Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.141/page_editor/app/components/app-hooks/useBackURL",["module","exports","require","liferay!frontend-js-react-web$react","../../contexts/StoreContext","../../selectors/selectSegmentsExperienceId"],(function(e,t,r){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function useBackURL(){const[e,t]=(0,n.useMemo)((()=>{const e=document.querySelector(".lfr-back-link");try{return[e,new URL(null==e?void 0:e.href)]}catch(e){return[]}}),[]),r=(0,o.useSelector)(a.default);(0,n.useEffect)((()=>{if(e&&t&&r){t.searchParams.set("segmentsExperienceId",r),e.href=t.toString();const n=new URL(window.location.href);n.searchParams.has("p_l_back_url")&&(n.searchParams.set("p_l_back_url",t.toString()),window.history.replaceState(null,document.title,n.toString()))}}),[e,t,r])};var n=r("liferay!frontend-js-react-web$react"),o=r("../../contexts/StoreContext"),a=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("../../selectors/selectSegmentsExperienceId"))}));
//# sourceMappingURL=useBackURL.js.map