1import{a as l,j as e}from"./vendor-query-CRhh6spR.js";import{u as B,b as E,a as A,a3 as D}from"./index-BkVb42KZ.js";import{u as O,a as R}from"./use-completion-extras-Cyh42nbm.js";import{H as V}from"./Head-B4hXUiBE.js";import{u as $,d as q}from"./vendor-react-BAmwgVqg.js";import{A as H}from"./arrow-left-B9mh4lKG.js";import{P as K}from"./party-popper-DJbpcWRp.js";import{C as T}from"./circle-check-BibDl6sq.js";import{C as z}from"./circle-Sm8JI_tc.js";import"./vendor-charts-BVeOEGzI.js";import"./vendor-stripe-2y4Jo9_W.js";import"./vendor-supabase-Csx7YFID.js";import"./completeness-core--su989Pr.js";function te(){var g,j,y,N,v,w,k;const{user:o}=B(),x=$(),[m,p]=q(),{t:c}=E(),a=c.completion??{},{data:d,isLoading:C}=A(o==null?void 0:o.id),{data:f}=O(o==null?void 0:o.id),[h,P]=l.useState(!1),[L,u]=l.useState(!1);l.useEffect(()=>{if(m.get("verify")==="phone"){u(!0);const t=new URLSearchParams(m);t.delete("verify"),p(t,{replace:!0})}},[m,p]);const s=l.useMemo(()=>d?R(d,f??{}):null,[d,f]);if(l.useEffect(()=>{s&&s.percent===100&&!h&&P(!0)},[s,h]),!o)return e.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:((g=c.common)==null?void 0:g.signInRequired)??"Sign in required."});if(C||!d||!s)return e.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:((j=c.common)==null?void 0:j.loading)??"Loadingâ¦"});const S=t=>{var r,i,n;return((n=(i=(r=a.boost)==null?void 0:r.item)==null?void 0:i[t])==null?void 0:n.label)??t},b=t=>{var r,i,n;return((n=(i=(r=a.boost)==null?void 0:r.item)==null?void 0:i[t])==null?void 0:n.benefit)??null};return e.jsxs("div",{className:"mx-auto w-full max-w-2xl p-4 pb-24 space-y-4",children:[e.jsx(V,{title:"Boost your profile · Knuckl",description:"Complete your Knuckl profile to get better matches."}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>x(-1),className:"h-9 w-9 rounded-full flex items-center justify-center hover:bg-muted","aria-label":((y=c.aria)==null?void 0:y.back)??"Back",children:e.jsx(H,{className:"w-5 h-5"})}),e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:((N=a.boost)==null?void 0:N.title)??"Complete your profile"})]}),e.jsxs("div",{className:"rounded-card border border-border bg-card p-4",children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:((v=a.boost)==null?void 0:v.subtitle)??"The more contractors know, the better the match"}),e.jsxs("span",{className:"text-2xl font-bold text-primary tabular-nums",children:[s.percent,"%"]})]}),e.jsx("div",{className:"mt-3 h-2 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${s.percent}%`}})})]}),s.percent===100?e.jsxs("div",{className:"rounded-card border border-primary/30 bg-primary/5 p-6 text-center space-y-2 animate-in fade-in zoom-in duration-500",children:[e.jsx(K,{className:"w-10 h-10 text-primary mx-auto"}),e.jsx("p",{className:"text-lg font-semibold text-foreground",children:((w=a.boost)==null?void 0:w.celebrationTitle)??"Profile complete!"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:((k=a.boost)==null?void 0:k.celebrationBody)??"You're now maximally visible to contractors."})]}):e.jsx("ul",{className:"space-y-2",children:s.items.map(t=>{const r=t.done;return e.jsx("li",{children:e.jsxs("button",{type:"button",disabled:r,onClick:()=>{if(t.key==="phoneVerification"){u(!0);return}x(t.href)},className:`w-full text-left rounded-card border p-3 flex items-start gap-3 transition-colors ${r?"border-border/60 bg-muted/30 opacity-70":"border-border bg-card hover:border-primary/40 hover:bg-primary/5"}`,children:[e.jsx("div",{className:"mt-0.5 shrink-0",children:r?e.jsx(T,{className:"w-5 h-5 text-primary"}):e.jsx(z,{className:"w-5 h-5 text-muted-foreground/50"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:`text-sm font-medium ${r?"text-muted-foreground line-through":"text-foreground"}`,children:S(t.key)}),e.jsxs("span",{className:"text-caption text-muted-foreground shrink-0",children:["+",t.weight,"%"]})]}),!r&&b(t.key)&&e.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:b(t.key)})]})]})},t.key)})}),e.jsx(D,{open:L,onOpenChange:u})]})}
1export{te 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.