@televet/kibble-ui 0.1.0-beta.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +37 -230
  2. package/build/components/Banner/index.d.ts +3 -0
  3. package/build/components/Input/index.d.ts +3 -0
  4. package/build/index.d.ts +2 -1
  5. package/build/index.js +86 -2258
  6. package/build/index.js.map +1 -1
  7. package/build/theme/index.d.ts +16 -17
  8. package/build/theme/{colors.d.ts → tokens/colors.d.ts} +32 -31
  9. package/package.json +26 -25
  10. package/build/index.es.js +0 -13886
  11. package/build/index.es.js.map +0 -1
  12. package/build/providers/ThemeProvider/ThemeProvider.d.ts +0 -5
  13. package/build/theme/breakpoints.d.ts +0 -9
  14. package/build/theme/pallette.d.ts +0 -23
  15. package/build/theme/theme.d.ts +0 -3
  16. package/build/theme/tokens/colors/colors.d.ts +0 -190
  17. package/build/theme/tokens/fonts/fonts.d.ts +0 -6
  18. /package/build/theme/{blur.d.ts → tokens/blur.d.ts} +0 -0
  19. /package/build/theme/{borders.d.ts → tokens/borders.d.ts} +0 -0
  20. /package/build/theme/{fontSizes.d.ts → tokens/fontSizes.d.ts} +0 -0
  21. /package/build/theme/{fontWeights.d.ts → tokens/fontWeights.d.ts} +0 -0
  22. /package/build/theme/{fonts.d.ts → tokens/fonts.d.ts} +0 -0
  23. /package/build/theme/{letterSpacings.d.ts → tokens/letterSpacings.d.ts} +0 -0
  24. /package/build/theme/{lineHeights.d.ts → tokens/lineHeights.d.ts} +0 -0
  25. /package/build/theme/{radii.d.ts → tokens/radii.d.ts} +0 -0
  26. /package/build/theme/{shadows.d.ts → tokens/shadows.d.ts} +0 -0
  27. /package/build/theme/{sizes.d.ts → tokens/sizes.d.ts} +0 -0
  28. /package/build/theme/{space.d.ts → tokens/space.d.ts} +0 -0
  29. /package/build/theme/{transition.d.ts → tokens/transition.d.ts} +0 -0
  30. /package/build/theme/{zIndeces.d.ts → tokens/zIndeces.d.ts} +0 -0
package/build/index.js CHANGED
@@ -36,7 +36,7 @@ var __assign = function() {
36
36
  return __assign.apply(this, arguments);
37
37
  };
38
38
 
