hunter-mate 0.1.23 → 0.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/assets/extension/build-info.json +1 -1
  2. package/dist/assets/extension/manifest.json +3 -3
  3. package/dist/assets/server/chunks/{chunk-SAJB6JRK.mjs → chunk-VL7WHUEV.mjs} +556 -8
  4. package/dist/assets/server/chunks/{script-rule-ZJN6CEYX.mjs → script-rule-4RZQ2PQE.mjs} +1 -2
  5. package/dist/assets/server/main.mjs +220 -105
  6. package/dist/index.js +221 -38
  7. package/dist/web/dist/404.html +1 -1
  8. package/dist/web/dist/_next/static/chunks/253-a05d05b94bfbd7a4.js +1 -0
  9. package/dist/web/dist/_next/static/chunks/{852-248884963a986600.js → 852-ad19b97821a4cf9e.js} +1 -1
  10. package/dist/web/dist/_next/static/chunks/app/companies/{page-ec27ce9ab3610221.js → page-e8d02fe997579315.js} +1 -1
  11. package/dist/web/dist/_next/static/chunks/app/jobs/page-4827a9ef286b6483.js +1 -0
  12. package/dist/web/dist/_next/static/chunks/app/talents/{page-c0a0c250eb5f5459.js → page-0edef6d07b3cf69d.js} +1 -1
  13. package/dist/web/dist/_next/static/css/10ba1fa1d6ce23a7.css +3 -0
  14. package/dist/web/dist/admin/data.html +1 -1
  15. package/dist/web/dist/admin/data.txt +1 -1
  16. package/dist/web/dist/auth/verify.html +1 -1
  17. package/dist/web/dist/auth/verify.txt +1 -1
  18. package/dist/web/dist/companies.html +1 -1
  19. package/dist/web/dist/companies.txt +2 -2
  20. package/dist/web/dist/company/admin.html +1 -1
  21. package/dist/web/dist/company/admin.txt +1 -1
  22. package/dist/web/dist/entity.html +1 -1
  23. package/dist/web/dist/entity.txt +1 -1
  24. package/dist/web/dist/index.html +1 -1
  25. package/dist/web/dist/index.txt +1 -1
  26. package/dist/web/dist/jobs.html +1 -1
  27. package/dist/web/dist/jobs.txt +2 -2
  28. package/dist/web/dist/logs.html +1 -1
  29. package/dist/web/dist/logs.txt +1 -1
  30. package/dist/web/dist/matching/jobs/placeholder/talents.html +1 -1
  31. package/dist/web/dist/matching/jobs/placeholder/talents.txt +1 -1
  32. package/dist/web/dist/matching/portraits/placeholder/jobs.html +1 -1
  33. package/dist/web/dist/matching/portraits/placeholder/jobs.txt +1 -1
  34. package/dist/web/dist/parselog.html +1 -1
  35. package/dist/web/dist/parselog.txt +1 -1
  36. package/dist/web/dist/recordings.html +1 -1
  37. package/dist/web/dist/recordings.txt +1 -1
  38. package/dist/web/dist/resource-usage.html +1 -1
  39. package/dist/web/dist/resource-usage.txt +1 -1
  40. package/dist/web/dist/shared/placeholder.html +1 -1
  41. package/dist/web/dist/shared/placeholder.txt +1 -1
  42. package/dist/web/dist/snapshots/placeholder/agent-prompt.html +1 -1
  43. package/dist/web/dist/snapshots/placeholder/agent-prompt.txt +1 -1
  44. package/dist/web/dist/talents.html +1 -1
  45. package/dist/web/dist/talents.txt +2 -2
  46. package/dist/web/dist/team/insights.html +1 -1
  47. package/dist/web/dist/team/insights.txt +1 -1
  48. package/package.json +1 -1
  49. package/dist/assets/server/chunks/chunk-BLXHCSZD.mjs +0 -565
  50. package/dist/assets/server/chunks/esm-4U746B76.mjs +0 -29
  51. package/dist/web/dist/_next/static/chunks/954-fb0212fe71f60a52.js +0 -1
  52. package/dist/web/dist/_next/static/chunks/app/jobs/page-4175a90f1b42f87d.js +0 -1
  53. package/dist/web/dist/_next/static/css/bd072fee69ae8474.css +0 -3
  54. /package/dist/assets/extension/background/{service-worker.20261016165050.js → service-worker.20261017183328.js} +0 -0
  55. /package/dist/web/dist/_next/static/{a_JzW5lROd6a66UMqSE9Z → 5MA8faUttk6FzlxGWnOlM}/_buildManifest.js +0 -0
  56. /package/dist/web/dist/_next/static/{a_JzW5lROd6a66UMqSE9Z → 5MA8faUttk6FzlxGWnOlM}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7a057e1f-24c9-406e-9fb9-03a74e13340c",e._sentryDebugIdIdentifier="sentry-dbid-7a057e1f-24c9-406e-9fb9-03a74e13340c")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[852],{70852:function(e,t,l){l.d(t,{EntityListPage:function(){return X}});var s=l(72835),a=l(60635),n=l(27473),r=l(74431),i=l(37202),d=l(94518),o=l(63718),c=l(19036),u=l(8448),x=l(86777);let m=["workExperiences","projects","education"],h={intent:["position","salary","city","industries"]},p={name:"姓名",headline:"头衔",currentPosition:"现职位",currentCompany:"现公司",city:"城市",degree:"学历",workYears:"工作年限",age:"年龄",gender:"性别",resId:"resId",statusTag:"状态标签",contactTime:"方便联系时间",phone:"电话",email:"邮箱",profileUrl:"主页 URL",sourceUrl:"来源 URL",selfEvaluation:"自我评价",statement:"平台声明","intent.position":"期望职位","intent.salary":"期望薪资","intent.city":"期望城市","intent.industries":"期望行业",updatedAt:"更新时间"},g={workExperiences:"工作经历",projects:"项目经历",education:"教育经历"},y={company:"公司",position:"职位",period:"时间段",start:"开始",end:"结束",department:"部门",location:"地点",reportsTo:"汇报对象",school:"学校",major:"专业",degree:"学历",name:"名称",role:"角色",description:"描述",duties:"职责",industry:"行业"};function b(e){return null==e||""===e?"—":Array.isArray(e)?e.length?e.map(e=>b(e)).filter(e=>"—"!==e).join("、"):"—":"object"==typeof e?JSON.stringify(e):"string"==typeof e&&/^\d{4}-\d{2}-\d{2}T/.test(e)?(0,u.d3)(e):String(e)}function v(e){var t;let{entity:l}=e,i=(0,n.useRouter)(),d=l.id,[o,c]=(0,a.useState)(null),[x,v]=(0,a.useState)(!1),[j,f]=(0,a.useState)({}),[N,w]=(0,a.useState)(null),[k,S]=(0,a.useState)(new Set),[A,C]=(0,a.useState)({}),[T,I]=(0,a.useState)({}),[E,U]=(0,a.useState)(!1),[O,D]=(0,a.useState)("");(0,a.useEffect)(()=>{let e=!0;return c(null),D(""),(async()=>{try{let t=await (0,r.aA)("/entities/talent/".concat(d,"/duplicates"));e&&c(t.candidates)}catch(t){e&&c([])}})(),()=>{e=!1}},[d]);let F=(0,a.useMemo)(()=>{var e;return null!==(e=l.extracted)&&void 0!==e?e:{}},[l.extracted]),P=async e=>{if(j[e])return j[e];try{let t=await (0,r.aA)("/entities/talent/".concat(e));if(!t.entity)return null;return f(l=>({...l,[e]:t.entity})),t.entity}catch(e){return null}},L=async()=>{var e,t,l,s,a,n,r;U(!0),D("");let i=[d,...(null!=o?o:[]).map(e=>e.talent.id)],c=await Promise.all(i.map(e=>P(e)));if(U(!1),c.some(e=>!e)){D("全量简历拉取失败,请重试");return}let u=c[0],x=null!==(t=u.extracted)&&void 0!==t?t:{},p={name:u.name,headline:u.headline},g={};for(let e of Object.keys(x))if(m.includes(e))g[e]=Array.isArray(x[e])?[...x[e]]:[];else if(h[e]){let t=null!==(s=x[e])&&void 0!==s?s:{};for(let l of h[e])p["".concat(e,".").concat(l)]=null!==(a=t[l])&&void 0!==a?a:"industries"===l?[]:""}else(null==(r=x[e])||["string","number","boolean"].includes(typeof r))&&!e.startsWith("_")&&(p[e]=null!==(l=x[e])&&void 0!==l?l:"");C(p),I(g),w(null!==(n=null==o?void 0:null===(e=o[0])||void 0===e?void 0:e.talent.id)&&void 0!==n?n:null),v(!0)},M=e=>{var t;let s=[],a=t=>{var l,s,a,n;if(t){if("name"===e)return t.name;if("headline"===e)return t.headline;if(e.startsWith("intent.")){let l=e.slice(7),n=null===(a=t.extracted)||void 0===a?void 0:null===(s=a.intent)||void 0===s?void 0:s[l];return"industries"===l?Array.isArray(n)?n:[]:null!=n?n:""}return null!==(n=null===(l=t.extracted)||void 0===l?void 0:l[e])&&void 0!==n?n:""}},n=a(null!==(t=j[d])&&void 0!==t?t:l);for(let e of(s.push({id:0,label:"当前",value:n}),null!=o?o:[])){let t=j[e.talent.id];if(!t)continue;let l=a(t);void 0!==l&&"—"!==b(l)&&s.push({id:e.talent.id,label:"#".concat(e.talent.id),value:l})}return s},_=(e,t)=>C(l=>({...l,[e]:t})),B=async e=>{U(!0);try{await (0,r.aA)("/entities/talent/".concat(d,"/duplicates/dismiss"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({otherId:e})}),c(t=>(null!=t?t:[]).filter(t=>t.talent.id!==e)),N===e&&w(null)}catch(e){D("标注失败,请重试")}finally{U(!1)}},q=async()=>{var e,t,l,s;let a={...F};for(let[t,l]of Object.entries(A))if("name"!==t&&"headline"!==t){if(t.startsWith("intent.")){let s=t.slice(7);a.intent={...null!==(e=a.intent)&&void 0!==e?e:{},[s]:l}}else a[t]="number"!=typeof(s=F[t])||"string"!=typeof l||""===l.trim()||Number.isNaN(Number(l))?"boolean"==typeof s&&"string"==typeof l?"true"===l:l:Number(l)}for(let e of m)T[e]&&(a[e]=T[e]);let n=(null!=o?o:[]).filter(e=>!k.has(e.talent.id)).map(e=>e.talent.id);if(0===n.length){D("未勾选任何候选参与合并");return}U(!0);let c=!1;for(let e of n)try{await (0,r.aA)("/entities/talent/merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepId:d,removeId:e,extracted:a,name:null!==(t=A.name)&&void 0!==t?t:null,headline:null!==(l=A.headline)&&void 0!==l?l:null})})}catch(e){c=!0;break}if(U(!1),c){D("合并失败,请重试");return}i.replace("/talents?id=".concat(d)),i.refresh(),window.location.reload()},R=async()=>{let e=(null!=o?o:[]).filter(e=>!k.has(e.talent.id)).map(e=>e.talent.id);if(0===e.length){D("未勾选任何候选参与合并");return}U(!0);let t=!0;for(let l of e)try{await (0,r.aA)("/entities/talent/merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepId:d,removeId:l})})}catch(e){t=!1;break}if(U(!1),!t){D("合并失败,请重试");return}i.replace("/talents?id=".concat(d)),i.refresh(),window.location.reload()};if(null===o||0===o.length)return null;let J=null!==(t=o.find(e=>e.talent.id===N))&&void 0!==t?t:null,Y=null!=N?j[N]:null,V=e=>(0,s.jsx)("span",{className:"flex flex-wrap items-center gap-1",children:M(e).map(t=>(0,s.jsx)("button",{type:"button",title:"采纳:".concat(b(t.value)),onClick:()=>_(e,t.value),className:"rounded border border-gray-200 px-1.5 py-0.5 text-xs text-gray-500 hover:border-blue-400 hover:text-blue-600",children:t.label},t.id))});return(0,s.jsxs)("div",{className:"mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("span",{className:"text-sm font-medium text-amber-800",children:["发现 ",o.length," 条可能重复的人才记录"]}),(0,s.jsx)("button",{onClick:()=>void L(),disabled:E,className:"rounded bg-amber-600 px-3 py-1 text-sm text-white hover:bg-amber-700 disabled:opacity-50",children:"查看并处理"}),(0,s.jsx)("button",{onClick:()=>void B(o[0].talent.id),disabled:E,className:"rounded border border-amber-400 px-3 py-1 text-sm text-amber-700 hover:bg-amber-100 disabled:opacity-50",children:"与最高分条目非重复"}),O?(0,s.jsx)("span",{className:"text-sm text-red-600",children:O}):null]}),x?(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 p-2 sm:p-4",onClick:()=>v(!1),children:(0,s.jsxs)("div",{className:"flex max-h-[92vh] w-full max-w-6xl flex-col overflow-hidden rounded-lg bg-white shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 border-b border-gray-200 px-4 py-3",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"重复简历合并工作区"}),(0,s.jsxs)("span",{className:"text-sm text-gray-500",children:["当前 #",d,l.name?" \xb7 ".concat(l.name):""," — ",o.length," 条候选"]}),(0,s.jsx)("button",{onClick:()=>v(!1),className:"ml-auto text-sm text-gray-500 hover:text-gray-700",children:"关闭"})]}),(0,s.jsxs)("div",{className:"grid flex-1 gap-0 overflow-hidden md:grid-cols-[250px,1fr]",children:[(0,s.jsxs)("div",{className:"overflow-y-auto border-b border-gray-200 p-3 md:border-b-0 md:border-r",children:[(0,s.jsx)("div",{className:"mb-2 text-xs font-medium text-gray-500",children:"候选简历(逐条处理)"}),(0,s.jsx)("div",{className:"space-y-2",children:o.map(e=>{var t;return(0,s.jsxs)("div",{className:"rounded-lg border p-2 ".concat(N===e.talent.id?"border-blue-400 bg-blue-50":"border-gray-200"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:!k.has(e.talent.id),disabled:E,onChange:t=>{S(l=>{let s=new Set(l);return t.target.checked?s.delete(e.talent.id):s.add(e.talent.id),s})},title:"勾选=同一人,参与本次合并"}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-900",children:null!==(t=e.talent.name)&&void 0!==t?t:"(未命名)"}),(0,s.jsxs)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-600",children:["相似度 ",e.score]})]}),(0,s.jsxs)("div",{className:"mt-0.5 truncate text-xs text-gray-500",title:e.talent.sourceUrl,children:[e.talent.source," \xb7 ",(0,u.d3)(e.talent.updatedAt)]}),(0,s.jsxs)("div",{className:"mt-1.5 flex gap-1.5",children:[(0,s.jsx)("button",{type:"button",onClick:()=>w(e.talent.id),className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-700 hover:bg-gray-50",children:"选中对比"}),(0,s.jsx)("button",{type:"button",disabled:E,onClick:()=>void B(e.talent.id),className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-700 hover:bg-gray-50 disabled:opacity-50",children:"非同一人"})]})]},e.talent.id)})})]}),(0,s.jsxs)("div",{className:"flex flex-col overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 border-b border-gray-100 px-3 py-2",children:[(0,s.jsx)("h4",{className:"text-sm font-semibold text-gray-900",children:"最终采用简历(可编辑)"}),(0,s.jsx)("button",{type:"button",onClick:()=>{L()},className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-600 hover:bg-gray-50",children:"重置为当前简历"})]}),(0,s.jsx)("div",{className:"divide-y divide-gray-100",children:Object.keys(A).map(e=>{var t,a;return(0,s.jsxs)("div",{className:"grid grid-cols-[90px,1fr,auto] items-center gap-2 px-3 py-1.5",children:[(0,s.jsx)("label",{className:"text-xs text-gray-500",children:null!==(t=p[e])&&void 0!==t?t:e}),"sourceUrl"===e?(0,s.jsx)("a",{href:String(null!==(a=A[e])&&void 0!==a?a:l.sourceUrl),target:"_blank",rel:"noreferrer",className:"truncate text-sm text-blue-600 hover:underline",children:"—"===b(A[e])?l.sourceUrl:b(A[e])}):"selfEvaluation"===e||"statement"===e?(0,s.jsx)("textarea",{value:"—"===b(A[e])?"":String(A[e]),onChange:t=>_(e,t.target.value),rows:2,className:"w-full rounded border border-gray-300 px-2 py-1 text-sm"}):(0,s.jsx)("input",{value:"—"===b(A[e])?"":String(A[e]),onChange:t=>_(e,t.target.value),className:"w-full rounded border border-gray-300 px-2 py-1 text-sm"}),V(e)]},e)})})]}),m.map(e=>{var t,l,a;let n=null!==(t=T[e])&&void 0!==t?t:[],r=[];for(let t of null!=o?o:[]){let s=j[t.talent.id],a=null==s?void 0:null===(l=s.extracted)||void 0===l?void 0:l[e];Array.isArray(a)&&a.forEach(e=>r.push({id:t.talent.id,item:e}))}return(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,s.jsx)("div",{className:"flex items-center justify-between border-b border-gray-100 px-3 py-2",children:(0,s.jsxs)("h4",{className:"text-sm font-semibold text-gray-900",children:[null!==(a=g[e])&&void 0!==a?a:e,"(",n.length,")"]})}),0===n.length&&0===r.length?(0,s.jsx)("p",{className:"px-3 py-2 text-xs text-gray-400",children:"两侧均无数据"}):(0,s.jsxs)("div",{className:"space-y-2 p-3",children:[n.map((t,l)=>(0,s.jsxs)("div",{className:"rounded border border-gray-200 p-2",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 lg:grid-cols-4",children:Object.keys(null!=t?t:{}).filter(e=>!e.startsWith("_")).map(a=>{var r;return(0,s.jsxs)("label",{className:"block",children:[(0,s.jsx)("span",{className:"text-xs text-gray-400",children:null!==(r=y[a])&&void 0!==r?r:a}),"string"==typeof t[a]&&t[a].length>40?(0,s.jsx)("textarea",{value:t[a],rows:2,onChange:t=>{let s=[...n];s[l]={...s[l],[a]:t.target.value},I(t=>({...t,[e]:s}))},className:"w-full rounded border border-gray-300 px-2 py-1 text-xs"}):(0,s.jsx)("input",{value:"—"===b(t[a])?"":String(t[a]),onChange:t=>{let s=[...n];s[l]={...s[l],[a]:t.target.value},I(t=>({...t,[e]:s}))},className:"w-full rounded border border-gray-300 px-2 py-1 text-xs"})]},a)})}),(0,s.jsx)("div",{className:"mt-1.5 flex items-center gap-2",children:(0,s.jsx)("button",{type:"button",onClick:()=>I(t=>({...t,[e]:n.filter((e,t)=>t!==l)})),className:"rounded border border-red-200 px-2 py-0.5 text-xs text-red-600 hover:bg-red-50",children:"删除此条"})})]},l)),r.length?(0,s.jsxs)("div",{className:"rounded border border-dashed border-gray-300 p-2",children:[(0,s.jsx)("div",{className:"mb-1 text-xs text-gray-500",children:"候选条目(选择合入或更新)"}),(0,s.jsx)("div",{className:"space-y-1.5",children:r.map((t,l)=>{var a,r,i,d,o,c,u,x,m;let h=n.findIndex(e=>(function(e,t){let l=e=>{var t,l,s;return String(null!==(s=null!==(l=null!==(t=null==e?void 0:e.company)&&void 0!==t?t:null==e?void 0:e.school)&&void 0!==l?l:null==e?void 0:e.name)&&void 0!==s?s:"")},s=e=>{var t,l,s;return String(null!==(s=null==e?void 0:e.period)&&void 0!==s?s:"".concat(null!==(t=null==e?void 0:e.start)&&void 0!==t?t:"","-").concat(null!==(l=null==e?void 0:e.end)&&void 0!==l?l:""))},a=l(e),n=l(t),r=s(e),i=s(t);return!!a&&!!n&&a===n||!!r&&!!i&&r===i&&(!a||!n||a===n)})(e,t.item));return(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,s.jsxs)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-gray-500",children:["#",t.id]}),(0,s.jsxs)("span",{className:"min-w-0 flex-1 truncate text-gray-700",children:[b(null!==(i=null!==(r=null!==(a=t.item.company)&&void 0!==a?a:t.item.school)&&void 0!==r?r:t.item.name)&&void 0!==i?i:"")," \xb7 ",b(null!==(c=null!==(o=null!==(d=t.item.position)&&void 0!==d?d:t.item.major)&&void 0!==o?o:t.item.role)&&void 0!==c?c:"")," \xb7 ",b(null!==(m=t.item.period)&&void 0!==m?m:"".concat(null!==(u=t.item.start)&&void 0!==u?u:"","-").concat(null!==(x=t.item.end)&&void 0!==x?x:""))]}),h>=0?(0,s.jsxs)("button",{type:"button",onClick:()=>{let l=[...n];l[h]={...t.item},I(t=>({...t,[e]:l}))},className:"shrink-0 rounded border border-blue-300 px-2 py-0.5 text-blue-600 hover:bg-blue-50",children:["更新条目",h+1]}):(0,s.jsx)("button",{type:"button",onClick:()=>I(l=>({...l,[e]:[...n,{...t.item}]})),className:"shrink-0 rounded border border-green-300 px-2 py-0.5 text-green-700 hover:bg-green-50",children:"合入"})]},l)})})]}):null]})]},e)}),J&&Y?(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,s.jsx)("div",{className:"border-b border-gray-100 px-3 py-2",children:(0,s.jsxs)("h4",{className:"text-sm font-semibold text-gray-900",children:["与候选 #",J.talent.id," 对比",J.reasons.length?(0,s.jsx)("span",{className:"ml-2 space-x-1",children:J.reasons.map(e=>(0,s.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs font-normal text-gray-600",children:e},e))}):null]})}),(0,s.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b border-gray-100 text-left text-xs text-gray-500",children:[(0,s.jsx)("th",{className:"py-1.5 pl-3 pr-2 font-medium",children:"字段"}),(0,s.jsxs)("th",{className:"py-1.5 pr-2 font-medium",children:["当前 #",d]}),(0,s.jsxs)("th",{className:"py-1.5 pr-3 font-medium",children:["候选 #",J.talent.id]})]})}),(0,s.jsx)("tbody",{children:Object.keys(A).map(e=>{var t,a,n,r;let i=b(null===(t=M(e)[0])||void 0===t?void 0:t.value),d=b((()=>{var t,l,s,a;let n=j[J.talent.id];if(n){if("name"===e)return n.name;if("headline"===e)return n.headline;if(e.startsWith("intent.")){let t=e.slice(7),a=null===(s=n.extracted)||void 0===s?void 0:null===(l=s.intent)||void 0===l?void 0:l[t];return"industries"===t?Array.isArray(a)?a:[]:null!=a?a:""}return null!==(a=null===(t=n.extracted)||void 0===t?void 0:t[e])&&void 0!==a?a:""}})()),o=i!==d&&"—"!==i&&"—"!==d;return(0,s.jsxs)("tr",{className:"border-b border-gray-50",children:[(0,s.jsx)("td",{className:"py-1 pl-3 pr-2 text-xs text-gray-500",children:null!==(n=p[e])&&void 0!==n?n:e}),(0,s.jsx)("td",{className:"py-1 pr-2 ".concat(o?"bg-amber-50":""),children:"sourceUrl"===e?(0,s.jsx)("a",{href:String(null!==(r=null===(a=M(e)[0])||void 0===a?void 0:a.value)&&void 0!==r?r:l.sourceUrl),target:"_blank",rel:"noreferrer",className:"break-all text-blue-600 hover:underline",children:i}):(0,s.jsx)("span",{className:"break-all",children:i})}),(0,s.jsx)("td",{className:"py-1 pr-3 ".concat(o?"bg-amber-50":""),children:"sourceUrl"===e?(0,s.jsx)("a",{href:String((()=>{var e;let t=j[J.talent.id];return null!==(e=null==t?void 0:t.sourceUrl)&&void 0!==e?e:""})()),target:"_blank",rel:"noreferrer",className:"break-all text-blue-600 hover:underline",children:d}):(0,s.jsx)("span",{className:"break-all",children:d})})]},e)})})]})]}):null]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t border-gray-200 px-4 py-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>void q(),disabled:E,className:"rounded bg-blue-600 px-4 py-1.5 text-sm text-white hover:bg-blue-700 disabled:opacity-50",children:"提交合并(采用上方编辑值)"}),(0,s.jsx)("button",{type:"button",onClick:()=>void R(),disabled:E,title:"传统语义:保留字段更全的一侧,另一侧补空合并",className:"rounded border border-gray-300 px-4 py-1.5 text-sm text-gray-700 hover:bg-gray-50 disabled:opacity-50",children:"快捷:整行补空合并"}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"被合并的候选会进入回收站(可恢复)"}),O?(0,s.jsx)("span",{className:"text-sm text-red-600",children:O}):null]})]})]})]})}):null]})}var j=l(65777);function f(e){var t,l;let{entityId:n,name:i}=e,[d,o]=(0,a.useState)(!1),[c,u]=(0,a.useState)(null),[x,m]=(0,a.useState)([]),[h,p]=(0,a.useState)(""),[g,y]=(0,a.useState)("pending_invite"),[b,v]=(0,a.useState)(!1),[f,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(null),{sync:S}=(0,j.nu)(),A=null!==(t=null==S?void 0:S.activeTenantId)&&void 0!==t?t:null;(0,a.useEffect)(()=>{d&&((async()=>{try{u(await (0,r.aA)("/recommendations/meta"))}catch(e){}})(),(async()=>{try{let e=await (0,r.aA)("/job-cases?limit=200");m(e.items)}catch(e){}})())},[d,A]);let C=async()=>{if(""!==h){v(!0),k(null);try{await (0,r.aA)("/recommendations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jobCaseId:h,entityId:n,stage:g})}),N({jobCaseId:Number(h)})}catch(e){k("写入失败(服务未启动或无权限)")}finally{v(!1)}}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>{o(!0),N(null),k(null)},className:"rounded bg-blue-600 px-3 py-1 text-sm text-white hover:bg-blue-700",children:"加入推荐流程"}),d?(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30",children:(0,s.jsx)("div",{className:"w-96 rounded-lg bg-white p-4 shadow-xl",children:f?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"mb-3 text-sm text-gray-800",children:["已把 ",(0,s.jsx)("span",{className:"font-medium",children:i})," 加入推荐流程。"]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)("button",{onClick:()=>o(!1),className:"rounded border border-gray-300 px-3 py-1 text-xs text-gray-600",children:"关闭"}),(0,s.jsx)("a",{href:"/jobs?id=".concat(f.jobCaseId),className:"rounded bg-blue-600 px-3 py-1 text-xs text-white hover:bg-blue-700",children:"去职位推荐流程 →"})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("h3",{className:"mb-3 text-sm font-semibold text-gray-900",children:["把 ",i," 加入推荐流程"]}),(0,s.jsxs)("label",{className:"mb-2 block text-xs text-gray-500",children:["目标职位",(0,s.jsxs)("select",{value:h,onChange:e=>p(""===e.target.value?"":Number(e.target.value)),className:"mt-1 w-full rounded border border-gray-300 px-2 py-1.5 text-sm",children:[(0,s.jsx)("option",{value:"",children:"选择职位…"}),x.map(e=>(0,s.jsx)("option",{value:e.id,children:e.title||e.externalId},e.id))]})]}),(0,s.jsxs)("label",{className:"mb-3 block text-xs text-gray-500",children:["推荐阶段(默认待邀请)",(0,s.jsx)("select",{value:g,onChange:e=>y(e.target.value),className:"mt-1 w-full rounded border border-gray-300 px-2 py-1.5 text-sm",children:(null!==(l=null==c?void 0:c.stages)&&void 0!==l?l:[{key:"pending_invite",label:"待邀请"}]).map(e=>(0,s.jsx)("option",{value:e.key,children:e.label},e.key))})]}),w?(0,s.jsx)("p",{className:"mb-2 text-xs text-red-600",children:w}):null,(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)("button",{onClick:()=>o(!1),className:"rounded border border-gray-300 px-3 py-1 text-xs text-gray-600",children:"取消"}),(0,s.jsx)("button",{onClick:()=>void C(),disabled:""===h||b,className:"rounded bg-blue-600 px-3 py-1 text-xs text-white hover:bg-blue-700 disabled:opacity-40",children:b?"写入中…":"确认加入"})]})]})})}):null]})}let N={merge:"解析合并",sync:"同步覆盖",manual:"人工编辑",backfill:"回溯回填"},w={"identity.displayName":"姓名","identity.gender":"性别","identity.birthYear":"出生年","identity.location":"地点","identity.nationality":"国籍","professional.headline":"头衔","professional.summary":"简介","professional.currentCompany":"现任公司","professional.currentTitle":"现任职位","professional.titleLevel":"职级","professional.yearsOfExperience":"工作年限","professional.currentStatus":"当前状态","professional.desiredJob":"求职意向","professional.skills":"技能","professional.workExperiences":"工作经历","professional.educations":"教育经历","professional.projects":"项目经历","professional.languages":"语言","professional.certifications":"证书","contact.phones":"电话","contact.emails":"邮箱","contact.wechats":"微信","contact.linkedinUrls":"LinkedIn"},k=e=>{if(null==e)return"(空)";if("object"==typeof e){if(e.truncated)return"".concat(String(e.preview).slice(0,40),"…");if(e.name)return String(e.name);if(e.city)return String(e.city);if(e.added||e.removed){var t,l;let s=[];return(null===(t=e.added)||void 0===t?void 0:t.length)&&s.push("+".concat(e.added.map(e=>{var t,l,s,a;return null!==(a=null!==(s=null!==(l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null==e?void 0:e.companyName)&&void 0!==l?l:null==e?void 0:e.school)&&void 0!==s?s:null==e?void 0:e.language)&&void 0!==a?a:String(e)}).join("、"))),(null===(l=e.removed)||void 0===l?void 0:l.length)&&s.push("-".concat(e.removed.map(e=>{var t,l,s,a;return null!==(a=null!==(s=null!==(l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null==e?void 0:e.companyName)&&void 0!==l?l:null==e?void 0:e.school)&&void 0!==s?s:null==e?void 0:e.language)&&void 0!==a?a:String(e)}).join("、"))),s.join(" ")||"(数量变化)"}return JSON.stringify(e).slice(0,40)}return String(e)};function S(e){let{versions:t,recommendations:l,changes:n,evaluations:r,matches:i}=e,d=(0,a.useMemo)(()=>{if(!(null==l?void 0:l.length))return null;let e=null;for(let r of l){var t,s,a,n;let l=null!==(t=r.history)&&void 0!==t?t:[],i=l.length?l[l.length-1]:null,d=null!==(s=null==i?void 0:i.at)&&void 0!==s?s:r.createdAt;(!e||d>e.at)&&(e={at:d,jobTitle:null!==(a=r.jobTitle)&&void 0!==a?a:"职位 #".concat(r.jobCaseId),toStage:null!==(n=null==i?void 0:i.toStage)&&void 0!==n?n:r.stage,by:null==i?void 0:i.by})}return e},[l]),o=(0,a.useMemo)(()=>{if(!(null==l?void 0:l.length))return[];let e=new Map;for(let a of l){var t,s;e.set(a.jobCaseId,{jobTitle:null!==(t=a.jobTitle)&&void 0!==t?t:"职位 #".concat(a.jobCaseId),stage:a.stage,stageLabel:null!==(s=a.stageLabel)&&void 0!==s?s:a.stage,updatedAt:a.updatedAt})}return Array.from(e.entries()).map(e=>{let[t,l]=e;return{jobCaseId:t,...l}}).sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))},[l]),c={rejected:"bg-red-50 text-red-700",onboarding:"bg-green-50 text-green-700"},x=(e,t)=>{var l;return(0,s.jsxs)("span",{className:"rounded px-2 py-0.5 text-xs ".concat(null!==(l=c[e])&&void 0!==l?l:"bg-blue-50 text-blue-700"),children:[t,c[e]?"":"(在途)"]})},m=(0,a.useMemo)(()=>{var e,a,i,d,o,c,u,x,m,h;let p=[];for(let t of null!=l?l:[])for(let l of null!==(e=t.history)&&void 0!==e?e:[])p.push({at:l.at,icon:"\uD83D\uDCE4",tone:"text-blue-700",text:(0,s.jsxs)("span",{children:[(0,s.jsx)("b",{children:null!==(a=t.jobTitle)&&void 0!==a?a:"职位 #".concat(t.jobCaseId)}),":",l.fromStage?"".concat(l.fromStage," → "):"",null!==(i=l.toStage)&&void 0!==i?i:l.action,l.by?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",l.by]}):null,l.note?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",l.note]}):null]})});for(let e of null!=n?n:[])p.push({at:e.createdAt,icon:"\uD83D\uDCDD",tone:"text-amber-700",text:(0,s.jsxs)("span",{children:["简历变更:",null!==(d=w[e.fieldPath])&&void 0!==d?d:e.fieldPath,"(",null!==(o=N[e.changeType])&&void 0!==o?o:e.changeType,")",(0,s.jsxs)("span",{className:"text-gray-400",children:[" ",k(e.oldValue)," → ",k(e.newValue)]}),e.sourceSystem?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 来源 ",e.sourceSystem]}):null]})});for(let e of null!=t?t:[])p.push({at:e.createdAt,icon:"\uD83C\uDD95",tone:"text-green-700",text:(0,s.jsxs)("span",{children:["新版本简历入库:",null!==(m=null===(c=e.source)||void 0===c?void 0:c.system)&&void 0!==m?m:"未知渠道",(null===(x=e.source)||void 0===x?void 0:null===(u=x.collector)||void 0===u?void 0:u.creatorName)?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 同步人 ",e.source.collector.creatorName]}):null]})});for(let e of null!=r?r:[])p.push({at:e.createdAt,icon:"\uD83D\uDCCA",tone:"text-violet-700",text:(0,s.jsxs)("span",{children:["生成评估:",(0,s.jsx)("b",{children:null!==(h=e.jobTitle)&&void 0!==h?h:"职位 #".concat(e.jobCaseId)}),(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",e.generatedBy]})]})});return p.sort((e,t)=>t.at.localeCompare(e.at)).slice(0,30)},[l,n,t,r]),h=(0,a.useMemo)(()=>(null!=i?i:[]).slice().sort((e,t)=>{var l,s,a,n;return(null!==(a=null===(l=t.scores)||void 0===l?void 0:l.overall)&&void 0!==a?a:0)-(null!==(n=null===(s=e.scores)||void 0===s?void 0:s.overall)&&void 0!==n?n:0)}).slice(0,3),[i]);return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-blue-200 bg-blue-50/50 p-4",children:[(0,s.jsx)("div",{className:"text-xs text-gray-500",children:"最近一次推荐"}),d?(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-lg font-semibold text-gray-900",children:d.jobTitle}),d.toStage?x(d.toStage,d.toStage):null,(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:[(0,u.d3)(d.at),d.by?" \xb7 ".concat(d.by):""]})]}):(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"暂无推荐记录"})]}),(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsxs)("h3",{className:"mb-2 text-sm font-semibold text-gray-900",children:["推荐履历(",o.length,")"]}),o.length?(0,s.jsx)("ul",{className:"space-y-2",children:o.map(e=>(0,s.jsxs)("li",{className:"flex items-center justify-between gap-2 text-sm",children:[(0,s.jsx)("a",{href:"/jobs?id=".concat(e.jobCaseId),className:"truncate text-blue-600 hover:underline",children:e.jobTitle}),x(e.stage,e.stageLabel)]},e.jobCaseId))}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无推荐记录"})]}),(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsx)("h3",{className:"mb-2 text-sm font-semibold text-gray-900",children:"在管职位匹配 Top 3"}),h.length?(0,s.jsx)("ul",{className:"space-y-2",children:h.map(e=>{var t,l,a,n,r,i,d;return(0,s.jsxs)("li",{className:"flex items-center justify-between gap-2 text-sm",children:[(0,s.jsx)("a",{href:"/jobs?id=".concat(e.jobCaseId),className:"truncate text-blue-600 hover:underline",children:(null===(t=e.jobCase)||void 0===t?void 0:t.title)||"职位 #".concat(e.jobCaseId)}),(0,s.jsxs)("span",{className:"rounded px-2 py-0.5 text-xs ".concat((null!==(r=null===(l=e.scores)||void 0===l?void 0:l.overall)&&void 0!==r?r:0)>=75?"bg-green-50 text-green-700":(null!==(i=null===(a=e.scores)||void 0===a?void 0:a.overall)&&void 0!==i?i:0)>=60?"bg-amber-50 text-amber-700":"bg-gray-100 text-gray-600"),children:[null!==(d=null===(n=e.scores)||void 0===n?void 0:n.overall)&&void 0!==d?d:"-"," 分"]})]},e.id)})}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无高匹配在管职位"}),(0,s.jsx)("p",{className:"mt-2 text-xs text-gray-400",children:"完整匹配与规则明细见「简历」tab"})]})]}),(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsx)("h3",{className:"mb-3 text-sm font-semibold text-gray-900",children:"动态(推荐 / 简历变更 / 新版本 / 评估)"}),m.length?(0,s.jsx)("ol",{className:"space-y-2",children:m.map((e,t)=>(0,s.jsxs)("li",{className:"flex items-start gap-2 text-sm",children:[(0,s.jsx)("span",{children:e.icon}),(0,s.jsx)("span",{className:e.tone,children:e.text}),(0,s.jsx)("span",{className:"shrink-0 text-xs text-gray-400",children:(0,u.d3)(e.at)})]},t))}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无动态"})]})]})}let A=[["skill","技能",.25],["experience","经验年限",.2],["industry","行业",.1],["company","公司",.1],["location","地点",.1],["salary","薪资",.1],["education","学历",.05],["stability","稳定性",.05],["availability","可用性",.05]],C=(e,t,l)=>[e,t].filter(Boolean).join(" - ")+(l?"(".concat(l,")"):"");function T(e){let{title:t,children:l}=e;return(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold text-gray-900",children:t}),l]})}function I(e){let{children:t}=e;return(0,s.jsx)("span",{className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700",children:t})}function E(e){var t,l;let{entity:n}=e,i=n.extracted||{},[d,o]=(0,a.useState)(null),[c,u]=(0,a.useState)(!1),[x,m]=(0,a.useState)(!1),[h,p]=(0,a.useState)(null),g=(0,a.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];m(!0);try{var t;let l=e?await (0,r.aA)("/entities/talent/".concat(n.id,"/match-jobs"),{method:"POST",headers:{"Content-Type":"application/json"}}):await (0,r.aA)("/entities/talent/".concat(n.id,"/matches"));o(null!==(t=l.matches)&&void 0!==t?t:[]),u(!1)}catch(e){u(!0)}finally{m(!1)}},[n.id]);(0,a.useEffect)(()=>{g()},[g]);let y=Array.isArray(i.workExperiences)?i.workExperiences:[],b=Array.isArray(i.projects)?i.projects:[],v=Array.isArray(i.education)?i.education:[],j=e=>"string"==typeof e?e:e&&"object"==typeof e&&"string"==typeof e.name?e.name:null,f=(Array.isArray(i.languages)?i.languages:[]).map(j).filter(e=>!!e),N=(Array.isArray(i.skills)?i.skills:[]).map(j).filter(e=>!!e),w=null!==(l=null===(t=i.extra)||void 0===t?void 0:t.sections)&&void 0!==l?l:[],k=i.intent||{},S=[["性别",i.gender],["年龄",null!=i.age?"".concat(i.age," 岁"):null],["城市",i.city],["学历",i.degree],["工作年限",null!=i.workYears?"".concat(i.workYears," 年"):null],["当前职位",i.currentPosition],["当前公司",i.currentCompany],["状态",i.statusTag],["方便联系",i.contactTime]].filter(e=>{let[,t]=e;return null!=t&&""!==t});return(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[i.photoUrl?(0,s.jsx)("img",{src:i.photoUrl,alt:"",className:"h-14 w-14 rounded-full object-cover"}):null,(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xl font-bold text-gray-900",children:i.name||"(未命名)"}),i.nameMasked?(0,s.jsx)(I,{children:"脱敏"}):null]}),S.length?(0,s.jsx)("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-sm text-gray-600",children:S.map(e=>{let[t,l]=e;return(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"text-gray-400",children:t})," ",l]},t)})}):(0,s.jsx)("p",{className:"mt-2 text-sm text-gray-500",children:"仅卡片级数据(搜索入库),尚无详情页解析字段"})]})]}),Object.keys(k).length?(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2 border-t border-gray-100 pt-3 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-400",children:"求职意向"}),k.position?(0,s.jsx)(I,{children:k.position}):null,k.salary?(0,s.jsx)(I,{children:k.salary}):null,k.city?(0,s.jsx)(I,{children:k.city}):null,(k.industries||[]).map(e=>(0,s.jsx)(I,{children:e},e))]}):null,N.length||f.length?(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-sm",children:[N.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-gray-400",children:"技能"}),N.map(e=>(0,s.jsx)(I,{children:e},e))]}):null,f.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"ml-2 text-gray-400",children:"语言"}),f.map(e=>(0,s.jsx)(I,{children:e},e))]}):null]}):null]}),(0,s.jsxs)(T,{title:"在管职位匹配",children:[c?(0,s.jsxs)("p",{className:"text-sm text-red-500",children:["匹配加载失败",(0,s.jsx)("button",{type:"button",onClick:()=>void g(),className:"ml-2 text-blue-500 hover:underline",children:"重试"})]}):null===d?(0,s.jsx)("p",{className:"text-sm text-gray-500",children:x?"匹配计算中…":"加载中…"}):0===d.length?(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无匹配记录"}):(0,s.jsx)("ul",{className:"space-y-3",children:d.map(e=>{var t,l,a,n,r,i,d,o,c,u,x,m,g,y,b,v,j,f;let N=h===e.id,w=null!==(b=e.matchDetails)&&void 0!==b?b:{};return(0,s.jsxs)("li",{className:"rounded border border-gray-100 p-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("span",{className:"font-medium text-gray-900",children:[(null===(t=e.jobCase)||void 0===t?void 0:t.title)||"职位 #".concat(e.jobCaseId),(null===(l=e.jobCase)||void 0===l?void 0:l.company)?(0,s.jsx)("span",{className:"ml-2 text-sm text-gray-500",children:e.jobCase.company}):null]}),(0,s.jsxs)("span",{className:"rounded px-2 py-0.5 text-sm font-medium ".concat((null!==(v=null===(a=e.scores)||void 0===a?void 0:a.overall)&&void 0!==v?v:0)>=75?"bg-green-50 text-green-700":(null!==(j=null===(n=e.scores)||void 0===n?void 0:n.overall)&&void 0!==j?j:0)>=60?"bg-amber-50 text-amber-700":"bg-gray-100 text-gray-600"),children:[null!==(f=null===(r=e.scores)||void 0===r?void 0:r.overall)&&void 0!==f?f:"-"," 分"]})]}),(null===(i=e.recommendation)||void 0===i?void 0:i.aiReason)?(0,s.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-sm text-gray-600",children:e.recommendation.aiReason}):null,(0,s.jsx)("button",{type:"button",onClick:()=>p(N?null:e.id),className:"mt-2 text-xs text-blue-600 hover:underline",children:N?"收起规则明细 ▲":"查看规则明细(为什么这么分)▼"}),N?(0,s.jsxs)("div",{className:"mt-2 space-y-2 border-t border-gray-100 pt-2",children:[w.gate?"fail"===w.gate.status?(0,s.jsxs)("div",{className:"rounded bg-red-50 p-2 text-xs text-red-700",children:[(0,s.jsx)("div",{className:"font-medium",children:"硬性条件不满足(一票否决,已出局)"}),(0,s.jsx)("ul",{className:"mt-1 list-disc pl-4",children:(w.gate.failed||[]).map((e,t)=>(0,s.jsxs)("li",{children:[e.label,e.talentValue?"(候选人:".concat(e.talentValue,")"):"",e.evidence?" JD 证据:「".concat(e.evidence,"」"):""]},t))})]}):"unknown"===w.gate.status?(0,s.jsxs)("div",{className:"rounded bg-amber-50 p-2 text-xs text-amber-700",children:[(0,s.jsx)("div",{className:"font-medium",children:"硬性条件待核实(信息缺失 ≠ 不满足,请人工复核)"}),(0,s.jsx)("ul",{className:"mt-1 list-disc pl-4",children:(w.gate.unknown||[]).map((e,t)=>(0,s.jsxs)("li",{children:[e.label,e.evidence?" JD 证据:「".concat(e.evidence,"」"):""]},t))})]}):(0,s.jsx)("p",{className:"text-xs text-green-700",children:"硬性条件(性别/学历/年龄/地点等):全部满足"}):null,(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2 md:grid-cols-5",children:A.map(t=>{var l;let[a,n,r]=t;return(0,s.jsxs)("div",{className:"rounded bg-gray-50 p-2 text-xs",children:[(0,s.jsxs)("div",{className:"text-gray-400",children:[n," ",(0,s.jsxs)("span",{title:"规则权重",children:["\xd7",r]})]}),(0,s.jsx)("div",{className:"font-medium",children:(null===(l=e.scores)||void 0===l?void 0:l[a])!=null?"".concat(Math.round(100*e.scores[a])):"-"})]},a)})}),"number"==typeof w.vectorCosine?(0,s.jsxs)("p",{className:"text-xs text-gray-500",children:["语义向量(本地 bge-small 余弦,权重 \xd70.2):",(100*w.vectorCosine).toFixed(1)," 分"]}):null,Array.isArray(w.hitSkills)&&w.hitSkills.length?(0,s.jsxs)("p",{className:"text-xs text-green-700",children:["命中技能:",w.hitSkills.map(e=>{var t;return null!==(t=null==e?void 0:e.name)&&void 0!==t?t:e}).join("、")]}):null,Array.isArray(w.missedSkills)&&w.missedSkills.length?(0,s.jsxs)("p",{className:"text-xs text-red-600",children:["缺失技能:",w.missedSkills.map(e=>{var t;return null!==(t=null==e?void 0:e.name)&&void 0!==t?t:e}).join("、")]}):null,Array.isArray(w.concernFlags)&&w.concernFlags.length?(0,s.jsxs)("p",{className:"text-xs text-amber-700",children:["风险提示:",w.concernFlags.join(";")]}):null,(null===(d=w.industryFit)||void 0===d?void 0:d.fitTag)||(null===(o=w.salaryFit)||void 0===o?void 0:o.fitTag)||(null===(c=w.locationFit)||void 0===c?void 0:c.fitTag)||(null===(u=w.experienceFit)||void 0===u?void 0:u.fitTag)?(0,s.jsxs)("p",{className:"text-xs text-gray-500",children:["适配标签:",[null===(x=w.industryFit)||void 0===x?void 0:x.fitTag,null===(m=w.salaryFit)||void 0===m?void 0:m.fitTag,null===(g=w.locationFit)||void 0===g?void 0:g.fitTag,null===(y=w.experienceFit)||void 0===y?void 0:y.fitTag].filter(Boolean).join(" / ")]}):null]}):null]},e.id)})}),(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)("button",{type:"button",disabled:x,onClick:()=>void g(!0),className:"rounded bg-blue-600 px-3 py-1 text-sm text-white hover:bg-blue-700 disabled:opacity-50",children:x?"匹配中…":"重新匹配在管职位"})})]}),y.length?(0,s.jsx)(T,{title:"工作经历(".concat(y.length,")"),children:(0,s.jsx)("ol",{className:"space-y-4",children:y.map((e,t)=>(0,s.jsxs)("li",{className:"border-l-2 border-blue-100 pl-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900",children:e.company||"(公司未知)"}),(0,s.jsx)("span",{className:"text-gray-700",children:e.position}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:C(e.start,e.end,e.duration)})]}),(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap gap-x-3 text-xs text-gray-500",children:[e.department?(0,s.jsxs)("span",{children:["部门:",e.department]}):null,e.location?(0,s.jsxs)("span",{children:["地点:",e.location]}):null,e.reportsTo?(0,s.jsxs)("span",{children:["汇报:",e.reportsTo]}):null,null!=e.subordinates?(0,s.jsxs)("span",{children:["下属:",e.subordinates," 人"]}):null]}),e.responsibilities?(0,s.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-gray-700",children:e.responsibilities}):null,e.extra?(0,s.jsx)("div",{className:"mt-1 flex flex-wrap gap-x-3 text-xs text-gray-500",children:Object.entries(e.extra).map(e=>{let[t,l]=e;return(0,s.jsxs)("span",{children:[t,":",l]},t)})}):null]},t))})}):null,b.length?(0,s.jsx)(T,{title:"项目经历(".concat(b.length,")"),children:(0,s.jsx)("ol",{className:"space-y-4",children:b.map((e,t)=>(0,s.jsxs)("li",{className:"border-l-2 border-green-100 pl-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900",children:e.name||"(项目未知)"}),e.role?(0,s.jsx)("span",{className:"text-gray-700",children:e.role}):null,e.company?(0,s.jsx)("span",{className:"text-sm text-gray-500",children:e.company}):null,(0,s.jsx)("span",{className:"text-xs text-gray-400",children:C(e.start,e.end,e.duration)})]}),e.description?(0,s.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-gray-700",children:e.description}):null,e.duties?(0,s.jsxs)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-gray-600",children:["职责:",e.duties]}):null,e.extra?(0,s.jsx)("div",{className:"mt-1 flex flex-wrap gap-x-3 text-xs text-gray-500",children:Object.entries(e.extra).map(e=>{let[t,l]=e;return(0,s.jsxs)("span",{children:[t,":",l]},t)})}):null]},t))})}):null,v.length?(0,s.jsx)(T,{title:"教育经历(".concat(v.length,")"),children:(0,s.jsx)("ol",{className:"space-y-3",children:v.map((e,t)=>(0,s.jsxs)("li",{className:"flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900",children:e.school||"(学校未知)"}),e.major?(0,s.jsx)("span",{className:"text-gray-700",children:e.major}):null,e.degree?(0,s.jsx)(I,{children:e.degree}):null,e.period?(0,s.jsx)("span",{className:"text-xs text-gray-400",children:e.period}):null,(e.tags||[]).map(e=>(0,s.jsx)(I,{children:e},e))]},t))})}):null,i.selfEvaluation?(0,s.jsx)(T,{title:"自我评价",children:(0,s.jsx)("p",{className:"whitespace-pre-wrap text-sm text-gray-700",children:i.selfEvaluation})}):null,w.map(e=>(0,s.jsx)(T,{title:e.title||e.key,children:(0,s.jsx)("p",{className:"whitespace-pre-wrap text-sm text-gray-700",children:e.text})},e.key))]})}function U(e){var t;let{portraitId:l}=e,[n,i]=(0,a.useState)([]),[d,o]=(0,a.useState)(""),[c,x]=(0,a.useState)(!1),[m,h]=(0,a.useState)(null),[p,g]=(0,a.useState)([]),{sync:y}=(0,j.nu)(),b=null!==(t=null==y?void 0:y.activeTenantId)&&void 0!==t?t:null;(0,a.useEffect)(()=>{(0,r.aA)("/job-cases?limit=200").then(e=>{var t;let l=(Array.isArray(e)?e:null!==(t=null==e?void 0:e.items)&&void 0!==t?t:[]).filter(e=>"active"===e.status||!e.status);i(l),o(e=>e&&l.some(t=>String(t.id)===e)?e:"")}).catch(()=>i([]))},[b]);let v=(0,a.useCallback)(async()=>{if(!l)return;let e=null;try{e=await (0,r.aA)("/talent-portraits/".concat(l,"/evaluations"))}catch(e){}g(e?e.items:[])},[l]);async function f(){if(h(null),!l||!d){h("先选择要评估的职位");return}try{let e=await fetch("".concat((0,r.Ox)(),"/talent-job-evaluations/evaluate-prompt?portraitId=").concat(l,"&jobCaseId=").concat(d));if(!e.ok)throw Error("HTTP ".concat(e.status));let t=await e.json();await navigator.clipboard.writeText(t.prompt),x(!0),setTimeout(()=>x(!1),4e3),setTimeout(()=>void v(),3e4)}catch(e){h(e.message)}}(0,a.useEffect)(()=>{v()},[v]);let N=d?p.filter(e=>String(e.jobCaseId)===d):p;return(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold text-gray-900",children:"评估(人才 \xd7 职位)"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("select",{value:d,onChange:e=>o(e.target.value),className:"rounded border border-gray-300 px-2 py-1 text-sm",children:[(0,s.jsx)("option",{value:"",children:"选择要评估的在管职位…"}),n.map(e=>(0,s.jsx)("option",{value:e.id,children:e.title||"职位 #".concat(e.id)},e.id))]}),(0,s.jsx)("button",{type:"button",onClick:()=>void f(),className:"rounded bg-violet-600 px-3 py-1 text-sm text-white hover:bg-violet-700",children:c?"已复制 ✓ 请发给 agent":"复制评估 prompt"}),m?(0,s.jsx)("span",{className:"text-xs text-red-600",children:m}):null]}),(0,s.jsx)("p",{className:"mt-2 text-xs text-gray-400",children:"评估由 agent 生成后写回;同一人才\xd7职位可多次评估,历史全留痕。原「AI 总结与评估」(不针对职位)已按 2026-10-04 裁定移除。"}),(0,s.jsx)("div",{className:"mt-3 space-y-3",children:N.length?N.map(e=>{var t;return(0,s.jsxs)("div",{className:"rounded border border-gray-100 p-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-gray-400",children:[(0,s.jsx)("span",{className:"font-medium text-gray-800",children:null!==(t=e.jobTitle)&&void 0!==t?t:"职位 #".concat(e.jobCaseId)}),(0,s.jsx)("span",{children:(0,u.d3)(e.createdAt)}),(0,s.jsxs)("span",{children:["生成:",e.generatedBy]}),e.createdBy?(0,s.jsxs)("span",{children:["操作者:",e.createdBy]}):null]}),(0,s.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-gray-700",children:e.content})]},e.id)}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无评估记录"})})]})}let O=e=>"string"==typeof e?e:e&&"object"==typeof e&&"string"==typeof e.name?e.name:null;function D(e){var t;let{entity:l,portraitId:n,versions:r,sources:i}=e,[d,o]=(0,a.useState)("merged"),c=null!=r?r:[],m=null!==(t=c.find(e=>e.id===d))&&void 0!==t?t:null;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>o("merged"),className:"rounded px-3 py-1 text-sm ".concat("merged"===d?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:"合并画像(默认)"}),c.map(e=>{var t,l,a,n,r,i;return(0,s.jsxs)("button",{type:"button",onClick:()=>o(e.id),className:"rounded px-3 py-1 text-sm ".concat(d===e.id?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"),title:"".concat(null!==(r=null===(t=e.source)||void 0===t?void 0:t.url)&&void 0!==r?r:""," ").concat((0,u.d3)(e.createdAt)),children:[null!==(i=null===(l=e.source)||void 0===l?void 0:l.system)&&void 0!==i?i:"未知渠道",(null===(n=e.source)||void 0===n?void 0:null===(a=n.collector)||void 0===a?void 0:a.creatorName)?" \xb7 ".concat(e.source.collector.creatorName):""," \xb7 ",(0,u.d3)(e.createdAt)]},e.id)}),c.length?null:(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"暂无独立版本(合并画像即全部已知信息)"})]}),"merged"!==d&&m?(0,s.jsx)(F,{version:m}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(E,{entity:l}),(0,s.jsx)(U,{portraitId:n}),(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h3",{className:"mb-2 text-lg font-semibold",children:"原始数据(合并画像)"}),(0,s.jsx)(x.Y,{data:l.extracted})]})]}),(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"解析来源"}),i.length?(0,s.jsx)("ul",{className:"space-y-1 text-sm",children:i.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)("a",{href:e.sourceUrl,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:e.domain}),(0,s.jsx)("span",{className:"ml-2 text-xs text-gray-400",children:(0,u.d3)(e.createdAt)})]},e.id))}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无解析来源记录"})]})]})}function F(e){var t,l,a,n,r,i,d,o,c,m,h,p,g;let{version:y}=e,b=null!==(o=y.extracted)&&void 0!==o?o:{},v=Array.isArray(b.workExperiences)?b.workExperiences:[],j=Array.isArray(b.educations)?null!==(c=b.education)&&void 0!==c?c:b.educations:Array.isArray(b.education)?b.education:[],f=(Array.isArray(b.skills)?b.skills:[]).map(O).filter(Boolean),N=null!==(m=b.contact)&&void 0!==m?m:{};return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xl font-bold text-gray-900",children:null!==(p=null!==(h=N.fullName)&&void 0!==h?h:b.name)&&void 0!==p?p:"(未命名)"}),(0,s.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:null!==(g=null===(t=y.source)||void 0===t?void 0:t.system)&&void 0!==g?g:"未知渠道"}),(null===(a=y.source)||void 0===a?void 0:null===(l=a.collector)||void 0===l?void 0:l.creatorName)?(0,s.jsxs)("span",{className:"rounded bg-violet-50 px-2 py-0.5 text-xs text-violet-700",children:["同步人 ",y.source.collector.creatorName]}):null,(0,s.jsx)("span",{className:"text-xs text-gray-400",children:(0,u.d3)(y.createdAt)}),(null===(n=y.confidence)||void 0===n?void 0:n.overall)!=null?(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["置信度 ",Math.round(100*y.confidence.overall),"%"]}):null]}),b.headline?(0,s.jsx)("p",{className:"mt-1 text-gray-600",children:b.headline}):null,(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-sm text-gray-600",children:[b.gender?(0,s.jsxs)("span",{children:["性别 ",b.gender]}):null,(null===(r=b.basic)||void 0===r?void 0:r.gender)?(0,s.jsxs)("span",{children:["性别 ",b.basic.gender]}):null,b.city?(0,s.jsxs)("span",{children:["城市 ",b.city]}):null,(null===(d=b.basic)||void 0===d?void 0:null===(i=d.location)||void 0===i?void 0:i.city)?(0,s.jsxs)("span",{children:["城市 ",b.basic.location.city]}):null]}),f.length?(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-400",children:"技能"}),f.map(e=>(0,s.jsx)("span",{className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700",children:e},e))]}):null]}),v.length?(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("h3",{className:"mb-2 text-lg font-semibold",children:["工作经历(",v.length,")"]}),(0,s.jsx)("ol",{className:"space-y-2",children:v.map((e,t)=>{var l,a,n,r,i;return(0,s.jsxs)("li",{className:"text-sm",children:[(0,s.jsx)("b",{children:null!==(a=null!==(l=e.companyName)&&void 0!==l?l:e.company)&&void 0!==a?a:"(公司未知)"})," ",null!==(n=e.title)&&void 0!==n?n:e.position," ",(0,s.jsx)("span",{className:"text-xs text-gray-400",children:[null!==(r=e.startDate)&&void 0!==r?r:e.start,null!==(i=e.endDate)&&void 0!==i?i:e.end].filter(Boolean).join(" - ")})]},t)})})]}):null,j.length?(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("h3",{className:"mb-2 text-lg font-semibold",children:["教育经历(",j.length,")"]}),(0,s.jsx)("ol",{className:"space-y-1",children:j.map((e,t)=>(0,s.jsxs)("li",{className:"text-sm",children:[(0,s.jsx)("b",{children:e.school})," ",e.major," ",(0,s.jsx)("span",{className:"text-xs text-gray-400",children:e.degree})]},t))})]}):null,(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h3",{className:"mb-2 text-lg font-semibold",children:"原始数据(该版本)"}),(0,s.jsx)(x.Y,{data:y.extracted})]})]})}let P={create:"建档",move:"阶段流转",form:"表单更新",invite:"邀请",invite_approved:"邀请批准",note:"备注",delete:"删除"};function L(e){let{recommendations:t,error:l,onRetry:n}=e,[r,i]=(0,a.useState)(null);return l?(0,s.jsxs)("p",{className:"rounded-lg border border-red-200 bg-white p-5 text-sm text-red-500 shadow-sm",children:["推荐记录加载失败:",l,n?(0,s.jsx)("button",{type:"button",onClick:n,className:"ml-2 text-blue-500 hover:underline",children:"重试"}):null]}):(null==t?void 0:t.length)?(0,s.jsx)("div",{className:"space-y-3",children:t.map(e=>{var t,l,a,n,d;let o=r===e.id,c=Object.entries(null!==(t=e.formData)&&void 0!==t?t:{}).filter(e=>{let[,t]=e;return null!=t&&""!==t});return(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("a",{href:"/jobs?id=".concat(e.jobCaseId),className:"font-medium text-blue-600 hover:underline",children:null!==(l=e.jobTitle)&&void 0!==l?l:"职位 #".concat(e.jobCaseId)}),(0,s.jsx)("span",{className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700",children:null!==(a=e.stageLabel)&&void 0!==a?a:e.stage})]}),(0,s.jsx)("button",{type:"button",onClick:()=>i(o?null:e.id),className:"text-xs text-blue-600 hover:underline",children:o?"收起 ▲":"展开表单与历史 ▼"})]}),o?(0,s.jsxs)("div",{className:"mt-3 space-y-3 border-t border-gray-100 pt-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-1 text-xs text-gray-400",children:["当前阶段表单(",c.length,")"]}),c.length?(0,s.jsx)("dl",{className:"grid gap-x-6 gap-y-1 md:grid-cols-2",children:c.map(e=>{let[t,l]=e;return(0,s.jsxs)("div",{className:"flex gap-2 text-sm",children:[(0,s.jsx)("dt",{className:"shrink-0 text-gray-400",children:t}),(0,s.jsx)("dd",{className:"whitespace-pre-wrap text-gray-800",children:"object"==typeof l?JSON.stringify(l):String(l)})]},t)})}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"(空)"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-1 text-xs text-gray-400",children:["操作历史(",(null!==(n=e.history)&&void 0!==n?n:[]).length,")"]}),(0,s.jsx)("ol",{className:"space-y-1",children:(null!==(d=e.history)&&void 0!==d?d:[]).map((e,t)=>{var l;return(0,s.jsxs)("li",{className:"text-sm text-gray-700",children:[(0,s.jsx)("span",{className:"text-gray-400",children:(0,u.d3)(e.at)})," ",(0,s.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs",children:null!==(l=P[e.action])&&void 0!==l?l:e.action})," ",e.fromStage?(0,s.jsxs)("span",{children:[e.fromStage," → "]}):null,e.toStage?(0,s.jsx)("b",{children:e.toStage}):null,e.by?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",e.by]}):null,e.note?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",e.note]}):null]},t)})})]})]}):null]},e.id)})}):(0,s.jsx)("p",{className:"rounded-lg border border-gray-200 bg-white p-5 text-sm text-gray-500 shadow-sm",children:"暂无推荐记录(可从头部「加入推荐流程」建档,或让 agent 写回)"})}let M={merge:"bg-blue-50 text-blue-700",sync:"bg-violet-50 text-violet-700",manual:"bg-amber-50 text-amber-700",backfill:"bg-gray-100 text-gray-600"},_={"identity.displayName":"姓名","identity.gender":"性别","identity.birthYear":"出生年","identity.location":"地点","identity.nationality":"国籍","professional.headline":"头衔","professional.summary":"简介","professional.currentCompany":"现任公司","professional.currentTitle":"现任职位","professional.titleLevel":"职级","professional.yearsOfExperience":"工作年限","professional.currentStatus":"当前状态","professional.desiredJob":"求职意向","professional.skills":"技能","professional.workExperiences":"工作经历","professional.educations":"教育经历","professional.projects":"项目经历","professional.languages":"语言","professional.certifications":"证书","contact.phones":"电话","contact.emails":"邮箱","contact.wechats":"微信","contact.linkedinUrls":"LinkedIn"},B=e=>{if(null==e)return"(空)";if("object"==typeof e){if(e.truncated)return"".concat(String(e.preview).slice(0,60),"…");if(e.name)return String(e.name);if(e.city)return String(e.city);if(e.added||e.removed){var t,l,s;let a=[],n=e=>{var t,l,s,a,n;return null!==(n=null!==(a=null!==(s=null!==(l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null==e?void 0:e.companyName)&&void 0!==l?l:null==e?void 0:e.school)&&void 0!==s?s:null==e?void 0:e.language)&&void 0!==a?a:null==e?void 0:e.value)&&void 0!==n?n:String(e)};return(null===(t=e.added)||void 0===t?void 0:t.length)&&a.push("新增 ".concat(e.added.map(n).join("、"))),(null===(l=e.removed)||void 0===l?void 0:l.length)&&a.push("移除 ".concat(e.removed.map(n).join("、"))),a.length||null==e.before||a.push("".concat(e.before," → ").concat(null!==(s=e.after)&&void 0!==s?s:"?"," 条")),a.join(";")}return JSON.stringify(e).slice(0,60)}return String(e)};function q(e){let{changes:t}=e;return(null==t?void 0:t.length)?(0,s.jsx)("ol",{className:"space-y-2",children:t.map(e=>{var t,l,a;return(0,s.jsxs)("li",{className:"rounded-lg border border-gray-200 bg-white p-3 text-sm shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900",children:null!==(t=_[e.fieldPath])&&void 0!==t?t:e.fieldPath}),(0,s.jsx)("span",{className:"rounded px-1.5 py-0.5 text-xs ".concat(null!==(l=M[e.changeType])&&void 0!==l?l:"bg-gray-100 text-gray-600"),children:null!==(a=N[e.changeType])&&void 0!==a?a:e.changeType}),e.sourceSystem?(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["来源 ",e.sourceSystem]}):null,(0,s.jsx)("span",{className:"ml-auto text-xs text-gray-400",children:(0,u.d3)(e.createdAt)})]}),(0,s.jsxs)("div",{className:"mt-1 text-gray-600",children:[(0,s.jsx)("span",{className:"text-red-600 line-through decoration-red-300",children:B(e.oldValue)}),(0,s.jsx)("span",{className:"mx-2 text-gray-400",children:"→"}),(0,s.jsx)("span",{className:"text-green-700",children:B(e.newValue)})]}),e.actor?(0,s.jsxs)("div",{className:"mt-0.5 text-xs text-gray-400",children:["操作者:",e.actor]}):null]},e.id)})}):(0,s.jsx)("p",{className:"rounded-lg border border-gray-200 bg-white p-5 text-sm text-gray-500 shadow-sm",children:"暂无字段级变更记录(画像被新解析合并/同步覆盖时自动留痕,自 2026-10-04 起记)"})}function R(e){var t,l,a,n,r,i,d,o,c,u,x,m;let{entity:h}=e,p=h.extracted||{},g=Array.isArray(p.workExperiences)?p.workExperiences:[],y=Array.isArray(p.education)?p.education:[],b=e=>"string"==typeof e?e:e&&"object"==typeof e&&"string"==typeof e.name?e.name:null,v=(Array.isArray(p.skills)?p.skills:[]).map(b).filter(Boolean),j=(Array.isArray(p.languages)?p.languages:[]).map(b).filter(e=>!!e),f=[["博士后",9],["博士",8],["DBA",8],["MBA",7],["EMBA",7],["硕士",6],["研究生",6],["MBA/EMBA",7],["本科",5],["学士",5],["大专",4],["专科",4],["高中",2],["中专",2],["初中",1]],N=e=>{if(!e)return 0;let t=0;for(let[l,s]of f)e.includes(l)&&s>t&&(t=s);return t},w=y.length?y.reduce((e,t)=>N(null==t?void 0:t.degree)>N(null==e?void 0:e.degree)?t:e):null,k=e=>{var t,l;return[null!==(t=e.start)&&void 0!==t?t:e.startDate,null!==(l=e.end)&&void 0!==l?l:e.endDate].filter(Boolean).join(" - ")};return(0,s.jsxs)("div",{className:"mb-4 rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-500",children:"现任"}),(0,s.jsx)("b",{className:"text-gray-900",children:null!==(c=null!==(o=null!==(d=p.currentCompany)&&void 0!==d?d:null===(t=g[0])||void 0===t?void 0:t.companyName)&&void 0!==o?o:null===(l=g[0])||void 0===l?void 0:l.company)&&void 0!==c?c:"(未知)"}),(0,s.jsx)("span",{className:"text-gray-700",children:null!==(m=null!==(x=null!==(u=p.currentPosition)&&void 0!==u?u:null===(a=g[0])||void 0===a?void 0:a.title)&&void 0!==x?x:null===(n=g[0])||void 0===n?void 0:n.position)&&void 0!==m?m:""})]}),g.length?(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)("div",{className:"text-xs text-gray-400",children:["工作经历(近 3 段 / 共 ",g.length," 段)"]}),(0,s.jsx)("ul",{className:"mt-1 space-y-0.5 text-sm text-gray-700",children:g.slice(0,3).map((e,t)=>{var l,a,n;return(0,s.jsxs)("li",{children:[(0,s.jsx)("b",{children:null!==(a=null!==(l=e.companyName)&&void 0!==l?l:e.company)&&void 0!==a?a:"(公司未知)"})," ",null!==(n=e.title)&&void 0!==n?n:e.position," ",(0,s.jsx)("span",{className:"text-xs text-gray-400",children:k(e)})]},t)})})]}):null,y.length?(0,s.jsxs)("div",{className:"mt-2 text-sm text-gray-700",children:[(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["教育(最近 / 最高 / 共 ",y.length," 段):"]})," ",null===(r=y[0])||void 0===r?void 0:r.school," ",null===(i=y[0])||void 0===i?void 0:i.degree,w&&w!==y[0]?" \xb7 最高:".concat(w.school," ").concat(w.degree):""]}):null,v.length||j.length?(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1 text-sm",children:[v.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"技能"}),v.slice(0,12).map(e=>(0,s.jsx)("span",{className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700",children:e},e))]}):null,j.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"ml-2 text-xs text-gray-400",children:"语言"}),j.map(e=>(0,s.jsx)("span",{className:"rounded bg-green-50 px-2 py-0.5 text-xs text-green-700",children:e},e))]}):null]}):null]})}function J(e){var t,l,n;let{entity:i,portraitId:d,matches:o,sources:c}=e,[u,x]=(0,a.useState)("overview"),{versions:m,recommendations:h,changes:p,evaluations:g,recommendationsError:y,reloadRecommendations:b}=function(e){let[t,l]=(0,a.useState)(null),[s,n]=(0,a.useState)(null),[i,d]=(0,a.useState)(null),[o,c]=(0,a.useState)(null),[u,x]=(0,a.useState)(null),[m,h]=(0,a.useState)(0);return(0,a.useEffect)(()=>{if(!e){l([]),n([]),d([]),c([]),x(null);return}let t=!0;return(async()=>{let s=async(e,t)=>{try{return await e}catch(e){return t}},[a,n,i]=await Promise.all([s((0,r.aA)("/parsed-resumes?portraitId=".concat(e)),{items:[]}),s((0,r.aA)("/resume-field-changes?portraitId=".concat(e)),{items:[]}),s((0,r.aA)("/talent-portraits/".concat(e,"/evaluations")),{items:[]})]);t&&(l(a.items),d(n.items),c(i.items))})(),(async()=>{try{let l=await (0,r.aA)("/recommendations/by-portrait/".concat(e));if(!t)return;n(l.items),x(null)}catch(e){if(!t)return;n([]),x(e instanceof Error?e.message:"加载失败")}})(),()=>{t=!1}},[e,m]),{versions:t,recommendations:s,changes:i,evaluations:o,recommendationsError:u,reloadRecommendations:()=>h(e=>e+1)}}(d),v=[{key:"overview",label:"最新情况"},{key:"resumes",label:"简历",count:null!==(t=null==m?void 0:m.length)&&void 0!==t?t:null},{key:"recommendations",label:"推荐记录",count:null!==(l=null==h?void 0:h.length)&&void 0!==l?l:null},{key:"changes",label:"变更历史",count:null!==(n=null==p?void 0:p.length)&&void 0!==n?n:null}];return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-4 flex flex-wrap gap-1 border-b border-gray-200",children:v.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>x(e.key),className:"px-4 py-2 text-sm ".concat(u===e.key?"border-b-2 border-blue-500 font-medium text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.label,null!=e.count&&e.count>0?(0,s.jsxs)("span",{className:"ml-1 text-xs text-gray-400",children:["(",e.count,")"]}):null]},e.key))}),"overview"===u?(0,s.jsx)(S,{versions:m,recommendations:h,changes:p,evaluations:g,matches:o}):null,"resumes"===u?(0,s.jsx)(D,{entity:i,portraitId:d,versions:m,sources:c}):null,"recommendations"===u?(0,s.jsx)(L,{recommendations:h,error:y,onRetry:b}):null,"changes"===u?(0,s.jsx)(q,{changes:p}):null]})}let Y={talent:"人才",job:"职位",company:"公司"},V={talent:"bg-blue-50 text-blue-700",job:"bg-yellow-50 text-yellow-700",company:"bg-green-50 text-green-700"};function W(e){var t,l,n,i,d,o;let{type:c,entity:m,sources:h}=e,[p,g]=(0,a.useState)(h.length?String(h[0].id):""),[y,b]=(0,a.useState)(!1),[j,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(null),[S,A]=(0,a.useState)(null);async function C(){N(null);try{let e=await fetch("".concat((0,r.Ox)(),"/entities/").concat(c,"/").concat(m.id,"/repair-prompt"));if(!e.ok)throw Error("HTTP ".concat(e.status));let t=await e.json();await navigator.clipboard.writeText(t.prompt),b(!0),setTimeout(()=>b(!1),4e3)}catch(e){N(e.message)}}(0,a.useEffect)(()=>{if("talent"!==c)return;let e=!0;return(async()=>{try{var t,l;let s=await fetch("".concat((0,r.Ox)(),"/entities/talent/").concat(m.id,"/matches"));if(!s.ok)return;let a=await s.json();if(!e)return;k(null!==(t=null==a?void 0:a.portraitId)&&void 0!==t?t:null),A(null!==(l=null==a?void 0:a.matches)&&void 0!==l?l:[])}catch(e){}})(),()=>{e=!1}},[c,m.id]);let T="talent"===c?null!==(t=m.name)&&void 0!==t?t:"(未命名)":"job"===c?null!==(l=m.title)&&void 0!==l?l:"(未命名职位)":null!==(n=m.name)&&void 0!==n?n:"(未命名)",I="talent"===c?m.headline:"job"===c?m.company:"",E=h.find(e=>String(e.id)===p)||h[0];return(0,s.jsxs)("div",{className:"w-full",children:["talent"===c?(0,s.jsx)(v,{entity:m}):null,(0,s.jsxs)("header",{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:T}),(0,s.jsx)("span",{className:"rounded px-2 py-0.5 text-xs ".concat(null!==(i=V[c])&&void 0!==i?i:"bg-gray-100 text-gray-600"),children:null!==(d=Y[c])&&void 0!==d?d:c}),(0,s.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:m.source}),m.sourceUrl?(0,s.jsx)("a",{href:m.sourceUrl,target:"_blank",rel:"noreferrer",title:m.sourceUrl,className:"max-w-xl truncate text-sm text-blue-600 hover:underline",children:m.sourceUrl}):null]}),I?(0,s.jsx)("p",{className:"mt-1 text-gray-600",children:I}):null,m.sessionId?(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:C,className:"rounded bg-amber-600 px-3 py-1 text-sm text-white hover:bg-amber-700",children:y?"已复制 ✓ 请发给 agent":"解析有误让agent修复"}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"按录制重解析、修解析 bug、提 issue"}),j?(0,s.jsx)("span",{className:"text-xs text-red-600",children:j}):null]}):null,"talent"===c?(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,s.jsx)(f,{entityId:m.id,name:T}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"加入某职位推荐流水线,默认待邀请"})]}):null]}),"talent"===c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(R,{entity:m}),(0,s.jsx)(J,{entity:m,portraitId:w,matches:S,sources:h.map(e=>({id:e.id,sourceUrl:e.sourceUrl,domain:e.domain,createdAt:e.createdAt}))})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"解析来源"}),E?(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"当前来源页面"}),(0,s.jsx)("a",{href:E.sourceUrl,target:"_blank",rel:"noreferrer",className:"break-all text-sm text-blue-600 hover:underline",children:E.sourceUrl}),E.hasSnapshot?(0,s.jsx)("span",{className:"ml-2 rounded bg-green-50 px-1.5 py-0.5 text-xs text-green-700",children:"有录制快照"}):null]}),h.length>1?(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("label",{className:"text-sm text-gray-600",children:"历史来源:"}),(0,s.jsx)("select",{value:p,onChange:e=>g(e.target.value),className:"rounded border border-gray-300 px-2 py-1 text-sm",children:h.map(e=>(0,s.jsxs)("option",{value:e.id,children:[e.domain," \xb7 ",(0,u.d3)(e.createdAt)]},e.id))}),(0,s.jsx)("a",{href:E.sourceUrl,target:"_blank",rel:"noreferrer",className:"rounded bg-blue-600 px-3 py-1 text-sm text-white hover:bg-blue-700",children:"打开该来源页面"})]}):null]}):(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"暂无解析来源记录"})]}),(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"原始数据"}),(0,s.jsx)(x.Y,{data:null!==(o=m.extracted)&&void 0!==o?o:m.raw})]})]})]})}var z=l(65912),H=l(26119),G=l(93464);function K(e){let t=new URLSearchParams;Object.entries(e).forEach(e=>{let[l,s]=e;s&&t.set(l,s)});let l=t.toString();return l?"?".concat(l):""}function Q(e){var t,l;let{type:x,label:m,batchDelete:h}=e,p=(0,n.useRouter)(),g=(0,n.usePathname)(),y=(0,n.useSearchParams)(),b=y.get("id")||"",v=(0,a.useMemo)(()=>({q:y.get("q")||"",status:"",from:y.get("from")||"",to:y.get("to")||""}),[y]),[f,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(!1),[S,A]=(0,a.useState)(!1),[C,T]=(0,a.useState)(0),I=(0,a.useCallback)(e=>{var t,l;let s=null!==(t=e.filters)&&void 0!==t?t:v,a=K({id:null!==(l=e.id)&&void 0!==l?l:b,q:s.q,from:s.from,to:s.to});p.replace("".concat(g).concat(a))},[v,b,g,p]),{session:E,sync:U}=(0,j.nu)(),O=null!==(t=null==U?void 0:U.activeTenantId)&&void 0!==t?t:null,D=(0,H.B)({deleteUrl:"/entities/".concat(x),label:m,onDeleted:()=>F.refresh(),currentUserId:null!==(l=null==E?void 0:E.hmUserId)&&void 0!==l?l:null}),F=(0,G.k)({fetchPage:(0,a.useCallback)(async(e,t)=>{let l=K({q:v.q,from:v.from,to:v.to}),s=await (0,r.aA)("/entities?type=".concat(x,"&limit=").concat(t,"&offset=").concat(e).concat(l.replace("?","&")));return{items:s.items,total:s.total,nextOffset:s.nextOffset}},[x,v.q,v.from,v.to,O]),pageSize:50,deps:[x,v.q,v.from,v.to,O]}),P=F.items;(0,a.useEffect)(()=>{D.prune(P.map(e=>String(e.id)))},[P,D]);let L=(0,a.useCallback)(()=>{if(P.length)return P[0].updatedAt},[P]);(0,a.useEffect)(()=>{if(!b){N(null),A(!1);return}k(!0),A(!1),Promise.all([(0,r.aA)("/entities/".concat(x,"/").concat(b)),(0,r.aA)("/entities/".concat(x,"/").concat(b,"/sources")).catch(()=>null)]).then(e=>{let[t,l]=e;N({entity:t.entity,sources:l?l.items:[]})}).catch(()=>{N(null),A(!0)}).finally(()=>{k(!1)})},[x,b,O,C]);let M=(0,a.useMemo)(()=>P.map(e=>{var t,l,a;let n=String(e.id),r="talent"===x?(0,s.jsx)(z.oj,{name:null!==(t=e.name)&&void 0!==t?t:"(未命名)",headline:e.headline,source:e.source,updatedAt:e.updatedAt}):"job"===x?(0,s.jsx)(z.rY,{title:null!==(l=e.title)&&void 0!==l?l:"(无标题)",source:e.source,company:e.company,sourceUrl:e.sourceUrl,updatedAt:e.updatedAt}):(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"font-medium text-gray-900",children:null!==(a=e.name)&&void 0!==a?a:"(未命名)"}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-2 text-xs text-gray-400",children:[(0,s.jsx)("span",{children:e.source}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsx)("span",{children:(0,u.d3)(e.updatedAt)})]})]});return{id:n,content:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[h&&D.checkbox(n),r]})}}),[P,x,h,D]),_=b?w?(0,s.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"加载中…"}):S?(0,s.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-red-500",children:["加载失败",(0,s.jsx)("button",{type:"button",onClick:()=>T(e=>e+1),className:"text-blue-500 hover:underline",children:"重试"})]}):f?(0,s.jsx)(W,{type:x,entity:f.entity,sources:f.sources}):(0,s.jsxs)("div",{className:"flex h-full items-center justify-center text-red-500",children:["未找到该",m]}):(0,s.jsxs)("div",{className:"flex h-full items-center justify-center text-gray-400",children:["请在左侧选择一条",m,"查看详情"]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.m,{filterBar:(0,s.jsxs)("div",{className:"border-b border-gray-200 bg-white",children:[(0,s.jsx)(i.f,{value:v,onChange:e=>I({filters:e})}),(0,s.jsx)(c.Y,{pollUrl:"/entities/count?type=".concat(x),getLatestTimestamp:L,onRefresh:()=>F.refresh(),label:m}),h&&D.bar(M)]}),listPanel:F.error?(0,s.jsxs)("div",{className:"flex-1 overflow-auto p-4 text-center text-sm",children:[(0,s.jsx)("span",{className:"text-red-500",children:"加载失败"}),(0,s.jsx)("button",{type:"button",onClick:()=>F.refresh(),className:"ml-2 text-blue-500 hover:underline",children:"重试"})]}):(0,s.jsx)(o.L,{items:M,selectedId:b,onSelect:e=>I({id:e}),loading:F.loading,emptyText:"暂无".concat(m,"数据"),onLoadMore:F.loadMore,loadingMore:F.loadingMore,exhausted:F.exhausted}),detailPanel:_}),D.modal()]})}function X(e){return(0,s.jsx)(a.Suspense,{fallback:(0,s.jsx)("div",{className:"p-6 text-gray-500",children:"加载中…"}),children:(0,s.jsx)(Q,{...e})})}},37202:function(e,t,l){l.d(t,{f:function(){return n}});var s=l(72835),a=l(60635);function n(e){let{value:t,showStatus:l,statusOptions:n,onChange:r}=e,[i,d]=(0,a.useState)(t);return(0,a.useEffect)(()=>{d(t)},[t.q,t.status,t.from,t.to]),(0,a.useEffect)(()=>{let e=setTimeout(()=>{(i.q!==t.q||i.status!==t.status||i.from!==t.from||i.to!==t.to)&&r(i)},300);return()=>clearTimeout(e)},[i.q,i.status,i.from,i.to]),(0,s.jsxs)("div",{className:"space-y-2 border-b border-gray-200 bg-white p-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)("input",{type:"text",value:i.q,onChange:e=>d(t=>({...t,q:e.target.value})),placeholder:"搜索关键词...",className:"w-full rounded border border-gray-300 px-2 py-1.5 pr-8 text-sm outline-none focus:border-blue-500"}),(0,s.jsx)("button",{type:"button",onClick:()=>r({q:"",status:"",from:"",to:""}),title:"重置筛选",className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 disabled:opacity-30",disabled:!i.q&&!i.status&&!i.from&&!i.to,children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),l?(0,s.jsxs)("select",{value:i.status,onChange:e=>d(t=>({...t,status:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500",children:[(0,s.jsx)("option",{value:"",children:"全部状态"}),(n||[]).map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))]}):null]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"date",value:i.from,onChange:e=>d(t=>({...t,from:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"}),(0,s.jsx)("span",{className:"text-sm text-gray-400",children:"-"}),(0,s.jsx)("input",{type:"date",value:i.to,onChange:e=>d(t=>({...t,to:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"})]})]})}},86777:function(e,t,l){l.d(t,{Y:function(){return d}});var s=l(72835),a=l(60635);function n(e){let{value:t}=e;if(null===t)return(0,s.jsx)("span",{className:"italic text-gray-400",children:"null"});if(void 0===t)return(0,s.jsx)("span",{className:"italic text-gray-400",children:"undefined"});switch(typeof t){case"string":return(0,s.jsxs)("span",{className:"break-all text-red-700",children:['"',t,'"']});case"number":return(0,s.jsx)("span",{className:"text-emerald-700",children:String(t)});case"boolean":return(0,s.jsx)("span",{className:"text-blue-700",children:String(t)});default:return(0,s.jsx)("span",{className:"text-gray-700",children:String(t)})}}function r(e){let{name:t}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"text-indigo-700",children:['"',t,'"']}),(0,s.jsx)("span",{className:"text-gray-500",children:": "})]})}function i(e){let{name:t,value:l,depth:d}=e,[o,c]=(0,a.useState)(d<2);if(!("object"==typeof l&&null!==l&&!Array.isArray(l))&&!Array.isArray(l))return(0,s.jsxs)("div",{className:"min-w-0",children:[null!==t?(0,s.jsx)(r,{name:t}):null,(0,s.jsx)(n,{value:l})]});let u=Array.isArray(l),x=u?l.map((e,t)=>[String(t),e]):Object.entries(l),m=u?"]":"}",h=x.length;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"group flex cursor-pointer select-none items-baseline rounded hover:bg-gray-100",onClick:()=>c(e=>!e),role:"button","aria-expanded":o,children:[(0,s.jsx)("span",{className:"mr-0.5 inline-block w-4 shrink-0 text-center text-gray-400",children:h>0?o?"▾":"▸":""}),null!==t?(0,s.jsx)(r,{name:t}):null,(0,s.jsx)("span",{className:"text-gray-700",children:u?"[":"{"}),o?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"mx-1 rounded bg-gray-100 px-1 text-gray-400 group-hover:bg-gray-200",children:u?"".concat(h," 项"):"".concat(h," 键")}),(0,s.jsx)("span",{className:"text-gray-700",children:m})]})]}),o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"ml-[7px] border-l border-gray-200 pl-3",children:x.map(e=>{let[t,l]=e;return(0,s.jsx)(i,{name:u?null:t,value:l,depth:d+1},t)})}),(0,s.jsx)("div",{className:"pl-5 text-gray-700",children:m})]}):null]})}function d(e){let{data:t}=e;return null==t?(0,s.jsx)("div",{className:"text-xs text-gray-400",children:"(无数据)"}):(0,s.jsx)("div",{className:"max-h-[32rem] overflow-auto rounded bg-gray-50 p-3 font-mono text-xs leading-5",children:(0,s.jsx)(i,{name:null,value:t,depth:0})})}},19036:function(e,t,l){l.d(t,{Y:function(){return r}});var s=l(72835),a=l(60635),n=l(74431);function r(e){let{pollUrl:t,intervalMs:l=5e3,onRefresh:r,getLatestTimestamp:i,label:d="新数据"}=e,[o,c]=(0,a.useState)(0),[u,x]=(0,a.useState)(!1),m=(0,a.useRef)(void 0);return((0,a.useEffect)(()=>{let e=()=>x(document.hidden);return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]),(0,a.useEffect)(()=>{m.current=i(),c(0)},[i]),(0,a.useEffect)(()=>{if(u)return;let e=async()=>{let e=m.current;if(!e)return;let l=t.includes("?")?"&":"?",s=0;try{var a;let r=await (0,n.aA)("".concat(t).concat(l,"since=").concat(encodeURIComponent(e)));s=null!==(a=r.count)&&void 0!==a?a:0}catch(e){}c(e=>Math.max(e,s))};e();let s=setInterval(e,l);return()=>clearInterval(s)},[t,l,u]),o<=0)?null:(0,s.jsxs)("button",{type:"button",onClick:()=>{c(0),r()},className:"w-full bg-blue-50 px-3 py-2 text-center text-sm text-blue-700 hover:bg-blue-100 active:bg-blue-200",children:["有 ",o," 条",d,",点击刷新"]})}}}]);
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="89f41ef8-c626-4ab1-bb49-bc914404a112",e._sentryDebugIdIdentifier="sentry-dbid-89f41ef8-c626-4ab1-bb49-bc914404a112")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[852],{70852:function(e,t,l){l.d(t,{EntityListPage:function(){return X}});var s=l(72835),a=l(60635),n=l(27473),r=l(74431),i=l(37202),d=l(94518),o=l(63718),c=l(19036),u=l(8448),x=l(86777);let m=["workExperiences","projects","education"],h={intent:["position","salary","city","industries"]},p={name:"姓名",headline:"头衔",currentPosition:"现职位",currentCompany:"现公司",city:"城市",degree:"学历",workYears:"工作年限",age:"年龄",gender:"性别",resId:"resId",statusTag:"状态标签",contactTime:"方便联系时间",phone:"电话",email:"邮箱",profileUrl:"主页 URL",sourceUrl:"来源 URL",selfEvaluation:"自我评价",statement:"平台声明","intent.position":"期望职位","intent.salary":"期望薪资","intent.city":"期望城市","intent.industries":"期望行业",updatedAt:"更新时间"},g={workExperiences:"工作经历",projects:"项目经历",education:"教育经历"},y={company:"公司",position:"职位",period:"时间段",start:"开始",end:"结束",department:"部门",location:"地点",reportsTo:"汇报对象",school:"学校",major:"专业",degree:"学历",name:"名称",role:"角色",description:"描述",duties:"职责",industry:"行业"};function b(e){return null==e||""===e?"—":Array.isArray(e)?e.length?e.map(e=>b(e)).filter(e=>"—"!==e).join("、"):"—":"object"==typeof e?JSON.stringify(e):"string"==typeof e&&/^\d{4}-\d{2}-\d{2}T/.test(e)?(0,u.d3)(e):String(e)}function v(e){var t;let{entity:l}=e,i=(0,n.useRouter)(),d=l.id,[o,c]=(0,a.useState)(null),[x,v]=(0,a.useState)(!1),[j,f]=(0,a.useState)({}),[N,w]=(0,a.useState)(null),[k,S]=(0,a.useState)(new Set),[A,C]=(0,a.useState)({}),[T,I]=(0,a.useState)({}),[E,U]=(0,a.useState)(!1),[O,D]=(0,a.useState)("");(0,a.useEffect)(()=>{let e=!0;return c(null),D(""),(async()=>{try{let t=await (0,r.aA)("/entities/talent/".concat(d,"/duplicates"));e&&c(t.candidates)}catch(t){e&&c([])}})(),()=>{e=!1}},[d]);let F=(0,a.useMemo)(()=>{var e;return null!==(e=l.extracted)&&void 0!==e?e:{}},[l.extracted]),P=async e=>{if(j[e])return j[e];try{let t=await (0,r.aA)("/entities/talent/".concat(e));if(!t.entity)return null;return f(l=>({...l,[e]:t.entity})),t.entity}catch(e){return null}},L=async()=>{var e,t,l,s,a,n,r;U(!0),D("");let i=[d,...(null!=o?o:[]).map(e=>e.talent.id)],c=await Promise.all(i.map(e=>P(e)));if(U(!1),c.some(e=>!e)){D("全量简历拉取失败,请重试");return}let u=c[0],x=null!==(t=u.extracted)&&void 0!==t?t:{},p={name:u.name,headline:u.headline},g={};for(let e of Object.keys(x))if(m.includes(e))g[e]=Array.isArray(x[e])?[...x[e]]:[];else if(h[e]){let t=null!==(s=x[e])&&void 0!==s?s:{};for(let l of h[e])p["".concat(e,".").concat(l)]=null!==(a=t[l])&&void 0!==a?a:"industries"===l?[]:""}else(null==(r=x[e])||["string","number","boolean"].includes(typeof r))&&!e.startsWith("_")&&(p[e]=null!==(l=x[e])&&void 0!==l?l:"");C(p),I(g),w(null!==(n=null==o?void 0:null===(e=o[0])||void 0===e?void 0:e.talent.id)&&void 0!==n?n:null),v(!0)},M=e=>{var t;let s=[],a=t=>{var l,s,a,n;if(t){if("name"===e)return t.name;if("headline"===e)return t.headline;if(e.startsWith("intent.")){let l=e.slice(7),n=null===(a=t.extracted)||void 0===a?void 0:null===(s=a.intent)||void 0===s?void 0:s[l];return"industries"===l?Array.isArray(n)?n:[]:null!=n?n:""}return null!==(n=null===(l=t.extracted)||void 0===l?void 0:l[e])&&void 0!==n?n:""}},n=a(null!==(t=j[d])&&void 0!==t?t:l);for(let e of(s.push({id:0,label:"当前",value:n}),null!=o?o:[])){let t=j[e.talent.id];if(!t)continue;let l=a(t);void 0!==l&&"—"!==b(l)&&s.push({id:e.talent.id,label:"#".concat(e.talent.id),value:l})}return s},_=(e,t)=>C(l=>({...l,[e]:t})),B=async e=>{U(!0);try{await (0,r.aA)("/entities/talent/".concat(d,"/duplicates/dismiss"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({otherId:e})}),c(t=>(null!=t?t:[]).filter(t=>t.talent.id!==e)),N===e&&w(null)}catch(e){D("标注失败,请重试")}finally{U(!1)}},q=async()=>{var e,t,l,s;let a={...F};for(let[t,l]of Object.entries(A))if("name"!==t&&"headline"!==t){if(t.startsWith("intent.")){let s=t.slice(7);a.intent={...null!==(e=a.intent)&&void 0!==e?e:{},[s]:l}}else a[t]="number"!=typeof(s=F[t])||"string"!=typeof l||""===l.trim()||Number.isNaN(Number(l))?"boolean"==typeof s&&"string"==typeof l?"true"===l:l:Number(l)}for(let e of m)T[e]&&(a[e]=T[e]);let n=(null!=o?o:[]).filter(e=>!k.has(e.talent.id)).map(e=>e.talent.id);if(0===n.length){D("未勾选任何候选参与合并");return}U(!0);let c=!1;for(let e of n)try{await (0,r.aA)("/entities/talent/merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepId:d,removeId:e,extracted:a,name:null!==(t=A.name)&&void 0!==t?t:null,headline:null!==(l=A.headline)&&void 0!==l?l:null})})}catch(e){c=!0;break}if(U(!1),c){D("合并失败,请重试");return}i.replace("/talents?id=".concat(d)),i.refresh(),window.location.reload()},R=async()=>{let e=(null!=o?o:[]).filter(e=>!k.has(e.talent.id)).map(e=>e.talent.id);if(0===e.length){D("未勾选任何候选参与合并");return}U(!0);let t=!0;for(let l of e)try{await (0,r.aA)("/entities/talent/merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepId:d,removeId:l})})}catch(e){t=!1;break}if(U(!1),!t){D("合并失败,请重试");return}i.replace("/talents?id=".concat(d)),i.refresh(),window.location.reload()};if(null===o||0===o.length)return null;let J=null!==(t=o.find(e=>e.talent.id===N))&&void 0!==t?t:null,Y=null!=N?j[N]:null,V=e=>(0,s.jsx)("span",{className:"flex flex-wrap items-center gap-1",children:M(e).map(t=>(0,s.jsx)("button",{type:"button",title:"采纳:".concat(b(t.value)),onClick:()=>_(e,t.value),className:"rounded border border-gray-200 px-1.5 py-0.5 text-xs text-gray-500 hover:border-blue-400 hover:text-blue-600",children:t.label},t.id))});return(0,s.jsxs)("div",{className:"mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("span",{className:"text-sm font-medium text-amber-800",children:["发现 ",o.length," 条可能重复的人才记录"]}),(0,s.jsx)("button",{onClick:()=>void L(),disabled:E,className:"rounded bg-amber-600 px-3 py-1 text-sm text-white hover:bg-amber-700 disabled:opacity-50",children:"查看并处理"}),(0,s.jsx)("button",{onClick:()=>void B(o[0].talent.id),disabled:E,className:"rounded border border-amber-400 px-3 py-1 text-sm text-amber-700 hover:bg-amber-100 disabled:opacity-50",children:"与最高分条目非重复"}),O?(0,s.jsx)("span",{className:"text-sm text-red-600",children:O}):null]}),x?(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 p-2 sm:p-4",onClick:()=>v(!1),children:(0,s.jsxs)("div",{className:"flex max-h-[92vh] w-full max-w-6xl flex-col overflow-hidden rounded-lg bg-white shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 border-b border-gray-200 px-4 py-3",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"重复简历合并工作区"}),(0,s.jsxs)("span",{className:"text-sm text-gray-500",children:["当前 #",d,l.name?" \xb7 ".concat(l.name):""," — ",o.length," 条候选"]}),(0,s.jsx)("button",{onClick:()=>v(!1),className:"ml-auto text-sm text-gray-500 hover:text-gray-700",children:"关闭"})]}),(0,s.jsxs)("div",{className:"grid flex-1 gap-0 overflow-hidden md:grid-cols-[250px,1fr]",children:[(0,s.jsxs)("div",{className:"overflow-y-auto border-b border-gray-200 p-3 md:border-b-0 md:border-r",children:[(0,s.jsx)("div",{className:"mb-2 text-xs font-medium text-gray-500",children:"候选简历(逐条处理)"}),(0,s.jsx)("div",{className:"space-y-2",children:o.map(e=>{var t;return(0,s.jsxs)("div",{className:"rounded-lg border p-2 ".concat(N===e.talent.id?"border-blue-400 bg-blue-50":"border-gray-200"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:!k.has(e.talent.id),disabled:E,onChange:t=>{S(l=>{let s=new Set(l);return t.target.checked?s.delete(e.talent.id):s.add(e.talent.id),s})},title:"勾选=同一人,参与本次合并"}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-900",children:null!==(t=e.talent.name)&&void 0!==t?t:"(未命名)"}),(0,s.jsxs)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-600",children:["相似度 ",e.score]})]}),(0,s.jsxs)("div",{className:"mt-0.5 truncate text-xs text-gray-500",title:e.talent.sourceUrl,children:[e.talent.source," \xb7 ",(0,u.d3)(e.talent.updatedAt)]}),(0,s.jsxs)("div",{className:"mt-1.5 flex gap-1.5",children:[(0,s.jsx)("button",{type:"button",onClick:()=>w(e.talent.id),className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-700 hover:bg-gray-50",children:"选中对比"}),(0,s.jsx)("button",{type:"button",disabled:E,onClick:()=>void B(e.talent.id),className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-700 hover:bg-gray-50 disabled:opacity-50",children:"非同一人"})]})]},e.talent.id)})})]}),(0,s.jsxs)("div",{className:"flex flex-col overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 border-b border-gray-100 px-3 py-2",children:[(0,s.jsx)("h4",{className:"text-sm font-semibold text-gray-900",children:"最终采用简历(可编辑)"}),(0,s.jsx)("button",{type:"button",onClick:()=>{L()},className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-600 hover:bg-gray-50",children:"重置为当前简历"})]}),(0,s.jsx)("div",{className:"divide-y divide-gray-100",children:Object.keys(A).map(e=>{var t,a;return(0,s.jsxs)("div",{className:"grid grid-cols-[90px,1fr,auto] items-center gap-2 px-3 py-1.5",children:[(0,s.jsx)("label",{className:"text-xs text-gray-500",children:null!==(t=p[e])&&void 0!==t?t:e}),"sourceUrl"===e?(0,s.jsx)("a",{href:String(null!==(a=A[e])&&void 0!==a?a:l.sourceUrl),target:"_blank",rel:"noreferrer",className:"truncate text-sm text-blue-600 hover:underline",children:"—"===b(A[e])?l.sourceUrl:b(A[e])}):"selfEvaluation"===e||"statement"===e?(0,s.jsx)("textarea",{value:"—"===b(A[e])?"":String(A[e]),onChange:t=>_(e,t.target.value),rows:2,className:"w-full rounded border border-gray-300 px-2 py-1 text-sm"}):(0,s.jsx)("input",{value:"—"===b(A[e])?"":String(A[e]),onChange:t=>_(e,t.target.value),className:"w-full rounded border border-gray-300 px-2 py-1 text-sm"}),V(e)]},e)})})]}),m.map(e=>{var t,l,a;let n=null!==(t=T[e])&&void 0!==t?t:[],r=[];for(let t of null!=o?o:[]){let s=j[t.talent.id],a=null==s?void 0:null===(l=s.extracted)||void 0===l?void 0:l[e];Array.isArray(a)&&a.forEach(e=>r.push({id:t.talent.id,item:e}))}return(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,s.jsx)("div",{className:"flex items-center justify-between border-b border-gray-100 px-3 py-2",children:(0,s.jsxs)("h4",{className:"text-sm font-semibold text-gray-900",children:[null!==(a=g[e])&&void 0!==a?a:e,"(",n.length,")"]})}),0===n.length&&0===r.length?(0,s.jsx)("p",{className:"px-3 py-2 text-xs text-gray-400",children:"两侧均无数据"}):(0,s.jsxs)("div",{className:"space-y-2 p-3",children:[n.map((t,l)=>(0,s.jsxs)("div",{className:"rounded border border-gray-200 p-2",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 lg:grid-cols-4",children:Object.keys(null!=t?t:{}).filter(e=>!e.startsWith("_")).map(a=>{var r;return(0,s.jsxs)("label",{className:"block",children:[(0,s.jsx)("span",{className:"text-xs text-gray-400",children:null!==(r=y[a])&&void 0!==r?r:a}),"string"==typeof t[a]&&t[a].length>40?(0,s.jsx)("textarea",{value:t[a],rows:2,onChange:t=>{let s=[...n];s[l]={...s[l],[a]:t.target.value},I(t=>({...t,[e]:s}))},className:"w-full rounded border border-gray-300 px-2 py-1 text-xs"}):(0,s.jsx)("input",{value:"—"===b(t[a])?"":String(t[a]),onChange:t=>{let s=[...n];s[l]={...s[l],[a]:t.target.value},I(t=>({...t,[e]:s}))},className:"w-full rounded border border-gray-300 px-2 py-1 text-xs"})]},a)})}),(0,s.jsx)("div",{className:"mt-1.5 flex items-center gap-2",children:(0,s.jsx)("button",{type:"button",onClick:()=>I(t=>({...t,[e]:n.filter((e,t)=>t!==l)})),className:"rounded border border-red-200 px-2 py-0.5 text-xs text-red-600 hover:bg-red-50",children:"删除此条"})})]},l)),r.length?(0,s.jsxs)("div",{className:"rounded border border-dashed border-gray-300 p-2",children:[(0,s.jsx)("div",{className:"mb-1 text-xs text-gray-500",children:"候选条目(选择合入或更新)"}),(0,s.jsx)("div",{className:"space-y-1.5",children:r.map((t,l)=>{var a,r,i,d,o,c,u,x,m;let h=n.findIndex(e=>(function(e,t){let l=e=>{var t,l,s;return String(null!==(s=null!==(l=null!==(t=null==e?void 0:e.company)&&void 0!==t?t:null==e?void 0:e.school)&&void 0!==l?l:null==e?void 0:e.name)&&void 0!==s?s:"")},s=e=>{var t,l,s;return String(null!==(s=null==e?void 0:e.period)&&void 0!==s?s:"".concat(null!==(t=null==e?void 0:e.start)&&void 0!==t?t:"","-").concat(null!==(l=null==e?void 0:e.end)&&void 0!==l?l:""))},a=l(e),n=l(t),r=s(e),i=s(t);return!!a&&!!n&&a===n||!!r&&!!i&&r===i&&(!a||!n||a===n)})(e,t.item));return(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,s.jsxs)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-gray-500",children:["#",t.id]}),(0,s.jsxs)("span",{className:"min-w-0 flex-1 truncate text-gray-700",children:[b(null!==(i=null!==(r=null!==(a=t.item.company)&&void 0!==a?a:t.item.school)&&void 0!==r?r:t.item.name)&&void 0!==i?i:"")," \xb7 ",b(null!==(c=null!==(o=null!==(d=t.item.position)&&void 0!==d?d:t.item.major)&&void 0!==o?o:t.item.role)&&void 0!==c?c:"")," \xb7 ",b(null!==(m=t.item.period)&&void 0!==m?m:"".concat(null!==(u=t.item.start)&&void 0!==u?u:"","-").concat(null!==(x=t.item.end)&&void 0!==x?x:""))]}),h>=0?(0,s.jsxs)("button",{type:"button",onClick:()=>{let l=[...n];l[h]={...t.item},I(t=>({...t,[e]:l}))},className:"shrink-0 rounded border border-blue-300 px-2 py-0.5 text-blue-600 hover:bg-blue-50",children:["更新条目",h+1]}):(0,s.jsx)("button",{type:"button",onClick:()=>I(l=>({...l,[e]:[...n,{...t.item}]})),className:"shrink-0 rounded border border-green-300 px-2 py-0.5 text-green-700 hover:bg-green-50",children:"合入"})]},l)})})]}):null]})]},e)}),J&&Y?(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,s.jsx)("div",{className:"border-b border-gray-100 px-3 py-2",children:(0,s.jsxs)("h4",{className:"text-sm font-semibold text-gray-900",children:["与候选 #",J.talent.id," 对比",J.reasons.length?(0,s.jsx)("span",{className:"ml-2 space-x-1",children:J.reasons.map(e=>(0,s.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs font-normal text-gray-600",children:e},e))}):null]})}),(0,s.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b border-gray-100 text-left text-xs text-gray-500",children:[(0,s.jsx)("th",{className:"py-1.5 pl-3 pr-2 font-medium",children:"字段"}),(0,s.jsxs)("th",{className:"py-1.5 pr-2 font-medium",children:["当前 #",d]}),(0,s.jsxs)("th",{className:"py-1.5 pr-3 font-medium",children:["候选 #",J.talent.id]})]})}),(0,s.jsx)("tbody",{children:Object.keys(A).map(e=>{var t,a,n,r;let i=b(null===(t=M(e)[0])||void 0===t?void 0:t.value),d=b((()=>{var t,l,s,a;let n=j[J.talent.id];if(n){if("name"===e)return n.name;if("headline"===e)return n.headline;if(e.startsWith("intent.")){let t=e.slice(7),a=null===(s=n.extracted)||void 0===s?void 0:null===(l=s.intent)||void 0===l?void 0:l[t];return"industries"===t?Array.isArray(a)?a:[]:null!=a?a:""}return null!==(a=null===(t=n.extracted)||void 0===t?void 0:t[e])&&void 0!==a?a:""}})()),o=i!==d&&"—"!==i&&"—"!==d;return(0,s.jsxs)("tr",{className:"border-b border-gray-50",children:[(0,s.jsx)("td",{className:"py-1 pl-3 pr-2 text-xs text-gray-500",children:null!==(n=p[e])&&void 0!==n?n:e}),(0,s.jsx)("td",{className:"py-1 pr-2 ".concat(o?"bg-amber-50":""),children:"sourceUrl"===e?(0,s.jsx)("a",{href:String(null!==(r=null===(a=M(e)[0])||void 0===a?void 0:a.value)&&void 0!==r?r:l.sourceUrl),target:"_blank",rel:"noreferrer",className:"break-all text-blue-600 hover:underline",children:i}):(0,s.jsx)("span",{className:"break-all",children:i})}),(0,s.jsx)("td",{className:"py-1 pr-3 ".concat(o?"bg-amber-50":""),children:"sourceUrl"===e?(0,s.jsx)("a",{href:String((()=>{var e;let t=j[J.talent.id];return null!==(e=null==t?void 0:t.sourceUrl)&&void 0!==e?e:""})()),target:"_blank",rel:"noreferrer",className:"break-all text-blue-600 hover:underline",children:d}):(0,s.jsx)("span",{className:"break-all",children:d})})]},e)})})]})]}):null]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t border-gray-200 px-4 py-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>void q(),disabled:E,className:"rounded bg-blue-600 px-4 py-1.5 text-sm text-white hover:bg-blue-700 disabled:opacity-50",children:"提交合并(采用上方编辑值)"}),(0,s.jsx)("button",{type:"button",onClick:()=>void R(),disabled:E,title:"传统语义:保留字段更全的一侧,另一侧补空合并",className:"rounded border border-gray-300 px-4 py-1.5 text-sm text-gray-700 hover:bg-gray-50 disabled:opacity-50",children:"快捷:整行补空合并"}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"被合并的候选会进入回收站(可恢复)"}),O?(0,s.jsx)("span",{className:"text-sm text-red-600",children:O}):null]})]})]})]})}):null]})}var j=l(65777);function f(e){var t,l;let{entityId:n,name:i}=e,[d,o]=(0,a.useState)(!1),[c,u]=(0,a.useState)(null),[x,m]=(0,a.useState)([]),[h,p]=(0,a.useState)(""),[g,y]=(0,a.useState)("pending_invite"),[b,v]=(0,a.useState)(!1),[f,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(null),{sync:S}=(0,j.nu)(),A=null!==(t=null==S?void 0:S.activeTenantId)&&void 0!==t?t:null;(0,a.useEffect)(()=>{d&&((async()=>{try{u(await (0,r.aA)("/recommendations/meta"))}catch(e){}})(),(async()=>{try{let e=await (0,r.aA)("/job-cases?limit=200");m(e.items)}catch(e){}})())},[d,A]);let C=async()=>{if(""!==h){v(!0),k(null);try{await (0,r.aA)("/recommendations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jobCaseId:h,entityId:n,stage:g})}),N({jobCaseId:Number(h)})}catch(e){k("写入失败(服务未启动或无权限)")}finally{v(!1)}}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>{o(!0),N(null),k(null)},className:"rounded bg-blue-600 px-3 py-1 text-sm text-white hover:bg-blue-700",children:"加入推荐流程"}),d?(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30",children:(0,s.jsx)("div",{className:"w-96 rounded-lg bg-white p-4 shadow-xl",children:f?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"mb-3 text-sm text-gray-800",children:["已把 ",(0,s.jsx)("span",{className:"font-medium",children:i})," 加入推荐流程。"]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)("button",{onClick:()=>o(!1),className:"rounded border border-gray-300 px-3 py-1 text-xs text-gray-600",children:"关闭"}),(0,s.jsx)("a",{href:"/jobs?id=".concat(f.jobCaseId),className:"rounded bg-blue-600 px-3 py-1 text-xs text-white hover:bg-blue-700",children:"去职位推荐流程 →"})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("h3",{className:"mb-3 text-sm font-semibold text-gray-900",children:["把 ",i," 加入推荐流程"]}),(0,s.jsxs)("label",{className:"mb-2 block text-xs text-gray-500",children:["目标职位",(0,s.jsxs)("select",{value:h,onChange:e=>p(""===e.target.value?"":Number(e.target.value)),className:"mt-1 w-full rounded border border-gray-300 px-2 py-1.5 text-sm",children:[(0,s.jsx)("option",{value:"",children:"选择职位…"}),x.map(e=>(0,s.jsx)("option",{value:e.id,children:e.title||e.externalId},e.id))]})]}),(0,s.jsxs)("label",{className:"mb-3 block text-xs text-gray-500",children:["推荐阶段(默认待邀请)",(0,s.jsx)("select",{value:g,onChange:e=>y(e.target.value),className:"mt-1 w-full rounded border border-gray-300 px-2 py-1.5 text-sm",children:(null!==(l=null==c?void 0:c.stages)&&void 0!==l?l:[{key:"pending_invite",label:"待邀请"}]).map(e=>(0,s.jsx)("option",{value:e.key,children:e.label},e.key))})]}),w?(0,s.jsx)("p",{className:"mb-2 text-xs text-red-600",children:w}):null,(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)("button",{onClick:()=>o(!1),className:"rounded border border-gray-300 px-3 py-1 text-xs text-gray-600",children:"取消"}),(0,s.jsx)("button",{onClick:()=>void C(),disabled:""===h||b,className:"rounded bg-blue-600 px-3 py-1 text-xs text-white hover:bg-blue-700 disabled:opacity-40",children:b?"写入中…":"确认加入"})]})]})})}):null]})}let N={merge:"解析合并",sync:"同步覆盖",manual:"人工编辑",backfill:"回溯回填"},w={"identity.displayName":"姓名","identity.gender":"性别","identity.birthYear":"出生年","identity.location":"地点","identity.nationality":"国籍","professional.headline":"头衔","professional.summary":"简介","professional.currentCompany":"现任公司","professional.currentTitle":"现任职位","professional.titleLevel":"职级","professional.yearsOfExperience":"工作年限","professional.currentStatus":"当前状态","professional.desiredJob":"求职意向","professional.skills":"技能","professional.workExperiences":"工作经历","professional.educations":"教育经历","professional.projects":"项目经历","professional.languages":"语言","professional.certifications":"证书","contact.phones":"电话","contact.emails":"邮箱","contact.wechats":"微信","contact.linkedinUrls":"LinkedIn"},k=e=>{if(null==e)return"(空)";if("object"==typeof e){if(e.truncated)return"".concat(String(e.preview).slice(0,40),"…");if(e.name)return String(e.name);if(e.city)return String(e.city);if(e.added||e.removed){var t,l;let s=[];return(null===(t=e.added)||void 0===t?void 0:t.length)&&s.push("+".concat(e.added.map(e=>{var t,l,s,a;return null!==(a=null!==(s=null!==(l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null==e?void 0:e.companyName)&&void 0!==l?l:null==e?void 0:e.school)&&void 0!==s?s:null==e?void 0:e.language)&&void 0!==a?a:String(e)}).join("、"))),(null===(l=e.removed)||void 0===l?void 0:l.length)&&s.push("-".concat(e.removed.map(e=>{var t,l,s,a;return null!==(a=null!==(s=null!==(l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null==e?void 0:e.companyName)&&void 0!==l?l:null==e?void 0:e.school)&&void 0!==s?s:null==e?void 0:e.language)&&void 0!==a?a:String(e)}).join("、"))),s.join(" ")||"(数量变化)"}return JSON.stringify(e).slice(0,40)}return String(e)};function S(e){let{versions:t,recommendations:l,changes:n,evaluations:r,matches:i}=e,d=(0,a.useMemo)(()=>{if(!(null==l?void 0:l.length))return null;let e=null;for(let r of l){var t,s,a,n;let l=null!==(t=r.history)&&void 0!==t?t:[],i=l.length?l[l.length-1]:null,d=null!==(s=null==i?void 0:i.at)&&void 0!==s?s:r.createdAt;(!e||d>e.at)&&(e={at:d,jobTitle:null!==(a=r.jobTitle)&&void 0!==a?a:"职位 #".concat(r.jobCaseId),toStage:null!==(n=null==i?void 0:i.toStage)&&void 0!==n?n:r.stage,by:null==i?void 0:i.by})}return e},[l]),o=(0,a.useMemo)(()=>{if(!(null==l?void 0:l.length))return[];let e=new Map;for(let a of l){var t,s;e.set(a.jobCaseId,{jobTitle:null!==(t=a.jobTitle)&&void 0!==t?t:"职位 #".concat(a.jobCaseId),stage:a.stage,stageLabel:null!==(s=a.stageLabel)&&void 0!==s?s:a.stage,updatedAt:a.updatedAt})}return Array.from(e.entries()).map(e=>{let[t,l]=e;return{jobCaseId:t,...l}}).sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))},[l]),c={rejected:"bg-red-50 text-red-700",onboarding:"bg-green-50 text-green-700"},x=(e,t)=>{var l;return(0,s.jsxs)("span",{className:"rounded px-2 py-0.5 text-xs ".concat(null!==(l=c[e])&&void 0!==l?l:"bg-blue-50 text-blue-700"),children:[t,c[e]?"":"(在途)"]})},m=(0,a.useMemo)(()=>{var e,a,i,d,o,c,u,x,m,h;let p=[];for(let t of null!=l?l:[])for(let l of null!==(e=t.history)&&void 0!==e?e:[])p.push({at:l.at,icon:"\uD83D\uDCE4",tone:"text-blue-700",text:(0,s.jsxs)("span",{children:[(0,s.jsx)("b",{children:null!==(a=t.jobTitle)&&void 0!==a?a:"职位 #".concat(t.jobCaseId)}),":",l.fromStage?"".concat(l.fromStage," → "):"",null!==(i=l.toStage)&&void 0!==i?i:l.action,l.by?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",l.by]}):null,l.note?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",l.note]}):null]})});for(let e of null!=n?n:[])p.push({at:e.createdAt,icon:"\uD83D\uDCDD",tone:"text-amber-700",text:(0,s.jsxs)("span",{children:["简历变更:",null!==(d=w[e.fieldPath])&&void 0!==d?d:e.fieldPath,"(",null!==(o=N[e.changeType])&&void 0!==o?o:e.changeType,")",(0,s.jsxs)("span",{className:"text-gray-400",children:[" ",k(e.oldValue)," → ",k(e.newValue)]}),e.sourceSystem?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 来源 ",e.sourceSystem]}):null]})});for(let e of null!=t?t:[])p.push({at:e.createdAt,icon:"\uD83C\uDD95",tone:"text-green-700",text:(0,s.jsxs)("span",{children:["新版本简历入库:",null!==(m=null===(c=e.source)||void 0===c?void 0:c.system)&&void 0!==m?m:"未知渠道",(null===(x=e.source)||void 0===x?void 0:null===(u=x.collector)||void 0===u?void 0:u.creatorName)?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 同步人 ",e.source.collector.creatorName]}):null]})});for(let e of null!=r?r:[])p.push({at:e.createdAt,icon:"\uD83D\uDCCA",tone:"text-violet-700",text:(0,s.jsxs)("span",{children:["生成评估:",(0,s.jsx)("b",{children:null!==(h=e.jobTitle)&&void 0!==h?h:"职位 #".concat(e.jobCaseId)}),(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",e.generatedBy]})]})});return p.sort((e,t)=>t.at.localeCompare(e.at)).slice(0,30)},[l,n,t,r]),h=(0,a.useMemo)(()=>(null!=i?i:[]).slice().sort((e,t)=>{var l,s,a,n;return(null!==(a=null===(l=t.scores)||void 0===l?void 0:l.overall)&&void 0!==a?a:0)-(null!==(n=null===(s=e.scores)||void 0===s?void 0:s.overall)&&void 0!==n?n:0)}).slice(0,3),[i]);return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-blue-200 bg-blue-50/50 p-4",children:[(0,s.jsx)("div",{className:"text-xs text-gray-500",children:"最近一次推荐"}),d?(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-lg font-semibold text-gray-900",children:d.jobTitle}),d.toStage?x(d.toStage,d.toStage):null,(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:[(0,u.d3)(d.at),d.by?" \xb7 ".concat(d.by):""]})]}):(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"暂无推荐记录"})]}),(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsxs)("h3",{className:"mb-2 text-sm font-semibold text-gray-900",children:["推荐履历(",o.length,")"]}),o.length?(0,s.jsx)("ul",{className:"space-y-2",children:o.map(e=>(0,s.jsxs)("li",{className:"flex items-center justify-between gap-2 text-sm",children:[(0,s.jsx)("a",{href:"/jobs?id=".concat(e.jobCaseId),className:"truncate text-blue-600 hover:underline",children:e.jobTitle}),x(e.stage,e.stageLabel)]},e.jobCaseId))}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无推荐记录"})]}),(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsx)("h3",{className:"mb-2 text-sm font-semibold text-gray-900",children:"在管职位匹配 Top 3"}),h.length?(0,s.jsx)("ul",{className:"space-y-2",children:h.map(e=>{var t,l,a,n,r,i,d;return(0,s.jsxs)("li",{className:"flex items-center justify-between gap-2 text-sm",children:[(0,s.jsx)("a",{href:"/jobs?id=".concat(e.jobCaseId),className:"truncate text-blue-600 hover:underline",children:(null===(t=e.jobCase)||void 0===t?void 0:t.title)||"职位 #".concat(e.jobCaseId)}),(0,s.jsxs)("span",{className:"rounded px-2 py-0.5 text-xs ".concat((null!==(r=null===(l=e.scores)||void 0===l?void 0:l.overall)&&void 0!==r?r:0)>=75?"bg-green-50 text-green-700":(null!==(i=null===(a=e.scores)||void 0===a?void 0:a.overall)&&void 0!==i?i:0)>=60?"bg-amber-50 text-amber-700":"bg-gray-100 text-gray-600"),children:[null!==(d=null===(n=e.scores)||void 0===n?void 0:n.overall)&&void 0!==d?d:"-"," 分"]})]},e.id)})}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无高匹配在管职位"}),(0,s.jsx)("p",{className:"mt-2 text-xs text-gray-400",children:"完整匹配与规则明细见「简历」tab"})]})]}),(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsx)("h3",{className:"mb-3 text-sm font-semibold text-gray-900",children:"动态(推荐 / 简历变更 / 新版本 / 评估)"}),m.length?(0,s.jsx)("ol",{className:"space-y-2",children:m.map((e,t)=>(0,s.jsxs)("li",{className:"flex items-start gap-2 text-sm",children:[(0,s.jsx)("span",{children:e.icon}),(0,s.jsx)("span",{className:e.tone,children:e.text}),(0,s.jsx)("span",{className:"shrink-0 text-xs text-gray-400",children:(0,u.d3)(e.at)})]},t))}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无动态"})]})]})}let A=[["skill","技能",.25],["experience","经验年限",.2],["industry","行业",.1],["company","公司",.1],["location","地点",.1],["salary","薪资",.1],["education","学历",.05],["stability","稳定性",.05],["availability","可用性",.05]],C=(e,t,l)=>[e,t].filter(Boolean).join(" - ")+(l?"(".concat(l,")"):"");function T(e){let{title:t,children:l}=e;return(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold text-gray-900",children:t}),l]})}function I(e){let{children:t}=e;return(0,s.jsx)("span",{className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700",children:t})}function E(e){var t,l;let{entity:n}=e,i=n.extracted||{},[d,o]=(0,a.useState)(null),[c,u]=(0,a.useState)(!1),[x,m]=(0,a.useState)(!1),[h,p]=(0,a.useState)(null),g=(0,a.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];m(!0);try{var t;let l=e?await (0,r.aA)("/entities/talent/".concat(n.id,"/match-jobs"),{method:"POST",headers:{"Content-Type":"application/json"}}):await (0,r.aA)("/entities/talent/".concat(n.id,"/matches"));o(null!==(t=l.matches)&&void 0!==t?t:[]),u(!1)}catch(e){u(!0)}finally{m(!1)}},[n.id]);(0,a.useEffect)(()=>{g()},[g]);let y=Array.isArray(i.workExperiences)?i.workExperiences:[],b=Array.isArray(i.projects)?i.projects:[],v=Array.isArray(i.education)?i.education:[],j=e=>"string"==typeof e?e:e&&"object"==typeof e&&"string"==typeof e.name?e.name:null,f=(Array.isArray(i.languages)?i.languages:[]).map(j).filter(e=>!!e),N=(Array.isArray(i.skills)?i.skills:[]).map(j).filter(e=>!!e),w=null!==(l=null===(t=i.extra)||void 0===t?void 0:t.sections)&&void 0!==l?l:[],k=i.intent||{},S=[["性别",i.gender],["年龄",null!=i.age?"".concat(i.age," 岁"):null],["城市",i.city],["学历",i.degree],["工作年限",null!=i.workYears?"".concat(i.workYears," 年"):null],["当前职位",i.currentPosition],["当前公司",i.currentCompany],["状态",i.statusTag],["方便联系",i.contactTime]].filter(e=>{let[,t]=e;return null!=t&&""!==t});return(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[i.photoUrl?(0,s.jsx)("img",{src:i.photoUrl,alt:"",className:"h-14 w-14 rounded-full object-cover"}):null,(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xl font-bold text-gray-900",children:i.name||"(未命名)"}),i.nameMasked?(0,s.jsx)(I,{children:"脱敏"}):null]}),S.length?(0,s.jsx)("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-sm text-gray-600",children:S.map(e=>{let[t,l]=e;return(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"text-gray-400",children:t})," ",l]},t)})}):(0,s.jsx)("p",{className:"mt-2 text-sm text-gray-500",children:"仅卡片级数据(搜索入库),尚无详情页解析字段"})]})]}),Object.keys(k).length?(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2 border-t border-gray-100 pt-3 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-400",children:"求职意向"}),k.position?(0,s.jsx)(I,{children:k.position}):null,k.salary?(0,s.jsx)(I,{children:k.salary}):null,k.city?(0,s.jsx)(I,{children:k.city}):null,(k.industries||[]).map(e=>(0,s.jsx)(I,{children:e},e))]}):null,N.length||f.length?(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-sm",children:[N.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-gray-400",children:"技能"}),N.map(e=>(0,s.jsx)(I,{children:e},e))]}):null,f.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"ml-2 text-gray-400",children:"语言"}),f.map(e=>(0,s.jsx)(I,{children:e},e))]}):null]}):null]}),(0,s.jsxs)(T,{title:"在管职位匹配",children:[c?(0,s.jsxs)("p",{className:"text-sm text-red-500",children:["匹配加载失败",(0,s.jsx)("button",{type:"button",onClick:()=>void g(),className:"ml-2 text-blue-500 hover:underline",children:"重试"})]}):null===d?(0,s.jsx)("p",{className:"text-sm text-gray-500",children:x?"匹配计算中…":"加载中…"}):0===d.length?(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无匹配记录"}):(0,s.jsx)("ul",{className:"space-y-3",children:d.map(e=>{var t,l,a,n,r,i,d,o,c,u,x,m,g,y,b,v,j,f;let N=h===e.id,w=null!==(b=e.matchDetails)&&void 0!==b?b:{};return(0,s.jsxs)("li",{className:"rounded border border-gray-100 p-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("span",{className:"font-medium text-gray-900",children:[(null===(t=e.jobCase)||void 0===t?void 0:t.title)||"职位 #".concat(e.jobCaseId),(null===(l=e.jobCase)||void 0===l?void 0:l.company)?(0,s.jsx)("span",{className:"ml-2 text-sm text-gray-500",children:e.jobCase.company}):null]}),(0,s.jsxs)("span",{className:"rounded px-2 py-0.5 text-sm font-medium ".concat((null!==(v=null===(a=e.scores)||void 0===a?void 0:a.overall)&&void 0!==v?v:0)>=75?"bg-green-50 text-green-700":(null!==(j=null===(n=e.scores)||void 0===n?void 0:n.overall)&&void 0!==j?j:0)>=60?"bg-amber-50 text-amber-700":"bg-gray-100 text-gray-600"),children:[null!==(f=null===(r=e.scores)||void 0===r?void 0:r.overall)&&void 0!==f?f:"-"," 分"]})]}),(null===(i=e.recommendation)||void 0===i?void 0:i.aiReason)?(0,s.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-sm text-gray-600",children:e.recommendation.aiReason}):null,(0,s.jsx)("button",{type:"button",onClick:()=>p(N?null:e.id),className:"mt-2 text-xs text-blue-600 hover:underline",children:N?"收起规则明细 ▲":"查看规则明细(为什么这么分)▼"}),N?(0,s.jsxs)("div",{className:"mt-2 space-y-2 border-t border-gray-100 pt-2",children:[w.gate?"fail"===w.gate.status?(0,s.jsxs)("div",{className:"rounded bg-red-50 p-2 text-xs text-red-700",children:[(0,s.jsx)("div",{className:"font-medium",children:"硬性条件不满足(一票否决,已出局)"}),(0,s.jsx)("ul",{className:"mt-1 list-disc pl-4",children:(w.gate.failed||[]).map((e,t)=>(0,s.jsxs)("li",{children:[e.label,e.talentValue?"(候选人:".concat(e.talentValue,")"):"",e.evidence?" JD 证据:「".concat(e.evidence,"」"):""]},t))})]}):"unknown"===w.gate.status?(0,s.jsxs)("div",{className:"rounded bg-amber-50 p-2 text-xs text-amber-700",children:[(0,s.jsx)("div",{className:"font-medium",children:"硬性条件待核实(信息缺失 ≠ 不满足,请人工复核)"}),(0,s.jsx)("ul",{className:"mt-1 list-disc pl-4",children:(w.gate.unknown||[]).map((e,t)=>(0,s.jsxs)("li",{children:[e.label,e.evidence?" JD 证据:「".concat(e.evidence,"」"):""]},t))})]}):(0,s.jsx)("p",{className:"text-xs text-green-700",children:"硬性条件(性别/学历/年龄/地点等):全部满足"}):null,(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2 md:grid-cols-5",children:A.map(t=>{var l;let[a,n,r]=t;return(0,s.jsxs)("div",{className:"rounded bg-gray-50 p-2 text-xs",children:[(0,s.jsxs)("div",{className:"text-gray-400",children:[n," ",(0,s.jsxs)("span",{title:"规则权重",children:["\xd7",r]})]}),(0,s.jsx)("div",{className:"font-medium",children:(null===(l=e.scores)||void 0===l?void 0:l[a])!=null?"".concat(Math.round(100*e.scores[a])):"-"})]},a)})}),"number"==typeof w.vectorCosine?(0,s.jsxs)("p",{className:"text-xs text-gray-500",children:["语义向量(本地 bge-small 余弦,权重 \xd70.2):",(100*w.vectorCosine).toFixed(1)," 分"]}):null,Array.isArray(w.hitSkills)&&w.hitSkills.length?(0,s.jsxs)("p",{className:"text-xs text-green-700",children:["命中技能:",w.hitSkills.map(e=>{var t;return null!==(t=null==e?void 0:e.name)&&void 0!==t?t:e}).join("、")]}):null,Array.isArray(w.missedSkills)&&w.missedSkills.length?(0,s.jsxs)("p",{className:"text-xs text-red-600",children:["缺失技能:",w.missedSkills.map(e=>{var t;return null!==(t=null==e?void 0:e.name)&&void 0!==t?t:e}).join("、")]}):null,Array.isArray(w.concernFlags)&&w.concernFlags.length?(0,s.jsxs)("p",{className:"text-xs text-amber-700",children:["风险提示:",w.concernFlags.join(";")]}):null,(null===(d=w.industryFit)||void 0===d?void 0:d.fitTag)||(null===(o=w.salaryFit)||void 0===o?void 0:o.fitTag)||(null===(c=w.locationFit)||void 0===c?void 0:c.fitTag)||(null===(u=w.experienceFit)||void 0===u?void 0:u.fitTag)?(0,s.jsxs)("p",{className:"text-xs text-gray-500",children:["适配标签:",[null===(x=w.industryFit)||void 0===x?void 0:x.fitTag,null===(m=w.salaryFit)||void 0===m?void 0:m.fitTag,null===(g=w.locationFit)||void 0===g?void 0:g.fitTag,null===(y=w.experienceFit)||void 0===y?void 0:y.fitTag].filter(Boolean).join(" / ")]}):null]}):null]},e.id)})}),(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)("button",{type:"button",disabled:x,onClick:()=>void g(!0),className:"rounded bg-blue-600 px-3 py-1 text-sm text-white hover:bg-blue-700 disabled:opacity-50",children:x?"匹配中…":"重新匹配在管职位"})})]}),y.length?(0,s.jsx)(T,{title:"工作经历(".concat(y.length,")"),children:(0,s.jsx)("ol",{className:"space-y-4",children:y.map((e,t)=>(0,s.jsxs)("li",{className:"border-l-2 border-blue-100 pl-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900",children:e.company||"(公司未知)"}),(0,s.jsx)("span",{className:"text-gray-700",children:e.position}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:C(e.start,e.end,e.duration)})]}),(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap gap-x-3 text-xs text-gray-500",children:[e.department?(0,s.jsxs)("span",{children:["部门:",e.department]}):null,e.location?(0,s.jsxs)("span",{children:["地点:",e.location]}):null,e.reportsTo?(0,s.jsxs)("span",{children:["汇报:",e.reportsTo]}):null,null!=e.subordinates?(0,s.jsxs)("span",{children:["下属:",e.subordinates," 人"]}):null]}),e.responsibilities?(0,s.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-gray-700",children:e.responsibilities}):null,e.extra?(0,s.jsx)("div",{className:"mt-1 flex flex-wrap gap-x-3 text-xs text-gray-500",children:Object.entries(e.extra).map(e=>{let[t,l]=e;return(0,s.jsxs)("span",{children:[t,":",l]},t)})}):null]},t))})}):null,b.length?(0,s.jsx)(T,{title:"项目经历(".concat(b.length,")"),children:(0,s.jsx)("ol",{className:"space-y-4",children:b.map((e,t)=>(0,s.jsxs)("li",{className:"border-l-2 border-green-100 pl-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900",children:e.name||"(项目未知)"}),e.role?(0,s.jsx)("span",{className:"text-gray-700",children:e.role}):null,e.company?(0,s.jsx)("span",{className:"text-sm text-gray-500",children:e.company}):null,(0,s.jsx)("span",{className:"text-xs text-gray-400",children:C(e.start,e.end,e.duration)})]}),e.description?(0,s.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-gray-700",children:e.description}):null,e.duties?(0,s.jsxs)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-gray-600",children:["职责:",e.duties]}):null,e.extra?(0,s.jsx)("div",{className:"mt-1 flex flex-wrap gap-x-3 text-xs text-gray-500",children:Object.entries(e.extra).map(e=>{let[t,l]=e;return(0,s.jsxs)("span",{children:[t,":",l]},t)})}):null]},t))})}):null,v.length?(0,s.jsx)(T,{title:"教育经历(".concat(v.length,")"),children:(0,s.jsx)("ol",{className:"space-y-3",children:v.map((e,t)=>(0,s.jsxs)("li",{className:"flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900",children:e.school||"(学校未知)"}),e.major?(0,s.jsx)("span",{className:"text-gray-700",children:e.major}):null,e.degree?(0,s.jsx)(I,{children:e.degree}):null,e.period?(0,s.jsx)("span",{className:"text-xs text-gray-400",children:e.period}):null,(e.tags||[]).map(e=>(0,s.jsx)(I,{children:e},e))]},t))})}):null,i.selfEvaluation?(0,s.jsx)(T,{title:"自我评价",children:(0,s.jsx)("p",{className:"whitespace-pre-wrap text-sm text-gray-700",children:i.selfEvaluation})}):null,w.map(e=>(0,s.jsx)(T,{title:e.title||e.key,children:(0,s.jsx)("p",{className:"whitespace-pre-wrap text-sm text-gray-700",children:e.text})},e.key))]})}function U(e){var t;let{portraitId:l}=e,[n,i]=(0,a.useState)([]),[d,o]=(0,a.useState)(""),[c,x]=(0,a.useState)(!1),[m,h]=(0,a.useState)(null),[p,g]=(0,a.useState)([]),{sync:y}=(0,j.nu)(),b=null!==(t=null==y?void 0:y.activeTenantId)&&void 0!==t?t:null;(0,a.useEffect)(()=>{(0,r.aA)("/job-cases?limit=200").then(e=>{var t;let l=(Array.isArray(e)?e:null!==(t=null==e?void 0:e.items)&&void 0!==t?t:[]).filter(e=>"active"===e.status||!e.status);i(l),o(e=>e&&l.some(t=>String(t.id)===e)?e:"")}).catch(()=>i([]))},[b]);let v=(0,a.useCallback)(async()=>{if(!l)return;let e=null;try{e=await (0,r.aA)("/talent-portraits/".concat(l,"/evaluations"))}catch(e){}g(e?e.items:[])},[l]);async function f(){if(h(null),!l||!d){h("先选择要评估的职位");return}try{let e=await fetch("".concat((0,r.Ox)(),"/talent-job-evaluations/evaluate-prompt?portraitId=").concat(l,"&jobCaseId=").concat(d));if(!e.ok)throw Error("HTTP ".concat(e.status));let t=await e.json();await navigator.clipboard.writeText(t.prompt),x(!0),setTimeout(()=>x(!1),4e3),setTimeout(()=>void v(),3e4)}catch(e){h(e.message)}}(0,a.useEffect)(()=>{v()},[v]);let N=d?p.filter(e=>String(e.jobCaseId)===d):p;return(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold text-gray-900",children:"评估(人才 \xd7 职位)"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("select",{value:d,onChange:e=>o(e.target.value),className:"rounded border border-gray-300 px-2 py-1 text-sm",children:[(0,s.jsx)("option",{value:"",children:"选择要评估的在管职位…"}),n.map(e=>(0,s.jsx)("option",{value:e.id,children:e.title||"职位 #".concat(e.id)},e.id))]}),(0,s.jsx)("button",{type:"button",onClick:()=>void f(),className:"rounded bg-violet-600 px-3 py-1 text-sm text-white hover:bg-violet-700",children:c?"已复制 ✓ 请发给 agent":"复制评估 prompt"}),m?(0,s.jsx)("span",{className:"text-xs text-red-600",children:m}):null]}),(0,s.jsx)("p",{className:"mt-2 text-xs text-gray-400",children:"评估由 agent 生成后写回;同一人才\xd7职位可多次评估,历史全留痕。原「AI 总结与评估」(不针对职位)已按 2026-10-04 裁定移除。"}),(0,s.jsx)("div",{className:"mt-3 space-y-3",children:N.length?N.map(e=>{var t;return(0,s.jsxs)("div",{className:"rounded border border-gray-100 p-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-gray-400",children:[(0,s.jsx)("span",{className:"font-medium text-gray-800",children:null!==(t=e.jobTitle)&&void 0!==t?t:"职位 #".concat(e.jobCaseId)}),(0,s.jsx)("span",{children:(0,u.d3)(e.createdAt)}),(0,s.jsxs)("span",{children:["生成:",e.generatedBy]}),e.createdBy?(0,s.jsxs)("span",{children:["操作者:",e.createdBy]}):null]}),(0,s.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-gray-700",children:e.content})]},e.id)}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无评估记录"})})]})}let O=e=>"string"==typeof e?e:e&&"object"==typeof e&&"string"==typeof e.name?e.name:null;function D(e){var t;let{entity:l,portraitId:n,versions:r,sources:i}=e,[d,o]=(0,a.useState)("merged"),c=null!=r?r:[],m=null!==(t=c.find(e=>e.id===d))&&void 0!==t?t:null;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>o("merged"),className:"rounded px-3 py-1 text-sm ".concat("merged"===d?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:"合并画像(默认)"}),c.map(e=>{var t,l,a,n,r,i;return(0,s.jsxs)("button",{type:"button",onClick:()=>o(e.id),className:"rounded px-3 py-1 text-sm ".concat(d===e.id?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"),title:"".concat(null!==(r=null===(t=e.source)||void 0===t?void 0:t.url)&&void 0!==r?r:""," ").concat((0,u.d3)(e.createdAt)),children:[null!==(i=null===(l=e.source)||void 0===l?void 0:l.system)&&void 0!==i?i:"未知渠道",(null===(n=e.source)||void 0===n?void 0:null===(a=n.collector)||void 0===a?void 0:a.creatorName)?" \xb7 ".concat(e.source.collector.creatorName):""," \xb7 ",(0,u.d3)(e.createdAt)]},e.id)}),c.length?null:(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"暂无独立版本(合并画像即全部已知信息)"})]}),"merged"!==d&&m?(0,s.jsx)(F,{version:m}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(E,{entity:l}),(0,s.jsx)(U,{portraitId:n}),(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h3",{className:"mb-2 text-lg font-semibold",children:"原始数据(合并画像)"}),(0,s.jsx)(x.Y,{data:l.extracted})]})]}),(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"解析来源"}),i.length?(0,s.jsx)("ul",{className:"space-y-1 text-sm",children:i.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)("a",{href:e.sourceUrl,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:e.domain}),(0,s.jsx)("span",{className:"ml-2 text-xs text-gray-400",children:(0,u.d3)(e.createdAt)})]},e.id))}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无解析来源记录"})]})]})}function F(e){var t,l,a,n,r,i,d,o,c,m,h,p,g;let{version:y}=e,b=null!==(o=y.extracted)&&void 0!==o?o:{},v=Array.isArray(b.workExperiences)?b.workExperiences:[],j=Array.isArray(b.educations)?null!==(c=b.education)&&void 0!==c?c:b.educations:Array.isArray(b.education)?b.education:[],f=(Array.isArray(b.skills)?b.skills:[]).map(O).filter(Boolean),N=null!==(m=b.contact)&&void 0!==m?m:{};return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xl font-bold text-gray-900",children:null!==(p=null!==(h=N.fullName)&&void 0!==h?h:b.name)&&void 0!==p?p:"(未命名)"}),(0,s.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:null!==(g=null===(t=y.source)||void 0===t?void 0:t.system)&&void 0!==g?g:"未知渠道"}),(null===(a=y.source)||void 0===a?void 0:null===(l=a.collector)||void 0===l?void 0:l.creatorName)?(0,s.jsxs)("span",{className:"rounded bg-violet-50 px-2 py-0.5 text-xs text-violet-700",children:["同步人 ",y.source.collector.creatorName]}):null,(0,s.jsx)("span",{className:"text-xs text-gray-400",children:(0,u.d3)(y.createdAt)}),(null===(n=y.confidence)||void 0===n?void 0:n.overall)!=null?(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["置信度 ",Math.round(100*y.confidence.overall),"%"]}):null]}),b.headline?(0,s.jsx)("p",{className:"mt-1 text-gray-600",children:b.headline}):null,(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-sm text-gray-600",children:[b.gender?(0,s.jsxs)("span",{children:["性别 ",b.gender]}):null,(null===(r=b.basic)||void 0===r?void 0:r.gender)?(0,s.jsxs)("span",{children:["性别 ",b.basic.gender]}):null,b.city?(0,s.jsxs)("span",{children:["城市 ",b.city]}):null,(null===(d=b.basic)||void 0===d?void 0:null===(i=d.location)||void 0===i?void 0:i.city)?(0,s.jsxs)("span",{children:["城市 ",b.basic.location.city]}):null]}),f.length?(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-400",children:"技能"}),f.map(e=>(0,s.jsx)("span",{className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700",children:e},e))]}):null]}),v.length?(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("h3",{className:"mb-2 text-lg font-semibold",children:["工作经历(",v.length,")"]}),(0,s.jsx)("ol",{className:"space-y-2",children:v.map((e,t)=>{var l,a,n,r,i;return(0,s.jsxs)("li",{className:"text-sm",children:[(0,s.jsx)("b",{children:null!==(a=null!==(l=e.companyName)&&void 0!==l?l:e.company)&&void 0!==a?a:"(公司未知)"})," ",null!==(n=e.title)&&void 0!==n?n:e.position," ",(0,s.jsx)("span",{className:"text-xs text-gray-400",children:[null!==(r=e.startDate)&&void 0!==r?r:e.start,null!==(i=e.endDate)&&void 0!==i?i:e.end].filter(Boolean).join(" - ")})]},t)})})]}):null,j.length?(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("h3",{className:"mb-2 text-lg font-semibold",children:["教育经历(",j.length,")"]}),(0,s.jsx)("ol",{className:"space-y-1",children:j.map((e,t)=>(0,s.jsxs)("li",{className:"text-sm",children:[(0,s.jsx)("b",{children:e.school})," ",e.major," ",(0,s.jsx)("span",{className:"text-xs text-gray-400",children:e.degree})]},t))})]}):null,(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h3",{className:"mb-2 text-lg font-semibold",children:"原始数据(该版本)"}),(0,s.jsx)(x.Y,{data:y.extracted})]})]})}let P={create:"建档",move:"阶段流转",form:"表单更新",invite:"邀请",invite_approved:"邀请批准",note:"备注",delete:"删除"};function L(e){let{recommendations:t,error:l,onRetry:n}=e,[r,i]=(0,a.useState)(null);return l?(0,s.jsxs)("p",{className:"rounded-lg border border-red-200 bg-white p-5 text-sm text-red-500 shadow-sm",children:["推荐记录加载失败:",l,n?(0,s.jsx)("button",{type:"button",onClick:n,className:"ml-2 text-blue-500 hover:underline",children:"重试"}):null]}):(null==t?void 0:t.length)?(0,s.jsx)("div",{className:"space-y-3",children:t.map(e=>{var t,l,a,n,d;let o=r===e.id,c=Object.entries(null!==(t=e.formData)&&void 0!==t?t:{}).filter(e=>{let[,t]=e;return null!=t&&""!==t});return(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("a",{href:"/jobs?id=".concat(e.jobCaseId),className:"font-medium text-blue-600 hover:underline",children:null!==(l=e.jobTitle)&&void 0!==l?l:"职位 #".concat(e.jobCaseId)}),(0,s.jsx)("span",{className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700",children:null!==(a=e.stageLabel)&&void 0!==a?a:e.stage})]}),(0,s.jsx)("button",{type:"button",onClick:()=>i(o?null:e.id),className:"text-xs text-blue-600 hover:underline",children:o?"收起 ▲":"展开表单与历史 ▼"})]}),o?(0,s.jsxs)("div",{className:"mt-3 space-y-3 border-t border-gray-100 pt-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-1 text-xs text-gray-400",children:["当前阶段表单(",c.length,")"]}),c.length?(0,s.jsx)("dl",{className:"grid gap-x-6 gap-y-1 md:grid-cols-2",children:c.map(e=>{let[t,l]=e;return(0,s.jsxs)("div",{className:"flex gap-2 text-sm",children:[(0,s.jsx)("dt",{className:"shrink-0 text-gray-400",children:t}),(0,s.jsx)("dd",{className:"whitespace-pre-wrap text-gray-800",children:"object"==typeof l?JSON.stringify(l):String(l)})]},t)})}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"(空)"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-1 text-xs text-gray-400",children:["操作历史(",(null!==(n=e.history)&&void 0!==n?n:[]).length,")"]}),(0,s.jsx)("ol",{className:"space-y-1",children:(null!==(d=e.history)&&void 0!==d?d:[]).map((e,t)=>{var l;return(0,s.jsxs)("li",{className:"text-sm text-gray-700",children:[(0,s.jsx)("span",{className:"text-gray-400",children:(0,u.d3)(e.at)})," ",(0,s.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs",children:null!==(l=P[e.action])&&void 0!==l?l:e.action})," ",e.fromStage?(0,s.jsxs)("span",{children:[e.fromStage," → "]}):null,e.toStage?(0,s.jsx)("b",{children:e.toStage}):null,e.by?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",e.by]}):null,e.note?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",e.note]}):null]},t)})})]})]}):null]},e.id)})}):(0,s.jsx)("p",{className:"rounded-lg border border-gray-200 bg-white p-5 text-sm text-gray-500 shadow-sm",children:"暂无推荐记录(可从头部「加入推荐流程」建档,或让 agent 写回)"})}let M={merge:"bg-blue-50 text-blue-700",sync:"bg-violet-50 text-violet-700",manual:"bg-amber-50 text-amber-700",backfill:"bg-gray-100 text-gray-600"},_={"identity.displayName":"姓名","identity.gender":"性别","identity.birthYear":"出生年","identity.location":"地点","identity.nationality":"国籍","professional.headline":"头衔","professional.summary":"简介","professional.currentCompany":"现任公司","professional.currentTitle":"现任职位","professional.titleLevel":"职级","professional.yearsOfExperience":"工作年限","professional.currentStatus":"当前状态","professional.desiredJob":"求职意向","professional.skills":"技能","professional.workExperiences":"工作经历","professional.educations":"教育经历","professional.projects":"项目经历","professional.languages":"语言","professional.certifications":"证书","contact.phones":"电话","contact.emails":"邮箱","contact.wechats":"微信","contact.linkedinUrls":"LinkedIn"},B=e=>{if(null==e)return"(空)";if("object"==typeof e){if(e.truncated)return"".concat(String(e.preview).slice(0,60),"…");if(e.name)return String(e.name);if(e.city)return String(e.city);if(e.added||e.removed){var t,l,s;let a=[],n=e=>{var t,l,s,a,n;return null!==(n=null!==(a=null!==(s=null!==(l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null==e?void 0:e.companyName)&&void 0!==l?l:null==e?void 0:e.school)&&void 0!==s?s:null==e?void 0:e.language)&&void 0!==a?a:null==e?void 0:e.value)&&void 0!==n?n:String(e)};return(null===(t=e.added)||void 0===t?void 0:t.length)&&a.push("新增 ".concat(e.added.map(n).join("、"))),(null===(l=e.removed)||void 0===l?void 0:l.length)&&a.push("移除 ".concat(e.removed.map(n).join("、"))),a.length||null==e.before||a.push("".concat(e.before," → ").concat(null!==(s=e.after)&&void 0!==s?s:"?"," 条")),a.join(";")}return JSON.stringify(e).slice(0,60)}return String(e)};function q(e){let{changes:t}=e;return(null==t?void 0:t.length)?(0,s.jsx)("ol",{className:"space-y-2",children:t.map(e=>{var t,l,a;return(0,s.jsxs)("li",{className:"rounded-lg border border-gray-200 bg-white p-3 text-sm shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900",children:null!==(t=_[e.fieldPath])&&void 0!==t?t:e.fieldPath}),(0,s.jsx)("span",{className:"rounded px-1.5 py-0.5 text-xs ".concat(null!==(l=M[e.changeType])&&void 0!==l?l:"bg-gray-100 text-gray-600"),children:null!==(a=N[e.changeType])&&void 0!==a?a:e.changeType}),e.sourceSystem?(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["来源 ",e.sourceSystem]}):null,(0,s.jsx)("span",{className:"ml-auto text-xs text-gray-400",children:(0,u.d3)(e.createdAt)})]}),(0,s.jsxs)("div",{className:"mt-1 text-gray-600",children:[(0,s.jsx)("span",{className:"text-red-600 line-through decoration-red-300",children:B(e.oldValue)}),(0,s.jsx)("span",{className:"mx-2 text-gray-400",children:"→"}),(0,s.jsx)("span",{className:"text-green-700",children:B(e.newValue)})]}),e.actor?(0,s.jsxs)("div",{className:"mt-0.5 text-xs text-gray-400",children:["操作者:",e.actor]}):null]},e.id)})}):(0,s.jsx)("p",{className:"rounded-lg border border-gray-200 bg-white p-5 text-sm text-gray-500 shadow-sm",children:"暂无字段级变更记录(画像被新解析合并/同步覆盖时自动留痕,自 2026-10-04 起记)"})}function R(e){var t,l,a,n,r,i,d,o,c,u,x,m;let{entity:h}=e,p=h.extracted||{},g=Array.isArray(p.workExperiences)?p.workExperiences:[],y=Array.isArray(p.education)?p.education:[],b=e=>"string"==typeof e?e:e&&"object"==typeof e&&"string"==typeof e.name?e.name:null,v=(Array.isArray(p.skills)?p.skills:[]).map(b).filter(Boolean),j=(Array.isArray(p.languages)?p.languages:[]).map(b).filter(e=>!!e),f=[["博士后",9],["博士",8],["DBA",8],["MBA",7],["EMBA",7],["硕士",6],["研究生",6],["MBA/EMBA",7],["本科",5],["学士",5],["大专",4],["专科",4],["高中",2],["中专",2],["初中",1]],N=e=>{if(!e)return 0;let t=0;for(let[l,s]of f)e.includes(l)&&s>t&&(t=s);return t},w=y.length?y.reduce((e,t)=>N(null==t?void 0:t.degree)>N(null==e?void 0:e.degree)?t:e):null,k=e=>{var t,l;return[null!==(t=e.start)&&void 0!==t?t:e.startDate,null!==(l=e.end)&&void 0!==l?l:e.endDate].filter(Boolean).join(" - ")};return(0,s.jsxs)("div",{className:"mb-4 rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-500",children:"现任"}),(0,s.jsx)("b",{className:"text-gray-900",children:null!==(c=null!==(o=null!==(d=p.currentCompany)&&void 0!==d?d:null===(t=g[0])||void 0===t?void 0:t.companyName)&&void 0!==o?o:null===(l=g[0])||void 0===l?void 0:l.company)&&void 0!==c?c:"(未知)"}),(0,s.jsx)("span",{className:"text-gray-700",children:null!==(m=null!==(x=null!==(u=p.currentPosition)&&void 0!==u?u:null===(a=g[0])||void 0===a?void 0:a.title)&&void 0!==x?x:null===(n=g[0])||void 0===n?void 0:n.position)&&void 0!==m?m:""})]}),g.length?(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)("div",{className:"text-xs text-gray-400",children:["工作经历(近 3 段 / 共 ",g.length," 段)"]}),(0,s.jsx)("ul",{className:"mt-1 space-y-0.5 text-sm text-gray-700",children:g.slice(0,3).map((e,t)=>{var l,a,n;return(0,s.jsxs)("li",{children:[(0,s.jsx)("b",{children:null!==(a=null!==(l=e.companyName)&&void 0!==l?l:e.company)&&void 0!==a?a:"(公司未知)"})," ",null!==(n=e.title)&&void 0!==n?n:e.position," ",(0,s.jsx)("span",{className:"text-xs text-gray-400",children:k(e)})]},t)})})]}):null,y.length?(0,s.jsxs)("div",{className:"mt-2 text-sm text-gray-700",children:[(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["教育(最近 / 最高 / 共 ",y.length," 段):"]})," ",null===(r=y[0])||void 0===r?void 0:r.school," ",null===(i=y[0])||void 0===i?void 0:i.degree,w&&w!==y[0]?" \xb7 最高:".concat(w.school," ").concat(w.degree):""]}):null,v.length||j.length?(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1 text-sm",children:[v.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"技能"}),v.slice(0,12).map(e=>(0,s.jsx)("span",{className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700",children:e},e))]}):null,j.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"ml-2 text-xs text-gray-400",children:"语言"}),j.map(e=>(0,s.jsx)("span",{className:"rounded bg-green-50 px-2 py-0.5 text-xs text-green-700",children:e},e))]}):null]}):null]})}function J(e){var t,l,n;let{entity:i,portraitId:d,matches:o,sources:c}=e,[u,x]=(0,a.useState)("overview"),{versions:m,recommendations:h,changes:p,evaluations:g,recommendationsError:y,reloadRecommendations:b}=function(e){let[t,l]=(0,a.useState)(null),[s,n]=(0,a.useState)(null),[i,d]=(0,a.useState)(null),[o,c]=(0,a.useState)(null),[u,x]=(0,a.useState)(null),[m,h]=(0,a.useState)(0);return(0,a.useEffect)(()=>{if(!e){l([]),n([]),d([]),c([]),x(null);return}let t=!0;return(async()=>{let s=async(e,t)=>{try{return await e}catch(e){return t}},[a,n,i]=await Promise.all([s((0,r.aA)("/parsed-resumes?portraitId=".concat(e)),{items:[]}),s((0,r.aA)("/resume-field-changes?portraitId=".concat(e)),{items:[]}),s((0,r.aA)("/talent-portraits/".concat(e,"/evaluations")),{items:[]})]);t&&(l(a.items),d(n.items),c(i.items))})(),(async()=>{try{let l=await (0,r.aA)("/recommendations/by-portrait/".concat(e));if(!t)return;n(l.items),x(null)}catch(e){if(!t)return;n([]),x(e instanceof Error?e.message:"加载失败")}})(),()=>{t=!1}},[e,m]),{versions:t,recommendations:s,changes:i,evaluations:o,recommendationsError:u,reloadRecommendations:()=>h(e=>e+1)}}(d),v=[{key:"overview",label:"最新情况"},{key:"resumes",label:"简历",count:null!==(t=null==m?void 0:m.length)&&void 0!==t?t:null},{key:"recommendations",label:"推荐记录",count:null!==(l=null==h?void 0:h.length)&&void 0!==l?l:null},{key:"changes",label:"变更历史",count:null!==(n=null==p?void 0:p.length)&&void 0!==n?n:null}];return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-4 flex flex-wrap gap-1 border-b border-gray-200",children:v.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>x(e.key),className:"px-4 py-2 text-sm ".concat(u===e.key?"border-b-2 border-blue-500 font-medium text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.label,null!=e.count&&e.count>0?(0,s.jsxs)("span",{className:"ml-1 text-xs text-gray-400",children:["(",e.count,")"]}):null]},e.key))}),"overview"===u?(0,s.jsx)(S,{versions:m,recommendations:h,changes:p,evaluations:g,matches:o}):null,"resumes"===u?(0,s.jsx)(D,{entity:i,portraitId:d,versions:m,sources:c}):null,"recommendations"===u?(0,s.jsx)(L,{recommendations:h,error:y,onRetry:b}):null,"changes"===u?(0,s.jsx)(q,{changes:p}):null]})}let Y={talent:"人才",job:"职位",company:"公司"},V={talent:"bg-blue-50 text-blue-700",job:"bg-yellow-50 text-yellow-700",company:"bg-green-50 text-green-700"};function W(e){var t,l,n,i,d,o;let{type:c,entity:m,sources:h}=e,[p,g]=(0,a.useState)(h.length?String(h[0].id):""),[y,b]=(0,a.useState)(!1),[j,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(null),[S,A]=(0,a.useState)(null);async function C(){N(null);try{let e=await fetch("".concat((0,r.Ox)(),"/entities/").concat(c,"/").concat(m.id,"/repair-prompt"));if(!e.ok)throw Error("HTTP ".concat(e.status));let t=await e.json();await navigator.clipboard.writeText(t.prompt),b(!0),setTimeout(()=>b(!1),4e3)}catch(e){N(e.message)}}(0,a.useEffect)(()=>{if("talent"!==c)return;let e=!0;return(async()=>{try{var t,l;let s=await fetch("".concat((0,r.Ox)(),"/entities/talent/").concat(m.id,"/matches"));if(!s.ok)return;let a=await s.json();if(!e)return;k(null!==(t=null==a?void 0:a.portraitId)&&void 0!==t?t:null),A(null!==(l=null==a?void 0:a.matches)&&void 0!==l?l:[])}catch(e){}})(),()=>{e=!1}},[c,m.id]);let T="talent"===c?null!==(t=m.name)&&void 0!==t?t:"(未命名)":"job"===c?null!==(l=m.title)&&void 0!==l?l:"(未命名职位)":null!==(n=m.name)&&void 0!==n?n:"(未命名)",I="talent"===c?m.headline:"job"===c?m.company:"",E=h.find(e=>String(e.id)===p)||h[0];return(0,s.jsxs)("div",{className:"w-full",children:["talent"===c?(0,s.jsx)(v,{entity:m}):null,(0,s.jsxs)("header",{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:T}),(0,s.jsx)("span",{className:"rounded px-2 py-0.5 text-xs ".concat(null!==(i=V[c])&&void 0!==i?i:"bg-gray-100 text-gray-600"),children:null!==(d=Y[c])&&void 0!==d?d:c}),(0,s.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:m.source}),m.sourceUrl?(0,s.jsx)("a",{href:m.sourceUrl,target:"_blank",rel:"noreferrer",title:m.sourceUrl,className:"max-w-xl truncate text-sm text-blue-600 hover:underline",children:m.sourceUrl}):null]}),I?(0,s.jsx)("p",{className:"mt-1 text-gray-600",children:I}):null,m.sessionId?(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:C,className:"rounded bg-amber-600 px-3 py-1 text-sm text-white hover:bg-amber-700",children:y?"已复制 ✓ 请发给 agent":"解析有误让agent修复"}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"按录制重解析、修解析 bug、提 issue"}),j?(0,s.jsx)("span",{className:"text-xs text-red-600",children:j}):null]}):null,"talent"===c?(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,s.jsx)(f,{entityId:m.id,name:T}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"加入某职位推荐流水线,默认待邀请"})]}):null]}),"talent"===c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(R,{entity:m}),(0,s.jsx)(J,{entity:m,portraitId:w,matches:S,sources:h.map(e=>({id:e.id,sourceUrl:e.sourceUrl,domain:e.domain,createdAt:e.createdAt}))})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"解析来源"}),E?(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"当前来源页面"}),(0,s.jsx)("a",{href:E.sourceUrl,target:"_blank",rel:"noreferrer",className:"break-all text-sm text-blue-600 hover:underline",children:E.sourceUrl}),E.hasSnapshot?(0,s.jsx)("span",{className:"ml-2 rounded bg-green-50 px-1.5 py-0.5 text-xs text-green-700",children:"有录制快照"}):null]}),h.length>1?(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("label",{className:"text-sm text-gray-600",children:"历史来源:"}),(0,s.jsx)("select",{value:p,onChange:e=>g(e.target.value),className:"rounded border border-gray-300 px-2 py-1 text-sm",children:h.map(e=>(0,s.jsxs)("option",{value:e.id,children:[e.domain," \xb7 ",(0,u.d3)(e.createdAt)]},e.id))}),(0,s.jsx)("a",{href:E.sourceUrl,target:"_blank",rel:"noreferrer",className:"rounded bg-blue-600 px-3 py-1 text-sm text-white hover:bg-blue-700",children:"打开该来源页面"})]}):null]}):(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"暂无解析来源记录"})]}),(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"原始数据"}),(0,s.jsx)(x.Y,{data:null!==(o=m.extracted)&&void 0!==o?o:m.raw})]})]})]})}var z=l(27828),H=l(26119),G=l(93464);function K(e){let t=new URLSearchParams;Object.entries(e).forEach(e=>{let[l,s]=e;s&&t.set(l,s)});let l=t.toString();return l?"?".concat(l):""}function Q(e){var t,l;let{type:x,label:m,batchDelete:h}=e,p=(0,n.useRouter)(),g=(0,n.usePathname)(),y=(0,n.useSearchParams)(),b=y.get("id")||"",v=(0,a.useMemo)(()=>({q:y.get("q")||"",status:"",from:y.get("from")||"",to:y.get("to")||""}),[y]),[f,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(!1),[S,A]=(0,a.useState)(!1),[C,T]=(0,a.useState)(0),I=(0,a.useCallback)(e=>{var t,l;let s=null!==(t=e.filters)&&void 0!==t?t:v,a=K({id:null!==(l=e.id)&&void 0!==l?l:b,q:s.q,from:s.from,to:s.to});p.replace("".concat(g).concat(a))},[v,b,g,p]),{session:E,sync:U}=(0,j.nu)(),O=null!==(t=null==U?void 0:U.activeTenantId)&&void 0!==t?t:null,D=(0,H.B)({deleteUrl:"/entities/".concat(x),label:m,onDeleted:()=>F.refresh(),currentUserId:null!==(l=null==E?void 0:E.hmUserId)&&void 0!==l?l:null}),F=(0,G.k)({fetchPage:(0,a.useCallback)(async(e,t)=>{let l=K({q:v.q,from:v.from,to:v.to}),s=await (0,r.aA)("/entities?type=".concat(x,"&limit=").concat(t,"&offset=").concat(e).concat(l.replace("?","&")));return{items:s.items,total:s.total,nextOffset:s.nextOffset}},[x,v.q,v.from,v.to,O]),pageSize:50,deps:[x,v.q,v.from,v.to,O]}),P=F.items;(0,a.useEffect)(()=>{D.prune(P.map(e=>String(e.id)))},[P,D]);let L=(0,a.useCallback)(()=>{if(P.length)return P[0].updatedAt},[P]);(0,a.useEffect)(()=>{if(!b){N(null),A(!1);return}k(!0),A(!1),Promise.all([(0,r.aA)("/entities/".concat(x,"/").concat(b)),(0,r.aA)("/entities/".concat(x,"/").concat(b,"/sources")).catch(()=>null)]).then(e=>{let[t,l]=e;N({entity:t.entity,sources:l?l.items:[]})}).catch(()=>{N(null),A(!0)}).finally(()=>{k(!1)})},[x,b,O,C]);let M=(0,a.useMemo)(()=>P.map(e=>{var t,l,a;let n=String(e.id),r="talent"===x?(0,s.jsx)(z.oj,{name:null!==(t=e.name)&&void 0!==t?t:"(未命名)",headline:e.headline,source:e.source,updatedAt:e.updatedAt}):"job"===x?(0,s.jsx)(z.rY,{title:null!==(l=e.title)&&void 0!==l?l:"(无标题)",source:e.source,company:e.company,sourceUrl:e.sourceUrl,updatedAt:e.updatedAt}):(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"font-medium text-gray-900",children:null!==(a=e.name)&&void 0!==a?a:"(未命名)"}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-2 text-xs text-gray-400",children:[(0,s.jsx)("span",{children:e.source}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsx)("span",{children:(0,u.d3)(e.updatedAt)})]})]});return{id:n,content:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[h&&D.checkbox(n),r]})}}),[P,x,h,D]),_=b?w?(0,s.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"加载中…"}):S?(0,s.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-red-500",children:["加载失败",(0,s.jsx)("button",{type:"button",onClick:()=>T(e=>e+1),className:"text-blue-500 hover:underline",children:"重试"})]}):f?(0,s.jsx)(W,{type:x,entity:f.entity,sources:f.sources}):(0,s.jsxs)("div",{className:"flex h-full items-center justify-center text-red-500",children:["未找到该",m]}):(0,s.jsxs)("div",{className:"flex h-full items-center justify-center text-gray-400",children:["请在左侧选择一条",m,"查看详情"]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.m,{filterBar:(0,s.jsxs)("div",{className:"border-b border-gray-200 bg-white",children:[(0,s.jsx)(i.f,{value:v,onChange:e=>I({filters:e})}),(0,s.jsx)(c.Y,{pollUrl:"/entities/count?type=".concat(x),getLatestTimestamp:L,onRefresh:()=>F.refresh(),label:m}),h&&D.bar(M)]}),listPanel:F.error?(0,s.jsxs)("div",{className:"flex-1 overflow-auto p-4 text-center text-sm",children:[(0,s.jsx)("span",{className:"text-red-500",children:"加载失败"}),(0,s.jsx)("button",{type:"button",onClick:()=>F.refresh(),className:"ml-2 text-blue-500 hover:underline",children:"重试"})]}):(0,s.jsx)(o.L,{items:M,selectedId:b,onSelect:e=>I({id:e}),loading:F.loading,emptyText:"暂无".concat(m,"数据"),onLoadMore:F.loadMore,loadingMore:F.loadingMore,exhausted:F.exhausted}),detailPanel:_}),D.modal()]})}function X(e){return(0,s.jsx)(a.Suspense,{fallback:(0,s.jsx)("div",{className:"p-6 text-gray-500",children:"加载中…"}),children:(0,s.jsx)(Q,{...e})})}},37202:function(e,t,l){l.d(t,{f:function(){return n}});var s=l(72835),a=l(60635);function n(e){let{value:t,showStatus:l,statusOptions:n,onChange:r}=e,[i,d]=(0,a.useState)(t);return(0,a.useEffect)(()=>{d(t)},[t.q,t.status,t.from,t.to]),(0,a.useEffect)(()=>{let e=setTimeout(()=>{(i.q!==t.q||i.status!==t.status||i.from!==t.from||i.to!==t.to)&&r(i)},300);return()=>clearTimeout(e)},[i.q,i.status,i.from,i.to]),(0,s.jsxs)("div",{className:"space-y-2 border-b border-gray-200 bg-white p-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)("input",{type:"text",value:i.q,onChange:e=>d(t=>({...t,q:e.target.value})),placeholder:"搜索关键词...",className:"w-full rounded border border-gray-300 px-2 py-1.5 pr-8 text-sm outline-none focus:border-blue-500"}),(0,s.jsx)("button",{type:"button",onClick:()=>r({q:"",status:"",from:"",to:""}),title:"重置筛选",className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 disabled:opacity-30",disabled:!i.q&&!i.status&&!i.from&&!i.to,children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),l?(0,s.jsxs)("select",{value:i.status,onChange:e=>d(t=>({...t,status:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500",children:[(0,s.jsx)("option",{value:"",children:"全部状态"}),(n||[]).map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))]}):null]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"date",value:i.from,onChange:e=>d(t=>({...t,from:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"}),(0,s.jsx)("span",{className:"text-sm text-gray-400",children:"-"}),(0,s.jsx)("input",{type:"date",value:i.to,onChange:e=>d(t=>({...t,to:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"})]})]})}},86777:function(e,t,l){l.d(t,{Y:function(){return d}});var s=l(72835),a=l(60635);function n(e){let{value:t}=e;if(null===t)return(0,s.jsx)("span",{className:"italic text-gray-400",children:"null"});if(void 0===t)return(0,s.jsx)("span",{className:"italic text-gray-400",children:"undefined"});switch(typeof t){case"string":return(0,s.jsxs)("span",{className:"break-all text-red-700",children:['"',t,'"']});case"number":return(0,s.jsx)("span",{className:"text-emerald-700",children:String(t)});case"boolean":return(0,s.jsx)("span",{className:"text-blue-700",children:String(t)});default:return(0,s.jsx)("span",{className:"text-gray-700",children:String(t)})}}function r(e){let{name:t}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"text-indigo-700",children:['"',t,'"']}),(0,s.jsx)("span",{className:"text-gray-500",children:": "})]})}function i(e){let{name:t,value:l,depth:d}=e,[o,c]=(0,a.useState)(d<2);if(!("object"==typeof l&&null!==l&&!Array.isArray(l))&&!Array.isArray(l))return(0,s.jsxs)("div",{className:"min-w-0",children:[null!==t?(0,s.jsx)(r,{name:t}):null,(0,s.jsx)(n,{value:l})]});let u=Array.isArray(l),x=u?l.map((e,t)=>[String(t),e]):Object.entries(l),m=u?"]":"}",h=x.length;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"group flex cursor-pointer select-none items-baseline rounded hover:bg-gray-100",onClick:()=>c(e=>!e),role:"button","aria-expanded":o,children:[(0,s.jsx)("span",{className:"mr-0.5 inline-block w-4 shrink-0 text-center text-gray-400",children:h>0?o?"▾":"▸":""}),null!==t?(0,s.jsx)(r,{name:t}):null,(0,s.jsx)("span",{className:"text-gray-700",children:u?"[":"{"}),o?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"mx-1 rounded bg-gray-100 px-1 text-gray-400 group-hover:bg-gray-200",children:u?"".concat(h," 项"):"".concat(h," 键")}),(0,s.jsx)("span",{className:"text-gray-700",children:m})]})]}),o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"ml-[7px] border-l border-gray-200 pl-3",children:x.map(e=>{let[t,l]=e;return(0,s.jsx)(i,{name:u?null:t,value:l,depth:d+1},t)})}),(0,s.jsx)("div",{className:"pl-5 text-gray-700",children:m})]}):null]})}function d(e){let{data:t}=e;return null==t?(0,s.jsx)("div",{className:"text-xs text-gray-400",children:"(无数据)"}):(0,s.jsx)("div",{className:"max-h-[32rem] overflow-auto rounded bg-gray-50 p-3 font-mono text-xs leading-5",children:(0,s.jsx)(i,{name:null,value:t,depth:0})})}},19036:function(e,t,l){l.d(t,{Y:function(){return r}});var s=l(72835),a=l(60635),n=l(74431);function r(e){let{pollUrl:t,intervalMs:l=5e3,onRefresh:r,getLatestTimestamp:i,label:d="新数据"}=e,[o,c]=(0,a.useState)(0),[u,x]=(0,a.useState)(!1),m=(0,a.useRef)(void 0);return((0,a.useEffect)(()=>{let e=()=>x(document.hidden);return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]),(0,a.useEffect)(()=>{m.current=i(),c(0)},[i]),(0,a.useEffect)(()=>{if(u)return;let e=async()=>{let e=m.current;if(!e)return;let l=t.includes("?")?"&":"?",s=0;try{var a;let r=await (0,n.aA)("".concat(t).concat(l,"since=").concat(encodeURIComponent(e)));s=null!==(a=r.count)&&void 0!==a?a:0}catch(e){}c(e=>Math.max(e,s))};e();let s=setInterval(e,l);return()=>clearInterval(s)},[t,l,u]),o<=0)?null:(0,s.jsxs)("button",{type:"button",onClick:()=>{c(0),r()},className:"w-full bg-blue-50 px-3 py-2 text-center text-sm text-blue-700 hover:bg-blue-100 active:bg-blue-200",children:["有 ",o," 条",d,",点击刷新"]})}}}]);