"use strict";

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

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

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

var _stateHelper = _interopRequireDefault(require("../../../../../common/util/stateHelper"));

var _makeEditable = _interopRequireDefault(require("../../../../../common/components/shared/functionality/makeEditable"));

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

var _alerts = require("../../../../../common/actions/alerts");

var _modifications = require("../../../../../common/actions/modifications");

var _quizEntries = require("../../../../../building/api/quizEntries");

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

var _modal = require("../../../../../common/actions/modal");

var _constants = require("@instructure/quiz-common/lib/constants");

var mapStateToProps = function mapStateToProps(state, props) {
  var activeQuiz = _stateHelper.default.activeQuiz();

  return {
    movedInSidebar: state.getIn(['ui', _constants.MOVED_IN_SIDEBAR]),
    movedQuizEntry: state.getIn(['ui', _constants.MOVED_QUIZ_ENTRY]),
    quizId: activeQuiz.id
  };
};

exports.mapStateToProps = mapStateToProps;
var mapDispatchToProps = {
  clearUI: _ui.clear,
  moveQuizEntry: _quizEntries.moveQuizEntry,
  moveTemporaryQuizEntry: _modifications.moveTemporaryQuizEntry,
  openMoveImmutableModal: _modal.openMoveImmutableModal,
  screenreaderNotification: _alerts.screenreaderNotification,
  setUI: _ui.set
};

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

exports.default = _default;