1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
28 |
|
29 | function createCommonjsModule(fn, module) {
|
30 | return module = {
|
31 | exports: {}
|
32 | }, fn(module, module.exports), module.exports;
|
33 | }
|
34 |
|
35 | var check = function (it) {
|
36 | return it && it.Math == Math && it;
|
37 | };
|
38 |
|
39 |
|
40 | var global_1 =
|
41 | check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
42 | Function('return this')();
|
43 |
|
44 | var fails = function (exec) {
|
45 | try {
|
46 | return !!exec();
|
47 | } catch (error) {
|
48 | return true;
|
49 | }
|
50 | };
|
51 |
|
52 |
|
53 | var descriptors = !fails(function () {
|
54 | return Object.defineProperty({}, 'a', {
|
55 | get: function () {
|
56 | return 7;
|
57 | }
|
58 | }).a != 7;
|
59 | });
|
60 | var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
|
61 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
62 |
|
63 | var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({
|
64 | 1: 2
|
65 | }, 1);
|
66 |
|
67 |
|
68 | var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
69 | var descriptor = getOwnPropertyDescriptor(this, V);
|
70 | return !!descriptor && descriptor.enumerable;
|
71 | } : nativePropertyIsEnumerable;
|
72 | var objectPropertyIsEnumerable = {
|
73 | f: f
|
74 | };
|
75 |
|
76 | var createPropertyDescriptor = function (bitmap, value) {
|
77 | return {
|
78 | enumerable: !(bitmap & 1),
|
79 | configurable: !(bitmap & 2),
|
80 | writable: !(bitmap & 4),
|
81 | value: value
|
82 | };
|
83 | };
|
84 |
|
85 | var toString = {}.toString;
|
86 |
|
87 | var classofRaw = function (it) {
|
88 | return toString.call(it).slice(8, -1);
|
89 | };
|
90 |
|
91 | var split = ''.split;
|
92 |
|
93 | var indexedObject = fails(function () {
|
94 |
|
95 |
|
96 | return !Object('z').propertyIsEnumerable(0);
|
97 | }) ? function (it) {
|
98 | return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
|
99 | } : Object;
|
100 |
|
101 |
|
102 | var requireObjectCoercible = function (it) {
|
103 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
104 | return it;
|
105 | };
|
106 |
|
107 |
|
108 | var toIndexedObject = function (it) {
|
109 | return indexedObject(requireObjectCoercible(it));
|
110 | };
|
111 |
|
112 | var isObject = function (it) {
|
113 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
114 | };
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 | var toPrimitive = function (input, PREFERRED_STRING) {
|
121 | if (!isObject(input)) return input;
|
122 | var fn, val;
|
123 | if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
124 | if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
|
125 | if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
126 | throw TypeError("Can't convert object to primitive value");
|
127 | };
|
128 |
|
129 | var hasOwnProperty = {}.hasOwnProperty;
|
130 |
|
131 | var has = function (it, key) {
|
132 | return hasOwnProperty.call(it, key);
|
133 | };
|
134 |
|
135 | var document$1 = global_1.document;
|
136 |
|
137 | var EXISTS = isObject(document$1) && isObject(document$1.createElement);
|
138 |
|
139 | var documentCreateElement = function (it) {
|
140 | return EXISTS ? document$1.createElement(it) : {};
|
141 | };
|
142 |
|
143 |
|
144 | var ie8DomDefine = !descriptors && !fails(function () {
|
145 | return Object.defineProperty(documentCreateElement('div'), 'a', {
|
146 | get: function () {
|
147 | return 7;
|
148 | }
|
149 | }).a != 7;
|
150 | });
|
151 | var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
152 |
|
153 |
|
154 | var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
155 | O = toIndexedObject(O);
|
156 | P = toPrimitive(P, true);
|
157 | if (ie8DomDefine) try {
|
158 | return nativeGetOwnPropertyDescriptor(O, P);
|
159 | } catch (error) {
|
160 |
|
161 | }
|
162 | if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
|
163 | };
|
164 | var objectGetOwnPropertyDescriptor = {
|
165 | f: f$1
|
166 | };
|
167 | var replacement = /#|\.prototype\./;
|
168 |
|
169 | var isForced = function (feature, detection) {
|
170 | var value = data[normalize(feature)];
|
171 | return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection;
|
172 | };
|
173 |
|
174 | var normalize = isForced.normalize = function (string) {
|
175 | return String(string).replace(replacement, '.').toLowerCase();
|
176 | };
|
177 |
|
178 | var data = isForced.data = {};
|
179 | var NATIVE = isForced.NATIVE = 'N';
|
180 | var POLYFILL = isForced.POLYFILL = 'P';
|
181 | var isForced_1 = isForced;
|
182 | var path = {};
|
183 |
|
184 | var aFunction = function (it) {
|
185 | if (typeof it != 'function') {
|
186 | throw TypeError(String(it) + ' is not a function');
|
187 | }
|
188 |
|
189 | return it;
|
190 | };
|
191 |
|
192 |
|
193 | var bindContext = function (fn, that, length) {
|
194 | aFunction(fn);
|
195 | if (that === undefined) return fn;
|
196 |
|
197 | switch (length) {
|
198 | case 0:
|
199 | return function () {
|
200 | return fn.call(that);
|
201 | };
|
202 |
|
203 | case 1:
|
204 | return function (a) {
|
205 | return fn.call(that, a);
|
206 | };
|
207 |
|
208 | case 2:
|
209 | return function (a, b) {
|
210 | return fn.call(that, a, b);
|
211 | };
|
212 |
|
213 | case 3:
|
214 | return function (a, b, c) {
|
215 | return fn.call(that, a, b, c);
|
216 | };
|
217 | }
|
218 |
|
219 | return function ()
|
220 | /* ...args */
|
221 | {
|
222 | return fn.apply(that, arguments);
|
223 | };
|
224 | };
|
225 |
|
226 | var anObject = function (it) {
|
227 | if (!isObject(it)) {
|
228 | throw TypeError(String(it) + ' is not an object');
|
229 | }
|
230 |
|
231 | return it;
|
232 | };
|
233 |
|
234 | var nativeDefineProperty = Object.defineProperty;
|
235 |
|
236 |
|
237 | var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
|
238 | anObject(O);
|
239 | P = toPrimitive(P, true);
|
240 | anObject(Attributes);
|
241 | if (ie8DomDefine) try {
|
242 | return nativeDefineProperty(O, P, Attributes);
|
243 | } catch (error) {
|
244 |
|
245 | }
|
246 | if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
247 | if ('value' in Attributes) O[P] = Attributes.value;
|
248 | return O;
|
249 | };
|
250 | var objectDefineProperty = {
|
251 | f: f$2
|
252 | };
|
253 | var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
254 | return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
255 | } : function (object, key, value) {
|
256 | object[key] = value;
|
257 | return object;
|
258 | };
|
259 | var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
260 |
|
261 | var wrapConstructor = function (NativeConstructor) {
|
262 | var Wrapper = function (a, b, c) {
|
263 | if (this instanceof NativeConstructor) {
|
264 | switch (arguments.length) {
|
265 | case 0:
|
266 | return new NativeConstructor();
|
267 |
|
268 | case 1:
|
269 | return new NativeConstructor(a);
|
270 |
|
271 | case 2:
|
272 | return new NativeConstructor(a, b);
|
273 | }
|
274 |
|
275 | return new NativeConstructor(a, b, c);
|
276 | }
|
277 |
|
278 | return NativeConstructor.apply(this, arguments);
|
279 | };
|
280 |
|
281 | Wrapper.prototype = NativeConstructor.prototype;
|
282 | return Wrapper;
|
283 | };
|
284 |
|
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 | var _export = function (options, source) {
|
301 | var TARGET = options.target;
|
302 | var GLOBAL = options.global;
|
303 | var STATIC = options.stat;
|
304 | var PROTO = options.proto;
|
305 | var nativeSource = GLOBAL ? global_1 : STATIC ? global_1[TARGET] : (global_1[TARGET] || {}).prototype;
|
306 | var target = GLOBAL ? path : path[TARGET] || (path[TARGET] = {});
|
307 | var targetPrototype = target.prototype;
|
308 | var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
|
309 | var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
|
310 |
|
311 | for (key in source) {
|
312 | FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
313 |
|
314 | USE_NATIVE = !FORCED && nativeSource && has(nativeSource, key);
|
315 | targetProperty = target[key];
|
316 | if (USE_NATIVE) if (options.noTargetGet) {
|
317 | descriptor = getOwnPropertyDescriptor$1(nativeSource, key);
|
318 | nativeProperty = descriptor && descriptor.value;
|
319 | } else nativeProperty = nativeSource[key];
|
320 |
|
321 | sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key];
|
322 | if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue;
|
323 |
|
324 | if (options.bind && USE_NATIVE) resultProperty = bindContext(sourceProperty, global_1);
|
325 | else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
|
326 | else if (PROTO && typeof sourceProperty == 'function') resultProperty = bindContext(Function.call, sourceProperty);
|
327 | else resultProperty = sourceProperty;
|
328 |
|
329 | if (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) {
|
330 | createNonEnumerableProperty(resultProperty, 'sham', true);
|
331 | }
|
332 |
|
333 | target[key] = resultProperty;
|
334 |
|
335 | if (PROTO) {
|
336 | VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
|
337 |
|
338 | if (!has(path, VIRTUAL_PROTOTYPE)) {
|
339 | createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});
|
340 | }
|
341 |
|
342 |
|
343 | path[VIRTUAL_PROTOTYPE][key] = sourceProperty;
|
344 |
|
345 | if (options.real && targetPrototype && !targetPrototype[key]) {
|
346 | createNonEnumerableProperty(targetPrototype, key, sourceProperty);
|
347 | }
|
348 | }
|
349 | }
|
350 | };
|
351 |
|
352 |
|
353 |
|
354 | _export({
|
355 | target: 'Object',
|
356 | stat: true,
|
357 | forced: !descriptors,
|
358 | sham: !descriptors
|
359 | }, {
|
360 | defineProperty: objectDefineProperty.f
|
361 | });
|
362 |
|
363 | var defineProperty_1 = createCommonjsModule(function (module) {
|
364 | var Object = path.Object;
|
365 |
|
366 | var defineProperty = module.exports = function defineProperty(it, key, desc) {
|
367 | return Object.defineProperty(it, key, desc);
|
368 | };
|
369 |
|
370 | if (Object.defineProperty.sham) defineProperty.sham = true;
|
371 | });
|
372 | var defineProperty = defineProperty_1;
|
373 | var defineProperty$1 = defineProperty;
|
374 | var ceil = Math.ceil;
|
375 | var floor = Math.floor;
|
376 |
|
377 |
|
378 | var toInteger = function (argument) {
|
379 | return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
|
380 | };
|
381 |
|
382 | var min = Math.min;
|
383 |
|
384 |
|
385 | var toLength = function (argument) {
|
386 | return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0;
|
387 | };
|
388 |
|
389 | var max = Math.max;
|
390 | var min$1 = Math.min;
|
391 |
|
392 |
|
393 |
|
394 | var toAbsoluteIndex = function (index, length) {
|
395 | var integer = toInteger(index);
|
396 | return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
397 | };
|
398 |
|
399 |
|
400 | var createMethod = function (IS_INCLUDES) {
|
401 | return function ($this, el, fromIndex) {
|
402 | var O = toIndexedObject($this);
|
403 | var length = toLength(O.length);
|
404 | var index = toAbsoluteIndex(fromIndex, length);
|
405 | var value;
|
406 |
|
407 |
|
408 | if (IS_INCLUDES && el != el) while (length > index) {
|
409 | value = O[index++];
|
410 |
|
411 | if (value != value) return true;
|
412 | } else for (; length > index; index++) {
|
413 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
414 | }
|
415 | return !IS_INCLUDES && -1;
|
416 | };
|
417 | };
|
418 |
|
419 | var arrayIncludes = {
|
420 |
|
421 |
|
422 | includes: createMethod(true),
|
423 |
|
424 |
|
425 | indexOf: createMethod(false)
|
426 | };
|
427 | var hiddenKeys = {};
|
428 | var indexOf = arrayIncludes.indexOf;
|
429 |
|
430 | var objectKeysInternal = function (object, names) {
|
431 | var O = toIndexedObject(object);
|
432 | var i = 0;
|
433 | var result = [];
|
434 | var key;
|
435 |
|
436 | for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
|
437 |
|
438 |
|
439 | while (names.length > i) if (has(O, key = names[i++])) {
|
440 | ~indexOf(result, key) || result.push(key);
|
441 | }
|
442 |
|
443 | return result;
|
444 | };
|
445 |
|
446 |
|
447 | var enumBugKeys = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
|
448 |
|
449 |
|
450 | var objectKeys = Object.keys || function keys(O) {
|
451 | return objectKeysInternal(O, enumBugKeys);
|
452 | };
|
453 |
|
454 |
|
455 |
|
456 | var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
|
457 | anObject(O);
|
458 | var keys = objectKeys(Properties);
|
459 | var length = keys.length;
|
460 | var index = 0;
|
461 | var key;
|
462 |
|
463 | while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
|
464 |
|
465 | return O;
|
466 | };
|
467 |
|
468 |
|
469 | _export({
|
470 | target: 'Object',
|
471 | stat: true,
|
472 | forced: !descriptors,
|
473 | sham: !descriptors
|
474 | }, {
|
475 | defineProperties: objectDefineProperties
|
476 | });
|
477 |
|
478 | var defineProperties_1 = createCommonjsModule(function (module) {
|
479 | var Object = path.Object;
|
480 |
|
481 | var defineProperties = module.exports = function defineProperties(T, D) {
|
482 | return Object.defineProperties(T, D);
|
483 | };
|
484 |
|
485 | if (Object.defineProperties.sham) defineProperties.sham = true;
|
486 | });
|
487 | var defineProperties = defineProperties_1;
|
488 | var defineProperties$1 = defineProperties;
|
489 |
|
490 | var aFunction$1 = function (variable) {
|
491 | return typeof variable == 'function' ? variable : undefined;
|
492 | };
|
493 |
|
494 | var getBuiltIn = function (namespace, method) {
|
495 | return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace]) : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
|
496 | };
|
497 |
|
498 | var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
499 |
|
500 |
|
501 | var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
502 | return objectKeysInternal(O, hiddenKeys$1);
|
503 | };
|
504 |
|
505 | var objectGetOwnPropertyNames = {
|
506 | f: f$3
|
507 | };
|
508 | var f$4 = Object.getOwnPropertySymbols;
|
509 | var objectGetOwnPropertySymbols = {
|
510 | f: f$4
|
511 | };
|
512 |
|
513 | var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
514 | var keys = objectGetOwnPropertyNames.f(anObject(it));
|
515 | var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
516 | return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
517 | };
|
518 |
|
519 | var createProperty = function (object, key, value) {
|
520 | var propertyKey = toPrimitive(key);
|
521 | if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));else object[propertyKey] = value;
|
522 | };
|
523 |
|
524 |
|
525 |
|
526 | _export({
|
527 | target: 'Object',
|
528 | stat: true,
|
529 | sham: !descriptors
|
530 | }, {
|
531 | getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
|
532 | var O = toIndexedObject(object);
|
533 | var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
534 | var keys = ownKeys(O);
|
535 | var result = {};
|
536 | var index = 0;
|
537 | var key, descriptor;
|
538 |
|
539 | while (keys.length > index) {
|
540 | descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
|
541 | if (descriptor !== undefined) createProperty(result, key, descriptor);
|
542 | }
|
543 |
|
544 | return result;
|
545 | }
|
546 | });
|
547 |
|
548 | var getOwnPropertyDescriptors = path.Object.getOwnPropertyDescriptors;
|
549 | var getOwnPropertyDescriptors$1 = getOwnPropertyDescriptors;
|
550 | var getOwnPropertyDescriptors$2 = getOwnPropertyDescriptors$1;
|
551 | var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
552 | var FAILS_ON_PRIMITIVES = fails(function () {
|
553 | nativeGetOwnPropertyDescriptor$1(1);
|
554 | });
|
555 | var FORCED = !descriptors || FAILS_ON_PRIMITIVES;
|
556 |
|
557 |
|
558 | _export({
|
559 | target: 'Object',
|
560 | stat: true,
|
561 | forced: FORCED,
|
562 | sham: !descriptors
|
563 | }, {
|
564 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
|
565 | return nativeGetOwnPropertyDescriptor$1(toIndexedObject(it), key);
|
566 | }
|
567 | });
|
568 |
|
569 | var getOwnPropertyDescriptor_1 = createCommonjsModule(function (module) {
|
570 | var Object = path.Object;
|
571 |
|
572 | var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
|
573 | return Object.getOwnPropertyDescriptor(it, key);
|
574 | };
|
575 |
|
576 | if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
|
577 | });
|
578 | var getOwnPropertyDescriptor$2 = getOwnPropertyDescriptor_1;
|
579 | var getOwnPropertyDescriptor$3 = getOwnPropertyDescriptor$2;
|
580 | var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
581 |
|
582 |
|
583 | return !String(Symbol());
|
584 | });
|
585 |
|
586 |
|
587 | var isArray = Array.isArray || function isArray(arg) {
|
588 | return classofRaw(arg) == 'Array';
|
589 | };
|
590 |
|
591 |
|
592 |
|
593 | var toObject = function (argument) {
|
594 | return Object(requireObjectCoercible(argument));
|
595 | };
|
596 |
|
597 | var html = getBuiltIn('document', 'documentElement');
|
598 |
|
599 | var setGlobal = function (key, value) {
|
600 | try {
|
601 | createNonEnumerableProperty(global_1, key, value);
|
602 | } catch (error) {
|
603 | global_1[key] = value;
|
604 | }
|
605 |
|
606 | return value;
|
607 | };
|
608 |
|
609 | var SHARED = '__core-js_shared__';
|
610 | var store = global_1[SHARED] || setGlobal(SHARED, {});
|
611 | var sharedStore = store;
|
612 | var shared = createCommonjsModule(function (module) {
|
613 | (module.exports = function (key, value) {
|
614 | return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
615 | })('versions', []).push({
|
616 | version: '3.4.1',
|
617 | mode: 'pure',
|
618 | copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
619 | });
|
620 | });
|
621 | var id = 0;
|
622 | var postfix = Math.random();
|
623 |
|
624 | var uid = function (key) {
|
625 | return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
626 | };
|
627 |
|
628 | var keys = shared('keys');
|
629 |
|
630 | var sharedKey = function (key) {
|
631 | return keys[key] || (keys[key] = uid(key));
|
632 | };
|
633 |
|
634 | var IE_PROTO = sharedKey('IE_PROTO');
|
635 | var PROTOTYPE = 'prototype';
|
636 |
|
637 | var Empty = function () {
|
638 |
|
639 | };
|
640 |
|
641 |
|
642 | var createDict = function () {
|
643 |
|
644 | var iframe = documentCreateElement('iframe');
|
645 | var length = enumBugKeys.length;
|
646 | var lt = '<';
|
647 | var script = 'script';
|
648 | var gt = '>';
|
649 | var js = 'java' + script + ':';
|
650 | var iframeDocument;
|
651 | iframe.style.display = 'none';
|
652 | html.appendChild(iframe);
|
653 | iframe.src = String(js);
|
654 | iframeDocument = iframe.contentWindow.document;
|
655 | iframeDocument.open();
|
656 | iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
|
657 | iframeDocument.close();
|
658 | createDict = iframeDocument.F;
|
659 |
|
660 | while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
|
661 |
|
662 | return createDict();
|
663 | };
|
664 |
|
665 |
|
666 |
|
667 | var objectCreate = Object.create || function create(O, Properties) {
|
668 | var result;
|
669 |
|
670 | if (O !== null) {
|
671 | Empty[PROTOTYPE] = anObject(O);
|
672 | result = new Empty();
|
673 | Empty[PROTOTYPE] = null;
|
674 |
|
675 | result[IE_PROTO] = O;
|
676 | } else result = createDict();
|
677 |
|
678 | return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
679 | };
|
680 |
|
681 | hiddenKeys[IE_PROTO] = true;
|
682 | var nativeGetOwnPropertyNames = objectGetOwnPropertyNames.f;
|
683 | var toString$1 = {}.toString;
|
684 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
|
685 |
|
686 | var getWindowNames = function (it) {
|
687 | try {
|
688 | return nativeGetOwnPropertyNames(it);
|
689 | } catch (error) {
|
690 | return windowNames.slice();
|
691 | }
|
692 | };
|
693 |
|
694 |
|
695 | var f$5 = function getOwnPropertyNames(it) {
|
696 | return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : nativeGetOwnPropertyNames(toIndexedObject(it));
|
697 | };
|
698 |
|
699 | var objectGetOwnPropertyNamesExternal = {
|
700 | f: f$5
|
701 | };
|
702 |
|
703 | var redefine = function (target, key, value, options) {
|
704 | if (options && options.enumerable) target[key] = value;else createNonEnumerableProperty(target, key, value);
|
705 | };
|
706 |
|
707 | var Symbol$1 = global_1.Symbol;
|
708 | var store$1 = shared('wks');
|
709 |
|
710 | var wellKnownSymbol = function (name) {
|
711 | return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name] || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
|
712 | };
|
713 |
|
714 | var f$6 = wellKnownSymbol;
|
715 | var wrappedWellKnownSymbol = {
|
716 | f: f$6
|
717 | };
|
718 | var defineProperty$2 = objectDefineProperty.f;
|
719 |
|
720 | var defineWellKnownSymbol = function (NAME) {
|
721 | var Symbol = path.Symbol || (path.Symbol = {});
|
722 | if (!has(Symbol, NAME)) defineProperty$2(Symbol, NAME, {
|
723 | value: wrappedWellKnownSymbol.f(NAME)
|
724 | });
|
725 | };
|
726 |
|
727 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
728 |
|
729 | var CORRECT_ARGUMENTS = classofRaw(function () {
|
730 | return arguments;
|
731 | }()) == 'Arguments';
|
732 |
|
733 | var tryGet = function (it, key) {
|
734 | try {
|
735 | return it[key];
|
736 | } catch (error) {
|
737 |
|
738 | }
|
739 | };
|
740 |
|
741 |
|
742 | var classof = function (it) {
|
743 | var O, tag, result;
|
744 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
745 | : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
|
746 | : CORRECT_ARGUMENTS ? classofRaw(O)
|
747 | : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
|
748 | };
|
749 |
|
750 | var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
751 | var test = {};
|
752 | test[TO_STRING_TAG$1] = 'z';
|
753 |
|
754 |
|
755 | var objectToString = String(test) !== '[object z]' ? function toString() {
|
756 | return '[object ' + classof(this) + ']';
|
757 | } : test.toString;
|
758 | var defineProperty$3 = objectDefineProperty.f;
|
759 | var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
760 | var METHOD_REQUIRED = objectToString !== {}.toString;
|
761 |
|
762 | var setToStringTag = function (it, TAG, STATIC, SET_METHOD) {
|
763 | if (it) {
|
764 | var target = STATIC ? it : it.prototype;
|
765 |
|
766 | if (!has(target, TO_STRING_TAG$2)) {
|
767 | defineProperty$3(target, TO_STRING_TAG$2, {
|
768 | configurable: true,
|
769 | value: TAG
|
770 | });
|
771 | }
|
772 |
|
773 | if (SET_METHOD && METHOD_REQUIRED) {
|
774 | createNonEnumerableProperty(target, 'toString', objectToString);
|
775 | }
|
776 | }
|
777 | };
|
778 |
|
779 | var functionToString = shared('native-function-to-string', Function.toString);
|
780 | var WeakMap = global_1.WeakMap;
|
781 | var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap));
|
782 | var WeakMap$1 = global_1.WeakMap;
|
783 | var set, get, has$1;
|
784 |
|
785 | var enforce = function (it) {
|
786 | return has$1(it) ? get(it) : set(it, {});
|
787 | };
|
788 |
|
789 | var getterFor = function (TYPE) {
|
790 | return function (it) {
|
791 | var state;
|
792 |
|
793 | if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
794 | throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
795 | }
|
796 |
|
797 | return state;
|
798 | };
|
799 | };
|
800 |
|
801 | if (nativeWeakMap) {
|
802 | var store$2 = new WeakMap$1();
|
803 | var wmget = store$2.get;
|
804 | var wmhas = store$2.has;
|
805 | var wmset = store$2.set;
|
806 |
|
807 | set = function (it, metadata) {
|
808 | wmset.call(store$2, it, metadata);
|
809 | return metadata;
|
810 | };
|
811 |
|
812 | get = function (it) {
|
813 | return wmget.call(store$2, it) || {};
|
814 | };
|
815 |
|
816 | has$1 = function (it) {
|
817 | return wmhas.call(store$2, it);
|
818 | };
|
819 | } else {
|
820 | var STATE = sharedKey('state');
|
821 | hiddenKeys[STATE] = true;
|
822 |
|
823 | set = function (it, metadata) {
|
824 | createNonEnumerableProperty(it, STATE, metadata);
|
825 | return metadata;
|
826 | };
|
827 |
|
828 | get = function (it) {
|
829 | return has(it, STATE) ? it[STATE] : {};
|
830 | };
|
831 |
|
832 | has$1 = function (it) {
|
833 | return has(it, STATE);
|
834 | };
|
835 | }
|
836 |
|
837 | var internalState = {
|
838 | set: set,
|
839 | get: get,
|
840 | has: has$1,
|
841 | enforce: enforce,
|
842 | getterFor: getterFor
|
843 | };
|
844 | var SPECIES = wellKnownSymbol('species'); // `ArraySpeciesCreate` abstract operation
|
845 | // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
|
846 |
|
847 | var arraySpeciesCreate = function (originalArray, length) {
|
848 | var C;
|
849 |
|
850 | if (isArray(originalArray)) {
|
851 | C = originalArray.constructor;
|
852 |
|
853 | if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;else if (isObject(C)) {
|
854 | C = C[SPECIES];
|
855 | if (C === null) C = undefined;
|
856 | }
|
857 | }
|
858 |
|
859 | return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
860 | };
|
861 |
|
862 | var push = [].push;
|
863 |
|
864 | var createMethod$1 = function (TYPE) {
|
865 | var IS_MAP = TYPE == 1;
|
866 | var IS_FILTER = TYPE == 2;
|
867 | var IS_SOME = TYPE == 3;
|
868 | var IS_EVERY = TYPE == 4;
|
869 | var IS_FIND_INDEX = TYPE == 6;
|
870 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
871 | return function ($this, callbackfn, that, specificCreate) {
|
872 | var O = toObject($this);
|
873 | var self = indexedObject(O);
|
874 | var boundFunction = bindContext(callbackfn, that, 3);
|
875 | var length = toLength(self.length);
|
876 | var index = 0;
|
877 | var create = specificCreate || arraySpeciesCreate;
|
878 | var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
|
879 | var value, result;
|
880 |
|
881 | for (; length > index; index++) if (NO_HOLES || index in self) {
|
882 | value = self[index];
|
883 | result = boundFunction(value, index, O);
|
884 |
|
885 | if (TYPE) {
|
886 | if (IS_MAP) target[index] = result;
|
887 | else if (result) switch (TYPE) {
|
888 | case 3:
|
889 | return true;
|
890 |
|
891 |
|
892 | case 5:
|
893 | return value;
|
894 |
|
895 |
|
896 | case 6:
|
897 | return index;
|
898 |
|
899 |
|
900 | case 2:
|
901 | push.call(target, value);
|
902 |
|
903 | } else if (IS_EVERY) return false;
|
904 | }
|
905 | }
|
906 |
|
907 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
908 | };
|
909 | };
|
910 |
|
911 | var arrayIteration = {
|
912 |
|
913 |
|
914 | forEach: createMethod$1(0),
|
915 |
|
916 |
|
917 | map: createMethod$1(1),
|
918 |
|
919 |
|
920 | filter: createMethod$1(2),
|
921 |
|
922 |
|
923 | some: createMethod$1(3),
|
924 |
|
925 |
|
926 | every: createMethod$1(4),
|
927 |
|
928 |
|
929 | find: createMethod$1(5),
|
930 |
|
931 |
|
932 | findIndex: createMethod$1(6)
|
933 | };
|
934 | var $forEach = arrayIteration.forEach;
|
935 | var HIDDEN = sharedKey('hidden');
|
936 | var SYMBOL = 'Symbol';
|
937 | var PROTOTYPE$1 = 'prototype';
|
938 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
939 | var setInternalState = internalState.set;
|
940 | var getInternalState = internalState.getterFor(SYMBOL);
|
941 | var ObjectPrototype = Object[PROTOTYPE$1];
|
942 | var $Symbol = global_1.Symbol;
|
943 | var $stringify = getBuiltIn('JSON', 'stringify');
|
944 | var nativeGetOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
|
945 | var nativeDefineProperty$1 = objectDefineProperty.f;
|
946 | var nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f;
|
947 | var nativePropertyIsEnumerable$1 = objectPropertyIsEnumerable.f;
|
948 | var AllSymbols = shared('symbols');
|
949 | var ObjectPrototypeSymbols = shared('op-symbols');
|
950 | var StringToSymbolRegistry = shared('string-to-symbol-registry');
|
951 | var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
952 | var WellKnownSymbolsStore = shared('wks');
|
953 | var QObject = global_1.QObject;
|
954 |
|
955 | var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild;
|
956 |
|
957 | var setSymbolDescriptor = descriptors && fails(function () {
|
958 | return objectCreate(nativeDefineProperty$1({}, 'a', {
|
959 | get: function () {
|
960 | return nativeDefineProperty$1(this, 'a', {
|
961 | value: 7
|
962 | }).a;
|
963 | }
|
964 | })).a != 7;
|
965 | }) ? function (O, P, Attributes) {
|
966 | var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$2(ObjectPrototype, P);
|
967 | if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
|
968 | nativeDefineProperty$1(O, P, Attributes);
|
969 |
|
970 | if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
|
971 | nativeDefineProperty$1(ObjectPrototype, P, ObjectPrototypeDescriptor);
|
972 | }
|
973 | } : nativeDefineProperty$1;
|
974 |
|
975 | var wrap = function (tag, description) {
|
976 | var symbol = AllSymbols[tag] = objectCreate($Symbol[PROTOTYPE$1]);
|
977 | setInternalState(symbol, {
|
978 | type: SYMBOL,
|
979 | tag: tag,
|
980 | description: description
|
981 | });
|
982 | if (!descriptors) symbol.description = description;
|
983 | return symbol;
|
984 | };
|
985 |
|
986 | var isSymbol = nativeSymbol && typeof $Symbol.iterator == 'symbol' ? function (it) {
|
987 | return typeof it == 'symbol';
|
988 | } : function (it) {
|
989 | return Object(it) instanceof $Symbol;
|
990 | };
|
991 |
|
992 | var $defineProperty = function defineProperty(O, P, Attributes) {
|
993 | if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
|
994 | anObject(O);
|
995 | var key = toPrimitive(P, true);
|
996 | anObject(Attributes);
|
997 |
|
998 | if (has(AllSymbols, key)) {
|
999 | if (!Attributes.enumerable) {
|
1000 | if (!has(O, HIDDEN)) nativeDefineProperty$1(O, HIDDEN, createPropertyDescriptor(1, {}));
|
1001 | O[HIDDEN][key] = true;
|
1002 | } else {
|
1003 | if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
|
1004 | Attributes = objectCreate(Attributes, {
|
1005 | enumerable: createPropertyDescriptor(0, false)
|
1006 | });
|
1007 | }
|
1008 |
|
1009 | return setSymbolDescriptor(O, key, Attributes);
|
1010 | }
|
1011 |
|
1012 | return nativeDefineProperty$1(O, key, Attributes);
|
1013 | };
|
1014 |
|
1015 | var $defineProperties = function defineProperties(O, Properties) {
|
1016 | anObject(O);
|
1017 | var properties = toIndexedObject(Properties);
|
1018 | var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
|
1019 | $forEach(keys, function (key) {
|
1020 | if (!descriptors || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
|
1021 | });
|
1022 | return O;
|
1023 | };
|
1024 |
|
1025 | var $create = function create(O, Properties) {
|
1026 | return Properties === undefined ? objectCreate(O) : $defineProperties(objectCreate(O), Properties);
|
1027 | };
|
1028 |
|
1029 | var $propertyIsEnumerable = function propertyIsEnumerable(V) {
|
1030 | var P = toPrimitive(V, true);
|
1031 | var enumerable = nativePropertyIsEnumerable$1.call(this, P);
|
1032 | if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
|
1033 | return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
|
1034 | };
|
1035 |
|
1036 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
|
1037 | var it = toIndexedObject(O);
|
1038 | var key = toPrimitive(P, true);
|
1039 | if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
|
1040 | var descriptor = nativeGetOwnPropertyDescriptor$2(it, key);
|
1041 |
|
1042 | if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
|
1043 | descriptor.enumerable = true;
|
1044 | }
|
1045 |
|
1046 | return descriptor;
|
1047 | };
|
1048 |
|
1049 | var $getOwnPropertyNames = function getOwnPropertyNames(O) {
|
1050 | var names = nativeGetOwnPropertyNames$1(toIndexedObject(O));
|
1051 | var result = [];
|
1052 | $forEach(names, function (key) {
|
1053 | if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
|
1054 | });
|
1055 | return result;
|
1056 | };
|
1057 |
|
1058 | var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
|
1059 | var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
|
1060 | var names = nativeGetOwnPropertyNames$1(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
|
1061 | var result = [];
|
1062 | $forEach(names, function (key) {
|
1063 | if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
|
1064 | result.push(AllSymbols[key]);
|
1065 | }
|
1066 | });
|
1067 | return result;
|
1068 | };
|
1069 |
|
1070 |
|
1071 |
|
1072 | if (!nativeSymbol) {
|
1073 | $Symbol = function Symbol() {
|
1074 | if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
|
1075 | var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
|
1076 | var tag = uid(description);
|
1077 |
|
1078 | var setter = function (value) {
|
1079 | if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
|
1080 | if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
1081 | setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
|
1082 | };
|
1083 |
|
1084 | if (descriptors && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, {
|
1085 | configurable: true,
|
1086 | set: setter
|
1087 | });
|
1088 | return wrap(tag, description);
|
1089 | };
|
1090 |
|
1091 | redefine($Symbol[PROTOTYPE$1], 'toString', function toString() {
|
1092 | return getInternalState(this).tag;
|
1093 | });
|
1094 | objectPropertyIsEnumerable.f = $propertyIsEnumerable;
|
1095 | objectDefineProperty.f = $defineProperty;
|
1096 | objectGetOwnPropertyDescriptor.f = $getOwnPropertyDescriptor;
|
1097 | objectGetOwnPropertyNames.f = objectGetOwnPropertyNamesExternal.f = $getOwnPropertyNames;
|
1098 | objectGetOwnPropertySymbols.f = $getOwnPropertySymbols;
|
1099 |
|
1100 | if (descriptors) {
|
1101 |
|
1102 | nativeDefineProperty$1($Symbol[PROTOTYPE$1], 'description', {
|
1103 | configurable: true,
|
1104 | get: function description() {
|
1105 | return getInternalState(this).description;
|
1106 | }
|
1107 | });
|
1108 | }
|
1109 |
|
1110 | wrappedWellKnownSymbol.f = function (name) {
|
1111 | return wrap(wellKnownSymbol(name), name);
|
1112 | };
|
1113 | }
|
1114 |
|
1115 | _export({
|
1116 | global: true,
|
1117 | wrap: true,
|
1118 | forced: !nativeSymbol,
|
1119 | sham: !nativeSymbol
|
1120 | }, {
|
1121 | Symbol: $Symbol
|
1122 | });
|
1123 |
|
1124 | $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
|
1125 | defineWellKnownSymbol(name);
|
1126 | });
|
1127 |
|
1128 | _export({
|
1129 | target: SYMBOL,
|
1130 | stat: true,
|
1131 | forced: !nativeSymbol
|
1132 | }, {
|
1133 |
|
1134 |
|
1135 | 'for': function (key) {
|
1136 | var string = String(key);
|
1137 | if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
|
1138 | var symbol = $Symbol(string);
|
1139 | StringToSymbolRegistry[string] = symbol;
|
1140 | SymbolToStringRegistry[symbol] = string;
|
1141 | return symbol;
|
1142 | },
|
1143 |
|
1144 |
|
1145 | keyFor: function keyFor(sym) {
|
1146 | if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
|
1147 | if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
|
1148 | },
|
1149 | useSetter: function () {
|
1150 | USE_SETTER = true;
|
1151 | },
|
1152 | useSimple: function () {
|
1153 | USE_SETTER = false;
|
1154 | }
|
1155 | });
|
1156 |
|
1157 | _export({
|
1158 | target: 'Object',
|
1159 | stat: true,
|
1160 | forced: !nativeSymbol,
|
1161 | sham: !descriptors
|
1162 | }, {
|
1163 |
|
1164 |
|
1165 | create: $create,
|
1166 |
|
1167 |
|
1168 | defineProperty: $defineProperty,
|
1169 |
|
1170 |
|
1171 | defineProperties: $defineProperties,
|
1172 |
|
1173 |
|
1174 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor
|
1175 | });
|
1176 |
|
1177 | _export({
|
1178 | target: 'Object',
|
1179 | stat: true,
|
1180 | forced: !nativeSymbol
|
1181 | }, {
|
1182 |
|
1183 |
|
1184 | getOwnPropertyNames: $getOwnPropertyNames,
|
1185 |
|
1186 |
|
1187 | getOwnPropertySymbols: $getOwnPropertySymbols
|
1188 | });
|
1189 |
|
1190 |
|
1191 |
|
1192 | _export({
|
1193 | target: 'Object',
|
1194 | stat: true,
|
1195 | forced: fails(function () {
|
1196 | objectGetOwnPropertySymbols.f(1);
|
1197 | })
|
1198 | }, {
|
1199 | getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
1200 | return objectGetOwnPropertySymbols.f(toObject(it));
|
1201 | }
|
1202 | });
|
1203 |
|
1204 |
|
1205 |
|
1206 | if ($stringify) {
|
1207 | var FORCED_JSON_STRINGIFY = !nativeSymbol || fails(function () {
|
1208 | var symbol = $Symbol();
|
1209 |
|
1210 | return $stringify([symbol]) != '[null]'
|
1211 | || $stringify({
|
1212 | a: symbol
|
1213 | }) != '{}'
|
1214 | || $stringify(Object(symbol)) != '{}';
|
1215 | });
|
1216 |
|
1217 | _export({
|
1218 | target: 'JSON',
|
1219 | stat: true,
|
1220 | forced: FORCED_JSON_STRINGIFY
|
1221 | }, {
|
1222 |
|
1223 | stringify: function stringify(it, replacer, space) {
|
1224 | var args = [it];
|
1225 | var index = 1;
|
1226 | var $replacer;
|
1227 |
|
1228 | while (arguments.length > index) args.push(arguments[index++]);
|
1229 |
|
1230 | $replacer = replacer;
|
1231 | if (!isObject(replacer) && it === undefined || isSymbol(it)) return;
|
1232 |
|
1233 | if (!isArray(replacer)) replacer = function (key, value) {
|
1234 | if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
1235 | if (!isSymbol(value)) return value;
|
1236 | };
|
1237 | args[1] = replacer;
|
1238 | return $stringify.apply(null, args);
|
1239 | }
|
1240 | });
|
1241 | }
|
1242 |
|
1243 |
|
1244 |
|
1245 | if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) {
|
1246 | createNonEnumerableProperty($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf);
|
1247 | }
|
1248 |
|
1249 |
|
1250 |
|
1251 | setToStringTag($Symbol, SYMBOL);
|
1252 | hiddenKeys[HIDDEN] = true;
|
1253 | var getOwnPropertySymbols = path.Object.getOwnPropertySymbols;
|
1254 | var getOwnPropertySymbols$1 = getOwnPropertySymbols;
|
1255 | var getOwnPropertySymbols$2 = getOwnPropertySymbols$1;
|
1256 | var iterators = {};
|
1257 | var correctPrototypeGetter = !fails(function () {
|
1258 | function F() {
|
1259 |
|
1260 | }
|
1261 |
|
1262 | F.prototype.constructor = null;
|
1263 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
1264 | });
|
1265 | var IE_PROTO$1 = sharedKey('IE_PROTO');
|
1266 | var ObjectPrototype$1 = Object.prototype;
|
1267 |
|
1268 |
|
1269 | var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
|
1270 | O = toObject(O);
|
1271 | if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
|
1272 |
|
1273 | if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
1274 | return O.constructor.prototype;
|
1275 | }
|
1276 |
|
1277 | return O instanceof Object ? ObjectPrototype$1 : null;
|
1278 | };
|
1279 | var ITERATOR = wellKnownSymbol('iterator');
|
1280 | var BUGGY_SAFARI_ITERATORS = false;
|
1281 |
|
1282 |
|
1283 | var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
1284 |
|
1285 | if ([].keys) {
|
1286 | arrayIterator = [].keys();
|
1287 |
|
1288 | if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;else {
|
1289 | PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
|
1290 | if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
|
1291 | }
|
1292 | }
|
1293 |
|
1294 | if (IteratorPrototype == undefined) IteratorPrototype = {};
|
1295 | var iteratorsCore = {
|
1296 | IteratorPrototype: IteratorPrototype,
|
1297 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
1298 | };
|
1299 | var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
1300 |
|
1301 | var returnThis = function () {
|
1302 | return this;
|
1303 | };
|
1304 |
|
1305 | var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
|
1306 | var TO_STRING_TAG = NAME + ' Iterator';
|
1307 | IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, {
|
1308 | next: createPropertyDescriptor(1, next)
|
1309 | });
|
1310 | setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
|
1311 | iterators[TO_STRING_TAG] = returnThis;
|
1312 | return IteratorConstructor;
|
1313 | };
|
1314 |
|
1315 | var aPossiblePrototype = function (it) {
|
1316 | if (!isObject(it) && it !== null) {
|
1317 | throw TypeError("Can't set " + String(it) + ' as a prototype');
|
1318 | }
|
1319 |
|
1320 | return it;
|
1321 | };
|
1322 |
|
1323 |
|
1324 |
|
1325 |
|
1326 |
|
1327 |
|
1328 | var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
1329 | var CORRECT_SETTER = false;
|
1330 | var test = {};
|
1331 | var setter;
|
1332 |
|
1333 | try {
|
1334 | setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
|
1335 | setter.call(test, []);
|
1336 | CORRECT_SETTER = test instanceof Array;
|
1337 | } catch (error) {
|
1338 |
|
1339 | }
|
1340 |
|
1341 | return function setPrototypeOf(O, proto) {
|
1342 | anObject(O);
|
1343 | aPossiblePrototype(proto);
|
1344 | if (CORRECT_SETTER) setter.call(O, proto);else O.__proto__ = proto;
|
1345 | return O;
|
1346 | };
|
1347 | }() : undefined);
|
1348 | var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
|
1349 | var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
|
1350 | var ITERATOR$1 = wellKnownSymbol('iterator');
|
1351 | var KEYS = 'keys';
|
1352 | var VALUES = 'values';
|
1353 | var ENTRIES = 'entries';
|
1354 |
|
1355 | var returnThis$1 = function () {
|
1356 | return this;
|
1357 | };
|
1358 |
|
1359 | var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
1360 | createIteratorConstructor(IteratorConstructor, NAME, next);
|
1361 |
|
1362 | var getIterationMethod = function (KIND) {
|
1363 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
1364 | if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) return IterablePrototype[KIND];
|
1365 |
|
1366 | switch (KIND) {
|
1367 | case KEYS:
|
1368 | return function keys() {
|
1369 | return new IteratorConstructor(this, KIND);
|
1370 | };
|
1371 |
|
1372 | case VALUES:
|
1373 | return function values() {
|
1374 | return new IteratorConstructor(this, KIND);
|
1375 | };
|
1376 |
|
1377 | case ENTRIES:
|
1378 | return function entries() {
|
1379 | return new IteratorConstructor(this, KIND);
|
1380 | };
|
1381 | }
|
1382 |
|
1383 | return function () {
|
1384 | return new IteratorConstructor(this);
|
1385 | };
|
1386 | };
|
1387 |
|
1388 | var TO_STRING_TAG = NAME + ' Iterator';
|
1389 | var INCORRECT_VALUES_NAME = false;
|
1390 | var IterablePrototype = Iterable.prototype;
|
1391 | var nativeIterator = IterablePrototype[ITERATOR$1] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT];
|
1392 | var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT);
|
1393 | var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
1394 | var CurrentIteratorPrototype, methods, KEY;
|
1395 |
|
1396 | if (anyNativeIterator) {
|
1397 | CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
|
1398 |
|
1399 | if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) {
|
1400 |
|
1401 | setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
|
1402 | iterators[TO_STRING_TAG] = returnThis$1;
|
1403 | }
|
1404 | }
|
1405 |
|
1406 |
|
1407 | if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
1408 | INCORRECT_VALUES_NAME = true;
|
1409 |
|
1410 | defaultIterator = function values() {
|
1411 | return nativeIterator.call(this);
|
1412 | };
|
1413 | }
|
1414 |
|
1415 |
|
1416 | if (FORCED && IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
1417 | createNonEnumerableProperty(IterablePrototype, ITERATOR$1, defaultIterator);
|
1418 | }
|
1419 |
|
1420 | iterators[NAME] = defaultIterator;
|
1421 |
|
1422 | if (DEFAULT) {
|
1423 | methods = {
|
1424 | values: getIterationMethod(VALUES),
|
1425 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
1426 | entries: getIterationMethod(ENTRIES)
|
1427 | };
|
1428 | if (FORCED) for (KEY in methods) {
|
1429 | if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
1430 | redefine(IterablePrototype, KEY, methods[KEY]);
|
1431 | }
|
1432 | } else _export({
|
1433 | target: NAME,
|
1434 | proto: true,
|
1435 | forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME
|
1436 | }, methods);
|
1437 | }
|
1438 |
|
1439 | return methods;
|
1440 | };
|
1441 |
|
1442 | var ARRAY_ITERATOR = 'Array Iterator';
|
1443 | var setInternalState$1 = internalState.set;
|
1444 | var getInternalState$1 = internalState.getterFor(ARRAY_ITERATOR);
|
1445 |
|
1446 |
|
1447 |
|
1448 |
|
1449 |
|
1450 |
|
1451 |
|
1452 |
|
1453 |
|
1454 |
|
1455 | var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
|
1456 | setInternalState$1(this, {
|
1457 | type: ARRAY_ITERATOR,
|
1458 | target: toIndexedObject(iterated),
|
1459 |
|
1460 | index: 0,
|
1461 |
|
1462 | kind: kind
|
1463 |
|
1464 | });
|
1465 |
|
1466 | }, function () {
|
1467 | var state = getInternalState$1(this);
|
1468 | var target = state.target;
|
1469 | var kind = state.kind;
|
1470 | var index = state.index++;
|
1471 |
|
1472 | if (!target || index >= target.length) {
|
1473 | state.target = undefined;
|
1474 | return {
|
1475 | value: undefined,
|
1476 | done: true
|
1477 | };
|
1478 | }
|
1479 |
|
1480 | if (kind == 'keys') return {
|
1481 | value: index,
|
1482 | done: false
|
1483 | };
|
1484 | if (kind == 'values') return {
|
1485 | value: target[index],
|
1486 | done: false
|
1487 | };
|
1488 | return {
|
1489 | value: [index, target[index]],
|
1490 | done: false
|
1491 | };
|
1492 | }, 'values');
|
1493 |
|
1494 |
|
1495 |
|
1496 | iterators.Arguments = iterators.Array;
|
1497 |
|
1498 |
|
1499 | var domIterables = {
|
1500 | CSSRuleList: 0,
|
1501 | CSSStyleDeclaration: 0,
|
1502 | CSSValueList: 0,
|
1503 | ClientRectList: 0,
|
1504 | DOMRectList: 0,
|
1505 | DOMStringList: 0,
|
1506 | DOMTokenList: 1,
|
1507 | DataTransferItemList: 0,
|
1508 | FileList: 0,
|
1509 | HTMLAllCollection: 0,
|
1510 | HTMLCollection: 0,
|
1511 | HTMLFormElement: 0,
|
1512 | HTMLSelectElement: 0,
|
1513 | MediaList: 0,
|
1514 | MimeTypeArray: 0,
|
1515 | NamedNodeMap: 0,
|
1516 | NodeList: 1,
|
1517 | PaintRequestList: 0,
|
1518 | Plugin: 0,
|
1519 | PluginArray: 0,
|
1520 | SVGLengthList: 0,
|
1521 | SVGNumberList: 0,
|
1522 | SVGPathSegList: 0,
|
1523 | SVGPointList: 0,
|
1524 | SVGStringList: 0,
|
1525 | SVGTransformList: 0,
|
1526 | SourceBufferList: 0,
|
1527 | StyleSheetList: 0,
|
1528 | TextTrackCueList: 0,
|
1529 | TextTrackList: 0,
|
1530 | TouchList: 0
|
1531 | };
|
1532 | var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag');
|
1533 |
|
1534 | for (var COLLECTION_NAME in domIterables) {
|
1535 | var Collection = global_1[COLLECTION_NAME];
|
1536 | var CollectionPrototype = Collection && Collection.prototype;
|
1537 |
|
1538 | if (CollectionPrototype && !CollectionPrototype[TO_STRING_TAG$3]) {
|
1539 | createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$3, COLLECTION_NAME);
|
1540 | }
|
1541 |
|
1542 | iterators[COLLECTION_NAME] = iterators.Array;
|
1543 | }
|
1544 |
|
1545 |
|
1546 | var createMethod$2 = function (CONVERT_TO_STRING) {
|
1547 | return function ($this, pos) {
|
1548 | var S = String(requireObjectCoercible($this));
|
1549 | var position = toInteger(pos);
|
1550 | var size = S.length;
|
1551 | var first, second;
|
1552 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
1553 | first = S.charCodeAt(position);
|
1554 | return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
1555 | };
|
1556 | };
|
1557 |
|
1558 | var stringMultibyte = {
|
1559 |
|
1560 |
|
1561 | codeAt: createMethod$2(false),
|
1562 |
|
1563 |
|
1564 | charAt: createMethod$2(true)
|
1565 | };
|
1566 | var charAt = stringMultibyte.charAt;
|
1567 | var STRING_ITERATOR = 'String Iterator';
|
1568 | var setInternalState$2 = internalState.set;
|
1569 | var getInternalState$2 = internalState.getterFor(STRING_ITERATOR);
|
1570 |
|
1571 |
|
1572 | defineIterator(String, 'String', function (iterated) {
|
1573 | setInternalState$2(this, {
|
1574 | type: STRING_ITERATOR,
|
1575 | string: String(iterated),
|
1576 | index: 0
|
1577 | });
|
1578 |
|
1579 | }, function next() {
|
1580 | var state = getInternalState$2(this);
|
1581 | var string = state.string;
|
1582 | var index = state.index;
|
1583 | var point;
|
1584 | if (index >= string.length) return {
|
1585 | value: undefined,
|
1586 | done: true
|
1587 | };
|
1588 | point = charAt(string, index);
|
1589 | state.index += point.length;
|
1590 | return {
|
1591 | value: point,
|
1592 | done: false
|
1593 | };
|
1594 | });
|
1595 | var ITERATOR$2 = wellKnownSymbol('iterator');
|
1596 |
|
1597 | var getIteratorMethod = function (it) {
|
1598 | if (it != undefined) return it[ITERATOR$2] || it['@@iterator'] || iterators[classof(it)];
|
1599 | };
|
1600 |
|
1601 | var getIterator = function (it) {
|
1602 | var iteratorMethod = getIteratorMethod(it);
|
1603 |
|
1604 | if (typeof iteratorMethod != 'function') {
|
1605 | throw TypeError(String(it) + ' is not iterable');
|
1606 | }
|
1607 |
|
1608 | return anObject(iteratorMethod.call(it));
|
1609 | };
|
1610 |
|
1611 | var getIterator$1 = getIterator;
|
1612 | var getIterator$2 = getIterator$1;
|
1613 |
|
1614 |
|
1615 | _export({
|
1616 | target: 'Object',
|
1617 | stat: true,
|
1618 | sham: !descriptors
|
1619 | }, {
|
1620 | create: objectCreate
|
1621 | });
|
1622 |
|
1623 | var Object$1 = path.Object;
|
1624 |
|
1625 | var create = function create(P, D) {
|
1626 | return Object$1.create(P, D);
|
1627 | };
|
1628 |
|
1629 | var create$1 = create;
|
1630 | var create$2 = create$1;
|
1631 | var defineProperty$4 = defineProperty_1;
|
1632 | var defineProperty$5 = defineProperty$4;
|
1633 |
|
1634 | function _defineProperty(obj, key, value) {
|
1635 | if (key in obj) {
|
1636 | defineProperty$5(obj, key, {
|
1637 | value: value,
|
1638 | enumerable: true,
|
1639 | configurable: true,
|
1640 | writable: true
|
1641 | });
|
1642 | } else {
|
1643 | obj[key] = value;
|
1644 | }
|
1645 |
|
1646 | return obj;
|
1647 | }
|
1648 |
|
1649 | var defineProperty$6 = _defineProperty;
|
1650 | var FAILS_ON_PRIMITIVES$1 = fails(function () {
|
1651 | objectKeys(1);
|
1652 | });
|
1653 |
|
1654 |
|
1655 | _export({
|
1656 | target: 'Object',
|
1657 | stat: true,
|
1658 | forced: FAILS_ON_PRIMITIVES$1
|
1659 | }, {
|
1660 | keys: function keys(it) {
|
1661 | return objectKeys(toObject(it));
|
1662 | }
|
1663 | });
|
1664 |
|
1665 | var keys$1 = path.Object.keys;
|
1666 | var keys$2 = keys$1;
|
1667 | var keys$3 = keys$2;
|
1668 |
|
1669 |
|
1670 | var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
1671 | var whitespace = '[' + whitespaces + ']';
|
1672 | var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
1673 | var rtrim = RegExp(whitespace + whitespace + '*$');
|
1674 |
|
1675 | var createMethod$3 = function (TYPE) {
|
1676 | return function ($this) {
|
1677 | var string = String(requireObjectCoercible($this));
|
1678 | if (TYPE & 1) string = string.replace(ltrim, '');
|
1679 | if (TYPE & 2) string = string.replace(rtrim, '');
|
1680 | return string;
|
1681 | };
|
1682 | };
|
1683 |
|
1684 | var stringTrim = {
|
1685 |
|
1686 |
|
1687 | start: createMethod$3(1),
|
1688 |
|
1689 |
|
1690 | end: createMethod$3(2),
|
1691 |
|
1692 |
|
1693 | trim: createMethod$3(3)
|
1694 | };
|
1695 | var non = '\u200B\u0085\u180E';
|
1696 |
|
1697 |
|
1698 | var forcedStringTrimMethod = function (METHOD_NAME) {
|
1699 | return fails(function () {
|
1700 | return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
|
1701 | });
|
1702 | };
|
1703 |
|
1704 | var $trim = stringTrim.trim;
|
1705 |
|
1706 |
|
1707 | _export({
|
1708 | target: 'String',
|
1709 | proto: true,
|
1710 | forced: forcedStringTrimMethod('trim')
|
1711 | }, {
|
1712 | trim: function trim() {
|
1713 | return $trim(this);
|
1714 | }
|
1715 | });
|
1716 |
|
1717 | var entryVirtual = function (CONSTRUCTOR) {
|
1718 | return path[CONSTRUCTOR + 'Prototype'];
|
1719 | };
|
1720 |
|
1721 | var trim = entryVirtual('String').trim;
|
1722 | var StringPrototype = String.prototype;
|
1723 |
|
1724 | var trim_1 = function (it) {
|
1725 | var own = it.trim;
|
1726 | return typeof it === 'string' || it === StringPrototype || it instanceof String && own === StringPrototype.trim ? trim : own;
|
1727 | };
|
1728 |
|
1729 | var trim$1 = trim_1;
|
1730 | var trim$2 = trim$1;
|
1731 |
|
1732 | var sloppyArrayMethod = function (METHOD_NAME, argument) {
|
1733 | var method = [][METHOD_NAME];
|
1734 | return !method || !fails(function () {
|
1735 |
|
1736 | method.call(null, argument || function () {
|
1737 | throw 1;
|
1738 | }, 1);
|
1739 | });
|
1740 | };
|
1741 |
|
1742 | var $forEach$1 = arrayIteration.forEach;
|
1743 |
|
1744 |
|
1745 | var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn
|
1746 | /* , thisArg */
|
1747 | ) {
|
1748 | return $forEach$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
1749 | } : [].forEach;
|
1750 |
|
1751 |
|
1752 | _export({
|
1753 | target: 'Array',
|
1754 | proto: true,
|
1755 | forced: [].forEach != arrayForEach
|
1756 | }, {
|
1757 | forEach: arrayForEach
|
1758 | });
|
1759 |
|
1760 | var forEach = entryVirtual('Array').forEach;
|
1761 | var forEach$1 = forEach;
|
1762 | var ArrayPrototype = Array.prototype;
|
1763 | var DOMIterables = {
|
1764 | DOMTokenList: true,
|
1765 | NodeList: true
|
1766 | };
|
1767 |
|
1768 | var forEach_1 = function (it) {
|
1769 | var own = it.forEach;
|
1770 | return it === ArrayPrototype || it instanceof Array && own === ArrayPrototype.forEach
|
1771 | || DOMIterables.hasOwnProperty(classof(it)) ? forEach$1 : own;
|
1772 | };
|
1773 |
|
1774 | var forEach$2 = forEach_1;
|
1775 | var userAgent = getBuiltIn('navigator', 'userAgent') || '';
|
1776 | var process = global_1.process;
|
1777 | var versions = process && process.versions;
|
1778 | var v8 = versions && versions.v8;
|
1779 | var match, version;
|
1780 |
|
1781 | if (v8) {
|
1782 | match = v8.split('.');
|
1783 | version = match[0] + match[1];
|
1784 | } else if (userAgent) {
|
1785 | match = userAgent.match(/Edge\/(\d+)/);
|
1786 |
|
1787 | if (!match || match[1] >= 74) {
|
1788 | match = userAgent.match(/Chrome\/(\d+)/);
|
1789 | if (match) version = match[1];
|
1790 | }
|
1791 | }
|
1792 |
|
1793 | var v8Version = version && +version;
|
1794 | var SPECIES$1 = wellKnownSymbol('species');
|
1795 |
|
1796 | var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
1797 |
|
1798 |
|
1799 |
|
1800 | return v8Version >= 51 || !fails(function () {
|
1801 | var array = [];
|
1802 | var constructor = array.constructor = {};
|
1803 |
|
1804 | constructor[SPECIES$1] = function () {
|
1805 | return {
|
1806 | foo: 1
|
1807 | };
|
1808 | };
|
1809 |
|
1810 | return array[METHOD_NAME](Boolean).foo !== 1;
|
1811 | });
|
1812 | };
|
1813 |
|
1814 | var $map = arrayIteration.map;
|
1815 |
|
1816 |
|
1817 |
|
1818 | _export({
|
1819 | target: 'Array',
|
1820 | proto: true,
|
1821 | forced: !arrayMethodHasSpeciesSupport('map')
|
1822 | }, {
|
1823 | map: function map(callbackfn
|
1824 | /* , thisArg */
|
1825 | ) {
|
1826 | return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
1827 | }
|
1828 | });
|
1829 |
|
1830 | var map = entryVirtual('Array').map;
|
1831 | var ArrayPrototype$1 = Array.prototype;
|
1832 |
|
1833 | var map_1 = function (it) {
|
1834 | var own = it.map;
|
1835 | return it === ArrayPrototype$1 || it instanceof Array && own === ArrayPrototype$1.map ? map : own;
|
1836 | };
|
1837 |
|
1838 | var map$1 = map_1;
|
1839 | var map$2 = map$1;
|
1840 | var trim$3 = stringTrim.trim;
|
1841 | var nativeParseInt = global_1.parseInt;
|
1842 | var hex = /^[+-]?0[Xx]/;
|
1843 | var FORCED$1 = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
|
1844 |
|
1845 |
|
1846 | var _parseInt = FORCED$1 ? function parseInt(string, radix) {
|
1847 | var S = trim$3(String(string));
|
1848 | return nativeParseInt(S, radix >>> 0 || (hex.test(S) ? 16 : 10));
|
1849 | } : nativeParseInt;
|
1850 |
|
1851 |
|
1852 |
|
1853 | _export({
|
1854 | global: true,
|
1855 | forced: parseInt != _parseInt
|
1856 | }, {
|
1857 | parseInt: _parseInt
|
1858 | });
|
1859 |
|
1860 | var _parseInt$1 = path.parseInt;
|
1861 | var _parseInt$2 = _parseInt$1;
|
1862 | var _parseInt$3 = _parseInt$2;
|
1863 | var propertyIsEnumerable = objectPropertyIsEnumerable.f;
|
1864 |
|
1865 | var createMethod$4 = function (TO_ENTRIES) {
|
1866 | return function (it) {
|
1867 | var O = toIndexedObject(it);
|
1868 | var keys = objectKeys(O);
|
1869 | var length = keys.length;
|
1870 | var i = 0;
|
1871 | var result = [];
|
1872 | var key;
|
1873 |
|
1874 | while (length > i) {
|
1875 | key = keys[i++];
|
1876 |
|
1877 | if (!descriptors || propertyIsEnumerable.call(O, key)) {
|
1878 | result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
|
1879 | }
|
1880 | }
|
1881 |
|
1882 | return result;
|
1883 | };
|
1884 | };
|
1885 |
|
1886 | var objectToArray = {
|
1887 |
|
1888 |
|
1889 | entries: createMethod$4(true),
|
1890 |
|
1891 |
|
1892 | values: createMethod$4(false)
|
1893 | };
|
1894 | var $values = objectToArray.values;
|
1895 |
|
1896 |
|
1897 | _export({
|
1898 | target: 'Object',
|
1899 | stat: true
|
1900 | }, {
|
1901 | values: function values(O) {
|
1902 | return $values(O);
|
1903 | }
|
1904 | });
|
1905 |
|
1906 | var values = path.Object.values;
|
1907 | var values$1 = values;
|
1908 | var values$2 = values$1;
|
1909 | var $filter = arrayIteration.filter;
|
1910 |
|
1911 |
|
1912 |
|
1913 | _export({
|
1914 | target: 'Array',
|
1915 | proto: true,
|
1916 | forced: !arrayMethodHasSpeciesSupport('filter')
|
1917 | }, {
|
1918 | filter: function filter(callbackfn
|
1919 | /* , thisArg */
|
1920 | ) {
|
1921 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
1922 | }
|
1923 | });
|
1924 |
|
1925 | var filter = entryVirtual('Array').filter;
|
1926 | var ArrayPrototype$2 = Array.prototype;
|
1927 |
|
1928 | var filter_1 = function (it) {
|
1929 | var own = it.filter;
|
1930 | return it === ArrayPrototype$2 || it instanceof Array && own === ArrayPrototype$2.filter ? filter : own;
|
1931 | };
|
1932 |
|
1933 | var filter$1 = filter_1;
|
1934 | var filter$2 = filter$1;
|
1935 | var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
1936 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
1937 | var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
1938 |
|
1939 |
|
1940 |
|
1941 | var IS_CONCAT_SPREADABLE_SUPPORT = v8Version >= 51 || !fails(function () {
|
1942 | var array = [];
|
1943 | array[IS_CONCAT_SPREADABLE] = false;
|
1944 | return array.concat()[0] !== array;
|
1945 | });
|
1946 | var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
1947 |
|
1948 | var isConcatSpreadable = function (O) {
|
1949 | if (!isObject(O)) return false;
|
1950 | var spreadable = O[IS_CONCAT_SPREADABLE];
|
1951 | return spreadable !== undefined ? !!spreadable : isArray(O);
|
1952 | };
|
1953 |
|
1954 | var FORCED$2 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
1955 |
|
1956 |
|
1957 |
|
1958 | _export({
|
1959 | target: 'Array',
|
1960 | proto: true,
|
1961 | forced: FORCED$2
|
1962 | }, {
|
1963 | concat: function concat(arg) {
|
1964 |
|
1965 | var O = toObject(this);
|
1966 | var A = arraySpeciesCreate(O, 0);
|
1967 | var n = 0;
|
1968 | var i, k, length, len, E;
|
1969 |
|
1970 | for (i = -1, length = arguments.length; i < length; i++) {
|
1971 | E = i === -1 ? O : arguments[i];
|
1972 |
|
1973 | if (isConcatSpreadable(E)) {
|
1974 | len = toLength(E.length);
|
1975 | if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
1976 |
|
1977 | for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
1978 | } else {
|
1979 | if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
1980 | createProperty(A, n++, E);
|
1981 | }
|
1982 | }
|
1983 |
|
1984 | A.length = n;
|
1985 | return A;
|
1986 | }
|
1987 | });
|
1988 |
|
1989 | var concat = entryVirtual('Array').concat;
|
1990 | var ArrayPrototype$3 = Array.prototype;
|
1991 |
|
1992 | var concat_1 = function (it) {
|
1993 | var own = it.concat;
|
1994 | return it === ArrayPrototype$3 || it instanceof Array && own === ArrayPrototype$3.concat ? concat : own;
|
1995 | };
|
1996 |
|
1997 | var concat$1 = concat_1;
|
1998 | var concat$2 = concat$1;
|
1999 |
|
2000 |
|
2001 | _export({
|
2002 | target: 'Array',
|
2003 | stat: true
|
2004 | }, {
|
2005 | isArray: isArray
|
2006 | });
|
2007 |
|
2008 | var isArray$1 = path.Array.isArray;
|
2009 | var isArray$2 = isArray$1;
|
2010 | var isArray$3 = isArray$2;
|
2011 |
|
2012 | function _arrayWithoutHoles(arr) {
|
2013 | if (isArray$3(arr)) {
|
2014 | for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
|
2015 | arr2[i] = arr[i];
|
2016 | }
|
2017 |
|
2018 | return arr2;
|
2019 | }
|
2020 | }
|
2021 |
|
2022 | var arrayWithoutHoles = _arrayWithoutHoles;
|
2023 |
|
2024 | var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
|
2025 | try {
|
2026 | return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
2027 | } catch (error) {
|
2028 | var returnMethod = iterator['return'];
|
2029 | if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
|
2030 | throw error;
|
2031 | }
|
2032 | };
|
2033 |
|
2034 | var ITERATOR$3 = wellKnownSymbol('iterator');
|
2035 | var ArrayPrototype$4 = Array.prototype;
|
2036 |
|
2037 | var isArrayIteratorMethod = function (it) {
|
2038 | return it !== undefined && (iterators.Array === it || ArrayPrototype$4[ITERATOR$3] === it);
|
2039 | };
|
2040 |
|
2041 |
|
2042 |
|
2043 | var arrayFrom = function from(arrayLike
|
2044 | /* , mapfn = undefined, thisArg = undefined */
|
2045 | ) {
|
2046 | var O = toObject(arrayLike);
|
2047 | var C = typeof this == 'function' ? this : Array;
|
2048 | var argumentsLength = arguments.length;
|
2049 | var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
2050 | var mapping = mapfn !== undefined;
|
2051 | var index = 0;
|
2052 | var iteratorMethod = getIteratorMethod(O);
|
2053 | var length, result, step, iterator, next;
|
2054 | if (mapping) mapfn = bindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
|
2055 |
|
2056 | if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {
|
2057 | iterator = iteratorMethod.call(O);
|
2058 | next = iterator.next;
|
2059 | result = new C();
|
2060 |
|
2061 | for (; !(step = next.call(iterator)).done; index++) {
|
2062 | createProperty(result, index, mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value);
|
2063 | }
|
2064 | } else {
|
2065 | length = toLength(O.length);
|
2066 | result = new C(length);
|
2067 |
|
2068 | for (; length > index; index++) {
|
2069 | createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
|
2070 | }
|
2071 | }
|
2072 |
|
2073 | result.length = index;
|
2074 | return result;
|
2075 | };
|
2076 |
|
2077 | var ITERATOR$4 = wellKnownSymbol('iterator');
|
2078 | var SAFE_CLOSING = false;
|
2079 |
|
2080 | try {
|
2081 | var called = 0;
|
2082 | var iteratorWithReturn = {
|
2083 | next: function () {
|
2084 | return {
|
2085 | done: !!called++
|
2086 | };
|
2087 | },
|
2088 | 'return': function () {
|
2089 | SAFE_CLOSING = true;
|
2090 | }
|
2091 | };
|
2092 |
|
2093 | iteratorWithReturn[ITERATOR$4] = function () {
|
2094 | return this;
|
2095 | };
|
2096 |
|
2097 |
|
2098 | Array.from(iteratorWithReturn, function () {
|
2099 | throw 2;
|
2100 | });
|
2101 | } catch (error) {
|
2102 |
|
2103 | }
|
2104 |
|
2105 | var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
|
2106 | if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
2107 | var ITERATION_SUPPORT = false;
|
2108 |
|
2109 | try {
|
2110 | var object = {};
|
2111 |
|
2112 | object[ITERATOR$4] = function () {
|
2113 | return {
|
2114 | next: function () {
|
2115 | return {
|
2116 | done: ITERATION_SUPPORT = true
|
2117 | };
|
2118 | }
|
2119 | };
|
2120 | };
|
2121 |
|
2122 | exec(object);
|
2123 | } catch (error) {
|
2124 |
|
2125 | }
|
2126 |
|
2127 | return ITERATION_SUPPORT;
|
2128 | };
|
2129 |
|
2130 | var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
|
2131 | Array.from(iterable);
|
2132 | });
|
2133 |
|
2134 |
|
2135 | _export({
|
2136 | target: 'Array',
|
2137 | stat: true,
|
2138 | forced: INCORRECT_ITERATION
|
2139 | }, {
|
2140 | from: arrayFrom
|
2141 | });
|
2142 |
|
2143 | var from_1 = path.Array.from;
|
2144 | var from_1$1 = from_1;
|
2145 | var from_1$2 = from_1$1;
|
2146 | var ITERATOR$5 = wellKnownSymbol('iterator');
|
2147 |
|
2148 | var isIterable = function (it) {
|
2149 | var O = Object(it);
|
2150 | return O[ITERATOR$5] !== undefined || '@@iterator' in O
|
2151 | || iterators.hasOwnProperty(classof(O));
|
2152 | };
|
2153 |
|
2154 | var isIterable$1 = isIterable;
|
2155 | var isIterable$2 = isIterable$1;
|
2156 |
|
2157 | function _iterableToArray(iter) {
|
2158 | if (isIterable$2(Object(iter)) || Object.prototype.toString.call(iter) === "[object Arguments]") return from_1$2(iter);
|
2159 | }
|
2160 |
|
2161 | var iterableToArray = _iterableToArray;
|
2162 |
|
2163 | function _nonIterableSpread() {
|
2164 | throw new TypeError("Invalid attempt to spread non-iterable instance");
|
2165 | }
|
2166 |
|
2167 | var nonIterableSpread = _nonIterableSpread;
|
2168 |
|
2169 | function _toConsumableArray(arr) {
|
2170 | return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();
|
2171 | }
|
2172 |
|
2173 | var toConsumableArray = _toConsumableArray;
|
2174 | var SPECIES$2 = wellKnownSymbol('species');
|
2175 | var nativeSlice = [].slice;
|
2176 | var max$1 = Math.max;
|
2177 |
|
2178 |
|
2179 |
|
2180 | _export({
|
2181 | target: 'Array',
|
2182 | proto: true,
|
2183 | forced: !arrayMethodHasSpeciesSupport('slice')
|
2184 | }, {
|
2185 | slice: function slice(start, end) {
|
2186 | var O = toIndexedObject(this);
|
2187 | var length = toLength(O.length);
|
2188 | var k = toAbsoluteIndex(start, length);
|
2189 | var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
2190 |
|
2191 | var Constructor, result, n;
|
2192 |
|
2193 | if (isArray(O)) {
|
2194 | Constructor = O.constructor;
|
2195 |
|
2196 | if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
|
2197 | Constructor = undefined;
|
2198 | } else if (isObject(Constructor)) {
|
2199 | Constructor = Constructor[SPECIES$2];
|
2200 | if (Constructor === null) Constructor = undefined;
|
2201 | }
|
2202 |
|
2203 | if (Constructor === Array || Constructor === undefined) {
|
2204 | return nativeSlice.call(O, k, fin);
|
2205 | }
|
2206 | }
|
2207 |
|
2208 | result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
|
2209 |
|
2210 | for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
|
2211 |
|
2212 | result.length = n;
|
2213 | return result;
|
2214 | }
|
2215 | });
|
2216 |
|
2217 | var slice = entryVirtual('Array').slice;
|
2218 | var ArrayPrototype$5 = Array.prototype;
|
2219 |
|
2220 | var slice_1 = function (it) {
|
2221 | var own = it.slice;
|
2222 | return it === ArrayPrototype$5 || it instanceof Array && own === ArrayPrototype$5.slice ? slice : own;
|
2223 | };
|
2224 |
|
2225 | var slice$1 = slice_1;
|
2226 | var slice$2 = slice$1;
|
2227 | var FAILS_ON_PRIMITIVES$2 = fails(function () {
|
2228 | objectGetPrototypeOf(1);
|
2229 | });
|
2230 |
|
2231 |
|
2232 | _export({
|
2233 | target: 'Object',
|
2234 | stat: true,
|
2235 | forced: FAILS_ON_PRIMITIVES$2,
|
2236 | sham: !correctPrototypeGetter
|
2237 | }, {
|
2238 | getPrototypeOf: function getPrototypeOf(it) {
|
2239 | return objectGetPrototypeOf(toObject(it));
|
2240 | }
|
2241 | });
|
2242 |
|
2243 | var getPrototypeOf = path.Object.getPrototypeOf;
|
2244 | var getPrototypeOf$1 = getPrototypeOf;
|
2245 | var getPrototypeOf$2 = getPrototypeOf$1;
|
2246 | var $indexOf = arrayIncludes.indexOf;
|
2247 | var nativeIndexOf = [].indexOf;
|
2248 | var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
|
2249 | var SLOPPY_METHOD = sloppyArrayMethod('indexOf');
|
2250 |
|
2251 |
|
2252 | _export({
|
2253 | target: 'Array',
|
2254 | proto: true,
|
2255 | forced: NEGATIVE_ZERO || SLOPPY_METHOD
|
2256 | }, {
|
2257 | indexOf: function indexOf(searchElement
|
2258 | /* , fromIndex = 0 */
|
2259 | ) {
|
2260 | return NEGATIVE_ZERO
|
2261 | ? nativeIndexOf.apply(this, arguments) || 0 : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
|
2262 | }
|
2263 | });
|
2264 |
|
2265 | var indexOf$1 = entryVirtual('Array').indexOf;
|
2266 | var ArrayPrototype$6 = Array.prototype;
|
2267 |
|
2268 | var indexOf_1 = function (it) {
|
2269 | var own = it.indexOf;
|
2270 | return it === ArrayPrototype$6 || it instanceof Array && own === ArrayPrototype$6.indexOf ? indexOf$1 : own;
|
2271 | };
|
2272 |
|
2273 | var indexOf$2 = indexOf_1;
|
2274 | var indexOf$3 = indexOf$2;
|
2275 | var isArray$4 = isArray$1;
|
2276 | var isArray$5 = isArray$4;
|
2277 | var nativeAssign = Object.assign;
|
2278 |
|
2279 |
|
2280 |
|
2281 | var objectAssign = !nativeAssign || fails(function () {
|
2282 | var A = {};
|
2283 | var B = {};
|
2284 |
|
2285 | var symbol = Symbol();
|
2286 | var alphabet = 'abcdefghijklmnopqrst';
|
2287 | A[symbol] = 7;
|
2288 | alphabet.split('').forEach(function (chr) {
|
2289 | B[chr] = chr;
|
2290 | });
|
2291 | return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
|
2292 | }) ? function assign(target, source) {
|
2293 |
|
2294 | var T = toObject(target);
|
2295 | var argumentsLength = arguments.length;
|
2296 | var index = 1;
|
2297 | var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
2298 | var propertyIsEnumerable = objectPropertyIsEnumerable.f;
|
2299 |
|
2300 | while (argumentsLength > index) {
|
2301 | var S = indexedObject(arguments[index++]);
|
2302 | var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
|
2303 | var length = keys.length;
|
2304 | var j = 0;
|
2305 | var key;
|
2306 |
|
2307 | while (length > j) {
|
2308 | key = keys[j++];
|
2309 | if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
|
2310 | }
|
2311 | }
|
2312 |
|
2313 | return T;
|
2314 | } : nativeAssign;
|
2315 |
|
2316 |
|
2317 | _export({
|
2318 | target: 'Object',
|
2319 | stat: true,
|
2320 | forced: Object.assign !== objectAssign
|
2321 | }, {
|
2322 | assign: objectAssign
|
2323 | });
|
2324 |
|
2325 | var assign = path.Object.assign;
|
2326 | var assign$1 = assign;
|
2327 | var assign$2 = assign$1;
|
2328 |
|
2329 |
|
2330 | defineWellKnownSymbol('iterator');
|
2331 | var iterator = wrappedWellKnownSymbol.f('iterator');
|
2332 | var iterator$1 = iterator;
|
2333 | var iterator$2 = iterator$1;
|
2334 |
|
2335 |
|
2336 | defineWellKnownSymbol('asyncIterator');
|
2337 |
|
2338 |
|
2339 | defineWellKnownSymbol('hasInstance');
|
2340 |
|
2341 |
|
2342 | defineWellKnownSymbol('isConcatSpreadable');
|
2343 |
|
2344 |
|
2345 | defineWellKnownSymbol('match');
|
2346 |
|
2347 | defineWellKnownSymbol('matchAll');
|
2348 |
|
2349 |
|
2350 | defineWellKnownSymbol('replace');
|
2351 |
|
2352 |
|
2353 | defineWellKnownSymbol('search');
|
2354 |
|
2355 |
|
2356 | defineWellKnownSymbol('species');
|
2357 |
|
2358 |
|
2359 | defineWellKnownSymbol('split');
|
2360 |
|
2361 |
|
2362 | defineWellKnownSymbol('toPrimitive');
|
2363 |
|
2364 |
|
2365 | defineWellKnownSymbol('toStringTag');
|
2366 |
|
2367 |
|
2368 | defineWellKnownSymbol('unscopables');
|
2369 |
|
2370 |
|
2371 | setToStringTag(Math, 'Math', true);
|
2372 |
|
2373 |
|
2374 | setToStringTag(global_1.JSON, 'JSON', true);
|
2375 | var symbol = path.Symbol;
|
2376 |
|
2377 |
|
2378 | defineWellKnownSymbol('asyncDispose');
|
2379 |
|
2380 |
|
2381 | defineWellKnownSymbol('dispose');
|
2382 |
|
2383 |
|
2384 | defineWellKnownSymbol('observable');
|
2385 |
|
2386 |
|
2387 | defineWellKnownSymbol('patternMatch');
|
2388 |
|
2389 | defineWellKnownSymbol('replaceAll');
|
2390 | var symbol$1 = symbol;
|
2391 | var symbol$2 = symbol$1;
|
2392 |
|
2393 | var _typeof_1 = createCommonjsModule(function (module) {
|
2394 | function _typeof2(obj) {
|
2395 | if (typeof symbol$2 === "function" && typeof iterator$2 === "symbol") {
|
2396 | _typeof2 = function _typeof2(obj) {
|
2397 | return typeof obj;
|
2398 | };
|
2399 | } else {
|
2400 | _typeof2 = function _typeof2(obj) {
|
2401 | return obj && typeof symbol$2 === "function" && obj.constructor === symbol$2 && obj !== symbol$2.prototype ? "symbol" : typeof obj;
|
2402 | };
|
2403 | }
|
2404 |
|
2405 | return _typeof2(obj);
|
2406 | }
|
2407 |
|
2408 | function _typeof(obj) {
|
2409 | if (typeof symbol$2 === "function" && _typeof2(iterator$2) === "symbol") {
|
2410 | module.exports = _typeof = function _typeof(obj) {
|
2411 | return _typeof2(obj);
|
2412 | };
|
2413 | } else {
|
2414 | module.exports = _typeof = function _typeof(obj) {
|
2415 | return obj && typeof symbol$2 === "function" && obj.constructor === symbol$2 && obj !== symbol$2.prototype ? "symbol" : _typeof2(obj);
|
2416 | };
|
2417 | }
|
2418 |
|
2419 | return _typeof(obj);
|
2420 | }
|
2421 |
|
2422 | module.exports = _typeof;
|
2423 | });
|
2424 |
|
2425 |
|
2426 | var byteToHex = [];
|
2427 |
|
2428 | for (var i = 0; i < 256; i++) {
|
2429 | byteToHex[i] = (i + 0x100).toString(16).substr(1);
|
2430 | }
|
2431 |
|
2432 |
|
2433 |
|
2434 |
|
2435 |
|
2436 |
|
2437 |
|
2438 |
|
2439 |
|
2440 |
|
2441 | function stringifyUUID(buf, offset) {
|
2442 | var i = offset || 0;
|
2443 | var bth = byteToHex;
|
2444 | return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]];
|
2445 | }
|
2446 |
|
2447 |
|
2448 |
|
2449 |
|
2450 |
|
2451 |
|
2452 |
|
2453 | var random = function () {
|
2454 | if (typeof crypto !== 'undefined' && crypto.getRandomValues) {
|
2455 |
|
2456 |
|
2457 | var _rnds8 = new Uint8Array(16);
|
2458 |
|
2459 | return function whatwgRNG() {
|
2460 | crypto.getRandomValues(_rnds8);
|
2461 | return _rnds8;
|
2462 | };
|
2463 | }
|
2464 |
|
2465 |
|
2466 |
|
2467 |
|
2468 |
|
2469 | var _rnds = new Array(16);
|
2470 |
|
2471 | return function () {
|
2472 | for (var i = 0, r; i < 16; i++) {
|
2473 | if ((i & 0x03) === 0) {
|
2474 | r = Math.random() * 0x100000000;
|
2475 | }
|
2476 |
|
2477 | _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
|
2478 | }
|
2479 |
|
2480 | return _rnds;
|
2481 | };
|
2482 |
|
2483 |
|
2484 |
|
2485 |
|
2486 |
|
2487 |
|
2488 |
|
2489 | }();
|
2490 |
|
2491 | var byteToHex$1 = [];
|
2492 |
|
2493 | for (var i$1 = 0; i$1 < 256; i$1++) {
|
2494 | byteToHex$1[i$1] = (i$1 + 0x100).toString(16).substr(1);
|
2495 | }
|
2496 |
|
2497 |
|
2498 |
|
2499 |
|
2500 |
|
2501 |
|
2502 | var seedBytes = random();
|
2503 |
|
2504 | var defaultNodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
2505 |
|
2506 | var defaultClockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
|
2507 |
|
2508 |
|
2509 |
|
2510 |
|
2511 |
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 |
|
2517 |
|
2518 |
|
2519 |
|
2520 |
|
2521 |
|
2522 |
|
2523 | function uuid4() {
|
2524 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
2525 | var buf = arguments.length > 1 ? arguments[1] : undefined;
|
2526 | var offset = arguments.length > 2 ? arguments[2] : undefined;
|
2527 |
|
2528 | var i = buf && offset || 0;
|
2529 |
|
2530 | if (typeof options === 'string') {
|
2531 | buf = options === 'binary' ? new Array(16) : undefined;
|
2532 | options = {};
|
2533 | }
|
2534 |
|
2535 | var rnds = options.random || (options.rng || random)();
|
2536 |
|
2537 | rnds[6] = rnds[6] & 0x0f | 0x40;
|
2538 | rnds[8] = rnds[8] & 0x3f | 0x80;
|
2539 |
|
2540 | if (buf) {
|
2541 | for (var ii = 0; ii < 16; ii++) {
|
2542 | buf[i + ii] = rnds[ii];
|
2543 | }
|
2544 | }
|
2545 |
|
2546 | return buf || stringifyUUID(rnds);
|
2547 | }
|
2548 |
|
2549 | function ownKeys$1(object, enumerableOnly) {
|
2550 | var keys = keys$3(object);
|
2551 |
|
2552 | if (getOwnPropertySymbols$2) {
|
2553 | var symbols = getOwnPropertySymbols$2(object);
|
2554 | if (enumerableOnly) symbols = filter$2(symbols).call(symbols, function (sym) {
|
2555 | return getOwnPropertyDescriptor$3(object, sym).enumerable;
|
2556 | });
|
2557 | keys.push.apply(keys, symbols);
|
2558 | }
|
2559 |
|
2560 | return keys;
|
2561 | }
|
2562 |
|
2563 | function _objectSpread(target) {
|
2564 | for (var i = 1; i < arguments.length; i++) {
|
2565 | var source = arguments[i] != null ? arguments[i] : {};
|
2566 |
|
2567 | if (i % 2) {
|
2568 | var _context11;
|
2569 |
|
2570 | forEach$2(_context11 = ownKeys$1(source, true)).call(_context11, function (key) {
|
2571 | defineProperty$6(target, key, source[key]);
|
2572 | });
|
2573 | } else if (getOwnPropertyDescriptors$2) {
|
2574 | defineProperties$1(target, getOwnPropertyDescriptors$2(source));
|
2575 | } else {
|
2576 | var _context12;
|
2577 |
|
2578 | forEach$2(_context12 = ownKeys$1(source)).call(_context12, function (key) {
|
2579 | defineProperty$1(target, key, getOwnPropertyDescriptor$3(source, key));
|
2580 | });
|
2581 | }
|
2582 | }
|
2583 |
|
2584 | return target;
|
2585 | }
|
2586 |
|
2587 |
|
2588 |
|
2589 | var ASPDateRegex = /^\/?Date\((-?\d+)/i;
|
2590 |
|
2591 | var fullHexRE = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;
|
2592 | var shortHexRE = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
2593 | var rgbRE = /^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i;
|
2594 | var rgbaRE = /^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;
|
2595 |
|
2596 |
|
2597 |
|
2598 |
|
2599 |
|
2600 |
|
2601 |
|
2602 |
|
2603 |
|
2604 |
|
2605 |
|
2606 |
|
2607 | function isNumber(value) {
|
2608 | return value instanceof Number || typeof value === "number";
|
2609 | }
|
2610 |
|
2611 |
|
2612 |
|
2613 |
|
2614 |
|
2615 |
|
2616 |
|
2617 | function recursiveDOMDelete(DOMobject) {
|
2618 | if (DOMobject) {
|
2619 | while (DOMobject.hasChildNodes() === true) {
|
2620 | var child = DOMobject.firstChild;
|
2621 |
|
2622 | if (child) {
|
2623 | recursiveDOMDelete(child);
|
2624 | DOMobject.removeChild(child);
|
2625 | }
|
2626 | }
|
2627 | }
|
2628 | }
|
2629 |
|
2630 |
|
2631 |
|
2632 |
|
2633 |
|
2634 |
|
2635 |
|
2636 |
|
2637 |
|
2638 | function isString(value) {
|
2639 | return value instanceof String || typeof value === "string";
|
2640 | }
|
2641 |
|
2642 |
|
2643 |
|
2644 |
|
2645 |
|
2646 |
|
2647 |
|
2648 |
|
2649 |
|
2650 | function isObject$1(value) {
|
2651 | return _typeof_1(value) === "object" && value !== null;
|
2652 | }
|
2653 |
|
2654 |
|
2655 |
|
2656 |
|
2657 |
|
2658 |
|
2659 |
|
2660 |
|
2661 |
|
2662 | function isDate(value) {
|
2663 | if (value instanceof Date) {
|
2664 | return true;
|
2665 | } else if (isString(value)) {
|
2666 |
|
2667 | var match = ASPDateRegex.exec(value);
|
2668 |
|
2669 | if (match) {
|
2670 | return true;
|
2671 | } else if (!isNaN(Date.parse(value))) {
|
2672 | return true;
|
2673 | }
|
2674 | }
|
2675 |
|
2676 | return false;
|
2677 | }
|
2678 |
|
2679 |
|
2680 |
|
2681 |
|
2682 |
|
2683 |
|
2684 |
|
2685 |
|
2686 |
|
2687 |
|
2688 |
|
2689 |
|
2690 |
|
2691 | function copyOrDelete(a, b, prop, allowDeletion) {
|
2692 | var doDeletion = false;
|
2693 |
|
2694 | if (allowDeletion === true) {
|
2695 | doDeletion = b[prop] === null && a[prop] !== undefined;
|
2696 | }
|
2697 |
|
2698 | if (doDeletion) {
|
2699 | delete a[prop];
|
2700 | } else {
|
2701 | a[prop] = b[prop];
|
2702 | }
|
2703 | }
|
2704 |
|
2705 |
|
2706 |
|
2707 |
|
2708 |
|
2709 |
|
2710 |
|
2711 |
|
2712 |
|
2713 |
|
2714 |
|
2715 |
|
2716 | function fillIfDefined(a, b) {
|
2717 | var allowDeletion = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
2718 |
|
2719 |
|
2720 | for (var prop in a) {
|
2721 | if (b[prop] !== undefined) {
|
2722 | if (b[prop] === null || _typeof_1(b[prop]) !== "object") {
|
2723 |
|
2724 | copyOrDelete(a, b, prop, allowDeletion);
|
2725 | } else {
|
2726 | var aProp = a[prop];
|
2727 | var bProp = b[prop];
|
2728 |
|
2729 | if (isObject$1(aProp) && isObject$1(bProp)) {
|
2730 | fillIfDefined(aProp, bProp, allowDeletion);
|
2731 | }
|
2732 | }
|
2733 | }
|
2734 | }
|
2735 | }
|
2736 |
|
2737 |
|
2738 |
|
2739 |
|
2740 |
|
2741 |
|
2742 |
|
2743 |
|
2744 |
|
2745 |
|
2746 |
|
2747 | var extend = assign$2;
|
2748 |
|
2749 |
|
2750 |
|
2751 |
|
2752 |
|
2753 |
|
2754 |
|
2755 |
|
2756 |
|
2757 |
|
2758 |
|
2759 | function selectiveExtend(props, a) {
|
2760 | if (!isArray$5(props)) {
|
2761 | throw new Error("Array with property names expected as first argument");
|
2762 | }
|
2763 |
|
2764 | for (var _len = arguments.length, others = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
2765 | others[_key - 2] = arguments[_key];
|
2766 | }
|
2767 |
|
2768 | for (var _i = 0, _others = others; _i < _others.length; _i++) {
|
2769 | var other = _others[_i];
|
2770 |
|
2771 | for (var p = 0; p < props.length; p++) {
|
2772 | var prop = props[p];
|
2773 |
|
2774 | if (other && Object.prototype.hasOwnProperty.call(other, prop)) {
|
2775 | a[prop] = other[prop];
|
2776 | }
|
2777 | }
|
2778 | }
|
2779 |
|
2780 | return a;
|
2781 | }
|
2782 |
|
2783 |
|
2784 |
|
2785 |
|
2786 |
|
2787 |
|
2788 |
|
2789 |
|
2790 |
|
2791 |
|
2792 |
|
2793 |
|
2794 |
|
2795 |
|
2796 |
|
2797 |
|
2798 |
|
2799 |
|
2800 | function selectiveDeepExtend(props, a, b) {
|
2801 | var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
2802 |
|
2803 | if (isArray$5(b)) {
|
2804 | throw new TypeError("Arrays are not supported by deepExtend");
|
2805 | }
|
2806 |
|
2807 | for (var p = 0; p < props.length; p++) {
|
2808 | var prop = props[p];
|
2809 |
|
2810 | if (Object.prototype.hasOwnProperty.call(b, prop)) {
|
2811 | if (b[prop] && b[prop].constructor === Object) {
|
2812 | if (a[prop] === undefined) {
|
2813 | a[prop] = {};
|
2814 | }
|
2815 |
|
2816 | if (a[prop].constructor === Object) {
|
2817 | deepExtend(a[prop], b[prop], false, allowDeletion);
|
2818 | } else {
|
2819 | copyOrDelete(a, b, prop, allowDeletion);
|
2820 | }
|
2821 | } else if (isArray$5(b[prop])) {
|
2822 | throw new TypeError("Arrays are not supported by deepExtend");
|
2823 | } else {
|
2824 | copyOrDelete(a, b, prop, allowDeletion);
|
2825 | }
|
2826 | }
|
2827 | }
|
2828 |
|
2829 | return a;
|
2830 | }
|
2831 |
|
2832 |
|
2833 |
|
2834 |
|
2835 |
|
2836 |
|
2837 |
|
2838 |
|
2839 |
|
2840 |
|
2841 |
|
2842 |
|
2843 |
|
2844 |
|
2845 |
|
2846 |
|
2847 |
|
2848 | function selectiveNotDeepExtend(propsToExclude, a, b) {
|
2849 | var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
2850 |
|
2851 |
|
2852 | if (isArray$5(b)) {
|
2853 | throw new TypeError("Arrays are not supported by deepExtend");
|
2854 | }
|
2855 |
|
2856 | for (var prop in b) {
|
2857 | if (!Object.prototype.hasOwnProperty.call(b, prop)) {
|
2858 | continue;
|
2859 | }
|
2860 |
|
2861 |
|
2862 | if (indexOf$3(propsToExclude).call(propsToExclude, prop) !== -1) {
|
2863 | continue;
|
2864 | }
|
2865 |
|
2866 |
|
2867 | if (b[prop] && b[prop].constructor === Object) {
|
2868 | if (a[prop] === undefined) {
|
2869 | a[prop] = {};
|
2870 | }
|
2871 |
|
2872 | if (a[prop].constructor === Object) {
|
2873 | deepExtend(a[prop], b[prop]);
|
2874 | } else {
|
2875 | copyOrDelete(a, b, prop, allowDeletion);
|
2876 | }
|
2877 | } else if (isArray$5(b[prop])) {
|
2878 | a[prop] = [];
|
2879 |
|
2880 | for (var i = 0; i < b[prop].length; i++) {
|
2881 | a[prop].push(b[prop][i]);
|
2882 | }
|
2883 | } else {
|
2884 | copyOrDelete(a, b, prop, allowDeletion);
|
2885 | }
|
2886 | }
|
2887 |
|
2888 | return a;
|
2889 | }
|
2890 |
|
2891 |
|
2892 |
|
2893 |
|
2894 |
|
2895 |
|
2896 |
|
2897 |
|
2898 |
|
2899 |
|
2900 |
|
2901 |
|
2902 |
|
2903 | function deepExtend(a, b) {
|
2904 | var protoExtend = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
2905 | var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
2906 |
|
2907 | for (var prop in b) {
|
2908 | if (Object.prototype.hasOwnProperty.call(b, prop) || protoExtend === true) {
|
2909 | if (_typeof_1(b[prop]) === "object" && b[prop] !== null && getPrototypeOf$2(b[prop]) === Object.prototype) {
|
2910 | if (a[prop] === undefined) {
|
2911 | a[prop] = deepExtend({}, b[prop], protoExtend);
|
2912 | } else if (_typeof_1(a[prop]) === "object" && a[prop] !== null && getPrototypeOf$2(a[prop]) === Object.prototype) {
|
2913 | deepExtend(a[prop], b[prop], protoExtend);
|
2914 | } else {
|
2915 | copyOrDelete(a, b, prop, allowDeletion);
|
2916 | }
|
2917 | } else if (isArray$5(b[prop])) {
|
2918 | var _context;
|
2919 |
|
2920 | a[prop] = slice$2(_context = b[prop]).call(_context);
|
2921 | } else {
|
2922 | copyOrDelete(a, b, prop, allowDeletion);
|
2923 | }
|
2924 | }
|
2925 | }
|
2926 |
|
2927 | return a;
|
2928 | }
|
2929 |
|
2930 |
|
2931 |
|
2932 |
|
2933 |
|
2934 |
|
2935 |
|
2936 |
|
2937 |
|
2938 |
|
2939 | function equalArray(a, b) {
|
2940 | if (a.length !== b.length) {
|
2941 | return false;
|
2942 | }
|
2943 |
|
2944 | for (var i = 0, len = a.length; i < len; i++) {
|
2945 | if (a[i] != b[i]) {
|
2946 | return false;
|
2947 | }
|
2948 | }
|
2949 |
|
2950 | return true;
|
2951 | }
|
2952 |
|
2953 |
|
2954 |
|
2955 |
|
2956 |
|
2957 |
|
2958 |
|
2959 |
|
2960 |
|
2961 | function getType(object) {
|
2962 | var type = _typeof_1(object);
|
2963 |
|
2964 | if (type === "object") {
|
2965 | if (object === null) {
|
2966 | return "null";
|
2967 | }
|
2968 |
|
2969 | if (object instanceof Boolean) {
|
2970 | return "Boolean";
|
2971 | }
|
2972 |
|
2973 | if (object instanceof Number) {
|
2974 | return "Number";
|
2975 | }
|
2976 |
|
2977 | if (object instanceof String) {
|
2978 | return "String";
|
2979 | }
|
2980 |
|
2981 | if (isArray$5(object)) {
|
2982 | return "Array";
|
2983 | }
|
2984 |
|
2985 | if (object instanceof Date) {
|
2986 | return "Date";
|
2987 | }
|
2988 |
|
2989 | return "Object";
|
2990 | }
|
2991 |
|
2992 | if (type === "number") {
|
2993 | return "Number";
|
2994 | }
|
2995 |
|
2996 | if (type === "boolean") {
|
2997 | return "Boolean";
|
2998 | }
|
2999 |
|
3000 | if (type === "string") {
|
3001 | return "String";
|
3002 | }
|
3003 |
|
3004 | if (type === undefined) {
|
3005 | return "undefined";
|
3006 | }
|
3007 |
|
3008 | return type;
|
3009 | }
|
3010 |
|
3011 |
|
3012 |
|
3013 |
|
3014 |
|
3015 |
|
3016 |
|
3017 |
|
3018 |
|
3019 |
|
3020 | function copyAndExtendArray(arr, newValue) {
|
3021 | var _context2;
|
3022 |
|
3023 | return concat$2(_context2 = []).call(_context2, toConsumableArray(arr), [newValue]);
|
3024 | }
|
3025 |
|
3026 |
|
3027 |
|
3028 |
|
3029 |
|
3030 |
|
3031 |
|
3032 |
|
3033 |
|
3034 | function copyArray(arr) {
|
3035 | return slice$2(arr).call(arr);
|
3036 | }
|
3037 |
|
3038 |
|
3039 |
|
3040 |
|
3041 |
|
3042 |
|
3043 |
|
3044 |
|
3045 |
|
3046 | function getAbsoluteLeft(elem) {
|
3047 | return elem.getBoundingClientRect().left;
|
3048 | }
|
3049 |
|
3050 |
|
3051 |
|
3052 |
|
3053 |
|
3054 |
|
3055 |
|
3056 |
|
3057 |
|
3058 | function getAbsoluteRight(elem) {
|
3059 | return elem.getBoundingClientRect().right;
|
3060 | }
|
3061 |
|
3062 |
|
3063 |
|
3064 |
|
3065 |
|
3066 |
|
3067 |
|
3068 |
|
3069 |
|
3070 | function getAbsoluteTop(elem) {
|
3071 | return elem.getBoundingClientRect().top;
|
3072 | }
|
3073 |
|
3074 |
|
3075 |
|
3076 |
|
3077 |
|
3078 |
|
3079 |
|
3080 |
|
3081 | function addClassName(elem, classNames) {
|
3082 | var classes = elem.className.split(" ");
|
3083 | var newClasses = classNames.split(" ");
|
3084 | classes = concat$2(classes).call(classes, filter$2(newClasses).call(newClasses, function (className) {
|
3085 | return indexOf$3(classes).call(classes, className) < 0;
|
3086 | }));
|
3087 | elem.className = classes.join(" ");
|
3088 | }
|
3089 |
|
3090 |
|
3091 |
|
3092 |
|
3093 |
|
3094 |
|
3095 |
|
3096 |
|
3097 | function removeClassName(elem, classNames) {
|
3098 | var classes = elem.className.split(" ");
|
3099 | var oldClasses = classNames.split(" ");
|
3100 | classes = filter$2(classes).call(classes, function (className) {
|
3101 | return indexOf$3(oldClasses).call(oldClasses, className) < 0;
|
3102 | });
|
3103 | elem.className = classes.join(" ");
|
3104 | }
|
3105 |
|
3106 |
|
3107 |
|
3108 |
|
3109 |
|
3110 |
|
3111 |
|
3112 |
|
3113 |
|
3114 |
|
3115 | function forEach$3(object, callback) {
|
3116 | if (isArray$5(object)) {
|
3117 |
|
3118 | var len = object.length;
|
3119 |
|
3120 | for (var i = 0; i < len; i++) {
|
3121 | callback(object[i], i, object);
|
3122 | }
|
3123 | } else {
|
3124 |
|
3125 | for (var _key2 in object) {
|
3126 | if (Object.prototype.hasOwnProperty.call(object, _key2)) {
|
3127 | callback(object[_key2], _key2, object);
|
3128 | }
|
3129 | }
|
3130 | }
|
3131 | }
|
3132 |
|
3133 |
|
3134 |
|
3135 |
|
3136 |
|
3137 |
|
3138 |
|
3139 |
|
3140 |
|
3141 | var toArray = values$2;
|
3142 |
|
3143 |
|
3144 |
|
3145 |
|
3146 |
|
3147 |
|
3148 |
|
3149 |
|
3150 |
|
3151 |
|
3152 | function updateProperty(object, key, value) {
|
3153 | if (object[key] !== value) {
|
3154 | object[key] = value;
|
3155 | return true;
|
3156 | } else {
|
3157 | return false;
|
3158 | }
|
3159 | }
|
3160 |
|
3161 |
|
3162 |
|
3163 |
|
3164 |
|
3165 |
|
3166 |
|
3167 |
|
3168 |
|
3169 | function throttle(fn) {
|
3170 | var scheduled = false;
|
3171 | return function () {
|
3172 | if (!scheduled) {
|
3173 | scheduled = true;
|
3174 | requestAnimationFrame(function () {
|
3175 | scheduled = false;
|
3176 | fn();
|
3177 | });
|
3178 | }
|
3179 | };
|
3180 | }
|
3181 |
|
3182 |
|
3183 |
|
3184 |
|
3185 |
|
3186 |
|
3187 |
|
3188 |
|
3189 |
|
3190 |
|
3191 | function addEventListener(element, action, listener, useCapture) {
|
3192 | if (element.addEventListener) {
|
3193 | var _context3;
|
3194 |
|
3195 | if (useCapture === undefined) {
|
3196 | useCapture = false;
|
3197 | }
|
3198 |
|
3199 | if (action === "mousewheel" && indexOf$3(_context3 = navigator.userAgent).call(_context3, "Firefox") >= 0) {
|
3200 | action = "DOMMouseScroll";
|
3201 | }
|
3202 |
|
3203 | element.addEventListener(action, listener, useCapture);
|
3204 | } else {
|
3205 |
|
3206 | element.attachEvent("on" + action, listener);
|
3207 | }
|
3208 | }
|
3209 |
|
3210 |
|
3211 |
|
3212 |
|
3213 |
|
3214 |
|
3215 |
|
3216 |
|
3217 |
|
3218 |
|
3219 | function removeEventListener(element, action, listener, useCapture) {
|
3220 | if (element.removeEventListener) {
|
3221 | var _context4;
|
3222 |
|
3223 |
|
3224 | if (useCapture === undefined) {
|
3225 | useCapture = false;
|
3226 | }
|
3227 |
|
3228 | if (action === "mousewheel" && indexOf$3(_context4 = navigator.userAgent).call(_context4, "Firefox") >= 0) {
|
3229 | action = "DOMMouseScroll";
|
3230 | }
|
3231 |
|
3232 | element.removeEventListener(action, listener, useCapture);
|
3233 | } else {
|
3234 |
|
3235 | element.detachEvent("on" + action, listener);
|
3236 | }
|
3237 | }
|
3238 |
|
3239 |
|
3240 |
|
3241 |
|
3242 |
|
3243 |
|
3244 |
|
3245 | function preventDefault(event) {
|
3246 | if (!event) {
|
3247 | event = window.event;
|
3248 | }
|
3249 |
|
3250 | if (!event) ;else if (event.preventDefault) {
|
3251 | event.preventDefault();
|
3252 | } else {
|
3253 |
|
3254 | event.returnValue = false;
|
3255 | }
|
3256 | }
|
3257 |
|
3258 |
|
3259 |
|
3260 |
|
3261 |
|
3262 |
|
3263 |
|
3264 |
|
3265 |
|
3266 | function getTarget() {
|
3267 | var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.event;
|
3268 |
|
3269 |
|
3270 | var target = null;
|
3271 | if (!event) ;else if (event.target) {
|
3272 | target = event.target;
|
3273 | } else if (event.srcElement) {
|
3274 | target = event.srcElement;
|
3275 | }
|
3276 |
|
3277 | if (!(target instanceof Element)) {
|
3278 | return null;
|
3279 | }
|
3280 |
|
3281 | if (target.nodeType != null && target.nodeType == 3) {
|
3282 |
|
3283 | target = target.parentNode;
|
3284 |
|
3285 | if (!(target instanceof Element)) {
|
3286 | return null;
|
3287 | }
|
3288 | }
|
3289 |
|
3290 | return target;
|
3291 | }
|
3292 |
|
3293 |
|
3294 |
|
3295 |
|
3296 |
|
3297 |
|
3298 |
|
3299 |
|
3300 |
|
3301 |
|
3302 | function hasParent(element, parent) {
|
3303 | var elem = element;
|
3304 |
|
3305 | while (elem) {
|
3306 | if (elem === parent) {
|
3307 | return true;
|
3308 | } else if (elem.parentNode) {
|
3309 | elem = elem.parentNode;
|
3310 | } else {
|
3311 | return false;
|
3312 | }
|
3313 | }
|
3314 |
|
3315 | return false;
|
3316 | }
|
3317 |
|
3318 | var option = {
|
3319 | |
3320 |
|
3321 |
|
3322 |
|
3323 |
|
3324 |
|
3325 |
|
3326 |
|
3327 | asBoolean: function asBoolean(value, defaultValue) {
|
3328 | if (typeof value == "function") {
|
3329 | value = value();
|
3330 | }
|
3331 |
|
3332 | if (value != null) {
|
3333 | return value != false;
|
3334 | }
|
3335 |
|
3336 | return defaultValue || null;
|
3337 | },
|
3338 |
|
3339 | |
3340 |
|
3341 |
|
3342 |
|
3343 |
|
3344 |
|
3345 |
|
3346 |
|
3347 | asNumber: function asNumber(value, defaultValue) {
|
3348 | if (typeof value == "function") {
|
3349 | value = value();
|
3350 | }
|
3351 |
|
3352 | if (value != null) {
|
3353 | return Number(value) || defaultValue || null;
|
3354 | }
|
3355 |
|
3356 | return defaultValue || null;
|
3357 | },
|
3358 |
|
3359 | |
3360 |
|
3361 |
|
3362 |
|
3363 |
|
3364 |
|
3365 |
|
3366 |
|
3367 | asString: function asString(value, defaultValue) {
|
3368 | if (typeof value == "function") {
|
3369 | value = value();
|
3370 | }
|
3371 |
|
3372 | if (value != null) {
|
3373 | return String(value);
|
3374 | }
|
3375 |
|
3376 | return defaultValue || null;
|
3377 | },
|
3378 |
|
3379 | |
3380 |
|
3381 |
|
3382 |
|
3383 |
|
3384 |
|
3385 |
|
3386 |
|
3387 | asSize: function asSize(value, defaultValue) {
|
3388 | if (typeof value == "function") {
|
3389 | value = value();
|
3390 | }
|
3391 |
|
3392 | if (isString(value)) {
|
3393 | return value;
|
3394 | } else if (isNumber(value)) {
|
3395 | return value + "px";
|
3396 | } else {
|
3397 | return defaultValue || null;
|
3398 | }
|
3399 | },
|
3400 |
|
3401 | |
3402 |
|
3403 |
|
3404 |
|
3405 |
|
3406 |
|
3407 |
|
3408 |
|
3409 | asElement: function asElement(value, defaultValue) {
|
3410 | if (typeof value == "function") {
|
3411 | value = value();
|
3412 | }
|
3413 |
|
3414 | return value || defaultValue || null;
|
3415 | }
|
3416 | };
|
3417 |
|
3418 |
|
3419 |
|
3420 |
|
3421 |
|
3422 |
|
3423 |
|
3424 |
|
3425 |
|
3426 | function hexToRGB(hex) {
|
3427 | var result;
|
3428 |
|
3429 | switch (hex.length) {
|
3430 | case 3:
|
3431 | case 4:
|
3432 | result = shortHexRE.exec(hex);
|
3433 | return result ? {
|
3434 | r: _parseInt$3(result[1] + result[1], 16),
|
3435 | g: _parseInt$3(result[2] + result[2], 16),
|
3436 | b: _parseInt$3(result[3] + result[3], 16)
|
3437 | } : null;
|
3438 |
|
3439 | case 6:
|
3440 | case 7:
|
3441 | result = fullHexRE.exec(hex);
|
3442 | return result ? {
|
3443 | r: _parseInt$3(result[1], 16),
|
3444 | g: _parseInt$3(result[2], 16),
|
3445 | b: _parseInt$3(result[3], 16)
|
3446 | } : null;
|
3447 |
|
3448 | default:
|
3449 | return null;
|
3450 | }
|
3451 | }
|
3452 |
|
3453 |
|
3454 |
|
3455 |
|
3456 |
|
3457 |
|
3458 |
|
3459 |
|
3460 |
|
3461 |
|
3462 | function overrideOpacity(color, opacity) {
|
3463 | if (indexOf$3(color).call(color, "rgba") !== -1) {
|
3464 | return color;
|
3465 | } else if (indexOf$3(color).call(color, "rgb") !== -1) {
|
3466 | var rgb = color.substr(indexOf$3(color).call(color, "(") + 1).replace(")", "").split(",");
|
3467 | return "rgba(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "," + opacity + ")";
|
3468 | } else {
|
3469 | var _rgb = hexToRGB(color);
|
3470 |
|
3471 | if (_rgb == null) {
|
3472 | return color;
|
3473 | } else {
|
3474 | return "rgba(" + _rgb.r + "," + _rgb.g + "," + _rgb.b + "," + opacity + ")";
|
3475 | }
|
3476 | }
|
3477 | }
|
3478 |
|
3479 |
|
3480 |
|
3481 |
|
3482 |
|
3483 |
|
3484 |
|
3485 |
|
3486 |
|
3487 |
|
3488 |
|
3489 | function RGBToHex(red, green, blue) {
|
3490 | var _context5;
|
3491 |
|
3492 | return "#" + slice$2(_context5 = ((1 << 24) + (red << 16) + (green << 8) + blue).toString(16)).call(_context5, 1);
|
3493 | }
|
3494 |
|
3495 |
|
3496 |
|
3497 |
|
3498 |
|
3499 |
|
3500 |
|
3501 |
|
3502 |
|
3503 |
|
3504 | function parseColor(inputColor, defaultColor) {
|
3505 | if (isString(inputColor)) {
|
3506 | var colorStr = inputColor;
|
3507 |
|
3508 | if (isValidRGB(colorStr)) {
|
3509 | var _context6;
|
3510 |
|
3511 | var rgb = map$2(_context6 = colorStr.substr(4).substr(0, colorStr.length - 5).split(",")).call(_context6, function (value) {
|
3512 | return _parseInt$3(value);
|
3513 | });
|
3514 | colorStr = RGBToHex(rgb[0], rgb[1], rgb[2]);
|
3515 | }
|
3516 |
|
3517 | if (isValidHex(colorStr) === true) {
|
3518 | var hsv = hexToHSV(colorStr);
|
3519 | var lighterColorHSV = {
|
3520 | h: hsv.h,
|
3521 | s: hsv.s * 0.8,
|
3522 | v: Math.min(1, hsv.v * 1.02)
|
3523 | };
|
3524 | var darkerColorHSV = {
|
3525 | h: hsv.h,
|
3526 | s: Math.min(1, hsv.s * 1.25),
|
3527 | v: hsv.v * 0.8
|
3528 | };
|
3529 | var darkerColorHex = HSVToHex(darkerColorHSV.h, darkerColorHSV.s, darkerColorHSV.v);
|
3530 | var lighterColorHex = HSVToHex(lighterColorHSV.h, lighterColorHSV.s, lighterColorHSV.v);
|
3531 | return {
|
3532 | background: colorStr,
|
3533 | border: darkerColorHex,
|
3534 | highlight: {
|
3535 | background: lighterColorHex,
|
3536 | border: darkerColorHex
|
3537 | },
|
3538 | hover: {
|
3539 | background: lighterColorHex,
|
3540 | border: darkerColorHex
|
3541 | }
|
3542 | };
|
3543 | } else {
|
3544 | return {
|
3545 | background: colorStr,
|
3546 | border: colorStr,
|
3547 | highlight: {
|
3548 | background: colorStr,
|
3549 | border: colorStr
|
3550 | },
|
3551 | hover: {
|
3552 | background: colorStr,
|
3553 | border: colorStr
|
3554 | }
|
3555 | };
|
3556 | }
|
3557 | } else {
|
3558 | if (defaultColor) {
|
3559 | var color = {
|
3560 | background: inputColor.background || defaultColor.background,
|
3561 | border: inputColor.border || defaultColor.border,
|
3562 | highlight: isString(inputColor.highlight) ? {
|
3563 | border: inputColor.highlight,
|
3564 | background: inputColor.highlight
|
3565 | } : {
|
3566 | background: inputColor.highlight && inputColor.highlight.background || defaultColor.highlight.background,
|
3567 | border: inputColor.highlight && inputColor.highlight.border || defaultColor.highlight.border
|
3568 | },
|
3569 | hover: isString(inputColor.hover) ? {
|
3570 | border: inputColor.hover,
|
3571 | background: inputColor.hover
|
3572 | } : {
|
3573 | border: inputColor.hover && inputColor.hover.border || defaultColor.hover.border,
|
3574 | background: inputColor.hover && inputColor.hover.background || defaultColor.hover.background
|
3575 | }
|
3576 | };
|
3577 | return color;
|
3578 | } else {
|
3579 | var _color = {
|
3580 | background: inputColor.background || undefined,
|
3581 | border: inputColor.border || undefined,
|
3582 | highlight: isString(inputColor.highlight) ? {
|
3583 | border: inputColor.highlight,
|
3584 | background: inputColor.highlight
|
3585 | } : {
|
3586 | background: inputColor.highlight && inputColor.highlight.background || undefined,
|
3587 | border: inputColor.highlight && inputColor.highlight.border || undefined
|
3588 | },
|
3589 | hover: isString(inputColor.hover) ? {
|
3590 | border: inputColor.hover,
|
3591 | background: inputColor.hover
|
3592 | } : {
|
3593 | border: inputColor.hover && inputColor.hover.border || undefined,
|
3594 | background: inputColor.hover && inputColor.hover.background || undefined
|
3595 | }
|
3596 | };
|
3597 | return _color;
|
3598 | }
|
3599 | }
|
3600 | }
|
3601 |
|
3602 |
|
3603 |
|
3604 |
|
3605 |
|
3606 |
|
3607 |
|
3608 |
|
3609 |
|
3610 |
|
3611 |
|
3612 |
|
3613 | function RGBToHSV(red, green, blue) {
|
3614 | red = red / 255;
|
3615 | green = green / 255;
|
3616 | blue = blue / 255;
|
3617 | var minRGB = Math.min(red, Math.min(green, blue));
|
3618 | var maxRGB = Math.max(red, Math.max(green, blue));
|
3619 |
|
3620 | if (minRGB === maxRGB) {
|
3621 | return {
|
3622 | h: 0,
|
3623 | s: 0,
|
3624 | v: minRGB
|
3625 | };
|
3626 | }
|
3627 |
|
3628 |
|
3629 | var d = red === minRGB ? green - blue : blue === minRGB ? red - green : blue - red;
|
3630 | var h = red === minRGB ? 3 : blue === minRGB ? 1 : 5;
|
3631 | var hue = 60 * (h - d / (maxRGB - minRGB)) / 360;
|
3632 | var saturation = (maxRGB - minRGB) / maxRGB;
|
3633 | var value = maxRGB;
|
3634 | return {
|
3635 | h: hue,
|
3636 | s: saturation,
|
3637 | v: value
|
3638 | };
|
3639 | }
|
3640 |
|
3641 | var cssUtil = {
|
3642 |
|
3643 | split: function split(cssText) {
|
3644 | var _context7;
|
3645 |
|
3646 | var styles = {};
|
3647 | forEach$2(_context7 = cssText.split(";")).call(_context7, function (style) {
|
3648 | if (trim$2(style).call(style) != "") {
|
3649 | var _context8, _context9;
|
3650 |
|
3651 | var parts = style.split(":");
|
3652 |
|
3653 | var _key3 = trim$2(_context8 = parts[0]).call(_context8);
|
3654 |
|
3655 | var _value = trim$2(_context9 = parts[1]).call(_context9);
|
3656 |
|
3657 | styles[_key3] = _value;
|
3658 | }
|
3659 | });
|
3660 | return styles;
|
3661 | },
|
3662 |
|
3663 | join: function join(styles) {
|
3664 | var _context10;
|
3665 |
|
3666 | return map$2(_context10 = keys$3(styles)).call(_context10, function (key) {
|
3667 | return key + ": " + styles[key];
|
3668 | }).join("; ");
|
3669 | }
|
3670 | };
|
3671 |
|
3672 |
|
3673 |
|
3674 |
|
3675 |
|
3676 |
|
3677 |
|
3678 | function addCssText(element, cssText) {
|
3679 | var currentStyles = cssUtil.split(element.style.cssText);
|
3680 | var newStyles = cssUtil.split(cssText);
|
3681 |
|
3682 | var styles = _objectSpread({}, currentStyles, {}, newStyles);
|
3683 |
|
3684 | element.style.cssText = cssUtil.join(styles);
|
3685 | }
|
3686 |
|
3687 |
|
3688 |
|
3689 |
|
3690 |
|
3691 |
|
3692 |
|
3693 |
|
3694 | function removeCssText(element, cssText) {
|
3695 | var styles = cssUtil.split(element.style.cssText);
|
3696 | var removeStyles = cssUtil.split(cssText);
|
3697 |
|
3698 | for (var _key4 in removeStyles) {
|
3699 | if (Object.prototype.hasOwnProperty.call(removeStyles, _key4)) {
|
3700 | delete styles[_key4];
|
3701 | }
|
3702 | }
|
3703 |
|
3704 | element.style.cssText = cssUtil.join(styles);
|
3705 | }
|
3706 |
|
3707 |
|
3708 |
|
3709 |
|
3710 |
|
3711 |
|
3712 |
|
3713 |
|
3714 |
|
3715 |
|
3716 |
|
3717 |
|
3718 | function HSVToRGB(h, s, v) {
|
3719 | var r;
|
3720 | var g;
|
3721 | var b;
|
3722 | var i = Math.floor(h * 6);
|
3723 | var f = h * 6 - i;
|
3724 | var p = v * (1 - s);
|
3725 | var q = v * (1 - f * s);
|
3726 | var t = v * (1 - (1 - f) * s);
|
3727 |
|
3728 | switch (i % 6) {
|
3729 | case 0:
|
3730 | r = v, g = t, b = p;
|
3731 | break;
|
3732 |
|
3733 | case 1:
|
3734 | r = q, g = v, b = p;
|
3735 | break;
|
3736 |
|
3737 | case 2:
|
3738 | r = p, g = v, b = t;
|
3739 | break;
|
3740 |
|
3741 | case 3:
|
3742 | r = p, g = q, b = v;
|
3743 | break;
|
3744 |
|
3745 | case 4:
|
3746 | r = t, g = p, b = v;
|
3747 | break;
|
3748 |
|
3749 | case 5:
|
3750 | r = v, g = p, b = q;
|
3751 | break;
|
3752 | }
|
3753 |
|
3754 | return {
|
3755 | r: Math.floor(r * 255),
|
3756 | g: Math.floor(g * 255),
|
3757 | b: Math.floor(b * 255)
|
3758 | };
|
3759 | }
|
3760 |
|
3761 |
|
3762 |
|
3763 |
|
3764 |
|
3765 |
|
3766 |
|
3767 |
|
3768 |
|
3769 |
|
3770 |
|
3771 | function HSVToHex(h, s, v) {
|
3772 | var rgb = HSVToRGB(h, s, v);
|
3773 | return RGBToHex(rgb.r, rgb.g, rgb.b);
|
3774 | }
|
3775 |
|
3776 |
|
3777 |
|
3778 |
|
3779 |
|
3780 |
|
3781 |
|
3782 |
|
3783 |
|
3784 | function hexToHSV(hex) {
|
3785 | var rgb = hexToRGB(hex);
|
3786 |
|
3787 | if (!rgb) {
|
3788 | throw new TypeError("'".concat(hex, "' is not a valid color."));
|
3789 | }
|
3790 |
|
3791 | return RGBToHSV(rgb.r, rgb.g, rgb.b);
|
3792 | }
|
3793 |
|
3794 |
|
3795 |
|
3796 |
|
3797 |
|
3798 |
|
3799 |
|
3800 |
|
3801 |
|
3802 | function isValidHex(hex) {
|
3803 | var isOk = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex);
|
3804 | return isOk;
|
3805 | }
|
3806 |
|
3807 |
|
3808 |
|
3809 |
|
3810 |
|
3811 |
|
3812 |
|
3813 |
|
3814 |
|
3815 | function isValidRGB(rgb) {
|
3816 | return rgbRE.test(rgb);
|
3817 | }
|
3818 |
|
3819 |
|
3820 |
|
3821 |
|
3822 |
|
3823 |
|
3824 |
|
3825 |
|
3826 |
|
3827 | function isValidRGBA(rgba) {
|
3828 | return rgbaRE.test(rgba);
|
3829 | }
|
3830 |
|
3831 |
|
3832 |
|
3833 |
|
3834 |
|
3835 |
|
3836 |
|
3837 |
|
3838 |
|
3839 |
|
3840 |
|
3841 | function selectiveBridgeObject(fields, referenceObject) {
|
3842 | if (referenceObject !== null && _typeof_1(referenceObject) === "object") {
|
3843 |
|
3844 | var objectTo = create$2(referenceObject);
|
3845 |
|
3846 | for (var i = 0; i < fields.length; i++) {
|
3847 | if (Object.prototype.hasOwnProperty.call(referenceObject, fields[i])) {
|
3848 | if (_typeof_1(referenceObject[fields[i]]) == "object") {
|
3849 | objectTo[fields[i]] = bridgeObject(referenceObject[fields[i]]);
|
3850 | }
|
3851 | }
|
3852 | }
|
3853 |
|
3854 | return objectTo;
|
3855 | } else {
|
3856 | return null;
|
3857 | }
|
3858 | }
|
3859 |
|
3860 |
|
3861 |
|
3862 |
|
3863 |
|
3864 |
|
3865 |
|
3866 |
|
3867 |
|
3868 |
|
3869 | function bridgeObject(referenceObject) {
|
3870 | if (referenceObject === null || _typeof_1(referenceObject) !== "object") {
|
3871 | return null;
|
3872 | }
|
3873 |
|
3874 | if (referenceObject instanceof Element) {
|
3875 |
|
3876 | return referenceObject;
|
3877 | }
|
3878 |
|
3879 | var objectTo = create$2(referenceObject);
|
3880 |
|
3881 | for (var i in referenceObject) {
|
3882 | if (Object.prototype.hasOwnProperty.call(referenceObject, i)) {
|
3883 | if (_typeof_1(referenceObject[i]) == "object") {
|
3884 | objectTo[i] = bridgeObject(referenceObject[i]);
|
3885 | }
|
3886 | }
|
3887 | }
|
3888 |
|
3889 | return objectTo;
|
3890 | }
|
3891 |
|
3892 |
|
3893 |
|
3894 |
|
3895 |
|
3896 |
|
3897 |
|
3898 |
|
3899 |
|
3900 |
|
3901 | function insertSort(a, compare) {
|
3902 | for (var i = 0; i < a.length; i++) {
|
3903 | var k = a[i];
|
3904 | var j = void 0;
|
3905 |
|
3906 | for (j = i; j > 0 && compare(k, a[j - 1]) < 0; j--) {
|
3907 | a[j] = a[j - 1];
|
3908 | }
|
3909 |
|
3910 | a[j] = k;
|
3911 | }
|
3912 |
|
3913 | return a;
|
3914 | }
|
3915 |
|
3916 |
|
3917 |
|
3918 |
|
3919 |
|
3920 |
|
3921 |
|
3922 |
|
3923 |
|
3924 |
|
3925 |
|
3926 |
|
3927 |
|
3928 |
|
3929 |
|
3930 | function mergeOptions(mergeTarget, options, option) {
|
3931 | var globalOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
3932 |
|
3933 | var isPresent = function isPresent(obj) {
|
3934 | return obj !== null && obj !== undefined;
|
3935 | };
|
3936 |
|
3937 | var isObject = function isObject(obj) {
|
3938 | return obj !== null && _typeof_1(obj) === "object";
|
3939 | };
|
3940 |
|
3941 |
|
3942 | var isEmpty = function isEmpty(obj) {
|
3943 | for (var x in obj) {
|
3944 | if (Object.prototype.hasOwnProperty.call(obj, x)) {
|
3945 | return false;
|
3946 | }
|
3947 | }
|
3948 |
|
3949 | return true;
|
3950 | };
|
3951 |
|
3952 |
|
3953 | if (!isObject(mergeTarget)) {
|
3954 | throw new Error("Parameter mergeTarget must be an object");
|
3955 | }
|
3956 |
|
3957 | if (!isObject(options)) {
|
3958 | throw new Error("Parameter options must be an object");
|
3959 | }
|
3960 |
|
3961 | if (!isPresent(option)) {
|
3962 | throw new Error("Parameter option must have a value");
|
3963 | }
|
3964 |
|
3965 | if (!isObject(globalOptions)) {
|
3966 | throw new Error("Parameter globalOptions must be an object");
|
3967 | }
|
3968 |
|
3969 |
|
3970 |
|
3971 |
|
3972 |
|
3973 | var doMerge = function doMerge(target, options, option) {
|
3974 | if (!isObject(target[option])) {
|
3975 | target[option] = {};
|
3976 | }
|
3977 |
|
3978 | var src = options[option];
|
3979 | var dst = target[option];
|
3980 |
|
3981 | for (var prop in src) {
|
3982 | if (Object.prototype.hasOwnProperty.call(src, prop)) {
|
3983 | dst[prop] = src[prop];
|
3984 | }
|
3985 | }
|
3986 | };
|
3987 |
|
3988 |
|
3989 | var srcOption = options[option];
|
3990 | var globalPassed = isObject(globalOptions) && !isEmpty(globalOptions);
|
3991 | var globalOption = globalPassed ? globalOptions[option] : undefined;
|
3992 | var globalEnabled = globalOption ? globalOption.enabled : undefined;
|
3993 |
|
3994 |
|
3995 |
|
3996 | if (srcOption === undefined) {
|
3997 | return;
|
3998 | }
|
3999 |
|
4000 | if (typeof srcOption === "boolean") {
|
4001 | if (!isObject(mergeTarget[option])) {
|
4002 | mergeTarget[option] = {};
|
4003 | }
|
4004 |
|
4005 | mergeTarget[option].enabled = srcOption;
|
4006 | return;
|
4007 | }
|
4008 |
|
4009 | if (srcOption === null && !isObject(mergeTarget[option])) {
|
4010 |
|
4011 | if (isPresent(globalOption)) {
|
4012 | mergeTarget[option] = create$2(globalOption);
|
4013 | } else {
|
4014 | return;
|
4015 | }
|
4016 | }
|
4017 |
|
4018 | if (!isObject(srcOption)) {
|
4019 | return;
|
4020 | }
|
4021 |
|
4022 |
|
4023 |
|
4024 |
|
4025 |
|
4026 | var enabled = true;
|
4027 |
|
4028 | if (srcOption.enabled !== undefined) {
|
4029 | enabled = srcOption.enabled;
|
4030 | } else {
|
4031 |
|
4032 | if (globalEnabled !== undefined) {
|
4033 | enabled = globalOption.enabled;
|
4034 | }
|
4035 | }
|
4036 |
|
4037 | doMerge(mergeTarget, options, option);
|
4038 | mergeTarget[option].enabled = enabled;
|
4039 | }
|
4040 |
|
4041 |
|
4042 |
|
4043 |
|
4044 |
|
4045 |
|
4046 |
|
4047 |
|
4048 |
|
4049 |
|
4050 |
|
4051 |
|
4052 |
|
4053 | function binarySearchCustom(orderedItems, comparator, field, field2) {
|
4054 | var maxIterations = 10000;
|
4055 | var iteration = 0;
|
4056 | var low = 0;
|
4057 | var high = orderedItems.length - 1;
|
4058 |
|
4059 | while (low <= high && iteration < maxIterations) {
|
4060 | var middle = Math.floor((low + high) / 2);
|
4061 | var item = orderedItems[middle];
|
4062 |
|
4063 | var _value2 = field2 === undefined ? item[field] : item[field][field2];
|
4064 |
|
4065 | var searchResult = comparator(_value2);
|
4066 |
|
4067 | if (searchResult == 0) {
|
4068 |
|
4069 | return middle;
|
4070 | } else if (searchResult == -1) {
|
4071 |
|
4072 | low = middle + 1;
|
4073 | } else {
|
4074 |
|
4075 | high = middle - 1;
|
4076 | }
|
4077 |
|
4078 | iteration++;
|
4079 | }
|
4080 |
|
4081 | return -1;
|
4082 | }
|
4083 |
|
4084 |
|
4085 |
|
4086 |
|
4087 |
|
4088 |
|
4089 |
|
4090 |
|
4091 |
|
4092 |
|
4093 |
|
4094 |
|
4095 |
|
4096 |
|
4097 |
|
4098 | function binarySearchValue(orderedItems, target, field, sidePreference, comparator) {
|
4099 | var maxIterations = 10000;
|
4100 | var iteration = 0;
|
4101 | var low = 0;
|
4102 | var high = orderedItems.length - 1;
|
4103 | var prevValue;
|
4104 | var value;
|
4105 | var nextValue;
|
4106 | var middle;
|
4107 | comparator = comparator != undefined ? comparator : function (a, b) {
|
4108 | return a == b ? 0 : a < b ? -1 : 1;
|
4109 | };
|
4110 |
|
4111 | while (low <= high && iteration < maxIterations) {
|
4112 |
|
4113 | middle = Math.floor(0.5 * (high + low));
|
4114 | prevValue = orderedItems[Math.max(0, middle - 1)][field];
|
4115 | value = orderedItems[middle][field];
|
4116 | nextValue = orderedItems[Math.min(orderedItems.length - 1, middle + 1)][field];
|
4117 |
|
4118 | if (comparator(value, target) == 0) {
|
4119 |
|
4120 | return middle;
|
4121 | } else if (comparator(prevValue, target) < 0 && comparator(value, target) > 0) {
|
4122 |
|
4123 | return sidePreference == "before" ? Math.max(0, middle - 1) : middle;
|
4124 | } else if (comparator(value, target) < 0 && comparator(nextValue, target) > 0) {
|
4125 |
|
4126 | return sidePreference == "before" ? middle : Math.min(orderedItems.length - 1, middle + 1);
|
4127 | } else {
|
4128 |
|
4129 | if (comparator(value, target) < 0) {
|
4130 |
|
4131 | low = middle + 1;
|
4132 | } else {
|
4133 |
|
4134 | high = middle - 1;
|
4135 | }
|
4136 | }
|
4137 |
|
4138 | iteration++;
|
4139 | }
|
4140 |
|
4141 |
|
4142 | return -1;
|
4143 | }
|
4144 |
|
4145 |
|
4146 |
|
4147 |
|
4148 |
|
4149 |
|
4150 |
|
4151 |
|
4152 |
|
4153 | var easingFunctions = {
|
4154 | |
4155 |
|
4156 |
|
4157 |
|
4158 |
|
4159 |
|
4160 |
|
4161 | linear: function linear(t) {
|
4162 | return t;
|
4163 | },
|
4164 |
|
4165 | |
4166 |
|
4167 |
|
4168 |
|
4169 |
|
4170 |
|
4171 |
|
4172 | easeInQuad: function easeInQuad(t) {
|
4173 | return t * t;
|
4174 | },
|
4175 |
|
4176 | |
4177 |
|
4178 |
|
4179 |
|
4180 |
|
4181 |
|
4182 |
|
4183 | easeOutQuad: function easeOutQuad(t) {
|
4184 | return t * (2 - t);
|
4185 | },
|
4186 |
|
4187 | |
4188 |
|
4189 |
|
4190 |
|
4191 |
|
4192 |
|
4193 |
|
4194 | easeInOutQuad: function easeInOutQuad(t) {
|
4195 | return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
|
4196 | },
|
4197 |
|
4198 | |
4199 |
|
4200 |
|
4201 |
|
4202 |
|
4203 |
|
4204 |
|
4205 | easeInCubic: function easeInCubic(t) {
|
4206 | return t * t * t;
|
4207 | },
|
4208 |
|
4209 | |
4210 |
|
4211 |
|
4212 |
|
4213 |
|
4214 |
|
4215 |
|
4216 | easeOutCubic: function easeOutCubic(t) {
|
4217 | return --t * t * t + 1;
|
4218 | },
|
4219 |
|
4220 | |
4221 |
|
4222 |
|
4223 |
|
4224 |
|
4225 |
|
4226 |
|
4227 | easeInOutCubic: function easeInOutCubic(t) {
|
4228 | return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
|
4229 | },
|
4230 |
|
4231 | |
4232 |
|
4233 |
|
4234 |
|
4235 |
|
4236 |
|
4237 |
|
4238 | easeInQuart: function easeInQuart(t) {
|
4239 | return t * t * t * t;
|
4240 | },
|
4241 |
|
4242 | |
4243 |
|
4244 |
|
4245 |
|
4246 |
|
4247 |
|
4248 |
|
4249 | easeOutQuart: function easeOutQuart(t) {
|
4250 | return 1 - --t * t * t * t;
|
4251 | },
|
4252 |
|
4253 | |
4254 |
|
4255 |
|
4256 |
|
4257 |
|
4258 |
|
4259 |
|
4260 | easeInOutQuart: function easeInOutQuart(t) {
|
4261 | return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
|
4262 | },
|
4263 |
|
4264 | |
4265 |
|
4266 |
|
4267 |
|
4268 |
|
4269 |
|
4270 |
|
4271 | easeInQuint: function easeInQuint(t) {
|
4272 | return t * t * t * t * t;
|
4273 | },
|
4274 |
|
4275 | |
4276 |
|
4277 |
|
4278 |
|
4279 |
|
4280 |
|
4281 |
|
4282 | easeOutQuint: function easeOutQuint(t) {
|
4283 | return 1 + --t * t * t * t * t;
|
4284 | },
|
4285 |
|
4286 | |
4287 |
|
4288 |
|
4289 |
|
4290 |
|
4291 |
|
4292 |
|
4293 | easeInOutQuint: function easeInOutQuint(t) {
|
4294 | return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
|
4295 | }
|
4296 | };
|
4297 |
|
4298 |
|
4299 |
|
4300 |
|
4301 |
|
4302 |
|
4303 | function getScrollBarWidth() {
|
4304 | var inner = document.createElement("p");
|
4305 | inner.style.width = "100%";
|
4306 | inner.style.height = "200px";
|
4307 | var outer = document.createElement("div");
|
4308 | outer.style.position = "absolute";
|
4309 | outer.style.top = "0px";
|
4310 | outer.style.left = "0px";
|
4311 | outer.style.visibility = "hidden";
|
4312 | outer.style.width = "200px";
|
4313 | outer.style.height = "150px";
|
4314 | outer.style.overflow = "hidden";
|
4315 | outer.appendChild(inner);
|
4316 | document.body.appendChild(outer);
|
4317 | var w1 = inner.offsetWidth;
|
4318 | outer.style.overflow = "scroll";
|
4319 | var w2 = inner.offsetWidth;
|
4320 |
|
4321 | if (w1 == w2) {
|
4322 | w2 = outer.clientWidth;
|
4323 | }
|
4324 |
|
4325 | document.body.removeChild(outer);
|
4326 | return w1 - w2;
|
4327 | }
|
4328 |
|
4329 |
|
4330 |
|
4331 |
|
4332 |
|
4333 |
|
4334 |
|
4335 |
|
4336 |
|
4337 |
|
4338 |
|
4339 |
|
4340 |
|
4341 |
|
4342 |
|
4343 |
|
4344 |
|
4345 |
|
4346 |
|
4347 |
|
4348 |
|
4349 |
|
4350 |
|
4351 |
|
4352 |
|
4353 | function topMost(pile, accessors) {
|
4354 | var candidate;
|
4355 |
|
4356 | if (!isArray$5(accessors)) {
|
4357 | accessors = [accessors];
|
4358 | }
|
4359 |
|
4360 | var _iteratorNormalCompletion = true;
|
4361 | var _didIteratorError = false;
|
4362 | var _iteratorError = undefined;
|
4363 |
|
4364 | try {
|
4365 | for (var _iterator = getIterator$2(pile), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
4366 | var member = _step.value;
|
4367 |
|
4368 | if (member) {
|
4369 | candidate = member[accessors[0]];
|
4370 |
|
4371 | for (var i = 1; i < accessors.length; i++) {
|
4372 | if (candidate) {
|
4373 | candidate = candidate[accessors[i]];
|
4374 | }
|
4375 | }
|
4376 |
|
4377 | if (typeof candidate !== "undefined") {
|
4378 | break;
|
4379 | }
|
4380 | }
|
4381 | }
|
4382 | } catch (err) {
|
4383 | _didIteratorError = true;
|
4384 | _iteratorError = err;
|
4385 | } finally {
|
4386 | try {
|
4387 | if (!_iteratorNormalCompletion && _iterator.return != null) {
|
4388 | _iterator.return();
|
4389 | }
|
4390 | } finally {
|
4391 | if (_didIteratorError) {
|
4392 | throw _iteratorError;
|
4393 | }
|
4394 | }
|
4395 | }
|
4396 |
|
4397 | return candidate;
|
4398 | }
|
4399 |
|
4400 | var util =
|
4401 |
|
4402 | Object.freeze({
|
4403 | __proto__: null,
|
4404 | isNumber: isNumber,
|
4405 | recursiveDOMDelete: recursiveDOMDelete,
|
4406 | isString: isString,
|
4407 | isObject: isObject$1,
|
4408 | isDate: isDate,
|
4409 | fillIfDefined: fillIfDefined,
|
4410 | extend: extend,
|
4411 | selectiveExtend: selectiveExtend,
|
4412 | selectiveDeepExtend: selectiveDeepExtend,
|
4413 | selectiveNotDeepExtend: selectiveNotDeepExtend,
|
4414 | deepExtend: deepExtend,
|
4415 | equalArray: equalArray,
|
4416 | getType: getType,
|
4417 | copyAndExtendArray: copyAndExtendArray,
|
4418 | copyArray: copyArray,
|
4419 | getAbsoluteLeft: getAbsoluteLeft,
|
4420 | getAbsoluteRight: getAbsoluteRight,
|
4421 | getAbsoluteTop: getAbsoluteTop,
|
4422 | addClassName: addClassName,
|
4423 | removeClassName: removeClassName,
|
4424 | forEach: forEach$3,
|
4425 | toArray: toArray,
|
4426 | updateProperty: updateProperty,
|
4427 | throttle: throttle,
|
4428 | addEventListener: addEventListener,
|
4429 | removeEventListener: removeEventListener,
|
4430 | preventDefault: preventDefault,
|
4431 | getTarget: getTarget,
|
4432 | hasParent: hasParent,
|
4433 | option: option,
|
4434 | hexToRGB: hexToRGB,
|
4435 | overrideOpacity: overrideOpacity,
|
4436 | RGBToHex: RGBToHex,
|
4437 | parseColor: parseColor,
|
4438 | RGBToHSV: RGBToHSV,
|
4439 | addCssText: addCssText,
|
4440 | removeCssText: removeCssText,
|
4441 | HSVToRGB: HSVToRGB,
|
4442 | HSVToHex: HSVToHex,
|
4443 | hexToHSV: hexToHSV,
|
4444 | isValidHex: isValidHex,
|
4445 | isValidRGB: isValidRGB,
|
4446 | isValidRGBA: isValidRGBA,
|
4447 | selectiveBridgeObject: selectiveBridgeObject,
|
4448 | bridgeObject: bridgeObject,
|
4449 | insertSort: insertSort,
|
4450 | mergeOptions: mergeOptions,
|
4451 | binarySearchCustom: binarySearchCustom,
|
4452 | binarySearchValue: binarySearchValue,
|
4453 | easingFunctions: easingFunctions,
|
4454 | getScrollBarWidth: getScrollBarWidth,
|
4455 | topMost: topMost,
|
4456 | randomUUID: uuid4
|
4457 | });
|
4458 |
|
4459 | var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
4460 |
|
4461 | function commonjsRequire () {
|
4462 | throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');
|
4463 | }
|
4464 |
|
4465 | function createCommonjsModule$1(fn, module) {
|
4466 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
4467 | }
|
4468 |
|
4469 | var DOMutil = createCommonjsModule$1(function (module, exports) {
|
4470 |
|
4471 |
|
4472 | |
4473 |
|
4474 |
|
4475 |
|
4476 |
|
4477 | exports.prepareElements = function (JSONcontainer) {
|
4478 |
|
4479 | for (var elementType in JSONcontainer) {
|
4480 | if (JSONcontainer.hasOwnProperty(elementType)) {
|
4481 | JSONcontainer[elementType].redundant = JSONcontainer[elementType].used;
|
4482 | JSONcontainer[elementType].used = [];
|
4483 | }
|
4484 | }
|
4485 | };
|
4486 | |
4487 |
|
4488 |
|
4489 |
|
4490 |
|
4491 |
|
4492 |
|
4493 |
|
4494 |
|
4495 | exports.cleanupElements = function (JSONcontainer) {
|
4496 |
|
4497 | for (var elementType in JSONcontainer) {
|
4498 | if (JSONcontainer.hasOwnProperty(elementType)) {
|
4499 | if (JSONcontainer[elementType].redundant) {
|
4500 | for (var i = 0; i < JSONcontainer[elementType].redundant.length; i++) {
|
4501 | JSONcontainer[elementType].redundant[i].parentNode.removeChild(JSONcontainer[elementType].redundant[i]);
|
4502 | }
|
4503 |
|
4504 | JSONcontainer[elementType].redundant = [];
|
4505 | }
|
4506 | }
|
4507 | }
|
4508 | };
|
4509 | |
4510 |
|
4511 |
|
4512 |
|
4513 |
|
4514 |
|
4515 | exports.resetElements = function (JSONcontainer) {
|
4516 | exports.prepareElements(JSONcontainer);
|
4517 | exports.cleanupElements(JSONcontainer);
|
4518 | exports.prepareElements(JSONcontainer);
|
4519 | };
|
4520 | |
4521 |
|
4522 |
|
4523 |
|
4524 |
|
4525 |
|
4526 |
|
4527 |
|
4528 |
|
4529 |
|
4530 |
|
4531 |
|
4532 | exports.getSVGElement = function (elementType, JSONcontainer, svgContainer) {
|
4533 | var element;
|
4534 |
|
4535 | if (JSONcontainer.hasOwnProperty(elementType)) {
|
4536 |
|
4537 |
|
4538 | if (JSONcontainer[elementType].redundant.length > 0) {
|
4539 | element = JSONcontainer[elementType].redundant[0];
|
4540 | JSONcontainer[elementType].redundant.shift();
|
4541 | } else {
|
4542 |
|
4543 | element = document.createElementNS('http://www.w3.org/2000/svg', elementType);
|
4544 | svgContainer.appendChild(element);
|
4545 | }
|
4546 | } else {
|
4547 |
|
4548 | element = document.createElementNS('http://www.w3.org/2000/svg', elementType);
|
4549 | JSONcontainer[elementType] = {
|
4550 | used: [],
|
4551 | redundant: []
|
4552 | };
|
4553 | svgContainer.appendChild(element);
|
4554 | }
|
4555 |
|
4556 | JSONcontainer[elementType].used.push(element);
|
4557 | return element;
|
4558 | };
|
4559 | |
4560 |
|
4561 |
|
4562 |
|
4563 |
|
4564 |
|
4565 |
|
4566 |
|
4567 |
|
4568 |
|
4569 |
|
4570 |
|
4571 | exports.getDOMElement = function (elementType, JSONcontainer, DOMContainer, insertBefore) {
|
4572 | var element;
|
4573 |
|
4574 | if (JSONcontainer.hasOwnProperty(elementType)) {
|
4575 |
|
4576 |
|
4577 | if (JSONcontainer[elementType].redundant.length > 0) {
|
4578 | element = JSONcontainer[elementType].redundant[0];
|
4579 | JSONcontainer[elementType].redundant.shift();
|
4580 | } else {
|
4581 |
|
4582 | element = document.createElement(elementType);
|
4583 |
|
4584 | if (insertBefore !== undefined) {
|
4585 | DOMContainer.insertBefore(element, insertBefore);
|
4586 | } else {
|
4587 | DOMContainer.appendChild(element);
|
4588 | }
|
4589 | }
|
4590 | } else {
|
4591 |
|
4592 | element = document.createElement(elementType);
|
4593 | JSONcontainer[elementType] = {
|
4594 | used: [],
|
4595 | redundant: []
|
4596 | };
|
4597 |
|
4598 | if (insertBefore !== undefined) {
|
4599 | DOMContainer.insertBefore(element, insertBefore);
|
4600 | } else {
|
4601 | DOMContainer.appendChild(element);
|
4602 | }
|
4603 | }
|
4604 |
|
4605 | JSONcontainer[elementType].used.push(element);
|
4606 | return element;
|
4607 | };
|
4608 | |
4609 |
|
4610 |
|
4611 |
|
4612 |
|
4613 |
|
4614 |
|
4615 |
|
4616 |
|
4617 |
|
4618 |
|
4619 |
|
4620 |
|
4621 |
|
4622 |
|
4623 | exports.drawPoint = function (x, y, groupTemplate, JSONcontainer, svgContainer, labelObj) {
|
4624 | var point;
|
4625 |
|
4626 | if (groupTemplate.style == 'circle') {
|
4627 | point = exports.getSVGElement('circle', JSONcontainer, svgContainer);
|
4628 | point.setAttributeNS(null, "cx", x);
|
4629 | point.setAttributeNS(null, "cy", y);
|
4630 | point.setAttributeNS(null, "r", 0.5 * groupTemplate.size);
|
4631 | } else {
|
4632 | point = exports.getSVGElement('rect', JSONcontainer, svgContainer);
|
4633 | point.setAttributeNS(null, "x", x - 0.5 * groupTemplate.size);
|
4634 | point.setAttributeNS(null, "y", y - 0.5 * groupTemplate.size);
|
4635 | point.setAttributeNS(null, "width", groupTemplate.size);
|
4636 | point.setAttributeNS(null, "height", groupTemplate.size);
|
4637 | }
|
4638 |
|
4639 | if (groupTemplate.styles !== undefined) {
|
4640 | point.setAttributeNS(null, "style", groupTemplate.styles);
|
4641 | }
|
4642 |
|
4643 | point.setAttributeNS(null, "class", groupTemplate.className + " vis-point");
|
4644 |
|
4645 | if (labelObj) {
|
4646 | var label = exports.getSVGElement('text', JSONcontainer, svgContainer);
|
4647 |
|
4648 | if (labelObj.xOffset) {
|
4649 | x = x + labelObj.xOffset;
|
4650 | }
|
4651 |
|
4652 | if (labelObj.yOffset) {
|
4653 | y = y + labelObj.yOffset;
|
4654 | }
|
4655 |
|
4656 | if (labelObj.content) {
|
4657 | label.textContent = labelObj.content;
|
4658 | }
|
4659 |
|
4660 | if (labelObj.className) {
|
4661 | label.setAttributeNS(null, "class", labelObj.className + " vis-label");
|
4662 | }
|
4663 |
|
4664 | label.setAttributeNS(null, "x", x);
|
4665 | label.setAttributeNS(null, "y", y);
|
4666 | }
|
4667 |
|
4668 | return point;
|
4669 | };
|
4670 | |
4671 |
|
4672 |
|
4673 |
|
4674 |
|
4675 |
|
4676 |
|
4677 |
|
4678 |
|
4679 |
|
4680 |
|
4681 |
|
4682 |
|
4683 |
|
4684 | exports.drawBar = function (x, y, width, height, className, JSONcontainer, svgContainer, style) {
|
4685 | if (height != 0) {
|
4686 | if (height < 0) {
|
4687 | height *= -1;
|
4688 | y -= height;
|
4689 | }
|
4690 |
|
4691 | var rect = exports.getSVGElement('rect', JSONcontainer, svgContainer);
|
4692 | rect.setAttributeNS(null, "x", x - 0.5 * width);
|
4693 | rect.setAttributeNS(null, "y", y);
|
4694 | rect.setAttributeNS(null, "width", width);
|
4695 | rect.setAttributeNS(null, "height", height);
|
4696 | rect.setAttributeNS(null, "class", className);
|
4697 |
|
4698 | if (style) {
|
4699 | rect.setAttributeNS(null, "style", style);
|
4700 | }
|
4701 | }
|
4702 | };
|
4703 | });
|
4704 | var DOMutil_1 = DOMutil.prepareElements;
|
4705 | var DOMutil_2 = DOMutil.cleanupElements;
|
4706 | var DOMutil_3 = DOMutil.resetElements;
|
4707 | var DOMutil_4 = DOMutil.getSVGElement;
|
4708 | var DOMutil_5 = DOMutil.getDOMElement;
|
4709 | var DOMutil_6 = DOMutil.drawPoint;
|
4710 | var DOMutil_7 = DOMutil.drawBar;
|
4711 |
|
4712 |
|
4713 |
|
4714 |
|
4715 |
|
4716 |
|
4717 |
|
4718 |
|
4719 |
|
4720 |
|
4721 |
|
4722 |
|
4723 |
|
4724 |
|
4725 |
|
4726 |
|
4727 |
|
4728 |
|
4729 |
|
4730 |
|
4731 |
|
4732 |
|
4733 |
|
4734 |
|
4735 |
|
4736 |
|
4737 | var commonjsGlobal$2 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
4738 |
|
4739 | function createCommonjsModule$2(fn, module) {
|
4740 | return module = {
|
4741 | exports: {}
|
4742 | }, fn(module, module.exports), module.exports;
|
4743 | }
|
4744 |
|
4745 | var check$1 = function (it) {
|
4746 | return it && it.Math == Math && it;
|
4747 | };
|
4748 |
|
4749 |
|
4750 | var global_1$1 =
|
4751 | check$1(typeof globalThis == 'object' && globalThis) || check$1(typeof window == 'object' && window) || check$1(typeof self == 'object' && self) || check$1(typeof commonjsGlobal$2 == 'object' && commonjsGlobal$2) ||
|
4752 | Function('return this')();
|
4753 |
|
4754 | var fails$1 = function (exec) {
|
4755 | try {
|
4756 | return !!exec();
|
4757 | } catch (error) {
|
4758 | return true;
|
4759 | }
|
4760 | };
|
4761 |
|
4762 | var descriptors$1 = !fails$1(function () {
|
4763 | return Object.defineProperty({}, 'a', {
|
4764 | get: function () {
|
4765 | return 7;
|
4766 | }
|
4767 | }).a != 7;
|
4768 | });
|
4769 | var nativePropertyIsEnumerable$2 = {}.propertyIsEnumerable;
|
4770 | var getOwnPropertyDescriptor$4 = Object.getOwnPropertyDescriptor;
|
4771 |
|
4772 | var NASHORN_BUG$1 = getOwnPropertyDescriptor$4 && !nativePropertyIsEnumerable$2.call({
|
4773 | 1: 2
|
4774 | }, 1);
|
4775 |
|
4776 |
|
4777 | var f$7 = NASHORN_BUG$1 ? function propertyIsEnumerable(V) {
|
4778 | var descriptor = getOwnPropertyDescriptor$4(this, V);
|
4779 | return !!descriptor && descriptor.enumerable;
|
4780 | } : nativePropertyIsEnumerable$2;
|
4781 | var objectPropertyIsEnumerable$1 = {
|
4782 | f: f$7
|
4783 | };
|
4784 |
|
4785 | var createPropertyDescriptor$1 = function (bitmap, value) {
|
4786 | return {
|
4787 | enumerable: !(bitmap & 1),
|
4788 | configurable: !(bitmap & 2),
|
4789 | writable: !(bitmap & 4),
|
4790 | value: value
|
4791 | };
|
4792 | };
|
4793 |
|
4794 | var toString$2 = {}.toString;
|
4795 |
|
4796 | var classofRaw$1 = function (it) {
|
4797 | return toString$2.call(it).slice(8, -1);
|
4798 | };
|
4799 |
|
4800 | var split$1 = ''.split;
|
4801 |
|
4802 | var indexedObject$1 = fails$1(function () {
|
4803 |
|
4804 |
|
4805 | return !Object('z').propertyIsEnumerable(0);
|
4806 | }) ? function (it) {
|
4807 | return classofRaw$1(it) == 'String' ? split$1.call(it, '') : Object(it);
|
4808 | } : Object;
|
4809 |
|
4810 |
|
4811 | var requireObjectCoercible$1 = function (it) {
|
4812 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
4813 | return it;
|
4814 | };
|
4815 |
|
4816 | var toIndexedObject$1 = function (it) {
|
4817 | return indexedObject$1(requireObjectCoercible$1(it));
|
4818 | };
|
4819 |
|
4820 | var isObject$2 = function (it) {
|
4821 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
4822 | };
|
4823 |
|
4824 |
|
4825 |
|
4826 |
|
4827 | var toPrimitive$1 = function (input, PREFERRED_STRING) {
|
4828 | if (!isObject$2(input)) return input;
|
4829 | var fn, val;
|
4830 | if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject$2(val = fn.call(input))) return val;
|
4831 | if (typeof (fn = input.valueOf) == 'function' && !isObject$2(val = fn.call(input))) return val;
|
4832 | if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject$2(val = fn.call(input))) return val;
|
4833 | throw TypeError("Can't convert object to primitive value");
|
4834 | };
|
4835 |
|
4836 | var hasOwnProperty$1 = {}.hasOwnProperty;
|
4837 |
|
4838 | var has$2 = function (it, key) {
|
4839 | return hasOwnProperty$1.call(it, key);
|
4840 | };
|
4841 |
|
4842 | var document$2 = global_1$1.document;
|
4843 |
|
4844 | var EXISTS$1 = isObject$2(document$2) && isObject$2(document$2.createElement);
|
4845 |
|
4846 | var documentCreateElement$1 = function (it) {
|
4847 | return EXISTS$1 ? document$2.createElement(it) : {};
|
4848 | };
|
4849 |
|
4850 | var ie8DomDefine$1 = !descriptors$1 && !fails$1(function () {
|
4851 | return Object.defineProperty(documentCreateElement$1('div'), 'a', {
|
4852 | get: function () {
|
4853 | return 7;
|
4854 | }
|
4855 | }).a != 7;
|
4856 | });
|
4857 | var nativeGetOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor;
|
4858 |
|
4859 |
|
4860 | var f$1$1 = descriptors$1 ? nativeGetOwnPropertyDescriptor$3 : function getOwnPropertyDescriptor(O, P) {
|
4861 | O = toIndexedObject$1(O);
|
4862 | P = toPrimitive$1(P, true);
|
4863 | if (ie8DomDefine$1) try {
|
4864 | return nativeGetOwnPropertyDescriptor$3(O, P);
|
4865 | } catch (error) {
|
4866 |
|
4867 | }
|
4868 | if (has$2(O, P)) return createPropertyDescriptor$1(!objectPropertyIsEnumerable$1.f.call(O, P), O[P]);
|
4869 | };
|
4870 | var objectGetOwnPropertyDescriptor$1 = {
|
4871 | f: f$1$1
|
4872 | };
|
4873 | var replacement$1 = /#|\.prototype\./;
|
4874 |
|
4875 | var isForced$1 = function (feature, detection) {
|
4876 | var value = data$1[normalize$1(feature)];
|
4877 | return value == POLYFILL$1 ? true : value == NATIVE$1 ? false : typeof detection == 'function' ? fails$1(detection) : !!detection;
|
4878 | };
|
4879 |
|
4880 | var normalize$1 = isForced$1.normalize = function (string) {
|
4881 | return String(string).replace(replacement$1, '.').toLowerCase();
|
4882 | };
|
4883 |
|
4884 | var data$1 = isForced$1.data = {};
|
4885 | var NATIVE$1 = isForced$1.NATIVE = 'N';
|
4886 | var POLYFILL$1 = isForced$1.POLYFILL = 'P';
|
4887 | var isForced_1$1 = isForced$1;
|
4888 | var path$1 = {};
|
4889 |
|
4890 | var aFunction$2 = function (it) {
|
4891 | if (typeof it != 'function') {
|
4892 | throw TypeError(String(it) + ' is not a function');
|
4893 | }
|
4894 |
|
4895 | return it;
|
4896 | };
|
4897 |
|
4898 | var bindContext$1 = function (fn, that, length) {
|
4899 | aFunction$2(fn);
|
4900 | if (that === undefined) return fn;
|
4901 |
|
4902 | switch (length) {
|
4903 | case 0:
|
4904 | return function () {
|
4905 | return fn.call(that);
|
4906 | };
|
4907 |
|
4908 | case 1:
|
4909 | return function (a) {
|
4910 | return fn.call(that, a);
|
4911 | };
|
4912 |
|
4913 | case 2:
|
4914 | return function (a, b) {
|
4915 | return fn.call(that, a, b);
|
4916 | };
|
4917 |
|
4918 | case 3:
|
4919 | return function (a, b, c) {
|
4920 | return fn.call(that, a, b, c);
|
4921 | };
|
4922 | }
|
4923 |
|
4924 | return function ()
|
4925 | /* ...args */
|
4926 | {
|
4927 | return fn.apply(that, arguments);
|
4928 | };
|
4929 | };
|
4930 |
|
4931 | var anObject$1 = function (it) {
|
4932 | if (!isObject$2(it)) {
|
4933 | throw TypeError(String(it) + ' is not an object');
|
4934 | }
|
4935 |
|
4936 | return it;
|
4937 | };
|
4938 |
|
4939 | var nativeDefineProperty$2 = Object.defineProperty;
|
4940 |
|
4941 |
|
4942 | var f$2$1 = descriptors$1 ? nativeDefineProperty$2 : function defineProperty(O, P, Attributes) {
|
4943 | anObject$1(O);
|
4944 | P = toPrimitive$1(P, true);
|
4945 | anObject$1(Attributes);
|
4946 | if (ie8DomDefine$1) try {
|
4947 | return nativeDefineProperty$2(O, P, Attributes);
|
4948 | } catch (error) {
|
4949 |
|
4950 | }
|
4951 | if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
4952 | if ('value' in Attributes) O[P] = Attributes.value;
|
4953 | return O;
|
4954 | };
|
4955 | var objectDefineProperty$1 = {
|
4956 | f: f$2$1
|
4957 | };
|
4958 | var createNonEnumerableProperty$1 = descriptors$1 ? function (object, key, value) {
|
4959 | return objectDefineProperty$1.f(object, key, createPropertyDescriptor$1(1, value));
|
4960 | } : function (object, key, value) {
|
4961 | object[key] = value;
|
4962 | return object;
|
4963 | };
|
4964 | var getOwnPropertyDescriptor$1$1 = objectGetOwnPropertyDescriptor$1.f;
|
4965 |
|
4966 | var wrapConstructor$1 = function (NativeConstructor) {
|
4967 | var Wrapper = function (a, b, c) {
|
4968 | if (this instanceof NativeConstructor) {
|
4969 | switch (arguments.length) {
|
4970 | case 0:
|
4971 | return new NativeConstructor();
|
4972 |
|
4973 | case 1:
|
4974 | return new NativeConstructor(a);
|
4975 |
|
4976 | case 2:
|
4977 | return new NativeConstructor(a, b);
|
4978 | }
|
4979 |
|
4980 | return new NativeConstructor(a, b, c);
|
4981 | }
|
4982 |
|
4983 | return NativeConstructor.apply(this, arguments);
|
4984 | };
|
4985 |
|
4986 | Wrapper.prototype = NativeConstructor.prototype;
|
4987 | return Wrapper;
|
4988 | };
|
4989 |
|
4990 |
|
4991 |
|
4992 |
|
4993 |
|
4994 |
|
4995 |
|
4996 |
|
4997 |
|
4998 |
|
4999 |
|
5000 |
|
5001 |
|
5002 |
|
5003 |
|
5004 |
|
5005 | var _export$1 = function (options, source) {
|
5006 | var TARGET = options.target;
|
5007 | var GLOBAL = options.global;
|
5008 | var STATIC = options.stat;
|
5009 | var PROTO = options.proto;
|
5010 | var nativeSource = GLOBAL ? global_1$1 : STATIC ? global_1$1[TARGET] : (global_1$1[TARGET] || {}).prototype;
|
5011 | var target = GLOBAL ? path$1 : path$1[TARGET] || (path$1[TARGET] = {});
|
5012 | var targetPrototype = target.prototype;
|
5013 | var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
|
5014 | var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
|
5015 |
|
5016 | for (key in source) {
|
5017 | FORCED = isForced_1$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
5018 |
|
5019 | USE_NATIVE = !FORCED && nativeSource && has$2(nativeSource, key);
|
5020 | targetProperty = target[key];
|
5021 | if (USE_NATIVE) if (options.noTargetGet) {
|
5022 | descriptor = getOwnPropertyDescriptor$1$1(nativeSource, key);
|
5023 | nativeProperty = descriptor && descriptor.value;
|
5024 | } else nativeProperty = nativeSource[key];
|
5025 |
|
5026 | sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key];
|
5027 | if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue;
|
5028 |
|
5029 | if (options.bind && USE_NATIVE) resultProperty = bindContext$1(sourceProperty, global_1$1);
|
5030 | else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor$1(sourceProperty);
|
5031 | else if (PROTO && typeof sourceProperty == 'function') resultProperty = bindContext$1(Function.call, sourceProperty);
|
5032 | else resultProperty = sourceProperty;
|
5033 |
|
5034 | if (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) {
|
5035 | createNonEnumerableProperty$1(resultProperty, 'sham', true);
|
5036 | }
|
5037 |
|
5038 | target[key] = resultProperty;
|
5039 |
|
5040 | if (PROTO) {
|
5041 | VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
|
5042 |
|
5043 | if (!has$2(path$1, VIRTUAL_PROTOTYPE)) {
|
5044 | createNonEnumerableProperty$1(path$1, VIRTUAL_PROTOTYPE, {});
|
5045 | }
|
5046 |
|
5047 |
|
5048 | path$1[VIRTUAL_PROTOTYPE][key] = sourceProperty;
|
5049 |
|
5050 | if (options.real && targetPrototype && !targetPrototype[key]) {
|
5051 | createNonEnumerableProperty$1(targetPrototype, key, sourceProperty);
|
5052 | }
|
5053 | }
|
5054 | }
|
5055 | };
|
5056 |
|
5057 |
|
5058 | _export$1({
|
5059 | target: 'Object',
|
5060 | stat: true,
|
5061 | forced: !descriptors$1,
|
5062 | sham: !descriptors$1
|
5063 | }, {
|
5064 | defineProperty: objectDefineProperty$1.f
|
5065 | });
|
5066 |
|
5067 | var defineProperty_1$1 = createCommonjsModule$2(function (module) {
|
5068 | var Object = path$1.Object;
|
5069 |
|
5070 | var defineProperty = module.exports = function defineProperty(it, key, desc) {
|
5071 | return Object.defineProperty(it, key, desc);
|
5072 | };
|
5073 |
|
5074 | if (Object.defineProperty.sham) defineProperty.sham = true;
|
5075 | });
|
5076 | var defineProperty$7 = defineProperty_1$1;
|
5077 | var defineProperty$1$1 = defineProperty$7;
|
5078 | var ceil$1 = Math.ceil;
|
5079 | var floor$1 = Math.floor;
|
5080 |
|
5081 |
|
5082 | var toInteger$1 = function (argument) {
|
5083 | return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor$1 : ceil$1)(argument);
|
5084 | };
|
5085 |
|
5086 | var min$2 = Math.min;
|
5087 |
|
5088 |
|
5089 | var toLength$1 = function (argument) {
|
5090 | return argument > 0 ? min$2(toInteger$1(argument), 0x1FFFFFFFFFFFFF) : 0;
|
5091 | };
|
5092 |
|
5093 | var max$2 = Math.max;
|
5094 | var min$1$1 = Math.min;
|
5095 |
|
5096 |
|
5097 |
|
5098 | var toAbsoluteIndex$1 = function (index, length) {
|
5099 | var integer = toInteger$1(index);
|
5100 | return integer < 0 ? max$2(integer + length, 0) : min$1$1(integer, length);
|
5101 | };
|
5102 |
|
5103 | var createMethod$5 = function (IS_INCLUDES) {
|
5104 | return function ($this, el, fromIndex) {
|
5105 | var O = toIndexedObject$1($this);
|
5106 | var length = toLength$1(O.length);
|
5107 | var index = toAbsoluteIndex$1(fromIndex, length);
|
5108 | var value;
|
5109 |
|
5110 |
|
5111 | if (IS_INCLUDES && el != el) while (length > index) {
|
5112 | value = O[index++];
|
5113 |
|
5114 | if (value != value) return true;
|
5115 | } else for (; length > index; index++) {
|
5116 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
5117 | }
|
5118 | return !IS_INCLUDES && -1;
|
5119 | };
|
5120 | };
|
5121 |
|
5122 | var arrayIncludes$1 = {
|
5123 |
|
5124 |
|
5125 | includes: createMethod$5(true),
|
5126 |
|
5127 |
|
5128 | indexOf: createMethod$5(false)
|
5129 | };
|
5130 | var hiddenKeys$2 = {};
|
5131 | var indexOf$4 = arrayIncludes$1.indexOf;
|
5132 |
|
5133 | var objectKeysInternal$1 = function (object, names) {
|
5134 | var O = toIndexedObject$1(object);
|
5135 | var i = 0;
|
5136 | var result = [];
|
5137 | var key;
|
5138 |
|
5139 | for (key in O) !has$2(hiddenKeys$2, key) && has$2(O, key) && result.push(key);
|
5140 |
|
5141 |
|
5142 | while (names.length > i) if (has$2(O, key = names[i++])) {
|
5143 | ~indexOf$4(result, key) || result.push(key);
|
5144 | }
|
5145 |
|
5146 | return result;
|
5147 | };
|
5148 |
|
5149 |
|
5150 | var enumBugKeys$1 = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
|
5151 |
|
5152 | var objectKeys$1 = Object.keys || function keys(O) {
|
5153 | return objectKeysInternal$1(O, enumBugKeys$1);
|
5154 | };
|
5155 |
|
5156 |
|
5157 | var objectDefineProperties$1 = descriptors$1 ? Object.defineProperties : function defineProperties(O, Properties) {
|
5158 | anObject$1(O);
|
5159 | var keys = objectKeys$1(Properties);
|
5160 | var length = keys.length;
|
5161 | var index = 0;
|
5162 | var key;
|
5163 |
|
5164 | while (length > index) objectDefineProperty$1.f(O, key = keys[index++], Properties[key]);
|
5165 |
|
5166 | return O;
|
5167 | };
|
5168 |
|
5169 | _export$1({
|
5170 | target: 'Object',
|
5171 | stat: true,
|
5172 | forced: !descriptors$1,
|
5173 | sham: !descriptors$1
|
5174 | }, {
|
5175 | defineProperties: objectDefineProperties$1
|
5176 | });
|
5177 |
|
5178 | var defineProperties_1$1 = createCommonjsModule$2(function (module) {
|
5179 | var Object = path$1.Object;
|
5180 |
|
5181 | var defineProperties = module.exports = function defineProperties(T, D) {
|
5182 | return Object.defineProperties(T, D);
|
5183 | };
|
5184 |
|
5185 | if (Object.defineProperties.sham) defineProperties.sham = true;
|
5186 | });
|
5187 | var defineProperties$2 = defineProperties_1$1;
|
5188 | var defineProperties$1$1 = defineProperties$2;
|
5189 |
|
5190 | var aFunction$1$1 = function (variable) {
|
5191 | return typeof variable == 'function' ? variable : undefined;
|
5192 | };
|
5193 |
|
5194 | var getBuiltIn$1 = function (namespace, method) {
|
5195 | return arguments.length < 2 ? aFunction$1$1(path$1[namespace]) || aFunction$1$1(global_1$1[namespace]) : path$1[namespace] && path$1[namespace][method] || global_1$1[namespace] && global_1$1[namespace][method];
|
5196 | };
|
5197 |
|
5198 | var hiddenKeys$1$1 = enumBugKeys$1.concat('length', 'prototype');
|
5199 |
|
5200 |
|
5201 | var f$3$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
5202 | return objectKeysInternal$1(O, hiddenKeys$1$1);
|
5203 | };
|
5204 |
|
5205 | var objectGetOwnPropertyNames$1 = {
|
5206 | f: f$3$1
|
5207 | };
|
5208 | var f$4$1 = Object.getOwnPropertySymbols;
|
5209 | var objectGetOwnPropertySymbols$1 = {
|
5210 | f: f$4$1
|
5211 | };
|
5212 |
|
5213 | var ownKeys$2 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
|
5214 | var keys = objectGetOwnPropertyNames$1.f(anObject$1(it));
|
5215 | var getOwnPropertySymbols = objectGetOwnPropertySymbols$1.f;
|
5216 | return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
5217 | };
|
5218 |
|
5219 | var createProperty$1 = function (object, key, value) {
|
5220 | var propertyKey = toPrimitive$1(key);
|
5221 | if (propertyKey in object) objectDefineProperty$1.f(object, propertyKey, createPropertyDescriptor$1(0, value));else object[propertyKey] = value;
|
5222 | };
|
5223 |
|
5224 |
|
5225 | _export$1({
|
5226 | target: 'Object',
|
5227 | stat: true,
|
5228 | sham: !descriptors$1
|
5229 | }, {
|
5230 | getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
|
5231 | var O = toIndexedObject$1(object);
|
5232 | var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor$1.f;
|
5233 | var keys = ownKeys$2(O);
|
5234 | var result = {};
|
5235 | var index = 0;
|
5236 | var key, descriptor;
|
5237 |
|
5238 | while (keys.length > index) {
|
5239 | descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
|
5240 | if (descriptor !== undefined) createProperty$1(result, key, descriptor);
|
5241 | }
|
5242 |
|
5243 | return result;
|
5244 | }
|
5245 | });
|
5246 |
|
5247 | var getOwnPropertyDescriptors$3 = path$1.Object.getOwnPropertyDescriptors;
|
5248 | var getOwnPropertyDescriptors$1$1 = getOwnPropertyDescriptors$3;
|
5249 | var getOwnPropertyDescriptors$2$1 = getOwnPropertyDescriptors$1$1;
|
5250 | var iterators$1 = {};
|
5251 |
|
5252 | var setGlobal$1 = function (key, value) {
|
5253 | try {
|
5254 | createNonEnumerableProperty$1(global_1$1, key, value);
|
5255 | } catch (error) {
|
5256 | global_1$1[key] = value;
|
5257 | }
|
5258 |
|
5259 | return value;
|
5260 | };
|
5261 |
|
5262 | var SHARED$1 = '__core-js_shared__';
|
5263 | var store$3 = global_1$1[SHARED$1] || setGlobal$1(SHARED$1, {});
|
5264 | var sharedStore$1 = store$3;
|
5265 | var shared$1 = createCommonjsModule$2(function (module) {
|
5266 | (module.exports = function (key, value) {
|
5267 | return sharedStore$1[key] || (sharedStore$1[key] = value !== undefined ? value : {});
|
5268 | })('versions', []).push({
|
5269 | version: '3.4.0',
|
5270 | mode: 'pure',
|
5271 | copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
5272 | });
|
5273 | });
|
5274 | var functionToString$1 = shared$1('native-function-to-string', Function.toString);
|
5275 | var WeakMap$2 = global_1$1.WeakMap;
|
5276 | var nativeWeakMap$1 = typeof WeakMap$2 === 'function' && /native code/.test(functionToString$1.call(WeakMap$2));
|
5277 | var id$1 = 0;
|
5278 | var postfix$1 = Math.random();
|
5279 |
|
5280 | var uid$1 = function (key) {
|
5281 | return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id$1 + postfix$1).toString(36);
|
5282 | };
|
5283 |
|
5284 | var keys$4 = shared$1('keys');
|
5285 |
|
5286 | var sharedKey$1 = function (key) {
|
5287 | return keys$4[key] || (keys$4[key] = uid$1(key));
|
5288 | };
|
5289 |
|
5290 | var WeakMap$1$1 = global_1$1.WeakMap;
|
5291 | var set$1, get$1, has$1$1;
|
5292 |
|
5293 | var enforce$1 = function (it) {
|
5294 | return has$1$1(it) ? get$1(it) : set$1(it, {});
|
5295 | };
|
5296 |
|
5297 | var getterFor$1 = function (TYPE) {
|
5298 | return function (it) {
|
5299 | var state;
|
5300 |
|
5301 | if (!isObject$2(it) || (state = get$1(it)).type !== TYPE) {
|
5302 | throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
5303 | }
|
5304 |
|
5305 | return state;
|
5306 | };
|
5307 | };
|
5308 |
|
5309 | if (nativeWeakMap$1) {
|
5310 | var store$1$1 = new WeakMap$1$1();
|
5311 | var wmget$1 = store$1$1.get;
|
5312 | var wmhas$1 = store$1$1.has;
|
5313 | var wmset$1 = store$1$1.set;
|
5314 |
|
5315 | set$1 = function (it, metadata) {
|
5316 | wmset$1.call(store$1$1, it, metadata);
|
5317 | return metadata;
|
5318 | };
|
5319 |
|
5320 | get$1 = function (it) {
|
5321 | return wmget$1.call(store$1$1, it) || {};
|
5322 | };
|
5323 |
|
5324 | has$1$1 = function (it) {
|
5325 | return wmhas$1.call(store$1$1, it);
|
5326 | };
|
5327 | } else {
|
5328 | var STATE$1 = sharedKey$1('state');
|
5329 | hiddenKeys$2[STATE$1] = true;
|
5330 |
|
5331 | set$1 = function (it, metadata) {
|
5332 | createNonEnumerableProperty$1(it, STATE$1, metadata);
|
5333 | return metadata;
|
5334 | };
|
5335 |
|
5336 | get$1 = function (it) {
|
5337 | return has$2(it, STATE$1) ? it[STATE$1] : {};
|
5338 | };
|
5339 |
|
5340 | has$1$1 = function (it) {
|
5341 | return has$2(it, STATE$1);
|
5342 | };
|
5343 | }
|
5344 |
|
5345 | var internalState$1 = {
|
5346 | set: set$1,
|
5347 | get: get$1,
|
5348 | has: has$1$1,
|
5349 | enforce: enforce$1,
|
5350 | getterFor: getterFor$1
|
5351 | }; // https://tc39.github.io/ecma262/#sec-toobject
|
5352 |
|
5353 | var toObject$1 = function (argument) {
|
5354 | return Object(requireObjectCoercible$1(argument));
|
5355 | };
|
5356 |
|
5357 | var correctPrototypeGetter$1 = !fails$1(function () {
|
5358 | function F() {
|
5359 |
|
5360 | }
|
5361 |
|
5362 | F.prototype.constructor = null;
|
5363 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
5364 | });
|
5365 | var IE_PROTO$2 = sharedKey$1('IE_PROTO');
|
5366 | var ObjectPrototype$2 = Object.prototype;
|
5367 |
|
5368 |
|
5369 | var objectGetPrototypeOf$1 = correctPrototypeGetter$1 ? Object.getPrototypeOf : function (O) {
|
5370 | O = toObject$1(O);
|
5371 | if (has$2(O, IE_PROTO$2)) return O[IE_PROTO$2];
|
5372 |
|
5373 | if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
5374 | return O.constructor.prototype;
|
5375 | }
|
5376 |
|
5377 | return O instanceof Object ? ObjectPrototype$2 : null;
|
5378 | };
|
5379 | var nativeSymbol$1 = !!Object.getOwnPropertySymbols && !fails$1(function () {
|
5380 |
|
5381 |
|
5382 | return !String(Symbol());
|
5383 | });
|
5384 | var Symbol$1$1 = global_1$1.Symbol;
|
5385 | var store$2$1 = shared$1('wks');
|
5386 |
|
5387 | var wellKnownSymbol$1 = function (name) {
|
5388 | return store$2$1[name] || (store$2$1[name] = nativeSymbol$1 && Symbol$1$1[name] || (nativeSymbol$1 ? Symbol$1$1 : uid$1)('Symbol.' + name));
|
5389 | };
|
5390 |
|
5391 | var ITERATOR$6 = wellKnownSymbol$1('iterator');
|
5392 | var BUGGY_SAFARI_ITERATORS$2 = false;
|
5393 |
|
5394 | var IteratorPrototype$3, PrototypeOfArrayIteratorPrototype$1, arrayIterator$1;
|
5395 |
|
5396 | if ([].keys) {
|
5397 | arrayIterator$1 = [].keys();
|
5398 |
|
5399 | if (!('next' in arrayIterator$1)) BUGGY_SAFARI_ITERATORS$2 = true;else {
|
5400 | PrototypeOfArrayIteratorPrototype$1 = objectGetPrototypeOf$1(objectGetPrototypeOf$1(arrayIterator$1));
|
5401 | if (PrototypeOfArrayIteratorPrototype$1 !== Object.prototype) IteratorPrototype$3 = PrototypeOfArrayIteratorPrototype$1;
|
5402 | }
|
5403 | }
|
5404 |
|
5405 | if (IteratorPrototype$3 == undefined) IteratorPrototype$3 = {};
|
5406 |
|
5407 | var iteratorsCore$1 = {
|
5408 | IteratorPrototype: IteratorPrototype$3,
|
5409 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$2
|
5410 | };
|
5411 | var html$1 = getBuiltIn$1('document', 'documentElement');
|
5412 | var IE_PROTO$1$1 = sharedKey$1('IE_PROTO');
|
5413 | var PROTOTYPE$2 = 'prototype';
|
5414 |
|
5415 | var Empty$1 = function () {
|
5416 |
|
5417 | };
|
5418 |
|
5419 |
|
5420 | var createDict$1 = function () {
|
5421 |
|
5422 | var iframe = documentCreateElement$1('iframe');
|
5423 | var length = enumBugKeys$1.length;
|
5424 | var lt = '<';
|
5425 | var script = 'script';
|
5426 | var gt = '>';
|
5427 | var js = 'java' + script + ':';
|
5428 | var iframeDocument;
|
5429 | iframe.style.display = 'none';
|
5430 | html$1.appendChild(iframe);
|
5431 | iframe.src = String(js);
|
5432 | iframeDocument = iframe.contentWindow.document;
|
5433 | iframeDocument.open();
|
5434 | iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
|
5435 | iframeDocument.close();
|
5436 | createDict$1 = iframeDocument.F;
|
5437 |
|
5438 | while (length--) delete createDict$1[PROTOTYPE$2][enumBugKeys$1[length]];
|
5439 |
|
5440 | return createDict$1();
|
5441 | };
|
5442 |
|
5443 |
|
5444 |
|
5445 | var objectCreate$1 = Object.create || function create(O, Properties) {
|
5446 | var result;
|
5447 |
|
5448 | if (O !== null) {
|
5449 | Empty$1[PROTOTYPE$2] = anObject$1(O);
|
5450 | result = new Empty$1();
|
5451 | Empty$1[PROTOTYPE$2] = null;
|
5452 |
|
5453 | result[IE_PROTO$1$1] = O;
|
5454 | } else result = createDict$1();
|
5455 |
|
5456 | return Properties === undefined ? result : objectDefineProperties$1(result, Properties);
|
5457 | };
|
5458 |
|
5459 | hiddenKeys$2[IE_PROTO$1$1] = true;
|
5460 | var TO_STRING_TAG$4 = wellKnownSymbol$1('toStringTag');
|
5461 |
|
5462 | var CORRECT_ARGUMENTS$1 = classofRaw$1(function () {
|
5463 | return arguments;
|
5464 | }()) == 'Arguments';
|
5465 |
|
5466 | var tryGet$1 = function (it, key) {
|
5467 | try {
|
5468 | return it[key];
|
5469 | } catch (error) {
|
5470 |
|
5471 | }
|
5472 | };
|
5473 |
|
5474 |
|
5475 | var classof$1 = function (it) {
|
5476 | var O, tag, result;
|
5477 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
5478 | : typeof (tag = tryGet$1(O = Object(it), TO_STRING_TAG$4)) == 'string' ? tag
|
5479 | : CORRECT_ARGUMENTS$1 ? classofRaw$1(O)
|
5480 | : (result = classofRaw$1(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
|
5481 | };
|
5482 |
|
5483 | var TO_STRING_TAG$1$1 = wellKnownSymbol$1('toStringTag');
|
5484 | var test$1 = {};
|
5485 | test$1[TO_STRING_TAG$1$1] = 'z';
|
5486 |
|
5487 |
|
5488 | var objectToString$1 = String(test$1) !== '[object z]' ? function toString() {
|
5489 | return '[object ' + classof$1(this) + ']';
|
5490 | } : test$1.toString;
|
5491 | var defineProperty$2$1 = objectDefineProperty$1.f;
|
5492 | var TO_STRING_TAG$2$1 = wellKnownSymbol$1('toStringTag');
|
5493 | var METHOD_REQUIRED$1 = objectToString$1 !== {}.toString;
|
5494 |
|
5495 | var setToStringTag$1 = function (it, TAG, STATIC, SET_METHOD) {
|
5496 | if (it) {
|
5497 | var target = STATIC ? it : it.prototype;
|
5498 |
|
5499 | if (!has$2(target, TO_STRING_TAG$2$1)) {
|
5500 | defineProperty$2$1(target, TO_STRING_TAG$2$1, {
|
5501 | configurable: true,
|
5502 | value: TAG
|
5503 | });
|
5504 | }
|
5505 |
|
5506 | if (SET_METHOD && METHOD_REQUIRED$1) {
|
5507 | createNonEnumerableProperty$1(target, 'toString', objectToString$1);
|
5508 | }
|
5509 | }
|
5510 | };
|
5511 |
|
5512 | var IteratorPrototype$1$1 = iteratorsCore$1.IteratorPrototype;
|
5513 |
|
5514 | var returnThis$2 = function () {
|
5515 | return this;
|
5516 | };
|
5517 |
|
5518 | var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next) {
|
5519 | var TO_STRING_TAG = NAME + ' Iterator';
|
5520 | IteratorConstructor.prototype = objectCreate$1(IteratorPrototype$1$1, {
|
5521 | next: createPropertyDescriptor$1(1, next)
|
5522 | });
|
5523 | setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false, true);
|
5524 | iterators$1[TO_STRING_TAG] = returnThis$2;
|
5525 | return IteratorConstructor;
|
5526 | };
|
5527 |
|
5528 | var aPossiblePrototype$1 = function (it) {
|
5529 | if (!isObject$2(it) && it !== null) {
|
5530 | throw TypeError("Can't set " + String(it) + ' as a prototype');
|
5531 | }
|
5532 |
|
5533 | return it;
|
5534 | };
|
5535 |
|
5536 |
|
5537 |
|
5538 |
|
5539 |
|
5540 | var objectSetPrototypeOf$1 = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
5541 | var CORRECT_SETTER = false;
|
5542 | var test = {};
|
5543 | var setter;
|
5544 |
|
5545 | try {
|
5546 | setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
|
5547 | setter.call(test, []);
|
5548 | CORRECT_SETTER = test instanceof Array;
|
5549 | } catch (error) {
|
5550 |
|
5551 | }
|
5552 |
|
5553 | return function setPrototypeOf(O, proto) {
|
5554 | anObject$1(O);
|
5555 | aPossiblePrototype$1(proto);
|
5556 | if (CORRECT_SETTER) setter.call(O, proto);else O.__proto__ = proto;
|
5557 | return O;
|
5558 | };
|
5559 | }() : undefined);
|
5560 |
|
5561 | var redefine$1 = function (target, key, value, options) {
|
5562 | if (options && options.enumerable) target[key] = value;else createNonEnumerableProperty$1(target, key, value);
|
5563 | };
|
5564 |
|
5565 | var IteratorPrototype$2$1 = iteratorsCore$1.IteratorPrototype;
|
5566 | var BUGGY_SAFARI_ITERATORS$1$1 = iteratorsCore$1.BUGGY_SAFARI_ITERATORS;
|
5567 | var ITERATOR$1$1 = wellKnownSymbol$1('iterator');
|
5568 | var KEYS$1 = 'keys';
|
5569 | var VALUES$1 = 'values';
|
5570 | var ENTRIES$1 = 'entries';
|
5571 |
|
5572 | var returnThis$1$1 = function () {
|
5573 | return this;
|
5574 | };
|
5575 |
|
5576 | var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
5577 | createIteratorConstructor$1(IteratorConstructor, NAME, next);
|
5578 |
|
5579 | var getIterationMethod = function (KIND) {
|
5580 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
5581 | if (!BUGGY_SAFARI_ITERATORS$1$1 && KIND in IterablePrototype) return IterablePrototype[KIND];
|
5582 |
|
5583 | switch (KIND) {
|
5584 | case KEYS$1:
|
5585 | return function keys() {
|
5586 | return new IteratorConstructor(this, KIND);
|
5587 | };
|
5588 |
|
5589 | case VALUES$1:
|
5590 | return function values() {
|
5591 | return new IteratorConstructor(this, KIND);
|
5592 | };
|
5593 |
|
5594 | case ENTRIES$1:
|
5595 | return function entries() {
|
5596 | return new IteratorConstructor(this, KIND);
|
5597 | };
|
5598 | }
|
5599 |
|
5600 | return function () {
|
5601 | return new IteratorConstructor(this);
|
5602 | };
|
5603 | };
|
5604 |
|
5605 | var TO_STRING_TAG = NAME + ' Iterator';
|
5606 | var INCORRECT_VALUES_NAME = false;
|
5607 | var IterablePrototype = Iterable.prototype;
|
5608 | var nativeIterator = IterablePrototype[ITERATOR$1$1] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT];
|
5609 | var defaultIterator = !BUGGY_SAFARI_ITERATORS$1$1 && nativeIterator || getIterationMethod(DEFAULT);
|
5610 | var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
5611 | var CurrentIteratorPrototype, methods, KEY;
|
5612 |
|
5613 | if (anyNativeIterator) {
|
5614 | CurrentIteratorPrototype = objectGetPrototypeOf$1(anyNativeIterator.call(new Iterable()));
|
5615 |
|
5616 | if (IteratorPrototype$2$1 !== Object.prototype && CurrentIteratorPrototype.next) {
|
5617 | setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
|
5618 | iterators$1[TO_STRING_TAG] = returnThis$1$1;
|
5619 | }
|
5620 | }
|
5621 |
|
5622 |
|
5623 | if (DEFAULT == VALUES$1 && nativeIterator && nativeIterator.name !== VALUES$1) {
|
5624 | INCORRECT_VALUES_NAME = true;
|
5625 |
|
5626 | defaultIterator = function values() {
|
5627 | return nativeIterator.call(this);
|
5628 | };
|
5629 | }
|
5630 |
|
5631 |
|
5632 | if (FORCED && IterablePrototype[ITERATOR$1$1] !== defaultIterator) {
|
5633 | createNonEnumerableProperty$1(IterablePrototype, ITERATOR$1$1, defaultIterator);
|
5634 | }
|
5635 |
|
5636 | iterators$1[NAME] = defaultIterator;
|
5637 |
|
5638 | if (DEFAULT) {
|
5639 | methods = {
|
5640 | values: getIterationMethod(VALUES$1),
|
5641 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS$1),
|
5642 | entries: getIterationMethod(ENTRIES$1)
|
5643 | };
|
5644 | if (FORCED) for (KEY in methods) {
|
5645 | if (BUGGY_SAFARI_ITERATORS$1$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
5646 | redefine$1(IterablePrototype, KEY, methods[KEY]);
|
5647 | }
|
5648 | } else _export$1({
|
5649 | target: NAME,
|
5650 | proto: true,
|
5651 | forced: BUGGY_SAFARI_ITERATORS$1$1 || INCORRECT_VALUES_NAME
|
5652 | }, methods);
|
5653 | }
|
5654 |
|
5655 | return methods;
|
5656 | };
|
5657 |
|
5658 | var ARRAY_ITERATOR$1 = 'Array Iterator';
|
5659 | var setInternalState$3 = internalState$1.set;
|
5660 | var getInternalState$3 = internalState$1.getterFor(ARRAY_ITERATOR$1); // `Array.prototype.entries` method
|
5661 | // https://tc39.github.io/ecma262/#sec-array.prototype.entries
|
5662 | // `Array.prototype.keys` method
|
5663 | // https://tc39.github.io/ecma262/#sec-array.prototype.keys
|
5664 | // `Array.prototype.values` method
|
5665 | // https://tc39.github.io/ecma262/#sec-array.prototype.values
|
5666 | // `Array.prototype[@@iterator]` method
|
5667 | // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
|
5668 | // `CreateArrayIterator` internal method
|
5669 | // https://tc39.github.io/ecma262/#sec-createarrayiterator
|
5670 |
|
5671 | var es_array_iterator$1 = defineIterator$1(Array, 'Array', function (iterated, kind) {
|
5672 | setInternalState$3(this, {
|
5673 | type: ARRAY_ITERATOR$1,
|
5674 | target: toIndexedObject$1(iterated),
|
5675 |
|
5676 | index: 0,
|
5677 |
|
5678 | kind: kind
|
5679 |
|
5680 | });
|
5681 |
|
5682 | }, function () {
|
5683 | var state = getInternalState$3(this);
|
5684 | var target = state.target;
|
5685 | var kind = state.kind;
|
5686 | var index = state.index++;
|
5687 |
|
5688 | if (!target || index >= target.length) {
|
5689 | state.target = undefined;
|
5690 | return {
|
5691 | value: undefined,
|
5692 | done: true
|
5693 | };
|
5694 | }
|
5695 |
|
5696 | if (kind == 'keys') return {
|
5697 | value: index,
|
5698 | done: false
|
5699 | };
|
5700 | if (kind == 'values') return {
|
5701 | value: target[index],
|
5702 | done: false
|
5703 | };
|
5704 | return {
|
5705 | value: [index, target[index]],
|
5706 | done: false
|
5707 | };
|
5708 | }, 'values');
|
5709 |
|
5710 |
|
5711 |
|
5712 | iterators$1.Arguments = iterators$1.Array;
|
5713 |
|
5714 |
|
5715 |
|
5716 | var domIterables$1 = {
|
5717 | CSSRuleList: 0,
|
5718 | CSSStyleDeclaration: 0,
|
5719 | CSSValueList: 0,
|
5720 | ClientRectList: 0,
|
5721 | DOMRectList: 0,
|
5722 | DOMStringList: 0,
|
5723 | DOMTokenList: 1,
|
5724 | DataTransferItemList: 0,
|
5725 | FileList: 0,
|
5726 | HTMLAllCollection: 0,
|
5727 | HTMLCollection: 0,
|
5728 | HTMLFormElement: 0,
|
5729 | HTMLSelectElement: 0,
|
5730 | MediaList: 0,
|
5731 | MimeTypeArray: 0,
|
5732 | NamedNodeMap: 0,
|
5733 | NodeList: 1,
|
5734 | PaintRequestList: 0,
|
5735 | Plugin: 0,
|
5736 | PluginArray: 0,
|
5737 | SVGLengthList: 0,
|
5738 | SVGNumberList: 0,
|
5739 | SVGPathSegList: 0,
|
5740 | SVGPointList: 0,
|
5741 | SVGStringList: 0,
|
5742 | SVGTransformList: 0,
|
5743 | SourceBufferList: 0,
|
5744 | StyleSheetList: 0,
|
5745 | TextTrackCueList: 0,
|
5746 | TextTrackList: 0,
|
5747 | TouchList: 0
|
5748 | };
|
5749 | var TO_STRING_TAG$3$1 = wellKnownSymbol$1('toStringTag');
|
5750 |
|
5751 | for (var COLLECTION_NAME$1 in domIterables$1) {
|
5752 | var Collection$1 = global_1$1[COLLECTION_NAME$1];
|
5753 | var CollectionPrototype$1 = Collection$1 && Collection$1.prototype;
|
5754 |
|
5755 | if (CollectionPrototype$1 && !CollectionPrototype$1[TO_STRING_TAG$3$1]) {
|
5756 | createNonEnumerableProperty$1(CollectionPrototype$1, TO_STRING_TAG$3$1, COLLECTION_NAME$1);
|
5757 | }
|
5758 |
|
5759 | iterators$1[COLLECTION_NAME$1] = iterators$1.Array;
|
5760 | }
|
5761 |
|
5762 |
|
5763 | var isArray$6 = Array.isArray || function isArray(arg) {
|
5764 | return classofRaw$1(arg) == 'Array';
|
5765 | };
|
5766 |
|
5767 | var SPECIES$3 = wellKnownSymbol$1('species');
|
5768 |
|
5769 |
|
5770 | var arraySpeciesCreate$1 = function (originalArray, length) {
|
5771 | var C;
|
5772 |
|
5773 | if (isArray$6(originalArray)) {
|
5774 | C = originalArray.constructor;
|
5775 |
|
5776 | if (typeof C == 'function' && (C === Array || isArray$6(C.prototype))) C = undefined;else if (isObject$2(C)) {
|
5777 | C = C[SPECIES$3];
|
5778 | if (C === null) C = undefined;
|
5779 | }
|
5780 | }
|
5781 |
|
5782 | return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
5783 | };
|
5784 |
|
5785 | var push$1 = [].push;
|
5786 |
|
5787 | var createMethod$1$1 = function (TYPE) {
|
5788 | var IS_MAP = TYPE == 1;
|
5789 | var IS_FILTER = TYPE == 2;
|
5790 | var IS_SOME = TYPE == 3;
|
5791 | var IS_EVERY = TYPE == 4;
|
5792 | var IS_FIND_INDEX = TYPE == 6;
|
5793 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
5794 | return function ($this, callbackfn, that, specificCreate) {
|
5795 | var O = toObject$1($this);
|
5796 | var self = indexedObject$1(O);
|
5797 | var boundFunction = bindContext$1(callbackfn, that, 3);
|
5798 | var length = toLength$1(self.length);
|
5799 | var index = 0;
|
5800 | var create = specificCreate || arraySpeciesCreate$1;
|
5801 | var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
|
5802 | var value, result;
|
5803 |
|
5804 | for (; length > index; index++) if (NO_HOLES || index in self) {
|
5805 | value = self[index];
|
5806 | result = boundFunction(value, index, O);
|
5807 |
|
5808 | if (TYPE) {
|
5809 | if (IS_MAP) target[index] = result;
|
5810 | else if (result) switch (TYPE) {
|
5811 | case 3:
|
5812 | return true;
|
5813 |
|
5814 |
|
5815 | case 5:
|
5816 | return value;
|
5817 |
|
5818 |
|
5819 | case 6:
|
5820 | return index;
|
5821 |
|
5822 |
|
5823 | case 2:
|
5824 | push$1.call(target, value);
|
5825 |
|
5826 | } else if (IS_EVERY) return false;
|
5827 | }
|
5828 | }
|
5829 |
|
5830 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
5831 | };
|
5832 | };
|
5833 |
|
5834 | var arrayIteration$1 = {
|
5835 |
|
5836 |
|
5837 | forEach: createMethod$1$1(0),
|
5838 |
|
5839 |
|
5840 | map: createMethod$1$1(1),
|
5841 |
|
5842 |
|
5843 | filter: createMethod$1$1(2),
|
5844 |
|
5845 |
|
5846 | some: createMethod$1$1(3),
|
5847 |
|
5848 |
|
5849 | every: createMethod$1$1(4),
|
5850 |
|
5851 |
|
5852 | find: createMethod$1$1(5),
|
5853 |
|
5854 |
|
5855 | findIndex: createMethod$1$1(6)
|
5856 | };
|
5857 |
|
5858 | var sloppyArrayMethod$1 = function (METHOD_NAME, argument) {
|
5859 | var method = [][METHOD_NAME];
|
5860 | return !method || !fails$1(function () {
|
5861 |
|
5862 | method.call(null, argument || function () {
|
5863 | throw 1;
|
5864 | }, 1);
|
5865 | });
|
5866 | };
|
5867 |
|
5868 | var $forEach$2 = arrayIteration$1.forEach;
|
5869 |
|
5870 |
|
5871 | var arrayForEach$1 = sloppyArrayMethod$1('forEach') ? function forEach(callbackfn
|
5872 | /* , thisArg */
|
5873 | ) {
|
5874 | return $forEach$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
5875 | } : [].forEach;
|
5876 |
|
5877 | _export$1({
|
5878 | target: 'Array',
|
5879 | proto: true,
|
5880 | forced: [].forEach != arrayForEach$1
|
5881 | }, {
|
5882 | forEach: arrayForEach$1
|
5883 | });
|
5884 |
|
5885 | var entryVirtual$1 = function (CONSTRUCTOR) {
|
5886 | return path$1[CONSTRUCTOR + 'Prototype'];
|
5887 | };
|
5888 |
|
5889 | var forEach$4 = entryVirtual$1('Array').forEach;
|
5890 | var forEach$1$1 = forEach$4;
|
5891 | var ArrayPrototype$7 = Array.prototype;
|
5892 | var DOMIterables$1 = {
|
5893 | DOMTokenList: true,
|
5894 | NodeList: true
|
5895 | };
|
5896 |
|
5897 | var forEach_1$1 = function (it) {
|
5898 | var own = it.forEach;
|
5899 | return it === ArrayPrototype$7 || it instanceof Array && own === ArrayPrototype$7.forEach
|
5900 | || DOMIterables$1.hasOwnProperty(classof$1(it)) ? forEach$1$1 : own;
|
5901 | };
|
5902 |
|
5903 | var forEach$2$1 = forEach_1$1;
|
5904 | var nativeGetOwnPropertyDescriptor$1$1 = objectGetOwnPropertyDescriptor$1.f;
|
5905 | var FAILS_ON_PRIMITIVES$3 = fails$1(function () {
|
5906 | nativeGetOwnPropertyDescriptor$1$1(1);
|
5907 | });
|
5908 | var FORCED$3 = !descriptors$1 || FAILS_ON_PRIMITIVES$3;
|
5909 |
|
5910 |
|
5911 | _export$1({
|
5912 | target: 'Object',
|
5913 | stat: true,
|
5914 | forced: FORCED$3,
|
5915 | sham: !descriptors$1
|
5916 | }, {
|
5917 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
|
5918 | return nativeGetOwnPropertyDescriptor$1$1(toIndexedObject$1(it), key);
|
5919 | }
|
5920 | });
|
5921 |
|
5922 | var getOwnPropertyDescriptor_1$1 = createCommonjsModule$2(function (module) {
|
5923 | var Object = path$1.Object;
|
5924 |
|
5925 | var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
|
5926 | return Object.getOwnPropertyDescriptor(it, key);
|
5927 | };
|
5928 |
|
5929 | if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
|
5930 | });
|
5931 | var getOwnPropertyDescriptor$2$1 = getOwnPropertyDescriptor_1$1;
|
5932 | var getOwnPropertyDescriptor$3$1 = getOwnPropertyDescriptor$2$1;
|
5933 | var nativeGetOwnPropertyNames$2 = objectGetOwnPropertyNames$1.f;
|
5934 | var toString$1$1 = {}.toString;
|
5935 | var windowNames$1 = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
|
5936 |
|
5937 | var getWindowNames$1 = function (it) {
|
5938 | try {
|
5939 | return nativeGetOwnPropertyNames$2(it);
|
5940 | } catch (error) {
|
5941 | return windowNames$1.slice();
|
5942 | }
|
5943 | };
|
5944 |
|
5945 |
|
5946 | var f$5$1 = function getOwnPropertyNames(it) {
|
5947 | return windowNames$1 && toString$1$1.call(it) == '[object Window]' ? getWindowNames$1(it) : nativeGetOwnPropertyNames$2(toIndexedObject$1(it));
|
5948 | };
|
5949 |
|
5950 | var objectGetOwnPropertyNamesExternal$1 = {
|
5951 | f: f$5$1
|
5952 | };
|
5953 | var f$6$1 = wellKnownSymbol$1;
|
5954 | var wrappedWellKnownSymbol$1 = {
|
5955 | f: f$6$1
|
5956 | };
|
5957 | var defineProperty$3$1 = objectDefineProperty$1.f;
|
5958 |
|
5959 | var defineWellKnownSymbol$1 = function (NAME) {
|
5960 | var Symbol = path$1.Symbol || (path$1.Symbol = {});
|
5961 | if (!has$2(Symbol, NAME)) defineProperty$3$1(Symbol, NAME, {
|
5962 | value: wrappedWellKnownSymbol$1.f(NAME)
|
5963 | });
|
5964 | };
|
5965 |
|
5966 | var $forEach$1$1 = arrayIteration$1.forEach;
|
5967 | var HIDDEN$1 = sharedKey$1('hidden');
|
5968 | var SYMBOL$1 = 'Symbol';
|
5969 | var PROTOTYPE$1$1 = 'prototype';
|
5970 | var TO_PRIMITIVE$1 = wellKnownSymbol$1('toPrimitive');
|
5971 | var setInternalState$1$1 = internalState$1.set;
|
5972 | var getInternalState$1$1 = internalState$1.getterFor(SYMBOL$1);
|
5973 | var ObjectPrototype$1$1 = Object[PROTOTYPE$1$1];
|
5974 | var $Symbol$1 = global_1$1.Symbol;
|
5975 | var $stringify$1 = getBuiltIn$1('JSON', 'stringify');
|
5976 | var nativeGetOwnPropertyDescriptor$2$1 = objectGetOwnPropertyDescriptor$1.f;
|
5977 | var nativeDefineProperty$1$1 = objectDefineProperty$1.f;
|
5978 | var nativeGetOwnPropertyNames$1$1 = objectGetOwnPropertyNamesExternal$1.f;
|
5979 | var nativePropertyIsEnumerable$1$1 = objectPropertyIsEnumerable$1.f;
|
5980 | var AllSymbols$1 = shared$1('symbols');
|
5981 | var ObjectPrototypeSymbols$1 = shared$1('op-symbols');
|
5982 | var StringToSymbolRegistry$1 = shared$1('string-to-symbol-registry');
|
5983 | var SymbolToStringRegistry$1 = shared$1('symbol-to-string-registry');
|
5984 | var WellKnownSymbolsStore$1 = shared$1('wks');
|
5985 | var QObject$1 = global_1$1.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
|
5986 |
|
5987 | var USE_SETTER$1 = !QObject$1 || !QObject$1[PROTOTYPE$1$1] || !QObject$1[PROTOTYPE$1$1].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
|
5988 |
|
5989 | var setSymbolDescriptor$1 = descriptors$1 && fails$1(function () {
|
5990 | return objectCreate$1(nativeDefineProperty$1$1({}, 'a', {
|
5991 | get: function () {
|
5992 | return nativeDefineProperty$1$1(this, 'a', {
|
5993 | value: 7
|
5994 | }).a;
|
5995 | }
|
5996 | })).a != 7;
|
5997 | }) ? function (O, P, Attributes) {
|
5998 | var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$2$1(ObjectPrototype$1$1, P);
|
5999 | if (ObjectPrototypeDescriptor) delete ObjectPrototype$1$1[P];
|
6000 | nativeDefineProperty$1$1(O, P, Attributes);
|
6001 |
|
6002 | if (ObjectPrototypeDescriptor && O !== ObjectPrototype$1$1) {
|
6003 | nativeDefineProperty$1$1(ObjectPrototype$1$1, P, ObjectPrototypeDescriptor);
|
6004 | }
|
6005 | } : nativeDefineProperty$1$1;
|
6006 |
|
6007 | var wrap$1 = function (tag, description) {
|
6008 | var symbol = AllSymbols$1[tag] = objectCreate$1($Symbol$1[PROTOTYPE$1$1]);
|
6009 | setInternalState$1$1(symbol, {
|
6010 | type: SYMBOL$1,
|
6011 | tag: tag,
|
6012 | description: description
|
6013 | });
|
6014 | if (!descriptors$1) symbol.description = description;
|
6015 | return symbol;
|
6016 | };
|
6017 |
|
6018 | var isSymbol$1 = nativeSymbol$1 && typeof $Symbol$1.iterator == 'symbol' ? function (it) {
|
6019 | return typeof it == 'symbol';
|
6020 | } : function (it) {
|
6021 | return Object(it) instanceof $Symbol$1;
|
6022 | };
|
6023 |
|
6024 | var $defineProperty$1 = function defineProperty(O, P, Attributes) {
|
6025 | if (O === ObjectPrototype$1$1) $defineProperty$1(ObjectPrototypeSymbols$1, P, Attributes);
|
6026 | anObject$1(O);
|
6027 | var key = toPrimitive$1(P, true);
|
6028 | anObject$1(Attributes);
|
6029 |
|
6030 | if (has$2(AllSymbols$1, key)) {
|
6031 | if (!Attributes.enumerable) {
|
6032 | if (!has$2(O, HIDDEN$1)) nativeDefineProperty$1$1(O, HIDDEN$1, createPropertyDescriptor$1(1, {}));
|
6033 | O[HIDDEN$1][key] = true;
|
6034 | } else {
|
6035 | if (has$2(O, HIDDEN$1) && O[HIDDEN$1][key]) O[HIDDEN$1][key] = false;
|
6036 | Attributes = objectCreate$1(Attributes, {
|
6037 | enumerable: createPropertyDescriptor$1(0, false)
|
6038 | });
|
6039 | }
|
6040 |
|
6041 | return setSymbolDescriptor$1(O, key, Attributes);
|
6042 | }
|
6043 |
|
6044 | return nativeDefineProperty$1$1(O, key, Attributes);
|
6045 | };
|
6046 |
|
6047 | var $defineProperties$1 = function defineProperties(O, Properties) {
|
6048 | anObject$1(O);
|
6049 | var properties = toIndexedObject$1(Properties);
|
6050 | var keys = objectKeys$1(properties).concat($getOwnPropertySymbols$1(properties));
|
6051 | $forEach$1$1(keys, function (key) {
|
6052 | if (!descriptors$1 || $propertyIsEnumerable$1.call(properties, key)) $defineProperty$1(O, key, properties[key]);
|
6053 | });
|
6054 | return O;
|
6055 | };
|
6056 |
|
6057 | var $create$1 = function create(O, Properties) {
|
6058 | return Properties === undefined ? objectCreate$1(O) : $defineProperties$1(objectCreate$1(O), Properties);
|
6059 | };
|
6060 |
|
6061 | var $propertyIsEnumerable$1 = function propertyIsEnumerable(V) {
|
6062 | var P = toPrimitive$1(V, true);
|
6063 | var enumerable = nativePropertyIsEnumerable$1$1.call(this, P);
|
6064 | if (this === ObjectPrototype$1$1 && has$2(AllSymbols$1, P) && !has$2(ObjectPrototypeSymbols$1, P)) return false;
|
6065 | return enumerable || !has$2(this, P) || !has$2(AllSymbols$1, P) || has$2(this, HIDDEN$1) && this[HIDDEN$1][P] ? enumerable : true;
|
6066 | };
|
6067 |
|
6068 | var $getOwnPropertyDescriptor$1 = function getOwnPropertyDescriptor(O, P) {
|
6069 | var it = toIndexedObject$1(O);
|
6070 | var key = toPrimitive$1(P, true);
|
6071 | if (it === ObjectPrototype$1$1 && has$2(AllSymbols$1, key) && !has$2(ObjectPrototypeSymbols$1, key)) return;
|
6072 | var descriptor = nativeGetOwnPropertyDescriptor$2$1(it, key);
|
6073 |
|
6074 | if (descriptor && has$2(AllSymbols$1, key) && !(has$2(it, HIDDEN$1) && it[HIDDEN$1][key])) {
|
6075 | descriptor.enumerable = true;
|
6076 | }
|
6077 |
|
6078 | return descriptor;
|
6079 | };
|
6080 |
|
6081 | var $getOwnPropertyNames$1 = function getOwnPropertyNames(O) {
|
6082 | var names = nativeGetOwnPropertyNames$1$1(toIndexedObject$1(O));
|
6083 | var result = [];
|
6084 | $forEach$1$1(names, function (key) {
|
6085 | if (!has$2(AllSymbols$1, key) && !has$2(hiddenKeys$2, key)) result.push(key);
|
6086 | });
|
6087 | return result;
|
6088 | };
|
6089 |
|
6090 | var $getOwnPropertySymbols$1 = function getOwnPropertySymbols(O) {
|
6091 | var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$1$1;
|
6092 | var names = nativeGetOwnPropertyNames$1$1(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols$1 : toIndexedObject$1(O));
|
6093 | var result = [];
|
6094 | $forEach$1$1(names, function (key) {
|
6095 | if (has$2(AllSymbols$1, key) && (!IS_OBJECT_PROTOTYPE || has$2(ObjectPrototype$1$1, key))) {
|
6096 | result.push(AllSymbols$1[key]);
|
6097 | }
|
6098 | });
|
6099 | return result;
|
6100 | };
|
6101 |
|
6102 |
|
6103 |
|
6104 | if (!nativeSymbol$1) {
|
6105 | $Symbol$1 = function Symbol() {
|
6106 | if (this instanceof $Symbol$1) throw TypeError('Symbol is not a constructor');
|
6107 | var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
|
6108 | var tag = uid$1(description);
|
6109 |
|
6110 | var setter = function (value) {
|
6111 | if (this === ObjectPrototype$1$1) setter.call(ObjectPrototypeSymbols$1, value);
|
6112 | if (has$2(this, HIDDEN$1) && has$2(this[HIDDEN$1], tag)) this[HIDDEN$1][tag] = false;
|
6113 | setSymbolDescriptor$1(this, tag, createPropertyDescriptor$1(1, value));
|
6114 | };
|
6115 |
|
6116 | if (descriptors$1 && USE_SETTER$1) setSymbolDescriptor$1(ObjectPrototype$1$1, tag, {
|
6117 | configurable: true,
|
6118 | set: setter
|
6119 | });
|
6120 | return wrap$1(tag, description);
|
6121 | };
|
6122 |
|
6123 | redefine$1($Symbol$1[PROTOTYPE$1$1], 'toString', function toString() {
|
6124 | return getInternalState$1$1(this).tag;
|
6125 | });
|
6126 | objectPropertyIsEnumerable$1.f = $propertyIsEnumerable$1;
|
6127 | objectDefineProperty$1.f = $defineProperty$1;
|
6128 | objectGetOwnPropertyDescriptor$1.f = $getOwnPropertyDescriptor$1;
|
6129 | objectGetOwnPropertyNames$1.f = objectGetOwnPropertyNamesExternal$1.f = $getOwnPropertyNames$1;
|
6130 | objectGetOwnPropertySymbols$1.f = $getOwnPropertySymbols$1;
|
6131 |
|
6132 | if (descriptors$1) {
|
6133 |
|
6134 | nativeDefineProperty$1$1($Symbol$1[PROTOTYPE$1$1], 'description', {
|
6135 | configurable: true,
|
6136 | get: function description() {
|
6137 | return getInternalState$1$1(this).description;
|
6138 | }
|
6139 | });
|
6140 | }
|
6141 |
|
6142 | wrappedWellKnownSymbol$1.f = function (name) {
|
6143 | return wrap$1(wellKnownSymbol$1(name), name);
|
6144 | };
|
6145 | }
|
6146 |
|
6147 | _export$1({
|
6148 | global: true,
|
6149 | wrap: true,
|
6150 | forced: !nativeSymbol$1,
|
6151 | sham: !nativeSymbol$1
|
6152 | }, {
|
6153 | Symbol: $Symbol$1
|
6154 | });
|
6155 |
|
6156 | $forEach$1$1(objectKeys$1(WellKnownSymbolsStore$1), function (name) {
|
6157 | defineWellKnownSymbol$1(name);
|
6158 | });
|
6159 |
|
6160 | _export$1({
|
6161 | target: SYMBOL$1,
|
6162 | stat: true,
|
6163 | forced: !nativeSymbol$1
|
6164 | }, {
|
6165 |
|
6166 |
|
6167 | 'for': function (key) {
|
6168 | var string = String(key);
|
6169 | if (has$2(StringToSymbolRegistry$1, string)) return StringToSymbolRegistry$1[string];
|
6170 | var symbol = $Symbol$1(string);
|
6171 | StringToSymbolRegistry$1[string] = symbol;
|
6172 | SymbolToStringRegistry$1[symbol] = string;
|
6173 | return symbol;
|
6174 | },
|
6175 |
|
6176 |
|
6177 | keyFor: function keyFor(sym) {
|
6178 | if (!isSymbol$1(sym)) throw TypeError(sym + ' is not a symbol');
|
6179 | if (has$2(SymbolToStringRegistry$1, sym)) return SymbolToStringRegistry$1[sym];
|
6180 | },
|
6181 | useSetter: function () {
|
6182 | USE_SETTER$1 = true;
|
6183 | },
|
6184 | useSimple: function () {
|
6185 | USE_SETTER$1 = false;
|
6186 | }
|
6187 | });
|
6188 |
|
6189 | _export$1({
|
6190 | target: 'Object',
|
6191 | stat: true,
|
6192 | forced: !nativeSymbol$1,
|
6193 | sham: !descriptors$1
|
6194 | }, {
|
6195 |
|
6196 |
|
6197 | create: $create$1,
|
6198 |
|
6199 |
|
6200 | defineProperty: $defineProperty$1,
|
6201 |
|
6202 |
|
6203 | defineProperties: $defineProperties$1,
|
6204 |
|
6205 |
|
6206 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor$1
|
6207 | });
|
6208 |
|
6209 | _export$1({
|
6210 | target: 'Object',
|
6211 | stat: true,
|
6212 | forced: !nativeSymbol$1
|
6213 | }, {
|
6214 |
|
6215 |
|
6216 | getOwnPropertyNames: $getOwnPropertyNames$1,
|
6217 |
|
6218 |
|
6219 | getOwnPropertySymbols: $getOwnPropertySymbols$1
|
6220 | });
|
6221 |
|
6222 |
|
6223 |
|
6224 | _export$1({
|
6225 | target: 'Object',
|
6226 | stat: true,
|
6227 | forced: fails$1(function () {
|
6228 | objectGetOwnPropertySymbols$1.f(1);
|
6229 | })
|
6230 | }, {
|
6231 | getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
6232 | return objectGetOwnPropertySymbols$1.f(toObject$1(it));
|
6233 | }
|
6234 | });
|
6235 |
|
6236 |
|
6237 |
|
6238 | if ($stringify$1) {
|
6239 | var FORCED_JSON_STRINGIFY$1 = !nativeSymbol$1 || fails$1(function () {
|
6240 | var symbol = $Symbol$1();
|
6241 |
|
6242 | return $stringify$1([symbol]) != '[null]'
|
6243 | || $stringify$1({
|
6244 | a: symbol
|
6245 | }) != '{}'
|
6246 | || $stringify$1(Object(symbol)) != '{}';
|
6247 | });
|
6248 |
|
6249 | _export$1({
|
6250 | target: 'JSON',
|
6251 | stat: true,
|
6252 | forced: FORCED_JSON_STRINGIFY$1
|
6253 | }, {
|
6254 |
|
6255 | stringify: function stringify(it, replacer, space) {
|
6256 | var args = [it];
|
6257 | var index = 1;
|
6258 | var $replacer;
|
6259 |
|
6260 | while (arguments.length > index) args.push(arguments[index++]);
|
6261 |
|
6262 | $replacer = replacer;
|
6263 | if (!isObject$2(replacer) && it === undefined || isSymbol$1(it)) return;
|
6264 |
|
6265 | if (!isArray$6(replacer)) replacer = function (key, value) {
|
6266 | if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
6267 | if (!isSymbol$1(value)) return value;
|
6268 | };
|
6269 | args[1] = replacer;
|
6270 | return $stringify$1.apply(null, args);
|
6271 | }
|
6272 | });
|
6273 | }
|
6274 |
|
6275 |
|
6276 |
|
6277 | if (!$Symbol$1[PROTOTYPE$1$1][TO_PRIMITIVE$1]) {
|
6278 | createNonEnumerableProperty$1($Symbol$1[PROTOTYPE$1$1], TO_PRIMITIVE$1, $Symbol$1[PROTOTYPE$1$1].valueOf);
|
6279 | }
|
6280 |
|
6281 |
|
6282 |
|
6283 | setToStringTag$1($Symbol$1, SYMBOL$1);
|
6284 | hiddenKeys$2[HIDDEN$1] = true;
|
6285 | var getOwnPropertySymbols$3 = path$1.Object.getOwnPropertySymbols;
|
6286 | var getOwnPropertySymbols$1$1 = getOwnPropertySymbols$3;
|
6287 | var getOwnPropertySymbols$2$1 = getOwnPropertySymbols$1$1;
|
6288 | var entries = entryVirtual$1('Array').entries;
|
6289 | var entries$1 = entries;
|
6290 | var ArrayPrototype$1$1 = Array.prototype;
|
6291 | var DOMIterables$1$1 = {
|
6292 | DOMTokenList: true,
|
6293 | NodeList: true
|
6294 | };
|
6295 |
|
6296 | var entries_1 = function (it) {
|
6297 | var own = it.entries;
|
6298 | return it === ArrayPrototype$1$1 || it instanceof Array && own === ArrayPrototype$1$1.entries
|
6299 | || DOMIterables$1$1.hasOwnProperty(classof$1(it)) ? entries$1 : own;
|
6300 | };
|
6301 |
|
6302 | var entries$2 = entries_1;
|
6303 | var slice$3 = [].slice;
|
6304 | var factories = {};
|
6305 |
|
6306 | var construct = function (C, argsLength, args) {
|
6307 | if (!(argsLength in factories)) {
|
6308 | for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
|
6309 |
|
6310 |
|
6311 | factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');
|
6312 | }
|
6313 |
|
6314 | return factories[argsLength](C, args);
|
6315 | };
|
6316 |
|
6317 |
|
6318 |
|
6319 | var functionBind = Function.bind || function bind(that
|
6320 | /* , ...args */
|
6321 | ) {
|
6322 | var fn = aFunction$2(this);
|
6323 | var partArgs = slice$3.call(arguments, 1);
|
6324 |
|
6325 | var boundFunction = function bound()
|
6326 | /* args... */
|
6327 | {
|
6328 | var args = partArgs.concat(slice$3.call(arguments));
|
6329 | return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args);
|
6330 | };
|
6331 |
|
6332 | if (isObject$2(fn.prototype)) boundFunction.prototype = fn.prototype;
|
6333 | return boundFunction;
|
6334 | };
|
6335 |
|
6336 |
|
6337 | _export$1({
|
6338 | target: 'Function',
|
6339 | proto: true
|
6340 | }, {
|
6341 | bind: functionBind
|
6342 | });
|
6343 |
|
6344 | var bind = entryVirtual$1('Function').bind;
|
6345 | var FunctionPrototype = Function.prototype;
|
6346 |
|
6347 | var bind_1 = function (it) {
|
6348 | var own = it.bind;
|
6349 | return it === FunctionPrototype || it instanceof Function && own === FunctionPrototype.bind ? bind : own;
|
6350 | };
|
6351 |
|
6352 | var bind$1 = bind_1;
|
6353 | var bind$2 = bind$1;
|
6354 | var runtime_1 = createCommonjsModule$2(function (module) {
|
6355 | |
6356 |
|
6357 |
|
6358 |
|
6359 |
|
6360 |
|
6361 | var runtime = function (exports) {
|
6362 | var Op = Object.prototype;
|
6363 | var hasOwn = Op.hasOwnProperty;
|
6364 | var undefined$1;
|
6365 |
|
6366 | var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
6367 | var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
6368 | var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
6369 | var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
6370 |
|
6371 | function wrap(innerFn, outerFn, self, tryLocsList) {
|
6372 |
|
6373 | var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
6374 | var generator = Object.create(protoGenerator.prototype);
|
6375 | var context = new Context(tryLocsList || []);
|
6376 |
|
6377 |
|
6378 | generator._invoke = makeInvokeMethod(innerFn, self, context);
|
6379 | return generator;
|
6380 | }
|
6381 |
|
6382 | exports.wrap = wrap;
|
6383 |
|
6384 |
|
6385 |
|
6386 |
|
6387 |
|
6388 |
|
6389 |
|
6390 |
|
6391 |
|
6392 |
|
6393 | function tryCatch(fn, obj, arg) {
|
6394 | try {
|
6395 | return {
|
6396 | type: "normal",
|
6397 | arg: fn.call(obj, arg)
|
6398 | };
|
6399 | } catch (err) {
|
6400 | return {
|
6401 | type: "throw",
|
6402 | arg: err
|
6403 | };
|
6404 | }
|
6405 | }
|
6406 |
|
6407 | var GenStateSuspendedStart = "suspendedStart";
|
6408 | var GenStateSuspendedYield = "suspendedYield";
|
6409 | var GenStateExecuting = "executing";
|
6410 | var GenStateCompleted = "completed";
|
6411 |
|
6412 |
|
6413 | var ContinueSentinel = {};
|
6414 |
|
6415 |
|
6416 |
|
6417 |
|
6418 | function Generator() {}
|
6419 |
|
6420 | function GeneratorFunction() {}
|
6421 |
|
6422 | function GeneratorFunctionPrototype() {}
|
6423 |
|
6424 |
|
6425 |
|
6426 | var IteratorPrototype = {};
|
6427 |
|
6428 | IteratorPrototype[iteratorSymbol] = function () {
|
6429 | return this;
|
6430 | };
|
6431 |
|
6432 | var getProto = Object.getPrototypeOf;
|
6433 | var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
6434 |
|
6435 | if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
6436 |
|
6437 |
|
6438 | IteratorPrototype = NativeIteratorPrototype;
|
6439 | }
|
6440 |
|
6441 | var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
6442 | GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
6443 | GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
6444 | GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction";
|
6445 |
|
6446 |
|
6447 | function defineIteratorMethods(prototype) {
|
6448 | ["next", "throw", "return"].forEach(function (method) {
|
6449 | prototype[method] = function (arg) {
|
6450 | return this._invoke(method, arg);
|
6451 | };
|
6452 | });
|
6453 | }
|
6454 |
|
6455 | exports.isGeneratorFunction = function (genFun) {
|
6456 | var ctor = typeof genFun === "function" && genFun.constructor;
|
6457 | return ctor ? ctor === GeneratorFunction ||
|
6458 |
|
6459 | (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
|
6460 | };
|
6461 |
|
6462 | exports.mark = function (genFun) {
|
6463 | if (Object.setPrototypeOf) {
|
6464 | Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
6465 | } else {
|
6466 | genFun.__proto__ = GeneratorFunctionPrototype;
|
6467 |
|
6468 | if (!(toStringTagSymbol in genFun)) {
|
6469 | genFun[toStringTagSymbol] = "GeneratorFunction";
|
6470 | }
|
6471 | }
|
6472 |
|
6473 | genFun.prototype = Object.create(Gp);
|
6474 | return genFun;
|
6475 | };
|
6476 |
|
6477 |
|
6478 |
|
6479 |
|
6480 |
|
6481 | exports.awrap = function (arg) {
|
6482 | return {
|
6483 | __await: arg
|
6484 | };
|
6485 | };
|
6486 |
|
6487 | function AsyncIterator(generator) {
|
6488 | function invoke(method, arg, resolve, reject) {
|
6489 | var record = tryCatch(generator[method], generator, arg);
|
6490 |
|
6491 | if (record.type === "throw") {
|
6492 | reject(record.arg);
|
6493 | } else {
|
6494 | var result = record.arg;
|
6495 | var value = result.value;
|
6496 |
|
6497 | if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
|
6498 | return Promise.resolve(value.__await).then(function (value) {
|
6499 | invoke("next", value, resolve, reject);
|
6500 | }, function (err) {
|
6501 | invoke("throw", err, resolve, reject);
|
6502 | });
|
6503 | }
|
6504 |
|
6505 | return Promise.resolve(value).then(function (unwrapped) {
|
6506 |
|
6507 |
|
6508 |
|
6509 | result.value = unwrapped;
|
6510 | resolve(result);
|
6511 | }, function (error) {
|
6512 |
|
6513 |
|
6514 | return invoke("throw", error, resolve, reject);
|
6515 | });
|
6516 | }
|
6517 | }
|
6518 |
|
6519 | var previousPromise;
|
6520 |
|
6521 | function enqueue(method, arg) {
|
6522 | function callInvokeWithMethodAndArg() {
|
6523 | return new Promise(function (resolve, reject) {
|
6524 | invoke(method, arg, resolve, reject);
|
6525 | });
|
6526 | }
|
6527 |
|
6528 | return previousPromise =
|
6529 |
|
6530 |
|
6531 |
|
6532 |
|
6533 |
|
6534 |
|
6535 |
|
6536 |
|
6537 |
|
6538 |
|
6539 |
|
6540 | previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
|
6541 |
|
6542 | callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
6543 | }
|
6544 |
|
6545 |
|
6546 |
|
6547 | this._invoke = enqueue;
|
6548 | }
|
6549 |
|
6550 | defineIteratorMethods(AsyncIterator.prototype);
|
6551 |
|
6552 | AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
6553 | return this;
|
6554 | };
|
6555 |
|
6556 | exports.AsyncIterator = AsyncIterator;
|
6557 |
|
6558 |
|
6559 |
|
6560 | exports.async = function (innerFn, outerFn, self, tryLocsList) {
|
6561 | var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList));
|
6562 | return exports.isGeneratorFunction(outerFn) ? iter
|
6563 | : iter.next().then(function (result) {
|
6564 | return result.done ? result.value : iter.next();
|
6565 | });
|
6566 | };
|
6567 |
|
6568 | function makeInvokeMethod(innerFn, self, context) {
|
6569 | var state = GenStateSuspendedStart;
|
6570 | return function invoke(method, arg) {
|
6571 | if (state === GenStateExecuting) {
|
6572 | throw new Error("Generator is already running");
|
6573 | }
|
6574 |
|
6575 | if (state === GenStateCompleted) {
|
6576 | if (method === "throw") {
|
6577 | throw arg;
|
6578 | }
|
6579 |
|
6580 |
|
6581 |
|
6582 | return doneResult();
|
6583 | }
|
6584 |
|
6585 | context.method = method;
|
6586 | context.arg = arg;
|
6587 |
|
6588 | while (true) {
|
6589 | var delegate = context.delegate;
|
6590 |
|
6591 | if (delegate) {
|
6592 | var delegateResult = maybeInvokeDelegate(delegate, context);
|
6593 |
|
6594 | if (delegateResult) {
|
6595 | if (delegateResult === ContinueSentinel) continue;
|
6596 | return delegateResult;
|
6597 | }
|
6598 | }
|
6599 |
|
6600 | if (context.method === "next") {
|
6601 |
|
6602 |
|
6603 | context.sent = context._sent = context.arg;
|
6604 | } else if (context.method === "throw") {
|
6605 | if (state === GenStateSuspendedStart) {
|
6606 | state = GenStateCompleted;
|
6607 | throw context.arg;
|
6608 | }
|
6609 |
|
6610 | context.dispatchException(context.arg);
|
6611 | } else if (context.method === "return") {
|
6612 | context.abrupt("return", context.arg);
|
6613 | }
|
6614 |
|
6615 | state = GenStateExecuting;
|
6616 | var record = tryCatch(innerFn, self, context);
|
6617 |
|
6618 | if (record.type === "normal") {
|
6619 |
|
6620 |
|
6621 | state = context.done ? GenStateCompleted : GenStateSuspendedYield;
|
6622 |
|
6623 | if (record.arg === ContinueSentinel) {
|
6624 | continue;
|
6625 | }
|
6626 |
|
6627 | return {
|
6628 | value: record.arg,
|
6629 | done: context.done
|
6630 | };
|
6631 | } else if (record.type === "throw") {
|
6632 | state = GenStateCompleted;
|
6633 |
|
6634 |
|
6635 | context.method = "throw";
|
6636 | context.arg = record.arg;
|
6637 | }
|
6638 | }
|
6639 | };
|
6640 | }
|
6641 |
|
6642 |
|
6643 |
|
6644 |
|
6645 |
|
6646 | function maybeInvokeDelegate(delegate, context) {
|
6647 | var method = delegate.iterator[context.method];
|
6648 |
|
6649 | if (method === undefined$1) {
|
6650 |
|
6651 |
|
6652 | context.delegate = null;
|
6653 |
|
6654 | if (context.method === "throw") {
|
6655 |
|
6656 | if (delegate.iterator["return"]) {
|
6657 |
|
6658 |
|
6659 | context.method = "return";
|
6660 | context.arg = undefined$1;
|
6661 | maybeInvokeDelegate(delegate, context);
|
6662 |
|
6663 | if (context.method === "throw") {
|
6664 |
|
6665 |
|
6666 | return ContinueSentinel;
|
6667 | }
|
6668 | }
|
6669 |
|
6670 | context.method = "throw";
|
6671 | context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
6672 | }
|
6673 |
|
6674 | return ContinueSentinel;
|
6675 | }
|
6676 |
|
6677 | var record = tryCatch(method, delegate.iterator, context.arg);
|
6678 |
|
6679 | if (record.type === "throw") {
|
6680 | context.method = "throw";
|
6681 | context.arg = record.arg;
|
6682 | context.delegate = null;
|
6683 | return ContinueSentinel;
|
6684 | }
|
6685 |
|
6686 | var info = record.arg;
|
6687 |
|
6688 | if (!info) {
|
6689 | context.method = "throw";
|
6690 | context.arg = new TypeError("iterator result is not an object");
|
6691 | context.delegate = null;
|
6692 | return ContinueSentinel;
|
6693 | }
|
6694 |
|
6695 | if (info.done) {
|
6696 |
|
6697 |
|
6698 | context[delegate.resultName] = info.value;
|
6699 |
|
6700 | context.next = delegate.nextLoc;
|
6701 |
|
6702 |
|
6703 |
|
6704 |
|
6705 |
|
6706 |
|
6707 | if (context.method !== "return") {
|
6708 | context.method = "next";
|
6709 | context.arg = undefined$1;
|
6710 | }
|
6711 | } else {
|
6712 |
|
6713 | return info;
|
6714 | }
|
6715 |
|
6716 |
|
6717 |
|
6718 | context.delegate = null;
|
6719 | return ContinueSentinel;
|
6720 | }
|
6721 |
|
6722 |
|
6723 |
|
6724 | defineIteratorMethods(Gp);
|
6725 | Gp[toStringTagSymbol] = "Generator";
|
6726 |
|
6727 |
|
6728 |
|
6729 |
|
6730 |
|
6731 | Gp[iteratorSymbol] = function () {
|
6732 | return this;
|
6733 | };
|
6734 |
|
6735 | Gp.toString = function () {
|
6736 | return "[object Generator]";
|
6737 | };
|
6738 |
|
6739 | function pushTryEntry(locs) {
|
6740 | var entry = {
|
6741 | tryLoc: locs[0]
|
6742 | };
|
6743 |
|
6744 | if (1 in locs) {
|
6745 | entry.catchLoc = locs[1];
|
6746 | }
|
6747 |
|
6748 | if (2 in locs) {
|
6749 | entry.finallyLoc = locs[2];
|
6750 | entry.afterLoc = locs[3];
|
6751 | }
|
6752 |
|
6753 | this.tryEntries.push(entry);
|
6754 | }
|
6755 |
|
6756 | function resetTryEntry(entry) {
|
6757 | var record = entry.completion || {};
|
6758 | record.type = "normal";
|
6759 | delete record.arg;
|
6760 | entry.completion = record;
|
6761 | }
|
6762 |
|
6763 | function Context(tryLocsList) {
|
6764 |
|
6765 |
|
6766 |
|
6767 | this.tryEntries = [{
|
6768 | tryLoc: "root"
|
6769 | }];
|
6770 | tryLocsList.forEach(pushTryEntry, this);
|
6771 | this.reset(true);
|
6772 | }
|
6773 |
|
6774 | exports.keys = function (object) {
|
6775 | var keys = [];
|
6776 |
|
6777 | for (var key in object) {
|
6778 | keys.push(key);
|
6779 | }
|
6780 |
|
6781 | keys.reverse();
|
6782 |
|
6783 |
|
6784 | return function next() {
|
6785 | while (keys.length) {
|
6786 | var key = keys.pop();
|
6787 |
|
6788 | if (key in object) {
|
6789 | next.value = key;
|
6790 | next.done = false;
|
6791 | return next;
|
6792 | }
|
6793 | }
|
6794 |
|
6795 |
|
6796 |
|
6797 |
|
6798 | next.done = true;
|
6799 | return next;
|
6800 | };
|
6801 | };
|
6802 |
|
6803 | function values(iterable) {
|
6804 | if (iterable) {
|
6805 | var iteratorMethod = iterable[iteratorSymbol];
|
6806 |
|
6807 | if (iteratorMethod) {
|
6808 | return iteratorMethod.call(iterable);
|
6809 | }
|
6810 |
|
6811 | if (typeof iterable.next === "function") {
|
6812 | return iterable;
|
6813 | }
|
6814 |
|
6815 | if (!isNaN(iterable.length)) {
|
6816 | var i = -1,
|
6817 | next = function next() {
|
6818 | while (++i < iterable.length) {
|
6819 | if (hasOwn.call(iterable, i)) {
|
6820 | next.value = iterable[i];
|
6821 | next.done = false;
|
6822 | return next;
|
6823 | }
|
6824 | }
|
6825 |
|
6826 | next.value = undefined$1;
|
6827 | next.done = true;
|
6828 | return next;
|
6829 | };
|
6830 |
|
6831 | return next.next = next;
|
6832 | }
|
6833 | }
|
6834 |
|
6835 |
|
6836 | return {
|
6837 | next: doneResult
|
6838 | };
|
6839 | }
|
6840 |
|
6841 | exports.values = values;
|
6842 |
|
6843 | function doneResult() {
|
6844 | return {
|
6845 | value: undefined$1,
|
6846 | done: true
|
6847 | };
|
6848 | }
|
6849 |
|
6850 | Context.prototype = {
|
6851 | constructor: Context,
|
6852 | reset: function (skipTempReset) {
|
6853 | this.prev = 0;
|
6854 | this.next = 0;
|
6855 |
|
6856 |
|
6857 | this.sent = this._sent = undefined$1;
|
6858 | this.done = false;
|
6859 | this.delegate = null;
|
6860 | this.method = "next";
|
6861 | this.arg = undefined$1;
|
6862 | this.tryEntries.forEach(resetTryEntry);
|
6863 |
|
6864 | if (!skipTempReset) {
|
6865 | for (var name in this) {
|
6866 |
|
6867 | if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
|
6868 | this[name] = undefined$1;
|
6869 | }
|
6870 | }
|
6871 | }
|
6872 | },
|
6873 | stop: function () {
|
6874 | this.done = true;
|
6875 | var rootEntry = this.tryEntries[0];
|
6876 | var rootRecord = rootEntry.completion;
|
6877 |
|
6878 | if (rootRecord.type === "throw") {
|
6879 | throw rootRecord.arg;
|
6880 | }
|
6881 |
|
6882 | return this.rval;
|
6883 | },
|
6884 | dispatchException: function (exception) {
|
6885 | if (this.done) {
|
6886 | throw exception;
|
6887 | }
|
6888 |
|
6889 | var context = this;
|
6890 |
|
6891 | function handle(loc, caught) {
|
6892 | record.type = "throw";
|
6893 | record.arg = exception;
|
6894 | context.next = loc;
|
6895 |
|
6896 | if (caught) {
|
6897 |
|
6898 |
|
6899 | context.method = "next";
|
6900 | context.arg = undefined$1;
|
6901 | }
|
6902 |
|
6903 | return !!caught;
|
6904 | }
|
6905 |
|
6906 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
6907 | var entry = this.tryEntries[i];
|
6908 | var record = entry.completion;
|
6909 |
|
6910 | if (entry.tryLoc === "root") {
|
6911 |
|
6912 |
|
6913 |
|
6914 | return handle("end");
|
6915 | }
|
6916 |
|
6917 | if (entry.tryLoc <= this.prev) {
|
6918 | var hasCatch = hasOwn.call(entry, "catchLoc");
|
6919 | var hasFinally = hasOwn.call(entry, "finallyLoc");
|
6920 |
|
6921 | if (hasCatch && hasFinally) {
|
6922 | if (this.prev < entry.catchLoc) {
|
6923 | return handle(entry.catchLoc, true);
|
6924 | } else if (this.prev < entry.finallyLoc) {
|
6925 | return handle(entry.finallyLoc);
|
6926 | }
|
6927 | } else if (hasCatch) {
|
6928 | if (this.prev < entry.catchLoc) {
|
6929 | return handle(entry.catchLoc, true);
|
6930 | }
|
6931 | } else if (hasFinally) {
|
6932 | if (this.prev < entry.finallyLoc) {
|
6933 | return handle(entry.finallyLoc);
|
6934 | }
|
6935 | } else {
|
6936 | throw new Error("try statement without catch or finally");
|
6937 | }
|
6938 | }
|
6939 | }
|
6940 | },
|
6941 | abrupt: function (type, arg) {
|
6942 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
6943 | var entry = this.tryEntries[i];
|
6944 |
|
6945 | if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
6946 | var finallyEntry = entry;
|
6947 | break;
|
6948 | }
|
6949 | }
|
6950 |
|
6951 | if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
|
6952 |
|
6953 |
|
6954 | finallyEntry = null;
|
6955 | }
|
6956 |
|
6957 | var record = finallyEntry ? finallyEntry.completion : {};
|
6958 | record.type = type;
|
6959 | record.arg = arg;
|
6960 |
|
6961 | if (finallyEntry) {
|
6962 | this.method = "next";
|
6963 | this.next = finallyEntry.finallyLoc;
|
6964 | return ContinueSentinel;
|
6965 | }
|
6966 |
|
6967 | return this.complete(record);
|
6968 | },
|
6969 | complete: function (record, afterLoc) {
|
6970 | if (record.type === "throw") {
|
6971 | throw record.arg;
|
6972 | }
|
6973 |
|
6974 | if (record.type === "break" || record.type === "continue") {
|
6975 | this.next = record.arg;
|
6976 | } else if (record.type === "return") {
|
6977 | this.rval = this.arg = record.arg;
|
6978 | this.method = "return";
|
6979 | this.next = "end";
|
6980 | } else if (record.type === "normal" && afterLoc) {
|
6981 | this.next = afterLoc;
|
6982 | }
|
6983 |
|
6984 | return ContinueSentinel;
|
6985 | },
|
6986 | finish: function (finallyLoc) {
|
6987 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
6988 | var entry = this.tryEntries[i];
|
6989 |
|
6990 | if (entry.finallyLoc === finallyLoc) {
|
6991 | this.complete(entry.completion, entry.afterLoc);
|
6992 | resetTryEntry(entry);
|
6993 | return ContinueSentinel;
|
6994 | }
|
6995 | }
|
6996 | },
|
6997 | "catch": function (tryLoc) {
|
6998 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
6999 | var entry = this.tryEntries[i];
|
7000 |
|
7001 | if (entry.tryLoc === tryLoc) {
|
7002 | var record = entry.completion;
|
7003 |
|
7004 | if (record.type === "throw") {
|
7005 | var thrown = record.arg;
|
7006 | resetTryEntry(entry);
|
7007 | }
|
7008 |
|
7009 | return thrown;
|
7010 | }
|
7011 | }
|
7012 |
|
7013 |
|
7014 |
|
7015 | throw new Error("illegal catch attempt");
|
7016 | },
|
7017 | delegateYield: function (iterable, resultName, nextLoc) {
|
7018 | this.delegate = {
|
7019 | iterator: values(iterable),
|
7020 | resultName: resultName,
|
7021 | nextLoc: nextLoc
|
7022 | };
|
7023 |
|
7024 | if (this.method === "next") {
|
7025 |
|
7026 |
|
7027 | this.arg = undefined$1;
|
7028 | }
|
7029 |
|
7030 | return ContinueSentinel;
|
7031 | }
|
7032 | };
|
7033 |
|
7034 |
|
7035 |
|
7036 |
|
7037 | return exports;
|
7038 | }(
|
7039 |
|
7040 |
|
7041 |
|
7042 | module.exports);
|
7043 |
|
7044 | try {
|
7045 | regeneratorRuntime = runtime;
|
7046 | } catch (accidentalStrictMode) {
|
7047 |
|
7048 |
|
7049 |
|
7050 |
|
7051 |
|
7052 |
|
7053 |
|
7054 |
|
7055 |
|
7056 | Function("r", "regeneratorRuntime = r")(runtime);
|
7057 | }
|
7058 | });
|
7059 | var regenerator = runtime_1;
|
7060 |
|
7061 | defineWellKnownSymbol$1('iterator');
|
7062 |
|
7063 | var createMethod$2$1 = function (CONVERT_TO_STRING) {
|
7064 | return function ($this, pos) {
|
7065 | var S = String(requireObjectCoercible$1($this));
|
7066 | var position = toInteger$1(pos);
|
7067 | var size = S.length;
|
7068 | var first, second;
|
7069 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
7070 | first = S.charCodeAt(position);
|
7071 | return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
7072 | };
|
7073 | };
|
7074 |
|
7075 | var stringMultibyte$1 = {
|
7076 |
|
7077 |
|
7078 | codeAt: createMethod$2$1(false),
|
7079 |
|
7080 |
|
7081 | charAt: createMethod$2$1(true)
|
7082 | };
|
7083 | var charAt$1 = stringMultibyte$1.charAt;
|
7084 | var STRING_ITERATOR$1 = 'String Iterator';
|
7085 | var setInternalState$2$1 = internalState$1.set;
|
7086 | var getInternalState$2$1 = internalState$1.getterFor(STRING_ITERATOR$1); // `String.prototype[@@iterator]` method
|
7087 | // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
|
7088 |
|
7089 | defineIterator$1(String, 'String', function (iterated) {
|
7090 | setInternalState$2$1(this, {
|
7091 | type: STRING_ITERATOR$1,
|
7092 | string: String(iterated),
|
7093 | index: 0
|
7094 | });
|
7095 |
|
7096 | }, function next() {
|
7097 | var state = getInternalState$2$1(this);
|
7098 | var string = state.string;
|
7099 | var index = state.index;
|
7100 | var point;
|
7101 | if (index >= string.length) return {
|
7102 | value: undefined,
|
7103 | done: true
|
7104 | };
|
7105 | point = charAt$1(string, index);
|
7106 | state.index += point.length;
|
7107 | return {
|
7108 | value: point,
|
7109 | done: false
|
7110 | };
|
7111 | });
|
7112 | var iterator$3 = wrappedWellKnownSymbol$1.f('iterator');
|
7113 | var iterator$1$1 = iterator$3;
|
7114 | var iterator$2$1 = iterator$1$1;
|
7115 | var $stringify$1$1 = getBuiltIn$1('JSON', 'stringify');
|
7116 | var re = /[\uD800-\uDFFF]/g;
|
7117 | var low = /^[\uD800-\uDBFF]$/;
|
7118 | var hi = /^[\uDC00-\uDFFF]$/;
|
7119 |
|
7120 | var fix = function (match, offset, string) {
|
7121 | var prev = string.charAt(offset - 1);
|
7122 | var next = string.charAt(offset + 1);
|
7123 |
|
7124 | if (low.test(match) && !hi.test(next) || hi.test(match) && !low.test(prev)) {
|
7125 | return '\\u' + match.charCodeAt(0).toString(16);
|
7126 | }
|
7127 |
|
7128 | return match;
|
7129 | };
|
7130 |
|
7131 | var FORCED$1$1 = fails$1(function () {
|
7132 | return $stringify$1$1('\uDF06\uD834') !== '"\\udf06\\ud834"' || $stringify$1$1('\uDEAD') !== '"\\udead"';
|
7133 | });
|
7134 |
|
7135 | if ($stringify$1$1) {
|
7136 |
|
7137 | _export$1({
|
7138 | target: 'JSON',
|
7139 | stat: true,
|
7140 | forced: FORCED$1$1
|
7141 | }, {
|
7142 |
|
7143 | stringify: function stringify(it, replacer, space) {
|
7144 | var result = $stringify$1$1.apply(null, arguments);
|
7145 | return typeof result == 'string' ? result.replace(re, fix) : result;
|
7146 | }
|
7147 | });
|
7148 | }
|
7149 |
|
7150 | if (!path$1.JSON) path$1.JSON = {
|
7151 | stringify: JSON.stringify
|
7152 | };
|
7153 |
|
7154 | var stringify = function stringify(it, replacer, space) {
|
7155 | return path$1.JSON.stringify.apply(null, arguments);
|
7156 | };
|
7157 |
|
7158 | var stringify$1 = stringify;
|
7159 | var stringify$2 = stringify$1;
|
7160 | var defineProperty$4$1 = defineProperty_1$1;
|
7161 | var defineProperty$5$1 = defineProperty$4$1;
|
7162 |
|
7163 | function _defineProperty$1(obj, key, value) {
|
7164 | if (key in obj) {
|
7165 | defineProperty$5$1(obj, key, {
|
7166 | value: value,
|
7167 | enumerable: true,
|
7168 | configurable: true,
|
7169 | writable: true
|
7170 | });
|
7171 | } else {
|
7172 | obj[key] = value;
|
7173 | }
|
7174 |
|
7175 | return obj;
|
7176 | }
|
7177 |
|
7178 | var defineProperty$6$1 = _defineProperty$1;
|
7179 | var values$3 = entryVirtual$1('Array').values;
|
7180 | var values$1$1 = values$3;
|
7181 | var ArrayPrototype$2$1 = Array.prototype;
|
7182 | var DOMIterables$2 = {
|
7183 | DOMTokenList: true,
|
7184 | NodeList: true
|
7185 | };
|
7186 |
|
7187 | var values_1 = function (it) {
|
7188 | var own = it.values;
|
7189 | return it === ArrayPrototype$2$1 || it instanceof Array && own === ArrayPrototype$2$1.values
|
7190 | || DOMIterables$2.hasOwnProperty(classof$1(it)) ? values$1$1 : own;
|
7191 | };
|
7192 |
|
7193 | var values$2$1 = values_1;
|
7194 | var ITERATOR$2$1 = wellKnownSymbol$1('iterator');
|
7195 |
|
7196 | var getIteratorMethod$1 = function (it) {
|
7197 | if (it != undefined) return it[ITERATOR$2$1] || it['@@iterator'] || iterators$1[classof$1(it)];
|
7198 | };
|
7199 |
|
7200 | var getIterator$3 = function (it) {
|
7201 | var iteratorMethod = getIteratorMethod$1(it);
|
7202 |
|
7203 | if (typeof iteratorMethod != 'function') {
|
7204 | throw TypeError(String(it) + ' is not iterable');
|
7205 | }
|
7206 |
|
7207 | return anObject$1(iteratorMethod.call(it));
|
7208 | };
|
7209 |
|
7210 | var getIterator$1$1 = getIterator$3;
|
7211 | var getIterator$2$1 = getIterator$1$1;
|
7212 | var nativeSort = [].sort;
|
7213 | var test$1$1 = [1, 2, 3];
|
7214 |
|
7215 | var FAILS_ON_UNDEFINED = fails$1(function () {
|
7216 | test$1$1.sort(undefined);
|
7217 | });
|
7218 |
|
7219 | var FAILS_ON_NULL = fails$1(function () {
|
7220 | test$1$1.sort(null);
|
7221 | });
|
7222 |
|
7223 | var SLOPPY_METHOD$1 = sloppyArrayMethod$1('sort');
|
7224 | var FORCED$2$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD$1;
|
7225 |
|
7226 |
|
7227 | _export$1({
|
7228 | target: 'Array',
|
7229 | proto: true,
|
7230 | forced: FORCED$2$1
|
7231 | }, {
|
7232 | sort: function sort(comparefn) {
|
7233 | return comparefn === undefined ? nativeSort.call(toObject$1(this)) : nativeSort.call(toObject$1(this), aFunction$2(comparefn));
|
7234 | }
|
7235 | });
|
7236 |
|
7237 | var sort = entryVirtual$1('Array').sort;
|
7238 | var ArrayPrototype$3$1 = Array.prototype;
|
7239 |
|
7240 | var sort_1 = function (it) {
|
7241 | var own = it.sort;
|
7242 | return it === ArrayPrototype$3$1 || it instanceof Array && own === ArrayPrototype$3$1.sort ? sort : own;
|
7243 | };
|
7244 |
|
7245 | var sort$1 = sort_1;
|
7246 | var sort$2 = sort$1;
|
7247 |
|
7248 | var createMethod$3$1 = function (IS_RIGHT) {
|
7249 | return function (that, callbackfn, argumentsLength, memo) {
|
7250 | aFunction$2(callbackfn);
|
7251 | var O = toObject$1(that);
|
7252 | var self = indexedObject$1(O);
|
7253 | var length = toLength$1(O.length);
|
7254 | var index = IS_RIGHT ? length - 1 : 0;
|
7255 | var i = IS_RIGHT ? -1 : 1;
|
7256 | if (argumentsLength < 2) while (true) {
|
7257 | if (index in self) {
|
7258 | memo = self[index];
|
7259 | index += i;
|
7260 | break;
|
7261 | }
|
7262 |
|
7263 | index += i;
|
7264 |
|
7265 | if (IS_RIGHT ? index < 0 : length <= index) {
|
7266 | throw TypeError('Reduce of empty array with no initial value');
|
7267 | }
|
7268 | }
|
7269 |
|
7270 | for (; IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
7271 | memo = callbackfn(memo, self[index], index, O);
|
7272 | }
|
7273 |
|
7274 | return memo;
|
7275 | };
|
7276 | };
|
7277 |
|
7278 | var arrayReduce = {
|
7279 |
|
7280 |
|
7281 | left: createMethod$3$1(false),
|
7282 |
|
7283 |
|
7284 | right: createMethod$3$1(true)
|
7285 | };
|
7286 | var $reduce = arrayReduce.left;
|
7287 |
|
7288 |
|
7289 | _export$1({
|
7290 | target: 'Array',
|
7291 | proto: true,
|
7292 | forced: sloppyArrayMethod$1('reduce')
|
7293 | }, {
|
7294 | reduce: function reduce(callbackfn
|
7295 | /* , initialValue */
|
7296 | ) {
|
7297 | return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
|
7298 | }
|
7299 | });
|
7300 |
|
7301 | var reduce = entryVirtual$1('Array').reduce;
|
7302 | var ArrayPrototype$4$1 = Array.prototype;
|
7303 |
|
7304 | var reduce_1 = function (it) {
|
7305 | var own = it.reduce;
|
7306 | return it === ArrayPrototype$4$1 || it instanceof Array && own === ArrayPrototype$4$1.reduce ? reduce : own;
|
7307 | };
|
7308 |
|
7309 | var reduce$1 = reduce_1;
|
7310 | var reduce$2 = reduce$1;
|
7311 | var keys$1$1 = entryVirtual$1('Array').keys;
|
7312 | var keys$2$1 = keys$1$1;
|
7313 | var ArrayPrototype$5$1 = Array.prototype;
|
7314 | var DOMIterables$3 = {
|
7315 | DOMTokenList: true,
|
7316 | NodeList: true
|
7317 | };
|
7318 |
|
7319 | var keys_1 = function (it) {
|
7320 | var own = it.keys;
|
7321 | return it === ArrayPrototype$5$1 || it instanceof Array && own === ArrayPrototype$5$1.keys
|
7322 | || DOMIterables$3.hasOwnProperty(classof$1(it)) ? keys$2$1 : own;
|
7323 | };
|
7324 |
|
7325 | var keys$3$1 = keys_1;
|
7326 |
|
7327 | _export$1({
|
7328 | target: 'Array',
|
7329 | stat: true
|
7330 | }, {
|
7331 | isArray: isArray$6
|
7332 | });
|
7333 |
|
7334 | var isArray$1$1 = path$1.Array.isArray;
|
7335 | var isArray$2$1 = isArray$1$1;
|
7336 | var isArray$3$1 = isArray$2$1;
|
7337 |
|
7338 | function _arrayWithoutHoles$1(arr) {
|
7339 | if (isArray$3$1(arr)) {
|
7340 | for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
|
7341 | arr2[i] = arr[i];
|
7342 | }
|
7343 |
|
7344 | return arr2;
|
7345 | }
|
7346 | }
|
7347 |
|
7348 | var arrayWithoutHoles$1 = _arrayWithoutHoles$1;
|
7349 |
|
7350 | var callWithSafeIterationClosing$1 = function (iterator, fn, value, ENTRIES) {
|
7351 | try {
|
7352 | return ENTRIES ? fn(anObject$1(value)[0], value[1]) : fn(value);
|
7353 | } catch (error) {
|
7354 | var returnMethod = iterator['return'];
|
7355 | if (returnMethod !== undefined) anObject$1(returnMethod.call(iterator));
|
7356 | throw error;
|
7357 | }
|
7358 | };
|
7359 |
|
7360 | var ITERATOR$3$1 = wellKnownSymbol$1('iterator');
|
7361 | var ArrayPrototype$6$1 = Array.prototype;
|
7362 |
|
7363 | var isArrayIteratorMethod$1 = function (it) {
|
7364 | return it !== undefined && (iterators$1.Array === it || ArrayPrototype$6$1[ITERATOR$3$1] === it);
|
7365 | };
|
7366 |
|
7367 |
|
7368 | var arrayFrom$1 = function from(arrayLike
|
7369 | /* , mapfn = undefined, thisArg = undefined */
|
7370 | ) {
|
7371 | var O = toObject$1(arrayLike);
|
7372 | var C = typeof this == 'function' ? this : Array;
|
7373 | var argumentsLength = arguments.length;
|
7374 | var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
7375 | var mapping = mapfn !== undefined;
|
7376 | var index = 0;
|
7377 | var iteratorMethod = getIteratorMethod$1(O);
|
7378 | var length, result, step, iterator, next;
|
7379 | if (mapping) mapfn = bindContext$1(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
|
7380 |
|
7381 | if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod$1(iteratorMethod))) {
|
7382 | iterator = iteratorMethod.call(O);
|
7383 | next = iterator.next;
|
7384 | result = new C();
|
7385 |
|
7386 | for (; !(step = next.call(iterator)).done; index++) {
|
7387 | createProperty$1(result, index, mapping ? callWithSafeIterationClosing$1(iterator, mapfn, [step.value, index], true) : step.value);
|
7388 | }
|
7389 | } else {
|
7390 | length = toLength$1(O.length);
|
7391 | result = new C(length);
|
7392 |
|
7393 | for (; length > index; index++) {
|
7394 | createProperty$1(result, index, mapping ? mapfn(O[index], index) : O[index]);
|
7395 | }
|
7396 | }
|
7397 |
|
7398 | result.length = index;
|
7399 | return result;
|
7400 | };
|
7401 |
|
7402 | var ITERATOR$4$1 = wellKnownSymbol$1('iterator');
|
7403 | var SAFE_CLOSING$1 = false;
|
7404 |
|
7405 | try {
|
7406 | var called$1 = 0;
|
7407 | var iteratorWithReturn$1 = {
|
7408 | next: function () {
|
7409 | return {
|
7410 | done: !!called$1++
|
7411 | };
|
7412 | },
|
7413 | 'return': function () {
|
7414 | SAFE_CLOSING$1 = true;
|
7415 | }
|
7416 | };
|
7417 |
|
7418 | iteratorWithReturn$1[ITERATOR$4$1] = function () {
|
7419 | return this;
|
7420 | };
|
7421 |
|
7422 |
|
7423 | Array.from(iteratorWithReturn$1, function () {
|
7424 | throw 2;
|
7425 | });
|
7426 | } catch (error) {
|
7427 |
|
7428 | }
|
7429 |
|
7430 | var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
|
7431 | if (!SKIP_CLOSING && !SAFE_CLOSING$1) return false;
|
7432 | var ITERATION_SUPPORT = false;
|
7433 |
|
7434 | try {
|
7435 | var object = {};
|
7436 |
|
7437 | object[ITERATOR$4$1] = function () {
|
7438 | return {
|
7439 | next: function () {
|
7440 | return {
|
7441 | done: ITERATION_SUPPORT = true
|
7442 | };
|
7443 | }
|
7444 | };
|
7445 | };
|
7446 |
|
7447 | exec(object);
|
7448 | } catch (error) {
|
7449 |
|
7450 | }
|
7451 |
|
7452 | return ITERATION_SUPPORT;
|
7453 | };
|
7454 |
|
7455 | var INCORRECT_ITERATION$1 = !checkCorrectnessOfIteration$1(function (iterable) {
|
7456 | Array.from(iterable);
|
7457 | });
|
7458 |
|
7459 |
|
7460 | _export$1({
|
7461 | target: 'Array',
|
7462 | stat: true,
|
7463 | forced: INCORRECT_ITERATION$1
|
7464 | }, {
|
7465 | from: arrayFrom$1
|
7466 | });
|
7467 |
|
7468 | var from_1$3 = path$1.Array.from;
|
7469 | var from_1$1$1 = from_1$3;
|
7470 | var from_1$2$1 = from_1$1$1;
|
7471 | var ITERATOR$5$1 = wellKnownSymbol$1('iterator');
|
7472 |
|
7473 | var isIterable$3 = function (it) {
|
7474 | var O = Object(it);
|
7475 | return O[ITERATOR$5$1] !== undefined || '@@iterator' in O
|
7476 | || iterators$1.hasOwnProperty(classof$1(O));
|
7477 | };
|
7478 |
|
7479 | var isIterable$1$1 = isIterable$3;
|
7480 | var isIterable$2$1 = isIterable$1$1;
|
7481 |
|
7482 | function _iterableToArray$1(iter) {
|
7483 | if (isIterable$2$1(Object(iter)) || Object.prototype.toString.call(iter) === "[object Arguments]") return from_1$2$1(iter);
|
7484 | }
|
7485 |
|
7486 | var iterableToArray$1 = _iterableToArray$1;
|
7487 |
|
7488 | function _nonIterableSpread$1() {
|
7489 | throw new TypeError("Invalid attempt to spread non-iterable instance");
|
7490 | }
|
7491 |
|
7492 | var nonIterableSpread$1 = _nonIterableSpread$1;
|
7493 |
|
7494 | function _toConsumableArray$1(arr) {
|
7495 | return arrayWithoutHoles$1(arr) || iterableToArray$1(arr) || nonIterableSpread$1();
|
7496 | }
|
7497 |
|
7498 | var toConsumableArray$1 = _toConsumableArray$1;
|
7499 | var userAgent$1 = getBuiltIn$1('navigator', 'userAgent') || '';
|
7500 | var process$1 = global_1$1.process;
|
7501 | var versions$1 = process$1 && process$1.versions;
|
7502 | var v8$1 = versions$1 && versions$1.v8;
|
7503 | var match$1, version$1;
|
7504 |
|
7505 | if (v8$1) {
|
7506 | match$1 = v8$1.split('.');
|
7507 | version$1 = match$1[0] + match$1[1];
|
7508 | } else if (userAgent$1) {
|
7509 | match$1 = userAgent$1.match(/Edge\/(\d+)/);
|
7510 |
|
7511 | if (!match$1 || match$1[1] >= 74) {
|
7512 | match$1 = userAgent$1.match(/Chrome\/(\d+)/);
|
7513 | if (match$1) version$1 = match$1[1];
|
7514 | }
|
7515 | }
|
7516 |
|
7517 | var v8Version$1 = version$1 && +version$1;
|
7518 | var SPECIES$1$1 = wellKnownSymbol$1('species');
|
7519 |
|
7520 | var arrayMethodHasSpeciesSupport$1 = function (METHOD_NAME) {
|
7521 |
|
7522 |
|
7523 |
|
7524 | return v8Version$1 >= 51 || !fails$1(function () {
|
7525 | var array = [];
|
7526 | var constructor = array.constructor = {};
|
7527 |
|
7528 | constructor[SPECIES$1$1] = function () {
|
7529 | return {
|
7530 | foo: 1
|
7531 | };
|
7532 | };
|
7533 |
|
7534 | return array[METHOD_NAME](Boolean).foo !== 1;
|
7535 | });
|
7536 | };
|
7537 |
|
7538 | var $filter$1 = arrayIteration$1.filter;
|
7539 |
|
7540 |
|
7541 |
|
7542 | _export$1({
|
7543 | target: 'Array',
|
7544 | proto: true,
|
7545 | forced: !arrayMethodHasSpeciesSupport$1('filter')
|
7546 | }, {
|
7547 | filter: function filter(callbackfn
|
7548 | /* , thisArg */
|
7549 | ) {
|
7550 | return $filter$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
7551 | }
|
7552 | });
|
7553 |
|
7554 | var filter$3 = entryVirtual$1('Array').filter;
|
7555 | var ArrayPrototype$7$1 = Array.prototype;
|
7556 |
|
7557 | var filter_1$1 = function (it) {
|
7558 | var own = it.filter;
|
7559 | return it === ArrayPrototype$7$1 || it instanceof Array && own === ArrayPrototype$7$1.filter ? filter$3 : own;
|
7560 | };
|
7561 |
|
7562 | var filter$1$1 = filter_1$1;
|
7563 | var filter$2$1 = filter$1$1;
|
7564 | var IS_CONCAT_SPREADABLE$1 = wellKnownSymbol$1('isConcatSpreadable');
|
7565 | var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;
|
7566 | var MAXIMUM_ALLOWED_INDEX_EXCEEDED$1 = 'Maximum allowed index exceeded';
|
7567 |
|
7568 |
|
7569 |
|
7570 | var IS_CONCAT_SPREADABLE_SUPPORT$1 = v8Version$1 >= 51 || !fails$1(function () {
|
7571 | var array = [];
|
7572 | array[IS_CONCAT_SPREADABLE$1] = false;
|
7573 | return array.concat()[0] !== array;
|
7574 | });
|
7575 | var SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('concat');
|
7576 |
|
7577 | var isConcatSpreadable$1 = function (O) {
|
7578 | if (!isObject$2(O)) return false;
|
7579 | var spreadable = O[IS_CONCAT_SPREADABLE$1];
|
7580 | return spreadable !== undefined ? !!spreadable : isArray$6(O);
|
7581 | };
|
7582 |
|
7583 | var FORCED$3$1 = !IS_CONCAT_SPREADABLE_SUPPORT$1 || !SPECIES_SUPPORT$1;
|
7584 |
|
7585 |
|
7586 |
|
7587 | _export$1({
|
7588 | target: 'Array',
|
7589 | proto: true,
|
7590 | forced: FORCED$3$1
|
7591 | }, {
|
7592 | concat: function concat(arg) {
|
7593 |
|
7594 | var O = toObject$1(this);
|
7595 | var A = arraySpeciesCreate$1(O, 0);
|
7596 | var n = 0;
|
7597 | var i, k, length, len, E;
|
7598 |
|
7599 | for (i = -1, length = arguments.length; i < length; i++) {
|
7600 | E = i === -1 ? O : arguments[i];
|
7601 |
|
7602 | if (isConcatSpreadable$1(E)) {
|
7603 | len = toLength$1(E.length);
|
7604 | if (n + len > MAX_SAFE_INTEGER$1) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED$1);
|
7605 |
|
7606 | for (k = 0; k < len; k++, n++) if (k in E) createProperty$1(A, n, E[k]);
|
7607 | } else {
|
7608 | if (n >= MAX_SAFE_INTEGER$1) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED$1);
|
7609 | createProperty$1(A, n++, E);
|
7610 | }
|
7611 | }
|
7612 |
|
7613 | A.length = n;
|
7614 | return A;
|
7615 | }
|
7616 | });
|
7617 |
|
7618 | var concat$3 = entryVirtual$1('Array').concat;
|
7619 | var ArrayPrototype$8 = Array.prototype;
|
7620 |
|
7621 | var concat_1$1 = function (it) {
|
7622 | var own = it.concat;
|
7623 | return it === ArrayPrototype$8 || it instanceof Array && own === ArrayPrototype$8.concat ? concat$3 : own;
|
7624 | };
|
7625 |
|
7626 | var concat$1$1 = concat_1$1;
|
7627 | var concat$2$1 = concat$1$1;
|
7628 | var nativeAssign$1 = Object.assign;
|
7629 |
|
7630 |
|
7631 |
|
7632 | var objectAssign$1 = !nativeAssign$1 || fails$1(function () {
|
7633 | var A = {};
|
7634 | var B = {};
|
7635 |
|
7636 | var symbol = Symbol();
|
7637 | var alphabet = 'abcdefghijklmnopqrst';
|
7638 | A[symbol] = 7;
|
7639 | alphabet.split('').forEach(function (chr) {
|
7640 | B[chr] = chr;
|
7641 | });
|
7642 | return nativeAssign$1({}, A)[symbol] != 7 || objectKeys$1(nativeAssign$1({}, B)).join('') != alphabet;
|
7643 | }) ? function assign(target, source) {
|
7644 |
|
7645 | var T = toObject$1(target);
|
7646 | var argumentsLength = arguments.length;
|
7647 | var index = 1;
|
7648 | var getOwnPropertySymbols = objectGetOwnPropertySymbols$1.f;
|
7649 | var propertyIsEnumerable = objectPropertyIsEnumerable$1.f;
|
7650 |
|
7651 | while (argumentsLength > index) {
|
7652 | var S = indexedObject$1(arguments[index++]);
|
7653 | var keys = getOwnPropertySymbols ? objectKeys$1(S).concat(getOwnPropertySymbols(S)) : objectKeys$1(S);
|
7654 | var length = keys.length;
|
7655 | var j = 0;
|
7656 | var key;
|
7657 |
|
7658 | while (length > j) {
|
7659 | key = keys[j++];
|
7660 | if (!descriptors$1 || propertyIsEnumerable.call(S, key)) T[key] = S[key];
|
7661 | }
|
7662 | }
|
7663 |
|
7664 | return T;
|
7665 | } : nativeAssign$1;
|
7666 |
|
7667 | _export$1({
|
7668 | target: 'Object',
|
7669 | stat: true,
|
7670 | forced: Object.assign !== objectAssign$1
|
7671 | }, {
|
7672 | assign: objectAssign$1
|
7673 | });
|
7674 |
|
7675 | var assign$3 = path$1.Object.assign;
|
7676 | var assign$1$1 = assign$3;
|
7677 | var assign$2$1 = assign$1$1;
|
7678 | var $some = arrayIteration$1.some;
|
7679 |
|
7680 |
|
7681 | _export$1({
|
7682 | target: 'Array',
|
7683 | proto: true,
|
7684 | forced: sloppyArrayMethod$1('some')
|
7685 | }, {
|
7686 | some: function some(callbackfn
|
7687 | /* , thisArg */
|
7688 | ) {
|
7689 | return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
7690 | }
|
7691 | });
|
7692 |
|
7693 | var some = entryVirtual$1('Array').some;
|
7694 | var ArrayPrototype$9 = Array.prototype;
|
7695 |
|
7696 | var some_1 = function (it) {
|
7697 | var own = it.some;
|
7698 | return it === ArrayPrototype$9 || it instanceof Array && own === ArrayPrototype$9.some ? some : own;
|
7699 | };
|
7700 |
|
7701 | var some$1 = some_1;
|
7702 | var some$2 = some$1;
|
7703 | var $map$1 = arrayIteration$1.map;
|
7704 |
|
7705 |
|
7706 |
|
7707 | _export$1({
|
7708 | target: 'Array',
|
7709 | proto: true,
|
7710 | forced: !arrayMethodHasSpeciesSupport$1('map')
|
7711 | }, {
|
7712 | map: function map(callbackfn
|
7713 | /* , thisArg */
|
7714 | ) {
|
7715 | return $map$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
7716 | }
|
7717 | });
|
7718 |
|
7719 | var map$3 = entryVirtual$1('Array').map;
|
7720 | var ArrayPrototype$a = Array.prototype;
|
7721 |
|
7722 | var map_1$1 = function (it) {
|
7723 | var own = it.map;
|
7724 | return it === ArrayPrototype$a || it instanceof Array && own === ArrayPrototype$a.map ? map$3 : own;
|
7725 | };
|
7726 |
|
7727 | var map$1$1 = map_1$1;
|
7728 | var map$2$1 = map$1$1;
|
7729 | var iterator$3$1 = iterator$3;
|
7730 | var iterator$4 = iterator$3$1;
|
7731 |
|
7732 | defineWellKnownSymbol$1('asyncIterator');
|
7733 |
|
7734 | defineWellKnownSymbol$1('hasInstance');
|
7735 |
|
7736 | defineWellKnownSymbol$1('isConcatSpreadable');
|
7737 |
|
7738 | defineWellKnownSymbol$1('match');
|
7739 | defineWellKnownSymbol$1('matchAll');
|
7740 |
|
7741 | defineWellKnownSymbol$1('replace');
|
7742 |
|
7743 | defineWellKnownSymbol$1('search');
|
7744 |
|
7745 | defineWellKnownSymbol$1('species');
|
7746 |
|
7747 | defineWellKnownSymbol$1('split');
|
7748 |
|
7749 | defineWellKnownSymbol$1('toPrimitive');
|
7750 |
|
7751 | defineWellKnownSymbol$1('toStringTag');
|
7752 |
|
7753 | defineWellKnownSymbol$1('unscopables');
|
7754 |
|
7755 | setToStringTag$1(Math, 'Math', true);
|
7756 |
|
7757 | setToStringTag$1(global_1$1.JSON, 'JSON', true);
|
7758 | var symbol$3 = path$1.Symbol;
|
7759 |
|
7760 | defineWellKnownSymbol$1('asyncDispose');
|
7761 |
|
7762 | defineWellKnownSymbol$1('dispose');
|
7763 |
|
7764 | defineWellKnownSymbol$1('observable');
|
7765 |
|
7766 | defineWellKnownSymbol$1('patternMatch');
|
7767 | defineWellKnownSymbol$1('replaceAll');
|
7768 | var symbol$1$1 = symbol$3;
|
7769 |
|
7770 | var symbol$2$1 = symbol$1$1;
|
7771 |
|
7772 | var _typeof_1$1 = createCommonjsModule$2(function (module) {
|
7773 | function _typeof2(obj) {
|
7774 | if (typeof symbol$2$1 === "function" && typeof iterator$4 === "symbol") {
|
7775 | _typeof2 = function _typeof2(obj) {
|
7776 | return typeof obj;
|
7777 | };
|
7778 | } else {
|
7779 | _typeof2 = function _typeof2(obj) {
|
7780 | return obj && typeof symbol$2$1 === "function" && obj.constructor === symbol$2$1 && obj !== symbol$2$1.prototype ? "symbol" : typeof obj;
|
7781 | };
|
7782 | }
|
7783 |
|
7784 | return _typeof2(obj);
|
7785 | }
|
7786 |
|
7787 | function _typeof(obj) {
|
7788 | if (typeof symbol$2$1 === "function" && _typeof2(iterator$4) === "symbol") {
|
7789 | module.exports = _typeof = function _typeof(obj) {
|
7790 | return _typeof2(obj);
|
7791 | };
|
7792 | } else {
|
7793 | module.exports = _typeof = function _typeof(obj) {
|
7794 | return obj && typeof symbol$2$1 === "function" && obj.constructor === symbol$2$1 && obj !== symbol$2$1.prototype ? "symbol" : _typeof2(obj);
|
7795 | };
|
7796 | }
|
7797 |
|
7798 | return _typeof(obj);
|
7799 | }
|
7800 |
|
7801 | module.exports = _typeof;
|
7802 | });
|
7803 |
|
7804 | var FAILS_ON_PRIMITIVES$1$1 = fails$1(function () {
|
7805 | objectKeys$1(1);
|
7806 | });
|
7807 |
|
7808 |
|
7809 | _export$1({
|
7810 | target: 'Object',
|
7811 | stat: true,
|
7812 | forced: FAILS_ON_PRIMITIVES$1$1
|
7813 | }, {
|
7814 | keys: function keys(it) {
|
7815 | return objectKeys$1(toObject$1(it));
|
7816 | }
|
7817 | });
|
7818 |
|
7819 | var keys$4$1 = path$1.Object.keys;
|
7820 | var keys$5 = keys$4$1;
|
7821 | var keys$6 = keys$5;
|
7822 | var freezing = !fails$1(function () {
|
7823 | return Object.isExtensible(Object.preventExtensions({}));
|
7824 | });
|
7825 | var internalMetadata = createCommonjsModule$2(function (module) {
|
7826 | var defineProperty = objectDefineProperty$1.f;
|
7827 | var METADATA = uid$1('meta');
|
7828 | var id = 0;
|
7829 |
|
7830 | var isExtensible = Object.isExtensible || function () {
|
7831 | return true;
|
7832 | };
|
7833 |
|
7834 | var setMetadata = function (it) {
|
7835 | defineProperty(it, METADATA, {
|
7836 | value: {
|
7837 | objectID: 'O' + ++id,
|
7838 |
|
7839 | weakData: {}
|
7840 |
|
7841 | }
|
7842 | });
|
7843 | };
|
7844 |
|
7845 | var fastKey = function (it, create) {
|
7846 |
|
7847 | if (!isObject$2(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
7848 |
|
7849 | if (!has$2(it, METADATA)) {
|
7850 |
|
7851 | if (!isExtensible(it)) return 'F';
|
7852 |
|
7853 | if (!create) return 'E';
|
7854 |
|
7855 | setMetadata(it);
|
7856 | }
|
7857 |
|
7858 | return it[METADATA].objectID;
|
7859 | };
|
7860 |
|
7861 | var getWeakData = function (it, create) {
|
7862 | if (!has$2(it, METADATA)) {
|
7863 |
|
7864 | if (!isExtensible(it)) return true;
|
7865 |
|
7866 | if (!create) return false;
|
7867 |
|
7868 | setMetadata(it);
|
7869 | }
|
7870 |
|
7871 | return it[METADATA].weakData;
|
7872 | };
|
7873 |
|
7874 |
|
7875 | var onFreeze = function (it) {
|
7876 | if (freezing && meta.REQUIRED && isExtensible(it) && !has$2(it, METADATA)) setMetadata(it);
|
7877 | return it;
|
7878 | };
|
7879 |
|
7880 | var meta = module.exports = {
|
7881 | REQUIRED: false,
|
7882 | fastKey: fastKey,
|
7883 | getWeakData: getWeakData,
|
7884 | onFreeze: onFreeze
|
7885 | };
|
7886 | hiddenKeys$2[METADATA] = true;
|
7887 | });
|
7888 | var internalMetadata_1 = internalMetadata.REQUIRED;
|
7889 | var internalMetadata_2 = internalMetadata.fastKey;
|
7890 | var internalMetadata_3 = internalMetadata.getWeakData;
|
7891 | var internalMetadata_4 = internalMetadata.onFreeze;
|
7892 | var iterate_1 = createCommonjsModule$2(function (module) {
|
7893 | var Result = function (stopped, result) {
|
7894 | this.stopped = stopped;
|
7895 | this.result = result;
|
7896 | };
|
7897 |
|
7898 | var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
|
7899 | var boundFunction = bindContext$1(fn, that, AS_ENTRIES ? 2 : 1);
|
7900 | var iterator, iterFn, index, length, result, next, step;
|
7901 |
|
7902 | if (IS_ITERATOR) {
|
7903 | iterator = iterable;
|
7904 | } else {
|
7905 | iterFn = getIteratorMethod$1(iterable);
|
7906 | if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
|
7907 |
|
7908 | if (isArrayIteratorMethod$1(iterFn)) {
|
7909 | for (index = 0, length = toLength$1(iterable.length); length > index; index++) {
|
7910 | result = AS_ENTRIES ? boundFunction(anObject$1(step = iterable[index])[0], step[1]) : boundFunction(iterable[index]);
|
7911 | if (result && result instanceof Result) return result;
|
7912 | }
|
7913 |
|
7914 | return new Result(false);
|
7915 | }
|
7916 |
|
7917 | iterator = iterFn.call(iterable);
|
7918 | }
|
7919 |
|
7920 | next = iterator.next;
|
7921 |
|
7922 | while (!(step = next.call(iterator)).done) {
|
7923 | result = callWithSafeIterationClosing$1(iterator, boundFunction, step.value, AS_ENTRIES);
|
7924 | if (typeof result == 'object' && result && result instanceof Result) return result;
|
7925 | }
|
7926 |
|
7927 | return new Result(false);
|
7928 | };
|
7929 |
|
7930 | iterate.stop = function (result) {
|
7931 | return new Result(true, result);
|
7932 | };
|
7933 | });
|
7934 |
|
7935 | var anInstance = function (it, Constructor, name) {
|
7936 | if (!(it instanceof Constructor)) {
|
7937 | throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
|
7938 | }
|
7939 |
|
7940 | return it;
|
7941 | };
|
7942 |
|
7943 | var defineProperty$7$1 = objectDefineProperty$1.f;
|
7944 | var forEach$3$1 = arrayIteration$1.forEach;
|
7945 | var setInternalState$3$1 = internalState$1.set;
|
7946 | var internalStateGetterFor = internalState$1.getterFor;
|
7947 |
|
7948 | var collection = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) {
|
7949 | var NativeConstructor = global_1$1[CONSTRUCTOR_NAME];
|
7950 | var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
7951 | var ADDER = IS_MAP ? 'set' : 'add';
|
7952 | var exported = {};
|
7953 | var Constructor;
|
7954 |
|
7955 | if (!descriptors$1 || typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails$1(function () {
|
7956 | new NativeConstructor().entries().next();
|
7957 | }))) {
|
7958 |
|
7959 | Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
|
7960 | internalMetadata.REQUIRED = true;
|
7961 | } else {
|
7962 | Constructor = wrapper(function (target, iterable) {
|
7963 | setInternalState$3$1(anInstance(target, Constructor, CONSTRUCTOR_NAME), {
|
7964 | type: CONSTRUCTOR_NAME,
|
7965 | collection: new NativeConstructor()
|
7966 | });
|
7967 | if (iterable != undefined) iterate_1(iterable, target[ADDER], target, IS_MAP);
|
7968 | });
|
7969 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
7970 | forEach$3$1(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
|
7971 | var IS_ADDER = KEY == 'add' || KEY == 'set';
|
7972 |
|
7973 | if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {
|
7974 | createNonEnumerableProperty$1(Constructor.prototype, KEY, function (a, b) {
|
7975 | var collection = getInternalState(this).collection;
|
7976 | if (!IS_ADDER && IS_WEAK && !isObject$2(a)) return KEY == 'get' ? undefined : false;
|
7977 | var result = collection[KEY](a === 0 ? 0 : a, b);
|
7978 | return IS_ADDER ? this : result;
|
7979 | });
|
7980 | }
|
7981 | });
|
7982 | IS_WEAK || defineProperty$7$1(Constructor.prototype, 'size', {
|
7983 | get: function () {
|
7984 | return getInternalState(this).collection.size;
|
7985 | }
|
7986 | });
|
7987 | }
|
7988 |
|
7989 | setToStringTag$1(Constructor, CONSTRUCTOR_NAME, false, true);
|
7990 | exported[CONSTRUCTOR_NAME] = Constructor;
|
7991 |
|
7992 | _export$1({
|
7993 | global: true,
|
7994 | forced: true
|
7995 | }, exported);
|
7996 |
|
7997 | if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
|
7998 | return Constructor;
|
7999 | };
|
8000 |
|
8001 | var redefineAll = function (target, src, options) {
|
8002 | for (var key in src) {
|
8003 | if (options && options.unsafe && target[key]) target[key] = src[key];else redefine$1(target, key, src[key], options);
|
8004 | }
|
8005 |
|
8006 | return target;
|
8007 | };
|
8008 |
|
8009 | var SPECIES$2$1 = wellKnownSymbol$1('species');
|
8010 |
|
8011 | var setSpecies = function (CONSTRUCTOR_NAME) {
|
8012 | var Constructor = getBuiltIn$1(CONSTRUCTOR_NAME);
|
8013 | var defineProperty = objectDefineProperty$1.f;
|
8014 |
|
8015 | if (descriptors$1 && Constructor && !Constructor[SPECIES$2$1]) {
|
8016 | defineProperty(Constructor, SPECIES$2$1, {
|
8017 | configurable: true,
|
8018 | get: function () {
|
8019 | return this;
|
8020 | }
|
8021 | });
|
8022 | }
|
8023 | };
|
8024 |
|
8025 | var defineProperty$8 = objectDefineProperty$1.f;
|
8026 | var fastKey = internalMetadata.fastKey;
|
8027 | var setInternalState$4 = internalState$1.set;
|
8028 | var internalStateGetterFor$1 = internalState$1.getterFor;
|
8029 | var collectionStrong = {
|
8030 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
8031 | var C = wrapper(function (that, iterable) {
|
8032 | anInstance(that, C, CONSTRUCTOR_NAME);
|
8033 | setInternalState$4(that, {
|
8034 | type: CONSTRUCTOR_NAME,
|
8035 | index: objectCreate$1(null),
|
8036 | first: undefined,
|
8037 | last: undefined,
|
8038 | size: 0
|
8039 | });
|
8040 | if (!descriptors$1) that.size = 0;
|
8041 | if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP);
|
8042 | });
|
8043 | var getInternalState = internalStateGetterFor$1(CONSTRUCTOR_NAME);
|
8044 |
|
8045 | var define = function (that, key, value) {
|
8046 | var state = getInternalState(that);
|
8047 | var entry = getEntry(that, key);
|
8048 | var previous, index;
|
8049 |
|
8050 | if (entry) {
|
8051 | entry.value = value;
|
8052 | } else {
|
8053 | state.last = entry = {
|
8054 | index: index = fastKey(key, true),
|
8055 | key: key,
|
8056 | value: value,
|
8057 | previous: previous = state.last,
|
8058 | next: undefined,
|
8059 | removed: false
|
8060 | };
|
8061 | if (!state.first) state.first = entry;
|
8062 | if (previous) previous.next = entry;
|
8063 | if (descriptors$1) state.size++;else that.size++;
|
8064 |
|
8065 | if (index !== 'F') state.index[index] = entry;
|
8066 | }
|
8067 |
|
8068 | return that;
|
8069 | };
|
8070 |
|
8071 | var getEntry = function (that, key) {
|
8072 | var state = getInternalState(that);
|
8073 |
|
8074 | var index = fastKey(key);
|
8075 | var entry;
|
8076 | if (index !== 'F') return state.index[index];
|
8077 |
|
8078 | for (entry = state.first; entry; entry = entry.next) {
|
8079 | if (entry.key == key) return entry;
|
8080 | }
|
8081 | };
|
8082 |
|
8083 | redefineAll(C.prototype, {
|
8084 |
|
8085 |
|
8086 | clear: function clear() {
|
8087 | var that = this;
|
8088 | var state = getInternalState(that);
|
8089 | var data = state.index;
|
8090 | var entry = state.first;
|
8091 |
|
8092 | while (entry) {
|
8093 | entry.removed = true;
|
8094 | if (entry.previous) entry.previous = entry.previous.next = undefined;
|
8095 | delete data[entry.index];
|
8096 | entry = entry.next;
|
8097 | }
|
8098 |
|
8099 | state.first = state.last = undefined;
|
8100 | if (descriptors$1) state.size = 0;else that.size = 0;
|
8101 | },
|
8102 |
|
8103 |
|
8104 | 'delete': function (key) {
|
8105 | var that = this;
|
8106 | var state = getInternalState(that);
|
8107 | var entry = getEntry(that, key);
|
8108 |
|
8109 | if (entry) {
|
8110 | var next = entry.next;
|
8111 | var prev = entry.previous;
|
8112 | delete state.index[entry.index];
|
8113 | entry.removed = true;
|
8114 | if (prev) prev.next = next;
|
8115 | if (next) next.previous = prev;
|
8116 | if (state.first == entry) state.first = next;
|
8117 | if (state.last == entry) state.last = prev;
|
8118 | if (descriptors$1) state.size--;else that.size--;
|
8119 | }
|
8120 |
|
8121 | return !!entry;
|
8122 | },
|
8123 |
|
8124 |
|
8125 | forEach: function forEach(callbackfn
|
8126 | /* , that = undefined */
|
8127 | ) {
|
8128 | var state = getInternalState(this);
|
8129 | var boundFunction = bindContext$1(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
|
8130 | var entry;
|
8131 |
|
8132 | while (entry = entry ? entry.next : state.first) {
|
8133 | boundFunction(entry.value, entry.key, this);
|
8134 |
|
8135 | while (entry && entry.removed) entry = entry.previous;
|
8136 | }
|
8137 | },
|
8138 |
|
8139 |
|
8140 | has: function has(key) {
|
8141 | return !!getEntry(this, key);
|
8142 | }
|
8143 | });
|
8144 | redefineAll(C.prototype, IS_MAP ? {
|
8145 |
|
8146 | get: function get(key) {
|
8147 | var entry = getEntry(this, key);
|
8148 | return entry && entry.value;
|
8149 | },
|
8150 |
|
8151 | set: function set(key, value) {
|
8152 | return define(this, key === 0 ? 0 : key, value);
|
8153 | }
|
8154 | } : {
|
8155 |
|
8156 | add: function add(value) {
|
8157 | return define(this, value = value === 0 ? 0 : value, value);
|
8158 | }
|
8159 | });
|
8160 | if (descriptors$1) defineProperty$8(C.prototype, 'size', {
|
8161 | get: function () {
|
8162 | return getInternalState(this).size;
|
8163 | }
|
8164 | });
|
8165 | return C;
|
8166 | },
|
8167 | setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {
|
8168 | var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
|
8169 | var getInternalCollectionState = internalStateGetterFor$1(CONSTRUCTOR_NAME);
|
8170 | var getInternalIteratorState = internalStateGetterFor$1(ITERATOR_NAME);
|
8171 |
|
8172 |
|
8173 | defineIterator$1(C, CONSTRUCTOR_NAME, function (iterated, kind) {
|
8174 | setInternalState$4(this, {
|
8175 | type: ITERATOR_NAME,
|
8176 | target: iterated,
|
8177 | state: getInternalCollectionState(iterated),
|
8178 | kind: kind,
|
8179 | last: undefined
|
8180 | });
|
8181 | }, function () {
|
8182 | var state = getInternalIteratorState(this);
|
8183 | var kind = state.kind;
|
8184 | var entry = state.last;
|
8185 |
|
8186 | while (entry && entry.removed) entry = entry.previous;
|
8187 |
|
8188 |
|
8189 | if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
|
8190 |
|
8191 | state.target = undefined;
|
8192 | return {
|
8193 | value: undefined,
|
8194 | done: true
|
8195 | };
|
8196 | }
|
8197 |
|
8198 |
|
8199 | if (kind == 'keys') return {
|
8200 | value: entry.key,
|
8201 | done: false
|
8202 | };
|
8203 | if (kind == 'values') return {
|
8204 | value: entry.value,
|
8205 | done: false
|
8206 | };
|
8207 | return {
|
8208 | value: [entry.key, entry.value],
|
8209 | done: false
|
8210 | };
|
8211 | }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
|
8212 |
|
8213 | setSpecies(CONSTRUCTOR_NAME);
|
8214 | }
|
8215 | };
|
8216 |
|
8217 | var es_map = collection('Map', function (get) {
|
8218 | return function Map() {
|
8219 | return get(this, arguments.length ? arguments[0] : undefined);
|
8220 | };
|
8221 | }, collectionStrong, true);
|
8222 | var map$3$1 = path$1.Map;
|
8223 | var map$4 = map$3$1;
|
8224 | var map$5 = map$4;
|
8225 | var isArray$4$1 = isArray$1$1;
|
8226 | var isArray$5$1 = isArray$4$1;
|
8227 |
|
8228 | function _classCallCheck(instance, Constructor) {
|
8229 | if (!(instance instanceof Constructor)) {
|
8230 | throw new TypeError("Cannot call a class as a function");
|
8231 | }
|
8232 | }
|
8233 |
|
8234 | var classCallCheck = _classCallCheck;
|
8235 |
|
8236 | function _defineProperties(target, props) {
|
8237 | for (var i = 0; i < props.length; i++) {
|
8238 | var descriptor = props[i];
|
8239 | descriptor.enumerable = descriptor.enumerable || false;
|
8240 | descriptor.configurable = true;
|
8241 | if ("value" in descriptor) descriptor.writable = true;
|
8242 | defineProperty$5$1(target, descriptor.key, descriptor);
|
8243 | }
|
8244 | }
|
8245 |
|
8246 | function _createClass(Constructor, protoProps, staticProps) {
|
8247 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
8248 | if (staticProps) _defineProperties(Constructor, staticProps);
|
8249 | return Constructor;
|
8250 | }
|
8251 |
|
8252 | var createClass = _createClass;
|
8253 |
|
8254 | function _assertThisInitialized(self) {
|
8255 | if (self === void 0) {
|
8256 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
8257 | }
|
8258 |
|
8259 | return self;
|
8260 | }
|
8261 |
|
8262 | var assertThisInitialized = _assertThisInitialized;
|
8263 |
|
8264 | function _possibleConstructorReturn(self, call) {
|
8265 | if (call && (_typeof_1$1(call) === "object" || typeof call === "function")) {
|
8266 | return call;
|
8267 | }
|
8268 |
|
8269 | return assertThisInitialized(self);
|
8270 | }
|
8271 |
|
8272 | var possibleConstructorReturn = _possibleConstructorReturn;
|
8273 | var FAILS_ON_PRIMITIVES$2$1 = fails$1(function () {
|
8274 | objectGetPrototypeOf$1(1);
|
8275 | });
|
8276 |
|
8277 |
|
8278 | _export$1({
|
8279 | target: 'Object',
|
8280 | stat: true,
|
8281 | forced: FAILS_ON_PRIMITIVES$2$1,
|
8282 | sham: !correctPrototypeGetter$1
|
8283 | }, {
|
8284 | getPrototypeOf: function getPrototypeOf(it) {
|
8285 | return objectGetPrototypeOf$1(toObject$1(it));
|
8286 | }
|
8287 | });
|
8288 |
|
8289 | var getPrototypeOf$3 = path$1.Object.getPrototypeOf;
|
8290 | var getPrototypeOf$1$1 = getPrototypeOf$3;
|
8291 | var getPrototypeOf$2$1 = getPrototypeOf$1$1;
|
8292 |
|
8293 | _export$1({
|
8294 | target: 'Object',
|
8295 | stat: true
|
8296 | }, {
|
8297 | setPrototypeOf: objectSetPrototypeOf$1
|
8298 | });
|
8299 |
|
8300 | var setPrototypeOf = path$1.Object.setPrototypeOf;
|
8301 | var setPrototypeOf$1 = setPrototypeOf;
|
8302 | var setPrototypeOf$2 = setPrototypeOf$1;
|
8303 | var getPrototypeOf$3$1 = createCommonjsModule$2(function (module) {
|
8304 | function _getPrototypeOf(o) {
|
8305 | module.exports = _getPrototypeOf = setPrototypeOf$2 ? getPrototypeOf$2$1 : function _getPrototypeOf(o) {
|
8306 | return o.__proto__ || getPrototypeOf$2$1(o);
|
8307 | };
|
8308 | return _getPrototypeOf(o);
|
8309 | }
|
8310 |
|
8311 | module.exports = _getPrototypeOf;
|
8312 | });
|
8313 |
|
8314 | _export$1({
|
8315 | target: 'Object',
|
8316 | stat: true,
|
8317 | sham: !descriptors$1
|
8318 | }, {
|
8319 | create: objectCreate$1
|
8320 | });
|
8321 |
|
8322 | var Object$1$1 = path$1.Object;
|
8323 |
|
8324 | var create$3 = function create(P, D) {
|
8325 | return Object$1$1.create(P, D);
|
8326 | };
|
8327 |
|
8328 | var create$1$1 = create$3;
|
8329 | var create$2$1 = create$1$1;
|
8330 | var setPrototypeOf$3 = createCommonjsModule$2(function (module) {
|
8331 | function _setPrototypeOf(o, p) {
|
8332 | module.exports = _setPrototypeOf = setPrototypeOf$2 || function _setPrototypeOf(o, p) {
|
8333 | o.__proto__ = p;
|
8334 | return o;
|
8335 | };
|
8336 |
|
8337 | return _setPrototypeOf(o, p);
|
8338 | }
|
8339 |
|
8340 | module.exports = _setPrototypeOf;
|
8341 | });
|
8342 |
|
8343 | function _inherits(subClass, superClass) {
|
8344 | if (typeof superClass !== "function" && superClass !== null) {
|
8345 | throw new TypeError("Super expression must either be null or a function");
|
8346 | }
|
8347 |
|
8348 | subClass.prototype = create$2$1(superClass && superClass.prototype, {
|
8349 | constructor: {
|
8350 | value: subClass,
|
8351 | writable: true,
|
8352 | configurable: true
|
8353 | }
|
8354 | });
|
8355 | if (superClass) setPrototypeOf$3(subClass, superClass);
|
8356 | }
|
8357 |
|
8358 | var inherits = _inherits;
|
8359 |
|
8360 | var byteToHex$2 = [];
|
8361 |
|
8362 | for (var i$2 = 0; i$2 < 256; i$2++) {
|
8363 | byteToHex$2[i$2] = (i$2 + 0x100).toString(16).substr(1);
|
8364 | }
|
8365 |
|
8366 |
|
8367 |
|
8368 |
|
8369 |
|
8370 |
|
8371 |
|
8372 |
|
8373 |
|
8374 |
|
8375 | function stringifyUUID$1(buf, offset) {
|
8376 | var i = offset || 0;
|
8377 | var bth = byteToHex$2;
|
8378 | return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]];
|
8379 | }
|
8380 |
|
8381 |
|
8382 |
|
8383 |
|
8384 |
|
8385 |
|
8386 |
|
8387 | var random$1 = function () {
|
8388 | if (typeof crypto !== 'undefined' && crypto.getRandomValues) {
|
8389 |
|
8390 |
|
8391 | var _rnds8 = new Uint8Array(16);
|
8392 |
|
8393 | return function whatwgRNG() {
|
8394 | crypto.getRandomValues(_rnds8);
|
8395 | return _rnds8;
|
8396 | };
|
8397 | }
|
8398 |
|
8399 |
|
8400 |
|
8401 |
|
8402 |
|
8403 | var _rnds = new Array(16);
|
8404 |
|
8405 | return function () {
|
8406 | for (var i = 0, r; i < 16; i++) {
|
8407 | if ((i & 0x03) === 0) {
|
8408 | r = Math.random() * 0x100000000;
|
8409 | }
|
8410 |
|
8411 | _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
|
8412 | }
|
8413 |
|
8414 | return _rnds;
|
8415 | };
|
8416 |
|
8417 |
|
8418 |
|
8419 |
|
8420 |
|
8421 |
|
8422 |
|
8423 | }();
|
8424 |
|
8425 | var byteToHex$1$1 = [];
|
8426 |
|
8427 | for (var i$1$1 = 0; i$1$1 < 256; i$1$1++) {
|
8428 | byteToHex$1$1[i$1$1] = (i$1$1 + 0x100).toString(16).substr(1);
|
8429 | }
|
8430 |
|
8431 |
|
8432 |
|
8433 |
|
8434 |
|
8435 |
|
8436 | var seedBytes$1 = random$1();
|
8437 |
|
8438 | var defaultNodeId$1 = [seedBytes$1[0] | 0x01, seedBytes$1[1], seedBytes$1[2], seedBytes$1[3], seedBytes$1[4], seedBytes$1[5]];
|
8439 |
|
8440 | var defaultClockseq$1 = (seedBytes$1[6] << 8 | seedBytes$1[7]) & 0x3fff;
|
8441 |
|
8442 |
|
8443 |
|
8444 |
|
8445 |
|
8446 |
|
8447 |
|
8448 |
|
8449 |
|
8450 |
|
8451 |
|
8452 |
|
8453 |
|
8454 |
|
8455 |
|
8456 |
|
8457 | function uuid4$1() {
|
8458 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
8459 | var buf = arguments.length > 1 ? arguments[1] : undefined;
|
8460 | var offset = arguments.length > 2 ? arguments[2] : undefined;
|
8461 |
|
8462 | var i = buf && offset || 0;
|
8463 |
|
8464 | if (typeof options === 'string') {
|
8465 | buf = options === 'binary' ? new Array(16) : undefined;
|
8466 | options = {};
|
8467 | }
|
8468 |
|
8469 | var rnds = options.random || (options.rng || random$1)();
|
8470 |
|
8471 | rnds[6] = rnds[6] & 0x0f | 0x40;
|
8472 | rnds[8] = rnds[8] & 0x3f | 0x80;
|
8473 |
|
8474 | if (buf) {
|
8475 | for (var ii = 0; ii < 16; ii++) {
|
8476 | buf[i + ii] = rnds[ii];
|
8477 | }
|
8478 | }
|
8479 |
|
8480 | return buf || stringifyUUID$1(rnds);
|
8481 | }
|
8482 |
|
8483 |
|
8484 | var commonjsGlobal$1$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
8485 |
|
8486 | function commonjsRequire$1() {
|
8487 | throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');
|
8488 | }
|
8489 |
|
8490 | function createCommonjsModule$1$1(fn, module) {
|
8491 | return module = {
|
8492 | exports: {}
|
8493 | }, fn(module, module.exports), module.exports;
|
8494 | }
|
8495 |
|
8496 | var check$1$1 = function (it) {
|
8497 | return it && it.Math == Math && it;
|
8498 | };
|
8499 |
|
8500 |
|
8501 | var global_1$1$1 =
|
8502 | check$1$1(typeof globalThis == 'object' && globalThis) || check$1$1(typeof window == 'object' && window) || check$1$1(typeof self == 'object' && self) || check$1$1(typeof commonjsGlobal$1$1 == 'object' && commonjsGlobal$1$1) ||
|
8503 | Function('return this')();
|
8504 |
|
8505 | var fails$1$1 = function (exec) {
|
8506 | try {
|
8507 | return !!exec();
|
8508 | } catch (error) {
|
8509 | return true;
|
8510 | }
|
8511 | };
|
8512 |
|
8513 |
|
8514 | var descriptors$1$1 = !fails$1$1(function () {
|
8515 | return Object.defineProperty({}, 'a', {
|
8516 | get: function () {
|
8517 | return 7;
|
8518 | }
|
8519 | }).a != 7;
|
8520 | });
|
8521 | var nativePropertyIsEnumerable$2$1 = {}.propertyIsEnumerable;
|
8522 | var getOwnPropertyDescriptor$4$1 = Object.getOwnPropertyDescriptor;
|
8523 |
|
8524 | var NASHORN_BUG$1$1 = getOwnPropertyDescriptor$4$1 && !nativePropertyIsEnumerable$2$1.call({
|
8525 | 1: 2
|
8526 | }, 1);
|
8527 |
|
8528 |
|
8529 | var f$7$1 = NASHORN_BUG$1$1 ? function propertyIsEnumerable(V) {
|
8530 | var descriptor = getOwnPropertyDescriptor$4$1(this, V);
|
8531 | return !!descriptor && descriptor.enumerable;
|
8532 | } : nativePropertyIsEnumerable$2$1;
|
8533 | var objectPropertyIsEnumerable$1$1 = {
|
8534 | f: f$7$1
|
8535 | };
|
8536 |
|
8537 | var createPropertyDescriptor$1$1 = function (bitmap, value) {
|
8538 | return {
|
8539 | enumerable: !(bitmap & 1),
|
8540 | configurable: !(bitmap & 2),
|
8541 | writable: !(bitmap & 4),
|
8542 | value: value
|
8543 | };
|
8544 | };
|
8545 |
|
8546 | var toString$2$1 = {}.toString;
|
8547 |
|
8548 | var classofRaw$1$1 = function (it) {
|
8549 | return toString$2$1.call(it).slice(8, -1);
|
8550 | };
|
8551 |
|
8552 | var split$1$1 = ''.split;
|
8553 |
|
8554 | var indexedObject$1$1 = fails$1$1(function () {
|
8555 |
|
8556 |
|
8557 | return !Object('z').propertyIsEnumerable(0);
|
8558 | }) ? function (it) {
|
8559 | return classofRaw$1$1(it) == 'String' ? split$1$1.call(it, '') : Object(it);
|
8560 | } : Object;
|
8561 |
|
8562 |
|
8563 | var requireObjectCoercible$1$1 = function (it) {
|
8564 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
8565 | return it;
|
8566 | };
|
8567 |
|
8568 |
|
8569 | var toIndexedObject$1$1 = function (it) {
|
8570 | return indexedObject$1$1(requireObjectCoercible$1$1(it));
|
8571 | };
|
8572 |
|
8573 | var isObject$1$1 = function (it) {
|
8574 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
8575 | };
|
8576 |
|
8577 |
|
8578 |
|
8579 |
|
8580 |
|
8581 | var toPrimitive$1$1 = function (input, PREFERRED_STRING) {
|
8582 | if (!isObject$1$1(input)) return input;
|
8583 | var fn, val;
|
8584 | if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject$1$1(val = fn.call(input))) return val;
|
8585 | if (typeof (fn = input.valueOf) == 'function' && !isObject$1$1(val = fn.call(input))) return val;
|
8586 | if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject$1$1(val = fn.call(input))) return val;
|
8587 | throw TypeError("Can't convert object to primitive value");
|
8588 | };
|
8589 |
|
8590 | var hasOwnProperty$1$1 = {}.hasOwnProperty;
|
8591 |
|
8592 | var has$2$1 = function (it, key) {
|
8593 | return hasOwnProperty$1$1.call(it, key);
|
8594 | };
|
8595 |
|
8596 | var document$1$1 = global_1$1$1.document;
|
8597 |
|
8598 | var EXISTS$1$1 = isObject$1$1(document$1$1) && isObject$1$1(document$1$1.createElement);
|
8599 |
|
8600 | var documentCreateElement$1$1 = function (it) {
|
8601 | return EXISTS$1$1 ? document$1$1.createElement(it) : {};
|
8602 | };
|
8603 |
|
8604 |
|
8605 | var ie8DomDefine$1$1 = !descriptors$1$1 && !fails$1$1(function () {
|
8606 | return Object.defineProperty(documentCreateElement$1$1('div'), 'a', {
|
8607 | get: function () {
|
8608 | return 7;
|
8609 | }
|
8610 | }).a != 7;
|
8611 | });
|
8612 | var nativeGetOwnPropertyDescriptor$3$1 = Object.getOwnPropertyDescriptor;
|
8613 |
|
8614 |
|
8615 | var f$1$1$1 = descriptors$1$1 ? nativeGetOwnPropertyDescriptor$3$1 : function getOwnPropertyDescriptor(O, P) {
|
8616 | O = toIndexedObject$1$1(O);
|
8617 | P = toPrimitive$1$1(P, true);
|
8618 | if (ie8DomDefine$1$1) try {
|
8619 | return nativeGetOwnPropertyDescriptor$3$1(O, P);
|
8620 | } catch (error) {
|
8621 |
|
8622 | }
|
8623 | if (has$2$1(O, P)) return createPropertyDescriptor$1$1(!objectPropertyIsEnumerable$1$1.f.call(O, P), O[P]);
|
8624 | };
|
8625 | var objectGetOwnPropertyDescriptor$1$1 = {
|
8626 | f: f$1$1$1
|
8627 | };
|
8628 | var replacement$1$1 = /#|\.prototype\./;
|
8629 |
|
8630 | var isForced$1$1 = function (feature, detection) {
|
8631 | var value = data$1$1[normalize$1$1(feature)];
|
8632 | return value == POLYFILL$1$1 ? true : value == NATIVE$1$1 ? false : typeof detection == 'function' ? fails$1$1(detection) : !!detection;
|
8633 | };
|
8634 |
|
8635 | var normalize$1$1 = isForced$1$1.normalize = function (string) {
|
8636 | return String(string).replace(replacement$1$1, '.').toLowerCase();
|
8637 | };
|
8638 |
|
8639 | var data$1$1 = isForced$1$1.data = {};
|
8640 | var NATIVE$1$1 = isForced$1$1.NATIVE = 'N';
|
8641 | var POLYFILL$1$1 = isForced$1$1.POLYFILL = 'P';
|
8642 | var isForced_1$1$1 = isForced$1$1;
|
8643 | var path$1$1 = {};
|
8644 |
|
8645 | var aFunction$2$1 = function (it) {
|
8646 | if (typeof it != 'function') {
|
8647 | throw TypeError(String(it) + ' is not a function');
|
8648 | }
|
8649 |
|
8650 | return it;
|
8651 | };
|
8652 |
|
8653 |
|
8654 | var bindContext$1$1 = function (fn, that, length) {
|
8655 | aFunction$2$1(fn);
|
8656 | if (that === undefined) return fn;
|
8657 |
|
8658 | switch (length) {
|
8659 | case 0:
|
8660 | return function () {
|
8661 | return fn.call(that);
|
8662 | };
|
8663 |
|
8664 | case 1:
|
8665 | return function (a) {
|
8666 | return fn.call(that, a);
|
8667 | };
|
8668 |
|
8669 | case 2:
|
8670 | return function (a, b) {
|
8671 | return fn.call(that, a, b);
|
8672 | };
|
8673 |
|
8674 | case 3:
|
8675 | return function (a, b, c) {
|
8676 | return fn.call(that, a, b, c);
|
8677 | };
|
8678 | }
|
8679 |
|
8680 | return function ()
|
8681 | /* ...args */
|
8682 | {
|
8683 | return fn.apply(that, arguments);
|
8684 | };
|
8685 | };
|
8686 |
|
8687 | var anObject$1$1 = function (it) {
|
8688 | if (!isObject$1$1(it)) {
|
8689 | throw TypeError(String(it) + ' is not an object');
|
8690 | }
|
8691 |
|
8692 | return it;
|
8693 | };
|
8694 |
|
8695 | var nativeDefineProperty$2$1 = Object.defineProperty;
|
8696 |
|
8697 |
|
8698 | var f$2$1$1 = descriptors$1$1 ? nativeDefineProperty$2$1 : function defineProperty(O, P, Attributes) {
|
8699 | anObject$1$1(O);
|
8700 | P = toPrimitive$1$1(P, true);
|
8701 | anObject$1$1(Attributes);
|
8702 | if (ie8DomDefine$1$1) try {
|
8703 | return nativeDefineProperty$2$1(O, P, Attributes);
|
8704 | } catch (error) {
|
8705 |
|
8706 | }
|
8707 | if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
8708 | if ('value' in Attributes) O[P] = Attributes.value;
|
8709 | return O;
|
8710 | };
|
8711 | var objectDefineProperty$1$1 = {
|
8712 | f: f$2$1$1
|
8713 | };
|
8714 | var createNonEnumerableProperty$1$1 = descriptors$1$1 ? function (object, key, value) {
|
8715 | return objectDefineProperty$1$1.f(object, key, createPropertyDescriptor$1$1(1, value));
|
8716 | } : function (object, key, value) {
|
8717 | object[key] = value;
|
8718 | return object;
|
8719 | };
|
8720 | var getOwnPropertyDescriptor$1$1$1 = objectGetOwnPropertyDescriptor$1$1.f;
|
8721 |
|
8722 | var wrapConstructor$1$1 = function (NativeConstructor) {
|
8723 | var Wrapper = function (a, b, c) {
|
8724 | if (this instanceof NativeConstructor) {
|
8725 | switch (arguments.length) {
|
8726 | case 0:
|
8727 | return new NativeConstructor();
|
8728 |
|
8729 | case 1:
|
8730 | return new NativeConstructor(a);
|
8731 |
|
8732 | case 2:
|
8733 | return new NativeConstructor(a, b);
|
8734 | }
|
8735 |
|
8736 | return new NativeConstructor(a, b, c);
|
8737 | }
|
8738 |
|
8739 | return NativeConstructor.apply(this, arguments);
|
8740 | };
|
8741 |
|
8742 | Wrapper.prototype = NativeConstructor.prototype;
|
8743 | return Wrapper;
|
8744 | };
|
8745 |
|
8746 |
|
8747 |
|
8748 |
|
8749 |
|
8750 |
|
8751 |
|
8752 |
|
8753 |
|
8754 |
|
8755 |
|
8756 |
|
8757 |
|
8758 |
|
8759 |
|
8760 |
|
8761 | var _export$1$1 = function (options, source) {
|
8762 | var TARGET = options.target;
|
8763 | var GLOBAL = options.global;
|
8764 | var STATIC = options.stat;
|
8765 | var PROTO = options.proto;
|
8766 | var nativeSource = GLOBAL ? global_1$1$1 : STATIC ? global_1$1$1[TARGET] : (global_1$1$1[TARGET] || {}).prototype;
|
8767 | var target = GLOBAL ? path$1$1 : path$1$1[TARGET] || (path$1$1[TARGET] = {});
|
8768 | var targetPrototype = target.prototype;
|
8769 | var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
|
8770 | var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
|
8771 |
|
8772 | for (key in source) {
|
8773 | FORCED = isForced_1$1$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
8774 |
|
8775 | USE_NATIVE = !FORCED && nativeSource && has$2$1(nativeSource, key);
|
8776 | targetProperty = target[key];
|
8777 | if (USE_NATIVE) if (options.noTargetGet) {
|
8778 | descriptor = getOwnPropertyDescriptor$1$1$1(nativeSource, key);
|
8779 | nativeProperty = descriptor && descriptor.value;
|
8780 | } else nativeProperty = nativeSource[key];
|
8781 |
|
8782 | sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key];
|
8783 | if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue;
|
8784 |
|
8785 | if (options.bind && USE_NATIVE) resultProperty = bindContext$1$1(sourceProperty, global_1$1$1);
|
8786 | else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor$1$1(sourceProperty);
|
8787 | else if (PROTO && typeof sourceProperty == 'function') resultProperty = bindContext$1$1(Function.call, sourceProperty);
|
8788 | else resultProperty = sourceProperty;
|
8789 |
|
8790 | if (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) {
|
8791 | createNonEnumerableProperty$1$1(resultProperty, 'sham', true);
|
8792 | }
|
8793 |
|
8794 | target[key] = resultProperty;
|
8795 |
|
8796 | if (PROTO) {
|
8797 | VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
|
8798 |
|
8799 | if (!has$2$1(path$1$1, VIRTUAL_PROTOTYPE)) {
|
8800 | createNonEnumerableProperty$1$1(path$1$1, VIRTUAL_PROTOTYPE, {});
|
8801 | }
|
8802 |
|
8803 |
|
8804 | path$1$1[VIRTUAL_PROTOTYPE][key] = sourceProperty;
|
8805 |
|
8806 | if (options.real && targetPrototype && !targetPrototype[key]) {
|
8807 | createNonEnumerableProperty$1$1(targetPrototype, key, sourceProperty);
|
8808 | }
|
8809 | }
|
8810 | }
|
8811 | };
|
8812 |
|
8813 |
|
8814 |
|
8815 | _export$1$1({
|
8816 | target: 'Object',
|
8817 | stat: true,
|
8818 | forced: !descriptors$1$1,
|
8819 | sham: !descriptors$1$1
|
8820 | }, {
|
8821 | defineProperty: objectDefineProperty$1$1.f
|
8822 | });
|
8823 |
|
8824 | var defineProperty_1$1$1 = createCommonjsModule$1$1(function (module) {
|
8825 | var Object = path$1$1.Object;
|
8826 |
|
8827 | var defineProperty = module.exports = function defineProperty(it, key, desc) {
|
8828 | return Object.defineProperty(it, key, desc);
|
8829 | };
|
8830 |
|
8831 | if (Object.defineProperty.sham) defineProperty.sham = true;
|
8832 | });
|
8833 | var ceil$1$1 = Math.ceil;
|
8834 | var floor$1$1 = Math.floor;
|
8835 |
|
8836 |
|
8837 | var toInteger$1$1 = function (argument) {
|
8838 | return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor$1$1 : ceil$1$1)(argument);
|
8839 | };
|
8840 |
|
8841 | var min$2$1 = Math.min;
|
8842 |
|
8843 |
|
8844 | var toLength$1$1 = function (argument) {
|
8845 | return argument > 0 ? min$2$1(toInteger$1$1(argument), 0x1FFFFFFFFFFFFF) : 0;
|
8846 | };
|
8847 |
|
8848 | var max$1$1 = Math.max;
|
8849 | var min$1$1$1 = Math.min;
|
8850 |
|
8851 |
|
8852 |
|
8853 | var toAbsoluteIndex$1$1 = function (index, length) {
|
8854 | var integer = toInteger$1$1(index);
|
8855 | return integer < 0 ? max$1$1(integer + length, 0) : min$1$1$1(integer, length);
|
8856 | };
|
8857 |
|
8858 |
|
8859 | var createMethod$4$1 = function (IS_INCLUDES) {
|
8860 | return function ($this, el, fromIndex) {
|
8861 | var O = toIndexedObject$1$1($this);
|
8862 | var length = toLength$1$1(O.length);
|
8863 | var index = toAbsoluteIndex$1$1(fromIndex, length);
|
8864 | var value;
|
8865 |
|
8866 |
|
8867 | if (IS_INCLUDES && el != el) while (length > index) {
|
8868 | value = O[index++];
|
8869 |
|
8870 | if (value != value) return true;
|
8871 | } else for (; length > index; index++) {
|
8872 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
8873 | }
|
8874 | return !IS_INCLUDES && -1;
|
8875 | };
|
8876 | };
|
8877 |
|
8878 | var arrayIncludes$1$1 = {
|
8879 |
|
8880 |
|
8881 | includes: createMethod$4$1(true),
|
8882 |
|
8883 |
|
8884 | indexOf: createMethod$4$1(false)
|
8885 | };
|
8886 | var hiddenKeys$2$1 = {};
|
8887 | var indexOf$1$1 = arrayIncludes$1$1.indexOf;
|
8888 |
|
8889 | var objectKeysInternal$1$1 = function (object, names) {
|
8890 | var O = toIndexedObject$1$1(object);
|
8891 | var i = 0;
|
8892 | var result = [];
|
8893 | var key;
|
8894 |
|
8895 | for (key in O) !has$2$1(hiddenKeys$2$1, key) && has$2$1(O, key) && result.push(key);
|
8896 |
|
8897 |
|
8898 | while (names.length > i) if (has$2$1(O, key = names[i++])) {
|
8899 | ~indexOf$1$1(result, key) || result.push(key);
|
8900 | }
|
8901 |
|
8902 | return result;
|
8903 | };
|
8904 |
|
8905 |
|
8906 | var enumBugKeys$1$1 = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
|
8907 |
|
8908 |
|
8909 | var objectKeys$1$1 = Object.keys || function keys(O) {
|
8910 | return objectKeysInternal$1$1(O, enumBugKeys$1$1);
|
8911 | };
|
8912 |
|
8913 |
|
8914 |
|
8915 | var objectDefineProperties$1$1 = descriptors$1$1 ? Object.defineProperties : function defineProperties(O, Properties) {
|
8916 | anObject$1$1(O);
|
8917 | var keys = objectKeys$1$1(Properties);
|
8918 | var length = keys.length;
|
8919 | var index = 0;
|
8920 | var key;
|
8921 |
|
8922 | while (length > index) objectDefineProperty$1$1.f(O, key = keys[index++], Properties[key]);
|
8923 |
|
8924 | return O;
|
8925 | };
|
8926 |
|
8927 |
|
8928 | _export$1$1({
|
8929 | target: 'Object',
|
8930 | stat: true,
|
8931 | forced: !descriptors$1$1,
|
8932 | sham: !descriptors$1$1
|
8933 | }, {
|
8934 | defineProperties: objectDefineProperties$1$1
|
8935 | });
|
8936 |
|
8937 | var defineProperties_1$1$1 = createCommonjsModule$1$1(function (module) {
|
8938 | var Object = path$1$1.Object;
|
8939 |
|
8940 | var defineProperties = module.exports = function defineProperties(T, D) {
|
8941 | return Object.defineProperties(T, D);
|
8942 | };
|
8943 |
|
8944 | if (Object.defineProperties.sham) defineProperties.sham = true;
|
8945 | });
|
8946 |
|
8947 | var aFunction$1$1$1 = function (variable) {
|
8948 | return typeof variable == 'function' ? variable : undefined;
|
8949 | };
|
8950 |
|
8951 | var getBuiltIn$1$1 = function (namespace, method) {
|
8952 | return arguments.length < 2 ? aFunction$1$1$1(path$1$1[namespace]) || aFunction$1$1$1(global_1$1$1[namespace]) : path$1$1[namespace] && path$1$1[namespace][method] || global_1$1$1[namespace] && global_1$1$1[namespace][method];
|
8953 | };
|
8954 |
|
8955 | var hiddenKeys$1$1$1 = enumBugKeys$1$1.concat('length', 'prototype');
|
8956 |
|
8957 |
|
8958 | var f$3$1$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
8959 | return objectKeysInternal$1$1(O, hiddenKeys$1$1$1);
|
8960 | };
|
8961 |
|
8962 | var objectGetOwnPropertyNames$1$1 = {
|
8963 | f: f$3$1$1
|
8964 | };
|
8965 | var f$4$1$1 = Object.getOwnPropertySymbols;
|
8966 | var objectGetOwnPropertySymbols$1$1 = {
|
8967 | f: f$4$1$1
|
8968 | };
|
8969 |
|
8970 | var ownKeys$1$1 = getBuiltIn$1$1('Reflect', 'ownKeys') || function ownKeys(it) {
|
8971 | var keys = objectGetOwnPropertyNames$1$1.f(anObject$1$1(it));
|
8972 | var getOwnPropertySymbols = objectGetOwnPropertySymbols$1$1.f;
|
8973 | return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
8974 | };
|
8975 |
|
8976 | var createProperty$1$1 = function (object, key, value) {
|
8977 | var propertyKey = toPrimitive$1$1(key);
|
8978 | if (propertyKey in object) objectDefineProperty$1$1.f(object, propertyKey, createPropertyDescriptor$1$1(0, value));else object[propertyKey] = value;
|
8979 | };
|
8980 |
|
8981 |
|
8982 |
|
8983 | _export$1$1({
|
8984 | target: 'Object',
|
8985 | stat: true,
|
8986 | sham: !descriptors$1$1
|
8987 | }, {
|
8988 | getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
|
8989 | var O = toIndexedObject$1$1(object);
|
8990 | var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor$1$1.f;
|
8991 | var keys = ownKeys$1$1(O);
|
8992 | var result = {};
|
8993 | var index = 0;
|
8994 | var key, descriptor;
|
8995 |
|
8996 | while (keys.length > index) {
|
8997 | descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
|
8998 | if (descriptor !== undefined) createProperty$1$1(result, key, descriptor);
|
8999 | }
|
9000 |
|
9001 | return result;
|
9002 | }
|
9003 | });
|
9004 |
|
9005 | var getOwnPropertyDescriptors$3$1 = path$1$1.Object.getOwnPropertyDescriptors;
|
9006 | var nativeGetOwnPropertyDescriptor$1$1$1 = objectGetOwnPropertyDescriptor$1$1.f;
|
9007 | var FAILS_ON_PRIMITIVES$3$1 = fails$1$1(function () {
|
9008 | nativeGetOwnPropertyDescriptor$1$1$1(1);
|
9009 | });
|
9010 | var FORCED$4 = !descriptors$1$1 || FAILS_ON_PRIMITIVES$3$1;
|
9011 |
|
9012 |
|
9013 | _export$1$1({
|
9014 | target: 'Object',
|
9015 | stat: true,
|
9016 | forced: FORCED$4,
|
9017 | sham: !descriptors$1$1
|
9018 | }, {
|
9019 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
|
9020 | return nativeGetOwnPropertyDescriptor$1$1$1(toIndexedObject$1$1(it), key);
|
9021 | }
|
9022 | });
|
9023 |
|
9024 | var getOwnPropertyDescriptor_1$1$1 = createCommonjsModule$1$1(function (module) {
|
9025 | var Object = path$1$1.Object;
|
9026 |
|
9027 | var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
|
9028 | return Object.getOwnPropertyDescriptor(it, key);
|
9029 | };
|
9030 |
|
9031 | if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
|
9032 | });
|
9033 | var nativeSymbol$1$1 = !!Object.getOwnPropertySymbols && !fails$1$1(function () {
|
9034 |
|
9035 |
|
9036 | return !String(Symbol());
|
9037 | });
|
9038 |
|
9039 |
|
9040 | var isArray$6$1 = Array.isArray || function isArray(arg) {
|
9041 | return classofRaw$1$1(arg) == 'Array';
|
9042 | };
|
9043 |
|
9044 |
|
9045 |
|
9046 | var toObject$1$1 = function (argument) {
|
9047 | return Object(requireObjectCoercible$1$1(argument));
|
9048 | };
|
9049 |
|
9050 | var html$1$1 = getBuiltIn$1$1('document', 'documentElement');
|
9051 |
|
9052 | var setGlobal$1$1 = function (key, value) {
|
9053 | try {
|
9054 | createNonEnumerableProperty$1$1(global_1$1$1, key, value);
|
9055 | } catch (error) {
|
9056 | global_1$1$1[key] = value;
|
9057 | }
|
9058 |
|
9059 | return value;
|
9060 | };
|
9061 |
|
9062 | var SHARED$1$1 = '__core-js_shared__';
|
9063 | var store$3$1 = global_1$1$1[SHARED$1$1] || setGlobal$1$1(SHARED$1$1, {});
|
9064 | var sharedStore$1$1 = store$3$1;
|
9065 | var shared$1$1 = createCommonjsModule$1$1(function (module) {
|
9066 | (module.exports = function (key, value) {
|
9067 | return sharedStore$1$1[key] || (sharedStore$1$1[key] = value !== undefined ? value : {});
|
9068 | })('versions', []).push({
|
9069 | version: '3.4.1',
|
9070 | mode: 'pure',
|
9071 | copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
9072 | });
|
9073 | });
|
9074 | var id$1$1 = 0;
|
9075 | var postfix$1$1 = Math.random();
|
9076 |
|
9077 | var uid$1$1 = function (key) {
|
9078 | return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id$1$1 + postfix$1$1).toString(36);
|
9079 | };
|
9080 |
|
9081 | var keys$7 = shared$1$1('keys');
|
9082 |
|
9083 | var sharedKey$1$1 = function (key) {
|
9084 | return keys$7[key] || (keys$7[key] = uid$1$1(key));
|
9085 | };
|
9086 |
|
9087 | var IE_PROTO$2$1 = sharedKey$1$1('IE_PROTO');
|
9088 | var PROTOTYPE$2$1 = 'prototype';
|
9089 |
|
9090 | var Empty$1$1 = function () {
|
9091 |
|
9092 | };
|
9093 |
|
9094 |
|
9095 | var createDict$1$1 = function () {
|
9096 |
|
9097 | var iframe = documentCreateElement$1$1('iframe');
|
9098 | var length = enumBugKeys$1$1.length;
|
9099 | var lt = '<';
|
9100 | var script = 'script';
|
9101 | var gt = '>';
|
9102 | var js = 'java' + script + ':';
|
9103 | var iframeDocument;
|
9104 | iframe.style.display = 'none';
|
9105 | html$1$1.appendChild(iframe);
|
9106 | iframe.src = String(js);
|
9107 | iframeDocument = iframe.contentWindow.document;
|
9108 | iframeDocument.open();
|
9109 | iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
|
9110 | iframeDocument.close();
|
9111 | createDict$1$1 = iframeDocument.F;
|
9112 |
|
9113 | while (length--) delete createDict$1$1[PROTOTYPE$2$1][enumBugKeys$1$1[length]];
|
9114 |
|
9115 | return createDict$1$1();
|
9116 | };
|
9117 |
|
9118 |
|
9119 |
|
9120 | var objectCreate$1$1 = Object.create || function create(O, Properties) {
|
9121 | var result;
|
9122 |
|
9123 | if (O !== null) {
|
9124 | Empty$1$1[PROTOTYPE$2$1] = anObject$1$1(O);
|
9125 | result = new Empty$1$1();
|
9126 | Empty$1$1[PROTOTYPE$2$1] = null;
|
9127 |
|
9128 | result[IE_PROTO$2$1] = O;
|
9129 | } else result = createDict$1$1();
|
9130 |
|
9131 | return Properties === undefined ? result : objectDefineProperties$1$1(result, Properties);
|
9132 | };
|
9133 |
|
9134 | hiddenKeys$2$1[IE_PROTO$2$1] = true;
|
9135 | var nativeGetOwnPropertyNames$2$1 = objectGetOwnPropertyNames$1$1.f;
|
9136 | var toString$1$1$1 = {}.toString;
|
9137 | var windowNames$1$1 = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
|
9138 |
|
9139 | var getWindowNames$1$1 = function (it) {
|
9140 | try {
|
9141 | return nativeGetOwnPropertyNames$2$1(it);
|
9142 | } catch (error) {
|
9143 | return windowNames$1$1.slice();
|
9144 | }
|
9145 | };
|
9146 |
|
9147 |
|
9148 | var f$5$1$1 = function getOwnPropertyNames(it) {
|
9149 | return windowNames$1$1 && toString$1$1$1.call(it) == '[object Window]' ? getWindowNames$1$1(it) : nativeGetOwnPropertyNames$2$1(toIndexedObject$1$1(it));
|
9150 | };
|
9151 |
|
9152 | var objectGetOwnPropertyNamesExternal$1$1 = {
|
9153 | f: f$5$1$1
|
9154 | };
|
9155 |
|
9156 | var redefine$1$1 = function (target, key, value, options) {
|
9157 | if (options && options.enumerable) target[key] = value;else createNonEnumerableProperty$1$1(target, key, value);
|
9158 | };
|
9159 |
|
9160 | var Symbol$1$1$1 = global_1$1$1.Symbol;
|
9161 | var store$1$1$1 = shared$1$1('wks');
|
9162 |
|
9163 | var wellKnownSymbol$1$1 = function (name) {
|
9164 | return store$1$1$1[name] || (store$1$1$1[name] = nativeSymbol$1$1 && Symbol$1$1$1[name] || (nativeSymbol$1$1 ? Symbol$1$1$1 : uid$1$1)('Symbol.' + name));
|
9165 | };
|
9166 |
|
9167 | var f$6$1$1 = wellKnownSymbol$1$1;
|
9168 | var wrappedWellKnownSymbol$1$1 = {
|
9169 | f: f$6$1$1
|
9170 | };
|
9171 | var defineProperty$2$1$1 = objectDefineProperty$1$1.f;
|
9172 |
|
9173 | var defineWellKnownSymbol$1$1 = function (NAME) {
|
9174 | var Symbol = path$1$1.Symbol || (path$1$1.Symbol = {});
|
9175 | if (!has$2$1(Symbol, NAME)) defineProperty$2$1$1(Symbol, NAME, {
|
9176 | value: wrappedWellKnownSymbol$1$1.f(NAME)
|
9177 | });
|
9178 | };
|
9179 |
|
9180 | var TO_STRING_TAG$4$1 = wellKnownSymbol$1$1('toStringTag');
|
9181 |
|
9182 | var CORRECT_ARGUMENTS$1$1 = classofRaw$1$1(function () {
|
9183 | return arguments;
|
9184 | }()) == 'Arguments';
|
9185 |
|
9186 | var tryGet$1$1 = function (it, key) {
|
9187 | try {
|
9188 | return it[key];
|
9189 | } catch (error) {
|
9190 |
|
9191 | }
|
9192 | };
|
9193 |
|
9194 |
|
9195 | var classof$1$1 = function (it) {
|
9196 | var O, tag, result;
|
9197 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
9198 | : typeof (tag = tryGet$1$1(O = Object(it), TO_STRING_TAG$4$1)) == 'string' ? tag
|
9199 | : CORRECT_ARGUMENTS$1$1 ? classofRaw$1$1(O)
|
9200 | : (result = classofRaw$1$1(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
|
9201 | };
|
9202 |
|
9203 | var TO_STRING_TAG$1$1$1 = wellKnownSymbol$1$1('toStringTag');
|
9204 | var test$2 = {};
|
9205 | test$2[TO_STRING_TAG$1$1$1] = 'z';
|
9206 |
|
9207 |
|
9208 | var objectToString$1$1 = String(test$2) !== '[object z]' ? function toString() {
|
9209 | return '[object ' + classof$1$1(this) + ']';
|
9210 | } : test$2.toString;
|
9211 | var defineProperty$3$1$1 = objectDefineProperty$1$1.f;
|
9212 | var TO_STRING_TAG$2$1$1 = wellKnownSymbol$1$1('toStringTag');
|
9213 | var METHOD_REQUIRED$1$1 = objectToString$1$1 !== {}.toString;
|
9214 |
|
9215 | var setToStringTag$1$1 = function (it, TAG, STATIC, SET_METHOD) {
|
9216 | if (it) {
|
9217 | var target = STATIC ? it : it.prototype;
|
9218 |
|
9219 | if (!has$2$1(target, TO_STRING_TAG$2$1$1)) {
|
9220 | defineProperty$3$1$1(target, TO_STRING_TAG$2$1$1, {
|
9221 | configurable: true,
|
9222 | value: TAG
|
9223 | });
|
9224 | }
|
9225 |
|
9226 | if (SET_METHOD && METHOD_REQUIRED$1$1) {
|
9227 | createNonEnumerableProperty$1$1(target, 'toString', objectToString$1$1);
|
9228 | }
|
9229 | }
|
9230 | };
|
9231 |
|
9232 | var functionToString$1$1 = shared$1$1('native-function-to-string', Function.toString);
|
9233 | var WeakMap$2$1 = global_1$1$1.WeakMap;
|
9234 | var nativeWeakMap$1$1 = typeof WeakMap$2$1 === 'function' && /native code/.test(functionToString$1$1.call(WeakMap$2$1));
|
9235 | var WeakMap$1$1$1 = global_1$1$1.WeakMap;
|
9236 | var set$1$1, get$1$1, has$1$1$1;
|
9237 |
|
9238 | var enforce$1$1 = function (it) {
|
9239 | return has$1$1$1(it) ? get$1$1(it) : set$1$1(it, {});
|
9240 | };
|
9241 |
|
9242 | var getterFor$1$1 = function (TYPE) {
|
9243 | return function (it) {
|
9244 | var state;
|
9245 |
|
9246 | if (!isObject$1$1(it) || (state = get$1$1(it)).type !== TYPE) {
|
9247 | throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
9248 | }
|
9249 |
|
9250 | return state;
|
9251 | };
|
9252 | };
|
9253 |
|
9254 | if (nativeWeakMap$1$1) {
|
9255 | var store$2$1$1 = new WeakMap$1$1$1();
|
9256 | var wmget$1$1 = store$2$1$1.get;
|
9257 | var wmhas$1$1 = store$2$1$1.has;
|
9258 | var wmset$1$1 = store$2$1$1.set;
|
9259 |
|
9260 | set$1$1 = function (it, metadata) {
|
9261 | wmset$1$1.call(store$2$1$1, it, metadata);
|
9262 | return metadata;
|
9263 | };
|
9264 |
|
9265 | get$1$1 = function (it) {
|
9266 | return wmget$1$1.call(store$2$1$1, it) || {};
|
9267 | };
|
9268 |
|
9269 | has$1$1$1 = function (it) {
|
9270 | return wmhas$1$1.call(store$2$1$1, it);
|
9271 | };
|
9272 | } else {
|
9273 | var STATE$1$1 = sharedKey$1$1('state');
|
9274 | hiddenKeys$2$1[STATE$1$1] = true;
|
9275 |
|
9276 | set$1$1 = function (it, metadata) {
|
9277 | createNonEnumerableProperty$1$1(it, STATE$1$1, metadata);
|
9278 | return metadata;
|
9279 | };
|
9280 |
|
9281 | get$1$1 = function (it) {
|
9282 | return has$2$1(it, STATE$1$1) ? it[STATE$1$1] : {};
|
9283 | };
|
9284 |
|
9285 | has$1$1$1 = function (it) {
|
9286 | return has$2$1(it, STATE$1$1);
|
9287 | };
|
9288 | }
|
9289 |
|
9290 | var internalState$1$1 = {
|
9291 | set: set$1$1,
|
9292 | get: get$1$1,
|
9293 | has: has$1$1$1,
|
9294 | enforce: enforce$1$1,
|
9295 | getterFor: getterFor$1$1
|
9296 | };
|
9297 | var SPECIES$3$1 = wellKnownSymbol$1$1('species'); // `ArraySpeciesCreate` abstract operation
|
9298 | // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
|
9299 |
|
9300 | var arraySpeciesCreate$1$1 = function (originalArray, length) {
|
9301 | var C;
|
9302 |
|
9303 | if (isArray$6$1(originalArray)) {
|
9304 | C = originalArray.constructor;
|
9305 |
|
9306 | if (typeof C == 'function' && (C === Array || isArray$6$1(C.prototype))) C = undefined;else if (isObject$1$1(C)) {
|
9307 | C = C[SPECIES$3$1];
|
9308 | if (C === null) C = undefined;
|
9309 | }
|
9310 | }
|
9311 |
|
9312 | return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
9313 | };
|
9314 |
|
9315 | var push$1$1 = [].push;
|
9316 |
|
9317 | var createMethod$1$1$1 = function (TYPE) {
|
9318 | var IS_MAP = TYPE == 1;
|
9319 | var IS_FILTER = TYPE == 2;
|
9320 | var IS_SOME = TYPE == 3;
|
9321 | var IS_EVERY = TYPE == 4;
|
9322 | var IS_FIND_INDEX = TYPE == 6;
|
9323 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
9324 | return function ($this, callbackfn, that, specificCreate) {
|
9325 | var O = toObject$1$1($this);
|
9326 | var self = indexedObject$1$1(O);
|
9327 | var boundFunction = bindContext$1$1(callbackfn, that, 3);
|
9328 | var length = toLength$1$1(self.length);
|
9329 | var index = 0;
|
9330 | var create = specificCreate || arraySpeciesCreate$1$1;
|
9331 | var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
|
9332 | var value, result;
|
9333 |
|
9334 | for (; length > index; index++) if (NO_HOLES || index in self) {
|
9335 | value = self[index];
|
9336 | result = boundFunction(value, index, O);
|
9337 |
|
9338 | if (TYPE) {
|
9339 | if (IS_MAP) target[index] = result;
|
9340 | else if (result) switch (TYPE) {
|
9341 | case 3:
|
9342 | return true;
|
9343 |
|
9344 |
|
9345 | case 5:
|
9346 | return value;
|
9347 |
|
9348 |
|
9349 | case 6:
|
9350 | return index;
|
9351 |
|
9352 |
|
9353 | case 2:
|
9354 | push$1$1.call(target, value);
|
9355 |
|
9356 | } else if (IS_EVERY) return false;
|
9357 | }
|
9358 | }
|
9359 |
|
9360 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
9361 | };
|
9362 | };
|
9363 |
|
9364 | var arrayIteration$1$1 = {
|
9365 |
|
9366 |
|
9367 | forEach: createMethod$1$1$1(0),
|
9368 |
|
9369 |
|
9370 | map: createMethod$1$1$1(1),
|
9371 |
|
9372 |
|
9373 | filter: createMethod$1$1$1(2),
|
9374 |
|
9375 |
|
9376 | some: createMethod$1$1$1(3),
|
9377 |
|
9378 |
|
9379 | every: createMethod$1$1$1(4),
|
9380 |
|
9381 |
|
9382 | find: createMethod$1$1$1(5),
|
9383 |
|
9384 |
|
9385 | findIndex: createMethod$1$1$1(6)
|
9386 | };
|
9387 | var $forEach$2$1 = arrayIteration$1$1.forEach;
|
9388 | var HIDDEN$1$1 = sharedKey$1$1('hidden');
|
9389 | var SYMBOL$1$1 = 'Symbol';
|
9390 | var PROTOTYPE$1$1$1 = 'prototype';
|
9391 | var TO_PRIMITIVE$1$1 = wellKnownSymbol$1$1('toPrimitive');
|
9392 | var setInternalState$5 = internalState$1$1.set;
|
9393 | var getInternalState$3$1 = internalState$1$1.getterFor(SYMBOL$1$1);
|
9394 | var ObjectPrototype$2$1 = Object[PROTOTYPE$1$1$1];
|
9395 | var $Symbol$1$1 = global_1$1$1.Symbol;
|
9396 | var $stringify$2 = getBuiltIn$1$1('JSON', 'stringify');
|
9397 | var nativeGetOwnPropertyDescriptor$2$1$1 = objectGetOwnPropertyDescriptor$1$1.f;
|
9398 | var nativeDefineProperty$1$1$1 = objectDefineProperty$1$1.f;
|
9399 | var nativeGetOwnPropertyNames$1$1$1 = objectGetOwnPropertyNamesExternal$1$1.f;
|
9400 | var nativePropertyIsEnumerable$1$1$1 = objectPropertyIsEnumerable$1$1.f;
|
9401 | var AllSymbols$1$1 = shared$1$1('symbols');
|
9402 | var ObjectPrototypeSymbols$1$1 = shared$1$1('op-symbols');
|
9403 | var StringToSymbolRegistry$1$1 = shared$1$1('string-to-symbol-registry');
|
9404 | var SymbolToStringRegistry$1$1 = shared$1$1('symbol-to-string-registry');
|
9405 | var WellKnownSymbolsStore$1$1 = shared$1$1('wks');
|
9406 | var QObject$1$1 = global_1$1$1.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
|
9407 |
|
9408 | var USE_SETTER$1$1 = !QObject$1$1 || !QObject$1$1[PROTOTYPE$1$1$1] || !QObject$1$1[PROTOTYPE$1$1$1].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
|
9409 |
|
9410 | var setSymbolDescriptor$1$1 = descriptors$1$1 && fails$1$1(function () {
|
9411 | return objectCreate$1$1(nativeDefineProperty$1$1$1({}, 'a', {
|
9412 | get: function () {
|
9413 | return nativeDefineProperty$1$1$1(this, 'a', {
|
9414 | value: 7
|
9415 | }).a;
|
9416 | }
|
9417 | })).a != 7;
|
9418 | }) ? function (O, P, Attributes) {
|
9419 | var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$2$1$1(ObjectPrototype$2$1, P);
|
9420 | if (ObjectPrototypeDescriptor) delete ObjectPrototype$2$1[P];
|
9421 | nativeDefineProperty$1$1$1(O, P, Attributes);
|
9422 |
|
9423 | if (ObjectPrototypeDescriptor && O !== ObjectPrototype$2$1) {
|
9424 | nativeDefineProperty$1$1$1(ObjectPrototype$2$1, P, ObjectPrototypeDescriptor);
|
9425 | }
|
9426 | } : nativeDefineProperty$1$1$1;
|
9427 |
|
9428 | var wrap$1$1 = function (tag, description) {
|
9429 | var symbol = AllSymbols$1$1[tag] = objectCreate$1$1($Symbol$1$1[PROTOTYPE$1$1$1]);
|
9430 | setInternalState$5(symbol, {
|
9431 | type: SYMBOL$1$1,
|
9432 | tag: tag,
|
9433 | description: description
|
9434 | });
|
9435 | if (!descriptors$1$1) symbol.description = description;
|
9436 | return symbol;
|
9437 | };
|
9438 |
|
9439 | var isSymbol$1$1 = nativeSymbol$1$1 && typeof $Symbol$1$1.iterator == 'symbol' ? function (it) {
|
9440 | return typeof it == 'symbol';
|
9441 | } : function (it) {
|
9442 | return Object(it) instanceof $Symbol$1$1;
|
9443 | };
|
9444 |
|
9445 | var $defineProperty$1$1 = function defineProperty(O, P, Attributes) {
|
9446 | if (O === ObjectPrototype$2$1) $defineProperty$1$1(ObjectPrototypeSymbols$1$1, P, Attributes);
|
9447 | anObject$1$1(O);
|
9448 | var key = toPrimitive$1$1(P, true);
|
9449 | anObject$1$1(Attributes);
|
9450 |
|
9451 | if (has$2$1(AllSymbols$1$1, key)) {
|
9452 | if (!Attributes.enumerable) {
|
9453 | if (!has$2$1(O, HIDDEN$1$1)) nativeDefineProperty$1$1$1(O, HIDDEN$1$1, createPropertyDescriptor$1$1(1, {}));
|
9454 | O[HIDDEN$1$1][key] = true;
|
9455 | } else {
|
9456 | if (has$2$1(O, HIDDEN$1$1) && O[HIDDEN$1$1][key]) O[HIDDEN$1$1][key] = false;
|
9457 | Attributes = objectCreate$1$1(Attributes, {
|
9458 | enumerable: createPropertyDescriptor$1$1(0, false)
|
9459 | });
|
9460 | }
|
9461 |
|
9462 | return setSymbolDescriptor$1$1(O, key, Attributes);
|
9463 | }
|
9464 |
|
9465 | return nativeDefineProperty$1$1$1(O, key, Attributes);
|
9466 | };
|
9467 |
|
9468 | var $defineProperties$1$1 = function defineProperties(O, Properties) {
|
9469 | anObject$1$1(O);
|
9470 | var properties = toIndexedObject$1$1(Properties);
|
9471 | var keys = objectKeys$1$1(properties).concat($getOwnPropertySymbols$1$1(properties));
|
9472 | $forEach$2$1(keys, function (key) {
|
9473 | if (!descriptors$1$1 || $propertyIsEnumerable$1$1.call(properties, key)) $defineProperty$1$1(O, key, properties[key]);
|
9474 | });
|
9475 | return O;
|
9476 | };
|
9477 |
|
9478 | var $create$1$1 = function create(O, Properties) {
|
9479 | return Properties === undefined ? objectCreate$1$1(O) : $defineProperties$1$1(objectCreate$1$1(O), Properties);
|
9480 | };
|
9481 |
|
9482 | var $propertyIsEnumerable$1$1 = function propertyIsEnumerable(V) {
|
9483 | var P = toPrimitive$1$1(V, true);
|
9484 | var enumerable = nativePropertyIsEnumerable$1$1$1.call(this, P);
|
9485 | if (this === ObjectPrototype$2$1 && has$2$1(AllSymbols$1$1, P) && !has$2$1(ObjectPrototypeSymbols$1$1, P)) return false;
|
9486 | return enumerable || !has$2$1(this, P) || !has$2$1(AllSymbols$1$1, P) || has$2$1(this, HIDDEN$1$1) && this[HIDDEN$1$1][P] ? enumerable : true;
|
9487 | };
|
9488 |
|
9489 | var $getOwnPropertyDescriptor$1$1 = function getOwnPropertyDescriptor(O, P) {
|
9490 | var it = toIndexedObject$1$1(O);
|
9491 | var key = toPrimitive$1$1(P, true);
|
9492 | if (it === ObjectPrototype$2$1 && has$2$1(AllSymbols$1$1, key) && !has$2$1(ObjectPrototypeSymbols$1$1, key)) return;
|
9493 | var descriptor = nativeGetOwnPropertyDescriptor$2$1$1(it, key);
|
9494 |
|
9495 | if (descriptor && has$2$1(AllSymbols$1$1, key) && !(has$2$1(it, HIDDEN$1$1) && it[HIDDEN$1$1][key])) {
|
9496 | descriptor.enumerable = true;
|
9497 | }
|
9498 |
|
9499 | return descriptor;
|
9500 | };
|
9501 |
|
9502 | var $getOwnPropertyNames$1$1 = function getOwnPropertyNames(O) {
|
9503 | var names = nativeGetOwnPropertyNames$1$1$1(toIndexedObject$1$1(O));
|
9504 | var result = [];
|
9505 | $forEach$2$1(names, function (key) {
|
9506 | if (!has$2$1(AllSymbols$1$1, key) && !has$2$1(hiddenKeys$2$1, key)) result.push(key);
|
9507 | });
|
9508 | return result;
|
9509 | };
|
9510 |
|
9511 | var $getOwnPropertySymbols$1$1 = function getOwnPropertySymbols(O) {
|
9512 | var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$2$1;
|
9513 | var names = nativeGetOwnPropertyNames$1$1$1(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols$1$1 : toIndexedObject$1$1(O));
|
9514 | var result = [];
|
9515 | $forEach$2$1(names, function (key) {
|
9516 | if (has$2$1(AllSymbols$1$1, key) && (!IS_OBJECT_PROTOTYPE || has$2$1(ObjectPrototype$2$1, key))) {
|
9517 | result.push(AllSymbols$1$1[key]);
|
9518 | }
|
9519 | });
|
9520 | return result;
|
9521 | };
|
9522 |
|
9523 |
|
9524 |
|
9525 | if (!nativeSymbol$1$1) {
|
9526 | $Symbol$1$1 = function Symbol() {
|
9527 | if (this instanceof $Symbol$1$1) throw TypeError('Symbol is not a constructor');
|
9528 | var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
|
9529 | var tag = uid$1$1(description);
|
9530 |
|
9531 | var setter = function (value) {
|
9532 | if (this === ObjectPrototype$2$1) setter.call(ObjectPrototypeSymbols$1$1, value);
|
9533 | if (has$2$1(this, HIDDEN$1$1) && has$2$1(this[HIDDEN$1$1], tag)) this[HIDDEN$1$1][tag] = false;
|
9534 | setSymbolDescriptor$1$1(this, tag, createPropertyDescriptor$1$1(1, value));
|
9535 | };
|
9536 |
|
9537 | if (descriptors$1$1 && USE_SETTER$1$1) setSymbolDescriptor$1$1(ObjectPrototype$2$1, tag, {
|
9538 | configurable: true,
|
9539 | set: setter
|
9540 | });
|
9541 | return wrap$1$1(tag, description);
|
9542 | };
|
9543 |
|
9544 | redefine$1$1($Symbol$1$1[PROTOTYPE$1$1$1], 'toString', function toString() {
|
9545 | return getInternalState$3$1(this).tag;
|
9546 | });
|
9547 | objectPropertyIsEnumerable$1$1.f = $propertyIsEnumerable$1$1;
|
9548 | objectDefineProperty$1$1.f = $defineProperty$1$1;
|
9549 | objectGetOwnPropertyDescriptor$1$1.f = $getOwnPropertyDescriptor$1$1;
|
9550 | objectGetOwnPropertyNames$1$1.f = objectGetOwnPropertyNamesExternal$1$1.f = $getOwnPropertyNames$1$1;
|
9551 | objectGetOwnPropertySymbols$1$1.f = $getOwnPropertySymbols$1$1;
|
9552 |
|
9553 | if (descriptors$1$1) {
|
9554 |
|
9555 | nativeDefineProperty$1$1$1($Symbol$1$1[PROTOTYPE$1$1$1], 'description', {
|
9556 | configurable: true,
|
9557 | get: function description() {
|
9558 | return getInternalState$3$1(this).description;
|
9559 | }
|
9560 | });
|
9561 | }
|
9562 |
|
9563 | wrappedWellKnownSymbol$1$1.f = function (name) {
|
9564 | return wrap$1$1(wellKnownSymbol$1$1(name), name);
|
9565 | };
|
9566 | }
|
9567 |
|
9568 | _export$1$1({
|
9569 | global: true,
|
9570 | wrap: true,
|
9571 | forced: !nativeSymbol$1$1,
|
9572 | sham: !nativeSymbol$1$1
|
9573 | }, {
|
9574 | Symbol: $Symbol$1$1
|
9575 | });
|
9576 |
|
9577 | $forEach$2$1(objectKeys$1$1(WellKnownSymbolsStore$1$1), function (name) {
|
9578 | defineWellKnownSymbol$1$1(name);
|
9579 | });
|
9580 |
|
9581 | _export$1$1({
|
9582 | target: SYMBOL$1$1,
|
9583 | stat: true,
|
9584 | forced: !nativeSymbol$1$1
|
9585 | }, {
|
9586 |
|
9587 |
|
9588 | 'for': function (key) {
|
9589 | var string = String(key);
|
9590 | if (has$2$1(StringToSymbolRegistry$1$1, string)) return StringToSymbolRegistry$1$1[string];
|
9591 | var symbol = $Symbol$1$1(string);
|
9592 | StringToSymbolRegistry$1$1[string] = symbol;
|
9593 | SymbolToStringRegistry$1$1[symbol] = string;
|
9594 | return symbol;
|
9595 | },
|
9596 |
|
9597 |
|
9598 | keyFor: function keyFor(sym) {
|
9599 | if (!isSymbol$1$1(sym)) throw TypeError(sym + ' is not a symbol');
|
9600 | if (has$2$1(SymbolToStringRegistry$1$1, sym)) return SymbolToStringRegistry$1$1[sym];
|
9601 | },
|
9602 | useSetter: function () {
|
9603 | USE_SETTER$1$1 = true;
|
9604 | },
|
9605 | useSimple: function () {
|
9606 | USE_SETTER$1$1 = false;
|
9607 | }
|
9608 | });
|
9609 |
|
9610 | _export$1$1({
|
9611 | target: 'Object',
|
9612 | stat: true,
|
9613 | forced: !nativeSymbol$1$1,
|
9614 | sham: !descriptors$1$1
|
9615 | }, {
|
9616 |
|
9617 |
|
9618 | create: $create$1$1,
|
9619 |
|
9620 |
|
9621 | defineProperty: $defineProperty$1$1,
|
9622 |
|
9623 |
|
9624 | defineProperties: $defineProperties$1$1,
|
9625 |
|
9626 |
|
9627 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor$1$1
|
9628 | });
|
9629 |
|
9630 | _export$1$1({
|
9631 | target: 'Object',
|
9632 | stat: true,
|
9633 | forced: !nativeSymbol$1$1
|
9634 | }, {
|
9635 |
|
9636 |
|
9637 | getOwnPropertyNames: $getOwnPropertyNames$1$1,
|
9638 |
|
9639 |
|
9640 | getOwnPropertySymbols: $getOwnPropertySymbols$1$1
|
9641 | });
|
9642 |
|
9643 |
|
9644 |
|
9645 | _export$1$1({
|
9646 | target: 'Object',
|
9647 | stat: true,
|
9648 | forced: fails$1$1(function () {
|
9649 | objectGetOwnPropertySymbols$1$1.f(1);
|
9650 | })
|
9651 | }, {
|
9652 | getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
9653 | return objectGetOwnPropertySymbols$1$1.f(toObject$1$1(it));
|
9654 | }
|
9655 | });
|
9656 |
|
9657 |
|
9658 |
|
9659 | if ($stringify$2) {
|
9660 | var FORCED_JSON_STRINGIFY$1$1 = !nativeSymbol$1$1 || fails$1$1(function () {
|
9661 | var symbol = $Symbol$1$1();
|
9662 |
|
9663 | return $stringify$2([symbol]) != '[null]'
|
9664 | || $stringify$2({
|
9665 | a: symbol
|
9666 | }) != '{}'
|
9667 | || $stringify$2(Object(symbol)) != '{}';
|
9668 | });
|
9669 |
|
9670 | _export$1$1({
|
9671 | target: 'JSON',
|
9672 | stat: true,
|
9673 | forced: FORCED_JSON_STRINGIFY$1$1
|
9674 | }, {
|
9675 |
|
9676 | stringify: function stringify(it, replacer, space) {
|
9677 | var args = [it];
|
9678 | var index = 1;
|
9679 | var $replacer;
|
9680 |
|
9681 | while (arguments.length > index) args.push(arguments[index++]);
|
9682 |
|
9683 | $replacer = replacer;
|
9684 | if (!isObject$1$1(replacer) && it === undefined || isSymbol$1$1(it)) return;
|
9685 |
|
9686 | if (!isArray$6$1(replacer)) replacer = function (key, value) {
|
9687 | if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
9688 | if (!isSymbol$1$1(value)) return value;
|
9689 | };
|
9690 | args[1] = replacer;
|
9691 | return $stringify$2.apply(null, args);
|
9692 | }
|
9693 | });
|
9694 | }
|
9695 |
|
9696 |
|
9697 |
|
9698 | if (!$Symbol$1$1[PROTOTYPE$1$1$1][TO_PRIMITIVE$1$1]) {
|
9699 | createNonEnumerableProperty$1$1($Symbol$1$1[PROTOTYPE$1$1$1], TO_PRIMITIVE$1$1, $Symbol$1$1[PROTOTYPE$1$1$1].valueOf);
|
9700 | }
|
9701 |
|
9702 |
|
9703 |
|
9704 | setToStringTag$1$1($Symbol$1$1, SYMBOL$1$1);
|
9705 | hiddenKeys$2$1[HIDDEN$1$1] = true;
|
9706 | var getOwnPropertySymbols$3$1 = path$1$1.Object.getOwnPropertySymbols;
|
9707 | var iterators$1$1 = {};
|
9708 | var correctPrototypeGetter$1$1 = !fails$1$1(function () {
|
9709 | function F() {
|
9710 |
|
9711 | }
|
9712 |
|
9713 | F.prototype.constructor = null;
|
9714 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
9715 | });
|
9716 | var IE_PROTO$1$1$1 = sharedKey$1$1('IE_PROTO');
|
9717 | var ObjectPrototype$1$1$1 = Object.prototype;
|
9718 |
|
9719 |
|
9720 | var objectGetPrototypeOf$1$1 = correctPrototypeGetter$1$1 ? Object.getPrototypeOf : function (O) {
|
9721 | O = toObject$1$1(O);
|
9722 | if (has$2$1(O, IE_PROTO$1$1$1)) return O[IE_PROTO$1$1$1];
|
9723 |
|
9724 | if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
9725 | return O.constructor.prototype;
|
9726 | }
|
9727 |
|
9728 | return O instanceof Object ? ObjectPrototype$1$1$1 : null;
|
9729 | };
|
9730 | var ITERATOR$6$1 = wellKnownSymbol$1$1('iterator');
|
9731 | var BUGGY_SAFARI_ITERATORS$2$1 = false;
|
9732 |
|
9733 |
|
9734 | var IteratorPrototype$3$1, PrototypeOfArrayIteratorPrototype$1$1, arrayIterator$1$1;
|
9735 |
|
9736 | if ([].keys) {
|
9737 | arrayIterator$1$1 = [].keys();
|
9738 |
|
9739 | if (!('next' in arrayIterator$1$1)) BUGGY_SAFARI_ITERATORS$2$1 = true;else {
|
9740 | PrototypeOfArrayIteratorPrototype$1$1 = objectGetPrototypeOf$1$1(objectGetPrototypeOf$1$1(arrayIterator$1$1));
|
9741 | if (PrototypeOfArrayIteratorPrototype$1$1 !== Object.prototype) IteratorPrototype$3$1 = PrototypeOfArrayIteratorPrototype$1$1;
|
9742 | }
|
9743 | }
|
9744 |
|
9745 | if (IteratorPrototype$3$1 == undefined) IteratorPrototype$3$1 = {};
|
9746 | var iteratorsCore$1$1 = {
|
9747 | IteratorPrototype: IteratorPrototype$3$1,
|
9748 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$2$1
|
9749 | };
|
9750 | var IteratorPrototype$1$1$1 = iteratorsCore$1$1.IteratorPrototype;
|
9751 |
|
9752 | var returnThis$2$1 = function () {
|
9753 | return this;
|
9754 | };
|
9755 |
|
9756 | var createIteratorConstructor$1$1 = function (IteratorConstructor, NAME, next) {
|
9757 | var TO_STRING_TAG = NAME + ' Iterator';
|
9758 | IteratorConstructor.prototype = objectCreate$1$1(IteratorPrototype$1$1$1, {
|
9759 | next: createPropertyDescriptor$1$1(1, next)
|
9760 | });
|
9761 | setToStringTag$1$1(IteratorConstructor, TO_STRING_TAG, false, true);
|
9762 | iterators$1$1[TO_STRING_TAG] = returnThis$2$1;
|
9763 | return IteratorConstructor;
|
9764 | };
|
9765 |
|
9766 | var aPossiblePrototype$1$1 = function (it) {
|
9767 | if (!isObject$1$1(it) && it !== null) {
|
9768 | throw TypeError("Can't set " + String(it) + ' as a prototype');
|
9769 | }
|
9770 |
|
9771 | return it;
|
9772 | };
|
9773 |
|
9774 |
|
9775 |
|
9776 |
|
9777 |
|
9778 |
|
9779 | var objectSetPrototypeOf$1$1 = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
9780 | var CORRECT_SETTER = false;
|
9781 | var test = {};
|
9782 | var setter;
|
9783 |
|
9784 | try {
|
9785 | setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
|
9786 | setter.call(test, []);
|
9787 | CORRECT_SETTER = test instanceof Array;
|
9788 | } catch (error) {
|
9789 |
|
9790 | }
|
9791 |
|
9792 | return function setPrototypeOf(O, proto) {
|
9793 | anObject$1$1(O);
|
9794 | aPossiblePrototype$1$1(proto);
|
9795 | if (CORRECT_SETTER) setter.call(O, proto);else O.__proto__ = proto;
|
9796 | return O;
|
9797 | };
|
9798 | }() : undefined);
|
9799 | var IteratorPrototype$2$1$1 = iteratorsCore$1$1.IteratorPrototype;
|
9800 | var BUGGY_SAFARI_ITERATORS$1$1$1 = iteratorsCore$1$1.BUGGY_SAFARI_ITERATORS;
|
9801 | var ITERATOR$1$1$1 = wellKnownSymbol$1$1('iterator');
|
9802 | var KEYS$1$1 = 'keys';
|
9803 | var VALUES$1$1 = 'values';
|
9804 | var ENTRIES$1$1 = 'entries';
|
9805 |
|
9806 | var returnThis$1$1$1 = function () {
|
9807 | return this;
|
9808 | };
|
9809 |
|
9810 | var defineIterator$1$1 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
9811 | createIteratorConstructor$1$1(IteratorConstructor, NAME, next);
|
9812 |
|
9813 | var getIterationMethod = function (KIND) {
|
9814 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
9815 | if (!BUGGY_SAFARI_ITERATORS$1$1$1 && KIND in IterablePrototype) return IterablePrototype[KIND];
|
9816 |
|
9817 | switch (KIND) {
|
9818 | case KEYS$1$1:
|
9819 | return function keys() {
|
9820 | return new IteratorConstructor(this, KIND);
|
9821 | };
|
9822 |
|
9823 | case VALUES$1$1:
|
9824 | return function values() {
|
9825 | return new IteratorConstructor(this, KIND);
|
9826 | };
|
9827 |
|
9828 | case ENTRIES$1$1:
|
9829 | return function entries() {
|
9830 | return new IteratorConstructor(this, KIND);
|
9831 | };
|
9832 | }
|
9833 |
|
9834 | return function () {
|
9835 | return new IteratorConstructor(this);
|
9836 | };
|
9837 | };
|
9838 |
|
9839 | var TO_STRING_TAG = NAME + ' Iterator';
|
9840 | var INCORRECT_VALUES_NAME = false;
|
9841 | var IterablePrototype = Iterable.prototype;
|
9842 | var nativeIterator = IterablePrototype[ITERATOR$1$1$1] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT];
|
9843 | var defaultIterator = !BUGGY_SAFARI_ITERATORS$1$1$1 && nativeIterator || getIterationMethod(DEFAULT);
|
9844 | var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
9845 | var CurrentIteratorPrototype, methods, KEY;
|
9846 |
|
9847 | if (anyNativeIterator) {
|
9848 | CurrentIteratorPrototype = objectGetPrototypeOf$1$1(anyNativeIterator.call(new Iterable()));
|
9849 |
|
9850 | if (IteratorPrototype$2$1$1 !== Object.prototype && CurrentIteratorPrototype.next) {
|
9851 |
|
9852 | setToStringTag$1$1(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
|
9853 | iterators$1$1[TO_STRING_TAG] = returnThis$1$1$1;
|
9854 | }
|
9855 | }
|
9856 |
|
9857 |
|
9858 | if (DEFAULT == VALUES$1$1 && nativeIterator && nativeIterator.name !== VALUES$1$1) {
|
9859 | INCORRECT_VALUES_NAME = true;
|
9860 |
|
9861 | defaultIterator = function values() {
|
9862 | return nativeIterator.call(this);
|
9863 | };
|
9864 | }
|
9865 |
|
9866 |
|
9867 | if (FORCED && IterablePrototype[ITERATOR$1$1$1] !== defaultIterator) {
|
9868 | createNonEnumerableProperty$1$1(IterablePrototype, ITERATOR$1$1$1, defaultIterator);
|
9869 | }
|
9870 |
|
9871 | iterators$1$1[NAME] = defaultIterator;
|
9872 |
|
9873 | if (DEFAULT) {
|
9874 | methods = {
|
9875 | values: getIterationMethod(VALUES$1$1),
|
9876 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS$1$1),
|
9877 | entries: getIterationMethod(ENTRIES$1$1)
|
9878 | };
|
9879 | if (FORCED) for (KEY in methods) {
|
9880 | if (BUGGY_SAFARI_ITERATORS$1$1$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
9881 | redefine$1$1(IterablePrototype, KEY, methods[KEY]);
|
9882 | }
|
9883 | } else _export$1$1({
|
9884 | target: NAME,
|
9885 | proto: true,
|
9886 | forced: BUGGY_SAFARI_ITERATORS$1$1$1 || INCORRECT_VALUES_NAME
|
9887 | }, methods);
|
9888 | }
|
9889 |
|
9890 | return methods;
|
9891 | };
|
9892 |
|
9893 | var ARRAY_ITERATOR$1$1 = 'Array Iterator';
|
9894 | var setInternalState$1$1$1 = internalState$1$1.set;
|
9895 | var getInternalState$1$1$1 = internalState$1$1.getterFor(ARRAY_ITERATOR$1$1); // `Array.prototype.entries` method
|
9896 | // https://tc39.github.io/ecma262/#sec-array.prototype.entries
|
9897 | // `Array.prototype.keys` method
|
9898 | // https://tc39.github.io/ecma262/#sec-array.prototype.keys
|
9899 | // `Array.prototype.values` method
|
9900 | // https://tc39.github.io/ecma262/#sec-array.prototype.values
|
9901 | // `Array.prototype[@@iterator]` method
|
9902 | // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
|
9903 | // `CreateArrayIterator` internal method
|
9904 | // https://tc39.github.io/ecma262/#sec-createarrayiterator
|
9905 |
|
9906 | var es_array_iterator$1$1 = defineIterator$1$1(Array, 'Array', function (iterated, kind) {
|
9907 | setInternalState$1$1$1(this, {
|
9908 | type: ARRAY_ITERATOR$1$1,
|
9909 | target: toIndexedObject$1$1(iterated),
|
9910 |
|
9911 | index: 0,
|
9912 |
|
9913 | kind: kind
|
9914 |
|
9915 | });
|
9916 |
|
9917 | }, function () {
|
9918 | var state = getInternalState$1$1$1(this);
|
9919 | var target = state.target;
|
9920 | var kind = state.kind;
|
9921 | var index = state.index++;
|
9922 |
|
9923 | if (!target || index >= target.length) {
|
9924 | state.target = undefined;
|
9925 | return {
|
9926 | value: undefined,
|
9927 | done: true
|
9928 | };
|
9929 | }
|
9930 |
|
9931 | if (kind == 'keys') return {
|
9932 | value: index,
|
9933 | done: false
|
9934 | };
|
9935 | if (kind == 'values') return {
|
9936 | value: target[index],
|
9937 | done: false
|
9938 | };
|
9939 | return {
|
9940 | value: [index, target[index]],
|
9941 | done: false
|
9942 | };
|
9943 | }, 'values');
|
9944 |
|
9945 |
|
9946 |
|
9947 | iterators$1$1.Arguments = iterators$1$1.Array;
|
9948 |
|
9949 |
|
9950 | var domIterables$1$1 = {
|
9951 | CSSRuleList: 0,
|
9952 | CSSStyleDeclaration: 0,
|
9953 | CSSValueList: 0,
|
9954 | ClientRectList: 0,
|
9955 | DOMRectList: 0,
|
9956 | DOMStringList: 0,
|
9957 | DOMTokenList: 1,
|
9958 | DataTransferItemList: 0,
|
9959 | FileList: 0,
|
9960 | HTMLAllCollection: 0,
|
9961 | HTMLCollection: 0,
|
9962 | HTMLFormElement: 0,
|
9963 | HTMLSelectElement: 0,
|
9964 | MediaList: 0,
|
9965 | MimeTypeArray: 0,
|
9966 | NamedNodeMap: 0,
|
9967 | NodeList: 1,
|
9968 | PaintRequestList: 0,
|
9969 | Plugin: 0,
|
9970 | PluginArray: 0,
|
9971 | SVGLengthList: 0,
|
9972 | SVGNumberList: 0,
|
9973 | SVGPathSegList: 0,
|
9974 | SVGPointList: 0,
|
9975 | SVGStringList: 0,
|
9976 | SVGTransformList: 0,
|
9977 | SourceBufferList: 0,
|
9978 | StyleSheetList: 0,
|
9979 | TextTrackCueList: 0,
|
9980 | TextTrackList: 0,
|
9981 | TouchList: 0
|
9982 | };
|
9983 | var TO_STRING_TAG$3$1$1 = wellKnownSymbol$1$1('toStringTag');
|
9984 |
|
9985 | for (var COLLECTION_NAME$1$1 in domIterables$1$1) {
|
9986 | var Collection$1$1 = global_1$1$1[COLLECTION_NAME$1$1];
|
9987 | var CollectionPrototype$1$1 = Collection$1$1 && Collection$1$1.prototype;
|
9988 |
|
9989 | if (CollectionPrototype$1$1 && !CollectionPrototype$1$1[TO_STRING_TAG$3$1$1]) {
|
9990 | createNonEnumerableProperty$1$1(CollectionPrototype$1$1, TO_STRING_TAG$3$1$1, COLLECTION_NAME$1$1);
|
9991 | }
|
9992 |
|
9993 | iterators$1$1[COLLECTION_NAME$1$1] = iterators$1$1.Array;
|
9994 | }
|
9995 |
|
9996 |
|
9997 | var createMethod$2$1$1 = function (CONVERT_TO_STRING) {
|
9998 | return function ($this, pos) {
|
9999 | var S = String(requireObjectCoercible$1$1($this));
|
10000 | var position = toInteger$1$1(pos);
|
10001 | var size = S.length;
|
10002 | var first, second;
|
10003 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
10004 | first = S.charCodeAt(position);
|
10005 | return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
10006 | };
|
10007 | };
|
10008 |
|
10009 | var stringMultibyte$1$1 = {
|
10010 |
|
10011 |
|
10012 | codeAt: createMethod$2$1$1(false),
|
10013 |
|
10014 |
|
10015 | charAt: createMethod$2$1$1(true)
|
10016 | };
|
10017 | var charAt$1$1 = stringMultibyte$1$1.charAt;
|
10018 | var STRING_ITERATOR$1$1 = 'String Iterator';
|
10019 | var setInternalState$2$1$1 = internalState$1$1.set;
|
10020 | var getInternalState$2$1$1 = internalState$1$1.getterFor(STRING_ITERATOR$1$1); // `String.prototype[@@iterator]` method
|
10021 | // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
|
10022 |
|
10023 | defineIterator$1$1(String, 'String', function (iterated) {
|
10024 | setInternalState$2$1$1(this, {
|
10025 | type: STRING_ITERATOR$1$1,
|
10026 | string: String(iterated),
|
10027 | index: 0
|
10028 | });
|
10029 |
|
10030 | }, function next() {
|
10031 | var state = getInternalState$2$1$1(this);
|
10032 | var string = state.string;
|
10033 | var index = state.index;
|
10034 | var point;
|
10035 | if (index >= string.length) return {
|
10036 | value: undefined,
|
10037 | done: true
|
10038 | };
|
10039 | point = charAt$1$1(string, index);
|
10040 | state.index += point.length;
|
10041 | return {
|
10042 | value: point,
|
10043 | done: false
|
10044 | };
|
10045 | });
|
10046 | var ITERATOR$2$1$1 = wellKnownSymbol$1$1('iterator');
|
10047 |
|
10048 | var getIteratorMethod$1$1 = function (it) {
|
10049 | if (it != undefined) return it[ITERATOR$2$1$1] || it['@@iterator'] || iterators$1$1[classof$1$1(it)];
|
10050 | };
|
10051 |
|
10052 |
|
10053 | _export$1$1({
|
10054 | target: 'Object',
|
10055 | stat: true,
|
10056 | sham: !descriptors$1$1
|
10057 | }, {
|
10058 | create: objectCreate$1$1
|
10059 | });
|
10060 |
|
10061 | var FAILS_ON_PRIMITIVES$1$1$1 = fails$1$1(function () {
|
10062 | objectKeys$1$1(1);
|
10063 | });
|
10064 |
|
10065 |
|
10066 | _export$1$1({
|
10067 | target: 'Object',
|
10068 | stat: true,
|
10069 | forced: FAILS_ON_PRIMITIVES$1$1$1
|
10070 | }, {
|
10071 | keys: function keys(it) {
|
10072 | return objectKeys$1$1(toObject$1$1(it));
|
10073 | }
|
10074 | });
|
10075 |
|
10076 | var keys$1$1$1 = path$1$1.Object.keys;
|
10077 | var keys$2$1$1 = keys$1$1$1;
|
10078 | var keys$3$1$1 = keys$2$1$1;
|
10079 |
|
10080 |
|
10081 | var whitespaces$1 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
10082 | var whitespace$1 = '[' + whitespaces$1 + ']';
|
10083 | var ltrim$1 = RegExp('^' + whitespace$1 + whitespace$1 + '*');
|
10084 | var rtrim$1 = RegExp(whitespace$1 + whitespace$1 + '*$');
|
10085 |
|
10086 | var createMethod$3$1$1 = function (TYPE) {
|
10087 | return function ($this) {
|
10088 | var string = String(requireObjectCoercible$1$1($this));
|
10089 | if (TYPE & 1) string = string.replace(ltrim$1, '');
|
10090 | if (TYPE & 2) string = string.replace(rtrim$1, '');
|
10091 | return string;
|
10092 | };
|
10093 | };
|
10094 |
|
10095 | var stringTrim$1 = {
|
10096 |
|
10097 |
|
10098 | start: createMethod$3$1$1(1),
|
10099 |
|
10100 |
|
10101 | end: createMethod$3$1$1(2),
|
10102 |
|
10103 |
|
10104 | trim: createMethod$3$1$1(3)
|
10105 | };
|
10106 | var non$1 = '\u200B\u0085\u180E';
|
10107 |
|
10108 |
|
10109 | var forcedStringTrimMethod$1 = function (METHOD_NAME) {
|
10110 | return fails$1$1(function () {
|
10111 | return !!whitespaces$1[METHOD_NAME]() || non$1[METHOD_NAME]() != non$1 || whitespaces$1[METHOD_NAME].name !== METHOD_NAME;
|
10112 | });
|
10113 | };
|
10114 |
|
10115 | var $trim$1 = stringTrim$1.trim;
|
10116 |
|
10117 |
|
10118 | _export$1$1({
|
10119 | target: 'String',
|
10120 | proto: true,
|
10121 | forced: forcedStringTrimMethod$1('trim')
|
10122 | }, {
|
10123 | trim: function trim() {
|
10124 | return $trim$1(this);
|
10125 | }
|
10126 | });
|
10127 |
|
10128 | var entryVirtual$1$1 = function (CONSTRUCTOR) {
|
10129 | return path$1$1[CONSTRUCTOR + 'Prototype'];
|
10130 | };
|
10131 |
|
10132 | var trim$4 = entryVirtual$1$1('String').trim;
|
10133 |
|
10134 | var sloppyArrayMethod$1$1 = function (METHOD_NAME, argument) {
|
10135 | var method = [][METHOD_NAME];
|
10136 | return !method || !fails$1$1(function () {
|
10137 |
|
10138 | method.call(null, argument || function () {
|
10139 | throw 1;
|
10140 | }, 1);
|
10141 | });
|
10142 | };
|
10143 |
|
10144 | var $forEach$1$1$1 = arrayIteration$1$1.forEach;
|
10145 |
|
10146 |
|
10147 | var arrayForEach$1$1 = sloppyArrayMethod$1$1('forEach') ? function forEach(callbackfn
|
10148 | /* , thisArg */
|
10149 | ) {
|
10150 | return $forEach$1$1$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
10151 | } : [].forEach;
|
10152 |
|
10153 |
|
10154 | _export$1$1({
|
10155 | target: 'Array',
|
10156 | proto: true,
|
10157 | forced: [].forEach != arrayForEach$1$1
|
10158 | }, {
|
10159 | forEach: arrayForEach$1$1
|
10160 | });
|
10161 |
|
10162 | var forEach$4$1 = entryVirtual$1$1('Array').forEach;
|
10163 | var forEach$1$1$1 = forEach$4$1;
|
10164 | var ArrayPrototype$b = Array.prototype;
|
10165 | var DOMIterables$4 = {
|
10166 | DOMTokenList: true,
|
10167 | NodeList: true
|
10168 | };
|
10169 |
|
10170 | var forEach_1$1$1 = function (it) {
|
10171 | var own = it.forEach;
|
10172 | return it === ArrayPrototype$b || it instanceof Array && own === ArrayPrototype$b.forEach
|
10173 | || DOMIterables$4.hasOwnProperty(classof$1$1(it)) ? forEach$1$1$1 : own;
|
10174 | };
|
10175 |
|
10176 | var forEach$2$1$1 = forEach_1$1$1;
|
10177 | var userAgent$1$1 = getBuiltIn$1$1('navigator', 'userAgent') || '';
|
10178 | var process$1$1 = global_1$1$1.process;
|
10179 | var versions$1$1 = process$1$1 && process$1$1.versions;
|
10180 | var v8$1$1 = versions$1$1 && versions$1$1.v8;
|
10181 | var match$1$1, version$1$1;
|
10182 |
|
10183 | if (v8$1$1) {
|
10184 | match$1$1 = v8$1$1.split('.');
|
10185 | version$1$1 = match$1$1[0] + match$1$1[1];
|
10186 | } else if (userAgent$1$1) {
|
10187 | match$1$1 = userAgent$1$1.match(/Edge\/(\d+)/);
|
10188 |
|
10189 | if (!match$1$1 || match$1$1[1] >= 74) {
|
10190 | match$1$1 = userAgent$1$1.match(/Chrome\/(\d+)/);
|
10191 | if (match$1$1) version$1$1 = match$1$1[1];
|
10192 | }
|
10193 | }
|
10194 |
|
10195 | var v8Version$1$1 = version$1$1 && +version$1$1;
|
10196 | var SPECIES$1$1$1 = wellKnownSymbol$1$1('species');
|
10197 |
|
10198 | var arrayMethodHasSpeciesSupport$1$1 = function (METHOD_NAME) {
|
10199 |
|
10200 |
|
10201 |
|
10202 | return v8Version$1$1 >= 51 || !fails$1$1(function () {
|
10203 | var array = [];
|
10204 | var constructor = array.constructor = {};
|
10205 |
|
10206 | constructor[SPECIES$1$1$1] = function () {
|
10207 | return {
|
10208 | foo: 1
|
10209 | };
|
10210 | };
|
10211 |
|
10212 | return array[METHOD_NAME](Boolean).foo !== 1;
|
10213 | });
|
10214 | };
|
10215 |
|
10216 | var $map$1$1 = arrayIteration$1$1.map;
|
10217 |
|
10218 |
|
10219 |
|
10220 | _export$1$1({
|
10221 | target: 'Array',
|
10222 | proto: true,
|
10223 | forced: !arrayMethodHasSpeciesSupport$1$1('map')
|
10224 | }, {
|
10225 | map: function map(callbackfn
|
10226 | /* , thisArg */
|
10227 | ) {
|
10228 | return $map$1$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
10229 | }
|
10230 | });
|
10231 |
|
10232 | var map$6 = entryVirtual$1$1('Array').map;
|
10233 | var trim$3$1 = stringTrim$1.trim;
|
10234 | var nativeParseInt$1 = global_1$1$1.parseInt;
|
10235 | var hex$1 = /^[+-]?0[Xx]/;
|
10236 | var FORCED$1$1$1 = nativeParseInt$1(whitespaces$1 + '08') !== 8 || nativeParseInt$1(whitespaces$1 + '0x16') !== 22;
|
10237 |
|
10238 |
|
10239 | var _parseInt$4 = FORCED$1$1$1 ? function parseInt(string, radix) {
|
10240 | var S = trim$3$1(String(string));
|
10241 | return nativeParseInt$1(S, radix >>> 0 || (hex$1.test(S) ? 16 : 10));
|
10242 | } : nativeParseInt$1;
|
10243 |
|
10244 |
|
10245 |
|
10246 | _export$1$1({
|
10247 | global: true,
|
10248 | forced: parseInt != _parseInt$4
|
10249 | }, {
|
10250 | parseInt: _parseInt$4
|
10251 | });
|
10252 |
|
10253 | var _parseInt$1$1 = path$1$1.parseInt;
|
10254 | var _parseInt$2$1 = _parseInt$1$1;
|
10255 | var _parseInt$3$1 = _parseInt$2$1;
|
10256 | var propertyIsEnumerable$1 = objectPropertyIsEnumerable$1$1.f;
|
10257 |
|
10258 | var createMethod$4$1$1 = function (TO_ENTRIES) {
|
10259 | return function (it) {
|
10260 | var O = toIndexedObject$1$1(it);
|
10261 | var keys = objectKeys$1$1(O);
|
10262 | var length = keys.length;
|
10263 | var i = 0;
|
10264 | var result = [];
|
10265 | var key;
|
10266 |
|
10267 | while (length > i) {
|
10268 | key = keys[i++];
|
10269 |
|
10270 | if (!descriptors$1$1 || propertyIsEnumerable$1.call(O, key)) {
|
10271 | result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
|
10272 | }
|
10273 | }
|
10274 |
|
10275 | return result;
|
10276 | };
|
10277 | };
|
10278 |
|
10279 | var objectToArray$1 = {
|
10280 |
|
10281 |
|
10282 | entries: createMethod$4$1$1(true),
|
10283 |
|
10284 |
|
10285 | values: createMethod$4$1$1(false)
|
10286 | };
|
10287 | var $values$1 = objectToArray$1.values;
|
10288 |
|
10289 |
|
10290 | _export$1$1({
|
10291 | target: 'Object',
|
10292 | stat: true
|
10293 | }, {
|
10294 | values: function values(O) {
|
10295 | return $values$1(O);
|
10296 | }
|
10297 | });
|
10298 |
|
10299 | var values$3$1 = path$1$1.Object.values;
|
10300 | var $filter$1$1 = arrayIteration$1$1.filter;
|
10301 |
|
10302 |
|
10303 |
|
10304 | _export$1$1({
|
10305 | target: 'Array',
|
10306 | proto: true,
|
10307 | forced: !arrayMethodHasSpeciesSupport$1$1('filter')
|
10308 | }, {
|
10309 | filter: function filter(callbackfn
|
10310 | /* , thisArg */
|
10311 | ) {
|
10312 | return $filter$1$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
10313 | }
|
10314 | });
|
10315 |
|
10316 | var filter$3$1 = entryVirtual$1$1('Array').filter;
|
10317 | var IS_CONCAT_SPREADABLE$1$1 = wellKnownSymbol$1$1('isConcatSpreadable');
|
10318 | var MAX_SAFE_INTEGER$1$1 = 0x1FFFFFFFFFFFFF;
|
10319 | var MAXIMUM_ALLOWED_INDEX_EXCEEDED$1$1 = 'Maximum allowed index exceeded';
|
10320 |
|
10321 |
|
10322 |
|
10323 | var IS_CONCAT_SPREADABLE_SUPPORT$1$1 = v8Version$1$1 >= 51 || !fails$1$1(function () {
|
10324 | var array = [];
|
10325 | array[IS_CONCAT_SPREADABLE$1$1] = false;
|
10326 | return array.concat()[0] !== array;
|
10327 | });
|
10328 | var SPECIES_SUPPORT$1$1 = arrayMethodHasSpeciesSupport$1$1('concat');
|
10329 |
|
10330 | var isConcatSpreadable$1$1 = function (O) {
|
10331 | if (!isObject$1$1(O)) return false;
|
10332 | var spreadable = O[IS_CONCAT_SPREADABLE$1$1];
|
10333 | return spreadable !== undefined ? !!spreadable : isArray$6$1(O);
|
10334 | };
|
10335 |
|
10336 | var FORCED$2$1$1 = !IS_CONCAT_SPREADABLE_SUPPORT$1$1 || !SPECIES_SUPPORT$1$1;
|
10337 |
|
10338 |
|
10339 |
|
10340 | _export$1$1({
|
10341 | target: 'Array',
|
10342 | proto: true,
|
10343 | forced: FORCED$2$1$1
|
10344 | }, {
|
10345 | concat: function concat(arg) {
|
10346 |
|
10347 | var O = toObject$1$1(this);
|
10348 | var A = arraySpeciesCreate$1$1(O, 0);
|
10349 | var n = 0;
|
10350 | var i, k, length, len, E;
|
10351 |
|
10352 | for (i = -1, length = arguments.length; i < length; i++) {
|
10353 | E = i === -1 ? O : arguments[i];
|
10354 |
|
10355 | if (isConcatSpreadable$1$1(E)) {
|
10356 | len = toLength$1$1(E.length);
|
10357 | if (n + len > MAX_SAFE_INTEGER$1$1) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED$1$1);
|
10358 |
|
10359 | for (k = 0; k < len; k++, n++) if (k in E) createProperty$1$1(A, n, E[k]);
|
10360 | } else {
|
10361 | if (n >= MAX_SAFE_INTEGER$1$1) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED$1$1);
|
10362 | createProperty$1$1(A, n++, E);
|
10363 | }
|
10364 | }
|
10365 |
|
10366 | A.length = n;
|
10367 | return A;
|
10368 | }
|
10369 | });
|
10370 |
|
10371 | var concat$3$1 = entryVirtual$1$1('Array').concat;
|
10372 | var ArrayPrototype$3$1$1 = Array.prototype;
|
10373 |
|
10374 | var concat_1$1$1 = function (it) {
|
10375 | var own = it.concat;
|
10376 | return it === ArrayPrototype$3$1$1 || it instanceof Array && own === ArrayPrototype$3$1$1.concat ? concat$3$1 : own;
|
10377 | };
|
10378 |
|
10379 | var concat$1$1$1 = concat_1$1$1;
|
10380 | var concat$2$1$1 = concat$1$1$1;
|
10381 |
|
10382 |
|
10383 | _export$1$1({
|
10384 | target: 'Array',
|
10385 | stat: true
|
10386 | }, {
|
10387 | isArray: isArray$6$1
|
10388 | });
|
10389 |
|
10390 | var isArray$1$1$1 = path$1$1.Array.isArray;
|
10391 |
|
10392 | var callWithSafeIterationClosing$1$1 = function (iterator, fn, value, ENTRIES) {
|
10393 | try {
|
10394 | return ENTRIES ? fn(anObject$1$1(value)[0], value[1]) : fn(value);
|
10395 | } catch (error) {
|
10396 | var returnMethod = iterator['return'];
|
10397 | if (returnMethod !== undefined) anObject$1$1(returnMethod.call(iterator));
|
10398 | throw error;
|
10399 | }
|
10400 | };
|
10401 |
|
10402 | var ITERATOR$3$1$1 = wellKnownSymbol$1$1('iterator');
|
10403 | var ArrayPrototype$4$1$1 = Array.prototype;
|
10404 |
|
10405 | var isArrayIteratorMethod$1$1 = function (it) {
|
10406 | return it !== undefined && (iterators$1$1.Array === it || ArrayPrototype$4$1$1[ITERATOR$3$1$1] === it);
|
10407 | };
|
10408 |
|
10409 |
|
10410 |
|
10411 | var arrayFrom$1$1 = function from(arrayLike
|
10412 | /* , mapfn = undefined, thisArg = undefined */
|
10413 | ) {
|
10414 | var O = toObject$1$1(arrayLike);
|
10415 | var C = typeof this == 'function' ? this : Array;
|
10416 | var argumentsLength = arguments.length;
|
10417 | var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
10418 | var mapping = mapfn !== undefined;
|
10419 | var index = 0;
|
10420 | var iteratorMethod = getIteratorMethod$1$1(O);
|
10421 | var length, result, step, iterator, next;
|
10422 | if (mapping) mapfn = bindContext$1$1(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
|
10423 |
|
10424 | if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod$1$1(iteratorMethod))) {
|
10425 | iterator = iteratorMethod.call(O);
|
10426 | next = iterator.next;
|
10427 | result = new C();
|
10428 |
|
10429 | for (; !(step = next.call(iterator)).done; index++) {
|
10430 | createProperty$1$1(result, index, mapping ? callWithSafeIterationClosing$1$1(iterator, mapfn, [step.value, index], true) : step.value);
|
10431 | }
|
10432 | } else {
|
10433 | length = toLength$1$1(O.length);
|
10434 | result = new C(length);
|
10435 |
|
10436 | for (; length > index; index++) {
|
10437 | createProperty$1$1(result, index, mapping ? mapfn(O[index], index) : O[index]);
|
10438 | }
|
10439 | }
|
10440 |
|
10441 | result.length = index;
|
10442 | return result;
|
10443 | };
|
10444 |
|
10445 | var ITERATOR$4$1$1 = wellKnownSymbol$1$1('iterator');
|
10446 | var SAFE_CLOSING$1$1 = false;
|
10447 |
|
10448 | try {
|
10449 | var called$1$1 = 0;
|
10450 | var iteratorWithReturn$1$1 = {
|
10451 | next: function () {
|
10452 | return {
|
10453 | done: !!called$1$1++
|
10454 | };
|
10455 | },
|
10456 | 'return': function () {
|
10457 | SAFE_CLOSING$1$1 = true;
|
10458 | }
|
10459 | };
|
10460 |
|
10461 | iteratorWithReturn$1$1[ITERATOR$4$1$1] = function () {
|
10462 | return this;
|
10463 | };
|
10464 |
|
10465 |
|
10466 | Array.from(iteratorWithReturn$1$1, function () {
|
10467 | throw 2;
|
10468 | });
|
10469 | } catch (error) {
|
10470 |
|
10471 | }
|
10472 |
|
10473 | var checkCorrectnessOfIteration$1$1 = function (exec, SKIP_CLOSING) {
|
10474 | if (!SKIP_CLOSING && !SAFE_CLOSING$1$1) return false;
|
10475 | var ITERATION_SUPPORT = false;
|
10476 |
|
10477 | try {
|
10478 | var object = {};
|
10479 |
|
10480 | object[ITERATOR$4$1$1] = function () {
|
10481 | return {
|
10482 | next: function () {
|
10483 | return {
|
10484 | done: ITERATION_SUPPORT = true
|
10485 | };
|
10486 | }
|
10487 | };
|
10488 | };
|
10489 |
|
10490 | exec(object);
|
10491 | } catch (error) {
|
10492 |
|
10493 | }
|
10494 |
|
10495 | return ITERATION_SUPPORT;
|
10496 | };
|
10497 |
|
10498 | var INCORRECT_ITERATION$1$1 = !checkCorrectnessOfIteration$1$1(function (iterable) {
|
10499 | Array.from(iterable);
|
10500 | });
|
10501 |
|
10502 |
|
10503 | _export$1$1({
|
10504 | target: 'Array',
|
10505 | stat: true,
|
10506 | forced: INCORRECT_ITERATION$1$1
|
10507 | }, {
|
10508 | from: arrayFrom$1$1
|
10509 | });
|
10510 |
|
10511 | var from_1$3$1 = path$1$1.Array.from;
|
10512 | var ITERATOR$5$1$1 = wellKnownSymbol$1$1('iterator');
|
10513 | var SPECIES$2$1$1 = wellKnownSymbol$1$1('species');
|
10514 | var nativeSlice$1 = [].slice;
|
10515 | var max$1$1$1 = Math.max;
|
10516 |
|
10517 |
|
10518 |
|
10519 | _export$1$1({
|
10520 | target: 'Array',
|
10521 | proto: true,
|
10522 | forced: !arrayMethodHasSpeciesSupport$1$1('slice')
|
10523 | }, {
|
10524 | slice: function slice(start, end) {
|
10525 | var O = toIndexedObject$1$1(this);
|
10526 | var length = toLength$1$1(O.length);
|
10527 | var k = toAbsoluteIndex$1$1(start, length);
|
10528 | var fin = toAbsoluteIndex$1$1(end === undefined ? length : end, length);
|
10529 |
|
10530 | var Constructor, result, n;
|
10531 |
|
10532 | if (isArray$6$1(O)) {
|
10533 | Constructor = O.constructor;
|
10534 |
|
10535 | if (typeof Constructor == 'function' && (Constructor === Array || isArray$6$1(Constructor.prototype))) {
|
10536 | Constructor = undefined;
|
10537 | } else if (isObject$1$1(Constructor)) {
|
10538 | Constructor = Constructor[SPECIES$2$1$1];
|
10539 | if (Constructor === null) Constructor = undefined;
|
10540 | }
|
10541 |
|
10542 | if (Constructor === Array || Constructor === undefined) {
|
10543 | return nativeSlice$1.call(O, k, fin);
|
10544 | }
|
10545 | }
|
10546 |
|
10547 | result = new (Constructor === undefined ? Array : Constructor)(max$1$1$1(fin - k, 0));
|
10548 |
|
10549 | for (n = 0; k < fin; k++, n++) if (k in O) createProperty$1$1(result, n, O[k]);
|
10550 |
|
10551 | result.length = n;
|
10552 | return result;
|
10553 | }
|
10554 | });
|
10555 |
|
10556 | var slice$1$1 = entryVirtual$1$1('Array').slice;
|
10557 | var ArrayPrototype$5$1$1 = Array.prototype;
|
10558 |
|
10559 | var slice_1$1 = function (it) {
|
10560 | var own = it.slice;
|
10561 | return it === ArrayPrototype$5$1$1 || it instanceof Array && own === ArrayPrototype$5$1$1.slice ? slice$1$1 : own;
|
10562 | };
|
10563 |
|
10564 | var slice$1$1$1 = slice_1$1;
|
10565 | var slice$2$1 = slice$1$1$1;
|
10566 | var FAILS_ON_PRIMITIVES$2$1$1 = fails$1$1(function () {
|
10567 | objectGetPrototypeOf$1$1(1);
|
10568 | });
|
10569 |
|
10570 |
|
10571 | _export$1$1({
|
10572 | target: 'Object',
|
10573 | stat: true,
|
10574 | forced: FAILS_ON_PRIMITIVES$2$1$1,
|
10575 | sham: !correctPrototypeGetter$1$1
|
10576 | }, {
|
10577 | getPrototypeOf: function getPrototypeOf(it) {
|
10578 | return objectGetPrototypeOf$1$1(toObject$1$1(it));
|
10579 | }
|
10580 | });
|
10581 |
|
10582 | var getPrototypeOf$4 = path$1$1.Object.getPrototypeOf;
|
10583 | var getPrototypeOf$1$1$1 = getPrototypeOf$4;
|
10584 | var getPrototypeOf$2$1$1 = getPrototypeOf$1$1$1;
|
10585 | var $indexOf$1 = arrayIncludes$1$1.indexOf;
|
10586 | var nativeIndexOf$1 = [].indexOf;
|
10587 | var NEGATIVE_ZERO$1 = !!nativeIndexOf$1 && 1 / [1].indexOf(1, -0) < 0;
|
10588 | var SLOPPY_METHOD$1$1 = sloppyArrayMethod$1$1('indexOf');
|
10589 |
|
10590 |
|
10591 | _export$1$1({
|
10592 | target: 'Array',
|
10593 | proto: true,
|
10594 | forced: NEGATIVE_ZERO$1 || SLOPPY_METHOD$1$1
|
10595 | }, {
|
10596 | indexOf: function indexOf(searchElement
|
10597 | /* , fromIndex = 0 */
|
10598 | ) {
|
10599 | return NEGATIVE_ZERO$1
|
10600 | ? nativeIndexOf$1.apply(this, arguments) || 0 : $indexOf$1(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
|
10601 | }
|
10602 | });
|
10603 |
|
10604 | var indexOf$1$1$1 = entryVirtual$1$1('Array').indexOf;
|
10605 | var ArrayPrototype$6$1$1 = Array.prototype;
|
10606 |
|
10607 | var indexOf_1$1 = function (it) {
|
10608 | var own = it.indexOf;
|
10609 | return it === ArrayPrototype$6$1$1 || it instanceof Array && own === ArrayPrototype$6$1$1.indexOf ? indexOf$1$1$1 : own;
|
10610 | };
|
10611 |
|
10612 | var indexOf$2$1 = indexOf_1$1;
|
10613 | var indexOf$3$1 = indexOf$2$1;
|
10614 | var isArray$4$1$1 = isArray$1$1$1;
|
10615 | var isArray$5$1$1 = isArray$4$1$1;
|
10616 | var nativeAssign$1$1 = Object.assign;
|
10617 |
|
10618 |
|
10619 |
|
10620 | var objectAssign$1$1 = !nativeAssign$1$1 || fails$1$1(function () {
|
10621 | var A = {};
|
10622 | var B = {};
|
10623 |
|
10624 | var symbol = Symbol();
|
10625 | var alphabet = 'abcdefghijklmnopqrst';
|
10626 | A[symbol] = 7;
|
10627 | alphabet.split('').forEach(function (chr) {
|
10628 | B[chr] = chr;
|
10629 | });
|
10630 | return nativeAssign$1$1({}, A)[symbol] != 7 || objectKeys$1$1(nativeAssign$1$1({}, B)).join('') != alphabet;
|
10631 | }) ? function assign(target, source) {
|
10632 |
|
10633 | var T = toObject$1$1(target);
|
10634 | var argumentsLength = arguments.length;
|
10635 | var index = 1;
|
10636 | var getOwnPropertySymbols = objectGetOwnPropertySymbols$1$1.f;
|
10637 | var propertyIsEnumerable = objectPropertyIsEnumerable$1$1.f;
|
10638 |
|
10639 | while (argumentsLength > index) {
|
10640 | var S = indexedObject$1$1(arguments[index++]);
|
10641 | var keys = getOwnPropertySymbols ? objectKeys$1$1(S).concat(getOwnPropertySymbols(S)) : objectKeys$1$1(S);
|
10642 | var length = keys.length;
|
10643 | var j = 0;
|
10644 | var key;
|
10645 |
|
10646 | while (length > j) {
|
10647 | key = keys[j++];
|
10648 | if (!descriptors$1$1 || propertyIsEnumerable.call(S, key)) T[key] = S[key];
|
10649 | }
|
10650 | }
|
10651 |
|
10652 | return T;
|
10653 | } : nativeAssign$1$1;
|
10654 |
|
10655 |
|
10656 | _export$1$1({
|
10657 | target: 'Object',
|
10658 | stat: true,
|
10659 | forced: Object.assign !== objectAssign$1$1
|
10660 | }, {
|
10661 | assign: objectAssign$1$1
|
10662 | });
|
10663 |
|
10664 | var assign$3$1 = path$1$1.Object.assign;
|
10665 |
|
10666 | defineWellKnownSymbol$1$1('iterator');
|
10667 | var iterator$5 = wrappedWellKnownSymbol$1$1.f('iterator');
|
10668 | var iterator$1$1$1 = iterator$5;
|
10669 | var iterator$2$1$1 = iterator$1$1$1;
|
10670 |
|
10671 |
|
10672 | defineWellKnownSymbol$1$1('asyncIterator');
|
10673 |
|
10674 |
|
10675 | defineWellKnownSymbol$1$1('hasInstance');
|
10676 |
|
10677 |
|
10678 | defineWellKnownSymbol$1$1('isConcatSpreadable');
|
10679 |
|
10680 |
|
10681 | defineWellKnownSymbol$1$1('match');
|
10682 |
|
10683 | defineWellKnownSymbol$1$1('matchAll');
|
10684 |
|
10685 |
|
10686 | defineWellKnownSymbol$1$1('replace');
|
10687 |
|
10688 |
|
10689 | defineWellKnownSymbol$1$1('search');
|
10690 |
|
10691 |
|
10692 | defineWellKnownSymbol$1$1('species');
|
10693 |
|
10694 |
|
10695 | defineWellKnownSymbol$1$1('split');
|
10696 |
|
10697 |
|
10698 | defineWellKnownSymbol$1$1('toPrimitive');
|
10699 |
|
10700 |
|
10701 | defineWellKnownSymbol$1$1('toStringTag');
|
10702 |
|
10703 |
|
10704 | defineWellKnownSymbol$1$1('unscopables');
|
10705 |
|
10706 |
|
10707 | setToStringTag$1$1(Math, 'Math', true);
|
10708 |
|
10709 |
|
10710 | setToStringTag$1$1(global_1$1$1.JSON, 'JSON', true);
|
10711 | var symbol$3$1 = path$1$1.Symbol;
|
10712 |
|
10713 |
|
10714 | defineWellKnownSymbol$1$1('asyncDispose');
|
10715 |
|
10716 |
|
10717 | defineWellKnownSymbol$1$1('dispose');
|
10718 |
|
10719 |
|
10720 | defineWellKnownSymbol$1$1('observable');
|
10721 |
|
10722 |
|
10723 | defineWellKnownSymbol$1$1('patternMatch');
|
10724 |
|
10725 | defineWellKnownSymbol$1$1('replaceAll');
|
10726 | var symbol$1$1$1 = symbol$3$1;
|
10727 | var symbol$2$1$1 = symbol$1$1$1;
|
10728 |
|
10729 | var _typeof_1$1$1 = createCommonjsModule$1$1(function (module) {
|
10730 | function _typeof2(obj) {
|
10731 | if (typeof symbol$2$1$1 === "function" && typeof iterator$2$1$1 === "symbol") {
|
10732 | _typeof2 = function _typeof2(obj) {
|
10733 | return typeof obj;
|
10734 | };
|
10735 | } else {
|
10736 | _typeof2 = function _typeof2(obj) {
|
10737 | return obj && typeof symbol$2$1$1 === "function" && obj.constructor === symbol$2$1$1 && obj !== symbol$2$1$1.prototype ? "symbol" : typeof obj;
|
10738 | };
|
10739 | }
|
10740 |
|
10741 | return _typeof2(obj);
|
10742 | }
|
10743 |
|
10744 | function _typeof(obj) {
|
10745 | if (typeof symbol$2$1$1 === "function" && _typeof2(iterator$2$1$1) === "symbol") {
|
10746 | module.exports = _typeof = function _typeof(obj) {
|
10747 | return _typeof2(obj);
|
10748 | };
|
10749 | } else {
|
10750 | module.exports = _typeof = function _typeof(obj) {
|
10751 | return obj && typeof symbol$2$1$1 === "function" && obj.constructor === symbol$2$1$1 && obj !== symbol$2$1$1.prototype ? "symbol" : _typeof2(obj);
|
10752 | };
|
10753 | }
|
10754 |
|
10755 | return _typeof(obj);
|
10756 | }
|
10757 |
|
10758 | module.exports = _typeof;
|
10759 | });
|
10760 |
|
10761 | var trim$4$1 = stringTrim$1.trim;
|
10762 | var nativeParseFloat = global_1$1$1.parseFloat;
|
10763 | var FORCED$3$1$1 = 1 / nativeParseFloat(whitespaces$1 + '-0') !== -Infinity;
|
10764 |
|
10765 |
|
10766 | var _parseFloat = FORCED$3$1$1 ? function parseFloat(string) {
|
10767 | var trimmedString = trim$4$1(String(string));
|
10768 | var result = nativeParseFloat(trimmedString);
|
10769 | return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;
|
10770 | } : nativeParseFloat;
|
10771 |
|
10772 |
|
10773 |
|
10774 | _export$1$1({
|
10775 | global: true,
|
10776 | forced: parseFloat != _parseFloat
|
10777 | }, {
|
10778 | parseFloat: _parseFloat
|
10779 | });
|
10780 |
|
10781 | var _parseFloat$1 = path$1$1.parseFloat;
|
10782 | var _parseFloat$2 = _parseFloat$1;
|
10783 | var _parseFloat$3 = _parseFloat$2;
|
10784 |
|
10785 |
|
10786 | _export$1$1({
|
10787 | target: 'Date',
|
10788 | stat: true
|
10789 | }, {
|
10790 | now: function now() {
|
10791 | return new Date().getTime();
|
10792 | }
|
10793 | });
|
10794 |
|
10795 | var now = path$1$1.Date.now;
|
10796 | var now$1 = now;
|
10797 | var now$2 = now$1;
|
10798 | var test$1$1$1 = [];
|
10799 | var nativeSort$1 = test$1$1$1.sort;
|
10800 |
|
10801 | var FAILS_ON_UNDEFINED$1 = fails$1$1(function () {
|
10802 | test$1$1$1.sort(undefined);
|
10803 | });
|
10804 |
|
10805 | var FAILS_ON_NULL$1 = fails$1$1(function () {
|
10806 | test$1$1$1.sort(null);
|
10807 | });
|
10808 |
|
10809 | var SLOPPY_METHOD$1$1$1 = sloppyArrayMethod$1$1('sort');
|
10810 | var FORCED$4$1 = FAILS_ON_UNDEFINED$1 || !FAILS_ON_NULL$1 || SLOPPY_METHOD$1$1$1;
|
10811 |
|
10812 |
|
10813 | _export$1$1({
|
10814 | target: 'Array',
|
10815 | proto: true,
|
10816 | forced: FORCED$4$1
|
10817 | }, {
|
10818 | sort: function sort(comparefn) {
|
10819 | return comparefn === undefined ? nativeSort$1.call(toObject$1$1(this)) : nativeSort$1.call(toObject$1$1(this), aFunction$2$1(comparefn));
|
10820 | }
|
10821 | });
|
10822 |
|
10823 | var sort$3 = entryVirtual$1$1('Array').sort;
|
10824 | var ArrayPrototype$7$1$1 = Array.prototype;
|
10825 |
|
10826 | var sort_1$1 = function (it) {
|
10827 | var own = it.sort;
|
10828 | return it === ArrayPrototype$7$1$1 || it instanceof Array && own === ArrayPrototype$7$1$1.sort ? sort$3 : own;
|
10829 | };
|
10830 |
|
10831 | var sort$1$1 = sort_1$1;
|
10832 | var sort$2$1 = sort$1$1;
|
10833 | var nativeIsFrozen = Object.isFrozen;
|
10834 | var FAILS_ON_PRIMITIVES$3$1$1 = fails$1$1(function () {
|
10835 | nativeIsFrozen(1);
|
10836 | });
|
10837 |
|
10838 |
|
10839 | _export$1$1({
|
10840 | target: 'Object',
|
10841 | stat: true,
|
10842 | forced: FAILS_ON_PRIMITIVES$3$1$1
|
10843 | }, {
|
10844 | isFrozen: function isFrozen(it) {
|
10845 | return isObject$1$1(it) ? nativeIsFrozen ? nativeIsFrozen(it) : false : true;
|
10846 | }
|
10847 | });
|
10848 |
|
10849 | var isFrozen = path$1$1.Object.isFrozen;
|
10850 | var isFrozen$1 = isFrozen;
|
10851 | var isFrozen$2 = isFrozen$1;
|
10852 | var $some$1 = arrayIteration$1$1.some;
|
10853 |
|
10854 |
|
10855 | _export$1$1({
|
10856 | target: 'Array',
|
10857 | proto: true,
|
10858 | forced: sloppyArrayMethod$1$1('some')
|
10859 | }, {
|
10860 | some: function some(callbackfn
|
10861 | /* , thisArg */
|
10862 | ) {
|
10863 | return $some$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
10864 | }
|
10865 | });
|
10866 |
|
10867 | var some$3 = entryVirtual$1$1('Array').some;
|
10868 | var ArrayPrototype$8$1 = Array.prototype;
|
10869 |
|
10870 | var some_1$1 = function (it) {
|
10871 | var own = it.some;
|
10872 | return it === ArrayPrototype$8$1 || it instanceof Array && own === ArrayPrototype$8$1.some ? some$3 : own;
|
10873 | };
|
10874 |
|
10875 | var some$1$1 = some_1$1;
|
10876 | var some$2$1 = some$1$1;
|
10877 | var nativeGetOwnPropertyNames$2$1$1 = objectGetOwnPropertyNamesExternal$1$1.f;
|
10878 | var FAILS_ON_PRIMITIVES$4 = fails$1$1(function () {
|
10879 | return !Object.getOwnPropertyNames(1);
|
10880 | });
|
10881 |
|
10882 |
|
10883 | _export$1$1({
|
10884 | target: 'Object',
|
10885 | stat: true,
|
10886 | forced: FAILS_ON_PRIMITIVES$4
|
10887 | }, {
|
10888 | getOwnPropertyNames: nativeGetOwnPropertyNames$2$1$1
|
10889 | });
|
10890 |
|
10891 | var Object$2 = path$1$1.Object;
|
10892 |
|
10893 | var getOwnPropertyNames = function getOwnPropertyNames(it) {
|
10894 | return Object$2.getOwnPropertyNames(it);
|
10895 | };
|
10896 |
|
10897 | var getOwnPropertyNames$1 = getOwnPropertyNames;
|
10898 | var getOwnPropertyNames$2 = getOwnPropertyNames$1;
|
10899 | var moment = createCommonjsModule$1$1(function (module, exports) {
|
10900 | (function (global, factory) {
|
10901 | module.exports = factory();
|
10902 | })(commonjsGlobal$1$1, function () {
|
10903 | var hookCallback;
|
10904 |
|
10905 | function hooks() {
|
10906 | return hookCallback.apply(null, arguments);
|
10907 | }
|
10908 |
|
10909 |
|
10910 |
|
10911 | function setHookCallback(callback) {
|
10912 | hookCallback = callback;
|
10913 | }
|
10914 |
|
10915 | function isArray(input) {
|
10916 | return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
|
10917 | }
|
10918 |
|
10919 | function isObject(input) {
|
10920 |
|
10921 |
|
10922 | return input != null && Object.prototype.toString.call(input) === '[object Object]';
|
10923 | }
|
10924 |
|
10925 | function isObjectEmpty(obj) {
|
10926 | if (getOwnPropertyNames$2) {
|
10927 | return getOwnPropertyNames$2(obj).length === 0;
|
10928 | } else {
|
10929 | var k;
|
10930 |
|
10931 | for (k in obj) {
|
10932 | if (obj.hasOwnProperty(k)) {
|
10933 | return false;
|
10934 | }
|
10935 | }
|
10936 |
|
10937 | return true;
|
10938 | }
|
10939 | }
|
10940 |
|
10941 | function isUndefined(input) {
|
10942 | return input === void 0;
|
10943 | }
|
10944 |
|
10945 | function isNumber(input) {
|
10946 | return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
|
10947 | }
|
10948 |
|
10949 | function isDate(input) {
|
10950 | return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
|
10951 | }
|
10952 |
|
10953 | function map(arr, fn) {
|
10954 | var res = [],
|
10955 | i;
|
10956 |
|
10957 | for (i = 0; i < arr.length; ++i) {
|
10958 | res.push(fn(arr[i], i));
|
10959 | }
|
10960 |
|
10961 | return res;
|
10962 | }
|
10963 |
|
10964 | function hasOwnProp(a, b) {
|
10965 | return Object.prototype.hasOwnProperty.call(a, b);
|
10966 | }
|
10967 |
|
10968 | function extend(a, b) {
|
10969 | for (var i in b) {
|
10970 | if (hasOwnProp(b, i)) {
|
10971 | a[i] = b[i];
|
10972 | }
|
10973 | }
|
10974 |
|
10975 | if (hasOwnProp(b, 'toString')) {
|
10976 | a.toString = b.toString;
|
10977 | }
|
10978 |
|
10979 | if (hasOwnProp(b, 'valueOf')) {
|
10980 | a.valueOf = b.valueOf;
|
10981 | }
|
10982 |
|
10983 | return a;
|
10984 | }
|
10985 |
|
10986 | function createUTC(input, format, locale, strict) {
|
10987 | return createLocalOrUTC(input, format, locale, strict, true).utc();
|
10988 | }
|
10989 |
|
10990 | function defaultParsingFlags() {
|
10991 |
|
10992 | return {
|
10993 | empty: false,
|
10994 | unusedTokens: [],
|
10995 | unusedInput: [],
|
10996 | overflow: -2,
|
10997 | charsLeftOver: 0,
|
10998 | nullInput: false,
|
10999 | invalidMonth: null,
|
11000 | invalidFormat: false,
|
11001 | userInvalidated: false,
|
11002 | iso: false,
|
11003 | parsedDateParts: [],
|
11004 | meridiem: null,
|
11005 | rfc2822: false,
|
11006 | weekdayMismatch: false
|
11007 | };
|
11008 | }
|
11009 |
|
11010 | function getParsingFlags(m) {
|
11011 | if (m._pf == null) {
|
11012 | m._pf = defaultParsingFlags();
|
11013 | }
|
11014 |
|
11015 | return m._pf;
|
11016 | }
|
11017 |
|
11018 | var some;
|
11019 |
|
11020 | if (some$2$1(Array.prototype)) {
|
11021 | some = some$2$1(Array.prototype);
|
11022 | } else {
|
11023 | some = function some(fun) {
|
11024 | var t = Object(this);
|
11025 | var len = t.length >>> 0;
|
11026 |
|
11027 | for (var i = 0; i < len; i++) {
|
11028 | if (i in t && fun.call(this, t[i], i, t)) {
|
11029 | return true;
|
11030 | }
|
11031 | }
|
11032 |
|
11033 | return false;
|
11034 | };
|
11035 | }
|
11036 |
|
11037 | function isValid(m) {
|
11038 | if (m._isValid == null) {
|
11039 | var flags = getParsingFlags(m);
|
11040 | var parsedParts = some.call(flags.parsedDateParts, function (i) {
|
11041 | return i != null;
|
11042 | });
|
11043 | var isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
|
11044 |
|
11045 | if (m._strict) {
|
11046 | isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined;
|
11047 | }
|
11048 |
|
11049 | if (isFrozen$2 == null || !isFrozen$2(m)) {
|
11050 | m._isValid = isNowValid;
|
11051 | } else {
|
11052 | return isNowValid;
|
11053 | }
|
11054 | }
|
11055 |
|
11056 | return m._isValid;
|
11057 | }
|
11058 |
|
11059 | function createInvalid(flags) {
|
11060 | var m = createUTC(NaN);
|
11061 |
|
11062 | if (flags != null) {
|
11063 | extend(getParsingFlags(m), flags);
|
11064 | } else {
|
11065 | getParsingFlags(m).userInvalidated = true;
|
11066 | }
|
11067 |
|
11068 | return m;
|
11069 | }
|
11070 |
|
11071 |
|
11072 |
|
11073 | var momentProperties = hooks.momentProperties = [];
|
11074 |
|
11075 | function copyConfig(to, from) {
|
11076 | var i, prop, val;
|
11077 |
|
11078 | if (!isUndefined(from._isAMomentObject)) {
|
11079 | to._isAMomentObject = from._isAMomentObject;
|
11080 | }
|
11081 |
|
11082 | if (!isUndefined(from._i)) {
|
11083 | to._i = from._i;
|
11084 | }
|
11085 |
|
11086 | if (!isUndefined(from._f)) {
|
11087 | to._f = from._f;
|
11088 | }
|
11089 |
|
11090 | if (!isUndefined(from._l)) {
|
11091 | to._l = from._l;
|
11092 | }
|
11093 |
|
11094 | if (!isUndefined(from._strict)) {
|
11095 | to._strict = from._strict;
|
11096 | }
|
11097 |
|
11098 | if (!isUndefined(from._tzm)) {
|
11099 | to._tzm = from._tzm;
|
11100 | }
|
11101 |
|
11102 | if (!isUndefined(from._isUTC)) {
|
11103 | to._isUTC = from._isUTC;
|
11104 | }
|
11105 |
|
11106 | if (!isUndefined(from._offset)) {
|
11107 | to._offset = from._offset;
|
11108 | }
|
11109 |
|
11110 | if (!isUndefined(from._pf)) {
|
11111 | to._pf = getParsingFlags(from);
|
11112 | }
|
11113 |
|
11114 | if (!isUndefined(from._locale)) {
|
11115 | to._locale = from._locale;
|
11116 | }
|
11117 |
|
11118 | if (momentProperties.length > 0) {
|
11119 | for (i = 0; i < momentProperties.length; i++) {
|
11120 | prop = momentProperties[i];
|
11121 | val = from[prop];
|
11122 |
|
11123 | if (!isUndefined(val)) {
|
11124 | to[prop] = val;
|
11125 | }
|
11126 | }
|
11127 | }
|
11128 |
|
11129 | return to;
|
11130 | }
|
11131 |
|
11132 | var updateInProgress = false;
|
11133 |
|
11134 | function Moment(config) {
|
11135 | copyConfig(this, config);
|
11136 | this._d = new Date(config._d != null ? config._d.getTime() : NaN);
|
11137 |
|
11138 | if (!this.isValid()) {
|
11139 | this._d = new Date(NaN);
|
11140 | }
|
11141 |
|
11142 |
|
11143 |
|
11144 | if (updateInProgress === false) {
|
11145 | updateInProgress = true;
|
11146 | hooks.updateOffset(this);
|
11147 | updateInProgress = false;
|
11148 | }
|
11149 | }
|
11150 |
|
11151 | function isMoment(obj) {
|
11152 | return obj instanceof Moment || obj != null && obj._isAMomentObject != null;
|
11153 | }
|
11154 |
|
11155 | function absFloor(number) {
|
11156 | if (number < 0) {
|
11157 |
|
11158 | return Math.ceil(number) || 0;
|
11159 | } else {
|
11160 | return Math.floor(number);
|
11161 | }
|
11162 | }
|
11163 |
|
11164 | function toInt(argumentForCoercion) {
|
11165 | var coercedNumber = +argumentForCoercion,
|
11166 | value = 0;
|
11167 |
|
11168 | if (coercedNumber !== 0 && isFinite(coercedNumber)) {
|
11169 | value = absFloor(coercedNumber);
|
11170 | }
|
11171 |
|
11172 | return value;
|
11173 | }
|
11174 |
|
11175 |
|
11176 | function compareArrays(array1, array2, dontConvert) {
|
11177 | var len = Math.min(array1.length, array2.length),
|
11178 | lengthDiff = Math.abs(array1.length - array2.length),
|
11179 | diffs = 0,
|
11180 | i;
|
11181 |
|
11182 | for (i = 0; i < len; i++) {
|
11183 | if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) {
|
11184 | diffs++;
|
11185 | }
|
11186 | }
|
11187 |
|
11188 | return diffs + lengthDiff;
|
11189 | }
|
11190 |
|
11191 | function warn(msg) {
|
11192 | if (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {
|
11193 | console.warn('Deprecation warning: ' + msg);
|
11194 | }
|
11195 | }
|
11196 |
|
11197 | function deprecate(msg, fn) {
|
11198 | var firstTime = true;
|
11199 | return extend(function () {
|
11200 | if (hooks.deprecationHandler != null) {
|
11201 | hooks.deprecationHandler(null, msg);
|
11202 | }
|
11203 |
|
11204 | if (firstTime) {
|
11205 | var args = [];
|
11206 | var arg;
|
11207 |
|
11208 | for (var i = 0; i < arguments.length; i++) {
|
11209 | arg = '';
|
11210 |
|
11211 | if (_typeof_1$1$1(arguments[i]) === 'object') {
|
11212 | arg += '\n[' + i + '] ';
|
11213 |
|
11214 | for (var key in arguments[0]) {
|
11215 | arg += key + ': ' + arguments[0][key] + ', ';
|
11216 | }
|
11217 |
|
11218 | arg = slice$2$1(arg).call(arg, 0, -2);
|
11219 | } else {
|
11220 | arg = arguments[i];
|
11221 | }
|
11222 |
|
11223 | args.push(arg);
|
11224 | }
|
11225 |
|
11226 | warn(msg + '\nArguments: ' + slice$2$1(Array.prototype).call(args).join('') + '\n' + new Error().stack);
|
11227 | firstTime = false;
|
11228 | }
|
11229 |
|
11230 | return fn.apply(this, arguments);
|
11231 | }, fn);
|
11232 | }
|
11233 |
|
11234 | var deprecations = {};
|
11235 |
|
11236 | function deprecateSimple(name, msg) {
|
11237 | if (hooks.deprecationHandler != null) {
|
11238 | hooks.deprecationHandler(name, msg);
|
11239 | }
|
11240 |
|
11241 | if (!deprecations[name]) {
|
11242 | warn(msg);
|
11243 | deprecations[name] = true;
|
11244 | }
|
11245 | }
|
11246 |
|
11247 | hooks.suppressDeprecationWarnings = false;
|
11248 | hooks.deprecationHandler = null;
|
11249 |
|
11250 | function isFunction(input) {
|
11251 | return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
|
11252 | }
|
11253 |
|
11254 | function set(config) {
|
11255 | var prop, i;
|
11256 |
|
11257 | for (i in config) {
|
11258 | prop = config[i];
|
11259 |
|
11260 | if (isFunction(prop)) {
|
11261 | this[i] = prop;
|
11262 | } else {
|
11263 | this['_' + i] = prop;
|
11264 | }
|
11265 | }
|
11266 |
|
11267 | this._config = config;
|
11268 |
|
11269 |
|
11270 |
|
11271 | this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\d{1,2}/.source);
|
11272 | }
|
11273 |
|
11274 | function mergeConfigs(parentConfig, childConfig) {
|
11275 | var res = extend({}, parentConfig),
|
11276 | prop;
|
11277 |
|
11278 | for (prop in childConfig) {
|
11279 | if (hasOwnProp(childConfig, prop)) {
|
11280 | if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
|
11281 | res[prop] = {};
|
11282 | extend(res[prop], parentConfig[prop]);
|
11283 | extend(res[prop], childConfig[prop]);
|
11284 | } else if (childConfig[prop] != null) {
|
11285 | res[prop] = childConfig[prop];
|
11286 | } else {
|
11287 | delete res[prop];
|
11288 | }
|
11289 | }
|
11290 | }
|
11291 |
|
11292 | for (prop in parentConfig) {
|
11293 | if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {
|
11294 |
|
11295 | res[prop] = extend({}, res[prop]);
|
11296 | }
|
11297 | }
|
11298 |
|
11299 | return res;
|
11300 | }
|
11301 |
|
11302 | function Locale(config) {
|
11303 | if (config != null) {
|
11304 | this.set(config);
|
11305 | }
|
11306 | }
|
11307 |
|
11308 | var keys;
|
11309 |
|
11310 | if (keys$3$1$1) {
|
11311 | keys = keys$3$1$1;
|
11312 | } else {
|
11313 | keys = function keys(obj) {
|
11314 | var i,
|
11315 | res = [];
|
11316 |
|
11317 | for (i in obj) {
|
11318 | if (hasOwnProp(obj, i)) {
|
11319 | res.push(i);
|
11320 | }
|
11321 | }
|
11322 |
|
11323 | return res;
|
11324 | };
|
11325 | }
|
11326 |
|
11327 | var defaultCalendar = {
|
11328 | sameDay: '[Today at] LT',
|
11329 | nextDay: '[Tomorrow at] LT',
|
11330 | nextWeek: 'dddd [at] LT',
|
11331 | lastDay: '[Yesterday at] LT',
|
11332 | lastWeek: '[Last] dddd [at] LT',
|
11333 | sameElse: 'L'
|
11334 | };
|
11335 |
|
11336 | function calendar(key, mom, now) {
|
11337 | var output = this._calendar[key] || this._calendar['sameElse'];
|
11338 | return isFunction(output) ? output.call(mom, now) : output;
|
11339 | }
|
11340 |
|
11341 | var defaultLongDateFormat = {
|
11342 | LTS: 'h:mm:ss A',
|
11343 | LT: 'h:mm A',
|
11344 | L: 'MM/DD/YYYY',
|
11345 | LL: 'MMMM D, YYYY',
|
11346 | LLL: 'MMMM D, YYYY h:mm A',
|
11347 | LLLL: 'dddd, MMMM D, YYYY h:mm A'
|
11348 | };
|
11349 |
|
11350 | function longDateFormat(key) {
|
11351 | var format = this._longDateFormat[key],
|
11352 | formatUpper = this._longDateFormat[key.toUpperCase()];
|
11353 |
|
11354 | if (format || !formatUpper) {
|
11355 | return format;
|
11356 | }
|
11357 |
|
11358 | this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
|
11359 | return slice$2$1(val).call(val, 1);
|
11360 | });
|
11361 | return this._longDateFormat[key];
|
11362 | }
|
11363 |
|
11364 | var defaultInvalidDate = 'Invalid date';
|
11365 |
|
11366 | function invalidDate() {
|
11367 | return this._invalidDate;
|
11368 | }
|
11369 |
|
11370 | var defaultOrdinal = '%d';
|
11371 | var defaultDayOfMonthOrdinalParse = /\d{1,2}/;
|
11372 |
|
11373 | function ordinal(number) {
|
11374 | return this._ordinal.replace('%d', number);
|
11375 | }
|
11376 |
|
11377 | var defaultRelativeTime = {
|
11378 | future: 'in %s',
|
11379 | past: '%s ago',
|
11380 | s: 'a few seconds',
|
11381 | ss: '%d seconds',
|
11382 | m: 'a minute',
|
11383 | mm: '%d minutes',
|
11384 | h: 'an hour',
|
11385 | hh: '%d hours',
|
11386 | d: 'a day',
|
11387 | dd: '%d days',
|
11388 | M: 'a month',
|
11389 | MM: '%d months',
|
11390 | y: 'a year',
|
11391 | yy: '%d years'
|
11392 | };
|
11393 |
|
11394 | function relativeTime(number, withoutSuffix, string, isFuture) {
|
11395 | var output = this._relativeTime[string];
|
11396 | return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
|
11397 | }
|
11398 |
|
11399 | function pastFuture(diff, output) {
|
11400 | var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
|
11401 | return isFunction(format) ? format(output) : format.replace(/%s/i, output);
|
11402 | }
|
11403 |
|
11404 | var aliases = {};
|
11405 |
|
11406 | function addUnitAlias(unit, shorthand) {
|
11407 | var lowerCase = unit.toLowerCase();
|
11408 | aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
|
11409 | }
|
11410 |
|
11411 | function normalizeUnits(units) {
|
11412 | return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
|
11413 | }
|
11414 |
|
11415 | function normalizeObjectUnits(inputObject) {
|
11416 | var normalizedInput = {},
|
11417 | normalizedProp,
|
11418 | prop;
|
11419 |
|
11420 | for (prop in inputObject) {
|
11421 | if (hasOwnProp(inputObject, prop)) {
|
11422 | normalizedProp = normalizeUnits(prop);
|
11423 |
|
11424 | if (normalizedProp) {
|
11425 | normalizedInput[normalizedProp] = inputObject[prop];
|
11426 | }
|
11427 | }
|
11428 | }
|
11429 |
|
11430 | return normalizedInput;
|
11431 | }
|
11432 |
|
11433 | var priorities = {};
|
11434 |
|
11435 | function addUnitPriority(unit, priority) {
|
11436 | priorities[unit] = priority;
|
11437 | }
|
11438 |
|
11439 | function getPrioritizedUnits(unitsObj) {
|
11440 | var units = [];
|
11441 |
|
11442 | for (var u in unitsObj) {
|
11443 | units.push({
|
11444 | unit: u,
|
11445 | priority: priorities[u]
|
11446 | });
|
11447 | }
|
11448 |
|
11449 | sort$2$1(units).call(units, function (a, b) {
|
11450 | return a.priority - b.priority;
|
11451 | });
|
11452 | return units;
|
11453 | }
|
11454 |
|
11455 | function zeroFill(number, targetLength, forceSign) {
|
11456 | var absNumber = '' + Math.abs(number),
|
11457 | zerosToFill = targetLength - absNumber.length,
|
11458 | sign = number >= 0;
|
11459 | return (sign ? forceSign ? '+' : '' : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
|
11460 | }
|
11461 |
|
11462 | var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
|
11463 | var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
|
11464 | var formatFunctions = {};
|
11465 | var formatTokenFunctions = {};
|
11466 |
|
11467 |
|
11468 |
|
11469 |
|
11470 | function addFormatToken(token, padded, ordinal, callback) {
|
11471 | var func = callback;
|
11472 |
|
11473 | if (typeof callback === 'string') {
|
11474 | func = function func() {
|
11475 | return this[callback]();
|
11476 | };
|
11477 | }
|
11478 |
|
11479 | if (token) {
|
11480 | formatTokenFunctions[token] = func;
|
11481 | }
|
11482 |
|
11483 | if (padded) {
|
11484 | formatTokenFunctions[padded[0]] = function () {
|
11485 | return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
|
11486 | };
|
11487 | }
|
11488 |
|
11489 | if (ordinal) {
|
11490 | formatTokenFunctions[ordinal] = function () {
|
11491 | return this.localeData().ordinal(func.apply(this, arguments), token);
|
11492 | };
|
11493 | }
|
11494 | }
|
11495 |
|
11496 | function removeFormattingTokens(input) {
|
11497 | if (input.match(/\[[\s\S]/)) {
|
11498 | return input.replace(/^\[|\]$/g, '');
|
11499 | }
|
11500 |
|
11501 | return input.replace(/\\/g, '');
|
11502 | }
|
11503 |
|
11504 | function makeFormatFunction(format) {
|
11505 | var array = format.match(formattingTokens),
|
11506 | i,
|
11507 | length;
|
11508 |
|
11509 | for (i = 0, length = array.length; i < length; i++) {
|
11510 | if (formatTokenFunctions[array[i]]) {
|
11511 | array[i] = formatTokenFunctions[array[i]];
|
11512 | } else {
|
11513 | array[i] = removeFormattingTokens(array[i]);
|
11514 | }
|
11515 | }
|
11516 |
|
11517 | return function (mom) {
|
11518 | var output = '',
|
11519 | i;
|
11520 |
|
11521 | for (i = 0; i < length; i++) {
|
11522 | output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];
|
11523 | }
|
11524 |
|
11525 | return output;
|
11526 | };
|
11527 | }
|
11528 |
|
11529 |
|
11530 | function formatMoment(m, format) {
|
11531 | if (!m.isValid()) {
|
11532 | return m.localeData().invalidDate();
|
11533 | }
|
11534 |
|
11535 | format = expandFormat(format, m.localeData());
|
11536 | formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
|
11537 | return formatFunctions[format](m);
|
11538 | }
|
11539 |
|
11540 | function expandFormat(format, locale) {
|
11541 | var i = 5;
|
11542 |
|
11543 | function replaceLongDateFormatTokens(input) {
|
11544 | return locale.longDateFormat(input) || input;
|
11545 | }
|
11546 |
|
11547 | localFormattingTokens.lastIndex = 0;
|
11548 |
|
11549 | while (i >= 0 && localFormattingTokens.test(format)) {
|
11550 | format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
|
11551 | localFormattingTokens.lastIndex = 0;
|
11552 | i -= 1;
|
11553 | }
|
11554 |
|
11555 | return format;
|
11556 | }
|
11557 |
|
11558 | var match1 = /\d/;
|
11559 |
|
11560 | var match2 = /\d\d/;
|
11561 |
|
11562 | var match3 = /\d{3}/;
|
11563 |
|
11564 | var match4 = /\d{4}/;
|
11565 |
|
11566 | var match6 = /[+-]?\d{6}/;
|
11567 |
|
11568 | var match1to2 = /\d\d?/;
|
11569 |
|
11570 | var match3to4 = /\d\d\d\d?/;
|
11571 |
|
11572 | var match5to6 = /\d\d\d\d\d\d?/;
|
11573 |
|
11574 | var match1to3 = /\d{1,3}/;
|
11575 |
|
11576 | var match1to4 = /\d{1,4}/;
|
11577 |
|
11578 | var match1to6 = /[+-]?\d{1,6}/;
|
11579 |
|
11580 | var matchUnsigned = /\d+/;
|
11581 |
|
11582 | var matchSigned = /[+-]?\d+/;
|
11583 |
|
11584 | var matchOffset = /Z|[+-]\d\d:?\d\d/gi;
|
11585 |
|
11586 | var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi;
|
11587 |
|
11588 | var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/;
|
11589 |
|
11590 |
|
11591 |
|
11592 | var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
|
11593 | var regexes = {};
|
11594 |
|
11595 | function addRegexToken(token, regex, strictRegex) {
|
11596 | regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
|
11597 | return isStrict && strictRegex ? strictRegex : regex;
|
11598 | };
|
11599 | }
|
11600 |
|
11601 | function getParseRegexForToken(token, config) {
|
11602 | if (!hasOwnProp(regexes, token)) {
|
11603 | return new RegExp(unescapeFormat(token));
|
11604 | }
|
11605 |
|
11606 | return regexes[token](config._strict, config._locale);
|
11607 | }
|
11608 |
|
11609 |
|
11610 | function unescapeFormat(s) {
|
11611 | return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
|
11612 | return p1 || p2 || p3 || p4;
|
11613 | }));
|
11614 | }
|
11615 |
|
11616 | function regexEscape(s) {
|
11617 | return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
11618 | }
|
11619 |
|
11620 | var tokens = {};
|
11621 |
|
11622 | function addParseToken(token, callback) {
|
11623 | var i,
|
11624 | func = callback;
|
11625 |
|
11626 | if (typeof token === 'string') {
|
11627 | token = [token];
|
11628 | }
|
11629 |
|
11630 | if (isNumber(callback)) {
|
11631 | func = function func(input, array) {
|
11632 | array[callback] = toInt(input);
|
11633 | };
|
11634 | }
|
11635 |
|
11636 | for (i = 0; i < token.length; i++) {
|
11637 | tokens[token[i]] = func;
|
11638 | }
|
11639 | }
|
11640 |
|
11641 | function addWeekParseToken(token, callback) {
|
11642 | addParseToken(token, function (input, array, config, token) {
|
11643 | config._w = config._w || {};
|
11644 | callback(input, config._w, config, token);
|
11645 | });
|
11646 | }
|
11647 |
|
11648 | function addTimeToArrayFromToken(token, input, config) {
|
11649 | if (input != null && hasOwnProp(tokens, token)) {
|
11650 | tokens[token](input, config._a, config, token);
|
11651 | }
|
11652 | }
|
11653 |
|
11654 | var YEAR = 0;
|
11655 | var MONTH = 1;
|
11656 | var DATE = 2;
|
11657 | var HOUR = 3;
|
11658 | var MINUTE = 4;
|
11659 | var SECOND = 5;
|
11660 | var MILLISECOND = 6;
|
11661 | var WEEK = 7;
|
11662 | var WEEKDAY = 8;
|
11663 |
|
11664 | addFormatToken('Y', 0, 0, function () {
|
11665 | var y = this.year();
|
11666 | return y <= 9999 ? '' + y : '+' + y;
|
11667 | });
|
11668 | addFormatToken(0, ['YY', 2], 0, function () {
|
11669 | return this.year() % 100;
|
11670 | });
|
11671 | addFormatToken(0, ['YYYY', 4], 0, 'year');
|
11672 | addFormatToken(0, ['YYYYY', 5], 0, 'year');
|
11673 | addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
|
11674 |
|
11675 | addUnitAlias('year', 'y');
|
11676 |
|
11677 | addUnitPriority('year', 1);
|
11678 |
|
11679 | addRegexToken('Y', matchSigned);
|
11680 | addRegexToken('YY', match1to2, match2);
|
11681 | addRegexToken('YYYY', match1to4, match4);
|
11682 | addRegexToken('YYYYY', match1to6, match6);
|
11683 | addRegexToken('YYYYYY', match1to6, match6);
|
11684 | addParseToken(['YYYYY', 'YYYYYY'], YEAR);
|
11685 | addParseToken('YYYY', function (input, array) {
|
11686 | array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
|
11687 | });
|
11688 | addParseToken('YY', function (input, array) {
|
11689 | array[YEAR] = hooks.parseTwoDigitYear(input);
|
11690 | });
|
11691 | addParseToken('Y', function (input, array) {
|
11692 | array[YEAR] = _parseInt$3$1(input, 10);
|
11693 | });
|
11694 |
|
11695 | function daysInYear(year) {
|
11696 | return isLeapYear(year) ? 366 : 365;
|
11697 | }
|
11698 |
|
11699 | function isLeapYear(year) {
|
11700 | return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
11701 | }
|
11702 |
|
11703 |
|
11704 | hooks.parseTwoDigitYear = function (input) {
|
11705 | return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
|
11706 | };
|
11707 |
|
11708 |
|
11709 | var getSetYear = makeGetSet('FullYear', true);
|
11710 |
|
11711 | function getIsLeapYear() {
|
11712 | return isLeapYear(this.year());
|
11713 | }
|
11714 |
|
11715 | function makeGetSet(unit, keepTime) {
|
11716 | return function (value) {
|
11717 | if (value != null) {
|
11718 | set$1(this, unit, value);
|
11719 | hooks.updateOffset(this, keepTime);
|
11720 | return this;
|
11721 | } else {
|
11722 | return get(this, unit);
|
11723 | }
|
11724 | };
|
11725 | }
|
11726 |
|
11727 | function get(mom, unit) {
|
11728 | return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
|
11729 | }
|
11730 |
|
11731 | function set$1(mom, unit, value) {
|
11732 | if (mom.isValid() && !isNaN(value)) {
|
11733 | if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
|
11734 | mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
|
11735 | } else {
|
11736 | mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
|
11737 | }
|
11738 | }
|
11739 | }
|
11740 |
|
11741 |
|
11742 | function stringGet(units) {
|
11743 | units = normalizeUnits(units);
|
11744 |
|
11745 | if (isFunction(this[units])) {
|
11746 | return this[units]();
|
11747 | }
|
11748 |
|
11749 | return this;
|
11750 | }
|
11751 |
|
11752 | function stringSet(units, value) {
|
11753 | if (_typeof_1$1$1(units) === 'object') {
|
11754 | units = normalizeObjectUnits(units);
|
11755 | var prioritized = getPrioritizedUnits(units);
|
11756 |
|
11757 | for (var i = 0; i < prioritized.length; i++) {
|
11758 | this[prioritized[i].unit](units[prioritized[i].unit]);
|
11759 | }
|
11760 | } else {
|
11761 | units = normalizeUnits(units);
|
11762 |
|
11763 | if (isFunction(this[units])) {
|
11764 | return this[units](value);
|
11765 | }
|
11766 | }
|
11767 |
|
11768 | return this;
|
11769 | }
|
11770 |
|
11771 | function mod(n, x) {
|
11772 | return (n % x + x) % x;
|
11773 | }
|
11774 |
|
11775 | var indexOf;
|
11776 |
|
11777 | if (indexOf$3$1(Array.prototype)) {
|
11778 | indexOf = indexOf$3$1(Array.prototype);
|
11779 | } else {
|
11780 | indexOf = function indexOf(o) {
|
11781 |
|
11782 | var i;
|
11783 |
|
11784 | for (i = 0; i < this.length; ++i) {
|
11785 | if (this[i] === o) {
|
11786 | return i;
|
11787 | }
|
11788 | }
|
11789 |
|
11790 | return -1;
|
11791 | };
|
11792 | }
|
11793 |
|
11794 | function daysInMonth(year, month) {
|
11795 | if (isNaN(year) || isNaN(month)) {
|
11796 | return NaN;
|
11797 | }
|
11798 |
|
11799 | var modMonth = mod(month, 12);
|
11800 | year += (month - modMonth) / 12;
|
11801 | return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
|
11802 | }
|
11803 |
|
11804 |
|
11805 | addFormatToken('M', ['MM', 2], 'Mo', function () {
|
11806 | return this.month() + 1;
|
11807 | });
|
11808 | addFormatToken('MMM', 0, 0, function (format) {
|
11809 | return this.localeData().monthsShort(this, format);
|
11810 | });
|
11811 | addFormatToken('MMMM', 0, 0, function (format) {
|
11812 | return this.localeData().months(this, format);
|
11813 | });
|
11814 |
|
11815 | addUnitAlias('month', 'M');
|
11816 |
|
11817 | addUnitPriority('month', 8);
|
11818 |
|
11819 | addRegexToken('M', match1to2);
|
11820 | addRegexToken('MM', match1to2, match2);
|
11821 | addRegexToken('MMM', function (isStrict, locale) {
|
11822 | return locale.monthsShortRegex(isStrict);
|
11823 | });
|
11824 | addRegexToken('MMMM', function (isStrict, locale) {
|
11825 | return locale.monthsRegex(isStrict);
|
11826 | });
|
11827 | addParseToken(['M', 'MM'], function (input, array) {
|
11828 | array[MONTH] = toInt(input) - 1;
|
11829 | });
|
11830 | addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
|
11831 | var month = config._locale.monthsParse(input, token, config._strict);
|
11832 |
|
11833 |
|
11834 | if (month != null) {
|
11835 | array[MONTH] = month;
|
11836 | } else {
|
11837 | getParsingFlags(config).invalidMonth = input;
|
11838 | }
|
11839 | });
|
11840 |
|
11841 | var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
|
11842 | var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
|
11843 |
|
11844 | function localeMonths(m, format) {
|
11845 | if (!m) {
|
11846 | return isArray(this._months) ? this._months : this._months['standalone'];
|
11847 | }
|
11848 |
|
11849 | return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
|
11850 | }
|
11851 |
|
11852 | var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
|
11853 |
|
11854 | function localeMonthsShort(m, format) {
|
11855 | if (!m) {
|
11856 | return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone'];
|
11857 | }
|
11858 |
|
11859 | return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
|
11860 | }
|
11861 |
|
11862 | function handleStrictParse(monthName, format, strict) {
|
11863 | var i,
|
11864 | ii,
|
11865 | mom,
|
11866 | llc = monthName.toLocaleLowerCase();
|
11867 |
|
11868 | if (!this._monthsParse) {
|
11869 |
|
11870 | this._monthsParse = [];
|
11871 | this._longMonthsParse = [];
|
11872 | this._shortMonthsParse = [];
|
11873 |
|
11874 | for (i = 0; i < 12; ++i) {
|
11875 | mom = createUTC([2000, i]);
|
11876 | this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
|
11877 | this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
|
11878 | }
|
11879 | }
|
11880 |
|
11881 | if (strict) {
|
11882 | if (format === 'MMM') {
|
11883 | ii = indexOf.call(this._shortMonthsParse, llc);
|
11884 | return ii !== -1 ? ii : null;
|
11885 | } else {
|
11886 | ii = indexOf.call(this._longMonthsParse, llc);
|
11887 | return ii !== -1 ? ii : null;
|
11888 | }
|
11889 | } else {
|
11890 | if (format === 'MMM') {
|
11891 | ii = indexOf.call(this._shortMonthsParse, llc);
|
11892 |
|
11893 | if (ii !== -1) {
|
11894 | return ii;
|
11895 | }
|
11896 |
|
11897 | ii = indexOf.call(this._longMonthsParse, llc);
|
11898 | return ii !== -1 ? ii : null;
|
11899 | } else {
|
11900 | ii = indexOf.call(this._longMonthsParse, llc);
|
11901 |
|
11902 | if (ii !== -1) {
|
11903 | return ii;
|
11904 | }
|
11905 |
|
11906 | ii = indexOf.call(this._shortMonthsParse, llc);
|
11907 | return ii !== -1 ? ii : null;
|
11908 | }
|
11909 | }
|
11910 | }
|
11911 |
|
11912 | function localeMonthsParse(monthName, format, strict) {
|
11913 | var i, mom, regex;
|
11914 |
|
11915 | if (this._monthsParseExact) {
|
11916 | return handleStrictParse.call(this, monthName, format, strict);
|
11917 | }
|
11918 |
|
11919 | if (!this._monthsParse) {
|
11920 | this._monthsParse = [];
|
11921 | this._longMonthsParse = [];
|
11922 | this._shortMonthsParse = [];
|
11923 | }
|
11924 |
|
11925 |
|
11926 |
|
11927 |
|
11928 | for (i = 0; i < 12; i++) {
|
11929 |
|
11930 | mom = createUTC([2000, i]);
|
11931 |
|
11932 | if (strict && !this._longMonthsParse[i]) {
|
11933 | this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
|
11934 | this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
|
11935 | }
|
11936 |
|
11937 | if (!strict && !this._monthsParse[i]) {
|
11938 | regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
|
11939 | this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
|
11940 | }
|
11941 |
|
11942 |
|
11943 | if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
|
11944 | return i;
|
11945 | } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
|
11946 | return i;
|
11947 | } else if (!strict && this._monthsParse[i].test(monthName)) {
|
11948 | return i;
|
11949 | }
|
11950 | }
|
11951 | }
|
11952 |
|
11953 |
|
11954 | function setMonth(mom, value) {
|
11955 | var dayOfMonth;
|
11956 |
|
11957 | if (!mom.isValid()) {
|
11958 |
|
11959 | return mom;
|
11960 | }
|
11961 |
|
11962 | if (typeof value === 'string') {
|
11963 | if (/^\d+$/.test(value)) {
|
11964 | value = toInt(value);
|
11965 | } else {
|
11966 | value = mom.localeData().monthsParse(value);
|
11967 |
|
11968 | if (!isNumber(value)) {
|
11969 | return mom;
|
11970 | }
|
11971 | }
|
11972 | }
|
11973 |
|
11974 | dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
|
11975 |
|
11976 | mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
|
11977 |
|
11978 | return mom;
|
11979 | }
|
11980 |
|
11981 | function getSetMonth(value) {
|
11982 | if (value != null) {
|
11983 | setMonth(this, value);
|
11984 | hooks.updateOffset(this, true);
|
11985 | return this;
|
11986 | } else {
|
11987 | return get(this, 'Month');
|
11988 | }
|
11989 | }
|
11990 |
|
11991 | function getDaysInMonth() {
|
11992 | return daysInMonth(this.year(), this.month());
|
11993 | }
|
11994 |
|
11995 | var defaultMonthsShortRegex = matchWord;
|
11996 |
|
11997 | function monthsShortRegex(isStrict) {
|
11998 | if (this._monthsParseExact) {
|
11999 | if (!hasOwnProp(this, '_monthsRegex')) {
|
12000 | computeMonthsParse.call(this);
|
12001 | }
|
12002 |
|
12003 | if (isStrict) {
|
12004 | return this._monthsShortStrictRegex;
|
12005 | } else {
|
12006 | return this._monthsShortRegex;
|
12007 | }
|
12008 | } else {
|
12009 | if (!hasOwnProp(this, '_monthsShortRegex')) {
|
12010 | this._monthsShortRegex = defaultMonthsShortRegex;
|
12011 | }
|
12012 |
|
12013 | return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;
|
12014 | }
|
12015 | }
|
12016 |
|
12017 | var defaultMonthsRegex = matchWord;
|
12018 |
|
12019 | function monthsRegex(isStrict) {
|
12020 | if (this._monthsParseExact) {
|
12021 | if (!hasOwnProp(this, '_monthsRegex')) {
|
12022 | computeMonthsParse.call(this);
|
12023 | }
|
12024 |
|
12025 | if (isStrict) {
|
12026 | return this._monthsStrictRegex;
|
12027 | } else {
|
12028 | return this._monthsRegex;
|
12029 | }
|
12030 | } else {
|
12031 | if (!hasOwnProp(this, '_monthsRegex')) {
|
12032 | this._monthsRegex = defaultMonthsRegex;
|
12033 | }
|
12034 |
|
12035 | return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;
|
12036 | }
|
12037 | }
|
12038 |
|
12039 | function computeMonthsParse() {
|
12040 | function cmpLenRev(a, b) {
|
12041 | return b.length - a.length;
|
12042 | }
|
12043 |
|
12044 | var shortPieces = [],
|
12045 | longPieces = [],
|
12046 | mixedPieces = [],
|
12047 | i,
|
12048 | mom;
|
12049 |
|
12050 | for (i = 0; i < 12; i++) {
|
12051 |
|
12052 | mom = createUTC([2000, i]);
|
12053 | shortPieces.push(this.monthsShort(mom, ''));
|
12054 | longPieces.push(this.months(mom, ''));
|
12055 | mixedPieces.push(this.months(mom, ''));
|
12056 | mixedPieces.push(this.monthsShort(mom, ''));
|
12057 | }
|
12058 |
|
12059 |
|
12060 |
|
12061 | sort$2$1(shortPieces).call(shortPieces, cmpLenRev);
|
12062 | sort$2$1(longPieces).call(longPieces, cmpLenRev);
|
12063 | sort$2$1(mixedPieces).call(mixedPieces, cmpLenRev);
|
12064 |
|
12065 | for (i = 0; i < 12; i++) {
|
12066 | shortPieces[i] = regexEscape(shortPieces[i]);
|
12067 | longPieces[i] = regexEscape(longPieces[i]);
|
12068 | }
|
12069 |
|
12070 | for (i = 0; i < 24; i++) {
|
12071 | mixedPieces[i] = regexEscape(mixedPieces[i]);
|
12072 | }
|
12073 |
|
12074 | this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
12075 | this._monthsShortRegex = this._monthsRegex;
|
12076 | this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
|
12077 | this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
|
12078 | }
|
12079 |
|
12080 | function createDate(y, m, d, h, M, s, ms) {
|
12081 |
|
12082 |
|
12083 | var date;
|
12084 |
|
12085 | if (y < 100 && y >= 0) {
|
12086 |
|
12087 | date = new Date(y + 400, m, d, h, M, s, ms);
|
12088 |
|
12089 | if (isFinite(date.getFullYear())) {
|
12090 | date.setFullYear(y);
|
12091 | }
|
12092 | } else {
|
12093 | date = new Date(y, m, d, h, M, s, ms);
|
12094 | }
|
12095 |
|
12096 | return date;
|
12097 | }
|
12098 |
|
12099 | function createUTCDate(y) {
|
12100 | var date;
|
12101 |
|
12102 | if (y < 100 && y >= 0) {
|
12103 | var args = slice$2$1(Array.prototype).call(arguments);
|
12104 |
|
12105 | args[0] = y + 400;
|
12106 | date = new Date(Date.UTC.apply(null, args));
|
12107 |
|
12108 | if (isFinite(date.getUTCFullYear())) {
|
12109 | date.setUTCFullYear(y);
|
12110 | }
|
12111 | } else {
|
12112 | date = new Date(Date.UTC.apply(null, arguments));
|
12113 | }
|
12114 |
|
12115 | return date;
|
12116 | }
|
12117 |
|
12118 |
|
12119 | function firstWeekOffset(year, dow, doy) {
|
12120 | var
|
12121 | fwd = 7 + dow - doy,
|
12122 |
|
12123 | fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
|
12124 | return -fwdlw + fwd - 1;
|
12125 | }
|
12126 |
|
12127 |
|
12128 | function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
|
12129 | var localWeekday = (7 + weekday - dow) % 7,
|
12130 | weekOffset = firstWeekOffset(year, dow, doy),
|
12131 | dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
|
12132 | resYear,
|
12133 | resDayOfYear;
|
12134 |
|
12135 | if (dayOfYear <= 0) {
|
12136 | resYear = year - 1;
|
12137 | resDayOfYear = daysInYear(resYear) + dayOfYear;
|
12138 | } else if (dayOfYear > daysInYear(year)) {
|
12139 | resYear = year + 1;
|
12140 | resDayOfYear = dayOfYear - daysInYear(year);
|
12141 | } else {
|
12142 | resYear = year;
|
12143 | resDayOfYear = dayOfYear;
|
12144 | }
|
12145 |
|
12146 | return {
|
12147 | year: resYear,
|
12148 | dayOfYear: resDayOfYear
|
12149 | };
|
12150 | }
|
12151 |
|
12152 | function weekOfYear(mom, dow, doy) {
|
12153 | var weekOffset = firstWeekOffset(mom.year(), dow, doy),
|
12154 | week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
|
12155 | resWeek,
|
12156 | resYear;
|
12157 |
|
12158 | if (week < 1) {
|
12159 | resYear = mom.year() - 1;
|
12160 | resWeek = week + weeksInYear(resYear, dow, doy);
|
12161 | } else if (week > weeksInYear(mom.year(), dow, doy)) {
|
12162 | resWeek = week - weeksInYear(mom.year(), dow, doy);
|
12163 | resYear = mom.year() + 1;
|
12164 | } else {
|
12165 | resYear = mom.year();
|
12166 | resWeek = week;
|
12167 | }
|
12168 |
|
12169 | return {
|
12170 | week: resWeek,
|
12171 | year: resYear
|
12172 | };
|
12173 | }
|
12174 |
|
12175 | function weeksInYear(year, dow, doy) {
|
12176 | var weekOffset = firstWeekOffset(year, dow, doy),
|
12177 | weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
|
12178 | return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
|
12179 | }
|
12180 |
|
12181 |
|
12182 | addFormatToken('w', ['ww', 2], 'wo', 'week');
|
12183 | addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
|
12184 |
|
12185 | addUnitAlias('week', 'w');
|
12186 | addUnitAlias('isoWeek', 'W');
|
12187 |
|
12188 | addUnitPriority('week', 5);
|
12189 | addUnitPriority('isoWeek', 5);
|
12190 |
|
12191 | addRegexToken('w', match1to2);
|
12192 | addRegexToken('ww', match1to2, match2);
|
12193 | addRegexToken('W', match1to2);
|
12194 | addRegexToken('WW', match1to2, match2);
|
12195 | addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
|
12196 | week[token.substr(0, 1)] = toInt(input);
|
12197 | });
|
12198 |
|
12199 |
|
12200 | function localeWeek(mom) {
|
12201 | return weekOfYear(mom, this._week.dow, this._week.doy).week;
|
12202 | }
|
12203 |
|
12204 | var defaultLocaleWeek = {
|
12205 | dow: 0,
|
12206 |
|
12207 | doy: 6
|
12208 |
|
12209 | };
|
12210 |
|
12211 | function localeFirstDayOfWeek() {
|
12212 | return this._week.dow;
|
12213 | }
|
12214 |
|
12215 | function localeFirstDayOfYear() {
|
12216 | return this._week.doy;
|
12217 | }
|
12218 |
|
12219 |
|
12220 | function getSetWeek(input) {
|
12221 | var week = this.localeData().week(this);
|
12222 | return input == null ? week : this.add((input - week) * 7, 'd');
|
12223 | }
|
12224 |
|
12225 | function getSetISOWeek(input) {
|
12226 | var week = weekOfYear(this, 1, 4).week;
|
12227 | return input == null ? week : this.add((input - week) * 7, 'd');
|
12228 | }
|
12229 |
|
12230 |
|
12231 | addFormatToken('d', 0, 'do', 'day');
|
12232 | addFormatToken('dd', 0, 0, function (format) {
|
12233 | return this.localeData().weekdaysMin(this, format);
|
12234 | });
|
12235 | addFormatToken('ddd', 0, 0, function (format) {
|
12236 | return this.localeData().weekdaysShort(this, format);
|
12237 | });
|
12238 | addFormatToken('dddd', 0, 0, function (format) {
|
12239 | return this.localeData().weekdays(this, format);
|
12240 | });
|
12241 | addFormatToken('e', 0, 0, 'weekday');
|
12242 | addFormatToken('E', 0, 0, 'isoWeekday');
|
12243 |
|
12244 | addUnitAlias('day', 'd');
|
12245 | addUnitAlias('weekday', 'e');
|
12246 | addUnitAlias('isoWeekday', 'E');
|
12247 |
|
12248 | addUnitPriority('day', 11);
|
12249 | addUnitPriority('weekday', 11);
|
12250 | addUnitPriority('isoWeekday', 11);
|
12251 |
|
12252 | addRegexToken('d', match1to2);
|
12253 | addRegexToken('e', match1to2);
|
12254 | addRegexToken('E', match1to2);
|
12255 | addRegexToken('dd', function (isStrict, locale) {
|
12256 | return locale.weekdaysMinRegex(isStrict);
|
12257 | });
|
12258 | addRegexToken('ddd', function (isStrict, locale) {
|
12259 | return locale.weekdaysShortRegex(isStrict);
|
12260 | });
|
12261 | addRegexToken('dddd', function (isStrict, locale) {
|
12262 | return locale.weekdaysRegex(isStrict);
|
12263 | });
|
12264 | addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
|
12265 | var weekday = config._locale.weekdaysParse(input, token, config._strict);
|
12266 |
|
12267 |
|
12268 | if (weekday != null) {
|
12269 | week.d = weekday;
|
12270 | } else {
|
12271 | getParsingFlags(config).invalidWeekday = input;
|
12272 | }
|
12273 | });
|
12274 | addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
|
12275 | week[token] = toInt(input);
|
12276 | });
|
12277 |
|
12278 | function parseWeekday(input, locale) {
|
12279 | if (typeof input !== 'string') {
|
12280 | return input;
|
12281 | }
|
12282 |
|
12283 | if (!isNaN(input)) {
|
12284 | return _parseInt$3$1(input, 10);
|
12285 | }
|
12286 |
|
12287 | input = locale.weekdaysParse(input);
|
12288 |
|
12289 | if (typeof input === 'number') {
|
12290 | return input;
|
12291 | }
|
12292 |
|
12293 | return null;
|
12294 | }
|
12295 |
|
12296 | function parseIsoWeekday(input, locale) {
|
12297 | if (typeof input === 'string') {
|
12298 | return locale.weekdaysParse(input) % 7 || 7;
|
12299 | }
|
12300 |
|
12301 | return isNaN(input) ? null : input;
|
12302 | }
|
12303 |
|
12304 |
|
12305 | function shiftWeekdays(ws, n) {
|
12306 | var _context;
|
12307 |
|
12308 | return concat$2$1$1(_context = slice$2$1(ws).call(ws, n, 7)).call(_context, slice$2$1(ws).call(ws, 0, n));
|
12309 | }
|
12310 |
|
12311 | var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
|
12312 |
|
12313 | function localeWeekdays(m, format) {
|
12314 | var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone'];
|
12315 | return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;
|
12316 | }
|
12317 |
|
12318 | var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
|
12319 |
|
12320 | function localeWeekdaysShort(m) {
|
12321 | return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;
|
12322 | }
|
12323 |
|
12324 | var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
|
12325 |
|
12326 | function localeWeekdaysMin(m) {
|
12327 | return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;
|
12328 | }
|
12329 |
|
12330 | function handleStrictParse$1(weekdayName, format, strict) {
|
12331 | var i,
|
12332 | ii,
|
12333 | mom,
|
12334 | llc = weekdayName.toLocaleLowerCase();
|
12335 |
|
12336 | if (!this._weekdaysParse) {
|
12337 | this._weekdaysParse = [];
|
12338 | this._shortWeekdaysParse = [];
|
12339 | this._minWeekdaysParse = [];
|
12340 |
|
12341 | for (i = 0; i < 7; ++i) {
|
12342 | mom = createUTC([2000, 1]).day(i);
|
12343 | this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
|
12344 | this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
|
12345 | this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
|
12346 | }
|
12347 | }
|
12348 |
|
12349 | if (strict) {
|
12350 | if (format === 'dddd') {
|
12351 | ii = indexOf.call(this._weekdaysParse, llc);
|
12352 | return ii !== -1 ? ii : null;
|
12353 | } else if (format === 'ddd') {
|
12354 | ii = indexOf.call(this._shortWeekdaysParse, llc);
|
12355 | return ii !== -1 ? ii : null;
|
12356 | } else {
|
12357 | ii = indexOf.call(this._minWeekdaysParse, llc);
|
12358 | return ii !== -1 ? ii : null;
|
12359 | }
|
12360 | } else {
|
12361 | if (format === 'dddd') {
|
12362 | ii = indexOf.call(this._weekdaysParse, llc);
|
12363 |
|
12364 | if (ii !== -1) {
|
12365 | return ii;
|
12366 | }
|
12367 |
|
12368 | ii = indexOf.call(this._shortWeekdaysParse, llc);
|
12369 |
|
12370 | if (ii !== -1) {
|
12371 | return ii;
|
12372 | }
|
12373 |
|
12374 | ii = indexOf.call(this._minWeekdaysParse, llc);
|
12375 | return ii !== -1 ? ii : null;
|
12376 | } else if (format === 'ddd') {
|
12377 | ii = indexOf.call(this._shortWeekdaysParse, llc);
|
12378 |
|
12379 | if (ii !== -1) {
|
12380 | return ii;
|
12381 | }
|
12382 |
|
12383 | ii = indexOf.call(this._weekdaysParse, llc);
|
12384 |
|
12385 | if (ii !== -1) {
|
12386 | return ii;
|
12387 | }
|
12388 |
|
12389 | ii = indexOf.call(this._minWeekdaysParse, llc);
|
12390 | return ii !== -1 ? ii : null;
|
12391 | } else {
|
12392 | ii = indexOf.call(this._minWeekdaysParse, llc);
|
12393 |
|
12394 | if (ii !== -1) {
|
12395 | return ii;
|
12396 | }
|
12397 |
|
12398 | ii = indexOf.call(this._weekdaysParse, llc);
|
12399 |
|
12400 | if (ii !== -1) {
|
12401 | return ii;
|
12402 | }
|
12403 |
|
12404 | ii = indexOf.call(this._shortWeekdaysParse, llc);
|
12405 | return ii !== -1 ? ii : null;
|
12406 | }
|
12407 | }
|
12408 | }
|
12409 |
|
12410 | function localeWeekdaysParse(weekdayName, format, strict) {
|
12411 | var i, mom, regex;
|
12412 |
|
12413 | if (this._weekdaysParseExact) {
|
12414 | return handleStrictParse$1.call(this, weekdayName, format, strict);
|
12415 | }
|
12416 |
|
12417 | if (!this._weekdaysParse) {
|
12418 | this._weekdaysParse = [];
|
12419 | this._minWeekdaysParse = [];
|
12420 | this._shortWeekdaysParse = [];
|
12421 | this._fullWeekdaysParse = [];
|
12422 | }
|
12423 |
|
12424 | for (i = 0; i < 7; i++) {
|
12425 |
|
12426 | mom = createUTC([2000, 1]).day(i);
|
12427 |
|
12428 | if (strict && !this._fullWeekdaysParse[i]) {
|
12429 | this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');
|
12430 | this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');
|
12431 | this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');
|
12432 | }
|
12433 |
|
12434 | if (!this._weekdaysParse[i]) {
|
12435 | regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
|
12436 | this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
|
12437 | }
|
12438 |
|
12439 |
|
12440 | if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
|
12441 | return i;
|
12442 | } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
|
12443 | return i;
|
12444 | } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
|
12445 | return i;
|
12446 | } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
|
12447 | return i;
|
12448 | }
|
12449 | }
|
12450 | }
|
12451 |
|
12452 |
|
12453 | function getSetDayOfWeek(input) {
|
12454 | if (!this.isValid()) {
|
12455 | return input != null ? this : NaN;
|
12456 | }
|
12457 |
|
12458 | var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
|
12459 |
|
12460 | if (input != null) {
|
12461 | input = parseWeekday(input, this.localeData());
|
12462 | return this.add(input - day, 'd');
|
12463 | } else {
|
12464 | return day;
|
12465 | }
|
12466 | }
|
12467 |
|
12468 | function getSetLocaleDayOfWeek(input) {
|
12469 | if (!this.isValid()) {
|
12470 | return input != null ? this : NaN;
|
12471 | }
|
12472 |
|
12473 | var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
|
12474 | return input == null ? weekday : this.add(input - weekday, 'd');
|
12475 | }
|
12476 |
|
12477 | function getSetISODayOfWeek(input) {
|
12478 | if (!this.isValid()) {
|
12479 | return input != null ? this : NaN;
|
12480 | }
|
12481 |
|
12482 |
|
12483 |
|
12484 |
|
12485 | if (input != null) {
|
12486 | var weekday = parseIsoWeekday(input, this.localeData());
|
12487 | return this.day(this.day() % 7 ? weekday : weekday - 7);
|
12488 | } else {
|
12489 | return this.day() || 7;
|
12490 | }
|
12491 | }
|
12492 |
|
12493 | var defaultWeekdaysRegex = matchWord;
|
12494 |
|
12495 | function weekdaysRegex(isStrict) {
|
12496 | if (this._weekdaysParseExact) {
|
12497 | if (!hasOwnProp(this, '_weekdaysRegex')) {
|
12498 | computeWeekdaysParse.call(this);
|
12499 | }
|
12500 |
|
12501 | if (isStrict) {
|
12502 | return this._weekdaysStrictRegex;
|
12503 | } else {
|
12504 | return this._weekdaysRegex;
|
12505 | }
|
12506 | } else {
|
12507 | if (!hasOwnProp(this, '_weekdaysRegex')) {
|
12508 | this._weekdaysRegex = defaultWeekdaysRegex;
|
12509 | }
|
12510 |
|
12511 | return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;
|
12512 | }
|
12513 | }
|
12514 |
|
12515 | var defaultWeekdaysShortRegex = matchWord;
|
12516 |
|
12517 | function weekdaysShortRegex(isStrict) {
|
12518 | if (this._weekdaysParseExact) {
|
12519 | if (!hasOwnProp(this, '_weekdaysRegex')) {
|
12520 | computeWeekdaysParse.call(this);
|
12521 | }
|
12522 |
|
12523 | if (isStrict) {
|
12524 | return this._weekdaysShortStrictRegex;
|
12525 | } else {
|
12526 | return this._weekdaysShortRegex;
|
12527 | }
|
12528 | } else {
|
12529 | if (!hasOwnProp(this, '_weekdaysShortRegex')) {
|
12530 | this._weekdaysShortRegex = defaultWeekdaysShortRegex;
|
12531 | }
|
12532 |
|
12533 | return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
|
12534 | }
|
12535 | }
|
12536 |
|
12537 | var defaultWeekdaysMinRegex = matchWord;
|
12538 |
|
12539 | function weekdaysMinRegex(isStrict) {
|
12540 | if (this._weekdaysParseExact) {
|
12541 | if (!hasOwnProp(this, '_weekdaysRegex')) {
|
12542 | computeWeekdaysParse.call(this);
|
12543 | }
|
12544 |
|
12545 | if (isStrict) {
|
12546 | return this._weekdaysMinStrictRegex;
|
12547 | } else {
|
12548 | return this._weekdaysMinRegex;
|
12549 | }
|
12550 | } else {
|
12551 | if (!hasOwnProp(this, '_weekdaysMinRegex')) {
|
12552 | this._weekdaysMinRegex = defaultWeekdaysMinRegex;
|
12553 | }
|
12554 |
|
12555 | return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
|
12556 | }
|
12557 | }
|
12558 |
|
12559 | function computeWeekdaysParse() {
|
12560 | function cmpLenRev(a, b) {
|
12561 | return b.length - a.length;
|
12562 | }
|
12563 |
|
12564 | var minPieces = [],
|
12565 | shortPieces = [],
|
12566 | longPieces = [],
|
12567 | mixedPieces = [],
|
12568 | i,
|
12569 | mom,
|
12570 | minp,
|
12571 | shortp,
|
12572 | longp;
|
12573 |
|
12574 | for (i = 0; i < 7; i++) {
|
12575 |
|
12576 | mom = createUTC([2000, 1]).day(i);
|
12577 | minp = this.weekdaysMin(mom, '');
|
12578 | shortp = this.weekdaysShort(mom, '');
|
12579 | longp = this.weekdays(mom, '');
|
12580 | minPieces.push(minp);
|
12581 | shortPieces.push(shortp);
|
12582 | longPieces.push(longp);
|
12583 | mixedPieces.push(minp);
|
12584 | mixedPieces.push(shortp);
|
12585 | mixedPieces.push(longp);
|
12586 | }
|
12587 |
|
12588 |
|
12589 |
|
12590 | sort$2$1(minPieces).call(minPieces, cmpLenRev);
|
12591 | sort$2$1(shortPieces).call(shortPieces, cmpLenRev);
|
12592 | sort$2$1(longPieces).call(longPieces, cmpLenRev);
|
12593 | sort$2$1(mixedPieces).call(mixedPieces, cmpLenRev);
|
12594 |
|
12595 | for (i = 0; i < 7; i++) {
|
12596 | shortPieces[i] = regexEscape(shortPieces[i]);
|
12597 | longPieces[i] = regexEscape(longPieces[i]);
|
12598 | mixedPieces[i] = regexEscape(mixedPieces[i]);
|
12599 | }
|
12600 |
|
12601 | this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
12602 | this._weekdaysShortRegex = this._weekdaysRegex;
|
12603 | this._weekdaysMinRegex = this._weekdaysRegex;
|
12604 | this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
|
12605 | this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
|
12606 | this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
|
12607 | }
|
12608 |
|
12609 |
|
12610 | function hFormat() {
|
12611 | return this.hours() % 12 || 12;
|
12612 | }
|
12613 |
|
12614 | function kFormat() {
|
12615 | return this.hours() || 24;
|
12616 | }
|
12617 |
|
12618 | addFormatToken('H', ['HH', 2], 0, 'hour');
|
12619 | addFormatToken('h', ['hh', 2], 0, hFormat);
|
12620 | addFormatToken('k', ['kk', 2], 0, kFormat);
|
12621 | addFormatToken('hmm', 0, 0, function () {
|
12622 | return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
|
12623 | });
|
12624 | addFormatToken('hmmss', 0, 0, function () {
|
12625 | return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
|
12626 | });
|
12627 | addFormatToken('Hmm', 0, 0, function () {
|
12628 | return '' + this.hours() + zeroFill(this.minutes(), 2);
|
12629 | });
|
12630 | addFormatToken('Hmmss', 0, 0, function () {
|
12631 | return '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
|
12632 | });
|
12633 |
|
12634 | function meridiem(token, lowercase) {
|
12635 | addFormatToken(token, 0, 0, function () {
|
12636 | return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
|
12637 | });
|
12638 | }
|
12639 |
|
12640 | meridiem('a', true);
|
12641 | meridiem('A', false);
|
12642 |
|
12643 | addUnitAlias('hour', 'h');
|
12644 |
|
12645 | addUnitPriority('hour', 13);
|
12646 |
|
12647 | function matchMeridiem(isStrict, locale) {
|
12648 | return locale._meridiemParse;
|
12649 | }
|
12650 |
|
12651 | addRegexToken('a', matchMeridiem);
|
12652 | addRegexToken('A', matchMeridiem);
|
12653 | addRegexToken('H', match1to2);
|
12654 | addRegexToken('h', match1to2);
|
12655 | addRegexToken('k', match1to2);
|
12656 | addRegexToken('HH', match1to2, match2);
|
12657 | addRegexToken('hh', match1to2, match2);
|
12658 | addRegexToken('kk', match1to2, match2);
|
12659 | addRegexToken('hmm', match3to4);
|
12660 | addRegexToken('hmmss', match5to6);
|
12661 | addRegexToken('Hmm', match3to4);
|
12662 | addRegexToken('Hmmss', match5to6);
|
12663 | addParseToken(['H', 'HH'], HOUR);
|
12664 | addParseToken(['k', 'kk'], function (input, array, config) {
|
12665 | var kInput = toInt(input);
|
12666 | array[HOUR] = kInput === 24 ? 0 : kInput;
|
12667 | });
|
12668 | addParseToken(['a', 'A'], function (input, array, config) {
|
12669 | config._isPm = config._locale.isPM(input);
|
12670 | config._meridiem = input;
|
12671 | });
|
12672 | addParseToken(['h', 'hh'], function (input, array, config) {
|
12673 | array[HOUR] = toInt(input);
|
12674 | getParsingFlags(config).bigHour = true;
|
12675 | });
|
12676 | addParseToken('hmm', function (input, array, config) {
|
12677 | var pos = input.length - 2;
|
12678 | array[HOUR] = toInt(input.substr(0, pos));
|
12679 | array[MINUTE] = toInt(input.substr(pos));
|
12680 | getParsingFlags(config).bigHour = true;
|
12681 | });
|
12682 | addParseToken('hmmss', function (input, array, config) {
|
12683 | var pos1 = input.length - 4;
|
12684 | var pos2 = input.length - 2;
|
12685 | array[HOUR] = toInt(input.substr(0, pos1));
|
12686 | array[MINUTE] = toInt(input.substr(pos1, 2));
|
12687 | array[SECOND] = toInt(input.substr(pos2));
|
12688 | getParsingFlags(config).bigHour = true;
|
12689 | });
|
12690 | addParseToken('Hmm', function (input, array, config) {
|
12691 | var pos = input.length - 2;
|
12692 | array[HOUR] = toInt(input.substr(0, pos));
|
12693 | array[MINUTE] = toInt(input.substr(pos));
|
12694 | });
|
12695 | addParseToken('Hmmss', function (input, array, config) {
|
12696 | var pos1 = input.length - 4;
|
12697 | var pos2 = input.length - 2;
|
12698 | array[HOUR] = toInt(input.substr(0, pos1));
|
12699 | array[MINUTE] = toInt(input.substr(pos1, 2));
|
12700 | array[SECOND] = toInt(input.substr(pos2));
|
12701 | });
|
12702 |
|
12703 | function localeIsPM(input) {
|
12704 |
|
12705 |
|
12706 | return (input + '').toLowerCase().charAt(0) === 'p';
|
12707 | }
|
12708 |
|
12709 | var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
|
12710 |
|
12711 | function localeMeridiem(hours, minutes, isLower) {
|
12712 | if (hours > 11) {
|
12713 | return isLower ? 'pm' : 'PM';
|
12714 | } else {
|
12715 | return isLower ? 'am' : 'AM';
|
12716 | }
|
12717 | }
|
12718 |
|
12719 |
|
12720 |
|
12721 |
|
12722 |
|
12723 |
|
12724 | var getSetHour = makeGetSet('Hours', true);
|
12725 | var baseConfig = {
|
12726 | calendar: defaultCalendar,
|
12727 | longDateFormat: defaultLongDateFormat,
|
12728 | invalidDate: defaultInvalidDate,
|
12729 | ordinal: defaultOrdinal,
|
12730 | dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
|
12731 | relativeTime: defaultRelativeTime,
|
12732 | months: defaultLocaleMonths,
|
12733 | monthsShort: defaultLocaleMonthsShort,
|
12734 | week: defaultLocaleWeek,
|
12735 | weekdays: defaultLocaleWeekdays,
|
12736 | weekdaysMin: defaultLocaleWeekdaysMin,
|
12737 | weekdaysShort: defaultLocaleWeekdaysShort,
|
12738 | meridiemParse: defaultLocaleMeridiemParse
|
12739 | };
|
12740 |
|
12741 | var locales = {};
|
12742 | var localeFamilies = {};
|
12743 | var globalLocale;
|
12744 |
|
12745 | function normalizeLocale(key) {
|
12746 | return key ? key.toLowerCase().replace('_', '-') : key;
|
12747 | }
|
12748 |
|
12749 |
|
12750 |
|
12751 |
|
12752 | function chooseLocale(names) {
|
12753 | var i = 0,
|
12754 | j,
|
12755 | next,
|
12756 | locale,
|
12757 | split;
|
12758 |
|
12759 | while (i < names.length) {
|
12760 | split = normalizeLocale(names[i]).split('-');
|
12761 | j = split.length;
|
12762 | next = normalizeLocale(names[i + 1]);
|
12763 | next = next ? next.split('-') : null;
|
12764 |
|
12765 | while (j > 0) {
|
12766 | locale = loadLocale(slice$2$1(split).call(split, 0, j).join('-'));
|
12767 |
|
12768 | if (locale) {
|
12769 | return locale;
|
12770 | }
|
12771 |
|
12772 | if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
|
12773 |
|
12774 | break;
|
12775 | }
|
12776 |
|
12777 | j--;
|
12778 | }
|
12779 |
|
12780 | i++;
|
12781 | }
|
12782 |
|
12783 | return globalLocale;
|
12784 | }
|
12785 |
|
12786 | function loadLocale(name) {
|
12787 | var oldLocale = null;
|
12788 |
|
12789 | if (!locales[name] && 'object' !== 'undefined' && module && module.exports) {
|
12790 | try {
|
12791 | oldLocale = globalLocale._abbr;
|
12792 | var aliasedRequire = commonjsRequire$1;
|
12793 | aliasedRequire('./locale/' + name);
|
12794 | getSetGlobalLocale(oldLocale);
|
12795 | } catch (e) {}
|
12796 | }
|
12797 |
|
12798 | return locales[name];
|
12799 | }
|
12800 |
|
12801 |
|
12802 |
|
12803 |
|
12804 | function getSetGlobalLocale(key, values) {
|
12805 | var data;
|
12806 |
|
12807 | if (key) {
|
12808 | if (isUndefined(values)) {
|
12809 | data = getLocale(key);
|
12810 | } else {
|
12811 | data = defineLocale(key, values);
|
12812 | }
|
12813 |
|
12814 | if (data) {
|
12815 |
|
12816 | globalLocale = data;
|
12817 | } else {
|
12818 | if (typeof console !== 'undefined' && console.warn) {
|
12819 |
|
12820 | console.warn('Locale ' + key + ' not found. Did you forget to load it?');
|
12821 | }
|
12822 | }
|
12823 | }
|
12824 |
|
12825 | return globalLocale._abbr;
|
12826 | }
|
12827 |
|
12828 | function defineLocale(name, config) {
|
12829 | if (config !== null) {
|
12830 | var locale,
|
12831 | parentConfig = baseConfig;
|
12832 | config.abbr = name;
|
12833 |
|
12834 | if (locales[name] != null) {
|
12835 | deprecateSimple('defineLocaleOverride', 'use moment.updateLocale(localeName, config) to change ' + 'an existing locale. moment.defineLocale(localeName, ' + 'config) should only be used for creating a new locale ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
|
12836 | parentConfig = locales[name]._config;
|
12837 | } else if (config.parentLocale != null) {
|
12838 | if (locales[config.parentLocale] != null) {
|
12839 | parentConfig = locales[config.parentLocale]._config;
|
12840 | } else {
|
12841 | locale = loadLocale(config.parentLocale);
|
12842 |
|
12843 | if (locale != null) {
|
12844 | parentConfig = locale._config;
|
12845 | } else {
|
12846 | if (!localeFamilies[config.parentLocale]) {
|
12847 | localeFamilies[config.parentLocale] = [];
|
12848 | }
|
12849 |
|
12850 | localeFamilies[config.parentLocale].push({
|
12851 | name: name,
|
12852 | config: config
|
12853 | });
|
12854 | return null;
|
12855 | }
|
12856 | }
|
12857 | }
|
12858 |
|
12859 | locales[name] = new Locale(mergeConfigs(parentConfig, config));
|
12860 |
|
12861 | if (localeFamilies[name]) {
|
12862 | var _context2;
|
12863 |
|
12864 | forEach$2$1$1(_context2 = localeFamilies[name]).call(_context2, function (x) {
|
12865 | defineLocale(x.name, x.config);
|
12866 | });
|
12867 | }
|
12868 |
|
12869 |
|
12870 |
|
12871 |
|
12872 | getSetGlobalLocale(name);
|
12873 | return locales[name];
|
12874 | } else {
|
12875 |
|
12876 | delete locales[name];
|
12877 | return null;
|
12878 | }
|
12879 | }
|
12880 |
|
12881 | function updateLocale(name, config) {
|
12882 | if (config != null) {
|
12883 | var locale,
|
12884 | tmpLocale,
|
12885 | parentConfig = baseConfig;
|
12886 |
|
12887 | tmpLocale = loadLocale(name);
|
12888 |
|
12889 | if (tmpLocale != null) {
|
12890 | parentConfig = tmpLocale._config;
|
12891 | }
|
12892 |
|
12893 | config = mergeConfigs(parentConfig, config);
|
12894 | locale = new Locale(config);
|
12895 | locale.parentLocale = locales[name];
|
12896 | locales[name] = locale;
|
12897 |
|
12898 | getSetGlobalLocale(name);
|
12899 | } else {
|
12900 |
|
12901 | if (locales[name] != null) {
|
12902 | if (locales[name].parentLocale != null) {
|
12903 | locales[name] = locales[name].parentLocale;
|
12904 | } else if (locales[name] != null) {
|
12905 | delete locales[name];
|
12906 | }
|
12907 | }
|
12908 | }
|
12909 |
|
12910 | return locales[name];
|
12911 | }
|
12912 |
|
12913 |
|
12914 | function getLocale(key) {
|
12915 | var locale;
|
12916 |
|
12917 | if (key && key._locale && key._locale._abbr) {
|
12918 | key = key._locale._abbr;
|
12919 | }
|
12920 |
|
12921 | if (!key) {
|
12922 | return globalLocale;
|
12923 | }
|
12924 |
|
12925 | if (!isArray(key)) {
|
12926 |
|
12927 | locale = loadLocale(key);
|
12928 |
|
12929 | if (locale) {
|
12930 | return locale;
|
12931 | }
|
12932 |
|
12933 | key = [key];
|
12934 | }
|
12935 |
|
12936 | return chooseLocale(key);
|
12937 | }
|
12938 |
|
12939 | function listLocales() {
|
12940 | return keys(locales);
|
12941 | }
|
12942 |
|
12943 | function checkOverflow(m) {
|
12944 | var overflow;
|
12945 | var a = m._a;
|
12946 |
|
12947 | if (a && getParsingFlags(m).overflow === -2) {
|
12948 | overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;
|
12949 |
|
12950 | if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
|
12951 | overflow = DATE;
|
12952 | }
|
12953 |
|
12954 | if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
|
12955 | overflow = WEEK;
|
12956 | }
|
12957 |
|
12958 | if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
|
12959 | overflow = WEEKDAY;
|
12960 | }
|
12961 |
|
12962 | getParsingFlags(m).overflow = overflow;
|
12963 | }
|
12964 |
|
12965 | return m;
|
12966 | }
|
12967 |
|
12968 |
|
12969 | function defaults(a, b, c) {
|
12970 | if (a != null) {
|
12971 | return a;
|
12972 | }
|
12973 |
|
12974 | if (b != null) {
|
12975 | return b;
|
12976 | }
|
12977 |
|
12978 | return c;
|
12979 | }
|
12980 |
|
12981 | function currentDateArray(config) {
|
12982 |
|
12983 | var nowValue = new Date(hooks.now());
|
12984 |
|
12985 | if (config._useUTC) {
|
12986 | return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
|
12987 | }
|
12988 |
|
12989 | return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
|
12990 | }
|
12991 |
|
12992 |
|
12993 |
|
12994 |
|
12995 |
|
12996 | function configFromArray(config) {
|
12997 | var i,
|
12998 | date,
|
12999 | input = [],
|
13000 | currentDate,
|
13001 | expectedWeekday,
|
13002 | yearToUse;
|
13003 |
|
13004 | if (config._d) {
|
13005 | return;
|
13006 | }
|
13007 |
|
13008 | currentDate = currentDateArray(config);
|
13009 |
|
13010 | if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
|
13011 | dayOfYearFromWeekInfo(config);
|
13012 | }
|
13013 |
|
13014 |
|
13015 | if (config._dayOfYear != null) {
|
13016 | yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
|
13017 |
|
13018 | if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
|
13019 | getParsingFlags(config)._overflowDayOfYear = true;
|
13020 | }
|
13021 |
|
13022 | date = createUTCDate(yearToUse, 0, config._dayOfYear);
|
13023 | config._a[MONTH] = date.getUTCMonth();
|
13024 | config._a[DATE] = date.getUTCDate();
|
13025 | }
|
13026 |
|
13027 |
|
13028 |
|
13029 |
|
13030 |
|
13031 |
|
13032 | for (i = 0; i < 3 && config._a[i] == null; ++i) {
|
13033 | config._a[i] = input[i] = currentDate[i];
|
13034 | }
|
13035 |
|
13036 |
|
13037 | for (; i < 7; i++) {
|
13038 | config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];
|
13039 | }
|
13040 |
|
13041 |
|
13042 | if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {
|
13043 | config._nextDay = true;
|
13044 | config._a[HOUR] = 0;
|
13045 | }
|
13046 |
|
13047 | config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
|
13048 | expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
|
13049 |
|
13050 |
|
13051 | if (config._tzm != null) {
|
13052 | config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
|
13053 | }
|
13054 |
|
13055 | if (config._nextDay) {
|
13056 | config._a[HOUR] = 24;
|
13057 | }
|
13058 |
|
13059 |
|
13060 | if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
|
13061 | getParsingFlags(config).weekdayMismatch = true;
|
13062 | }
|
13063 | }
|
13064 |
|
13065 | function dayOfYearFromWeekInfo(config) {
|
13066 | var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
|
13067 | w = config._w;
|
13068 |
|
13069 | if (w.GG != null || w.W != null || w.E != null) {
|
13070 | dow = 1;
|
13071 | doy = 4;
|
13072 |
|
13073 |
|
13074 |
|
13075 |
|
13076 | weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
|
13077 | week = defaults(w.W, 1);
|
13078 | weekday = defaults(w.E, 1);
|
13079 |
|
13080 | if (weekday < 1 || weekday > 7) {
|
13081 | weekdayOverflow = true;
|
13082 | }
|
13083 | } else {
|
13084 | dow = config._locale._week.dow;
|
13085 | doy = config._locale._week.doy;
|
13086 | var curWeek = weekOfYear(createLocal(), dow, doy);
|
13087 | weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
|
13088 |
|
13089 | week = defaults(w.w, curWeek.week);
|
13090 |
|
13091 | if (w.d != null) {
|
13092 |
|
13093 | weekday = w.d;
|
13094 |
|
13095 | if (weekday < 0 || weekday > 6) {
|
13096 | weekdayOverflow = true;
|
13097 | }
|
13098 | } else if (w.e != null) {
|
13099 |
|
13100 | weekday = w.e + dow;
|
13101 |
|
13102 | if (w.e < 0 || w.e > 6) {
|
13103 | weekdayOverflow = true;
|
13104 | }
|
13105 | } else {
|
13106 |
|
13107 | weekday = dow;
|
13108 | }
|
13109 | }
|
13110 |
|
13111 | if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
|
13112 | getParsingFlags(config)._overflowWeeks = true;
|
13113 | } else if (weekdayOverflow != null) {
|
13114 | getParsingFlags(config)._overflowWeekday = true;
|
13115 | } else {
|
13116 | temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
|
13117 | config._a[YEAR] = temp.year;
|
13118 | config._dayOfYear = temp.dayOfYear;
|
13119 | }
|
13120 | }
|
13121 |
|
13122 |
|
13123 |
|
13124 | var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
|
13125 | var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
|
13126 | var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
|
13127 | var isoDates = [['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], ['GGGG-[W]WW', /\d{4}-W\d\d/, false], ['YYYY-DDD', /\d{4}-\d{3}/], ['YYYY-MM', /\d{4}-\d\d/, false], ['YYYYYYMMDD', /[+-]\d{10}/], ['YYYYMMDD', /\d{8}/],
|
13128 | ['GGGG[W]WWE', /\d{4}W\d{3}/], ['GGGG[W]WW', /\d{4}W\d{2}/, false], ['YYYYDDD', /\d{7}/]];
|
13129 |
|
13130 | var isoTimes = [['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], ['HH:mm:ss', /\d\d:\d\d:\d\d/], ['HH:mm', /\d\d:\d\d/], ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], ['HHmmss', /\d\d\d\d\d\d/], ['HHmm', /\d\d\d\d/], ['HH', /\d\d/]];
|
13131 | var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
|
13132 |
|
13133 | function configFromISO(config) {
|
13134 | var i,
|
13135 | l,
|
13136 | string = config._i,
|
13137 | match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
|
13138 | allowTime,
|
13139 | dateFormat,
|
13140 | timeFormat,
|
13141 | tzFormat;
|
13142 |
|
13143 | if (match) {
|
13144 | getParsingFlags(config).iso = true;
|
13145 |
|
13146 | for (i = 0, l = isoDates.length; i < l; i++) {
|
13147 | if (isoDates[i][1].exec(match[1])) {
|
13148 | dateFormat = isoDates[i][0];
|
13149 | allowTime = isoDates[i][2] !== false;
|
13150 | break;
|
13151 | }
|
13152 | }
|
13153 |
|
13154 | if (dateFormat == null) {
|
13155 | config._isValid = false;
|
13156 | return;
|
13157 | }
|
13158 |
|
13159 | if (match[3]) {
|
13160 | for (i = 0, l = isoTimes.length; i < l; i++) {
|
13161 | if (isoTimes[i][1].exec(match[3])) {
|
13162 |
|
13163 | timeFormat = (match[2] || ' ') + isoTimes[i][0];
|
13164 | break;
|
13165 | }
|
13166 | }
|
13167 |
|
13168 | if (timeFormat == null) {
|
13169 | config._isValid = false;
|
13170 | return;
|
13171 | }
|
13172 | }
|
13173 |
|
13174 | if (!allowTime && timeFormat != null) {
|
13175 | config._isValid = false;
|
13176 | return;
|
13177 | }
|
13178 |
|
13179 | if (match[4]) {
|
13180 | if (tzRegex.exec(match[4])) {
|
13181 | tzFormat = 'Z';
|
13182 | } else {
|
13183 | config._isValid = false;
|
13184 | return;
|
13185 | }
|
13186 | }
|
13187 |
|
13188 | config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
|
13189 | configFromStringAndFormat(config);
|
13190 | } else {
|
13191 | config._isValid = false;
|
13192 | }
|
13193 | }
|
13194 |
|
13195 |
|
13196 | var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
|
13197 |
|
13198 | function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
|
13199 | var result = [untruncateYear(yearStr), indexOf$3$1(defaultLocaleMonthsShort).call(defaultLocaleMonthsShort, monthStr), _parseInt$3$1(dayStr, 10), _parseInt$3$1(hourStr, 10), _parseInt$3$1(minuteStr, 10)];
|
13200 |
|
13201 | if (secondStr) {
|
13202 | result.push(_parseInt$3$1(secondStr, 10));
|
13203 | }
|
13204 |
|
13205 | return result;
|
13206 | }
|
13207 |
|
13208 | function untruncateYear(yearStr) {
|
13209 | var year = _parseInt$3$1(yearStr, 10);
|
13210 |
|
13211 | if (year <= 49) {
|
13212 | return 2000 + year;
|
13213 | } else if (year <= 999) {
|
13214 | return 1900 + year;
|
13215 | }
|
13216 |
|
13217 | return year;
|
13218 | }
|
13219 |
|
13220 | function preprocessRFC2822(s) {
|
13221 |
|
13222 | return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
|
13223 | }
|
13224 |
|
13225 | function checkWeekday(weekdayStr, parsedInput, config) {
|
13226 | if (weekdayStr) {
|
13227 |
|
13228 | var weekdayProvided = indexOf$3$1(defaultLocaleWeekdaysShort).call(defaultLocaleWeekdaysShort, weekdayStr),
|
13229 | weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();
|
13230 |
|
13231 | if (weekdayProvided !== weekdayActual) {
|
13232 | getParsingFlags(config).weekdayMismatch = true;
|
13233 | config._isValid = false;
|
13234 | return false;
|
13235 | }
|
13236 | }
|
13237 |
|
13238 | return true;
|
13239 | }
|
13240 |
|
13241 | var obsOffsets = {
|
13242 | UT: 0,
|
13243 | GMT: 0,
|
13244 | EDT: -4 * 60,
|
13245 | EST: -5 * 60,
|
13246 | CDT: -5 * 60,
|
13247 | CST: -6 * 60,
|
13248 | MDT: -6 * 60,
|
13249 | MST: -7 * 60,
|
13250 | PDT: -7 * 60,
|
13251 | PST: -8 * 60
|
13252 | };
|
13253 |
|
13254 | function calculateOffset(obsOffset, militaryOffset, numOffset) {
|
13255 | if (obsOffset) {
|
13256 | return obsOffsets[obsOffset];
|
13257 | } else if (militaryOffset) {
|
13258 |
|
13259 | return 0;
|
13260 | } else {
|
13261 | var hm = _parseInt$3$1(numOffset, 10);
|
13262 |
|
13263 | var m = hm % 100,
|
13264 | h = (hm - m) / 100;
|
13265 | return h * 60 + m;
|
13266 | }
|
13267 | }
|
13268 |
|
13269 |
|
13270 | function configFromRFC2822(config) {
|
13271 | var match = rfc2822.exec(preprocessRFC2822(config._i));
|
13272 |
|
13273 | if (match) {
|
13274 | var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);
|
13275 |
|
13276 | if (!checkWeekday(match[1], parsedArray, config)) {
|
13277 | return;
|
13278 | }
|
13279 |
|
13280 | config._a = parsedArray;
|
13281 | config._tzm = calculateOffset(match[8], match[9], match[10]);
|
13282 | config._d = createUTCDate.apply(null, config._a);
|
13283 |
|
13284 | config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
|
13285 |
|
13286 | getParsingFlags(config).rfc2822 = true;
|
13287 | } else {
|
13288 | config._isValid = false;
|
13289 | }
|
13290 | }
|
13291 |
|
13292 |
|
13293 | function configFromString(config) {
|
13294 | var matched = aspNetJsonRegex.exec(config._i);
|
13295 |
|
13296 | if (matched !== null) {
|
13297 | config._d = new Date(+matched[1]);
|
13298 | return;
|
13299 | }
|
13300 |
|
13301 | configFromISO(config);
|
13302 |
|
13303 | if (config._isValid === false) {
|
13304 | delete config._isValid;
|
13305 | } else {
|
13306 | return;
|
13307 | }
|
13308 |
|
13309 | configFromRFC2822(config);
|
13310 |
|
13311 | if (config._isValid === false) {
|
13312 | delete config._isValid;
|
13313 | } else {
|
13314 | return;
|
13315 | }
|
13316 |
|
13317 |
|
13318 | hooks.createFromInputFallback(config);
|
13319 | }
|
13320 |
|
13321 | hooks.createFromInputFallback = deprecate('value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged and will be removed in an upcoming major release. Please refer to ' + 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) {
|
13322 | config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
|
13323 | });
|
13324 |
|
13325 | hooks.ISO_8601 = function () {};
|
13326 |
|
13327 |
|
13328 | hooks.RFC_2822 = function () {};
|
13329 |
|
13330 |
|
13331 | function configFromStringAndFormat(config) {
|
13332 | var _context3;
|
13333 |
|
13334 |
|
13335 | if (config._f === hooks.ISO_8601) {
|
13336 | configFromISO(config);
|
13337 | return;
|
13338 | }
|
13339 |
|
13340 | if (config._f === hooks.RFC_2822) {
|
13341 | configFromRFC2822(config);
|
13342 | return;
|
13343 | }
|
13344 |
|
13345 | config._a = [];
|
13346 | getParsingFlags(config).empty = true;
|
13347 |
|
13348 | var string = '' + config._i,
|
13349 | i,
|
13350 | parsedInput,
|
13351 | tokens,
|
13352 | token,
|
13353 | skipped,
|
13354 | stringLength = string.length,
|
13355 | totalParsedInputLength = 0;
|
13356 | tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
|
13357 |
|
13358 | for (i = 0; i < tokens.length; i++) {
|
13359 | token = tokens[i];
|
13360 | parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
|
13361 |
|
13362 |
|
13363 | if (parsedInput) {
|
13364 | skipped = string.substr(0, indexOf$3$1(string).call(string, parsedInput));
|
13365 |
|
13366 | if (skipped.length > 0) {
|
13367 | getParsingFlags(config).unusedInput.push(skipped);
|
13368 | }
|
13369 |
|
13370 | string = slice$2$1(string).call(string, indexOf$3$1(string).call(string, parsedInput) + parsedInput.length);
|
13371 | totalParsedInputLength += parsedInput.length;
|
13372 | }
|
13373 |
|
13374 |
|
13375 | if (formatTokenFunctions[token]) {
|
13376 | if (parsedInput) {
|
13377 | getParsingFlags(config).empty = false;
|
13378 | } else {
|
13379 | getParsingFlags(config).unusedTokens.push(token);
|
13380 | }
|
13381 |
|
13382 | addTimeToArrayFromToken(token, parsedInput, config);
|
13383 | } else if (config._strict && !parsedInput) {
|
13384 | getParsingFlags(config).unusedTokens.push(token);
|
13385 | }
|
13386 | }
|
13387 |
|
13388 |
|
13389 | getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
|
13390 |
|
13391 | if (string.length > 0) {
|
13392 | getParsingFlags(config).unusedInput.push(string);
|
13393 | }
|
13394 |
|
13395 |
|
13396 | if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {
|
13397 | getParsingFlags(config).bigHour = undefined;
|
13398 | }
|
13399 |
|
13400 | getParsingFlags(config).parsedDateParts = slice$2$1(_context3 = config._a).call(_context3, 0);
|
13401 | getParsingFlags(config).meridiem = config._meridiem;
|
13402 |
|
13403 | config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
|
13404 | configFromArray(config);
|
13405 | checkOverflow(config);
|
13406 | }
|
13407 |
|
13408 | function meridiemFixWrap(locale, hour, meridiem) {
|
13409 | var isPm;
|
13410 |
|
13411 | if (meridiem == null) {
|
13412 |
|
13413 | return hour;
|
13414 | }
|
13415 |
|
13416 | if (locale.meridiemHour != null) {
|
13417 | return locale.meridiemHour(hour, meridiem);
|
13418 | } else if (locale.isPM != null) {
|
13419 |
|
13420 | isPm = locale.isPM(meridiem);
|
13421 |
|
13422 | if (isPm && hour < 12) {
|
13423 | hour += 12;
|
13424 | }
|
13425 |
|
13426 | if (!isPm && hour === 12) {
|
13427 | hour = 0;
|
13428 | }
|
13429 |
|
13430 | return hour;
|
13431 | } else {
|
13432 |
|
13433 | return hour;
|
13434 | }
|
13435 | }
|
13436 |
|
13437 |
|
13438 | function configFromStringAndArray(config) {
|
13439 | var tempConfig, bestMoment, scoreToBeat, i, currentScore;
|
13440 |
|
13441 | if (config._f.length === 0) {
|
13442 | getParsingFlags(config).invalidFormat = true;
|
13443 | config._d = new Date(NaN);
|
13444 | return;
|
13445 | }
|
13446 |
|
13447 | for (i = 0; i < config._f.length; i++) {
|
13448 | currentScore = 0;
|
13449 | tempConfig = copyConfig({}, config);
|
13450 |
|
13451 | if (config._useUTC != null) {
|
13452 | tempConfig._useUTC = config._useUTC;
|
13453 | }
|
13454 |
|
13455 | tempConfig._f = config._f[i];
|
13456 | configFromStringAndFormat(tempConfig);
|
13457 |
|
13458 | if (!isValid(tempConfig)) {
|
13459 | continue;
|
13460 | }
|
13461 |
|
13462 |
|
13463 | currentScore += getParsingFlags(tempConfig).charsLeftOver;
|
13464 |
|
13465 | currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
|
13466 | getParsingFlags(tempConfig).score = currentScore;
|
13467 |
|
13468 | if (scoreToBeat == null || currentScore < scoreToBeat) {
|
13469 | scoreToBeat = currentScore;
|
13470 | bestMoment = tempConfig;
|
13471 | }
|
13472 | }
|
13473 |
|
13474 | extend(config, bestMoment || tempConfig);
|
13475 | }
|
13476 |
|
13477 | function configFromObject(config) {
|
13478 | if (config._d) {
|
13479 | return;
|
13480 | }
|
13481 |
|
13482 | var i = normalizeObjectUnits(config._i);
|
13483 | config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
|
13484 | return obj && _parseInt$3$1(obj, 10);
|
13485 | });
|
13486 | configFromArray(config);
|
13487 | }
|
13488 |
|
13489 | function createFromConfig(config) {
|
13490 | var res = new Moment(checkOverflow(prepareConfig(config)));
|
13491 |
|
13492 | if (res._nextDay) {
|
13493 |
|
13494 | res.add(1, 'd');
|
13495 | res._nextDay = undefined;
|
13496 | }
|
13497 |
|
13498 | return res;
|
13499 | }
|
13500 |
|
13501 | function prepareConfig(config) {
|
13502 | var input = config._i,
|
13503 | format = config._f;
|
13504 | config._locale = config._locale || getLocale(config._l);
|
13505 |
|
13506 | if (input === null || format === undefined && input === '') {
|
13507 | return createInvalid({
|
13508 | nullInput: true
|
13509 | });
|
13510 | }
|
13511 |
|
13512 | if (typeof input === 'string') {
|
13513 | config._i = input = config._locale.preparse(input);
|
13514 | }
|
13515 |
|
13516 | if (isMoment(input)) {
|
13517 | return new Moment(checkOverflow(input));
|
13518 | } else if (isDate(input)) {
|
13519 | config._d = input;
|
13520 | } else if (isArray(format)) {
|
13521 | configFromStringAndArray(config);
|
13522 | } else if (format) {
|
13523 | configFromStringAndFormat(config);
|
13524 | } else {
|
13525 | configFromInput(config);
|
13526 | }
|
13527 |
|
13528 | if (!isValid(config)) {
|
13529 | config._d = null;
|
13530 | }
|
13531 |
|
13532 | return config;
|
13533 | }
|
13534 |
|
13535 | function configFromInput(config) {
|
13536 | var input = config._i;
|
13537 |
|
13538 | if (isUndefined(input)) {
|
13539 | config._d = new Date(hooks.now());
|
13540 | } else if (isDate(input)) {
|
13541 | config._d = new Date(input.valueOf());
|
13542 | } else if (typeof input === 'string') {
|
13543 | configFromString(config);
|
13544 | } else if (isArray(input)) {
|
13545 | config._a = map(slice$2$1(input).call(input, 0), function (obj) {
|
13546 | return _parseInt$3$1(obj, 10);
|
13547 | });
|
13548 | configFromArray(config);
|
13549 | } else if (isObject(input)) {
|
13550 | configFromObject(config);
|
13551 | } else if (isNumber(input)) {
|
13552 |
|
13553 | config._d = new Date(input);
|
13554 | } else {
|
13555 | hooks.createFromInputFallback(config);
|
13556 | }
|
13557 | }
|
13558 |
|
13559 | function createLocalOrUTC(input, format, locale, strict, isUTC) {
|
13560 | var c = {};
|
13561 |
|
13562 | if (locale === true || locale === false) {
|
13563 | strict = locale;
|
13564 | locale = undefined;
|
13565 | }
|
13566 |
|
13567 | if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {
|
13568 | input = undefined;
|
13569 | }
|
13570 |
|
13571 |
|
13572 |
|
13573 | c._isAMomentObject = true;
|
13574 | c._useUTC = c._isUTC = isUTC;
|
13575 | c._l = locale;
|
13576 | c._i = input;
|
13577 | c._f = format;
|
13578 | c._strict = strict;
|
13579 | return createFromConfig(c);
|
13580 | }
|
13581 |
|
13582 | function createLocal(input, format, locale, strict) {
|
13583 | return createLocalOrUTC(input, format, locale, strict, false);
|
13584 | }
|
13585 |
|
13586 | var prototypeMin = deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () {
|
13587 | var other = createLocal.apply(null, arguments);
|
13588 |
|
13589 | if (this.isValid() && other.isValid()) {
|
13590 | return other < this ? this : other;
|
13591 | } else {
|
13592 | return createInvalid();
|
13593 | }
|
13594 | });
|
13595 | var prototypeMax = deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () {
|
13596 | var other = createLocal.apply(null, arguments);
|
13597 |
|
13598 | if (this.isValid() && other.isValid()) {
|
13599 | return other > this ? this : other;
|
13600 | } else {
|
13601 | return createInvalid();
|
13602 | }
|
13603 | });
|
13604 |
|
13605 |
|
13606 |
|
13607 |
|
13608 |
|
13609 | function pickBy(fn, moments) {
|
13610 | var res, i;
|
13611 |
|
13612 | if (moments.length === 1 && isArray(moments[0])) {
|
13613 | moments = moments[0];
|
13614 | }
|
13615 |
|
13616 | if (!moments.length) {
|
13617 | return createLocal();
|
13618 | }
|
13619 |
|
13620 | res = moments[0];
|
13621 |
|
13622 | for (i = 1; i < moments.length; ++i) {
|
13623 | if (!moments[i].isValid() || moments[i][fn](res)) {
|
13624 | res = moments[i];
|
13625 | }
|
13626 | }
|
13627 |
|
13628 | return res;
|
13629 | }
|
13630 |
|
13631 |
|
13632 | function min() {
|
13633 | var args = slice$2$1([]).call(arguments, 0);
|
13634 | return pickBy('isBefore', args);
|
13635 | }
|
13636 |
|
13637 | function max() {
|
13638 | var args = slice$2$1([]).call(arguments, 0);
|
13639 | return pickBy('isAfter', args);
|
13640 | }
|
13641 |
|
13642 | var now = function now() {
|
13643 | return now$2 ? now$2() : +new Date();
|
13644 | };
|
13645 |
|
13646 | var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];
|
13647 |
|
13648 | function isDurationValid(m) {
|
13649 | for (var key in m) {
|
13650 | if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
|
13651 | return false;
|
13652 | }
|
13653 | }
|
13654 |
|
13655 | var unitHasDecimal = false;
|
13656 |
|
13657 | for (var i = 0; i < ordering.length; ++i) {
|
13658 | if (m[ordering[i]]) {
|
13659 | if (unitHasDecimal) {
|
13660 | return false;
|
13661 | }
|
13662 |
|
13663 | if (_parseFloat$3(m[ordering[i]]) !== toInt(m[ordering[i]])) {
|
13664 | unitHasDecimal = true;
|
13665 | }
|
13666 | }
|
13667 | }
|
13668 |
|
13669 | return true;
|
13670 | }
|
13671 |
|
13672 | function isValid$1() {
|
13673 | return this._isValid;
|
13674 | }
|
13675 |
|
13676 | function createInvalid$1() {
|
13677 | return createDuration(NaN);
|
13678 | }
|
13679 |
|
13680 | function Duration(duration) {
|
13681 | var normalizedInput = normalizeObjectUnits(duration),
|
13682 | years = normalizedInput.year || 0,
|
13683 | quarters = normalizedInput.quarter || 0,
|
13684 | months = normalizedInput.month || 0,
|
13685 | weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
|
13686 | days = normalizedInput.day || 0,
|
13687 | hours = normalizedInput.hour || 0,
|
13688 | minutes = normalizedInput.minute || 0,
|
13689 | seconds = normalizedInput.second || 0,
|
13690 | milliseconds = normalizedInput.millisecond || 0;
|
13691 | this._isValid = isDurationValid(normalizedInput);
|
13692 |
|
13693 | this._milliseconds = +milliseconds + seconds * 1e3 +
|
13694 | minutes * 6e4 +
|
13695 | hours * 1000 * 60 * 60;
|
13696 |
|
13697 |
|
13698 |
|
13699 | this._days = +days + weeks * 7;
|
13700 |
|
13701 |
|
13702 |
|
13703 | this._months = +months + quarters * 3 + years * 12;
|
13704 | this._data = {};
|
13705 | this._locale = getLocale();
|
13706 |
|
13707 | this._bubble();
|
13708 | }
|
13709 |
|
13710 | function isDuration(obj) {
|
13711 | return obj instanceof Duration;
|
13712 | }
|
13713 |
|
13714 | function absRound(number) {
|
13715 | if (number < 0) {
|
13716 | return Math.round(-1 * number) * -1;
|
13717 | } else {
|
13718 | return Math.round(number);
|
13719 | }
|
13720 | }
|
13721 |
|
13722 |
|
13723 | function offset(token, separator) {
|
13724 | addFormatToken(token, 0, 0, function () {
|
13725 | var offset = this.utcOffset();
|
13726 | var sign = '+';
|
13727 |
|
13728 | if (offset < 0) {
|
13729 | offset = -offset;
|
13730 | sign = '-';
|
13731 | }
|
13732 |
|
13733 | return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2);
|
13734 | });
|
13735 | }
|
13736 |
|
13737 | offset('Z', ':');
|
13738 | offset('ZZ', '');
|
13739 |
|
13740 | addRegexToken('Z', matchShortOffset);
|
13741 | addRegexToken('ZZ', matchShortOffset);
|
13742 | addParseToken(['Z', 'ZZ'], function (input, array, config) {
|
13743 | config._useUTC = true;
|
13744 | config._tzm = offsetFromString(matchShortOffset, input);
|
13745 | });
|
13746 |
|
13747 |
|
13748 |
|
13749 |
|
13750 | var chunkOffset = /([\+\-]|\d\d)/gi;
|
13751 |
|
13752 | function offsetFromString(matcher, string) {
|
13753 | var matches = (string || '').match(matcher);
|
13754 |
|
13755 | if (matches === null) {
|
13756 | return null;
|
13757 | }
|
13758 |
|
13759 | var chunk = matches[matches.length - 1] || [];
|
13760 | var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
|
13761 | var minutes = +(parts[1] * 60) + toInt(parts[2]);
|
13762 | return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
|
13763 | }
|
13764 |
|
13765 |
|
13766 | function cloneWithOffset(input, model) {
|
13767 | var res, diff;
|
13768 |
|
13769 | if (model._isUTC) {
|
13770 | res = model.clone();
|
13771 | diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
|
13772 |
|
13773 | res._d.setTime(res._d.valueOf() + diff);
|
13774 |
|
13775 | hooks.updateOffset(res, false);
|
13776 | return res;
|
13777 | } else {
|
13778 | return createLocal(input).local();
|
13779 | }
|
13780 | }
|
13781 |
|
13782 | function getDateOffset(m) {
|
13783 |
|
13784 |
|
13785 | return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
|
13786 | }
|
13787 |
|
13788 |
|
13789 |
|
13790 |
|
13791 | hooks.updateOffset = function () {};
|
13792 |
|
13793 |
|
13794 |
|
13795 |
|
13796 |
|
13797 |
|
13798 |
|
13799 |
|
13800 |
|
13801 |
|
13802 |
|
13803 |
|
13804 | function getSetOffset(input, keepLocalTime, keepMinutes) {
|
13805 | var offset = this._offset || 0,
|
13806 | localAdjust;
|
13807 |
|
13808 | if (!this.isValid()) {
|
13809 | return input != null ? this : NaN;
|
13810 | }
|
13811 |
|
13812 | if (input != null) {
|
13813 | if (typeof input === 'string') {
|
13814 | input = offsetFromString(matchShortOffset, input);
|
13815 |
|
13816 | if (input === null) {
|
13817 | return this;
|
13818 | }
|
13819 | } else if (Math.abs(input) < 16 && !keepMinutes) {
|
13820 | input = input * 60;
|
13821 | }
|
13822 |
|
13823 | if (!this._isUTC && keepLocalTime) {
|
13824 | localAdjust = getDateOffset(this);
|
13825 | }
|
13826 |
|
13827 | this._offset = input;
|
13828 | this._isUTC = true;
|
13829 |
|
13830 | if (localAdjust != null) {
|
13831 | this.add(localAdjust, 'm');
|
13832 | }
|
13833 |
|
13834 | if (offset !== input) {
|
13835 | if (!keepLocalTime || this._changeInProgress) {
|
13836 | addSubtract(this, createDuration(input - offset, 'm'), 1, false);
|
13837 | } else if (!this._changeInProgress) {
|
13838 | this._changeInProgress = true;
|
13839 | hooks.updateOffset(this, true);
|
13840 | this._changeInProgress = null;
|
13841 | }
|
13842 | }
|
13843 |
|
13844 | return this;
|
13845 | } else {
|
13846 | return this._isUTC ? offset : getDateOffset(this);
|
13847 | }
|
13848 | }
|
13849 |
|
13850 | function getSetZone(input, keepLocalTime) {
|
13851 | if (input != null) {
|
13852 | if (typeof input !== 'string') {
|
13853 | input = -input;
|
13854 | }
|
13855 |
|
13856 | this.utcOffset(input, keepLocalTime);
|
13857 | return this;
|
13858 | } else {
|
13859 | return -this.utcOffset();
|
13860 | }
|
13861 | }
|
13862 |
|
13863 | function setOffsetToUTC(keepLocalTime) {
|
13864 | return this.utcOffset(0, keepLocalTime);
|
13865 | }
|
13866 |
|
13867 | function setOffsetToLocal(keepLocalTime) {
|
13868 | if (this._isUTC) {
|
13869 | this.utcOffset(0, keepLocalTime);
|
13870 | this._isUTC = false;
|
13871 |
|
13872 | if (keepLocalTime) {
|
13873 | this.subtract(getDateOffset(this), 'm');
|
13874 | }
|
13875 | }
|
13876 |
|
13877 | return this;
|
13878 | }
|
13879 |
|
13880 | function setOffsetToParsedOffset() {
|
13881 | if (this._tzm != null) {
|
13882 | this.utcOffset(this._tzm, false, true);
|
13883 | } else if (typeof this._i === 'string') {
|
13884 | var tZone = offsetFromString(matchOffset, this._i);
|
13885 |
|
13886 | if (tZone != null) {
|
13887 | this.utcOffset(tZone);
|
13888 | } else {
|
13889 | this.utcOffset(0, true);
|
13890 | }
|
13891 | }
|
13892 |
|
13893 | return this;
|
13894 | }
|
13895 |
|
13896 | function hasAlignedHourOffset(input) {
|
13897 | if (!this.isValid()) {
|
13898 | return false;
|
13899 | }
|
13900 |
|
13901 | input = input ? createLocal(input).utcOffset() : 0;
|
13902 | return (this.utcOffset() - input) % 60 === 0;
|
13903 | }
|
13904 |
|
13905 | function isDaylightSavingTime() {
|
13906 | return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
|
13907 | }
|
13908 |
|
13909 | function isDaylightSavingTimeShifted() {
|
13910 | if (!isUndefined(this._isDSTShifted)) {
|
13911 | return this._isDSTShifted;
|
13912 | }
|
13913 |
|
13914 | var c = {};
|
13915 | copyConfig(c, this);
|
13916 | c = prepareConfig(c);
|
13917 |
|
13918 | if (c._a) {
|
13919 | var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
|
13920 | this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;
|
13921 | } else {
|
13922 | this._isDSTShifted = false;
|
13923 | }
|
13924 |
|
13925 | return this._isDSTShifted;
|
13926 | }
|
13927 |
|
13928 | function isLocal() {
|
13929 | return this.isValid() ? !this._isUTC : false;
|
13930 | }
|
13931 |
|
13932 | function isUtcOffset() {
|
13933 | return this.isValid() ? this._isUTC : false;
|
13934 | }
|
13935 |
|
13936 | function isUtc() {
|
13937 | return this.isValid() ? this._isUTC && this._offset === 0 : false;
|
13938 | }
|
13939 |
|
13940 |
|
13941 | var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
|
13942 |
|
13943 |
|
13944 |
|
13945 | var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
|
13946 |
|
13947 | function createDuration(input, key) {
|
13948 | var duration = input,
|
13949 |
|
13950 | match = null,
|
13951 | sign,
|
13952 | ret,
|
13953 | diffRes;
|
13954 |
|
13955 | if (isDuration(input)) {
|
13956 | duration = {
|
13957 | ms: input._milliseconds,
|
13958 | d: input._days,
|
13959 | M: input._months
|
13960 | };
|
13961 | } else if (isNumber(input)) {
|
13962 | duration = {};
|
13963 |
|
13964 | if (key) {
|
13965 | duration[key] = input;
|
13966 | } else {
|
13967 | duration.milliseconds = input;
|
13968 | }
|
13969 | } else if (!!(match = aspNetRegex.exec(input))) {
|
13970 | sign = match[1] === '-' ? -1 : 1;
|
13971 | duration = {
|
13972 | y: 0,
|
13973 | d: toInt(match[DATE]) * sign,
|
13974 | h: toInt(match[HOUR]) * sign,
|
13975 | m: toInt(match[MINUTE]) * sign,
|
13976 | s: toInt(match[SECOND]) * sign,
|
13977 | ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign
|
13978 |
|
13979 | };
|
13980 | } else if (!!(match = isoRegex.exec(input))) {
|
13981 | sign = match[1] === '-' ? -1 : 1;
|
13982 | duration = {
|
13983 | y: parseIso(match[2], sign),
|
13984 | M: parseIso(match[3], sign),
|
13985 | w: parseIso(match[4], sign),
|
13986 | d: parseIso(match[5], sign),
|
13987 | h: parseIso(match[6], sign),
|
13988 | m: parseIso(match[7], sign),
|
13989 | s: parseIso(match[8], sign)
|
13990 | };
|
13991 | } else if (duration == null) {
|
13992 |
|
13993 | duration = {};
|
13994 | } else if (_typeof_1$1$1(duration) === 'object' && ('from' in duration || 'to' in duration)) {
|
13995 | diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
|
13996 | duration = {};
|
13997 | duration.ms = diffRes.milliseconds;
|
13998 | duration.M = diffRes.months;
|
13999 | }
|
14000 |
|
14001 | ret = new Duration(duration);
|
14002 |
|
14003 | if (isDuration(input) && hasOwnProp(input, '_locale')) {
|
14004 | ret._locale = input._locale;
|
14005 | }
|
14006 |
|
14007 | return ret;
|
14008 | }
|
14009 |
|
14010 | createDuration.fn = Duration.prototype;
|
14011 | createDuration.invalid = createInvalid$1;
|
14012 |
|
14013 | function parseIso(inp, sign) {
|
14014 |
|
14015 |
|
14016 |
|
14017 | var res = inp && _parseFloat$3(inp.replace(',', '.'));
|
14018 |
|
14019 |
|
14020 | return (isNaN(res) ? 0 : res) * sign;
|
14021 | }
|
14022 |
|
14023 | function positiveMomentsDifference(base, other) {
|
14024 | var res = {};
|
14025 | res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
|
14026 |
|
14027 | if (base.clone().add(res.months, 'M').isAfter(other)) {
|
14028 | --res.months;
|
14029 | }
|
14030 |
|
14031 | res.milliseconds = +other - +base.clone().add(res.months, 'M');
|
14032 | return res;
|
14033 | }
|
14034 |
|
14035 | function momentsDifference(base, other) {
|
14036 | var res;
|
14037 |
|
14038 | if (!(base.isValid() && other.isValid())) {
|
14039 | return {
|
14040 | milliseconds: 0,
|
14041 | months: 0
|
14042 | };
|
14043 | }
|
14044 |
|
14045 | other = cloneWithOffset(other, base);
|
14046 |
|
14047 | if (base.isBefore(other)) {
|
14048 | res = positiveMomentsDifference(base, other);
|
14049 | } else {
|
14050 | res = positiveMomentsDifference(other, base);
|
14051 | res.milliseconds = -res.milliseconds;
|
14052 | res.months = -res.months;
|
14053 | }
|
14054 |
|
14055 | return res;
|
14056 | }
|
14057 |
|
14058 |
|
14059 | function createAdder(direction, name) {
|
14060 | return function (val, period) {
|
14061 | var dur, tmp;
|
14062 |
|
14063 | if (period !== null && !isNaN(+period)) {
|
14064 | deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
|
14065 | tmp = val;
|
14066 | val = period;
|
14067 | period = tmp;
|
14068 | }
|
14069 |
|
14070 | val = typeof val === 'string' ? +val : val;
|
14071 | dur = createDuration(val, period);
|
14072 | addSubtract(this, dur, direction);
|
14073 | return this;
|
14074 | };
|
14075 | }
|
14076 |
|
14077 | function addSubtract(mom, duration, isAdding, updateOffset) {
|
14078 | var milliseconds = duration._milliseconds,
|
14079 | days = absRound(duration._days),
|
14080 | months = absRound(duration._months);
|
14081 |
|
14082 | if (!mom.isValid()) {
|
14083 |
|
14084 | return;
|
14085 | }
|
14086 |
|
14087 | updateOffset = updateOffset == null ? true : updateOffset;
|
14088 |
|
14089 | if (months) {
|
14090 | setMonth(mom, get(mom, 'Month') + months * isAdding);
|
14091 | }
|
14092 |
|
14093 | if (days) {
|
14094 | set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
|
14095 | }
|
14096 |
|
14097 | if (milliseconds) {
|
14098 | mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
|
14099 | }
|
14100 |
|
14101 | if (updateOffset) {
|
14102 | hooks.updateOffset(mom, days || months);
|
14103 | }
|
14104 | }
|
14105 |
|
14106 | var add = createAdder(1, 'add');
|
14107 | var subtract = createAdder(-1, 'subtract');
|
14108 |
|
14109 | function getCalendarFormat(myMoment, now) {
|
14110 | var diff = myMoment.diff(now, 'days', true);
|
14111 | return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse';
|
14112 | }
|
14113 |
|
14114 | function calendar$1(time, formats) {
|
14115 |
|
14116 |
|
14117 | var now = time || createLocal(),
|
14118 | sod = cloneWithOffset(now, this).startOf('day'),
|
14119 | format = hooks.calendarFormat(this, sod) || 'sameElse';
|
14120 | var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
|
14121 | return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
|
14122 | }
|
14123 |
|
14124 | function clone() {
|
14125 | return new Moment(this);
|
14126 | }
|
14127 |
|
14128 | function isAfter(input, units) {
|
14129 | var localInput = isMoment(input) ? input : createLocal(input);
|
14130 |
|
14131 | if (!(this.isValid() && localInput.isValid())) {
|
14132 | return false;
|
14133 | }
|
14134 |
|
14135 | units = normalizeUnits(units) || 'millisecond';
|
14136 |
|
14137 | if (units === 'millisecond') {
|
14138 | return this.valueOf() > localInput.valueOf();
|
14139 | } else {
|
14140 | return localInput.valueOf() < this.clone().startOf(units).valueOf();
|
14141 | }
|
14142 | }
|
14143 |
|
14144 | function isBefore(input, units) {
|
14145 | var localInput = isMoment(input) ? input : createLocal(input);
|
14146 |
|
14147 | if (!(this.isValid() && localInput.isValid())) {
|
14148 | return false;
|
14149 | }
|
14150 |
|
14151 | units = normalizeUnits(units) || 'millisecond';
|
14152 |
|
14153 | if (units === 'millisecond') {
|
14154 | return this.valueOf() < localInput.valueOf();
|
14155 | } else {
|
14156 | return this.clone().endOf(units).valueOf() < localInput.valueOf();
|
14157 | }
|
14158 | }
|
14159 |
|
14160 | function isBetween(from, to, units, inclusivity) {
|
14161 | var localFrom = isMoment(from) ? from : createLocal(from),
|
14162 | localTo = isMoment(to) ? to : createLocal(to);
|
14163 |
|
14164 | if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
|
14165 | return false;
|
14166 | }
|
14167 |
|
14168 | inclusivity = inclusivity || '()';
|
14169 | return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
|
14170 | }
|
14171 |
|
14172 | function isSame(input, units) {
|
14173 | var localInput = isMoment(input) ? input : createLocal(input),
|
14174 | inputMs;
|
14175 |
|
14176 | if (!(this.isValid() && localInput.isValid())) {
|
14177 | return false;
|
14178 | }
|
14179 |
|
14180 | units = normalizeUnits(units) || 'millisecond';
|
14181 |
|
14182 | if (units === 'millisecond') {
|
14183 | return this.valueOf() === localInput.valueOf();
|
14184 | } else {
|
14185 | inputMs = localInput.valueOf();
|
14186 | return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
|
14187 | }
|
14188 | }
|
14189 |
|
14190 | function isSameOrAfter(input, units) {
|
14191 | return this.isSame(input, units) || this.isAfter(input, units);
|
14192 | }
|
14193 |
|
14194 | function isSameOrBefore(input, units) {
|
14195 | return this.isSame(input, units) || this.isBefore(input, units);
|
14196 | }
|
14197 |
|
14198 | function diff(input, units, asFloat) {
|
14199 | var that, zoneDelta, output;
|
14200 |
|
14201 | if (!this.isValid()) {
|
14202 | return NaN;
|
14203 | }
|
14204 |
|
14205 | that = cloneWithOffset(input, this);
|
14206 |
|
14207 | if (!that.isValid()) {
|
14208 | return NaN;
|
14209 | }
|
14210 |
|
14211 | zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
|
14212 | units = normalizeUnits(units);
|
14213 |
|
14214 | switch (units) {
|
14215 | case 'year':
|
14216 | output = monthDiff(this, that) / 12;
|
14217 | break;
|
14218 |
|
14219 | case 'month':
|
14220 | output = monthDiff(this, that);
|
14221 | break;
|
14222 |
|
14223 | case 'quarter':
|
14224 | output = monthDiff(this, that) / 3;
|
14225 | break;
|
14226 |
|
14227 | case 'second':
|
14228 | output = (this - that) / 1e3;
|
14229 | break;
|
14230 |
|
14231 |
|
14232 | case 'minute':
|
14233 | output = (this - that) / 6e4;
|
14234 | break;
|
14235 |
|
14236 |
|
14237 | case 'hour':
|
14238 | output = (this - that) / 36e5;
|
14239 | break;
|
14240 |
|
14241 |
|
14242 | case 'day':
|
14243 | output = (this - that - zoneDelta) / 864e5;
|
14244 | break;
|
14245 |
|
14246 |
|
14247 | case 'week':
|
14248 | output = (this - that - zoneDelta) / 6048e5;
|
14249 | break;
|
14250 |
|
14251 |
|
14252 | default:
|
14253 | output = this - that;
|
14254 | }
|
14255 |
|
14256 | return asFloat ? output : absFloor(output);
|
14257 | }
|
14258 |
|
14259 | function monthDiff(a, b) {
|
14260 |
|
14261 | var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
|
14262 |
|
14263 | anchor = a.clone().add(wholeMonthDiff, 'months'),
|
14264 | anchor2,
|
14265 | adjust;
|
14266 |
|
14267 | if (b - anchor < 0) {
|
14268 | anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
|
14269 |
|
14270 | adjust = (b - anchor) / (anchor - anchor2);
|
14271 | } else {
|
14272 | anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
|
14273 |
|
14274 | adjust = (b - anchor) / (anchor2 - anchor);
|
14275 | }
|
14276 |
|
14277 |
|
14278 | return -(wholeMonthDiff + adjust) || 0;
|
14279 | }
|
14280 |
|
14281 | hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
|
14282 | hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
|
14283 |
|
14284 | function toString() {
|
14285 | return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
|
14286 | }
|
14287 |
|
14288 | function toISOString(keepOffset) {
|
14289 | if (!this.isValid()) {
|
14290 | return null;
|
14291 | }
|
14292 |
|
14293 | var utc = keepOffset !== true;
|
14294 | var m = utc ? this.clone().utc() : this;
|
14295 |
|
14296 | if (m.year() < 0 || m.year() > 9999) {
|
14297 | return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');
|
14298 | }
|
14299 |
|
14300 | if (isFunction(Date.prototype.toISOString)) {
|
14301 |
|
14302 | if (utc) {
|
14303 | return this.toDate().toISOString();
|
14304 | } else {
|
14305 | return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));
|
14306 | }
|
14307 | }
|
14308 |
|
14309 | return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');
|
14310 | }
|
14311 | |
14312 |
|
14313 |
|
14314 |
|
14315 |
|
14316 |
|
14317 |
|
14318 |
|
14319 | function inspect() {
|
14320 | if (!this.isValid()) {
|
14321 | return 'moment.invalid(/* ' + this._i + ' */)';
|
14322 | }
|
14323 |
|
14324 | var func = 'moment';
|
14325 | var zone = '';
|
14326 |
|
14327 | if (!this.isLocal()) {
|
14328 | func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
|
14329 | zone = 'Z';
|
14330 | }
|
14331 |
|
14332 | var prefix = '[' + func + '("]';
|
14333 | var year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
|
14334 | var datetime = '-MM-DD[T]HH:mm:ss.SSS';
|
14335 | var suffix = zone + '[")]';
|
14336 | return this.format(prefix + year + datetime + suffix);
|
14337 | }
|
14338 |
|
14339 | function format(inputString) {
|
14340 | if (!inputString) {
|
14341 | inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
|
14342 | }
|
14343 |
|
14344 | var output = formatMoment(this, inputString);
|
14345 | return this.localeData().postformat(output);
|
14346 | }
|
14347 |
|
14348 | function from(time, withoutSuffix) {
|
14349 | if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
|
14350 | return createDuration({
|
14351 | to: this,
|
14352 | from: time
|
14353 | }).locale(this.locale()).humanize(!withoutSuffix);
|
14354 | } else {
|
14355 | return this.localeData().invalidDate();
|
14356 | }
|
14357 | }
|
14358 |
|
14359 | function fromNow(withoutSuffix) {
|
14360 | return this.from(createLocal(), withoutSuffix);
|
14361 | }
|
14362 |
|
14363 | function to(time, withoutSuffix) {
|
14364 | if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
|
14365 | return createDuration({
|
14366 | from: this,
|
14367 | to: time
|
14368 | }).locale(this.locale()).humanize(!withoutSuffix);
|
14369 | } else {
|
14370 | return this.localeData().invalidDate();
|
14371 | }
|
14372 | }
|
14373 |
|
14374 | function toNow(withoutSuffix) {
|
14375 | return this.to(createLocal(), withoutSuffix);
|
14376 | }
|
14377 |
|
14378 |
|
14379 |
|
14380 |
|
14381 | function locale(key) {
|
14382 | var newLocaleData;
|
14383 |
|
14384 | if (key === undefined) {
|
14385 | return this._locale._abbr;
|
14386 | } else {
|
14387 | newLocaleData = getLocale(key);
|
14388 |
|
14389 | if (newLocaleData != null) {
|
14390 | this._locale = newLocaleData;
|
14391 | }
|
14392 |
|
14393 | return this;
|
14394 | }
|
14395 | }
|
14396 |
|
14397 | var lang = deprecate('moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) {
|
14398 | if (key === undefined) {
|
14399 | return this.localeData();
|
14400 | } else {
|
14401 | return this.locale(key);
|
14402 | }
|
14403 | });
|
14404 |
|
14405 | function localeData() {
|
14406 | return this._locale;
|
14407 | }
|
14408 |
|
14409 | var MS_PER_SECOND = 1000;
|
14410 | var MS_PER_MINUTE = 60 * MS_PER_SECOND;
|
14411 | var MS_PER_HOUR = 60 * MS_PER_MINUTE;
|
14412 | var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
|
14413 |
|
14414 | function mod$1(dividend, divisor) {
|
14415 | return (dividend % divisor + divisor) % divisor;
|
14416 | }
|
14417 |
|
14418 | function localStartOfDate(y, m, d) {
|
14419 |
|
14420 | if (y < 100 && y >= 0) {
|
14421 |
|
14422 | return new Date(y + 400, m, d) - MS_PER_400_YEARS;
|
14423 | } else {
|
14424 | return new Date(y, m, d).valueOf();
|
14425 | }
|
14426 | }
|
14427 |
|
14428 | function utcStartOfDate(y, m, d) {
|
14429 |
|
14430 | if (y < 100 && y >= 0) {
|
14431 |
|
14432 | return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
|
14433 | } else {
|
14434 | return Date.UTC(y, m, d);
|
14435 | }
|
14436 | }
|
14437 |
|
14438 | function startOf(units) {
|
14439 | var time;
|
14440 | units = normalizeUnits(units);
|
14441 |
|
14442 | if (units === undefined || units === 'millisecond' || !this.isValid()) {
|
14443 | return this;
|
14444 | }
|
14445 |
|
14446 | var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
|
14447 |
|
14448 | switch (units) {
|
14449 | case 'year':
|
14450 | time = startOfDate(this.year(), 0, 1);
|
14451 | break;
|
14452 |
|
14453 | case 'quarter':
|
14454 | time = startOfDate(this.year(), this.month() - this.month() % 3, 1);
|
14455 | break;
|
14456 |
|
14457 | case 'month':
|
14458 | time = startOfDate(this.year(), this.month(), 1);
|
14459 | break;
|
14460 |
|
14461 | case 'week':
|
14462 | time = startOfDate(this.year(), this.month(), this.date() - this.weekday());
|
14463 | break;
|
14464 |
|
14465 | case 'isoWeek':
|
14466 | time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));
|
14467 | break;
|
14468 |
|
14469 | case 'day':
|
14470 | case 'date':
|
14471 | time = startOfDate(this.year(), this.month(), this.date());
|
14472 | break;
|
14473 |
|
14474 | case 'hour':
|
14475 | time = this._d.valueOf();
|
14476 | time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR);
|
14477 | break;
|
14478 |
|
14479 | case 'minute':
|
14480 | time = this._d.valueOf();
|
14481 | time -= mod$1(time, MS_PER_MINUTE);
|
14482 | break;
|
14483 |
|
14484 | case 'second':
|
14485 | time = this._d.valueOf();
|
14486 | time -= mod$1(time, MS_PER_SECOND);
|
14487 | break;
|
14488 | }
|
14489 |
|
14490 | this._d.setTime(time);
|
14491 |
|
14492 | hooks.updateOffset(this, true);
|
14493 | return this;
|
14494 | }
|
14495 |
|
14496 | function endOf(units) {
|
14497 | var time;
|
14498 | units = normalizeUnits(units);
|
14499 |
|
14500 | if (units === undefined || units === 'millisecond' || !this.isValid()) {
|
14501 | return this;
|
14502 | }
|
14503 |
|
14504 | var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
|
14505 |
|
14506 | switch (units) {
|
14507 | case 'year':
|
14508 | time = startOfDate(this.year() + 1, 0, 1) - 1;
|
14509 | break;
|
14510 |
|
14511 | case 'quarter':
|
14512 | time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;
|
14513 | break;
|
14514 |
|
14515 | case 'month':
|
14516 | time = startOfDate(this.year(), this.month() + 1, 1) - 1;
|
14517 | break;
|
14518 |
|
14519 | case 'week':
|
14520 | time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;
|
14521 | break;
|
14522 |
|
14523 | case 'isoWeek':
|
14524 | time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;
|
14525 | break;
|
14526 |
|
14527 | case 'day':
|
14528 | case 'date':
|
14529 | time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
|
14530 | break;
|
14531 |
|
14532 | case 'hour':
|
14533 | time = this._d.valueOf();
|
14534 | time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1;
|
14535 | break;
|
14536 |
|
14537 | case 'minute':
|
14538 | time = this._d.valueOf();
|
14539 | time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
|
14540 | break;
|
14541 |
|
14542 | case 'second':
|
14543 | time = this._d.valueOf();
|
14544 | time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
|
14545 | break;
|
14546 | }
|
14547 |
|
14548 | this._d.setTime(time);
|
14549 |
|
14550 | hooks.updateOffset(this, true);
|
14551 | return this;
|
14552 | }
|
14553 |
|
14554 | function valueOf() {
|
14555 | return this._d.valueOf() - (this._offset || 0) * 60000;
|
14556 | }
|
14557 |
|
14558 | function unix() {
|
14559 | return Math.floor(this.valueOf() / 1000);
|
14560 | }
|
14561 |
|
14562 | function toDate() {
|
14563 | return new Date(this.valueOf());
|
14564 | }
|
14565 |
|
14566 | function toArray() {
|
14567 | var m = this;
|
14568 | return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
|
14569 | }
|
14570 |
|
14571 | function toObject() {
|
14572 | var m = this;
|
14573 | return {
|
14574 | years: m.year(),
|
14575 | months: m.month(),
|
14576 | date: m.date(),
|
14577 | hours: m.hours(),
|
14578 | minutes: m.minutes(),
|
14579 | seconds: m.seconds(),
|
14580 | milliseconds: m.milliseconds()
|
14581 | };
|
14582 | }
|
14583 |
|
14584 | function toJSON() {
|
14585 |
|
14586 | return this.isValid() ? this.toISOString() : null;
|
14587 | }
|
14588 |
|
14589 | function isValid$2() {
|
14590 | return isValid(this);
|
14591 | }
|
14592 |
|
14593 | function parsingFlags() {
|
14594 | return extend({}, getParsingFlags(this));
|
14595 | }
|
14596 |
|
14597 | function invalidAt() {
|
14598 | return getParsingFlags(this).overflow;
|
14599 | }
|
14600 |
|
14601 | function creationData() {
|
14602 | return {
|
14603 | input: this._i,
|
14604 | format: this._f,
|
14605 | locale: this._locale,
|
14606 | isUTC: this._isUTC,
|
14607 | strict: this._strict
|
14608 | };
|
14609 | }
|
14610 |
|
14611 |
|
14612 | addFormatToken(0, ['gg', 2], 0, function () {
|
14613 | return this.weekYear() % 100;
|
14614 | });
|
14615 | addFormatToken(0, ['GG', 2], 0, function () {
|
14616 | return this.isoWeekYear() % 100;
|
14617 | });
|
14618 |
|
14619 | function addWeekYearFormatToken(token, getter) {
|
14620 | addFormatToken(0, [token, token.length], 0, getter);
|
14621 | }
|
14622 |
|
14623 | addWeekYearFormatToken('gggg', 'weekYear');
|
14624 | addWeekYearFormatToken('ggggg', 'weekYear');
|
14625 | addWeekYearFormatToken('GGGG', 'isoWeekYear');
|
14626 | addWeekYearFormatToken('GGGGG', 'isoWeekYear');
|
14627 |
|
14628 | addUnitAlias('weekYear', 'gg');
|
14629 | addUnitAlias('isoWeekYear', 'GG');
|
14630 |
|
14631 | addUnitPriority('weekYear', 1);
|
14632 | addUnitPriority('isoWeekYear', 1);
|
14633 |
|
14634 | addRegexToken('G', matchSigned);
|
14635 | addRegexToken('g', matchSigned);
|
14636 | addRegexToken('GG', match1to2, match2);
|
14637 | addRegexToken('gg', match1to2, match2);
|
14638 | addRegexToken('GGGG', match1to4, match4);
|
14639 | addRegexToken('gggg', match1to4, match4);
|
14640 | addRegexToken('GGGGG', match1to6, match6);
|
14641 | addRegexToken('ggggg', match1to6, match6);
|
14642 | addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
|
14643 | week[token.substr(0, 2)] = toInt(input);
|
14644 | });
|
14645 | addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
|
14646 | week[token] = hooks.parseTwoDigitYear(input);
|
14647 | });
|
14648 |
|
14649 | function getSetWeekYear(input) {
|
14650 | return getSetWeekYearHelper.call(this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy);
|
14651 | }
|
14652 |
|
14653 | function getSetISOWeekYear(input) {
|
14654 | return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4);
|
14655 | }
|
14656 |
|
14657 | function getISOWeeksInYear() {
|
14658 | return weeksInYear(this.year(), 1, 4);
|
14659 | }
|
14660 |
|
14661 | function getWeeksInYear() {
|
14662 | var weekInfo = this.localeData()._week;
|
14663 |
|
14664 | return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
|
14665 | }
|
14666 |
|
14667 | function getSetWeekYearHelper(input, week, weekday, dow, doy) {
|
14668 | var weeksTarget;
|
14669 |
|
14670 | if (input == null) {
|
14671 | return weekOfYear(this, dow, doy).year;
|
14672 | } else {
|
14673 | weeksTarget = weeksInYear(input, dow, doy);
|
14674 |
|
14675 | if (week > weeksTarget) {
|
14676 | week = weeksTarget;
|
14677 | }
|
14678 |
|
14679 | return setWeekAll.call(this, input, week, weekday, dow, doy);
|
14680 | }
|
14681 | }
|
14682 |
|
14683 | function setWeekAll(weekYear, week, weekday, dow, doy) {
|
14684 | var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
|
14685 | date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
|
14686 | this.year(date.getUTCFullYear());
|
14687 | this.month(date.getUTCMonth());
|
14688 | this.date(date.getUTCDate());
|
14689 | return this;
|
14690 | }
|
14691 |
|
14692 |
|
14693 | addFormatToken('Q', 0, 'Qo', 'quarter');
|
14694 |
|
14695 | addUnitAlias('quarter', 'Q');
|
14696 |
|
14697 | addUnitPriority('quarter', 7);
|
14698 |
|
14699 | addRegexToken('Q', match1);
|
14700 | addParseToken('Q', function (input, array) {
|
14701 | array[MONTH] = (toInt(input) - 1) * 3;
|
14702 | });
|
14703 |
|
14704 | function getSetQuarter(input) {
|
14705 | return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
|
14706 | }
|
14707 |
|
14708 |
|
14709 | addFormatToken('D', ['DD', 2], 'Do', 'date');
|
14710 |
|
14711 | addUnitAlias('date', 'D');
|
14712 |
|
14713 | addUnitPriority('date', 9);
|
14714 |
|
14715 | addRegexToken('D', match1to2);
|
14716 | addRegexToken('DD', match1to2, match2);
|
14717 | addRegexToken('Do', function (isStrict, locale) {
|
14718 |
|
14719 | return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient;
|
14720 | });
|
14721 | addParseToken(['D', 'DD'], DATE);
|
14722 | addParseToken('Do', function (input, array) {
|
14723 | array[DATE] = toInt(input.match(match1to2)[0]);
|
14724 | });
|
14725 |
|
14726 | var getSetDayOfMonth = makeGetSet('Date', true);
|
14727 |
|
14728 | addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
|
14729 |
|
14730 | addUnitAlias('dayOfYear', 'DDD');
|
14731 |
|
14732 | addUnitPriority('dayOfYear', 4);
|
14733 |
|
14734 | addRegexToken('DDD', match1to3);
|
14735 | addRegexToken('DDDD', match3);
|
14736 | addParseToken(['DDD', 'DDDD'], function (input, array, config) {
|
14737 | config._dayOfYear = toInt(input);
|
14738 | });
|
14739 |
|
14740 |
|
14741 | function getSetDayOfYear(input) {
|
14742 | var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
|
14743 | return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
|
14744 | }
|
14745 |
|
14746 |
|
14747 | addFormatToken('m', ['mm', 2], 0, 'minute');
|
14748 |
|
14749 | addUnitAlias('minute', 'm');
|
14750 |
|
14751 | addUnitPriority('minute', 14);
|
14752 |
|
14753 | addRegexToken('m', match1to2);
|
14754 | addRegexToken('mm', match1to2, match2);
|
14755 | addParseToken(['m', 'mm'], MINUTE);
|
14756 |
|
14757 | var getSetMinute = makeGetSet('Minutes', false);
|
14758 |
|
14759 | addFormatToken('s', ['ss', 2], 0, 'second');
|
14760 |
|
14761 | addUnitAlias('second', 's');
|
14762 |
|
14763 | addUnitPriority('second', 15);
|
14764 |
|
14765 | addRegexToken('s', match1to2);
|
14766 | addRegexToken('ss', match1to2, match2);
|
14767 | addParseToken(['s', 'ss'], SECOND);
|
14768 |
|
14769 | var getSetSecond = makeGetSet('Seconds', false);
|
14770 |
|
14771 | addFormatToken('S', 0, 0, function () {
|
14772 | return ~~(this.millisecond() / 100);
|
14773 | });
|
14774 | addFormatToken(0, ['SS', 2], 0, function () {
|
14775 | return ~~(this.millisecond() / 10);
|
14776 | });
|
14777 | addFormatToken(0, ['SSS', 3], 0, 'millisecond');
|
14778 | addFormatToken(0, ['SSSS', 4], 0, function () {
|
14779 | return this.millisecond() * 10;
|
14780 | });
|
14781 | addFormatToken(0, ['SSSSS', 5], 0, function () {
|
14782 | return this.millisecond() * 100;
|
14783 | });
|
14784 | addFormatToken(0, ['SSSSSS', 6], 0, function () {
|
14785 | return this.millisecond() * 1000;
|
14786 | });
|
14787 | addFormatToken(0, ['SSSSSSS', 7], 0, function () {
|
14788 | return this.millisecond() * 10000;
|
14789 | });
|
14790 | addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
|
14791 | return this.millisecond() * 100000;
|
14792 | });
|
14793 | addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
|
14794 | return this.millisecond() * 1000000;
|
14795 | });
|
14796 |
|
14797 | addUnitAlias('millisecond', 'ms');
|
14798 |
|
14799 | addUnitPriority('millisecond', 16);
|
14800 |
|
14801 | addRegexToken('S', match1to3, match1);
|
14802 | addRegexToken('SS', match1to3, match2);
|
14803 | addRegexToken('SSS', match1to3, match3);
|
14804 | var token;
|
14805 |
|
14806 | for (token = 'SSSS'; token.length <= 9; token += 'S') {
|
14807 | addRegexToken(token, matchUnsigned);
|
14808 | }
|
14809 |
|
14810 | function parseMs(input, array) {
|
14811 | array[MILLISECOND] = toInt(('0.' + input) * 1000);
|
14812 | }
|
14813 |
|
14814 | for (token = 'S'; token.length <= 9; token += 'S') {
|
14815 | addParseToken(token, parseMs);
|
14816 | }
|
14817 |
|
14818 |
|
14819 | var getSetMillisecond = makeGetSet('Milliseconds', false);
|
14820 |
|
14821 | addFormatToken('z', 0, 0, 'zoneAbbr');
|
14822 | addFormatToken('zz', 0, 0, 'zoneName');
|
14823 |
|
14824 | function getZoneAbbr() {
|
14825 | return this._isUTC ? 'UTC' : '';
|
14826 | }
|
14827 |
|
14828 | function getZoneName() {
|
14829 | return this._isUTC ? 'Coordinated Universal Time' : '';
|
14830 | }
|
14831 |
|
14832 | var proto = Moment.prototype;
|
14833 | proto.add = add;
|
14834 | proto.calendar = calendar$1;
|
14835 | proto.clone = clone;
|
14836 | proto.diff = diff;
|
14837 | proto.endOf = endOf;
|
14838 | proto.format = format;
|
14839 | proto.from = from;
|
14840 | proto.fromNow = fromNow;
|
14841 | proto.to = to;
|
14842 | proto.toNow = toNow;
|
14843 | proto.get = stringGet;
|
14844 | proto.invalidAt = invalidAt;
|
14845 | proto.isAfter = isAfter;
|
14846 | proto.isBefore = isBefore;
|
14847 | proto.isBetween = isBetween;
|
14848 | proto.isSame = isSame;
|
14849 | proto.isSameOrAfter = isSameOrAfter;
|
14850 | proto.isSameOrBefore = isSameOrBefore;
|
14851 | proto.isValid = isValid$2;
|
14852 | proto.lang = lang;
|
14853 | proto.locale = locale;
|
14854 | proto.localeData = localeData;
|
14855 | proto.max = prototypeMax;
|
14856 | proto.min = prototypeMin;
|
14857 | proto.parsingFlags = parsingFlags;
|
14858 | proto.set = stringSet;
|
14859 | proto.startOf = startOf;
|
14860 | proto.subtract = subtract;
|
14861 | proto.toArray = toArray;
|
14862 | proto.toObject = toObject;
|
14863 | proto.toDate = toDate;
|
14864 | proto.toISOString = toISOString;
|
14865 | proto.inspect = inspect;
|
14866 | proto.toJSON = toJSON;
|
14867 | proto.toString = toString;
|
14868 | proto.unix = unix;
|
14869 | proto.valueOf = valueOf;
|
14870 | proto.creationData = creationData;
|
14871 | proto.year = getSetYear;
|
14872 | proto.isLeapYear = getIsLeapYear;
|
14873 | proto.weekYear = getSetWeekYear;
|
14874 | proto.isoWeekYear = getSetISOWeekYear;
|
14875 | proto.quarter = proto.quarters = getSetQuarter;
|
14876 | proto.month = getSetMonth;
|
14877 | proto.daysInMonth = getDaysInMonth;
|
14878 | proto.week = proto.weeks = getSetWeek;
|
14879 | proto.isoWeek = proto.isoWeeks = getSetISOWeek;
|
14880 | proto.weeksInYear = getWeeksInYear;
|
14881 | proto.isoWeeksInYear = getISOWeeksInYear;
|
14882 | proto.date = getSetDayOfMonth;
|
14883 | proto.day = proto.days = getSetDayOfWeek;
|
14884 | proto.weekday = getSetLocaleDayOfWeek;
|
14885 | proto.isoWeekday = getSetISODayOfWeek;
|
14886 | proto.dayOfYear = getSetDayOfYear;
|
14887 | proto.hour = proto.hours = getSetHour;
|
14888 | proto.minute = proto.minutes = getSetMinute;
|
14889 | proto.second = proto.seconds = getSetSecond;
|
14890 | proto.millisecond = proto.milliseconds = getSetMillisecond;
|
14891 | proto.utcOffset = getSetOffset;
|
14892 | proto.utc = setOffsetToUTC;
|
14893 | proto.local = setOffsetToLocal;
|
14894 | proto.parseZone = setOffsetToParsedOffset;
|
14895 | proto.hasAlignedHourOffset = hasAlignedHourOffset;
|
14896 | proto.isDST = isDaylightSavingTime;
|
14897 | proto.isLocal = isLocal;
|
14898 | proto.isUtcOffset = isUtcOffset;
|
14899 | proto.isUtc = isUtc;
|
14900 | proto.isUTC = isUtc;
|
14901 | proto.zoneAbbr = getZoneAbbr;
|
14902 | proto.zoneName = getZoneName;
|
14903 | proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
|
14904 | proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
|
14905 | proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
|
14906 | proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
|
14907 | proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
|
14908 |
|
14909 | function createUnix(input) {
|
14910 | return createLocal(input * 1000);
|
14911 | }
|
14912 |
|
14913 | function createInZone() {
|
14914 | return createLocal.apply(null, arguments).parseZone();
|
14915 | }
|
14916 |
|
14917 | function preParsePostFormat(string) {
|
14918 | return string;
|
14919 | }
|
14920 |
|
14921 | var proto$1 = Locale.prototype;
|
14922 | proto$1.calendar = calendar;
|
14923 | proto$1.longDateFormat = longDateFormat;
|
14924 | proto$1.invalidDate = invalidDate;
|
14925 | proto$1.ordinal = ordinal;
|
14926 | proto$1.preparse = preParsePostFormat;
|
14927 | proto$1.postformat = preParsePostFormat;
|
14928 | proto$1.relativeTime = relativeTime;
|
14929 | proto$1.pastFuture = pastFuture;
|
14930 | proto$1.set = set;
|
14931 | proto$1.months = localeMonths;
|
14932 | proto$1.monthsShort = localeMonthsShort;
|
14933 | proto$1.monthsParse = localeMonthsParse;
|
14934 | proto$1.monthsRegex = monthsRegex;
|
14935 | proto$1.monthsShortRegex = monthsShortRegex;
|
14936 | proto$1.week = localeWeek;
|
14937 | proto$1.firstDayOfYear = localeFirstDayOfYear;
|
14938 | proto$1.firstDayOfWeek = localeFirstDayOfWeek;
|
14939 | proto$1.weekdays = localeWeekdays;
|
14940 | proto$1.weekdaysMin = localeWeekdaysMin;
|
14941 | proto$1.weekdaysShort = localeWeekdaysShort;
|
14942 | proto$1.weekdaysParse = localeWeekdaysParse;
|
14943 | proto$1.weekdaysRegex = weekdaysRegex;
|
14944 | proto$1.weekdaysShortRegex = weekdaysShortRegex;
|
14945 | proto$1.weekdaysMinRegex = weekdaysMinRegex;
|
14946 | proto$1.isPM = localeIsPM;
|
14947 | proto$1.meridiem = localeMeridiem;
|
14948 |
|
14949 | function get$1(format, index, field, setter) {
|
14950 | var locale = getLocale();
|
14951 | var utc = createUTC().set(setter, index);
|
14952 | return locale[field](utc, format);
|
14953 | }
|
14954 |
|
14955 | function listMonthsImpl(format, index, field) {
|
14956 | if (isNumber(format)) {
|
14957 | index = format;
|
14958 | format = undefined;
|
14959 | }
|
14960 |
|
14961 | format = format || '';
|
14962 |
|
14963 | if (index != null) {
|
14964 | return get$1(format, index, field, 'month');
|
14965 | }
|
14966 |
|
14967 | var i;
|
14968 | var out = [];
|
14969 |
|
14970 | for (i = 0; i < 12; i++) {
|
14971 | out[i] = get$1(format, i, field, 'month');
|
14972 | }
|
14973 |
|
14974 | return out;
|
14975 | } // ()
|
14976 | // (5)
|
14977 | // (fmt, 5)
|
14978 | // (fmt)
|
14979 | // (true)
|
14980 | // (true, 5)
|
14981 | // (true, fmt, 5)
|
14982 | // (true, fmt)
|
14983 |
|
14984 |
|
14985 | function listWeekdaysImpl(localeSorted, format, index, field) {
|
14986 | if (typeof localeSorted === 'boolean') {
|
14987 | if (isNumber(format)) {
|
14988 | index = format;
|
14989 | format = undefined;
|
14990 | }
|
14991 |
|
14992 | format = format || '';
|
14993 | } else {
|
14994 | format = localeSorted;
|
14995 | index = format;
|
14996 | localeSorted = false;
|
14997 |
|
14998 | if (isNumber(format)) {
|
14999 | index = format;
|
15000 | format = undefined;
|
15001 | }
|
15002 |
|
15003 | format = format || '';
|
15004 | }
|
15005 |
|
15006 | var locale = getLocale(),
|
15007 | shift = localeSorted ? locale._week.dow : 0;
|
15008 |
|
15009 | if (index != null) {
|
15010 | return get$1(format, (index + shift) % 7, field, 'day');
|
15011 | }
|
15012 |
|
15013 | var i;
|
15014 | var out = [];
|
15015 |
|
15016 | for (i = 0; i < 7; i++) {
|
15017 | out[i] = get$1(format, (i + shift) % 7, field, 'day');
|
15018 | }
|
15019 |
|
15020 | return out;
|
15021 | }
|
15022 |
|
15023 | function listMonths(format, index) {
|
15024 | return listMonthsImpl(format, index, 'months');
|
15025 | }
|
15026 |
|
15027 | function listMonthsShort(format, index) {
|
15028 | return listMonthsImpl(format, index, 'monthsShort');
|
15029 | }
|
15030 |
|
15031 | function listWeekdays(localeSorted, format, index) {
|
15032 | return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
|
15033 | }
|
15034 |
|
15035 | function listWeekdaysShort(localeSorted, format, index) {
|
15036 | return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
|
15037 | }
|
15038 |
|
15039 | function listWeekdaysMin(localeSorted, format, index) {
|
15040 | return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
|
15041 | }
|
15042 |
|
15043 | getSetGlobalLocale('en', {
|
15044 | dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
|
15045 | ordinal: function ordinal(number) {
|
15046 | var b = number % 10,
|
15047 | output = toInt(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
|
15048 | return number + output;
|
15049 | }
|
15050 | });
|
15051 |
|
15052 | hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
|
15053 | hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
|
15054 | var mathAbs = Math.abs;
|
15055 |
|
15056 | function abs() {
|
15057 | var data = this._data;
|
15058 | this._milliseconds = mathAbs(this._milliseconds);
|
15059 | this._days = mathAbs(this._days);
|
15060 | this._months = mathAbs(this._months);
|
15061 | data.milliseconds = mathAbs(data.milliseconds);
|
15062 | data.seconds = mathAbs(data.seconds);
|
15063 | data.minutes = mathAbs(data.minutes);
|
15064 | data.hours = mathAbs(data.hours);
|
15065 | data.months = mathAbs(data.months);
|
15066 | data.years = mathAbs(data.years);
|
15067 | return this;
|
15068 | }
|
15069 |
|
15070 | function addSubtract$1(duration, input, value, direction) {
|
15071 | var other = createDuration(input, value);
|
15072 | duration._milliseconds += direction * other._milliseconds;
|
15073 | duration._days += direction * other._days;
|
15074 | duration._months += direction * other._months;
|
15075 | return duration._bubble();
|
15076 | }
|
15077 |
|
15078 |
|
15079 | function add$1(input, value) {
|
15080 | return addSubtract$1(this, input, value, 1);
|
15081 | }
|
15082 |
|
15083 |
|
15084 | function subtract$1(input, value) {
|
15085 | return addSubtract$1(this, input, value, -1);
|
15086 | }
|
15087 |
|
15088 | function absCeil(number) {
|
15089 | if (number < 0) {
|
15090 | return Math.floor(number);
|
15091 | } else {
|
15092 | return Math.ceil(number);
|
15093 | }
|
15094 | }
|
15095 |
|
15096 | function bubble() {
|
15097 | var milliseconds = this._milliseconds;
|
15098 | var days = this._days;
|
15099 | var months = this._months;
|
15100 | var data = this._data;
|
15101 | var seconds, minutes, hours, years, monthsFromDays;
|
15102 |
|
15103 |
|
15104 | if (!(milliseconds >= 0 && days >= 0 && months >= 0 || milliseconds <= 0 && days <= 0 && months <= 0)) {
|
15105 | milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
|
15106 | days = 0;
|
15107 | months = 0;
|
15108 | }
|
15109 |
|
15110 |
|
15111 |
|
15112 | data.milliseconds = milliseconds % 1000;
|
15113 | seconds = absFloor(milliseconds / 1000);
|
15114 | data.seconds = seconds % 60;
|
15115 | minutes = absFloor(seconds / 60);
|
15116 | data.minutes = minutes % 60;
|
15117 | hours = absFloor(minutes / 60);
|
15118 | data.hours = hours % 24;
|
15119 | days += absFloor(hours / 24);
|
15120 |
|
15121 | monthsFromDays = absFloor(daysToMonths(days));
|
15122 | months += monthsFromDays;
|
15123 | days -= absCeil(monthsToDays(monthsFromDays));
|
15124 |
|
15125 | years = absFloor(months / 12);
|
15126 | months %= 12;
|
15127 | data.days = days;
|
15128 | data.months = months;
|
15129 | data.years = years;
|
15130 | return this;
|
15131 | }
|
15132 |
|
15133 | function daysToMonths(days) {
|
15134 |
|
15135 |
|
15136 | return days * 4800 / 146097;
|
15137 | }
|
15138 |
|
15139 | function monthsToDays(months) {
|
15140 |
|
15141 | return months * 146097 / 4800;
|
15142 | }
|
15143 |
|
15144 | function as(units) {
|
15145 | if (!this.isValid()) {
|
15146 | return NaN;
|
15147 | }
|
15148 |
|
15149 | var days;
|
15150 | var months;
|
15151 | var milliseconds = this._milliseconds;
|
15152 | units = normalizeUnits(units);
|
15153 |
|
15154 | if (units === 'month' || units === 'quarter' || units === 'year') {
|
15155 | days = this._days + milliseconds / 864e5;
|
15156 | months = this._months + daysToMonths(days);
|
15157 |
|
15158 | switch (units) {
|
15159 | case 'month':
|
15160 | return months;
|
15161 |
|
15162 | case 'quarter':
|
15163 | return months / 3;
|
15164 |
|
15165 | case 'year':
|
15166 | return months / 12;
|
15167 | }
|
15168 | } else {
|
15169 |
|
15170 | days = this._days + Math.round(monthsToDays(this._months));
|
15171 |
|
15172 | switch (units) {
|
15173 | case 'week':
|
15174 | return days / 7 + milliseconds / 6048e5;
|
15175 |
|
15176 | case 'day':
|
15177 | return days + milliseconds / 864e5;
|
15178 |
|
15179 | case 'hour':
|
15180 | return days * 24 + milliseconds / 36e5;
|
15181 |
|
15182 | case 'minute':
|
15183 | return days * 1440 + milliseconds / 6e4;
|
15184 |
|
15185 | case 'second':
|
15186 | return days * 86400 + milliseconds / 1000;
|
15187 |
|
15188 |
|
15189 | case 'millisecond':
|
15190 | return Math.floor(days * 864e5) + milliseconds;
|
15191 |
|
15192 | default:
|
15193 | throw new Error('Unknown unit ' + units);
|
15194 | }
|
15195 | }
|
15196 | }
|
15197 |
|
15198 |
|
15199 | function valueOf$1() {
|
15200 | if (!this.isValid()) {
|
15201 | return NaN;
|
15202 | }
|
15203 |
|
15204 | return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6;
|
15205 | }
|
15206 |
|
15207 | function makeAs(alias) {
|
15208 | return function () {
|
15209 | return this.as(alias);
|
15210 | };
|
15211 | }
|
15212 |
|
15213 | var asMilliseconds = makeAs('ms');
|
15214 | var asSeconds = makeAs('s');
|
15215 | var asMinutes = makeAs('m');
|
15216 | var asHours = makeAs('h');
|
15217 | var asDays = makeAs('d');
|
15218 | var asWeeks = makeAs('w');
|
15219 | var asMonths = makeAs('M');
|
15220 | var asQuarters = makeAs('Q');
|
15221 | var asYears = makeAs('y');
|
15222 |
|
15223 | function clone$1() {
|
15224 | return createDuration(this);
|
15225 | }
|
15226 |
|
15227 | function get$2(units) {
|
15228 | units = normalizeUnits(units);
|
15229 | return this.isValid() ? this[units + 's']() : NaN;
|
15230 | }
|
15231 |
|
15232 | function makeGetter(name) {
|
15233 | return function () {
|
15234 | return this.isValid() ? this._data[name] : NaN;
|
15235 | };
|
15236 | }
|
15237 |
|
15238 | var milliseconds = makeGetter('milliseconds');
|
15239 | var seconds = makeGetter('seconds');
|
15240 | var minutes = makeGetter('minutes');
|
15241 | var hours = makeGetter('hours');
|
15242 | var days = makeGetter('days');
|
15243 | var months = makeGetter('months');
|
15244 | var years = makeGetter('years');
|
15245 |
|
15246 | function weeks() {
|
15247 | return absFloor(this.days() / 7);
|
15248 | }
|
15249 |
|
15250 | var round = Math.round;
|
15251 | var thresholds = {
|
15252 | ss: 44,
|
15253 |
|
15254 | s: 45,
|
15255 |
|
15256 | m: 45,
|
15257 |
|
15258 | h: 22,
|
15259 |
|
15260 | d: 26,
|
15261 |
|
15262 | M: 11
|
15263 |
|
15264 | };
|
15265 |
|
15266 | function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
|
15267 | return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
|
15268 | }
|
15269 |
|
15270 | function relativeTime$1(posNegDuration, withoutSuffix, locale) {
|
15271 | var duration = createDuration(posNegDuration).abs();
|
15272 | var seconds = round(duration.as('s'));
|
15273 | var minutes = round(duration.as('m'));
|
15274 | var hours = round(duration.as('h'));
|
15275 | var days = round(duration.as('d'));
|
15276 | var months = round(duration.as('M'));
|
15277 | var years = round(duration.as('y'));
|
15278 | var a = seconds <= thresholds.ss && ['s', seconds] || seconds < thresholds.s && ['ss', seconds] || minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || days <= 1 && ['d'] || days < thresholds.d && ['dd', days] || months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || years <= 1 && ['y'] || ['yy', years];
|
15279 | a[2] = withoutSuffix;
|
15280 | a[3] = +posNegDuration > 0;
|
15281 | a[4] = locale;
|
15282 | return substituteTimeAgo.apply(null, a);
|
15283 | }
|
15284 |
|
15285 |
|
15286 | function getSetRelativeTimeRounding(roundingFunction) {
|
15287 | if (roundingFunction === undefined) {
|
15288 | return round;
|
15289 | }
|
15290 |
|
15291 | if (typeof roundingFunction === 'function') {
|
15292 | round = roundingFunction;
|
15293 | return true;
|
15294 | }
|
15295 |
|
15296 | return false;
|
15297 | }
|
15298 |
|
15299 |
|
15300 | function getSetRelativeTimeThreshold(threshold, limit) {
|
15301 | if (thresholds[threshold] === undefined) {
|
15302 | return false;
|
15303 | }
|
15304 |
|
15305 | if (limit === undefined) {
|
15306 | return thresholds[threshold];
|
15307 | }
|
15308 |
|
15309 | thresholds[threshold] = limit;
|
15310 |
|
15311 | if (threshold === 's') {
|
15312 | thresholds.ss = limit - 1;
|
15313 | }
|
15314 |
|
15315 | return true;
|
15316 | }
|
15317 |
|
15318 | function humanize(withSuffix) {
|
15319 | if (!this.isValid()) {
|
15320 | return this.localeData().invalidDate();
|
15321 | }
|
15322 |
|
15323 | var locale = this.localeData();
|
15324 | var output = relativeTime$1(this, !withSuffix, locale);
|
15325 |
|
15326 | if (withSuffix) {
|
15327 | output = locale.pastFuture(+this, output);
|
15328 | }
|
15329 |
|
15330 | return locale.postformat(output);
|
15331 | }
|
15332 |
|
15333 | var abs$1 = Math.abs;
|
15334 |
|
15335 | function sign(x) {
|
15336 | return (x > 0) - (x < 0) || +x;
|
15337 | }
|
15338 |
|
15339 | function toISOString$1() {
|
15340 |
|
15341 |
|
15342 |
|
15343 |
|
15344 |
|
15345 |
|
15346 |
|
15347 | if (!this.isValid()) {
|
15348 | return this.localeData().invalidDate();
|
15349 | }
|
15350 |
|
15351 | var seconds = abs$1(this._milliseconds) / 1000;
|
15352 | var days = abs$1(this._days);
|
15353 | var months = abs$1(this._months);
|
15354 | var minutes, hours, years;
|
15355 |
|
15356 | minutes = absFloor(seconds / 60);
|
15357 | hours = absFloor(minutes / 60);
|
15358 | seconds %= 60;
|
15359 | minutes %= 60;
|
15360 |
|
15361 | years = absFloor(months / 12);
|
15362 | months %= 12;
|
15363 |
|
15364 | var Y = years;
|
15365 | var M = months;
|
15366 | var D = days;
|
15367 | var h = hours;
|
15368 | var m = minutes;
|
15369 | var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
|
15370 | var total = this.asSeconds();
|
15371 |
|
15372 | if (!total) {
|
15373 |
|
15374 |
|
15375 | return 'P0D';
|
15376 | }
|
15377 |
|
15378 | var totalSign = total < 0 ? '-' : '';
|
15379 | var ymSign = sign(this._months) !== sign(total) ? '-' : '';
|
15380 | var daysSign = sign(this._days) !== sign(total) ? '-' : '';
|
15381 | var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
|
15382 | return totalSign + 'P' + (Y ? ymSign + Y + 'Y' : '') + (M ? ymSign + M + 'M' : '') + (D ? daysSign + D + 'D' : '') + (h || m || s ? 'T' : '') + (h ? hmsSign + h + 'H' : '') + (m ? hmsSign + m + 'M' : '') + (s ? hmsSign + s + 'S' : '');
|
15383 | }
|
15384 |
|
15385 | var proto$2 = Duration.prototype;
|
15386 | proto$2.isValid = isValid$1;
|
15387 | proto$2.abs = abs;
|
15388 | proto$2.add = add$1;
|
15389 | proto$2.subtract = subtract$1;
|
15390 | proto$2.as = as;
|
15391 | proto$2.asMilliseconds = asMilliseconds;
|
15392 | proto$2.asSeconds = asSeconds;
|
15393 | proto$2.asMinutes = asMinutes;
|
15394 | proto$2.asHours = asHours;
|
15395 | proto$2.asDays = asDays;
|
15396 | proto$2.asWeeks = asWeeks;
|
15397 | proto$2.asMonths = asMonths;
|
15398 | proto$2.asQuarters = asQuarters;
|
15399 | proto$2.asYears = asYears;
|
15400 | proto$2.valueOf = valueOf$1;
|
15401 | proto$2._bubble = bubble;
|
15402 | proto$2.clone = clone$1;
|
15403 | proto$2.get = get$2;
|
15404 | proto$2.milliseconds = milliseconds;
|
15405 | proto$2.seconds = seconds;
|
15406 | proto$2.minutes = minutes;
|
15407 | proto$2.hours = hours;
|
15408 | proto$2.days = days;
|
15409 | proto$2.weeks = weeks;
|
15410 | proto$2.months = months;
|
15411 | proto$2.years = years;
|
15412 | proto$2.humanize = humanize;
|
15413 | proto$2.toISOString = toISOString$1;
|
15414 | proto$2.toString = toISOString$1;
|
15415 | proto$2.toJSON = toISOString$1;
|
15416 | proto$2.locale = locale;
|
15417 | proto$2.localeData = localeData;
|
15418 | proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
|
15419 | proto$2.lang = lang; // Side effect imports
|
15420 | // FORMATTING
|
15421 |
|
15422 | addFormatToken('X', 0, 0, 'unix');
|
15423 | addFormatToken('x', 0, 0, 'valueOf'); // PARSING
|
15424 |
|
15425 | addRegexToken('x', matchSigned);
|
15426 | addRegexToken('X', matchTimestamp);
|
15427 | addParseToken('X', function (input, array, config) {
|
15428 | config._d = new Date(_parseFloat$3(input, 10) * 1000);
|
15429 | });
|
15430 | addParseToken('x', function (input, array, config) {
|
15431 | config._d = new Date(toInt(input));
|
15432 | });
|
15433 |
|
15434 | hooks.version = '2.24.0';
|
15435 | setHookCallback(createLocal);
|
15436 | hooks.fn = proto;
|
15437 | hooks.min = min;
|
15438 | hooks.max = max;
|
15439 | hooks.now = now;
|
15440 | hooks.utc = createUTC;
|
15441 | hooks.unix = createUnix;
|
15442 | hooks.months = listMonths;
|
15443 | hooks.isDate = isDate;
|
15444 | hooks.locale = getSetGlobalLocale;
|
15445 | hooks.invalid = createInvalid;
|
15446 | hooks.duration = createDuration;
|
15447 | hooks.isMoment = isMoment;
|
15448 | hooks.weekdays = listWeekdays;
|
15449 | hooks.parseZone = createInZone;
|
15450 | hooks.localeData = getLocale;
|
15451 | hooks.isDuration = isDuration;
|
15452 | hooks.monthsShort = listMonthsShort;
|
15453 | hooks.weekdaysMin = listWeekdaysMin;
|
15454 | hooks.defineLocale = defineLocale;
|
15455 | hooks.updateLocale = updateLocale;
|
15456 | hooks.locales = listLocales;
|
15457 | hooks.weekdaysShort = listWeekdaysShort;
|
15458 | hooks.normalizeUnits = normalizeUnits;
|
15459 | hooks.relativeTimeRounding = getSetRelativeTimeRounding;
|
15460 | hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
|
15461 | hooks.calendarFormat = getCalendarFormat;
|
15462 | hooks.prototype = proto;
|
15463 |
|
15464 | hooks.HTML5_FMT = {
|
15465 | DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm',
|
15466 |
|
15467 | DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss',
|
15468 |
|
15469 | DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS',
|
15470 |
|
15471 | DATE: 'YYYY-MM-DD',
|
15472 |
|
15473 | TIME: 'HH:mm',
|
15474 |
|
15475 | TIME_SECONDS: 'HH:mm:ss',
|
15476 |
|
15477 | TIME_MS: 'HH:mm:ss.SSS',
|
15478 |
|
15479 | WEEK: 'GGGG-[W]WW',
|
15480 |
|
15481 | MONTH: 'YYYY-MM'
|
15482 |
|
15483 | };
|
15484 | return hooks;
|
15485 | });
|
15486 | });
|
15487 |
|
15488 | var byteToHex$2$1 = [];
|
15489 |
|
15490 | for (var i$2$1 = 0; i$2$1 < 256; i$2$1++) {
|
15491 | byteToHex$2$1[i$2$1] = (i$2$1 + 0x100).toString(16).substr(1);
|
15492 | }
|
15493 |
|
15494 |
|
15495 |
|
15496 |
|
15497 |
|
15498 |
|
15499 |
|
15500 | var random$1$1 = function () {
|
15501 | if (typeof crypto !== 'undefined' && crypto.getRandomValues) {
|
15502 |
|
15503 |
|
15504 | var _rnds8 = new Uint8Array(16);
|
15505 |
|
15506 | return function whatwgRNG() {
|
15507 | crypto.getRandomValues(_rnds8);
|
15508 | return _rnds8;
|
15509 | };
|
15510 | }
|
15511 |
|
15512 |
|
15513 |
|
15514 |
|
15515 |
|
15516 | var _rnds = new Array(16);
|
15517 |
|
15518 | return function () {
|
15519 | for (var i = 0, r; i < 16; i++) {
|
15520 | if ((i & 0x03) === 0) {
|
15521 | r = Math.random() * 0x100000000;
|
15522 | }
|
15523 |
|
15524 | _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
|
15525 | }
|
15526 |
|
15527 | return _rnds;
|
15528 | };
|
15529 |
|
15530 |
|
15531 |
|
15532 |
|
15533 |
|
15534 |
|
15535 |
|
15536 | }();
|
15537 |
|
15538 | var byteToHex$1$1$1 = [];
|
15539 |
|
15540 | for (var i$1$1$1 = 0; i$1$1$1 < 256; i$1$1$1++) {
|
15541 | byteToHex$1$1$1[i$1$1$1] = (i$1$1$1 + 0x100).toString(16).substr(1);
|
15542 | }
|
15543 |
|
15544 |
|
15545 |
|
15546 |
|
15547 |
|
15548 |
|
15549 | var seedBytes$1$1 = random$1$1();
|
15550 |
|
15551 | var defaultNodeId$1$1 = [seedBytes$1$1[0] | 0x01, seedBytes$1$1[1], seedBytes$1$1[2], seedBytes$1$1[3], seedBytes$1$1[4], seedBytes$1$1[5]];
|
15552 |
|
15553 | var defaultClockseq$1$1 = (seedBytes$1$1[6] << 8 | seedBytes$1$1[7]) & 0x3fff;
|
15554 |
|
15555 |
|
15556 | var ASPDateRegex$1 = /^\/?Date\((-?\d+)/i;
|
15557 |
|
15558 |
|
15559 |
|
15560 |
|
15561 |
|
15562 |
|
15563 |
|
15564 |
|
15565 |
|
15566 |
|
15567 |
|
15568 |
|
15569 |
|
15570 | function isNumber$1(value) {
|
15571 | return value instanceof Number || typeof value === "number";
|
15572 | }
|
15573 |
|
15574 |
|
15575 |
|
15576 |
|
15577 |
|
15578 |
|
15579 |
|
15580 |
|
15581 |
|
15582 | function isString$1(value) {
|
15583 | return value instanceof String || typeof value === "string";
|
15584 | }
|
15585 |
|
15586 |
|
15587 |
|
15588 |
|
15589 |
|
15590 |
|
15591 |
|
15592 |
|
15593 |
|
15594 |
|
15595 | function isMoment(value) {
|
15596 | return moment.isMoment(value);
|
15597 | }
|
15598 |
|
15599 |
|
15600 |
|
15601 |
|
15602 |
|
15603 |
|
15604 |
|
15605 |
|
15606 |
|
15607 |
|
15608 |
|
15609 |
|
15610 |
|
15611 | function copyOrDelete$1(a, b, prop, allowDeletion) {
|
15612 | var doDeletion = false;
|
15613 |
|
15614 | if (allowDeletion === true) {
|
15615 | doDeletion = b[prop] === null && a[prop] !== undefined;
|
15616 | }
|
15617 |
|
15618 | if (doDeletion) {
|
15619 | delete a[prop];
|
15620 | } else {
|
15621 | a[prop] = b[prop];
|
15622 | }
|
15623 | }
|
15624 |
|
15625 |
|
15626 |
|
15627 |
|
15628 |
|
15629 |
|
15630 |
|
15631 |
|
15632 |
|
15633 |
|
15634 |
|
15635 |
|
15636 |
|
15637 | function deepExtend$1(a, b) {
|
15638 | var protoExtend = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
15639 | var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
15640 |
|
15641 | for (var prop in b) {
|
15642 | if (Object.prototype.hasOwnProperty.call(b, prop) || protoExtend === true) {
|
15643 | if (_typeof_1$1$1(b[prop]) === "object" && b[prop] !== null && getPrototypeOf$2$1$1(b[prop]) === Object.prototype) {
|
15644 | if (a[prop] === undefined) {
|
15645 | a[prop] = deepExtend$1({}, b[prop], protoExtend);
|
15646 | } else if (_typeof_1$1$1(a[prop]) === "object" && a[prop] !== null && getPrototypeOf$2$1$1(a[prop]) === Object.prototype) {
|
15647 | deepExtend$1(a[prop], b[prop], protoExtend);
|
15648 | } else {
|
15649 | copyOrDelete$1(a, b, prop, allowDeletion);
|
15650 | }
|
15651 | } else if (isArray$5$1$1(b[prop])) {
|
15652 | var _context;
|
15653 |
|
15654 | a[prop] = slice$2$1(_context = b[prop]).call(_context);
|
15655 | } else {
|
15656 | copyOrDelete$1(a, b, prop, allowDeletion);
|
15657 | }
|
15658 | }
|
15659 | }
|
15660 |
|
15661 | return a;
|
15662 | }
|
15663 |
|
15664 |
|
15665 |
|
15666 |
|
15667 |
|
15668 |
|
15669 |
|
15670 |
|
15671 |
|
15672 |
|
15673 |
|
15674 | function convert(object, type) {
|
15675 | var match;
|
15676 |
|
15677 | if (object === undefined) {
|
15678 | return undefined;
|
15679 | }
|
15680 |
|
15681 | if (object === null) {
|
15682 | return null;
|
15683 | }
|
15684 |
|
15685 | if (!type) {
|
15686 | return object;
|
15687 | }
|
15688 |
|
15689 | if (!(typeof type === "string") && !(type instanceof String)) {
|
15690 | throw new Error("Type must be a string");
|
15691 | }
|
15692 |
|
15693 |
|
15694 | switch (type) {
|
15695 | case "boolean":
|
15696 | case "Boolean":
|
15697 | return Boolean(object);
|
15698 |
|
15699 | case "number":
|
15700 | case "Number":
|
15701 | if (isString$1(object) && !isNaN(Date.parse(object))) {
|
15702 | return moment(object).valueOf();
|
15703 | } else {
|
15704 |
|
15705 |
|
15706 |
|
15707 | return Number(object.valueOf());
|
15708 | }
|
15709 |
|
15710 | case "string":
|
15711 | case "String":
|
15712 | return String(object);
|
15713 |
|
15714 | case "Date":
|
15715 | if (isNumber$1(object)) {
|
15716 | return new Date(object);
|
15717 | }
|
15718 |
|
15719 | if (object instanceof Date) {
|
15720 | return new Date(object.valueOf());
|
15721 | } else if (isMoment(object)) {
|
15722 | return new Date(object.valueOf());
|
15723 | }
|
15724 |
|
15725 | if (isString$1(object)) {
|
15726 | match = ASPDateRegex$1.exec(object);
|
15727 |
|
15728 | if (match) {
|
15729 |
|
15730 | return new Date(Number(match[1]));
|
15731 | } else {
|
15732 | return moment(new Date(object)).toDate();
|
15733 | }
|
15734 | } else {
|
15735 | throw new Error("Cannot convert object of type " + getType$1(object) + " to type Date");
|
15736 | }
|
15737 |
|
15738 | case "Moment":
|
15739 | if (isNumber$1(object)) {
|
15740 | return moment(object);
|
15741 | }
|
15742 |
|
15743 | if (object instanceof Date) {
|
15744 | return moment(object.valueOf());
|
15745 | } else if (isMoment(object)) {
|
15746 | return moment(object);
|
15747 | }
|
15748 |
|
15749 | if (isString$1(object)) {
|
15750 | match = ASPDateRegex$1.exec(object);
|
15751 |
|
15752 | if (match) {
|
15753 |
|
15754 | return moment(Number(match[1]));
|
15755 | } else {
|
15756 | return moment(object);
|
15757 | }
|
15758 | } else {
|
15759 | throw new Error("Cannot convert object of type " + getType$1(object) + " to type Date");
|
15760 | }
|
15761 |
|
15762 | case "ISODate":
|
15763 | if (isNumber$1(object)) {
|
15764 | return new Date(object);
|
15765 | } else if (object instanceof Date) {
|
15766 | return object.toISOString();
|
15767 | } else if (isMoment(object)) {
|
15768 | return object.toDate().toISOString();
|
15769 | } else if (isString$1(object)) {
|
15770 | match = ASPDateRegex$1.exec(object);
|
15771 |
|
15772 | if (match) {
|
15773 |
|
15774 | return new Date(Number(match[1])).toISOString();
|
15775 | } else {
|
15776 | return moment(object).format();
|
15777 | }
|
15778 | } else {
|
15779 | throw new Error("Cannot convert object of type " + getType$1(object) + " to type ISODate");
|
15780 | }
|
15781 |
|
15782 | case "ASPDate":
|
15783 | if (isNumber$1(object)) {
|
15784 | return "/Date(" + object + ")/";
|
15785 | } else if (object instanceof Date || isMoment(object)) {
|
15786 | return "/Date(" + object.valueOf() + ")/";
|
15787 | } else if (isString$1(object)) {
|
15788 | match = ASPDateRegex$1.exec(object);
|
15789 |
|
15790 | var _value;
|
15791 |
|
15792 | if (match) {
|
15793 |
|
15794 | _value = new Date(Number(match[1])).valueOf();
|
15795 | } else {
|
15796 | _value = new Date(object).valueOf();
|
15797 | }
|
15798 |
|
15799 | return "/Date(" + _value + ")/";
|
15800 | } else {
|
15801 | throw new Error("Cannot convert object of type " + getType$1(object) + " to type ASPDate");
|
15802 | }
|
15803 |
|
15804 | default:
|
15805 | var never = type;
|
15806 | throw new Error("Unknown type ".concat(never));
|
15807 | }
|
15808 | }
|
15809 |
|
15810 |
|
15811 |
|
15812 |
|
15813 |
|
15814 |
|
15815 |
|
15816 |
|
15817 |
|
15818 | function getType$1(object) {
|
15819 | var type = _typeof_1$1$1(object);
|
15820 |
|
15821 | if (type === "object") {
|
15822 | if (object === null) {
|
15823 | return "null";
|
15824 | }
|
15825 |
|
15826 | if (object instanceof Boolean) {
|
15827 | return "Boolean";
|
15828 | }
|
15829 |
|
15830 | if (object instanceof Number) {
|
15831 | return "Number";
|
15832 | }
|
15833 |
|
15834 | if (object instanceof String) {
|
15835 | return "String";
|
15836 | }
|
15837 |
|
15838 | if (isArray$5$1$1(object)) {
|
15839 | return "Array";
|
15840 | }
|
15841 |
|
15842 | if (object instanceof Date) {
|
15843 | return "Date";
|
15844 | }
|
15845 |
|
15846 | return "Object";
|
15847 | }
|
15848 |
|
15849 | if (type === "number") {
|
15850 | return "Number";
|
15851 | }
|
15852 |
|
15853 | if (type === "boolean") {
|
15854 | return "Boolean";
|
15855 | }
|
15856 |
|
15857 | if (type === "string") {
|
15858 | return "String";
|
15859 | }
|
15860 |
|
15861 | if (type === undefined) {
|
15862 | return "undefined";
|
15863 | }
|
15864 |
|
15865 | return type;
|
15866 | }
|
15867 |
|
15868 |
|
15869 |
|
15870 |
|
15871 |
|
15872 |
|
15873 |
|
15874 |
|
15875 |
|
15876 | function isId(value) {
|
15877 | return typeof value === "string" || typeof value === "number";
|
15878 | }
|
15879 |
|
15880 | var max$2$1 = Math.max;
|
15881 | var min$3 = Math.min;
|
15882 | var MAX_SAFE_INTEGER$2 = 0x1FFFFFFFFFFFFF;
|
15883 | var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
|
15884 |
|
15885 |
|
15886 |
|
15887 | _export$1({
|
15888 | target: 'Array',
|
15889 | proto: true,
|
15890 | forced: !arrayMethodHasSpeciesSupport$1('splice')
|
15891 | }, {
|
15892 | splice: function splice(start, deleteCount
|
15893 | /* , ...items */
|
15894 | ) {
|
15895 | var O = toObject$1(this);
|
15896 | var len = toLength$1(O.length);
|
15897 | var actualStart = toAbsoluteIndex$1(start, len);
|
15898 | var argumentsLength = arguments.length;
|
15899 | var insertCount, actualDeleteCount, A, k, from, to;
|
15900 |
|
15901 | if (argumentsLength === 0) {
|
15902 | insertCount = actualDeleteCount = 0;
|
15903 | } else if (argumentsLength === 1) {
|
15904 | insertCount = 0;
|
15905 | actualDeleteCount = len - actualStart;
|
15906 | } else {
|
15907 | insertCount = argumentsLength - 2;
|
15908 | actualDeleteCount = min$3(max$2$1(toInteger$1(deleteCount), 0), len - actualStart);
|
15909 | }
|
15910 |
|
15911 | if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER$2) {
|
15912 | throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
|
15913 | }
|
15914 |
|
15915 | A = arraySpeciesCreate$1(O, actualDeleteCount);
|
15916 |
|
15917 | for (k = 0; k < actualDeleteCount; k++) {
|
15918 | from = actualStart + k;
|
15919 | if (from in O) createProperty$1(A, k, O[from]);
|
15920 | }
|
15921 |
|
15922 | A.length = actualDeleteCount;
|
15923 |
|
15924 | if (insertCount < actualDeleteCount) {
|
15925 | for (k = actualStart; k < len - actualDeleteCount; k++) {
|
15926 | from = k + actualDeleteCount;
|
15927 | to = k + insertCount;
|
15928 | if (from in O) O[to] = O[from];else delete O[to];
|
15929 | }
|
15930 |
|
15931 | for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
|
15932 | } else if (insertCount > actualDeleteCount) {
|
15933 | for (k = len - actualDeleteCount; k > actualStart; k--) {
|
15934 | from = k + actualDeleteCount - 1;
|
15935 | to = k + insertCount - 1;
|
15936 | if (from in O) O[to] = O[from];else delete O[to];
|
15937 | }
|
15938 | }
|
15939 |
|
15940 | for (k = 0; k < insertCount; k++) {
|
15941 | O[k + actualStart] = arguments[k + 2];
|
15942 | }
|
15943 |
|
15944 | O.length = len - actualDeleteCount + insertCount;
|
15945 | return A;
|
15946 | }
|
15947 | });
|
15948 |
|
15949 | var splice = entryVirtual$1('Array').splice;
|
15950 | var ArrayPrototype$c = Array.prototype;
|
15951 |
|
15952 | var splice_1 = function (it) {
|
15953 | var own = it.splice;
|
15954 | return it === ArrayPrototype$c || it instanceof Array && own === ArrayPrototype$c.splice ? splice : own;
|
15955 | };
|
15956 |
|
15957 | var splice$1 = splice_1;
|
15958 | var splice$2 = splice$1;
|
15959 | var slice$3$1 = [].slice;
|
15960 | var MSIE = /MSIE .\./.test(userAgent$1);
|
15961 |
|
15962 | var wrap$2 = function (scheduler) {
|
15963 | return function (handler, timeout
|
15964 | /* , ...arguments */
|
15965 | ) {
|
15966 | var boundArgs = arguments.length > 2;
|
15967 | var args = boundArgs ? slice$3$1.call(arguments, 2) : undefined;
|
15968 | return scheduler(boundArgs ? function () {
|
15969 |
|
15970 | (typeof handler == 'function' ? handler : Function(handler)).apply(this, args);
|
15971 | } : handler, timeout);
|
15972 | };
|
15973 | };
|
15974 |
|
15975 |
|
15976 |
|
15977 | _export$1({
|
15978 | global: true,
|
15979 | bind: true,
|
15980 | forced: MSIE
|
15981 | }, {
|
15982 |
|
15983 |
|
15984 | setTimeout: wrap$2(global_1$1.setTimeout),
|
15985 |
|
15986 |
|
15987 | setInterval: wrap$2(global_1$1.setInterval)
|
15988 | });
|
15989 |
|
15990 | var setTimeout$1 = path$1.setTimeout;
|
15991 | var setTimeout$1$1 = setTimeout$1;
|
15992 |
|
15993 |
|
15994 |
|
15995 |
|
15996 |
|
15997 |
|
15998 |
|
15999 |
|
16000 | var Queue =
|
16001 |
|
16002 | function () {
|
16003 | |
16004 |
|
16005 |
|
16006 |
|
16007 |
|
16008 | function Queue(options) {
|
16009 | classCallCheck(this, Queue);
|
16010 | this._queue = [];
|
16011 | this._timeout = null;
|
16012 | this._extended = null;
|
16013 |
|
16014 | this.delay = null;
|
16015 | this.max = Infinity;
|
16016 | this.setOptions(options);
|
16017 | }
|
16018 | |
16019 |
|
16020 |
|
16021 |
|
16022 |
|
16023 |
|
16024 |
|
16025 | createClass(Queue, [{
|
16026 | key: "setOptions",
|
16027 | value: function setOptions(options) {
|
16028 | if (options && typeof options.delay !== "undefined") {
|
16029 | this.delay = options.delay;
|
16030 | }
|
16031 |
|
16032 | if (options && typeof options.max !== "undefined") {
|
16033 | this.max = options.max;
|
16034 | }
|
16035 |
|
16036 | this._flushIfNeeded();
|
16037 | }
|
16038 | |
16039 |
|
16040 |
|
16041 |
|
16042 |
|
16043 |
|
16044 |
|
16045 |
|
16046 |
|
16047 |
|
16048 | }, {
|
16049 | key: "destroy",
|
16050 |
|
16051 | |
16052 |
|
16053 |
|
16054 | value: function destroy() {
|
16055 | this.flush();
|
16056 |
|
16057 | if (this._extended) {
|
16058 | var object = this._extended.object;
|
16059 | var methods = this._extended.methods;
|
16060 |
|
16061 | for (var i = 0; i < methods.length; i++) {
|
16062 | var method = methods[i];
|
16063 |
|
16064 | if (method.original) {
|
16065 |
|
16066 | object[method.name] = method.original;
|
16067 | } else {
|
16068 |
|
16069 | delete object[method.name];
|
16070 | }
|
16071 | }
|
16072 |
|
16073 | this._extended = null;
|
16074 | }
|
16075 | }
|
16076 | |
16077 |
|
16078 |
|
16079 |
|
16080 |
|
16081 |
|
16082 |
|
16083 | }, {
|
16084 | key: "replace",
|
16085 | value: function replace(object, method) {
|
16086 |
|
16087 | var me = this;
|
16088 | var original = object[method];
|
16089 |
|
16090 | if (!original) {
|
16091 | throw new Error("Method " + method + " undefined");
|
16092 | }
|
16093 |
|
16094 | object[method] = function () {
|
16095 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
16096 | args[_key] = arguments[_key];
|
16097 | }
|
16098 |
|
16099 |
|
16100 | me.queue({
|
16101 | args: args,
|
16102 | fn: original,
|
16103 | context: this
|
16104 | });
|
16105 | };
|
16106 | }
|
16107 | |
16108 |
|
16109 |
|
16110 |
|
16111 |
|
16112 |
|
16113 | }, {
|
16114 | key: "queue",
|
16115 | value: function queue(entry) {
|
16116 | if (typeof entry === "function") {
|
16117 | this._queue.push({
|
16118 | fn: entry
|
16119 | });
|
16120 | } else {
|
16121 | this._queue.push(entry);
|
16122 | }
|
16123 |
|
16124 | this._flushIfNeeded();
|
16125 | }
|
16126 | |
16127 |
|
16128 |
|
16129 |
|
16130 | }, {
|
16131 | key: "_flushIfNeeded",
|
16132 | value: function _flushIfNeeded() {
|
16133 | var _this = this;
|
16134 |
|
16135 |
|
16136 | if (this._queue.length > this.max) {
|
16137 | this.flush();
|
16138 | }
|
16139 |
|
16140 |
|
16141 | if (this._timeout != null) {
|
16142 | clearTimeout(this._timeout);
|
16143 | this._timeout = null;
|
16144 | }
|
16145 |
|
16146 | if (this.queue.length > 0 && typeof this.delay === "number") {
|
16147 | this._timeout = setTimeout$1$1(function () {
|
16148 | _this.flush();
|
16149 | }, this.delay);
|
16150 | }
|
16151 | }
|
16152 | |
16153 |
|
16154 |
|
16155 |
|
16156 | }, {
|
16157 | key: "flush",
|
16158 | value: function flush() {
|
16159 | var _context, _context2;
|
16160 |
|
16161 | forEach$2$1(_context = splice$2(_context2 = this._queue).call(_context2, 0)).call(_context, function (entry) {
|
16162 | entry.fn.apply(entry.context || entry.fn, entry.args || []);
|
16163 | });
|
16164 | }
|
16165 | }], [{
|
16166 | key: "extend",
|
16167 | value: function extend(object, options) {
|
16168 | var queue = new Queue(options);
|
16169 |
|
16170 | if (object.flush !== undefined) {
|
16171 | throw new Error("Target object already has a property flush");
|
16172 | }
|
16173 |
|
16174 | object.flush = function () {
|
16175 | queue.flush();
|
16176 | };
|
16177 |
|
16178 | var methods = [{
|
16179 | name: "flush",
|
16180 | original: undefined
|
16181 | }];
|
16182 |
|
16183 | if (options && options.replace) {
|
16184 | for (var i = 0; i < options.replace.length; i++) {
|
16185 | var name = options.replace[i];
|
16186 | methods.push({
|
16187 | name: name,
|
16188 |
|
16189 | original: object[name]
|
16190 | });
|
16191 |
|
16192 | queue.replace(object, name);
|
16193 | }
|
16194 | }
|
16195 |
|
16196 | queue._extended = {
|
16197 | object: object,
|
16198 | methods: methods
|
16199 | };
|
16200 | return queue;
|
16201 | }
|
16202 | }]);
|
16203 | return Queue;
|
16204 | }();
|
16205 |
|
16206 |
|
16207 |
|
16208 |
|
16209 |
|
16210 |
|
16211 |
|
16212 |
|
16213 |
|
16214 |
|
16215 | var DataSetPart =
|
16216 |
|
16217 | function () {
|
16218 | function DataSetPart() {
|
16219 | classCallCheck(this, DataSetPart);
|
16220 | this._subscribers = {
|
16221 | "*": [],
|
16222 | add: [],
|
16223 | remove: [],
|
16224 | update: []
|
16225 | };
|
16226 | |
16227 |
|
16228 |
|
16229 |
|
16230 | this.subscribe = DataSetPart.prototype.on;
|
16231 | |
16232 |
|
16233 |
|
16234 |
|
16235 | this.unsubscribe = DataSetPart.prototype.off;
|
16236 | }
|
16237 | |
16238 |
|
16239 |
|
16240 |
|
16241 |
|
16242 |
|
16243 |
|
16244 |
|
16245 |
|
16246 | createClass(DataSetPart, [{
|
16247 | key: "_trigger",
|
16248 | value: function _trigger(event, payload, senderId) {
|
16249 | var _context, _context2;
|
16250 |
|
16251 | if (event === "*") {
|
16252 | throw new Error("Cannot trigger event *");
|
16253 | }
|
16254 |
|
16255 | forEach$2$1(_context = concat$2$1(_context2 = []).call(_context2, toConsumableArray$1(this._subscribers[event]), toConsumableArray$1(this._subscribers["*"]))).call(_context, function (subscriber) {
|
16256 | subscriber(event, payload, senderId != null ? senderId : null);
|
16257 | });
|
16258 | }
|
16259 | |
16260 |
|
16261 |
|
16262 |
|
16263 |
|
16264 |
|
16265 |
|
16266 |
|
16267 |
|
16268 | }, {
|
16269 | key: "on",
|
16270 | value: function on(event, callback) {
|
16271 | if (typeof callback === "function") {
|
16272 | this._subscribers[event].push(callback);
|
16273 | }
|
16274 |
|
16275 | }
|
16276 | |
16277 |
|
16278 |
|
16279 |
|
16280 |
|
16281 |
|
16282 |
|
16283 |
|
16284 |
|
16285 | }, {
|
16286 | key: "off",
|
16287 | value: function off(event, callback) {
|
16288 | var _context3;
|
16289 |
|
16290 | this._subscribers[event] = filter$2$1(_context3 = this._subscribers[event]).call(_context3, function (subscriber) {
|
16291 | return subscriber !== callback;
|
16292 | });
|
16293 | }
|
16294 | }]);
|
16295 | return DataSetPart;
|
16296 | }();
|
16297 |
|
16298 |
|
16299 | var es_set = collection('Set', function (get) {
|
16300 | return function Set() {
|
16301 | return get(this, arguments.length ? arguments[0] : undefined);
|
16302 | };
|
16303 | }, collectionStrong);
|
16304 | var set$2 = path$1.Set;
|
16305 | var set$3 = set$2;
|
16306 | var set$4 = set$3;
|
16307 | var create$3$1 = create$3;
|
16308 | var create$4 = create$3$1;
|
16309 |
|
16310 | function _arrayWithHoles(arr) {
|
16311 | if (isArray$3$1(arr)) return arr;
|
16312 | }
|
16313 |
|
16314 | var arrayWithHoles = _arrayWithHoles;
|
16315 |
|
16316 | function _iterableToArrayLimit(arr, i) {
|
16317 | if (!(isIterable$2$1(Object(arr)) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
|
16318 | return;
|
16319 | }
|
16320 |
|
16321 | var _arr = [];
|
16322 | var _n = true;
|
16323 | var _d = false;
|
16324 | var _e = undefined;
|
16325 |
|
16326 | try {
|
16327 | for (var _i = getIterator$2$1(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
16328 | _arr.push(_s.value);
|
16329 |
|
16330 | if (i && _arr.length === i) break;
|
16331 | }
|
16332 | } catch (err) {
|
16333 | _d = true;
|
16334 | _e = err;
|
16335 | } finally {
|
16336 | try {
|
16337 | if (!_n && _i["return"] != null) _i["return"]();
|
16338 | } finally {
|
16339 | if (_d) throw _e;
|
16340 | }
|
16341 | }
|
16342 |
|
16343 | return _arr;
|
16344 | }
|
16345 |
|
16346 | var iterableToArrayLimit = _iterableToArrayLimit;
|
16347 |
|
16348 | function _nonIterableRest() {
|
16349 | throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
16350 | }
|
16351 |
|
16352 | var nonIterableRest = _nonIterableRest;
|
16353 |
|
16354 | function _slicedToArray(arr, i) {
|
16355 | return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();
|
16356 | }
|
16357 |
|
16358 | var slicedToArray = _slicedToArray;
|
16359 |
|
16360 |
|
16361 |
|
16362 |
|
16363 |
|
16364 |
|
16365 |
|
16366 |
|
16367 |
|
16368 |
|
16369 |
|
16370 | var DataStream =
|
16371 |
|
16372 | function () {
|
16373 | |
16374 |
|
16375 |
|
16376 |
|
16377 |
|
16378 | function DataStream(_pairs) {
|
16379 | classCallCheck(this, DataStream);
|
16380 | this._pairs = _pairs;
|
16381 | }
|
16382 | |
16383 |
|
16384 |
|
16385 |
|
16386 |
|
16387 | createClass(DataStream, [{
|
16388 | key: iterator$2$1,
|
16389 | value:
|
16390 |
|
16391 | regenerator.mark(function value() {
|
16392 | var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step$value, id, item;
|
16393 |
|
16394 | return regenerator.wrap(function value$(_context) {
|
16395 | while (1) {
|
16396 | switch (_context.prev = _context.next) {
|
16397 | case 0:
|
16398 | _iteratorNormalCompletion = true;
|
16399 | _didIteratorError = false;
|
16400 | _iteratorError = undefined;
|
16401 | _context.prev = 3;
|
16402 | _iterator = getIterator$2$1(this._pairs);
|
16403 |
|
16404 | case 5:
|
16405 | if (_iteratorNormalCompletion = (_step = _iterator.next()).done) {
|
16406 | _context.next = 12;
|
16407 | break;
|
16408 | }
|
16409 |
|
16410 | _step$value = slicedToArray(_step.value, 2), id = _step$value[0], item = _step$value[1];
|
16411 | _context.next = 9;
|
16412 | return [id, item];
|
16413 |
|
16414 | case 9:
|
16415 | _iteratorNormalCompletion = true;
|
16416 | _context.next = 5;
|
16417 | break;
|
16418 |
|
16419 | case 12:
|
16420 | _context.next = 18;
|
16421 | break;
|
16422 |
|
16423 | case 14:
|
16424 | _context.prev = 14;
|
16425 | _context.t0 = _context["catch"](3);
|
16426 | _didIteratorError = true;
|
16427 | _iteratorError = _context.t0;
|
16428 |
|
16429 | case 18:
|
16430 | _context.prev = 18;
|
16431 | _context.prev = 19;
|
16432 |
|
16433 | if (!_iteratorNormalCompletion && _iterator.return != null) {
|
16434 | _iterator.return();
|
16435 | }
|
16436 |
|
16437 | case 21:
|
16438 | _context.prev = 21;
|
16439 |
|
16440 | if (!_didIteratorError) {
|
16441 | _context.next = 24;
|
16442 | break;
|
16443 | }
|
16444 |
|
16445 | throw _iteratorError;
|
16446 |
|
16447 | case 24:
|
16448 | return _context.finish(21);
|
16449 |
|
16450 | case 25:
|
16451 | return _context.finish(18);
|
16452 |
|
16453 | case 26:
|
16454 | case "end":
|
16455 | return _context.stop();
|
16456 | }
|
16457 | }
|
16458 | }, value, this, [[3, 14, 18, 26], [19,, 21, 25]]);
|
16459 | })
|
16460 | |
16461 |
|
16462 |
|
16463 |
|
16464 | }, {
|
16465 | key: "entries",
|
16466 | value:
|
16467 |
|
16468 | regenerator.mark(function entries() {
|
16469 | var _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, _step2$value, id, item;
|
16470 |
|
16471 | return regenerator.wrap(function entries$(_context2) {
|
16472 | while (1) {
|
16473 | switch (_context2.prev = _context2.next) {
|
16474 | case 0:
|
16475 | _iteratorNormalCompletion2 = true;
|
16476 | _didIteratorError2 = false;
|
16477 | _iteratorError2 = undefined;
|
16478 | _context2.prev = 3;
|
16479 | _iterator2 = getIterator$2$1(this._pairs);
|
16480 |
|
16481 | case 5:
|
16482 | if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) {
|
16483 | _context2.next = 12;
|
16484 | break;
|
16485 | }
|
16486 |
|
16487 | _step2$value = slicedToArray(_step2.value, 2), id = _step2$value[0], item = _step2$value[1];
|
16488 | _context2.next = 9;
|
16489 | return [id, item];
|
16490 |
|
16491 | case 9:
|
16492 | _iteratorNormalCompletion2 = true;
|
16493 | _context2.next = 5;
|
16494 | break;
|
16495 |
|
16496 | case 12:
|
16497 | _context2.next = 18;
|
16498 | break;
|
16499 |
|
16500 | case 14:
|
16501 | _context2.prev = 14;
|
16502 | _context2.t0 = _context2["catch"](3);
|
16503 | _didIteratorError2 = true;
|
16504 | _iteratorError2 = _context2.t0;
|
16505 |
|
16506 | case 18:
|
16507 | _context2.prev = 18;
|
16508 | _context2.prev = 19;
|
16509 |
|
16510 | if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
16511 | _iterator2.return();
|
16512 | }
|
16513 |
|
16514 | case 21:
|
16515 | _context2.prev = 21;
|
16516 |
|
16517 | if (!_didIteratorError2) {
|
16518 | _context2.next = 24;
|
16519 | break;
|
16520 | }
|
16521 |
|
16522 | throw _iteratorError2;
|
16523 |
|
16524 | case 24:
|
16525 | return _context2.finish(21);
|
16526 |
|
16527 | case 25:
|
16528 | return _context2.finish(18);
|
16529 |
|
16530 | case 26:
|
16531 | case "end":
|
16532 | return _context2.stop();
|
16533 | }
|
16534 | }
|
16535 | }, entries, this, [[3, 14, 18, 26], [19,, 21, 25]]);
|
16536 | })
|
16537 | |
16538 |
|
16539 |
|
16540 |
|
16541 | }, {
|
16542 | key: "keys",
|
16543 | value:
|
16544 |
|
16545 | regenerator.mark(function keys() {
|
16546 | var _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, _step3$value, id;
|
16547 |
|
16548 | return regenerator.wrap(function keys$(_context3) {
|
16549 | while (1) {
|
16550 | switch (_context3.prev = _context3.next) {
|
16551 | case 0:
|
16552 | _iteratorNormalCompletion3 = true;
|
16553 | _didIteratorError3 = false;
|
16554 | _iteratorError3 = undefined;
|
16555 | _context3.prev = 3;
|
16556 | _iterator3 = getIterator$2$1(this._pairs);
|
16557 |
|
16558 | case 5:
|
16559 | if (_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done) {
|
16560 | _context3.next = 12;
|
16561 | break;
|
16562 | }
|
16563 |
|
16564 | _step3$value = slicedToArray(_step3.value, 1), id = _step3$value[0];
|
16565 | _context3.next = 9;
|
16566 | return id;
|
16567 |
|
16568 | case 9:
|
16569 | _iteratorNormalCompletion3 = true;
|
16570 | _context3.next = 5;
|
16571 | break;
|
16572 |
|
16573 | case 12:
|
16574 | _context3.next = 18;
|
16575 | break;
|
16576 |
|
16577 | case 14:
|
16578 | _context3.prev = 14;
|
16579 | _context3.t0 = _context3["catch"](3);
|
16580 | _didIteratorError3 = true;
|
16581 | _iteratorError3 = _context3.t0;
|
16582 |
|
16583 | case 18:
|
16584 | _context3.prev = 18;
|
16585 | _context3.prev = 19;
|
16586 |
|
16587 | if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
16588 | _iterator3.return();
|
16589 | }
|
16590 |
|
16591 | case 21:
|
16592 | _context3.prev = 21;
|
16593 |
|
16594 | if (!_didIteratorError3) {
|
16595 | _context3.next = 24;
|
16596 | break;
|
16597 | }
|
16598 |
|
16599 | throw _iteratorError3;
|
16600 |
|
16601 | case 24:
|
16602 | return _context3.finish(21);
|
16603 |
|
16604 | case 25:
|
16605 | return _context3.finish(18);
|
16606 |
|
16607 | case 26:
|
16608 | case "end":
|
16609 | return _context3.stop();
|
16610 | }
|
16611 | }
|
16612 | }, keys, this, [[3, 14, 18, 26], [19,, 21, 25]]);
|
16613 | })
|
16614 | |
16615 |
|
16616 |
|
16617 |
|
16618 | }, {
|
16619 | key: "values",
|
16620 | value:
|
16621 |
|
16622 | regenerator.mark(function values() {
|
16623 | var _iteratorNormalCompletion4, _didIteratorError4, _iteratorError4, _iterator4, _step4, _step4$value, item;
|
16624 |
|
16625 | return regenerator.wrap(function values$(_context4) {
|
16626 | while (1) {
|
16627 | switch (_context4.prev = _context4.next) {
|
16628 | case 0:
|
16629 | _iteratorNormalCompletion4 = true;
|
16630 | _didIteratorError4 = false;
|
16631 | _iteratorError4 = undefined;
|
16632 | _context4.prev = 3;
|
16633 | _iterator4 = getIterator$2$1(this._pairs);
|
16634 |
|
16635 | case 5:
|
16636 | if (_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done) {
|
16637 | _context4.next = 12;
|
16638 | break;
|
16639 | }
|
16640 |
|
16641 | _step4$value = slicedToArray(_step4.value, 2), item = _step4$value[1];
|
16642 | _context4.next = 9;
|
16643 | return item;
|
16644 |
|
16645 | case 9:
|
16646 | _iteratorNormalCompletion4 = true;
|
16647 | _context4.next = 5;
|
16648 | break;
|
16649 |
|
16650 | case 12:
|
16651 | _context4.next = 18;
|
16652 | break;
|
16653 |
|
16654 | case 14:
|
16655 | _context4.prev = 14;
|
16656 | _context4.t0 = _context4["catch"](3);
|
16657 | _didIteratorError4 = true;
|
16658 | _iteratorError4 = _context4.t0;
|
16659 |
|
16660 | case 18:
|
16661 | _context4.prev = 18;
|
16662 | _context4.prev = 19;
|
16663 |
|
16664 | if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
|
16665 | _iterator4.return();
|
16666 | }
|
16667 |
|
16668 | case 21:
|
16669 | _context4.prev = 21;
|
16670 |
|
16671 | if (!_didIteratorError4) {
|
16672 | _context4.next = 24;
|
16673 | break;
|
16674 | }
|
16675 |
|
16676 | throw _iteratorError4;
|
16677 |
|
16678 | case 24:
|
16679 | return _context4.finish(21);
|
16680 |
|
16681 | case 25:
|
16682 | return _context4.finish(18);
|
16683 |
|
16684 | case 26:
|
16685 | case "end":
|
16686 | return _context4.stop();
|
16687 | }
|
16688 | }
|
16689 | }, values, this, [[3, 14, 18, 26], [19,, 21, 25]]);
|
16690 | })
|
16691 | |
16692 |
|
16693 |
|
16694 |
|
16695 |
|
16696 |
|
16697 |
|
16698 |
|
16699 |
|
16700 | }, {
|
16701 | key: "toIdArray",
|
16702 | value: function toIdArray() {
|
16703 | var _context5;
|
16704 |
|
16705 | return map$2$1(_context5 = toConsumableArray$1(this._pairs)).call(_context5, function (pair) {
|
16706 | return pair[0];
|
16707 | });
|
16708 | }
|
16709 | |
16710 |
|
16711 |
|
16712 |
|
16713 |
|
16714 |
|
16715 |
|
16716 |
|
16717 |
|
16718 | }, {
|
16719 | key: "toItemArray",
|
16720 | value: function toItemArray() {
|
16721 | var _context6;
|
16722 |
|
16723 | return map$2$1(_context6 = toConsumableArray$1(this._pairs)).call(_context6, function (pair) {
|
16724 | return pair[1];
|
16725 | });
|
16726 | }
|
16727 | |
16728 |
|
16729 |
|
16730 |
|
16731 |
|
16732 |
|
16733 |
|
16734 |
|
16735 |
|
16736 | }, {
|
16737 | key: "toEntryArray",
|
16738 | value: function toEntryArray() {
|
16739 | return toConsumableArray$1(this._pairs);
|
16740 | }
|
16741 | |
16742 |
|
16743 |
|
16744 |
|
16745 |
|
16746 |
|
16747 |
|
16748 |
|
16749 |
|
16750 | }, {
|
16751 | key: "toObjectMap",
|
16752 | value: function toObjectMap() {
|
16753 | var map = create$4(null);
|
16754 | var _iteratorNormalCompletion5 = true;
|
16755 | var _didIteratorError5 = false;
|
16756 | var _iteratorError5 = undefined;
|
16757 |
|
16758 | try {
|
16759 | for (var _iterator5 = getIterator$2$1(this._pairs), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
|
16760 | var _step5$value = slicedToArray(_step5.value, 2),
|
16761 | id = _step5$value[0],
|
16762 | item = _step5$value[1];
|
16763 |
|
16764 | map[id] = item;
|
16765 | }
|
16766 | } catch (err) {
|
16767 | _didIteratorError5 = true;
|
16768 | _iteratorError5 = err;
|
16769 | } finally {
|
16770 | try {
|
16771 | if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
|
16772 | _iterator5.return();
|
16773 | }
|
16774 | } finally {
|
16775 | if (_didIteratorError5) {
|
16776 | throw _iteratorError5;
|
16777 | }
|
16778 | }
|
16779 | }
|
16780 |
|
16781 | return map;
|
16782 | }
|
16783 | |
16784 |
|
16785 |
|
16786 |
|
16787 |
|
16788 |
|
16789 | }, {
|
16790 | key: "toMap",
|
16791 | value: function toMap() {
|
16792 | return new map$5(this._pairs);
|
16793 | }
|
16794 | |
16795 |
|
16796 |
|
16797 |
|
16798 |
|
16799 |
|
16800 | }, {
|
16801 | key: "toIdSet",
|
16802 | value: function toIdSet() {
|
16803 | return new set$4(this.toIdArray());
|
16804 | }
|
16805 | /**
|
16806 | * Return a set containing all the (unique) items in this stream.
|
16807 | *
|
16808 | * @returns The set of all items from this stream.
|
16809 | */
|
16810 |
|
16811 | }, {
|
16812 | key: "toItemSet",
|
16813 | value: function toItemSet() {
|
16814 | return new set$4(this.toItemArray());
|
16815 | }
|
16816 | /**
|
16817 | * Cache the items from this stream.
|
16818 | *
|
16819 | * @remarks
|
16820 | * This method allows for items to be fetched immediatelly and used (possibly multiple times) later.
|
16821 | * It can also be used to optimize performance as [[DataStream]] would otherwise reevaluate everything upon each iteration.
|
16822 | *
|
16823 | * ## Example
|
16824 | * ```javascript
|
16825 | * const ds = new DataSet([…])
|
16826 | *
|
16827 | * const cachedStream = ds.stream()
|
16828 | * .filter(…)
|
16829 | * .sort(…)
|
16830 | * .map(…)
|
16831 | * .cached(…) // Data are fetched, processed and cached here.
|
16832 | *
|
16833 | * ds.clear()
|
16834 | * chachedStream // Still has all the items.
|
16835 | * ```
|
16836 | *
|
16837 | * @returns A new [[DataStream]] with cached items (detached from the original [[DataSet]]).
|
16838 | */
|
16839 |
|
16840 | }, {
|
16841 | key: "cache",
|
16842 | value: function cache() {
|
16843 | return new DataStream(toConsumableArray$1(this._pairs));
|
16844 | }
|
16845 | |
16846 |
|
16847 |
|
16848 |
|
16849 |
|
16850 |
|
16851 |
|
16852 |
|
16853 |
|
16854 |
|
16855 | }, {
|
16856 | key: "distinct",
|
16857 | value: function distinct(callback) {
|
16858 | var set = new set$4();
|
16859 | var _iteratorNormalCompletion6 = true;
|
16860 | var _didIteratorError6 = false;
|
16861 | var _iteratorError6 = undefined;
|
16862 |
|
16863 | try {
|
16864 | for (var _iterator6 = getIterator$2$1(this._pairs), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
|
16865 | var _step6$value = slicedToArray(_step6.value, 2),
|
16866 | id = _step6$value[0],
|
16867 | item = _step6$value[1];
|
16868 |
|
16869 | set.add(callback(item, id));
|
16870 | }
|
16871 | } catch (err) {
|
16872 | _didIteratorError6 = true;
|
16873 | _iteratorError6 = err;
|
16874 | } finally {
|
16875 | try {
|
16876 | if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
|
16877 | _iterator6.return();
|
16878 | }
|
16879 | } finally {
|
16880 | if (_didIteratorError6) {
|
16881 | throw _iteratorError6;
|
16882 | }
|
16883 | }
|
16884 | }
|
16885 |
|
16886 | return set;
|
16887 | }
|
16888 | /**
|
16889 | * Filter the items of the stream.
|
16890 | *
|
16891 | * @param callback - The function that decides whether an item will be included.
|
16892 | *
|
16893 | * @returns A new data stream with the filtered items.
|
16894 | */
|
16895 |
|
16896 | }, {
|
16897 | key: "filter",
|
16898 | value: function filter(callback) {
|
16899 | var pairs = this._pairs;
|
16900 | return new DataStream(defineProperty$6$1({}, iterator$2$1,
|
16901 |
|
16902 | regenerator.mark(function _callee() {
|
16903 | var _iteratorNormalCompletion7, _didIteratorError7, _iteratorError7, _iterator7, _step7, _step7$value, id, item;
|
16904 |
|
16905 | return regenerator.wrap(function _callee$(_context7) {
|
16906 | while (1) {
|
16907 | switch (_context7.prev = _context7.next) {
|
16908 | case 0:
|
16909 | _iteratorNormalCompletion7 = true;
|
16910 | _didIteratorError7 = false;
|
16911 | _iteratorError7 = undefined;
|
16912 | _context7.prev = 3;
|
16913 | _iterator7 = getIterator$2$1(pairs);
|
16914 |
|
16915 | case 5:
|
16916 | if (_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done) {
|
16917 | _context7.next = 13;
|
16918 | break;
|
16919 | }
|
16920 |
|
16921 | _step7$value = slicedToArray(_step7.value, 2), id = _step7$value[0], item = _step7$value[1];
|
16922 |
|
16923 | if (!callback(item, id)) {
|
16924 | _context7.next = 10;
|
16925 | break;
|
16926 | }
|
16927 |
|
16928 | _context7.next = 10;
|
16929 | return [id, item];
|
16930 |
|
16931 | case 10:
|
16932 | _iteratorNormalCompletion7 = true;
|
16933 | _context7.next = 5;
|
16934 | break;
|
16935 |
|
16936 | case 13:
|
16937 | _context7.next = 19;
|
16938 | break;
|
16939 |
|
16940 | case 15:
|
16941 | _context7.prev = 15;
|
16942 | _context7.t0 = _context7["catch"](3);
|
16943 | _didIteratorError7 = true;
|
16944 | _iteratorError7 = _context7.t0;
|
16945 |
|
16946 | case 19:
|
16947 | _context7.prev = 19;
|
16948 | _context7.prev = 20;
|
16949 |
|
16950 | if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
|
16951 | _iterator7.return();
|
16952 | }
|
16953 |
|
16954 | case 22:
|
16955 | _context7.prev = 22;
|
16956 |
|
16957 | if (!_didIteratorError7) {
|
16958 | _context7.next = 25;
|
16959 | break;
|
16960 | }
|
16961 |
|
16962 | throw _iteratorError7;
|
16963 |
|
16964 | case 25:
|
16965 | return _context7.finish(22);
|
16966 |
|
16967 | case 26:
|
16968 | return _context7.finish(19);
|
16969 |
|
16970 | case 27:
|
16971 | case "end":
|
16972 | return _context7.stop();
|
16973 | }
|
16974 | }
|
16975 | }, _callee, null, [[3, 15, 19, 27], [20,, 22, 26]]);
|
16976 | })));
|
16977 | }
|
16978 | |
16979 |
|
16980 |
|
16981 |
|
16982 |
|
16983 |
|
16984 | }, {
|
16985 | key: "forEach",
|
16986 | value: function forEach(callback) {
|
16987 | var _iteratorNormalCompletion8 = true;
|
16988 | var _didIteratorError8 = false;
|
16989 | var _iteratorError8 = undefined;
|
16990 |
|
16991 | try {
|
16992 | for (var _iterator8 = getIterator$2$1(this._pairs), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {
|
16993 | var _step8$value = slicedToArray(_step8.value, 2),
|
16994 | id = _step8$value[0],
|
16995 | item = _step8$value[1];
|
16996 |
|
16997 | callback(item, id);
|
16998 | }
|
16999 | } catch (err) {
|
17000 | _didIteratorError8 = true;
|
17001 | _iteratorError8 = err;
|
17002 | } finally {
|
17003 | try {
|
17004 | if (!_iteratorNormalCompletion8 && _iterator8.return != null) {
|
17005 | _iterator8.return();
|
17006 | }
|
17007 | } finally {
|
17008 | if (_didIteratorError8) {
|
17009 | throw _iteratorError8;
|
17010 | }
|
17011 | }
|
17012 | }
|
17013 | }
|
17014 | |
17015 |
|
17016 |
|
17017 |
|
17018 |
|
17019 |
|
17020 |
|
17021 |
|
17022 |
|
17023 |
|
17024 | }, {
|
17025 | key: "map",
|
17026 | value: function map(callback) {
|
17027 | var pairs = this._pairs;
|
17028 | return new DataStream(defineProperty$6$1({}, iterator$2$1,
|
17029 |
|
17030 | regenerator.mark(function _callee2() {
|
17031 | var _iteratorNormalCompletion9, _didIteratorError9, _iteratorError9, _iterator9, _step9, _step9$value, id, item;
|
17032 |
|
17033 | return regenerator.wrap(function _callee2$(_context8) {
|
17034 | while (1) {
|
17035 | switch (_context8.prev = _context8.next) {
|
17036 | case 0:
|
17037 | _iteratorNormalCompletion9 = true;
|
17038 | _didIteratorError9 = false;
|
17039 | _iteratorError9 = undefined;
|
17040 | _context8.prev = 3;
|
17041 | _iterator9 = getIterator$2$1(pairs);
|
17042 |
|
17043 | case 5:
|
17044 | if (_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done) {
|
17045 | _context8.next = 12;
|
17046 | break;
|
17047 | }
|
17048 |
|
17049 | _step9$value = slicedToArray(_step9.value, 2), id = _step9$value[0], item = _step9$value[1];
|
17050 | _context8.next = 9;
|
17051 | return [id, callback(item, id)];
|
17052 |
|
17053 | case 9:
|
17054 | _iteratorNormalCompletion9 = true;
|
17055 | _context8.next = 5;
|
17056 | break;
|
17057 |
|
17058 | case 12:
|
17059 | _context8.next = 18;
|
17060 | break;
|
17061 |
|
17062 | case 14:
|
17063 | _context8.prev = 14;
|
17064 | _context8.t0 = _context8["catch"](3);
|
17065 | _didIteratorError9 = true;
|
17066 | _iteratorError9 = _context8.t0;
|
17067 |
|
17068 | case 18:
|
17069 | _context8.prev = 18;
|
17070 | _context8.prev = 19;
|
17071 |
|
17072 | if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
|
17073 | _iterator9.return();
|
17074 | }
|
17075 |
|
17076 | case 21:
|
17077 | _context8.prev = 21;
|
17078 |
|
17079 | if (!_didIteratorError9) {
|
17080 | _context8.next = 24;
|
17081 | break;
|
17082 | }
|
17083 |
|
17084 | throw _iteratorError9;
|
17085 |
|
17086 | case 24:
|
17087 | return _context8.finish(21);
|
17088 |
|
17089 | case 25:
|
17090 | return _context8.finish(18);
|
17091 |
|
17092 | case 26:
|
17093 | case "end":
|
17094 | return _context8.stop();
|
17095 | }
|
17096 | }
|
17097 | }, _callee2, null, [[3, 14, 18, 26], [19,, 21, 25]]);
|
17098 | })));
|
17099 | }
|
17100 | |
17101 |
|
17102 |
|
17103 |
|
17104 |
|
17105 |
|
17106 |
|
17107 |
|
17108 | }, {
|
17109 | key: "max",
|
17110 | value: function max(callback) {
|
17111 | var iter = getIterator$2$1(this._pairs);
|
17112 | var curr = iter.next();
|
17113 |
|
17114 | if (curr.done) {
|
17115 | return null;
|
17116 | }
|
17117 |
|
17118 | var maxItem = curr.value[1];
|
17119 | var maxValue = callback(curr.value[1], curr.value[0]);
|
17120 |
|
17121 | while (!(curr = iter.next()).done) {
|
17122 | var _curr$value = slicedToArray(curr.value, 2),
|
17123 | id = _curr$value[0],
|
17124 | item = _curr$value[1];
|
17125 |
|
17126 | var _value = callback(item, id);
|
17127 |
|
17128 | if (_value > maxValue) {
|
17129 | maxValue = _value;
|
17130 | maxItem = item;
|
17131 | }
|
17132 | }
|
17133 |
|
17134 | return maxItem;
|
17135 | }
|
17136 | |
17137 |
|
17138 |
|
17139 |
|
17140 |
|
17141 |
|
17142 |
|
17143 |
|
17144 | }, {
|
17145 | key: "min",
|
17146 | value: function min(callback) {
|
17147 | var iter = getIterator$2$1(this._pairs);
|
17148 | var curr = iter.next();
|
17149 |
|
17150 | if (curr.done) {
|
17151 | return null;
|
17152 | }
|
17153 |
|
17154 | var minItem = curr.value[1];
|
17155 | var minValue = callback(curr.value[1], curr.value[0]);
|
17156 |
|
17157 | while (!(curr = iter.next()).done) {
|
17158 | var _curr$value2 = slicedToArray(curr.value, 2),
|
17159 | id = _curr$value2[0],
|
17160 | item = _curr$value2[1];
|
17161 |
|
17162 | var _value2 = callback(item, id);
|
17163 |
|
17164 | if (_value2 < minValue) {
|
17165 | minValue = _value2;
|
17166 | minItem = item;
|
17167 | }
|
17168 | }
|
17169 |
|
17170 | return minItem;
|
17171 | }
|
17172 | |
17173 |
|
17174 |
|
17175 |
|
17176 |
|
17177 |
|
17178 |
|
17179 |
|
17180 |
|
17181 |
|
17182 |
|
17183 | }, {
|
17184 | key: "reduce",
|
17185 | value: function reduce(callback, accumulator) {
|
17186 | var _iteratorNormalCompletion10 = true;
|
17187 | var _didIteratorError10 = false;
|
17188 | var _iteratorError10 = undefined;
|
17189 |
|
17190 | try {
|
17191 | for (var _iterator10 = getIterator$2$1(this._pairs), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {
|
17192 | var _step10$value = slicedToArray(_step10.value, 2),
|
17193 | id = _step10$value[0],
|
17194 | item = _step10$value[1];
|
17195 |
|
17196 | accumulator = callback(accumulator, item, id);
|
17197 | }
|
17198 | } catch (err) {
|
17199 | _didIteratorError10 = true;
|
17200 | _iteratorError10 = err;
|
17201 | } finally {
|
17202 | try {
|
17203 | if (!_iteratorNormalCompletion10 && _iterator10.return != null) {
|
17204 | _iterator10.return();
|
17205 | }
|
17206 | } finally {
|
17207 | if (_didIteratorError10) {
|
17208 | throw _iteratorError10;
|
17209 | }
|
17210 | }
|
17211 | }
|
17212 |
|
17213 | return accumulator;
|
17214 | }
|
17215 | |
17216 |
|
17217 |
|
17218 |
|
17219 |
|
17220 |
|
17221 |
|
17222 |
|
17223 | }, {
|
17224 | key: "sort",
|
17225 | value: function sort(callback) {
|
17226 | var _this = this;
|
17227 |
|
17228 | return new DataStream(defineProperty$6$1({}, iterator$2$1, function () {
|
17229 | var _context9;
|
17230 |
|
17231 | return getIterator$2$1(sort$2(_context9 = toConsumableArray$1(_this._pairs)).call(_context9, function (_ref3, _ref4) {
|
17232 | var _ref5 = slicedToArray(_ref3, 2),
|
17233 | idA = _ref5[0],
|
17234 | itemA = _ref5[1];
|
17235 |
|
17236 | var _ref6 = slicedToArray(_ref4, 2),
|
17237 | idB = _ref6[0],
|
17238 | itemB = _ref6[1];
|
17239 |
|
17240 | return callback(itemA, itemB, idA, idB);
|
17241 | }));
|
17242 | }));
|
17243 | }
|
17244 | }]);
|
17245 | return DataStream;
|
17246 | }();
|
17247 |
|
17248 | function ownKeys$2$1(object, enumerableOnly) {
|
17249 | var keys = keys$6(object);
|
17250 |
|
17251 | if (getOwnPropertySymbols$2$1) {
|
17252 | var symbols = getOwnPropertySymbols$2$1(object);
|
17253 | if (enumerableOnly) symbols = filter$2$1(symbols).call(symbols, function (sym) {
|
17254 | return getOwnPropertyDescriptor$3$1(object, sym).enumerable;
|
17255 | });
|
17256 | keys.push.apply(keys, symbols);
|
17257 | }
|
17258 |
|
17259 | return keys;
|
17260 | }
|
17261 |
|
17262 | function _objectSpread$1(target) {
|
17263 | for (var i = 1; i < arguments.length; i++) {
|
17264 | var source = arguments[i] != null ? arguments[i] : {};
|
17265 |
|
17266 | if (i % 2) {
|
17267 | var _context9;
|
17268 |
|
17269 | forEach$2$1(_context9 = ownKeys$2$1(source, true)).call(_context9, function (key) {
|
17270 | defineProperty$6$1(target, key, source[key]);
|
17271 | });
|
17272 | } else if (getOwnPropertyDescriptors$2$1) {
|
17273 | defineProperties$1$1(target, getOwnPropertyDescriptors$2$1(source));
|
17274 | } else {
|
17275 | var _context10;
|
17276 |
|
17277 | forEach$2$1(_context10 = ownKeys$2$1(source)).call(_context10, function (key) {
|
17278 | defineProperty$1$1(target, key, getOwnPropertyDescriptor$3$1(source, key));
|
17279 | });
|
17280 | }
|
17281 | }
|
17282 |
|
17283 | return target;
|
17284 | }
|
17285 |
|
17286 |
|
17287 |
|
17288 |
|
17289 |
|
17290 |
|
17291 |
|
17292 |
|
17293 |
|
17294 |
|
17295 |
|
17296 |
|
17297 |
|
17298 |
|
17299 |
|
17300 |
|
17301 |
|
17302 |
|
17303 |
|
17304 |
|
17305 |
|
17306 |
|
17307 |
|
17308 |
|
17309 |
|
17310 |
|
17311 |
|
17312 |
|
17313 |
|
17314 |
|
17315 |
|
17316 |
|
17317 |
|
17318 |
|
17319 |
|
17320 |
|
17321 |
|
17322 |
|
17323 |
|
17324 |
|
17325 |
|
17326 |
|
17327 |
|
17328 |
|
17329 |
|
17330 |
|
17331 |
|
17332 |
|
17333 |
|
17334 |
|
17335 |
|
17336 |
|
17337 |
|
17338 |
|
17339 |
|
17340 |
|
17341 |
|
17342 |
|
17343 |
|
17344 |
|
17345 |
|
17346 |
|
17347 |
|
17348 |
|
17349 |
|
17350 | var DataSet =
|
17351 |
|
17352 | function (_DataSetPart) {
|
17353 | inherits(DataSet, _DataSetPart);
|
17354 | |
17355 |
|
17356 |
|
17357 |
|
17358 |
|
17359 |
|
17360 |
|
17361 | function DataSet(data, options) {
|
17362 | var _this;
|
17363 |
|
17364 | classCallCheck(this, DataSet);
|
17365 | _this = possibleConstructorReturn(this, getPrototypeOf$3$1(DataSet).call(this));
|
17366 |
|
17367 | if (data && !isArray$5$1(data)) {
|
17368 | options = data;
|
17369 | data = [];
|
17370 | }
|
17371 |
|
17372 | _this._options = options || {};
|
17373 | _this._data = new map$5();
|
17374 |
|
17375 | _this.length = 0;
|
17376 |
|
17377 | _this._idProp = _this._options.fieldId || "id";
|
17378 |
|
17379 | _this._type = {};
|
17380 |
|
17381 |
|
17382 |
|
17383 | if (_this._options.type) {
|
17384 | var fields = keys$6(_this._options.type);
|
17385 |
|
17386 | for (var i = 0, len = fields.length; i < len; i++) {
|
17387 | var field = fields[i];
|
17388 | var value = _this._options.type[field];
|
17389 |
|
17390 | if (value == "Date" || value == "ISODate" || value == "ASPDate") {
|
17391 | _this._type[field] = "Date";
|
17392 | } else {
|
17393 | _this._type[field] = value;
|
17394 | }
|
17395 | }
|
17396 | }
|
17397 |
|
17398 |
|
17399 | if (data && data.length) {
|
17400 | _this.add(data);
|
17401 | }
|
17402 |
|
17403 | _this.setOptions(options);
|
17404 |
|
17405 | return _this;
|
17406 | }
|
17407 | |
17408 |
|
17409 |
|
17410 |
|
17411 |
|
17412 |
|
17413 |
|
17414 | createClass(DataSet, [{
|
17415 | key: "setOptions",
|
17416 | value: function setOptions(options) {
|
17417 | if (options && options.queue !== undefined) {
|
17418 | if (options.queue === false) {
|
17419 |
|
17420 | if (this._queue) {
|
17421 | this._queue.destroy();
|
17422 |
|
17423 | delete this._queue;
|
17424 | }
|
17425 | } else {
|
17426 |
|
17427 | if (!this._queue) {
|
17428 | this._queue = Queue.extend(this, {
|
17429 | replace: ["add", "update", "remove"]
|
17430 | });
|
17431 | }
|
17432 |
|
17433 | if (options.queue && _typeof_1$1(options.queue) === "object") {
|
17434 | this._queue.setOptions(options.queue);
|
17435 | }
|
17436 | }
|
17437 | }
|
17438 | }
|
17439 | |
17440 |
|
17441 |
|
17442 |
|
17443 |
|
17444 |
|
17445 |
|
17446 |
|
17447 |
|
17448 |
|
17449 |
|
17450 |
|
17451 |
|
17452 |
|
17453 |
|
17454 |
|
17455 |
|
17456 |
|
17457 |
|
17458 |
|
17459 |
|
17460 |
|
17461 |
|
17462 |
|
17463 |
|
17464 |
|
17465 |
|
17466 |
|
17467 |
|
17468 | }, {
|
17469 | key: "add",
|
17470 | value: function add(data, senderId) {
|
17471 | var _this2 = this;
|
17472 |
|
17473 | var addedIds = [];
|
17474 | var id;
|
17475 |
|
17476 | if (isArray$5$1(data)) {
|
17477 |
|
17478 | var idsToAdd = map$2$1(data).call(data, function (d) {
|
17479 | return d[_this2._idProp];
|
17480 | });
|
17481 |
|
17482 | if (some$2(idsToAdd).call(idsToAdd, function (id) {
|
17483 | return _this2._data.has(id);
|
17484 | })) {
|
17485 | throw new Error("A duplicate id was found in the parameter array.");
|
17486 | }
|
17487 |
|
17488 | for (var i = 0, len = data.length; i < len; i++) {
|
17489 | id = this._addItem(data[i]);
|
17490 | addedIds.push(id);
|
17491 | }
|
17492 | } else if (data && _typeof_1$1(data) === "object") {
|
17493 |
|
17494 | id = this._addItem(data);
|
17495 | addedIds.push(id);
|
17496 | } else {
|
17497 | throw new Error("Unknown dataType");
|
17498 | }
|
17499 |
|
17500 | if (addedIds.length) {
|
17501 | this._trigger("add", {
|
17502 | items: addedIds
|
17503 | }, senderId);
|
17504 | }
|
17505 |
|
17506 | return addedIds;
|
17507 | }
|
17508 | |
17509 |
|
17510 |
|
17511 |
|
17512 |
|
17513 |
|
17514 |
|
17515 |
|
17516 |
|
17517 |
|
17518 |
|
17519 |
|
17520 |
|
17521 |
|
17522 |
|
17523 |
|
17524 |
|
17525 |
|
17526 |
|
17527 |
|
17528 |
|
17529 |
|
17530 |
|
17531 |
|
17532 |
|
17533 |
|
17534 |
|
17535 |
|
17536 |
|
17537 |
|
17538 |
|
17539 |
|
17540 |
|
17541 |
|
17542 |
|
17543 |
|
17544 |
|
17545 |
|
17546 | }, {
|
17547 | key: "update",
|
17548 | value: function update(data, senderId) {
|
17549 | var _this3 = this;
|
17550 |
|
17551 | var addedIds = [];
|
17552 | var updatedIds = [];
|
17553 | var oldData = [];
|
17554 | var updatedData = [];
|
17555 | var idProp = this._idProp;
|
17556 |
|
17557 | var addOrUpdate = function addOrUpdate(item) {
|
17558 | var origId = item[idProp];
|
17559 |
|
17560 | if (origId != null && _this3._data.has(origId)) {
|
17561 | var fullItem = item;
|
17562 |
|
17563 | var oldItem = assign$2$1({}, _this3._data.get(origId));
|
17564 |
|
17565 | var id = _this3._updateItem(fullItem);
|
17566 |
|
17567 | updatedIds.push(id);
|
17568 | updatedData.push(fullItem);
|
17569 | oldData.push(oldItem);
|
17570 | } else {
|
17571 |
|
17572 | var _id = _this3._addItem(item);
|
17573 |
|
17574 | addedIds.push(_id);
|
17575 | }
|
17576 | };
|
17577 |
|
17578 | if (isArray$5$1(data)) {
|
17579 |
|
17580 | for (var i = 0, len = data.length; i < len; i++) {
|
17581 | if (data[i] && _typeof_1$1(data[i]) === "object") {
|
17582 | addOrUpdate(data[i]);
|
17583 | } else {
|
17584 | console.warn("Ignoring input item, which is not an object at index " + i);
|
17585 | }
|
17586 | }
|
17587 | } else if (data && _typeof_1$1(data) === "object") {
|
17588 |
|
17589 | addOrUpdate(data);
|
17590 | } else {
|
17591 | throw new Error("Unknown dataType");
|
17592 | }
|
17593 |
|
17594 | if (addedIds.length) {
|
17595 | this._trigger("add", {
|
17596 | items: addedIds
|
17597 | }, senderId);
|
17598 | }
|
17599 |
|
17600 | if (updatedIds.length) {
|
17601 | var props = {
|
17602 | items: updatedIds,
|
17603 | oldData: oldData,
|
17604 | data: updatedData
|
17605 | };
|
17606 |
|
17607 |
|
17608 |
|
17609 |
|
17610 |
|
17611 |
|
17612 |
|
17613 | this._trigger("update", props, senderId);
|
17614 | }
|
17615 |
|
17616 | return concat$2$1(addedIds).call(addedIds, updatedIds);
|
17617 | }
|
17618 | |
17619 |
|
17620 |
|
17621 |
|
17622 |
|
17623 |
|
17624 |
|
17625 |
|
17626 |
|
17627 |
|
17628 |
|
17629 |
|
17630 |
|
17631 |
|
17632 |
|
17633 |
|
17634 |
|
17635 |
|
17636 |
|
17637 |
|
17638 |
|
17639 |
|
17640 |
|
17641 |
|
17642 |
|
17643 |
|
17644 |
|
17645 |
|
17646 |
|
17647 |
|
17648 |
|
17649 |
|
17650 |
|
17651 |
|
17652 |
|
17653 |
|
17654 |
|
17655 |
|
17656 | }, {
|
17657 | key: "updateOnly",
|
17658 | value: function updateOnly(data, senderId) {
|
17659 | var _context,
|
17660 | _this4 = this;
|
17661 |
|
17662 | if (!isArray$5$1(data)) {
|
17663 | data = [data];
|
17664 | }
|
17665 |
|
17666 | var updateEventData = map$2$1(_context = map$2$1(data).call(data, function (update) {
|
17667 | var oldData = _this4._data.get(update[_this4._idProp]);
|
17668 |
|
17669 | if (oldData == null) {
|
17670 | throw new Error("Updating non-existent items is not allowed.");
|
17671 | }
|
17672 |
|
17673 | return {
|
17674 | oldData: oldData,
|
17675 | update: update
|
17676 | };
|
17677 | })).call(_context, function (_ref) {
|
17678 | var oldData = _ref.oldData,
|
17679 | update = _ref.update;
|
17680 | var id = oldData[_this4._idProp];
|
17681 | var updatedData = deepExtend$1(deepExtend$1({}, oldData), update);
|
17682 |
|
17683 | _this4._data.set(id, updatedData);
|
17684 |
|
17685 | return {
|
17686 | id: id,
|
17687 | oldData: oldData,
|
17688 | updatedData: updatedData
|
17689 | };
|
17690 | });
|
17691 |
|
17692 | if (updateEventData.length) {
|
17693 | var props = {
|
17694 | items: map$2$1(updateEventData).call(updateEventData, function (value) {
|
17695 | return value.id;
|
17696 | }),
|
17697 | oldData: map$2$1(updateEventData).call(updateEventData, function (value) {
|
17698 | return value.oldData;
|
17699 | }),
|
17700 | data: map$2$1(updateEventData).call(updateEventData, function (value) {
|
17701 | return value.updatedData;
|
17702 | })
|
17703 | };
|
17704 |
|
17705 |
|
17706 |
|
17707 |
|
17708 |
|
17709 |
|
17710 |
|
17711 | this._trigger("update", props, senderId);
|
17712 |
|
17713 | return props.items;
|
17714 | } else {
|
17715 | return [];
|
17716 | }
|
17717 | }
|
17718 |
|
17719 |
|
17720 | }, {
|
17721 | key: "get",
|
17722 | value: function get(first, second) {
|
17723 |
|
17724 |
|
17725 | var id = undefined;
|
17726 | var ids = undefined;
|
17727 | var options = undefined;
|
17728 |
|
17729 | if (isId(first)) {
|
17730 |
|
17731 | id = first;
|
17732 | options = second;
|
17733 | } else if (isArray$5$1(first)) {
|
17734 |
|
17735 | ids = first;
|
17736 | options = second;
|
17737 | } else {
|
17738 |
|
17739 | options = first;
|
17740 | }
|
17741 |
|
17742 |
|
17743 | var returnType = options && options.returnType === "Object" ? "Object" : "Array";
|
17744 |
|
17745 |
|
17746 |
|
17747 |
|
17748 |
|
17749 |
|
17750 |
|
17751 |
|
17752 |
|
17753 |
|
17754 |
|
17755 |
|
17756 | var type = options && options.type || this._options.type;
|
17757 | var filter = options && filter$2$1(options);
|
17758 | var items = [];
|
17759 | var item = null;
|
17760 | var itemIds = null;
|
17761 | var itemId = null;
|
17762 |
|
17763 | if (id != null) {
|
17764 |
|
17765 | item = this._getItem(id, type);
|
17766 |
|
17767 | if (item && filter && !filter(item)) {
|
17768 | item = null;
|
17769 | }
|
17770 | } else if (ids != null) {
|
17771 |
|
17772 | for (var i = 0, len = ids.length; i < len; i++) {
|
17773 | item = this._getItem(ids[i], type);
|
17774 |
|
17775 | if (item != null && (!filter || filter(item))) {
|
17776 | items.push(item);
|
17777 | }
|
17778 | }
|
17779 | } else {
|
17780 | var _context2;
|
17781 |
|
17782 |
|
17783 | itemIds = toConsumableArray$1(keys$3$1(_context2 = this._data).call(_context2));
|
17784 |
|
17785 | for (var _i = 0, _len = itemIds.length; _i < _len; _i++) {
|
17786 | itemId = itemIds[_i];
|
17787 | item = this._getItem(itemId, type);
|
17788 |
|
17789 | if (item != null && (!filter || filter(item))) {
|
17790 | items.push(item);
|
17791 | }
|
17792 | }
|
17793 | }
|
17794 |
|
17795 |
|
17796 | if (options && options.order && id == undefined) {
|
17797 | this._sort(items, options.order);
|
17798 | }
|
17799 |
|
17800 |
|
17801 | if (options && options.fields) {
|
17802 | var fields = options.fields;
|
17803 |
|
17804 | if (id != undefined && item != null) {
|
17805 | item = this._filterFields(item, fields);
|
17806 | } else {
|
17807 | for (var _i2 = 0, _len2 = items.length; _i2 < _len2; _i2++) {
|
17808 | items[_i2] = this._filterFields(items[_i2], fields);
|
17809 | }
|
17810 | }
|
17811 | }
|
17812 |
|
17813 |
|
17814 | if (returnType == "Object") {
|
17815 | var result = {};
|
17816 |
|
17817 | for (var _i3 = 0, _len3 = items.length; _i3 < _len3; _i3++) {
|
17818 | var resultant = items[_i3];
|
17819 |
|
17820 |
|
17821 | var _id2 = resultant[this._idProp];
|
17822 | result[_id2] = resultant;
|
17823 | }
|
17824 |
|
17825 | return result;
|
17826 | } else {
|
17827 | if (id != null) {
|
17828 |
|
17829 | return item;
|
17830 | } else {
|
17831 |
|
17832 | return items;
|
17833 | }
|
17834 | }
|
17835 | }
|
17836 |
|
17837 |
|
17838 | }, {
|
17839 | key: "getIds",
|
17840 | value: function getIds(options) {
|
17841 | var data = this._data;
|
17842 | var filter = options && filter$2$1(options);
|
17843 | var order = options && options.order;
|
17844 | var type = options && options.type || this._options.type;
|
17845 | var itemIds = toConsumableArray$1(keys$3$1(data).call(data));
|
17846 | var ids = [];
|
17847 | var item;
|
17848 | var items;
|
17849 |
|
17850 | if (filter) {
|
17851 |
|
17852 | if (order) {
|
17853 |
|
17854 | items = [];
|
17855 |
|
17856 | for (var i = 0, len = itemIds.length; i < len; i++) {
|
17857 | var id = itemIds[i];
|
17858 | item = this._getItem(id, type);
|
17859 |
|
17860 | if (filter(item)) {
|
17861 | items.push(item);
|
17862 | }
|
17863 | }
|
17864 |
|
17865 | this._sort(items, order);
|
17866 |
|
17867 | for (var _i4 = 0, _len4 = items.length; _i4 < _len4; _i4++) {
|
17868 | ids.push(items[_i4][this._idProp]);
|
17869 | }
|
17870 | } else {
|
17871 |
|
17872 | for (var _i5 = 0, _len5 = itemIds.length; _i5 < _len5; _i5++) {
|
17873 | var _id3 = itemIds[_i5];
|
17874 | item = this._getItem(_id3, type);
|
17875 |
|
17876 | if (filter(item)) {
|
17877 | ids.push(item[this._idProp]);
|
17878 | }
|
17879 | }
|
17880 | }
|
17881 | } else {
|
17882 |
|
17883 | if (order) {
|
17884 |
|
17885 | items = [];
|
17886 |
|
17887 | for (var _i6 = 0, _len6 = itemIds.length; _i6 < _len6; _i6++) {
|
17888 | var _id4 = itemIds[_i6];
|
17889 | items.push(data.get(_id4));
|
17890 | }
|
17891 |
|
17892 | this._sort(items, order);
|
17893 |
|
17894 | for (var _i7 = 0, _len7 = items.length; _i7 < _len7; _i7++) {
|
17895 | ids.push(items[_i7][this._idProp]);
|
17896 | }
|
17897 | } else {
|
17898 |
|
17899 | for (var _i8 = 0, _len8 = itemIds.length; _i8 < _len8; _i8++) {
|
17900 | var _id5 = itemIds[_i8];
|
17901 | item = data.get(_id5);
|
17902 | ids.push(item[this._idProp]);
|
17903 | }
|
17904 | }
|
17905 | }
|
17906 |
|
17907 | return ids;
|
17908 | }
|
17909 |
|
17910 |
|
17911 | }, {
|
17912 | key: "getDataSet",
|
17913 | value: function getDataSet() {
|
17914 | return this;
|
17915 | }
|
17916 |
|
17917 |
|
17918 | }, {
|
17919 | key: "forEach",
|
17920 | value: function forEach(callback, options) {
|
17921 | var filter = options && filter$2$1(options);
|
17922 | var type = options && options.type || this._options.type;
|
17923 | var data = this._data;
|
17924 | var itemIds = toConsumableArray$1(keys$3$1(data).call(data));
|
17925 |
|
17926 | if (options && options.order) {
|
17927 |
|
17928 | var items = this.get(options);
|
17929 |
|
17930 | for (var i = 0, len = items.length; i < len; i++) {
|
17931 | var item = items[i];
|
17932 | var id = item[this._idProp];
|
17933 | callback(item, id);
|
17934 | }
|
17935 | } else {
|
17936 |
|
17937 | for (var _i9 = 0, _len9 = itemIds.length; _i9 < _len9; _i9++) {
|
17938 | var _id6 = itemIds[_i9];
|
17939 |
|
17940 | var _item = this._getItem(_id6, type);
|
17941 |
|
17942 | if (!filter || filter(_item)) {
|
17943 | callback(_item, _id6);
|
17944 | }
|
17945 | }
|
17946 | }
|
17947 | }
|
17948 |
|
17949 |
|
17950 | }, {
|
17951 | key: "map",
|
17952 | value: function map(callback, options) {
|
17953 | var filter = options && filter$2$1(options);
|
17954 | var type = options && options.type || this._options.type;
|
17955 | var mappedItems = [];
|
17956 | var data = this._data;
|
17957 | var itemIds = toConsumableArray$1(keys$3$1(data).call(data));
|
17958 |
|
17959 | for (var i = 0, len = itemIds.length; i < len; i++) {
|
17960 | var id = itemIds[i];
|
17961 |
|
17962 | var item = this._getItem(id, type);
|
17963 |
|
17964 | if (!filter || filter(item)) {
|
17965 | mappedItems.push(callback(item, id));
|
17966 | }
|
17967 | }
|
17968 |
|
17969 |
|
17970 | if (options && options.order) {
|
17971 | this._sort(mappedItems, options.order);
|
17972 | }
|
17973 |
|
17974 | return mappedItems;
|
17975 | }
|
17976 | |
17977 |
|
17978 |
|
17979 |
|
17980 |
|
17981 |
|
17982 |
|
17983 |
|
17984 |
|
17985 |
|
17986 |
|
17987 | }, {
|
17988 | key: "_filterFields",
|
17989 | value: function _filterFields(item, fields) {
|
17990 | var _context3;
|
17991 |
|
17992 | if (!item) {
|
17993 |
|
17994 | return item;
|
17995 | }
|
17996 |
|
17997 | return reduce$2(_context3 = isArray$5$1(fields) ?
|
17998 | fields :
|
17999 | keys$6(fields)).call(_context3, function (filteredItem, field) {
|
18000 | filteredItem[field] = item[field];
|
18001 | return filteredItem;
|
18002 | }, {});
|
18003 | }
|
18004 | |
18005 |
|
18006 |
|
18007 |
|
18008 |
|
18009 |
|
18010 |
|
18011 |
|
18012 |
|
18013 | }, {
|
18014 | key: "_sort",
|
18015 | value: function _sort(items, order) {
|
18016 | if (typeof order === "string") {
|
18017 |
|
18018 | var name = order;
|
18019 |
|
18020 | sort$2(items).call(items, function (a, b) {
|
18021 |
|
18022 | var av = a[name];
|
18023 | var bv = b[name];
|
18024 | return av > bv ? 1 : av < bv ? -1 : 0;
|
18025 | });
|
18026 | } else if (typeof order === "function") {
|
18027 |
|
18028 | sort$2(items).call(items, order);
|
18029 | } else {
|
18030 |
|
18031 |
|
18032 | throw new TypeError("Order must be a function or a string");
|
18033 | }
|
18034 | }
|
18035 | |
18036 |
|
18037 |
|
18038 |
|
18039 |
|
18040 |
|
18041 |
|
18042 |
|
18043 |
|
18044 |
|
18045 |
|
18046 |
|
18047 |
|
18048 |
|
18049 |
|
18050 |
|
18051 |
|
18052 |
|
18053 |
|
18054 |
|
18055 |
|
18056 |
|
18057 |
|
18058 |
|
18059 |
|
18060 |
|
18061 |
|
18062 |
|
18063 | }, {
|
18064 | key: "remove",
|
18065 | value: function remove(id, senderId) {
|
18066 | var removedIds = [];
|
18067 | var removedItems = [];
|
18068 |
|
18069 | var ids = isArray$5$1(id) ? id : [id];
|
18070 |
|
18071 | for (var i = 0, len = ids.length; i < len; i++) {
|
18072 | var item = this._remove(ids[i]);
|
18073 |
|
18074 | if (item) {
|
18075 | var itemId = item[this._idProp];
|
18076 |
|
18077 | if (itemId != null) {
|
18078 | removedIds.push(itemId);
|
18079 | removedItems.push(item);
|
18080 | }
|
18081 | }
|
18082 | }
|
18083 |
|
18084 | if (removedIds.length) {
|
18085 | this._trigger("remove", {
|
18086 | items: removedIds,
|
18087 | oldData: removedItems
|
18088 | }, senderId);
|
18089 | }
|
18090 |
|
18091 | return removedIds;
|
18092 | }
|
18093 | |
18094 |
|
18095 |
|
18096 |
|
18097 |
|
18098 |
|
18099 |
|
18100 |
|
18101 | }, {
|
18102 | key: "_remove",
|
18103 | value: function _remove(id) {
|
18104 |
|
18105 |
|
18106 | var ident;
|
18107 |
|
18108 | if (isId(id)) {
|
18109 | ident = id;
|
18110 | } else if (id && _typeof_1$1(id) === "object") {
|
18111 | ident = id[this._idProp];
|
18112 | }
|
18113 |
|
18114 |
|
18115 | if (ident != null && this._data.has(ident)) {
|
18116 | var item = this._data.get(ident) || null;
|
18117 |
|
18118 | this._data.delete(ident);
|
18119 |
|
18120 | --this.length;
|
18121 | return item;
|
18122 | }
|
18123 |
|
18124 | return null;
|
18125 | }
|
18126 | |
18127 |
|
18128 |
|
18129 |
|
18130 |
|
18131 |
|
18132 |
|
18133 |
|
18134 |
|
18135 |
|
18136 | }, {
|
18137 | key: "clear",
|
18138 | value: function clear(senderId) {
|
18139 | var _context4;
|
18140 |
|
18141 | var ids = toConsumableArray$1(keys$3$1(_context4 = this._data).call(_context4));
|
18142 | var items = [];
|
18143 |
|
18144 | for (var i = 0, len = ids.length; i < len; i++) {
|
18145 | items.push(this._data.get(ids[i]));
|
18146 | }
|
18147 |
|
18148 | this._data.clear();
|
18149 |
|
18150 | this.length = 0;
|
18151 |
|
18152 | this._trigger("remove", {
|
18153 | items: ids,
|
18154 | oldData: items
|
18155 | }, senderId);
|
18156 |
|
18157 | return ids;
|
18158 | }
|
18159 | |
18160 |
|
18161 |
|
18162 |
|
18163 |
|
18164 |
|
18165 |
|
18166 |
|
18167 | }, {
|
18168 | key: "max",
|
18169 | value: function max(field) {
|
18170 | var max = null;
|
18171 | var maxField = null;
|
18172 | var _iteratorNormalCompletion = true;
|
18173 | var _didIteratorError = false;
|
18174 | var _iteratorError = undefined;
|
18175 |
|
18176 | try {
|
18177 | for (var _iterator = getIterator$2$1(values$2$1(_context5 = this._data).call(_context5)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
18178 | var _context5;
|
18179 |
|
18180 | var item = _step.value;
|
18181 | var itemField = item[field];
|
18182 |
|
18183 | if (typeof itemField === "number" && (maxField == null || itemField > maxField)) {
|
18184 | max = item;
|
18185 | maxField = itemField;
|
18186 | }
|
18187 | }
|
18188 | } catch (err) {
|
18189 | _didIteratorError = true;
|
18190 | _iteratorError = err;
|
18191 | } finally {
|
18192 | try {
|
18193 | if (!_iteratorNormalCompletion && _iterator.return != null) {
|
18194 | _iterator.return();
|
18195 | }
|
18196 | } finally {
|
18197 | if (_didIteratorError) {
|
18198 | throw _iteratorError;
|
18199 | }
|
18200 | }
|
18201 | }
|
18202 |
|
18203 | return max || null;
|
18204 | }
|
18205 | |
18206 |
|
18207 |
|
18208 |
|
18209 |
|
18210 |
|
18211 |
|
18212 |
|
18213 | }, {
|
18214 | key: "min",
|
18215 | value: function min(field) {
|
18216 | var min = null;
|
18217 | var minField = null;
|
18218 | var _iteratorNormalCompletion2 = true;
|
18219 | var _didIteratorError2 = false;
|
18220 | var _iteratorError2 = undefined;
|
18221 |
|
18222 | try {
|
18223 | for (var _iterator2 = getIterator$2$1(values$2$1(_context6 = this._data).call(_context6)), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
18224 | var _context6;
|
18225 |
|
18226 | var item = _step2.value;
|
18227 | var itemField = item[field];
|
18228 |
|
18229 | if (typeof itemField === "number" && (minField == null || itemField < minField)) {
|
18230 | min = item;
|
18231 | minField = itemField;
|
18232 | }
|
18233 | }
|
18234 | } catch (err) {
|
18235 | _didIteratorError2 = true;
|
18236 | _iteratorError2 = err;
|
18237 | } finally {
|
18238 | try {
|
18239 | if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
18240 | _iterator2.return();
|
18241 | }
|
18242 | } finally {
|
18243 | if (_didIteratorError2) {
|
18244 | throw _iteratorError2;
|
18245 | }
|
18246 | }
|
18247 | }
|
18248 |
|
18249 | return min || null;
|
18250 | }
|
18251 | |
18252 |
|
18253 |
|
18254 |
|
18255 |
|
18256 |
|
18257 |
|
18258 |
|
18259 | }, {
|
18260 | key: "distinct",
|
18261 | value: function distinct(prop) {
|
18262 | var data = this._data;
|
18263 | var itemIds = toConsumableArray$1(keys$3$1(data).call(data));
|
18264 | var values = [];
|
18265 | var fieldType = this._options.type && this._options.type[prop] || null;
|
18266 | var count = 0;
|
18267 |
|
18268 | for (var i = 0, len = itemIds.length; i < len; i++) {
|
18269 | var id = itemIds[i];
|
18270 | var item = data.get(id);
|
18271 | var value = item[prop];
|
18272 | var exists = false;
|
18273 |
|
18274 | for (var j = 0; j < count; j++) {
|
18275 | if (values[j] == value) {
|
18276 | exists = true;
|
18277 | break;
|
18278 | }
|
18279 | }
|
18280 |
|
18281 | if (!exists && value !== undefined) {
|
18282 | values[count] = value;
|
18283 | count++;
|
18284 | }
|
18285 | }
|
18286 |
|
18287 | if (fieldType) {
|
18288 | for (var _i10 = 0, _len10 = values.length; _i10 < _len10; _i10++) {
|
18289 | values[_i10] = convert(values[_i10], fieldType);
|
18290 | }
|
18291 | }
|
18292 |
|
18293 | return values;
|
18294 | }
|
18295 | |
18296 |
|
18297 |
|
18298 |
|
18299 |
|
18300 |
|
18301 |
|
18302 |
|
18303 | }, {
|
18304 | key: "_addItem",
|
18305 | value: function _addItem(item) {
|
18306 | var id = item[this._idProp];
|
18307 |
|
18308 | if (id != null) {
|
18309 |
|
18310 | if (this._data.has(id)) {
|
18311 |
|
18312 | throw new Error("Cannot add item: item with id " + id + " already exists");
|
18313 | }
|
18314 | } else {
|
18315 |
|
18316 | id = uuid4$1();
|
18317 | item[this._idProp] = id;
|
18318 | }
|
18319 |
|
18320 | var d = {};
|
18321 | var fields = keys$6(item);
|
18322 |
|
18323 | for (var i = 0, len = fields.length; i < len; i++) {
|
18324 | var field = fields[i];
|
18325 | var fieldType = this._type[field];
|
18326 |
|
18327 | d[field] = convert(item[field], fieldType);
|
18328 | }
|
18329 |
|
18330 | this._data.set(id, d);
|
18331 |
|
18332 | ++this.length;
|
18333 | return id;
|
18334 | }
|
18335 | |
18336 |
|
18337 |
|
18338 |
|
18339 |
|
18340 |
|
18341 |
|
18342 |
|
18343 |
|
18344 | }, {
|
18345 | key: "_getItem",
|
18346 | value: function _getItem(id, types) {
|
18347 |
|
18348 |
|
18349 | var raw = this._data.get(id);
|
18350 |
|
18351 | if (!raw) {
|
18352 | return null;
|
18353 | }
|
18354 |
|
18355 |
|
18356 | var converted;
|
18357 | var fields = keys$6(raw);
|
18358 |
|
18359 | if (types) {
|
18360 | converted = {};
|
18361 |
|
18362 | for (var i = 0, len = fields.length; i < len; i++) {
|
18363 | var field = fields[i];
|
18364 | var value = raw[field];
|
18365 | converted[field] = convert(value, types[field]);
|
18366 | }
|
18367 | } else {
|
18368 |
|
18369 | converted = _objectSpread$1({}, raw);
|
18370 | }
|
18371 |
|
18372 | if (converted[this._idProp] == null) {
|
18373 | converted[this._idProp] = raw.id;
|
18374 | }
|
18375 |
|
18376 | return converted;
|
18377 | }
|
18378 | |
18379 |
|
18380 |
|
18381 |
|
18382 |
|
18383 |
|
18384 |
|
18385 |
|
18386 |
|
18387 | }, {
|
18388 | key: "_updateItem",
|
18389 | value: function _updateItem(item) {
|
18390 | var id = item[this._idProp];
|
18391 |
|
18392 | if (id == null) {
|
18393 | throw new Error("Cannot update item: item has no id (item: " + stringify$2(item) + ")");
|
18394 | }
|
18395 |
|
18396 | var d = this._data.get(id);
|
18397 |
|
18398 | if (!d) {
|
18399 |
|
18400 | throw new Error("Cannot update item: no item with id " + id + " found");
|
18401 | }
|
18402 |
|
18403 |
|
18404 | var fields = keys$6(item);
|
18405 |
|
18406 | for (var i = 0, len = fields.length; i < len; i++) {
|
18407 | var field = fields[i];
|
18408 | var fieldType = this._type[field];
|
18409 |
|
18410 | d[field] = convert(item[field], fieldType);
|
18411 | }
|
18412 |
|
18413 | return id;
|
18414 | }
|
18415 |
|
18416 |
|
18417 | }, {
|
18418 | key: "stream",
|
18419 | value: function stream(ids) {
|
18420 | if (ids) {
|
18421 | var data = this._data;
|
18422 | return new DataStream(defineProperty$6$1({}, iterator$2$1,
|
18423 |
|
18424 | regenerator.mark(function _callee() {
|
18425 | var _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, id, item;
|
18426 |
|
18427 | return regenerator.wrap(function _callee$(_context7) {
|
18428 | while (1) {
|
18429 | switch (_context7.prev = _context7.next) {
|
18430 | case 0:
|
18431 | _iteratorNormalCompletion3 = true;
|
18432 | _didIteratorError3 = false;
|
18433 | _iteratorError3 = undefined;
|
18434 | _context7.prev = 3;
|
18435 | _iterator3 = getIterator$2$1(ids);
|
18436 |
|
18437 | case 5:
|
18438 | if (_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done) {
|
18439 | _context7.next = 14;
|
18440 | break;
|
18441 | }
|
18442 |
|
18443 | id = _step3.value;
|
18444 | item = data.get(id);
|
18445 |
|
18446 | if (!(item != null)) {
|
18447 | _context7.next = 11;
|
18448 | break;
|
18449 | }
|
18450 |
|
18451 | _context7.next = 11;
|
18452 | return [id, item];
|
18453 |
|
18454 | case 11:
|
18455 | _iteratorNormalCompletion3 = true;
|
18456 | _context7.next = 5;
|
18457 | break;
|
18458 |
|
18459 | case 14:
|
18460 | _context7.next = 20;
|
18461 | break;
|
18462 |
|
18463 | case 16:
|
18464 | _context7.prev = 16;
|
18465 | _context7.t0 = _context7["catch"](3);
|
18466 | _didIteratorError3 = true;
|
18467 | _iteratorError3 = _context7.t0;
|
18468 |
|
18469 | case 20:
|
18470 | _context7.prev = 20;
|
18471 | _context7.prev = 21;
|
18472 |
|
18473 | if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
18474 | _iterator3.return();
|
18475 | }
|
18476 |
|
18477 | case 23:
|
18478 | _context7.prev = 23;
|
18479 |
|
18480 | if (!_didIteratorError3) {
|
18481 | _context7.next = 26;
|
18482 | break;
|
18483 | }
|
18484 |
|
18485 | throw _iteratorError3;
|
18486 |
|
18487 | case 26:
|
18488 | return _context7.finish(23);
|
18489 |
|
18490 | case 27:
|
18491 | return _context7.finish(20);
|
18492 |
|
18493 | case 28:
|
18494 | case "end":
|
18495 | return _context7.stop();
|
18496 | }
|
18497 | }
|
18498 | }, _callee, null, [[3, 16, 20, 28], [21,, 23, 27]]);
|
18499 | })));
|
18500 | } else {
|
18501 | var _context8;
|
18502 |
|
18503 | return new DataStream(defineProperty$6$1({}, iterator$2$1, bind$2(_context8 = entries$2(this._data)).call(_context8, this._data)));
|
18504 | }
|
18505 | }
|
18506 | }]);
|
18507 | return DataSet;
|
18508 | }(DataSetPart);
|
18509 |
|
18510 |
|
18511 |
|
18512 |
|
18513 |
|
18514 |
|
18515 |
|
18516 |
|
18517 |
|
18518 |
|
18519 |
|
18520 |
|
18521 |
|
18522 |
|
18523 |
|
18524 |
|
18525 |
|
18526 |
|
18527 |
|
18528 |
|
18529 |
|
18530 |
|
18531 |
|
18532 |
|
18533 |
|
18534 |
|
18535 |
|
18536 |
|
18537 |
|
18538 |
|
18539 |
|
18540 |
|
18541 |
|
18542 |
|
18543 |
|
18544 |
|
18545 |
|
18546 |
|
18547 |
|
18548 |
|
18549 |
|
18550 |
|
18551 |
|
18552 |
|
18553 |
|
18554 |
|
18555 |
|
18556 | var DataView =
|
18557 |
|
18558 | function (_DataSetPart) {
|
18559 | inherits(DataView, _DataSetPart);
|
18560 | |
18561 |
|
18562 |
|
18563 |
|
18564 |
|
18565 |
|
18566 |
|
18567 | function DataView(data, options) {
|
18568 | var _context;
|
18569 |
|
18570 | var _this;
|
18571 |
|
18572 | classCallCheck(this, DataView);
|
18573 | _this = possibleConstructorReturn(this, getPrototypeOf$3$1(DataView).call(this));
|
18574 |
|
18575 |
|
18576 | _this.length = 0;
|
18577 | _this._ids = new set$4(); // ids of the items currently in memory (just contains a boolean true)
|
18578 |
|
18579 | _this._options = options || {};
|
18580 | _this._listener = bind$2(_context = _this._onEvent).call(_context, assertThisInitialized(_this));
|
18581 |
|
18582 | _this.setData(data);
|
18583 |
|
18584 | return _this;
|
18585 | }
|
18586 |
|
18587 |
|
18588 | |
18589 |
|
18590 |
|
18591 |
|
18592 |
|
18593 |
|
18594 |
|
18595 | createClass(DataView, [{
|
18596 | key: "setData",
|
18597 | value: function setData(data) {
|
18598 | if (this._data) {
|
18599 |
|
18600 | if (this._data.off) {
|
18601 | this._data.off("*", this._listener);
|
18602 | }
|
18603 |
|
18604 |
|
18605 | var ids = this._data.getIds({
|
18606 | filter: filter$2$1(this._options)
|
18607 | });
|
18608 |
|
18609 | var items = this._data.get(ids);
|
18610 |
|
18611 | this._ids.clear();
|
18612 |
|
18613 | this.length = 0;
|
18614 |
|
18615 | this._trigger("remove", {
|
18616 | items: ids,
|
18617 | oldData: items
|
18618 | });
|
18619 | }
|
18620 |
|
18621 | if (data != null) {
|
18622 | this._data = data;
|
18623 |
|
18624 | var _ids = this._data.getIds({
|
18625 | filter: filter$2$1(this._options)
|
18626 | });
|
18627 |
|
18628 | for (var i = 0, len = _ids.length; i < len; i++) {
|
18629 | var id = _ids[i];
|
18630 |
|
18631 | this._ids.add(id);
|
18632 | }
|
18633 |
|
18634 | this.length = _ids.length;
|
18635 |
|
18636 | this._trigger("add", {
|
18637 | items: _ids
|
18638 | });
|
18639 | } else {
|
18640 | this._data = new DataSet();
|
18641 | }
|
18642 |
|
18643 |
|
18644 | if (this._data.on) {
|
18645 | this._data.on("*", this._listener);
|
18646 | }
|
18647 | }
|
18648 | |
18649 |
|
18650 |
|
18651 |
|
18652 |
|
18653 | }, {
|
18654 | key: "refresh",
|
18655 | value: function refresh() {
|
18656 | var ids = this._data.getIds({
|
18657 | filter: filter$2$1(this._options)
|
18658 | });
|
18659 |
|
18660 | var oldIds = toConsumableArray$1(this._ids);
|
18661 | var newIds = {};
|
18662 | var addedIds = [];
|
18663 | var removedIds = [];
|
18664 | var removedItems = [];
|
18665 |
|
18666 | for (var i = 0, len = ids.length; i < len; i++) {
|
18667 | var id = ids[i];
|
18668 | newIds[id] = true;
|
18669 |
|
18670 | if (!this._ids.has(id)) {
|
18671 | addedIds.push(id);
|
18672 |
|
18673 | this._ids.add(id);
|
18674 | }
|
18675 | }
|
18676 |
|
18677 |
|
18678 | for (var _i = 0, _len = oldIds.length; _i < _len; _i++) {
|
18679 | var _id = oldIds[_i];
|
18680 |
|
18681 | var item = this._data.get(_id);
|
18682 |
|
18683 | if (item == null) {
|
18684 |
|
18685 |
|
18686 |
|
18687 |
|
18688 | console.error("If you see this, report it please.");
|
18689 | } else if (!newIds[_id]) {
|
18690 | removedIds.push(_id);
|
18691 | removedItems.push(item);
|
18692 |
|
18693 | this._ids.delete(_id);
|
18694 | }
|
18695 | }
|
18696 |
|
18697 | this.length += addedIds.length - removedIds.length;
|
18698 |
|
18699 | if (addedIds.length) {
|
18700 | this._trigger("add", {
|
18701 | items: addedIds
|
18702 | });
|
18703 | }
|
18704 |
|
18705 | if (removedIds.length) {
|
18706 | this._trigger("remove", {
|
18707 | items: removedIds,
|
18708 | oldData: removedItems
|
18709 | });
|
18710 | }
|
18711 | }
|
18712 |
|
18713 |
|
18714 | }, {
|
18715 | key: "get",
|
18716 | value: function get(first, second) {
|
18717 | if (this._data == null) {
|
18718 | return null;
|
18719 | }
|
18720 |
|
18721 |
|
18722 | var ids = null;
|
18723 | var options;
|
18724 |
|
18725 | if (isId(first) || isArray$5$1(first)) {
|
18726 | ids = first;
|
18727 | options = second;
|
18728 | } else {
|
18729 | options = first;
|
18730 | }
|
18731 |
|
18732 |
|
18733 | var viewOptions = assign$2$1({}, this._options, options);
|
18734 |
|
18735 | var thisFilter = filter$2$1(this._options);
|
18736 | var optionsFilter = options && filter$2$1(options);
|
18737 |
|
18738 | if (thisFilter && optionsFilter) {
|
18739 | viewOptions.filter = function (item) {
|
18740 | return thisFilter(item) && optionsFilter(item);
|
18741 | };
|
18742 | }
|
18743 |
|
18744 | if (ids == null) {
|
18745 | return this._data.get(viewOptions);
|
18746 | } else {
|
18747 | return this._data.get(ids, viewOptions);
|
18748 | }
|
18749 | }
|
18750 |
|
18751 |
|
18752 | }, {
|
18753 | key: "getIds",
|
18754 | value: function getIds(options) {
|
18755 | if (this._data.length) {
|
18756 | var defaultFilter = filter$2$1(this._options);
|
18757 | var optionsFilter = options != null ? filter$2$1(options) : null;
|
18758 | var filter;
|
18759 |
|
18760 | if (optionsFilter) {
|
18761 | if (defaultFilter) {
|
18762 | filter = function filter(item) {
|
18763 | return defaultFilter(item) && optionsFilter(item);
|
18764 | };
|
18765 | } else {
|
18766 | filter = optionsFilter;
|
18767 | }
|
18768 | } else {
|
18769 | filter = defaultFilter;
|
18770 | }
|
18771 |
|
18772 | return this._data.getIds({
|
18773 | filter: filter,
|
18774 | order: options && options.order
|
18775 | });
|
18776 | } else {
|
18777 | return [];
|
18778 | }
|
18779 | }
|
18780 |
|
18781 |
|
18782 | }, {
|
18783 | key: "forEach",
|
18784 | value: function forEach(callback, options) {
|
18785 | if (this._data) {
|
18786 | var _context2;
|
18787 |
|
18788 | var defaultFilter = filter$2$1(this._options);
|
18789 | var optionsFilter = options && filter$2$1(options);
|
18790 | var filter;
|
18791 |
|
18792 | if (optionsFilter) {
|
18793 | if (defaultFilter) {
|
18794 | filter = function filter(item) {
|
18795 | return defaultFilter(item) && optionsFilter(item);
|
18796 | };
|
18797 | } else {
|
18798 | filter = optionsFilter;
|
18799 | }
|
18800 | } else {
|
18801 | filter = defaultFilter;
|
18802 | }
|
18803 |
|
18804 | forEach$2$1(_context2 = this._data).call(_context2, callback, {
|
18805 | filter: filter,
|
18806 | order: options && options.order
|
18807 | });
|
18808 | }
|
18809 | }
|
18810 |
|
18811 |
|
18812 | }, {
|
18813 | key: "map",
|
18814 | value: function map(callback, options) {
|
18815 | if (this._data) {
|
18816 | var _context3;
|
18817 |
|
18818 | var defaultFilter = filter$2$1(this._options);
|
18819 | var optionsFilter = options && filter$2$1(options);
|
18820 | var filter;
|
18821 |
|
18822 | if (optionsFilter) {
|
18823 | if (defaultFilter) {
|
18824 | filter = function filter(item) {
|
18825 | return defaultFilter(item) && optionsFilter(item);
|
18826 | };
|
18827 | } else {
|
18828 | filter = optionsFilter;
|
18829 | }
|
18830 | } else {
|
18831 | filter = defaultFilter;
|
18832 | }
|
18833 |
|
18834 | return map$2$1(_context3 = this._data).call(_context3, callback, {
|
18835 | filter: filter,
|
18836 | order: options && options.order
|
18837 | });
|
18838 | } else {
|
18839 | return [];
|
18840 | }
|
18841 | }
|
18842 |
|
18843 |
|
18844 | }, {
|
18845 | key: "getDataSet",
|
18846 | value: function getDataSet() {
|
18847 | return this._data.getDataSet();
|
18848 | }
|
18849 |
|
18850 |
|
18851 | }, {
|
18852 | key: "stream",
|
18853 | value: function stream(ids) {
|
18854 | var _context4;
|
18855 |
|
18856 | return this._data.stream(ids || defineProperty$6$1({}, iterator$2$1, bind$2(_context4 = keys$3$1(this._ids)).call(_context4, this._ids)));
|
18857 | }
|
18858 | |
18859 |
|
18860 |
|
18861 |
|
18862 |
|
18863 |
|
18864 |
|
18865 |
|
18866 | }, {
|
18867 | key: "_onEvent",
|
18868 | value: function _onEvent(event, params, senderId) {
|
18869 | if (!params || !params.items || !this._data) {
|
18870 | return;
|
18871 | }
|
18872 |
|
18873 | var ids = params.items;
|
18874 | var addedIds = [];
|
18875 | var updatedIds = [];
|
18876 | var removedIds = [];
|
18877 | var oldItems = [];
|
18878 | var updatedItems = [];
|
18879 | var removedItems = [];
|
18880 |
|
18881 | switch (event) {
|
18882 | case "add":
|
18883 |
|
18884 | for (var i = 0, len = ids.length; i < len; i++) {
|
18885 | var id = ids[i];
|
18886 | var item = this.get(id);
|
18887 |
|
18888 | if (item) {
|
18889 | this._ids.add(id);
|
18890 |
|
18891 | addedIds.push(id);
|
18892 | }
|
18893 | }
|
18894 |
|
18895 | break;
|
18896 |
|
18897 | case "update":
|
18898 |
|
18899 |
|
18900 | for (var _i2 = 0, _len2 = ids.length; _i2 < _len2; _i2++) {
|
18901 | var _id2 = ids[_i2];
|
18902 |
|
18903 | var _item = this.get(_id2);
|
18904 |
|
18905 | if (_item) {
|
18906 | if (this._ids.has(_id2)) {
|
18907 | updatedIds.push(_id2);
|
18908 | updatedItems.push(params.data[_i2]);
|
18909 | oldItems.push(params.oldData[_i2]);
|
18910 | } else {
|
18911 | this._ids.add(_id2);
|
18912 |
|
18913 | addedIds.push(_id2);
|
18914 | }
|
18915 | } else {
|
18916 | if (this._ids.has(_id2)) {
|
18917 | this._ids.delete(_id2);
|
18918 |
|
18919 | removedIds.push(_id2);
|
18920 | removedItems.push(params.oldData[_i2]);
|
18921 | }
|
18922 | }
|
18923 | }
|
18924 |
|
18925 | break;
|
18926 |
|
18927 | case "remove":
|
18928 |
|
18929 | for (var _i3 = 0, _len3 = ids.length; _i3 < _len3; _i3++) {
|
18930 | var _id3 = ids[_i3];
|
18931 |
|
18932 | if (this._ids.has(_id3)) {
|
18933 | this._ids.delete(_id3);
|
18934 |
|
18935 | removedIds.push(_id3);
|
18936 | removedItems.push(params.oldData[_i3]);
|
18937 | }
|
18938 | }
|
18939 |
|
18940 | break;
|
18941 | }
|
18942 |
|
18943 | this.length += addedIds.length - removedIds.length;
|
18944 |
|
18945 | if (addedIds.length) {
|
18946 | this._trigger("add", {
|
18947 | items: addedIds
|
18948 | }, senderId);
|
18949 | }
|
18950 |
|
18951 | if (updatedIds.length) {
|
18952 | this._trigger("update", {
|
18953 | items: updatedIds,
|
18954 | oldData: oldItems,
|
18955 | data: updatedItems
|
18956 | }, senderId);
|
18957 | }
|
18958 |
|
18959 | if (removedIds.length) {
|
18960 | this._trigger("remove", {
|
18961 | items: removedIds,
|
18962 | oldData: removedItems
|
18963 | }, senderId);
|
18964 | }
|
18965 | }
|
18966 | }]);
|
18967 | return DataView;
|
18968 | }(DataSetPart);
|
18969 |
|
18970 | var index = {
|
18971 | DataSet: DataSet,
|
18972 | DataView: DataView,
|
18973 | Queue: Queue
|
18974 | };
|
18975 |
|
18976 | function _typeof(obj) {
|
18977 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
18978 | _typeof = function (obj) {
|
18979 | return typeof obj;
|
18980 | };
|
18981 | } else {
|
18982 | _typeof = function (obj) {
|
18983 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
18984 | };
|
18985 | }
|
18986 |
|
18987 | return _typeof(obj);
|
18988 | }
|
18989 |
|
18990 | function _classCallCheck$1(instance, Constructor) {
|
18991 | if (!(instance instanceof Constructor)) {
|
18992 | throw new TypeError("Cannot call a class as a function");
|
18993 | }
|
18994 | }
|
18995 |
|
18996 | function _defineProperties$1(target, props) {
|
18997 | for (var i = 0; i < props.length; i++) {
|
18998 | var descriptor = props[i];
|
18999 | descriptor.enumerable = descriptor.enumerable || false;
|
19000 | descriptor.configurable = true;
|
19001 | if ("value" in descriptor) descriptor.writable = true;
|
19002 | Object.defineProperty(target, descriptor.key, descriptor);
|
19003 | }
|
19004 | }
|
19005 |
|
19006 | function _createClass$1(Constructor, protoProps, staticProps) {
|
19007 | if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
|
19008 | if (staticProps) _defineProperties$1(Constructor, staticProps);
|
19009 | return Constructor;
|
19010 | }
|
19011 |
|
19012 |
|
19013 |
|
19014 |
|
19015 | var emitterComponent = Emitter;
|
19016 |
|
19017 |
|
19018 |
|
19019 |
|
19020 |
|
19021 |
|
19022 | function Emitter(obj) {
|
19023 | if (obj) return mixin(obj);
|
19024 | }
|
19025 |
|
19026 |
|
19027 |
|
19028 |
|
19029 |
|
19030 |
|
19031 |
|
19032 |
|
19033 | function mixin(obj) {
|
19034 | for (var key in Emitter.prototype) {
|
19035 | obj[key] = Emitter.prototype[key];
|
19036 | }
|
19037 |
|
19038 | return obj;
|
19039 | }
|
19040 |
|
19041 |
|
19042 |
|
19043 |
|
19044 |
|
19045 |
|
19046 |
|
19047 |
|
19048 |
|
19049 |
|
19050 | Emitter.prototype.on = Emitter.prototype.addEventListener = function (event, fn) {
|
19051 | this._callbacks = this._callbacks || {};
|
19052 | (this._callbacks[event] = this._callbacks[event] || []).push(fn);
|
19053 | return this;
|
19054 | };
|
19055 |
|
19056 |
|
19057 |
|
19058 |
|
19059 |
|
19060 |
|
19061 |
|
19062 |
|
19063 |
|
19064 |
|
19065 |
|
19066 | Emitter.prototype.once = function (event, fn) {
|
19067 | var self = this;
|
19068 | this._callbacks = this._callbacks || {};
|
19069 |
|
19070 | function on() {
|
19071 | self.off(event, on);
|
19072 | fn.apply(this, arguments);
|
19073 | }
|
19074 |
|
19075 | on.fn = fn;
|
19076 | this.on(event, on);
|
19077 | return this;
|
19078 | };
|
19079 |
|
19080 |
|
19081 |
|
19082 |
|
19083 |
|
19084 |
|
19085 |
|
19086 |
|
19087 |
|
19088 |
|
19089 |
|
19090 | Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function (event, fn) {
|
19091 | this._callbacks = this._callbacks || {};
|
19092 |
|
19093 | if (0 == arguments.length) {
|
19094 | this._callbacks = {};
|
19095 | return this;
|
19096 | }
|
19097 |
|
19098 |
|
19099 | var callbacks = this._callbacks[event];
|
19100 | if (!callbacks) return this;
|
19101 |
|
19102 | if (1 == arguments.length) {
|
19103 | delete this._callbacks[event];
|
19104 | return this;
|
19105 | }
|
19106 |
|
19107 |
|
19108 | var cb;
|
19109 |
|
19110 | for (var i = 0; i < callbacks.length; i++) {
|
19111 | cb = callbacks[i];
|
19112 |
|
19113 | if (cb === fn || cb.fn === fn) {
|
19114 | callbacks.splice(i, 1);
|
19115 | break;
|
19116 | }
|
19117 | }
|
19118 |
|
19119 | return this;
|
19120 | };
|
19121 |
|
19122 |
|
19123 |
|
19124 |
|
19125 |
|
19126 |
|
19127 |
|
19128 |
|
19129 |
|
19130 | Emitter.prototype.emit = function (event) {
|
19131 | this._callbacks = this._callbacks || {};
|
19132 | var args = [].slice.call(arguments, 1),
|
19133 | callbacks = this._callbacks[event];
|
19134 |
|
19135 | if (callbacks) {
|
19136 | callbacks = callbacks.slice(0);
|
19137 |
|
19138 | for (var i = 0, len = callbacks.length; i < len; ++i) {
|
19139 | callbacks[i].apply(this, args);
|
19140 | }
|
19141 | }
|
19142 |
|
19143 | return this;
|
19144 | };
|
19145 |
|
19146 |
|
19147 |
|
19148 |
|
19149 |
|
19150 |
|
19151 |
|
19152 |
|
19153 |
|
19154 | Emitter.prototype.listeners = function (event) {
|
19155 | this._callbacks = this._callbacks || {};
|
19156 | return this._callbacks[event] || [];
|
19157 | };
|
19158 |
|
19159 |
|
19160 |
|
19161 |
|
19162 |
|
19163 |
|
19164 |
|
19165 |
|
19166 |
|
19167 | Emitter.prototype.hasListeners = function (event) {
|
19168 | return !!this.listeners(event).length;
|
19169 | };
|
19170 |
|
19171 |
|
19172 |
|
19173 |
|
19174 |
|
19175 |
|
19176 |
|
19177 | function Point3d(x, y, z) {
|
19178 | this.x = x !== undefined ? x : 0;
|
19179 | this.y = y !== undefined ? y : 0;
|
19180 | this.z = z !== undefined ? z : 0;
|
19181 | }
|
19182 |
|
19183 |
|
19184 |
|
19185 |
|
19186 |
|
19187 |
|
19188 |
|
19189 |
|
19190 | Point3d.subtract = function (a, b) {
|
19191 | var sub = new Point3d();
|
19192 | sub.x = a.x - b.x;
|
19193 | sub.y = a.y - b.y;
|
19194 | sub.z = a.z - b.z;
|
19195 | return sub;
|
19196 | };
|
19197 |
|
19198 |
|
19199 |
|
19200 |
|
19201 |
|
19202 |
|
19203 |
|
19204 |
|
19205 | Point3d.add = function (a, b) {
|
19206 | var sum = new Point3d();
|
19207 | sum.x = a.x + b.x;
|
19208 | sum.y = a.y + b.y;
|
19209 | sum.z = a.z + b.z;
|
19210 | return sum;
|
19211 | };
|
19212 |
|
19213 |
|
19214 |
|
19215 |
|
19216 |
|
19217 |
|
19218 |
|
19219 |
|
19220 | Point3d.avg = function (a, b) {
|
19221 | return new Point3d((a.x + b.x) / 2, (a.y + b.y) / 2, (a.z + b.z) / 2);
|
19222 | };
|
19223 |
|
19224 |
|
19225 |
|
19226 |
|
19227 |
|
19228 |
|
19229 |
|
19230 |
|
19231 |
|
19232 | Point3d.crossProduct = function (a, b) {
|
19233 | var crossproduct = new Point3d();
|
19234 | crossproduct.x = a.y * b.z - a.z * b.y;
|
19235 | crossproduct.y = a.z * b.x - a.x * b.z;
|
19236 | crossproduct.z = a.x * b.y - a.y * b.x;
|
19237 | return crossproduct;
|
19238 | };
|
19239 |
|
19240 |
|
19241 |
|
19242 |
|
19243 |
|
19244 |
|
19245 | Point3d.prototype.length = function () {
|
19246 | return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
|
19247 | };
|
19248 |
|
19249 | var Point3d_1 = Point3d;
|
19250 |
|
19251 |
|
19252 |
|
19253 |
|
19254 |
|
19255 |
|
19256 | function Point2d(x, y) {
|
19257 | this.x = x !== undefined ? x : 0;
|
19258 | this.y = y !== undefined ? y : 0;
|
19259 | }
|
19260 |
|
19261 | var Point2d_1 = Point2d;
|
19262 |
|
19263 |
|
19264 |
|
19265 |
|
19266 |
|
19267 |
|
19268 |
|
19269 |
|
19270 |
|
19271 |
|
19272 |
|
19273 | function Slider(container, options) {
|
19274 | if (container === undefined) {
|
19275 | throw new Error('No container element defined');
|
19276 | }
|
19277 |
|
19278 | this.container = container;
|
19279 | this.visible = options && options.visible != undefined ? options.visible : true;
|
19280 |
|
19281 | if (this.visible) {
|
19282 | this.frame = document.createElement('DIV');
|
19283 |
|
19284 | this.frame.style.width = '100%';
|
19285 | this.frame.style.position = 'relative';
|
19286 | this.container.appendChild(this.frame);
|
19287 | this.frame.prev = document.createElement('INPUT');
|
19288 | this.frame.prev.type = 'BUTTON';
|
19289 | this.frame.prev.value = 'Prev';
|
19290 | this.frame.appendChild(this.frame.prev);
|
19291 | this.frame.play = document.createElement('INPUT');
|
19292 | this.frame.play.type = 'BUTTON';
|
19293 | this.frame.play.value = 'Play';
|
19294 | this.frame.appendChild(this.frame.play);
|
19295 | this.frame.next = document.createElement('INPUT');
|
19296 | this.frame.next.type = 'BUTTON';
|
19297 | this.frame.next.value = 'Next';
|
19298 | this.frame.appendChild(this.frame.next);
|
19299 | this.frame.bar = document.createElement('INPUT');
|
19300 | this.frame.bar.type = 'BUTTON';
|
19301 | this.frame.bar.style.position = 'absolute';
|
19302 | this.frame.bar.style.border = '1px solid red';
|
19303 | this.frame.bar.style.width = '100px';
|
19304 | this.frame.bar.style.height = '6px';
|
19305 | this.frame.bar.style.borderRadius = '2px';
|
19306 | this.frame.bar.style.MozBorderRadius = '2px';
|
19307 | this.frame.bar.style.border = '1px solid #7F7F7F';
|
19308 | this.frame.bar.style.backgroundColor = '#E5E5E5';
|
19309 | this.frame.appendChild(this.frame.bar);
|
19310 | this.frame.slide = document.createElement('INPUT');
|
19311 | this.frame.slide.type = 'BUTTON';
|
19312 | this.frame.slide.style.margin = '0px';
|
19313 | this.frame.slide.value = ' ';
|
19314 | this.frame.slide.style.position = 'relative';
|
19315 | this.frame.slide.style.left = '-100px';
|
19316 | this.frame.appendChild(this.frame.slide);
|
19317 |
|
19318 | var me = this;
|
19319 |
|
19320 | this.frame.slide.onmousedown = function (event) {
|
19321 | me._onMouseDown(event);
|
19322 | };
|
19323 |
|
19324 | this.frame.prev.onclick = function (event) {
|
19325 | me.prev(event);
|
19326 | };
|
19327 |
|
19328 | this.frame.play.onclick = function (event) {
|
19329 | me.togglePlay(event);
|
19330 | };
|
19331 |
|
19332 | this.frame.next.onclick = function (event) {
|
19333 | me.next(event);
|
19334 | };
|
19335 | }
|
19336 |
|
19337 | this.onChangeCallback = undefined;
|
19338 | this.values = [];
|
19339 | this.index = undefined;
|
19340 | this.playTimeout = undefined;
|
19341 | this.playInterval = 1000;
|
19342 |
|
19343 | this.playLoop = true;
|
19344 | }
|
19345 |
|
19346 |
|
19347 |
|
19348 |
|
19349 |
|
19350 | Slider.prototype.prev = function () {
|
19351 | var index = this.getIndex();
|
19352 |
|
19353 | if (index > 0) {
|
19354 | index--;
|
19355 | this.setIndex(index);
|
19356 | }
|
19357 | };
|
19358 |
|
19359 |
|
19360 |
|
19361 |
|
19362 |
|
19363 | Slider.prototype.next = function () {
|
19364 | var index = this.getIndex();
|
19365 |
|
19366 | if (index < this.values.length - 1) {
|
19367 | index++;
|
19368 | this.setIndex(index);
|
19369 | }
|
19370 | };
|
19371 |
|
19372 |
|
19373 |
|
19374 |
|
19375 |
|
19376 | Slider.prototype.playNext = function () {
|
19377 | var start = new Date();
|
19378 | var index = this.getIndex();
|
19379 |
|
19380 | if (index < this.values.length - 1) {
|
19381 | index++;
|
19382 | this.setIndex(index);
|
19383 | } else if (this.playLoop) {
|
19384 |
|
19385 | index = 0;
|
19386 | this.setIndex(index);
|
19387 | }
|
19388 |
|
19389 | var end = new Date();
|
19390 | var diff = end - start;
|
19391 |
|
19392 |
|
19393 | var interval = Math.max(this.playInterval - diff, 0);
|
19394 |
|
19395 | var me = this;
|
19396 | this.playTimeout = setTimeout(function () {
|
19397 | me.playNext();
|
19398 | }, interval);
|
19399 | };
|
19400 |
|
19401 |
|
19402 |
|
19403 |
|
19404 |
|
19405 | Slider.prototype.togglePlay = function () {
|
19406 | if (this.playTimeout === undefined) {
|
19407 | this.play();
|
19408 | } else {
|
19409 | this.stop();
|
19410 | }
|
19411 | };
|
19412 |
|
19413 |
|
19414 |
|
19415 |
|
19416 |
|
19417 | Slider.prototype.play = function () {
|
19418 |
|
19419 | if (this.playTimeout) return;
|
19420 | this.playNext();
|
19421 |
|
19422 | if (this.frame) {
|
19423 | this.frame.play.value = 'Stop';
|
19424 | }
|
19425 | };
|
19426 |
|
19427 |
|
19428 |
|
19429 |
|
19430 |
|
19431 | Slider.prototype.stop = function () {
|
19432 | clearInterval(this.playTimeout);
|
19433 | this.playTimeout = undefined;
|
19434 |
|
19435 | if (this.frame) {
|
19436 | this.frame.play.value = 'Play';
|
19437 | }
|
19438 | };
|
19439 |
|
19440 |
|
19441 |
|
19442 |
|
19443 |
|
19444 |
|
19445 |
|
19446 |
|
19447 | Slider.prototype.setOnChangeCallback = function (callback) {
|
19448 | this.onChangeCallback = callback;
|
19449 | };
|
19450 |
|
19451 |
|
19452 |
|
19453 |
|
19454 |
|
19455 |
|
19456 | Slider.prototype.setPlayInterval = function (interval) {
|
19457 | this.playInterval = interval;
|
19458 | };
|
19459 |
|
19460 |
|
19461 |
|
19462 |
|
19463 |
|
19464 |
|
19465 | Slider.prototype.getPlayInterval = function () {
|
19466 | return this.playInterval;
|
19467 | };
|
19468 |
|
19469 |
|
19470 |
|
19471 |
|
19472 |
|
19473 |
|
19474 |
|
19475 |
|
19476 |
|
19477 | Slider.prototype.setPlayLoop = function (doLoop) {
|
19478 | this.playLoop = doLoop;
|
19479 | };
|
19480 |
|
19481 |
|
19482 |
|
19483 |
|
19484 |
|
19485 | Slider.prototype.onChange = function () {
|
19486 | if (this.onChangeCallback !== undefined) {
|
19487 | this.onChangeCallback();
|
19488 | }
|
19489 | };
|
19490 |
|
19491 |
|
19492 |
|
19493 |
|
19494 |
|
19495 | Slider.prototype.redraw = function () {
|
19496 | if (this.frame) {
|
19497 |
|
19498 | this.frame.bar.style.top = this.frame.clientHeight / 2 - this.frame.bar.offsetHeight / 2 + 'px';
|
19499 | this.frame.bar.style.width = this.frame.clientWidth - this.frame.prev.clientWidth - this.frame.play.clientWidth - this.frame.next.clientWidth - 30 + 'px';
|
19500 |
|
19501 | var left = this.indexToLeft(this.index);
|
19502 | this.frame.slide.style.left = left + 'px';
|
19503 | }
|
19504 | };
|
19505 |
|
19506 |
|
19507 |
|
19508 |
|
19509 |
|
19510 |
|
19511 | Slider.prototype.setValues = function (values) {
|
19512 | this.values = values;
|
19513 | if (this.values.length > 0) this.setIndex(0);else this.index = undefined;
|
19514 | };
|
19515 |
|
19516 |
|
19517 |
|
19518 |
|
19519 |
|
19520 |
|
19521 | Slider.prototype.setIndex = function (index) {
|
19522 | if (index < this.values.length) {
|
19523 | this.index = index;
|
19524 | this.redraw();
|
19525 | this.onChange();
|
19526 | } else {
|
19527 | throw new Error('Index out of range');
|
19528 | }
|
19529 | };
|
19530 |
|
19531 |
|
19532 |
|
19533 |
|
19534 |
|
19535 |
|
19536 | Slider.prototype.getIndex = function () {
|
19537 | return this.index;
|
19538 | };
|
19539 |
|
19540 |
|
19541 |
|
19542 |
|
19543 |
|
19544 |
|
19545 | Slider.prototype.get = function () {
|
19546 | return this.values[this.index];
|
19547 | };
|
19548 |
|
19549 | Slider.prototype._onMouseDown = function (event) {
|
19550 |
|
19551 | var leftButtonDown = event.which ? event.which === 1 : event.button === 1;
|
19552 | if (!leftButtonDown) return;
|
19553 | this.startClientX = event.clientX;
|
19554 | this.startSlideX = parseFloat(this.frame.slide.style.left);
|
19555 | this.frame.style.cursor = 'move';
|
19556 |
|
19557 |
|
19558 |
|
19559 | var me = this;
|
19560 |
|
19561 | this.onmousemove = function (event) {
|
19562 | me._onMouseMove(event);
|
19563 | };
|
19564 |
|
19565 | this.onmouseup = function (event) {
|
19566 | me._onMouseUp(event);
|
19567 | };
|
19568 |
|
19569 | util.addEventListener(document, 'mousemove', this.onmousemove);
|
19570 | util.addEventListener(document, 'mouseup', this.onmouseup);
|
19571 | util.preventDefault(event);
|
19572 | };
|
19573 |
|
19574 | Slider.prototype.leftToIndex = function (left) {
|
19575 | var width = parseFloat(this.frame.bar.style.width) - this.frame.slide.clientWidth - 10;
|
19576 | var x = left - 3;
|
19577 | var index = Math.round(x / width * (this.values.length - 1));
|
19578 | if (index < 0) index = 0;
|
19579 | if (index > this.values.length - 1) index = this.values.length - 1;
|
19580 | return index;
|
19581 | };
|
19582 |
|
19583 | Slider.prototype.indexToLeft = function (index) {
|
19584 | var width = parseFloat(this.frame.bar.style.width) - this.frame.slide.clientWidth - 10;
|
19585 | var x = index / (this.values.length - 1) * width;
|
19586 | var left = x + 3;
|
19587 | return left;
|
19588 | };
|
19589 |
|
19590 | Slider.prototype._onMouseMove = function (event) {
|
19591 | var diff = event.clientX - this.startClientX;
|
19592 | var x = this.startSlideX + diff;
|
19593 | var index = this.leftToIndex(x);
|
19594 | this.setIndex(index);
|
19595 | util.preventDefault();
|
19596 | };
|
19597 |
|
19598 | Slider.prototype._onMouseUp = function (event) {
|
19599 |
|
19600 | this.frame.style.cursor = 'auto';
|
19601 |
|
19602 | util.removeEventListener(document, 'mousemove', this.onmousemove);
|
19603 | util.removeEventListener(document, 'mouseup', this.onmouseup);
|
19604 | util.preventDefault();
|
19605 | };
|
19606 |
|
19607 | var Slider_1 = Slider;
|
19608 |
|
19609 |
|
19610 |
|
19611 |
|
19612 |
|
19613 |
|
19614 |
|
19615 |
|
19616 |
|
19617 |
|
19618 |
|
19619 |
|
19620 |
|
19621 |
|
19622 |
|
19623 |
|
19624 |
|
19625 |
|
19626 |
|
19627 |
|
19628 |
|
19629 |
|
19630 |
|
19631 |
|
19632 |
|
19633 |
|
19634 | function StepNumber(start, end, step, prettyStep) {
|
19635 |
|
19636 | this._start = 0;
|
19637 | this._end = 0;
|
19638 | this._step = 1;
|
19639 | this.prettyStep = true;
|
19640 | this.precision = 5;
|
19641 | this._current = 0;
|
19642 | this.setRange(start, end, step, prettyStep);
|
19643 | }
|
19644 |
|
19645 |
|
19646 |
|
19647 |
|
19648 |
|
19649 |
|
19650 |
|
19651 |
|
19652 |
|
19653 |
|
19654 | StepNumber.prototype.isNumeric = function (n) {
|
19655 | return !isNaN(parseFloat(n)) && isFinite(n);
|
19656 | };
|
19657 |
|
19658 |
|
19659 |
|
19660 |
|
19661 |
|
19662 |
|
19663 |
|
19664 |
|
19665 |
|
19666 |
|
19667 |
|
19668 | StepNumber.prototype.setRange = function (start, end, step, prettyStep) {
|
19669 | if (!this.isNumeric(start)) {
|
19670 | throw new Error('Parameter \'start\' is not numeric; value: ' + start);
|
19671 | }
|
19672 |
|
19673 | if (!this.isNumeric(end)) {
|
19674 | throw new Error('Parameter \'end\' is not numeric; value: ' + start);
|
19675 | }
|
19676 |
|
19677 | if (!this.isNumeric(step)) {
|
19678 | throw new Error('Parameter \'step\' is not numeric; value: ' + start);
|
19679 | }
|
19680 |
|
19681 | this._start = start ? start : 0;
|
19682 | this._end = end ? end : 0;
|
19683 | this.setStep(step, prettyStep);
|
19684 | };
|
19685 |
|
19686 |
|
19687 |
|
19688 |
|
19689 |
|
19690 |
|
19691 |
|
19692 |
|
19693 | StepNumber.prototype.setStep = function (step, prettyStep) {
|
19694 | if (step === undefined || step <= 0) return;
|
19695 | if (prettyStep !== undefined) this.prettyStep = prettyStep;
|
19696 | if (this.prettyStep === true) this._step = StepNumber.calculatePrettyStep(step);else this._step = step;
|
19697 | };
|
19698 |
|
19699 |
|
19700 |
|
19701 |
|
19702 |
|
19703 |
|
19704 |
|
19705 |
|
19706 |
|
19707 | StepNumber.calculatePrettyStep = function (step) {
|
19708 | var log10 = function log10(x) {
|
19709 | return Math.log(x) / Math.LN10;
|
19710 | };
|
19711 |
|
19712 |
|
19713 | var step1 = Math.pow(10, Math.round(log10(step))),
|
19714 | step2 = 2 * Math.pow(10, Math.round(log10(step / 2))),
|
19715 | step5 = 5 * Math.pow(10, Math.round(log10(step / 5)));
|
19716 |
|
19717 | var prettyStep = step1;
|
19718 | if (Math.abs(step2 - step) <= Math.abs(prettyStep - step)) prettyStep = step2;
|
19719 | if (Math.abs(step5 - step) <= Math.abs(prettyStep - step)) prettyStep = step5;
|
19720 |
|
19721 | if (prettyStep <= 0) {
|
19722 | prettyStep = 1;
|
19723 | }
|
19724 |
|
19725 | return prettyStep;
|
19726 | };
|
19727 |
|
19728 |
|
19729 |
|
19730 |
|
19731 |
|
19732 |
|
19733 | StepNumber.prototype.getCurrent = function () {
|
19734 | return parseFloat(this._current.toPrecision(this.precision));
|
19735 | };
|
19736 |
|
19737 |
|
19738 |
|
19739 |
|
19740 |
|
19741 |
|
19742 | StepNumber.prototype.getStep = function () {
|
19743 | return this._step;
|
19744 | };
|
19745 |
|
19746 |
|
19747 |
|
19748 |
|
19749 |
|
19750 |
|
19751 |
|
19752 |
|
19753 |
|
19754 |
|
19755 |
|
19756 |
|
19757 |
|
19758 | StepNumber.prototype.start = function (checkFirst) {
|
19759 | if (checkFirst === undefined) {
|
19760 | checkFirst = false;
|
19761 | }
|
19762 |
|
19763 | this._current = this._start - this._start % this._step;
|
19764 |
|
19765 | if (checkFirst) {
|
19766 | if (this.getCurrent() < this._start) {
|
19767 | this.next();
|
19768 | }
|
19769 | }
|
19770 | };
|
19771 |
|
19772 |
|
19773 |
|
19774 |
|
19775 |
|
19776 | StepNumber.prototype.next = function () {
|
19777 | this._current += this._step;
|
19778 | };
|
19779 |
|
19780 |
|
19781 |
|
19782 |
|
19783 |
|
19784 |
|
19785 | StepNumber.prototype.end = function () {
|
19786 | return this._current > this._end;
|
19787 | };
|
19788 |
|
19789 | var StepNumber_1 = StepNumber;
|
19790 |
|
19791 |
|
19792 |
|
19793 |
|
19794 |
|
19795 |
|
19796 |
|
19797 |
|
19798 |
|
19799 |
|
19800 |
|
19801 |
|
19802 | function Camera() {
|
19803 | this.armLocation = new Point3d_1();
|
19804 | this.armRotation = {};
|
19805 | this.armRotation.horizontal = 0;
|
19806 | this.armRotation.vertical = 0;
|
19807 | this.armLength = 1.7;
|
19808 | this.cameraOffset = new Point3d_1();
|
19809 | this.offsetMultiplier = 0.6;
|
19810 | this.cameraLocation = new Point3d_1();
|
19811 | this.cameraRotation = new Point3d_1(0.5 * Math.PI, 0, 0);
|
19812 | this.calculateCameraOrientation();
|
19813 | }
|
19814 |
|
19815 |
|
19816 |
|
19817 |
|
19818 |
|
19819 |
|
19820 |
|
19821 | Camera.prototype.setOffset = function (x, y) {
|
19822 | var abs = Math.abs,
|
19823 | sign = Math.sign,
|
19824 | mul = this.offsetMultiplier,
|
19825 | border = this.armLength * mul;
|
19826 |
|
19827 | if (abs(x) > border) {
|
19828 | x = sign(x) * border;
|
19829 | }
|
19830 |
|
19831 | if (abs(y) > border) {
|
19832 | y = sign(y) * border;
|
19833 | }
|
19834 |
|
19835 | this.cameraOffset.x = x;
|
19836 | this.cameraOffset.y = y;
|
19837 | this.calculateCameraOrientation();
|
19838 | };
|
19839 |
|
19840 |
|
19841 |
|
19842 |
|
19843 |
|
19844 |
|
19845 | Camera.prototype.getOffset = function () {
|
19846 | return this.cameraOffset;
|
19847 | };
|
19848 |
|
19849 |
|
19850 |
|
19851 |
|
19852 |
|
19853 |
|
19854 |
|
19855 |
|
19856 | Camera.prototype.setArmLocation = function (x, y, z) {
|
19857 | this.armLocation.x = x;
|
19858 | this.armLocation.y = y;
|
19859 | this.armLocation.z = z;
|
19860 | this.calculateCameraOrientation();
|
19861 | };
|
19862 |
|
19863 |
|
19864 |
|
19865 |
|
19866 |
|
19867 |
|
19868 |
|
19869 |
|
19870 |
|
19871 |
|
19872 | Camera.prototype.setArmRotation = function (horizontal, vertical) {
|
19873 | if (horizontal !== undefined) {
|
19874 | this.armRotation.horizontal = horizontal;
|
19875 | }
|
19876 |
|
19877 | if (vertical !== undefined) {
|
19878 | this.armRotation.vertical = vertical;
|
19879 | if (this.armRotation.vertical < 0) this.armRotation.vertical = 0;
|
19880 | if (this.armRotation.vertical > 0.5 * Math.PI) this.armRotation.vertical = 0.5 * Math.PI;
|
19881 | }
|
19882 |
|
19883 | if (horizontal !== undefined || vertical !== undefined) {
|
19884 | this.calculateCameraOrientation();
|
19885 | }
|
19886 | };
|
19887 |
|
19888 |
|
19889 |
|
19890 |
|
19891 |
|
19892 |
|
19893 | Camera.prototype.getArmRotation = function () {
|
19894 | var rot = {};
|
19895 | rot.horizontal = this.armRotation.horizontal;
|
19896 | rot.vertical = this.armRotation.vertical;
|
19897 | return rot;
|
19898 | };
|
19899 |
|
19900 |
|
19901 |
|
19902 |
|
19903 |
|
19904 |
|
19905 | Camera.prototype.setArmLength = function (length) {
|
19906 | if (length === undefined) return;
|
19907 | this.armLength = length;
|
19908 |
|
19909 |
|
19910 |
|
19911 | if (this.armLength < 0.71) this.armLength = 0.71;
|
19912 | if (this.armLength > 5.0) this.armLength = 5.0;
|
19913 | this.setOffset(this.cameraOffset.x, this.cameraOffset.y);
|
19914 | this.calculateCameraOrientation();
|
19915 | };
|
19916 |
|
19917 |
|
19918 |
|
19919 |
|
19920 |
|
19921 |
|
19922 | Camera.prototype.getArmLength = function () {
|
19923 | return this.armLength;
|
19924 | };
|
19925 |
|
19926 |
|
19927 |
|
19928 |
|
19929 |
|
19930 |
|
19931 | Camera.prototype.getCameraLocation = function () {
|
19932 | return this.cameraLocation;
|
19933 | };
|
19934 |
|
19935 |
|
19936 |
|
19937 |
|
19938 |
|
19939 |
|
19940 | Camera.prototype.getCameraRotation = function () {
|
19941 | return this.cameraRotation;
|
19942 | };
|
19943 |
|
19944 |
|
19945 |
|
19946 |
|
19947 |
|
19948 |
|
19949 | Camera.prototype.calculateCameraOrientation = function () {
|
19950 |
|
19951 | this.cameraLocation.x = this.armLocation.x - this.armLength * Math.sin(this.armRotation.horizontal) * Math.cos(this.armRotation.vertical);
|
19952 | this.cameraLocation.y = this.armLocation.y - this.armLength * Math.cos(this.armRotation.horizontal) * Math.cos(this.armRotation.vertical);
|
19953 | this.cameraLocation.z = this.armLocation.z + this.armLength * Math.sin(this.armRotation.vertical);
|
19954 |
|
19955 | this.cameraRotation.x = Math.PI / 2 - this.armRotation.vertical;
|
19956 | this.cameraRotation.y = 0;
|
19957 | this.cameraRotation.z = -this.armRotation.horizontal;
|
19958 | var xa = this.cameraRotation.x;
|
19959 | var za = this.cameraRotation.z;
|
19960 | var dx = this.cameraOffset.x;
|
19961 | var dy = this.cameraOffset.y;
|
19962 | var sin = Math.sin,
|
19963 | cos = Math.cos;
|
19964 | this.cameraLocation.x = this.cameraLocation.x + dx * cos(za) + dy * -sin(za) * cos(xa);
|
19965 | this.cameraLocation.y = this.cameraLocation.y + dx * sin(za) + dy * cos(za) * cos(xa);
|
19966 | this.cameraLocation.z = this.cameraLocation.z + dy * sin(xa);
|
19967 | };
|
19968 |
|
19969 | var Camera_1 = Camera;
|
19970 |
|
19971 |
|
19972 |
|
19973 |
|
19974 |
|
19975 |
|
19976 | var STYLE = {
|
19977 | BAR: 0,
|
19978 | BARCOLOR: 1,
|
19979 | BARSIZE: 2,
|
19980 | DOT: 3,
|
19981 | DOTLINE: 4,
|
19982 | DOTCOLOR: 5,
|
19983 | DOTSIZE: 6,
|
19984 | GRID: 7,
|
19985 | LINE: 8,
|
19986 | SURFACE: 9
|
19987 | };
|
19988 |
|
19989 | var STYLENAME = {
|
19990 | 'dot': STYLE.DOT,
|
19991 | 'dot-line': STYLE.DOTLINE,
|
19992 | 'dot-color': STYLE.DOTCOLOR,
|
19993 | 'dot-size': STYLE.DOTSIZE,
|
19994 | 'line': STYLE.LINE,
|
19995 | 'grid': STYLE.GRID,
|
19996 | 'surface': STYLE.SURFACE,
|
19997 | 'bar': STYLE.BAR,
|
19998 | 'bar-color': STYLE.BARCOLOR,
|
19999 | 'bar-size': STYLE.BARSIZE
|
20000 | };
|
20001 |
|
20002 |
|
20003 |
|
20004 |
|
20005 |
|
20006 |
|
20007 |
|
20008 | var OPTIONKEYS = ['width', 'height', 'filterLabel', 'legendLabel', 'xLabel', 'yLabel', 'zLabel', 'xValueLabel', 'yValueLabel', 'zValueLabel', 'showXAxis', 'showYAxis', 'showZAxis', 'showGrid', 'showPerspective', 'showShadow', 'keepAspectRatio', 'rotateAxisLabels', 'verticalRatio', 'dotSizeRatio', 'dotSizeMinFraction', 'dotSizeMaxFraction', 'showAnimationControls', 'animationInterval', 'animationPreload', 'animationAutoStart', 'axisColor', 'axisFontSize', 'axisFontType', 'gridColor', 'xCenter', 'yCenter', 'zoomable', 'tooltipDelay', 'ctrlToZoom'];
|
20009 |
|
20010 |
|
20011 |
|
20012 |
|
20013 |
|
20014 |
|
20015 |
|
20016 | var PREFIXEDOPTIONKEYS = ['xBarWidth', 'yBarWidth', 'valueMin', 'valueMax', 'xMin', 'xMax', 'xStep', 'yMin', 'yMax', 'yStep', 'zMin', 'zMax', 'zStep'];
|
20017 |
|
20018 | var DEFAULTS = undefined;
|
20019 |
|
20020 |
|
20021 |
|
20022 |
|
20023 |
|
20024 |
|
20025 |
|
20026 |
|
20027 |
|
20028 | function isEmpty(obj) {
|
20029 | for (var prop in obj) {
|
20030 | if (obj.hasOwnProperty(prop)) return false;
|
20031 | }
|
20032 |
|
20033 | return true;
|
20034 | }
|
20035 |
|
20036 |
|
20037 |
|
20038 |
|
20039 |
|
20040 |
|
20041 |
|
20042 |
|
20043 |
|
20044 |
|
20045 | function capitalize(str) {
|
20046 | if (str === undefined || str === "" || typeof str != "string") {
|
20047 | return str;
|
20048 | }
|
20049 |
|
20050 | return str.charAt(0).toUpperCase() + str.slice(1);
|
20051 | }
|
20052 |
|
20053 |
|
20054 |
|
20055 |
|
20056 |
|
20057 |
|
20058 |
|
20059 |
|
20060 |
|
20061 | function prefixFieldName(prefix, fieldName) {
|
20062 | if (prefix === undefined || prefix === "") {
|
20063 | return fieldName;
|
20064 | }
|
20065 |
|
20066 | return prefix + capitalize(fieldName);
|
20067 | }
|
20068 |
|
20069 |
|
20070 |
|
20071 |
|
20072 |
|
20073 |
|
20074 |
|
20075 |
|
20076 |
|
20077 |
|
20078 |
|
20079 |
|
20080 |
|
20081 |
|
20082 |
|
20083 |
|
20084 |
|
20085 |
|
20086 | function forceCopy(src, dst, fields, prefix) {
|
20087 | var srcKey;
|
20088 | var dstKey;
|
20089 |
|
20090 | for (var i = 0; i < fields.length; ++i) {
|
20091 | srcKey = fields[i];
|
20092 | dstKey = prefixFieldName(prefix, srcKey);
|
20093 | dst[dstKey] = src[srcKey];
|
20094 | }
|
20095 | }
|
20096 |
|
20097 |
|
20098 |
|
20099 |
|
20100 |
|
20101 |
|
20102 |
|
20103 |
|
20104 |
|
20105 |
|
20106 |
|
20107 |
|
20108 |
|
20109 | function safeCopy(src, dst, fields, prefix) {
|
20110 | var srcKey;
|
20111 | var dstKey;
|
20112 |
|
20113 | for (var i = 0; i < fields.length; ++i) {
|
20114 | srcKey = fields[i];
|
20115 | if (src[srcKey] === undefined) continue;
|
20116 | dstKey = prefixFieldName(prefix, srcKey);
|
20117 | dst[dstKey] = src[srcKey];
|
20118 | }
|
20119 | }
|
20120 |
|
20121 |
|
20122 |
|
20123 |
|
20124 |
|
20125 |
|
20126 |
|
20127 |
|
20128 |
|
20129 |
|
20130 |
|
20131 |
|
20132 |
|
20133 | function setDefaults(src, dst) {
|
20134 | if (src === undefined || isEmpty(src)) {
|
20135 | throw new Error('No DEFAULTS passed');
|
20136 | }
|
20137 |
|
20138 | if (dst === undefined) {
|
20139 | throw new Error('No dst passed');
|
20140 | }
|
20141 |
|
20142 |
|
20143 | DEFAULTS = src;
|
20144 |
|
20145 | forceCopy(src, dst, OPTIONKEYS);
|
20146 | forceCopy(src, dst, PREFIXEDOPTIONKEYS, 'default');
|
20147 |
|
20148 | setSpecialSettings(src, dst);
|
20149 |
|
20150 | dst.margin = 10;
|
20151 |
|
20152 | dst.showGrayBottom = false;
|
20153 |
|
20154 | dst.showTooltip = false;
|
20155 | dst.onclick_callback = null;
|
20156 | dst.eye = new Point3d_1(0, 0, -1);
|
20157 | }
|
20158 |
|
20159 |
|
20160 |
|
20161 |
|
20162 |
|
20163 |
|
20164 |
|
20165 | function setOptions(options, dst) {
|
20166 | if (options === undefined) {
|
20167 | return;
|
20168 | }
|
20169 |
|
20170 | if (dst === undefined) {
|
20171 | throw new Error('No dst passed');
|
20172 | }
|
20173 |
|
20174 | if (DEFAULTS === undefined || isEmpty(DEFAULTS)) {
|
20175 | throw new Error('DEFAULTS not set for module Settings');
|
20176 | }
|
20177 |
|
20178 |
|
20179 | safeCopy(options, dst, OPTIONKEYS);
|
20180 | safeCopy(options, dst, PREFIXEDOPTIONKEYS, 'default');
|
20181 |
|
20182 | setSpecialSettings(options, dst);
|
20183 | }
|
20184 |
|
20185 |
|
20186 |
|
20187 |
|
20188 |
|
20189 |
|
20190 |
|
20191 |
|
20192 |
|
20193 |
|
20194 | function setSpecialSettings(src, dst) {
|
20195 | if (src.backgroundColor !== undefined) {
|
20196 | setBackgroundColor(src.backgroundColor, dst);
|
20197 | }
|
20198 |
|
20199 | setDataColor(src.dataColor, dst);
|
20200 | setStyle(src.style, dst);
|
20201 | setShowLegend(src.showLegend, dst);
|
20202 | setCameraPosition(src.cameraPosition, dst);
|
20203 |
|
20204 |
|
20205 | if (src.tooltip !== undefined) {
|
20206 | dst.showTooltip = src.tooltip;
|
20207 | }
|
20208 |
|
20209 | if (src.onclick != undefined) {
|
20210 | dst.onclick_callback = src.onclick;
|
20211 | }
|
20212 |
|
20213 | if (src.tooltipStyle !== undefined) {
|
20214 | util.selectiveDeepExtend(['tooltipStyle'], dst, src);
|
20215 | }
|
20216 | }
|
20217 |
|
20218 |
|
20219 |
|
20220 |
|
20221 |
|
20222 |
|
20223 |
|
20224 |
|
20225 |
|
20226 |
|
20227 |
|
20228 | function setShowLegend(showLegend, dst) {
|
20229 | if (showLegend === undefined) {
|
20230 |
|
20231 | var isAutoByDefault = DEFAULTS.showLegend === undefined;
|
20232 |
|
20233 | if (isAutoByDefault) {
|
20234 |
|
20235 | var isLegendGraphStyle = dst.style === STYLE.DOTCOLOR || dst.style === STYLE.DOTSIZE;
|
20236 | dst.showLegend = isLegendGraphStyle;
|
20237 | }
|
20238 | } else {
|
20239 | dst.showLegend = showLegend;
|
20240 | }
|
20241 | }
|
20242 |
|
20243 |
|
20244 |
|
20245 |
|
20246 |
|
20247 |
|
20248 |
|
20249 |
|
20250 | function getStyleNumberByName(styleName) {
|
20251 | var number = STYLENAME[styleName];
|
20252 |
|
20253 | if (number === undefined) {
|
20254 | return -1;
|
20255 | }
|
20256 |
|
20257 | return number;
|
20258 | }
|
20259 |
|
20260 |
|
20261 |
|
20262 |
|
20263 |
|
20264 |
|
20265 |
|
20266 |
|
20267 | function checkStyleNumber(style) {
|
20268 | var valid = false;
|
20269 |
|
20270 | for (var n in STYLE) {
|
20271 | if (STYLE[n] === style) {
|
20272 | valid = true;
|
20273 | break;
|
20274 | }
|
20275 | }
|
20276 |
|
20277 | return valid;
|
20278 | }
|
20279 |
|
20280 |
|
20281 |
|
20282 |
|
20283 |
|
20284 |
|
20285 |
|
20286 | function setStyle(style, dst) {
|
20287 | if (style === undefined) {
|
20288 | return;
|
20289 | }
|
20290 |
|
20291 | var styleNumber;
|
20292 |
|
20293 | if (typeof style === 'string') {
|
20294 | styleNumber = getStyleNumberByName(style);
|
20295 |
|
20296 | if (styleNumber === -1) {
|
20297 | throw new Error('Style \'' + style + '\' is invalid');
|
20298 | }
|
20299 | } else {
|
20300 |
|
20301 | if (!checkStyleNumber(style)) {
|
20302 | throw new Error('Style \'' + style + '\' is invalid');
|
20303 | }
|
20304 |
|
20305 | styleNumber = style;
|
20306 | }
|
20307 |
|
20308 | dst.style = styleNumber;
|
20309 | }
|
20310 |
|
20311 |
|
20312 |
|
20313 |
|
20314 |
|
20315 |
|
20316 |
|
20317 | function setBackgroundColor(backgroundColor, dst) {
|
20318 | var fill = 'white';
|
20319 | var stroke = 'gray';
|
20320 | var strokeWidth = 1;
|
20321 |
|
20322 | if (typeof backgroundColor === 'string') {
|
20323 | fill = backgroundColor;
|
20324 | stroke = 'none';
|
20325 | strokeWidth = 0;
|
20326 | } else if (_typeof(backgroundColor) === 'object') {
|
20327 | if (backgroundColor.fill !== undefined) fill = backgroundColor.fill;
|
20328 | if (backgroundColor.stroke !== undefined) stroke = backgroundColor.stroke;
|
20329 | if (backgroundColor.strokeWidth !== undefined) strokeWidth = backgroundColor.strokeWidth;
|
20330 | } else {
|
20331 | throw new Error('Unsupported type of backgroundColor');
|
20332 | }
|
20333 |
|
20334 | dst.frame.style.backgroundColor = fill;
|
20335 | dst.frame.style.borderColor = stroke;
|
20336 | dst.frame.style.borderWidth = strokeWidth + 'px';
|
20337 | dst.frame.style.borderStyle = 'solid';
|
20338 | }
|
20339 |
|
20340 |
|
20341 |
|
20342 |
|
20343 |
|
20344 |
|
20345 |
|
20346 | function setDataColor(dataColor, dst) {
|
20347 | if (dataColor === undefined) {
|
20348 | return;
|
20349 | }
|
20350 |
|
20351 | if (dst.dataColor === undefined) {
|
20352 | dst.dataColor = {};
|
20353 | }
|
20354 |
|
20355 | if (typeof dataColor === 'string') {
|
20356 | dst.dataColor.fill = dataColor;
|
20357 | dst.dataColor.stroke = dataColor;
|
20358 | } else {
|
20359 | if (dataColor.fill) {
|
20360 | dst.dataColor.fill = dataColor.fill;
|
20361 | }
|
20362 |
|
20363 | if (dataColor.stroke) {
|
20364 | dst.dataColor.stroke = dataColor.stroke;
|
20365 | }
|
20366 |
|
20367 | if (dataColor.strokeWidth !== undefined) {
|
20368 | dst.dataColor.strokeWidth = dataColor.strokeWidth;
|
20369 | }
|
20370 | }
|
20371 | }
|
20372 |
|
20373 |
|
20374 |
|
20375 |
|
20376 |
|
20377 |
|
20378 |
|
20379 | function setCameraPosition(cameraPosition, dst) {
|
20380 | var camPos = cameraPosition;
|
20381 |
|
20382 | if (camPos === undefined) {
|
20383 | return;
|
20384 | }
|
20385 |
|
20386 | if (dst.camera === undefined) {
|
20387 | dst.camera = new Camera_1();
|
20388 | }
|
20389 |
|
20390 | dst.camera.setArmRotation(camPos.horizontal, camPos.vertical);
|
20391 | dst.camera.setArmLength(camPos.distance);
|
20392 | }
|
20393 |
|
20394 | var STYLE_1 = STYLE;
|
20395 | var setDefaults_1 = setDefaults;
|
20396 | var setOptions_1 = setOptions;
|
20397 | var setCameraPosition_1 = setCameraPosition;
|
20398 | var Settings = {
|
20399 | STYLE: STYLE_1,
|
20400 | setDefaults: setDefaults_1,
|
20401 | setOptions: setOptions_1,
|
20402 | setCameraPosition: setCameraPosition_1
|
20403 | };
|
20404 |
|
20405 | var errorFound = false;
|
20406 | var allOptions;
|
20407 | var printStyle = 'background: #FFeeee; color: #dd0000';
|
20408 |
|
20409 |
|
20410 |
|
20411 |
|
20412 | var Validator =
|
20413 |
|
20414 | function () {
|
20415 | |
20416 |
|
20417 |
|
20418 | function Validator() {
|
20419 | _classCallCheck$1(this, Validator);
|
20420 | }
|
20421 | |
20422 |
|
20423 |
|
20424 |
|
20425 |
|
20426 |
|
20427 |
|
20428 |
|
20429 |
|
20430 |
|
20431 | _createClass$1(Validator, null, [{
|
20432 | key: "validate",
|
20433 | value: function validate(options, referenceOptions, subObject) {
|
20434 | errorFound = false;
|
20435 | allOptions = referenceOptions;
|
20436 | var usedOptions = referenceOptions;
|
20437 |
|
20438 | if (subObject !== undefined) {
|
20439 | usedOptions = referenceOptions[subObject];
|
20440 | }
|
20441 |
|
20442 | Validator.parse(options, usedOptions, []);
|
20443 | return errorFound;
|
20444 | }
|
20445 | |
20446 |
|
20447 |
|
20448 |
|
20449 |
|
20450 |
|
20451 |
|
20452 |
|
20453 | }, {
|
20454 | key: "parse",
|
20455 | value: function parse(options, referenceOptions, path) {
|
20456 | for (var option in options) {
|
20457 | if (options.hasOwnProperty(option)) {
|
20458 | Validator.check(option, options, referenceOptions, path);
|
20459 | }
|
20460 | }
|
20461 | }
|
20462 | |
20463 |
|
20464 |
|
20465 |
|
20466 |
|
20467 |
|
20468 |
|
20469 |
|
20470 |
|
20471 | }, {
|
20472 | key: "check",
|
20473 | value: function check(option, options, referenceOptions, path) {
|
20474 | if (referenceOptions[option] === undefined && referenceOptions.__any__ === undefined) {
|
20475 | Validator.getSuggestion(option, referenceOptions, path);
|
20476 | return;
|
20477 | }
|
20478 |
|
20479 | var referenceOption = option;
|
20480 | var is_object = true;
|
20481 |
|
20482 | if (referenceOptions[option] === undefined && referenceOptions.__any__ !== undefined) {
|
20483 |
|
20484 |
|
20485 |
|
20486 |
|
20487 | referenceOption = '__any__';
|
20488 |
|
20489 |
|
20490 | is_object = Validator.getType(options[option]) === 'object';
|
20491 | }
|
20492 |
|
20493 | var refOptionObj = referenceOptions[referenceOption];
|
20494 |
|
20495 | if (is_object && refOptionObj.__type__ !== undefined) {
|
20496 | refOptionObj = refOptionObj.__type__;
|
20497 | }
|
20498 |
|
20499 | Validator.checkFields(option, options, referenceOptions, referenceOption, refOptionObj, path);
|
20500 | }
|
20501 | |
20502 |
|
20503 |
|
20504 |
|
20505 |
|
20506 |
|
20507 |
|
20508 |
|
20509 |
|
20510 |
|
20511 |
|
20512 | }, {
|
20513 | key: "checkFields",
|
20514 | value: function checkFields(option, options, referenceOptions, referenceOption, refOptionObj, path) {
|
20515 | var log = function log(message) {
|
20516 | console.log('%c' + message + Validator.printLocation(path, option), printStyle);
|
20517 | };
|
20518 |
|
20519 | var optionType = Validator.getType(options[option]);
|
20520 | var refOptionType = refOptionObj[optionType];
|
20521 |
|
20522 | if (refOptionType !== undefined) {
|
20523 |
|
20524 | if (Validator.getType(refOptionType) === 'array' && refOptionType.indexOf(options[option]) === -1) {
|
20525 | log('Invalid option detected in "' + option + '".' + ' Allowed values are:' + Validator.print(refOptionType) + ' not "' + options[option] + '". ');
|
20526 | errorFound = true;
|
20527 | } else if (optionType === 'object' && referenceOption !== "__any__") {
|
20528 | path = util.copyAndExtendArray(path, option);
|
20529 | Validator.parse(options[option], referenceOptions[referenceOption], path);
|
20530 | }
|
20531 | } else if (refOptionObj['any'] === undefined) {
|
20532 |
|
20533 | log('Invalid type received for "' + option + '". Expected: ' + Validator.print(Object.keys(refOptionObj)) + '. Received [' + optionType + '] "' + options[option] + '"');
|
20534 | errorFound = true;
|
20535 | }
|
20536 | }
|
20537 | |
20538 |
|
20539 |
|
20540 |
|
20541 |
|
20542 |
|
20543 |
|
20544 | }, {
|
20545 | key: "getType",
|
20546 | value: function getType(object) {
|
20547 | var type = _typeof(object);
|
20548 |
|
20549 | if (type === 'object') {
|
20550 | if (object === null) {
|
20551 | return 'null';
|
20552 | }
|
20553 |
|
20554 | if (object instanceof Boolean) {
|
20555 | return 'boolean';
|
20556 | }
|
20557 |
|
20558 | if (object instanceof Number) {
|
20559 | return 'number';
|
20560 | }
|
20561 |
|
20562 | if (object instanceof String) {
|
20563 | return 'string';
|
20564 | }
|
20565 |
|
20566 | if (Array.isArray(object)) {
|
20567 | return 'array';
|
20568 | }
|
20569 |
|
20570 | if (object instanceof Date) {
|
20571 | return 'date';
|
20572 | }
|
20573 |
|
20574 | if (object.nodeType !== undefined) {
|
20575 | return 'dom';
|
20576 | }
|
20577 |
|
20578 | if (object._isAMomentObject === true) {
|
20579 | return 'moment';
|
20580 | }
|
20581 |
|
20582 | return 'object';
|
20583 | } else if (type === 'number') {
|
20584 | return 'number';
|
20585 | } else if (type === 'boolean') {
|
20586 | return 'boolean';
|
20587 | } else if (type === 'string') {
|
20588 | return 'string';
|
20589 | } else if (type === undefined) {
|
20590 | return 'undefined';
|
20591 | }
|
20592 |
|
20593 | return type;
|
20594 | }
|
20595 | |
20596 |
|
20597 |
|
20598 |
|
20599 |
|
20600 |
|
20601 |
|
20602 | }, {
|
20603 | key: "getSuggestion",
|
20604 | value: function getSuggestion(option, options, path) {
|
20605 | var localSearch = Validator.findInOptions(option, options, path, false);
|
20606 | var globalSearch = Validator.findInOptions(option, allOptions, [], true);
|
20607 | var localSearchThreshold = 8;
|
20608 | var globalSearchThreshold = 4;
|
20609 | var msg;
|
20610 |
|
20611 | if (localSearch.indexMatch !== undefined) {
|
20612 | msg = ' in ' + Validator.printLocation(localSearch.path, option, '') + 'Perhaps it was incomplete? Did you mean: "' + localSearch.indexMatch + '"?\n\n';
|
20613 | } else if (globalSearch.distance <= globalSearchThreshold && localSearch.distance > globalSearch.distance) {
|
20614 | msg = ' in ' + Validator.printLocation(localSearch.path, option, '') + 'Perhaps it was misplaced? Matching option found at: ' + Validator.printLocation(globalSearch.path, globalSearch.closestMatch, '');
|
20615 | } else if (localSearch.distance <= localSearchThreshold) {
|
20616 | msg = '. Did you mean "' + localSearch.closestMatch + '"?' + Validator.printLocation(localSearch.path, option);
|
20617 | } else {
|
20618 | msg = '. Did you mean one of these: ' + Validator.print(Object.keys(options)) + Validator.printLocation(path, option);
|
20619 | }
|
20620 |
|
20621 | console.log('%cUnknown option detected: "' + option + '"' + msg, printStyle);
|
20622 | errorFound = true;
|
20623 | }
|
20624 | |
20625 |
|
20626 |
|
20627 |
|
20628 |
|
20629 |
|
20630 |
|
20631 |
|
20632 |
|
20633 |
|
20634 | }, {
|
20635 | key: "findInOptions",
|
20636 | value: function findInOptions(option, options, path) {
|
20637 | var recursive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
20638 | var min = 1e9;
|
20639 | var closestMatch = '';
|
20640 | var closestMatchPath = [];
|
20641 | var lowerCaseOption = option.toLowerCase();
|
20642 | var indexMatch = undefined;
|
20643 |
|
20644 | for (var op in options) {
|
20645 |
|
20646 | var distance = void 0;
|
20647 |
|
20648 | if (options[op].__type__ !== undefined && recursive === true) {
|
20649 | var result = Validator.findInOptions(option, options[op], util.copyAndExtendArray(path, op));
|
20650 |
|
20651 | if (min > result.distance) {
|
20652 | closestMatch = result.closestMatch;
|
20653 | closestMatchPath = result.path;
|
20654 | min = result.distance;
|
20655 | indexMatch = result.indexMatch;
|
20656 | }
|
20657 | } else {
|
20658 | if (op.toLowerCase().indexOf(lowerCaseOption) !== -1) {
|
20659 | indexMatch = op;
|
20660 | }
|
20661 |
|
20662 | distance = Validator.levenshteinDistance(option, op);
|
20663 |
|
20664 | if (min > distance) {
|
20665 | closestMatch = op;
|
20666 | closestMatchPath = util.copyArray(path);
|
20667 | min = distance;
|
20668 | }
|
20669 | }
|
20670 | }
|
20671 |
|
20672 | return {
|
20673 | closestMatch: closestMatch,
|
20674 | path: closestMatchPath,
|
20675 | distance: min,
|
20676 | indexMatch: indexMatch
|
20677 | };
|
20678 | }
|
20679 | |
20680 |
|
20681 |
|
20682 |
|
20683 |
|
20684 |
|
20685 |
|
20686 |
|
20687 | }, {
|
20688 | key: "printLocation",
|
20689 | value: function printLocation(path, option) {
|
20690 | var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Problem value found at: \n';
|
20691 | var str = '\n\n' + prefix + 'options = {\n';
|
20692 |
|
20693 | for (var i = 0; i < path.length; i++) {
|
20694 | for (var j = 0; j < i + 1; j++) {
|
20695 | str += ' ';
|
20696 | }
|
20697 |
|
20698 | str += path[i] + ': {\n';
|
20699 | }
|
20700 |
|
20701 | for (var _j = 0; _j < path.length + 1; _j++) {
|
20702 | str += ' ';
|
20703 | }
|
20704 |
|
20705 | str += option + '\n';
|
20706 |
|
20707 | for (var _i = 0; _i < path.length + 1; _i++) {
|
20708 | for (var _j2 = 0; _j2 < path.length - _i; _j2++) {
|
20709 | str += ' ';
|
20710 | }
|
20711 |
|
20712 | str += '}\n';
|
20713 | }
|
20714 |
|
20715 | return str + '\n\n';
|
20716 | }
|
20717 | |
20718 |
|
20719 |
|
20720 |
|
20721 |
|
20722 |
|
20723 | }, {
|
20724 | key: "print",
|
20725 | value: function print(options) {
|
20726 | return JSON.stringify(options).replace(/(\")|(\[)|(\])|(,"__type__")/g, "").replace(/(\,)/g, ', ');
|
20727 | }
|
20728 | |
20729 |
|
20730 |
|
20731 |
|
20732 |
|
20733 |
|
20734 |
|
20735 |
|
20736 |
|
20737 |
|
20738 |
|
20739 |
|
20740 |
|
20741 |
|
20742 |
|
20743 |
|
20744 |
|
20745 |
|
20746 | }, {
|
20747 | key: "levenshteinDistance",
|
20748 | value: function levenshteinDistance(a, b) {
|
20749 | if (a.length === 0) return b.length;
|
20750 | if (b.length === 0) return a.length;
|
20751 | var matrix = [];
|
20752 |
|
20753 | var i;
|
20754 |
|
20755 | for (i = 0; i <= b.length; i++) {
|
20756 | matrix[i] = [i];
|
20757 | }
|
20758 |
|
20759 |
|
20760 | var j;
|
20761 |
|
20762 | for (j = 0; j <= a.length; j++) {
|
20763 | matrix[0][j] = j;
|
20764 | }
|
20765 |
|
20766 |
|
20767 | for (i = 1; i <= b.length; i++) {
|
20768 | for (j = 1; j <= a.length; j++) {
|
20769 | if (b.charAt(i - 1) == a.charAt(j - 1)) {
|
20770 | matrix[i][j] = matrix[i - 1][j - 1];
|
20771 | } else {
|
20772 | matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1,
|
20773 | Math.min(matrix[i][j - 1] + 1,
|
20774 | matrix[i - 1][j] + 1));
|
20775 | }
|
20776 | }
|
20777 | }
|
20778 |
|
20779 | return matrix[b.length][a.length];
|
20780 | }
|
20781 | }]);
|
20782 |
|
20783 | return Validator;
|
20784 | }();
|
20785 |
|
20786 | var Validator$1 = Object.freeze({
|
20787 | Validator: Validator,
|
20788 | printStyle: printStyle
|
20789 | });
|
20790 |
|
20791 |
|
20792 |
|
20793 |
|
20794 |
|
20795 |
|
20796 |
|
20797 |
|
20798 | var string = 'string';
|
20799 | var bool = 'boolean';
|
20800 | var number = 'number';
|
20801 | var object = 'object';
|
20802 |
|
20803 |
|
20804 |
|
20805 |
|
20806 |
|
20807 | var colorOptions = {
|
20808 | fill: {
|
20809 | string: string
|
20810 | },
|
20811 | stroke: {
|
20812 | string: string
|
20813 | },
|
20814 | strokeWidth: {
|
20815 | number: number
|
20816 | },
|
20817 | __type__: {
|
20818 | string: string,
|
20819 | object: object,
|
20820 | 'undefined': 'undefined'
|
20821 | }
|
20822 | };
|
20823 |
|
20824 |
|
20825 |
|
20826 |
|
20827 |
|
20828 |
|
20829 |
|
20830 | var allOptions$1 = {
|
20831 | animationAutoStart: {
|
20832 | boolean: bool,
|
20833 | 'undefined': 'undefined'
|
20834 | },
|
20835 | animationInterval: {
|
20836 | number: number
|
20837 | },
|
20838 | animationPreload: {
|
20839 | boolean: bool
|
20840 | },
|
20841 | axisColor: {
|
20842 | string: string
|
20843 | },
|
20844 | axisFontSize: {
|
20845 | number: number
|
20846 | },
|
20847 | axisFontType: {
|
20848 | string: string
|
20849 | },
|
20850 | backgroundColor: colorOptions,
|
20851 | xBarWidth: {
|
20852 | number: number,
|
20853 | 'undefined': 'undefined'
|
20854 | },
|
20855 | yBarWidth: {
|
20856 | number: number,
|
20857 | 'undefined': 'undefined'
|
20858 | },
|
20859 | cameraPosition: {
|
20860 | distance: {
|
20861 | number: number
|
20862 | },
|
20863 | horizontal: {
|
20864 | number: number
|
20865 | },
|
20866 | vertical: {
|
20867 | number: number
|
20868 | },
|
20869 | __type__: {
|
20870 | object: object
|
20871 | }
|
20872 | },
|
20873 | zoomable: {
|
20874 | boolean: bool
|
20875 | },
|
20876 | ctrlToZoom: {
|
20877 | boolean: bool
|
20878 | },
|
20879 | xCenter: {
|
20880 | string: string
|
20881 | },
|
20882 | yCenter: {
|
20883 | string: string
|
20884 | },
|
20885 | dataColor: colorOptions,
|
20886 | dotSizeMinFraction: {
|
20887 | number: number
|
20888 | },
|
20889 | dotSizeMaxFraction: {
|
20890 | number: number
|
20891 | },
|
20892 | dotSizeRatio: {
|
20893 | number: number
|
20894 | },
|
20895 | filterLabel: {
|
20896 | string: string
|
20897 | },
|
20898 | gridColor: {
|
20899 | string: string
|
20900 | },
|
20901 | onclick: {
|
20902 | 'function': 'function'
|
20903 | },
|
20904 | keepAspectRatio: {
|
20905 | boolean: bool
|
20906 | },
|
20907 | xLabel: {
|
20908 | string: string
|
20909 | },
|
20910 | yLabel: {
|
20911 | string: string
|
20912 | },
|
20913 | zLabel: {
|
20914 | string: string
|
20915 | },
|
20916 | legendLabel: {
|
20917 | string: string
|
20918 | },
|
20919 | xMin: {
|
20920 | number: number,
|
20921 | 'undefined': 'undefined'
|
20922 | },
|
20923 | yMin: {
|
20924 | number: number,
|
20925 | 'undefined': 'undefined'
|
20926 | },
|
20927 | zMin: {
|
20928 | number: number,
|
20929 | 'undefined': 'undefined'
|
20930 | },
|
20931 | xMax: {
|
20932 | number: number,
|
20933 | 'undefined': 'undefined'
|
20934 | },
|
20935 | yMax: {
|
20936 | number: number,
|
20937 | 'undefined': 'undefined'
|
20938 | },
|
20939 | zMax: {
|
20940 | number: number,
|
20941 | 'undefined': 'undefined'
|
20942 | },
|
20943 | showAnimationControls: {
|
20944 | boolean: bool,
|
20945 | 'undefined': 'undefined'
|
20946 | },
|
20947 | showGrid: {
|
20948 | boolean: bool
|
20949 | },
|
20950 | showLegend: {
|
20951 | boolean: bool,
|
20952 | 'undefined': 'undefined'
|
20953 | },
|
20954 | showPerspective: {
|
20955 | boolean: bool
|
20956 | },
|
20957 | showShadow: {
|
20958 | boolean: bool
|
20959 | },
|
20960 | showXAxis: {
|
20961 | boolean: bool
|
20962 | },
|
20963 | showYAxis: {
|
20964 | boolean: bool
|
20965 | },
|
20966 | showZAxis: {
|
20967 | boolean: bool
|
20968 | },
|
20969 | rotateAxisLabels: {
|
20970 | boolean: bool
|
20971 | },
|
20972 | xStep: {
|
20973 | number: number,
|
20974 | 'undefined': 'undefined'
|
20975 | },
|
20976 | yStep: {
|
20977 | number: number,
|
20978 | 'undefined': 'undefined'
|
20979 | },
|
20980 | zStep: {
|
20981 | number: number,
|
20982 | 'undefined': 'undefined'
|
20983 | },
|
20984 | style: {
|
20985 | number: number,
|
20986 |
|
20987 | string: ['bar', 'bar-color', 'bar-size', 'dot', 'dot-line', 'dot-color', 'dot-size', 'line', 'grid', 'surface']
|
20988 | },
|
20989 | tooltip: {
|
20990 | boolean: bool,
|
20991 | 'function': 'function'
|
20992 | },
|
20993 | tooltipDelay: {
|
20994 | number: number
|
20995 | },
|
20996 | tooltipStyle: {
|
20997 | content: {
|
20998 | color: {
|
20999 | string: string
|
21000 | },
|
21001 | background: {
|
21002 | string: string
|
21003 | },
|
21004 | border: {
|
21005 | string: string
|
21006 | },
|
21007 | borderRadius: {
|
21008 | string: string
|
21009 | },
|
21010 | boxShadow: {
|
21011 | string: string
|
21012 | },
|
21013 | padding: {
|
21014 | string: string
|
21015 | },
|
21016 | __type__: {
|
21017 | object: object
|
21018 | }
|
21019 | },
|
21020 | line: {
|
21021 | borderLeft: {
|
21022 | string: string
|
21023 | },
|
21024 | height: {
|
21025 | string: string
|
21026 | },
|
21027 | width: {
|
21028 | string: string
|
21029 | },
|
21030 | pointerEvents: {
|
21031 | string: string
|
21032 | },
|
21033 | __type__: {
|
21034 | object: object
|
21035 | }
|
21036 | },
|
21037 | dot: {
|
21038 | border: {
|
21039 | string: string
|
21040 | },
|
21041 | borderRadius: {
|
21042 | string: string
|
21043 | },
|
21044 | height: {
|
21045 | string: string
|
21046 | },
|
21047 | width: {
|
21048 | string: string
|
21049 | },
|
21050 | pointerEvents: {
|
21051 | string: string
|
21052 | },
|
21053 | __type__: {
|
21054 | object: object
|
21055 | }
|
21056 | },
|
21057 | __type__: {
|
21058 | object: object
|
21059 | }
|
21060 | },
|
21061 | xValueLabel: {
|
21062 | 'function': 'function'
|
21063 | },
|
21064 | yValueLabel: {
|
21065 | 'function': 'function'
|
21066 | },
|
21067 | zValueLabel: {
|
21068 | 'function': 'function'
|
21069 | },
|
21070 | valueMax: {
|
21071 | number: number,
|
21072 | 'undefined': 'undefined'
|
21073 | },
|
21074 | valueMin: {
|
21075 | number: number,
|
21076 | 'undefined': 'undefined'
|
21077 | },
|
21078 | verticalRatio: {
|
21079 | number: number
|
21080 | },
|
21081 |
|
21082 | height: {
|
21083 | string: string
|
21084 | },
|
21085 | width: {
|
21086 | string: string
|
21087 | },
|
21088 | __type__: {
|
21089 | object: object
|
21090 | }
|
21091 | };
|
21092 |
|
21093 | var options = Object.freeze({
|
21094 | allOptions: allOptions$1
|
21095 | });
|
21096 |
|
21097 |
|
21098 |
|
21099 |
|
21100 |
|
21101 |
|
21102 |
|
21103 |
|
21104 |
|
21105 |
|
21106 | function Range() {
|
21107 | this.min = undefined;
|
21108 | this.max = undefined;
|
21109 | }
|
21110 |
|
21111 |
|
21112 |
|
21113 |
|
21114 |
|
21115 |
|
21116 |
|
21117 |
|
21118 |
|
21119 |
|
21120 | Range.prototype.adjust = function (value) {
|
21121 | if (value === undefined) return;
|
21122 |
|
21123 | if (this.min === undefined || this.min > value) {
|
21124 | this.min = value;
|
21125 | }
|
21126 |
|
21127 | if (this.max === undefined || this.max < value) {
|
21128 | this.max = value;
|
21129 | }
|
21130 | };
|
21131 |
|
21132 |
|
21133 |
|
21134 |
|
21135 |
|
21136 |
|
21137 |
|
21138 | Range.prototype.combine = function (range) {
|
21139 | this.add(range.min);
|
21140 | this.add(range.max);
|
21141 | };
|
21142 |
|
21143 |
|
21144 |
|
21145 |
|
21146 |
|
21147 |
|
21148 |
|
21149 |
|
21150 |
|
21151 |
|
21152 |
|
21153 |
|
21154 | Range.prototype.expand = function (val) {
|
21155 | if (val === undefined) {
|
21156 | return;
|
21157 | }
|
21158 |
|
21159 | var newMin = this.min - val;
|
21160 | var newMax = this.max + val;
|
21161 |
|
21162 |
|
21163 | if (newMin > newMax) {
|
21164 | throw new Error('Passed expansion value makes range invalid');
|
21165 | }
|
21166 |
|
21167 | this.min = newMin;
|
21168 | this.max = newMax;
|
21169 | };
|
21170 |
|
21171 |
|
21172 |
|
21173 |
|
21174 |
|
21175 |
|
21176 |
|
21177 | Range.prototype.range = function () {
|
21178 | return this.max - this.min;
|
21179 | };
|
21180 |
|
21181 |
|
21182 |
|
21183 |
|
21184 |
|
21185 |
|
21186 |
|
21187 | Range.prototype.center = function () {
|
21188 | return (this.min + this.max) / 2;
|
21189 | };
|
21190 |
|
21191 | var Range_1 = Range;
|
21192 |
|
21193 | var DataView$1 = index.DataView;
|
21194 |
|
21195 |
|
21196 |
|
21197 |
|
21198 |
|
21199 |
|
21200 |
|
21201 |
|
21202 | function Filter(dataGroup, column, graph) {
|
21203 | this.dataGroup = dataGroup;
|
21204 | this.column = column;
|
21205 | this.graph = graph;
|
21206 |
|
21207 | this.index = undefined;
|
21208 | this.value = undefined;
|
21209 |
|
21210 | this.values = dataGroup.getDistinctValues(this.column);
|
21211 |
|
21212 | if (this.values.length > 0) {
|
21213 | this.selectValue(0);
|
21214 | }
|
21215 |
|
21216 |
|
21217 | this.dataPoints = [];
|
21218 | this.loaded = false;
|
21219 | this.onLoadCallback = undefined;
|
21220 |
|
21221 | if (graph.animationPreload) {
|
21222 | this.loaded = false;
|
21223 | this.loadInBackground();
|
21224 | } else {
|
21225 | this.loaded = true;
|
21226 | }
|
21227 | }
|
21228 |
|
21229 |
|
21230 |
|
21231 |
|
21232 |
|
21233 |
|
21234 | Filter.prototype.isLoaded = function () {
|
21235 | return this.loaded;
|
21236 | };
|
21237 |
|
21238 |
|
21239 |
|
21240 |
|
21241 |
|
21242 |
|
21243 | Filter.prototype.getLoadedProgress = function () {
|
21244 | var len = this.values.length;
|
21245 | var i = 0;
|
21246 |
|
21247 | while (this.dataPoints[i]) {
|
21248 | i++;
|
21249 | }
|
21250 |
|
21251 | return Math.round(i / len * 100);
|
21252 | };
|
21253 |
|
21254 |
|
21255 |
|
21256 |
|
21257 |
|
21258 |
|
21259 | Filter.prototype.getLabel = function () {
|
21260 | return this.graph.filterLabel;
|
21261 | };
|
21262 |
|
21263 |
|
21264 |
|
21265 |
|
21266 |
|
21267 |
|
21268 | Filter.prototype.getColumn = function () {
|
21269 | return this.column;
|
21270 | };
|
21271 |
|
21272 |
|
21273 |
|
21274 |
|
21275 |
|
21276 |
|
21277 | Filter.prototype.getSelectedValue = function () {
|
21278 | if (this.index === undefined) return undefined;
|
21279 | return this.values[this.index];
|
21280 | };
|
21281 |
|
21282 |
|
21283 |
|
21284 |
|
21285 |
|
21286 |
|
21287 | Filter.prototype.getValues = function () {
|
21288 | return this.values;
|
21289 | };
|
21290 |
|
21291 |
|
21292 |
|
21293 |
|
21294 |
|
21295 |
|
21296 |
|
21297 | Filter.prototype.getValue = function (index) {
|
21298 | if (index >= this.values.length) throw new Error('Index out of range');
|
21299 | return this.values[index];
|
21300 | };
|
21301 |
|
21302 |
|
21303 |
|
21304 |
|
21305 |
|
21306 |
|
21307 |
|
21308 | Filter.prototype._getDataPoints = function (index) {
|
21309 | if (index === undefined) index = this.index;
|
21310 | if (index === undefined) return [];
|
21311 | var dataPoints;
|
21312 |
|
21313 | if (this.dataPoints[index]) {
|
21314 | dataPoints = this.dataPoints[index];
|
21315 | } else {
|
21316 | var f = {};
|
21317 | f.column = this.column;
|
21318 | f.value = this.values[index];
|
21319 | var dataView = new DataView$1(this.dataGroup.getDataSet(), {
|
21320 | filter: function filter(item) {
|
21321 | return item[f.column] == f.value;
|
21322 | }
|
21323 | }).get();
|
21324 | dataPoints = this.dataGroup._getDataPoints(dataView);
|
21325 | this.dataPoints[index] = dataPoints;
|
21326 | }
|
21327 |
|
21328 | return dataPoints;
|
21329 | };
|
21330 |
|
21331 |
|
21332 |
|
21333 |
|
21334 |
|
21335 |
|
21336 |
|
21337 | Filter.prototype.setOnLoadCallback = function (callback) {
|
21338 | this.onLoadCallback = callback;
|
21339 | };
|
21340 |
|
21341 |
|
21342 |
|
21343 |
|
21344 |
|
21345 |
|
21346 |
|
21347 | Filter.prototype.selectValue = function (index) {
|
21348 | if (index >= this.values.length) throw new Error('Index out of range');
|
21349 | this.index = index;
|
21350 | this.value = this.values[index];
|
21351 | };
|
21352 |
|
21353 |
|
21354 |
|
21355 |
|
21356 |
|
21357 |
|
21358 |
|
21359 |
|
21360 | Filter.prototype.loadInBackground = function (index) {
|
21361 | if (index === undefined) index = 0;
|
21362 | var frame = this.graph.frame;
|
21363 |
|
21364 | if (index < this.values.length) {
|
21365 |
|
21366 | if (frame.progress === undefined) {
|
21367 | frame.progress = document.createElement('DIV');
|
21368 | frame.progress.style.position = 'absolute';
|
21369 | frame.progress.style.color = 'gray';
|
21370 | frame.appendChild(frame.progress);
|
21371 | }
|
21372 |
|
21373 | var progress = this.getLoadedProgress();
|
21374 | frame.progress.innerHTML = 'Loading animation... ' + progress + '%';
|
21375 |
|
21376 | frame.progress.style.bottom = 60 + 'px';
|
21377 |
|
21378 | frame.progress.style.left = 10 + 'px';
|
21379 | var me = this;
|
21380 | setTimeout(function () {
|
21381 | me.loadInBackground(index + 1);
|
21382 | }, 10);
|
21383 | this.loaded = false;
|
21384 | } else {
|
21385 | this.loaded = true;
|
21386 |
|
21387 | if (frame.progress !== undefined) {
|
21388 | frame.removeChild(frame.progress);
|
21389 | frame.progress = undefined;
|
21390 | }
|
21391 |
|
21392 | if (this.onLoadCallback) this.onLoadCallback();
|
21393 | }
|
21394 | };
|
21395 |
|
21396 | var Filter_1 = Filter;
|
21397 |
|
21398 | var DataSet$1 = index.DataSet;
|
21399 | var DataView$2 = index.DataView;
|
21400 |
|
21401 |
|
21402 |
|
21403 |
|
21404 |
|
21405 |
|
21406 |
|
21407 |
|
21408 |
|
21409 |
|
21410 |
|
21411 |
|
21412 |
|
21413 | function DataGroup() {
|
21414 | this.dataTable = null;
|
21415 | }
|
21416 |
|
21417 |
|
21418 |
|
21419 |
|
21420 |
|
21421 |
|
21422 |
|
21423 |
|
21424 |
|
21425 |
|
21426 |
|
21427 |
|
21428 |
|
21429 |
|
21430 |
|
21431 |
|
21432 |
|
21433 | DataGroup.prototype.initializeData = function (graph3d, rawData, style) {
|
21434 | if (rawData === undefined) return;
|
21435 |
|
21436 | if (Array.isArray(rawData)) {
|
21437 | rawData = new DataSet$1(rawData);
|
21438 | }
|
21439 |
|
21440 | var data;
|
21441 |
|
21442 | if (rawData instanceof DataSet$1 || rawData instanceof DataView$2) {
|
21443 | data = rawData.get();
|
21444 | } else {
|
21445 | throw new Error('Array, DataSet, or DataView expected');
|
21446 | }
|
21447 |
|
21448 | if (data.length == 0) return;
|
21449 | this.style = style;
|
21450 |
|
21451 | if (this.dataSet) {
|
21452 | this.dataSet.off('*', this._onChange);
|
21453 | }
|
21454 |
|
21455 | this.dataSet = rawData;
|
21456 | this.dataTable = data;
|
21457 |
|
21458 | var me = this;
|
21459 |
|
21460 | this._onChange = function () {
|
21461 | graph3d.setData(me.dataSet);
|
21462 | };
|
21463 |
|
21464 | this.dataSet.on('*', this._onChange);
|
21465 |
|
21466 | this.colX = 'x';
|
21467 | this.colY = 'y';
|
21468 | this.colZ = 'z';
|
21469 | var withBars = graph3d.hasBars(style);
|
21470 |
|
21471 | if (withBars) {
|
21472 | if (graph3d.defaultXBarWidth !== undefined) {
|
21473 | this.xBarWidth = graph3d.defaultXBarWidth;
|
21474 | } else {
|
21475 | this.xBarWidth = this.getSmallestDifference(data, this.colX) || 1;
|
21476 | }
|
21477 |
|
21478 | if (graph3d.defaultYBarWidth !== undefined) {
|
21479 | this.yBarWidth = graph3d.defaultYBarWidth;
|
21480 | } else {
|
21481 | this.yBarWidth = this.getSmallestDifference(data, this.colY) || 1;
|
21482 | }
|
21483 | }
|
21484 |
|
21485 |
|
21486 | this._initializeRange(data, this.colX, graph3d, withBars);
|
21487 |
|
21488 | this._initializeRange(data, this.colY, graph3d, withBars);
|
21489 |
|
21490 | this._initializeRange(data, this.colZ, graph3d, false);
|
21491 |
|
21492 | if (data[0].hasOwnProperty('style')) {
|
21493 | this.colValue = 'style';
|
21494 | var valueRange = this.getColumnRange(data, this.colValue);
|
21495 |
|
21496 | this._setRangeDefaults(valueRange, graph3d.defaultValueMin, graph3d.defaultValueMax);
|
21497 |
|
21498 | this.valueRange = valueRange;
|
21499 | }
|
21500 |
|
21501 |
|
21502 | var table = this.getDataTable();
|
21503 |
|
21504 | if (table[0].hasOwnProperty('filter')) {
|
21505 | if (this.dataFilter === undefined) {
|
21506 | this.dataFilter = new Filter_1(this, 'filter', graph3d);
|
21507 | this.dataFilter.setOnLoadCallback(function () {
|
21508 | graph3d.redraw();
|
21509 | });
|
21510 | }
|
21511 | }
|
21512 |
|
21513 | var dataPoints;
|
21514 |
|
21515 | if (this.dataFilter) {
|
21516 |
|
21517 | dataPoints = this.dataFilter._getDataPoints();
|
21518 | } else {
|
21519 |
|
21520 | dataPoints = this._getDataPoints(this.getDataTable());
|
21521 | }
|
21522 |
|
21523 | return dataPoints;
|
21524 | };
|
21525 |
|
21526 |
|
21527 |
|
21528 |
|
21529 |
|
21530 |
|
21531 |
|
21532 |
|
21533 |
|
21534 |
|
21535 |
|
21536 |
|
21537 |
|
21538 |
|
21539 |
|
21540 |
|
21541 |
|
21542 | DataGroup.prototype._collectRangeSettings = function (column, graph3d) {
|
21543 | var index = ['x', 'y', 'z'].indexOf(column);
|
21544 |
|
21545 | if (index == -1) {
|
21546 | throw new Error('Column \'' + column + '\' invalid');
|
21547 | }
|
21548 |
|
21549 | var upper = column.toUpperCase();
|
21550 | return {
|
21551 | barWidth: this[column + 'BarWidth'],
|
21552 | min: graph3d['default' + upper + 'Min'],
|
21553 | max: graph3d['default' + upper + 'Max'],
|
21554 | step: graph3d['default' + upper + 'Step'],
|
21555 | range_label: column + 'Range',
|
21556 |
|
21557 | step_label: column + 'Step'
|
21558 |
|
21559 | };
|
21560 | };
|
21561 |
|
21562 |
|
21563 |
|
21564 |
|
21565 |
|
21566 |
|
21567 |
|
21568 |
|
21569 |
|
21570 |
|
21571 |
|
21572 |
|
21573 |
|
21574 |
|
21575 |
|
21576 | DataGroup.prototype._initializeRange = function (data, column, graph3d, withBars) {
|
21577 | var NUMSTEPS = 5;
|
21578 |
|
21579 | var settings = this._collectRangeSettings(column, graph3d);
|
21580 |
|
21581 | var range = this.getColumnRange(data, column);
|
21582 |
|
21583 | if (withBars && column != 'z') {
|
21584 |
|
21585 | range.expand(settings.barWidth / 2);
|
21586 | }
|
21587 |
|
21588 | this._setRangeDefaults(range, settings.min, settings.max);
|
21589 |
|
21590 | this[settings.range_label] = range;
|
21591 | this[settings.step_label] = settings.step !== undefined ? settings.step : range.range() / NUMSTEPS;
|
21592 | };
|
21593 |
|
21594 |
|
21595 |
|
21596 |
|
21597 |
|
21598 |
|
21599 |
|
21600 |
|
21601 |
|
21602 |
|
21603 |
|
21604 |
|
21605 | DataGroup.prototype.getDistinctValues = function (column, data) {
|
21606 | if (data === undefined) {
|
21607 | data = this.dataTable;
|
21608 | }
|
21609 |
|
21610 | var values = [];
|
21611 |
|
21612 | for (var i = 0; i < data.length; i++) {
|
21613 | var value = data[i][column] || 0;
|
21614 |
|
21615 | if (values.indexOf(value) === -1) {
|
21616 | values.push(value);
|
21617 | }
|
21618 | }
|
21619 |
|
21620 | return values.sort(function (a, b) {
|
21621 | return a - b;
|
21622 | });
|
21623 | };
|
21624 |
|
21625 |
|
21626 |
|
21627 |
|
21628 |
|
21629 |
|
21630 |
|
21631 |
|
21632 |
|
21633 |
|
21634 |
|
21635 |
|
21636 | DataGroup.prototype.getSmallestDifference = function (data, column) {
|
21637 | var values = this.getDistinctValues(data, column);
|
21638 |
|
21639 |
|
21640 | var smallest_diff = null;
|
21641 |
|
21642 | for (var i = 1; i < values.length; i++) {
|
21643 | var diff = values[i] - values[i - 1];
|
21644 |
|
21645 | if (smallest_diff == null || smallest_diff > diff) {
|
21646 | smallest_diff = diff;
|
21647 | }
|
21648 | }
|
21649 |
|
21650 | return smallest_diff;
|
21651 | };
|
21652 |
|
21653 |
|
21654 |
|
21655 |
|
21656 |
|
21657 |
|
21658 |
|
21659 |
|
21660 |
|
21661 |
|
21662 | DataGroup.prototype.getColumnRange = function (data, column) {
|
21663 | var range = new Range_1();
|
21664 |
|
21665 | for (var i = 0; i < data.length; i++) {
|
21666 | var item = data[i][column];
|
21667 | range.adjust(item);
|
21668 | }
|
21669 |
|
21670 | return range;
|
21671 | };
|
21672 |
|
21673 |
|
21674 |
|
21675 |
|
21676 |
|
21677 |
|
21678 |
|
21679 | DataGroup.prototype.getNumberOfRows = function () {
|
21680 | return this.dataTable.length;
|
21681 | };
|
21682 |
|
21683 |
|
21684 |
|
21685 |
|
21686 |
|
21687 |
|
21688 |
|
21689 |
|
21690 |
|
21691 |
|
21692 |
|
21693 |
|
21694 |
|
21695 |
|
21696 |
|
21697 |
|
21698 | DataGroup.prototype._setRangeDefaults = function (range, defaultMin, defaultMax) {
|
21699 | if (defaultMin !== undefined) {
|
21700 | range.min = defaultMin;
|
21701 | }
|
21702 |
|
21703 | if (defaultMax !== undefined) {
|
21704 | range.max = defaultMax;
|
21705 | }
|
21706 |
|
21707 |
|
21708 |
|
21709 |
|
21710 | if (range.max <= range.min) range.max = range.min + 1;
|
21711 | };
|
21712 |
|
21713 | DataGroup.prototype.getDataTable = function () {
|
21714 | return this.dataTable;
|
21715 | };
|
21716 |
|
21717 | DataGroup.prototype.getDataSet = function () {
|
21718 | return this.dataSet;
|
21719 | };
|
21720 |
|
21721 |
|
21722 |
|
21723 |
|
21724 |
|
21725 |
|
21726 |
|
21727 | DataGroup.prototype.getDataPoints = function (data) {
|
21728 | var dataPoints = [];
|
21729 |
|
21730 | for (var i = 0; i < data.length; i++) {
|
21731 | var point = new Point3d_1();
|
21732 | point.x = data[i][this.colX] || 0;
|
21733 | point.y = data[i][this.colY] || 0;
|
21734 | point.z = data[i][this.colZ] || 0;
|
21735 | point.data = data[i];
|
21736 |
|
21737 | if (this.colValue !== undefined) {
|
21738 | point.value = data[i][this.colValue] || 0;
|
21739 | }
|
21740 |
|
21741 | var obj = {};
|
21742 | obj.point = point;
|
21743 | obj.bottom = new Point3d_1(point.x, point.y, this.zRange.min);
|
21744 | obj.trans = undefined;
|
21745 | obj.screen = undefined;
|
21746 | dataPoints.push(obj);
|
21747 | }
|
21748 |
|
21749 | return dataPoints;
|
21750 | };
|
21751 |
|
21752 |
|
21753 |
|
21754 |
|
21755 |
|
21756 |
|
21757 |
|
21758 |
|
21759 |
|
21760 |
|
21761 | DataGroup.prototype.initDataAsMatrix = function (data) {
|
21762 |
|
21763 |
|
21764 | var x, y, i, obj;
|
21765 |
|
21766 | var dataX = this.getDistinctValues(this.colX, data);
|
21767 | var dataY = this.getDistinctValues(this.colY, data);
|
21768 | var dataPoints = this.getDataPoints(data);
|
21769 |
|
21770 | var dataMatrix = [];
|
21771 |
|
21772 | for (i = 0; i < dataPoints.length; i++) {
|
21773 | obj = dataPoints[i];
|
21774 |
|
21775 | var xIndex = dataX.indexOf(obj.point.x);
|
21776 | var yIndex = dataY.indexOf(obj.point.y);
|
21777 |
|
21778 | if (dataMatrix[xIndex] === undefined) {
|
21779 | dataMatrix[xIndex] = [];
|
21780 | }
|
21781 |
|
21782 | dataMatrix[xIndex][yIndex] = obj;
|
21783 | }
|
21784 |
|
21785 |
|
21786 | for (x = 0; x < dataMatrix.length; x++) {
|
21787 | for (y = 0; y < dataMatrix[x].length; y++) {
|
21788 | if (dataMatrix[x][y]) {
|
21789 | dataMatrix[x][y].pointRight = x < dataMatrix.length - 1 ? dataMatrix[x + 1][y] : undefined;
|
21790 | dataMatrix[x][y].pointTop = y < dataMatrix[x].length - 1 ? dataMatrix[x][y + 1] : undefined;
|
21791 | dataMatrix[x][y].pointCross = x < dataMatrix.length - 1 && y < dataMatrix[x].length - 1 ? dataMatrix[x + 1][y + 1] : undefined;
|
21792 | }
|
21793 | }
|
21794 | }
|
21795 |
|
21796 | return dataPoints;
|
21797 | };
|
21798 |
|
21799 |
|
21800 |
|
21801 |
|
21802 |
|
21803 |
|
21804 |
|
21805 | DataGroup.prototype.getInfo = function () {
|
21806 | var dataFilter = this.dataFilter;
|
21807 | if (!dataFilter) return undefined;
|
21808 | return dataFilter.getLabel() + ': ' + dataFilter.getSelectedValue();
|
21809 | };
|
21810 |
|
21811 |
|
21812 |
|
21813 |
|
21814 |
|
21815 | DataGroup.prototype.reload = function () {
|
21816 | if (this.dataTable) {
|
21817 | this.setData(this.dataTable);
|
21818 | }
|
21819 | };
|
21820 |
|
21821 |
|
21822 |
|
21823 |
|
21824 |
|
21825 |
|
21826 |
|
21827 |
|
21828 |
|
21829 | DataGroup.prototype._getDataPoints = function (data) {
|
21830 | var dataPoints = [];
|
21831 |
|
21832 | if (this.style === Settings.STYLE.GRID || this.style === Settings.STYLE.SURFACE) {
|
21833 | dataPoints = this.initDataAsMatrix(data);
|
21834 | } else {
|
21835 |
|
21836 | this._checkValueField(data);
|
21837 |
|
21838 | dataPoints = this.getDataPoints(data);
|
21839 |
|
21840 | if (this.style === Settings.STYLE.LINE) {
|
21841 |
|
21842 | for (var i = 0; i < dataPoints.length; i++) {
|
21843 | if (i > 0) {
|
21844 | dataPoints[i - 1].pointNext = dataPoints[i];
|
21845 | }
|
21846 | }
|
21847 | }
|
21848 | }
|
21849 |
|
21850 | return dataPoints;
|
21851 | };
|
21852 |
|
21853 |
|
21854 |
|
21855 |
|
21856 |
|
21857 |
|
21858 |
|
21859 |
|
21860 |
|
21861 |
|
21862 | DataGroup.prototype._checkValueField = function (data) {
|
21863 | var hasValueField = this.style === Settings.STYLE.BARCOLOR || this.style === Settings.STYLE.BARSIZE || this.style === Settings.STYLE.DOTCOLOR || this.style === Settings.STYLE.DOTSIZE;
|
21864 |
|
21865 | if (!hasValueField) {
|
21866 | return;
|
21867 | }
|
21868 |
|
21869 |
|
21870 | if (this.colValue === undefined) {
|
21871 | throw new Error('Expected data to have ' + ' field \'style\' ' + ' for graph style \'' + this.style + '\'');
|
21872 | }
|
21873 |
|
21874 |
|
21875 |
|
21876 | if (data[0][this.colValue] === undefined) {
|
21877 | throw new Error('Expected data to have ' + ' field \'' + this.colValue + '\' ' + ' for graph style \'' + this.style + '\'');
|
21878 | }
|
21879 | };
|
21880 |
|
21881 | var DataGroup_1 = DataGroup;
|
21882 |
|
21883 | var Validator$2 = Validator$1.Validator;
|
21884 | var printStyle$1 = Validator$1.printStyle;
|
21885 | var allOptions$2 = options.allOptions;
|
21886 |
|
21887 | Graph3d.STYLE = Settings.STYLE;
|
21888 |
|
21889 |
|
21890 |
|
21891 |
|
21892 |
|
21893 |
|
21894 |
|
21895 |
|
21896 | var autoByDefault = undefined;
|
21897 |
|
21898 |
|
21899 |
|
21900 |
|
21901 |
|
21902 |
|
21903 |
|
21904 |
|
21905 |
|
21906 |
|
21907 | Graph3d.DEFAULTS = {
|
21908 | width: '400px',
|
21909 | height: '400px',
|
21910 | filterLabel: 'time',
|
21911 | legendLabel: 'value',
|
21912 | xLabel: 'x',
|
21913 | yLabel: 'y',
|
21914 | zLabel: 'z',
|
21915 | xValueLabel: function xValueLabel(v) {
|
21916 | return v;
|
21917 | },
|
21918 | yValueLabel: function yValueLabel(v) {
|
21919 | return v;
|
21920 | },
|
21921 | zValueLabel: function zValueLabel(v) {
|
21922 | return v;
|
21923 | },
|
21924 | showXAxis: true,
|
21925 | showYAxis: true,
|
21926 | showZAxis: true,
|
21927 | showGrid: true,
|
21928 | showPerspective: true,
|
21929 | showShadow: false,
|
21930 | keepAspectRatio: true,
|
21931 | rotateAxisLabels: true,
|
21932 | verticalRatio: 0.5,
|
21933 |
|
21934 | dotSizeRatio: 0.02,
|
21935 |
|
21936 | dotSizeMinFraction: 0.5,
|
21937 |
|
21938 | dotSizeMaxFraction: 2.5,
|
21939 |
|
21940 | showAnimationControls: autoByDefault,
|
21941 | animationInterval: 1000,
|
21942 |
|
21943 | animationPreload: false,
|
21944 | animationAutoStart: autoByDefault,
|
21945 | axisFontSize: 14,
|
21946 | axisFontType: 'arial',
|
21947 | axisColor: '#4D4D4D',
|
21948 | gridColor: '#D3D3D3',
|
21949 | xCenter: '55%',
|
21950 | yCenter: '50%',
|
21951 | style: Graph3d.STYLE.DOT,
|
21952 | tooltip: false,
|
21953 | tooltipDelay: 300,
|
21954 |
|
21955 | tooltipStyle: {
|
21956 | content: {
|
21957 | padding: '10px',
|
21958 | border: '1px solid #4d4d4d',
|
21959 | color: '#1a1a1a',
|
21960 | background: 'rgba(255,255,255,0.7)',
|
21961 | borderRadius: '2px',
|
21962 | boxShadow: '5px 5px 10px rgba(128,128,128,0.5)'
|
21963 | },
|
21964 | line: {
|
21965 | height: '40px',
|
21966 | width: '0',
|
21967 | borderLeft: '1px solid #4d4d4d',
|
21968 | pointerEvents: 'none'
|
21969 | },
|
21970 | dot: {
|
21971 | height: '0',
|
21972 | width: '0',
|
21973 | border: '5px solid #4d4d4d',
|
21974 | borderRadius: '5px',
|
21975 | pointerEvents: 'none'
|
21976 | }
|
21977 | },
|
21978 | dataColor: {
|
21979 | fill: '#7DC1FF',
|
21980 | stroke: '#3267D2',
|
21981 | strokeWidth: 1
|
21982 |
|
21983 | },
|
21984 | cameraPosition: {
|
21985 | horizontal: 1.0,
|
21986 | vertical: 0.5,
|
21987 | distance: 1.7
|
21988 | },
|
21989 | zoomable: true,
|
21990 | ctrlToZoom: false,
|
21991 |
|
21992 | |
21993 |
|
21994 |
|
21995 | showLegend: autoByDefault,
|
21996 |
|
21997 | backgroundColor: autoByDefault,
|
21998 | xBarWidth: autoByDefault,
|
21999 | yBarWidth: autoByDefault,
|
22000 | valueMin: autoByDefault,
|
22001 | valueMax: autoByDefault,
|
22002 | xMin: autoByDefault,
|
22003 | xMax: autoByDefault,
|
22004 | xStep: autoByDefault,
|
22005 | yMin: autoByDefault,
|
22006 | yMax: autoByDefault,
|
22007 | yStep: autoByDefault,
|
22008 | zMin: autoByDefault,
|
22009 | zMax: autoByDefault,
|
22010 | zStep: autoByDefault
|
22011 | };
|
22012 |
|
22013 |
|
22014 |
|
22015 |
|
22016 |
|
22017 |
|
22018 |
|
22019 |
|
22020 |
|
22021 |
|
22022 |
|
22023 |
|
22024 |
|
22025 |
|
22026 |
|
22027 | function Graph3d(container, data, options) {
|
22028 | if (!(this instanceof Graph3d)) {
|
22029 | throw new SyntaxError('Constructor must be called with the new operator');
|
22030 | }
|
22031 |
|
22032 |
|
22033 | this.containerElement = container;
|
22034 | this.dataGroup = new DataGroup_1();
|
22035 | this.dataPoints = null;
|
22036 |
|
22037 |
|
22038 | this.create();
|
22039 | Settings.setDefaults(Graph3d.DEFAULTS, this);
|
22040 |
|
22041 | this.colX = undefined;
|
22042 | this.colY = undefined;
|
22043 | this.colZ = undefined;
|
22044 | this.colValue = undefined;
|
22045 |
|
22046 |
|
22047 | this.setOptions(options);
|
22048 |
|
22049 | this.setData(data);
|
22050 | }
|
22051 |
|
22052 |
|
22053 | emitterComponent(Graph3d.prototype);
|
22054 |
|
22055 |
|
22056 |
|
22057 |
|
22058 | Graph3d.prototype._setScale = function () {
|
22059 | this.scale = new Point3d_1(1 / this.xRange.range(), 1 / this.yRange.range(), 1 / this.zRange.range());
|
22060 |
|
22061 | if (this.keepAspectRatio) {
|
22062 | if (this.scale.x < this.scale.y) {
|
22063 |
|
22064 | this.scale.y = this.scale.x;
|
22065 | } else {
|
22066 |
|
22067 | this.scale.x = this.scale.y;
|
22068 | }
|
22069 | }
|
22070 |
|
22071 |
|
22072 | this.scale.z *= this.verticalRatio;
|
22073 |
|
22074 |
|
22075 | if (this.valueRange !== undefined) {
|
22076 | this.scale.value = 1 / this.valueRange.range();
|
22077 | }
|
22078 |
|
22079 |
|
22080 | var xCenter = this.xRange.center() * this.scale.x;
|
22081 | var yCenter = this.yRange.center() * this.scale.y;
|
22082 | var zCenter = this.zRange.center() * this.scale.z;
|
22083 | this.camera.setArmLocation(xCenter, yCenter, zCenter);
|
22084 | };
|
22085 |
|
22086 |
|
22087 |
|
22088 |
|
22089 |
|
22090 |
|
22091 |
|
22092 |
|
22093 |
|
22094 | Graph3d.prototype._convert3Dto2D = function (point3d) {
|
22095 | var translation = this._convertPointToTranslation(point3d);
|
22096 |
|
22097 | return this._convertTranslationToScreen(translation);
|
22098 | };
|
22099 |
|
22100 |
|
22101 |
|
22102 |
|
22103 |
|
22104 |
|
22105 |
|
22106 |
|
22107 |
|
22108 |
|
22109 |
|
22110 | Graph3d.prototype._convertPointToTranslation = function (point3d) {
|
22111 | var cameraLocation = this.camera.getCameraLocation(),
|
22112 | cameraRotation = this.camera.getCameraRotation(),
|
22113 | ax = point3d.x * this.scale.x,
|
22114 | ay = point3d.y * this.scale.y,
|
22115 | az = point3d.z * this.scale.z,
|
22116 | cx = cameraLocation.x,
|
22117 | cy = cameraLocation.y,
|
22118 | cz = cameraLocation.z,
|
22119 |
|
22120 | sinTx = Math.sin(cameraRotation.x),
|
22121 | cosTx = Math.cos(cameraRotation.x),
|
22122 | sinTy = Math.sin(cameraRotation.y),
|
22123 | cosTy = Math.cos(cameraRotation.y),
|
22124 | sinTz = Math.sin(cameraRotation.z),
|
22125 | cosTz = Math.cos(cameraRotation.z),
|
22126 |
|
22127 | dx = cosTy * (sinTz * (ay - cy) + cosTz * (ax - cx)) - sinTy * (az - cz),
|
22128 | dy = sinTx * (cosTy * (az - cz) + sinTy * (sinTz * (ay - cy) + cosTz * (ax - cx))) + cosTx * (cosTz * (ay - cy) - sinTz * (ax - cx)),
|
22129 | dz = cosTx * (cosTy * (az - cz) + sinTy * (sinTz * (ay - cy) + cosTz * (ax - cx))) - sinTx * (cosTz * (ay - cy) - sinTz * (ax - cx));
|
22130 | return new Point3d_1(dx, dy, dz);
|
22131 | };
|
22132 |
|
22133 |
|
22134 |
|
22135 |
|
22136 |
|
22137 |
|
22138 |
|
22139 |
|
22140 |
|
22141 |
|
22142 | Graph3d.prototype._convertTranslationToScreen = function (translation) {
|
22143 | var ex = this.eye.x,
|
22144 | ey = this.eye.y,
|
22145 | ez = this.eye.z,
|
22146 | dx = translation.x,
|
22147 | dy = translation.y,
|
22148 | dz = translation.z;
|
22149 |
|
22150 | var bx;
|
22151 | var by;
|
22152 |
|
22153 | if (this.showPerspective) {
|
22154 | bx = (dx - ex) * (ez / dz);
|
22155 | by = (dy - ey) * (ez / dz);
|
22156 | } else {
|
22157 | bx = dx * -(ez / this.camera.getArmLength());
|
22158 | by = dy * -(ez / this.camera.getArmLength());
|
22159 | }
|
22160 |
|
22161 |
|
22162 |
|
22163 | return new Point2d_1(this.currentXCenter + bx * this.frame.canvas.clientWidth, this.currentYCenter - by * this.frame.canvas.clientWidth);
|
22164 | };
|
22165 |
|
22166 |
|
22167 |
|
22168 |
|
22169 |
|
22170 |
|
22171 |
|
22172 |
|
22173 | Graph3d.prototype._calcTranslations = function (points) {
|
22174 | for (var i = 0; i < points.length; i++) {
|
22175 | var point = points[i];
|
22176 | point.trans = this._convertPointToTranslation(point.point);
|
22177 | point.screen = this._convertTranslationToScreen(point.trans);
|
22178 |
|
22179 | var transBottom = this._convertPointToTranslation(point.bottom);
|
22180 |
|
22181 | point.dist = this.showPerspective ? transBottom.length() : -transBottom.z;
|
22182 | }
|
22183 |
|
22184 |
|
22185 | var sortDepth = function sortDepth(a, b) {
|
22186 | return b.dist - a.dist;
|
22187 | };
|
22188 |
|
22189 | points.sort(sortDepth);
|
22190 | };
|
22191 |
|
22192 |
|
22193 |
|
22194 |
|
22195 |
|
22196 | Graph3d.prototype._initializeRanges = function () {
|
22197 |
|
22198 | var dg = this.dataGroup;
|
22199 | this.xRange = dg.xRange;
|
22200 | this.yRange = dg.yRange;
|
22201 | this.zRange = dg.zRange;
|
22202 | this.valueRange = dg.valueRange;
|
22203 |
|
22204 |
|
22205 | this.xStep = dg.xStep;
|
22206 | this.yStep = dg.yStep;
|
22207 | this.zStep = dg.zStep;
|
22208 | this.xBarWidth = dg.xBarWidth;
|
22209 | this.yBarWidth = dg.yBarWidth;
|
22210 | this.colX = dg.colX;
|
22211 | this.colY = dg.colY;
|
22212 | this.colZ = dg.colZ;
|
22213 | this.colValue = dg.colValue;
|
22214 |
|
22215 | this._setScale();
|
22216 | };
|
22217 |
|
22218 |
|
22219 |
|
22220 |
|
22221 |
|
22222 |
|
22223 |
|
22224 |
|
22225 | Graph3d.prototype.getDataPoints = function (data) {
|
22226 | var dataPoints = [];
|
22227 |
|
22228 | for (var i = 0; i < data.length; i++) {
|
22229 | var point = new Point3d_1();
|
22230 | point.x = data[i][this.colX] || 0;
|
22231 | point.y = data[i][this.colY] || 0;
|
22232 | point.z = data[i][this.colZ] || 0;
|
22233 | point.data = data[i];
|
22234 |
|
22235 | if (this.colValue !== undefined) {
|
22236 | point.value = data[i][this.colValue] || 0;
|
22237 | }
|
22238 |
|
22239 | var obj = {};
|
22240 | obj.point = point;
|
22241 | obj.bottom = new Point3d_1(point.x, point.y, this.zRange.min);
|
22242 | obj.trans = undefined;
|
22243 | obj.screen = undefined;
|
22244 | dataPoints.push(obj);
|
22245 | }
|
22246 |
|
22247 | return dataPoints;
|
22248 | };
|
22249 |
|
22250 |
|
22251 |
|
22252 |
|
22253 |
|
22254 |
|
22255 |
|
22256 |
|
22257 |
|
22258 | Graph3d.prototype._getDataPoints = function (data) {
|
22259 |
|
22260 |
|
22261 | var x, y, i, obj;
|
22262 | var dataPoints = [];
|
22263 |
|
22264 | if (this.style === Graph3d.STYLE.GRID || this.style === Graph3d.STYLE.SURFACE) {
|
22265 |
|
22266 |
|
22267 |
|
22268 | var dataX = this.dataGroup.getDistinctValues(this.colX, data);
|
22269 | var dataY = this.dataGroup.getDistinctValues(this.colY, data);
|
22270 | dataPoints = this.getDataPoints(data);
|
22271 |
|
22272 | var dataMatrix = [];
|
22273 |
|
22274 | for (i = 0; i < dataPoints.length; i++) {
|
22275 | obj = dataPoints[i];
|
22276 |
|
22277 | var xIndex = dataX.indexOf(obj.point.x);
|
22278 | var yIndex = dataY.indexOf(obj.point.y);
|
22279 |
|
22280 | if (dataMatrix[xIndex] === undefined) {
|
22281 | dataMatrix[xIndex] = [];
|
22282 | }
|
22283 |
|
22284 | dataMatrix[xIndex][yIndex] = obj;
|
22285 | }
|
22286 |
|
22287 |
|
22288 | for (x = 0; x < dataMatrix.length; x++) {
|
22289 | for (y = 0; y < dataMatrix[x].length; y++) {
|
22290 | if (dataMatrix[x][y]) {
|
22291 | dataMatrix[x][y].pointRight = x < dataMatrix.length - 1 ? dataMatrix[x + 1][y] : undefined;
|
22292 | dataMatrix[x][y].pointTop = y < dataMatrix[x].length - 1 ? dataMatrix[x][y + 1] : undefined;
|
22293 | dataMatrix[x][y].pointCross = x < dataMatrix.length - 1 && y < dataMatrix[x].length - 1 ? dataMatrix[x + 1][y + 1] : undefined;
|
22294 | }
|
22295 | }
|
22296 | }
|
22297 | } else {
|
22298 |
|
22299 | this._checkValueField(data);
|
22300 |
|
22301 | dataPoints = this.getDataPoints(data);
|
22302 |
|
22303 | if (this.style === Graph3d.STYLE.LINE) {
|
22304 |
|
22305 | for (i = 0; i < dataPoints.length; i++) {
|
22306 | if (i > 0) {
|
22307 | dataPoints[i - 1].pointNext = dataPoints[i];
|
22308 | }
|
22309 | }
|
22310 | }
|
22311 | }
|
22312 |
|
22313 | return dataPoints;
|
22314 | };
|
22315 |
|
22316 |
|
22317 |
|
22318 |
|
22319 |
|
22320 |
|
22321 |
|
22322 |
|
22323 |
|
22324 | Graph3d.prototype.create = function () {
|
22325 |
|
22326 | while (this.containerElement.hasChildNodes()) {
|
22327 | this.containerElement.removeChild(this.containerElement.firstChild);
|
22328 | }
|
22329 |
|
22330 | this.frame = document.createElement('div');
|
22331 | this.frame.style.position = 'relative';
|
22332 | this.frame.style.overflow = 'hidden';
|
22333 |
|
22334 | this.frame.canvas = document.createElement('canvas');
|
22335 | this.frame.canvas.style.position = 'relative';
|
22336 | this.frame.appendChild(this.frame.canvas);
|
22337 |
|
22338 | {
|
22339 | var noCanvas = document.createElement('DIV');
|
22340 | noCanvas.style.color = 'red';
|
22341 | noCanvas.style.fontWeight = 'bold';
|
22342 | noCanvas.style.padding = '10px';
|
22343 | noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';
|
22344 | this.frame.canvas.appendChild(noCanvas);
|
22345 | }
|
22346 | this.frame.filter = document.createElement('div');
|
22347 | this.frame.filter.style.position = 'absolute';
|
22348 | this.frame.filter.style.bottom = '0px';
|
22349 | this.frame.filter.style.left = '0px';
|
22350 | this.frame.filter.style.width = '100%';
|
22351 | this.frame.appendChild(this.frame.filter);
|
22352 |
|
22353 | var me = this;
|
22354 |
|
22355 | var onmousedown = function onmousedown(event) {
|
22356 | me._onMouseDown(event);
|
22357 | };
|
22358 |
|
22359 | var ontouchstart = function ontouchstart(event) {
|
22360 | me._onTouchStart(event);
|
22361 | };
|
22362 |
|
22363 | var onmousewheel = function onmousewheel(event) {
|
22364 | me._onWheel(event);
|
22365 | };
|
22366 |
|
22367 | var ontooltip = function ontooltip(event) {
|
22368 | me._onTooltip(event);
|
22369 | };
|
22370 |
|
22371 | var onclick = function onclick(event) {
|
22372 | me._onClick(event);
|
22373 | };
|
22374 |
|
22375 |
|
22376 | util.addEventListener(this.frame.canvas, 'mousedown', onmousedown);
|
22377 | util.addEventListener(this.frame.canvas, 'touchstart', ontouchstart);
|
22378 | util.addEventListener(this.frame.canvas, 'mousewheel', onmousewheel);
|
22379 | util.addEventListener(this.frame.canvas, 'mousemove', ontooltip);
|
22380 | util.addEventListener(this.frame.canvas, 'click', onclick);
|
22381 |
|
22382 | this.containerElement.appendChild(this.frame);
|
22383 | };
|
22384 |
|
22385 |
|
22386 |
|
22387 |
|
22388 |
|
22389 |
|
22390 |
|
22391 |
|
22392 |
|
22393 | Graph3d.prototype._setSize = function (width, height) {
|
22394 | this.frame.style.width = width;
|
22395 | this.frame.style.height = height;
|
22396 |
|
22397 | this._resizeCanvas();
|
22398 | };
|
22399 |
|
22400 |
|
22401 |
|
22402 |
|
22403 |
|
22404 | Graph3d.prototype._resizeCanvas = function () {
|
22405 | this.frame.canvas.style.width = '100%';
|
22406 | this.frame.canvas.style.height = '100%';
|
22407 | this.frame.canvas.width = this.frame.canvas.clientWidth;
|
22408 | this.frame.canvas.height = this.frame.canvas.clientHeight;
|
22409 |
|
22410 | this.frame.filter.style.width = this.frame.canvas.clientWidth - 2 * 10 + 'px';
|
22411 | };
|
22412 |
|
22413 |
|
22414 |
|
22415 |
|
22416 |
|
22417 |
|
22418 | Graph3d.prototype.animationStart = function () {
|
22419 |
|
22420 | if (!this.animationAutoStart || !this.dataGroup.dataFilter) return;
|
22421 | if (!this.frame.filter || !this.frame.filter.slider) throw new Error('No animation available');
|
22422 | this.frame.filter.slider.play();
|
22423 | };
|
22424 |
|
22425 |
|
22426 |
|
22427 |
|
22428 |
|
22429 | Graph3d.prototype.animationStop = function () {
|
22430 | if (!this.frame.filter || !this.frame.filter.slider) return;
|
22431 | this.frame.filter.slider.stop();
|
22432 | };
|
22433 |
|
22434 |
|
22435 |
|
22436 |
|
22437 |
|
22438 |
|
22439 |
|
22440 |
|
22441 | Graph3d.prototype._resizeCenter = function () {
|
22442 |
|
22443 | if (this.xCenter.charAt(this.xCenter.length - 1) === '%') {
|
22444 | this.currentXCenter = parseFloat(this.xCenter) / 100 * this.frame.canvas.clientWidth;
|
22445 | } else {
|
22446 | this.currentXCenter = parseFloat(this.xCenter);
|
22447 | }
|
22448 |
|
22449 |
|
22450 | if (this.yCenter.charAt(this.yCenter.length - 1) === '%') {
|
22451 | this.currentYCenter = parseFloat(this.yCenter) / 100 * (this.frame.canvas.clientHeight - this.frame.filter.clientHeight);
|
22452 | } else {
|
22453 | this.currentYCenter = parseFloat(this.yCenter);
|
22454 | }
|
22455 | };
|
22456 |
|
22457 |
|
22458 |
|
22459 |
|
22460 |
|
22461 |
|
22462 |
|
22463 |
|
22464 | Graph3d.prototype.getCameraPosition = function () {
|
22465 | var pos = this.camera.getArmRotation();
|
22466 | pos.distance = this.camera.getArmLength();
|
22467 | return pos;
|
22468 | };
|
22469 |
|
22470 |
|
22471 |
|
22472 |
|
22473 |
|
22474 |
|
22475 |
|
22476 |
|
22477 | Graph3d.prototype._readData = function (data) {
|
22478 |
|
22479 | this.dataPoints = this.dataGroup.initializeData(this, data, this.style);
|
22480 |
|
22481 | this._initializeRanges();
|
22482 |
|
22483 | this._redrawFilter();
|
22484 | };
|
22485 |
|
22486 |
|
22487 |
|
22488 |
|
22489 |
|
22490 |
|
22491 |
|
22492 | Graph3d.prototype.setData = function (data) {
|
22493 | if (data === undefined || data === null) return;
|
22494 |
|
22495 | this._readData(data);
|
22496 |
|
22497 | this.redraw();
|
22498 | this.animationStart();
|
22499 | };
|
22500 |
|
22501 |
|
22502 |
|
22503 |
|
22504 |
|
22505 |
|
22506 |
|
22507 | Graph3d.prototype.setOptions = function (options) {
|
22508 | if (options === undefined) return;
|
22509 | var errorFound = Validator$2.validate(options, allOptions$2);
|
22510 |
|
22511 | if (errorFound === true) {
|
22512 | console.log('%cErrors have been found in the supplied options object.', printStyle$1);
|
22513 | }
|
22514 |
|
22515 | this.animationStop();
|
22516 | Settings.setOptions(options, this);
|
22517 | this.setPointDrawingMethod();
|
22518 |
|
22519 | this._setSize(this.width, this.height);
|
22520 |
|
22521 | this.setAxisLabelMethod();
|
22522 | this.setData(this.dataGroup.getDataTable());
|
22523 | this.animationStart();
|
22524 | };
|
22525 |
|
22526 |
|
22527 |
|
22528 |
|
22529 |
|
22530 | Graph3d.prototype.setPointDrawingMethod = function () {
|
22531 | var method = undefined;
|
22532 |
|
22533 | switch (this.style) {
|
22534 | case Graph3d.STYLE.BAR:
|
22535 | method = Graph3d.prototype._redrawBarGraphPoint;
|
22536 | break;
|
22537 |
|
22538 | case Graph3d.STYLE.BARCOLOR:
|
22539 | method = Graph3d.prototype._redrawBarColorGraphPoint;
|
22540 | break;
|
22541 |
|
22542 | case Graph3d.STYLE.BARSIZE:
|
22543 | method = Graph3d.prototype._redrawBarSizeGraphPoint;
|
22544 | break;
|
22545 |
|
22546 | case Graph3d.STYLE.DOT:
|
22547 | method = Graph3d.prototype._redrawDotGraphPoint;
|
22548 | break;
|
22549 |
|
22550 | case Graph3d.STYLE.DOTLINE:
|
22551 | method = Graph3d.prototype._redrawDotLineGraphPoint;
|
22552 | break;
|
22553 |
|
22554 | case Graph3d.STYLE.DOTCOLOR:
|
22555 | method = Graph3d.prototype._redrawDotColorGraphPoint;
|
22556 | break;
|
22557 |
|
22558 | case Graph3d.STYLE.DOTSIZE:
|
22559 | method = Graph3d.prototype._redrawDotSizeGraphPoint;
|
22560 | break;
|
22561 |
|
22562 | case Graph3d.STYLE.SURFACE:
|
22563 | method = Graph3d.prototype._redrawSurfaceGraphPoint;
|
22564 | break;
|
22565 |
|
22566 | case Graph3d.STYLE.GRID:
|
22567 | method = Graph3d.prototype._redrawGridGraphPoint;
|
22568 | break;
|
22569 |
|
22570 | case Graph3d.STYLE.LINE:
|
22571 | method = Graph3d.prototype._redrawLineGraphPoint;
|
22572 | break;
|
22573 |
|
22574 | default:
|
22575 | throw new Error('Can not determine point drawing method ' + 'for graph style \'' + this.style + '\'');
|
22576 | }
|
22577 |
|
22578 | this._pointDrawingMethod = method;
|
22579 | };
|
22580 |
|
22581 |
|
22582 |
|
22583 |
|
22584 |
|
22585 | Graph3d.prototype.setAxisLabelMethod = function () {
|
22586 | var method_x, method_y, method_z;
|
22587 | method_x = method_y = method_z = undefined;
|
22588 |
|
22589 | if (this.rotateAxisLabels == true) {
|
22590 | method_x = Graph3d.prototype.drawAxisLabelXRotate;
|
22591 | method_y = Graph3d.prototype.drawAxisLabelYRotate;
|
22592 | method_z = Graph3d.prototype.drawAxisLabelZRotate;
|
22593 | } else {
|
22594 | method_x = Graph3d.prototype.drawAxisLabelX;
|
22595 | method_y = Graph3d.prototype.drawAxisLabelY;
|
22596 | method_z = Graph3d.prototype.drawAxisLabelZ;
|
22597 | }
|
22598 |
|
22599 | this._drawAxisLabelX = method_x;
|
22600 | this._drawAxisLabelY = method_y;
|
22601 | this._drawAxisLabelZ = method_z;
|
22602 | };
|
22603 |
|
22604 |
|
22605 |
|
22606 |
|
22607 |
|
22608 | Graph3d.prototype.redraw = function () {
|
22609 | if (this.dataPoints === undefined) {
|
22610 | throw new Error('Graph data not initialized');
|
22611 | }
|
22612 |
|
22613 | this._resizeCanvas();
|
22614 |
|
22615 | this._resizeCenter();
|
22616 |
|
22617 | this._redrawSlider();
|
22618 |
|
22619 | this._redrawClear();
|
22620 |
|
22621 | this._redrawAxis();
|
22622 |
|
22623 | this._redrawDataGraph();
|
22624 |
|
22625 | this._redrawInfo();
|
22626 |
|
22627 | this._redrawLegend();
|
22628 | };
|
22629 |
|
22630 |
|
22631 |
|
22632 |
|
22633 |
|
22634 |
|
22635 |
|
22636 |
|
22637 | Graph3d.prototype._getContext = function () {
|
22638 | var canvas = this.frame.canvas;
|
22639 | var ctx = canvas.getContext('2d');
|
22640 | ctx.lineJoin = 'round';
|
22641 | ctx.lineCap = 'round';
|
22642 | return ctx;
|
22643 | };
|
22644 |
|
22645 |
|
22646 |
|
22647 |
|
22648 |
|
22649 | Graph3d.prototype._redrawClear = function () {
|
22650 | var canvas = this.frame.canvas;
|
22651 | var ctx = canvas.getContext('2d');
|
22652 | ctx.clearRect(0, 0, canvas.width, canvas.height);
|
22653 | };
|
22654 |
|
22655 | Graph3d.prototype._dotSize = function () {
|
22656 | return this.frame.clientWidth * this.dotSizeRatio;
|
22657 | };
|
22658 |
|
22659 |
|
22660 |
|
22661 |
|
22662 |
|
22663 |
|
22664 |
|
22665 |
|
22666 | Graph3d.prototype._getLegendWidth = function () {
|
22667 | var width;
|
22668 |
|
22669 | if (this.style === Graph3d.STYLE.DOTSIZE) {
|
22670 | var dotSize = this._dotSize();
|
22671 |
|
22672 |
|
22673 | width = dotSize * this.dotSizeMaxFraction;
|
22674 | } else if (this.style === Graph3d.STYLE.BARSIZE) {
|
22675 | width = this.xBarWidth;
|
22676 | } else {
|
22677 | width = 20;
|
22678 | }
|
22679 |
|
22680 | return width;
|
22681 | };
|
22682 |
|
22683 |
|
22684 |
|
22685 |
|
22686 |
|
22687 | Graph3d.prototype._redrawLegend = function () {
|
22688 |
|
22689 | if (this.showLegend !== true) {
|
22690 | return;
|
22691 | }
|
22692 |
|
22693 |
|
22694 | if (this.style === Graph3d.STYLE.LINE || this.style === Graph3d.STYLE.BARSIZE
|
22695 | ) {
|
22696 | return;
|
22697 | }
|
22698 |
|
22699 |
|
22700 | var isSizeLegend = this.style === Graph3d.STYLE.BARSIZE || this.style === Graph3d.STYLE.DOTSIZE;
|
22701 |
|
22702 | var isValueLegend = this.style === Graph3d.STYLE.DOTSIZE || this.style === Graph3d.STYLE.DOTCOLOR || this.style === Graph3d.STYLE.BARCOLOR;
|
22703 | var height = Math.max(this.frame.clientHeight * 0.25, 100);
|
22704 | var top = this.margin;
|
22705 |
|
22706 | var width = this._getLegendWidth();
|
22707 |
|
22708 |
|
22709 | var right = this.frame.clientWidth - this.margin;
|
22710 | var left = right - width;
|
22711 | var bottom = top + height;
|
22712 |
|
22713 | var ctx = this._getContext();
|
22714 |
|
22715 | ctx.lineWidth = 1;
|
22716 | ctx.font = '14px arial';
|
22717 |
|
22718 | if (isSizeLegend === false) {
|
22719 |
|
22720 | var ymin = 0;
|
22721 | var ymax = height;
|
22722 |
|
22723 | var y;
|
22724 |
|
22725 | for (y = ymin; y < ymax; y++) {
|
22726 | var f = (y - ymin) / (ymax - ymin);
|
22727 | var hue = f * 240;
|
22728 |
|
22729 | var color = this._hsv2rgb(hue, 1, 1);
|
22730 |
|
22731 | ctx.strokeStyle = color;
|
22732 | ctx.beginPath();
|
22733 | ctx.moveTo(left, top + y);
|
22734 | ctx.lineTo(right, top + y);
|
22735 | ctx.stroke();
|
22736 | }
|
22737 |
|
22738 | ctx.strokeStyle = this.axisColor;
|
22739 | ctx.strokeRect(left, top, width, height);
|
22740 | } else {
|
22741 |
|
22742 | var widthMin;
|
22743 |
|
22744 | if (this.style === Graph3d.STYLE.DOTSIZE) {
|
22745 |
|
22746 | widthMin = width * (this.dotSizeMinFraction / this.dotSizeMaxFraction);
|
22747 | } else if (this.style === Graph3d.STYLE.BARSIZE) ;
|
22748 |
|
22749 | ctx.strokeStyle = this.axisColor;
|
22750 | ctx.fillStyle = this.dataColor.fill;
|
22751 | ctx.beginPath();
|
22752 | ctx.moveTo(left, top);
|
22753 | ctx.lineTo(right, top);
|
22754 | ctx.lineTo(left + widthMin, bottom);
|
22755 | ctx.lineTo(left, bottom);
|
22756 | ctx.closePath();
|
22757 | ctx.fill();
|
22758 | ctx.stroke();
|
22759 | }
|
22760 |
|
22761 |
|
22762 | var gridLineLen = 5;
|
22763 |
|
22764 | var legendMin = isValueLegend ? this.valueRange.min : this.zRange.min;
|
22765 | var legendMax = isValueLegend ? this.valueRange.max : this.zRange.max;
|
22766 | var step = new StepNumber_1(legendMin, legendMax, (legendMax - legendMin) / 5, true);
|
22767 | step.start(true);
|
22768 | var from;
|
22769 | var to;
|
22770 |
|
22771 | while (!step.end()) {
|
22772 | y = bottom - (step.getCurrent() - legendMin) / (legendMax - legendMin) * height;
|
22773 | from = new Point2d_1(left - gridLineLen, y);
|
22774 | to = new Point2d_1(left, y);
|
22775 |
|
22776 | this._line(ctx, from, to);
|
22777 |
|
22778 | ctx.textAlign = 'right';
|
22779 | ctx.textBaseline = 'middle';
|
22780 | ctx.fillStyle = this.axisColor;
|
22781 | ctx.fillText(step.getCurrent(), left - 2 * gridLineLen, y);
|
22782 | step.next();
|
22783 | }
|
22784 |
|
22785 | ctx.textAlign = 'right';
|
22786 | ctx.textBaseline = 'top';
|
22787 | var label = this.legendLabel;
|
22788 | ctx.fillText(label, right, bottom + this.margin);
|
22789 | };
|
22790 |
|
22791 |
|
22792 |
|
22793 |
|
22794 |
|
22795 | Graph3d.prototype._redrawFilter = function () {
|
22796 | var dataFilter = this.dataGroup.dataFilter;
|
22797 | var filter = this.frame.filter;
|
22798 | filter.innerHTML = '';
|
22799 |
|
22800 | if (!dataFilter) {
|
22801 | filter.slider = undefined;
|
22802 | return;
|
22803 | }
|
22804 |
|
22805 | var options = {
|
22806 | 'visible': this.showAnimationControls
|
22807 | };
|
22808 | var slider = new Slider_1(filter, options);
|
22809 | filter.slider = slider;
|
22810 |
|
22811 | filter.style.padding = '10px';
|
22812 |
|
22813 | slider.setValues(dataFilter.values);
|
22814 | slider.setPlayInterval(this.animationInterval);
|
22815 |
|
22816 | var me = this;
|
22817 |
|
22818 | var onchange = function onchange() {
|
22819 | var dataFilter = me.dataGroup.dataFilter;
|
22820 | var index = slider.getIndex();
|
22821 | dataFilter.selectValue(index);
|
22822 | me.dataPoints = dataFilter._getDataPoints();
|
22823 | me.redraw();
|
22824 | };
|
22825 |
|
22826 | slider.setOnChangeCallback(onchange);
|
22827 | };
|
22828 |
|
22829 |
|
22830 |
|
22831 |
|
22832 |
|
22833 | Graph3d.prototype._redrawSlider = function () {
|
22834 | if (this.frame.filter.slider !== undefined) {
|
22835 | this.frame.filter.slider.redraw();
|
22836 | }
|
22837 | };
|
22838 |
|
22839 |
|
22840 |
|
22841 |
|
22842 |
|
22843 | Graph3d.prototype._redrawInfo = function () {
|
22844 | var info = this.dataGroup.getInfo();
|
22845 | if (info === undefined) return;
|
22846 |
|
22847 | var ctx = this._getContext();
|
22848 |
|
22849 | ctx.font = '14px arial';
|
22850 |
|
22851 | ctx.lineStyle = 'gray';
|
22852 | ctx.fillStyle = 'gray';
|
22853 | ctx.textAlign = 'left';
|
22854 | ctx.textBaseline = 'top';
|
22855 | var x = this.margin;
|
22856 | var y = this.margin;
|
22857 | ctx.fillText(info, x, y);
|
22858 | };
|
22859 |
|
22860 |
|
22861 |
|
22862 |
|
22863 |
|
22864 |
|
22865 |
|
22866 |
|
22867 |
|
22868 |
|
22869 |
|
22870 |
|
22871 |
|
22872 | Graph3d.prototype._line = function (ctx, from, to, strokeStyle) {
|
22873 | if (strokeStyle !== undefined) {
|
22874 | ctx.strokeStyle = strokeStyle;
|
22875 | }
|
22876 |
|
22877 | ctx.beginPath();
|
22878 | ctx.moveTo(from.x, from.y);
|
22879 | ctx.lineTo(to.x, to.y);
|
22880 | ctx.stroke();
|
22881 | };
|
22882 |
|
22883 |
|
22884 |
|
22885 |
|
22886 |
|
22887 |
|
22888 |
|
22889 |
|
22890 |
|
22891 |
|
22892 | Graph3d.prototype.drawAxisLabelX = function (ctx, point3d, text, armAngle, yMargin) {
|
22893 | if (yMargin === undefined) {
|
22894 | yMargin = 0;
|
22895 | }
|
22896 |
|
22897 | var point2d = this._convert3Dto2D(point3d);
|
22898 |
|
22899 | if (Math.cos(armAngle * 2) > 0) {
|
22900 | ctx.textAlign = 'center';
|
22901 | ctx.textBaseline = 'top';
|
22902 | point2d.y += yMargin;
|
22903 | } else if (Math.sin(armAngle * 2) < 0) {
|
22904 | ctx.textAlign = 'right';
|
22905 | ctx.textBaseline = 'middle';
|
22906 | } else {
|
22907 | ctx.textAlign = 'left';
|
22908 | ctx.textBaseline = 'middle';
|
22909 | }
|
22910 |
|
22911 | ctx.fillStyle = this.axisColor;
|
22912 | ctx.fillText(text, point2d.x, point2d.y);
|
22913 | };
|
22914 |
|
22915 |
|
22916 |
|
22917 |
|
22918 |
|
22919 |
|
22920 |
|
22921 |
|
22922 |
|
22923 |
|
22924 | Graph3d.prototype.drawAxisLabelY = function (ctx, point3d, text, armAngle, yMargin) {
|
22925 | if (yMargin === undefined) {
|
22926 | yMargin = 0;
|
22927 | }
|
22928 |
|
22929 | var point2d = this._convert3Dto2D(point3d);
|
22930 |
|
22931 | if (Math.cos(armAngle * 2) < 0) {
|
22932 | ctx.textAlign = 'center';
|
22933 | ctx.textBaseline = 'top';
|
22934 | point2d.y += yMargin;
|
22935 | } else if (Math.sin(armAngle * 2) > 0) {
|
22936 | ctx.textAlign = 'right';
|
22937 | ctx.textBaseline = 'middle';
|
22938 | } else {
|
22939 | ctx.textAlign = 'left';
|
22940 | ctx.textBaseline = 'middle';
|
22941 | }
|
22942 |
|
22943 | ctx.fillStyle = this.axisColor;
|
22944 | ctx.fillText(text, point2d.x, point2d.y);
|
22945 | };
|
22946 |
|
22947 |
|
22948 |
|
22949 |
|
22950 |
|
22951 |
|
22952 |
|
22953 |
|
22954 |
|
22955 | Graph3d.prototype.drawAxisLabelZ = function (ctx, point3d, text, offset) {
|
22956 | if (offset === undefined) {
|
22957 | offset = 0;
|
22958 | }
|
22959 |
|
22960 | var point2d = this._convert3Dto2D(point3d);
|
22961 |
|
22962 | ctx.textAlign = 'right';
|
22963 | ctx.textBaseline = 'middle';
|
22964 | ctx.fillStyle = this.axisColor;
|
22965 | ctx.fillText(text, point2d.x - offset, point2d.y);
|
22966 | };
|
22967 |
|
22968 |
|
22969 |
|
22970 |
|
22971 |
|
22972 |
|
22973 |
|
22974 |
|
22975 |
|
22976 |
|
22977 | Graph3d.prototype.drawAxisLabelXRotate = function (ctx, point3d, text, armAngle, yMargin) {
|
22978 | if (yMargin === undefined) {
|
22979 | yMargin = 0;
|
22980 | }
|
22981 |
|
22982 | var point2d = this._convert3Dto2D(point3d);
|
22983 |
|
22984 | if (Math.cos(armAngle * 2) > 0) {
|
22985 | ctx.save();
|
22986 | ctx.get;
|
22987 | ctx.translate(point2d.x, point2d.y);
|
22988 | ctx.rotate(Math.PI / 2);
|
22989 | ctx.fillText(text, point2d.x / 100, point2d.y / 100);
|
22990 | ctx.textAlign = 'center';
|
22991 | ctx.textBaseline = 'top';
|
22992 | point2d.y += yMargin;
|
22993 | ctx.restore();
|
22994 | } else if (Math.sin(armAngle * 2) < 0) {
|
22995 | ctx.textAlign = 'right';
|
22996 | ctx.textBaseline = 'middle';
|
22997 | ctx.fillStyle = this.axisColor;
|
22998 | ctx.fillText(text, point2d.x, point2d.y);
|
22999 | } else {
|
23000 | ctx.textAlign = 'left';
|
23001 | ctx.textBaseline = 'middle';
|
23002 | ctx.fillStyle = this.axisColor;
|
23003 | ctx.fillText(text, point2d.x, point2d.y);
|
23004 | }
|
23005 | };
|
23006 |
|
23007 |
|
23008 |
|
23009 |
|
23010 |
|
23011 |
|
23012 |
|
23013 |
|
23014 |
|
23015 |
|
23016 | Graph3d.prototype.drawAxisLabelYRotate = function (ctx, point3d, text, armAngle, yMargin) {
|
23017 | if (yMargin === undefined) {
|
23018 | yMargin = 0;
|
23019 | }
|
23020 |
|
23021 | var point2d = this._convert3Dto2D(point3d);
|
23022 |
|
23023 | if (Math.cos(armAngle * 2) < 0 && Math.sin(armAngle * 2) < 0) {
|
23024 | ctx.save();
|
23025 | ctx.get;
|
23026 | ctx.translate(point2d.x, point2d.y);
|
23027 | ctx.rotate(Math.PI / 2 * -1);
|
23028 | ctx.fillText(text, point2d.x / 100, point2d.y / 100);
|
23029 | ctx.textAlign = 'center';
|
23030 | ctx.textBaseline = 'top';
|
23031 | point2d.y += yMargin;
|
23032 | ctx.restore();
|
23033 | } else if (Math.cos(armAngle * 2) < 0) {
|
23034 | ctx.save();
|
23035 | ctx.get;
|
23036 | ctx.translate(point2d.x, point2d.y);
|
23037 | ctx.rotate(Math.PI / 2);
|
23038 | ctx.fillText(text, point2d.x / 100, point2d.y / 100);
|
23039 | ctx.textAlign = 'center';
|
23040 | ctx.textBaseline = 'top';
|
23041 | point2d.y += yMargin;
|
23042 | ctx.restore();
|
23043 | } else if (Math.sin(armAngle * 2) > 0) {
|
23044 | ctx.textAlign = 'right';
|
23045 | ctx.textBaseline = 'middle';
|
23046 | ctx.fillStyle = this.axisColor;
|
23047 | ctx.fillText(text, point2d.x, point2d.y);
|
23048 | } else {
|
23049 | ctx.textAlign = 'left';
|
23050 | ctx.textBaseline = 'middle';
|
23051 | ctx.fillStyle = this.axisColor;
|
23052 | ctx.fillText(text, point2d.x, point2d.y);
|
23053 | }
|
23054 | };
|
23055 |
|
23056 |
|
23057 |
|
23058 |
|
23059 |
|
23060 |
|
23061 |
|
23062 |
|
23063 |
|
23064 | Graph3d.prototype.drawAxisLabelZRotate = function (ctx, point3d, text, offset) {
|
23065 | if (offset === undefined) {
|
23066 | offset = 0;
|
23067 | }
|
23068 |
|
23069 | var point2d = this._convert3Dto2D(point3d);
|
23070 |
|
23071 | ctx.textAlign = 'right';
|
23072 | ctx.textBaseline = 'middle';
|
23073 | ctx.fillStyle = this.axisColor;
|
23074 | ctx.fillText(text, point2d.x - offset, point2d.y);
|
23075 | };
|
23076 |
|
23077 |
|
23078 |
|
23079 |
|
23080 |
|
23081 |
|
23082 |
|
23083 |
|
23084 |
|
23085 |
|
23086 |
|
23087 |
|
23088 |
|
23089 |
|
23090 |
|
23091 |
|
23092 | Graph3d.prototype._line3d = function (ctx, from, to, strokeStyle) {
|
23093 | var from2d = this._convert3Dto2D(from);
|
23094 |
|
23095 | var to2d = this._convert3Dto2D(to);
|
23096 |
|
23097 | this._line(ctx, from2d, to2d, strokeStyle);
|
23098 | };
|
23099 |
|
23100 |
|
23101 |
|
23102 |
|
23103 |
|
23104 | Graph3d.prototype._redrawAxis = function () {
|
23105 | var ctx = this._getContext(),
|
23106 | from,
|
23107 | to,
|
23108 | step,
|
23109 | prettyStep,
|
23110 | text,
|
23111 | xText,
|
23112 | yText,
|
23113 | zText,
|
23114 | offset,
|
23115 | xOffset,
|
23116 | yOffset;
|
23117 |
|
23118 |
|
23119 |
|
23120 |
|
23121 | ctx.font = this.axisFontSize / this.camera.getArmLength() + 'px ' + this.axisFontType;
|
23122 |
|
23123 | var gridLenX = 0.025 / this.scale.x;
|
23124 | var gridLenY = 0.025 / this.scale.y;
|
23125 | var textMargin = 5 / this.camera.getArmLength();
|
23126 |
|
23127 | var armAngle = this.camera.getArmRotation().horizontal;
|
23128 | var armVector = new Point2d_1(Math.cos(armAngle), Math.sin(armAngle));
|
23129 | var xRange = this.xRange;
|
23130 | var yRange = this.yRange;
|
23131 | var zRange = this.zRange;
|
23132 | var point3d;
|
23133 |
|
23134 | ctx.lineWidth = 1;
|
23135 | prettyStep = this.defaultXStep === undefined;
|
23136 | step = new StepNumber_1(xRange.min, xRange.max, this.xStep, prettyStep);
|
23137 | step.start(true);
|
23138 |
|
23139 | while (!step.end()) {
|
23140 | var x = step.getCurrent();
|
23141 |
|
23142 | if (this.showGrid) {
|
23143 | from = new Point3d_1(x, yRange.min, zRange.min);
|
23144 | to = new Point3d_1(x, yRange.max, zRange.min);
|
23145 |
|
23146 | this._line3d(ctx, from, to, this.gridColor);
|
23147 | } else if (this.showXAxis) {
|
23148 | from = new Point3d_1(x, yRange.min, zRange.min);
|
23149 | to = new Point3d_1(x, yRange.min + gridLenX, zRange.min);
|
23150 |
|
23151 | this._line3d(ctx, from, to, this.axisColor);
|
23152 |
|
23153 | from = new Point3d_1(x, yRange.max, zRange.min);
|
23154 | to = new Point3d_1(x, yRange.max - gridLenX, zRange.min);
|
23155 |
|
23156 | this._line3d(ctx, from, to, this.axisColor);
|
23157 | }
|
23158 |
|
23159 | if (this.showXAxis) {
|
23160 | yText = armVector.x > 0 ? yRange.min : yRange.max;
|
23161 | point3d = new Point3d_1(x, yText, zRange.min);
|
23162 | var msg = ' ' + this.xValueLabel(x) + ' ';
|
23163 |
|
23164 | this._drawAxisLabelX.call(this, ctx, point3d, msg, armAngle, textMargin);
|
23165 | }
|
23166 |
|
23167 | step.next();
|
23168 | }
|
23169 |
|
23170 |
|
23171 | ctx.lineWidth = 1;
|
23172 | prettyStep = this.defaultYStep === undefined;
|
23173 | step = new StepNumber_1(yRange.min, yRange.max, this.yStep, prettyStep);
|
23174 | step.start(true);
|
23175 |
|
23176 | while (!step.end()) {
|
23177 | var y = step.getCurrent();
|
23178 |
|
23179 | if (this.showGrid) {
|
23180 | from = new Point3d_1(xRange.min, y, zRange.min);
|
23181 | to = new Point3d_1(xRange.max, y, zRange.min);
|
23182 |
|
23183 | this._line3d(ctx, from, to, this.gridColor);
|
23184 | } else if (this.showYAxis) {
|
23185 | from = new Point3d_1(xRange.min, y, zRange.min);
|
23186 | to = new Point3d_1(xRange.min + gridLenY, y, zRange.min);
|
23187 |
|
23188 | this._line3d(ctx, from, to, this.axisColor);
|
23189 |
|
23190 | from = new Point3d_1(xRange.max, y, zRange.min);
|
23191 | to = new Point3d_1(xRange.max - gridLenY, y, zRange.min);
|
23192 |
|
23193 | this._line3d(ctx, from, to, this.axisColor);
|
23194 | }
|
23195 |
|
23196 | if (this.showYAxis) {
|
23197 | xText = armVector.y > 0 ? xRange.min : xRange.max;
|
23198 | point3d = new Point3d_1(xText, y, zRange.min);
|
23199 |
|
23200 | var _msg = ' ' + this.yValueLabel(y) + ' ';
|
23201 |
|
23202 | this._drawAxisLabelY.call(this, ctx, point3d, _msg, armAngle, textMargin);
|
23203 | }
|
23204 |
|
23205 | step.next();
|
23206 | }
|
23207 |
|
23208 |
|
23209 | if (this.showZAxis) {
|
23210 | ctx.lineWidth = 1;
|
23211 | prettyStep = this.defaultZStep === undefined;
|
23212 | step = new StepNumber_1(zRange.min, zRange.max, this.zStep, prettyStep);
|
23213 | step.start(true);
|
23214 | xText = armVector.x > 0 ? xRange.min : xRange.max;
|
23215 | yText = armVector.y < 0 ? yRange.min : yRange.max;
|
23216 |
|
23217 | while (!step.end()) {
|
23218 | var z = step.getCurrent();
|
23219 |
|
23220 | var from3d = new Point3d_1(xText, yText, z);
|
23221 |
|
23222 | var from2d = this._convert3Dto2D(from3d);
|
23223 |
|
23224 | to = new Point2d_1(from2d.x - textMargin, from2d.y);
|
23225 |
|
23226 | this._line(ctx, from2d, to, this.axisColor);
|
23227 |
|
23228 | var _msg2 = this.zValueLabel(z) + ' ';
|
23229 |
|
23230 | this._drawAxisLabelZ.call(this, ctx, from3d, _msg2, 5);
|
23231 |
|
23232 | step.next();
|
23233 | }
|
23234 |
|
23235 | ctx.lineWidth = 1;
|
23236 | from = new Point3d_1(xText, yText, zRange.min);
|
23237 | to = new Point3d_1(xText, yText, zRange.max);
|
23238 |
|
23239 | this._line3d(ctx, from, to, this.axisColor);
|
23240 | }
|
23241 |
|
23242 |
|
23243 | if (this.showXAxis) {
|
23244 | var xMin2d;
|
23245 | var xMax2d;
|
23246 | ctx.lineWidth = 1;
|
23247 |
|
23248 | xMin2d = new Point3d_1(xRange.min, yRange.min, zRange.min);
|
23249 | xMax2d = new Point3d_1(xRange.max, yRange.min, zRange.min);
|
23250 |
|
23251 | this._line3d(ctx, xMin2d, xMax2d, this.axisColor);
|
23252 |
|
23253 |
|
23254 | xMin2d = new Point3d_1(xRange.min, yRange.max, zRange.min);
|
23255 | xMax2d = new Point3d_1(xRange.max, yRange.max, zRange.min);
|
23256 |
|
23257 | this._line3d(ctx, xMin2d, xMax2d, this.axisColor);
|
23258 | }
|
23259 |
|
23260 |
|
23261 | if (this.showYAxis) {
|
23262 | ctx.lineWidth = 1;
|
23263 |
|
23264 | from = new Point3d_1(xRange.min, yRange.min, zRange.min);
|
23265 | to = new Point3d_1(xRange.min, yRange.max, zRange.min);
|
23266 |
|
23267 | this._line3d(ctx, from, to, this.axisColor);
|
23268 |
|
23269 |
|
23270 | from = new Point3d_1(xRange.max, yRange.min, zRange.min);
|
23271 | to = new Point3d_1(xRange.max, yRange.max, zRange.min);
|
23272 |
|
23273 | this._line3d(ctx, from, to, this.axisColor);
|
23274 | }
|
23275 |
|
23276 |
|
23277 | var xLabel = this.xLabel;
|
23278 |
|
23279 | if (xLabel.length > 0 && this.showXAxis) {
|
23280 | yOffset = 0.1 / this.scale.y;
|
23281 | xText = (xRange.max + 3 * xRange.min) / 4;
|
23282 | yText = armVector.x > 0 ? yRange.min - yOffset : yRange.max + yOffset;
|
23283 | text = new Point3d_1(xText, yText, zRange.min);
|
23284 | this.drawAxisLabelX(ctx, text, xLabel, armAngle);
|
23285 | }
|
23286 |
|
23287 |
|
23288 | var yLabel = this.yLabel;
|
23289 |
|
23290 | if (yLabel.length > 0 && this.showYAxis) {
|
23291 | xOffset = 0.1 / this.scale.x;
|
23292 | xText = armVector.y > 0 ? xRange.min - xOffset : xRange.max + xOffset;
|
23293 | yText = (yRange.max + 3 * yRange.min) / 4;
|
23294 | text = new Point3d_1(xText, yText, zRange.min);
|
23295 | this.drawAxisLabelY(ctx, text, yLabel, armAngle);
|
23296 | }
|
23297 |
|
23298 |
|
23299 | var zLabel = this.zLabel;
|
23300 |
|
23301 | if (zLabel.length > 0 && this.showZAxis) {
|
23302 | offset = 30;
|
23303 |
|
23304 | xText = armVector.x > 0 ? xRange.min : xRange.max;
|
23305 | yText = armVector.y < 0 ? yRange.min : yRange.max;
|
23306 | zText = (zRange.max + 3 * zRange.min) / 4;
|
23307 | text = new Point3d_1(xText, yText, zText);
|
23308 | this.drawAxisLabelZ(ctx, text, zLabel, offset);
|
23309 | }
|
23310 | };
|
23311 |
|
23312 |
|
23313 |
|
23314 |
|
23315 |
|
23316 |
|
23317 |
|
23318 |
|
23319 |
|
23320 |
|
23321 | Graph3d.prototype._hsv2rgb = function (H, S, V) {
|
23322 | var R, G, B, C, Hi, X;
|
23323 | C = V * S;
|
23324 | Hi = Math.floor(H / 60);
|
23325 |
|
23326 | X = C * (1 - Math.abs(H / 60 % 2 - 1));
|
23327 |
|
23328 | switch (Hi) {
|
23329 | case 0:
|
23330 | R = C;
|
23331 | G = X;
|
23332 | B = 0;
|
23333 | break;
|
23334 |
|
23335 | case 1:
|
23336 | R = X;
|
23337 | G = C;
|
23338 | B = 0;
|
23339 | break;
|
23340 |
|
23341 | case 2:
|
23342 | R = 0;
|
23343 | G = C;
|
23344 | B = X;
|
23345 | break;
|
23346 |
|
23347 | case 3:
|
23348 | R = 0;
|
23349 | G = X;
|
23350 | B = C;
|
23351 | break;
|
23352 |
|
23353 | case 4:
|
23354 | R = X;
|
23355 | G = 0;
|
23356 | B = C;
|
23357 | break;
|
23358 |
|
23359 | case 5:
|
23360 | R = C;
|
23361 | G = 0;
|
23362 | B = X;
|
23363 | break;
|
23364 |
|
23365 | default:
|
23366 | R = 0;
|
23367 | G = 0;
|
23368 | B = 0;
|
23369 | break;
|
23370 | }
|
23371 |
|
23372 | return 'RGB(' + parseInt(R * 255) + ',' + parseInt(G * 255) + ',' + parseInt(B * 255) + ')';
|
23373 | };
|
23374 |
|
23375 |
|
23376 |
|
23377 |
|
23378 |
|
23379 |
|
23380 |
|
23381 |
|
23382 | Graph3d.prototype._getStrokeWidth = function (point) {
|
23383 | if (point !== undefined) {
|
23384 | if (this.showPerspective) {
|
23385 | return 1 / -point.trans.z * this.dataColor.strokeWidth;
|
23386 | } else {
|
23387 | return -(this.eye.z / this.camera.getArmLength()) * this.dataColor.strokeWidth;
|
23388 | }
|
23389 | }
|
23390 |
|
23391 | return this.dataColor.strokeWidth;
|
23392 | };
|
23393 |
|
23394 |
|
23395 |
|
23396 |
|
23397 |
|
23398 |
|
23399 |
|
23400 |
|
23401 |
|
23402 |
|
23403 |
|
23404 |
|
23405 |
|
23406 |
|
23407 |
|
23408 |
|
23409 | Graph3d.prototype._redrawBar = function (ctx, point, xWidth, yWidth, color, borderColor) {
|
23410 | var surface;
|
23411 |
|
23412 | var me = this;
|
23413 | var point3d = point.point;
|
23414 | var zMin = this.zRange.min;
|
23415 | var top = [{
|
23416 | point: new Point3d_1(point3d.x - xWidth, point3d.y - yWidth, point3d.z)
|
23417 | }, {
|
23418 | point: new Point3d_1(point3d.x + xWidth, point3d.y - yWidth, point3d.z)
|
23419 | }, {
|
23420 | point: new Point3d_1(point3d.x + xWidth, point3d.y + yWidth, point3d.z)
|
23421 | }, {
|
23422 | point: new Point3d_1(point3d.x - xWidth, point3d.y + yWidth, point3d.z)
|
23423 | }];
|
23424 | var bottom = [{
|
23425 | point: new Point3d_1(point3d.x - xWidth, point3d.y - yWidth, zMin)
|
23426 | }, {
|
23427 | point: new Point3d_1(point3d.x + xWidth, point3d.y - yWidth, zMin)
|
23428 | }, {
|
23429 | point: new Point3d_1(point3d.x + xWidth, point3d.y + yWidth, zMin)
|
23430 | }, {
|
23431 | point: new Point3d_1(point3d.x - xWidth, point3d.y + yWidth, zMin)
|
23432 | }];
|
23433 |
|
23434 | top.forEach(function (obj) {
|
23435 | obj.screen = me._convert3Dto2D(obj.point);
|
23436 | });
|
23437 | bottom.forEach(function (obj) {
|
23438 | obj.screen = me._convert3Dto2D(obj.point);
|
23439 | });
|
23440 |
|
23441 | var surfaces = [{
|
23442 | corners: top,
|
23443 | center: Point3d_1.avg(bottom[0].point, bottom[2].point)
|
23444 | }, {
|
23445 | corners: [top[0], top[1], bottom[1], bottom[0]],
|
23446 | center: Point3d_1.avg(bottom[1].point, bottom[0].point)
|
23447 | }, {
|
23448 | corners: [top[1], top[2], bottom[2], bottom[1]],
|
23449 | center: Point3d_1.avg(bottom[2].point, bottom[1].point)
|
23450 | }, {
|
23451 | corners: [top[2], top[3], bottom[3], bottom[2]],
|
23452 | center: Point3d_1.avg(bottom[3].point, bottom[2].point)
|
23453 | }, {
|
23454 | corners: [top[3], top[0], bottom[0], bottom[3]],
|
23455 | center: Point3d_1.avg(bottom[0].point, bottom[3].point)
|
23456 | }];
|
23457 | point.surfaces = surfaces;
|
23458 |
|
23459 | for (var j = 0; j < surfaces.length; j++) {
|
23460 | surface = surfaces[j];
|
23461 |
|
23462 | var transCenter = this._convertPointToTranslation(surface.center);
|
23463 |
|
23464 | surface.dist = this.showPerspective ? transCenter.length() : -transCenter.z;
|
23465 |
|
23466 |
|
23467 | }
|
23468 |
|
23469 |
|
23470 | surfaces.sort(function (a, b) {
|
23471 | var diff = b.dist - a.dist;
|
23472 | if (diff) return diff;
|
23473 |
|
23474 | if (a.corners === top) return 1;
|
23475 | if (b.corners === top) return -1;
|
23476 |
|
23477 | return 0;
|
23478 | });
|
23479 |
|
23480 | ctx.lineWidth = this._getStrokeWidth(point);
|
23481 | ctx.strokeStyle = borderColor;
|
23482 | ctx.fillStyle = color;
|
23483 |
|
23484 | for (var _j = 2; _j < surfaces.length; _j++) {
|
23485 | surface = surfaces[_j];
|
23486 |
|
23487 | this._polygon(ctx, surface.corners);
|
23488 | }
|
23489 | };
|
23490 |
|
23491 |
|
23492 |
|
23493 |
|
23494 |
|
23495 |
|
23496 |
|
23497 |
|
23498 |
|
23499 |
|
23500 | Graph3d.prototype._polygon = function (ctx, points, fillStyle, strokeStyle) {
|
23501 | if (points.length < 2) {
|
23502 | return;
|
23503 | }
|
23504 |
|
23505 | if (fillStyle !== undefined) {
|
23506 | ctx.fillStyle = fillStyle;
|
23507 | }
|
23508 |
|
23509 | if (strokeStyle !== undefined) {
|
23510 | ctx.strokeStyle = strokeStyle;
|
23511 | }
|
23512 |
|
23513 | ctx.beginPath();
|
23514 | ctx.moveTo(points[0].screen.x, points[0].screen.y);
|
23515 |
|
23516 | for (var i = 1; i < points.length; ++i) {
|
23517 | var point = points[i];
|
23518 | ctx.lineTo(point.screen.x, point.screen.y);
|
23519 | }
|
23520 |
|
23521 | ctx.closePath();
|
23522 | ctx.fill();
|
23523 | ctx.stroke();
|
23524 | };
|
23525 |
|
23526 |
|
23527 |
|
23528 |
|
23529 |
|
23530 |
|
23531 |
|
23532 |
|
23533 |
|
23534 |
|
23535 | Graph3d.prototype._drawCircle = function (ctx, point, color, borderColor, size) {
|
23536 | var radius = this._calcRadius(point, size);
|
23537 |
|
23538 | ctx.lineWidth = this._getStrokeWidth(point);
|
23539 | ctx.strokeStyle = borderColor;
|
23540 | ctx.fillStyle = color;
|
23541 | ctx.beginPath();
|
23542 | ctx.arc(point.screen.x, point.screen.y, radius, 0, Math.PI * 2, true);
|
23543 | ctx.fill();
|
23544 | ctx.stroke();
|
23545 | };
|
23546 |
|
23547 |
|
23548 |
|
23549 |
|
23550 |
|
23551 |
|
23552 |
|
23553 |
|
23554 |
|
23555 | Graph3d.prototype._getColorsRegular = function (point) {
|
23556 |
|
23557 | var hue = (1 - (point.point.z - this.zRange.min) * this.scale.z / this.verticalRatio) * 240;
|
23558 |
|
23559 | var color = this._hsv2rgb(hue, 1, 1);
|
23560 |
|
23561 | var borderColor = this._hsv2rgb(hue, 1, 0.8);
|
23562 |
|
23563 | return {
|
23564 | fill: color,
|
23565 | border: borderColor
|
23566 | };
|
23567 | };
|
23568 |
|
23569 |
|
23570 |
|
23571 |
|
23572 |
|
23573 |
|
23574 |
|
23575 |
|
23576 |
|
23577 |
|
23578 |
|
23579 |
|
23580 |
|
23581 |
|
23582 | Graph3d.prototype._getColorsColor = function (point) {
|
23583 |
|
23584 | var color, borderColor, pointStyle;
|
23585 |
|
23586 | if (point && point.point && point.point.data && point.point.data.style) {
|
23587 | pointStyle = point.point.data.style;
|
23588 | }
|
23589 |
|
23590 | if (pointStyle && _typeof(pointStyle) === 'object' && pointStyle.fill && pointStyle.stroke) {
|
23591 | return {
|
23592 | fill: pointStyle.fill,
|
23593 | border: pointStyle.stroke
|
23594 | };
|
23595 | }
|
23596 |
|
23597 | if (typeof point.point.value === "string") {
|
23598 | color = point.point.value;
|
23599 | borderColor = point.point.value;
|
23600 | } else {
|
23601 | var hue = (1 - (point.point.value - this.valueRange.min) * this.scale.value) * 240;
|
23602 | color = this._hsv2rgb(hue, 1, 1);
|
23603 | borderColor = this._hsv2rgb(hue, 1, 0.8);
|
23604 | }
|
23605 |
|
23606 | return {
|
23607 | fill: color,
|
23608 | border: borderColor
|
23609 | };
|
23610 | };
|
23611 |
|
23612 |
|
23613 |
|
23614 |
|
23615 |
|
23616 |
|
23617 |
|
23618 |
|
23619 |
|
23620 | Graph3d.prototype._getColorsSize = function () {
|
23621 | return {
|
23622 | fill: this.dataColor.fill,
|
23623 | border: this.dataColor.stroke
|
23624 | };
|
23625 | };
|
23626 |
|
23627 |
|
23628 |
|
23629 |
|
23630 |
|
23631 |
|
23632 |
|
23633 |
|
23634 |
|
23635 |
|
23636 |
|
23637 |
|
23638 | Graph3d.prototype._calcRadius = function (point, size) {
|
23639 | if (size === undefined) {
|
23640 | size = this._dotSize();
|
23641 | }
|
23642 |
|
23643 | var radius;
|
23644 |
|
23645 | if (this.showPerspective) {
|
23646 | radius = size / -point.trans.z;
|
23647 | } else {
|
23648 | radius = size * -(this.eye.z / this.camera.getArmLength());
|
23649 | }
|
23650 |
|
23651 | if (radius < 0) {
|
23652 | radius = 0;
|
23653 | }
|
23654 |
|
23655 | return radius;
|
23656 | };
|
23657 |
|
23658 |
|
23659 |
|
23660 |
|
23661 |
|
23662 |
|
23663 |
|
23664 |
|
23665 |
|
23666 |
|
23667 |
|
23668 |
|
23669 | Graph3d.prototype._redrawBarGraphPoint = function (ctx, point) {
|
23670 | var xWidth = this.xBarWidth / 2;
|
23671 | var yWidth = this.yBarWidth / 2;
|
23672 |
|
23673 | var colors = this._getColorsRegular(point);
|
23674 |
|
23675 | this._redrawBar(ctx, point, xWidth, yWidth, colors.fill, colors.border);
|
23676 | };
|
23677 |
|
23678 |
|
23679 |
|
23680 |
|
23681 |
|
23682 |
|
23683 |
|
23684 |
|
23685 |
|
23686 | Graph3d.prototype._redrawBarColorGraphPoint = function (ctx, point) {
|
23687 | var xWidth = this.xBarWidth / 2;
|
23688 | var yWidth = this.yBarWidth / 2;
|
23689 |
|
23690 | var colors = this._getColorsColor(point);
|
23691 |
|
23692 | this._redrawBar(ctx, point, xWidth, yWidth, colors.fill, colors.border);
|
23693 | };
|
23694 |
|
23695 |
|
23696 |
|
23697 |
|
23698 |
|
23699 |
|
23700 |
|
23701 |
|
23702 |
|
23703 | Graph3d.prototype._redrawBarSizeGraphPoint = function (ctx, point) {
|
23704 |
|
23705 | var fraction = (point.point.value - this.valueRange.min) / this.valueRange.range();
|
23706 | var xWidth = this.xBarWidth / 2 * (fraction * 0.8 + 0.2);
|
23707 | var yWidth = this.yBarWidth / 2 * (fraction * 0.8 + 0.2);
|
23708 |
|
23709 | var colors = this._getColorsSize();
|
23710 |
|
23711 | this._redrawBar(ctx, point, xWidth, yWidth, colors.fill, colors.border);
|
23712 | };
|
23713 |
|
23714 |
|
23715 |
|
23716 |
|
23717 |
|
23718 |
|
23719 |
|
23720 |
|
23721 |
|
23722 | Graph3d.prototype._redrawDotGraphPoint = function (ctx, point) {
|
23723 | var colors = this._getColorsRegular(point);
|
23724 |
|
23725 | this._drawCircle(ctx, point, colors.fill, colors.border);
|
23726 | };
|
23727 |
|
23728 |
|
23729 |
|
23730 |
|
23731 |
|
23732 |
|
23733 |
|
23734 |
|
23735 |
|
23736 | Graph3d.prototype._redrawDotLineGraphPoint = function (ctx, point) {
|
23737 |
|
23738 | var from = this._convert3Dto2D(point.bottom);
|
23739 |
|
23740 | ctx.lineWidth = 1;
|
23741 |
|
23742 | this._line(ctx, from, point.screen, this.gridColor);
|
23743 |
|
23744 | this._redrawDotGraphPoint(ctx, point);
|
23745 | };
|
23746 |
|
23747 |
|
23748 |
|
23749 |
|
23750 |
|
23751 |
|
23752 |
|
23753 |
|
23754 |
|
23755 | Graph3d.prototype._redrawDotColorGraphPoint = function (ctx, point) {
|
23756 | var colors = this._getColorsColor(point);
|
23757 |
|
23758 | this._drawCircle(ctx, point, colors.fill, colors.border);
|
23759 | };
|
23760 |
|
23761 |
|
23762 |
|
23763 |
|
23764 |
|
23765 |
|
23766 |
|
23767 |
|
23768 |
|
23769 | Graph3d.prototype._redrawDotSizeGraphPoint = function (ctx, point) {
|
23770 | var dotSize = this._dotSize();
|
23771 |
|
23772 | var fraction = (point.point.value - this.valueRange.min) / this.valueRange.range();
|
23773 | var sizeMin = dotSize * this.dotSizeMinFraction;
|
23774 | var sizeRange = dotSize * this.dotSizeMaxFraction - sizeMin;
|
23775 | var size = sizeMin + sizeRange * fraction;
|
23776 |
|
23777 | var colors = this._getColorsSize();
|
23778 |
|
23779 | this._drawCircle(ctx, point, colors.fill, colors.border, size);
|
23780 | };
|
23781 |
|
23782 |
|
23783 |
|
23784 |
|
23785 |
|
23786 |
|
23787 |
|
23788 |
|
23789 |
|
23790 | Graph3d.prototype._redrawSurfaceGraphPoint = function (ctx, point) {
|
23791 | var right = point.pointRight;
|
23792 | var top = point.pointTop;
|
23793 | var cross = point.pointCross;
|
23794 |
|
23795 | if (point === undefined || right === undefined || top === undefined || cross === undefined) {
|
23796 | return;
|
23797 | }
|
23798 |
|
23799 | var topSideVisible = true;
|
23800 | var fillStyle;
|
23801 | var strokeStyle;
|
23802 |
|
23803 | if (this.showGrayBottom || this.showShadow) {
|
23804 |
|
23805 |
|
23806 |
|
23807 |
|
23808 | var aDiff = Point3d_1.subtract(cross.trans, point.trans);
|
23809 | var bDiff = Point3d_1.subtract(top.trans, right.trans);
|
23810 | var crossproduct = Point3d_1.crossProduct(aDiff, bDiff);
|
23811 | var len = crossproduct.length();
|
23812 |
|
23813 | topSideVisible = crossproduct.z > 0;
|
23814 | }
|
23815 |
|
23816 | if (topSideVisible) {
|
23817 |
|
23818 | var zAvg = (point.point.z + right.point.z + top.point.z + cross.point.z) / 4;
|
23819 | var h = (1 - (zAvg - this.zRange.min) * this.scale.z / this.verticalRatio) * 240;
|
23820 | var s = 1;
|
23821 |
|
23822 | var v;
|
23823 |
|
23824 | if (this.showShadow) {
|
23825 | v = Math.min(1 + crossproduct.x / len / 2, 1);
|
23826 |
|
23827 | fillStyle = this._hsv2rgb(h, s, v);
|
23828 | strokeStyle = fillStyle;
|
23829 | } else {
|
23830 | v = 1;
|
23831 | fillStyle = this._hsv2rgb(h, s, v);
|
23832 | strokeStyle = this.axisColor;
|
23833 | }
|
23834 | } else {
|
23835 | fillStyle = 'gray';
|
23836 | strokeStyle = this.axisColor;
|
23837 | }
|
23838 |
|
23839 | ctx.lineWidth = this._getStrokeWidth(point);
|
23840 |
|
23841 | var points = [point, right, cross, top];
|
23842 |
|
23843 | this._polygon(ctx, points, fillStyle, strokeStyle);
|
23844 | };
|
23845 |
|
23846 |
|
23847 |
|
23848 |
|
23849 |
|
23850 |
|
23851 |
|
23852 |
|
23853 |
|
23854 |
|
23855 | Graph3d.prototype._drawGridLine = function (ctx, from, to) {
|
23856 | if (from === undefined || to === undefined) {
|
23857 | return;
|
23858 | }
|
23859 |
|
23860 |
|
23861 | var zAvg = (from.point.z + to.point.z) / 2;
|
23862 | var h = (1 - (zAvg - this.zRange.min) * this.scale.z / this.verticalRatio) * 240;
|
23863 | ctx.lineWidth = this._getStrokeWidth(from) * 2;
|
23864 | ctx.strokeStyle = this._hsv2rgb(h, 1, 1);
|
23865 |
|
23866 | this._line(ctx, from.screen, to.screen);
|
23867 | };
|
23868 |
|
23869 |
|
23870 |
|
23871 |
|
23872 |
|
23873 |
|
23874 |
|
23875 |
|
23876 |
|
23877 | Graph3d.prototype._redrawGridGraphPoint = function (ctx, point) {
|
23878 | this._drawGridLine(ctx, point, point.pointRight);
|
23879 |
|
23880 | this._drawGridLine(ctx, point, point.pointTop);
|
23881 | };
|
23882 |
|
23883 |
|
23884 |
|
23885 |
|
23886 |
|
23887 |
|
23888 |
|
23889 |
|
23890 |
|
23891 | Graph3d.prototype._redrawLineGraphPoint = function (ctx, point) {
|
23892 | if (point.pointNext === undefined) {
|
23893 | return;
|
23894 | }
|
23895 |
|
23896 | ctx.lineWidth = this._getStrokeWidth(point);
|
23897 | ctx.strokeStyle = this.dataColor.stroke;
|
23898 |
|
23899 | this._line(ctx, point.screen, point.pointNext.screen);
|
23900 | };
|
23901 |
|
23902 |
|
23903 |
|
23904 |
|
23905 |
|
23906 |
|
23907 | Graph3d.prototype._redrawDataGraph = function () {
|
23908 | var ctx = this._getContext();
|
23909 |
|
23910 | var i;
|
23911 | if (this.dataPoints === undefined || this.dataPoints.length <= 0) return;
|
23912 |
|
23913 | this._calcTranslations(this.dataPoints);
|
23914 |
|
23915 | for (i = 0; i < this.dataPoints.length; i++) {
|
23916 | var point = this.dataPoints[i];
|
23917 |
|
23918 | this._pointDrawingMethod.call(this, ctx, point);
|
23919 | }
|
23920 | };
|
23921 |
|
23922 |
|
23923 |
|
23924 |
|
23925 |
|
23926 |
|
23927 |
|
23928 |
|
23929 |
|
23930 |
|
23931 | Graph3d.prototype._storeMousePosition = function (event) {
|
23932 |
|
23933 | this.startMouseX = getMouseX(event);
|
23934 | this.startMouseY = getMouseY(event);
|
23935 | this._startCameraOffset = this.camera.getOffset();
|
23936 | };
|
23937 |
|
23938 |
|
23939 |
|
23940 |
|
23941 |
|
23942 |
|
23943 |
|
23944 | Graph3d.prototype._onMouseDown = function (event) {
|
23945 | event = event || window.event;
|
23946 |
|
23947 |
|
23948 | if (this.leftButtonDown) {
|
23949 | this._onMouseUp(event);
|
23950 | }
|
23951 |
|
23952 |
|
23953 | this.leftButtonDown = event.which ? event.which === 1 : event.button === 1;
|
23954 | if (!this.leftButtonDown && !this.touchDown) return;
|
23955 |
|
23956 | this._storeMousePosition(event);
|
23957 |
|
23958 | this.startStart = new Date(this.start);
|
23959 | this.startEnd = new Date(this.end);
|
23960 | this.startArmRotation = this.camera.getArmRotation();
|
23961 | this.frame.style.cursor = 'move';
|
23962 |
|
23963 |
|
23964 |
|
23965 | var me = this;
|
23966 |
|
23967 | this.onmousemove = function (event) {
|
23968 | me._onMouseMove(event);
|
23969 | };
|
23970 |
|
23971 | this.onmouseup = function (event) {
|
23972 | me._onMouseUp(event);
|
23973 | };
|
23974 |
|
23975 | util.addEventListener(document, 'mousemove', me.onmousemove);
|
23976 | util.addEventListener(document, 'mouseup', me.onmouseup);
|
23977 | util.preventDefault(event);
|
23978 | };
|
23979 |
|
23980 |
|
23981 |
|
23982 |
|
23983 |
|
23984 |
|
23985 |
|
23986 | Graph3d.prototype._onMouseMove = function (event) {
|
23987 | this.moving = true;
|
23988 | event = event || window.event;
|
23989 |
|
23990 | var diffX = parseFloat(getMouseX(event)) - this.startMouseX;
|
23991 | var diffY = parseFloat(getMouseY(event)) - this.startMouseY;
|
23992 |
|
23993 | if (event && event.ctrlKey === true) {
|
23994 |
|
23995 | var scaleX = this.frame.clientWidth * 0.5;
|
23996 | var scaleY = this.frame.clientHeight * 0.5;
|
23997 | var offXNew = (this._startCameraOffset.x || 0) - diffX / scaleX * this.camera.armLength * 0.8;
|
23998 | var offYNew = (this._startCameraOffset.y || 0) + diffY / scaleY * this.camera.armLength * 0.8;
|
23999 | this.camera.setOffset(offXNew, offYNew);
|
24000 |
|
24001 | this._storeMousePosition(event);
|
24002 | } else {
|
24003 | var horizontalNew = this.startArmRotation.horizontal + diffX / 200;
|
24004 | var verticalNew = this.startArmRotation.vertical + diffY / 200;
|
24005 | var snapAngle = 4;
|
24006 |
|
24007 | var snapValue = Math.sin(snapAngle / 360 * 2 * Math.PI);
|
24008 |
|
24009 |
|
24010 | if (Math.abs(Math.sin(horizontalNew)) < snapValue) {
|
24011 | horizontalNew = Math.round(horizontalNew / Math.PI) * Math.PI - 0.001;
|
24012 | }
|
24013 |
|
24014 | if (Math.abs(Math.cos(horizontalNew)) < snapValue) {
|
24015 | horizontalNew = (Math.round(horizontalNew / Math.PI - 0.5) + 0.5) * Math.PI - 0.001;
|
24016 | }
|
24017 |
|
24018 |
|
24019 | if (Math.abs(Math.sin(verticalNew)) < snapValue) {
|
24020 | verticalNew = Math.round(verticalNew / Math.PI) * Math.PI;
|
24021 | }
|
24022 |
|
24023 | if (Math.abs(Math.cos(verticalNew)) < snapValue) {
|
24024 | verticalNew = (Math.round(verticalNew / Math.PI - 0.5) + 0.5) * Math.PI;
|
24025 | }
|
24026 |
|
24027 | this.camera.setArmRotation(horizontalNew, verticalNew);
|
24028 | }
|
24029 |
|
24030 | this.redraw();
|
24031 |
|
24032 | var parameters = this.getCameraPosition();
|
24033 | this.emit('cameraPositionChange', parameters);
|
24034 | util.preventDefault(event);
|
24035 | };
|
24036 |
|
24037 |
|
24038 |
|
24039 |
|
24040 |
|
24041 |
|
24042 |
|
24043 | Graph3d.prototype._onMouseUp = function (event) {
|
24044 | this.frame.style.cursor = 'auto';
|
24045 | this.leftButtonDown = false;
|
24046 |
|
24047 | util.removeEventListener(document, 'mousemove', this.onmousemove);
|
24048 | util.removeEventListener(document, 'mouseup', this.onmouseup);
|
24049 | util.preventDefault(event);
|
24050 | };
|
24051 |
|
24052 |
|
24053 |
|
24054 |
|
24055 |
|
24056 | Graph3d.prototype._onClick = function (event) {
|
24057 | if (!this.onclick_callback) return;
|
24058 |
|
24059 | if (!this.moving) {
|
24060 | var boundingRect = this.frame.getBoundingClientRect();
|
24061 | var mouseX = getMouseX(event) - boundingRect.left;
|
24062 | var mouseY = getMouseY(event) - boundingRect.top;
|
24063 |
|
24064 | var dataPoint = this._dataPointFromXY(mouseX, mouseY);
|
24065 |
|
24066 | if (dataPoint) this.onclick_callback(dataPoint.point.data);
|
24067 | } else {
|
24068 |
|
24069 | this.moving = false;
|
24070 | }
|
24071 |
|
24072 | util.preventDefault(event);
|
24073 | };
|
24074 |
|
24075 |
|
24076 |
|
24077 |
|
24078 |
|
24079 |
|
24080 | Graph3d.prototype._onTooltip = function (event) {
|
24081 | var delay = this.tooltipDelay;
|
24082 |
|
24083 | var boundingRect = this.frame.getBoundingClientRect();
|
24084 | var mouseX = getMouseX(event) - boundingRect.left;
|
24085 | var mouseY = getMouseY(event) - boundingRect.top;
|
24086 |
|
24087 | if (!this.showTooltip) {
|
24088 | return;
|
24089 | }
|
24090 |
|
24091 | if (this.tooltipTimeout) {
|
24092 | clearTimeout(this.tooltipTimeout);
|
24093 | }
|
24094 |
|
24095 |
|
24096 | if (this.leftButtonDown) {
|
24097 | this._hideTooltip();
|
24098 |
|
24099 | return;
|
24100 | }
|
24101 |
|
24102 | if (this.tooltip && this.tooltip.dataPoint) {
|
24103 |
|
24104 | var dataPoint = this._dataPointFromXY(mouseX, mouseY);
|
24105 |
|
24106 | if (dataPoint !== this.tooltip.dataPoint) {
|
24107 |
|
24108 | if (dataPoint) {
|
24109 | this._showTooltip(dataPoint);
|
24110 | } else {
|
24111 | this._hideTooltip();
|
24112 | }
|
24113 | }
|
24114 | } else {
|
24115 |
|
24116 | var me = this;
|
24117 | this.tooltipTimeout = setTimeout(function () {
|
24118 | me.tooltipTimeout = null;
|
24119 |
|
24120 | var dataPoint = me._dataPointFromXY(mouseX, mouseY);
|
24121 |
|
24122 | if (dataPoint) {
|
24123 | me._showTooltip(dataPoint);
|
24124 | }
|
24125 | }, delay);
|
24126 | }
|
24127 | };
|
24128 |
|
24129 |
|
24130 |
|
24131 |
|
24132 |
|
24133 |
|
24134 | Graph3d.prototype._onTouchStart = function (event) {
|
24135 | this.touchDown = true;
|
24136 | var me = this;
|
24137 |
|
24138 | this.ontouchmove = function (event) {
|
24139 | me._onTouchMove(event);
|
24140 | };
|
24141 |
|
24142 | this.ontouchend = function (event) {
|
24143 | me._onTouchEnd(event);
|
24144 | };
|
24145 |
|
24146 | util.addEventListener(document, 'touchmove', me.ontouchmove);
|
24147 | util.addEventListener(document, 'touchend', me.ontouchend);
|
24148 |
|
24149 | this._onMouseDown(event);
|
24150 | };
|
24151 |
|
24152 |
|
24153 |
|
24154 |
|
24155 |
|
24156 |
|
24157 | Graph3d.prototype._onTouchMove = function (event) {
|
24158 | this._onMouseMove(event);
|
24159 | };
|
24160 |
|
24161 |
|
24162 |
|
24163 |
|
24164 |
|
24165 |
|
24166 | Graph3d.prototype._onTouchEnd = function (event) {
|
24167 | this.touchDown = false;
|
24168 | util.removeEventListener(document, 'touchmove', this.ontouchmove);
|
24169 | util.removeEventListener(document, 'touchend', this.ontouchend);
|
24170 |
|
24171 | this._onMouseUp(event);
|
24172 | };
|
24173 |
|
24174 |
|
24175 |
|
24176 |
|
24177 |
|
24178 |
|
24179 |
|
24180 | Graph3d.prototype._onWheel = function (event) {
|
24181 | if (!event)
|
24182 |
|
24183 | event = window.event;
|
24184 |
|
24185 | if (this.zoomable && (!this.ctrlToZoom || event.ctrlKey)) {
|
24186 |
|
24187 | var delta = 0;
|
24188 |
|
24189 | if (event.wheelDelta) {
|
24190 |
|
24191 | delta = event.wheelDelta / 120;
|
24192 | } else if (event.detail) {
|
24193 |
|
24194 |
|
24195 |
|
24196 | delta = -event.detail / 3;
|
24197 | }
|
24198 |
|
24199 |
|
24200 |
|
24201 |
|
24202 | if (delta) {
|
24203 | var oldLength = this.camera.getArmLength();
|
24204 | var newLength = oldLength * (1 - delta / 10);
|
24205 | this.camera.setArmLength(newLength);
|
24206 | this.redraw();
|
24207 |
|
24208 | this._hideTooltip();
|
24209 | }
|
24210 |
|
24211 |
|
24212 | var parameters = this.getCameraPosition();
|
24213 | this.emit('cameraPositionChange', parameters);
|
24214 |
|
24215 |
|
24216 |
|
24217 | util.preventDefault(event);
|
24218 | }
|
24219 | };
|
24220 |
|
24221 |
|
24222 |
|
24223 |
|
24224 |
|
24225 |
|
24226 |
|
24227 |
|
24228 |
|
24229 |
|
24230 |
|
24231 | Graph3d.prototype._insideTriangle = function (point, triangle) {
|
24232 | var a = triangle[0],
|
24233 | b = triangle[1],
|
24234 | c = triangle[2];
|
24235 | |
24236 |
|
24237 |
|
24238 |
|
24239 |
|
24240 |
|
24241 | function sign(x) {
|
24242 | return x > 0 ? 1 : x < 0 ? -1 : 0;
|
24243 | }
|
24244 |
|
24245 | var as = sign((b.x - a.x) * (point.y - a.y) - (b.y - a.y) * (point.x - a.x));
|
24246 | var bs = sign((c.x - b.x) * (point.y - b.y) - (c.y - b.y) * (point.x - b.x));
|
24247 | var cs = sign((a.x - c.x) * (point.y - c.y) - (a.y - c.y) * (point.x - c.x));
|
24248 |
|
24249 | return (as == 0 || bs == 0 || as == bs) && (bs == 0 || cs == 0 || bs == cs) && (as == 0 || cs == 0 || as == cs);
|
24250 | };
|
24251 |
|
24252 |
|
24253 |
|
24254 |
|
24255 |
|
24256 |
|
24257 |
|
24258 |
|
24259 |
|
24260 |
|
24261 |
|
24262 | Graph3d.prototype._dataPointFromXY = function (x, y) {
|
24263 | var i,
|
24264 | distMax = 100,
|
24265 |
|
24266 | dataPoint = null,
|
24267 | closestDataPoint = null,
|
24268 | closestDist = null,
|
24269 | center = new Point2d_1(x, y);
|
24270 |
|
24271 | if (this.style === Graph3d.STYLE.BAR || this.style === Graph3d.STYLE.BARCOLOR || this.style === Graph3d.STYLE.BARSIZE) {
|
24272 |
|
24273 | for (i = this.dataPoints.length - 1; i >= 0; i--) {
|
24274 | dataPoint = this.dataPoints[i];
|
24275 | var surfaces = dataPoint.surfaces;
|
24276 |
|
24277 | if (surfaces) {
|
24278 | for (var s = surfaces.length - 1; s >= 0; s--) {
|
24279 |
|
24280 | var surface = surfaces[s];
|
24281 | var corners = surface.corners;
|
24282 | var triangle1 = [corners[0].screen, corners[1].screen, corners[2].screen];
|
24283 | var triangle2 = [corners[2].screen, corners[3].screen, corners[0].screen];
|
24284 |
|
24285 | if (this._insideTriangle(center, triangle1) || this._insideTriangle(center, triangle2)) {
|
24286 |
|
24287 | return dataPoint;
|
24288 | }
|
24289 | }
|
24290 | }
|
24291 | }
|
24292 | } else {
|
24293 |
|
24294 | for (i = 0; i < this.dataPoints.length; i++) {
|
24295 | dataPoint = this.dataPoints[i];
|
24296 | var point = dataPoint.screen;
|
24297 |
|
24298 | if (point) {
|
24299 | var distX = Math.abs(x - point.x);
|
24300 | var distY = Math.abs(y - point.y);
|
24301 | var dist = Math.sqrt(distX * distX + distY * distY);
|
24302 |
|
24303 | if ((closestDist === null || dist < closestDist) && dist < distMax) {
|
24304 | closestDist = dist;
|
24305 | closestDataPoint = dataPoint;
|
24306 | }
|
24307 | }
|
24308 | }
|
24309 | }
|
24310 |
|
24311 | return closestDataPoint;
|
24312 | };
|
24313 |
|
24314 |
|
24315 |
|
24316 |
|
24317 |
|
24318 |
|
24319 |
|
24320 |
|
24321 | Graph3d.prototype.hasBars = function (style) {
|
24322 | return style == Graph3d.STYLE.BAR || style == Graph3d.STYLE.BARCOLOR || style == Graph3d.STYLE.BARSIZE;
|
24323 | };
|
24324 |
|
24325 |
|
24326 |
|
24327 |
|
24328 |
|
24329 |
|
24330 |
|
24331 | Graph3d.prototype._showTooltip = function (dataPoint) {
|
24332 | var content, line, dot;
|
24333 |
|
24334 | if (!this.tooltip) {
|
24335 | content = document.createElement('div');
|
24336 | Object.assign(content.style, {}, this.tooltipStyle.content);
|
24337 | content.style.position = 'absolute';
|
24338 | line = document.createElement('div');
|
24339 | Object.assign(line.style, {}, this.tooltipStyle.line);
|
24340 | line.style.position = 'absolute';
|
24341 | dot = document.createElement('div');
|
24342 | Object.assign(dot.style, {}, this.tooltipStyle.dot);
|
24343 | dot.style.position = 'absolute';
|
24344 | this.tooltip = {
|
24345 | dataPoint: null,
|
24346 | dom: {
|
24347 | content: content,
|
24348 | line: line,
|
24349 | dot: dot
|
24350 | }
|
24351 | };
|
24352 | } else {
|
24353 | content = this.tooltip.dom.content;
|
24354 | line = this.tooltip.dom.line;
|
24355 | dot = this.tooltip.dom.dot;
|
24356 | }
|
24357 |
|
24358 | this._hideTooltip();
|
24359 |
|
24360 | this.tooltip.dataPoint = dataPoint;
|
24361 |
|
24362 | if (typeof this.showTooltip === 'function') {
|
24363 | content.innerHTML = this.showTooltip(dataPoint.point);
|
24364 | } else {
|
24365 | content.innerHTML = '<table>' + '<tr><td>' + this.xLabel + ':</td><td>' + dataPoint.point.x + '</td></tr>' + '<tr><td>' + this.yLabel + ':</td><td>' + dataPoint.point.y + '</td></tr>' + '<tr><td>' + this.zLabel + ':</td><td>' + dataPoint.point.z + '</td></tr>' + '</table>';
|
24366 | }
|
24367 |
|
24368 | content.style.left = '0';
|
24369 | content.style.top = '0';
|
24370 | this.frame.appendChild(content);
|
24371 | this.frame.appendChild(line);
|
24372 | this.frame.appendChild(dot);
|
24373 |
|
24374 | var contentWidth = content.offsetWidth;
|
24375 | var contentHeight = content.offsetHeight;
|
24376 | var lineHeight = line.offsetHeight;
|
24377 | var dotWidth = dot.offsetWidth;
|
24378 | var dotHeight = dot.offsetHeight;
|
24379 | var left = dataPoint.screen.x - contentWidth / 2;
|
24380 | left = Math.min(Math.max(left, 10), this.frame.clientWidth - 10 - contentWidth);
|
24381 | line.style.left = dataPoint.screen.x + 'px';
|
24382 | line.style.top = dataPoint.screen.y - lineHeight + 'px';
|
24383 | content.style.left = left + 'px';
|
24384 | content.style.top = dataPoint.screen.y - lineHeight - contentHeight + 'px';
|
24385 | dot.style.left = dataPoint.screen.x - dotWidth / 2 + 'px';
|
24386 | dot.style.top = dataPoint.screen.y - dotHeight / 2 + 'px';
|
24387 | };
|
24388 |
|
24389 |
|
24390 |
|
24391 |
|
24392 |
|
24393 |
|
24394 | Graph3d.prototype._hideTooltip = function () {
|
24395 | if (this.tooltip) {
|
24396 | this.tooltip.dataPoint = null;
|
24397 |
|
24398 | for (var prop in this.tooltip.dom) {
|
24399 | if (this.tooltip.dom.hasOwnProperty(prop)) {
|
24400 | var elem = this.tooltip.dom[prop];
|
24401 |
|
24402 | if (elem && elem.parentNode) {
|
24403 | elem.parentNode.removeChild(elem);
|
24404 | }
|
24405 | }
|
24406 | }
|
24407 | }
|
24408 | };
|
24409 |
|
24410 |
|
24411 |
|
24412 |
|
24413 |
|
24414 |
|
24415 |
|
24416 |
|
24417 |
|
24418 |
|
24419 | function getMouseX(event) {
|
24420 | if ('clientX' in event) return event.clientX;
|
24421 | return event.targetTouches[0] && event.targetTouches[0].clientX || 0;
|
24422 | }
|
24423 |
|
24424 |
|
24425 |
|
24426 |
|
24427 |
|
24428 |
|
24429 |
|
24430 |
|
24431 | function getMouseY(event) {
|
24432 | if ('clientY' in event) return event.clientY;
|
24433 | return event.targetTouches[0] && event.targetTouches[0].clientY || 0;
|
24434 | }
|
24435 |
|
24436 |
|
24437 |
|
24438 |
|
24439 |
|
24440 |
|
24441 |
|
24442 |
|
24443 |
|
24444 |
|
24445 |
|
24446 |
|
24447 |
|
24448 |
|
24449 |
|
24450 |
|
24451 |
|
24452 |
|
24453 | Graph3d.prototype.setCameraPosition = function (pos) {
|
24454 | Settings.setCameraPosition(pos, this);
|
24455 | this.redraw();
|
24456 | };
|
24457 |
|
24458 |
|
24459 |
|
24460 |
|
24461 |
|
24462 |
|
24463 |
|
24464 |
|
24465 |
|
24466 |
|
24467 | Graph3d.prototype.setSize = function (width, height) {
|
24468 | this._setSize(width, height);
|
24469 |
|
24470 | this.redraw();
|
24471 | };
|
24472 |
|
24473 |
|
24474 |
|
24475 |
|
24476 | var Graph3d_1 = Graph3d;
|
24477 |
|
24478 | var moment$1 = createCommonjsModule$1(function (module, exports) {
|
24479 |
|
24480 | (function (global, factory) {
|
24481 | module.exports = factory() ;
|
24482 | })(commonjsGlobal$1, function () {
|
24483 |
|
24484 | var hookCallback;
|
24485 |
|
24486 | function hooks() {
|
24487 | return hookCallback.apply(null, arguments);
|
24488 | }
|
24489 |
|
24490 |
|
24491 |
|
24492 | function setHookCallback(callback) {
|
24493 | hookCallback = callback;
|
24494 | }
|
24495 |
|
24496 | function isArray(input) {
|
24497 | return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
|
24498 | }
|
24499 |
|
24500 | function isObject(input) {
|
24501 |
|
24502 |
|
24503 | return input != null && Object.prototype.toString.call(input) === '[object Object]';
|
24504 | }
|
24505 |
|
24506 | function isObjectEmpty(obj) {
|
24507 | if (Object.getOwnPropertyNames) {
|
24508 | return Object.getOwnPropertyNames(obj).length === 0;
|
24509 | } else {
|
24510 | var k;
|
24511 |
|
24512 | for (k in obj) {
|
24513 | if (obj.hasOwnProperty(k)) {
|
24514 | return false;
|
24515 | }
|
24516 | }
|
24517 |
|
24518 | return true;
|
24519 | }
|
24520 | }
|
24521 |
|
24522 | function isUndefined(input) {
|
24523 | return input === void 0;
|
24524 | }
|
24525 |
|
24526 | function isNumber(input) {
|
24527 | return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
|
24528 | }
|
24529 |
|
24530 | function isDate(input) {
|
24531 | return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
|
24532 | }
|
24533 |
|
24534 | function map(arr, fn) {
|
24535 | var res = [],
|
24536 | i;
|
24537 |
|
24538 | for (i = 0; i < arr.length; ++i) {
|
24539 | res.push(fn(arr[i], i));
|
24540 | }
|
24541 |
|
24542 | return res;
|
24543 | }
|
24544 |
|
24545 | function hasOwnProp(a, b) {
|
24546 | return Object.prototype.hasOwnProperty.call(a, b);
|
24547 | }
|
24548 |
|
24549 | function extend(a, b) {
|
24550 | for (var i in b) {
|
24551 | if (hasOwnProp(b, i)) {
|
24552 | a[i] = b[i];
|
24553 | }
|
24554 | }
|
24555 |
|
24556 | if (hasOwnProp(b, 'toString')) {
|
24557 | a.toString = b.toString;
|
24558 | }
|
24559 |
|
24560 | if (hasOwnProp(b, 'valueOf')) {
|
24561 | a.valueOf = b.valueOf;
|
24562 | }
|
24563 |
|
24564 | return a;
|
24565 | }
|
24566 |
|
24567 | function createUTC(input, format, locale, strict) {
|
24568 | return createLocalOrUTC(input, format, locale, strict, true).utc();
|
24569 | }
|
24570 |
|
24571 | function defaultParsingFlags() {
|
24572 |
|
24573 | return {
|
24574 | empty: false,
|
24575 | unusedTokens: [],
|
24576 | unusedInput: [],
|
24577 | overflow: -2,
|
24578 | charsLeftOver: 0,
|
24579 | nullInput: false,
|
24580 | invalidMonth: null,
|
24581 | invalidFormat: false,
|
24582 | userInvalidated: false,
|
24583 | iso: false,
|
24584 | parsedDateParts: [],
|
24585 | meridiem: null,
|
24586 | rfc2822: false,
|
24587 | weekdayMismatch: false
|
24588 | };
|
24589 | }
|
24590 |
|
24591 | function getParsingFlags(m) {
|
24592 | if (m._pf == null) {
|
24593 | m._pf = defaultParsingFlags();
|
24594 | }
|
24595 |
|
24596 | return m._pf;
|
24597 | }
|
24598 |
|
24599 | var some;
|
24600 |
|
24601 | if (Array.prototype.some) {
|
24602 | some = Array.prototype.some;
|
24603 | } else {
|
24604 | some = function (fun) {
|
24605 | var t = Object(this);
|
24606 | var len = t.length >>> 0;
|
24607 |
|
24608 | for (var i = 0; i < len; i++) {
|
24609 | if (i in t && fun.call(this, t[i], i, t)) {
|
24610 | return true;
|
24611 | }
|
24612 | }
|
24613 |
|
24614 | return false;
|
24615 | };
|
24616 | }
|
24617 |
|
24618 | function isValid(m) {
|
24619 | if (m._isValid == null) {
|
24620 | var flags = getParsingFlags(m);
|
24621 | var parsedParts = some.call(flags.parsedDateParts, function (i) {
|
24622 | return i != null;
|
24623 | });
|
24624 | var isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
|
24625 |
|
24626 | if (m._strict) {
|
24627 | isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined;
|
24628 | }
|
24629 |
|
24630 | if (Object.isFrozen == null || !Object.isFrozen(m)) {
|
24631 | m._isValid = isNowValid;
|
24632 | } else {
|
24633 | return isNowValid;
|
24634 | }
|
24635 | }
|
24636 |
|
24637 | return m._isValid;
|
24638 | }
|
24639 |
|
24640 | function createInvalid(flags) {
|
24641 | var m = createUTC(NaN);
|
24642 |
|
24643 | if (flags != null) {
|
24644 | extend(getParsingFlags(m), flags);
|
24645 | } else {
|
24646 | getParsingFlags(m).userInvalidated = true;
|
24647 | }
|
24648 |
|
24649 | return m;
|
24650 | }
|
24651 |
|
24652 |
|
24653 |
|
24654 | var momentProperties = hooks.momentProperties = [];
|
24655 |
|
24656 | function copyConfig(to, from) {
|
24657 | var i, prop, val;
|
24658 |
|
24659 | if (!isUndefined(from._isAMomentObject)) {
|
24660 | to._isAMomentObject = from._isAMomentObject;
|
24661 | }
|
24662 |
|
24663 | if (!isUndefined(from._i)) {
|
24664 | to._i = from._i;
|
24665 | }
|
24666 |
|
24667 | if (!isUndefined(from._f)) {
|
24668 | to._f = from._f;
|
24669 | }
|
24670 |
|
24671 | if (!isUndefined(from._l)) {
|
24672 | to._l = from._l;
|
24673 | }
|
24674 |
|
24675 | if (!isUndefined(from._strict)) {
|
24676 | to._strict = from._strict;
|
24677 | }
|
24678 |
|
24679 | if (!isUndefined(from._tzm)) {
|
24680 | to._tzm = from._tzm;
|
24681 | }
|
24682 |
|
24683 | if (!isUndefined(from._isUTC)) {
|
24684 | to._isUTC = from._isUTC;
|
24685 | }
|
24686 |
|
24687 | if (!isUndefined(from._offset)) {
|
24688 | to._offset = from._offset;
|
24689 | }
|
24690 |
|
24691 | if (!isUndefined(from._pf)) {
|
24692 | to._pf = getParsingFlags(from);
|
24693 | }
|
24694 |
|
24695 | if (!isUndefined(from._locale)) {
|
24696 | to._locale = from._locale;
|
24697 | }
|
24698 |
|
24699 | if (momentProperties.length > 0) {
|
24700 | for (i = 0; i < momentProperties.length; i++) {
|
24701 | prop = momentProperties[i];
|
24702 | val = from[prop];
|
24703 |
|
24704 | if (!isUndefined(val)) {
|
24705 | to[prop] = val;
|
24706 | }
|
24707 | }
|
24708 | }
|
24709 |
|
24710 | return to;
|
24711 | }
|
24712 |
|
24713 | var updateInProgress = false;
|
24714 |
|
24715 | function Moment(config) {
|
24716 | copyConfig(this, config);
|
24717 | this._d = new Date(config._d != null ? config._d.getTime() : NaN);
|
24718 |
|
24719 | if (!this.isValid()) {
|
24720 | this._d = new Date(NaN);
|
24721 | }
|
24722 |
|
24723 |
|
24724 |
|
24725 | if (updateInProgress === false) {
|
24726 | updateInProgress = true;
|
24727 | hooks.updateOffset(this);
|
24728 | updateInProgress = false;
|
24729 | }
|
24730 | }
|
24731 |
|
24732 | function isMoment(obj) {
|
24733 | return obj instanceof Moment || obj != null && obj._isAMomentObject != null;
|
24734 | }
|
24735 |
|
24736 | function absFloor(number) {
|
24737 | if (number < 0) {
|
24738 |
|
24739 | return Math.ceil(number) || 0;
|
24740 | } else {
|
24741 | return Math.floor(number);
|
24742 | }
|
24743 | }
|
24744 |
|
24745 | function toInt(argumentForCoercion) {
|
24746 | var coercedNumber = +argumentForCoercion,
|
24747 | value = 0;
|
24748 |
|
24749 | if (coercedNumber !== 0 && isFinite(coercedNumber)) {
|
24750 | value = absFloor(coercedNumber);
|
24751 | }
|
24752 |
|
24753 | return value;
|
24754 | }
|
24755 |
|
24756 |
|
24757 | function compareArrays(array1, array2, dontConvert) {
|
24758 | var len = Math.min(array1.length, array2.length),
|
24759 | lengthDiff = Math.abs(array1.length - array2.length),
|
24760 | diffs = 0,
|
24761 | i;
|
24762 |
|
24763 | for (i = 0; i < len; i++) {
|
24764 | if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) {
|
24765 | diffs++;
|
24766 | }
|
24767 | }
|
24768 |
|
24769 | return diffs + lengthDiff;
|
24770 | }
|
24771 |
|
24772 | function warn(msg) {
|
24773 | if (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {
|
24774 | console.warn('Deprecation warning: ' + msg);
|
24775 | }
|
24776 | }
|
24777 |
|
24778 | function deprecate(msg, fn) {
|
24779 | var firstTime = true;
|
24780 | return extend(function () {
|
24781 | if (hooks.deprecationHandler != null) {
|
24782 | hooks.deprecationHandler(null, msg);
|
24783 | }
|
24784 |
|
24785 | if (firstTime) {
|
24786 | var args = [];
|
24787 | var arg;
|
24788 |
|
24789 | for (var i = 0; i < arguments.length; i++) {
|
24790 | arg = '';
|
24791 |
|
24792 | if (typeof arguments[i] === 'object') {
|
24793 | arg += '\n[' + i + '] ';
|
24794 |
|
24795 | for (var key in arguments[0]) {
|
24796 | arg += key + ': ' + arguments[0][key] + ', ';
|
24797 | }
|
24798 |
|
24799 | arg = arg.slice(0, -2);
|
24800 | } else {
|
24801 | arg = arguments[i];
|
24802 | }
|
24803 |
|
24804 | args.push(arg);
|
24805 | }
|
24806 |
|
24807 | warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + new Error().stack);
|
24808 | firstTime = false;
|
24809 | }
|
24810 |
|
24811 | return fn.apply(this, arguments);
|
24812 | }, fn);
|
24813 | }
|
24814 |
|
24815 | var deprecations = {};
|
24816 |
|
24817 | function deprecateSimple(name, msg) {
|
24818 | if (hooks.deprecationHandler != null) {
|
24819 | hooks.deprecationHandler(name, msg);
|
24820 | }
|
24821 |
|
24822 | if (!deprecations[name]) {
|
24823 | warn(msg);
|
24824 | deprecations[name] = true;
|
24825 | }
|
24826 | }
|
24827 |
|
24828 | hooks.suppressDeprecationWarnings = false;
|
24829 | hooks.deprecationHandler = null;
|
24830 |
|
24831 | function isFunction(input) {
|
24832 | return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
|
24833 | }
|
24834 |
|
24835 | function set(config) {
|
24836 | var prop, i;
|
24837 |
|
24838 | for (i in config) {
|
24839 | prop = config[i];
|
24840 |
|
24841 | if (isFunction(prop)) {
|
24842 | this[i] = prop;
|
24843 | } else {
|
24844 | this['_' + i] = prop;
|
24845 | }
|
24846 | }
|
24847 |
|
24848 | this._config = config;
|
24849 |
|
24850 |
|
24851 |
|
24852 | this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\d{1,2}/.source);
|
24853 | }
|
24854 |
|
24855 | function mergeConfigs(parentConfig, childConfig) {
|
24856 | var res = extend({}, parentConfig),
|
24857 | prop;
|
24858 |
|
24859 | for (prop in childConfig) {
|
24860 | if (hasOwnProp(childConfig, prop)) {
|
24861 | if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
|
24862 | res[prop] = {};
|
24863 | extend(res[prop], parentConfig[prop]);
|
24864 | extend(res[prop], childConfig[prop]);
|
24865 | } else if (childConfig[prop] != null) {
|
24866 | res[prop] = childConfig[prop];
|
24867 | } else {
|
24868 | delete res[prop];
|
24869 | }
|
24870 | }
|
24871 | }
|
24872 |
|
24873 | for (prop in parentConfig) {
|
24874 | if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {
|
24875 |
|
24876 | res[prop] = extend({}, res[prop]);
|
24877 | }
|
24878 | }
|
24879 |
|
24880 | return res;
|
24881 | }
|
24882 |
|
24883 | function Locale(config) {
|
24884 | if (config != null) {
|
24885 | this.set(config);
|
24886 | }
|
24887 | }
|
24888 |
|
24889 | var keys;
|
24890 |
|
24891 | if (Object.keys) {
|
24892 | keys = Object.keys;
|
24893 | } else {
|
24894 | keys = function (obj) {
|
24895 | var i,
|
24896 | res = [];
|
24897 |
|
24898 | for (i in obj) {
|
24899 | if (hasOwnProp(obj, i)) {
|
24900 | res.push(i);
|
24901 | }
|
24902 | }
|
24903 |
|
24904 | return res;
|
24905 | };
|
24906 | }
|
24907 |
|
24908 | var defaultCalendar = {
|
24909 | sameDay: '[Today at] LT',
|
24910 | nextDay: '[Tomorrow at] LT',
|
24911 | nextWeek: 'dddd [at] LT',
|
24912 | lastDay: '[Yesterday at] LT',
|
24913 | lastWeek: '[Last] dddd [at] LT',
|
24914 | sameElse: 'L'
|
24915 | };
|
24916 |
|
24917 | function calendar(key, mom, now) {
|
24918 | var output = this._calendar[key] || this._calendar['sameElse'];
|
24919 | return isFunction(output) ? output.call(mom, now) : output;
|
24920 | }
|
24921 |
|
24922 | var defaultLongDateFormat = {
|
24923 | LTS: 'h:mm:ss A',
|
24924 | LT: 'h:mm A',
|
24925 | L: 'MM/DD/YYYY',
|
24926 | LL: 'MMMM D, YYYY',
|
24927 | LLL: 'MMMM D, YYYY h:mm A',
|
24928 | LLLL: 'dddd, MMMM D, YYYY h:mm A'
|
24929 | };
|
24930 |
|
24931 | function longDateFormat(key) {
|
24932 | var format = this._longDateFormat[key],
|
24933 | formatUpper = this._longDateFormat[key.toUpperCase()];
|
24934 |
|
24935 | if (format || !formatUpper) {
|
24936 | return format;
|
24937 | }
|
24938 |
|
24939 | this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
|
24940 | return val.slice(1);
|
24941 | });
|
24942 | return this._longDateFormat[key];
|
24943 | }
|
24944 |
|
24945 | var defaultInvalidDate = 'Invalid date';
|
24946 |
|
24947 | function invalidDate() {
|
24948 | return this._invalidDate;
|
24949 | }
|
24950 |
|
24951 | var defaultOrdinal = '%d';
|
24952 | var defaultDayOfMonthOrdinalParse = /\d{1,2}/;
|
24953 |
|
24954 | function ordinal(number) {
|
24955 | return this._ordinal.replace('%d', number);
|
24956 | }
|
24957 |
|
24958 | var defaultRelativeTime = {
|
24959 | future: 'in %s',
|
24960 | past: '%s ago',
|
24961 | s: 'a few seconds',
|
24962 | ss: '%d seconds',
|
24963 | m: 'a minute',
|
24964 | mm: '%d minutes',
|
24965 | h: 'an hour',
|
24966 | hh: '%d hours',
|
24967 | d: 'a day',
|
24968 | dd: '%d days',
|
24969 | M: 'a month',
|
24970 | MM: '%d months',
|
24971 | y: 'a year',
|
24972 | yy: '%d years'
|
24973 | };
|
24974 |
|
24975 | function relativeTime(number, withoutSuffix, string, isFuture) {
|
24976 | var output = this._relativeTime[string];
|
24977 | return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
|
24978 | }
|
24979 |
|
24980 | function pastFuture(diff, output) {
|
24981 | var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
|
24982 | return isFunction(format) ? format(output) : format.replace(/%s/i, output);
|
24983 | }
|
24984 |
|
24985 | var aliases = {};
|
24986 |
|
24987 | function addUnitAlias(unit, shorthand) {
|
24988 | var lowerCase = unit.toLowerCase();
|
24989 | aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
|
24990 | }
|
24991 |
|
24992 | function normalizeUnits(units) {
|
24993 | return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
|
24994 | }
|
24995 |
|
24996 | function normalizeObjectUnits(inputObject) {
|
24997 | var normalizedInput = {},
|
24998 | normalizedProp,
|
24999 | prop;
|
25000 |
|
25001 | for (prop in inputObject) {
|
25002 | if (hasOwnProp(inputObject, prop)) {
|
25003 | normalizedProp = normalizeUnits(prop);
|
25004 |
|
25005 | if (normalizedProp) {
|
25006 | normalizedInput[normalizedProp] = inputObject[prop];
|
25007 | }
|
25008 | }
|
25009 | }
|
25010 |
|
25011 | return normalizedInput;
|
25012 | }
|
25013 |
|
25014 | var priorities = {};
|
25015 |
|
25016 | function addUnitPriority(unit, priority) {
|
25017 | priorities[unit] = priority;
|
25018 | }
|
25019 |
|
25020 | function getPrioritizedUnits(unitsObj) {
|
25021 | var units = [];
|
25022 |
|
25023 | for (var u in unitsObj) {
|
25024 | units.push({
|
25025 | unit: u,
|
25026 | priority: priorities[u]
|
25027 | });
|
25028 | }
|
25029 |
|
25030 | units.sort(function (a, b) {
|
25031 | return a.priority - b.priority;
|
25032 | });
|
25033 | return units;
|
25034 | }
|
25035 |
|
25036 | function zeroFill(number, targetLength, forceSign) {
|
25037 | var absNumber = '' + Math.abs(number),
|
25038 | zerosToFill = targetLength - absNumber.length,
|
25039 | sign = number >= 0;
|
25040 | return (sign ? forceSign ? '+' : '' : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
|
25041 | }
|
25042 |
|
25043 | var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
|
25044 | var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
|
25045 | var formatFunctions = {};
|
25046 | var formatTokenFunctions = {};
|
25047 |
|
25048 |
|
25049 |
|
25050 |
|
25051 | function addFormatToken(token, padded, ordinal, callback) {
|
25052 | var func = callback;
|
25053 |
|
25054 | if (typeof callback === 'string') {
|
25055 | func = function () {
|
25056 | return this[callback]();
|
25057 | };
|
25058 | }
|
25059 |
|
25060 | if (token) {
|
25061 | formatTokenFunctions[token] = func;
|
25062 | }
|
25063 |
|
25064 | if (padded) {
|
25065 | formatTokenFunctions[padded[0]] = function () {
|
25066 | return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
|
25067 | };
|
25068 | }
|
25069 |
|
25070 | if (ordinal) {
|
25071 | formatTokenFunctions[ordinal] = function () {
|
25072 | return this.localeData().ordinal(func.apply(this, arguments), token);
|
25073 | };
|
25074 | }
|
25075 | }
|
25076 |
|
25077 | function removeFormattingTokens(input) {
|
25078 | if (input.match(/\[[\s\S]/)) {
|
25079 | return input.replace(/^\[|\]$/g, '');
|
25080 | }
|
25081 |
|
25082 | return input.replace(/\\/g, '');
|
25083 | }
|
25084 |
|
25085 | function makeFormatFunction(format) {
|
25086 | var array = format.match(formattingTokens),
|
25087 | i,
|
25088 | length;
|
25089 |
|
25090 | for (i = 0, length = array.length; i < length; i++) {
|
25091 | if (formatTokenFunctions[array[i]]) {
|
25092 | array[i] = formatTokenFunctions[array[i]];
|
25093 | } else {
|
25094 | array[i] = removeFormattingTokens(array[i]);
|
25095 | }
|
25096 | }
|
25097 |
|
25098 | return function (mom) {
|
25099 | var output = '',
|
25100 | i;
|
25101 |
|
25102 | for (i = 0; i < length; i++) {
|
25103 | output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];
|
25104 | }
|
25105 |
|
25106 | return output;
|
25107 | };
|
25108 | }
|
25109 |
|
25110 |
|
25111 | function formatMoment(m, format) {
|
25112 | if (!m.isValid()) {
|
25113 | return m.localeData().invalidDate();
|
25114 | }
|
25115 |
|
25116 | format = expandFormat(format, m.localeData());
|
25117 | formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
|
25118 | return formatFunctions[format](m);
|
25119 | }
|
25120 |
|
25121 | function expandFormat(format, locale) {
|
25122 | var i = 5;
|
25123 |
|
25124 | function replaceLongDateFormatTokens(input) {
|
25125 | return locale.longDateFormat(input) || input;
|
25126 | }
|
25127 |
|
25128 | localFormattingTokens.lastIndex = 0;
|
25129 |
|
25130 | while (i >= 0 && localFormattingTokens.test(format)) {
|
25131 | format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
|
25132 | localFormattingTokens.lastIndex = 0;
|
25133 | i -= 1;
|
25134 | }
|
25135 |
|
25136 | return format;
|
25137 | }
|
25138 |
|
25139 | var match1 = /\d/;
|
25140 |
|
25141 | var match2 = /\d\d/;
|
25142 |
|
25143 | var match3 = /\d{3}/;
|
25144 |
|
25145 | var match4 = /\d{4}/;
|
25146 |
|
25147 | var match6 = /[+-]?\d{6}/;
|
25148 |
|
25149 | var match1to2 = /\d\d?/;
|
25150 |
|
25151 | var match3to4 = /\d\d\d\d?/;
|
25152 |
|
25153 | var match5to6 = /\d\d\d\d\d\d?/;
|
25154 |
|
25155 | var match1to3 = /\d{1,3}/;
|
25156 |
|
25157 | var match1to4 = /\d{1,4}/;
|
25158 |
|
25159 | var match1to6 = /[+-]?\d{1,6}/;
|
25160 |
|
25161 | var matchUnsigned = /\d+/;
|
25162 |
|
25163 | var matchSigned = /[+-]?\d+/;
|
25164 |
|
25165 | var matchOffset = /Z|[+-]\d\d:?\d\d/gi;
|
25166 |
|
25167 | var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi;
|
25168 |
|
25169 | var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/;
|
25170 |
|
25171 |
|
25172 |
|
25173 | var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
|
25174 | var regexes = {};
|
25175 |
|
25176 | function addRegexToken(token, regex, strictRegex) {
|
25177 | regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
|
25178 | return isStrict && strictRegex ? strictRegex : regex;
|
25179 | };
|
25180 | }
|
25181 |
|
25182 | function getParseRegexForToken(token, config) {
|
25183 | if (!hasOwnProp(regexes, token)) {
|
25184 | return new RegExp(unescapeFormat(token));
|
25185 | }
|
25186 |
|
25187 | return regexes[token](config._strict, config._locale);
|
25188 | }
|
25189 |
|
25190 |
|
25191 | function unescapeFormat(s) {
|
25192 | return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
|
25193 | return p1 || p2 || p3 || p4;
|
25194 | }));
|
25195 | }
|
25196 |
|
25197 | function regexEscape(s) {
|
25198 | return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
25199 | }
|
25200 |
|
25201 | var tokens = {};
|
25202 |
|
25203 | function addParseToken(token, callback) {
|
25204 | var i,
|
25205 | func = callback;
|
25206 |
|
25207 | if (typeof token === 'string') {
|
25208 | token = [token];
|
25209 | }
|
25210 |
|
25211 | if (isNumber(callback)) {
|
25212 | func = function (input, array) {
|
25213 | array[callback] = toInt(input);
|
25214 | };
|
25215 | }
|
25216 |
|
25217 | for (i = 0; i < token.length; i++) {
|
25218 | tokens[token[i]] = func;
|
25219 | }
|
25220 | }
|
25221 |
|
25222 | function addWeekParseToken(token, callback) {
|
25223 | addParseToken(token, function (input, array, config, token) {
|
25224 | config._w = config._w || {};
|
25225 | callback(input, config._w, config, token);
|
25226 | });
|
25227 | }
|
25228 |
|
25229 | function addTimeToArrayFromToken(token, input, config) {
|
25230 | if (input != null && hasOwnProp(tokens, token)) {
|
25231 | tokens[token](input, config._a, config, token);
|
25232 | }
|
25233 | }
|
25234 |
|
25235 | var YEAR = 0;
|
25236 | var MONTH = 1;
|
25237 | var DATE = 2;
|
25238 | var HOUR = 3;
|
25239 | var MINUTE = 4;
|
25240 | var SECOND = 5;
|
25241 | var MILLISECOND = 6;
|
25242 | var WEEK = 7;
|
25243 | var WEEKDAY = 8;
|
25244 |
|
25245 | addFormatToken('Y', 0, 0, function () {
|
25246 | var y = this.year();
|
25247 | return y <= 9999 ? '' + y : '+' + y;
|
25248 | });
|
25249 | addFormatToken(0, ['YY', 2], 0, function () {
|
25250 | return this.year() % 100;
|
25251 | });
|
25252 | addFormatToken(0, ['YYYY', 4], 0, 'year');
|
25253 | addFormatToken(0, ['YYYYY', 5], 0, 'year');
|
25254 | addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
|
25255 |
|
25256 | addUnitAlias('year', 'y');
|
25257 |
|
25258 | addUnitPriority('year', 1);
|
25259 |
|
25260 | addRegexToken('Y', matchSigned);
|
25261 | addRegexToken('YY', match1to2, match2);
|
25262 | addRegexToken('YYYY', match1to4, match4);
|
25263 | addRegexToken('YYYYY', match1to6, match6);
|
25264 | addRegexToken('YYYYYY', match1to6, match6);
|
25265 | addParseToken(['YYYYY', 'YYYYYY'], YEAR);
|
25266 | addParseToken('YYYY', function (input, array) {
|
25267 | array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
|
25268 | });
|
25269 | addParseToken('YY', function (input, array) {
|
25270 | array[YEAR] = hooks.parseTwoDigitYear(input);
|
25271 | });
|
25272 | addParseToken('Y', function (input, array) {
|
25273 | array[YEAR] = parseInt(input, 10);
|
25274 | });
|
25275 |
|
25276 | function daysInYear(year) {
|
25277 | return isLeapYear(year) ? 366 : 365;
|
25278 | }
|
25279 |
|
25280 | function isLeapYear(year) {
|
25281 | return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
25282 | }
|
25283 |
|
25284 |
|
25285 | hooks.parseTwoDigitYear = function (input) {
|
25286 | return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
|
25287 | };
|
25288 |
|
25289 |
|
25290 | var getSetYear = makeGetSet('FullYear', true);
|
25291 |
|
25292 | function getIsLeapYear() {
|
25293 | return isLeapYear(this.year());
|
25294 | }
|
25295 |
|
25296 | function makeGetSet(unit, keepTime) {
|
25297 | return function (value) {
|
25298 | if (value != null) {
|
25299 | set$1(this, unit, value);
|
25300 | hooks.updateOffset(this, keepTime);
|
25301 | return this;
|
25302 | } else {
|
25303 | return get(this, unit);
|
25304 | }
|
25305 | };
|
25306 | }
|
25307 |
|
25308 | function get(mom, unit) {
|
25309 | return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
|
25310 | }
|
25311 |
|
25312 | function set$1(mom, unit, value) {
|
25313 | if (mom.isValid() && !isNaN(value)) {
|
25314 | if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
|
25315 | mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
|
25316 | } else {
|
25317 | mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
|
25318 | }
|
25319 | }
|
25320 | }
|
25321 |
|
25322 |
|
25323 | function stringGet(units) {
|
25324 | units = normalizeUnits(units);
|
25325 |
|
25326 | if (isFunction(this[units])) {
|
25327 | return this[units]();
|
25328 | }
|
25329 |
|
25330 | return this;
|
25331 | }
|
25332 |
|
25333 | function stringSet(units, value) {
|
25334 | if (typeof units === 'object') {
|
25335 | units = normalizeObjectUnits(units);
|
25336 | var prioritized = getPrioritizedUnits(units);
|
25337 |
|
25338 | for (var i = 0; i < prioritized.length; i++) {
|
25339 | this[prioritized[i].unit](units[prioritized[i].unit]);
|
25340 | }
|
25341 | } else {
|
25342 | units = normalizeUnits(units);
|
25343 |
|
25344 | if (isFunction(this[units])) {
|
25345 | return this[units](value);
|
25346 | }
|
25347 | }
|
25348 |
|
25349 | return this;
|
25350 | }
|
25351 |
|
25352 | function mod(n, x) {
|
25353 | return (n % x + x) % x;
|
25354 | }
|
25355 |
|
25356 | var indexOf;
|
25357 |
|
25358 | if (Array.prototype.indexOf) {
|
25359 | indexOf = Array.prototype.indexOf;
|
25360 | } else {
|
25361 | indexOf = function (o) {
|
25362 |
|
25363 | var i;
|
25364 |
|
25365 | for (i = 0; i < this.length; ++i) {
|
25366 | if (this[i] === o) {
|
25367 | return i;
|
25368 | }
|
25369 | }
|
25370 |
|
25371 | return -1;
|
25372 | };
|
25373 | }
|
25374 |
|
25375 | function daysInMonth(year, month) {
|
25376 | if (isNaN(year) || isNaN(month)) {
|
25377 | return NaN;
|
25378 | }
|
25379 |
|
25380 | var modMonth = mod(month, 12);
|
25381 | year += (month - modMonth) / 12;
|
25382 | return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
|
25383 | }
|
25384 |
|
25385 |
|
25386 | addFormatToken('M', ['MM', 2], 'Mo', function () {
|
25387 | return this.month() + 1;
|
25388 | });
|
25389 | addFormatToken('MMM', 0, 0, function (format) {
|
25390 | return this.localeData().monthsShort(this, format);
|
25391 | });
|
25392 | addFormatToken('MMMM', 0, 0, function (format) {
|
25393 | return this.localeData().months(this, format);
|
25394 | });
|
25395 |
|
25396 | addUnitAlias('month', 'M');
|
25397 |
|
25398 | addUnitPriority('month', 8);
|
25399 |
|
25400 | addRegexToken('M', match1to2);
|
25401 | addRegexToken('MM', match1to2, match2);
|
25402 | addRegexToken('MMM', function (isStrict, locale) {
|
25403 | return locale.monthsShortRegex(isStrict);
|
25404 | });
|
25405 | addRegexToken('MMMM', function (isStrict, locale) {
|
25406 | return locale.monthsRegex(isStrict);
|
25407 | });
|
25408 | addParseToken(['M', 'MM'], function (input, array) {
|
25409 | array[MONTH] = toInt(input) - 1;
|
25410 | });
|
25411 | addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
|
25412 | var month = config._locale.monthsParse(input, token, config._strict);
|
25413 |
|
25414 |
|
25415 | if (month != null) {
|
25416 | array[MONTH] = month;
|
25417 | } else {
|
25418 | getParsingFlags(config).invalidMonth = input;
|
25419 | }
|
25420 | });
|
25421 |
|
25422 | var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
|
25423 | var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
|
25424 |
|
25425 | function localeMonths(m, format) {
|
25426 | if (!m) {
|
25427 | return isArray(this._months) ? this._months : this._months['standalone'];
|
25428 | }
|
25429 |
|
25430 | return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
|
25431 | }
|
25432 |
|
25433 | var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
|
25434 |
|
25435 | function localeMonthsShort(m, format) {
|
25436 | if (!m) {
|
25437 | return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone'];
|
25438 | }
|
25439 |
|
25440 | return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
|
25441 | }
|
25442 |
|
25443 | function handleStrictParse(monthName, format, strict) {
|
25444 | var i,
|
25445 | ii,
|
25446 | mom,
|
25447 | llc = monthName.toLocaleLowerCase();
|
25448 |
|
25449 | if (!this._monthsParse) {
|
25450 |
|
25451 | this._monthsParse = [];
|
25452 | this._longMonthsParse = [];
|
25453 | this._shortMonthsParse = [];
|
25454 |
|
25455 | for (i = 0; i < 12; ++i) {
|
25456 | mom = createUTC([2000, i]);
|
25457 | this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
|
25458 | this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
|
25459 | }
|
25460 | }
|
25461 |
|
25462 | if (strict) {
|
25463 | if (format === 'MMM') {
|
25464 | ii = indexOf.call(this._shortMonthsParse, llc);
|
25465 | return ii !== -1 ? ii : null;
|
25466 | } else {
|
25467 | ii = indexOf.call(this._longMonthsParse, llc);
|
25468 | return ii !== -1 ? ii : null;
|
25469 | }
|
25470 | } else {
|
25471 | if (format === 'MMM') {
|
25472 | ii = indexOf.call(this._shortMonthsParse, llc);
|
25473 |
|
25474 | if (ii !== -1) {
|
25475 | return ii;
|
25476 | }
|
25477 |
|
25478 | ii = indexOf.call(this._longMonthsParse, llc);
|
25479 | return ii !== -1 ? ii : null;
|
25480 | } else {
|
25481 | ii = indexOf.call(this._longMonthsParse, llc);
|
25482 |
|
25483 | if (ii !== -1) {
|
25484 | return ii;
|
25485 | }
|
25486 |
|
25487 | ii = indexOf.call(this._shortMonthsParse, llc);
|
25488 | return ii !== -1 ? ii : null;
|
25489 | }
|
25490 | }
|
25491 | }
|
25492 |
|
25493 | function localeMonthsParse(monthName, format, strict) {
|
25494 | var i, mom, regex;
|
25495 |
|
25496 | if (this._monthsParseExact) {
|
25497 | return handleStrictParse.call(this, monthName, format, strict);
|
25498 | }
|
25499 |
|
25500 | if (!this._monthsParse) {
|
25501 | this._monthsParse = [];
|
25502 | this._longMonthsParse = [];
|
25503 | this._shortMonthsParse = [];
|
25504 | }
|
25505 |
|
25506 |
|
25507 |
|
25508 |
|
25509 | for (i = 0; i < 12; i++) {
|
25510 |
|
25511 | mom = createUTC([2000, i]);
|
25512 |
|
25513 | if (strict && !this._longMonthsParse[i]) {
|
25514 | this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
|
25515 | this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
|
25516 | }
|
25517 |
|
25518 | if (!strict && !this._monthsParse[i]) {
|
25519 | regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
|
25520 | this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
|
25521 | }
|
25522 |
|
25523 |
|
25524 | if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
|
25525 | return i;
|
25526 | } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
|
25527 | return i;
|
25528 | } else if (!strict && this._monthsParse[i].test(monthName)) {
|
25529 | return i;
|
25530 | }
|
25531 | }
|
25532 | }
|
25533 |
|
25534 |
|
25535 | function setMonth(mom, value) {
|
25536 | var dayOfMonth;
|
25537 |
|
25538 | if (!mom.isValid()) {
|
25539 |
|
25540 | return mom;
|
25541 | }
|
25542 |
|
25543 | if (typeof value === 'string') {
|
25544 | if (/^\d+$/.test(value)) {
|
25545 | value = toInt(value);
|
25546 | } else {
|
25547 | value = mom.localeData().monthsParse(value);
|
25548 |
|
25549 | if (!isNumber(value)) {
|
25550 | return mom;
|
25551 | }
|
25552 | }
|
25553 | }
|
25554 |
|
25555 | dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
|
25556 |
|
25557 | mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
|
25558 |
|
25559 | return mom;
|
25560 | }
|
25561 |
|
25562 | function getSetMonth(value) {
|
25563 | if (value != null) {
|
25564 | setMonth(this, value);
|
25565 | hooks.updateOffset(this, true);
|
25566 | return this;
|
25567 | } else {
|
25568 | return get(this, 'Month');
|
25569 | }
|
25570 | }
|
25571 |
|
25572 | function getDaysInMonth() {
|
25573 | return daysInMonth(this.year(), this.month());
|
25574 | }
|
25575 |
|
25576 | var defaultMonthsShortRegex = matchWord;
|
25577 |
|
25578 | function monthsShortRegex(isStrict) {
|
25579 | if (this._monthsParseExact) {
|
25580 | if (!hasOwnProp(this, '_monthsRegex')) {
|
25581 | computeMonthsParse.call(this);
|
25582 | }
|
25583 |
|
25584 | if (isStrict) {
|
25585 | return this._monthsShortStrictRegex;
|
25586 | } else {
|
25587 | return this._monthsShortRegex;
|
25588 | }
|
25589 | } else {
|
25590 | if (!hasOwnProp(this, '_monthsShortRegex')) {
|
25591 | this._monthsShortRegex = defaultMonthsShortRegex;
|
25592 | }
|
25593 |
|
25594 | return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;
|
25595 | }
|
25596 | }
|
25597 |
|
25598 | var defaultMonthsRegex = matchWord;
|
25599 |
|
25600 | function monthsRegex(isStrict) {
|
25601 | if (this._monthsParseExact) {
|
25602 | if (!hasOwnProp(this, '_monthsRegex')) {
|
25603 | computeMonthsParse.call(this);
|
25604 | }
|
25605 |
|
25606 | if (isStrict) {
|
25607 | return this._monthsStrictRegex;
|
25608 | } else {
|
25609 | return this._monthsRegex;
|
25610 | }
|
25611 | } else {
|
25612 | if (!hasOwnProp(this, '_monthsRegex')) {
|
25613 | this._monthsRegex = defaultMonthsRegex;
|
25614 | }
|
25615 |
|
25616 | return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;
|
25617 | }
|
25618 | }
|
25619 |
|
25620 | function computeMonthsParse() {
|
25621 | function cmpLenRev(a, b) {
|
25622 | return b.length - a.length;
|
25623 | }
|
25624 |
|
25625 | var shortPieces = [],
|
25626 | longPieces = [],
|
25627 | mixedPieces = [],
|
25628 | i,
|
25629 | mom;
|
25630 |
|
25631 | for (i = 0; i < 12; i++) {
|
25632 |
|
25633 | mom = createUTC([2000, i]);
|
25634 | shortPieces.push(this.monthsShort(mom, ''));
|
25635 | longPieces.push(this.months(mom, ''));
|
25636 | mixedPieces.push(this.months(mom, ''));
|
25637 | mixedPieces.push(this.monthsShort(mom, ''));
|
25638 | }
|
25639 |
|
25640 |
|
25641 |
|
25642 | shortPieces.sort(cmpLenRev);
|
25643 | longPieces.sort(cmpLenRev);
|
25644 | mixedPieces.sort(cmpLenRev);
|
25645 |
|
25646 | for (i = 0; i < 12; i++) {
|
25647 | shortPieces[i] = regexEscape(shortPieces[i]);
|
25648 | longPieces[i] = regexEscape(longPieces[i]);
|
25649 | }
|
25650 |
|
25651 | for (i = 0; i < 24; i++) {
|
25652 | mixedPieces[i] = regexEscape(mixedPieces[i]);
|
25653 | }
|
25654 |
|
25655 | this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
25656 | this._monthsShortRegex = this._monthsRegex;
|
25657 | this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
|
25658 | this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
|
25659 | }
|
25660 |
|
25661 | function createDate(y, m, d, h, M, s, ms) {
|
25662 |
|
25663 |
|
25664 | var date;
|
25665 |
|
25666 | if (y < 100 && y >= 0) {
|
25667 |
|
25668 | date = new Date(y + 400, m, d, h, M, s, ms);
|
25669 |
|
25670 | if (isFinite(date.getFullYear())) {
|
25671 | date.setFullYear(y);
|
25672 | }
|
25673 | } else {
|
25674 | date = new Date(y, m, d, h, M, s, ms);
|
25675 | }
|
25676 |
|
25677 | return date;
|
25678 | }
|
25679 |
|
25680 | function createUTCDate(y) {
|
25681 | var date;
|
25682 |
|
25683 | if (y < 100 && y >= 0) {
|
25684 | var args = Array.prototype.slice.call(arguments);
|
25685 |
|
25686 | args[0] = y + 400;
|
25687 | date = new Date(Date.UTC.apply(null, args));
|
25688 |
|
25689 | if (isFinite(date.getUTCFullYear())) {
|
25690 | date.setUTCFullYear(y);
|
25691 | }
|
25692 | } else {
|
25693 | date = new Date(Date.UTC.apply(null, arguments));
|
25694 | }
|
25695 |
|
25696 | return date;
|
25697 | }
|
25698 |
|
25699 |
|
25700 | function firstWeekOffset(year, dow, doy) {
|
25701 | var
|
25702 | fwd = 7 + dow - doy,
|
25703 |
|
25704 | fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
|
25705 | return -fwdlw + fwd - 1;
|
25706 | }
|
25707 |
|
25708 |
|
25709 | function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
|
25710 | var localWeekday = (7 + weekday - dow) % 7,
|
25711 | weekOffset = firstWeekOffset(year, dow, doy),
|
25712 | dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
|
25713 | resYear,
|
25714 | resDayOfYear;
|
25715 |
|
25716 | if (dayOfYear <= 0) {
|
25717 | resYear = year - 1;
|
25718 | resDayOfYear = daysInYear(resYear) + dayOfYear;
|
25719 | } else if (dayOfYear > daysInYear(year)) {
|
25720 | resYear = year + 1;
|
25721 | resDayOfYear = dayOfYear - daysInYear(year);
|
25722 | } else {
|
25723 | resYear = year;
|
25724 | resDayOfYear = dayOfYear;
|
25725 | }
|
25726 |
|
25727 | return {
|
25728 | year: resYear,
|
25729 | dayOfYear: resDayOfYear
|
25730 | };
|
25731 | }
|
25732 |
|
25733 | function weekOfYear(mom, dow, doy) {
|
25734 | var weekOffset = firstWeekOffset(mom.year(), dow, doy),
|
25735 | week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
|
25736 | resWeek,
|
25737 | resYear;
|
25738 |
|
25739 | if (week < 1) {
|
25740 | resYear = mom.year() - 1;
|
25741 | resWeek = week + weeksInYear(resYear, dow, doy);
|
25742 | } else if (week > weeksInYear(mom.year(), dow, doy)) {
|
25743 | resWeek = week - weeksInYear(mom.year(), dow, doy);
|
25744 | resYear = mom.year() + 1;
|
25745 | } else {
|
25746 | resYear = mom.year();
|
25747 | resWeek = week;
|
25748 | }
|
25749 |
|
25750 | return {
|
25751 | week: resWeek,
|
25752 | year: resYear
|
25753 | };
|
25754 | }
|
25755 |
|
25756 | function weeksInYear(year, dow, doy) {
|
25757 | var weekOffset = firstWeekOffset(year, dow, doy),
|
25758 | weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
|
25759 | return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
|
25760 | }
|
25761 |
|
25762 |
|
25763 | addFormatToken('w', ['ww', 2], 'wo', 'week');
|
25764 | addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
|
25765 |
|
25766 | addUnitAlias('week', 'w');
|
25767 | addUnitAlias('isoWeek', 'W');
|
25768 |
|
25769 | addUnitPriority('week', 5);
|
25770 | addUnitPriority('isoWeek', 5);
|
25771 |
|
25772 | addRegexToken('w', match1to2);
|
25773 | addRegexToken('ww', match1to2, match2);
|
25774 | addRegexToken('W', match1to2);
|
25775 | addRegexToken('WW', match1to2, match2);
|
25776 | addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
|
25777 | week[token.substr(0, 1)] = toInt(input);
|
25778 | });
|
25779 |
|
25780 |
|
25781 | function localeWeek(mom) {
|
25782 | return weekOfYear(mom, this._week.dow, this._week.doy).week;
|
25783 | }
|
25784 |
|
25785 | var defaultLocaleWeek = {
|
25786 | dow: 0,
|
25787 |
|
25788 | doy: 6
|
25789 |
|
25790 | };
|
25791 |
|
25792 | function localeFirstDayOfWeek() {
|
25793 | return this._week.dow;
|
25794 | }
|
25795 |
|
25796 | function localeFirstDayOfYear() {
|
25797 | return this._week.doy;
|
25798 | }
|
25799 |
|
25800 |
|
25801 | function getSetWeek(input) {
|
25802 | var week = this.localeData().week(this);
|
25803 | return input == null ? week : this.add((input - week) * 7, 'd');
|
25804 | }
|
25805 |
|
25806 | function getSetISOWeek(input) {
|
25807 | var week = weekOfYear(this, 1, 4).week;
|
25808 | return input == null ? week : this.add((input - week) * 7, 'd');
|
25809 | }
|
25810 |
|
25811 |
|
25812 | addFormatToken('d', 0, 'do', 'day');
|
25813 | addFormatToken('dd', 0, 0, function (format) {
|
25814 | return this.localeData().weekdaysMin(this, format);
|
25815 | });
|
25816 | addFormatToken('ddd', 0, 0, function (format) {
|
25817 | return this.localeData().weekdaysShort(this, format);
|
25818 | });
|
25819 | addFormatToken('dddd', 0, 0, function (format) {
|
25820 | return this.localeData().weekdays(this, format);
|
25821 | });
|
25822 | addFormatToken('e', 0, 0, 'weekday');
|
25823 | addFormatToken('E', 0, 0, 'isoWeekday');
|
25824 |
|
25825 | addUnitAlias('day', 'd');
|
25826 | addUnitAlias('weekday', 'e');
|
25827 | addUnitAlias('isoWeekday', 'E');
|
25828 |
|
25829 | addUnitPriority('day', 11);
|
25830 | addUnitPriority('weekday', 11);
|
25831 | addUnitPriority('isoWeekday', 11);
|
25832 |
|
25833 | addRegexToken('d', match1to2);
|
25834 | addRegexToken('e', match1to2);
|
25835 | addRegexToken('E', match1to2);
|
25836 | addRegexToken('dd', function (isStrict, locale) {
|
25837 | return locale.weekdaysMinRegex(isStrict);
|
25838 | });
|
25839 | addRegexToken('ddd', function (isStrict, locale) {
|
25840 | return locale.weekdaysShortRegex(isStrict);
|
25841 | });
|
25842 | addRegexToken('dddd', function (isStrict, locale) {
|
25843 | return locale.weekdaysRegex(isStrict);
|
25844 | });
|
25845 | addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
|
25846 | var weekday = config._locale.weekdaysParse(input, token, config._strict);
|
25847 |
|
25848 |
|
25849 | if (weekday != null) {
|
25850 | week.d = weekday;
|
25851 | } else {
|
25852 | getParsingFlags(config).invalidWeekday = input;
|
25853 | }
|
25854 | });
|
25855 | addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
|
25856 | week[token] = toInt(input);
|
25857 | });
|
25858 |
|
25859 | function parseWeekday(input, locale) {
|
25860 | if (typeof input !== 'string') {
|
25861 | return input;
|
25862 | }
|
25863 |
|
25864 | if (!isNaN(input)) {
|
25865 | return parseInt(input, 10);
|
25866 | }
|
25867 |
|
25868 | input = locale.weekdaysParse(input);
|
25869 |
|
25870 | if (typeof input === 'number') {
|
25871 | return input;
|
25872 | }
|
25873 |
|
25874 | return null;
|
25875 | }
|
25876 |
|
25877 | function parseIsoWeekday(input, locale) {
|
25878 | if (typeof input === 'string') {
|
25879 | return locale.weekdaysParse(input) % 7 || 7;
|
25880 | }
|
25881 |
|
25882 | return isNaN(input) ? null : input;
|
25883 | }
|
25884 |
|
25885 |
|
25886 | function shiftWeekdays(ws, n) {
|
25887 | return ws.slice(n, 7).concat(ws.slice(0, n));
|
25888 | }
|
25889 |
|
25890 | var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
|
25891 |
|
25892 | function localeWeekdays(m, format) {
|
25893 | var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone'];
|
25894 | return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;
|
25895 | }
|
25896 |
|
25897 | var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
|
25898 |
|
25899 | function localeWeekdaysShort(m) {
|
25900 | return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;
|
25901 | }
|
25902 |
|
25903 | var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
|
25904 |
|
25905 | function localeWeekdaysMin(m) {
|
25906 | return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;
|
25907 | }
|
25908 |
|
25909 | function handleStrictParse$1(weekdayName, format, strict) {
|
25910 | var i,
|
25911 | ii,
|
25912 | mom,
|
25913 | llc = weekdayName.toLocaleLowerCase();
|
25914 |
|
25915 | if (!this._weekdaysParse) {
|
25916 | this._weekdaysParse = [];
|
25917 | this._shortWeekdaysParse = [];
|
25918 | this._minWeekdaysParse = [];
|
25919 |
|
25920 | for (i = 0; i < 7; ++i) {
|
25921 | mom = createUTC([2000, 1]).day(i);
|
25922 | this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
|
25923 | this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
|
25924 | this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
|
25925 | }
|
25926 | }
|
25927 |
|
25928 | if (strict) {
|
25929 | if (format === 'dddd') {
|
25930 | ii = indexOf.call(this._weekdaysParse, llc);
|
25931 | return ii !== -1 ? ii : null;
|
25932 | } else if (format === 'ddd') {
|
25933 | ii = indexOf.call(this._shortWeekdaysParse, llc);
|
25934 | return ii !== -1 ? ii : null;
|
25935 | } else {
|
25936 | ii = indexOf.call(this._minWeekdaysParse, llc);
|
25937 | return ii !== -1 ? ii : null;
|
25938 | }
|
25939 | } else {
|
25940 | if (format === 'dddd') {
|
25941 | ii = indexOf.call(this._weekdaysParse, llc);
|
25942 |
|
25943 | if (ii !== -1) {
|
25944 | return ii;
|
25945 | }
|
25946 |
|
25947 | ii = indexOf.call(this._shortWeekdaysParse, llc);
|
25948 |
|
25949 | if (ii !== -1) {
|
25950 | return ii;
|
25951 | }
|
25952 |
|
25953 | ii = indexOf.call(this._minWeekdaysParse, llc);
|
25954 | return ii !== -1 ? ii : null;
|
25955 | } else if (format === 'ddd') {
|
25956 | ii = indexOf.call(this._shortWeekdaysParse, llc);
|
25957 |
|
25958 | if (ii !== -1) {
|
25959 | return ii;
|
25960 | }
|
25961 |
|
25962 | ii = indexOf.call(this._weekdaysParse, llc);
|
25963 |
|
25964 | if (ii !== -1) {
|
25965 | return ii;
|
25966 | }
|
25967 |
|
25968 | ii = indexOf.call(this._minWeekdaysParse, llc);
|
25969 | return ii !== -1 ? ii : null;
|
25970 | } else {
|
25971 | ii = indexOf.call(this._minWeekdaysParse, llc);
|
25972 |
|
25973 | if (ii !== -1) {
|
25974 | return ii;
|
25975 | }
|
25976 |
|
25977 | ii = indexOf.call(this._weekdaysParse, llc);
|
25978 |
|
25979 | if (ii !== -1) {
|
25980 | return ii;
|
25981 | }
|
25982 |
|
25983 | ii = indexOf.call(this._shortWeekdaysParse, llc);
|
25984 | return ii !== -1 ? ii : null;
|
25985 | }
|
25986 | }
|
25987 | }
|
25988 |
|
25989 | function localeWeekdaysParse(weekdayName, format, strict) {
|
25990 | var i, mom, regex;
|
25991 |
|
25992 | if (this._weekdaysParseExact) {
|
25993 | return handleStrictParse$1.call(this, weekdayName, format, strict);
|
25994 | }
|
25995 |
|
25996 | if (!this._weekdaysParse) {
|
25997 | this._weekdaysParse = [];
|
25998 | this._minWeekdaysParse = [];
|
25999 | this._shortWeekdaysParse = [];
|
26000 | this._fullWeekdaysParse = [];
|
26001 | }
|
26002 |
|
26003 | for (i = 0; i < 7; i++) {
|
26004 |
|
26005 | mom = createUTC([2000, 1]).day(i);
|
26006 |
|
26007 | if (strict && !this._fullWeekdaysParse[i]) {
|
26008 | this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');
|
26009 | this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');
|
26010 | this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');
|
26011 | }
|
26012 |
|
26013 | if (!this._weekdaysParse[i]) {
|
26014 | regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
|
26015 | this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
|
26016 | }
|
26017 |
|
26018 |
|
26019 | if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
|
26020 | return i;
|
26021 | } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
|
26022 | return i;
|
26023 | } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
|
26024 | return i;
|
26025 | } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
|
26026 | return i;
|
26027 | }
|
26028 | }
|
26029 | }
|
26030 |
|
26031 |
|
26032 | function getSetDayOfWeek(input) {
|
26033 | if (!this.isValid()) {
|
26034 | return input != null ? this : NaN;
|
26035 | }
|
26036 |
|
26037 | var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
|
26038 |
|
26039 | if (input != null) {
|
26040 | input = parseWeekday(input, this.localeData());
|
26041 | return this.add(input - day, 'd');
|
26042 | } else {
|
26043 | return day;
|
26044 | }
|
26045 | }
|
26046 |
|
26047 | function getSetLocaleDayOfWeek(input) {
|
26048 | if (!this.isValid()) {
|
26049 | return input != null ? this : NaN;
|
26050 | }
|
26051 |
|
26052 | var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
|
26053 | return input == null ? weekday : this.add(input - weekday, 'd');
|
26054 | }
|
26055 |
|
26056 | function getSetISODayOfWeek(input) {
|
26057 | if (!this.isValid()) {
|
26058 | return input != null ? this : NaN;
|
26059 | }
|
26060 |
|
26061 |
|
26062 |
|
26063 |
|
26064 | if (input != null) {
|
26065 | var weekday = parseIsoWeekday(input, this.localeData());
|
26066 | return this.day(this.day() % 7 ? weekday : weekday - 7);
|
26067 | } else {
|
26068 | return this.day() || 7;
|
26069 | }
|
26070 | }
|
26071 |
|
26072 | var defaultWeekdaysRegex = matchWord;
|
26073 |
|
26074 | function weekdaysRegex(isStrict) {
|
26075 | if (this._weekdaysParseExact) {
|
26076 | if (!hasOwnProp(this, '_weekdaysRegex')) {
|
26077 | computeWeekdaysParse.call(this);
|
26078 | }
|
26079 |
|
26080 | if (isStrict) {
|
26081 | return this._weekdaysStrictRegex;
|
26082 | } else {
|
26083 | return this._weekdaysRegex;
|
26084 | }
|
26085 | } else {
|
26086 | if (!hasOwnProp(this, '_weekdaysRegex')) {
|
26087 | this._weekdaysRegex = defaultWeekdaysRegex;
|
26088 | }
|
26089 |
|
26090 | return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;
|
26091 | }
|
26092 | }
|
26093 |
|
26094 | var defaultWeekdaysShortRegex = matchWord;
|
26095 |
|
26096 | function weekdaysShortRegex(isStrict) {
|
26097 | if (this._weekdaysParseExact) {
|
26098 | if (!hasOwnProp(this, '_weekdaysRegex')) {
|
26099 | computeWeekdaysParse.call(this);
|
26100 | }
|
26101 |
|
26102 | if (isStrict) {
|
26103 | return this._weekdaysShortStrictRegex;
|
26104 | } else {
|
26105 | return this._weekdaysShortRegex;
|
26106 | }
|
26107 | } else {
|
26108 | if (!hasOwnProp(this, '_weekdaysShortRegex')) {
|
26109 | this._weekdaysShortRegex = defaultWeekdaysShortRegex;
|
26110 | }
|
26111 |
|
26112 | return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
|
26113 | }
|
26114 | }
|
26115 |
|
26116 | var defaultWeekdaysMinRegex = matchWord;
|
26117 |
|
26118 | function weekdaysMinRegex(isStrict) {
|
26119 | if (this._weekdaysParseExact) {
|
26120 | if (!hasOwnProp(this, '_weekdaysRegex')) {
|
26121 | computeWeekdaysParse.call(this);
|
26122 | }
|
26123 |
|
26124 | if (isStrict) {
|
26125 | return this._weekdaysMinStrictRegex;
|
26126 | } else {
|
26127 | return this._weekdaysMinRegex;
|
26128 | }
|
26129 | } else {
|
26130 | if (!hasOwnProp(this, '_weekdaysMinRegex')) {
|
26131 | this._weekdaysMinRegex = defaultWeekdaysMinRegex;
|
26132 | }
|
26133 |
|
26134 | return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
|
26135 | }
|
26136 | }
|
26137 |
|
26138 | function computeWeekdaysParse() {
|
26139 | function cmpLenRev(a, b) {
|
26140 | return b.length - a.length;
|
26141 | }
|
26142 |
|
26143 | var minPieces = [],
|
26144 | shortPieces = [],
|
26145 | longPieces = [],
|
26146 | mixedPieces = [],
|
26147 | i,
|
26148 | mom,
|
26149 | minp,
|
26150 | shortp,
|
26151 | longp;
|
26152 |
|
26153 | for (i = 0; i < 7; i++) {
|
26154 |
|
26155 | mom = createUTC([2000, 1]).day(i);
|
26156 | minp = this.weekdaysMin(mom, '');
|
26157 | shortp = this.weekdaysShort(mom, '');
|
26158 | longp = this.weekdays(mom, '');
|
26159 | minPieces.push(minp);
|
26160 | shortPieces.push(shortp);
|
26161 | longPieces.push(longp);
|
26162 | mixedPieces.push(minp);
|
26163 | mixedPieces.push(shortp);
|
26164 | mixedPieces.push(longp);
|
26165 | }
|
26166 |
|
26167 |
|
26168 |
|
26169 | minPieces.sort(cmpLenRev);
|
26170 | shortPieces.sort(cmpLenRev);
|
26171 | longPieces.sort(cmpLenRev);
|
26172 | mixedPieces.sort(cmpLenRev);
|
26173 |
|
26174 | for (i = 0; i < 7; i++) {
|
26175 | shortPieces[i] = regexEscape(shortPieces[i]);
|
26176 | longPieces[i] = regexEscape(longPieces[i]);
|
26177 | mixedPieces[i] = regexEscape(mixedPieces[i]);
|
26178 | }
|
26179 |
|
26180 | this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
26181 | this._weekdaysShortRegex = this._weekdaysRegex;
|
26182 | this._weekdaysMinRegex = this._weekdaysRegex;
|
26183 | this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
|
26184 | this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
|
26185 | this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
|
26186 | }
|
26187 |
|
26188 |
|
26189 | function hFormat() {
|
26190 | return this.hours() % 12 || 12;
|
26191 | }
|
26192 |
|
26193 | function kFormat() {
|
26194 | return this.hours() || 24;
|
26195 | }
|
26196 |
|
26197 | addFormatToken('H', ['HH', 2], 0, 'hour');
|
26198 | addFormatToken('h', ['hh', 2], 0, hFormat);
|
26199 | addFormatToken('k', ['kk', 2], 0, kFormat);
|
26200 | addFormatToken('hmm', 0, 0, function () {
|
26201 | return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
|
26202 | });
|
26203 | addFormatToken('hmmss', 0, 0, function () {
|
26204 | return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
|
26205 | });
|
26206 | addFormatToken('Hmm', 0, 0, function () {
|
26207 | return '' + this.hours() + zeroFill(this.minutes(), 2);
|
26208 | });
|
26209 | addFormatToken('Hmmss', 0, 0, function () {
|
26210 | return '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
|
26211 | });
|
26212 |
|
26213 | function meridiem(token, lowercase) {
|
26214 | addFormatToken(token, 0, 0, function () {
|
26215 | return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
|
26216 | });
|
26217 | }
|
26218 |
|
26219 | meridiem('a', true);
|
26220 | meridiem('A', false);
|
26221 |
|
26222 | addUnitAlias('hour', 'h');
|
26223 |
|
26224 | addUnitPriority('hour', 13);
|
26225 |
|
26226 | function matchMeridiem(isStrict, locale) {
|
26227 | return locale._meridiemParse;
|
26228 | }
|
26229 |
|
26230 | addRegexToken('a', matchMeridiem);
|
26231 | addRegexToken('A', matchMeridiem);
|
26232 | addRegexToken('H', match1to2);
|
26233 | addRegexToken('h', match1to2);
|
26234 | addRegexToken('k', match1to2);
|
26235 | addRegexToken('HH', match1to2, match2);
|
26236 | addRegexToken('hh', match1to2, match2);
|
26237 | addRegexToken('kk', match1to2, match2);
|
26238 | addRegexToken('hmm', match3to4);
|
26239 | addRegexToken('hmmss', match5to6);
|
26240 | addRegexToken('Hmm', match3to4);
|
26241 | addRegexToken('Hmmss', match5to6);
|
26242 | addParseToken(['H', 'HH'], HOUR);
|
26243 | addParseToken(['k', 'kk'], function (input, array, config) {
|
26244 | var kInput = toInt(input);
|
26245 | array[HOUR] = kInput === 24 ? 0 : kInput;
|
26246 | });
|
26247 | addParseToken(['a', 'A'], function (input, array, config) {
|
26248 | config._isPm = config._locale.isPM(input);
|
26249 | config._meridiem = input;
|
26250 | });
|
26251 | addParseToken(['h', 'hh'], function (input, array, config) {
|
26252 | array[HOUR] = toInt(input);
|
26253 | getParsingFlags(config).bigHour = true;
|
26254 | });
|
26255 | addParseToken('hmm', function (input, array, config) {
|
26256 | var pos = input.length - 2;
|
26257 | array[HOUR] = toInt(input.substr(0, pos));
|
26258 | array[MINUTE] = toInt(input.substr(pos));
|
26259 | getParsingFlags(config).bigHour = true;
|
26260 | });
|
26261 | addParseToken('hmmss', function (input, array, config) {
|
26262 | var pos1 = input.length - 4;
|
26263 | var pos2 = input.length - 2;
|
26264 | array[HOUR] = toInt(input.substr(0, pos1));
|
26265 | array[MINUTE] = toInt(input.substr(pos1, 2));
|
26266 | array[SECOND] = toInt(input.substr(pos2));
|
26267 | getParsingFlags(config).bigHour = true;
|
26268 | });
|
26269 | addParseToken('Hmm', function (input, array, config) {
|
26270 | var pos = input.length - 2;
|
26271 | array[HOUR] = toInt(input.substr(0, pos));
|
26272 | array[MINUTE] = toInt(input.substr(pos));
|
26273 | });
|
26274 | addParseToken('Hmmss', function (input, array, config) {
|
26275 | var pos1 = input.length - 4;
|
26276 | var pos2 = input.length - 2;
|
26277 | array[HOUR] = toInt(input.substr(0, pos1));
|
26278 | array[MINUTE] = toInt(input.substr(pos1, 2));
|
26279 | array[SECOND] = toInt(input.substr(pos2));
|
26280 | });
|
26281 |
|
26282 | function localeIsPM(input) {
|
26283 |
|
26284 |
|
26285 | return (input + '').toLowerCase().charAt(0) === 'p';
|
26286 | }
|
26287 |
|
26288 | var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
|
26289 |
|
26290 | function localeMeridiem(hours, minutes, isLower) {
|
26291 | if (hours > 11) {
|
26292 | return isLower ? 'pm' : 'PM';
|
26293 | } else {
|
26294 | return isLower ? 'am' : 'AM';
|
26295 | }
|
26296 | }
|
26297 |
|
26298 |
|
26299 |
|
26300 |
|
26301 |
|
26302 |
|
26303 | var getSetHour = makeGetSet('Hours', true);
|
26304 | var baseConfig = {
|
26305 | calendar: defaultCalendar,
|
26306 | longDateFormat: defaultLongDateFormat,
|
26307 | invalidDate: defaultInvalidDate,
|
26308 | ordinal: defaultOrdinal,
|
26309 | dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
|
26310 | relativeTime: defaultRelativeTime,
|
26311 | months: defaultLocaleMonths,
|
26312 | monthsShort: defaultLocaleMonthsShort,
|
26313 | week: defaultLocaleWeek,
|
26314 | weekdays: defaultLocaleWeekdays,
|
26315 | weekdaysMin: defaultLocaleWeekdaysMin,
|
26316 | weekdaysShort: defaultLocaleWeekdaysShort,
|
26317 | meridiemParse: defaultLocaleMeridiemParse
|
26318 | };
|
26319 |
|
26320 | var locales = {};
|
26321 | var localeFamilies = {};
|
26322 | var globalLocale;
|
26323 |
|
26324 | function normalizeLocale(key) {
|
26325 | return key ? key.toLowerCase().replace('_', '-') : key;
|
26326 | }
|
26327 |
|
26328 |
|
26329 |
|
26330 |
|
26331 | function chooseLocale(names) {
|
26332 | var i = 0,
|
26333 | j,
|
26334 | next,
|
26335 | locale,
|
26336 | split;
|
26337 |
|
26338 | while (i < names.length) {
|
26339 | split = normalizeLocale(names[i]).split('-');
|
26340 | j = split.length;
|
26341 | next = normalizeLocale(names[i + 1]);
|
26342 | next = next ? next.split('-') : null;
|
26343 |
|
26344 | while (j > 0) {
|
26345 | locale = loadLocale(split.slice(0, j).join('-'));
|
26346 |
|
26347 | if (locale) {
|
26348 | return locale;
|
26349 | }
|
26350 |
|
26351 | if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
|
26352 |
|
26353 | break;
|
26354 | }
|
26355 |
|
26356 | j--;
|
26357 | }
|
26358 |
|
26359 | i++;
|
26360 | }
|
26361 |
|
26362 | return globalLocale;
|
26363 | }
|
26364 |
|
26365 | function loadLocale(name) {
|
26366 | var oldLocale = null;
|
26367 |
|
26368 | if (!locales[name] && 'object' !== 'undefined' && module && module.exports) {
|
26369 | try {
|
26370 | oldLocale = globalLocale._abbr;
|
26371 | var aliasedRequire = commonjsRequire;
|
26372 | aliasedRequire('./locale/' + name);
|
26373 | getSetGlobalLocale(oldLocale);
|
26374 | } catch (e) {}
|
26375 | }
|
26376 |
|
26377 | return locales[name];
|
26378 | }
|
26379 |
|
26380 |
|
26381 |
|
26382 |
|
26383 | function getSetGlobalLocale(key, values) {
|
26384 | var data;
|
26385 |
|
26386 | if (key) {
|
26387 | if (isUndefined(values)) {
|
26388 | data = getLocale(key);
|
26389 | } else {
|
26390 | data = defineLocale(key, values);
|
26391 | }
|
26392 |
|
26393 | if (data) {
|
26394 |
|
26395 | globalLocale = data;
|
26396 | } else {
|
26397 | if (typeof console !== 'undefined' && console.warn) {
|
26398 |
|
26399 | console.warn('Locale ' + key + ' not found. Did you forget to load it?');
|
26400 | }
|
26401 | }
|
26402 | }
|
26403 |
|
26404 | return globalLocale._abbr;
|
26405 | }
|
26406 |
|
26407 | function defineLocale(name, config) {
|
26408 | if (config !== null) {
|
26409 | var locale,
|
26410 | parentConfig = baseConfig;
|
26411 | config.abbr = name;
|
26412 |
|
26413 | if (locales[name] != null) {
|
26414 | deprecateSimple('defineLocaleOverride', 'use moment.updateLocale(localeName, config) to change ' + 'an existing locale. moment.defineLocale(localeName, ' + 'config) should only be used for creating a new locale ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
|
26415 | parentConfig = locales[name]._config;
|
26416 | } else if (config.parentLocale != null) {
|
26417 | if (locales[config.parentLocale] != null) {
|
26418 | parentConfig = locales[config.parentLocale]._config;
|
26419 | } else {
|
26420 | locale = loadLocale(config.parentLocale);
|
26421 |
|
26422 | if (locale != null) {
|
26423 | parentConfig = locale._config;
|
26424 | } else {
|
26425 | if (!localeFamilies[config.parentLocale]) {
|
26426 | localeFamilies[config.parentLocale] = [];
|
26427 | }
|
26428 |
|
26429 | localeFamilies[config.parentLocale].push({
|
26430 | name: name,
|
26431 | config: config
|
26432 | });
|
26433 | return null;
|
26434 | }
|
26435 | }
|
26436 | }
|
26437 |
|
26438 | locales[name] = new Locale(mergeConfigs(parentConfig, config));
|
26439 |
|
26440 | if (localeFamilies[name]) {
|
26441 | localeFamilies[name].forEach(function (x) {
|
26442 | defineLocale(x.name, x.config);
|
26443 | });
|
26444 | }
|
26445 |
|
26446 |
|
26447 |
|
26448 |
|
26449 | getSetGlobalLocale(name);
|
26450 | return locales[name];
|
26451 | } else {
|
26452 |
|
26453 | delete locales[name];
|
26454 | return null;
|
26455 | }
|
26456 | }
|
26457 |
|
26458 | function updateLocale(name, config) {
|
26459 | if (config != null) {
|
26460 | var locale,
|
26461 | tmpLocale,
|
26462 | parentConfig = baseConfig;
|
26463 |
|
26464 | tmpLocale = loadLocale(name);
|
26465 |
|
26466 | if (tmpLocale != null) {
|
26467 | parentConfig = tmpLocale._config;
|
26468 | }
|
26469 |
|
26470 | config = mergeConfigs(parentConfig, config);
|
26471 | locale = new Locale(config);
|
26472 | locale.parentLocale = locales[name];
|
26473 | locales[name] = locale;
|
26474 |
|
26475 | getSetGlobalLocale(name);
|
26476 | } else {
|
26477 |
|
26478 | if (locales[name] != null) {
|
26479 | if (locales[name].parentLocale != null) {
|
26480 | locales[name] = locales[name].parentLocale;
|
26481 | } else if (locales[name] != null) {
|
26482 | delete locales[name];
|
26483 | }
|
26484 | }
|
26485 | }
|
26486 |
|
26487 | return locales[name];
|
26488 | }
|
26489 |
|
26490 |
|
26491 | function getLocale(key) {
|
26492 | var locale;
|
26493 |
|
26494 | if (key && key._locale && key._locale._abbr) {
|
26495 | key = key._locale._abbr;
|
26496 | }
|
26497 |
|
26498 | if (!key) {
|
26499 | return globalLocale;
|
26500 | }
|
26501 |
|
26502 | if (!isArray(key)) {
|
26503 |
|
26504 | locale = loadLocale(key);
|
26505 |
|
26506 | if (locale) {
|
26507 | return locale;
|
26508 | }
|
26509 |
|
26510 | key = [key];
|
26511 | }
|
26512 |
|
26513 | return chooseLocale(key);
|
26514 | }
|
26515 |
|
26516 | function listLocales() {
|
26517 | return keys(locales);
|
26518 | }
|
26519 |
|
26520 | function checkOverflow(m) {
|
26521 | var overflow;
|
26522 | var a = m._a;
|
26523 |
|
26524 | if (a && getParsingFlags(m).overflow === -2) {
|
26525 | overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;
|
26526 |
|
26527 | if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
|
26528 | overflow = DATE;
|
26529 | }
|
26530 |
|
26531 | if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
|
26532 | overflow = WEEK;
|
26533 | }
|
26534 |
|
26535 | if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
|
26536 | overflow = WEEKDAY;
|
26537 | }
|
26538 |
|
26539 | getParsingFlags(m).overflow = overflow;
|
26540 | }
|
26541 |
|
26542 | return m;
|
26543 | }
|
26544 |
|
26545 |
|
26546 | function defaults(a, b, c) {
|
26547 | if (a != null) {
|
26548 | return a;
|
26549 | }
|
26550 |
|
26551 | if (b != null) {
|
26552 | return b;
|
26553 | }
|
26554 |
|
26555 | return c;
|
26556 | }
|
26557 |
|
26558 | function currentDateArray(config) {
|
26559 |
|
26560 | var nowValue = new Date(hooks.now());
|
26561 |
|
26562 | if (config._useUTC) {
|
26563 | return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
|
26564 | }
|
26565 |
|
26566 | return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
|
26567 | }
|
26568 |
|
26569 |
|
26570 |
|
26571 |
|
26572 |
|
26573 | function configFromArray(config) {
|
26574 | var i,
|
26575 | date,
|
26576 | input = [],
|
26577 | currentDate,
|
26578 | expectedWeekday,
|
26579 | yearToUse;
|
26580 |
|
26581 | if (config._d) {
|
26582 | return;
|
26583 | }
|
26584 |
|
26585 | currentDate = currentDateArray(config);
|
26586 |
|
26587 | if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
|
26588 | dayOfYearFromWeekInfo(config);
|
26589 | }
|
26590 |
|
26591 |
|
26592 | if (config._dayOfYear != null) {
|
26593 | yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
|
26594 |
|
26595 | if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
|
26596 | getParsingFlags(config)._overflowDayOfYear = true;
|
26597 | }
|
26598 |
|
26599 | date = createUTCDate(yearToUse, 0, config._dayOfYear);
|
26600 | config._a[MONTH] = date.getUTCMonth();
|
26601 | config._a[DATE] = date.getUTCDate();
|
26602 | }
|
26603 |
|
26604 |
|
26605 |
|
26606 |
|
26607 |
|
26608 |
|
26609 | for (i = 0; i < 3 && config._a[i] == null; ++i) {
|
26610 | config._a[i] = input[i] = currentDate[i];
|
26611 | }
|
26612 |
|
26613 |
|
26614 | for (; i < 7; i++) {
|
26615 | config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];
|
26616 | }
|
26617 |
|
26618 |
|
26619 | if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {
|
26620 | config._nextDay = true;
|
26621 | config._a[HOUR] = 0;
|
26622 | }
|
26623 |
|
26624 | config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
|
26625 | expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
|
26626 |
|
26627 |
|
26628 | if (config._tzm != null) {
|
26629 | config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
|
26630 | }
|
26631 |
|
26632 | if (config._nextDay) {
|
26633 | config._a[HOUR] = 24;
|
26634 | }
|
26635 |
|
26636 |
|
26637 | if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
|
26638 | getParsingFlags(config).weekdayMismatch = true;
|
26639 | }
|
26640 | }
|
26641 |
|
26642 | function dayOfYearFromWeekInfo(config) {
|
26643 | var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
|
26644 | w = config._w;
|
26645 |
|
26646 | if (w.GG != null || w.W != null || w.E != null) {
|
26647 | dow = 1;
|
26648 | doy = 4;
|
26649 |
|
26650 |
|
26651 |
|
26652 |
|
26653 | weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
|
26654 | week = defaults(w.W, 1);
|
26655 | weekday = defaults(w.E, 1);
|
26656 |
|
26657 | if (weekday < 1 || weekday > 7) {
|
26658 | weekdayOverflow = true;
|
26659 | }
|
26660 | } else {
|
26661 | dow = config._locale._week.dow;
|
26662 | doy = config._locale._week.doy;
|
26663 | var curWeek = weekOfYear(createLocal(), dow, doy);
|
26664 | weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
|
26665 |
|
26666 | week = defaults(w.w, curWeek.week);
|
26667 |
|
26668 | if (w.d != null) {
|
26669 |
|
26670 | weekday = w.d;
|
26671 |
|
26672 | if (weekday < 0 || weekday > 6) {
|
26673 | weekdayOverflow = true;
|
26674 | }
|
26675 | } else if (w.e != null) {
|
26676 |
|
26677 | weekday = w.e + dow;
|
26678 |
|
26679 | if (w.e < 0 || w.e > 6) {
|
26680 | weekdayOverflow = true;
|
26681 | }
|
26682 | } else {
|
26683 |
|
26684 | weekday = dow;
|
26685 | }
|
26686 | }
|
26687 |
|
26688 | if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
|
26689 | getParsingFlags(config)._overflowWeeks = true;
|
26690 | } else if (weekdayOverflow != null) {
|
26691 | getParsingFlags(config)._overflowWeekday = true;
|
26692 | } else {
|
26693 | temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
|
26694 | config._a[YEAR] = temp.year;
|
26695 | config._dayOfYear = temp.dayOfYear;
|
26696 | }
|
26697 | }
|
26698 |
|
26699 |
|
26700 |
|
26701 | var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
|
26702 | var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
|
26703 | var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
|
26704 | var isoDates = [['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], ['GGGG-[W]WW', /\d{4}-W\d\d/, false], ['YYYY-DDD', /\d{4}-\d{3}/], ['YYYY-MM', /\d{4}-\d\d/, false], ['YYYYYYMMDD', /[+-]\d{10}/], ['YYYYMMDD', /\d{8}/],
|
26705 | ['GGGG[W]WWE', /\d{4}W\d{3}/], ['GGGG[W]WW', /\d{4}W\d{2}/, false], ['YYYYDDD', /\d{7}/]];
|
26706 |
|
26707 | var isoTimes = [['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], ['HH:mm:ss', /\d\d:\d\d:\d\d/], ['HH:mm', /\d\d:\d\d/], ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], ['HHmmss', /\d\d\d\d\d\d/], ['HHmm', /\d\d\d\d/], ['HH', /\d\d/]];
|
26708 | var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
|
26709 |
|
26710 | function configFromISO(config) {
|
26711 | var i,
|
26712 | l,
|
26713 | string = config._i,
|
26714 | match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
|
26715 | allowTime,
|
26716 | dateFormat,
|
26717 | timeFormat,
|
26718 | tzFormat;
|
26719 |
|
26720 | if (match) {
|
26721 | getParsingFlags(config).iso = true;
|
26722 |
|
26723 | for (i = 0, l = isoDates.length; i < l; i++) {
|
26724 | if (isoDates[i][1].exec(match[1])) {
|
26725 | dateFormat = isoDates[i][0];
|
26726 | allowTime = isoDates[i][2] !== false;
|
26727 | break;
|
26728 | }
|
26729 | }
|
26730 |
|
26731 | if (dateFormat == null) {
|
26732 | config._isValid = false;
|
26733 | return;
|
26734 | }
|
26735 |
|
26736 | if (match[3]) {
|
26737 | for (i = 0, l = isoTimes.length; i < l; i++) {
|
26738 | if (isoTimes[i][1].exec(match[3])) {
|
26739 |
|
26740 | timeFormat = (match[2] || ' ') + isoTimes[i][0];
|
26741 | break;
|
26742 | }
|
26743 | }
|
26744 |
|
26745 | if (timeFormat == null) {
|
26746 | config._isValid = false;
|
26747 | return;
|
26748 | }
|
26749 | }
|
26750 |
|
26751 | if (!allowTime && timeFormat != null) {
|
26752 | config._isValid = false;
|
26753 | return;
|
26754 | }
|
26755 |
|
26756 | if (match[4]) {
|
26757 | if (tzRegex.exec(match[4])) {
|
26758 | tzFormat = 'Z';
|
26759 | } else {
|
26760 | config._isValid = false;
|
26761 | return;
|
26762 | }
|
26763 | }
|
26764 |
|
26765 | config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
|
26766 | configFromStringAndFormat(config);
|
26767 | } else {
|
26768 | config._isValid = false;
|
26769 | }
|
26770 | }
|
26771 |
|
26772 |
|
26773 | var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
|
26774 |
|
26775 | function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
|
26776 | var result = [untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10)];
|
26777 |
|
26778 | if (secondStr) {
|
26779 | result.push(parseInt(secondStr, 10));
|
26780 | }
|
26781 |
|
26782 | return result;
|
26783 | }
|
26784 |
|
26785 | function untruncateYear(yearStr) {
|
26786 | var year = parseInt(yearStr, 10);
|
26787 |
|
26788 | if (year <= 49) {
|
26789 | return 2000 + year;
|
26790 | } else if (year <= 999) {
|
26791 | return 1900 + year;
|
26792 | }
|
26793 |
|
26794 | return year;
|
26795 | }
|
26796 |
|
26797 | function preprocessRFC2822(s) {
|
26798 |
|
26799 | return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
|
26800 | }
|
26801 |
|
26802 | function checkWeekday(weekdayStr, parsedInput, config) {
|
26803 | if (weekdayStr) {
|
26804 |
|
26805 | var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
|
26806 | weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();
|
26807 |
|
26808 | if (weekdayProvided !== weekdayActual) {
|
26809 | getParsingFlags(config).weekdayMismatch = true;
|
26810 | config._isValid = false;
|
26811 | return false;
|
26812 | }
|
26813 | }
|
26814 |
|
26815 | return true;
|
26816 | }
|
26817 |
|
26818 | var obsOffsets = {
|
26819 | UT: 0,
|
26820 | GMT: 0,
|
26821 | EDT: -4 * 60,
|
26822 | EST: -5 * 60,
|
26823 | CDT: -5 * 60,
|
26824 | CST: -6 * 60,
|
26825 | MDT: -6 * 60,
|
26826 | MST: -7 * 60,
|
26827 | PDT: -7 * 60,
|
26828 | PST: -8 * 60
|
26829 | };
|
26830 |
|
26831 | function calculateOffset(obsOffset, militaryOffset, numOffset) {
|
26832 | if (obsOffset) {
|
26833 | return obsOffsets[obsOffset];
|
26834 | } else if (militaryOffset) {
|
26835 |
|
26836 | return 0;
|
26837 | } else {
|
26838 | var hm = parseInt(numOffset, 10);
|
26839 | var m = hm % 100,
|
26840 | h = (hm - m) / 100;
|
26841 | return h * 60 + m;
|
26842 | }
|
26843 | }
|
26844 |
|
26845 |
|
26846 | function configFromRFC2822(config) {
|
26847 | var match = rfc2822.exec(preprocessRFC2822(config._i));
|
26848 |
|
26849 | if (match) {
|
26850 | var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);
|
26851 |
|
26852 | if (!checkWeekday(match[1], parsedArray, config)) {
|
26853 | return;
|
26854 | }
|
26855 |
|
26856 | config._a = parsedArray;
|
26857 | config._tzm = calculateOffset(match[8], match[9], match[10]);
|
26858 | config._d = createUTCDate.apply(null, config._a);
|
26859 |
|
26860 | config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
|
26861 |
|
26862 | getParsingFlags(config).rfc2822 = true;
|
26863 | } else {
|
26864 | config._isValid = false;
|
26865 | }
|
26866 | }
|
26867 |
|
26868 |
|
26869 | function configFromString(config) {
|
26870 | var matched = aspNetJsonRegex.exec(config._i);
|
26871 |
|
26872 | if (matched !== null) {
|
26873 | config._d = new Date(+matched[1]);
|
26874 | return;
|
26875 | }
|
26876 |
|
26877 | configFromISO(config);
|
26878 |
|
26879 | if (config._isValid === false) {
|
26880 | delete config._isValid;
|
26881 | } else {
|
26882 | return;
|
26883 | }
|
26884 |
|
26885 | configFromRFC2822(config);
|
26886 |
|
26887 | if (config._isValid === false) {
|
26888 | delete config._isValid;
|
26889 | } else {
|
26890 | return;
|
26891 | }
|
26892 |
|
26893 |
|
26894 | hooks.createFromInputFallback(config);
|
26895 | }
|
26896 |
|
26897 | hooks.createFromInputFallback = deprecate('value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged and will be removed in an upcoming major release. Please refer to ' + 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) {
|
26898 | config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
|
26899 | });
|
26900 |
|
26901 | hooks.ISO_8601 = function () {};
|
26902 |
|
26903 |
|
26904 | hooks.RFC_2822 = function () {};
|
26905 |
|
26906 |
|
26907 | function configFromStringAndFormat(config) {
|
26908 |
|
26909 | if (config._f === hooks.ISO_8601) {
|
26910 | configFromISO(config);
|
26911 | return;
|
26912 | }
|
26913 |
|
26914 | if (config._f === hooks.RFC_2822) {
|
26915 | configFromRFC2822(config);
|
26916 | return;
|
26917 | }
|
26918 |
|
26919 | config._a = [];
|
26920 | getParsingFlags(config).empty = true;
|
26921 |
|
26922 | var string = '' + config._i,
|
26923 | i,
|
26924 | parsedInput,
|
26925 | tokens,
|
26926 | token,
|
26927 | skipped,
|
26928 | stringLength = string.length,
|
26929 | totalParsedInputLength = 0;
|
26930 | tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
|
26931 |
|
26932 | for (i = 0; i < tokens.length; i++) {
|
26933 | token = tokens[i];
|
26934 | parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
|
26935 |
|
26936 |
|
26937 | if (parsedInput) {
|
26938 | skipped = string.substr(0, string.indexOf(parsedInput));
|
26939 |
|
26940 | if (skipped.length > 0) {
|
26941 | getParsingFlags(config).unusedInput.push(skipped);
|
26942 | }
|
26943 |
|
26944 | string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
|
26945 | totalParsedInputLength += parsedInput.length;
|
26946 | }
|
26947 |
|
26948 |
|
26949 | if (formatTokenFunctions[token]) {
|
26950 | if (parsedInput) {
|
26951 | getParsingFlags(config).empty = false;
|
26952 | } else {
|
26953 | getParsingFlags(config).unusedTokens.push(token);
|
26954 | }
|
26955 |
|
26956 | addTimeToArrayFromToken(token, parsedInput, config);
|
26957 | } else if (config._strict && !parsedInput) {
|
26958 | getParsingFlags(config).unusedTokens.push(token);
|
26959 | }
|
26960 | }
|
26961 |
|
26962 |
|
26963 | getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
|
26964 |
|
26965 | if (string.length > 0) {
|
26966 | getParsingFlags(config).unusedInput.push(string);
|
26967 | }
|
26968 |
|
26969 |
|
26970 | if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {
|
26971 | getParsingFlags(config).bigHour = undefined;
|
26972 | }
|
26973 |
|
26974 | getParsingFlags(config).parsedDateParts = config._a.slice(0);
|
26975 | getParsingFlags(config).meridiem = config._meridiem;
|
26976 |
|
26977 | config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
|
26978 | configFromArray(config);
|
26979 | checkOverflow(config);
|
26980 | }
|
26981 |
|
26982 | function meridiemFixWrap(locale, hour, meridiem) {
|
26983 | var isPm;
|
26984 |
|
26985 | if (meridiem == null) {
|
26986 |
|
26987 | return hour;
|
26988 | }
|
26989 |
|
26990 | if (locale.meridiemHour != null) {
|
26991 | return locale.meridiemHour(hour, meridiem);
|
26992 | } else if (locale.isPM != null) {
|
26993 |
|
26994 | isPm = locale.isPM(meridiem);
|
26995 |
|
26996 | if (isPm && hour < 12) {
|
26997 | hour += 12;
|
26998 | }
|
26999 |
|
27000 | if (!isPm && hour === 12) {
|
27001 | hour = 0;
|
27002 | }
|
27003 |
|
27004 | return hour;
|
27005 | } else {
|
27006 |
|
27007 | return hour;
|
27008 | }
|
27009 | }
|
27010 |
|
27011 |
|
27012 | function configFromStringAndArray(config) {
|
27013 | var tempConfig, bestMoment, scoreToBeat, i, currentScore;
|
27014 |
|
27015 | if (config._f.length === 0) {
|
27016 | getParsingFlags(config).invalidFormat = true;
|
27017 | config._d = new Date(NaN);
|
27018 | return;
|
27019 | }
|
27020 |
|
27021 | for (i = 0; i < config._f.length; i++) {
|
27022 | currentScore = 0;
|
27023 | tempConfig = copyConfig({}, config);
|
27024 |
|
27025 | if (config._useUTC != null) {
|
27026 | tempConfig._useUTC = config._useUTC;
|
27027 | }
|
27028 |
|
27029 | tempConfig._f = config._f[i];
|
27030 | configFromStringAndFormat(tempConfig);
|
27031 |
|
27032 | if (!isValid(tempConfig)) {
|
27033 | continue;
|
27034 | }
|
27035 |
|
27036 |
|
27037 | currentScore += getParsingFlags(tempConfig).charsLeftOver;
|
27038 |
|
27039 | currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
|
27040 | getParsingFlags(tempConfig).score = currentScore;
|
27041 |
|
27042 | if (scoreToBeat == null || currentScore < scoreToBeat) {
|
27043 | scoreToBeat = currentScore;
|
27044 | bestMoment = tempConfig;
|
27045 | }
|
27046 | }
|
27047 |
|
27048 | extend(config, bestMoment || tempConfig);
|
27049 | }
|
27050 |
|
27051 | function configFromObject(config) {
|
27052 | if (config._d) {
|
27053 | return;
|
27054 | }
|
27055 |
|
27056 | var i = normalizeObjectUnits(config._i);
|
27057 | config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
|
27058 | return obj && parseInt(obj, 10);
|
27059 | });
|
27060 | configFromArray(config);
|
27061 | }
|
27062 |
|
27063 | function createFromConfig(config) {
|
27064 | var res = new Moment(checkOverflow(prepareConfig(config)));
|
27065 |
|
27066 | if (res._nextDay) {
|
27067 |
|
27068 | res.add(1, 'd');
|
27069 | res._nextDay = undefined;
|
27070 | }
|
27071 |
|
27072 | return res;
|
27073 | }
|
27074 |
|
27075 | function prepareConfig(config) {
|
27076 | var input = config._i,
|
27077 | format = config._f;
|
27078 | config._locale = config._locale || getLocale(config._l);
|
27079 |
|
27080 | if (input === null || format === undefined && input === '') {
|
27081 | return createInvalid({
|
27082 | nullInput: true
|
27083 | });
|
27084 | }
|
27085 |
|
27086 | if (typeof input === 'string') {
|
27087 | config._i = input = config._locale.preparse(input);
|
27088 | }
|
27089 |
|
27090 | if (isMoment(input)) {
|
27091 | return new Moment(checkOverflow(input));
|
27092 | } else if (isDate(input)) {
|
27093 | config._d = input;
|
27094 | } else if (isArray(format)) {
|
27095 | configFromStringAndArray(config);
|
27096 | } else if (format) {
|
27097 | configFromStringAndFormat(config);
|
27098 | } else {
|
27099 | configFromInput(config);
|
27100 | }
|
27101 |
|
27102 | if (!isValid(config)) {
|
27103 | config._d = null;
|
27104 | }
|
27105 |
|
27106 | return config;
|
27107 | }
|
27108 |
|
27109 | function configFromInput(config) {
|
27110 | var input = config._i;
|
27111 |
|
27112 | if (isUndefined(input)) {
|
27113 | config._d = new Date(hooks.now());
|
27114 | } else if (isDate(input)) {
|
27115 | config._d = new Date(input.valueOf());
|
27116 | } else if (typeof input === 'string') {
|
27117 | configFromString(config);
|
27118 | } else if (isArray(input)) {
|
27119 | config._a = map(input.slice(0), function (obj) {
|
27120 | return parseInt(obj, 10);
|
27121 | });
|
27122 | configFromArray(config);
|
27123 | } else if (isObject(input)) {
|
27124 | configFromObject(config);
|
27125 | } else if (isNumber(input)) {
|
27126 |
|
27127 | config._d = new Date(input);
|
27128 | } else {
|
27129 | hooks.createFromInputFallback(config);
|
27130 | }
|
27131 | }
|
27132 |
|
27133 | function createLocalOrUTC(input, format, locale, strict, isUTC) {
|
27134 | var c = {};
|
27135 |
|
27136 | if (locale === true || locale === false) {
|
27137 | strict = locale;
|
27138 | locale = undefined;
|
27139 | }
|
27140 |
|
27141 | if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {
|
27142 | input = undefined;
|
27143 | }
|
27144 |
|
27145 |
|
27146 |
|
27147 | c._isAMomentObject = true;
|
27148 | c._useUTC = c._isUTC = isUTC;
|
27149 | c._l = locale;
|
27150 | c._i = input;
|
27151 | c._f = format;
|
27152 | c._strict = strict;
|
27153 | return createFromConfig(c);
|
27154 | }
|
27155 |
|
27156 | function createLocal(input, format, locale, strict) {
|
27157 | return createLocalOrUTC(input, format, locale, strict, false);
|
27158 | }
|
27159 |
|
27160 | var prototypeMin = deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () {
|
27161 | var other = createLocal.apply(null, arguments);
|
27162 |
|
27163 | if (this.isValid() && other.isValid()) {
|
27164 | return other < this ? this : other;
|
27165 | } else {
|
27166 | return createInvalid();
|
27167 | }
|
27168 | });
|
27169 | var prototypeMax = deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () {
|
27170 | var other = createLocal.apply(null, arguments);
|
27171 |
|
27172 | if (this.isValid() && other.isValid()) {
|
27173 | return other > this ? this : other;
|
27174 | } else {
|
27175 | return createInvalid();
|
27176 | }
|
27177 | });
|
27178 |
|
27179 |
|
27180 |
|
27181 |
|
27182 |
|
27183 | function pickBy(fn, moments) {
|
27184 | var res, i;
|
27185 |
|
27186 | if (moments.length === 1 && isArray(moments[0])) {
|
27187 | moments = moments[0];
|
27188 | }
|
27189 |
|
27190 | if (!moments.length) {
|
27191 | return createLocal();
|
27192 | }
|
27193 |
|
27194 | res = moments[0];
|
27195 |
|
27196 | for (i = 1; i < moments.length; ++i) {
|
27197 | if (!moments[i].isValid() || moments[i][fn](res)) {
|
27198 | res = moments[i];
|
27199 | }
|
27200 | }
|
27201 |
|
27202 | return res;
|
27203 | }
|
27204 |
|
27205 |
|
27206 | function min() {
|
27207 | var args = [].slice.call(arguments, 0);
|
27208 | return pickBy('isBefore', args);
|
27209 | }
|
27210 |
|
27211 | function max() {
|
27212 | var args = [].slice.call(arguments, 0);
|
27213 | return pickBy('isAfter', args);
|
27214 | }
|
27215 |
|
27216 | var now = function () {
|
27217 | return Date.now ? Date.now() : +new Date();
|
27218 | };
|
27219 |
|
27220 | var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];
|
27221 |
|
27222 | function isDurationValid(m) {
|
27223 | for (var key in m) {
|
27224 | if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
|
27225 | return false;
|
27226 | }
|
27227 | }
|
27228 |
|
27229 | var unitHasDecimal = false;
|
27230 |
|
27231 | for (var i = 0; i < ordering.length; ++i) {
|
27232 | if (m[ordering[i]]) {
|
27233 | if (unitHasDecimal) {
|
27234 | return false;
|
27235 | }
|
27236 |
|
27237 | if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
|
27238 | unitHasDecimal = true;
|
27239 | }
|
27240 | }
|
27241 | }
|
27242 |
|
27243 | return true;
|
27244 | }
|
27245 |
|
27246 | function isValid$1() {
|
27247 | return this._isValid;
|
27248 | }
|
27249 |
|
27250 | function createInvalid$1() {
|
27251 | return createDuration(NaN);
|
27252 | }
|
27253 |
|
27254 | function Duration(duration) {
|
27255 | var normalizedInput = normalizeObjectUnits(duration),
|
27256 | years = normalizedInput.year || 0,
|
27257 | quarters = normalizedInput.quarter || 0,
|
27258 | months = normalizedInput.month || 0,
|
27259 | weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
|
27260 | days = normalizedInput.day || 0,
|
27261 | hours = normalizedInput.hour || 0,
|
27262 | minutes = normalizedInput.minute || 0,
|
27263 | seconds = normalizedInput.second || 0,
|
27264 | milliseconds = normalizedInput.millisecond || 0;
|
27265 | this._isValid = isDurationValid(normalizedInput);
|
27266 |
|
27267 | this._milliseconds = +milliseconds + seconds * 1e3 +
|
27268 | minutes * 6e4 +
|
27269 | hours * 1000 * 60 * 60;
|
27270 |
|
27271 |
|
27272 |
|
27273 | this._days = +days + weeks * 7;
|
27274 |
|
27275 |
|
27276 |
|
27277 | this._months = +months + quarters * 3 + years * 12;
|
27278 | this._data = {};
|
27279 | this._locale = getLocale();
|
27280 |
|
27281 | this._bubble();
|
27282 | }
|
27283 |
|
27284 | function isDuration(obj) {
|
27285 | return obj instanceof Duration;
|
27286 | }
|
27287 |
|
27288 | function absRound(number) {
|
27289 | if (number < 0) {
|
27290 | return Math.round(-1 * number) * -1;
|
27291 | } else {
|
27292 | return Math.round(number);
|
27293 | }
|
27294 | }
|
27295 |
|
27296 |
|
27297 | function offset(token, separator) {
|
27298 | addFormatToken(token, 0, 0, function () {
|
27299 | var offset = this.utcOffset();
|
27300 | var sign = '+';
|
27301 |
|
27302 | if (offset < 0) {
|
27303 | offset = -offset;
|
27304 | sign = '-';
|
27305 | }
|
27306 |
|
27307 | return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2);
|
27308 | });
|
27309 | }
|
27310 |
|
27311 | offset('Z', ':');
|
27312 | offset('ZZ', '');
|
27313 |
|
27314 | addRegexToken('Z', matchShortOffset);
|
27315 | addRegexToken('ZZ', matchShortOffset);
|
27316 | addParseToken(['Z', 'ZZ'], function (input, array, config) {
|
27317 | config._useUTC = true;
|
27318 | config._tzm = offsetFromString(matchShortOffset, input);
|
27319 | });
|
27320 |
|
27321 |
|
27322 |
|
27323 |
|
27324 | var chunkOffset = /([\+\-]|\d\d)/gi;
|
27325 |
|
27326 | function offsetFromString(matcher, string) {
|
27327 | var matches = (string || '').match(matcher);
|
27328 |
|
27329 | if (matches === null) {
|
27330 | return null;
|
27331 | }
|
27332 |
|
27333 | var chunk = matches[matches.length - 1] || [];
|
27334 | var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
|
27335 | var minutes = +(parts[1] * 60) + toInt(parts[2]);
|
27336 | return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
|
27337 | }
|
27338 |
|
27339 |
|
27340 | function cloneWithOffset(input, model) {
|
27341 | var res, diff;
|
27342 |
|
27343 | if (model._isUTC) {
|
27344 | res = model.clone();
|
27345 | diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
|
27346 |
|
27347 | res._d.setTime(res._d.valueOf() + diff);
|
27348 |
|
27349 | hooks.updateOffset(res, false);
|
27350 | return res;
|
27351 | } else {
|
27352 | return createLocal(input).local();
|
27353 | }
|
27354 | }
|
27355 |
|
27356 | function getDateOffset(m) {
|
27357 |
|
27358 |
|
27359 | return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
|
27360 | }
|
27361 |
|
27362 |
|
27363 |
|
27364 |
|
27365 | hooks.updateOffset = function () {};
|
27366 |
|
27367 |
|
27368 |
|
27369 |
|
27370 |
|
27371 |
|
27372 |
|
27373 |
|
27374 |
|
27375 |
|
27376 |
|
27377 |
|
27378 | function getSetOffset(input, keepLocalTime, keepMinutes) {
|
27379 | var offset = this._offset || 0,
|
27380 | localAdjust;
|
27381 |
|
27382 | if (!this.isValid()) {
|
27383 | return input != null ? this : NaN;
|
27384 | }
|
27385 |
|
27386 | if (input != null) {
|
27387 | if (typeof input === 'string') {
|
27388 | input = offsetFromString(matchShortOffset, input);
|
27389 |
|
27390 | if (input === null) {
|
27391 | return this;
|
27392 | }
|
27393 | } else if (Math.abs(input) < 16 && !keepMinutes) {
|
27394 | input = input * 60;
|
27395 | }
|
27396 |
|
27397 | if (!this._isUTC && keepLocalTime) {
|
27398 | localAdjust = getDateOffset(this);
|
27399 | }
|
27400 |
|
27401 | this._offset = input;
|
27402 | this._isUTC = true;
|
27403 |
|
27404 | if (localAdjust != null) {
|
27405 | this.add(localAdjust, 'm');
|
27406 | }
|
27407 |
|
27408 | if (offset !== input) {
|
27409 | if (!keepLocalTime || this._changeInProgress) {
|
27410 | addSubtract(this, createDuration(input - offset, 'm'), 1, false);
|
27411 | } else if (!this._changeInProgress) {
|
27412 | this._changeInProgress = true;
|
27413 | hooks.updateOffset(this, true);
|
27414 | this._changeInProgress = null;
|
27415 | }
|
27416 | }
|
27417 |
|
27418 | return this;
|
27419 | } else {
|
27420 | return this._isUTC ? offset : getDateOffset(this);
|
27421 | }
|
27422 | }
|
27423 |
|
27424 | function getSetZone(input, keepLocalTime) {
|
27425 | if (input != null) {
|
27426 | if (typeof input !== 'string') {
|
27427 | input = -input;
|
27428 | }
|
27429 |
|
27430 | this.utcOffset(input, keepLocalTime);
|
27431 | return this;
|
27432 | } else {
|
27433 | return -this.utcOffset();
|
27434 | }
|
27435 | }
|
27436 |
|
27437 | function setOffsetToUTC(keepLocalTime) {
|
27438 | return this.utcOffset(0, keepLocalTime);
|
27439 | }
|
27440 |
|
27441 | function setOffsetToLocal(keepLocalTime) {
|
27442 | if (this._isUTC) {
|
27443 | this.utcOffset(0, keepLocalTime);
|
27444 | this._isUTC = false;
|
27445 |
|
27446 | if (keepLocalTime) {
|
27447 | this.subtract(getDateOffset(this), 'm');
|
27448 | }
|
27449 | }
|
27450 |
|
27451 | return this;
|
27452 | }
|
27453 |
|
27454 | function setOffsetToParsedOffset() {
|
27455 | if (this._tzm != null) {
|
27456 | this.utcOffset(this._tzm, false, true);
|
27457 | } else if (typeof this._i === 'string') {
|
27458 | var tZone = offsetFromString(matchOffset, this._i);
|
27459 |
|
27460 | if (tZone != null) {
|
27461 | this.utcOffset(tZone);
|
27462 | } else {
|
27463 | this.utcOffset(0, true);
|
27464 | }
|
27465 | }
|
27466 |
|
27467 | return this;
|
27468 | }
|
27469 |
|
27470 | function hasAlignedHourOffset(input) {
|
27471 | if (!this.isValid()) {
|
27472 | return false;
|
27473 | }
|
27474 |
|
27475 | input = input ? createLocal(input).utcOffset() : 0;
|
27476 | return (this.utcOffset() - input) % 60 === 0;
|
27477 | }
|
27478 |
|
27479 | function isDaylightSavingTime() {
|
27480 | return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
|
27481 | }
|
27482 |
|
27483 | function isDaylightSavingTimeShifted() {
|
27484 | if (!isUndefined(this._isDSTShifted)) {
|
27485 | return this._isDSTShifted;
|
27486 | }
|
27487 |
|
27488 | var c = {};
|
27489 | copyConfig(c, this);
|
27490 | c = prepareConfig(c);
|
27491 |
|
27492 | if (c._a) {
|
27493 | var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
|
27494 | this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;
|
27495 | } else {
|
27496 | this._isDSTShifted = false;
|
27497 | }
|
27498 |
|
27499 | return this._isDSTShifted;
|
27500 | }
|
27501 |
|
27502 | function isLocal() {
|
27503 | return this.isValid() ? !this._isUTC : false;
|
27504 | }
|
27505 |
|
27506 | function isUtcOffset() {
|
27507 | return this.isValid() ? this._isUTC : false;
|
27508 | }
|
27509 |
|
27510 | function isUtc() {
|
27511 | return this.isValid() ? this._isUTC && this._offset === 0 : false;
|
27512 | }
|
27513 |
|
27514 |
|
27515 | var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
|
27516 |
|
27517 |
|
27518 |
|
27519 | var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
|
27520 |
|
27521 | function createDuration(input, key) {
|
27522 | var duration = input,
|
27523 |
|
27524 | match = null,
|
27525 | sign,
|
27526 | ret,
|
27527 | diffRes;
|
27528 |
|
27529 | if (isDuration(input)) {
|
27530 | duration = {
|
27531 | ms: input._milliseconds,
|
27532 | d: input._days,
|
27533 | M: input._months
|
27534 | };
|
27535 | } else if (isNumber(input)) {
|
27536 | duration = {};
|
27537 |
|
27538 | if (key) {
|
27539 | duration[key] = input;
|
27540 | } else {
|
27541 | duration.milliseconds = input;
|
27542 | }
|
27543 | } else if (!!(match = aspNetRegex.exec(input))) {
|
27544 | sign = match[1] === '-' ? -1 : 1;
|
27545 | duration = {
|
27546 | y: 0,
|
27547 | d: toInt(match[DATE]) * sign,
|
27548 | h: toInt(match[HOUR]) * sign,
|
27549 | m: toInt(match[MINUTE]) * sign,
|
27550 | s: toInt(match[SECOND]) * sign,
|
27551 | ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign
|
27552 |
|
27553 | };
|
27554 | } else if (!!(match = isoRegex.exec(input))) {
|
27555 | sign = match[1] === '-' ? -1 : 1;
|
27556 | duration = {
|
27557 | y: parseIso(match[2], sign),
|
27558 | M: parseIso(match[3], sign),
|
27559 | w: parseIso(match[4], sign),
|
27560 | d: parseIso(match[5], sign),
|
27561 | h: parseIso(match[6], sign),
|
27562 | m: parseIso(match[7], sign),
|
27563 | s: parseIso(match[8], sign)
|
27564 | };
|
27565 | } else if (duration == null) {
|
27566 |
|
27567 | duration = {};
|
27568 | } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
|
27569 | diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
|
27570 | duration = {};
|
27571 | duration.ms = diffRes.milliseconds;
|
27572 | duration.M = diffRes.months;
|
27573 | }
|
27574 |
|
27575 | ret = new Duration(duration);
|
27576 |
|
27577 | if (isDuration(input) && hasOwnProp(input, '_locale')) {
|
27578 | ret._locale = input._locale;
|
27579 | }
|
27580 |
|
27581 | return ret;
|
27582 | }
|
27583 |
|
27584 | createDuration.fn = Duration.prototype;
|
27585 | createDuration.invalid = createInvalid$1;
|
27586 |
|
27587 | function parseIso(inp, sign) {
|
27588 |
|
27589 |
|
27590 |
|
27591 | var res = inp && parseFloat(inp.replace(',', '.'));
|
27592 |
|
27593 | return (isNaN(res) ? 0 : res) * sign;
|
27594 | }
|
27595 |
|
27596 | function positiveMomentsDifference(base, other) {
|
27597 | var res = {};
|
27598 | res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
|
27599 |
|
27600 | if (base.clone().add(res.months, 'M').isAfter(other)) {
|
27601 | --res.months;
|
27602 | }
|
27603 |
|
27604 | res.milliseconds = +other - +base.clone().add(res.months, 'M');
|
27605 | return res;
|
27606 | }
|
27607 |
|
27608 | function momentsDifference(base, other) {
|
27609 | var res;
|
27610 |
|
27611 | if (!(base.isValid() && other.isValid())) {
|
27612 | return {
|
27613 | milliseconds: 0,
|
27614 | months: 0
|
27615 | };
|
27616 | }
|
27617 |
|
27618 | other = cloneWithOffset(other, base);
|
27619 |
|
27620 | if (base.isBefore(other)) {
|
27621 | res = positiveMomentsDifference(base, other);
|
27622 | } else {
|
27623 | res = positiveMomentsDifference(other, base);
|
27624 | res.milliseconds = -res.milliseconds;
|
27625 | res.months = -res.months;
|
27626 | }
|
27627 |
|
27628 | return res;
|
27629 | }
|
27630 |
|
27631 |
|
27632 | function createAdder(direction, name) {
|
27633 | return function (val, period) {
|
27634 | var dur, tmp;
|
27635 |
|
27636 | if (period !== null && !isNaN(+period)) {
|
27637 | deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
|
27638 | tmp = val;
|
27639 | val = period;
|
27640 | period = tmp;
|
27641 | }
|
27642 |
|
27643 | val = typeof val === 'string' ? +val : val;
|
27644 | dur = createDuration(val, period);
|
27645 | addSubtract(this, dur, direction);
|
27646 | return this;
|
27647 | };
|
27648 | }
|
27649 |
|
27650 | function addSubtract(mom, duration, isAdding, updateOffset) {
|
27651 | var milliseconds = duration._milliseconds,
|
27652 | days = absRound(duration._days),
|
27653 | months = absRound(duration._months);
|
27654 |
|
27655 | if (!mom.isValid()) {
|
27656 |
|
27657 | return;
|
27658 | }
|
27659 |
|
27660 | updateOffset = updateOffset == null ? true : updateOffset;
|
27661 |
|
27662 | if (months) {
|
27663 | setMonth(mom, get(mom, 'Month') + months * isAdding);
|
27664 | }
|
27665 |
|
27666 | if (days) {
|
27667 | set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
|
27668 | }
|
27669 |
|
27670 | if (milliseconds) {
|
27671 | mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
|
27672 | }
|
27673 |
|
27674 | if (updateOffset) {
|
27675 | hooks.updateOffset(mom, days || months);
|
27676 | }
|
27677 | }
|
27678 |
|
27679 | var add = createAdder(1, 'add');
|
27680 | var subtract = createAdder(-1, 'subtract');
|
27681 |
|
27682 | function getCalendarFormat(myMoment, now) {
|
27683 | var diff = myMoment.diff(now, 'days', true);
|
27684 | return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse';
|
27685 | }
|
27686 |
|
27687 | function calendar$1(time, formats) {
|
27688 |
|
27689 |
|
27690 | var now = time || createLocal(),
|
27691 | sod = cloneWithOffset(now, this).startOf('day'),
|
27692 | format = hooks.calendarFormat(this, sod) || 'sameElse';
|
27693 | var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
|
27694 | return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
|
27695 | }
|
27696 |
|
27697 | function clone() {
|
27698 | return new Moment(this);
|
27699 | }
|
27700 |
|
27701 | function isAfter(input, units) {
|
27702 | var localInput = isMoment(input) ? input : createLocal(input);
|
27703 |
|
27704 | if (!(this.isValid() && localInput.isValid())) {
|
27705 | return false;
|
27706 | }
|
27707 |
|
27708 | units = normalizeUnits(units) || 'millisecond';
|
27709 |
|
27710 | if (units === 'millisecond') {
|
27711 | return this.valueOf() > localInput.valueOf();
|
27712 | } else {
|
27713 | return localInput.valueOf() < this.clone().startOf(units).valueOf();
|
27714 | }
|
27715 | }
|
27716 |
|
27717 | function isBefore(input, units) {
|
27718 | var localInput = isMoment(input) ? input : createLocal(input);
|
27719 |
|
27720 | if (!(this.isValid() && localInput.isValid())) {
|
27721 | return false;
|
27722 | }
|
27723 |
|
27724 | units = normalizeUnits(units) || 'millisecond';
|
27725 |
|
27726 | if (units === 'millisecond') {
|
27727 | return this.valueOf() < localInput.valueOf();
|
27728 | } else {
|
27729 | return this.clone().endOf(units).valueOf() < localInput.valueOf();
|
27730 | }
|
27731 | }
|
27732 |
|
27733 | function isBetween(from, to, units, inclusivity) {
|
27734 | var localFrom = isMoment(from) ? from : createLocal(from),
|
27735 | localTo = isMoment(to) ? to : createLocal(to);
|
27736 |
|
27737 | if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
|
27738 | return false;
|
27739 | }
|
27740 |
|
27741 | inclusivity = inclusivity || '()';
|
27742 | return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
|
27743 | }
|
27744 |
|
27745 | function isSame(input, units) {
|
27746 | var localInput = isMoment(input) ? input : createLocal(input),
|
27747 | inputMs;
|
27748 |
|
27749 | if (!(this.isValid() && localInput.isValid())) {
|
27750 | return false;
|
27751 | }
|
27752 |
|
27753 | units = normalizeUnits(units) || 'millisecond';
|
27754 |
|
27755 | if (units === 'millisecond') {
|
27756 | return this.valueOf() === localInput.valueOf();
|
27757 | } else {
|
27758 | inputMs = localInput.valueOf();
|
27759 | return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
|
27760 | }
|
27761 | }
|
27762 |
|
27763 | function isSameOrAfter(input, units) {
|
27764 | return this.isSame(input, units) || this.isAfter(input, units);
|
27765 | }
|
27766 |
|
27767 | function isSameOrBefore(input, units) {
|
27768 | return this.isSame(input, units) || this.isBefore(input, units);
|
27769 | }
|
27770 |
|
27771 | function diff(input, units, asFloat) {
|
27772 | var that, zoneDelta, output;
|
27773 |
|
27774 | if (!this.isValid()) {
|
27775 | return NaN;
|
27776 | }
|
27777 |
|
27778 | that = cloneWithOffset(input, this);
|
27779 |
|
27780 | if (!that.isValid()) {
|
27781 | return NaN;
|
27782 | }
|
27783 |
|
27784 | zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
|
27785 | units = normalizeUnits(units);
|
27786 |
|
27787 | switch (units) {
|
27788 | case 'year':
|
27789 | output = monthDiff(this, that) / 12;
|
27790 | break;
|
27791 |
|
27792 | case 'month':
|
27793 | output = monthDiff(this, that);
|
27794 | break;
|
27795 |
|
27796 | case 'quarter':
|
27797 | output = monthDiff(this, that) / 3;
|
27798 | break;
|
27799 |
|
27800 | case 'second':
|
27801 | output = (this - that) / 1e3;
|
27802 | break;
|
27803 |
|
27804 |
|
27805 | case 'minute':
|
27806 | output = (this - that) / 6e4;
|
27807 | break;
|
27808 |
|
27809 |
|
27810 | case 'hour':
|
27811 | output = (this - that) / 36e5;
|
27812 | break;
|
27813 |
|
27814 |
|
27815 | case 'day':
|
27816 | output = (this - that - zoneDelta) / 864e5;
|
27817 | break;
|
27818 |
|
27819 |
|
27820 | case 'week':
|
27821 | output = (this - that - zoneDelta) / 6048e5;
|
27822 | break;
|
27823 |
|
27824 |
|
27825 | default:
|
27826 | output = this - that;
|
27827 | }
|
27828 |
|
27829 | return asFloat ? output : absFloor(output);
|
27830 | }
|
27831 |
|
27832 | function monthDiff(a, b) {
|
27833 |
|
27834 | var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
|
27835 |
|
27836 | anchor = a.clone().add(wholeMonthDiff, 'months'),
|
27837 | anchor2,
|
27838 | adjust;
|
27839 |
|
27840 | if (b - anchor < 0) {
|
27841 | anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
|
27842 |
|
27843 | adjust = (b - anchor) / (anchor - anchor2);
|
27844 | } else {
|
27845 | anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
|
27846 |
|
27847 | adjust = (b - anchor) / (anchor2 - anchor);
|
27848 | }
|
27849 |
|
27850 |
|
27851 | return -(wholeMonthDiff + adjust) || 0;
|
27852 | }
|
27853 |
|
27854 | hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
|
27855 | hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
|
27856 |
|
27857 | function toString() {
|
27858 | return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
|
27859 | }
|
27860 |
|
27861 | function toISOString(keepOffset) {
|
27862 | if (!this.isValid()) {
|
27863 | return null;
|
27864 | }
|
27865 |
|
27866 | var utc = keepOffset !== true;
|
27867 | var m = utc ? this.clone().utc() : this;
|
27868 |
|
27869 | if (m.year() < 0 || m.year() > 9999) {
|
27870 | return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');
|
27871 | }
|
27872 |
|
27873 | if (isFunction(Date.prototype.toISOString)) {
|
27874 |
|
27875 | if (utc) {
|
27876 | return this.toDate().toISOString();
|
27877 | } else {
|
27878 | return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));
|
27879 | }
|
27880 | }
|
27881 |
|
27882 | return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');
|
27883 | }
|
27884 | |
27885 |
|
27886 |
|
27887 |
|
27888 |
|
27889 |
|
27890 |
|
27891 |
|
27892 | function inspect() {
|
27893 | if (!this.isValid()) {
|
27894 | return 'moment.invalid(/* ' + this._i + ' */)';
|
27895 | }
|
27896 |
|
27897 | var func = 'moment';
|
27898 | var zone = '';
|
27899 |
|
27900 | if (!this.isLocal()) {
|
27901 | func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
|
27902 | zone = 'Z';
|
27903 | }
|
27904 |
|
27905 | var prefix = '[' + func + '("]';
|
27906 | var year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
|
27907 | var datetime = '-MM-DD[T]HH:mm:ss.SSS';
|
27908 | var suffix = zone + '[")]';
|
27909 | return this.format(prefix + year + datetime + suffix);
|
27910 | }
|
27911 |
|
27912 | function format(inputString) {
|
27913 | if (!inputString) {
|
27914 | inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
|
27915 | }
|
27916 |
|
27917 | var output = formatMoment(this, inputString);
|
27918 | return this.localeData().postformat(output);
|
27919 | }
|
27920 |
|
27921 | function from(time, withoutSuffix) {
|
27922 | if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
|
27923 | return createDuration({
|
27924 | to: this,
|
27925 | from: time
|
27926 | }).locale(this.locale()).humanize(!withoutSuffix);
|
27927 | } else {
|
27928 | return this.localeData().invalidDate();
|
27929 | }
|
27930 | }
|
27931 |
|
27932 | function fromNow(withoutSuffix) {
|
27933 | return this.from(createLocal(), withoutSuffix);
|
27934 | }
|
27935 |
|
27936 | function to(time, withoutSuffix) {
|
27937 | if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
|
27938 | return createDuration({
|
27939 | from: this,
|
27940 | to: time
|
27941 | }).locale(this.locale()).humanize(!withoutSuffix);
|
27942 | } else {
|
27943 | return this.localeData().invalidDate();
|
27944 | }
|
27945 | }
|
27946 |
|
27947 | function toNow(withoutSuffix) {
|
27948 | return this.to(createLocal(), withoutSuffix);
|
27949 | }
|
27950 |
|
27951 |
|
27952 |
|
27953 |
|
27954 | function locale(key) {
|
27955 | var newLocaleData;
|
27956 |
|
27957 | if (key === undefined) {
|
27958 | return this._locale._abbr;
|
27959 | } else {
|
27960 | newLocaleData = getLocale(key);
|
27961 |
|
27962 | if (newLocaleData != null) {
|
27963 | this._locale = newLocaleData;
|
27964 | }
|
27965 |
|
27966 | return this;
|
27967 | }
|
27968 | }
|
27969 |
|
27970 | var lang = deprecate('moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) {
|
27971 | if (key === undefined) {
|
27972 | return this.localeData();
|
27973 | } else {
|
27974 | return this.locale(key);
|
27975 | }
|
27976 | });
|
27977 |
|
27978 | function localeData() {
|
27979 | return this._locale;
|
27980 | }
|
27981 |
|
27982 | var MS_PER_SECOND = 1000;
|
27983 | var MS_PER_MINUTE = 60 * MS_PER_SECOND;
|
27984 | var MS_PER_HOUR = 60 * MS_PER_MINUTE;
|
27985 | var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
|
27986 |
|
27987 | function mod$1(dividend, divisor) {
|
27988 | return (dividend % divisor + divisor) % divisor;
|
27989 | }
|
27990 |
|
27991 | function localStartOfDate(y, m, d) {
|
27992 |
|
27993 | if (y < 100 && y >= 0) {
|
27994 |
|
27995 | return new Date(y + 400, m, d) - MS_PER_400_YEARS;
|
27996 | } else {
|
27997 | return new Date(y, m, d).valueOf();
|
27998 | }
|
27999 | }
|
28000 |
|
28001 | function utcStartOfDate(y, m, d) {
|
28002 |
|
28003 | if (y < 100 && y >= 0) {
|
28004 |
|
28005 | return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
|
28006 | } else {
|
28007 | return Date.UTC(y, m, d);
|
28008 | }
|
28009 | }
|
28010 |
|
28011 | function startOf(units) {
|
28012 | var time;
|
28013 | units = normalizeUnits(units);
|
28014 |
|
28015 | if (units === undefined || units === 'millisecond' || !this.isValid()) {
|
28016 | return this;
|
28017 | }
|
28018 |
|
28019 | var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
|
28020 |
|
28021 | switch (units) {
|
28022 | case 'year':
|
28023 | time = startOfDate(this.year(), 0, 1);
|
28024 | break;
|
28025 |
|
28026 | case 'quarter':
|
28027 | time = startOfDate(this.year(), this.month() - this.month() % 3, 1);
|
28028 | break;
|
28029 |
|
28030 | case 'month':
|
28031 | time = startOfDate(this.year(), this.month(), 1);
|
28032 | break;
|
28033 |
|
28034 | case 'week':
|
28035 | time = startOfDate(this.year(), this.month(), this.date() - this.weekday());
|
28036 | break;
|
28037 |
|
28038 | case 'isoWeek':
|
28039 | time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));
|
28040 | break;
|
28041 |
|
28042 | case 'day':
|
28043 | case 'date':
|
28044 | time = startOfDate(this.year(), this.month(), this.date());
|
28045 | break;
|
28046 |
|
28047 | case 'hour':
|
28048 | time = this._d.valueOf();
|
28049 | time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR);
|
28050 | break;
|
28051 |
|
28052 | case 'minute':
|
28053 | time = this._d.valueOf();
|
28054 | time -= mod$1(time, MS_PER_MINUTE);
|
28055 | break;
|
28056 |
|
28057 | case 'second':
|
28058 | time = this._d.valueOf();
|
28059 | time -= mod$1(time, MS_PER_SECOND);
|
28060 | break;
|
28061 | }
|
28062 |
|
28063 | this._d.setTime(time);
|
28064 |
|
28065 | hooks.updateOffset(this, true);
|
28066 | return this;
|
28067 | }
|
28068 |
|
28069 | function endOf(units) {
|
28070 | var time;
|
28071 | units = normalizeUnits(units);
|
28072 |
|
28073 | if (units === undefined || units === 'millisecond' || !this.isValid()) {
|
28074 | return this;
|
28075 | }
|
28076 |
|
28077 | var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
|
28078 |
|
28079 | switch (units) {
|
28080 | case 'year':
|
28081 | time = startOfDate(this.year() + 1, 0, 1) - 1;
|
28082 | break;
|
28083 |
|
28084 | case 'quarter':
|
28085 | time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;
|
28086 | break;
|
28087 |
|
28088 | case 'month':
|
28089 | time = startOfDate(this.year(), this.month() + 1, 1) - 1;
|
28090 | break;
|
28091 |
|
28092 | case 'week':
|
28093 | time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;
|
28094 | break;
|
28095 |
|
28096 | case 'isoWeek':
|
28097 | time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;
|
28098 | break;
|
28099 |
|
28100 | case 'day':
|
28101 | case 'date':
|
28102 | time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
|
28103 | break;
|
28104 |
|
28105 | case 'hour':
|
28106 | time = this._d.valueOf();
|
28107 | time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1;
|
28108 | break;
|
28109 |
|
28110 | case 'minute':
|
28111 | time = this._d.valueOf();
|
28112 | time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
|
28113 | break;
|
28114 |
|
28115 | case 'second':
|
28116 | time = this._d.valueOf();
|
28117 | time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
|
28118 | break;
|
28119 | }
|
28120 |
|
28121 | this._d.setTime(time);
|
28122 |
|
28123 | hooks.updateOffset(this, true);
|
28124 | return this;
|
28125 | }
|
28126 |
|
28127 | function valueOf() {
|
28128 | return this._d.valueOf() - (this._offset || 0) * 60000;
|
28129 | }
|
28130 |
|
28131 | function unix() {
|
28132 | return Math.floor(this.valueOf() / 1000);
|
28133 | }
|
28134 |
|
28135 | function toDate() {
|
28136 | return new Date(this.valueOf());
|
28137 | }
|
28138 |
|
28139 | function toArray() {
|
28140 | var m = this;
|
28141 | return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
|
28142 | }
|
28143 |
|
28144 | function toObject() {
|
28145 | var m = this;
|
28146 | return {
|
28147 | years: m.year(),
|
28148 | months: m.month(),
|
28149 | date: m.date(),
|
28150 | hours: m.hours(),
|
28151 | minutes: m.minutes(),
|
28152 | seconds: m.seconds(),
|
28153 | milliseconds: m.milliseconds()
|
28154 | };
|
28155 | }
|
28156 |
|
28157 | function toJSON() {
|
28158 |
|
28159 | return this.isValid() ? this.toISOString() : null;
|
28160 | }
|
28161 |
|
28162 | function isValid$2() {
|
28163 | return isValid(this);
|
28164 | }
|
28165 |
|
28166 | function parsingFlags() {
|
28167 | return extend({}, getParsingFlags(this));
|
28168 | }
|
28169 |
|
28170 | function invalidAt() {
|
28171 | return getParsingFlags(this).overflow;
|
28172 | }
|
28173 |
|
28174 | function creationData() {
|
28175 | return {
|
28176 | input: this._i,
|
28177 | format: this._f,
|
28178 | locale: this._locale,
|
28179 | isUTC: this._isUTC,
|
28180 | strict: this._strict
|
28181 | };
|
28182 | }
|
28183 |
|
28184 |
|
28185 | addFormatToken(0, ['gg', 2], 0, function () {
|
28186 | return this.weekYear() % 100;
|
28187 | });
|
28188 | addFormatToken(0, ['GG', 2], 0, function () {
|
28189 | return this.isoWeekYear() % 100;
|
28190 | });
|
28191 |
|
28192 | function addWeekYearFormatToken(token, getter) {
|
28193 | addFormatToken(0, [token, token.length], 0, getter);
|
28194 | }
|
28195 |
|
28196 | addWeekYearFormatToken('gggg', 'weekYear');
|
28197 | addWeekYearFormatToken('ggggg', 'weekYear');
|
28198 | addWeekYearFormatToken('GGGG', 'isoWeekYear');
|
28199 | addWeekYearFormatToken('GGGGG', 'isoWeekYear');
|
28200 |
|
28201 | addUnitAlias('weekYear', 'gg');
|
28202 | addUnitAlias('isoWeekYear', 'GG');
|
28203 |
|
28204 | addUnitPriority('weekYear', 1);
|
28205 | addUnitPriority('isoWeekYear', 1);
|
28206 |
|
28207 | addRegexToken('G', matchSigned);
|
28208 | addRegexToken('g', matchSigned);
|
28209 | addRegexToken('GG', match1to2, match2);
|
28210 | addRegexToken('gg', match1to2, match2);
|
28211 | addRegexToken('GGGG', match1to4, match4);
|
28212 | addRegexToken('gggg', match1to4, match4);
|
28213 | addRegexToken('GGGGG', match1to6, match6);
|
28214 | addRegexToken('ggggg', match1to6, match6);
|
28215 | addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
|
28216 | week[token.substr(0, 2)] = toInt(input);
|
28217 | });
|
28218 | addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
|
28219 | week[token] = hooks.parseTwoDigitYear(input);
|
28220 | });
|
28221 |
|
28222 | function getSetWeekYear(input) {
|
28223 | return getSetWeekYearHelper.call(this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy);
|
28224 | }
|
28225 |
|
28226 | function getSetISOWeekYear(input) {
|
28227 | return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4);
|
28228 | }
|
28229 |
|
28230 | function getISOWeeksInYear() {
|
28231 | return weeksInYear(this.year(), 1, 4);
|
28232 | }
|
28233 |
|
28234 | function getWeeksInYear() {
|
28235 | var weekInfo = this.localeData()._week;
|
28236 |
|
28237 | return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
|
28238 | }
|
28239 |
|
28240 | function getSetWeekYearHelper(input, week, weekday, dow, doy) {
|
28241 | var weeksTarget;
|
28242 |
|
28243 | if (input == null) {
|
28244 | return weekOfYear(this, dow, doy).year;
|
28245 | } else {
|
28246 | weeksTarget = weeksInYear(input, dow, doy);
|
28247 |
|
28248 | if (week > weeksTarget) {
|
28249 | week = weeksTarget;
|
28250 | }
|
28251 |
|
28252 | return setWeekAll.call(this, input, week, weekday, dow, doy);
|
28253 | }
|
28254 | }
|
28255 |
|
28256 | function setWeekAll(weekYear, week, weekday, dow, doy) {
|
28257 | var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
|
28258 | date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
|
28259 | this.year(date.getUTCFullYear());
|
28260 | this.month(date.getUTCMonth());
|
28261 | this.date(date.getUTCDate());
|
28262 | return this;
|
28263 | }
|
28264 |
|
28265 |
|
28266 | addFormatToken('Q', 0, 'Qo', 'quarter');
|
28267 |
|
28268 | addUnitAlias('quarter', 'Q');
|
28269 |
|
28270 | addUnitPriority('quarter', 7);
|
28271 |
|
28272 | addRegexToken('Q', match1);
|
28273 | addParseToken('Q', function (input, array) {
|
28274 | array[MONTH] = (toInt(input) - 1) * 3;
|
28275 | });
|
28276 |
|
28277 | function getSetQuarter(input) {
|
28278 | return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
|
28279 | }
|
28280 |
|
28281 |
|
28282 | addFormatToken('D', ['DD', 2], 'Do', 'date');
|
28283 |
|
28284 | addUnitAlias('date', 'D');
|
28285 |
|
28286 | addUnitPriority('date', 9);
|
28287 |
|
28288 | addRegexToken('D', match1to2);
|
28289 | addRegexToken('DD', match1to2, match2);
|
28290 | addRegexToken('Do', function (isStrict, locale) {
|
28291 |
|
28292 | return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient;
|
28293 | });
|
28294 | addParseToken(['D', 'DD'], DATE);
|
28295 | addParseToken('Do', function (input, array) {
|
28296 | array[DATE] = toInt(input.match(match1to2)[0]);
|
28297 | });
|
28298 |
|
28299 | var getSetDayOfMonth = makeGetSet('Date', true);
|
28300 |
|
28301 | addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
|
28302 |
|
28303 | addUnitAlias('dayOfYear', 'DDD');
|
28304 |
|
28305 | addUnitPriority('dayOfYear', 4);
|
28306 |
|
28307 | addRegexToken('DDD', match1to3);
|
28308 | addRegexToken('DDDD', match3);
|
28309 | addParseToken(['DDD', 'DDDD'], function (input, array, config) {
|
28310 | config._dayOfYear = toInt(input);
|
28311 | });
|
28312 |
|
28313 |
|
28314 | function getSetDayOfYear(input) {
|
28315 | var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
|
28316 | return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
|
28317 | }
|
28318 |
|
28319 |
|
28320 | addFormatToken('m', ['mm', 2], 0, 'minute');
|
28321 |
|
28322 | addUnitAlias('minute', 'm');
|
28323 |
|
28324 | addUnitPriority('minute', 14);
|
28325 |
|
28326 | addRegexToken('m', match1to2);
|
28327 | addRegexToken('mm', match1to2, match2);
|
28328 | addParseToken(['m', 'mm'], MINUTE);
|
28329 |
|
28330 | var getSetMinute = makeGetSet('Minutes', false);
|
28331 |
|
28332 | addFormatToken('s', ['ss', 2], 0, 'second');
|
28333 |
|
28334 | addUnitAlias('second', 's');
|
28335 |
|
28336 | addUnitPriority('second', 15);
|
28337 |
|
28338 | addRegexToken('s', match1to2);
|
28339 | addRegexToken('ss', match1to2, match2);
|
28340 | addParseToken(['s', 'ss'], SECOND);
|
28341 |
|
28342 | var getSetSecond = makeGetSet('Seconds', false);
|
28343 |
|
28344 | addFormatToken('S', 0, 0, function () {
|
28345 | return ~~(this.millisecond() / 100);
|
28346 | });
|
28347 | addFormatToken(0, ['SS', 2], 0, function () {
|
28348 | return ~~(this.millisecond() / 10);
|
28349 | });
|
28350 | addFormatToken(0, ['SSS', 3], 0, 'millisecond');
|
28351 | addFormatToken(0, ['SSSS', 4], 0, function () {
|
28352 | return this.millisecond() * 10;
|
28353 | });
|
28354 | addFormatToken(0, ['SSSSS', 5], 0, function () {
|
28355 | return this.millisecond() * 100;
|
28356 | });
|
28357 | addFormatToken(0, ['SSSSSS', 6], 0, function () {
|
28358 | return this.millisecond() * 1000;
|
28359 | });
|
28360 | addFormatToken(0, ['SSSSSSS', 7], 0, function () {
|
28361 | return this.millisecond() * 10000;
|
28362 | });
|
28363 | addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
|
28364 | return this.millisecond() * 100000;
|
28365 | });
|
28366 | addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
|
28367 | return this.millisecond() * 1000000;
|
28368 | });
|
28369 |
|
28370 | addUnitAlias('millisecond', 'ms');
|
28371 |
|
28372 | addUnitPriority('millisecond', 16);
|
28373 |
|
28374 | addRegexToken('S', match1to3, match1);
|
28375 | addRegexToken('SS', match1to3, match2);
|
28376 | addRegexToken('SSS', match1to3, match3);
|
28377 | var token;
|
28378 |
|
28379 | for (token = 'SSSS'; token.length <= 9; token += 'S') {
|
28380 | addRegexToken(token, matchUnsigned);
|
28381 | }
|
28382 |
|
28383 | function parseMs(input, array) {
|
28384 | array[MILLISECOND] = toInt(('0.' + input) * 1000);
|
28385 | }
|
28386 |
|
28387 | for (token = 'S'; token.length <= 9; token += 'S') {
|
28388 | addParseToken(token, parseMs);
|
28389 | }
|
28390 |
|
28391 |
|
28392 | var getSetMillisecond = makeGetSet('Milliseconds', false);
|
28393 |
|
28394 | addFormatToken('z', 0, 0, 'zoneAbbr');
|
28395 | addFormatToken('zz', 0, 0, 'zoneName');
|
28396 |
|
28397 | function getZoneAbbr() {
|
28398 | return this._isUTC ? 'UTC' : '';
|
28399 | }
|
28400 |
|
28401 | function getZoneName() {
|
28402 | return this._isUTC ? 'Coordinated Universal Time' : '';
|
28403 | }
|
28404 |
|
28405 | var proto = Moment.prototype;
|
28406 | proto.add = add;
|
28407 | proto.calendar = calendar$1;
|
28408 | proto.clone = clone;
|
28409 | proto.diff = diff;
|
28410 | proto.endOf = endOf;
|
28411 | proto.format = format;
|
28412 | proto.from = from;
|
28413 | proto.fromNow = fromNow;
|
28414 | proto.to = to;
|
28415 | proto.toNow = toNow;
|
28416 | proto.get = stringGet;
|
28417 | proto.invalidAt = invalidAt;
|
28418 | proto.isAfter = isAfter;
|
28419 | proto.isBefore = isBefore;
|
28420 | proto.isBetween = isBetween;
|
28421 | proto.isSame = isSame;
|
28422 | proto.isSameOrAfter = isSameOrAfter;
|
28423 | proto.isSameOrBefore = isSameOrBefore;
|
28424 | proto.isValid = isValid$2;
|
28425 | proto.lang = lang;
|
28426 | proto.locale = locale;
|
28427 | proto.localeData = localeData;
|
28428 | proto.max = prototypeMax;
|
28429 | proto.min = prototypeMin;
|
28430 | proto.parsingFlags = parsingFlags;
|
28431 | proto.set = stringSet;
|
28432 | proto.startOf = startOf;
|
28433 | proto.subtract = subtract;
|
28434 | proto.toArray = toArray;
|
28435 | proto.toObject = toObject;
|
28436 | proto.toDate = toDate;
|
28437 | proto.toISOString = toISOString;
|
28438 | proto.inspect = inspect;
|
28439 | proto.toJSON = toJSON;
|
28440 | proto.toString = toString;
|
28441 | proto.unix = unix;
|
28442 | proto.valueOf = valueOf;
|
28443 | proto.creationData = creationData;
|
28444 | proto.year = getSetYear;
|
28445 | proto.isLeapYear = getIsLeapYear;
|
28446 | proto.weekYear = getSetWeekYear;
|
28447 | proto.isoWeekYear = getSetISOWeekYear;
|
28448 | proto.quarter = proto.quarters = getSetQuarter;
|
28449 | proto.month = getSetMonth;
|
28450 | proto.daysInMonth = getDaysInMonth;
|
28451 | proto.week = proto.weeks = getSetWeek;
|
28452 | proto.isoWeek = proto.isoWeeks = getSetISOWeek;
|
28453 | proto.weeksInYear = getWeeksInYear;
|
28454 | proto.isoWeeksInYear = getISOWeeksInYear;
|
28455 | proto.date = getSetDayOfMonth;
|
28456 | proto.day = proto.days = getSetDayOfWeek;
|
28457 | proto.weekday = getSetLocaleDayOfWeek;
|
28458 | proto.isoWeekday = getSetISODayOfWeek;
|
28459 | proto.dayOfYear = getSetDayOfYear;
|
28460 | proto.hour = proto.hours = getSetHour;
|
28461 | proto.minute = proto.minutes = getSetMinute;
|
28462 | proto.second = proto.seconds = getSetSecond;
|
28463 | proto.millisecond = proto.milliseconds = getSetMillisecond;
|
28464 | proto.utcOffset = getSetOffset;
|
28465 | proto.utc = setOffsetToUTC;
|
28466 | proto.local = setOffsetToLocal;
|
28467 | proto.parseZone = setOffsetToParsedOffset;
|
28468 | proto.hasAlignedHourOffset = hasAlignedHourOffset;
|
28469 | proto.isDST = isDaylightSavingTime;
|
28470 | proto.isLocal = isLocal;
|
28471 | proto.isUtcOffset = isUtcOffset;
|
28472 | proto.isUtc = isUtc;
|
28473 | proto.isUTC = isUtc;
|
28474 | proto.zoneAbbr = getZoneAbbr;
|
28475 | proto.zoneName = getZoneName;
|
28476 | proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
|
28477 | proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
|
28478 | proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
|
28479 | proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
|
28480 | proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
|
28481 |
|
28482 | function createUnix(input) {
|
28483 | return createLocal(input * 1000);
|
28484 | }
|
28485 |
|
28486 | function createInZone() {
|
28487 | return createLocal.apply(null, arguments).parseZone();
|
28488 | }
|
28489 |
|
28490 | function preParsePostFormat(string) {
|
28491 | return string;
|
28492 | }
|
28493 |
|
28494 | var proto$1 = Locale.prototype;
|
28495 | proto$1.calendar = calendar;
|
28496 | proto$1.longDateFormat = longDateFormat;
|
28497 | proto$1.invalidDate = invalidDate;
|
28498 | proto$1.ordinal = ordinal;
|
28499 | proto$1.preparse = preParsePostFormat;
|
28500 | proto$1.postformat = preParsePostFormat;
|
28501 | proto$1.relativeTime = relativeTime;
|
28502 | proto$1.pastFuture = pastFuture;
|
28503 | proto$1.set = set;
|
28504 | proto$1.months = localeMonths;
|
28505 | proto$1.monthsShort = localeMonthsShort;
|
28506 | proto$1.monthsParse = localeMonthsParse;
|
28507 | proto$1.monthsRegex = monthsRegex;
|
28508 | proto$1.monthsShortRegex = monthsShortRegex;
|
28509 | proto$1.week = localeWeek;
|
28510 | proto$1.firstDayOfYear = localeFirstDayOfYear;
|
28511 | proto$1.firstDayOfWeek = localeFirstDayOfWeek;
|
28512 | proto$1.weekdays = localeWeekdays;
|
28513 | proto$1.weekdaysMin = localeWeekdaysMin;
|
28514 | proto$1.weekdaysShort = localeWeekdaysShort;
|
28515 | proto$1.weekdaysParse = localeWeekdaysParse;
|
28516 | proto$1.weekdaysRegex = weekdaysRegex;
|
28517 | proto$1.weekdaysShortRegex = weekdaysShortRegex;
|
28518 | proto$1.weekdaysMinRegex = weekdaysMinRegex;
|
28519 | proto$1.isPM = localeIsPM;
|
28520 | proto$1.meridiem = localeMeridiem;
|
28521 |
|
28522 | function get$1(format, index, field, setter) {
|
28523 | var locale = getLocale();
|
28524 | var utc = createUTC().set(setter, index);
|
28525 | return locale[field](utc, format);
|
28526 | }
|
28527 |
|
28528 | function listMonthsImpl(format, index, field) {
|
28529 | if (isNumber(format)) {
|
28530 | index = format;
|
28531 | format = undefined;
|
28532 | }
|
28533 |
|
28534 | format = format || '';
|
28535 |
|
28536 | if (index != null) {
|
28537 | return get$1(format, index, field, 'month');
|
28538 | }
|
28539 |
|
28540 | var i;
|
28541 | var out = [];
|
28542 |
|
28543 | for (i = 0; i < 12; i++) {
|
28544 | out[i] = get$1(format, i, field, 'month');
|
28545 | }
|
28546 |
|
28547 | return out;
|
28548 | } // ()
|
28549 | // (5)
|
28550 | // (fmt, 5)
|
28551 | // (fmt)
|
28552 | // (true)
|
28553 | // (true, 5)
|
28554 | // (true, fmt, 5)
|
28555 | // (true, fmt)
|
28556 |
|
28557 |
|
28558 | function listWeekdaysImpl(localeSorted, format, index, field) {
|
28559 | if (typeof localeSorted === 'boolean') {
|
28560 | if (isNumber(format)) {
|
28561 | index = format;
|
28562 | format = undefined;
|
28563 | }
|
28564 |
|
28565 | format = format || '';
|
28566 | } else {
|
28567 | format = localeSorted;
|
28568 | index = format;
|
28569 | localeSorted = false;
|
28570 |
|
28571 | if (isNumber(format)) {
|
28572 | index = format;
|
28573 | format = undefined;
|
28574 | }
|
28575 |
|
28576 | format = format || '';
|
28577 | }
|
28578 |
|
28579 | var locale = getLocale(),
|
28580 | shift = localeSorted ? locale._week.dow : 0;
|
28581 |
|
28582 | if (index != null) {
|
28583 | return get$1(format, (index + shift) % 7, field, 'day');
|
28584 | }
|
28585 |
|
28586 | var i;
|
28587 | var out = [];
|
28588 |
|
28589 | for (i = 0; i < 7; i++) {
|
28590 | out[i] = get$1(format, (i + shift) % 7, field, 'day');
|
28591 | }
|
28592 |
|
28593 | return out;
|
28594 | }
|
28595 |
|
28596 | function listMonths(format, index) {
|
28597 | return listMonthsImpl(format, index, 'months');
|
28598 | }
|
28599 |
|
28600 | function listMonthsShort(format, index) {
|
28601 | return listMonthsImpl(format, index, 'monthsShort');
|
28602 | }
|
28603 |
|
28604 | function listWeekdays(localeSorted, format, index) {
|
28605 | return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
|
28606 | }
|
28607 |
|
28608 | function listWeekdaysShort(localeSorted, format, index) {
|
28609 | return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
|
28610 | }
|
28611 |
|
28612 | function listWeekdaysMin(localeSorted, format, index) {
|
28613 | return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
|
28614 | }
|
28615 |
|
28616 | getSetGlobalLocale('en', {
|
28617 | dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
|
28618 | ordinal: function (number) {
|
28619 | var b = number % 10,
|
28620 | output = toInt(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
|
28621 | return number + output;
|
28622 | }
|
28623 | });
|
28624 |
|
28625 | hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
|
28626 | hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
|
28627 | var mathAbs = Math.abs;
|
28628 |
|
28629 | function abs() {
|
28630 | var data = this._data;
|
28631 | this._milliseconds = mathAbs(this._milliseconds);
|
28632 | this._days = mathAbs(this._days);
|
28633 | this._months = mathAbs(this._months);
|
28634 | data.milliseconds = mathAbs(data.milliseconds);
|
28635 | data.seconds = mathAbs(data.seconds);
|
28636 | data.minutes = mathAbs(data.minutes);
|
28637 | data.hours = mathAbs(data.hours);
|
28638 | data.months = mathAbs(data.months);
|
28639 | data.years = mathAbs(data.years);
|
28640 | return this;
|
28641 | }
|
28642 |
|
28643 | function addSubtract$1(duration, input, value, direction) {
|
28644 | var other = createDuration(input, value);
|
28645 | duration._milliseconds += direction * other._milliseconds;
|
28646 | duration._days += direction * other._days;
|
28647 | duration._months += direction * other._months;
|
28648 | return duration._bubble();
|
28649 | }
|
28650 |
|
28651 |
|
28652 | function add$1(input, value) {
|
28653 | return addSubtract$1(this, input, value, 1);
|
28654 | }
|
28655 |
|
28656 |
|
28657 | function subtract$1(input, value) {
|
28658 | return addSubtract$1(this, input, value, -1);
|
28659 | }
|
28660 |
|
28661 | function absCeil(number) {
|
28662 | if (number < 0) {
|
28663 | return Math.floor(number);
|
28664 | } else {
|
28665 | return Math.ceil(number);
|
28666 | }
|
28667 | }
|
28668 |
|
28669 | function bubble() {
|
28670 | var milliseconds = this._milliseconds;
|
28671 | var days = this._days;
|
28672 | var months = this._months;
|
28673 | var data = this._data;
|
28674 | var seconds, minutes, hours, years, monthsFromDays;
|
28675 |
|
28676 |
|
28677 | if (!(milliseconds >= 0 && days >= 0 && months >= 0 || milliseconds <= 0 && days <= 0 && months <= 0)) {
|
28678 | milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
|
28679 | days = 0;
|
28680 | months = 0;
|
28681 | }
|
28682 |
|
28683 |
|
28684 |
|
28685 | data.milliseconds = milliseconds % 1000;
|
28686 | seconds = absFloor(milliseconds / 1000);
|
28687 | data.seconds = seconds % 60;
|
28688 | minutes = absFloor(seconds / 60);
|
28689 | data.minutes = minutes % 60;
|
28690 | hours = absFloor(minutes / 60);
|
28691 | data.hours = hours % 24;
|
28692 | days += absFloor(hours / 24);
|
28693 |
|
28694 | monthsFromDays = absFloor(daysToMonths(days));
|
28695 | months += monthsFromDays;
|
28696 | days -= absCeil(monthsToDays(monthsFromDays));
|
28697 |
|
28698 | years = absFloor(months / 12);
|
28699 | months %= 12;
|
28700 | data.days = days;
|
28701 | data.months = months;
|
28702 | data.years = years;
|
28703 | return this;
|
28704 | }
|
28705 |
|
28706 | function daysToMonths(days) {
|
28707 |
|
28708 |
|
28709 | return days * 4800 / 146097;
|
28710 | }
|
28711 |
|
28712 | function monthsToDays(months) {
|
28713 |
|
28714 | return months * 146097 / 4800;
|
28715 | }
|
28716 |
|
28717 | function as(units) {
|
28718 | if (!this.isValid()) {
|
28719 | return NaN;
|
28720 | }
|
28721 |
|
28722 | var days;
|
28723 | var months;
|
28724 | var milliseconds = this._milliseconds;
|
28725 | units = normalizeUnits(units);
|
28726 |
|
28727 | if (units === 'month' || units === 'quarter' || units === 'year') {
|
28728 | days = this._days + milliseconds / 864e5;
|
28729 | months = this._months + daysToMonths(days);
|
28730 |
|
28731 | switch (units) {
|
28732 | case 'month':
|
28733 | return months;
|
28734 |
|
28735 | case 'quarter':
|
28736 | return months / 3;
|
28737 |
|
28738 | case 'year':
|
28739 | return months / 12;
|
28740 | }
|
28741 | } else {
|
28742 |
|
28743 | days = this._days + Math.round(monthsToDays(this._months));
|
28744 |
|
28745 | switch (units) {
|
28746 | case 'week':
|
28747 | return days / 7 + milliseconds / 6048e5;
|
28748 |
|
28749 | case 'day':
|
28750 | return days + milliseconds / 864e5;
|
28751 |
|
28752 | case 'hour':
|
28753 | return days * 24 + milliseconds / 36e5;
|
28754 |
|
28755 | case 'minute':
|
28756 | return days * 1440 + milliseconds / 6e4;
|
28757 |
|
28758 | case 'second':
|
28759 | return days * 86400 + milliseconds / 1000;
|
28760 |
|
28761 |
|
28762 | case 'millisecond':
|
28763 | return Math.floor(days * 864e5) + milliseconds;
|
28764 |
|
28765 | default:
|
28766 | throw new Error('Unknown unit ' + units);
|
28767 | }
|
28768 | }
|
28769 | }
|
28770 |
|
28771 |
|
28772 | function valueOf$1() {
|
28773 | if (!this.isValid()) {
|
28774 | return NaN;
|
28775 | }
|
28776 |
|
28777 | return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6;
|
28778 | }
|
28779 |
|
28780 | function makeAs(alias) {
|
28781 | return function () {
|
28782 | return this.as(alias);
|
28783 | };
|
28784 | }
|
28785 |
|
28786 | var asMilliseconds = makeAs('ms');
|
28787 | var asSeconds = makeAs('s');
|
28788 | var asMinutes = makeAs('m');
|
28789 | var asHours = makeAs('h');
|
28790 | var asDays = makeAs('d');
|
28791 | var asWeeks = makeAs('w');
|
28792 | var asMonths = makeAs('M');
|
28793 | var asQuarters = makeAs('Q');
|
28794 | var asYears = makeAs('y');
|
28795 |
|
28796 | function clone$1() {
|
28797 | return createDuration(this);
|
28798 | }
|
28799 |
|
28800 | function get$2(units) {
|
28801 | units = normalizeUnits(units);
|
28802 | return this.isValid() ? this[units + 's']() : NaN;
|
28803 | }
|
28804 |
|
28805 | function makeGetter(name) {
|
28806 | return function () {
|
28807 | return this.isValid() ? this._data[name] : NaN;
|
28808 | };
|
28809 | }
|
28810 |
|
28811 | var milliseconds = makeGetter('milliseconds');
|
28812 | var seconds = makeGetter('seconds');
|
28813 | var minutes = makeGetter('minutes');
|
28814 | var hours = makeGetter('hours');
|
28815 | var days = makeGetter('days');
|
28816 | var months = makeGetter('months');
|
28817 | var years = makeGetter('years');
|
28818 |
|
28819 | function weeks() {
|
28820 | return absFloor(this.days() / 7);
|
28821 | }
|
28822 |
|
28823 | var round = Math.round;
|
28824 | var thresholds = {
|
28825 | ss: 44,
|
28826 |
|
28827 | s: 45,
|
28828 |
|
28829 | m: 45,
|
28830 |
|
28831 | h: 22,
|
28832 |
|
28833 | d: 26,
|
28834 |
|
28835 | M: 11
|
28836 |
|
28837 | };
|
28838 |
|
28839 | function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
|
28840 | return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
|
28841 | }
|
28842 |
|
28843 | function relativeTime$1(posNegDuration, withoutSuffix, locale) {
|
28844 | var duration = createDuration(posNegDuration).abs();
|
28845 | var seconds = round(duration.as('s'));
|
28846 | var minutes = round(duration.as('m'));
|
28847 | var hours = round(duration.as('h'));
|
28848 | var days = round(duration.as('d'));
|
28849 | var months = round(duration.as('M'));
|
28850 | var years = round(duration.as('y'));
|
28851 | var a = seconds <= thresholds.ss && ['s', seconds] || seconds < thresholds.s && ['ss', seconds] || minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || days <= 1 && ['d'] || days < thresholds.d && ['dd', days] || months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || years <= 1 && ['y'] || ['yy', years];
|
28852 | a[2] = withoutSuffix;
|
28853 | a[3] = +posNegDuration > 0;
|
28854 | a[4] = locale;
|
28855 | return substituteTimeAgo.apply(null, a);
|
28856 | }
|
28857 |
|
28858 |
|
28859 | function getSetRelativeTimeRounding(roundingFunction) {
|
28860 | if (roundingFunction === undefined) {
|
28861 | return round;
|
28862 | }
|
28863 |
|
28864 | if (typeof roundingFunction === 'function') {
|
28865 | round = roundingFunction;
|
28866 | return true;
|
28867 | }
|
28868 |
|
28869 | return false;
|
28870 | }
|
28871 |
|
28872 |
|
28873 | function getSetRelativeTimeThreshold(threshold, limit) {
|
28874 | if (thresholds[threshold] === undefined) {
|
28875 | return false;
|
28876 | }
|
28877 |
|
28878 | if (limit === undefined) {
|
28879 | return thresholds[threshold];
|
28880 | }
|
28881 |
|
28882 | thresholds[threshold] = limit;
|
28883 |
|
28884 | if (threshold === 's') {
|
28885 | thresholds.ss = limit - 1;
|
28886 | }
|
28887 |
|
28888 | return true;
|
28889 | }
|
28890 |
|
28891 | function humanize(withSuffix) {
|
28892 | if (!this.isValid()) {
|
28893 | return this.localeData().invalidDate();
|
28894 | }
|
28895 |
|
28896 | var locale = this.localeData();
|
28897 | var output = relativeTime$1(this, !withSuffix, locale);
|
28898 |
|
28899 | if (withSuffix) {
|
28900 | output = locale.pastFuture(+this, output);
|
28901 | }
|
28902 |
|
28903 | return locale.postformat(output);
|
28904 | }
|
28905 |
|
28906 | var abs$1 = Math.abs;
|
28907 |
|
28908 | function sign(x) {
|
28909 | return (x > 0) - (x < 0) || +x;
|
28910 | }
|
28911 |
|
28912 | function toISOString$1() {
|
28913 |
|
28914 |
|
28915 |
|
28916 |
|
28917 |
|
28918 |
|
28919 |
|
28920 | if (!this.isValid()) {
|
28921 | return this.localeData().invalidDate();
|
28922 | }
|
28923 |
|
28924 | var seconds = abs$1(this._milliseconds) / 1000;
|
28925 | var days = abs$1(this._days);
|
28926 | var months = abs$1(this._months);
|
28927 | var minutes, hours, years;
|
28928 |
|
28929 | minutes = absFloor(seconds / 60);
|
28930 | hours = absFloor(minutes / 60);
|
28931 | seconds %= 60;
|
28932 | minutes %= 60;
|
28933 |
|
28934 | years = absFloor(months / 12);
|
28935 | months %= 12;
|
28936 |
|
28937 | var Y = years;
|
28938 | var M = months;
|
28939 | var D = days;
|
28940 | var h = hours;
|
28941 | var m = minutes;
|
28942 | var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
|
28943 | var total = this.asSeconds();
|
28944 |
|
28945 | if (!total) {
|
28946 |
|
28947 |
|
28948 | return 'P0D';
|
28949 | }
|
28950 |
|
28951 | var totalSign = total < 0 ? '-' : '';
|
28952 | var ymSign = sign(this._months) !== sign(total) ? '-' : '';
|
28953 | var daysSign = sign(this._days) !== sign(total) ? '-' : '';
|
28954 | var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
|
28955 | return totalSign + 'P' + (Y ? ymSign + Y + 'Y' : '') + (M ? ymSign + M + 'M' : '') + (D ? daysSign + D + 'D' : '') + (h || m || s ? 'T' : '') + (h ? hmsSign + h + 'H' : '') + (m ? hmsSign + m + 'M' : '') + (s ? hmsSign + s + 'S' : '');
|
28956 | }
|
28957 |
|
28958 | var proto$2 = Duration.prototype;
|
28959 | proto$2.isValid = isValid$1;
|
28960 | proto$2.abs = abs;
|
28961 | proto$2.add = add$1;
|
28962 | proto$2.subtract = subtract$1;
|
28963 | proto$2.as = as;
|
28964 | proto$2.asMilliseconds = asMilliseconds;
|
28965 | proto$2.asSeconds = asSeconds;
|
28966 | proto$2.asMinutes = asMinutes;
|
28967 | proto$2.asHours = asHours;
|
28968 | proto$2.asDays = asDays;
|
28969 | proto$2.asWeeks = asWeeks;
|
28970 | proto$2.asMonths = asMonths;
|
28971 | proto$2.asQuarters = asQuarters;
|
28972 | proto$2.asYears = asYears;
|
28973 | proto$2.valueOf = valueOf$1;
|
28974 | proto$2._bubble = bubble;
|
28975 | proto$2.clone = clone$1;
|
28976 | proto$2.get = get$2;
|
28977 | proto$2.milliseconds = milliseconds;
|
28978 | proto$2.seconds = seconds;
|
28979 | proto$2.minutes = minutes;
|
28980 | proto$2.hours = hours;
|
28981 | proto$2.days = days;
|
28982 | proto$2.weeks = weeks;
|
28983 | proto$2.months = months;
|
28984 | proto$2.years = years;
|
28985 | proto$2.humanize = humanize;
|
28986 | proto$2.toISOString = toISOString$1;
|
28987 | proto$2.toString = toISOString$1;
|
28988 | proto$2.toJSON = toISOString$1;
|
28989 | proto$2.locale = locale;
|
28990 | proto$2.localeData = localeData;
|
28991 | proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
|
28992 | proto$2.lang = lang; // Side effect imports
|
28993 | // FORMATTING
|
28994 |
|
28995 | addFormatToken('X', 0, 0, 'unix');
|
28996 | addFormatToken('x', 0, 0, 'valueOf'); // PARSING
|
28997 |
|
28998 | addRegexToken('x', matchSigned);
|
28999 | addRegexToken('X', matchTimestamp);
|
29000 | addParseToken('X', function (input, array, config) {
|
29001 | config._d = new Date(parseFloat(input, 10) * 1000);
|
29002 | });
|
29003 | addParseToken('x', function (input, array, config) {
|
29004 | config._d = new Date(toInt(input));
|
29005 | });
|
29006 |
|
29007 | hooks.version = '2.24.0';
|
29008 | setHookCallback(createLocal);
|
29009 | hooks.fn = proto;
|
29010 | hooks.min = min;
|
29011 | hooks.max = max;
|
29012 | hooks.now = now;
|
29013 | hooks.utc = createUTC;
|
29014 | hooks.unix = createUnix;
|
29015 | hooks.months = listMonths;
|
29016 | hooks.isDate = isDate;
|
29017 | hooks.locale = getSetGlobalLocale;
|
29018 | hooks.invalid = createInvalid;
|
29019 | hooks.duration = createDuration;
|
29020 | hooks.isMoment = isMoment;
|
29021 | hooks.weekdays = listWeekdays;
|
29022 | hooks.parseZone = createInZone;
|
29023 | hooks.localeData = getLocale;
|
29024 | hooks.isDuration = isDuration;
|
29025 | hooks.monthsShort = listMonthsShort;
|
29026 | hooks.weekdaysMin = listWeekdaysMin;
|
29027 | hooks.defineLocale = defineLocale;
|
29028 | hooks.updateLocale = updateLocale;
|
29029 | hooks.locales = listLocales;
|
29030 | hooks.weekdaysShort = listWeekdaysShort;
|
29031 | hooks.normalizeUnits = normalizeUnits;
|
29032 | hooks.relativeTimeRounding = getSetRelativeTimeRounding;
|
29033 | hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
|
29034 | hooks.calendarFormat = getCalendarFormat;
|
29035 | hooks.prototype = proto;
|
29036 |
|
29037 | hooks.HTML5_FMT = {
|
29038 | DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm',
|
29039 |
|
29040 | DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss',
|
29041 |
|
29042 | DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS',
|
29043 |
|
29044 | DATE: 'YYYY-MM-DD',
|
29045 |
|
29046 | TIME: 'HH:mm',
|
29047 |
|
29048 | TIME_SECONDS: 'HH:mm:ss',
|
29049 |
|
29050 | TIME_MS: 'HH:mm:ss.SSS',
|
29051 |
|
29052 | WEEK: 'GGGG-[W]WW',
|
29053 |
|
29054 | MONTH: 'YYYY-MM'
|
29055 |
|
29056 | };
|
29057 | return hooks;
|
29058 | });
|
29059 | });
|
29060 |
|
29061 |
|
29062 |
|
29063 | var moment$2 = typeof window !== 'undefined' && window['moment'] || moment$1;
|
29064 |
|
29065 | var propagating = createCommonjsModule$1(function (module, exports) {
|
29066 |
|
29067 | (function (factory) {
|
29068 | {
|
29069 |
|
29070 |
|
29071 |
|
29072 | module.exports = factory();
|
29073 | }
|
29074 | })(function () {
|
29075 | var _firstTarget = null;
|
29076 |
|
29077 | |
29078 |
|
29079 |
|
29080 |
|
29081 |
|
29082 |
|
29083 |
|
29084 |
|
29085 |
|
29086 |
|
29087 |
|
29088 |
|
29089 |
|
29090 |
|
29091 |
|
29092 |
|
29093 |
|
29094 |
|
29095 |
|
29096 |
|
29097 |
|
29098 |
|
29099 |
|
29100 | return function propagating(hammer, options) {
|
29101 | var _options = options || {
|
29102 | preventDefault: false
|
29103 | };
|
29104 |
|
29105 | if (hammer.Manager) {
|
29106 |
|
29107 |
|
29108 | var Hammer = hammer;
|
29109 |
|
29110 | var PropagatingHammer = function (element, options) {
|
29111 | var o = Object.create(_options);
|
29112 | if (options) Hammer.assign(o, options);
|
29113 | return propagating(new Hammer(element, o), o);
|
29114 | };
|
29115 |
|
29116 | Hammer.assign(PropagatingHammer, Hammer);
|
29117 |
|
29118 | PropagatingHammer.Manager = function (element, options) {
|
29119 | var o = Object.create(_options);
|
29120 | if (options) Hammer.assign(o, options);
|
29121 | return propagating(new Hammer.Manager(element, o), o);
|
29122 | };
|
29123 |
|
29124 | return PropagatingHammer;
|
29125 | }
|
29126 |
|
29127 |
|
29128 |
|
29129 | var wrapper = Object.create(hammer);
|
29130 |
|
29131 | var element = hammer.element;
|
29132 | if (!element.hammer) element.hammer = [];
|
29133 | element.hammer.push(wrapper);
|
29134 |
|
29135 |
|
29136 | hammer.on('hammer.input', function (event) {
|
29137 | if (_options.preventDefault === true || _options.preventDefault === event.pointerType) {
|
29138 | event.preventDefault();
|
29139 | }
|
29140 |
|
29141 | if (event.isFirst) {
|
29142 | _firstTarget = event.target;
|
29143 | }
|
29144 | });
|
29145 |
|
29146 |
|
29147 | wrapper._handlers = {};
|
29148 | |
29149 |
|
29150 |
|
29151 |
|
29152 |
|
29153 |
|
29154 |
|
29155 | wrapper.on = function (events, handler) {
|
29156 |
|
29157 | split(events).forEach(function (event) {
|
29158 | var _handlers = wrapper._handlers[event];
|
29159 |
|
29160 | if (!_handlers) {
|
29161 | wrapper._handlers[event] = _handlers = [];
|
29162 |
|
29163 | hammer.on(event, propagatedHandler);
|
29164 | }
|
29165 |
|
29166 | _handlers.push(handler);
|
29167 | });
|
29168 | return wrapper;
|
29169 | };
|
29170 | |
29171 |
|
29172 |
|
29173 |
|
29174 |
|
29175 |
|
29176 |
|
29177 |
|
29178 |
|
29179 |
|
29180 | wrapper.off = function (events, handler) {
|
29181 |
|
29182 | split(events).forEach(function (event) {
|
29183 | var _handlers = wrapper._handlers[event];
|
29184 |
|
29185 | if (_handlers) {
|
29186 | _handlers = handler ? _handlers.filter(function (h) {
|
29187 | return h !== handler;
|
29188 | }) : [];
|
29189 |
|
29190 | if (_handlers.length > 0) {
|
29191 | wrapper._handlers[event] = _handlers;
|
29192 | } else {
|
29193 |
|
29194 | hammer.off(event, propagatedHandler);
|
29195 | delete wrapper._handlers[event];
|
29196 | }
|
29197 | }
|
29198 | });
|
29199 | return wrapper;
|
29200 | };
|
29201 | |
29202 |
|
29203 |
|
29204 |
|
29205 |
|
29206 |
|
29207 |
|
29208 | wrapper.emit = function (eventType, event) {
|
29209 | _firstTarget = event.target;
|
29210 | hammer.emit(eventType, event);
|
29211 | };
|
29212 |
|
29213 | wrapper.destroy = function () {
|
29214 |
|
29215 | var hammers = hammer.element.hammer;
|
29216 | var idx = hammers.indexOf(wrapper);
|
29217 | if (idx !== -1) hammers.splice(idx, 1);
|
29218 | if (!hammers.length) delete hammer.element.hammer;
|
29219 |
|
29220 | wrapper._handlers = {};
|
29221 |
|
29222 | hammer.destroy();
|
29223 | };
|
29224 |
|
29225 |
|
29226 | function split(events) {
|
29227 | return events.match(/[^ ]+/g);
|
29228 | }
|
29229 | |
29230 |
|
29231 |
|
29232 |
|
29233 |
|
29234 |
|
29235 | function propagatedHandler(event) {
|
29236 |
|
29237 | if (event.type !== 'hammer.input') {
|
29238 |
|
29239 |
|
29240 | if (!event.srcEvent._handled) {
|
29241 | event.srcEvent._handled = {};
|
29242 | }
|
29243 |
|
29244 | if (event.srcEvent._handled[event.type]) {
|
29245 | return;
|
29246 | } else {
|
29247 | event.srcEvent._handled[event.type] = true;
|
29248 | }
|
29249 | }
|
29250 |
|
29251 |
|
29252 | var stopped = false;
|
29253 |
|
29254 | event.stopPropagation = function () {
|
29255 | stopped = true;
|
29256 | };
|
29257 |
|
29258 |
|
29259 | var srcStop = event.srcEvent.stopPropagation.bind(event.srcEvent);
|
29260 |
|
29261 | if (typeof srcStop == "function") {
|
29262 | event.srcEvent.stopPropagation = function () {
|
29263 | srcStop();
|
29264 | event.stopPropagation();
|
29265 | };
|
29266 | }
|
29267 |
|
29268 |
|
29269 | event.firstTarget = _firstTarget;
|
29270 |
|
29271 | var elem = _firstTarget;
|
29272 |
|
29273 | while (elem && !stopped) {
|
29274 | var elemHammer = elem.hammer;
|
29275 |
|
29276 | if (elemHammer) {
|
29277 | var _handlers;
|
29278 |
|
29279 | for (var k = 0; k < elemHammer.length; k++) {
|
29280 | _handlers = elemHammer[k]._handlers[event.type];
|
29281 | if (_handlers) for (var i = 0; i < _handlers.length && !stopped; i++) {
|
29282 | _handlers[i](event);
|
29283 | }
|
29284 | }
|
29285 | }
|
29286 |
|
29287 | elem = elem.parentNode;
|
29288 | }
|
29289 | }
|
29290 |
|
29291 | return wrapper;
|
29292 | };
|
29293 | });
|
29294 | });
|
29295 |
|
29296 | var hammer = createCommonjsModule$1(function (module) {
|
29297 | |
29298 |
|
29299 |
|
29300 |
|
29301 |
|
29302 | (function (window, document, exportName, undefined$1) {
|
29303 |
|
29304 | var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
|
29305 | var TEST_ELEMENT = document.createElement('div');
|
29306 | var TYPE_FUNCTION = 'function';
|
29307 | var round = Math.round;
|
29308 | var abs = Math.abs;
|
29309 | var now = Date.now;
|
29310 | |
29311 |
|
29312 |
|
29313 |
|
29314 |
|
29315 |
|
29316 |
|
29317 |
|
29318 | function setTimeoutContext(fn, timeout, context) {
|
29319 | return setTimeout(bindFn(fn, context), timeout);
|
29320 | }
|
29321 | |
29322 |
|
29323 |
|
29324 |
|
29325 |
|
29326 |
|
29327 |
|
29328 |
|
29329 |
|
29330 |
|
29331 |
|
29332 | function invokeArrayArg(arg, fn, context) {
|
29333 | if (Array.isArray(arg)) {
|
29334 | each(arg, context[fn], context);
|
29335 | return true;
|
29336 | }
|
29337 |
|
29338 | return false;
|
29339 | }
|
29340 | |
29341 |
|
29342 |
|
29343 |
|
29344 |
|
29345 |
|
29346 |
|
29347 |
|
29348 | function each(obj, iterator, context) {
|
29349 | var i;
|
29350 |
|
29351 | if (!obj) {
|
29352 | return;
|
29353 | }
|
29354 |
|
29355 | if (obj.forEach) {
|
29356 | obj.forEach(iterator, context);
|
29357 | } else if (obj.length !== undefined$1) {
|
29358 | i = 0;
|
29359 |
|
29360 | while (i < obj.length) {
|
29361 | iterator.call(context, obj[i], i, obj);
|
29362 | i++;
|
29363 | }
|
29364 | } else {
|
29365 | for (i in obj) {
|
29366 | obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
|
29367 | }
|
29368 | }
|
29369 | }
|
29370 | |
29371 |
|
29372 |
|
29373 |
|
29374 |
|
29375 |
|
29376 |
|
29377 |
|
29378 |
|
29379 | function deprecate(method, name, message) {
|
29380 | var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n';
|
29381 | return function () {
|
29382 | var e = new Error('get-stack-trace');
|
29383 | var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '').replace(/^\s+at\s+/gm, '').replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';
|
29384 | var log = window.console && (window.console.warn || window.console.log);
|
29385 |
|
29386 | if (log) {
|
29387 | log.call(window.console, deprecationMessage, stack);
|
29388 | }
|
29389 |
|
29390 | return method.apply(this, arguments);
|
29391 | };
|
29392 | }
|
29393 | |
29394 |
|
29395 |
|
29396 |
|
29397 |
|
29398 |
|
29399 |
|
29400 |
|
29401 |
|
29402 | var assign;
|
29403 |
|
29404 | if (typeof Object.assign !== 'function') {
|
29405 | assign = function assign(target) {
|
29406 | if (target === undefined$1 || target === null) {
|
29407 | throw new TypeError('Cannot convert undefined or null to object');
|
29408 | }
|
29409 |
|
29410 | var output = Object(target);
|
29411 |
|
29412 | for (var index = 1; index < arguments.length; index++) {
|
29413 | var source = arguments[index];
|
29414 |
|
29415 | if (source !== undefined$1 && source !== null) {
|
29416 | for (var nextKey in source) {
|
29417 | if (source.hasOwnProperty(nextKey)) {
|
29418 | output[nextKey] = source[nextKey];
|
29419 | }
|
29420 | }
|
29421 | }
|
29422 | }
|
29423 |
|
29424 | return output;
|
29425 | };
|
29426 | } else {
|
29427 | assign = Object.assign;
|
29428 | }
|
29429 | |
29430 |
|
29431 |
|
29432 |
|
29433 |
|
29434 |
|
29435 |
|
29436 |
|
29437 |
|
29438 |
|
29439 | var extend = deprecate(function extend(dest, src, merge) {
|
29440 | var keys = Object.keys(src);
|
29441 | var i = 0;
|
29442 |
|
29443 | while (i < keys.length) {
|
29444 | if (!merge || merge && dest[keys[i]] === undefined$1) {
|
29445 | dest[keys[i]] = src[keys[i]];
|
29446 | }
|
29447 |
|
29448 | i++;
|
29449 | }
|
29450 |
|
29451 | return dest;
|
29452 | }, 'extend', 'Use `assign`.');
|
29453 | |
29454 |
|
29455 |
|
29456 |
|
29457 |
|
29458 |
|
29459 |
|
29460 |
|
29461 | var merge = deprecate(function merge(dest, src) {
|
29462 | return extend(dest, src, true);
|
29463 | }, 'merge', 'Use `assign`.');
|
29464 | |
29465 |
|
29466 |
|
29467 |
|
29468 |
|
29469 |
|
29470 |
|
29471 | function inherit(child, base, properties) {
|
29472 | var baseP = base.prototype,
|
29473 | childP;
|
29474 | childP = child.prototype = Object.create(baseP);
|
29475 | childP.constructor = child;
|
29476 | childP._super = baseP;
|
29477 |
|
29478 | if (properties) {
|
29479 | assign(childP, properties);
|
29480 | }
|
29481 | }
|
29482 | |
29483 |
|
29484 |
|
29485 |
|
29486 |
|
29487 |
|
29488 |
|
29489 |
|
29490 | function bindFn(fn, context) {
|
29491 | return function boundFn() {
|
29492 | return fn.apply(context, arguments);
|
29493 | };
|
29494 | }
|
29495 | |
29496 |
|
29497 |
|
29498 |
|
29499 |
|
29500 |
|
29501 |
|
29502 |
|
29503 |
|
29504 | function boolOrFn(val, args) {
|
29505 | if (typeof val == TYPE_FUNCTION) {
|
29506 | return val.apply(args ? args[0] || undefined$1 : undefined$1, args);
|
29507 | }
|
29508 |
|
29509 | return val;
|
29510 | }
|
29511 | |
29512 |
|
29513 |
|
29514 |
|
29515 |
|
29516 |
|
29517 |
|
29518 |
|
29519 | function ifUndefined(val1, val2) {
|
29520 | return val1 === undefined$1 ? val2 : val1;
|
29521 | }
|
29522 | |
29523 |
|
29524 |
|
29525 |
|
29526 |
|
29527 |
|
29528 |
|
29529 |
|
29530 | function addEventListeners(target, types, handler) {
|
29531 | each(splitStr(types), function (type) {
|
29532 | target.addEventListener(type, handler, false);
|
29533 | });
|
29534 | }
|
29535 | |
29536 |
|
29537 |
|
29538 |
|
29539 |
|
29540 |
|
29541 |
|
29542 |
|
29543 | function removeEventListeners(target, types, handler) {
|
29544 | each(splitStr(types), function (type) {
|
29545 | target.removeEventListener(type, handler, false);
|
29546 | });
|
29547 | }
|
29548 | |
29549 |
|
29550 |
|
29551 |
|
29552 |
|
29553 |
|
29554 |
|
29555 |
|
29556 |
|
29557 | function hasParent(node, parent) {
|
29558 | while (node) {
|
29559 | if (node == parent) {
|
29560 | return true;
|
29561 | }
|
29562 |
|
29563 | node = node.parentNode;
|
29564 | }
|
29565 |
|
29566 | return false;
|
29567 | }
|
29568 | |
29569 |
|
29570 |
|
29571 |
|
29572 |
|
29573 |
|
29574 |
|
29575 |
|
29576 | function inStr(str, find) {
|
29577 | return str.indexOf(find) > -1;
|
29578 | }
|
29579 | |
29580 |
|
29581 |
|
29582 |
|
29583 |
|
29584 |
|
29585 |
|
29586 | function splitStr(str) {
|
29587 | return str.trim().split(/\s+/g);
|
29588 | }
|
29589 | |
29590 |
|
29591 |
|
29592 |
|
29593 |
|
29594 |
|
29595 |
|
29596 |
|
29597 |
|
29598 | function inArray(src, find, findByKey) {
|
29599 | if (src.indexOf && !findByKey) {
|
29600 | return src.indexOf(find);
|
29601 | } else {
|
29602 | var i = 0;
|
29603 |
|
29604 | while (i < src.length) {
|
29605 | if (findByKey && src[i][findByKey] == find || !findByKey && src[i] === find) {
|
29606 | return i;
|
29607 | }
|
29608 |
|
29609 | i++;
|
29610 | }
|
29611 |
|
29612 | return -1;
|
29613 | }
|
29614 | }
|
29615 | |
29616 |
|
29617 |
|
29618 |
|
29619 |
|
29620 |
|
29621 |
|
29622 | function toArray(obj) {
|
29623 | return Array.prototype.slice.call(obj, 0);
|
29624 | }
|
29625 | |
29626 |
|
29627 |
|
29628 |
|
29629 |
|
29630 |
|
29631 |
|
29632 |
|
29633 |
|
29634 | function uniqueArray(src, key, sort) {
|
29635 | var results = [];
|
29636 | var values = [];
|
29637 | var i = 0;
|
29638 |
|
29639 | while (i < src.length) {
|
29640 | var val = key ? src[i][key] : src[i];
|
29641 |
|
29642 | if (inArray(values, val) < 0) {
|
29643 | results.push(src[i]);
|
29644 | }
|
29645 |
|
29646 | values[i] = val;
|
29647 | i++;
|
29648 | }
|
29649 |
|
29650 | if (sort) {
|
29651 | if (!key) {
|
29652 | results = results.sort();
|
29653 | } else {
|
29654 | results = results.sort(function sortUniqueArray(a, b) {
|
29655 | return a[key] > b[key];
|
29656 | });
|
29657 | }
|
29658 | }
|
29659 |
|
29660 | return results;
|
29661 | }
|
29662 | |
29663 |
|
29664 |
|
29665 |
|
29666 |
|
29667 |
|
29668 |
|
29669 |
|
29670 | function prefixed(obj, property) {
|
29671 | var prefix, prop;
|
29672 | var camelProp = property[0].toUpperCase() + property.slice(1);
|
29673 | var i = 0;
|
29674 |
|
29675 | while (i < VENDOR_PREFIXES.length) {
|
29676 | prefix = VENDOR_PREFIXES[i];
|
29677 | prop = prefix ? prefix + camelProp : property;
|
29678 |
|
29679 | if (prop in obj) {
|
29680 | return prop;
|
29681 | }
|
29682 |
|
29683 | i++;
|
29684 | }
|
29685 |
|
29686 | return undefined$1;
|
29687 | }
|
29688 | |
29689 |
|
29690 |
|
29691 |
|
29692 |
|
29693 |
|
29694 | var _uniqueId = 1;
|
29695 |
|
29696 | function uniqueId() {
|
29697 | return _uniqueId++;
|
29698 | }
|
29699 | |
29700 |
|
29701 |
|
29702 |
|
29703 |
|
29704 |
|
29705 |
|
29706 | function getWindowForElement(element) {
|
29707 | var doc = element.ownerDocument || element;
|
29708 | return doc.defaultView || doc.parentWindow || window;
|
29709 | }
|
29710 |
|
29711 | var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
|
29712 | var SUPPORT_TOUCH = 'ontouchstart' in window;
|
29713 | var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined$1;
|
29714 | var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
|
29715 | var INPUT_TYPE_TOUCH = 'touch';
|
29716 | var INPUT_TYPE_PEN = 'pen';
|
29717 | var INPUT_TYPE_MOUSE = 'mouse';
|
29718 | var INPUT_TYPE_KINECT = 'kinect';
|
29719 | var COMPUTE_INTERVAL = 25;
|
29720 | var INPUT_START = 1;
|
29721 | var INPUT_MOVE = 2;
|
29722 | var INPUT_END = 4;
|
29723 | var INPUT_CANCEL = 8;
|
29724 | var DIRECTION_NONE = 1;
|
29725 | var DIRECTION_LEFT = 2;
|
29726 | var DIRECTION_RIGHT = 4;
|
29727 | var DIRECTION_UP = 8;
|
29728 | var DIRECTION_DOWN = 16;
|
29729 | var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
|
29730 | var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
|
29731 | var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
|
29732 | var PROPS_XY = ['x', 'y'];
|
29733 | var PROPS_CLIENT_XY = ['clientX', 'clientY'];
|
29734 | |
29735 |
|
29736 |
|
29737 |
|
29738 |
|
29739 |
|
29740 |
|
29741 |
|
29742 | function Input(manager, callback) {
|
29743 | var self = this;
|
29744 | this.manager = manager;
|
29745 | this.callback = callback;
|
29746 | this.element = manager.element;
|
29747 | this.target = manager.options.inputTarget;
|
29748 |
|
29749 |
|
29750 | this.domHandler = function (ev) {
|
29751 | if (boolOrFn(manager.options.enable, [manager])) {
|
29752 | self.handler(ev);
|
29753 | }
|
29754 | };
|
29755 |
|
29756 | this.init();
|
29757 | }
|
29758 |
|
29759 | Input.prototype = {
|
29760 | |
29761 |
|
29762 |
|
29763 |
|
29764 | handler: function () {},
|
29765 |
|
29766 | |
29767 |
|
29768 |
|
29769 | init: function () {
|
29770 | this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
|
29771 | this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
|
29772 | this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
|
29773 | },
|
29774 |
|
29775 | |
29776 |
|
29777 |
|
29778 | destroy: function () {
|
29779 | this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
|
29780 | this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
|
29781 | this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
|
29782 | }
|
29783 | };
|
29784 | |
29785 |
|
29786 |
|
29787 |
|
29788 |
|
29789 |
|
29790 |
|
29791 | function createInputInstance(manager) {
|
29792 | var Type;
|
29793 | var inputClass = manager.options.inputClass;
|
29794 |
|
29795 | if (inputClass) {
|
29796 | Type = inputClass;
|
29797 | } else if (SUPPORT_POINTER_EVENTS) {
|
29798 | Type = PointerEventInput;
|
29799 | } else if (SUPPORT_ONLY_TOUCH) {
|
29800 | Type = TouchInput;
|
29801 | } else if (!SUPPORT_TOUCH) {
|
29802 | Type = MouseInput;
|
29803 | } else {
|
29804 | Type = TouchMouseInput;
|
29805 | }
|
29806 |
|
29807 | return new Type(manager, inputHandler);
|
29808 | }
|
29809 | |
29810 |
|
29811 |
|
29812 |
|
29813 |
|
29814 |
|
29815 |
|
29816 |
|
29817 | function inputHandler(manager, eventType, input) {
|
29818 | var pointersLen = input.pointers.length;
|
29819 | var changedPointersLen = input.changedPointers.length;
|
29820 | var isFirst = eventType & INPUT_START && pointersLen - changedPointersLen === 0;
|
29821 | var isFinal = eventType & (INPUT_END | INPUT_CANCEL) && pointersLen - changedPointersLen === 0;
|
29822 | input.isFirst = !!isFirst;
|
29823 | input.isFinal = !!isFinal;
|
29824 |
|
29825 | if (isFirst) {
|
29826 | manager.session = {};
|
29827 | }
|
29828 |
|
29829 |
|
29830 |
|
29831 | input.eventType = eventType;
|
29832 |
|
29833 | computeInputData(manager, input);
|
29834 |
|
29835 | manager.emit('hammer.input', input);
|
29836 | manager.recognize(input);
|
29837 | manager.session.prevInput = input;
|
29838 | }
|
29839 | |
29840 |
|
29841 |
|
29842 |
|
29843 |
|
29844 |
|
29845 |
|
29846 | function computeInputData(manager, input) {
|
29847 | var session = manager.session;
|
29848 | var pointers = input.pointers;
|
29849 | var pointersLength = pointers.length;
|
29850 |
|
29851 | if (!session.firstInput) {
|
29852 | session.firstInput = simpleCloneInputData(input);
|
29853 | }
|
29854 |
|
29855 |
|
29856 | if (pointersLength > 1 && !session.firstMultiple) {
|
29857 | session.firstMultiple = simpleCloneInputData(input);
|
29858 | } else if (pointersLength === 1) {
|
29859 | session.firstMultiple = false;
|
29860 | }
|
29861 |
|
29862 | var firstInput = session.firstInput;
|
29863 | var firstMultiple = session.firstMultiple;
|
29864 | var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
|
29865 | var center = input.center = getCenter(pointers);
|
29866 | input.timeStamp = now();
|
29867 | input.deltaTime = input.timeStamp - firstInput.timeStamp;
|
29868 | input.angle = getAngle(offsetCenter, center);
|
29869 | input.distance = getDistance(offsetCenter, center);
|
29870 | computeDeltaXY(session, input);
|
29871 | input.offsetDirection = getDirection(input.deltaX, input.deltaY);
|
29872 | var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
|
29873 | input.overallVelocityX = overallVelocity.x;
|
29874 | input.overallVelocityY = overallVelocity.y;
|
29875 | input.overallVelocity = abs(overallVelocity.x) > abs(overallVelocity.y) ? overallVelocity.x : overallVelocity.y;
|
29876 | input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
|
29877 | input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
|
29878 | input.maxPointers = !session.prevInput ? input.pointers.length : input.pointers.length > session.prevInput.maxPointers ? input.pointers.length : session.prevInput.maxPointers;
|
29879 | computeIntervalInputData(session, input);
|
29880 |
|
29881 | var target = manager.element;
|
29882 |
|
29883 | if (hasParent(input.srcEvent.target, target)) {
|
29884 | target = input.srcEvent.target;
|
29885 | }
|
29886 |
|
29887 | input.target = target;
|
29888 | }
|
29889 |
|
29890 | function computeDeltaXY(session, input) {
|
29891 | var center = input.center;
|
29892 | var offset = session.offsetDelta || {};
|
29893 | var prevDelta = session.prevDelta || {};
|
29894 | var prevInput = session.prevInput || {};
|
29895 |
|
29896 | if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
|
29897 | prevDelta = session.prevDelta = {
|
29898 | x: prevInput.deltaX || 0,
|
29899 | y: prevInput.deltaY || 0
|
29900 | };
|
29901 | offset = session.offsetDelta = {
|
29902 | x: center.x,
|
29903 | y: center.y
|
29904 | };
|
29905 | }
|
29906 |
|
29907 | input.deltaX = prevDelta.x + (center.x - offset.x);
|
29908 | input.deltaY = prevDelta.y + (center.y - offset.y);
|
29909 | }
|
29910 | |
29911 |
|
29912 |
|
29913 |
|
29914 |
|
29915 |
|
29916 |
|
29917 | function computeIntervalInputData(session, input) {
|
29918 | var last = session.lastInterval || input,
|
29919 | deltaTime = input.timeStamp - last.timeStamp,
|
29920 | velocity,
|
29921 | velocityX,
|
29922 | velocityY,
|
29923 | direction;
|
29924 |
|
29925 | if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined$1)) {
|
29926 | var deltaX = input.deltaX - last.deltaX;
|
29927 | var deltaY = input.deltaY - last.deltaY;
|
29928 | var v = getVelocity(deltaTime, deltaX, deltaY);
|
29929 | velocityX = v.x;
|
29930 | velocityY = v.y;
|
29931 | velocity = abs(v.x) > abs(v.y) ? v.x : v.y;
|
29932 | direction = getDirection(deltaX, deltaY);
|
29933 | session.lastInterval = input;
|
29934 | } else {
|
29935 |
|
29936 | velocity = last.velocity;
|
29937 | velocityX = last.velocityX;
|
29938 | velocityY = last.velocityY;
|
29939 | direction = last.direction;
|
29940 | }
|
29941 |
|
29942 | input.velocity = velocity;
|
29943 | input.velocityX = velocityX;
|
29944 | input.velocityY = velocityY;
|
29945 | input.direction = direction;
|
29946 | }
|
29947 | |
29948 |
|
29949 |
|
29950 |
|
29951 |
|
29952 |
|
29953 |
|
29954 | function simpleCloneInputData(input) {
|
29955 |
|
29956 |
|
29957 | var pointers = [];
|
29958 | var i = 0;
|
29959 |
|
29960 | while (i < input.pointers.length) {
|
29961 | pointers[i] = {
|
29962 | clientX: round(input.pointers[i].clientX),
|
29963 | clientY: round(input.pointers[i].clientY)
|
29964 | };
|
29965 | i++;
|
29966 | }
|
29967 |
|
29968 | return {
|
29969 | timeStamp: now(),
|
29970 | pointers: pointers,
|
29971 | center: getCenter(pointers),
|
29972 | deltaX: input.deltaX,
|
29973 | deltaY: input.deltaY
|
29974 | };
|
29975 | }
|
29976 | |
29977 |
|
29978 |
|
29979 |
|
29980 |
|
29981 |
|
29982 |
|
29983 | function getCenter(pointers) {
|
29984 | var pointersLength = pointers.length;
|
29985 |
|
29986 | if (pointersLength === 1) {
|
29987 | return {
|
29988 | x: round(pointers[0].clientX),
|
29989 | y: round(pointers[0].clientY)
|
29990 | };
|
29991 | }
|
29992 |
|
29993 | var x = 0,
|
29994 | y = 0,
|
29995 | i = 0;
|
29996 |
|
29997 | while (i < pointersLength) {
|
29998 | x += pointers[i].clientX;
|
29999 | y += pointers[i].clientY;
|
30000 | i++;
|
30001 | }
|
30002 |
|
30003 | return {
|
30004 | x: round(x / pointersLength),
|
30005 | y: round(y / pointersLength)
|
30006 | };
|
30007 | }
|
30008 | |
30009 |
|
30010 |
|
30011 |
|
30012 |
|
30013 |
|
30014 |
|
30015 |
|
30016 |
|
30017 | function getVelocity(deltaTime, x, y) {
|
30018 | return {
|
30019 | x: x / deltaTime || 0,
|
30020 | y: y / deltaTime || 0
|
30021 | };
|
30022 | }
|
30023 | |
30024 |
|
30025 |
|
30026 |
|
30027 |
|
30028 |
|
30029 |
|
30030 |
|
30031 | function getDirection(x, y) {
|
30032 | if (x === y) {
|
30033 | return DIRECTION_NONE;
|
30034 | }
|
30035 |
|
30036 | if (abs(x) >= abs(y)) {
|
30037 | return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
|
30038 | }
|
30039 |
|
30040 | return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
|
30041 | }
|
30042 | |
30043 |
|
30044 |
|
30045 |
|
30046 |
|
30047 |
|
30048 |
|
30049 |
|
30050 |
|
30051 | function getDistance(p1, p2, props) {
|
30052 | if (!props) {
|
30053 | props = PROPS_XY;
|
30054 | }
|
30055 |
|
30056 | var x = p2[props[0]] - p1[props[0]],
|
30057 | y = p2[props[1]] - p1[props[1]];
|
30058 | return Math.sqrt(x * x + y * y);
|
30059 | }
|
30060 | |
30061 |
|
30062 |
|
30063 |
|
30064 |
|
30065 |
|
30066 |
|
30067 |
|
30068 |
|
30069 | function getAngle(p1, p2, props) {
|
30070 | if (!props) {
|
30071 | props = PROPS_XY;
|
30072 | }
|
30073 |
|
30074 | var x = p2[props[0]] - p1[props[0]],
|
30075 | y = p2[props[1]] - p1[props[1]];
|
30076 | return Math.atan2(y, x) * 180 / Math.PI;
|
30077 | }
|
30078 | |
30079 |
|
30080 |
|
30081 |
|
30082 |
|
30083 |
|
30084 |
|
30085 |
|
30086 | function getRotation(start, end) {
|
30087 | return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
|
30088 | }
|
30089 | |
30090 |
|
30091 |
|
30092 |
|
30093 |
|
30094 |
|
30095 |
|
30096 |
|
30097 |
|
30098 | function getScale(start, end) {
|
30099 | return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
|
30100 | }
|
30101 |
|
30102 | var MOUSE_INPUT_MAP = {
|
30103 | mousedown: INPUT_START,
|
30104 | mousemove: INPUT_MOVE,
|
30105 | mouseup: INPUT_END
|
30106 | };
|
30107 | var MOUSE_ELEMENT_EVENTS = 'mousedown';
|
30108 | var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
|
30109 | |
30110 |
|
30111 |
|
30112 |
|
30113 |
|
30114 |
|
30115 | function MouseInput() {
|
30116 | this.evEl = MOUSE_ELEMENT_EVENTS;
|
30117 | this.evWin = MOUSE_WINDOW_EVENTS;
|
30118 | this.pressed = false;
|
30119 |
|
30120 | Input.apply(this, arguments);
|
30121 | }
|
30122 |
|
30123 | inherit(MouseInput, Input, {
|
30124 | |
30125 |
|
30126 |
|
30127 |
|
30128 | handler: function MEhandler(ev) {
|
30129 | var eventType = MOUSE_INPUT_MAP[ev.type];
|
30130 |
|
30131 | if (eventType & INPUT_START && ev.button === 0) {
|
30132 | this.pressed = true;
|
30133 | }
|
30134 |
|
30135 | if (eventType & INPUT_MOVE && ev.which !== 1) {
|
30136 | eventType = INPUT_END;
|
30137 | }
|
30138 |
|
30139 |
|
30140 | if (!this.pressed) {
|
30141 | return;
|
30142 | }
|
30143 |
|
30144 | if (eventType & INPUT_END) {
|
30145 | this.pressed = false;
|
30146 | }
|
30147 |
|
30148 | this.callback(this.manager, eventType, {
|
30149 | pointers: [ev],
|
30150 | changedPointers: [ev],
|
30151 | pointerType: INPUT_TYPE_MOUSE,
|
30152 | srcEvent: ev
|
30153 | });
|
30154 | }
|
30155 | });
|
30156 | var POINTER_INPUT_MAP = {
|
30157 | pointerdown: INPUT_START,
|
30158 | pointermove: INPUT_MOVE,
|
30159 | pointerup: INPUT_END,
|
30160 | pointercancel: INPUT_CANCEL,
|
30161 | pointerout: INPUT_CANCEL
|
30162 | };
|
30163 |
|
30164 | var IE10_POINTER_TYPE_ENUM = {
|
30165 | 2: INPUT_TYPE_TOUCH,
|
30166 | 3: INPUT_TYPE_PEN,
|
30167 | 4: INPUT_TYPE_MOUSE,
|
30168 | 5: INPUT_TYPE_KINECT
|
30169 |
|
30170 | };
|
30171 | var POINTER_ELEMENT_EVENTS = 'pointerdown';
|
30172 | var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
|
30173 |
|
30174 | if (window.MSPointerEvent && !window.PointerEvent) {
|
30175 | POINTER_ELEMENT_EVENTS = 'MSPointerDown';
|
30176 | POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
|
30177 | }
|
30178 | |
30179 |
|
30180 |
|
30181 |
|
30182 |
|
30183 |
|
30184 |
|
30185 | function PointerEventInput() {
|
30186 | this.evEl = POINTER_ELEMENT_EVENTS;
|
30187 | this.evWin = POINTER_WINDOW_EVENTS;
|
30188 | Input.apply(this, arguments);
|
30189 | this.store = this.manager.session.pointerEvents = [];
|
30190 | }
|
30191 |
|
30192 | inherit(PointerEventInput, Input, {
|
30193 | |
30194 |
|
30195 |
|
30196 |
|
30197 | handler: function PEhandler(ev) {
|
30198 | var store = this.store;
|
30199 | var removePointer = false;
|
30200 | var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
|
30201 | var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
|
30202 | var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
|
30203 | var isTouch = pointerType == INPUT_TYPE_TOUCH;
|
30204 |
|
30205 | var storeIndex = inArray(store, ev.pointerId, 'pointerId');
|
30206 |
|
30207 | if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
|
30208 | if (storeIndex < 0) {
|
30209 | store.push(ev);
|
30210 | storeIndex = store.length - 1;
|
30211 | }
|
30212 | } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
|
30213 | removePointer = true;
|
30214 | }
|
30215 |
|
30216 |
|
30217 | if (storeIndex < 0) {
|
30218 | return;
|
30219 | }
|
30220 |
|
30221 |
|
30222 | store[storeIndex] = ev;
|
30223 | this.callback(this.manager, eventType, {
|
30224 | pointers: store,
|
30225 | changedPointers: [ev],
|
30226 | pointerType: pointerType,
|
30227 | srcEvent: ev
|
30228 | });
|
30229 |
|
30230 | if (removePointer) {
|
30231 |
|
30232 | store.splice(storeIndex, 1);
|
30233 | }
|
30234 | }
|
30235 | });
|
30236 | var SINGLE_TOUCH_INPUT_MAP = {
|
30237 | touchstart: INPUT_START,
|
30238 | touchmove: INPUT_MOVE,
|
30239 | touchend: INPUT_END,
|
30240 | touchcancel: INPUT_CANCEL
|
30241 | };
|
30242 | var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
|
30243 | var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
|
30244 | |
30245 |
|
30246 |
|
30247 |
|
30248 |
|
30249 |
|
30250 | function SingleTouchInput() {
|
30251 | this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
|
30252 | this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
|
30253 | this.started = false;
|
30254 | Input.apply(this, arguments);
|
30255 | }
|
30256 |
|
30257 | inherit(SingleTouchInput, Input, {
|
30258 | handler: function TEhandler(ev) {
|
30259 | var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
|
30260 |
|
30261 | if (type === INPUT_START) {
|
30262 | this.started = true;
|
30263 | }
|
30264 |
|
30265 | if (!this.started) {
|
30266 | return;
|
30267 | }
|
30268 |
|
30269 | var touches = normalizeSingleTouches.call(this, ev, type);
|
30270 |
|
30271 | if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
|
30272 | this.started = false;
|
30273 | }
|
30274 |
|
30275 | this.callback(this.manager, type, {
|
30276 | pointers: touches[0],
|
30277 | changedPointers: touches[1],
|
30278 | pointerType: INPUT_TYPE_TOUCH,
|
30279 | srcEvent: ev
|
30280 | });
|
30281 | }
|
30282 | });
|
30283 | |
30284 |
|
30285 |
|
30286 |
|
30287 |
|
30288 |
|
30289 |
|
30290 | function normalizeSingleTouches(ev, type) {
|
30291 | var all = toArray(ev.touches);
|
30292 | var changed = toArray(ev.changedTouches);
|
30293 |
|
30294 | if (type & (INPUT_END | INPUT_CANCEL)) {
|
30295 | all = uniqueArray(all.concat(changed), 'identifier', true);
|
30296 | }
|
30297 |
|
30298 | return [all, changed];
|
30299 | }
|
30300 |
|
30301 | var TOUCH_INPUT_MAP = {
|
30302 | touchstart: INPUT_START,
|
30303 | touchmove: INPUT_MOVE,
|
30304 | touchend: INPUT_END,
|
30305 | touchcancel: INPUT_CANCEL
|
30306 | };
|
30307 | var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
|
30308 | |
30309 |
|
30310 |
|
30311 |
|
30312 |
|
30313 |
|
30314 | function TouchInput() {
|
30315 | this.evTarget = TOUCH_TARGET_EVENTS;
|
30316 | this.targetIds = {};
|
30317 | Input.apply(this, arguments);
|
30318 | }
|
30319 |
|
30320 | inherit(TouchInput, Input, {
|
30321 | handler: function MTEhandler(ev) {
|
30322 | var type = TOUCH_INPUT_MAP[ev.type];
|
30323 | var touches = getTouches.call(this, ev, type);
|
30324 |
|
30325 | if (!touches) {
|
30326 | return;
|
30327 | }
|
30328 |
|
30329 | this.callback(this.manager, type, {
|
30330 | pointers: touches[0],
|
30331 | changedPointers: touches[1],
|
30332 | pointerType: INPUT_TYPE_TOUCH,
|
30333 | srcEvent: ev
|
30334 | });
|
30335 | }
|
30336 | });
|
30337 | |
30338 |
|
30339 |
|
30340 |
|
30341 |
|
30342 |
|
30343 |
|
30344 | function getTouches(ev, type) {
|
30345 | var allTouches = toArray(ev.touches);
|
30346 | var targetIds = this.targetIds;
|
30347 |
|
30348 | if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
|
30349 | targetIds[allTouches[0].identifier] = true;
|
30350 | return [allTouches, allTouches];
|
30351 | }
|
30352 |
|
30353 | var i,
|
30354 | targetTouches,
|
30355 | changedTouches = toArray(ev.changedTouches),
|
30356 | changedTargetTouches = [],
|
30357 | target = this.target;
|
30358 |
|
30359 | targetTouches = allTouches.filter(function (touch) {
|
30360 | return hasParent(touch.target, target);
|
30361 | });
|
30362 |
|
30363 | if (type === INPUT_START) {
|
30364 | i = 0;
|
30365 |
|
30366 | while (i < targetTouches.length) {
|
30367 | targetIds[targetTouches[i].identifier] = true;
|
30368 | i++;
|
30369 | }
|
30370 | }
|
30371 |
|
30372 |
|
30373 | i = 0;
|
30374 |
|
30375 | while (i < changedTouches.length) {
|
30376 | if (targetIds[changedTouches[i].identifier]) {
|
30377 | changedTargetTouches.push(changedTouches[i]);
|
30378 | }
|
30379 |
|
30380 |
|
30381 | if (type & (INPUT_END | INPUT_CANCEL)) {
|
30382 | delete targetIds[changedTouches[i].identifier];
|
30383 | }
|
30384 |
|
30385 | i++;
|
30386 | }
|
30387 |
|
30388 | if (!changedTargetTouches.length) {
|
30389 | return;
|
30390 | }
|
30391 |
|
30392 | return [
|
30393 | uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true), changedTargetTouches];
|
30394 | }
|
30395 | |
30396 |
|
30397 |
|
30398 |
|
30399 |
|
30400 |
|
30401 |
|
30402 |
|
30403 |
|
30404 |
|
30405 |
|
30406 | var DEDUP_TIMEOUT = 2500;
|
30407 | var DEDUP_DISTANCE = 25;
|
30408 |
|
30409 | function TouchMouseInput() {
|
30410 | Input.apply(this, arguments);
|
30411 | var handler = bindFn(this.handler, this);
|
30412 | this.touch = new TouchInput(this.manager, handler);
|
30413 | this.mouse = new MouseInput(this.manager, handler);
|
30414 | this.primaryTouch = null;
|
30415 | this.lastTouches = [];
|
30416 | }
|
30417 |
|
30418 | inherit(TouchMouseInput, Input, {
|
30419 | |
30420 |
|
30421 |
|
30422 |
|
30423 |
|
30424 |
|
30425 | handler: function TMEhandler(manager, inputEvent, inputData) {
|
30426 | var isTouch = inputData.pointerType == INPUT_TYPE_TOUCH,
|
30427 | isMouse = inputData.pointerType == INPUT_TYPE_MOUSE;
|
30428 |
|
30429 | if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
|
30430 | return;
|
30431 | }
|
30432 |
|
30433 |
|
30434 | if (isTouch) {
|
30435 | recordTouches.call(this, inputEvent, inputData);
|
30436 | } else if (isMouse && isSyntheticEvent.call(this, inputData)) {
|
30437 | return;
|
30438 | }
|
30439 |
|
30440 | this.callback(manager, inputEvent, inputData);
|
30441 | },
|
30442 |
|
30443 | |
30444 |
|
30445 |
|
30446 | destroy: function destroy() {
|
30447 | this.touch.destroy();
|
30448 | this.mouse.destroy();
|
30449 | }
|
30450 | });
|
30451 |
|
30452 | function recordTouches(eventType, eventData) {
|
30453 | if (eventType & INPUT_START) {
|
30454 | this.primaryTouch = eventData.changedPointers[0].identifier;
|
30455 | setLastTouch.call(this, eventData);
|
30456 | } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
|
30457 | setLastTouch.call(this, eventData);
|
30458 | }
|
30459 | }
|
30460 |
|
30461 | function setLastTouch(eventData) {
|
30462 | var touch = eventData.changedPointers[0];
|
30463 |
|
30464 | if (touch.identifier === this.primaryTouch) {
|
30465 | var lastTouch = {
|
30466 | x: touch.clientX,
|
30467 | y: touch.clientY
|
30468 | };
|
30469 | this.lastTouches.push(lastTouch);
|
30470 | var lts = this.lastTouches;
|
30471 |
|
30472 | var removeLastTouch = function () {
|
30473 | var i = lts.indexOf(lastTouch);
|
30474 |
|
30475 | if (i > -1) {
|
30476 | lts.splice(i, 1);
|
30477 | }
|
30478 | };
|
30479 |
|
30480 | setTimeout(removeLastTouch, DEDUP_TIMEOUT);
|
30481 | }
|
30482 | }
|
30483 |
|
30484 | function isSyntheticEvent(eventData) {
|
30485 | var x = eventData.srcEvent.clientX,
|
30486 | y = eventData.srcEvent.clientY;
|
30487 |
|
30488 | for (var i = 0; i < this.lastTouches.length; i++) {
|
30489 | var t = this.lastTouches[i];
|
30490 | var dx = Math.abs(x - t.x),
|
30491 | dy = Math.abs(y - t.y);
|
30492 |
|
30493 | if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
|
30494 | return true;
|
30495 | }
|
30496 | }
|
30497 |
|
30498 | return false;
|
30499 | }
|
30500 |
|
30501 | var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
|
30502 | var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined$1;
|
30503 |
|
30504 | var TOUCH_ACTION_COMPUTE = 'compute';
|
30505 | var TOUCH_ACTION_AUTO = 'auto';
|
30506 | var TOUCH_ACTION_MANIPULATION = 'manipulation';
|
30507 |
|
30508 | var TOUCH_ACTION_NONE = 'none';
|
30509 | var TOUCH_ACTION_PAN_X = 'pan-x';
|
30510 | var TOUCH_ACTION_PAN_Y = 'pan-y';
|
30511 | var TOUCH_ACTION_MAP = getTouchActionProps();
|
30512 | |
30513 |
|
30514 |
|
30515 |
|
30516 |
|
30517 |
|
30518 |
|
30519 |
|
30520 | function TouchAction(manager, value) {
|
30521 | this.manager = manager;
|
30522 | this.set(value);
|
30523 | }
|
30524 |
|
30525 | TouchAction.prototype = {
|
30526 | |
30527 |
|
30528 |
|
30529 |
|
30530 | set: function (value) {
|
30531 |
|
30532 | if (value == TOUCH_ACTION_COMPUTE) {
|
30533 | value = this.compute();
|
30534 | }
|
30535 |
|
30536 | if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {
|
30537 | this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
|
30538 | }
|
30539 |
|
30540 | this.actions = value.toLowerCase().trim();
|
30541 | },
|
30542 |
|
30543 | |
30544 |
|
30545 |
|
30546 | update: function () {
|
30547 | this.set(this.manager.options.touchAction);
|
30548 | },
|
30549 |
|
30550 | |
30551 |
|
30552 |
|
30553 |
|
30554 | compute: function () {
|
30555 | var actions = [];
|
30556 | each(this.manager.recognizers, function (recognizer) {
|
30557 | if (boolOrFn(recognizer.options.enable, [recognizer])) {
|
30558 | actions = actions.concat(recognizer.getTouchAction());
|
30559 | }
|
30560 | });
|
30561 | return cleanTouchActions(actions.join(' '));
|
30562 | },
|
30563 |
|
30564 | |
30565 |
|
30566 |
|
30567 |
|
30568 | preventDefaults: function (input) {
|
30569 | var srcEvent = input.srcEvent;
|
30570 | var direction = input.offsetDirection;
|
30571 |
|
30572 | if (this.manager.session.prevented) {
|
30573 | srcEvent.preventDefault();
|
30574 | return;
|
30575 | }
|
30576 |
|
30577 | var actions = this.actions;
|
30578 | var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
|
30579 | var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
|
30580 | var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];
|
30581 |
|
30582 | if (hasNone) {
|
30583 |
|
30584 | var isTapPointer = input.pointers.length === 1;
|
30585 | var isTapMovement = input.distance < 2;
|
30586 | var isTapTouchTime = input.deltaTime < 250;
|
30587 |
|
30588 | if (isTapPointer && isTapMovement && isTapTouchTime) {
|
30589 | return;
|
30590 | }
|
30591 | }
|
30592 |
|
30593 | if (hasPanX && hasPanY) {
|
30594 |
|
30595 | return;
|
30596 | }
|
30597 |
|
30598 | if (hasNone || hasPanY && direction & DIRECTION_HORIZONTAL || hasPanX && direction & DIRECTION_VERTICAL) {
|
30599 | return this.preventSrc(srcEvent);
|
30600 | }
|
30601 | },
|
30602 |
|
30603 | |
30604 |
|
30605 |
|
30606 |
|
30607 | preventSrc: function (srcEvent) {
|
30608 | this.manager.session.prevented = true;
|
30609 | srcEvent.preventDefault();
|
30610 | }
|
30611 | };
|
30612 | |
30613 |
|
30614 |
|
30615 |
|
30616 |
|
30617 |
|
30618 | function cleanTouchActions(actions) {
|
30619 |
|
30620 | if (inStr(actions, TOUCH_ACTION_NONE)) {
|
30621 | return TOUCH_ACTION_NONE;
|
30622 | }
|
30623 |
|
30624 | var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
|
30625 | var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
|
30626 |
|
30627 |
|
30628 |
|
30629 |
|
30630 | if (hasPanX && hasPanY) {
|
30631 | return TOUCH_ACTION_NONE;
|
30632 | }
|
30633 |
|
30634 |
|
30635 | if (hasPanX || hasPanY) {
|
30636 | return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
|
30637 | }
|
30638 |
|
30639 |
|
30640 | if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
|
30641 | return TOUCH_ACTION_MANIPULATION;
|
30642 | }
|
30643 |
|
30644 | return TOUCH_ACTION_AUTO;
|
30645 | }
|
30646 |
|
30647 | function getTouchActionProps() {
|
30648 | if (!NATIVE_TOUCH_ACTION) {
|
30649 | return false;
|
30650 | }
|
30651 |
|
30652 | var touchMap = {};
|
30653 | var cssSupports = window.CSS && window.CSS.supports;
|
30654 | ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function (val) {
|
30655 |
|
30656 |
|
30657 | touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;
|
30658 | });
|
30659 | return touchMap;
|
30660 | }
|
30661 | |
30662 |
|
30663 |
|
30664 |
|
30665 |
|
30666 |
|
30667 |
|
30668 |
|
30669 |
|
30670 |
|
30671 |
|
30672 |
|
30673 |
|
30674 |
|
30675 |
|
30676 |
|
30677 |
|
30678 |
|
30679 |
|
30680 |
|
30681 |
|
30682 |
|
30683 |
|
30684 |
|
30685 |
|
30686 |
|
30687 |
|
30688 |
|
30689 |
|
30690 | var STATE_POSSIBLE = 1;
|
30691 | var STATE_BEGAN = 2;
|
30692 | var STATE_CHANGED = 4;
|
30693 | var STATE_ENDED = 8;
|
30694 | var STATE_RECOGNIZED = STATE_ENDED;
|
30695 | var STATE_CANCELLED = 16;
|
30696 | var STATE_FAILED = 32;
|
30697 | |
30698 |
|
30699 |
|
30700 |
|
30701 |
|
30702 |
|
30703 |
|
30704 | function Recognizer(options) {
|
30705 | this.options = assign({}, this.defaults, options || {});
|
30706 | this.id = uniqueId();
|
30707 | this.manager = null;
|
30708 |
|
30709 | this.options.enable = ifUndefined(this.options.enable, true);
|
30710 | this.state = STATE_POSSIBLE;
|
30711 | this.simultaneous = {};
|
30712 | this.requireFail = [];
|
30713 | }
|
30714 |
|
30715 | Recognizer.prototype = {
|
30716 | |
30717 |
|
30718 |
|
30719 |
|
30720 | defaults: {},
|
30721 |
|
30722 | |
30723 |
|
30724 |
|
30725 |
|
30726 |
|
30727 | set: function (options) {
|
30728 | assign(this.options, options);
|
30729 |
|
30730 | this.manager && this.manager.touchAction.update();
|
30731 | return this;
|
30732 | },
|
30733 |
|
30734 | |
30735 |
|
30736 |
|
30737 |
|
30738 |
|
30739 | recognizeWith: function (otherRecognizer) {
|
30740 | if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
|
30741 | return this;
|
30742 | }
|
30743 |
|
30744 | var simultaneous = this.simultaneous;
|
30745 | otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
30746 |
|
30747 | if (!simultaneous[otherRecognizer.id]) {
|
30748 | simultaneous[otherRecognizer.id] = otherRecognizer;
|
30749 | otherRecognizer.recognizeWith(this);
|
30750 | }
|
30751 |
|
30752 | return this;
|
30753 | },
|
30754 |
|
30755 | |
30756 |
|
30757 |
|
30758 |
|
30759 |
|
30760 | dropRecognizeWith: function (otherRecognizer) {
|
30761 | if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
|
30762 | return this;
|
30763 | }
|
30764 |
|
30765 | otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
30766 | delete this.simultaneous[otherRecognizer.id];
|
30767 | return this;
|
30768 | },
|
30769 |
|
30770 | |
30771 |
|
30772 |
|
30773 |
|
30774 |
|
30775 | requireFailure: function (otherRecognizer) {
|
30776 | if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
|
30777 | return this;
|
30778 | }
|
30779 |
|
30780 | var requireFail = this.requireFail;
|
30781 | otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
30782 |
|
30783 | if (inArray(requireFail, otherRecognizer) === -1) {
|
30784 | requireFail.push(otherRecognizer);
|
30785 | otherRecognizer.requireFailure(this);
|
30786 | }
|
30787 |
|
30788 | return this;
|
30789 | },
|
30790 |
|
30791 | |
30792 |
|
30793 |
|
30794 |
|
30795 |
|
30796 | dropRequireFailure: function (otherRecognizer) {
|
30797 | if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
|
30798 | return this;
|
30799 | }
|
30800 |
|
30801 | otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
30802 | var index = inArray(this.requireFail, otherRecognizer);
|
30803 |
|
30804 | if (index > -1) {
|
30805 | this.requireFail.splice(index, 1);
|
30806 | }
|
30807 |
|
30808 | return this;
|
30809 | },
|
30810 |
|
30811 | |
30812 |
|
30813 |
|
30814 |
|
30815 | hasRequireFailures: function () {
|
30816 | return this.requireFail.length > 0;
|
30817 | },
|
30818 |
|
30819 | |
30820 |
|
30821 |
|
30822 |
|
30823 |
|
30824 | canRecognizeWith: function (otherRecognizer) {
|
30825 | return !!this.simultaneous[otherRecognizer.id];
|
30826 | },
|
30827 |
|
30828 | |
30829 |
|
30830 |
|
30831 |
|
30832 |
|
30833 | emit: function (input) {
|
30834 | var self = this;
|
30835 | var state = this.state;
|
30836 |
|
30837 | function emit(event) {
|
30838 | self.manager.emit(event, input);
|
30839 | }
|
30840 |
|
30841 |
|
30842 | if (state < STATE_ENDED) {
|
30843 | emit(self.options.event + stateStr(state));
|
30844 | }
|
30845 |
|
30846 | emit(self.options.event);
|
30847 |
|
30848 | if (input.additionalEvent) {
|
30849 |
|
30850 | emit(input.additionalEvent);
|
30851 | }
|
30852 |
|
30853 |
|
30854 | if (state >= STATE_ENDED) {
|
30855 | emit(self.options.event + stateStr(state));
|
30856 | }
|
30857 | },
|
30858 |
|
30859 | |
30860 |
|
30861 |
|
30862 |
|
30863 |
|
30864 |
|
30865 | tryEmit: function (input) {
|
30866 | if (this.canEmit()) {
|
30867 | return this.emit(input);
|
30868 | }
|
30869 |
|
30870 |
|
30871 | this.state = STATE_FAILED;
|
30872 | },
|
30873 |
|
30874 | |
30875 |
|
30876 |
|
30877 |
|
30878 | canEmit: function () {
|
30879 | var i = 0;
|
30880 |
|
30881 | while (i < this.requireFail.length) {
|
30882 | if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
|
30883 | return false;
|
30884 | }
|
30885 |
|
30886 | i++;
|
30887 | }
|
30888 |
|
30889 | return true;
|
30890 | },
|
30891 |
|
30892 | |
30893 |
|
30894 |
|
30895 |
|
30896 | recognize: function (inputData) {
|
30897 |
|
30898 |
|
30899 | var inputDataClone = assign({}, inputData);
|
30900 |
|
30901 | if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
|
30902 | this.reset();
|
30903 | this.state = STATE_FAILED;
|
30904 | return;
|
30905 | }
|
30906 |
|
30907 |
|
30908 | if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
|
30909 | this.state = STATE_POSSIBLE;
|
30910 | }
|
30911 |
|
30912 | this.state = this.process(inputDataClone);
|
30913 |
|
30914 |
|
30915 | if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
|
30916 | this.tryEmit(inputDataClone);
|
30917 | }
|
30918 | },
|
30919 |
|
30920 | |
30921 |
|
30922 |
|
30923 |
|
30924 |
|
30925 |
|
30926 |
|
30927 | process: function (inputData) {},
|
30928 |
|
30929 |
|
30930 | |
30931 |
|
30932 |
|
30933 |
|
30934 |
|
30935 | getTouchAction: function () {},
|
30936 |
|
30937 | |
30938 |
|
30939 |
|
30940 |
|
30941 |
|
30942 | reset: function () {}
|
30943 | };
|
30944 | |
30945 |
|
30946 |
|
30947 |
|
30948 |
|
30949 |
|
30950 | function stateStr(state) {
|
30951 | if (state & STATE_CANCELLED) {
|
30952 | return 'cancel';
|
30953 | } else if (state & STATE_ENDED) {
|
30954 | return 'end';
|
30955 | } else if (state & STATE_CHANGED) {
|
30956 | return 'move';
|
30957 | } else if (state & STATE_BEGAN) {
|
30958 | return 'start';
|
30959 | }
|
30960 |
|
30961 | return '';
|
30962 | }
|
30963 | |
30964 |
|
30965 |
|
30966 |
|
30967 |
|
30968 |
|
30969 |
|
30970 | function directionStr(direction) {
|
30971 | if (direction == DIRECTION_DOWN) {
|
30972 | return 'down';
|
30973 | } else if (direction == DIRECTION_UP) {
|
30974 | return 'up';
|
30975 | } else if (direction == DIRECTION_LEFT) {
|
30976 | return 'left';
|
30977 | } else if (direction == DIRECTION_RIGHT) {
|
30978 | return 'right';
|
30979 | }
|
30980 |
|
30981 | return '';
|
30982 | }
|
30983 | |
30984 |
|
30985 |
|
30986 |
|
30987 |
|
30988 |
|
30989 |
|
30990 |
|
30991 | function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
|
30992 | var manager = recognizer.manager;
|
30993 |
|
30994 | if (manager) {
|
30995 | return manager.get(otherRecognizer);
|
30996 | }
|
30997 |
|
30998 | return otherRecognizer;
|
30999 | }
|
31000 | |
31001 |
|
31002 |
|
31003 |
|
31004 |
|
31005 |
|
31006 |
|
31007 | function AttrRecognizer() {
|
31008 | Recognizer.apply(this, arguments);
|
31009 | }
|
31010 |
|
31011 | inherit(AttrRecognizer, Recognizer, {
|
31012 | |
31013 |
|
31014 |
|
31015 |
|
31016 | defaults: {
|
31017 | |
31018 |
|
31019 |
|
31020 |
|
31021 | pointers: 1
|
31022 | },
|
31023 |
|
31024 | |
31025 |
|
31026 |
|
31027 |
|
31028 |
|
31029 |
|
31030 | attrTest: function (input) {
|
31031 | var optionPointers = this.options.pointers;
|
31032 | return optionPointers === 0 || input.pointers.length === optionPointers;
|
31033 | },
|
31034 |
|
31035 | |
31036 |
|
31037 |
|
31038 |
|
31039 |
|
31040 |
|
31041 | process: function (input) {
|
31042 | var state = this.state;
|
31043 | var eventType = input.eventType;
|
31044 | var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
|
31045 | var isValid = this.attrTest(input);
|
31046 |
|
31047 | if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
|
31048 | return state | STATE_CANCELLED;
|
31049 | } else if (isRecognized || isValid) {
|
31050 | if (eventType & INPUT_END) {
|
31051 | return state | STATE_ENDED;
|
31052 | } else if (!(state & STATE_BEGAN)) {
|
31053 | return STATE_BEGAN;
|
31054 | }
|
31055 |
|
31056 | return state | STATE_CHANGED;
|
31057 | }
|
31058 |
|
31059 | return STATE_FAILED;
|
31060 | }
|
31061 | });
|
31062 | |
31063 |
|
31064 |
|
31065 |
|
31066 |
|
31067 |
|
31068 |
|
31069 | function PanRecognizer() {
|
31070 | AttrRecognizer.apply(this, arguments);
|
31071 | this.pX = null;
|
31072 | this.pY = null;
|
31073 | }
|
31074 |
|
31075 | inherit(PanRecognizer, AttrRecognizer, {
|
31076 | |
31077 |
|
31078 |
|
31079 |
|
31080 | defaults: {
|
31081 | event: 'pan',
|
31082 | threshold: 10,
|
31083 | pointers: 1,
|
31084 | direction: DIRECTION_ALL
|
31085 | },
|
31086 | getTouchAction: function () {
|
31087 | var direction = this.options.direction;
|
31088 | var actions = [];
|
31089 |
|
31090 | if (direction & DIRECTION_HORIZONTAL) {
|
31091 | actions.push(TOUCH_ACTION_PAN_Y);
|
31092 | }
|
31093 |
|
31094 | if (direction & DIRECTION_VERTICAL) {
|
31095 | actions.push(TOUCH_ACTION_PAN_X);
|
31096 | }
|
31097 |
|
31098 | return actions;
|
31099 | },
|
31100 | directionTest: function (input) {
|
31101 | var options = this.options;
|
31102 | var hasMoved = true;
|
31103 | var distance = input.distance;
|
31104 | var direction = input.direction;
|
31105 | var x = input.deltaX;
|
31106 | var y = input.deltaY;
|
31107 |
|
31108 | if (!(direction & options.direction)) {
|
31109 | if (options.direction & DIRECTION_HORIZONTAL) {
|
31110 | direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
|
31111 | hasMoved = x != this.pX;
|
31112 | distance = Math.abs(input.deltaX);
|
31113 | } else {
|
31114 | direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
|
31115 | hasMoved = y != this.pY;
|
31116 | distance = Math.abs(input.deltaY);
|
31117 | }
|
31118 | }
|
31119 |
|
31120 | input.direction = direction;
|
31121 | return hasMoved && distance > options.threshold && direction & options.direction;
|
31122 | },
|
31123 | attrTest: function (input) {
|
31124 | return AttrRecognizer.prototype.attrTest.call(this, input) && (this.state & STATE_BEGAN || !(this.state & STATE_BEGAN) && this.directionTest(input));
|
31125 | },
|
31126 | emit: function (input) {
|
31127 | this.pX = input.deltaX;
|
31128 | this.pY = input.deltaY;
|
31129 | var direction = directionStr(input.direction);
|
31130 |
|
31131 | if (direction) {
|
31132 | input.additionalEvent = this.options.event + direction;
|
31133 | }
|
31134 |
|
31135 | this._super.emit.call(this, input);
|
31136 | }
|
31137 | });
|
31138 | |
31139 |
|
31140 |
|
31141 |
|
31142 |
|
31143 |
|
31144 |
|
31145 | function PinchRecognizer() {
|
31146 | AttrRecognizer.apply(this, arguments);
|
31147 | }
|
31148 |
|
31149 | inherit(PinchRecognizer, AttrRecognizer, {
|
31150 | |
31151 |
|
31152 |
|
31153 |
|
31154 | defaults: {
|
31155 | event: 'pinch',
|
31156 | threshold: 0,
|
31157 | pointers: 2
|
31158 | },
|
31159 | getTouchAction: function () {
|
31160 | return [TOUCH_ACTION_NONE];
|
31161 | },
|
31162 | attrTest: function (input) {
|
31163 | return this._super.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
|
31164 | },
|
31165 | emit: function (input) {
|
31166 | if (input.scale !== 1) {
|
31167 | var inOut = input.scale < 1 ? 'in' : 'out';
|
31168 | input.additionalEvent = this.options.event + inOut;
|
31169 | }
|
31170 |
|
31171 | this._super.emit.call(this, input);
|
31172 | }
|
31173 | });
|
31174 | |
31175 |
|
31176 |
|
31177 |
|
31178 |
|
31179 |
|
31180 |
|
31181 | function PressRecognizer() {
|
31182 | Recognizer.apply(this, arguments);
|
31183 | this._timer = null;
|
31184 | this._input = null;
|
31185 | }
|
31186 |
|
31187 | inherit(PressRecognizer, Recognizer, {
|
31188 | |
31189 |
|
31190 |
|
31191 |
|
31192 | defaults: {
|
31193 | event: 'press',
|
31194 | pointers: 1,
|
31195 | time: 251,
|
31196 |
|
31197 | threshold: 9
|
31198 |
|
31199 | },
|
31200 | getTouchAction: function () {
|
31201 | return [TOUCH_ACTION_AUTO];
|
31202 | },
|
31203 | process: function (input) {
|
31204 | var options = this.options;
|
31205 | var validPointers = input.pointers.length === options.pointers;
|
31206 | var validMovement = input.distance < options.threshold;
|
31207 | var validTime = input.deltaTime > options.time;
|
31208 | this._input = input;
|
31209 |
|
31210 |
|
31211 | if (!validMovement || !validPointers || input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime) {
|
31212 | this.reset();
|
31213 | } else if (input.eventType & INPUT_START) {
|
31214 | this.reset();
|
31215 | this._timer = setTimeoutContext(function () {
|
31216 | this.state = STATE_RECOGNIZED;
|
31217 | this.tryEmit();
|
31218 | }, options.time, this);
|
31219 | } else if (input.eventType & INPUT_END) {
|
31220 | return STATE_RECOGNIZED;
|
31221 | }
|
31222 |
|
31223 | return STATE_FAILED;
|
31224 | },
|
31225 | reset: function () {
|
31226 | clearTimeout(this._timer);
|
31227 | },
|
31228 | emit: function (input) {
|
31229 | if (this.state !== STATE_RECOGNIZED) {
|
31230 | return;
|
31231 | }
|
31232 |
|
31233 | if (input && input.eventType & INPUT_END) {
|
31234 | this.manager.emit(this.options.event + 'up', input);
|
31235 | } else {
|
31236 | this._input.timeStamp = now();
|
31237 | this.manager.emit(this.options.event, this._input);
|
31238 | }
|
31239 | }
|
31240 | });
|
31241 | |
31242 |
|
31243 |
|
31244 |
|
31245 |
|
31246 |
|
31247 |
|
31248 | function RotateRecognizer() {
|
31249 | AttrRecognizer.apply(this, arguments);
|
31250 | }
|
31251 |
|
31252 | inherit(RotateRecognizer, AttrRecognizer, {
|
31253 | |
31254 |
|
31255 |
|
31256 |
|
31257 | defaults: {
|
31258 | event: 'rotate',
|
31259 | threshold: 0,
|
31260 | pointers: 2
|
31261 | },
|
31262 | getTouchAction: function () {
|
31263 | return [TOUCH_ACTION_NONE];
|
31264 | },
|
31265 | attrTest: function (input) {
|
31266 | return this._super.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
|
31267 | }
|
31268 | });
|
31269 | |
31270 |
|
31271 |
|
31272 |
|
31273 |
|
31274 |
|
31275 |
|
31276 | function SwipeRecognizer() {
|
31277 | AttrRecognizer.apply(this, arguments);
|
31278 | }
|
31279 |
|
31280 | inherit(SwipeRecognizer, AttrRecognizer, {
|
31281 | |
31282 |
|
31283 |
|
31284 |
|
31285 | defaults: {
|
31286 | event: 'swipe',
|
31287 | threshold: 10,
|
31288 | velocity: 0.3,
|
31289 | direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
|
31290 | pointers: 1
|
31291 | },
|
31292 | getTouchAction: function () {
|
31293 | return PanRecognizer.prototype.getTouchAction.call(this);
|
31294 | },
|
31295 | attrTest: function (input) {
|
31296 | var direction = this.options.direction;
|
31297 | var velocity;
|
31298 |
|
31299 | if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
|
31300 | velocity = input.overallVelocity;
|
31301 | } else if (direction & DIRECTION_HORIZONTAL) {
|
31302 | velocity = input.overallVelocityX;
|
31303 | } else if (direction & DIRECTION_VERTICAL) {
|
31304 | velocity = input.overallVelocityY;
|
31305 | }
|
31306 |
|
31307 | return this._super.attrTest.call(this, input) && direction & input.offsetDirection && input.distance > this.options.threshold && input.maxPointers == this.options.pointers && abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
|
31308 | },
|
31309 | emit: function (input) {
|
31310 | var direction = directionStr(input.offsetDirection);
|
31311 |
|
31312 | if (direction) {
|
31313 | this.manager.emit(this.options.event + direction, input);
|
31314 | }
|
31315 |
|
31316 | this.manager.emit(this.options.event, input);
|
31317 | }
|
31318 | });
|
31319 | |
31320 |
|
31321 |
|
31322 |
|
31323 |
|
31324 |
|
31325 |
|
31326 |
|
31327 |
|
31328 |
|
31329 |
|
31330 | function TapRecognizer() {
|
31331 | Recognizer.apply(this, arguments);
|
31332 |
|
31333 |
|
31334 | this.pTime = false;
|
31335 | this.pCenter = false;
|
31336 | this._timer = null;
|
31337 | this._input = null;
|
31338 | this.count = 0;
|
31339 | }
|
31340 |
|
31341 | inherit(TapRecognizer, Recognizer, {
|
31342 | |
31343 |
|
31344 |
|
31345 |
|
31346 | defaults: {
|
31347 | event: 'tap',
|
31348 | pointers: 1,
|
31349 | taps: 1,
|
31350 | interval: 300,
|
31351 |
|
31352 | time: 250,
|
31353 |
|
31354 | threshold: 9,
|
31355 |
|
31356 | posThreshold: 10
|
31357 |
|
31358 | },
|
31359 | getTouchAction: function () {
|
31360 | return [TOUCH_ACTION_MANIPULATION];
|
31361 | },
|
31362 | process: function (input) {
|
31363 | var options = this.options;
|
31364 | var validPointers = input.pointers.length === options.pointers;
|
31365 | var validMovement = input.distance < options.threshold;
|
31366 | var validTouchTime = input.deltaTime < options.time;
|
31367 | this.reset();
|
31368 |
|
31369 | if (input.eventType & INPUT_START && this.count === 0) {
|
31370 | return this.failTimeout();
|
31371 | }
|
31372 |
|
31373 |
|
31374 |
|
31375 | if (validMovement && validTouchTime && validPointers) {
|
31376 | if (input.eventType != INPUT_END) {
|
31377 | return this.failTimeout();
|
31378 | }
|
31379 |
|
31380 | var validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true;
|
31381 | var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
|
31382 | this.pTime = input.timeStamp;
|
31383 | this.pCenter = input.center;
|
31384 |
|
31385 | if (!validMultiTap || !validInterval) {
|
31386 | this.count = 1;
|
31387 | } else {
|
31388 | this.count += 1;
|
31389 | }
|
31390 |
|
31391 | this._input = input;
|
31392 |
|
31393 |
|
31394 | var tapCount = this.count % options.taps;
|
31395 |
|
31396 | if (tapCount === 0) {
|
31397 |
|
31398 |
|
31399 | if (!this.hasRequireFailures()) {
|
31400 | return STATE_RECOGNIZED;
|
31401 | } else {
|
31402 | this._timer = setTimeoutContext(function () {
|
31403 | this.state = STATE_RECOGNIZED;
|
31404 | this.tryEmit();
|
31405 | }, options.interval, this);
|
31406 | return STATE_BEGAN;
|
31407 | }
|
31408 | }
|
31409 | }
|
31410 |
|
31411 | return STATE_FAILED;
|
31412 | },
|
31413 | failTimeout: function () {
|
31414 | this._timer = setTimeoutContext(function () {
|
31415 | this.state = STATE_FAILED;
|
31416 | }, this.options.interval, this);
|
31417 | return STATE_FAILED;
|
31418 | },
|
31419 | reset: function () {
|
31420 | clearTimeout(this._timer);
|
31421 | },
|
31422 | emit: function () {
|
31423 | if (this.state == STATE_RECOGNIZED) {
|
31424 | this._input.tapCount = this.count;
|
31425 | this.manager.emit(this.options.event, this._input);
|
31426 | }
|
31427 | }
|
31428 | });
|
31429 | |
31430 |
|
31431 |
|
31432 |
|
31433 |
|
31434 |
|
31435 |
|
31436 | function Hammer(element, options) {
|
31437 | options = options || {};
|
31438 | options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
|
31439 | return new Manager(element, options);
|
31440 | }
|
31441 | |
31442 |
|
31443 |
|
31444 |
|
31445 |
|
31446 | Hammer.VERSION = '2.0.7';
|
31447 | |
31448 |
|
31449 |
|
31450 |
|
31451 |
|
31452 | Hammer.defaults = {
|
31453 | |
31454 |
|
31455 |
|
31456 |
|
31457 |
|
31458 |
|
31459 | domEvents: false,
|
31460 |
|
31461 | |
31462 |
|
31463 |
|
31464 |
|
31465 |
|
31466 |
|
31467 | touchAction: TOUCH_ACTION_COMPUTE,
|
31468 |
|
31469 | |
31470 |
|
31471 |
|
31472 |
|
31473 | enable: true,
|
31474 |
|
31475 | |
31476 |
|
31477 |
|
31478 |
|
31479 |
|
31480 |
|
31481 |
|
31482 | inputTarget: null,
|
31483 |
|
31484 | |
31485 |
|
31486 |
|
31487 |
|
31488 |
|
31489 | inputClass: null,
|
31490 |
|
31491 | |
31492 |
|
31493 |
|
31494 |
|
31495 |
|
31496 | preset: [
|
31497 | [RotateRecognizer, {
|
31498 | enable: false
|
31499 | }], [PinchRecognizer, {
|
31500 | enable: false
|
31501 | }, ['rotate']], [SwipeRecognizer, {
|
31502 | direction: DIRECTION_HORIZONTAL
|
31503 | }], [PanRecognizer, {
|
31504 | direction: DIRECTION_HORIZONTAL
|
31505 | }, ['swipe']], [TapRecognizer], [TapRecognizer, {
|
31506 | event: 'doubletap',
|
31507 | taps: 2
|
31508 | }, ['tap']], [PressRecognizer]],
|
31509 |
|
31510 | |
31511 |
|
31512 |
|
31513 |
|
31514 |
|
31515 | cssProps: {
|
31516 | |
31517 |
|
31518 |
|
31519 |
|
31520 |
|
31521 | userSelect: 'none',
|
31522 |
|
31523 | |
31524 |
|
31525 |
|
31526 |
|
31527 |
|
31528 | touchSelect: 'none',
|
31529 |
|
31530 | |
31531 |
|
31532 |
|
31533 |
|
31534 |
|
31535 |
|
31536 |
|
31537 | touchCallout: 'none',
|
31538 |
|
31539 | |
31540 |
|
31541 |
|
31542 |
|
31543 |
|
31544 | contentZooming: 'none',
|
31545 |
|
31546 | |
31547 |
|
31548 |
|
31549 |
|
31550 |
|
31551 | userDrag: 'none',
|
31552 |
|
31553 | |
31554 |
|
31555 |
|
31556 |
|
31557 |
|
31558 |
|
31559 | tapHighlightColor: 'rgba(0,0,0,0)'
|
31560 | }
|
31561 | };
|
31562 | var STOP = 1;
|
31563 | var FORCED_STOP = 2;
|
31564 | |
31565 |
|
31566 |
|
31567 |
|
31568 |
|
31569 |
|
31570 |
|
31571 | function Manager(element, options) {
|
31572 | this.options = assign({}, Hammer.defaults, options || {});
|
31573 | this.options.inputTarget = this.options.inputTarget || element;
|
31574 | this.handlers = {};
|
31575 | this.session = {};
|
31576 | this.recognizers = [];
|
31577 | this.oldCssProps = {};
|
31578 | this.element = element;
|
31579 | this.input = createInputInstance(this);
|
31580 | this.touchAction = new TouchAction(this, this.options.touchAction);
|
31581 | toggleCssProps(this, true);
|
31582 | each(this.options.recognizers, function (item) {
|
31583 | var recognizer = this.add(new item[0](item[1]));
|
31584 | item[2] && recognizer.recognizeWith(item[2]);
|
31585 | item[3] && recognizer.requireFailure(item[3]);
|
31586 | }, this);
|
31587 | }
|
31588 |
|
31589 | Manager.prototype = {
|
31590 | |
31591 |
|
31592 |
|
31593 |
|
31594 |
|
31595 | set: function (options) {
|
31596 | assign(this.options, options);
|
31597 |
|
31598 | if (options.touchAction) {
|
31599 | this.touchAction.update();
|
31600 | }
|
31601 |
|
31602 | if (options.inputTarget) {
|
31603 |
|
31604 | this.input.destroy();
|
31605 | this.input.target = options.inputTarget;
|
31606 | this.input.init();
|
31607 | }
|
31608 |
|
31609 | return this;
|
31610 | },
|
31611 |
|
31612 | |
31613 |
|
31614 |
|
31615 |
|
31616 |
|
31617 |
|
31618 | stop: function (force) {
|
31619 | this.session.stopped = force ? FORCED_STOP : STOP;
|
31620 | },
|
31621 |
|
31622 | |
31623 |
|
31624 |
|
31625 |
|
31626 |
|
31627 |
|
31628 | recognize: function (inputData) {
|
31629 | var session = this.session;
|
31630 |
|
31631 | if (session.stopped) {
|
31632 | return;
|
31633 | }
|
31634 |
|
31635 |
|
31636 | this.touchAction.preventDefaults(inputData);
|
31637 | var recognizer;
|
31638 | var recognizers = this.recognizers;
|
31639 |
|
31640 |
|
31641 |
|
31642 | var curRecognizer = session.curRecognizer;
|
31643 |
|
31644 |
|
31645 | if (!curRecognizer || curRecognizer && curRecognizer.state & STATE_RECOGNIZED) {
|
31646 | curRecognizer = session.curRecognizer = null;
|
31647 | }
|
31648 |
|
31649 | var i = 0;
|
31650 |
|
31651 | while (i < recognizers.length) {
|
31652 | recognizer = recognizers[i];
|
31653 |
|
31654 |
|
31655 |
|
31656 |
|
31657 |
|
31658 |
|
31659 | if (session.stopped !== FORCED_STOP && (
|
31660 | !curRecognizer || recognizer == curRecognizer ||
|
31661 | recognizer.canRecognizeWith(curRecognizer))) {
|
31662 |
|
31663 | recognizer.recognize(inputData);
|
31664 | } else {
|
31665 | recognizer.reset();
|
31666 | }
|
31667 |
|
31668 |
|
31669 |
|
31670 | if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
|
31671 | curRecognizer = session.curRecognizer = recognizer;
|
31672 | }
|
31673 |
|
31674 | i++;
|
31675 | }
|
31676 | },
|
31677 |
|
31678 | |
31679 |
|
31680 |
|
31681 |
|
31682 |
|
31683 | get: function (recognizer) {
|
31684 | if (recognizer instanceof Recognizer) {
|
31685 | return recognizer;
|
31686 | }
|
31687 |
|
31688 | var recognizers = this.recognizers;
|
31689 |
|
31690 | for (var i = 0; i < recognizers.length; i++) {
|
31691 | if (recognizers[i].options.event == recognizer) {
|
31692 | return recognizers[i];
|
31693 | }
|
31694 | }
|
31695 |
|
31696 | return null;
|
31697 | },
|
31698 |
|
31699 | |
31700 |
|
31701 |
|
31702 |
|
31703 |
|
31704 |
|
31705 | add: function (recognizer) {
|
31706 | if (invokeArrayArg(recognizer, 'add', this)) {
|
31707 | return this;
|
31708 | }
|
31709 |
|
31710 |
|
31711 | var existing = this.get(recognizer.options.event);
|
31712 |
|
31713 | if (existing) {
|
31714 | this.remove(existing);
|
31715 | }
|
31716 |
|
31717 | this.recognizers.push(recognizer);
|
31718 | recognizer.manager = this;
|
31719 | this.touchAction.update();
|
31720 | return recognizer;
|
31721 | },
|
31722 |
|
31723 | |
31724 |
|
31725 |
|
31726 |
|
31727 |
|
31728 | remove: function (recognizer) {
|
31729 | if (invokeArrayArg(recognizer, 'remove', this)) {
|
31730 | return this;
|
31731 | }
|
31732 |
|
31733 | recognizer = this.get(recognizer);
|
31734 |
|
31735 | if (recognizer) {
|
31736 | var recognizers = this.recognizers;
|
31737 | var index = inArray(recognizers, recognizer);
|
31738 |
|
31739 | if (index !== -1) {
|
31740 | recognizers.splice(index, 1);
|
31741 | this.touchAction.update();
|
31742 | }
|
31743 | }
|
31744 |
|
31745 | return this;
|
31746 | },
|
31747 |
|
31748 | |
31749 |
|
31750 |
|
31751 |
|
31752 |
|
31753 |
|
31754 | on: function (events, handler) {
|
31755 | if (events === undefined$1) {
|
31756 | return;
|
31757 | }
|
31758 |
|
31759 | if (handler === undefined$1) {
|
31760 | return;
|
31761 | }
|
31762 |
|
31763 | var handlers = this.handlers;
|
31764 | each(splitStr(events), function (event) {
|
31765 | handlers[event] = handlers[event] || [];
|
31766 | handlers[event].push(handler);
|
31767 | });
|
31768 | return this;
|
31769 | },
|
31770 |
|
31771 | |
31772 |
|
31773 |
|
31774 |
|
31775 |
|
31776 |
|
31777 | off: function (events, handler) {
|
31778 | if (events === undefined$1) {
|
31779 | return;
|
31780 | }
|
31781 |
|
31782 | var handlers = this.handlers;
|
31783 | each(splitStr(events), function (event) {
|
31784 | if (!handler) {
|
31785 | delete handlers[event];
|
31786 | } else {
|
31787 | handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
|
31788 | }
|
31789 | });
|
31790 | return this;
|
31791 | },
|
31792 |
|
31793 | |
31794 |
|
31795 |
|
31796 |
|
31797 |
|
31798 | emit: function (event, data) {
|
31799 |
|
31800 | if (this.options.domEvents) {
|
31801 | triggerDomEvent(event, data);
|
31802 | }
|
31803 |
|
31804 |
|
31805 | var handlers = this.handlers[event] && this.handlers[event].slice();
|
31806 |
|
31807 | if (!handlers || !handlers.length) {
|
31808 | return;
|
31809 | }
|
31810 |
|
31811 | data.type = event;
|
31812 |
|
31813 | data.preventDefault = function () {
|
31814 | data.srcEvent.preventDefault();
|
31815 | };
|
31816 |
|
31817 | var i = 0;
|
31818 |
|
31819 | while (i < handlers.length) {
|
31820 | handlers[i](data);
|
31821 | i++;
|
31822 | }
|
31823 | },
|
31824 |
|
31825 | |
31826 |
|
31827 |
|
31828 |
|
31829 | destroy: function () {
|
31830 | this.element && toggleCssProps(this, false);
|
31831 | this.handlers = {};
|
31832 | this.session = {};
|
31833 | this.input.destroy();
|
31834 | this.element = null;
|
31835 | }
|
31836 | };
|
31837 | |
31838 |
|
31839 |
|
31840 |
|
31841 |
|
31842 |
|
31843 | function toggleCssProps(manager, add) {
|
31844 | var element = manager.element;
|
31845 |
|
31846 | if (!element.style) {
|
31847 | return;
|
31848 | }
|
31849 |
|
31850 | var prop;
|
31851 | each(manager.options.cssProps, function (value, name) {
|
31852 | prop = prefixed(element.style, name);
|
31853 |
|
31854 | if (add) {
|
31855 | manager.oldCssProps[prop] = element.style[prop];
|
31856 | element.style[prop] = value;
|
31857 | } else {
|
31858 | element.style[prop] = manager.oldCssProps[prop] || '';
|
31859 | }
|
31860 | });
|
31861 |
|
31862 | if (!add) {
|
31863 | manager.oldCssProps = {};
|
31864 | }
|
31865 | }
|
31866 | |
31867 |
|
31868 |
|
31869 |
|
31870 |
|
31871 |
|
31872 |
|
31873 | function triggerDomEvent(event, data) {
|
31874 | var gestureEvent = document.createEvent('Event');
|
31875 | gestureEvent.initEvent(event, true, true);
|
31876 | gestureEvent.gesture = data;
|
31877 | data.target.dispatchEvent(gestureEvent);
|
31878 | }
|
31879 |
|
31880 | assign(Hammer, {
|
31881 | INPUT_START: INPUT_START,
|
31882 | INPUT_MOVE: INPUT_MOVE,
|
31883 | INPUT_END: INPUT_END,
|
31884 | INPUT_CANCEL: INPUT_CANCEL,
|
31885 | STATE_POSSIBLE: STATE_POSSIBLE,
|
31886 | STATE_BEGAN: STATE_BEGAN,
|
31887 | STATE_CHANGED: STATE_CHANGED,
|
31888 | STATE_ENDED: STATE_ENDED,
|
31889 | STATE_RECOGNIZED: STATE_RECOGNIZED,
|
31890 | STATE_CANCELLED: STATE_CANCELLED,
|
31891 | STATE_FAILED: STATE_FAILED,
|
31892 | DIRECTION_NONE: DIRECTION_NONE,
|
31893 | DIRECTION_LEFT: DIRECTION_LEFT,
|
31894 | DIRECTION_RIGHT: DIRECTION_RIGHT,
|
31895 | DIRECTION_UP: DIRECTION_UP,
|
31896 | DIRECTION_DOWN: DIRECTION_DOWN,
|
31897 | DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
|
31898 | DIRECTION_VERTICAL: DIRECTION_VERTICAL,
|
31899 | DIRECTION_ALL: DIRECTION_ALL,
|
31900 | Manager: Manager,
|
31901 | Input: Input,
|
31902 | TouchAction: TouchAction,
|
31903 | TouchInput: TouchInput,
|
31904 | MouseInput: MouseInput,
|
31905 | PointerEventInput: PointerEventInput,
|
31906 | TouchMouseInput: TouchMouseInput,
|
31907 | SingleTouchInput: SingleTouchInput,
|
31908 | Recognizer: Recognizer,
|
31909 | AttrRecognizer: AttrRecognizer,
|
31910 | Tap: TapRecognizer,
|
31911 | Pan: PanRecognizer,
|
31912 | Swipe: SwipeRecognizer,
|
31913 | Pinch: PinchRecognizer,
|
31914 | Rotate: RotateRecognizer,
|
31915 | Press: PressRecognizer,
|
31916 | on: addEventListeners,
|
31917 | off: removeEventListeners,
|
31918 | each: each,
|
31919 | merge: merge,
|
31920 | extend: extend,
|
31921 | assign: assign,
|
31922 | inherit: inherit,
|
31923 | bindFn: bindFn,
|
31924 | prefixed: prefixed
|
31925 | });
|
31926 |
|
31927 |
|
31928 | var freeGlobal = typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {};
|
31929 |
|
31930 | freeGlobal.Hammer = Hammer;
|
31931 |
|
31932 | if (typeof undefined$1 === 'function' && undefined$1.amd) {
|
31933 | undefined$1(function () {
|
31934 | return Hammer;
|
31935 | });
|
31936 | } else if ( module.exports) {
|
31937 | module.exports = Hammer;
|
31938 | } else {
|
31939 | window[exportName] = Hammer;
|
31940 | }
|
31941 | })(window, document, 'Hammer');
|
31942 | });
|
31943 |
|
31944 | var hammer$1 = createCommonjsModule$1(function (module) {
|
31945 | |
31946 |
|
31947 |
|
31948 |
|
31949 |
|
31950 |
|
31951 |
|
31952 | function hammerMock() {
|
31953 | var noop = function noop() {};
|
31954 |
|
31955 | return {
|
31956 | on: noop,
|
31957 | off: noop,
|
31958 | destroy: noop,
|
31959 | emit: noop,
|
31960 | get: function get(m) {
|
31961 |
|
31962 | return {
|
31963 | set: noop
|
31964 | };
|
31965 | }
|
31966 | };
|
31967 | }
|
31968 |
|
31969 | if (typeof window !== 'undefined') {
|
31970 | var propagating$1 = propagating;
|
31971 | var Hammer = window['Hammer'] || hammer;
|
31972 | module.exports = propagating$1(Hammer, {
|
31973 | preventDefault: 'mouse'
|
31974 | });
|
31975 | } else {
|
31976 | module.exports = function () {
|
31977 |
|
31978 | return hammerMock();
|
31979 | };
|
31980 | }
|
31981 | });
|
31982 |
|
31983 | var keycharm = createCommonjsModule$1(function (module, exports) {
|
31984 | |
31985 |
|
31986 |
|
31987 |
|
31988 |
|
31989 |
|
31990 | (function (root, factory) {
|
31991 | {
|
31992 |
|
31993 |
|
31994 |
|
31995 | module.exports = factory();
|
31996 | }
|
31997 | })(commonjsGlobal$1, function () {
|
31998 | function keycharm(options) {
|
31999 | var preventDefault = options && options.preventDefault || false;
|
32000 | var container = options && options.container || window;
|
32001 | var _exportFunctions = {};
|
32002 | var _bound = {
|
32003 | keydown: {},
|
32004 | keyup: {}
|
32005 | };
|
32006 | var _keys = {};
|
32007 | var i;
|
32008 |
|
32009 | for (i = 97; i <= 122; i++) {
|
32010 | _keys[String.fromCharCode(i)] = {
|
32011 | code: 65 + (i - 97),
|
32012 | shift: false
|
32013 | };
|
32014 | }
|
32015 |
|
32016 |
|
32017 | for (i = 65; i <= 90; i++) {
|
32018 | _keys[String.fromCharCode(i)] = {
|
32019 | code: i,
|
32020 | shift: true
|
32021 | };
|
32022 | }
|
32023 |
|
32024 |
|
32025 | for (i = 0; i <= 9; i++) {
|
32026 | _keys['' + i] = {
|
32027 | code: 48 + i,
|
32028 | shift: false
|
32029 | };
|
32030 | }
|
32031 |
|
32032 |
|
32033 | for (i = 1; i <= 12; i++) {
|
32034 | _keys['F' + i] = {
|
32035 | code: 111 + i,
|
32036 | shift: false
|
32037 | };
|
32038 | }
|
32039 |
|
32040 |
|
32041 | for (i = 0; i <= 9; i++) {
|
32042 | _keys['num' + i] = {
|
32043 | code: 96 + i,
|
32044 | shift: false
|
32045 | };
|
32046 | }
|
32047 |
|
32048 |
|
32049 | _keys['num*'] = {
|
32050 | code: 106,
|
32051 | shift: false
|
32052 | };
|
32053 | _keys['num+'] = {
|
32054 | code: 107,
|
32055 | shift: false
|
32056 | };
|
32057 | _keys['num-'] = {
|
32058 | code: 109,
|
32059 | shift: false
|
32060 | };
|
32061 | _keys['num/'] = {
|
32062 | code: 111,
|
32063 | shift: false
|
32064 | };
|
32065 | _keys['num.'] = {
|
32066 | code: 110,
|
32067 | shift: false
|
32068 | };
|
32069 |
|
32070 | _keys['left'] = {
|
32071 | code: 37,
|
32072 | shift: false
|
32073 | };
|
32074 | _keys['up'] = {
|
32075 | code: 38,
|
32076 | shift: false
|
32077 | };
|
32078 | _keys['right'] = {
|
32079 | code: 39,
|
32080 | shift: false
|
32081 | };
|
32082 | _keys['down'] = {
|
32083 | code: 40,
|
32084 | shift: false
|
32085 | };
|
32086 |
|
32087 | _keys['space'] = {
|
32088 | code: 32,
|
32089 | shift: false
|
32090 | };
|
32091 | _keys['enter'] = {
|
32092 | code: 13,
|
32093 | shift: false
|
32094 | };
|
32095 | _keys['shift'] = {
|
32096 | code: 16,
|
32097 | shift: undefined
|
32098 | };
|
32099 | _keys['esc'] = {
|
32100 | code: 27,
|
32101 | shift: false
|
32102 | };
|
32103 | _keys['backspace'] = {
|
32104 | code: 8,
|
32105 | shift: false
|
32106 | };
|
32107 | _keys['tab'] = {
|
32108 | code: 9,
|
32109 | shift: false
|
32110 | };
|
32111 | _keys['ctrl'] = {
|
32112 | code: 17,
|
32113 | shift: false
|
32114 | };
|
32115 | _keys['alt'] = {
|
32116 | code: 18,
|
32117 | shift: false
|
32118 | };
|
32119 | _keys['delete'] = {
|
32120 | code: 46,
|
32121 | shift: false
|
32122 | };
|
32123 | _keys['pageup'] = {
|
32124 | code: 33,
|
32125 | shift: false
|
32126 | };
|
32127 | _keys['pagedown'] = {
|
32128 | code: 34,
|
32129 | shift: false
|
32130 | };
|
32131 |
|
32132 | _keys['='] = {
|
32133 | code: 187,
|
32134 | shift: false
|
32135 | };
|
32136 | _keys['-'] = {
|
32137 | code: 189,
|
32138 | shift: false
|
32139 | };
|
32140 | _keys[']'] = {
|
32141 | code: 221,
|
32142 | shift: false
|
32143 | };
|
32144 | _keys['['] = {
|
32145 | code: 219,
|
32146 | shift: false
|
32147 | };
|
32148 |
|
32149 | var down = function (event) {
|
32150 | handleEvent(event, 'keydown');
|
32151 | };
|
32152 |
|
32153 | var up = function (event) {
|
32154 | handleEvent(event, 'keyup');
|
32155 | };
|
32156 |
|
32157 |
|
32158 | var handleEvent = function (event, type) {
|
32159 | if (_bound[type][event.keyCode] !== undefined) {
|
32160 | var bound = _bound[type][event.keyCode];
|
32161 |
|
32162 | for (var i = 0; i < bound.length; i++) {
|
32163 | if (bound[i].shift === undefined) {
|
32164 | bound[i].fn(event);
|
32165 | } else if (bound[i].shift == true && event.shiftKey == true) {
|
32166 | bound[i].fn(event);
|
32167 | } else if (bound[i].shift == false && event.shiftKey == false) {
|
32168 | bound[i].fn(event);
|
32169 | }
|
32170 | }
|
32171 |
|
32172 | if (preventDefault == true) {
|
32173 | event.preventDefault();
|
32174 | }
|
32175 | }
|
32176 | };
|
32177 |
|
32178 |
|
32179 | _exportFunctions.bind = function (key, callback, type) {
|
32180 | if (type === undefined) {
|
32181 | type = 'keydown';
|
32182 | }
|
32183 |
|
32184 | if (_keys[key] === undefined) {
|
32185 | throw new Error("unsupported key: " + key);
|
32186 | }
|
32187 |
|
32188 | if (_bound[type][_keys[key].code] === undefined) {
|
32189 | _bound[type][_keys[key].code] = [];
|
32190 | }
|
32191 |
|
32192 | _bound[type][_keys[key].code].push({
|
32193 | fn: callback,
|
32194 | shift: _keys[key].shift
|
32195 | });
|
32196 | };
|
32197 |
|
32198 |
|
32199 | _exportFunctions.bindAll = function (callback, type) {
|
32200 | if (type === undefined) {
|
32201 | type = 'keydown';
|
32202 | }
|
32203 |
|
32204 | for (var key in _keys) {
|
32205 | if (_keys.hasOwnProperty(key)) {
|
32206 | _exportFunctions.bind(key, callback, type);
|
32207 | }
|
32208 | }
|
32209 | };
|
32210 |
|
32211 |
|
32212 | _exportFunctions.getKey = function (event) {
|
32213 | for (var key in _keys) {
|
32214 | if (_keys.hasOwnProperty(key)) {
|
32215 | if (event.shiftKey == true && _keys[key].shift == true && event.keyCode == _keys[key].code) {
|
32216 | return key;
|
32217 | } else if (event.shiftKey == false && _keys[key].shift == false && event.keyCode == _keys[key].code) {
|
32218 | return key;
|
32219 | } else if (event.keyCode == _keys[key].code && key == 'shift') {
|
32220 | return key;
|
32221 | }
|
32222 | }
|
32223 | }
|
32224 |
|
32225 | return "unknown key, currently not supported";
|
32226 | };
|
32227 |
|
32228 |
|
32229 | _exportFunctions.unbind = function (key, callback, type) {
|
32230 | if (type === undefined) {
|
32231 | type = 'keydown';
|
32232 | }
|
32233 |
|
32234 | if (_keys[key] === undefined) {
|
32235 | throw new Error("unsupported key: " + key);
|
32236 | }
|
32237 |
|
32238 | if (callback !== undefined) {
|
32239 | var newBindings = [];
|
32240 | var bound = _bound[type][_keys[key].code];
|
32241 |
|
32242 | if (bound !== undefined) {
|
32243 | for (var i = 0; i < bound.length; i++) {
|
32244 | if (!(bound[i].fn == callback && bound[i].shift == _keys[key].shift)) {
|
32245 | newBindings.push(_bound[type][_keys[key].code][i]);
|
32246 | }
|
32247 | }
|
32248 | }
|
32249 |
|
32250 | _bound[type][_keys[key].code] = newBindings;
|
32251 | } else {
|
32252 | _bound[type][_keys[key].code] = [];
|
32253 | }
|
32254 | };
|
32255 |
|
32256 |
|
32257 | _exportFunctions.reset = function () {
|
32258 | _bound = {
|
32259 | keydown: {},
|
32260 | keyup: {}
|
32261 | };
|
32262 | };
|
32263 |
|
32264 |
|
32265 | _exportFunctions.destroy = function () {
|
32266 | _bound = {
|
32267 | keydown: {},
|
32268 | keyup: {}
|
32269 | };
|
32270 | container.removeEventListener('keydown', down, true);
|
32271 | container.removeEventListener('keyup', up, true);
|
32272 | };
|
32273 |
|
32274 |
|
32275 | container.addEventListener('keydown', down, true);
|
32276 | container.addEventListener('keyup', up, true);
|
32277 |
|
32278 | return _exportFunctions;
|
32279 | }
|
32280 |
|
32281 | return keycharm;
|
32282 | });
|
32283 | });
|
32284 |
|
32285 | var util_1 = util;
|
32286 | var DOMutil$1 = DOMutil;
|
32287 |
|
32288 | var DataSet$2 = index.DataSet,
|
32289 | DataView$3 = index.DataView,
|
32290 | Queue$1 = index.Queue;
|
32291 | var DataSet_1 = DataSet$2;
|
32292 | var DataView_1 = DataView$3;
|
32293 | var Queue_1 = Queue$1;
|
32294 |
|
32295 | var Graph3d$1 = Graph3d_1;
|
32296 | var graph3d = {
|
32297 | Camera: Camera_1,
|
32298 | Filter: Filter_1,
|
32299 | Point2d: Point2d_1,
|
32300 | Point3d: Point3d_1,
|
32301 | Slider: Slider_1,
|
32302 | StepNumber: StepNumber_1
|
32303 | };
|
32304 |
|
32305 | var moment$3 = moment$2;
|
32306 | var Hammer = hammer$1;
|
32307 | var keycharm$1 = keycharm;
|
32308 | var repo = {
|
32309 | util: util_1,
|
32310 | DOMutil: DOMutil$1,
|
32311 | DataSet: DataSet_1,
|
32312 | DataView: DataView_1,
|
32313 | Queue: Queue_1,
|
32314 | Graph3d: Graph3d$1,
|
32315 | graph3d: graph3d,
|
32316 | moment: moment$3,
|
32317 | Hammer: Hammer,
|
32318 | keycharm: keycharm$1
|
32319 | };
|
32320 |
|
32321 | export default repo;
|
32322 | export { DOMutil$1 as DOMutil, DataSet_1 as DataSet, DataView_1 as DataView, Graph3d$1 as Graph3d, Hammer, Queue_1 as Queue, graph3d, keycharm$1 as keycharm, moment$3 as moment, util_1 as util };
|