{"version":3,"file":"shared-lib.BQOP7mPR.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/kyK7v8W4fn1UWqgJvNb3/aEhiRtuGgm9AqD2b6dpn/DynamicNavigation.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import React,{useRef}from\"react\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/docs/guides/auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */const LOCAL_DEV_URL=\"http://localhost:3000\";const NAVIGATION_ENDPOINT=\"/client_app/framer_navigation\";const FOOTER_ENDPOINT=\"/client_app/framer_footer\";const reInjectScriptTag=oldScriptEl=>{const newScriptEl=document.createElement(\"script\");Array.from(oldScriptEl.attributes).forEach(attr=>{newScriptEl.setAttribute(attr.name,attr.value);});// framer acts like a SPA sometimes and doesn't reload the page when navigating to other\n// framer pages sometimes. This results in the JS getting cached which the browser blocks\n// from running again (preventing the nav from initializing). As a temporary bandaid, we\n// simply cache bust the JS url so it forces the browser to reload the JS on these special\n// page redirects.\nnewScriptEl.src=`${newScriptEl.src}?cacheBust=${Math.floor(Math.random()*1e9)}`;if(oldScriptEl.innerHTML){const scriptContent=document.createTextNode(oldScriptEl.innerHTML);newScriptEl.appendChild(scriptContent);}oldScriptEl.parentNode.replaceChild(newScriptEl,oldScriptEl);};const isDevMode=()=>{// don't run on the server\nif(typeof window===\"undefined\")return false;// check for `dev` url param\nconst urlParams=new URLSearchParams(window.location.search);return urlParams.get(\"dev\");};// loads JS/CSS assets from local dev server if url param `?dev=true` exists\nconst transformHtmlForLocalDev=html=>{// don't run on the server\nif(!isDevMode())return html;// use `localhost:3000` as url base\nhtml=html.replaceAll('\"/assets',`\"${LOCAL_DEV_URL}/assets`);return html.replaceAll('\"/vite-dev',`\"${LOCAL_DEV_URL}/vite-dev`);};const fetchAndInjectHtml=async(endpoint,domElement)=>{// fetch html/js/css either from local dev or current domain\nconst response=await fetch(isDevMode()?`${LOCAL_DEV_URL}${endpoint}`:endpoint,{headers:{\"X-Requested-With\":\"XMLHttpRequest\"}});if(response.status!==200)return;// transform HTML\nlet html=await response.text();html=transformHtmlForLocalDev(html);// inject HTML into dom element\nif(!domElement||!html)return;domElement.innerHTML=html;requestAnimationFrame(()=>{setTimeout(()=>{if(!domElement)return;const scriptEls=domElement.querySelectorAll(\"script\");scriptEls.forEach(reInjectScriptTag);},0);});};export default function DynamicNavigation(props){const dynamicNavRef=useRef(null);React.useEffect(()=>{if(typeof window===\"undefined\")return;// fetch and inject nav\nfetchAndInjectHtml(NAVIGATION_ENDPOINT,dynamicNavRef.current);// fetch and inject footer\nconst footerElement=document.querySelector(\"[data-framer-footer-v2]\");if(footerElement)fetchAndInjectHtml(FOOTER_ENDPOINT,footerElement);},[]);return /*#__PURE__*/_jsx(\"div\",{ref:dynamicNavRef});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DynamicNavigation\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DynamicNavigation.map"],"mappings":"0MAmB6N,SAAwB,EAAkB,EAAM,CAAC,IAAM,EAAcA,EAAO,KAAK,CAE/J,OAFgK,EAAM,cAAc,CAAC,GAAU,IAAS,OAAY,OACnW,EAAmB,EAAoB,EAAc,QAAQ,CAC7D,IAAM,EAAc,SAAS,cAAc,0BAA0B,CAAI,GAAc,EAAmB,EAAgB,EAAc,EAAG,EAAE,CAAC,CAAqB,EAAK,MAAM,CAAC,IAAI,EAAc,CAAC,oCArBvJ,IAAiC,CAMnE,EAAc,wBAA8B,EAAoB,gCAAsC,EAAgB,4BAAkC,EAAkB,GAAa,CAAC,IAAM,EAAY,SAAS,cAAc,SAAS,CAKnK,GALoK,MAAM,KAAK,EAAY,WAAW,CAAC,QAAQ,GAAM,CAAC,EAAY,aAAa,EAAK,KAAK,EAAK,MAAM,EAAG,CAKvV,EAAY,IA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