{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/L0Mxw44VymKGmgkARXr5/bipD4MMxVOnDC02jMhPt/RecaptchaButton.js"],
  "sourcesContent": ["// Google reCAPTCHA v2 component with explicit rendering for form integration\n// IMPORTANT: This component generates a token that MUST be verified on your backend server\n// to complete the reCAPTCHA protection. Without server-side verification, you will receive\n// \"unprotected events\" warnings from Google.\n//\n// Backend verification example:\n// 1. Send the token to your server endpoint\n// 2. Verify with Google: POST https://www.google.com/recaptcha/api/siteverify\n// 3. Include secret key, response token, and user IP\n// 4. Check the verification response before processing the form\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState,useRef,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Google reCAPTCHA v2 Widget Component\n * \n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Recaptcha(props){const{siteKey=\"\",theme=\"light\",size=\"normal\",onVerify,onExpired,onError,showInstructions=true}=props;const[scriptLoaded,setScriptLoaded]=useState(false);const[widgetId,setWidgetId]=useState(null);const[error,setError]=useState(null);const[token,setToken]=useState(null);const recaptchaRef=useRef(null);useEffect(()=>{if(typeof window===\"undefined\")return;if(!siteKey){startTransition(()=>setError(\"Site key is required\"));return;}// Check if script is already loaded\nif(window.grecaptcha){startTransition(()=>setScriptLoaded(true));return;}// Define the callback function\nwindow.onRecaptchaLoad=()=>{startTransition(()=>{setScriptLoaded(true);setError(null);});};// Load the script with explicit rendering\nconst script=document.createElement(\"script\");script.src=\"https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoad&render=explicit\";script.async=true;script.defer=true;script.onerror=()=>{startTransition(()=>setError(\"Failed to load reCAPTCHA\"));};document.head.appendChild(script);return()=>{try{if(document.head.contains(script)){document.head.removeChild(script);}delete window.onRecaptchaLoad;}catch(e){// Script already removed\n}};},[siteKey]);useEffect(()=>{if(!scriptLoaded||!window.grecaptcha||!recaptchaRef.current||!siteKey){return;}// Reset any existing widget\nif(widgetId!==null){try{window.grecaptcha.reset(widgetId);}catch(e){// Widget doesn't exist\n}}// Render the reCAPTCHA widget\ntry{window.grecaptcha.ready(()=>{if(recaptchaRef.current){const id=window.grecaptcha.render(recaptchaRef.current,{sitekey:siteKey,theme:theme,size:size,callback:responseToken=>{startTransition(()=>{setError(null);setToken(responseToken);});if(onVerify)onVerify(responseToken);},\"expired-callback\":()=>{startTransition(()=>setToken(null));if(onExpired)onExpired();},\"error-callback\":()=>{console.warn(\"reCAPTCHA error occurred - this may be due to network issues or invalid site key\");startTransition(()=>setToken(null));if(onError)onError();}});startTransition(()=>setWidgetId(id));}});}catch(err){startTransition(()=>setError(\"Failed to render reCAPTCHA\"));}},[scriptLoaded,siteKey,theme,size,onVerify,onExpired,onError]);const reset=()=>{if(widgetId!==null&&window.grecaptcha){try{window.grecaptcha.reset(widgetId);startTransition(()=>setToken(null));}catch(e){// Widget doesn't exist\n}}};const getResponse=()=>{if(widgetId!==null&&window.grecaptcha){try{return window.grecaptcha.getResponse(widgetId);}catch(e){return\"\";}}return\"\";};if(error){return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,position:\"relative\",padding:\"16px\",backgroundColor:\"#fee\",color:\"#c33\",border:\"1px solid #fcc\",borderRadius:\"4px\",fontSize:\"14px\",textAlign:\"center\"},children:[\"Error: \",error]});}if(!scriptLoaded){return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,position:\"relative\",padding:\"16px\",backgroundColor:\"#f5f5f5\",color:\"#666\",border:\"1px solid #ddd\",borderRadius:\"4px\",fontSize:\"14px\",textAlign:\"center\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:\"8px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:\"16px\",height:\"16px\",border:\"2px solid #ddd\",borderTop:\"2px solid #666\",borderRadius:\"50%\",animation:\"spin 1s linear infinite\"}}),\"Loading reCAPTCHA...\",/*#__PURE__*/_jsx(\"style\",{children:`\n            @keyframes spin {\n              0% { transform: rotate(0deg); }\n              100% { transform: rotate(360deg); }\n            }\n          `})]});}return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,position:\"relative\",display:\"inline-block\"},children:[/*#__PURE__*/_jsx(\"div\",{ref:recaptchaRef,style:{minHeight:size===\"compact\"?\"144px\":\"78px\",minWidth:size===\"compact\"?\"164px\":\"304px\"}}),showInstructions&&/*#__PURE__*/_jsxs(\"div\",{style:{marginTop:\"12px\",padding:\"12px\",backgroundColor:\"#f8f9fa\",border:\"1px solid #e9ecef\",borderRadius:\"4px\",fontSize:\"12px\",color:\"#495057\",lineHeight:\"1.4\"},children:[/*#__PURE__*/_jsx(\"strong\",{children:\"\u26A0\uFE0F Backend Verification Required\"}),/*#__PURE__*/_jsx(\"br\",{}),token?/*#__PURE__*/_jsxs(_Fragment,{children:[\"Token generated! Send this token to your server for verification:\",/*#__PURE__*/_jsx(\"br\",{}),/*#__PURE__*/_jsxs(\"code\",{style:{backgroundColor:\"#e9ecef\",padding:\"2px 4px\",borderRadius:\"2px\",fontSize:\"11px\",wordBreak:\"break-all\"},children:[token.substring(0,50),\"...\"]})]}):\"Complete the reCAPTCHA above to generate a verification token.\",/*#__PURE__*/_jsx(\"br\",{}),/*#__PURE__*/_jsx(\"small\",{children:'Without server-side verification, Google will send \"unprotected events\" warnings.'})]})]});}addPropertyControls(Recaptcha,{siteKey:{type:ControlType.String,title:\"Site Key\",placeholder:\"Your reCAPTCHA v2 site key\",defaultValue:\"\"},theme:{type:ControlType.Enum,title:\"Theme\",options:[\"light\",\"dark\"],optionTitles:[\"Light\",\"Dark\"],defaultValue:\"light\",displaySegmentedControl:true},size:{type:ControlType.Enum,title:\"Size\",options:[\"normal\",\"compact\"],optionTitles:[\"Normal\",\"Compact\"],defaultValue:\"normal\",displaySegmentedControl:true},showInstructions:{type:ControlType.Boolean,title:\"Show Instructions\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},onVerify:{type:ControlType.EventHandler,title:\"On Verify\"},onExpired:{type:ControlType.EventHandler,title:\"On Expired\"},onError:{type:ControlType.EventHandler,title:\"On Error\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Recaptcha\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RecaptchaButton.map"],
  "mappings": "4KAekB,SAARA,EAA2BC,EAAM,CAAC,GAAK,CAAC,QAAAC,EAAQ,GAAG,MAAAC,EAAM,QAAQ,KAAAC,EAAK,SAAS,SAAAC,EAAS,UAAAC,EAAU,QAAAC,EAAQ,iBAAAC,EAAiB,EAAI,EAAEP,EAAW,CAACQ,EAAaC,CAAe,EAAEC,EAAS,EAAK,EAAO,CAACC,EAASC,CAAW,EAAEF,EAAS,IAAI,EAAO,CAACG,EAAMC,CAAQ,EAAEJ,EAAS,IAAI,EAAO,CAACK,EAAMC,CAAQ,EAAEN,EAAS,IAAI,EAAQO,EAAaC,EAAO,IAAI,EAAEC,EAAU,IAAI,CAAC,GAAG,OAAOC,EAAS,IAAY,OAAO,GAAG,CAACnB,EAAQ,CAACoB,EAAgB,IAAIP,EAAS,sBAAsB,CAAC,EAAE,MAAO,CACzd,GAAGM,EAAO,WAAW,CAACC,EAAgB,IAAIZ,EAAgB,EAAI,CAAC,EAAE,MAAO,CACxEW,EAAO,gBAAgB,IAAI,CAACC,EAAgB,IAAI,CAACZ,EAAgB,EAAI,EAAEK,EAAS,IAAI,CAAE,CAAC,CAAE,EACzF,IAAMQ,EAAO,SAAS,cAAc,QAAQ,EAAE,OAAAA,EAAO,IAAI,iFAAiFA,EAAO,MAAM,GAAKA,EAAO,MAAM,GAAKA,EAAO,QAAQ,IAAI,CAACD,EAAgB,IAAIP,EAAS,0BAA0B,CAAC,CAAE,EAAE,SAAS,KAAK,YAAYQ,CAAM,EAA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AG3B,EAAM,MAAM,SAAS,WAAW,QAAQ,OAAO,gBAAgB,UAAU,MAAM,OAAO,OAAO,iBAAiB,aAAa,MAAM,SAAS,OAAO,UAAU,SAAS,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,IAAI,KAAK,EAAE,SAAS,CAAc4B,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,OAAO,iBAAiB,UAAU,iBAAiB,aAAa,MAAM,UAAU,yBAAyB,CAAC,CAAC,EAAE,uBAAoCA,EAAK,QAAQ,CAAC,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,WAKn5B,CAAC,CAAC,CAAC,CAAC,CAAilC,CAACE,EAAoB/B,EAAU,CAAC,QAAQ,CAAC,KAAKgC,EAAY,OAAO,MAAM,WAAW,YAAY,6BAA6B,aAAa,EAAE,EAAE,MAAM,CAAC,KAAKA,EAAY,KAAK,MAAM,QAAQ,QAAQ,CAAC,QAAQ,MAAM,EAAE,aAAa,CAAC,QAAQ,MAAM,EAAE,aAAa,QAAQ,wBAAwB,EAAI,EAAE,KAAK,CAAC,KAAKA,EAAY,KAAK,MAAM,OAAO,QAAQ,CAAC,SAAS,SAAS,EAAE,aAAa,CAAC,SAAS,SAAS,EAAE,aAAa,SAAS,wBAAwB,EAAI,EAAE,iBAAiB,CAAC,KAAKA,EAAY,QAAQ,MAAM,oBAAoB,aAAa,GAAK,aAAa,OAAO,cAAc,MAAM,EAAE,SAAS,CAAC,KAAKA,EAAY,aAAa,MAAM,WAAW,EAAE,UAAU,CAAC,KAAKA,EAAY,aAAa,MAAM,YAAY,EAAE,QAAQ,CAAC,KAAKA,EAAY,aAAa,MAAM,UAAU,CAAC,CAAC",
  "names": ["Recaptcha", "props", "siteKey", "theme", "size", "onVerify", "onExpired", "onError", "showInstructions", "scriptLoaded", "setScriptLoaded", "ye", "widgetId", "setWidgetId", "error", "setError", "token", "setToken", "recaptchaRef", "pe", "ue", "window", "Z", "script", "id", "responseToken", "reset", "getResponse", "u", "p", "l", "addPropertyControls", "ControlType"]
}
