@revolist/revogrid 4.4.0-next.2 → 4.4.0-next.21

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 (243) hide show
  1. package/custom-element/columnService.js +1 -1
  2. package/custom-element/consts.js +2 -1
  3. package/custom-element/consts.js.map +1 -1
  4. package/custom-element/localScrollService.js +1 -1
  5. package/custom-element/localScrollService.js.map +1 -1
  6. package/custom-element/revo-grid.js +163 -97
  7. package/custom-element/revo-grid.js.map +1 -1
  8. package/custom-element/revogr-clipboard.js +24 -5
  9. package/custom-element/revogr-clipboard.js.map +1 -1
  10. package/custom-element/revogr-edit2.js +12 -6
  11. package/custom-element/revogr-edit2.js.map +1 -1
  12. package/custom-element/revogr-focus2.js +1 -1
  13. package/custom-element/revogr-focus2.js.map +1 -1
  14. package/custom-element/revogr-header2.js +25 -11
  15. package/custom-element/revogr-header2.js.map +1 -1
  16. package/custom-element/revogr-overlay-selection2.js +99 -32
  17. package/custom-element/revogr-overlay-selection2.js.map +1 -1
  18. package/custom-element/revogr-row-headers2.js +1 -2
  19. package/custom-element/revogr-row-headers2.js.map +1 -1
  20. package/custom-element/revogr-viewport-scroll2.js +39 -6
  21. package/custom-element/revogr-viewport-scroll2.js.map +1 -1
  22. package/dist/cjs/{debounce-525dd66c.js → debounce-f50730b6.js} +1 -38
  23. package/dist/cjs/debounce-f50730b6.js.map +1 -0
  24. package/dist/cjs/dispatcher-20520c70.js +21 -0
  25. package/dist/cjs/dispatcher-20520c70.js.map +1 -0
  26. package/dist/cjs/events-030618fc.js +459 -0
  27. package/dist/cjs/events-030618fc.js.map +1 -0
  28. package/dist/cjs/filter.button-6badec7a.js +44 -0
  29. package/dist/cjs/filter.button-6badec7a.js.map +1 -0
  30. package/dist/cjs/{index-aad39b7b.js → index-ee2ef5ae.js} +96 -36
  31. package/dist/cjs/index-ee2ef5ae.js.map +1 -0
  32. package/dist/cjs/index-effc94b9.js +3944 -0
  33. package/dist/cjs/index-effc94b9.js.map +1 -0
  34. package/dist/cjs/isString-3dde8d95.js +38 -0
  35. package/dist/cjs/isString-3dde8d95.js.map +1 -0
  36. package/dist/cjs/keyCodes.utils-d665ebed.js +271 -0
  37. package/dist/cjs/keyCodes.utils-d665ebed.js.map +1 -0
  38. package/dist/cjs/loader.cjs.js +3 -3
  39. package/dist/cjs/loader.cjs.js.map +1 -1
  40. package/dist/cjs/localScrollService-a81823c5.js +403 -0
  41. package/dist/cjs/localScrollService-a81823c5.js.map +1 -0
  42. package/dist/cjs/revo-grid.cjs.entry.js +3858 -0
  43. package/dist/cjs/revo-grid.cjs.entry.js.map +1 -0
  44. package/dist/cjs/revo-grid.cjs.js +3 -3
  45. package/dist/cjs/revo-grid.cjs.js.map +1 -1
  46. package/dist/cjs/revogr-clipboard.cjs.entry.js +24 -6
  47. package/dist/cjs/revogr-clipboard.cjs.entry.js.map +1 -1
  48. package/dist/cjs/revogr-data_3.cjs.entry.js +1138 -0
  49. package/dist/cjs/revogr-data_3.cjs.entry.js.map +1 -0
  50. package/dist/cjs/revogr-edit_2.cjs.entry.js +325 -0
  51. package/dist/cjs/revogr-edit_2.cjs.entry.js.map +1 -0
  52. package/dist/cjs/revogr-filter-panel.cjs.entry.js +6 -5
  53. package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
  54. package/dist/cjs/revogr-focus_5.cjs.entry.js +1231 -0
  55. package/dist/cjs/revogr-focus_5.cjs.entry.js.map +1 -0
  56. package/dist/cjs/{revo-grid_11.cjs.entry.js → viewport.helpers-70ccec8f.js} +13978 -25269
  57. package/dist/cjs/viewport.helpers-70ccec8f.js.map +1 -0
  58. package/dist/collection/collection-manifest.json +1 -1
  59. package/dist/collection/components/clipboard/revogr-clipboard.d.ts +6 -2
  60. package/dist/collection/components/clipboard/revogr-clipboard.js +46 -5
  61. package/dist/collection/components/clipboard/revogr-clipboard.js.map +1 -1
  62. package/dist/collection/components/header/headerCellRenderer.d.ts +2 -1
  63. package/dist/collection/components/header/headerCellRenderer.js +1 -1
  64. package/dist/collection/components/header/headerCellRenderer.js.map +1 -1
  65. package/dist/collection/components/header/headerRenderer.d.ts +2 -2
  66. package/dist/collection/components/header/headerRenderer.js +1 -1
  67. package/dist/collection/components/header/headerRenderer.js.map +1 -1
  68. package/dist/collection/components/header/revogr-header.d.ts +15 -1
  69. package/dist/collection/components/header/revogr-header.js +34 -8
  70. package/dist/collection/components/header/revogr-header.js.map +1 -1
  71. package/dist/collection/components/overlay/autofill.service.d.ts +7 -3
  72. package/dist/collection/components/overlay/autofill.service.js +32 -12
  73. package/dist/collection/components/overlay/autofill.service.js.map +1 -1
  74. package/dist/collection/components/overlay/clipboard.service.d.ts +1 -1
  75. package/dist/collection/components/overlay/clipboard.service.js +2 -2
  76. package/dist/collection/components/overlay/clipboard.service.js.map +1 -1
  77. package/dist/collection/components/overlay/keyboard.service.js +2 -6
  78. package/dist/collection/components/overlay/keyboard.service.js.map +1 -1
  79. package/dist/collection/components/overlay/revogr-edit.d.ts +8 -0
  80. package/dist/collection/components/overlay/revogr-edit.js +34 -9
  81. package/dist/collection/components/overlay/revogr-edit.js.map +1 -1
  82. package/dist/collection/components/overlay/revogr-overlay-selection.d.ts +32 -10
  83. package/dist/collection/components/overlay/revogr-overlay-selection.js +80 -12
  84. package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -1
  85. package/dist/collection/components/overlay/revogr-overlay-style.css +71 -4
  86. package/dist/collection/components/revoGrid/revo-grid.d.ts +15 -4
  87. package/dist/collection/components/revoGrid/revo-grid.js +60 -19
  88. package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
  89. package/dist/collection/components/revoGrid/viewport.scrolling.service.d.ts +6 -2
  90. package/dist/collection/components/revoGrid/viewport.scrolling.service.js +26 -4
  91. package/dist/collection/components/revoGrid/viewport.scrolling.service.js.map +1 -1
  92. package/dist/collection/components/revoGrid/viewport.section.d.ts +3 -2
  93. package/dist/collection/components/revoGrid/viewport.section.js +8 -4
  94. package/dist/collection/components/revoGrid/viewport.section.js.map +1 -1
  95. package/dist/collection/components/revoGrid/viewport.service.d.ts +4 -0
  96. package/dist/collection/components/revoGrid/viewport.service.js +15 -3
  97. package/dist/collection/components/revoGrid/viewport.service.js.map +1 -1
  98. package/dist/collection/components/rowHeaders/revogr-row-headers.js.map +1 -1
  99. package/dist/collection/components/scroll/revogr-viewport-scroll-style.css +3 -0
  100. package/dist/collection/components/scroll/revogr-viewport-scroll.d.ts +16 -5
  101. package/dist/collection/components/scroll/revogr-viewport-scroll.js +64 -9
  102. package/dist/collection/components/scroll/revogr-viewport-scroll.js.map +1 -1
  103. package/dist/collection/components/selectionFocus/revogr-focus-style.css +1 -1
  104. package/dist/collection/components.d.ts +110 -6
  105. package/dist/collection/interfaces.d.ts +4 -1
  106. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.d.ts +3 -2
  107. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js +2 -2
  108. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js.map +1 -1
  109. package/dist/collection/plugins/groupingColumn/headerGroupRenderer.d.ts +2 -2
  110. package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js +1 -1
  111. package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js.map +1 -1
  112. package/dist/collection/plugins/sorting/sorting.plugin.d.ts +21 -13
  113. package/dist/collection/plugins/sorting/sorting.plugin.js +77 -70
  114. package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
  115. package/dist/collection/serve/controller.js +183 -0
  116. package/dist/collection/services/localScrollService.js +1 -1
  117. package/dist/collection/services/localScrollService.js.map +1 -1
  118. package/dist/collection/services/resizable.directive.d.ts +8 -7
  119. package/dist/collection/services/resizable.directive.js +13 -36
  120. package/dist/collection/services/resizable.directive.js.map +1 -1
  121. package/dist/collection/services/resizable.element.d.ts +4 -0
  122. package/dist/collection/services/resizable.element.js +39 -0
  123. package/dist/collection/services/resizable.element.js.map +1 -0
  124. package/dist/collection/stencil-public-runtime.d.ts +1 -0
  125. package/dist/collection/store/viewPort/viewport.store.js +0 -1
  126. package/dist/collection/store/viewPort/viewport.store.js.map +1 -1
  127. package/dist/collection/utils/consts.d.ts +1 -0
  128. package/dist/collection/utils/consts.js +1 -0
  129. package/dist/collection/utils/consts.js.map +1 -1
  130. package/dist/collection/utils/events.d.ts +2 -1
  131. package/dist/collection/utils/events.js +18 -2
  132. package/dist/collection/utils/events.js.map +1 -1
  133. package/dist/collection/utils/mobile.d.ts +1 -0
  134. package/dist/collection/utils/mobile.js +7 -0
  135. package/dist/collection/utils/mobile.js.map +1 -0
  136. package/dist/esm/{debounce-301fd4d2.js → debounce-820b5a8b.js} +2 -34
  137. package/dist/esm/debounce-820b5a8b.js.map +1 -0
  138. package/dist/esm/dispatcher-9e9c0233.js +19 -0
  139. package/dist/esm/dispatcher-9e9c0233.js.map +1 -0
  140. package/dist/esm/events-31272e5e.js +454 -0
  141. package/dist/esm/events-31272e5e.js.map +1 -0
  142. package/dist/esm/filter.button-21ce90ef.js +38 -0
  143. package/dist/esm/filter.button-21ce90ef.js.map +1 -0
  144. package/dist/esm/{index-5e90b19b.js → index-05947c5f.js} +97 -37
  145. package/dist/esm/index-05947c5f.js.map +1 -0
  146. package/dist/esm/index-728bf6e3.js +3889 -0
  147. package/dist/esm/index-728bf6e3.js.map +1 -0
  148. package/dist/esm/isString-d539060a.js +36 -0
  149. package/dist/esm/isString-d539060a.js.map +1 -0
  150. package/dist/esm/keyCodes.utils-c0064460.js +265 -0
  151. package/dist/esm/keyCodes.utils-c0064460.js.map +1 -0
  152. package/dist/esm/loader.js +4 -4
  153. package/dist/esm/loader.js.map +1 -1
  154. package/dist/esm/localScrollService-884d8952.js +400 -0
  155. package/dist/esm/localScrollService-884d8952.js.map +1 -0
  156. package/dist/esm/revo-grid.entry.js +3854 -0
  157. package/dist/esm/revo-grid.entry.js.map +1 -0
  158. package/dist/esm/revo-grid.js +4 -4
  159. package/dist/esm/revo-grid.js.map +1 -1
  160. package/dist/esm/revogr-clipboard.entry.js +24 -6
  161. package/dist/esm/revogr-clipboard.entry.js.map +1 -1
  162. package/dist/esm/revogr-data_3.entry.js +1132 -0
  163. package/dist/esm/revogr-data_3.entry.js.map +1 -0
  164. package/dist/esm/revogr-edit_2.entry.js +320 -0
  165. package/dist/esm/revogr-edit_2.entry.js.map +1 -0
  166. package/dist/esm/revogr-filter-panel.entry.js +3 -2
  167. package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
  168. package/dist/esm/revogr-focus_5.entry.js +1223 -0
  169. package/dist/esm/revogr-focus_5.entry.js.map +1 -0
  170. package/dist/esm/{revo-grid_11.entry.js → viewport.helpers-c08e729e.js} +13790 -25093
  171. package/dist/esm/viewport.helpers-c08e729e.js.map +1 -0
  172. package/dist/revo-grid/debounce-820b5a8b.js +5 -0
  173. package/dist/revo-grid/debounce-820b5a8b.js.map +1 -0
  174. package/dist/revo-grid/dispatcher-9e9c0233.js +5 -0
  175. package/dist/revo-grid/dispatcher-9e9c0233.js.map +1 -0
  176. package/dist/revo-grid/events-31272e5e.js +5 -0
  177. package/dist/revo-grid/events-31272e5e.js.map +1 -0
  178. package/dist/revo-grid/filter.button-21ce90ef.js +5 -0
  179. package/dist/revo-grid/filter.button-21ce90ef.js.map +1 -0
  180. package/dist/revo-grid/index-05947c5f.js +6 -0
  181. package/dist/revo-grid/index-05947c5f.js.map +1 -0
  182. package/dist/revo-grid/index-728bf6e3.js +5 -0
  183. package/dist/revo-grid/index-728bf6e3.js.map +1 -0
  184. package/dist/revo-grid/isString-d539060a.js +5 -0
  185. package/dist/revo-grid/isString-d539060a.js.map +1 -0
  186. package/dist/revo-grid/keyCodes.utils-c0064460.js +5 -0
  187. package/dist/revo-grid/keyCodes.utils-c0064460.js.map +1 -0
  188. package/dist/revo-grid/localScrollService-884d8952.js +5 -0
  189. package/dist/revo-grid/localScrollService-884d8952.js.map +1 -0
  190. package/dist/revo-grid/revo-grid.entry.js +5 -0
  191. package/dist/revo-grid/revo-grid.entry.js.map +1 -0
  192. package/dist/revo-grid/revo-grid.esm.js +1 -1
  193. package/dist/revo-grid/revo-grid.esm.js.map +1 -1
  194. package/dist/revo-grid/revogr-clipboard.entry.js +1 -1
  195. package/dist/revo-grid/revogr-clipboard.entry.js.map +1 -1
  196. package/dist/revo-grid/revogr-data_3.entry.js +5 -0
  197. package/dist/revo-grid/revogr-data_3.entry.js.map +1 -0
  198. package/dist/revo-grid/revogr-edit_2.entry.js +5 -0
  199. package/dist/revo-grid/revogr-edit_2.entry.js.map +1 -0
  200. package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
  201. package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
  202. package/dist/revo-grid/revogr-focus_5.entry.js +5 -0
  203. package/dist/revo-grid/revogr-focus_5.entry.js.map +1 -0
  204. package/dist/revo-grid/viewport.helpers-c08e729e.js +5 -0
  205. package/dist/revo-grid/viewport.helpers-c08e729e.js.map +1 -0
  206. package/dist/types/components/clipboard/revogr-clipboard.d.ts +6 -2
  207. package/dist/types/components/header/headerCellRenderer.d.ts +2 -1
  208. package/dist/types/components/header/headerRenderer.d.ts +2 -2
  209. package/dist/types/components/header/revogr-header.d.ts +15 -1
  210. package/dist/types/components/overlay/autofill.service.d.ts +7 -3
  211. package/dist/types/components/overlay/clipboard.service.d.ts +1 -1
  212. package/dist/types/components/overlay/revogr-edit.d.ts +8 -0
  213. package/dist/types/components/overlay/revogr-overlay-selection.d.ts +32 -10
  214. package/dist/types/components/revoGrid/revo-grid.d.ts +15 -4
  215. package/dist/types/components/revoGrid/viewport.scrolling.service.d.ts +6 -2
  216. package/dist/types/components/revoGrid/viewport.section.d.ts +3 -2
  217. package/dist/types/components/revoGrid/viewport.service.d.ts +4 -0
  218. package/dist/types/components/scroll/revogr-viewport-scroll.d.ts +16 -5
  219. package/dist/types/components.d.ts +110 -6
  220. package/dist/types/interfaces.d.ts +4 -1
  221. package/dist/types/plugins/groupingColumn/columnGroupsRenderer.d.ts +3 -2
  222. package/dist/types/plugins/groupingColumn/headerGroupRenderer.d.ts +2 -2
  223. package/dist/types/plugins/sorting/sorting.plugin.d.ts +21 -13
  224. package/dist/types/services/resizable.directive.d.ts +8 -7
  225. package/dist/types/services/resizable.element.d.ts +4 -0
  226. package/dist/types/stencil-public-runtime.d.ts +1 -0
  227. package/dist/types/utils/consts.d.ts +1 -0
  228. package/dist/types/utils/events.d.ts +2 -1
  229. package/dist/types/utils/mobile.d.ts +1 -0
  230. package/package.json +4 -3
  231. package/dist/cjs/debounce-525dd66c.js.map +0 -1
  232. package/dist/cjs/index-aad39b7b.js.map +0 -1
  233. package/dist/cjs/revo-grid_11.cjs.entry.js.map +0 -1
  234. package/dist/esm/debounce-301fd4d2.js.map +0 -1
  235. package/dist/esm/index-5e90b19b.js.map +0 -1
  236. package/dist/esm/revo-grid_11.entry.js.map +0 -1
  237. package/dist/revo-grid/debounce-301fd4d2.js +0 -5
  238. package/dist/revo-grid/debounce-301fd4d2.js.map +0 -1
  239. package/dist/revo-grid/index-5e90b19b.js +0 -6
  240. package/dist/revo-grid/index-5e90b19b.js.map +0 -1
  241. package/dist/revo-grid/revo-grid_11.entry.js +0 -5
  242. package/dist/revo-grid/revo-grid_11.entry.js.map +0 -1
  243. /package/dist/collection/{utilsExternal/generate-data.js → serve/data.js} +0 -0
