@televet/kibble-ui 1.3.2-release.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/build/components/Forms/Textarea/index.d.ts +1 -0
  2. package/build/components/Forms/Textarea/textarea.component.d.ts +3 -5
  3. package/build/components/Forms/index.d.ts +0 -4
  4. package/build/components/index.d.ts +0 -1
  5. package/build/index.js +28 -2373
  6. package/build/index.js.map +1 -1
  7. package/build/theme/theme.types.d.ts +2 -4
  8. package/package.json +1 -1
  9. package/build/components/Avatar/avatar.component.d.ts +0 -26
  10. package/build/components/Avatar/avatar.config.d.ts +0 -2
  11. package/build/components/Avatar/avatar.types.d.ts +0 -1
  12. package/build/components/Avatar/index.d.ts +0 -3
  13. package/build/components/AvatarGroup/avatarGroup.component.d.ts +0 -13
  14. package/build/components/AvatarGroup/avatarGroup.utilities.d.ts +0 -6
  15. package/build/components/AvatarGroup/index.d.ts +0 -1
  16. package/build/components/Button/button.component.d.ts +0 -13
  17. package/build/components/Button/button.config.d.ts +0 -16
  18. package/build/components/Button/button.types.d.ts +0 -8
  19. package/build/components/Button/index.d.ts +0 -3
  20. package/build/components/Drawer/drawer.config.d.ts +0 -13
  21. package/build/components/Drawer/index.d.ts +0 -1
  22. package/build/components/FormControl/formControl.argTypes.d.ts +0 -125
  23. package/build/components/FormControl/formControl.component.d.ts +0 -12
  24. package/build/components/FormControl/formControl.config.d.ts +0 -2
  25. package/build/components/Forms/FormControl/formControl.argTypes.d.ts +0 -125
  26. package/build/components/Forms/FormControl/formControl.component.d.ts +0 -12
  27. package/build/components/Forms/FormControl/formControl.config.d.ts +0 -2
  28. package/build/components/Forms/RatingDots/index.d.ts +0 -2
  29. package/build/components/Forms/RatingDots/ratingDot.component.d.ts +0 -9
  30. package/build/components/Forms/RatingDots/ratingDots.component.d.ts +0 -10
  31. package/build/components/Forms/Select/index.d.ts +0 -3
  32. package/build/components/Forms/Select/select.component.d.ts +0 -9
  33. package/build/components/Forms/Select/select.config.d.ts +0 -2
  34. package/build/components/Forms/Select/select.types.d.ts +0 -4
  35. package/build/components/Forms/Switch/index.d.ts +0 -2
  36. package/build/components/Forms/Switch/switch.component.d.ts +0 -7
  37. package/build/components/Forms/Switch/switch.config.d.ts +0 -2
  38. package/build/components/Forms/TextInput/index.d.ts +0 -2
  39. package/build/components/Forms/TextInput/textInput.component.d.ts +0 -9
  40. package/build/components/Forms/TextInput/textInput.config.d.ts +0 -2
  41. package/build/components/Icon/icon.component.d.ts +0 -8
  42. package/build/components/Icon/icon.records.d.ts +0 -3
  43. package/build/components/Icon/icon.types.d.ts +0 -3
  44. package/build/components/Icon/index.d.ts +0 -2
  45. package/build/components/Logo/index.d.ts +0 -2
  46. package/build/components/Logo/logo.component.d.ts +0 -14
  47. package/build/components/Logo/logo.config.d.ts +0 -6
  48. package/build/components/Logo/logo.types.d.ts +0 -3
  49. package/build/components/Logo/logos.d.ts +0 -22
  50. package/build/components/RatingDots/index.d.ts +0 -2
  51. package/build/components/RatingDots/ratingDot.component.d.ts +0 -9
  52. package/build/components/RatingDots/ratingDots.component.d.ts +0 -10
  53. package/build/components/Select/index.d.ts +0 -3
  54. package/build/components/Select/select.component.d.ts +0 -9
  55. package/build/components/Select/select.config.d.ts +0 -2
  56. package/build/components/Select/select.types.d.ts +0 -4
  57. package/build/components/Switch/index.d.ts +0 -2
  58. package/build/components/Switch/switch.component.d.ts +0 -7
  59. package/build/components/Switch/switch.config.d.ts +0 -2
  60. package/build/components/TextInput/index.d.ts +0 -2
  61. package/build/components/TextInput/textInput.component.d.ts +0 -7
  62. package/build/components/TextInput/textInput.config.d.ts +0 -2
  63. package/build/components/Textarea/index.d.ts +0 -2
  64. package/build/components/Textarea/textarea.component.d.ts +0 -7
  65. package/build/components/Textarea/textarea.config.d.ts +0 -2
  66. package/build/components/Tooltip/index.d.ts +0 -3
  67. package/build/components/Tooltip/tooltip.component.d.ts +0 -8
  68. package/build/components/Tooltip/tooltip.config.d.ts +0 -8
  69. package/build/components/Tooltip/tooltip.types.d.ts +0 -4
package/build/index.js CHANGED
@@ -949,19 +949,18 @@ var Button = React.forwardRef(function (props, ref) {
949
949
  bg: react.useColorModeValue(modeColor.active, dark.active),
950
950
  transform: 'scale(0.98)',
951
951
  };
952
- var iconName = p.iconName; p.darkMode; var iconPosition = p.iconPosition, domProps = __rest(p, ["iconName", "darkMode", "iconPosition"]);
953
- if (iconName) {
954
- var ButtonIcon = React__default["default"].createElement(Icon, { size: p.size, name: iconName });
955
- if (!domProps.children) {
956
- var label = camelCaseToLabel(iconName);
957
- return (React__default["default"].createElement(react.IconButton, __assign({ ref: ref, _hover: hoverClass, _active: activeClass, "aria-label": label, icon: ButtonIcon }, domProps)));
952
+ if (p.iconName) {
953
+ var ButtonIcon = React__default["default"].createElement(Icon, { size: p.size, name: p.iconName });
954
+ if (!p.children) {
955
+ var label = camelCaseToLabel(p.iconName);
956
+ return (React__default["default"].createElement(react.IconButton, __assign({ ref: ref, _hover: hoverClass, _active: activeClass, "aria-label": label, icon: ButtonIcon }, p)));
958
957
  }
959
958
  else {
960
- var position = iconPosition === 'right' ? 'rightIcon' : 'leftIcon';
961
- domProps[position] = ButtonIcon;
959
+ var position = p.iconPosition === 'right' ? 'rightIcon' : 'leftIcon';
960
+ p[position] = ButtonIcon;
962
961
  }
963
962
  }
964
- return (React__default["default"].createElement(react.Button, __assign({ fontWeight: fontWeights.semibold, ref: ref, _hover: hoverClass, _active: activeClass, iconSpacing: domProps.size === 'sm' || domProps.size === 'xs' ? '4px' : '8px' }, domProps), domProps.children));
963
+ return (React__default["default"].createElement(react.Button, __assign({ fontWeight: fontWeights.semibold, ref: ref, _hover: hoverClass, _active: activeClass, whiteSpace: "normal", wordWrap: "break-word", iconSpacing: p.size === 'sm' || p.size === 'xs' ? '4px' : '8px' }, p), props.children));
965
964
  });
966
965
  Button.displayName = 'Button';
967
966
 
@@ -1410,25 +1409,10 @@ var ButtonSizeConfig = {
1410
1409
  },
1411
1410
  };
1412
1411
 
1413
- function withFormControl(Component) {
1414
- function WithFormControl(_a) {
1415
- var label = _a.label, errorText = _a.errorText, helperText = _a.helperText, isRequired = _a.isRequired, isReadOnly = _a.isReadOnly, isInvalid = _a.isInvalid, isDisabled = _a.isDisabled, props = __rest(_a, ["label", "errorText", "helperText", "isRequired", "isReadOnly", "isInvalid", "isDisabled"]);
1416
- var colors = useTheme().colors;
1417
- return (React__default["default"].createElement(react.FormControl, { isInvalid: isInvalid, isRequired: isRequired, isReadOnly: isReadOnly, isDisabled: isDisabled },
1418
- label && React__default["default"].createElement(react.FormLabel, { color: colors.text.light.default }, label),
1419
- React__default["default"].createElement(Component, __assign({}, props, { errorBorderColor: colors.border.light.error, focusBorderColor: colors.border.light.focus })),
1420
- helperText && !isInvalid && React__default["default"].createElement(react.FormHelperText, null, helperText),
1421
- React__default["default"].createElement(react.FormErrorMessage, null, errorText ? errorText : 'Field is invalid')));
1422
- }
1423
- WithFormControl.displayName = "withFormControl(".concat(Component.displayName || Component.name);
1424
- return WithFormControl;
1425
- }
1426
-
1427
1412
  var Textarea = function (props) {
1428
- return React__default["default"].createElement(react.Textarea, __assign({}, props));
1429
- };
1430
- Textarea.displayName = 'Textarea';
1431
- var WrappedTextArea = withFormControl(Textarea);
1413
+ var colors = useTheme().colors;
1414
+ return (React__default["default"].createElement(react.Textarea, __assign({}, props, { errorBorderColor: colors.border.light.error, focusBorderColor: colors.border.light.focus })));
1415
+ };
1432
1416
 
