1import{aA as c,b as l,c as d,r as m,j as e,E as x,F as u,k as h,a2 as f,aB as g,B as i,aq as b}from"./index-BBYsJQph.js";function p(){const a=(c().code||"").trim(),[,n]=l(),{data:t,isLoading:o}=d({queryKey:["/api/referrals/validate",a],queryFn:async()=>{const r=await fetch(`/api/referrals/validate/${encodeURIComponent(a)}`,{credentials:"include"});return r.ok?r.json():{valid:!1}},enabled:!!a});m.useEffect(()=>{t!=null&&t.valid&&a&&localStorage.setItem("referredByCode",a)},[t==null?void 0:t.valid,a]);const s=()=>n("/daycare/auth");return e.jsx("div",{className:"min-h-[100svh] flex items-center justify-center p-4",style:{background:"#faf7f2"},children:e.jsx(x,{className:"w-full max-w-md bg-white border border-[#ece2d2] rounded-2xl shadow-[0_2px_16px_rgba(74,60,58,0.06)]",children:e.jsxs(u,{className:"p-6 sm:p-8 text-center",children:[e.jsx("div",{className:"w-20 h-20 rounded-full mx-auto mb-5 overflow-hidden bg-white border-2 border-[#cd8161]/20",children:e.jsx("img",{src:h,alt:"King's Dog Daycare",className:"w-full h-full object-contain"})}),o?e.jsxs("div",{className:"py-8 flex flex-col items-center gap-3 text-[#756661]",children:[e.jsx(f,{className:"w-6 h-6 animate-spin text-[#cd8161]"}),e.jsx("p",{className:"text-sm",children:"Checking your invitation..."})]}):t!=null&&t.valid?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bg-[#cd8161]/10 rounded-xl w-12 h-12 flex items-center justify-center mx-auto mb-4",children:e.jsx(g,{className:"w-6 h-6 text-[#cd8161]"})}),e.jsx("h1",{className:"text-2xl font-black uppercase tracking-tight text-[#4A3C3A]",children:"You're invited"}),e.jsx("p",{className:"text-[#756661] mt-2",children:t.referrerFirstName?`${t.referrerFirstName} thinks your dog will love King's Dog Daycare.`:"A friend thinks your dog will love King's Dog Daycare."}),e.jsx("div",{className:"mt-4 rounded-xl bg-[#8BB381]/10 border border-[#8BB381]/20 p-4 text-sm text-[#5d8654]",children:"Join, book a daycare trial and once your pup passes, you and your friend each receive free daycare credit."}),e.jsx(i,{onClick:s,className:"w-full h-12 mt-6 text-white font-semibold uppercase tracking-wide hover:bg-[#b5694d]",style:{backgroundColor:"#cd8161"},"data-testid":"button-join-start",children:"Create your account"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bg-[#f6f1e7] rounded-xl w-12 h-12 flex items-center justify-center mx-auto mb-4",children:e.jsx(b,{className:"w-6 h-6 text-[#e1a95f]"})}),e.jsx("h1",{className:"text-xl font-bold text-[#4A3C3A]",children:"Invitation not found"}),e.jsx("p",{className:"text-[#756661] mt-2 text-sm",children:"This referral link isn't valid, but you're very welcome to join us anyway."}),e.jsx(i,{onClick:s,className:"w-full h-12 mt-6 text-white font-semibold uppercase tracking-wide hover:bg-[#b5694d]",style:{backgroundColor:"#cd8161"},"data-testid":"button-join-start",children:"Create your account"})]})]})})})}export{p as default};
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.