{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/mqfJgwCRKtjUdOJG4TQF/WODDOcX4w0uq17gzKEXj/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 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)){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\"}},\"withFormEmailInsert\":{\"type\":\"reactHoc\",\"name\":\"withFormEmailInsert\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Email_save.map"],
  "mappings": "kLAAAA,IACA,IAAMC,EAASC,EAAY,CAAC,MAAM,EAAE,CAAC,EAAS,SAASC,EAAcC,EAAU,CAAC,OAAOC,GAAO,CAAC,GAAK,CAACC,EAAMC,CAAQ,EAAEN,EAAS,EAAE,SAASO,EAAcC,EAAE,CAAC,IAAMC,EAAWD,EAAE,OAAaE,EAAWD,EAAW,MAAM,KAAK,EACrNE,EAAeC,EAAsF,GAAG,CAAtD,mDAAoE,KAAKF,CAAU,EAAG,OAAAD,EAAW,kBAAkB,eAAe,EAAS,GAAO,IAAMI,EAAYH,EAAW,MAAM,GAAG,EAAE,CAAC,EAAE,OAAGC,EAAe,SAASE,CAAW,GAAGJ,EAAW,kBAAkB,yBAAyB,EAAS,KAAOA,EAAW,kBAAkB,EAAE,EAAS,GAAK,CAIjZ,OAAoBK,EAAKX,EAAU,CAAC,GAAGC,EAAM,SAASI,GAAG,CAACD,EAAcC,CAAC,EAAEF,EAAS,CAAC,MAAME,EAAE,OAAO,KAAK,CAAC,CAAE,CAAC,CAAC,CAAE,CAAE,CAAQ,SAASO,EAAoBZ,EAAU,CAAC,OAAOC,GAAO,CAAC,GAAK,CAACC,EAAMC,CAAQ,EAAEN,EAAS,EAAE,SAASO,EAAcE,EAAW,CACpP,IAAMC,EAAWD,EAAW,MAAM,KAAK,EACjCE,EAAeC,EAAsF,GAAG,CAAtD,mDAAoE,KAAKF,CAAU,EAAG,OAAAD,EAAW,kBAAkB,eAAe,EAAS,GAAO,IAAMI,EAAYH,EAAW,MAAM,GAAG,EAAE,CAAC,EAEnP,OAAGC,EAAe,SAASE,CAAW,GAAGJ,EAAW,kBAAkB,gCAAgC,EAAS,KAAOA,EAAW,kBAAkB,EAAE,EAAS,GAAK,CAAC,OAAAO,EAAU,IAAI,CAAC,GAAG,OAAO,SAAS,KAAK,SAAS,aAAa,EAAE,CAAC,IAAMC,EAAgB,SAAS,cAAc,wCAAwC,EAAKA,IAAiBA,EAAgB,MAAMZ,EAAM,MAAME,EAAcU,CAAe,QACpY,SAAS,cAAc,qBAAqB,IAAG,SAAS,cAAc,qBAAqB,EAAE,MAAMZ,EAAM,MACjH,EAAE,CAACA,EAAM,KAAK,CAAC,EAAsBS,EAAKX,EAAU,CAAC,GAAGC,EAAM,SAASI,GAAGF,EAAS,CAAC,MAAME,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAE,CAAE",
  "names": ["init_ssg_sandbox_shims", "useStore", "createStore", "withEmailSave", "Component", "props", "store", "setStore", "validateEmail", "e", "emailInput", "emailValue", "blockedDomains", "EmailDomainList", "emailDomain", "p", "withFormEmailInsert", "ue", "emailInputField"]
}
