{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/mqfJgwCRKtjUdOJG4TQF/1NOYkQOpzJzpJlQbrH1C/Email_save.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{EmailDomainList}from\"https://framerusercontent.com/modules/4XCbkV06reIR1Un4aQCF/JAqmSbYMyrVYBUKrO7fa/EmailDomainList.js\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({email:\"\"});export function withEmailPass(Component){return props=>{const[store]=useStore();// const getEmail = WithEmailValue() // \u2705 Hook inside a function component\nreturn /*#__PURE__*/_jsx(Component,{...props,getEmail:store.email});};}// export function WithEmailValue() {\n//     const [store] = useStore()\n//     return () => {\n//         console.log(\"Email Value ::: \", store.email)\n//         return store.email\n//     }\n// }\nexport function withEmailSave(Component){return props=>{const[store,setStore]=useStore();function validateEmail(e){const emailInput=e.target;const emailValue=emailInput.value.trim();// Personal email domains to block\nconst blockedDomains=EmailDomainList;const emailPattern=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;if(!emailPattern.test(emailValue)){emailInput.setCustomValidity(\"Invalid email\");return false;}const emailDomain=emailValue.split(\"@\")[1];if(blockedDomains.includes(emailDomain)){emailInput.setCustomValidity(\"Please enter work email\");return false;}emailInput.setCustomValidity(\"\");return true;}// useEffect(() => {\n//     const email = document.querySelector('input[name=\"email\"]')\n//     email.addEventListener(\"input\", validateEmail)\n// }, [])\nreturn /*#__PURE__*/_jsx(Component,{...props,onChange:e=>{validateEmail(e);setStore({email:e.target.value});}});};}export function withFormEmailInsert(Component){return props=>{const[store,setStore]=useStore();function validateEmail(emailInput){// const emailInput = e.target\nconst emailValue=emailInput.value.trim();// Personal email domains to block\nconst blockedDomains=EmailDomainList;const emailPattern=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;if(!emailPattern.test(emailValue)){window.posthog&&window.posthog.capture(\"junk_lead_submission_attempt\");emailInput.setCustomValidity(\"Invalid email\");return false;}const emailDomain=emailValue.split(\"@\")[1];// console.log(\"emailDomain Typed: \", emailDomain)\n// console.log(\"Block? \", blockedDomains.includes(emailDomain))\nif(blockedDomains.includes(emailDomain)){emailInput.setCustomValidity(\"Please enter a business email.\");return false;}emailInput.setCustomValidity(\"\");return true;}useEffect(()=>{if(window.location.href.includes(\"/instant-ai\")){const emailInputField=document.querySelector('form.waitlist-form input[type=\"email\"]');if(emailInputField){emailInputField.value=store.email;validateEmail(emailInputField);// console.log(\"Value chagned form: \", store.email)\n}}else{if(document.querySelector('input[type=\"email\"]')){document.querySelector('input[type=\"email\"]').value=store.email;// console.log(\"Value chagned form: \", store.email)\n}}},[store.email]);return /*#__PURE__*/_jsx(Component,{...props,onChange:e=>setStore({email:e.target.value})});};}// export function withEmailInsert(Component): ComponentType {\n//     return (props) => {\n//         const [store, setStore] = useStore()\n//         const [value, setValue] = useState(store.email)\n//         console.log(\"email value: \", value)\n//         const handleInputChange = (e) => {\n//             console.log(\"email change: \", props)\n//             // setValue(e.target.value)\n//         }\n//         return (\n//             <Component value=\"aasadf\" {...props} onChange={handleInputChange} />\n//         )\n//     }\n// }\n\nexport const __FramerMetadata__ = {\"exports\":{\"withEmailSave\":{\"type\":\"reactHoc\",\"name\":\"withEmailSave\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withEmailPass\":{\"type\":\"reactHoc\",\"name\":\"withEmailPass\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFormEmailInsert\":{\"type\":\"reactHoc\",\"name\":\"withFormEmailInsert\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Email_save.map"],
  "mappings": "uLAAAA,IACA,IAAMC,EAASC,EAAY,CAAC,MAAM,EAAE,CAAC,EAAS,SAASC,EAAcC,EAAU,CAAC,OAA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S,aAAa,EAAE,CAAC,IAAMC,EAAgB,SAAS,cAAc,wCAAwC,EAAKA,IAAiBA,EAAgB,MAAMb,EAAM,MAAMI,EAAcS,CAAe,EAC7Y,MAAS,SAAS,cAAc,qBAAqB,IAAG,SAAS,cAAc,qBAAqB,EAAE,MAAMb,EAAM,MACjH,EAAE,CAACA,EAAM,KAAK,CAAC,EAAsBC,EAAKH,EAAU,CAAC,GAAGC,EAAM,SAASM,GAAGF,EAAS,CAAC,MAAME,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAE,CAAE",
  "names": ["init_ssg_sandbox_shims", "useStore", "createStore", "withEmailPass", "Component", "props", "store", "p", "withEmailSave", "setStore", "validateEmail", "e", "emailInput", "emailValue", "blockedDomains", "EmailDomainList", "emailDomain", "withFormEmailInsert", "ue", "emailInputField"]
}
