{"version":3,"file":"Error_validation.Bd0UeWzA.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/Pz7qAYMsbluL3mNKQWXK/UkTx2NhUypEEmhEtoaYU/Error_validation.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useEffect}from\"react\";export function indianPhoneValidation(Component){return props=>{const inputRef=useRef(null);useEffect(()=>{const input=inputRef.current?.querySelector(\"input\");if(!input)return;input.type=\"tel\";input.inputMode=\"numeric\";input.maxLength=10;const handleInput=e=>{const target=e.target;const originalValue=target.value;const cleanValue=originalValue.replace(/\\D/g,\"\").slice(0,10);// Only update if changes were actually made to avoid infinite loops\nif(originalValue!==cleanValue){target.value=cleanValue;// THIS PART IS CRITICAL:\n// Force Framer to notice the change so it doesn't \"reset\" the field\ntarget.dispatchEvent(new Event(\"change\",{bubbles:true}));}const isValidIndianMobile=/^[6-9]\\d{9}$/.test(cleanValue);const hasValue=cleanValue.length>0;if(hasValue&&!isValidIndianMobile){target.setCustomValidity(\"Please enter a valid 10-digit mobile number\");target.setAttribute(\"aria-invalid\",\"true\");}else{target.setCustomValidity(\"\");target.setAttribute(\"aria-invalid\",\"false\");}};input.addEventListener(\"input\",handleInput);return()=>input.removeEventListener(\"input\",handleInput);},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:inputRef});};}\nexport const __FramerMetadata__ = {\"exports\":{\"indianPhoneValidation\":{\"type\":\"reactHoc\",\"name\":\"indianPhoneValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Error_validation.map"],"mappings":"yHAA+E,SAAgB,EAAsB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAASA,EAAO,IAAI,EAGiU,OAH/T,MAAc,CAAC,IAAM,EAAM,EAAS,SAAS,cAAc,OAAO,EAAE,GAAG,CAAC,EAAM,OAAO,EAAM,KAAK,MAAM,EAAM,UAAU,UAAU,EAAM,UAAU,GAAG,IAAM,EAAY,GAAG,CAAC,IAAM,EAAO,EAAE,OAAa,EAAc,EAAO,MAAY,EAAW,EAAc,QAAQ,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,EACnc,IAAgB,IAAY,EAAO,MAAM,EAE5C,EAAO,cAAc,IAAI,MAAM,SAAS,CAAC,QAAQ,EAAI,CAAC,CAAC,GAAG,IAAM,EAAoB,eAAe,KAAK,CAAU,EAAiB,EAAW,OAAO,GAAe,CAAC,GAAqB,EAAO,kBAAkB,6CAA6C,EAAE,EAAO,aAAa,eAAe,MAAM,IAAQ,EAAO,kBAAkB,EAAE,EAAE,EAAO,aAAa,eAAe,OAAO,EAAG,EAA8C,OAA5C,EAAM,iBAAiB,QAAQ,CAAW,MAAY,EAAM,oBAAoB,QAAQ,CAAW,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,IAAI,CAAQ,CAAC,CAAE,CAAE,iBAH9f,IAAoC"}