{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/vHefZg5U2WtFtt1va2yg/LZOvCoFNgDV2cdgnvNb4/Form_validation_ru.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";/**\n@framerDisableUnlink\n@framerIntrinsicWidth 100\n@framerIntrinsicHeight 100\n*/export function withPhoneMaskAndNameValidation(Component){return props=>{useEffect(()=>{const applyPhoneMask=event=>{const matrix=\"8 (___) ___-__-__\"// Adjust phone matrix as needed\n;let i=0;const def=matrix.replace(/\\D/g,\"\");let currentValue=event.target.value.replace(/\\D/g,\"\");if(def.length>=currentValue.length){currentValue=def;}const newValue=matrix.replace(/./g,function(a){return/[_\\d]/.test(a)&&i<currentValue.length?currentValue.charAt(i++):i>=currentValue.length?\"\":a;});event.target.value=newValue;};const handleBlur=event=>{const currentValue=event.target.value;// Adjust 2 to 3 for country codes with two digits (e.g., +38)\nif(currentValue.length<=2){event.target.value=\"\";const customEvent=new Event(\"change\");event.target.dispatchEvent(customEvent);}};const restrictNameInput=event=>{const regex=/^[a-zA-Z\\u0400-\\u04FF\\s]*$///Latic, Cyrillic, and spaces\n;if(!regex.test(event.target.value)){event.target.value=event.target.value.replace(/[^a-zA-Z\\u0400-\\u04FF\\s]/g,\"\");}};const phoneFields=document.querySelectorAll('input[type=\"tel\"]');const nameFields=document.querySelectorAll('input[name=\"name\"]');phoneFields.forEach(phoneField=>{phoneField.addEventListener(\"input\",applyPhoneMask);phoneField.addEventListener(\"blur\",handleBlur);});nameFields.forEach(nameField=>{nameField.addEventListener(\"input\",restrictNameInput);});// Cleanup on unmount\nreturn()=>{phoneFields.forEach(phoneFields=>{phoneFields.removeEventListener(\"input\",applyPhoneMask);phoneFields.removeEventListener(\"blur\",handleBlur);});};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withPhoneMaskAndNameValidation\":{\"type\":\"reactHoc\",\"name\":\"withPhoneMaskAndNameValidation\",\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"@framerIntrinsicWidth 100\",\"framerIntrinsicHeight\":\"100\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Form_validation_ru.map"],
  "mappings": "gDAIS,SAASA,EAA+BC,EAAU,CAAC,OAAOC,IAAQC,EAAU,IAAI,CAAC,IAAMC,EAAeC,GAAO,CAAC,IAAMC,EAAO,oBAC/HC,EAAE,EAAQC,EAAIF,EAAO,QAAQ,MAAM,EAAE,EAAMG,EAAaJ,EAAM,OAAO,MAAM,QAAQ,MAAM,EAAE,EAAKG,EAAI,QAAQC,EAAa,SAAQA,EAAaD,GAAK,IAAME,EAASJ,EAAO,QAAQ,KAAK,SAASK,EAAE,CAAC,MAAM,QAAQ,KAAKA,CAAC,GAAGJ,EAAEE,EAAa,OAAOA,EAAa,OAAOF,GAAG,EAAEA,GAAGE,EAAa,OAAO,GAAGE,CAAE,CAAC,EAAEN,EAAM,OAAO,MAAMK,CAAS,EAAQE,EAAWP,GAAO,CAClW,GADsXA,EAAM,OAAO,MACnX,QAAQ,EAAE,CAACA,EAAM,OAAO,MAAM,GAAG,IAAMQ,EAAY,IAAI,MAAM,QAAQ,EAAER,EAAM,OAAO,cAAcQ,CAAW,CAAE,CAAC,EAAQC,EAAkBT,GAAO,CAAa,6BACnK,KAAKA,EAAM,OAAO,KAAK,IAAGA,EAAM,OAAO,MAAMA,EAAM,OAAO,MAAM,QAAQ,4BAA4B,EAAE,EAAG,EAAQU,EAAY,SAAS,iBAAiB,mBAAmB,EAAQC,EAAW,SAAS,iBAAiB,oBAAoB,EAAE,OAAAD,EAAY,QAAQE,GAAY,CAACA,EAAW,iBAAiB,QAAQb,CAAc,EAAEa,EAAW,iBAAiB,OAAOL,CAAU,CAAE,CAAC,EAAEI,EAAW,QAAQE,GAAW,CAACA,EAAU,iBAAiB,QAAQJ,CAAiB,CAAE,CAAC,EAC/c,IAAI,CAACC,EAAY,QAAQA,GAAa,CAACA,EAAY,oBAAoB,QAAQX,CAAc,EAAEW,EAAY,oBAAoB,OAAOH,CAAU,CAAE,CAAC,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsBO,EAAKlB,EAAU,CAAC,GAAGC,CAAK,CAAC,EAAI",
  "names": ["withPhoneMaskAndNameValidation", "Component", "props", "ue", "applyPhoneMask", "event", "matrix", "i", "def", "currentValue", "newValue", "a", "handleBlur", "customEvent", "restrictNameInput", "phoneFields", "nameFields", "phoneField", "nameField", "p"]
}
