1import{r as d,v as E,j as e,P,C as _}from"./index-BGw9JD6r.js";import{C as F}from"./circle-check-C-qJcmjz.js";const b=["Wood Flooring","Sanding & Refinishing","Floor Leveling","Floor Repairs","Hardwood Installation","Cork Flooring","Vinyl Flooring","Laminate Flooring","Hand Railing","Not sure yet"],q="https://hooks.zapier.com/hooks/catch/19007017/uaqt5j2/",p="puulse_ai_site",R={address:"Address",service:"Service Needed",rooms:"Number of Rooms",date:"Preferred Date"};function L(){const[x,c]=d.useState(!1),[f,m]=d.useState(!1),[g,v]=d.useState(null),i=E({strict:!1}),w=i.service&&b.includes(i.service)?i.service:"",[s,y]=d.useState({full_name:"",phone:"",email:"",address:"",service:w,rooms:"",date:"",secondaryPhoneNumber:""});d.useEffect(()=>{const r=i.service;if(r&&b.includes(r)){y(u=>u.service===r?u:{...u,service:r});const l=document.getElementById("lead-form");l&&l.scrollIntoView({behavior:"smooth",block:"start"})}},[i.service]);const a=r=>l=>y({...s,[r]:l.target.value}),C=async r=>{if(r.preventDefault(),v(null),s.secondaryPhoneNumber.trim()!==""){c(!0);return}if(!s.full_name.trim()||!s.phone.trim()||!s.email.trim()){v("Please fill in your name, phone, and email.");return}m(!0);const l=new Set(["full_name","phone","email","secondaryPhoneNumber"]),j=Object.entries(s).filter(([t,h])=>!l.has(t)&&h&&h.toString().trim()!=="").map(([t,h])=>`${R[t]??t}: ${h}`).join(` 2`),N=`Your Puulse ai website just generated a new lead, please reach out to them as soon as possible: 3 4Name: ${s.full_name} 5Phone: ${s.phone} 6Email: ${s.email}`,S={source:p,notification_phone:"13109081766",notification_email:"[email protected]",message_sms:`${N} 7 8For more information please go to your email`,message_email:`${N}${j?` 9 10${j}`:""}`,country:"US",form_content:{...s,source:p}};try{if(p.trim()!==""){const t=window;typeof t.gtag=="function"&&t.gtag("event","lead_form",{source:p})}await fetch(q,{method:"POST",headers:{"Content-Type":"application/json"},mode:"no-cors",body:JSON.stringify(S)}),c(!0)}catch(t){console.error("Webhook submit failed",t),v("Something went wrong. Please call us directly at 1-310-908-1766.")}finally{m(!1)}};return e.jsxs("div",{id:"lead-form",className:"rounded-2xl bg-[var(--card)] border border-[var(--border)] p-6 md:p-10 scroll-mt-28 shadow-sm",children:[e.jsx("h2",{className:"text-3xl md:text-4xl mb-2 text-[var(--espresso)]",children:"Claim Your FREE In-Home Estimate"}),e.jsx("p",{className:"text-[var(--muted-foreground)] mb-6",children:"Fast, no-obligation quote. We typically respond within 1 business day."}),x?e.jsxs("div",{className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-[var(--secondary)] to-[var(--cream)] border border-[var(--honey)]/30 p-8 text-center",children:[e.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-[var(--espresso)] text-[var(--gold)] flex items-center justify-center mb-4 shadow-lg",children:e.jsx(F,{size:36})}),e.jsxs("h3",{className:"text-2xl md:text-3xl text-[var(--espresso)] mb-2",children:["Thank you, ",s.full_name.split(" ")[0]||"friend","!"]}),e.jsxs("p",{className:"text-[var(--muted-foreground)] max-w-md mx-auto mb-6",children:["Your free estimate request has been received. Paul will personally reach out within"," ",e.jsx("strong",{className:"text-[var(--espresso)]",children:"1 business day"})," to schedule your in-home visit."]}),e.jsxs("div",{className:"inline-flex items-center gap-2 px-5 py-3 rounded-full bg-[var(--espresso)] text-[var(--cream)] font-semibold",children:[e.jsx(P,{size:16})," Need it sooner? Call 1-310-908-1766"]})]}):e.jsxs("form",{onSubmit:C,className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(n,{label:"Full Name",required:!0,children:e.jsx("input",{required:!0,value:s.full_name,onChange:a("full_name"),className:o,autoComplete:"name"})}),e.jsx(n,{label:"Phone",required:!0,children:e.jsx("input",{required:!0,type:"tel",value:s.phone,onChange:a("phone"),className:o,autoComplete:"tel"})}),e.jsx(n,{label:"Email",required:!0,children:e.jsx("input",{required:!0,type:"email",value:s.email,onChange:a("email"),className:o,autoComplete:"email"})}),e.jsx(n,{label:"Address",children:e.jsx("input",{value:s.address,onChange:a("address"),className:o,autoComplete:"street-address"})}),e.jsx("input",{type:"text",id:"secondaryPhoneNumber",name:"secondaryPhoneNumber",value:s.secondaryPhoneNumber,onChange:a("secondaryPhoneNumber"),autoComplete:"off",tabIndex:-1,"aria-hidden":"true",style:{display:"none"}}),e.jsx(n,{label:"Service Needed",required:!0,children:e.jsxs("select",{required:!0,value:s.service,onChange:a("service"),className:o,children:[e.jsx("option",{value:"",children:"Select a serviceâ¦"}),b.map(r=>e.jsx("option",{children:r},r))]})}),e.jsx(n,{label:"Number of Rooms",children:e.jsx("input",{type:"number",min:"1",value:s.rooms,onChange:a("rooms"),className:o})}),e.jsx(n,{label:"Preferred Date for Estimate",className:"md:col-span-2",children:e.jsx("input",{type:"date",value:s.date,onChange:a("date"),className:o})}),g&&e.jsx("div",{className:"md:col-span-2 px-4 py-3 rounded-md bg-[var(--destructive)]/10 border border-[var(--destructive)]/30 text-sm text-[var(--destructive)]",children:g}),e.jsx("div",{className:"md:col-span-2 flex flex-col sm:flex-row gap-3 mt-2",children:e.jsx(_,{type:"submit",variant:"primary",size:"lg",className:"flex-1",children:f?"
10Sendingâ¦":"Request My Free Estimate"})})]})]})}const o="w-full px-4 py-3 rounded-md border border-[var(--border)] bg-white text-[var(--foreground)] focus:outline-none focus:ring-2 focus:ring-[var(--accent)]";function n({label:x,required:c,children:f,className:m=""}){return e.jsxs("label",{className:`block ${m}`,children:[e.jsxs("span",{className:"block text-sm font-semibold mb-1.5 text-[var(--espresso)]",children:[x,c&&e.jsx("span",{className:"text-[var(--destructive)]",children:" *"})]}),f]})}export{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.