Liferay.Loader.define("style-book-web@2.0.76/js/style-book-editor/contexts/LayoutContext",["module","exports","require","liferay!frontend-js-react-web$react","../constants/actionTypes","../reducers/layoutReducer"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutContextProvider=function LayoutContextProvider({children:t,initialState:r}){const[n,i]=(0,u.useReducer)(o.default,r);return u.default.createElement(e.Provider,{value:i},u.default.createElement(a.Provider,{value:n},t))},t.useDispatch=useDispatch,t.useDraftStatus=function useDraftStatus(){return(0,u.useContext)(a).draftStatus},t.useLoading=function useLoading(){return(0,u.useContext)(a).loading},t.usePreviewLayout=function usePreviewLayout(){return(0,u.useContext)(a).previewLayout},t.usePreviewLayoutType=function usePreviewLayoutType(){return(0,u.useContext)(a).previewLayoutType},t.useSetLoading=function useSetLoading(){const e=useDispatch();return(0,u.useCallback)((t=>e({type:n.LOADING,value:t})),[e])},t.useSetPreviewLayout=function useSetPreviewLayout(){const e=useDispatch();return(0,u.useCallback)((t=>e({layout:t,type:n.SET_PREVIEW_LAYOUT})),[e])},t.useSetPreviewLayoutType=function useSetPreviewLayoutType(){const e=useDispatch();return t=>e({layoutType:t,type:n.SET_PREVIEW_LAYOUT_TYPE})},t.LayoutStoreContext=void 0;var u=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={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=u?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),n=r("../constants/actionTypes"),o=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("../reducers/layoutReducer"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}const e=u.default.createContext((()=>{})),a=u.default.createContext({loading:!0,previewLayout:{},previewLayoutType:null});function useDispatch(){return(0,u.useContext)(e)}t.LayoutStoreContext=a}}));
//# sourceMappingURL=LayoutContext.js.map