Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/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({children:e}){const[t,r]=(0,n.useState)((()=>({recentItemList:[],selectedItem:null})));return n.default.createElement(c.Provider,{value:r},n.default.createElement(u.Provider,{value:t},e))},t.useDisplayPagePreviewItem=function(){return(0,n.useContext)(u).selectedItem},t.useDisplayPageRecentPreviewItemList=function(){return(0,n.useContext)(u).recentItemList},t.useSelectDisplayPagePreviewItem=function(){const t=(0,n.useContext)(c);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=>{return r=e,n=t,(0,a.deepEqual)(r,n);var r,n}))))),{recentItemList:n,selectedItem:r}}))),[t])};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var u=n?Object.getOwnPropertyDescriptor(e,a):null;u&&(u.get||u.set)?Object.defineProperty(r,a,u):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),a=r("../utils/checkDeepEqual");function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}const e=100,u=n.default.createContext({recentItemList:[],selectedItem:null}),c=n.default.createContext((()=>{}))}}));
//# sourceMappingURL=DisplayPagePreviewItemContext.js.map