{"version":3,"file":"PersistQueryParams.DKAjp3CD.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/Wy4azsdISTvpWozhbeCq/QBuzAhR7S6RmaXOarOOT/PersistQueryParams.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";// This goes in your overrides file\nexport const PersistQueryParams=()=>{const KEEP=[\"utm_source\",\"utm_campaign\",\"utm_content\",\"utm_medium\",\"utm_term\",\"as\"];useEffect(()=>{if(typeof window===\"undefined\")return;// Store initial params ONLY if they exist in the current URL\nconst currentParams=new URLSearchParams(window.location.search);const paramsToKeep=new URLSearchParams;KEEP.forEach(key=>{if(currentParams.has(key)){paramsToKeep.set(key,currentParams.get(key));}});// Only store if we actually have parameters to keep\nif(paramsToKeep.toString()){sessionStorage.setItem(\"stackParams\",paramsToKeep.toString());console.log(\"📦 Stored params:\",paramsToKeep.toString());}// Handle Framer navigation\nconst handleNavigation=()=>{const saved=sessionStorage.getItem(\"stackParams\");if(!saved)return;const currentUrl=window.location.href;const url=new URL(currentUrl);const savedParams=new URLSearchParams(saved);let needsUpdate=false;savedParams.forEach((value,key)=>{if(!url.searchParams.has(key)){url.searchParams.set(key,value);needsUpdate=true;}});if(needsUpdate){window.history.replaceState(null,\"\",url.toString());console.log(\"🔄 Updated URL with saved params\");}};// Listen for Framer page changes\nconst observer=new MutationObserver(handleNavigation);observer.observe(document.body,{childList:true,subtree:true});return()=>observer.disconnect();},[]);// Return empty props - this override just runs the effect\nreturn{};};import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withPersistQueryParams(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...PersistQueryParams(props)});};}withPersistQueryParams.displayName=\"PersistQueryParams\";\nexport const __FramerMetadata__ = {\"exports\":{\"PersistQueryParams\":{\"type\":\"override\",\"name\":\"PersistQueryParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPersistQueryParams\":{\"type\":\"reactHoc\",\"name\":\"withPersistQueryParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PersistQueryParams.map"],"mappings":"mLAM8J,SAAgB,EAAuB,EAAE,CAAC,MAAO,KAAQ,EAA+BA,EAAwC,CAAQC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAmB,EAAM,CAAC,CAAC,yBAN1S,IAA6B,IAMsF,CALjJ,MAAuB,CAAC,IAAM,EAAK,CAAC,aAAa,eAAe,cAAc,aAAa,WAAW,KAAK,CAKxH,OALyH,MAAc,CAAC,GAAU,IAAS,OAAY,OACvK,IAAM,EAAc,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAO,EAAa,IAAI,gBAAgB,EAAK,QAAQ,GAAK,CAAI,EAAc,IAAI,EAAI,EAAE,EAAa,IAAI,EAAI,EAAc,IAAI,EAAI,CAAC,EAAI,CAClM,EAAa,UAAU,GAAE,eAAe,QAAQ,cAAc,EAAa,UAAU,CAAC,CAAC,QAAQ,IAAI,oBAAoB,EAAa,UAAU,CAAC,EAElJ,IAAM,EAAS,IAAI,qBADQ,CAAC,IAAM,EAAM,eAAe,QAAQ,cAAc,CAAC,GAAG,CAAC,EAAM,OAAO,IAAM,EAAW,EAAO,SAAS,KAAW,EAAI,IAAI,IAAI,EAAW,CAAO,EAAY,IAAI,gBAAgB,EAAM,CAAK,EAAY,GAAM,EAAY,SAAS,EAAM,IAAM,CAAK,EAAI,aAAa,IAAI,EAAI,GAAE,EAAI,aAAa,IAAI,EAAI,EAAM,CAAC,EAAY,KAAQ,CAAI,IAAa,EAAO,QAAQ,aAAa,KAAK,GAAG,EAAI,UAAU,CAAC,CAAC,QAAQ,IAAI,mCAAmC,GAC1Z,CAA+D,OAA9D,EAAS,QAAQ,SAAS,KAAK,CAAC,UAAU,GAAK,QAAQ,GAAK,CAAC,KAAW,EAAS,YAAY,EAAG,EAAE,CAAC,CACnJ,EAAE,EAAiV,EAAuB,YAAY"}