Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.179/page_editor/app/reducers/layoutDataReducer",["module","exports","require","../actions/types","../utils/setIn"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function layoutDataReducer(t=e,r){switch(r.type){case o.UPDATE_COL_SIZE:case o.UPDATE_COLLECTION_DISPLAY_COLLECTION:case o.ADD_FRAGMENT_ENTRY_LINKS:case o.ADD_ITEM:case o.DELETE_ITEM:case o.DUPLICATE_ITEM:case o.MOVE_ITEM:case o.UPDATE_FRAGMENT_ENTRY_LINK_CONFIGURATION:case o.UPDATE_ROW_COLUMNS:return r.layoutData;case o.UPDATE_FORM_ITEM_CONFIG:case o.UPDATE_ITEM_CONFIG:{const{itemId:e,layoutData:o}=r,c=o.items[e]||{},n=t.items[e]||{};return _objectSpread(_objectSpread({},o),{},{items:_objectSpread(_objectSpread({},o.items),{},{[e]:_objectSpread(_objectSpread({},c),{},{config:_objectSpread(_objectSpread({},r.overridePreviousConfig?{}:n.config),c.config)})})})}case o.UPDATE_ITEM_LOCAL_CONFIG:{const{itemConfig:e,itemId:o}=r,c=t.items[o]||{};return _objectSpread(_objectSpread({},t),{},{items:_objectSpread(_objectSpread({},t.items),{},{[o]:_objectSpread(_objectSpread({},c),{},{config:_objectSpread(_objectSpread({},r.overridePreviousConfig?{}:c.config),e)})})})}case o.UPDATE_PREVIEW_IMAGE:{const e=Object.fromEntries(Object.entries(t.items).map((([e,t])=>{var o,n,a;return[e,(null===(o=t.config)||void 0===o||null===(n=o.styles)||void 0===n||null===(a=n.backgroundImage)||void 0===a?void 0:a.classPK)===r.fileEntryId?(0,c.setIn)(t,["config","styles","backgroundImage","url"],r.previewURL):t]})));return _objectSpread(_objectSpread({},t),{},{items:e})}default:return t}},t.INITIAL_STATE=void 0;var o=r("../actions/types"),c=r("../utils/setIn");function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e={items:{}};t.INITIAL_STATE=e}}));
//# sourceMappingURL=layoutDataReducer.js.map