{"version":3,"file":"FormHoneypot.DrO2OFFb.mjs","names":["useEffect","_jsx","__esmMin","init_jsx_runtime","c","init_npm_react_18_3_1","ce","withAdvancedHoneypot","Component","props","formLoadTime","form","honeypotField","handleSubmit","e","timeTaken","showFakeSuccess","reason","submitButton","originalText","nameField","notesField","nameValue","notesValue","hasExcessiveConsonants","text","hasRandomCase","upperCount","totalLetters","upperRatio","hasInsufficientVowels","isGibberishPattern","nameIsSuspicious","notesAreSuspicious","init_FormHoneypot"],"sources":["https:/framerusercontent.com/modules/lZ7uUpxWe5c9svyY2dx8/hqJbBqDAS8VOwEU8k4Z9/FormHoneypot.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";/**\n * Honeypot Form Override\n *\n * This override prevents form submission if the honeypot field is filled.\n * Apply this to your Form component in Framer.\n *\n * Setup:\n * 1. Add a form field named \"customer_email_lead\" to your form\n * 2. Make sure this field is hidden (set opacity to 0 or position off-screen)\n * 3. Apply this override to your Form component\n */export function withHoneypot(Component){return props=>{useEffect(()=>{// Find the form element\nconst form=document.querySelector(\"form\");if(!form)return;// Find the honeypot field\nconst honeypotField=form.querySelector('input[name=\"customer_email_lead\"]');if(!honeypotField){console.error('⚠️ HONEYPOT FIELD NOT FOUND - Check that your form has a field named \"customer_email_lead\"');// List all form fields for debugging\nconst allInputs=form.querySelectorAll(\"input, textarea\");console.log(\"Available form fields:\",Array.from(allInputs).map(input=>input.getAttribute(\"name\")));return;}console.log(\"✅ Honeypot protection active\");// Ensure the honeypot field is properly hidden\n// Use CSS that makes it invisible but still accessible to bots\nhoneypotField.style.position=\"absolute\";honeypotField.style.left=\"-9999px\";honeypotField.style.width=\"1px\";honeypotField.style.height=\"1px\";honeypotField.style.opacity=\"0\";honeypotField.setAttribute(\"tabindex\",\"-1\");honeypotField.setAttribute(\"autocomplete\",\"off\");// Add form submit handler\nconst handleSubmit=e=>{// Check if honeypot field has been filled\nif(honeypotField.value&&honeypotField.value.trim()!==\"\"){// Bot detected - prevent submission\ne.preventDefault();e.stopPropagation();console.log(\"Spam submission blocked by honeypot\");// Optionally, you can show a silent success message to the bot\n// or just do nothing to avoid revealing the honeypot\nreturn false;}// If honeypot is empty, allow normal submission\n};// Attach the handler to the form\nform.addEventListener(\"submit\",handleSubmit,true);// Cleanup\nreturn()=>{form.removeEventListener(\"submit\",handleSubmit,true);};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}/**\n * More aggressive honeypot with time-based check\n * This version includes both honeypot field checking and timing validation\n */export function withAdvancedHoneypot(Component){return props=>{useEffect(()=>{const formLoadTime=Date.now();const form=document.querySelector(\"form\");if(!form)return;const honeypotField=form.querySelector('input[name=\"customer_email_lead\"]');if(!honeypotField){console.warn('Honeypot field \"customer_email_lead\" not found');return;}honeypotField.style.position=\"absolute\";honeypotField.style.left=\"-9999px\";honeypotField.style.width=\"1px\";honeypotField.style.height=\"1px\";honeypotField.style.opacity=\"0\";honeypotField.setAttribute(\"tabindex\",\"-1\");honeypotField.setAttribute(\"autocomplete\",\"off\");const handleSubmit=e=>{const timeTaken=Date.now()-formLoadTime;// Helper function to show fake success\nconst showFakeSuccess=reason=>{console.log(\"Spam blocked:\",reason);const submitButton=form.querySelector('button[type=\"submit\"]');if(submitButton){const originalText=submitButton.textContent;submitButton.textContent=\"Submitted!\";submitButton.disabled=true;setTimeout(()=>{submitButton.textContent=originalText;submitButton.disabled=false;},2e3);}};// Check honeypot field\nif(honeypotField.value&&honeypotField.value.trim()!==\"\"){e.preventDefault();e.stopPropagation();showFakeSuccess(\"honeypot filled\");return false;}// Check if form was submitted too quickly (less than 2 seconds)\nif(timeTaken<2e3){e.preventDefault();e.stopPropagation();showFakeSuccess(\"submitted too quickly\");return false;}// Get name and notes fields\nconst nameField=form.querySelector('input[name=\"name\"]');const notesField=form.querySelector('textarea[name=\"notes\"], input[name=\"notes\"]');// Pattern detection for spam\nconst nameValue=nameField?.value||\"\";const notesValue=notesField?.value||\"\";console.log(\"🔍 Form validation check:\",{timeTaken:`${timeTaken}ms`,honeypotFilled:honeypotField.value?\"YES\":\"NO\",nameValue,notesValue});// Check for excessive consonant clusters (common in random strings)\nconst hasExcessiveConsonants=text=>{// More than 4 consonants in a row is suspicious\nreturn/[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]{4,}/.test(text);};// Check for mixed case gibberish pattern (alternating or random case)\nconst hasRandomCase=text=>{// Look for patterns like \"PnquKQlQqlLYI\" - multiple uppercase in middle/end\nconst upperCount=(text.match(/[A-Z]/g)||[]).length;const lowerCount=(text.match(/[a-z]/g)||[]).length;const totalLetters=upperCount+lowerCount;if(totalLetters<5)return false;// If more than 30% uppercase (excluding first letter), it's suspicious\nconst upperRatio=upperCount/totalLetters;return upperRatio>.3&&upperRatio<.9;};// Check for lack of vowels (most real names/messages have vowels)\nconst hasInsufficientVowels=text=>{if(text.length<5)return false;const vowelCount=(text.match(/[aeiouAEIOU]/g)||[]).length;const vowelRatio=vowelCount/text.length;// Less than 25% vowels is suspicious\nreturn vowelRatio<.25;};// Check for very short messages with no spaces (like \"WTyyvhwHGVdRhNz\")\nconst isGibberishPattern=text=>{if(text.length<8)return false;// No spaces and more than 8 characters is suspicious for notes\nreturn!text.includes(\" \")&&text.length>8;};// Check if name field looks suspicious\nconst nameIsSuspicious=nameValue.length>0&&(hasExcessiveConsonants(nameValue)||hasRandomCase(nameValue)||hasInsufficientVowels(nameValue));// Check if notes field looks suspicious\nconst notesAreSuspicious=notesValue.length>0&&(hasExcessiveConsonants(notesValue)||hasRandomCase(notesValue)||hasInsufficientVowels(notesValue)||isGibberishPattern(notesValue));console.log(\"🤖 Spam detection:\",{nameIsSuspicious,notesAreSuspicious,bothSuspicious:nameIsSuspicious&&notesAreSuspicious});// Only block if BOTH fields are suspicious\nif(nameIsSuspicious&&notesAreSuspicious){e.preventDefault();e.stopPropagation();showFakeSuccess(\"suspicious patterns in multiple fields\");return false;}};form.addEventListener(\"submit\",handleSubmit,true);return()=>{form.removeEventListener(\"submit\",handleSubmit,true);};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withHoneypot\":{\"type\":\"reactHoc\",\"name\":\"withHoneypot\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAdvancedHoneypot\":{\"type\":\"reactHoc\",\"name\":\"withAdvancedHoneypot\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormHoneypot.map"],"mappings":"A,kHA0BG,SAAgBO,EAAqBC,EAAU,CAAC,MAAOC,KAAQT,MAAc,CAAC,IAAMU,EAAa,KAAK,IAAI,EAAQC,EAAK,SAAS,cAAc,MAAM,EAAE,GAAG,CAACA,EAAK,OAAO,IAAMC,EAAcD,EAAK,cAAc,mCAAmC,EAAE,GAAG,CAACC,EAAc,CAAC,QAAQ,KAAK,gDAAgD,EAAE,MAAO,CAACA,EAAc,MAAM,SAAS,WAAWA,EAAc,MAAM,KAAK,UAAUA,EAAc,MAAM,MAAM,MAAMA,EAAc,MAAM,OAAO,MAAMA,EAAc,MAAM,QAAQ,IAAIA,EAAc,aAAa,WAAW,IAAI,EAAEA,EAAc,aAAa,eAAe,KAAK,EAAE,IAAMC,EAAaC,GAAG,CAAC,IAAMC,EAAU,KAAK,IAAI,EAAEL,EACpoBM,EAAgBC,GAAQ,CAAC,QAAQ,IAAI,gBAAgBA,CAAM,EAAE,IAAMC,EAAaP,EAAK,cAAc,uBAAuB,EAAE,GAAGO,EAAa,CAAC,IAAMC,EAAaD,EAAa,YAAYA,EAAa,YAAY,aAAaA,EAAa,SAAS,GAAK,eAAe,CAACA,EAAa,YAAYC,EAAaD,EAAa,SAAS,EAAM,EAAE,GAAG,CAAE,CAAC,EAC1V,GAAGN,EAAc,OAAOA,EAAc,MAAM,KAAK,IAAI,GAA8E,OAA1EE,EAAE,eAAe,EAAEA,EAAE,gBAAgB,EAAEE,EAAgB,iBAAiB,EAAS,GAC1I,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