import{r as e}from"./norm-CeclA1Tu.js";import{t}from"./createLucideIcon-D8EZdzY3.js";var n=t(`UploadCloud`,[[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`M12 12v9`,key:`192myk`}],[`path`,{d:`m16 16-4-4-4 4`,key:`119tzi`}]]),r=`hr_profile_selected_resumes_v1`,i=(e=`hr_resume`)=>`${e}_${typeof globalThis.crypto?.randomUUID==`function`?globalThis.crypto.randomUUID():`${Date.now().toString(36)}_${Math.random().toString(16).slice(2,8)}`}`,a=t=>{let n=e(t?.name).toLowerCase(),r=e(t?.type).toLowerCase();return n.endsWith(`.pdf`)||r===`application/pdf`},o=e=>{let t=Number(e||0);return!Number.isFinite(t)||t<=0?``:t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`},s=(t,n=0)=>e(t).replace(/\.[^.]+$/g,``).replace(/[_-]+/g,` `).trim()||`候选人 ${n+1}`,c=(t,n=0)=>({id:i(),file:t,fileName:e(t.name)||`resume-${n+1}.pdf`,size:t.size,status:`queued`,stage:`等待识别`,source:`upload`}),l=(t,n=0)=>({id:i(`hr_profile_resume`),fileName:e(t.fileName||t.label)||`profile-${n+1}.pdf`,status:`ready`,stage:`已从人才画像带入`,text:e(t.resumeText),tags:Array.isArray(t.tags)?t.tags.map(t=>e(t)).filter(Boolean).slice(0,12):[],profileSummary:e(t.summary),source:`profile`}),u=(e,t,n)=>{let r=Array.from(t||[]),i=r.filter(a),o=Math.max(0,n-e.length),s=i.slice(0,o).map((t,n)=>c(t,e.length+n)),l=[];return r.length!==i.length&&l.push(`暂只支持 PDF 格式，其他文件已跳过`),i.length>o&&l.push(`一次最多 ${n} 份 PDF，超出的文件已跳过`),{rows:[...e,...s],message:l.join(`；`)}},d=(t,n)=>{let r=e(n).replace(/[，,；;。]/g,` `).split(/\s+/).join(` `).slice(0,24);r&&!t.includes(r)&&t.push(r)},f=e=>{let t=[];return d(t,e.likelyRole),d(t,e.seniority),e.coreSkills.slice(0,5).forEach(e=>d(t,e)),e.experienceSignals.slice(0,4).forEach(e=>d(t,e)),e.strengths.slice(0,3).forEach(e=>d(t,e)),t.slice(0,12)},p=t=>{try{let n=t.map(t=>({label:e(t.label),resumeText:e(t.resumeText),fileName:e(t.fileName),tags:Array.isArray(t.tags)?t.tags.map(t=>e(t)).filter(Boolean).slice(0,12):[],summary:e(t.summary)})).filter(e=>e.resumeText.length>=20).slice(0,20);return window.sessionStorage.setItem(r,JSON.stringify(n)),n.length}catch{return 0}},m=()=>{try{let t=window.sessionStorage.getItem(r),n=t?JSON.parse(t):[];return Array.isArray(n)?n.map(t=>({label:e(t?.label),resumeText:e(t?.resumeText),fileName:e(t?.fileName),tags:Array.isArray(t?.tags)?t.tags.map(t=>e(t)).filter(Boolean).slice(0,12):[],summary:e(t?.summary)})).filter(e=>e.resumeText.length>=20).slice(0,20):[]}catch{return[]}},h=()=>{try{window.sessionStorage.removeItem(r)}catch{}};export{s as a,p as c,o as i,n as l,h as n,l as o,f as r,m as s,u as t};