1import{j as n}from"./vendor-ui-3f6e26cd.js";import{d as X,c as Y,b as ee,r}from"./vendor-react-ece16e03.js";import{P as x}from"./PageLayout-c06c9ab8.js";import{f as te,m as ae,a as oe,b as se,J as de}from"./candidateDataMapper-f6f63d1a.js";import{S as ne}from"./index-3ebdd27d.js";import{C as ie,a as re}from"./candidates-9cb56438.js";import{u as le,f as ce}from"./index-62e0d23f.js";import{j as ue}from"./jobService-bb4aead6.js";import{a as pe}from"./matches-2bab2538.js";import{o as me}from"./offerService-13a9e64a.js";import{u as fe}from"./useResumePdfDownload-13eb8822.js";import"./tinymce.config-b6a38862.js";import"./vendor-pdf-create-fdd850a0.js";import"./index-8e449471.js";import"./Button-4394ff3c.js";import"./Input-4eead7af.js";import"./Dropdown-be739300.js";import"./phone-4d4b183d.js";import"./ActivityFeed-26b502e9.js";import"./utils-ac0b6be1.js";import"./vendor-query-c0215a5a.js";import"./vendor-state-3eb292e6.js";function De(){var b,_,P,v,w,N,T,k,B;const{companyId:R,jobId:u,candidateId:l}=X(),[M]=Y(),D=ee(),A=le(t=>t.addNotification),h=M.get("matchId"),[i,z]=r.useState(null),[o,E]=r.useState(null),[e,c]=r.useState(null),[O,g]=r.useState(null),[H,y]=r.useState(!0),[I,S]=r.useState(null),{downloadPdf:U,isDownloading:j}=fe(l,(b=i==null?void 0:i.candidate)==null?void 0:b.firstName,(_=i==null?void 0:i.candidate)==null?void 0:_.lastName),$=()=>{D(`/company/${R}/jobs/${u}`)};if(r.useEffect(()=>{if(!l||!u){S("No candidate or job ID provided"),y(!1);return}(async()=>{var d;try{y(!0);const[J,m]=await Promise.all([re.getCandidateProfile(l),ue.getJobProfile(parseInt(u))]);z(J),E(m);const a=(d=m.matches)==null?void 0:d.find(f=>f.candidateId.toString()===l),L=h?parseInt(h):a==null?void 0:a.id;if(L)try{const f=await pe.getMatch(L);c(f)}catch{c(a?{id:a.id,companyJobId:m.id,candidateId:a.candidateId,matchDatetimeUtc:a.createdAt||new Date().toISOString(),matchResultStatusCode:a.matchResultStatusCode||"",createdAt:a.createdAt||null,updatedAt:a.updatedAt||null,deletedAt:null,createdBy:null,startDate:a.hiredAt||null,wage:null,interviews:a.interviews||[]}:null)}else c(a?{id:a.id,companyJobId:m.id,candidateId:a.candidateId,matchDatetimeUtc:a.createdAt||new Date().toISOString(),matchResultStatusCode:a.matchResultStatusCode||"",createdAt:a.createdAt||null,updatedAt:a.updatedAt||null,deletedAt:null,createdBy:null,startDate:a.hiredAt||null,wage:null,interviews:a.interviews||[]}:null);S(null)}catch{S("Failed to load job-candidate details"),A({type:"error",message:"Failed to load job-candidate details"})}finally{y(!1)}})()},[l,u,h,A]),r.useEffect(()=>{(async()=>{if(!(e!=null&&e.id)){g(null);return}try{const d=await me.getLatestOfferByMatch(e.id);g((d==null?void 0:d.acceptedAt)||null)}catch{g(null)}})()},[e==null?void 0:e.id]),H)return n.jsx(x,{children:n.jsx("div",{style:{textAlign:"center",padding:"48px",color:"var(--slate)",fontSize:"14px"},children:"Loading..."})});if(I||!i||!o)return n.jsx(x,{children:n.jsx("div",{style:{textAlign:"center",padding:"48px",color:"var(--slate)",fontSize:"14px"},children:I||"Job-candidate details not found"})});const s=i.candidate,F=te(s.firstName,s.lastName),W=ce(s.location_data??s.locationData,s.location_city,s.location_state_code,s.location_postal_code,s.location_country_code,{mode:"detail"}),G=ae(i.workHistory),K=oe(s.sizzle),Z=[],q=((P=e==null?void 0:e.interviews)==null?void 0:P.map(t=>(t==null?void 0:t.createdAt)||(t==null?void 0:t.created_at)||null).filter(Boolean).sort((t,d)=>new Date(t).getTime()-new Date(d).getTime())[0])||null,C=((v=e==null?void 0:e.interviews)==null?void 0:v.map(t=>(t==null?void 0:t.scheduledDatetimeUtc)||(t==null?void 0:t.scheduled_datetime_utc)||null).filter(Boolean).sort((t,d)=>new Date(t).getTime()-new Date(d).getTime())[0])||null,Q=se((e==null?void 0:e.matchResultStatusCode)||null,{searchKickoffDate:(o==null?void 0:o.readinessStatusUpdatedAt)||(o==null?void 0:o.readiness_status_updated_at)||null,matchedDate:(e==null?void 0:e.matchDatetimeUtc)||(e==null?void 0:e.createdAt)||null,scheduleConfirmedDate:q||C,interviewDate:C,offerAcceptedDate:O,hiredDate:(w=e==null?void 0:e.matchResultStatusCode)!=null&&w.includes("Hired")&&(e!=null&&e.updatedAt||e!=null&&e.startDate)?e.updatedAt||e.startDate:null,archivedDate:(N=e==null?void 0:e.matchResultStatusCode)!=null&&N.includes("Archive")&&(e!=null&&e.updatedAt)?e.updatedAt:null},{trackerType:"job"}),p={name:F,title:((k=(T=s.default_industry_job_title_code)==null?void 0:T.split(":").pop())==null?void 0:k.replace(/([A-Z])/g," $1").trim())||"Professional",location:W,phone:s.primary_phone||void 0,email:s.email,experience:G,skills:Z,highlights:K,licenses:""},V=((B=i.resume)==null?void 0:B.resume)||"";return n.jsxs(x,{children:[n.jsx(ne,{text:"Back to Job",onClick:$}),n.jsxs("div",{className:"card",style:{padding:"30px 20px",margin:"20px 0"},children:[n.jsxs("div",{style:{marginBottom:"30px",fontSize:"12px",textTransform:"uppercase",letterSpacing:"1.5px",color:"var(--slate)",fontWeight:"600"},children:["Match track progress -- ",o.title||"Job"]}),n.jsx(de,{steps:Q})]}),n.jsx(ie,{name:p.name,contact:"",summary:"",experience:p.experience,licenses:p.licenses,highlights:p.highlights,matchId:e==null?void 0:e.id,jobData:o?{id:o.id,companyId:o.companyId,defaultInterviewLocationId:o.defaultInterviewLocationId||null,interviewLocationType:o.interviewLocationType||null}:void 0,adminMode:!1,showAIGenerateCards:!1,resumeHtml:V,resumePanelOptions:{isPersonalInfoShow:!0,headerActions:n.jsx("button",{className:"primary",onClick:U,disabled:j,children:j?"Downloading...":"Download Resume"})},interviewCardMode:"company"})]})}
1export{De 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.