@@ -0,0 +1,3889 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
4
+ import { a as getRenderingRef, f as forceUpdate } from './index-05947c5f.js';
5
+ import { i as isObjectLike_1, _ as _baseGetTag, c as createCommonjsModule, a as _root, b as _freeGlobal, e as isObject_1, f as _Symbol, g as isSymbol_1, t as toNumber_1 } from './debounce-820b5a8b.js';
6
+
7
+ /**
8
+ * A specialized version of `_.forEach` for arrays without support for
9
+ * iteratee shorthands.
10
+ *
11
+ * @private
12
+ * @param {Array} [array] The array to iterate over.
13
+ * @param {Function} iteratee The function invoked per iteration.
14
+ * @returns {Array} Returns `array`.
15
+ */
16
+ function arrayEach(array, iteratee) {
17
+ var index = -1,
18
+ length = array == null ? 0 : array.length;
19
+
20
+ while (++index < length) {
21
+ if (iteratee(array[index], index, array) === false) {
22
+ break;
23
+ }
24
+ }
25
+ return array;
26
+ }
27
+
28
+ var _arrayEach = arrayEach;
29
+
30
+ /**
31
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
32
+ *
33
+ * @private
34
+ * @param {boolean} [fromRight] Specify iterating from right to left.
35
+ * @returns {Function} Returns the new base function.
36
+ */
37
+ function createBaseFor(fromRight) {
38
+ return function(object, iteratee, keysFunc) {
39
+ var index = -1,
40
+ iterable = Object(object),
41
+ props = keysFunc(object),
42
+ length = props.length;
43
+
44
+ while (length--) {
45
+ var key = props[fromRight ? length : ++index];
46
+ if (iteratee(iterable[key], key, iterable) === false) {
47
+ break;
48
+ }
49
+ }
50
+ return object;
51
+ };
52
+ }
53
+
54
+ var _createBaseFor = createBaseFor;
55
+
56
+ /**
57
+ * The base implementation of `baseForOwn` which iterates over `object`
58
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
59
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
60
+ *
61
+ * @private
62
+ * @param {Object} object The object to iterate over.
63
+ * @param {Function} iteratee The function invoked per iteration.
64
+ * @param {Function} keysFunc The function to get the keys of `object`.
65
+ * @returns {Object} Returns `object`.
66
+ */
67
+ var baseFor = _createBaseFor();
68
+
69
+ var _baseFor = baseFor;
70
+
71
+ /**
72
+ * The base implementation of `_.times` without support for iteratee shorthands
73
+ * or max array length checks.
74
+ *
75
+ * @private
76
+ * @param {number} n The number of times to invoke `iteratee`.
77
+ * @param {Function} iteratee The function invoked per iteration.
78
+ * @returns {Array} Returns the array of results.
79
+ */
80
+ function baseTimes(n, iteratee) {
81
+ var index = -1,
82
+ result = Array(n);
83
+
84
+ while (++index < n) {
85
+ result[index] = iteratee(index);
86
+ }
87
+ return result;
88
+ }
89
+
90
+ var _baseTimes = baseTimes;
91
+
92
+ /** `Object#toString` result references. */
93
+ var argsTag$2 = '[object Arguments]';
94
+
95
+ /**
96
+ * The base implementation of `_.isArguments`.
97
+ *
98
+ * @private
99
+ * @param {*} value The value to check.
100
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
101
+ */
102
+ function baseIsArguments(value) {
103
+ return isObjectLike_1(value) && _baseGetTag(value) == argsTag$2;
104
+ }
105
+
106
+ var _baseIsArguments = baseIsArguments;
107
+
108
+ /** Used for built-in method references. */
109
+ var objectProto$9 = Object.prototype;
110
+
111
+ /** Used to check objects for own properties. */
112
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
113
+
114
+ /** Built-in value references. */
115
+ var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
116
+
117
+ /**
118
+ * Checks if `value` is likely an `arguments` object.
119
+ *
120
+ * @static
121
+ * @memberOf _
122
+ * @since 0.1.0
123
+ * @category Lang
124
+ * @param {*} value The value to check.
125
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
126
+ * else `false`.
127
+ * @example
128
+ *
129
+ * _.isArguments(function() { return arguments; }());
130
+ * // => true
131
+ *
132
+ * _.isArguments([1, 2, 3]);
133
+ * // => false
134
+ */
135
+ var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
136
+ return isObjectLike_1(value) && hasOwnProperty$7.call(value, 'callee') &&
137
+ !propertyIsEnumerable$1.call(value, 'callee');
138
+ };
139
+
140
+ var isArguments_1 = isArguments;
141
+
142
+ /**
143
+ * Checks if `value` is classified as an `Array` object.
144
+ *
145
+ * @static
146
+ * @memberOf _
147
+ * @since 0.1.0
148
+ * @category Lang
149
+ * @param {*} value The value to check.
150
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
151
+ * @example
152
+ *
153
+ * _.isArray([1, 2, 3]);
154
+ * // => true
155
+ *
156
+ * _.isArray(document.body.children);
157
+ * // => false
158
+ *
159
+ * _.isArray('abc');
160
+ * // => false
161
+ *
162
+ * _.isArray(_.noop);
163
+ * // => false
164
+ */
165
+ var isArray = Array.isArray;
166
+
167
+ var isArray_1 = isArray;
168
+
169
+ /**
170
+ * This method returns `false`.
171
+ *
172
+ * @static
173
+ * @memberOf _
174
+ * @since 4.13.0
175
+ * @category Util
176
+ * @returns {boolean} Returns `false`.
177
+ * @example
178
+ *
179
+ * _.times(2, _.stubFalse);
180
+ * // => [false, false]
181
+ */
182
+ function stubFalse() {
183
+ return false;
184
+ }
185
+
186
+ var stubFalse_1 = stubFalse;
187
+
188
+ var isBuffer_1 = createCommonjsModule(function (module, exports) {
189
+ /** Detect free variable `exports`. */
190
+ var freeExports = exports && !exports.nodeType && exports;
191
+
192
+ /** Detect free variable `module`. */
193
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
194
+
195
+ /** Detect the popular CommonJS extension `module.exports`. */
196
+ var moduleExports = freeModule && freeModule.exports === freeExports;
197
+
198
+ /** Built-in value references. */
199
+ var Buffer = moduleExports ? _root.Buffer : undefined;
200
+
201
+ /* Built-in method references for those with the same name as other `lodash` methods. */
202
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
203
+
204
+ /**
205
+ * Checks if `value` is a buffer.
206
+ *
207
+ * @static
208
+ * @memberOf _
209
+ * @since 4.3.0
210
+ * @category Lang
211
+ * @param {*} value The value to check.
212
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
213
+ * @example
214
+ *
215
+ * _.isBuffer(new Buffer(2));
216
+ * // => true
217
+ *
218
+ * _.isBuffer(new Uint8Array(2));
219
+ * // => false
220
+ */
221
+ var isBuffer = nativeIsBuffer || stubFalse_1;
222
+
223
+ module.exports = isBuffer;
224
+ });
225
+
226
+ /** Used as references for various `Number` constants. */
227
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
228
+
229
+ /** Used to detect unsigned integer values. */
230
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
231
+
232
+ /**
233
+ * Checks if `value` is a valid array-like index.
234
+ *
235
+ * @private
236
+ * @param {*} value The value to check.
237
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
238
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
239
+ */
240
+ function isIndex(value, length) {
241
+ var type = typeof value;
242
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
243
+
244
+ return !!length &&
245
+ (type == 'number' ||
246
+ (type != 'symbol' && reIsUint.test(value))) &&
247
+ (value > -1 && value % 1 == 0 && value < length);
248
+ }
249
+
250
+ var _isIndex = isIndex;
251
+
252
+ /** Used as references for various `Number` constants. */
253
+ var MAX_SAFE_INTEGER = 9007199254740991;
254
+
255
+ /**
256
+ * Checks if `value` is a valid array-like length.
257
+ *
258
+ * **Note:** This method is loosely based on
259
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
260
+ *
261
+ * @static
262
+ * @memberOf _
263
+ * @since 4.0.0
264
+ * @category Lang
265
+ * @param {*} value The value to check.
266
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
267
+ * @example
268
+ *
269
+ * _.isLength(3);
270
+ * // => true
271
+ *
272
+ * _.isLength(Number.MIN_VALUE);
273
+ * // => false
274
+ *
275
+ * _.isLength(Infinity);
276
+ * // => false
277
+ *
278
+ * _.isLength('3');
279
+ * // => false
280
+ */
281
+ function isLength(value) {
282
+ return typeof value == 'number' &&
283
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
284
+ }
285
+
286
+ var isLength_1 = isLength;
287
+
288
+ /** `Object#toString` result references. */
289
+ var argsTag$1 = '[object Arguments]',
290
+ arrayTag$1 = '[object Array]',
291
+ boolTag$1 = '[object Boolean]',
292
+ dateTag$1 = '[object Date]',
293
+ errorTag$1 = '[object Error]',
294
+ funcTag$1 = '[object Function]',
295
+ mapTag$2 = '[object Map]',
296
+ numberTag$1 = '[object Number]',
297
+ objectTag$2 = '[object Object]',
298
+ regexpTag$1 = '[object RegExp]',
299
+ setTag$2 = '[object Set]',
300
+ stringTag$1 = '[object String]',
301
+ weakMapTag$1 = '[object WeakMap]';
302
+
303
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
304
+ dataViewTag$2 = '[object DataView]',
305
+ float32Tag = '[object Float32Array]',
306
+ float64Tag = '[object Float64Array]',
307
+ int8Tag = '[object Int8Array]',
308
+ int16Tag = '[object Int16Array]',
309
+ int32Tag = '[object Int32Array]',
310
+ uint8Tag = '[object Uint8Array]',
311
+ uint8ClampedTag = '[object Uint8ClampedArray]',
312
+ uint16Tag = '[object Uint16Array]',
313
+ uint32Tag = '[object Uint32Array]';
314
+
315
+ /** Used to identify `toStringTag` values of typed arrays. */
316
+ var typedArrayTags = {};
317
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
318
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
319
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
320
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
321
+ typedArrayTags[uint32Tag] = true;
322
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
323
+ typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] =
324
+ typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] =
325
+ typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
326
+ typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] =
327
+ typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$1] =
328
+ typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] =
329
+ typedArrayTags[weakMapTag$1] = false;
330
+
331
+ /**
332
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
333
+ *
334
+ * @private
335
+ * @param {*} value The value to check.
336
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
337
+ */
338
+ function baseIsTypedArray(value) {
339
+ return isObjectLike_1(value) &&
340
+ isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
341
+ }
342
+
343
+ var _baseIsTypedArray = baseIsTypedArray;
344
+
345
+ /**
346
+ * The base implementation of `_.unary` without support for storing metadata.
347
+ *
348
+ * @private
349
+ * @param {Function} func The function to cap arguments for.
350
+ * @returns {Function} Returns the new capped function.
351
+ */
352
+ function baseUnary(func) {
353
+ return function(value) {
354
+ return func(value);
355
+ };
356
+ }
357
+
358
+ var _baseUnary = baseUnary;
359
+
360
+ var _nodeUtil = createCommonjsModule(function (module, exports) {
361
+ /** Detect free variable `exports`. */
362
+ var freeExports = exports && !exports.nodeType && exports;
363
+
364
+ /** Detect free variable `module`. */
365
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
366
+
367
+ /** Detect the popular CommonJS extension `module.exports`. */
368
+ var moduleExports = freeModule && freeModule.exports === freeExports;
369
+
370
+ /** Detect free variable `process` from Node.js. */
371
+ var freeProcess = moduleExports && _freeGlobal.process;
372
+
373
+ /** Used to access faster Node.js helpers. */
374
+ var nodeUtil = (function() {
375
+ try {
376
+ // Use `util.types` for Node.js 10+.
377
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
378
+
379
+ if (types) {
380
+ return types;
381
+ }
382
+
383
+ // Legacy `process.binding('util')` for Node.js < 10.
384
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
385
+ } catch (e) {}
386
+ }());
387
+
388
+ module.exports = nodeUtil;
389
+ });
390
+
391
+ /* Node.js helper references. */
392
+ var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
393
+
394
+ /**
395
+ * Checks if `value` is classified as a typed array.
396
+ *
397
+ * @static
398
+ * @memberOf _
399
+ * @since 3.0.0
400
+ * @category Lang
401
+ * @param {*} value The value to check.
402
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
403
+ * @example
404
+ *
405
+ * _.isTypedArray(new Uint8Array);
406
+ * // => true
407
+ *
408
+ * _.isTypedArray([]);
409
+ * // => false
410
+ */
411
+ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
412
+
413
+ var isTypedArray_1 = isTypedArray;
414
+
415
+ /** Used for built-in method references. */
416
+ var objectProto$8 = Object.prototype;
417
+
418
+ /** Used to check objects for own properties. */
419
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
420
+
421
+ /**
422
+ * Creates an array of the enumerable property names of the array-like `value`.
423
+ *
424
+ * @private
425
+ * @param {*} value The value to query.
426
+ * @param {boolean} inherited Specify returning inherited property names.
427
+ * @returns {Array} Returns the array of property names.
428
+ */
429
+ function arrayLikeKeys(value, inherited) {
430
+ var isArr = isArray_1(value),
431
+ isArg = !isArr && isArguments_1(value),
432
+ isBuff = !isArr && !isArg && isBuffer_1(value),
433
+ isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
434
+ skipIndexes = isArr || isArg || isBuff || isType,
435
+ result = skipIndexes ? _baseTimes(value.length, String) : [],
436
+ length = result.length;
437
+
438
+ for (var key in value) {
439
+ if ((inherited || hasOwnProperty$6.call(value, key)) &&
440
+ !(skipIndexes && (
441
+ // Safari 9 has enumerable `arguments.length` in strict mode.
442
+ key == 'length' ||
443
+ // Node.js 0.10 has enumerable non-index properties on buffers.
444
+ (isBuff && (key == 'offset' || key == 'parent')) ||
445
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
446
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
447
+ // Skip index properties.
448
+ _isIndex(key, length)
449
+ ))) {
450
+ result.push(key);
451
+ }
452
+ }
453
+ return result;
454
+ }
455
+
456
+ var _arrayLikeKeys = arrayLikeKeys;
457
+
458
+ /** Used for built-in method references. */
459
+ var objectProto$7 = Object.prototype;
460
+
461
+ /**
462
+ * Checks if `value` is likely a prototype object.
463
+ *
464
+ * @private
465
+ * @param {*} value The value to check.
466
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
467
+ */
468
+ function isPrototype(value) {
469
+ var Ctor = value && value.constructor,
470
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$7;
471
+
472
+ return value === proto;
473
+ }
474
+
475
+ var _isPrototype = isPrototype;
476
+
477
+ /**
478
+ * Creates a unary function that invokes `func` with its argument transformed.
479
+ *
480
+ * @private
481
+ * @param {Function} func The function to wrap.
482
+ * @param {Function} transform The argument transform.
483
+ * @returns {Function} Returns the new function.
484
+ */
485
+ function overArg(func, transform) {
486
+ return function(arg) {
487
+ return func(transform(arg));
488
+ };
489
+ }
490
+
491
+ var _overArg = overArg;
492
+
493
+ /* Built-in method references for those with the same name as other `lodash` methods. */
494
+ var nativeKeys = _overArg(Object.keys, Object);
495
+
496
+ var _nativeKeys = nativeKeys;
497
+
498
+ /** Used for built-in method references. */
499
+ var objectProto$6 = Object.prototype;
500
+
501
+ /** Used to check objects for own properties. */
502
+ var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
503
+
504
+ /**
505
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
506
+ *
507
+ * @private
508
+ * @param {Object} object The object to query.
509
+ * @returns {Array} Returns the array of property names.
510
+ */
511
+ function baseKeys(object) {
512
+ if (!_isPrototype(object)) {
513
+ return _nativeKeys(object);
514
+ }
515
+ var result = [];
516
+ for (var key in Object(object)) {
517
+ if (hasOwnProperty$5.call(object, key) && key != 'constructor') {
518
+ result.push(key);
519
+ }
520
+ }
521
+ return result;
522
+ }
523
+
524
+ var _baseKeys = baseKeys;
525
+
526
+ /** `Object#toString` result references. */
527
+ var asyncTag = '[object AsyncFunction]',
528
+ funcTag = '[object Function]',
529
+ genTag = '[object GeneratorFunction]',
530
+ proxyTag = '[object Proxy]';
531
+
532
+ /**
533
+ * Checks if `value` is classified as a `Function` object.
534
+ *
535
+ * @static
536
+ * @memberOf _
537
+ * @since 0.1.0
538
+ * @category Lang
539
+ * @param {*} value The value to check.
540
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
541
+ * @example
542
+ *
543
+ * _.isFunction(_);
544
+ * // => true
545
+ *
546
+ * _.isFunction(/abc/);
547
+ * // => false
548
+ */
549
+ function isFunction(value) {
550
+ if (!isObject_1(value)) {
551
+ return false;
552
+ }
553
+ // The use of `Object#toString` avoids issues with the `typeof` operator
554
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
555
+ var tag = _baseGetTag(value);
556
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
557
+ }
558
+
559
+ var isFunction_1 = isFunction;
560
+
561
+ /**
562
+ * Checks if `value` is array-like. A value is considered array-like if it's
563
+ * not a function and has a `value.length` that's an integer greater than or
564
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
565
+ *
566
+ * @static
567
+ * @memberOf _
568
+ * @since 4.0.0
569
+ * @category Lang
570
+ * @param {*} value The value to check.
571
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
572
+ * @example
573
+ *
574
+ * _.isArrayLike([1, 2, 3]);
575
+ * // => true
576
+ *
577
+ * _.isArrayLike(document.body.children);
578
+ * // => true
579
+ *
580
+ * _.isArrayLike('abc');
581
+ * // => true
582
+ *
583
+ * _.isArrayLike(_.noop);
584
+ * // => false
585
+ */
586
+ function isArrayLike(value) {
587
+ return value != null && isLength_1(value.length) && !isFunction_1(value);
588
+ }
589
+
590
+ var isArrayLike_1 = isArrayLike;
591
+
592
+ /**
593
+ * Creates an array of the own enumerable property names of `object`.
594
+ *
595
+ * **Note:** Non-object values are coerced to objects. See the
596
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
597
+ * for more details.
598
+ *
599
+ * @static
600
+ * @since 0.1.0
601
+ * @memberOf _
602
+ * @category Object
603
+ * @param {Object} object The object to query.
604
+ * @returns {Array} Returns the array of property names.
605
+ * @example
606
+ *
607
+ * function Foo() {
608
+ * this.a = 1;
609
+ * this.b = 2;
610
+ * }
611
+ *
612
+ * Foo.prototype.c = 3;
613
+ *
614
+ * _.keys(new Foo);
615
+ * // => ['a', 'b'] (iteration order is not guaranteed)
616
+ *
617
+ * _.keys('hi');
618
+ * // => ['0', '1']
619
+ */
620
+ function keys(object) {
621
+ return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
622
+ }
623
+
624
+ var keys_1 = keys;
625
+
626
+ /**
627
+ * The base implementation of `_.forOwn` without support for iteratee shorthands.
628
+ *
629
+ * @private
630
+ * @param {Object} object The object to iterate over.
631
+ * @param {Function} iteratee The function invoked per iteration.
632
+ * @returns {Object} Returns `object`.
633
+ */
634
+ function baseForOwn(object, iteratee) {
635
+ return object && _baseFor(object, iteratee, keys_1);
636
+ }
637
+
638
+ var _baseForOwn = baseForOwn;
639
+
640
+ /**
641
+ * Creates a `baseEach` or `baseEachRight` function.
642
+ *
643
+ * @private
644
+ * @param {Function} eachFunc The function to iterate over a collection.
645
+ * @param {boolean} [fromRight] Specify iterating from right to left.
646
+ * @returns {Function} Returns the new base function.
647
+ */
648
+ function createBaseEach(eachFunc, fromRight) {
649
+ return function(collection, iteratee) {
650
+ if (collection == null) {
651
+ return collection;
652
+ }
653
+ if (!isArrayLike_1(collection)) {
654
+ return eachFunc(collection, iteratee);
655
+ }
656
+ var length = collection.length,
657
+ index = fromRight ? length : -1,
658
+ iterable = Object(collection);
659
+
660
+ while ((fromRight ? index-- : ++index < length)) {
661
+ if (iteratee(iterable[index], index, iterable) === false) {
662
+ break;
663
+ }
664
+ }
665
+ return collection;
666
+ };
667
+ }
668
+
669
+ var _createBaseEach = createBaseEach;
670
+
671
+ /**
672
+ * The base implementation of `_.forEach` without support for iteratee shorthands.
673
+ *
674
+ * @private
675
+ * @param {Array|Object} collection The collection to iterate over.
676
+ * @param {Function} iteratee The function invoked per iteration.
677
+ * @returns {Array|Object} Returns `collection`.
678
+ */
679
+ var baseEach = _createBaseEach(_baseForOwn);
680
+
681
+ var _baseEach = baseEach;
682
+
683
+ /**
684
+ * This method returns the first argument it receives.
685
+ *
686
+ * @static
687
+ * @since 0.1.0
688
+ * @memberOf _
689
+ * @category Util
690
+ * @param {*} value Any value.
691
+ * @returns {*} Returns `value`.
692
+ * @example
693
+ *
694
+ * var object = { 'a': 1 };
695
+ *
696
+ * console.log(_.identity(object) === object);
697
+ * // => true
698
+ */
699
+ function identity(value) {
700
+ return value;
701
+ }
702
+
703
+ var identity_1 = identity;
704
+
705
+ /**
706
+ * Casts `value` to `identity` if it's not a function.
707
+ *
708
+ * @private
709
+ * @param {*} value The value to inspect.
710
+ * @returns {Function} Returns cast function.
711
+ */
712
+ function castFunction(value) {
713
+ return typeof value == 'function' ? value : identity_1;
714
+ }
715
+
716
+ var _castFunction = castFunction;
717
+
718
+ /**
719
+ * Iterates over elements of `collection` and invokes `iteratee` for each element.
720
+ * The iteratee is invoked with three arguments: (value, index|key, collection).
721
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
722
+ *
723
+ * **Note:** As with other "Collections" methods, objects with a "length"
724
+ * property are iterated like arrays. To avoid this behavior use `_.forIn`
725
+ * or `_.forOwn` for object iteration.
726
+ *
727
+ * @static
728
+ * @memberOf _
729
+ * @since 0.1.0
730
+ * @alias each
731
+ * @category Collection
732
+ * @param {Array|Object} collection The collection to iterate over.
733
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
734
+ * @returns {Array|Object} Returns `collection`.
735
+ * @see _.forEachRight
736
+ * @example
737
+ *
738
+ * _.forEach([1, 2], function(value) {
739
+ * console.log(value);
740
+ * });
741
+ * // => Logs `1` then `2`.
742
+ *
743
+ * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
744
+ * console.log(key);
745
+ * });
746
+ * // => Logs 'a' then 'b' (iteration order is not guaranteed).
747
+ */
748
+ function forEach(collection, iteratee) {
749
+ var func = isArray_1(collection) ? _arrayEach : _baseEach;
750
+ return func(collection, _castFunction(iteratee));
751
+ }
752
+
753
+ var forEach_1 = forEach;
754
+
755
+ var each = forEach_1;
756
+
757
+ /**
758
+ * A specialized version of `_.reduce` for arrays without support for
759
+ * iteratee shorthands.
760
+ *
761
+ * @private
762
+ * @param {Array} [array] The array to iterate over.
763
+ * @param {Function} iteratee The function invoked per iteration.
764
+ * @param {*} [accumulator] The initial value.
765
+ * @param {boolean} [initAccum] Specify using the first element of `array` as
766
+ * the initial value.
767
+ * @returns {*} Returns the accumulated value.
768
+ */
769
+ function arrayReduce(array, iteratee, accumulator, initAccum) {
770
+ var index = -1,
771
+ length = array == null ? 0 : array.length;
772
+
773
+ if (initAccum && length) {
774
+ accumulator = array[++index];
775
+ }
776
+ while (++index < length) {
777
+ accumulator = iteratee(accumulator, array[index], index, array);
778
+ }
779
+ return accumulator;
780
+ }
781
+
782
+ var _arrayReduce = arrayReduce;
783
+
784
+ /**
785
+ * Removes all key-value entries from the list cache.
786
+ *
787
+ * @private
788
+ * @name clear
789
+ * @memberOf ListCache
790
+ */
791
+ function listCacheClear() {
792
+ this.__data__ = [];
793
+ this.size = 0;
794
+ }
795
+
796
+ var _listCacheClear = listCacheClear;
797
+
798
+ /**
799
+ * Performs a
800
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
801
+ * comparison between two values to determine if they are equivalent.
802
+ *
803
+ * @static
804
+ * @memberOf _
805
+ * @since 4.0.0
806
+ * @category Lang
807
+ * @param {*} value The value to compare.
808
+ * @param {*} other The other value to compare.
809
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
810
+ * @example
811
+ *
812
+ * var object = { 'a': 1 };
813
+ * var other = { 'a': 1 };
814
+ *
815
+ * _.eq(object, object);
816
+ * // => true
817
+ *
818
+ * _.eq(object, other);
819
+ * // => false
820
+ *
821
+ * _.eq('a', 'a');
822
+ * // => true
823
+ *
824
+ * _.eq('a', Object('a'));
825
+ * // => false
826
+ *
827
+ * _.eq(NaN, NaN);
828
+ * // => true
829
+ */
830
+ function eq(value, other) {
831
+ return value === other || (value !== value && other !== other);
832
+ }
833
+
834
+ var eq_1 = eq;
835
+
836
+ /**
837
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
838
+ *
839
+ * @private
840
+ * @param {Array} array The array to inspect.
841
+ * @param {*} key The key to search for.
842
+ * @returns {number} Returns the index of the matched value, else `-1`.
843
+ */
844
+ function assocIndexOf(array, key) {
845
+ var length = array.length;
846
+ while (length--) {
847
+ if (eq_1(array[length][0], key)) {
848
+ return length;
849
+ }
850
+ }
851
+ return -1;
852
+ }
853
+
854
+ var _assocIndexOf = assocIndexOf;
855
+
856
+ /** Used for built-in method references. */
857
+ var arrayProto = Array.prototype;
858
+
859
+ /** Built-in value references. */
860
+ var splice = arrayProto.splice;
861
+
862
+ /**
863
+ * Removes `key` and its value from the list cache.
864
+ *
865
+ * @private
866
+ * @name delete
867
+ * @memberOf ListCache
868
+ * @param {string} key The key of the value to remove.
869
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
870
+ */
871
+ function listCacheDelete(key) {
872
+ var data = this.__data__,
873
+ index = _assocIndexOf(data, key);
874
+
875
+ if (index < 0) {
876
+ return false;
877
+ }
878
+ var lastIndex = data.length - 1;
879
+ if (index == lastIndex) {
880
+ data.pop();
881
+ } else {
882
+ splice.call(data, index, 1);
883
+ }
884
+ --this.size;
885
+ return true;
886
+ }
887
+
888
+ var _listCacheDelete = listCacheDelete;
889
+
890
+ /**
891
+ * Gets the list cache value for `key`.
892
+ *
893
+ * @private
894
+ * @name get
895
+ * @memberOf ListCache
896
+ * @param {string} key The key of the value to get.
897
+ * @returns {*} Returns the entry value.
898
+ */
899
+ function listCacheGet(key) {
900
+ var data = this.__data__,
901
+ index = _assocIndexOf(data, key);
902
+
903
+ return index < 0 ? undefined : data[index][1];
904
+ }
905
+
906
+ var _listCacheGet = listCacheGet;
907
+
908
+ /**
909
+ * Checks if a list cache value for `key` exists.
910
+ *
911
+ * @private
912
+ * @name has
913
+ * @memberOf ListCache
914
+ * @param {string} key The key of the entry to check.
915
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
916
+ */
917
+ function listCacheHas(key) {
918
+ return _assocIndexOf(this.__data__, key) > -1;
919
+ }
920
+
921
+ var _listCacheHas = listCacheHas;
922
+
923
+ /**
924
+ * Sets the list cache `key` to `value`.
925
+ *
926
+ * @private
927
+ * @name set
928
+ * @memberOf ListCache
929
+ * @param {string} key The key of the value to set.
930
+ * @param {*} value The value to set.
931
+ * @returns {Object} Returns the list cache instance.
932
+ */
933
+ function listCacheSet(key, value) {
934
+ var data = this.__data__,
935
+ index = _assocIndexOf(data, key);
936
+
937
+ if (index < 0) {
938
+ ++this.size;
939
+ data.push([key, value]);
940
+ } else {
941
+ data[index][1] = value;
942
+ }
943
+ return this;
944
+ }
945
+
946
+ var _listCacheSet = listCacheSet;
947
+
948
+ /**
949
+ * Creates an list cache object.
950
+ *
951
+ * @private
952
+ * @constructor
953
+ * @param {Array} [entries] The key-value pairs to cache.
954
+ */
955
+ function ListCache(entries) {
956
+ var index = -1,
957
+ length = entries == null ? 0 : entries.length;
958
+
959
+ this.clear();
960
+ while (++index < length) {
961
+ var entry = entries[index];
962
+ this.set(entry[0], entry[1]);
963
+ }
964
+ }
965
+
966
+ // Add methods to `ListCache`.
967
+ ListCache.prototype.clear = _listCacheClear;
968
+ ListCache.prototype['delete'] = _listCacheDelete;
969
+ ListCache.prototype.get = _listCacheGet;
970
+ ListCache.prototype.has = _listCacheHas;
971
+ ListCache.prototype.set = _listCacheSet;
972
+
973
+ var _ListCache = ListCache;
974
+
975
+ /**
976
+ * Removes all key-value entries from the stack.
977
+ *
978
+ * @private
979
+ * @name clear
980
+ * @memberOf Stack
981
+ */
982
+ function stackClear() {
983
+ this.__data__ = new _ListCache;
984
+ this.size = 0;
985
+ }
986
+
987
+ var _stackClear = stackClear;
988
+
989
+ /**
990
+ * Removes `key` and its value from the stack.
991
+ *
992
+ * @private
993
+ * @name delete
994
+ * @memberOf Stack
995
+ * @param {string} key The key of the value to remove.
996
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
997
+ */
998
+ function stackDelete(key) {
999
+ var data = this.__data__,
1000
+ result = data['delete'](key);
1001
+
1002
+ this.size = data.size;
1003
+ return result;
1004
+ }
1005
+
1006
+ var _stackDelete = stackDelete;
1007
+
1008
+ /**
1009
+ * Gets the stack value for `key`.
1010
+ *
1011
+ * @private
1012
+ * @name get
1013
+ * @memberOf Stack
1014
+ * @param {string} key The key of the value to get.
1015
+ * @returns {*} Returns the entry value.
1016
+ */
1017
+ function stackGet(key) {
1018
+ return this.__data__.get(key);
1019
+ }
1020
+
1021
+ var _stackGet = stackGet;
1022
+
1023
+ /**
1024
+ * Checks if a stack value for `key` exists.
1025
+ *
1026
+ * @private
1027
+ * @name has
1028
+ * @memberOf Stack
1029
+ * @param {string} key The key of the entry to check.
1030
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1031
+ */
1032
+ function stackHas(key) {
1033
+ return this.__data__.has(key);
1034
+ }
1035
+
1036
+ var _stackHas = stackHas;
1037
+
1038
+ /** Used to detect overreaching core-js shims. */
1039
+ var coreJsData = _root['__core-js_shared__'];
1040
+
1041
+ var _coreJsData = coreJsData;
1042
+
1043
+ /** Used to detect methods masquerading as native. */
1044
+ var maskSrcKey = (function() {
1045
+ var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
1046
+ return uid ? ('Symbol(src)_1.' + uid) : '';
1047
+ }());
1048
+
1049
+ /**
1050
+ * Checks if `func` has its source masked.
1051
+ *
1052
+ * @private
1053
+ * @param {Function} func The function to check.
1054
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1055
+ */
1056
+ function isMasked(func) {
1057
+ return !!maskSrcKey && (maskSrcKey in func);
1058
+ }
1059
+
1060
+ var _isMasked = isMasked;
1061
+
1062
+ /** Used for built-in method references. */
1063
+ var funcProto$1 = Function.prototype;
1064
+
1065
+ /** Used to resolve the decompiled source of functions. */
1066
+ var funcToString$1 = funcProto$1.toString;
1067
+
1068
+ /**
1069
+ * Converts `func` to its source code.
1070
+ *
1071
+ * @private
1072
+ * @param {Function} func The function to convert.
1073
+ * @returns {string} Returns the source code.
1074
+ */
1075
+ function toSource(func) {
1076
+ if (func != null) {
1077
+ try {
1078
+ return funcToString$1.call(func);
1079
+ } catch (e) {}
1080
+ try {
1081
+ return (func + '');
1082
+ } catch (e) {}
1083
+ }
1084
+ return '';
1085
+ }
1086
+
1087
+ var _toSource = toSource;
1088
+
1089
+ /**
1090
+ * Used to match `RegExp`
1091
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
1092
+ */
1093
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
1094
+
1095
+ /** Used to detect host constructors (Safari). */
1096
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
1097
+
1098
+ /** Used for built-in method references. */
1099
+ var funcProto = Function.prototype,
1100
+ objectProto$5 = Object.prototype;
1101
+
1102
+ /** Used to resolve the decompiled source of functions. */
1103
+ var funcToString = funcProto.toString;
1104
+
1105
+ /** Used to check objects for own properties. */
1106
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
1107
+
1108
+ /** Used to detect if a method is native. */
1109
+ var reIsNative = RegExp('^' +
1110
+ funcToString.call(hasOwnProperty$4).replace(reRegExpChar, '\\$&')
1111
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
1112
+ );
1113
+
1114
+ /**
1115
+ * The base implementation of `_.isNative` without bad shim checks.
1116
+ *
1117
+ * @private
1118
+ * @param {*} value The value to check.
1119
+ * @returns {boolean} Returns `true` if `value` is a native function,
1120
+ * else `false`.
1121
+ */
1122
+ function baseIsNative(value) {
1123
+ if (!isObject_1(value) || _isMasked(value)) {
1124
+ return false;
1125
+ }
1126
+ var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
1127
+ return pattern.test(_toSource(value));
1128
+ }
1129
+
1130
+ var _baseIsNative = baseIsNative;
1131
+
1132
+ /**
1133
+ * Gets the value at `key` of `object`.
1134
+ *
1135
+ * @private
1136
+ * @param {Object} [object] The object to query.
1137
+ * @param {string} key The key of the property to get.
1138
+ * @returns {*} Returns the property value.
1139
+ */
1140
+ function getValue(object, key) {
1141
+ return object == null ? undefined : object[key];
1142
+ }
1143
+
1144
+ var _getValue = getValue;
1145
+
1146
+ /**
1147
+ * Gets the native function at `key` of `object`.
1148
+ *
1149
+ * @private
1150
+ * @param {Object} object The object to query.
1151
+ * @param {string} key The key of the method to get.
1152
+ * @returns {*} Returns the function if it's native, else `undefined`.
1153
+ */
1154
+ function getNative(object, key) {
1155
+ var value = _getValue(object, key);
1156
+ return _baseIsNative(value) ? value : undefined;
1157
+ }
1158
+
1159
+ var _getNative = getNative;
1160
+
1161
+ /* Built-in method references that are verified to be native. */
1162
+ var Map$1 = _getNative(_root, 'Map');
1163
+
1164
+ var _Map = Map$1;
1165
+
1166
+ /* Built-in method references that are verified to be native. */
1167
+ var nativeCreate = _getNative(Object, 'create');
1168
+
1169
+ var _nativeCreate = nativeCreate;
1170
+
1171
+ /**
1172
+ * Removes all key-value entries from the hash.
1173
+ *
1174
+ * @private
1175
+ * @name clear
1176
+ * @memberOf Hash
1177
+ */
1178
+ function hashClear() {
1179
+ this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
1180
+ this.size = 0;
1181
+ }
1182
+
1183
+ var _hashClear = hashClear;
1184
+
1185
+ /**
1186
+ * Removes `key` and its value from the hash.
1187
+ *
1188
+ * @private
1189
+ * @name delete
1190
+ * @memberOf Hash
1191
+ * @param {Object} hash The hash to modify.
1192
+ * @param {string} key The key of the value to remove.
1193
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1194
+ */
1195
+ function hashDelete(key) {
1196
+ var result = this.has(key) && delete this.__data__[key];
1197
+ this.size -= result ? 1 : 0;
1198
+ return result;
1199
+ }
1200
+
1201
+ var _hashDelete = hashDelete;
1202
+
1203
+ /** Used to stand-in for `undefined` hash values. */
1204
+ var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
1205
+
1206
+ /** Used for built-in method references. */
1207
+ var objectProto$4 = Object.prototype;
1208
+
1209
+ /** Used to check objects for own properties. */
1210
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
1211
+
1212
+ /**
1213
+ * Gets the hash value for `key`.
1214
+ *
1215
+ * @private
1216
+ * @name get
1217
+ * @memberOf Hash
1218
+ * @param {string} key The key of the value to get.
1219
+ * @returns {*} Returns the entry value.
1220
+ */
1221
+ function hashGet(key) {
1222
+ var data = this.__data__;
1223
+ if (_nativeCreate) {
1224
+ var result = data[key];
1225
+ return result === HASH_UNDEFINED$2 ? undefined : result;
1226
+ }
1227
+ return hasOwnProperty$3.call(data, key) ? data[key] : undefined;
1228
+ }
1229
+
1230
+ var _hashGet = hashGet;
1231
+
1232
+ /** Used for built-in method references. */
1233
+ var objectProto$3 = Object.prototype;
1234
+
1235
+ /** Used to check objects for own properties. */
1236
+ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
1237
+
1238
+ /**
1239
+ * Checks if a hash value for `key` exists.
1240
+ *
1241
+ * @private
1242
+ * @name has
1243
+ * @memberOf Hash
1244
+ * @param {string} key The key of the entry to check.
1245
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1246
+ */
1247
+ function hashHas(key) {
1248
+ var data = this.__data__;
1249
+ return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$2.call(data, key);
1250
+ }
1251
+
1252
+ var _hashHas = hashHas;
1253
+
1254
+ /** Used to stand-in for `undefined` hash values. */
1255
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
1256
+
1257
+ /**
1258
+ * Sets the hash `key` to `value`.
1259
+ *
1260
+ * @private
1261
+ * @name set
1262
+ * @memberOf Hash
1263
+ * @param {string} key The key of the value to set.
1264
+ * @param {*} value The value to set.
1265
+ * @returns {Object} Returns the hash instance.
1266
+ */
1267
+ function hashSet(key, value) {
1268
+ var data = this.__data__;
1269
+ this.size += this.has(key) ? 0 : 1;
1270
+ data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
1271
+ return this;
1272
+ }
1273
+
1274
+ var _hashSet = hashSet;
1275
+
1276
+ /**
1277
+ * Creates a hash object.
1278
+ *
1279
+ * @private
1280
+ * @constructor
1281
+ * @param {Array} [entries] The key-value pairs to cache.
1282
+ */
1283
+ function Hash(entries) {
1284
+ var index = -1,
1285
+ length = entries == null ? 0 : entries.length;
1286
+
1287
+ this.clear();
1288
+ while (++index < length) {
1289
+ var entry = entries[index];
1290
+ this.set(entry[0], entry[1]);
1291
+ }
1292
+ }
1293
+
1294
+ // Add methods to `Hash`.
1295
+ Hash.prototype.clear = _hashClear;
1296
+ Hash.prototype['delete'] = _hashDelete;
1297
+ Hash.prototype.get = _hashGet;
1298
+ Hash.prototype.has = _hashHas;
1299
+ Hash.prototype.set = _hashSet;
1300
+
1301
+ var _Hash = Hash;
1302
+
1303
+ /**
1304
+ * Removes all key-value entries from the map.
1305
+ *
1306
+ * @private
1307
+ * @name clear
1308
+ * @memberOf MapCache
1309
+ */
1310
+ function mapCacheClear() {
1311
+ this.size = 0;
1312
+ this.__data__ = {
1313
+ 'hash': new _Hash,
1314
+ 'map': new (_Map || _ListCache),
1315
+ 'string': new _Hash
1316
+ };
1317
+ }
1318
+
1319
+ var _mapCacheClear = mapCacheClear;
1320
+
1321
+ /**
1322
+ * Checks if `value` is suitable for use as unique object key.
1323
+ *
1324
+ * @private
1325
+ * @param {*} value The value to check.
1326
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1327
+ */
1328
+ function isKeyable(value) {
1329
+ var type = typeof value;
1330
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1331
+ ? (value !== '__proto__')
1332
+ : (value === null);
1333
+ }
1334
+
1335
+ var _isKeyable = isKeyable;
1336
+
1337
+ /**
1338
+ * Gets the data for `map`.
1339
+ *
1340
+ * @private
1341
+ * @param {Object} map The map to query.
1342
+ * @param {string} key The reference key.
1343
+ * @returns {*} Returns the map data.
1344
+ */
1345
+ function getMapData(map, key) {
1346
+ var data = map.__data__;
1347
+ return _isKeyable(key)
1348
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1349
+ : data.map;
1350
+ }
1351
+
1352
+ var _getMapData = getMapData;
1353
+
1354
+ /**
1355
+ * Removes `key` and its value from the map.
1356
+ *
1357
+ * @private
1358
+ * @name delete
1359
+ * @memberOf MapCache
1360
+ * @param {string} key The key of the value to remove.
1361
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1362
+ */
1363
+ function mapCacheDelete(key) {
1364
+ var result = _getMapData(this, key)['delete'](key);
1365
+ this.size -= result ? 1 : 0;
1366
+ return result;
1367
+ }
1368
+
1369
+ var _mapCacheDelete = mapCacheDelete;
1370
+
1371
+ /**
1372
+ * Gets the map value for `key`.
1373
+ *
1374
+ * @private
1375
+ * @name get
1376
+ * @memberOf MapCache
1377
+ * @param {string} key The key of the value to get.
1378
+ * @returns {*} Returns the entry value.
1379
+ */
1380
+ function mapCacheGet(key) {
1381
+ return _getMapData(this, key).get(key);
1382
+ }
1383
+
1384
+ var _mapCacheGet = mapCacheGet;
1385
+
1386
+ /**
1387
+ * Checks if a map value for `key` exists.
1388
+ *
1389
+ * @private
1390
+ * @name has
1391
+ * @memberOf MapCache
1392
+ * @param {string} key The key of the entry to check.
1393
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1394
+ */
1395
+ function mapCacheHas(key) {
1396
+ return _getMapData(this, key).has(key);
1397
+ }
1398
+
1399
+ var _mapCacheHas = mapCacheHas;
1400
+
1401
+ /**
1402
+ * Sets the map `key` to `value`.
1403
+ *
1404
+ * @private
1405
+ * @name set
1406
+ * @memberOf MapCache
1407
+ * @param {string} key The key of the value to set.
1408
+ * @param {*} value The value to set.
1409
+ * @returns {Object} Returns the map cache instance.
1410
+ */
1411
+ function mapCacheSet(key, value) {
1412
+ var data = _getMapData(this, key),
1413
+ size = data.size;
1414
+
1415
+ data.set(key, value);
1416
+ this.size += data.size == size ? 0 : 1;
1417
+ return this;
1418
+ }
1419
+
1420
+ var _mapCacheSet = mapCacheSet;
1421
+
1422
+ /**
1423
+ * Creates a map cache object to store key-value pairs.
1424
+ *
1425
+ * @private
1426
+ * @constructor
1427
+ * @param {Array} [entries] The key-value pairs to cache.
1428
+ */
1429
+ function MapCache(entries) {
1430
+ var index = -1,
1431
+ length = entries == null ? 0 : entries.length;
1432
+
1433
+ this.clear();
1434
+ while (++index < length) {
1435
+ var entry = entries[index];
1436
+ this.set(entry[0], entry[1]);
1437
+ }
1438
+ }
1439
+
1440
+ // Add methods to `MapCache`.
1441
+ MapCache.prototype.clear = _mapCacheClear;
1442
+ MapCache.prototype['delete'] = _mapCacheDelete;
1443
+ MapCache.prototype.get = _mapCacheGet;
1444
+ MapCache.prototype.has = _mapCacheHas;
1445
+ MapCache.prototype.set = _mapCacheSet;
1446
+
1447
+ var _MapCache = MapCache;
1448
+
1449
+ /** Used as the size to enable large array optimizations. */
1450
+ var LARGE_ARRAY_SIZE = 200;
1451
+
1452
+ /**
1453
+ * Sets the stack `key` to `value`.
1454
+ *
1455
+ * @private
1456
+ * @name set
1457
+ * @memberOf Stack
1458
+ * @param {string} key The key of the value to set.
1459
+ * @param {*} value The value to set.
1460
+ * @returns {Object} Returns the stack cache instance.
1461
+ */
1462
+ function stackSet(key, value) {
1463
+ var data = this.__data__;
1464
+ if (data instanceof _ListCache) {
1465
+ var pairs = data.__data__;
1466
+ if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1467
+ pairs.push([key, value]);
1468
+ this.size = ++data.size;
1469
+ return this;
1470
+ }
1471
+ data = this.__data__ = new _MapCache(pairs);
1472
+ }
1473
+ data.set(key, value);
1474
+ this.size = data.size;
1475
+ return this;
1476
+ }
1477
+
1478
+ var _stackSet = stackSet;
1479
+
1480
+ /**
1481
+ * Creates a stack cache object to store key-value pairs.
1482
+ *
1483
+ * @private
1484
+ * @constructor
1485
+ * @param {Array} [entries] The key-value pairs to cache.
1486
+ */
1487
+ function Stack(entries) {
1488
+ var data = this.__data__ = new _ListCache(entries);
1489
+ this.size = data.size;
1490
+ }
1491
+
1492
+ // Add methods to `Stack`.
1493
+ Stack.prototype.clear = _stackClear;
1494
+ Stack.prototype['delete'] = _stackDelete;
1495
+ Stack.prototype.get = _stackGet;
1496
+ Stack.prototype.has = _stackHas;
1497
+ Stack.prototype.set = _stackSet;
1498
+
1499
+ var _Stack = Stack;
1500
+
1501
+ /** Used to stand-in for `undefined` hash values. */
1502
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
1503
+
1504
+ /**
1505
+ * Adds `value` to the array cache.
1506
+ *
1507
+ * @private
1508
+ * @name add
1509
+ * @memberOf SetCache
1510
+ * @alias push
1511
+ * @param {*} value The value to cache.
1512
+ * @returns {Object} Returns the cache instance.
1513
+ */
1514
+ function setCacheAdd(value) {
1515
+ this.__data__.set(value, HASH_UNDEFINED);
1516
+ return this;
1517
+ }
1518
+
1519
+ var _setCacheAdd = setCacheAdd;
1520
+
1521
+ /**
1522
+ * Checks if `value` is in the array cache.
1523
+ *
1524
+ * @private
1525
+ * @name has
1526
+ * @memberOf SetCache
1527
+ * @param {*} value The value to search for.
1528
+ * @returns {number} Returns `true` if `value` is found, else `false`.
1529
+ */
1530
+ function setCacheHas(value) {
1531
+ return this.__data__.has(value);
1532
+ }
1533
+
1534
+ var _setCacheHas = setCacheHas;
1535
+
1536
+ /**
1537
+ *
1538
+ * Creates an array cache object to store unique values.
1539
+ *
1540
+ * @private
1541
+ * @constructor
1542
+ * @param {Array} [values] The values to cache.
1543
+ */
1544
+ function SetCache(values) {
1545
+ var index = -1,
1546
+ length = values == null ? 0 : values.length;
1547
+
1548
+ this.__data__ = new _MapCache;
1549
+ while (++index < length) {
1550
+ this.add(values[index]);
1551
+ }
1552
+ }
1553
+
1554
+ // Add methods to `SetCache`.
1555
+ SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd;
1556
+ SetCache.prototype.has = _setCacheHas;
1557
+
1558
+ var _SetCache = SetCache;
1559
+
1560
+ /**
1561
+ * A specialized version of `_.some` for arrays without support for iteratee
1562
+ * shorthands.
1563
+ *
1564
+ * @private
1565
+ * @param {Array} [array] The array to iterate over.
1566
+ * @param {Function} predicate The function invoked per iteration.
1567
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
1568
+ * else `false`.
1569
+ */
1570
+ function arraySome(array, predicate) {
1571
+ var index = -1,
1572
+ length = array == null ? 0 : array.length;
1573
+
1574
+ while (++index < length) {
1575
+ if (predicate(array[index], index, array)) {
1576
+ return true;
1577
+ }
1578
+ }
1579
+ return false;
1580
+ }
1581
+
1582
+ var _arraySome = arraySome;
1583
+
1584
+ /**
1585
+ * Checks if a `cache` value for `key` exists.
1586
+ *
1587
+ * @private
1588
+ * @param {Object} cache The cache to query.
1589
+ * @param {string} key The key of the entry to check.
1590
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1591
+ */
1592
+ function cacheHas(cache, key) {
1593
+ return cache.has(key);
1594
+ }
1595
+
1596
+ var _cacheHas = cacheHas;
1597
+
1598
+ /** Used to compose bitmasks for value comparisons. */
1599
+ var COMPARE_PARTIAL_FLAG$5 = 1,
1600
+ COMPARE_UNORDERED_FLAG$3 = 2;
1601
+
1602
+ /**
1603
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
1604
+ * partial deep comparisons.
1605
+ *
1606
+ * @private
1607
+ * @param {Array} array The array to compare.
1608
+ * @param {Array} other The other array to compare.
1609
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1610
+ * @param {Function} customizer The function to customize comparisons.
1611
+ * @param {Function} equalFunc The function to determine equivalents of values.
1612
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
1613
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
1614
+ */
1615
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1616
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
1617
+ arrLength = array.length,
1618
+ othLength = other.length;
1619
+
1620
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1621
+ return false;
1622
+ }
1623
+ // Check that cyclic values are equal.
1624
+ var arrStacked = stack.get(array);
1625
+ var othStacked = stack.get(other);
1626
+ if (arrStacked && othStacked) {
1627
+ return arrStacked == other && othStacked == array;
1628
+ }
1629
+ var index = -1,
1630
+ result = true,
1631
+ seen = (bitmask & COMPARE_UNORDERED_FLAG$3) ? new _SetCache : undefined;
1632
+
1633
+ stack.set(array, other);
1634
+ stack.set(other, array);
1635
+
1636
+ // Ignore non-index properties.
1637
+ while (++index < arrLength) {
1638
+ var arrValue = array[index],
1639
+ othValue = other[index];
1640
+
1641
+ if (customizer) {
1642
+ var compared = isPartial
1643
+ ? customizer(othValue, arrValue, index, other, array, stack)
1644
+ : customizer(arrValue, othValue, index, array, other, stack);
1645
+ }
1646
+ if (compared !== undefined) {
1647
+ if (compared) {
1648
+ continue;
1649
+ }
1650
+ result = false;
1651
+ break;
1652
+ }
1653
+ // Recursively compare arrays (susceptible to call stack limits).
1654
+ if (seen) {
1655
+ if (!_arraySome(other, function(othValue, othIndex) {
1656
+ if (!_cacheHas(seen, othIndex) &&
1657
+ (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1658
+ return seen.push(othIndex);
1659
+ }
1660
+ })) {
1661
+ result = false;
1662
+ break;
1663
+ }
1664
+ } else if (!(
1665
+ arrValue === othValue ||
1666
+ equalFunc(arrValue, othValue, bitmask, customizer, stack)
1667
+ )) {
1668
+ result = false;
1669
+ break;
1670
+ }
1671
+ }
1672
+ stack['delete'](array);
1673
+ stack['delete'](other);
1674
+ return result;
1675
+ }
1676
+
1677
+ var _equalArrays = equalArrays;
1678
+
1679
+ /** Built-in value references. */
1680
+ var Uint8Array = _root.Uint8Array;
1681
+
1682
+ var _Uint8Array = Uint8Array;
1683
+
1684
+ /**
1685
+ * Converts `map` to its key-value pairs.
1686
+ *
1687
+ * @private
1688
+ * @param {Object} map The map to convert.
1689
+ * @returns {Array} Returns the key-value pairs.
1690
+ */
1691
+ function mapToArray(map) {
1692
+ var index = -1,
1693
+ result = Array(map.size);
1694
+
1695
+ map.forEach(function(value, key) {
1696
+ result[++index] = [key, value];
1697
+ });
1698
+ return result;
1699
+ }
1700
+
1701
+ var _mapToArray = mapToArray;
1702
+
1703
+ /**
1704
+ * Converts `set` to an array of its values.
1705
+ *
1706
+ * @private
1707
+ * @param {Object} set The set to convert.
1708
+ * @returns {Array} Returns the values.
1709
+ */
1710
+ function setToArray(set) {
1711
+ var index = -1,
1712
+ result = Array(set.size);
1713
+
1714
+ set.forEach(function(value) {
1715
+ result[++index] = value;
1716
+ });
1717
+ return result;
1718
+ }
1719
+
1720
+ var _setToArray = setToArray;
1721
+
1722
+ /** Used to compose bitmasks for value comparisons. */
1723
+ var COMPARE_PARTIAL_FLAG$4 = 1,
1724
+ COMPARE_UNORDERED_FLAG$2 = 2;
1725
+
1726
+ /** `Object#toString` result references. */
1727
+ var boolTag = '[object Boolean]',
1728
+ dateTag = '[object Date]',
1729
+ errorTag = '[object Error]',
1730
+ mapTag$1 = '[object Map]',
1731
+ numberTag = '[object Number]',
1732
+ regexpTag = '[object RegExp]',
1733
+ setTag$1 = '[object Set]',
1734
+ stringTag = '[object String]',
1735
+ symbolTag = '[object Symbol]';
1736
+
1737
+ var arrayBufferTag = '[object ArrayBuffer]',
1738
+ dataViewTag$1 = '[object DataView]';
1739
+
1740
+ /** Used to convert symbols to primitives and strings. */
1741
+ var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,
1742
+ symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
1743
+
1744
+ /**
1745
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
1746
+ * the same `toStringTag`.
1747
+ *
1748
+ * **Note:** This function only supports comparing values with tags of
1749
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1750
+ *
1751
+ * @private
1752
+ * @param {Object} object The object to compare.
1753
+ * @param {Object} other The other object to compare.
1754
+ * @param {string} tag The `toStringTag` of the objects to compare.
1755
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1756
+ * @param {Function} customizer The function to customize comparisons.
1757
+ * @param {Function} equalFunc The function to determine equivalents of values.
1758
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
1759
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1760
+ */
1761
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1762
+ switch (tag) {
1763
+ case dataViewTag$1:
1764
+ if ((object.byteLength != other.byteLength) ||
1765
+ (object.byteOffset != other.byteOffset)) {
1766
+ return false;
1767
+ }
1768
+ object = object.buffer;
1769
+ other = other.buffer;
1770
+
1771
+ case arrayBufferTag:
1772
+ if ((object.byteLength != other.byteLength) ||
1773
+ !equalFunc(new _Uint8Array(object), new _Uint8Array(other))) {
1774
+ return false;
1775
+ }
1776
+ return true;
1777
+
1778
+ case boolTag:
1779
+ case dateTag:
1780
+ case numberTag:
1781
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
1782
+ // Invalid dates are coerced to `NaN`.
1783
+ return eq_1(+object, +other);
1784
+
1785
+ case errorTag:
1786
+ return object.name == other.name && object.message == other.message;
1787
+
1788
+ case regexpTag:
1789
+ case stringTag:
1790
+ // Coerce regexes to strings and treat strings, primitives and objects,
1791
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1792
+ // for more details.
1793
+ return object == (other + '');
1794
+
1795
+ case mapTag$1:
1796
+ var convert = _mapToArray;
1797
+
1798
+ case setTag$1:
1799
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
1800
+ convert || (convert = _setToArray);
1801
+
1802
+ if (object.size != other.size && !isPartial) {
1803
+ return false;
1804
+ }
1805
+ // Assume cyclic values are equal.
1806
+ var stacked = stack.get(object);
1807
+ if (stacked) {
1808
+ return stacked == other;
1809
+ }
1810
+ bitmask |= COMPARE_UNORDERED_FLAG$2;
1811
+
1812
+ // Recursively compare objects (susceptible to call stack limits).
1813
+ stack.set(object, other);
1814
+ var result = _equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1815
+ stack['delete'](object);
1816
+ return result;
1817
+
1818
+ case symbolTag:
1819
+ if (symbolValueOf) {
1820
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
1821
+ }
1822
+ }
1823
+ return false;
1824
+ }
1825
+
1826
+ var _equalByTag = equalByTag;
1827
+
1828
+ /**
1829
+ * Appends the elements of `values` to `array`.
1830
+ *
1831
+ * @private
1832
+ * @param {Array} array The array to modify.
1833
+ * @param {Array} values The values to append.
1834
+ * @returns {Array} Returns `array`.
1835
+ */
1836
+ function arrayPush(array, values) {
1837
+ var index = -1,
1838
+ length = values.length,
1839
+ offset = array.length;
1840
+
1841
+ while (++index < length) {
1842
+ array[offset + index] = values[index];
1843
+ }
1844
+ return array;
1845
+ }
1846
+
1847
+ var _arrayPush = arrayPush;
1848
+
1849
+ /**
1850
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1851
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1852
+ * symbols of `object`.
1853
+ *
1854
+ * @private
1855
+ * @param {Object} object The object to query.
1856
+ * @param {Function} keysFunc The function to get the keys of `object`.
1857
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
1858
+ * @returns {Array} Returns the array of property names and symbols.
1859
+ */
1860
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1861
+ var result = keysFunc(object);
1862
+ return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object));
1863
+ }
1864
+
1865
+ var _baseGetAllKeys = baseGetAllKeys;
1866
+
1867
+ /**
1868
+ * A specialized version of `_.filter` for arrays without support for
1869
+ * iteratee shorthands.
1870
+ *
1871
+ * @private
1872
+ * @param {Array} [array] The array to iterate over.
1873
+ * @param {Function} predicate The function invoked per iteration.
1874
+ * @returns {Array} Returns the new filtered array.
1875
+ */
1876
+ function arrayFilter(array, predicate) {
1877
+ var index = -1,
1878
+ length = array == null ? 0 : array.length,
1879
+ resIndex = 0,
1880
+ result = [];
1881
+
1882
+ while (++index < length) {
1883
+ var value = array[index];
1884
+ if (predicate(value, index, array)) {
1885
+ result[resIndex++] = value;
1886
+ }
1887
+ }
1888
+ return result;
1889
+ }
1890
+
1891
+ var _arrayFilter = arrayFilter;
1892
+
1893
+ /**
1894
+ * This method returns a new empty array.
1895
+ *
1896
+ * @static
1897
+ * @memberOf _
1898
+ * @since 4.13.0
1899
+ * @category Util
1900
+ * @returns {Array} Returns the new empty array.
1901
+ * @example
1902
+ *
1903
+ * var arrays = _.times(2, _.stubArray);
1904
+ *
1905
+ * console.log(arrays);
1906
+ * // => [[], []]
1907
+ *
1908
+ * console.log(arrays[0] === arrays[1]);
1909
+ * // => false
1910
+ */
1911
+ function stubArray() {
1912
+ return [];
1913
+ }
1914
+
1915
+ var stubArray_1 = stubArray;
1916
+
1917
+ /** Used for built-in method references. */
1918
+ var objectProto$2 = Object.prototype;
1919
+
1920
+ /** Built-in value references. */
1921
+ var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
1922
+
1923
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1924
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
1925
+
1926
+ /**
1927
+ * Creates an array of the own enumerable symbols of `object`.
1928
+ *
1929
+ * @private
1930
+ * @param {Object} object The object to query.
1931
+ * @returns {Array} Returns the array of symbols.
1932
+ */
1933
+ var getSymbols = !nativeGetSymbols ? stubArray_1 : function(object) {
1934
+ if (object == null) {
1935
+ return [];
1936
+ }
1937
+ object = Object(object);
1938
+ return _arrayFilter(nativeGetSymbols(object), function(symbol) {
1939
+ return propertyIsEnumerable.call(object, symbol);
1940
+ });
1941
+ };
1942
+
1943
+ var _getSymbols = getSymbols;
1944
+
1945
+ /**
1946
+ * Creates an array of own enumerable property names and symbols of `object`.
1947
+ *
1948
+ * @private
1949
+ * @param {Object} object The object to query.
1950
+ * @returns {Array} Returns the array of property names and symbols.
1951
+ */
1952
+ function getAllKeys(object) {
1953
+ return _baseGetAllKeys(object, keys_1, _getSymbols);
1954
+ }
1955
+
1956
+ var _getAllKeys = getAllKeys;
1957
+
1958
+ /** Used to compose bitmasks for value comparisons. */
1959
+ var COMPARE_PARTIAL_FLAG$3 = 1;
1960
+
1961
+ /** Used for built-in method references. */
1962
+ var objectProto$1 = Object.prototype;
1963
+
1964
+ /** Used to check objects for own properties. */
1965
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
1966
+
1967
+ /**
1968
+ * A specialized version of `baseIsEqualDeep` for objects with support for
1969
+ * partial deep comparisons.
1970
+ *
1971
+ * @private
1972
+ * @param {Object} object The object to compare.
1973
+ * @param {Object} other The other object to compare.
1974
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1975
+ * @param {Function} customizer The function to customize comparisons.
1976
+ * @param {Function} equalFunc The function to determine equivalents of values.
1977
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
1978
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1979
+ */
1980
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
1981
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
1982
+ objProps = _getAllKeys(object),
1983
+ objLength = objProps.length,
1984
+ othProps = _getAllKeys(other),
1985
+ othLength = othProps.length;
1986
+
1987
+ if (objLength != othLength && !isPartial) {
1988
+ return false;
1989
+ }
1990
+ var index = objLength;
1991
+ while (index--) {
1992
+ var key = objProps[index];
1993
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
1994
+ return false;
1995
+ }
1996
+ }
1997
+ // Check that cyclic values are equal.
1998
+ var objStacked = stack.get(object);
1999
+ var othStacked = stack.get(other);
2000
+ if (objStacked && othStacked) {
2001
+ return objStacked == other && othStacked == object;
2002
+ }
2003
+ var result = true;
2004
+ stack.set(object, other);
2005
+ stack.set(other, object);
2006
+
2007
+ var skipCtor = isPartial;
2008
+ while (++index < objLength) {
2009
+ key = objProps[index];
2010
+ var objValue = object[key],
2011
+ othValue = other[key];
2012
+
2013
+ if (customizer) {
2014
+ var compared = isPartial
2015
+ ? customizer(othValue, objValue, key, other, object, stack)
2016
+ : customizer(objValue, othValue, key, object, other, stack);
2017
+ }
2018
+ // Recursively compare objects (susceptible to call stack limits).
2019
+ if (!(compared === undefined
2020
+ ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
2021
+ : compared
2022
+ )) {
2023
+ result = false;
2024
+ break;
2025
+ }
2026
+ skipCtor || (skipCtor = key == 'constructor');
2027
+ }
2028
+ if (result && !skipCtor) {
2029
+ var objCtor = object.constructor,
2030
+ othCtor = other.constructor;
2031
+
2032
+ // Non `Object` object instances with different constructors are not equal.
2033
+ if (objCtor != othCtor &&
2034
+ ('constructor' in object && 'constructor' in other) &&
2035
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
2036
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
2037
+ result = false;
2038
+ }
2039
+ }
2040
+ stack['delete'](object);
2041
+ stack['delete'](other);
2042
+ return result;
2043
+ }
2044
+
2045
+ var _equalObjects = equalObjects;
2046
+
2047
+ /* Built-in method references that are verified to be native. */
2048
+ var DataView = _getNative(_root, 'DataView');
2049
+
2050
+ var _DataView = DataView;
2051
+
2052
+ /* Built-in method references that are verified to be native. */
2053
+ var Promise$1 = _getNative(_root, 'Promise');
2054
+
2055
+ var _Promise = Promise$1;
2056
+
2057
+ /* Built-in method references that are verified to be native. */
2058
+ var Set = _getNative(_root, 'Set');
2059
+
2060
+ var _Set = Set;
2061
+
2062
+ /* Built-in method references that are verified to be native. */
2063
+ var WeakMap = _getNative(_root, 'WeakMap');
2064
+
2065
+ var _WeakMap = WeakMap;
2066
+
2067
+ /** `Object#toString` result references. */
2068
+ var mapTag = '[object Map]',
2069
+ objectTag$1 = '[object Object]',
2070
+ promiseTag = '[object Promise]',
2071
+ setTag = '[object Set]',
2072
+ weakMapTag = '[object WeakMap]';
2073
+
2074
+ var dataViewTag = '[object DataView]';
2075
+
2076
+ /** Used to detect maps, sets, and weakmaps. */
2077
+ var dataViewCtorString = _toSource(_DataView),
2078
+ mapCtorString = _toSource(_Map),
2079
+ promiseCtorString = _toSource(_Promise),
2080
+ setCtorString = _toSource(_Set),
2081
+ weakMapCtorString = _toSource(_WeakMap);
2082
+
2083
+ /**
2084
+ * Gets the `toStringTag` of `value`.
2085
+ *
2086
+ * @private
2087
+ * @param {*} value The value to query.
2088
+ * @returns {string} Returns the `toStringTag`.
2089
+ */
2090
+ var getTag = _baseGetTag;
2091
+
2092
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2093
+ if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag) ||
2094
+ (_Map && getTag(new _Map) != mapTag) ||
2095
+ (_Promise && getTag(_Promise.resolve()) != promiseTag) ||
2096
+ (_Set && getTag(new _Set) != setTag) ||
2097
+ (_WeakMap && getTag(new _WeakMap) != weakMapTag)) {
2098
+ getTag = function(value) {
2099
+ var result = _baseGetTag(value),
2100
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
2101
+ ctorString = Ctor ? _toSource(Ctor) : '';
2102
+
2103
+ if (ctorString) {
2104
+ switch (ctorString) {
2105
+ case dataViewCtorString: return dataViewTag;
2106
+ case mapCtorString: return mapTag;
2107
+ case promiseCtorString: return promiseTag;
2108
+ case setCtorString: return setTag;
2109
+ case weakMapCtorString: return weakMapTag;
2110
+ }
2111
+ }
2112
+ return result;
2113
+ };
2114
+ }
2115
+
2116
+ var _getTag = getTag;
2117
+
2118
+ /** Used to compose bitmasks for value comparisons. */
2119
+ var COMPARE_PARTIAL_FLAG$2 = 1;
2120
+
2121
+ /** `Object#toString` result references. */
2122
+ var argsTag = '[object Arguments]',
2123
+ arrayTag = '[object Array]',
2124
+ objectTag = '[object Object]';
2125
+
2126
+ /** Used for built-in method references. */
2127
+ var objectProto = Object.prototype;
2128
+
2129
+ /** Used to check objects for own properties. */
2130
+ var hasOwnProperty = objectProto.hasOwnProperty;
2131
+
2132
+ /**
2133
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
2134
+ * deep comparisons and tracks traversed objects enabling objects with circular
2135
+ * references to be compared.
2136
+ *
2137
+ * @private
2138
+ * @param {Object} object The object to compare.
2139
+ * @param {Object} other The other object to compare.
2140
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2141
+ * @param {Function} customizer The function to customize comparisons.
2142
+ * @param {Function} equalFunc The function to determine equivalents of values.
2143
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
2144
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2145
+ */
2146
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
2147
+ var objIsArr = isArray_1(object),
2148
+ othIsArr = isArray_1(other),
2149
+ objTag = objIsArr ? arrayTag : _getTag(object),
2150
+ othTag = othIsArr ? arrayTag : _getTag(other);
2151
+
2152
+ objTag = objTag == argsTag ? objectTag : objTag;
2153
+ othTag = othTag == argsTag ? objectTag : othTag;
2154
+
2155
+ var objIsObj = objTag == objectTag,
2156
+ othIsObj = othTag == objectTag,
2157
+ isSameTag = objTag == othTag;
2158
+
2159
+ if (isSameTag && isBuffer_1(object)) {
2160
+ if (!isBuffer_1(other)) {
2161
+ return false;
2162
+ }
2163
+ objIsArr = true;
2164
+ objIsObj = false;
2165
+ }
2166
+ if (isSameTag && !objIsObj) {
2167
+ stack || (stack = new _Stack);
2168
+ return (objIsArr || isTypedArray_1(object))
2169
+ ? _equalArrays(object, other, bitmask, customizer, equalFunc, stack)
2170
+ : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2171
+ }
2172
+ if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
2173
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
2174
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
2175
+
2176
+ if (objIsWrapped || othIsWrapped) {
2177
+ var objUnwrapped = objIsWrapped ? object.value() : object,
2178
+ othUnwrapped = othIsWrapped ? other.value() : other;
2179
+
2180
+ stack || (stack = new _Stack);
2181
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
2182
+ }
2183
+ }
2184
+ if (!isSameTag) {
2185
+ return false;
2186
+ }
2187
+ stack || (stack = new _Stack);
2188
+ return _equalObjects(object, other, bitmask, customizer, equalFunc, stack);
2189
+ }
2190
+
2191
+ var _baseIsEqualDeep = baseIsEqualDeep;
2192
+
2193
+ /**
2194
+ * The base implementation of `_.isEqual` which supports partial comparisons
2195
+ * and tracks traversed objects.
2196
+ *
2197
+ * @private
2198
+ * @param {*} value The value to compare.
2199
+ * @param {*} other The other value to compare.
2200
+ * @param {boolean} bitmask The bitmask flags.
2201
+ * 1 - Unordered comparison
2202
+ * 2 - Partial comparison
2203
+ * @param {Function} [customizer] The function to customize comparisons.
2204
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
2205
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2206
+ */
2207
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
2208
+ if (value === other) {
2209
+ return true;
2210
+ }
2211
+ if (value == null || other == null || (!isObjectLike_1(value) && !isObjectLike_1(other))) {
2212
+ return value !== value && other !== other;
2213
+ }
2214
+ return _baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
2215
+ }
2216
+
2217
+ var _baseIsEqual = baseIsEqual;
2218
+
2219
+ /** Used to compose bitmasks for value comparisons. */
2220
+ var COMPARE_PARTIAL_FLAG$1 = 1,
2221
+ COMPARE_UNORDERED_FLAG$1 = 2;
2222
+
2223
+ /**
2224
+ * The base implementation of `_.isMatch` without support for iteratee shorthands.
2225
+ *
2226
+ * @private
2227
+ * @param {Object} object The object to inspect.
2228
+ * @param {Object} source The object of property values to match.
2229
+ * @param {Array} matchData The property names, values, and compare flags to match.
2230
+ * @param {Function} [customizer] The function to customize comparisons.
2231
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
2232
+ */
2233
+ function baseIsMatch(object, source, matchData, customizer) {
2234
+ var index = matchData.length,
2235
+ length = index,
2236
+ noCustomizer = !customizer;
2237
+
2238
+ if (object == null) {
2239
+ return !length;
2240
+ }
2241
+ object = Object(object);
2242
+ while (index--) {
2243
+ var data = matchData[index];
2244
+ if ((noCustomizer && data[2])
2245
+ ? data[1] !== object[data[0]]
2246
+ : !(data[0] in object)
2247
+ ) {
2248
+ return false;
2249
+ }
2250
+ }
2251
+ while (++index < length) {
2252
+ data = matchData[index];
2253
+ var key = data[0],
2254
+ objValue = object[key],
2255
+ srcValue = data[1];
2256
+
2257
+ if (noCustomizer && data[2]) {
2258
+ if (objValue === undefined && !(key in object)) {
2259
+ return false;
2260
+ }
2261
+ } else {
2262
+ var stack = new _Stack;
2263
+ if (customizer) {
2264
+ var result = customizer(objValue, srcValue, key, object, source, stack);
2265
+ }
2266
+ if (!(result === undefined
2267
+ ? _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack)
2268
+ : result
2269
+ )) {
2270
+ return false;
2271
+ }
2272
+ }
2273
+ }
2274
+ return true;
2275
+ }
2276
+
2277
+ var _baseIsMatch = baseIsMatch;
2278
+
2279
+ /**
2280
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
2281
+ *
2282
+ * @private
2283
+ * @param {*} value The value to check.
2284
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
2285
+ * equality comparisons, else `false`.
2286
+ */
2287
+ function isStrictComparable(value) {
2288
+ return value === value && !isObject_1(value);
2289
+ }
2290
+
2291
+ var _isStrictComparable = isStrictComparable;
2292
+
2293
+ /**
2294
+ * Gets the property names, values, and compare flags of `object`.
2295
+ *
2296
+ * @private
2297
+ * @param {Object} object The object to query.
2298
+ * @returns {Array} Returns the match data of `object`.
2299
+ */
2300
+ function getMatchData(object) {
2301
+ var result = keys_1(object),
2302
+ length = result.length;
2303
+
2304
+ while (length--) {
2305
+ var key = result[length],
2306
+ value = object[key];
2307
+
2308
+ result[length] = [key, value, _isStrictComparable(value)];
2309
+ }
2310
+ return result;
2311
+ }
2312
+
2313
+ var _getMatchData = getMatchData;
2314
+
2315
+ /**
2316
+ * A specialized version of `matchesProperty` for source values suitable
2317
+ * for strict equality comparisons, i.e. `===`.
2318
+ *
2319
+ * @private
2320
+ * @param {string} key The key of the property to get.
2321
+ * @param {*} srcValue The value to match.
2322
+ * @returns {Function} Returns the new spec function.
2323
+ */
2324
+ function matchesStrictComparable(key, srcValue) {
2325
+ return function(object) {
2326
+ if (object == null) {
2327
+ return false;
2328
+ }
2329
+ return object[key] === srcValue &&
2330
+ (srcValue !== undefined || (key in Object(object)));
2331
+ };
2332
+ }
2333
+
2334
+ var _matchesStrictComparable = matchesStrictComparable;
2335
+
2336
+ /**
2337
+ * The base implementation of `_.matches` which doesn't clone `source`.
2338
+ *
2339
+ * @private
2340
+ * @param {Object} source The object of property values to match.
2341
+ * @returns {Function} Returns the new spec function.
2342
+ */
2343
+ function baseMatches(source) {
2344
+ var matchData = _getMatchData(source);
2345
+ if (matchData.length == 1 && matchData[0][2]) {
2346
+ return _matchesStrictComparable(matchData[0][0], matchData[0][1]);
2347
+ }
2348
+ return function(object) {
2349
+ return object === source || _baseIsMatch(object, source, matchData);
2350
+ };
2351
+ }
2352
+
2353
+ var _baseMatches = baseMatches;
2354
+
2355
+ /** Used to match property names within property paths. */
2356
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
2357
+ reIsPlainProp = /^\w*$/;
2358
+
2359
+ /**
2360
+ * Checks if `value` is a property name and not a property path.
2361
+ *
2362
+ * @private
2363
+ * @param {*} value The value to check.
2364
+ * @param {Object} [object] The object to query keys on.
2365
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
2366
+ */
2367
+ function isKey(value, object) {
2368
+ if (isArray_1(value)) {
2369
+ return false;
2370
+ }
2371
+ var type = typeof value;
2372
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
2373
+ value == null || isSymbol_1(value)) {
2374
+ return true;
2375
+ }
2376
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
2377
+ (object != null && value in Object(object));
2378
+ }
2379
+
2380
+ var _isKey = isKey;
2381
+
2382
+ /** Error message constants. */
2383
+ var FUNC_ERROR_TEXT = 'Expected a function';
2384
+
2385
+ /**
2386
+ * Creates a function that memoizes the result of `func`. If `resolver` is
2387
+ * provided, it determines the cache key for storing the result based on the
2388
+ * arguments provided to the memoized function. By default, the first argument
2389
+ * provided to the memoized function is used as the map cache key. The `func`
2390
+ * is invoked with the `this` binding of the memoized function.
2391
+ *
2392
+ * **Note:** The cache is exposed as the `cache` property on the memoized
2393
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
2394
+ * constructor with one whose instances implement the
2395
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
2396
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
2397
+ *
2398
+ * @static
2399
+ * @memberOf _
2400
+ * @since 0.1.0
2401
+ * @category Function
2402
+ * @param {Function} func The function to have its output memoized.
2403
+ * @param {Function} [resolver] The function to resolve the cache key.
2404
+ * @returns {Function} Returns the new memoized function.
2405
+ * @example
2406
+ *
2407
+ * var object = { 'a': 1, 'b': 2 };
2408
+ * var other = { 'c': 3, 'd': 4 };
2409
+ *
2410
+ * var values = _.memoize(_.values);
2411
+ * values(object);
2412
+ * // => [1, 2]
2413
+ *
2414
+ * values(other);
2415
+ * // => [3, 4]
2416
+ *
2417
+ * object.a = 2;
2418
+ * values(object);
2419
+ * // => [1, 2]
2420
+ *
2421
+ * // Modify the result cache.
2422
+ * values.cache.set(object, ['a', 'b']);
2423
+ * values(object);
2424
+ * // => ['a', 'b']
2425
+ *
2426
+ * // Replace `_.memoize.Cache`.
2427
+ * _.memoize.Cache = WeakMap;
2428
+ */
2429
+ function memoize(func, resolver) {
2430
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
2431
+ throw new TypeError(FUNC_ERROR_TEXT);
2432
+ }
2433
+ var memoized = function() {
2434
+ var args = arguments,
2435
+ key = resolver ? resolver.apply(this, args) : args[0],
2436
+ cache = memoized.cache;
2437
+
2438
+ if (cache.has(key)) {
2439
+ return cache.get(key);
2440
+ }
2441
+ var result = func.apply(this, args);
2442
+ memoized.cache = cache.set(key, result) || cache;
2443
+ return result;
2444
+ };
2445
+ memoized.cache = new (memoize.Cache || _MapCache);
2446
+ return memoized;
2447
+ }
2448
+
2449
+ // Expose `MapCache`.
2450
+ memoize.Cache = _MapCache;
2451
+
2452
+ var memoize_1 = memoize;
2453
+
2454
+ /** Used as the maximum memoize cache size. */
2455
+ var MAX_MEMOIZE_SIZE = 500;
2456
+
2457
+ /**
2458
+ * A specialized version of `_.memoize` which clears the memoized function's
2459
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
2460
+ *
2461
+ * @private
2462
+ * @param {Function} func The function to have its output memoized.
2463
+ * @returns {Function} Returns the new memoized function.
2464
+ */
2465
+ function memoizeCapped(func) {
2466
+ var result = memoize_1(func, function(key) {
2467
+ if (cache.size === MAX_MEMOIZE_SIZE) {
2468
+ cache.clear();
2469
+ }
2470
+ return key;
2471
+ });
2472
+
2473
+ var cache = result.cache;
2474
+ return result;
2475
+ }
2476
+
2477
+ var _memoizeCapped = memoizeCapped;
2478
+
2479
+ /** Used to match property names within property paths. */
2480
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
2481
+
2482
+ /** Used to match backslashes in property paths. */
2483
+ var reEscapeChar = /\\(\\)?/g;
2484
+
2485
+ /**
2486
+ * Converts `string` to a property path array.
2487
+ *
2488
+ * @private
2489
+ * @param {string} string The string to convert.
2490
+ * @returns {Array} Returns the property path array.
2491
+ */
2492
+ var stringToPath = _memoizeCapped(function(string) {
2493
+ var result = [];
2494
+ if (string.charCodeAt(0) === 46 /* . */) {
2495
+ result.push('');
2496
+ }
2497
+ string.replace(rePropName, function(match, number, quote, subString) {
2498
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
2499
+ });
2500
+ return result;
2501
+ });
2502
+
2503
+ var _stringToPath = stringToPath;
2504
+
2505
+ /**
2506
+ * A specialized version of `_.map` for arrays without support for iteratee
2507
+ * shorthands.
2508
+ *
2509
+ * @private
2510
+ * @param {Array} [array] The array to iterate over.
2511
+ * @param {Function} iteratee The function invoked per iteration.
2512
+ * @returns {Array} Returns the new mapped array.
2513
+ */
2514
+ function arrayMap(array, iteratee) {
2515
+ var index = -1,
2516
+ length = array == null ? 0 : array.length,
2517
+ result = Array(length);
2518
+
2519
+ while (++index < length) {
2520
+ result[index] = iteratee(array[index], index, array);
2521
+ }
2522
+ return result;
2523
+ }
2524
+
2525
+ var _arrayMap = arrayMap;
2526
+
2527
+ /** Used as references for various `Number` constants. */
2528
+ var INFINITY$2 = 1 / 0;
2529
+
2530
+ /** Used to convert symbols to primitives and strings. */
2531
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
2532
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
2533
+
2534
+ /**
2535
+ * The base implementation of `_.toString` which doesn't convert nullish
2536
+ * values to empty strings.
2537
+ *
2538
+ * @private
2539
+ * @param {*} value The value to process.
2540
+ * @returns {string} Returns the string.
2541
+ */
2542
+ function baseToString(value) {
2543
+ // Exit early for strings to avoid a performance hit in some environments.
2544
+ if (typeof value == 'string') {
2545
+ return value;
2546
+ }
2547
+ if (isArray_1(value)) {
2548
+ // Recursively convert values (susceptible to call stack limits).
2549
+ return _arrayMap(value, baseToString) + '';
2550
+ }
2551
+ if (isSymbol_1(value)) {
2552
+ return symbolToString ? symbolToString.call(value) : '';
2553
+ }
2554
+ var result = (value + '');
2555
+ return (result == '0' && (1 / value) == -INFINITY$2) ? '-0' : result;
2556
+ }
2557
+
2558
+ var _baseToString = baseToString;
2559
+
2560
+ /**
2561
+ * Converts `value` to a string. An empty string is returned for `null`
2562
+ * and `undefined` values. The sign of `-0` is preserved.
2563
+ *
2564
+ * @static
2565
+ * @memberOf _
2566
+ * @since 4.0.0
2567
+ * @category Lang
2568
+ * @param {*} value The value to convert.
2569
+ * @returns {string} Returns the converted string.
2570
+ * @example
2571
+ *
2572
+ * _.toString(null);
2573
+ * // => ''
2574
+ *
2575
+ * _.toString(-0);
2576
+ * // => '-0'
2577
+ *
2578
+ * _.toString([1, 2, 3]);
2579
+ * // => '1,2,3'
2580
+ */
2581
+ function toString(value) {
2582
+ return value == null ? '' : _baseToString(value);
2583
+ }
2584
+
2585
+ var toString_1 = toString;
2586
+
2587
+ /**
2588
+ * Casts `value` to a path array if it's not one.
2589
+ *
2590
+ * @private
2591
+ * @param {*} value The value to inspect.
2592
+ * @param {Object} [object] The object to query keys on.
2593
+ * @returns {Array} Returns the cast property path array.
2594
+ */
2595
+ function castPath(value, object) {
2596
+ if (isArray_1(value)) {
2597
+ return value;
2598
+ }
2599
+ return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
2600
+ }
2601
+
2602
+ var _castPath = castPath;
2603
+
2604
+ /** Used as references for various `Number` constants. */
2605
+ var INFINITY$1 = 1 / 0;
2606
+
2607
+ /**
2608
+ * Converts `value` to a string key if it's not a string or symbol.
2609
+ *
2610
+ * @private
2611
+ * @param {*} value The value to inspect.
2612
+ * @returns {string|symbol} Returns the key.
2613
+ */
2614
+ function toKey(value) {
2615
+ if (typeof value == 'string' || isSymbol_1(value)) {
2616
+ return value;
2617
+ }
2618
+ var result = (value + '');
2619
+ return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
2620
+ }
2621
+
2622
+ var _toKey = toKey;
2623
+
2624
+ /**
2625
+ * The base implementation of `_.get` without support for default values.
2626
+ *
2627
+ * @private
2628
+ * @param {Object} object The object to query.
2629
+ * @param {Array|string} path The path of the property to get.
2630
+ * @returns {*} Returns the resolved value.
2631
+ */
2632
+ function baseGet(object, path) {
2633
+ path = _castPath(path, object);
2634
+
2635
+ var index = 0,
2636
+ length = path.length;
2637
+
2638
+ while (object != null && index < length) {
2639
+ object = object[_toKey(path[index++])];
2640
+ }
2641
+ return (index && index == length) ? object : undefined;
2642
+ }
2643
+
2644
+ var _baseGet = baseGet;
2645
+
2646
+ /**
2647
+ * Gets the value at `path` of `object`. If the resolved value is
2648
+ * `undefined`, the `defaultValue` is returned in its place.
2649
+ *
2650
+ * @static
2651
+ * @memberOf _
2652
+ * @since 3.7.0
2653
+ * @category Object
2654
+ * @param {Object} object The object to query.
2655
+ * @param {Array|string} path The path of the property to get.
2656
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
2657
+ * @returns {*} Returns the resolved value.
2658
+ * @example
2659
+ *
2660
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
2661
+ *
2662
+ * _.get(object, 'a[0].b.c');
2663
+ * // => 3
2664
+ *
2665
+ * _.get(object, ['a', '0', 'b', 'c']);
2666
+ * // => 3
2667
+ *
2668
+ * _.get(object, 'a.b.c', 'default');
2669
+ * // => 'default'
2670
+ */
2671
+ function get(object, path, defaultValue) {
2672
+ var result = object == null ? undefined : _baseGet(object, path);
2673
+ return result === undefined ? defaultValue : result;
2674
+ }
2675
+
2676
+ var get_1 = get;
2677
+
2678
+ /**
2679
+ * The base implementation of `_.hasIn` without support for deep paths.
2680
+ *
2681
+ * @private
2682
+ * @param {Object} [object] The object to query.
2683
+ * @param {Array|string} key The key to check.
2684
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
2685
+ */
2686
+ function baseHasIn(object, key) {
2687
+ return object != null && key in Object(object);
2688
+ }
2689
+
2690
+ var _baseHasIn = baseHasIn;
2691
+
2692
+ /**
2693
+ * Checks if `path` exists on `object`.
2694
+ *
2695
+ * @private
2696
+ * @param {Object} object The object to query.
2697
+ * @param {Array|string} path The path to check.
2698
+ * @param {Function} hasFunc The function to check properties.
2699
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
2700
+ */
2701
+ function hasPath(object, path, hasFunc) {
2702
+ path = _castPath(path, object);
2703
+
2704
+ var index = -1,
2705
+ length = path.length,
2706
+ result = false;
2707
+
2708
+ while (++index < length) {
2709
+ var key = _toKey(path[index]);
2710
+ if (!(result = object != null && hasFunc(object, key))) {
2711
+ break;
2712
+ }
2713
+ object = object[key];
2714
+ }
2715
+ if (result || ++index != length) {
2716
+ return result;
2717
+ }
2718
+ length = object == null ? 0 : object.length;
2719
+ return !!length && isLength_1(length) && _isIndex(key, length) &&
2720
+ (isArray_1(object) || isArguments_1(object));
2721
+ }
2722
+
2723
+ var _hasPath = hasPath;
2724
+
2725
+ /**
2726
+ * Checks if `path` is a direct or inherited property of `object`.
2727
+ *
2728
+ * @static
2729
+ * @memberOf _
2730
+ * @since 4.0.0
2731
+ * @category Object
2732
+ * @param {Object} object The object to query.
2733
+ * @param {Array|string} path The path to check.
2734
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
2735
+ * @example
2736
+ *
2737
+ * var object = _.create({ 'a': _.create({ 'b': 2 }) });
2738
+ *
2739
+ * _.hasIn(object, 'a');
2740
+ * // => true
2741
+ *
2742
+ * _.hasIn(object, 'a.b');
2743
+ * // => true
2744
+ *
2745
+ * _.hasIn(object, ['a', 'b']);
2746
+ * // => true
2747
+ *
2748
+ * _.hasIn(object, 'b');
2749
+ * // => false
2750
+ */
2751
+ function hasIn(object, path) {
2752
+ return object != null && _hasPath(object, path, _baseHasIn);
2753
+ }
2754
+
2755
+ var hasIn_1 = hasIn;
2756
+
2757
+ /** Used to compose bitmasks for value comparisons. */
2758
+ var COMPARE_PARTIAL_FLAG = 1,
2759
+ COMPARE_UNORDERED_FLAG = 2;
2760
+
2761
+ /**
2762
+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
2763
+ *
2764
+ * @private
2765
+ * @param {string} path The path of the property to get.
2766
+ * @param {*} srcValue The value to match.
2767
+ * @returns {Function} Returns the new spec function.
2768
+ */
2769
+ function baseMatchesProperty(path, srcValue) {
2770
+ if (_isKey(path) && _isStrictComparable(srcValue)) {
2771
+ return _matchesStrictComparable(_toKey(path), srcValue);
2772
+ }
2773
+ return function(object) {
2774
+ var objValue = get_1(object, path);
2775
+ return (objValue === undefined && objValue === srcValue)
2776
+ ? hasIn_1(object, path)
2777
+ : _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
2778
+ };
2779
+ }
2780
+
2781
+ var _baseMatchesProperty = baseMatchesProperty;
2782
+
2783
+ /**
2784
+ * The base implementation of `_.property` without support for deep paths.
2785
+ *
2786
+ * @private
2787
+ * @param {string} key The key of the property to get.
2788
+ * @returns {Function} Returns the new accessor function.
2789
+ */
2790
+ function baseProperty(key) {
2791
+ return function(object) {
2792
+ return object == null ? undefined : object[key];
2793
+ };
2794
+ }
2795
+
2796
+ var _baseProperty = baseProperty;
2797
+
2798
+ /**
2799
+ * A specialized version of `baseProperty` which supports deep paths.
2800
+ *
2801
+ * @private
2802
+ * @param {Array|string} path The path of the property to get.
2803
+ * @returns {Function} Returns the new accessor function.
2804
+ */
2805
+ function basePropertyDeep(path) {
2806
+ return function(object) {
2807
+ return _baseGet(object, path);
2808
+ };
2809
+ }
2810
+
2811
+ var _basePropertyDeep = basePropertyDeep;
2812
+
2813
+ /**
2814
+ * Creates a function that returns the value at `path` of a given object.
2815
+ *
2816
+ * @static
2817
+ * @memberOf _
2818
+ * @since 2.4.0
2819
+ * @category Util
2820
+ * @param {Array|string} path The path of the property to get.
2821
+ * @returns {Function} Returns the new accessor function.
2822
+ * @example
2823
+ *
2824
+ * var objects = [
2825
+ * { 'a': { 'b': 2 } },
2826
+ * { 'a': { 'b': 1 } }
2827
+ * ];
2828
+ *
2829
+ * _.map(objects, _.property('a.b'));
2830
+ * // => [2, 1]
2831
+ *
2832
+ * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
2833
+ * // => [1, 2]
2834
+ */
2835
+ function property(path) {
2836
+ return _isKey(path) ? _baseProperty(_toKey(path)) : _basePropertyDeep(path);
2837
+ }
2838
+
2839
+ var property_1 = property;
2840
+
2841
+ /**
2842
+ * The base implementation of `_.iteratee`.
2843
+ *
2844
+ * @private
2845
+ * @param {*} [value=_.identity] The value to convert to an iteratee.
2846
+ * @returns {Function} Returns the iteratee.
2847
+ */
2848
+ function baseIteratee(value) {
2849
+ // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
2850
+ // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
2851
+ if (typeof value == 'function') {
2852
+ return value;
2853
+ }
2854
+ if (value == null) {
2855
+ return identity_1;
2856
+ }
2857
+ if (typeof value == 'object') {
2858
+ return isArray_1(value)
2859
+ ? _baseMatchesProperty(value[0], value[1])
2860
+ : _baseMatches(value);
2861
+ }
2862
+ return property_1(value);
2863
+ }
2864
+
2865
+ var _baseIteratee = baseIteratee;
2866
+
2867
+ /**
2868
+ * The base implementation of `_.reduce` and `_.reduceRight`, without support
2869
+ * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
2870
+ *
2871
+ * @private
2872
+ * @param {Array|Object} collection The collection to iterate over.
2873
+ * @param {Function} iteratee The function invoked per iteration.
2874
+ * @param {*} accumulator The initial value.
2875
+ * @param {boolean} initAccum Specify using the first or last element of
2876
+ * `collection` as the initial value.
2877
+ * @param {Function} eachFunc The function to iterate over `collection`.
2878
+ * @returns {*} Returns the accumulated value.
2879
+ */
2880
+ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
2881
+ eachFunc(collection, function(value, index, collection) {
2882
+ accumulator = initAccum
2883
+ ? (initAccum = false, value)
2884
+ : iteratee(accumulator, value, index, collection);
2885
+ });
2886
+ return accumulator;
2887
+ }
2888
+
2889
+ var _baseReduce = baseReduce;
2890
+
2891
+ /**
2892
+ * Reduces `collection` to a value which is the accumulated result of running
2893
+ * each element in `collection` thru `iteratee`, where each successive
2894
+ * invocation is supplied the return value of the previous. If `accumulator`
2895
+ * is not given, the first element of `collection` is used as the initial
2896
+ * value. The iteratee is invoked with four arguments:
2897
+ * (accumulator, value, index|key, collection).
2898
+ *
2899
+ * Many lodash methods are guarded to work as iteratees for methods like
2900
+ * `_.reduce`, `_.reduceRight`, and `_.transform`.
2901
+ *
2902
+ * The guarded methods are:
2903
+ * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
2904
+ * and `sortBy`
2905
+ *
2906
+ * @static
2907
+ * @memberOf _
2908
+ * @since 0.1.0
2909
+ * @category Collection
2910
+ * @param {Array|Object} collection The collection to iterate over.
2911
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
2912
+ * @param {*} [accumulator] The initial value.
2913
+ * @returns {*} Returns the accumulated value.
2914
+ * @see _.reduceRight
2915
+ * @example
2916
+ *
2917
+ * _.reduce([1, 2], function(sum, n) {
2918
+ * return sum + n;
2919
+ * }, 0);
2920
+ * // => 3
2921
+ *
2922
+ * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
2923
+ * (result[value] || (result[value] = [])).push(key);
2924
+ * return result;
2925
+ * }, {});
2926
+ * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
2927
+ */
2928
+ function reduce(collection, iteratee, accumulator) {
2929
+ var func = isArray_1(collection) ? _arrayReduce : _baseReduce,
2930
+ initAccum = arguments.length < 3;
2931
+
2932
+ return func(collection, _baseIteratee(iteratee), accumulator, initAccum, _baseEach);
2933
+ }
2934
+
2935
+ var reduce_1 = reduce;
2936
+
2937
+ /**
2938
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
2939
+ * support for iteratee shorthands.
2940
+ *
2941
+ * @private
2942
+ * @param {Array} array The array to inspect.
2943
+ * @param {Function} predicate The function invoked per iteration.
2944
+ * @param {number} fromIndex The index to search from.
2945
+ * @param {boolean} [fromRight] Specify iterating from right to left.
2946
+ * @returns {number} Returns the index of the matched value, else `-1`.
2947
+ */
2948
+ function baseFindIndex(array, predicate, fromIndex, fromRight) {
2949
+ var length = array.length,
2950
+ index = fromIndex + (fromRight ? 1 : -1);
2951
+
2952
+ while ((fromRight ? index-- : ++index < length)) {
2953
+ if (predicate(array[index], index, array)) {
2954
+ return index;
2955
+ }
2956
+ }
2957
+ return -1;
2958
+ }
2959
+
2960
+ var _baseFindIndex = baseFindIndex;
2961
+
2962
+ /** Used as references for various `Number` constants. */
2963
+ var INFINITY = 1 / 0,
2964
+ MAX_INTEGER = 1.7976931348623157e+308;
2965
+
2966
+ /**
2967
+ * Converts `value` to a finite number.
2968
+ *
2969
+ * @static
2970
+ * @memberOf _
2971
+ * @since 4.12.0
2972
+ * @category Lang
2973
+ * @param {*} value The value to convert.
2974
+ * @returns {number} Returns the converted number.
2975
+ * @example
2976
+ *
2977
+ * _.toFinite(3.2);
2978
+ * // => 3.2
2979
+ *
2980
+ * _.toFinite(Number.MIN_VALUE);
2981
+ * // => 5e-324
2982
+ *
2983
+ * _.toFinite(Infinity);
2984
+ * // => 1.7976931348623157e+308
2985
+ *
2986
+ * _.toFinite('3.2');
2987
+ * // => 3.2
2988
+ */
2989
+ function toFinite(value) {
2990
+ if (!value) {
2991
+ return value === 0 ? value : 0;
2992
+ }
2993
+ value = toNumber_1(value);
2994
+ if (value === INFINITY || value === -INFINITY) {
2995
+ var sign = (value < 0 ? -1 : 1);
2996
+ return sign * MAX_INTEGER;
2997
+ }
2998
+ return value === value ? value : 0;
2999
+ }
3000
+
3001
+ var toFinite_1 = toFinite;
3002
+
3003
+ /**
3004
+ * Converts `value` to an integer.
3005
+ *
3006
+ * **Note:** This method is loosely based on
3007
+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
3008
+ *
3009
+ * @static
3010
+ * @memberOf _
3011
+ * @since 4.0.0
3012
+ * @category Lang
3013
+ * @param {*} value The value to convert.
3014
+ * @returns {number} Returns the converted integer.
3015
+ * @example
3016
+ *
3017
+ * _.toInteger(3.2);
3018
+ * // => 3
3019
+ *
3020
+ * _.toInteger(Number.MIN_VALUE);
3021
+ * // => 0
3022
+ *
3023
+ * _.toInteger(Infinity);
3024
+ * // => 1.7976931348623157e+308
3025
+ *
3026
+ * _.toInteger('3.2');
3027
+ * // => 3
3028
+ */
3029
+ function toInteger(value) {
3030
+ var result = toFinite_1(value),
3031
+ remainder = result % 1;
3032
+
3033
+ return result === result ? (remainder ? result - remainder : result) : 0;
3034
+ }
3035
+
3036
+ var toInteger_1 = toInteger;
3037
+
3038
+ /* Built-in method references for those with the same name as other `lodash` methods. */
3039
+ var nativeMax$1 = Math.max;
3040
+
3041
+ /**
3042
+ * This method is like `_.find` except that it returns the index of the first
3043
+ * element `predicate` returns truthy for instead of the element itself.
3044
+ *
3045
+ * @static
3046
+ * @memberOf _
3047
+ * @since 1.1.0
3048
+ * @category Array
3049
+ * @param {Array} array The array to inspect.
3050
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
3051
+ * @param {number} [fromIndex=0] The index to search from.
3052
+ * @returns {number} Returns the index of the found element, else `-1`.
3053
+ * @example
3054
+ *
3055
+ * var users = [
3056
+ * { 'user': 'barney', 'active': false },
3057
+ * { 'user': 'fred', 'active': false },
3058
+ * { 'user': 'pebbles', 'active': true }
3059
+ * ];
3060
+ *
3061
+ * _.findIndex(users, function(o) { return o.user == 'barney'; });
3062
+ * // => 0
3063
+ *
3064
+ * // The `_.matches` iteratee shorthand.
3065
+ * _.findIndex(users, { 'user': 'fred', 'active': false });
3066
+ * // => 1
3067
+ *
3068
+ * // The `_.matchesProperty` iteratee shorthand.
3069
+ * _.findIndex(users, ['active', false]);
3070
+ * // => 0
3071
+ *
3072
+ * // The `_.property` iteratee shorthand.
3073
+ * _.findIndex(users, 'active');
3074
+ * // => 2
3075
+ */
3076
+ function findIndex(array, predicate, fromIndex) {
3077
+ var length = array == null ? 0 : array.length;
3078
+ if (!length) {
3079
+ return -1;
3080
+ }
3081
+ var index = fromIndex == null ? 0 : toInteger_1(fromIndex);
3082
+ if (index < 0) {
3083
+ index = nativeMax$1(length + index, 0);
3084
+ }
3085
+ return _baseFindIndex(array, _baseIteratee(predicate), index);
3086
+ }
3087
+
3088
+ var findIndex_1 = findIndex;
3089
+
3090
+ const appendToMap = (map, propName, value) => {
3091
+ const items = map.get(propName);
3092
+ if (!items) {
3093
+ map.set(propName, [value]);
3094
+ }
3095
+ else if (!items.includes(value)) {
3096
+ items.push(value);
3097
+ }
3098
+ };
3099
+ const debounce = (fn, ms) => {
3100
+ let timeoutId;
3101
+ return (...args) => {
3102
+ if (timeoutId) {
3103
+ clearTimeout(timeoutId);
3104
+ }
3105
+ timeoutId = setTimeout(() => {
3106
+ timeoutId = 0;
3107
+ fn(...args);
3108
+ }, ms);
3109
+ };
3110
+ };
3111
+
3112
+ /**
3113
+ * Check if a possible element isConnected.
3114
+ * The property might not be there, so we check for it.
3115
+ *
3116
+ * We want it to return true if isConnected is not a property,
3117
+ * otherwise we would remove these elements and would not update.
3118
+ *
3119
+ * Better leak in Edge than to be useless.
3120
+ */
3121
+ const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
3122
+ const cleanupElements = debounce((map) => {
3123
+ for (let key of map.keys()) {
3124
+ map.set(key, map.get(key).filter(isConnected));
3125
+ }
3126
+ }, 2000);
3127
+ const stencilSubscription = () => {
3128
+ if (typeof getRenderingRef !== 'function') {
3129
+ // If we are not in a stencil project, we do nothing.
3130
+ // This function is not really exported by @stencil/core.
3131
+ return {};
3132
+ }
3133
+ const elmsToUpdate = new Map();
3134
+ return {
3135
+ dispose: () => elmsToUpdate.clear(),
3136
+ get: (propName) => {
3137
+ const elm = getRenderingRef();
3138
+ if (elm) {
3139
+ appendToMap(elmsToUpdate, propName, elm);
3140
+ }
3141
+ },
3142
+ set: (propName) => {
3143
+ const elements = elmsToUpdate.get(propName);
3144
+ if (elements) {
3145
+ elmsToUpdate.set(propName, elements.filter(forceUpdate));
3146
+ }
3147
+ cleanupElements(elmsToUpdate);
3148
+ },
3149
+ reset: () => {
3150
+ elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
3151
+ cleanupElements(elmsToUpdate);
3152
+ },
3153
+ };
3154
+ };
3155
+
3156
+ const unwrap = (val) => (typeof val === 'function' ? val() : val);
3157
+ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
3158
+ const unwrappedState = unwrap(defaultState);
3159
+ let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
3160
+ const handlers = {
3161
+ dispose: [],
3162
+ get: [],
3163
+ set: [],
3164
+ reset: [],
3165
+ };
3166
+ const reset = () => {
3167
+ var _a;
3168
+ // When resetting the state, the default state may be a function - unwrap it to invoke it.
3169
+ // otherwise, the state won't be properly reset
3170
+ states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
3171
+ handlers.reset.forEach((cb) => cb());
3172
+ };
3173
+ const dispose = () => {
3174
+ // Call first dispose as resetting the state would
3175
+ // cause less updates ;)
3176
+ handlers.dispose.forEach((cb) => cb());
3177
+ reset();
3178
+ };
3179
+ const get = (propName) => {
3180
+ handlers.get.forEach((cb) => cb(propName));
3181
+ return states.get(propName);
3182
+ };
3183
+ const set = (propName, value) => {
3184
+ const oldValue = states.get(propName);
3185
+ if (shouldUpdate(value, oldValue, propName)) {
3186
+ states.set(propName, value);
3187
+ handlers.set.forEach((cb) => cb(propName, value, oldValue));
3188
+ }
3189
+ };
3190
+ const state = (typeof Proxy === 'undefined'
3191
+ ? {}
3192
+ : new Proxy(unwrappedState, {
3193
+ get(_, propName) {
3194
+ return get(propName);
3195
+ },
3196
+ ownKeys(_) {
3197
+ return Array.from(states.keys());
3198
+ },
3199
+ getOwnPropertyDescriptor() {
3200
+ return {
3201
+ enumerable: true,
3202
+ configurable: true,
3203
+ };
3204
+ },
3205
+ has(_, propName) {
3206
+ return states.has(propName);
3207
+ },
3208
+ set(_, propName, value) {
3209
+ set(propName, value);
3210
+ return true;
3211
+ },
3212
+ }));
3213
+ const on = (eventName, callback) => {
3214
+ handlers[eventName].push(callback);
3215
+ return () => {
3216
+ removeFromArray(handlers[eventName], callback);
3217
+ };
3218
+ };
3219
+ const onChange = (propName, cb) => {
3220
+ const unSet = on('set', (key, newValue) => {
3221
+ if (key === propName) {
3222
+ cb(newValue);
3223
+ }
3224
+ });
3225
+ // We need to unwrap the defaultState because it might be a function.
3226
+ // Otherwise we might not be sending the right reset value.
3227
+ const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
3228
+ return () => {
3229
+ unSet();
3230
+ unReset();
3231
+ };
3232
+ };
3233
+ const use = (...subscriptions) => {
3234
+ const unsubs = subscriptions.reduce((unsubs, subscription) => {
3235
+ if (subscription.set) {
3236
+ unsubs.push(on('set', subscription.set));
3237
+ }
3238
+ if (subscription.get) {
3239
+ unsubs.push(on('get', subscription.get));
3240
+ }
3241
+ if (subscription.reset) {
3242
+ unsubs.push(on('reset', subscription.reset));
3243
+ }
3244
+ if (subscription.dispose) {
3245
+ unsubs.push(on('dispose', subscription.dispose));
3246
+ }
3247
+ return unsubs;
3248
+ }, []);
3249
+ return () => unsubs.forEach((unsub) => unsub());
3250
+ };
3251
+ const forceUpdate = (key) => {
3252
+ const oldValue = states.get(key);
3253
+ handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
3254
+ };
3255
+ return {
3256
+ state,
3257
+ get,
3258
+ set,
3259
+ on,
3260
+ onChange,
3261
+ use,
3262
+ dispose,
3263
+ reset,
3264
+ forceUpdate,
3265
+ };
3266
+ };
3267
+ const removeFromArray = (array, item) => {
3268
+ const index = array.indexOf(item);
3269
+ if (index >= 0) {
3270
+ array[index] = array[array.length - 1];
3271
+ array.length--;
3272
+ }
3273
+ };
3274
+
3275
+ const createStore = (defaultState, shouldUpdate) => {
3276
+ const map = createObservableMap(defaultState, shouldUpdate);
3277
+ map.use(stencilSubscription());
3278
+ return map;
3279
+ };
3280
+
3281
+ /* Built-in method references for those with the same name as other `lodash` methods. */
3282
+ var nativeCeil = Math.ceil,
3283
+ nativeMax = Math.max;
3284
+
3285
+ /**
3286
+ * The base implementation of `_.range` and `_.rangeRight` which doesn't
3287
+ * coerce arguments.
3288
+ *
3289
+ * @private
3290
+ * @param {number} start The start of the range.
3291
+ * @param {number} end The end of the range.
3292
+ * @param {number} step The value to increment or decrement by.
3293
+ * @param {boolean} [fromRight] Specify iterating from right to left.
3294
+ * @returns {Array} Returns the range of numbers.
3295
+ */
3296
+ function baseRange(start, end, step, fromRight) {
3297
+ var index = -1,
3298
+ length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
3299
+ result = Array(length);
3300
+
3301
+ while (length--) {
3302
+ result[fromRight ? length : ++index] = start;
3303
+ start += step;
3304
+ }
3305
+ return result;
3306
+ }
3307
+
3308
+ var _baseRange = baseRange;
3309
+
3310
+ /**
3311
+ * Checks if the given arguments are from an iteratee call.
3312
+ *
3313
+ * @private
3314
+ * @param {*} value The potential iteratee value argument.
3315
+ * @param {*} index The potential iteratee index or key argument.
3316
+ * @param {*} object The potential iteratee object argument.
3317
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
3318
+ * else `false`.
3319
+ */
3320
+ function isIterateeCall(value, index, object) {
3321
+ if (!isObject_1(object)) {
3322
+ return false;
3323
+ }
3324
+ var type = typeof index;
3325
+ if (type == 'number'
3326
+ ? (isArrayLike_1(object) && _isIndex(index, object.length))
3327
+ : (type == 'string' && index in object)
3328
+ ) {
3329
+ return eq_1(object[index], value);
3330
+ }
3331
+ return false;
3332
+ }
3333
+
3334
+ var _isIterateeCall = isIterateeCall;
3335
+
3336
+ /**
3337
+ * Creates a `_.range` or `_.rangeRight` function.
3338
+ *
3339
+ * @private
3340
+ * @param {boolean} [fromRight] Specify iterating from right to left.
3341
+ * @returns {Function} Returns the new range function.
3342
+ */
3343
+ function createRange(fromRight) {
3344
+ return function(start, end, step) {
3345
+ if (step && typeof step != 'number' && _isIterateeCall(start, end, step)) {
3346
+ end = step = undefined;
3347
+ }
3348
+ // Ensure the sign of `-0` is preserved.
3349
+ start = toFinite_1(start);
3350
+ if (end === undefined) {
3351
+ end = start;
3352
+ start = 0;
3353
+ } else {
3354
+ end = toFinite_1(end);
3355
+ }
3356
+ step = step === undefined ? (start < end ? 1 : -1) : toFinite_1(step);
3357
+ return _baseRange(start, end, step, fromRight);
3358
+ };
3359
+ }
3360
+
3361
+ var _createRange = createRange;
3362
+
3363
+ /**
3364
+ * Creates an array of numbers (positive and/or negative) progressing from
3365
+ * `start` up to, but not including, `end`. A step of `-1` is used if a negative
3366
+ * `start` is specified without an `end` or `step`. If `end` is not specified,
3367
+ * it's set to `start` with `start` then set to `0`.
3368
+ *
3369
+ * **Note:** JavaScript follows the IEEE-754 standard for resolving
3370
+ * floating-point values which can produce unexpected results.
3371
+ *
3372
+ * @static
3373
+ * @since 0.1.0
3374
+ * @memberOf _
3375
+ * @category Util
3376
+ * @param {number} [start=0] The start of the range.
3377
+ * @param {number} end The end of the range.
3378
+ * @param {number} [step=1] The value to increment or decrement by.
3379
+ * @returns {Array} Returns the range of numbers.
3380
+ * @see _.inRange, _.rangeRight
3381
+ * @example
3382
+ *
3383
+ * _.range(4);
3384
+ * // => [0, 1, 2, 3]
3385
+ *
3386
+ * _.range(-4);
3387
+ * // => [0, -1, -2, -3]
3388
+ *
3389
+ * _.range(1, 5);
3390
+ * // => [1, 2, 3, 4]
3391
+ *
3392
+ * _.range(0, 20, 5);
3393
+ * // => [0, 5, 10, 15]
3394
+ *
3395
+ * _.range(0, -4, -1);
3396
+ * // => [0, -1, -2, -3]
3397
+ *
3398
+ * _.range(1, 4, 0);
3399
+ * // => [1, 1, 1]
3400
+ *
3401
+ * _.range(0);
3402
+ * // => []
3403
+ */
3404
+ var range = _createRange();
3405
+
3406
+ var range_1 = range;
3407
+
3408
+ /**
3409
+ * Hide items from main collection
3410
+ * But keep them in store
3411
+ */
3412
+ const trimmedPlugin = (store) => ({
3413
+ set(k, newVal) {
3414
+ switch (k) {
3415
+ case 'trimmed':
3416
+ const proxy = store.get('proxyItems');
3417
+ const trimmed = gatherTrimmedItems(newVal);
3418
+ const newItems = proxy.reduce((result, v) => {
3419
+ // check if present in new trimmed remove from items (filter)
3420
+ if (!trimmed[v]) {
3421
+ result.push(v);
3422
+ }
3423
+ return result;
3424
+ }, []);
3425
+ store.set('items', newItems);
3426
+ break;
3427
+ }
3428
+ },
3429
+ });
3430
+ function gatherTrimmedItems(trimmedItems) {
3431
+ const trimmed = {};
3432
+ for (let trimmedKey in trimmedItems) {
3433
+ // trimmed overweight not trimmed
3434
+ for (let t in trimmedItems[trimmedKey]) {
3435
+ trimmed[t] = trimmed[t] || trimmedItems[trimmedKey][t];
3436
+ }
3437
+ }
3438
+ return trimmed;
3439
+ }
3440
+
3441
+ /** Set stores data */
3442
+ function setStore(store, data) {
3443
+ for (let key in data) {
3444
+ store.set(key, data[key]);
3445
+ }
3446
+ }
3447
+
3448
+ /**
3449
+ * All items
3450
+ * Used as proxy for sorting
3451
+ * Keep order but do not modify final source
3452
+ */
3453
+ const proxyPlugin = (store) => ({
3454
+ set(k, newVal) {
3455
+ if (!isProxy(k)) {
3456
+ return;
3457
+ }
3458
+ /**
3459
+ * Getting existing collection of items
3460
+ * Mark indexes as visible
3461
+ */
3462
+ const oldItems = store.get('items').reduce((r, v) => {
3463
+ r[v] = true;
3464
+ return r;
3465
+ }, {});
3466
+ /**
3467
+ * Check if new values where present in items
3468
+ * Filter item collection according presense
3469
+ */
3470
+ const newItems = newVal.reduce((r, i) => {
3471
+ if (oldItems[i]) {
3472
+ r.push(i);
3473
+ }
3474
+ return r;
3475
+ }, []);
3476
+ store.set('items', newItems);
3477
+ },
3478
+ });
3479
+ function isProxy(k) {
3480
+ return k === 'proxyItems';
3481
+ }
3482
+
3483
+ class DataStore {
3484
+ get store() {
3485
+ return this.dataStore;
3486
+ }
3487
+ constructor(type) {
3488
+ const store = (this.dataStore = createStore({
3489
+ items: [],
3490
+ proxyItems: [],
3491
+ source: [],
3492
+ groupingDepth: 0,
3493
+ groups: {},
3494
+ type,
3495
+ trimmed: {},
3496
+ groupingCustomRenderer: undefined,
3497
+ }));
3498
+ store.use(proxyPlugin(store));
3499
+ store.use(trimmedPlugin(store));
3500
+ }
3501
+ /**
3502
+ * full data source update
3503
+ * @param source - data column/rgRow source
3504
+ * @param grouping - grouping information if present
3505
+ */
3506
+ updateData(source, grouping, silent = false) {
3507
+ // during full update we do drop trim
3508
+ if (!silent) {
3509
+ this.store.set('trimmed', {});
3510
+ }
3511
+ // clear items
3512
+ this.store.set('items', []);
3513
+ const items = range_1(0, (source === null || source === void 0 ? void 0 : source.length) || 0);
3514
+ // set proxy first
3515
+ setStore(this.store, {
3516
+ source,
3517
+ proxyItems: [...items],
3518
+ });
3519
+ // update data items
3520
+ this.store.set('items', items);
3521
+ // apply grooping if present
3522
+ if (grouping) {
3523
+ setStore(this.store, {
3524
+ groupingDepth: grouping.depth,
3525
+ groups: grouping.groups,
3526
+ groupingCustomRenderer: grouping.customRenderer,
3527
+ });
3528
+ }
3529
+ }
3530
+ addTrimmed(some) {
3531
+ let trimmed = this.store.get('trimmed');
3532
+ trimmed = Object.assign(Object.assign({}, trimmed), some);
3533
+ setStore(this.store, { trimmed });
3534
+ }
3535
+ // local data update
3536
+ setData(input) {
3537
+ const data = Object.assign({}, input);
3538
+ setStore(this.store, data);
3539
+ }
3540
+ refresh() {
3541
+ const source = this.store.get('source');
3542
+ this.store.set('source', [...source]);
3543
+ }
3544
+ }
3545
+ /**
3546
+ * get physical index by virtual
3547
+ * @param store - store to process
3548
+ */
3549
+ function getPhysical(store, virtualIndex) {
3550
+ const items = store.get('items');
3551
+ return items[virtualIndex];
3552
+ }
3553
+ /**
3554
+ * get all visible items
3555
+ * @param store - store to process
3556
+ */
3557
+ function getVisibleSourceItem(store) {
3558
+ const source = store.get('source');
3559
+ return store.get('items').map(v => source[v]);
3560
+ }
3561
+ /**
3562
+ * get mapped item from source
3563
+ * @param store - store to process
3564
+ * @param virtualIndex - virtual index to process
3565
+ */
3566
+ function getSourceItem(store, virtualIndex) {
3567
+ const items = store.get('items');
3568
+ const source = store.get('source');
3569
+ return source[items[virtualIndex]];
3570
+ }
3571
+ /**
3572
+ * set item to source
3573
+ * @param store - store to process
3574
+ * @param modelByIndex - collection of rows with virtual indexes to setup
3575
+ */
3576
+ function setSourceByVirtualIndex(store, modelByIndex) {
3577
+ const items = store.get('items');
3578
+ const source = store.get('source');
3579
+ for (let virtualIndex in modelByIndex) {
3580
+ const realIndex = items[virtualIndex];
3581
+ source[realIndex] = modelByIndex[virtualIndex];
3582
+ }
3583
+ store.set('source', [...source]);
3584
+ }
3585
+ function setItems(store, items) {
3586
+ store.set('items', items);
3587
+ }
3588
+ function getSourceItemVirtualIndexByProp(store, prop) {
3589
+ const items = store.get('items');
3590
+ const source = store.get('source');
3591
+ const physicalIndex = findIndex_1(source, { prop });
3592
+ return items.indexOf(physicalIndex);
3593
+ }
3594
+
3595
+ /** Used as references for the maximum length and index of an array. */
3596
+ var MAX_ARRAY_LENGTH$1 = 4294967295,
3597
+ MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH$1 - 1;
3598
+
3599
+ /* Built-in method references for those with the same name as other `lodash` methods. */
3600
+ var nativeFloor = Math.floor,
3601
+ nativeMin = Math.min;
3602
+
3603
+ /**
3604
+ * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
3605
+ * which invokes `iteratee` for `value` and each element of `array` to compute
3606
+ * their sort ranking. The iteratee is invoked with one argument; (value).
3607
+ *
3608
+ * @private
3609
+ * @param {Array} array The sorted array to inspect.
3610
+ * @param {*} value The value to evaluate.
3611
+ * @param {Function} iteratee The iteratee invoked per element.
3612
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
3613
+ * @returns {number} Returns the index at which `value` should be inserted
3614
+ * into `array`.
3615
+ */
3616
+ function baseSortedIndexBy(array, value, iteratee, retHighest) {
3617
+ var low = 0,
3618
+ high = array == null ? 0 : array.length;
3619
+ if (high === 0) {
3620
+ return 0;
3621
+ }
3622
+
3623
+ value = iteratee(value);
3624
+ var valIsNaN = value !== value,
3625
+ valIsNull = value === null,
3626
+ valIsSymbol = isSymbol_1(value),
3627
+ valIsUndefined = value === undefined;
3628
+
3629
+ while (low < high) {
3630
+ var mid = nativeFloor((low + high) / 2),
3631
+ computed = iteratee(array[mid]),
3632
+ othIsDefined = computed !== undefined,
3633
+ othIsNull = computed === null,
3634
+ othIsReflexive = computed === computed,
3635
+ othIsSymbol = isSymbol_1(computed);
3636
+
3637
+ if (valIsNaN) {
3638
+ var setLow = retHighest || othIsReflexive;
3639
+ } else if (valIsUndefined) {
3640
+ setLow = othIsReflexive && (retHighest || othIsDefined);
3641
+ } else if (valIsNull) {
3642
+ setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
3643
+ } else if (valIsSymbol) {
3644
+ setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
3645
+ } else if (othIsNull || othIsSymbol) {
3646
+ setLow = false;
3647
+ } else {
3648
+ setLow = retHighest ? (computed <= value) : (computed < value);
3649
+ }
3650
+ if (setLow) {
3651
+ low = mid + 1;
3652
+ } else {
3653
+ high = mid;
3654
+ }
3655
+ }
3656
+ return nativeMin(high, MAX_ARRAY_INDEX);
3657
+ }
3658
+
3659
+ var _baseSortedIndexBy = baseSortedIndexBy;
3660
+
3661
+ /** Used as references for the maximum length and index of an array. */
3662
+ var MAX_ARRAY_LENGTH = 4294967295,
3663
+ HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
3664
+
3665
+ /**
3666
+ * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
3667
+ * performs a binary search of `array` to determine the index at which `value`
3668
+ * should be inserted into `array` in order to maintain its sort order.
3669
+ *
3670
+ * @private
3671
+ * @param {Array} array The sorted array to inspect.
3672
+ * @param {*} value The value to evaluate.
3673
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
3674
+ * @returns {number} Returns the index at which `value` should be inserted
3675
+ * into `array`.
3676
+ */
3677
+ function baseSortedIndex(array, value, retHighest) {
3678
+ var low = 0,
3679
+ high = array == null ? low : array.length;
3680
+
3681
+ if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
3682
+ while (low < high) {
3683
+ var mid = (low + high) >>> 1,
3684
+ computed = array[mid];
3685
+
3686
+ if (computed !== null && !isSymbol_1(computed) &&
3687
+ (retHighest ? (computed <= value) : (computed < value))) {
3688
+ low = mid + 1;
3689
+ } else {
3690
+ high = mid;
3691
+ }
3692
+ }
3693
+ return high;
3694
+ }
3695
+ return _baseSortedIndexBy(array, value, identity_1, retHighest);
3696
+ }
3697
+
3698
+ var _baseSortedIndex = baseSortedIndex;
3699
+
3700
+ /**
3701
+ * Uses a binary search to determine the lowest index at which `value`
3702
+ * should be inserted into `array` in order to maintain its sort order.
3703
+ *
3704
+ * @static
3705
+ * @memberOf _
3706
+ * @since 0.1.0
3707
+ * @category Array
3708
+ * @param {Array} array The sorted array to inspect.
3709
+ * @param {*} value The value to evaluate.
3710
+ * @returns {number} Returns the index at which `value` should be inserted
3711
+ * into `array`.
3712
+ * @example
3713
+ *
3714
+ * _.sortedIndex([30, 50], 40);
3715
+ * // => 1
3716
+ */
3717
+ function sortedIndex(array, value) {
3718
+ return _baseSortedIndex(array, value);
3719
+ }
3720
+
3721
+ var sortedIndex_1 = sortedIndex;
3722
+
3723
+ /**
3724
+ * Pre-calculation
3725
+ * Dimension custom sizes for each cell
3726
+ * Keeps only changed sizes, skips origin size
3727
+ */
3728
+ function calculateDimensionData(originItemSize, newSizes = {}) {
3729
+ const positionIndexes = [];
3730
+ const positionIndexToItem = {};
3731
+ const indexToItem = {};
3732
+ // combine all new sizes
3733
+ const sizes = Object.assign({}, newSizes);
3734
+ // prepare order sorted new sizes and calculate changed real size
3735
+ let newIndexes = [];
3736
+ each(newSizes, (_, i) => {
3737
+ const index = parseInt(i, 10);
3738
+ newIndexes[sortedIndex_1(newIndexes, index)] = index;
3739
+ });
3740
+ // fill new coordinates based on what is changed
3741
+ reduce_1(newIndexes, (previous, itemIndex, i) => {
3742
+ const newItem = {
3743
+ itemIndex,
3744
+ start: 0,
3745
+ end: 0,
3746
+ };
3747
+ // if previous item was changed too
3748
+ if (previous) {
3749
+ const itemsBetween = (itemIndex - previous.itemIndex - 1) * originItemSize;
3750
+ newItem.start = itemsBetween + previous.end;
3751
+ }
3752
+ else {
3753
+ newItem.start = itemIndex * originItemSize;
3754
+ }
3755
+ newItem.end = newItem.start + sizes[itemIndex];
3756
+ positionIndexes.push(newItem.start);
3757
+ indexToItem[itemIndex] = positionIndexToItem[i] = newItem;
3758
+ return newItem;
3759
+ }, undefined);
3760
+ return {
3761
+ indexes: newIndexes,
3762
+ positionIndexes: [...positionIndexes],
3763
+ positionIndexToItem: Object.assign({}, positionIndexToItem),
3764
+ indexToItem,
3765
+ sizes,
3766
+ };
3767
+ }
3768
+ /**
3769
+ * Calculate item by position
3770
+ */
3771
+ function getItemByPosition({ indexes, positionIndexes, originItemSize, positionIndexToItem }, pos) {
3772
+ const item = {
3773
+ itemIndex: 0,
3774
+ start: 0,
3775
+ end: 0,
3776
+ };
3777
+ const currentPlace = indexes.length ? sortedIndex_1(positionIndexes, pos) : 0;
3778
+ // not found or first index
3779
+ if (!currentPlace) {
3780
+ item.itemIndex = Math.floor(pos / originItemSize);
3781
+ item.start = item.itemIndex * originItemSize;
3782
+ item.end = item.start + originItemSize;
3783
+ return item;
3784
+ }
3785
+ const positionItem = positionIndexToItem[currentPlace - 1];
3786
+ // if item has specified size
3787
+ if (positionItem.end > pos) {
3788
+ return positionItem;
3789
+ }
3790
+ // special size item was present before
3791
+ const relativePos = pos - positionItem.end;
3792
+ const relativeIndex = Math.floor(relativePos / originItemSize);
3793
+ item.itemIndex = positionItem.itemIndex + 1 + relativeIndex;
3794
+ item.start = positionItem.end + relativeIndex * originItemSize;
3795
+ item.end = item.start + originItemSize;
3796
+ return item;
3797
+ }
3798
+ function getItemByIndex(dimension, index) {
3799
+ let item = {
3800
+ itemIndex: index,
3801
+ start: 0,
3802
+ end: 0,
3803
+ };
3804
+ // if item has specified size
3805
+ if (dimension.indexToItem[index]) {
3806
+ return dimension.indexToItem[index];
3807
+ }
3808
+ const currentPlace = dimension.indexes.length ? sortedIndex_1(dimension.indexes, index) : 0;
3809
+ // not found or first index
3810
+ if (!currentPlace) {
3811
+ item.start = item.itemIndex * dimension.originItemSize;
3812
+ item.end = item.start + dimension.originItemSize;
3813
+ return item;
3814
+ }
3815
+ // special size item was present before
3816
+ const positionItem = dimension.indexToItem[dimension.indexes[currentPlace - 1]];
3817
+ item.start = positionItem.end + (index - positionItem.itemIndex - 1) * dimension.originItemSize;
3818
+ item.end = item.start + dimension.originItemSize;
3819
+ return item;
3820
+ }
3821
+
3822
+ const MIN_COL_SIZE = 30;
3823
+ const RESIZE_INTERVAL = 40;
3824
+ const DATA_COL = 'data-rgCol';
3825
+ const DATA_ROW = 'data-rgRow';
3826
+ const UUID = 'grid-uuid';
3827
+ const DISABLED_CLASS = 'disabled';
3828
+ const CELL_CLASS = 'rgCell';
3829
+ const ROW_HEADER_TYPE = 'rowHeaders';
3830
+ const HEADER_CLASS = 'rgHeaderCell';
3831
+ const HEADER_SORTABLE_CLASS = 'sortable';
3832
+ const HEADER_ROW_CLASS = 'header-rgRow';
3833
+ const HEADER_ACTUAL_ROW_CLASS = 'actual-rgRow';
3834
+ const DRAG_ICON_CLASS = 'revo-drag-icon';
3835
+ const DRAGGABLE_CLASS = 'revo-draggable';
3836
+ const FOCUS_CLASS = 'focused-cell';
3837
+ const SELECTION_BORDER_CLASS = 'selection-border-range';
3838
+ const MOBILE_CLASS = 'mobile-handler';
3839
+ const TMP_SELECTION_BG_CLASS = 'temp-bg-range';
3840
+ const CELL_HANDLER_CLASS = 'autofill-handle';
3841
+ const EDIT_INPUT_WR = 'edit-input-wrapper';
3842
+ const DRAGG_TEXT = 'Draggable item';
3843
+ const GRID_INTERNALS = '__rvgr';
3844
+
3845
+ /* Calculate system scrollbar width */
3846
+ function getScrollbarWidth(doc) {
3847
+ // Creating invisible container
3848
+ const outer = doc.createElement('div');
3849
+ const styles = outer.style;
3850
+ styles.visibility = 'hidden';
3851
+ styles.overflow = 'scroll'; // forcing scrollbar to appear
3852
+ styles.msOverflowStyle = 'scrollbar'; // needed for WinJS apps
3853
+ doc.body.appendChild(outer);
3854
+ // Creating inner element and placing it in the container
3855
+ const inner = doc.createElement('div');
3856
+ outer.appendChild(inner);
3857
+ // Calculating difference between container's full width and the child width
3858
+ const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
3859
+ // Removing temporary elements from the DOM
3860
+ outer.parentNode.removeChild(outer);
3861
+ return scrollbarWidth;
3862
+ }
3863
+ /* Scale a value between 2 ranges
3864
+ *
3865
+ * Sample:
3866
+ * // 55 from a 0-100 range to a 0-1000 range (Ranges don't have to be positive)
3867
+ * const n = scaleValue(55, [0,100], [0,1000]);
3868
+ *
3869
+ * Ranges of two values
3870
+ * @from
3871
+ * @to
3872
+ *
3873
+ * ~~ return value does the equivalent of Math.floor but faster.
3874
+ */
3875
+ function scaleValue(value, from, to) {
3876
+ return ((to[1] - to[0]) * (value - from[0])) / (from[1] - from[0]) + to[0];
3877
+ }
3878
+ /**
3879
+ * Async timeout
3880
+ */
3881
+ async function timeout(delay = 0) {
3882
+ await new Promise((r) => {
3883
+ setTimeout(() => r(), delay);
3884
+ });
3885
+ }
3886
+
3887
+ export { DRAGG_TEXT as $, getItemByPosition as A, ROW_HEADER_TYPE as B, CELL_HANDLER_CLASS as C, DataStore as D, EDIT_INPUT_WR as E, FOCUS_CLASS as F, GRID_INTERNALS as G, CELL_CLASS as H, DISABLED_CLASS as I, scaleValue as J, _baseFindIndex as K, DRAG_ICON_CLASS as L, MOBILE_CLASS as M, DRAGGABLE_CLASS as N, DATA_COL as O, DATA_ROW as P, _getNative as Q, RESIZE_INTERVAL as R, SELECTION_BORDER_CLASS as S, TMP_SELECTION_BG_CLASS as T, UUID as U, HEADER_CLASS as V, HEADER_SORTABLE_CLASS as W, MIN_COL_SIZE as X, HEADER_ROW_CLASS as Y, HEADER_ACTUAL_ROW_CLASS as Z, _baseIteratee as _, _baseEach as a, isArray_1 as b, _arrayMap as c, getSourceItemVirtualIndexByProp as d, each as e, findIndex_1 as f, getSourceItem as g, getVisibleSourceItem as h, isArrayLike_1 as i, createStore as j, keys_1 as k, setStore as l, calculateDimensionData as m, getItemByIndex as n, gatherTrimmedItems as o, _baseProperty as p, _getTag as q, reduce_1 as r, setSourceByVirtualIndex as s, _baseKeys as t, toInteger_1 as u, _isIterateeCall as v, timeout as w, getPhysical as x, setItems as y, getScrollbarWidth as z };
3888
+
3889
+ //# sourceMappingURL=index-728bf6e3.js.map