Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.151/page_editor/app/hooks/app_hooks/usePreviewURL",["module","exports","require","liferay!frontend-js-react-web$react","../../config/constants/layoutTypes","../../config/index","../../contexts/DisplayPagePreviewItemContext","../../contexts/StoreContext","../../selectors/selectLanguageId","../../selectors/selectSegmentsExperienceId"],(function(e,t,o){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function usePreviewURL(){const e=(0,s.useDisplayPagePreviewItem)(),t=(0,i.useSelector)(c.default),o=(0,i.useSelector)(l.default);(0,a.useEffect)((()=>{const a=document.querySelector("[data-page-editor-layout-preview-base-url]");if(!(null==a?void 0:a.dataset.pageEditorLayoutPreviewBaseUrl))return;const s=new URL(null==a?void 0:a.dataset.pageEditorLayoutPreviewBaseUrl),setParameters=e=>{Object.entries(e).forEach((([e,t])=>{s.searchParams.set("".concat(n.config.portletNamespace).concat(e),t)}))};setParameters({languageId:t,segmentsExperienceId:o}),n.config.layoutType===r.LAYOUT_TYPES.display&&e&&setParameters(e.data),a.setAttribute("href",s.toString())}),[e,t,o])};var a=o("liferay!frontend-js-react-web$react"),r=o("../../config/constants/layoutTypes"),n=o("../../config/index"),s=o("../../contexts/DisplayPagePreviewItemContext"),i=o("../../contexts/StoreContext"),c=_interopRequireDefault(o("../../selectors/selectLanguageId")),l=_interopRequireDefault(o("../../selectors/selectSegmentsExperienceId"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=usePreviewURL.js.map