{"version":3,"file":"Validation.D4ICeWmf.mjs","names":["React.useState","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/HYz0J4Dv4uPopn9Ld6p8/vtbUr9kchKZg0fSSezjN/Validation.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";/**\n * UseNameRestriction (updated)\n * - Allows: letters (A–Z), spaces, hyphen (-), apostrophes (' or ’)\n * - Blocks everything else at keystroke level\n * - Sanitizes paste/IME: collapses repeats, trims ends, normalizes curly apostrophes to straight\n */export function UseNameRestriction(){const[value,setValue]=React.useState(\"\");const sanitize=raw=>{// normalize curly apostrophes to straight\nlet v=raw.replace(/[’]/g,\"'\");// strip everything except letters, space, hyphen, apostrophe\nv=v.replace(/[^a-zA-Z\\s\\-']/g,\"\");// collapse multiples\nv=v.replace(/\\s+/g,\" \")// multi spaces -> single\n;v=v.replace(/\\-+/g,\"-\")// multi hyphens -> single\n;v=v.replace(/'+/g,\"'\")// multi apostrophes -> single\n;// trim leading/trailing space/hyphen/apostrophe\nv=v.replace(/^[\\s\\-']+|[\\s\\-']+$/g,\"\");return v;};return{value,onBeforeInput:e=>{const data=e?.data??\"\";if(!data)return;// allow deletions/composition steps\n// accept A–Z, a–z, space, hyphen, apostrophe (straight or curly)\nif(!/^[a-zA-Z\\s\\-'\\u2019]$/.test(data))e.preventDefault();},onChange:e=>{setValue(sanitize(e.target.value));},name:\"name\",autoComplete:\"name\",inputMode:\"text\",spellCheck:false};}/**\n * UseUSPhoneMask\n * - Accepts digits, spaces, parentheses, hyphen (-), en dash (–), em dash (—)\n * - Normalizes display to: +1 (AAA) BBB–CCCC (en dash)\n * - Works with onChange(event) and onValueChange(next)\n */export function UseUSPhoneMask(){const[display,setDisplay]=React.useState(\"\");// Keep only digits; clamp to +1 plus 10 digits\nconst toDigits=raw=>raw.replace(/\\D/g,\"\");const clampUS11=digits=>(digits.startsWith(\"1\")?digits:\"1\"+digits).slice(0,11);// Format as +1 (AAA) BBB–CCCC with progressive fill\nconst formatUS=digits=>{const d=digits.slice(1)// national number\n;const a=d.slice(0,3);const b=d.slice(3,6);const c=d.slice(6,10);let out=\"+1\";if(a.length)out+=` (${a}`;if(a.length===3)out+=`)`;if(b.length)out+=` ${b}`;if(c.length)out+=`–${c}`// en dash\n;return out;};const commit=raw=>{const digitized=clampUS11(toDigits(raw));setDisplay(formatUS(digitized));};return{value:display,// Allow digits, spaces, parentheses, hyphen, en dash, em dash at keystroke level\nonBeforeInput:e=>{const ch=e?.data??\"\";if(!ch)return;// deletions/composition\nif(!/^[0-9()\\s\\-\\u2013\\u2014]$/.test(ch)){e.preventDefault();}},// Support both native and Framer-style change signatures\nonChange:e=>commit(e?.target?.value??\"\"),onValueChange:next=>commit(next),name:\"phone\",autoComplete:\"tel\",inputMode:\"numeric\",maxLength:17,// Native validation: accept hyphen, en dash, or em dash\npattern:\"\\\\+1\\\\s\\\\(\\\\d{3}\\\\)\\\\s\\\\d{3}[-–—]\\\\d{4}\"};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withUseNameRestriction(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...UseNameRestriction(props)});};}withUseNameRestriction.displayName=\"UseNameRestriction\";export function withUseUSPhoneMask(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...UseUSPhoneMask(props)});};}withUseUSPhoneMask.displayName=\"UseUSPhoneMask\";\nexport const __FramerMetadata__ = {\"exports\":{\"withUseNameRestriction\":{\"type\":\"reactHoc\",\"name\":\"withUseNameRestriction\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUseUSPhoneMask\":{\"type\":\"reactHoc\",\"name\":\"withUseUSPhoneMask\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"UseUSPhoneMask\":{\"type\":\"override\",\"name\":\"UseUSPhoneMask\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"UseNameRestriction\":{\"type\":\"override\",\"name\":\"UseNameRestriction\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Validation.map"],"mappings":"0KAKG,SAAgB,GAAoB,CAAC,GAAK,CAAC,EAAM,GAAUA,EAAe,GAAG,CAAO,EAAS,GAAK,CACrG,IAAI,EAAE,EAAI,QAAQ,OAAO,IAAI,CAMU,MALvC,GAAE,EAAE,QAAQ,kBAAkB,GAAG,CACjC,EAAE,EAAE,QAAQ,OAAO,IAAI,CACtB,EAAE,EAAE,QAAQ,OAAO,IAAI,CACvB,EAAE,EAAE,QAAQ,MAAM,IAAI,CAEvB,EAAE,EAAE,QAAQ,uBAAuB,GAAG,CAAQ,GAAI,MAAM,CAAC,QAAM,cAAc,GAAG,CAAC,IAAM,EAAK,GAAG,MAAM,GAAO,IAExG,wBAAwB,KAAK,EAAK,EAAC,EAAE,gBAAgB,GAAG,SAAS,GAAG,CAAC,EAAS,EAAS,EAAE,OAAO,MAAM,CAAC,EAAG,KAAK,OAAO,aAAa,OAAO,UAAU,OAAO,WAAW,GAAM,CAK7K,SAAgB,GAAgB,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAe,GAAG,CAC1E,EAAS,GAAK,EAAI,QAAQ,MAAM,GAAG,CAAO,EAAU,IAAS,EAAO,WAAW,IAAI,CAAC,EAAO,IAAI,GAAQ,MAAM,EAAE,GAAG,CAClH,EAAS,GAAQ,CAAC,IAAM,EAAE,EAAO,MAAM,EAAE,CACxC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAO,EAAE,EAAE,MAAM,EAAE,EAAE,CAAO,EAAE,EAAE,MAAM,EAAE,GAAG,CAAK,EAAI,KACxE,OADgF,EAAE,SAAO,GAAK,KAAK,KAAO,EAAE,SAAS,IAAE,GAAK,KAAO,EAAE,SAAO,GAAK,IAAI,KAAO,EAAE,SAAO,GAAK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