{"version":3,"file":"Register_Button.B_P6fcCP.mjs","names":["Helmet"],"sources":["https:/framerusercontent.com/modules/7VekRYsnccvY3tuFFqOA/RSlqOlwKcUtYwOiMSaO2/Register_Button.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";import{Helmet}from\"react-helmet\";export default function Download(props){const{title,tint,style,file}=props;const[isHovered,setIsHovered]=useState(false);const handleHover=()=>{setIsHovered(true);};const handleHoverEnd=()=>{setIsHovered(false);};const buttonStyle={margin:0,borderRadius:10,backgroundColor:tint,color:\"#FFFFFF\",fontSize:\"16px\",fontFamily:\"Public Sans, serif\",cursor:isHovered?\"pointer\":\"default\",transform:isHovered?\"scale(1.01)\":\"scale(1)\",transition:\"transform 0.3s\"};async function postData(){try{const response=await fetch(\"https://onboarding.streakcard.click/nfo/log-event\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({studentUserID:\"NA\",eventName:\"individual_registration_website_click\",productIDs:[100]})});if(!response.status){throw new Error(\"Something went wrong\");}const result=await response.json();console.log(result);return result// Return the result if needed for further use\n;}catch(error){console.error(\"Error:\",error.message);}}return /*#__PURE__*/_jsxs(motion.div,{style:{...style,...containerStyle},children:[/*#__PURE__*/_jsx(Helmet,{children:/*#__PURE__*/_jsx(\"link\",{href:\"https://fonts.googleapis.com/css2?family=Pridi:wght@500&display=swap\",rel:\"stylesheet\"})}),/*#__PURE__*/_jsx(motion.div,{onTap:()=>{const urlParams=new URLSearchParams(window.location.search);const referrer=document.referrer;const referredBy=urlParams.get(\"referredBy\");const fbclid=urlParams.get(\"fbclid\");const utm_medium=urlParams.get(\"utm_medium\");const utm_campaign=urlParams.get(\"utm_campaign\");const utm_content=urlParams.get(\"utm_content\");const utm_source=urlParams.get(\"utm_source\");const baseUrl=\"https://nfoself.checkout.nationalfinanceolympiad.com/CheckoutPage/?&scl=SLF\";// Function to build the URL with available parameters\nfunction buildUrl(){const params=new URLSearchParams;// Add base parameters\n// Conditionally add optional parameters if they are available\nif(referredBy)params.append(\"referredBy\",referredBy);if(fbclid)params.append(\"fbclid\",fbclid);if(utm_source)params.append(\"utm_source\",utm_source);if(utm_medium)params.append(\"utm_medium\",utm_medium);if(utm_campaign)params.append(\"utm_campaign\",utm_campaign);if(utm_content)params.append(\"utm_content\",utm_content);if(referrer)params.append(\"referrer\",referrer);return`${baseUrl}&${params.toString()}`;}postData().then(()=>{// if (fbclid) {\n//     window.open(buildUrl(), \"_self\")\n// } else {\n//     window.open(\n//         \"https://nfoself.checkout.nationalfinanceolympiad.com/CheckoutPage/?&scl=SLF\",\n//         \"_self\"\n//     )\n// }\nwindow.open(buildUrl(),\"_self\");}).catch(()=>{// if (referredBy) {\n//     window.open(buildUrl(), \"_self\")\n// } else {\n//     window.open(\n//         \"https://nfoself.checkout.nationalfinanceolympiad.com/CheckoutPage/?&scl=SLF\",\n//         \"_self\"\n//     )\n// }\nwindow.open(buildUrl(),\"_self\");});},style:{paddingLeft:50,...buttonStyle,paddingRight:50,paddingTop:15,paddingBottom:15,fontWeight:700},onMouseEnter:handleHover,onMouseLeave:handleHoverEnd,children:title})]});}Download.defaultProps={tint:\"#09F\",title:\"Register for NFO 2024\"};addPropertyControls(Download,{tint:{title:\"Tint\",type:ControlType.Color},title:{title:\"Label\",type:ControlType.String},file:{title:\"File\",type:ControlType.File,allowedFileTypes:[]}});const containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Download\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Register_Button.map"],"mappings":"6bAA4M,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,QAAM,OAAK,CAAC,EAAW,CAAC,EAAU,EA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