1import{r as p,f as W,j as e,L as H}from"./react-TITiJaTY.js";import{c0 as q,g as V,V as _,bs as Q,ba as M,a as X,c as Z,S as ee,U as te,l as ae,e as ie,f as se,d as ne,T as re,ar as oe}from"./App-Dli7sJFM.js";import{u as ce}from"./pay-DYfPM9uF.js";import{u as le}from"./careerHealth-CIkys9uk.js";import{b5 as de}from"./llm-CdWZ4qgd.js";import{I as v}from"./shared-lite-BOZiOCY1.js";import{A as pe}from"./AppHeader-Bv7bfOUu.js";import{m as O}from"./motion-DheP8iPc.js";import"./index-D0VpW5-F.js";import"./memory-BnxUEnat.js";import"./podcastDeviceState-B0NlAIS7.js";const F="nemo_radar",K={lastOpened:"",streak:0};function me(){try{return{...K,...JSON.parse(localStorage.getItem(F))}}catch{return{...K}}}let k=me();const U=new Set;function ue(i){k=i;try{localStorage.setItem(F,JSON.stringify(i))}catch{}U.forEach(r=>r())}const he=()=>M(Date.now()),fe=()=>M(Date.now()-864e5),B=i=>i?Math.floor((Date.now()-new Date(i).getTime())/864e5):1/0,ye=i=>String(i||"").trim().split(/\s+/)[0]||"";function ge(){const i=he();if(k.lastOpened===i)return;const r=k.lastOpened===fe()?(k.streak||0)+1:1;ue({lastOpened:i,streak:r})}function we(){return p.useSyncExternalStore(i=>(U.add(i),()=>U.delete(i)),()=>k,()=>k)}function ve({profile:i={},completeness:r=0,activity:b={},achievements:u={},gaps:l=[],contacts:L=[],market:E=null,risk:h={},promo:y={},health:A=[],reflections:I=[]}={}){var R,Y,C,T,S,o,D;const x=[],s=a=>x.push(a),z=((R=h.warn)==null?void 0:R.confirmed)===!0&&q(h),g=h.assessment,j=Object.keys(h.signals||{}).length;z?s({id:"risk-warn",kind:"risk",tone:"alert",icon:"shield",priority:100,title:"A WARN layoff notice is on file at your employer",detail:"Treat a cut as imminent - open your defensive plan now.",ctaLabel:"Open my plan",to:"/app/risk"}):g?(g.summary,s({id:"risk",kind:"risk",tone:"warn",icon:"shield",priority:72,title:"Your layoff-risk read is ready",detail:((C=(Y=g.playbook)==null?void 0:Y[0])==null?void 0:C.title)||"Review your exposure and the plan to lower it.",ctaLabel:"Review risk",to:"/app/risk"})):j>=2&&s({id:"risk-signals",kind:"risk",tone:"warn",icon:"shield",priority:60,title:`You flagged ${j} warning signs`,detail:"Turn them into a calm, prioritized defensive plan.",ctaLabel:"Build my plan",to:"/app/risk"});const f=V(L);if(f.due>0){const a=f.needsAttention[0];s({id:"network",kind:"network",tone:"warn",icon:"chat",priority:68,title:`${f.due} relationship follow-up${f.due>1?"s are":" is"} due`,detail:a?`${ye(a.name)}${a.company?` at ${a.company}`:""} is ready for a follow-up.`:"Review the contacts waiting for a follow-up.",ctaLabel:"Review follow-ups",to:"/app/network"})}else f.total===0&&s({id:"network-empty",kind:"network",tone:"info",icon:"chat",priority:34,title:"Your network is empty",detail:"Add the recruiters, referrals & mentors who can open doors.",ctaLabel:"Add contacts",to:"/app/network"});const m=A||[];if(m.length>=2){const a=m[m.length-1].score,n=m[m.length-2].score,c=a-n;s({id:"health",kind:"health",tone:c>=0?"good":"warn",icon:"heart",priority:c<0?58:44,title:`Career health: ${a}/100 ${c===0?"(steady)":c>0?`â² ${c}`:`â¼ ${Math.abs(c)}`}`,detail:c<0?"It slipped - see the fastest way to move it back up.":"Keep the momentum - check what moves it next.",ctaLabel:"See score",to:"/app/health"})}if(l.length>0){const a=[...l].sort((c,P)=>(P.weight||0)-(c.weight||0))[0],n=a==null?void 0:a.topic;s({id:"gaps",kind:"skill",tone:"info",icon:"bulb",priority:50,title:n?l.length>1?`Strengthen evidence for ${n} (+${l.length-1} more)`:`Strengthen evidence for ${n}`:`${l.length} skill area${l.length>1?"s need":" needs"}
1 evidence`,detail:n?`Use a short lesson or a grounded project to add evidence for ${n}.`:"Choose one area and add evidence through learning or a project.",ctaLabel:n?"Practice":"Review skill areas",to:n?`/app/growth?focus=${encodeURIComponent(n)}`:"/app/growth"})}const w=_(b),N=((T=w[0])==null?void 0:T.date)||((S=w[w.length-1])==null?void 0:S.date);if(w.length===0)s({id:"iv-first",kind:"interview",tone:"info",icon:"mic",priority:46,title:"Run your first mock interview",detail:"Get a real readiness read - and start teaching your persona how you answer.",ctaLabel:"Start practice",to:"/app/interview"});else if(B(N)>14){const a=B(N);s({id:"iv-stale",kind:"interview",tone:"info",icon:"mic",priority:42,title:`It's been ${Number.isFinite(a)?`${a} days`:"a while"} since your last mock`,detail:"Stay sharp - a quick session keeps your reps fresh.",ctaLabel:"Practice",to:"/app/interview"})}E||s({id:"market",kind:"market",tone:"info",icon:"coin",priority:40,title:"Review salary benchmarks",detail:`Compare current salary data for ${i.targetRole||"your role"}.`,ctaLabel:"Review benchmarks",to:"/app/pay"}),(y.targetLevel||(y.wins||[]).length)&&B((D=(o=y.wins)==null?void 0:o[0])==null?void 0:D.date)>7&&s({id:"promo",kind:"promotion",tone:"good",icon:"star",priority:36,title:"Log this week's wins",detail:"A living brag-doc is the evidence your promo case runs on.",ctaLabel:"Add a win",to:"/app/promotion"}),r<100&&s({id:"profile",kind:"profile",tone:"info",icon:"doc",priority:30,title:`Your profile is ${r}% complete`,detail:"Finish it - every agent gets sharper with more signal.",ctaLabel:"Complete profile",to:"/app/profile"});const $=Q(I||[],b.interviews);return $.length>=3&&s({id:"persona",kind:"persona",tone:"accent",icon:"graph",priority:26,title:"Your Career Persona has new signals",detail:`${$.length} confirmed reflections are ready for review.`,ctaLabel:"Review Persona changes",to:"/app/persona"}),x.sort((a,n)=>n.priority-a.priority)}const ke={alert:"var(--coral)",warn:"var(--amber)",info:"var(--info)",good:"var(--good)",accent:"var(--accent)"},be=()=>{const i=new Date().getHours();return i<12?"Good morning":i<18?"Good afternoon":"Good evening"},G=()=>new Date().toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"});function ze(){const i=W(),{profile:r,completeness:b}=X(),{user:u}=Z(),l=ee(),L=te(),E=ae(),h=ie(),y=ce(),A=se(),I=ne(),x=le(),s=re(),z=we(),[g,j]=p.useState(""),[f,m]=p.useState(!0),[w,N]=p.useState(!1),[$,R]=p.useState(!1),[Y,C]=p.useState(!1),S=(r.fullName||(u==null?void 0:u.name)||"").split(/\s+/)[0]||"there",o=p.useMemo(()=>ve({profile:r,completeness:b,activity:l,achievements:L,gaps:E.items,contacts:h.items,market:y.current,risk:A,promo:I,health:x.points,reflections:s.items}),[r,b,l,L,E.items,h.items,y.current,A,I,x.points,s.items]),D=o.map(t=>t.id).join(",");p.useEffect(()=>{ge()},[]),p.useEffect(()=>{let t=!0;return m(!0),j(""),N(!1),de({name:S,role:r.targetRole,items:o,grounding:oe(r)}).then(d=>{t&&d&&j(d)}).catch(()=>{t&&N(!0)}).finally(()=>{t&&m(!1)}),()=>{t=!1}},[D]);const a=o[0]?`Your highest-leverage move today: ${o[0].title.toLowerCase()}.`:"Nothing urgent today - a calm window to invest in the long game.",n=()=>{const t=[`Nyanza · Career Radar - ${G()}`,"",`Today's focus: ${g||a}`,""];return o.length&&(t.push("Your moves:"),o.slice(0,6).forEach((d,J)=>t.push(`${J+1}. ${d.title} - ${d.detail}`))),t.push("","- Nyanza (nyanza.ai)"),t.join(` 2`)},c=async()=>{C(!1);try{await navigator.clipboard.writeText(n()),R(!0),setTimeout(()=>R(!1),1800)}catch{C(!0)}},P=()=>{const t=encodeURIComponent(`Your Nyanza Career Radar - ${G()}`),d=encodeURIComponent(n());window.location.href=`mailto:${(u==null?void 0:u.email)||""}?subject=${t}&body=${d}`};return e.jsxs("div",{className:"rd",children:[e.jsx(pe,{}),e.jsxs("main",{className:"rd-main",children:[e.jsxs(O.div,{className:"rd-head",initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5},children:[e.jsxs("span",{className:"eyebrow",children:["Career Radar · ",G()]}),e.jsxs("div",{className:"rd-greet",children:[e.jsxs("h1",{className:"rd-title",children:[be(),", ",e.jsx("span",{className:"gradient-text",children:S}),"."]}),z.streak>1&&e.jsxs("span",{className:"rd-streak",children:[e.jsx(v,{name:"zap",size:14})," ",z.streak,"-day streak"]})]})]}),e.jsxs(O.div,{className:"card rd-focus",role:"status","aria-live":"polite",initial:{opacity:0,y:12}
2,animate:{opacity:1,y:0},transition:{duration:.45,delay:.05},children:[e.jsxs("span",{className:"rd-focus-label",children:[e.jsx(v,{name:"spark",size:15})," Today's focus"]}),e.jsx("p",{className:"rd-focus-text",children:f?e.jsx("span",{className:"rd-focus-loading",children:"Reading your week..."}):g||a}),w&&e.jsx("p",{className:"rd-focus-note",children:"Live brief unavailable; showing your highest-priority signal instead."})]}),e.jsxs(O.div,{className:"rd-digest",initial:{opacity:0},animate:{opacity:1},transition:{duration:.4,delay:.1},children:[e.jsxs("button",{type:"button",className:"rd-digest-btn",onClick:c,children:[e.jsx(v,{name:$?"check":"copy",size:14})," ",$?"Copied":"Copy digest"]}),e.jsxs("button",{type:"button",className:"rd-digest-btn",onClick:P,children:[e.jsx(v,{name:"mail",size:14})," Email it to me"]}),e.jsx("span",{className:"rd-digest-note",children:"Inbox delivery is not enabled; copy the digest or open it in your email app."})]}),Y&&e.jsx("p",{className:"rd-copy-error",role:"alert",children:"Clipboard access is unavailable. Use âEmail it to meâ instead."}),o.length===0?e.jsxs("div",{className:"card rd-clear",children:[e.jsx("div",{className:"empty-orb"}),e.jsx("h3",{children:"You're all caught up."}),e.jsx("p",{children:"No fires, no cold contacts, nothing overdue. Keep practicing and your persona keeps getting smarter."}),e.jsx(H,{className:"btn btn-primary",to:"/app/persona",children:"Review my Career Persona"})]}):e.jsx("div",{className:"rd-feed",children:o.map((t,d)=>e.jsxs(O.button,{type:"button",className:`card rd-item tone-${t.tone}`,style:{"--tc":ke[t.tone]||"var(--accent)"},onClick:()=>i(t.to),initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.35,delay:.1+d*.05},children:[e.jsx("span",{className:"rd-item-ic",children:e.jsx(v,{name:t.icon,size:18})}),e.jsxs("span",{className:"rd-item-body",children:[e.jsx("strong",{className:"rd-item-title",children:t.title}),e.jsx("span",{className:"rd-item-detail",children:t.detail})]}),e.jsxs("span",{className:"rd-item-cta",children:[t.ctaLabel," ",e.jsx(v,{name:"arrowRight",size:14})]})]},t.id))}),e.jsxs("p",{className:"rd-foot",children:["Your radar reads every layer of your ",e.jsx(H,{to:"/app/persona",children:"Career Persona"})," - it refreshes as you practice, apply, and plan."]})]})]})}export{ze as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.