1433
1417
  var blur = {
1434
1418
  none: 0,
@@ -1569,46 +1553,29 @@ var zIndices = {
1569
1553
  tooltip: 1800,
1570
1554
  };
1571
1555
 
1572
- var FormControlConfig = {
1556
+ var TextareaConfig = {
1573
1557
  baseStyle: {
1574
1558
  borderRadius: borders['4px'],
1575
1559
  color: adaptiveColors.text.light.default,
1576
1560
  },
1577
1561
  variants: {
1578
1562
  outline: {
1579
- // textarea doesn't have a "field" prop, so its disabled styles live a level up from the others
1563
+ background: coreColors.white,
1564
+ borderColor: semanticColors.border.light.default,
1565
+ _hover: {
1566
+ borderColor: semanticColors.border.dark.default,
1567
+ },
1580
1568
  _disabled: {
1581
- background: colors.border.light.default,
1582
- borderColor: colors.border.light.default,
1583
- opacity: 0.4,
1584
- '::placeholder': {
1585
- color: colors.text.light.placeholder,
1586
- opacity: 1,
1587
- },
1569
+ borderColor: semanticColors.border.light.default,
1570
+ opacity: 0.5,
1588
1571
  },
1589
- field: {
1590
- background: coreColors.white,
1591
- borderColor: colors.border.light.default,
1572
+ _focus: {
1592
1573
  _hover: {
1593
- borderColor: colors.border.dark.default,
1574
+ borderColor: semanticColors.border.light.focus,
1594
1575
  },
1595
- _disabled: {
1596
- background: colors.border.light.default,
1597
- borderColor: colors.border.light.default,
1598
- opacity: 0.4,
1599
- '::placeholder': {
1600
- color: colors.text.light.placeholder,
1601
- opacity: 1,
1602
- },
1603
- },
1604
- _focus: {
1605
- _hover: {
1606
- borderColor: colors.border.light.focus,
1607
- },
1608
- _invalid: {
1609
- borderColor: colors.border.light.error,
1610
- boxShadow: "0 0 0 1px ".concat(colors.border.light.error),
1611
- },
1576
+ _invalid: {
1577
+ borderColor: semanticColors.border.light.error,
1578
+ boxShadow: "0 0 0 1px ".concat(semanticColors.border.light.error),
1612
1579
  },
1613
1580
  },
1614
1581
  },
@@ -1627,2292 +1594,6 @@ var FormControlConfig = {
1627
1594
  },
1628
1595
  };
1629
1596
 
1630
- var TextareaConfig = __assign({}, FormControlConfig);
1631
-
1632
- var TextInput = function (props) {
1633
- // the disabled styles coming from the FormControlConfig weren't getting applied to the TextInput, so they're added inline instead
1634
- var leftElement = props.leftElement, rightElement = props.rightElement, domProps = __rest(props, ["leftElement", "rightElement"]);
1635
- return (React__default["default"].createElement(react.InputGroup, null,
1636
- leftElement ? React__default["default"].createElement(react.InputLeftElement, { children: leftElement }) : null,
1637
- React__default["default"].createElement(react.Input, __assign({ _disabled: {
1638
- background: colors.border.light.default,
1639
- opacity: 0.4,
1640
- cursor: 'not-allowed',
1641
- '::placeholder': {
1642
- color: colors.text.light.placeholder,
1643
- opacity: 1,
1644
- },
1645
- } }, domProps)),
1646
- rightElement ? React__default["default"].createElement(react.InputRightElement, { children: rightElement }) : null));
1647
- };
1648
- TextInput.displayName = 'TextInput';
1649
- var WrappedTextInput = withFormControl(TextInput);
1650
-
1651
- var TextInputConfig = __assign({}, FormControlConfig);
1652
-
1653
- var RatingDot = function (_a) {
1654
- var number = _a.number, isInteractive = _a.isInteractive, isDisabled = _a.isDisabled, onClick = _a.onClick, selected = _a.selected;
1655
- var colors = useTheme().colors;
1656
- var handleClick = React.useCallback(function () {
1657
- if (onClick)
1658
- onClick(number);
1659
- }, [number, onClick]);
1660
- return (React__default["default"].createElement(React__default["default"].Fragment, null, isInteractive ? (isDisabled ? (React__default["default"].createElement(react.Flex, { as: "button", bgColor: selected ? "".concat(colors.background.brand, "80") : 'transparent', h: "60px", w: "60px", borderRadius: "30px", border: "2px solid ".concat(selected ? 'transparent' : colors.background.brand, "50"), color: selected ? 'white' : "".concat(colors.background.brand, "50"), mr: 1, mb: 1, justifyContent: "center", alignItems: "center", fontSize: "lg", cursor: "not-allowed" }, number)) : (React__default["default"].createElement(react.Flex, { as: "button", onClick: handleClick, bgColor: selected ? colors.background.brand : 'transparent', h: "60px", w: "60px", borderRadius: "30px", border: "2px solid ".concat(colors.background.brand), color: selected ? colors.text.dark.default : colors.text.light.link, mr: 1, mb: 1, justifyContent: "center", alignItems: "center", fontSize: "lg", cursor: "pointer", _hover: {
1661
- bg: selected ? colors.background.brand : colors.background.tealLight,
1662
- } }, number))) : (React__default["default"].createElement(react.Flex, { as: "div", bgColor: colors.background.brand, h: "40px", w: "40px", borderRadius: "20px", border: "2px solid ".concat(colors.background.brand), color: colors.text.dark.default, mr: 1, mb: 1, justifyContent: "center", alignItems: "center", fontSize: "lg", cursor: "default" }, number))));
1663
- };
1664
-
1665
- var RatingDots = function (_a) {
1666
- var minValue = _a.minValue, maxValue = _a.maxValue, isDisabled = _a.isDisabled, isInteractive = _a.isInteractive, onClick = _a.onClick, selected = _a.selected;
1667
- var _b = React.useState(), selectedValue = _b[0], setSelectedValue = _b[1];
1668
- var roundedMin = React.useMemo(function () { return Math.round(minValue); }, [minValue]);
1669
- var roundedMax = React.useMemo(function () { return Math.round(maxValue); }, [maxValue]);
1670
- var values = React.useMemo(function () {
1671
- var arr = [];
1672
- for (var i = roundedMin; i <= roundedMax; i++) {
1673
- arr.push(i);
1674
- }
1675
- return arr;
1676
- }, [roundedMax, roundedMin]);
1677
- React.useEffect(function () {
1678
- if (selected !== undefined)
1679
- setSelectedValue(selected);
1680
- }, [selected]);
1681
- return (React__default["default"].createElement(React__default["default"].Fragment, null,
1682
- React__default["default"].createElement(react.Flex, { my: 4, flexWrap: "wrap", justifyContent: isInteractive ? 'center' : 'flex-start' }, values.map(function (value) { return (React__default["default"].createElement(RatingDot, { key: "composer-rating-dot-".concat(value), number: value, isInteractive: isInteractive, onClick: onClick, isDisabled: isDisabled, selected: selectedValue === value })); })),
1683
- React__default["default"].createElement(react.Flex, { color: colors.text.light.subtle, justifyContent: isInteractive ? 'space-between' : 'flex-start' },
1684
- React__default["default"].createElement(Text, { size: "sm" }, "".concat(roundedMin, " - Not likely")),
1685
- !isInteractive && React__default["default"].createElement(Text, { size: "sm", pr: 1 }, ","),
1686
- React__default["default"].createElement(Text, { size: "sm" }, "".concat(roundedMax, " - Very likely")))));
1687
- };
1688
-
1689
- var Select = function (props) {
1690
- var options = props.options, domProps = __rest(props, ["options"]);
1691
- return (React__default["default"].createElement(react.Select, __assign({}, domProps), options.map(function (option, index) { return (React__default["default"].createElement("option", { key: "options-".concat(index), value: option.value }, option.text)); })));
1692
- };
1693
- Select.displayName = 'Select';
1694
- var WrappedSelect = withFormControl(Select);
1695
-
1696
- var SelectConfig = __assign({}, FormControlConfig);
1697
-
1698
- var Switch = function (props) {
1699
- return React__default["default"].createElement(react.Switch, __assign({ colorScheme: "teal" }, props, { isChecked: props.isChecked }));
1700
- };
1701
- Switch.displayName = 'Switch';
1702
- var WrappedSwitch = withFormControl(Switch);
1703
-
1704
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1705
-
1706
- var lodash_mergewith = {exports: {}};
1707
-
1708
- /**
1709
- * Lodash (Custom Build) <https://lodash.com/>
1710
- * Build: `lodash modularize exports="npm" -o ./`
1711
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
1712
- * Released under MIT license <https://lodash.com/license>
1713
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1714
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1715
- */
1716
-
1717
- (function (module, exports) {
1718
- /** Used as the size to enable large array optimizations. */
1719
- var LARGE_ARRAY_SIZE = 200;
1720
-
1721
- /** Used to stand-in for `undefined` hash values. */
1722
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1723
-
1724
- /** Used to detect hot functions by number of calls within a span of milliseconds. */
1725
- var HOT_COUNT = 800,
1726
- HOT_SPAN = 16;
1727
-
1728
- /** Used as references for various `Number` constants. */
1729
- var MAX_SAFE_INTEGER = 9007199254740991;
1730
-
1731
- /** `Object#toString` result references. */
1732
- var argsTag = '[object Arguments]',
1733
- arrayTag = '[object Array]',
1734
- asyncTag = '[object AsyncFunction]',
1735
- boolTag = '[object Boolean]',
1736
- dateTag = '[object Date]',
1737
- errorTag = '[object Error]',
1738
- funcTag = '[object Function]',
1739
- genTag = '[object GeneratorFunction]',
1740
- mapTag = '[object Map]',
1741
- numberTag = '[object Number]',
1742
- nullTag = '[object Null]',
1743
- objectTag = '[object Object]',
1744
- proxyTag = '[object Proxy]',
1745
- regexpTag = '[object RegExp]',
1746
- setTag = '[object Set]',
1747
- stringTag = '[object String]',
1748
- undefinedTag = '[object Undefined]',
1749
- weakMapTag = '[object WeakMap]';
1750
-
1751
- var arrayBufferTag = '[object ArrayBuffer]',
1752
- dataViewTag = '[object DataView]',
1753
- float32Tag = '[object Float32Array]',
1754
- float64Tag = '[object Float64Array]',
1755
- int8Tag = '[object Int8Array]',
1756
- int16Tag = '[object Int16Array]',
1757
- int32Tag = '[object Int32Array]',
1758
- uint8Tag = '[object Uint8Array]',
1759
- uint8ClampedTag = '[object Uint8ClampedArray]',
1760
- uint16Tag = '[object Uint16Array]',
1761
- uint32Tag = '[object Uint32Array]';
1762
-
1763
- /**
1764
- * Used to match `RegExp`
1765
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
1766
- */
1767
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
1768
-
1769
- /** Used to detect host constructors (Safari). */
1770
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
1771
-
1772
- /** Used to detect unsigned integer values. */
1773
- var reIsUint = /^(?:0|[1-9]\d*)$/;
1774
-
1775
- /** Used to identify `toStringTag` values of typed arrays. */
1776
- var typedArrayTags = {};
1777
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
1778
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
1779
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
1780
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
1781
- typedArrayTags[uint32Tag] = true;
1782
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
1783
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
1784
- typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
1785
- typedArrayTags[errorTag] = typedArrayTags[funcTag] =
1786
- typedArrayTags[mapTag] = typedArrayTags[numberTag] =
1787
- typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
1788
- typedArrayTags[setTag] = typedArrayTags[stringTag] =
1789
- typedArrayTags[weakMapTag] = false;
1790
-
1791
- /** Detect free variable `global` from Node.js. */
1792
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
1793
-
1794
- /** Detect free variable `self`. */
1795
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
1796
-
1797
- /** Used as a reference to the global object. */
1798
- var root = freeGlobal || freeSelf || Function('return this')();
1799
-
1800
- /** Detect free variable `exports`. */
1801
- var freeExports = exports && !exports.nodeType && exports;
1802
-
1803
- /** Detect free variable `module`. */
1804
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1805
-
1806
- /** Detect the popular CommonJS extension `module.exports`. */
1807
- var moduleExports = freeModule && freeModule.exports === freeExports;
1808
-
1809
- /** Detect free variable `process` from Node.js. */
1810
- var freeProcess = moduleExports && freeGlobal.process;
1811
-
1812
- /** Used to access faster Node.js helpers. */
1813
- var nodeUtil = (function() {
1814
- try {
1815
- // Use `util.types` for Node.js 10+.
1816
- var types = freeModule && freeModule.require && freeModule.require('util').types;
1817
-
1818
- if (types) {
1819
- return types;
1820
- }
1821
-
1822
- // Legacy `process.binding('util')` for Node.js < 10.
1823
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
1824
- } catch (e) {}
1825
- }());
1826
-
1827
- /* Node.js helper references. */
1828
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
1829
-
1830
- /**
1831
- * A faster alternative to `Function#apply`, this function invokes `func`
1832
- * with the `this` binding of `thisArg` and the arguments of `args`.
1833
- *
1834
- * @private
1835
- * @param {Function} func The function to invoke.
1836
- * @param {*} thisArg The `this` binding of `func`.
1837
- * @param {Array} args The arguments to invoke `func` with.
1838
- * @returns {*} Returns the result of `func`.
1839
- */
1840
- function apply(func, thisArg, args) {
1841
- switch (args.length) {
1842
- case 0: return func.call(thisArg);
1843
- case 1: return func.call(thisArg, args[0]);
1844
- case 2: return func.call(thisArg, args[0], args[1]);
1845
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
1846
- }
1847
- return func.apply(thisArg, args);
1848
- }
1849
-
1850
- /**
1851
- * The base implementation of `_.times` without support for iteratee shorthands
1852
- * or max array length checks.
1853
- *
1854
- * @private
1855
- * @param {number} n The number of times to invoke `iteratee`.
1856
- * @param {Function} iteratee The function invoked per iteration.
1857
- * @returns {Array} Returns the array of results.
1858
- */
1859
- function baseTimes(n, iteratee) {
1860
- var index = -1,
1861
- result = Array(n);
1862
-
1863
- while (++index < n) {
1864
- result[index] = iteratee(index);
1865
- }
1866
- return result;
1867
- }
1868
-
1869
- /**
1870
- * The base implementation of `_.unary` without support for storing metadata.
1871
- *
1872
- * @private
1873
- * @param {Function} func The function to cap arguments for.
1874
- * @returns {Function} Returns the new capped function.
1875
- */
1876
- function baseUnary(func) {
1877
- return function(value) {
1878
- return func(value);
1879
- };
1880
- }
1881
-
1882
- /**
1883
- * Gets the value at `key` of `object`.
1884
- *
1885
- * @private
1886
- * @param {Object} [object] The object to query.
1887
- * @param {string} key The key of the property to get.
1888
- * @returns {*} Returns the property value.
1889
- */
1890
- function getValue(object, key) {
1891
- return object == null ? undefined : object[key];
1892
- }
1893
-
1894
- /**
1895
- * Creates a unary function that invokes `func` with its argument transformed.
1896
- *
1897
- * @private
1898
- * @param {Function} func The function to wrap.
1899
- * @param {Function} transform The argument transform.
1900
- * @returns {Function} Returns the new function.
1901
- */
1902
- function overArg(func, transform) {
1903
- return function(arg) {
1904
- return func(transform(arg));
1905
- };
1906
- }
1907
-
1908
- /** Used for built-in method references. */
1909
- var arrayProto = Array.prototype,
1910
- funcProto = Function.prototype,
1911
- objectProto = Object.prototype;
1912
-
1913
- /** Used to detect overreaching core-js shims. */
1914
- var coreJsData = root['__core-js_shared__'];
1915
-
1916
- /** Used to resolve the decompiled source of functions. */
1917
- var funcToString = funcProto.toString;
1918
-
1919
- /** Used to check objects for own properties. */
1920
- var hasOwnProperty = objectProto.hasOwnProperty;
1921
-
1922
- /** Used to detect methods masquerading as native. */
1923
- var maskSrcKey = (function() {
1924
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
1925
- return uid ? ('Symbol(src)_1.' + uid) : '';
1926
- }());
1927
-
1928
- /**
1929
- * Used to resolve the
1930
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1931
- * of values.
1932
- */
1933
- var nativeObjectToString = objectProto.toString;
1934
-
1935
- /** Used to infer the `Object` constructor. */
1936
- var objectCtorString = funcToString.call(Object);
1937
-
1938
- /** Used to detect if a method is native. */
1939
- var reIsNative = RegExp('^' +
1940
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
1941
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
1942
- );
1943
-
1944
- /** Built-in value references. */
1945
- var Buffer = moduleExports ? root.Buffer : undefined,
1946
- Symbol = root.Symbol,
1947
- Uint8Array = root.Uint8Array,
1948
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
1949
- getPrototype = overArg(Object.getPrototypeOf, Object),
1950
- objectCreate = Object.create,
1951
- propertyIsEnumerable = objectProto.propertyIsEnumerable,
1952
- splice = arrayProto.splice,
1953
- symToStringTag = Symbol ? Symbol.toStringTag : undefined;
1954
-
1955
- var defineProperty = (function() {
1956
- try {
1957
- var func = getNative(Object, 'defineProperty');
1958
- func({}, '', {});
1959
- return func;
1960
- } catch (e) {}
1961
- }());
1962
-
1963
- /* Built-in method references for those with the same name as other `lodash` methods. */
1964
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
1965
- nativeMax = Math.max,
1966
- nativeNow = Date.now;
1967
-
1968
- /* Built-in method references that are verified to be native. */
1969
- var Map = getNative(root, 'Map'),
1970
- nativeCreate = getNative(Object, 'create');
1971
-
1972
- /**
1973
- * The base implementation of `_.create` without support for assigning
1974
- * properties to the created object.
1975
- *
1976
- * @private
1977
- * @param {Object} proto The object to inherit from.
1978
- * @returns {Object} Returns the new object.
1979
- */
1980
- var baseCreate = (function() {
1981
- function object() {}
1982
- return function(proto) {
1983
- if (!isObject(proto)) {
1984
- return {};
1985
- }
1986
- if (objectCreate) {
1987
- return objectCreate(proto);
1988
- }
1989
- object.prototype = proto;
1990
- var result = new object;
1991
- object.prototype = undefined;
1992
- return result;
1993
- };
1994
- }());
1995
-
1996
- /**
1997
- * Creates a hash object.
1998
- *
1999
- * @private
2000
- * @constructor
2001
- * @param {Array} [entries] The key-value pairs to cache.
2002
- */
2003
- function Hash(entries) {
2004
- var index = -1,
2005
- length = entries == null ? 0 : entries.length;
2006
-
2007
- this.clear();
2008
- while (++index < length) {
2009
- var entry = entries[index];
2010
- this.set(entry[0], entry[1]);
2011
- }
2012
- }
2013
-
2014
- /**
2015
- * Removes all key-value entries from the hash.
2016
- *
2017
- * @private
2018
- * @name clear
2019
- * @memberOf Hash
2020
- */
2021
- function hashClear() {
2022
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
2023
- this.size = 0;
2024
- }
2025
-
2026
- /**
2027
- * Removes `key` and its value from the hash.
2028
- *
2029
- * @private
2030
- * @name delete
2031
- * @memberOf Hash
2032
- * @param {Object} hash The hash to modify.
2033
- * @param {string} key The key of the value to remove.
2034
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2035
- */
2036
- function hashDelete(key) {
2037
- var result = this.has(key) && delete this.__data__[key];
2038
- this.size -= result ? 1 : 0;
2039
- return result;
2040
- }
2041
-
2042
- /**
2043
- * Gets the hash value for `key`.
2044
- *
2045
- * @private
2046
- * @name get
2047
- * @memberOf Hash
2048
- * @param {string} key The key of the value to get.
2049
- * @returns {*} Returns the entry value.
2050
- */
2051
- function hashGet(key) {
2052
- var data = this.__data__;
2053
- if (nativeCreate) {
2054
- var result = data[key];
2055
- return result === HASH_UNDEFINED ? undefined : result;
2056
- }
2057
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
2058
- }
2059
-
2060
- /**
2061
- * Checks if a hash value for `key` exists.
2062
- *
2063
- * @private
2064
- * @name has
2065
- * @memberOf Hash
2066
- * @param {string} key The key of the entry to check.
2067
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2068
- */
2069
- function hashHas(key) {
2070
- var data = this.__data__;
2071
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
2072
- }
2073
-
2074
- /**
2075
- * Sets the hash `key` to `value`.
2076
- *
2077
- * @private
2078
- * @name set
2079
- * @memberOf Hash
2080
- * @param {string} key The key of the value to set.
2081
- * @param {*} value The value to set.
2082
- * @returns {Object} Returns the hash instance.
2083
- */
2084
- function hashSet(key, value) {
2085
- var data = this.__data__;
2086
- this.size += this.has(key) ? 0 : 1;
2087
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
2088
- return this;
2089
- }
2090
-
2091
- // Add methods to `Hash`.
2092
- Hash.prototype.clear = hashClear;
2093
- Hash.prototype['delete'] = hashDelete;
2094
- Hash.prototype.get = hashGet;
2095
- Hash.prototype.has = hashHas;
2096
- Hash.prototype.set = hashSet;
2097
-
2098
- /**
2099
- * Creates an list cache object.
2100
- *
2101
- * @private
2102
- * @constructor
2103
- * @param {Array} [entries] The key-value pairs to cache.
2104
- */
2105
- function ListCache(entries) {
2106
- var index = -1,
2107
- length = entries == null ? 0 : entries.length;
2108
-
2109
- this.clear();
2110
- while (++index < length) {
2111
- var entry = entries[index];
2112
- this.set(entry[0], entry[1]);
2113
- }
2114
- }
2115
-
2116
- /**
2117
- * Removes all key-value entries from the list cache.
2118
- *
2119
- * @private
2120
- * @name clear
2121
- * @memberOf ListCache
2122
- */
2123
- function listCacheClear() {
2124
- this.__data__ = [];
2125
- this.size = 0;
2126
- }
2127
-
2128
- /**
2129
- * Removes `key` and its value from the list cache.
2130
- *
2131
- * @private
2132
- * @name delete
2133
- * @memberOf ListCache
2134
- * @param {string} key The key of the value to remove.
2135
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2136
- */
2137
- function listCacheDelete(key) {
2138
- var data = this.__data__,
2139
- index = assocIndexOf(data, key);
2140
-
2141
- if (index < 0) {
2142
- return false;
2143
- }
2144
- var lastIndex = data.length - 1;
2145
- if (index == lastIndex) {
2146
- data.pop();
2147
- } else {
2148
- splice.call(data, index, 1);
2149
- }
2150
- --this.size;
2151
- return true;
2152
- }
2153
-
2154
- /**
2155
- * Gets the list cache value for `key`.
2156
- *
2157
- * @private
2158
- * @name get
2159
- * @memberOf ListCache
2160
- * @param {string} key The key of the value to get.
2161
- * @returns {*} Returns the entry value.
2162
- */
2163
- function listCacheGet(key) {
2164
- var data = this.__data__,
2165
- index = assocIndexOf(data, key);
2166
-
2167
- return index < 0 ? undefined : data[index][1];
2168
- }
2169
-
2170
- /**
2171
- * Checks if a list cache value for `key` exists.
2172
- *
2173
- * @private
2174
- * @name has
2175
- * @memberOf ListCache
2176
- * @param {string} key The key of the entry to check.
2177
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2178
- */
2179
- function listCacheHas(key) {
2180
- return assocIndexOf(this.__data__, key) > -1;
2181
- }
2182
-
2183
- /**
2184
- * Sets the list cache `key` to `value`.
2185
- *
2186
- * @private
2187
- * @name set
2188
- * @memberOf ListCache
2189
- * @param {string} key The key of the value to set.
2190
- * @param {*} value The value to set.
2191
- * @returns {Object} Returns the list cache instance.
2192
- */
2193
- function listCacheSet(key, value) {
2194
- var data = this.__data__,
2195
- index = assocIndexOf(data, key);
2196
-
2197
- if (index < 0) {
2198
- ++this.size;
2199
- data.push([key, value]);
2200
- } else {
2201
- data[index][1] = value;
2202
- }
2203
- return this;
2204
- }
2205
-
2206
- // Add methods to `ListCache`.
2207
- ListCache.prototype.clear = listCacheClear;
2208
- ListCache.prototype['delete'] = listCacheDelete;
2209
- ListCache.prototype.get = listCacheGet;
2210
- ListCache.prototype.has = listCacheHas;
2211
- ListCache.prototype.set = listCacheSet;
2212
-
2213
- /**
2214
- * Creates a map cache object to store key-value pairs.
2215
- *
2216
- * @private
2217
- * @constructor
2218
- * @param {Array} [entries] The key-value pairs to cache.
2219
- */
2220
- function MapCache(entries) {
2221
- var index = -1,
2222
- length = entries == null ? 0 : entries.length;
2223
-
2224
- this.clear();
2225
- while (++index < length) {
2226
- var entry = entries[index];
2227
- this.set(entry[0], entry[1]);
2228
- }
2229
- }
2230
-
2231
- /**
2232
- * Removes all key-value entries from the map.
2233
- *
2234
- * @private
2235
- * @name clear
2236
- * @memberOf MapCache
2237
- */
2238
- function mapCacheClear() {
2239
- this.size = 0;
2240
- this.__data__ = {
2241
- 'hash': new Hash,
2242
- 'map': new (Map || ListCache),
2243
- 'string': new Hash
2244
- };
2245
- }
2246
-
2247
- /**
2248
- * Removes `key` and its value from the map.
2249
- *
2250
- * @private
2251
- * @name delete
2252
- * @memberOf MapCache
2253
- * @param {string} key The key of the value to remove.
2254
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2255
- */
2256
- function mapCacheDelete(key) {
2257
- var result = getMapData(this, key)['delete'](key);
2258
- this.size -= result ? 1 : 0;
2259
- return result;
2260
- }
2261
-
2262
- /**
2263
- * Gets the map value for `key`.
2264
- *
2265
- * @private
2266
- * @name get
2267
- * @memberOf MapCache
2268
- * @param {string} key The key of the value to get.
2269
- * @returns {*} Returns the entry value.
2270
- */
2271
- function mapCacheGet(key) {
2272
- return getMapData(this, key).get(key);
2273
- }
2274
-
2275
- /**
2276
- * Checks if a map value for `key` exists.
2277
- *
2278
- * @private
2279
- * @name has
2280
- * @memberOf MapCache
2281
- * @param {string} key The key of the entry to check.
2282
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2283
- */
2284
- function mapCacheHas(key) {
2285
- return getMapData(this, key).has(key);
2286
- }
2287
-
2288
- /**
2289
- * Sets the map `key` to `value`.
2290
- *
2291
- * @private
2292
- * @name set
2293
- * @memberOf MapCache
2294
- * @param {string} key The key of the value to set.
2295
- * @param {*} value The value to set.
2296
- * @returns {Object} Returns the map cache instance.
2297
- */
2298
- function mapCacheSet(key, value) {
2299
- var data = getMapData(this, key),
2300
- size = data.size;
2301
-
2302
- data.set(key, value);
2303
- this.size += data.size == size ? 0 : 1;
2304
- return this;
2305
- }
2306
-
2307
- // Add methods to `MapCache`.
2308
- MapCache.prototype.clear = mapCacheClear;
2309
- MapCache.prototype['delete'] = mapCacheDelete;
2310
- MapCache.prototype.get = mapCacheGet;
2311
- MapCache.prototype.has = mapCacheHas;
2312
- MapCache.prototype.set = mapCacheSet;
2313
-
2314
- /**
2315
- * Creates a stack cache object to store key-value pairs.
2316
- *
2317
- * @private
2318
- * @constructor
2319
- * @param {Array} [entries] The key-value pairs to cache.
2320
- */
2321
- function Stack(entries) {
2322
- var data = this.__data__ = new ListCache(entries);
2323
- this.size = data.size;
2324
- }
2325
-
2326
- /**
2327
- * Removes all key-value entries from the stack.
2328
- *
2329
- * @private
2330
- * @name clear
2331
- * @memberOf Stack
2332
- */
2333
- function stackClear() {
2334
- this.__data__ = new ListCache;
2335
- this.size = 0;
2336
- }
2337
-
2338
- /**
2339
- * Removes `key` and its value from the stack.
2340
- *
2341
- * @private
2342
- * @name delete
2343
- * @memberOf Stack
2344
- * @param {string} key The key of the value to remove.
2345
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2346
- */
2347
- function stackDelete(key) {
2348
- var data = this.__data__,
2349
- result = data['delete'](key);
2350
-
2351
- this.size = data.size;
2352
- return result;
2353
- }
2354
-
2355
- /**
2356
- * Gets the stack value for `key`.
2357
- *
2358
- * @private
2359
- * @name get
2360
- * @memberOf Stack
2361
- * @param {string} key The key of the value to get.
2362
- * @returns {*} Returns the entry value.
2363
- */
2364
- function stackGet(key) {
2365
- return this.__data__.get(key);
2366
- }
2367
-
2368
- /**
2369
- * Checks if a stack value for `key` exists.
2370
- *
2371
- * @private
2372
- * @name has
2373
- * @memberOf Stack
2374
- * @param {string} key The key of the entry to check.
2375
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2376
- */
2377
- function stackHas(key) {
2378
- return this.__data__.has(key);
2379
- }
2380
-
2381
- /**
2382
- * Sets the stack `key` to `value`.
2383
- *
2384
- * @private
2385
- * @name set
2386
- * @memberOf Stack
2387
- * @param {string} key The key of the value to set.
2388
- * @param {*} value The value to set.
2389
- * @returns {Object} Returns the stack cache instance.
2390
- */
2391
- function stackSet(key, value) {
2392
- var data = this.__data__;
2393
- if (data instanceof ListCache) {
2394
- var pairs = data.__data__;
2395
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
2396
- pairs.push([key, value]);
2397
- this.size = ++data.size;
2398
- return this;
2399
- }
2400
- data = this.__data__ = new MapCache(pairs);
2401
- }
2402
- data.set(key, value);
2403
- this.size = data.size;
2404
- return this;
2405
- }
2406
-
2407
- // Add methods to `Stack`.
2408
- Stack.prototype.clear = stackClear;
2409
- Stack.prototype['delete'] = stackDelete;
2410
- Stack.prototype.get = stackGet;
2411
- Stack.prototype.has = stackHas;
2412
- Stack.prototype.set = stackSet;
2413
-
2414
- /**
2415
- * Creates an array of the enumerable property names of the array-like `value`.
2416
- *
2417
- * @private
2418
- * @param {*} value The value to query.
2419
- * @param {boolean} inherited Specify returning inherited property names.
2420
- * @returns {Array} Returns the array of property names.
2421
- */
2422
- function arrayLikeKeys(value, inherited) {
2423
- var isArr = isArray(value),
2424
- isArg = !isArr && isArguments(value),
2425
- isBuff = !isArr && !isArg && isBuffer(value),
2426
- isType = !isArr && !isArg && !isBuff && isTypedArray(value),
2427
- skipIndexes = isArr || isArg || isBuff || isType,
2428
- result = skipIndexes ? baseTimes(value.length, String) : [],
2429
- length = result.length;
2430
-
2431
- for (var key in value) {
2432
- if ((inherited || hasOwnProperty.call(value, key)) &&
2433
- !(skipIndexes && (
2434
- // Safari 9 has enumerable `arguments.length` in strict mode.
2435
- key == 'length' ||
2436
- // Node.js 0.10 has enumerable non-index properties on buffers.
2437
- (isBuff && (key == 'offset' || key == 'parent')) ||
2438
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
2439
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
2440
- // Skip index properties.
2441
- isIndex(key, length)
2442
- ))) {
2443
- result.push(key);
2444
- }
2445
- }
2446
- return result;
2447
- }
2448
-
2449
- /**
2450
- * This function is like `assignValue` except that it doesn't assign
2451
- * `undefined` values.
2452
- *
2453
- * @private
2454
- * @param {Object} object The object to modify.
2455
- * @param {string} key The key of the property to assign.
2456
- * @param {*} value The value to assign.
2457
- */
2458
- function assignMergeValue(object, key, value) {
2459
- if ((value !== undefined && !eq(object[key], value)) ||
2460
- (value === undefined && !(key in object))) {
2461
- baseAssignValue(object, key, value);
2462
- }
2463
- }
2464
-
2465
- /**
2466
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
2467
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2468
- * for equality comparisons.
2469
- *
2470
- * @private
2471
- * @param {Object} object The object to modify.
2472
- * @param {string} key The key of the property to assign.
2473
- * @param {*} value The value to assign.
2474
- */
2475
- function assignValue(object, key, value) {
2476
- var objValue = object[key];
2477
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
2478
- (value === undefined && !(key in object))) {
2479
- baseAssignValue(object, key, value);
2480
- }
2481
- }
2482
-
2483
- /**
2484
- * Gets the index at which the `key` is found in `array` of key-value pairs.
2485
- *
2486
- * @private
2487
- * @param {Array} array The array to inspect.
2488
- * @param {*} key The key to search for.
2489
- * @returns {number} Returns the index of the matched value, else `-1`.
2490
- */
2491
- function assocIndexOf(array, key) {
2492
- var length = array.length;
2493
- while (length--) {
2494
- if (eq(array[length][0], key)) {
2495
- return length;
2496
- }
2497
- }
2498
- return -1;
2499
- }
2500
-
2501
- /**
2502
- * The base implementation of `assignValue` and `assignMergeValue` without
2503
- * value checks.
2504
- *
2505
- * @private
2506
- * @param {Object} object The object to modify.
2507
- * @param {string} key The key of the property to assign.
2508
- * @param {*} value The value to assign.
2509
- */
2510
- function baseAssignValue(object, key, value) {
2511
- if (key == '__proto__' && defineProperty) {
2512
- defineProperty(object, key, {
2513
- 'configurable': true,
2514
- 'enumerable': true,
2515
- 'value': value,
2516
- 'writable': true
2517
- });
2518
- } else {
2519
- object[key] = value;
2520
- }
2521
- }
2522
-
2523
- /**
2524
- * The base implementation of `baseForOwn` which iterates over `object`
2525
- * properties returned by `keysFunc` and invokes `iteratee` for each property.
2526
- * Iteratee functions may exit iteration early by explicitly returning `false`.
2527
- *
2528
- * @private
2529
- * @param {Object} object The object to iterate over.
2530
- * @param {Function} iteratee The function invoked per iteration.
2531
- * @param {Function} keysFunc The function to get the keys of `object`.
2532
- * @returns {Object} Returns `object`.
2533
- */
2534
- var baseFor = createBaseFor();
2535
-
2536
- /**
2537
- * The base implementation of `getTag` without fallbacks for buggy environments.
2538
- *
2539
- * @private
2540
- * @param {*} value The value to query.
2541
- * @returns {string} Returns the `toStringTag`.
2542
- */
2543
- function baseGetTag(value) {
2544
- if (value == null) {
2545
- return value === undefined ? undefinedTag : nullTag;
2546
- }
2547
- return (symToStringTag && symToStringTag in Object(value))
2548
- ? getRawTag(value)
2549
- : objectToString(value);
2550
- }
2551
-
2552
- /**
2553
- * The base implementation of `_.isArguments`.
2554
- *
2555
- * @private
2556
- * @param {*} value The value to check.
2557
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
2558
- */
2559
- function baseIsArguments(value) {
2560
- return isObjectLike(value) && baseGetTag(value) == argsTag;
2561
- }
2562
-
2563
- /**
2564
- * The base implementation of `_.isNative` without bad shim checks.
2565
- *
2566
- * @private
2567
- * @param {*} value The value to check.
2568
- * @returns {boolean} Returns `true` if `value` is a native function,
2569
- * else `false`.
2570
- */
2571
- function baseIsNative(value) {
2572
- if (!isObject(value) || isMasked(value)) {
2573
- return false;
2574
- }
2575
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
2576
- return pattern.test(toSource(value));
2577
- }
2578
-
2579
- /**
2580
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
2581
- *
2582
- * @private
2583
- * @param {*} value The value to check.
2584
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2585
- */
2586
- function baseIsTypedArray(value) {
2587
- return isObjectLike(value) &&
2588
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
2589
- }
2590
-
2591
- /**
2592
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
2593
- *
2594
- * @private
2595
- * @param {Object} object The object to query.
2596
- * @returns {Array} Returns the array of property names.
2597
- */
2598
- function baseKeysIn(object) {
2599
- if (!isObject(object)) {
2600
- return nativeKeysIn(object);
2601
- }
2602
- var isProto = isPrototype(object),
2603
- result = [];
2604
-
2605
- for (var key in object) {
2606
- if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
2607
- result.push(key);
2608
- }
2609
- }
2610
- return result;
2611
- }
2612
-
2613
- /**
2614
- * The base implementation of `_.merge` without support for multiple sources.
2615
- *
2616
- * @private
2617
- * @param {Object} object The destination object.
2618
- * @param {Object} source The source object.
2619
- * @param {number} srcIndex The index of `source`.
2620
- * @param {Function} [customizer] The function to customize merged values.
2621
- * @param {Object} [stack] Tracks traversed source values and their merged
2622
- * counterparts.
2623
- */
2624
- function baseMerge(object, source, srcIndex, customizer, stack) {
2625
- if (object === source) {
2626
- return;
2627
- }
2628
- baseFor(source, function(srcValue, key) {
2629
- stack || (stack = new Stack);
2630
- if (isObject(srcValue)) {
2631
- baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
2632
- }
2633
- else {
2634
- var newValue = customizer
2635
- ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
2636
- : undefined;
2637
-
2638
- if (newValue === undefined) {
2639
- newValue = srcValue;
2640
- }
2641
- assignMergeValue(object, key, newValue);
2642
- }
2643
- }, keysIn);
2644
- }
2645
-
2646
- /**
2647
- * A specialized version of `baseMerge` for arrays and objects which performs
2648
- * deep merges and tracks traversed objects enabling objects with circular
2649
- * references to be merged.
2650
- *
2651
- * @private
2652
- * @param {Object} object The destination object.
2653
- * @param {Object} source The source object.
2654
- * @param {string} key The key of the value to merge.
2655
- * @param {number} srcIndex The index of `source`.
2656
- * @param {Function} mergeFunc The function to merge values.
2657
- * @param {Function} [customizer] The function to customize assigned values.
2658
- * @param {Object} [stack] Tracks traversed source values and their merged
2659
- * counterparts.
2660
- */
2661
- function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
2662
- var objValue = safeGet(object, key),
2663
- srcValue = safeGet(source, key),
2664
- stacked = stack.get(srcValue);
2665
-
2666
- if (stacked) {
2667
- assignMergeValue(object, key, stacked);
2668
- return;
2669
- }
2670
- var newValue = customizer
2671
- ? customizer(objValue, srcValue, (key + ''), object, source, stack)
2672
- : undefined;
2673
-
2674
- var isCommon = newValue === undefined;
2675
-
2676
- if (isCommon) {
2677
- var isArr = isArray(srcValue),
2678
- isBuff = !isArr && isBuffer(srcValue),
2679
- isTyped = !isArr && !isBuff && isTypedArray(srcValue);
2680
-
2681
- newValue = srcValue;
2682
- if (isArr || isBuff || isTyped) {
2683
- if (isArray(objValue)) {
2684
- newValue = objValue;
2685
- }
2686
- else if (isArrayLikeObject(objValue)) {
2687
- newValue = copyArray(objValue);
2688
- }
2689
- else if (isBuff) {
2690
- isCommon = false;
2691
- newValue = cloneBuffer(srcValue, true);
2692
- }
2693
- else if (isTyped) {
2694
- isCommon = false;
2695
- newValue = cloneTypedArray(srcValue, true);
2696
- }
2697
- else {
2698
- newValue = [];
2699
- }
2700
- }
2701
- else if (isPlainObject(srcValue) || isArguments(srcValue)) {
2702
- newValue = objValue;
2703
- if (isArguments(objValue)) {
2704
- newValue = toPlainObject(objValue);
2705
- }
2706
- else if (!isObject(objValue) || isFunction(objValue)) {
2707
- newValue = initCloneObject(srcValue);
2708
- }
2709
- }
2710
- else {
2711
- isCommon = false;
2712
- }
2713
- }
2714
- if (isCommon) {
2715
- // Recursively merge objects and arrays (susceptible to call stack limits).
2716
- stack.set(srcValue, newValue);
2717
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
2718
- stack['delete'](srcValue);
2719
- }
2720
- assignMergeValue(object, key, newValue);
2721
- }
2722
-
2723
- /**
2724
- * The base implementation of `_.rest` which doesn't validate or coerce arguments.
2725
- *
2726
- * @private
2727
- * @param {Function} func The function to apply a rest parameter to.
2728
- * @param {number} [start=func.length-1] The start position of the rest parameter.
2729
- * @returns {Function} Returns the new function.
2730
- */
2731
- function baseRest(func, start) {
2732
- return setToString(overRest(func, start, identity), func + '');
2733
- }
2734
-
2735
- /**
2736
- * The base implementation of `setToString` without support for hot loop shorting.
2737
- *
2738
- * @private
2739
- * @param {Function} func The function to modify.
2740
- * @param {Function} string The `toString` result.
2741
- * @returns {Function} Returns `func`.
2742
- */
2743
- var baseSetToString = !defineProperty ? identity : function(func, string) {
2744
- return defineProperty(func, 'toString', {
2745
- 'configurable': true,
2746
- 'enumerable': false,
2747
- 'value': constant(string),
2748
- 'writable': true
2749
- });
2750
- };
2751
-
2752
- /**
2753
- * Creates a clone of `buffer`.
2754
- *
2755
- * @private
2756
- * @param {Buffer} buffer The buffer to clone.
2757
- * @param {boolean} [isDeep] Specify a deep clone.
2758
- * @returns {Buffer} Returns the cloned buffer.
2759
- */
2760
- function cloneBuffer(buffer, isDeep) {
2761
- if (isDeep) {
2762
- return buffer.slice();
2763
- }
2764
- var length = buffer.length,
2765
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
2766
-
2767
- buffer.copy(result);
2768
- return result;
2769
- }
2770
-
2771
- /**
2772
- * Creates a clone of `arrayBuffer`.
2773
- *
2774
- * @private
2775
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
2776
- * @returns {ArrayBuffer} Returns the cloned array buffer.
2777
- */
2778
- function cloneArrayBuffer(arrayBuffer) {
2779
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2780
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
2781
- return result;
2782
- }
2783
-
2784
- /**
2785
- * Creates a clone of `typedArray`.
2786
- *
2787
- * @private
2788
- * @param {Object} typedArray The typed array to clone.
2789
- * @param {boolean} [isDeep] Specify a deep clone.
2790
- * @returns {Object} Returns the cloned typed array.
2791
- */
2792
- function cloneTypedArray(typedArray, isDeep) {
2793
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
2794
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2795
- }
2796
-
2797
- /**
2798
- * Copies the values of `source` to `array`.
2799
- *
2800
- * @private
2801
- * @param {Array} source The array to copy values from.
2802
- * @param {Array} [array=[]] The array to copy values to.
2803
- * @returns {Array} Returns `array`.
2804
- */
2805
- function copyArray(source, array) {
2806
- var index = -1,
2807
- length = source.length;
2808
-
2809
- array || (array = Array(length));
2810
- while (++index < length) {
2811
- array[index] = source[index];
2812
- }
2813
- return array;
2814
- }
2815
-
2816
- /**
2817
- * Copies properties of `source` to `object`.
2818
- *
2819
- * @private
2820
- * @param {Object} source The object to copy properties from.
2821
- * @param {Array} props The property identifiers to copy.
2822
- * @param {Object} [object={}] The object to copy properties to.
2823
- * @param {Function} [customizer] The function to customize copied values.
2824
- * @returns {Object} Returns `object`.
2825
- */
2826
- function copyObject(source, props, object, customizer) {
2827
- var isNew = !object;
2828
- object || (object = {});
2829
-
2830
- var index = -1,
2831
- length = props.length;
2832
-
2833
- while (++index < length) {
2834
- var key = props[index];
2835
-
2836
- var newValue = customizer
2837
- ? customizer(object[key], source[key], key, object, source)
2838
- : undefined;
2839
-
2840
- if (newValue === undefined) {
2841
- newValue = source[key];
2842
- }
2843
- if (isNew) {
2844
- baseAssignValue(object, key, newValue);
2845
- } else {
2846
- assignValue(object, key, newValue);
2847
- }
2848
- }
2849
- return object;
2850
- }
2851
-
2852
- /**
2853
- * Creates a function like `_.assign`.
2854
- *
2855
- * @private
2856
- * @param {Function} assigner The function to assign values.
2857
- * @returns {Function} Returns the new assigner function.
2858
- */
2859
- function createAssigner(assigner) {
2860
- return baseRest(function(object, sources) {
2861
- var index = -1,
2862
- length = sources.length,
2863
- customizer = length > 1 ? sources[length - 1] : undefined,
2864
- guard = length > 2 ? sources[2] : undefined;
2865
-
2866
- customizer = (assigner.length > 3 && typeof customizer == 'function')
2867
- ? (length--, customizer)
2868
- : undefined;
2869
-
2870
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
2871
- customizer = length < 3 ? undefined : customizer;
2872
- length = 1;
2873
- }
2874
- object = Object(object);
2875
- while (++index < length) {
2876
- var source = sources[index];
2877
- if (source) {
2878
- assigner(object, source, index, customizer);
2879
- }
2880
- }
2881
- return object;
2882
- });
2883
- }
2884
-
2885
- /**
2886
- * Creates a base function for methods like `_.forIn` and `_.forOwn`.
2887
- *
2888
- * @private
2889
- * @param {boolean} [fromRight] Specify iterating from right to left.
2890
- * @returns {Function} Returns the new base function.
2891
- */
2892
- function createBaseFor(fromRight) {
2893
- return function(object, iteratee, keysFunc) {
2894
- var index = -1,
2895
- iterable = Object(object),
2896
- props = keysFunc(object),
2897
- length = props.length;
2898
-
2899
- while (length--) {
2900
- var key = props[fromRight ? length : ++index];
2901
- if (iteratee(iterable[key], key, iterable) === false) {
2902
- break;
2903
- }
2904
- }
2905
- return object;
2906
- };
2907
- }
2908
-
2909
- /**
2910
- * Gets the data for `map`.
2911
- *
2912
- * @private
2913
- * @param {Object} map The map to query.
2914
- * @param {string} key The reference key.
2915
- * @returns {*} Returns the map data.
2916
- */
2917
- function getMapData(map, key) {
2918
- var data = map.__data__;
2919
- return isKeyable(key)
2920
- ? data[typeof key == 'string' ? 'string' : 'hash']
2921
- : data.map;
2922
- }
2923
-
2924
- /**
2925
- * Gets the native function at `key` of `object`.
2926
- *
2927
- * @private
2928
- * @param {Object} object The object to query.
2929
- * @param {string} key The key of the method to get.
2930
- * @returns {*} Returns the function if it's native, else `undefined`.
2931
- */
2932
- function getNative(object, key) {
2933
- var value = getValue(object, key);
2934
- return baseIsNative(value) ? value : undefined;
2935
- }
2936
-
2937
- /**
2938
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
2939
- *
2940
- * @private
2941
- * @param {*} value The value to query.
2942
- * @returns {string} Returns the raw `toStringTag`.
2943
- */
2944
- function getRawTag(value) {
2945
- var isOwn = hasOwnProperty.call(value, symToStringTag),
2946
- tag = value[symToStringTag];
2947
-
2948
- try {
2949
- value[symToStringTag] = undefined;
2950
- var unmasked = true;
2951
- } catch (e) {}
2952
-
2953
- var result = nativeObjectToString.call(value);
2954
- if (unmasked) {
2955
- if (isOwn) {
2956
- value[symToStringTag] = tag;
2957
- } else {
2958
- delete value[symToStringTag];
2959
- }
2960
- }
2961
- return result;
2962
- }
2963
-
2964
- /**
2965
- * Initializes an object clone.
2966
- *
2967
- * @private
2968
- * @param {Object} object The object to clone.
2969
- * @returns {Object} Returns the initialized clone.
2970
- */
2971
- function initCloneObject(object) {
2972
- return (typeof object.constructor == 'function' && !isPrototype(object))
2973
- ? baseCreate(getPrototype(object))
2974
- : {};
2975
- }
2976
-
2977
- /**
2978
- * Checks if `value` is a valid array-like index.
2979
- *
2980
- * @private
2981
- * @param {*} value The value to check.
2982
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
2983
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
2984
- */
2985
- function isIndex(value, length) {
2986
- var type = typeof value;
2987
- length = length == null ? MAX_SAFE_INTEGER : length;
2988
-
2989
- return !!length &&
2990
- (type == 'number' ||
2991
- (type != 'symbol' && reIsUint.test(value))) &&
2992
- (value > -1 && value % 1 == 0 && value < length);
2993
- }
2994
-
2995
- /**
2996
- * Checks if the given arguments are from an iteratee call.
2997
- *
2998
- * @private
2999
- * @param {*} value The potential iteratee value argument.
3000
- * @param {*} index The potential iteratee index or key argument.
3001
- * @param {*} object The potential iteratee object argument.
3002
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
3003
- * else `false`.
3004
- */
3005
- function isIterateeCall(value, index, object) {
3006
- if (!isObject(object)) {
3007
- return false;
3008
- }
3009
- var type = typeof index;
3010
- if (type == 'number'
3011
- ? (isArrayLike(object) && isIndex(index, object.length))
3012
- : (type == 'string' && index in object)
3013
- ) {
3014
- return eq(object[index], value);
3015
- }
3016
- return false;
3017
- }
3018
-
3019
- /**
3020
- * Checks if `value` is suitable for use as unique object key.
3021
- *
3022
- * @private
3023
- * @param {*} value The value to check.
3024
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
3025
- */
3026
- function isKeyable(value) {
3027
- var type = typeof value;
3028
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
3029
- ? (value !== '__proto__')
3030
- : (value === null);
3031
- }
3032
-
3033
- /**
3034
- * Checks if `func` has its source masked.
3035
- *
3036
- * @private
3037
- * @param {Function} func The function to check.
3038
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
3039
- */
3040
- function isMasked(func) {
3041
- return !!maskSrcKey && (maskSrcKey in func);
3042
- }
3043
-
3044
- /**
3045
- * Checks if `value` is likely a prototype object.
3046
- *
3047
- * @private
3048
- * @param {*} value The value to check.
3049
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
3050
- */
3051
- function isPrototype(value) {
3052
- var Ctor = value && value.constructor,
3053
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
3054
-
3055
- return value === proto;
3056
- }
3057
-
3058
- /**
3059
- * This function is like
3060
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
3061
- * except that it includes inherited enumerable properties.
3062
- *
3063
- * @private
3064
- * @param {Object} object The object to query.
3065
- * @returns {Array} Returns the array of property names.
3066
- */
3067
- function nativeKeysIn(object) {
3068
- var result = [];
3069
- if (object != null) {
3070
- for (var key in Object(object)) {
3071
- result.push(key);
3072
- }
3073
- }
3074
- return result;
3075
- }
3076
-
3077
- /**
3078
- * Converts `value` to a string using `Object.prototype.toString`.
3079
- *
3080
- * @private
3081
- * @param {*} value The value to convert.
3082
- * @returns {string} Returns the converted string.
3083
- */
3084
- function objectToString(value) {
3085
- return nativeObjectToString.call(value);
3086
- }
3087
-
3088
- /**
3089
- * A specialized version of `baseRest` which transforms the rest array.
3090
- *
3091
- * @private
3092
- * @param {Function} func The function to apply a rest parameter to.
3093
- * @param {number} [start=func.length-1] The start position of the rest parameter.
3094
- * @param {Function} transform The rest array transform.
3095
- * @returns {Function} Returns the new function.
3096
- */
3097
- function overRest(func, start, transform) {
3098
- start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
3099
- return function() {
3100
- var args = arguments,
3101
- index = -1,
3102
- length = nativeMax(args.length - start, 0),
3103
- array = Array(length);
3104
-
3105
- while (++index < length) {
3106
- array[index] = args[start + index];
3107
- }
3108
- index = -1;
3109
- var otherArgs = Array(start + 1);
3110
- while (++index < start) {
3111
- otherArgs[index] = args[index];
3112
- }
3113
- otherArgs[start] = transform(array);
3114
- return apply(func, this, otherArgs);
3115
- };
3116
- }
3117
-
3118
- /**
3119
- * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
3120
- *
3121
- * @private
3122
- * @param {Object} object The object to query.
3123
- * @param {string} key The key of the property to get.
3124
- * @returns {*} Returns the property value.
3125
- */
3126
- function safeGet(object, key) {
3127
- if (key === 'constructor' && typeof object[key] === 'function') {
3128
- return;
3129
- }
3130
-
3131
- if (key == '__proto__') {
3132
- return;
3133
- }
3134
-
3135
- return object[key];
3136
- }
3137
-
3138
- /**
3139
- * Sets the `toString` method of `func` to return `string`.
3140
- *
3141
- * @private
3142
- * @param {Function} func The function to modify.
3143
- * @param {Function} string The `toString` result.
3144
- * @returns {Function} Returns `func`.
3145
- */
3146
- var setToString = shortOut(baseSetToString);
3147
-
3148
- /**
3149
- * Creates a function that'll short out and invoke `identity` instead
3150
- * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
3151
- * milliseconds.
3152
- *
3153
- * @private
3154
- * @param {Function} func The function to restrict.
3155
- * @returns {Function} Returns the new shortable function.
3156
- */
3157
- function shortOut(func) {
3158
- var count = 0,
3159
- lastCalled = 0;
3160
-
3161
- return function() {
3162
- var stamp = nativeNow(),
3163
- remaining = HOT_SPAN - (stamp - lastCalled);
3164
-
3165
- lastCalled = stamp;
3166
- if (remaining > 0) {
3167
- if (++count >= HOT_COUNT) {
3168
- return arguments[0];
3169
- }
3170
- } else {
3171
- count = 0;
3172
- }
3173
- return func.apply(undefined, arguments);
3174
- };
3175
- }
3176
-
3177
- /**
3178
- * Converts `func` to its source code.
3179
- *
3180
- * @private
3181
- * @param {Function} func The function to convert.
3182
- * @returns {string} Returns the source code.
3183
- */
3184
- function toSource(func) {
3185
- if (func != null) {
3186
- try {
3187
- return funcToString.call(func);
3188
- } catch (e) {}
3189
- try {
3190
- return (func + '');
3191
- } catch (e) {}
3192
- }
3193
- return '';
3194
- }
3195
-
3196
- /**
3197
- * Performs a
3198
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
3199
- * comparison between two values to determine if they are equivalent.
3200
- *
3201
- * @static
3202
- * @memberOf _
3203
- * @since 4.0.0
3204
- * @category Lang
3205
- * @param {*} value The value to compare.
3206
- * @param {*} other The other value to compare.
3207
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
3208
- * @example
3209
- *
3210
- * var object = { 'a': 1 };
3211
- * var other = { 'a': 1 };
3212
- *
3213
- * _.eq(object, object);
3214
- * // => true
3215
- *
3216
- * _.eq(object, other);
3217
- * // => false
3218
- *
3219
- * _.eq('a', 'a');
3220
- * // => true
3221
- *
3222
- * _.eq('a', Object('a'));
3223
- * // => false
3224
- *
3225
- * _.eq(NaN, NaN);
3226
- * // => true
3227
- */
3228
- function eq(value, other) {
3229
- return value === other || (value !== value && other !== other);
3230
- }
3231
-
3232
- /**
3233
- * Checks if `value` is likely an `arguments` object.
3234
- *
3235
- * @static
3236
- * @memberOf _
3237
- * @since 0.1.0
3238
- * @category Lang
3239
- * @param {*} value The value to check.
3240
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
3241
- * else `false`.
3242
- * @example
3243
- *
3244
- * _.isArguments(function() { return arguments; }());
3245
- * // => true
3246
- *
3247
- * _.isArguments([1, 2, 3]);
3248
- * // => false
3249
- */
3250
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
3251
- return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
3252
- !propertyIsEnumerable.call(value, 'callee');
3253
- };
3254
-
3255
- /**
3256
- * Checks if `value` is classified as an `Array` object.
3257
- *
3258
- * @static
3259
- * @memberOf _
3260
- * @since 0.1.0
3261
- * @category Lang
3262
- * @param {*} value The value to check.
3263
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
3264
- * @example
3265
- *
3266
- * _.isArray([1, 2, 3]);
3267
- * // => true
3268
- *
3269
- * _.isArray(document.body.children);
3270
- * // => false
3271
- *
3272
- * _.isArray('abc');
3273
- * // => false
3274
- *
3275
- * _.isArray(_.noop);
3276
- * // => false
3277
- */
3278
- var isArray = Array.isArray;
3279
-
3280
- /**
3281
- * Checks if `value` is array-like. A value is considered array-like if it's
3282
- * not a function and has a `value.length` that's an integer greater than or
3283
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
3284
- *
3285
- * @static
3286
- * @memberOf _
3287
- * @since 4.0.0
3288
- * @category Lang
3289
- * @param {*} value The value to check.
3290
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
3291
- * @example
3292
- *
3293
- * _.isArrayLike([1, 2, 3]);
3294
- * // => true
3295
- *
3296
- * _.isArrayLike(document.body.children);
3297
- * // => true
3298
- *
3299
- * _.isArrayLike('abc');
3300
- * // => true
3301
- *
3302
- * _.isArrayLike(_.noop);
3303
- * // => false
3304
- */
3305
- function isArrayLike(value) {
3306
- return value != null && isLength(value.length) && !isFunction(value);
3307
- }
3308
-
3309
- /**
3310
- * This method is like `_.isArrayLike` except that it also checks if `value`
3311
- * is an object.
3312
- *
3313
- * @static
3314
- * @memberOf _
3315
- * @since 4.0.0
3316
- * @category Lang
3317
- * @param {*} value The value to check.
3318
- * @returns {boolean} Returns `true` if `value` is an array-like object,
3319
- * else `false`.
3320
- * @example
3321
- *
3322
- * _.isArrayLikeObject([1, 2, 3]);
3323
- * // => true
3324
- *
3325
- * _.isArrayLikeObject(document.body.children);
3326
- * // => true
3327
- *
3328
- * _.isArrayLikeObject('abc');
3329
- * // => false
3330
- *
3331
- * _.isArrayLikeObject(_.noop);
3332
- * // => false
3333
- */
3334
- function isArrayLikeObject(value) {
3335
- return isObjectLike(value) && isArrayLike(value);
3336
- }
3337
-
3338
- /**
3339
- * Checks if `value` is a buffer.
3340
- *
3341
- * @static
3342
- * @memberOf _
3343
- * @since 4.3.0
3344
- * @category Lang
3345
- * @param {*} value The value to check.
3346
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
3347
- * @example
3348
- *
3349
- * _.isBuffer(new Buffer(2));
3350
- * // => true
3351
- *
3352
- * _.isBuffer(new Uint8Array(2));
3353
- * // => false
3354
- */
3355
- var isBuffer = nativeIsBuffer || stubFalse;
3356
-
3357
- /**
3358
- * Checks if `value` is classified as a `Function` object.
3359
- *
3360
- * @static
3361
- * @memberOf _
3362
- * @since 0.1.0
3363
- * @category Lang
3364
- * @param {*} value The value to check.
3365
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
3366
- * @example
3367
- *
3368
- * _.isFunction(_);
3369
- * // => true
3370
- *
3371
- * _.isFunction(/abc/);
3372
- * // => false
3373
- */
3374
- function isFunction(value) {
3375
- if (!isObject(value)) {
3376
- return false;
3377
- }
3378
- // The use of `Object#toString` avoids issues with the `typeof` operator
3379
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
3380
- var tag = baseGetTag(value);
3381
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
3382
- }
3383
-
3384
- /**
3385
- * Checks if `value` is a valid array-like length.
3386
- *
3387
- * **Note:** This method is loosely based on
3388
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
3389
- *
3390
- * @static
3391
- * @memberOf _
3392
- * @since 4.0.0
3393
- * @category Lang
3394
- * @param {*} value The value to check.
3395
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
3396
- * @example
3397
- *
3398
- * _.isLength(3);
3399
- * // => true
3400
- *
3401
- * _.isLength(Number.MIN_VALUE);
3402
- * // => false
3403
- *
3404
- * _.isLength(Infinity);
3405
- * // => false
3406
- *
3407
- * _.isLength('3');
3408
- * // => false
3409
- */
3410
- function isLength(value) {
3411
- return typeof value == 'number' &&
3412
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
3413
- }
3414
-
3415
- /**
3416
- * Checks if `value` is the
3417
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
3418
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
3419
- *
3420
- * @static
3421
- * @memberOf _
3422
- * @since 0.1.0
3423
- * @category Lang
3424
- * @param {*} value The value to check.
3425
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
3426
- * @example
3427
- *
3428
- * _.isObject({});
3429
- * // => true
3430
- *
3431
- * _.isObject([1, 2, 3]);
3432
- * // => true
3433
- *
3434
- * _.isObject(_.noop);
3435
- * // => true
3436
- *
3437
- * _.isObject(null);
3438
- * // => false
3439
- */
3440
- function isObject(value) {
3441
- var type = typeof value;
3442
- return value != null && (type == 'object' || type == 'function');
3443
- }
3444
-
3445
- /**
3446
- * Checks if `value` is object-like. A value is object-like if it's not `null`
3447
- * and has a `typeof` result of "object".
3448
- *
3449
- * @static
3450
- * @memberOf _
3451
- * @since 4.0.0
3452
- * @category Lang
3453
- * @param {*} value The value to check.
3454
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
3455
- * @example
3456
- *
3457
- * _.isObjectLike({});
3458
- * // => true
3459
- *
3460
- * _.isObjectLike([1, 2, 3]);
3461
- * // => true
3462
- *
3463
- * _.isObjectLike(_.noop);
3464
- * // => false
3465
- *
3466
- * _.isObjectLike(null);
3467
- * // => false
3468
- */
3469
- function isObjectLike(value) {
3470
- return value != null && typeof value == 'object';
3471
- }
3472
-
3473
- /**
3474
- * Checks if `value` is a plain object, that is, an object created by the
3475
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
3476
- *
3477
- * @static
3478
- * @memberOf _
3479
- * @since 0.8.0
3480
- * @category Lang
3481
- * @param {*} value The value to check.
3482
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
3483
- * @example
3484
- *
3485
- * function Foo() {
3486
- * this.a = 1;
3487
- * }
3488
- *
3489
- * _.isPlainObject(new Foo);
3490
- * // => false
3491
- *
3492
- * _.isPlainObject([1, 2, 3]);
3493
- * // => false
3494
- *
3495
- * _.isPlainObject({ 'x': 0, 'y': 0 });
3496
- * // => true
3497
- *
3498
- * _.isPlainObject(Object.create(null));
3499
- * // => true
3500
- */
3501
- function isPlainObject(value) {
3502
- if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
3503
- return false;
3504
- }
3505
- var proto = getPrototype(value);
3506
- if (proto === null) {
3507
- return true;
3508
- }
3509
- var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
3510
- return typeof Ctor == 'function' && Ctor instanceof Ctor &&
3511
- funcToString.call(Ctor) == objectCtorString;
3512
- }
3513
-
3514
- /**
3515
- * Checks if `value` is classified as a typed array.
3516
- *
3517
- * @static
3518
- * @memberOf _
3519
- * @since 3.0.0
3520
- * @category Lang
3521
- * @param {*} value The value to check.
3522
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
3523
- * @example
3524
- *
3525
- * _.isTypedArray(new Uint8Array);
3526
- * // => true
3527
- *
3528
- * _.isTypedArray([]);
3529
- * // => false
3530
- */
3531
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
3532
-
3533
- /**
3534
- * Converts `value` to a plain object flattening inherited enumerable string
3535
- * keyed properties of `value` to own properties of the plain object.
3536
- *
3537
- * @static
3538
- * @memberOf _
3539
- * @since 3.0.0
3540
- * @category Lang
3541
- * @param {*} value The value to convert.
3542
- * @returns {Object} Returns the converted plain object.
3543
- * @example
3544
- *
3545
- * function Foo() {
3546
- * this.b = 2;
3547
- * }
3548
- *
3549
- * Foo.prototype.c = 3;
3550
- *
3551
- * _.assign({ 'a': 1 }, new Foo);
3552
- * // => { 'a': 1, 'b': 2 }
3553
- *
3554
- * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
3555
- * // => { 'a': 1, 'b': 2, 'c': 3 }
3556
- */
3557
- function toPlainObject(value) {
3558
- return copyObject(value, keysIn(value));
3559
- }
3560
-
3561
- /**
3562
- * Creates an array of the own and inherited enumerable property names of `object`.
3563
- *
3564
- * **Note:** Non-object values are coerced to objects.
3565
- *
3566
- * @static
3567
- * @memberOf _
3568
- * @since 3.0.0
3569
- * @category Object
3570
- * @param {Object} object The object to query.
3571
- * @returns {Array} Returns the array of property names.
3572
- * @example
3573
- *
3574
- * function Foo() {
3575
- * this.a = 1;
3576
- * this.b = 2;
3577
- * }
3578
- *
3579
- * Foo.prototype.c = 3;
3580
- *
3581
- * _.keysIn(new Foo);
3582
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
3583
- */
3584
- function keysIn(object) {
3585
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
3586
- }
3587
-
3588
- /**
3589
- * This method is like `_.merge` except that it accepts `customizer` which
3590
- * is invoked to produce the merged values of the destination and source
3591
- * properties. If `customizer` returns `undefined`, merging is handled by the
3592
- * method instead. The `customizer` is invoked with six arguments:
3593
- * (objValue, srcValue, key, object, source, stack).
3594
- *
3595
- * **Note:** This method mutates `object`.
3596
- *
3597
- * @static
3598
- * @memberOf _
3599
- * @since 4.0.0
3600
- * @category Object
3601
- * @param {Object} object The destination object.
3602
- * @param {...Object} sources The source objects.
3603
- * @param {Function} customizer The function to customize assigned values.
3604
- * @returns {Object} Returns `object`.
3605
- * @example
3606
- *
3607
- * function customizer(objValue, srcValue) {
3608
- * if (_.isArray(objValue)) {
3609
- * return objValue.concat(srcValue);
3610
- * }
3611
- * }
3612
- *
3613
- * var object = { 'a': [1], 'b': [2] };
3614
- * var other = { 'a': [3], 'b': [4] };
3615
- *
3616
- * _.mergeWith(object, other, customizer);
3617
- * // => { 'a': [1, 3], 'b': [2, 4] }
3618
- */
3619
- var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
3620
- baseMerge(object, source, srcIndex, customizer);
3621
- });
3622
-
3623
- /**
3624
- * Creates a function that returns `value`.
3625
- *
3626
- * @static
3627
- * @memberOf _
3628
- * @since 2.4.0
3629
- * @category Util
3630
- * @param {*} value The value to return from the new function.
3631
- * @returns {Function} Returns the new constant function.
3632
- * @example
3633
- *
3634
- * var objects = _.times(2, _.constant({ 'a': 1 }));
3635
- *
3636
- * console.log(objects);
3637
- * // => [{ 'a': 1 }, { 'a': 1 }]
3638
- *
3639
- * console.log(objects[0] === objects[1]);
3640
- * // => true
3641
- */
3642
- function constant(value) {
3643
- return function() {
3644
- return value;
3645
- };
3646
- }
3647
-
3648
- /**
3649
- * This method returns the first argument it receives.
3650
- *
3651
- * @static
3652
- * @since 0.1.0
3653
- * @memberOf _
3654
- * @category Util
3655
- * @param {*} value Any value.
3656
- * @returns {*} Returns `value`.
3657
- * @example
3658
- *
3659
- * var object = { 'a': 1 };
3660
- *
3661
- * console.log(_.identity(object) === object);
3662
- * // => true
3663
- */
3664
- function identity(value) {
3665
- return value;
3666
- }
3667
-
3668
- /**
3669
- * This method returns `false`.
3670
- *
3671
- * @static
3672
- * @memberOf _
3673
- * @since 4.13.0
3674
- * @category Util
3675
- * @returns {boolean} Returns `false`.
3676
- * @example
3677
- *
3678
- * _.times(2, _.stubFalse);
3679
- * // => [false, false]
3680
- */
3681
- function stubFalse() {
3682
- return false;
3683
- }
3684
-
3685
- module.exports = mergeWith;
3686
- }(lodash_mergewith, lodash_mergewith.exports));
3687
-
3688
- function isArray(value) {
3689
- return Array.isArray(value);
3690
- }
3691
-
3692
- function isObject(value) {
3693
- var type = typeof value;
3694
- return value != null && (type === "object" || type === "function") && !isArray(value);
3695
- }
3696
- process.env.NODE_ENV !== "production";
3697
- process.env.NODE_ENV === "test";
3698
-
3699
- Object.freeze(["base", "sm", "md", "lg", "xl", "2xl"]);
3700
-
3701
- function toRef(operand) {
3702
- if (isObject(operand) && operand.reference) {
3703
- return operand.reference;
3704
- }
3705
-
3706
- return String(operand);
3707
- }
3708
-
3709
- var toExpr = function toExpr(operator) {
3710
- for (var _len = arguments.length, operands = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3711
- operands[_key - 1] = arguments[_key];
3712
- }
3713
-
3714
- return operands.map(toRef).join(" " + operator + " ").replace(/calc/g, "");
3715
- };
3716
-
3717
- var _add = function add() {
3718
- for (var _len2 = arguments.length, operands = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3719
- operands[_key2] = arguments[_key2];
3720
- }
3721
-
3722
- return "calc(" + toExpr.apply(void 0, ["+"].concat(operands)) + ")";
3723
- };
3724
-
3725
- var _subtract = function subtract() {
3726
- for (var _len3 = arguments.length, operands = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
3727
- operands[_key3] = arguments[_key3];
3728
- }
3729
-
3730
- return "calc(" + toExpr.apply(void 0, ["-"].concat(operands)) + ")";
3731
- };
3732
-
3733
- var _multiply = function multiply() {
3734
- for (var _len4 = arguments.length, operands = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
3735
- operands[_key4] = arguments[_key4];
3736
- }
3737
-
3738
- return "calc(" + toExpr.apply(void 0, ["*"].concat(operands)) + ")";
3739
- };
3740
-
3741
- var _divide = function divide() {
3742
- for (var _len5 = arguments.length, operands = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
3743
- operands[_key5] = arguments[_key5];
3744
- }
3745
-
3746
- return "calc(" + toExpr.apply(void 0, ["/"].concat(operands)) + ")";
3747
- };
3748
-
3749
- var _negate = function negate(x) {
3750
- var value = toRef(x);
3751
-
3752
- if (value != null && !Number.isNaN(parseFloat(value))) {
3753
- return String(value).startsWith("-") ? String(value).slice(1) : "-" + value;
3754
- }
3755
-
3756
- return _multiply(value, -1);
3757
- };
3758
-
3759
- var calc = Object.assign(function (x) {
3760
- return {
3761
- add: function add() {
3762
- for (var _len6 = arguments.length, operands = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
3763
- operands[_key6] = arguments[_key6];
3764
- }
3765
-
3766
- return calc(_add.apply(void 0, [x].concat(operands)));
3767
- },
3768
- subtract: function subtract() {
3769
- for (var _len7 = arguments.length, operands = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
3770
- operands[_key7] = arguments[_key7];
3771
- }
3772
-
3773
- return calc(_subtract.apply(void 0, [x].concat(operands)));
3774
- },
3775
- multiply: function multiply() {
3776
- for (var _len8 = arguments.length, operands = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
3777
- operands[_key8] = arguments[_key8];
3778
- }
3779
-
3780
- return calc(_multiply.apply(void 0, [x].concat(operands)));
3781
- },
3782
- divide: function divide() {
3783
- for (var _len9 = arguments.length, operands = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
3784
- operands[_key9] = arguments[_key9];
3785
- }
3786
-
3787
- return calc(_divide.apply(void 0, [x].concat(operands)));
3788
- },
3789
- negate: function negate() {
3790
- return calc(_negate(x));
3791
- },
3792
- toString: function toString() {
3793
- return x.toString();
3794
- }
3795
- };
3796
- }, {
3797
- add: _add,
3798
- subtract: _subtract,
3799
- multiply: _multiply,
3800
- divide: _divide,
3801
- negate: _negate
3802
- });
3803
-
3804
- function isDecimal(value) {
3805
- return !Number.isInteger(parseFloat(value.toString()));
3806
- }
3807
-
3808
- function replaceWhiteSpace(value, replaceValue) {
3809
- if (replaceValue === void 0) {
3810
- replaceValue = "-";
3811
- }
3812
-
3813
- return value.replace(/\s+/g, replaceValue);
3814
- }
3815
-
3816
- function escape(value) {
3817
- var valueStr = replaceWhiteSpace(value.toString());
3818
- if (valueStr.includes("\\.")) return value;
3819
- return isDecimal(value) ? valueStr.replace(".", "\\.") : value;
3820
- }
3821
-
3822
- function addPrefix(value, prefix) {
3823
- if (prefix === void 0) {
3824
- prefix = "";
3825
- }
3826
-
3827
- return [prefix, escape(value)].filter(Boolean).join("-");
3828
- }
3829
- function toVarRef(name, fallback) {
3830
- return "var(" + escape(name) + (fallback ? ", " + fallback : "") + ")";
3831
- }
3832
- function toVar(value, prefix) {
3833
- if (prefix === void 0) {
3834
- prefix = "";
3835
- }
3836
-
3837
- return "--" + addPrefix(value, prefix);
3838
- }
3839
- function cssVar(name, options) {
3840
- var cssVariable = toVar(name, options == null ? void 0 : options.prefix);
3841
- return {
3842
- variable: cssVariable,
3843
- reference: toVarRef(cssVariable, getFallback(options == null ? void 0 : options.fallback))
3844
- };
3845
- }
3846
-
3847
- function getFallback(fallback) {
3848
- if (typeof fallback === "string") return fallback;
3849
- return fallback == null ? void 0 : fallback.reference;
3850
- }
3851
-
3852
- var _a, _b, _c;
3853
- var $trackWidth = cssVar('switch-track-width');
3854
- var $trackHeight = cssVar('switch-track-height');
3855
- var $thumbWidth = cssVar('switch-thumb-width');
3856
- var $thumbHeight = cssVar('switch-thumb-height');
3857
- var SwitchConfig = {
3858
- baseStyle: {
3859
- track: {
3860
- bg: semanticColors.background.grayDark,
3861
- p: 0,
3862
- pos: 'relative',
3863
- _checked: {
3864
- bg: semanticColors.background.grayDark,
3865
- },
3866
- _active: {
3867
- outline: '0px',
3868
- boxShadow: 'none',
3869
- },
3870
- _focus: {
3871
- outline: '0px',
3872
- boxShadow: 'none',
3873
- },
3874
- },
3875
- thumb: {
3876
- bg: coreColors.comet[700],
3877
- h: $thumbHeight.reference,
3878
- w: $thumbWidth.reference,
3879
- pos: 'absolute',
3880
- top: '50%',
3881
- transform: 'translate(0%, -50%)',
3882
- _checked: {
3883
- bg: semanticColors.background.brand,
3884
- transform: 'translate(100%, -50%)',
3885
- },
3886
- },
3887
- },
3888
- sizes: {
3889
- sm: {
3890
- container: (_a = {},
3891
- _a[$thumbWidth.variable] = '9.75px',
3892
- _a[$thumbHeight.variable] = '9.75px',
3893
- _a[$trackWidth.variable] = '16.5px',
3894
- _a[$trackHeight.variable] = '5.25px',
3895
- _a),
3896
- },
3897
- md: {
3898
- container: (_b = {},
3899
- _b[$thumbWidth.variable] = '13px',
3900
- _b[$thumbHeight.variable] = '13px',
3901
- _b[$trackWidth.variable] = '22px',
3902
- _b[$trackHeight.variable] = '7px',
3903
- _b),
3904
- },
3905
- lg: {
3906
- container: (_c = {},
3907
- _c[$thumbWidth.variable] = '19.5px',
3908
- _c[$thumbHeight.variable] = '19.5px',
3909
- _c[$trackWidth.variable] = '33px',
3910
- _c[$trackHeight.variable] = '10.5px',
3911
- _c),
3912
- },
3913
- },
3914
- };
3915
-
3916
1597
  var useAdaptiveColor = function (color) { return react.useColorModeValue(color.light, color.dark); };
