Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/app/components/undo/undoUpdateCollectionDisplayCollection",["module","exports","require","../../actions/updateCollectionDisplayCollection","../../services/LayoutService","../../utils/setIn"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.getDerivedStateForUndo=t.undoAction=void 0;var i=r(n("../../actions/updateCollectionDisplayCollection")),o=r(n("../../services/LayoutService")),a=n("../../utils/setIn");function r(e){return e&&e.__esModule?e:{default:e}}const e=({action:e,store:t})=>n=>o.default.restoreCollectionDisplayConfig({filterFragmentEntryLinks:e.filterFragmentEntryLinks.map((e=>({editableValues:e.editableValues,fragmentEntryLinkId:e.fragmentEntryLinkId}))),itemConfig:e.itemConfig,itemId:e.itemId,onNetworkStatus:n,segmentsExperienceId:t.segmentsExperienceId}).then((()=>{n((0,i.default)({fragmentEntryLinks:e.filterFragmentEntryLinks,itemId:e.itemId,layoutData:(0,a.setIn)(t.layoutData,["items",e.itemId,"config"],e.itemConfig),pageContents:e.pageContents}))}));t.undoAction=e;const s=({action:e,state:t})=>({filterFragmentEntryLinks:e.fragmentEntryLinks.map((({fragmentEntryLinkId:e})=>{const n=t.fragmentEntryLinks[e];return{content:n.content,editableValues:n.editableValues,fragmentEntryLinkId:e}})),itemConfig:t.layoutData.items[e.itemId].config,itemId:e.itemId,pageContents:t.pageContents});t.getDerivedStateForUndo=s}}));
//# sourceMappingURL=undoUpdateCollectionDisplayCollection.js.map