1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-esm-BqRNWjrv.js","assets/index-BRFkJXk9.js"])))=>i.map(i=>d[i]); 2import{y as z,z as H,r as n,j as e,c as R,L as oe,Z as M,f as le,_ as re,e as ie,$ as ce}from"./index-BRFkJXk9.js";import{B as j}from"./button-BGfOKQQJ.js";import{C as de}from"./check-D2xkP7vl.js";import{L as me}from"./logo-spinner-CXw8z2-W.js";import{c as W}from"./createLucideIcon-BzFlwUvL.js";import{I as x}from"./input-YDAWwrPF.js";import{T as xe}from"./textarea-CUGp6qdy.js";import{A as ue}from"./arrow-right-DFe6_tMM.js";import"./index-jbG8BFt3.js";import"./index-CkifLC64.js";const he=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],pe=W("chevron-left",he);const be=[["path",{d:"M12 11.22C11 9.997 10 9 10 8a2 2 0 0 1 4 0c0 1-.998 2.002-2.01 3.22",key:"1rnhq3"}],["path",{d:"m12 18 2.57-3.5",key:"116vt7"}],["path",{d:"M6.243 9.016a7 7 0 0 1 11.507-.009",key:"10dq0b"}],["path",{d:"M9.35 14.53 12 11.22",key:"tdsyp2"}],["path",{d:"M9.35 14.53C7.728 12.246 6 10.221 6 7a6 5 0 0 1 12 0c-.005 3.22-1.778 5.235-3.43 7.5l3.557 4.527a1 1 0 0 1-.203 1.43l-1.894 1.36a1 1 0 0 1-1.384-.215L12 18l-2.679 3.593a1 1 0 0 1-1.39.213l-1.865-1.353a1 1 0 0 1-.203-1.422z",key:"nmifey"}]],fe=W("ribbon",be),ge=z({method:"POST"}).handler(H("2080189ecfe59bf69dcc4424e33aed95e13b7982d2d4518248f50157f3e00465")),je=z({method:"POST"}).handler(H("fb8e75948967699d71077df550c4a0b4e51ea7425d44addfe8276ba41b43d994"));var B=(t=>(t.GOOGLE="google",t.REDDIT="reddit",t.SOCIAL_MEDIA="social_media",t.REFERRAL="referral",t.ENERGY_SAGE="energy_sage",t.OTHER="other",t))(B||{});const Ne={google:{label:"Google",color:"bg-green-300"},reddit:{label:"Reddit",color:"bg-red-300"},social_media:{label:"Social Media",color:"bg-blue-300"},referral:{label:"Referral",color:"bg-purple-300"},energy_sage:{label:"EnergySage",color:"bg-orange-300"},other:{label:"Other",color:"bg-gray-300"}};function ye({quoteRequestId:t,companyName:o,companyLongSlug:i}){const[l,p]=n.useState(null),[d,w]=n.useState(!1),c=async a=>{p(a),(await je({data:{quoteRequestId:t,findUsSource:a}})).success&&w(!0)};return e.jsxs("div",{className:"flex flex-col items-center text-center",children:[e.jsx("div",{className:"bg-brand mb-6 flex h-20 w-20 items-center justify-center border-2 shadow-xl sm:mb-8 sm:h-24 sm:w-24",children:e.jsx(de,{className:"h-10 w-10 text-black sm:h-12 sm:w-12",strokeWidth:3})}),e.jsxs("h1",{className:"mb-4 text-3xl leading-none font-black tracking-tighter uppercase sm:text-4xl",children:["Request",e.jsx("br",{}),"Submitted!"]}),e.jsxs("p",{className:"mb-10 max-w-xs font-mono text-sm text-gray-600",children:["Your info will be shared with ",o,". Installers typically respond within a day or two."]}),e.jsx("div",{className:"my-2 w-full border-t-2 border-dashed"}),e.jsx("div",{className:"w-full py-8 text-left",children:d?e.jsx("p",{className:"text-muted-foreground text-center text-sm",children:"Thanks for letting us know!"}):e.jsxs(e.Fragment,{children:[e.jsx("label",{className:"mb-4 block text-center text-sm font-bold uppercase",children:"How did you find our page?"}),e.jsx("div",{className:"flex flex-wrap justify-center gap-2",children:Object.values(B).map(a=>e.jsx("button",{type:"button",onClick:()=>c(a),className:R("rounded-full border-2 px-4 py-1.5 font-mono text-xs transition-all",l===a?"bg-brand shadow-sm":"hover:bg-brand hover:shadow-sm"),children:Ne[a].label},a))})]})}),e.jsxs("div",{className:"brand-dark group relative w-full overflow-hidden border-2 p-6",children:[e.jsx("div",{className:"bg-brand absolute -top-4 -right-4 h-16 w-16 rounded-full opacity-20 transition-transform duration-500 group-hover:scale-150"}),e.jsx("h3",{className:"relative z-10 mb-2 text-lg font-bold uppercase",children:"Want more quotes?"}),e.jsx("p",{className:"relative z-10 mb-6 font-mono text-xs text-gray-400",children:"Get matched with 2 other WattBot Certified installer
2s in your area."}),e.jsxs("div",{className:"relative z-10 flex gap-4",children:[e.jsx(j,{variant:"outline",className:"flex-1",children:"Yes, Match Me"}),e.jsx(j,{variant:"secondary",className:"flex-1",children:"No Thanks"})]})]}),e.jsx(oe,{to:"/company/$longSlug",params:{longSlug:i},className:"mt-8 font-mono text-xs text-gray-500 underline hover:text-black",children:"Return to Company Page"})]})}function ve({companyName:t,isCompanyCertified:o,trustScore:i,progressPercent:l}){return e.jsxs("header",{className:"brand-dark sticky top-0 z-50 border-b-2",children:[e.jsxs("div",{className:"flex items-center gap-3 p-4",children:[e.jsx(me,{size:"MD"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-lg leading-none font-black tracking-tighter uppercase",children:t}),o&&e.jsxs("div",{className:"mt-1 flex items-center gap-1",children:[e.jsx(fe,{className:"text-brand size-4"}),e.jsx("span",{className:"text-brand wb-data",children:"WattBot Certified"})]})]}),e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("span",{className:"text-[10px] leading-none font-bold tracking-wider uppercase opacity-70",children:"Trust"}),e.jsx("span",{className:"text-brand text-2xl leading-none font-black",children:Math.round(i)})]})]}),e.jsx("div",{className:"relative h-2 border-t-2 bg-gray-800",children:e.jsx("div",{className:"bg-brand absolute top-0 left-0 h-full transition-all duration-300 ease-out",style:{width:`${l}%`}})})]})}var h=(t=>(t.NEW_SOLAR="new_solar",t.SERVICE_EXISTING="service_existing",t))(h||{});const Se={new_solar:{label:"I want to go solar",title:"New System",description:"I want to install solar panels or battery"},service_existing:{label:"I need service on my existing system",title:"Service Existing",description:"I have a system that needs maintenance"}};var g=(t=>(t.READY_NOW="ready_now",t.ONE_TO_THREE_MONTHS="1_3_months",t.THREE_TO_SIX_MONTHS="3_6_months",t.SIX_PLUS_MONTHS="6_plus_months",t.JUST_RESEARCHING="just_researching",t))(g||{}),y=(t=>(t.SOLAR="solar",t.BATTERY="battery",t.SOLAR_AND_BATTERY="solar_and_battery",t.OTHER="other",t))(y||{});const _e={solar:{label:"Solar panels"},battery:{label:"Battery storage"},solar_and_battery:{label:"Solar + battery"},other:{label:"Other"}};var P=(t=>(t.GOOD="good",t.NEEDS_WORK="needs_work",t.NOT_SURE="not_sure",t))(P||{});const ke={good:{label:"Good condition",title:"Good Shape",description:"No known issues or leaks",hoverColor:"hover:bg-green-100"},needs_work:{label:"Needs work",title:"Needs Work",description:"Old, damaged, or leaking",hoverColor:"hover:bg-orange-100"},not_sure:{label:"Not sure",title:"Not Sure",description:"I'd like an assessment",hoverColor:"hover:bg-brand/20"}},we=n.lazy(()=>re(()=>import("./index-esm-BqRNWjrv.js"),__vite__mapDeps([0,1])).then(t=>({default:t.AddressAutofill}))),Ee=["situation","scope","roof_condition","timeline","contact"],Re=["situation","original_installer","timeline","contact"];function D(t){return t===h.NEW_SOLAR?Ee:t===h.SERVICE_EXISTING?Re:["situation"]}function Ce(t,o){if(t==="confirmation")return 100;const i=D(o),l=i.indexOf(t);return l===-1?0:Math.round(l/i.length*100)}function Oe({isDisabled:t}){const{pending:o}=ie.useFormStatus();return e.jsx(j,{type:"submit",className:"mt-4 w-full",size:"lg",shadow:!0,disabled:o||t,children:o?"Submitting...":"Submit Request"})}function u({onClick:t,children:o,className:i,shadowSize:l="shadow-md"}){const p=l==="shadow-xl"?"active:translate-x-[6px] active:translate-y-[6px]":"active:translate-x-[4px] active:translate-y-[4px]";return e.jsx("button",{type:"button",onClick:t,className:R("group w-full cursor-pointer border-2 text-left transition-all",l,p,"active:shadow-none",i),children:o})}function Te({companyId:t,companyName:o,companyLongSlug:i,isCompanyCertified:l,trustScore:p}){const[d,w]=n.useActionState((s,r)=>ge({data:{_prevState:s,formData:r}}),null),[c,a]=n.useState("situation"),[m,G]=n.useState(null),[v,F]=n.useState(null),[S,C]=n.useState(""),[O,q]=n.useState(null),[_,Y]=n.useState(""),[T,N]=n.useState(null),[I,J]=n.useState(""),[V,X]=n.useState(""),[A,U]=n.useState(""),[b,$]=n.useState(null),[L,Z]=n.useState(""),[K,Q]=n.useState(""),ee=n.useRef(null);n.useEffect(()=>{d?.success&&a("confirmation")},[d]);const E=D(m),k=E.indexOf(c),te=c==="confirmation"&&d?.success,se=()=>{k>0&&a(E[k-1])},ae=s=>
2{s?.features?.[0]&&$(s.features[0])},ne=I.trim().length>0&&M(A).length>=10&&b!==null&&Number(L)>0;return e.jsxs(e.Fragment,{children:[e.jsx(ve,{companyName:o,isCompanyCertified:l,trustScore:p,progressPercent:Ce(c,m)}),e.jsx("main",{className:"flex grow flex-col overflow-y-auto px-4 py-6 sm:px-6 sm:py-8",children:te?e.jsx(ye,{quoteRequestId:d.quoteRequestId,companyName:o,companyLongSlug:i}):e.jsxs("form",{action:w,onSubmit:s=>{c!=="contact"&&s.preventDefault()},className:"flex grow flex-col",children:[e.jsx("input",{type:"hidden",name:"company_id",value:t}),m&&e.jsx("input",{type:"hidden",name:"situation",value:m}),v&&m===h.NEW_SOLAR&&e.jsx("input",{type:"hidden",name:"scope",value:v}),S&&v===y.OTHER&&e.jsx("input",{type:"hidden",name:"scope_other",value:S}),O&&m===h.NEW_SOLAR&&e.jsx("input",{type:"hidden",name:"roof_condition",value:O}),_&&m===h.SERVICE_EXISTING&&e.jsx("input",{type:"hidden",name:"original_installer",value:_}),T&&e.jsx("input",{type:"hidden",name:"timeline",value:T}),b&&e.jsx("input",{type:"hidden",name:"mbx_geojson",value:JSON.stringify(b)}),e.jsxs("div",{className:"mb-6 flex h-8 items-center justify-between sm:mb-8",children:[k>0?e.jsxs(j,{type:"button",variant:"link",size:"sm",className:"-ml-4",onClick:se,children:[e.jsx(pe,{className:"h-4 w-4"}),"Back"]}):e.jsx("div",{}),e.jsxs("div",{className:"text-muted-foreground ml-auto font-mono text-xs font-bold tracking-widest uppercase",children:["Step ",k+1,m&&` of ${E.length}`]})]}),c==="situation"&&e.jsx(f,{title:"Are you looking for new solar or service?",children:e.jsx("div",{className:"space-y-4",children:Object.values(h).map(s=>{const r=Se[s];return e.jsx(u,{shadowSize:"shadow-xl",className:"bg-background hover:bg-brand/10 p-6",onClick:()=>{G(s),s===h.NEW_SOLAR?a("scope"):a("original_installer")},children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"mb-1 block text-xl font-black uppercase",children:r.title}),e.jsx("span",{className:"block font-mono text-xs text-gray-600",children:r.description})]}),e.jsx(ue,{className:"h-6 w-6 opacity-0 transition-opacity group-hover:opacity-100"})]})},s)})})}),c==="scope"&&e.jsxs(f,{title:"What are you interested in?",children:[e.jsx("div",{className:"grid grid-cols-1 gap-4",children:Object.values(y).map(s=>{const r=_e[s];return e.jsx(u,{shadowSize:"shadow-md",className:"bg-background hover:bg-brand p-5",onClick:()=>{F(s),s!==y.OTHER&&(C(""),a("roof_condition"))},children:e.jsx("span",{className:"font-bold tracking-wide uppercase",children:r.label})},s)})}),v===y.OTHER&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsx(x,{placeholder:"Please describe what you're looking for",value:S,onChange:s=>C(s.target.value)}),e.jsx(j,{type:"button",className:"w-full",disabled:!S.trim(),onClick:()=>a("roof_condition"),children:"Next Step"})]})]}),c==="roof_condition"&&e.jsx(f,{title:"What is the condition of your roof?",children:e.jsx("div",{className:"space-y-4",children:Object.values(P).map(s=>{const r=ke[s];return e.jsx(u,{shadowSize:"shadow-md",className:R("bg-background p-6",r.hoverColor),onClick:()=>{q(s),a("timeline")},children:e.jsxs("div",{children:[e.jsx("span",{className:"mb-1 block text-base font-black uppercase sm:text-lg",children:r.title}),e.jsx("span",{className:"block font-mono text-xs text-gray-600",children:r.description})]})},s)})})}),c==="original_installer"&&e.jsxs(f,{title:"Who installed your system?",children:[e.jsx("p",{className:"mb-8 font-mono text-sm text-gray-600",children:"This helps us understand if we can service your equipment warranties."}),e.jsxs("div",{className:"mb-8",children:[e.jsx("label",{className:"mb-2 block font-mono text-xs font-bold uppercase",children:"Original Installer Name"}),e.jsx(x,{placeholder:"e.g. Tesla, SunPower, Local Co...",className:"font-mono text-lg shadow-md",value:_,onChange:s=>Y(s.target.value)})]}),e.jsx(j,{type:"button",variant:"outline",size:"lg",className:"w-full",disabled:!_.trim(),onClick:()=>a("timeline"),children:"Next Step"})]}),c==="timeline"&&e.jsx(f,{title:"How soon do you want to start?",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(u,{shadowSize:"shadow-md",className:"bg-brand hover:bg-foreground hover:text-background col-span-2 p-6",onClick:()=>{N(g.READY_NOW),a("contact")},children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xl font-black uppercase",children:"Ready Now"}),e.jsx("span",{className:"bg-background text-foreground border-2 px-2 py-0.5 font-mono text-xs font-bold uppercase",children:"Priority"})]})}),e.jsx(u,{shadowSize:"shadow-md",className:"bg-background h-28 hover:bg-gray-100 sm:h-32",onClick:()=>{N(g.ONE_TO_THREE_MONTHS),a("contact")},children:e.jsx("div",{className:"flex h-full flex-col items-center justify-center text-center",children:e.jsxs("span",{className:"text-base leading-tight font-bold uppercase sm:text-lg",children:["1 - 3",e.jsx("br",{}),"Months"]})})}),e.jsx(u,{shadowSize:"shadow-md",className:"bg-background h-28 hover:bg-gray-100 sm:h-32",onClick:()=>{N(g.THREE_TO_SIX_MONTHS),a("contact")},children:e.jsx("div",{className:"flex h-full flex-col items-center justify-center text-center",children:e.jsxs("span",{className:"text-base leading-tight font-bold uppercase sm:text-lg",children:["3 - 6",e.jsx("br",{}),"Months"]})})}),e.jsx(u,{shadowSize:"shadow-md",className:"bg-background h-28 hover:bg-gray-100 sm:h-32",onClick:()=>{N(g.SIX_PLUS_MONTHS),a("contact")},children:e.jsx("div",{className:"flex h-full flex-col items-center justify-center text-center",children:e.jsxs("span",{className:"text-base leading-tight font-bold uppercase sm:text-lg",children:["6+",e.jsx("br",{}),"Months"]})})}),e.jsx(u,{shadowSize:"shadow-md",className:"bg-background h-28 hover:bg-gray-100 sm:h-32",onClick:()=>{N(g.JUST_RESEARCHING),a("contact")},children:e.jsx("div",{className:"flex h-full flex-col items-center justify-center text-center",children:e.jsxs("span",{className:"text-base leading-tight font-bold uppercase sm:text-lg",children:["Just",e.jsx("br",{}),"Looking"]})})})]})}),c==="contact"&&e.jsx(f,{title:"Where should we send the quote?",children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block font-mono text-xs font-bold uppercase",children:["Full Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx(x,{id:"full_name",name:"full_name",placeholder:"Jane Doe",className:"bg-muted/30 focus:bg-background font-mono",value:I,onChange:s=>J(s.target.value)})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block font-mono text-xs font-bold uppercase",children:["Phone Number ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx(x,{id:"phone",name:"phone",type:"tel",placeholder:"(555) 123-4567",className:"bg-muted/30 focus:bg-background font-mono",value:le(A),onChange:s=>{const r=M(s.target.value);r.length<=10&&U(r)}})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block font-mono text-xs font-bold uppercase",children:["Email ",e.jsx("span",{className:"text-gray-400",children:"(Optional)"})]}),e.jsx(x,{id:"email",name:"email",type:"email",placeholder:"[email protected]",className:"bg-muted/30 focus:bg-background font-mono",value:V,onChange:s=>X(s.target.value)})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block font-mono text-xs font-bold uppercase",children:["Home Address ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx(n.Suspense,{fallback:e.jsx(x,{type:"text",placeholder:"Start typing your address...",className:"bg-muted/30 font-mono",disabled:!0}),children:e.jsx(we,{accessToken:"pk.eyJ1IjoibmF0aGFuZWlkZWxzb24iLCJhIjoiY2wyaml1bjFqMDBwcjNrbmRzNjdieWVydSJ9.FTR0RU81Ya3gtsIyMEkLeg",options:{country:"US"},onRetrieve:ae,children:e.jsx(x,{ref:ee,type:"text",placeholder:"Start typing your address...",autoComplete:"address-line1",className:"bg-muted/30 focus:bg-background font-mono"})})}),b&&e.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:b.properties?.full_address||b.properties?.feature_name})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block font-mono text-xs font-bold uppercase",children:["Average Monthly Electric Bill"," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute top-3 left-3 font-mono font-bold",children:"$"}),e.jsx(x,{id:"monthly_bill",name:"monthly_bill",type:"number",min:"1",placeholder:"",className:"bg-muted/30 focus:bg-background pl-8 font-mono",value:L,onChange:s=>Z(s.target.value)})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block font-mono text-xs font-bold uppercase",children:["Anything else?"," ",e.jsx("span",{className:"text-gray-400",children:"(Optional)"})]}),e.jsx(xe,{id:"additional_details",name:"additional_details",rows:2,placeholder:"e.g. My roof faces north, I may want to get trees removed, etc...",className:"bg-muted/30 focus:bg-background font-mono text-sm",value:K,onChange:s=>Q(s.target.value)})]}),d&&!d.success&&e.jsx("div",{className:"text-sm font-bold text-red-700",children:d.errors.map(s=>e.jsx("div",{children:s},s))}),e.jsx(Oe,{isDisabled:!ne}),e.jsxs("p",{className:"text-center font-mono text-[10px] leading-tight text-gray-500",children:["By clicking submit, you authorize ",o," to contact you about your project."]})]})})]})})]})}function f({title:t,children:o}){return e.jsxs("div",{className:"flex grow flex-col",children:[e.jsx("h1",{className:"mb-6 text-2xl leading-none font-black tracking-tight uppercase sm:mb-8 sm:text-3xl",children:t}),o]})}function Ge(){const{companyId:t,companyName:o,companyLongSlug:i,isCompanyCertified:l,trustScore:p}=ce.useLoaderData();return e.jsx("div",{className:"bg-muted flex min-h-screen flex-col items-center justify-center p-4 sm:p-6 lg:p-8",children:e.jsx("div",{className:"bg-background flex max-h-[900px] min-h-[700px] w-full max-w-[480px] flex-col overflow-hidden border-2 shadow-2xl",children:e.jsx(Te,{companyId:t,companyName:o,companyLongSlug:i,isCompanyCertified:l,trustScore:p})})})}export{Ge as component}; 3//# sourceMappingURL=contact-DJyJ76Pp.js.map
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.