@jobber/hooks 2.17.4 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/index.cjs +49 -0
  2. package/dist/index.mjs +23 -0
  3. package/dist/isObjectLike-cjs.js +228 -0
  4. package/dist/isObjectLike-es.js +219 -0
  5. package/dist/useBool/index.cjs +8 -0
  6. package/dist/useBool/index.mjs +2 -0
  7. package/dist/useBool-cjs.js +13 -0
  8. package/dist/useBool-es.js +11 -0
  9. package/dist/useBreakpoints/index.cjs +11 -0
  10. package/dist/useBreakpoints/index.mjs +3 -0
  11. package/dist/useBreakpoints/mockViewportWidth/{mockViewportWidth.js → index.cjs} +5 -4
  12. package/dist/useBreakpoints/mockViewportWidth/index.mjs +66 -0
  13. package/dist/useBreakpoints-cjs.js +48 -0
  14. package/dist/useBreakpoints-es.js +45 -0
  15. package/dist/useCallbackRef/index.cjs +8 -0
  16. package/dist/useCallbackRef/index.mjs +2 -0
  17. package/dist/useCallbackRef-cjs.js +17 -0
  18. package/dist/useCallbackRef-es.js +15 -0
  19. package/dist/useCollectionQuery/index.cjs +13 -0
  20. package/dist/useCollectionQuery/index.mjs +7 -0
  21. package/dist/useCollectionQuery/useCollectionQuery.d.ts +1 -1
  22. package/dist/useCollectionQuery-cjs.js +2842 -0
  23. package/dist/useCollectionQuery-es.js +2821 -0
  24. package/dist/useDebounce/index.cjs +9 -0
  25. package/dist/useDebounce/index.mjs +3 -0
  26. package/dist/useDebounce-cjs.js +92 -0
  27. package/dist/useDebounce-es.js +90 -0
  28. package/dist/useFocusTrap/index.cjs +8 -0
  29. package/dist/useFocusTrap/index.mjs +2 -0
  30. package/dist/{useFocusTrap/useFocusTrap.js → useFocusTrap-cjs.js} +8 -6
  31. package/dist/useFocusTrap-es.js +68 -0
  32. package/dist/useFormState/index.cjs +8 -0
  33. package/dist/useFormState/index.mjs +2 -0
  34. package/dist/useFormState-cjs.js +13 -0
  35. package/dist/useFormState-es.js +11 -0
  36. package/dist/useInView/index.cjs +8 -0
  37. package/dist/useInView/index.mjs +2 -0
  38. package/dist/{useInView/useInView.js → useInView-cjs.js} +10 -8
  39. package/dist/useInView-es.js +19 -0
  40. package/dist/useIsMounted/index.cjs +9 -0
  41. package/dist/useIsMounted/index.mjs +3 -0
  42. package/dist/{useIsMounted/useIsMounted.js → useIsMounted-cjs.js} +9 -7
  43. package/dist/useIsMounted-es.js +34 -0
  44. package/dist/useLiveAnnounce/index.cjs +8 -0
  45. package/dist/useLiveAnnounce/index.mjs +2 -0
  46. package/dist/{useLiveAnnounce/useLiveAnnounce.js → useLiveAnnounce-cjs.js} +8 -6
  47. package/dist/useLiveAnnounce-es.js +41 -0
  48. package/dist/useOnKeyDown/index.cjs +8 -0
  49. package/dist/useOnKeyDown/index.mjs +2 -0
  50. package/dist/{useOnKeyDown/useOnKeyDown.js → useOnKeyDown-cjs.js} +7 -5
  51. package/dist/useOnKeyDown-es.js +34 -0
  52. package/dist/useOnMount/index.cjs +9 -0
  53. package/dist/useOnMount/index.mjs +3 -0
  54. package/dist/{useOnMount/useOnMount.js → useOnMount-cjs.js} +9 -8
  55. package/dist/useOnMount-es.js +19 -0
  56. package/dist/useRefocusOnActivator/index.cjs +8 -0
  57. package/dist/useRefocusOnActivator/index.mjs +2 -0
  58. package/dist/{useRefocusOnActivator/useRefocusOnActivator.js → useRefocusOnActivator-cjs.js} +7 -5
  59. package/dist/useRefocusOnActivator-es.js +26 -0
  60. package/dist/useResizeObserver/index.cjs +10 -0
  61. package/dist/useResizeObserver/index.mjs +3 -0
  62. package/dist/useResizeObserver-cjs.js +1519 -0
  63. package/dist/useResizeObserver-es.js +1516 -0
  64. package/dist/useSafeLayoutEffect/index.cjs +8 -0
  65. package/dist/useSafeLayoutEffect/index.mjs +2 -0
  66. package/dist/useSafeLayoutEffect-cjs.js +9 -0
  67. package/dist/useSafeLayoutEffect-es.js +7 -0
  68. package/dist/useShowClear/{useShowClear.js → index.cjs} +4 -3
  69. package/dist/useShowClear/index.mjs +17 -0
  70. package/dist/useStepper/index.cjs +8 -0
  71. package/dist/useStepper/index.mjs +2 -0
  72. package/dist/{useStepper/useStepper.js → useStepper-cjs.js} +26 -14
  73. package/dist/useStepper-es.js +51 -0
  74. package/dist/useWindowDimensions/index.cjs +8 -0
  75. package/dist/useWindowDimensions/index.mjs +2 -0
  76. package/dist/{useWindowDimensions/useWindowDimensions.js → useWindowDimensions-cjs.js} +8 -6
  77. package/dist/useWindowDimensions-es.js +28 -0
  78. package/package.json +109 -7
  79. package/dist/index.js +0 -34
  80. package/dist/useBool/index.js +0 -5
  81. package/dist/useBool/useBool.js +0 -11
  82. package/dist/useBool/useBool.test.d.ts +0 -1
  83. package/dist/useBool/useBool.test.js +0 -28
  84. package/dist/useBreakpoints/index.js +0 -20
  85. package/dist/useBreakpoints/mockViewportWidth/index.js +0 -17
  86. package/dist/useBreakpoints/mockViewportWidth/mockViewportWidth.test.d.ts +0 -1
  87. package/dist/useBreakpoints/mockViewportWidth/mockViewportWidth.test.js +0 -17
  88. package/dist/useBreakpoints/useBreakpoints.js +0 -28
  89. package/dist/useBreakpoints/useBreakpoints.test.d.ts +0 -1
  90. package/dist/useBreakpoints/useBreakpoints.test.js +0 -142
  91. package/dist/useBreakpoints/useMediaQuery.js +0 -22
  92. package/dist/useCallbackRef/index.js +0 -5
  93. package/dist/useCallbackRef/useCallbackRef.js +0 -15
  94. package/dist/useCallbackRef/useCallbackRef.test.d.ts +0 -1
  95. package/dist/useCallbackRef/useCallbackRef.test.js +0 -29
  96. package/dist/useCollectionQuery/index.js +0 -5
  97. package/dist/useCollectionQuery/mdxUtils.js +0 -152
  98. package/dist/useCollectionQuery/test-utilities/index.d.ts +0 -3
  99. package/dist/useCollectionQuery/test-utilities/index.js +0 -19
  100. package/dist/useCollectionQuery/test-utilities/mocks.d.ts +0 -106
  101. package/dist/useCollectionQuery/test-utilities/mocks.js +0 -131
  102. package/dist/useCollectionQuery/test-utilities/queries.d.ts +0 -37
  103. package/dist/useCollectionQuery/test-utilities/queries.js +0 -59
  104. package/dist/useCollectionQuery/test-utilities/utils.d.ts +0 -1
  105. package/dist/useCollectionQuery/test-utilities/utils.js +0 -17
  106. package/dist/useCollectionQuery/uniqueEdges.js +0 -18
  107. package/dist/useCollectionQuery/uniqueNodes.js +0 -10
  108. package/dist/useCollectionQuery/useCollectionQuery.js +0 -194
  109. package/dist/useCollectionQuery/useCollectionQuery.test.d.ts +0 -1
  110. package/dist/useCollectionQuery/useCollectionQuery.test.js +0 -357
  111. package/dist/useDebounce/index.js +0 -5
  112. package/dist/useDebounce/useDebounce.js +0 -29
  113. package/dist/useDebounce/useDebounce.test.d.ts +0 -1
  114. package/dist/useDebounce/useDebounce.test.js +0 -190
  115. package/dist/useFocusTrap/index.js +0 -5
  116. package/dist/useFocusTrap/useFocusTrap.test.d.ts +0 -1
  117. package/dist/useFocusTrap/useFocusTrap.test.js +0 -61
  118. package/dist/useFormState/index.js +0 -5
  119. package/dist/useFormState/useFormState.js +0 -11
  120. package/dist/useInView/index.js +0 -17
  121. package/dist/useInView/useInView.test.d.ts +0 -1
  122. package/dist/useInView/useInView.test.js +0 -29
  123. package/dist/useIsMounted/index.js +0 -5
  124. package/dist/useIsMounted/useIsMounted.test.d.ts +0 -1
  125. package/dist/useIsMounted/useIsMounted.test.js +0 -15
  126. package/dist/useLiveAnnounce/index.js +0 -5
  127. package/dist/useLiveAnnounce/useLiveAnnounce.test.d.ts +0 -1
  128. package/dist/useLiveAnnounce/useLiveAnnounce.test.js +0 -60
  129. package/dist/useOnKeyDown/index.js +0 -5
  130. package/dist/useOnKeyDown/useOnKeyDown.test.d.ts +0 -1
  131. package/dist/useOnKeyDown/useOnKeyDown.test.js +0 -23
  132. package/dist/useOnMount/index.js +0 -5
  133. package/dist/useOnMount/useOnMount.test.d.ts +0 -1
  134. package/dist/useOnMount/useOnMount.test.js +0 -18
  135. package/dist/useRefocusOnActivator/index.js +0 -5
  136. package/dist/useResizeObserver/index.js +0 -17
  137. package/dist/useResizeObserver/useResizeObserver.js +0 -68
  138. package/dist/useSafeLayoutEffect/index.js +0 -5
  139. package/dist/useSafeLayoutEffect/useSafeLayoutEffect.js +0 -7
  140. package/dist/useShowClear/index.js +0 -5
  141. package/dist/useShowClear/useShowClear.test.d.ts +0 -1
  142. package/dist/useShowClear/useShowClear.test.js +0 -210
  143. package/dist/useStepper/index.js +0 -5
  144. package/dist/useStepper/useStepper.test.d.ts +0 -1
  145. package/dist/useStepper/useStepper.test.js +0 -79
  146. package/dist/useWindowDimensions/index.js +0 -5
  147. package/dist/useWindowDimensions/useWIndowDimensions.test.d.ts +0 -1
  148. package/dist/useWindowDimensions/useWIndowDimensions.test.js +0 -23
