{"version":3,"file":"shared-lib.BjGPYNPq.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,MAE1J,OAFgK,EAAM,cAAc,CAAC,GAAU,IAAS,OAAY,OACnW,EAAmB,EAAoB,EAAc,SACrD,IAAM,EAAc,SAAS,cAAc,2BAA8B,GAAc,EAAmB,EAAgB,EAAgB,EAAC,EAAE,EAAsB,EAAK,MAAM,CAAC,IAAI,EAAc,CAAG,yCAf3L,EAAc,wBAA8B,EAAoB,gCAAsC,EAAgB,4BAAkC,EAAkB,GAAa,CAAC,IAAM,EAAY,SAAS,cAAc,UAK1J,GALoK,MAAM,KAAK,EAAY,YAAY,QAAQ,GAAM,CAAC,EAAY,aAAa,EAAK,KAAK,EAAK,MAAQ,GAKtV,EAAY,IAAI,GAAG,EAAY,IAAI,aAAa,KAAK,MAAM,KAAK,SAAS,OAAU,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