@pie-element/match 10.3.4-next.3 → 11.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/configure/lib/add-row.js +27 -73
  2. package/configure/lib/add-row.js.map +1 -1
  3. package/configure/lib/answer-config-block.js +260 -333
  4. package/configure/lib/answer-config-block.js.map +1 -1
  5. package/configure/lib/common.js +18 -33
  6. package/configure/lib/common.js.map +1 -1
  7. package/configure/lib/configure.js +329 -419
  8. package/configure/lib/configure.js.map +1 -1
  9. package/configure/lib/defaults.js +2 -4
  10. package/configure/lib/defaults.js.map +1 -1
  11. package/configure/lib/general-config-block.js +123 -190
  12. package/configure/lib/general-config-block.js.map +1 -1
  13. package/configure/lib/index.js +116 -188
  14. package/configure/lib/index.js.map +1 -1
  15. package/configure/lib/row.js +268 -376
  16. package/configure/lib/row.js.map +1 -1
  17. package/configure/lib/utils.js +4 -15
  18. package/configure/lib/utils.js.map +1 -1
  19. package/configure/package.json +13 -11
  20. package/controller/lib/defaults.js +2 -3
  21. package/controller/lib/defaults.js.map +1 -1
  22. package/controller/lib/index.js +172 -298
  23. package/controller/lib/index.js.map +1 -1
  24. package/controller/package.json +5 -5
  25. package/lib/answer-grid.js +142 -242
  26. package/lib/answer-grid.js.map +1 -1
  27. package/lib/index.js +59 -108
  28. package/lib/index.js.map +1 -1
  29. package/lib/main.js +123 -191
  30. package/lib/main.js.map +1 -1
  31. package/package.json +12 -9
  32. package/esm/configure.js +0 -48535
  33. package/esm/configure.js.map +0 -1
  34. package/esm/controller.js +0 -4464
  35. package/esm/controller.js.map +0 -1
  36. package/esm/element.js +0 -13517
  37. package/esm/element.js.map +0 -1
  38. package/esm/package.json +0 -3
