"use strict";

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

var _immutable = require("immutable");

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

var _default = function _default() {
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _immutable.Map)({});
  var action = arguments.length > 1 ? arguments[1] : undefined;

  switch (action.type) {
    case _constants.SCROLL_TO_COMPONENT:
      return state.set('scrolledComponentKey', action.payload).set('scrollingFocus', action.scrollingFocus);

    case _constants.CLEAR_SCROLLED_COMPONENT:
      return state.set('scrolledComponentKey', null).set('scrollingFocus', null);

    default:
      return state;
  }
};

exports.default = _default;