"use strict";

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

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

var _presenter = _interopRequireDefault(require("./presenter"));

var _reactRedux = require("../../../../react-redux");

var _ui = require("../../../../../common/selectors/ui");

var _calculator = require("../../../../../common/selectors/calculator");

var _ui2 = require("../../../../../common/actions/ui");

var _quizSessions = require("../../../../selectors/quizSessions");

var _quizzes = require("../../../../selectors/quizzes");

var mapStateToProps = function mapStateToProps(state) {
  return {
    activeCalculatorId: (0, _ui.getActiveCalculatorId)(state),
    calculatorType: (0, _calculator.hasVisibleQuestionCalculator)(state) ? 'none' : (0, _quizzes.getActiveQuizCaluclatorType)(state),
    quizSessionId: (0, _quizSessions.getActiveQuizSessionId)(state)
  };
};

var mapDispatchToProps = {
  setActiveCalculatorId: _ui2.setActiveCalculatorId
};

var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_presenter.default);

exports.default = _default;