package/esm/controller.js DELETED
@@ -1,4464 +0,0 @@
1
- import { getFeedbackForCorrectness } from '@pie-lib/feedback';
2
- import { lockChoices, getShuffledChoices, partialScoring } from '@pie-lib/controller-utils';
3
-
4
- function _extends() {
5
- _extends = Object.assign || function (target) {
6
- for (var i = 1; i < arguments.length; i++) {
7
- var source = arguments[i];
8
-
9
- for (var key in source) {
10
- if (Object.prototype.hasOwnProperty.call(source, key)) {
11
- target[key] = source[key];
12
- }
13
- }
14
- }
15
-
16
- return target;
17
- };
18
-
19
- return _extends.apply(this, arguments);
20
- }
21
-
22
- function _objectWithoutPropertiesLoose(source, excluded) {
23
- if (source == null) return {};
24
- var target = {};
25
- var sourceKeys = Object.keys(source);
26
- var key, i;
27
-
28
- for (i = 0; i < sourceKeys.length; i++) {
29
- key = sourceKeys[i];
30
- if (excluded.indexOf(key) >= 0) continue;
31
- target[key] = source[key];
32
- }
33
-
34
- return target;
35
- }
36
-
37
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
38
-
39
- /**
40
- * Removes all key-value entries from the list cache.
41
- *
42
- * @private
43
- * @name clear
44
- * @memberOf ListCache
45
- */
46
-
47
- function listCacheClear$1() {
48
- this.__data__ = [];
49
- this.size = 0;
50
- }
51
-
52
- var _listCacheClear = listCacheClear$1;
53
-
54
- /**
55
- * Performs a
56
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
57
- * comparison between two values to determine if they are equivalent.
58
- *
59
- * @static
60
- * @memberOf _
61
- * @since 4.0.0
62
- * @category Lang
63
- * @param {*} value The value to compare.
64
- * @param {*} other The other value to compare.
65
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
66
- * @example
67
- *
68
- * var object = { 'a': 1 };
69
- * var other = { 'a': 1 };
70
- *
71
- * _.eq(object, object);
72
- * // => true
73
- *
74
- * _.eq(object, other);
75
- * // => false
76
- *
77
- * _.eq('a', 'a');
78
- * // => true
79
- *
80
- * _.eq('a', Object('a'));
81
- * // => false
82
- *
83
- * _.eq(NaN, NaN);
84
- * // => true
85
- */
86
-
87
- function eq$3(value, other) {
88
- return value === other || (value !== value && other !== other);
89
- }
90
-
91
- var eq_1 = eq$3;
92
-
93
- var eq$2 = eq_1;
94
-
95
- /**
96
- * Gets the index at which the `key` is found in `array` of key-value pairs.
97
- *
98
- * @private
99
- * @param {Array} array The array to inspect.
100
- * @param {*} key The key to search for.
101
- * @returns {number} Returns the index of the matched value, else `-1`.
102
- */
103
- function assocIndexOf$4(array, key) {
104
- var length = array.length;
105
- while (length--) {
106
- if (eq$2(array[length][0], key)) {
107
- return length;
108
- }
109
- }
110
- return -1;
111
- }
112
-
113
- var _assocIndexOf = assocIndexOf$4;
114
-
115
- var assocIndexOf$3 = _assocIndexOf;
116
-
117
- /** Used for built-in method references. */
118
- var arrayProto = Array.prototype;
119
-
120
- /** Built-in value references. */
121
- var splice = arrayProto.splice;
122
-
123
- /**
124
- * Removes `key` and its value from the list cache.
125
- *
126
- * @private
127
- * @name delete
128
- * @memberOf ListCache
129
- * @param {string} key The key of the value to remove.
130
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
131
- */
132
- function listCacheDelete$1(key) {
133
- var data = this.__data__,
134
- index = assocIndexOf$3(data, key);
135
-
136
- if (index < 0) {
137
- return false;
138
- }
139
- var lastIndex = data.length - 1;
140
- if (index == lastIndex) {
141
- data.pop();
142
- } else {
143
- splice.call(data, index, 1);
144
- }
145
- --this.size;
146
- return true;
147
- }
148
-
149
- var _listCacheDelete = listCacheDelete$1;
150
-
151
- var assocIndexOf$2 = _assocIndexOf;
152
-
153
- /**
154
- * Gets the list cache value for `key`.
155
- *
156
- * @private
157
- * @name get
158
- * @memberOf ListCache
159
- * @param {string} key The key of the value to get.
160
- * @returns {*} Returns the entry value.
161
- */
162
- function listCacheGet$1(key) {
163
- var data = this.__data__,
164
- index = assocIndexOf$2(data, key);
165
-
166
- return index < 0 ? undefined : data[index][1];
167
- }
168
-
169
- var _listCacheGet = listCacheGet$1;
170
-
171
- var assocIndexOf$1 = _assocIndexOf;
172
-
173
- /**
174
- * Checks if a list cache value for `key` exists.
175
- *
176
- * @private
177
- * @name has
178
- * @memberOf ListCache
179
- * @param {string} key The key of the entry to check.
180
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
181
- */
182
- function listCacheHas$1(key) {
183
- return assocIndexOf$1(this.__data__, key) > -1;
184
- }
185
-
186
- var _listCacheHas = listCacheHas$1;
187
-
188
- var assocIndexOf = _assocIndexOf;
189
-
190
- /**
191
- * Sets the list cache `key` to `value`.
192
- *
193
- * @private
194
- * @name set
195
- * @memberOf ListCache
196
- * @param {string} key The key of the value to set.
197
- * @param {*} value The value to set.
198
- * @returns {Object} Returns the list cache instance.
199
- */
200
- function listCacheSet$1(key, value) {
201
- var data = this.__data__,
202
- index = assocIndexOf(data, key);
203
-
204
- if (index < 0) {
205
- ++this.size;
206
- data.push([key, value]);
207
- } else {
208
- data[index][1] = value;
209
- }
210
- return this;
211
- }
212
-
213
- var _listCacheSet = listCacheSet$1;
214
-
215
- var listCacheClear = _listCacheClear,
216
- listCacheDelete = _listCacheDelete,
217
- listCacheGet = _listCacheGet,
218
- listCacheHas = _listCacheHas,
219
- listCacheSet = _listCacheSet;
220
-
221
- /**
222
- * Creates an list cache object.
223
- *
224
- * @private
225
- * @constructor
226
- * @param {Array} [entries] The key-value pairs to cache.
227
- */
228
- function ListCache$4(entries) {
229
- var index = -1,
230
- length = entries == null ? 0 : entries.length;
231
-
232
- this.clear();
233
- while (++index < length) {
234
- var entry = entries[index];
235
- this.set(entry[0], entry[1]);
236
- }
237
- }
238
-
239
- // Add methods to `ListCache`.
240
- ListCache$4.prototype.clear = listCacheClear;
241
- ListCache$4.prototype['delete'] = listCacheDelete;
242
- ListCache$4.prototype.get = listCacheGet;
243
- ListCache$4.prototype.has = listCacheHas;
244
- ListCache$4.prototype.set = listCacheSet;
245
-
246
- var _ListCache = ListCache$4;
247
-
248
- var ListCache$3 = _ListCache;
249
-
250
- /**
251
- * Removes all key-value entries from the stack.
252
- *
253
- * @private
254
- * @name clear
255
- * @memberOf Stack
256
- */
257
- function stackClear$1() {
258
- this.__data__ = new ListCache$3;
259
- this.size = 0;
260
- }
261
-
262
- var _stackClear = stackClear$1;
263
-
264
- /**
265
- * Removes `key` and its value from the stack.
266
- *
267
- * @private
268
- * @name delete
269
- * @memberOf Stack
270
- * @param {string} key The key of the value to remove.
271
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
272
- */
273
-
274
- function stackDelete$1(key) {
275
- var data = this.__data__,
276
- result = data['delete'](key);
277
-
278
- this.size = data.size;
279
- return result;
280
- }
281
-
282
- var _stackDelete = stackDelete$1;
283
-
284
- /**
285
- * Gets the stack value for `key`.
286
- *
287
- * @private
288
- * @name get
289
- * @memberOf Stack
290
- * @param {string} key The key of the value to get.
291
- * @returns {*} Returns the entry value.
292
- */
293
-
294
- function stackGet$1(key) {
295
- return this.__data__.get(key);
296
- }
297
-
298
- var _stackGet = stackGet$1;
299
-
300
- /**
301
- * Checks if a stack value for `key` exists.
302
- *
303
- * @private
304
- * @name has
305
- * @memberOf Stack
306
- * @param {string} key The key of the entry to check.
307
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
308
- */
309
-
310
- function stackHas$1(key) {
311
- return this.__data__.has(key);
312
- }
313
-
314
- var _stackHas = stackHas$1;
315
-
316
- /** Detect free variable `global` from Node.js. */
317
-
318
- var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
319
-
320
- var _freeGlobal = freeGlobal$1;
321
-
322
- var freeGlobal = _freeGlobal;
323
-
324
- /** Detect free variable `self`. */
325
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
326
-
327
- /** Used as a reference to the global object. */
328
- var root$8 = freeGlobal || freeSelf || Function('return this')();
329
-
330
- var _root = root$8;
331
-
332
- var root$7 = _root;
333
-
334
- /** Built-in value references. */
335
- var Symbol$5 = root$7.Symbol;
336
-
337
- var _Symbol = Symbol$5;
338
-
339
- var Symbol$4 = _Symbol;
340
-
341
- /** Used for built-in method references. */
342
- var objectProto$f = Object.prototype;
343
-
344
- /** Used to check objects for own properties. */
345
- var hasOwnProperty$c = objectProto$f.hasOwnProperty;
346
-
347
- /**
348
- * Used to resolve the
349
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
350
- * of values.
351
- */
352
- var nativeObjectToString$1 = objectProto$f.toString;
353
-
354
- /** Built-in value references. */
355
- var symToStringTag$1 = Symbol$4 ? Symbol$4.toStringTag : undefined;
356
-
357
- /**
358
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
359
- *
360
- * @private
361
- * @param {*} value The value to query.
362
- * @returns {string} Returns the raw `toStringTag`.
363
- */
364
- function getRawTag$1(value) {
365
- var isOwn = hasOwnProperty$c.call(value, symToStringTag$1),
366
- tag = value[symToStringTag$1];
367
-
368
- try {
369
- value[symToStringTag$1] = undefined;
370
- var unmasked = true;
371
- } catch (e) {}
372
-
373
- var result = nativeObjectToString$1.call(value);
374
- if (unmasked) {
375
- if (isOwn) {
376
- value[symToStringTag$1] = tag;
377
- } else {
378
- delete value[symToStringTag$1];
379
- }
380
- }
381
- return result;
382
- }
383
-
384
- var _getRawTag = getRawTag$1;
385
-
386
- /** Used for built-in method references. */
387
-
388
- var objectProto$e = Object.prototype;
389
-
390
- /**
391
- * Used to resolve the
392
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
393
- * of values.
394
- */
395
- var nativeObjectToString = objectProto$e.toString;
396
-
397
- /**
398
- * Converts `value` to a string using `Object.prototype.toString`.
399
- *
400
- * @private
401
- * @param {*} value The value to convert.
402
- * @returns {string} Returns the converted string.
403
- */
404
- function objectToString$1(value) {
405
- return nativeObjectToString.call(value);
406
- }
407
-
408
- var _objectToString = objectToString$1;
409
-
410
- var Symbol$3 = _Symbol,
411
- getRawTag = _getRawTag,
412
- objectToString = _objectToString;
413
-
414
- /** `Object#toString` result references. */
415
- var nullTag = '[object Null]',
416
- undefinedTag = '[object Undefined]';
417
-
418
- /** Built-in value references. */
419
- var symToStringTag = Symbol$3 ? Symbol$3.toStringTag : undefined;
420
-
421
- /**
422
- * The base implementation of `getTag` without fallbacks for buggy environments.
423
- *
424
- * @private
425
- * @param {*} value The value to query.
426
- * @returns {string} Returns the `toStringTag`.
427
- */
428
- function baseGetTag$4(value) {
429
- if (value == null) {
430
- return value === undefined ? undefinedTag : nullTag;
431
- }
432
- return (symToStringTag && symToStringTag in Object(value))
433
- ? getRawTag(value)
434
- : objectToString(value);
435
- }
436
-
437
- var _baseGetTag = baseGetTag$4;
438
-
439
- /**
440
- * Checks if `value` is the
441
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
442
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
443
- *
444
- * @static
445
- * @memberOf _
446
- * @since 0.1.0
447
- * @category Lang
448
- * @param {*} value The value to check.
449
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
450
- * @example
451
- *
452
- * _.isObject({});
453
- * // => true
454
- *
455
- * _.isObject([1, 2, 3]);
456
- * // => true
457
- *
458
- * _.isObject(_.noop);
459
- * // => true
460
- *
461
- * _.isObject(null);
462
- * // => false
463
- */
464
-
465
- function isObject$5(value) {
466
- var type = typeof value;
467
- return value != null && (type == 'object' || type == 'function');
468
- }
469
-
470
- var isObject_1 = isObject$5;
471
-
472
- var baseGetTag$3 = _baseGetTag,
473
- isObject$4 = isObject_1;
474
-
475
- /** `Object#toString` result references. */
476
- var asyncTag = '[object AsyncFunction]',
477
- funcTag$2 = '[object Function]',
478
- genTag$1 = '[object GeneratorFunction]',
479
- proxyTag = '[object Proxy]';
480
-
481
- /**
482
- * Checks if `value` is classified as a `Function` object.
483
- *
484
- * @static
485
- * @memberOf _
486
- * @since 0.1.0
487
- * @category Lang
488
- * @param {*} value The value to check.
489
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
490
- * @example
491
- *
492
- * _.isFunction(_);
493
- * // => true
494
- *
495
- * _.isFunction(/abc/);
496
- * // => false
497
- */
498
- function isFunction$2(value) {
499
- if (!isObject$4(value)) {
500
- return false;
501
- }
502
- // The use of `Object#toString` avoids issues with the `typeof` operator
503
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
504
- var tag = baseGetTag$3(value);
505
- return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
506
- }
507
-
508
- var isFunction_1 = isFunction$2;
509
-
510
- var root$6 = _root;
511
-
512
- /** Used to detect overreaching core-js shims. */
513
- var coreJsData$1 = root$6['__core-js_shared__'];
514
-
515
- var _coreJsData = coreJsData$1;
516
-
517
- var coreJsData = _coreJsData;
518
-
519
- /** Used to detect methods masquerading as native. */
520
- var maskSrcKey = (function() {
521
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
522
- return uid ? ('Symbol(src)_1.' + uid) : '';
523
- }());
524
-
525
- /**
526
- * Checks if `func` has its source masked.
527
- *
528
- * @private
529
- * @param {Function} func The function to check.
530
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
531
- */
532
- function isMasked$1(func) {
533
- return !!maskSrcKey && (maskSrcKey in func);
534
- }
535
-
536
- var _isMasked = isMasked$1;
537
-
538
- /** Used for built-in method references. */
539
-
540
- var funcProto$1 = Function.prototype;
541
-
542
- /** Used to resolve the decompiled source of functions. */
543
- var funcToString$1 = funcProto$1.toString;
544
-
545
- /**
546
- * Converts `func` to its source code.
547
- *
548
- * @private
549
- * @param {Function} func The function to convert.
550
- * @returns {string} Returns the source code.
551
- */
552
- function toSource$2(func) {
553
- if (func != null) {
554
- try {
555
- return funcToString$1.call(func);
556
- } catch (e) {}
557
- try {
558
- return (func + '');
559
- } catch (e) {}
560
- }
561
- return '';
562
- }
563
-
564
- var _toSource = toSource$2;
565
-
566
- var isFunction$1 = isFunction_1,
567
- isMasked = _isMasked,
568
- isObject$3 = isObject_1,
569
- toSource$1 = _toSource;
570
-
571
- /**
572
- * Used to match `RegExp`
573
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
574
- */
575
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
576
-
577
- /** Used to detect host constructors (Safari). */
578
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
579
-
580
- /** Used for built-in method references. */
581
- var funcProto = Function.prototype,
582
- objectProto$d = Object.prototype;
583
-
584
- /** Used to resolve the decompiled source of functions. */
585
- var funcToString = funcProto.toString;
586
-
587
- /** Used to check objects for own properties. */
588
- var hasOwnProperty$b = objectProto$d.hasOwnProperty;
589
-
590
- /** Used to detect if a method is native. */
591
- var reIsNative = RegExp('^' +
592
- funcToString.call(hasOwnProperty$b).replace(reRegExpChar, '\\$&')
593
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
594
- );
595
-
596
- /**
597
- * The base implementation of `_.isNative` without bad shim checks.
598
- *
599
- * @private
600
- * @param {*} value The value to check.
601
- * @returns {boolean} Returns `true` if `value` is a native function,
602
- * else `false`.
603
- */
604
- function baseIsNative$1(value) {
605
- if (!isObject$3(value) || isMasked(value)) {
606
- return false;
607
- }
608
- var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
609
- return pattern.test(toSource$1(value));
610
- }
611
-
612
- var _baseIsNative = baseIsNative$1;
613
-
614
- /**
615
- * Gets the value at `key` of `object`.
616
- *
617
- * @private
618
- * @param {Object} [object] The object to query.
619
- * @param {string} key The key of the property to get.
620
- * @returns {*} Returns the property value.
621
- */
622
-
623
- function getValue$1(object, key) {
624
- return object == null ? undefined : object[key];
625
- }
626
-
627
- var _getValue = getValue$1;
628
-
629
- var baseIsNative = _baseIsNative,
630
- getValue = _getValue;
631
-
632
- /**
633
- * Gets the native function at `key` of `object`.
634
- *
635
- * @private
636
- * @param {Object} object The object to query.
637
- * @param {string} key The key of the method to get.
638
- * @returns {*} Returns the function if it's native, else `undefined`.
639
- */
640
- function getNative$7(object, key) {
641
- var value = getValue(object, key);
642
- return baseIsNative(value) ? value : undefined;
643
- }
644
-
645
- var _getNative = getNative$7;
646
-
647
- var getNative$6 = _getNative,
648
- root$5 = _root;
649
-
650
- /* Built-in method references that are verified to be native. */
651
- var Map$3 = getNative$6(root$5, 'Map');
652
-
653
- var _Map = Map$3;
654
-
655
- var getNative$5 = _getNative;
656
-
657
- /* Built-in method references that are verified to be native. */
658
- var nativeCreate$4 = getNative$5(Object, 'create');
659
-
660
- var _nativeCreate = nativeCreate$4;
661
-
662
- var nativeCreate$3 = _nativeCreate;
663
-
664
- /**
665
- * Removes all key-value entries from the hash.
666
- *
667
- * @private
668
- * @name clear
669
- * @memberOf Hash
670
- */
671
- function hashClear$1() {
672
- this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
673
- this.size = 0;
674
- }
675
-
676
- var _hashClear = hashClear$1;
677
-
678
- /**
679
- * Removes `key` and its value from the hash.
680
- *
681
- * @private
682
- * @name delete
683
- * @memberOf Hash
684
- * @param {Object} hash The hash to modify.
685
- * @param {string} key The key of the value to remove.
686
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
687
- */
688
-
689
- function hashDelete$1(key) {
690
- var result = this.has(key) && delete this.__data__[key];
691
- this.size -= result ? 1 : 0;
692
- return result;
693
- }
694
-
695
- var _hashDelete = hashDelete$1;
696
-
697
- var nativeCreate$2 = _nativeCreate;
698
-
699
- /** Used to stand-in for `undefined` hash values. */
700
- var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
701
-
702
- /** Used for built-in method references. */
703
- var objectProto$c = Object.prototype;
704
-
705
- /** Used to check objects for own properties. */
706
- var hasOwnProperty$a = objectProto$c.hasOwnProperty;
707
-
708
- /**
709
- * Gets the hash value for `key`.
710
- *
711
- * @private
712
- * @name get
713
- * @memberOf Hash
714
- * @param {string} key The key of the value to get.
715
- * @returns {*} Returns the entry value.
716
- */
717
- function hashGet$1(key) {
718
- var data = this.__data__;
719
- if (nativeCreate$2) {
720
- var result = data[key];
721
- return result === HASH_UNDEFINED$2 ? undefined : result;
722
- }
723
- return hasOwnProperty$a.call(data, key) ? data[key] : undefined;
724
- }
725
-
726
- var _hashGet = hashGet$1;
727
-
728
- var nativeCreate$1 = _nativeCreate;
729
-
730
- /** Used for built-in method references. */
731
- var objectProto$b = Object.prototype;
732
-
733
- /** Used to check objects for own properties. */
734
- var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
735
-
736
- /**
737
- * Checks if a hash value for `key` exists.
738
- *
739
- * @private
740
- * @name has
741
- * @memberOf Hash
742
- * @param {string} key The key of the entry to check.
743
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
744
- */
745
- function hashHas$1(key) {
746
- var data = this.__data__;
747
- return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$9.call(data, key);
748
- }
749
-
750
- var _hashHas = hashHas$1;
751
-
752
- var nativeCreate = _nativeCreate;
753
-
754
- /** Used to stand-in for `undefined` hash values. */
755
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
756
-
757
- /**
758
- * Sets the hash `key` to `value`.
759
- *
760
- * @private
761
- * @name set
762
- * @memberOf Hash
763
- * @param {string} key The key of the value to set.
764
- * @param {*} value The value to set.
765
- * @returns {Object} Returns the hash instance.
766
- */
767
- function hashSet$1(key, value) {
768
- var data = this.__data__;
769
- this.size += this.has(key) ? 0 : 1;
770
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
771
- return this;
772
- }
773
-
774
- var _hashSet = hashSet$1;
775
-
776
- var hashClear = _hashClear,
777
- hashDelete = _hashDelete,
778
- hashGet = _hashGet,
779
- hashHas = _hashHas,
780
- hashSet = _hashSet;
781
-
782
- /**
783
- * Creates a hash object.
784
- *
785
- * @private
786
- * @constructor
787
- * @param {Array} [entries] The key-value pairs to cache.
788
- */
789
- function Hash$1(entries) {
790
- var index = -1,
791
- length = entries == null ? 0 : entries.length;
792
-
793
- this.clear();
794
- while (++index < length) {
795
- var entry = entries[index];
796
- this.set(entry[0], entry[1]);
797
- }
798
- }
799
-
800
- // Add methods to `Hash`.
801
- Hash$1.prototype.clear = hashClear;
802
- Hash$1.prototype['delete'] = hashDelete;
803
- Hash$1.prototype.get = hashGet;
804
- Hash$1.prototype.has = hashHas;
805
- Hash$1.prototype.set = hashSet;
806
-
807
- var _Hash = Hash$1;
808
-
809
- var Hash = _Hash,
810
- ListCache$2 = _ListCache,
811
- Map$2 = _Map;
812
-
813
- /**
814
- * Removes all key-value entries from the map.
815
- *
816
- * @private
817
- * @name clear
818
- * @memberOf MapCache
819
- */
820
- function mapCacheClear$1() {
821
- this.size = 0;
822
- this.__data__ = {
823
- 'hash': new Hash,
824
- 'map': new (Map$2 || ListCache$2),
825
- 'string': new Hash
826
- };
827
- }
828
-
829
- var _mapCacheClear = mapCacheClear$1;
830
-
831
- /**
832
- * Checks if `value` is suitable for use as unique object key.
833
- *
834
- * @private
835
- * @param {*} value The value to check.
836
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
837
- */
838
-
839
- function isKeyable$1(value) {
840
- var type = typeof value;
841
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
842
- ? (value !== '__proto__')
843
- : (value === null);
844
- }
845
-
846
- var _isKeyable = isKeyable$1;
847
-
848
- var isKeyable = _isKeyable;
849
-
850
- /**
851
- * Gets the data for `map`.
852
- *
853
- * @private
854
- * @param {Object} map The map to query.
855
- * @param {string} key The reference key.
856
- * @returns {*} Returns the map data.
857
- */
858
- function getMapData$4(map, key) {
859
- var data = map.__data__;
860
- return isKeyable(key)
861
- ? data[typeof key == 'string' ? 'string' : 'hash']
862
- : data.map;
863
- }
864
-
865
- var _getMapData = getMapData$4;
866
-
867
- var getMapData$3 = _getMapData;
868
-
869
- /**
870
- * Removes `key` and its value from the map.
871
- *
872
- * @private
873
- * @name delete
874
- * @memberOf MapCache
875
- * @param {string} key The key of the value to remove.
876
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
877
- */
878
- function mapCacheDelete$1(key) {
879
- var result = getMapData$3(this, key)['delete'](key);
880
- this.size -= result ? 1 : 0;
881
- return result;
882
- }
883
-
884
- var _mapCacheDelete = mapCacheDelete$1;
885
-
886
- var getMapData$2 = _getMapData;
887
-
888
- /**
889
- * Gets the map value for `key`.
890
- *
891
- * @private
892
- * @name get
893
- * @memberOf MapCache
894
- * @param {string} key The key of the value to get.
895
- * @returns {*} Returns the entry value.
896
- */
897
- function mapCacheGet$1(key) {
898
- return getMapData$2(this, key).get(key);
899
- }
900
-
901
- var _mapCacheGet = mapCacheGet$1;
902
-
903
- var getMapData$1 = _getMapData;
904
-
905
- /**
906
- * Checks if a map value for `key` exists.
907
- *
908
- * @private
909
- * @name has
910
- * @memberOf MapCache
911
- * @param {string} key The key of the entry to check.
912
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
913
- */
914
- function mapCacheHas$1(key) {
915
- return getMapData$1(this, key).has(key);
916
- }
917
-
918
- var _mapCacheHas = mapCacheHas$1;
919
-
920
- var getMapData = _getMapData;
921
-
922
- /**
923
- * Sets the map `key` to `value`.
924
- *
925
- * @private
926
- * @name set
927
- * @memberOf MapCache
928
- * @param {string} key The key of the value to set.
929
- * @param {*} value The value to set.
930
- * @returns {Object} Returns the map cache instance.
931
- */
932
- function mapCacheSet$1(key, value) {
933
- var data = getMapData(this, key),
934
- size = data.size;
935
-
936
- data.set(key, value);
937
- this.size += data.size == size ? 0 : 1;
938
- return this;
939
- }
940
-
941
- var _mapCacheSet = mapCacheSet$1;
942
-
943
- var mapCacheClear = _mapCacheClear,
944
- mapCacheDelete = _mapCacheDelete,
945
- mapCacheGet = _mapCacheGet,
946
- mapCacheHas = _mapCacheHas,
947
- mapCacheSet = _mapCacheSet;
948
-
949
- /**
950
- * Creates a map cache object to store key-value pairs.
951
- *
952
- * @private
953
- * @constructor
954
- * @param {Array} [entries] The key-value pairs to cache.
955
- */
956
- function MapCache$2(entries) {
957
- var index = -1,
958
- length = entries == null ? 0 : entries.length;
959
-
960
- this.clear();
961
- while (++index < length) {
962
- var entry = entries[index];
963
- this.set(entry[0], entry[1]);
964
- }
965
- }
966
-
967
- // Add methods to `MapCache`.
968
- MapCache$2.prototype.clear = mapCacheClear;
969
- MapCache$2.prototype['delete'] = mapCacheDelete;
970
- MapCache$2.prototype.get = mapCacheGet;
971
- MapCache$2.prototype.has = mapCacheHas;
972
- MapCache$2.prototype.set = mapCacheSet;
973
-
974
- var _MapCache = MapCache$2;
975
-
976
- var ListCache$1 = _ListCache,
977
- Map$1 = _Map,
978
- MapCache$1 = _MapCache;
979
-
980
- /** Used as the size to enable large array optimizations. */
981
- var LARGE_ARRAY_SIZE = 200;
982
-
983
- /**
984
- * Sets the stack `key` to `value`.
985
- *
986
- * @private
987
- * @name set
988
- * @memberOf Stack
989
- * @param {string} key The key of the value to set.
990
- * @param {*} value The value to set.
991
- * @returns {Object} Returns the stack cache instance.
992
- */
993
- function stackSet$1(key, value) {
994
- var data = this.__data__;
995
- if (data instanceof ListCache$1) {
996
- var pairs = data.__data__;
997
- if (!Map$1 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
998
- pairs.push([key, value]);
999
- this.size = ++data.size;
1000
- return this;
1001
- }
1002
- data = this.__data__ = new MapCache$1(pairs);
1003
- }
1004
- data.set(key, value);
1005
- this.size = data.size;
1006
- return this;
1007
- }
1008
-
1009
- var _stackSet = stackSet$1;
1010
-
1011
- var ListCache = _ListCache,
1012
- stackClear = _stackClear,
1013
- stackDelete = _stackDelete,
1014
- stackGet = _stackGet,
1015
- stackHas = _stackHas,
1016
- stackSet = _stackSet;
1017
-
1018
- /**
1019
- * Creates a stack cache object to store key-value pairs.
1020
- *
1021
- * @private
1022
- * @constructor
1023
- * @param {Array} [entries] The key-value pairs to cache.
1024
- */
1025
- function Stack$2(entries) {
1026
- var data = this.__data__ = new ListCache(entries);
1027
- this.size = data.size;
1028
- }
1029
-
1030
- // Add methods to `Stack`.
1031
- Stack$2.prototype.clear = stackClear;
1032
- Stack$2.prototype['delete'] = stackDelete;
1033
- Stack$2.prototype.get = stackGet;
1034
- Stack$2.prototype.has = stackHas;
1035
- Stack$2.prototype.set = stackSet;
1036
-
1037
- var _Stack = Stack$2;
1038
-
1039
- /** Used to stand-in for `undefined` hash values. */
1040
-
1041
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1042
-
1043
- /**
1044
- * Adds `value` to the array cache.
1045
- *
1046
- * @private
1047
- * @name add
1048
- * @memberOf SetCache
1049
- * @alias push
1050
- * @param {*} value The value to cache.
1051
- * @returns {Object} Returns the cache instance.
1052
- */
1053
- function setCacheAdd$1(value) {
1054
- this.__data__.set(value, HASH_UNDEFINED);
1055
- return this;
1056
- }
1057
-
1058
- var _setCacheAdd = setCacheAdd$1;
1059
-
1060
- /**
1061
- * Checks if `value` is in the array cache.
1062
- *
1063
- * @private
1064
- * @name has
1065
- * @memberOf SetCache
1066
- * @param {*} value The value to search for.
1067
- * @returns {number} Returns `true` if `value` is found, else `false`.
1068
- */
1069
-
1070
- function setCacheHas$1(value) {
1071
- return this.__data__.has(value);
1072
- }
1073
-
1074
- var _setCacheHas = setCacheHas$1;
1075
-
1076
- var MapCache = _MapCache,
1077
- setCacheAdd = _setCacheAdd,
1078
- setCacheHas = _setCacheHas;
1079
-
1080
- /**
1081
- *
1082
- * Creates an array cache object to store unique values.
1083
- *
1084
- * @private
1085
- * @constructor
1086
- * @param {Array} [values] The values to cache.
1087
- */
1088
- function SetCache$1(values) {
1089
- var index = -1,
1090
- length = values == null ? 0 : values.length;
1091
-
1092
- this.__data__ = new MapCache;
1093
- while (++index < length) {
1094
- this.add(values[index]);
1095
- }
1096
- }
1097
-
1098
- // Add methods to `SetCache`.
1099
- SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
1100
- SetCache$1.prototype.has = setCacheHas;
1101
-
1102
- var _SetCache = SetCache$1;
1103
-
1104
- /**
1105
- * A specialized version of `_.some` for arrays without support for iteratee
1106
- * shorthands.
1107
- *
1108
- * @private
1109
- * @param {Array} [array] The array to iterate over.
1110
- * @param {Function} predicate The function invoked per iteration.
1111
- * @returns {boolean} Returns `true` if any element passes the predicate check,
1112
- * else `false`.
1113
- */
1114
-
1115
- function arraySome$1(array, predicate) {
1116
- var index = -1,
1117
- length = array == null ? 0 : array.length;
1118
-
1119
- while (++index < length) {
1120
- if (predicate(array[index], index, array)) {
1121
- return true;
1122
- }
1123
- }
1124
- return false;
1125
- }
1126
-
1127
- var _arraySome = arraySome$1;
1128
-
1129
- /**
1130
- * Checks if a `cache` value for `key` exists.
1131
- *
1132
- * @private
1133
- * @param {Object} cache The cache to query.
1134
- * @param {string} key The key of the entry to check.
1135
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1136
- */
1137
-
1138
- function cacheHas$1(cache, key) {
1139
- return cache.has(key);
1140
- }
1141
-
1142
- var _cacheHas = cacheHas$1;
1143
-
1144
- var SetCache = _SetCache,
1145
- arraySome = _arraySome,
1146
- cacheHas = _cacheHas;
1147
-
1148
- /** Used to compose bitmasks for value comparisons. */
1149
- var COMPARE_PARTIAL_FLAG$3 = 1,
1150
- COMPARE_UNORDERED_FLAG$1 = 2;
1151
-
1152
- /**
1153
- * A specialized version of `baseIsEqualDeep` for arrays with support for
1154
- * partial deep comparisons.
1155
- *
1156
- * @private
1157
- * @param {Array} array The array to compare.
1158
- * @param {Array} other The other array to compare.
1159
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1160
- * @param {Function} customizer The function to customize comparisons.
1161
- * @param {Function} equalFunc The function to determine equivalents of values.
1162
- * @param {Object} stack Tracks traversed `array` and `other` objects.
1163
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
1164
- */
1165
- function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
1166
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
1167
- arrLength = array.length,
1168
- othLength = other.length;
1169
-
1170
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1171
- return false;
1172
- }
1173
- // Check that cyclic values are equal.
1174
- var arrStacked = stack.get(array);
1175
- var othStacked = stack.get(other);
1176
- if (arrStacked && othStacked) {
1177
- return arrStacked == other && othStacked == array;
1178
- }
1179
- var index = -1,
1180
- result = true,
1181
- seen = (bitmask & COMPARE_UNORDERED_FLAG$1) ? new SetCache : undefined;
1182
-
1183
- stack.set(array, other);
1184
- stack.set(other, array);
1185
-
1186
- // Ignore non-index properties.
1187
- while (++index < arrLength) {
1188
- var arrValue = array[index],
1189
- othValue = other[index];
1190
-
1191
- if (customizer) {
1192
- var compared = isPartial
1193
- ? customizer(othValue, arrValue, index, other, array, stack)
1194
- : customizer(arrValue, othValue, index, array, other, stack);
1195
- }
1196
- if (compared !== undefined) {
1197
- if (compared) {
1198
- continue;
1199
- }
1200
- result = false;
1201
- break;
1202
- }
1203
- // Recursively compare arrays (susceptible to call stack limits).
1204
- if (seen) {
1205
- if (!arraySome(other, function(othValue, othIndex) {
1206
- if (!cacheHas(seen, othIndex) &&
1207
- (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1208
- return seen.push(othIndex);
1209
- }
1210
- })) {
1211
- result = false;
1212
- break;
1213
- }
1214
- } else if (!(
1215
- arrValue === othValue ||
1216
- equalFunc(arrValue, othValue, bitmask, customizer, stack)
1217
- )) {
1218
- result = false;
1219
- break;
1220
- }
1221
- }
1222
- stack['delete'](array);
1223
- stack['delete'](other);
1224
- return result;
1225
- }
1226
-
1227
- var _equalArrays = equalArrays$2;
1228
-
1229
- var root$4 = _root;
1230
-
1231
- /** Built-in value references. */
1232
- var Uint8Array$2 = root$4.Uint8Array;
1233
-
1234
- var _Uint8Array = Uint8Array$2;
1235
-
1236
- /**
1237
- * Converts `map` to its key-value pairs.
1238
- *
1239
- * @private
1240
- * @param {Object} map The map to convert.
1241
- * @returns {Array} Returns the key-value pairs.
1242
- */
1243
-
1244
- function mapToArray$1(map) {
1245
- var index = -1,
1246
- result = Array(map.size);
1247
-
1248
- map.forEach(function(value, key) {
1249
- result[++index] = [key, value];
1250
- });
1251
- return result;
1252
- }
1253
-
1254
- var _mapToArray = mapToArray$1;
1255
-
1256
- /**
1257
- * Converts `set` to an array of its values.
1258
- *
1259
- * @private
1260
- * @param {Object} set The set to convert.
1261
- * @returns {Array} Returns the values.
1262
- */
1263
-
1264
- function setToArray$1(set) {
1265
- var index = -1,
1266
- result = Array(set.size);
1267
-
1268
- set.forEach(function(value) {
1269
- result[++index] = value;
1270
- });
1271
- return result;
1272
- }
1273
-
1274
- var _setToArray = setToArray$1;
1275
-
1276
- var Symbol$2 = _Symbol,
1277
- Uint8Array$1 = _Uint8Array,
1278
- eq$1 = eq_1,
1279
- equalArrays$1 = _equalArrays,
1280
- mapToArray = _mapToArray,
1281
- setToArray = _setToArray;
1282
-
1283
- /** Used to compose bitmasks for value comparisons. */
1284
- var COMPARE_PARTIAL_FLAG$2 = 1,
1285
- COMPARE_UNORDERED_FLAG = 2;
1286
-
1287
- /** `Object#toString` result references. */
1288
- var boolTag$3 = '[object Boolean]',
1289
- dateTag$3 = '[object Date]',
1290
- errorTag$2 = '[object Error]',
1291
- mapTag$6 = '[object Map]',
1292
- numberTag$3 = '[object Number]',
1293
- regexpTag$3 = '[object RegExp]',
1294
- setTag$6 = '[object Set]',
1295
- stringTag$3 = '[object String]',
1296
- symbolTag$2 = '[object Symbol]';
1297
-
1298
- var arrayBufferTag$3 = '[object ArrayBuffer]',
1299
- dataViewTag$4 = '[object DataView]';
1300
-
1301
- /** Used to convert symbols to primitives and strings. */
1302
- var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : undefined,
1303
- symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : undefined;
1304
-
1305
- /**
1306
- * A specialized version of `baseIsEqualDeep` for comparing objects of
1307
- * the same `toStringTag`.
1308
- *
1309
- * **Note:** This function only supports comparing values with tags of
1310
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1311
- *
1312
- * @private
1313
- * @param {Object} object The object to compare.
1314
- * @param {Object} other The other object to compare.
1315
- * @param {string} tag The `toStringTag` of the objects to compare.
1316
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1317
- * @param {Function} customizer The function to customize comparisons.
1318
- * @param {Function} equalFunc The function to determine equivalents of values.
1319
- * @param {Object} stack Tracks traversed `object` and `other` objects.
1320
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1321
- */
1322
- function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack) {
1323
- switch (tag) {
1324
- case dataViewTag$4:
1325
- if ((object.byteLength != other.byteLength) ||
1326
- (object.byteOffset != other.byteOffset)) {
1327
- return false;
1328
- }
1329
- object = object.buffer;
1330
- other = other.buffer;
1331
-
1332
- case arrayBufferTag$3:
1333
- if ((object.byteLength != other.byteLength) ||
1334
- !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
1335
- return false;
1336
- }
1337
- return true;
1338
-
1339
- case boolTag$3:
1340
- case dateTag$3:
1341
- case numberTag$3:
1342
- // Coerce booleans to `1` or `0` and dates to milliseconds.
1343
- // Invalid dates are coerced to `NaN`.
1344
- return eq$1(+object, +other);
1345
-
1346
- case errorTag$2:
1347
- return object.name == other.name && object.message == other.message;
1348
-
1349
- case regexpTag$3:
1350
- case stringTag$3:
1351
- // Coerce regexes to strings and treat strings, primitives and objects,
1352
- // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1353
- // for more details.
1354
- return object == (other + '');
1355
-
1356
- case mapTag$6:
1357
- var convert = mapToArray;
1358
-
1359
- case setTag$6:
1360
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
1361
- convert || (convert = setToArray);
1362
-
1363
- if (object.size != other.size && !isPartial) {
1364
- return false;
1365
- }
1366
- // Assume cyclic values are equal.
1367
- var stacked = stack.get(object);
1368
- if (stacked) {
1369
- return stacked == other;
1370
- }
1371
- bitmask |= COMPARE_UNORDERED_FLAG;
1372
-
1373
- // Recursively compare objects (susceptible to call stack limits).
1374
- stack.set(object, other);
1375
- var result = equalArrays$1(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1376
- stack['delete'](object);
1377
- return result;
1378
-
1379
- case symbolTag$2:
1380
- if (symbolValueOf$1) {
1381
- return symbolValueOf$1.call(object) == symbolValueOf$1.call(other);
1382
- }
1383
- }
1384
- return false;
1385
- }
1386
-
1387
- var _equalByTag = equalByTag$1;
1388
-
1389
- /**
1390
- * Appends the elements of `values` to `array`.
1391
- *
1392
- * @private
1393
- * @param {Array} array The array to modify.
1394
- * @param {Array} values The values to append.
1395
- * @returns {Array} Returns `array`.
1396
- */
1397
-
1398
- function arrayPush$2(array, values) {
1399
- var index = -1,
1400
- length = values.length,
1401
- offset = array.length;
1402
-
1403
- while (++index < length) {
1404
- array[offset + index] = values[index];
1405
- }
1406
- return array;
1407
- }
1408
-
1409
- var _arrayPush = arrayPush$2;
1410
-
1411
- /**
1412
- * Checks if `value` is classified as an `Array` object.
1413
- *
1414
- * @static
1415
- * @memberOf _
1416
- * @since 0.1.0
1417
- * @category Lang
1418
- * @param {*} value The value to check.
1419
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1420
- * @example
1421
- *
1422
- * _.isArray([1, 2, 3]);
1423
- * // => true
1424
- *
1425
- * _.isArray(document.body.children);
1426
- * // => false
1427
- *
1428
- * _.isArray('abc');
1429
- * // => false
1430
- *
1431
- * _.isArray(_.noop);
1432
- * // => false
1433
- */
1434
-
1435
- var isArray$5 = Array.isArray;
1436
-
1437
- var isArray_1 = isArray$5;
1438
-
1439
- var arrayPush$1 = _arrayPush,
1440
- isArray$4 = isArray_1;
1441
-
1442
- /**
1443
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1444
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1445
- * symbols of `object`.
1446
- *
1447
- * @private
1448
- * @param {Object} object The object to query.
1449
- * @param {Function} keysFunc The function to get the keys of `object`.
1450
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
1451
- * @returns {Array} Returns the array of property names and symbols.
1452
- */
1453
- function baseGetAllKeys$2(object, keysFunc, symbolsFunc) {
1454
- var result = keysFunc(object);
1455
- return isArray$4(object) ? result : arrayPush$1(result, symbolsFunc(object));
1456
- }
1457
-
1458
- var _baseGetAllKeys = baseGetAllKeys$2;
1459
-
1460
- /**
1461
- * A specialized version of `_.filter` for arrays without support for
1462
- * iteratee shorthands.
1463
- *
1464
- * @private
1465
- * @param {Array} [array] The array to iterate over.
1466
- * @param {Function} predicate The function invoked per iteration.
1467
- * @returns {Array} Returns the new filtered array.
1468
- */
1469
-
1470
- function arrayFilter$1(array, predicate) {
1471
- var index = -1,
1472
- length = array == null ? 0 : array.length,
1473
- resIndex = 0,
1474
- result = [];
1475
-
1476
- while (++index < length) {
1477
- var value = array[index];
1478
- if (predicate(value, index, array)) {
1479
- result[resIndex++] = value;
1480
- }
1481
- }
1482
- return result;
1483
- }
1484
-
1485
- var _arrayFilter = arrayFilter$1;
1486
-
1487
- /**
1488
- * This method returns a new empty array.
1489
- *
1490
- * @static
1491
- * @memberOf _
1492
- * @since 4.13.0
1493
- * @category Util
1494
- * @returns {Array} Returns the new empty array.
1495
- * @example
1496
- *
1497
- * var arrays = _.times(2, _.stubArray);
1498
- *
1499
- * console.log(arrays);
1500
- * // => [[], []]
1501
- *
1502
- * console.log(arrays[0] === arrays[1]);
1503
- * // => false
1504
- */
1505
-
1506
- function stubArray$2() {
1507
- return [];
1508
- }
1509
-
1510
- var stubArray_1 = stubArray$2;
1511
-
1512
- var arrayFilter = _arrayFilter,
1513
- stubArray$1 = stubArray_1;
1514
-
1515
- /** Used for built-in method references. */
1516
- var objectProto$a = Object.prototype;
1517
-
1518
- /** Built-in value references. */
1519
- var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
1520
-
1521
- /* Built-in method references for those with the same name as other `lodash` methods. */
1522
- var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
1523
-
1524
- /**
1525
- * Creates an array of the own enumerable symbols of `object`.
1526
- *
1527
- * @private
1528
- * @param {Object} object The object to query.
1529
- * @returns {Array} Returns the array of symbols.
1530
- */
1531
- var getSymbols$3 = !nativeGetSymbols$1 ? stubArray$1 : function(object) {
1532
- if (object == null) {
1533
- return [];
1534
- }
1535
- object = Object(object);
1536
- return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
1537
- return propertyIsEnumerable$1.call(object, symbol);
1538
- });
1539
- };
1540
-
1541
- var _getSymbols = getSymbols$3;
1542
-
1543
- /**
1544
- * The base implementation of `_.times` without support for iteratee shorthands
1545
- * or max array length checks.
1546
- *
1547
- * @private
1548
- * @param {number} n The number of times to invoke `iteratee`.
1549
- * @param {Function} iteratee The function invoked per iteration.
1550
- * @returns {Array} Returns the array of results.
1551
- */
1552
-
1553
- function baseTimes$1(n, iteratee) {
1554
- var index = -1,
1555
- result = Array(n);
1556
-
1557
- while (++index < n) {
1558
- result[index] = iteratee(index);
1559
- }
1560
- return result;
1561
- }
1562
-
1563
- var _baseTimes = baseTimes$1;
1564
-
1565
- /**
1566
- * Checks if `value` is object-like. A value is object-like if it's not `null`
1567
- * and has a `typeof` result of "object".
1568
- *
1569
- * @static
1570
- * @memberOf _
1571
- * @since 4.0.0
1572
- * @category Lang
1573
- * @param {*} value The value to check.
1574
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1575
- * @example
1576
- *
1577
- * _.isObjectLike({});
1578
- * // => true
1579
- *
1580
- * _.isObjectLike([1, 2, 3]);
1581
- * // => true
1582
- *
1583
- * _.isObjectLike(_.noop);
1584
- * // => false
1585
- *
1586
- * _.isObjectLike(null);
1587
- * // => false
1588
- */
1589
-
1590
- function isObjectLike$6(value) {
1591
- return value != null && typeof value == 'object';
1592
- }
1593
-
1594
- var isObjectLike_1 = isObjectLike$6;
1595
-
1596
- var baseGetTag$2 = _baseGetTag,
1597
- isObjectLike$5 = isObjectLike_1;
1598
-
1599
- /** `Object#toString` result references. */
1600
- var argsTag$3 = '[object Arguments]';
1601
-
1602
- /**
1603
- * The base implementation of `_.isArguments`.
1604
- *
1605
- * @private
1606
- * @param {*} value The value to check.
1607
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1608
- */
1609
- function baseIsArguments$1(value) {
1610
- return isObjectLike$5(value) && baseGetTag$2(value) == argsTag$3;
1611
- }
1612
-
1613
- var _baseIsArguments = baseIsArguments$1;
1614
-
1615
- var baseIsArguments = _baseIsArguments,
1616
- isObjectLike$4 = isObjectLike_1;
1617
-
1618
- /** Used for built-in method references. */
1619
- var objectProto$9 = Object.prototype;
1620
-
1621
- /** Used to check objects for own properties. */
1622
- var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
1623
-
1624
- /** Built-in value references. */
1625
- var propertyIsEnumerable = objectProto$9.propertyIsEnumerable;
1626
-
1627
- /**
1628
- * Checks if `value` is likely an `arguments` object.
1629
- *
1630
- * @static
1631
- * @memberOf _
1632
- * @since 0.1.0
1633
- * @category Lang
1634
- * @param {*} value The value to check.
1635
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1636
- * else `false`.
1637
- * @example
1638
- *
1639
- * _.isArguments(function() { return arguments; }());
1640
- * // => true
1641
- *
1642
- * _.isArguments([1, 2, 3]);
1643
- * // => false
1644
- */
1645
- var isArguments$2 = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
1646
- return isObjectLike$4(value) && hasOwnProperty$8.call(value, 'callee') &&
1647
- !propertyIsEnumerable.call(value, 'callee');
1648
- };
1649
-
1650
- var isArguments_1 = isArguments$2;
1651
-
1652
- var isBuffer$4 = {exports: {}};
1653
-
1654
- /**
1655
- * This method returns `false`.
1656
- *
1657
- * @static
1658
- * @memberOf _
1659
- * @since 4.13.0
1660
- * @category Util
1661
- * @returns {boolean} Returns `false`.
1662
- * @example
1663
- *
1664
- * _.times(2, _.stubFalse);
1665
- * // => [false, false]
1666
- */
1667
-
1668
- function stubFalse() {
1669
- return false;
1670
- }
1671
-
1672
- var stubFalse_1 = stubFalse;
1673
-
1674
- (function (module, exports) {
1675
- var root = _root,
1676
- stubFalse = stubFalse_1;
1677
-
1678
- /** Detect free variable `exports`. */
1679
- var freeExports = exports && !exports.nodeType && exports;
1680
-
1681
- /** Detect free variable `module`. */
1682
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1683
-
1684
- /** Detect the popular CommonJS extension `module.exports`. */
1685
- var moduleExports = freeModule && freeModule.exports === freeExports;
1686
-
1687
- /** Built-in value references. */
1688
- var Buffer = moduleExports ? root.Buffer : undefined;
1689
-
1690
- /* Built-in method references for those with the same name as other `lodash` methods. */
1691
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
1692
-
1693
- /**
1694
- * Checks if `value` is a buffer.
1695
- *
1696
- * @static
1697
- * @memberOf _
1698
- * @since 4.3.0
1699
- * @category Lang
1700
- * @param {*} value The value to check.
1701
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1702
- * @example
1703
- *
1704
- * _.isBuffer(new Buffer(2));
1705
- * // => true
1706
- *
1707
- * _.isBuffer(new Uint8Array(2));
1708
- * // => false
1709
- */
1710
- var isBuffer = nativeIsBuffer || stubFalse;
1711
-
1712
- module.exports = isBuffer;
1713
- }(isBuffer$4, isBuffer$4.exports));
1714
-
1715
- /** Used as references for various `Number` constants. */
1716
-
1717
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
1718
-
1719
- /** Used to detect unsigned integer values. */
1720
- var reIsUint = /^(?:0|[1-9]\d*)$/;
1721
-
1722
- /**
1723
- * Checks if `value` is a valid array-like index.
1724
- *
1725
- * @private
1726
- * @param {*} value The value to check.
1727
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1728
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1729
- */
1730
- function isIndex$1(value, length) {
1731
- var type = typeof value;
1732
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
1733
-
1734
- return !!length &&
1735
- (type == 'number' ||
1736
- (type != 'symbol' && reIsUint.test(value))) &&
1737
- (value > -1 && value % 1 == 0 && value < length);
1738
- }
1739
-
1740
- var _isIndex = isIndex$1;
1741
-
1742
- /** Used as references for various `Number` constants. */
1743
-
1744
- var MAX_SAFE_INTEGER = 9007199254740991;
1745
-
1746
- /**
1747
- * Checks if `value` is a valid array-like length.
1748
- *
1749
- * **Note:** This method is loosely based on
1750
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1751
- *
1752
- * @static
1753
- * @memberOf _
1754
- * @since 4.0.0
1755
- * @category Lang
1756
- * @param {*} value The value to check.
1757
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1758
- * @example
1759
- *
1760
- * _.isLength(3);
1761
- * // => true
1762
- *
1763
- * _.isLength(Number.MIN_VALUE);
1764
- * // => false
1765
- *
1766
- * _.isLength(Infinity);
1767
- * // => false
1768
- *
1769
- * _.isLength('3');
1770
- * // => false
1771
- */
1772
- function isLength$2(value) {
1773
- return typeof value == 'number' &&
1774
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1775
- }
1776
-
1777
- var isLength_1 = isLength$2;
1778
-
1779
- var baseGetTag$1 = _baseGetTag,
1780
- isLength$1 = isLength_1,
1781
- isObjectLike$3 = isObjectLike_1;
1782
-
1783
- /** `Object#toString` result references. */
1784
- var argsTag$2 = '[object Arguments]',
1785
- arrayTag$2 = '[object Array]',
1786
- boolTag$2 = '[object Boolean]',
1787
- dateTag$2 = '[object Date]',
1788
- errorTag$1 = '[object Error]',
1789
- funcTag$1 = '[object Function]',
1790
- mapTag$5 = '[object Map]',
1791
- numberTag$2 = '[object Number]',
1792
- objectTag$3 = '[object Object]',
1793
- regexpTag$2 = '[object RegExp]',
1794
- setTag$5 = '[object Set]',
1795
- stringTag$2 = '[object String]',
1796
- weakMapTag$2 = '[object WeakMap]';
1797
-
1798
- var arrayBufferTag$2 = '[object ArrayBuffer]',
1799
- dataViewTag$3 = '[object DataView]',
1800
- float32Tag$2 = '[object Float32Array]',
1801
- float64Tag$2 = '[object Float64Array]',
1802
- int8Tag$2 = '[object Int8Array]',
1803
- int16Tag$2 = '[object Int16Array]',
1804
- int32Tag$2 = '[object Int32Array]',
1805
- uint8Tag$2 = '[object Uint8Array]',
1806
- uint8ClampedTag$2 = '[object Uint8ClampedArray]',
1807
- uint16Tag$2 = '[object Uint16Array]',
1808
- uint32Tag$2 = '[object Uint32Array]';
1809
-
1810
- /** Used to identify `toStringTag` values of typed arrays. */
1811
- var typedArrayTags = {};
1812
- typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
1813
- typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
1814
- typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
1815
- typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
1816
- typedArrayTags[uint32Tag$2] = true;
1817
- typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] =
1818
- typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
1819
- typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
1820
- typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
1821
- typedArrayTags[mapTag$5] = typedArrayTags[numberTag$2] =
1822
- typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$2] =
1823
- typedArrayTags[setTag$5] = typedArrayTags[stringTag$2] =
1824
- typedArrayTags[weakMapTag$2] = false;
1825
-
1826
- /**
1827
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
1828
- *
1829
- * @private
1830
- * @param {*} value The value to check.
1831
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1832
- */
1833
- function baseIsTypedArray$1(value) {
1834
- return isObjectLike$3(value) &&
1835
- isLength$1(value.length) && !!typedArrayTags[baseGetTag$1(value)];
1836
- }
1837
-
1838
- var _baseIsTypedArray = baseIsTypedArray$1;
1839
-
1840
- /**
1841
- * The base implementation of `_.unary` without support for storing metadata.
1842
- *
1843
- * @private
1844
- * @param {Function} func The function to cap arguments for.
1845
- * @returns {Function} Returns the new capped function.
1846
- */
1847
-
1848
- function baseUnary$3(func) {
1849
- return function(value) {
1850
- return func(value);
1851
- };
1852
- }
1853
-
1854
- var _baseUnary = baseUnary$3;
1855
-
1856
- var _nodeUtil = {exports: {}};
1857
-
1858
- (function (module, exports) {
1859
- var freeGlobal = _freeGlobal;
1860
-
1861
- /** Detect free variable `exports`. */
1862
- var freeExports = exports && !exports.nodeType && exports;
1863
-
1864
- /** Detect free variable `module`. */
1865
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1866
-
1867
- /** Detect the popular CommonJS extension `module.exports`. */
1868
- var moduleExports = freeModule && freeModule.exports === freeExports;
1869
-
1870
- /** Detect free variable `process` from Node.js. */
1871
- var freeProcess = moduleExports && freeGlobal.process;
1872
-
1873
- /** Used to access faster Node.js helpers. */
1874
- var nodeUtil = (function() {
1875
- try {
1876
- // Use `util.types` for Node.js 10+.
1877
- var types = freeModule && freeModule.require && freeModule.require('util').types;
1878
-
1879
- if (types) {
1880
- return types;
1881
- }
1882
-
1883
- // Legacy `process.binding('util')` for Node.js < 10.
1884
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
1885
- } catch (e) {}
1886
- }());
1887
-
1888
- module.exports = nodeUtil;
1889
- }(_nodeUtil, _nodeUtil.exports));
1890
-
1891
- var baseIsTypedArray = _baseIsTypedArray,
1892
- baseUnary$2 = _baseUnary,
1893
- nodeUtil$2 = _nodeUtil.exports;
1894
-
1895
- /* Node.js helper references. */
1896
- var nodeIsTypedArray = nodeUtil$2 && nodeUtil$2.isTypedArray;
1897
-
1898
- /**
1899
- * Checks if `value` is classified as a typed array.
1900
- *
1901
- * @static
1902
- * @memberOf _
1903
- * @since 3.0.0
1904
- * @category Lang
1905
- * @param {*} value The value to check.
1906
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1907
- * @example
1908
- *
1909
- * _.isTypedArray(new Uint8Array);
1910
- * // => true
1911
- *
1912
- * _.isTypedArray([]);
1913
- * // => false
1914
- */
1915
- var isTypedArray$3 = nodeIsTypedArray ? baseUnary$2(nodeIsTypedArray) : baseIsTypedArray;
1916
-
1917
- var isTypedArray_1 = isTypedArray$3;
1918
-
1919
- var baseTimes = _baseTimes,
1920
- isArguments$1 = isArguments_1,
1921
- isArray$3 = isArray_1,
1922
- isBuffer$3 = isBuffer$4.exports,
1923
- isIndex = _isIndex,
1924
- isTypedArray$2 = isTypedArray_1;
1925
-
1926
- /** Used for built-in method references. */
1927
- var objectProto$8 = Object.prototype;
1928
-
1929
- /** Used to check objects for own properties. */
1930
- var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
1931
-
1932
- /**
1933
- * Creates an array of the enumerable property names of the array-like `value`.
1934
- *
1935
- * @private
1936
- * @param {*} value The value to query.
1937
- * @param {boolean} inherited Specify returning inherited property names.
1938
- * @returns {Array} Returns the array of property names.
1939
- */
1940
- function arrayLikeKeys$2(value, inherited) {
1941
- var isArr = isArray$3(value),
1942
- isArg = !isArr && isArguments$1(value),
1943
- isBuff = !isArr && !isArg && isBuffer$3(value),
1944
- isType = !isArr && !isArg && !isBuff && isTypedArray$2(value),
1945
- skipIndexes = isArr || isArg || isBuff || isType,
1946
- result = skipIndexes ? baseTimes(value.length, String) : [],
1947
- length = result.length;
1948
-
1949
- for (var key in value) {
1950
- if ((inherited || hasOwnProperty$7.call(value, key)) &&
1951
- !(skipIndexes && (
1952
- // Safari 9 has enumerable `arguments.length` in strict mode.
1953
- key == 'length' ||
1954
- // Node.js 0.10 has enumerable non-index properties on buffers.
1955
- (isBuff && (key == 'offset' || key == 'parent')) ||
1956
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
1957
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
1958
- // Skip index properties.
1959
- isIndex(key, length)
1960
- ))) {
1961
- result.push(key);
1962
- }
1963
- }
1964
- return result;
1965
- }
1966
-
1967
- var _arrayLikeKeys = arrayLikeKeys$2;
1968
-
1969
- /** Used for built-in method references. */
1970
-
1971
- var objectProto$7 = Object.prototype;
1972
-
1973
- /**
1974
- * Checks if `value` is likely a prototype object.
1975
- *
1976
- * @private
1977
- * @param {*} value The value to check.
1978
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1979
- */
1980
- function isPrototype$4(value) {
1981
- var Ctor = value && value.constructor,
1982
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$7;
1983
-
1984
- return value === proto;
1985
- }
1986
-
1987
- var _isPrototype = isPrototype$4;
1988
-
1989
- /**
1990
- * Creates a unary function that invokes `func` with its argument transformed.
1991
- *
1992
- * @private
1993
- * @param {Function} func The function to wrap.
1994
- * @param {Function} transform The argument transform.
1995
- * @returns {Function} Returns the new function.
1996
- */
1997
-
1998
- function overArg$2(func, transform) {
1999
- return function(arg) {
2000
- return func(transform(arg));
2001
- };
2002
- }
2003
-
2004
- var _overArg = overArg$2;
2005
-
2006
- var overArg$1 = _overArg;
2007
-
2008
- /* Built-in method references for those with the same name as other `lodash` methods. */
2009
- var nativeKeys$1 = overArg$1(Object.keys, Object);
2010
-
2011
- var _nativeKeys = nativeKeys$1;
2012
-
2013
- var isPrototype$3 = _isPrototype,
2014
- nativeKeys = _nativeKeys;
2015
-
2016
- /** Used for built-in method references. */
2017
- var objectProto$6 = Object.prototype;
2018
-
2019
- /** Used to check objects for own properties. */
2020
- var hasOwnProperty$6 = objectProto$6.hasOwnProperty;
2021
-
2022
- /**
2023
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
2024
- *
2025
- * @private
2026
- * @param {Object} object The object to query.
2027
- * @returns {Array} Returns the array of property names.
2028
- */
2029
- function baseKeys$2(object) {
2030
- if (!isPrototype$3(object)) {
2031
- return nativeKeys(object);
2032
- }
2033
- var result = [];
2034
- for (var key in Object(object)) {
2035
- if (hasOwnProperty$6.call(object, key) && key != 'constructor') {
2036
- result.push(key);
2037
- }
2038
- }
2039
- return result;
2040
- }
2041
-
2042
- var _baseKeys = baseKeys$2;
2043
-
2044
- var isFunction = isFunction_1,
2045
- isLength = isLength_1;
2046
-
2047
- /**
2048
- * Checks if `value` is array-like. A value is considered array-like if it's
2049
- * not a function and has a `value.length` that's an integer greater than or
2050
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
2051
- *
2052
- * @static
2053
- * @memberOf _
2054
- * @since 4.0.0
2055
- * @category Lang
2056
- * @param {*} value The value to check.
2057
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
2058
- * @example
2059
- *
2060
- * _.isArrayLike([1, 2, 3]);
2061
- * // => true
2062
- *
2063
- * _.isArrayLike(document.body.children);
2064
- * // => true
2065
- *
2066
- * _.isArrayLike('abc');
2067
- * // => true
2068
- *
2069
- * _.isArrayLike(_.noop);
2070
- * // => false
2071
- */
2072
- function isArrayLike$3(value) {
2073
- return value != null && isLength(value.length) && !isFunction(value);
2074
- }
2075
-
2076
- var isArrayLike_1 = isArrayLike$3;
2077
-
2078
- var arrayLikeKeys$1 = _arrayLikeKeys,
2079
- baseKeys$1 = _baseKeys,
2080
- isArrayLike$2 = isArrayLike_1;
2081
-
2082
- /**
2083
- * Creates an array of the own enumerable property names of `object`.
2084
- *
2085
- * **Note:** Non-object values are coerced to objects. See the
2086
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
2087
- * for more details.
2088
- *
2089
- * @static
2090
- * @since 0.1.0
2091
- * @memberOf _
2092
- * @category Object
2093
- * @param {Object} object The object to query.
2094
- * @returns {Array} Returns the array of property names.
2095
- * @example
2096
- *
2097
- * function Foo() {
2098
- * this.a = 1;
2099
- * this.b = 2;
2100
- * }
2101
- *
2102
- * Foo.prototype.c = 3;
2103
- *
2104
- * _.keys(new Foo);
2105
- * // => ['a', 'b'] (iteration order is not guaranteed)
2106
- *
2107
- * _.keys('hi');
2108
- * // => ['0', '1']
2109
- */
2110
- function keys$3(object) {
2111
- return isArrayLike$2(object) ? arrayLikeKeys$1(object) : baseKeys$1(object);
2112
- }
2113
-
2114
- var keys_1 = keys$3;
2115
-
2116
- var baseGetAllKeys$1 = _baseGetAllKeys,
2117
- getSymbols$2 = _getSymbols,
2118
- keys$2 = keys_1;
2119
-
2120
- /**
2121
- * Creates an array of own enumerable property names and symbols of `object`.
2122
- *
2123
- * @private
2124
- * @param {Object} object The object to query.
2125
- * @returns {Array} Returns the array of property names and symbols.
2126
- */
2127
- function getAllKeys$2(object) {
2128
- return baseGetAllKeys$1(object, keys$2, getSymbols$2);
2129
- }
2130
-
2131
- var _getAllKeys = getAllKeys$2;
2132
-
2133
- var getAllKeys$1 = _getAllKeys;
2134
-
2135
- /** Used to compose bitmasks for value comparisons. */
2136
- var COMPARE_PARTIAL_FLAG$1 = 1;
2137
-
2138
- /** Used for built-in method references. */
2139
- var objectProto$5 = Object.prototype;
2140
-
2141
- /** Used to check objects for own properties. */
2142
- var hasOwnProperty$5 = objectProto$5.hasOwnProperty;
2143
-
2144
- /**
2145
- * A specialized version of `baseIsEqualDeep` for objects with support for
2146
- * partial deep comparisons.
2147
- *
2148
- * @private
2149
- * @param {Object} object The object to compare.
2150
- * @param {Object} other The other object to compare.
2151
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2152
- * @param {Function} customizer The function to customize comparisons.
2153
- * @param {Function} equalFunc The function to determine equivalents of values.
2154
- * @param {Object} stack Tracks traversed `object` and `other` objects.
2155
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2156
- */
2157
- function equalObjects$1(object, other, bitmask, customizer, equalFunc, stack) {
2158
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1,
2159
- objProps = getAllKeys$1(object),
2160
- objLength = objProps.length,
2161
- othProps = getAllKeys$1(other),
2162
- othLength = othProps.length;
2163
-
2164
- if (objLength != othLength && !isPartial) {
2165
- return false;
2166
- }
2167
- var index = objLength;
2168
- while (index--) {
2169
- var key = objProps[index];
2170
- if (!(isPartial ? key in other : hasOwnProperty$5.call(other, key))) {
2171
- return false;
2172
- }
2173
- }
2174
- // Check that cyclic values are equal.
2175
- var objStacked = stack.get(object);
2176
- var othStacked = stack.get(other);
2177
- if (objStacked && othStacked) {
2178
- return objStacked == other && othStacked == object;
2179
- }
2180
- var result = true;
2181
- stack.set(object, other);
2182
- stack.set(other, object);
2183
-
2184
- var skipCtor = isPartial;
2185
- while (++index < objLength) {
2186
- key = objProps[index];
2187
- var objValue = object[key],
2188
- othValue = other[key];
2189
-
2190
- if (customizer) {
2191
- var compared = isPartial
2192
- ? customizer(othValue, objValue, key, other, object, stack)
2193
- : customizer(objValue, othValue, key, object, other, stack);
2194
- }
2195
- // Recursively compare objects (susceptible to call stack limits).
2196
- if (!(compared === undefined
2197
- ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
2198
- : compared
2199
- )) {
2200
- result = false;
2201
- break;
2202
- }
2203
- skipCtor || (skipCtor = key == 'constructor');
2204
- }
2205
- if (result && !skipCtor) {
2206
- var objCtor = object.constructor,
2207
- othCtor = other.constructor;
2208
-
2209
- // Non `Object` object instances with different constructors are not equal.
2210
- if (objCtor != othCtor &&
2211
- ('constructor' in object && 'constructor' in other) &&
2212
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
2213
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
2214
- result = false;
2215
- }
2216
- }
2217
- stack['delete'](object);
2218
- stack['delete'](other);
2219
- return result;
2220
- }
2221
-
2222
- var _equalObjects = equalObjects$1;
2223
-
2224
- var getNative$4 = _getNative,
2225
- root$3 = _root;
2226
-
2227
- /* Built-in method references that are verified to be native. */
2228
- var DataView$1 = getNative$4(root$3, 'DataView');
2229
-
2230
- var _DataView = DataView$1;
2231
-
2232
- var getNative$3 = _getNative,
2233
- root$2 = _root;
2234
-
2235
- /* Built-in method references that are verified to be native. */
2236
- var Promise$2 = getNative$3(root$2, 'Promise');
2237
-
2238
- var _Promise = Promise$2;
2239
-
2240
- var getNative$2 = _getNative,
2241
- root$1 = _root;
2242
-
2243
- /* Built-in method references that are verified to be native. */
2244
- var Set$1 = getNative$2(root$1, 'Set');
2245
-
2246
- var _Set = Set$1;
2247
-
2248
- var getNative$1 = _getNative,
2249
- root = _root;
2250
-
2251
- /* Built-in method references that are verified to be native. */
2252
- var WeakMap$1 = getNative$1(root, 'WeakMap');
2253
-
2254
- var _WeakMap = WeakMap$1;
2255
-
2256
- var DataView = _DataView,
2257
- Map = _Map,
2258
- Promise$1 = _Promise,
2259
- Set = _Set,
2260
- WeakMap = _WeakMap,
2261
- baseGetTag = _baseGetTag,
2262
- toSource = _toSource;
2263
-
2264
- /** `Object#toString` result references. */
2265
- var mapTag$4 = '[object Map]',
2266
- objectTag$2 = '[object Object]',
2267
- promiseTag = '[object Promise]',
2268
- setTag$4 = '[object Set]',
2269
- weakMapTag$1 = '[object WeakMap]';
2270
-
2271
- var dataViewTag$2 = '[object DataView]';
2272
-
2273
- /** Used to detect maps, sets, and weakmaps. */
2274
- var dataViewCtorString = toSource(DataView),
2275
- mapCtorString = toSource(Map),
2276
- promiseCtorString = toSource(Promise$1),
2277
- setCtorString = toSource(Set),
2278
- weakMapCtorString = toSource(WeakMap);
2279
-
2280
- /**
2281
- * Gets the `toStringTag` of `value`.
2282
- *
2283
- * @private
2284
- * @param {*} value The value to query.
2285
- * @returns {string} Returns the `toStringTag`.
2286
- */
2287
- var getTag$5 = baseGetTag;
2288
-
2289
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2290
- if ((DataView && getTag$5(new DataView(new ArrayBuffer(1))) != dataViewTag$2) ||
2291
- (Map && getTag$5(new Map) != mapTag$4) ||
2292
- (Promise$1 && getTag$5(Promise$1.resolve()) != promiseTag) ||
2293
- (Set && getTag$5(new Set) != setTag$4) ||
2294
- (WeakMap && getTag$5(new WeakMap) != weakMapTag$1)) {
2295
- getTag$5 = function(value) {
2296
- var result = baseGetTag(value),
2297
- Ctor = result == objectTag$2 ? value.constructor : undefined,
2298
- ctorString = Ctor ? toSource(Ctor) : '';
2299
-
2300
- if (ctorString) {
2301
- switch (ctorString) {
2302
- case dataViewCtorString: return dataViewTag$2;
2303
- case mapCtorString: return mapTag$4;
2304
- case promiseCtorString: return promiseTag;
2305
- case setCtorString: return setTag$4;
2306
- case weakMapCtorString: return weakMapTag$1;
2307
- }
2308
- }
2309
- return result;
2310
- };
2311
- }
2312
-
2313
- var _getTag = getTag$5;
2314
-
2315
- var Stack$1 = _Stack,
2316
- equalArrays = _equalArrays,
2317
- equalByTag = _equalByTag,
2318
- equalObjects = _equalObjects,
2319
- getTag$4 = _getTag,
2320
- isArray$2 = isArray_1,
2321
- isBuffer$2 = isBuffer$4.exports,
2322
- isTypedArray$1 = isTypedArray_1;
2323
-
2324
- /** Used to compose bitmasks for value comparisons. */
2325
- var COMPARE_PARTIAL_FLAG = 1;
2326
-
2327
- /** `Object#toString` result references. */
2328
- var argsTag$1 = '[object Arguments]',
2329
- arrayTag$1 = '[object Array]',
2330
- objectTag$1 = '[object Object]';
2331
-
2332
- /** Used for built-in method references. */
2333
- var objectProto$4 = Object.prototype;
2334
-
2335
- /** Used to check objects for own properties. */
2336
- var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
2337
-
2338
- /**
2339
- * A specialized version of `baseIsEqual` for arrays and objects which performs
2340
- * deep comparisons and tracks traversed objects enabling objects with circular
2341
- * references to be compared.
2342
- *
2343
- * @private
2344
- * @param {Object} object The object to compare.
2345
- * @param {Object} other The other object to compare.
2346
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2347
- * @param {Function} customizer The function to customize comparisons.
2348
- * @param {Function} equalFunc The function to determine equivalents of values.
2349
- * @param {Object} [stack] Tracks traversed `object` and `other` objects.
2350
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2351
- */
2352
- function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
2353
- var objIsArr = isArray$2(object),
2354
- othIsArr = isArray$2(other),
2355
- objTag = objIsArr ? arrayTag$1 : getTag$4(object),
2356
- othTag = othIsArr ? arrayTag$1 : getTag$4(other);
2357
-
2358
- objTag = objTag == argsTag$1 ? objectTag$1 : objTag;
2359
- othTag = othTag == argsTag$1 ? objectTag$1 : othTag;
2360
-
2361
- var objIsObj = objTag == objectTag$1,
2362
- othIsObj = othTag == objectTag$1,
2363
- isSameTag = objTag == othTag;
2364
-
2365
- if (isSameTag && isBuffer$2(object)) {
2366
- if (!isBuffer$2(other)) {
2367
- return false;
2368
- }
2369
- objIsArr = true;
2370
- objIsObj = false;
2371
- }
2372
- if (isSameTag && !objIsObj) {
2373
- stack || (stack = new Stack$1);
2374
- return (objIsArr || isTypedArray$1(object))
2375
- ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
2376
- : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2377
- }
2378
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
2379
- var objIsWrapped = objIsObj && hasOwnProperty$4.call(object, '__wrapped__'),
2380
- othIsWrapped = othIsObj && hasOwnProperty$4.call(other, '__wrapped__');
2381
-
2382
- if (objIsWrapped || othIsWrapped) {
2383
- var objUnwrapped = objIsWrapped ? object.value() : object,
2384
- othUnwrapped = othIsWrapped ? other.value() : other;
2385
-
2386
- stack || (stack = new Stack$1);
2387
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
2388
- }
2389
- }
2390
- if (!isSameTag) {
2391
- return false;
2392
- }
2393
- stack || (stack = new Stack$1);
2394
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
2395
- }
2396
-
2397
- var _baseIsEqualDeep = baseIsEqualDeep$1;
2398
-
2399
- var baseIsEqualDeep = _baseIsEqualDeep,
2400
- isObjectLike$2 = isObjectLike_1;
2401
-
2402
- /**
2403
- * The base implementation of `_.isEqual` which supports partial comparisons
2404
- * and tracks traversed objects.
2405
- *
2406
- * @private
2407
- * @param {*} value The value to compare.
2408
- * @param {*} other The other value to compare.
2409
- * @param {boolean} bitmask The bitmask flags.
2410
- * 1 - Unordered comparison
2411
- * 2 - Partial comparison
2412
- * @param {Function} [customizer] The function to customize comparisons.
2413
- * @param {Object} [stack] Tracks traversed `value` and `other` objects.
2414
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2415
- */
2416
- function baseIsEqual$1(value, other, bitmask, customizer, stack) {
2417
- if (value === other) {
2418
- return true;
2419
- }
2420
- if (value == null || other == null || (!isObjectLike$2(value) && !isObjectLike$2(other))) {
2421
- return value !== value && other !== other;
2422
- }
2423
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$1, stack);
2424
- }
2425
-
2426
- var _baseIsEqual = baseIsEqual$1;
2427
-
2428
- var baseIsEqual = _baseIsEqual;
2429
-
2430
- /**
2431
- * Performs a deep comparison between two values to determine if they are
2432
- * equivalent.
2433
- *
2434
- * **Note:** This method supports comparing arrays, array buffers, booleans,
2435
- * date objects, error objects, maps, numbers, `Object` objects, regexes,
2436
- * sets, strings, symbols, and typed arrays. `Object` objects are compared
2437
- * by their own, not inherited, enumerable properties. Functions and DOM
2438
- * nodes are compared by strict equality, i.e. `===`.
2439
- *
2440
- * @static
2441
- * @memberOf _
2442
- * @since 0.1.0
2443
- * @category Lang
2444
- * @param {*} value The value to compare.
2445
- * @param {*} other The other value to compare.
2446
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2447
- * @example
2448
- *
2449
- * var object = { 'a': 1 };
2450
- * var other = { 'a': 1 };
2451
- *
2452
- * _.isEqual(object, other);
2453
- * // => true
2454
- *
2455
- * object === other;
2456
- * // => false
2457
- */
2458
- function isEqual(value, other) {
2459
- return baseIsEqual(value, other);
2460
- }
2461
-
2462
- var isEqual_1 = isEqual;
2463
-
2464
- var baseKeys = _baseKeys,
2465
- getTag$3 = _getTag,
2466
- isArguments = isArguments_1,
2467
- isArray$1 = isArray_1,
2468
- isArrayLike$1 = isArrayLike_1,
2469
- isBuffer$1 = isBuffer$4.exports,
2470
- isPrototype$2 = _isPrototype,
2471
- isTypedArray = isTypedArray_1;
2472
-
2473
- /** `Object#toString` result references. */
2474
- var mapTag$3 = '[object Map]',
2475
- setTag$3 = '[object Set]';
2476
-
2477
- /** Used for built-in method references. */
2478
- var objectProto$3 = Object.prototype;
2479
-
2480
- /** Used to check objects for own properties. */
2481
- var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
2482
-
2483
- /**
2484
- * Checks if `value` is an empty object, collection, map, or set.
2485
- *
2486
- * Objects are considered empty if they have no own enumerable string keyed
2487
- * properties.
2488
- *
2489
- * Array-like values such as `arguments` objects, arrays, buffers, strings, or
2490
- * jQuery-like collections are considered empty if they have a `length` of `0`.
2491
- * Similarly, maps and sets are considered empty if they have a `size` of `0`.
2492
- *
2493
- * @static
2494
- * @memberOf _
2495
- * @since 0.1.0
2496
- * @category Lang
2497
- * @param {*} value The value to check.
2498
- * @returns {boolean} Returns `true` if `value` is empty, else `false`.
2499
- * @example
2500
- *
2501
- * _.isEmpty(null);
2502
- * // => true
2503
- *
2504
- * _.isEmpty(true);
2505
- * // => true
2506
- *
2507
- * _.isEmpty(1);
2508
- * // => true
2509
- *
2510
- * _.isEmpty([1, 2, 3]);
2511
- * // => false
2512
- *
2513
- * _.isEmpty({ 'a': 1 });
2514
- * // => false
2515
- */
2516
- function isEmpty(value) {
2517
- if (value == null) {
2518
- return true;
2519
- }
2520
- if (isArrayLike$1(value) &&
2521
- (isArray$1(value) || typeof value == 'string' || typeof value.splice == 'function' ||
2522
- isBuffer$1(value) || isTypedArray(value) || isArguments(value))) {
2523
- return !value.length;
2524
- }
2525
- var tag = getTag$3(value);
2526
- if (tag == mapTag$3 || tag == setTag$3) {
2527
- return !value.size;
2528
- }
2529
- if (isPrototype$2(value)) {
2530
- return !baseKeys(value).length;
2531
- }
2532
- for (var key in value) {
2533
- if (hasOwnProperty$3.call(value, key)) {
2534
- return false;
2535
- }
2536
- }
2537
- return true;
2538
- }
2539
-
2540
- var isEmpty_1 = isEmpty;
2541
-
2542
- /**
2543
- * A specialized version of `_.forEach` for arrays without support for
2544
- * iteratee shorthands.
2545
- *
2546
- * @private
2547
- * @param {Array} [array] The array to iterate over.
2548
- * @param {Function} iteratee The function invoked per iteration.
2549
- * @returns {Array} Returns `array`.
2550
- */
2551
-
2552
- function arrayEach$1(array, iteratee) {
2553
- var index = -1,
2554
- length = array == null ? 0 : array.length;
2555
-
2556
- while (++index < length) {
2557
- if (iteratee(array[index], index, array) === false) {
2558
- break;
2559
- }
2560
- }
2561
- return array;
2562
- }
2563
-
2564
- var _arrayEach = arrayEach$1;
2565
-
2566
- var getNative = _getNative;
2567
-
2568
- var defineProperty$1 = (function() {
2569
- try {
2570
- var func = getNative(Object, 'defineProperty');
2571
- func({}, '', {});
2572
- return func;
2573
- } catch (e) {}
2574
- }());
2575
-
2576
- var _defineProperty = defineProperty$1;
2577
-
2578
- var defineProperty = _defineProperty;
2579
-
2580
- /**
2581
- * The base implementation of `assignValue` and `assignMergeValue` without
2582
- * value checks.
2583
- *
2584
- * @private
2585
- * @param {Object} object The object to modify.
2586
- * @param {string} key The key of the property to assign.
2587
- * @param {*} value The value to assign.
2588
- */
2589
- function baseAssignValue$2(object, key, value) {
2590
- if (key == '__proto__' && defineProperty) {
2591
- defineProperty(object, key, {
2592
- 'configurable': true,
2593
- 'enumerable': true,
2594
- 'value': value,
2595
- 'writable': true
2596
- });
2597
- } else {
2598
- object[key] = value;
2599
- }
2600
- }
2601
-
2602
- var _baseAssignValue = baseAssignValue$2;
2603
-
2604
- var baseAssignValue$1 = _baseAssignValue,
2605
- eq = eq_1;
2606
-
2607
- /** Used for built-in method references. */
2608
- var objectProto$2 = Object.prototype;
2609
-
2610
- /** Used to check objects for own properties. */
2611
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
2612
-
2613
- /**
2614
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
2615
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2616
- * for equality comparisons.
2617
- *
2618
- * @private
2619
- * @param {Object} object The object to modify.
2620
- * @param {string} key The key of the property to assign.
2621
- * @param {*} value The value to assign.
2622
- */
2623
- function assignValue$2(object, key, value) {
2624
- var objValue = object[key];
2625
- if (!(hasOwnProperty$2.call(object, key) && eq(objValue, value)) ||
2626
- (value === undefined && !(key in object))) {
2627
- baseAssignValue$1(object, key, value);
2628
- }
2629
- }
2630
-
2631
- var _assignValue = assignValue$2;
2632
-
2633
- var assignValue$1 = _assignValue,
2634
- baseAssignValue = _baseAssignValue;
2635
-
2636
- /**
2637
- * Copies properties of `source` to `object`.
2638
- *
2639
- * @private
2640
- * @param {Object} source The object to copy properties from.
2641
- * @param {Array} props The property identifiers to copy.
2642
- * @param {Object} [object={}] The object to copy properties to.
2643
- * @param {Function} [customizer] The function to customize copied values.
2644
- * @returns {Object} Returns `object`.
2645
- */
2646
- function copyObject$4(source, props, object, customizer) {
2647
- var isNew = !object;
2648
- object || (object = {});
2649
-
2650
- var index = -1,
2651
- length = props.length;
2652
-
2653
- while (++index < length) {
2654
- var key = props[index];
2655
-
2656
- var newValue = customizer
2657
- ? customizer(object[key], source[key], key, object, source)
2658
- : undefined;
2659
-
2660
- if (newValue === undefined) {
2661
- newValue = source[key];
2662
- }
2663
- if (isNew) {
2664
- baseAssignValue(object, key, newValue);
2665
- } else {
2666
- assignValue$1(object, key, newValue);
2667
- }
2668
- }
2669
- return object;
2670
- }
2671
-
2672
- var _copyObject = copyObject$4;
2673
-
2674
- var copyObject$3 = _copyObject,
2675
- keys$1 = keys_1;
2676
-
2677
- /**
2678
- * The base implementation of `_.assign` without support for multiple sources
2679
- * or `customizer` functions.
2680
- *
2681
- * @private
2682
- * @param {Object} object The destination object.
2683
- * @param {Object} source The source object.
2684
- * @returns {Object} Returns `object`.
2685
- */
2686
- function baseAssign$1(object, source) {
2687
- return object && copyObject$3(source, keys$1(source), object);
2688
- }
2689
-
2690
- var _baseAssign = baseAssign$1;
2691
-
2692
- /**
2693
- * This function is like
2694
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
2695
- * except that it includes inherited enumerable properties.
2696
- *
2697
- * @private
2698
- * @param {Object} object The object to query.
2699
- * @returns {Array} Returns the array of property names.
2700
- */
2701
-
2702
- function nativeKeysIn$1(object) {
2703
- var result = [];
2704
- if (object != null) {
2705
- for (var key in Object(object)) {
2706
- result.push(key);
2707
- }
2708
- }
2709
- return result;
2710
- }
2711
-
2712
- var _nativeKeysIn = nativeKeysIn$1;
2713
-
2714
- var isObject$2 = isObject_1,
2715
- isPrototype$1 = _isPrototype,
2716
- nativeKeysIn = _nativeKeysIn;
2717
-
2718
- /** Used for built-in method references. */
2719
- var objectProto$1 = Object.prototype;
2720
-
2721
- /** Used to check objects for own properties. */
2722
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2723
-
2724
- /**
2725
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
2726
- *
2727
- * @private
2728
- * @param {Object} object The object to query.
2729
- * @returns {Array} Returns the array of property names.
2730
- */
2731
- function baseKeysIn$1(object) {
2732
- if (!isObject$2(object)) {
2733
- return nativeKeysIn(object);
2734
- }
2735
- var isProto = isPrototype$1(object),
2736
- result = [];
2737
-
2738
- for (var key in object) {
2739
- if (!(key == 'constructor' && (isProto || !hasOwnProperty$1.call(object, key)))) {
2740
- result.push(key);
2741
- }
2742
- }
2743
- return result;
2744
- }
2745
-
2746
- var _baseKeysIn = baseKeysIn$1;
2747
-
2748
- var arrayLikeKeys = _arrayLikeKeys,
2749
- baseKeysIn = _baseKeysIn,
2750
- isArrayLike = isArrayLike_1;
2751
-
2752
- /**
2753
- * Creates an array of the own and inherited enumerable property names of `object`.
2754
- *
2755
- * **Note:** Non-object values are coerced to objects.
2756
- *
2757
- * @static
2758
- * @memberOf _
2759
- * @since 3.0.0
2760
- * @category Object
2761
- * @param {Object} object The object to query.
2762
- * @returns {Array} Returns the array of property names.
2763
- * @example
2764
- *
2765
- * function Foo() {
2766
- * this.a = 1;
2767
- * this.b = 2;
2768
- * }
2769
- *
2770
- * Foo.prototype.c = 3;
2771
- *
2772
- * _.keysIn(new Foo);
2773
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
2774
- */
2775
- function keysIn$3(object) {
2776
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
2777
- }
2778
-
2779
- var keysIn_1 = keysIn$3;
2780
-
2781
- var copyObject$2 = _copyObject,
2782
- keysIn$2 = keysIn_1;
2783
-
2784
- /**
2785
- * The base implementation of `_.assignIn` without support for multiple sources
2786
- * or `customizer` functions.
2787
- *
2788
- * @private
2789
- * @param {Object} object The destination object.
2790
- * @param {Object} source The source object.
2791
- * @returns {Object} Returns `object`.
2792
- */
2793
- function baseAssignIn$1(object, source) {
2794
- return object && copyObject$2(source, keysIn$2(source), object);
2795
- }
2796
-
2797
- var _baseAssignIn = baseAssignIn$1;
2798
-
2799
- var _cloneBuffer = {exports: {}};
2800
-
2801
- (function (module, exports) {
2802
- var root = _root;
2803
-
2804
- /** Detect free variable `exports`. */
2805
- var freeExports = exports && !exports.nodeType && exports;
2806
-
2807
- /** Detect free variable `module`. */
2808
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
2809
-
2810
- /** Detect the popular CommonJS extension `module.exports`. */
2811
- var moduleExports = freeModule && freeModule.exports === freeExports;
2812
-
2813
- /** Built-in value references. */
2814
- var Buffer = moduleExports ? root.Buffer : undefined,
2815
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
2816
-
2817
- /**
2818
- * Creates a clone of `buffer`.
2819
- *
2820
- * @private
2821
- * @param {Buffer} buffer The buffer to clone.
2822
- * @param {boolean} [isDeep] Specify a deep clone.
2823
- * @returns {Buffer} Returns the cloned buffer.
2824
- */
2825
- function cloneBuffer(buffer, isDeep) {
2826
- if (isDeep) {
2827
- return buffer.slice();
2828
- }
2829
- var length = buffer.length,
2830
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
2831
-
2832
- buffer.copy(result);
2833
- return result;
2834
- }
2835
-
2836
- module.exports = cloneBuffer;
2837
- }(_cloneBuffer, _cloneBuffer.exports));
2838
-
2839
- /**
2840
- * Copies the values of `source` to `array`.
2841
- *
2842
- * @private
2843
- * @param {Array} source The array to copy values from.
2844
- * @param {Array} [array=[]] The array to copy values to.
2845
- * @returns {Array} Returns `array`.
2846
- */
2847
-
2848
- function copyArray$1(source, array) {
2849
- var index = -1,
2850
- length = source.length;
2851
-
2852
- array || (array = Array(length));
2853
- while (++index < length) {
2854
- array[index] = source[index];
2855
- }
2856
- return array;
2857
- }
2858
-
2859
- var _copyArray = copyArray$1;
2860
-
2861
- var copyObject$1 = _copyObject,
2862
- getSymbols$1 = _getSymbols;
2863
-
2864
- /**
2865
- * Copies own symbols of `source` to `object`.
2866
- *
2867
- * @private
2868
- * @param {Object} source The object to copy symbols from.
2869
- * @param {Object} [object={}] The object to copy symbols to.
2870
- * @returns {Object} Returns `object`.
2871
- */
2872
- function copySymbols$1(source, object) {
2873
- return copyObject$1(source, getSymbols$1(source), object);
2874
- }
2875
-
2876
- var _copySymbols = copySymbols$1;
2877
-
2878
- var overArg = _overArg;
2879
-
2880
- /** Built-in value references. */
2881
- var getPrototype$2 = overArg(Object.getPrototypeOf, Object);
2882
-
2883
- var _getPrototype = getPrototype$2;
2884
-
2885
- var arrayPush = _arrayPush,
2886
- getPrototype$1 = _getPrototype,
2887
- getSymbols = _getSymbols,
2888
- stubArray = stubArray_1;
2889
-
2890
- /* Built-in method references for those with the same name as other `lodash` methods. */
2891
- var nativeGetSymbols = Object.getOwnPropertySymbols;
2892
-
2893
- /**
2894
- * Creates an array of the own and inherited enumerable symbols of `object`.
2895
- *
2896
- * @private
2897
- * @param {Object} object The object to query.
2898
- * @returns {Array} Returns the array of symbols.
2899
- */
2900
- var getSymbolsIn$2 = !nativeGetSymbols ? stubArray : function(object) {
2901
- var result = [];
2902
- while (object) {
2903
- arrayPush(result, getSymbols(object));
2904
- object = getPrototype$1(object);
2905
- }
2906
- return result;
2907
- };
2908
-
2909
- var _getSymbolsIn = getSymbolsIn$2;
2910
-
2911
- var copyObject = _copyObject,
2912
- getSymbolsIn$1 = _getSymbolsIn;
2913
-
2914
- /**
2915
- * Copies own and inherited symbols of `source` to `object`.
2916
- *
2917
- * @private
2918
- * @param {Object} source The object to copy symbols from.
2919
- * @param {Object} [object={}] The object to copy symbols to.
2920
- * @returns {Object} Returns `object`.
2921
- */
2922
- function copySymbolsIn$1(source, object) {
2923
- return copyObject(source, getSymbolsIn$1(source), object);
2924
- }
2925
-
2926
- var _copySymbolsIn = copySymbolsIn$1;
2927
-
2928
- var baseGetAllKeys = _baseGetAllKeys,
2929
- getSymbolsIn = _getSymbolsIn,
2930
- keysIn$1 = keysIn_1;
2931
-
2932
- /**
2933
- * Creates an array of own and inherited enumerable property names and
2934
- * symbols of `object`.
2935
- *
2936
- * @private
2937
- * @param {Object} object The object to query.
2938
- * @returns {Array} Returns the array of property names and symbols.
2939
- */
2940
- function getAllKeysIn$1(object) {
2941
- return baseGetAllKeys(object, keysIn$1, getSymbolsIn);
2942
- }
2943
-
2944
- var _getAllKeysIn = getAllKeysIn$1;
2945
-
2946
- /** Used for built-in method references. */
2947
-
2948
- var objectProto = Object.prototype;
2949
-
2950
- /** Used to check objects for own properties. */
2951
- var hasOwnProperty = objectProto.hasOwnProperty;
2952
-
2953
- /**
2954
- * Initializes an array clone.
2955
- *
2956
- * @private
2957
- * @param {Array} array The array to clone.
2958
- * @returns {Array} Returns the initialized clone.
2959
- */
2960
- function initCloneArray$1(array) {
2961
- var length = array.length,
2962
- result = new array.constructor(length);
2963
-
2964
- // Add properties assigned by `RegExp#exec`.
2965
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
2966
- result.index = array.index;
2967
- result.input = array.input;
2968
- }
2969
- return result;
2970
- }
2971
-
2972
- var _initCloneArray = initCloneArray$1;
2973
-
2974
- var Uint8Array = _Uint8Array;
2975
-
2976
- /**
2977
- * Creates a clone of `arrayBuffer`.
2978
- *
2979
- * @private
2980
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
2981
- * @returns {ArrayBuffer} Returns the cloned array buffer.
2982
- */
2983
- function cloneArrayBuffer$3(arrayBuffer) {
2984
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2985
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
2986
- return result;
2987
- }
2988
-
2989
- var _cloneArrayBuffer = cloneArrayBuffer$3;
2990
-
2991
- var cloneArrayBuffer$2 = _cloneArrayBuffer;
2992
-
2993
- /**
2994
- * Creates a clone of `dataView`.
2995
- *
2996
- * @private
2997
- * @param {Object} dataView The data view to clone.
2998
- * @param {boolean} [isDeep] Specify a deep clone.
2999
- * @returns {Object} Returns the cloned data view.
3000
- */
3001
- function cloneDataView$1(dataView, isDeep) {
3002
- var buffer = isDeep ? cloneArrayBuffer$2(dataView.buffer) : dataView.buffer;
3003
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
3004
- }
3005
-
3006
- var _cloneDataView = cloneDataView$1;
3007
-
3008
- /** Used to match `RegExp` flags from their coerced string values. */
3009
-
3010
- var reFlags = /\w*$/;
3011
-
3012
- /**
3013
- * Creates a clone of `regexp`.
3014
- *
3015
- * @private
3016
- * @param {Object} regexp The regexp to clone.
3017
- * @returns {Object} Returns the cloned regexp.
3018
- */
3019
- function cloneRegExp$1(regexp) {
3020
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
3021
- result.lastIndex = regexp.lastIndex;
3022
- return result;
3023
- }
3024
-
3025
- var _cloneRegExp = cloneRegExp$1;
3026
-
3027
- var Symbol$1 = _Symbol;
3028
-
3029
- /** Used to convert symbols to primitives and strings. */
3030
- var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
3031
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
3032
-
3033
- /**
3034
- * Creates a clone of the `symbol` object.
3035
- *
3036
- * @private
3037
- * @param {Object} symbol The symbol object to clone.
3038
- * @returns {Object} Returns the cloned symbol object.
3039
- */
3040
- function cloneSymbol$1(symbol) {
3041
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
3042
- }
3043
-
3044
- var _cloneSymbol = cloneSymbol$1;
3045
-
3046
- var cloneArrayBuffer$1 = _cloneArrayBuffer;
3047
-
3048
- /**
3049
- * Creates a clone of `typedArray`.
3050
- *
3051
- * @private
3052
- * @param {Object} typedArray The typed array to clone.
3053
- * @param {boolean} [isDeep] Specify a deep clone.
3054
- * @returns {Object} Returns the cloned typed array.
3055
- */
3056
- function cloneTypedArray$1(typedArray, isDeep) {
3057
- var buffer = isDeep ? cloneArrayBuffer$1(typedArray.buffer) : typedArray.buffer;
3058
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
3059
- }
3060
-
3061
- var _cloneTypedArray = cloneTypedArray$1;
3062
-
3063
- var cloneArrayBuffer = _cloneArrayBuffer,
3064
- cloneDataView = _cloneDataView,
3065
- cloneRegExp = _cloneRegExp,
3066
- cloneSymbol = _cloneSymbol,
3067
- cloneTypedArray = _cloneTypedArray;
3068
-
3069
- /** `Object#toString` result references. */
3070
- var boolTag$1 = '[object Boolean]',
3071
- dateTag$1 = '[object Date]',
3072
- mapTag$2 = '[object Map]',
3073
- numberTag$1 = '[object Number]',
3074
- regexpTag$1 = '[object RegExp]',
3075
- setTag$2 = '[object Set]',
3076
- stringTag$1 = '[object String]',
3077
- symbolTag$1 = '[object Symbol]';
3078
-
3079
- var arrayBufferTag$1 = '[object ArrayBuffer]',
3080
- dataViewTag$1 = '[object DataView]',
3081
- float32Tag$1 = '[object Float32Array]',
3082
- float64Tag$1 = '[object Float64Array]',
3083
- int8Tag$1 = '[object Int8Array]',
3084
- int16Tag$1 = '[object Int16Array]',
3085
- int32Tag$1 = '[object Int32Array]',
3086
- uint8Tag$1 = '[object Uint8Array]',
3087
- uint8ClampedTag$1 = '[object Uint8ClampedArray]',
3088
- uint16Tag$1 = '[object Uint16Array]',
3089
- uint32Tag$1 = '[object Uint32Array]';
3090
-
3091
- /**
3092
- * Initializes an object clone based on its `toStringTag`.
3093
- *
3094
- * **Note:** This function only supports cloning values with tags of
3095
- * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
3096
- *
3097
- * @private
3098
- * @param {Object} object The object to clone.
3099
- * @param {string} tag The `toStringTag` of the object to clone.
3100
- * @param {boolean} [isDeep] Specify a deep clone.
3101
- * @returns {Object} Returns the initialized clone.
3102
- */
3103
- function initCloneByTag$1(object, tag, isDeep) {
3104
- var Ctor = object.constructor;
3105
- switch (tag) {
3106
- case arrayBufferTag$1:
3107
- return cloneArrayBuffer(object);
3108
-
3109
- case boolTag$1:
3110
- case dateTag$1:
3111
- return new Ctor(+object);
3112
-
3113
- case dataViewTag$1:
3114
- return cloneDataView(object, isDeep);
3115
-
3116
- case float32Tag$1: case float64Tag$1:
3117
- case int8Tag$1: case int16Tag$1: case int32Tag$1:
3118
- case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
3119
- return cloneTypedArray(object, isDeep);
3120
-
3121
- case mapTag$2:
3122
- return new Ctor;
3123
-
3124
- case numberTag$1:
3125
- case stringTag$1:
3126
- return new Ctor(object);
3127
-
3128
- case regexpTag$1:
3129
- return cloneRegExp(object);
3130
-
3131
- case setTag$2:
3132
- return new Ctor;
3133
-
3134
- case symbolTag$1:
3135
- return cloneSymbol(object);
3136
- }
3137
- }
3138
-
3139
- var _initCloneByTag = initCloneByTag$1;
3140
-
3141
- var isObject$1 = isObject_1;
3142
-
3143
- /** Built-in value references. */
3144
- var objectCreate = Object.create;
3145
-
3146
- /**
3147
- * The base implementation of `_.create` without support for assigning
3148
- * properties to the created object.
3149
- *
3150
- * @private
3151
- * @param {Object} proto The object to inherit from.
3152
- * @returns {Object} Returns the new object.
3153
- */
3154
- var baseCreate$1 = (function() {
3155
- function object() {}
3156
- return function(proto) {
3157
- if (!isObject$1(proto)) {
3158
- return {};
3159
- }
3160
- if (objectCreate) {
3161
- return objectCreate(proto);
3162
- }
3163
- object.prototype = proto;
3164
- var result = new object;
3165
- object.prototype = undefined;
3166
- return result;
3167
- };
3168
- }());
3169
-
3170
- var _baseCreate = baseCreate$1;
3171
-
3172
- var baseCreate = _baseCreate,
3173
- getPrototype = _getPrototype,
3174
- isPrototype = _isPrototype;
3175
-
3176
- /**
3177
- * Initializes an object clone.
3178
- *
3179
- * @private
3180
- * @param {Object} object The object to clone.
3181
- * @returns {Object} Returns the initialized clone.
3182
- */
3183
- function initCloneObject$1(object) {
3184
- return (typeof object.constructor == 'function' && !isPrototype(object))
3185
- ? baseCreate(getPrototype(object))
3186
- : {};
3187
- }
3188
-
3189
- var _initCloneObject = initCloneObject$1;
3190
-
3191
- var getTag$2 = _getTag,
3192
- isObjectLike$1 = isObjectLike_1;
3193
-
3194
- /** `Object#toString` result references. */
3195
- var mapTag$1 = '[object Map]';
3196
-
3197
- /**
3198
- * The base implementation of `_.isMap` without Node.js optimizations.
3199
- *
3200
- * @private
3201
- * @param {*} value The value to check.
3202
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
3203
- */
3204
- function baseIsMap$1(value) {
3205
- return isObjectLike$1(value) && getTag$2(value) == mapTag$1;
3206
- }
3207
-
3208
- var _baseIsMap = baseIsMap$1;
3209
-
3210
- var baseIsMap = _baseIsMap,
3211
- baseUnary$1 = _baseUnary,
3212
- nodeUtil$1 = _nodeUtil.exports;
3213
-
3214
- /* Node.js helper references. */
3215
- var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
3216
-
3217
- /**
3218
- * Checks if `value` is classified as a `Map` object.
3219
- *
3220
- * @static
3221
- * @memberOf _
3222
- * @since 4.3.0
3223
- * @category Lang
3224
- * @param {*} value The value to check.
3225
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
3226
- * @example
3227
- *
3228
- * _.isMap(new Map);
3229
- * // => true
3230
- *
3231
- * _.isMap(new WeakMap);
3232
- * // => false
3233
- */
3234
- var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
3235
-
3236
- var isMap_1 = isMap$1;
3237
-
3238
- var getTag$1 = _getTag,
3239
- isObjectLike = isObjectLike_1;
3240
-
3241
- /** `Object#toString` result references. */
3242
- var setTag$1 = '[object Set]';
3243
-
3244
- /**
3245
- * The base implementation of `_.isSet` without Node.js optimizations.
3246
- *
3247
- * @private
3248
- * @param {*} value The value to check.
3249
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
3250
- */
3251
- function baseIsSet$1(value) {
3252
- return isObjectLike(value) && getTag$1(value) == setTag$1;
3253
- }
3254
-
3255
- var _baseIsSet = baseIsSet$1;
3256
-
3257
- var baseIsSet = _baseIsSet,
3258
- baseUnary = _baseUnary,
3259
- nodeUtil = _nodeUtil.exports;
3260
-
3261
- /* Node.js helper references. */
3262
- var nodeIsSet = nodeUtil && nodeUtil.isSet;
3263
-
3264
- /**
3265
- * Checks if `value` is classified as a `Set` object.
3266
- *
3267
- * @static
3268
- * @memberOf _
3269
- * @since 4.3.0
3270
- * @category Lang
3271
- * @param {*} value The value to check.
3272
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
3273
- * @example
3274
- *
3275
- * _.isSet(new Set);
3276
- * // => true
3277
- *
3278
- * _.isSet(new WeakSet);
3279
- * // => false
3280
- */
3281
- var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
3282
-
3283
- var isSet_1 = isSet$1;
3284
-
3285
- var Stack = _Stack,
3286
- arrayEach = _arrayEach,
3287
- assignValue = _assignValue,
3288
- baseAssign = _baseAssign,
3289
- baseAssignIn = _baseAssignIn,
3290
- cloneBuffer = _cloneBuffer.exports,
3291
- copyArray = _copyArray,
3292
- copySymbols = _copySymbols,
3293
- copySymbolsIn = _copySymbolsIn,
3294
- getAllKeys = _getAllKeys,
3295
- getAllKeysIn = _getAllKeysIn,
3296
- getTag = _getTag,
3297
- initCloneArray = _initCloneArray,
3298
- initCloneByTag = _initCloneByTag,
3299
- initCloneObject = _initCloneObject,
3300
- isArray = isArray_1,
3301
- isBuffer = isBuffer$4.exports,
3302
- isMap = isMap_1,
3303
- isObject = isObject_1,
3304
- isSet = isSet_1,
3305
- keys = keys_1,
3306
- keysIn = keysIn_1;
3307
-
3308
- /** Used to compose bitmasks for cloning. */
3309
- var CLONE_DEEP_FLAG$1 = 1,
3310
- CLONE_FLAT_FLAG = 2,
3311
- CLONE_SYMBOLS_FLAG$1 = 4;
3312
-
3313
- /** `Object#toString` result references. */
3314
- var argsTag = '[object Arguments]',
3315
- arrayTag = '[object Array]',
3316
- boolTag = '[object Boolean]',
3317
- dateTag = '[object Date]',
3318
- errorTag = '[object Error]',
3319
- funcTag = '[object Function]',
3320
- genTag = '[object GeneratorFunction]',
3321
- mapTag = '[object Map]',
3322
- numberTag = '[object Number]',
3323
- objectTag = '[object Object]',
3324
- regexpTag = '[object RegExp]',
3325
- setTag = '[object Set]',
3326
- stringTag = '[object String]',
3327
- symbolTag = '[object Symbol]',
3328
- weakMapTag = '[object WeakMap]';
3329
-
3330
- var arrayBufferTag = '[object ArrayBuffer]',
3331
- dataViewTag = '[object DataView]',
3332
- float32Tag = '[object Float32Array]',
3333
- float64Tag = '[object Float64Array]',
3334
- int8Tag = '[object Int8Array]',
3335
- int16Tag = '[object Int16Array]',
3336
- int32Tag = '[object Int32Array]',
3337
- uint8Tag = '[object Uint8Array]',
3338
- uint8ClampedTag = '[object Uint8ClampedArray]',
3339
- uint16Tag = '[object Uint16Array]',
3340
- uint32Tag = '[object Uint32Array]';
3341
-
3342
- /** Used to identify `toStringTag` values supported by `_.clone`. */
3343
- var cloneableTags = {};
3344
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
3345
- cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
3346
- cloneableTags[boolTag] = cloneableTags[dateTag] =
3347
- cloneableTags[float32Tag] = cloneableTags[float64Tag] =
3348
- cloneableTags[int8Tag] = cloneableTags[int16Tag] =
3349
- cloneableTags[int32Tag] = cloneableTags[mapTag] =
3350
- cloneableTags[numberTag] = cloneableTags[objectTag] =
3351
- cloneableTags[regexpTag] = cloneableTags[setTag] =
3352
- cloneableTags[stringTag] = cloneableTags[symbolTag] =
3353
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
3354
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
3355
- cloneableTags[errorTag] = cloneableTags[funcTag] =
3356
- cloneableTags[weakMapTag] = false;
3357
-
3358
- /**
3359
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
3360
- * traversed objects.
3361
- *
3362
- * @private
3363
- * @param {*} value The value to clone.
3364
- * @param {boolean} bitmask The bitmask flags.
3365
- * 1 - Deep clone
3366
- * 2 - Flatten inherited properties
3367
- * 4 - Clone symbols
3368
- * @param {Function} [customizer] The function to customize cloning.
3369
- * @param {string} [key] The key of `value`.
3370
- * @param {Object} [object] The parent object of `value`.
3371
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
3372
- * @returns {*} Returns the cloned value.
3373
- */
3374
- function baseClone$1(value, bitmask, customizer, key, object, stack) {
3375
- var result,
3376
- isDeep = bitmask & CLONE_DEEP_FLAG$1,
3377
- isFlat = bitmask & CLONE_FLAT_FLAG,
3378
- isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
3379
-
3380
- if (customizer) {
3381
- result = object ? customizer(value, key, object, stack) : customizer(value);
3382
- }
3383
- if (result !== undefined) {
3384
- return result;
3385
- }
3386
- if (!isObject(value)) {
3387
- return value;
3388
- }
3389
- var isArr = isArray(value);
3390
- if (isArr) {
3391
- result = initCloneArray(value);
3392
- if (!isDeep) {
3393
- return copyArray(value, result);
3394
- }
3395
- } else {
3396
- var tag = getTag(value),
3397
- isFunc = tag == funcTag || tag == genTag;
3398
-
3399
- if (isBuffer(value)) {
3400
- return cloneBuffer(value, isDeep);
3401
- }
3402
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
3403
- result = (isFlat || isFunc) ? {} : initCloneObject(value);
3404
- if (!isDeep) {
3405
- return isFlat
3406
- ? copySymbolsIn(value, baseAssignIn(result, value))
3407
- : copySymbols(value, baseAssign(result, value));
3408
- }
3409
- } else {
3410
- if (!cloneableTags[tag]) {
3411
- return object ? value : {};
3412
- }
3413
- result = initCloneByTag(value, tag, isDeep);
3414
- }
3415
- }
3416
- // Check for circular references and return its corresponding clone.
3417
- stack || (stack = new Stack);
3418
- var stacked = stack.get(value);
3419
- if (stacked) {
3420
- return stacked;
3421
- }
3422
- stack.set(value, result);
3423
-
3424
- if (isSet(value)) {
3425
- value.forEach(function(subValue) {
3426
- result.add(baseClone$1(subValue, bitmask, customizer, subValue, value, stack));
3427
- });
3428
- } else if (isMap(value)) {
3429
- value.forEach(function(subValue, key) {
3430
- result.set(key, baseClone$1(subValue, bitmask, customizer, key, value, stack));
3431
- });
3432
- }
3433
-
3434
- var keysFunc = isFull
3435
- ? (isFlat ? getAllKeysIn : getAllKeys)
3436
- : (isFlat ? keysIn : keys);
3437
-
3438
- var props = isArr ? undefined : keysFunc(value);
3439
- arrayEach(props || value, function(subValue, key) {
3440
- if (props) {
3441
- key = subValue;
3442
- subValue = value[key];
3443
- }
3444
- // Recursively populate clone (susceptible to call stack limits).
3445
- assignValue(result, key, baseClone$1(subValue, bitmask, customizer, key, value, stack));
3446
- });
3447
- return result;
3448
- }
3449
-
3450
- var _baseClone = baseClone$1;
3451
-
3452
- var baseClone = _baseClone;
3453
-
3454
- /** Used to compose bitmasks for cloning. */
3455
- var CLONE_DEEP_FLAG = 1,
3456
- CLONE_SYMBOLS_FLAG = 4;
3457
-
3458
- /**
3459
- * This method is like `_.clone` except that it recursively clones `value`.
3460
- *
3461
- * @static
3462
- * @memberOf _
3463
- * @since 1.0.0
3464
- * @category Lang
3465
- * @param {*} value The value to recursively clone.
3466
- * @returns {*} Returns the deep cloned value.
3467
- * @see _.clone
3468
- * @example
3469
- *
3470
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
3471
- *
3472
- * var deep = _.cloneDeep(objects);
3473
- * console.log(deep[0] === objects[0]);
3474
- * // => false
3475
- */
3476
- function cloneDeep(value) {
3477
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
3478
- }
3479
-
3480
- var cloneDeep_1 = cloneDeep;
3481
-
3482
- var browser = {exports: {}};
3483
-
3484
- /**
3485
- * Helpers.
3486
- */
3487
-
3488
- var s = 1000;
3489
- var m = s * 60;
3490
- var h = m * 60;
3491
- var d = h * 24;
3492
- var w = d * 7;
3493
- var y = d * 365.25;
3494
-
3495
- /**
3496
- * Parse or format the given `val`.
3497
- *
3498
- * Options:
3499
- *
3500
- * - `long` verbose formatting [false]
3501
- *
3502
- * @param {String|Number} val
3503
- * @param {Object} [options]
3504
- * @throws {Error} throw an error if val is not a non-empty string or a number
3505
- * @return {String|Number}
3506
- * @api public
3507
- */
3508
-
3509
- var ms = function (val, options) {
3510
- options = options || {};
3511
- var type = typeof val;
3512
- if (type === 'string' && val.length > 0) {
3513
- return parse(val);
3514
- } else if (type === 'number' && isFinite(val)) {
3515
- return options.long ? fmtLong(val) : fmtShort(val);
3516
- }
3517
- throw new Error(
3518
- 'val is not a non-empty string or a valid number. val=' +
3519
- JSON.stringify(val)
3520
- );
3521
- };
3522
-
3523
- /**
3524
- * Parse the given `str` and return milliseconds.
3525
- *
3526
- * @param {String} str
3527
- * @return {Number}
3528
- * @api private
3529
- */
3530
-
3531
- function parse(str) {
3532
- str = String(str);
3533
- if (str.length > 100) {
3534
- return;
3535
- }
3536
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
3537
- str
3538
- );
3539
- if (!match) {
3540
- return;
3541
- }
3542
- var n = parseFloat(match[1]);
3543
- var type = (match[2] || 'ms').toLowerCase();
3544
- switch (type) {
3545
- case 'years':
3546
- case 'year':
3547
- case 'yrs':
3548
- case 'yr':
3549
- case 'y':
3550
- return n * y;
3551
- case 'weeks':
3552
- case 'week':
3553
- case 'w':
3554
- return n * w;
3555
- case 'days':
3556
- case 'day':
3557
- case 'd':
3558
- return n * d;
3559
- case 'hours':
3560
- case 'hour':
3561
- case 'hrs':
3562
- case 'hr':
3563
- case 'h':
3564
- return n * h;
3565
- case 'minutes':
3566
- case 'minute':
3567
- case 'mins':
3568
- case 'min':
3569
- case 'm':
3570
- return n * m;
3571
- case 'seconds':
3572
- case 'second':
3573
- case 'secs':
3574
- case 'sec':
3575
- case 's':
3576
- return n * s;
3577
- case 'milliseconds':
3578
- case 'millisecond':
3579
- case 'msecs':
3580
- case 'msec':
3581
- case 'ms':
3582
- return n;
3583
- default:
3584
- return undefined;
3585
- }
3586
- }
3587
-
3588
- /**
3589
- * Short format for `ms`.
3590
- *
3591
- * @param {Number} ms
3592
- * @return {String}
3593
- * @api private
3594
- */
3595
-
3596
- function fmtShort(ms) {
3597
- var msAbs = Math.abs(ms);
3598
- if (msAbs >= d) {
3599
- return Math.round(ms / d) + 'd';
3600
- }
3601
- if (msAbs >= h) {
3602
- return Math.round(ms / h) + 'h';
3603
- }
3604
- if (msAbs >= m) {
3605
- return Math.round(ms / m) + 'm';
3606
- }
3607
- if (msAbs >= s) {
3608
- return Math.round(ms / s) + 's';
3609
- }
3610
- return ms + 'ms';
3611
- }
3612
-
3613
- /**
3614
- * Long format for `ms`.
3615
- *
3616
- * @param {Number} ms
3617
- * @return {String}
3618
- * @api private
3619
- */
3620
-
3621
- function fmtLong(ms) {
3622
- var msAbs = Math.abs(ms);
3623
- if (msAbs >= d) {
3624
- return plural(ms, msAbs, d, 'day');
3625
- }
3626
- if (msAbs >= h) {
3627
- return plural(ms, msAbs, h, 'hour');
3628
- }
3629
- if (msAbs >= m) {
3630
- return plural(ms, msAbs, m, 'minute');
3631
- }
3632
- if (msAbs >= s) {
3633
- return plural(ms, msAbs, s, 'second');
3634
- }
3635
- return ms + ' ms';
3636
- }
3637
-
3638
- /**
3639
- * Pluralization helper.
3640
- */
3641
-
3642
- function plural(ms, msAbs, n, name) {
3643
- var isPlural = msAbs >= n * 1.5;
3644
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
3645
- }
3646
-
3647
- /**
3648
- * This is the common logic for both the Node.js and web browser
3649
- * implementations of `debug()`.
3650
- */
3651
- function setup(env) {
3652
- createDebug.debug = createDebug;
3653
- createDebug.default = createDebug;
3654
- createDebug.coerce = coerce;
3655
- createDebug.disable = disable;
3656
- createDebug.enable = enable;
3657
- createDebug.enabled = enabled;
3658
- createDebug.humanize = ms;
3659
- Object.keys(env).forEach(function (key) {
3660
- createDebug[key] = env[key];
3661
- });
3662
- /**
3663
- * Active `debug` instances.
3664
- */
3665
-
3666
- createDebug.instances = [];
3667
- /**
3668
- * The currently active debug mode names, and names to skip.
3669
- */
3670
-
3671
- createDebug.names = [];
3672
- createDebug.skips = [];
3673
- /**
3674
- * Map of special "%n" handling functions, for the debug "format" argument.
3675
- *
3676
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
3677
- */
3678
-
3679
- createDebug.formatters = {};
3680
- /**
3681
- * Selects a color for a debug namespace
3682
- * @param {String} namespace The namespace string for the for the debug instance to be colored
3683
- * @return {Number|String} An ANSI color code for the given namespace
3684
- * @api private
3685
- */
3686
-
3687
- function selectColor(namespace) {
3688
- var hash = 0;
3689
-
3690
- for (var i = 0; i < namespace.length; i++) {
3691
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
3692
- hash |= 0; // Convert to 32bit integer
3693
- }
3694
-
3695
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
3696
- }
3697
-
3698
- createDebug.selectColor = selectColor;
3699
- /**
3700
- * Create a debugger with the given `namespace`.
3701
- *
3702
- * @param {String} namespace
3703
- * @return {Function}
3704
- * @api public
3705
- */
3706
-
3707
- function createDebug(namespace) {
3708
- var prevTime;
3709
-
3710
- function debug() {
3711
- // Disabled?
3712
- if (!debug.enabled) {
3713
- return;
3714
- }
3715
-
3716
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3717
- args[_key] = arguments[_key];
3718
- }
3719
-
3720
- var self = debug; // Set `diff` timestamp
3721
-
3722
- var curr = Number(new Date());
3723
- var ms = curr - (prevTime || curr);
3724
- self.diff = ms;
3725
- self.prev = prevTime;
3726
- self.curr = curr;
3727
- prevTime = curr;
3728
- args[0] = createDebug.coerce(args[0]);
3729
-
3730
- if (typeof args[0] !== 'string') {
3731
- // Anything else let's inspect with %O
3732
- args.unshift('%O');
3733
- } // Apply any `formatters` transformations
3734
-
3735
-
3736
- var index = 0;
3737
- args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
3738
- // If we encounter an escaped % then don't increase the array index
3739
- if (match === '%%') {
3740
- return match;
3741
- }
3742
-
3743
- index++;
3744
- var formatter = createDebug.formatters[format];
3745
-
3746
- if (typeof formatter === 'function') {
3747
- var val = args[index];
3748
- match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
3749
-
3750
- args.splice(index, 1);
3751
- index--;
3752
- }
3753
-
3754
- return match;
3755
- }); // Apply env-specific formatting (colors, etc.)
3756
-
3757
- createDebug.formatArgs.call(self, args);
3758
- var logFn = self.log || createDebug.log;
3759
- logFn.apply(self, args);
3760
- }
3761
-
3762
- debug.namespace = namespace;
3763
- debug.enabled = createDebug.enabled(namespace);
3764
- debug.useColors = createDebug.useColors();
3765
- debug.color = selectColor(namespace);
3766
- debug.destroy = destroy;
3767
- debug.extend = extend; // Debug.formatArgs = formatArgs;
3768
- // debug.rawLog = rawLog;
3769
- // env-specific initialization logic for debug instances
3770
-
3771
- if (typeof createDebug.init === 'function') {
3772
- createDebug.init(debug);
3773
- }
3774
-
3775
- createDebug.instances.push(debug);
3776
- return debug;
3777
- }
3778
-
3779
- function destroy() {
3780
- var index = createDebug.instances.indexOf(this);
3781
-
3782
- if (index !== -1) {
3783
- createDebug.instances.splice(index, 1);
3784
- return true;
3785
- }
3786
-
3787
- return false;
3788
- }
3789
-
3790
- function extend(namespace, delimiter) {
3791
- return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
3792
- }
3793
- /**
3794
- * Enables a debug mode by namespaces. This can include modes
3795
- * separated by a colon and wildcards.
3796
- *
3797
- * @param {String} namespaces
3798
- * @api public
3799
- */
3800
-
3801
-
3802
- function enable(namespaces) {
3803
- createDebug.save(namespaces);
3804
- createDebug.names = [];
3805
- createDebug.skips = [];
3806
- var i;
3807
- var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
3808
- var len = split.length;
3809
-
3810
- for (i = 0; i < len; i++) {
3811
- if (!split[i]) {
3812
- // ignore empty strings
3813
- continue;
3814
- }
3815
-
3816
- namespaces = split[i].replace(/\*/g, '.*?');
3817
-
3818
- if (namespaces[0] === '-') {
3819
- createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
3820
- } else {
3821
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
3822
- }
3823
- }
3824
-
3825
- for (i = 0; i < createDebug.instances.length; i++) {
3826
- var instance = createDebug.instances[i];
3827
- instance.enabled = createDebug.enabled(instance.namespace);
3828
- }
3829
- }
3830
- /**
3831
- * Disable debug output.
3832
- *
3833
- * @api public
3834
- */
3835
-
3836
-
3837
- function disable() {
3838
- createDebug.enable('');
3839
- }
3840
- /**
3841
- * Returns true if the given mode name is enabled, false otherwise.
3842
- *
3843
- * @param {String} name
3844
- * @return {Boolean}
3845
- * @api public
3846
- */
3847
-
3848
-
3849
- function enabled(name) {
3850
- if (name[name.length - 1] === '*') {
3851
- return true;
3852
- }
3853
-
3854
- var i;
3855
- var len;
3856
-
3857
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
3858
- if (createDebug.skips[i].test(name)) {
3859
- return false;
3860
- }
3861
- }
3862
-
3863
- for (i = 0, len = createDebug.names.length; i < len; i++) {
3864
- if (createDebug.names[i].test(name)) {
3865
- return true;
3866
- }
3867
- }
3868
-
3869
- return false;
3870
- }
3871
- /**
3872
- * Coerce `val`.
3873
- *
3874
- * @param {Mixed} val
3875
- * @return {Mixed}
3876
- * @api private
3877
- */
3878
-
3879
-
3880
- function coerce(val) {
3881
- if (val instanceof Error) {
3882
- return val.stack || val.message;
3883
- }
3884
-
3885
- return val;
3886
- }
3887
-
3888
- createDebug.enable(createDebug.load());
3889
- return createDebug;
3890
- }
3891
-
3892
- var common = setup;
3893
-
3894
- (function (module, exports) {
3895
-
3896
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3897
-
3898
- /* eslint-env browser */
3899
-
3900
- /**
3901
- * This is the web browser implementation of `debug()`.
3902
- */
3903
- exports.log = log;
3904
- exports.formatArgs = formatArgs;
3905
- exports.save = save;
3906
- exports.load = load;
3907
- exports.useColors = useColors;
3908
- exports.storage = localstorage();
3909
- /**
3910
- * Colors.
3911
- */
3912
-
3913
- exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
3914
- /**
3915
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
3916
- * and the Firebug extension (any Firefox version) are known
3917
- * to support "%c" CSS customizations.
3918
- *
3919
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
3920
- */
3921
- // eslint-disable-next-line complexity
3922
-
3923
- function useColors() {
3924
- // NB: In an Electron preload script, document will be defined but not fully
3925
- // initialized. Since we know we're in Chrome, we'll just detect this case
3926
- // explicitly
3927
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
3928
- return true;
3929
- } // Internet Explorer and Edge do not support colors.
3930
-
3931
-
3932
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
3933
- return false;
3934
- } // Is webkit? http://stackoverflow.com/a/16459606/376773
3935
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
3936
-
3937
-
3938
- return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
3939
- typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
3940
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
3941
- typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
3942
- typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
3943
- }
3944
- /**
3945
- * Colorize log arguments if enabled.
3946
- *
3947
- * @api public
3948
- */
3949
-
3950
-
3951
- function formatArgs(args) {
3952
- args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
3953
-
3954
- if (!this.useColors) {
3955
- return;
3956
- }
3957
-
3958
- var c = 'color: ' + this.color;
3959
- args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
3960
- // arguments passed either before or after the %c, so we need to
3961
- // figure out the correct index to insert the CSS into
3962
-
3963
- var index = 0;
3964
- var lastC = 0;
3965
- args[0].replace(/%[a-zA-Z%]/g, function (match) {
3966
- if (match === '%%') {
3967
- return;
3968
- }
3969
-
3970
- index++;
3971
-
3972
- if (match === '%c') {
3973
- // We only are interested in the *last* %c
3974
- // (the user may have provided their own)
3975
- lastC = index;
3976
- }
3977
- });
3978
- args.splice(lastC, 0, c);
3979
- }
3980
- /**
3981
- * Invokes `console.log()` when available.
3982
- * No-op when `console.log` is not a "function".
3983
- *
3984
- * @api public
3985
- */
3986
-
3987
-
3988
- function log() {
3989
- var _console;
3990
-
3991
- // This hackery is required for IE8/9, where
3992
- // the `console.log` function doesn't have 'apply'
3993
- return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
3994
- }
3995
- /**
3996
- * Save `namespaces`.
3997
- *
3998
- * @param {String} namespaces
3999
- * @api private
4000
- */
4001
-
4002
-
4003
- function save(namespaces) {
4004
- try {
4005
- if (namespaces) {
4006
- exports.storage.setItem('debug', namespaces);
4007
- } else {
4008
- exports.storage.removeItem('debug');
4009
- }
4010
- } catch (error) {// Swallow
4011
- // XXX (@Qix-) should we be logging these?
4012
- }
4013
- }
4014
- /**
4015
- * Load `namespaces`.
4016
- *
4017
- * @return {String} returns the previously persisted debug modes
4018
- * @api private
4019
- */
4020
-
4021
-
4022
- function load() {
4023
- var r;
4024
-
4025
- try {
4026
- r = exports.storage.getItem('debug');
4027
- } catch (error) {} // Swallow
4028
- // XXX (@Qix-) should we be logging these?
4029
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
4030
-
4031
-
4032
- if (!r && typeof process !== 'undefined' && 'env' in process) {
4033
- r = process.env.DEBUG;
4034
- }
4035
-
4036
- return r;
4037
- }
4038
- /**
4039
- * Localstorage attempts to return the localstorage.
4040
- *
4041
- * This is necessary because safari throws
4042
- * when a user disables cookies/localstorage
4043
- * and you attempt to access it.
4044
- *
4045
- * @return {LocalStorage}
4046
- * @api private
4047
- */
4048
-
4049
-
4050
- function localstorage() {
4051
- try {
4052
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
4053
- // The Browser also has localStorage in the global context.
4054
- return localStorage;
4055
- } catch (error) {// Swallow
4056
- // XXX (@Qix-) should we be logging these?
4057
- }
4058
- }
4059
-
4060
- module.exports = common(exports);
4061
- var formatters = module.exports.formatters;
4062
- /**
4063
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
4064
- */
4065
-
4066
- formatters.j = function (v) {
4067
- try {
4068
- return JSON.stringify(v);
4069
- } catch (error) {
4070
- return '[UnexpectedJSONParseError]: ' + error.message;
4071
- }
4072
- };
4073
- }(browser, browser.exports));
4074
-
4075
- var debug = browser.exports;
4076
-
4077
- var defaults = {
4078
- choiceMode: 'radio',
4079
- feedbackEnabled: false,
4080
- headers: ['Column 1', 'Column 2', 'Column 3'],
4081
- layout: 3,
4082
- lockChoiceOrder: true,
4083
- partialScoring: false,
4084
- prompt: '',
4085
- promptEnabled: true,
4086
- rationale: '',
4087
- rationaleEnabled: true,
4088
- rows: [],
4089
- scoringType: 'auto',
4090
- studentInstructionsEnabled: true,
4091
- teacherInstructions: '',
4092
- teacherInstructionsEnabled: true,
4093
- toolbarEditorPosition: 'bottom'
4094
- };
4095
-
4096
- const _excluded = ["extraCSSRules", "feedbackEnabled", "promptEnabled", "prompt", "lockChoiceOrder"];
4097
- const log = debug('@pie-element:match:controller');
4098
-
4099
- const getResponseCorrectness = (model, answers, env = {}) => {
4100
- const isPartialScoring = partialScoring.enabled(model, env);
4101
- const rows = model.rows;
4102
- const checkboxMode = model.choiceMode === 'checkbox';
4103
-
4104
- if (!answers || Object.keys(answers).length === 0) {
4105
- return 'unanswered';
4106
- }
4107
-
4108
- const totalCorrectAnswers = checkboxMode ? getTotalCorrectAnswers(model) : getTotalCorrect(model);
4109
- let correctAnswers;
4110
- let incorrectAnswers = 0;
4111
-
4112
- if (checkboxMode) {
4113
- const checkboxes = getCheckboxes(rows, answers);
4114
- correctAnswers = checkboxes.correctAnswers;
4115
- incorrectAnswers = checkboxes.incorrectAnswers;
4116
- } else {
4117
- correctAnswers = getCorrectRadios(rows, answers);
4118
- }
4119
-
4120
- if (totalCorrectAnswers === correctAnswers && !incorrectAnswers) {
4121
- return 'correct';
4122
- } else if (correctAnswers === 0) {
4123
- return 'incorrect';
4124
- } else if (isPartialScoring) {
4125
- return 'partial';
4126
- }
4127
-
4128
- return 'incorrect';
4129
- };
4130
-
4131
- const getCorrectness = (question, env, answers = {}) => {
4132
- if (env.mode === 'evaluate') {
4133
- return getResponseCorrectness(question, answers, env);
4134
- }
4135
- };
4136
-
4137
- const getCheckboxes = (rows, answers) => {
4138
- let correctAnswers = 0;
4139
- let incorrectAnswers = 0;
4140
- rows.forEach(row => {
4141
- const answer = answers[row.id];
4142
-
4143
- if (answer) {
4144
- row.values.forEach((v, i) => {
4145
- if (answer[i] && answer[i] === v) {
4146
- correctAnswers += 1;
4147
- } else if (answer[i] && answer[i] !== v) {
4148
- incorrectAnswers += 1;
4149
- }
4150
- });
4151
- }
4152
- });
4153
- return {
4154
- correctAnswers,
4155
- incorrectAnswers
4156
- };
4157
- };
4158
-
4159
- const getCorrectRadios = (rows, answers) => {
4160
- let correctAnswers = 0;
4161
- rows.forEach(row => {
4162
- if (isEqual_1(row.values, answers[row.id])) {
4163
- correctAnswers += 1;
4164
- }
4165
- });
4166
- return correctAnswers;
4167
- };
4168
-
4169
- const getTotalCorrect = question => {
4170
- const checkboxMode = question.choiceMode === 'checkbox';
4171
- const matchingTable = checkboxMode ? question.layout - 1 : 1;
4172
- return (question.rows.length || 0) * matchingTable;
4173
- };
4174
-
4175
- const getTotalCorrectAnswers = question => {
4176
- let noOfTotalCorrectAnswers = 0;
4177
- question.rows.forEach(row => {
4178
- row.values.forEach(value => {
4179
- if (value) {
4180
- noOfTotalCorrectAnswers += 1;
4181
- }
4182
- });
4183
- });
4184
- return noOfTotalCorrectAnswers;
4185
- };
4186
-
4187
- const getPartialScore = (question, answers) => {
4188
- const checkboxMode = question.choiceMode === 'checkbox';
4189
-
4190
- if (checkboxMode) {
4191
- const {
4192
- correctAnswers,
4193
- incorrectAnswers
4194
- } = getCheckboxes(question.rows, answers);
4195
- const totalCorrect = getTotalCorrectAnswers(question);
4196
- const total = totalCorrect === 0 ? 1 : totalCorrect;
4197
-
4198
- if (correctAnswers + incorrectAnswers > totalCorrect) {
4199
- const extraAnswers = correctAnswers + incorrectAnswers - totalCorrect;
4200
- const score = parseFloat(((correctAnswers - extraAnswers) / total).toFixed(2));
4201
- return score < 0 ? 0 : score;
4202
- } else {
4203
- return parseFloat((correctAnswers / total).toFixed(2));
4204
- }
4205
- } else {
4206
- const correctAnswers = getCorrectRadios(question.rows, answers);
4207
- const totalCorrect = getTotalCorrect(question) === 0 ? 1 : getTotalCorrect(question);
4208
- return parseFloat((correctAnswers / totalCorrect).toFixed(2));
4209
- }
4210
- };
4211
-
4212
- const getOutComeScore = (question, env, answers = {}) => {
4213
- const correctness = getCorrectness(question, env, answers);
4214
- const isPartialScoring = partialScoring.enabled(question, env);
4215
- return correctness === 'correct' ? 1 : correctness === 'partial' && isPartialScoring ? getPartialScore(question, answers) : 0;
4216
- };
4217
-
4218
- const outcome = (question, session, env) => {
4219
- return new Promise(resolve => {
4220
- if (env.mode !== 'evaluate') {
4221
- resolve({
4222
- score: undefined,
4223
- completed: undefined
4224
- });
4225
- } else {
4226
- if (!session || isEmpty_1(session)) {
4227
- resolve({
4228
- score: 0,
4229
- empty: true
4230
- });
4231
- }
4232
-
4233
- const out = {
4234
- score: getOutComeScore(question, env, session.answers)
4235
- };
4236
- resolve(out);
4237
- }
4238
- });
4239
- };
4240
- function createDefaultModel(model = {}) {
4241
- return new Promise(resolve => {
4242
- resolve(_extends({}, defaults, model));
4243
- });
4244
- }
4245
- const normalize = question => _extends({}, defaults, question);
4246
- /**
4247
- *
4248
- * @param {*} question
4249
- * @param {*} session
4250
- * @param {*} env
4251
- * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.
4252
- */
4253
-
4254
- function model(question, session, env, updateSession) {
4255
- return new Promise(async resolve => {
4256
- const normalizedQuestion = cloneDeep_1(normalize(question));
4257
- let correctness, score;
4258
-
4259
- if ((!session || isEmpty_1(session)) && env.mode === 'evaluate') {
4260
- correctness = 'unanswered';
4261
- score = '0%';
4262
- } else {
4263
- correctness = getCorrectness(normalizedQuestion, env, session && session.answers);
4264
- score = `${getOutComeScore(normalizedQuestion, env, session && session.answers) * 100}%`;
4265
- }
4266
-
4267
- const correctResponse = {};
4268
- const correctInfo = {
4269
- score,
4270
- correctness
4271
- };
4272
- const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);
4273
-
4274
- if (!lockChoiceOrder) {
4275
- normalizedQuestion.rows = await getShuffledChoices(normalizedQuestion.rows, session, updateSession, 'id');
4276
- }
4277
-
4278
- normalizedQuestion.rows.forEach(row => {
4279
- correctResponse[row.id] = row.values;
4280
-
4281
- if (env.mode !== 'evaluate') {
4282
- delete row.values;
4283
- }
4284
- });
4285
- const fb = env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled ? getFeedbackForCorrectness(correctInfo.correctness, normalizedQuestion.feedback) : Promise.resolve(undefined);
4286
- fb.then(feedback => {
4287
- const {
4288
- extraCSSRules,
4289
- feedbackEnabled,
4290
- promptEnabled,
4291
- prompt,
4292
- lockChoiceOrder
4293
- } = normalizedQuestion,
4294
- essentials = _objectWithoutPropertiesLoose(normalizedQuestion, _excluded);
4295
-
4296
- const out = _extends({}, essentials, {
4297
- extraCSSRules,
4298
- allowFeedback: feedbackEnabled,
4299
- prompt: promptEnabled ? prompt : null,
4300
- shuffled: !lockChoiceOrder,
4301
- feedback,
4302
- disabled: env.mode !== 'gather',
4303
- view: env.mode === 'view'
4304
- });
4305
-
4306
- if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {
4307
- out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;
4308
- out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;
4309
- } else {
4310
- out.rationale = null;
4311
- out.teacherInstructions = null;
4312
- }
4313
-
4314
- if (env.mode === 'evaluate') {
4315
- Object.assign(out, {
4316
- correctResponse,
4317
- correctness: correctInfo
4318
- });
4319
- }
4320
-
4321
- log('out: ', out);
4322
- resolve(out);
4323
- });
4324
- });
4325
- }
4326
- const createCorrectResponseSession = (question, env) => {
4327
- return new Promise(resolve => {
4328
- if (env.mode !== 'evaluate' && env.role === 'instructor') {
4329
- const {
4330
- rows
4331
- } = question;
4332
- const answers = {};
4333
- rows.forEach(r => {
4334
- answers[r.id] = r.values;
4335
- });
4336
- resolve({
4337
- answers,
4338
- id: '1'
4339
- });
4340
- } else {
4341
- resolve(null);
4342
- }
4343
- });
4344
- }; // remove all html tags
4345
-
4346
- const getInnerText = html => (html || '').replaceAll(/<[^>]*>/g, ''); // remove all html tags except img, iframe and source tag for audio
4347
-
4348
-
4349
- const getContent = html => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
4350
-
4351
- const validate = (model = {}, config = {}) => {
4352
- const {
4353
- rows,
4354
- choiceMode,
4355
- headers
4356
- } = model;
4357
- const {
4358
- minQuestions,
4359
- maxQuestions,
4360
- maxLengthQuestionsHeading,
4361
- maxAnswers,
4362
- maxLengthAnswers,
4363
- maxLengthFirstColumnHeading
4364
- } = config;
4365
- const rowsErrors = {};
4366
- const columnsErrors = {};
4367
- const errors = {};
4368
- ['teacherInstructions', 'prompt', 'rationale'].forEach(field => {
4369
- var _config$field;
4370
-
4371
- if ((_config$field = config[field]) != null && _config$field.required && !getContent(model[field])) {
4372
- errors[field] = 'This field is required.';
4373
- }
4374
- });
4375
-
4376
- if (rows.length < minQuestions) {
4377
- errors.noOfRowsError = `There should be at least ${minQuestions} question rows.`;
4378
- } else if (rows.length > maxQuestions) {
4379
- errors.noOfRowsError = `No more than ${maxQuestions} question rows should be defined.`;
4380
- }
4381
-
4382
- (rows || []).forEach((row, index) => {
4383
- const {
4384
- id,
4385
- values = [],
4386
- title
4387
- } = row;
4388
- rowsErrors[id] = '';
4389
-
4390
- if (maxLengthQuestionsHeading && getInnerText(title).length > maxLengthQuestionsHeading) {
4391
- rowsErrors[id] += `Content length should be maximum ${maxLengthQuestionsHeading} characters. `;
4392
- }
4393
-
4394
- if (!getContent(title)) {
4395
- rowsErrors[id] += 'Content should not be empty. ';
4396
- } else {
4397
- // check for identical content with the previous answers
4398
- const identicalAnswer = rows.slice(0, index).some(r => getContent(r.title) === getContent(title));
4399
-
4400
- if (identicalAnswer) {
4401
- rowsErrors[id] += 'Content should be unique. ';
4402
- }
4403
- }
4404
-
4405
- const hasCorrectResponse = values.some(value => !!value);
4406
-
4407
- if (!hasCorrectResponse) {
4408
- rowsErrors[id] += 'No correct response defined.';
4409
- }
4410
- });
4411
-
4412
- if (maxAnswers && headers.length - 1 > maxAnswers) {
4413
- errors.columnsLengthError = `There should be maximum ${maxAnswers} answers.`;
4414
- }
4415
-
4416
- if (maxLengthFirstColumnHeading && headers[0].length > maxLengthFirstColumnHeading) {
4417
- columnsErrors[0] = `Content length should be maximum ${maxLengthFirstColumnHeading} characters.`;
4418
- }
4419
-
4420
- const headersContent = (headers || []).map(heading => getContent(heading));
4421
- headersContent.shift(); // remove first column since it does not require validation
4422
-
4423
- headersContent.forEach((heading, index) => {
4424
- const headerIndex = index + 1; // we need to add 1 because we removed first header from validation
4425
-
4426
- columnsErrors[headerIndex] = '';
4427
-
4428
- if (maxLengthAnswers && getInnerText(heading).length > maxLengthAnswers) {
4429
- columnsErrors[headerIndex] += `Content length should be maximum ${maxLengthAnswers} characters. `;
4430
- }
4431
-
4432
- if (!heading) {
4433
- columnsErrors[headerIndex] += 'Content should not be empty.';
4434
- } else {
4435
- // check for identical content with the previous headers
4436
- const identicalAnswer = headersContent.slice(0, index).some(head => head === heading);
4437
-
4438
- if (identicalAnswer) {
4439
- columnsErrors[index + 1] += 'Content should be unique.';
4440
- }
4441
- }
4442
- });
4443
- const hasRowErrors = Object.values(rowsErrors).some(error => (error || '').length);
4444
-
4445
- if (hasRowErrors) {
4446
- errors.rowsErrors = rowsErrors;
4447
- const noCorrectAnswer = Object.values(rowsErrors).some(error => (error || '').includes('No correct response defined.'));
4448
-
4449
- if (noCorrectAnswer) {
4450
- errors.correctResponseError = choiceMode === 'radio' ? 'There should be a correct response defined for every row.' : 'There should be at least one correct response defined for every row.';
4451
- }
4452
- }
4453
-
4454
- const hasColumnErrors = Object.values(columnsErrors).some(error => (error || '').length);
4455
-
4456
- if (hasColumnErrors) {
4457
- errors.columnsErrors = columnsErrors;
4458
- }
4459
-
4460
- return errors;
4461
- };
4462
-
4463
- export { createCorrectResponseSession, createDefaultModel, model, normalize, outcome, validate };
4464
- //# sourceMappingURL=controller.js.map