quicksnack 3.34.3 → 3.34.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +2548 -17
- package/dist/bundle.min.js +142 -142
- package/package.json +3 -1
package/dist/bundle.js
CHANGED
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var styledComponents = require('styled-components');
|
|
5
|
-
var polished = require('polished');
|
|
6
|
-
var isPropValid = require('@emotion/is-prop-valid');
|
|
7
|
-
var clsx = require('clsx');
|
|
8
5
|
var immer = require('immer');
|
|
9
|
-
var _chunk = require('lodash.chunk');
|
|
10
|
-
var _difference = require('lodash.difference');
|
|
11
6
|
|
|
12
7
|
/*! *****************************************************************************
|
|
13
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -38,13 +33,831 @@ function __rest(s, e) {
|
|
|
38
33
|
return t;
|
|
39
34
|
}
|
|
40
35
|
|
|
36
|
+
function _extends() {
|
|
37
|
+
_extends = Object.assign || function (target) {
|
|
38
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
39
|
+
var source = arguments[i];
|
|
40
|
+
|
|
41
|
+
for (var key in source) {
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
43
|
+
target[key] = source[key];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return target;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return _extends.apply(this, arguments);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function _assertThisInitialized(self) {
|
|
55
|
+
if (self === void 0) {
|
|
56
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return self;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function _setPrototypeOf(o, p) {
|
|
63
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
64
|
+
o.__proto__ = p;
|
|
65
|
+
return o;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return _setPrototypeOf(o, p);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function _inheritsLoose(subClass, superClass) {
|
|
72
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
73
|
+
subClass.prototype.constructor = subClass;
|
|
74
|
+
_setPrototypeOf(subClass, superClass);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function _getPrototypeOf(o) {
|
|
78
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
79
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
80
|
+
};
|
|
81
|
+
return _getPrototypeOf(o);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function _isNativeFunction(fn) {
|
|
85
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function _isNativeReflectConstruct() {
|
|
89
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
90
|
+
if (Reflect.construct.sham) return false;
|
|
91
|
+
if (typeof Proxy === "function") return true;
|
|
92
|
+
|
|
93
|
+
try {
|
|
94
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
95
|
+
return true;
|
|
96
|
+
} catch (e) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function _construct(Parent, args, Class) {
|
|
102
|
+
if (_isNativeReflectConstruct()) {
|
|
103
|
+
_construct = Reflect.construct;
|
|
104
|
+
} else {
|
|
105
|
+
_construct = function _construct(Parent, args, Class) {
|
|
106
|
+
var a = [null];
|
|
107
|
+
a.push.apply(a, args);
|
|
108
|
+
var Constructor = Function.bind.apply(Parent, a);
|
|
109
|
+
var instance = new Constructor();
|
|
110
|
+
if (Class) _setPrototypeOf(instance, Class.prototype);
|
|
111
|
+
return instance;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return _construct.apply(null, arguments);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function _wrapNativeSuper(Class) {
|
|
119
|
+
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
120
|
+
|
|
121
|
+
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
|
122
|
+
if (Class === null || !_isNativeFunction(Class)) return Class;
|
|
123
|
+
|
|
124
|
+
if (typeof Class !== "function") {
|
|
125
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (typeof _cache !== "undefined") {
|
|
129
|
+
if (_cache.has(Class)) return _cache.get(Class);
|
|
130
|
+
|
|
131
|
+
_cache.set(Class, Wrapper);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function Wrapper() {
|
|
135
|
+
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
Wrapper.prototype = Object.create(Class.prototype, {
|
|
139
|
+
constructor: {
|
|
140
|
+
value: Wrapper,
|
|
141
|
+
enumerable: false,
|
|
142
|
+
writable: true,
|
|
143
|
+
configurable: true
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
return _setPrototypeOf(Wrapper, Class);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
return _wrapNativeSuper(Class);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Parse errors.md and turn it into a simple hash of code: message
|
|
156
|
+
* @private
|
|
157
|
+
*/
|
|
158
|
+
var ERRORS = {
|
|
159
|
+
"1": "Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",
|
|
160
|
+
"2": "Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",
|
|
161
|
+
"3": "Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",
|
|
162
|
+
"4": "Couldn't generate valid rgb string from %s, it returned %s.\n\n",
|
|
163
|
+
"5": "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",
|
|
164
|
+
"6": "Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",
|
|
165
|
+
"7": "Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",
|
|
166
|
+
"8": "Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",
|
|
167
|
+
"9": "Please provide a number of steps to the modularScale helper.\n\n",
|
|
168
|
+
"10": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
|
|
169
|
+
"11": "Invalid value passed as base to modularScale, expected number or em string but got \"%s\"\n\n",
|
|
170
|
+
"12": "Expected a string ending in \"px\" or a number passed as the first argument to %s(), got \"%s\" instead.\n\n",
|
|
171
|
+
"13": "Expected a string ending in \"px\" or a number passed as the second argument to %s(), got \"%s\" instead.\n\n",
|
|
172
|
+
"14": "Passed invalid pixel value (\"%s\") to %s(), please pass a value like \"12px\" or 12.\n\n",
|
|
173
|
+
"15": "Passed invalid base value (\"%s\") to %s(), please pass a value like \"12px\" or 12.\n\n",
|
|
174
|
+
"16": "You must provide a template to this method.\n\n",
|
|
175
|
+
"17": "You passed an unsupported selector state to this method.\n\n",
|
|
176
|
+
"18": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
|
|
177
|
+
"19": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
|
|
178
|
+
"20": "expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
|
|
179
|
+
"21": "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
|
|
180
|
+
"22": "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
|
|
181
|
+
"23": "fontFace expects a name of a font-family.\n\n",
|
|
182
|
+
"24": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
|
|
183
|
+
"25": "fontFace expects localFonts to be an array.\n\n",
|
|
184
|
+
"26": "fontFace expects fileFormats to be an array.\n\n",
|
|
185
|
+
"27": "radialGradient requries at least 2 color-stops to properly render.\n\n",
|
|
186
|
+
"28": "Please supply a filename to retinaImage() as the first argument.\n\n",
|
|
187
|
+
"29": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
|
|
188
|
+
"30": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
|
|
189
|
+
"31": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",
|
|
190
|
+
"32": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",
|
|
191
|
+
"33": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",
|
|
192
|
+
"34": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
|
|
193
|
+
"35": "borderRadius expects one of \"top\", \"bottom\", \"left\" or \"right\" as the first argument.\n\n",
|
|
194
|
+
"36": "Property must be a string value.\n\n",
|
|
195
|
+
"37": "Syntax Error at %s.\n\n",
|
|
196
|
+
"38": "Formula contains a function that needs parentheses at %s.\n\n",
|
|
197
|
+
"39": "Formula is missing closing parenthesis at %s.\n\n",
|
|
198
|
+
"40": "Formula has too many closing parentheses at %s.\n\n",
|
|
199
|
+
"41": "All values in a formula must have the same unit or be unitless.\n\n",
|
|
200
|
+
"42": "Please provide a number of steps to the modularScale helper.\n\n",
|
|
201
|
+
"43": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
|
|
202
|
+
"44": "Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",
|
|
203
|
+
"45": "Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",
|
|
204
|
+
"46": "Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",
|
|
205
|
+
"47": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
|
|
206
|
+
"48": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
|
|
207
|
+
"49": "Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
|
|
208
|
+
"50": "Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",
|
|
209
|
+
"51": "Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",
|
|
210
|
+
"52": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
|
|
211
|
+
"53": "fontFace expects localFonts to be an array.\n\n",
|
|
212
|
+
"54": "fontFace expects fileFormats to be an array.\n\n",
|
|
213
|
+
"55": "fontFace expects a name of a font-family.\n\n",
|
|
214
|
+
"56": "linearGradient requries at least 2 color-stops to properly render.\n\n",
|
|
215
|
+
"57": "radialGradient requries at least 2 color-stops to properly render.\n\n",
|
|
216
|
+
"58": "Please supply a filename to retinaImage() as the first argument.\n\n",
|
|
217
|
+
"59": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
|
|
218
|
+
"60": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
|
|
219
|
+
"61": "Property must be a string value.\n\n",
|
|
220
|
+
"62": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
|
|
221
|
+
"63": "borderRadius expects one of \"top\", \"bottom\", \"left\" or \"right\" as the first argument.\n\n",
|
|
222
|
+
"64": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",
|
|
223
|
+
"65": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",
|
|
224
|
+
"66": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",
|
|
225
|
+
"67": "You must provide a template to this method.\n\n",
|
|
226
|
+
"68": "You passed an unsupported selector state to this method.\n\n",
|
|
227
|
+
"69": "Expected a string ending in \"px\" or a number passed as the first argument to %s(), got %s instead.\n\n",
|
|
228
|
+
"70": "Expected a string ending in \"px\" or a number passed as the second argument to %s(), got %s instead.\n\n",
|
|
229
|
+
"71": "Passed invalid pixel value %s to %s(), please pass a value like \"12px\" or 12.\n\n",
|
|
230
|
+
"72": "Passed invalid base value %s to %s(), please pass a value like \"12px\" or 12.\n\n",
|
|
231
|
+
"73": "Please provide a valid CSS variable.\n\n",
|
|
232
|
+
"74": "CSS variable not found and no default was provided.\n\n",
|
|
233
|
+
"75": "important requires a valid style object, got a %s instead.\n\n",
|
|
234
|
+
"76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",
|
|
235
|
+
"77": "remToPx expects a value in \"rem\" but you provided it in \"%s\".\n\n",
|
|
236
|
+
"78": "base must be set in \"px\" or \"%\" but you set it in \"%s\".\n"
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* super basic version of sprintf
|
|
240
|
+
* @private
|
|
241
|
+
*/
|
|
242
|
+
|
|
243
|
+
function format() {
|
|
244
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
245
|
+
args[_key] = arguments[_key];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
var a = args[0];
|
|
249
|
+
var b = [];
|
|
250
|
+
var c;
|
|
251
|
+
|
|
252
|
+
for (c = 1; c < args.length; c += 1) {
|
|
253
|
+
b.push(args[c]);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
b.forEach(function (d) {
|
|
257
|
+
a = a.replace(/%[a-z]/, d);
|
|
258
|
+
});
|
|
259
|
+
return a;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Create an error file out of errors.md for development and a simple web link to the full errors
|
|
263
|
+
* in production mode.
|
|
264
|
+
* @private
|
|
265
|
+
*/
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
var PolishedError = /*#__PURE__*/function (_Error) {
|
|
269
|
+
_inheritsLoose(PolishedError, _Error);
|
|
270
|
+
|
|
271
|
+
function PolishedError(code) {
|
|
272
|
+
var _this;
|
|
273
|
+
|
|
274
|
+
if (process.env.NODE_ENV === 'production') {
|
|
275
|
+
_this = _Error.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + code + " for more information.") || this;
|
|
276
|
+
} else {
|
|
277
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
278
|
+
args[_key2 - 1] = arguments[_key2];
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
_this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
return _assertThisInitialized(_this);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
return PolishedError;
|
|
288
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
289
|
+
|
|
290
|
+
function colorToInt(color) {
|
|
291
|
+
return Math.round(color * 255);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function convertToInt(red, green, blue) {
|
|
295
|
+
return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function hslToRgb(hue, saturation, lightness, convert) {
|
|
299
|
+
if (convert === void 0) {
|
|
300
|
+
convert = convertToInt;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (saturation === 0) {
|
|
304
|
+
// achromatic
|
|
305
|
+
return convert(lightness, lightness, lightness);
|
|
306
|
+
} // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
var huePrime = (hue % 360 + 360) % 360 / 60;
|
|
310
|
+
var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
|
|
311
|
+
var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
312
|
+
var red = 0;
|
|
313
|
+
var green = 0;
|
|
314
|
+
var blue = 0;
|
|
315
|
+
|
|
316
|
+
if (huePrime >= 0 && huePrime < 1) {
|
|
317
|
+
red = chroma;
|
|
318
|
+
green = secondComponent;
|
|
319
|
+
} else if (huePrime >= 1 && huePrime < 2) {
|
|
320
|
+
red = secondComponent;
|
|
321
|
+
green = chroma;
|
|
322
|
+
} else if (huePrime >= 2 && huePrime < 3) {
|
|
323
|
+
green = chroma;
|
|
324
|
+
blue = secondComponent;
|
|
325
|
+
} else if (huePrime >= 3 && huePrime < 4) {
|
|
326
|
+
green = secondComponent;
|
|
327
|
+
blue = chroma;
|
|
328
|
+
} else if (huePrime >= 4 && huePrime < 5) {
|
|
329
|
+
red = secondComponent;
|
|
330
|
+
blue = chroma;
|
|
331
|
+
} else if (huePrime >= 5 && huePrime < 6) {
|
|
332
|
+
red = chroma;
|
|
333
|
+
blue = secondComponent;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
var lightnessModification = lightness - chroma / 2;
|
|
337
|
+
var finalRed = red + lightnessModification;
|
|
338
|
+
var finalGreen = green + lightnessModification;
|
|
339
|
+
var finalBlue = blue + lightnessModification;
|
|
340
|
+
return convert(finalRed, finalGreen, finalBlue);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
var namedColorMap = {
|
|
344
|
+
aliceblue: 'f0f8ff',
|
|
345
|
+
antiquewhite: 'faebd7',
|
|
346
|
+
aqua: '00ffff',
|
|
347
|
+
aquamarine: '7fffd4',
|
|
348
|
+
azure: 'f0ffff',
|
|
349
|
+
beige: 'f5f5dc',
|
|
350
|
+
bisque: 'ffe4c4',
|
|
351
|
+
black: '000',
|
|
352
|
+
blanchedalmond: 'ffebcd',
|
|
353
|
+
blue: '0000ff',
|
|
354
|
+
blueviolet: '8a2be2',
|
|
355
|
+
brown: 'a52a2a',
|
|
356
|
+
burlywood: 'deb887',
|
|
357
|
+
cadetblue: '5f9ea0',
|
|
358
|
+
chartreuse: '7fff00',
|
|
359
|
+
chocolate: 'd2691e',
|
|
360
|
+
coral: 'ff7f50',
|
|
361
|
+
cornflowerblue: '6495ed',
|
|
362
|
+
cornsilk: 'fff8dc',
|
|
363
|
+
crimson: 'dc143c',
|
|
364
|
+
cyan: '00ffff',
|
|
365
|
+
darkblue: '00008b',
|
|
366
|
+
darkcyan: '008b8b',
|
|
367
|
+
darkgoldenrod: 'b8860b',
|
|
368
|
+
darkgray: 'a9a9a9',
|
|
369
|
+
darkgreen: '006400',
|
|
370
|
+
darkgrey: 'a9a9a9',
|
|
371
|
+
darkkhaki: 'bdb76b',
|
|
372
|
+
darkmagenta: '8b008b',
|
|
373
|
+
darkolivegreen: '556b2f',
|
|
374
|
+
darkorange: 'ff8c00',
|
|
375
|
+
darkorchid: '9932cc',
|
|
376
|
+
darkred: '8b0000',
|
|
377
|
+
darksalmon: 'e9967a',
|
|
378
|
+
darkseagreen: '8fbc8f',
|
|
379
|
+
darkslateblue: '483d8b',
|
|
380
|
+
darkslategray: '2f4f4f',
|
|
381
|
+
darkslategrey: '2f4f4f',
|
|
382
|
+
darkturquoise: '00ced1',
|
|
383
|
+
darkviolet: '9400d3',
|
|
384
|
+
deeppink: 'ff1493',
|
|
385
|
+
deepskyblue: '00bfff',
|
|
386
|
+
dimgray: '696969',
|
|
387
|
+
dimgrey: '696969',
|
|
388
|
+
dodgerblue: '1e90ff',
|
|
389
|
+
firebrick: 'b22222',
|
|
390
|
+
floralwhite: 'fffaf0',
|
|
391
|
+
forestgreen: '228b22',
|
|
392
|
+
fuchsia: 'ff00ff',
|
|
393
|
+
gainsboro: 'dcdcdc',
|
|
394
|
+
ghostwhite: 'f8f8ff',
|
|
395
|
+
gold: 'ffd700',
|
|
396
|
+
goldenrod: 'daa520',
|
|
397
|
+
gray: '808080',
|
|
398
|
+
green: '008000',
|
|
399
|
+
greenyellow: 'adff2f',
|
|
400
|
+
grey: '808080',
|
|
401
|
+
honeydew: 'f0fff0',
|
|
402
|
+
hotpink: 'ff69b4',
|
|
403
|
+
indianred: 'cd5c5c',
|
|
404
|
+
indigo: '4b0082',
|
|
405
|
+
ivory: 'fffff0',
|
|
406
|
+
khaki: 'f0e68c',
|
|
407
|
+
lavender: 'e6e6fa',
|
|
408
|
+
lavenderblush: 'fff0f5',
|
|
409
|
+
lawngreen: '7cfc00',
|
|
410
|
+
lemonchiffon: 'fffacd',
|
|
411
|
+
lightblue: 'add8e6',
|
|
412
|
+
lightcoral: 'f08080',
|
|
413
|
+
lightcyan: 'e0ffff',
|
|
414
|
+
lightgoldenrodyellow: 'fafad2',
|
|
415
|
+
lightgray: 'd3d3d3',
|
|
416
|
+
lightgreen: '90ee90',
|
|
417
|
+
lightgrey: 'd3d3d3',
|
|
418
|
+
lightpink: 'ffb6c1',
|
|
419
|
+
lightsalmon: 'ffa07a',
|
|
420
|
+
lightseagreen: '20b2aa',
|
|
421
|
+
lightskyblue: '87cefa',
|
|
422
|
+
lightslategray: '789',
|
|
423
|
+
lightslategrey: '789',
|
|
424
|
+
lightsteelblue: 'b0c4de',
|
|
425
|
+
lightyellow: 'ffffe0',
|
|
426
|
+
lime: '0f0',
|
|
427
|
+
limegreen: '32cd32',
|
|
428
|
+
linen: 'faf0e6',
|
|
429
|
+
magenta: 'f0f',
|
|
430
|
+
maroon: '800000',
|
|
431
|
+
mediumaquamarine: '66cdaa',
|
|
432
|
+
mediumblue: '0000cd',
|
|
433
|
+
mediumorchid: 'ba55d3',
|
|
434
|
+
mediumpurple: '9370db',
|
|
435
|
+
mediumseagreen: '3cb371',
|
|
436
|
+
mediumslateblue: '7b68ee',
|
|
437
|
+
mediumspringgreen: '00fa9a',
|
|
438
|
+
mediumturquoise: '48d1cc',
|
|
439
|
+
mediumvioletred: 'c71585',
|
|
440
|
+
midnightblue: '191970',
|
|
441
|
+
mintcream: 'f5fffa',
|
|
442
|
+
mistyrose: 'ffe4e1',
|
|
443
|
+
moccasin: 'ffe4b5',
|
|
444
|
+
navajowhite: 'ffdead',
|
|
445
|
+
navy: '000080',
|
|
446
|
+
oldlace: 'fdf5e6',
|
|
447
|
+
olive: '808000',
|
|
448
|
+
olivedrab: '6b8e23',
|
|
449
|
+
orange: 'ffa500',
|
|
450
|
+
orangered: 'ff4500',
|
|
451
|
+
orchid: 'da70d6',
|
|
452
|
+
palegoldenrod: 'eee8aa',
|
|
453
|
+
palegreen: '98fb98',
|
|
454
|
+
paleturquoise: 'afeeee',
|
|
455
|
+
palevioletred: 'db7093',
|
|
456
|
+
papayawhip: 'ffefd5',
|
|
457
|
+
peachpuff: 'ffdab9',
|
|
458
|
+
peru: 'cd853f',
|
|
459
|
+
pink: 'ffc0cb',
|
|
460
|
+
plum: 'dda0dd',
|
|
461
|
+
powderblue: 'b0e0e6',
|
|
462
|
+
purple: '800080',
|
|
463
|
+
rebeccapurple: '639',
|
|
464
|
+
red: 'f00',
|
|
465
|
+
rosybrown: 'bc8f8f',
|
|
466
|
+
royalblue: '4169e1',
|
|
467
|
+
saddlebrown: '8b4513',
|
|
468
|
+
salmon: 'fa8072',
|
|
469
|
+
sandybrown: 'f4a460',
|
|
470
|
+
seagreen: '2e8b57',
|
|
471
|
+
seashell: 'fff5ee',
|
|
472
|
+
sienna: 'a0522d',
|
|
473
|
+
silver: 'c0c0c0',
|
|
474
|
+
skyblue: '87ceeb',
|
|
475
|
+
slateblue: '6a5acd',
|
|
476
|
+
slategray: '708090',
|
|
477
|
+
slategrey: '708090',
|
|
478
|
+
snow: 'fffafa',
|
|
479
|
+
springgreen: '00ff7f',
|
|
480
|
+
steelblue: '4682b4',
|
|
481
|
+
tan: 'd2b48c',
|
|
482
|
+
teal: '008080',
|
|
483
|
+
thistle: 'd8bfd8',
|
|
484
|
+
tomato: 'ff6347',
|
|
485
|
+
turquoise: '40e0d0',
|
|
486
|
+
violet: 'ee82ee',
|
|
487
|
+
wheat: 'f5deb3',
|
|
488
|
+
white: 'fff',
|
|
489
|
+
whitesmoke: 'f5f5f5',
|
|
490
|
+
yellow: 'ff0',
|
|
491
|
+
yellowgreen: '9acd32'
|
|
492
|
+
};
|
|
493
|
+
/**
|
|
494
|
+
* Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.
|
|
495
|
+
* @private
|
|
496
|
+
*/
|
|
497
|
+
|
|
498
|
+
function nameToHex(color) {
|
|
499
|
+
if (typeof color !== 'string') return color;
|
|
500
|
+
var normalizedColorName = color.toLowerCase();
|
|
501
|
+
return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
var hexRegex = /^#[a-fA-F0-9]{6}$/;
|
|
505
|
+
var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/;
|
|
506
|
+
var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
|
|
507
|
+
var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/;
|
|
508
|
+
var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i;
|
|
509
|
+
var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
|
|
510
|
+
var hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i;
|
|
511
|
+
var hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
|
|
512
|
+
/**
|
|
513
|
+
* Returns an RgbColor or RgbaColor object. This utility function is only useful
|
|
514
|
+
* if want to extract a color component. With the color util `toColorString` you
|
|
515
|
+
* can convert a RgbColor or RgbaColor object back to a string.
|
|
516
|
+
*
|
|
517
|
+
* @example
|
|
518
|
+
* // Assigns `{ red: 255, green: 0, blue: 0 }` to color1
|
|
519
|
+
* const color1 = parseToRgb('rgb(255, 0, 0)');
|
|
520
|
+
* // Assigns `{ red: 92, green: 102, blue: 112, alpha: 0.75 }` to color2
|
|
521
|
+
* const color2 = parseToRgb('hsla(210, 10%, 40%, 0.75)');
|
|
522
|
+
*/
|
|
523
|
+
|
|
524
|
+
function parseToRgb(color) {
|
|
525
|
+
if (typeof color !== 'string') {
|
|
526
|
+
throw new PolishedError(3);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
var normalizedColor = nameToHex(color);
|
|
530
|
+
|
|
531
|
+
if (normalizedColor.match(hexRegex)) {
|
|
532
|
+
return {
|
|
533
|
+
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
|
|
534
|
+
green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
|
|
535
|
+
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
if (normalizedColor.match(hexRgbaRegex)) {
|
|
540
|
+
var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
|
|
541
|
+
return {
|
|
542
|
+
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
|
|
543
|
+
green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
|
|
544
|
+
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16),
|
|
545
|
+
alpha: alpha
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
if (normalizedColor.match(reducedHexRegex)) {
|
|
550
|
+
return {
|
|
551
|
+
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
552
|
+
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
|
|
553
|
+
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
if (normalizedColor.match(reducedRgbaHexRegex)) {
|
|
558
|
+
var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
|
|
559
|
+
|
|
560
|
+
return {
|
|
561
|
+
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
562
|
+
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
|
|
563
|
+
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16),
|
|
564
|
+
alpha: _alpha
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
var rgbMatched = rgbRegex.exec(normalizedColor);
|
|
569
|
+
|
|
570
|
+
if (rgbMatched) {
|
|
571
|
+
return {
|
|
572
|
+
red: parseInt("" + rgbMatched[1], 10),
|
|
573
|
+
green: parseInt("" + rgbMatched[2], 10),
|
|
574
|
+
blue: parseInt("" + rgbMatched[3], 10)
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
|
|
579
|
+
|
|
580
|
+
if (rgbaMatched) {
|
|
581
|
+
return {
|
|
582
|
+
red: parseInt("" + rgbaMatched[1], 10),
|
|
583
|
+
green: parseInt("" + rgbaMatched[2], 10),
|
|
584
|
+
blue: parseInt("" + rgbaMatched[3], 10),
|
|
585
|
+
alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
var hslMatched = hslRegex.exec(normalizedColor);
|
|
590
|
+
|
|
591
|
+
if (hslMatched) {
|
|
592
|
+
var hue = parseInt("" + hslMatched[1], 10);
|
|
593
|
+
var saturation = parseInt("" + hslMatched[2], 10) / 100;
|
|
594
|
+
var lightness = parseInt("" + hslMatched[3], 10) / 100;
|
|
595
|
+
var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
|
|
596
|
+
var hslRgbMatched = rgbRegex.exec(rgbColorString);
|
|
597
|
+
|
|
598
|
+
if (!hslRgbMatched) {
|
|
599
|
+
throw new PolishedError(4, normalizedColor, rgbColorString);
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
return {
|
|
603
|
+
red: parseInt("" + hslRgbMatched[1], 10),
|
|
604
|
+
green: parseInt("" + hslRgbMatched[2], 10),
|
|
605
|
+
blue: parseInt("" + hslRgbMatched[3], 10)
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
|
|
610
|
+
|
|
611
|
+
if (hslaMatched) {
|
|
612
|
+
var _hue = parseInt("" + hslaMatched[1], 10);
|
|
613
|
+
|
|
614
|
+
var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
|
|
615
|
+
|
|
616
|
+
var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
|
|
617
|
+
|
|
618
|
+
var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
|
|
619
|
+
|
|
620
|
+
var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
|
|
621
|
+
|
|
622
|
+
if (!_hslRgbMatched) {
|
|
623
|
+
throw new PolishedError(4, normalizedColor, _rgbColorString);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
return {
|
|
627
|
+
red: parseInt("" + _hslRgbMatched[1], 10),
|
|
628
|
+
green: parseInt("" + _hslRgbMatched[2], 10),
|
|
629
|
+
blue: parseInt("" + _hslRgbMatched[3], 10),
|
|
630
|
+
alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
throw new PolishedError(5);
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Reduces hex values if possible e.g. #ff8866 to #f86
|
|
639
|
+
* @private
|
|
640
|
+
*/
|
|
641
|
+
var reduceHexValue = function reduceHexValue(value) {
|
|
642
|
+
if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
|
|
643
|
+
return "#" + value[1] + value[3] + value[5];
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
return value;
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
var reduceHexValue$1 = reduceHexValue;
|
|
650
|
+
|
|
651
|
+
function numberToHex(value) {
|
|
652
|
+
var hex = value.toString(16);
|
|
653
|
+
return hex.length === 1 ? "0" + hex : hex;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Returns a string value for the color. The returned result is the smallest possible hex notation.
|
|
658
|
+
*
|
|
659
|
+
* @example
|
|
660
|
+
* // Styles as object usage
|
|
661
|
+
* const styles = {
|
|
662
|
+
* background: rgb(255, 205, 100),
|
|
663
|
+
* background: rgb({ red: 255, green: 205, blue: 100 }),
|
|
664
|
+
* }
|
|
665
|
+
*
|
|
666
|
+
* // styled-components usage
|
|
667
|
+
* const div = styled.div`
|
|
668
|
+
* background: ${rgb(255, 205, 100)};
|
|
669
|
+
* background: ${rgb({ red: 255, green: 205, blue: 100 })};
|
|
670
|
+
* `
|
|
671
|
+
*
|
|
672
|
+
* // CSS in JS Output
|
|
673
|
+
*
|
|
674
|
+
* element {
|
|
675
|
+
* background: "#ffcd64";
|
|
676
|
+
* background: "#ffcd64";
|
|
677
|
+
* }
|
|
678
|
+
*/
|
|
679
|
+
function rgb(value, green, blue) {
|
|
680
|
+
if (typeof value === 'number' && typeof green === 'number' && typeof blue === 'number') {
|
|
681
|
+
return reduceHexValue$1("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue));
|
|
682
|
+
} else if (typeof value === 'object' && green === undefined && blue === undefined) {
|
|
683
|
+
return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
throw new PolishedError(6);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Returns a string value for the color. The returned result is the smallest possible rgba or hex notation.
|
|
691
|
+
*
|
|
692
|
+
* Can also be used to fade a color by passing a hex value or named CSS color along with an alpha value.
|
|
693
|
+
*
|
|
694
|
+
* @example
|
|
695
|
+
* // Styles as object usage
|
|
696
|
+
* const styles = {
|
|
697
|
+
* background: rgba(255, 205, 100, 0.7),
|
|
698
|
+
* background: rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 }),
|
|
699
|
+
* background: rgba(255, 205, 100, 1),
|
|
700
|
+
* background: rgba('#ffffff', 0.4),
|
|
701
|
+
* background: rgba('black', 0.7),
|
|
702
|
+
* }
|
|
703
|
+
*
|
|
704
|
+
* // styled-components usage
|
|
705
|
+
* const div = styled.div`
|
|
706
|
+
* background: ${rgba(255, 205, 100, 0.7)};
|
|
707
|
+
* background: ${rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 })};
|
|
708
|
+
* background: ${rgba(255, 205, 100, 1)};
|
|
709
|
+
* background: ${rgba('#ffffff', 0.4)};
|
|
710
|
+
* background: ${rgba('black', 0.7)};
|
|
711
|
+
* `
|
|
712
|
+
*
|
|
713
|
+
* // CSS in JS Output
|
|
714
|
+
*
|
|
715
|
+
* element {
|
|
716
|
+
* background: "rgba(255,205,100,0.7)";
|
|
717
|
+
* background: "rgba(255,205,100,0.7)";
|
|
718
|
+
* background: "#ffcd64";
|
|
719
|
+
* background: "rgba(255,255,255,0.4)";
|
|
720
|
+
* background: "rgba(0,0,0,0.7)";
|
|
721
|
+
* }
|
|
722
|
+
*/
|
|
723
|
+
function rgba(firstValue, secondValue, thirdValue, fourthValue) {
|
|
724
|
+
if (typeof firstValue === 'string' && typeof secondValue === 'number') {
|
|
725
|
+
var rgbValue = parseToRgb(firstValue);
|
|
726
|
+
return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
|
|
727
|
+
} else if (typeof firstValue === 'number' && typeof secondValue === 'number' && typeof thirdValue === 'number' && typeof fourthValue === 'number') {
|
|
728
|
+
return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
|
|
729
|
+
} else if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
|
|
730
|
+
return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
throw new PolishedError(7);
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
// Type definitions taken from https://github.com/gcanti/flow-static-land/blob/master/src/Fun.js
|
|
737
|
+
// eslint-disable-next-line no-unused-vars
|
|
738
|
+
// eslint-disable-next-line no-unused-vars
|
|
739
|
+
// eslint-disable-next-line no-redeclare
|
|
740
|
+
function curried(f, length, acc) {
|
|
741
|
+
return function fn() {
|
|
742
|
+
// eslint-disable-next-line prefer-rest-params
|
|
743
|
+
var combined = acc.concat(Array.prototype.slice.call(arguments));
|
|
744
|
+
return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
|
|
745
|
+
};
|
|
746
|
+
} // eslint-disable-next-line no-redeclare
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
function curry(f) {
|
|
750
|
+
// eslint-disable-line no-redeclare
|
|
751
|
+
return curried(f, f.length, []);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* Mixes the two provided colors together by calculating the average of each of the RGB components weighted to the first color by the provided weight.
|
|
756
|
+
*
|
|
757
|
+
* @example
|
|
758
|
+
* // Styles as object usage
|
|
759
|
+
* const styles = {
|
|
760
|
+
* background: mix(0.5, '#f00', '#00f')
|
|
761
|
+
* background: mix(0.25, '#f00', '#00f')
|
|
762
|
+
* background: mix('0.5', 'rgba(255, 0, 0, 0.5)', '#00f')
|
|
763
|
+
* }
|
|
764
|
+
*
|
|
765
|
+
* // styled-components usage
|
|
766
|
+
* const div = styled.div`
|
|
767
|
+
* background: ${mix(0.5, '#f00', '#00f')};
|
|
768
|
+
* background: ${mix(0.25, '#f00', '#00f')};
|
|
769
|
+
* background: ${mix('0.5', 'rgba(255, 0, 0, 0.5)', '#00f')};
|
|
770
|
+
* `
|
|
771
|
+
*
|
|
772
|
+
* // CSS in JS Output
|
|
773
|
+
*
|
|
774
|
+
* element {
|
|
775
|
+
* background: "#7f007f";
|
|
776
|
+
* background: "#3f00bf";
|
|
777
|
+
* background: "rgba(63, 0, 191, 0.75)";
|
|
778
|
+
* }
|
|
779
|
+
*/
|
|
780
|
+
|
|
781
|
+
function mix(weight, color, otherColor) {
|
|
782
|
+
if (color === 'transparent') return otherColor;
|
|
783
|
+
if (otherColor === 'transparent') return color;
|
|
784
|
+
if (weight === 0) return otherColor;
|
|
785
|
+
var parsedColor1 = parseToRgb(color);
|
|
786
|
+
|
|
787
|
+
var color1 = _extends({}, parsedColor1, {
|
|
788
|
+
alpha: typeof parsedColor1.alpha === 'number' ? parsedColor1.alpha : 1
|
|
789
|
+
});
|
|
790
|
+
|
|
791
|
+
var parsedColor2 = parseToRgb(otherColor);
|
|
792
|
+
|
|
793
|
+
var color2 = _extends({}, parsedColor2, {
|
|
794
|
+
alpha: typeof parsedColor2.alpha === 'number' ? parsedColor2.alpha : 1
|
|
795
|
+
}); // The formula is copied from the original Sass implementation:
|
|
796
|
+
// http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
var alphaDelta = color1.alpha - color2.alpha;
|
|
800
|
+
var x = parseFloat(weight) * 2 - 1;
|
|
801
|
+
var y = x * alphaDelta === -1 ? x : x + alphaDelta;
|
|
802
|
+
var z = 1 + x * alphaDelta;
|
|
803
|
+
var weight1 = (y / z + 1) / 2.0;
|
|
804
|
+
var weight2 = 1 - weight1;
|
|
805
|
+
var mixedColor = {
|
|
806
|
+
red: Math.floor(color1.red * weight1 + color2.red * weight2),
|
|
807
|
+
green: Math.floor(color1.green * weight1 + color2.green * weight2),
|
|
808
|
+
blue: Math.floor(color1.blue * weight1 + color2.blue * weight2),
|
|
809
|
+
alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight))
|
|
810
|
+
};
|
|
811
|
+
return rgba(mixedColor);
|
|
812
|
+
} // prettier-ignore
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
var curriedMix = /*#__PURE__*/curry
|
|
816
|
+
/* ::<number | string, string, string, string> */
|
|
817
|
+
(mix);
|
|
818
|
+
var mix$1 = curriedMix;
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* Shades a color by mixing it with black. `shade` can produce
|
|
822
|
+
* hue shifts, where as `darken` manipulates the luminance channel and therefore
|
|
823
|
+
* doesn't produce hue shifts.
|
|
824
|
+
*
|
|
825
|
+
* @example
|
|
826
|
+
* // Styles as object usage
|
|
827
|
+
* const styles = {
|
|
828
|
+
* background: shade(0.25, '#00f')
|
|
829
|
+
* }
|
|
830
|
+
*
|
|
831
|
+
* // styled-components usage
|
|
832
|
+
* const div = styled.div`
|
|
833
|
+
* background: ${shade(0.25, '#00f')};
|
|
834
|
+
* `
|
|
835
|
+
*
|
|
836
|
+
* // CSS in JS Output
|
|
837
|
+
*
|
|
838
|
+
* element {
|
|
839
|
+
* background: "#00003f";
|
|
840
|
+
* }
|
|
841
|
+
*/
|
|
842
|
+
|
|
843
|
+
function shade(percentage, color) {
|
|
844
|
+
if (color === 'transparent') return color;
|
|
845
|
+
return mix$1(parseFloat(percentage), 'rgb(0, 0, 0)', color);
|
|
846
|
+
} // prettier-ignore
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
var curriedShade = /*#__PURE__*/curry
|
|
850
|
+
/* ::<number | string, string, string> */
|
|
851
|
+
(shade);
|
|
852
|
+
var curriedShade$1 = curriedShade;
|
|
853
|
+
|
|
41
854
|
const SPACING = 4;
|
|
42
855
|
const BLACK = 'rgba(0,0,0,.87)';
|
|
43
856
|
const WHITE = '#fff';
|
|
44
857
|
const darkenPalette = (amount, palette, colorsToDarken) => Object
|
|
45
858
|
.entries(palette)
|
|
46
859
|
.reduce((acc, [key, val]) => (Object.assign(Object.assign({}, acc), { [key]: colorsToDarken.includes(key)
|
|
47
|
-
?
|
|
860
|
+
? curriedShade$1(amount, val)
|
|
48
861
|
: val })), palette);
|
|
49
862
|
const createButtonPalette = (_a) => {
|
|
50
863
|
var { colorsToDarken } = _a, palette = __rest(_a, ["colorsToDarken"]);
|
|
@@ -203,6 +1016,26 @@ const UiWrapper = ({ theme, children }) => (React.createElement(UiProvider, { th
|
|
|
203
1016
|
React.createElement(UiStateProvider, null,
|
|
204
1017
|
React.createElement(Wrapper$d, null, children))));
|
|
205
1018
|
|
|
1019
|
+
function memoize(fn) {
|
|
1020
|
+
var cache = Object.create(null);
|
|
1021
|
+
return function (arg) {
|
|
1022
|
+
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
1023
|
+
return cache[arg];
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
|
1028
|
+
|
|
1029
|
+
var isPropValid = /* #__PURE__ */memoize(function (prop) {
|
|
1030
|
+
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|
|
1031
|
+
/* o */
|
|
1032
|
+
&& prop.charCodeAt(1) === 110
|
|
1033
|
+
/* n */
|
|
1034
|
+
&& prop.charCodeAt(2) < 91;
|
|
1035
|
+
}
|
|
1036
|
+
/* Z+1 */
|
|
1037
|
+
);
|
|
1038
|
+
|
|
206
1039
|
const slideInFromTop = styledComponents.keyframes `
|
|
207
1040
|
0% {
|
|
208
1041
|
opacity: 0;
|
|
@@ -1718,6 +2551,47 @@ const PasswordStrengthField = React.forwardRef((props, ref) => {
|
|
|
1718
2551
|
React.createElement(ProgressBar, { score: score })));
|
|
1719
2552
|
});
|
|
1720
2553
|
|
|
2554
|
+
function toVal(mix) {
|
|
2555
|
+
var k, y, str='';
|
|
2556
|
+
|
|
2557
|
+
if (typeof mix === 'string' || typeof mix === 'number') {
|
|
2558
|
+
str += mix;
|
|
2559
|
+
} else if (typeof mix === 'object') {
|
|
2560
|
+
if (Array.isArray(mix)) {
|
|
2561
|
+
for (k=0; k < mix.length; k++) {
|
|
2562
|
+
if (mix[k]) {
|
|
2563
|
+
if (y = toVal(mix[k])) {
|
|
2564
|
+
str && (str += ' ');
|
|
2565
|
+
str += y;
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
} else {
|
|
2570
|
+
for (k in mix) {
|
|
2571
|
+
if (mix[k]) {
|
|
2572
|
+
str && (str += ' ');
|
|
2573
|
+
str += k;
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
return str;
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
function clsx () {
|
|
2583
|
+
var i=0, tmp, x, str='';
|
|
2584
|
+
while (i < arguments.length) {
|
|
2585
|
+
if (tmp = arguments[i++]) {
|
|
2586
|
+
if (x = toVal(tmp)) {
|
|
2587
|
+
str && (str += ' ');
|
|
2588
|
+
str += x;
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2592
|
+
return str;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
1721
2595
|
const NUM_ROWS_PER_FIELD = 2;
|
|
1722
2596
|
// NOTE:
|
|
1723
2597
|
//
|
|
@@ -1895,21 +2769,505 @@ const FloatingPanelLayout = ({ panelProps, imageUrl, alert, logoUrl, backgroundB
|
|
|
1895
2769
|
alert && (React.createElement(Box, { pb: VerticalRhythmLaptop }, alert)),
|
|
1896
2770
|
React.createElement(StyledPanel, Object.assign({}, panelProps)))));
|
|
1897
2771
|
|
|
2772
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2773
|
+
|
|
2774
|
+
function getDefaultExportFromCjs (x) {
|
|
2775
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
2776
|
+
}
|
|
2777
|
+
|
|
1898
2778
|
/**
|
|
1899
|
-
*
|
|
1900
|
-
*
|
|
1901
|
-
*
|
|
1902
|
-
*
|
|
2779
|
+
* lodash (Custom Build) <https://lodash.com/>
|
|
2780
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
2781
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
2782
|
+
* Released under MIT license <https://lodash.com/license>
|
|
2783
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
2784
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
2785
|
+
*/
|
|
2786
|
+
|
|
2787
|
+
/** Used as references for various `Number` constants. */
|
|
2788
|
+
var INFINITY = 1 / 0,
|
|
2789
|
+
MAX_SAFE_INTEGER$1 = 9007199254740991,
|
|
2790
|
+
MAX_INTEGER = 1.7976931348623157e+308,
|
|
2791
|
+
NAN = 0 / 0;
|
|
2792
|
+
|
|
2793
|
+
/** `Object#toString` result references. */
|
|
2794
|
+
var funcTag$1 = '[object Function]',
|
|
2795
|
+
genTag$1 = '[object GeneratorFunction]',
|
|
2796
|
+
symbolTag = '[object Symbol]';
|
|
2797
|
+
|
|
2798
|
+
/** Used to match leading and trailing whitespace. */
|
|
2799
|
+
var reTrim = /^\s+|\s+$/g;
|
|
2800
|
+
|
|
2801
|
+
/** Used to detect bad signed hexadecimal string values. */
|
|
2802
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
2803
|
+
|
|
2804
|
+
/** Used to detect binary string values. */
|
|
2805
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
2806
|
+
|
|
2807
|
+
/** Used to detect octal string values. */
|
|
2808
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
2809
|
+
|
|
2810
|
+
/** Used to detect unsigned integer values. */
|
|
2811
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
2812
|
+
|
|
2813
|
+
/** Built-in method references without a dependency on `root`. */
|
|
2814
|
+
var freeParseInt = parseInt;
|
|
2815
|
+
|
|
2816
|
+
/** Used for built-in method references. */
|
|
2817
|
+
var objectProto$1 = Object.prototype;
|
|
2818
|
+
|
|
2819
|
+
/**
|
|
2820
|
+
* Used to resolve the
|
|
2821
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
2822
|
+
* of values.
|
|
2823
|
+
*/
|
|
2824
|
+
var objectToString$1 = objectProto$1.toString;
|
|
2825
|
+
|
|
2826
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
2827
|
+
var nativeCeil = Math.ceil,
|
|
2828
|
+
nativeMax$1 = Math.max;
|
|
2829
|
+
|
|
2830
|
+
/**
|
|
2831
|
+
* The base implementation of `_.slice` without an iteratee call guard.
|
|
1903
2832
|
*
|
|
1904
|
-
*
|
|
1905
|
-
*
|
|
1906
|
-
*
|
|
1907
|
-
*
|
|
1908
|
-
*
|
|
2833
|
+
* @private
|
|
2834
|
+
* @param {Array} array The array to slice.
|
|
2835
|
+
* @param {number} [start=0] The start position.
|
|
2836
|
+
* @param {number} [end=array.length] The end position.
|
|
2837
|
+
* @returns {Array} Returns the slice of `array`.
|
|
2838
|
+
*/
|
|
2839
|
+
function baseSlice(array, start, end) {
|
|
2840
|
+
var index = -1,
|
|
2841
|
+
length = array.length;
|
|
2842
|
+
|
|
2843
|
+
if (start < 0) {
|
|
2844
|
+
start = -start > length ? 0 : (length + start);
|
|
2845
|
+
}
|
|
2846
|
+
end = end > length ? length : end;
|
|
2847
|
+
if (end < 0) {
|
|
2848
|
+
end += length;
|
|
2849
|
+
}
|
|
2850
|
+
length = start > end ? 0 : ((end - start) >>> 0);
|
|
2851
|
+
start >>>= 0;
|
|
2852
|
+
|
|
2853
|
+
var result = Array(length);
|
|
2854
|
+
while (++index < length) {
|
|
2855
|
+
result[index] = array[index + start];
|
|
2856
|
+
}
|
|
2857
|
+
return result;
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2860
|
+
/**
|
|
2861
|
+
* Checks if `value` is a valid array-like index.
|
|
1909
2862
|
*
|
|
2863
|
+
* @private
|
|
2864
|
+
* @param {*} value The value to check.
|
|
2865
|
+
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
2866
|
+
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
1910
2867
|
*/
|
|
1911
|
-
|
|
1912
|
-
|
|
2868
|
+
function isIndex(value, length) {
|
|
2869
|
+
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
|
2870
|
+
return !!length &&
|
|
2871
|
+
(typeof value == 'number' || reIsUint.test(value)) &&
|
|
2872
|
+
(value > -1 && value % 1 == 0 && value < length);
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
/**
|
|
2876
|
+
* Checks if the given arguments are from an iteratee call.
|
|
2877
|
+
*
|
|
2878
|
+
* @private
|
|
2879
|
+
* @param {*} value The potential iteratee value argument.
|
|
2880
|
+
* @param {*} index The potential iteratee index or key argument.
|
|
2881
|
+
* @param {*} object The potential iteratee object argument.
|
|
2882
|
+
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
|
2883
|
+
* else `false`.
|
|
2884
|
+
*/
|
|
2885
|
+
function isIterateeCall(value, index, object) {
|
|
2886
|
+
if (!isObject$1(object)) {
|
|
2887
|
+
return false;
|
|
2888
|
+
}
|
|
2889
|
+
var type = typeof index;
|
|
2890
|
+
if (type == 'number'
|
|
2891
|
+
? (isArrayLike$1(object) && isIndex(index, object.length))
|
|
2892
|
+
: (type == 'string' && index in object)
|
|
2893
|
+
) {
|
|
2894
|
+
return eq$1(object[index], value);
|
|
2895
|
+
}
|
|
2896
|
+
return false;
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2899
|
+
/**
|
|
2900
|
+
* Creates an array of elements split into groups the length of `size`.
|
|
2901
|
+
* If `array` can't be split evenly, the final chunk will be the remaining
|
|
2902
|
+
* elements.
|
|
2903
|
+
*
|
|
2904
|
+
* @static
|
|
2905
|
+
* @memberOf _
|
|
2906
|
+
* @since 3.0.0
|
|
2907
|
+
* @category Array
|
|
2908
|
+
* @param {Array} array The array to process.
|
|
2909
|
+
* @param {number} [size=1] The length of each chunk
|
|
2910
|
+
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
|
2911
|
+
* @returns {Array} Returns the new array of chunks.
|
|
2912
|
+
* @example
|
|
2913
|
+
*
|
|
2914
|
+
* _.chunk(['a', 'b', 'c', 'd'], 2);
|
|
2915
|
+
* // => [['a', 'b'], ['c', 'd']]
|
|
2916
|
+
*
|
|
2917
|
+
* _.chunk(['a', 'b', 'c', 'd'], 3);
|
|
2918
|
+
* // => [['a', 'b', 'c'], ['d']]
|
|
2919
|
+
*/
|
|
2920
|
+
function chunk(array, size, guard) {
|
|
2921
|
+
if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
|
|
2922
|
+
size = 1;
|
|
2923
|
+
} else {
|
|
2924
|
+
size = nativeMax$1(toInteger(size), 0);
|
|
2925
|
+
}
|
|
2926
|
+
var length = array ? array.length : 0;
|
|
2927
|
+
if (!length || size < 1) {
|
|
2928
|
+
return [];
|
|
2929
|
+
}
|
|
2930
|
+
var index = 0,
|
|
2931
|
+
resIndex = 0,
|
|
2932
|
+
result = Array(nativeCeil(length / size));
|
|
2933
|
+
|
|
2934
|
+
while (index < length) {
|
|
2935
|
+
result[resIndex++] = baseSlice(array, index, (index += size));
|
|
2936
|
+
}
|
|
2937
|
+
return result;
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
/**
|
|
2941
|
+
* Performs a
|
|
2942
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
2943
|
+
* comparison between two values to determine if they are equivalent.
|
|
2944
|
+
*
|
|
2945
|
+
* @static
|
|
2946
|
+
* @memberOf _
|
|
2947
|
+
* @since 4.0.0
|
|
2948
|
+
* @category Lang
|
|
2949
|
+
* @param {*} value The value to compare.
|
|
2950
|
+
* @param {*} other The other value to compare.
|
|
2951
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
2952
|
+
* @example
|
|
2953
|
+
*
|
|
2954
|
+
* var object = { 'a': 1 };
|
|
2955
|
+
* var other = { 'a': 1 };
|
|
2956
|
+
*
|
|
2957
|
+
* _.eq(object, object);
|
|
2958
|
+
* // => true
|
|
2959
|
+
*
|
|
2960
|
+
* _.eq(object, other);
|
|
2961
|
+
* // => false
|
|
2962
|
+
*
|
|
2963
|
+
* _.eq('a', 'a');
|
|
2964
|
+
* // => true
|
|
2965
|
+
*
|
|
2966
|
+
* _.eq('a', Object('a'));
|
|
2967
|
+
* // => false
|
|
2968
|
+
*
|
|
2969
|
+
* _.eq(NaN, NaN);
|
|
2970
|
+
* // => true
|
|
2971
|
+
*/
|
|
2972
|
+
function eq$1(value, other) {
|
|
2973
|
+
return value === other || (value !== value && other !== other);
|
|
2974
|
+
}
|
|
2975
|
+
|
|
2976
|
+
/**
|
|
2977
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
2978
|
+
* not a function and has a `value.length` that's an integer greater than or
|
|
2979
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
2980
|
+
*
|
|
2981
|
+
* @static
|
|
2982
|
+
* @memberOf _
|
|
2983
|
+
* @since 4.0.0
|
|
2984
|
+
* @category Lang
|
|
2985
|
+
* @param {*} value The value to check.
|
|
2986
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
2987
|
+
* @example
|
|
2988
|
+
*
|
|
2989
|
+
* _.isArrayLike([1, 2, 3]);
|
|
2990
|
+
* // => true
|
|
2991
|
+
*
|
|
2992
|
+
* _.isArrayLike(document.body.children);
|
|
2993
|
+
* // => true
|
|
2994
|
+
*
|
|
2995
|
+
* _.isArrayLike('abc');
|
|
2996
|
+
* // => true
|
|
2997
|
+
*
|
|
2998
|
+
* _.isArrayLike(_.noop);
|
|
2999
|
+
* // => false
|
|
3000
|
+
*/
|
|
3001
|
+
function isArrayLike$1(value) {
|
|
3002
|
+
return value != null && isLength$1(value.length) && !isFunction$1(value);
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
/**
|
|
3006
|
+
* Checks if `value` is classified as a `Function` object.
|
|
3007
|
+
*
|
|
3008
|
+
* @static
|
|
3009
|
+
* @memberOf _
|
|
3010
|
+
* @since 0.1.0
|
|
3011
|
+
* @category Lang
|
|
3012
|
+
* @param {*} value The value to check.
|
|
3013
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
3014
|
+
* @example
|
|
3015
|
+
*
|
|
3016
|
+
* _.isFunction(_);
|
|
3017
|
+
* // => true
|
|
3018
|
+
*
|
|
3019
|
+
* _.isFunction(/abc/);
|
|
3020
|
+
* // => false
|
|
3021
|
+
*/
|
|
3022
|
+
function isFunction$1(value) {
|
|
3023
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
3024
|
+
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
|
3025
|
+
var tag = isObject$1(value) ? objectToString$1.call(value) : '';
|
|
3026
|
+
return tag == funcTag$1 || tag == genTag$1;
|
|
3027
|
+
}
|
|
3028
|
+
|
|
3029
|
+
/**
|
|
3030
|
+
* Checks if `value` is a valid array-like length.
|
|
3031
|
+
*
|
|
3032
|
+
* **Note:** This method is loosely based on
|
|
3033
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
3034
|
+
*
|
|
3035
|
+
* @static
|
|
3036
|
+
* @memberOf _
|
|
3037
|
+
* @since 4.0.0
|
|
3038
|
+
* @category Lang
|
|
3039
|
+
* @param {*} value The value to check.
|
|
3040
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
3041
|
+
* @example
|
|
3042
|
+
*
|
|
3043
|
+
* _.isLength(3);
|
|
3044
|
+
* // => true
|
|
3045
|
+
*
|
|
3046
|
+
* _.isLength(Number.MIN_VALUE);
|
|
3047
|
+
* // => false
|
|
3048
|
+
*
|
|
3049
|
+
* _.isLength(Infinity);
|
|
3050
|
+
* // => false
|
|
3051
|
+
*
|
|
3052
|
+
* _.isLength('3');
|
|
3053
|
+
* // => false
|
|
3054
|
+
*/
|
|
3055
|
+
function isLength$1(value) {
|
|
3056
|
+
return typeof value == 'number' &&
|
|
3057
|
+
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
|
|
3058
|
+
}
|
|
3059
|
+
|
|
3060
|
+
/**
|
|
3061
|
+
* Checks if `value` is the
|
|
3062
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
3063
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
3064
|
+
*
|
|
3065
|
+
* @static
|
|
3066
|
+
* @memberOf _
|
|
3067
|
+
* @since 0.1.0
|
|
3068
|
+
* @category Lang
|
|
3069
|
+
* @param {*} value The value to check.
|
|
3070
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
3071
|
+
* @example
|
|
3072
|
+
*
|
|
3073
|
+
* _.isObject({});
|
|
3074
|
+
* // => true
|
|
3075
|
+
*
|
|
3076
|
+
* _.isObject([1, 2, 3]);
|
|
3077
|
+
* // => true
|
|
3078
|
+
*
|
|
3079
|
+
* _.isObject(_.noop);
|
|
3080
|
+
* // => true
|
|
3081
|
+
*
|
|
3082
|
+
* _.isObject(null);
|
|
3083
|
+
* // => false
|
|
3084
|
+
*/
|
|
3085
|
+
function isObject$1(value) {
|
|
3086
|
+
var type = typeof value;
|
|
3087
|
+
return !!value && (type == 'object' || type == 'function');
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3090
|
+
/**
|
|
3091
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
3092
|
+
* and has a `typeof` result of "object".
|
|
3093
|
+
*
|
|
3094
|
+
* @static
|
|
3095
|
+
* @memberOf _
|
|
3096
|
+
* @since 4.0.0
|
|
3097
|
+
* @category Lang
|
|
3098
|
+
* @param {*} value The value to check.
|
|
3099
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
3100
|
+
* @example
|
|
3101
|
+
*
|
|
3102
|
+
* _.isObjectLike({});
|
|
3103
|
+
* // => true
|
|
3104
|
+
*
|
|
3105
|
+
* _.isObjectLike([1, 2, 3]);
|
|
3106
|
+
* // => true
|
|
3107
|
+
*
|
|
3108
|
+
* _.isObjectLike(_.noop);
|
|
3109
|
+
* // => false
|
|
3110
|
+
*
|
|
3111
|
+
* _.isObjectLike(null);
|
|
3112
|
+
* // => false
|
|
3113
|
+
*/
|
|
3114
|
+
function isObjectLike$1(value) {
|
|
3115
|
+
return !!value && typeof value == 'object';
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
/**
|
|
3119
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
3120
|
+
*
|
|
3121
|
+
* @static
|
|
3122
|
+
* @memberOf _
|
|
3123
|
+
* @since 4.0.0
|
|
3124
|
+
* @category Lang
|
|
3125
|
+
* @param {*} value The value to check.
|
|
3126
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
3127
|
+
* @example
|
|
3128
|
+
*
|
|
3129
|
+
* _.isSymbol(Symbol.iterator);
|
|
3130
|
+
* // => true
|
|
3131
|
+
*
|
|
3132
|
+
* _.isSymbol('abc');
|
|
3133
|
+
* // => false
|
|
3134
|
+
*/
|
|
3135
|
+
function isSymbol(value) {
|
|
3136
|
+
return typeof value == 'symbol' ||
|
|
3137
|
+
(isObjectLike$1(value) && objectToString$1.call(value) == symbolTag);
|
|
3138
|
+
}
|
|
3139
|
+
|
|
3140
|
+
/**
|
|
3141
|
+
* Converts `value` to a finite number.
|
|
3142
|
+
*
|
|
3143
|
+
* @static
|
|
3144
|
+
* @memberOf _
|
|
3145
|
+
* @since 4.12.0
|
|
3146
|
+
* @category Lang
|
|
3147
|
+
* @param {*} value The value to convert.
|
|
3148
|
+
* @returns {number} Returns the converted number.
|
|
3149
|
+
* @example
|
|
3150
|
+
*
|
|
3151
|
+
* _.toFinite(3.2);
|
|
3152
|
+
* // => 3.2
|
|
3153
|
+
*
|
|
3154
|
+
* _.toFinite(Number.MIN_VALUE);
|
|
3155
|
+
* // => 5e-324
|
|
3156
|
+
*
|
|
3157
|
+
* _.toFinite(Infinity);
|
|
3158
|
+
* // => 1.7976931348623157e+308
|
|
3159
|
+
*
|
|
3160
|
+
* _.toFinite('3.2');
|
|
3161
|
+
* // => 3.2
|
|
3162
|
+
*/
|
|
3163
|
+
function toFinite(value) {
|
|
3164
|
+
if (!value) {
|
|
3165
|
+
return value === 0 ? value : 0;
|
|
3166
|
+
}
|
|
3167
|
+
value = toNumber(value);
|
|
3168
|
+
if (value === INFINITY || value === -INFINITY) {
|
|
3169
|
+
var sign = (value < 0 ? -1 : 1);
|
|
3170
|
+
return sign * MAX_INTEGER;
|
|
3171
|
+
}
|
|
3172
|
+
return value === value ? value : 0;
|
|
3173
|
+
}
|
|
3174
|
+
|
|
3175
|
+
/**
|
|
3176
|
+
* Converts `value` to an integer.
|
|
3177
|
+
*
|
|
3178
|
+
* **Note:** This method is loosely based on
|
|
3179
|
+
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
|
|
3180
|
+
*
|
|
3181
|
+
* @static
|
|
3182
|
+
* @memberOf _
|
|
3183
|
+
* @since 4.0.0
|
|
3184
|
+
* @category Lang
|
|
3185
|
+
* @param {*} value The value to convert.
|
|
3186
|
+
* @returns {number} Returns the converted integer.
|
|
3187
|
+
* @example
|
|
3188
|
+
*
|
|
3189
|
+
* _.toInteger(3.2);
|
|
3190
|
+
* // => 3
|
|
3191
|
+
*
|
|
3192
|
+
* _.toInteger(Number.MIN_VALUE);
|
|
3193
|
+
* // => 0
|
|
3194
|
+
*
|
|
3195
|
+
* _.toInteger(Infinity);
|
|
3196
|
+
* // => 1.7976931348623157e+308
|
|
3197
|
+
*
|
|
3198
|
+
* _.toInteger('3.2');
|
|
3199
|
+
* // => 3
|
|
3200
|
+
*/
|
|
3201
|
+
function toInteger(value) {
|
|
3202
|
+
var result = toFinite(value),
|
|
3203
|
+
remainder = result % 1;
|
|
3204
|
+
|
|
3205
|
+
return result === result ? (remainder ? result - remainder : result) : 0;
|
|
3206
|
+
}
|
|
3207
|
+
|
|
3208
|
+
/**
|
|
3209
|
+
* Converts `value` to a number.
|
|
3210
|
+
*
|
|
3211
|
+
* @static
|
|
3212
|
+
* @memberOf _
|
|
3213
|
+
* @since 4.0.0
|
|
3214
|
+
* @category Lang
|
|
3215
|
+
* @param {*} value The value to process.
|
|
3216
|
+
* @returns {number} Returns the number.
|
|
3217
|
+
* @example
|
|
3218
|
+
*
|
|
3219
|
+
* _.toNumber(3.2);
|
|
3220
|
+
* // => 3.2
|
|
3221
|
+
*
|
|
3222
|
+
* _.toNumber(Number.MIN_VALUE);
|
|
3223
|
+
* // => 5e-324
|
|
3224
|
+
*
|
|
3225
|
+
* _.toNumber(Infinity);
|
|
3226
|
+
* // => Infinity
|
|
3227
|
+
*
|
|
3228
|
+
* _.toNumber('3.2');
|
|
3229
|
+
* // => 3.2
|
|
3230
|
+
*/
|
|
3231
|
+
function toNumber(value) {
|
|
3232
|
+
if (typeof value == 'number') {
|
|
3233
|
+
return value;
|
|
3234
|
+
}
|
|
3235
|
+
if (isSymbol(value)) {
|
|
3236
|
+
return NAN;
|
|
3237
|
+
}
|
|
3238
|
+
if (isObject$1(value)) {
|
|
3239
|
+
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
|
3240
|
+
value = isObject$1(other) ? (other + '') : other;
|
|
3241
|
+
}
|
|
3242
|
+
if (typeof value != 'string') {
|
|
3243
|
+
return value === 0 ? value : +value;
|
|
3244
|
+
}
|
|
3245
|
+
value = value.replace(reTrim, '');
|
|
3246
|
+
var isBinary = reIsBinary.test(value);
|
|
3247
|
+
return (isBinary || reIsOctal.test(value))
|
|
3248
|
+
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
|
3249
|
+
: (reIsBadHex.test(value) ? NAN : +value);
|
|
3250
|
+
}
|
|
3251
|
+
|
|
3252
|
+
var lodash_chunk = chunk;
|
|
3253
|
+
|
|
3254
|
+
var _chunk = /*@__PURE__*/getDefaultExportFromCjs(lodash_chunk);
|
|
3255
|
+
|
|
3256
|
+
/**
|
|
3257
|
+
* Two dimensional array grid.
|
|
3258
|
+
* Useful to position elements with.
|
|
3259
|
+
*
|
|
3260
|
+
* Example:
|
|
3261
|
+
*
|
|
3262
|
+
* new Grid([
|
|
3263
|
+
* [1,2,3],
|
|
3264
|
+
* [4,5,6],
|
|
3265
|
+
* [7,8,9]
|
|
3266
|
+
* ])
|
|
3267
|
+
*
|
|
3268
|
+
*/
|
|
3269
|
+
class Grid {
|
|
3270
|
+
constructor(grid) {
|
|
1913
3271
|
this.grid = grid;
|
|
1914
3272
|
}
|
|
1915
3273
|
getValues() {
|
|
@@ -1955,6 +3313,1179 @@ class Grid {
|
|
|
1955
3313
|
}
|
|
1956
3314
|
}
|
|
1957
3315
|
|
|
3316
|
+
/**
|
|
3317
|
+
* lodash (Custom Build) <https://lodash.com/>
|
|
3318
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
3319
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
3320
|
+
* Released under MIT license <https://lodash.com/license>
|
|
3321
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
3322
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
3323
|
+
*/
|
|
3324
|
+
|
|
3325
|
+
/** Used as the size to enable large array optimizations. */
|
|
3326
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
3327
|
+
|
|
3328
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
3329
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
3330
|
+
|
|
3331
|
+
/** Used as references for various `Number` constants. */
|
|
3332
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
3333
|
+
|
|
3334
|
+
/** `Object#toString` result references. */
|
|
3335
|
+
var argsTag = '[object Arguments]',
|
|
3336
|
+
funcTag = '[object Function]',
|
|
3337
|
+
genTag = '[object GeneratorFunction]';
|
|
3338
|
+
|
|
3339
|
+
/**
|
|
3340
|
+
* Used to match `RegExp`
|
|
3341
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
3342
|
+
*/
|
|
3343
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
3344
|
+
|
|
3345
|
+
/** Used to detect host constructors (Safari). */
|
|
3346
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
3347
|
+
|
|
3348
|
+
/** Detect free variable `global` from Node.js. */
|
|
3349
|
+
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
3350
|
+
|
|
3351
|
+
/** Detect free variable `self`. */
|
|
3352
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
3353
|
+
|
|
3354
|
+
/** Used as a reference to the global object. */
|
|
3355
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
3356
|
+
|
|
3357
|
+
/**
|
|
3358
|
+
* A faster alternative to `Function#apply`, this function invokes `func`
|
|
3359
|
+
* with the `this` binding of `thisArg` and the arguments of `args`.
|
|
3360
|
+
*
|
|
3361
|
+
* @private
|
|
3362
|
+
* @param {Function} func The function to invoke.
|
|
3363
|
+
* @param {*} thisArg The `this` binding of `func`.
|
|
3364
|
+
* @param {Array} args The arguments to invoke `func` with.
|
|
3365
|
+
* @returns {*} Returns the result of `func`.
|
|
3366
|
+
*/
|
|
3367
|
+
function apply(func, thisArg, args) {
|
|
3368
|
+
switch (args.length) {
|
|
3369
|
+
case 0: return func.call(thisArg);
|
|
3370
|
+
case 1: return func.call(thisArg, args[0]);
|
|
3371
|
+
case 2: return func.call(thisArg, args[0], args[1]);
|
|
3372
|
+
case 3: return func.call(thisArg, args[0], args[1], args[2]);
|
|
3373
|
+
}
|
|
3374
|
+
return func.apply(thisArg, args);
|
|
3375
|
+
}
|
|
3376
|
+
|
|
3377
|
+
/**
|
|
3378
|
+
* A specialized version of `_.includes` for arrays without support for
|
|
3379
|
+
* specifying an index to search from.
|
|
3380
|
+
*
|
|
3381
|
+
* @private
|
|
3382
|
+
* @param {Array} [array] The array to inspect.
|
|
3383
|
+
* @param {*} target The value to search for.
|
|
3384
|
+
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
3385
|
+
*/
|
|
3386
|
+
function arrayIncludes(array, value) {
|
|
3387
|
+
var length = array ? array.length : 0;
|
|
3388
|
+
return !!length && baseIndexOf(array, value, 0) > -1;
|
|
3389
|
+
}
|
|
3390
|
+
|
|
3391
|
+
/**
|
|
3392
|
+
* This function is like `arrayIncludes` except that it accepts a comparator.
|
|
3393
|
+
*
|
|
3394
|
+
* @private
|
|
3395
|
+
* @param {Array} [array] The array to inspect.
|
|
3396
|
+
* @param {*} target The value to search for.
|
|
3397
|
+
* @param {Function} comparator The comparator invoked per element.
|
|
3398
|
+
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
3399
|
+
*/
|
|
3400
|
+
function arrayIncludesWith(array, value, comparator) {
|
|
3401
|
+
var index = -1,
|
|
3402
|
+
length = array ? array.length : 0;
|
|
3403
|
+
|
|
3404
|
+
while (++index < length) {
|
|
3405
|
+
if (comparator(value, array[index])) {
|
|
3406
|
+
return true;
|
|
3407
|
+
}
|
|
3408
|
+
}
|
|
3409
|
+
return false;
|
|
3410
|
+
}
|
|
3411
|
+
|
|
3412
|
+
/**
|
|
3413
|
+
* A specialized version of `_.map` for arrays without support for iteratee
|
|
3414
|
+
* shorthands.
|
|
3415
|
+
*
|
|
3416
|
+
* @private
|
|
3417
|
+
* @param {Array} [array] The array to iterate over.
|
|
3418
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
3419
|
+
* @returns {Array} Returns the new mapped array.
|
|
3420
|
+
*/
|
|
3421
|
+
function arrayMap(array, iteratee) {
|
|
3422
|
+
var index = -1,
|
|
3423
|
+
length = array ? array.length : 0,
|
|
3424
|
+
result = Array(length);
|
|
3425
|
+
|
|
3426
|
+
while (++index < length) {
|
|
3427
|
+
result[index] = iteratee(array[index], index, array);
|
|
3428
|
+
}
|
|
3429
|
+
return result;
|
|
3430
|
+
}
|
|
3431
|
+
|
|
3432
|
+
/**
|
|
3433
|
+
* Appends the elements of `values` to `array`.
|
|
3434
|
+
*
|
|
3435
|
+
* @private
|
|
3436
|
+
* @param {Array} array The array to modify.
|
|
3437
|
+
* @param {Array} values The values to append.
|
|
3438
|
+
* @returns {Array} Returns `array`.
|
|
3439
|
+
*/
|
|
3440
|
+
function arrayPush(array, values) {
|
|
3441
|
+
var index = -1,
|
|
3442
|
+
length = values.length,
|
|
3443
|
+
offset = array.length;
|
|
3444
|
+
|
|
3445
|
+
while (++index < length) {
|
|
3446
|
+
array[offset + index] = values[index];
|
|
3447
|
+
}
|
|
3448
|
+
return array;
|
|
3449
|
+
}
|
|
3450
|
+
|
|
3451
|
+
/**
|
|
3452
|
+
* The base implementation of `_.findIndex` and `_.findLastIndex` without
|
|
3453
|
+
* support for iteratee shorthands.
|
|
3454
|
+
*
|
|
3455
|
+
* @private
|
|
3456
|
+
* @param {Array} array The array to inspect.
|
|
3457
|
+
* @param {Function} predicate The function invoked per iteration.
|
|
3458
|
+
* @param {number} fromIndex The index to search from.
|
|
3459
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
3460
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
3461
|
+
*/
|
|
3462
|
+
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
3463
|
+
var length = array.length,
|
|
3464
|
+
index = fromIndex + (fromRight ? 1 : -1);
|
|
3465
|
+
|
|
3466
|
+
while ((fromRight ? index-- : ++index < length)) {
|
|
3467
|
+
if (predicate(array[index], index, array)) {
|
|
3468
|
+
return index;
|
|
3469
|
+
}
|
|
3470
|
+
}
|
|
3471
|
+
return -1;
|
|
3472
|
+
}
|
|
3473
|
+
|
|
3474
|
+
/**
|
|
3475
|
+
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
|
3476
|
+
*
|
|
3477
|
+
* @private
|
|
3478
|
+
* @param {Array} array The array to inspect.
|
|
3479
|
+
* @param {*} value The value to search for.
|
|
3480
|
+
* @param {number} fromIndex The index to search from.
|
|
3481
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
3482
|
+
*/
|
|
3483
|
+
function baseIndexOf(array, value, fromIndex) {
|
|
3484
|
+
if (value !== value) {
|
|
3485
|
+
return baseFindIndex(array, baseIsNaN, fromIndex);
|
|
3486
|
+
}
|
|
3487
|
+
var index = fromIndex - 1,
|
|
3488
|
+
length = array.length;
|
|
3489
|
+
|
|
3490
|
+
while (++index < length) {
|
|
3491
|
+
if (array[index] === value) {
|
|
3492
|
+
return index;
|
|
3493
|
+
}
|
|
3494
|
+
}
|
|
3495
|
+
return -1;
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
/**
|
|
3499
|
+
* The base implementation of `_.isNaN` without support for number objects.
|
|
3500
|
+
*
|
|
3501
|
+
* @private
|
|
3502
|
+
* @param {*} value The value to check.
|
|
3503
|
+
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
|
|
3504
|
+
*/
|
|
3505
|
+
function baseIsNaN(value) {
|
|
3506
|
+
return value !== value;
|
|
3507
|
+
}
|
|
3508
|
+
|
|
3509
|
+
/**
|
|
3510
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
|
3511
|
+
*
|
|
3512
|
+
* @private
|
|
3513
|
+
* @param {Function} func The function to cap arguments for.
|
|
3514
|
+
* @returns {Function} Returns the new capped function.
|
|
3515
|
+
*/
|
|
3516
|
+
function baseUnary(func) {
|
|
3517
|
+
return function(value) {
|
|
3518
|
+
return func(value);
|
|
3519
|
+
};
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
/**
|
|
3523
|
+
* Checks if a cache value for `key` exists.
|
|
3524
|
+
*
|
|
3525
|
+
* @private
|
|
3526
|
+
* @param {Object} cache The cache to query.
|
|
3527
|
+
* @param {string} key The key of the entry to check.
|
|
3528
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
3529
|
+
*/
|
|
3530
|
+
function cacheHas(cache, key) {
|
|
3531
|
+
return cache.has(key);
|
|
3532
|
+
}
|
|
3533
|
+
|
|
3534
|
+
/**
|
|
3535
|
+
* Gets the value at `key` of `object`.
|
|
3536
|
+
*
|
|
3537
|
+
* @private
|
|
3538
|
+
* @param {Object} [object] The object to query.
|
|
3539
|
+
* @param {string} key The key of the property to get.
|
|
3540
|
+
* @returns {*} Returns the property value.
|
|
3541
|
+
*/
|
|
3542
|
+
function getValue(object, key) {
|
|
3543
|
+
return object == null ? undefined : object[key];
|
|
3544
|
+
}
|
|
3545
|
+
|
|
3546
|
+
/**
|
|
3547
|
+
* Checks if `value` is a host object in IE < 9.
|
|
3548
|
+
*
|
|
3549
|
+
* @private
|
|
3550
|
+
* @param {*} value The value to check.
|
|
3551
|
+
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
|
3552
|
+
*/
|
|
3553
|
+
function isHostObject(value) {
|
|
3554
|
+
// Many host objects are `Object` objects that can coerce to strings
|
|
3555
|
+
// despite having improperly defined `toString` methods.
|
|
3556
|
+
var result = false;
|
|
3557
|
+
if (value != null && typeof value.toString != 'function') {
|
|
3558
|
+
try {
|
|
3559
|
+
result = !!(value + '');
|
|
3560
|
+
} catch (e) {}
|
|
3561
|
+
}
|
|
3562
|
+
return result;
|
|
3563
|
+
}
|
|
3564
|
+
|
|
3565
|
+
/** Used for built-in method references. */
|
|
3566
|
+
var arrayProto = Array.prototype,
|
|
3567
|
+
funcProto = Function.prototype,
|
|
3568
|
+
objectProto = Object.prototype;
|
|
3569
|
+
|
|
3570
|
+
/** Used to detect overreaching core-js shims. */
|
|
3571
|
+
var coreJsData = root['__core-js_shared__'];
|
|
3572
|
+
|
|
3573
|
+
/** Used to detect methods masquerading as native. */
|
|
3574
|
+
var maskSrcKey = (function() {
|
|
3575
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
3576
|
+
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
3577
|
+
}());
|
|
3578
|
+
|
|
3579
|
+
/** Used to resolve the decompiled source of functions. */
|
|
3580
|
+
var funcToString = funcProto.toString;
|
|
3581
|
+
|
|
3582
|
+
/** Used to check objects for own properties. */
|
|
3583
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
3584
|
+
|
|
3585
|
+
/**
|
|
3586
|
+
* Used to resolve the
|
|
3587
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
3588
|
+
* of values.
|
|
3589
|
+
*/
|
|
3590
|
+
var objectToString = objectProto.toString;
|
|
3591
|
+
|
|
3592
|
+
/** Used to detect if a method is native. */
|
|
3593
|
+
var reIsNative = RegExp('^' +
|
|
3594
|
+
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
|
3595
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
3596
|
+
);
|
|
3597
|
+
|
|
3598
|
+
/** Built-in value references. */
|
|
3599
|
+
var Symbol = root.Symbol,
|
|
3600
|
+
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
|
3601
|
+
splice = arrayProto.splice,
|
|
3602
|
+
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
|
|
3603
|
+
|
|
3604
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
3605
|
+
var nativeMax = Math.max;
|
|
3606
|
+
|
|
3607
|
+
/* Built-in method references that are verified to be native. */
|
|
3608
|
+
var Map$1 = getNative(root, 'Map'),
|
|
3609
|
+
nativeCreate = getNative(Object, 'create');
|
|
3610
|
+
|
|
3611
|
+
/**
|
|
3612
|
+
* Creates a hash object.
|
|
3613
|
+
*
|
|
3614
|
+
* @private
|
|
3615
|
+
* @constructor
|
|
3616
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
3617
|
+
*/
|
|
3618
|
+
function Hash(entries) {
|
|
3619
|
+
var index = -1,
|
|
3620
|
+
length = entries ? entries.length : 0;
|
|
3621
|
+
|
|
3622
|
+
this.clear();
|
|
3623
|
+
while (++index < length) {
|
|
3624
|
+
var entry = entries[index];
|
|
3625
|
+
this.set(entry[0], entry[1]);
|
|
3626
|
+
}
|
|
3627
|
+
}
|
|
3628
|
+
|
|
3629
|
+
/**
|
|
3630
|
+
* Removes all key-value entries from the hash.
|
|
3631
|
+
*
|
|
3632
|
+
* @private
|
|
3633
|
+
* @name clear
|
|
3634
|
+
* @memberOf Hash
|
|
3635
|
+
*/
|
|
3636
|
+
function hashClear() {
|
|
3637
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3640
|
+
/**
|
|
3641
|
+
* Removes `key` and its value from the hash.
|
|
3642
|
+
*
|
|
3643
|
+
* @private
|
|
3644
|
+
* @name delete
|
|
3645
|
+
* @memberOf Hash
|
|
3646
|
+
* @param {Object} hash The hash to modify.
|
|
3647
|
+
* @param {string} key The key of the value to remove.
|
|
3648
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
3649
|
+
*/
|
|
3650
|
+
function hashDelete(key) {
|
|
3651
|
+
return this.has(key) && delete this.__data__[key];
|
|
3652
|
+
}
|
|
3653
|
+
|
|
3654
|
+
/**
|
|
3655
|
+
* Gets the hash value for `key`.
|
|
3656
|
+
*
|
|
3657
|
+
* @private
|
|
3658
|
+
* @name get
|
|
3659
|
+
* @memberOf Hash
|
|
3660
|
+
* @param {string} key The key of the value to get.
|
|
3661
|
+
* @returns {*} Returns the entry value.
|
|
3662
|
+
*/
|
|
3663
|
+
function hashGet(key) {
|
|
3664
|
+
var data = this.__data__;
|
|
3665
|
+
if (nativeCreate) {
|
|
3666
|
+
var result = data[key];
|
|
3667
|
+
return result === HASH_UNDEFINED ? undefined : result;
|
|
3668
|
+
}
|
|
3669
|
+
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
|
3670
|
+
}
|
|
3671
|
+
|
|
3672
|
+
/**
|
|
3673
|
+
* Checks if a hash value for `key` exists.
|
|
3674
|
+
*
|
|
3675
|
+
* @private
|
|
3676
|
+
* @name has
|
|
3677
|
+
* @memberOf Hash
|
|
3678
|
+
* @param {string} key The key of the entry to check.
|
|
3679
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
3680
|
+
*/
|
|
3681
|
+
function hashHas(key) {
|
|
3682
|
+
var data = this.__data__;
|
|
3683
|
+
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
|
|
3684
|
+
}
|
|
3685
|
+
|
|
3686
|
+
/**
|
|
3687
|
+
* Sets the hash `key` to `value`.
|
|
3688
|
+
*
|
|
3689
|
+
* @private
|
|
3690
|
+
* @name set
|
|
3691
|
+
* @memberOf Hash
|
|
3692
|
+
* @param {string} key The key of the value to set.
|
|
3693
|
+
* @param {*} value The value to set.
|
|
3694
|
+
* @returns {Object} Returns the hash instance.
|
|
3695
|
+
*/
|
|
3696
|
+
function hashSet(key, value) {
|
|
3697
|
+
var data = this.__data__;
|
|
3698
|
+
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
3699
|
+
return this;
|
|
3700
|
+
}
|
|
3701
|
+
|
|
3702
|
+
// Add methods to `Hash`.
|
|
3703
|
+
Hash.prototype.clear = hashClear;
|
|
3704
|
+
Hash.prototype['delete'] = hashDelete;
|
|
3705
|
+
Hash.prototype.get = hashGet;
|
|
3706
|
+
Hash.prototype.has = hashHas;
|
|
3707
|
+
Hash.prototype.set = hashSet;
|
|
3708
|
+
|
|
3709
|
+
/**
|
|
3710
|
+
* Creates an list cache object.
|
|
3711
|
+
*
|
|
3712
|
+
* @private
|
|
3713
|
+
* @constructor
|
|
3714
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
3715
|
+
*/
|
|
3716
|
+
function ListCache(entries) {
|
|
3717
|
+
var index = -1,
|
|
3718
|
+
length = entries ? entries.length : 0;
|
|
3719
|
+
|
|
3720
|
+
this.clear();
|
|
3721
|
+
while (++index < length) {
|
|
3722
|
+
var entry = entries[index];
|
|
3723
|
+
this.set(entry[0], entry[1]);
|
|
3724
|
+
}
|
|
3725
|
+
}
|
|
3726
|
+
|
|
3727
|
+
/**
|
|
3728
|
+
* Removes all key-value entries from the list cache.
|
|
3729
|
+
*
|
|
3730
|
+
* @private
|
|
3731
|
+
* @name clear
|
|
3732
|
+
* @memberOf ListCache
|
|
3733
|
+
*/
|
|
3734
|
+
function listCacheClear() {
|
|
3735
|
+
this.__data__ = [];
|
|
3736
|
+
}
|
|
3737
|
+
|
|
3738
|
+
/**
|
|
3739
|
+
* Removes `key` and its value from the list cache.
|
|
3740
|
+
*
|
|
3741
|
+
* @private
|
|
3742
|
+
* @name delete
|
|
3743
|
+
* @memberOf ListCache
|
|
3744
|
+
* @param {string} key The key of the value to remove.
|
|
3745
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
3746
|
+
*/
|
|
3747
|
+
function listCacheDelete(key) {
|
|
3748
|
+
var data = this.__data__,
|
|
3749
|
+
index = assocIndexOf(data, key);
|
|
3750
|
+
|
|
3751
|
+
if (index < 0) {
|
|
3752
|
+
return false;
|
|
3753
|
+
}
|
|
3754
|
+
var lastIndex = data.length - 1;
|
|
3755
|
+
if (index == lastIndex) {
|
|
3756
|
+
data.pop();
|
|
3757
|
+
} else {
|
|
3758
|
+
splice.call(data, index, 1);
|
|
3759
|
+
}
|
|
3760
|
+
return true;
|
|
3761
|
+
}
|
|
3762
|
+
|
|
3763
|
+
/**
|
|
3764
|
+
* Gets the list cache value for `key`.
|
|
3765
|
+
*
|
|
3766
|
+
* @private
|
|
3767
|
+
* @name get
|
|
3768
|
+
* @memberOf ListCache
|
|
3769
|
+
* @param {string} key The key of the value to get.
|
|
3770
|
+
* @returns {*} Returns the entry value.
|
|
3771
|
+
*/
|
|
3772
|
+
function listCacheGet(key) {
|
|
3773
|
+
var data = this.__data__,
|
|
3774
|
+
index = assocIndexOf(data, key);
|
|
3775
|
+
|
|
3776
|
+
return index < 0 ? undefined : data[index][1];
|
|
3777
|
+
}
|
|
3778
|
+
|
|
3779
|
+
/**
|
|
3780
|
+
* Checks if a list cache value for `key` exists.
|
|
3781
|
+
*
|
|
3782
|
+
* @private
|
|
3783
|
+
* @name has
|
|
3784
|
+
* @memberOf ListCache
|
|
3785
|
+
* @param {string} key The key of the entry to check.
|
|
3786
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
3787
|
+
*/
|
|
3788
|
+
function listCacheHas(key) {
|
|
3789
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
3790
|
+
}
|
|
3791
|
+
|
|
3792
|
+
/**
|
|
3793
|
+
* Sets the list cache `key` to `value`.
|
|
3794
|
+
*
|
|
3795
|
+
* @private
|
|
3796
|
+
* @name set
|
|
3797
|
+
* @memberOf ListCache
|
|
3798
|
+
* @param {string} key The key of the value to set.
|
|
3799
|
+
* @param {*} value The value to set.
|
|
3800
|
+
* @returns {Object} Returns the list cache instance.
|
|
3801
|
+
*/
|
|
3802
|
+
function listCacheSet(key, value) {
|
|
3803
|
+
var data = this.__data__,
|
|
3804
|
+
index = assocIndexOf(data, key);
|
|
3805
|
+
|
|
3806
|
+
if (index < 0) {
|
|
3807
|
+
data.push([key, value]);
|
|
3808
|
+
} else {
|
|
3809
|
+
data[index][1] = value;
|
|
3810
|
+
}
|
|
3811
|
+
return this;
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3814
|
+
// Add methods to `ListCache`.
|
|
3815
|
+
ListCache.prototype.clear = listCacheClear;
|
|
3816
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
|
3817
|
+
ListCache.prototype.get = listCacheGet;
|
|
3818
|
+
ListCache.prototype.has = listCacheHas;
|
|
3819
|
+
ListCache.prototype.set = listCacheSet;
|
|
3820
|
+
|
|
3821
|
+
/**
|
|
3822
|
+
* Creates a map cache object to store key-value pairs.
|
|
3823
|
+
*
|
|
3824
|
+
* @private
|
|
3825
|
+
* @constructor
|
|
3826
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
3827
|
+
*/
|
|
3828
|
+
function MapCache(entries) {
|
|
3829
|
+
var index = -1,
|
|
3830
|
+
length = entries ? entries.length : 0;
|
|
3831
|
+
|
|
3832
|
+
this.clear();
|
|
3833
|
+
while (++index < length) {
|
|
3834
|
+
var entry = entries[index];
|
|
3835
|
+
this.set(entry[0], entry[1]);
|
|
3836
|
+
}
|
|
3837
|
+
}
|
|
3838
|
+
|
|
3839
|
+
/**
|
|
3840
|
+
* Removes all key-value entries from the map.
|
|
3841
|
+
*
|
|
3842
|
+
* @private
|
|
3843
|
+
* @name clear
|
|
3844
|
+
* @memberOf MapCache
|
|
3845
|
+
*/
|
|
3846
|
+
function mapCacheClear() {
|
|
3847
|
+
this.__data__ = {
|
|
3848
|
+
'hash': new Hash,
|
|
3849
|
+
'map': new (Map$1 || ListCache),
|
|
3850
|
+
'string': new Hash
|
|
3851
|
+
};
|
|
3852
|
+
}
|
|
3853
|
+
|
|
3854
|
+
/**
|
|
3855
|
+
* Removes `key` and its value from the map.
|
|
3856
|
+
*
|
|
3857
|
+
* @private
|
|
3858
|
+
* @name delete
|
|
3859
|
+
* @memberOf MapCache
|
|
3860
|
+
* @param {string} key The key of the value to remove.
|
|
3861
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
3862
|
+
*/
|
|
3863
|
+
function mapCacheDelete(key) {
|
|
3864
|
+
return getMapData(this, key)['delete'](key);
|
|
3865
|
+
}
|
|
3866
|
+
|
|
3867
|
+
/**
|
|
3868
|
+
* Gets the map value for `key`.
|
|
3869
|
+
*
|
|
3870
|
+
* @private
|
|
3871
|
+
* @name get
|
|
3872
|
+
* @memberOf MapCache
|
|
3873
|
+
* @param {string} key The key of the value to get.
|
|
3874
|
+
* @returns {*} Returns the entry value.
|
|
3875
|
+
*/
|
|
3876
|
+
function mapCacheGet(key) {
|
|
3877
|
+
return getMapData(this, key).get(key);
|
|
3878
|
+
}
|
|
3879
|
+
|
|
3880
|
+
/**
|
|
3881
|
+
* Checks if a map value for `key` exists.
|
|
3882
|
+
*
|
|
3883
|
+
* @private
|
|
3884
|
+
* @name has
|
|
3885
|
+
* @memberOf MapCache
|
|
3886
|
+
* @param {string} key The key of the entry to check.
|
|
3887
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
3888
|
+
*/
|
|
3889
|
+
function mapCacheHas(key) {
|
|
3890
|
+
return getMapData(this, key).has(key);
|
|
3891
|
+
}
|
|
3892
|
+
|
|
3893
|
+
/**
|
|
3894
|
+
* Sets the map `key` to `value`.
|
|
3895
|
+
*
|
|
3896
|
+
* @private
|
|
3897
|
+
* @name set
|
|
3898
|
+
* @memberOf MapCache
|
|
3899
|
+
* @param {string} key The key of the value to set.
|
|
3900
|
+
* @param {*} value The value to set.
|
|
3901
|
+
* @returns {Object} Returns the map cache instance.
|
|
3902
|
+
*/
|
|
3903
|
+
function mapCacheSet(key, value) {
|
|
3904
|
+
getMapData(this, key).set(key, value);
|
|
3905
|
+
return this;
|
|
3906
|
+
}
|
|
3907
|
+
|
|
3908
|
+
// Add methods to `MapCache`.
|
|
3909
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
3910
|
+
MapCache.prototype['delete'] = mapCacheDelete;
|
|
3911
|
+
MapCache.prototype.get = mapCacheGet;
|
|
3912
|
+
MapCache.prototype.has = mapCacheHas;
|
|
3913
|
+
MapCache.prototype.set = mapCacheSet;
|
|
3914
|
+
|
|
3915
|
+
/**
|
|
3916
|
+
*
|
|
3917
|
+
* Creates an array cache object to store unique values.
|
|
3918
|
+
*
|
|
3919
|
+
* @private
|
|
3920
|
+
* @constructor
|
|
3921
|
+
* @param {Array} [values] The values to cache.
|
|
3922
|
+
*/
|
|
3923
|
+
function SetCache(values) {
|
|
3924
|
+
var index = -1,
|
|
3925
|
+
length = values ? values.length : 0;
|
|
3926
|
+
|
|
3927
|
+
this.__data__ = new MapCache;
|
|
3928
|
+
while (++index < length) {
|
|
3929
|
+
this.add(values[index]);
|
|
3930
|
+
}
|
|
3931
|
+
}
|
|
3932
|
+
|
|
3933
|
+
/**
|
|
3934
|
+
* Adds `value` to the array cache.
|
|
3935
|
+
*
|
|
3936
|
+
* @private
|
|
3937
|
+
* @name add
|
|
3938
|
+
* @memberOf SetCache
|
|
3939
|
+
* @alias push
|
|
3940
|
+
* @param {*} value The value to cache.
|
|
3941
|
+
* @returns {Object} Returns the cache instance.
|
|
3942
|
+
*/
|
|
3943
|
+
function setCacheAdd(value) {
|
|
3944
|
+
this.__data__.set(value, HASH_UNDEFINED);
|
|
3945
|
+
return this;
|
|
3946
|
+
}
|
|
3947
|
+
|
|
3948
|
+
/**
|
|
3949
|
+
* Checks if `value` is in the array cache.
|
|
3950
|
+
*
|
|
3951
|
+
* @private
|
|
3952
|
+
* @name has
|
|
3953
|
+
* @memberOf SetCache
|
|
3954
|
+
* @param {*} value The value to search for.
|
|
3955
|
+
* @returns {number} Returns `true` if `value` is found, else `false`.
|
|
3956
|
+
*/
|
|
3957
|
+
function setCacheHas(value) {
|
|
3958
|
+
return this.__data__.has(value);
|
|
3959
|
+
}
|
|
3960
|
+
|
|
3961
|
+
// Add methods to `SetCache`.
|
|
3962
|
+
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
3963
|
+
SetCache.prototype.has = setCacheHas;
|
|
3964
|
+
|
|
3965
|
+
/**
|
|
3966
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
3967
|
+
*
|
|
3968
|
+
* @private
|
|
3969
|
+
* @param {Array} array The array to inspect.
|
|
3970
|
+
* @param {*} key The key to search for.
|
|
3971
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
3972
|
+
*/
|
|
3973
|
+
function assocIndexOf(array, key) {
|
|
3974
|
+
var length = array.length;
|
|
3975
|
+
while (length--) {
|
|
3976
|
+
if (eq(array[length][0], key)) {
|
|
3977
|
+
return length;
|
|
3978
|
+
}
|
|
3979
|
+
}
|
|
3980
|
+
return -1;
|
|
3981
|
+
}
|
|
3982
|
+
|
|
3983
|
+
/**
|
|
3984
|
+
* The base implementation of methods like `_.difference` without support
|
|
3985
|
+
* for excluding multiple arrays or iteratee shorthands.
|
|
3986
|
+
*
|
|
3987
|
+
* @private
|
|
3988
|
+
* @param {Array} array The array to inspect.
|
|
3989
|
+
* @param {Array} values The values to exclude.
|
|
3990
|
+
* @param {Function} [iteratee] The iteratee invoked per element.
|
|
3991
|
+
* @param {Function} [comparator] The comparator invoked per element.
|
|
3992
|
+
* @returns {Array} Returns the new array of filtered values.
|
|
3993
|
+
*/
|
|
3994
|
+
function baseDifference(array, values, iteratee, comparator) {
|
|
3995
|
+
var index = -1,
|
|
3996
|
+
includes = arrayIncludes,
|
|
3997
|
+
isCommon = true,
|
|
3998
|
+
length = array.length,
|
|
3999
|
+
result = [],
|
|
4000
|
+
valuesLength = values.length;
|
|
4001
|
+
|
|
4002
|
+
if (!length) {
|
|
4003
|
+
return result;
|
|
4004
|
+
}
|
|
4005
|
+
if (iteratee) {
|
|
4006
|
+
values = arrayMap(values, baseUnary(iteratee));
|
|
4007
|
+
}
|
|
4008
|
+
if (comparator) {
|
|
4009
|
+
includes = arrayIncludesWith;
|
|
4010
|
+
isCommon = false;
|
|
4011
|
+
}
|
|
4012
|
+
else if (values.length >= LARGE_ARRAY_SIZE) {
|
|
4013
|
+
includes = cacheHas;
|
|
4014
|
+
isCommon = false;
|
|
4015
|
+
values = new SetCache(values);
|
|
4016
|
+
}
|
|
4017
|
+
outer:
|
|
4018
|
+
while (++index < length) {
|
|
4019
|
+
var value = array[index],
|
|
4020
|
+
computed = iteratee ? iteratee(value) : value;
|
|
4021
|
+
|
|
4022
|
+
value = (comparator || value !== 0) ? value : 0;
|
|
4023
|
+
if (isCommon && computed === computed) {
|
|
4024
|
+
var valuesIndex = valuesLength;
|
|
4025
|
+
while (valuesIndex--) {
|
|
4026
|
+
if (values[valuesIndex] === computed) {
|
|
4027
|
+
continue outer;
|
|
4028
|
+
}
|
|
4029
|
+
}
|
|
4030
|
+
result.push(value);
|
|
4031
|
+
}
|
|
4032
|
+
else if (!includes(values, computed, comparator)) {
|
|
4033
|
+
result.push(value);
|
|
4034
|
+
}
|
|
4035
|
+
}
|
|
4036
|
+
return result;
|
|
4037
|
+
}
|
|
4038
|
+
|
|
4039
|
+
/**
|
|
4040
|
+
* The base implementation of `_.flatten` with support for restricting flattening.
|
|
4041
|
+
*
|
|
4042
|
+
* @private
|
|
4043
|
+
* @param {Array} array The array to flatten.
|
|
4044
|
+
* @param {number} depth The maximum recursion depth.
|
|
4045
|
+
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
|
|
4046
|
+
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
|
|
4047
|
+
* @param {Array} [result=[]] The initial result value.
|
|
4048
|
+
* @returns {Array} Returns the new flattened array.
|
|
4049
|
+
*/
|
|
4050
|
+
function baseFlatten(array, depth, predicate, isStrict, result) {
|
|
4051
|
+
var index = -1,
|
|
4052
|
+
length = array.length;
|
|
4053
|
+
|
|
4054
|
+
predicate || (predicate = isFlattenable);
|
|
4055
|
+
result || (result = []);
|
|
4056
|
+
|
|
4057
|
+
while (++index < length) {
|
|
4058
|
+
var value = array[index];
|
|
4059
|
+
if (depth > 0 && predicate(value)) {
|
|
4060
|
+
if (depth > 1) {
|
|
4061
|
+
// Recursively flatten arrays (susceptible to call stack limits).
|
|
4062
|
+
baseFlatten(value, depth - 1, predicate, isStrict, result);
|
|
4063
|
+
} else {
|
|
4064
|
+
arrayPush(result, value);
|
|
4065
|
+
}
|
|
4066
|
+
} else if (!isStrict) {
|
|
4067
|
+
result[result.length] = value;
|
|
4068
|
+
}
|
|
4069
|
+
}
|
|
4070
|
+
return result;
|
|
4071
|
+
}
|
|
4072
|
+
|
|
4073
|
+
/**
|
|
4074
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
|
4075
|
+
*
|
|
4076
|
+
* @private
|
|
4077
|
+
* @param {*} value The value to check.
|
|
4078
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
4079
|
+
* else `false`.
|
|
4080
|
+
*/
|
|
4081
|
+
function baseIsNative(value) {
|
|
4082
|
+
if (!isObject(value) || isMasked(value)) {
|
|
4083
|
+
return false;
|
|
4084
|
+
}
|
|
4085
|
+
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
|
|
4086
|
+
return pattern.test(toSource(value));
|
|
4087
|
+
}
|
|
4088
|
+
|
|
4089
|
+
/**
|
|
4090
|
+
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
|
|
4091
|
+
*
|
|
4092
|
+
* @private
|
|
4093
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
4094
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
4095
|
+
* @returns {Function} Returns the new function.
|
|
4096
|
+
*/
|
|
4097
|
+
function baseRest(func, start) {
|
|
4098
|
+
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
|
4099
|
+
return function() {
|
|
4100
|
+
var args = arguments,
|
|
4101
|
+
index = -1,
|
|
4102
|
+
length = nativeMax(args.length - start, 0),
|
|
4103
|
+
array = Array(length);
|
|
4104
|
+
|
|
4105
|
+
while (++index < length) {
|
|
4106
|
+
array[index] = args[start + index];
|
|
4107
|
+
}
|
|
4108
|
+
index = -1;
|
|
4109
|
+
var otherArgs = Array(start + 1);
|
|
4110
|
+
while (++index < start) {
|
|
4111
|
+
otherArgs[index] = args[index];
|
|
4112
|
+
}
|
|
4113
|
+
otherArgs[start] = array;
|
|
4114
|
+
return apply(func, this, otherArgs);
|
|
4115
|
+
};
|
|
4116
|
+
}
|
|
4117
|
+
|
|
4118
|
+
/**
|
|
4119
|
+
* Gets the data for `map`.
|
|
4120
|
+
*
|
|
4121
|
+
* @private
|
|
4122
|
+
* @param {Object} map The map to query.
|
|
4123
|
+
* @param {string} key The reference key.
|
|
4124
|
+
* @returns {*} Returns the map data.
|
|
4125
|
+
*/
|
|
4126
|
+
function getMapData(map, key) {
|
|
4127
|
+
var data = map.__data__;
|
|
4128
|
+
return isKeyable(key)
|
|
4129
|
+
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
4130
|
+
: data.map;
|
|
4131
|
+
}
|
|
4132
|
+
|
|
4133
|
+
/**
|
|
4134
|
+
* Gets the native function at `key` of `object`.
|
|
4135
|
+
*
|
|
4136
|
+
* @private
|
|
4137
|
+
* @param {Object} object The object to query.
|
|
4138
|
+
* @param {string} key The key of the method to get.
|
|
4139
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
4140
|
+
*/
|
|
4141
|
+
function getNative(object, key) {
|
|
4142
|
+
var value = getValue(object, key);
|
|
4143
|
+
return baseIsNative(value) ? value : undefined;
|
|
4144
|
+
}
|
|
4145
|
+
|
|
4146
|
+
/**
|
|
4147
|
+
* Checks if `value` is a flattenable `arguments` object or array.
|
|
4148
|
+
*
|
|
4149
|
+
* @private
|
|
4150
|
+
* @param {*} value The value to check.
|
|
4151
|
+
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
|
|
4152
|
+
*/
|
|
4153
|
+
function isFlattenable(value) {
|
|
4154
|
+
return isArray(value) || isArguments(value) ||
|
|
4155
|
+
!!(spreadableSymbol && value && value[spreadableSymbol]);
|
|
4156
|
+
}
|
|
4157
|
+
|
|
4158
|
+
/**
|
|
4159
|
+
* Checks if `value` is suitable for use as unique object key.
|
|
4160
|
+
*
|
|
4161
|
+
* @private
|
|
4162
|
+
* @param {*} value The value to check.
|
|
4163
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
4164
|
+
*/
|
|
4165
|
+
function isKeyable(value) {
|
|
4166
|
+
var type = typeof value;
|
|
4167
|
+
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
4168
|
+
? (value !== '__proto__')
|
|
4169
|
+
: (value === null);
|
|
4170
|
+
}
|
|
4171
|
+
|
|
4172
|
+
/**
|
|
4173
|
+
* Checks if `func` has its source masked.
|
|
4174
|
+
*
|
|
4175
|
+
* @private
|
|
4176
|
+
* @param {Function} func The function to check.
|
|
4177
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
4178
|
+
*/
|
|
4179
|
+
function isMasked(func) {
|
|
4180
|
+
return !!maskSrcKey && (maskSrcKey in func);
|
|
4181
|
+
}
|
|
4182
|
+
|
|
4183
|
+
/**
|
|
4184
|
+
* Converts `func` to its source code.
|
|
4185
|
+
*
|
|
4186
|
+
* @private
|
|
4187
|
+
* @param {Function} func The function to process.
|
|
4188
|
+
* @returns {string} Returns the source code.
|
|
4189
|
+
*/
|
|
4190
|
+
function toSource(func) {
|
|
4191
|
+
if (func != null) {
|
|
4192
|
+
try {
|
|
4193
|
+
return funcToString.call(func);
|
|
4194
|
+
} catch (e) {}
|
|
4195
|
+
try {
|
|
4196
|
+
return (func + '');
|
|
4197
|
+
} catch (e) {}
|
|
4198
|
+
}
|
|
4199
|
+
return '';
|
|
4200
|
+
}
|
|
4201
|
+
|
|
4202
|
+
/**
|
|
4203
|
+
* Creates an array of `array` values not included in the other given arrays
|
|
4204
|
+
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
4205
|
+
* for equality comparisons. The order of result values is determined by the
|
|
4206
|
+
* order they occur in the first array.
|
|
4207
|
+
*
|
|
4208
|
+
* **Note:** Unlike `_.pullAll`, this method returns a new array.
|
|
4209
|
+
*
|
|
4210
|
+
* @static
|
|
4211
|
+
* @memberOf _
|
|
4212
|
+
* @since 0.1.0
|
|
4213
|
+
* @category Array
|
|
4214
|
+
* @param {Array} array The array to inspect.
|
|
4215
|
+
* @param {...Array} [values] The values to exclude.
|
|
4216
|
+
* @returns {Array} Returns the new array of filtered values.
|
|
4217
|
+
* @see _.without, _.xor
|
|
4218
|
+
* @example
|
|
4219
|
+
*
|
|
4220
|
+
* _.difference([2, 1], [2, 3]);
|
|
4221
|
+
* // => [1]
|
|
4222
|
+
*/
|
|
4223
|
+
var difference = baseRest(function(array, values) {
|
|
4224
|
+
return isArrayLikeObject(array)
|
|
4225
|
+
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
|
|
4226
|
+
: [];
|
|
4227
|
+
});
|
|
4228
|
+
|
|
4229
|
+
/**
|
|
4230
|
+
* Performs a
|
|
4231
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
4232
|
+
* comparison between two values to determine if they are equivalent.
|
|
4233
|
+
*
|
|
4234
|
+
* @static
|
|
4235
|
+
* @memberOf _
|
|
4236
|
+
* @since 4.0.0
|
|
4237
|
+
* @category Lang
|
|
4238
|
+
* @param {*} value The value to compare.
|
|
4239
|
+
* @param {*} other The other value to compare.
|
|
4240
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
4241
|
+
* @example
|
|
4242
|
+
*
|
|
4243
|
+
* var object = { 'a': 1 };
|
|
4244
|
+
* var other = { 'a': 1 };
|
|
4245
|
+
*
|
|
4246
|
+
* _.eq(object, object);
|
|
4247
|
+
* // => true
|
|
4248
|
+
*
|
|
4249
|
+
* _.eq(object, other);
|
|
4250
|
+
* // => false
|
|
4251
|
+
*
|
|
4252
|
+
* _.eq('a', 'a');
|
|
4253
|
+
* // => true
|
|
4254
|
+
*
|
|
4255
|
+
* _.eq('a', Object('a'));
|
|
4256
|
+
* // => false
|
|
4257
|
+
*
|
|
4258
|
+
* _.eq(NaN, NaN);
|
|
4259
|
+
* // => true
|
|
4260
|
+
*/
|
|
4261
|
+
function eq(value, other) {
|
|
4262
|
+
return value === other || (value !== value && other !== other);
|
|
4263
|
+
}
|
|
4264
|
+
|
|
4265
|
+
/**
|
|
4266
|
+
* Checks if `value` is likely an `arguments` object.
|
|
4267
|
+
*
|
|
4268
|
+
* @static
|
|
4269
|
+
* @memberOf _
|
|
4270
|
+
* @since 0.1.0
|
|
4271
|
+
* @category Lang
|
|
4272
|
+
* @param {*} value The value to check.
|
|
4273
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
4274
|
+
* else `false`.
|
|
4275
|
+
* @example
|
|
4276
|
+
*
|
|
4277
|
+
* _.isArguments(function() { return arguments; }());
|
|
4278
|
+
* // => true
|
|
4279
|
+
*
|
|
4280
|
+
* _.isArguments([1, 2, 3]);
|
|
4281
|
+
* // => false
|
|
4282
|
+
*/
|
|
4283
|
+
function isArguments(value) {
|
|
4284
|
+
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
|
|
4285
|
+
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
|
|
4286
|
+
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
|
|
4287
|
+
}
|
|
4288
|
+
|
|
4289
|
+
/**
|
|
4290
|
+
* Checks if `value` is classified as an `Array` object.
|
|
4291
|
+
*
|
|
4292
|
+
* @static
|
|
4293
|
+
* @memberOf _
|
|
4294
|
+
* @since 0.1.0
|
|
4295
|
+
* @category Lang
|
|
4296
|
+
* @param {*} value The value to check.
|
|
4297
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
4298
|
+
* @example
|
|
4299
|
+
*
|
|
4300
|
+
* _.isArray([1, 2, 3]);
|
|
4301
|
+
* // => true
|
|
4302
|
+
*
|
|
4303
|
+
* _.isArray(document.body.children);
|
|
4304
|
+
* // => false
|
|
4305
|
+
*
|
|
4306
|
+
* _.isArray('abc');
|
|
4307
|
+
* // => false
|
|
4308
|
+
*
|
|
4309
|
+
* _.isArray(_.noop);
|
|
4310
|
+
* // => false
|
|
4311
|
+
*/
|
|
4312
|
+
var isArray = Array.isArray;
|
|
4313
|
+
|
|
4314
|
+
/**
|
|
4315
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
4316
|
+
* not a function and has a `value.length` that's an integer greater than or
|
|
4317
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
4318
|
+
*
|
|
4319
|
+
* @static
|
|
4320
|
+
* @memberOf _
|
|
4321
|
+
* @since 4.0.0
|
|
4322
|
+
* @category Lang
|
|
4323
|
+
* @param {*} value The value to check.
|
|
4324
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
4325
|
+
* @example
|
|
4326
|
+
*
|
|
4327
|
+
* _.isArrayLike([1, 2, 3]);
|
|
4328
|
+
* // => true
|
|
4329
|
+
*
|
|
4330
|
+
* _.isArrayLike(document.body.children);
|
|
4331
|
+
* // => true
|
|
4332
|
+
*
|
|
4333
|
+
* _.isArrayLike('abc');
|
|
4334
|
+
* // => true
|
|
4335
|
+
*
|
|
4336
|
+
* _.isArrayLike(_.noop);
|
|
4337
|
+
* // => false
|
|
4338
|
+
*/
|
|
4339
|
+
function isArrayLike(value) {
|
|
4340
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
|
4341
|
+
}
|
|
4342
|
+
|
|
4343
|
+
/**
|
|
4344
|
+
* This method is like `_.isArrayLike` except that it also checks if `value`
|
|
4345
|
+
* is an object.
|
|
4346
|
+
*
|
|
4347
|
+
* @static
|
|
4348
|
+
* @memberOf _
|
|
4349
|
+
* @since 4.0.0
|
|
4350
|
+
* @category Lang
|
|
4351
|
+
* @param {*} value The value to check.
|
|
4352
|
+
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
|
4353
|
+
* else `false`.
|
|
4354
|
+
* @example
|
|
4355
|
+
*
|
|
4356
|
+
* _.isArrayLikeObject([1, 2, 3]);
|
|
4357
|
+
* // => true
|
|
4358
|
+
*
|
|
4359
|
+
* _.isArrayLikeObject(document.body.children);
|
|
4360
|
+
* // => true
|
|
4361
|
+
*
|
|
4362
|
+
* _.isArrayLikeObject('abc');
|
|
4363
|
+
* // => false
|
|
4364
|
+
*
|
|
4365
|
+
* _.isArrayLikeObject(_.noop);
|
|
4366
|
+
* // => false
|
|
4367
|
+
*/
|
|
4368
|
+
function isArrayLikeObject(value) {
|
|
4369
|
+
return isObjectLike(value) && isArrayLike(value);
|
|
4370
|
+
}
|
|
4371
|
+
|
|
4372
|
+
/**
|
|
4373
|
+
* Checks if `value` is classified as a `Function` object.
|
|
4374
|
+
*
|
|
4375
|
+
* @static
|
|
4376
|
+
* @memberOf _
|
|
4377
|
+
* @since 0.1.0
|
|
4378
|
+
* @category Lang
|
|
4379
|
+
* @param {*} value The value to check.
|
|
4380
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
4381
|
+
* @example
|
|
4382
|
+
*
|
|
4383
|
+
* _.isFunction(_);
|
|
4384
|
+
* // => true
|
|
4385
|
+
*
|
|
4386
|
+
* _.isFunction(/abc/);
|
|
4387
|
+
* // => false
|
|
4388
|
+
*/
|
|
4389
|
+
function isFunction(value) {
|
|
4390
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
4391
|
+
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
|
4392
|
+
var tag = isObject(value) ? objectToString.call(value) : '';
|
|
4393
|
+
return tag == funcTag || tag == genTag;
|
|
4394
|
+
}
|
|
4395
|
+
|
|
4396
|
+
/**
|
|
4397
|
+
* Checks if `value` is a valid array-like length.
|
|
4398
|
+
*
|
|
4399
|
+
* **Note:** This method is loosely based on
|
|
4400
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
4401
|
+
*
|
|
4402
|
+
* @static
|
|
4403
|
+
* @memberOf _
|
|
4404
|
+
* @since 4.0.0
|
|
4405
|
+
* @category Lang
|
|
4406
|
+
* @param {*} value The value to check.
|
|
4407
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
4408
|
+
* @example
|
|
4409
|
+
*
|
|
4410
|
+
* _.isLength(3);
|
|
4411
|
+
* // => true
|
|
4412
|
+
*
|
|
4413
|
+
* _.isLength(Number.MIN_VALUE);
|
|
4414
|
+
* // => false
|
|
4415
|
+
*
|
|
4416
|
+
* _.isLength(Infinity);
|
|
4417
|
+
* // => false
|
|
4418
|
+
*
|
|
4419
|
+
* _.isLength('3');
|
|
4420
|
+
* // => false
|
|
4421
|
+
*/
|
|
4422
|
+
function isLength(value) {
|
|
4423
|
+
return typeof value == 'number' &&
|
|
4424
|
+
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
4425
|
+
}
|
|
4426
|
+
|
|
4427
|
+
/**
|
|
4428
|
+
* Checks if `value` is the
|
|
4429
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
4430
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
4431
|
+
*
|
|
4432
|
+
* @static
|
|
4433
|
+
* @memberOf _
|
|
4434
|
+
* @since 0.1.0
|
|
4435
|
+
* @category Lang
|
|
4436
|
+
* @param {*} value The value to check.
|
|
4437
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
4438
|
+
* @example
|
|
4439
|
+
*
|
|
4440
|
+
* _.isObject({});
|
|
4441
|
+
* // => true
|
|
4442
|
+
*
|
|
4443
|
+
* _.isObject([1, 2, 3]);
|
|
4444
|
+
* // => true
|
|
4445
|
+
*
|
|
4446
|
+
* _.isObject(_.noop);
|
|
4447
|
+
* // => true
|
|
4448
|
+
*
|
|
4449
|
+
* _.isObject(null);
|
|
4450
|
+
* // => false
|
|
4451
|
+
*/
|
|
4452
|
+
function isObject(value) {
|
|
4453
|
+
var type = typeof value;
|
|
4454
|
+
return !!value && (type == 'object' || type == 'function');
|
|
4455
|
+
}
|
|
4456
|
+
|
|
4457
|
+
/**
|
|
4458
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
4459
|
+
* and has a `typeof` result of "object".
|
|
4460
|
+
*
|
|
4461
|
+
* @static
|
|
4462
|
+
* @memberOf _
|
|
4463
|
+
* @since 4.0.0
|
|
4464
|
+
* @category Lang
|
|
4465
|
+
* @param {*} value The value to check.
|
|
4466
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
4467
|
+
* @example
|
|
4468
|
+
*
|
|
4469
|
+
* _.isObjectLike({});
|
|
4470
|
+
* // => true
|
|
4471
|
+
*
|
|
4472
|
+
* _.isObjectLike([1, 2, 3]);
|
|
4473
|
+
* // => true
|
|
4474
|
+
*
|
|
4475
|
+
* _.isObjectLike(_.noop);
|
|
4476
|
+
* // => false
|
|
4477
|
+
*
|
|
4478
|
+
* _.isObjectLike(null);
|
|
4479
|
+
* // => false
|
|
4480
|
+
*/
|
|
4481
|
+
function isObjectLike(value) {
|
|
4482
|
+
return !!value && typeof value == 'object';
|
|
4483
|
+
}
|
|
4484
|
+
|
|
4485
|
+
var lodash_difference = difference;
|
|
4486
|
+
|
|
4487
|
+
var _difference = /*@__PURE__*/getDefaultExportFromCjs(lodash_difference);
|
|
4488
|
+
|
|
1958
4489
|
/**
|
|
1959
4490
|
* Makes sure all values in the grid have a rectangular shape.
|
|
1960
4491
|
* We don't support Tetris types.
|