PageSourceSearch

https://youngaileaderslinz.at/assets/review._assignmentId-BWGpUkdt.js

js youngaileaderslinz.at collected 2026-10-05 04:52:17 UTC 12,779 bytes, 1 lines download raw bytes

1import{b8 as V,u as W,r as c,t as i,j as e}from"./index-nxedOTY2.js";import{u as M}from"./useServerFn-6pSUwCS5.js";import{r as N}from"./rpcs-B6rBMjyZ.js";import{m as U}from"./document-access.functions-Bi_6YnQD.js";import"./auth-middleware-2REYcJVg.js";function Q(){const{assignmentId:n}=V.useParams(),l=W(),d=M(U),[t,$]=c.useState(null),[I,p]=c.useState(!0),[m,y]=c.useState({}),[w,F]=c.useState("yes"),[h,E]=c.useState(""),[b,D]=c.useState(""),[v,x]=c.useState(!1),[f,O]=c.useState(""),[_,R]=c.useState(!1),C=c.useCallback(async()=>{p(!0);const{data:r,error:s}=await N.getReviewerApplicationWorkspaceV3(n);if(s){i.error(s.message),p(!1);return}$(r);const o=r?.rubric?.criteria??[];y(Object.fromEntries(o.map(a=>[a.key,{score:0,evidence_reference:"",rationale:""}]))),p(!1)},[n]);c.useEffect(()=>{C()},[C]);const g=t?.evidence_catalog??[],S=c.useMemo(()=>new Set(g.map(r=>r.ref)),[g]);function j(r,s){y(o=>({...o,[r]:{...o[r],...s}}))}async function k(r){try{await navigator.clipboard.writeText(r),i.success(`Copied ${r}`)}catch{i.error("Copy failed")}}async function B(r){try{const s=await d({data:{documentId:r,purpose:"reviewer-workspace"}});window.open(s.url,"_blank","noopener,noreferrer")}catch(s){i.error(s instanceof Error?s.message:"Failed to open document")}}async function L(){if(f.trim().length<20){i.error("Recusal reason must be at least 20 characters");return}x(!0);const{error:r}=await N.recuseFromReview(n,f.trim());if(x(!1),r)return i.error(r.message);i.success("Recusal recorded — admins notified"),l({to:"/portal/recruitment"})}async function P(){if(!t)return;if(t.assignment.read_only)return i.error("This assignment is read-only — no scoring allowed.");const r=t.rubric.criteria;for(const s of r){const o=m[s.key];if(!o||o.score<0||o.score>4)return i.error(`${s.label}: score out of range`);const a=o.evidence_reference.trim();if(a.length<3)return i.error(`${s.label}: evidence reference required`);if(!S.has(a))return i.error(`${s.label}: evidence reference "${a}" not in workspace (use e.g. evidence-1, answer-motivation, document-cv)`);if(o.rationale.trim().length<20)return i.error(`${s.label}: rationale must be ≥20 chars`)}if(b.trim().length<20)return i.error("Interview focus must be at least 20 characters");if(!h)return i.error("Pick a suggested team");x(!0);try{const s=r.map(a=>({criterion:a.key,score:m[a.key].score,evidence_reference:m[a.key].evidence_reference.trim(),rationale:m[a.key].rationale.trim()})),{error:o}=await N.submitReviewV3(n,s,w,h,b.trim(),"none",null);if(o)return i.error(o.message);i.success("Review submitted"),l({to:"/portal/recruitment"})}finally{x(!1)}}if(I)return e.jsx("div",{className:"text-sm text-[color:var(--ink-soft)]",children:"Loading workspace…"});if(!t)return e.jsx("div",{className:"text-sm text-red-700",children:"Workspace unavailable."});const T=t.answers_by_ref??{},A=r=>Array.isArray(r)?r.map(s=>String(s)):[];return e.jsxs("div",{className:"max-w-4xl",children:[e.jsx("div",{className:"mono text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)] mb-2",children:"Recruitment · Blind review (v3)"}),e.jsxs("div",{className:"text-[11px] text-[color:var(--ink-soft)] mb-2",children:[e.jsx("b",{children:"CAR"})," is the applicant's evidence structure only: Context/Challenge → Action → Result/Change. Capability, availability and responsibility are separate scoring dimensions — they are not what CAR stands for."]}),e.jsx("h1",{className:"text-3xl mb-1",children:"Score application"}),e.jsxs("div",{className:"font-mono text-xs text-[color:var(--ink-soft)] mb-2",children:["Application ",t.application.id.slice(0,8)," · Assignment ",n.slice(0,8),t.assignment.due_at?` · due ${new Date(t.assignment.due_at).toLocaleDateString()}`:""," · disposition ",e.jsx("b",{children:t.application.eligibility_disposition})]}),t.assignment.read_only?e.jsx("div",{className:"mb-4 rounded-sm border border-amber-500/40 bg-amber-50 px-3 py-2 text-xs",children:"Read-only view (admin fallback or completed/recused assignment). Scoring disabled."}):null,e.jsxs("section",{className:"mb-6 border border-[color:var(--hairline)] rounded-sm p-4 space-y-3",children:[e.jsx("h2",{className:"mono text-[11px] uppercase tracking-[0.18em]",children:"Answers (blind)"}
1),Object.entries(T).map(([r,s])=>e.jsx(J,{refId:r,value:s,onCopy:k},r))]}),t.evidence.length>0&&e.jsxs("section",{className:"mb-6 border border-[color:var(--hairline)] rounded-sm p-4 space-y-3",children:[e.jsxs("h2",{className:"mono text-[11px] uppercase tracking-[0.18em]",children:["Structured evidence (CAR: context/challenge → action → result/change) · ",t.evidence.length," item(s)"]}),t.evidence.map(r=>e.jsxs("div",{className:"border border-[color:var(--hairline)] rounded-sm p-3 text-sm space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>k(r.ref),className:"mono text-[10px] uppercase tracking-[0.18em] px-1.5 py-0.5 border border-[color:var(--hairline)] rounded-sm hover:bg-black/5",children:r.ref}),e.jsxs("span",{className:"text-[color:var(--ink-soft)] text-xs",children:["· ",r.kind]}),r.title?e.jsx("span",{className:"font-medium",children:r.title}):null]}),r.context_challenge&&e.jsx(u,{small:!0,label:"Context / Challenge",value:r.context_challenge}),r.action&&e.jsx(u,{small:!0,label:"Action",value:r.action}),r.result_change&&e.jsx(u,{small:!0,label:"Result / Change",value:r.result_change}),r.learned&&e.jsx(u,{small:!0,label:"Learned",value:r.learned}),r.stakeholders&&e.jsx(u,{small:!0,label:"Stakeholders",value:r.stakeholders}),r.link_url?e.jsxs("div",{className:"text-xs",children:["link: ",e.jsx("a",{href:r.link_url,target:"_blank",rel:"noreferrer",className:"underline",children:r.link_url})]}):null]},r.ref))]}),e.jsxs("section",{className:"mb-6 border border-[color:var(--hairline)] rounded-sm p-4 space-y-2",children:[e.jsxs("h2",{className:"mono text-[11px] uppercase tracking-[0.18em]",children:["Private documents · ",t.documents.length]}),t.documents.length===0?e.jsx("div",{className:"text-xs text-[color:var(--ink-soft)]",children:"No documents uploaded. Continue the review with the answers and CAR evidence above."}):e.jsx("ul",{className:"text-sm space-y-1",children:t.documents.map(r=>e.jsxs("li",{className:"flex items-center justify-between border border-[color:var(--hairline)] rounded-sm px-3 py-1.5 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("button",{onClick:()=>k(r.ref),className:"mono text-[10px] uppercase tracking-[0.18em] px-1.5 py-0.5 border border-[color:var(--hairline)] rounded-sm hover:bg-black/5",children:r.ref}),e.jsxs("span",{className:"truncate",children:[r.original_name," ",e.jsxs("span",{className:"text-xs text-[color:var(--ink-soft)]",children:["(",Math.round(r.bytes/1024)," KB)"]})]})]}),e.jsx("button",{disabled:t.assignment.read_only,onClick:()=>B(r.id),className:"mono text-[11px] uppercase tracking-[0.18em] hover:underline disabled:opacity-40 disabled:no-underline",children:"Open (signed, 5m)"})]},r.id))}),A(t.answers.other_links).length>0&&e.jsxs("div",{className:"text-xs text-[color:var(--ink-soft)]",children:["other links: ",A(t.answers.other_links).join(" · ")]})]}),!t.assignment.read_only&&e.jsx("section",{className:"mb-6 border border-[color:var(--hairline)] rounded-sm p-3",children:_?e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"mono text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:"Recuse (assignment ends, admins notified, re-assignment blocked)"}),e.jsx("textarea",{value:f,onChange:r=>O(r.target.value),rows:3,placeholder:"Reason for recusal (≥20 chars) — stored in the audit trail.",className:"w-full border border-[color:var(--hairline)] rounded-sm p-2 text-sm"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{className:"btn btn-ink text-sm",disabled:v,onClick:L,children:"Submit recusal"}),e.jsx("button",{className:"mono text-[11px] uppercase tracking-[0.18em]",onClick:()=>R(!1),children:"Cancel"})]})]}):e.jsx("button",{className:"mono text-[11px] uppercase tracking-[0.18em] hover:underline",onClick:()=>R(!0),children:"I have a conflict — recuse me from this application"})}),!_&&!t.assignment.read_only&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-xs text-[color:var(--ink-soft)] mb-3",children:[e.jsx("b",{children:t.rubric.method})," · Anchors:"," ",t.rubric.anchors.map((r,s)=>e.jsxs("span",{children:[s>0?" · ":"",r]},s))]}),t.rubric.criteria.map(r=>{const s=m[r.key]??{score:0,evidence_reference:"",rationale:""},o=s.evidence_reference.trim().length===0||S.has(s.evidence_reference.trim());return e.jsxs("div",{className:"mb-4 border border-[color:var(--hairline)] rounded-sm p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium",children:r.label}),e.jsx("span",{className:"ml-2 text-xs text-[color:var(--ink-soft)]",children:r.group})]}),e.jsx("div",{className:"flex gap-1",children:[0,1,2,3,4].map(a=>e.jsx("button",{type:"button",onClick:()=>j(r.key,{score:a}),className:`w-8 h-8 rounded-sm border text-sm ${s.score===a?"bg-[color:var(--ink)] text-[color:var(--paper)] border-[color:var(--ink)]":"border-[color:var(--hairline)]"}`,children:a},a))})]}),e.jsx("div",{className:"text-xs text-[color:var(--ink-soft)] mb-2",children:r.anchors&&r.anchors[s.score]||t.rubric.anchors[s.score]||""}),r.description?e.jsx("div",{className:"text-[11px] text-[color:var(--ink-soft)] italic mb-2",children:r.description}):null,e.jsxs("select",{className:`w-full mb-1 border rounded-sm p-2 text-sm font-mono bg-transparent ${o?"border-[color:var(--hairline)]":"border-red-500"}`,value:s.evidence_reference,onChange:a=>j(r.key,{evidence_reference:a.target.value}),children:[e.jsx("option",{value:"",children:"— pick an evidence reference —"}),g.map(a=>e.jsxs("option",{value:a.ref,children:[a.ref," — ",a.label]},a.ref))]}),!o&&e.jsx("div",{className:"text-[11px] text-red-700 mb-1",children:"Not a workspace reference — pick from the list."}),e.jsx("textarea",{className:"w-full border border-[color:var(--hairline)] rounded-sm p-2 text-sm",rows:2,placeholder:"Rationale (≥20 chars)",value:s.rationale,onChange:a=>j(r.key,{rationale:a.target.value})})]},r.key)}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-3 mb-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mono text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)] block mb-2",children:"Recommendation"}),e.jsxs("select",{value:w,onChange:r=>F(r.target.value),className:"w-full border border-[color:var(--hairline)] rounded-sm p-2 text-sm",children:[e.jsx("option",{value:"strong_yes",children:"Strong yes"}),e.jsx("option",{value:"yes",children:"Yes"}),e.jsx("option",{value:"discuss",children:"Discuss"}),e.jsx("option",{value:"not_now",children:"Not now"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mono text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)] block mb-2",children:"Suggested team"}),e.jsxs("select",{value:h,onChange:r=>E(r.target.value),className:"w-full border border-[color:var(--hairline)] rounded-sm p-2 text-sm",children:[e.jsx("option",{value:"",children:"— select team —"}),t.teams.map(r=>
1e.jsx("option",{value:r.id,children:r.name},r.id))]})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mono text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)] block mb-2",children:"Interview focus (≥20 chars — what should the panel probe?)"}),e.jsx("textarea",{value:b,onChange:r=>D(r.target.value),rows:4,className:"w-full border border-[color:var(--hairline)] rounded-sm p-3 text-sm"})]}),e.jsx("button",{className:"btn btn-signal",disabled:v,onClick:P,children:v?"Submitting…":"Submit review"})]})]})}function q(n){return n==null?!0:typeof n=="string"?n.trim()==="":Array.isArray(n)?n.length===0:!1}function J({refId:n,value:l,onCopy:d}){if(q(l))return null;const t=Array.isArray(l)?l.map(String).join(", "):typeof l=="object"?JSON.stringify(l):String(l);return e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-2 mb-1",children:e.jsx("button",{onClick:()=>d(n),className:"mono text-[10px] uppercase tracking-[0.18em] px-1.5 py-0.5 border border-[color:var(--hairline)] rounded-sm hover:bg-black/5",children:n})}),e.jsx("div",{className:"text-sm whitespace-pre-wrap",children:t})]})}function u({label:n,value:l,small:d=!1}){return l==null||l===""?null:e.jsxs("div",{children:[e.jsx("div",{className:"mono uppercase tracking-[0.18em] text-[color:var(--ink-soft)] mb-1 text-[10px]",children:n}),e.jsx("div",{className:"text-sm whitespace-pre-wrap",children:String(l)})]})}export{Q as component};

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.