@p4ulcristian/iris-layout 0.2.0 → 0.2.2

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 (201) hide show
  1. package/dist/cljs-runtime/cljs.core.js +38746 -0
  2. package/dist/cljs-runtime/cljs.core.js.map +1 -0
  3. package/dist/cljs-runtime/cljs.pprint.js +8400 -0
  4. package/dist/cljs-runtime/cljs.pprint.js.map +1 -0
  5. package/dist/cljs-runtime/cljs.stacktrace.js +561 -0
  6. package/dist/cljs-runtime/cljs.stacktrace.js.map +1 -0
  7. package/dist/cljs-runtime/cljs_env.js +1286 -0
  8. package/dist/cljs-runtime/clojure.data.js +295 -0
  9. package/dist/cljs-runtime/clojure.data.js.map +1 -0
  10. package/dist/cljs-runtime/clojure.set.js +382 -0
  11. package/dist/cljs-runtime/clojure.set.js.map +1 -0
  12. package/dist/cljs-runtime/clojure.string.js +480 -0
  13. package/dist/cljs-runtime/clojure.string.js.map +1 -0
  14. package/dist/cljs-runtime/clojure.walk.js +132 -0
  15. package/dist/cljs-runtime/clojure.walk.js.map +1 -0
  16. package/dist/cljs-runtime/devtools.async.js +90 -0
  17. package/dist/cljs-runtime/devtools.async.js.map +1 -0
  18. package/dist/cljs-runtime/devtools.context.js +11 -0
  19. package/dist/cljs-runtime/devtools.context.js.map +1 -0
  20. package/dist/cljs-runtime/devtools.core.js +175 -0
  21. package/dist/cljs-runtime/devtools.core.js.map +1 -0
  22. package/dist/cljs-runtime/devtools.defaults.js +20 -0
  23. package/dist/cljs-runtime/devtools.defaults.js.map +1 -0
  24. package/dist/cljs-runtime/devtools.format.js +631 -0
  25. package/dist/cljs-runtime/devtools.format.js.map +1 -0
  26. package/dist/cljs-runtime/devtools.formatters.budgeting.js +182 -0
  27. package/dist/cljs-runtime/devtools.formatters.budgeting.js.map +1 -0
  28. package/dist/cljs-runtime/devtools.formatters.core.js +220 -0
  29. package/dist/cljs-runtime/devtools.formatters.core.js.map +1 -0
  30. package/dist/cljs-runtime/devtools.formatters.helpers.js +228 -0
  31. package/dist/cljs-runtime/devtools.formatters.helpers.js.map +1 -0
  32. package/dist/cljs-runtime/devtools.formatters.js +261 -0
  33. package/dist/cljs-runtime/devtools.formatters.js.map +1 -0
  34. package/dist/cljs-runtime/devtools.formatters.markup.js +1174 -0
  35. package/dist/cljs-runtime/devtools.formatters.markup.js.map +1 -0
  36. package/dist/cljs-runtime/devtools.formatters.printing.js +313 -0
  37. package/dist/cljs-runtime/devtools.formatters.printing.js.map +1 -0
  38. package/dist/cljs-runtime/devtools.formatters.state.js +325 -0
  39. package/dist/cljs-runtime/devtools.formatters.state.js.map +1 -0
  40. package/dist/cljs-runtime/devtools.formatters.templating.js +666 -0
  41. package/dist/cljs-runtime/devtools.formatters.templating.js.map +1 -0
  42. package/dist/cljs-runtime/devtools.hints.js +193 -0
  43. package/dist/cljs-runtime/devtools.hints.js.map +1 -0
  44. package/dist/cljs-runtime/devtools.munging.js +1058 -0
  45. package/dist/cljs-runtime/devtools.munging.js.map +1 -0
  46. package/dist/cljs-runtime/devtools.prefs.js +87 -0
  47. package/dist/cljs-runtime/devtools.prefs.js.map +1 -0
  48. package/dist/cljs-runtime/devtools.preload.js +11 -0
  49. package/dist/cljs-runtime/devtools.preload.js.map +1 -0
  50. package/dist/cljs-runtime/devtools.protocols.js +98 -0
  51. package/dist/cljs-runtime/devtools.protocols.js.map +1 -0
  52. package/dist/cljs-runtime/devtools.reporter.js +81 -0
  53. package/dist/cljs-runtime/devtools.reporter.js.map +1 -0
  54. package/dist/cljs-runtime/devtools.toolbox.js +141 -0
  55. package/dist/cljs-runtime/devtools.toolbox.js.map +1 -0
  56. package/dist/cljs-runtime/devtools.util.js +517 -0
  57. package/dist/cljs-runtime/devtools.util.js.map +1 -0
  58. package/dist/cljs-runtime/devtools.version.js +9 -0
  59. package/dist/cljs-runtime/devtools.version.js.map +1 -0
  60. package/dist/cljs-runtime/goog.array.array.js +659 -0
  61. package/dist/cljs-runtime/goog.array.array.js.map +9 -0
  62. package/dist/cljs-runtime/goog.asserts.asserts.js +133 -0
  63. package/dist/cljs-runtime/goog.asserts.asserts.js.map +9 -0
  64. package/dist/cljs-runtime/goog.asserts.dom.js +90 -0
  65. package/dist/cljs-runtime/goog.asserts.dom.js.map +9 -0
  66. package/dist/cljs-runtime/goog.async.nexttick.js +93 -0
  67. package/dist/cljs-runtime/goog.async.nexttick.js.map +9 -0
  68. package/dist/cljs-runtime/goog.base.js +1261 -0
  69. package/dist/cljs-runtime/goog.base.js.map +9 -0
  70. package/dist/cljs-runtime/goog.collections.maps.js +82 -0
  71. package/dist/cljs-runtime/goog.collections.maps.js.map +9 -0
  72. package/dist/cljs-runtime/goog.debug.entrypointregistry.js +44 -0
  73. package/dist/cljs-runtime/goog.debug.entrypointregistry.js.map +9 -0
  74. package/dist/cljs-runtime/goog.debug.error.js +30 -0
  75. package/dist/cljs-runtime/goog.debug.error.js.map +9 -0
  76. package/dist/cljs-runtime/goog.dom.asserts.js +40 -0
  77. package/dist/cljs-runtime/goog.dom.asserts.js.map +9 -0
  78. package/dist/cljs-runtime/goog.dom.browserfeature.js +21 -0
  79. package/dist/cljs-runtime/goog.dom.browserfeature.js.map +9 -0
  80. package/dist/cljs-runtime/goog.dom.dom.js +1087 -0
  81. package/dist/cljs-runtime/goog.dom.dom.js.map +9 -0
  82. package/dist/cljs-runtime/goog.dom.element.js +69 -0
  83. package/dist/cljs-runtime/goog.dom.element.js.map +9 -0
  84. package/dist/cljs-runtime/goog.dom.htmlelement.js +7 -0
  85. package/dist/cljs-runtime/goog.dom.htmlelement.js.map +9 -0
  86. package/dist/cljs-runtime/goog.dom.nodetype.js +6 -0
  87. package/dist/cljs-runtime/goog.dom.nodetype.js.map +9 -0
  88. package/dist/cljs-runtime/goog.dom.safe.js +277 -0
  89. package/dist/cljs-runtime/goog.dom.safe.js.map +9 -0
  90. package/dist/cljs-runtime/goog.dom.tagname.js +147 -0
  91. package/dist/cljs-runtime/goog.dom.tagname.js.map +9 -0
  92. package/dist/cljs-runtime/goog.dom.tags.js +10 -0
  93. package/dist/cljs-runtime/goog.dom.tags.js.map +9 -0
  94. package/dist/cljs-runtime/goog.flags.flags.js +12 -0
  95. package/dist/cljs-runtime/goog.flags.flags.js.map +9 -0
  96. package/dist/cljs-runtime/goog.fs.blob.js +38 -0
  97. package/dist/cljs-runtime/goog.fs.blob.js.map +9 -0
  98. package/dist/cljs-runtime/goog.fs.url.js +37 -0
  99. package/dist/cljs-runtime/goog.fs.url.js.map +9 -0
  100. package/dist/cljs-runtime/goog.functions.functions.js +211 -0
  101. package/dist/cljs-runtime/goog.functions.functions.js.map +9 -0
  102. package/dist/cljs-runtime/goog.html.safehtml.js +321 -0
  103. package/dist/cljs-runtime/goog.html.safehtml.js.map +9 -0
  104. package/dist/cljs-runtime/goog.html.safescript.js +65 -0
  105. package/dist/cljs-runtime/goog.html.safescript.js.map +9 -0
  106. package/dist/cljs-runtime/goog.html.safestyle.js +175 -0
  107. package/dist/cljs-runtime/goog.html.safestyle.js.map +9 -0
  108. package/dist/cljs-runtime/goog.html.safestylesheet.js +99 -0
  109. package/dist/cljs-runtime/goog.html.safestylesheet.js.map +9 -0
  110. package/dist/cljs-runtime/goog.html.safeurl.js +231 -0
  111. package/dist/cljs-runtime/goog.html.safeurl.js.map +9 -0
  112. package/dist/cljs-runtime/goog.html.trustedresourceurl.js +123 -0
  113. package/dist/cljs-runtime/goog.html.trustedresourceurl.js.map +9 -0
  114. package/dist/cljs-runtime/goog.html.trustedtypes.js +16 -0
  115. package/dist/cljs-runtime/goog.html.trustedtypes.js.map +9 -0
  116. package/dist/cljs-runtime/goog.html.uncheckedconversions.js +52 -0
  117. package/dist/cljs-runtime/goog.html.uncheckedconversions.js.map +9 -0
  118. package/dist/cljs-runtime/goog.labs.useragent.browser.js +352 -0
  119. package/dist/cljs-runtime/goog.labs.useragent.browser.js.map +9 -0
  120. package/dist/cljs-runtime/goog.labs.useragent.engine.js +73 -0
  121. package/dist/cljs-runtime/goog.labs.useragent.engine.js.map +9 -0
  122. package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js +14 -0
  123. package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js.map +9 -0
  124. package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js +74 -0
  125. package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js.map +9 -0
  126. package/dist/cljs-runtime/goog.labs.useragent.platform.js +147 -0
  127. package/dist/cljs-runtime/goog.labs.useragent.platform.js.map +9 -0
  128. package/dist/cljs-runtime/goog.labs.useragent.useragent.js +21 -0
  129. package/dist/cljs-runtime/goog.labs.useragent.useragent.js.map +9 -0
  130. package/dist/cljs-runtime/goog.labs.useragent.util.js +81 -0
  131. package/dist/cljs-runtime/goog.labs.useragent.util.js.map +9 -0
  132. package/dist/cljs-runtime/goog.math.coordinate.js +97 -0
  133. package/dist/cljs-runtime/goog.math.coordinate.js.map +9 -0
  134. package/dist/cljs-runtime/goog.math.integer.js +445 -0
  135. package/dist/cljs-runtime/goog.math.integer.js.map +9 -0
  136. package/dist/cljs-runtime/goog.math.long.js +437 -0
  137. package/dist/cljs-runtime/goog.math.long.js.map +9 -0
  138. package/dist/cljs-runtime/goog.math.math.js +158 -0
  139. package/dist/cljs-runtime/goog.math.math.js.map +9 -0
  140. package/dist/cljs-runtime/goog.math.size.js +76 -0
  141. package/dist/cljs-runtime/goog.math.size.js.map +9 -0
  142. package/dist/cljs-runtime/goog.object.object.js +284 -0
  143. package/dist/cljs-runtime/goog.object.object.js.map +9 -0
  144. package/dist/cljs-runtime/goog.reflect.reflect.js +32 -0
  145. package/dist/cljs-runtime/goog.reflect.reflect.js.map +9 -0
  146. package/dist/cljs-runtime/goog.string.const.js +35 -0
  147. package/dist/cljs-runtime/goog.string.const.js.map +9 -0
  148. package/dist/cljs-runtime/goog.string.internal.js +119 -0
  149. package/dist/cljs-runtime/goog.string.internal.js.map +9 -0
  150. package/dist/cljs-runtime/goog.string.string.js +462 -0
  151. package/dist/cljs-runtime/goog.string.string.js.map +9 -0
  152. package/dist/cljs-runtime/goog.string.stringbuffer.js +32 -0
  153. package/dist/cljs-runtime/goog.string.stringbuffer.js.map +9 -0
  154. package/dist/cljs-runtime/goog.string.typedstring.js +9 -0
  155. package/dist/cljs-runtime/goog.string.typedstring.js.map +9 -0
  156. package/dist/cljs-runtime/goog.structs.structs.js +199 -0
  157. package/dist/cljs-runtime/goog.structs.structs.js.map +9 -0
  158. package/dist/cljs-runtime/goog.uri.uri.js +628 -0
  159. package/dist/cljs-runtime/goog.uri.uri.js.map +9 -0
  160. package/dist/cljs-runtime/goog.uri.utils.js +326 -0
  161. package/dist/cljs-runtime/goog.uri.utils.js.map +9 -0
  162. package/dist/cljs-runtime/goog.useragent.useragent.js +139 -0
  163. package/dist/cljs-runtime/goog.useragent.useragent.js.map +9 -0
  164. package/dist/cljs-runtime/iris_layout.components.entity_card_group.js +202 -0
  165. package/dist/cljs-runtime/iris_layout.components.entity_card_group.js.map +1 -0
  166. package/dist/cljs-runtime/iris_layout.components.entity_tile.js +295 -0
  167. package/dist/cljs-runtime/iris_layout.components.entity_tile.js.map +1 -0
  168. package/dist/cljs-runtime/iris_layout.components.entity_tile_group.js +33 -0
  169. package/dist/cljs-runtime/iris_layout.components.entity_tile_group.js.map +1 -0
  170. package/dist/cljs-runtime/iris_layout.components.resizer.js +91 -0
  171. package/dist/cljs-runtime/iris_layout.components.resizer.js.map +1 -0
  172. package/dist/cljs-runtime/iris_layout.components.touch_drag.js +399 -0
  173. package/dist/cljs-runtime/iris_layout.components.touch_drag.js.map +1 -0
  174. package/dist/cljs-runtime/iris_layout.core.js +1372 -0
  175. package/dist/cljs-runtime/iris_layout.core.js.map +1 -0
  176. package/dist/cljs-runtime/iris_layout.layout.js +328 -0
  177. package/dist/cljs-runtime/iris_layout.layout.js.map +1 -0
  178. package/dist/cljs-runtime/reagent.core.js +993 -0
  179. package/dist/cljs-runtime/reagent.core.js.map +1 -0
  180. package/dist/cljs-runtime/reagent.debug.js +75 -0
  181. package/dist/cljs-runtime/reagent.debug.js.map +1 -0
  182. package/dist/cljs-runtime/reagent.impl.batching.js +270 -0
  183. package/dist/cljs-runtime/reagent.impl.batching.js.map +1 -0
  184. package/dist/cljs-runtime/reagent.impl.component.js +758 -0
  185. package/dist/cljs-runtime/reagent.impl.component.js.map +1 -0
  186. package/dist/cljs-runtime/reagent.impl.input.js +175 -0
  187. package/dist/cljs-runtime/reagent.impl.input.js.map +1 -0
  188. package/dist/cljs-runtime/reagent.impl.protocols.js +99 -0
  189. package/dist/cljs-runtime/reagent.impl.protocols.js.map +1 -0
  190. package/dist/cljs-runtime/reagent.impl.template.js +660 -0
  191. package/dist/cljs-runtime/reagent.impl.template.js.map +1 -0
  192. package/dist/cljs-runtime/reagent.impl.util.js +748 -0
  193. package/dist/cljs-runtime/reagent.impl.util.js.map +1 -0
  194. package/dist/cljs-runtime/reagent.ratom.js +1668 -0
  195. package/dist/cljs-runtime/reagent.ratom.js.map +1 -0
  196. package/dist/cljs-runtime/shadow.esm.esm_import$react.js +5 -0
  197. package/dist/cljs-runtime/shadow.module.iris-layout.append.js +2 -0
  198. package/dist/cljs-runtime/shadow.module.iris-layout.prepend.js +2 -0
  199. package/dist/iris-layout.js +375 -355
  200. package/dist/styles.css +287 -9
  201. package/package.json +1 -1
