@pie-lib/controller-utils 0.22.2 → 0.22.3-next.2

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.
package/esm/index.js ADDED
@@ -0,0 +1,3011 @@
1
+ const enabled = (config, env, defaultValue) => {
2
+ // if model.partialScoring = false
3
+ // - if env.partialScoring = false || env.partialScoring = true => use dichotomous scoring
4
+ // else if model.partialScoring = true || undefined
5
+ // - if env.partialScoring = false, use dichotomous scoring
6
+ // - else if env.partialScoring = true, use partial scoring
7
+ config = config || {};
8
+ env = env || {};
9
+
10
+ if (config.partialScoring === false) {
11
+ return false;
12
+ }
13
+
14
+ if (env.partialScoring === false) {
15
+ return false;
16
+ }
17
+
18
+ return typeof defaultValue === 'boolean' ? defaultValue : true;
19
+ };
20
+
21
+ var partialScoring = /*#__PURE__*/Object.freeze({
22
+ __proto__: null,
23
+ enabled: enabled
24
+ });
25
+
26
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
27
+
28
+ function getDefaultExportFromCjs (x) {
29
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
30
+ }
31
+
32
+ /**
33
+ * Checks if `value` is classified as an `Array` object.
34
+ *
35
+ * @static
36
+ * @memberOf _
37
+ * @since 0.1.0
38
+ * @category Lang
39
+ * @param {*} value The value to check.
40
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
41
+ * @example
42
+ *
43
+ * _.isArray([1, 2, 3]);
44
+ * // => true
45
+ *
46
+ * _.isArray(document.body.children);
47
+ * // => false
48
+ *
49
+ * _.isArray('abc');
50
+ * // => false
51
+ *
52
+ * _.isArray(_.noop);
53
+ * // => false
54
+ */
55
+
56
+ var isArray_1;
57
+ var hasRequiredIsArray;
58
+
59
+ function requireIsArray () {
60
+ if (hasRequiredIsArray) return isArray_1;
61
+ hasRequiredIsArray = 1;
62
+ var isArray = Array.isArray;
63
+
64
+ isArray_1 = isArray;
65
+ return isArray_1;
66
+ }
67
+
68
+ /** Detect free variable `global` from Node.js. */
69
+
70
+ var _freeGlobal;
71
+ var hasRequired_freeGlobal;
72
+
73
+ function require_freeGlobal () {
74
+ if (hasRequired_freeGlobal) return _freeGlobal;
75
+ hasRequired_freeGlobal = 1;
76
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
77
+
78
+ _freeGlobal = freeGlobal;
79
+ return _freeGlobal;
80
+ }
81
+
82
+ var _root;
83
+ var hasRequired_root;
84
+
85
+ function require_root () {
86
+ if (hasRequired_root) return _root;
87
+ hasRequired_root = 1;
88
+ var freeGlobal = require_freeGlobal();
89
+
90
+ /** Detect free variable `self`. */
91
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
92
+
93
+ /** Used as a reference to the global object. */
94
+ var root = freeGlobal || freeSelf || Function('return this')();
95
+
96
+ _root = root;
97
+ return _root;
98
+ }
99
+
100
+ var _Symbol;
101
+ var hasRequired_Symbol;
102
+
103
+ function require_Symbol () {
104
+ if (hasRequired_Symbol) return _Symbol;
105
+ hasRequired_Symbol = 1;
106
+ var root = require_root();
107
+
108
+ /** Built-in value references. */
109
+ var Symbol = root.Symbol;
110
+
111
+ _Symbol = Symbol;
112
+ return _Symbol;
113
+ }
114
+
115
+ var _getRawTag;
116
+ var hasRequired_getRawTag;
117
+
118
+ function require_getRawTag () {
119
+ if (hasRequired_getRawTag) return _getRawTag;
120
+ hasRequired_getRawTag = 1;
121
+ var Symbol = require_Symbol();
122
+
123
+ /** Used for built-in method references. */
124
+ var objectProto = Object.prototype;
125
+
126
+ /** Used to check objects for own properties. */
127
+ var hasOwnProperty = objectProto.hasOwnProperty;
128
+
129
+ /**
130
+ * Used to resolve the
131
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
132
+ * of values.
133
+ */
134
+ var nativeObjectToString = objectProto.toString;
135
+
136
+ /** Built-in value references. */
137
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
138
+
139
+ /**
140
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
141
+ *
142
+ * @private
143
+ * @param {*} value The value to query.
144
+ * @returns {string} Returns the raw `toStringTag`.
145
+ */
146
+ function getRawTag(value) {
147
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
148
+ tag = value[symToStringTag];
149
+
150
+ try {
151
+ value[symToStringTag] = undefined;
152
+ var unmasked = true;
153
+ } catch (e) {}
154
+
155
+ var result = nativeObjectToString.call(value);
156
+ if (unmasked) {
157
+ if (isOwn) {
158
+ value[symToStringTag] = tag;
159
+ } else {
160
+ delete value[symToStringTag];
161
+ }
162
+ }
163
+ return result;
164
+ }
165
+
166
+ _getRawTag = getRawTag;
167
+ return _getRawTag;
168
+ }
169
+
170
+ /** Used for built-in method references. */
171
+
172
+ var _objectToString;
173
+ var hasRequired_objectToString;
174
+
175
+ function require_objectToString () {
176
+ if (hasRequired_objectToString) return _objectToString;
177
+ hasRequired_objectToString = 1;
178
+ var objectProto = Object.prototype;
179
+
180
+ /**
181
+ * Used to resolve the
182
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
183
+ * of values.
184
+ */
185
+ var nativeObjectToString = objectProto.toString;
186
+
187
+ /**
188
+ * Converts `value` to a string using `Object.prototype.toString`.
189
+ *
190
+ * @private
191
+ * @param {*} value The value to convert.
192
+ * @returns {string} Returns the converted string.
193
+ */
194
+ function objectToString(value) {
195
+ return nativeObjectToString.call(value);
196
+ }
197
+
198
+ _objectToString = objectToString;
199
+ return _objectToString;
200
+ }
201
+
202
+ var _baseGetTag;
203
+ var hasRequired_baseGetTag;
204
+
205
+ function require_baseGetTag () {
206
+ if (hasRequired_baseGetTag) return _baseGetTag;
207
+ hasRequired_baseGetTag = 1;
208
+ var Symbol = require_Symbol(),
209
+ getRawTag = require_getRawTag(),
210
+ objectToString = require_objectToString();
211
+
212
+ /** `Object#toString` result references. */
213
+ var nullTag = '[object Null]',
214
+ undefinedTag = '[object Undefined]';
215
+
216
+ /** Built-in value references. */
217
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
218
+
219
+ /**
220
+ * The base implementation of `getTag` without fallbacks for buggy environments.
221
+ *
222
+ * @private
223
+ * @param {*} value The value to query.
224
+ * @returns {string} Returns the `toStringTag`.
225
+ */
226
+ function baseGetTag(value) {
227
+ if (value == null) {
228
+ return value === undefined ? undefinedTag : nullTag;
229
+ }
230
+ return (symToStringTag && symToStringTag in Object(value))
231
+ ? getRawTag(value)
232
+ : objectToString(value);
233
+ }
234
+
235
+ _baseGetTag = baseGetTag;
236
+ return _baseGetTag;
237
+ }
238
+
239
+ /**
240
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
241
+ * and has a `typeof` result of "object".
242
+ *
243
+ * @static
244
+ * @memberOf _
245
+ * @since 4.0.0
246
+ * @category Lang
247
+ * @param {*} value The value to check.
248
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
249
+ * @example
250
+ *
251
+ * _.isObjectLike({});
252
+ * // => true
253
+ *
254
+ * _.isObjectLike([1, 2, 3]);
255
+ * // => true
256
+ *
257
+ * _.isObjectLike(_.noop);
258
+ * // => false
259
+ *
260
+ * _.isObjectLike(null);
261
+ * // => false
262
+ */
263
+
264
+ var isObjectLike_1;
265
+ var hasRequiredIsObjectLike;
266
+
267
+ function requireIsObjectLike () {
268
+ if (hasRequiredIsObjectLike) return isObjectLike_1;
269
+ hasRequiredIsObjectLike = 1;
270
+ function isObjectLike(value) {
271
+ return value != null && typeof value == 'object';
272
+ }
273
+
274
+ isObjectLike_1 = isObjectLike;
275
+ return isObjectLike_1;
276
+ }
277
+
278
+ var isSymbol_1;
279
+ var hasRequiredIsSymbol;
280
+
281
+ function requireIsSymbol () {
282
+ if (hasRequiredIsSymbol) return isSymbol_1;
283
+ hasRequiredIsSymbol = 1;
284
+ var baseGetTag = require_baseGetTag(),
285
+ isObjectLike = requireIsObjectLike();
286
+
287
+ /** `Object#toString` result references. */
288
+ var symbolTag = '[object Symbol]';
289
+
290
+ /**
291
+ * Checks if `value` is classified as a `Symbol` primitive or object.
292
+ *
293
+ * @static
294
+ * @memberOf _
295
+ * @since 4.0.0
296
+ * @category Lang
297
+ * @param {*} value The value to check.
298
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
299
+ * @example
300
+ *
301
+ * _.isSymbol(Symbol.iterator);
302
+ * // => true
303
+ *
304
+ * _.isSymbol('abc');
305
+ * // => false
306
+ */
307
+ function isSymbol(value) {
308
+ return typeof value == 'symbol' ||
309
+ (isObjectLike(value) && baseGetTag(value) == symbolTag);
310
+ }
311
+
312
+ isSymbol_1 = isSymbol;
313
+ return isSymbol_1;
314
+ }
315
+
316
+ var _isKey;
317
+ var hasRequired_isKey;
318
+
319
+ function require_isKey () {
320
+ if (hasRequired_isKey) return _isKey;
321
+ hasRequired_isKey = 1;
322
+ var isArray = requireIsArray(),
323
+ isSymbol = requireIsSymbol();
324
+
325
+ /** Used to match property names within property paths. */
326
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
327
+ reIsPlainProp = /^\w*$/;
328
+
329
+ /**
330
+ * Checks if `value` is a property name and not a property path.
331
+ *
332
+ * @private
333
+ * @param {*} value The value to check.
334
+ * @param {Object} [object] The object to query keys on.
335
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
336
+ */
337
+ function isKey(value, object) {
338
+ if (isArray(value)) {
339
+ return false;
340
+ }
341
+ var type = typeof value;
342
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
343
+ value == null || isSymbol(value)) {
344
+ return true;
345
+ }
346
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
347
+ (object != null && value in Object(object));
348
+ }
349
+
350
+ _isKey = isKey;
351
+ return _isKey;
352
+ }
353
+
354
+ /**
355
+ * Checks if `value` is the
356
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
357
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
358
+ *
359
+ * @static
360
+ * @memberOf _
361
+ * @since 0.1.0
362
+ * @category Lang
363
+ * @param {*} value The value to check.
364
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
365
+ * @example
366
+ *
367
+ * _.isObject({});
368
+ * // => true
369
+ *
370
+ * _.isObject([1, 2, 3]);
371
+ * // => true
372
+ *
373
+ * _.isObject(_.noop);
374
+ * // => true
375
+ *
376
+ * _.isObject(null);
377
+ * // => false
378
+ */
379
+
380
+ var isObject_1;
381
+ var hasRequiredIsObject;
382
+
383
+ function requireIsObject () {
384
+ if (hasRequiredIsObject) return isObject_1;
385
+ hasRequiredIsObject = 1;
386
+ function isObject(value) {
387
+ var type = typeof value;
388
+ return value != null && (type == 'object' || type == 'function');
389
+ }
390
+
391
+ isObject_1 = isObject;
392
+ return isObject_1;
393
+ }
394
+
395
+ var isFunction_1;
396
+ var hasRequiredIsFunction;
397
+
398
+ function requireIsFunction () {
399
+ if (hasRequiredIsFunction) return isFunction_1;
400
+ hasRequiredIsFunction = 1;
401
+ var baseGetTag = require_baseGetTag(),
402
+ isObject = requireIsObject();
403
+
404
+ /** `Object#toString` result references. */
405
+ var asyncTag = '[object AsyncFunction]',
406
+ funcTag = '[object Function]',
407
+ genTag = '[object GeneratorFunction]',
408
+ proxyTag = '[object Proxy]';
409
+
410
+ /**
411
+ * Checks if `value` is classified as a `Function` object.
412
+ *
413
+ * @static
414
+ * @memberOf _
415
+ * @since 0.1.0
416
+ * @category Lang
417
+ * @param {*} value The value to check.
418
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
419
+ * @example
420
+ *
421
+ * _.isFunction(_);
422
+ * // => true
423
+ *
424
+ * _.isFunction(/abc/);
425
+ * // => false
426
+ */
427
+ function isFunction(value) {
428
+ if (!isObject(value)) {
429
+ return false;
430
+ }
431
+ // The use of `Object#toString` avoids issues with the `typeof` operator
432
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
433
+ var tag = baseGetTag(value);
434
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
435
+ }
436
+
437
+ isFunction_1 = isFunction;
438
+ return isFunction_1;
439
+ }
440
+
441
+ var _coreJsData;
442
+ var hasRequired_coreJsData;
443
+
444
+ function require_coreJsData () {
445
+ if (hasRequired_coreJsData) return _coreJsData;
446
+ hasRequired_coreJsData = 1;
447
+ var root = require_root();
448
+
449
+ /** Used to detect overreaching core-js shims. */
450
+ var coreJsData = root['__core-js_shared__'];
451
+
452
+ _coreJsData = coreJsData;
453
+ return _coreJsData;
454
+ }
455
+
456
+ var _isMasked;
457
+ var hasRequired_isMasked;
458
+
459
+ function require_isMasked () {
460
+ if (hasRequired_isMasked) return _isMasked;
461
+ hasRequired_isMasked = 1;
462
+ var coreJsData = require_coreJsData();
463
+
464
+ /** Used to detect methods masquerading as native. */
465
+ var maskSrcKey = (function() {
466
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
467
+ return uid ? ('Symbol(src)_1.' + uid) : '';
468
+ }());
469
+
470
+ /**
471
+ * Checks if `func` has its source masked.
472
+ *
473
+ * @private
474
+ * @param {Function} func The function to check.
475
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
476
+ */
477
+ function isMasked(func) {
478
+ return !!maskSrcKey && (maskSrcKey in func);
479
+ }
480
+
481
+ _isMasked = isMasked;
482
+ return _isMasked;
483
+ }
484
+
485
+ /** Used for built-in method references. */
486
+
487
+ var _toSource;
488
+ var hasRequired_toSource;
489
+
490
+ function require_toSource () {
491
+ if (hasRequired_toSource) return _toSource;
492
+ hasRequired_toSource = 1;
493
+ var funcProto = Function.prototype;
494
+
495
+ /** Used to resolve the decompiled source of functions. */
496
+ var funcToString = funcProto.toString;
497
+
498
+ /**
499
+ * Converts `func` to its source code.
500
+ *
501
+ * @private
502
+ * @param {Function} func The function to convert.
503
+ * @returns {string} Returns the source code.
504
+ */
505
+ function toSource(func) {
506
+ if (func != null) {
507
+ try {
508
+ return funcToString.call(func);
509
+ } catch (e) {}
510
+ try {
511
+ return (func + '');
512
+ } catch (e) {}
513
+ }
514
+ return '';
515
+ }
516
+
517
+ _toSource = toSource;
518
+ return _toSource;
519
+ }
520
+
521
+ var _baseIsNative;
522
+ var hasRequired_baseIsNative;
523
+
524
+ function require_baseIsNative () {
525
+ if (hasRequired_baseIsNative) return _baseIsNative;
526
+ hasRequired_baseIsNative = 1;
527
+ var isFunction = requireIsFunction(),
528
+ isMasked = require_isMasked(),
529
+ isObject = requireIsObject(),
530
+ toSource = require_toSource();
531
+
532
+ /**
533
+ * Used to match `RegExp`
534
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
535
+ */
536
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
537
+
538
+ /** Used to detect host constructors (Safari). */
539
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
540
+
541
+ /** Used for built-in method references. */
542
+ var funcProto = Function.prototype,
543
+ objectProto = Object.prototype;
544
+
545
+ /** Used to resolve the decompiled source of functions. */
546
+ var funcToString = funcProto.toString;
547
+
548
+ /** Used to check objects for own properties. */
549
+ var hasOwnProperty = objectProto.hasOwnProperty;
550
+
551
+ /** Used to detect if a method is native. */
552
+ var reIsNative = RegExp('^' +
553
+ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
554
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
555
+ );
556
+
557
+ /**
558
+ * The base implementation of `_.isNative` without bad shim checks.
559
+ *
560
+ * @private
561
+ * @param {*} value The value to check.
562
+ * @returns {boolean} Returns `true` if `value` is a native function,
563
+ * else `false`.
564
+ */
565
+ function baseIsNative(value) {
566
+ if (!isObject(value) || isMasked(value)) {
567
+ return false;
568
+ }
569
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
570
+ return pattern.test(toSource(value));
571
+ }
572
+
573
+ _baseIsNative = baseIsNative;
574
+ return _baseIsNative;
575
+ }
576
+
577
+ /**
578
+ * Gets the value at `key` of `object`.
579
+ *
580
+ * @private
581
+ * @param {Object} [object] The object to query.
582
+ * @param {string} key The key of the property to get.
583
+ * @returns {*} Returns the property value.
584
+ */
585
+
586
+ var _getValue;
587
+ var hasRequired_getValue;
588
+
589
+ function require_getValue () {
590
+ if (hasRequired_getValue) return _getValue;
591
+ hasRequired_getValue = 1;
592
+ function getValue(object, key) {
593
+ return object == null ? undefined : object[key];
594
+ }
595
+
596
+ _getValue = getValue;
597
+ return _getValue;
598
+ }
599
+
600
+ var _getNative;
601
+ var hasRequired_getNative;
602
+
603
+ function require_getNative () {
604
+ if (hasRequired_getNative) return _getNative;
605
+ hasRequired_getNative = 1;
606
+ var baseIsNative = require_baseIsNative(),
607
+ getValue = require_getValue();
608
+
609
+ /**
610
+ * Gets the native function at `key` of `object`.
611
+ *
612
+ * @private
613
+ * @param {Object} object The object to query.
614
+ * @param {string} key The key of the method to get.
615
+ * @returns {*} Returns the function if it's native, else `undefined`.
616
+ */
617
+ function getNative(object, key) {
618
+ var value = getValue(object, key);
619
+ return baseIsNative(value) ? value : undefined;
620
+ }
621
+
622
+ _getNative = getNative;
623
+ return _getNative;
624
+ }
625
+
626
+ var _nativeCreate;
627
+ var hasRequired_nativeCreate;
628
+
629
+ function require_nativeCreate () {
630
+ if (hasRequired_nativeCreate) return _nativeCreate;
631
+ hasRequired_nativeCreate = 1;
632
+ var getNative = require_getNative();
633
+
634
+ /* Built-in method references that are verified to be native. */
635
+ var nativeCreate = getNative(Object, 'create');
636
+
637
+ _nativeCreate = nativeCreate;
638
+ return _nativeCreate;
639
+ }
640
+
641
+ var _hashClear;
642
+ var hasRequired_hashClear;
643
+
644
+ function require_hashClear () {
645
+ if (hasRequired_hashClear) return _hashClear;
646
+ hasRequired_hashClear = 1;
647
+ var nativeCreate = require_nativeCreate();
648
+
649
+ /**
650
+ * Removes all key-value entries from the hash.
651
+ *
652
+ * @private
653
+ * @name clear
654
+ * @memberOf Hash
655
+ */
656
+ function hashClear() {
657
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
658
+ this.size = 0;
659
+ }
660
+
661
+ _hashClear = hashClear;
662
+ return _hashClear;
663
+ }
664
+
665
+ /**
666
+ * Removes `key` and its value from the hash.
667
+ *
668
+ * @private
669
+ * @name delete
670
+ * @memberOf Hash
671
+ * @param {Object} hash The hash to modify.
672
+ * @param {string} key The key of the value to remove.
673
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
674
+ */
675
+
676
+ var _hashDelete;
677
+ var hasRequired_hashDelete;
678
+
679
+ function require_hashDelete () {
680
+ if (hasRequired_hashDelete) return _hashDelete;
681
+ hasRequired_hashDelete = 1;
682
+ function hashDelete(key) {
683
+ var result = this.has(key) && delete this.__data__[key];
684
+ this.size -= result ? 1 : 0;
685
+ return result;
686
+ }
687
+
688
+ _hashDelete = hashDelete;
689
+ return _hashDelete;
690
+ }
691
+
692
+ var _hashGet;
693
+ var hasRequired_hashGet;
694
+
695
+ function require_hashGet () {
696
+ if (hasRequired_hashGet) return _hashGet;
697
+ hasRequired_hashGet = 1;
698
+ var nativeCreate = require_nativeCreate();
699
+
700
+ /** Used to stand-in for `undefined` hash values. */
701
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
702
+
703
+ /** Used for built-in method references. */
704
+ var objectProto = Object.prototype;
705
+
706
+ /** Used to check objects for own properties. */
707
+ var hasOwnProperty = objectProto.hasOwnProperty;
708
+
709
+ /**
710
+ * Gets the hash value for `key`.
711
+ *
712
+ * @private
713
+ * @name get
714
+ * @memberOf Hash
715
+ * @param {string} key The key of the value to get.
716
+ * @returns {*} Returns the entry value.
717
+ */
718
+ function hashGet(key) {
719
+ var data = this.__data__;
720
+ if (nativeCreate) {
721
+ var result = data[key];
722
+ return result === HASH_UNDEFINED ? undefined : result;
723
+ }
724
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
725
+ }
726
+
727
+ _hashGet = hashGet;
728
+ return _hashGet;
729
+ }
730
+
731
+ var _hashHas;
732
+ var hasRequired_hashHas;
733
+
734
+ function require_hashHas () {
735
+ if (hasRequired_hashHas) return _hashHas;
736
+ hasRequired_hashHas = 1;
737
+ var nativeCreate = require_nativeCreate();
738
+
739
+ /** Used for built-in method references. */
740
+ var objectProto = Object.prototype;
741
+
742
+ /** Used to check objects for own properties. */
743
+ var hasOwnProperty = objectProto.hasOwnProperty;
744
+
745
+ /**
746
+ * Checks if a hash value for `key` exists.
747
+ *
748
+ * @private
749
+ * @name has
750
+ * @memberOf Hash
751
+ * @param {string} key The key of the entry to check.
752
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
753
+ */
754
+ function hashHas(key) {
755
+ var data = this.__data__;
756
+ return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
757
+ }
758
+
759
+ _hashHas = hashHas;
760
+ return _hashHas;
761
+ }
762
+
763
+ var _hashSet;
764
+ var hasRequired_hashSet;
765
+
766
+ function require_hashSet () {
767
+ if (hasRequired_hashSet) return _hashSet;
768
+ hasRequired_hashSet = 1;
769
+ var nativeCreate = require_nativeCreate();
770
+
771
+ /** Used to stand-in for `undefined` hash values. */
772
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
773
+
774
+ /**
775
+ * Sets the hash `key` to `value`.
776
+ *
777
+ * @private
778
+ * @name set
779
+ * @memberOf Hash
780
+ * @param {string} key The key of the value to set.
781
+ * @param {*} value The value to set.
782
+ * @returns {Object} Returns the hash instance.
783
+ */
784
+ function hashSet(key, value) {
785
+ var data = this.__data__;
786
+ this.size += this.has(key) ? 0 : 1;
787
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
788
+ return this;
789
+ }
790
+
791
+ _hashSet = hashSet;
792
+ return _hashSet;
793
+ }
794
+
795
+ var _Hash;
796
+ var hasRequired_Hash;
797
+
798
+ function require_Hash () {
799
+ if (hasRequired_Hash) return _Hash;
800
+ hasRequired_Hash = 1;
801
+ var hashClear = require_hashClear(),
802
+ hashDelete = require_hashDelete(),
803
+ hashGet = require_hashGet(),
804
+ hashHas = require_hashHas(),
805
+ hashSet = require_hashSet();
806
+
807
+ /**
808
+ * Creates a hash object.
809
+ *
810
+ * @private
811
+ * @constructor
812
+ * @param {Array} [entries] The key-value pairs to cache.
813
+ */
814
+ function Hash(entries) {
815
+ var index = -1,
816
+ length = entries == null ? 0 : entries.length;
817
+
818
+ this.clear();
819
+ while (++index < length) {
820
+ var entry = entries[index];
821
+ this.set(entry[0], entry[1]);
822
+ }
823
+ }
824
+
825
+ // Add methods to `Hash`.
826
+ Hash.prototype.clear = hashClear;
827
+ Hash.prototype['delete'] = hashDelete;
828
+ Hash.prototype.get = hashGet;
829
+ Hash.prototype.has = hashHas;
830
+ Hash.prototype.set = hashSet;
831
+
832
+ _Hash = Hash;
833
+ return _Hash;
834
+ }
835
+
836
+ /**
837
+ * Removes all key-value entries from the list cache.
838
+ *
839
+ * @private
840
+ * @name clear
841
+ * @memberOf ListCache
842
+ */
843
+
844
+ var _listCacheClear;
845
+ var hasRequired_listCacheClear;
846
+
847
+ function require_listCacheClear () {
848
+ if (hasRequired_listCacheClear) return _listCacheClear;
849
+ hasRequired_listCacheClear = 1;
850
+ function listCacheClear() {
851
+ this.__data__ = [];
852
+ this.size = 0;
853
+ }
854
+
855
+ _listCacheClear = listCacheClear;
856
+ return _listCacheClear;
857
+ }
858
+
859
+ /**
860
+ * Performs a
861
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
862
+ * comparison between two values to determine if they are equivalent.
863
+ *
864
+ * @static
865
+ * @memberOf _
866
+ * @since 4.0.0
867
+ * @category Lang
868
+ * @param {*} value The value to compare.
869
+ * @param {*} other The other value to compare.
870
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
871
+ * @example
872
+ *
873
+ * var object = { 'a': 1 };
874
+ * var other = { 'a': 1 };
875
+ *
876
+ * _.eq(object, object);
877
+ * // => true
878
+ *
879
+ * _.eq(object, other);
880
+ * // => false
881
+ *
882
+ * _.eq('a', 'a');
883
+ * // => true
884
+ *
885
+ * _.eq('a', Object('a'));
886
+ * // => false
887
+ *
888
+ * _.eq(NaN, NaN);
889
+ * // => true
890
+ */
891
+
892
+ var eq_1;
893
+ var hasRequiredEq;
894
+
895
+ function requireEq () {
896
+ if (hasRequiredEq) return eq_1;
897
+ hasRequiredEq = 1;
898
+ function eq(value, other) {
899
+ return value === other || (value !== value && other !== other);
900
+ }
901
+
902
+ eq_1 = eq;
903
+ return eq_1;
904
+ }
905
+
906
+ var _assocIndexOf;
907
+ var hasRequired_assocIndexOf;
908
+
909
+ function require_assocIndexOf () {
910
+ if (hasRequired_assocIndexOf) return _assocIndexOf;
911
+ hasRequired_assocIndexOf = 1;
912
+ var eq = requireEq();
913
+
914
+ /**
915
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
916
+ *
917
+ * @private
918
+ * @param {Array} array The array to inspect.
919
+ * @param {*} key The key to search for.
920
+ * @returns {number} Returns the index of the matched value, else `-1`.
921
+ */
922
+ function assocIndexOf(array, key) {
923
+ var length = array.length;
924
+ while (length--) {
925
+ if (eq(array[length][0], key)) {
926
+ return length;
927
+ }
928
+ }
929
+ return -1;
930
+ }
931
+
932
+ _assocIndexOf = assocIndexOf;
933
+ return _assocIndexOf;
934
+ }
935
+
936
+ var _listCacheDelete;
937
+ var hasRequired_listCacheDelete;
938
+
939
+ function require_listCacheDelete () {
940
+ if (hasRequired_listCacheDelete) return _listCacheDelete;
941
+ hasRequired_listCacheDelete = 1;
942
+ var assocIndexOf = require_assocIndexOf();
943
+
944
+ /** Used for built-in method references. */
945
+ var arrayProto = Array.prototype;
946
+
947
+ /** Built-in value references. */
948
+ var splice = arrayProto.splice;
949
+
950
+ /**
951
+ * Removes `key` and its value from the list cache.
952
+ *
953
+ * @private
954
+ * @name delete
955
+ * @memberOf ListCache
956
+ * @param {string} key The key of the value to remove.
957
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
958
+ */
959
+ function listCacheDelete(key) {
960
+ var data = this.__data__,
961
+ index = assocIndexOf(data, key);
962
+
963
+ if (index < 0) {
964
+ return false;
965
+ }
966
+ var lastIndex = data.length - 1;
967
+ if (index == lastIndex) {
968
+ data.pop();
969
+ } else {
970
+ splice.call(data, index, 1);
971
+ }
972
+ --this.size;
973
+ return true;
974
+ }
975
+
976
+ _listCacheDelete = listCacheDelete;
977
+ return _listCacheDelete;
978
+ }
979
+
980
+ var _listCacheGet;
981
+ var hasRequired_listCacheGet;
982
+
983
+ function require_listCacheGet () {
984
+ if (hasRequired_listCacheGet) return _listCacheGet;
985
+ hasRequired_listCacheGet = 1;
986
+ var assocIndexOf = require_assocIndexOf();
987
+
988
+ /**
989
+ * Gets the list cache value for `key`.
990
+ *
991
+ * @private
992
+ * @name get
993
+ * @memberOf ListCache
994
+ * @param {string} key The key of the value to get.
995
+ * @returns {*} Returns the entry value.
996
+ */
997
+ function listCacheGet(key) {
998
+ var data = this.__data__,
999
+ index = assocIndexOf(data, key);
1000
+
1001
+ return index < 0 ? undefined : data[index][1];
1002
+ }
1003
+
1004
+ _listCacheGet = listCacheGet;
1005
+ return _listCacheGet;
1006
+ }
1007
+
1008
+ var _listCacheHas;
1009
+ var hasRequired_listCacheHas;
1010
+
1011
+ function require_listCacheHas () {
1012
+ if (hasRequired_listCacheHas) return _listCacheHas;
1013
+ hasRequired_listCacheHas = 1;
1014
+ var assocIndexOf = require_assocIndexOf();
1015
+
1016
+ /**
1017
+ * Checks if a list cache value for `key` exists.
1018
+ *
1019
+ * @private
1020
+ * @name has
1021
+ * @memberOf ListCache
1022
+ * @param {string} key The key of the entry to check.
1023
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1024
+ */
1025
+ function listCacheHas(key) {
1026
+ return assocIndexOf(this.__data__, key) > -1;
1027
+ }
1028
+
1029
+ _listCacheHas = listCacheHas;
1030
+ return _listCacheHas;
1031
+ }
1032
+
1033
+ var _listCacheSet;
1034
+ var hasRequired_listCacheSet;
1035
+
1036
+ function require_listCacheSet () {
1037
+ if (hasRequired_listCacheSet) return _listCacheSet;
1038
+ hasRequired_listCacheSet = 1;
1039
+ var assocIndexOf = require_assocIndexOf();
1040
+
1041
+ /**
1042
+ * Sets the list cache `key` to `value`.
1043
+ *
1044
+ * @private
1045
+ * @name set
1046
+ * @memberOf ListCache
1047
+ * @param {string} key The key of the value to set.
1048
+ * @param {*} value The value to set.
1049
+ * @returns {Object} Returns the list cache instance.
1050
+ */
1051
+ function listCacheSet(key, value) {
1052
+ var data = this.__data__,
1053
+ index = assocIndexOf(data, key);
1054
+
1055
+ if (index < 0) {
1056
+ ++this.size;
1057
+ data.push([key, value]);
1058
+ } else {
1059
+ data[index][1] = value;
1060
+ }
1061
+ return this;
1062
+ }
1063
+
1064
+ _listCacheSet = listCacheSet;
1065
+ return _listCacheSet;
1066
+ }
1067
+
1068
+ var _ListCache;
1069
+ var hasRequired_ListCache;
1070
+
1071
+ function require_ListCache () {
1072
+ if (hasRequired_ListCache) return _ListCache;
1073
+ hasRequired_ListCache = 1;
1074
+ var listCacheClear = require_listCacheClear(),
1075
+ listCacheDelete = require_listCacheDelete(),
1076
+ listCacheGet = require_listCacheGet(),
1077
+ listCacheHas = require_listCacheHas(),
1078
+ listCacheSet = require_listCacheSet();
1079
+
1080
+ /**
1081
+ * Creates an list cache object.
1082
+ *
1083
+ * @private
1084
+ * @constructor
1085
+ * @param {Array} [entries] The key-value pairs to cache.
1086
+ */
1087
+ function ListCache(entries) {
1088
+ var index = -1,
1089
+ length = entries == null ? 0 : entries.length;
1090
+
1091
+ this.clear();
1092
+ while (++index < length) {
1093
+ var entry = entries[index];
1094
+ this.set(entry[0], entry[1]);
1095
+ }
1096
+ }
1097
+
1098
+ // Add methods to `ListCache`.
1099
+ ListCache.prototype.clear = listCacheClear;
1100
+ ListCache.prototype['delete'] = listCacheDelete;
1101
+ ListCache.prototype.get = listCacheGet;
1102
+ ListCache.prototype.has = listCacheHas;
1103
+ ListCache.prototype.set = listCacheSet;
1104
+
1105
+ _ListCache = ListCache;
1106
+ return _ListCache;
1107
+ }
1108
+
1109
+ var _Map;
1110
+ var hasRequired_Map;
1111
+
1112
+ function require_Map () {
1113
+ if (hasRequired_Map) return _Map;
1114
+ hasRequired_Map = 1;
1115
+ var getNative = require_getNative(),
1116
+ root = require_root();
1117
+
1118
+ /* Built-in method references that are verified to be native. */
1119
+ var Map = getNative(root, 'Map');
1120
+
1121
+ _Map = Map;
1122
+ return _Map;
1123
+ }
1124
+
1125
+ var _mapCacheClear;
1126
+ var hasRequired_mapCacheClear;
1127
+
1128
+ function require_mapCacheClear () {
1129
+ if (hasRequired_mapCacheClear) return _mapCacheClear;
1130
+ hasRequired_mapCacheClear = 1;
1131
+ var Hash = require_Hash(),
1132
+ ListCache = require_ListCache(),
1133
+ Map = require_Map();
1134
+
1135
+ /**
1136
+ * Removes all key-value entries from the map.
1137
+ *
1138
+ * @private
1139
+ * @name clear
1140
+ * @memberOf MapCache
1141
+ */
1142
+ function mapCacheClear() {
1143
+ this.size = 0;
1144
+ this.__data__ = {
1145
+ 'hash': new Hash,
1146
+ 'map': new (Map || ListCache),
1147
+ 'string': new Hash
1148
+ };
1149
+ }
1150
+
1151
+ _mapCacheClear = mapCacheClear;
1152
+ return _mapCacheClear;
1153
+ }
1154
+
1155
+ /**
1156
+ * Checks if `value` is suitable for use as unique object key.
1157
+ *
1158
+ * @private
1159
+ * @param {*} value The value to check.
1160
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1161
+ */
1162
+
1163
+ var _isKeyable;
1164
+ var hasRequired_isKeyable;
1165
+
1166
+ function require_isKeyable () {
1167
+ if (hasRequired_isKeyable) return _isKeyable;
1168
+ hasRequired_isKeyable = 1;
1169
+ function isKeyable(value) {
1170
+ var type = typeof value;
1171
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1172
+ ? (value !== '__proto__')
1173
+ : (value === null);
1174
+ }
1175
+
1176
+ _isKeyable = isKeyable;
1177
+ return _isKeyable;
1178
+ }
1179
+
1180
+ var _getMapData;
1181
+ var hasRequired_getMapData;
1182
+
1183
+ function require_getMapData () {
1184
+ if (hasRequired_getMapData) return _getMapData;
1185
+ hasRequired_getMapData = 1;
1186
+ var isKeyable = require_isKeyable();
1187
+
1188
+ /**
1189
+ * Gets the data for `map`.
1190
+ *
1191
+ * @private
1192
+ * @param {Object} map The map to query.
1193
+ * @param {string} key The reference key.
1194
+ * @returns {*} Returns the map data.
1195
+ */
1196
+ function getMapData(map, key) {
1197
+ var data = map.__data__;
1198
+ return isKeyable(key)
1199
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1200
+ : data.map;
1201
+ }
1202
+
1203
+ _getMapData = getMapData;
1204
+ return _getMapData;
1205
+ }
1206
+
1207
+ var _mapCacheDelete;
1208
+ var hasRequired_mapCacheDelete;
1209
+
1210
+ function require_mapCacheDelete () {
1211
+ if (hasRequired_mapCacheDelete) return _mapCacheDelete;
1212
+ hasRequired_mapCacheDelete = 1;
1213
+ var getMapData = require_getMapData();
1214
+
1215
+ /**
1216
+ * Removes `key` and its value from the map.
1217
+ *
1218
+ * @private
1219
+ * @name delete
1220
+ * @memberOf MapCache
1221
+ * @param {string} key The key of the value to remove.
1222
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1223
+ */
1224
+ function mapCacheDelete(key) {
1225
+ var result = getMapData(this, key)['delete'](key);
1226
+ this.size -= result ? 1 : 0;
1227
+ return result;
1228
+ }
1229
+
1230
+ _mapCacheDelete = mapCacheDelete;
1231
+ return _mapCacheDelete;
1232
+ }
1233
+
1234
+ var _mapCacheGet;
1235
+ var hasRequired_mapCacheGet;
1236
+
1237
+ function require_mapCacheGet () {
1238
+ if (hasRequired_mapCacheGet) return _mapCacheGet;
1239
+ hasRequired_mapCacheGet = 1;
1240
+ var getMapData = require_getMapData();
1241
+
1242
+ /**
1243
+ * Gets the map value for `key`.
1244
+ *
1245
+ * @private
1246
+ * @name get
1247
+ * @memberOf MapCache
1248
+ * @param {string} key The key of the value to get.
1249
+ * @returns {*} Returns the entry value.
1250
+ */
1251
+ function mapCacheGet(key) {
1252
+ return getMapData(this, key).get(key);
1253
+ }
1254
+
1255
+ _mapCacheGet = mapCacheGet;
1256
+ return _mapCacheGet;
1257
+ }
1258
+
1259
+ var _mapCacheHas;
1260
+ var hasRequired_mapCacheHas;
1261
+
1262
+ function require_mapCacheHas () {
1263
+ if (hasRequired_mapCacheHas) return _mapCacheHas;
1264
+ hasRequired_mapCacheHas = 1;
1265
+ var getMapData = require_getMapData();
1266
+
1267
+ /**
1268
+ * Checks if a map value for `key` exists.
1269
+ *
1270
+ * @private
1271
+ * @name has
1272
+ * @memberOf MapCache
1273
+ * @param {string} key The key of the entry to check.
1274
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1275
+ */
1276
+ function mapCacheHas(key) {
1277
+ return getMapData(this, key).has(key);
1278
+ }
1279
+
1280
+ _mapCacheHas = mapCacheHas;
1281
+ return _mapCacheHas;
1282
+ }
1283
+
1284
+ var _mapCacheSet;
1285
+ var hasRequired_mapCacheSet;
1286
+
1287
+ function require_mapCacheSet () {
1288
+ if (hasRequired_mapCacheSet) return _mapCacheSet;
1289
+ hasRequired_mapCacheSet = 1;
1290
+ var getMapData = require_getMapData();
1291
+
1292
+ /**
1293
+ * Sets the map `key` to `value`.
1294
+ *
1295
+ * @private
1296
+ * @name set
1297
+ * @memberOf MapCache
1298
+ * @param {string} key The key of the value to set.
1299
+ * @param {*} value The value to set.
1300
+ * @returns {Object} Returns the map cache instance.
1301
+ */
1302
+ function mapCacheSet(key, value) {
1303
+ var data = getMapData(this, key),
1304
+ size = data.size;
1305
+
1306
+ data.set(key, value);
1307
+ this.size += data.size == size ? 0 : 1;
1308
+ return this;
1309
+ }
1310
+
1311
+ _mapCacheSet = mapCacheSet;
1312
+ return _mapCacheSet;
1313
+ }
1314
+
1315
+ var _MapCache;
1316
+ var hasRequired_MapCache;
1317
+
1318
+ function require_MapCache () {
1319
+ if (hasRequired_MapCache) return _MapCache;
1320
+ hasRequired_MapCache = 1;
1321
+ var mapCacheClear = require_mapCacheClear(),
1322
+ mapCacheDelete = require_mapCacheDelete(),
1323
+ mapCacheGet = require_mapCacheGet(),
1324
+ mapCacheHas = require_mapCacheHas(),
1325
+ mapCacheSet = require_mapCacheSet();
1326
+
1327
+ /**
1328
+ * Creates a map cache object to store key-value pairs.
1329
+ *
1330
+ * @private
1331
+ * @constructor
1332
+ * @param {Array} [entries] The key-value pairs to cache.
1333
+ */
1334
+ function MapCache(entries) {
1335
+ var index = -1,
1336
+ length = entries == null ? 0 : entries.length;
1337
+
1338
+ this.clear();
1339
+ while (++index < length) {
1340
+ var entry = entries[index];
1341
+ this.set(entry[0], entry[1]);
1342
+ }
1343
+ }
1344
+
1345
+ // Add methods to `MapCache`.
1346
+ MapCache.prototype.clear = mapCacheClear;
1347
+ MapCache.prototype['delete'] = mapCacheDelete;
1348
+ MapCache.prototype.get = mapCacheGet;
1349
+ MapCache.prototype.has = mapCacheHas;
1350
+ MapCache.prototype.set = mapCacheSet;
1351
+
1352
+ _MapCache = MapCache;
1353
+ return _MapCache;
1354
+ }
1355
+
1356
+ var memoize_1;
1357
+ var hasRequiredMemoize;
1358
+
1359
+ function requireMemoize () {
1360
+ if (hasRequiredMemoize) return memoize_1;
1361
+ hasRequiredMemoize = 1;
1362
+ var MapCache = require_MapCache();
1363
+
1364
+ /** Error message constants. */
1365
+ var FUNC_ERROR_TEXT = 'Expected a function';
1366
+
1367
+ /**
1368
+ * Creates a function that memoizes the result of `func`. If `resolver` is
1369
+ * provided, it determines the cache key for storing the result based on the
1370
+ * arguments provided to the memoized function. By default, the first argument
1371
+ * provided to the memoized function is used as the map cache key. The `func`
1372
+ * is invoked with the `this` binding of the memoized function.
1373
+ *
1374
+ * **Note:** The cache is exposed as the `cache` property on the memoized
1375
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
1376
+ * constructor with one whose instances implement the
1377
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1378
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
1379
+ *
1380
+ * @static
1381
+ * @memberOf _
1382
+ * @since 0.1.0
1383
+ * @category Function
1384
+ * @param {Function} func The function to have its output memoized.
1385
+ * @param {Function} [resolver] The function to resolve the cache key.
1386
+ * @returns {Function} Returns the new memoized function.
1387
+ * @example
1388
+ *
1389
+ * var object = { 'a': 1, 'b': 2 };
1390
+ * var other = { 'c': 3, 'd': 4 };
1391
+ *
1392
+ * var values = _.memoize(_.values);
1393
+ * values(object);
1394
+ * // => [1, 2]
1395
+ *
1396
+ * values(other);
1397
+ * // => [3, 4]
1398
+ *
1399
+ * object.a = 2;
1400
+ * values(object);
1401
+ * // => [1, 2]
1402
+ *
1403
+ * // Modify the result cache.
1404
+ * values.cache.set(object, ['a', 'b']);
1405
+ * values(object);
1406
+ * // => ['a', 'b']
1407
+ *
1408
+ * // Replace `_.memoize.Cache`.
1409
+ * _.memoize.Cache = WeakMap;
1410
+ */
1411
+ function memoize(func, resolver) {
1412
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
1413
+ throw new TypeError(FUNC_ERROR_TEXT);
1414
+ }
1415
+ var memoized = function() {
1416
+ var args = arguments,
1417
+ key = resolver ? resolver.apply(this, args) : args[0],
1418
+ cache = memoized.cache;
1419
+
1420
+ if (cache.has(key)) {
1421
+ return cache.get(key);
1422
+ }
1423
+ var result = func.apply(this, args);
1424
+ memoized.cache = cache.set(key, result) || cache;
1425
+ return result;
1426
+ };
1427
+ memoized.cache = new (memoize.Cache || MapCache);
1428
+ return memoized;
1429
+ }
1430
+
1431
+ // Expose `MapCache`.
1432
+ memoize.Cache = MapCache;
1433
+
1434
+ memoize_1 = memoize;
1435
+ return memoize_1;
1436
+ }
1437
+
1438
+ var _memoizeCapped;
1439
+ var hasRequired_memoizeCapped;
1440
+
1441
+ function require_memoizeCapped () {
1442
+ if (hasRequired_memoizeCapped) return _memoizeCapped;
1443
+ hasRequired_memoizeCapped = 1;
1444
+ var memoize = requireMemoize();
1445
+
1446
+ /** Used as the maximum memoize cache size. */
1447
+ var MAX_MEMOIZE_SIZE = 500;
1448
+
1449
+ /**
1450
+ * A specialized version of `_.memoize` which clears the memoized function's
1451
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
1452
+ *
1453
+ * @private
1454
+ * @param {Function} func The function to have its output memoized.
1455
+ * @returns {Function} Returns the new memoized function.
1456
+ */
1457
+ function memoizeCapped(func) {
1458
+ var result = memoize(func, function(key) {
1459
+ if (cache.size === MAX_MEMOIZE_SIZE) {
1460
+ cache.clear();
1461
+ }
1462
+ return key;
1463
+ });
1464
+
1465
+ var cache = result.cache;
1466
+ return result;
1467
+ }
1468
+
1469
+ _memoizeCapped = memoizeCapped;
1470
+ return _memoizeCapped;
1471
+ }
1472
+
1473
+ var _stringToPath;
1474
+ var hasRequired_stringToPath;
1475
+
1476
+ function require_stringToPath () {
1477
+ if (hasRequired_stringToPath) return _stringToPath;
1478
+ hasRequired_stringToPath = 1;
1479
+ var memoizeCapped = require_memoizeCapped();
1480
+
1481
+ /** Used to match property names within property paths. */
1482
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1483
+
1484
+ /** Used to match backslashes in property paths. */
1485
+ var reEscapeChar = /\\(\\)?/g;
1486
+
1487
+ /**
1488
+ * Converts `string` to a property path array.
1489
+ *
1490
+ * @private
1491
+ * @param {string} string The string to convert.
1492
+ * @returns {Array} Returns the property path array.
1493
+ */
1494
+ var stringToPath = memoizeCapped(function(string) {
1495
+ var result = [];
1496
+ if (string.charCodeAt(0) === 46 /* . */) {
1497
+ result.push('');
1498
+ }
1499
+ string.replace(rePropName, function(match, number, quote, subString) {
1500
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
1501
+ });
1502
+ return result;
1503
+ });
1504
+
1505
+ _stringToPath = stringToPath;
1506
+ return _stringToPath;
1507
+ }
1508
+
1509
+ /**
1510
+ * A specialized version of `_.map` for arrays without support for iteratee
1511
+ * shorthands.
1512
+ *
1513
+ * @private
1514
+ * @param {Array} [array] The array to iterate over.
1515
+ * @param {Function} iteratee The function invoked per iteration.
1516
+ * @returns {Array} Returns the new mapped array.
1517
+ */
1518
+
1519
+ var _arrayMap;
1520
+ var hasRequired_arrayMap;
1521
+
1522
+ function require_arrayMap () {
1523
+ if (hasRequired_arrayMap) return _arrayMap;
1524
+ hasRequired_arrayMap = 1;
1525
+ function arrayMap(array, iteratee) {
1526
+ var index = -1,
1527
+ length = array == null ? 0 : array.length,
1528
+ result = Array(length);
1529
+
1530
+ while (++index < length) {
1531
+ result[index] = iteratee(array[index], index, array);
1532
+ }
1533
+ return result;
1534
+ }
1535
+
1536
+ _arrayMap = arrayMap;
1537
+ return _arrayMap;
1538
+ }
1539
+
1540
+ var _baseToString;
1541
+ var hasRequired_baseToString;
1542
+
1543
+ function require_baseToString () {
1544
+ if (hasRequired_baseToString) return _baseToString;
1545
+ hasRequired_baseToString = 1;
1546
+ var Symbol = require_Symbol(),
1547
+ arrayMap = require_arrayMap(),
1548
+ isArray = requireIsArray(),
1549
+ isSymbol = requireIsSymbol();
1550
+
1551
+ /** Used to convert symbols to primitives and strings. */
1552
+ var symbolProto = Symbol ? Symbol.prototype : undefined,
1553
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
1554
+
1555
+ /**
1556
+ * The base implementation of `_.toString` which doesn't convert nullish
1557
+ * values to empty strings.
1558
+ *
1559
+ * @private
1560
+ * @param {*} value The value to process.
1561
+ * @returns {string} Returns the string.
1562
+ */
1563
+ function baseToString(value) {
1564
+ // Exit early for strings to avoid a performance hit in some environments.
1565
+ if (typeof value == 'string') {
1566
+ return value;
1567
+ }
1568
+ if (isArray(value)) {
1569
+ // Recursively convert values (susceptible to call stack limits).
1570
+ return arrayMap(value, baseToString) + '';
1571
+ }
1572
+ if (isSymbol(value)) {
1573
+ return symbolToString ? symbolToString.call(value) : '';
1574
+ }
1575
+ var result = (value + '');
1576
+ return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
1577
+ }
1578
+
1579
+ _baseToString = baseToString;
1580
+ return _baseToString;
1581
+ }
1582
+
1583
+ var toString_1;
1584
+ var hasRequiredToString;
1585
+
1586
+ function requireToString () {
1587
+ if (hasRequiredToString) return toString_1;
1588
+ hasRequiredToString = 1;
1589
+ var baseToString = require_baseToString();
1590
+
1591
+ /**
1592
+ * Converts `value` to a string. An empty string is returned for `null`
1593
+ * and `undefined` values. The sign of `-0` is preserved.
1594
+ *
1595
+ * @static
1596
+ * @memberOf _
1597
+ * @since 4.0.0
1598
+ * @category Lang
1599
+ * @param {*} value The value to convert.
1600
+ * @returns {string} Returns the converted string.
1601
+ * @example
1602
+ *
1603
+ * _.toString(null);
1604
+ * // => ''
1605
+ *
1606
+ * _.toString(-0);
1607
+ * // => '-0'
1608
+ *
1609
+ * _.toString([1, 2, 3]);
1610
+ * // => '1,2,3'
1611
+ */
1612
+ function toString(value) {
1613
+ return value == null ? '' : baseToString(value);
1614
+ }
1615
+
1616
+ toString_1 = toString;
1617
+ return toString_1;
1618
+ }
1619
+
1620
+ var _castPath;
1621
+ var hasRequired_castPath;
1622
+
1623
+ function require_castPath () {
1624
+ if (hasRequired_castPath) return _castPath;
1625
+ hasRequired_castPath = 1;
1626
+ var isArray = requireIsArray(),
1627
+ isKey = require_isKey(),
1628
+ stringToPath = require_stringToPath(),
1629
+ toString = requireToString();
1630
+
1631
+ /**
1632
+ * Casts `value` to a path array if it's not one.
1633
+ *
1634
+ * @private
1635
+ * @param {*} value The value to inspect.
1636
+ * @param {Object} [object] The object to query keys on.
1637
+ * @returns {Array} Returns the cast property path array.
1638
+ */
1639
+ function castPath(value, object) {
1640
+ if (isArray(value)) {
1641
+ return value;
1642
+ }
1643
+ return isKey(value, object) ? [value] : stringToPath(toString(value));
1644
+ }
1645
+
1646
+ _castPath = castPath;
1647
+ return _castPath;
1648
+ }
1649
+
1650
+ var _toKey;
1651
+ var hasRequired_toKey;
1652
+
1653
+ function require_toKey () {
1654
+ if (hasRequired_toKey) return _toKey;
1655
+ hasRequired_toKey = 1;
1656
+ var isSymbol = requireIsSymbol();
1657
+
1658
+ /**
1659
+ * Converts `value` to a string key if it's not a string or symbol.
1660
+ *
1661
+ * @private
1662
+ * @param {*} value The value to inspect.
1663
+ * @returns {string|symbol} Returns the key.
1664
+ */
1665
+ function toKey(value) {
1666
+ if (typeof value == 'string' || isSymbol(value)) {
1667
+ return value;
1668
+ }
1669
+ var result = (value + '');
1670
+ return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
1671
+ }
1672
+
1673
+ _toKey = toKey;
1674
+ return _toKey;
1675
+ }
1676
+
1677
+ var _baseGet;
1678
+ var hasRequired_baseGet;
1679
+
1680
+ function require_baseGet () {
1681
+ if (hasRequired_baseGet) return _baseGet;
1682
+ hasRequired_baseGet = 1;
1683
+ var castPath = require_castPath(),
1684
+ toKey = require_toKey();
1685
+
1686
+ /**
1687
+ * The base implementation of `_.get` without support for default values.
1688
+ *
1689
+ * @private
1690
+ * @param {Object} object The object to query.
1691
+ * @param {Array|string} path The path of the property to get.
1692
+ * @returns {*} Returns the resolved value.
1693
+ */
1694
+ function baseGet(object, path) {
1695
+ path = castPath(path, object);
1696
+
1697
+ var index = 0,
1698
+ length = path.length;
1699
+
1700
+ while (object != null && index < length) {
1701
+ object = object[toKey(path[index++])];
1702
+ }
1703
+ return (index && index == length) ? object : undefined;
1704
+ }
1705
+
1706
+ _baseGet = baseGet;
1707
+ return _baseGet;
1708
+ }
1709
+
1710
+ var get_1;
1711
+ var hasRequiredGet;
1712
+
1713
+ function requireGet () {
1714
+ if (hasRequiredGet) return get_1;
1715
+ hasRequiredGet = 1;
1716
+ var baseGet = require_baseGet();
1717
+
1718
+ /**
1719
+ * Gets the value at `path` of `object`. If the resolved value is
1720
+ * `undefined`, the `defaultValue` is returned in its place.
1721
+ *
1722
+ * @static
1723
+ * @memberOf _
1724
+ * @since 3.7.0
1725
+ * @category Object
1726
+ * @param {Object} object The object to query.
1727
+ * @param {Array|string} path The path of the property to get.
1728
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
1729
+ * @returns {*} Returns the resolved value.
1730
+ * @example
1731
+ *
1732
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
1733
+ *
1734
+ * _.get(object, 'a[0].b.c');
1735
+ * // => 3
1736
+ *
1737
+ * _.get(object, ['a', '0', 'b', 'c']);
1738
+ * // => 3
1739
+ *
1740
+ * _.get(object, 'a.b.c', 'default');
1741
+ * // => 'default'
1742
+ */
1743
+ function get(object, path, defaultValue) {
1744
+ var result = object == null ? undefined : baseGet(object, path);
1745
+ return result === undefined ? defaultValue : result;
1746
+ }
1747
+
1748
+ get_1 = get;
1749
+ return get_1;
1750
+ }
1751
+
1752
+ var getExports = requireGet();
1753
+ var get = /*@__PURE__*/getDefaultExportFromCjs(getExports);
1754
+
1755
+ /**
1756
+ * Copies the values of `source` to `array`.
1757
+ *
1758
+ * @private
1759
+ * @param {Array} source The array to copy values from.
1760
+ * @param {Array} [array=[]] The array to copy values to.
1761
+ * @returns {Array} Returns `array`.
1762
+ */
1763
+
1764
+ var _copyArray;
1765
+ var hasRequired_copyArray;
1766
+
1767
+ function require_copyArray () {
1768
+ if (hasRequired_copyArray) return _copyArray;
1769
+ hasRequired_copyArray = 1;
1770
+ function copyArray(source, array) {
1771
+ var index = -1,
1772
+ length = source.length;
1773
+
1774
+ array || (array = Array(length));
1775
+ while (++index < length) {
1776
+ array[index] = source[index];
1777
+ }
1778
+ return array;
1779
+ }
1780
+
1781
+ _copyArray = copyArray;
1782
+ return _copyArray;
1783
+ }
1784
+
1785
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1786
+
1787
+ var _baseRandom;
1788
+ var hasRequired_baseRandom;
1789
+
1790
+ function require_baseRandom () {
1791
+ if (hasRequired_baseRandom) return _baseRandom;
1792
+ hasRequired_baseRandom = 1;
1793
+ var nativeFloor = Math.floor,
1794
+ nativeRandom = Math.random;
1795
+
1796
+ /**
1797
+ * The base implementation of `_.random` without support for returning
1798
+ * floating-point numbers.
1799
+ *
1800
+ * @private
1801
+ * @param {number} lower The lower bound.
1802
+ * @param {number} upper The upper bound.
1803
+ * @returns {number} Returns the random number.
1804
+ */
1805
+ function baseRandom(lower, upper) {
1806
+ return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
1807
+ }
1808
+
1809
+ _baseRandom = baseRandom;
1810
+ return _baseRandom;
1811
+ }
1812
+
1813
+ var _shuffleSelf;
1814
+ var hasRequired_shuffleSelf;
1815
+
1816
+ function require_shuffleSelf () {
1817
+ if (hasRequired_shuffleSelf) return _shuffleSelf;
1818
+ hasRequired_shuffleSelf = 1;
1819
+ var baseRandom = require_baseRandom();
1820
+
1821
+ /**
1822
+ * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
1823
+ *
1824
+ * @private
1825
+ * @param {Array} array The array to shuffle.
1826
+ * @param {number} [size=array.length] The size of `array`.
1827
+ * @returns {Array} Returns `array`.
1828
+ */
1829
+ function shuffleSelf(array, size) {
1830
+ var index = -1,
1831
+ length = array.length,
1832
+ lastIndex = length - 1;
1833
+
1834
+ size = size === undefined ? length : size;
1835
+ while (++index < size) {
1836
+ var rand = baseRandom(index, lastIndex),
1837
+ value = array[rand];
1838
+
1839
+ array[rand] = array[index];
1840
+ array[index] = value;
1841
+ }
1842
+ array.length = size;
1843
+ return array;
1844
+ }
1845
+
1846
+ _shuffleSelf = shuffleSelf;
1847
+ return _shuffleSelf;
1848
+ }
1849
+
1850
+ var _arrayShuffle;
1851
+ var hasRequired_arrayShuffle;
1852
+
1853
+ function require_arrayShuffle () {
1854
+ if (hasRequired_arrayShuffle) return _arrayShuffle;
1855
+ hasRequired_arrayShuffle = 1;
1856
+ var copyArray = require_copyArray(),
1857
+ shuffleSelf = require_shuffleSelf();
1858
+
1859
+ /**
1860
+ * A specialized version of `_.shuffle` for arrays.
1861
+ *
1862
+ * @private
1863
+ * @param {Array} array The array to shuffle.
1864
+ * @returns {Array} Returns the new shuffled array.
1865
+ */
1866
+ function arrayShuffle(array) {
1867
+ return shuffleSelf(copyArray(array));
1868
+ }
1869
+
1870
+ _arrayShuffle = arrayShuffle;
1871
+ return _arrayShuffle;
1872
+ }
1873
+
1874
+ var _baseValues;
1875
+ var hasRequired_baseValues;
1876
+
1877
+ function require_baseValues () {
1878
+ if (hasRequired_baseValues) return _baseValues;
1879
+ hasRequired_baseValues = 1;
1880
+ var arrayMap = require_arrayMap();
1881
+
1882
+ /**
1883
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
1884
+ * array of `object` property values corresponding to the property names
1885
+ * of `props`.
1886
+ *
1887
+ * @private
1888
+ * @param {Object} object The object to query.
1889
+ * @param {Array} props The property names to get values for.
1890
+ * @returns {Object} Returns the array of property values.
1891
+ */
1892
+ function baseValues(object, props) {
1893
+ return arrayMap(props, function(key) {
1894
+ return object[key];
1895
+ });
1896
+ }
1897
+
1898
+ _baseValues = baseValues;
1899
+ return _baseValues;
1900
+ }
1901
+
1902
+ /**
1903
+ * The base implementation of `_.times` without support for iteratee shorthands
1904
+ * or max array length checks.
1905
+ *
1906
+ * @private
1907
+ * @param {number} n The number of times to invoke `iteratee`.
1908
+ * @param {Function} iteratee The function invoked per iteration.
1909
+ * @returns {Array} Returns the array of results.
1910
+ */
1911
+
1912
+ var _baseTimes;
1913
+ var hasRequired_baseTimes;
1914
+
1915
+ function require_baseTimes () {
1916
+ if (hasRequired_baseTimes) return _baseTimes;
1917
+ hasRequired_baseTimes = 1;
1918
+ function baseTimes(n, iteratee) {
1919
+ var index = -1,
1920
+ result = Array(n);
1921
+
1922
+ while (++index < n) {
1923
+ result[index] = iteratee(index);
1924
+ }
1925
+ return result;
1926
+ }
1927
+
1928
+ _baseTimes = baseTimes;
1929
+ return _baseTimes;
1930
+ }
1931
+
1932
+ var _baseIsArguments;
1933
+ var hasRequired_baseIsArguments;
1934
+
1935
+ function require_baseIsArguments () {
1936
+ if (hasRequired_baseIsArguments) return _baseIsArguments;
1937
+ hasRequired_baseIsArguments = 1;
1938
+ var baseGetTag = require_baseGetTag(),
1939
+ isObjectLike = requireIsObjectLike();
1940
+
1941
+ /** `Object#toString` result references. */
1942
+ var argsTag = '[object Arguments]';
1943
+
1944
+ /**
1945
+ * The base implementation of `_.isArguments`.
1946
+ *
1947
+ * @private
1948
+ * @param {*} value The value to check.
1949
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1950
+ */
1951
+ function baseIsArguments(value) {
1952
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
1953
+ }
1954
+
1955
+ _baseIsArguments = baseIsArguments;
1956
+ return _baseIsArguments;
1957
+ }
1958
+
1959
+ var isArguments_1;
1960
+ var hasRequiredIsArguments;
1961
+
1962
+ function requireIsArguments () {
1963
+ if (hasRequiredIsArguments) return isArguments_1;
1964
+ hasRequiredIsArguments = 1;
1965
+ var baseIsArguments = require_baseIsArguments(),
1966
+ isObjectLike = requireIsObjectLike();
1967
+
1968
+ /** Used for built-in method references. */
1969
+ var objectProto = Object.prototype;
1970
+
1971
+ /** Used to check objects for own properties. */
1972
+ var hasOwnProperty = objectProto.hasOwnProperty;
1973
+
1974
+ /** Built-in value references. */
1975
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
1976
+
1977
+ /**
1978
+ * Checks if `value` is likely an `arguments` object.
1979
+ *
1980
+ * @static
1981
+ * @memberOf _
1982
+ * @since 0.1.0
1983
+ * @category Lang
1984
+ * @param {*} value The value to check.
1985
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1986
+ * else `false`.
1987
+ * @example
1988
+ *
1989
+ * _.isArguments(function() { return arguments; }());
1990
+ * // => true
1991
+ *
1992
+ * _.isArguments([1, 2, 3]);
1993
+ * // => false
1994
+ */
1995
+ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
1996
+ return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
1997
+ !propertyIsEnumerable.call(value, 'callee');
1998
+ };
1999
+
2000
+ isArguments_1 = isArguments;
2001
+ return isArguments_1;
2002
+ }
2003
+
2004
+ var isBuffer = {exports: {}};
2005
+
2006
+ /**
2007
+ * This method returns `false`.
2008
+ *
2009
+ * @static
2010
+ * @memberOf _
2011
+ * @since 4.13.0
2012
+ * @category Util
2013
+ * @returns {boolean} Returns `false`.
2014
+ * @example
2015
+ *
2016
+ * _.times(2, _.stubFalse);
2017
+ * // => [false, false]
2018
+ */
2019
+
2020
+ var stubFalse_1;
2021
+ var hasRequiredStubFalse;
2022
+
2023
+ function requireStubFalse () {
2024
+ if (hasRequiredStubFalse) return stubFalse_1;
2025
+ hasRequiredStubFalse = 1;
2026
+ function stubFalse() {
2027
+ return false;
2028
+ }
2029
+
2030
+ stubFalse_1 = stubFalse;
2031
+ return stubFalse_1;
2032
+ }
2033
+
2034
+ isBuffer.exports;
2035
+
2036
+ var hasRequiredIsBuffer;
2037
+
2038
+ function requireIsBuffer () {
2039
+ if (hasRequiredIsBuffer) return isBuffer.exports;
2040
+ hasRequiredIsBuffer = 1;
2041
+ (function (module, exports$1) {
2042
+ var root = require_root(),
2043
+ stubFalse = requireStubFalse();
2044
+
2045
+ /** Detect free variable `exports`. */
2046
+ var freeExports = exports$1 && !exports$1.nodeType && exports$1;
2047
+
2048
+ /** Detect free variable `module`. */
2049
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
2050
+
2051
+ /** Detect the popular CommonJS extension `module.exports`. */
2052
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2053
+
2054
+ /** Built-in value references. */
2055
+ var Buffer = moduleExports ? root.Buffer : undefined;
2056
+
2057
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2058
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
2059
+
2060
+ /**
2061
+ * Checks if `value` is a buffer.
2062
+ *
2063
+ * @static
2064
+ * @memberOf _
2065
+ * @since 4.3.0
2066
+ * @category Lang
2067
+ * @param {*} value The value to check.
2068
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
2069
+ * @example
2070
+ *
2071
+ * _.isBuffer(new Buffer(2));
2072
+ * // => true
2073
+ *
2074
+ * _.isBuffer(new Uint8Array(2));
2075
+ * // => false
2076
+ */
2077
+ var isBuffer = nativeIsBuffer || stubFalse;
2078
+
2079
+ module.exports = isBuffer;
2080
+ } (isBuffer, isBuffer.exports));
2081
+ return isBuffer.exports;
2082
+ }
2083
+
2084
+ /** Used as references for various `Number` constants. */
2085
+
2086
+ var _isIndex;
2087
+ var hasRequired_isIndex;
2088
+
2089
+ function require_isIndex () {
2090
+ if (hasRequired_isIndex) return _isIndex;
2091
+ hasRequired_isIndex = 1;
2092
+ var MAX_SAFE_INTEGER = 9007199254740991;
2093
+
2094
+ /** Used to detect unsigned integer values. */
2095
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
2096
+
2097
+ /**
2098
+ * Checks if `value` is a valid array-like index.
2099
+ *
2100
+ * @private
2101
+ * @param {*} value The value to check.
2102
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
2103
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
2104
+ */
2105
+ function isIndex(value, length) {
2106
+ var type = typeof value;
2107
+ length = length == null ? MAX_SAFE_INTEGER : length;
2108
+
2109
+ return !!length &&
2110
+ (type == 'number' ||
2111
+ (type != 'symbol' && reIsUint.test(value))) &&
2112
+ (value > -1 && value % 1 == 0 && value < length);
2113
+ }
2114
+
2115
+ _isIndex = isIndex;
2116
+ return _isIndex;
2117
+ }
2118
+
2119
+ /** Used as references for various `Number` constants. */
2120
+
2121
+ var isLength_1;
2122
+ var hasRequiredIsLength;
2123
+
2124
+ function requireIsLength () {
2125
+ if (hasRequiredIsLength) return isLength_1;
2126
+ hasRequiredIsLength = 1;
2127
+ var MAX_SAFE_INTEGER = 9007199254740991;
2128
+
2129
+ /**
2130
+ * Checks if `value` is a valid array-like length.
2131
+ *
2132
+ * **Note:** This method is loosely based on
2133
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
2134
+ *
2135
+ * @static
2136
+ * @memberOf _
2137
+ * @since 4.0.0
2138
+ * @category Lang
2139
+ * @param {*} value The value to check.
2140
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
2141
+ * @example
2142
+ *
2143
+ * _.isLength(3);
2144
+ * // => true
2145
+ *
2146
+ * _.isLength(Number.MIN_VALUE);
2147
+ * // => false
2148
+ *
2149
+ * _.isLength(Infinity);
2150
+ * // => false
2151
+ *
2152
+ * _.isLength('3');
2153
+ * // => false
2154
+ */
2155
+ function isLength(value) {
2156
+ return typeof value == 'number' &&
2157
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2158
+ }
2159
+
2160
+ isLength_1 = isLength;
2161
+ return isLength_1;
2162
+ }
2163
+
2164
+ var _baseIsTypedArray;
2165
+ var hasRequired_baseIsTypedArray;
2166
+
2167
+ function require_baseIsTypedArray () {
2168
+ if (hasRequired_baseIsTypedArray) return _baseIsTypedArray;
2169
+ hasRequired_baseIsTypedArray = 1;
2170
+ var baseGetTag = require_baseGetTag(),
2171
+ isLength = requireIsLength(),
2172
+ isObjectLike = requireIsObjectLike();
2173
+
2174
+ /** `Object#toString` result references. */
2175
+ var argsTag = '[object Arguments]',
2176
+ arrayTag = '[object Array]',
2177
+ boolTag = '[object Boolean]',
2178
+ dateTag = '[object Date]',
2179
+ errorTag = '[object Error]',
2180
+ funcTag = '[object Function]',
2181
+ mapTag = '[object Map]',
2182
+ numberTag = '[object Number]',
2183
+ objectTag = '[object Object]',
2184
+ regexpTag = '[object RegExp]',
2185
+ setTag = '[object Set]',
2186
+ stringTag = '[object String]',
2187
+ weakMapTag = '[object WeakMap]';
2188
+
2189
+ var arrayBufferTag = '[object ArrayBuffer]',
2190
+ dataViewTag = '[object DataView]',
2191
+ float32Tag = '[object Float32Array]',
2192
+ float64Tag = '[object Float64Array]',
2193
+ int8Tag = '[object Int8Array]',
2194
+ int16Tag = '[object Int16Array]',
2195
+ int32Tag = '[object Int32Array]',
2196
+ uint8Tag = '[object Uint8Array]',
2197
+ uint8ClampedTag = '[object Uint8ClampedArray]',
2198
+ uint16Tag = '[object Uint16Array]',
2199
+ uint32Tag = '[object Uint32Array]';
2200
+
2201
+ /** Used to identify `toStringTag` values of typed arrays. */
2202
+ var typedArrayTags = {};
2203
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
2204
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
2205
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
2206
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
2207
+ typedArrayTags[uint32Tag] = true;
2208
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
2209
+ typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
2210
+ typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
2211
+ typedArrayTags[errorTag] = typedArrayTags[funcTag] =
2212
+ typedArrayTags[mapTag] = typedArrayTags[numberTag] =
2213
+ typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
2214
+ typedArrayTags[setTag] = typedArrayTags[stringTag] =
2215
+ typedArrayTags[weakMapTag] = false;
2216
+
2217
+ /**
2218
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
2219
+ *
2220
+ * @private
2221
+ * @param {*} value The value to check.
2222
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2223
+ */
2224
+ function baseIsTypedArray(value) {
2225
+ return isObjectLike(value) &&
2226
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
2227
+ }
2228
+
2229
+ _baseIsTypedArray = baseIsTypedArray;
2230
+ return _baseIsTypedArray;
2231
+ }
2232
+
2233
+ /**
2234
+ * The base implementation of `_.unary` without support for storing metadata.
2235
+ *
2236
+ * @private
2237
+ * @param {Function} func The function to cap arguments for.
2238
+ * @returns {Function} Returns the new capped function.
2239
+ */
2240
+
2241
+ var _baseUnary;
2242
+ var hasRequired_baseUnary;
2243
+
2244
+ function require_baseUnary () {
2245
+ if (hasRequired_baseUnary) return _baseUnary;
2246
+ hasRequired_baseUnary = 1;
2247
+ function baseUnary(func) {
2248
+ return function(value) {
2249
+ return func(value);
2250
+ };
2251
+ }
2252
+
2253
+ _baseUnary = baseUnary;
2254
+ return _baseUnary;
2255
+ }
2256
+
2257
+ var _nodeUtil = {exports: {}};
2258
+
2259
+ _nodeUtil.exports;
2260
+
2261
+ var hasRequired_nodeUtil;
2262
+
2263
+ function require_nodeUtil () {
2264
+ if (hasRequired_nodeUtil) return _nodeUtil.exports;
2265
+ hasRequired_nodeUtil = 1;
2266
+ (function (module, exports$1) {
2267
+ var freeGlobal = require_freeGlobal();
2268
+
2269
+ /** Detect free variable `exports`. */
2270
+ var freeExports = exports$1 && !exports$1.nodeType && exports$1;
2271
+
2272
+ /** Detect free variable `module`. */
2273
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
2274
+
2275
+ /** Detect the popular CommonJS extension `module.exports`. */
2276
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2277
+
2278
+ /** Detect free variable `process` from Node.js. */
2279
+ var freeProcess = moduleExports && freeGlobal.process;
2280
+
2281
+ /** Used to access faster Node.js helpers. */
2282
+ var nodeUtil = (function() {
2283
+ try {
2284
+ // Use `util.types` for Node.js 10+.
2285
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
2286
+
2287
+ if (types) {
2288
+ return types;
2289
+ }
2290
+
2291
+ // Legacy `process.binding('util')` for Node.js < 10.
2292
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
2293
+ } catch (e) {}
2294
+ }());
2295
+
2296
+ module.exports = nodeUtil;
2297
+ } (_nodeUtil, _nodeUtil.exports));
2298
+ return _nodeUtil.exports;
2299
+ }
2300
+
2301
+ var isTypedArray_1;
2302
+ var hasRequiredIsTypedArray;
2303
+
2304
+ function requireIsTypedArray () {
2305
+ if (hasRequiredIsTypedArray) return isTypedArray_1;
2306
+ hasRequiredIsTypedArray = 1;
2307
+ var baseIsTypedArray = require_baseIsTypedArray(),
2308
+ baseUnary = require_baseUnary(),
2309
+ nodeUtil = require_nodeUtil();
2310
+
2311
+ /* Node.js helper references. */
2312
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
2313
+
2314
+ /**
2315
+ * Checks if `value` is classified as a typed array.
2316
+ *
2317
+ * @static
2318
+ * @memberOf _
2319
+ * @since 3.0.0
2320
+ * @category Lang
2321
+ * @param {*} value The value to check.
2322
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2323
+ * @example
2324
+ *
2325
+ * _.isTypedArray(new Uint8Array);
2326
+ * // => true
2327
+ *
2328
+ * _.isTypedArray([]);
2329
+ * // => false
2330
+ */
2331
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
2332
+
2333
+ isTypedArray_1 = isTypedArray;
2334
+ return isTypedArray_1;
2335
+ }
2336
+
2337
+ var _arrayLikeKeys;
2338
+ var hasRequired_arrayLikeKeys;
2339
+
2340
+ function require_arrayLikeKeys () {
2341
+ if (hasRequired_arrayLikeKeys) return _arrayLikeKeys;
2342
+ hasRequired_arrayLikeKeys = 1;
2343
+ var baseTimes = require_baseTimes(),
2344
+ isArguments = requireIsArguments(),
2345
+ isArray = requireIsArray(),
2346
+ isBuffer = requireIsBuffer(),
2347
+ isIndex = require_isIndex(),
2348
+ isTypedArray = requireIsTypedArray();
2349
+
2350
+ /** Used for built-in method references. */
2351
+ var objectProto = Object.prototype;
2352
+
2353
+ /** Used to check objects for own properties. */
2354
+ var hasOwnProperty = objectProto.hasOwnProperty;
2355
+
2356
+ /**
2357
+ * Creates an array of the enumerable property names of the array-like `value`.
2358
+ *
2359
+ * @private
2360
+ * @param {*} value The value to query.
2361
+ * @param {boolean} inherited Specify returning inherited property names.
2362
+ * @returns {Array} Returns the array of property names.
2363
+ */
2364
+ function arrayLikeKeys(value, inherited) {
2365
+ var isArr = isArray(value),
2366
+ isArg = !isArr && isArguments(value),
2367
+ isBuff = !isArr && !isArg && isBuffer(value),
2368
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
2369
+ skipIndexes = isArr || isArg || isBuff || isType,
2370
+ result = skipIndexes ? baseTimes(value.length, String) : [],
2371
+ length = result.length;
2372
+
2373
+ for (var key in value) {
2374
+ if ((inherited || hasOwnProperty.call(value, key)) &&
2375
+ !(skipIndexes && (
2376
+ // Safari 9 has enumerable `arguments.length` in strict mode.
2377
+ key == 'length' ||
2378
+ // Node.js 0.10 has enumerable non-index properties on buffers.
2379
+ (isBuff && (key == 'offset' || key == 'parent')) ||
2380
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
2381
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
2382
+ // Skip index properties.
2383
+ isIndex(key, length)
2384
+ ))) {
2385
+ result.push(key);
2386
+ }
2387
+ }
2388
+ return result;
2389
+ }
2390
+
2391
+ _arrayLikeKeys = arrayLikeKeys;
2392
+ return _arrayLikeKeys;
2393
+ }
2394
+
2395
+ /** Used for built-in method references. */
2396
+
2397
+ var _isPrototype;
2398
+ var hasRequired_isPrototype;
2399
+
2400
+ function require_isPrototype () {
2401
+ if (hasRequired_isPrototype) return _isPrototype;
2402
+ hasRequired_isPrototype = 1;
2403
+ var objectProto = Object.prototype;
2404
+
2405
+ /**
2406
+ * Checks if `value` is likely a prototype object.
2407
+ *
2408
+ * @private
2409
+ * @param {*} value The value to check.
2410
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
2411
+ */
2412
+ function isPrototype(value) {
2413
+ var Ctor = value && value.constructor,
2414
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
2415
+
2416
+ return value === proto;
2417
+ }
2418
+
2419
+ _isPrototype = isPrototype;
2420
+ return _isPrototype;
2421
+ }
2422
+
2423
+ /**
2424
+ * Creates a unary function that invokes `func` with its argument transformed.
2425
+ *
2426
+ * @private
2427
+ * @param {Function} func The function to wrap.
2428
+ * @param {Function} transform The argument transform.
2429
+ * @returns {Function} Returns the new function.
2430
+ */
2431
+
2432
+ var _overArg;
2433
+ var hasRequired_overArg;
2434
+
2435
+ function require_overArg () {
2436
+ if (hasRequired_overArg) return _overArg;
2437
+ hasRequired_overArg = 1;
2438
+ function overArg(func, transform) {
2439
+ return function(arg) {
2440
+ return func(transform(arg));
2441
+ };
2442
+ }
2443
+
2444
+ _overArg = overArg;
2445
+ return _overArg;
2446
+ }
2447
+
2448
+ var _nativeKeys;
2449
+ var hasRequired_nativeKeys;
2450
+
2451
+ function require_nativeKeys () {
2452
+ if (hasRequired_nativeKeys) return _nativeKeys;
2453
+ hasRequired_nativeKeys = 1;
2454
+ var overArg = require_overArg();
2455
+
2456
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2457
+ var nativeKeys = overArg(Object.keys, Object);
2458
+
2459
+ _nativeKeys = nativeKeys;
2460
+ return _nativeKeys;
2461
+ }
2462
+
2463
+ var _baseKeys;
2464
+ var hasRequired_baseKeys;
2465
+
2466
+ function require_baseKeys () {
2467
+ if (hasRequired_baseKeys) return _baseKeys;
2468
+ hasRequired_baseKeys = 1;
2469
+ var isPrototype = require_isPrototype(),
2470
+ nativeKeys = require_nativeKeys();
2471
+
2472
+ /** Used for built-in method references. */
2473
+ var objectProto = Object.prototype;
2474
+
2475
+ /** Used to check objects for own properties. */
2476
+ var hasOwnProperty = objectProto.hasOwnProperty;
2477
+
2478
+ /**
2479
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
2480
+ *
2481
+ * @private
2482
+ * @param {Object} object The object to query.
2483
+ * @returns {Array} Returns the array of property names.
2484
+ */
2485
+ function baseKeys(object) {
2486
+ if (!isPrototype(object)) {
2487
+ return nativeKeys(object);
2488
+ }
2489
+ var result = [];
2490
+ for (var key in Object(object)) {
2491
+ if (hasOwnProperty.call(object, key) && key != 'constructor') {
2492
+ result.push(key);
2493
+ }
2494
+ }
2495
+ return result;
2496
+ }
2497
+
2498
+ _baseKeys = baseKeys;
2499
+ return _baseKeys;
2500
+ }
2501
+
2502
+ var isArrayLike_1;
2503
+ var hasRequiredIsArrayLike;
2504
+
2505
+ function requireIsArrayLike () {
2506
+ if (hasRequiredIsArrayLike) return isArrayLike_1;
2507
+ hasRequiredIsArrayLike = 1;
2508
+ var isFunction = requireIsFunction(),
2509
+ isLength = requireIsLength();
2510
+
2511
+ /**
2512
+ * Checks if `value` is array-like. A value is considered array-like if it's
2513
+ * not a function and has a `value.length` that's an integer greater than or
2514
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
2515
+ *
2516
+ * @static
2517
+ * @memberOf _
2518
+ * @since 4.0.0
2519
+ * @category Lang
2520
+ * @param {*} value The value to check.
2521
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
2522
+ * @example
2523
+ *
2524
+ * _.isArrayLike([1, 2, 3]);
2525
+ * // => true
2526
+ *
2527
+ * _.isArrayLike(document.body.children);
2528
+ * // => true
2529
+ *
2530
+ * _.isArrayLike('abc');
2531
+ * // => true
2532
+ *
2533
+ * _.isArrayLike(_.noop);
2534
+ * // => false
2535
+ */
2536
+ function isArrayLike(value) {
2537
+ return value != null && isLength(value.length) && !isFunction(value);
2538
+ }
2539
+
2540
+ isArrayLike_1 = isArrayLike;
2541
+ return isArrayLike_1;
2542
+ }
2543
+
2544
+ var keys_1;
2545
+ var hasRequiredKeys;
2546
+
2547
+ function requireKeys () {
2548
+ if (hasRequiredKeys) return keys_1;
2549
+ hasRequiredKeys = 1;
2550
+ var arrayLikeKeys = require_arrayLikeKeys(),
2551
+ baseKeys = require_baseKeys(),
2552
+ isArrayLike = requireIsArrayLike();
2553
+
2554
+ /**
2555
+ * Creates an array of the own enumerable property names of `object`.
2556
+ *
2557
+ * **Note:** Non-object values are coerced to objects. See the
2558
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
2559
+ * for more details.
2560
+ *
2561
+ * @static
2562
+ * @since 0.1.0
2563
+ * @memberOf _
2564
+ * @category Object
2565
+ * @param {Object} object The object to query.
2566
+ * @returns {Array} Returns the array of property names.
2567
+ * @example
2568
+ *
2569
+ * function Foo() {
2570
+ * this.a = 1;
2571
+ * this.b = 2;
2572
+ * }
2573
+ *
2574
+ * Foo.prototype.c = 3;
2575
+ *
2576
+ * _.keys(new Foo);
2577
+ * // => ['a', 'b'] (iteration order is not guaranteed)
2578
+ *
2579
+ * _.keys('hi');
2580
+ * // => ['0', '1']
2581
+ */
2582
+ function keys(object) {
2583
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
2584
+ }
2585
+
2586
+ keys_1 = keys;
2587
+ return keys_1;
2588
+ }
2589
+
2590
+ var values_1;
2591
+ var hasRequiredValues;
2592
+
2593
+ function requireValues () {
2594
+ if (hasRequiredValues) return values_1;
2595
+ hasRequiredValues = 1;
2596
+ var baseValues = require_baseValues(),
2597
+ keys = requireKeys();
2598
+
2599
+ /**
2600
+ * Creates an array of the own enumerable string keyed property values of `object`.
2601
+ *
2602
+ * **Note:** Non-object values are coerced to objects.
2603
+ *
2604
+ * @static
2605
+ * @since 0.1.0
2606
+ * @memberOf _
2607
+ * @category Object
2608
+ * @param {Object} object The object to query.
2609
+ * @returns {Array} Returns the array of property values.
2610
+ * @example
2611
+ *
2612
+ * function Foo() {
2613
+ * this.a = 1;
2614
+ * this.b = 2;
2615
+ * }
2616
+ *
2617
+ * Foo.prototype.c = 3;
2618
+ *
2619
+ * _.values(new Foo);
2620
+ * // => [1, 2] (iteration order is not guaranteed)
2621
+ *
2622
+ * _.values('hi');
2623
+ * // => ['h', 'i']
2624
+ */
2625
+ function values(object) {
2626
+ return object == null ? [] : baseValues(object, keys(object));
2627
+ }
2628
+
2629
+ values_1 = values;
2630
+ return values_1;
2631
+ }
2632
+
2633
+ var _baseShuffle;
2634
+ var hasRequired_baseShuffle;
2635
+
2636
+ function require_baseShuffle () {
2637
+ if (hasRequired_baseShuffle) return _baseShuffle;
2638
+ hasRequired_baseShuffle = 1;
2639
+ var shuffleSelf = require_shuffleSelf(),
2640
+ values = requireValues();
2641
+
2642
+ /**
2643
+ * The base implementation of `_.shuffle`.
2644
+ *
2645
+ * @private
2646
+ * @param {Array|Object} collection The collection to shuffle.
2647
+ * @returns {Array} Returns the new shuffled array.
2648
+ */
2649
+ function baseShuffle(collection) {
2650
+ return shuffleSelf(values(collection));
2651
+ }
2652
+
2653
+ _baseShuffle = baseShuffle;
2654
+ return _baseShuffle;
2655
+ }
2656
+
2657
+ var shuffle_1;
2658
+ var hasRequiredShuffle;
2659
+
2660
+ function requireShuffle () {
2661
+ if (hasRequiredShuffle) return shuffle_1;
2662
+ hasRequiredShuffle = 1;
2663
+ var arrayShuffle = require_arrayShuffle(),
2664
+ baseShuffle = require_baseShuffle(),
2665
+ isArray = requireIsArray();
2666
+
2667
+ /**
2668
+ * Creates an array of shuffled values, using a version of the
2669
+ * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
2670
+ *
2671
+ * @static
2672
+ * @memberOf _
2673
+ * @since 0.1.0
2674
+ * @category Collection
2675
+ * @param {Array|Object} collection The collection to shuffle.
2676
+ * @returns {Array} Returns the new shuffled array.
2677
+ * @example
2678
+ *
2679
+ * _.shuffle([1, 2, 3, 4]);
2680
+ * // => [4, 1, 3, 2]
2681
+ */
2682
+ function shuffle(collection) {
2683
+ var func = isArray(collection) ? arrayShuffle : baseShuffle;
2684
+ return func(collection);
2685
+ }
2686
+
2687
+ shuffle_1 = shuffle;
2688
+ return shuffle_1;
2689
+ }
2690
+
2691
+ var shuffleExports = requireShuffle();
2692
+ var shuffle = /*@__PURE__*/getDefaultExportFromCjs(shuffleExports);
2693
+
2694
+ var _DataView;
2695
+ var hasRequired_DataView;
2696
+
2697
+ function require_DataView () {
2698
+ if (hasRequired_DataView) return _DataView;
2699
+ hasRequired_DataView = 1;
2700
+ var getNative = require_getNative(),
2701
+ root = require_root();
2702
+
2703
+ /* Built-in method references that are verified to be native. */
2704
+ var DataView = getNative(root, 'DataView');
2705
+
2706
+ _DataView = DataView;
2707
+ return _DataView;
2708
+ }
2709
+
2710
+ var _Promise;
2711
+ var hasRequired_Promise;
2712
+
2713
+ function require_Promise () {
2714
+ if (hasRequired_Promise) return _Promise;
2715
+ hasRequired_Promise = 1;
2716
+ var getNative = require_getNative(),
2717
+ root = require_root();
2718
+
2719
+ /* Built-in method references that are verified to be native. */
2720
+ var Promise = getNative(root, 'Promise');
2721
+
2722
+ _Promise = Promise;
2723
+ return _Promise;
2724
+ }
2725
+
2726
+ var _Set;
2727
+ var hasRequired_Set;
2728
+
2729
+ function require_Set () {
2730
+ if (hasRequired_Set) return _Set;
2731
+ hasRequired_Set = 1;
2732
+ var getNative = require_getNative(),
2733
+ root = require_root();
2734
+
2735
+ /* Built-in method references that are verified to be native. */
2736
+ var Set = getNative(root, 'Set');
2737
+
2738
+ _Set = Set;
2739
+ return _Set;
2740
+ }
2741
+
2742
+ var _WeakMap;
2743
+ var hasRequired_WeakMap;
2744
+
2745
+ function require_WeakMap () {
2746
+ if (hasRequired_WeakMap) return _WeakMap;
2747
+ hasRequired_WeakMap = 1;
2748
+ var getNative = require_getNative(),
2749
+ root = require_root();
2750
+
2751
+ /* Built-in method references that are verified to be native. */
2752
+ var WeakMap = getNative(root, 'WeakMap');
2753
+
2754
+ _WeakMap = WeakMap;
2755
+ return _WeakMap;
2756
+ }
2757
+
2758
+ var _getTag;
2759
+ var hasRequired_getTag;
2760
+
2761
+ function require_getTag () {
2762
+ if (hasRequired_getTag) return _getTag;
2763
+ hasRequired_getTag = 1;
2764
+ var DataView = require_DataView(),
2765
+ Map = require_Map(),
2766
+ Promise = require_Promise(),
2767
+ Set = require_Set(),
2768
+ WeakMap = require_WeakMap(),
2769
+ baseGetTag = require_baseGetTag(),
2770
+ toSource = require_toSource();
2771
+
2772
+ /** `Object#toString` result references. */
2773
+ var mapTag = '[object Map]',
2774
+ objectTag = '[object Object]',
2775
+ promiseTag = '[object Promise]',
2776
+ setTag = '[object Set]',
2777
+ weakMapTag = '[object WeakMap]';
2778
+
2779
+ var dataViewTag = '[object DataView]';
2780
+
2781
+ /** Used to detect maps, sets, and weakmaps. */
2782
+ var dataViewCtorString = toSource(DataView),
2783
+ mapCtorString = toSource(Map),
2784
+ promiseCtorString = toSource(Promise),
2785
+ setCtorString = toSource(Set),
2786
+ weakMapCtorString = toSource(WeakMap);
2787
+
2788
+ /**
2789
+ * Gets the `toStringTag` of `value`.
2790
+ *
2791
+ * @private
2792
+ * @param {*} value The value to query.
2793
+ * @returns {string} Returns the `toStringTag`.
2794
+ */
2795
+ var getTag = baseGetTag;
2796
+
2797
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2798
+ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
2799
+ (Map && getTag(new Map) != mapTag) ||
2800
+ (Promise && getTag(Promise.resolve()) != promiseTag) ||
2801
+ (Set && getTag(new Set) != setTag) ||
2802
+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {
2803
+ getTag = function(value) {
2804
+ var result = baseGetTag(value),
2805
+ Ctor = result == objectTag ? value.constructor : undefined,
2806
+ ctorString = Ctor ? toSource(Ctor) : '';
2807
+
2808
+ if (ctorString) {
2809
+ switch (ctorString) {
2810
+ case dataViewCtorString: return dataViewTag;
2811
+ case mapCtorString: return mapTag;
2812
+ case promiseCtorString: return promiseTag;
2813
+ case setCtorString: return setTag;
2814
+ case weakMapCtorString: return weakMapTag;
2815
+ }
2816
+ }
2817
+ return result;
2818
+ };
2819
+ }
2820
+
2821
+ _getTag = getTag;
2822
+ return _getTag;
2823
+ }
2824
+
2825
+ var isEmpty_1;
2826
+ var hasRequiredIsEmpty;
2827
+
2828
+ function requireIsEmpty () {
2829
+ if (hasRequiredIsEmpty) return isEmpty_1;
2830
+ hasRequiredIsEmpty = 1;
2831
+ var baseKeys = require_baseKeys(),
2832
+ getTag = require_getTag(),
2833
+ isArguments = requireIsArguments(),
2834
+ isArray = requireIsArray(),
2835
+ isArrayLike = requireIsArrayLike(),
2836
+ isBuffer = requireIsBuffer(),
2837
+ isPrototype = require_isPrototype(),
2838
+ isTypedArray = requireIsTypedArray();
2839
+
2840
+ /** `Object#toString` result references. */
2841
+ var mapTag = '[object Map]',
2842
+ setTag = '[object Set]';
2843
+
2844
+ /** Used for built-in method references. */
2845
+ var objectProto = Object.prototype;
2846
+
2847
+ /** Used to check objects for own properties. */
2848
+ var hasOwnProperty = objectProto.hasOwnProperty;
2849
+
2850
+ /**
2851
+ * Checks if `value` is an empty object, collection, map, or set.
2852
+ *
2853
+ * Objects are considered empty if they have no own enumerable string keyed
2854
+ * properties.
2855
+ *
2856
+ * Array-like values such as `arguments` objects, arrays, buffers, strings, or
2857
+ * jQuery-like collections are considered empty if they have a `length` of `0`.
2858
+ * Similarly, maps and sets are considered empty if they have a `size` of `0`.
2859
+ *
2860
+ * @static
2861
+ * @memberOf _
2862
+ * @since 0.1.0
2863
+ * @category Lang
2864
+ * @param {*} value The value to check.
2865
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
2866
+ * @example
2867
+ *
2868
+ * _.isEmpty(null);
2869
+ * // => true
2870
+ *
2871
+ * _.isEmpty(true);
2872
+ * // => true
2873
+ *
2874
+ * _.isEmpty(1);
2875
+ * // => true
2876
+ *
2877
+ * _.isEmpty([1, 2, 3]);
2878
+ * // => false
2879
+ *
2880
+ * _.isEmpty({ 'a': 1 });
2881
+ * // => false
2882
+ */
2883
+ function isEmpty(value) {
2884
+ if (value == null) {
2885
+ return true;
2886
+ }
2887
+ if (isArrayLike(value) &&
2888
+ (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
2889
+ isBuffer(value) || isTypedArray(value) || isArguments(value))) {
2890
+ return !value.length;
2891
+ }
2892
+ var tag = getTag(value);
2893
+ if (tag == mapTag || tag == setTag) {
2894
+ return !value.size;
2895
+ }
2896
+ if (isPrototype(value)) {
2897
+ return !baseKeys(value).length;
2898
+ }
2899
+ for (var key in value) {
2900
+ if (hasOwnProperty.call(value, key)) {
2901
+ return false;
2902
+ }
2903
+ }
2904
+ return true;
2905
+ }
2906
+
2907
+ isEmpty_1 = isEmpty;
2908
+ return isEmpty_1;
2909
+ }
2910
+
2911
+ var isEmptyExports = requireIsEmpty();
2912
+ var isEmpty = /*@__PURE__*/getDefaultExportFromCjs(isEmptyExports);
2913
+
2914
+ const lg = n => console[n].bind(console, 'controller-utils:');
2915
+
2916
+ const debug = lg('debug');
2917
+ const log = lg('log');
2918
+ const warn = lg('warn');
2919
+ const error = lg('error');
2920
+ const compact = arr => {
2921
+ if (Array.isArray(arr)) {
2922
+ return arr.filter(v => v !== null && v !== undefined);
2923
+ }
2924
+
2925
+ return arr;
2926
+ };
2927
+ const getShuffledChoices = (choices, session, updateSession, choiceKey) => new Promise(resolve => {
2928
+ var _session$data;
2929
+
2930
+ log('updateSession type: ', typeof updateSession);
2931
+ log('session: ', session);
2932
+ const currentShuffled = compact((session == null ? void 0 : (_session$data = session.data) == null ? void 0 : _session$data.shuffledValues) || (session == null ? void 0 : session.shuffledValues) || []);
2933
+
2934
+ if (!session) {
2935
+ // eslint-disable-next-line quotes
2936
+ warn("unable to save shuffled choices because there's no session.");
2937
+ resolve(undefined);
2938
+ } else if (!isEmpty(currentShuffled)) {
2939
+ debug('use shuffledValues to sort the choices...', currentShuffled);
2940
+ resolve(compact(currentShuffled.map(v => choices.find(c => c[choiceKey] === v))));
2941
+ } else {
2942
+ const shuffledChoices = shuffle(choices);
2943
+
2944
+ if (updateSession && typeof updateSession === 'function') {
2945
+ try {
2946
+ //Note: session.id refers to the id of the element within a session
2947
+ const shuffledValues = compact(shuffledChoices.map(c => c[choiceKey]));
2948
+ log('try to save shuffledValues to session...', shuffledValues);
2949
+ log('call updateSession... ', session.id, session.element);
2950
+
2951
+ if (isEmpty(shuffledValues)) {
2952
+ error(`shuffledValues is an empty array? - refusing to call updateSession: shuffledChoices: ${JSON.stringify(shuffledChoices)}, key: ${choiceKey}`);
2953
+ } else {
2954
+ updateSession(session.id, session.element, {
2955
+ shuffledValues
2956
+ }).catch(e => // eslint-disable-next-line no-console
2957
+ console.error('update session failed for: ', session.id, e));
2958
+ }
2959
+ } catch (e) {
2960
+ warn('unable to save shuffled order for choices');
2961
+ error(e);
2962
+ }
2963
+ } else {
2964
+ warn('unable to save shuffled choices, shuffle will happen every time.');
2965
+ } //save this shuffle to the session for later retrieval
2966
+
2967
+
2968
+ resolve(shuffledChoices);
2969
+ }
2970
+ });
2971
+ /**
2972
+ * If we return:
2973
+ * - true - that means that the order of the choices will be ordinal (as is created in the configure item)
2974
+ * - false - that means the getShuffledChoices above will be called and that in turn means that we either
2975
+ * return the shuffled values on the session (if any exists) or we shuffle the choices
2976
+ * @param model - model to check if we should lock order
2977
+ * @param session - session to check if we should lock order
2978
+ * @param env - env to check if we should lock order
2979
+ * @returns {boolean}
2980
+ */
2981
+
2982
+ const lockChoices = (model, session, env) => {
2983
+ if (model.lockChoiceOrder) {
2984
+ return true;
2985
+ }
2986
+
2987
+ log('lockChoiceOrder: ', get(env, ['@pie-element', 'lockChoiceOrder'], false));
2988
+
2989
+ if (get(env, ['@pie-element', 'lockChoiceOrder'], false)) {
2990
+ return true;
2991
+ }
2992
+
2993
+ const role = get(env, 'role', 'student');
2994
+
2995
+ if (role === 'instructor') {
2996
+ // TODO: .. in the future the instructor can toggle between ordinal and shuffled here, so keeping this code until then
2997
+
2998
+ /*const alreadyShuffled = hasShuffledValues(session);
2999
+ if (alreadyShuffled) {
3000
+ return false;
3001
+ }
3002
+ return true;*/
3003
+ return true;
3004
+ } // here it's a student, so don't lock and it will shuffle if needs be
3005
+
3006
+
3007
+ return false;
3008
+ };
3009
+
3010
+ export { getShuffledChoices, lockChoices, partialScoring };
3011
+ //# sourceMappingURL=index.js.map