PageSourceSearch

https://talenteconomy.ai/assets/SharedReport-Bcs6XTTt.js

js talenteconomy.ai collected 2026-10-05 12:43:29 UTC 13,411 bytes, 1 lines download raw bytes

1import{k as W,r as p,j as e}from"./vendor-react-DYJL7UAt.js";import{C as T}from"./card-DGAvK3MX.js";import{B as u}from"./badge-CrnQLnUO.js";import{C as q,a as L,b as U}from"./collapsible-Abpzrzds.js";import{g as J,l as G,B as K,s as M}from"./index-BIO39sMQ.js";import{s as w,S as X}from"./ScorecardDisplay-n1UJ6MBQ.js";import{n as z}from"./scorecard-normalizer-QSPHA9ft.js";import{f as Y,S as Z}from"./errors-D1YZS7CK.js";import{C as H}from"./chevron-down-CCnDO4fA.js";import{C as O}from"./chevron-right-CWex_CBs.js";import{I as ee}from"./info-JZeJJ_Qj.js";import{F as se}from"./file-text-DPMiqHuV.js";import{U as V}from"./user-check-DbeSRgUX.js";import{P as re}from"./play-Bc3jfloN.js";import"./radix-react-collapsible-D7lL7ZtI.js";import"./radix-primitive-DW48STyt.js";import"./radix-react-context-iY9xdQT3.js";import"./radix-react-use-controllable-state-CZV0Xf5f.js";import"./radix-react-use-layout-effect-Srw_3GoD.js";import"./radix-react-compose-refs-CfVRrsi0.js";import"./radix-react-primitive-959IC5wQ.js";import"./radix-react-slot-BZcFcFsW.js";import"./radix-react-presence-EBT9m5cy.js";import"./radix-react-id-B-atqmlr.js";import"./radix-react-tooltip-DfqcfuNL.js";import"./radix-react-dismissable-layer-CBcRHXfU.js";import"./radix-react-use-callback-ref-Ddo4FvIt.js";import"./radix-react-use-escape-keydown-DN1DJCUJ.js";import"./radix-react-popper-DSwfl_Ch.js";import"./radix-react-arrow-8Sch-yNe.js";import"./radix-react-use-size-_gy1Cq7l.js";import"./radix-react-visually-hidden-Dahs-IJh.js";import"./vendor-query-BubNDIGE.js";import"./vendor-supabase-BtLZQ70r.js";import"./radix-react-dialog-C0XjuzvT.js";import"./radix-react-focus-scope-Dki4ZAiL.js";import"./radix-react-portal-C6YvUZXJ.js";import"./radix-react-focus-guards-BtsPnA-q.js";import"./circle-check-big-D2hdDqUy.js";import"./trending-down-Bmb217Ei.js";import"./trending-up-OpSff7o8.js";import"./circle-help-jpeH3PWb.js";import"./message-square-yN-x2XSi.js";function te({interviewId:l,questionIndex:b,shareToken:h}){const[N,f]=p.useState(null),[m,y]=p.useState(!1),[_,S]=p.useState(null),k=async()=>{y(!0),S(null);try{const{data:a,error:C}=await M.functions.invoke("get-video-playback-url",{body:{interview_id:l,question_index:b,share_token:h}});if(C)throw C;if(!(a!=null&&a.ok)||!(a!=null&&a.url))throw new Error((a==null?void 0:a.error)||"Video unavailable");f(a.url)}catch(a){S(Y(a,`This video couldn't be played right now. Please try again, or email ${Z}.`))}finally{y(!1)}};return N?e.jsx("video",{src:N,controls:!0,className:"mt-2 w-full max-w-md rounded-md border border-border bg-black"}):e.jsxs("div",{className:"mt-2",children:[e.jsxs(K,{size:"sm",variant:"outline",onClick:k,disabled:m,children:[m?e.jsx(J,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}):e.jsx(re,{className:"h-3.5 w-3.5 mr-1.5"}),"Play video response"]}),_&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:_})]})}const $=(l,b)=>l?{decision:l==="hire"?"Strong Hire":l.charAt(0).toUpperCase()+l.slice(1),isOverride:!0}:{decision:b,isOverride:!1},Qe=()=>{const{token:l}=W(),[b,h]=p.useState(!0),[N,f]=p.useState(null),[m,y]=p.useState(null),[_,S]=p.useState(null),[k,a]=p.useState(!1);p.useEffect(()=>{(async()=>{if(!l){f("Invalid share link"),h(!1);return}try{const{data:i,error:d}=await M.rpc("get_share_report",{p_token:l});if(d){console.error("[SharedReport] RPC error:",d),f("Unable to load report"),h(!1);return}const s=i;if(s!=null&&s.error){f(s.error),h(!1);return}if(!(s!=null&&s.job)){f("Invalid report data"),h(!1);return}y({job:s.job,resumes:s.resumes||[],scorecards:s.scorecards||[],prescreens:s.prescreens||[],video_interviews:s.video_interviews||[],video_responses:s.video_responses||[]})}catch(i){console.error("[SharedReport] Fetch error:",i),f("Something went wrong")}finally{h(!1)}})()},[l]);const C=r=>new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Q=(r,i=!1)=>{const d=w(r,"").toLowerCase();let s="bg-amber-500 text-white";return(d.includes("hire")||d.includes("strong"))&&(s="bg-green-600 text-white"),(d.includes("reject")||d.includes("no"))&&(s="bg-destructive text-destructive-foreground"),i?`${s} ring-2 ring-primary/40`:s},E=(m==null?void 0:m.resumes.map(r=>{const i=m.scorecards.find(d=>d.screening_job_resume_id===r.id);return{...r,scorecard:i||null}}))||[],x=E.reduce((r,i)=>{if(i.scorecard){const s=z(i.scorecard.scorecard_json).parsed;if(s!=null&&s.decision){const v=w(s.decision,""),{decision:c}=$(i.final_decision,v),j=c.toLowerCase();j.includes("hire")||j.includes("strong")?r.hire++:j.includes("reject")||j.includes("no")?r.reject++:r.review++}}return r},{hire:0,review:0,reject:0}
1);if(b)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(J,{className:"h-6 w-6 animate-spin text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading report..."})]})});if(N||!m)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs(T,{className:"p-8 text-center max-w-md border border-border shadow-sm",children:[e.jsx(G,{className:"h-8 w-8 text-muted-foreground mx-auto mb-4"}),e.jsx("p",{className:"text-foreground mb-2 font-medium",children:"Report Not Available"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:N||"This share link is invalid or has expired."})]})});const{job:R}=m,A=E.length;return E.filter(r=>r.scorecard!==null).length,e.jsx("div",{className:"min-h-screen bg-background py-8",children:e.jsxs("div",{className:"max-w-[900px] mx-auto px-4 space-y-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Shared Report"}),e.jsx(u,{variant:"outline",className:"text-xs",children:"Read-only"})]})}),e.jsx(T,{className:"p-6 border border-border shadow-sm",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold text-foreground",children:R.job_title||"Screening Results"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:C(R.created_at)})]}),e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("span",{className:"text-sm text-muted-foreground",children:[A," candidate",A!==1?"s":""]})})]}),(x.hire>0||x.review>0||x.reject>0)&&e.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-border",children:[x.hire>0&&e.jsxs(u,{className:"bg-green-600 text-white",children:[x.hire," Hire"]}),x.review>0&&e.jsxs(u,{className:"bg-amber-500 text-white",children:[x.review," Review"]}),x.reject>0&&e.jsxs(u,{variant:"destructive",children:[x.reject," Reject"]})]}),e.jsxs(q,{open:k,onOpenChange:a,children:[e.jsxs(L,{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[k?e.jsx(H,{className:"h-4 w-4"}):e.jsx(O,{className:"h-4 w-4"}),"Job Description"]}),e.jsx(U,{children:e.jsx("div",{className:"mt-3 p-4 bg-muted/50 rounded-lg border border-border max-h-[200px] overflow-y-auto",children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap leading-relaxed",children:R.job_description})})})]})]})}),e.jsxs(q,{children:[e.jsxs(L,{className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),"About this report",e.jsx(O,{className:"h-3 w-3 data-[state=open]:rotate-90 transition-transform"})]}),e.jsx(U,{children:e.jsx("div",{className:"mt-2 p-3 bg-muted/30 rounded-md border border-border",children:e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"This analysis uses AI to structure and compare candidate information against role requirements. All recommendations are advisory and designed to support — not replace — human hiring decisions."})})})]}),e.jsxs(T,{className:"p-6 border border-border shadow-sm",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground mb-4",children:"Candidates"}),A===0?e.jsx("p",{className:"text-sm text-muted-foreground py-4",children:"No candidates in this report."}):e.jsx("div",{className:"space-y-3",children:E.map(r=>{var F;const i=r.scorecard!==null,d=_===r.id,s=(F=r.scorecard)==null?void 0:F.scorecard_json,v=s?z(s):null,c=v==null?void 0:v.parsed,j=w(c==null?void 0:c.decision,"Review"),{decision:I,isOverride:P}=$(r.final_decision,j);return e.jsx(q,{open:d,onOpenChange:t=>S(t?r.id:null),children:e.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[e.jsxs(L,{className:"w-full flex items-center gap-3 p-4 hover:bg-muted/50 transition-colors text-left",disabled:!i,children:[e.jsx(se,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:r.resume_filename}),i&&c&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:[w(c.summary,"").slice(0,120),w(c.summary,"").length>120?"...":""]})]}),i&&c?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-right shrink-0 mr-2",children:[e.jsx("span",{className:"text-2xl font-bold text-foreground",children:c.fit_score??c.overall_fit_score??"--"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"/100"})]}),e.jsxs(u,{className:`shrink-0 ${Q(I,P)}`,children:[P&&e.jsx(V,{className:"h-3 w-3 mr-1"}),I]}),d?e.jsx(H,{className:"h-4 w-4 text-muted-foreground shrink-0"}):e.jsx(O,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}):e.jsx(u,{variant:"secondary",children:"Processing"})]}),e.jsx(U,{children:e.jsxs("div",{className:"border-t border-border p-4 bg-muted/20 space-y-6",children:[i&&c&&e.jsxs("div",{children:[P&&e.jsxs("div",{className:"mb-4 p-3 bg-primary/5 rounded-lg border border-primary/10",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(V,{className:"h-4 w-4 text-primary"}),e.jsxs("span",{className:"font-medium text-foreground",children:["Final Decision (Human): ",I]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["AI recommendation: ",j]})]}),e.jsx(X,{scorecard:c})]}),m.prescreens.filter(t=>t.screening_job_resume_id===r.id).map(t=>e.jsxs("div",{className:"rounded-lg border border-border bg-background p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"Pre-screen answers"}),typeof t.overall_score=="number"&&e.jsxs(u,{variant:"secondary",children:[t.overall_score,"/100"]})]}),t.scoring_summary&&e.jsx("p",{className:"text-sm text-muted-foreground mb-3 whitespace-pre-wrap",children:t.scoring_summary}),e.jsx("div",{className:"space-y-3",children:(Array.isArray(t.answers
1)?t.answers:[]).map((n,g)=>{var B;const o=n&&typeof n=="object"&&(n.question||n.q)||Array.isArray(t.form_questions)&&((B=t.form_questions[g])==null?void 0:B.text)||"",D=typeof n=="string"?n:(n==null?void 0:n.answer)??(n==null?void 0:n.a)??"";return e.jsxs("div",{className:"text-sm",children:[e.jsxs("p",{className:"font-medium text-foreground",children:["Q",g+1,". ",o]}),e.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap mt-0.5",children:D||"—"})]},g)})})]},t.id)),m.video_interviews.filter(t=>t.screening_job_resume_id===r.id).map(t=>{var g;const n=m.video_responses.filter(o=>o.interview_id===t.id);return e.jsxs("div",{className:"rounded-lg border border-border bg-background p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"Video pre-screen"}),typeof t.combined_score=="number"&&e.jsxs(u,{variant:"secondary",children:[t.combined_score,"/100"]})]}),((g=t.ai_assessment)==null?void 0:g.summary)&&e.jsx("p",{className:"text-sm text-muted-foreground mb-3 whitespace-pre-wrap",children:t.ai_assessment.summary}),e.jsxs("div",{className:"space-y-3",children:[n.map(o=>{var D;return e.jsxs("div",{className:"text-sm border-l-2 border-primary/30 pl-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("p",{className:"font-medium text-foreground",children:["Q",o.question_index+1,". ",o.question_text]}),typeof o.ai_score=="number"&&e.jsxs(u,{variant:"outline",className:"shrink-0 text-xs",children:[o.ai_score,"/10"]})]}),o.transcript&&e.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap mt-1",children:o.transcript}),o.transcription_status==="failed"||(D=o.ai_summary)!=null&&D.startsWith("Transcription error:")?e.jsx("p",{className:"text-xs text-muted-foreground italic mt-1",children:"Transcript unavailable for this answer — please watch the video response below."}):o.ai_summary?e.jsxs("p",{className:"text-xs text-muted-foreground italic mt-1",children:["AI: ",o.ai_summary]}):null,l&&e.jsx(te,{interviewId:o.interview_id,questionIndex:o.question_index,shareToken:l})]},o.id)}),n.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No responses yet."})]})]},t.id)})]})})]})},r.id)})})]}),e.jsx("div",{className:"text-center py-4",children:e.jsx("p",{className:"text-xs text-muted-foreground",children:"Powered by TalentEconomy.ai"})})]})})};export{Qe 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.