import{a as e,n as t,t as n}from"./jsx-runtime-CutOxEx1.js";import{d as r,l as i}from"./chunk-6CSD65Y2-BjfinoX-.js";import{r as a}from"./authSession-Dulxhbeq.js";import{r as o}from"./norm-f7iXVy-b.js";import{n as s}from"./runtimeFeatures-DPvDAM4s.js";import{n as c}from"./llmSettings-8VBl-FQI.js";import{t as l}from"./resumeAiConsent-3fYgyUHE.js";import{t as u}from"./createLucideIcon-D6B-X28I.js";import{t as d}from"./alert-circle-Bbhy7EjJ.js";import{n as f,t as p}from"./trending-up-BD3RfKls.js";import{t as m}from"./briefcase-Dk3vy-5X.js";import{n as h,t as g}from"./message-square-DMXD1bW8.js";import{t as _}from"./external-link-BLYE1R6N.js";import{t as v}from"./file-text-DsuuTZpm.js";import{t as y}from"./send-D2dk6kZF.js";import{t as b}from"./shield-check-zXIudjoP.js";import{t as x}from"./sparkles-B5E8t1MX.js";import{t as S}from"./x-BrDGz5b1.js";import{t as C}from"./PlatformTokenUsage-BOBT9r1m.js";import{n as w,t as ee}from"./ToolConversationUI-WfmJSuU3.js";import{a as T,i as E,n as te,t as ne}from"./llm-DjSVhhgj.js";import{c as D,i as O,l as re,n as ie,s as k,t as A,u as ae}from"./toolRuntime-CFu8ZbRX.js";import{n as j,t as M}from"./ToolSidebarNav-Py6lZOex.js";import{t as N}from"./MarkdownText-Du4i1sv4.js";import{t as P}from"./ToolLiveStreamPanel-DOjuHZof.js";import{i as F,r as I,t as L}from"./ToolConversationBilling-DMVcVppo.js";import{a as R,c as oe,o as z,r as se,s as B}from"./marketService-JUKV6PH8.js";import{t as V}from"./supportFileText-DOFcXb8H.js";import{n as H}from"./taskPointGuard-DQLlEFVj.js";import{n as ce,t as U}from"./toolSkillSummary-BaaCQSOG.js";import{n as le,r as W}from"./ToolConversationPersistence-BXOyFMX0.js";import{a as ue,i as de,n as fe,o as pe,r as G,t as me}from"./ToolConversationExecution-Do6biEtR.js";import{n as he,t as K}from"./ComingSoonPanel-fFedT8aH.js";import{n as ge,t as _e}from"./useToolRunState-BASJ0aoE.js";import{n as ve}from"./ToolConversationHelpers-Cl6_xe6W.js";import{t as q}from"./ToolRunStatus-Bmkja9xq.js";import{i as ye,r as be}from"./exploreContext-CYgurwOx.js";var xe=u(`Calculator`,[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`line`,{x1:`8`,x2:`16`,y1:`6`,y2:`6`,key:`x4nwl0`}],[`line`,{x1:`16`,x2:`16`,y1:`14`,y2:`18`,key:`wjye3r`}],[`path`,{d:`M16 10h.01`,key:`1m94wz`}],[`path`,{d:`M12 10h.01`,key:`1nrarc`}],[`path`,{d:`M8 10h.01`,key:`19clt8`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}]]),J=u(`CheckCircle`,[[`path`,{d:`M22 11.08V12a10 10 0 1 1-5.93-9.14`,key:`g774vq`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Y=u(`Coffee`,[[`path`,{d:`M17 8h1a4 4 0 1 1 0 8h-1`,key:`jx4kbh`}],[`path`,{d:`M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z`,key:`1bxrl0`}],[`line`,{x1:`6`,x2:`6`,y1:`2`,y2:`4`,key:`1cr9l3`}],[`line`,{x1:`10`,x2:`10`,y1:`2`,y2:`4`,key:`170wym`}],[`line`,{x1:`14`,x2:`14`,y1:`2`,y2:`4`,key:`1c5f70`}]]),Se=u(`Flame`,[[`path`,{d:`M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z`,key:`96xj49`}]]),Ce=u(`Languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),we=u(`MailOpen`,[[`path`,{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`,key:`1jhwl8`}],[`path`,{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`,key:`1qfld7`}]]),X=e(t(),1),Z=n(),Te=`deepseek_pro`,Ee=`deepseek`,De=`deepseek-v4-pro`,Oe=1,ke=/市场价|市场薪资|市场行情|薪资行情|薪资范围|薪酬范围|薪资区间|薪酬区间|市场上|benchmark|bench\s*mark|对标|同岗|同岗位|同职位|同行业|行业平均|行业水平|外部数据|最新薪资|当前市场|脉脉|看准|boss直聘|boss|拉勾|猎聘|glassdoor|levels\.fyi|大概多少钱|值多少钱/i,Ae=e=>ke.test(o(e)),je=e=>(Array.isArray(e)?e:[]).map(e=>({title:o(e?.title||e?.url),url:o(e?.url),source:o(e?.source)})).filter(e=>/^https?:\/\//i.test(e.url)).slice(0,8),Me=e=>(Array.isArray(e)?e:[]).slice(0,5).map((e,t)=>[`Offer ${t+1}`,o(e.company)?`公司：${o(e.company)}`:``,o(e.role)?`岗位：${o(e.role)}`:``,o(e.base)?`Base：${o(e.base)}`:``,o(e.bonus)?`奖金：${o(e.bonus)}`:``,o(e.stock)?`股票/期权：${o(e.stock)}`:``,o(e.level)?`级别：${o(e.level)}`:``,o(e.location)?`地点：${o(e.location)}`:``,o(e.note)?`备注：${o(e.note)}`:``].filter(Boolean).join(`
`)).join(`

`),Ne=e=>/proxy_non_json/i.test(String(e?.message||e||``)),Pe=e=>{let t=String(e||``).replace(/\r/g,``).split(`
`).map(e=>o(e)).filter(Boolean).slice(0,4).join(`
`);return t.length<=700?t:`${t.slice(0,700)}...`},Fe=(e,t=[])=>({title:`薪酬谈判：待补充信息`,summary:Pe(e)||`当前信息还不够完整，请先补充关键 Offer 信息。`,strategy:`先补齐岗位、薪资、地点、Offer 细节、优先级、风险点、机会成本和不可接受条件，再判断下一步。`,bottomLine:`信息未补齐前，不直接判断接受或拒绝。`,nextQuestion:`请补充岗位、薪资、地点、Offer 细节、优先级、风险点、机会成本和不可接受条件。`,compensationBreakdown:[],leveragePoints:[],objections:[],tips:[],caveats:[`本轮结构化详情由正文降级生成；你补充信息后，我会重新整理详情。`],gapTable:[],offerComparisons:[],radar:{labels:[],selfValues:[],offerValues:[]},emailDrafts:[],...Array.isArray(t)&&t.length?{webSearchCitations:t}:{}}),Ie=async(e,t,n)=>{let r=!1,i;return await new Promise(a=>{i=window.setTimeout(()=>{r||(r=!0,a(n))},Math.max(200,t)),e.then(e=>{r||(r=!0,i&&window.clearTimeout(i),a(e))},()=>{r||(r=!0,i&&window.clearTimeout(i),a(n))})})},Le=()=>{try{let e=new Uint8Array(12);return crypto.getRandomValues(e),Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}catch{return`${Date.now().toString(16)}${Math.random().toString(16).slice(2)}`.replace(/[^a-f0-9]/gi,``).slice(0,24)}},Re=(e,t)=>I({beforeIds:e,requestId:t,aggregateAllNew:e.size>0,pageSize:200,rangeDays:1,attempts:8,retryDelayMs:800});function ze(){let e=[{value:`received_offer`,label:`收到 Offer`,hint:`先拆总包与缺口`},{value:`prepare_counter`,label:`准备反驳`,hint:`组织诉求与让步顺序`},{value:`got_reply`,label:`收到回复`,hint:`判断下一轮推进方式`},{value:`final_decision`,label:`最终决策`,hint:`比较去留与确认底线`}],[t,n]=(0,X.useState)(!1),[i,s]=(0,X.useState)(``),{runState:u,progress:d,setProgress:f,start:p,partial:m,done:h,failByMessage:g}=ge(),[_,v]=(0,X.useState)(null),[y,b]=(0,X.useState)(``),[x]=r();(0,X.useEffect)(()=>{if(x.get(`cc_ref`)===`career_coach`){let e=x.get(`cc_resume`)||``;e&&b(t=>t||e)}let e=x.get(`source`)||``;if(e!==`career_coach`&&e!==`salary_position`&&e!==`public_jobs`)return;let t=O(x.get(`sid`)||``);if(!t)return;let n=e===`public_jobs`?`岗位库带入`:`职业教练带入`,r=[];o(t.resumeText)&&r.push({name:`${n}：简历`,content:o(t.resumeText),preview:o(t.resumeText).slice(0,120)}),o(t.jdText)&&r.push({name:`${n}：岗位信息`,content:o(t.jdText),preview:o(t.jdText).slice(0,120)}),r.length&&(I(e=>e.length?e:r),M(e=>e.length?e:r.map(e=>({name:e.name,preview:e.preview}))));let i=o(t.prefillHint)||[o(t.primaryAction),o(t.summary),o(t.nextQuestion)].filter(Boolean).join(`
`);i&&b(e=>e||i)},[]);let[S,C]=(0,X.useState)([]),w=(0,X.useRef)([]),[ee,D]=(0,X.useState)([]),[j,M]=(0,X.useState)([]),[P,I]=(0,X.useState)([]),[L,R]=(0,X.useState)(``),[oe,z]=(0,X.useState)(``),[se,B]=(0,X.useState)(``),[me,K]=(0,X.useState)(``),q=(0,X.useRef)(``),ye=(0,X.useRef)(null),be=(0,X.useRef)(``),xe=(0,X.useRef)(null),J=(0,X.useRef)(null),Y=(0,X.useRef)(0),Se=(0,X.useRef)(4),Ce=(0,X.useRef)(null),[we,ke]=(0,X.useState)(``),[Pe,ze]=(0,X.useState)(!0),[Be,Ve]=(0,X.useState)(!1),[He,Ue]=(0,X.useState)([]),[We,Ge]=(0,X.useState)(``),[Ke,qe]=(0,X.useState)(e[0].value),[Q,Je]=(0,X.useState)([]),Ye=e=>{C(t=>{let n=[...t,e].slice(-80);return w.current=n,n})};(0,X.useEffect)(()=>{w.current=S},[S]),le({tool:`salary_negotiation`,onRestore:e=>{e.result&&v(e.result),Array.isArray(e.chatTurns)&&(C(e.chatTurns.slice(-80)),w.current=e.chatTurns.slice(-80)),Array.isArray(e.uploadedDocs)&&I(e.uploadedDocs.slice(-20)),Array.isArray(e.offerCards)&&Je(e.offerCards.slice(0,5)),o(e.streamText)&&(R(o(e.streamText)),Ge(o(e.streamText))),o(e.streamThinking)&&z(o(e.streamThinking)),o(e.streamStage)&&B(o(e.streamStage)),o(e.streamActor)&&K(o(e.streamActor)),Number.isFinite(Number(e.progress))&&f(Number(e.progress))},syncEntries:[{key:`result`,signature:e=>e.result?JSON.stringify(e.result):``,apply:e=>v(e.result||null)},{key:`chatTurns`,signature:e=>Array.isArray(e.chatTurns)?JSON.stringify(e.chatTurns):``,apply:e=>{let t=Array.isArray(e.chatTurns)?e.chatTurns.slice(-80):[];C(t),w.current=t}},{key:`uploadedDocs`,signature:e=>Array.isArray(e.uploadedDocs)?JSON.stringify(e.uploadedDocs):``,apply:e=>I(Array.isArray(e.uploadedDocs)?e.uploadedDocs.slice(-20):[])},{key:`offerCards`,signature:e=>Array.isArray(e.offerCards)?JSON.stringify(e.offerCards):``,apply:e=>Je(Array.isArray(e.offerCards)?e.offerCards.slice(0,5):[])},{key:`streamText`,signature:e=>o(e.streamText),apply:e=>{let t=o(e.streamText);R(t),Ge(t)}},{key:`streamThinking`,signature:e=>o(e.streamThinking),apply:e=>z(o(e.streamThinking))},{key:`streamStage`,signature:e=>o(e.streamStage),apply:e=>B(o(e.streamStage))},{key:`streamActor`,signature:e=>o(e.streamActor),apply:e=>K(o(e.streamActor))},{key:`progress`,signature:e=>Number.isFinite(Number(e.progress))?String(Number(e.progress)):``,apply:e=>{Number.isFinite(Number(e.progress))&&f(Number(e.progress))}}],onRunState:(e,t)=>{e===`running`?(p(),n(!0)):e===`partial`?(m(),n(!0)):e===`done`?(h(),n(!1)):e===`failed`?(g(String(t.err||`生成失败`),s),n(!1)):e===`cancelled`&&(g(`已取消`,s),n(!1))},shouldStop:e=>e!==`running`&&e!==`partial`}),(0,X.useEffect)(()=>{let e=Ce.current;if(e)try{e.scrollTop=e.scrollHeight}catch{}},[S.length,oe,L,we,t]);let Xe=e=>{let t=String(e||``).replace(/\r/g,``).replace(/```[\s\S]*?```/g,``).split(`
`).map(e=>e.trimEnd()),n=[],r=``;for(let e of t){let t=String(e||``).trim();t&&(/^\s*[\{\}\[\],]+\s*$/.test(t)||/output_schema|compact_json|response_format|max_tokens|prompt_tokens/i.test(t)||t!==r&&(r=t,n.push(t)))}let i=n.join(`
`);return i.length<=12e3?i:`…\n${i.slice(-12e3)}`},Ze=e=>{let t=String(e||``).trim();return t?/^\s*[\[{]/.test(t)?!0:(t.match(/"\w+"\s*:/g)||[]).length>=4:!1},$=e=>{let t=String(e||``).replace(/\r/g,``);if(!t)return``;let n=t,r=t.match(/---JSON_STATE---/);if(r&&typeof r.index==`number`)n=t.slice(0,r.index);else{let e=t.match(/```json\b[\s\S]*/i);e&&typeof e.index==`number`&&(n=t.slice(0,e.index))}n=n.replace(/^<对话回复>[\s\n]*/i,``).replace(/<\/?对话回复>[\s\n]*/gi,``).trim();let i=n.split(`
`).map(e=>e.trimEnd()).filter(e=>!!String(e||``).trim()).join(`
`);return i.length<=16e3?i:`…\n${i.slice(-16e3)}`},Qe=e=>{let t=String(e||``);if(!t)return[];let n=t.match(/(?:\d{3,6}(?:\.\d+)?(?:元|块|rmb|cny)?(?:\/?(?:月|年))?|\d+(?:\.\d+)?\s*[kKwW万](?:\/?(?:月|年))?)/g)||[];return Array.from(new Set(n.map(e=>o(e)).filter(Boolean))).slice(0,20)},$e=e=>{let t=[];return o(e.summary)&&t.push(`我先给你一个判断：${o(e.summary)}`),o(e.strategy)&&t.push(`如果现在继续往下谈，我更建议你这样推进：${o(e.strategy)}`),o(e.bottomLine)&&t.push(`如果你要守住底线，可以先记住这条：${o(e.bottomLine)}`),Array.isArray(e.tips)&&e.tips.length&&t.push(`你可以直接这样回对方：\n${e.tips.slice(0,12).map(e=>`- ${o(e)}`).join(`
`)}`),o(e.nextQuestion)&&t.push(`我接下来最想确认的是：${o(e.nextQuestion)}`),t.join(`

`)||`已生成建议。`},et=e=>{let t=o(String(e||``).split(`
`).map(e=>o(e)).filter(Boolean).slice(0,3).join(`；`)||String(e||``).slice(0,120));return t.length<=120?t:`${t.slice(0,120)}…`},tt=(e,t)=>{let n=String(e||``).trim();return n?t===`user`?(0,Z.jsx)(`div`,{style:{whiteSpace:`pre-wrap`},children:n}):(0,Z.jsx)(N,{text:n}):null},nt=e=>{let t=o(e);t&&b(t)},rt=()=>{ze(!0),ve(`salary-detail-view`,`start`)},it=async e=>{let t=Array.isArray(e)?e.slice(0,5):[];if(!t.length)return;if(!(await a())?.token)throw Error(`请先登录后上传文件`);if(!await l())throw Error(`未同意隐私条款，已取消文件解析`);let n=[],r=[];for(let e of t){let t=o(e?.name)||`附件`,i=``;i=await V(e,{minLength:120,onStage:ke}).catch(()=>``);let a=o(i).slice(0,12e3);a&&(n.push({name:t,content:a}),r.push({name:t,preview:et(a)}))}if(n.length){let e=n.reduce((e,t)=>e+o(t.content).length,0);I(e=>[...e,...n].slice(-20)),M(e=>[...e,...r].slice(-10)),Ye({id:`turn_s_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`system`,content:`已解析 ${n.length} 个附件，共提取约 ${e} 字内容。后续回答会自动结合这些材料更新判断。`,createdAt:Date.now(),attachments:r})}ke(``)},at=async r=>{if(t)return;let i=j.slice(),u=o(r)||(i.length?`我补充了几个附件，请结合这些信息继续帮我分析。`:``);if(!u)return;let d=++Y.current;if(!(await a())?.token){s((0,Z.jsxs)(`span`,{children:[`请先`,(0,Z.jsx)(`a`,{href:A(),style:{color:`var(--accent)`,marginLeft:4},children:`登录`}),`后使用`]}));return}if(P.length>0&&!await l())return;try{let e=await H({tool:`salary_negotiation`,modelChoice:Te,dialogChars:u.length,docsChars:P.reduce((e,t)=>e+o(t?.content).length,0),chatChars:w.current.reduce((e,t)=>e+o(t?.content).length,0),searchCostPoints:Ae(u)?Oe:0});if(!e.ok){s((0,Z.jsxs)(`p`,{style:{color:`var(--accent)`,fontSize:`13px`},children:[e.message,` `,(0,Z.jsx)(`a`,{href:e.rechargeHref,children:`充值`})]}));return}}catch(e){s((0,Z.jsx)(`p`,{style:{color:`var(--accent)`,fontSize:`13px`},children:String(e?.message||`暂时无法校验积分余额，请稍后重试。`)}));return}s(``),pe({setStreamText:R,setStreamThinking:z,setStreamStage:B,setStreamActor:K,streamTextRawRef:q,streamThinkingRawRef:be,streamTextFlushTimerRef:ye,streamThinkingFlushTimerRef:xe}),n(!0),p(),b(``);let f={id:`turn_u_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`user`,content:u,createdAt:Date.now(),attachments:i};Ye(f),W(`salary_negotiation`,{runState:`running`,chatTurns:[...S,f].slice(-80),uploadedDocs:P.slice(-20)}),M([]),D([]),J.current=new AbortController;let m=J.current.signal,_=new Set,y=Le(),x=[],ee=(e,t)=>{let n=o($(t))||o(t)||$e(e);v(e);let r={id:`turn_a_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`assistant`,content:n,createdAt:Date.now(),billing:null},i=[...w.current,r].slice(-80);C(i),w.current=i,h(),R(``),z(``),B(``),K(``),W(`salary_negotiation`,{runState:`done`,result:e,uploadedDocs:P.slice(-20),chatTurns:i,offerCards:Q.slice(0,5),streamText:``,streamThinking:``,streamStage:``,streamActor:``}),(y||_.size)&&Re(_,y).then(e=>{e&&C(t=>{let n=!1,i=t.map(t=>t.id===r.id?(n=!0,{...t,billing:e}):t);return n?(w.current=i,W(`salary_negotiation`,{chatTurns:i}),i):t})}).catch(()=>{})};try{_=await Ie(F({rangeDays:1,pageSize:200}),1500,new Set);let t=e=>{let t=je(e);t.length&&(x=t)},n=await c();if(!n.enabled||!n.proxyUrl)throw Error(`AI 服务未启用，请在设置中开启 AI 代理`);let r=o(n.clientId)||`public`,i=String(globalThis?.navigator?.language||`zh-CN`),a=Me(Q),s=P.slice(-20).map(e=>`附件《${o(e.name)}》：\n${o(e.content).slice(0,12e3)}`).filter(Boolean).join(`

`),l=w.current.filter(e=>e.role===`user`||e.role===`assistant`).slice(-30).map(e=>`${e.role===`user`?`用户`:`助手`}：${o(e.content)}`).filter(Boolean).join(`
`),f=``;try{let e=await he(u,void 0,e=>{B(e)});e.triggered&&e.contextText&&(f=e.contextText)}catch{}let p=[f,`你正在作为薪酬谈判 Skill 与策略 Agent 工作：先追问缺失信息，再拆解总包、筹码、让步边界和可直接发送的话术。`,`事实边界：只能使用用户已在本轮输入、历史对话、Offer 卡片或上传附件中明确提供的信息。`,`禁止补写：不要根据行业常识、岗位分类、示例、市场搜索或你的猜测，生成用户没有提供过的岗位、公司、地点、薪资、职级、Offer 名称或候选方案。`,`如果缺少岗位/公司/地点/薪资结构/对方原话/候选 offer/优先级/风险点/机会成本/不可接受条件，先提出 2-5 个追问；不要先下最终决策，也不要生成带具体岗位名或薪资数字的标题。`,`标题与正文必须可被用户已给信息支撑；没有明确岗位或 offer 名时，用”薪酬谈判：待补充信息”这类通用表述。`,`请按真实对话方式继续，用自然语言追问和回复，不要输出任何 JSON 代码块或结构化表单。`,`请主动追问：招聘方给出的条件、用户自身条件、候选offer信息；信息不足时分步提问。`,`常见反驳应对要口语化、可直接发给招聘方。`,`每一轮都必须综合已有对话历史、所有已上传附件和本轮新增信息动态更新判断；如果用户后补充了新条件，要基于新信息修正之前建议，而不是重复旧结论。`,`用户输入里的数字（尤其薪资金额）必须原样保留，禁止擅自缩放、去零或改单位；若不确定必须原文复述确认。`,`本轮识别到的金额片段：${Qe(`${l}\n${u}\n${s}`).join(`，`)||`未识别到`}`,`当前谈判阶段：${e.find(e=>e.value===Ke)?.label||Ke}`,a?`用户手动维护的 Offer 卡片：\n${a}`:``,l?`对话历史：\n${l}`:``,s?`已上传文件内容：\n${s}`:``,`本轮用户输入：${u}`].filter(Boolean).join(`

`),h=Ae(u),g={lang:i,context:p,userInput:u,resumeText:s.slice(0,2e4),stage:Ke,offerDetails:a,searchIntent:h},v=fe({tool:`salary_negotiation`,runSeq:d,runSeqRef:Y,stage:`调用薪酬谈判 Skill`,agentLabel:`策略 Agent`,skillLabel:`薪酬谈判 Skill`,setStreamStage:B,setStreamActor:K,setStreamText:R,setStreamThinking:z,buildPlainStreamPreview:$,sanitizeThinking:Xe,streamTextRawRef:q,streamThinkingRawRef:be,streamTextFlushTimerRef:ye,streamThinkingFlushTimerRef:xe,hideModelMeta:!0}),b=await ae(te({proxyUrl:n.proxyUrl,gatewayApiKey:n.gatewayApiKey,clientId:r,tier:n.tier,preset:`salary_negotiation`,provider:Ee,model:De,thinking:!0,data:g,signal:m,requestId:y,onMeta:e=>{e?.webSearchCitations&&t(e.webSearchCitations),v.onMeta(e),y=v.getRequestId()||y},onText:v.onText,onThinking:v.onThinking}),6e5,`AI 生成`);v.flushPending();let S=null,C=``,E=e=>{let t=``,n=e,r=e.match(/```json\b[^\r\n]*\r?\n([\s\S]*?)```/i);if(r)n=e.slice(0,r.index).trim(),t=r[1].trim();else if(Ze(e))n=``,t=T(e);else{let n=e.lastIndexOf(`}`),r=e.indexOf(`{`);r>=0&&n>r&&(t=T(e))}return{mdPart:n,jsonPart:t}},D=E(b);C=D.mdPart;try{S=JSON.parse(D.jsonPart)}catch{S=null}let O=!!(S&&typeof S==`object`&&!Array.isArray(S)&&Object.keys(S).length===0);if(!S||typeof S!=`object`||O){let e=o(C)||$(q.current)||$(b);if(e)C=e,S=Fe(e,x);else try{let e=Le();D=E(await ae(ne({proxyUrl:n.proxyUrl,gatewayApiKey:n.gatewayApiKey,clientId:r,tier:n.tier,preset:`salary_negotiation`,provider:Ee,model:De,data:{...g,force_json:!0},signal:m,requestId:e,onResponseMeta:e=>{e?.webSearchCitations&&t(e.webSearchCitations)}}),6e5,`AI 重试`)),C||=D.mdPart;try{S=JSON.parse(D.jsonPart)}catch{S=null}}catch(e){let t=o(C)||$(q.current)||$(b);if(!t)throw e;C=t,S=Fe(t,x)}}let k=!!(S&&typeof S==`object`&&!Array.isArray(S)&&Object.keys(S).length===0);if(!S||typeof S!=`object`||k){let e=o(C)||$(q.current)||$(b);if(!e)throw Error(`生成失败，请重试`);C=e,S=Fe(e,x)}let A={...S,...x.length?{webSearchCitations:x}:{}};ee(A,C);let j=`salary_negotiation_${Date.now()}_${Math.random().toString(16).slice(2,8)}`;queueMicrotask(()=>{re(U({id:j,toolLabel:`薪酬谈判`,toolType:`salary_negotiation`,title:o(A.title)||`薪酬谈判结果`,score:``,deepLink:ie(`/tools/salary-negotiation`,`result`,{rid:j}),result:A}),{result:A,uploadedDocs:P}).catch(()=>{})})}catch(e){if(d!==Y.current)return;if(e?.name===`AbortError`){g(`已取消`,s);return}let t=$(q.current);if(t&&Ne(e)){ee(Fe(t,x),t),s(``);return}let n=k(e);g(n,s),s(n),W(`salary_negotiation`,{runState:String(n||``).includes(`取消`)?`cancelled`:`failed`,err:String(n||``)})}finally{pe({setStreamText:R,setStreamThinking:z,setStreamStage:B,setStreamActor:K,streamTextRawRef:q,streamThinkingRawRef:be,streamTextFlushTimerRef:ye,streamThinkingFlushTimerRef:xe}),n(!1),J.current=null}},ot=async()=>{if(t)return;let e=++Y.current;if(s(``),!await a()){s((0,Z.jsxs)(`p`,{style:{color:`var(--accent)`,fontSize:`13px`},children:[`请先`,(0,Z.jsx)(`a`,{href:A(),children:`登录`}),`后使用薪酬谈判功能`]}));return}try{let e=await H({tool:`salary_negotiation`,modelChoice:Te,dialogChars:o(y).length,docsChars:P.reduce((e,t)=>e+o(t?.content).length,0),chatChars:w.current.reduce((e,t)=>e+o(t?.content).length,0),searchCostPoints:Ae(y)?Oe:0});if(!e.ok){s((0,Z.jsxs)(`p`,{style:{color:`var(--accent)`,fontSize:`13px`},children:[e.message,` `,(0,Z.jsx)(`a`,{href:e.rechargeHref,children:`充值`})]}));return}}catch(e){s((0,Z.jsx)(`p`,{style:{color:`var(--accent)`,fontSize:`13px`},children:String(e?.message||`暂时无法校验积分余额，请稍后重试。`)}));return}Ue([]),Ge(``),Se.current=4,p(),n(!0),J.current=new AbortController;try{let t=await Ie(F({rangeDays:1,pageSize:200}),1500,new Set),n=Le(),r=await c();if(!r.enabled||!r.proxyUrl)throw Error(`AI 服务未启用，请在设置中开启 AI 代理`);let i=o(y);W(`salary_negotiation`,{runState:`running`,progress:0,err:``,streamText:``,streamThinking:``,streamStage:`准备开始`,streamActor:`agent`,offerCards:Q.slice(0,5)});let a=Me(Q),s=P.slice(-20).map(e=>`附件《${o(e.name)}》：\n${o(e.content).slice(0,12e3)}`).filter(Boolean).join(`

`),l=w.current.filter(e=>e.role===`user`||e.role===`assistant`).slice(-30).map(e=>`${e.role===`user`?`用户`:`助手`}：${o(e.content)}`).filter(Boolean).join(`
`),u={current:``},d=await E({op:`salary_negotiation_agent`,proxyUrl:r.proxyUrl,gatewayApiKey:r.gatewayApiKey,thinking:!0,subProvider:Ee,subModel:De,data:(()=>{let e=Q.find(e=>o(e?.role||e?.company||e?.location));return{userInput:i,context:[a?`用户手动维护的 Offer 卡片：\n${a}`:``,l?`对话历史：\n${l}`:``,s?`已上传文件内容：\n${s}`:``,i?`本轮用户输入：${i}`:``].filter(Boolean).join(`

`),jd:``,jobTitle:o(e?.role||``),company:o(e?.company||``),city:o(e?.location||``),offerDetails:a,stage:Ke}})(),signal:J.current.signal,requestId:n,onToolStart:(t,n,r)=>{if(e!==Y.current)return;Se.current=Math.max(1,Number(r||0)||1),Ue(e=>ue(e,t)),B(`步骤 ${n}/${r}`);let i=_e(n,r,`start`);f(i),W(`salary_negotiation`,{runState:`running`,progress:i,streamStage:`步骤 ${n}/${r}`,streamActor:t})},onToolDone:(t,n)=>{if(e!==Y.current)return;Ue(e=>G(e,t));let r=_e(n,Se.current,`done`);f(r),W(`salary_negotiation`,{runState:`partial`,progress:r,streamStage:`已完成 ${n}/${Se.current}`,streamActor:t})},onProcess:t=>{e===Y.current&&R(e=>{let n=de(e,String(t||``));return Ge(n),u.current=n,W(`salary_negotiation`,{runState:`partial`,streamText:n}),n})},onThinking:t=>{e===Y.current&&z(e=>{let n=de(e,String(t||``),12e3);return W(`salary_negotiation`,{runState:`partial`,streamThinking:n}),n})},onText:t=>{e===Y.current&&Ge(t)}});if(e!==Y.current)return;let p=o(u.current)||String(d||``),m=o($(p))||o(p)||`当前信息还不够，请先补充岗位、薪资、地点和 Offer 细节。`,g={id:`turn_a_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`assistant`,content:m,createdAt:Date.now(),billing:null},_=[...w.current,g].slice(-80);C(_),w.current=_,W(`salary_negotiation`,{runState:`done`,progress:100,streamText:``,streamThinking:``,streamStage:``,streamActor:``,offerCards:Q.slice(0,5),chatTurns:_}),Re(t,n).then(e=>{e&&C(t=>{let n=!1,r=t.map(t=>t.id===g.id?(n=!0,{...t,billing:e}):t);return n?(w.current=r,W(`salary_negotiation`,{chatTurns:r}),r):t})}).catch(()=>{}),Ge(``),R(``),z(``),B(``),K(``),Ue([]),h()}catch(t){if(e!==Y.current)return;let n=k(t);W(`salary_negotiation`,{runState:`failed`,err:n}),g(n,s)}finally{n(!1)}},st=()=>{v(null),C([]),b(``),I([]),M([]),R(``),D([]),z(``),B(``),K(``),ke(``),Je([]),W(`salary_negotiation`,{runState:`idle`,chatTurns:[],uploadedDocs:[],result:null,streamText:``,streamThinking:``,streamStage:``,streamActor:``,offerCards:[]})},ct=(0,X.useMemo)(()=>Array.isArray(_?.gapTable)&&_.gapTable.length?_.gapTable:[],[_]),lt=(0,X.useMemo)(()=>_?ce(`salary_negotiation`,_):null,[_]),ut=(0,X.useMemo)(()=>Array.isArray(_?.compensationBreakdown)&&_.compensationBreakdown.length?_.compensationBreakdown.slice(0,6):ct.length?ct.slice(0,6).map((e,t)=>({label:o(e?.item)||`项目${t+1}`,current:o(e?.offered)||`-`,target:o(e?.expected)||`-`,priority:t<2?`high`:t<4?`medium`:`low`})):[],[_,ct]),dt=(0,X.useMemo)(()=>Array.isArray(_?.leveragePoints)&&_.leveragePoints.length?_.leveragePoints.slice(0,8).map(e=>o(e)).filter(Boolean):[...Array.isArray(_?.tips)?_.tips.slice(0,4):[],o(_?.strategy),o(_?.bottomLine)].map(e=>o(e)).filter(Boolean).slice(0,6),[_]),ft=[`我刚收到 Offer，但信息还不完整。请先问我岗位、公司、地点、薪资结构、试用期和对方原话；缺什么先追问，不要先下结论。`,`我准备还价。请先问我当前 offer 条件、我的目标、底线、可让步项和我最看重的优先级。`,`我收到了招聘方回复。请先让我粘贴对方原话，并问清楚我之前怎么表达、现在目标和可接受边界。`,`我需要做最终决策。请先问我优先级、风险点、机会成本和不可接受条件；缺岗位、薪资、地点或 offer 细节时先追问。`],pt=t&&!!o(oe);return(0,X.useEffect)(()=>{_&&ze(!0)},[_]),{busy:t,setBusy:n,err:i,setErr:s,runState:u,progress:d,failByMessage:g,result:_,setResult:v,dialogInput:y,setDialogInput:b,chatTurns:S,setChatTurns:C,supportFiles:ee,setSupportFiles:D,pendingAttachments:j,setPendingAttachments:M,uploadedDocs:P,setUploadedDocs:I,streamText:L,setStreamText:R,streamThinking:oe,setStreamThinking:z,streamStage:se,setStreamStage:B,streamActor:me,setStreamActor:K,streamTextRawRef:q,streamTextFlushTimerRef:ye,streamThinkingRawRef:be,streamThinkingFlushTimerRef:xe,abortRef:J,runSeqRef:Y,chatScrollRef:Ce,parseStage:we,setParseStage:ke,detailExpanded:Pe,setDetailExpanded:ze,appendChatTurn:Ye,sanitizeThinking:Xe,looksLikeJsonPayload:Ze,buildPlainStreamPreview:$,collectMoneySnippets:Qe,buildAssistantReplyText:$e,buildDocPreview:et,renderRichText:tt,applyNextQuestion:nt,jumpToDetailView:rt,ingestFilesToChat:it,handleRun:at,runAgent:ot,agentMode:Be,setAgentMode:Ve,agentSteps:He,agentText:We,resetAll:st,comparisonRows:ct,unifiedSummary:lt,compensationBreakdown:ut,leveragePoints:dt,starterPrompts:ft,showThinkingPanel:pt,negotiationStage:Ke,setNegotiationStage:qe,stageOptions:e,offerCards:Q,setOfferCards:Je}}var Be=[{key:`core`,title:`核心求职链路`,description:`从测分、改写、求职信到面试与谈薪，解决“投出去、拿面试、拿 offer”的主流程。`},{key:`helper`,title:`辅助决策与补位`,description:`处理 JD 排雷、外企表达、裁员维权与副业接单等边缘但高频的实际问题。`},{key:`fun`,title:`娱乐解压与引流游戏`,description:`这些不是严肃工具，而是更轻、更好玩、适合截图转发的情绪释放小游戏。`,note:`仅供娱乐，不作为任何职业、法律、医学或人生决策依据。`}],Ve=[{id:`ats-scanner`,title:`ATS 简历测分器`,description:`模拟大厂 ATS 筛选，给你的简历和 JD 打分并指出缺失关键词。`,icon:(0,Z.jsx)(J,{className:`w-8 h-8 text-blue-500`}),path:`/t/ats-scanner`,tag:`引流神器`,group:`core`,tone:`serious`,audience:`准备投递的人`,inputHint:`简历 + JD`,badge:`推荐先用`,featured:!0},{id:`magic-resume`,title:`八股文翻译机`,description:`输入大白话，一键转化为更像大厂写法的专业经历表述。`,icon:(0,Z.jsx)(v,{className:`w-8 h-8 text-indigo-500`}),path:`/t/magic-resume`,group:`core`,tone:`serious`,audience:`简历不会写的人`,inputHint:`一段经历`,featured:!0},{id:`cover-letter`,title:`定制求职信生成`,description:`针对不同 JD 快速定制相关的 Cover Letter，提高投递回复率。`,icon:(0,Z.jsx)(we,{className:`w-8 h-8 text-sky-500`}),path:`/t/cover-letter`,group:`core`,tone:`serious`,audience:`投递外企/海外岗位`,inputHint:`简历 + JD`,featured:!0},{id:`interview-mock`,title:`AI 刁钻面试官`,description:`根据简历和 JD，生成深度追问，并进行模拟对练。`,icon:(0,Z.jsx)(g,{className:`w-8 h-8 text-purple-500`}),path:`/t/interview-mock`,group:`core`,tone:`serious`,audience:`准备面试的人`,inputHint:`简历 + JD`,featured:!0},{id:`salary-copilot`,title:`薪资谈判助手`,description:`拿到 Offer 后不敢要高薪？帮你自动生成合规、专业的议价邮件。`,icon:(0,Z.jsx)(h,{className:`w-8 h-8 text-green-500`}),path:`/t/salary-copilot`,group:`core`,tone:`serious`,audience:`拿到 offer 的人`,inputHint:`offer 信息`,featured:!0},{id:`blind-resume`,title:`Blind Resume 洗白器`,description:`一键去除年龄、性别、联系方式等敏感信息，生成合规盲历。`,icon:(0,Z.jsx)(b,{className:`w-8 h-8 text-emerald-500`}),path:`/t/blind-resume`,tag:`合规出海`,group:`core`,tone:`compliance`,audience:`准备出海求职的人`,inputHint:`原始简历`},{id:`jd-red-flag`,title:`JD 隐形排雷器`,description:`识别 JD 里的画饼、黑话和潜在坑点，帮你先看值不值得投。`,icon:(0,Z.jsx)(f,{className:`w-8 h-8 text-red-500`}),path:`/t/jd-red-flag`,group:`helper`,tone:`serious`,audience:`筛岗位的人`,inputHint:`职位 JD`},{id:`resume-translate`,title:`外企求职遮羞布`,description:`把“三下乡、团支书”等中文语境经历转换成外企更易理解的表达。`,icon:(0,Z.jsx)(Ce,{className:`w-8 h-8 text-teal-500`}),path:`/t/resume-translate`,group:`helper`,tone:`serious`,audience:`投外企/海外岗位`,inputHint:`中文经历`},{id:`referral-hook`,title:`内推撩人神器`,description:`不知道怎么找陌生人或校友开口？一键生成高回复率的破冰话术。`,icon:(0,Z.jsx)(y,{className:`w-8 h-8 text-pink-500`}),path:`/t/referral-hook`,group:`helper`,tone:`serious`,audience:`需要内推的人`,inputHint:`目标对象 + 场景`},{id:`severance-calculator`,title:`离职补偿口径计算器`,description:`不确定该按 N / N+1 / 2N 哪一档沟通？先估算口径，再生成发给 HR 的沟通文本。`,icon:(0,Z.jsx)(xe,{className:`w-8 h-8 text-rose-500`}),path:`/t/severance-calculator`,group:`helper`,tone:`serious`,audience:`裁员/离职场景`,inputHint:`工龄 + 工资 + 情况`},{id:`freelance-proposal`,title:`副业接单话术库`,description:`不知道怎么写 Upwork/兼职 Proposal？一键生成专业竞标方案。`,icon:(0,Z.jsx)(m,{className:`w-8 h-8 text-amber-500`}),path:`/t/freelance-proposal`,group:`helper`,tone:`serious`,audience:`接单/副业用户`,inputHint:`客户需求`},{id:`cyber-divination`,title:`赛博八卦算命`,description:`简历与 JD 八字合不合？AI 大师为你测算职场运势与气场。`,icon:(0,Z.jsx)(x,{className:`w-8 h-8 text-purple-400`}),path:`/t/cyber-divination`,tag:`玄学求职`,group:`fun`,tone:`fun`,audience:`求职焦虑但想先笑一笑`,inputHint:`简历 + JD`},{id:`niuma-calculator`,title:`牛马折寿计算器`,description:`算算上这个班每天少活多少年？顺便暴击你的真实时薪。`,icon:(0,Z.jsx)(Se,{className:`w-8 h-8 text-red-500`}),path:`/t/niuma-calculator`,tag:`扎心娱乐`,group:`fun`,tone:`fun`,audience:`所有打工人`,inputHint:`薪资 + 工时 + 通勤`},{id:`slacking-salary`,title:`摸鱼薪水计算器`,description:`每天摸鱼、带薪上厕所，到底从老板口袋里掏走了多少钱？`,icon:(0,Z.jsx)(Y,{className:`w-8 h-8 text-amber-600`}),path:`/t/slacking-salary`,tag:`打工必备`,group:`fun`,tone:`fun`,audience:`办公室生存玩家`,inputHint:`薪资 + 摸鱼时间`}];function He(e){return Ve.filter(t=>t.group===e)}function Ue(){let e=i(),[t,n]=(0,X.useState)(!1),r=(0,X.useRef)(null);return(0,X.useEffect)(()=>{function e(e){r.current&&!r.current.contains(e.target)&&n(!1)}return t&&document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[t]),(0,Z.jsxs)(`div`,{className:`relative z-50`,ref:r,children:[(0,Z.jsx)(`button`,{onClick:()=>n(e=>!e),className:`rounded-full px-3 py-2 text-[12px] font-semibold transition-colors focus:outline-none focus:ring-2`,style:{color:`var(--text-2)`},title:`HireEdge Tools`,children:`工具`}),t?(0,Z.jsxs)(`div`,{className:`absolute right-0 mt-2 w-[348px] max-h-[75vh] overflow-y-auto rounded-[24px] border animate-in fade-in slide-in-from-top-2 duration-200`,style:{background:`var(--surface)`,borderColor:`var(--border)`,boxShadow:`0 18px 40px rgba(26,23,20,0.12)`},children:[(0,Z.jsxs)(`div`,{className:`border-b px-4 pt-4 pb-3`,style:{borderColor:`var(--border)`},children:[(0,Z.jsx)(`div`,{className:`text-[13px] font-semibold`,style:{color:`var(--text-1)`},children:`切换工具`}),(0,Z.jsx)(`div`,{className:`mt-1 text-[11px]`,style:{color:`var(--text-2)`},children:`核心工具、辅助工具、娱乐工具都在这里`})]}),(0,Z.jsx)(`div`,{className:`space-y-4 p-3`,children:Be.map(t=>{let r=He(t.key);return(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`div`,{className:`mb-2 px-2 text-[10px] font-bold tracking-[0.12em] uppercase`,style:{color:`var(--text-3)`},children:t.title}),(0,Z.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:r.map(t=>(0,Z.jsx)(`button`,{onClick:()=>{n(!1),e(t.path)},className:`group flex flex-col items-center justify-start rounded-2xl p-2.5 text-center transition-colors`,style:{background:`transparent`},children:(0,Z.jsx)(`span`,{className:`line-clamp-2 text-[11px] font-medium leading-tight`,style:{color:`var(--text-2)`},children:t.title})},t.id))})]},t.key)})}),(0,Z.jsx)(`div`,{className:`border-t p-3 text-center`,style:{background:`var(--surface2)`,borderColor:`var(--border)`},children:(0,Z.jsx)(`button`,{onClick:()=>{n(!1),e(`/t`)},className:`text-[12px] font-semibold hover:underline`,style:{color:`var(--accent)`},children:`打开完整工具矩阵`})})]}):null]})}var We={serious:{frameStyle:{background:`var(--bg)`,color:`var(--text-1)`},heroStyle:{background:`var(--surface)`,borderColor:`var(--border)`},noticeStyle:{background:`var(--accent-lt)`,color:`var(--accent)`,borderColor:`rgba(200,90,34,0.2)`},badgeStyle:{background:`var(--accent-lt)`,color:`var(--accent)`,borderColor:`rgba(200,90,34,0.2)`},metaStyle:{background:`var(--surface2)`,color:`var(--text-2)`,borderColor:`var(--border)`},headerSubtle:`var(--text-2)`,label:`求职主链路工具`},compliance:{frameStyle:{background:`var(--bg)`,color:`var(--text-1)`},heroStyle:{background:`linear-gradient(135deg, var(--surface) 0%, var(--surface2) 70%, var(--accent-lt) 100%)`,borderColor:`var(--border)`},noticeStyle:{background:`var(--success-lt)`,color:`var(--success)`,borderColor:`rgba(45,122,90,0.22)`},badgeStyle:{background:`var(--success-lt)`,color:`var(--success)`,borderColor:`rgba(45,122,90,0.22)`},metaStyle:{background:`var(--surface2)`,color:`var(--text-2)`,borderColor:`var(--border)`},headerSubtle:`var(--text-2)`,label:`合规辅助工具`},fun:{frameStyle:{background:`var(--bg)`,color:`var(--text-1)`},heroStyle:{background:`linear-gradient(135deg, var(--surface) 0%, var(--surface2) 58%, var(--accent-lt) 100%)`,borderColor:`var(--border)`},noticeStyle:{background:`var(--amber-lt)`,color:`var(--amber)`,borderColor:`rgba(184,122,32,0.22)`},badgeStyle:{background:`var(--accent-lt)`,color:`var(--accent)`,borderColor:`rgba(200,90,34,0.2)`},metaStyle:{background:`var(--surface2)`,color:`var(--text-2)`,borderColor:`var(--border)`},headerSubtle:`var(--text-2)`,label:`娱乐解压工具`}};function Ge({title:e,description:t,tone:n=`serious`,badge:r,notice:a,meta:o=[],backPath:s=`/t`,embedded:c=!1,children:l}){let u=i(),d=We[n],f=(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-5`,style:d.frameStyle,children:[!c&&(0,Z.jsxs)(`section`,{className:`he-card`,style:{padding:16,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12},children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>u(s),className:`flex min-h-9 items-center justify-center rounded-xl border px-3 text-[12px] font-semibold transition-colors`,style:{color:`var(--text-2)`,borderColor:`var(--border)`,background:`var(--surface)`},children:`返回`}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`div`,{className:`truncate text-[15px] font-semibold md:text-base`,style:{color:`var(--text-1)`},children:e}),(0,Z.jsx)(`div`,{className:`text-[11px]`,style:{color:d.headerSubtle},children:d.label})]})]}),(0,Z.jsx)(Ue,{})]}),!c&&(0,Z.jsxs)(`section`,{className:`rounded-3xl border p-5 shadow-sm md:p-6`,style:{...d.heroStyle,boxShadow:`0 10px 24px rgba(26,23,20,0.04)`},children:[(0,Z.jsx)(`div`,{className:`flex flex-col gap-5 md:flex-row md:items-start md:justify-between`,children:(0,Z.jsxs)(`div`,{className:`max-w-3xl`,children:[(0,Z.jsxs)(`div`,{className:`mb-3 flex flex-wrap gap-2`,children:[(0,Z.jsx)(`span`,{className:`inline-flex items-center rounded-full border px-3 py-1 text-[11px] font-semibold`,style:d.badgeStyle,children:r||d.label}),o.map(e=>(0,Z.jsx)(`span`,{className:`inline-flex items-center rounded-full border px-3 py-1 text-[11px] font-medium`,style:d.metaStyle,children:e},e))]}),(0,Z.jsx)(`h1`,{className:`text-[28px] font-black tracking-tight md:text-[34px]`,style:{color:`var(--text-1)`},children:e}),(0,Z.jsx)(`p`,{className:`mt-3 max-w-2xl text-sm leading-7 md:text-[15px]`,style:{color:`var(--text-2)`},children:t})]})}),a?(0,Z.jsx)(`div`,{className:`mt-4 rounded-2xl border px-4 py-3 text-[13px] leading-6`,style:d.noticeStyle,children:a}):null]}),l]});return c?f:(0,Z.jsx)(j,{title:e,subTitle:t,hideModelSelector:!0,hideThinkingToggle:!0,children:f})}var Ke=e=>e.replace(/(?:市|地区|盟|林区|自治州|自治县)$/,``).trim(),qe={height:38,padding:`0 12px`,borderRadius:8,border:`1px solid var(--border)`,background:`var(--surface2)`,fontSize:13,lineHeight:`38px`,outline:`none`,boxSizing:`border-box`};function Q({percentile:e,p25:t,p50:n,p75:r,p90:i,salary:a}){let o=[{pos:25,label:`P25`,value:t},{pos:50,label:`P50`,value:n},{pos:75,label:`P75`,value:r},{pos:90,label:`P90`,value:i}];return(0,Z.jsxs)(`div`,{style:{padding:`24px 0`},children:[(0,Z.jsxs)(`div`,{style:{position:`relative`,height:48,marginBottom:32},children:[(0,Z.jsx)(`div`,{style:{position:`absolute`,top:20,left:0,right:0,height:8,borderRadius:4,background:`var(--surface2)`,border:`1px solid var(--border)`}}),(0,Z.jsx)(`div`,{style:{position:`absolute`,top:20,left:0,width:`${Math.min(e,100)}%`,height:8,borderRadius:4,background:e>=75?`var(--success)`:e>=50?`var(--accent)`:`var(--text-3)`,transition:`width 0.6s ease`}}),o.map(e=>(0,Z.jsxs)(`div`,{style:{position:`absolute`,left:`${e.pos}%`,top:0,transform:`translateX(-50%)`},children:[(0,Z.jsx)(`div`,{style:{width:2,height:36,background:`var(--border2)`,margin:`0 auto`}}),(0,Z.jsxs)(`div`,{style:{textAlign:`center`,marginTop:4},children:[(0,Z.jsx)(`div`,{style:{fontSize:10,color:`var(--text-3)`,fontWeight:600},children:e.label}),(0,Z.jsx)(`div`,{style:{fontSize:11,color:`var(--text-2)`},children:e.value.toLocaleString()})]})]},e.label)),(0,Z.jsx)(`div`,{style:{position:`absolute`,left:`${Math.min(e,100)}%`,top:12,transform:`translateX(-50%)`,zIndex:2},children:(0,Z.jsx)(`div`,{style:{width:20,height:20,borderRadius:`50%`,background:`var(--accent)`,border:`3px solid var(--surface)`,boxShadow:`0 2px 8px rgba(0,0,0,0.15)`}})})]}),(0,Z.jsx)(`div`,{style:{textAlign:`center`,marginTop:8},children:(0,Z.jsxs)(`span`,{style:{fontSize:13,color:`var(--text-2)`},children:[`你的薪资 `,(0,Z.jsxs)(`strong`,{style:{color:`var(--text-1)`},children:[a.toLocaleString(),` 元/月`]}),` 位于第`,` `,(0,Z.jsx)(`strong`,{style:{color:`var(--accent)`,fontSize:18},children:e}),` 百分位`]})})]})}function Je({embedded:e=!1,panelMode:t=!1,onSendToNegotiation:n}={}){let r=be(),i=t?null:r,[a,o]=(0,X.useState)({}),[s,c]=(0,X.useState)(``),[l,u]=(0,X.useState)(``),[f,m]=(0,X.useState)(``),[h,v]=(0,X.useState)([]),[y,b]=(0,X.useState)(!1),S=e&&i?i.state.salaryFamily:s,C=e&&i?i.state.salarySubFamily:l,w=e&&i?i.state.salaryL3:f,ee=(0,X.useCallback)(t=>{e&&i?i.setSalaryFamily(t):c(t)},[e,i]),T=(0,X.useCallback)(t=>{e&&i?i.setSalarySubFamily(t):u(t)},[e,i]),E=(0,X.useCallback)(t=>{e&&i?i.setSalaryL3(t):m(t)},[e,i]),[te,ne]=(0,X.useState)({city:null,districts:[]}),O=e&&i?i.state.region:te,re=(0,X.useCallback)(t=>{e&&i?i.setRegion(t):ne(t)},[e,i]),k=(0,X.useMemo)(()=>O.city?O.city.isMunicipality?Ke(O.city.displayName||O.city.province):Ke(O.city.city||O.city.displayName||``):``,[O.city]),[A,ae]=(0,X.useState)(``),j=e&&i?i.state.salaryAmount:A,M=(0,X.useCallback)(t=>{e&&i?i.setSalaryAmount(t):ae(t)},[e,i]),[N,P]=(0,X.useState)(!1),[F,I]=(0,X.useState)(``),[L,V]=(0,X.useState)(null),[H,ce]=(0,X.useState)([]),[U,le]=(0,X.useState)(null),[W,ue]=(0,X.useState)(!1),de=(0,X.useRef)(null);(0,X.useEffect)(()=>{!e||!i||i.state.view===`salary`&&i.setLoading(N)},[e,i,N]),(0,X.useEffect)(()=>(B().then(o).catch(()=>{}),()=>{try{de.current?.abort()}catch{}}),[]);let fe=i?.state.region.city;(0,X.useEffect)(()=>{e||fe&&fe.adminCode!==O.city?.adminCode&&(re({city:fe,districts:[]}),V(null))},[fe?.adminCode,e]);let pe=(0,X.useMemo)(()=>Object.keys(a).sort(),[a]),G=(0,X.useMemo)(()=>S&&a[S]||[],[a,S]),me=(0,X.useCallback)(e=>{ee(e),T(``),E(``),v([]),V(null)},[]);(0,X.useEffect)(()=>{if(!S){v([]),E(``);return}let e=!0;return b(!0),oe(S,C||void 0,k||void 0).then(t=>{e&&(v(t),w&&!t.find(e=>e.l3===w)&&E(``))}).catch(()=>{e&&v([])}).finally(()=>{e&&b(!1)}),()=>{e=!1}},[S,C,k]);let he=(0,X.useCallback)(async()=>{let t=parseInt(j);if(!S){I(`请选择岗位大类`);return}if(!w){I(`请选择具体岗位`);return}if(!t||t<=0){I(`请输入有效的月薪`);return}I(``),P(!0),V(null),ce([]),le(null);try{de.current?.abort()}catch{}try{let e=await z(S,t,C||void 0,k||void 0,w||void 0);if(!e){I(`该岗位暂无足够数据，请尝试其他筛选条件`);return}V(e),se(S,C||void 0,k||void 0,10).then(e=>ce(e||[])).catch(()=>{})}catch(e){I(e.message||`查询失败`)}finally{P(!1),e&&i&&i.markViewFired(`salary`)}},[S,C,w,k,j,e,i]),K=(0,X.useCallback)(()=>{if(!L||L.p75<=0)return;let e=parseInt(j);try{de.current?.abort()}catch{}let t=new AbortController;de.current=t,le(null),ue(!0),R({family:S,subFamily:C||null,city:k||null,salary:Number.isFinite(e)?e:null,percentile:L.percentile,stats:{p25:L.p25,p50:L.p50,p75:L.p75,p90:L.p90,total_jobs:L.total_jobs},skills:(H||[]).slice(0,8).map(e=>e.skill)},t.signal).then(e=>{e&&le(e)}).catch(()=>{}).finally(()=>{ue(!1)})},[L,S,C,k,j,H]),ge=i?.state.fireNonce??0,_e=i?.state.view===`salary`;(0,X.useEffect)(()=>{if(!e||!i||!_e||N||!S||!w)return;let t=parseInt(j);!t||t<=0||he()},[ge,e]);let ve=(0,X.useCallback)(()=>{if(!L)return;let e=[],t=w||(C?`${S}/${C}`:S),r=k||`全国`;e.push(`【薪资搜索锚点】岗位：${t}（${r}）`),e.push(`市场分布：P25 ${L.p25.toLocaleString()} / P50 ${L.p50.toLocaleString()} / P75 ${L.p75.toLocaleString()} / P90 ${L.p90.toLocaleString()} 元/月（样本 ${L.total_jobs.toLocaleString()} 条）`),e.push(`我当前月薪：${L.salary.toLocaleString()} 元（位于 P${L.percentile}）`),U&&(U.p75_anchor&&e.push(`谈判 P75 锚点：${U.p75_anchor.toLocaleString()} 元/月（${U.p75_basis}）`),U.key_premium_skills?.length&&e.push(`高溢价技能：${U.key_premium_skills.join(`、`)}`),U.recent_signal&&e.push(`近期行情信号：${U.recent_signal}`)),e.push(``),e.push(`请基于以上锚点，帮我梳理这次的谈判筹码与可发送话术。`);let i=e.join(`
`);if(n){n(i);return}let a=`salary-position-${Date.now()}`;D({sid:a,source:`salary_position`,tool:`salary_negotiation`,createdAt:Date.now(),currentRole:t,targetRole:t,summary:`薪资搜索 P${L.percentile} → P75 锚点 ${U?.p75_anchor?U.p75_anchor.toLocaleString():L.p75.toLocaleString()}`,prefillHint:i});let o=ie(`/tools/salary-negotiation`,`tool`,{source:`salary_position`,sid:a});try{window.location.assign(o)}catch{window.location.href=o}},[L,U,S,C,w,k,n]),q=(0,X.useMemo)(()=>L?L.percentile>=90?`远超市场水平`:L.percentile>=75?`高于大多数人`:L.percentile>=50?`中等偏上`:L.percentile>=25?`中等偏下`:`低于市场水平`:``,[L]);return(0,Z.jsx)(Ge,{title:`薪资搜索`,description:`输入岗位和当前薪资，基于 581 万条历史招聘数据，告诉你在市场中的位置。`,icon:(0,Z.jsx)(p,{className:`w-5 h-5`}),iconClassName:`bg-[var(--accent-lt)] text-[var(--accent)] border-[rgba(200,90,34,0.2)]`,badge:`市场数据`,meta:[`581 万条招聘记录`,`历史基准参考`],notice:`数据来源为历史招聘记录统计，实际薪资受公司规模、个人经验、行业景气度等因素影响。`,embedded:e||t,children:(0,Z.jsxs)(`div`,{className:e||t?`flex flex-col gap-4`:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[t&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`},children:[(0,Z.jsx)(`div`,{style:{flex:`1 1 150px`,minWidth:130,display:`flex`},children:(0,Z.jsx)(ye,{value:O,onChange:e=>{re(e),V(null)},placeholderCity:`城市（可选）`,showDistrict:!1,size:`md`,style:{width:`100%`}})}),(0,Z.jsxs)(`select`,{value:S,onChange:e=>me(e.target.value),style:{...qe,flex:`1 1 130px`,minWidth:110,color:S?`var(--text-1)`:`var(--text-3)`},children:[(0,Z.jsx)(`option`,{value:``,children:`岗位大类`}),pe.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),(0,Z.jsxs)(`select`,{value:C,onChange:e=>{T(e.target.value),E(``),V(null)},disabled:G.length===0,style:{...qe,flex:`1 1 130px`,minWidth:110,color:C?`var(--text-1)`:`var(--text-3)`,opacity:G.length===0?.6:1},children:[(0,Z.jsx)(`option`,{value:``,children:G.length===0?`子类（先选大类）`:`子类（可选）`}),G.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),(0,Z.jsxs)(`select`,{value:w,onChange:e=>{E(e.target.value),V(null)},disabled:!S||y||h.length===0,style:{...qe,flex:`1 1 130px`,minWidth:110,color:w?`var(--text-1)`:`var(--text-3)`,opacity:!S||h.length===0?.6:1},children:[(0,Z.jsx)(`option`,{value:``,children:S?y?`加载中…`:h.length===0?`暂无样本`:`具体岗位`:`具体岗位（先选大类）`}),h.map(e=>(0,Z.jsx)(`option`,{value:e.l3,children:e.l3},e.l3))]}),(0,Z.jsx)(`input`,{value:j,onChange:e=>M(e.target.value.replace(/\D/g,``)),onKeyDown:e=>{e.key===`Enter`&&!N&&he()},placeholder:`月薪（元）`,inputMode:`numeric`,className:`placeholder:text-[var(--text-3)]`,style:{...qe,flex:`1 1 96px`,minWidth:88,color:`var(--text-1)`}}),(0,Z.jsx)(`button`,{onClick:he,disabled:N,style:{...qe,flex:`0 0 auto`,padding:`0 18px`,fontWeight:600,cursor:N?`progress`:`pointer`,opacity:N?.6:1,background:`var(--btn-primary-bg)`,color:`var(--btn-primary-text)`,borderColor:`var(--btn-primary-border)`,whiteSpace:`nowrap`},children:N?`查询中…`:`查薪资`})]}),F&&(0,Z.jsx)(`div`,{className:`rounded-xl border px-3 py-2.5 text-[13px]`,style:{background:`var(--red-lt)`,color:`var(--red)`,borderColor:`rgba(184,50,50,0.18)`},children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(d,{className:`h-4 w-4 flex-shrink-0`}),F]})})]}),!e&&!t&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,Z.jsxs)(`div`,{className:`rounded-2xl border p-5`,style:{background:`var(--surface)`,borderColor:`var(--border)`},children:[(0,Z.jsx)(`div`,{className:`text-[13px] font-semibold mb-4`,style:{color:`var(--text-2)`},children:`查询条件`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`select`,{value:S,onChange:e=>me(e.target.value),className:`rounded-xl border px-3 py-3 outline-none`,style:{background:`var(--surface2)`,borderColor:`var(--border)`,color:S?`var(--text-1)`:`var(--text-3)`},children:[(0,Z.jsx)(`option`,{value:``,children:`选择岗位大类`}),pe.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),G.length>0&&(0,Z.jsxs)(`select`,{value:C,onChange:e=>{T(e.target.value),E(``),V(null)},className:`rounded-xl border px-3 py-3 outline-none`,style:{background:`var(--surface2)`,borderColor:`var(--border)`,color:C?`var(--text-1)`:`var(--text-3)`},children:[(0,Z.jsx)(`option`,{value:``,children:`全部子类（可选）`}),G.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),S&&(0,Z.jsxs)(`select`,{value:w,onChange:e=>{E(e.target.value),V(null)},disabled:y||h.length===0,className:`rounded-xl border px-3 py-3 outline-none disabled:opacity-60`,style:{background:`var(--surface2)`,borderColor:`var(--border)`,color:w?`var(--text-1)`:`var(--text-3)`},children:[(0,Z.jsx)(`option`,{value:``,children:y?`加载具体岗位…`:h.length===0?`当前条件下无 L3 岗位样本`:`选择具体岗位（必填）`}),h.map(e=>(0,Z.jsx)(`option`,{value:e.l3,children:e.l3},e.l3))]}),!e&&(0,Z.jsx)(ye,{value:O,onChange:e=>{re(e),V(null)},placeholderCity:`城市（可选，如：上海）`,showDistrict:!1,size:`md`}),(0,Z.jsx)(`input`,{value:j,onChange:e=>M(e.target.value.replace(/\D/g,``)),placeholder:`你的月薪（元）`,className:`rounded-xl border px-3 py-3 outline-none placeholder:text-[var(--text-3)]`,style:{background:`var(--surface2)`,borderColor:`var(--border)`,color:`var(--text-1)`}}),(0,Z.jsx)(`button`,{onClick:he,disabled:N,className:`w-full rounded-xl px-4 py-4 text-base font-bold transition-all disabled:opacity-50`,style:{background:`var(--btn-primary-bg)`,color:`var(--btn-primary-text)`,border:`1px solid var(--btn-primary-border)`},children:N?`查询中...`:`查看我的薪资分位`}),F&&(0,Z.jsx)(`div`,{className:`rounded-xl border px-3 py-2.5 text-[13px]`,style:{background:`var(--red-lt)`,color:`var(--red)`,borderColor:`rgba(184,50,50,0.18)`},children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(d,{className:`h-4 w-4 flex-shrink-0`}),F]})})]})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e&&F&&!L?(0,Z.jsx)(`div`,{className:`rounded-xl border px-3 py-2.5 text-[13px]`,style:{background:`var(--red-lt)`,color:`var(--red)`,borderColor:`rgba(184,50,50,0.18)`},children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(d,{className:`h-4 w-4 flex-shrink-0`}),F]})}):null,L?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`rounded-2xl border p-5 shadow-sm`,style:{background:`var(--surface)`,borderColor:`var(--border)`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,Z.jsx)(`div`,{className:`text-[13px] font-semibold`,style:{color:`var(--text-2)`},children:`薪资搜索结果`}),(0,Z.jsx)(`span`,{className:`inline-flex items-center rounded-full border px-3 py-1 text-[11px] font-semibold`,style:{background:`var(--accent-lt)`,color:`var(--accent)`,borderColor:`rgba(200,90,34,0.2)`},children:q})]}),(w||C||k)&&(0,Z.jsxs)(`div`,{className:`mb-3 text-[12px]`,style:{color:`var(--text-3)`},children:[w?(0,Z.jsx)(`span`,{style:{color:`var(--text-1)`,fontWeight:600},children:w}):null,w&&(C||S)?(0,Z.jsx)(`span`,{children:` · `}):null,!w&&(C||S)?(0,Z.jsx)(`span`,{style:{color:`var(--text-1)`,fontWeight:600},children:C||S}):null,(w||C)&&S?(0,Z.jsxs)(`span`,{children:[`（`,S,C&&w?` / ${C}`:``,`）`]}):null,k?(0,Z.jsxs)(`span`,{children:[` · `,k]}):null]}),(0,Z.jsx)(Q,{percentile:L.percentile,p25:L.p25,p50:L.p50,p75:L.p75,p90:L.p90,salary:L.salary}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 mt-4`,children:[(0,Z.jsxs)(`div`,{className:`rounded-xl border px-4 py-3`,style:{background:`var(--surface2)`,borderColor:`var(--border)`},children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide`,style:{color:`var(--text-3)`},children:`样本量`}),(0,Z.jsxs)(`div`,{className:`mt-1 text-sm font-medium`,style:{color:`var(--text-1)`},children:[L.total_jobs.toLocaleString(),` 条`]})]}),(0,Z.jsxs)(`div`,{className:`rounded-xl border px-4 py-3`,style:{background:`var(--surface2)`,borderColor:`var(--border)`},children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide`,style:{color:`var(--text-3)`},children:`中位数`}),(0,Z.jsxs)(`div`,{className:`mt-1 text-sm font-medium`,style:{color:`var(--text-1)`},children:[L.p50.toLocaleString(),` 元/月`]})]}),(0,Z.jsxs)(`div`,{className:`rounded-xl border px-4 py-3`,style:{background:`var(--surface2)`,borderColor:`var(--border)`},children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide`,style:{color:`var(--text-3)`},children:`你的百分位`}),(0,Z.jsxs)(`div`,{className:`mt-1 text-lg font-bold`,style:{color:`var(--accent)`},children:[`P`,L.percentile]})]}),(0,Z.jsxs)(`div`,{className:`rounded-xl border px-4 py-3`,style:{background:`var(--surface2)`,borderColor:`var(--border)`},children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide`,style:{color:`var(--text-3)`},children:`达到 P75 需要`}),(0,Z.jsx)(`div`,{className:`mt-1 text-sm font-medium`,style:{color:L.salary>=L.p75?`var(--success)`:`var(--text-1)`},children:L.salary>=L.p75?`已达到`:`${L.p75.toLocaleString()} 元/月`})]})]}),n?(0,Z.jsxs)(`button`,{type:`button`,onClick:ve,className:`mt-4 w-full inline-flex items-center justify-center gap-2 rounded-xl px-4 py-3 text-[14px] font-semibold transition-all`,style:{background:`var(--btn-primary-bg)`,color:`var(--btn-primary-text)`,border:`1px solid var(--btn-primary-border)`},children:[(0,Z.jsx)(g,{className:`h-4 w-4`}),`把市场分布带入谈判对话`]}):null]}),H.length>0&&(0,Z.jsxs)(`div`,{className:`rounded-2xl border p-5`,style:{background:`var(--surface)`,borderColor:`var(--border)`},children:[(0,Z.jsx)(`div`,{className:`text-[13px] font-semibold mb-3`,style:{color:`var(--text-2)`},children:`该岗位市场高频技能`}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:H.map(e=>(0,Z.jsxs)(`span`,{className:`inline-flex items-center rounded-full border px-3 py-1 text-[12px]`,style:{background:`var(--surface2)`,borderColor:`var(--border)`,color:`var(--text-1)`},children:[e.skill,(0,Z.jsx)(`span`,{className:`ml-1.5 text-[10px]`,style:{color:`var(--text-3)`},children:e.frequency.toLocaleString()})]},e.skill))}),(0,Z.jsx)(`div`,{className:`mt-3 text-[12px]`,style:{color:`var(--text-3)`},children:`掌握以上高频技能有助于提升薪资竞争力`})]}),!W&&!U&&L.p75>0&&(0,Z.jsxs)(`button`,{type:`button`,onClick:K,className:`w-full inline-flex items-center justify-center gap-2 rounded-2xl border px-4 py-3.5 text-[14px] font-semibold transition-all`,style:{background:`var(--surface)`,borderColor:`var(--border)`,color:`var(--text-1)`},children:[(0,Z.jsx)(x,{className:`h-4 w-4`,style:{color:`var(--accent)`}}),`获取 AI 谈判锚点（联网行情，约 5-10 秒 · 免费）`]}),(W||U)&&(0,Z.jsxs)(`div`,{className:`rounded-2xl border p-5`,style:{background:`var(--surface)`,borderColor:`var(--border)`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between mb-3 gap-2 flex-wrap`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(x,{className:`h-4 w-4`,style:{color:`var(--accent)`}}),(0,Z.jsx)(`div`,{className:`text-[13px] font-semibold`,style:{color:`var(--text-2)`},children:`谈判锚点（联网行情 + AI 综合）`})]}),(0,Z.jsx)(`span`,{className:`inline-flex items-center rounded-full border px-2.5 py-0.5 text-[10px] font-medium`,style:{background:`var(--surface2)`,borderColor:`var(--border)`,color:`var(--text-3)`},children:`免费 · 不扣积分`})]}),W&&!U?(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px]`,style:{color:`var(--text-3)`},children:[(0,Z.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full animate-pulse`,style:{background:`var(--accent)`}}),`正在聚合联网行情与 AI 锚点（约 5-10 秒）...`]}):U?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[U.p75_anchor!=null&&(0,Z.jsxs)(`div`,{className:`rounded-xl border px-4 py-3`,style:{background:`var(--accent-lt)`,borderColor:`rgba(200,90,34,0.2)`},children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide`,style:{color:`var(--accent)`},children:`建议谈判锚点（P75）`}),(0,Z.jsxs)(`div`,{className:`mt-1 text-2xl font-bold`,style:{color:`var(--text-1)`},children:[U.p75_anchor.toLocaleString(),` `,(0,Z.jsx)(`span`,{className:`text-sm font-medium`,style:{color:`var(--text-2)`},children:`元/月`})]}),U.p75_basis&&(0,Z.jsx)(`div`,{className:`mt-1 text-[12px]`,style:{color:`var(--text-3)`},children:U.p75_basis})]}),U.key_premium_skills?.length>0&&(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide mb-2`,style:{color:`var(--text-3)`},children:`高溢价技能（谈判筹码）`}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:U.key_premium_skills.map(e=>(0,Z.jsx)(`span`,{className:`inline-flex items-center rounded-full border px-3 py-1 text-[12px] font-medium`,style:{background:`var(--surface2)`,borderColor:`rgba(200,90,34,0.2)`,color:`var(--accent)`},children:e},e))})]}),U.recent_signal&&(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide mb-1`,style:{color:`var(--text-3)`},children:`近期行情信号`}),(0,Z.jsx)(`div`,{className:`text-[13px] leading-relaxed`,style:{color:`var(--text-1)`},children:U.recent_signal})]}),U.data_caveat&&(0,Z.jsxs)(`div`,{className:`text-[11px] flex items-start gap-1.5`,style:{color:`var(--text-3)`},children:[(0,Z.jsx)(d,{className:`h-3 w-3 flex-shrink-0 mt-0.5`}),U.data_caveat]}),U.citations?.length>0&&(0,Z.jsxs)(`div`,{className:`border-t pt-3 mt-1`,style:{borderColor:`var(--border)`},children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide mb-2`,style:{color:`var(--text-3)`},children:`信息来源`}),(0,Z.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:U.citations.slice(0,4).map((e,t)=>(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-[12px] hover:underline flex items-center gap-1.5 truncate`,style:{color:`var(--accent)`},children:[(0,Z.jsx)(_,{className:`h-3 w-3 flex-shrink-0`}),(0,Z.jsxs)(`span`,{className:`truncate`,children:[e.source?`[${e.source}] `:``,e.title]})]},`${e.url}-${t}`))})]}),(0,Z.jsxs)(`button`,{type:`button`,onClick:ve,className:`mt-1 w-full inline-flex items-center justify-center gap-2 rounded-xl px-4 py-3 text-[14px] font-semibold transition-all`,style:{background:`var(--btn-primary-bg)`,color:`var(--btn-primary-text)`,border:`1px solid var(--btn-primary-border)`},children:[(0,Z.jsx)(g,{className:`h-4 w-4`}),n?`把这些锚点带入对话`:`用这些锚点去薪酬谈判`]})]}):null]})]}):e||t?null:(0,Z.jsxs)(`div`,{className:`rounded-2xl border p-8 flex flex-col items-center justify-center min-h-[400px]`,style:{background:`var(--surface)`,borderColor:`var(--border)`},children:[(0,Z.jsx)(p,{className:`h-14 w-14 mb-4`,style:{color:`var(--text-3)`}}),(0,Z.jsx)(`div`,{className:`text-[15px] font-medium mb-2`,style:{color:`var(--text-2)`},children:`薪资搜索结果`}),(0,Z.jsx)(`div`,{className:`text-[13px] text-center max-w-[280px]`,style:{color:`var(--text-3)`},children:`选择岗位、输入月薪后点击查询，这里会显示你在市场中的薪资百分位。`})]})]})]})})}function Ye(){return s(`/tools/salary-negotiation`)?(0,Z.jsx)(j,{title:`薪酬谈判`,subTitle:`对话式谈薪助手：先厘清筹码，再给出策略与可直接发送的话术。`,hideModelSelector:!0,hideThinkingToggle:!0,children:(0,Z.jsx)(K,{title:`薪酬谈判即将上线`,description:`薪酬谈判即将上线，建议先使用简历匹配与简历优化完善投递与谈判基础。`})}):(0,Z.jsx)(Xe,{})}function Xe(){let{busy:e,setBusy:t,err:n,setErr:r,runState:i,progress:a,failByMessage:s,dialogInput:c,setDialogInput:l,chatTurns:u,streamText:d,setStreamText:f,streamThinking:p,setStreamThinking:m,streamStage:h,setStreamStage:g,streamActor:_,setStreamActor:v,abortRef:y,runSeqRef:b,chatScrollRef:x,handleRun:T,resetAll:E,starterPrompts:te}=ze(),[ne,D]=(0,X.useState)(null),[O,re]=(0,X.useState)(!1),[ie,k]=(0,X.useState)(!0),A=(0,X.useRef)(e);(0,X.useEffect)(()=>{if(A.current&&!e&&ne){let e=ne;D(null),l(``),T(e)}A.current=e},[e]);let ae=(0,X.useCallback)(e=>{let t=o(e);t&&l(e=>{let n=o(e);return n?`${n}\n\n${t}`:t})},[l]),F=(0,X.useCallback)(()=>{re(!1),k(!0)},[]),I=(0,X.useCallback)(()=>{let t=o(c);if(t){if(e){D(t),l(``);return}T(t)}},[e,c,T,l]),R=(0,X.useCallback)(e=>{let t=String(e.content||``).trim();return t?e.role===`user`?(0,Z.jsx)(`div`,{style:{whiteSpace:`pre-wrap`},children:t}):(0,Z.jsx)(N,{text:t}):null},[]),oe=e=>{let t=o(e);t&&l(t)},z=()=>{f(``),m(``),g(``),v(``),me({tool:`salary_negotiation`,runSeqRef:b,abortRef:y,setBusy:t,snapshotPatch:{streamText:``,streamThinking:``,streamStage:``,streamActor:``},onCancelled:()=>s(`已停止`,r)})},se=!u.length&&!e,B=(0,X.useMemo)(()=>L(u),[u]),V=(0,X.useMemo)(()=>[...u].reverse().find(e=>e.role===`assistant`),[u]),H=e?`本轮 token 将在回复结束后更新`:V&&!V.billing?`本轮 token 统计中，稍后自动更新`:``;return(0,Z.jsx)(j,{title:`薪酬谈判`,subTitle:`对话式谈薪助手：先厘清筹码，再给出策略与可直接发送的话术。`,hideModelSelector:!0,hideThinkingToggle:!0,children:(0,Z.jsxs)(`div`,{className:`he-tools-layout`,children:[(0,Z.jsx)(`aside`,{className:`he-tools-sidebar`,children:(0,Z.jsx)(M,{current:`/tools/salary-negotiation`,collapsed:ie,onCollapsedChange:k})}),(0,Z.jsxs)(`section`,{className:`he-tools-main he-salaryneg-main${O?` is-rail-collapsed`:``}`,children:[(0,Z.jsxs)(`div`,{className:`he-salaryneg-chat`,children:[(0,Z.jsxs)(`div`,{className:`he-card`,style:{marginTop:6,padding:0,display:`flex`,flexDirection:`column`,minHeight:560,overflow:`hidden`},children:[se?(0,Z.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,padding:`26px 24px 18px`},children:[(0,Z.jsxs)(`div`,{style:{borderBottom:`1px solid var(--border-soft)`,paddingBottom:16},children:[(0,Z.jsx)(`div`,{className:`he-label`,children:`薪酬谈判 Skill`}),(0,Z.jsx)(`div`,{style:{marginTop:8,fontSize:22,fontWeight:800,color:`var(--text-1)`,letterSpacing:`-0.02em`},children:`先把你的处境说清楚，我来追问、拆包、给话术`}),(0,Z.jsx)(`div`,{className:`he-muted`,style:{marginTop:8,fontSize:13,lineHeight:1.8,maxWidth:720},children:`这个页面只保留当前对话上下文。你离开薪酬谈判后，对话不会长期保留。`})]}),(0,Z.jsxs)(`div`,{style:{marginTop:16,padding:`16px 16px 12px`,borderRadius:18,border:`1px solid var(--border)`,background:`var(--surface)`},children:[(0,Z.jsx)(`div`,{className:`he-label`,children:`建议这样开始`}),(0,Z.jsx)(`div`,{style:{marginTop:12,display:`flex`,flexWrap:`wrap`,gap:10},children:te.slice(0,4).map(e=>(0,Z.jsx)(`button`,{type:`button`,onClick:()=>oe(e),style:{padding:`10px 14px`,borderRadius:999,border:`1px solid var(--border)`,background:`var(--surface2)`,cursor:`pointer`,textAlign:`left`,transition:`transform 0.15s, border-color 0.15s`},onMouseEnter:e=>{e.currentTarget.style.transform=`translateY(-1px)`,e.currentTarget.style.borderColor=`var(--accent)`},onMouseLeave:e=>{e.currentTarget.style.transform=``,e.currentTarget.style.borderColor=`var(--border)`},children:(0,Z.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:`var(--text-1)`,lineHeight:1.5},children:e})},e))}),(0,Z.jsx)(`div`,{className:`he-muted`,style:{marginTop:12,fontSize:12,lineHeight:1.7},children:`你也可以直接粘贴 offer 邮件、对方原话、薪资结构截图，或描述你当前的谈判处境。`}),(0,Z.jsx)(`div`,{className:`he-muted`,style:{marginTop:8,fontSize:12,lineHeight:1.7},children:`对话会保存在你当前的浏览器里，下次打开能接着谈；换设备或清除浏览器数据后会丢失。`})]})]}):(0,Z.jsx)(`div`,{style:{flex:1,overflowY:`auto`,padding:`16px 18px 0`,background:`color-mix(in srgb, var(--surface) 96%, transparent)`},children:(0,Z.jsxs)(`div`,{style:{maxWidth:920,margin:`0 auto`},children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,marginBottom:12,padding:`0 2px`,flexWrap:`wrap`},children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`he-label`,children:`对话面板`}),(0,Z.jsx)(`div`,{className:`he-muted`,style:{marginTop:4,fontSize:12},children:`调用薪酬谈判 Skill：追问信息、拆解筹码、生成可发送话术。`})]}),(0,Z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,flexWrap:`wrap`,justifyContent:`flex-end`},children:[(0,Z.jsxs)(`div`,{style:{minWidth:180,textAlign:`right`},children:[(0,Z.jsx)(C,{billing:B,label:`本次会话累计`,style:{marginTop:0,fontSize:11,lineHeight:1.5}}),H?(0,Z.jsx)(`div`,{className:`he-muted`,style:{fontSize:11,lineHeight:1.5},children:H}):null]}),(0,Z.jsx)(`button`,{type:`button`,className:`btn-secondary`,style:{fontSize:12,padding:`4px 10px`},onClick:E,disabled:e,children:`清空对话`})]})]}),(0,Z.jsx)(w,{turns:u,assistantLabel:`薪酬谈判助手`,emptyText:``,chatScrollRef:x,renderContent:e=>R(e),hideBillingModel:!0,streamPreview:e||d||p?(0,Z.jsx)(P,{assistantLabel:`薪酬谈判助手`,busy:e,streamText:d,streamThinking:p,streamStage:h,streamActor:_,emptyText:`正在调用薪酬谈判 Skill，拆解总包、筹码和让步顺序…`}):null})]})}),(0,Z.jsx)(`div`,{style:{padding:`0 18px 16px`,borderTop:se?`none`:`1px solid var(--border)`,paddingTop:se?0:14,marginTop:se?0:4,background:`var(--surface)`},children:(0,Z.jsxs)(`div`,{style:{maxWidth:920,margin:`0 auto`},children:[(0,Z.jsx)(ee,{busy:e,inputDisabled:!1,actionDisabled:!1,pendingAttachments:[],onRemoveAttachment:()=>{},value:c,onChange:l,onSubmit:I,onStop:z,stopLabel:`停止`,onFilesPicked:()=>{},placeholder:e&&ne?`消息已排队，等待回复后自动发送…`:`输入你的薪资情况、offer 条件、对方原话或你想怎么谈…`,hideAttachmentButton:!0,submitDisabled:!o(c),simpleStyle:!0,minTextareaHeight:120,maxTextareaHeight:260}),e&&ne?(0,Z.jsx)(`div`,{style:{marginTop:6,fontSize:11,color:`var(--text-3)`,textAlign:`center`},children:`已排队 1 条消息，等当前回复结束后自动发送`}):null]})})]}),(0,Z.jsx)(q,{state:i,progress:a}),n?(0,Z.jsx)(`div`,{className:`he-err`,children:n}):null]}),O?(0,Z.jsxs)(`div`,{className:`he-salaryneg-rail-collapsed`,children:[(0,Z.jsx)(`button`,{type:`button`,className:`he-sidebar-toggle`,onClick:F,title:`展开薪资搜索`,"aria-label":`展开薪资搜索`,children:(0,Z.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,Z.jsx)(`polyline`,{points:`15 18 9 12 15 6`})})}),(0,Z.jsx)(`span`,{className:`he-salaryneg-rail-vlabel`,children:`薪资搜索`})]}):(0,Z.jsx)(`aside`,{className:`he-salaryneg-rail`,children:(0,Z.jsxs)(`div`,{className:`he-card`,style:{padding:16,border:`1px solid var(--border)`},children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:10,marginBottom:10},children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`he-label`,children:`薪资搜索`}),(0,Z.jsx)(`div`,{className:`he-muted`,style:{marginTop:4,fontSize:12,lineHeight:1.6},children:`选岗位、城市、月薪查市场分位。查完点「带入对话」把锚点填进左侧对话框。本搜索不读取你的历史记忆。`})]}),(0,Z.jsx)(`button`,{type:`button`,className:`he-sidebar-toggle`,onClick:()=>re(!0),title:`收起薪资搜索，给对话腾空间`,"aria-label":`收起薪资搜索`,style:{flexShrink:0},children:(0,Z.jsx)(S,{className:`w-4 h-4`})})]}),(0,Z.jsx)(Je,{panelMode:!0,onSendToNegotiation:ae})]})})]})]})})}export{Ye as default};