{"version":3,"file":"OneStepBookDemoForm.BXBdWRkx.mjs","names":["__esmMin","init_npm_react_18_3_1","window","ce","init_jsx_runtime","c","init_ssg_sandbox_shims","init_store_js__1_0","createStore","withCalendly","store","useStore","Component","props","capitalize","word","withFirstName","textCapital","text","withCompanyName","withCompanyInitial","initial","withCompanyVariant","variant","withFormValidation","setStore","className","formElement","form","field","name","emailInput","nameInput","lastNameInput","channelInput","buildCalendlyLink","email","utms","getUtms","k","v","BASE_CALENDLY_URL","checkFormValidity","isEmailValid","isNameValid","isLastNameValid","isChannelValid","allValid","firstName","extracted","extractCompanyName","companyName","calendlyLink","handleEmailInput","blockedEmailDomains","emailPattern","value","domain","d","handleFieldChange","handleSubmit","UTM_KEYS","init_OneStepBookDemoForm","base","out","qs","m"],"sources":["https:/framerusercontent.com/modules/mUyjRlDdmNm0wX9OjbJw/E7XQIW34Wv4jWjdh3Cy7/OneStepBookDemoForm.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\";// embed_domain and embed_type make Calendly post its events (calendly.event_scheduled…)\n// to the page, where jimo.ai's analytics reads them (jimo-landing: public/landing/jimo-analytics.js).\nconst BASE_CALENDLY_URL=\"https://calendly.com/thomas-747/jimo-intro-call?hide_gdpr_banner=1&hide_event_type_details=1&embed_domain=jimo.ai&embed_type=Inline\";const useStore=createStore({formFieldsValid:false,firstName:\"\",companyName:\"Jimo\",calendlyLink:BASE_CALENDLY_URL});// ─── HELPER: Extract company name from email domain ───────────────────────────\n// e.g. thomas@jimo.ai → \"Jimo\" | sarah@usejimo.com → \"Usejimo\"\nconst extractCompanyName=email=>{const domain=email.split(\"@\")[1];if(!domain)return\"\";const base=domain.split(\".\")[0];return base.charAt(0).toUpperCase()+base.slice(1).toLowerCase();};// ─── HELPER: The visit's campaign tags, passed on to Calendly ────────────────\n// From the URL first, else from the cookie Framer sets on the landing page.\n// Calendly stores utm_* on the booking (it ignores other keys, so no gclid).\nconst UTM_KEYS=[\"utm_source\",\"utm_medium\",\"utm_campaign\",\"utm_content\",\"utm_term\"];const getUtms=()=>{const out={};if(typeof window===\"undefined\")return out;const qs=new URLSearchParams(window.location.search);UTM_KEYS.forEach(k=>{const v=qs.get(k);if(v)out[k]=v;});if(Object.keys(out).length)return out;try{const m=document.cookie.match(/(?:^|; )framerFormsUTMTags=([^;]+)/);const c=m?JSON.parse(decodeURIComponent(m[1])):{};UTM_KEYS.forEach(k=>{if(c[k])out[k]=String(c[k]);});}catch{}return out;};// ─── withNextButton ───────────────────────────────────────────────────────────\nexport function withNextButton(Component){return props=>{const[store]=useStore();const variant=store.formFieldsValid?\"Default\":\"Disabled\";return /*#__PURE__*/_jsx(Component,{...props,variant:variant});};}// ─── withCalendly ─────────────────────────────────────────────────────────────\nexport function withCalendly(Component){return props=>{const[store]=useStore();return /*#__PURE__*/_jsx(Component,{...props,calendlylink:store.calendlyLink});};}function capitalize(word){if(!word)return\"\";return word[0].toUpperCase()+word.slice(1).toLowerCase();}// ─── withFirstName ────────────────────────────────────────────────────────────\nexport function withFirstName(Component){return props=>{const[store]=useStore();const textCapital=capitalize(store.firstName);const text=store.firstName?`Welcome ${textCapital}, let's have a quick chat!`:\"Welcome, let's have a quick chat!\";return /*#__PURE__*/_jsx(Component,{...props,text:text});};}// ─── withCompanyName ──────────────────────────────────────────────────────────\nexport function withCompanyName(Component){return props=>{const[store]=useStore();return /*#__PURE__*/_jsx(Component,{...props,text:store.companyName});};}// ─── withCompanyInitial ───────────────────────────────────────────────────────\nexport function withCompanyInitial(Component){return props=>{const[store]=useStore();const initial=store.companyName?store.companyName.charAt(0):\"\";return /*#__PURE__*/_jsx(Component,{...props,text:initial});};}// ─── withCompanyVariant ───────────────────────────────────────────────────────\nexport function withCompanyVariant(Component){return props=>{const[store]=useStore();const isJimo=store.companyName.toLowerCase()===\"jimo\"||store.companyName.toLowerCase()===\"usejimo\";const variant=isJimo?\"default\":\"filled\";return /*#__PURE__*/_jsx(Component,{...props,variant:variant});};}// ─── withFormValidation ───────────────────────────────────────────────────────\nexport function withFormValidation(Component){return props=>{const[,setStore]=useStore();useEffect(()=>{// Some pages render several <form> elements — the Main CTA Input\n// (email only), this One-Step Demo form, and both of those again\n// inside the modal. A bare document.querySelector would bind to\n// whichever lands first in the DOM, so scope every lookup to the\n// form this override is actually applied to.\nconst className=typeof props.className===\"string\"?props.className.trim():\"\";const scopedForm=className?document.querySelector(`form.${className.split(/\\s+/).join(\".\")}`):null;// Fallback for the rare case Framer does not hand us a className:\n// this is the only form on the page carrying a first-name field.\nconst formElement=scopedForm??Array.from(document.querySelectorAll(\"form\")).find(form=>form.querySelector(\"[name='first-name']\"));if(!formElement)return;// `channel` is a textarea, so the selector must not be tag-qualified.\nconst field=name=>formElement.querySelector(`[name='${name}']`);const emailInput=field(\"email\");const nameInput=field(\"first-name\");const lastNameInput=field(\"last-name\");const channelInput=field(\"channel\");const buildCalendlyLink=()=>{const name=nameInput?.value.trim()??\"\";const email=emailInput?.value.trim()??\"\";const utms=Object.entries(getUtms()).map(([k,v])=>`&${k}=${encodeURIComponent(v)}`).join(\"\");return`${BASE_CALENDLY_URL}&name=${encodeURIComponent(name)}&email=${encodeURIComponent(email)}${utms}`;};const checkFormValidity=()=>{const isEmailValid=emailInput&&emailInput.value.trim()!==\"\"&&emailInput.checkValidity()&&emailInput.validationMessage===\"\";const isNameValid=nameInput&&nameInput.value.trim()!==\"\";const isLastNameValid=lastNameInput&&lastNameInput.value.trim()!==\"\";const isChannelValid=channelInput&&channelInput.value.trim()!==\"\";const allValid=!!isEmailValid&&!!isNameValid&&!!isLastNameValid&&!!isChannelValid;const firstName=nameInput?.value.trim()??\"\";const extracted=extractCompanyName(emailInput?.value.trim()??\"\");const companyName=extracted!==\"\"?extracted:\"Jimo\";const calendlyLink=buildCalendlyLink();setStore({formFieldsValid:allValid,firstName,companyName,calendlyLink});return allValid;};const handleEmailInput=()=>{if(!emailInput)return;const blockedEmailDomains=[\"gmail\",\"yahoo\",\"hotmail\",\"outlook\",\"live\",\"aol\",\"icloud\",\"mail\",\"protonmail\",\"zoho\",\"test\",\"gmai\",\"msn\",\"yandex\",\"gmx\",\"aim\",\"inbox\",\"example\",\"gmail.com\",\"10minutemail\",\"guerrillamail\",\"mailinator\",\"tempmail\",\"maildrop\",\"yopmail\",\"trashmail\",\"getnada\",\"mailnesia\",\"fakemail\",\"throwawaymail\",\"sharklasers\",\"spamgourmet\",\"moakt\",\"dispostable\",\"mailcatch\",\"mintemail\",\"mytempemail\",\"tempinbox\",\"spam4.me\",\"qq\",\"163\",\"bhuxp.org\",\"volku.org\",\"laxiw.org\",\"tst\",\"xxx\",\"appcues.com\",\"userpilot.com\",\"userpilot.io\",\"intercom.com\",\"candu.ai\",\"productfruits.com\",\"usetandem.ai\",\"chameleon.io\",\"pendo.io\",\"command.ai\",\"commandbar.com\",\"userflow.com\",\"whatfix.com\",\"walkme.com\",\"frigade.com\",\"frigade.ai\",\"introjs.com\",\"lemonlearning.com\",\"stonly.com\",\"apty.io\",\"userlane.com\",\"optimonk.com\",\"olvy.app\",\"olvy.co\",\"usetiful.com\",\"screeb.app\",\"getbeamer.com\",\"inlinehelp.com\",\"layup.ai\",\"layuplabs.ai\",\"userguiding.com\",\"guide.cx\",\"guidecx.com\"];const emailPattern=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;const value=emailInput.value.trim();const domain=value.split(\"@\")[1];if(value===\"\"){emailInput.setCustomValidity(\"\");}else if(!emailPattern.test(value)){emailInput.setCustomValidity(\"Please input your email in the valid format.\");}else if(domain&&blockedEmailDomains.some(d=>domain.toLowerCase().includes(d.toLowerCase()))){emailInput.setCustomValidity(\"Please only enter your work email.\");}else{emailInput.setCustomValidity(\"\");}emailInput.reportValidity();setTimeout(checkFormValidity,100);};const handleFieldChange=()=>{setTimeout(checkFormValidity,100);};const handleSubmit=()=>{checkFormValidity();};emailInput?.addEventListener(\"input\",handleEmailInput);emailInput?.addEventListener(\"blur\",handleEmailInput);nameInput?.addEventListener(\"input\",handleFieldChange);nameInput?.addEventListener(\"blur\",handleFieldChange);lastNameInput?.addEventListener(\"input\",handleFieldChange);lastNameInput?.addEventListener(\"blur\",handleFieldChange);channelInput?.addEventListener(\"input\",handleFieldChange);channelInput?.addEventListener(\"blur\",handleFieldChange);formElement.addEventListener(\"submit\",handleSubmit);setTimeout(checkFormValidity,200);return()=>{emailInput?.removeEventListener(\"input\",handleEmailInput);emailInput?.removeEventListener(\"blur\",handleEmailInput);nameInput?.removeEventListener(\"input\",handleFieldChange);nameInput?.removeEventListener(\"blur\",handleFieldChange);lastNameInput?.removeEventListener(\"input\",handleFieldChange);lastNameInput?.removeEventListener(\"blur\",handleFieldChange);channelInput?.removeEventListener(\"input\",handleFieldChange);channelInput?.removeEventListener(\"blur\",handleFieldChange);formElement.removeEventListener(\"submit\",handleSubmit);};},[props.className]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCompanyVariant\":{\"type\":\"reactHoc\",\"name\":\"withCompanyVariant\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFirstName\":{\"type\":\"reactHoc\",\"name\":\"withFirstName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFormValidation\":{\"type\":\"reactHoc\",\"name\":\"withFormValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCompanyInitial\":{\"type\":\"reactHoc\",\"name\":\"withCompanyInitial\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNextButton\":{\"type\":\"reactHoc\",\"name\":\"withNextButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCompanyName\":{\"type\":\"reactHoc\",\"name\":\"withCompanyName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCalendly\":{\"type\":\"reactHoc\",\"name\":\"withCalendly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}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