import _extends from "@babel/runtime/helpers/extends";

/* eslint-disable max-len */
import React from "react";
import PropTypes from "prop-types";
import classnames from "classnames";
import makeStyles from "../styles/makeStyles";
import { getShades } from "../styles/colors";

var deprecationWarning = function deprecationWarning(message) {
  if (process.env.NODE_ENV === "development") {
    // eslint-disable-next-line no-console
    console.warn("[Clever-react]: ".concat(message));
  }
};

var getClasses = makeStyles(function (_ref) {
  var colors = _ref.cleverUI.colors;
  return {
    root: function root(_ref2) {
      var rotation = _ref2.rotation,
          padding = _ref2.padding,
          size = _ref2.size,
          color = _ref2.color,
          shade = _ref2.shade;
      var res = {
        color: colors[color] ? colors[color][shade] : color
      };

      if (rotation > 0) {
        res.transform = "rotate(".concat(rotation, "deg)");
      }

      if (padding > 0) {
        res.padding = "".concat(size * padding / 200, "px");
      }

      return res;
    }
  };
});
var shadesList = getShades();

function Infinity(props) {
  var classes = getClasses(props);
  var size = props.size,
      padding = props.padding,
      className = props.className,
      onMouseEnter = props.onMouseEnter,
      onMouseLeave = props.onMouseLeave;
  var sizeIcon = size;
  var otherProps = {
    className: classnames(className, classes.root),
    onMouseEnter: onMouseEnter,
    onMouseLeave: onMouseLeave
  };

  if (padding) {
    deprecationWarning("The padding prop is deprecated, use a className for customization");
    sizeIcon = sizeIcon * (100 - padding) / 100;
  }

  return /*#__PURE__*/React.createElement("svg", _extends({
    viewBox: "0 0 16 13",
    fill: "none",
    height: sizeIcon,
    width: sizeIcon
  }, otherProps), /*#__PURE__*/React.createElement("path", {
    d: "M14.92 3.318C14.184 2.468 13.148 2 12 2c-1.415 0-2.48.832-3.227 1.754.284.445.505.87.666 1.215.573-.842 1.432-1.694 2.561-1.694 1.594 0 2.75 1.314 2.75 3.125 0 1.81-1.156 3.125-2.75 3.125-2.278 0-3.397-3.295-3.407-3.327l-.003-.01C8.53 6.018 7.11 2 4 2c-1.148 0-2.184.468-2.92 1.318C.384 4.123 0 5.218 0 6.4c0 1.183.384 2.277 1.08 3.082.736.85 1.772 1.318 2.92 1.318 1.427 0 2.486-.81 3.226-1.72-.283-.444-.502-.87-.662-1.221C5.998 8.69 5.146 9.525 4 9.525c-1.593 0-2.75-1.314-2.75-3.125 0-1.81 1.157-3.125 2.75-3.125 2.199 0 3.372 3.23 3.41 3.334.083.25 1.445 4.191 4.59 4.191 1.148 0 2.184-.468 2.92-1.318.696-.805 1.08-1.9 1.08-3.082 0-1.183-.384-2.277-1.08-3.082Z",
    fill: "currentColor"
  }));
}

Infinity.propTypes = {
  color: PropTypes.string,
  className: PropTypes.string,
  size: PropTypes.number,
  onMouseEnter: PropTypes.func,
  onMouseLeave: PropTypes.func,
  rotation: PropTypes.number,
  shade: PropTypes.oneOf(shadesList),
  padding: PropTypes.number
};
Infinity.defaultProps = {
  color: "neutral",
  size: 24,
  className: "",
  rotation: 0,
  shade: 500,
  padding: 0,
  onMouseEnter: function onMouseEnter() {},
  onMouseLeave: function onMouseLeave() {}
};
export default Infinity;