PageSourceSearch

https://flex-lovable-landing-pages.lovable.app/lp/assets/LeadCaptureForm-MBeifXdx.js

js flex-lovable-landing-pages.lovable.app collected 2026-10-03 03:31:45 UTC 8,467 bytes, 1 lines download raw bytes

1import{aa as S,r as d,j as e,u as F,w as P}from"./index-BuZskSCt.js";import{C as y,l as _,s as I}from"./leads-vgMB-mKU.js";const L=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],$=S("bell",L),A="https://privacy.flexcar.com/policies?name=flexcar-privacy-policy";function w({className:i}){const c=F();return e.jsxs("p",{className:i,children:["By submitting, you agree to receive launch updates from Flexcar. Unsubscribe anytime. See our"," ",e.jsx("a",{href:c(P(A)),className:"underline underline-offset-2 hover:text-neutral-900",children:"Privacy Policy"}),"."]})}function W({source:i="locations_page",successMessage:c,variant:o="default",title:b,body:N,buttonLabel:C,initialLocation:m}){const[n,g]=d.useState({email:"",location:m??""}),[x,v]=d.useState({}),[r,u]=d.useState("idle"),[p,k]=d.useState(null);d.useEffect(()=>{m&&g(t=>({...t,location:m}))},[m]),d.useEffect(()=>{function t(l){const a=l.detail;typeof a=="string"&&a.length>0&&g(E=>({...E,location:a}))}function s(l){const a=l.detail;typeof a=="string"&&a.length>0&&k(a)}return window.addEventListener("flx:prefill-location",t),window.addEventListener("flx:notify-city",s),()=>{window.removeEventListener("flx:prefill-location",t),window.removeEventListener("flx:notify-city",s)}},[]);const f=t=>s=>g(l=>({...l,[t]:s.target.value}));async function j(t){t.preventDefault();const s=_.safeParse(n);if(!s.success){const l={};for(const a of s.error.issues)l[a.path[0]]=a.message;v(l);return}v({}),u("submitting");try{await I({email:s.data.email,zip:s.data.location,source:i}),u("success");try{localStorage.setItem("flx_loc_notified",n.location),window.dispatchEvent(new CustomEvent("flx:lead-submitted"))}catch{}}catch(l){console.error(l),u("error")}}return o==="compact"?e.jsx("section",{id:"notify-me","aria-labelledby":"notify-title",className:"mx-auto mt-14 max-w-3xl px-4 sm:px-6",children:e.jsx("div",{className:"rounded-3xl border border-neutral-200 bg-white p-6 sm:p-8",children:r==="success"?e.jsxs("div",{role:"status","aria-live":"polite",className:"flex items-start gap-3",children:[e.jsx(y,{className:"mt-0.5 h-6 w-6 flex-shrink-0 text-emerald-500","aria-hidden":!0}),e.jsxs("div",{children:[e.jsx("h2",{id:"notify-title",className:"font-display text-[20px] font-semibold tracking-[-0.5px] text-neutral-900",children:"You’re on the list."}),e.jsx("p",{className:"mt-1 text-[14px] text-neutral-600",children:c??`We’ll email you about launches near ${n.location}.`})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("h2",{id:"notify-title",className:"font-display text-[22px] font-semibold tracking-[-0.6px] text-neutral-900 sm:text-[26px]",children:b??"Hear when Flexcar opens near you."}),e.jsx("p",{className:"mt-2 text-[14px] leading-[1.55] text-neutral-600",children:N??"Enter your email and ZIP for launch updates."}),e.jsxs("form",{onSubmit:j,noValidate:!0,className:"mt-5 grid gap-3 sm:grid-cols-[1fr_140px_auto] sm:items-end",children:[e.jsx(h,{id:"lead-email",label:"Email",type:"email",required:!0,value:n.email,onChange:f("email"),error:x.email,autoComplete:"email",placeholder:"[email protected]"}),e.jsx(h,{id:"lead-location",label:"ZIP code",required:!0,value:n.location,onChange:f("location"),error:x.location,autoComplete:"postal-code",inputMode:"numeric",placeholder:"10001"}),e.jsx("button",{type:"submit",disabled:r==="submitting",className:"inline-flex h-11 items-center justify-center whitespace-nowrap rounded-full bg-neutral-900 px-6 text-[14px] font-semibold text-white transition hover:bg-neutral-800 disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#3A00E5] focus-visible:ring-offset-2",children:r==="submitting"?"Submitting…":C??"Email me launch updates"}),e.jsx(w,{className:"text-[11px] leading-[1.4] text-neutral-500 sm:col-span-3"}),r==="error"&&e.jsxs("div",{role:"alert",className:"flex flex-wrap items-center gap-3 rounded-lg bg-rose-50 px-3 py-2 text-[13px] text-rose-700 sm:col-span-3",children:[e.jsx("span",{children:"Something went wrong submitting your details."}),e.jsx("button",{type:"button",onClick:()=>u("idle"),className:"font-semibold text-rose-700 underline underline-offset-2 hover:text-rose-900",children:"Try again"})]})]})]})})}):e.jsx("section",{id:"notify-me","aria-labelledby":"notify-title",className:"mx-auto mt-20 max-w-7xl px-4 sm:mt-24 sm:px-6",children:e.jsxs("div",{className:"grid overflow-hidden rounded-3xl border border-neutral-200 bg-white lg:grid-cols-[1.1fr_1fr]",children:[e.jsxs("div",{className:"bg-neutral-50 p-8 sm:p-12 lg:p-14",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full border border-neutral-200 bg-white px-3 py-1.5 text-[11px] font-bold uppercase tracking-[0.5px] text-neutral-700",children:[e.jsx($,{className:"h-3 w-3"})," Get notified"]}),e.jsx("h2",{id:"notify-title",className:"font-display mt-5 text-[28px] font-semibold leading-tight tracking-[-0.8px] text-neutral-900 sm:text-[34px] sm:tracking-[-1px]",children:p?`We're not in ${p} yet — but you'll be the first to know.`:"Not near a Flexcar hub yet? We'll tell you the moment we are."}),e.jsx("p",{className:"mt-4 max-w-md text-[15px] leading-[1.55] text-neutral-600",children:p?`Drop your ZIP and we'll email you the day Flexcar opens near ${p}.`:"Drop your details and we'll keep you posted as Flexcar launches near you."}),e.jsx("ul",{className:"mt-6 space-y-3 text-[14px] text-neutral-700",children:["Launch updates for your market","Early access to inventory before public open","Founding-member offers where available"].map(t=>e.jsxs("li",{className:"flex items-start gap-2.5",children:[e.jsx(y,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-emerald-600"}),t]},t))})]}),e.jsx("div",{className:"p-8 sm:p-12 lg:p-14",children:r==="success"?e.jsxs("div",{role:"status","aria-live":"polite",className:"flex h-full flex-col items-start justify-center",children:[e.jsx(y,{className:"h-10 w-10 text-emerald-500","aria-hidden":!0}),e.jsx("h3",{className:"font-display mt-4 text-[24px] font-semibold tracking-[-0.6px] text-neutral-900",children:"You're on the list."}),e.jsx("p",{className:"mt-2 text-[15px] text-neutral-600",children:c??`We'll reach out the moment Flexcar lands near ${n.location}. In the meantime, browse our active markets above.`})]}):e.jsxs("form",{onSubmit:j,noValidate:!0,className:"flex flex-col gap-4",children:[e.jsx(h,{id:"lead-email",label:"Email",type:"email",required:!0,value:n.email,onChange:f("email"),error:x.email,autoComplete:"email",placeholder:"[email protected]"}),e.jsx(h,{id:"lead-location",label:"ZIP code",required:!0,value:n.location,onChange:f("location"),error:x.location,autoComplete:"postal-code",inputMode:"numeric",placeholder:"10001"}),e.jsxs("div",{className:"mt-2 flex flex-col items-start gap-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4",children:[e.jsx("button",{type:"submit",disabled:r==="submitting",className:"inline-flex h-12 w-full items-center justify-center whitespace-nowrap rounded-full bg-neutral-900 px-7 text-[14px] font-semibold text-white transition hover:bg-neutral-800 disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#3A00E5] focus-visible:ring-offset-2 sm:w-auto",children:r==="submitting"?"Submitting…":"Get notified"}),e.jsx(w,{className:"text-[11px] leading-[1.4] text-neutral-500"})]}
1),r==="error"&&e.jsxs("div",{role:"alert",className:"flex flex-wrap items-center gap-3 rounded-lg bg-rose-50 px-3 py-2 text-[13px] text-rose-700",children:[e.jsx("span",{children:"Something went wrong submitting your details."}),e.jsx("button",{type:"button",onClick:()=>u("idle"),className:"font-semibold text-rose-700 underline underline-offset-2 hover:text-rose-900",children:"Try again"})]})]})})]})})}function h({id:i,label:c,error:o,...b}){return e.jsxs("div",{children:[e.jsx("label",{htmlFor:i,className:"block text-[13px] font-semibold text-neutral-800",children:c}),e.jsx("input",{id:i,...b,"aria-invalid":!!o,"aria-describedby":o?`${i}-error`:void 0,className:`mt-1.5 block h-11 w-full rounded-xl border bg-white px-3.5 text-[14px] outline-none transition focus:ring-2 ${o?"border-rose-400 ring-rose-200":"border-neutral-200 focus:border-neutral-900 focus:ring-neutral-900/10"}`}),o&&e.jsx("p",{id:`${i}-error`,role:"alert",className:"mt-1.5 text-[12px] text-rose-600",children:o})]})}export{W as L};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.