{"version":3,"file":"Submit6ToolsUpdated.CaXsIsVa.mjs","names":["useState","CTAPrimary"],"sources":["https:/framerusercontent.com/modules/oaL787eoSjDyhGB40CJU/6D6dGtFwFd6CS2zSseJm/Submit6ToolsUpdated.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import CTAPrimary from\"https://framer.com/m/CTAPrimary-eiUA.js@LgOx1qQ3SxdWdRugK0i5\";import{useState}from\"react\";// import { useState, useEffect } from \"react\"\nconst ConvertKit_API_Endpoint=\"https://api.convertkit.com/v3/forms/5826065/subscribe\";const functionUrl=\"https://dglmmrnwszmmgyktpfvg.supabase.co/functions/v1/email-subscription\";export default function Form(props){const[email,setEmail]=useState(\"\");function handleChange(e){setEmail(e.target.value);}async function handleSubmit(e){e.preventDefault();try{const fields={};if(typeof window!==\"undefined\"){const params=new URLSearchParams(window.location.search);params.forEach((value,key)=>{console.log(key,value);const formattedKey=key.toLowerCase();if(formattedKey.startsWith(\"utm\")){fields[formattedKey]=value;}});}const subResponse=await fetch(functionUrl,{method:\"POST\",headers:{\"Content-Type\":\"application/json\",Accept:\"application/json\"},body:JSON.stringify({email:email,fields:fields,formId:5826065})});const subData=await subResponse.json();if(subResponse.ok){console.log(\"Subscription successful\",subData);window.location.href=\"/thank-you\";}else{console.error(\"Subscription failed\",subData);return;}}catch(error){console.error(\"Network error\",error);}}return /*#__PURE__*/_jsx(\"div\",{id:\"mc_embed_shell\",style:{borderRadius:\"4px\",overflow:\"hidden\"},children:/*#__PURE__*/_jsxs(\"form\",{method:\"post\",id:\"ck-embedded-subscribe-form\",name:\"ck-embedded-subscribe-form\",className:\"validate\",noValidate:true,onSubmit:handleSubmit,style:{padding:0,display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",gap:\"10px\",zIndex:1,width:\"100%\",margin:\"0 auto\",borderRadius:\"4px\",height:\"flex\",maxWidth:\"400px\",backgroundColor:\"#EBEBEB\"},children:[/*#__PURE__*/_jsx(\"input\",{type:\"email\",name:\"email\",id:\"ck-EMAIL\",placeholder:\"Enter your email\",onChange:handleChange,value:email,style:{width:\"100%\",height:\"100%\",border:\"none\",padding:\"12px\",outline:\"none\",fontFamily:\"Exodus Regular\",fontSize:\"12px\",lineHeight:\"1em\",display:\"flex\",backgroundColor:\"#EBEBEB\"}}),/*#__PURE__*/_jsx(\"button\",{style:{border:\"none\",outline:\"none\",backgroundColor:\"transparent\"},type:\"submit\",children:/*#__PURE__*/_jsx(CTAPrimary,{title:\"Subscribe\"})})]})});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Form\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Submit6ToolsUpdated.map"],"mappings":"oSACmL,SAAwB,EAAK,EAAM,CAAC,GAAK,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAC,SAAS,EAAa,EAAE,CAAC,EAAS,EAAE,OAAO,MAAM,CAAE,eAAe,EAAa,EAAE,CAAC,EAAE,gBAAgB,CAAC,GAAG,CAAC,IAAM,EAAO,EAAE,CAAW,IAAS,QAA0B,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAQ,SAAS,EAAM,IAAM,CAAC,QAAQ,IAAI,EAAI,EAAM,CAAC,IAAM,EAAa,EAAI,aAAa,CAAI,EAAa,WAAW,MAAM,GAAE,EAAO,GAAc,IAAS,CAAE,IAAM,EAAY,MAAM,MAAM,EAAY,CAAC,OAAO,OAAO,QAAQ,CAAC,eAAe,mBAAmB,OAAO,mBAAmB,CAAC,KAAK,KAAK,UAAU,CAAO,QAAa,SAAO,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAO,EAAQ,MAAM,EAAY,MAAM,CAAC,GAAG,EAAY,GAAI,QAAQ,IAAI,0BAA0B,EAAQ,CAAC,EAAO,SAAS,KAAK,iBAAkB,CAAC,QAAQ,MAAM,sBAAsB,EAAQ,CAAC,cAAe,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