Liferay.Loader.define("layout-content-page-editor-web@2.0.170/page_editor/plugins/experience/reducers/index", ['module', 'exports', 'require', '../actions', './createExperience', './deleteExperience', './selectExperience', './updateExperience', './updateExperiencesList'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = void 0;

    var _actions = require("../actions");

    var _createExperience = _interopRequireDefault(require("./createExperience"));

    var _deleteExperience = _interopRequireDefault(require("./deleteExperience"));

    var _selectExperience = _interopRequireDefault(require("./selectExperience"));

    var _updateExperience = _interopRequireDefault(require("./updateExperience"));

    var _updateExperiencesList = _interopRequireDefault(require("./updateExperiencesList"));

    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }

    /**
     * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
     * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
     */
    var reducer = function reducer(state, action) {
      var nextState = state;

      switch (action.type) {
        case _actions.CREATE_SEGMENTS_EXPERIENCE:
          nextState = (0, _createExperience.default)(nextState, {
            fragmentEntryLinks: action.payload.fragmentEntryLinks,
            layoutData: action.payload.layoutData,
            segmentsExperience: action.payload.segmentsExperience
          });
          nextState = (0, _selectExperience.default)(nextState, {
            segmentsExperienceId: action.payload.segmentsExperience.segmentsExperienceId
          });
          break;

        case _actions.DELETE_SEGMENTS_EXPERIENCE:
          nextState = (0, _deleteExperience.default)(nextState, {
            segmentsExperienceId: action.payload.segmentsExperienceId
          });
          break;

        case _actions.SELECT_SEGMENTS_EXPERIENCE:
          nextState = (0, _selectExperience.default)(nextState, {
            segmentsExperienceId: action.payload.segmentsExperienceId
          });
          break;

        case _actions.UPDATE_SEGMENTS_EXPERIENCE:
          nextState = (0, _updateExperience.default)(nextState, {
            updatedExperience: action.payload
          });
          break;

        case _actions.UPDATE_SEGMENTS_EXPERIENCES_LIST:
          nextState = (0, _updateExperiencesList.default)(nextState, {
            availableSegmentsExperiences: action.payload.availableSegmentsExperiences
          });
          break;

        default:
          break;
      }

      return nextState;
    };

    var _default = reducer;
    exports.default = _default;
    //# sourceMappingURL=index.js.map
  }
});
//# sourceMappingURL=index.js.map