import{i as e}from"./chunk-B3pr0VN8.js";import{n as t,t as n}from"./jsx-runtime-wTfS3W87.js";import{u as r}from"./chunk-6CSD65Y2-Dj7xjS5D.js";import{i}from"./appConfig-CuVl6yRs.js";import{r as a}from"./norm-CeclA1Tu.js";import{t as o}from"./exportDomPng-BDWMk3SC.js";import{r as s}from"./ToolConversationUI-SaFaLfJ7.js";import{n as c,r as l,t as u}from"./FallbackNoticeCard-B3WK5QL2.js";import{n as d}from"./toolSkillSummary-B3044xDN.js";import{readResumeReportSession as f}from"./resumeReportSessions-Cp1MWWCE.js";var p=e(t(),1),m=n(),h=e=>String(e||``).split(/(【待补充：[^】]{1,120}】|\[(?:NAME|GENDER|AGE|BIRTH|PHONE|EMAIL|HUKOU|POLITICAL|ETHNICITY|RELIGION|HEALTH|ADDRESS|WECHAT|QQ|WEIBO|XHS|DOUYIN|KUAISHOU|PASSPORT|DRIVER_LICENSE|EMERGENCY_CONTACT|ID|BANK|URL|FILE)\])/g).map((e,t)=>e?e.startsWith(`【待补充：`)||e.startsWith(`[`)&&e.endsWith(`]`)?(0,m.jsx)(`span`,{className:`text-red-700 font-semibold`,children:e},t):(0,m.jsx)(`span`,{children:e},t):null),g=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0},_=e=>{let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}},v=(e,t)=>(Array.isArray(e)?e:[]).map(e=>String(e??``).trim()).filter(Boolean).slice(0,Math.max(0,Math.min(30,t))).join(`
`),y=({jobId:e,text:t,active:n,onDone:r})=>{let[i,a]=(0,p.useState)(``),o=(0,p.useRef)(``),s=(0,p.useRef)(null),c=(0,p.useRef)(0),l=(0,p.useRef)(null),u=(0,p.useRef)(!1);(0,p.useEffect)(()=>{let i=String(t||``),d=i!==o.current;if(!n){d&&(o.current=i),s.current&&window.clearTimeout(s.current),s.current=null,c.current=i.length,u.current=!0,a(i);return}if(!i.trim()){o.current=i,s.current&&window.clearTimeout(s.current),s.current=null,c.current=0,u.current=!0,a(``);return}if(!d)return;o.current=i,a(``),s.current&&window.clearTimeout(s.current),s.current=null,c.current=0,u.current=!1,l.current=_(g(`${String(e||``)}::${i.length}`)^2654435769);let f=()=>l.current?l.current():Math.random(),p=(e,t)=>{let n=String(e||``).trim(),r=/^[-•]\s+/.test(n)||/^\d+\.\s+/.test(n),i=t===0&&n.length<=28&&!r;return{isBullet:r,isTitle:i,isHeading:!r&&!i&&n.length<=18&&(/[：:]$/.test(n)||/^[\u4e00-\u9fa5A-Za-z0-9 ]+$/.test(n))}},m=e=>{let t=i.slice(0,Math.max(0,Math.min(i.length,e))).split(`
`),n=Math.max(0,t.length-1);return{line:t[n]??``,lineIndex:n}},h=e=>`。！？!?`.includes(e),v=e=>`，,、；;：:`.includes(e),y=e=>{if(Math.max(0,i.length-e)<=0)return 0;if((i[e]||``)===`
`)return 1;let{line:t,lineIndex:n}=m(e),r=p(t,n);return r.isTitle||r.isHeading?1:r.isBullet?f()<.85?1:2:f()<.92?1:2},b=(e,t)=>{if(!String(e||``).trim())return 420+Math.floor(f()*420);let n=p(e,t);return n.isTitle?680+Math.floor(f()*620):n.isHeading?620+Math.floor(f()*820):n.isBullet?f()<.08?520+Math.floor(f()*900):180+Math.floor(f()*260):f()<.06?520+Math.floor(f()*900):220+Math.floor(f()*260)},x=e=>{let t=i.length,n=t>5200?18:t>3600?20:t>2400?22:26,r=Math.floor(f()*10)-4;return e===` `||e===`	`?8+Math.floor(f()*20):h(e)?180+Math.floor(f()*260):v(e)?70+Math.floor(f()*150):Math.max(10,n+r)},S=()=>{let e=c.current;if(e>=i.length){if(s.current=null,!u.current){u.current=!0;try{r?.()}catch{}}return}let t=y(e),n=Math.min(i.length,e+Math.max(1,t));c.current=n,a(i.slice(0,n));let o=i[n-1]||``,l=x(o);if(o===`
`){let e=i.slice(0,Math.max(0,n-1)).split(`
`),t=Math.max(0,e.length-1);l=b(e[t]??``,t),f()<.03&&(l+=900+Math.floor(f()*1100))}s.current=window.setTimeout(S,l)},C=450+Math.floor(f()*650);return s.current=window.setTimeout(S,C),()=>{s.current&&window.clearTimeout(s.current),s.current=null}},[t,n]);let d=String(t||``),f=!!d&&i.length>=d.length;return(0,m.jsxs)(m.Fragment,{children:[h(i),n&&!f?(0,m.jsx)(`span`,{className:`inline-block w-[10px] animate-pulse text-gray-700`,children:`▍`}):null]})},b=({jobId:e,itemsText:t,active:n,color:r,onDone:i})=>{let[a,o]=(0,p.useState)(``),[s,c]=(0,p.useState)(!1),l=(0,p.useRef)(``),u=(0,p.useRef)(``),d=(0,p.useRef)(``),f=(0,p.useRef)(!1),v=(0,p.useRef)(null),y=(0,p.useRef)(0),b=(0,p.useRef)(0),x=(0,p.useRef)(null);(0,p.useEffect)(()=>{let r=String(t||``).trim(),a=r?r.split(`
`).map(e=>String(e||``).trim()).filter(Boolean).slice(0,30):[],s=`${String(e||``)}::${r}`;if(!n){l.current=s,v.current&&window.clearTimeout(v.current),v.current=null,o(a.map(e=>`- ${e}`).join(`
`)),f.current=!0,d.current=``,c(!0);return}if(!a.length){l.current=s,v.current&&window.clearTimeout(v.current),v.current=null,o(``),f.current=!0,d.current=``,c(!0);return}if(u.current===s||d.current===s&&v.current)return;u.current&&u.current!==s&&(u.current=``),l.current=s,v.current&&window.clearTimeout(v.current),v.current=null,d.current=s,x.current=_(g(s)^2246822507),y.current=0,b.current=0,o(``),f.current=!1,c(!1);let p=()=>x.current?x.current():Math.random(),m=()=>300+Math.floor(p()*500),h=()=>160+Math.floor(p()*260),S=()=>70+Math.floor(p()*150),C=e=>`。！？!?`.includes(e),w=e=>`，,、；;：:`.includes(e),T=(()=>{let e=a.reduce((e,t)=>e+t.length,0);return e>1800?16:e>900?18:21})(),E=e=>e===`
`?m():C(e)?h():w(e)?S():e===` `||e===`	`?8+Math.floor(p()*18):Math.max(10,T+(Math.floor(p()*10)-4)),D=()=>{let e=b.current;if(e>=a.length){v.current=null,d.current=``,f.current=!0,c(!0),u.current=s;try{i?.()}catch{}return}let t=`- ${a[e]}`,n=y.current;if(n>=t.length){if(o(a.slice(0,e+1).map(e=>`- ${e}`).join(`
`)),b.current=e+1,y.current=0,e+1>=a.length){v.current=null,d.current=``,f.current=!0,c(!0),u.current=s;try{i?.()}catch{}return}v.current=window.setTimeout(D,m());return}let r=Math.min(t.length,n+1);y.current=r;let l=a.slice(0,e).map(e=>`- ${e}`).join(`
`),p=t.slice(0,r);o(l?`${l}\n${p}`:p);let h=t[r-1]||``;v.current=window.setTimeout(D,E(h))};return v.current=window.setTimeout(D,m()),()=>{v.current&&window.clearTimeout(v.current),v.current=null}},[e,n,t]);let S=String(a||``),C=r===`danger`?`text-red-700`:`text-gray-700`;return(0,m.jsxs)(m.Fragment,{children:[h(S),n&&!s?(0,m.jsx)(`span`,{className:`inline-block w-[10px] animate-pulse ${C}`,children:`▍`}):null]})},x=e=>{if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`number`&&Number.isFinite(e))return String(e);if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`object`){let t=e;return a(t.text)||a(t.label)||a(t.value)||a(t.name)||a(t.title)}return``},S=`AI 输出提示：该优化结果由云端大模型生成，可能不准确；请勿将“【待补充】”占位内容当作事实，并以面试/offer确认信息为准。`,C=({children:e})=>(0,m.jsx)(`span`,{className:`inline-flex items-center px-2 h-5 rounded-full text-[11px] font-extrabold border border-gray-200 bg-white text-gray-700`,children:e});function w(){let e=r(),t=(0,p.useRef)(null),n=(0,p.useRef)(null),h=(0,p.useRef)(null),_=(0,p.useRef)(0),w=(0,p.useMemo)(()=>a(new URLSearchParams(String(e.search||``)).get(`sid`)),[e.search]),[T,E]=(0,p.useState)(null),[D,O]=(0,p.useState)([]),[k,A]=(0,p.useState)(``),[j,M]=(0,p.useState)(!0),[N,P]=(0,p.useState)({}),[F,I]=(0,p.useState)({}),L=(0,p.useRef)({});(0,p.useEffect)(()=>{let e=!0,t=async()=>{try{let t=await f(w);if(!e)return;if(!t||t.type!==`optimize_resume`){A(`会话不存在或已过期，请重新生成。`),E(null);return}E(t)}catch(t){if(!e)return;A(String(t?.message||`加载失败`))}};t();let n=window.setInterval(t,900);return()=>{e=!1,window.clearInterval(n)}},[w]),(0,p.useEffect)(()=>{let e=!0;return(async()=>{try{let t=(T?.ids||[]).map(e=>String(e||``).trim()).filter(Boolean).slice(0,5);if(!t.length)return;let n=await i({type:`GET_JOBS_BY_IDS`,payload:{ids:t}});if(!e||!n.success)return;O(Array.isArray(n.jobs)?n.jobs:[])}catch{}})(),()=>{e=!1}},[T?.ids?.join(`|`)]);let R=T?.status||`new`,z=(()=>{let e=Number(T?.progress);return Number.isFinite(e)&&e>0?Math.max(1,Math.min(100,Math.round(e))):R===`done`||R===`failed`?100:5})(),B=String(T?.inputResume||``),V=T?.out||null,H=Array.isArray(V?.items)?V.items:[],U=(0,p.useMemo)(()=>c(V?._fallback),[V]),W=(0,p.useMemo)(()=>l(V?._fallback),[V]),G=(0,p.useMemo)(()=>H.length?d(`resume_optimize`,{items:H}):null,[H]),K=e=>String(e||``).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`);(0,p.useEffect)(()=>{let e=n.current,t=()=>{_.current=Date.now()+4500},r=()=>t(),i=()=>t(),a=()=>t(),o=e=>{let n=String(e.key||``);(n===`ArrowDown`||n===`ArrowUp`||n===`PageDown`||n===`PageUp`||n===`Home`||n===`End`||n===` `)&&t()};return e&&(e.addEventListener(`wheel`,r,{passive:!0}),e.addEventListener(`touchstart`,i,{passive:!0}),e.addEventListener(`mousedown`,a,{passive:!0})),window.addEventListener(`wheel`,r,{passive:!0}),window.addEventListener(`touchstart`,i,{passive:!0}),window.addEventListener(`mousedown`,a,{passive:!0}),window.addEventListener(`keydown`,o),()=>{e&&(e.removeEventListener(`wheel`,r),e.removeEventListener(`touchstart`,i),e.removeEventListener(`mousedown`,a)),window.removeEventListener(`wheel`,r),window.removeEventListener(`touchstart`,i),window.removeEventListener(`mousedown`,a),window.removeEventListener(`keydown`,o)}},[]),(0,p.useEffect)(()=>{if(!j||R!==`running`&&R!==`new`)return;let e=window.setInterval(()=>{try{if(Date.now()<(_.current||0))return;let e=n.current,t=h.current;if(!t)return;let r=e&&e.scrollHeight>e.clientHeight+2?e:null,i=document.scrollingElement||document.documentElement,a=(r||i).getBoundingClientRect(),o=t.getBoundingClientRect(),s=o.top<a.top+90,c=o.bottom>a.bottom-90;if(!s&&!c)return;let l=o.bottom-a.bottom+90,u=o.top-a.top-90;if(r){let e=Math.max(0,r.scrollHeight-r.clientHeight),t=c?r.scrollTop+l:s?r.scrollTop+u:r.scrollTop,n=Math.max(0,Math.min(e,t));if(Math.abs(n-r.scrollTop)<18)return;r.scrollTop=n}else{let e=c?window.scrollY+l:s?window.scrollY+u:window.scrollY,t=Math.max(0,(document.documentElement.scrollHeight||0)-window.innerHeight),n=Math.max(0,Math.min(t,e));if(Math.abs(n-window.scrollY)<18)return;window.scrollTo(0,n)}}catch{}},260);return()=>window.clearInterval(e)},[j,R,N,H]);let q=(0,p.useMemo)(()=>{for(let e of H){let t=a(e?.jobId);if(t&&Number(N[t]??0)<4)return t}return a(H[0]?.jobId)},[H,N]),J=(0,p.useMemo)(()=>{let e=a(q);return e?`${e}:${Number(N[e]??0)}`:``},[q,N]);(0,p.useEffect)(()=>{if(J)try{let e=`[data-follow-key="${K(J)}"]`,t=document.querySelector(e);if(t){h.current=t;return}let n=J.split(`:`)[0]||``;if(!n)return;let r=document.querySelector(`[data-follow-card="${K(n)}"]`);r&&(h.current=r)}catch{}},[J]),(0,p.useEffect)(()=>{if(!H.length)return;let e={};for(let t of H){let n=a(t?.jobId);if(!n)continue;let r=String(t?.optimizedResume||``);L.current[n]!==r&&(L.current[n]=r,Number(N[n]??0)<=0&&(e[n]=g(r)))}let t=Object.keys(e);t.length&&(I(n=>{let r={...n||{}};for(let n of t)r[n]=e[n];return r}),P(e=>{let n={...e||{}};for(let e of t)n[e]=0;return n}))},[w,H,N]);let Y=(e,t)=>{let n=a(e);if(!n)return;let r=H.find(e=>a(e?.jobId)===n),i=Array.isArray(r?.highlights)&&r.highlights.length>0,o=Array.isArray(r?.changes)&&r.changes.length>0,s=Array.isArray(r?.caveats)&&r.caveats.length>0,c=(e=>e<=1&&i?1:e<=2&&o?2:e<=3&&s?3:4)(t+1);P(e=>({...e||{},[n]:c}))};return(0,m.jsx)(`div`,{ref:n,className:`w-full h-screen overflow-auto bg-gradient-to-b from-gray-50 via-gray-50 to-gray-100`,children:(0,m.jsxs)(`div`,{ref:t,className:`max-w-7xl mx-auto px-4 py-6`,children:[(0,m.jsx)(`div`,{className:`sticky top-0 z-20 -mx-4 px-4 py-3 bg-white/80 backdrop-blur border-b border-gray-200`,children:(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`text-lg font-bold text-gray-900 truncate`,children:`智能简历优化器`}),(0,m.jsx)(`div`,{className:`h-1`}),(0,m.jsx)(`div`,{className:`text-sm text-gray-600`,children:R===`running`||R===`new`?`生成中… ${z}%`:R===`failed`?`生成失败`:``})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,"data-export-ignore":`1`,children:[(0,m.jsx)(`button`,{type:`button`,onClick:()=>M(e=>!e),className:`h-9 px-4 rounded-full border text-sm font-semibold ${j?`border-gray-200 bg-white text-gray-700 hover:bg-gray-50 active:bg-gray-100`:`border-gray-200 bg-gray-50 text-gray-700 hover:bg-gray-100 active:bg-gray-200`}`,children:j?`跟随中`:`恢复跟随`}),(0,m.jsx)(`button`,{type:`button`,onClick:async()=>{try{let e=t.current;if(!e)throw Error(`导出区域不存在`);await o({element:e,fileName:`简历优化结果.png`,backgroundColor:`#ffffff`,pixelRatio:2})}catch(e){A(String(e?.message||`导出失败`))}},className:`h-9 px-4 rounded-full bg-gray-900 text-sm font-semibold text-white hover:bg-gray-800 active:bg-gray-700`,children:`导出 PNG`})]})]})}),k?(0,m.jsx)(`div`,{className:`mt-4 bg-white border border-red-200 rounded-2xl p-4 text-sm text-red-700`,children:k}):null,D?.length?(0,m.jsxs)(`section`,{className:`mt-5 bg-white border border-gray-200 rounded-2xl p-6 shadow-sm`,children:[(0,m.jsx)(`div`,{className:`text-base font-semibold text-gray-900`,children:`目标岗位（用于反向优化）`}),(0,m.jsx)(`div`,{className:`h-3`}),(0,m.jsx)(`div`,{className:`space-y-2 text-sm text-gray-800`,children:D.slice(0,5).map(e=>(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,m.jsx)(C,{children:String(e?.company||``).trim()||`（未填写公司）`}),(0,m.jsx)(`div`,{className:`font-semibold text-gray-900`,children:String(e?.title||``).trim()||`（未命名岗位）`}),String(e?.location||``).trim()?(0,m.jsx)(`div`,{className:`text-gray-500`,children:String(e?.location).trim()}):null]},String(e?.id||e?.url||Math.random())))})]}):null,R===`failed`?(0,m.jsxs)(`section`,{className:`mt-4 bg-white border border-gray-200 rounded-2xl p-6 shadow-sm`,children:[(0,m.jsx)(`div`,{className:`text-base font-semibold text-gray-900`,children:`错误信息`}),(0,m.jsx)(`div`,{className:`h-3`}),(0,m.jsx)(`div`,{className:`text-sm text-red-700 whitespace-pre-wrap`,children:String(T?.error||`生成失败`)})]}):null,U?(0,m.jsx)(u,{raw:V?._fallback,variant:`notice`,className:`mt-4 bg-white border border-gray-200 rounded-2xl p-4 shadow-sm`,style:{borderColor:`rgba(244,136,53,0.18)`,background:`rgba(244,136,53,0.08)`},textStyle:{color:`#111827`,fontSize:14,fontWeight:600}}):null,R===`done`&&G?(0,m.jsx)(s,{data:G}):null,W?(0,m.jsx)(u,{raw:V?._fallback,variant:`hint`,className:`mt-4 bg-white border border-gray-200 rounded-2xl p-4 shadow-sm`,style:{borderColor:`rgba(244,136,53,0.16)`,background:`rgba(244,136,53,0.07)`},textStyle:{color:`#374151`,fontSize:14,lineHeight:1.75}}):null,(0,m.jsxs)(`section`,{className:`mt-4 grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,m.jsxs)(`div`,{className:`bg-white border border-gray-200 rounded-2xl p-6 shadow-sm`,children:[(0,m.jsx)(`div`,{className:`text-base font-semibold text-gray-900`,children:`原始简历（你粘贴的内容）`}),(0,m.jsx)(`div`,{className:`h-3`}),(0,m.jsx)(`textarea`,{readOnly:!0,value:B,className:`w-full h-[520px] rounded-2xl border border-gray-200 p-3 text-sm text-gray-800 bg-gray-50 outline-none`})]}),(0,m.jsxs)(`div`,{className:`bg-white border border-gray-200 rounded-2xl p-6 shadow-sm`,children:[(0,m.jsx)(`div`,{className:`text-base font-semibold text-gray-900`,children:`针对性优化版（按岗位）`}),(0,m.jsx)(`div`,{className:`h-3`}),Array.isArray(V?.items)&&V.items.length?(0,m.jsx)(`div`,{className:`space-y-3`,children:V.items.slice(0,5).map((e,t)=>{let n=a(e?.jobId)||`${t}`,r=Number(F[n]??0)||0,i=r?`r${r}`:`r0`,o=Number(N[n]??0),s=!!n&&n===q,c=o>0||s?String(e?.optimizedResume||``):``,l=!!String(e?.optimizedResume||``).trim(),u=String(e?.fitLevel||``).trim(),d=Number(e?.fitScore),f=String(e?.fitSummary||``).trim(),p=u===`match`?`匹配`:u===`partial`?`部分匹配`:u===`miss`?`不匹配`:``,h=u===`match`?`border-emerald-200 bg-emerald-50 text-emerald-700`:u===`partial`?`border-amber-200 bg-amber-50 text-amber-700`:u===`miss`?`border-red-200 bg-red-50 text-red-700`:`border-gray-200 bg-white text-gray-700`;return(0,m.jsxs)(`div`,{"data-follow-card":n,className:`border border-gray-200 rounded-2xl p-4 bg-white`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,m.jsx)(`div`,{className:`text-sm font-semibold text-gray-900 break-words`,children:`${String(e?.jobTitle||`-`)}${e?.company?` · ${String(e.company)}`:``}`}),p?(0,m.jsxs)(`span`,{className:`inline-flex items-center px-2 h-6 rounded-full text-[11px] font-semibold border ${h}`,children:[p,Number.isFinite(d)&&d>0?` · ${Math.round(d)}`:``]}):null]}),f?(0,m.jsx)(`div`,{className:`mt-1 text-[12px] ${u===`miss`?`text-red-700 font-semibold`:`text-gray-600`}`,children:f}):null,Array.isArray(e?.atsKeywords)&&e.atsKeywords.length?(0,m.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:e.atsKeywords.slice(0,12).map((e,t)=>(0,m.jsx)(`span`,{className:`inline-flex items-center px-2 h-6 rounded-full text-[11px] font-semibold border border-gray-200 bg-white text-gray-700`,children:x(e)},t))}):null]}),(0,m.jsx)(`div`,{className:`shrink-0 flex items-center gap-2`,children:(0,m.jsx)(`button`,{type:`button`,"data-export-ignore":`1`,onClick:async()=>{try{let t=String(e?.optimizedResume||``).trim();if(!t)return;await navigator.clipboard.writeText(t),A(`已复制该岗位优化简历到剪贴板`),window.setTimeout(()=>A(``),1400)}catch(e){A(String(e?.message||`复制失败`))}},className:`h-8 px-3 rounded-full border border-gray-200 bg-white text-xs font-semibold text-gray-700 hover:bg-gray-50 active:bg-gray-100`,children:`复制`})})]}),(0,m.jsxs)(`div`,{className:`mt-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,m.jsx)(`div`,{className:`text-xs font-semibold text-gray-900`,children:`排版简历（建议只复制这一段）`}),(0,m.jsx)(`div`,{className:`text-[11px] text-gray-500`,children:`下方“改写点/注意事项”无需复制`})]}),(0,m.jsx)(`div`,{"data-follow-key":`${n}:0`,className:`mt-2 rounded-2xl border border-gray-200 bg-gray-50 p-3 whitespace-pre-wrap text-sm text-gray-900 leading-relaxed`,children:c.trim()?(0,m.jsx)(y,{jobId:`${String(n)}:${i}`,text:c,active:s&&o===0&&l,onDone:()=>Y(n,0)}):l&&!s&&o===0?`已生成，排队展示中…`:R===`done`?`—`:`生成中…`})]}),Array.isArray(e?.highlights)&&e.highlights.length||Array.isArray(e?.changes)&&e.changes.length||Array.isArray(e?.caveats)&&e.caveats.length?(0,m.jsx)(`div`,{className:`mt-4`,children:(0,m.jsx)(`div`,{className:`border-t border-dashed border-gray-200 pt-4`,children:(0,m.jsx)(`div`,{className:`text-[11px] font-semibold text-gray-500`,children:`以下内容用于理解与补齐信息（无需复制）`})})}):null,Array.isArray(e?.gaps)&&e.gaps.length?(0,m.jsxs)(`div`,{className:`mt-3`,children:[(0,m.jsx)(`div`,{className:`text-xs font-semibold text-gray-900`,children:`关键缺口（不补齐很难投中）`}),(0,m.jsx)(`div`,{className:`mt-2 space-y-1 text-sm text-gray-800`,children:e.gaps.slice(0,6).map((e,t)=>(0,m.jsx)(`div`,{children:`- ${x(e)}`},t))})]}):null,Array.isArray(e?.highlights)&&e.highlights.length&&o>=1?(0,m.jsxs)(`div`,{className:`mt-3`,children:[(0,m.jsx)(`div`,{className:`text-xs font-semibold text-gray-900`,children:`岗位适配亮点`}),(0,m.jsx)(`div`,{"data-follow-key":`${n}:1`,className:`mt-2 rounded-2xl border border-gray-200 bg-white p-3 whitespace-pre-wrap text-sm text-gray-800 leading-relaxed`,children:(0,m.jsx)(b,{jobId:`${String(n)}:${i}:highlights`,itemsText:v(e.highlights,8),active:s&&o===1,onDone:()=>Y(n,1)})})]}):null,Array.isArray(e?.changes)&&e.changes.length&&o>=2?(0,m.jsxs)(`div`,{className:`mt-3`,children:[(0,m.jsx)(`div`,{className:`text-xs font-semibold text-gray-900`,children:`本次改写点`}),(0,m.jsx)(`div`,{"data-follow-key":`${n}:2`,className:`mt-2 rounded-2xl border border-gray-200 bg-white p-3 whitespace-pre-wrap text-sm text-gray-800 leading-relaxed`,children:(0,m.jsx)(b,{jobId:`${String(n)}:${i}:changes`,itemsText:v(e.changes,10),active:s&&o===2,onDone:()=>Y(n,2)})})]}):null,Array.isArray(e?.caveats)&&e.caveats.length&&o>=3?(0,m.jsxs)(`div`,{className:`mt-3`,children:[(0,m.jsx)(`div`,{className:`text-xs font-semibold text-gray-900`,children:`注意事项（请补齐后再投递）`}),(0,m.jsx)(`div`,{"data-follow-key":`${n}:3`,className:`mt-2 rounded-2xl border border-red-200 bg-red-50 p-3 whitespace-pre-wrap text-sm text-red-700 leading-relaxed`,children:(0,m.jsx)(b,{jobId:`${String(n)}:${i}:caveats`,itemsText:v(e.caveats,8),active:s&&o===3,color:`danger`,onDone:()=>Y(n,3)})})]}):null]},`${t}-${String(e?.jobId||``)}`)})}):R===`done`?(0,m.jsxs)(m.Fragment,{children:[Array.isArray(V?.atsKeywords)&&V.atsKeywords.length?(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`text-xs font-semibold text-gray-900`,children:`ATS 关键词`}),(0,m.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:V.atsKeywords.slice(0,14).map((e,t)=>(0,m.jsx)(`span`,{className:`inline-flex items-center px-2 h-6 rounded-full text-[11px] font-semibold border border-gray-200 bg-white text-gray-700`,children:x(e)},t))})]}):null,(0,m.jsxs)(`div`,{className:`mt-4`,children:[(0,m.jsx)(`div`,{className:`text-xs font-semibold text-gray-900`,children:`自我评价/个人摘要（重写）`}),(0,m.jsx)(`div`,{className:`mt-2 whitespace-pre-wrap text-sm text-gray-800`,children:String(V?.selfIntro||``).trim()||`—`})]}),(0,m.jsxs)(`div`,{className:`mt-4`,children:[(0,m.jsx)(`div`,{className:`text-xs font-semibold text-gray-900`,children:`项目经历（重写写法）`}),(0,m.jsx)(`div`,{className:`mt-2 whitespace-pre-wrap text-sm text-gray-800`,children:String(V?.projectRewrite||``).trim()||`—`})]}),Array.isArray(V?.changes)&&V.changes.length?(0,m.jsxs)(`div`,{className:`mt-4`,children:[(0,m.jsx)(`div`,{className:`text-xs font-semibold text-gray-900`,children:`本次改写点`}),(0,m.jsx)(`div`,{className:`mt-2 space-y-1 text-sm text-gray-800`,children:V.changes.slice(0,12).map((e,t)=>(0,m.jsx)(`div`,{children:`- ${x(e)}`},t))})]}):null,Array.isArray(V?.caveats)&&V.caveats.length?(0,m.jsxs)(`div`,{className:`mt-4`,children:[(0,m.jsx)(`div`,{className:`text-xs font-semibold text-gray-900`,children:`注意事项`}),(0,m.jsx)(`div`,{className:`mt-2 space-y-1 text-sm text-gray-700`,children:V.caveats.slice(0,8).map((e,t)=>(0,m.jsx)(`div`,{children:`- ${x(e)}`},t))})]}):null]}):(0,m.jsx)(`div`,{className:`text-sm text-gray-600`,children:`正在生成优化内容，请稍候…`})]})]}),(0,m.jsxs)(`section`,{className:`mt-4 bg-white border border-gray-200 rounded-2xl p-6 shadow-sm`,children:[(0,m.jsx)(`div`,{className:`text-base font-semibold text-gray-900`,children:`AI 输出提示`}),(0,m.jsx)(`div`,{className:`h-2`}),(0,m.jsx)(`div`,{className:`text-sm text-gray-600 leading-relaxed`,children:S})]})]})})}export{w as default};