{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/cBZmbfdiKgqs6VZIDqgh/wkscNVBVhya6w5CoDWL5/Validations.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=\"+38 (0__) ___-__-__\"// 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,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 to 2 for country codes with two digits (e.g., +38)\nif(currentValue.length<=4){event.target.value=\"\";const customEvent=new Event(\"change\");event.target.dispatchEvent(customEvent);}};const restrictNameInput=event=>{const regex=/^[a-zA-Z\\u0400-\\u04FF\\s]*$/// Latin, 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(phoneField=>{phoneField.removeEventListener(\"input\",applyPhoneMask);phoneField.removeEventListener(\"blur\",handleBlur);});nameFields.forEach(nameField=>{nameField.removeEventListener(\"input\",restrictNameInput);});};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}// Adjusted based on all three screenshots to ensure completeness and alignment with the expected structure.\n\nexport const __FramerMetadata__ = {\"exports\":{\"withPhoneMaskAndNameValidation\":{\"type\":\"reactHoc\",\"name\":\"withPhoneMaskAndNameValidation\",\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"@framerIntrinsicWidth 100\",\"framerIntrinsicHeight\":\"100\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Validations.map"],
  "mappings": "2CAIS,SAASA,EAA+BC,EAAU,CAAC,OAAOC,IAAQC,EAAU,IAAI,CAAC,IAAMC,EAAeC,GAAO,CAAC,IAAMC,EAAO,sBAC/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,KAAKK,GAAU,QAAQ,KAAKA,CAAC,GAAGJ,EAAEE,EAAa,OAAOA,EAAa,OAAOF,GAAG,EAAEA,GAAGE,EAAa,OAAO,GAAGE,CAAG,EAAEN,EAAM,OAAO,MAAMK,CAAS,EAAQE,EAAWP,GAAO,CAC1V,GAD8WA,EAAM,OAAO,MAC3W,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,QAAQE,GAAY,CAACA,EAAW,oBAAoB,QAAQb,CAAc,EAAEa,EAAW,oBAAoB,OAAOL,CAAU,CAAE,CAAC,EAAEI,EAAW,QAAQE,GAAW,CAACA,EAAU,oBAAoB,QAAQJ,CAAiB,CAAE,CAAC,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsBK,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"]
}
