@spark-ui/hooks 17.2.3 → 17.2.4

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.
@@ -1,685 +1,1477 @@
1
- import { useRef, useState, useCallback } from "react";
2
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
3
- function getDefaultExportFromCjs(x) {
4
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5
- }
6
- var lodash_isequal = { exports: {} };
7
- lodash_isequal.exports;
8
- var hasRequiredLodash_isequal;
9
- function requireLodash_isequal() {
10
- if (hasRequiredLodash_isequal) return lodash_isequal.exports;
11
- hasRequiredLodash_isequal = 1;
12
- (function(module, exports$1) {
13
- var LARGE_ARRAY_SIZE = 200;
14
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
15
- var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
16
- var MAX_SAFE_INTEGER = 9007199254740991;
17
- var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]";
18
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
19
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
20
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
21
- var reIsUint = /^(?:0|[1-9]\d*)$/;
22
- var typedArrayTags = {};
23
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
24
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
25
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
26
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
27
- var root = freeGlobal || freeSelf || Function("return this")();
28
- var freeExports = exports$1 && !exports$1.nodeType && exports$1;
29
- var freeModule = freeExports && true && module && !module.nodeType && module;
30
- var moduleExports = freeModule && freeModule.exports === freeExports;
31
- var freeProcess = moduleExports && freeGlobal.process;
32
- var nodeUtil = (function() {
33
- try {
34
- return freeProcess && freeProcess.binding && freeProcess.binding("util");
35
- } catch (e) {
36
- }
37
- })();
38
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
39
- function arrayFilter(array, predicate) {
40
- var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
41
- while (++index < length) {
42
- var value = array[index];
43
- if (predicate(value, index, array)) {
44
- result[resIndex++] = value;
45
- }
46
- }
47
- return result;
48
- }
49
- function arrayPush(array, values) {
50
- var index = -1, length = values.length, offset = array.length;
51
- while (++index < length) {
52
- array[offset + index] = values[index];
53
- }
54
- return array;
55
- }
56
- function arraySome(array, predicate) {
57
- var index = -1, length = array == null ? 0 : array.length;
58
- while (++index < length) {
59
- if (predicate(array[index], index, array)) {
60
- return true;
61
- }
62
- }
63
- return false;
64
- }
65
- function baseTimes(n, iteratee) {
66
- var index = -1, result = Array(n);
67
- while (++index < n) {
68
- result[index] = iteratee(index);
69
- }
70
- return result;
71
- }
72
- function baseUnary(func) {
73
- return function(value) {
74
- return func(value);
75
- };
76
- }
77
- function cacheHas(cache, key) {
78
- return cache.has(key);
79
- }
80
- function getValue(object, key) {
81
- return object == null ? void 0 : object[key];
82
- }
83
- function mapToArray(map) {
84
- var index = -1, result = Array(map.size);
85
- map.forEach(function(value, key) {
86
- result[++index] = [key, value];
87
- });
88
- return result;
89
- }
90
- function overArg(func, transform) {
91
- return function(arg) {
92
- return func(transform(arg));
93
- };
94
- }
95
- function setToArray(set) {
96
- var index = -1, result = Array(set.size);
97
- set.forEach(function(value) {
98
- result[++index] = value;
99
- });
100
- return result;
101
- }
102
- var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
103
- var coreJsData = root["__core-js_shared__"];
104
- var funcToString = funcProto.toString;
105
- var hasOwnProperty = objectProto.hasOwnProperty;
106
- var maskSrcKey = (function() {
107
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
108
- return uid ? "Symbol(src)_1." + uid : "";
109
- })();
110
- var nativeObjectToString = objectProto.toString;
111
- var reIsNative = RegExp(
112
- "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
113
- );
114
- var Buffer = moduleExports ? root.Buffer : void 0, Symbol = root.Symbol, Uint8Array = root.Uint8Array, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol ? Symbol.toStringTag : void 0;
115
- var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object);
116
- var DataView = getNative(root, "DataView"), Map = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set = getNative(root, "Set"), WeakMap = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create");
117
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
118
- var symbolProto = Symbol ? Symbol.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
119
- function Hash(entries) {
120
- var index = -1, length = entries == null ? 0 : entries.length;
121
- this.clear();
122
- while (++index < length) {
123
- var entry = entries[index];
124
- this.set(entry[0], entry[1]);
125
- }
126
- }
127
- function hashClear() {
128
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
129
- this.size = 0;
130
- }
131
- function hashDelete(key) {
132
- var result = this.has(key) && delete this.__data__[key];
133
- this.size -= result ? 1 : 0;
134
- return result;
135
- }
136
- function hashGet(key) {
137
- var data = this.__data__;
138
- if (nativeCreate) {
139
- var result = data[key];
140
- return result === HASH_UNDEFINED ? void 0 : result;
141
- }
142
- return hasOwnProperty.call(data, key) ? data[key] : void 0;
143
- }
144
- function hashHas(key) {
145
- var data = this.__data__;
146
- return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
147
- }
148
- function hashSet(key, value) {
149
- var data = this.__data__;
150
- this.size += this.has(key) ? 0 : 1;
151
- data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
152
- return this;
153
- }
154
- Hash.prototype.clear = hashClear;
155
- Hash.prototype["delete"] = hashDelete;
156
- Hash.prototype.get = hashGet;
157
- Hash.prototype.has = hashHas;
158
- Hash.prototype.set = hashSet;
159
- function ListCache(entries) {
160
- var index = -1, length = entries == null ? 0 : entries.length;
161
- this.clear();
162
- while (++index < length) {
163
- var entry = entries[index];
164
- this.set(entry[0], entry[1]);
165
- }
166
- }
167
- function listCacheClear() {
168
- this.__data__ = [];
169
- this.size = 0;
170
- }
171
- function listCacheDelete(key) {
172
- var data = this.__data__, index = assocIndexOf(data, key);
173
- if (index < 0) {
174
- return false;
175
- }
176
- var lastIndex = data.length - 1;
177
- if (index == lastIndex) {
178
- data.pop();
179
- } else {
180
- splice.call(data, index, 1);
181
- }
182
- --this.size;
183
- return true;
184
- }
185
- function listCacheGet(key) {
186
- var data = this.__data__, index = assocIndexOf(data, key);
187
- return index < 0 ? void 0 : data[index][1];
188
- }
189
- function listCacheHas(key) {
190
- return assocIndexOf(this.__data__, key) > -1;
191
- }
192
- function listCacheSet(key, value) {
193
- var data = this.__data__, index = assocIndexOf(data, key);
194
- if (index < 0) {
195
- ++this.size;
196
- data.push([key, value]);
197
- } else {
198
- data[index][1] = value;
199
- }
200
- return this;
201
- }
202
- ListCache.prototype.clear = listCacheClear;
203
- ListCache.prototype["delete"] = listCacheDelete;
204
- ListCache.prototype.get = listCacheGet;
205
- ListCache.prototype.has = listCacheHas;
206
- ListCache.prototype.set = listCacheSet;
207
- function MapCache(entries) {
208
- var index = -1, length = entries == null ? 0 : entries.length;
209
- this.clear();
210
- while (++index < length) {
211
- var entry = entries[index];
212
- this.set(entry[0], entry[1]);
213
- }
214
- }
215
- function mapCacheClear() {
216
- this.size = 0;
217
- this.__data__ = {
218
- "hash": new Hash(),
219
- "map": new (Map || ListCache)(),
220
- "string": new Hash()
221
- };
222
- }
223
- function mapCacheDelete(key) {
224
- var result = getMapData(this, key)["delete"](key);
225
- this.size -= result ? 1 : 0;
226
- return result;
227
- }
228
- function mapCacheGet(key) {
229
- return getMapData(this, key).get(key);
230
- }
231
- function mapCacheHas(key) {
232
- return getMapData(this, key).has(key);
233
- }
234
- function mapCacheSet(key, value) {
235
- var data = getMapData(this, key), size = data.size;
236
- data.set(key, value);
237
- this.size += data.size == size ? 0 : 1;
238
- return this;
239
- }
240
- MapCache.prototype.clear = mapCacheClear;
241
- MapCache.prototype["delete"] = mapCacheDelete;
242
- MapCache.prototype.get = mapCacheGet;
243
- MapCache.prototype.has = mapCacheHas;
244
- MapCache.prototype.set = mapCacheSet;
245
- function SetCache(values) {
246
- var index = -1, length = values == null ? 0 : values.length;
247
- this.__data__ = new MapCache();
248
- while (++index < length) {
249
- this.add(values[index]);
250
- }
251
- }
252
- function setCacheAdd(value) {
253
- this.__data__.set(value, HASH_UNDEFINED);
254
- return this;
255
- }
256
- function setCacheHas(value) {
257
- return this.__data__.has(value);
258
- }
259
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
260
- SetCache.prototype.has = setCacheHas;
261
- function Stack(entries) {
262
- var data = this.__data__ = new ListCache(entries);
263
- this.size = data.size;
264
- }
265
- function stackClear() {
266
- this.__data__ = new ListCache();
267
- this.size = 0;
268
- }
269
- function stackDelete(key) {
270
- var data = this.__data__, result = data["delete"](key);
271
- this.size = data.size;
272
- return result;
273
- }
274
- function stackGet(key) {
275
- return this.__data__.get(key);
276
- }
277
- function stackHas(key) {
278
- return this.__data__.has(key);
279
- }
280
- function stackSet(key, value) {
281
- var data = this.__data__;
282
- if (data instanceof ListCache) {
283
- var pairs = data.__data__;
284
- if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
285
- pairs.push([key, value]);
286
- this.size = ++data.size;
287
- return this;
288
- }
289
- data = this.__data__ = new MapCache(pairs);
290
- }
291
- data.set(key, value);
292
- this.size = data.size;
293
- return this;
294
- }
295
- Stack.prototype.clear = stackClear;
296
- Stack.prototype["delete"] = stackDelete;
297
- Stack.prototype.get = stackGet;
298
- Stack.prototype.has = stackHas;
299
- Stack.prototype.set = stackSet;
300
- function arrayLikeKeys(value, inherited) {
301
- var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
302
- for (var key in value) {
303
- if (hasOwnProperty.call(value, key) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
304
- (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
305
- isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
306
- isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
307
- isIndex(key, length)))) {
308
- result.push(key);
309
- }
310
- }
311
- return result;
312
- }
313
- function assocIndexOf(array, key) {
314
- var length = array.length;
315
- while (length--) {
316
- if (eq(array[length][0], key)) {
317
- return length;
318
- }
319
- }
320
- return -1;
321
- }
322
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
323
- var result = keysFunc(object);
324
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
325
- }
326
- function baseGetTag(value) {
327
- if (value == null) {
328
- return value === void 0 ? undefinedTag : nullTag;
329
- }
330
- return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
331
- }
332
- function baseIsArguments(value) {
333
- return isObjectLike(value) && baseGetTag(value) == argsTag;
334
- }
335
- function baseIsEqual(value, other, bitmask, customizer, stack) {
336
- if (value === other) {
337
- return true;
338
- }
339
- if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
340
- return value !== value && other !== other;
341
- }
342
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
343
- }
344
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
345
- var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
346
- objTag = objTag == argsTag ? objectTag : objTag;
347
- othTag = othTag == argsTag ? objectTag : othTag;
348
- var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
349
- if (isSameTag && isBuffer(object)) {
350
- if (!isBuffer(other)) {
351
- return false;
352
- }
353
- objIsArr = true;
354
- objIsObj = false;
355
- }
356
- if (isSameTag && !objIsObj) {
357
- stack || (stack = new Stack());
358
- return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
359
- }
360
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
361
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
362
- if (objIsWrapped || othIsWrapped) {
363
- var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
364
- stack || (stack = new Stack());
365
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
366
- }
367
- }
368
- if (!isSameTag) {
369
- return false;
370
- }
371
- stack || (stack = new Stack());
372
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
373
- }
374
- function baseIsNative(value) {
375
- if (!isObject(value) || isMasked(value)) {
376
- return false;
377
- }
378
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
379
- return pattern.test(toSource(value));
380
- }
381
- function baseIsTypedArray(value) {
382
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
383
- }
384
- function baseKeys(object) {
385
- if (!isPrototype(object)) {
386
- return nativeKeys(object);
387
- }
388
- var result = [];
389
- for (var key in Object(object)) {
390
- if (hasOwnProperty.call(object, key) && key != "constructor") {
391
- result.push(key);
392
- }
393
- }
394
- return result;
395
- }
396
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
397
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
398
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
399
- return false;
400
- }
401
- var stacked = stack.get(array);
402
- if (stacked && stack.get(other)) {
403
- return stacked == other;
404
- }
405
- var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
406
- stack.set(array, other);
407
- stack.set(other, array);
408
- while (++index < arrLength) {
409
- var arrValue = array[index], othValue = other[index];
410
- if (customizer) {
411
- var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
412
- }
413
- if (compared !== void 0) {
414
- if (compared) {
415
- continue;
416
- }
417
- result = false;
418
- break;
419
- }
420
- if (seen) {
421
- if (!arraySome(other, function(othValue2, othIndex) {
422
- if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
423
- return seen.push(othIndex);
424
- }
425
- })) {
426
- result = false;
427
- break;
428
- }
429
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
430
- result = false;
431
- break;
432
- }
433
- }
434
- stack["delete"](array);
435
- stack["delete"](other);
436
- return result;
437
- }
438
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
439
- switch (tag) {
440
- case dataViewTag:
441
- if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
442
- return false;
443
- }
444
- object = object.buffer;
445
- other = other.buffer;
446
- case arrayBufferTag:
447
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
448
- return false;
449
- }
450
- return true;
451
- case boolTag:
452
- case dateTag:
453
- case numberTag:
454
- return eq(+object, +other);
455
- case errorTag:
456
- return object.name == other.name && object.message == other.message;
457
- case regexpTag:
458
- case stringTag:
459
- return object == other + "";
460
- case mapTag:
461
- var convert = mapToArray;
462
- case setTag:
463
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
464
- convert || (convert = setToArray);
465
- if (object.size != other.size && !isPartial) {
466
- return false;
467
- }
468
- var stacked = stack.get(object);
469
- if (stacked) {
470
- return stacked == other;
471
- }
472
- bitmask |= COMPARE_UNORDERED_FLAG;
473
- stack.set(object, other);
474
- var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
475
- stack["delete"](object);
476
- return result;
477
- case symbolTag:
478
- if (symbolValueOf) {
479
- return symbolValueOf.call(object) == symbolValueOf.call(other);
480
- }
481
- }
482
- return false;
483
- }
484
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
485
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
486
- if (objLength != othLength && !isPartial) {
487
- return false;
488
- }
489
- var index = objLength;
490
- while (index--) {
491
- var key = objProps[index];
492
- if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
493
- return false;
494
- }
495
- }
496
- var stacked = stack.get(object);
497
- if (stacked && stack.get(other)) {
498
- return stacked == other;
499
- }
500
- var result = true;
501
- stack.set(object, other);
502
- stack.set(other, object);
503
- var skipCtor = isPartial;
504
- while (++index < objLength) {
505
- key = objProps[index];
506
- var objValue = object[key], othValue = other[key];
507
- if (customizer) {
508
- var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
509
- }
510
- if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
511
- result = false;
512
- break;
513
- }
514
- skipCtor || (skipCtor = key == "constructor");
515
- }
516
- if (result && !skipCtor) {
517
- var objCtor = object.constructor, othCtor = other.constructor;
518
- if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
519
- result = false;
520
- }
521
- }
522
- stack["delete"](object);
523
- stack["delete"](other);
524
- return result;
525
- }
526
- function getAllKeys(object) {
527
- return baseGetAllKeys(object, keys, getSymbols);
528
- }
529
- function getMapData(map, key) {
530
- var data = map.__data__;
531
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
532
- }
533
- function getNative(object, key) {
534
- var value = getValue(object, key);
535
- return baseIsNative(value) ? value : void 0;
536
- }
537
- function getRawTag(value) {
538
- var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
539
- try {
540
- value[symToStringTag] = void 0;
541
- var unmasked = true;
542
- } catch (e) {
543
- }
544
- var result = nativeObjectToString.call(value);
545
- if (unmasked) {
546
- if (isOwn) {
547
- value[symToStringTag] = tag;
548
- } else {
549
- delete value[symToStringTag];
550
- }
551
- }
552
- return result;
553
- }
554
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
555
- if (object == null) {
556
- return [];
557
- }
558
- object = Object(object);
559
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
560
- return propertyIsEnumerable.call(object, symbol);
561
- });
562
- };
563
- var getTag = baseGetTag;
564
- if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
565
- getTag = function(value) {
566
- var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
567
- if (ctorString) {
568
- switch (ctorString) {
569
- case dataViewCtorString:
570
- return dataViewTag;
571
- case mapCtorString:
572
- return mapTag;
573
- case promiseCtorString:
574
- return promiseTag;
575
- case setCtorString:
576
- return setTag;
577
- case weakMapCtorString:
578
- return weakMapTag;
579
- }
580
- }
581
- return result;
582
- };
583
- }
584
- function isIndex(value, length) {
585
- length = length == null ? MAX_SAFE_INTEGER : length;
586
- return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
587
- }
588
- function isKeyable(value) {
589
- var type = typeof value;
590
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
591
- }
592
- function isMasked(func) {
593
- return !!maskSrcKey && maskSrcKey in func;
594
- }
595
- function isPrototype(value) {
596
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
597
- return value === proto;
598
- }
599
- function objectToString(value) {
600
- return nativeObjectToString.call(value);
601
- }
602
- function toSource(func) {
603
- if (func != null) {
604
- try {
605
- return funcToString.call(func);
606
- } catch (e) {
607
- }
608
- try {
609
- return func + "";
610
- } catch (e) {
611
- }
612
- }
613
- return "";
614
- }
615
- function eq(value, other) {
616
- return value === other || value !== value && other !== other;
617
- }
618
- var isArguments = baseIsArguments(/* @__PURE__ */ (function() {
619
- return arguments;
620
- })()) ? baseIsArguments : function(value) {
621
- return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
622
- };
623
- var isArray = Array.isArray;
624
- function isArrayLike(value) {
625
- return value != null && isLength(value.length) && !isFunction(value);
626
- }
627
- var isBuffer = nativeIsBuffer || stubFalse;
628
- function isEqual2(value, other) {
629
- return baseIsEqual(value, other);
630
- }
631
- function isFunction(value) {
632
- if (!isObject(value)) {
633
- return false;
634
- }
635
- var tag = baseGetTag(value);
636
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
637
- }
638
- function isLength(value) {
639
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
640
- }
641
- function isObject(value) {
642
- var type = typeof value;
643
- return value != null && (type == "object" || type == "function");
644
- }
645
- function isObjectLike(value) {
646
- return value != null && typeof value == "object";
647
- }
648
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
649
- function keys(object) {
650
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
651
- }
652
- function stubArray() {
653
- return [];
654
- }
655
- function stubFalse() {
656
- return false;
657
- }
658
- module.exports = isEqual2;
659
- })(lodash_isequal, lodash_isequal.exports);
660
- return lodash_isequal.exports;
661
- }
662
- var lodash_isequalExports = requireLodash_isequal();
663
- const isEqual = /* @__PURE__ */ getDefaultExportFromCjs(lodash_isequalExports);
1
+ import { useCallback, useRef, useState } from "react";
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
21
+ value: mod,
22
+ enumerable: true
23
+ }) : target, mod));
24
+ //#endregion
25
+ //#region src/use-combined-state/useCombinedState.tsx
26
+ var import_lodash_isequal = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
27
+ /**
28
+ * Lodash (Custom Build) <https://lodash.com/>
29
+ * Build: `lodash modularize exports="npm" -o ./`
30
+ * Copyright JS Foundation and other contributors <https://js.foundation/>
31
+ * Released under MIT license <https://lodash.com/license>
32
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
33
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
34
+ */
35
+ /** Used as the size to enable large array optimizations. */
36
+ var LARGE_ARRAY_SIZE = 200;
37
+ /** Used to stand-in for `undefined` hash values. */
38
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
39
+ /** Used to compose bitmasks for value comparisons. */
40
+ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
41
+ /** Used as references for various `Number` constants. */
42
+ var MAX_SAFE_INTEGER = 9007199254740991;
43
+ /** `Object#toString` result references. */
44
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]";
45
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
46
+ /**
47
+ * Used to match `RegExp`
48
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
49
+ */
50
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
51
+ /** Used to detect host constructors (Safari). */
52
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
53
+ /** Used to detect unsigned integer values. */
54
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
55
+ /** Used to identify `toStringTag` values of typed arrays. */
56
+ var typedArrayTags = {};
57
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
58
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
59
+ /** Detect free variable `global` from Node.js. */
60
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
61
+ /** Detect free variable `self`. */
62
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
63
+ /** Used as a reference to the global object. */
64
+ var root = freeGlobal || freeSelf || Function("return this")();
65
+ /** Detect free variable `exports`. */
66
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
67
+ /** Detect free variable `module`. */
68
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
69
+ /** Detect the popular CommonJS extension `module.exports`. */
70
+ var moduleExports = freeModule && freeModule.exports === freeExports;
71
+ /** Detect free variable `process` from Node.js. */
72
+ var freeProcess = moduleExports && freeGlobal.process;
73
+ /** Used to access faster Node.js helpers. */
74
+ var nodeUtil = function() {
75
+ try {
76
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
77
+ } catch (e) {}
78
+ }();
79
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
80
+ /**
81
+ * A specialized version of `_.filter` for arrays without support for
82
+ * iteratee shorthands.
83
+ *
84
+ * @private
85
+ * @param {Array} [array] The array to iterate over.
86
+ * @param {Function} predicate The function invoked per iteration.
87
+ * @returns {Array} Returns the new filtered array.
88
+ */
89
+ function arrayFilter(array, predicate) {
90
+ var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
91
+ while (++index < length) {
92
+ var value = array[index];
93
+ if (predicate(value, index, array)) result[resIndex++] = value;
94
+ }
95
+ return result;
96
+ }
97
+ /**
98
+ * Appends the elements of `values` to `array`.
99
+ *
100
+ * @private
101
+ * @param {Array} array The array to modify.
102
+ * @param {Array} values The values to append.
103
+ * @returns {Array} Returns `array`.
104
+ */
105
+ function arrayPush(array, values) {
106
+ var index = -1, length = values.length, offset = array.length;
107
+ while (++index < length) array[offset + index] = values[index];
108
+ return array;
109
+ }
110
+ /**
111
+ * A specialized version of `_.some` for arrays without support for iteratee
112
+ * shorthands.
113
+ *
114
+ * @private
115
+ * @param {Array} [array] The array to iterate over.
116
+ * @param {Function} predicate The function invoked per iteration.
117
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
118
+ * else `false`.
119
+ */
120
+ function arraySome(array, predicate) {
121
+ var index = -1, length = array == null ? 0 : array.length;
122
+ while (++index < length) if (predicate(array[index], index, array)) return true;
123
+ return false;
124
+ }
125
+ /**
126
+ * The base implementation of `_.times` without support for iteratee shorthands
127
+ * or max array length checks.
128
+ *
129
+ * @private
130
+ * @param {number} n The number of times to invoke `iteratee`.
131
+ * @param {Function} iteratee The function invoked per iteration.
132
+ * @returns {Array} Returns the array of results.
133
+ */
134
+ function baseTimes(n, iteratee) {
135
+ var index = -1, result = Array(n);
136
+ while (++index < n) result[index] = iteratee(index);
137
+ return result;
138
+ }
139
+ /**
140
+ * The base implementation of `_.unary` without support for storing metadata.
141
+ *
142
+ * @private
143
+ * @param {Function} func The function to cap arguments for.
144
+ * @returns {Function} Returns the new capped function.
145
+ */
146
+ function baseUnary(func) {
147
+ return function(value) {
148
+ return func(value);
149
+ };
150
+ }
151
+ /**
152
+ * Checks if a `cache` value for `key` exists.
153
+ *
154
+ * @private
155
+ * @param {Object} cache The cache to query.
156
+ * @param {string} key The key of the entry to check.
157
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
158
+ */
159
+ function cacheHas(cache, key) {
160
+ return cache.has(key);
161
+ }
162
+ /**
163
+ * Gets the value at `key` of `object`.
164
+ *
165
+ * @private
166
+ * @param {Object} [object] The object to query.
167
+ * @param {string} key The key of the property to get.
168
+ * @returns {*} Returns the property value.
169
+ */
170
+ function getValue(object, key) {
171
+ return object == null ? void 0 : object[key];
172
+ }
173
+ /**
174
+ * Converts `map` to its key-value pairs.
175
+ *
176
+ * @private
177
+ * @param {Object} map The map to convert.
178
+ * @returns {Array} Returns the key-value pairs.
179
+ */
180
+ function mapToArray(map) {
181
+ var index = -1, result = Array(map.size);
182
+ map.forEach(function(value, key) {
183
+ result[++index] = [key, value];
184
+ });
185
+ return result;
186
+ }
187
+ /**
188
+ * Creates a unary function that invokes `func` with its argument transformed.
189
+ *
190
+ * @private
191
+ * @param {Function} func The function to wrap.
192
+ * @param {Function} transform The argument transform.
193
+ * @returns {Function} Returns the new function.
194
+ */
195
+ function overArg(func, transform) {
196
+ return function(arg) {
197
+ return func(transform(arg));
198
+ };
199
+ }
200
+ /**
201
+ * Converts `set` to an array of its values.
202
+ *
203
+ * @private
204
+ * @param {Object} set The set to convert.
205
+ * @returns {Array} Returns the values.
206
+ */
207
+ function setToArray(set) {
208
+ var index = -1, result = Array(set.size);
209
+ set.forEach(function(value) {
210
+ result[++index] = value;
211
+ });
212
+ return result;
213
+ }
214
+ /** Used for built-in method references. */
215
+ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
216
+ /** Used to detect overreaching core-js shims. */
217
+ var coreJsData = root["__core-js_shared__"];
218
+ /** Used to resolve the decompiled source of functions. */
219
+ var funcToString = funcProto.toString;
220
+ /** Used to check objects for own properties. */
221
+ var hasOwnProperty = objectProto.hasOwnProperty;
222
+ /** Used to detect methods masquerading as native. */
223
+ var maskSrcKey = function() {
224
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
225
+ return uid ? "Symbol(src)_1." + uid : "";
226
+ }();
227
+ /**
228
+ * Used to resolve the
229
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
230
+ * of values.
231
+ */
232
+ var nativeObjectToString = objectProto.toString;
233
+ /** Used to detect if a method is native. */
234
+ var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
235
+ /** Built-in value references. */
236
+ var Buffer = moduleExports ? root.Buffer : void 0, Symbol = root.Symbol, Uint8Array = root.Uint8Array, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol ? Symbol.toStringTag : void 0;
237
+ var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object);
238
+ var DataView = getNative(root, "DataView"), Map = getNative(root, "Map"), Promise = getNative(root, "Promise"), Set = getNative(root, "Set"), WeakMap = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create");
239
+ /** Used to detect maps, sets, and weakmaps. */
240
+ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
241
+ /** Used to convert symbols to primitives and strings. */
242
+ var symbolProto = Symbol ? Symbol.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
243
+ /**
244
+ * Creates a hash object.
245
+ *
246
+ * @private
247
+ * @constructor
248
+ * @param {Array} [entries] The key-value pairs to cache.
249
+ */
250
+ function Hash(entries) {
251
+ var index = -1, length = entries == null ? 0 : entries.length;
252
+ this.clear();
253
+ while (++index < length) {
254
+ var entry = entries[index];
255
+ this.set(entry[0], entry[1]);
256
+ }
257
+ }
258
+ /**
259
+ * Removes all key-value entries from the hash.
260
+ *
261
+ * @private
262
+ * @name clear
263
+ * @memberOf Hash
264
+ */
265
+ function hashClear() {
266
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
267
+ this.size = 0;
268
+ }
269
+ /**
270
+ * Removes `key` and its value from the hash.
271
+ *
272
+ * @private
273
+ * @name delete
274
+ * @memberOf Hash
275
+ * @param {Object} hash The hash to modify.
276
+ * @param {string} key The key of the value to remove.
277
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
278
+ */
279
+ function hashDelete(key) {
280
+ var result = this.has(key) && delete this.__data__[key];
281
+ this.size -= result ? 1 : 0;
282
+ return result;
283
+ }
284
+ /**
285
+ * Gets the hash value for `key`.
286
+ *
287
+ * @private
288
+ * @name get
289
+ * @memberOf Hash
290
+ * @param {string} key The key of the value to get.
291
+ * @returns {*} Returns the entry value.
292
+ */
293
+ function hashGet(key) {
294
+ var data = this.__data__;
295
+ if (nativeCreate) {
296
+ var result = data[key];
297
+ return result === HASH_UNDEFINED ? void 0 : result;
298
+ }
299
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
300
+ }
301
+ /**
302
+ * Checks if a hash value for `key` exists.
303
+ *
304
+ * @private
305
+ * @name has
306
+ * @memberOf Hash
307
+ * @param {string} key The key of the entry to check.
308
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
309
+ */
310
+ function hashHas(key) {
311
+ var data = this.__data__;
312
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
313
+ }
314
+ /**
315
+ * Sets the hash `key` to `value`.
316
+ *
317
+ * @private
318
+ * @name set
319
+ * @memberOf Hash
320
+ * @param {string} key The key of the value to set.
321
+ * @param {*} value The value to set.
322
+ * @returns {Object} Returns the hash instance.
323
+ */
324
+ function hashSet(key, value) {
325
+ var data = this.__data__;
326
+ this.size += this.has(key) ? 0 : 1;
327
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
328
+ return this;
329
+ }
330
+ Hash.prototype.clear = hashClear;
331
+ Hash.prototype["delete"] = hashDelete;
332
+ Hash.prototype.get = hashGet;
333
+ Hash.prototype.has = hashHas;
334
+ Hash.prototype.set = hashSet;
335
+ /**
336
+ * Creates an list cache object.
337
+ *
338
+ * @private
339
+ * @constructor
340
+ * @param {Array} [entries] The key-value pairs to cache.
341
+ */
342
+ function ListCache(entries) {
343
+ var index = -1, length = entries == null ? 0 : entries.length;
344
+ this.clear();
345
+ while (++index < length) {
346
+ var entry = entries[index];
347
+ this.set(entry[0], entry[1]);
348
+ }
349
+ }
350
+ /**
351
+ * Removes all key-value entries from the list cache.
352
+ *
353
+ * @private
354
+ * @name clear
355
+ * @memberOf ListCache
356
+ */
357
+ function listCacheClear() {
358
+ this.__data__ = [];
359
+ this.size = 0;
360
+ }
361
+ /**
362
+ * Removes `key` and its value from the list cache.
363
+ *
364
+ * @private
365
+ * @name delete
366
+ * @memberOf ListCache
367
+ * @param {string} key The key of the value to remove.
368
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
369
+ */
370
+ function listCacheDelete(key) {
371
+ var data = this.__data__, index = assocIndexOf(data, key);
372
+ if (index < 0) return false;
373
+ if (index == data.length - 1) data.pop();
374
+ else splice.call(data, index, 1);
375
+ --this.size;
376
+ return true;
377
+ }
378
+ /**
379
+ * Gets the list cache value for `key`.
380
+ *
381
+ * @private
382
+ * @name get
383
+ * @memberOf ListCache
384
+ * @param {string} key The key of the value to get.
385
+ * @returns {*} Returns the entry value.
386
+ */
387
+ function listCacheGet(key) {
388
+ var data = this.__data__, index = assocIndexOf(data, key);
389
+ return index < 0 ? void 0 : data[index][1];
390
+ }
391
+ /**
392
+ * Checks if a list cache value for `key` exists.
393
+ *
394
+ * @private
395
+ * @name has
396
+ * @memberOf ListCache
397
+ * @param {string} key The key of the entry to check.
398
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
399
+ */
400
+ function listCacheHas(key) {
401
+ return assocIndexOf(this.__data__, key) > -1;
402
+ }
403
+ /**
404
+ * Sets the list cache `key` to `value`.
405
+ *
406
+ * @private
407
+ * @name set
408
+ * @memberOf ListCache
409
+ * @param {string} key The key of the value to set.
410
+ * @param {*} value The value to set.
411
+ * @returns {Object} Returns the list cache instance.
412
+ */
413
+ function listCacheSet(key, value) {
414
+ var data = this.__data__, index = assocIndexOf(data, key);
415
+ if (index < 0) {
416
+ ++this.size;
417
+ data.push([key, value]);
418
+ } else data[index][1] = value;
419
+ return this;
420
+ }
421
+ ListCache.prototype.clear = listCacheClear;
422
+ ListCache.prototype["delete"] = listCacheDelete;
423
+ ListCache.prototype.get = listCacheGet;
424
+ ListCache.prototype.has = listCacheHas;
425
+ ListCache.prototype.set = listCacheSet;
426
+ /**
427
+ * Creates a map cache object to store key-value pairs.
428
+ *
429
+ * @private
430
+ * @constructor
431
+ * @param {Array} [entries] The key-value pairs to cache.
432
+ */
433
+ function MapCache(entries) {
434
+ var index = -1, length = entries == null ? 0 : entries.length;
435
+ this.clear();
436
+ while (++index < length) {
437
+ var entry = entries[index];
438
+ this.set(entry[0], entry[1]);
439
+ }
440
+ }
441
+ /**
442
+ * Removes all key-value entries from the map.
443
+ *
444
+ * @private
445
+ * @name clear
446
+ * @memberOf MapCache
447
+ */
448
+ function mapCacheClear() {
449
+ this.size = 0;
450
+ this.__data__ = {
451
+ "hash": new Hash(),
452
+ "map": new (Map || ListCache)(),
453
+ "string": new Hash()
454
+ };
455
+ }
456
+ /**
457
+ * Removes `key` and its value from the map.
458
+ *
459
+ * @private
460
+ * @name delete
461
+ * @memberOf MapCache
462
+ * @param {string} key The key of the value to remove.
463
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
464
+ */
465
+ function mapCacheDelete(key) {
466
+ var result = getMapData(this, key)["delete"](key);
467
+ this.size -= result ? 1 : 0;
468
+ return result;
469
+ }
470
+ /**
471
+ * Gets the map value for `key`.
472
+ *
473
+ * @private
474
+ * @name get
475
+ * @memberOf MapCache
476
+ * @param {string} key The key of the value to get.
477
+ * @returns {*} Returns the entry value.
478
+ */
479
+ function mapCacheGet(key) {
480
+ return getMapData(this, key).get(key);
481
+ }
482
+ /**
483
+ * Checks if a map value for `key` exists.
484
+ *
485
+ * @private
486
+ * @name has
487
+ * @memberOf MapCache
488
+ * @param {string} key The key of the entry to check.
489
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
490
+ */
491
+ function mapCacheHas(key) {
492
+ return getMapData(this, key).has(key);
493
+ }
494
+ /**
495
+ * Sets the map `key` to `value`.
496
+ *
497
+ * @private
498
+ * @name set
499
+ * @memberOf MapCache
500
+ * @param {string} key The key of the value to set.
501
+ * @param {*} value The value to set.
502
+ * @returns {Object} Returns the map cache instance.
503
+ */
504
+ function mapCacheSet(key, value) {
505
+ var data = getMapData(this, key), size = data.size;
506
+ data.set(key, value);
507
+ this.size += data.size == size ? 0 : 1;
508
+ return this;
509
+ }
510
+ MapCache.prototype.clear = mapCacheClear;
511
+ MapCache.prototype["delete"] = mapCacheDelete;
512
+ MapCache.prototype.get = mapCacheGet;
513
+ MapCache.prototype.has = mapCacheHas;
514
+ MapCache.prototype.set = mapCacheSet;
515
+ /**
516
+ *
517
+ * Creates an array cache object to store unique values.
518
+ *
519
+ * @private
520
+ * @constructor
521
+ * @param {Array} [values] The values to cache.
522
+ */
523
+ function SetCache(values) {
524
+ var index = -1, length = values == null ? 0 : values.length;
525
+ this.__data__ = new MapCache();
526
+ while (++index < length) this.add(values[index]);
527
+ }
528
+ /**
529
+ * Adds `value` to the array cache.
530
+ *
531
+ * @private
532
+ * @name add
533
+ * @memberOf SetCache
534
+ * @alias push
535
+ * @param {*} value The value to cache.
536
+ * @returns {Object} Returns the cache instance.
537
+ */
538
+ function setCacheAdd(value) {
539
+ this.__data__.set(value, HASH_UNDEFINED);
540
+ return this;
541
+ }
542
+ /**
543
+ * Checks if `value` is in the array cache.
544
+ *
545
+ * @private
546
+ * @name has
547
+ * @memberOf SetCache
548
+ * @param {*} value The value to search for.
549
+ * @returns {number} Returns `true` if `value` is found, else `false`.
550
+ */
551
+ function setCacheHas(value) {
552
+ return this.__data__.has(value);
553
+ }
554
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
555
+ SetCache.prototype.has = setCacheHas;
556
+ /**
557
+ * Creates a stack cache object to store key-value pairs.
558
+ *
559
+ * @private
560
+ * @constructor
561
+ * @param {Array} [entries] The key-value pairs to cache.
562
+ */
563
+ function Stack(entries) {
564
+ this.size = (this.__data__ = new ListCache(entries)).size;
565
+ }
566
+ /**
567
+ * Removes all key-value entries from the stack.
568
+ *
569
+ * @private
570
+ * @name clear
571
+ * @memberOf Stack
572
+ */
573
+ function stackClear() {
574
+ this.__data__ = new ListCache();
575
+ this.size = 0;
576
+ }
577
+ /**
578
+ * Removes `key` and its value from the stack.
579
+ *
580
+ * @private
581
+ * @name delete
582
+ * @memberOf Stack
583
+ * @param {string} key The key of the value to remove.
584
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
585
+ */
586
+ function stackDelete(key) {
587
+ var data = this.__data__, result = data["delete"](key);
588
+ this.size = data.size;
589
+ return result;
590
+ }
591
+ /**
592
+ * Gets the stack value for `key`.
593
+ *
594
+ * @private
595
+ * @name get
596
+ * @memberOf Stack
597
+ * @param {string} key The key of the value to get.
598
+ * @returns {*} Returns the entry value.
599
+ */
600
+ function stackGet(key) {
601
+ return this.__data__.get(key);
602
+ }
603
+ /**
604
+ * Checks if a stack value for `key` exists.
605
+ *
606
+ * @private
607
+ * @name has
608
+ * @memberOf Stack
609
+ * @param {string} key The key of the entry to check.
610
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
611
+ */
612
+ function stackHas(key) {
613
+ return this.__data__.has(key);
614
+ }
615
+ /**
616
+ * Sets the stack `key` to `value`.
617
+ *
618
+ * @private
619
+ * @name set
620
+ * @memberOf Stack
621
+ * @param {string} key The key of the value to set.
622
+ * @param {*} value The value to set.
623
+ * @returns {Object} Returns the stack cache instance.
624
+ */
625
+ function stackSet(key, value) {
626
+ var data = this.__data__;
627
+ if (data instanceof ListCache) {
628
+ var pairs = data.__data__;
629
+ if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
630
+ pairs.push([key, value]);
631
+ this.size = ++data.size;
632
+ return this;
633
+ }
634
+ data = this.__data__ = new MapCache(pairs);
635
+ }
636
+ data.set(key, value);
637
+ this.size = data.size;
638
+ return this;
639
+ }
640
+ Stack.prototype.clear = stackClear;
641
+ Stack.prototype["delete"] = stackDelete;
642
+ Stack.prototype.get = stackGet;
643
+ Stack.prototype.has = stackHas;
644
+ Stack.prototype.set = stackSet;
645
+ /**
646
+ * Creates an array of the enumerable property names of the array-like `value`.
647
+ *
648
+ * @private
649
+ * @param {*} value The value to query.
650
+ * @param {boolean} inherited Specify returning inherited property names.
651
+ * @returns {Array} Returns the array of property names.
652
+ */
653
+ function arrayLikeKeys(value, inherited) {
654
+ var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
655
+ for (var key in value) if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) result.push(key);
656
+ return result;
657
+ }
658
+ /**
659
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
660
+ *
661
+ * @private
662
+ * @param {Array} array The array to inspect.
663
+ * @param {*} key The key to search for.
664
+ * @returns {number} Returns the index of the matched value, else `-1`.
665
+ */
666
+ function assocIndexOf(array, key) {
667
+ var length = array.length;
668
+ while (length--) if (eq(array[length][0], key)) return length;
669
+ return -1;
670
+ }
671
+ /**
672
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
673
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
674
+ * symbols of `object`.
675
+ *
676
+ * @private
677
+ * @param {Object} object The object to query.
678
+ * @param {Function} keysFunc The function to get the keys of `object`.
679
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
680
+ * @returns {Array} Returns the array of property names and symbols.
681
+ */
682
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
683
+ var result = keysFunc(object);
684
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
685
+ }
686
+ /**
687
+ * The base implementation of `getTag` without fallbacks for buggy environments.
688
+ *
689
+ * @private
690
+ * @param {*} value The value to query.
691
+ * @returns {string} Returns the `toStringTag`.
692
+ */
693
+ function baseGetTag(value) {
694
+ if (value == null) return value === void 0 ? undefinedTag : nullTag;
695
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
696
+ }
697
+ /**
698
+ * The base implementation of `_.isArguments`.
699
+ *
700
+ * @private
701
+ * @param {*} value The value to check.
702
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
703
+ */
704
+ function baseIsArguments(value) {
705
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
706
+ }
707
+ /**
708
+ * The base implementation of `_.isEqual` which supports partial comparisons
709
+ * and tracks traversed objects.
710
+ *
711
+ * @private
712
+ * @param {*} value The value to compare.
713
+ * @param {*} other The other value to compare.
714
+ * @param {boolean} bitmask The bitmask flags.
715
+ * 1 - Unordered comparison
716
+ * 2 - Partial comparison
717
+ * @param {Function} [customizer] The function to customize comparisons.
718
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
719
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
720
+ */
721
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
722
+ if (value === other) return true;
723
+ if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) return value !== value && other !== other;
724
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
725
+ }
726
+ /**
727
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
728
+ * deep comparisons and tracks traversed objects enabling objects with circular
729
+ * references to be compared.
730
+ *
731
+ * @private
732
+ * @param {Object} object The object to compare.
733
+ * @param {Object} other The other object to compare.
734
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
735
+ * @param {Function} customizer The function to customize comparisons.
736
+ * @param {Function} equalFunc The function to determine equivalents of values.
737
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
738
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
739
+ */
740
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
741
+ var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
742
+ objTag = objTag == argsTag ? objectTag : objTag;
743
+ othTag = othTag == argsTag ? objectTag : othTag;
744
+ var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
745
+ if (isSameTag && isBuffer(object)) {
746
+ if (!isBuffer(other)) return false;
747
+ objIsArr = true;
748
+ objIsObj = false;
749
+ }
750
+ if (isSameTag && !objIsObj) {
751
+ stack || (stack = new Stack());
752
+ return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
753
+ }
754
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
755
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
756
+ if (objIsWrapped || othIsWrapped) {
757
+ var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
758
+ stack || (stack = new Stack());
759
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
760
+ }
761
+ }
762
+ if (!isSameTag) return false;
763
+ stack || (stack = new Stack());
764
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
765
+ }
766
+ /**
767
+ * The base implementation of `_.isNative` without bad shim checks.
768
+ *
769
+ * @private
770
+ * @param {*} value The value to check.
771
+ * @returns {boolean} Returns `true` if `value` is a native function,
772
+ * else `false`.
773
+ */
774
+ function baseIsNative(value) {
775
+ if (!isObject(value) || isMasked(value)) return false;
776
+ return (isFunction(value) ? reIsNative : reIsHostCtor).test(toSource(value));
777
+ }
778
+ /**
779
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
780
+ *
781
+ * @private
782
+ * @param {*} value The value to check.
783
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
784
+ */
785
+ function baseIsTypedArray(value) {
786
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
787
+ }
788
+ /**
789
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
790
+ *
791
+ * @private
792
+ * @param {Object} object The object to query.
793
+ * @returns {Array} Returns the array of property names.
794
+ */
795
+ function baseKeys(object) {
796
+ if (!isPrototype(object)) return nativeKeys(object);
797
+ var result = [];
798
+ for (var key in Object(object)) if (hasOwnProperty.call(object, key) && key != "constructor") result.push(key);
799
+ return result;
800
+ }
801
+ /**
802
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
803
+ * partial deep comparisons.
804
+ *
805
+ * @private
806
+ * @param {Array} array The array to compare.
807
+ * @param {Array} other The other array to compare.
808
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
809
+ * @param {Function} customizer The function to customize comparisons.
810
+ * @param {Function} equalFunc The function to determine equivalents of values.
811
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
812
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
813
+ */
814
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
815
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
816
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) return false;
817
+ var stacked = stack.get(array);
818
+ if (stacked && stack.get(other)) return stacked == other;
819
+ var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
820
+ stack.set(array, other);
821
+ stack.set(other, array);
822
+ while (++index < arrLength) {
823
+ var arrValue = array[index], othValue = other[index];
824
+ if (customizer) var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
825
+ if (compared !== void 0) {
826
+ if (compared) continue;
827
+ result = false;
828
+ break;
829
+ }
830
+ if (seen) {
831
+ if (!arraySome(other, function(othValue, othIndex) {
832
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) return seen.push(othIndex);
833
+ })) {
834
+ result = false;
835
+ break;
836
+ }
837
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
838
+ result = false;
839
+ break;
840
+ }
841
+ }
842
+ stack["delete"](array);
843
+ stack["delete"](other);
844
+ return result;
845
+ }
846
+ /**
847
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
848
+ * the same `toStringTag`.
849
+ *
850
+ * **Note:** This function only supports comparing values with tags of
851
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
852
+ *
853
+ * @private
854
+ * @param {Object} object The object to compare.
855
+ * @param {Object} other The other object to compare.
856
+ * @param {string} tag The `toStringTag` of the objects to compare.
857
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
858
+ * @param {Function} customizer The function to customize comparisons.
859
+ * @param {Function} equalFunc The function to determine equivalents of values.
860
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
861
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
862
+ */
863
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
864
+ switch (tag) {
865
+ case dataViewTag:
866
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) return false;
867
+ object = object.buffer;
868
+ other = other.buffer;
869
+ case arrayBufferTag:
870
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) return false;
871
+ return true;
872
+ case boolTag:
873
+ case dateTag:
874
+ case numberTag: return eq(+object, +other);
875
+ case errorTag: return object.name == other.name && object.message == other.message;
876
+ case regexpTag:
877
+ case stringTag: return object == other + "";
878
+ case mapTag: var convert = mapToArray;
879
+ case setTag:
880
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
881
+ convert || (convert = setToArray);
882
+ if (object.size != other.size && !isPartial) return false;
883
+ var stacked = stack.get(object);
884
+ if (stacked) return stacked == other;
885
+ bitmask |= COMPARE_UNORDERED_FLAG;
886
+ stack.set(object, other);
887
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
888
+ stack["delete"](object);
889
+ return result;
890
+ case symbolTag: if (symbolValueOf) return symbolValueOf.call(object) == symbolValueOf.call(other);
891
+ }
892
+ return false;
893
+ }
894
+ /**
895
+ * A specialized version of `baseIsEqualDeep` for objects with support for
896
+ * partial deep comparisons.
897
+ *
898
+ * @private
899
+ * @param {Object} object The object to compare.
900
+ * @param {Object} other The other object to compare.
901
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
902
+ * @param {Function} customizer The function to customize comparisons.
903
+ * @param {Function} equalFunc The function to determine equivalents of values.
904
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
905
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
906
+ */
907
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
908
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length;
909
+ if (objLength != getAllKeys(other).length && !isPartial) return false;
910
+ var index = objLength;
911
+ while (index--) {
912
+ var key = objProps[index];
913
+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) return false;
914
+ }
915
+ var stacked = stack.get(object);
916
+ if (stacked && stack.get(other)) return stacked == other;
917
+ var result = true;
918
+ stack.set(object, other);
919
+ stack.set(other, object);
920
+ var skipCtor = isPartial;
921
+ while (++index < objLength) {
922
+ key = objProps[index];
923
+ var objValue = object[key], othValue = other[key];
924
+ if (customizer) var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
925
+ if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
926
+ result = false;
927
+ break;
928
+ }
929
+ skipCtor || (skipCtor = key == "constructor");
930
+ }
931
+ if (result && !skipCtor) {
932
+ var objCtor = object.constructor, othCtor = other.constructor;
933
+ if (objCtor != othCtor && "constructor" in object && "constructor" in other && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) result = false;
934
+ }
935
+ stack["delete"](object);
936
+ stack["delete"](other);
937
+ return result;
938
+ }
939
+ /**
940
+ * Creates an array of own enumerable property names and symbols of `object`.
941
+ *
942
+ * @private
943
+ * @param {Object} object The object to query.
944
+ * @returns {Array} Returns the array of property names and symbols.
945
+ */
946
+ function getAllKeys(object) {
947
+ return baseGetAllKeys(object, keys, getSymbols);
948
+ }
949
+ /**
950
+ * Gets the data for `map`.
951
+ *
952
+ * @private
953
+ * @param {Object} map The map to query.
954
+ * @param {string} key The reference key.
955
+ * @returns {*} Returns the map data.
956
+ */
957
+ function getMapData(map, key) {
958
+ var data = map.__data__;
959
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
960
+ }
961
+ /**
962
+ * Gets the native function at `key` of `object`.
963
+ *
964
+ * @private
965
+ * @param {Object} object The object to query.
966
+ * @param {string} key The key of the method to get.
967
+ * @returns {*} Returns the function if it's native, else `undefined`.
968
+ */
969
+ function getNative(object, key) {
970
+ var value = getValue(object, key);
971
+ return baseIsNative(value) ? value : void 0;
972
+ }
973
+ /**
974
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
975
+ *
976
+ * @private
977
+ * @param {*} value The value to query.
978
+ * @returns {string} Returns the raw `toStringTag`.
979
+ */
980
+ function getRawTag(value) {
981
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
982
+ try {
983
+ value[symToStringTag] = void 0;
984
+ var unmasked = true;
985
+ } catch (e) {}
986
+ var result = nativeObjectToString.call(value);
987
+ if (unmasked) if (isOwn) value[symToStringTag] = tag;
988
+ else delete value[symToStringTag];
989
+ return result;
990
+ }
991
+ /**
992
+ * Creates an array of the own enumerable symbols of `object`.
993
+ *
994
+ * @private
995
+ * @param {Object} object The object to query.
996
+ * @returns {Array} Returns the array of symbols.
997
+ */
998
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
999
+ if (object == null) return [];
1000
+ object = Object(object);
1001
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
1002
+ return propertyIsEnumerable.call(object, symbol);
1003
+ });
1004
+ };
1005
+ /**
1006
+ * Gets the `toStringTag` of `value`.
1007
+ *
1008
+ * @private
1009
+ * @param {*} value The value to query.
1010
+ * @returns {string} Returns the `toStringTag`.
1011
+ */
1012
+ var getTag = baseGetTag;
1013
+ if (DataView && getTag(new DataView(/* @__PURE__ */ new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) getTag = function(value) {
1014
+ var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
1015
+ if (ctorString) switch (ctorString) {
1016
+ case dataViewCtorString: return dataViewTag;
1017
+ case mapCtorString: return mapTag;
1018
+ case promiseCtorString: return promiseTag;
1019
+ case setCtorString: return setTag;
1020
+ case weakMapCtorString: return weakMapTag;
1021
+ }
1022
+ return result;
1023
+ };
1024
+ /**
1025
+ * Checks if `value` is a valid array-like index.
1026
+ *
1027
+ * @private
1028
+ * @param {*} value The value to check.
1029
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1030
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1031
+ */
1032
+ function isIndex(value, length) {
1033
+ length = length == null ? MAX_SAFE_INTEGER : length;
1034
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
1035
+ }
1036
+ /**
1037
+ * Checks if `value` is suitable for use as unique object key.
1038
+ *
1039
+ * @private
1040
+ * @param {*} value The value to check.
1041
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1042
+ */
1043
+ function isKeyable(value) {
1044
+ var type = typeof value;
1045
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
1046
+ }
1047
+ /**
1048
+ * Checks if `func` has its source masked.
1049
+ *
1050
+ * @private
1051
+ * @param {Function} func The function to check.
1052
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1053
+ */
1054
+ function isMasked(func) {
1055
+ return !!maskSrcKey && maskSrcKey in func;
1056
+ }
1057
+ /**
1058
+ * Checks if `value` is likely a prototype object.
1059
+ *
1060
+ * @private
1061
+ * @param {*} value The value to check.
1062
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1063
+ */
1064
+ function isPrototype(value) {
1065
+ var Ctor = value && value.constructor;
1066
+ return value === (typeof Ctor == "function" && Ctor.prototype || objectProto);
1067
+ }
1068
+ /**
1069
+ * Converts `value` to a string using `Object.prototype.toString`.
1070
+ *
1071
+ * @private
1072
+ * @param {*} value The value to convert.
1073
+ * @returns {string} Returns the converted string.
1074
+ */
1075
+ function objectToString(value) {
1076
+ return nativeObjectToString.call(value);
1077
+ }
1078
+ /**
1079
+ * Converts `func` to its source code.
1080
+ *
1081
+ * @private
1082
+ * @param {Function} func The function to convert.
1083
+ * @returns {string} Returns the source code.
1084
+ */
1085
+ function toSource(func) {
1086
+ if (func != null) {
1087
+ try {
1088
+ return funcToString.call(func);
1089
+ } catch (e) {}
1090
+ try {
1091
+ return func + "";
1092
+ } catch (e) {}
1093
+ }
1094
+ return "";
1095
+ }
1096
+ /**
1097
+ * Performs a
1098
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1099
+ * comparison between two values to determine if they are equivalent.
1100
+ *
1101
+ * @static
1102
+ * @memberOf _
1103
+ * @since 4.0.0
1104
+ * @category Lang
1105
+ * @param {*} value The value to compare.
1106
+ * @param {*} other The other value to compare.
1107
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1108
+ * @example
1109
+ *
1110
+ * var object = { 'a': 1 };
1111
+ * var other = { 'a': 1 };
1112
+ *
1113
+ * _.eq(object, object);
1114
+ * // => true
1115
+ *
1116
+ * _.eq(object, other);
1117
+ * // => false
1118
+ *
1119
+ * _.eq('a', 'a');
1120
+ * // => true
1121
+ *
1122
+ * _.eq('a', Object('a'));
1123
+ * // => false
1124
+ *
1125
+ * _.eq(NaN, NaN);
1126
+ * // => true
1127
+ */
1128
+ function eq(value, other) {
1129
+ return value === other || value !== value && other !== other;
1130
+ }
1131
+ /**
1132
+ * Checks if `value` is likely an `arguments` object.
1133
+ *
1134
+ * @static
1135
+ * @memberOf _
1136
+ * @since 0.1.0
1137
+ * @category Lang
1138
+ * @param {*} value The value to check.
1139
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1140
+ * else `false`.
1141
+ * @example
1142
+ *
1143
+ * _.isArguments(function() { return arguments; }());
1144
+ * // => true
1145
+ *
1146
+ * _.isArguments([1, 2, 3]);
1147
+ * // => false
1148
+ */
1149
+ var isArguments = baseIsArguments(function() {
1150
+ return arguments;
1151
+ }()) ? baseIsArguments : function(value) {
1152
+ return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
1153
+ };
1154
+ /**
1155
+ * Checks if `value` is classified as an `Array` object.
1156
+ *
1157
+ * @static
1158
+ * @memberOf _
1159
+ * @since 0.1.0
1160
+ * @category Lang
1161
+ * @param {*} value The value to check.
1162
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1163
+ * @example
1164
+ *
1165
+ * _.isArray([1, 2, 3]);
1166
+ * // => true
1167
+ *
1168
+ * _.isArray(document.body.children);
1169
+ * // => false
1170
+ *
1171
+ * _.isArray('abc');
1172
+ * // => false
1173
+ *
1174
+ * _.isArray(_.noop);
1175
+ * // => false
1176
+ */
1177
+ var isArray = Array.isArray;
1178
+ /**
1179
+ * Checks if `value` is array-like. A value is considered array-like if it's
1180
+ * not a function and has a `value.length` that's an integer greater than or
1181
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1182
+ *
1183
+ * @static
1184
+ * @memberOf _
1185
+ * @since 4.0.0
1186
+ * @category Lang
1187
+ * @param {*} value The value to check.
1188
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1189
+ * @example
1190
+ *
1191
+ * _.isArrayLike([1, 2, 3]);
1192
+ * // => true
1193
+ *
1194
+ * _.isArrayLike(document.body.children);
1195
+ * // => true
1196
+ *
1197
+ * _.isArrayLike('abc');
1198
+ * // => true
1199
+ *
1200
+ * _.isArrayLike(_.noop);
1201
+ * // => false
1202
+ */
1203
+ function isArrayLike(value) {
1204
+ return value != null && isLength(value.length) && !isFunction(value);
1205
+ }
1206
+ /**
1207
+ * Checks if `value` is a buffer.
1208
+ *
1209
+ * @static
1210
+ * @memberOf _
1211
+ * @since 4.3.0
1212
+ * @category Lang
1213
+ * @param {*} value The value to check.
1214
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1215
+ * @example
1216
+ *
1217
+ * _.isBuffer(new Buffer(2));
1218
+ * // => true
1219
+ *
1220
+ * _.isBuffer(new Uint8Array(2));
1221
+ * // => false
1222
+ */
1223
+ var isBuffer = nativeIsBuffer || stubFalse;
1224
+ /**
1225
+ * Performs a deep comparison between two values to determine if they are
1226
+ * equivalent.
1227
+ *
1228
+ * **Note:** This method supports comparing arrays, array buffers, booleans,
1229
+ * date objects, error objects, maps, numbers, `Object` objects, regexes,
1230
+ * sets, strings, symbols, and typed arrays. `Object` objects are compared
1231
+ * by their own, not inherited, enumerable properties. Functions and DOM
1232
+ * nodes are compared by strict equality, i.e. `===`.
1233
+ *
1234
+ * @static
1235
+ * @memberOf _
1236
+ * @since 0.1.0
1237
+ * @category Lang
1238
+ * @param {*} value The value to compare.
1239
+ * @param {*} other The other value to compare.
1240
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1241
+ * @example
1242
+ *
1243
+ * var object = { 'a': 1 };
1244
+ * var other = { 'a': 1 };
1245
+ *
1246
+ * _.isEqual(object, other);
1247
+ * // => true
1248
+ *
1249
+ * object === other;
1250
+ * // => false
1251
+ */
1252
+ function isEqual(value, other) {
1253
+ return baseIsEqual(value, other);
1254
+ }
1255
+ /**
1256
+ * Checks if `value` is classified as a `Function` object.
1257
+ *
1258
+ * @static
1259
+ * @memberOf _
1260
+ * @since 0.1.0
1261
+ * @category Lang
1262
+ * @param {*} value The value to check.
1263
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1264
+ * @example
1265
+ *
1266
+ * _.isFunction(_);
1267
+ * // => true
1268
+ *
1269
+ * _.isFunction(/abc/);
1270
+ * // => false
1271
+ */
1272
+ function isFunction(value) {
1273
+ if (!isObject(value)) return false;
1274
+ var tag = baseGetTag(value);
1275
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1276
+ }
1277
+ /**
1278
+ * Checks if `value` is a valid array-like length.
1279
+ *
1280
+ * **Note:** This method is loosely based on
1281
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1282
+ *
1283
+ * @static
1284
+ * @memberOf _
1285
+ * @since 4.0.0
1286
+ * @category Lang
1287
+ * @param {*} value The value to check.
1288
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1289
+ * @example
1290
+ *
1291
+ * _.isLength(3);
1292
+ * // => true
1293
+ *
1294
+ * _.isLength(Number.MIN_VALUE);
1295
+ * // => false
1296
+ *
1297
+ * _.isLength(Infinity);
1298
+ * // => false
1299
+ *
1300
+ * _.isLength('3');
1301
+ * // => false
1302
+ */
1303
+ function isLength(value) {
1304
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1305
+ }
1306
+ /**
1307
+ * Checks if `value` is the
1308
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1309
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1310
+ *
1311
+ * @static
1312
+ * @memberOf _
1313
+ * @since 0.1.0
1314
+ * @category Lang
1315
+ * @param {*} value The value to check.
1316
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1317
+ * @example
1318
+ *
1319
+ * _.isObject({});
1320
+ * // => true
1321
+ *
1322
+ * _.isObject([1, 2, 3]);
1323
+ * // => true
1324
+ *
1325
+ * _.isObject(_.noop);
1326
+ * // => true
1327
+ *
1328
+ * _.isObject(null);
1329
+ * // => false
1330
+ */
1331
+ function isObject(value) {
1332
+ var type = typeof value;
1333
+ return value != null && (type == "object" || type == "function");
1334
+ }
1335
+ /**
1336
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1337
+ * and has a `typeof` result of "object".
1338
+ *
1339
+ * @static
1340
+ * @memberOf _
1341
+ * @since 4.0.0
1342
+ * @category Lang
1343
+ * @param {*} value The value to check.
1344
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1345
+ * @example
1346
+ *
1347
+ * _.isObjectLike({});
1348
+ * // => true
1349
+ *
1350
+ * _.isObjectLike([1, 2, 3]);
1351
+ * // => true
1352
+ *
1353
+ * _.isObjectLike(_.noop);
1354
+ * // => false
1355
+ *
1356
+ * _.isObjectLike(null);
1357
+ * // => false
1358
+ */
1359
+ function isObjectLike(value) {
1360
+ return value != null && typeof value == "object";
1361
+ }
1362
+ /**
1363
+ * Checks if `value` is classified as a typed array.
1364
+ *
1365
+ * @static
1366
+ * @memberOf _
1367
+ * @since 3.0.0
1368
+ * @category Lang
1369
+ * @param {*} value The value to check.
1370
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1371
+ * @example
1372
+ *
1373
+ * _.isTypedArray(new Uint8Array);
1374
+ * // => true
1375
+ *
1376
+ * _.isTypedArray([]);
1377
+ * // => false
1378
+ */
1379
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1380
+ /**
1381
+ * Creates an array of the own enumerable property names of `object`.
1382
+ *
1383
+ * **Note:** Non-object values are coerced to objects. See the
1384
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1385
+ * for more details.
1386
+ *
1387
+ * @static
1388
+ * @since 0.1.0
1389
+ * @memberOf _
1390
+ * @category Object
1391
+ * @param {Object} object The object to query.
1392
+ * @returns {Array} Returns the array of property names.
1393
+ * @example
1394
+ *
1395
+ * function Foo() {
1396
+ * this.a = 1;
1397
+ * this.b = 2;
1398
+ * }
1399
+ *
1400
+ * Foo.prototype.c = 3;
1401
+ *
1402
+ * _.keys(new Foo);
1403
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1404
+ *
1405
+ * _.keys('hi');
1406
+ * // => ['0', '1']
1407
+ */
1408
+ function keys(object) {
1409
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1410
+ }
1411
+ /**
1412
+ * This method returns a new empty array.
1413
+ *
1414
+ * @static
1415
+ * @memberOf _
1416
+ * @since 4.13.0
1417
+ * @category Util
1418
+ * @returns {Array} Returns the new empty array.
1419
+ * @example
1420
+ *
1421
+ * var arrays = _.times(2, _.stubArray);
1422
+ *
1423
+ * console.log(arrays);
1424
+ * // => [[], []]
1425
+ *
1426
+ * console.log(arrays[0] === arrays[1]);
1427
+ * // => false
1428
+ */
1429
+ function stubArray() {
1430
+ return [];
1431
+ }
1432
+ /**
1433
+ * This method returns `false`.
1434
+ *
1435
+ * @static
1436
+ * @memberOf _
1437
+ * @since 4.13.0
1438
+ * @category Util
1439
+ * @returns {boolean} Returns `false`.
1440
+ * @example
1441
+ *
1442
+ * _.times(2, _.stubFalse);
1443
+ * // => [false, false]
1444
+ */
1445
+ function stubFalse() {
1446
+ return false;
1447
+ }
1448
+ module.exports = isEqual;
1449
+ })))());
1450
+ /**
1451
+ * This hook must be used when a component has both a controlled and uncontrolled mode.
1452
+ * It will take care of updating the state value when a controlled mode (prop) is updated.
1453
+ */
664
1454
  function useCombinedState(controlledValue, defaultValue, onChange) {
665
- const isControlled = controlledValue !== void 0;
666
- const { current: initialValue } = useRef(isControlled ? controlledValue : defaultValue);
667
- const [innerValue, setInnerValue] = useState(defaultValue);
668
- const value = isControlled ? controlledValue : innerValue;
669
- const updater = useCallback(
670
- (next, shouldUpdateProp = (prevValue, nextValue) => !isEqual(prevValue, nextValue)) => {
671
- const nextValue = typeof next !== "function" ? next : next(value);
672
- const shouldUpdate = shouldUpdateProp(value, nextValue);
673
- if (shouldUpdate && !isControlled) {
674
- setInnerValue(nextValue);
675
- }
676
- onChange && onChange(nextValue);
677
- },
678
- [isControlled, value, onChange]
679
- );
680
- return [value, updater, isControlled, initialValue];
1455
+ const isControlled = controlledValue !== void 0;
1456
+ const { current: initialValue } = useRef(isControlled ? controlledValue : defaultValue);
1457
+ const [innerValue, setInnerValue] = useState(defaultValue);
1458
+ const value = isControlled ? controlledValue : innerValue;
1459
+ return [
1460
+ value,
1461
+ useCallback((next, shouldUpdateProp = (prevValue, nextValue) => !(0, import_lodash_isequal.default)(prevValue, nextValue)) => {
1462
+ const nextValue = typeof next !== "function" ? next : next(value);
1463
+ if (shouldUpdateProp(value, nextValue) && !isControlled) setInnerValue(nextValue);
1464
+ onChange && onChange(nextValue);
1465
+ }, [
1466
+ isControlled,
1467
+ value,
1468
+ onChange
1469
+ ]),
1470
+ isControlled,
1471
+ initialValue
1472
+ ];
681
1473
  }
682
- export {
683
- useCombinedState
684
- };
685
- //# sourceMappingURL=index.mjs.map
1474
+ //#endregion
1475
+ export { useCombinedState };
1476
+
1477
+ //# sourceMappingURL=index.mjs.map