"use strict";

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

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

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

var _immutable = require("immutable");

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

var _default = function _default() {
  var _editingActions;

  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _immutable.Map)();
  var action = arguments.length > 1 ? arguments[1] : undefined;
  var editingActions = (_editingActions = {}, (0, _defineProperty2.default)(_editingActions, _constants.START_EDIT, state.set(action.componentId, true).set('initialFocusId', action.initialFocusId)), (0, _defineProperty2.default)(_editingActions, _constants.END_EDIT, state.set(action.componentId, false)), (0, _defineProperty2.default)(_editingActions, _constants.TOGGLE_EDIT, state.set(action.componentId, !state.get(action.componentId))), _editingActions);
  return editingActions[action.type] || state;
};

exports.default = _default;