"use strict";

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = exports.ConnectedCalculationWidgetScreen = void 0;
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _reactRedux = require("react-redux");
var _DefaultCanvasProvider = require("../../Shared/Providers/DefaultCanvasProvider");
var _CalculationWidget = _interopRequireDefault(require("./Containers/CalculationWidget"));
var _Error = _interopRequireDefault(require("../../Shared/Containers/Error"));
var _Confirm = _interopRequireDefault(require("./Containers/Confirm"));
var _ThemeProvider = _interopRequireDefault(require("./ThemeProvider"));
require("./Components/Styles.scss");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
/**
 * Main Screen of the configurator
 */
var CalculationWidgetScreen = function CalculationWidgetScreen(props) {
  var renderError = props.renderError,
    renderConfirm = props.renderConfirm,
    renderWidget = props.renderWidget,
    CanvasProvider = props.CanvasProvider,
    ThemeProvider = props.ThemeProvider;
  return /*#__PURE__*/React.createElement(CanvasProvider, null, /*#__PURE__*/React.createElement(ThemeProvider, null, renderWidget(), renderError(), renderConfirm()));
};
CalculationWidgetScreen.defaultProps = {
  // Render props
  renderWidget: function renderWidget() {
    return /*#__PURE__*/React.createElement(_CalculationWidget["default"], null);
  },
  renderError: function renderError() {
    return /*#__PURE__*/React.createElement(_Error["default"], null);
  },
  renderConfirm: function renderConfirm() {
    return /*#__PURE__*/React.createElement(_Confirm["default"], null);
  },
  // Components
  CanvasProvider: _DefaultCanvasProvider.DefaultCanvasProvider,
  ThemeProvider: _ThemeProvider["default"]
};

// Export the non connected Screen
var _default = exports["default"] = CalculationWidgetScreen;
var mapStateToProps = function mapStateToProps(state) {
  var selectedDesignArea = state.designArea.selectedDesignArea;
  return {
    selectedDesignArea: selectedDesignArea
  };
};
var ConnectedCalculationWidgetScreen = exports.ConnectedCalculationWidgetScreen = (0, _reactRedux.connect)(mapStateToProps)(CalculationWidgetScreen);