@kne/super-select 0.1.0 → 0.1.1
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 +2031 -1202
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +2029 -1200
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35,265 +35,259 @@ const {
|
|
|
35
35
|
useContext
|
|
36
36
|
} = context;
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Removes all key-value entries from the list cache.
|
|
40
|
+
*
|
|
41
|
+
* @private
|
|
42
|
+
* @name clear
|
|
43
|
+
* @memberOf ListCache
|
|
44
|
+
*/
|
|
45
|
+
function listCacheClear() {
|
|
46
|
+
this.__data__ = [];
|
|
47
|
+
this.size = 0;
|
|
48
|
+
}
|
|
39
49
|
|
|
40
|
-
|
|
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
|
-
};
|
|
50
|
+
var _listCacheClear = listCacheClear;
|
|
270
51
|
|
|
271
52
|
/**
|
|
272
|
-
*
|
|
53
|
+
* Performs a
|
|
54
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
55
|
+
* comparison between two values to determine if they are equivalent.
|
|
273
56
|
*
|
|
274
57
|
* @static
|
|
275
58
|
* @memberOf _
|
|
276
|
-
* @since 0.
|
|
59
|
+
* @since 4.0.0
|
|
277
60
|
* @category Lang
|
|
278
|
-
* @param {*} value The value to
|
|
279
|
-
* @
|
|
61
|
+
* @param {*} value The value to compare.
|
|
62
|
+
* @param {*} other The other value to compare.
|
|
63
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
280
64
|
* @example
|
|
281
65
|
*
|
|
282
|
-
*
|
|
66
|
+
* var object = { 'a': 1 };
|
|
67
|
+
* var other = { 'a': 1 };
|
|
68
|
+
*
|
|
69
|
+
* _.eq(object, object);
|
|
283
70
|
* // => true
|
|
284
71
|
*
|
|
285
|
-
* _.
|
|
72
|
+
* _.eq(object, other);
|
|
286
73
|
* // => false
|
|
287
74
|
*
|
|
288
|
-
* _.
|
|
289
|
-
* // =>
|
|
75
|
+
* _.eq('a', 'a');
|
|
76
|
+
* // => true
|
|
290
77
|
*
|
|
291
|
-
* _.
|
|
78
|
+
* _.eq('a', Object('a'));
|
|
292
79
|
* // => false
|
|
80
|
+
*
|
|
81
|
+
* _.eq(NaN, NaN);
|
|
82
|
+
* // => true
|
|
293
83
|
*/
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
84
|
+
function eq(value, other) {
|
|
85
|
+
return value === other || (value !== value && other !== other);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var eq_1 = eq;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
92
|
+
*
|
|
93
|
+
* @private
|
|
94
|
+
* @param {Array} array The array to inspect.
|
|
95
|
+
* @param {*} key The key to search for.
|
|
96
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
97
|
+
*/
|
|
98
|
+
function assocIndexOf(array, key) {
|
|
99
|
+
var length = array.length;
|
|
100
|
+
while (length--) {
|
|
101
|
+
if (eq_1(array[length][0], key)) {
|
|
102
|
+
return length;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return -1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var _assocIndexOf = assocIndexOf;
|
|
109
|
+
|
|
110
|
+
/** Used for built-in method references. */
|
|
111
|
+
var arrayProto = Array.prototype;
|
|
112
|
+
|
|
113
|
+
/** Built-in value references. */
|
|
114
|
+
var splice = arrayProto.splice;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Removes `key` and its value from the list cache.
|
|
118
|
+
*
|
|
119
|
+
* @private
|
|
120
|
+
* @name delete
|
|
121
|
+
* @memberOf ListCache
|
|
122
|
+
* @param {string} key The key of the value to remove.
|
|
123
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
124
|
+
*/
|
|
125
|
+
function listCacheDelete(key) {
|
|
126
|
+
var data = this.__data__,
|
|
127
|
+
index = _assocIndexOf(data, key);
|
|
128
|
+
|
|
129
|
+
if (index < 0) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
var lastIndex = data.length - 1;
|
|
133
|
+
if (index == lastIndex) {
|
|
134
|
+
data.pop();
|
|
135
|
+
} else {
|
|
136
|
+
splice.call(data, index, 1);
|
|
137
|
+
}
|
|
138
|
+
--this.size;
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
var _listCacheDelete = listCacheDelete;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Gets the list cache value for `key`.
|
|
146
|
+
*
|
|
147
|
+
* @private
|
|
148
|
+
* @name get
|
|
149
|
+
* @memberOf ListCache
|
|
150
|
+
* @param {string} key The key of the value to get.
|
|
151
|
+
* @returns {*} Returns the entry value.
|
|
152
|
+
*/
|
|
153
|
+
function listCacheGet(key) {
|
|
154
|
+
var data = this.__data__,
|
|
155
|
+
index = _assocIndexOf(data, key);
|
|
156
|
+
|
|
157
|
+
return index < 0 ? undefined : data[index][1];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
var _listCacheGet = listCacheGet;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Checks if a list cache value for `key` exists.
|
|
164
|
+
*
|
|
165
|
+
* @private
|
|
166
|
+
* @name has
|
|
167
|
+
* @memberOf ListCache
|
|
168
|
+
* @param {string} key The key of the entry to check.
|
|
169
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
170
|
+
*/
|
|
171
|
+
function listCacheHas(key) {
|
|
172
|
+
return _assocIndexOf(this.__data__, key) > -1;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
var _listCacheHas = listCacheHas;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Sets the list cache `key` to `value`.
|
|
179
|
+
*
|
|
180
|
+
* @private
|
|
181
|
+
* @name set
|
|
182
|
+
* @memberOf ListCache
|
|
183
|
+
* @param {string} key The key of the value to set.
|
|
184
|
+
* @param {*} value The value to set.
|
|
185
|
+
* @returns {Object} Returns the list cache instance.
|
|
186
|
+
*/
|
|
187
|
+
function listCacheSet(key, value) {
|
|
188
|
+
var data = this.__data__,
|
|
189
|
+
index = _assocIndexOf(data, key);
|
|
190
|
+
|
|
191
|
+
if (index < 0) {
|
|
192
|
+
++this.size;
|
|
193
|
+
data.push([key, value]);
|
|
194
|
+
} else {
|
|
195
|
+
data[index][1] = value;
|
|
196
|
+
}
|
|
197
|
+
return this;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
var _listCacheSet = listCacheSet;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Creates an list cache object.
|
|
204
|
+
*
|
|
205
|
+
* @private
|
|
206
|
+
* @constructor
|
|
207
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
208
|
+
*/
|
|
209
|
+
function ListCache(entries) {
|
|
210
|
+
var index = -1,
|
|
211
|
+
length = entries == null ? 0 : entries.length;
|
|
212
|
+
|
|
213
|
+
this.clear();
|
|
214
|
+
while (++index < length) {
|
|
215
|
+
var entry = entries[index];
|
|
216
|
+
this.set(entry[0], entry[1]);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Add methods to `ListCache`.
|
|
221
|
+
ListCache.prototype.clear = _listCacheClear;
|
|
222
|
+
ListCache.prototype['delete'] = _listCacheDelete;
|
|
223
|
+
ListCache.prototype.get = _listCacheGet;
|
|
224
|
+
ListCache.prototype.has = _listCacheHas;
|
|
225
|
+
ListCache.prototype.set = _listCacheSet;
|
|
226
|
+
|
|
227
|
+
var _ListCache = ListCache;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Removes all key-value entries from the stack.
|
|
231
|
+
*
|
|
232
|
+
* @private
|
|
233
|
+
* @name clear
|
|
234
|
+
* @memberOf Stack
|
|
235
|
+
*/
|
|
236
|
+
function stackClear() {
|
|
237
|
+
this.__data__ = new _ListCache;
|
|
238
|
+
this.size = 0;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
var _stackClear = stackClear;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Removes `key` and its value from the stack.
|
|
245
|
+
*
|
|
246
|
+
* @private
|
|
247
|
+
* @name delete
|
|
248
|
+
* @memberOf Stack
|
|
249
|
+
* @param {string} key The key of the value to remove.
|
|
250
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
251
|
+
*/
|
|
252
|
+
function stackDelete(key) {
|
|
253
|
+
var data = this.__data__,
|
|
254
|
+
result = data['delete'](key);
|
|
255
|
+
|
|
256
|
+
this.size = data.size;
|
|
257
|
+
return result;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
var _stackDelete = stackDelete;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Gets the stack value for `key`.
|
|
264
|
+
*
|
|
265
|
+
* @private
|
|
266
|
+
* @name get
|
|
267
|
+
* @memberOf Stack
|
|
268
|
+
* @param {string} key The key of the value to get.
|
|
269
|
+
* @returns {*} Returns the entry value.
|
|
270
|
+
*/
|
|
271
|
+
function stackGet(key) {
|
|
272
|
+
return this.__data__.get(key);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
var _stackGet = stackGet;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Checks if a stack value for `key` exists.
|
|
279
|
+
*
|
|
280
|
+
* @private
|
|
281
|
+
* @name has
|
|
282
|
+
* @memberOf Stack
|
|
283
|
+
* @param {string} key The key of the entry to check.
|
|
284
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
285
|
+
*/
|
|
286
|
+
function stackHas(key) {
|
|
287
|
+
return this.__data__.has(key);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
var _stackHas = stackHas;
|
|
297
291
|
|
|
298
292
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
299
293
|
|
|
@@ -322,17 +316,17 @@ var Symbol = _root.Symbol;
|
|
|
322
316
|
var _Symbol = Symbol;
|
|
323
317
|
|
|
324
318
|
/** Used for built-in method references. */
|
|
325
|
-
var objectProto$
|
|
319
|
+
var objectProto$e = Object.prototype;
|
|
326
320
|
|
|
327
321
|
/** Used to check objects for own properties. */
|
|
328
|
-
var hasOwnProperty$
|
|
322
|
+
var hasOwnProperty$b = objectProto$e.hasOwnProperty;
|
|
329
323
|
|
|
330
324
|
/**
|
|
331
325
|
* Used to resolve the
|
|
332
326
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
333
327
|
* of values.
|
|
334
328
|
*/
|
|
335
|
-
var nativeObjectToString$1 = objectProto$
|
|
329
|
+
var nativeObjectToString$1 = objectProto$e.toString;
|
|
336
330
|
|
|
337
331
|
/** Built-in value references. */
|
|
338
332
|
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
@@ -345,7 +339,7 @@ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
|
345
339
|
* @returns {string} Returns the raw `toStringTag`.
|
|
346
340
|
*/
|
|
347
341
|
function getRawTag(value) {
|
|
348
|
-
var isOwn = hasOwnProperty$
|
|
342
|
+
var isOwn = hasOwnProperty$b.call(value, symToStringTag$1),
|
|
349
343
|
tag = value[symToStringTag$1];
|
|
350
344
|
|
|
351
345
|
try {
|
|
@@ -367,14 +361,14 @@ function getRawTag(value) {
|
|
|
367
361
|
var _getRawTag = getRawTag;
|
|
368
362
|
|
|
369
363
|
/** Used for built-in method references. */
|
|
370
|
-
var objectProto$
|
|
364
|
+
var objectProto$d = Object.prototype;
|
|
371
365
|
|
|
372
366
|
/**
|
|
373
367
|
* Used to resolve the
|
|
374
368
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
375
369
|
* of values.
|
|
376
370
|
*/
|
|
377
|
-
var nativeObjectToString = objectProto$
|
|
371
|
+
var nativeObjectToString = objectProto$d.toString;
|
|
378
372
|
|
|
379
373
|
/**
|
|
380
374
|
* Converts `value` to a string using `Object.prototype.toString`.
|
|
@@ -415,142 +409,58 @@ function baseGetTag(value) {
|
|
|
415
409
|
var _baseGetTag = baseGetTag;
|
|
416
410
|
|
|
417
411
|
/**
|
|
418
|
-
* Checks if `value` is
|
|
419
|
-
*
|
|
412
|
+
* Checks if `value` is the
|
|
413
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
414
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
420
415
|
*
|
|
421
416
|
* @static
|
|
422
417
|
* @memberOf _
|
|
423
|
-
* @since
|
|
418
|
+
* @since 0.1.0
|
|
424
419
|
* @category Lang
|
|
425
420
|
* @param {*} value The value to check.
|
|
426
|
-
* @returns {boolean} Returns `true` if `value` is object
|
|
421
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
427
422
|
* @example
|
|
428
423
|
*
|
|
429
|
-
* _.
|
|
424
|
+
* _.isObject({});
|
|
430
425
|
* // => true
|
|
431
426
|
*
|
|
432
|
-
* _.
|
|
427
|
+
* _.isObject([1, 2, 3]);
|
|
433
428
|
* // => true
|
|
434
429
|
*
|
|
435
|
-
* _.
|
|
436
|
-
* // =>
|
|
430
|
+
* _.isObject(_.noop);
|
|
431
|
+
* // => true
|
|
437
432
|
*
|
|
438
|
-
* _.
|
|
433
|
+
* _.isObject(null);
|
|
439
434
|
* // => false
|
|
440
435
|
*/
|
|
441
|
-
function
|
|
442
|
-
|
|
436
|
+
function isObject(value) {
|
|
437
|
+
var type = typeof value;
|
|
438
|
+
return value != null && (type == 'object' || type == 'function');
|
|
443
439
|
}
|
|
444
440
|
|
|
445
|
-
var
|
|
441
|
+
var isObject_1 = isObject;
|
|
446
442
|
|
|
447
443
|
/** `Object#toString` result references. */
|
|
448
|
-
var
|
|
444
|
+
var asyncTag = '[object AsyncFunction]',
|
|
445
|
+
funcTag$1 = '[object Function]',
|
|
446
|
+
genTag = '[object GeneratorFunction]',
|
|
447
|
+
proxyTag = '[object Proxy]';
|
|
449
448
|
|
|
450
449
|
/**
|
|
451
|
-
* Checks if `value` is classified as a `
|
|
450
|
+
* Checks if `value` is classified as a `Function` object.
|
|
452
451
|
*
|
|
453
452
|
* @static
|
|
454
453
|
* @memberOf _
|
|
455
|
-
* @since
|
|
454
|
+
* @since 0.1.0
|
|
456
455
|
* @category Lang
|
|
457
456
|
* @param {*} value The value to check.
|
|
458
|
-
* @returns {boolean} Returns `true` if `value` is a
|
|
457
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
459
458
|
* @example
|
|
460
459
|
*
|
|
461
|
-
* _.
|
|
460
|
+
* _.isFunction(_);
|
|
462
461
|
* // => true
|
|
463
462
|
*
|
|
464
|
-
* _.
|
|
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/);
|
|
463
|
+
* _.isFunction(/abc/);
|
|
554
464
|
* // => false
|
|
555
465
|
*/
|
|
556
466
|
function isFunction(value) {
|
|
@@ -627,17 +537,17 @@ var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
|
627
537
|
|
|
628
538
|
/** Used for built-in method references. */
|
|
629
539
|
var funcProto$1 = Function.prototype,
|
|
630
|
-
objectProto$
|
|
540
|
+
objectProto$c = Object.prototype;
|
|
631
541
|
|
|
632
542
|
/** Used to resolve the decompiled source of functions. */
|
|
633
543
|
var funcToString$1 = funcProto$1.toString;
|
|
634
544
|
|
|
635
545
|
/** Used to check objects for own properties. */
|
|
636
|
-
var hasOwnProperty$
|
|
546
|
+
var hasOwnProperty$a = objectProto$c.hasOwnProperty;
|
|
637
547
|
|
|
638
548
|
/** Used to detect if a method is native. */
|
|
639
549
|
var reIsNative = RegExp('^' +
|
|
640
|
-
funcToString$1.call(hasOwnProperty$
|
|
550
|
+
funcToString$1.call(hasOwnProperty$a).replace(reRegExpChar, '\\$&')
|
|
641
551
|
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
642
552
|
);
|
|
643
553
|
|
|
@@ -688,6 +598,11 @@ function getNative(object, key) {
|
|
|
688
598
|
|
|
689
599
|
var _getNative = getNative;
|
|
690
600
|
|
|
601
|
+
/* Built-in method references that are verified to be native. */
|
|
602
|
+
var Map = _getNative(_root, 'Map');
|
|
603
|
+
|
|
604
|
+
var _Map = Map;
|
|
605
|
+
|
|
691
606
|
/* Built-in method references that are verified to be native. */
|
|
692
607
|
var nativeCreate = _getNative(Object, 'create');
|
|
693
608
|
|
|
@@ -726,13 +641,13 @@ function hashDelete(key) {
|
|
|
726
641
|
var _hashDelete = hashDelete;
|
|
727
642
|
|
|
728
643
|
/** Used to stand-in for `undefined` hash values. */
|
|
729
|
-
var HASH_UNDEFINED$
|
|
644
|
+
var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
|
|
730
645
|
|
|
731
646
|
/** Used for built-in method references. */
|
|
732
|
-
var objectProto$
|
|
647
|
+
var objectProto$b = Object.prototype;
|
|
733
648
|
|
|
734
649
|
/** Used to check objects for own properties. */
|
|
735
|
-
var hasOwnProperty$
|
|
650
|
+
var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
|
|
736
651
|
|
|
737
652
|
/**
|
|
738
653
|
* Gets the hash value for `key`.
|
|
@@ -747,18 +662,18 @@ function hashGet(key) {
|
|
|
747
662
|
var data = this.__data__;
|
|
748
663
|
if (_nativeCreate) {
|
|
749
664
|
var result = data[key];
|
|
750
|
-
return result === HASH_UNDEFINED$
|
|
665
|
+
return result === HASH_UNDEFINED$2 ? undefined : result;
|
|
751
666
|
}
|
|
752
|
-
return hasOwnProperty$
|
|
667
|
+
return hasOwnProperty$9.call(data, key) ? data[key] : undefined;
|
|
753
668
|
}
|
|
754
669
|
|
|
755
670
|
var _hashGet = hashGet;
|
|
756
671
|
|
|
757
672
|
/** Used for built-in method references. */
|
|
758
|
-
var objectProto$
|
|
673
|
+
var objectProto$a = Object.prototype;
|
|
759
674
|
|
|
760
675
|
/** Used to check objects for own properties. */
|
|
761
|
-
var hasOwnProperty$
|
|
676
|
+
var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
|
762
677
|
|
|
763
678
|
/**
|
|
764
679
|
* Checks if a hash value for `key` exists.
|
|
@@ -771,13 +686,13 @@ var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
|
|
|
771
686
|
*/
|
|
772
687
|
function hashHas(key) {
|
|
773
688
|
var data = this.__data__;
|
|
774
|
-
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$
|
|
689
|
+
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$8.call(data, key);
|
|
775
690
|
}
|
|
776
691
|
|
|
777
692
|
var _hashHas = hashHas;
|
|
778
693
|
|
|
779
694
|
/** Used to stand-in for `undefined` hash values. */
|
|
780
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
695
|
+
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
781
696
|
|
|
782
697
|
/**
|
|
783
698
|
* Sets the hash `key` to `value`.
|
|
@@ -792,7 +707,7 @@ var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
|
792
707
|
function hashSet(key, value) {
|
|
793
708
|
var data = this.__data__;
|
|
794
709
|
this.size += this.has(key) ? 0 : 1;
|
|
795
|
-
data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
710
|
+
data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
|
|
796
711
|
return this;
|
|
797
712
|
}
|
|
798
713
|
|
|
@@ -826,177 +741,132 @@ Hash.prototype.set = _hashSet;
|
|
|
826
741
|
var _Hash = Hash;
|
|
827
742
|
|
|
828
743
|
/**
|
|
829
|
-
* Removes all key-value entries from the
|
|
744
|
+
* Removes all key-value entries from the map.
|
|
830
745
|
*
|
|
831
746
|
* @private
|
|
832
747
|
* @name clear
|
|
833
|
-
* @memberOf
|
|
748
|
+
* @memberOf MapCache
|
|
834
749
|
*/
|
|
835
|
-
function
|
|
836
|
-
this.__data__ = [];
|
|
750
|
+
function mapCacheClear() {
|
|
837
751
|
this.size = 0;
|
|
752
|
+
this.__data__ = {
|
|
753
|
+
'hash': new _Hash,
|
|
754
|
+
'map': new (_Map || _ListCache),
|
|
755
|
+
'string': new _Hash
|
|
756
|
+
};
|
|
838
757
|
}
|
|
839
758
|
|
|
840
|
-
var
|
|
759
|
+
var _mapCacheClear = mapCacheClear;
|
|
841
760
|
|
|
842
761
|
/**
|
|
843
|
-
*
|
|
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
|
|
762
|
+
* Checks if `value` is suitable for use as unique object key.
|
|
870
763
|
*
|
|
871
|
-
*
|
|
872
|
-
*
|
|
764
|
+
* @private
|
|
765
|
+
* @param {*} value The value to check.
|
|
766
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
873
767
|
*/
|
|
874
|
-
function
|
|
875
|
-
|
|
768
|
+
function isKeyable(value) {
|
|
769
|
+
var type = typeof value;
|
|
770
|
+
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
771
|
+
? (value !== '__proto__')
|
|
772
|
+
: (value === null);
|
|
876
773
|
}
|
|
877
774
|
|
|
878
|
-
var
|
|
775
|
+
var _isKeyable = isKeyable;
|
|
879
776
|
|
|
880
777
|
/**
|
|
881
|
-
* Gets the
|
|
778
|
+
* Gets the data for `map`.
|
|
882
779
|
*
|
|
883
780
|
* @private
|
|
884
|
-
* @param {
|
|
885
|
-
* @param {
|
|
886
|
-
* @returns {
|
|
781
|
+
* @param {Object} map The map to query.
|
|
782
|
+
* @param {string} key The reference key.
|
|
783
|
+
* @returns {*} Returns the map data.
|
|
887
784
|
*/
|
|
888
|
-
function
|
|
889
|
-
var
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
return -1;
|
|
785
|
+
function getMapData(map, key) {
|
|
786
|
+
var data = map.__data__;
|
|
787
|
+
return _isKeyable(key)
|
|
788
|
+
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
789
|
+
: data.map;
|
|
896
790
|
}
|
|
897
791
|
|
|
898
|
-
var
|
|
899
|
-
|
|
900
|
-
/** Used for built-in method references. */
|
|
901
|
-
var arrayProto = Array.prototype;
|
|
902
|
-
|
|
903
|
-
/** Built-in value references. */
|
|
904
|
-
var splice = arrayProto.splice;
|
|
792
|
+
var _getMapData = getMapData;
|
|
905
793
|
|
|
906
794
|
/**
|
|
907
|
-
* Removes `key` and its value from the
|
|
795
|
+
* Removes `key` and its value from the map.
|
|
908
796
|
*
|
|
909
797
|
* @private
|
|
910
798
|
* @name delete
|
|
911
|
-
* @memberOf
|
|
799
|
+
* @memberOf MapCache
|
|
912
800
|
* @param {string} key The key of the value to remove.
|
|
913
801
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
914
802
|
*/
|
|
915
|
-
function
|
|
916
|
-
var
|
|
917
|
-
|
|
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;
|
|
803
|
+
function mapCacheDelete(key) {
|
|
804
|
+
var result = _getMapData(this, key)['delete'](key);
|
|
805
|
+
this.size -= result ? 1 : 0;
|
|
806
|
+
return result;
|
|
930
807
|
}
|
|
931
808
|
|
|
932
|
-
var
|
|
809
|
+
var _mapCacheDelete = mapCacheDelete;
|
|
933
810
|
|
|
934
811
|
/**
|
|
935
|
-
* Gets the
|
|
812
|
+
* Gets the map value for `key`.
|
|
936
813
|
*
|
|
937
814
|
* @private
|
|
938
815
|
* @name get
|
|
939
|
-
* @memberOf
|
|
816
|
+
* @memberOf MapCache
|
|
940
817
|
* @param {string} key The key of the value to get.
|
|
941
818
|
* @returns {*} Returns the entry value.
|
|
942
819
|
*/
|
|
943
|
-
function
|
|
944
|
-
|
|
945
|
-
index = _assocIndexOf(data, key);
|
|
946
|
-
|
|
947
|
-
return index < 0 ? undefined : data[index][1];
|
|
820
|
+
function mapCacheGet(key) {
|
|
821
|
+
return _getMapData(this, key).get(key);
|
|
948
822
|
}
|
|
949
823
|
|
|
950
|
-
var
|
|
824
|
+
var _mapCacheGet = mapCacheGet;
|
|
951
825
|
|
|
952
826
|
/**
|
|
953
|
-
* Checks if a
|
|
827
|
+
* Checks if a map value for `key` exists.
|
|
954
828
|
*
|
|
955
829
|
* @private
|
|
956
830
|
* @name has
|
|
957
|
-
* @memberOf
|
|
831
|
+
* @memberOf MapCache
|
|
958
832
|
* @param {string} key The key of the entry to check.
|
|
959
833
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
960
834
|
*/
|
|
961
|
-
function
|
|
962
|
-
return
|
|
835
|
+
function mapCacheHas(key) {
|
|
836
|
+
return _getMapData(this, key).has(key);
|
|
963
837
|
}
|
|
964
838
|
|
|
965
|
-
var
|
|
839
|
+
var _mapCacheHas = mapCacheHas;
|
|
966
840
|
|
|
967
841
|
/**
|
|
968
|
-
* Sets the
|
|
842
|
+
* Sets the map `key` to `value`.
|
|
969
843
|
*
|
|
970
844
|
* @private
|
|
971
845
|
* @name set
|
|
972
|
-
* @memberOf
|
|
846
|
+
* @memberOf MapCache
|
|
973
847
|
* @param {string} key The key of the value to set.
|
|
974
848
|
* @param {*} value The value to set.
|
|
975
|
-
* @returns {Object} Returns the
|
|
849
|
+
* @returns {Object} Returns the map cache instance.
|
|
976
850
|
*/
|
|
977
|
-
function
|
|
978
|
-
var data = this
|
|
979
|
-
|
|
851
|
+
function mapCacheSet(key, value) {
|
|
852
|
+
var data = _getMapData(this, key),
|
|
853
|
+
size = data.size;
|
|
980
854
|
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
data.push([key, value]);
|
|
984
|
-
} else {
|
|
985
|
-
data[index][1] = value;
|
|
986
|
-
}
|
|
855
|
+
data.set(key, value);
|
|
856
|
+
this.size += data.size == size ? 0 : 1;
|
|
987
857
|
return this;
|
|
988
858
|
}
|
|
989
859
|
|
|
990
|
-
var
|
|
860
|
+
var _mapCacheSet = mapCacheSet;
|
|
991
861
|
|
|
992
862
|
/**
|
|
993
|
-
* Creates
|
|
863
|
+
* Creates a map cache object to store key-value pairs.
|
|
994
864
|
*
|
|
995
865
|
* @private
|
|
996
866
|
* @constructor
|
|
997
867
|
* @param {Array} [entries] The key-value pairs to cache.
|
|
998
868
|
*/
|
|
999
|
-
function
|
|
869
|
+
function MapCache(entries) {
|
|
1000
870
|
var index = -1,
|
|
1001
871
|
length = entries == null ? 0 : entries.length;
|
|
1002
872
|
|
|
@@ -1007,165 +877,1670 @@ function ListCache(entries) {
|
|
|
1007
877
|
}
|
|
1008
878
|
}
|
|
1009
879
|
|
|
1010
|
-
// Add methods to `
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
880
|
+
// Add methods to `MapCache`.
|
|
881
|
+
MapCache.prototype.clear = _mapCacheClear;
|
|
882
|
+
MapCache.prototype['delete'] = _mapCacheDelete;
|
|
883
|
+
MapCache.prototype.get = _mapCacheGet;
|
|
884
|
+
MapCache.prototype.has = _mapCacheHas;
|
|
885
|
+
MapCache.prototype.set = _mapCacheSet;
|
|
1016
886
|
|
|
1017
|
-
var
|
|
887
|
+
var _MapCache = MapCache;
|
|
1018
888
|
|
|
1019
|
-
|
|
1020
|
-
var
|
|
889
|
+
/** Used as the size to enable large array optimizations. */
|
|
890
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
1021
891
|
|
|
1022
|
-
|
|
892
|
+
/**
|
|
893
|
+
* Sets the stack `key` to `value`.
|
|
894
|
+
*
|
|
895
|
+
* @private
|
|
896
|
+
* @name set
|
|
897
|
+
* @memberOf Stack
|
|
898
|
+
* @param {string} key The key of the value to set.
|
|
899
|
+
* @param {*} value The value to set.
|
|
900
|
+
* @returns {Object} Returns the stack cache instance.
|
|
901
|
+
*/
|
|
902
|
+
function stackSet(key, value) {
|
|
903
|
+
var data = this.__data__;
|
|
904
|
+
if (data instanceof _ListCache) {
|
|
905
|
+
var pairs = data.__data__;
|
|
906
|
+
if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
|
907
|
+
pairs.push([key, value]);
|
|
908
|
+
this.size = ++data.size;
|
|
909
|
+
return this;
|
|
910
|
+
}
|
|
911
|
+
data = this.__data__ = new _MapCache(pairs);
|
|
912
|
+
}
|
|
913
|
+
data.set(key, value);
|
|
914
|
+
this.size = data.size;
|
|
915
|
+
return this;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
var _stackSet = stackSet;
|
|
1023
919
|
|
|
1024
920
|
/**
|
|
1025
|
-
*
|
|
921
|
+
* Creates a stack cache object to store key-value pairs.
|
|
1026
922
|
*
|
|
1027
923
|
* @private
|
|
1028
|
-
* @
|
|
1029
|
-
* @
|
|
924
|
+
* @constructor
|
|
925
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
1030
926
|
*/
|
|
1031
|
-
function
|
|
1032
|
-
this.
|
|
1033
|
-
this.
|
|
1034
|
-
'hash': new _Hash,
|
|
1035
|
-
'map': new (_Map || _ListCache),
|
|
1036
|
-
'string': new _Hash
|
|
1037
|
-
};
|
|
927
|
+
function Stack(entries) {
|
|
928
|
+
var data = this.__data__ = new _ListCache(entries);
|
|
929
|
+
this.size = data.size;
|
|
1038
930
|
}
|
|
1039
931
|
|
|
1040
|
-
|
|
932
|
+
// Add methods to `Stack`.
|
|
933
|
+
Stack.prototype.clear = _stackClear;
|
|
934
|
+
Stack.prototype['delete'] = _stackDelete;
|
|
935
|
+
Stack.prototype.get = _stackGet;
|
|
936
|
+
Stack.prototype.has = _stackHas;
|
|
937
|
+
Stack.prototype.set = _stackSet;
|
|
938
|
+
|
|
939
|
+
var _Stack = Stack;
|
|
940
|
+
|
|
941
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
942
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
1041
943
|
|
|
1042
944
|
/**
|
|
1043
|
-
*
|
|
945
|
+
* Adds `value` to the array cache.
|
|
1044
946
|
*
|
|
1045
947
|
* @private
|
|
1046
|
-
* @
|
|
1047
|
-
* @
|
|
948
|
+
* @name add
|
|
949
|
+
* @memberOf SetCache
|
|
950
|
+
* @alias push
|
|
951
|
+
* @param {*} value The value to cache.
|
|
952
|
+
* @returns {Object} Returns the cache instance.
|
|
1048
953
|
*/
|
|
1049
|
-
function
|
|
1050
|
-
|
|
1051
|
-
return
|
|
1052
|
-
? (value !== '__proto__')
|
|
1053
|
-
: (value === null);
|
|
954
|
+
function setCacheAdd(value) {
|
|
955
|
+
this.__data__.set(value, HASH_UNDEFINED);
|
|
956
|
+
return this;
|
|
1054
957
|
}
|
|
1055
958
|
|
|
1056
|
-
var
|
|
959
|
+
var _setCacheAdd = setCacheAdd;
|
|
1057
960
|
|
|
1058
961
|
/**
|
|
1059
|
-
*
|
|
962
|
+
* Checks if `value` is in the array cache.
|
|
1060
963
|
*
|
|
1061
964
|
* @private
|
|
1062
|
-
* @
|
|
1063
|
-
* @
|
|
1064
|
-
* @
|
|
965
|
+
* @name has
|
|
966
|
+
* @memberOf SetCache
|
|
967
|
+
* @param {*} value The value to search for.
|
|
968
|
+
* @returns {number} Returns `true` if `value` is found, else `false`.
|
|
1065
969
|
*/
|
|
1066
|
-
function
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
970
|
+
function setCacheHas(value) {
|
|
971
|
+
return this.__data__.has(value);
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
var _setCacheHas = setCacheHas;
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
*
|
|
978
|
+
* Creates an array cache object to store unique values.
|
|
979
|
+
*
|
|
980
|
+
* @private
|
|
981
|
+
* @constructor
|
|
982
|
+
* @param {Array} [values] The values to cache.
|
|
983
|
+
*/
|
|
984
|
+
function SetCache(values) {
|
|
985
|
+
var index = -1,
|
|
986
|
+
length = values == null ? 0 : values.length;
|
|
987
|
+
|
|
988
|
+
this.__data__ = new _MapCache;
|
|
989
|
+
while (++index < length) {
|
|
990
|
+
this.add(values[index]);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
// Add methods to `SetCache`.
|
|
995
|
+
SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd;
|
|
996
|
+
SetCache.prototype.has = _setCacheHas;
|
|
997
|
+
|
|
998
|
+
var _SetCache = SetCache;
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* A specialized version of `_.some` for arrays without support for iteratee
|
|
1002
|
+
* shorthands.
|
|
1003
|
+
*
|
|
1004
|
+
* @private
|
|
1005
|
+
* @param {Array} [array] The array to iterate over.
|
|
1006
|
+
* @param {Function} predicate The function invoked per iteration.
|
|
1007
|
+
* @returns {boolean} Returns `true` if any element passes the predicate check,
|
|
1008
|
+
* else `false`.
|
|
1009
|
+
*/
|
|
1010
|
+
function arraySome(array, predicate) {
|
|
1011
|
+
var index = -1,
|
|
1012
|
+
length = array == null ? 0 : array.length;
|
|
1013
|
+
|
|
1014
|
+
while (++index < length) {
|
|
1015
|
+
if (predicate(array[index], index, array)) {
|
|
1016
|
+
return true;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
return false;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
var _arraySome = arraySome;
|
|
1023
|
+
|
|
1024
|
+
/**
|
|
1025
|
+
* Checks if a `cache` value for `key` exists.
|
|
1026
|
+
*
|
|
1027
|
+
* @private
|
|
1028
|
+
* @param {Object} cache The cache to query.
|
|
1029
|
+
* @param {string} key The key of the entry to check.
|
|
1030
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1031
|
+
*/
|
|
1032
|
+
function cacheHas(cache, key) {
|
|
1033
|
+
return cache.has(key);
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
var _cacheHas = cacheHas;
|
|
1037
|
+
|
|
1038
|
+
/** Used to compose bitmasks for value comparisons. */
|
|
1039
|
+
var COMPARE_PARTIAL_FLAG$3 = 1,
|
|
1040
|
+
COMPARE_UNORDERED_FLAG$1 = 2;
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* A specialized version of `baseIsEqualDeep` for arrays with support for
|
|
1044
|
+
* partial deep comparisons.
|
|
1045
|
+
*
|
|
1046
|
+
* @private
|
|
1047
|
+
* @param {Array} array The array to compare.
|
|
1048
|
+
* @param {Array} other The other array to compare.
|
|
1049
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
1050
|
+
* @param {Function} customizer The function to customize comparisons.
|
|
1051
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
1052
|
+
* @param {Object} stack Tracks traversed `array` and `other` objects.
|
|
1053
|
+
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
|
1054
|
+
*/
|
|
1055
|
+
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
1056
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
|
|
1057
|
+
arrLength = array.length,
|
|
1058
|
+
othLength = other.length;
|
|
1059
|
+
|
|
1060
|
+
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
1061
|
+
return false;
|
|
1062
|
+
}
|
|
1063
|
+
// Check that cyclic values are equal.
|
|
1064
|
+
var arrStacked = stack.get(array);
|
|
1065
|
+
var othStacked = stack.get(other);
|
|
1066
|
+
if (arrStacked && othStacked) {
|
|
1067
|
+
return arrStacked == other && othStacked == array;
|
|
1068
|
+
}
|
|
1069
|
+
var index = -1,
|
|
1070
|
+
result = true,
|
|
1071
|
+
seen = (bitmask & COMPARE_UNORDERED_FLAG$1) ? new _SetCache : undefined;
|
|
1072
|
+
|
|
1073
|
+
stack.set(array, other);
|
|
1074
|
+
stack.set(other, array);
|
|
1075
|
+
|
|
1076
|
+
// Ignore non-index properties.
|
|
1077
|
+
while (++index < arrLength) {
|
|
1078
|
+
var arrValue = array[index],
|
|
1079
|
+
othValue = other[index];
|
|
1080
|
+
|
|
1081
|
+
if (customizer) {
|
|
1082
|
+
var compared = isPartial
|
|
1083
|
+
? customizer(othValue, arrValue, index, other, array, stack)
|
|
1084
|
+
: customizer(arrValue, othValue, index, array, other, stack);
|
|
1085
|
+
}
|
|
1086
|
+
if (compared !== undefined) {
|
|
1087
|
+
if (compared) {
|
|
1088
|
+
continue;
|
|
1089
|
+
}
|
|
1090
|
+
result = false;
|
|
1091
|
+
break;
|
|
1092
|
+
}
|
|
1093
|
+
// Recursively compare arrays (susceptible to call stack limits).
|
|
1094
|
+
if (seen) {
|
|
1095
|
+
if (!_arraySome(other, function(othValue, othIndex) {
|
|
1096
|
+
if (!_cacheHas(seen, othIndex) &&
|
|
1097
|
+
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
1098
|
+
return seen.push(othIndex);
|
|
1099
|
+
}
|
|
1100
|
+
})) {
|
|
1101
|
+
result = false;
|
|
1102
|
+
break;
|
|
1103
|
+
}
|
|
1104
|
+
} else if (!(
|
|
1105
|
+
arrValue === othValue ||
|
|
1106
|
+
equalFunc(arrValue, othValue, bitmask, customizer, stack)
|
|
1107
|
+
)) {
|
|
1108
|
+
result = false;
|
|
1109
|
+
break;
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
stack['delete'](array);
|
|
1113
|
+
stack['delete'](other);
|
|
1114
|
+
return result;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
var _equalArrays = equalArrays;
|
|
1118
|
+
|
|
1119
|
+
/** Built-in value references. */
|
|
1120
|
+
var Uint8Array = _root.Uint8Array;
|
|
1121
|
+
|
|
1122
|
+
var _Uint8Array = Uint8Array;
|
|
1123
|
+
|
|
1124
|
+
/**
|
|
1125
|
+
* Converts `map` to its key-value pairs.
|
|
1126
|
+
*
|
|
1127
|
+
* @private
|
|
1128
|
+
* @param {Object} map The map to convert.
|
|
1129
|
+
* @returns {Array} Returns the key-value pairs.
|
|
1130
|
+
*/
|
|
1131
|
+
function mapToArray(map) {
|
|
1132
|
+
var index = -1,
|
|
1133
|
+
result = Array(map.size);
|
|
1134
|
+
|
|
1135
|
+
map.forEach(function(value, key) {
|
|
1136
|
+
result[++index] = [key, value];
|
|
1137
|
+
});
|
|
1138
|
+
return result;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
var _mapToArray = mapToArray;
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* Converts `set` to an array of its values.
|
|
1145
|
+
*
|
|
1146
|
+
* @private
|
|
1147
|
+
* @param {Object} set The set to convert.
|
|
1148
|
+
* @returns {Array} Returns the values.
|
|
1149
|
+
*/
|
|
1150
|
+
function setToArray(set) {
|
|
1151
|
+
var index = -1,
|
|
1152
|
+
result = Array(set.size);
|
|
1153
|
+
|
|
1154
|
+
set.forEach(function(value) {
|
|
1155
|
+
result[++index] = value;
|
|
1156
|
+
});
|
|
1157
|
+
return result;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
var _setToArray = setToArray;
|
|
1161
|
+
|
|
1162
|
+
/** Used to compose bitmasks for value comparisons. */
|
|
1163
|
+
var COMPARE_PARTIAL_FLAG$2 = 1,
|
|
1164
|
+
COMPARE_UNORDERED_FLAG = 2;
|
|
1165
|
+
|
|
1166
|
+
/** `Object#toString` result references. */
|
|
1167
|
+
var boolTag$1 = '[object Boolean]',
|
|
1168
|
+
dateTag$1 = '[object Date]',
|
|
1169
|
+
errorTag$1 = '[object Error]',
|
|
1170
|
+
mapTag$2 = '[object Map]',
|
|
1171
|
+
numberTag$1 = '[object Number]',
|
|
1172
|
+
regexpTag$1 = '[object RegExp]',
|
|
1173
|
+
setTag$2 = '[object Set]',
|
|
1174
|
+
stringTag$1 = '[object String]',
|
|
1175
|
+
symbolTag$1 = '[object Symbol]';
|
|
1176
|
+
|
|
1177
|
+
var arrayBufferTag$1 = '[object ArrayBuffer]',
|
|
1178
|
+
dataViewTag$2 = '[object DataView]';
|
|
1179
|
+
|
|
1180
|
+
/** Used to convert symbols to primitives and strings. */
|
|
1181
|
+
var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,
|
|
1182
|
+
symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* A specialized version of `baseIsEqualDeep` for comparing objects of
|
|
1186
|
+
* the same `toStringTag`.
|
|
1187
|
+
*
|
|
1188
|
+
* **Note:** This function only supports comparing values with tags of
|
|
1189
|
+
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
|
|
1190
|
+
*
|
|
1191
|
+
* @private
|
|
1192
|
+
* @param {Object} object The object to compare.
|
|
1193
|
+
* @param {Object} other The other object to compare.
|
|
1194
|
+
* @param {string} tag The `toStringTag` of the objects to compare.
|
|
1195
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
1196
|
+
* @param {Function} customizer The function to customize comparisons.
|
|
1197
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
1198
|
+
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
1199
|
+
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
1200
|
+
*/
|
|
1201
|
+
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
1202
|
+
switch (tag) {
|
|
1203
|
+
case dataViewTag$2:
|
|
1204
|
+
if ((object.byteLength != other.byteLength) ||
|
|
1205
|
+
(object.byteOffset != other.byteOffset)) {
|
|
1206
|
+
return false;
|
|
1207
|
+
}
|
|
1208
|
+
object = object.buffer;
|
|
1209
|
+
other = other.buffer;
|
|
1210
|
+
|
|
1211
|
+
case arrayBufferTag$1:
|
|
1212
|
+
if ((object.byteLength != other.byteLength) ||
|
|
1213
|
+
!equalFunc(new _Uint8Array(object), new _Uint8Array(other))) {
|
|
1214
|
+
return false;
|
|
1215
|
+
}
|
|
1216
|
+
return true;
|
|
1217
|
+
|
|
1218
|
+
case boolTag$1:
|
|
1219
|
+
case dateTag$1:
|
|
1220
|
+
case numberTag$1:
|
|
1221
|
+
// Coerce booleans to `1` or `0` and dates to milliseconds.
|
|
1222
|
+
// Invalid dates are coerced to `NaN`.
|
|
1223
|
+
return eq_1(+object, +other);
|
|
1224
|
+
|
|
1225
|
+
case errorTag$1:
|
|
1226
|
+
return object.name == other.name && object.message == other.message;
|
|
1227
|
+
|
|
1228
|
+
case regexpTag$1:
|
|
1229
|
+
case stringTag$1:
|
|
1230
|
+
// Coerce regexes to strings and treat strings, primitives and objects,
|
|
1231
|
+
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
|
|
1232
|
+
// for more details.
|
|
1233
|
+
return object == (other + '');
|
|
1234
|
+
|
|
1235
|
+
case mapTag$2:
|
|
1236
|
+
var convert = _mapToArray;
|
|
1237
|
+
|
|
1238
|
+
case setTag$2:
|
|
1239
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
|
|
1240
|
+
convert || (convert = _setToArray);
|
|
1241
|
+
|
|
1242
|
+
if (object.size != other.size && !isPartial) {
|
|
1243
|
+
return false;
|
|
1244
|
+
}
|
|
1245
|
+
// Assume cyclic values are equal.
|
|
1246
|
+
var stacked = stack.get(object);
|
|
1247
|
+
if (stacked) {
|
|
1248
|
+
return stacked == other;
|
|
1249
|
+
}
|
|
1250
|
+
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
1251
|
+
|
|
1252
|
+
// Recursively compare objects (susceptible to call stack limits).
|
|
1253
|
+
stack.set(object, other);
|
|
1254
|
+
var result = _equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
1255
|
+
stack['delete'](object);
|
|
1256
|
+
return result;
|
|
1257
|
+
|
|
1258
|
+
case symbolTag$1:
|
|
1259
|
+
if (symbolValueOf) {
|
|
1260
|
+
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
return false;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
var _equalByTag = equalByTag;
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* Appends the elements of `values` to `array`.
|
|
1270
|
+
*
|
|
1271
|
+
* @private
|
|
1272
|
+
* @param {Array} array The array to modify.
|
|
1273
|
+
* @param {Array} values The values to append.
|
|
1274
|
+
* @returns {Array} Returns `array`.
|
|
1275
|
+
*/
|
|
1276
|
+
function arrayPush(array, values) {
|
|
1277
|
+
var index = -1,
|
|
1278
|
+
length = values.length,
|
|
1279
|
+
offset = array.length;
|
|
1280
|
+
|
|
1281
|
+
while (++index < length) {
|
|
1282
|
+
array[offset + index] = values[index];
|
|
1283
|
+
}
|
|
1284
|
+
return array;
|
|
1071
1285
|
}
|
|
1072
1286
|
|
|
1073
|
-
var
|
|
1287
|
+
var _arrayPush = arrayPush;
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* Checks if `value` is classified as an `Array` object.
|
|
1291
|
+
*
|
|
1292
|
+
* @static
|
|
1293
|
+
* @memberOf _
|
|
1294
|
+
* @since 0.1.0
|
|
1295
|
+
* @category Lang
|
|
1296
|
+
* @param {*} value The value to check.
|
|
1297
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
1298
|
+
* @example
|
|
1299
|
+
*
|
|
1300
|
+
* _.isArray([1, 2, 3]);
|
|
1301
|
+
* // => true
|
|
1302
|
+
*
|
|
1303
|
+
* _.isArray(document.body.children);
|
|
1304
|
+
* // => false
|
|
1305
|
+
*
|
|
1306
|
+
* _.isArray('abc');
|
|
1307
|
+
* // => false
|
|
1308
|
+
*
|
|
1309
|
+
* _.isArray(_.noop);
|
|
1310
|
+
* // => false
|
|
1311
|
+
*/
|
|
1312
|
+
var isArray = Array.isArray;
|
|
1313
|
+
|
|
1314
|
+
var isArray_1 = isArray;
|
|
1315
|
+
|
|
1316
|
+
/**
|
|
1317
|
+
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
|
1318
|
+
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
|
|
1319
|
+
* symbols of `object`.
|
|
1320
|
+
*
|
|
1321
|
+
* @private
|
|
1322
|
+
* @param {Object} object The object to query.
|
|
1323
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
1324
|
+
* @param {Function} symbolsFunc The function to get the symbols of `object`.
|
|
1325
|
+
* @returns {Array} Returns the array of property names and symbols.
|
|
1326
|
+
*/
|
|
1327
|
+
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
1328
|
+
var result = keysFunc(object);
|
|
1329
|
+
return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object));
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
var _baseGetAllKeys = baseGetAllKeys;
|
|
1333
|
+
|
|
1334
|
+
/**
|
|
1335
|
+
* A specialized version of `_.filter` for arrays without support for
|
|
1336
|
+
* iteratee shorthands.
|
|
1337
|
+
*
|
|
1338
|
+
* @private
|
|
1339
|
+
* @param {Array} [array] The array to iterate over.
|
|
1340
|
+
* @param {Function} predicate The function invoked per iteration.
|
|
1341
|
+
* @returns {Array} Returns the new filtered array.
|
|
1342
|
+
*/
|
|
1343
|
+
function arrayFilter(array, predicate) {
|
|
1344
|
+
var index = -1,
|
|
1345
|
+
length = array == null ? 0 : array.length,
|
|
1346
|
+
resIndex = 0,
|
|
1347
|
+
result = [];
|
|
1348
|
+
|
|
1349
|
+
while (++index < length) {
|
|
1350
|
+
var value = array[index];
|
|
1351
|
+
if (predicate(value, index, array)) {
|
|
1352
|
+
result[resIndex++] = value;
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
return result;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
var _arrayFilter = arrayFilter;
|
|
1359
|
+
|
|
1360
|
+
/**
|
|
1361
|
+
* This method returns a new empty array.
|
|
1362
|
+
*
|
|
1363
|
+
* @static
|
|
1364
|
+
* @memberOf _
|
|
1365
|
+
* @since 4.13.0
|
|
1366
|
+
* @category Util
|
|
1367
|
+
* @returns {Array} Returns the new empty array.
|
|
1368
|
+
* @example
|
|
1369
|
+
*
|
|
1370
|
+
* var arrays = _.times(2, _.stubArray);
|
|
1371
|
+
*
|
|
1372
|
+
* console.log(arrays);
|
|
1373
|
+
* // => [[], []]
|
|
1374
|
+
*
|
|
1375
|
+
* console.log(arrays[0] === arrays[1]);
|
|
1376
|
+
* // => false
|
|
1377
|
+
*/
|
|
1378
|
+
function stubArray() {
|
|
1379
|
+
return [];
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
var stubArray_1 = stubArray;
|
|
1383
|
+
|
|
1384
|
+
/** Used for built-in method references. */
|
|
1385
|
+
var objectProto$9 = Object.prototype;
|
|
1386
|
+
|
|
1387
|
+
/** Built-in value references. */
|
|
1388
|
+
var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
|
|
1389
|
+
|
|
1390
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1391
|
+
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
1392
|
+
|
|
1393
|
+
/**
|
|
1394
|
+
* Creates an array of the own enumerable symbols of `object`.
|
|
1395
|
+
*
|
|
1396
|
+
* @private
|
|
1397
|
+
* @param {Object} object The object to query.
|
|
1398
|
+
* @returns {Array} Returns the array of symbols.
|
|
1399
|
+
*/
|
|
1400
|
+
var getSymbols = !nativeGetSymbols ? stubArray_1 : function(object) {
|
|
1401
|
+
if (object == null) {
|
|
1402
|
+
return [];
|
|
1403
|
+
}
|
|
1404
|
+
object = Object(object);
|
|
1405
|
+
return _arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
1406
|
+
return propertyIsEnumerable$1.call(object, symbol);
|
|
1407
|
+
});
|
|
1408
|
+
};
|
|
1409
|
+
|
|
1410
|
+
var _getSymbols = getSymbols;
|
|
1411
|
+
|
|
1412
|
+
/**
|
|
1413
|
+
* The base implementation of `_.times` without support for iteratee shorthands
|
|
1414
|
+
* or max array length checks.
|
|
1415
|
+
*
|
|
1416
|
+
* @private
|
|
1417
|
+
* @param {number} n The number of times to invoke `iteratee`.
|
|
1418
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
1419
|
+
* @returns {Array} Returns the array of results.
|
|
1420
|
+
*/
|
|
1421
|
+
function baseTimes(n, iteratee) {
|
|
1422
|
+
var index = -1,
|
|
1423
|
+
result = Array(n);
|
|
1424
|
+
|
|
1425
|
+
while (++index < n) {
|
|
1426
|
+
result[index] = iteratee(index);
|
|
1427
|
+
}
|
|
1428
|
+
return result;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
var _baseTimes = baseTimes;
|
|
1432
|
+
|
|
1433
|
+
/**
|
|
1434
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
1435
|
+
* and has a `typeof` result of "object".
|
|
1436
|
+
*
|
|
1437
|
+
* @static
|
|
1438
|
+
* @memberOf _
|
|
1439
|
+
* @since 4.0.0
|
|
1440
|
+
* @category Lang
|
|
1441
|
+
* @param {*} value The value to check.
|
|
1442
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
1443
|
+
* @example
|
|
1444
|
+
*
|
|
1445
|
+
* _.isObjectLike({});
|
|
1446
|
+
* // => true
|
|
1447
|
+
*
|
|
1448
|
+
* _.isObjectLike([1, 2, 3]);
|
|
1449
|
+
* // => true
|
|
1450
|
+
*
|
|
1451
|
+
* _.isObjectLike(_.noop);
|
|
1452
|
+
* // => false
|
|
1453
|
+
*
|
|
1454
|
+
* _.isObjectLike(null);
|
|
1455
|
+
* // => false
|
|
1456
|
+
*/
|
|
1457
|
+
function isObjectLike(value) {
|
|
1458
|
+
return value != null && typeof value == 'object';
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
var isObjectLike_1 = isObjectLike;
|
|
1462
|
+
|
|
1463
|
+
/** `Object#toString` result references. */
|
|
1464
|
+
var argsTag$2 = '[object Arguments]';
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* The base implementation of `_.isArguments`.
|
|
1468
|
+
*
|
|
1469
|
+
* @private
|
|
1470
|
+
* @param {*} value The value to check.
|
|
1471
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
1472
|
+
*/
|
|
1473
|
+
function baseIsArguments(value) {
|
|
1474
|
+
return isObjectLike_1(value) && _baseGetTag(value) == argsTag$2;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
var _baseIsArguments = baseIsArguments;
|
|
1478
|
+
|
|
1479
|
+
/** Used for built-in method references. */
|
|
1480
|
+
var objectProto$8 = Object.prototype;
|
|
1481
|
+
|
|
1482
|
+
/** Used to check objects for own properties. */
|
|
1483
|
+
var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
|
|
1484
|
+
|
|
1485
|
+
/** Built-in value references. */
|
|
1486
|
+
var propertyIsEnumerable = objectProto$8.propertyIsEnumerable;
|
|
1487
|
+
|
|
1488
|
+
/**
|
|
1489
|
+
* Checks if `value` is likely an `arguments` object.
|
|
1490
|
+
*
|
|
1491
|
+
* @static
|
|
1492
|
+
* @memberOf _
|
|
1493
|
+
* @since 0.1.0
|
|
1494
|
+
* @category Lang
|
|
1495
|
+
* @param {*} value The value to check.
|
|
1496
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
1497
|
+
* else `false`.
|
|
1498
|
+
* @example
|
|
1499
|
+
*
|
|
1500
|
+
* _.isArguments(function() { return arguments; }());
|
|
1501
|
+
* // => true
|
|
1502
|
+
*
|
|
1503
|
+
* _.isArguments([1, 2, 3]);
|
|
1504
|
+
* // => false
|
|
1505
|
+
*/
|
|
1506
|
+
var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
|
|
1507
|
+
return isObjectLike_1(value) && hasOwnProperty$7.call(value, 'callee') &&
|
|
1508
|
+
!propertyIsEnumerable.call(value, 'callee');
|
|
1509
|
+
};
|
|
1510
|
+
|
|
1511
|
+
var isArguments_1 = isArguments;
|
|
1512
|
+
|
|
1513
|
+
/**
|
|
1514
|
+
* This method returns `false`.
|
|
1515
|
+
*
|
|
1516
|
+
* @static
|
|
1517
|
+
* @memberOf _
|
|
1518
|
+
* @since 4.13.0
|
|
1519
|
+
* @category Util
|
|
1520
|
+
* @returns {boolean} Returns `false`.
|
|
1521
|
+
* @example
|
|
1522
|
+
*
|
|
1523
|
+
* _.times(2, _.stubFalse);
|
|
1524
|
+
* // => [false, false]
|
|
1525
|
+
*/
|
|
1526
|
+
function stubFalse() {
|
|
1527
|
+
return false;
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
var stubFalse_1 = stubFalse;
|
|
1531
|
+
|
|
1532
|
+
var isBuffer_1 = createCommonjsModule(function (module, exports) {
|
|
1533
|
+
/** Detect free variable `exports`. */
|
|
1534
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
1535
|
+
|
|
1536
|
+
/** Detect free variable `module`. */
|
|
1537
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
1538
|
+
|
|
1539
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
1540
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
1541
|
+
|
|
1542
|
+
/** Built-in value references. */
|
|
1543
|
+
var Buffer = moduleExports ? _root.Buffer : undefined;
|
|
1544
|
+
|
|
1545
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1546
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
1547
|
+
|
|
1548
|
+
/**
|
|
1549
|
+
* Checks if `value` is a buffer.
|
|
1550
|
+
*
|
|
1551
|
+
* @static
|
|
1552
|
+
* @memberOf _
|
|
1553
|
+
* @since 4.3.0
|
|
1554
|
+
* @category Lang
|
|
1555
|
+
* @param {*} value The value to check.
|
|
1556
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
1557
|
+
* @example
|
|
1558
|
+
*
|
|
1559
|
+
* _.isBuffer(new Buffer(2));
|
|
1560
|
+
* // => true
|
|
1561
|
+
*
|
|
1562
|
+
* _.isBuffer(new Uint8Array(2));
|
|
1563
|
+
* // => false
|
|
1564
|
+
*/
|
|
1565
|
+
var isBuffer = nativeIsBuffer || stubFalse_1;
|
|
1566
|
+
|
|
1567
|
+
module.exports = isBuffer;
|
|
1568
|
+
});
|
|
1569
|
+
|
|
1570
|
+
/** Used as references for various `Number` constants. */
|
|
1571
|
+
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
1572
|
+
|
|
1573
|
+
/** Used to detect unsigned integer values. */
|
|
1574
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
1575
|
+
|
|
1576
|
+
/**
|
|
1577
|
+
* Checks if `value` is a valid array-like index.
|
|
1578
|
+
*
|
|
1579
|
+
* @private
|
|
1580
|
+
* @param {*} value The value to check.
|
|
1581
|
+
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
1582
|
+
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
1583
|
+
*/
|
|
1584
|
+
function isIndex(value, length) {
|
|
1585
|
+
var type = typeof value;
|
|
1586
|
+
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
|
1587
|
+
|
|
1588
|
+
return !!length &&
|
|
1589
|
+
(type == 'number' ||
|
|
1590
|
+
(type != 'symbol' && reIsUint.test(value))) &&
|
|
1591
|
+
(value > -1 && value % 1 == 0 && value < length);
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
var _isIndex = isIndex;
|
|
1595
|
+
|
|
1596
|
+
/** Used as references for various `Number` constants. */
|
|
1597
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Checks if `value` is a valid array-like length.
|
|
1601
|
+
*
|
|
1602
|
+
* **Note:** This method is loosely based on
|
|
1603
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
1604
|
+
*
|
|
1605
|
+
* @static
|
|
1606
|
+
* @memberOf _
|
|
1607
|
+
* @since 4.0.0
|
|
1608
|
+
* @category Lang
|
|
1609
|
+
* @param {*} value The value to check.
|
|
1610
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
1611
|
+
* @example
|
|
1612
|
+
*
|
|
1613
|
+
* _.isLength(3);
|
|
1614
|
+
* // => true
|
|
1615
|
+
*
|
|
1616
|
+
* _.isLength(Number.MIN_VALUE);
|
|
1617
|
+
* // => false
|
|
1618
|
+
*
|
|
1619
|
+
* _.isLength(Infinity);
|
|
1620
|
+
* // => false
|
|
1621
|
+
*
|
|
1622
|
+
* _.isLength('3');
|
|
1623
|
+
* // => false
|
|
1624
|
+
*/
|
|
1625
|
+
function isLength(value) {
|
|
1626
|
+
return typeof value == 'number' &&
|
|
1627
|
+
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
var isLength_1 = isLength;
|
|
1631
|
+
|
|
1632
|
+
/** `Object#toString` result references. */
|
|
1633
|
+
var argsTag$1 = '[object Arguments]',
|
|
1634
|
+
arrayTag$1 = '[object Array]',
|
|
1635
|
+
boolTag = '[object Boolean]',
|
|
1636
|
+
dateTag = '[object Date]',
|
|
1637
|
+
errorTag = '[object Error]',
|
|
1638
|
+
funcTag = '[object Function]',
|
|
1639
|
+
mapTag$1 = '[object Map]',
|
|
1640
|
+
numberTag = '[object Number]',
|
|
1641
|
+
objectTag$3 = '[object Object]',
|
|
1642
|
+
regexpTag = '[object RegExp]',
|
|
1643
|
+
setTag$1 = '[object Set]',
|
|
1644
|
+
stringTag = '[object String]',
|
|
1645
|
+
weakMapTag$1 = '[object WeakMap]';
|
|
1646
|
+
|
|
1647
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
|
1648
|
+
dataViewTag$1 = '[object DataView]',
|
|
1649
|
+
float32Tag = '[object Float32Array]',
|
|
1650
|
+
float64Tag = '[object Float64Array]',
|
|
1651
|
+
int8Tag = '[object Int8Array]',
|
|
1652
|
+
int16Tag = '[object Int16Array]',
|
|
1653
|
+
int32Tag = '[object Int32Array]',
|
|
1654
|
+
uint8Tag = '[object Uint8Array]',
|
|
1655
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
1656
|
+
uint16Tag = '[object Uint16Array]',
|
|
1657
|
+
uint32Tag = '[object Uint32Array]';
|
|
1658
|
+
|
|
1659
|
+
/** Used to identify `toStringTag` values of typed arrays. */
|
|
1660
|
+
var typedArrayTags = {};
|
|
1661
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
|
1662
|
+
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
|
1663
|
+
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
|
1664
|
+
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
|
1665
|
+
typedArrayTags[uint32Tag] = true;
|
|
1666
|
+
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
|
|
1667
|
+
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
|
1668
|
+
typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] =
|
|
1669
|
+
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
|
1670
|
+
typedArrayTags[mapTag$1] = typedArrayTags[numberTag] =
|
|
1671
|
+
typedArrayTags[objectTag$3] = typedArrayTags[regexpTag] =
|
|
1672
|
+
typedArrayTags[setTag$1] = typedArrayTags[stringTag] =
|
|
1673
|
+
typedArrayTags[weakMapTag$1] = false;
|
|
1674
|
+
|
|
1675
|
+
/**
|
|
1676
|
+
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
1677
|
+
*
|
|
1678
|
+
* @private
|
|
1679
|
+
* @param {*} value The value to check.
|
|
1680
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
1681
|
+
*/
|
|
1682
|
+
function baseIsTypedArray(value) {
|
|
1683
|
+
return isObjectLike_1(value) &&
|
|
1684
|
+
isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
var _baseIsTypedArray = baseIsTypedArray;
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
|
1691
|
+
*
|
|
1692
|
+
* @private
|
|
1693
|
+
* @param {Function} func The function to cap arguments for.
|
|
1694
|
+
* @returns {Function} Returns the new capped function.
|
|
1695
|
+
*/
|
|
1696
|
+
function baseUnary(func) {
|
|
1697
|
+
return function(value) {
|
|
1698
|
+
return func(value);
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
var _baseUnary = baseUnary;
|
|
1703
|
+
|
|
1704
|
+
var _nodeUtil = createCommonjsModule(function (module, exports) {
|
|
1705
|
+
/** Detect free variable `exports`. */
|
|
1706
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
1707
|
+
|
|
1708
|
+
/** Detect free variable `module`. */
|
|
1709
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
1710
|
+
|
|
1711
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
1712
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
1713
|
+
|
|
1714
|
+
/** Detect free variable `process` from Node.js. */
|
|
1715
|
+
var freeProcess = moduleExports && _freeGlobal.process;
|
|
1716
|
+
|
|
1717
|
+
/** Used to access faster Node.js helpers. */
|
|
1718
|
+
var nodeUtil = (function() {
|
|
1719
|
+
try {
|
|
1720
|
+
// Use `util.types` for Node.js 10+.
|
|
1721
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
1722
|
+
|
|
1723
|
+
if (types) {
|
|
1724
|
+
return types;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
// Legacy `process.binding('util')` for Node.js < 10.
|
|
1728
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
1729
|
+
} catch (e) {}
|
|
1730
|
+
}());
|
|
1731
|
+
|
|
1732
|
+
module.exports = nodeUtil;
|
|
1733
|
+
});
|
|
1734
|
+
|
|
1735
|
+
/* Node.js helper references. */
|
|
1736
|
+
var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
|
|
1737
|
+
|
|
1738
|
+
/**
|
|
1739
|
+
* Checks if `value` is classified as a typed array.
|
|
1740
|
+
*
|
|
1741
|
+
* @static
|
|
1742
|
+
* @memberOf _
|
|
1743
|
+
* @since 3.0.0
|
|
1744
|
+
* @category Lang
|
|
1745
|
+
* @param {*} value The value to check.
|
|
1746
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
1747
|
+
* @example
|
|
1748
|
+
*
|
|
1749
|
+
* _.isTypedArray(new Uint8Array);
|
|
1750
|
+
* // => true
|
|
1751
|
+
*
|
|
1752
|
+
* _.isTypedArray([]);
|
|
1753
|
+
* // => false
|
|
1754
|
+
*/
|
|
1755
|
+
var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
|
|
1756
|
+
|
|
1757
|
+
var isTypedArray_1 = isTypedArray;
|
|
1758
|
+
|
|
1759
|
+
/** Used for built-in method references. */
|
|
1760
|
+
var objectProto$7 = Object.prototype;
|
|
1761
|
+
|
|
1762
|
+
/** Used to check objects for own properties. */
|
|
1763
|
+
var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
|
|
1764
|
+
|
|
1765
|
+
/**
|
|
1766
|
+
* Creates an array of the enumerable property names of the array-like `value`.
|
|
1767
|
+
*
|
|
1768
|
+
* @private
|
|
1769
|
+
* @param {*} value The value to query.
|
|
1770
|
+
* @param {boolean} inherited Specify returning inherited property names.
|
|
1771
|
+
* @returns {Array} Returns the array of property names.
|
|
1772
|
+
*/
|
|
1773
|
+
function arrayLikeKeys(value, inherited) {
|
|
1774
|
+
var isArr = isArray_1(value),
|
|
1775
|
+
isArg = !isArr && isArguments_1(value),
|
|
1776
|
+
isBuff = !isArr && !isArg && isBuffer_1(value),
|
|
1777
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
|
|
1778
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
|
1779
|
+
result = skipIndexes ? _baseTimes(value.length, String) : [],
|
|
1780
|
+
length = result.length;
|
|
1781
|
+
|
|
1782
|
+
for (var key in value) {
|
|
1783
|
+
if ((inherited || hasOwnProperty$6.call(value, key)) &&
|
|
1784
|
+
!(skipIndexes && (
|
|
1785
|
+
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1786
|
+
key == 'length' ||
|
|
1787
|
+
// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1788
|
+
(isBuff && (key == 'offset' || key == 'parent')) ||
|
|
1789
|
+
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1790
|
+
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
|
1791
|
+
// Skip index properties.
|
|
1792
|
+
_isIndex(key, length)
|
|
1793
|
+
))) {
|
|
1794
|
+
result.push(key);
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
return result;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
var _arrayLikeKeys = arrayLikeKeys;
|
|
1801
|
+
|
|
1802
|
+
/** Used for built-in method references. */
|
|
1803
|
+
var objectProto$6 = Object.prototype;
|
|
1804
|
+
|
|
1805
|
+
/**
|
|
1806
|
+
* Checks if `value` is likely a prototype object.
|
|
1807
|
+
*
|
|
1808
|
+
* @private
|
|
1809
|
+
* @param {*} value The value to check.
|
|
1810
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
1811
|
+
*/
|
|
1812
|
+
function isPrototype(value) {
|
|
1813
|
+
var Ctor = value && value.constructor,
|
|
1814
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$6;
|
|
1815
|
+
|
|
1816
|
+
return value === proto;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
var _isPrototype = isPrototype;
|
|
1820
|
+
|
|
1821
|
+
/**
|
|
1822
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
|
1823
|
+
*
|
|
1824
|
+
* @private
|
|
1825
|
+
* @param {Function} func The function to wrap.
|
|
1826
|
+
* @param {Function} transform The argument transform.
|
|
1827
|
+
* @returns {Function} Returns the new function.
|
|
1828
|
+
*/
|
|
1829
|
+
function overArg(func, transform) {
|
|
1830
|
+
return function(arg) {
|
|
1831
|
+
return func(transform(arg));
|
|
1832
|
+
};
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
var _overArg = overArg;
|
|
1836
|
+
|
|
1837
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1838
|
+
var nativeKeys = _overArg(Object.keys, Object);
|
|
1839
|
+
|
|
1840
|
+
var _nativeKeys = nativeKeys;
|
|
1841
|
+
|
|
1842
|
+
/** Used for built-in method references. */
|
|
1843
|
+
var objectProto$5 = Object.prototype;
|
|
1844
|
+
|
|
1845
|
+
/** Used to check objects for own properties. */
|
|
1846
|
+
var hasOwnProperty$5 = objectProto$5.hasOwnProperty;
|
|
1847
|
+
|
|
1848
|
+
/**
|
|
1849
|
+
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
1850
|
+
*
|
|
1851
|
+
* @private
|
|
1852
|
+
* @param {Object} object The object to query.
|
|
1853
|
+
* @returns {Array} Returns the array of property names.
|
|
1854
|
+
*/
|
|
1855
|
+
function baseKeys(object) {
|
|
1856
|
+
if (!_isPrototype(object)) {
|
|
1857
|
+
return _nativeKeys(object);
|
|
1858
|
+
}
|
|
1859
|
+
var result = [];
|
|
1860
|
+
for (var key in Object(object)) {
|
|
1861
|
+
if (hasOwnProperty$5.call(object, key) && key != 'constructor') {
|
|
1862
|
+
result.push(key);
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
return result;
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
var _baseKeys = baseKeys;
|
|
1869
|
+
|
|
1870
|
+
/**
|
|
1871
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
1872
|
+
* not a function and has a `value.length` that's an integer greater than or
|
|
1873
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
1874
|
+
*
|
|
1875
|
+
* @static
|
|
1876
|
+
* @memberOf _
|
|
1877
|
+
* @since 4.0.0
|
|
1878
|
+
* @category Lang
|
|
1879
|
+
* @param {*} value The value to check.
|
|
1880
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
1881
|
+
* @example
|
|
1882
|
+
*
|
|
1883
|
+
* _.isArrayLike([1, 2, 3]);
|
|
1884
|
+
* // => true
|
|
1885
|
+
*
|
|
1886
|
+
* _.isArrayLike(document.body.children);
|
|
1887
|
+
* // => true
|
|
1888
|
+
*
|
|
1889
|
+
* _.isArrayLike('abc');
|
|
1890
|
+
* // => true
|
|
1891
|
+
*
|
|
1892
|
+
* _.isArrayLike(_.noop);
|
|
1893
|
+
* // => false
|
|
1894
|
+
*/
|
|
1895
|
+
function isArrayLike(value) {
|
|
1896
|
+
return value != null && isLength_1(value.length) && !isFunction_1(value);
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
var isArrayLike_1 = isArrayLike;
|
|
1900
|
+
|
|
1901
|
+
/**
|
|
1902
|
+
* Creates an array of the own enumerable property names of `object`.
|
|
1903
|
+
*
|
|
1904
|
+
* **Note:** Non-object values are coerced to objects. See the
|
|
1905
|
+
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
1906
|
+
* for more details.
|
|
1907
|
+
*
|
|
1908
|
+
* @static
|
|
1909
|
+
* @since 0.1.0
|
|
1910
|
+
* @memberOf _
|
|
1911
|
+
* @category Object
|
|
1912
|
+
* @param {Object} object The object to query.
|
|
1913
|
+
* @returns {Array} Returns the array of property names.
|
|
1914
|
+
* @example
|
|
1915
|
+
*
|
|
1916
|
+
* function Foo() {
|
|
1917
|
+
* this.a = 1;
|
|
1918
|
+
* this.b = 2;
|
|
1919
|
+
* }
|
|
1920
|
+
*
|
|
1921
|
+
* Foo.prototype.c = 3;
|
|
1922
|
+
*
|
|
1923
|
+
* _.keys(new Foo);
|
|
1924
|
+
* // => ['a', 'b'] (iteration order is not guaranteed)
|
|
1925
|
+
*
|
|
1926
|
+
* _.keys('hi');
|
|
1927
|
+
* // => ['0', '1']
|
|
1928
|
+
*/
|
|
1929
|
+
function keys(object) {
|
|
1930
|
+
return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
var keys_1 = keys;
|
|
1934
|
+
|
|
1935
|
+
/**
|
|
1936
|
+
* Creates an array of own enumerable property names and symbols of `object`.
|
|
1937
|
+
*
|
|
1938
|
+
* @private
|
|
1939
|
+
* @param {Object} object The object to query.
|
|
1940
|
+
* @returns {Array} Returns the array of property names and symbols.
|
|
1941
|
+
*/
|
|
1942
|
+
function getAllKeys(object) {
|
|
1943
|
+
return _baseGetAllKeys(object, keys_1, _getSymbols);
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
var _getAllKeys = getAllKeys;
|
|
1947
|
+
|
|
1948
|
+
/** Used to compose bitmasks for value comparisons. */
|
|
1949
|
+
var COMPARE_PARTIAL_FLAG$1 = 1;
|
|
1950
|
+
|
|
1951
|
+
/** Used for built-in method references. */
|
|
1952
|
+
var objectProto$4 = Object.prototype;
|
|
1953
|
+
|
|
1954
|
+
/** Used to check objects for own properties. */
|
|
1955
|
+
var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
|
|
1956
|
+
|
|
1957
|
+
/**
|
|
1958
|
+
* A specialized version of `baseIsEqualDeep` for objects with support for
|
|
1959
|
+
* partial deep comparisons.
|
|
1960
|
+
*
|
|
1961
|
+
* @private
|
|
1962
|
+
* @param {Object} object The object to compare.
|
|
1963
|
+
* @param {Object} other The other object to compare.
|
|
1964
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
1965
|
+
* @param {Function} customizer The function to customize comparisons.
|
|
1966
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
1967
|
+
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
1968
|
+
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
1969
|
+
*/
|
|
1970
|
+
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
1971
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1,
|
|
1972
|
+
objProps = _getAllKeys(object),
|
|
1973
|
+
objLength = objProps.length,
|
|
1974
|
+
othProps = _getAllKeys(other),
|
|
1975
|
+
othLength = othProps.length;
|
|
1976
|
+
|
|
1977
|
+
if (objLength != othLength && !isPartial) {
|
|
1978
|
+
return false;
|
|
1979
|
+
}
|
|
1980
|
+
var index = objLength;
|
|
1981
|
+
while (index--) {
|
|
1982
|
+
var key = objProps[index];
|
|
1983
|
+
if (!(isPartial ? key in other : hasOwnProperty$4.call(other, key))) {
|
|
1984
|
+
return false;
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
// Check that cyclic values are equal.
|
|
1988
|
+
var objStacked = stack.get(object);
|
|
1989
|
+
var othStacked = stack.get(other);
|
|
1990
|
+
if (objStacked && othStacked) {
|
|
1991
|
+
return objStacked == other && othStacked == object;
|
|
1992
|
+
}
|
|
1993
|
+
var result = true;
|
|
1994
|
+
stack.set(object, other);
|
|
1995
|
+
stack.set(other, object);
|
|
1996
|
+
|
|
1997
|
+
var skipCtor = isPartial;
|
|
1998
|
+
while (++index < objLength) {
|
|
1999
|
+
key = objProps[index];
|
|
2000
|
+
var objValue = object[key],
|
|
2001
|
+
othValue = other[key];
|
|
2002
|
+
|
|
2003
|
+
if (customizer) {
|
|
2004
|
+
var compared = isPartial
|
|
2005
|
+
? customizer(othValue, objValue, key, other, object, stack)
|
|
2006
|
+
: customizer(objValue, othValue, key, object, other, stack);
|
|
2007
|
+
}
|
|
2008
|
+
// Recursively compare objects (susceptible to call stack limits).
|
|
2009
|
+
if (!(compared === undefined
|
|
2010
|
+
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
|
|
2011
|
+
: compared
|
|
2012
|
+
)) {
|
|
2013
|
+
result = false;
|
|
2014
|
+
break;
|
|
2015
|
+
}
|
|
2016
|
+
skipCtor || (skipCtor = key == 'constructor');
|
|
2017
|
+
}
|
|
2018
|
+
if (result && !skipCtor) {
|
|
2019
|
+
var objCtor = object.constructor,
|
|
2020
|
+
othCtor = other.constructor;
|
|
2021
|
+
|
|
2022
|
+
// Non `Object` object instances with different constructors are not equal.
|
|
2023
|
+
if (objCtor != othCtor &&
|
|
2024
|
+
('constructor' in object && 'constructor' in other) &&
|
|
2025
|
+
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
|
|
2026
|
+
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
|
|
2027
|
+
result = false;
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
stack['delete'](object);
|
|
2031
|
+
stack['delete'](other);
|
|
2032
|
+
return result;
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
var _equalObjects = equalObjects;
|
|
2036
|
+
|
|
2037
|
+
/* Built-in method references that are verified to be native. */
|
|
2038
|
+
var DataView = _getNative(_root, 'DataView');
|
|
2039
|
+
|
|
2040
|
+
var _DataView = DataView;
|
|
2041
|
+
|
|
2042
|
+
/* Built-in method references that are verified to be native. */
|
|
2043
|
+
var Promise$1 = _getNative(_root, 'Promise');
|
|
2044
|
+
|
|
2045
|
+
var _Promise = Promise$1;
|
|
2046
|
+
|
|
2047
|
+
/* Built-in method references that are verified to be native. */
|
|
2048
|
+
var Set = _getNative(_root, 'Set');
|
|
2049
|
+
|
|
2050
|
+
var _Set = Set;
|
|
2051
|
+
|
|
2052
|
+
/* Built-in method references that are verified to be native. */
|
|
2053
|
+
var WeakMap = _getNative(_root, 'WeakMap');
|
|
2054
|
+
|
|
2055
|
+
var _WeakMap = WeakMap;
|
|
2056
|
+
|
|
2057
|
+
/** `Object#toString` result references. */
|
|
2058
|
+
var mapTag = '[object Map]',
|
|
2059
|
+
objectTag$2 = '[object Object]',
|
|
2060
|
+
promiseTag = '[object Promise]',
|
|
2061
|
+
setTag = '[object Set]',
|
|
2062
|
+
weakMapTag = '[object WeakMap]';
|
|
2063
|
+
|
|
2064
|
+
var dataViewTag = '[object DataView]';
|
|
2065
|
+
|
|
2066
|
+
/** Used to detect maps, sets, and weakmaps. */
|
|
2067
|
+
var dataViewCtorString = _toSource(_DataView),
|
|
2068
|
+
mapCtorString = _toSource(_Map),
|
|
2069
|
+
promiseCtorString = _toSource(_Promise),
|
|
2070
|
+
setCtorString = _toSource(_Set),
|
|
2071
|
+
weakMapCtorString = _toSource(_WeakMap);
|
|
2072
|
+
|
|
2073
|
+
/**
|
|
2074
|
+
* Gets the `toStringTag` of `value`.
|
|
2075
|
+
*
|
|
2076
|
+
* @private
|
|
2077
|
+
* @param {*} value The value to query.
|
|
2078
|
+
* @returns {string} Returns the `toStringTag`.
|
|
2079
|
+
*/
|
|
2080
|
+
var getTag = _baseGetTag;
|
|
2081
|
+
|
|
2082
|
+
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
|
2083
|
+
if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
|
2084
|
+
(_Map && getTag(new _Map) != mapTag) ||
|
|
2085
|
+
(_Promise && getTag(_Promise.resolve()) != promiseTag) ||
|
|
2086
|
+
(_Set && getTag(new _Set) != setTag) ||
|
|
2087
|
+
(_WeakMap && getTag(new _WeakMap) != weakMapTag)) {
|
|
2088
|
+
getTag = function(value) {
|
|
2089
|
+
var result = _baseGetTag(value),
|
|
2090
|
+
Ctor = result == objectTag$2 ? value.constructor : undefined,
|
|
2091
|
+
ctorString = Ctor ? _toSource(Ctor) : '';
|
|
2092
|
+
|
|
2093
|
+
if (ctorString) {
|
|
2094
|
+
switch (ctorString) {
|
|
2095
|
+
case dataViewCtorString: return dataViewTag;
|
|
2096
|
+
case mapCtorString: return mapTag;
|
|
2097
|
+
case promiseCtorString: return promiseTag;
|
|
2098
|
+
case setCtorString: return setTag;
|
|
2099
|
+
case weakMapCtorString: return weakMapTag;
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
return result;
|
|
2103
|
+
};
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
var _getTag = getTag;
|
|
2107
|
+
|
|
2108
|
+
/** Used to compose bitmasks for value comparisons. */
|
|
2109
|
+
var COMPARE_PARTIAL_FLAG = 1;
|
|
2110
|
+
|
|
2111
|
+
/** `Object#toString` result references. */
|
|
2112
|
+
var argsTag = '[object Arguments]',
|
|
2113
|
+
arrayTag = '[object Array]',
|
|
2114
|
+
objectTag$1 = '[object Object]';
|
|
2115
|
+
|
|
2116
|
+
/** Used for built-in method references. */
|
|
2117
|
+
var objectProto$3 = Object.prototype;
|
|
2118
|
+
|
|
2119
|
+
/** Used to check objects for own properties. */
|
|
2120
|
+
var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
|
2121
|
+
|
|
2122
|
+
/**
|
|
2123
|
+
* A specialized version of `baseIsEqual` for arrays and objects which performs
|
|
2124
|
+
* deep comparisons and tracks traversed objects enabling objects with circular
|
|
2125
|
+
* references to be compared.
|
|
2126
|
+
*
|
|
2127
|
+
* @private
|
|
2128
|
+
* @param {Object} object The object to compare.
|
|
2129
|
+
* @param {Object} other The other object to compare.
|
|
2130
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
2131
|
+
* @param {Function} customizer The function to customize comparisons.
|
|
2132
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
2133
|
+
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
|
|
2134
|
+
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
2135
|
+
*/
|
|
2136
|
+
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
2137
|
+
var objIsArr = isArray_1(object),
|
|
2138
|
+
othIsArr = isArray_1(other),
|
|
2139
|
+
objTag = objIsArr ? arrayTag : _getTag(object),
|
|
2140
|
+
othTag = othIsArr ? arrayTag : _getTag(other);
|
|
2141
|
+
|
|
2142
|
+
objTag = objTag == argsTag ? objectTag$1 : objTag;
|
|
2143
|
+
othTag = othTag == argsTag ? objectTag$1 : othTag;
|
|
2144
|
+
|
|
2145
|
+
var objIsObj = objTag == objectTag$1,
|
|
2146
|
+
othIsObj = othTag == objectTag$1,
|
|
2147
|
+
isSameTag = objTag == othTag;
|
|
2148
|
+
|
|
2149
|
+
if (isSameTag && isBuffer_1(object)) {
|
|
2150
|
+
if (!isBuffer_1(other)) {
|
|
2151
|
+
return false;
|
|
2152
|
+
}
|
|
2153
|
+
objIsArr = true;
|
|
2154
|
+
objIsObj = false;
|
|
2155
|
+
}
|
|
2156
|
+
if (isSameTag && !objIsObj) {
|
|
2157
|
+
stack || (stack = new _Stack);
|
|
2158
|
+
return (objIsArr || isTypedArray_1(object))
|
|
2159
|
+
? _equalArrays(object, other, bitmask, customizer, equalFunc, stack)
|
|
2160
|
+
: _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
2161
|
+
}
|
|
2162
|
+
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
2163
|
+
var objIsWrapped = objIsObj && hasOwnProperty$3.call(object, '__wrapped__'),
|
|
2164
|
+
othIsWrapped = othIsObj && hasOwnProperty$3.call(other, '__wrapped__');
|
|
2165
|
+
|
|
2166
|
+
if (objIsWrapped || othIsWrapped) {
|
|
2167
|
+
var objUnwrapped = objIsWrapped ? object.value() : object,
|
|
2168
|
+
othUnwrapped = othIsWrapped ? other.value() : other;
|
|
2169
|
+
|
|
2170
|
+
stack || (stack = new _Stack);
|
|
2171
|
+
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
if (!isSameTag) {
|
|
2175
|
+
return false;
|
|
2176
|
+
}
|
|
2177
|
+
stack || (stack = new _Stack);
|
|
2178
|
+
return _equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
var _baseIsEqualDeep = baseIsEqualDeep;
|
|
2182
|
+
|
|
2183
|
+
/**
|
|
2184
|
+
* The base implementation of `_.isEqual` which supports partial comparisons
|
|
2185
|
+
* and tracks traversed objects.
|
|
2186
|
+
*
|
|
2187
|
+
* @private
|
|
2188
|
+
* @param {*} value The value to compare.
|
|
2189
|
+
* @param {*} other The other value to compare.
|
|
2190
|
+
* @param {boolean} bitmask The bitmask flags.
|
|
2191
|
+
* 1 - Unordered comparison
|
|
2192
|
+
* 2 - Partial comparison
|
|
2193
|
+
* @param {Function} [customizer] The function to customize comparisons.
|
|
2194
|
+
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
|
|
2195
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
2196
|
+
*/
|
|
2197
|
+
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
2198
|
+
if (value === other) {
|
|
2199
|
+
return true;
|
|
2200
|
+
}
|
|
2201
|
+
if (value == null || other == null || (!isObjectLike_1(value) && !isObjectLike_1(other))) {
|
|
2202
|
+
return value !== value && other !== other;
|
|
2203
|
+
}
|
|
2204
|
+
return _baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
var _baseIsEqual = baseIsEqual;
|
|
2208
|
+
|
|
2209
|
+
/**
|
|
2210
|
+
* Performs a deep comparison between two values to determine if they are
|
|
2211
|
+
* equivalent.
|
|
2212
|
+
*
|
|
2213
|
+
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
|
2214
|
+
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
|
2215
|
+
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
|
2216
|
+
* by their own, not inherited, enumerable properties. Functions and DOM
|
|
2217
|
+
* nodes are compared by strict equality, i.e. `===`.
|
|
2218
|
+
*
|
|
2219
|
+
* @static
|
|
2220
|
+
* @memberOf _
|
|
2221
|
+
* @since 0.1.0
|
|
2222
|
+
* @category Lang
|
|
2223
|
+
* @param {*} value The value to compare.
|
|
2224
|
+
* @param {*} other The other value to compare.
|
|
2225
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
2226
|
+
* @example
|
|
2227
|
+
*
|
|
2228
|
+
* var object = { 'a': 1 };
|
|
2229
|
+
* var other = { 'a': 1 };
|
|
2230
|
+
*
|
|
2231
|
+
* _.isEqual(object, other);
|
|
2232
|
+
* // => true
|
|
2233
|
+
*
|
|
2234
|
+
* object === other;
|
|
2235
|
+
* // => false
|
|
2236
|
+
*/
|
|
2237
|
+
function isEqual(value, other) {
|
|
2238
|
+
return _baseIsEqual(value, other);
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
var isEqual_1 = isEqual;
|
|
2242
|
+
|
|
2243
|
+
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"};
|
|
2244
|
+
|
|
2245
|
+
const numberToPx = val => {
|
|
2246
|
+
return typeof val === 'number' ? `${val}px` : val;
|
|
2247
|
+
};
|
|
2248
|
+
const pxToNumber = value => {
|
|
2249
|
+
if (!value) return 0;
|
|
2250
|
+
const match = value.match(/^\d*(\.\d*)?/);
|
|
2251
|
+
return match ? Number(match[0]) : 0;
|
|
2252
|
+
};
|
|
2253
|
+
const ModalContent = _ref => {
|
|
2254
|
+
let {
|
|
2255
|
+
children,
|
|
2256
|
+
...others
|
|
2257
|
+
} = _ref;
|
|
2258
|
+
const {
|
|
2259
|
+
open,
|
|
2260
|
+
value: propsValue
|
|
2261
|
+
} = others;
|
|
2262
|
+
const [value, setValue] = React.useState(propsValue);
|
|
2263
|
+
React.useEffect(() => {
|
|
2264
|
+
if (open && !isEqual_1(value, propsValue)) {
|
|
2265
|
+
setValue(propsValue);
|
|
2266
|
+
}
|
|
2267
|
+
}, [open]);
|
|
2268
|
+
const contextProps = Object.assign({}, others, {
|
|
2269
|
+
value,
|
|
2270
|
+
setValue,
|
|
2271
|
+
onComplete: () => others.setValue(value),
|
|
2272
|
+
onAdd: item => others.onAdd(item, setValue),
|
|
2273
|
+
onSelect: item => others.onSelect(item, setValue),
|
|
2274
|
+
onRemove: item => others.onRemove(item, setValue),
|
|
2275
|
+
children
|
|
2276
|
+
});
|
|
2277
|
+
return /*#__PURE__*/React__default["default"].createElement(Provider, {
|
|
2278
|
+
value: contextProps
|
|
2279
|
+
}, children(contextProps));
|
|
2280
|
+
};
|
|
2281
|
+
const SelectInput = p => {
|
|
2282
|
+
const locale = Object.assign({}, {
|
|
2283
|
+
placeholder: '请选择',
|
|
2284
|
+
selectAll: '全选',
|
|
2285
|
+
selected: '已选',
|
|
2286
|
+
search: '搜索',
|
|
2287
|
+
numberOf: '%s个',
|
|
2288
|
+
maxLengthError: '最大数量不能超过%s',
|
|
2289
|
+
defaultChildren: '下拉内容,需要调用方实现'
|
|
2290
|
+
}, p.locale);
|
|
2291
|
+
const props = Object.assign({}, {
|
|
2292
|
+
children: () => locale.defaultChildren,
|
|
2293
|
+
maxLength: null,
|
|
2294
|
+
single: false,
|
|
2295
|
+
disabled: false,
|
|
2296
|
+
isPopup: true,
|
|
2297
|
+
defaultValue: [],
|
|
2298
|
+
placeholder: locale.placeholder,
|
|
2299
|
+
searchPlaceholder: locale.search,
|
|
2300
|
+
allowSelectedAll: false,
|
|
2301
|
+
selectedAllValue: {
|
|
2302
|
+
value: 'all',
|
|
2303
|
+
label: locale.selectAll
|
|
2304
|
+
},
|
|
2305
|
+
placement: 'bottomLeft',
|
|
2306
|
+
labelWrap: true,
|
|
2307
|
+
showSelectedTag: true,
|
|
2308
|
+
allowClear: true,
|
|
2309
|
+
extra: null,
|
|
2310
|
+
renderModal: contextProps => {
|
|
2311
|
+
const {
|
|
2312
|
+
props,
|
|
2313
|
+
open,
|
|
2314
|
+
onComplete,
|
|
2315
|
+
onOpenChange
|
|
2316
|
+
} = contextProps;
|
|
2317
|
+
const {
|
|
2318
|
+
placeholder,
|
|
2319
|
+
children
|
|
2320
|
+
} = props;
|
|
2321
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Modal, {
|
|
2322
|
+
width: 1000,
|
|
2323
|
+
open: open,
|
|
2324
|
+
title: placeholder,
|
|
2325
|
+
onCancel: () => {
|
|
2326
|
+
onOpenChange(false);
|
|
2327
|
+
},
|
|
2328
|
+
onOk: () => {
|
|
2329
|
+
onComplete();
|
|
2330
|
+
onOpenChange(false);
|
|
2331
|
+
}
|
|
2332
|
+
}, children(contextProps));
|
|
2333
|
+
}
|
|
2334
|
+
}, p, {
|
|
2335
|
+
locale
|
|
2336
|
+
});
|
|
2337
|
+
const [value, setValue] = useControlValue__default["default"](props);
|
|
2338
|
+
const [searchText, setSearchText] = React.useState('');
|
|
2339
|
+
const [open, setOpen] = React.useState(false);
|
|
2340
|
+
const [hover, setHover] = React.useState(false);
|
|
2341
|
+
const [inputWidth, setInputWidth] = React.useState(0);
|
|
2342
|
+
const inputRef = useResize__default["default"](el => {
|
|
2343
|
+
setInputWidth(el.clientWidth);
|
|
2344
|
+
});
|
|
2345
|
+
const {
|
|
2346
|
+
children,
|
|
2347
|
+
className,
|
|
2348
|
+
maxLength,
|
|
2349
|
+
overlayClassName,
|
|
2350
|
+
single,
|
|
2351
|
+
labelWrap,
|
|
2352
|
+
isPopup,
|
|
2353
|
+
allowClear,
|
|
2354
|
+
disabled,
|
|
2355
|
+
placeholder,
|
|
2356
|
+
selectedAllValue,
|
|
2357
|
+
overlayWidth,
|
|
2358
|
+
placement,
|
|
2359
|
+
renderModal
|
|
2360
|
+
} = props;
|
|
2361
|
+
const popupOverlayWidth = numberToPx(Math.max(inputWidth, pxToNumber(overlayWidth)));
|
|
2362
|
+
const {
|
|
2363
|
+
message
|
|
2364
|
+
} = antd.App.useApp();
|
|
2365
|
+
const checkMaxLength = (value, maxLength) => {
|
|
2366
|
+
if (Number.isInteger(maxLength) && maxLength > 0 && value.length >= maxLength) {
|
|
2367
|
+
message.error(locale.maxLengthError.replace('%s', maxLength));
|
|
2368
|
+
return false;
|
|
2369
|
+
}
|
|
2370
|
+
return true;
|
|
2371
|
+
};
|
|
2372
|
+
const onRemove = (item, currentSetValue) => {
|
|
2373
|
+
(currentSetValue || setValue)(value => {
|
|
2374
|
+
const newValue = value.slice(0);
|
|
2375
|
+
const index = value.findIndex(currentItem => currentItem.value === item.value);
|
|
2376
|
+
if (index > -1) {
|
|
2377
|
+
newValue.splice(index, 1);
|
|
2378
|
+
}
|
|
2379
|
+
return newValue;
|
|
2380
|
+
});
|
|
2381
|
+
};
|
|
2382
|
+
const onAdd = (item, currentSetValue) => {
|
|
2383
|
+
(currentSetValue || setValue)(value => {
|
|
2384
|
+
if (checkMaxLength(value, maxLength)) {
|
|
2385
|
+
return value;
|
|
2386
|
+
}
|
|
2387
|
+
const newValue = value.slice(0);
|
|
2388
|
+
const index = value.findIndex(currentItem => currentItem.value === item.value);
|
|
2389
|
+
if (index === -1) {
|
|
2390
|
+
newValue.push(item);
|
|
2391
|
+
}
|
|
2392
|
+
return newValue;
|
|
2393
|
+
});
|
|
2394
|
+
};
|
|
2395
|
+
const onSelect = (item, currentSetValue) => {
|
|
2396
|
+
(currentSetValue || setValue)(value => {
|
|
2397
|
+
const newValue = value.slice(0);
|
|
2398
|
+
const index = value.findIndex(currentItem => currentItem.value === item.value);
|
|
2399
|
+
if (index === -1 && !checkMaxLength(value, maxLength)) {
|
|
2400
|
+
return value;
|
|
2401
|
+
}
|
|
2402
|
+
if (index === -1) {
|
|
2403
|
+
newValue.push(item);
|
|
2404
|
+
} else {
|
|
2405
|
+
newValue.splice(index, 1);
|
|
2406
|
+
}
|
|
2407
|
+
return newValue;
|
|
2408
|
+
});
|
|
2409
|
+
};
|
|
2410
|
+
const inputInnerRender = function (props) {
|
|
2411
|
+
if (props === void 0) {
|
|
2412
|
+
props = {};
|
|
2413
|
+
}
|
|
2414
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Flex, _extends({}, props, {
|
|
2415
|
+
ref: inputRef,
|
|
2416
|
+
className: classnames__default["default"](className, style$3['select-input'], {
|
|
2417
|
+
[style$3['wrap']]: labelWrap,
|
|
2418
|
+
[style$3['disabled']]: disabled
|
|
2419
|
+
}),
|
|
2420
|
+
justify: "space-between",
|
|
2421
|
+
onMouseOver: () => {
|
|
2422
|
+
setHover(true);
|
|
2423
|
+
},
|
|
2424
|
+
onMouseOut: () => {
|
|
2425
|
+
setHover(false);
|
|
2426
|
+
}
|
|
2427
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2428
|
+
className: style$3['select-input-inner']
|
|
2429
|
+
}, (value || []).length > 0 ? single || value[0].value === selectedAllValue.value ? value[0].label : value.map(item => {
|
|
2430
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Tag, {
|
|
2431
|
+
key: item.value,
|
|
2432
|
+
closable: true,
|
|
2433
|
+
bordered: false,
|
|
2434
|
+
onClose: e => {
|
|
2435
|
+
e.preventDefault();
|
|
2436
|
+
onRemove(item);
|
|
2437
|
+
}
|
|
2438
|
+
}, item.label);
|
|
2439
|
+
}) : /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2440
|
+
className: style$3['placeholder']
|
|
2441
|
+
}, placeholder)), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2442
|
+
className: style$3['select-input-icon']
|
|
2443
|
+
}, !disabled && allowClear && hover && (value || []).length > 0 ? /*#__PURE__*/React__default["default"].createElement(icons.CloseCircleFilled, {
|
|
2444
|
+
onClick: e => {
|
|
2445
|
+
e.stopPropagation();
|
|
2446
|
+
setValue([]);
|
|
2447
|
+
}
|
|
2448
|
+
}) : /*#__PURE__*/React__default["default"].createElement(icons.DownOutlined, null)));
|
|
2449
|
+
};
|
|
2450
|
+
const contextProps = {
|
|
2451
|
+
props,
|
|
2452
|
+
value,
|
|
2453
|
+
setValue,
|
|
2454
|
+
searchText,
|
|
2455
|
+
setSearchText,
|
|
2456
|
+
hover,
|
|
2457
|
+
inputWidth,
|
|
2458
|
+
onAdd,
|
|
2459
|
+
onRemove,
|
|
2460
|
+
onSelect,
|
|
2461
|
+
open: !disabled && open,
|
|
2462
|
+
onOpenChange: setOpen,
|
|
2463
|
+
children
|
|
2464
|
+
};
|
|
2465
|
+
return /*#__PURE__*/React__default["default"].createElement(Provider, {
|
|
2466
|
+
value: contextProps
|
|
2467
|
+
}, isPopup ? /*#__PURE__*/React__default["default"].createElement(antd.Popover, {
|
|
2468
|
+
open: !disabled && open,
|
|
2469
|
+
onOpenChange: setOpen,
|
|
2470
|
+
placement: placement,
|
|
2471
|
+
arrow: false,
|
|
2472
|
+
transitionName: "",
|
|
2473
|
+
overlayClassName: classnames__default["default"](style$3['overlay'], overlayClassName),
|
|
2474
|
+
trigger: "click",
|
|
2475
|
+
content: /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2476
|
+
style: {
|
|
2477
|
+
'--overlay-width': popupOverlayWidth
|
|
2478
|
+
},
|
|
2479
|
+
className: classnames__default["default"](style$3['overlay-content'], 'over-content'),
|
|
2480
|
+
onClick: e => {
|
|
2481
|
+
e.stopPropagation();
|
|
2482
|
+
}
|
|
2483
|
+
}, children(contextProps))
|
|
2484
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", null, inputInnerRender())) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, inputInnerRender({
|
|
2485
|
+
onClick: () => {
|
|
2486
|
+
setOpen(true);
|
|
2487
|
+
}
|
|
2488
|
+
}), /*#__PURE__*/React__default["default"].createElement(ModalContent, contextProps, renderModal)));
|
|
2489
|
+
};
|
|
2490
|
+
|
|
2491
|
+
/** `Object#toString` result references. */
|
|
2492
|
+
var symbolTag = '[object Symbol]';
|
|
1074
2493
|
|
|
1075
2494
|
/**
|
|
1076
|
-
*
|
|
2495
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
1077
2496
|
*
|
|
1078
|
-
* @
|
|
1079
|
-
* @
|
|
1080
|
-
* @
|
|
1081
|
-
* @
|
|
1082
|
-
* @
|
|
1083
|
-
|
|
1084
|
-
|
|
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`.
|
|
2497
|
+
* @static
|
|
2498
|
+
* @memberOf _
|
|
2499
|
+
* @since 4.0.0
|
|
2500
|
+
* @category Lang
|
|
2501
|
+
* @param {*} value The value to check.
|
|
2502
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
2503
|
+
* @example
|
|
1094
2504
|
*
|
|
1095
|
-
*
|
|
1096
|
-
*
|
|
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.
|
|
2505
|
+
* _.isSymbol(Symbol.iterator);
|
|
2506
|
+
* // => true
|
|
1109
2507
|
*
|
|
1110
|
-
*
|
|
1111
|
-
*
|
|
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`.
|
|
2508
|
+
* _.isSymbol('abc');
|
|
2509
|
+
* // => false
|
|
1115
2510
|
*/
|
|
1116
|
-
function
|
|
1117
|
-
return
|
|
2511
|
+
function isSymbol(value) {
|
|
2512
|
+
return typeof value == 'symbol' ||
|
|
2513
|
+
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
1118
2514
|
}
|
|
1119
2515
|
|
|
1120
|
-
var
|
|
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
|
-
}
|
|
2516
|
+
var isSymbol_1 = isSymbol;
|
|
1140
2517
|
|
|
1141
|
-
|
|
2518
|
+
/** Used to match property names within property paths. */
|
|
2519
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
2520
|
+
reIsPlainProp = /^\w*$/;
|
|
1142
2521
|
|
|
1143
2522
|
/**
|
|
1144
|
-
*
|
|
2523
|
+
* Checks if `value` is a property name and not a property path.
|
|
1145
2524
|
*
|
|
1146
2525
|
* @private
|
|
1147
|
-
* @
|
|
1148
|
-
* @param {
|
|
2526
|
+
* @param {*} value The value to check.
|
|
2527
|
+
* @param {Object} [object] The object to query keys on.
|
|
2528
|
+
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
1149
2529
|
*/
|
|
1150
|
-
function
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
2530
|
+
function isKey(value, object) {
|
|
2531
|
+
if (isArray_1(value)) {
|
|
2532
|
+
return false;
|
|
2533
|
+
}
|
|
2534
|
+
var type = typeof value;
|
|
2535
|
+
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
2536
|
+
value == null || isSymbol_1(value)) {
|
|
2537
|
+
return true;
|
|
1158
2538
|
}
|
|
2539
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
2540
|
+
(object != null && value in Object(object));
|
|
1159
2541
|
}
|
|
1160
2542
|
|
|
1161
|
-
|
|
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;
|
|
2543
|
+
var _isKey = isKey;
|
|
1169
2544
|
|
|
1170
2545
|
/** Error message constants. */
|
|
1171
2546
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
@@ -1515,146 +2890,31 @@ const SelectedTagList = () => {
|
|
|
1515
2890
|
single,
|
|
1516
2891
|
maxLength
|
|
1517
2892
|
} = 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;
|
|
2893
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2894
|
+
className: style$1['tag-list-outer']
|
|
2895
|
+
}, /*#__PURE__*/React__default["default"].createElement(antd.Flex, {
|
|
2896
|
+
className: style$1['tag-list'],
|
|
2897
|
+
gap: 8
|
|
2898
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2899
|
+
className: style$1['label']
|
|
2900
|
+
}, locale.selected, !single && `(${value.length}${Number.isInteger(maxLength) ? `/${maxLength}` : ''})`, ":"), /*#__PURE__*/React__default["default"].createElement(SimpleBar__default["default"], {
|
|
2901
|
+
className: style$1['tag-container']
|
|
2902
|
+
}, /*#__PURE__*/React__default["default"].createElement(antd.Flex, {
|
|
2903
|
+
gap: 8,
|
|
2904
|
+
wrap: true,
|
|
2905
|
+
className: style$1['tag-container-inner']
|
|
2906
|
+
}, value.map(item => {
|
|
2907
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Tag, {
|
|
2908
|
+
key: item.value,
|
|
2909
|
+
closable: true,
|
|
2910
|
+
bordered: false,
|
|
2911
|
+
onClose: e => {
|
|
2912
|
+
e.preventDefault();
|
|
2913
|
+
onRemove(item);
|
|
2914
|
+
}
|
|
2915
|
+
}, item.label);
|
|
2916
|
+
})))));
|
|
2917
|
+
};
|
|
1658
2918
|
|
|
1659
2919
|
var defineProperty = (function() {
|
|
1660
2920
|
try {
|
|
@@ -1785,11 +3045,6 @@ function cloneBuffer(buffer, isDeep) {
|
|
|
1785
3045
|
module.exports = cloneBuffer;
|
|
1786
3046
|
});
|
|
1787
3047
|
|
|
1788
|
-
/** Built-in value references. */
|
|
1789
|
-
var Uint8Array = _root.Uint8Array;
|
|
1790
|
-
|
|
1791
|
-
var _Uint8Array = Uint8Array;
|
|
1792
|
-
|
|
1793
3048
|
/**
|
|
1794
3049
|
* Creates a clone of `arrayBuffer`.
|
|
1795
3050
|
*
|
|
@@ -1870,278 +3125,69 @@ var baseCreate = (function() {
|
|
|
1870
3125
|
|
|
1871
3126
|
var _baseCreate = baseCreate;
|
|
1872
3127
|
|
|
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
3128
|
/** Built-in value references. */
|
|
2106
|
-
var
|
|
3129
|
+
var getPrototype = _overArg(Object.getPrototypeOf, Object);
|
|
2107
3130
|
|
|
2108
|
-
|
|
2109
|
-
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
3131
|
+
var _getPrototype = getPrototype;
|
|
2110
3132
|
|
|
2111
3133
|
/**
|
|
2112
|
-
*
|
|
3134
|
+
* Initializes an object clone.
|
|
3135
|
+
*
|
|
3136
|
+
* @private
|
|
3137
|
+
* @param {Object} object The object to clone.
|
|
3138
|
+
* @returns {Object} Returns the initialized clone.
|
|
3139
|
+
*/
|
|
3140
|
+
function initCloneObject(object) {
|
|
3141
|
+
return (typeof object.constructor == 'function' && !_isPrototype(object))
|
|
3142
|
+
? _baseCreate(_getPrototype(object))
|
|
3143
|
+
: {};
|
|
3144
|
+
}
|
|
3145
|
+
|
|
3146
|
+
var _initCloneObject = initCloneObject;
|
|
3147
|
+
|
|
3148
|
+
/**
|
|
3149
|
+
* This method is like `_.isArrayLike` except that it also checks if `value`
|
|
3150
|
+
* is an object.
|
|
2113
3151
|
*
|
|
2114
3152
|
* @static
|
|
2115
3153
|
* @memberOf _
|
|
2116
|
-
* @since 4.
|
|
3154
|
+
* @since 4.0.0
|
|
2117
3155
|
* @category Lang
|
|
2118
3156
|
* @param {*} value The value to check.
|
|
2119
|
-
* @returns {boolean} Returns `true` if `value` is
|
|
3157
|
+
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
|
3158
|
+
* else `false`.
|
|
2120
3159
|
* @example
|
|
2121
3160
|
*
|
|
2122
|
-
* _.
|
|
3161
|
+
* _.isArrayLikeObject([1, 2, 3]);
|
|
2123
3162
|
* // => true
|
|
2124
3163
|
*
|
|
2125
|
-
* _.
|
|
3164
|
+
* _.isArrayLikeObject(document.body.children);
|
|
3165
|
+
* // => true
|
|
3166
|
+
*
|
|
3167
|
+
* _.isArrayLikeObject('abc');
|
|
3168
|
+
* // => false
|
|
3169
|
+
*
|
|
3170
|
+
* _.isArrayLikeObject(_.noop);
|
|
2126
3171
|
* // => false
|
|
2127
3172
|
*/
|
|
2128
|
-
|
|
3173
|
+
function isArrayLikeObject(value) {
|
|
3174
|
+
return isObjectLike_1(value) && isArrayLike_1(value);
|
|
3175
|
+
}
|
|
2129
3176
|
|
|
2130
|
-
|
|
2131
|
-
});
|
|
3177
|
+
var isArrayLikeObject_1 = isArrayLikeObject;
|
|
2132
3178
|
|
|
2133
3179
|
/** `Object#toString` result references. */
|
|
2134
|
-
var objectTag
|
|
3180
|
+
var objectTag = '[object Object]';
|
|
2135
3181
|
|
|
2136
3182
|
/** Used for built-in method references. */
|
|
2137
3183
|
var funcProto = Function.prototype,
|
|
2138
|
-
objectProto$
|
|
3184
|
+
objectProto$2 = Object.prototype;
|
|
2139
3185
|
|
|
2140
3186
|
/** Used to resolve the decompiled source of functions. */
|
|
2141
3187
|
var funcToString = funcProto.toString;
|
|
2142
3188
|
|
|
2143
3189
|
/** Used to check objects for own properties. */
|
|
2144
|
-
var hasOwnProperty$
|
|
3190
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
2145
3191
|
|
|
2146
3192
|
/** Used to infer the `Object` constructor. */
|
|
2147
3193
|
var objectCtorString = funcToString.call(Object);
|
|
@@ -2175,147 +3221,20 @@ var objectCtorString = funcToString.call(Object);
|
|
|
2175
3221
|
* // => true
|
|
2176
3222
|
*/
|
|
2177
3223
|
function isPlainObject(value) {
|
|
2178
|
-
if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag
|
|
3224
|
+
if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag) {
|
|
2179
3225
|
return false;
|
|
2180
3226
|
}
|
|
2181
3227
|
var proto = _getPrototype(value);
|
|
2182
3228
|
if (proto === null) {
|
|
2183
3229
|
return true;
|
|
2184
3230
|
}
|
|
2185
|
-
var Ctor = hasOwnProperty$
|
|
3231
|
+
var Ctor = hasOwnProperty$2.call(proto, 'constructor') && proto.constructor;
|
|
2186
3232
|
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
|
2187
3233
|
funcToString.call(Ctor) == objectCtorString;
|
|
2188
3234
|
}
|
|
2189
3235
|
|
|
2190
3236
|
var isPlainObject_1 = isPlainObject;
|
|
2191
3237
|
|
|
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
3238
|
/**
|
|
2320
3239
|
* Gets the value at `key`, unless `key` is "__proto__" or "constructor".
|
|
2321
3240
|
*
|
|
@@ -2339,10 +3258,10 @@ function safeGet(object, key) {
|
|
|
2339
3258
|
var _safeGet = safeGet;
|
|
2340
3259
|
|
|
2341
3260
|
/** Used for built-in method references. */
|
|
2342
|
-
var objectProto$
|
|
3261
|
+
var objectProto$1 = Object.prototype;
|
|
2343
3262
|
|
|
2344
3263
|
/** Used to check objects for own properties. */
|
|
2345
|
-
var hasOwnProperty$
|
|
3264
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
2346
3265
|
|
|
2347
3266
|
/**
|
|
2348
3267
|
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
|
@@ -2356,7 +3275,7 @@ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
|
2356
3275
|
*/
|
|
2357
3276
|
function assignValue(object, key, value) {
|
|
2358
3277
|
var objValue = object[key];
|
|
2359
|
-
if (!(hasOwnProperty$
|
|
3278
|
+
if (!(hasOwnProperty$1.call(object, key) && eq_1(objValue, value)) ||
|
|
2360
3279
|
(value === undefined && !(key in object))) {
|
|
2361
3280
|
_baseAssignValue(object, key, value);
|
|
2362
3281
|
}
|
|
@@ -2402,96 +3321,6 @@ function copyObject(source, props, object, customizer) {
|
|
|
2402
3321
|
|
|
2403
3322
|
var _copyObject = copyObject;
|
|
2404
3323
|
|
|
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
3324
|
/**
|
|
2496
3325
|
* This function is like
|
|
2497
3326
|
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|