{"version":3,"file":"Validation.CUE2sumx.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/46aVNqvF08y6iar5Dge4/bDpt1tjCKkwZoAmzHx85/Validation.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";// Strict 7 to 10 digit Phone Number Validation (Blocks repeating junk numbers)\nexport function withPhoneValidation(Component){return props=>{const[errorMessage,setErrorMessage]=useState(\"\");const[htmlPattern,setHtmlPattern]=useState(\"[0-9]{7,10}\");const handleChange=e=>{const value=e.target.value;// 1. Regex check: Detects if the entire string consists of just 1 repeating digit\nconst isRepeatingJunk=/^([0-9])\\1+$/.test(value);// 2. Continuous test sequence check (e.g., 1234567, 1234567890)\nconst isSequentialJunk=\"1234567890123456789\".includes(value)&&value.length>=7;if(isRepeatingJunk||isSequentialJunk){setErrorMessage(\"Invalid Number\");setHtmlPattern(\"▲▲▲\")// Locks the HTML form layout from submitting\n;e.target.setCustomValidity(\"Junk phone number detected.\");}else{setErrorMessage(\"\");setHtmlPattern(\"[0-9]{7,10}\")// Restores normal length check rule\n;e.target.setCustomValidity(\"\");}if(props.onChange)props.onChange(e);};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",display:\"flex\",alignItems:\"center\"},children:[/*#__PURE__*/_jsx(Component,{...props,type:\"tel\",pattern:htmlPattern,title:errorMessage||\"Must be between 7 and 10 digits.\",onChange:handleChange,style:{...props.style,paddingRight:errorMessage?\"110px\":props.style?.paddingRight}}),errorMessage&&/*#__PURE__*/_jsx(\"div\",{style:{color:\"#FF4D4D\",fontSize:\"11px\",fontFamily:\"sans-serif\",position:\"absolute\",right:\"16px\",fontWeight:600,zIndex:10,pointerEvents:\"none\",backgroundColor:\"transparent\",letterSpacing:\"0.2px\"},children:errorMessage})]});};}// Professional Real-Time Real vs. Fake Email Validation (Blocks Special Symbol Junk)\nexport function withEmailValidation(Component){return props=>{const[errorMessage,setErrorMessage]=useState(\"\");const[htmlPattern,setHtmlPattern]=useState(\"^[^@\\\\s]+@[^@\\\\s]+\\\\.[^@\\\\s]+$\");const validateEmailField=async(email,targetInputElement)=>{if(!email)return;// 1. Strict Structural Cleanliness Check (Blocks symbols like #, $, %, &, *, etc. in username)\n// Normal professional email names should only contain alphanumeric characters, dots, underscores, or hyphens.\nconst strictSyntaxRegex=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;if(!strictSyntaxRegex.test(email)){setErrorMessage(\"Invalid Characters\");setHtmlPattern(\"▲▲▲\");targetInputElement.setCustomValidity(\"Invalid email characters detected.\");return;}const domainPart=email.split(\"@\")[1]||\"\";// 2. Structural/Keyboard-Mash Guard (Catches immediate fake strings like 'asdfasdf12345')\nconst isKeyboardMash=/([a-z0-9])\\1{4,}/i.test(domainPart)||(domainPart.match(/[0-9]/g)||[]).length>4;if(isKeyboardMash){setErrorMessage(\"Invalid Domain\");setHtmlPattern(\"▲▲▲\");targetInputElement.setCustomValidity(\"Fake email string detected.\");return;}try{// 3. Real-Time DNS/MX Lookup to check if the typed domain can physically receive mail\nconst response=await fetch(`https://cloudflare-dns.com/dns-query?name=${domainPart}&type=MX`,{headers:{accept:\"application/dns-json\"}});const dnsData=await response.json();if(!dnsData.Answer||dnsData.Answer.length===0){setErrorMessage(\"Domain Doesn't Exist\");setHtmlPattern(\"▲▲▲\");targetInputElement.setCustomValidity(\"Fake email domain.\");}else{// Safe domain (Includes gmail.com, yahoo.com, and valid business endpoints with clean format)\nsetErrorMessage(\"\");setHtmlPattern(\"^[^@\\\\s]+@[^@\\\\s]+\\\\.[^@\\\\s]+$\");targetInputElement.setCustomValidity(\"\");}}catch(error){console.warn(\"DNS Validation lookup skipped\",error);setErrorMessage(\"\");setHtmlPattern(\"^[^@\\\\s]+@[^@\\\\s]+\\\\.[^@\\\\s]+$\");targetInputElement.setCustomValidity(\"\");}};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",display:\"flex\",alignItems:\"center\"},children:[/*#__PURE__*/_jsx(Component,{...props,type:\"email\",pattern:htmlPattern,title:errorMessage||props.title,onBlur:e=>{validateEmailField(e.target.value,e.target);},onChange:e=>{setErrorMessage(\"\");setHtmlPattern(\"^[^@\\\\s]+@[^@\\\\s]+\\\\.[^@\\\\s]+$\");e.target.setCustomValidity(\"\");if(props.onChange)props.onChange(e);},style:{...props.style,paddingRight:errorMessage?\"140px\":props.style?.paddingRight}}),errorMessage&&/*#__PURE__*/_jsx(\"div\",{style:{color:\"#FF4D4D\",fontSize:\"11px\",fontFamily:\"sans-serif\",position:\"absolute\",right:\"16px\",fontWeight:600,zIndex:10,pointerEvents:\"none\",backgroundColor:\"transparent\",letterSpacing:\"0.2px\"},children:errorMessage})]});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withPhoneValidation\":{\"type\":\"reactHoc\",\"name\":\"withPhoneValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withEmailValidation\":{\"type\":\"reactHoc\",\"name\":\"withEmailValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Validation.map"],"mappings":"yHACA,SAAgB,EAAoB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAa,GAAiBA,EAAS,GAAG,CAAM,CAAC,EAAY,GAAgBA,EAAS,cAAc,CAAO,EAAa,GAAG,CAAC,IAAM,EAAM,EAAE,OAAO,MAC/M,EAAgB,eAAe,KAAK,EAAM,CAC1C,EAAiB,sBAAsB,SAAS,EAAM,EAAE,EAAM,QAAQ,EAAK,GAAiB,GAAkB,EAAgB,iBAAiB,CAAC,EAAe,MAAM,CAC1K,EAAE,OAAO,kBAAkB,8BAA8B,GAAO,EAAgB,GAAG,CAAC,EAAe,cAAc,CACjH,EAAE,OAAO,kBAAkB,GAAG,EAAK,EAAM,UAAS,EAAM,SAAS,EAAE,EAAG,OAAoB,EAAM,MAAM,CAAC,MA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