1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/resume-pdf-BRIe_Z72.js","assets/index-P6gp-aZt.js","assets/resume-tailor-version-arJFjEhY.js","assets/resume-source-hygiene-BnELtta6.js","assets/resume-docx-DxYvd0Ei.js"])))=>i.map(i=>d[i]); 2import{am as As,r as o,c as Te,p as Ze,ac as Qe,q as et,j as e,a as U,bA as Ds,u as _s,ay as me,t as Es,X as Ps,B as pe,b as $s,L as Ge}from"./index-P6gp-aZt.js";import{u as Is}from"./useAIJob-CDLw1WSR.js";import{P as Bs,A as Fs}from"./processing-message-CQInh3mu.js";import{n as K,F as se,B as Ms,L as Os,M as Bt,P as Ft,p as is,a as Re,b as Ce,S as Ws,w as Xe,c as zs,D as Hs,t as Mt,d as Ve,r as Us,l as Gs,e as Vs,f as Ys,g as Ks,v as Ot,h as Js,i as qs,j as Wt,k as Xs,m as Zs,s as zt,o as Ht,q as Qs,u as er,x as tr,y as sr,z as Ut,A as Gt,C as Vt,E as rr}from"./resume-tailor-version-arJFjEhY.js";import{T as ar}from"./tool-shell-DOJ8KLh1.js";import{R as nr}from"./resume-upload-button-D1k6awBz.js";import{L as or}from"./LoadSavedResume-DC5pf0P2.js";import{U as ir,R as lr}from"./UseResumeProfileButton-CMFYfwWj.js";import{S as dr}from"./SavedJobPicker-Syn3cM8P.js";import{J as Yt}from"./ResumeInput-CPuvAbK_.js";import{A as cr,a as ur,b as mr,c as pr,d as hr,e as xr,f as fr,g as gr}from"./alert-dialog-DPoGxQZH.js";import{P as br}from"./ai-processing-notice-C9mNNFMb.js";import{S as jr}from"./StepIndicator-CwQ9okve.js";import{u as yr}from"./useToolRemaining-Cqoz7xgb.js";import{L as Kt}from"./label-B0ZEWUZ2.js";import{r as Y}from"./resume-source-hygiene-BnELtta6.js";import{M as vr}from"./MultiColumnWarningBanner-BBDzppLc.js";import{F as wr}from"./FreeCheckCarriedNote-DNkvVbis.js";import{f as Nr,r as kr,b as Ye,m as Sr,c as Rr}from"./free-check-handoff-COf9yqmP.js";import{a as Cr,s as Tr,l as Lr,d as Ar,g as Dr,b as _r}from"./resume-tailor-versions.functions-DnZHdCsB.js";import{W as Er}from"./wand-sparkles-Bqic2VIV.js";import{C as Pr}from"./clipboard-list-DeXRY8-H.js";import{P as $r}from"./pencil-Cpv9QQl1.js";import{M as Ir}from"./mail-CHAWCWCR.js";import{D as Br}from"./download-DlC41J7E.js";import"./dialog-DwvLQ4w4.js";import"./index-CIfkDh8u.js";import"./index-BlJmuZBX.js";import"./refresh-cw-bk_qz457.js";import"./calendar-range-B8BsM8aX.js";import"./dollar-sign-CDWyGsO8.js";import"./camera-BvXux8uR.js";import"./mic-DMVsyDCl.js";import"./message-square-C46UnNU7.js";import"./linkedin-CLjECs8u.js";import"./file-text-BJzh_OwL.js";import"./target-CFt1blCK.js";import"./ToolAllowanceChip-DMWogGkO.js";import"./usage.functions-Y3GkqjYp.js";import"./DemoVideo-BH6GkF3v.js";import"./tool-demos-DgraiMJb.js";import"./check-DAebpxbK.js";import"./upload-CgNiXXHX.js";import"./index-BRxJuvAA.js";import"./index-m4kp8mBg.js";import"./career.functions-CIpAqbO3.js";import"./folder-open-zNkS6hJE.js";import"./resume-profile.functions-CIogRmkh.js";import"./extension-auth-B_JeSTLN.js";import"./tracked-applications.functions-OrmdIrYK.js";import"./input-DjMejl9x.js";import"./briefcase-DNrLFJ_6.js";import"./search-BPOzQH4F.js";import"./resume-drop-zone-CPmd3iIz.js";import"./shield-check-n8ostOuy.js";import"./info-CyM3nu35.js";import"./useSubscription-D3jBac0a.js";import"./stripe-BL9TlFig.js";import"./usage-period-Ce2ZEkxA.js";function Fr(s,n){if(s===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in s)return s;if(typeof s=="function")return{shouldBlockFn:async()=>await s(),enableBeforeUnload:!0,withResolver:!1};const i=!!(s.condition??!0),u=s.blockerFn;return{shouldBlockFn:async()=>i&&u!==void 0?await u():i,enableBeforeUnload:i,withResolver:u===void 0}}function Mr(s,n){const{shouldBlockFn:i,enableBeforeUnload:u=!0,disabled:c=!1,withResolver:h=!1}=Fr(s),l=As(),{history:a}=l,[y,m]=o.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return o.useEffect(()=>{const v=async S=>{function w(T){const O=l.parseLocation(T),P=l.getMatchedRoutes(O.pathname);return P.foundRoute===void 0?{routeId:"__notFound__",fullPath:O.pathname,pathname:O.pathname,params:P.routeParams,search:l.options.parseSearch(T.search)}:{routeId:P.foundRoute.id,fullPath:P.foundRoute.fullPath,pathname:O.pathname,params:P.routeParam
2s,search:l.options.parseSearch(T.search)}}const b=w(S.currentLocation),C=w(S.nextLocation);if(b.routeId==="__notFound__"&&C.routeId!=="__notFound__")return!1;const $=await i({action:S.action,current:b,next:C});if(!h)return $;if(!$)return!1;const M=await new Promise(T=>{m({status:"blocked",current:b,next:C,action:S.action,proceed:()=>T(!1),reset:()=>T(!0)})});return m({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),M};return c?void 0:a.block({blockerFn:v,enableBeforeUnload:u})},[i,u,c,h,a,l]),y}const Or=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],Wr=Te("check-check",Or);const zr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Hr=Te("columns-2",zr);const Ur=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Gr=Te("save",Ur);const Vr=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Yr=Te("undo-2",Vr),he=40,Ke=6e4,Jt=3e4;Ze({method:"POST"}).middleware([Qe]).handler(et("79839689dcfae5bc5869283394d719a8f0ae88ca2b7037faf01f852b0ffa8e90"));const Kr=Ze({method:"POST"}).middleware([Qe]).handler(et("c93a9101b23e71a224f6e889146cdd9457f39925229b077690f4857abc96f89b")),Jr=Ze({method:"POST"}).middleware([Qe]).handler(et("21bda5ecc165ad972e22977a833a3509156d0d25f61eac3409fcbd6465b548ae")),qr={pass:"bg-emerald-500",warn:"bg-amber-500",fail:"bg-rose-500"},Xr={missing:{label:"Missing",className:"bg-rose-500/15 text-rose-700 dark:text-rose-300"},skills_only:{label:"Skills only",className:"bg-amber-500/15 text-amber-700 dark:text-amber-300"},underused:{label:"Underused",className:"bg-amber-500/15 text-amber-700 dark:text-amber-300"},matched:{label:"Matched",className:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-300"}},Zr={high:"High",medium:"Medium",low:"Low"};function qt({item:s}){return e.jsxs("li",{className:"flex gap-3 py-3",children:[e.jsx("span",{className:`mt-1.5 size-2.5 shrink-0 rounded-full ${qr[s.status]}`,"aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[e.jsx("span",{className:"font-medium",children:s.label}),e.jsx("span",{className:"text-sm text-muted-foreground",children:s.finding})]}),s.action&&e.jsx("p",{className:"mt-1 text-sm",children:s.action}),s.lines&&s.lines.length>0&&e.jsx("ul",{className:"mt-1.5 space-y-0.5 border-l-2 border-border pl-3 text-xs text-muted-foreground",children:s.lines.map((n,i)=>e.jsx("li",{className:"truncate",title:n,children:n},i))})]})]})}function Xt({title:s,blurb:n,items:i}){const u=i.filter(a=>a.action),c=i.filter(a=>!a.action),[h,l]=o.useState(!1);return e.jsxs("section",{className:"rounded border p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[e.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:s}),e.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[u.length===0?"nothing to do":`${u.length} to do`," · ",c.length," passed"]})]}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:n}),u.length>0?e.jsx("ul",{className:"mt-2 divide-y",children:u.map(a=>e.jsx(qt,{item:a},a.key))}):e.jsx("p",{className:"mt-3 text-sm",children:"Every check here passed."}),c.length>0&&e.jsxs("div",{className:"mt-2",children:[e.jsxs("button",{type:"button",className:"text-xs text-muted-foreground underline-offset-2 hover:underline",onClick:()=>l(a=>!a),"aria-expanded":h,children:[h?"Hide":"Show"," the ",c.length," that passed"]}),h&&e.jsx("ul",{className:"mt-1 divide-y opacity-80",children:c.map(a=>e.jsx(qt,{item:a},a.key))})]})]})}function Qr({keywords:s}){const{rows:n,matched:i,underused:u,skillsOnly:c,missing:h}=s;return e.jsxs("section",{className:"rounded border p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[e.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:"Keywords"}),e.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[h," missing · ",c," skills only · ",u," underused · ",i," matched"]})]}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:'The terms this job description uses most, and whether your resume uses them. Missing terms are what the suggestions target. "Skills only" means the term appears in your skills list but under no role - a reader, and some parsers, weight a term more where it is shown in use. A term you have no real experience with should stay missing.'}),n.length===0?e.jsx("p",{className:"mt-3 text-sm",children:"No keywords could be extracted from this job description."}):e.jsx("div",{className:"mt-3 overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"text-xs uppercase text-muted-foreground",children:e.jsxs("tr",{className:"text-left",children:[e.jsx("th",{className:"py-1.5 pr-3 font-medium",children:"Keyword"}),e.jsx("th",{className:"py-1.5 pr-3 font-medium",children:"Importance"}),e.jsx("th",{className:"py-1.5 pr-3 text-right font-medium",children:"In the job"}),e.jsx("th",{className:"py-1.5 pr-3 text-right font-medium",children:"In your resume"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Status"})]})}),e.jsx("tbody",{className:"divide-y",children:n.map(l=>{const a=Xr[l.status];return e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-3",children:l.keyword}),e.jsx("td",{className:"py-1.5 pr-3 text-muted-foreground",children:Zr[l.importance]}),e.jsx("td",{className:"py-1.5 pr-3 text-right tabular-nums",children:l.jdCount}),e.jsx("td",{className:"py-1.5 pr-3 text-right tabular-nums",children:l.resumeCount}),e.jsx("td",{className:"py-1.5",children:e.jsx("span",{className:`inline-block rounded px-1.5 py-0.5 text-xs font-medium ${a.className}`,children:a.label})})]},l.keyword)})})]})})]})}function ea({report:s,pages:n}){const{facts:i}=s;return e.jsxs("div",{className:"space-y-4","data-testid":"resume-report",children:[e.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-1 rounded border px-4 py-3 text-sm",children:[e.jsxs("span",{children:[e.jsx("span",{className:"tabular-nums font-medium",children:i.words})," ",e.jsx("span",{className:"text-muted-foreground",children:"words"})]}),typeof n=="number"&&e.jsxs("span",{children:[e.jsx("span",{className:"tabular-nums font-medium",children:n})," ",e.jsxs("span",{className:"text-muted-foreground",children:["page",n===1?"":"s"]})]}),e.jsxs("span",{children:[e.jsx("span",{className:"tabular-nums font-medium",children:i.roles})," ",e.jsxs("span",{className:"text-muted-foreground",children:["role",i.roles===1?"":"s"," found"]}
2)]}),e.jsxs("span",{children:[e.jsx("span",{className:"tabular-nums font-medium",children:i.bullets})," ",e.jsx("span",{className:"text-muted-foreground",children:"bullets"})]}),e.jsxs("span",{children:[e.jsx("span",{className:"tabular-nums font-medium",children:i.quantified})," ",e.jsx("span",{className:"text-muted-foreground",children:"with a number"})]})]}),e.jsx(Qr,{keywords:s.keywords}),e.jsx(Xt,{title:"Searchability",blurb:"Whether an applicant-tracking system can read the document: contact details, section headings, dates, characters and layout. A failed check here can hide the resume regardless of what it says.",items:s.searchability}),e.jsx(Xt,{title:"Writing",blurb:"What a recruiter reading it notices in the first pass: numbers, verbs, length and filler. Measured from your text; every line names what to change.",items:s.writing})]})}function Zt({value:s,onChange:n,pages:i,className:u}){const c=K(s),h=a=>n(K({...c,...a})),l="h-7 rounded border border-slate-300 bg-white px-1.5 text-xs text-slate-800 focus-visible:outline-2 focus-visible:outline-offset-2";return e.jsxs("div",{className:`flex flex-wrap items-center gap-2 ${u??""}`,children:[e.jsx(xe,{label:"Font",children:e.jsx("select",{className:l,value:c.font,onChange:a=>h({font:a.target.value}),"aria-label":"Font",children:Object.keys(se).map(a=>e.jsx("option",{value:a,children:se[a].label},a))})}),e.jsx(xe,{label:"Size",children:e.jsx("select",{className:l,value:String(c.bodyPt),onChange:a=>h({bodyPt:Number(a.target.value)}),"aria-label":"Body size",children:Ms.map(a=>e.jsxs("option",{value:String(a),children:[a," pt"]},a))})}),e.jsx(xe,{label:"Line",children:e.jsx("select",{className:l,value:String(c.lineHeight),onChange:a=>h({lineHeight:Number(a.target.value)}),"aria-label":"Line spacing",children:Os.map(a=>e.jsx("option",{value:String(a),children:a.toFixed(2)},a))})}),e.jsx(xe,{label:"Margins",children:e.jsx("select",{className:l,value:c.margins,onChange:a=>h({margins:a.target.value}),"aria-label":"Margins",children:Object.keys(Bt).map(a=>e.jsx("option",{value:a,children:Bt[a].label},a))})}),e.jsx(xe,{label:"Page",children:e.jsx("select",{className:l,value:c.page,onChange:a=>h({page:a.target.value}),"aria-label":"Page size",children:Object.keys(Ft).map(a=>e.jsx("option",{value:a,children:Ft[a].label},a))})}),i!=null&&e.jsxs("span",{className:"ml-auto text-xs tabular-nums text-muted-foreground",children:[i," page",i===1?"":"s"]})]})}function xe({label:s,children:n}){return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded border border-slate-300 bg-white px-2 py-1",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-slate-500",children:s}),n]})}const ta=96/72;function Qt({lines:s,typography:n,renderLine:i,breakAfter:u,className:c,caption:h}){const l=K(n??void 0),a=is(l),y=new Set(u??[]),m=o.useRef(null),v=ls(m,a.widthIn*ra),S={width:`${a.widthIn}in`,minHeight:`${a.heightIn}in`,paddingLeft:`${a.marginXIn}in`,paddingRight:`${a.marginXIn}in`,paddingTop:`${a.marginYIn}in`,paddingBottom:`${a.marginYIn}in`,fontFamily:la[l.font],lineHeight:l.lineHeight,background:"var(--resume-paper, #ffffff)",color:"var(--resume-ink, #111827)",boxShadow:"var(--resume-shadow, 0 1px 2px rgba(15,23,42,0.08), 0 8px 24px rgba(15,23,42,0.10))",borderRadius:"2px",boxSizing:"border-box",zoom:v};return e.jsxs("div",{ref:m,className:["resume-canvas",c??""].join(" "),style:aa,children:[h?e.jsx("div",{style:na,children:h}):null,e.jsx("div",{style:{...S,marginLeft:"auto",marginRight:"auto"},className:"resume-sheet",children:s.map((w,b)=>{const C=w.text.slice(w.marker.length),$=Math.max(0,w.boldPrefix-w.marker.length),M=$?e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontWeight:700},children:C.slice(0,$)}),C.slice($)]}):C,T=w.marker?e.jsxs("span",{style:{display:"flex",alignItems:"flex-start"},children:[e.jsx("span",{style:{flex:"none",width:`${Re}in`,whiteSpace:"pre"},children:w.marker}),e.jsx("span",{style:{flex:"1 1 auto",minWidth:0,whiteSpace:"pre-wrap"},children:M})]}):e.jsx("span",{style:{whiteSpace:"pre-wrap"},children:w.text?M:"Â "}
2),O=e.jsx("div",{style:{fontSize:`${w.size}pt`,fontWeight:w.bold?700:400,letterSpacing:w.tracked?"0.06em":void 0,marginTop:w.spaceBefore?`${Ws}pt`:void 0,paddingLeft:w.indent?`${w.marker?Ce-Re:Ce}in`:void 0,minHeight:`${w.size*l.lineHeight*ta}px`},children:i?i(w,b,T):T});return e.jsxs("div",{children:[O,y.has(b)?e.jsx(sa,{}):null]},b)})})]})}function sa(){return e.jsxs("div",{"aria-hidden":!0,style:oa,children:[e.jsx("span",{style:es}),e.jsx("span",{style:ia,children:"page break"}),e.jsx("span",{style:es})]})}const ra=96;function ls(s,n){const[i,u]=o.useState(1);return o.useLayoutEffect(()=>{const c=s.current;if(!c||typeof ResizeObserver>"u")return;const h=()=>{const a=getComputedStyle(c),y=c.clientWidth-parseFloat(a.paddingLeft)-parseFloat(a.paddingRight);u(y>0?Math.min(1,y/n):1)};h();const l=new ResizeObserver(h);return l.observe(c),()=>l.disconnect()},[s,n]),i}const aa={background:"var(--resume-canvas, #eef0f4)",padding:"24px",display:"flex",flexDirection:"column",alignItems:"flex-start",overflow:"auto"},na={width:"100%",maxWidth:"8.5in",marginLeft:"auto",marginRight:"auto",marginBottom:"8px",fontSize:"12px",letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--resume-canvas-ink, #64748b)"},oa={display:"flex",alignItems:"center",gap:"8px",margin:"14px 0",userSelect:"none"},es={flex:1,height:"1px",background:"var(--resume-break, #cbd5e1)"},ia={fontSize:"10px",letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--resume-break-ink, #94a3b8)"},la=Object.fromEntries(Object.keys(se).map(s=>[s,se[s].screen])),ts=s=>Math.max(0,Math.min(100,Math.round(s)));function da({value:s,previous:n,label:i,sublabel:u,size:c=96}){const h=ts(s),l=n==null?null:ts(n),a=l===null?null:h-l,y=Math.max(6,Math.round(c*.085)),m=(c-y)/2,v=c/2,S=270,w=2*Math.PI*m,b=S/360*w,C=h/100*b;return e.jsxs("div",{style:ca,children:[e.jsxs("svg",{width:c,height:c,viewBox:`0 0 ${c} ${c}`,role:"img","aria-label":`${h}% ${i}${l!==null?`, previously ${l}%`:""}`,children:[e.jsxs("g",{transform:`rotate(135 ${v} ${v})`,children:[e.jsx("circle",{cx:v,cy:v,r:m,fill:"none",stroke:"var(--gauge-track, #e2e8f0)",strokeWidth:y,strokeDasharray:`${b} ${w}`,strokeLinecap:"round"}),e.jsx("circle",{cx:v,cy:v,r:m,fill:"none",stroke:"var(--gauge-fill, #059669)",strokeWidth:y,strokeDasharray:`${C} ${w}`,strokeLinecap:"round"})]}),e.jsxs("text",{x:v,y:v,textAnchor:"middle",dominantBaseline:"central",style:{fontSize:`${c*.28}px`,fontWeight:600,fill:"currentColor"},className:"tabular-nums",children:[h,"%"]})]}),e.jsxs("div",{children:[e.jsx("div",{style:ua,children:i}),u?e.jsx("div",{style:ma,children:u}):null,l!==null?e.jsxs("div",{style:pa,className:"tabular-nums",children:["was ",l,"%",a!==null&&a!==0?e.jsxs("span",{style:ss,children:[" ",a>0?"+":"",a]}):e.jsx("span",{style:ss,children:" no change"})]}):null]})]})}const ca={display:"flex",alignItems:"center",gap:"16px"},ua={fontSize:"14px",fontWeight:500,lineHeight:1.3},ma={marginTop:"2px",fontSize:"12px",lineHeight:1.4,color:"var(--gauge-muted, #64748b)",maxWidth:"34ch"},pa={marginTop:"6px",fontSize:"12px",color:"var(--gauge-muted, #64748b)"},ss={fontWeight:500};function ha(s){const n=[];for(const i of s.rewrites)s.decisions[i.id]==="accepted"&&n.push(i);for(const i of s.additions){if(s.decisions[i.id]!=="accepted")continue;const u=s.placements[i.id];u!==void 0&&n.push({...i,start:u,end:u})}return zs(s.source,n)}function ds(s){const{applied:n}=ha(s),i=[];let u=0,c=0,h=0;for(const l of n){l.start>u&&i.push({kind:"unchanged",before:s.source.slice(u,l.start),after:s.source.slice(u,l.start)});const a=s.source.slice(l.start,l.end),y=l.start===l.end?"added":"rewritten";y==="added"?h+=1:c+=1,i.push({kind:y,before:a,after:l.replacementText,suggestionId:l.id}),u=l.end}if(u<s.source.length){const l=s.source.slice(u);i.push({kind:"unchanged",before:l,after:l})}return{rows:i,rewritten:c,added:h}}function xa(s,n=ds(s)){const i=n.rows.map(c=>c.before).join(""),u=n.rows.map(c=>c.after).join("");return i===s.source&&u===Xe(s)}const fa=new Set(["consistent","significant","excellent","relevant","efficient","important","different","sufficient","confident","competent","independent","transparent","frequent","current","recent","pleasant","constant","abundant","dominant","reliant","compliant","resilient"]);function fe(s,n=4){const i=[],u=h=>
2h.split(/\s+/).filter(Boolean),c=h=>{const l=new Set(u(h));return i.some(a=>u(a).some(y=>l.has(y)))};for(const h of[1,2])for(const l of s){if(i.length>=n)break;const a=u(l).length;(h===1?a<2:a!==1||l.length<7||fa.has(l))||i.includes(l)||c(l)||i.push(l)}return i.sort((h,l)=>s.indexOf(h)-s.indexOf(l))}function ga({open:s,onStay:n,onLeave:i,what:u="accepted changes that are not saved as a version"}){return e.jsx(cr,{open:s,onOpenChange:c=>{c||n()},children:e.jsxs(ur,{children:[e.jsxs(mr,{children:[e.jsx(pr,{children:"Leave without saving?"}),e.jsxs(hr,{children:["You have ",u,". If you leave now, they will not be kept."]})]}),e.jsxs(xr,{children:[e.jsx(fr,{onClick:n,children:"Cancel"}),e.jsx(gr,{onClick:i,children:"Leave"})]})]})})}const ba=Object.fromEntries(Object.keys(se).map(s=>[s,se[s].screen]));function rs(s,n){if(n<=0)return s;const i=[];let u=0;for(const c of s){const h=u+c.text.length;u<n&&n<h?i.push({...c,text:c.text.slice(0,n-u)},{...c,text:c.text.slice(n-u)}):i.push(c),u=h}return i}function ja(s,n,i){const u=rs(rs(s,n.length),i);let c=0;return u.map(h=>{const l=c;c+=h.text.length;const a=n.length>0&&l<n.length,y=i>0&&l>=n.length&&l<i;return a||y?{...h,cell:a,bold:y}:h})}function ya({text:s}){return e.jsx("span",{style:{whiteSpace:"pre"},children:s})}function as({seg:s}){return s.cell?e.jsx(ya,{text:s.text}):s.bold?e.jsx("span",{style:{fontWeight:700},children:s.text}):e.jsx(e.Fragment,{children:s.text})}function Je({terms:s}){return e.jsx("span",{className:"inline-flex flex-wrap gap-1 align-baseline",children:s.map(n=>e.jsx("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 text-[12px] font-medium text-amber-800 dark:text-amber-300",children:n},n))})}function Cn(){const s=Is("resume_enhance"),n=U(Kr),i=U(Jr),[u,c]=o.useState(""),[h,l]=o.useState(!1),[a,y]=o.useState(""),[m,v]=o.useState(null),[S,w]=o.useState(null),[b,C]=o.useState(null),[$,M]=o.useState([]),[T,O]=o.useState({}),P=s.loading,{applicationId:D,loadId:re,fromAts:Le}=Ds.useSearch(),ge=_s(),tt=U(Cr),st=U(Tr),be=U(Lr),cs=U(Ar),J=yr("resume_enhance"),[q,Ae]=o.useState(null),[us,De]=o.useState(null),[rt,_e]=o.useState(!1),[at,ms]=o.useState(null),[x,Ee]=o.useState(null),[N,ae]=o.useState(Hs),ps=U(Dr),nt=U(_r),[ot,hs]=o.useState(!1);o.useEffect(()=>{let t=!1;return ps().then(r=>{t||ae(Mt({version:x?.typography,userDefault:r.typography}))}).catch(()=>{}).finally(()=>{t||hs(!0)}),()=>{t=!0}},[]),o.useEffect(()=>{if(!ot||x)return;const t=setTimeout(()=>{nt({data:{typography:N}}).catch(()=>{})},600);return()=>clearTimeout(t)},[N,ot,x,nt]);const[it,I]=o.useState(""),k=o.useMemo(()=>m?Xe(m):"",[m]),f=o.useMemo(()=>m?Ve(m):null,[m]),W=o.useMemo(()=>Us(k),[k]),X=o.useMemo(()=>is(K(N)),[N]),xs=o.useMemo(()=>Gs(W,N),[W,N]),fs=t=>{if(t===void 0)return;let r=W.findIndex(d=>d.end>=t);r<0&&(r=W.length-1);for(let d=r;d>=0;d-=1){const p=W[d],j=p.text.trim();if(j){if(p.role)return`Adds under ${j}`;if(p.style==="heading")return`Adds to ${j}`}}return"Adds at the end of your resume"},[Pe,gs]=o.useState({});o.useEffect(()=>{if(!q?.length)return;let t=!1;return me(()=>import("./resume-pdf-BRIe_Z72.js"),__vite__mapDeps([0,1,2,3])).then(async({resumePageCount:r})=>{const d=[];for(const p of q){if(t)return;d.push([p.id,await r(p.text,K(p.typography))])}t||gs(Object.fromEntries(d))}).catch(()=>{}),()=>{t=!0}},[q]);const bs=o.useMemo(()=>!!x&&JSON.stringify(K(x.typography))!==JSON.stringify(N),[x,N]),[Z,ne]=o.useState(!1),[lt,js]=o.useState(null),[dt,ct]=o.useState(""),oe=o.useRef(null);o.useEffect(()=>{if(!(!Z||!m||!a))return oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>{i({data:{text:k,jobDescription:a}}).then(t=>{js(t),ct("")}).catch(t=>ct(t instanceof Error?t.message:"Could not build the report."))},300),()=>{oe.current&&clearTimeout(oe.current)}},[Z,k,a,m]);const ie=o.useRef(null);o.useEffect(()=>{if(!(!m||!a))return ie.current&&clearTimeout(ie.current),ie.current=setTimeout(()=>{n({data:{text:k,jobDescription:a}}).then(C).catch(()=>{})},250),()=>{ie.current&&clearTimeout(ie.current)}},[k,a,m,n]),o.useEffect(()=>{if(Le){try{const t=sessionStorage.getItem("atsHandoff");if(sessionStorage.removeItem("atsHandoff"),!t)return;const r=JSON.parse(t);if(!r.ts||Date.now()-r.ts>1800*1e3)return;
2r.resume&&c(Y(r.resume)),r.jobDescription&&y(r.jobDescription),(r.resume||r.jobDescription)&&Es.success("Loaded from ATS Scorer - resume and job description carried over")}catch{}ge({replace:!0,search:t=>{const{fromAts:r,...d}=t;return d}})}},[Le,ge]);const[ys,ut]=o.useState(!1);o.useEffect(()=>{if(D||re||Le)return;const t=Nr(kr(Ye()),{resume:"",jobDescription:""},"tailor");t.filled&&(c(r=>r.trim()?r:Y(t.resume)),y(r=>r.trim()?r:t.jobDescription),ut(!0),Sr(Ye(),"tailor"))},[]),o.useEffect(()=>{if(!D&&!re)return;let t=!1;return tt({data:{applicationId:D,resumeId:re}}).then(r=>{t||(r.resume&&re&&c(Y(r.resume)),r.jobDescription&&y(r.jobDescription))}).catch(()=>I("Could not open that application. Paste your resume to continue.")),()=>{t=!0}},[D,re,tt]),o.useEffect(()=>{let t=!1;return be({data:{applicationId:D}}).then(r=>{t||(De(r.available),Ae(r.available?r.versions:[]))}).catch(()=>{t||De(!1)}),()=>{t=!0}},[D,be]);const je=o.useRef(null),ye=o.useCallback(t=>{je.current=t;const r=t.source,d=Vs(r,t.additions);c(r),y(t.jobDescription),v(Ys(r,{anchored:t.rewrites,additions:d.additions,placements:d.placements})),w(t.startingRate),C(t.startingRate),O(t.coverageGains),M(t.discarded)},[]),mt=o.useCallback(async()=>{I("");try{const t=Y(u),r=await s.run({resume:t,jobDescription:a});ye(r)}catch(t){I(t instanceof Error?t.message:"Could not get suggestions.")}},[s,u,a,ye]);o.useEffect(()=>{s.result&&je.current!==s.result&&ye(s.result)},[s.result]);const vs=o.useCallback(async()=>{if(!(!m||!S)){_e(!0),I("");try{const t=Ks(m,{typography:N,jobId:D??"",matchRate:b?.rate??S.rate,startingMatchRate:S.rate}),r=Ot({text:Xe(m),jobDescription:a}),d=window.prompt("Name this version (optional):",r);if(d===null){_e(!1);return}const p=d.trim()&&d.trim()!==r?d.trim().slice(0,200):void 0,j=await st({data:{applicationId:D,title:p,jobDescription:a,text:t.text,sourceText:t.sourceText,matchRate:t.matchRate,startingMatchRate:t.startingMatchRate,rewritesAccepted:t.rewritesAccepted,additionsAccepted:t.additionsAccepted,acceptedSuggestionIds:t.acceptedSuggestionIds,replayable:t.replayable,typography:t.typography}});if(De(j.available),ms(t.text),j.available){const E=await be({data:{applicationId:D}});Ae(E.available?E.versions:[])}}catch(t){I(t instanceof Error?t.message:"Could not save this version.")}finally{_e(!1)}}},[m,S,b,D,st,be,N,a]),ws=o.useCallback(t=>{const r=m?Ve(m):null,d=r?r.rewrites.accepted+r.additions.accepted:0;d>0&&!window.confirm(`You have ${d} accepted change${d===1?"":"s"} that are not saved. Opening this version replaces them with its stored text. Continue?`)||(Ee(t),t.jobDescription&&y(t.jobDescription),ae(Mt({version:t.typography})),v(null),de(!1),ne(!1),Q(!1),I(""))},[m]),pt=o.useCallback(()=>{const t=x?x.text:k,r=new Blob([t],{type:"text/plain;charset=utf-8"}),d=URL.createObjectURL(r),p=document.createElement("a");p.href=d,p.download="resume-tailored.txt",p.click(),URL.revokeObjectURL(d)},[k,x]),[ht,xt]=o.useState(!1),ft=o.useCallback(async()=>{const t=x?x.text:k;xt(!0);try{const{buildResumeDocx:r}=await me(async()=>{const{buildResumeDocx:E}=await import("./resume-docx-DxYvd0Ei.js");return{buildResumeDocx:E}},__vite__mapDeps([4,1,2,3])),d=await r(t,N),p=URL.createObjectURL(d),j=document.createElement("a");j.href=p,j.download="resume-tailored.docx",j.click(),URL.revokeObjectURL(p)}catch{I("Could not build the Word file. The plain-text download still works.")}finally{xt(!1)}},[k,x,N]),[gt,bt]=o.useState(!1),jt=o.useCallback(async()=>{const t=x?x.text:k;bt(!0);try{const{buildResumePdf:r}=await me(async()=>{const{buildResumePdf:E}=await import("./resume-pdf-BRIe_Z72.js");return{buildResumePdf:E}},__vite__mapDeps([0,1,2,3])),{blob:d}=await r(t,N),p=URL.createObjectURL(d),j=document.createElement("a");j.href=p,j.download="resume-tailored.pdf",j.click(),URL.revokeObjectURL(p)}catch{I("Could not build the PDF. The Word and plain-text downloads still work.")}finally{bt(!1)}},[k,x,N]),[_,$e]=o.useState(null),[yt,vt]=o.useState(!1),[ve,we]=o.useState(null),Ie=2,Ns=o.useCallback(async()=>{const t=x?x.text:k;if(t){vt(!0),we(null);try{const{resumePagination:r}=await me(async()=>{const{resumePagination:d}=await import("./resume-pdf-BRIe_Z72.js");return{resumePagination:d}},__vite__mapDeps([0,1,2,3]));for(const d of Js(N)){const{pageCount:p}=await r(t,d);if(p<=Ie){const j=qs(N,d);j&&(ae(d),we(`Now ${p} page${p===1?"":"s"}: ${j}.`));return}}we(`Still over two pages at the tightest settings. The text is the only lever left: Edit text and cut the bullets that say least - the Report's "Bullets over two lines" is a good place to start.`)}catch{we("Could not paginate - try again.")}finally{vt(!1)}}},[x,k,N]),[wt,Be]=o.useState([]),Nt=o.useMemo(()=>new Set(wt),[wt]),ks=o.useMemo(()=>{const t=[];let r=[];for(let d=0;d<W.length;d+=1)Nt.has(d)&&r.length&&(t.push(r),r=[]),r.push(d);return(r.length||t.length===0)&&t.push(r),t},[W,Nt]),kt=o.useRef(null),St=ls(kt,X.widthIn*96),Ss=o.useMemo(()=>{const t=K(N);return{width:`${X.widthIn}in`,minHeight:`${X.heightIn}in`,padding:`${X.marginYIn}in ${X.marginXIn}in`,boxSizing:"border-box",background:"var(--resume-paper, #ffffff)",color:"var(--resume-ink, #111827)",boxShadow:"var(--resume-shadow, 0 1px 2px rgba(15,23,42,0.08), 0 8px 24px rgba(15,23,42,0.10))",borderRadius:"2px",fontFamily:ba[t.font],lineHeight:t.lineHeight,flex:"0 0 auto",marginLeft:"auto",marginRight:"auto",zoom:St}},[X,N,St]);o.useEffect(()=>{const t=x?x.text:k;if(!t){$e(null),Be([]);return}let r=!1;const d=setTimeout(()=>{me(async()=>{const{resumePagination:p}=await import("./resume-pdf-BRIe_Z72.js");return{resumePagination:p}},__vite__mapDeps([0,1,2,3])).then(({resumePagination:p})=>
2p(t,N)).then(({pageCount:p,breaks:j})=>{r||($e(p),Be(j))}).catch(()=>{r||($e(null),Be([]))})},250);return()=>{r=!0,clearTimeout(d)}},[k,x,N]);const Ne=S&&b?b.rate-S.rate:0,Fe=o.useMemo(()=>m?Wt(m):[],[m]),Rs=o.useMemo(()=>m?Xs(m):[],[m]),Me=o.useMemo(()=>m?Zs(m):[],[m]),Cs=o.useMemo(()=>Object.fromEntries(Me.map(t=>[t.id,t.at])),[Me]),[le,de]=o.useState(!1),[G,Q]=o.useState(!1),[ke,Rt]=o.useState(""),[V,Ct]=o.useState(!1),Tt=o.useMemo(()=>{if(!m||G)return!1;const t=Ve(m);return(t.rewrites.accepted+t.additions.accepted>0||V)&&k!==at},[m,G,V,k,at]),Oe=Mr({shouldBlockFn:()=>Tt,enableBeforeUnload:Tt,withResolver:!0}),z=o.useMemo(()=>m&&le?ds(m):null,[m,le]),[B,Lt]=o.useState(null),ee=o.useRef(new Map),H=o.useRef(new Map),ce=(t,r)=>d=>{d?t.current.set(r,d):t.current.delete(r)},F=o.useCallback((t,r)=>{Lt(r);const d=t.current.get(r);if(!d)return;const p=d.closest("[data-scroll-pane]")??d.parentElement,j=(()=>{if(!p)return!0;const E=d.getBoundingClientRect(),Se=p.getBoundingClientRect();return E.top>=Se.top+24&&E.bottom<=Se.bottom-24})();d.scrollIntoView({block:j?"nearest":"center",behavior:"smooth"})},[]);o.useEffect(()=>{if(!B)return;const t=setTimeout(()=>Lt(null),3e3);return()=>clearTimeout(t)},[B]);const At=!!f&&f.rewrites.accepted===0&&f.additions.accepted===0,Ts=[f?.rewrites.total?`${f.rewrites.total} rewrite${f.rewrites.total===1?"":"s"}`:"",f?.additions.total?`${f.additions.total} addition${f.additions.total===1?"":"s"}`:""].filter(Boolean).join(", "),Dt=[f?.rewrites.pending?`${f.rewrites.pending} rewrite${f.rewrites.pending===1?"":"s"}`:"",f?.additions.pending?`${f.additions.pending} addition${f.additions.pending===1?"":"s"}`:""].filter(Boolean).join(", "),ue=t=>String(t).replace(/\B(?=(\d{3})+(?!\d))/g,","),_t=(t,r)=>{const d=t.trim().length,p=t.length>=r,j=d>=he;return{className:`mt-1 text-[11px] ${p?"text-amber-600 font-medium":j?"text-emerald-500":"text-muted-foreground"}`,label:p?`At the ${ue(r)}-character limit - anything longer was not pasted.`:j?`â Looks good - ${ue(d)} / ${ue(r)} characters`:`Minimum ${he} characters (${ue(d)} so far) - limit ${ue(r)}`}},Et=_t(u,Ke),Pt=_t(a,Jt),We=o.useCallback(()=>{const t=(x?x.text:k)||u,r=x&&x.jobDescription||a;if(!t.trim()&&!r.trim())return;const d=JSON.stringify({resume:t,jobDescription:r,ts:Date.now()});try{sessionStorage.setItem("coverLetterHandoff",d),sessionStorage.setItem("interviewPrepHandoff",d)}catch{}},[x,k,u,a]),Ls=!!(x&&x.jobDescription||a.trim()),$t=(m||x)&&e.jsxs("div",{className:"rounded-lg border border-primary/30 bg-primary/5 p-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-sm mb-1",children:"Ready to apply with this version?"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:Ls?"Write a cover letter for this job next. Your tailored resume and the job description carry over - no re-pasting. Interview Prep picks them up the same way.":"Write a cover letter next. Your tailored resume carries over; this version was saved without its job description, so paste the job on the next page."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs(Ge,{to:"/tools/cover-letter",onClick:We,className:"inline-flex items-center rounded-md bg-blue-600 px-3 py-2 text-sm font-semibold text-white hover:bg-blue-700",children:[e.jsx(Ir,{className:"size-4 mr-2"}),"Write a cover letter"]}),e.jsx(Ge,{to:"/tools/interview-prep",onClick:We,className:"text-sm font-medium text-primary hover:underline",children:"or prepare for the interview â"})]})]}),ze=q&&q.length>0&&e.jsxs("div",{className:"rounded border p-3",children:[e.jsx("div",{className:"text-xs uppercase text-muted-foreground",children:"Saved versions"}),e.jsx("ul",{className:"mt-2 space-y-1 text-sm",children:q.map(t=>{const r=zt(t);return e.jsxs("li",{className:"flex items-start gap-1",children:[e.jsxs("button",{type:"button",onClick:()=>ws(t),className:["flex min-w-0 flex-1 flex-wrap items-baseline gap-x-3 gap-y-1 rounded px-2 py-1 text-left hover:bg-muted/60",x?.id===t.id?"bg-muted":""].join(" "),children:[e.jsx("span",{className:"font-medium",children:Ot(t)}),e.jsx("span",{className:"tabular-nums text-muted-foreground",children:new Date(t.createdAt).toLocaleStr
2ing()}),e.jsxs("span",{className:"text-muted-foreground",children:[r.rewrites," rewrites, ",r.additions," additions",r.delta!==0?` · ${r.delta>0?"+":""}${r.delta} points`:"",r.edited?" · edited by hand":""]}),e.jsx("span",{className:"text-muted-foreground tabular-nums",children:r.typography}),Pe[t.id]!=null&&e.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[Pe[t.id]," page",Pe[t.id]===1?"":"s"]})]}),e.jsx("button",{type:"button","aria-label":"Delete this version",title:"Delete this version",className:"mt-1 rounded p-1 text-muted-foreground hover:bg-muted hover:text-destructive",onClick:async()=>{if(window.confirm("Delete this saved version? This cannot be undone."))try{await cs({data:{id:t.id}}),Ae(p=>(p??[]).filter(j=>j.id!==t.id)),x?.id===t.id&&Ee(null)}catch(p){I(p instanceof Error?p.message:"Could not delete this version.")}},children:e.jsx(Ps,{className:"size-3.5"})})]},t.id)})})]});return e.jsxs(ar,{toolKey:"resume-enhancer",onNextStep:We,title:"Resume Tailor",description:"Suggestions against a job description. Your text stays your text - nothing is rebuilt.",whatYouGet:["Rewrites you approve one at a time","New bullets, each citing your own experience","A match rate that moves as you accept","A report: keywords, searchability, writing","Download as .docx or PDF"],children:[e.jsx(ga,{open:Oe.status==="blocked",onStay:()=>Oe.reset?.(),onLeave:()=>Oe.proceed?.()}),!m&&!x&&e.jsxs(e.Fragment,{children:[e.jsx(jr,{steps:["Add your resume and the target job description","Approve the suggestions you want","Download your tailored resume"]}),ys&&e.jsx(wr,{onClear:()=>{Rr(Ye()),c(""),y(""),ut(!1)}}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-y-2 md:grid-cols-2 md:grid-rows-[auto_1fr] md:gap-x-6 md:gap-y-0 items-start",children:[e.jsxs("div",{className:"order-1 md:order-1",children:[e.jsxs(Kt,{htmlFor:"tailor-resume",className:"flex items-center gap-2",children:[e.jsx("span",{className:"inline-flex size-5 items-center justify-center rounded-full bg-blue-600 text-white text-[11px] font-semibold",children:"1"}),"Your resume",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-1.5",children:[e.jsx(nr,{onText:t=>c(Y(t)),onMultiColumn:l}),e.jsx(or,{onLoad:t=>c(Y(t)),onLoadJd:t=>a.trim()?!1:(y(t),!0)}),e.jsx(ir,{onLoad:t=>c(Y(t))}),e.jsx(lr,{className:"ml-1"})]})]}),e.jsxs("div",{className:"order-3 md:order-2",children:[e.jsxs(Kt,{htmlFor:"tailor-jd",className:"flex items-center gap-2",children:[e.jsx("span",{className:"inline-flex size-5 items-center justify-center rounded-full bg-blue-600 text-white text-[11px] font-semibold",children:"2"}),"Job description",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx("div",{className:"flex items-center gap-2 mt-1.5 min-h-8",children:e.jsx(dr,{applicationId:D,onPick:t=>ge({search:r=>({...r,applicationId:t})}),onClear:()=>{y(""),ge({search:t=>{const{applicationId:r,...d}=t;return d}})},variant:"inline"})})]}),e.jsxs("div",{className:"order-2 md:order-3 flex flex-col",children:[e.jsx(Yt,{id:"tailor-resume",required:!0,rows:16,value:u,onChange:c,maxLength:Ke,placeholder:"Upload a PDF, DOCX or TXT above, or paste your resume text here"}),e.jsx("p",{className:Et.className,children:Et.label}),e.jsx(vr,{show:h,onDismiss:()=>l(!1),editHint:"the box above"})]}),e.jsxs("div",{className:"order-4 md:order-4 flex flex-col",children:[e.jsx(Yt,{id:"tailor-jd",required:!0,rows:16,value:a,onChange:y,maxLength:Jt,placeholder:"Paste the job description"}),e.jsx("p",{className:Pt.className,children:Pt.label})]})]}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(pe,{type:"button",size:"lg",className:"px-6 bg-blue-600 text-white hover:bg-blue-700 font-semibold",disabled:P||u.trim().length<he||a.trim().length<he,onClick:mt,children:P?e.jsxs(e.Fragment,{children:[e.jsx($s,{className:"size-4 mr-2 animate-spin"}),"Workingâ¦"]}):e.jsxs(e.Fragment,{children:[e.jsx(Er,{className:"size-4 mr-2"}),"Get Suggestions"]})}),J!==null&&Number.isFinite(J)&&e.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums text-center","data-testid":"tailor-remaining",children:[J===0?"No tailored resumes left in this period":`${J} tailored ${J===1?"resume":"resumes"} left in this period`,J<=1&&e.jsxs(e.Fragment,{children:[" · ",e.jsx(Ge,{to:"/pricing",className:"text-primary hover:underline",children:"Get more"})]})]})]}),e.jsx(br,{loading:P,defaultMessage:"Tailoring your resumeâ¦",steps:[{label:"Reading your resume"},{label:"Comparing it against the job description",estimate:"~5 sec"},{label:"Drafting suggestions, role by role",estimate:"~20 sec"},{label:"Checking every suggestion against your own words",estimate:"~5 sec"},{label:"Placing them and scoring the match",estimate:"~5 sec"}],pollStale:s.pollStale,onCheckNow:s.checkNow,checking:s.checking,resumable:!0}),e.jsx(Bs,{loading:P,messages:["Reading your resumeâ¦","Comparing it against the job descriptionâ¦","Drafting suggestionsâ¦","Checking every suggestion against your own wordsâ¦","Placing them and scoring the matchâ¦"],suffix:"Usually under a minute; a long resume can take longer. You can leave this page - your result will be here when you come back."}),it&&e.jsx("p",{className:"text-sm text-destructive",children:it}
2),e.jsx(Fs,{open:s.timedOut,onClose:s.dismissTimeout,onRetry:()=>{s.dismissTimeout(),mt()}})]}),ze]}),x&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-4 rounded border p-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-semibold tabular-nums",children:[x.startingMatchRate,"%",e.jsx("span",{className:"mx-2 text-base font-normal text-muted-foreground",children:"->"}),x.matchRate,"%"]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["saved ",new Date(x.createdAt).toLocaleString()," · ",x.rewritesAccepted," ","rewrites, ",x.additionsAccepted," additions",x.replayable?"":" · edited by hand"," · ",zt(x).typography]}),bs&&e.jsx("div",{className:"mt-1 inline-flex items-center gap-1.5 rounded border border-amber-300 bg-amber-50 px-2 py-0.5 text-xs text-amber-900",children:"Changed layout - not saved. Download gives you what is on screen; Save creates a new version."})]}),e.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[e.jsx(os,{docxBusy:ht,pdfBusy:gt,onDocx:ft,onPdf:jt,onTxt:pt}),e.jsx(pe,{size:"sm",variant:"ghost",onClick:()=>Ee(null),children:"Close"})]}),e.jsx(Zt,{value:N,onChange:ae,pages:_,className:"mt-3 w-full rounded border p-2"})]}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsx("div",{className:"overflow-hidden rounded border",children:e.jsx(Qt,{caption:"Tailored, as saved",lines:Ht(x.text,x.typography),typography:x.typography,className:"max-h-[70vh]"})}),e.jsx("div",{className:"overflow-hidden rounded border",children:e.jsx(Qt,{caption:"What it was tailored from",lines:Ht(x.sourceText,x.typography),typography:x.typography,className:"max-h-[70vh]"})})]}),ze,$t]}),m&&f&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-4 roun
2ded border p-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"flex flex-wrap items-baseline gap-3",children:e.jsx(da,{value:b?.rate??S?.rate??0,previous:S?S.rate:null,label:"keyword coverage",sublabel:"Against this job description only. Real ATS implementations also weight frequency, section and recency; this measures none of those."})}),e.jsx("div",{className:"text-xs text-muted-foreground",children:At?f.rewrites.total+f.additions.total>0?`${Ts} ready to review`:"nothing to change - your resume already fits this role":[f.rewrites.accepted?`${f.rewrites.accepted} rewrite${f.rewrites.accepted===1?"":"s"} applied`:"",f.additions.accepted?`${f.additions.accepted} addition${f.additions.accepted===1?"":"s"} added`:"",Dt?`${Dt} still to review`:""].filter(Boolean).join(" · ")}),_!==null&&e.jsxs("div",{className:"mt-0.5 text-xs text-muted-foreground tabular-nums",children:[_," page",_===1?"":"s"]}),_!==null&&_>Ie&&e.jsxs("div",{className:"mt-2 max-w-xl rounded-r border-l-[3px] border-amber-500 bg-amber-500/10 px-2.5 py-2 text-[13px]","data-testid":"tailor-pages-warning",children:[e.jsxs("b",{className:"font-semibold",children:[_," pages."]})," Most recruiters want two."," ",e.jsx("button",{type:"button",className:"underline underline-offset-2 disabled:opacity-50",disabled:yt,onClick:()=>{Ns()},children:yt?"Tryingâ¦":"Fit to 2 pages"})," ","tries tighter spacing, margins, size and face in that order, or use Edit text to cut bullets.",ve&&e.jsx("div",{className:"mt-1 text-muted-foreground",children:ve})]}),_!==null&&_<=Ie&&ve&&e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:ve}),V&&e.jsx("div",{className:"mt-0.5 text-xs text-muted-foreground",children:"Edited by hand - earlier accepted changes are now part of the text. Reset to original returns to the resume you uploaded."}),!At&&b&&b.missing.length>0&&(Ne===0?e.jsxs("div",{className:"mt-2 max-w-xl rounded-r border-l-[3px] border-amber-500 bg-amber-500/10 px-2.5 py-2 text-[13px]","data-testid":"tailor-gap",children:[e.jsxs("b",{className:"font-semibold",children:["The ",100-b.rate,"% not covered:"]})," ",e.jsx(Je,{terms:fe(b.missing)}),b.missing.length>fe(b.missing).length?" and others":""," - terms this job uses that your resume doesn't mention. Rewrites can only use what's already in your resume. If you have that experience, add a line under the role it belongs to and the rate moves."]}):e.jsxs("div",{className:"mt-1.5 text-xs text-muted-foreground","data-testid":"tailor-gap",children:["Still not covered:"," ",e.jsx(Je,{terms:fe(b.missing)}),b.missing.length>fe(b.missing).length?" and others":""]}))]}),e.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-x-4 gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs(pe,{size:"sm",disabled:!f.rewrites.pending,onClick:()=>{const t=Qs(m);v(t);const r=Wt(t)[0];r&&requestAnimationFrame(()=>F(ee,r.id))},children:[e.jsx(Wr,{className:"size-4 mr-1.5"}),"Accept all rewrites (",f.rewrites.pending,")"]}),e.jsxs(pe,{size:"sm",variant:"ghost",title:V?"Back to the resume you uploaded, with every suggestion":"Set every suggestion back to undecided",onClick:()=>{if(!V||!je.current){v(er(m));return}window.confirm("Reset discards your edits and every accepted change and returns to the resume you uploaded, with all suggestions back. Continue?")&&(ye(je.current),Ct(!1),Q(!1),de(!1),ne(!1),M(r=>r.filter(d=>d.reason!=="no longer fit after your edit")))},children:[e.jsx(Yr,{className:"size-4 mr-1.5"}),V?"Reset to original":"Reset"]})]}),e.jsxs("div",{className:"flex items-center rounded-md border border-slate-200 bg-slate-100/70 p-0.5",role:"group","aria-label":"View",children:[e.jsx(qe,{active:le,primary:!le&&Fe.length>0,icon:Hr,label:le?"Back to suggestions":"Compare",onClick:()=>{ne(!1),de(t=>!t)}}),e.jsx(qe,{active:Z,icon:Pr,label:Z?"Back to suggestions":"Report",onClick:()=>{de(!1),ne(t=>!t)}}),e.jsx(qe,{active:G,icon:$r,label:G?"Cancel edit":"Edit text",onClick:()=>{if(G){Q(!1);return}Rt(k),de(!1),ne(!1),Q(!0)}})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[us!==!1&&e.jsxs(pe,{size:"sm",variant:"outline",disabled:rt||!m,onClick:vs,title:"Keep this version in your History. Unsaved results are removed after 24 hours.",children:[e.jsx(Gr,{className:"size-4 mr-1.5"}),rt?"Savingâ¦":"Save version"]}),e.jsx(os,{docxBusy:ht,pdfBusy:gt,onDocx:ft,onPdf:jt,onTxt:pt})]})]})]}),e.jsx(Zt,{value:N,onChange:ae,pages:_,className:"rounded border p-2"}),e.jsxs("p",{className:"-mt-2 text-xs text-muted-foreground",children:["Classic layout - the font, size, spacing and margins above apply to the screen and every download. More templates are coming.",N.font==="garamond"&&e.jsxs(e.Fragment,{children:[" ","Garamond: the screen and the PDF use EB Garamond; Word's own Garamond runs slightly narrower, so the page count in Word can differ by a line."]})]}),G&&e.jsxs("div",{className:"space-y-3 rounded border p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase text-muted-foreground",children:"Edit your resume"}),e.jsx("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:"Change anything - add a line for a term that isn't covered, fix a date, cut a bullet. Saving makes this the document: accepted changes stay in and can no longer be und
2one one by one; suggestions you haven't decided on are kept where they still fit. Punctuation is kept plain for ATS and recruiters: dashes used as pauses become commas, curly quotes become straight."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{className:"rounded border px-3 py-2 text-sm",onClick:()=>Q(!1),children:"Cancel"}),e.jsx("button",{className:"rounded bg-primary px-3 py-2 text-sm text-primary-foreground disabled:opacity-50",disabled:ke.trim().length<he||ke===k,onClick:()=>{if(!m)return;const t=tr(m,ke);v(t.session),Ct(!0),Q(!1),t.dropped>0&&M(r=>[...r,{reason:"no longer fit after your edit",count:t.dropped}])},children:"Save changes"})]})]}),e.jsx("textarea",{value:ke,onChange:t=>Rt(t.target.value),spellCheck:!0,className:"min-h-[70vh] w-full resize-y rounded border bg-background p-4 font-serif text-[14px] leading-[1.5]",maxLength:Ke,"aria-label":"Resume text"})]}),z&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-4 rounded border p-3",children:[e.jsxs("div",{className:"text-2xl font-semibold tabular-nums",children:[S?.rate??0,"%",e.jsx("span",{className:"mx-2 text-base font-normal text-muted-foreground",children:"â"}),b?.rate??S?.rate??0,"%"]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["match rate",Ne!==0?` · ${Ne>0?"+":""}${Ne} points`:""]})]}),e.jsxs("div",{className:"flex flex-wrap items-baseline gap-3 text-sm text-muted-foreground",children:[e.jsxs("span",{children:[z.rewritten," rewritten, ",z.added," added"]}),!xa(m,z)&&e.jsx("span",{className:"text-destructive",children:"This comparison does not reproduce your document. Do not trust it - reset and try again."})]}),z.rewritten===0&&z.added===0?e.jsxs("div",{className:"rounded border p-4",children:[e.jsx("p",{className:"font-medium",children:"Nothing has changed yet."}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["Your document is exactly as you uploaded it, so both sides of this comparison would be identical."," ",f&&f.rewrites.pending>0?`Accept a rewrite - there ${f.rewrites.pending===1?"is":"are"} ${f.rewrites.pending} waiting - and the difference shows here.`:"Accept a suggestion and the difference shows here."]})]}):e.jsx("div",{className:"grid gap-4 lg:grid-cols-2",children:["before","after"].map(t=>e.jsxs("div",{className:"rounded border p-4",children:[e.jsx("div",{className:"mb-2 text-xs uppercase text-muted-foreground",children:t==="before"?"Your original":"Tailored"}),e.jsx("div",{className:"max-h-[70vh] overflow-auto whitespace-pre-wrap text-[15px] leading-[1.65]",children:z.rows.map((r,d)=>{const p=r[t];return p?e.jsx("span",{className:r.kind==="unchanged"?"":t==="before"?"bg-rose-500/15 ring-1 ring-rose-500/25":"bg-emerald-500/20 ring-1 ring-emerald-500/30",children:p},d):null})})]},t))})]}),Z&&e.jsx("div",{className:"space-y-3",children:lt?e.jsx(ea,{report:lt,pages:_}):dt?e.jsx("p",{className:"text-sm text-destructive",children:dt}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Building the reportâ¦"})}),e.jsxs("div",{className:z||Z||G?"hidden":"grid gap-4 lg:grid-cols-[minmax(0,1fr)_390px]",children:[e.jsxs("div",{className:"rounded border p-4",children:[e.jsx("div",{className:"mb-2 text-xs uppercase text-muted-foreground",children:"Your resume"}),e.jsx("div",{ref:kt,className:"max-h-[70vh] overflow-auto","data-scroll-pane":!0,style:{background:"var(--resume-canvas, #eef0f4)",padding:"24px",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"24px"},children:ks.map((t,r)=>e.jsx("div",{style:Ss,children:t.map(d=>{const p=W[d],j=Rs.filter(g=>g.end>p.start&&g.start<p.end),E=Me.filter(g=>g.at===p.end),Se=B!==null&&j.some(g=>g.id===B);return e.jsxs("div",{children:[e.jsxs("div",{className:["relative rounded-sm transition-colors duration-300",Se?"bg-sky-200/70 ring-2 ring-sky-400/80":""].join(" "),children:[j.map(g=>e.jsx("span",{ref:ce(ee,g.id),role:"button",tabIndex:0,title:"Show this suggestion",onClick:()=>F(H,g.id),onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),F(H,g.id))},className:["absolute -left-3 top-1 bottom-1 cursor-pointer rounded transition-colors",B===g.id?"w-[4px] bg-sky-600":"w-[2px] bg-muted-foreground
2/35 hover:bg-muted-foreground/70"].join(" ")},g.id)),(()=>{const g=xs[d],L=p.text?ja(sr(p.text,p.start,Fe),g.marker,g.boldPrefix):[],He=(A,te)=>A.markId?e.jsx("mark",{ref:Fe.some(R=>R.id===A.markId&&R.start>=p.start&&R.start<=p.end)?ce(ee,A.markId):void 0,role:"button",tabIndex:0,title:"Show this suggestion",onClick:()=>F(H,A.markId),onKeyDown:R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),F(H,A.markId))},className:["cursor-pointer rounded-sm px-0.5 text-inherit decoration-emerald-600/60 underline-offset-4 ring-1 transition-colors",B===A.markId?"bg-emerald-500/55 ring-emerald-600/80":"bg-emerald-500/35 underline decoration-2 ring-emerald-500/50 hover:bg-emerald-500/45"].join(" "),children:e.jsx(as,{seg:A})},te):e.jsx("span",{children:e.jsx(as,{seg:A})},te),It={fontSize:`${g.size}pt`,fontWeight:g.bold?700:400,letterSpacing:g.tracked?"0.06em":void 0,marginTop:g.spaceBefore?"8pt":void 0,minHeight:`${g.size*1.334}px`};if(g.indent&&g.marker){const A=L.filter(R=>R.cell),te=L.filter(R=>!R.cell);return e.jsxs("div",{style:{...It,display:"flex",alignItems:"flex-start",paddingLeft:`${Ce-Re}in`},children:[e.jsx("span",{style:{flex:"none",width:`${Re}in`,whiteSpace:"pre"},children:A.map((R,Ue)=>He(R,Ue))}),e.jsx("span",{style:{flex:"1 1 auto",minWidth:0,whiteSpace:"pre-wrap"},children:te.map((R,Ue)=>He(R,Ue))})]})}return e.jsx("div",{style:{...It,whiteSpace:"pre-wrap",paddingLeft:g.indent?`${Ce}in`:void 0},children:L.length?L.map((A,te)=>He(A,te)):"Â "})})()]}),E.map(g=>e.jsx("div",{ref:ce(ee,g.id),role:"button",tabIndex:0,title:"Show this suggestion",onClick:()=>F(H,g.id),onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),F(H,g.id))},className:["my-1 cursor-pointer border-l-2 border-dashed py-0.5 pl-3 italic transition-colors",B===g.id?"border-emerald-500 bg-emerald-500/10 text-foreground":"border-emerald-500/50 text-muted-foreground hover:bg-muted/50"].join(" "),children:g.text.replace(/^\n/,"")},g.id))]},d)})},r))})]}),e.jsxs("div",{className:"space-y-3",children:[f.rewrites.total===0&&f.additions.total===0&&e.jsxs("div",{className:"rounded border p-4",children:[V?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"font-medium",children:"Nothing left to review."}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Your accepted changes and your edits are in the text. Download it, save a version, edit again, or Reset to original to start over from the resume you uploaded."})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"font-medium",children:"No changes suggested."}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["Your resume already aligns well with this role - it matches"," ",b?.rate??0,"% of what the job description asks for, and nothing here would read better rewritten. Your document is unchanged."]})]}),b?.missing?.length?e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Still not covered, most-asked first: ",e.jsx(Je,{terms:fe(b.missing,6)})]}):null]}),e.jsx(ns,{heading:`Rewrites (${f.rewrites.accepted}/${f.rewrites.total} accepted)`,items:m.rewrites.map(t=>({id:t.id,before:m.source.slice(t.start,t.end),after:t.replacementText,rationale:t.rationale,coverageGain:T[t.id]})),session:m,onAccept:t=>v(Vt(m,t)),onReject:t=>v(Gt(m,t)),onReset:t=>v(Ut(m,t)),registerCard:t=>ce(H,t),onReveal:t=>F(ee,t),focused:B}),m.additions.length>0&&e.jsx(ns,{heading:`New content (${f.additions.accepted}/${f.additions.total} accepted)`,note:"Not included in Accept all - this is content you did not write, so it is added only where you put it.",items:m.additions.map(t=>({id:t.id,before:"",after:t.replacementText,rationale:t.rationale,coverageGain:T[t.id],placement:fs(Cs[t.id]),blocked:m.placements[t.id]===void 0?"This is a skill, not a bullet. Choosing where it goes is not built yet.":void 0})),session:m,acceptLabel:"Add",onAccept:t=>v(Vt(m,t)),onReject:t=>v(Gt(m,t)),onReset:t=>v(Ut(m,t)),registerCard:t=>ce(H,t),onReveal:t=>F(ee,t),focused:B}),$.length>0&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[$.map(t=>`${t.count} ${t.reason}`).join(", ")," - discarded before you saw them."]}),!rr(m)&&e.jsx("p",{className:"text-sm text-destructive",children:"The document no longer matches the accepted changes. Reset before downloading."})]})]}),ze,$t]})]})}function ns(s){return e.jsxs("div",{className:"rounded border p-4",children:[e.jsx("div",{className:"text-xs uppercase text-muted-foreground",children:s.heading}),s.note&&e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:s.note}),e.jsx("ul",{className:"mt-3 max-h-[60vh] space-y-3 overflow-auto scroll-smooth","data-scroll-pane":!0,children:s.items.map(n=>{const i=s.session.decisions[n.id]??"pending";return e.jsxs("li",{ref:s.registerCard(n.id),onClick:()=>s.onReveal(n.id),className:["cursor-pointer rounded border p-3 text-sm transition-colors",s.focused===n.id?"border-emerald-500 bg-emerald-500/5":"hover:border-muted-foreground
2/40"].join(" "),children:[n.before&&e.jsx("div",{className:"text-muted-foreground line-through",children:n.before}),e.jsx("div",{className:"mt-1",children:n.after}),n.placement&&e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:n.placement}),n.coverageGain!==void 0&&n.coverageGain>0&&e.jsx("div",{className:"mt-1.5",children:e.jsxs("span",{className:"rounded bg-emerald-500/15 px-1.5 py-0.5 text-[11px] font-medium tabular-nums text-emerald-700 dark:text-emerald-400",children:["+",n.coverageGain," pts match"]})}),n.rationale&&e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:n.rationale}),n.blocked&&e.jsx("div",{className:"mt-1 text-xs text-amber-600",children:n.blocked}),e.jsx("div",{className:"mt-2 flex gap-2 text-xs",children:i==="pending"?e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"rounded bg-primary px-2.5 py-1 font-medium text-primary-foreground shadow-sm transition-colors hover:bg-primary/90 disabled:opacity-40",disabled:!!n.blocked,title:n.blocked,onClick:u=>{u.stopPropagation(),s.onAccept(n.id)},children:s.acceptLabel??"Accept"}),e.jsx("button",{className:"rounded px-2 py-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:u=>{u.stopPropagation(),s.onReject(n.id)},children:"Reject"})]}):e.jsx("button",{className:"rounded border px-2 py-1",onClick:u=>{u.stopPropagation(),s.onReset(n.id)},children:i==="accepted"?"Accepted - undo":"Rejected - undo"})})]},n.id)})})]})}function qe({active:s,primary:n=!1,icon:i,label:u,onClick:c}){return e.jsxs("button",{type:"button","aria-pressed":s,onClick:c,className:["inline-flex h-7 items-center gap-1.5 rounded px-2.5 text-xs font-medium transition-colors",s?"bg-white text-primary shadow-sm ring-1 ring-primary/40":n?"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90":"text-slate-600 hover:bg-white hover:text-slate-900"].join(" "),children:[e.jsx(i,{className:"size-3.5"}),u]})}function os({docxBusy:s,pdfBusy:n,onDocx:i,onPdf:u,onTxt:c}){const h="h-8 px-3 text-xs font-semibold text-slate-900 hover:bg-slate-50 disabled:opacity-50 border-l border-slate-200";return e.jsxs("div",{className:"inline-flex items-stretch overflow-hidden rounded-md border border-slate-200 bg-white shadow-sm",role:"group","aria-label":"Download",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-slate-100/80 px-2.5 text-[11px] font-semibold uppercase tracking-wide text-slate-600",children:[e.jsx(Br,{className:"size-3.5"}),"Download"]}),e.jsx("button",{type:"button",className:h,disabled:s,onClick:i,children:s?"Buildingâ¦":"Word .docx"}),e.jsx("button",{type:"button",className:h,disabled:n,onClick:u,children:n?"Buildingâ¦":"PDF"}),e.jsx("button",{type:"button",className:h,onClick:c,children:"Text"})]})}export{Cn 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.