3917
1598
 
3918
1599
  var Tooltip = function (_a) {
@@ -5768,13 +3449,11 @@ var theme = react.extendTheme({
5768
3449
  useSystemColorMode: false,
5769
3450
  },
5770
3451
  components: {
5771
- Button: __assign(__assign({}, ButtonVariantConfig), { sizes: ButtonSizeConfig }),
5772
- Drawer: DrawerConfig,
5773
- Heading: HeadingConfig,
5774
- Select: SelectConfig,
5775
- Switch: SwitchConfig,
5776
3452
  Text: TextConfig,
3453
+ Heading: HeadingConfig,
5777
3454
  Textarea: TextareaConfig,
3455
+ Drawer: DrawerConfig,
3456
+ Button: __assign(__assign({}, ButtonVariantConfig), { sizes: ButtonSizeConfig }),
5778
3457
  Tooltip: TooltipConfig,
5779
3458
  Avatar: AvatarConfig,
5780
3459
  },
@@ -5798,10 +3477,6 @@ Object.defineProperty(exports, 'Container', {
5798
3477
  enumerable: true,
5799
3478
  get: function () { return react.Container; }
5800
3479
  });
5801
- Object.defineProperty(exports, 'Divider', {
5802
- enumerable: true,
5803
- get: function () { return react.Divider; }
5804
- });
5805
3480
  Object.defineProperty(exports, 'Drawer', {
5806
3481
  enumerable: true,
5807
3482
  get: function () { return react.Drawer; }
@@ -5850,18 +3525,6 @@ Object.defineProperty(exports, 'Hide', {
5850
3525
  enumerable: true,
5851
3526
  get: function () { return react.Hide; }
5852
3527
  });
5853
- Object.defineProperty(exports, 'InputGroup', {
5854
- enumerable: true,
5855
- get: function () { return react.InputGroup; }
5856
- });
5857
- Object.defineProperty(exports, 'InputLeftElement', {
5858
- enumerable: true,
5859
- get: function () { return react.InputLeftElement; }
5860
- });
5861
- Object.defineProperty(exports, 'InputRightElement', {
5862
- enumerable: true,
5863
- get: function () { return react.InputRightElement; }
5864
- });
5865
3528
  Object.defineProperty(exports, 'Show', {
5866
3529
  enumerable: true,
5867
3530
  get: function () { return react.Show; }
@@ -5938,17 +3601,9 @@ exports.HeadingConfig = HeadingConfig;
5938
3601
  exports.Icon = Icon;
5939
3602
  exports.KibbleThemeProvider = KibbleThemeProvider;
5940
3603
  exports.Logo = Logo;
5941
- exports.RatingDot = RatingDot;
5942
- exports.RatingDots = RatingDots;
5943
- exports.Select = WrappedSelect;
5944
- exports.SelectConfig = SelectConfig;
5945
- exports.Switch = WrappedSwitch;
5946
- exports.SwitchConfig = SwitchConfig;
5947
3604
  exports.Text = Text;
5948
3605
  exports.TextConfig = TextConfig;
5949
- exports.TextInput = WrappedTextInput;
5950
- exports.TextInputConfig = TextInputConfig;
5951
- exports.Textarea = WrappedTextArea;
3606
+ exports.Textarea = Textarea;
5952
3607
  exports.TextareaConfig = TextareaConfig;
5953
3608
  exports.Tooltip = Tooltip;
5954
3609
  exports.TooltipConfig = TooltipConfig;