39
- var pallette$1 = {
39
+ var baseColors = {
40
40
  comet: {
41
41
  50: '#F0F1F5',
42
42
  100: '#D5D7E2',
@@ -49,20 +49,17 @@ var pallette$1 = {
49
49
  800: '#2A2D3C',
50
50
  900: '#15171E',
51
51
  },
52
- televet: {
53
- 100: '#A4DAE4',
54
- },
55
52
  teal: {
56
- 50: '#EBF7F9',
57
- 100: '#C8E9EF',
58
- 200: '#A4DAE4',
59
- 300: '#81CCDA',
60
- 400: '#5DBDD0',
53
+ 50: '#F7FAFC',
54
+ 100: '#EBF9FB',
55
+ 200: '#DCF6FB',
56
+ 300: '#AFE1EC',
57
+ 400: '#78CBDC',
61
58
  500: '#39ADC3',
62
- 600: '#2E8C9E',
63
- 700: '#236976',
64
- 800: '#17464F',
65
- 900: '#0C2327',
59
+ 600: '#3CA0B4',
60
+ 700: '#2E8C9E',
61
+ 800: '#236976',
62
+ 900: '#17464F',
66
63
  },
67
64
  blue: {
68
65
  50: '#E7E9FE',
@@ -82,7 +79,7 @@ var pallette$1 = {
82
79
  200: '#FEB2B2',
83
80
  300: '#FC8181',
84
81
  400: '#F56565',
85
- 500: '#E53E3E',
82
+ 500: '#E01F1F',
86
83
  600: '#C53030',
87
84
  700: '#9B2C2C',
88
85
  800: '#822727',
@@ -119,7 +116,7 @@ var pallette$1 = {
119
116
  300: '#68D391',
120
117
  400: '#48BB78',
121
118
  500: '#38A169',
122
- 600: '#2F855A',
119
+ 600: '#25855A',
123
120
  700: '#276749',
124
121
  800: '#22543D',
125
122
  900: '#1C4532',
@@ -167,66 +164,68 @@ var pallette$1 = {
167
164
  };
168
165
  var semanticTokens = {
169
166
  text: {
170
- onLight: pallette$1.comet[700],
171
- onLightSubtle: pallette$1.gray[800],
172
- onDark: pallette$1.white,
173
- headline: pallette$1.blue[700],
167
+ onLight: baseColors.comet[700],
168
+ linkOnLight: baseColors.teal[600],
169
+ onLightSubtle: baseColors.gray[800],
170
+ onDark: baseColors.white,
171
+ headline: baseColors.blue[800],
172
+ placeholder: baseColors.blackAlpha[500],
173
+ success: baseColors.green[600],
174
+ warning: baseColors.yellow[600],
175
+ error: baseColors.red[600],
174
176
  },
175
177
  background: {
176
- light: pallette$1.gray[300],
177
- gray: pallette$1.gray[50],
178
- info: pallette$1.teal[50],
179
- error: pallette$1.red[50],
180
- warning: pallette$1.orange[50],
181
- success: pallette$1.blue[50],
182
- },
183
- border: {
184
- default: pallette$1.gray[300],
185
- dark: pallette$1.comet[700],
186
- info: pallette$1.teal[500],
187
- error: pallette$1.red[500],
188
- warning: pallette$1.yellow[500],
189
- success: pallette$1.blue[200],
190
- },
191
- button: {
192
- primaryDefault: pallette$1.teal[600],
193
- primaryHover: pallette$1.teal[700],
194
- primaryActive: pallette$1.teal[800],
195
- secondaryDefault: pallette$1.gray[300],
196
- secondaryHover: pallette$1.gray[50],
197
- secondaryActive: pallette$1.gray[100],
198
- tertiaryDefault: pallette$1.gray[100],
199
- tertiaryHover: pallette$1.gray[200],
200
- tertiaryActive: pallette$1.gray[200],
201
- ghostDefault: pallette$1.white,
202
- ghostHover: pallette$1.teal[50],
203
- ghostActive: pallette$1.teal[100],
204
- },
205
- link: {
206
- onLight: pallette$1.teal[600],
178
+ light: baseColors.gray[300],
179
+ grayLight: baseColors.gray[50],
180
+ grayDark: baseColors.gray[300],
181
+ tealLight: baseColors.teal[50],
182
+ dark: baseColors.blue[800],
183
+ table: baseColors.comet[50],
184
+ overlay: baseColors.blackAlpha[300],
185
+ info: baseColors.teal[50],
186
+ error: baseColors.red[50],
187
+ warning: baseColors.orange[50],
188
+ success: baseColors.green[50],
207
189
  },
208
190
  icon: {
209
- onLight: pallette$1.comet[700],
210
- onDark: pallette$1.gray[300],
211
- active: pallette$1.teal[600],
212
- success: pallette$1.blue[400],
213
- warning: pallette$1.yellow[500],
214
- error: pallette$1.red[500],
191
+ onLight: baseColors.comet[700],
192
+ onLightSubtle: baseColors.gray[800],
193
+ onDark: baseColors.white,
194
+ inactive: baseColors.gray[700],
195
+ active: baseColors.teal[600],
196
+ success: baseColors.green[600],
197
+ warning: baseColors.yellow[600],
198
+ error: baseColors.red[600],
199
+ },
200
+ border: {
201
+ default: baseColors.gray[200],
202
+ dark: baseColors.comet[700],
203
+ focus: baseColors.teal[600],
204
+ info: baseColors.teal[600],
205
+ error: baseColors.red[500],
206
+ warning: baseColors.yellow[500],
207
+ success: baseColors.green[400],
215
208
  },
216
209
  divider: {
217
- onLight: pallette$1.gray[300],
210
+ onLight: baseColors.gray[100],
218
211
  },
219
212
  status: {
220
- open: pallette$1.blue[300],
221
- confirmed: pallette$1.teal[500],
222
- success: pallette$1.green[400],
223
- warning: pallette$1.yellow[400],
224
- action: pallette$1.orange[400],
225
- negative: pallette$1.red[300],
226
- error: pallette$1.red[500],
213
+ open: baseColors.blue[300],
214
+ confirmed: baseColors.teal[500],
215
+ success: baseColors.green[400],
216
+ warning: baseColors.yellow[400],
217
+ action: baseColors.orange[400],
218
+ negative: baseColors.red[300],
219
+ error: baseColors.red[500],
220
+ archived: baseColors.gray[800],
221
+ closed: baseColors.gray[900],
222
+ },
223
+ general: {
224
+ brand: baseColors.teal[500],
225
+ error: baseColors.red[500],
227
226
  },
228
227
  };
229
- var colors = __assign(__assign({}, pallette$1), semanticTokens);
228
+ var colors = __assign(__assign({}, baseColors), semanticTokens);
230
229
 
231
230
  var blur = {
232
231
  none: 0,
@@ -239,2169 +238,6 @@ var blur = {
239
238
  '3xl': '64px',
240
239
  };
241
240
 
242
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
243
-
244
- function createCommonjsModule(fn, module) {
245
- return module = { exports: {} }, fn(module, module.exports), module.exports;
246
- }
247
-
248
- createCommonjsModule(function (module, exports) {
249
- /**
250
- * Lodash (Custom Build) <https://lodash.com/>
251
- * Build: `lodash modularize exports="npm" -o ./`
252
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
253
- * Released under MIT license <https://lodash.com/license>
254
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
255
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
256
- */
257
-
258
- /** Used as the size to enable large array optimizations. */
259
- var LARGE_ARRAY_SIZE = 200;
260
-
261
- /** Used to stand-in for `undefined` hash values. */
262
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
263
-
264
- /** Used to detect hot functions by number of calls within a span of milliseconds. */
265
- var HOT_COUNT = 800,
266
- HOT_SPAN = 16;
267
-
268
- /** Used as references for various `Number` constants. */
269
- var MAX_SAFE_INTEGER = 9007199254740991;
270
-
271
- /** `Object#toString` result references. */
272
- var argsTag = '[object Arguments]',
273
- arrayTag = '[object Array]',
274
- asyncTag = '[object AsyncFunction]',
275
- boolTag = '[object Boolean]',
276
- dateTag = '[object Date]',
277
- errorTag = '[object Error]',
278
- funcTag = '[object Function]',
279
- genTag = '[object GeneratorFunction]',
280
- mapTag = '[object Map]',
281
- numberTag = '[object Number]',
282
- nullTag = '[object Null]',
283
- objectTag = '[object Object]',
284
- proxyTag = '[object Proxy]',
285
- regexpTag = '[object RegExp]',
286
- setTag = '[object Set]',
287
- stringTag = '[object String]',
288
- undefinedTag = '[object Undefined]',
289
- weakMapTag = '[object WeakMap]';
290
-
291
- var arrayBufferTag = '[object ArrayBuffer]',
292
- dataViewTag = '[object DataView]',
293
- float32Tag = '[object Float32Array]',
294
- float64Tag = '[object Float64Array]',
295
- int8Tag = '[object Int8Array]',
296
- int16Tag = '[object Int16Array]',
297
- int32Tag = '[object Int32Array]',
298
- uint8Tag = '[object Uint8Array]',
299
- uint8ClampedTag = '[object Uint8ClampedArray]',
300
- uint16Tag = '[object Uint16Array]',
301
- uint32Tag = '[object Uint32Array]';
302
-
303
- /**
304
- * Used to match `RegExp`
305
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
306
- */
307
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
308
-
309
- /** Used to detect host constructors (Safari). */
310
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
311
-
312
- /** Used to detect unsigned integer values. */
313
- var reIsUint = /^(?:0|[1-9]\d*)$/;
314
-
315
- /** Used to identify `toStringTag` values of typed arrays. */
316
- var typedArrayTags = {};
317
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
318
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
319
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
320
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
321
- typedArrayTags[uint32Tag] = true;
322
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
323
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
324
- typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
325
- typedArrayTags[errorTag] = typedArrayTags[funcTag] =
326
- typedArrayTags[mapTag] = typedArrayTags[numberTag] =
327
- typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
328
- typedArrayTags[setTag] = typedArrayTags[stringTag] =
329
- typedArrayTags[weakMapTag] = false;
330
-
331
- /** Detect free variable `global` from Node.js. */
332
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
333
-
334
- /** Detect free variable `self`. */
335
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
336
-
337
- /** Used as a reference to the global object. */
338
- var root = freeGlobal || freeSelf || Function('return this')();
339
-
340
- /** Detect free variable `exports`. */
341
- var freeExports = exports && !exports.nodeType && exports;
342
-
343
- /** Detect free variable `module`. */
344
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
345
-
346
- /** Detect the popular CommonJS extension `module.exports`. */
347
- var moduleExports = freeModule && freeModule.exports === freeExports;
348
-
349
- /** Detect free variable `process` from Node.js. */
350
- var freeProcess = moduleExports && freeGlobal.process;
351
-
352
- /** Used to access faster Node.js helpers. */
353
- var nodeUtil = (function() {
354
- try {
355
- // Use `util.types` for Node.js 10+.
356
- var types = freeModule && freeModule.require && freeModule.require('util').types;
357
-
358
- if (types) {
359
- return types;
360
- }
361
-
362
- // Legacy `process.binding('util')` for Node.js < 10.
363
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
364
- } catch (e) {}
365
- }());
366
-
367
- /* Node.js helper references. */
368
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
369
-
370
- /**
371
- * A faster alternative to `Function#apply`, this function invokes `func`
372
- * with the `this` binding of `thisArg` and the arguments of `args`.
373
- *
374
- * @private
375
- * @param {Function} func The function to invoke.
376
- * @param {*} thisArg The `this` binding of `func`.
377
- * @param {Array} args The arguments to invoke `func` with.
378
- * @returns {*} Returns the result of `func`.
379
- */
380
- function apply(func, thisArg, args) {
381
- switch (args.length) {
382
- case 0: return func.call(thisArg);
383
- case 1: return func.call(thisArg, args[0]);
384
- case 2: return func.call(thisArg, args[0], args[1]);
385
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
386
- }
387
- return func.apply(thisArg, args);
388
- }
389
-
390
- /**
391
- * The base implementation of `_.times` without support for iteratee shorthands
392
- * or max array length checks.
393
- *
394
- * @private
395
- * @param {number} n The number of times to invoke `iteratee`.
396
- * @param {Function} iteratee The function invoked per iteration.
397
- * @returns {Array} Returns the array of results.
398
- */
399
- function baseTimes(n, iteratee) {
400
- var index = -1,
401
- result = Array(n);
402
-
403
- while (++index < n) {
404
- result[index] = iteratee(index);
405
- }
406
- return result;
407
- }
408
-
409
- /**
410
- * The base implementation of `_.unary` without support for storing metadata.
411
- *
412
- * @private
413
- * @param {Function} func The function to cap arguments for.
414
- * @returns {Function} Returns the new capped function.
415
- */
416
- function baseUnary(func) {
417
- return function(value) {
418
- return func(value);
419
- };
420
- }
421
-
422
- /**
423
- * Gets the value at `key` of `object`.
424
- *
425
- * @private
426
- * @param {Object} [object] The object to query.
427
- * @param {string} key The key of the property to get.
428
- * @returns {*} Returns the property value.
429
- */
430
- function getValue(object, key) {
431
- return object == null ? undefined : object[key];
432
- }
433
-
434
- /**
435
- * Creates a unary function that invokes `func` with its argument transformed.
436
- *
437
- * @private
438
- * @param {Function} func The function to wrap.
439
- * @param {Function} transform The argument transform.
440
- * @returns {Function} Returns the new function.
441
- */
442
- function overArg(func, transform) {
443
- return function(arg) {
444
- return func(transform(arg));
445
- };
446
- }
447
-
448
- /** Used for built-in method references. */
449
- var arrayProto = Array.prototype,
450
- funcProto = Function.prototype,
451
- objectProto = Object.prototype;
452
-
453
- /** Used to detect overreaching core-js shims. */
454
- var coreJsData = root['__core-js_shared__'];
455
-
456
- /** Used to resolve the decompiled source of functions. */
457
- var funcToString = funcProto.toString;
458
-
459
- /** Used to check objects for own properties. */
460
- var hasOwnProperty = objectProto.hasOwnProperty;
461
-
462
- /** Used to detect methods masquerading as native. */
463
- var maskSrcKey = (function() {
464
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
465
- return uid ? ('Symbol(src)_1.' + uid) : '';
466
- }());
467
-
468
- /**
469
- * Used to resolve the
470
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
471
- * of values.
472
- */
473
- var nativeObjectToString = objectProto.toString;
474
-
475
- /** Used to infer the `Object` constructor. */
476
- var objectCtorString = funcToString.call(Object);
477
-
478
- /** Used to detect if a method is native. */
479
- var reIsNative = RegExp('^' +
480
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
481
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
482
- );
483
-
484
- /** Built-in value references. */
485
- var Buffer = moduleExports ? root.Buffer : undefined,
486
- Symbol = root.Symbol,
487
- Uint8Array = root.Uint8Array,
488
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
489
- getPrototype = overArg(Object.getPrototypeOf, Object),
490
- objectCreate = Object.create,
491
- propertyIsEnumerable = objectProto.propertyIsEnumerable,
492
- splice = arrayProto.splice,
493
- symToStringTag = Symbol ? Symbol.toStringTag : undefined;
494
-
495
- var defineProperty = (function() {
496
- try {
497
- var func = getNative(Object, 'defineProperty');
498
- func({}, '', {});
499
- return func;
500
- } catch (e) {}
501
- }());
502
-
503
- /* Built-in method references for those with the same name as other `lodash` methods. */
504
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
505
- nativeMax = Math.max,
506
- nativeNow = Date.now;
507
-
508
- /* Built-in method references that are verified to be native. */
509
- var Map = getNative(root, 'Map'),
510
- nativeCreate = getNative(Object, 'create');
511
-
512
- /**
513
- * The base implementation of `_.create` without support for assigning
514
- * properties to the created object.
515
- *
516
- * @private
517
- * @param {Object} proto The object to inherit from.
518
- * @returns {Object} Returns the new object.
519
- */
520
- var baseCreate = (function() {
521
- function object() {}
522
- return function(proto) {
523
- if (!isObject(proto)) {
524
- return {};
525
- }
526
- if (objectCreate) {
527
- return objectCreate(proto);
528
- }
529
- object.prototype = proto;
530
- var result = new object;
531
- object.prototype = undefined;
532
- return result;
533
- };
534
- }());
535
-
536
- /**
537
- * Creates a hash object.
538
- *
539
- * @private
540
- * @constructor
541
- * @param {Array} [entries] The key-value pairs to cache.
542
- */
543
- function Hash(entries) {
544
- var index = -1,
545
- length = entries == null ? 0 : entries.length;
546
-
547
- this.clear();
548
- while (++index < length) {
549
- var entry = entries[index];
550
- this.set(entry[0], entry[1]);
551
- }
552
- }
553
-
554
- /**
555
- * Removes all key-value entries from the hash.
556
- *
557
- * @private
558
- * @name clear
559
- * @memberOf Hash
560
- */
561
- function hashClear() {
562
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
563
- this.size = 0;
564
- }
565
-
566
- /**
567
- * Removes `key` and its value from the hash.
568
- *
569
- * @private
570
- * @name delete
571
- * @memberOf Hash
572
- * @param {Object} hash The hash to modify.
573
- * @param {string} key The key of the value to remove.
574
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
575
- */
576
- function hashDelete(key) {
577
- var result = this.has(key) && delete this.__data__[key];
578
- this.size -= result ? 1 : 0;
579
- return result;
580
- }
581
-
582
- /**
583
- * Gets the hash value for `key`.
584
- *
585
- * @private
586
- * @name get
587
- * @memberOf Hash
588
- * @param {string} key The key of the value to get.
589
- * @returns {*} Returns the entry value.
590
- */
591
- function hashGet(key) {
592
- var data = this.__data__;
593
- if (nativeCreate) {
594
- var result = data[key];
595
- return result === HASH_UNDEFINED ? undefined : result;
596
- }
597
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
598
- }
599
-
600
- /**
601
- * Checks if a hash value for `key` exists.
602
- *
603
- * @private
604
- * @name has
605
- * @memberOf Hash
606
- * @param {string} key The key of the entry to check.
607
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
608
- */
609
- function hashHas(key) {
610
- var data = this.__data__;
611
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
612
- }
613
-
614
- /**
615
- * Sets the hash `key` to `value`.
616
- *
617
- * @private
618
- * @name set
619
- * @memberOf Hash
620
- * @param {string} key The key of the value to set.
621
- * @param {*} value The value to set.
622
- * @returns {Object} Returns the hash instance.
623
- */
624
- function hashSet(key, value) {
625
- var data = this.__data__;
626
- this.size += this.has(key) ? 0 : 1;
627
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
628
- return this;
629
- }
630
-
631
- // Add methods to `Hash`.
632
- Hash.prototype.clear = hashClear;
633
- Hash.prototype['delete'] = hashDelete;
634
- Hash.prototype.get = hashGet;
635
- Hash.prototype.has = hashHas;
636
- Hash.prototype.set = hashSet;
637
-
638
- /**
639
- * Creates an list cache object.
640
- *
641
- * @private
642
- * @constructor
643
- * @param {Array} [entries] The key-value pairs to cache.
644
- */
645
- function ListCache(entries) {
646
- var index = -1,
647
- length = entries == null ? 0 : entries.length;
648
-
649
- this.clear();
650
- while (++index < length) {
651
- var entry = entries[index];
652
- this.set(entry[0], entry[1]);
653
- }
654
- }
655
-
656
- /**
657
- * Removes all key-value entries from the list cache.
658
- *
659
- * @private
660
- * @name clear
661
- * @memberOf ListCache
662
- */
663
- function listCacheClear() {
664
- this.__data__ = [];
665
- this.size = 0;
666
- }
667
-
668
- /**
669
- * Removes `key` and its value from the list cache.
670
- *
671
- * @private
672
- * @name delete
673
- * @memberOf ListCache
674
- * @param {string} key The key of the value to remove.
675
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
676
- */
677
- function listCacheDelete(key) {
678
- var data = this.__data__,
679
- index = assocIndexOf(data, key);
680
-
681
- if (index < 0) {
682
- return false;
683
- }
684
- var lastIndex = data.length - 1;
685
- if (index == lastIndex) {
686
- data.pop();
687
- } else {
688
- splice.call(data, index, 1);
689
- }
690
- --this.size;
691
- return true;
692
- }
693
-
694
- /**
695
- * Gets the list cache value for `key`.
696
- *
697
- * @private
698
- * @name get
699
- * @memberOf ListCache
700
- * @param {string} key The key of the value to get.
701
- * @returns {*} Returns the entry value.
702
- */
703
- function listCacheGet(key) {
704
- var data = this.__data__,
705
- index = assocIndexOf(data, key);
706
-
707
- return index < 0 ? undefined : data[index][1];
708
- }
709
-
710
- /**
711
- * Checks if a list cache value for `key` exists.
712
- *
713
- * @private
714
- * @name has
715
- * @memberOf ListCache
716
- * @param {string} key The key of the entry to check.
717
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
718
- */
719
- function listCacheHas(key) {
720
- return assocIndexOf(this.__data__, key) > -1;
721
- }
722
-
723
- /**
724
- * Sets the list cache `key` to `value`.
725
- *
726
- * @private
727
- * @name set
728
- * @memberOf ListCache
729
- * @param {string} key The key of the value to set.
730
- * @param {*} value The value to set.
731
- * @returns {Object} Returns the list cache instance.
732
- */
733
- function listCacheSet(key, value) {
734
- var data = this.__data__,
735
- index = assocIndexOf(data, key);
736
-
737
- if (index < 0) {
738
- ++this.size;
739
- data.push([key, value]);
740
- } else {
741
- data[index][1] = value;
742
- }
743
- return this;
744
- }
745
-
746
- // Add methods to `ListCache`.
747
- ListCache.prototype.clear = listCacheClear;
748
- ListCache.prototype['delete'] = listCacheDelete;
749
- ListCache.prototype.get = listCacheGet;
750
- ListCache.prototype.has = listCacheHas;
751
- ListCache.prototype.set = listCacheSet;
752
-
753
- /**
754
- * Creates a map cache object to store key-value pairs.
755
- *
756
- * @private
757
- * @constructor
758
- * @param {Array} [entries] The key-value pairs to cache.
759
- */
760
- function MapCache(entries) {
761
- var index = -1,
762
- length = entries == null ? 0 : entries.length;
763
-
764
- this.clear();
765
- while (++index < length) {
766
- var entry = entries[index];
767
- this.set(entry[0], entry[1]);
768
- }
769
- }
770
-
771
- /**
772
- * Removes all key-value entries from the map.
773
- *
774
- * @private
775
- * @name clear
776
- * @memberOf MapCache
777
- */
778
- function mapCacheClear() {
779
- this.size = 0;
780
- this.__data__ = {
781
- 'hash': new Hash,
782
- 'map': new (Map || ListCache),
783
- 'string': new Hash
784
- };
785
- }
786
-
787
- /**
788
- * Removes `key` and its value from the map.
789
- *
790
- * @private
791
- * @name delete
792
- * @memberOf MapCache
793
- * @param {string} key The key of the value to remove.
794
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
795
- */
796
- function mapCacheDelete(key) {
797
- var result = getMapData(this, key)['delete'](key);
798
- this.size -= result ? 1 : 0;
799
- return result;
800
- }
801
-
802
- /**
803
- * Gets the map value for `key`.
804
- *
805
- * @private
806
- * @name get
807
- * @memberOf MapCache
808
- * @param {string} key The key of the value to get.
809
- * @returns {*} Returns the entry value.
810
- */
811
- function mapCacheGet(key) {
812
- return getMapData(this, key).get(key);
813
- }
814
-
815
- /**
816
- * Checks if a map value for `key` exists.
817
- *
818
- * @private
819
- * @name has
820
- * @memberOf MapCache
821
- * @param {string} key The key of the entry to check.
822
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
823
- */
824
- function mapCacheHas(key) {
825
- return getMapData(this, key).has(key);
826
- }
827
-
828
- /**
829
- * Sets the map `key` to `value`.
830
- *
831
- * @private
832
- * @name set
833
- * @memberOf MapCache
834
- * @param {string} key The key of the value to set.
835
- * @param {*} value The value to set.
836
- * @returns {Object} Returns the map cache instance.
837
- */
838
- function mapCacheSet(key, value) {
839
- var data = getMapData(this, key),
840
- size = data.size;
841
-
842
- data.set(key, value);
843
- this.size += data.size == size ? 0 : 1;
844
- return this;
845
- }
846
-
847
- // Add methods to `MapCache`.
848
- MapCache.prototype.clear = mapCacheClear;
849
- MapCache.prototype['delete'] = mapCacheDelete;
850
- MapCache.prototype.get = mapCacheGet;
851
- MapCache.prototype.has = mapCacheHas;
852
- MapCache.prototype.set = mapCacheSet;
853
-
854
- /**
855
- * Creates a stack cache object to store key-value pairs.
856
- *
857
- * @private
858
- * @constructor
859
- * @param {Array} [entries] The key-value pairs to cache.
860
- */
861
- function Stack(entries) {
862
- var data = this.__data__ = new ListCache(entries);
863
- this.size = data.size;
864
- }
865
-
866
- /**
867
- * Removes all key-value entries from the stack.
868
- *
869
- * @private
870
- * @name clear
871
- * @memberOf Stack
872
- */
873
- function stackClear() {
874
- this.__data__ = new ListCache;
875
- this.size = 0;
876
- }
877
-
878
- /**
879
- * Removes `key` and its value from the stack.
880
- *
881
- * @private
882
- * @name delete
883
- * @memberOf Stack
884
- * @param {string} key The key of the value to remove.
885
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
886
- */
887
- function stackDelete(key) {
888
- var data = this.__data__,
889
- result = data['delete'](key);
890
-
891
- this.size = data.size;
892
- return result;
893
- }
894
-
895
- /**
896
- * Gets the stack value for `key`.
897
- *
898
- * @private
899
- * @name get
900
- * @memberOf Stack
901
- * @param {string} key The key of the value to get.
902
- * @returns {*} Returns the entry value.
903
- */
904
- function stackGet(key) {
905
- return this.__data__.get(key);
906
- }
907
-
908
- /**
909
- * Checks if a stack value for `key` exists.
910
- *
911
- * @private
912
- * @name has
913
- * @memberOf Stack
914
- * @param {string} key The key of the entry to check.
915
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
916
- */
917
- function stackHas(key) {
918
- return this.__data__.has(key);
919
- }
920
-
921
- /**
922
- * Sets the stack `key` to `value`.
923
- *
924
- * @private
925
- * @name set
926
- * @memberOf Stack
927
- * @param {string} key The key of the value to set.
928
- * @param {*} value The value to set.
929
- * @returns {Object} Returns the stack cache instance.
930
- */
931
- function stackSet(key, value) {
932
- var data = this.__data__;
933
- if (data instanceof ListCache) {
934
- var pairs = data.__data__;
935
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
936
- pairs.push([key, value]);
937
- this.size = ++data.size;
938
- return this;
939
- }
940
- data = this.__data__ = new MapCache(pairs);
941
- }
942
- data.set(key, value);
943
- this.size = data.size;
944
- return this;
945
- }
946
-
947
- // Add methods to `Stack`.
948
- Stack.prototype.clear = stackClear;
949
- Stack.prototype['delete'] = stackDelete;
950
- Stack.prototype.get = stackGet;
951
- Stack.prototype.has = stackHas;
952
- Stack.prototype.set = stackSet;
953
-
954
- /**
955
- * Creates an array of the enumerable property names of the array-like `value`.
956
- *
957
- * @private
958
- * @param {*} value The value to query.
959
- * @param {boolean} inherited Specify returning inherited property names.
960
- * @returns {Array} Returns the array of property names.
961
- */
962
- function arrayLikeKeys(value, inherited) {
963
- var isArr = isArray(value),
964
- isArg = !isArr && isArguments(value),
965
- isBuff = !isArr && !isArg && isBuffer(value),
966
- isType = !isArr && !isArg && !isBuff && isTypedArray(value),
967
- skipIndexes = isArr || isArg || isBuff || isType,
968
- result = skipIndexes ? baseTimes(value.length, String) : [],
969
- length = result.length;
970
-
971
- for (var key in value) {
972
- if ((inherited || hasOwnProperty.call(value, key)) &&
973
- !(skipIndexes && (
974
- // Safari 9 has enumerable `arguments.length` in strict mode.
975
- key == 'length' ||
976
- // Node.js 0.10 has enumerable non-index properties on buffers.
977
- (isBuff && (key == 'offset' || key == 'parent')) ||
978
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
979
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
980
- // Skip index properties.
981
- isIndex(key, length)
982
- ))) {
983
- result.push(key);
984
- }
985
- }
986
- return result;
987
- }
988
-
989
- /**
990
- * This function is like `assignValue` except that it doesn't assign
991
- * `undefined` values.
992
- *
993
- * @private
994
- * @param {Object} object The object to modify.
995
- * @param {string} key The key of the property to assign.
996
- * @param {*} value The value to assign.
997
- */
998
- function assignMergeValue(object, key, value) {
999
- if ((value !== undefined && !eq(object[key], value)) ||
1000
- (value === undefined && !(key in object))) {
1001
- baseAssignValue(object, key, value);
1002
- }
1003
- }
1004
-
1005
- /**
1006
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
1007
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1008
- * for equality comparisons.
1009
- *
1010
- * @private
1011
- * @param {Object} object The object to modify.
1012
- * @param {string} key The key of the property to assign.
1013
- * @param {*} value The value to assign.
1014
- */
1015
- function assignValue(object, key, value) {
1016
- var objValue = object[key];
1017
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
1018
- (value === undefined && !(key in object))) {
1019
- baseAssignValue(object, key, value);
1020
- }
1021
- }
1022
-
1023
- /**
1024
- * Gets the index at which the `key` is found in `array` of key-value pairs.
1025
- *
1026
- * @private
1027
- * @param {Array} array The array to inspect.
1028
- * @param {*} key The key to search for.
1029
- * @returns {number} Returns the index of the matched value, else `-1`.
1030
- */
1031
- function assocIndexOf(array, key) {
1032
- var length = array.length;
1033
- while (length--) {
1034
- if (eq(array[length][0], key)) {
1035
- return length;
1036
- }
1037
- }
1038
- return -1;
1039
- }
1040
-
1041
- /**
1042
- * The base implementation of `assignValue` and `assignMergeValue` without
1043
- * value checks.
1044
- *
1045
- * @private
1046
- * @param {Object} object The object to modify.
1047
- * @param {string} key The key of the property to assign.
1048
- * @param {*} value The value to assign.
1049
- */
1050
- function baseAssignValue(object, key, value) {
1051
- if (key == '__proto__' && defineProperty) {
1052
- defineProperty(object, key, {
1053
- 'configurable': true,
1054
- 'enumerable': true,
1055
- 'value': value,
1056
- 'writable': true
1057
- });
1058
- } else {
1059
- object[key] = value;
1060
- }
1061
- }
1062
-
1063
- /**
1064
- * The base implementation of `baseForOwn` which iterates over `object`
1065
- * properties returned by `keysFunc` and invokes `iteratee` for each property.
1066
- * Iteratee functions may exit iteration early by explicitly returning `false`.
1067
- *
1068
- * @private
1069
- * @param {Object} object The object to iterate over.
1070
- * @param {Function} iteratee The function invoked per iteration.
1071
- * @param {Function} keysFunc The function to get the keys of `object`.
1072
- * @returns {Object} Returns `object`.
1073
- */
1074
- var baseFor = createBaseFor();
1075
-
1076
- /**
1077
- * The base implementation of `getTag` without fallbacks for buggy environments.
1078
- *
1079
- * @private
1080
- * @param {*} value The value to query.
1081
- * @returns {string} Returns the `toStringTag`.
1082
- */
1083
- function baseGetTag(value) {
1084
- if (value == null) {
1085
- return value === undefined ? undefinedTag : nullTag;
1086
- }
1087
- return (symToStringTag && symToStringTag in Object(value))
1088
- ? getRawTag(value)
1089
- : objectToString(value);
1090
- }
1091
-
1092
- /**
1093
- * The base implementation of `_.isArguments`.
1094
- *
1095
- * @private
1096
- * @param {*} value The value to check.
1097
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1098
- */
1099
- function baseIsArguments(value) {
1100
- return isObjectLike(value) && baseGetTag(value) == argsTag;
1101
- }
1102
-
1103
- /**
1104
- * The base implementation of `_.isNative` without bad shim checks.
1105
- *
1106
- * @private
1107
- * @param {*} value The value to check.
1108
- * @returns {boolean} Returns `true` if `value` is a native function,
1109
- * else `false`.
1110
- */
1111
- function baseIsNative(value) {
1112
- if (!isObject(value) || isMasked(value)) {
1113
- return false;
1114
- }
1115
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
1116
- return pattern.test(toSource(value));
1117
- }
1118
-
1119
- /**
1120
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
1121
- *
1122
- * @private
1123
- * @param {*} value The value to check.
1124
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1125
- */
1126
- function baseIsTypedArray(value) {
1127
- return isObjectLike(value) &&
1128
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1129
- }
1130
-
1131
- /**
1132
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
1133
- *
1134
- * @private
1135
- * @param {Object} object The object to query.
1136
- * @returns {Array} Returns the array of property names.
1137
- */
1138
- function baseKeysIn(object) {
1139
- if (!isObject(object)) {
1140
- return nativeKeysIn(object);
1141
- }
1142
- var isProto = isPrototype(object),
1143
- result = [];
1144
-
1145
- for (var key in object) {
1146
- if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
1147
- result.push(key);
1148
- }
1149
- }
1150
- return result;
1151
- }
1152
-
1153
- /**
1154
- * The base implementation of `_.merge` without support for multiple sources.
1155
- *
1156
- * @private
1157
- * @param {Object} object The destination object.
1158
- * @param {Object} source The source object.
1159
- * @param {number} srcIndex The index of `source`.
1160
- * @param {Function} [customizer] The function to customize merged values.
1161
- * @param {Object} [stack] Tracks traversed source values and their merged
1162
- * counterparts.
1163
- */
1164
- function baseMerge(object, source, srcIndex, customizer, stack) {
1165
- if (object === source) {
1166
- return;
1167
- }
1168
- baseFor(source, function(srcValue, key) {
1169
- stack || (stack = new Stack);
1170
- if (isObject(srcValue)) {
1171
- baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
1172
- }
1173
- else {
1174
- var newValue = customizer
1175
- ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
1176
- : undefined;
1177
-
1178
- if (newValue === undefined) {
1179
- newValue = srcValue;
1180
- }
1181
- assignMergeValue(object, key, newValue);
1182
- }
1183
- }, keysIn);
1184
- }
1185
-
1186
- /**
1187
- * A specialized version of `baseMerge` for arrays and objects which performs
1188
- * deep merges and tracks traversed objects enabling objects with circular
1189
- * references to be merged.
1190
- *
1191
- * @private
1192
- * @param {Object} object The destination object.
1193
- * @param {Object} source The source object.
1194
- * @param {string} key The key of the value to merge.
1195
- * @param {number} srcIndex The index of `source`.
1196
- * @param {Function} mergeFunc The function to merge values.
1197
- * @param {Function} [customizer] The function to customize assigned values.
1198
- * @param {Object} [stack] Tracks traversed source values and their merged
1199
- * counterparts.
1200
- */
1201
- function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
1202
- var objValue = safeGet(object, key),
1203
- srcValue = safeGet(source, key),
1204
- stacked = stack.get(srcValue);
1205
-
1206
- if (stacked) {
1207
- assignMergeValue(object, key, stacked);
1208
- return;
1209
- }
1210
- var newValue = customizer
1211
- ? customizer(objValue, srcValue, (key + ''), object, source, stack)
1212
- : undefined;
1213
-
1214
- var isCommon = newValue === undefined;
1215
-
1216
- if (isCommon) {
1217
- var isArr = isArray(srcValue),
1218
- isBuff = !isArr && isBuffer(srcValue),
1219
- isTyped = !isArr && !isBuff && isTypedArray(srcValue);
1220
-
1221
- newValue = srcValue;
1222
- if (isArr || isBuff || isTyped) {
1223
- if (isArray(objValue)) {
1224
- newValue = objValue;
1225
- }
1226
- else if (isArrayLikeObject(objValue)) {
1227
- newValue = copyArray(objValue);
1228
- }
1229
- else if (isBuff) {
1230
- isCommon = false;
1231
- newValue = cloneBuffer(srcValue, true);
1232
- }
1233
- else if (isTyped) {
1234
- isCommon = false;
1235
- newValue = cloneTypedArray(srcValue, true);
1236
- }
1237
- else {
1238
- newValue = [];
1239
- }
1240
- }
1241
- else if (isPlainObject(srcValue) || isArguments(srcValue)) {
1242
- newValue = objValue;
1243
- if (isArguments(objValue)) {
1244
- newValue = toPlainObject(objValue);
1245
- }
1246
- else if (!isObject(objValue) || isFunction(objValue)) {
1247
- newValue = initCloneObject(srcValue);
1248
- }
1249
- }
1250
- else {
1251
- isCommon = false;
1252
- }
1253
- }
1254
- if (isCommon) {
1255
- // Recursively merge objects and arrays (susceptible to call stack limits).
1256
- stack.set(srcValue, newValue);
1257
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
1258
- stack['delete'](srcValue);
1259
- }
1260
- assignMergeValue(object, key, newValue);
1261
- }
1262
-
1263
- /**
1264
- * The base implementation of `_.rest` which doesn't validate or coerce arguments.
1265
- *
1266
- * @private
1267
- * @param {Function} func The function to apply a rest parameter to.
1268
- * @param {number} [start=func.length-1] The start position of the rest parameter.
1269
- * @returns {Function} Returns the new function.
1270
- */
1271
- function baseRest(func, start) {
1272
- return setToString(overRest(func, start, identity), func + '');
1273
- }
1274
-
1275
- /**
1276
- * The base implementation of `setToString` without support for hot loop shorting.
1277
- *
1278
- * @private
1279
- * @param {Function} func The function to modify.
1280
- * @param {Function} string The `toString` result.
1281
- * @returns {Function} Returns `func`.
1282
- */
1283
- var baseSetToString = !defineProperty ? identity : function(func, string) {
1284
- return defineProperty(func, 'toString', {
1285
- 'configurable': true,
1286
- 'enumerable': false,
1287
- 'value': constant(string),
1288
- 'writable': true
1289
- });
1290
- };
1291
-
1292
- /**
1293
- * Creates a clone of `buffer`.
1294
- *
1295
- * @private
1296
- * @param {Buffer} buffer The buffer to clone.
1297
- * @param {boolean} [isDeep] Specify a deep clone.
1298
- * @returns {Buffer} Returns the cloned buffer.
1299
- */
1300
- function cloneBuffer(buffer, isDeep) {
1301
- if (isDeep) {
1302
- return buffer.slice();
1303
- }
1304
- var length = buffer.length,
1305
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1306
-
1307
- buffer.copy(result);
1308
- return result;
1309
- }
1310
-
1311
- /**
1312
- * Creates a clone of `arrayBuffer`.
1313
- *
1314
- * @private
1315
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
1316
- * @returns {ArrayBuffer} Returns the cloned array buffer.
1317
- */
1318
- function cloneArrayBuffer(arrayBuffer) {
1319
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1320
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
1321
- return result;
1322
- }
1323
-
1324
- /**
1325
- * Creates a clone of `typedArray`.
1326
- *
1327
- * @private
1328
- * @param {Object} typedArray The typed array to clone.
1329
- * @param {boolean} [isDeep] Specify a deep clone.
1330
- * @returns {Object} Returns the cloned typed array.
1331
- */
1332
- function cloneTypedArray(typedArray, isDeep) {
1333
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
1334
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
1335
- }
1336
-
1337
- /**
1338
- * Copies the values of `source` to `array`.
1339
- *
1340
- * @private
1341
- * @param {Array} source The array to copy values from.
1342
- * @param {Array} [array=[]] The array to copy values to.
1343
- * @returns {Array} Returns `array`.
1344
- */
1345
- function copyArray(source, array) {
1346
- var index = -1,
1347
- length = source.length;
1348
-
1349
- array || (array = Array(length));
1350
- while (++index < length) {
1351
- array[index] = source[index];
1352
- }
1353
- return array;
1354
- }
1355
-
1356
- /**
1357
- * Copies properties of `source` to `object`.
1358
- *
1359
- * @private
1360
- * @param {Object} source The object to copy properties from.
1361
- * @param {Array} props The property identifiers to copy.
1362
- * @param {Object} [object={}] The object to copy properties to.
1363
- * @param {Function} [customizer] The function to customize copied values.
1364
- * @returns {Object} Returns `object`.
1365
- */
1366
- function copyObject(source, props, object, customizer) {
1367
- var isNew = !object;
1368
- object || (object = {});
1369
-
1370
- var index = -1,
1371
- length = props.length;
1372
-
1373
- while (++index < length) {
1374
- var key = props[index];
1375
-
1376
- var newValue = customizer
1377
- ? customizer(object[key], source[key], key, object, source)
1378
- : undefined;
1379
-
1380
- if (newValue === undefined) {
1381
- newValue = source[key];
1382
- }
1383
- if (isNew) {
1384
- baseAssignValue(object, key, newValue);
1385
- } else {
1386
- assignValue(object, key, newValue);
1387
- }
1388
- }
1389
- return object;
1390
- }
1391
-
1392
- /**
1393
- * Creates a function like `_.assign`.
1394
- *
1395
- * @private
1396
- * @param {Function} assigner The function to assign values.
1397
- * @returns {Function} Returns the new assigner function.
1398
- */
1399
- function createAssigner(assigner) {
1400
- return baseRest(function(object, sources) {
1401
- var index = -1,
1402
- length = sources.length,
1403
- customizer = length > 1 ? sources[length - 1] : undefined,
1404
- guard = length > 2 ? sources[2] : undefined;
1405
-
1406
- customizer = (assigner.length > 3 && typeof customizer == 'function')
1407
- ? (length--, customizer)
1408
- : undefined;
1409
-
1410
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
1411
- customizer = length < 3 ? undefined : customizer;
1412
- length = 1;
1413
- }
1414
- object = Object(object);
1415
- while (++index < length) {
1416
- var source = sources[index];
1417
- if (source) {
1418
- assigner(object, source, index, customizer);
1419
- }
1420
- }
1421
- return object;
1422
- });
1423
- }
1424
-
1425
- /**
1426
- * Creates a base function for methods like `_.forIn` and `_.forOwn`.
1427
- *
1428
- * @private
1429
- * @param {boolean} [fromRight] Specify iterating from right to left.
1430
- * @returns {Function} Returns the new base function.
1431
- */
1432
- function createBaseFor(fromRight) {
1433
- return function(object, iteratee, keysFunc) {
1434
- var index = -1,
1435
- iterable = Object(object),
1436
- props = keysFunc(object),
1437
- length = props.length;
1438
-
1439
- while (length--) {
1440
- var key = props[fromRight ? length : ++index];
1441
- if (iteratee(iterable[key], key, iterable) === false) {
1442
- break;
1443
- }
1444
- }
1445
- return object;
1446
- };
1447
- }
1448
-
1449
- /**
1450
- * Gets the data for `map`.
1451
- *
1452
- * @private
1453
- * @param {Object} map The map to query.
1454
- * @param {string} key The reference key.
1455
- * @returns {*} Returns the map data.
1456
- */
1457
- function getMapData(map, key) {
1458
- var data = map.__data__;
1459
- return isKeyable(key)
1460
- ? data[typeof key == 'string' ? 'string' : 'hash']
1461
- : data.map;
1462
- }
1463
-
1464
- /**
1465
- * Gets the native function at `key` of `object`.
1466
- *
1467
- * @private
1468
- * @param {Object} object The object to query.
1469
- * @param {string} key The key of the method to get.
1470
- * @returns {*} Returns the function if it's native, else `undefined`.
1471
- */
1472
- function getNative(object, key) {
1473
- var value = getValue(object, key);
1474
- return baseIsNative(value) ? value : undefined;
1475
- }
1476
-
1477
- /**
1478
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
1479
- *
1480
- * @private
1481
- * @param {*} value The value to query.
1482
- * @returns {string} Returns the raw `toStringTag`.
1483
- */
1484
- function getRawTag(value) {
1485
- var isOwn = hasOwnProperty.call(value, symToStringTag),
1486
- tag = value[symToStringTag];
1487
-
1488
- try {
1489
- value[symToStringTag] = undefined;
1490
- var unmasked = true;
1491
- } catch (e) {}
1492
-
1493
- var result = nativeObjectToString.call(value);
1494
- if (unmasked) {
1495
- if (isOwn) {
1496
- value[symToStringTag] = tag;
1497
- } else {
1498
- delete value[symToStringTag];
1499
- }
1500
- }
1501
- return result;
1502
- }
1503
-
1504
- /**
1505
- * Initializes an object clone.
1506
- *
1507
- * @private
1508
- * @param {Object} object The object to clone.
1509
- * @returns {Object} Returns the initialized clone.
1510
- */
1511
- function initCloneObject(object) {
1512
- return (typeof object.constructor == 'function' && !isPrototype(object))
1513
- ? baseCreate(getPrototype(object))
1514
- : {};
1515
- }
1516
-
1517
- /**
1518
- * Checks if `value` is a valid array-like index.
1519
- *
1520
- * @private
1521
- * @param {*} value The value to check.
1522
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1523
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1524
- */
1525
- function isIndex(value, length) {
1526
- var type = typeof value;
1527
- length = length == null ? MAX_SAFE_INTEGER : length;
1528
-
1529
- return !!length &&
1530
- (type == 'number' ||
1531
- (type != 'symbol' && reIsUint.test(value))) &&
1532
- (value > -1 && value % 1 == 0 && value < length);
1533
- }
1534
-
1535
- /**
1536
- * Checks if the given arguments are from an iteratee call.
1537
- *
1538
- * @private
1539
- * @param {*} value The potential iteratee value argument.
1540
- * @param {*} index The potential iteratee index or key argument.
1541
- * @param {*} object The potential iteratee object argument.
1542
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
1543
- * else `false`.
1544
- */
1545
- function isIterateeCall(value, index, object) {
1546
- if (!isObject(object)) {
1547
- return false;
1548
- }
1549
- var type = typeof index;
1550
- if (type == 'number'
1551
- ? (isArrayLike(object) && isIndex(index, object.length))
1552
- : (type == 'string' && index in object)
1553
- ) {
1554
- return eq(object[index], value);
1555
- }
1556
- return false;
1557
- }
1558
-
1559
- /**
1560
- * Checks if `value` is suitable for use as unique object key.
1561
- *
1562
- * @private
1563
- * @param {*} value The value to check.
1564
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1565
- */
1566
- function isKeyable(value) {
1567
- var type = typeof value;
1568
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1569
- ? (value !== '__proto__')
1570
- : (value === null);
1571
- }
1572
-
1573
- /**
1574
- * Checks if `func` has its source masked.
1575
- *
1576
- * @private
1577
- * @param {Function} func The function to check.
1578
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1579
- */
1580
- function isMasked(func) {
1581
- return !!maskSrcKey && (maskSrcKey in func);
1582
- }
1583
-
1584
- /**
1585
- * Checks if `value` is likely a prototype object.
1586
- *
1587
- * @private
1588
- * @param {*} value The value to check.
1589
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1590
- */
1591
- function isPrototype(value) {
1592
- var Ctor = value && value.constructor,
1593
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
1594
-
1595
- return value === proto;
1596
- }
1597
-
1598
- /**
1599
- * This function is like
1600
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1601
- * except that it includes inherited enumerable properties.
1602
- *
1603
- * @private
1604
- * @param {Object} object The object to query.
1605
- * @returns {Array} Returns the array of property names.
1606
- */
1607
- function nativeKeysIn(object) {
1608
- var result = [];
1609
- if (object != null) {
1610
- for (var key in Object(object)) {
1611
- result.push(key);
1612
- }
1613
- }
1614
- return result;
1615
- }
1616
-
1617
- /**
1618
- * Converts `value` to a string using `Object.prototype.toString`.
1619
- *
1620
- * @private
1621
- * @param {*} value The value to convert.
1622
- * @returns {string} Returns the converted string.
1623
- */
1624
- function objectToString(value) {
1625
- return nativeObjectToString.call(value);
1626
- }
1627
-
1628
- /**
1629
- * A specialized version of `baseRest` which transforms the rest array.
1630
- *
1631
- * @private
1632
- * @param {Function} func The function to apply a rest parameter to.
1633
- * @param {number} [start=func.length-1] The start position of the rest parameter.
1634
- * @param {Function} transform The rest array transform.
1635
- * @returns {Function} Returns the new function.
1636
- */
1637
- function overRest(func, start, transform) {
1638
- start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
1639
- return function() {
1640
- var args = arguments,
1641
- index = -1,
1642
- length = nativeMax(args.length - start, 0),
1643
- array = Array(length);
1644
-
1645
- while (++index < length) {
1646
- array[index] = args[start + index];
1647
- }
1648
- index = -1;
1649
- var otherArgs = Array(start + 1);
1650
- while (++index < start) {
1651
- otherArgs[index] = args[index];
1652
- }
1653
- otherArgs[start] = transform(array);
1654
- return apply(func, this, otherArgs);
1655
- };
1656
- }
1657
-
1658
- /**
1659
- * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
1660
- *
1661
- * @private
1662
- * @param {Object} object The object to query.
1663
- * @param {string} key The key of the property to get.
1664
- * @returns {*} Returns the property value.
1665
- */
1666
- function safeGet(object, key) {
1667
- if (key === 'constructor' && typeof object[key] === 'function') {
1668
- return;
1669
- }
1670
-
1671
- if (key == '__proto__') {
1672
- return;
1673
- }
1674
-
1675
- return object[key];
1676
- }
1677
-
1678
- /**
1679
- * Sets the `toString` method of `func` to return `string`.
1680
- *
1681
- * @private
1682
- * @param {Function} func The function to modify.
1683
- * @param {Function} string The `toString` result.
1684
- * @returns {Function} Returns `func`.
1685
- */
1686
- var setToString = shortOut(baseSetToString);
1687
-
1688
- /**
1689
- * Creates a function that'll short out and invoke `identity` instead
1690
- * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
1691
- * milliseconds.
1692
- *
1693
- * @private
1694
- * @param {Function} func The function to restrict.
1695
- * @returns {Function} Returns the new shortable function.
1696
- */
1697
- function shortOut(func) {
1698
- var count = 0,
1699
- lastCalled = 0;
1700
-
1701
- return function() {
1702
- var stamp = nativeNow(),
1703
- remaining = HOT_SPAN - (stamp - lastCalled);
1704
-
1705
- lastCalled = stamp;
1706
- if (remaining > 0) {
1707
- if (++count >= HOT_COUNT) {
1708
- return arguments[0];
1709
- }
1710
- } else {
1711
- count = 0;
1712
- }
1713
- return func.apply(undefined, arguments);
1714
- };
1715
- }
1716
-
1717
- /**
1718
- * Converts `func` to its source code.
1719
- *
1720
- * @private
1721
- * @param {Function} func The function to convert.
1722
- * @returns {string} Returns the source code.
1723
- */
1724
- function toSource(func) {
1725
- if (func != null) {
1726
- try {
1727
- return funcToString.call(func);
1728
- } catch (e) {}
1729
- try {
1730
- return (func + '');
1731
- } catch (e) {}
1732
- }
1733
- return '';
1734
- }
1735
-
1736
- /**
1737
- * Performs a
1738
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1739
- * comparison between two values to determine if they are equivalent.
1740
- *
1741
- * @static
1742
- * @memberOf _
1743
- * @since 4.0.0
1744
- * @category Lang
1745
- * @param {*} value The value to compare.
1746
- * @param {*} other The other value to compare.
1747
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1748
- * @example
1749
- *
1750
- * var object = { 'a': 1 };
1751
- * var other = { 'a': 1 };
1752
- *
1753
- * _.eq(object, object);
1754
- * // => true
1755
- *
1756
- * _.eq(object, other);
1757
- * // => false
1758
- *
1759
- * _.eq('a', 'a');
1760
- * // => true
1761
- *
1762
- * _.eq('a', Object('a'));
1763
- * // => false
1764
- *
1765
- * _.eq(NaN, NaN);
1766
- * // => true
1767
- */
1768
- function eq(value, other) {
1769
- return value === other || (value !== value && other !== other);
1770
- }
1771
-
1772
- /**
1773
- * Checks if `value` is likely an `arguments` object.
1774
- *
1775
- * @static
1776
- * @memberOf _
1777
- * @since 0.1.0
1778
- * @category Lang
1779
- * @param {*} value The value to check.
1780
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1781
- * else `false`.
1782
- * @example
1783
- *
1784
- * _.isArguments(function() { return arguments; }());
1785
- * // => true
1786
- *
1787
- * _.isArguments([1, 2, 3]);
1788
- * // => false
1789
- */
1790
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
1791
- return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
1792
- !propertyIsEnumerable.call(value, 'callee');
1793
- };
1794
-
1795
- /**
1796
- * Checks if `value` is classified as an `Array` object.
1797
- *
1798
- * @static
1799
- * @memberOf _
1800
- * @since 0.1.0
1801
- * @category Lang
1802
- * @param {*} value The value to check.
1803
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1804
- * @example
1805
- *
1806
- * _.isArray([1, 2, 3]);
1807
- * // => true
1808
- *
1809
- * _.isArray(document.body.children);
1810
- * // => false
1811
- *
1812
- * _.isArray('abc');
1813
- * // => false
1814
- *
1815
- * _.isArray(_.noop);
1816
- * // => false
1817
- */
1818
- var isArray = Array.isArray;
1819
-
1820
- /**
1821
- * Checks if `value` is array-like. A value is considered array-like if it's
1822
- * not a function and has a `value.length` that's an integer greater than or
1823
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1824
- *
1825
- * @static
1826
- * @memberOf _
1827
- * @since 4.0.0
1828
- * @category Lang
1829
- * @param {*} value The value to check.
1830
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1831
- * @example
1832
- *
1833
- * _.isArrayLike([1, 2, 3]);
1834
- * // => true
1835
- *
1836
- * _.isArrayLike(document.body.children);
1837
- * // => true
1838
- *
1839
- * _.isArrayLike('abc');
1840
- * // => true
1841
- *
1842
- * _.isArrayLike(_.noop);
1843
- * // => false
1844
- */
1845
- function isArrayLike(value) {
1846
- return value != null && isLength(value.length) && !isFunction(value);
1847
- }
1848
-
1849
- /**
1850
- * This method is like `_.isArrayLike` except that it also checks if `value`
1851
- * is an object.
1852
- *
1853
- * @static
1854
- * @memberOf _
1855
- * @since 4.0.0
1856
- * @category Lang
1857
- * @param {*} value The value to check.
1858
- * @returns {boolean} Returns `true` if `value` is an array-like object,
1859
- * else `false`.
1860
- * @example
1861
- *
1862
- * _.isArrayLikeObject([1, 2, 3]);
1863
- * // => true
1864
- *
1865
- * _.isArrayLikeObject(document.body.children);
1866
- * // => true
1867
- *
1868
- * _.isArrayLikeObject('abc');
1869
- * // => false
1870
- *
1871
- * _.isArrayLikeObject(_.noop);
1872
- * // => false
1873
- */
1874
- function isArrayLikeObject(value) {
1875
- return isObjectLike(value) && isArrayLike(value);
1876
- }
1877
-
1878
- /**
1879
- * Checks if `value` is a buffer.
1880
- *
1881
- * @static
1882
- * @memberOf _
1883
- * @since 4.3.0
1884
- * @category Lang
1885
- * @param {*} value The value to check.
1886
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1887
- * @example
1888
- *
1889
- * _.isBuffer(new Buffer(2));
1890
- * // => true
1891
- *
1892
- * _.isBuffer(new Uint8Array(2));
1893
- * // => false
1894
- */
1895
- var isBuffer = nativeIsBuffer || stubFalse;
1896
-
1897
- /**
1898
- * Checks if `value` is classified as a `Function` object.
1899
- *
1900
- * @static
1901
- * @memberOf _
1902
- * @since 0.1.0
1903
- * @category Lang
1904
- * @param {*} value The value to check.
1905
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1906
- * @example
1907
- *
1908
- * _.isFunction(_);
1909
- * // => true
1910
- *
1911
- * _.isFunction(/abc/);
1912
- * // => false
1913
- */
1914
- function isFunction(value) {
1915
- if (!isObject(value)) {
1916
- return false;
1917
- }
1918
- // The use of `Object#toString` avoids issues with the `typeof` operator
1919
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
1920
- var tag = baseGetTag(value);
1921
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1922
- }
1923
-
1924
- /**
1925
- * Checks if `value` is a valid array-like length.
1926
- *
1927
- * **Note:** This method is loosely based on
1928
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1929
- *
1930
- * @static
1931
- * @memberOf _
1932
- * @since 4.0.0
1933
- * @category Lang
1934
- * @param {*} value The value to check.
1935
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1936
- * @example
1937
- *
1938
- * _.isLength(3);
1939
- * // => true
1940
- *
1941
- * _.isLength(Number.MIN_VALUE);
1942
- * // => false
1943
- *
1944
- * _.isLength(Infinity);
1945
- * // => false
1946
- *
1947
- * _.isLength('3');
1948
- * // => false
1949
- */
1950
- function isLength(value) {
1951
- return typeof value == 'number' &&
1952
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1953
- }
1954
-
1955
- /**
1956
- * Checks if `value` is the
1957
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1958
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1959
- *
1960
- * @static
1961
- * @memberOf _
1962
- * @since 0.1.0
1963
- * @category Lang
1964
- * @param {*} value The value to check.
1965
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1966
- * @example
1967
- *
1968
- * _.isObject({});
1969
- * // => true
1970
- *
1971
- * _.isObject([1, 2, 3]);
1972
- * // => true
1973
- *
1974
- * _.isObject(_.noop);
1975
- * // => true
1976
- *
1977
- * _.isObject(null);
1978
- * // => false
1979
- */
1980
- function isObject(value) {
1981
- var type = typeof value;
1982
- return value != null && (type == 'object' || type == 'function');
1983
- }
1984
-
1985
- /**
1986
- * Checks if `value` is object-like. A value is object-like if it's not `null`
1987
- * and has a `typeof` result of "object".
1988
- *
1989
- * @static
1990
- * @memberOf _
1991
- * @since 4.0.0
1992
- * @category Lang
1993
- * @param {*} value The value to check.
1994
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1995
- * @example
1996
- *
1997
- * _.isObjectLike({});
1998
- * // => true
1999
- *
2000
- * _.isObjectLike([1, 2, 3]);
2001
- * // => true
2002
- *
2003
- * _.isObjectLike(_.noop);
2004
- * // => false
2005
- *
2006
- * _.isObjectLike(null);
2007
- * // => false
2008
- */
2009
- function isObjectLike(value) {
2010
- return value != null && typeof value == 'object';
2011
- }
2012
-
2013
- /**
2014
- * Checks if `value` is a plain object, that is, an object created by the
2015
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
2016
- *
2017
- * @static
2018
- * @memberOf _
2019
- * @since 0.8.0
2020
- * @category Lang
2021
- * @param {*} value The value to check.
2022
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
2023
- * @example
2024
- *
2025
- * function Foo() {
2026
- * this.a = 1;
2027
- * }
2028
- *
2029
- * _.isPlainObject(new Foo);
2030
- * // => false
2031
- *
2032
- * _.isPlainObject([1, 2, 3]);
2033
- * // => false
2034
- *
2035
- * _.isPlainObject({ 'x': 0, 'y': 0 });
2036
- * // => true
2037
- *
2038
- * _.isPlainObject(Object.create(null));
2039
- * // => true
2040
- */
2041
- function isPlainObject(value) {
2042
- if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
2043
- return false;
2044
- }
2045
- var proto = getPrototype(value);
2046
- if (proto === null) {
2047
- return true;
2048
- }
2049
- var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
2050
- return typeof Ctor == 'function' && Ctor instanceof Ctor &&
2051
- funcToString.call(Ctor) == objectCtorString;
2052
- }
2053
-
2054
- /**
2055
- * Checks if `value` is classified as a typed array.
2056
- *
2057
- * @static
2058
- * @memberOf _
2059
- * @since 3.0.0
2060
- * @category Lang
2061
- * @param {*} value The value to check.
2062
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2063
- * @example
2064
- *
2065
- * _.isTypedArray(new Uint8Array);
2066
- * // => true
2067
- *
2068
- * _.isTypedArray([]);
2069
- * // => false
2070
- */
2071
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
2072
-
2073
- /**
2074
- * Converts `value` to a plain object flattening inherited enumerable string
2075
- * keyed properties of `value` to own properties of the plain object.
2076
- *
2077
- * @static
2078
- * @memberOf _
2079
- * @since 3.0.0
2080
- * @category Lang
2081
- * @param {*} value The value to convert.
2082
- * @returns {Object} Returns the converted plain object.
2083
- * @example
2084
- *
2085
- * function Foo() {
2086
- * this.b = 2;
2087
- * }
2088
- *
2089
- * Foo.prototype.c = 3;
2090
- *
2091
- * _.assign({ 'a': 1 }, new Foo);
2092
- * // => { 'a': 1, 'b': 2 }
2093
- *
2094
- * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
2095
- * // => { 'a': 1, 'b': 2, 'c': 3 }
2096
- */
2097
- function toPlainObject(value) {
2098
- return copyObject(value, keysIn(value));
2099
- }
2100
-
2101
- /**
2102
- * Creates an array of the own and inherited enumerable property names of `object`.
2103
- *
2104
- * **Note:** Non-object values are coerced to objects.
2105
- *
2106
- * @static
2107
- * @memberOf _
2108
- * @since 3.0.0
2109
- * @category Object
2110
- * @param {Object} object The object to query.
2111
- * @returns {Array} Returns the array of property names.
2112
- * @example
2113
- *
2114
- * function Foo() {
2115
- * this.a = 1;
2116
- * this.b = 2;
2117
- * }
2118
- *
2119
- * Foo.prototype.c = 3;
2120
- *
2121
- * _.keysIn(new Foo);
2122
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
2123
- */
2124
- function keysIn(object) {
2125
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
2126
- }
2127
-
2128
- /**
2129
- * This method is like `_.merge` except that it accepts `customizer` which
2130
- * is invoked to produce the merged values of the destination and source
2131
- * properties. If `customizer` returns `undefined`, merging is handled by the
2132
- * method instead. The `customizer` is invoked with six arguments:
2133
- * (objValue, srcValue, key, object, source, stack).
2134
- *
2135
- * **Note:** This method mutates `object`.
2136
- *
2137
- * @static
2138
- * @memberOf _
2139
- * @since 4.0.0
2140
- * @category Object
2141
- * @param {Object} object The destination object.
2142
- * @param {...Object} sources The source objects.
2143
- * @param {Function} customizer The function to customize assigned values.
2144
- * @returns {Object} Returns `object`.
2145
- * @example
2146
- *
2147
- * function customizer(objValue, srcValue) {
2148
- * if (_.isArray(objValue)) {
2149
- * return objValue.concat(srcValue);
2150
- * }
2151
- * }
2152
- *
2153
- * var object = { 'a': [1], 'b': [2] };
2154
- * var other = { 'a': [3], 'b': [4] };
2155
- *
2156
- * _.mergeWith(object, other, customizer);
2157
- * // => { 'a': [1, 3], 'b': [2, 4] }
2158
- */
2159
- var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
2160
- baseMerge(object, source, srcIndex, customizer);
2161
- });
2162
-
2163
- /**
2164
- * Creates a function that returns `value`.
2165
- *
2166
- * @static
2167
- * @memberOf _
2168
- * @since 2.4.0
2169
- * @category Util
2170
- * @param {*} value The value to return from the new function.
2171
- * @returns {Function} Returns the new constant function.
2172
- * @example
2173
- *
2174
- * var objects = _.times(2, _.constant({ 'a': 1 }));
2175
- *
2176
- * console.log(objects);
2177
- * // => [{ 'a': 1 }, { 'a': 1 }]
2178
- *
2179
- * console.log(objects[0] === objects[1]);
2180
- * // => true
2181
- */
2182
- function constant(value) {
2183
- return function() {
2184
- return value;
2185
- };
2186
- }
2187
-
2188
- /**
2189
- * This method returns the first argument it receives.
2190
- *
2191
- * @static
2192
- * @since 0.1.0
2193
- * @memberOf _
2194
- * @category Util
2195
- * @param {*} value Any value.
2196
- * @returns {*} Returns `value`.
2197
- * @example
2198
- *
2199
- * var object = { 'a': 1 };
2200
- *
2201
- * console.log(_.identity(object) === object);
2202
- * // => true
2203
- */
2204
- function identity(value) {
2205
- return value;
2206
- }
2207
-
2208
- /**
2209
- * This method returns `false`.
2210
- *
2211
- * @static
2212
- * @memberOf _
2213
- * @since 4.13.0
2214
- * @category Util
2215
- * @returns {boolean} Returns `false`.
2216
- * @example
2217
- *
2218
- * _.times(2, _.stubFalse);
2219
- * // => [false, false]
2220
- */
2221
- function stubFalse() {
2222
- return false;
2223
- }
2224
-
2225
- module.exports = mergeWith;
2226
- });
2227
-
2228
- function isArray(value) {
2229
- return Array.isArray(value);
2230
- }
2231
-
2232
- function isObject(value) {
2233
- var type = typeof value;
2234
- return value != null && (type === "object" || type === "function") && !isArray(value);
2235
- }
2236
- var __DEV__ = process.env.NODE_ENV !== "production";
2237
- process.env.NODE_ENV === "test";
2238
- function once(fn) {
2239
- var result;
2240
- return function func() {
2241
- if (fn) {
2242
- for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
2243
- args[_key5] = arguments[_key5];
2244
- }
2245
-
2246
- result = fn.apply(this, args);
2247
- fn = null;
2248
- }
2249
-
2250
- return result;
2251
- };
2252
- }
2253
- var warn = once(function (options) {
2254
- return function () {
2255
- var condition = options.condition,
2256
- message = options.message;
2257
-
2258
- if (condition && __DEV__) {
2259
- console.warn(message);
2260
- }
2261
- };
2262
- });
2263
-
2264
- Object.freeze(["base", "sm", "md", "lg", "xl", "2xl"]);
2265
-
2266
- function _extends() {
2267
- _extends = Object.assign || function (target) {
2268
- for (var i = 1; i < arguments.length; i++) {
2269
- var source = arguments[i];
2270
-
2271
- for (var key in source) {
2272
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2273
- target[key] = source[key];
2274
- }
2275
- }
2276
- }
2277
-
2278
- return target;
2279
- };
2280
-
2281
- return _extends.apply(this, arguments);
2282
- }
2283
-
2284
- var createBreakpoints = function createBreakpoints(config) {
2285
- warn({
2286
- condition: true,
2287
- message: ["[chakra-ui]: createBreakpoints(...) will be deprecated pretty soon", "simply pass the breakpoints as an object. Remove the createBreakpoint(..) call"].join("")
2288
- });
2289
- return _extends({
2290
- base: "0em"
2291
- }, config);
2292
- };
2293
-
2294
- function toRef(operand) {
2295
- if (isObject(operand) && operand.reference) {
2296
- return operand.reference;
2297
- }
2298
-
2299
- return String(operand);
2300
- }
2301
-
2302
- var toExpr = function toExpr(operator) {
2303
- for (var _len = arguments.length, operands = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2304
- operands[_key - 1] = arguments[_key];
2305
- }
2306
-
2307
- return operands.map(toRef).join(" " + operator + " ").replace(/calc/g, "");
2308
- };
2309
-
2310
- var _add = function add() {
2311
- for (var _len2 = arguments.length, operands = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
2312
- operands[_key2] = arguments[_key2];
2313
- }
2314
-
2315
- return "calc(" + toExpr.apply(void 0, ["+"].concat(operands)) + ")";
2316
- };
2317
-
2318
- var _subtract = function subtract() {
2319
- for (var _len3 = arguments.length, operands = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
2320
- operands[_key3] = arguments[_key3];
2321
- }
2322
-
2323
- return "calc(" + toExpr.apply(void 0, ["-"].concat(operands)) + ")";
2324
- };
2325
-
2326
- var _multiply = function multiply() {
2327
- for (var _len4 = arguments.length, operands = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
2328
- operands[_key4] = arguments[_key4];
2329
- }
2330
-
2331
- return "calc(" + toExpr.apply(void 0, ["*"].concat(operands)) + ")";
2332
- };
2333
-
2334
- var _divide = function divide() {
2335
- for (var _len5 = arguments.length, operands = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
2336
- operands[_key5] = arguments[_key5];
2337
- }
2338
-
2339
- return "calc(" + toExpr.apply(void 0, ["/"].concat(operands)) + ")";
2340
- };
2341
-
2342
- var _negate = function negate(x) {
2343
- var value = toRef(x);
2344
-
2345
- if (value != null && !Number.isNaN(parseFloat(value))) {
2346
- return String(value).startsWith("-") ? String(value).slice(1) : "-" + value;
2347
- }
2348
-
2349
- return _multiply(value, -1);
2350
- };
2351
-
2352
- var calc = Object.assign(function (x) {
2353
- return {
2354
- add: function add() {
2355
- for (var _len6 = arguments.length, operands = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
2356
- operands[_key6] = arguments[_key6];
2357
- }
2358
-
2359
- return calc(_add.apply(void 0, [x].concat(operands)));
2360
- },
2361
- subtract: function subtract() {
2362
- for (var _len7 = arguments.length, operands = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
2363
- operands[_key7] = arguments[_key7];
2364
- }
2365
-
2366
- return calc(_subtract.apply(void 0, [x].concat(operands)));
2367
- },
2368
- multiply: function multiply() {
2369
- for (var _len8 = arguments.length, operands = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
2370
- operands[_key8] = arguments[_key8];
2371
- }
2372
-
2373
- return calc(_multiply.apply(void 0, [x].concat(operands)));
2374
- },
2375
- divide: function divide() {
2376
- for (var _len9 = arguments.length, operands = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
2377
- operands[_key9] = arguments[_key9];
2378
- }
2379
-
2380
- return calc(_divide.apply(void 0, [x].concat(operands)));
2381
- },
2382
- negate: function negate() {
2383
- return calc(_negate(x));
2384
- },
2385
- toString: function toString() {
2386
- return x.toString();
2387
- }
2388
- };
2389
- }, {
2390
- add: _add,
2391
- subtract: _subtract,
2392
- multiply: _multiply,
2393
- divide: _divide,
2394
- negate: _negate
2395
- });
2396
-
2397
- var breakpoints = createBreakpoints({
2398
- sm: '30em',
2399
- md: '48em',
2400
- lg: '62em',
2401
- xl: '80em',
2402
- '2xl': '96em',
2403
- });
2404
-
2405
241
  var borders = {
2406
242
  none: 0,
2407
243
  '1px': '1px solid',
@@ -2526,9 +362,9 @@ var transition = {
2526
362
  };
2527
363
 
2528
364
  var fonts = {
2529
- heading: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"",
2530
- body: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"",
2531
- mono: "SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace",
365
+ body: 'LinearSans, Noto Sans, Arial, Helvetica, sans-serif',
366
+ heading: 'LinearSans, Noto Sans, Arial, Helvetica, sans-serif',
367
+ mono: 'LinearSans, Noto Sans, Arial, Helvetica, sans-serif',
2532
368
  };
2533
369
 
2534
370
  var fontSizes = {
@@ -2593,33 +429,10 @@ var zIndices = {
2593
429
  tooltip: 1800,
2594
430
  };
2595
431
 
2596
- var pallette = {
2597
- primaryLightest: 'hsl(190deg 48% 70%)',
2598
- primaryLight: 'hsl(190deg 48% 54%)',
2599
- primary: 'hsl(190deg 48% 37%)',
2600
- primaryDark: 'hsl(190deg 48% 25%)',
2601
- error: '#ff3e28',
2602
- errorLight: '#fdcab9',
2603
- errorSecondary: '#fe5f55',
2604
- errorSecondaryDark: '#ca2f20',
2605
- grayWhite: '#fbfbfb',
2606
- graySecondary: '#8f99a4',
2607
- success: 'hsla(166, 100%, 26%, 1)',
2608
- grayLightest: 'hsl(0,0%,90%)',
2609
- grayLight: 'hsl(0,0%,70%)',
2610
- grayDark: 'hsl(0,0%,40%)',
2611
- grayDarker: 'hsl(0,0%,30%)',
2612
- grayDarkest: 'hsl(0,0%, 20%)',
2613
- warning: '#ff8d07',
2614
- white: 'hsl(230,0%,98%)',
2615
- black: 'hsl(230,68%,16%)',
2616
- };
2617
-
2618
432
  // @ts-ignore
2619
433
  var theme = react.extendTheme({
2620
434
  blur: blur,
2621
435
  borders: borders,
2622
- breakpoints: breakpoints,
2623
436
  colors: colors,
2624
437
  radii: radii,
2625
438
  shadows: shadows,
@@ -2631,20 +444,35 @@ var theme = react.extendTheme({
2631
444
  space: space,
2632
445
  transition: transition,
2633
446
  zIndices: zIndices,
2634
- pallette: pallette,
447
+ semanticTokens: semanticTokens,
448
+ config: {
449
+ initialColorMode: 'light',
450
+ useSystemColorMode: false,
451
+ },
2635
452
  });
2636
453
 
2637
454
  var KibbleThemeProvider = function (_a) {
2638
455
  var children = _a.children;
2639
- return (React__default["default"].createElement(styledComponents.ThemeProvider, { theme: theme },
2640
- React__default["default"].createElement(react.ThemeProvider, { theme: theme }, children)));
456
+ console.log(theme);
457
+ return (React__default["default"].createElement(react.ChakraProvider, { theme: theme },
458
+ React__default["default"].createElement(styledComponents.ThemeProvider, { theme: theme }, children)));
2641
459
  };
2642
460
 
2643
461
  var Button = function (_a) {
2644
462
  var children = _a.children;
2645
- return React__default["default"].createElement(react.Button, null, children);
463
+ console.log(react.useTheme());
464
+ return (React__default["default"].createElement(react.Button, { colorScheme: 'comet', variant: 'outline' }, children));
465
+ };
466
+
467
+ var Banner = function () {
468
+ return (React__default["default"].createElement(react.Alert, { status: "success" },
469
+ React__default["default"].createElement(react.AlertIcon, null),
470
+ React__default["default"].createElement(react.AlertTitle, { mr: 2 }, "Your design system is too fancy!"),
471
+ React__default["default"].createElement(react.AlertDescription, null, "You should consider being less fancy."),
472
+ React__default["default"].createElement(react.CloseButton, { position: "absolute", right: "8px", top: "8px" })));
2646
473
  };
2647
474
 
475
+ exports.Banner = Banner;
2648
476
  exports.Button = Button;
2649
477
  exports.KibbleThemeProvider = KibbleThemeProvider;
2650
478
  exports.theme = theme;