{"version":3,"file":"WithNewUTM.CaUDxtse.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/7feQA7CUMDP3FhCVlekm/zSFBORadE43PTI2Hr3Bi/WithNewUTM.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";// This override component will pass UTM parameters to the JotForm iframe\nexport function withUTMParams(){return{// Run when the component mounts\nonMount(props){updateJotFormWithUTM();// Set up a MutationObserver to watch for when the iframe gets added to the DOM\n// This helps in cases where the iframe loads after our code runs\nconst observer=new MutationObserver((mutations,obs)=>{const iframe=document.querySelector('iframe[src*=\"form.jotform.com/251057440067149\"]');if(iframe){updateJotFormWithUTM();obs.disconnect()// Stop observing once we've found and updated the iframe\n;console.log(\"JotForm iframe found and updated via MutationObserver\");}});// Start observing the document with the configured parameters\nobserver.observe(document.body,{childList:true,subtree:true});// Also try updating after a delay to catch slow-loading iframes\nsetTimeout(()=>{updateJotFormWithUTM();},1e3);},// Run when props change or component updates\nonUpdate(){updateJotFormWithUTM();}};}// Function to handle updating the JotForm iframe with UTM parameters\nfunction updateJotFormWithUTM(){// Find the JotForm iframe - use a more specific selector based on your provided code\nconst iframe=document.querySelector('iframe[src*=\"form.jotform.com/251057440067149\"]');if(!iframe||!iframe.src){console.log(\"JotForm iframe not found or has no src attribute yet\");return;}try{// Parse current iframe URL\nconst url=new URL(iframe.src);// Get UTM parameters from the page URL\nconst pageParams=new URLSearchParams(window.location.search);// List of UTM parameters to transfer\nconst utmParams=[\"utm_source\",\"utm_medium\",\"utm_campaign\",\"utm_term\",\"utm_content\"];// Transfer UTM parameters\nlet paramsAdded=false;for(const param of utmParams){const value=pageParams.get(param);if(value){url.searchParams.set(param,value);paramsAdded=true;}}// Only update if we actually added parameters\nif(paramsAdded){console.log(\"Updating JotForm iframe with UTM parameters:\",url.toString());iframe.src=url.toString();// Track the update with Zuko if it's available\nif(window.Zuko&&typeof window.Zuko.trackEvent===\"function\"){try{window.Zuko.trackEvent(\"utm_parameters_added\");}catch(e){console.log(\"Zuko tracking available but failed:\",e);}}}else{console.log(\"No UTM parameters found in the URL\");}}catch(error){console.error(\"Error updating JotForm with UTM parameters:\",error);}}// Add a second component for easier debugging if needed\nexport function UTMDebugger(){const[debug,setDebug]=React.useState({url:\"\",utmParams:{},iframeFound:false});React.useEffect(()=>{// Get current URL and UTM parameters\nconst currentUrl=window.location.href;const params=new URLSearchParams(window.location.search);const utmParams={};[\"utm_source\",\"utm_medium\",\"utm_campaign\",\"utm_term\",\"utm_content\"].forEach(param=>{const value=params.get(param);if(value)utmParams[param]=value;});// Check if iframe exists\nconst iframe=document.querySelector('iframe[src*=\"form.jotform.com/251057440067149\"]');setDebug({url:currentUrl,utmParams,iframeFound:!!iframe});},[]);return{// This adds a small debug overlay to the component\n// You can attach this to any element to see debugging info\nonTap(){console.log(\"Debug Info:\",debug);alert(`UTM Debug:\nURL: ${debug.url}\nUTM Params: ${JSON.stringify(debug.utmParams,null,2)}\nJotForm iframe found: ${debug.iframeFound}\n            `);}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withwithUTMParams(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...withUTMParams(props)});};}withwithUTMParams.displayName=\"withUTMParams\";export function withUTMDebugger(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...UTMDebugger(props)});};}withUTMDebugger.displayName=\"UTMDebugger\";\nexport const __FramerMetadata__ = {\"exports\":{\"withUTMParams\":{\"type\":\"override\",\"name\":\"withUTMParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"UTMDebugger\":{\"type\":\"override\",\"name\":\"UTMDebugger\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withwithUTMParams\":{\"type\":\"reactHoc\",\"name\":\"withwithUTMParams\",\"annotations\":{\"framerContractV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