@@ -0,0 +1,2842 @@
1
+ 'use strict';
2
+
3
+ var apolloClient = require('@apollo/client');
4
+ var isObjectLike$5 = require('./isObjectLike-cjs.js');
5
+ var require$$1 = require('react');
6
+ var formatters = require('@jobber/formatters');
7
+ var useIsMounted = require('./useIsMounted-cjs.js');
8
+
9
+ function _interopNamespaceDefault(e) {
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n.default = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var apolloClient__namespace = /*#__PURE__*/_interopNamespaceDefault(apolloClient);
27
+
28
+ /**
29
+ * Removes all key-value entries from the list cache.
30
+ *
31
+ * @private
32
+ * @name clear
33
+ * @memberOf ListCache
34
+ */
35
+
36
+ function listCacheClear$1() {
37
+ this.__data__ = [];
38
+ this.size = 0;
39
+ }
40
+
41
+ var _listCacheClear = listCacheClear$1;
42
+
43
+ /**
44
+ * Performs a
45
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
46
+ * comparison between two values to determine if they are equivalent.
47
+ *
48
+ * @static
49
+ * @memberOf _
50
+ * @since 4.0.0
51
+ * @category Lang
52
+ * @param {*} value The value to compare.
53
+ * @param {*} other The other value to compare.
54
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
55
+ * @example
56
+ *
57
+ * var object = { 'a': 1 };
58
+ * var other = { 'a': 1 };
59
+ *
60
+ * _.eq(object, object);
61
+ * // => true
62
+ *
63
+ * _.eq(object, other);
64
+ * // => false
65
+ *
66
+ * _.eq('a', 'a');
67
+ * // => true
68
+ *
69
+ * _.eq('a', Object('a'));
70
+ * // => false
71
+ *
72
+ * _.eq(NaN, NaN);
73
+ * // => true
74
+ */
75
+
76
+ function eq$2(value, other) {
77
+ return value === other || (value !== value && other !== other);
78
+ }
79
+
80
+ var eq_1 = eq$2;
81
+
82
+ var eq$1 = eq_1;
83
+
84
+ /**
85
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
86
+ *
87
+ * @private
88
+ * @param {Array} array The array to inspect.
89
+ * @param {*} key The key to search for.
90
+ * @returns {number} Returns the index of the matched value, else `-1`.
91
+ */
92
+ function assocIndexOf$4(array, key) {
93
+ var length = array.length;
94
+ while (length--) {
95
+ if (eq$1(array[length][0], key)) {
96
+ return length;
97
+ }
98
+ }
99
+ return -1;
100
+ }
101
+
102
+ var _assocIndexOf = assocIndexOf$4;
103
+
104
+ var assocIndexOf$3 = _assocIndexOf;
105
+
106
+ /** Used for built-in method references. */
107
+ var arrayProto = Array.prototype;
108
+
109
+ /** Built-in value references. */
110
+ var splice = arrayProto.splice;
111
+
112
+ /**
113
+ * Removes `key` and its value from the list cache.
114
+ *
115
+ * @private
116
+ * @name delete
117
+ * @memberOf ListCache
118
+ * @param {string} key The key of the value to remove.
119
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
120
+ */
121
+ function listCacheDelete$1(key) {
122
+ var data = this.__data__,
123
+ index = assocIndexOf$3(data, key);
124
+
125
+ if (index < 0) {
126
+ return false;
127
+ }
128
+ var lastIndex = data.length - 1;
129
+ if (index == lastIndex) {
130
+ data.pop();
131
+ } else {
132
+ splice.call(data, index, 1);
133
+ }
134
+ --this.size;
135
+ return true;
136
+ }
137
+
138
+ var _listCacheDelete = listCacheDelete$1;
139
+
140
+ var assocIndexOf$2 = _assocIndexOf;
141
+
142
+ /**
143
+ * Gets the list cache value for `key`.
144
+ *
145
+ * @private
146
+ * @name get
147
+ * @memberOf ListCache
148
+ * @param {string} key The key of the value to get.
149
+ * @returns {*} Returns the entry value.
150
+ */
151
+ function listCacheGet$1(key) {
152
+ var data = this.__data__,
153
+ index = assocIndexOf$2(data, key);
154
+
155
+ return index < 0 ? undefined : data[index][1];
156
+ }
157
+
158
+ var _listCacheGet = listCacheGet$1;
159
+
160
+ var assocIndexOf$1 = _assocIndexOf;
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$1(key) {
172
+ return assocIndexOf$1(this.__data__, key) > -1;
173
+ }
174
+
175
+ var _listCacheHas = listCacheHas$1;
176
+
177
+ var assocIndexOf = _assocIndexOf;
178
+
179
+ /**
180
+ * Sets the list cache `key` to `value`.
181
+ *
182
+ * @private
183
+ * @name set
184
+ * @memberOf ListCache
185
+ * @param {string} key The key of the value to set.
186
+ * @param {*} value The value to set.
187
+ * @returns {Object} Returns the list cache instance.
188
+ */
189
+ function listCacheSet$1(key, value) {
190
+ var data = this.__data__,
191
+ index = assocIndexOf(data, key);
192
+
193
+ if (index < 0) {
194
+ ++this.size;
195
+ data.push([key, value]);
196
+ } else {
197
+ data[index][1] = value;
198
+ }
199
+ return this;
200
+ }
201
+
202
+ var _listCacheSet = listCacheSet$1;
203
+
204
+ var listCacheClear = _listCacheClear,
205
+ listCacheDelete = _listCacheDelete,
206
+ listCacheGet = _listCacheGet,
207
+ listCacheHas = _listCacheHas,
208
+ listCacheSet = _listCacheSet;
209
+
210
+ /**
211
+ * Creates an list cache object.
212
+ *
213
+ * @private
214
+ * @constructor
215
+ * @param {Array} [entries] The key-value pairs to cache.
216
+ */
217
+ function ListCache$4(entries) {
218
+ var index = -1,
219
+ length = entries == null ? 0 : entries.length;
220
+
221
+ this.clear();
222
+ while (++index < length) {
223
+ var entry = entries[index];
224
+ this.set(entry[0], entry[1]);
225
+ }
226
+ }
227
+
228
+ // Add methods to `ListCache`.
229
+ ListCache$4.prototype.clear = listCacheClear;
230
+ ListCache$4.prototype['delete'] = listCacheDelete;
231
+ ListCache$4.prototype.get = listCacheGet;
232
+ ListCache$4.prototype.has = listCacheHas;
233
+ ListCache$4.prototype.set = listCacheSet;
234
+
235
+ var _ListCache = ListCache$4;
236
+
237
+ var ListCache$3 = _ListCache;
238
+
239
+ /**
240
+ * Removes all key-value entries from the stack.
241
+ *
242
+ * @private
243
+ * @name clear
244
+ * @memberOf Stack
245
+ */
246
+ function stackClear$1() {
247
+ this.__data__ = new ListCache$3;
248
+ this.size = 0;
249
+ }
250
+
251
+ var _stackClear = stackClear$1;
252
+
253
+ /**
254
+ * Removes `key` and its value from the stack.
255
+ *
256
+ * @private
257
+ * @name delete
258
+ * @memberOf Stack
259
+ * @param {string} key The key of the value to remove.
260
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
261
+ */
262
+
263
+ function stackDelete$1(key) {
264
+ var data = this.__data__,
265
+ result = data['delete'](key);
266
+
267
+ this.size = data.size;
268
+ return result;
269
+ }
270
+
271
+ var _stackDelete = stackDelete$1;
272
+
273
+ /**
274
+ * Gets the stack value for `key`.
275
+ *
276
+ * @private
277
+ * @name get
278
+ * @memberOf Stack
279
+ * @param {string} key The key of the value to get.
280
+ * @returns {*} Returns the entry value.
281
+ */
282
+
283
+ function stackGet$1(key) {
284
+ return this.__data__.get(key);
285
+ }
286
+
287
+ var _stackGet = stackGet$1;
288
+
289
+ /**
290
+ * Checks if a stack value for `key` exists.
291
+ *
292
+ * @private
293
+ * @name has
294
+ * @memberOf Stack
295
+ * @param {string} key The key of the entry to check.
296
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
297
+ */
298
+
299
+ function stackHas$1(key) {
300
+ return this.__data__.has(key);
301
+ }
302
+
303
+ var _stackHas = stackHas$1;
304
+
305
+ var baseGetTag$3 = isObjectLike$5._baseGetTag,
306
+ isObject$4 = isObjectLike$5.isObject_1;
307
+
308
+ /** `Object#toString` result references. */
309
+ var asyncTag = '[object AsyncFunction]',
310
+ funcTag$2 = '[object Function]',
311
+ genTag$1 = '[object GeneratorFunction]',
312
+ proxyTag = '[object Proxy]';
313
+
314
+ /**
315
+ * Checks if `value` is classified as a `Function` object.
316
+ *
317
+ * @static
318
+ * @memberOf _
319
+ * @since 0.1.0
320
+ * @category Lang
321
+ * @param {*} value The value to check.
322
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
323
+ * @example
324
+ *
325
+ * _.isFunction(_);
326
+ * // => true
327
+ *
328
+ * _.isFunction(/abc/);
329
+ * // => false
330
+ */
331
+ function isFunction$2(value) {
332
+ if (!isObject$4(value)) {
333
+ return false;
334
+ }
335
+ // The use of `Object#toString` avoids issues with the `typeof` operator
336
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
337
+ var tag = baseGetTag$3(value);
338
+ return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
339
+ }
340
+
341
+ var isFunction_1 = isFunction$2;
342
+
343
+ var root$6 = isObjectLike$5._root;
344
+
345
+ /** Used to detect overreaching core-js shims. */
346
+ var coreJsData$1 = root$6['__core-js_shared__'];
347
+
348
+ var _coreJsData = coreJsData$1;
349
+
350
+ var coreJsData = _coreJsData;
351
+
352
+ /** Used to detect methods masquerading as native. */
353
+ var maskSrcKey = (function() {
354
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
355
+ return uid ? ('Symbol(src)_1.' + uid) : '';
356
+ }());
357
+
358
+ /**
359
+ * Checks if `func` has its source masked.
360
+ *
361
+ * @private
362
+ * @param {Function} func The function to check.
363
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
364
+ */
365
+ function isMasked$1(func) {
366
+ return !!maskSrcKey && (maskSrcKey in func);
367
+ }
368
+
369
+ var _isMasked = isMasked$1;
370
+
371
+ /** Used for built-in method references. */
372
+
373
+ var funcProto$1 = Function.prototype;
374
+
375
+ /** Used to resolve the decompiled source of functions. */
376
+ var funcToString$1 = funcProto$1.toString;
377
+
378
+ /**
379
+ * Converts `func` to its source code.
380
+ *
381
+ * @private
382
+ * @param {Function} func The function to convert.
383
+ * @returns {string} Returns the source code.
384
+ */
385
+ function toSource$2(func) {
386
+ if (func != null) {
387
+ try {
388
+ return funcToString$1.call(func);
389
+ } catch (e) {}
390
+ try {
391
+ return (func + '');
392
+ } catch (e) {}
393
+ }
394
+ return '';
395
+ }
396
+
397
+ var _toSource = toSource$2;
398
+
399
+ var isFunction$1 = isFunction_1,
400
+ isMasked = _isMasked,
401
+ isObject$3 = isObjectLike$5.isObject_1,
402
+ toSource$1 = _toSource;
403
+
404
+ /**
405
+ * Used to match `RegExp`
406
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
407
+ */
408
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
409
+
410
+ /** Used to detect host constructors (Safari). */
411
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
412
+
413
+ /** Used for built-in method references. */
414
+ var funcProto = Function.prototype,
415
+ objectProto$a = Object.prototype;
416
+
417
+ /** Used to resolve the decompiled source of functions. */
418
+ var funcToString = funcProto.toString;
419
+
420
+ /** Used to check objects for own properties. */
421
+ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
422
+
423
+ /** Used to detect if a method is native. */
424
+ var reIsNative = RegExp('^' +
425
+ funcToString.call(hasOwnProperty$8).replace(reRegExpChar, '\\$&')
426
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
427
+ );
428
+
429
+ /**
430
+ * The base implementation of `_.isNative` without bad shim checks.
431
+ *
432
+ * @private
433
+ * @param {*} value The value to check.
434
+ * @returns {boolean} Returns `true` if `value` is a native function,
435
+ * else `false`.
436
+ */
437
+ function baseIsNative$1(value) {
438
+ if (!isObject$3(value) || isMasked(value)) {
439
+ return false;
440
+ }
441
+ var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
442
+ return pattern.test(toSource$1(value));
443
+ }
444
+
445
+ var _baseIsNative = baseIsNative$1;
446
+
447
+ /**
448
+ * Gets the value at `key` of `object`.
449
+ *
450
+ * @private
451
+ * @param {Object} [object] The object to query.
452
+ * @param {string} key The key of the property to get.
453
+ * @returns {*} Returns the property value.
454
+ */
455
+
456
+ function getValue$1(object, key) {
457
+ return object == null ? undefined : object[key];
458
+ }
459
+
460
+ var _getValue = getValue$1;
461
+
462
+ var baseIsNative = _baseIsNative,
463
+ getValue = _getValue;
464
+
465
+ /**
466
+ * Gets the native function at `key` of `object`.
467
+ *
468
+ * @private
469
+ * @param {Object} object The object to query.
470
+ * @param {string} key The key of the method to get.
471
+ * @returns {*} Returns the function if it's native, else `undefined`.
472
+ */
473
+ function getNative$7(object, key) {
474
+ var value = getValue(object, key);
475
+ return baseIsNative(value) ? value : undefined;
476
+ }
477
+
478
+ var _getNative = getNative$7;
479
+
480
+ var getNative$6 = _getNative,
481
+ root$5 = isObjectLike$5._root;
482
+
483
+ /* Built-in method references that are verified to be native. */
484
+ var Map$4 = getNative$6(root$5, 'Map');
485
+
486
+ var _Map = Map$4;
487
+
488
+ var getNative$5 = _getNative;
489
+
490
+ /* Built-in method references that are verified to be native. */
491
+ var nativeCreate$4 = getNative$5(Object, 'create');
492
+
493
+ var _nativeCreate = nativeCreate$4;
494
+
495
+ var nativeCreate$3 = _nativeCreate;
496
+
497
+ /**
498
+ * Removes all key-value entries from the hash.
499
+ *
500
+ * @private
501
+ * @name clear
502
+ * @memberOf Hash
503
+ */
504
+ function hashClear$1() {
505
+ this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
506
+ this.size = 0;
507
+ }
508
+
509
+ var _hashClear = hashClear$1;
510
+
511
+ /**
512
+ * Removes `key` and its value from the hash.
513
+ *
514
+ * @private
515
+ * @name delete
516
+ * @memberOf Hash
517
+ * @param {Object} hash The hash to modify.
518
+ * @param {string} key The key of the value to remove.
519
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
520
+ */
521
+
522
+ function hashDelete$1(key) {
523
+ var result = this.has(key) && delete this.__data__[key];
524
+ this.size -= result ? 1 : 0;
525
+ return result;
526
+ }
527
+
528
+ var _hashDelete = hashDelete$1;
529
+
530
+ var nativeCreate$2 = _nativeCreate;
531
+
532
+ /** Used to stand-in for `undefined` hash values. */
533
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
534
+
535
+ /** Used for built-in method references. */
536
+ var objectProto$9 = Object.prototype;
537
+
538
+ /** Used to check objects for own properties. */
539
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
540
+
541
+ /**
542
+ * Gets the hash value for `key`.
543
+ *
544
+ * @private
545
+ * @name get
546
+ * @memberOf Hash
547
+ * @param {string} key The key of the value to get.
548
+ * @returns {*} Returns the entry value.
549
+ */
550
+ function hashGet$1(key) {
551
+ var data = this.__data__;
552
+ if (nativeCreate$2) {
553
+ var result = data[key];
554
+ return result === HASH_UNDEFINED$1 ? undefined : result;
555
+ }
556
+ return hasOwnProperty$7.call(data, key) ? data[key] : undefined;
557
+ }
558
+
559
+ var _hashGet = hashGet$1;
560
+
561
+ var nativeCreate$1 = _nativeCreate;
562
+
563
+ /** Used for built-in method references. */
564
+ var objectProto$8 = Object.prototype;
565
+
566
+ /** Used to check objects for own properties. */
567
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
568
+
569
+ /**
570
+ * Checks if a hash value for `key` exists.
571
+ *
572
+ * @private
573
+ * @name has
574
+ * @memberOf Hash
575
+ * @param {string} key The key of the entry to check.
576
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
577
+ */
578
+ function hashHas$1(key) {
579
+ var data = this.__data__;
580
+ return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$6.call(data, key);
581
+ }
582
+
583
+ var _hashHas = hashHas$1;
584
+
585
+ var nativeCreate = _nativeCreate;
586
+
587
+ /** Used to stand-in for `undefined` hash values. */
588
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
589
+
590
+ /**
591
+ * Sets the hash `key` to `value`.
592
+ *
593
+ * @private
594
+ * @name set
595
+ * @memberOf Hash
596
+ * @param {string} key The key of the value to set.
597
+ * @param {*} value The value to set.
598
+ * @returns {Object} Returns the hash instance.
599
+ */
600
+ function hashSet$1(key, value) {
601
+ var data = this.__data__;
602
+ this.size += this.has(key) ? 0 : 1;
603
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
604
+ return this;
605
+ }
606
+
607
+ var _hashSet = hashSet$1;
608
+
609
+ var hashClear = _hashClear,
610
+ hashDelete = _hashDelete,
611
+ hashGet = _hashGet,
612
+ hashHas = _hashHas,
613
+ hashSet = _hashSet;
614
+
615
+ /**
616
+ * Creates a hash object.
617
+ *
618
+ * @private
619
+ * @constructor
620
+ * @param {Array} [entries] The key-value pairs to cache.
621
+ */
622
+ function Hash$1(entries) {
623
+ var index = -1,
624
+ length = entries == null ? 0 : entries.length;
625
+
626
+ this.clear();
627
+ while (++index < length) {
628
+ var entry = entries[index];
629
+ this.set(entry[0], entry[1]);
630
+ }
631
+ }
632
+
633
+ // Add methods to `Hash`.
634
+ Hash$1.prototype.clear = hashClear;
635
+ Hash$1.prototype['delete'] = hashDelete;
636
+ Hash$1.prototype.get = hashGet;
637
+ Hash$1.prototype.has = hashHas;
638
+ Hash$1.prototype.set = hashSet;
639
+
640
+ var _Hash = Hash$1;
641
+
642
+ var Hash = _Hash,
643
+ ListCache$2 = _ListCache,
644
+ Map$3 = _Map;
645
+
646
+ /**
647
+ * Removes all key-value entries from the map.
648
+ *
649
+ * @private
650
+ * @name clear
651
+ * @memberOf MapCache
652
+ */
653
+ function mapCacheClear$1() {
654
+ this.size = 0;
655
+ this.__data__ = {
656
+ 'hash': new Hash,
657
+ 'map': new (Map$3 || ListCache$2),
658
+ 'string': new Hash
659
+ };
660
+ }
661
+
662
+ var _mapCacheClear = mapCacheClear$1;
663
+
664
+ /**
665
+ * Checks if `value` is suitable for use as unique object key.
666
+ *
667
+ * @private
668
+ * @param {*} value The value to check.
669
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
670
+ */
671
+
672
+ function isKeyable$1(value) {
673
+ var type = typeof value;
674
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
675
+ ? (value !== '__proto__')
676
+ : (value === null);
677
+ }
678
+
679
+ var _isKeyable = isKeyable$1;
680
+
681
+ var isKeyable = _isKeyable;
682
+
683
+ /**
684
+ * Gets the data for `map`.
685
+ *
686
+ * @private
687
+ * @param {Object} map The map to query.
688
+ * @param {string} key The reference key.
689
+ * @returns {*} Returns the map data.
690
+ */
691
+ function getMapData$4(map, key) {
692
+ var data = map.__data__;
693
+ return isKeyable(key)
694
+ ? data[typeof key == 'string' ? 'string' : 'hash']
695
+ : data.map;
696
+ }
697
+
698
+ var _getMapData = getMapData$4;
699
+
700
+ var getMapData$3 = _getMapData;
701
+
702
+ /**
703
+ * Removes `key` and its value from the map.
704
+ *
705
+ * @private
706
+ * @name delete
707
+ * @memberOf MapCache
708
+ * @param {string} key The key of the value to remove.
709
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
710
+ */
711
+ function mapCacheDelete$1(key) {
712
+ var result = getMapData$3(this, key)['delete'](key);
713
+ this.size -= result ? 1 : 0;
714
+ return result;
715
+ }
716
+
717
+ var _mapCacheDelete = mapCacheDelete$1;
718
+
719
+ var getMapData$2 = _getMapData;
720
+
721
+ /**
722
+ * Gets the map value for `key`.
723
+ *
724
+ * @private
725
+ * @name get
726
+ * @memberOf MapCache
727
+ * @param {string} key The key of the value to get.
728
+ * @returns {*} Returns the entry value.
729
+ */
730
+ function mapCacheGet$1(key) {
731
+ return getMapData$2(this, key).get(key);
732
+ }
733
+
734
+ var _mapCacheGet = mapCacheGet$1;
735
+
736
+ var getMapData$1 = _getMapData;
737
+
738
+ /**
739
+ * Checks if a map value for `key` exists.
740
+ *
741
+ * @private
742
+ * @name has
743
+ * @memberOf MapCache
744
+ * @param {string} key The key of the entry to check.
745
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
746
+ */
747
+ function mapCacheHas$1(key) {
748
+ return getMapData$1(this, key).has(key);
749
+ }
750
+
751
+ var _mapCacheHas = mapCacheHas$1;
752
+
753
+ var getMapData = _getMapData;
754
+
755
+ /**
756
+ * Sets the map `key` to `value`.
757
+ *
758
+ * @private
759
+ * @name set
760
+ * @memberOf MapCache
761
+ * @param {string} key The key of the value to set.
762
+ * @param {*} value The value to set.
763
+ * @returns {Object} Returns the map cache instance.
764
+ */
765
+ function mapCacheSet$1(key, value) {
766
+ var data = getMapData(this, key),
767
+ size = data.size;
768
+
769
+ data.set(key, value);
770
+ this.size += data.size == size ? 0 : 1;
771
+ return this;
772
+ }
773
+
774
+ var _mapCacheSet = mapCacheSet$1;
775
+
776
+ var mapCacheClear = _mapCacheClear,
777
+ mapCacheDelete = _mapCacheDelete,
778
+ mapCacheGet = _mapCacheGet,
779
+ mapCacheHas = _mapCacheHas,
780
+ mapCacheSet = _mapCacheSet;
781
+
782
+ /**
783
+ * Creates a map cache object to store key-value pairs.
784
+ *
785
+ * @private
786
+ * @constructor
787
+ * @param {Array} [entries] The key-value pairs to cache.
788
+ */
789
+ function MapCache$1(entries) {
790
+ var index = -1,
791
+ length = entries == null ? 0 : entries.length;
792
+
793
+ this.clear();
794
+ while (++index < length) {
795
+ var entry = entries[index];
796
+ this.set(entry[0], entry[1]);
797
+ }
798
+ }
799
+
800
+ // Add methods to `MapCache`.
801
+ MapCache$1.prototype.clear = mapCacheClear;
802
+ MapCache$1.prototype['delete'] = mapCacheDelete;
803
+ MapCache$1.prototype.get = mapCacheGet;
804
+ MapCache$1.prototype.has = mapCacheHas;
805
+ MapCache$1.prototype.set = mapCacheSet;
806
+
807
+ var _MapCache = MapCache$1;
808
+
809
+ var ListCache$1 = _ListCache,
810
+ Map$2 = _Map,
811
+ MapCache = _MapCache;
812
+
813
+ /** Used as the size to enable large array optimizations. */
814
+ var LARGE_ARRAY_SIZE = 200;
815
+
816
+ /**
817
+ * Sets the stack `key` to `value`.
818
+ *
819
+ * @private
820
+ * @name set
821
+ * @memberOf Stack
822
+ * @param {string} key The key of the value to set.
823
+ * @param {*} value The value to set.
824
+ * @returns {Object} Returns the stack cache instance.
825
+ */
826
+ function stackSet$1(key, value) {
827
+ var data = this.__data__;
828
+ if (data instanceof ListCache$1) {
829
+ var pairs = data.__data__;
830
+ if (!Map$2 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
831
+ pairs.push([key, value]);
832
+ this.size = ++data.size;
833
+ return this;
834
+ }
835
+ data = this.__data__ = new MapCache(pairs);
836
+ }
837
+ data.set(key, value);
838
+ this.size = data.size;
839
+ return this;
840
+ }
841
+
842
+ var _stackSet = stackSet$1;
843
+
844
+ var ListCache = _ListCache,
845
+ stackClear = _stackClear,
846
+ stackDelete = _stackDelete,
847
+ stackGet = _stackGet,
848
+ stackHas = _stackHas,
849
+ stackSet = _stackSet;
850
+
851
+ /**
852
+ * Creates a stack cache object to store key-value pairs.
853
+ *
854
+ * @private
855
+ * @constructor
856
+ * @param {Array} [entries] The key-value pairs to cache.
857
+ */
858
+ function Stack$1(entries) {
859
+ var data = this.__data__ = new ListCache(entries);
860
+ this.size = data.size;
861
+ }
862
+
863
+ // Add methods to `Stack`.
864
+ Stack$1.prototype.clear = stackClear;
865
+ Stack$1.prototype['delete'] = stackDelete;
866
+ Stack$1.prototype.get = stackGet;
867
+ Stack$1.prototype.has = stackHas;
868
+ Stack$1.prototype.set = stackSet;
869
+
870
+ var _Stack = Stack$1;
871
+
872
+ /**
873
+ * A specialized version of `_.forEach` for arrays without support for
874
+ * iteratee shorthands.
875
+ *
876
+ * @private
877
+ * @param {Array} [array] The array to iterate over.
878
+ * @param {Function} iteratee The function invoked per iteration.
879
+ * @returns {Array} Returns `array`.
880
+ */
881
+
882
+ function arrayEach$1(array, iteratee) {
883
+ var index = -1,
884
+ length = array == null ? 0 : array.length;
885
+
886
+ while (++index < length) {
887
+ if (iteratee(array[index], index, array) === false) {
888
+ break;
889
+ }
890
+ }
891
+ return array;
892
+ }
893
+
894
+ var _arrayEach = arrayEach$1;
895
+
896
+ var getNative$4 = _getNative;
897
+
898
+ var defineProperty$1 = (function() {
899
+ try {
900
+ var func = getNative$4(Object, 'defineProperty');
901
+ func({}, '', {});
902
+ return func;
903
+ } catch (e) {}
904
+ }());
905
+
906
+ var _defineProperty = defineProperty$1;
907
+
908
+ var defineProperty = _defineProperty;
909
+
910
+ /**
911
+ * The base implementation of `assignValue` and `assignMergeValue` without
912
+ * value checks.
913
+ *
914
+ * @private
915
+ * @param {Object} object The object to modify.
916
+ * @param {string} key The key of the property to assign.
917
+ * @param {*} value The value to assign.
918
+ */
919
+ function baseAssignValue$2(object, key, value) {
920
+ if (key == '__proto__' && defineProperty) {
921
+ defineProperty(object, key, {
922
+ 'configurable': true,
923
+ 'enumerable': true,
924
+ 'value': value,
925
+ 'writable': true
926
+ });
927
+ } else {
928
+ object[key] = value;
929
+ }
930
+ }
931
+
932
+ var _baseAssignValue = baseAssignValue$2;
933
+
934
+ var baseAssignValue$1 = _baseAssignValue,
935
+ eq = eq_1;
936
+
937
+ /** Used for built-in method references. */
938
+ var objectProto$7 = Object.prototype;
939
+
940
+ /** Used to check objects for own properties. */
941
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
942
+
943
+ /**
944
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
945
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
946
+ * for equality comparisons.
947
+ *
948
+ * @private
949
+ * @param {Object} object The object to modify.
950
+ * @param {string} key The key of the property to assign.
951
+ * @param {*} value The value to assign.
952
+ */
953
+ function assignValue$2(object, key, value) {
954
+ var objValue = object[key];
955
+ if (!(hasOwnProperty$5.call(object, key) && eq(objValue, value)) ||
956
+ (value === undefined && !(key in object))) {
957
+ baseAssignValue$1(object, key, value);
958
+ }
959
+ }
960
+
961
+ var _assignValue = assignValue$2;
962
+
963
+ var assignValue$1 = _assignValue,
964
+ baseAssignValue = _baseAssignValue;
965
+
966
+ /**
967
+ * Copies properties of `source` to `object`.
968
+ *
969
+ * @private
970
+ * @param {Object} source The object to copy properties from.
971
+ * @param {Array} props The property identifiers to copy.
972
+ * @param {Object} [object={}] The object to copy properties to.
973
+ * @param {Function} [customizer] The function to customize copied values.
974
+ * @returns {Object} Returns `object`.
975
+ */
976
+ function copyObject$4(source, props, object, customizer) {
977
+ var isNew = !object;
978
+ object || (object = {});
979
+
980
+ var index = -1,
981
+ length = props.length;
982
+
983
+ while (++index < length) {
984
+ var key = props[index];
985
+
986
+ var newValue = customizer
987
+ ? customizer(object[key], source[key], key, object, source)
988
+ : undefined;
989
+
990
+ if (newValue === undefined) {
991
+ newValue = source[key];
992
+ }
993
+ if (isNew) {
994
+ baseAssignValue(object, key, newValue);
995
+ } else {
996
+ assignValue$1(object, key, newValue);
997
+ }
998
+ }
999
+ return object;
1000
+ }
1001
+
1002
+ var _copyObject = copyObject$4;
1003
+
1004
+ /**
1005
+ * The base implementation of `_.times` without support for iteratee shorthands
1006
+ * or max array length checks.
1007
+ *
1008
+ * @private
1009
+ * @param {number} n The number of times to invoke `iteratee`.
1010
+ * @param {Function} iteratee The function invoked per iteration.
1011
+ * @returns {Array} Returns the array of results.
1012
+ */
1013
+
1014
+ function baseTimes$1(n, iteratee) {
1015
+ var index = -1,
1016
+ result = Array(n);
1017
+
1018
+ while (++index < n) {
1019
+ result[index] = iteratee(index);
1020
+ }
1021
+ return result;
1022
+ }
1023
+
1024
+ var _baseTimes = baseTimes$1;
1025
+
1026
+ var baseGetTag$2 = isObjectLike$5._baseGetTag,
1027
+ isObjectLike$4 = isObjectLike$5.isObjectLike_1;
1028
+
1029
+ /** `Object#toString` result references. */
1030
+ var argsTag$2 = '[object Arguments]';
1031
+
1032
+ /**
1033
+ * The base implementation of `_.isArguments`.
1034
+ *
1035
+ * @private
1036
+ * @param {*} value The value to check.
1037
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1038
+ */
1039
+ function baseIsArguments$1(value) {
1040
+ return isObjectLike$4(value) && baseGetTag$2(value) == argsTag$2;
1041
+ }
1042
+
1043
+ var _baseIsArguments = baseIsArguments$1;
1044
+
1045
+ var baseIsArguments = _baseIsArguments,
1046
+ isObjectLike$3 = isObjectLike$5.isObjectLike_1;
1047
+
1048
+ /** Used for built-in method references. */
1049
+ var objectProto$6 = Object.prototype;
1050
+
1051
+ /** Used to check objects for own properties. */
1052
+ var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
1053
+
1054
+ /** Built-in value references. */
1055
+ var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
1056
+
1057
+ /**
1058
+ * Checks if `value` is likely an `arguments` object.
1059
+ *
1060
+ * @static
1061
+ * @memberOf _
1062
+ * @since 0.1.0
1063
+ * @category Lang
1064
+ * @param {*} value The value to check.
1065
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1066
+ * else `false`.
1067
+ * @example
1068
+ *
1069
+ * _.isArguments(function() { return arguments; }());
1070
+ * // => true
1071
+ *
1072
+ * _.isArguments([1, 2, 3]);
1073
+ * // => false
1074
+ */
1075
+ var isArguments$1 = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
1076
+ return isObjectLike$3(value) && hasOwnProperty$4.call(value, 'callee') &&
1077
+ !propertyIsEnumerable$1.call(value, 'callee');
1078
+ };
1079
+
1080
+ var isArguments_1 = isArguments$1;
1081
+
1082
+ /**
1083
+ * Checks if `value` is classified as an `Array` object.
1084
+ *
1085
+ * @static
1086
+ * @memberOf _
1087
+ * @since 0.1.0
1088
+ * @category Lang
1089
+ * @param {*} value The value to check.
1090
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1091
+ * @example
1092
+ *
1093
+ * _.isArray([1, 2, 3]);
1094
+ * // => true
1095
+ *
1096
+ * _.isArray(document.body.children);
1097
+ * // => false
1098
+ *
1099
+ * _.isArray('abc');
1100
+ * // => false
1101
+ *
1102
+ * _.isArray(_.noop);
1103
+ * // => false
1104
+ */
1105
+
1106
+ var isArray$3 = Array.isArray;
1107
+
1108
+ var isArray_1 = isArray$3;
1109
+
1110
+ var isBuffer$2 = {exports: {}};
1111
+
1112
+ /**
1113
+ * This method returns `false`.
1114
+ *
1115
+ * @static
1116
+ * @memberOf _
1117
+ * @since 4.13.0
1118
+ * @category Util
1119
+ * @returns {boolean} Returns `false`.
1120
+ * @example
1121
+ *
1122
+ * _.times(2, _.stubFalse);
1123
+ * // => [false, false]
1124
+ */
1125
+
1126
+ function stubFalse() {
1127
+ return false;
1128
+ }
1129
+
1130
+ var stubFalse_1 = stubFalse;
1131
+
1132
+ isBuffer$2.exports;
1133
+
1134
+ (function (module, exports) {
1135
+ var root = isObjectLike$5._root,
1136
+ stubFalse = stubFalse_1;
1137
+
1138
+ /** Detect free variable `exports`. */
1139
+ var freeExports = exports && !exports.nodeType && exports;
1140
+
1141
+ /** Detect free variable `module`. */
1142
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1143
+
1144
+ /** Detect the popular CommonJS extension `module.exports`. */
1145
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1146
+
1147
+ /** Built-in value references. */
1148
+ var Buffer = moduleExports ? root.Buffer : undefined;
1149
+
1150
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1151
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
1152
+
1153
+ /**
1154
+ * Checks if `value` is a buffer.
1155
+ *
1156
+ * @static
1157
+ * @memberOf _
1158
+ * @since 4.3.0
1159
+ * @category Lang
1160
+ * @param {*} value The value to check.
1161
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1162
+ * @example
1163
+ *
1164
+ * _.isBuffer(new Buffer(2));
1165
+ * // => true
1166
+ *
1167
+ * _.isBuffer(new Uint8Array(2));
1168
+ * // => false
1169
+ */
1170
+ var isBuffer = nativeIsBuffer || stubFalse;
1171
+
1172
+ module.exports = isBuffer;
1173
+ } (isBuffer$2, isBuffer$2.exports));
1174
+
1175
+ var isBufferExports = isBuffer$2.exports;
1176
+
1177
+ /** Used as references for various `Number` constants. */
1178
+
1179
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
1180
+
1181
+ /** Used to detect unsigned integer values. */
1182
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
1183
+
1184
+ /**
1185
+ * Checks if `value` is a valid array-like index.
1186
+ *
1187
+ * @private
1188
+ * @param {*} value The value to check.
1189
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1190
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1191
+ */
1192
+ function isIndex$1(value, length) {
1193
+ var type = typeof value;
1194
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
1195
+
1196
+ return !!length &&
1197
+ (type == 'number' ||
1198
+ (type != 'symbol' && reIsUint.test(value))) &&
1199
+ (value > -1 && value % 1 == 0 && value < length);
1200
+ }
1201
+
1202
+ var _isIndex = isIndex$1;
1203
+
1204
+ /** Used as references for various `Number` constants. */
1205
+
1206
+ var MAX_SAFE_INTEGER = 9007199254740991;
1207
+
1208
+ /**
1209
+ * Checks if `value` is a valid array-like length.
1210
+ *
1211
+ * **Note:** This method is loosely based on
1212
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1213
+ *
1214
+ * @static
1215
+ * @memberOf _
1216
+ * @since 4.0.0
1217
+ * @category Lang
1218
+ * @param {*} value The value to check.
1219
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1220
+ * @example
1221
+ *
1222
+ * _.isLength(3);
1223
+ * // => true
1224
+ *
1225
+ * _.isLength(Number.MIN_VALUE);
1226
+ * // => false
1227
+ *
1228
+ * _.isLength(Infinity);
1229
+ * // => false
1230
+ *
1231
+ * _.isLength('3');
1232
+ * // => false
1233
+ */
1234
+ function isLength$2(value) {
1235
+ return typeof value == 'number' &&
1236
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1237
+ }
1238
+
1239
+ var isLength_1 = isLength$2;
1240
+
1241
+ var baseGetTag$1 = isObjectLike$5._baseGetTag,
1242
+ isLength$1 = isLength_1,
1243
+ isObjectLike$2 = isObjectLike$5.isObjectLike_1;
1244
+
1245
+ /** `Object#toString` result references. */
1246
+ var argsTag$1 = '[object Arguments]',
1247
+ arrayTag$1 = '[object Array]',
1248
+ boolTag$2 = '[object Boolean]',
1249
+ dateTag$2 = '[object Date]',
1250
+ errorTag$1 = '[object Error]',
1251
+ funcTag$1 = '[object Function]',
1252
+ mapTag$4 = '[object Map]',
1253
+ numberTag$2 = '[object Number]',
1254
+ objectTag$2 = '[object Object]',
1255
+ regexpTag$2 = '[object RegExp]',
1256
+ setTag$4 = '[object Set]',
1257
+ stringTag$2 = '[object String]',
1258
+ weakMapTag$2 = '[object WeakMap]';
1259
+
1260
+ var arrayBufferTag$2 = '[object ArrayBuffer]',
1261
+ dataViewTag$3 = '[object DataView]',
1262
+ float32Tag$2 = '[object Float32Array]',
1263
+ float64Tag$2 = '[object Float64Array]',
1264
+ int8Tag$2 = '[object Int8Array]',
1265
+ int16Tag$2 = '[object Int16Array]',
1266
+ int32Tag$2 = '[object Int32Array]',
1267
+ uint8Tag$2 = '[object Uint8Array]',
1268
+ uint8ClampedTag$2 = '[object Uint8ClampedArray]',
1269
+ uint16Tag$2 = '[object Uint16Array]',
1270
+ uint32Tag$2 = '[object Uint32Array]';
1271
+
1272
+ /** Used to identify `toStringTag` values of typed arrays. */
1273
+ var typedArrayTags = {};
1274
+ typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
1275
+ typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
1276
+ typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
1277
+ typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
1278
+ typedArrayTags[uint32Tag$2] = true;
1279
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
1280
+ typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
1281
+ typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
1282
+ typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
1283
+ typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
1284
+ typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] =
1285
+ typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
1286
+ typedArrayTags[weakMapTag$2] = false;
1287
+
1288
+ /**
1289
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
1290
+ *
1291
+ * @private
1292
+ * @param {*} value The value to check.
1293
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1294
+ */
1295
+ function baseIsTypedArray$1(value) {
1296
+ return isObjectLike$2(value) &&
1297
+ isLength$1(value.length) && !!typedArrayTags[baseGetTag$1(value)];
1298
+ }
1299
+
1300
+ var _baseIsTypedArray = baseIsTypedArray$1;
1301
+
1302
+ /**
1303
+ * The base implementation of `_.unary` without support for storing metadata.
1304
+ *
1305
+ * @private
1306
+ * @param {Function} func The function to cap arguments for.
1307
+ * @returns {Function} Returns the new capped function.
1308
+ */
1309
+
1310
+ function baseUnary$3(func) {
1311
+ return function(value) {
1312
+ return func(value);
1313
+ };
1314
+ }
1315
+
1316
+ var _baseUnary = baseUnary$3;
1317
+
1318
+ var _nodeUtil = {exports: {}};
1319
+
1320
+ _nodeUtil.exports;
1321
+
1322
+ (function (module, exports) {
1323
+ var freeGlobal = isObjectLike$5._freeGlobal;
1324
+
1325
+ /** Detect free variable `exports`. */
1326
+ var freeExports = exports && !exports.nodeType && exports;
1327
+
1328
+ /** Detect free variable `module`. */
1329
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1330
+
1331
+ /** Detect the popular CommonJS extension `module.exports`. */
1332
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1333
+
1334
+ /** Detect free variable `process` from Node.js. */
1335
+ var freeProcess = moduleExports && freeGlobal.process;
1336
+
1337
+ /** Used to access faster Node.js helpers. */
1338
+ var nodeUtil = (function() {
1339
+ try {
1340
+ // Use `util.types` for Node.js 10+.
1341
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
1342
+
1343
+ if (types) {
1344
+ return types;
1345
+ }
1346
+
1347
+ // Legacy `process.binding('util')` for Node.js < 10.
1348
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
1349
+ } catch (e) {}
1350
+ }());
1351
+
1352
+ module.exports = nodeUtil;
1353
+ } (_nodeUtil, _nodeUtil.exports));
1354
+
1355
+ var _nodeUtilExports = _nodeUtil.exports;
1356
+
1357
+ var baseIsTypedArray = _baseIsTypedArray,
1358
+ baseUnary$2 = _baseUnary,
1359
+ nodeUtil$2 = _nodeUtilExports;
1360
+
1361
+ /* Node.js helper references. */
1362
+ var nodeIsTypedArray = nodeUtil$2 && nodeUtil$2.isTypedArray;
1363
+
1364
+ /**
1365
+ * Checks if `value` is classified as a typed array.
1366
+ *
1367
+ * @static
1368
+ * @memberOf _
1369
+ * @since 3.0.0
1370
+ * @category Lang
1371
+ * @param {*} value The value to check.
1372
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1373
+ * @example
1374
+ *
1375
+ * _.isTypedArray(new Uint8Array);
1376
+ * // => true
1377
+ *
1378
+ * _.isTypedArray([]);
1379
+ * // => false
1380
+ */
1381
+ var isTypedArray$1 = nodeIsTypedArray ? baseUnary$2(nodeIsTypedArray) : baseIsTypedArray;
1382
+
1383
+ var isTypedArray_1 = isTypedArray$1;
1384
+
1385
+ var baseTimes = _baseTimes,
1386
+ isArguments = isArguments_1,
1387
+ isArray$2 = isArray_1,
1388
+ isBuffer$1 = isBufferExports,
1389
+ isIndex = _isIndex,
1390
+ isTypedArray = isTypedArray_1;
1391
+
1392
+ /** Used for built-in method references. */
1393
+ var objectProto$5 = Object.prototype;
1394
+
1395
+ /** Used to check objects for own properties. */
1396
+ var hasOwnProperty$3 = objectProto$5.hasOwnProperty;
1397
+
1398
+ /**
1399
+ * Creates an array of the enumerable property names of the array-like `value`.
1400
+ *
1401
+ * @private
1402
+ * @param {*} value The value to query.
1403
+ * @param {boolean} inherited Specify returning inherited property names.
1404
+ * @returns {Array} Returns the array of property names.
1405
+ */
1406
+ function arrayLikeKeys$2(value, inherited) {
1407
+ var isArr = isArray$2(value),
1408
+ isArg = !isArr && isArguments(value),
1409
+ isBuff = !isArr && !isArg && isBuffer$1(value),
1410
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
1411
+ skipIndexes = isArr || isArg || isBuff || isType,
1412
+ result = skipIndexes ? baseTimes(value.length, String) : [],
1413
+ length = result.length;
1414
+
1415
+ for (var key in value) {
1416
+ if ((inherited || hasOwnProperty$3.call(value, key)) &&
1417
+ !(skipIndexes && (
1418
+ // Safari 9 has enumerable `arguments.length` in strict mode.
1419
+ key == 'length' ||
1420
+ // Node.js 0.10 has enumerable non-index properties on buffers.
1421
+ (isBuff && (key == 'offset' || key == 'parent')) ||
1422
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
1423
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
1424
+ // Skip index properties.
1425
+ isIndex(key, length)
1426
+ ))) {
1427
+ result.push(key);
1428
+ }
1429
+ }
1430
+ return result;
1431
+ }
1432
+
1433
+ var _arrayLikeKeys = arrayLikeKeys$2;
1434
+
1435
+ /** Used for built-in method references. */
1436
+
1437
+ var objectProto$4 = Object.prototype;
1438
+
1439
+ /**
1440
+ * Checks if `value` is likely a prototype object.
1441
+ *
1442
+ * @private
1443
+ * @param {*} value The value to check.
1444
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1445
+ */
1446
+ function isPrototype$3(value) {
1447
+ var Ctor = value && value.constructor,
1448
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$4;
1449
+
1450
+ return value === proto;
1451
+ }
1452
+
1453
+ var _isPrototype = isPrototype$3;
1454
+
1455
+ /**
1456
+ * Creates a unary function that invokes `func` with its argument transformed.
1457
+ *
1458
+ * @private
1459
+ * @param {Function} func The function to wrap.
1460
+ * @param {Function} transform The argument transform.
1461
+ * @returns {Function} Returns the new function.
1462
+ */
1463
+
1464
+ function overArg$2(func, transform) {
1465
+ return function(arg) {
1466
+ return func(transform(arg));
1467
+ };
1468
+ }
1469
+
1470
+ var _overArg = overArg$2;
1471
+
1472
+ var overArg$1 = _overArg;
1473
+
1474
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1475
+ var nativeKeys$1 = overArg$1(Object.keys, Object);
1476
+
1477
+ var _nativeKeys = nativeKeys$1;
1478
+
1479
+ var isPrototype$2 = _isPrototype,
1480
+ nativeKeys = _nativeKeys;
1481
+
1482
+ /** Used for built-in method references. */
1483
+ var objectProto$3 = Object.prototype;
1484
+
1485
+ /** Used to check objects for own properties. */
1486
+ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
1487
+
1488
+ /**
1489
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1490
+ *
1491
+ * @private
1492
+ * @param {Object} object The object to query.
1493
+ * @returns {Array} Returns the array of property names.
1494
+ */
1495
+ function baseKeys$1(object) {
1496
+ if (!isPrototype$2(object)) {
1497
+ return nativeKeys(object);
1498
+ }
1499
+ var result = [];
1500
+ for (var key in Object(object)) {
1501
+ if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
1502
+ result.push(key);
1503
+ }
1504
+ }
1505
+ return result;
1506
+ }
1507
+
1508
+ var _baseKeys = baseKeys$1;
1509
+
1510
+ var isFunction = isFunction_1,
1511
+ isLength = isLength_1;
1512
+
1513
+ /**
1514
+ * Checks if `value` is array-like. A value is considered array-like if it's
1515
+ * not a function and has a `value.length` that's an integer greater than or
1516
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1517
+ *
1518
+ * @static
1519
+ * @memberOf _
1520
+ * @since 4.0.0
1521
+ * @category Lang
1522
+ * @param {*} value The value to check.
1523
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1524
+ * @example
1525
+ *
1526
+ * _.isArrayLike([1, 2, 3]);
1527
+ * // => true
1528
+ *
1529
+ * _.isArrayLike(document.body.children);
1530
+ * // => true
1531
+ *
1532
+ * _.isArrayLike('abc');
1533
+ * // => true
1534
+ *
1535
+ * _.isArrayLike(_.noop);
1536
+ * // => false
1537
+ */
1538
+ function isArrayLike$2(value) {
1539
+ return value != null && isLength(value.length) && !isFunction(value);
1540
+ }
1541
+
1542
+ var isArrayLike_1 = isArrayLike$2;
1543
+
1544
+ var arrayLikeKeys$1 = _arrayLikeKeys,
1545
+ baseKeys = _baseKeys,
1546
+ isArrayLike$1 = isArrayLike_1;
1547
+
1548
+ /**
1549
+ * Creates an array of the own enumerable property names of `object`.
1550
+ *
1551
+ * **Note:** Non-object values are coerced to objects. See the
1552
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1553
+ * for more details.
1554
+ *
1555
+ * @static
1556
+ * @since 0.1.0
1557
+ * @memberOf _
1558
+ * @category Object
1559
+ * @param {Object} object The object to query.
1560
+ * @returns {Array} Returns the array of property names.
1561
+ * @example
1562
+ *
1563
+ * function Foo() {
1564
+ * this.a = 1;
1565
+ * this.b = 2;
1566
+ * }
1567
+ *
1568
+ * Foo.prototype.c = 3;
1569
+ *
1570
+ * _.keys(new Foo);
1571
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1572
+ *
1573
+ * _.keys('hi');
1574
+ * // => ['0', '1']
1575
+ */
1576
+ function keys$3(object) {
1577
+ return isArrayLike$1(object) ? arrayLikeKeys$1(object) : baseKeys(object);
1578
+ }
1579
+
1580
+ var keys_1 = keys$3;
1581
+
1582
+ var copyObject$3 = _copyObject,
1583
+ keys$2 = keys_1;
1584
+
1585
+ /**
1586
+ * The base implementation of `_.assign` without support for multiple sources
1587
+ * or `customizer` functions.
1588
+ *
1589
+ * @private
1590
+ * @param {Object} object The destination object.
1591
+ * @param {Object} source The source object.
1592
+ * @returns {Object} Returns `object`.
1593
+ */
1594
+ function baseAssign$1(object, source) {
1595
+ return object && copyObject$3(source, keys$2(source), object);
1596
+ }
1597
+
1598
+ var _baseAssign = baseAssign$1;
1599
+
1600
+ /**
1601
+ * This function is like
1602
+ * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1603
+ * except that it includes inherited enumerable properties.
1604
+ *
1605
+ * @private
1606
+ * @param {Object} object The object to query.
1607
+ * @returns {Array} Returns the array of property names.
1608
+ */
1609
+
1610
+ function nativeKeysIn$1(object) {
1611
+ var result = [];
1612
+ if (object != null) {
1613
+ for (var key in Object(object)) {
1614
+ result.push(key);
1615
+ }
1616
+ }
1617
+ return result;
1618
+ }
1619
+
1620
+ var _nativeKeysIn = nativeKeysIn$1;
1621
+
1622
+ var isObject$2 = isObjectLike$5.isObject_1,
1623
+ isPrototype$1 = _isPrototype,
1624
+ nativeKeysIn = _nativeKeysIn;
1625
+
1626
+ /** Used for built-in method references. */
1627
+ var objectProto$2 = Object.prototype;
1628
+
1629
+ /** Used to check objects for own properties. */
1630
+ var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
1631
+
1632
+ /**
1633
+ * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
1634
+ *
1635
+ * @private
1636
+ * @param {Object} object The object to query.
1637
+ * @returns {Array} Returns the array of property names.
1638
+ */
1639
+ function baseKeysIn$1(object) {
1640
+ if (!isObject$2(object)) {
1641
+ return nativeKeysIn(object);
1642
+ }
1643
+ var isProto = isPrototype$1(object),
1644
+ result = [];
1645
+
1646
+ for (var key in object) {
1647
+ if (!(key == 'constructor' && (isProto || !hasOwnProperty$1.call(object, key)))) {
1648
+ result.push(key);
1649
+ }
1650
+ }
1651
+ return result;
1652
+ }
1653
+
1654
+ var _baseKeysIn = baseKeysIn$1;
1655
+
1656
+ var arrayLikeKeys = _arrayLikeKeys,
1657
+ baseKeysIn = _baseKeysIn,
1658
+ isArrayLike = isArrayLike_1;
1659
+
1660
+ /**
1661
+ * Creates an array of the own and inherited enumerable property names of `object`.
1662
+ *
1663
+ * **Note:** Non-object values are coerced to objects.
1664
+ *
1665
+ * @static
1666
+ * @memberOf _
1667
+ * @since 3.0.0
1668
+ * @category Object
1669
+ * @param {Object} object The object to query.
1670
+ * @returns {Array} Returns the array of property names.
1671
+ * @example
1672
+ *
1673
+ * function Foo() {
1674
+ * this.a = 1;
1675
+ * this.b = 2;
1676
+ * }
1677
+ *
1678
+ * Foo.prototype.c = 3;
1679
+ *
1680
+ * _.keysIn(new Foo);
1681
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
1682
+ */
1683
+ function keysIn$3(object) {
1684
+ return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
1685
+ }
1686
+
1687
+ var keysIn_1 = keysIn$3;
1688
+
1689
+ var copyObject$2 = _copyObject,
1690
+ keysIn$2 = keysIn_1;
1691
+
1692
+ /**
1693
+ * The base implementation of `_.assignIn` without support for multiple sources
1694
+ * or `customizer` functions.
1695
+ *
1696
+ * @private
1697
+ * @param {Object} object The destination object.
1698
+ * @param {Object} source The source object.
1699
+ * @returns {Object} Returns `object`.
1700
+ */
1701
+ function baseAssignIn$1(object, source) {
1702
+ return object && copyObject$2(source, keysIn$2(source), object);
1703
+ }
1704
+
1705
+ var _baseAssignIn = baseAssignIn$1;
1706
+
1707
+ var _cloneBuffer = {exports: {}};
1708
+
1709
+ _cloneBuffer.exports;
1710
+
1711
+ (function (module, exports) {
1712
+ var root = isObjectLike$5._root;
1713
+
1714
+ /** Detect free variable `exports`. */
1715
+ var freeExports = exports && !exports.nodeType && exports;
1716
+
1717
+ /** Detect free variable `module`. */
1718
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1719
+
1720
+ /** Detect the popular CommonJS extension `module.exports`. */
1721
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1722
+
1723
+ /** Built-in value references. */
1724
+ var Buffer = moduleExports ? root.Buffer : undefined,
1725
+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
1726
+
1727
+ /**
1728
+ * Creates a clone of `buffer`.
1729
+ *
1730
+ * @private
1731
+ * @param {Buffer} buffer The buffer to clone.
1732
+ * @param {boolean} [isDeep] Specify a deep clone.
1733
+ * @returns {Buffer} Returns the cloned buffer.
1734
+ */
1735
+ function cloneBuffer(buffer, isDeep) {
1736
+ if (isDeep) {
1737
+ return buffer.slice();
1738
+ }
1739
+ var length = buffer.length,
1740
+ result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1741
+
1742
+ buffer.copy(result);
1743
+ return result;
1744
+ }
1745
+
1746
+ module.exports = cloneBuffer;
1747
+ } (_cloneBuffer, _cloneBuffer.exports));
1748
+
1749
+ var _cloneBufferExports = _cloneBuffer.exports;
1750
+
1751
+ /**
1752
+ * Copies the values of `source` to `array`.
1753
+ *
1754
+ * @private
1755
+ * @param {Array} source The array to copy values from.
1756
+ * @param {Array} [array=[]] The array to copy values to.
1757
+ * @returns {Array} Returns `array`.
1758
+ */
1759
+
1760
+ function copyArray$1(source, array) {
1761
+ var index = -1,
1762
+ length = source.length;
1763
+
1764
+ array || (array = Array(length));
1765
+ while (++index < length) {
1766
+ array[index] = source[index];
1767
+ }
1768
+ return array;
1769
+ }
1770
+
1771
+ var _copyArray = copyArray$1;
1772
+
1773
+ /**
1774
+ * A specialized version of `_.filter` for arrays without support for
1775
+ * iteratee shorthands.
1776
+ *
1777
+ * @private
1778
+ * @param {Array} [array] The array to iterate over.
1779
+ * @param {Function} predicate The function invoked per iteration.
1780
+ * @returns {Array} Returns the new filtered array.
1781
+ */
1782
+
1783
+ function arrayFilter$1(array, predicate) {
1784
+ var index = -1,
1785
+ length = array == null ? 0 : array.length,
1786
+ resIndex = 0,
1787
+ result = [];
1788
+
1789
+ while (++index < length) {
1790
+ var value = array[index];
1791
+ if (predicate(value, index, array)) {
1792
+ result[resIndex++] = value;
1793
+ }
1794
+ }
1795
+ return result;
1796
+ }
1797
+
1798
+ var _arrayFilter = arrayFilter$1;
1799
+
1800
+ /**
1801
+ * This method returns a new empty array.
1802
+ *
1803
+ * @static
1804
+ * @memberOf _
1805
+ * @since 4.13.0
1806
+ * @category Util
1807
+ * @returns {Array} Returns the new empty array.
1808
+ * @example
1809
+ *
1810
+ * var arrays = _.times(2, _.stubArray);
1811
+ *
1812
+ * console.log(arrays);
1813
+ * // => [[], []]
1814
+ *
1815
+ * console.log(arrays[0] === arrays[1]);
1816
+ * // => false
1817
+ */
1818
+
1819
+ function stubArray$2() {
1820
+ return [];
1821
+ }
1822
+
1823
+ var stubArray_1 = stubArray$2;
1824
+
1825
+ var arrayFilter = _arrayFilter,
1826
+ stubArray$1 = stubArray_1;
1827
+
1828
+ /** Used for built-in method references. */
1829
+ var objectProto$1 = Object.prototype;
1830
+
1831
+ /** Built-in value references. */
1832
+ var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
1833
+
1834
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1835
+ var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
1836
+
1837
+ /**
1838
+ * Creates an array of the own enumerable symbols of `object`.
1839
+ *
1840
+ * @private
1841
+ * @param {Object} object The object to query.
1842
+ * @returns {Array} Returns the array of symbols.
1843
+ */
1844
+ var getSymbols$3 = !nativeGetSymbols$1 ? stubArray$1 : function(object) {
1845
+ if (object == null) {
1846
+ return [];
1847
+ }
1848
+ object = Object(object);
1849
+ return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
1850
+ return propertyIsEnumerable.call(object, symbol);
1851
+ });
1852
+ };
1853
+
1854
+ var _getSymbols = getSymbols$3;
1855
+
1856
+ var copyObject$1 = _copyObject,
1857
+ getSymbols$2 = _getSymbols;
1858
+
1859
+ /**
1860
+ * Copies own symbols of `source` to `object`.
1861
+ *
1862
+ * @private
1863
+ * @param {Object} source The object to copy symbols from.
1864
+ * @param {Object} [object={}] The object to copy symbols to.
1865
+ * @returns {Object} Returns `object`.
1866
+ */
1867
+ function copySymbols$1(source, object) {
1868
+ return copyObject$1(source, getSymbols$2(source), object);
1869
+ }
1870
+
1871
+ var _copySymbols = copySymbols$1;
1872
+
1873
+ /**
1874
+ * Appends the elements of `values` to `array`.
1875
+ *
1876
+ * @private
1877
+ * @param {Array} array The array to modify.
1878
+ * @param {Array} values The values to append.
1879
+ * @returns {Array} Returns `array`.
1880
+ */
1881
+
1882
+ function arrayPush$2(array, values) {
1883
+ var index = -1,
1884
+ length = values.length,
1885
+ offset = array.length;
1886
+
1887
+ while (++index < length) {
1888
+ array[offset + index] = values[index];
1889
+ }
1890
+ return array;
1891
+ }
1892
+
1893
+ var _arrayPush = arrayPush$2;
1894
+
1895
+ var overArg = _overArg;
1896
+
1897
+ /** Built-in value references. */
1898
+ var getPrototype$2 = overArg(Object.getPrototypeOf, Object);
1899
+
1900
+ var _getPrototype = getPrototype$2;
1901
+
1902
+ var arrayPush$1 = _arrayPush,
1903
+ getPrototype$1 = _getPrototype,
1904
+ getSymbols$1 = _getSymbols,
1905
+ stubArray = stubArray_1;
1906
+
1907
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1908
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
1909
+
1910
+ /**
1911
+ * Creates an array of the own and inherited enumerable symbols of `object`.
1912
+ *
1913
+ * @private
1914
+ * @param {Object} object The object to query.
1915
+ * @returns {Array} Returns the array of symbols.
1916
+ */
1917
+ var getSymbolsIn$2 = !nativeGetSymbols ? stubArray : function(object) {
1918
+ var result = [];
1919
+ while (object) {
1920
+ arrayPush$1(result, getSymbols$1(object));
1921
+ object = getPrototype$1(object);
1922
+ }
1923
+ return result;
1924
+ };
1925
+
1926
+ var _getSymbolsIn = getSymbolsIn$2;
1927
+
1928
+ var copyObject = _copyObject,
1929
+ getSymbolsIn$1 = _getSymbolsIn;
1930
+
1931
+ /**
1932
+ * Copies own and inherited symbols of `source` to `object`.
1933
+ *
1934
+ * @private
1935
+ * @param {Object} source The object to copy symbols from.
1936
+ * @param {Object} [object={}] The object to copy symbols to.
1937
+ * @returns {Object} Returns `object`.
1938
+ */
1939
+ function copySymbolsIn$1(source, object) {
1940
+ return copyObject(source, getSymbolsIn$1(source), object);
1941
+ }
1942
+
1943
+ var _copySymbolsIn = copySymbolsIn$1;
1944
+
1945
+ var arrayPush = _arrayPush,
1946
+ isArray$1 = isArray_1;
1947
+
1948
+ /**
1949
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1950
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1951
+ * symbols of `object`.
1952
+ *
1953
+ * @private
1954
+ * @param {Object} object The object to query.
1955
+ * @param {Function} keysFunc The function to get the keys of `object`.
1956
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
1957
+ * @returns {Array} Returns the array of property names and symbols.
1958
+ */
1959
+ function baseGetAllKeys$2(object, keysFunc, symbolsFunc) {
1960
+ var result = keysFunc(object);
1961
+ return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
1962
+ }
1963
+
1964
+ var _baseGetAllKeys = baseGetAllKeys$2;
1965
+
1966
+ var baseGetAllKeys$1 = _baseGetAllKeys,
1967
+ getSymbols = _getSymbols,
1968
+ keys$1 = keys_1;
1969
+
1970
+ /**
1971
+ * Creates an array of own enumerable property names and symbols of `object`.
1972
+ *
1973
+ * @private
1974
+ * @param {Object} object The object to query.
1975
+ * @returns {Array} Returns the array of property names and symbols.
1976
+ */
1977
+ function getAllKeys$1(object) {
1978
+ return baseGetAllKeys$1(object, keys$1, getSymbols);
1979
+ }
1980
+
1981
+ var _getAllKeys = getAllKeys$1;
1982
+
1983
+ var baseGetAllKeys = _baseGetAllKeys,
1984
+ getSymbolsIn = _getSymbolsIn,
1985
+ keysIn$1 = keysIn_1;
1986
+
1987
+ /**
1988
+ * Creates an array of own and inherited enumerable property names and
1989
+ * symbols of `object`.
1990
+ *
1991
+ * @private
1992
+ * @param {Object} object The object to query.
1993
+ * @returns {Array} Returns the array of property names and symbols.
1994
+ */
1995
+ function getAllKeysIn$1(object) {
1996
+ return baseGetAllKeys(object, keysIn$1, getSymbolsIn);
1997
+ }
1998
+
1999
+ var _getAllKeysIn = getAllKeysIn$1;
2000
+
2001
+ var getNative$3 = _getNative,
2002
+ root$4 = isObjectLike$5._root;
2003
+
2004
+ /* Built-in method references that are verified to be native. */
2005
+ var DataView$1 = getNative$3(root$4, 'DataView');
2006
+
2007
+ var _DataView = DataView$1;
2008
+
2009
+ var getNative$2 = _getNative,
2010
+ root$3 = isObjectLike$5._root;
2011
+
2012
+ /* Built-in method references that are verified to be native. */
2013
+ var Promise$2 = getNative$2(root$3, 'Promise');
2014
+
2015
+ var _Promise = Promise$2;
2016
+
2017
+ var getNative$1 = _getNative,
2018
+ root$2 = isObjectLike$5._root;
2019
+
2020
+ /* Built-in method references that are verified to be native. */
2021
+ var Set$1 = getNative$1(root$2, 'Set');
2022
+
2023
+ var _Set = Set$1;
2024
+
2025
+ var getNative = _getNative,
2026
+ root$1 = isObjectLike$5._root;
2027
+
2028
+ /* Built-in method references that are verified to be native. */
2029
+ var WeakMap$1 = getNative(root$1, 'WeakMap');
2030
+
2031
+ var _WeakMap = WeakMap$1;
2032
+
2033
+ var DataView = _DataView,
2034
+ Map$1 = _Map,
2035
+ Promise$1 = _Promise,
2036
+ Set = _Set,
2037
+ WeakMap = _WeakMap,
2038
+ baseGetTag = isObjectLike$5._baseGetTag,
2039
+ toSource = _toSource;
2040
+
2041
+ /** `Object#toString` result references. */
2042
+ var mapTag$3 = '[object Map]',
2043
+ objectTag$1 = '[object Object]',
2044
+ promiseTag = '[object Promise]',
2045
+ setTag$3 = '[object Set]',
2046
+ weakMapTag$1 = '[object WeakMap]';
2047
+
2048
+ var dataViewTag$2 = '[object DataView]';
2049
+
2050
+ /** Used to detect maps, sets, and weakmaps. */
2051
+ var dataViewCtorString = toSource(DataView),
2052
+ mapCtorString = toSource(Map$1),
2053
+ promiseCtorString = toSource(Promise$1),
2054
+ setCtorString = toSource(Set),
2055
+ weakMapCtorString = toSource(WeakMap);
2056
+
2057
+ /**
2058
+ * Gets the `toStringTag` of `value`.
2059
+ *
2060
+ * @private
2061
+ * @param {*} value The value to query.
2062
+ * @returns {string} Returns the `toStringTag`.
2063
+ */
2064
+ var getTag$3 = baseGetTag;
2065
+
2066
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2067
+ if ((DataView && getTag$3(new DataView(new ArrayBuffer(1))) != dataViewTag$2) ||
2068
+ (Map$1 && getTag$3(new Map$1) != mapTag$3) ||
2069
+ (Promise$1 && getTag$3(Promise$1.resolve()) != promiseTag) ||
2070
+ (Set && getTag$3(new Set) != setTag$3) ||
2071
+ (WeakMap && getTag$3(new WeakMap) != weakMapTag$1)) {
2072
+ getTag$3 = function(value) {
2073
+ var result = baseGetTag(value),
2074
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
2075
+ ctorString = Ctor ? toSource(Ctor) : '';
2076
+
2077
+ if (ctorString) {
2078
+ switch (ctorString) {
2079
+ case dataViewCtorString: return dataViewTag$2;
2080
+ case mapCtorString: return mapTag$3;
2081
+ case promiseCtorString: return promiseTag;
2082
+ case setCtorString: return setTag$3;
2083
+ case weakMapCtorString: return weakMapTag$1;
2084
+ }
2085
+ }
2086
+ return result;
2087
+ };
2088
+ }
2089
+
2090
+ var _getTag = getTag$3;
2091
+
2092
+ /** Used for built-in method references. */
2093
+
2094
+ var objectProto = Object.prototype;
2095
+
2096
+ /** Used to check objects for own properties. */
2097
+ var hasOwnProperty = objectProto.hasOwnProperty;
2098
+
2099
+ /**
2100
+ * Initializes an array clone.
2101
+ *
2102
+ * @private
2103
+ * @param {Array} array The array to clone.
2104
+ * @returns {Array} Returns the initialized clone.
2105
+ */
2106
+ function initCloneArray$1(array) {
2107
+ var length = array.length,
2108
+ result = new array.constructor(length);
2109
+
2110
+ // Add properties assigned by `RegExp#exec`.
2111
+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
2112
+ result.index = array.index;
2113
+ result.input = array.input;
2114
+ }
2115
+ return result;
2116
+ }
2117
+
2118
+ var _initCloneArray = initCloneArray$1;
2119
+
2120
+ var root = isObjectLike$5._root;
2121
+
2122
+ /** Built-in value references. */
2123
+ var Uint8Array$1 = root.Uint8Array;
2124
+
2125
+ var _Uint8Array = Uint8Array$1;
2126
+
2127
+ var Uint8Array = _Uint8Array;
2128
+
2129
+ /**
2130
+ * Creates a clone of `arrayBuffer`.
2131
+ *
2132
+ * @private
2133
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
2134
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
2135
+ */
2136
+ function cloneArrayBuffer$3(arrayBuffer) {
2137
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2138
+ new Uint8Array(result).set(new Uint8Array(arrayBuffer));
2139
+ return result;
2140
+ }
2141
+
2142
+ var _cloneArrayBuffer = cloneArrayBuffer$3;
2143
+
2144
+ var cloneArrayBuffer$2 = _cloneArrayBuffer;
2145
+
2146
+ /**
2147
+ * Creates a clone of `dataView`.
2148
+ *
2149
+ * @private
2150
+ * @param {Object} dataView The data view to clone.
2151
+ * @param {boolean} [isDeep] Specify a deep clone.
2152
+ * @returns {Object} Returns the cloned data view.
2153
+ */
2154
+ function cloneDataView$1(dataView, isDeep) {
2155
+ var buffer = isDeep ? cloneArrayBuffer$2(dataView.buffer) : dataView.buffer;
2156
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2157
+ }
2158
+
2159
+ var _cloneDataView = cloneDataView$1;
2160
+
2161
+ /** Used to match `RegExp` flags from their coerced string values. */
2162
+
2163
+ var reFlags = /\w*$/;
2164
+
2165
+ /**
2166
+ * Creates a clone of `regexp`.
2167
+ *
2168
+ * @private
2169
+ * @param {Object} regexp The regexp to clone.
2170
+ * @returns {Object} Returns the cloned regexp.
2171
+ */
2172
+ function cloneRegExp$1(regexp) {
2173
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2174
+ result.lastIndex = regexp.lastIndex;
2175
+ return result;
2176
+ }
2177
+
2178
+ var _cloneRegExp = cloneRegExp$1;
2179
+
2180
+ var Symbol = isObjectLike$5._Symbol;
2181
+
2182
+ /** Used to convert symbols to primitives and strings. */
2183
+ var symbolProto = Symbol ? Symbol.prototype : undefined,
2184
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
2185
+
2186
+ /**
2187
+ * Creates a clone of the `symbol` object.
2188
+ *
2189
+ * @private
2190
+ * @param {Object} symbol The symbol object to clone.
2191
+ * @returns {Object} Returns the cloned symbol object.
2192
+ */
2193
+ function cloneSymbol$1(symbol) {
2194
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2195
+ }
2196
+
2197
+ var _cloneSymbol = cloneSymbol$1;
2198
+
2199
+ var cloneArrayBuffer$1 = _cloneArrayBuffer;
2200
+
2201
+ /**
2202
+ * Creates a clone of `typedArray`.
2203
+ *
2204
+ * @private
2205
+ * @param {Object} typedArray The typed array to clone.
2206
+ * @param {boolean} [isDeep] Specify a deep clone.
2207
+ * @returns {Object} Returns the cloned typed array.
2208
+ */
2209
+ function cloneTypedArray$1(typedArray, isDeep) {
2210
+ var buffer = isDeep ? cloneArrayBuffer$1(typedArray.buffer) : typedArray.buffer;
2211
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2212
+ }
2213
+
2214
+ var _cloneTypedArray = cloneTypedArray$1;
2215
+
2216
+ var cloneArrayBuffer = _cloneArrayBuffer,
2217
+ cloneDataView = _cloneDataView,
2218
+ cloneRegExp = _cloneRegExp,
2219
+ cloneSymbol = _cloneSymbol,
2220
+ cloneTypedArray = _cloneTypedArray;
2221
+
2222
+ /** `Object#toString` result references. */
2223
+ var boolTag$1 = '[object Boolean]',
2224
+ dateTag$1 = '[object Date]',
2225
+ mapTag$2 = '[object Map]',
2226
+ numberTag$1 = '[object Number]',
2227
+ regexpTag$1 = '[object RegExp]',
2228
+ setTag$2 = '[object Set]',
2229
+ stringTag$1 = '[object String]',
2230
+ symbolTag$1 = '[object Symbol]';
2231
+
2232
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
2233
+ dataViewTag$1 = '[object DataView]',
2234
+ float32Tag$1 = '[object Float32Array]',
2235
+ float64Tag$1 = '[object Float64Array]',
2236
+ int8Tag$1 = '[object Int8Array]',
2237
+ int16Tag$1 = '[object Int16Array]',
2238
+ int32Tag$1 = '[object Int32Array]',
2239
+ uint8Tag$1 = '[object Uint8Array]',
2240
+ uint8ClampedTag$1 = '[object Uint8ClampedArray]',
2241
+ uint16Tag$1 = '[object Uint16Array]',
2242
+ uint32Tag$1 = '[object Uint32Array]';
2243
+
2244
+ /**
2245
+ * Initializes an object clone based on its `toStringTag`.
2246
+ *
2247
+ * **Note:** This function only supports cloning values with tags of
2248
+ * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
2249
+ *
2250
+ * @private
2251
+ * @param {Object} object The object to clone.
2252
+ * @param {string} tag The `toStringTag` of the object to clone.
2253
+ * @param {boolean} [isDeep] Specify a deep clone.
2254
+ * @returns {Object} Returns the initialized clone.
2255
+ */
2256
+ function initCloneByTag$1(object, tag, isDeep) {
2257
+ var Ctor = object.constructor;
2258
+ switch (tag) {
2259
+ case arrayBufferTag$1:
2260
+ return cloneArrayBuffer(object);
2261
+
2262
+ case boolTag$1:
2263
+ case dateTag$1:
2264
+ return new Ctor(+object);
2265
+
2266
+ case dataViewTag$1:
2267
+ return cloneDataView(object, isDeep);
2268
+
2269
+ case float32Tag$1: case float64Tag$1:
2270
+ case int8Tag$1: case int16Tag$1: case int32Tag$1:
2271
+ case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
2272
+ return cloneTypedArray(object, isDeep);
2273
+
2274
+ case mapTag$2:
2275
+ return new Ctor;
2276
+
2277
+ case numberTag$1:
2278
+ case stringTag$1:
2279
+ return new Ctor(object);
2280
+
2281
+ case regexpTag$1:
2282
+ return cloneRegExp(object);
2283
+
2284
+ case setTag$2:
2285
+ return new Ctor;
2286
+
2287
+ case symbolTag$1:
2288
+ return cloneSymbol(object);
2289
+ }
2290
+ }
2291
+
2292
+ var _initCloneByTag = initCloneByTag$1;
2293
+
2294
+ var isObject$1 = isObjectLike$5.isObject_1;
2295
+
2296
+ /** Built-in value references. */
2297
+ var objectCreate = Object.create;
2298
+
2299
+ /**
2300
+ * The base implementation of `_.create` without support for assigning
2301
+ * properties to the created object.
2302
+ *
2303
+ * @private
2304
+ * @param {Object} proto The object to inherit from.
2305
+ * @returns {Object} Returns the new object.
2306
+ */
2307
+ var baseCreate$1 = (function() {
2308
+ function object() {}
2309
+ return function(proto) {
2310
+ if (!isObject$1(proto)) {
2311
+ return {};
2312
+ }
2313
+ if (objectCreate) {
2314
+ return objectCreate(proto);
2315
+ }
2316
+ object.prototype = proto;
2317
+ var result = new object;
2318
+ object.prototype = undefined;
2319
+ return result;
2320
+ };
2321
+ }());
2322
+
2323
+ var _baseCreate = baseCreate$1;
2324
+
2325
+ var baseCreate = _baseCreate,
2326
+ getPrototype = _getPrototype,
2327
+ isPrototype = _isPrototype;
2328
+
2329
+ /**
2330
+ * Initializes an object clone.
2331
+ *
2332
+ * @private
2333
+ * @param {Object} object The object to clone.
2334
+ * @returns {Object} Returns the initialized clone.
2335
+ */
2336
+ function initCloneObject$1(object) {
2337
+ return (typeof object.constructor == 'function' && !isPrototype(object))
2338
+ ? baseCreate(getPrototype(object))
2339
+ : {};
2340
+ }
2341
+
2342
+ var _initCloneObject = initCloneObject$1;
2343
+
2344
+ var getTag$2 = _getTag,
2345
+ isObjectLike$1 = isObjectLike$5.isObjectLike_1;
2346
+
2347
+ /** `Object#toString` result references. */
2348
+ var mapTag$1 = '[object Map]';
2349
+
2350
+ /**
2351
+ * The base implementation of `_.isMap` without Node.js optimizations.
2352
+ *
2353
+ * @private
2354
+ * @param {*} value The value to check.
2355
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2356
+ */
2357
+ function baseIsMap$1(value) {
2358
+ return isObjectLike$1(value) && getTag$2(value) == mapTag$1;
2359
+ }
2360
+
2361
+ var _baseIsMap = baseIsMap$1;
2362
+
2363
+ var baseIsMap = _baseIsMap,
2364
+ baseUnary$1 = _baseUnary,
2365
+ nodeUtil$1 = _nodeUtilExports;
2366
+
2367
+ /* Node.js helper references. */
2368
+ var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
2369
+
2370
+ /**
2371
+ * Checks if `value` is classified as a `Map` object.
2372
+ *
2373
+ * @static
2374
+ * @memberOf _
2375
+ * @since 4.3.0
2376
+ * @category Lang
2377
+ * @param {*} value The value to check.
2378
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2379
+ * @example
2380
+ *
2381
+ * _.isMap(new Map);
2382
+ * // => true
2383
+ *
2384
+ * _.isMap(new WeakMap);
2385
+ * // => false
2386
+ */
2387
+ var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
2388
+
2389
+ var isMap_1 = isMap$1;
2390
+
2391
+ var getTag$1 = _getTag,
2392
+ isObjectLike = isObjectLike$5.isObjectLike_1;
2393
+
2394
+ /** `Object#toString` result references. */
2395
+ var setTag$1 = '[object Set]';
2396
+
2397
+ /**
2398
+ * The base implementation of `_.isSet` without Node.js optimizations.
2399
+ *
2400
+ * @private
2401
+ * @param {*} value The value to check.
2402
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2403
+ */
2404
+ function baseIsSet$1(value) {
2405
+ return isObjectLike(value) && getTag$1(value) == setTag$1;
2406
+ }
2407
+
2408
+ var _baseIsSet = baseIsSet$1;
2409
+
2410
+ var baseIsSet = _baseIsSet,
2411
+ baseUnary = _baseUnary,
2412
+ nodeUtil = _nodeUtilExports;
2413
+
2414
+ /* Node.js helper references. */
2415
+ var nodeIsSet = nodeUtil && nodeUtil.isSet;
2416
+
2417
+ /**
2418
+ * Checks if `value` is classified as a `Set` object.
2419
+ *
2420
+ * @static
2421
+ * @memberOf _
2422
+ * @since 4.3.0
2423
+ * @category Lang
2424
+ * @param {*} value The value to check.
2425
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2426
+ * @example
2427
+ *
2428
+ * _.isSet(new Set);
2429
+ * // => true
2430
+ *
2431
+ * _.isSet(new WeakSet);
2432
+ * // => false
2433
+ */
2434
+ var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
2435
+
2436
+ var isSet_1 = isSet$1;
2437
+
2438
+ var Stack = _Stack,
2439
+ arrayEach = _arrayEach,
2440
+ assignValue = _assignValue,
2441
+ baseAssign = _baseAssign,
2442
+ baseAssignIn = _baseAssignIn,
2443
+ cloneBuffer = _cloneBufferExports,
2444
+ copyArray = _copyArray,
2445
+ copySymbols = _copySymbols,
2446
+ copySymbolsIn = _copySymbolsIn,
2447
+ getAllKeys = _getAllKeys,
2448
+ getAllKeysIn = _getAllKeysIn,
2449
+ getTag = _getTag,
2450
+ initCloneArray = _initCloneArray,
2451
+ initCloneByTag = _initCloneByTag,
2452
+ initCloneObject = _initCloneObject,
2453
+ isArray = isArray_1,
2454
+ isBuffer = isBufferExports,
2455
+ isMap = isMap_1,
2456
+ isObject = isObjectLike$5.isObject_1,
2457
+ isSet = isSet_1,
2458
+ keys = keys_1,
2459
+ keysIn = keysIn_1;
2460
+
2461
+ /** Used to compose bitmasks for cloning. */
2462
+ var CLONE_DEEP_FLAG$1 = 1,
2463
+ CLONE_FLAT_FLAG = 2,
2464
+ CLONE_SYMBOLS_FLAG$1 = 4;
2465
+
2466
+ /** `Object#toString` result references. */
2467
+ var argsTag = '[object Arguments]',
2468
+ arrayTag = '[object Array]',
2469
+ boolTag = '[object Boolean]',
2470
+ dateTag = '[object Date]',
2471
+ errorTag = '[object Error]',
2472
+ funcTag = '[object Function]',
2473
+ genTag = '[object GeneratorFunction]',
2474
+ mapTag = '[object Map]',
2475
+ numberTag = '[object Number]',
2476
+ objectTag = '[object Object]',
2477
+ regexpTag = '[object RegExp]',
2478
+ setTag = '[object Set]',
2479
+ stringTag = '[object String]',
2480
+ symbolTag = '[object Symbol]',
2481
+ weakMapTag = '[object WeakMap]';
2482
+
2483
+ var arrayBufferTag = '[object ArrayBuffer]',
2484
+ dataViewTag = '[object DataView]',
2485
+ float32Tag = '[object Float32Array]',
2486
+ float64Tag = '[object Float64Array]',
2487
+ int8Tag = '[object Int8Array]',
2488
+ int16Tag = '[object Int16Array]',
2489
+ int32Tag = '[object Int32Array]',
2490
+ uint8Tag = '[object Uint8Array]',
2491
+ uint8ClampedTag = '[object Uint8ClampedArray]',
2492
+ uint16Tag = '[object Uint16Array]',
2493
+ uint32Tag = '[object Uint32Array]';
2494
+
2495
+ /** Used to identify `toStringTag` values supported by `_.clone`. */
2496
+ var cloneableTags = {};
2497
+ cloneableTags[argsTag] = cloneableTags[arrayTag] =
2498
+ cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
2499
+ cloneableTags[boolTag] = cloneableTags[dateTag] =
2500
+ cloneableTags[float32Tag] = cloneableTags[float64Tag] =
2501
+ cloneableTags[int8Tag] = cloneableTags[int16Tag] =
2502
+ cloneableTags[int32Tag] = cloneableTags[mapTag] =
2503
+ cloneableTags[numberTag] = cloneableTags[objectTag] =
2504
+ cloneableTags[regexpTag] = cloneableTags[setTag] =
2505
+ cloneableTags[stringTag] = cloneableTags[symbolTag] =
2506
+ cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
2507
+ cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
2508
+ cloneableTags[errorTag] = cloneableTags[funcTag] =
2509
+ cloneableTags[weakMapTag] = false;
2510
+
2511
+ /**
2512
+ * The base implementation of `_.clone` and `_.cloneDeep` which tracks
2513
+ * traversed objects.
2514
+ *
2515
+ * @private
2516
+ * @param {*} value The value to clone.
2517
+ * @param {boolean} bitmask The bitmask flags.
2518
+ * 1 - Deep clone
2519
+ * 2 - Flatten inherited properties
2520
+ * 4 - Clone symbols
2521
+ * @param {Function} [customizer] The function to customize cloning.
2522
+ * @param {string} [key] The key of `value`.
2523
+ * @param {Object} [object] The parent object of `value`.
2524
+ * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
2525
+ * @returns {*} Returns the cloned value.
2526
+ */
2527
+ function baseClone$1(value, bitmask, customizer, key, object, stack) {
2528
+ var result,
2529
+ isDeep = bitmask & CLONE_DEEP_FLAG$1,
2530
+ isFlat = bitmask & CLONE_FLAT_FLAG,
2531
+ isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
2532
+
2533
+ if (customizer) {
2534
+ result = object ? customizer(value, key, object, stack) : customizer(value);
2535
+ }
2536
+ if (result !== undefined) {
2537
+ return result;
2538
+ }
2539
+ if (!isObject(value)) {
2540
+ return value;
2541
+ }
2542
+ var isArr = isArray(value);
2543
+ if (isArr) {
2544
+ result = initCloneArray(value);
2545
+ if (!isDeep) {
2546
+ return copyArray(value, result);
2547
+ }
2548
+ } else {
2549
+ var tag = getTag(value),
2550
+ isFunc = tag == funcTag || tag == genTag;
2551
+
2552
+ if (isBuffer(value)) {
2553
+ return cloneBuffer(value, isDeep);
2554
+ }
2555
+ if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
2556
+ result = (isFlat || isFunc) ? {} : initCloneObject(value);
2557
+ if (!isDeep) {
2558
+ return isFlat
2559
+ ? copySymbolsIn(value, baseAssignIn(result, value))
2560
+ : copySymbols(value, baseAssign(result, value));
2561
+ }
2562
+ } else {
2563
+ if (!cloneableTags[tag]) {
2564
+ return object ? value : {};
2565
+ }
2566
+ result = initCloneByTag(value, tag, isDeep);
2567
+ }
2568
+ }
2569
+ // Check for circular references and return its corresponding clone.
2570
+ stack || (stack = new Stack);
2571
+ var stacked = stack.get(value);
2572
+ if (stacked) {
2573
+ return stacked;
2574
+ }
2575
+ stack.set(value, result);
2576
+
2577
+ if (isSet(value)) {
2578
+ value.forEach(function(subValue) {
2579
+ result.add(baseClone$1(subValue, bitmask, customizer, subValue, value, stack));
2580
+ });
2581
+ } else if (isMap(value)) {
2582
+ value.forEach(function(subValue, key) {
2583
+ result.set(key, baseClone$1(subValue, bitmask, customizer, key, value, stack));
2584
+ });
2585
+ }
2586
+
2587
+ var keysFunc = isFull
2588
+ ? (isFlat ? getAllKeysIn : getAllKeys)
2589
+ : (isFlat ? keysIn : keys);
2590
+
2591
+ var props = isArr ? undefined : keysFunc(value);
2592
+ arrayEach(props || value, function(subValue, key) {
2593
+ if (props) {
2594
+ key = subValue;
2595
+ subValue = value[key];
2596
+ }
2597
+ // Recursively populate clone (susceptible to call stack limits).
2598
+ assignValue(result, key, baseClone$1(subValue, bitmask, customizer, key, value, stack));
2599
+ });
2600
+ return result;
2601
+ }
2602
+
2603
+ var _baseClone = baseClone$1;
2604
+
2605
+ var baseClone = _baseClone;
2606
+
2607
+ /** Used to compose bitmasks for cloning. */
2608
+ var CLONE_DEEP_FLAG = 1,
2609
+ CLONE_SYMBOLS_FLAG = 4;
2610
+
2611
+ /**
2612
+ * This method is like `_.clone` except that it recursively clones `value`.
2613
+ *
2614
+ * @static
2615
+ * @memberOf _
2616
+ * @since 1.0.0
2617
+ * @category Lang
2618
+ * @param {*} value The value to recursively clone.
2619
+ * @returns {*} Returns the deep cloned value.
2620
+ * @see _.clone
2621
+ * @example
2622
+ *
2623
+ * var objects = [{ 'a': 1 }, { 'b': 2 }];
2624
+ *
2625
+ * var deep = _.cloneDeep(objects);
2626
+ * console.log(deep[0] === objects[0]);
2627
+ * // => false
2628
+ */
2629
+ function cloneDeep(value) {
2630
+ return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
2631
+ }
2632
+
2633
+ var cloneDeep_1 = cloneDeep;
2634
+
2635
+ var cloneDeep$1 = /*@__PURE__*/isObjectLike$5.getDefaultExportFromCjs(cloneDeep_1);
2636
+
2637
+ function uniqueNodes(nodes) {
2638
+ const result = new Map();
2639
+ nodes.forEach(node => {
2640
+ result.set(`${node.__typename}-${node.id}`, node);
2641
+ });
2642
+ return Array.from(result.values());
2643
+ }
2644
+
2645
+ function createEdge(node) {
2646
+ return {
2647
+ node: node,
2648
+ cursor: "",
2649
+ __typename: `${node.__typename}Edge`,
2650
+ };
2651
+ }
2652
+ function uniqueEdges(edges) {
2653
+ const result = new Map();
2654
+ edges.forEach(edge => {
2655
+ result.set(`${edge.__typename}-${edge.node.__typename}-${edge.node.id}`, edge);
2656
+ });
2657
+ return Array.from(result.values());
2658
+ }
2659
+
2660
+ const { useQuery } = apolloClient__namespace;
2661
+ function useCollectionQuery({ query, queryOptions, getCollectionByPath, subscription, }) {
2662
+ var _a, _b;
2663
+ const { data, loading, refetch, error, fetchMore, subscribeToMore } = useQuery(query, queryOptions);
2664
+ const isMounted = useIsMounted.useIsMounted();
2665
+ const [loadingRefresh, setLoadingRefresh] = require$$1.useState(false);
2666
+ const [loadingNextPage, setLoadingNextPage] = require$$1.useState(false);
2667
+ const [hookError, setHookError] = require$$1.useState();
2668
+ const loadingInitialContent = loading && !loadingRefresh && !loadingNextPage;
2669
+ const isSearching = !!((_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.variables) === null || _a === void 0 ? void 0 : _a.searchTerm);
2670
+ const refresh = require$$1.useCallback(() => {
2671
+ if (loadingInitialContent || loadingRefresh) {
2672
+ return;
2673
+ }
2674
+ setLoadingRefresh(true);
2675
+ fetchMore({
2676
+ // a workaround fix for the error described in this post
2677
+ // https://github.com/apollographql/apollo-client/issues/7491#issuecomment-767985363
2678
+ // These changes can be reverted once we can update to version 3.4
2679
+ // (the current release candidate)
2680
+ variables: {},
2681
+ updateQuery: (prev, { fetchMoreResult }) => fetchMoreResult || prev,
2682
+ })
2683
+ .catch(err => formatters.config.errorNotifier("Refetch Error", err))
2684
+ .finally(() => {
2685
+ if (isMounted.current) {
2686
+ setLoadingRefresh(false);
2687
+ }
2688
+ });
2689
+ }, [
2690
+ loadingInitialContent,
2691
+ loadingRefresh,
2692
+ setLoadingRefresh,
2693
+ refetch,
2694
+ isMounted,
2695
+ ]);
2696
+ const nextPage = require$$1.useCallback(() => {
2697
+ var _a;
2698
+ if (loadingInitialContent || loadingRefresh || loadingNextPage) {
2699
+ return;
2700
+ }
2701
+ const pageInfo = (_a = getCollectionByPath(data)) === null || _a === void 0 ? void 0 : _a.pageInfo;
2702
+ if (!pageInfo || !pageInfo.hasNextPage) {
2703
+ return;
2704
+ }
2705
+ setLoadingNextPage(true);
2706
+ setHookError(undefined);
2707
+ fetchMore({
2708
+ variables: {
2709
+ cursor: pageInfo.endCursor,
2710
+ },
2711
+ updateQuery: (prev, { fetchMoreResult }) => fetchMoreUpdateQueryHandler(prev, fetchMoreResult, getCollectionByPath),
2712
+ })
2713
+ .catch(err => {
2714
+ formatters.config.errorNotifier("FetchMore Error", err);
2715
+ setHookError(err);
2716
+ })
2717
+ .finally(() => {
2718
+ if (isMounted.current) {
2719
+ setLoadingNextPage(false);
2720
+ }
2721
+ });
2722
+ }, [
2723
+ data,
2724
+ loadingInitialContent,
2725
+ loadingRefresh,
2726
+ fetchMore,
2727
+ loadingNextPage,
2728
+ setLoadingNextPage,
2729
+ getCollectionByPath,
2730
+ isMounted,
2731
+ ]);
2732
+ require$$1.useEffect(() => {
2733
+ if (subscription == undefined)
2734
+ return;
2735
+ const subscriptionOptions = subscription.options || {};
2736
+ // Reset this state so we can handle errors from the subscription
2737
+ setHookError(undefined);
2738
+ return subscribeToMore(Object.assign(Object.assign({}, subscriptionOptions), { document: subscription.document, updateQuery: (prev, { subscriptionData }) => subscribeToMoreHandler(isSearching, prev, getCollectionByPath, subscriptionData === null || subscriptionData === void 0 ? void 0 : subscriptionData.data, subscription.getNodeByPath), onError: err => {
2739
+ formatters.config.errorNotifier("Subscribe to More Error", err);
2740
+ setHookError(err);
2741
+ } }));
2742
+ },
2743
+ // Disabling this linter so we can force this only run once. If we didn't
2744
+ // do this we would need to ensure subscription, subscribeToMore, and getNodeByPath
2745
+ // all use useCallback.
2746
+ [(_b = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.variables) === null || _b === void 0 ? void 0 : _b.searchTerm]);
2747
+ const combinedError = error || hookError;
2748
+ return {
2749
+ data,
2750
+ error: combinedError,
2751
+ refresh,
2752
+ loadingRefresh,
2753
+ nextPage,
2754
+ loadingNextPage,
2755
+ loadingInitialContent,
2756
+ };
2757
+ }
2758
+ /**
2759
+ * The following method uses an `output` variable, and indirectly modifies it through the `outputCollection` variable.
2760
+ * This type of indirect modification is prone to bugs, but I couldn't think of a better way to write this code.
2761
+ *
2762
+ * Here's what I was balancing:
2763
+ * 1. We need to copy the structure of prev to ensure that when we're combining two objects, we're not losing properties
2764
+ * 2. We need to extract a key from an unknown path that's given to us by getCollectionByPath and then we need to modify
2765
+ * that, and ensure that it's properly set on the cloned output object.
2766
+ * 3. We want to keep the interface to this hook as simple and easy to use as possible
2767
+ *
2768
+ * The alternative approaches that were rejected:
2769
+ * 1. We replace the getCollectionByPath with a keyPath string. (Eg. "data.conversation.message") and then we use lodash
2770
+ * `get` and `set` which should remove all the object manipulation. But, this approach loses us the type safety that
2771
+ * getCollectionByPath gives us
2772
+ * 2. We could add a setCollection function to the list of arguments for this hook. This leaves us with type safety but
2773
+ * makes the `useCollectionQuery` interface more complicated by adding arguments
2774
+ */
2775
+ function fetchMoreUpdateQueryHandler(prev, fetchMoreResult, getCollectionByPath) {
2776
+ const nextCollection = getCollectionByPath(fetchMoreResult);
2777
+ const output = cloneDeep$1(prev);
2778
+ const outputCollection = getCollectionByPath(output);
2779
+ if (outputCollection === undefined || nextCollection === undefined) {
2780
+ return output;
2781
+ }
2782
+ if (outputCollection.nodes && nextCollection.nodes) {
2783
+ outputCollection.nodes = getUpdatedNodes(outputCollection.nodes, nextCollection.nodes);
2784
+ }
2785
+ if (outputCollection.edges && nextCollection.edges) {
2786
+ outputCollection.edges = getUpdatedEdges(outputCollection.edges, nextCollection.edges);
2787
+ }
2788
+ Object.assign(outputCollection, Object.assign({ pageInfo: cloneDeep$1(nextCollection.pageInfo) }, getTotalCount(nextCollection.totalCount)));
2789
+ return output;
2790
+ }
2791
+ function subscribeToMoreHandler(isSearching, prev, getCollectionByPath, subscriptionData, getNodeByPath) {
2792
+ const node = getNodeByPath(subscriptionData);
2793
+ const output = cloneDeep$1(prev);
2794
+ const outputCollection = getCollectionByPath(output);
2795
+ if (outputCollection == undefined || node == undefined)
2796
+ return output;
2797
+ if (isAlreadyUpdated(outputCollection, node) || isSearching) {
2798
+ return prev;
2799
+ }
2800
+ if (outputCollection.nodes) {
2801
+ outputCollection.nodes = getUpdatedNodes(outputCollection.nodes, [node], false);
2802
+ }
2803
+ if (outputCollection.edges) {
2804
+ outputCollection.edges = getUpdatedEdges(outputCollection.edges, [createEdge(node)], false);
2805
+ }
2806
+ Object.assign(outputCollection, Object.assign({ pageInfo: cloneDeep$1(outputCollection.pageInfo) }, getTotalCount(outputCollection.totalCount, 1)));
2807
+ return output;
2808
+ }
2809
+ function getTotalCount(totalCount, additionalCount = 0) {
2810
+ return totalCount !== undefined
2811
+ ? { totalCount: totalCount + additionalCount }
2812
+ : {};
2813
+ }
2814
+ function isAlreadyUpdated(outputCollection, newNode) {
2815
+ let edgesAlreadyUpdated = true;
2816
+ let nodesAlreadyUpdated = true;
2817
+ if (outputCollection.edges) {
2818
+ edgesAlreadyUpdated = outputCollection.edges.some(edge => {
2819
+ return edge.node.id === newNode.id;
2820
+ });
2821
+ }
2822
+ if (outputCollection.nodes) {
2823
+ nodesAlreadyUpdated = outputCollection.nodes.some(node => {
2824
+ return node.id === newNode.id;
2825
+ });
2826
+ }
2827
+ return edgesAlreadyUpdated && nodesAlreadyUpdated;
2828
+ }
2829
+ function getUpdatedEdges(prevEdges, nextEdges, appendToEnd = true) {
2830
+ const newEdges = appendToEnd
2831
+ ? [...prevEdges, ...nextEdges]
2832
+ : [...nextEdges, ...prevEdges];
2833
+ return uniqueEdges(newEdges);
2834
+ }
2835
+ function getUpdatedNodes(prevNodes, nextNodes, appendToEnd = true) {
2836
+ const newNodes = appendToEnd
2837
+ ? [...prevNodes, ...nextNodes]
2838
+ : [...nextNodes, ...prevNodes];
2839
+ return uniqueNodes(newNodes);
2840
+ }
2841
+
2842
+ exports.useCollectionQuery = useCollectionQuery;