{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/vBkuuhMNueannTfHrKsD/OMS6LyV4NAEnWc6GIZZZ/Auth.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";function MyComponent(){const defaultFormData={fullName:\"\",email:\"\",message:\"\"};const[formData,setFormData]=useState(defaultFormData);const handleChange=e=>{const{name,value}=e.target;setFormData({...formData,[name]:value});};const[isLoading,setIsLoading]=useState(false);const[showSuccessMessage,setShowSuccessMessage]=useState(false)// State to control success message visibility\n;const[errorMessage,setErrorMessage]=useState(null);const[showForm,setShowForm]=useState(true);const handleSubmit=async e=>{setIsLoading(true);function splitFullName(fullName){const parts=fullName.split(\" \");if(parts.length===2){const[firstName,lastName]=parts;return{firstName,lastName};}else if(parts.length>2){const firstName=parts[0];const lastName=parts.slice(1).join(\" \");return{firstName,lastName};}else{return{firstName:fullName,lastName:\"\"};}}e.preventDefault();console.log(\"Form data submitted:\",formData);var authHeaders=new Headers;authHeaders.append(\"Content-Type\",\"application/json\");// Matomo Tracking\nif(window._paq){window._paq.push([\"trackEvent\",\"prayer-partner-event\",\"click\",`prayer-partner`]);}// const { firstName, lastName } = splitFullName(formData?.fullName)\ntry{// API Request\nvar apiHeaders=new Headers;apiHeaders.append(\"Content-Type\",\"application/json\");apiHeaders.append(\"x-api-key\",\"XY1yrTW5nCTiwXh0DVaq926QV9ddI3QU\");const searchParams=new URLSearchParams(window.location.search);const ref=searchParams.get(\"ref\");var apiRaw=JSON.stringify({email:formData===null||formData===void 0?void 0:formData.email,message:formData===null||formData===void 0?void 0:formData.message,fullName:formData===null||formData===void 0?void 0:formData.fullName,portal:\"HOPEFORME\",page:window.location.href,ref});var apiRequestOptions={method:\"POST\",headers:apiHeaders,body:apiRaw,redirect:\"follow\"};// const requestId = `support-group-${new Date().getTime()}`\nconst apiResponse=await fetch(`https://hope4america-rest-server.cpptl.co/send-email`,apiRequestOptions);if((apiResponse===null||apiResponse===void 0?void 0:apiResponse.status)!==200){setErrorMessage(\"Something went wrong!!\");return;}setIsLoading(false)// Clear loading state\n;// setShowForm(false);\nsetShowSuccessMessage(true);setErrorMessage(null);setFormData(defaultFormData);setTimeout(()=>{window.location.href=\"https://hopeforme.us/resources\";},500);}catch(error){console.log(\"Error:\",error);setIsLoading(false)// Clear loading state\n;setErrorMessage(\"Something went wrong\");setShowSuccessMessage(false);}};return /*#__PURE__*/_jsx(\"div\",{style:{backgroundColor:\"#131720\"},children:showForm&&/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:{display:\"flex\",flexDirection:\"column\",rowGap:\"24px\"},children:[/*#__PURE__*/_jsx(\"input\",{type:\"text\",id:\"fullName\",name:\"fullName\",value:formData.fullName,onChange:handleChange,required:true,placeholder:\"First Name\",style:{fontFamily:\"Poppins!important\",fontSize:\"1rem\",fontStyle:\"normal\",color:\"#E2BBA0\",borderRadius:\"0.25rem\",border:\"1px solid #E2BBA0\",backgroundColor:\"#131720\",width:\"100%\",height:\"100%\",padding:\"0.625rem 1rem\",alignItems:\"center\"}}),/*#__PURE__*/_jsx(\"input\",{type:\"email\",id:\"email\",name:\"email\",value:formData.email,onChange:handleChange,required:true,placeholder:\"Email\",style:{fontFamily:\"Poppins!important\",fontSize:\"1rem\",fontStyle:\"normal\",color:\"#E2BBA0\",borderRadius:\"0.25rem\",border:\"1px solid #E2BBA0\",backgroundColor:\"#131720\",width:\"100%\",height:\"100%\",padding:\"0.625rem 1rem\",alignItems:\"center\"}}),/*#__PURE__*/_jsx(\"textarea\",{id:\"message\",name:\"message\",value:formData.message,onChange:handleChange,required:true,placeholder:\"Message\",style:{fontFamily:\"Poppins!important\",fontSize:\"1rem\",fontStyle:\"normal\",color:\"#E2BBA0\",borderRadius:\"0.25rem\",border:\"1px solid #E2BBA0\",backgroundColor:\"#131720\",width:\"100%\",height:\"100px\",padding:\"0.625rem 1rem\",alignItems:\"center\"}}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{color:\"#E2BBA0\",borderRadius:\"0.25rem\",border:\"1px solid #E2BBA0\",backgroundColor:\"#E2BBA0\",width:\"100%\",padding:\"0.625rem 1rem\",alignItems:\"center\",cursor:\"pointer\"},children:/*#__PURE__*/_jsx(\"span\",{style:{color:\"#000\",textAlign:\"center\",fontFamily:\"Poppins!important\",fontSize:\"1rem\",fontStyle:\"normal\",fontWeight:\"bold\",lineHeight:\"normal\",textTransform:\"uppercase\"},children:isLoading?\"Success! Your form was submitted\":\"Send your message to a prayer partner\"})}),errorMessage&&/*#__PURE__*/_jsxs(\"p\",{style:{color:\"red\",fontSize:\"1rem\",fontStyle:\"normal\",fontWeight:\"bold\",lineHeight:\"normal\"},children:[\"Error: \",errorMessage]}),showSuccessMessage&&/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",justifyContent:\"center\",color:\"#000000\",fontSize:\"1rem\",fontStyle:\"normal\",fontWeight:\"bold\",lineHeight:\"normal\",borderRadius:\"0.25rem\",border:\"1px solid #E2BBA0\",backgroundColor:\"#E2BBA0\",width:\"100%\",textAlign:\"center!important\"},children:/*#__PURE__*/_jsx(\"a\",{style:{color:\"#000000\",display:\"flex\",width:\"100%\",justifyContent:\"center\",alignItems:\"center\",textDecoration:\"none\"},href:\"https://hopeforme.us/\",children:/*#__PURE__*/_jsx(\"button\",{type:\"button\",style:{color:\"#000000\",borderRadius:\"0.25rem\",border:\"1px solid #E2BBA0\",backgroundColor:\"#E2BBA0\",fontSize:\"1rem\",fontStyle:\"normal\",fontWeight:\"bold\",lineHeight:\"normal\",padding:\"0.625rem 1rem\",alignItems:\"center\"},children:\"Back to Home\"})})})]})});}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight fixed\n */export default MyComponent;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MyComponent\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//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,OAAO,MAAM,OAAO,eAAe,SAAS,WAAW,SAAS,eAAe,MAAM,EAAE,KAAK,wBAAwB,SAAsBA,EAAK,SAAS,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,UAAU,aAAa,UAAU,OAAO,oBAAoB,gBAAgB,UAAU,SAAS,OAAO,UAAU,SAAS,WAAW,OAAO,WAAW,SAAS,QAAQ,gBAAgB,WAAW,QAAQ,EAAE,SAAS,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAG70F,IAAOa,EAAQ9B",
  "names": ["init_ssg_sandbox_shims", "MyComponent", "defaultFormData", "formData", "setFormData", "ye", "handleChange", "e", "name", "value", "isLoading", "setIsLoading", "showSuccessMessage", "setShowSuccessMessage", "errorMessage", "setErrorMessage", "showForm", "setShowForm", "p", "splitFullName", "fullName", "parts", "firstName", "lastName", "authHeaders", "apiHeaders", "ref", "apiRaw", "apiRequestOptions", "apiResponse", "error", "Auth_default"]
}