@@ -0,0 +1,659 @@
1
+ import "./cljs_env.js";
2
+ import "./goog.asserts.asserts.js";
3
+ goog.loadModule(function(exports) {
4
+ function peek(array) {
5
+ return array[array.length - 1];
6
+ }
7
+ function forEachRight(arr, f, opt_obj) {
8
+ const l = arr.length;
9
+ const arr2 = typeof arr === "string" ? arr.split("") : arr;
10
+ for (let i = l - 1; i >= 0; --i) {
11
+ if (i in arr2) {
12
+ f.call(opt_obj, arr2[i], i, arr);
13
+ }
14
+ }
15
+ }
16
+ function count(arr, f, opt_obj) {
17
+ let count = 0;
18
+ forEach(arr, function(element, index, arr) {
19
+ if (f.call(opt_obj, element, index, arr)) {
20
+ ++count;
21
+ }
22
+ }, opt_obj);
23
+ return count;
24
+ }
25
+ function find(arr, f, opt_obj) {
26
+ const i = findIndex(arr, f, opt_obj);
27
+ return i < 0 ? null : typeof arr === "string" ? arr.charAt(i) : arr[i];
28
+ }
29
+ function findIndex(arr, f, opt_obj) {
30
+ const l = arr.length;
31
+ const arr2 = typeof arr === "string" ? arr.split("") : arr;
32
+ for (let i = 0; i < l; i++) {
33
+ if (i in arr2 && f.call(opt_obj, arr2[i], i, arr)) {
34
+ return i;
35
+ }
36
+ }
37
+ return -1;
38
+ }
39
+ function findRight(arr, f, opt_obj) {
40
+ const i = findIndexRight(arr, f, opt_obj);
41
+ return i < 0 ? null : typeof arr === "string" ? arr.charAt(i) : arr[i];
42
+ }
43
+ function findIndexRight(arr, f, opt_obj) {
44
+ const l = arr.length;
45
+ const arr2 = typeof arr === "string" ? arr.split("") : arr;
46
+ for (let i = l - 1; i >= 0; i--) {
47
+ if (i in arr2 && f.call(opt_obj, arr2[i], i, arr)) {
48
+ return i;
49
+ }
50
+ }
51
+ return -1;
52
+ }
53
+ function contains(arr, obj) {
54
+ return indexOf(arr, obj) >= 0;
55
+ }
56
+ function isEmpty(arr) {
57
+ return arr.length == 0;
58
+ }
59
+ function clear(arr) {
60
+ if (!Array.isArray(arr)) {
61
+ for (let i = arr.length - 1; i >= 0; i--) {
62
+ delete arr[i];
63
+ }
64
+ }
65
+ arr.length = 0;
66
+ }
67
+ function insert(arr, obj) {
68
+ if (!contains(arr, obj)) {
69
+ arr.push(obj);
70
+ }
71
+ }
72
+ function insertAt(arr, obj, opt_i) {
73
+ splice(arr, opt_i, 0, obj);
74
+ }
75
+ function insertArrayAt(arr, elementsToAdd, opt_i) {
76
+ goog.partial(splice, arr, opt_i, 0).apply(null, elementsToAdd);
77
+ }
78
+ function insertBefore(arr, obj, opt_obj2) {
79
+ let i;
80
+ if (arguments.length == 2 || (i = indexOf(arr, opt_obj2)) < 0) {
81
+ arr.push(obj);
82
+ } else {
83
+ insertAt(arr, obj, i);
84
+ }
85
+ }
86
+ function remove(arr, obj) {
87
+ const i = indexOf(arr, obj);
88
+ let rv;
89
+ if (rv = i >= 0) {
90
+ removeAt(arr, i);
91
+ }
92
+ return rv;
93
+ }
94
+ function removeLast(arr, obj) {
95
+ const i = lastIndexOf(arr, obj);
96
+ if (i >= 0) {
97
+ removeAt(arr, i);
98
+ return true;
99
+ }
100
+ return false;
101
+ }
102
+ function removeAt(arr, i) {
103
+ asserts.assert(arr.length != null);
104
+ return Array.prototype.splice.call(arr, i, 1).length == 1;
105
+ }
106
+ function removeIf(arr, f, opt_obj) {
107
+ const i = findIndex(arr, f, opt_obj);
108
+ if (i >= 0) {
109
+ removeAt(arr, i);
110
+ return true;
111
+ }
112
+ return false;
113
+ }
114
+ function removeAllIf(arr, f, opt_obj) {
115
+ let removedCount = 0;
116
+ forEachRight(arr, function(val, index) {
117
+ if (f.call(opt_obj, val, index, arr)) {
118
+ if (removeAt(arr, index)) {
119
+ removedCount++;
120
+ }
121
+ }
122
+ });
123
+ return removedCount;
124
+ }
125
+ function concat(var_args) {
126
+ return Array.prototype.concat.apply([], arguments);
127
+ }
128
+ function join(var_args) {
129
+ return Array.prototype.concat.apply([], arguments);
130
+ }
131
+ function toArray(object) {
132
+ const length = object.length;
133
+ if (length > 0) {
134
+ const rv = new Array(length);
135
+ for (let i = 0; i < length; i++) {
136
+ rv[i] = object[i];
137
+ }
138
+ return rv;
139
+ }
140
+ return [];
141
+ }
142
+ function extend(arr1, var_args) {
143
+ for (let i = 1; i < arguments.length; i++) {
144
+ const arr2 = arguments[i];
145
+ if (goog.isArrayLike(arr2)) {
146
+ const len1 = arr1.length || 0;
147
+ const len2 = arr2.length || 0;
148
+ arr1.length = len1 + len2;
149
+ for (let j = 0; j < len2; j++) {
150
+ arr1[len1 + j] = arr2[j];
151
+ }
152
+ } else {
153
+ arr1.push(arr2);
154
+ }
155
+ }
156
+ }
157
+ function splice(arr, index, howMany, var_args) {
158
+ asserts.assert(arr.length != null);
159
+ return Array.prototype.splice.apply(arr, slice(arguments, 1));
160
+ }
161
+ function slice(arr, start, opt_end) {
162
+ asserts.assert(arr.length != null);
163
+ if (arguments.length <= 2) {
164
+ return Array.prototype.slice.call(arr, start);
165
+ } else {
166
+ return Array.prototype.slice.call(arr, start, opt_end);
167
+ }
168
+ }
169
+ function removeDuplicates(arr, opt_rv, opt_hashFn) {
170
+ const returnArray = opt_rv || arr;
171
+ const defaultHashFn = function(item) {
172
+ return goog.isObject(item) ? "o" + goog.getUid(item) : (typeof item).charAt(0) + item;
173
+ };
174
+ const hashFn = opt_hashFn || defaultHashFn;
175
+ let cursorInsert = 0;
176
+ let cursorRead = 0;
177
+ const seen = {};
178
+ for (; cursorRead < arr.length;) {
179
+ const current = arr[cursorRead++];
180
+ const key = hashFn(current);
181
+ if (!Object.prototype.hasOwnProperty.call(seen, key)) {
182
+ seen[key] = true;
183
+ returnArray[cursorInsert++] = current;
184
+ }
185
+ }
186
+ returnArray.length = cursorInsert;
187
+ }
188
+ function binarySearch(arr, target, opt_compareFn) {
189
+ return binarySearch_(arr, opt_compareFn || defaultCompare, false, target);
190
+ }
191
+ function binarySelect(arr, evaluator, opt_obj) {
192
+ return binarySearch_(arr, evaluator, true, undefined, opt_obj);
193
+ }
194
+ function binarySearch_(arr, compareFn, isEvaluator, opt_target, opt_selfObj) {
195
+ let left = 0;
196
+ let right = arr.length;
197
+ let found;
198
+ for (; left < right;) {
199
+ const middle = left + (right - left >>> 1);
200
+ let compareResult;
201
+ if (isEvaluator) {
202
+ compareResult = compareFn.call(opt_selfObj, arr[middle], middle, arr);
203
+ } else {
204
+ compareResult = compareFn(opt_target, arr[middle]);
205
+ }
206
+ if (compareResult > 0) {
207
+ left = middle + 1;
208
+ } else {
209
+ right = middle;
210
+ found = !compareResult;
211
+ }
212
+ }
213
+ return found ? left : -left - 1;
214
+ }
215
+ function sort(arr, opt_compareFn) {
216
+ arr.sort(opt_compareFn || defaultCompare);
217
+ }
218
+ function stableSort(arr, opt_compareFn) {
219
+ function stableCompareFn(obj1, obj2) {
220
+ return valueCompareFn(obj1.value, obj2.value) || obj1.index - obj2.index;
221
+ }
222
+ const compArr = new Array(arr.length);
223
+ for (let i = 0; i < arr.length; i++) {
224
+ compArr[i] = {index:i, value:arr[i]};
225
+ }
226
+ const valueCompareFn = opt_compareFn || defaultCompare;
227
+ sort(compArr, stableCompareFn);
228
+ for (let i = 0; i < arr.length; i++) {
229
+ arr[i] = compArr[i].value;
230
+ }
231
+ }
232
+ function sortByKey(arr, keyFn, opt_compareFn) {
233
+ const keyCompareFn = opt_compareFn || defaultCompare;
234
+ sort(arr, function(a, b) {
235
+ return keyCompareFn(keyFn(a), keyFn(b));
236
+ });
237
+ }
238
+ function sortObjectsByKey(arr, key, opt_compareFn) {
239
+ sortByKey(arr, function(obj) {
240
+ return obj[key];
241
+ }, opt_compareFn);
242
+ }
243
+ function isSorted(arr, opt_compareFn, opt_strict) {
244
+ const compare = opt_compareFn || defaultCompare;
245
+ for (let i = 1; i < arr.length; i++) {
246
+ const compareResult = compare(arr[i - 1], arr[i]);
247
+ if (compareResult > 0 || compareResult == 0 && opt_strict) {
248
+ return false;
249
+ }
250
+ }
251
+ return true;
252
+ }
253
+ function equals(arr1, arr2, opt_equalsFn) {
254
+ if (!goog.isArrayLike(arr1) || !goog.isArrayLike(arr2) || arr1.length != arr2.length) {
255
+ return false;
256
+ }
257
+ const l = arr1.length;
258
+ const equalsFn = opt_equalsFn || defaultCompareEquality;
259
+ for (let i = 0; i < l; i++) {
260
+ if (!equalsFn(arr1[i], arr2[i])) {
261
+ return false;
262
+ }
263
+ }
264
+ return true;
265
+ }
266
+ function compare3(arr1, arr2, opt_compareFn) {
267
+ const compare = opt_compareFn || defaultCompare;
268
+ const l = Math.min(arr1.length, arr2.length);
269
+ for (let i = 0; i < l; i++) {
270
+ const result = compare(arr1[i], arr2[i]);
271
+ if (result != 0) {
272
+ return result;
273
+ }
274
+ }
275
+ return defaultCompare(arr1.length, arr2.length);
276
+ }
277
+ function defaultCompare(a, b) {
278
+ return a > b ? 1 : a < b ? -1 : 0;
279
+ }
280
+ function inverseDefaultCompare(a, b) {
281
+ return -defaultCompare(a, b);
282
+ }
283
+ function defaultCompareEquality(a, b) {
284
+ return a === b;
285
+ }
286
+ function binaryInsert(array, value, opt_compareFn) {
287
+ const index = binarySearch(array, value, opt_compareFn);
288
+ if (index < 0) {
289
+ insertAt(array, value, -(index + 1));
290
+ return true;
291
+ }
292
+ return false;
293
+ }
294
+ function binaryRemove(array, value, opt_compareFn) {
295
+ const index = binarySearch(array, value, opt_compareFn);
296
+ return index >= 0 ? removeAt(array, index) : false;
297
+ }
298
+ function bucket(array, sorter, opt_obj) {
299
+ const buckets = {};
300
+ for (let i = 0; i < array.length; i++) {
301
+ const value = array[i];
302
+ const key = sorter.call(opt_obj, value, i, array);
303
+ if (key !== undefined) {
304
+ const bucket = buckets[key] || (buckets[key] = []);
305
+ bucket.push(value);
306
+ }
307
+ }
308
+ return buckets;
309
+ }
310
+ function bucketToMap(array, sorter) {
311
+ const buckets = new Map();
312
+ for (let i = 0; i < array.length; i++) {
313
+ const value = array[i];
314
+ const key = sorter(value, i, array);
315
+ if (key !== undefined) {
316
+ let bucket = buckets.get(key);
317
+ if (!bucket) {
318
+ bucket = [];
319
+ buckets.set(key, bucket);
320
+ }
321
+ bucket.push(value);
322
+ }
323
+ }
324
+ return buckets;
325
+ }
326
+ function toObject(arr, keyFunc, opt_obj) {
327
+ const ret = {};
328
+ forEach(arr, function(element, index) {
329
+ ret[keyFunc.call(opt_obj, element, index, arr)] = element;
330
+ });
331
+ return ret;
332
+ }
333
+ function toMap(arr, keyFunc) {
334
+ const map = new Map();
335
+ for (let i = 0; i < arr.length; i++) {
336
+ const element = arr[i];
337
+ map.set(keyFunc(element, i, arr), element);
338
+ }
339
+ return map;
340
+ }
341
+ function range(startOrEnd, opt_end, opt_step) {
342
+ const array = [];
343
+ let start = 0;
344
+ let end = startOrEnd;
345
+ const step = opt_step || 1;
346
+ if (opt_end !== undefined) {
347
+ start = startOrEnd;
348
+ end = opt_end;
349
+ }
350
+ if (step * (end - start) < 0) {
351
+ return [];
352
+ }
353
+ if (step > 0) {
354
+ for (let i = start; i < end; i = i + step) {
355
+ array.push(i);
356
+ }
357
+ } else {
358
+ for (let i = start; i > end; i = i + step) {
359
+ array.push(i);
360
+ }
361
+ }
362
+ return array;
363
+ }
364
+ function repeat(value, n) {
365
+ const array = [];
366
+ for (let i = 0; i < n; i++) {
367
+ array[i] = value;
368
+ }
369
+ return array;
370
+ }
371
+ function flatten(var_args) {
372
+ const CHUNK_SIZE = 8192;
373
+ const result = [];
374
+ for (let i = 0; i < arguments.length; i++) {
375
+ const element = arguments[i];
376
+ if (Array.isArray(element)) {
377
+ for (let c = 0; c < element.length; c = c + CHUNK_SIZE) {
378
+ const chunk = slice(element, c, c + CHUNK_SIZE);
379
+ const recurseResult = flatten.apply(null, chunk);
380
+ for (let r = 0; r < recurseResult.length; r++) {
381
+ result.push(recurseResult[r]);
382
+ }
383
+ }
384
+ } else {
385
+ result.push(element);
386
+ }
387
+ }
388
+ return result;
389
+ }
390
+ function rotate(array, n) {
391
+ asserts.assert(array.length != null);
392
+ if (array.length) {
393
+ n = n % array.length;
394
+ if (n > 0) {
395
+ Array.prototype.unshift.apply(array, array.splice(-n, n));
396
+ } else if (n < 0) {
397
+ Array.prototype.push.apply(array, array.splice(0, -n));
398
+ }
399
+ }
400
+ return array;
401
+ }
402
+ function moveItem(arr, fromIndex, toIndex) {
403
+ asserts.assert(fromIndex >= 0 && fromIndex < arr.length);
404
+ asserts.assert(toIndex >= 0 && toIndex < arr.length);
405
+ const removedItems = Array.prototype.splice.call(arr, fromIndex, 1);
406
+ Array.prototype.splice.call(arr, toIndex, 0, removedItems[0]);
407
+ }
408
+ function zip(var_args) {
409
+ if (!arguments.length) {
410
+ return [];
411
+ }
412
+ const result = [];
413
+ let minLen = arguments[0].length;
414
+ for (let i = 1; i < arguments.length; i++) {
415
+ if (arguments[i].length < minLen) {
416
+ minLen = arguments[i].length;
417
+ }
418
+ }
419
+ for (let i = 0; i < minLen; i++) {
420
+ const value = [];
421
+ for (let j = 0; j < arguments.length; j++) {
422
+ value.push(arguments[j][i]);
423
+ }
424
+ result.push(value);
425
+ }
426
+ return result;
427
+ }
428
+ function shuffle(arr, opt_randFn) {
429
+ const randFn = opt_randFn || Math.random;
430
+ for (let i = arr.length - 1; i > 0; i--) {
431
+ const j = Math.floor(randFn() * (i + 1));
432
+ const tmp = arr[i];
433
+ arr[i] = arr[j];
434
+ arr[j] = tmp;
435
+ }
436
+ }
437
+ function copyByIndex(arr, index_arr) {
438
+ const result = [];
439
+ forEach(index_arr, function(index) {
440
+ result.push(arr[index]);
441
+ });
442
+ return result;
443
+ }
444
+ function concatMap(arr, f, opt_obj) {
445
+ return concat.apply([], map(arr, f, opt_obj));
446
+ }
447
+ "use strict";
448
+ goog.module("goog.array");
449
+ goog.module.declareLegacyNamespace();
450
+ const asserts = goog.require("goog.asserts");
451
+ goog.NATIVE_ARRAY_PROTOTYPES = goog.define("goog.NATIVE_ARRAY_PROTOTYPES", goog.TRUSTED_SITE);
452
+ const ASSUME_NATIVE_FUNCTIONS = goog.define("goog.array.ASSUME_NATIVE_FUNCTIONS", goog.FEATURESET_YEAR > 2012);
453
+ exports.ASSUME_NATIVE_FUNCTIONS = ASSUME_NATIVE_FUNCTIONS;
454
+ exports.peek = peek;
455
+ exports.last = peek;
456
+ const indexOf = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.indexOf) ? function(arr, obj, opt_fromIndex) {
457
+ asserts.assert(arr.length != null);
458
+ return Array.prototype.indexOf.call(arr, obj, opt_fromIndex);
459
+ } : function(arr, obj, opt_fromIndex) {
460
+ const fromIndex = opt_fromIndex == null ? 0 : opt_fromIndex < 0 ? Math.max(0, arr.length + opt_fromIndex) : opt_fromIndex;
461
+ if (typeof arr === "string") {
462
+ if (typeof obj !== "string" || obj.length != 1) {
463
+ return -1;
464
+ }
465
+ return arr.indexOf(obj, fromIndex);
466
+ }
467
+ for (let i = fromIndex; i < arr.length; i++) {
468
+ if (i in arr && arr[i] === obj) {
469
+ return i;
470
+ }
471
+ }
472
+ return -1;
473
+ };
474
+ exports.indexOf = indexOf;
475
+ const lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.lastIndexOf) ? function(arr, obj, opt_fromIndex) {
476
+ asserts.assert(arr.length != null);
477
+ const fromIndex = opt_fromIndex == null ? arr.length - 1 : opt_fromIndex;
478
+ return Array.prototype.lastIndexOf.call(arr, obj, fromIndex);
479
+ } : function(arr, obj, opt_fromIndex) {
480
+ let fromIndex = opt_fromIndex == null ? arr.length - 1 : opt_fromIndex;
481
+ if (fromIndex < 0) {
482
+ fromIndex = Math.max(0, arr.length + fromIndex);
483
+ }
484
+ if (typeof arr === "string") {
485
+ if (typeof obj !== "string" || obj.length != 1) {
486
+ return -1;
487
+ }
488
+ return arr.lastIndexOf(obj, fromIndex);
489
+ }
490
+ for (let i = fromIndex; i >= 0; i--) {
491
+ if (i in arr && arr[i] === obj) {
492
+ return i;
493
+ }
494
+ }
495
+ return -1;
496
+ };
497
+ exports.lastIndexOf = lastIndexOf;
498
+ const forEach = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.forEach) ? function(arr, f, opt_obj) {
499
+ asserts.assert(arr.length != null);
500
+ Array.prototype.forEach.call(arr, f, opt_obj);
501
+ } : function(arr, f, opt_obj) {
502
+ const l = arr.length;
503
+ const arr2 = typeof arr === "string" ? arr.split("") : arr;
504
+ for (let i = 0; i < l; i++) {
505
+ if (i in arr2) {
506
+ f.call(opt_obj, arr2[i], i, arr);
507
+ }
508
+ }
509
+ };
510
+ exports.forEach = forEach;
511
+ exports.forEachRight = forEachRight;
512
+ const filter = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.filter) ? function(arr, f, opt_obj) {
513
+ asserts.assert(arr.length != null);
514
+ return Array.prototype.filter.call(arr, f, opt_obj);
515
+ } : function(arr, f, opt_obj) {
516
+ const l = arr.length;
517
+ const res = [];
518
+ let resLength = 0;
519
+ const arr2 = typeof arr === "string" ? arr.split("") : arr;
520
+ for (let i = 0; i < l; i++) {
521
+ if (i in arr2) {
522
+ const val = arr2[i];
523
+ if (f.call(opt_obj, val, i, arr)) {
524
+ res[resLength++] = val;
525
+ }
526
+ }
527
+ }
528
+ return res;
529
+ };
530
+ exports.filter = filter;
531
+ const map = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.map) ? function(arr, f, opt_obj) {
532
+ asserts.assert(arr.length != null);
533
+ return Array.prototype.map.call(arr, f, opt_obj);
534
+ } : function(arr, f, opt_obj) {
535
+ const l = arr.length;
536
+ const res = new Array(l);
537
+ const arr2 = typeof arr === "string" ? arr.split("") : arr;
538
+ for (let i = 0; i < l; i++) {
539
+ if (i in arr2) {
540
+ res[i] = f.call(opt_obj, arr2[i], i, arr);
541
+ }
542
+ }
543
+ return res;
544
+ };
545
+ exports.map = map;
546
+ const reduce = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.reduce) ? function(arr, f, val, opt_obj) {
547
+ asserts.assert(arr.length != null);
548
+ if (opt_obj) {
549
+ f = goog.bind(f, opt_obj);
550
+ }
551
+ return Array.prototype.reduce.call(arr, f, val);
552
+ } : function(arr, f, val, opt_obj) {
553
+ let rval = val;
554
+ forEach(arr, function(val, index) {
555
+ rval = f.call(opt_obj, rval, val, index, arr);
556
+ });
557
+ return rval;
558
+ };
559
+ exports.reduce = reduce;
560
+ const reduceRight = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.reduceRight) ? function(arr, f, val, opt_obj) {
561
+ asserts.assert(arr.length != null);
562
+ asserts.assert(f != null);
563
+ if (opt_obj) {
564
+ f = goog.bind(f, opt_obj);
565
+ }
566
+ return Array.prototype.reduceRight.call(arr, f, val);
567
+ } : function(arr, f, val, opt_obj) {
568
+ let rval = val;
569
+ forEachRight(arr, function(val, index) {
570
+ rval = f.call(opt_obj, rval, val, index, arr);
571
+ });
572
+ return rval;
573
+ };
574
+ exports.reduceRight = reduceRight;
575
+ const some = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.some) ? function(arr, f, opt_obj) {
576
+ asserts.assert(arr.length != null);
577
+ return Array.prototype.some.call(arr, f, opt_obj);
578
+ } : function(arr, f, opt_obj) {
579
+ const l = arr.length;
580
+ const arr2 = typeof arr === "string" ? arr.split("") : arr;
581
+ for (let i = 0; i < l; i++) {
582
+ if (i in arr2 && f.call(opt_obj, arr2[i], i, arr)) {
583
+ return true;
584
+ }
585
+ }
586
+ return false;
587
+ };
588
+ exports.some = some;
589
+ const every = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.every) ? function(arr, f, opt_obj) {
590
+ asserts.assert(arr.length != null);
591
+ return Array.prototype.every.call(arr, f, opt_obj);
592
+ } : function(arr, f, opt_obj) {
593
+ const l = arr.length;
594
+ const arr2 = typeof arr === "string" ? arr.split("") : arr;
595
+ for (let i = 0; i < l; i++) {
596
+ if (i in arr2 && !f.call(opt_obj, arr2[i], i, arr)) {
597
+ return false;
598
+ }
599
+ }
600
+ return true;
601
+ };
602
+ exports.every = every;
603
+ exports.count = count;
604
+ exports.find = find;
605
+ exports.findIndex = findIndex;
606
+ exports.findRight = findRight;
607
+ exports.findIndexRight = findIndexRight;
608
+ exports.contains = contains;
609
+ exports.isEmpty = isEmpty;
610
+ exports.clear = clear;
611
+ exports.insert = insert;
612
+ exports.insertAt = insertAt;
613
+ exports.insertArrayAt = insertArrayAt;
614
+ exports.insertBefore = insertBefore;
615
+ exports.remove = remove;
616
+ exports.removeLast = removeLast;
617
+ exports.removeAt = removeAt;
618
+ exports.removeIf = removeIf;
619
+ exports.removeAllIf = removeAllIf;
620
+ exports.concat = concat;
621
+ exports.join = join;
622
+ exports.toArray = toArray;
623
+ const clone = toArray;
624
+ exports.clone = clone;
625
+ exports.extend = extend;
626
+ exports.splice = splice;
627
+ exports.slice = slice;
628
+ exports.removeDuplicates = removeDuplicates;
629
+ exports.binarySearch = binarySearch;
630
+ exports.binarySelect = binarySelect;
631
+ exports.sort = sort;
632
+ exports.stableSort = stableSort;
633
+ exports.sortByKey = sortByKey;
634
+ exports.sortObjectsByKey = sortObjectsByKey;
635
+ exports.isSorted = isSorted;
636
+ exports.equals = equals;
637
+ exports.compare3 = compare3;
638
+ exports.defaultCompare = defaultCompare;
639
+ exports.inverseDefaultCompare = inverseDefaultCompare;
640
+ exports.defaultCompareEquality = defaultCompareEquality;
641
+ exports.binaryInsert = binaryInsert;
642
+ exports.binaryRemove = binaryRemove;
643
+ exports.bucket = bucket;
644
+ exports.bucketToMap = bucketToMap;
645
+ exports.toObject = toObject;
646
+ exports.toMap = toMap;
647
+ exports.range = range;
648
+ exports.repeat = repeat;
649
+ exports.flatten = flatten;
650
+ exports.rotate = rotate;
651
+ exports.moveItem = moveItem;
652
+ exports.zip = zip;
653
+ exports.shuffle = shuffle;
654
+ exports.copyByIndex = copyByIndex;
655
+ exports.concatMap = concatMap;
656
+ return exports;
657
+ });
658
+
659
+ //# sourceMappingURL=goog.array.array.js.map