Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.169/page_editor/app/contexts/DisplayPagePreviewItemContext",["module","exports","require","liferay!frontend-js-react-web$react","../utils/checkDeepEqual"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.DisplayPagePreviewItemContextProvider=function DisplayPagePreviewItemContextProvider({children:e}){const[t,r]=(0,n.useState)((()=>({recentItemList:[],selectedItem:null})));return n.default.createElement(u.Provider,{value:r},n.default.createElement(a.Provider,{value:t},e))},t.useDisplayPagePreviewItem=function useDisplayPagePreviewItem(){return(0,n.useContext)(a).selectedItem},t.useDisplayPageRecentPreviewItemList=function useDisplayPageRecentPreviewItemList(){return(0,n.useContext)(a).recentItemList},t.useSelectDisplayPagePreviewItem=function useSelectDisplayPagePreviewItem(){const t=(0,n.useContext)(u);return(0,n.useCallback)((r=>t((({recentItemList:t})=>{let n=t;return r&&(n=[r,...t].slice(0,e),n=n.filter(((e,t)=>t===n.findIndex((t=>function itemsAreEqual(e,t){return(0,i.deepEqual)(e,t)}(e,t)))))),{recentItemList:n,selectedItem:r}}))),[t])};var n=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),i=r("../utils/checkDeepEqual");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}const e=100,a=n.default.createContext({recentItemList:[],selectedItem:null}),u=n.default.createContext((()=>{}))}}));
//# sourceMappingURL=DisplayPagePreviewItemContext.js.map