"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = exports.UndoRedo = void 0;

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

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

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

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

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

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

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _classnames = _interopRequireDefault(require("classnames"));

var _Button = _interopRequireDefault(require("@material-ui/core/Button"));

var _core = require("@material-ui/core");

var _renderUi = require("../render-ui");

var _translator = _interopRequireDefault(require("../translator"));

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

var translator = _translator["default"].translator;

var UndoRedo = /*#__PURE__*/function (_React$Component) {
  (0, _inherits2["default"])(UndoRedo, _React$Component);

  var _super = _createSuper(UndoRedo);

  function UndoRedo() {
    (0, _classCallCheck2["default"])(this, UndoRedo);
    return _super.apply(this, arguments);
  }

  (0, _createClass2["default"])(UndoRedo, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          classes = _this$props.classes,
          className = _this$props.className,
          _this$props$onReset = _this$props.onReset,
          onReset = _this$props$onReset === void 0 ? false : _this$props$onReset,
          language = _this$props.language;
      return /*#__PURE__*/_react["default"].createElement("div", {
        className: (0, _classnames["default"])(className)
      }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
        classes: {
          root: classes.button
        },
        onClick: function onClick() {
          return onReset();
        }
      }, translator.t('graphing.reset', {
        lng: language
      })));
    }
  }]);
  return UndoRedo;
}(_react["default"].Component);

exports.UndoRedo = UndoRedo;
(0, _defineProperty2["default"])(UndoRedo, "propTypes", {
  classes: _propTypes["default"].object,
  className: _propTypes["default"].string,
  onReset: _propTypes["default"].func.isRequired,
  language: _propTypes["default"].string
});
(0, _defineProperty2["default"])(UndoRedo, "defaultProps", {});

var styles = function styles(theme) {
  return {
    button: {
      color: _renderUi.color.text(),
      fontWeight: 'bold',
      marginBottom: theme.spacing.unit / 2,
      '&:not(:last-of-type)': {
        marginRight: theme.spacing.unit / 2
      }
    },
    undoRedoDiv: {
      display: 'flex',
      flexDirection: 'row'
    }
  };
};

var _default = (0, _core.withStyles)(styles)(UndoRedo);

exports["default"] = _default;
//# sourceMappingURL=undo-redo.js.map