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 Age(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 16",
    fill: "none",
    height: sizeIcon,
    width: sizeIcon
  }, otherProps), /*#__PURE__*/React.createElement("path", {
    d: "M12.364 2.91h.727v.728a.727.727 0 0 0 1.454 0V2.91h.728a.727.727 0 0 0 0-1.455h-.728V.73a.727.727 0 0 0-1.454 0v.727h-.727a.727.727 0 1 0 0 1.455Zm-8 1.455v7.272a.727.727 0 0 0 1.454 0V4.365a.727.727 0 0 0-1.454 0ZM14.982 5.82a.727.727 0 0 0-.567.859 6.544 6.544 0 0 1-11.04 5.947A6.544 6.544 0 0 1 9.324 1.587a.742.742 0 1 0 .29-1.454A7.855 7.855 0 0 0 8 .002 8 8 0 1 0 8 16a8 8 0 0 0 7.84-9.599.727.727 0 0 0-.858-.582Zm-7.71 0v.728c.004.538.206 1.056.568 1.454a2.181 2.181 0 0 0-.567 1.454v.727a2.181 2.181 0 0 0 2.182 2.182h.727a2.182 2.182 0 0 0 2.182-2.182v-.727a2.182 2.182 0 0 0-.568-1.454c.362-.398.564-.916.568-1.454v-.728a2.182 2.182 0 0 0-2.182-2.181h-.727a2.182 2.182 0 0 0-2.182 2.181Zm3.637 4.363a.727.727 0 0 1-.727.728h-.727a.727.727 0 0 1-.728-.728v-.727c0-.401.326-.727.728-.727h.727c.401 0 .727.326.727.727v.727Zm0-4.363v.728a.727.727 0 0 1-.727.727h-.727a.727.727 0 0 1-.728-.727v-.728c0-.401.326-.727.728-.727h.727c.401 0 .727.326.727.727Z",
    fill: "currentColor"
  }));
}

Age.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
};
Age.defaultProps = {
  color: "neutral",
  size: 24,
  className: "",
  rotation: 0,
  shade: 500,
  padding: 0,
  onMouseEnter: function onMouseEnter() {},
  onMouseLeave: function onMouseLeave() {}
};
export default Age;