{"version":3,"file":"Recaptcha.p1MBpZwp.mjs","names":["useRef","useState","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","window","ce","init_jsx_runtime","c","_e","de","init_framer_BEr93sCn","addPropertyControls","ControlType","Recaptchav2","props","recaptchaRef","widgetIdRef","error","setError","mountedRef","loadRecaptcha","script","renderRecaptcha","id","siteKey","form","input","token","onVerify","err","theme","size","handleSubmit","init_Recaptcha"],"sources":["https:/framerusercontent.com/modules/UkgMsYfWPTS7PqoBnFWx/47RixaAuYqbcx10IpyG7/Recaptcha.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef,useState}from\"react\";export default function Recaptchav2(props){const{siteKey,theme=\"light\",size=\"normal\",onVerify}=props;const recaptchaRef=useRef(null);const widgetIdRef=useRef(null);const[error,setError]=useState(null);const mountedRef=useRef(false);useEffect(()=>{// Prevent double mounting in React Strict Mode\nif(mountedRef.current)return;mountedRef.current=true;const loadRecaptcha=()=>{// Check if script already exists\nlet script=document.getElementById(\"recaptcha-script\");if(!script){script=document.createElement(\"script\");script.id=\"recaptcha-script\";script.src=\"https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoad&render=explicit\";script.async=true;script.defer=true;script.onerror=()=>{setError(\"reCAPTCHA blocked by ad blocker or network issue\");};document.head.appendChild(script);}// Global callback for when reCAPTCHA loads\nwindow.onRecaptchaLoad=()=>{renderRecaptcha();};// If already loaded, render immediately\nif(window.grecaptcha?.render){renderRecaptcha();}};const renderRecaptcha=()=>{if(!recaptchaRef.current||widgetIdRef.current!==null)return;try{const id=window.grecaptcha.render(recaptchaRef.current,{sitekey:siteKey,theme:theme,size:size,callback:token=>{const form=recaptchaRef.current?.closest(\"form\");if(form){let input=form.querySelector('input[name=\"g-recaptcha-response\"]');if(!input){input=document.createElement(\"input\");input.type=\"hidden\";input.name=\"g-recaptcha-response\";form.appendChild(input);}input.value=token;}onVerify?.(token);}});widgetIdRef.current=id;}catch(err){console.error(\"reCAPTCHA render error:\",err);setError(\"Failed to render reCAPTCHA\");}};loadRecaptcha();// Cleanup\nreturn()=>{if(widgetIdRef.current!==null&&window.grecaptcha?.reset){try{window.grecaptcha.reset(widgetIdRef.current);}catch(e){// Ignore cleanup errors\n}}};},[siteKey,theme,size,onVerify]);// Form validation\nuseEffect(()=>{const form=recaptchaRef.current?.closest(\"form\");if(!form||widgetIdRef.current===null)return;const handleSubmit=e=>{const response=window.grecaptcha?.getResponse(widgetIdRef.current);if(!response){e.preventDefault();e.stopPropagation();alert(\"Please verify that you are not a robot.\");return false;}};form.addEventListener(\"submit\",handleSubmit,true);return()=>form.removeEventListener(\"submit\",handleSubmit,true);},[widgetIdRef.current]);if(error){return /*#__PURE__*/_jsx(\"div\",{style:{padding:\"10px\",background:\"#fee\",border:\"1px solid #fcc\",borderRadius:\"4px\",color:\"#c00\",fontSize:\"12px\"},children:error});}return /*#__PURE__*/_jsx(\"div\",{ref:recaptchaRef,style:{display:\"flex\",justifyContent:\"center\",alignItems:\"center\",minHeight:size===\"compact\"?\"78px\":\"78px\"}});}addPropertyControls(Recaptchav2,{siteKey:{type:ControlType.String,title:\"Site Key\",placeholder:\"6LeIxAcTAAAAAJcZVRqyHh71...\",description:\"Your Google reCAPTCHA v2 site key\"},theme:{type:ControlType.Enum,title:\"Theme\",options:[\"light\",\"dark\"],defaultValue:\"light\"},size:{type:ControlType.Enum,title:\"Size\",options:[\"normal\",\"compact\"],defaultValue:\"normal\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Recaptchav2\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Recaptcha.map"],"mappings":"A,sMAA4I,SAAwBc,EAAY,EAAM,CAAC,GAAK,CAAC,UAAQ,QAAM,QAAQ,OAAK,SAAS,YAAUC,EAAYC,EAAahB,EAAO,IAAI,EAAQi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