1import{c as ae,r as k,at as oe,j as e,X as Q,B as $,h as ne,L as A,A as T,a as F,e as L,C as ie,s as v,bg as X,bh as le,t as M,u as ce,p as de,ac as ue,q as me,am as pe,bd as he,b as xe}from"./index-P6gp-aZt.js";import{T as fe}from"./target-CFt1blCK.js";import{F as ge}from"./file-text-BJzh_OwL.js";import{M as Z}from"./mail-CHAWCWCR.js";import{L as ee}from"./linkedin-CLjECs8u.js";import{M as be}from"./message-square-C46UnNU7.js";import{M as ye}from"./mic-DMVsyDCl.js";import{C as ve}from"./camera-BvXux8uR.js";import{U as we}from"./users-BDvqxR7W.js";import{S as q}from"./sparkles-CbR3YTJF.js";import{T as je}from"./DemoVideo-BH6GkF3v.js";import{g as ke}from"./resume-profile.functions-CIogRmkh.js";import{C as Ne}from"./circle-check-B_xEoGS9.js";import{C as _e,D as Se,a as Ae,b as Ce,e as G}from"./dropdown-menu-CVKQV_RO.js";import{u as Ie}from"./useSubscription-D3jBac0a.js";import{f as Re,a as Te,b as Fe}from"./usage-period-Ce2ZEkxA.js";import{r as Le,b as H,p as De,c as Pe}from"./free-check-handoff-COf9yqmP.js";import{r as Ee}from"./analytics-C06G3E25.js";import{g as ze}from"./referral.functions-DuMkTXkU.js";import{I as te}from"./input-DjMejl9x.js";import{C as Me}from"./check-DAebpxbK.js";import{C as $e}from"./copy-BPWCpxIE.js";import{M as qe}from"./message-circle-Cd9NEXyI.js";import{a as Ue}from"./usage.functions-Y3GkqjYp.js";import{l as Be}from"./interview-library.functions-D6lNlU8V.js";import{g as Ye}from"./account.functions-BMps5sh2.js";import{r as We,d as Oe}from"./career.functions-CIpAqbO3.js";import{w as Ge,h as He,g as Ke,a as Ve,S as Je,E as Qe}from"./ScoreTrend-CdB7hbqp.js";import{A as Xe,a as Ze,b as et,c as tt,d as st,e as rt,f as at,g as ot}from"./alert-dialog-DPoGxQZH.js";import"./dialog-DwvLQ4w4.js";import"./index-CIfkDh8u.js";import"./index-BlJmuZBX.js";import"./tool-demos-DgraiMJb.js";import"./index-BRxJuvAA.js";import"./index-m4kp8mBg.js";import"./chevron-right-arvBV3js.js";import"./stripe-BL9TlFig.js";const nt=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8",key:"1sqzm4"}],["path",{d:"M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5",key:"kc0143"}],["rect",{x:"3",y:"7",width:"18",height:"4",rx:"1",key:"1hberx"}]],se=ae("gift",nt),P=[{to:"/tools/ats-scorer",title:"ATS Scorer",tagline:"Start every application here.",blurb:"Paste a job description and your resume - we score the match and surface the exact keywords, skills, and phrases recruiters' systems are filtering on.",when:"Use it for every new role you apply to.",highlights:["Match score against any JD","Missing keywords pulled out","Section-by-section coverage"],Icon:fe,tint:"#E85D3A"},{to:"/tools/resume-tailor",title:"Resume Tailor",tagline:"Rewrite weak bullets in one click.",blurb:"Turn vague responsibilities into recruiter-grade lines with strong verbs, real metrics, and the tone of the role you're targeting.",when:"Use after the ATS Scorer to close the gaps it found.",highlights:["Bullet-level rewrites","Metric & impact suggestions","Word + PDF export"],Icon:ge,tint:"#6B2D5C"},{to:"/tools/cover-letter",title:"Cover Letter",tagline:"Tailored letters in 30 seconds.",blurb:"Drop in the job + your resume and get a cover letter that sounds like you wrote it - not a template, not a wall of buzzwords.",when:"Whenever an application asks for one (or you want to stand out).",highlights:["Matches the role's tone","Pulls real wins from your resume","One-click share to LinkedIn"],Icon:Z,tint:"#F5B945"},{to:"/tools/linkedin-optimizer",title:"LinkedIn Toolkit",tagline:"A full LinkedIn growth workbench.",blurb:"Rewrite your headline & About, draft recruiter outreach that actually gets replies, brainstorm posts, and audit the weak spots recruiters notice first.",when:"Once a week - keep your profile and presence sharp.",highlights:["Profile rewrite (headline + About)","Outreach & follow-up drafts","Post Generator + profile audit"],Icon:ee,tint:"#1E3A5F"},{to:"/tools/interview-prep",title:"Interview Prep",tagline:"Walk in knowing what they'll ask.",blurb:"Likely questions for the role, STAR-formatted answer scaffolds built from your resume, and smart questions to ask back.",when:"The night before any interview.",highlights:["Role-specific question bank","STAR answer scaffolds","Smart questions to ask"],Icon:be,tint:"#87A878"},{to:"/tools/mock-interview",title:"Mock Interview",tagline:"Practice out loud, get instant feedback.",blurb:"Live spoken practice with an AI interviewer. Get per-answer feedback on clarity, structure, and content - so you sound sharp on the real call.",when:"After Interview Prep - rehearse out loud.",highlights:["Live voice interviewer","Per-answer feedback","Replays & transcripts"],Icon:ye,tint:"#C44569"},{to:"/tools/headshot",title:"AI Headshot",tagline:"Studio-grade photo from a phone selfie.",blurb:"Generate professional headshots that preserve your real face - no aging, no weird artifacts. Perfect for LinkedIn and your resume.",when:"Before refreshing your LinkedIn or resume p
1hoto.",highlights:["Identity-preserving","Multiple style presets","High-res downloads"],Icon:ve,tint:"#2D8A9E"},{to:"/contacts",title:"Contacts CRM",tagline:"Never let a warm intro go cold.",blurb:"Track every recruiter, hiring manager, and referral. Log conversations, set follow-up reminders, and move people through stages.",when:"Every time you talk to someone new in your search.",highlights:["Stages & pipelines","Notes & follow-up reminders","Searchable history"],Icon:we,tint:"#334155"}];function it({open:t,onClose:s}){const[r,a]=k.useState(0);if(k.useEffect(()=>{t&&a(0)},[t]),k.useEffect(()=>{if(!t)return;function o(u){u.key==="Escape"?s():u.key==="ArrowRight"?a(f=>Math.min(f+1,P.length-1)):u.key==="ArrowLeft"&&a(f=>Math.max(f-1,0))}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t,s]),!t||typeof window>"u")return null;const i=P[r],n=r===P.length-1,m=r===0;return oe.createPortal(e.jsx("div",{className:"fixed inset-0 z-[110] grid place-items-center p-3 sm:p-6 bg-black/75 backdrop-blur-sm animate-fade-in",onClick:s,children:e.jsxs("div",{role:"dialog","aria-label":`Tour: ${i.title}`,onClick:o=>o.stopPropagation(),className:"relative w-full max-w-2xl flex flex-col bg-card border border-border rounded-2xl shadow-2xl overflow-hidden animate-scale-in",children:[e.jsx("div",{className:"h-1 bg-muted shrink-0",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-blue-600 to-indigo-600 transition-all duration-300",style:{width:`${(r+1)/P.length*100}%`}})}),e.jsxs("div",{className:"relative p-6 text-white shrink-0",style:{background:`linear-gradient(135deg, ${i.tint}, color-mix(in oklab, ${i.tint} 70%, #000))`},children:[e.jsx("button",{onClick:s,"aria-label":"Close tour",className:"absolute top-3 right-3 text-white/80 hover:text-white",children:e.jsx(Q,{className:"size-5"})}),e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/15 text-[10px] font-mono uppercase tracking-widest mb-3",children:[e.jsx(q,{className:"size-3"})," Tour · ",r+1," of ",P.length]}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"size-12 shrink-0 rounded-xl grid place-items-center bg-white/15 backdrop-blur",children:e.jsx(i.Icon,{className:"size-6"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-2xl sm:text-3xl font-bold tracking-tight leading-tight",style:{fontFamily:"'Space Grotesk', Inter, sans-serif",letterSpacing:"-0.02em"},children:i.title}),e.jsx("p",{className:"mt-1 text-white/90 text-sm sm:text-base",children:i.tagline})]})]})]}),e.jsxs("div",{className:"p-6 space-y-5",children:[e.jsx("p",{className:"text-[15px] leading-relaxed text-foreground/90",children:i.blurb}),e.jsx("ul",{className:"space-y-2",children:i.highlights.map(o=>e.jsxs("li",{className:"flex items-start gap-2.5 text-sm",children:[e.jsx("span",{className:"mt-1.5 size-1.5 rounded-full shrink-0",style:{backgroundColor:i.tint}}),e.jsx("span",{className:"text-foreground/85",children:o})]},o))}),e.jsx("div",{className:"rounded-lg border border-border bg-muted/40 px-3.5 py-2.5 text-xs sm:text-sm text-muted-foreground italic",children:i.when}),e.jsx("div",{className:"flex items-center justify-center gap-1.5 pt-1",children:P.map((o,u)=>e.jsx("button",{onClick:()=>a(u),"aria-label":`Go to step ${u+1}`,className:`h-1.5 rounded-full transition-all ${u===r?"w-6 bg-foreground":"w-1.5 bg-foreground
1/25 hover:bg-foreground/50"}`},u))})]}),e.jsxs("div",{className:"border-t border-border p-4 sm:p-5 flex items-center justify-between gap-3 bg-muted/30 shrink-0",children:[e.jsxs($,{variant:"ghost",onClick:()=>a(o=>Math.max(o-1,0)),disabled:m,className:"gap-1",children:[e.jsx(ne,{className:"size-4"}),"Back"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{to:i.to,onClick:s,children:e.jsxs($,{variant:"outline",className:"gap-1",children:["Try it now",e.jsx(T,{className:"size-4"})]})}),n?e.jsxs($,{onClick:s,className:"bg-gradient-to-r from-blue-600 to-indigo-600 hover:opacity-90 text-white gap-1",children:["Finish",e.jsx(q,{className:"size-4"})]}):e.jsxs($,{onClick:()=>a(o=>Math.min(o+1,P.length-1)),className:"bg-gradient-to-r from-blue-600 to-indigo-600 hover:opacity-90 text-white gap-1",children:["Next",e.jsx(T,{className:"size-4"})]})]})]})]})}),document.body)}function W({title:t,when:s,actions:r,rows:a=3,pill:i=!0}){return e.jsxs("div",{className:"rounded-2xl border-2 border-midnight bg-card shadow-sm p-6",children:[e.jsx("h2",{className:"text-lg font-bold text-card-foreground mb-3",children:t}),e.jsx("ul",{className:"mb-4 divide-y divide-border","aria-hidden":"true",children:Array.from({length:a}).map((n,m)=>e.jsxs("li",{className:"flex items-center justify-between gap-4 py-2.5",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[e.jsx("div",{className:"h-3 rounded bg-slate-200/80",style:{width:`${52-m*9}%`}}),e.jsx("div",{className:"h-2 rounded bg-slate-100",style:{width:`${30+m*6}%`}})]}),i&&e.jsx("div",{className:"h-5 w-12 shrink-0 rounded-full bg-slate-100"})]},m))}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:s}),e.jsx("div",{className:"flex flex-wrap items-center gap-3",children:r.map(n=>e.jsxs(A,{to:n.to,className:"inline-flex items-center gap-1 text-sm font-semibold text-primary hover:opacity-80",children:[n.label," ",e.jsx(T,{className:"size-3"})]},n.to+n.label))})]})}function lt(){const t=F(ke),{data:s}=L({queryKey:["resume-profile"],queryFn:()=>t()}),[r,a]=k.useState(!1),i=s??{},n=d=>typeof i[d]=="string"&&i[d].trim().length>0,m=d=>Array.isArray(i[d])&&i[d].length>0,o=[{key:"full_name",label:"Full name",done:n("full_name")},{key:"email",label:"Email",done:n("email")},{key:"phone",label:"Phone",done:n("phone")},{key:"location",label:"Location",done:n("location")},{key:"country",label:"Country",done:n("country")},{key:"target_role",label:"Target role selected",done:n("target_role")},{key:"linkedin_url",label:"LinkedIn URL",done:n("linkedin_url")},{key:"portfolio_url",label:"Portfolio / website",done:n("portfolio_url")},{key:"professional_summary",label:"Professional summary",done:n("professional_summary")},{key:"work_experience",label:"Work experience",done:m("work_experience")},{key:"education",label:"Education",done:m("education")},{key:"skills",label:"Skills",done:m("skills")},{key:"certifications",label:"Certifications",done:m("certifications")}],u=o.filter(d=>d.done).length,f=o.length-u,y=Math.round(u/o.length*100),N=r?o:o.filter(d=>!d.done);return e.jsxs("div",{className:"rounded-2xl border-2 border-midnight bg-card shadow-sm p-5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-1",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-widest",children:"Profile Completeness"}),e.jsxs("span",{className:"text-sm font-bold text-card-foreground tabular-nums",children:[y,"%"]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted mb-4 overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${y}%`}})}),N.length>0?e.jsx("ul",{className:"space-y-1.5 mb-3",children:N.map(d=>e.jsxs("li",{className:"flex items-center gap-2 text-xs min-w-0",children:[d.done?e.jsx(Ne,{className:"size-4 text-emerald-600 shrink-0"}):e.jsx(_e,{className:"size-4 text-muted-foreground/40 shrink-0"}),e.jsx("span",{className:d.done?"text-muted-foreground truncate":"text-card-foreground font-medium truncate",children:d.label})]},d.key))}):e.jsx("p",{className:"text-sm text-emerald-700 mb-3",children:"Your resume profile is complete."}),!r&&f>0&&e.jsxs("p",{className:"text-xs text-muted-foreground mb-3",children:[f," item",f===1?"":"s"," remaining"]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u<
1o.length?e.jsxs(A,{to:"/resume-profile",className:"inline-flex items-center gap-1 text-xs font-semibold text-primary hover:opacity-80",children:["Complete Profile ",e.jsx(T,{className:"size-3"})]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Great job - your profile is fully filled out."}),e.jsxs("button",{type:"button",onClick:()=>a(d=>!d),className:"inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-card-foreground transition-colors","aria-expanded":r,"aria-label":r?"Collapse checklist":"Expand full checklist",children:[r?"Show less":"Show all",e.jsx(ie,{className:`size-3.5 transition-transform ${r?"rotate-180":""}`})]})]})]})}const ct={ats_score:"ATS checks",resume_enhance:"Tailored resumes",cover_letter:"Cover letters",linkedin:"LinkedIn optimizations",interview_prep:"Interview prep uses",mock_interview:"Mock interviews",mock_interview_video:"Video mock interviews",headshot:"AI headshots",salary_negotiate:"Salary negotiations",ninety_day_plan:"30-60-90 day plans"},K={ats_score:"topup-ats_score",resume_enhance:"topup-resume_enhance",cover_letter:"topup-cover_letter",linkedin:"topup-linkedin",salary_negotiate:"topup-salary_negotiate"},dt=["ats_score","resume_enhance","cover_letter","linkedin","interview_prep","mock_interview","mock_interview_video","headshot","salary_negotiate","ninety_day_plan"];function ut(){const{subscription:t,loading:s}=Ie(),[r,a]=k.useState({}),[i,n]=k.useState({}),[m,o]=k.useState(null),[u,f]=k.useState(!0);if(k.useEffect(()=>{let h=!0;return(async()=>{const{data:p}=await v.auth.getUser();if(!p?.user){h&&f(!1);return}const w=new Date().toISOString(),C=await Re(),[{data:R},{data:D}]=await Promise.all([v.from("usage_counters").select("tool, count").eq("user_id",p.user.id).eq("period",C),v.from("tool_credits").select("tool, delta, expires_at").eq("user_id",p.user.id)]),E={};(R??[]).forEach(j=>{E[j.tool]=j.count});const x={};(D??[]).forEach(j=>{j.expires_at&&j.expires_at<w||(x[j.tool]=(x[j.tool]??0)+(j.delta??0))}),h&&(a(E),n(x),o(C),f(!1))})(),()=>{h=!1}},[t?.plan]),s||u)return e.jsxs("div",{className:"rounded-2xl border-2 border-midnight bg-card shadow-sm p-5 animate-pulse",children:[e.jsx("div",{className:"h-3 w-24 bg-muted rounded mb-3"}),e.jsx("div",{className:"h-5 w-32 bg-muted rounded mb-4"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-3 w-full bg-muted rounded"}),e.jsx("div",{className:"h-3 w-5/6 bg-muted rounded"}),e.jsx("div",{className:"h-3 w-4/6 bg-muted rounded"})]})]});const y=t?.plan??"free",N=X[y],d=Te(m??"",t?.currentPeriodEnd??null),g=Math.max(i.referral_pool??0,0),_=dt.filter(h=>N[h]!==0).map(h=>{const p=N[h],w=r[h]??0,C=Math.max(i[h]??0,0),R=p===-1,D=R?1/0:p+C,E=R?1/0:Math.max(D-w,0),x=R?0:Math.min(w/Math.max(D,1)*100,100);return{tool:h,used:w,limit:p,available:D,remaining:E,unlimited:R,bonusBalance:C,pct:x}}),l=_.reduce((h,p)=>h+(p.unlimited?0:p.used),0),b=_.reduce((h,p)=>h+(p.unlimited?0:p.available),0),c=b>0?Math.min(l/b*100,100):0,S=y!=="power"&&y!=="bundle_90",I=y!=="free"&&!!t?.isActive;return e.jsxs("div",{className:"rounded-2xl border-2 border-midnight bg-card shadow-sm p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Available credits (incl. top-ups)"}),e.jsxs("p",{className:"mt-1 text-lg font-bold text-card-foreground inline-flex items-center gap-1.5",children:[e.jsx(q,{className:"size-4 text-primary"})," ",le[y]," plan"]})]}),S&&e.jsx(A,{to:"/pricing",className:"text-xs font-semibold px-2.5 py-1.5 rounded-md bg-primary text-primary-foreground hover:opacity-90 transition-opacity shrink-0",children:"Upgrade"})]}),e.jsx("div",{className:"space-y-3 mb-4",children:_.map(h=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between text-sm mb-1",children:[e.jsx("span",{className:"text-muted-foreground truncate",children:ct[h.tool]}),e.jsxs("span",{className:"font-semibold text-card-foreground tabular-nums shrink-0 ml-3 text-xs inline-flex items-center gap-2",children:[h.unlimited?e.jsx("span",{className:"text-emerald-600",children:"Unlimited"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-card-foreground",children:h.used}
1),e.jsx("span",{className:"text-muted-foreground/60 mx-1",children:"/"}),e.jsx("span",{className:"text-muted-foreground",children:h.available}),e.jsx("span",{className:"text-muted-foreground/60 ml-1",children:"used"})]}),I&&K[h.tool]&&e.jsx("a",{href:`/pricing#${K[h.tool]}`,className:"text-[10px] font-medium text-primary hover:underline ml-1",children:"Buy more"})]})]}),!h.unlimited&&e.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary rounded-full transition-all",style:{width:`${h.pct}%`}})})]},h.tool))}),b>0&&e.jsxs("div",{className:"pt-3 border-t border-border mb-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm mb-1",children:[e.jsx("span",{className:"font-semibold text-card-foreground",children:"Total used"}),e.jsxs("span",{className:"font-bold text-card-foreground tabular-nums text-xs",children:[l," / ",b]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary rounded-full transition-all",style:{width:`${c}%`}})})]}),g>0&&e.jsxs("div",{className:"pt-3 border-t border-border mb-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 text-sm",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 font-semibold text-card-foreground",children:[e.jsx(se,{className:"size-3.5 text-primary"})," Referral credits"]}),e.jsxs("span",{className:"font-bold tabular-nums text-card-foreground text-xs shrink-0",children:[g," available"]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-1 leading-relaxed",children:"Usable on ATS Scorer, Resume Tailor, and Cover Letter Generator only."})]}),e.jsx("div",{className:"pt-3 border-t border-border flex items-center justify-between text-xs",children:e.jsx("span",{className:"text-muted-foreground",children:Fe(d)})})]})}function mt(){const[t,s]=k.useState(null);return k.useEffect(()=>{const a=Le(H());s(De(a)?a:null)},[]),{saved:t,dismiss:()=>{Pe(H()),s(null)}}}function pt({saved:t,onDismiss:s}){if(!t)return null;const r=t.overallScore!=null?` scored ${t.overallScore}`:"";return e.jsx("section",{className:"mb-10","data-free-check-pickup":!0,children:e.jsxs("div",{className:"relative rounded-2xl border-2 border-blue-200 bg-blue-50/60 p-6 md:p-7",children:[e.jsx("button",{type:"button","aria-label":"Dismiss",onClick:s,className:"absolute right-3 top-3 rounded p-1 text-slate-500 hover:bg-white hover:text-slate-800",children:e.jsx(Q,{className:"size-4"})}),e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-widest text-blue-700 mb-2",children:"Pick up where you left off"}),e.jsxs("h2",{className:"text-xl md:text-2xl font-bold text-slate-900",style:{fontFamily:"'Space Grotesk', Inter, sans-serif",letterSpacing:"-0.02em"},children:["Your free ATS check",r]}),e.jsx("p",{className:"mt-1.5 max-w-2xl text-sm text-slate-600",children:"Your resume and the job description are ready in the ATS Scorer, the Resume Tailor and the Cover Letter - no pasting again."}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-3",children:[e.jsx(A,{to:"/tools/ats-scorer",className:"inline-flex items-center gap-2 rounded-lg border border-slate-300 bg-white px-5 py-2.5 text-sm font-semibold text-slate-800 hover:bg-slate-50",children:"See your full report"}),e.jsxs(A,{to:"/tools/resume-tailor",className:"inline-flex items-center gap-2 rounded-lg bg-blue-600 px-5 py-2.5 text-sm font-semibold text-white hover:bg-blue-700",children:["Tailor this resume ",e.jsx(T,{className:"size-4"})]}),e.jsx(A,{to:"/tools/cover-letter",className:"inline-flex items-center gap-2 rounded-lg border border-slate-300 bg-white px-5 py-2.5 text-sm font-semibold text-slate-800 hover:bg-slate-50",children:"Write the cover letter"})]})]})})}const U="I've been using CareerPlatform.io for AI-powered resume rewrites, cover letters, and mock interviews - it's been a game-changer for my job hunt. Sign up with my link and we both get bonus credits:";function ht(){const t=F(ze),{data:s,isLoading:r}=L({queryKey:["my-referral"],queryFn:()=>t(),staleTime:3e4}),[a,i]=k.useState(!1),n=s?s.available===!1:!1,m=s?.referralCode??"",o=m?`https://careerplatform.io/login?mode=signup&ref=${encodeURIComponent(m)}`:"",u=async()=>
1{if(o)try{await navigator.clipboard.writeText(o),i(!0),M.success("Referral link copied"),setTimeout(()=>i(!1),2e3)}catch{M.error("Copy failed - long-press to copy manually")}},f=o?`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(o)}&summary=${encodeURIComponent(`${U} ${o}`)}`:"#",y=o?`mailto:?subject=${encodeURIComponent("Free bonus credits on CareerPlatform.io")}&body=${encodeURIComponent(`${U} 2 3${o}`)}`:"#",N=o?`https://wa.me/?text=${encodeURIComponent(`${U} ${o}`)}`:"#";return e.jsxs("section",{className:"border border-primary/30 rounded-xl bg-primary/10 text-card-foreground p-7 md:p-9",children:[e.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[e.jsx("div",{className:"rounded-lg bg-primary/10 text-primary p-2.5 shrink-0",children:e.jsx(se,{className:"size-5"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold tracking-tight",children:"Give credits, get credits"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Share your referral link. When a friend signs up, they get bonus credits - and so do you."})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 mb-5",children:[e.jsx(te,{readOnly:!0,value:r?"Loadingâ¦":n?"Couldn't load your referral details - try again shortly":o||"Referral link unavailable",onClick:d=>d.target.select(),className:"font-mono text-xs sm:text-sm","aria-label":"Your referral link"}),e.jsxs($,{onClick:u,disabled:!o,type:"button",className:"shrink-0",children:[a?e.jsx(Me,{className:"size-4 mr-2"}):e.jsx($e,{className:"size-4 mr-2"}),a?"Copied":"Copy link"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[e.jsxs("a",{href:f,target:"_blank",rel:"noopener noreferrer","aria-disabled":!o,className:`inline-flex items-center gap-2 rounded-md border border-border bg-background hover:bg-accent px-3 py-1.5 text-sm font-medium ${o?"":"pointer-events-none opacity-50"}`,children:[e.jsx(ee,{className:"size-4 text-[#0A66C2]"})," LinkedIn"]}),e.jsxs("a",{href:y,"aria-disabled":!o,className:`inline-flex items-center gap-2 rounded-md border border-border bg-background hover:bg-accent px-3 py-1.5 text-sm font-medium ${o?"":"pointer-events-none opacity-50"}`,children:[e.jsx(Z,{className:"size-4"})," Email"]}),e.jsxs("a",{href:N,target:"_blank",rel:"noopener noreferrer","aria-disabled":!o,className:`inline-flex items-center gap-2 rounded-md border border-border bg-background hover:bg-accent px-3 py-1.5 text-sm font-medium ${o?"":"pointer-events-none opacity-50"}`,children:[e.jsx(qe,{className:"size-4 text-[#25D366]"})," WhatsApp"]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-6",children:[e.jsx(B,{label:"Successful signups",value:n?" - ":s?.successfulCount??0}),e.jsx(B,{label:"Credits earned",value:n?" - ":s?.creditsEarned??0}),e.jsx(B,{label:"Per referral",value:"+10",suffix:"credits"})]}),e.jsxs("div",{className:"rounded-lg border border-primary/20 bg-primary/5 px-3 py-2 mb-5 text-xs text-card-foreground/90 leading-relaxed",children:[e.jsx("span",{className:"font-semibold",children:"Heads up:"})," Referral credits can be used on"," ",e.jsx("span",{className:"font-semibold",children:"ATS Scorer"}),","," ",e.jsx("span",{className:"font-semibold",children:"Resume Tailor"}),", and"," ",e.jsx("span",{className:"font-semibold",children:"Cover Letter Generator"})," only - not on Voice Mock Interview or AI Headshots."]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 text-sm",children:[e.jsx(Y,{n:1,title:"Share your link",body:"Send it via LinkedIn, email, WhatsApp, or any chat."}),e.jsx(Y,{n:2,title:"Friend signs up",body:"They create a free account using your referral link."}),e.jsx(Y,{n:3,title:"You both get credits",body:"They get +5 bonus credits. You get +10. No cap."})]})]})}function B({label:t,value:s,suffix:r}){return e.jsxs("div",{className:"rounded-lg border border-border bg-background p-3 text-center",children:[e.jsx("div",{className:"text-2xl font-bold tabular-nums",children:s}),e.jsxs("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:[t,r?` ${r}`:""]})]})}function Y({n:t,title:s,body:r}){return e.jsxs("div",{className:"rounded-lg border border-border bg-background p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"inline-flex items-center justify-center size-6 rounded-full bg-primary/10 text-primary text-xs font-bold",children:t}),e.jsx("span",{className:"font-semibold text-sm",children:s})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:r})]})}const z=[{key:"profile",emoji:"ð¤",label:"Resume Profile",to:"/resume-profile",tool:null},{key:"ats",emoji:"ð¯",label:"ATS Scorer",to:"/tools/ats-scorer",tool:"ats_score"},{key:"resume",emoji:"âï¸",label:"Resume Tailor",to:"/tools/resume-tailor",tool:"resume_enhance"},{key:"cover",emoji:"ð",label:"Cover Letter",to:"/tools/cover-letter",tool:"cover_letter"},{key:"prep",emoji:"ð¤",label:"Interview Prep",to:"/tools/interview-prep",tool:"interview_prep"},{key:"mock",emoji:"ðï¸",label:"Mock Interview Simulator",to:"/tools/mock-interview",tool:"mock_interview"},{key:"video",emoji:"ð¥",label:"Video Mock Interview",to:"/tools/mock-interview-video",tool:"mock_interview"}
3,{key:"headshot",emoji:"ð¼ï¸",label:"AI Headshot",to:"/tools/headshot",tool:"headshot"},{key:"tracker",emoji:"ð¼",label:"Tracker",to:"/dashboard/applications",tool:null},{key:"linkedin",emoji:"ð",label:"LinkedIn Toolkit",to:"/tools/linkedin-optimizer",tool:"linkedin"},{key:"salary",emoji:"ð°",label:"Salary Negotiator",to:"/tools/salary",tool:"salary_negotiate"}];function xt(){return L({queryKey:["journey-progress-done"],queryFn:async()=>{const{data:{user:t}}=await v.auth.getUser(),s={};if(z.forEach(p=>s[p.key]=!1),!t)return s;const r=t.id,a=async p=>{try{return await p}catch{return null}},[i,n,m,o,u,f,y,N,d]=await Promise.all([a(v.from("ats_scores").select("id").eq("user_id",r).limit(1)),a(v.from("resumes").select("id").eq("user_id",r).limit(1)),a(v.from("cover_letters").select("id").eq("user_id",r).limit(1)),a(v.from("linkedin_optimizations").select("id").eq("user_id",r).limit(1)),a(v.from("interview_sessions").select("session_type").eq("user_id",r).limit(50)),a(v.from("tracked_applications").select("id").eq("user_id",r).limit(1)),a(v.from("usage_counters").select("tool, count").eq("user_id",r)),a(v.from("saved_headshots").select("id").eq("user_id",r).limit(1)),a(v.from("resume_profiles").select("id, raw_resume_text, professional_summary, work_experience, skills").eq("user_id",r).limit(1))]),g=u?.data??[],_=y?.data??[],l=p=>_.some(w=>w.tool===p&&(w.count??0)>0),b=p=>Array.isArray(p?.data)&&p.data.length>0,c=Array.isArray(d?.data)?d.data[0]:null,S=!!c&&(typeof c.raw_resume_text=="string"&&c.raw_resume_text.trim().length>0||typeof c.professional_summary=="string"&&c.professional_summary.trim().length>0||Array.isArray(c.work_experience)&&c.work_experience.length>0||Array.isArray(c.skills)&&c.skills.length>0),I=l("interview_prep")||g.some(p=>/prep/i.test(p.session_type??"")),h=l("mock_interview")||g.some(p=>
3/mock|simulator|practice/i.test(p.session_type??""));return{profile:S,ats:b(i)||l("ats_score"),resume:b(n)||l("resume_enhance"),cover:b(m)||l("cover_letter"),prep:I,mock:h,video:!1,headshot:l("headshot")||b(N),tracker:b(f),linkedin:l("linkedin")||b(o),salary:l("salary_negotiate")}},staleTime:6e4})}const ft=["ats_score","resume_enhance","cover_letter"];function V(t,s){return!t.tool||s.admin||(X[s.plan]?.[t.tool]??0)!==0||(s.credits[t.tool]??0)>0?!0:ft.includes(t.tool)&&s.referralCredits>0}function J(t){const s={width:28,height:28,borderRadius:"50%",borderWidth:2,borderStyle:"solid",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,lineHeight:1,flexShrink:0};return t==="done"?{...s,background:"#F0FDF4",borderColor:"#16A34A",color:"#16A34A",fontWeight:700}:t==="active"?{...s,background:"#1A56DB",borderColor:"#1A56DB",color:"#fff",animation:"journeyPulse 2s infinite"}:t==="locked"?{...s,background:"#F8FAFC",borderColor:"#E2E8F0",color:"#CBD5E1"}:{...s,background:"#F8FAFC",borderColor:"#E2E8F0",color:"#94A3B8"}}function gt(t,s){return t==="done"&&s==="done"?"#16A34A":t==="done"&&s==="active"?"linear-gradient(to right, #16A34A, #1A56DB)":t==="active"?"linear-gradient(to right, #1A56DB, #E2E8F0)":"#E2E8F0"}function bt(){const t=ce(),s=F(Ue),{data:r,isLoading:a}=L({queryKey:["access-summary"],queryFn:()=>s(),staleTime:6e4}),{data:i}=xt();if(a||!r||!i)return e.jsx("div",{style:{background:"#fff",padding:"20px 28px",borderBottom:"1px solid #F1F5F9"}});let n=!1;const m=z.map(l=>V(l,r)?i[l.key]?"done":n?"pending":(n=!0,"active"):"locked"),u=z.map(l=>V(l,r)).filter(Boolean).length,f=m.filter(l=>l==="done").length,y=f>0&&f===u,N=m.indexOf("active"),d=N>=0?z[N]:null,g=u>0?Math.round(f/u*100):0,_=l=>l==="done"?"#16A34A":l==="active"?"#1A56DB":l==="locked"?"#CBD5E1":"#94A3B8";return e.jsxs("section",{style:{background:"#fff",padding:"20px 28px",borderBottom:"1px solid #F1F5F9"},className:"rounded-xl mb-6","aria-label":"Your job search journey",children:[e.jsx("style",{children:` 4 @keyframes journeyPulse { 5 0%, 100% { box-shadow: 0 0 0 3px rgba(26,86,219,0.12); } 6 50% { box-shadow: 0 0 0 6px rgba(26,86,219,0.06); } 7 } 8 `}),e.jsxs("div",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.1em",textTransform:"uppercase",color:"#94A3B8",marginBottom:14,display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{children:"Your Job Search Journey"}),e.jsx("span",{style:{flex:1,height:1,background:"#F1F5F9"},"aria-hidden":"true"})]}),e.jsx("div",{style:{display:"flex",alignItems:"flex-start",width:"100%"},children:z.map((l,b)=>{const c=m[b],S=()=>{t(c==="locked"?{to:"/pricing"}:{to:l.to})};return e.jsxs("div",{style:{display:"contents"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",flexShrink:0,width:72},children:[e.jsx("button",{type:"button",onClick:S,style:{...J(c),background:J(c).background,cursor:"pointer",padding:0},"aria-label":`${l.label} - ${c}`,children:c==="done"?"â":c==="locked"?"ð":l.emoji}),e.jsx("div",{style:{fontSize:9,lineHeight:1.3,textAlign:"center",maxWidth:64,marginTop:6,color:_(c),fontWeight:c==="active"?700:500},children:l.label}),e.jsx("div",{style:{fontSize:9,marginTop:2,color:_(c),minHeight:12},children:c==="done"?"Done":c==="active"?"Up next":c==="locked"?"Upgrade":""})]}),b<z.length-1?e.jsx("div",{"aria-hidden":"true",style:{flex:1,height:2,marginTop:14,background:gt(m[b],m[b+1]),minWidth:8}}):null]},l.key)})}),e.jsxs("div",{style:{marginTop:16,borderTop:"1px solid #F8FAFC",paddingTop:12,display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,flexWrap:"wrap"},children:[e.jsxs("div",{style:{flex:1,minWidth:200},children:[e.jsx("div",{style:{height:3,width:"100%",background:"#F1F5F9",borderRadius:2,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${g}%`,background:"#1A56DB",transition:"width 0.4s ease"}})}),e.jsxs("div",{style:{fontSize:11,color:"#64748B",marginTop:6},children:[f," of ",u," steps complete - keep going"]})]}),y?e.jsx("div",{style:{fontSize:11,color:"#16A34A",fontWeight:600},children:"All steps complete ð"}):d?e.jsxs("button",{type:"button",onClick:()=>t({to:d.to}),style:{background:"#EEF2FF",color:"#1A56DB",fontSize:11,fontWeight:600,borderRadius:6,padding:"6px 12px",border:"none",cursor:"pointer"},children:["Continue with ",d.label," â"]}):null]})]})}const yt=de({method:"GET"}).middleware([ue]).handler(me("28f2da23b44e0262c75ab3b6ee417e0dea9f8650221c58e2c59329b6af680527")),re={ats:{count:0,lastScore:null,lastAt:null},resume:{count:0,lastAt:null},coverLetter:{count:0,lastAt:null},linkedin:{count:0,lastAt:null},interviewPrep:{count:0,lastAt:null},mockInterview:{count:0,lastAt:null},headshot:{count:0,lastAt:null},accountCreatedAt:null};function vt(){return L({queryKey:["dashboard-activity"],queryFn:async()=>{const{data:{user:t}}=await v.auth.getUser();if(!t)return re;const s=t.id,r=async w=>{try{return await w}catch{return null}},[a,i,n,m,o,u]=await Promise.all([r(v.from("ats_scores").select("score, created_at").eq("user_id",s).order("created_at",{ascending:!1}).limit(1)),r(v.from("resumes").select("created_at").eq("user_id",s).order("created_at",{ascending:!1}).limit(1)),r(v.from("cover_letters").select("created_at").eq("user_id",s).order("created_at",{ascending:!1}).limit(1)),r(v.from("linkedin_optimizations").select("created_at").eq("user_id",s).order("created_at",{ascending:!1}).limit(1)),r(v.from("interview_sessions").select("created_at, session_type").eq("user_id",s).order("created_at",{ascending:!1}).limit(20)),r(v.from("usage_counters").select("tool, count").eq("user_id",s).in("tool",["ats_score","resume_enhance","cover_letter","linkedin","interview_prep","mock_interview","headshot"]))]),f=a?.data?.[0],y=i?.data?.[0],N=n?.data?.[0],d=m?.data?.[0],g=o?.data??[],_=g.find(w=>/prep/i.test(w.session_type??"")),l=g.find(w=>
8/mock|simulator|practice/i.test(w.session_type??""))??(g.length&&!_?g[0]:null),b=u?.data??[],c=w=>b.some(C=>C.tool===w&&(C.count??0)>0),S=c("linkedin")||!!d,I=c("interview_prep")||!!_,h=c("mock_interview")||!!l,p=c("headshot");return{ats:{count:(a?.data?.length??0)||(c("ats_score")?1:0),lastScore:f?.score??null,lastAt:f?.created_at??null},resume:{count:(i?.data?.length??0)||(c("resume_enhance")?1:0),lastAt:y?.created_at??null},coverLetter:{count:(n?.data?.length??0)||(c("cover_letter")?1:0),lastAt:N?.created_at??null},linkedin:{count:S?1:0,lastAt:d?.created_at??null},interviewPrep:{count:I?1:0,lastAt:_?.created_at??null},mockInterview:{count:h?1:0,lastAt:l?.created_at??null},headshot:{count:p?1:0,lastAt:null},accountCreatedAt:t.created_at??null}},staleTime:6e4})}function wt(t){return t.ats.count===0?{title:"Start with your resume check",desc:"Upload your resume and target job description to see your ATS score, missing keywords, and recommended improvements.",cta:"Check Resume Match",to:"/tools/ats-scorer"}:t.ats.lastScore!==null&&t.ats.lastScore<75&&t.resume.count===0?{title:"Improve your resume",desc:`Your last ATS score was ${t.ats.lastScore}. Strengthen weak bullets and align language to the role.`,cta:"Improve Resume",to:"/tools/resume-tailor"}:t.resume.count>0&&t.coverLetter.count===0?{title:"Generate a tailored cover letter",desc:"Pair your improved resume with a focused cover letter that speaks directly to the role.",cta:"Generate Cover Letter",to:"/tools/cover-letter"}:t.linkedin.count===0?{title:"Optimize your LinkedIn profile",desc:"Sharpen your headline, About, and positioning so recruiters find you for the right roles.",cta:"Optimize LinkedIn Profile",to:"/tools/linkedin-optimizer"}:t.resume.count>0&&t.coverLetter.count>0&&t.interviewPrep.count===0?{title:"Start your interview prep",desc:"Generate likely questions and structured talking points based on your background and target role.",cta:"Start Interview Prep",to:"/tools/interview-prep"}:t.interviewPrep.count>0&&t.mockInterview.count===0?{title:"Practice with a mock interview",desc:"Rehearse your answers out loud and get structured feedback before the real call.",cta:"Start Mock Interview",to:"/tools/mock-interview"}:{title:"See what your resume is missing",desc:"Compare your resume to a target job, uncover missing keywords and requirements, and get clear next steps before you apply.",cta:"Check Resume Match",to:"/tools/ats-scorer"}}function jt(t){const s=r=>r>0?"completed":"not-started";return[{label:"Resume checked",status:s(t.ats.count),to:"/tools/ats-scorer",cta:t.ats.count?"Re-check":"Start"},{label:"Resume improved",status:s(t.resume.count),to:"/tools/resume-tailor",cta:t.resume.count?"Refine":"Start"},{label:"Cover letter created",status:s(t.coverLetter.count),to:"/tools/cover-letter",cta:t.coverLetter.count?"New":"Start"},{label:"LinkedIn optimized",status:s(t.linkedin.count),to:"/tools/linkedin-optimizer",cta:t.linkedin.count?"Update":"Start"},{label:"Interview prep completed",status:s(t.interviewPrep.count),to:"/tools/interview-prep",cta:t.interviewPrep.count?"Review":"Start"},{label:"Mock interview practiced",status:s(t.mockInterview.count),to:"/tools/mock-interview",cta:t.mockInterview.count?"Practice again":"Start"},{label:"Headshot created",status:t.headshot.count>0?"completed":"optional",to:"/tools/headshot",cta:"Open"}]}function ps(){const t=pe(),[s,r]=k.useState(!1),{data:a=re}=vt(),i=F(yt),{data:n}=L({queryKey:["dashboard-summary"],queryFn:()=>i(),staleTime:6e4}),m=F(Ye),{data:o}=L({queryKey:["profile"],queryFn:()=>m()}),u=(()=>{const l=o?.full_name?.trim();return l?l.split(/\s+/)[0]:null})(),f=(()=>{const l=o??{},b=I=>typeof l[I]=="string"&&l[I].trim().length>0,c=["target_role","linkedin_url","headline"],S=c.filter(b).length;return Math.round(S/c.length*100)})();k.useEffect(()=>{v.auth.getUser().then(({data:l})=>Ee(l.user)).catch(()=>{})},[]);const y=mt(),N=!!a.accountCreatedAt&&Date.now()-Date.parse(a.accountCreatedAt)<1440*60*1e3;k.useEffect(()=>{new URLSearchParams(t.latestLocation.searchStr).get("tour")==="1"&&t.navigate({to:"/dashboard",search:{},replace:!0})},[t]),wt(a);const d=At(a,n),g=jt(a),_=St(a,n);return g.filter(l=>l.status==="completed").length,g.filter(l=>l.status!=="optional").length,e.jsxs("div",{className:"min-h-[calc(100vh-3.5rem)]",children:[e.jsx(it,{open:s,onClose:()=>r(!1)}),e.jsxs("div",{className:"px-4 sm:px-6 lg:px-8 pt-1 md:pt-2 pb-8 md:pb-10",children:[e.jsx("header",{className:"mb-6 flex flex-col md:flex-row md:items-start md:justify-between gap-3",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold tracking-tight text-foreground",style:{fontFamily:"'Space Grotesk', Inter, sans-serif",letterSpacing:"-0.02em"},children:N?u?`Welcome, ${u}.`:"Welcome.":u?`Welcome back, ${u}.`:"Welcome back."}),e.jsx("p",{className:"mt-2 text-sm md:text-base text-muted-foreground max-w-2xl",children:_})]})}),e.jsx(bt,{}),e.jsx(pt,{saved:y.saved,onDismiss:y.dismiss}),!y.saved&&e.jsxs("section",{className:"mb-10",children:[e.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest mb-2",children:"Recommended Next Step"}),e.jsxs("div",{className:"rounded-2xl border-2 border-midnight bg-card shadow-sm p-6 md:p-7 flex flex-col md:flex-row md:items-center gap-5",children:[e.jsx("div",{className:"size-12 rounded-xl bg-primary/10 border border-primary/20 grid place-items-center text-primary shrink-0",children:e.jsx(q,{className:"size-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h2",{className:"text-xl md:text-2xl font-bold text-card-foreground",style:{fontFamily:"'Space Grotesk', Inter, sans-serif",letterSpacing:"-0.02em"},children:d.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 max-w-2xl",children:d.desc})]}),e.jsxs(A,{to:d.to,className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-blue-600 text-white text-sm font-semibold hover:bg-blue-700 transition-colors shrink-0",children:[d.cta," ",e.jsx(T,{className:"size-4"})]})]})]}),e.jsxs("section",{className:"mb-10 grid lg:grid-cols-3 gap-8",children:[e.jsx("p",{className:"col-span-full text-[11px] font-semibold text-muted-foreground uppercase tracking-widest mb-0",children:"Your snapshot"}),e.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[e.jsx(Nt,{summary:n}),e.jsx(_t,{summary:n}),e.jsx(It,{})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsx(ut,{}),f<100&&e.jsx(lt,{})]})]}),e.jsx(je,{}),e.jsx("section",{className:"mt-8",children:e.jsx(ht,{})})]})]})}function kt(t){switch(t){case"saved":return"Saved";case"applied":return"Applied";case"phone_screen":return"Phone Screen";case"interview":return"Interview";case"offer":return"Offer";case"rejected":return"Rejected";case"archived":return"Archived";default:return t}}function O(t){try{return new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"})}catch{return""}}function Nt({summary:t}){const s=t?.applications,r=(s?.recent?.length??0)>0,a=[{key:"saved",label:"Saved"},{key:"applied",label:"Applied"},{key:"phone_screen",label:"Phone Screen"},{key:"interview",label:"Interview"},{key:"offer",label:"Offer"}],i=s?.counts.rejected??0;return r?s?e.jsxs("div",{className:"rounded-2xl border-2 border-midnight bg-card shadow-sm p-6",children:[e.jsx("h2",{className:"text-lg font-bold text-card-foreground mb-4",children:"Your Tracker"}),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 mb-5",children:[a.map(n=>e.jsxs("a",{href:`/dashboard/applications?status=${n.key}`,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-muted hover:bg-muted/70 text-xs font-medium text-card-foreground transition-colors",children:[n.label," ",e.jsxs("span",{className:"tabular-nums text-muted-foreground",children:["(",s.counts[n.key]??0,")"]})]},n.key)),i>0&&e.jsxs("a",{href:"/dashboard/applications?status=rejected",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-rose-50 hover:bg-rose-100 text-xs font-medium text-rose-700 transition-colors dark:bg-rose-950/40 dark:hover:bg-rose-900/50 dark:text-rose-300",children:["Rejected ",e.jsxs("span",{className:"tabular-nums text-rose-600/80 dark:text-rose-400/80",children:["(",i,")"]})]})]}),e.jsx("ul",{className:"divide-y divide-border mb-4",children:s.recent.map(n=>e.jsxs("li",{className:"flex items-center gap-3 py-2.5",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-card-foreground truncate",children:n.company}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.job_title})]}),e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide px-2 py-0.5 rounded-full bg-muted text-muted-foreground shrink-0",children:kt(n.status)}),e.jsx("span",{className:"text-[11px] text-muted-foreground tabular-nums shrink-0 hidden sm:inline",children:O(n.updated_at)}),e.jsxs(A,{to:"/dashboard/applications/$id",params:{id:n.id},className:"text-xs font-semibold text-primary hover:opacity-80 inline-flex items-center gap-1 shrink-0",children:["Open ",e.jsx(T,{className:"size-3"})]})]},n.id))}),e.jsxs(A,{to:"/dashboard/applications",className:"text-xs font-semibold text-primary hover:opacity-80 inline-flex items-center gap-1",children:["View all applications ",e.jsx(T,{className:"size-3"})]})]})]}):null:e.jsx(W,{title:"Your Tracker",when:"Your saved and applied jobs appear here with their status, from the first job you save. Paste a job URL into the Tracker, or save one from the Chrome extension.",actions:[{to:"/dashboard/applications",label:"Open Tracker"}]})}function _t({summary:t}){const s=he(),r=F(We),a=F(Oe),i=t?.resumes??[],n=Ge(i),m=n.length===0,o=He(i),u=n.map(x=>x.id),f=F(Ke),{data:y}=L({queryKey:["dashboard-resume-histories",u],queryFn:()=>f({data:{resumeIds:u,limit:5}}),enabled:u.length>0}),N=(()=>{const x=new Map;
8return(y?.items??[]).forEach(j=>x.set(j.resumeId,j)),x})(),d=F(Ve),{data:g}=L({queryKey:["best-improvement"],queryFn:()=>d(),staleTime:6e4}),[_,l]=k.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("resumes-dupe-note-dismissed")==="1"),b=()=>{l(!0);try{window.localStorage.setItem("resumes-dupe-note-dismissed","1")}catch{}},[c,S]=k.useState(null),[I,h]=k.useState(""),[p,w]=k.useState(null),[C,R]=k.useState(!1),D=async()=>{if(!c)return;const x=I.trim();if(!x){S(null);return}R(!0);try{await r({data:{id:c,title:x}}),M.success("Renamed"),S(null),s.invalidateQueries({queryKey:["dashboard-summary"]})}catch(j){M.error(j instanceof Error?j.message:"Rename failed")}finally{R(!1)}},E=async()=>{if(p){R(!0);try{await a({data:{id:p}}),M.success("Resume deleted"),w(null),s.invalidateQueries({queryKey:["dashboard-summary"]})}catch(x){M.error(x instanceof Error?x.message:"Delete failed")}finally{R(!1)}}};return m?e.jsx(W,{title:"Your resumes.",when:"Your saved resumes appear here with their best ATS score after your first ATS check. Once two or more have been scored, your best improvement shows above them.",actions:[{to:"/tools/ats-scorer",label:"Run an ATS check to save your first"},{to:"/dashboard/resumes",label:"Upload a resume"}]}):e.jsxs("div",{className:"rounded-2xl border-2 border-midnight bg-card shadow-sm p-6",children:[e.jsx("h2",{className:"text-lg font-bold text-card-foreground mb-4",children:"Your resumes."}),g&&e.jsxs("p",{className:"text-xs text-muted-foreground -mt-2 mb-4",children:["Your best improvement:"," ",e.jsxs("span",{className:"font-semibold text-card-foreground tabular-nums",children:[g.startScore," â ",g.highScore]})," ",e.jsxs("span",{className:"text-emerald-600 dark:text-emerald-400 font-semibold tabular-nums",children:["(+",g.delta," points)"]})," ","on"," ",e.jsxs(A,{to:"/dashboard/applications/$id",params:{id:g.applicationId},className:"text-foreground font-medium hover:underline",children:[g.jobTitle," at ",g.company]})]}),m?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["No resumes saved yet."," ",e.jsxs(A,{to:"/tools/ats-scorer",className:"font-semibold text-primary hover:opacity-80 inline-flex items-center gap-1",children:["Run an ATS check to save your first ",e.jsx(T,{className:"size-3"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("ul",{className:"divide-y divide-border mb-4",children:n.map(x=>e.jsxs("li",{className:"flex items-center gap-3 py-2.5",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[c===x.id?e.jsx("form",{onSubmit:j=>{j.preventDefault(),D()},children:e.jsx(te,{autoFocus:!0,value:I,onChange:j=>h(j.target.value),onBlur:()=>{D()},onKeyDown:j=>{j.key==="Escape"&&S(null)},maxLength:120,disabled:C,className:"h-7 text-sm"})}):e.jsx("p",{className:"text-sm font-medium text-card-foreground truncate",children:x.displayTitle}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Last used ",O(x.updated_at)]})]}),e.jsx(Je,{score:N.get(x.id)?.highestScore??x.best_ats_score??null,trend:N.get(x.id)?.trend??"none"}),e.jsxs(Se,{children:[e.jsx(Ae,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Resume actions",className:"size-7 grid place-items-center rounded-md text-muted-foreground hover:text-card-foreground hover:bg-muted shrink-0",children:e.jsx(Qe,{className:"size-4"})})}),e.jsxs(Ce,{align:"end",children:[e.jsx(G,{onSelect:()=>{S(x.id),h(x.title)},children:"Rename"}),e.jsx(G,{onSelect:()=>w(x.id),className:"text-destructive focus:text-destructive",children:"Delete"})]})]})]},x.id))}),o&&!_&&e.jsxs("button",{type:"button",onClick:b,className:"block w-full text-left text-[11px] text-muted-foreground bg-muted/40 hover:bg-muted/60 rounded-md px-3 py-2 mb-3 transition-colors",children:["You have resumes with the same name - click any resume to rename it. ",e.jsx("span",{className:"underline",children:"Dismiss"})]}),e.jsxs(A,{to:"/dashboard/resumes",className:"text-xs font-semibold text-primary hover:opacity-80 inline-flex items-center gap-1",children:["Manage resumes ",e.jsx(T,{className:"size-3"})]})]}),e.jsx(Xe,{open:!!p,onOpenChange:x=>!x&&w(null),children:e.jsxs(Ze,{children:[e.jsxs(et,{children:[e.jsx(tt,{children:"Delete this resume?"}),e.jsx(st,{children:"This cannot be undone."})]}),e.jsxs(rt,{children:[e.jsx(at,{disabled:C,children:"Cancel"}),e.jsx(ot,{onClick:x=>{x.preventDefault(),E()},disabled:C,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:C?e.jsx(xe,{className:"size-4 animate-spin"}):"Confirm"})]})]})})]})}function St(t,s){const r=s?.applications;if(r?.hasOffer)return"You have an offer - congratulations! Review your application history.";if(r?.hasInterview)return"You have an interview coming up - make sure you're prepared.";const a=r?.activeCount??0;return a>=3?"You're actively applying - stay on top of your pipeline and keep improving your matches.":a>=1?`You have ${a} application${a===1?"":"s"} in progress - keep the momentum going.`:(s?.resumes?.length??0)>0||t.resume.count>0?"Your resume is in - find roles that match it and track every application.":"Upload your resume and target job description to see where you match, what is missing, and what to improve before you apply."}function At(t,s){const r=t.resume.count+t.ats.count,a=s?.applications,i=s?.pendingInterviewFollowup;if(i)return{title:`You interviewed with ${i.company} ${i.businessDaysSinceInterview} business days ago`,desc:`Want to send a follow-up thank-you note for ${i.jobTitle}? We'll draft one using the job description and your resume on file.`,cta:"Draft thank-you note",to:`/dashboard/applications?followup=${i.applicationId}`};if(a?.hasInterview)return{title:"You have an interview coming up",desc:"Practice your answers out loud and get structured feedback before the real call.",cta:"Start Mock Interview",to:"/tools/mock-interview"};if(a&&a.activeCount>0){const m=a.recent.slice(0,3).map(o=>o.company?`${o.job_title} at ${o.company}`:o.job_title).join(" · ");return{title:`You have ${a.activeCount} active application${a.activeCount===1?"":"s"}`,desc:m?`You're tracking: ${m}. Review your latest ATS scores and keep momentum on every role you're working on.`:"Review your latest ATS scores and keep momentum on every role you're working on.",cta:"View Tracker",to:"/dashboard/applications"}}return r>0?{title:"Your resume is ready - start tracking applications",desc:"Save the roles you're pursuing to your Tracker so you can measure ATS fit, tailor materials, and follow up on time.",cta:"Open Tracker",to:"/dashboard/applications"}:{title:"Upload your resume to get started",desc:"Upload your resume and a target job description to see your ATS score, missing keywords, and recommended improvements.",cta:"Check Resume Match",to:"/tools/ats-scorer"}}function Ct(t){return t===null?"bg-slate-100 text-slate-700 border-slate-200":t>=7?"bg-emerald-100 text-emerald-800 border-emerald-200":t>=5?"bg-amber-100 text-amber-800 border-amber-200":"bg-red-100 text-red-800 border-red-200"}function It(){const t=F(Be),{data:s}=L({queryKey:["interview-library"],queryFn:()=>t(),staleTime:6e4}),r=s?.items??[],a=r[0];return r.length===0?e.jsx(W,{title:"Interview Library.",rows:2,pill:!1,when:"Your interview prep kits and mock
8interview sessions are saved here after your first one, so you can reread them before the interview.",actions:[{to:"/tools/interview-prep",label:"Generate interview prep"},{to:"/tools/mock-interview",label:"Start mock interview"}]}):e.jsxs("div",{className:"rounded-2xl border-2 border-midnight bg-card shadow-sm p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 gap-3 flex-wrap",children:[e.jsx("h2",{className:"text-lg font-bold text-card-foreground",children:"Interview Library."}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[r.length," saved"]})]}),a&&e.jsxs("div",{className:"rounded-lg border border-slate-200 p-3 flex items-center justify-between gap-3 flex-wrap mb-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"text-sm font-semibold truncate",children:[a.role,a.company?e.jsxs("span",{className:"text-muted-foreground",children:[" · ",a.company]}):null]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:O(a.created_at)})]}),a.rating!==null&&e.jsxs("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full border ${Ct(a.rating)}`,children:[a.rating,"/10"]})]}),e.jsxs(A,{to:"/dashboard/interview-library",className:"inline-flex items-center gap-1 text-sm font-semibold text-primary hover:opacity-80",children:["View library ",e.jsx(T,{className:"size-3"})]})]})}export{ps as component};
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.