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