Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/app/components/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(){const e=(0,s.useDisplayPagePreviewItem)(),t=(0,c.useSelector)(i.default),o=(0,c.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),c=e=>{Object.entries(e).forEach((([e,t])=>{s.searchParams.set("".concat(r.config.portletNamespace).concat(e),t)}))};c({languageId:t,segmentsExperienceId:o}),r.config.layoutType===n.LAYOUT_TYPES.display&&e&&c(e.data),a.setAttribute("href",s.toString())}),[e,t,o])};var a=o("liferay!frontend-js-react-web$react"),n=o("../../config/constants/layoutTypes"),r=o("../../config/index"),s=o("../../contexts/DisplayPagePreviewItemContext"),c=o("../../contexts/StoreContext"),i=u(o("../../selectors/selectLanguageId")),l=u(o("../../selectors/selectSegmentsExperienceId"));function u(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=usePreviewURL.js.map