"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Icon = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _base = _interopRequireDefault(require("@emotion/styled/base"));

var _react = require("@emotion/react");

var _react2 = _interopRequireWildcard(require("react"));

var _Box = require("../Box");

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

var __jsx = _react2["default"].createElement;

function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }

var Svg = ( /*#__PURE__*/0, _base["default"])(_Box.Box, process.env.NODE_ENV === "production" ? {
  target: "emluq7g0"
} : {
  target: "emluq7g0",
  label: "Svg"
})(process.env.NODE_ENV === "production" ? {
  name: "164jrrk",
  styles: "flex-shrink:0;backface-visibility:hidden;&:not(:root){overflow:hidden;}"
} : {
  name: "164jrrk",
  styles: "flex-shrink:0;backface-visibility:hidden;&:not(:root){overflow:hidden;}",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9JY29uL0ljb24udHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU11QiIsImZpbGUiOiIuLi8uLi9zcmMvSWNvbi9JY29uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZVRoZW1lIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IFJlYWN0LCB7IGZvcndhcmRSZWYgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBCb3ggfSBmcm9tICcuLi9Cb3gnO1xuaW1wb3J0IHsgSWNvblByb3BzIH0gZnJvbSAnLi90eXBlcyc7XG5cbmNvbnN0IFN2ZyA9IHN0eWxlZChCb3gpYFxuICAgIGZsZXgtc2hyaW5rOiAwO1xuICAgIGJhY2tmYWNlLXZpc2liaWxpdHk6IGhpZGRlbjtcbiAgICAmOm5vdCg6cm9vdCkge1xuICAgICAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgIH1cbmA7XG5cbi8vIFRPRE86IHN3aXRjaCBJY29ucyB0byB1c2UgbWRpLXJlYWN0IGJ5IGRlZmF1bHRcbmV4cG9ydCBjb25zdCBJY29uID0gZm9yd2FyZFJlZihcbiAgICAoXG4gICAgICAgIHsgc2l6ZSA9ICc0JywgbmFtZSwgY29sb3IgPSAnY3VycmVudENvbG9yJywgcm9sZSA9ICdwcmVzZW50YXRpb24nLCBmb2N1c2FibGUgPSBmYWxzZSwgLi4ucmVzdCB9OiBJY29uUHJvcHMsXG4gICAgICAgIHJlZjogYW55XG4gICAgKSA9PiB7XG4gICAgICAgIGNvbnN0IHsgaWNvbnM6IGljb25QYXRocyB9ID0gdXNlVGhlbWUoKTtcblxuICAgICAgICAvLyBGYWxsYmFjayBpbiBjYXNlIHlvdSBwYXNzIHRoZSB3cm9uZyBuYW1lXG4gICAgICAgIGNvbnN0IGljb25GYWxsYmFjayA9IGljb25QYXRoc1sncXVlc3Rpb24tb3V0bGluZSddO1xuXG4gICAgICAgIGNvbnN0IHBhdGggPSBpY29uUGF0aHNbbmFtZV0gPT0gbnVsbCA/IGljb25GYWxsYmFjay5wYXRoIDogaWNvblBhdGhzW25hbWVdLnBhdGg7XG5cbiAgICAgICAgY29uc3Qgdmlld0JveCA9IChpY29uUGF0aHNbbmFtZV0gPT0gbnVsbCA/IGljb25GYWxsYmFjay52aWV3Qm94IDogaWNvblBhdGhzW25hbWVdLnZpZXdCb3gpIHx8ICcwIDAgMjQgMjQnO1xuXG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8U3ZnXG4gICAgICAgICAgICAgICAgcmVmPXtyZWZ9XG4gICAgICAgICAgICAgICAgYXM9XCJzdmdcIlxuICAgICAgICAgICAgICAgIHNpemU9e3NpemV9XG4gICAgICAgICAgICAgICAgY29sb3I9e2NvbG9yfVxuICAgICAgICAgICAgICAgIGRpc3BsYXk9XCJpbmxpbmUtYmxvY2tcIlxuICAgICAgICAgICAgICAgIHZlcnRpY2FsQWxpZ249XCJtaWRkbGVcIlxuICAgICAgICAgICAgICAgIHZpZXdCb3g9e3ZpZXdCb3h9XG4gICAgICAgICAgICAgICAgZm9jdXNhYmxlPXtmb2N1c2FibGV9XG4gICAgICAgICAgICAgICAgcm9sZT17cm9sZX1cbiAgICAgICAgICAgICAgICB7Li4ucmVzdH1cbiAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICB7cGF0aH1cbiAgICAgICAgICAgIDwvU3ZnPlxuICAgICAgICApO1xuICAgIH1cbik7XG4iXX0= */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
}); // TODO: switch Icons to use mdi-react by default

var Icon = /*#__PURE__*/(0, _react2.forwardRef)(function (_ref, ref) {
  var _ref$size = _ref.size,
      size = _ref$size === void 0 ? '4' : _ref$size,
      name = _ref.name,
      _ref$color = _ref.color,
      color = _ref$color === void 0 ? 'currentColor' : _ref$color,
      _ref$role = _ref.role,
      role = _ref$role === void 0 ? 'presentation' : _ref$role,
      _ref$focusable = _ref.focusable,
      focusable = _ref$focusable === void 0 ? false : _ref$focusable,
      rest = (0, _objectWithoutProperties2["default"])(_ref, ["size", "name", "color", "role", "focusable"]);

  var _useTheme = (0, _react.useTheme)(),
      iconPaths = _useTheme.icons; // Fallback in case you pass the wrong name


  var iconFallback = iconPaths['question-outline'];
  var path = iconPaths[name] == null ? iconFallback.path : iconPaths[name].path;
  var viewBox = (iconPaths[name] == null ? iconFallback.viewBox : iconPaths[name].viewBox) || '0 0 24 24';
  return __jsx(Svg, (0, _extends2["default"])({
    ref: ref,
    as: "svg",
    size: size,
    color: color,
    display: "inline-block",
    verticalAlign: "middle",
    viewBox: viewBox,
    focusable: focusable,
    role: role
  }, rest), path);
});
exports.Icon = Icon;
//# sourceMappingURL=Icon.js.map