1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html2pdf-BTknD3hk.js","assets/index-BcGILXnr.js","assets/index-DVu3-1lf.css"])))=>i.map(i=>d[i]); 2import{g as me,_ as Tt,c as gt,j as e,A as zt,r as S,B as R,X as At,x as Et,M as Rt,f as O,G as pe,T as Ae,t as ee,v as te,w as ae,S as xe,b as Ee,s as I,I as xt,L as J,u as Wt,a as Ft,J as Lt,N as qt,y as ue}from"./index-BcGILXnr.js";import{B as De,i as pt,M as Re,T as It,u as Yt,S as Bt,f as Ht,D as Je,U as Vt,p as Gt}from"./DashboardLayout-CEDXqKEj.js";import{T as Ke,a as Ze,b as X,c as Q}from"./tabs-CEvJd00j.js";import{B as $}from"./badge-CgnKKj3C.js";import{C as T,a as H,b as V,c as M}from"./card-CXJ0-SW3.js";import{downloadDossierPdf as Xt}from"./generateDossierPdf-iK2m_TBS.js";import{a as Qt,b as Ut,c as Jt,G as et,i as tt,R as Kt,j as Zt,A as ea,F as ta,P as aa,C as sa,D as na,k as ra,S as ia,d as la,g as at,e as oa,B as ca,I as da,f as ma,h as ua}from"./DossierSkeleton-DTQQBNqU.js";import{B as de,T as Se}from"./target-DKcIvOD1.js";import{S as ha}from"./sparkles-DOeV1aWv.js";import{P as We}from"./plus-DvKYdvUf.js";import{R as Ne}from"./refresh-cw-DdnBYlak.js";import{M as vt}from"./minus-BWWxkqmZ.js";import{C as yt}from"./check-CG4QLlbY.js";import{E as fa}from"./external-link-hsiLMjmL.js";import{u as ga,M as bt}from"./useProfileContacts-DrmCENZ3.js";import{U as we}from"./users-C_l24RrO.js";import{L as Oe}from"./linkedin-B8Z2Y6u_.js";import{S as _e,U as xa}from"./user-check-DCJB-mtc.js";import{S as Te,D as pa}from"./trending-down-Wk3d78Lf.js";import{S as st,a as nt,b as rt,c as it,d as lt}from"./select-Lv1UDB6D.js";import{S as wt}from"./separator-Bv2fxWg5.js";import{t as K,d as va,m as _t}from"./differenceInCalendarDays-mpVmVgHd.js";import{C as ze}from"./circle-check-DGoGnK6L.js";import{C as ya}from"./clock-DPVRQrMl.js";import{A as ba}from"./arrow-left-B4DAyS8Z.js";import{M as wa}from"./map-pin--Fshw9V-.js";import{G as be}from"./globe-lVoGG-pi.js";import"./database-e3mcfmXM.js";import"./trending-up-Cq3X9UTu.js";import"./circle-x-DRrRk1-A.js";import"./chevron-up-okwG9QRX.js";import"./save-Csx1LBoa.js";import"./index-BnxcXB4c.js";/** 3 * @license lucide-react v0.462.0 - ISC 4 * 5 * This source code is licensed under the ISC license. 6 * See the LICENSE file in the root directory of this source tree. 7 */const _a=me("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** 8 * @license lucide-react v0.462.0 - ISC 9 * 10 * This source code is licensed under the ISC license. 11 * See the LICENSE file in the root directory of this source tree. 12 */const jt=me("CalendarPlus",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M19 16v6",key:"tddt3s"}]]);/** 13 * @license lucide-react v0.462.0 - ISC 14 * 15 * This source code is licensed under the ISC license. 16 * See the LICENSE file in the root directory of this source tree. 17 */const ja=me("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/** 18 * @license lucide-react v0.462.0 - ISC 19 * 20 * This source code is licensed under the ISC license. 21 * See the LICENSE file in the root directory of this source tree. 22 */const Nt=me("ShieldQuestion",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 23 * @license lucide-react v0.462.0 - ISC 24 * 25 * This source code is licensed under the ISC license. 26 * See the LICENSE file in the root directory of this source tree.
vendor: 2,831 bytes, lines 27-32
27 */const Na=me("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/** 28 * @license lucide-react v0.462.0 - ISC 29 * 30 * This source code is licensed under the ISC license. 31 * See the LICENSE file in the root directory of this source tree. 32 */const ka=me("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);function le(t,a){return t instanceof Date?new t.constructor(a):new Date(a)}let Ca={};function ke(){return Ca}function ve(t,a){var d,u,f,g;const s=ke(),r=(a==null?void 0:a.weekStartsOn)??((u=(d=a==null?void 0:a.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??s.weekStartsOn??((g=(f=s.locale)==null?void 0:f.options)==null?void 0:g.weekStartsOn)??0,i=K(t),o=i.getDay(),n=(o<r?7:0)+o-r;return i.setDate(i.getDate()-n),i.setHours(0,0,0,0),i}function je(t){return ve(t,{weekStartsOn:1})}function kt(t){const a=K(t),s=a.getFullYear(),r=le(t,0);r.setFullYear(s+1,0,4),r.setHours(0,0,0,0);const i=je(r),o=le(t,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const n=je(o);return a.getTime()>=i.getTime()?s+1:a.getTime()>=n.getTime()?s:s-1}function Sa(t){const a=kt(t),s=le(t,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),je(s)}function Pa(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function $a(t){if(!Pa(t)&&typeof t!="number")return!1;const a=K(t);return!isNaN(Number(a))}function Ma(t){const a=K(t),s=le(t,0);return s.setFullYear(a.getFullYear(),0,1),s.setHours(0,0,0,0),s}const Da={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Oa=(t,a,s)=>{let r;const i=Da[t];return typeof i=="string"?r=i:a===1?r=i.one:r=i.other.replace("{{count}}
32",a.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+r:r+" ago":r};function Pe(t){return(a={})=>{const s=a.width?String(a.width):t.defaultWidth;return t.formats[s]||t.formats[t.defaultWidth]}}const Ta={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},za={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Aa={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ea={date:Pe({formats:Ta,defaultWidth:"full"}),time:Pe({formats:za,defaultWidth:"full"}),dateTime:Pe({formats:Aa,defaultWidth:"full"})},Ra={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wa=(t,a,s,r)=>Ra[t];function he(t){return(a,s)=>{const r=s!=null&&s.context?String(s.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const n=t.defaultFormattingWidth||t.defaultWidth,d=s!=null&&s.width?String(s.width):n;i=t.formattingValues[d]||t.formattingValues[n]}else{const n=t.defaultWidth,d=s!=null&&s.width?String(s.width):t.defaultWidth;i=t.values[d]||t.values[n]}const o=t.argumentCallback?t.argumentCallback(a):a;return i[o]}}const Fa={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},La={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},qa={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ia={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ya={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ba={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ha=(t,a)=>{const s=Number(t),r=s%100;if(r>20||r<10)switch(r%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},Va={ordinalNumber:Ha,era:he({values:Fa,defaultWidth:"wide"}),quarter:he({values:La,defaultWidth:"wide",argumentCallback:t=>t-1}),month:he({values:qa,defaultWidth:"wide"}),day:he({values:Ia,defaultWidth:"wide"}),dayPeriod:he({values:Ya,defaultWidth:"wide",formattingValues:Ba,defaultFormattingWidth:"wide"})};function fe(t){return(a,s={})=>{const r=s.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=a.match(i);if(!o)return null;const n=o[0],d=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(d)?Xa(d,y=>y.test(n)):Ga(d,y=>y.test(n));let f;f=t.valueCallback?t.valueCallback(u):u,f=s.valueCallback?s.valueCallback(f):f;const g=a.slice(n.length);return{value:f,rest:g}}}function Ga(t,a){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&a(t[s]))return s}function Xa(t,a){for(let s=0;s<t.length;s++)if(a(t[s]))return s}function Qa(t){return(a,s={})=>{const r=a.match(t.matchPattern);if(!r)return null;const i=r[0],o=a.match(t.parsePattern);if(!o)return null;let n=t.valueCallback?t.valueCallback(o[0]):o[0];n=s.valueCallback?s.valueCallback(n):n;const d=a.slice(i.length);return{value:n,rest:d}}}const Ua=/^(\d+)(th|st|nd|rd)?/i,Ja=/\d+/i,Ka={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Za={any:[/^b/i,/^(a|c)/i]},es={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ts={any:[/1/i,/2/i,/3/i,/4/i]},as={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ss={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},rs={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},is={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ls={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},os={ordinalNumber:Qa({matchPattern:Ua,parsePattern:Ja,valueCallback:t=>parseInt(t,10)}),era:fe({matchPatterns:Ka,defaultMatchWidth:"wide",parsePatterns:Za,defaultParseWidth:"any"}),quarter:fe({matchPatterns:es,defaultMatchWidth:"wide",parsePatterns:ts,defaultParseWidth:"any",valueCallback:t=>t+1}),month:fe({matchPatterns:as,defaultMatchWidth:"wide",parsePatterns:ss,defaultParseWidth:"any"}),day:fe({matchPatterns:ns,defaultMatchWidth:"wide",parsePatterns:rs,defaultParseWidth:"any"}),dayPeriod:fe({matchPatterns:is,defaultMatchWidth:"any",parsePatterns:ls,defaultParseWidth:"any"})},cs={code:"en-US",formatDistance:Oa,formatLong:Ea,formatRelative:Wa,localize:Va,match:os,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ds(t){const a=K(t);return va(a,Ma(a))+1}function ms(t){const a=K(t),s=+je(a)-+Sa(a);return Math.round(s/_t)+1}function Ct(t,a){var g,y,v,k;const s=K(t),r=s.getFullYear(),i=ke(),o=(a==null?void 0:a.firstWeekContainsDate)??((y=(g=a==null?void 0:a.locale)==null?void 0:g.options)==null?void 0:y.firstWeekContainsDate)??i.firstWeekContainsDate??((k=(v=i.locale)==null?void 0:v.options)==null?void 0:k.firstWeekContainsDate)??1,n=le(t,0);n.setFullYear(r+1,0,o),n.setHours(0,0,0,0);const d=ve(n,a),u=le(t,0);u.setFullYear(r,0,o),u.setHours(0,0,0,0);const f=ve(u,a);return s.getTime()>=d.getTime()?r+1:s.getTime()>=f.getTime()?r:r-1}function us(t,a){var d,u,f,g;const s=ke(),r=(a==null?void 0:a.firstWeekContainsDate)??((u=(d=a==null?void 0:a.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(f=s.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,i=Ct(t,a),o=le(t,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),ve(o,a)}function hs(t,a){const s=K(t),r=+ve(s,a)-+us(s,a);return Math.round(r/_t)+1}function N(t,a){const s=t<0?"-":"",r=Math.abs(t).toString().padStart(a,"0");return s+r}const Z={y(t,a){const s=t.getFullYear(),r=s>
vendor: 5,379 bytes, line 32
320?s:1-s;return N(a==="yy"?r%100:r,a.length)},M(t,a){const s=t.getMonth();return a==="M"?String(s+1):N(s+1,2)},d(t,a){return N(t.getDate(),a.length)},a(t,a){const s=t.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h(t,a){return N(t.getHours()%12||12,a.length)},H(t,a){return N(t.getHours(),a.length)},m(t,a){return N(t.getMinutes(),a.length)},s(t,a){return N(t.getSeconds(),a.length)},S(t,a){const s=a.length,r=t.getMilliseconds(),i=Math.trunc(r*Math.pow(10,s-3));return N(i,a.length)}},oe={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ot={G:function(t,a,s){const r=t.getFullYear()>0?1:0;switch(a){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})}},y:function(t,a,s){if(a==="yo"){const r=t.getFullYear(),i=r>0?r:1-r;return s.ordinalNumber(i,{unit:"year"})}return Z.y(t,a)},Y:function(t,a,s,r){const i=Ct(t,r),o=i>0?i:1-i;if(a==="YY"){const n=o%100;return N(n,2)}return a==="Yo"?s.ordinalNumber(o,{unit:"year"}):N(o,a.length)},R:function(t,a){const s=kt(t);return N(s,a.length)},u:function(t,a){const s=t.getFullYear();return N(s,a.length)},Q:function(t,a,s){const r=Math.ceil((t.getMonth()+1)/3);switch(a){case"Q":return String(r);case"QQ":return N(r,2);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,a,s){const r=Math.ceil((t.getMonth()+1)/3);switch(a){case"q":return String(r);case"qq":return N(r,2);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,a,s){const r=t.getMonth();switch(a){case"M":case"MM":return Z.M(t,a);case"Mo":return s.ordinalNumber(r+1,{unit:"month"});case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})}},L:function(t,a,s){const r=t.getMonth();switch(a){case"L":return String(r+1);case"LL":return N(r+1,2);case"Lo":return s.ordinalNumber(r+1,{unit:"month"});case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})}},w:function(t,a,s,r){const i=hs(t,r);return a==="wo"?s.ordinalNumber(i,{unit:"week"}):N(i,a.length)},I:function(t,a,s){const r=ms(t);return a==="Io"?s.ordinalNumber(r,{unit:"week"}):N(r,a.length)},d:function(t,a,s){return a==="do"?s.ordinalNumber(t.getDate(),{unit:"date"}):Z.d(t,a)},D:function(t,a,s){const r=ds(t);return a==="Do"?s.ordinalNumber(r,{unit:"dayOfYear"}):N(r,a.length)},E:function(t,a,s){const r=t.getDay();switch(a){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})}},e:function(t,a,s,r){const i=t.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(a){case"e":return String(o);case"ee":return N(o,2);case"eo":return s.ordinalNumber(o,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});case"eeee":default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(t,a,s,r){const i=t.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(a){case"c":return String(o);case"cc":return N(o,a.length);case"co":return s.ordinalNumber(o,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});case"cccc":default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(t,a,s){const r=t.getDay(),i=r===0?7:r;switch(a){case"i":return String(i);case"ii":return N(i,a.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(r,{width:"short",context:"formatting"});case"iiii":default:return s.day(r,{width:"wide",context:"formatting"})}},a:function(t,a,s){const i=t.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,a,s){const r=t.getHours();let i;switch(r===12?i=oe.noon:r===0?i=oe.midnight:i=r/12>
vendor: 4,388 bytes, line 32
32=1?"pm":"am",a){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,a,s){const r=t.getHours();let i;switch(r>=17?i=oe.evening:r>=12?i=oe.afternoon:r>=4?i=oe.morning:i=oe.night,a){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,a,s){if(a==="ho"){let r=t.getHours()%12;return r===0&&(r=12),s.ordinalNumber(r,{unit:"hour"})}return Z.h(t,a)},H:function(t,a,s){return a==="Ho"?s.ordinalNumber(t.getHours(),{unit:"hour"}):Z.H(t,a)},K:function(t,a,s){const r=t.getHours()%12;return a==="Ko"?s.ordinalNumber(r,{unit:"hour"}):N(r,a.length)},k:function(t,a,s){let r=t.getHours();return r===0&&(r=24),a==="ko"?s.ordinalNumber(r,{unit:"hour"}):N(r,a.length)},m:function(t,a,s){return a==="mo"?s.ordinalNumber(t.getMinutes(),{unit:"minute"}):Z.m(t,a)},s:function(t,a,s){return a==="so"?s.ordinalNumber(t.getSeconds(),{unit:"second"}):Z.s(t,a)},S:function(t,a){return Z.S(t,a)},X:function(t,a,s){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(a){case"X":return dt(r);case"XXXX":case"XX":return ie(r);case"XXXXX":case"XXX":default:return ie(r,":")}},x:function(t,a,s){const r=t.getTimezoneOffset();switch(a){case"x":return dt(r);case"xxxx":case"xx":return ie(r);case"xxxxx":case"xxx":default:return ie(r,":")}},O:function(t,a,s){const r=t.getTimezoneOffset();switch(a){case"O":case"OO":case"OOO":return"GMT"+ct(r,":");case"OOOO":default:return"GMT"+ie(r,":")}},z:function(t,a,s){const r=t.getTimezoneOffset();switch(a){case"z":case"zz":case"zzz":return"GMT"+ct(r,":");case"zzzz":default:return"GMT"+ie(r,":")}},t:function(t,a,s){const r=Math.trunc(t.getTime()/1e3);return N(r,a.length)},T:function(t,a,s){const r=t.getTime();return N(r,a.length)}};function ct(t,a=""){const s=t>0?"-":"+",r=Math.abs(t),i=Math.trunc(r/60),o=r%60;return o===0?s+String(i):s+String(i)+a+N(o,2)}function dt(t,a){return t%60===0?(t>0?"-":"+")+N(Math.abs(t)/60,2):ie(t,a)}function ie(t,a=""){const s=t>0?"-":"+",r=Math.abs(t),i=N(Math.trunc(r/60),2),o=N(r%60,2);return s+i+a+o}const mt=(t,a)=>{switch(t){case"P":return a.date({width:"short"});case"PP":return a.date({width:"medium"});case"PPP":return a.date({width:"long"});case"PPPP":default:return a.date({width:"full"})}},St=(t,a)=>{switch(t){case"p":return a.time({width:"short"});case"pp":return a.time({width:"medium"});case"ppp":return a.time({width:"long"});case"pppp":default:return a.time({width:"full"})}},fs=(t,a)=>{const s=t.match(/(P+)(p+)?/)||[],r=s[1],i=s[2];if(!i)return mt(t,a);let o;switch(r){case"P":o=a.dateTime({width:"short"});break;case"PP":o=a.dateTime({width:"medium"});break;case"PPP":o=a.dateTime({width:"long"});break;case"PPPP":default:o=a.dateTime({width:"full"});break}return o.replace("{{date}}",mt(r,a)).replace("{{time}}",St(i,a))},gs={p:St,P:fs},xs=/^D+$/,ps=/^Y+$/,vs=["D","DD","YY","YYYY"];function ys(t){return xs.test(t)}function bs(t){return ps.test(t)}function ws(t,a,s){const r=_s(t,a,s);if(console.warn(r),vs.includes(t))throw new RangeError(r)}function _s(t,a,s){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${a}\`) for formatting ${r} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const js=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ns=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ks=/^'([^]*?)'?$/,Cs=/''/g,Ss=/[a-zA-Z]/;function $e(t,a,s){var g,y,v,k;const r=ke(),i=r.locale??cs,o=r.firstWeekContainsDate??((y=(g=r.locale)==null?void 0:g.options)==null?void 0:y.firstWeekContainsDate)??1,n=r.weekStartsOn??((k=(v=r.locale)==null?void 0:v.options)==null?void 0:k.weekStartsOn)??0,d=K(t);if(!$a(d))throw new RangeError("Invalid time value");let u=a.match(Ns).map(w=>{const j=w[0];if(j==="p"||j==="P"){const z=gs[j];return z(w,i.formatLong)}return w}).join("").match(js).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const j=w[0];if(j==="'")return{isToken:!1,value:Ps(w)};if(ot[j])return{isToken:!0,value:w};
32if(j.match(Ss))throw new RangeError("Format string contains an unescaped latin alphabet character `"+j+"`");return{isToken:!1,value:w}});i.localize.preprocessor&&(u=i.localize.preprocessor(d,u));const f={firstWeekContainsDate:o,weekStartsOn:n,locale:i};return u.map(w=>{if(!w.isToken)return w.value;const j=w.value;(bs(j)||ys(j))&&ws(j,a,String(t));const z=ot[j[0]];return z(d,j,i.localize,f)}).join("")}function Ps(t){const a=t.match(ks);return a?a[1].replace(Cs,"'"):t}function h(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function re(t){return t==null?"":typeof t=="string"?t:JSON.stringify(t)}function $s(t,a){var f,g,y,v,k,w,j,z,W,F,c,C,Y,q,x,D,B;const s=t.profile,r=(s==null?void 0:s.full_name)||t.personName,i=a==null?void 0:a.behavioral_profile,o=a==null?void 0:a.recommended_approach;let n=` 33<style> 34 * { margin: 0; padding: 0; box-sizing: border-box; } 35 body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; color: #1a1a2e; line-height: 1.6; } 36 .page { padding: 40px 48px; max-width: 800px; margin: 0 auto; } 37 h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; color: #0f172a; } 38 h2 { font-size: 15px; font-weight: 700; margin-top: 20px; margin-bottom: 6px; color: #0f172a; border-bottom: 2px solid #8b5cf6; padding-bottom: 4px; } 39 h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; margin-top: 10px; margin-bottom: 4px; } 40 p, li { font-size: 11.5px; line-height: 1.7; color: #334155; } 41 .subtitle { font-size: 13px; color: #64748b; margin-bottom: 2px; } 42 .meta { font-size: 10px; color: #94a3b8; margin-bottom: 16px; } 43 .summary { font-size: 12px; line-height: 1.75; margin-bottom: 12px; background: #f5f3ff; padding: 12px 16px; border-radius: 6px; border-left: 3px solid #8b5cf6; } 44 .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } 45 .three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; } 46 .fact-label { font-size: 10px; font-weight: 600; text-transform: uppercase; color: #94a3b8; letter-spacing: 0.3px; margin-bottom: 2px; } 47 .fact-value { font-size: 11.5px; color: #334155; word-break: break-word; line-height: 1.5; } 48 .badge-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0; } 49 .badge { background: #f1f5f9; color: #475569; font-size: 10px; padding: 3px 9px; border-radius: 10px; line-height: 1.4; } 50 .badge-purple { background: #ede9fe; color: #6d28d9; font-size: 10px; padding: 3px 9px; border-radius: 10px; line-height: 1.4; } 51 .section-divider { border: none; border-top: 1px solid #e2e8f0; margin: 18px 0; } 52 .narrative-p { margin-bottom: 8px; } 53 .section-block { margin-bottom: 8px; } 54 .footer { margin-top: 32px; padding-top: 12px; border-top: 1px solid #e2e8f0; font-size: 10px; color: #94a3b8; text-align: center; } 55 .icebreaker-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; } 56 .icebreaker-text { font-size: 11.5px; font-style: italic; color: #1e293b; line-height: 1.6; } 57 .icebreaker-meta { font-size: 10px; color: #94a3b8; margin-top: 3px; } 58 .signal-card { background: #fafafa; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px 14px; margin-bottom: 6px; } 59 .signal-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: #8b5cf6; margin-bottom: 3px; } 60 .signal-value { font-size: 11.5px; color: #334155; } 61 ul { padding-left: 18px; } 62 li { margin-bottom: 4px; } 63 .header-row { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; } 64 .header-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid #e2e8f0; flex-shrink: 0; } 65 .header-info { flex: 1; min-width: 0; } 66 .report-badge { display: inline-block; background: #8b5cf6; color: #fff; font-size: 9px; font-weight: 600; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; } 67</style> 68<div class="page"> 69`;n+='<div class="report-badge">Intelligence Report</div>';const d=s==null?void 0:s.profile_image_url;if(d?(n+='<div class="header-row">',n+=`<img class="header-photo" src="${h(d)}" alt="${h(r)}" crossorigin="anonymous" />`,n+='<div class="header-info">',n+=`<h1>${h(r)}</h1>`,(f=s==null?void 0:s.current_roles)!=null&&f.length&&(n+=`<p class="subtitle">
69${s.current_roles.map(l=>`${h(l.role)} at ${h(l.company)}`).join(" · ")}</p>`),n+=`<p class="meta">Generated ${new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}</p>`,n+="</div></div>"):(n+=`<h1>${h(r)}</h1>`,(g=s==null?void 0:s.current_roles)!=null&&g.length&&(n+=`<p class="subtitle">${s.current_roles.map(l=>`${h(l.role)} at ${h(l.company)}`).join(" · ")}</p>`),n+=`<p class="meta">Generated ${new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}</p>`),o&&(n+="<h2>Recommended Approach</h2>",o.overall_strategy&&(n+=`<div class="summary">${h(o.overall_strategy)}</div>`),(o.best_channel||o.best_timing)&&(n+='<div class="two-col">',o.best_channel&&(n+=`<div><div class="fact-label">Best Channel</div><div class="fact-value">${h(o.best_channel)}</div></div>`),o.best_timing&&(n+=`<div><div class="fact-label">Best Timing</div><div class="fact-value">${h(o.best_timing)}</div></div>`),n+="</div>"),((y=o.dos)!=null&&y.length||(v=o.donts)!=null&&v.length)&&(n+='<div class="two-col" style="margin-top:10px;">',(k=o.dos)!=null&&k.length&&(n+=`<div><div class="fact-label">â Do</div><ul>${o.dos.map(l=>`<li>${h(l)}</li>`).join("")}</ul></div>`),(w=o.donts)!=null&&w.length&&(n+=`<div><div class="fact-label">â Don't</div><ul>${o.donts.map(l=>`<li>${h(l)}</li>`).join("")}</ul></div>`),n+="</div>"),(j=o.icebreakers)!=null&&j.length)){n+="<h3>Icebreakers</h3>";for(const l of o.icebreakers.slice(0,6))n+='<div class="icebreaker-card">',n+=`<div class="icebreaker-text">"${h(l.opener)}"</div>`,n+=`<div class="icebreaker-meta">${h(l.topic||"")}${l.source?` · ${h(l.source)}`:""}</div>`,n+="</div>"}if(i!=null&&i.communication_style){n+="<h2>Communication Style</h2>";const l=i.communication_style;n+='<div class="two-col">',l.tone&&(n+=`<div><div class="fact-label">Tone</div><div class="fact-value">${h(l.tone)}</div></div>`),l.preferred_format&&(n+=`<div><div class="fact-label">Preferred Format</div><div class="fact-value">${h(l.preferred_format)}</div></div>`),l.response_pattern&&(n+=`<div><div class="fact-label">Response Pattern</div><div class="fact-value">${h(l.response_pattern)}</div></div>`),l.formality_level&&(n+=`<div><div class="fact-label">Formality</div><div class="fact-value">${h(l.formality_level)}</div></div>`),n+="</div>",l.writing_patterns&&(n+=`<p class="narrative-p" style="font-size:11px;color:#64748b;margin-top:6px;">${h(l.writing_patterns)}</p>`)}if(i!=null&&i.personality_insights){n+="<h2>Personality Insights</h2>";const l=i.personality_insights;Array.isArray(l.motivations)&&l.motivations.length&&(n+=`<h3>Motivations</h3><div class="badge-row">${l.motivations.map(m=>`<span class="badge-purple">${h(m)}</span>`).join("")}</div>`),Array.isArray(l.values)&&l.values.length&&(n+=`<h3>Values</h3><div class="badge-row">${l.values.map(m=>`<span class="badge-purple">${h(m)}</span>`).join("")}</div>`),l.decision_making_style&&(n+=`<h3>Decision Making</h3><p class="narrative-p">${h(l.decision_making_style)}</p>`),l.risk_tolerance&&(n+=`<h3>Risk Tolerance</h3><p class="narrative-p">${h(l.risk_tolerance)}</p>`)}if(i!=null&&i.temporal_patterns){const l=i.temporal_patterns;n+='<h2>Temporal Patterns</h2><div class="two-col">',l.career_velocity&&(n+=`<div class="signal-card"><div class="signal-label">Career Velocity</div><div class="signal-value">${h(re(l.career_velocity))}</div></div>`),l.change_windows&&(n+=`<div class="signal-card"><div class="signal-label">Change Windows</div><div class="signal-value">${h(re(l.change_windows))}</div></div>`),l.activity_cycles&&(n+=`<div class="signal-card"><div class="signal-label">Activity Cycles</div><div class="signal-value">${h(re(l.activity_cycles))}</div></div>`),l.tenure_patterns&&(n+=`<div class="signal-card"><div class="signal-label">Tenure Patterns</div><div class="signal-value">${h(re(l.tenure_patterns))}</div></div>`),n+="</div>"}if(i!=null&&i.decision_environment){const l=i.decision_environment;n+='<h2>Decision Environment</h2><div class="two-col">',l.autonomy_level&&(n+=`<div class="signal-card"><div class="signal-label">Autonomy Level</div><div class="signal-value">${h(l.autonomy_level)}</div></div>`),l.stakeholder_complexity&&(n+=`<div class="signal-card"><div class="signal-label">Stakeholder Complexity</div><div class="signal-value">${h(l.stakeholder_complexity)}</div></div>`),l.budget_authority&&(n+=`<div class="signal-card"><div class="signal-label">Budget Authority</div><div class="signal-value">${h(l.budget_authority)}</div></div>`),l.decision_speed&&(n+=`<div class="signal-card"><div class="signal-label">Decision Speed</div><div class="signal-value">${h(l.decision_speed)}</div></div>`),n+="</div>"}if(i!=null&&i.influence_topology){const l=i.influence_topology;n+='<h2>Influence Topology</h2><div class="two-col">',l.network_position&&(n+=`<div class="signal-card"><div class="signal-label">Network Position</div><div class="signal-value">${h(l.network_position)}</div></div>`),l.influence_style&&(n+=`<div class="signal-card"><div class="signal-label">Influence Style</div><div class="signal-value">${h(l.influence_style)}</div></div>`),l.sphere_of_influence&&(n+=`<div class="signal-card"><div class="signal-label">
69Sphere</div><div class="signal-value">${h(l.sphere_of_influence)}</div></div>`),l.thought_leadership_reach&&(n+=`<div class="signal-card"><div class="signal-label">Thought Leadership</div><div class="signal-value">${h(l.thought_leadership_reach)}</div></div>`),n+="</div>"}if(i!=null&&i.psychographic_segmentation){const l=i.psychographic_segmentation;n+='<h2>Psychographic Profile</h2><div class="two-col">',l.primary_drive&&(n+=`<div class="signal-card"><div class="signal-label">Primary Drive (McClelland)</div><div class="signal-value">${h(l.primary_drive)}</div></div>`),l.secondary_drive&&(n+=`<div class="signal-card"><div class="signal-label">Secondary Drive</div><div class="signal-value">${h(l.secondary_drive)}</div></div>`),l.cognitive_style&&(n+=`<div class="signal-card"><div class="signal-label">Cognitive Style</div><div class="signal-value">${h(l.cognitive_style)}</div></div>`),l.information_processing&&(n+=`<div class="signal-card"><div class="signal-label">Info Processing</div><div class="signal-value">${h(l.information_processing)}</div></div>`),n+="</div>"}if(i!=null&&i.value_alignment){const l=i.value_alignment;n+="<h2>Value Alignment</h2>",Array.isArray(l.core_values)&&l.core_values.length&&(n+=`<div class="badge-row">${l.core_values.map(m=>`<span class="badge-purple">${h(m)}</span>`).join("")}</div>`),l.alignment_signals&&(n+=`<p class="narrative-p" style="font-size:11px;color:#64748b;margin-top:4px;">${h(re(l.alignment_signals))}</p>`),l.misalignment_risks&&(n+=`<p class="narrative-p" style="font-size:11px;color:#94a3b8;margin-top:2px;">${h(re(l.misalignment_risks))}</p>`)}if(i!=null&&i.risk_red_flags&&(Array.isArray(i.risk_red_flags)&&i.risk_red_flags.length||!Array.isArray(i.risk_red_flags)&&Object.keys(i.risk_red_flags).length)&&(n+="<h2>â Risk Red Flags</h2>",Array.isArray(i.risk_red_flags)?n+=`<ul>${i.risk_red_flags.map(l=>`<li>${h(typeof l=="string"?l:l.flag||JSON.stringify(l))}</li>`).join("")}</ul>`:n+=`<p class="narrative-p">${h(JSON.stringify(i.risk_red_flags))}</p>`),i!=null&&i.engagement_decay){const l=i.engagement_decay;n+='<h2>Engagement Decay Signals</h2><div class="two-col">',l.risk_level&&(n+=`<div class="signal-card"><div class="signal-label">Risk Level</div><div class="signal-value" style="text-transform:capitalize">${h(l.risk_level)}</div></div>`),l.re_engagement_strategy&&(n+=`<div class="signal-card"><div class="signal-label">Re-engagement</div><div class="signal-value">${h(l.re_engagement_strategy)}</div></div>`),n+="</div>",(z=l.warning_signs)!=null&&z.length&&(n+=`<div class="badge-row" style="margin-top:4px;">${l.warning_signs.map(m=>`<span class="badge">${h(m)}</span>`).join("")}</div>`)}const u=i==null?void 0:i.recruitment_intelligence;if(u){if(n+='<hr class="section-divider"><h2>Recruitment Intelligence</h2>',n+='<div class="two-col">',u.job_change_readiness){const m=u.job_change_readiness;n+='<div class="signal-card"><div class="signal-label">Change Readiness</div>',n+=`<div class="signal-value" style="text-transform:capitalize">${h(m.score||"N/A")}${m.change_window_open?" · Window Open":""}</div>`,(m.current_tenure_months||m.avg_historical_tenure_months)&&(n+=`<p style="font-size:10px;color:#64748b;margin-top:3px;">${m.current_tenure_months?`Current: ${m.current_tenure_months}mo`:""}${m.current_tenure_months&&m.avg_historical_tenure_months?" · ":""}${m.avg_historical_tenure_months?`Avg: ${m.avg_historical_tenure_months}mo`:""}</p>`),(W=m.evidence)!=null&&W.length&&(n+=`<p style="font-size:10px;color:#64748b;margin-top:2px;">${m.evidence.slice(0,3).map(b=>`⢠${h(b)}`).join("<br>")}</p>`),n+="</div>"}if(u.compensation_signals){const m=u.compensation_signals;n+='<div class="signal-card"><div class="signal-label">Compensation Signals</div>',n+='<div class="badge-row">',m.estimated_band&&(n+=`<span class="badge">${h(m.estimated_band)}</span>`),m.company_funding_stage&&m.company_funding_stage!=="unknown"&&(n+=`<span class="badge">${h(m.company_funding_stage)}</span>`),m.equity_likelihood&&m.equity_likelihood!=="unknown"&&(n+=`<span class="badge">Equity: ${h(m.equity_likelihood)}</span>`),n+="</div></div>"}if(u.cultural_fit_indicators){const m=u.cultural_fit_indicators;n+='<div class="signal-card"><div class="signal-label">Cultural Fit</div>',n+='<div class="badge-row">
69',m.company_size_preference&&(n+=`<span class="badge">${h(m.company_size_preference)}</span>`),m.work_style_preference&&m.work_style_preference!=="unknown"&&(n+=`<span class="badge">${h(m.work_style_preference)}</span>`),m.pace_preference&&(n+=`<span class="badge">${h(m.pace_preference)}</span>`),n+="</div>",(F=m.values_match_keywords)!=null&&F.length&&(n+=`<div class="badge-row">${m.values_match_keywords.slice(0,6).map(b=>`<span class="badge">${h(b)}</span>`).join("")}</div>`),n+="</div>"}if(u.passive_candidate_signals){const m=u.passive_candidate_signals;n+='<div class="signal-card"><div class="signal-label">Passive Candidate</div>',n+='<div class="badge-row">',m.visibility_appetite&&(n+=`<span class="badge">Visibility: ${h(m.visibility_appetite)}</span>`),m.recruiter_responsiveness_hint&&(n+=`<span class="badge">${h(m.recruiter_responsiveness_hint)}</span>`),n+="</div>";const b=[];m.conference_speaking&&b.push("Speaker"),m.open_source_contributions&&b.push("OSS Contributor"),m.content_creation_frequency&&m.content_creation_frequency!=="none"&&b.push(`Content: ${m.content_creation_frequency}`),b.length&&(n+=`<p style="font-size:10px;color:#64748b;">${b.join(" · ")}</p>`),n+="</div>"}n+="</div>";const l=u.advanced_candidate_patterns;if(l){if(n+='<h2>Advanced Candidate Patterns</h2><div class="two-col">',l.learning_trajectory&&(n+='<div class="signal-card"><div class="signal-label">Learning Trajectory</div>',l.learning_trajectory.direction&&(n+=`<div class="signal-value">${h(l.learning_trajectory.direction)}</div>`),l.learning_trajectory.signal_strength&&(n+=`<p style="font-size:10px;color:#64748b;">Signal: ${h(l.learning_trajectory.signal_strength)}</p>`),(c=l.learning_trajectory.recent_acquisitions)!=null&&c.length&&(n+=`<div class="badge-row">${l.learning_trajectory.recent_acquisitions.slice(0,5).map(m=>`<span class="badge">${h(m)}</span>`).join("")}</div>`),n+="</div>"),l.compensation_negotiation_style){const m=l.compensation_negotiation_style;n+='<div class="signal-card"><div class="signal-label">Negotiation Style</div>',m.pattern&&(n+=`<div class="signal-value" style="text-transform:capitalize">${h(m.pattern.replace(/-/g," "))}</div>`),m.optimizes_for&&(n+=`<p style="font-size:10px;color:#64748b;">Optimizes for: ${h(m.optimizes_for)}</p>`),(C=m.evidence)!=null&&C.length&&(n+=`<p style="font-size:10px;color:#64748b;">${m.evidence.slice(0,2).map(b=>`⢠${h(b)}`).join("<br>")}</p>`),n+="</div>"}if(l.org_lifecycle_preference){const m=l.org_lifecycle_preference;n+='<div class="signal-card"><div class="signal-label">Org Lifecycle Preference</div>',m.sweet_spot&&(n+=`<div class="signal-value" style="text-transform:capitalize">${h(m.sweet_spot.replace(/-/g," "))}</div>`),m.pattern_consistency&&(n+=`<p style="font-size:10px;color:#64748b;">Consistency: ${h(m.pattern_consistency)}</p>`),n+="</div>"}if(l.departure_patterns){const m=l.departure_patterns;n+='<div class="signal-card"><div class="signal-label">Departure Patterns</div>';const b=[];m.flight_risk_level&&b.push(`Flight risk: ${m.flight_risk_level}`),m.avg_tenure_before_departure_months&&b.push(`Avg departure: ${m.avg_tenure_before_departure_months}mo`),b.length&&(n+=`<div class="signal-value">${h(b.join(" · "))}</div>`),(Y=m.common_triggers)!=null&&Y.length&&(n+=`<div class="badge-row">${m.common_triggers.slice(0,4).map(ye=>`<span class="badge">${h(ye.replace(/-/g," "))}</span>`).join("")}</div>`),n+="</div>"}if(l.geographic_mobility){const m=l.geographic_mobility;n+='<div class="signal-card"><div class="signal-label">Geographic Mobility</div>',n+='<div class="badge-row">',m.relocation_history&&(n+=`<span class="badge">${h(m.relocation_history.replace(/-/g," "))}</span>`),m.remote_preference&&(n+=`<span class="badge">${h(m.remote_preference.replace(/-/g," "))}</span>`),m.willingness_to_relocate&&m.willingness_to_relocate!=="unknown"&&(n+=`<span class="badge">Relocate: ${h(m.willingness_to_relocate)}</span>`),n+="</div>",(q=m.timezone_experience)!=null&&q.length&&(n+=`<p style="font-size:10px;color:#64748b;">TZ: ${m.timezone_experience.join(", ")}</p>`),n+="</div>"}if(l.content_consumption_vs_creation){const m=l.content_consumption_vs_creation;n+='<div class="signal-card"><div class="signal-label">Content Behavior</div>',n+='<div class="badge-row">',m.engagement_pattern&&(n+=`<span class="badge">${h(m.engagement_pattern)}</span>`),m.creator_score&&(n+=`<span class="badge">Creator: ${h(m.creator_score)}</span>`),n+="</div>",(x=m.aspirational_topics)!=null&&x.length&&(n+=`<p style="font-size:10px;color:#64748b;">Aspirational: ${m.aspirational_topics.slice(0,4).join(", ")}</p>`),n+="</div>"}if(l.counter_offer_vulnerability){const m=l.counter_offer_vulnerability;n+='<div class="signal-card"><div class="signal-label">Counter-Offer Risk</div>',m.risk_level&&(n+=`<div class="signal-value" style="text-transform:capitalize">${h(m.risk_level)}</div>`),(D=m.factors)!=null&&D.length&&(n+=`<div class="badge-row">${m.factors.slice(0,4).map(b=>`<span class="badge">${h(b.replace(/-/g," "))}</span>`).join("")}</div>`),m.mitigation_strategy&&(n+=`<p style="font-size:10px;color:#64748b;font-style:italic;">${h(m.mitigation_strategy)}</p>`),n+="</div>"}if(l.team_building_dna){const m=l.team_building_dna;n+='<div class="signal-card"><div class="signal-label">Team-Building DNA</div>',n+='<div class="badge-row">',m.pattern&&(n+=`<span class="badge">${h(m.pattern.replace(/-/g," "))}</span>`),m.team_size_comfort&&(n+=`<span class="badge">${h(m.team_size_comfort)}</span>`),n+="</div>",m.hiring_philosophy&&(n+=`<p style="font-size:10px;color:#64748b;">${h(m.hiring_philosophy)}</p>`),n+="</div>"}n+="</div>"}}if((B=a==null?void 0:a.intelligence_signals)!=null&&B.length){n+='<hr class="section-divider"><h2>Intelligence Signals</h2>';for(const l of a.intelligence_signals)n+='<div class="signal-card">
69',n+=`<div class="signal-label">${h(l.category||l.type||"Signal")}</div>`,n+=`<div class="signal-value">${h(l.signal||l.description||re(l))}</div>`,l.confidence&&(n+=`<p style="font-size:10px;color:#94a3b8;margin-top:2px;">Confidence: ${h(l.confidence)}</p>`),n+="</div>"}return n+=`<div class="footer">Intelligence Report · ${h(r)} · Generated ${new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}</div>`,n+="</div>",n}async function Ms(t,a){var o;const s=$s(t,a),r=document.createElement("div");r.innerHTML=s;const i=r.querySelector(".header-photo");if(i!=null&&i.src)try{const d=await(await fetch(i.src,{mode:"cors"})).blob(),u=await new Promise(f=>{const g=new FileReader;g.onloadend=()=>f(g.result),g.readAsDataURL(d)});i.src=u}catch{i.remove()}Object.assign(r.style,{position:"fixed",top:"0",left:"0",width:"800px",background:"white",overflow:"hidden",height:"auto",opacity:"1",zIndex:"-1",pointerEvents:"none",display:"block",visibility:"visible",clipPath:"inset(0 0 0 0)"}),document.body.appendChild(r);try{const n=await Tt(()=>import("./html2pdf-BTknD3hk.js").then(f=>f.h),__vite__mapDeps([0,1,2])),d=n.default||n;(o=document.fonts)!=null&&o.ready&&await document.fonts.ready,await new Promise(f=>setTimeout(f,500));const u=r.scrollHeight||2e3;await d().set({margin:[10,10,10,10],filename:`${t.personName.replace(/\s+/g,"_")}_Intelligence_Report.pdf`,image:{type:"jpeg",quality:.98},html2canvas:{scale:2,useCORS:!0,allowTaint:!0,logging:!1,scrollX:0,scrollY:0,x:0,y:0,width:800,height:u,windowWidth:800,windowHeight:u,backgroundColor:"#ffffff",onclone:f=>{const g=f.body.querySelector(".page");g&&(g.style.visibility="visible",g.style.opacity="1")}},jsPDF:{unit:"mm",format:"a4",orientation:"portrait"},pagebreak:{mode:["css","legacy"]}}).from(r).save()}finally{document.body.removeChild(r)}}function Ds({profile:t,personName:a}){var n;const s=gt(),r=new Map;for(const d of t.current_roles||[])d.company&&r.set(d.company.toLowerCase(),{name:d.company,role:d.role,type:"current",details:d.details,status:"active"});for(const d of t.career_history||[])if(d.company){const u=d.company.toLowerCase();r.has(u)||r.set(u,{name:d.company,role:d.role,type:d.is_current?"current":"career",details:d.details,period:d.period})}for(const d of t.ventures_and_businesses||[])if(d.name){const u=d.name.toLowerCase(),f=r.get(u);(!f||f.type==="career")&&r.set(u,{name:d.name,role:d.role,type:"venture",details:d.details,status:d.status})}if((n=t.company_info)!=null&&n.current_company){const d=t.company_info.current_company.toLowerCase();r.has(d)||r.set(d,{name:t.company_info.current_company,role:"Associated",type:"current",details:t.company_info.description||void 0,status:"active"})}const i=Array.from(r.values());if(i.length===0)return null;const o={current:0,venture:1,career:2};return i.sort((d,u)=>o[d.type]-o[u.type]),e.jsxs(T,{children:[e.jsx(H,{className:"pb-3",children:e.jsxs(V,{className:"text-base flex items-center gap-2",children:[e.jsx(De,{className:"h-4 w-4"}),"Related Companies (",i.length,")"]})}),e.jsx(M,{className:"space-y-2",children:i.map((d,u)=>e.jsxs("button",{onClick:()=>s(`/companies?search=${encodeURIComponent(d.name)}`),className:"w-full text-left flex items-center gap-3 p-3 rounded-lg border border-border/50 hover:border-primary/30 hover:bg-muted/50 transition-colors group",children:[e.jsx("div",{className:"h-9 w-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:e.jsx(De,{className:"h-4 w-4 text-muted-foreground"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium truncate",children:d.name}),d.type==="current"&&e.jsx($,{variant:"default",className:"text-[10px] px-1.5 py-0",children:"Current"}),d.type==="venture"&&e.jsx($,{variant:"secondary",className:"text-[10px] px-1.5 py-0 capitalize",children:d.status||"venture"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground mt-0.5",children:[e.jsx(de,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:d.role}
69),d.period&&e.jsxs("span",{className:"text-muted-foreground/60",children:["· ",d.period]})]})]}),e.jsx(zt,{className:"h-4 w-4 text-muted-foreground/40 group-hover:text-primary transition-colors shrink-0"})]},u))})]})}const Os={new:{icon:We,color:"text-emerald-600 dark:text-emerald-400",bg:"bg-emerald-500/10",label:"New"},updated:{icon:Ne,color:"text-blue-600 dark:text-blue-400",bg:"bg-blue-500/10",label:"Updated"},removed:{icon:vt,color:"text-red-500 dark:text-red-400",bg:"bg-red-500/10",label:"Removed"},unchanged:{icon:yt,color:"text-muted-foreground",bg:"bg-muted/50",label:"Unchanged"}};function ut({entry:t}){const a=Os[t.status],s=a.icon,[r,i]=S.useState(!1),o=t.status!=="unchanged"&&(t.newValue||t.oldValue),n=e.jsxs("div",{className:`flex items-center gap-3 px-3 py-2 rounded-md ${a.bg} transition-colors`,children:[e.jsx(s,{className:`h-4 w-4 shrink-0 ${a.color}`}),e.jsx("span",{className:"flex-1 text-sm font-medium",children:t.label}),t.summary&&e.jsx("span",{className:`text-xs ${a.color}`,children:t.summary}),e.jsx($,{variant:"outline",className:`text-[10px] px-1.5 py-0 ${a.color} border-current/20`,children:a.label}),o&&e.jsx(Et,{className:`h-3 w-3 text-muted-foreground transition-transform ${r?"rotate-180":""}`})]});return o?e.jsxs(Qt,{open:r,onOpenChange:i,children:[e.jsx(Ut,{asChild:!0,children:e.jsx("button",{className:"w-full text-left",children:n})}),e.jsx(Jt,{children:e.jsx("div",{className:"ml-7 mt-1 mb-2 text-xs text-muted-foreground bg-muted/30 rounded p-2 max-h-40 overflow-auto",children:typeof t.newValue=="string"?e.jsxs("p",{className:"whitespace-pre-wrap",children:[t.newValue.slice(0,500),t.newValue.length>500?"â¦":""]}):e.jsx("pre",{className:"whitespace-pre-wrap",children:JSON.stringify(t.newValue,null,2).slice(0,800)})})})]}):n}function Ts({diff:t,onDismiss:a}){const{stats:s,enrichmentMode:r}=t,i=t.entries.filter(f=>f.status!=="unchanged"),o=t.entries.filter(f=>f.status==="unchanged"),[n,d]=S.useState(!1),u=s.newCount+s.updatedCount+s.removedCount;return e.jsxs(T,{className:"border-primary/20 shadow-md animate-fade-in",children:[e.jsxs(H,{
69className:"pb-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ha,{className:"h-5 w-5 text-primary"}),e.jsx(V,{className:"text-base",children:"Enrichment Complete"}),e.jsx($,{variant:"secondary",className:"text-xs",children:r==="delta"?"Quick Refresh":"Deep Enrich"})]}),e.jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,children:e.jsx(At,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs",children:[s.newCount>0&&e.jsxs("span",{className:"flex items-center gap-1 text-emerald-600 dark:text-emerald-400",children:[e.jsx(We,{className:"h-3 w-3"})," ",s.newCount," new"]}),s.updatedCount>0&&e.jsxs("span",{className:"flex items-center gap-1 text-blue-600 dark:text-blue-400",children:[e.jsx(Ne,{className:"h-3 w-3"})," ",s.updatedCount," updated"]}),s.removedCount>0&&e.jsxs("span",{className:"flex items-center gap-1 text-red-500 dark:text-red-400",children:[e.jsx(vt,{className:"h-3 w-3"})," ",s.removedCount," removed"]}),s.unchangedCount>0&&e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[e.jsx(yt,{className:"h-3 w-3"})," ",s.unchangedCount," unchanged"]})]})]}),e.jsx(M,{className:"space-y-1.5",children:u===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No changes detected â profile is already up to date."}):e.jsxs(e.Fragment,{children:[i.map(f=>e.jsx(ut,{entry:f},f.key)),o.length>0&&e.jsxs("button",{onClick:()=>d(!n),className:"w-full text-xs text-muted-foreground hover:text-foreground text-center py-2 transition-colors",children:[n?"Hide":"Show"," ",o.length," unchanged section",o.length>1?"s":""]}),n&&o.map(f=>e.jsx(ut,{entry:f},f.key))]})})]})}const zs={TypeScript:"bg-blue-500",JavaScript:"bg-yellow-400",Python:"bg-emerald-500",Rust:"bg-orange-600",Go:"bg-cyan-500",Java:"bg-red-500","C++":"bg-pink-600",C:"bg-slate-500",Ruby:"bg-red-600",Swift:"bg-orange-500",Kotlin:"bg-violet-500",Dart:"bg-sky-400",PHP:"bg-indigo-400",Shell:"bg-green-600",HTML:"bg-orange-400",CSS:"bg-purple-500"};function ht(t){return zs[t]||"bg-muted-foreground"}function As({profile:t}){var o,n;const a=t.github_activity;if(!a||!((o=a.notable_repos)!=null&&o.length)&&!((n=a.top_languages)!=null&&n.length))return null;const s=a.notable_repos||[],r=a.top_languages||[],i=s.reduce((d,u)=>d+(u.stars||0),0);return e.jsxs(T,{children:[e.jsx(H,{className:"pb-3",children:e.jsxs(V,{className:"text-sm flex items-center gap-2",children:[e.jsx(et,{className:"h-4 w-4"}),"GitHub Activity",a.username&&e.jsxs("a",{href:`https://github.com/${a.username}`,target:"_blank",rel:"noopener noreferrer",className:"ml-auto text-xs text-primary hover:underline inline-flex items-center gap-1 font-normal",children:["@",a.username," ",e.jsx(fa,{className:"h-3 w-3"})]})]})}),e.jsxs(M,{className:"space-y-4",children:[r.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(Rt,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:"Top Languages"})]}),e.jsx("div",{className:"flex h-2.5 rounded-full overflow-hidden bg-muted",children:r.map((d,u)=>e.jsx("div",{className:`h-full ${ht(d)} transition-all`,style:{width:`${Math.max(100/r.length,8)}%`},title:d},d))}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.map(d=>e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${ht(d)}`}),e.jsx("span",{className:"text-muted-foreground",children:d})]},d))})]}),(i>0||s.length>0)&&e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[s.length>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(et,{className:"h-3 w-3"}),s.length," notable repos"]}),i>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(tt,{className:"h-3 w-3 text-yellow-500"}),i.toLocaleString()," total stars"]})]}),s.length>0&&e.jsx("div",{className:"space-y-2",children:s.slice(0,6).map(d=>e.jsxs("div",{className:"flex items-start gap-3 p-2 rounded-md bg-muted/40 hover:bg-muted/60 transition-colors",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[d.url?e.jsx("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-primary hover:underline truncate",children:d.name}):e.jsx("span",{className:"text-sm font-medium truncate",children:d.name}),d.language&&e.jsx($,{variant:"outline",className:"text-[10px] px-1.5 py-0 shrink-0",children:d.language})]}),d.description&&e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-1",children:d.description})]}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[d.stars>0&&e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(tt,{className:"h-3 w-3"})," ",d.stars]}),(d.forks??0)>0&&e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(ja,{className:"h-3 w-3"})," ",d.forks]})]})]},d.name))}),a.tech_stack_signals&&a.tech_stack_signals.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Tech Stack Signals"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.tech_stack_signals.map((d,u)=>e.jsx($,{variant:"secondary",className:"text-xs",children:d},u))})]}),a.open_source_contributions&&e.jsx("p",{className:"text-xs text-muted-foreground border-t pt-2",children:a.open_source_contributions})]})]})}function Es({savedProfileId:t,profileData:a}){const{contacts:s,isLoading:r,saveMultipleContacts:i,deleteContact:o}=ga(t),[n,d]=S.useState(!1),u=(a==null?void 0:a.network_and_associations)||[],f=async()=>
69{if(u.length!==0){d(!0);try{const g=new Set(s.map(v=>v.name.toLowerCase())),y=u.filter(v=>{var k;return!g.has((k=v.name)==null?void 0:k.toLowerCase())}).map(v=>({saved_profile_id:t,company_id:null,name:v.name,relationship:v.relationship||null,context:v.context||null,role:null,company:null,linkedin_url:null,email:null,notes:null}));if(y.length===0){O.info("All contacts already imported");return}await i(y)}catch(g){console.error("Import error:",g),O.error("Failed to import contacts")}finally{d(!1)}}};return e.jsxs(T,{children:[e.jsx(H,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(V,{className:"text-sm flex items-center gap-2",children:[e.jsx(we,{className:"h-4 w-4 text-primary"}),"Contacts (",s.length,")"]}),u.length>0&&e.jsxs(R,{variant:"outline",size:"sm",className:"gap-1.5 text-xs",onClick:f,disabled:n,children:[e.jsx(ka,{className:"h-3.5 w-3.5"}),n?"Importingâ¦":`Import from Profile (${u.length})`]})]})}),e.jsx(M,{children:r?e.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"Loading contactsâ¦"}):s.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(we,{className:"h-8 w-8 mx-auto mb-2 opacity-30"}),e.jsx("p",{className:"text-sm",children:"No contacts saved for this profile yet"}),u.length>0&&e.jsx("p",{className:"text-xs mt-1",children:'Click "Import from Profile" to add network associations'})]}):e.jsx("div",{className:"space-y-2",children:s.map(g=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border hover:bg-muted/30 transition-colors group",children:[e.jsx("div",{className:"h-9 w-9 rounded-full bg-muted flex items-center justify-center shrink-0",children:e.jsx(we,{className:"h-4 w-4 text-muted-foreground"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:g.name}),g.relationship&&e.jsx($,{variant:"outline",className:"text-[10px] capitalize",children:g.relationship})]}),g.role&&e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1 mt-0.5",children:[e.jsx(de,{className:"h-3 w-3"})," ",g.role,g.company&&e.jsxs("span",{children:[" at ",g.company]})]}),g.context&&e.jsx("p",{className:"text-xs text-muted-foreground/70 mt-0.5",children:g.context}),e.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[g.email&&e.jsxs("a",{href:`mailto:${g.email}`,className:"text-xs text-primary hover:underline flex items-center gap-0.5",children:[e.jsx(bt,{className:"h-3 w-3"})," ",g.email]}),g.linkedin_url&&e.jsxs("a",{href:g.linkedin_url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline flex items-center gap-0.5",children:[e.jsx(Oe,{className:"h-3 w-3"})," LinkedIn"]})]})]}),e.jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:()=>o(g.id),children:e.jsx(pt,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-destructive"})})]},g.id))})})]})}function ge(t){if(!t)return null;const a=String(t).match(/(\d{4})/);return a?{year:a[1],sortKey:parseInt(a[1])}:null}const Rs={role:{icon:de,color:"bg-primary/10 text-primary"},venture:{icon:Kt,color:"bg-amber-500/10 text-amber-600 dark:text-amber-400"},education:{icon:Zt,color:"bg-blue-500/10 text-blue-600 dark:text-blue-400"},achievement:{icon:ea,color:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400"}};function Ws({profileData:t}){const a=S.useMemo(()=>{const s=[],r=t;return r&&((r.career_history||[]).forEach(i=>{const o=ge(i.start_date||i.dates);if(!o)return;const n=ge(i.end_date);s.push({year:o.year,sortKey:o.sortKey,title:i.role||"Unknown Role",subtitle:i.company,type:"role",isCurrent:i.is_current,duration:i.is_current?`${o.year} â Present`:n?`${o.year} â ${n.year}`:o.year})}),(r.ventures_and_businesses||[]).forEach(i=>{const o=ge(i.founded||i.start_date||i.year);o&&s.push({year:o.year,sortKey:o.sortKey,title:i.name||i.company||"Venture",subtitle:i.role||i.description,type:"venture",isCurrent:i.status==="active",duration:i.status==="active"?`${o.year} â Present`:o.year})}
69),(r.education||[]).forEach(i=>{const o=ge(i.graduation_year||i.year||i.dates);o&&s.push({year:o.year,sortKey:o.sortKey,title:i.degree||i.qualification||"Education",subtitle:i.institution||i.school,type:"education"})}),(r.achievements||[]).slice(0,3).forEach(i=>{const o=ge(i.year||i.date);o&&s.push({year:o.year,sortKey:o.sortKey,title:i.title||i.name||"Achievement",subtitle:i.description,type:"achievement"})}),s.sort((i,o)=>o.sortKey-i.sortKey)),s},[t]);return a.length<2?null:e.jsxs(T,{children:[e.jsx(H,{className:"pb-3",children:e.jsxs(V,{className:"text-sm flex items-center gap-2",children:[e.jsx(de,{className:"h-4 w-4 text-muted-foreground"}),"Career Timeline"]})}),e.jsx(M,{children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-[15px] top-2 bottom-2 w-px bg-border"}),e.jsx("div",{className:"space-y-4",children:a.map((s,r)=>{const i=Rs[s.type],o=i.icon;return e.jsxs("div",{className:"relative flex gap-3 pl-0",children:[e.jsx("div",{className:`relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border ${i.color} ${s.isCurrent?"ring-2 ring-primary/30":""}`,children:e.jsx(o,{className:"h-3.5 w-3.5"})}),e.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("p",{className:"text-sm font-medium leading-tight",children:s.title}),s.isCurrent&&e.jsx($,{variant:"default",className:"text-[9px] h-4 px-1.5",children:"Current"})]}),s.subtitle&&e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-1",children:s.subtitle}),e.jsx("p",{className:"text-[11px] text-muted-foreground/70 mt-0.5",children:s.duration||s.year})]})]},r)})})]})})]})}function Fs({sourceCount:t,dimensionsPct:a,onReResearch:s,isEnriching:r}){return t<15||a<50?e.jsx(T,{className:"border-amber-500/40 bg-amber-500/5",children:e.jsxs(M,{className:"py-4 flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(pe,{className:"h-5 w-5 text-amber-500 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Thin Profile Detected"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t<15?`Only ${t} sources found (15+ recommended for reliable intelligence).`:`Profile completeness is ${a}% â key dimensions are missing.`," ","Re-research with additional context for better results."]})]})]}),e.jsxs(R,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0 border-amber-500/40 text-amber-600 hover:bg-amber-500/10",onClick:s,disabled:r,children:[e.jsx(Ne,{className:`h-3.5 w-3.5 ${r?"animate-spin":""}`}),r?"Researchingâ¦":"Deep Re-Research"]})]})}):null}const Ls={linkedin:{label:"LinkedIn (verified)",weight:3,color:"text-emerald-600 dark:text-emerald-400",icon:_e},github:{label:"GitHub (verified)",weight:3,color:"text-emerald-600 dark:text-emerald-400",icon:_e},crunchbase:{label:"Business Data (verified)",weight:3,color:"text-emerald-600 dark:text-emerald-400",icon:_e},news:{label:"News (editorial)",weight:2,color:"text-blue-600 dark:text-blue-400",icon:xe},firecrawl:{label:"Web Scrape (unverified)",weight:1,color:"text-amber-600 dark:text-amber-400",icon:Te},perplexity:{label:"AI Search (synthesized)",weight:1,color:"text-amber-600 dark:text-amber-400",icon:Te},platform:{label:"Platforms (mixed)",weight:2,color:"text-blue-600 dark:text-blue-400",icon:xe},twitter:{label:"Twitter/X (self-reported)",weight:2,color:"text-blue-600 dark:text-blue-400",icon:xe}};function qs({sources:t,sourceCounts:a}){const{score:s,tierBreakdown:r}=S.useMemo(()=>{if(!a)return{score:0,tierBreakdown:[]};let d=0,u=0;const f=[];for(const[v,k]of Object.entries(a)){const w=typeof k=="number"?k:0;if(w===0)continue;const j=Ls[v]||{label:v,weight:1,color:"text-muted-foreground",icon:xe};d+=j.weight*w,u+=w,f.push({label:j.label,count:w,tier:j})}const g=u*3,y=g>0?Math.round(d/g*100):0;return f.sort((v,k)=>k.tier.weight-v.tier.weight),{score:y,tierBreakdown:f}},[a]);if(!a||r.length===0)return null;const i=s>=70?"High Confidence":s>=45?"Moderate Confidence":"Low Confidence",o=s>=70?"text-emerald-600 dark:text-emerald-400":s>
69=45?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400",n=s>=70?_e:s>=45?xe:Te;return e.jsxs(T,{children:[e.jsx(H,{className:"pb-2",children:e.jsxs(V,{className:"text-sm flex items-center gap-2",children:[e.jsx(n,{className:`h-4 w-4 ${o}`}),"Source Quality"]})}),e.jsxs(M,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:`text-2xl font-bold ${o}`,children:[s,"%"]}),e.jsx($,{variant:"outline",className:`text-xs ${o}`,children:i})]}),e.jsx(Ae,{delayDuration:200,children:e.jsx("div",{className:"space-y-1.5",children:r.map((d,u)=>{const f=d.tier.icon;return e.jsxs(ee,{children:[e.jsx(te,{asChild:!0,children:e.jsxs("div",{className:"flex items-center justify-between text-sm cursor-help",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{className:`h-3.5 w-3.5 ${d.tier.color}`}),e.jsx("span",{className:"text-xs",children:d.label})]}),e.jsx("span",{className:"text-xs font-medium",children:d.count})]})}),e.jsx(ae,{side:"left",className:"text-xs max-w-[200px]",children:d.tier.weight===3?"Primary source â verified, high reliability":d.tier.weight===2?"Secondary source â editorially reviewed or self-reported":"Synthesized or scraped â use with caution"})]},u)})})})]})]})}function ce({label:t,value:a,color:s}){const r={green:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20",amber:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",red:"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20",blue:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",muted:"bg-muted text-muted-foreground border-border"};return e.jsxs("div",{className:"flex flex-col items-center gap-1 min-w-[100px]",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-medium",children:t}),e.jsx($,{variant:"outline",className:`text-xs font-semibold capitalize ${r[s]}`,children:a})]})}function Is(t){var r,i,o,n,d,u,f,g,y,v,k,w,j,z,W,F,c;const a=[t==null?void 0:t.summary,(r=t==null?void 0:t.career_history)==null?void 0:r.length,(i=t==null?void 0:t.education)==null?void 0:i.length,(o=t==null?void 0:t.skills_and_expertise)==null?void 0:o.length,(n=t==null?void 0:t.network_and_associations)==null?void 0:n.length,(d=t==null?void 0:t.personal_details)==null?void 0:d.location,(f=(u=t==null?void 0:t.contact_info)==null?void 0:u.emails)==null?void 0:f.length,((g=t==null?void 0:t.social_links)==null?void 0:g.twitter)||((y=t==null?void 0:t.social_links)==null?void 0:y.github),(v=t==null?void 0:t.topics_of_interest)==null?void 0:v.length,(k=t==null?void 0:t.recent_activity)==null?void 0:k.length,(w=t==null?void 0:t.ventures_and_businesses)==null?void 0:w.length,(j=t==null?void 0:t.company_info)==null?void 0:j.current_company,(z=t==null?void 0:t.personal_interests)==null?void 0:z.length,(W=t==null?void 0:t.achievements)==null?void 0:W.length,(F=t==null?void 0:t.funding_and_financials)==null?void 0:F.length,(c=t==null?void 0:t.media_and_content)==null?void 0:c.length],s=a.filter(Boolean).length;return Math.round(s/a.length*100)}function Ys({profileData:t,analysisData:a,sources:s,sourceCounts:r}){var F,c,C,Y,q,x,D,B;const i=a==null?void 0:a.behavioral_profile,o=i==null?void 0:i.recruitment_intelligence,n=((F=o==null?void 0:o.job_change_readiness)==null?void 0:F.score)||"unknown",d=((c=i==null?void 0:i.engagement_patterns)==null?void 0:c.activity_level)||"unknown",u=(((C=t==null?void 0:t.network_and_associations)==null?void 0:C.length)||0)+(((Y=t==null?void 0:t.organization_memberships)==null?void 0:Y.length)||0),f=((x=(q=i==null?void 0:i.recruitment_intelligence)==null?void 0:q.passive_candidate_signals)==null?void 0:x.content_creation_frequency)||"unknown",g=Is(t),y=((t==null?void 0:t.recent_activity)||[]).map(l=>l.date).filter(Boolean).map(l=>new Date(l).getTime()).filter(l=>!isNaN(l)),v=y.length>0?new Date(Math.max(...y)):null,k=v?`${Math.round((Date.now()-v.getTime())/(1e3*60*60*24))}d ago`:"N/A",w=n==="high"?"green":n==="medium"?"amber":n==="low"?"red":"muted",j=d==="high"||d==="very active"?"green":d==="moderate"||d==="active"?"amber":"muted",z=f==="prolific"||f==="regular"?"green":f==="occasional"?"amber":"muted",W=g>=75?"green":g>=50?"amber":"red";return!a&&!t?null:e.jsx(T,{className:"border-primary/10 bg-gradient-to-r from-primary/[0.02] to-transparent",children:e.jsx(M,{className:"py-4 px-6",children:e.jsx(Ae,{children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs(ee,{children:[e.jsx(te,{children:e.jsx(ce,{label:"Change Readiness",value:n,color:w})}),e.jsx(ae,{className:"max-w-xs text-xs",children:((B=(D=o==null?void 0:o.job_change_readiness)==null?void 0:D.evidence)==null?void 0:B[0])||"Based on tenure patterns and activity signals"})]}),e.jsxs(ee,{children:[e.jsx(te,{children:e.jsx(ce,{label:"Engagement",value:d,color:j})}),e.jsx(ae,{className:"text-xs",children:"Public content and social media activity level"})]}),e.jsxs(ee,{children:[e.jsx(te,{children:e.jsx(ce,{label:"Network",value:`${u} connections`,color:u>10?"green":u>3?"amber":"muted"})}),e.jsx(ae,{className:"text-xs",children:"Known professional connections and org memberships"})]}),e.jsxs(ee,{children:[e.jsx(te,{children:e.jsx(ce,{label:"Content Signal",value:f,color:z})}),e.jsx(ae,{className:"text-xs",children:"Frequency of original content creation"})]}),e.jsxs(ee,{children:[e.jsx(te,{children:e.jsx(ce,{label:"Data Completeness",value:`${g}%`,color:W})}),e.jsx(ae,{className:"text-xs",children:"Percentage of profile data fields populated"})]}),e.jsxs(ee,{children:[e.jsx(te,{children:e.jsx(ce,{label:"Last Active",value:k,color:v&&Date.now()-v.getTime()<90*24*60*60*1e3?"green":"muted"})}),e.jsx(ae,{className:"text-xs",children:"Most recent public activity detected"})]})]})})})})}const Me=[{value:"replied",label:"Replied",icon:Re,color:"text-emerald-500"},{value:"no_response",label:"No Response",icon:ya,color:"text-muted-foreground"},{value:"meeting_booked",label:"Meeting Booked",icon:jt,color:"text-primary"},{value:"connected",label:"Connected",icon:xa,color:"text-blue-500"},{value:"referred",label:"Referred",icon:_a,color:"text-amber-500"},{value:"declined",label:"Declined",icon:Na,color:"text-destructive"}],Bs=[{value:"linkedin",label:"LinkedIn"},{value:"email",label:"Email"},{value:"phone",label:"Phone"},{value:"in_person",label:"In Person"},{value:"other",label:"Other"}];function Hs({savedProfileId:t}){const{user:a}=Ee(),[s,r]=S.useState([]),[i,o]=S.useState(!0),[n,d]=S.useState(!1),[u,f]=S.useState(!1),[g,y]=S.useState(""),[v,k]=S.useState(""),[w,j]=S.useState(""),[z,W]=S.useState($e(new Date,"yyyy-MM-dd"));S.useEffect(()=>{a!=null&&a.id&&F()},[a==null?void 0:a.id,t]);const F=async()=>{const{data:x,error:D}=await I.from("outreach_outcomes").select("*").eq("saved_profile_id",t).eq("user_id",a.id).order("outreach_date",{ascending:!1});D||r(x||[]),o(!1)},c=async()=>
69{if(!(!g||!(a!=null&&a.id))){d(!0);try{const{error:x}=await I.from("outreach_outcomes").insert({user_id:a.id,saved_profile_id:t,outcome_type:g,channel:v||null,notes:w.trim()||null,outreach_date:z});if(x)throw x;O.success("Outcome logged!"),y(""),k(""),j(""),W($e(new Date,"yyyy-MM-dd")),f(!1),F()}catch(x){console.error(x),O.error("Failed to log outcome")}finally{d(!1)}}},C=async x=>{const{error:D}=await I.from("outreach_outcomes").delete().eq("id",x);if(D){O.error("Failed to delete");return}r(B=>B.filter(l=>l.id!==x)),O.success("Outcome removed")},Y=x=>Me.find(D=>D.value===x)||Me[0],q={total:s.length,replied:s.filter(x=>x.outcome_type==="replied").length,meetings:s.filter(x=>x.outcome_type==="meeting_booked").length,responseRate:s.length>0?Math.round(s.filter(x=>!["no_response"].includes(x.outcome_type)).length/s.length*100):0};return e.jsxs("div",{className:"space-y-4",children:[s.length>0&&e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[{label:"Total Outreach",value:q.total,icon:Se},{label:"Replies",value:q.replied,icon:Re},{label:"Meetings",value:q.meetings,icon:jt},{label:"Response Rate",value:`${q.responseRate}%`,icon:ze}].map(x=>e.jsx(T,{children:e.jsxs(M,{className:"py-3 px-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1",children:[e.jsx(x.icon,{className:"h-3.5 w-3.5"}),x.label]}),e.jsx("p",{className:"text-lg font-semibold",children:x.value})]})},x.label))}),e.jsxs(T,{children:[e.jsx(H,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(V,{className:"text-sm flex items-center gap-2",children:[e.jsx(Se,{className:"h-4 w-4 text-primary"}),"Outreach Outcomes"]}),e.jsxs(R,{variant:u?"secondary":"default",size:"sm",className:"gap-1.5 text-xs",onClick:()=>f(!u),children:[e.jsx(We,{className:"h-3.5 w-3.5"}),u?"Cancel":"Log Outcome"]})]})}),u&&e.jsxs(M,{className:"pt-0 pb-4 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsxs(st,{value:g,onValueChange:y,children:[e.jsx(nt,{children:e.jsx(rt,{placeholder:"Outcome *"})}),e.jsx(it,{children:Me.map(x=>e.jsx(lt,{value:x.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(x.icon,{className:`h-3.5 w-3.5 ${x.color}`}),x.label]})},x.value))})]}),e.jsxs(st,{value:v,onValueChange:k,children:[e.jsx(nt,{children:e.jsx(rt,{placeholder:"Channel"})}),e.jsx(it,{children:Bs.map(x=>e.jsx(lt,{value:x.value,children:x.label},x.value))})]}),e.jsx(xt,{type:"date",value:z,onChange:x=>W(x.target.value)})]}),e.jsx(It,{placeholder:"Notes (optional) â what was the context, key takeaways?",value:w,onChange:x=>j(x.target.value),rows:2,className:"resize-none"}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(R,{onClick:c,disabled:!g||n,size:"sm",className:"gap-1.5",children:[n?e.jsx(J,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ze,{className:"h-3.5 w-3.5"}),"Save Outcome"]})}),e.jsx(wt,{})]}),e.jsx(M,{className:"pt-0",children:i?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(J,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):s.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Se,{className:"h-8 w-8 mx-auto mb-2 text-muted-foreground/30"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No outreach logged yet"}),e.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"Track your interactions to build a feedback loop"})]}):e.jsx("div",{className:"space-y-2",children:s.map(x=>{const D=Y(x.outcome_type),B=D.icon;return e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border p-3 group hover:bg-muted/30 transition-colors",children:[e.jsx(B,{className:`h-4 w-4 mt-0.5 shrink-0 ${D.color}`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-sm font-medium",children:D.label}),x.channel&&e.jsx($,{variant:"outline",className:"text-[10px] capitalize",children:x.channel.replace("_"," ")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:$e(new Date(x.outreach_date),"MMM d, yyyy")})]}),x.notes&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:x.notes})]}),e.jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:()=>C(x.id),children:e.jsx(pt,{className:"h-3.5 w-3.5 text-destructive"})})]},x.id)})})})]})]})}function Vs(t){const{user:a}=Ee();return Yt({queryKey:["profile_claims",t],queryFn:async()=>
69{if(!(a!=null&&a.id)||!t)return[];const{data:s,error:r}=await I.from("profile_claims").select("*").eq("saved_profile_id",t).eq("user_id",a.id).order("claim_type",{ascending:!0}).order("confidence",{ascending:!1});if(r)throw r;return s||[]},enabled:!!(a!=null&&a.id)&&!!t})}const Gs={current_role:"bg-primary/10 text-primary",career_history:"bg-blue-500/10 text-blue-600",education:"bg-emerald-500/10 text-emerald-600",venture:"bg-violet-500/10 text-violet-600",funding:"bg-amber-500/10 text-amber-600",social_link:"bg-cyan-500/10 text-cyan-600",skill:"bg-pink-500/10 text-pink-600",contact_info:"bg-orange-500/10 text-orange-600",company_intel:"bg-indigo-500/10 text-indigo-600",personal_detail:"bg-teal-500/10 text-teal-600",ai_extracted:"bg-purple-500/10 text-purple-600",interest:"bg-lime-500/10 text-lime-600",achievement:"bg-rose-500/10 text-rose-600"};function Xs({confidence:t,isStale:a}){const s=t??0;return a?e.jsx(Ae,{children:e.jsxs(ee,{children:[e.jsx(te,{children:e.jsxs($,{variant:"outline",className:"text-[10px] gap-1 border-amber-500/40 text-amber-600",children:[e.jsx(pe,{className:"h-3 w-3"}),"Stale"]})}),e.jsx(ae,{children:e.jsx("p",{children:"This claim hasn't been verified in 90+ days"})})]})}):s>=.8?e.jsxs($,{variant:"outline",className:"text-[10px] gap-1 border-emerald-500/40 text-emerald-600",children:[e.jsx(ze,{className:"h-3 w-3"}),Math.round(s*100),"%"]}):e.jsxs($,{variant:"outline",className:"text-[10px] gap-1 border-muted-foreground/40",children:[e.jsx(Nt,{className:"h-3 w-3"}),Math.round(s*100),"%"]})}function ft(t){if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t))return t.join(", ");if(typeof t=="object"&&t!==null){const a=[];for(const[s,r]of Object.entries(t))r&&typeof r=="string"?a.push(`${s}: ${r}`):r&&typeof r!="object"&&a.push(`${s}: ${r}`);return a.join(" · ")||JSON.stringify(t)}return String(t)}function Qs({savedProfileId:t}){const{data:a,isLoading:s}=Vs(t),[r,i]=S.useState(""),o=S.useMemo(()=>{if(!a)return{};const u=r.toLowerCase(),f=u?a.filter(y=>{var v;return y.claim_type.toLowerCase().includes(u)||((v=y.claim_key)==null?void 0:v.toLowerCase().includes(u))||ft(y.claim_value).toLowerCase().includes(u)}):a,g={};for(const y of f){const v=y.claim_type||"other";g[v]||(g[v]=[]),g[v].push(y)}return g},[a,r]);if(s)return e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(J,{className:"h-6 w-6 animate-spin text-primary"})});if(!(a!=null&&a.length))return e.jsx(T,{className:"border-dashed",children:e.jsxs(M,{className:"py-12 text-center",children:[e.jsx(Nt,{className:"h-10 w-10 mx-auto mb-3 text-muted-foreground/30"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No claims extracted yet. Claims are generated automatically when a profile is saved or enriched."})]})});const n=a.filter(u=>u.is_stale).length,d=Object.keys(o).sort();return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs($,{variant:"outline",children:[a.length," claims"]}),n>0&&e.jsxs($,{variant:"outline",className:"border-amber-500/40 text-amber-600 text-xs gap-1",children:[e.jsx(pe,{className:"h-3 w-3"}),n," stale"]})]}),e.jsxs("div",{className:"relative w-64",children:[e.jsx(Bt,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(xt,{placeholder:"Filter claimsâ¦",value:r,onChange:u=>i(u.target.value),className:"pl-8 h-8 text-sm"})]})]}),e.jsx("div",{className:"space-y-4",children:d.map(u=>e.jsxs(T,{children:[e.jsx(H,{className:"pb-2 pt-4 px-4",children:e.jsxs(V,{className:"text-xs uppercase tracking-wider flex items-center gap-2",children:[e.jsx($,{className:`text-[10px] ${Gs[u]||"bg-muted text-muted-foreground"}`,children:u.replace(/_/g," ")}),e.jsx("span",{className:"text-muted-foreground font-normal",children:o[u].length})]})}),e.jsx(M,{className:"px-4 pb-4",children:e.jsx("div",{className:"space-y-2",children:o[u].map(f=>e.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-md border px-3 py-2 text-sm",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[f.claim_key&&e.jsxs("span",{className:"font-medium text-foreground mr-1.5",children:[f.claim_key.replace(/_/g," "),":"]}),e.jsx("span",{className:"text-muted-foreground",children:ft(f.claim_value)}),f.source_label&&e.jsxs("span",{className:"text-[10px] text-muted-foreground
69/60 ml-2",children:["via ",f.source_label]})]}),e.jsx(Xs,{confidence:f.confidence,isStale:f.is_stale})]},f.id))})})]},u))})]})}function Mn(){var Fe,Le,qe,Ie,Ye,Be,He,Ve,Ge,Xe,Qe,Ue;Wt("Profile Detail",{noindex:!0}),Ft();const{id:t}=Lt(),{user:a}=Ee(),{openAgent:s}=qt(),r=gt(),[i,o]=S.useState(!0),[n,d]=S.useState(null),[u,f]=S.useState(!1),[g,y]=S.useState(!1),[v,k]=S.useState(null),[w,j]=S.useState(!1),[z,W]=S.useState(!1),{saveProfileAsync:F}=Ht(),c=(n==null?void 0:n.profile_data)||{},C=n==null?void 0:n.analysis_data;S.useEffect(()=>{!(a!=null&&a.id)||!t||(async()=>{o(!0);const{data:p,error:_}=await I.from("saved_profiles").select("*").eq("id",t).eq("user_id",a.id).single();if(_){O.error("Profile not found"),r("/saved-profiles");return}d(p),o(!1)})()},[a==null?void 0:a.id,t]);const Y=async()=>{if(n!=null&&n.profile_data){f(!0);try{const{data:p,error:_}=await I.functions.invoke("profile-analyze",{body:{profile:n.profile_data,personName:n.person_name,sources:n.sources||[]}});if(_)throw _;if(p!=null&&p.success){const P={...p.analysis,analyzed_at:new Date().toISOString()};await I.from("saved_profiles").update({analysis_data:P}).eq("id",n.id),d({...n,analysis_data:P}),O.success("Behavioral analysis complete!")}else O.error((p==null?void 0:p.error)||"Analysis failed")}catch(p){console.error("Analysis error:",p),O.error("Failed to analyze profile.")}finally{f(!1)}}},q=async()=>{if(!n||!a)return;y(!0),k(null);const p=JSON.parse(JSON.stringify(n.profile_data||{})),_=n.enriched_at,P=_?(Date.now()-new Date(_).getTime())/(1e3*60*60*24):null,A=P!==null&&P<=7;O.info(A?"Running delta enrichment â filling gaps & refreshing recent activityâ¦":"Running full deep research â profile is stale or newâ¦");try{const L=new AbortController,se=setTimeout(()=>L.abort(),5*60*1e3),ne="https://hlbzfgfesepixgkrpkts.supabase.co",U=(await I.auth.getSession()).data.session,G=await fetch(`${ne}/functions/v1/profile-research`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${U==null?void 0:U.access_token}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImhsYnpmZ2Zlc2VwaXhna3Jwa3RzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjU1ODM2NzYsImV4cCI6MjA4MTE1OTY3Nn0.0bwFVb5RKtm3B1jnvW7ZXFIxnPSmvxe-QfZIaIhCBaE"},body:JSON.stringify({personName:n.person_name,linkedinUrl:n.linkedin_url||void 0,existingProfile:n.profile_data,enrichedAt:n.enriched_at}),signal:L.signal});if(clearTimeout(se),!G.ok)throw new Error(`Research failed with status ${G.status}`);const E=await G.json();if(E!=null&&E.success&&E.profile){const Ce=E.enrichment_mode==="delta"?"delta":"full";await F({person_name:n.person_name,linkedin_url:n.linkedin_url||void 0,profile_data:E.profile,analysis_data:E.analysis||n.analysis_data||null,sources:E.sources||n.sources,source_counts:E.source_counts||n.source_counts,enrichment_mode:Ce}),d({...n,profile_data:E.profile,analysis_data:E.analysis||n.analysis_data,sources:E.sources||n.sources,source_counts:E.source_counts||n.source_counts,enriched_at:new Date().toISOString()});const Ot=Gt(p,E.profile,Ce);k(Ot),O.success(`${Ce==="delta"?"Delta":"Full"} enrichment complete!`)}else O.error((E==null?void 0:E.error)||"Enrichment failed")}catch(L){console.error("Enrich error:",L),O.error("Failed to enrich profile. Please try again.")}finally{y(!1)}};if(i)return e.jsx(Je,{children:e.jsx("div",{className:"flex justify-center py-24",children:e.jsx(J,{className:"h-8 w-8 animate-spin text-primary"})})});if(!n)return null;const x={personName:n.person_name,linkedinUrl:n.linkedin_url||void 0,profile:c,sources:n.sources||[],source_counts:n.source_counts||void 0,quality_score:n.quality_score??void 0,quality_checks:n.quality_checks??void 0},D=n.enriched_at?Math.round((Date.now()-new Date(n.enriched_at).getTime())/(1e3*60*60*24)):null,B=()=>{var P,A,L,se,ne,U;const p=((P=c==null?void 0:c.current_roles)==null?void 0:P[0])||((A=c==null?void 0:c.career_history)==null?void 0:A.find(G=>G==null?void 0:G.is_current))||((L=c==null?void 0:c.career_history)==null?void 0:L[0]),_=new URLSearchParams;_.set("personName",n.person_name||""),(p!=null&&p.company||(se=c==null?void 0:c.company_info)!=null&&se.current_company)&&_.set("company",(p==null?void 0:p.company)||((ne=c==null?void 0:c.company_info)==null?void 0:ne.current_company)),p!=null&&p.role&&_.set("jobTitle",p.role),(U=c==null?void 0:c.personal_details)!=null&&U.location&&_.set("location",c.personal_details.location),r(`/research?${_.toString()}`)},l=c==null?void 0:c.personal_details,m=c==null?void 0:c.contact_info,b=c==null?void 0:c.social_links,ye=(c==null?void 0:c.current_roles)||[],Pt=((Fe=c==null?void 0:c.network_and_associations)==null?void 0:Fe.length)>0,$t=!!(c!=null&&c.github_activity),Mt=!!(c!=null&&c.linkedin_activity),Dt=((Le=c==null?void 0:c.personal_interests)==null?void 0:Le.length)>0;return e.jsx(Je,{children:e.jsxs("div",{className:"max-w-5xl mx-auto
69space-y-6 animate-fade-in",children:[e.jsxs(R,{variant:"ghost",size:"sm",className:"gap-1.5 -ml-2",onClick:()=>r("/saved-profiles"),children:[e.jsx(ba,{className:"h-3.5 w-3.5"}),"Back to Profiles"]}),e.jsxs("div",{className:"rounded-xl border bg-card overflow-hidden",children:[e.jsx("div",{className:"p-6 sm:p-8",children:e.jsxs("div",{className:"flex flex-col sm:flex-row gap-6",children:[e.jsx("div",{className:"h-28 w-28 rounded-xl bg-muted flex items-center justify-center shrink-0 overflow-hidden border",children:c!=null&&c.profile_image_url?e.jsx("img",{src:c.profile_image_url,alt:n.person_name,className:"w-full h-full object-cover",onError:p=>{p.currentTarget.style.display="none"}}):e.jsx(Vt,{className:"h-12 w-12 text-muted-foreground/30",strokeWidth:1.2})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:(c==null?void 0:c.full_name)||n.person_name}),(l==null?void 0:l.known_for)&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1 max-w-xl leading-relaxed",children:l.known_for})]}),ye.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:ye.map((p,_)=>e.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[e.jsx(de,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"font-medium",children:p.role}),e.jsxs("span",{className:"text-muted-foreground",children:["at ",p.company]}),e.jsx($,{variant:"outline",className:"text-[10px] capitalize ml-1",children:p.type})]},_))}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-sm text-muted-foreground",children:[(l==null?void 0:l.location)&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(wa,{className:"h-3.5 w-3.5"}),l.location]}),(l==null?void 0:l.nationality)&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ta,{className:"h-3.5 w-3.5"}),l.nationality]}),((qe=m==null?void 0:m.emails)==null?void 0:qe[0])&&e.jsxs("a",{href:`mailto:${m.emails[0]}`,className:"flex items-center gap-1 text-primary hover:underline",children:[e.jsx(bt,{className:"h-3.5 w-3.5"}),m.emails[0]]}
69),((Ie=m==null?void 0:m.phones)==null?void 0:Ie[0])&&e.jsxs("a",{href:`tel:${m.phones[0]}`,className:"flex items-center gap-1 text-primary hover:underline",children:[e.jsx(aa,{className:"h-3.5 w-3.5"}),m.phones[0]]}),(l==null?void 0:l.birth_date)&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(sa,{className:"h-3.5 w-3.5"}),l.birth_date]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[n.linkedin_url&&e.jsxs("a",{href:n.linkedin_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline font-medium",children:[e.jsx(Oe,{className:"h-3.5 w-3.5"})," LinkedIn"]}),(b==null?void 0:b.twitter)&&e.jsxs("a",{href:b.twitter.startsWith("http")?b.twitter:`https://x.com/${b.twitter.replace("@","")}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline font-medium",children:[e.jsx(be,{className:"h-3.5 w-3.5"})," X"]}),(b==null?void 0:b.github)&&e.jsxs("a",{href:b.github.startsWith("http")?b.github:`https://github.com/${b.github}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline font-medium",children:[e.jsx(be,{className:"h-3.5 w-3.5"})," GitHub"]}),(b==null?void 0:b.personal_website)&&e.jsxs("a",{href:b.personal_website,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline font-medium",children:[e.jsx(be,{className:"h-3.5 w-3.5"})," Website"]}),n.enriched_at&&e.jsxs($,{variant:"outline",className:"text-[10px]",children:["Enriched ",D!==null?`${D}d ago`:""]})]})]}),e.jsxs("div",{className:"flex sm:flex-col gap-2 shrink-0",children:[e.jsxs(R,{variant:"outline",size:"sm",className:"gap-1.5 text-xs",onClick:async()=>{j(!0);try{await Xt(x,C),O.success("PDF downloaded!")}catch(p){console.error("PDF error:",p),O.error("Failed to generate PDF.")}finally{j(!1)}},disabled:w||g,children:[w?e.jsx(J,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(pa,{className:"h-3.5 w-3.5"}),"Dossier PDF"]}),C&&e.jsxs(R,{variant:"outline",size:"sm",className:"gap-1.5 text-xs",onClick:async()=>{W(!0);try{await Ms(x,C),O.success("Intelligence PDF downloaded!")}catch(p){console.error("Intel PDF error:",p),O.error("Failed to generate intelligence PDF.")}finally{W(!1)}},disabled:z||g,children:[z?e.jsx(J,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ue,{className:"h-3.5 w-3.5"}),"Intel PDF"]}),e.jsxs(R,{variant:"outline",size:"sm",className:"gap-1.5 text-xs",onClick:B,disabled:w,children:[e.jsx(Ne,{className:"h-3.5 w-3.5"})," Re-Research"]}),e.jsxs(R,{variant:"outline",size:"sm",className:"gap-1.5 text-xs",onClick:()=>s(n.id),children:[e.jsx(Re,{className:"h-3.5 w-3.5"})," Ask 108 Agent"]})]})]})}),(c==null?void 0:c.summary)&&e.jsx("div",{className:"px-6 sm:px-8 pb-6",children:e.jsx("p",{className:"text-sm leading-relaxed text-foreground/85",children:c.summary})}),e.jsx("div",{className:"border-t bg-muted/30 px-6 sm:px-8 py-3",children:e.jsxs("div",{className:"flex flex-wrap gap-6 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(de,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"font-medium text-foreground",children:((Ye=c==null?void 0:c.career_history)==null?void 0:Ye.length)||0})," roles"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(De,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"font-medium text-foreground",children:((Be=c==null?void 0:c.ventures_and_businesses)==null?void 0:Be.length)||0})," ventures"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(we,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"font-medium text-foreground",children:((He=c==null?void 0:c.network_and_associations)==null?void 0:He.length)||0})," connections"]}),x.source_counts&&e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(be,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"font-medium text-foreground",children:(x.source_counts.perplexity||0)+(x.source_counts.firecrawl||0)+(x.source_counts.linkedin||0)+(x.source_counts.platform||0)})," sources"]})]})})]}),e.jsx(Ys,{profileData:c,analysisData:C,sources:n.sources,sourceCounts:n.source_counts}),e.jsx(Fs,{sourceCount:((Ve=x.sources)==null?void 0:Ve.length)||0,dimensionsPct:(()=>{var _,P,A,L,se,ne,U,G;const p=[(((_=c==null?void 0:c.career_history)==null?void 0:_.length)||0)>=2,!!((P=c==null?void 0:c.company_info)!=null&&P.current_company),(((A=c==null?void 0:c.narrative_sections)==null?void 0:A.length)||0)>=4,(((L=c==null?void 0:c.network_and_associations)==null?void 0:L.length)||0)>=2,(((se=c==null?void 0:c.personal_interests)==null?void 0:se.length)||0)>=1,(((ne=c==null?void 0:c.skills_and_expertise)==null?void 0:ne.length)||0)>=2,!!((U=c==null?void 0:c.social_links)!=null&&U.twitter||(G=c==null?void 0:c.social_links)!=null&&G.github),!!(C!=null&&C.behavioral_profile)];
69return Math.round(p.filter(Boolean).length/p.length*100)})(),onReResearch:q,isEnriching:g}),v&&e.jsx(Ts,{diff:v,onDismiss:()=>k(null)}),g?e.jsx(na,{}):e.jsxs(Ke,{defaultValue:"overview",className:"w-full",children:[e.jsxs(Ze,{className:"w-full justify-start border-b rounded-none bg-transparent h-auto p-0 gap-0",children:[e.jsx(X,{value:"overview",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2.5",children:"Overview"}),e.jsx(X,{value:"career",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2.5",children:"Career & Companies"}),e.jsx(X,{value:"network",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2.5",children:"Network & Contacts"}),e.jsx(X,{value:"intelligence",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2.5",children:"Intelligence"}),e.jsx(X,{value:"outreach",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2.5",children:"Outreach"}),e.jsx(X,{value:"claims",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2.5",children:"Claims"}),e.jsx(X,{value:"dossier",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2.5",children:"Full Dossier"})]}),e.jsx(Q,{value:"overview",className:"mt-6 space-y-6",children:e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[((Ge=c==null?void 0:c.topics_of_interest)==null?void 0:Ge.length)>0&&e.jsxs(T,{children:[e.jsx(H,{className:"pb-3",children:e.jsx(V,{className:"text-sm",children:"Topics of Interest"})}),e.jsx(M,{children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:c.topics_of_interest.map((p,_)=>e.jsx($,{variant:"secondary",className:"text-xs",children:p},_))})})]}),Dt&&e.jsxs(T,{children:[e.jsx(H,{className:"pb-3",children:e.jsxs(V,{className:"text-sm flex items-center gap-2",children:[e.jsx(ra,{className:"h-4 w-4 text-primary"}),"Personal Interests & Hobbies"]})}),e.jsx(M,{className:"space-y-3",children:c.personal_interests.map((p,_)=>e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:p.category}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.items.map((P,A)=>e.jsx($,{variant:"outline",className:"text-xs",children:P},A))})]},_))})]}),Mt&&e.jsxs(T,{children:[e.jsx(H,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(V,{className:"text-sm flex items-center gap-2",children:[e.jsx(Oe,{className:"h-4 w-4 text-primary"}),"LinkedIn Activity"]}),c.linkedin_activity_fetched_at&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Fetched ",new Date(c.linkedin_activity_fetched_at).toLocaleDateString()]})]})}),e.jsxs(M,{className:"space-y-4",children:[((Xe=c.linkedin_activity.posts)==null?void 0:Xe.length)>0&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:["Recent Posts (",c.linkedin_activity.posts.length,")"]}),e.jsx("div",{className:"space-y-3",children:c.linkedin_activity.posts.slice(0,5).map((p,_)=>e.jsxs("div",{className:"rounded-lg border p-3 text-sm space-y-1",children:[e.jsx("p",{className:"text-foreground line-clamp-3",children:p.text}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[p.likes>0&&e.jsxs("span",{children:[p.likes," likes"]}),p.comments>0&&e.jsxs("span",{children:[p.comments," comments"]}),p.posted_at&&e.jsx("span",{children:new Date(p.posted_at).toLocaleDateString()})]})]},_))})]}),((Qe=c.linkedin_activity.reactions)==null?void 0:Qe.length)>0&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:["Recent Reactions (",c.linkedin_activity.reactions.length,")"]}),e.jsx("div",{className:"space-y-2",children:c.linkedin_activity.reactions.slice(0,5).map((p,_)=>{var P;return e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx($,{variant:"secondary",className:"text-xs mr-2",children:p.reaction_type}),e.jsx("span",{className:"line-clamp-1",children:(P=p.target_text)==null?void 0:P.slice(0,150)})]},_)})})]}),((Ue=c.linkedin_activity.comments)==null?void 0:Ue.length)>0&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:["Recent Comments (",c.linkedin_activity.comments.length,")"]}),e.jsx("div",{className:"space-y-2",children:c.linkedin_activity.comments.slice(0,5).map((p,_)=>{var P;return e.jsxs("div",{className:"text-sm italic text-muted-foreground border-l-2 border-border pl-3",children:['"',(P=p.text)==null?void 0:P.slice(0,200),'"',p.posted_at&&e.jsxs("span",{className:"text-xs not-italic ml-1",children:["(",new Date(p.posted_at).toLocaleDateString(),")"]})]},_)})})]})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(qs,{sources:x.sources||[],sourceCounts:x.source_counts}),e.jsx(ia,{result:x}),$t&&e.jsx(As,{profile:c}
69)]})]})}),e.jsxs(Q,{value:"career",className:"mt-6 space-y-6",children:[e.jsx(Ws,{profileData:c}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx("div",{className:"space-y-6",children:e.jsx(Ds,{profile:c,personName:n.person_name})}),e.jsx("div",{className:"space-y-6",children:e.jsx(la,{profile:c,personName:n.person_name,onCompanyIntelAdded:async(p,_)=>{const A=[...c.additional_company_intel||[],_],L={...c,additional_company_intel:A};await I.from("saved_profiles").update({profile_data:L}).eq("id",n.id),d({...n,profile_data:L})},onSaveCompany:async p=>{if(!(a!=null&&a.id))throw new Error("Not authenticated");const{data:_}=await I.from("companies").select("id").eq("user_id",a.id).eq("name",p.current_company).maybeSingle(),P={name:p.current_company,industry:p.industry||null,description:p.description||null,size:p.employee_count||null,website:p.website||null,funding_stage:p.growth_stage||null,headquarters:p.headquarters||null,metadata:p};if(_){const{error:A}=await I.from("companies").update(P).eq("id",_.id);if(A)throw A}else{const{error:A}=await I.from("companies").insert({...P,user_id:a.id});if(A)throw A}}})})]}),e.jsx(at,{result:x})]}),e.jsxs(Q,{value:"network",className:"mt-6 space-y-6",children:[e.jsx(Es,{savedProfileId:n.id,profileData:c}),Pt&&e.jsx(oa,{profile:c,analysis:C,personName:n.person_name})]}),e.jsxs(Q,{value:"intelligence",className:"mt-6 space-y-6",children:[C&&(n==null?void 0:n.enriched_at)&&C.analyzed_at&&new Date(n.enriched_at)>new Date(C.analyzed_at)&&e.jsx(T,{className:"border-amber-500/40 bg-amber-500/5",children:e.jsxs(M,{className:"py-4 flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(pe,{className:"h-5 w-5 text-amber-500 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Analysis may be outdated"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Profile was enriched after this analysis was generated. Re-analyze to capture the latest data."})]})]}),e.jsxs(R,{onClick:Y,disabled:u,variant:"outline",size:"sm",className:"gap-2 shrink-0 border-amber-500/40 text-amber-600 hover:bg-amber-500/10",children:[u?e.jsx(J,{className:"h-4 w-4 animate-spin"}):e.jsx(ue,{className:"h-4 w-4"}),u?"Analyzingâ¦":"Re-Analyze"]})]})}),C&&!C.analyzed_at&&(n==null?void 0:n.enriched_at)&&e.jsx(T,{className:"border-amber-500/40 bg-amber-500/5",children:e.jsxs(M,{className:"py-4 flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(pe,{className:"h-5 w-5 text-amber-500 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Analysis may be outdated"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This analysis was generated before timestamp tracking was added. Re-analyze to ensure it reflects the latest profile data."})]})]}),e.jsxs(R,{onClick:Y,disabled:u,variant:"outline",size:"sm",className:"gap-2 shrink-0 border-amber-500/40 text-amber-600 hover:bg-amber-500/10",children:[u?e.jsx(J,{className:"h-4 w-4 animate-spin"}):e.jsx(ue,{className:"h-4 w-4"}),u?"Analyzingâ¦":"Re-Analyze"]})]})}),!C&&e.jsx(T,{className:"border-dashed",children:e.jsxs(M,{className:"py-12 text-center",children:[e.jsx(ue,{className:"h-10 w-10 mx-auto mb-3 text-muted-foreground/30"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Generate behavioral analysis and intelligence briefing"}),e.jsxs(R,{onClick:Y,disabled:u,variant:"default",size:"sm",className:"gap-2",children:[u?e.jsx(J,{className:"h-4 w-4 animate-spin"}):e.jsx(ue,{className:"h-4 w-4"}),u?"Analyzingâ¦":"Generate Intelligence"]})]})}),C&&e.jsxs("div",{className:"space-y-6",children:[e.jsx(ca,{analysis:C}),e.jsx(wt,{}),e.jsx(da,{result:x,analysis:C})]})]}),e.jsx(Q,{value:"outreach",className:"mt-6",children:e.jsx(Hs,{savedProfileId:n.id})}),e.jsx(Q,{value:"claims",className:"mt-6",children:e.jsx(Qs,{savedProfileId:n.id})}),e.jsx(Q,{value:"dossier",className:"mt-6 space-y-6",children:e.jsxs(Ke,{defaultValue:"narrative",className:"w-full",children:[e.jsxs(Ze,{children:[e.jsx(X,{value:"narrative",children:"Narrative"}),e.jsx(X,{value:"cards",children:"Structured"}),e.jsx(X,{value:"exec",children:"Executive Summary"})]}),e.jsx(Q,{value:"narrative",className:"mt-4",children:e.jsx(ma,{result:x})}),e.jsx(Q,{value:"cards",className:"mt-4",children:e.jsx(at,{result:x})}),e.jsx(Q,{value:"exec",className:"mt-4",children:e.jsx(ua,{result:x})})]})})]})]})})}export{Mn 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.