PageSourceSearch

https://sortd.automateboring.ai/assets/HiringOnboardingInk-CqVx4sc4.js

js automateboring.ai collected 2026-09-24 14:30:38 UTC 14,724 bytes, 1 lines download raw bytes

1import{t as re,v as se,a5 as oe,l as de,w as M,r as _,j as t,a as G,I as le}from"./index-lDgJwfvj.js";import{C as ce}from"./ConfirmActionDialog-DLQTRYY4.js";import{H as ue}from"./Hiring-DapIZNz1.js";import{a as pe}from"./StageChangeConfirmDialog-Dewf8Vsh.js";import{u as me,f as fe,g as E,O as ge,a as L,S as v,M as he}from"./OnboardingStepCellModal-Db6Y3AsM.js";import{M as ve}from"./MonoValue-DZ0BKYe_.js";import{R as xe,c as _e,a as be,b as Se}from"./RuleCard-DVs2j-vX.js";import{E as O,S as ye,b as W,A as m}from"./overlays-ePGuX7O_.js";import{k as je}from"./use-hiring-candidates-CaPPg5GZ.js";import"./sms-variable-utils-aqkycXUg.js";import"./badge-_LyufwSX.js";import"./send-B8L0S-hD.js";import"./hiring-contact-BUN6uMhV.js";import"./trash-2-Ce2BqeQA.js";import"./use-click-to-call-tC8nWVMA.js";import"./candidate-pipeline-CMKpAutH.js";import"./ellipsis-ZcpG-Tl-.js";import"./user-round-C3jah7oY.js";import"./phone-C_MPOIGo.js";import"./pencil-B79mKNxM.js";import"./use-hiring-templates-nRaqi3tC.js";import"./use-hiring-settings-QWjwRQmT.js";import"./rotate-ccw-AdEJ5chN.js";import"./chevron-left-nlIGb7XP.js";import"./chevron-right-DnpOQBUQ.js";import"./layout-A0Ng9siJ.js";import"./separator-BC7IDIGC.js";import"./useInfiniteQuery-CoD7rcxY.js";import"./ellipsis-vertical-ZOHJaCIW.js";import"./use-search-source-access-BbQCvrdC.js";const ke=6,V=50,I=new Set(["complete","override_active"]),Ce=new Set(["complete","override_active","invite_sent","awaiting_amazon","failed","withdrawn"]),Ne="active_driver",Ee="set_active",Re={gmail_pending:"Send Gmail invite",drug_test:"Send drug test SMS",payroll_sent:"Send payroll link",i9_pending:"Send I-9 request"},Ae={amazon_invite:"Mark Amazon invite done",payroll_done:"Mark payroll done",i9_done:"Mark I-9 done",training_sched:"Mark training scheduled",training_done:"Mark training done"},$e="w-[208px]",Te="[&>div>div>div:last-child]:w-[208px]";function b(e){return`${e.first_name||""} ${e.last_name||""}`.trim()||"Unnamed candidate"}function R(e){if(!e)return null;const a=Date.parse(e);return Number.isFinite(a)?a:null}function S(e){const a=R(e);return a==null?"not recorded":new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(new Date(a))}function we(e){return R(e.hired_at)==null?"hire date not recorded":`hired ${S(e.hired_at)}`}function K(e){return!!(e&&!e.fromLegacyStage&&Ce.has(e.state))}function Y(e){return v.filter(a=>K(e.cells[a])).length}function De(e){return v.filter(a=>e.cells[a]?.fromLegacyStage).length}function Me(e){return e.fromLegacyStage?"Indicated by pipeline stage · timestamp not recorded":e.completedAt?`Complete · ${S(e.completedAt)}`:e.inviteSentAt?`${I.has(e.state)?"Complete":"Invite sent"} · ${S(e.inviteSentAt)}`:e.overrideUntil?`Override through ${S(e.overrideUntil)}`:e.state==="complete"?"Complete · timestamp not recorded":e.state==="override_active"?"Complete by override · timestamp not recorded":e.state==="invite_sent"?"In progress · sent time not recorded":e.state==="awaiting_amazon"?"Amazon progress recorded · timestamp not recorded":e.state==="failed"?e.failedReason?`Failed · ${e.failedReason}`:"Failed · reason not recorded":e.state==="withdrawn"?e.failedReason?`Withdrawn · ${e.failedReason}`:"Withdrawn · reason not recorded":e.state==="opted_out"?"SMS opted out · progress not evaluated":e.state==="na"?"Not tracked for this record":"Not recorded"}function Oe(e){return e.kind==="legacy_da"?"No candidate record 
1is linked":e.contactability_reason==="opted_out"||e.opted_out?"Candidate opted out of SMS":e.contactability_reason==="missing_or_invalid_phone"?"No valid phone on file":e.contactable!==!0?"Contactability was not verified":null}function Le(e,a){return e.kind!=="candidate"||!e.candidate_id?"No candidate record is linked":e.phone?.trim()?e.opted_out||e.contactability_reason==="opted_out"?"Candidate opted out of SMS":a?null:"Hiring messaging access required":"No phone on file"}function A(e){return e.kind==="candidate"&&v.every(a=>I.has(e.cells[a]?.state))}function P(e){if(e.kind!=="candidate")return null;const a=Z(e);return!a||e.cells[a]?.state!=="not_started"?null:E.has(a)||he.has(a)?a:null}function U(e){return v.find(a=>e.cells[a]?.stale===!0)??null}function Z(e){return v.find(a=>!I.has(e.cells[a]?.state))??null}function Ie(e){return U(e)?"stalled":A(e)||P(e)?"waiting":"pace"}function J(e,a){return a==="waiting"?P(e):a==="stalled"?U(e):Z(e)}function Pe(e,a){if(e.kind!=="candidate"||!e.candidate_id)return null;if(a==="stalled"){const o=U(e);return o&&E.has(o)?{kind:"step",step:o,label:"Nudge"}:{kind:"text"}}if(A(e))return{kind:"convert"};const i=P(e);return i?E.has(i)?{kind:"step",step:i,label:Re[i]??`Send ${L[i]}`}:{kind:"step",step:i,label:Ae[i]??`Mark ${L[i]} done`}:null}function Ue(e,a){if(A(e))return"All 13 steps recorded — ready to convert";const i=J(e,a);if(!i)return"No next step recorded";const o=e.cells[i],x=a==="stalled"&&typeof o?.staleDays=="number"&&Number.isFinite(o.staleDays)?` · ${o.staleDays} day${o.staleDays===1?"":"s"} without movement`:"";return`${L[i]} · ${Me(o)}${x}`}function ze(e,a){if(A(e)){const f=v.map(l=>R(e.cells[l]?.completedAt??e.cells[l]?.inviteSentAt)).filter(l=>l!=null).sort((l,n)=>n-l)[0];return f==null?"—":S(new Date(f).toISOString())}const i=J(e,a),o=i?e.cells[i]:void 0,x=o?.inviteSentAt??o?.completedAt??o?.overrideUntil;return R(x)==null?"—":S(x)}function Fe(e){return e.kind!=="candidate"||!e.candidate_id?null:{id:e.candidate_id,company_id:"",first_name:e.first_name??"",last_name:e.last_name,phone:e.phone??"",email:null,pipeline_stage:e.pipeline_stage??"",indeed_tier:null,relevant_experience:null,availability_notes:null,hired_at:e.hired_at,active_since:null,notes:null,disqualification_reason:null,source:null,intake_station_code:e.intake_station_code,intake_link_sent_at:null,intake_reinvite_sent_at:null,created_at:"",updated_at:"",tags:[],next_appointment:null,last_no_show_appointment:null,sms_opted_out:e.opted_out}}function qe({row:e}){const a=Y(e);return t.jsx("span",{className:"flex flex-none gap-0.5",role:"img","aria-label":`${a} of 13 steps have direct recorded evidence`,children:v.map(i=>t.jsx("span",{className:G("h-2 w-2 rounded-sm",K(e.cells[i])?"bg-ink":"bg-hairline")},i))})}function _t({onTotalChange:e}={}){const{selectedStationCode:a}=re(),i=se(),{openWithCandidate:o}=oe(!1),x=je(),{toast:f}=de(),l=M(i.data,"hiring.view",{stationCode:a,operation:"read"}),n=me(a,!!(i.data&&l),{pageSize:V}),[z,Q]=_.useState(()=>new Set),[$,T]=_.useState(null),[j,w]=_.useState(null);_.useEffect(()=>{(!l||n.isError||n.isUnavailable)&&(T(null),w(null))},[l,n.isError,n.isUnavailable]);const X=_.useMemo(()=>{const s={waiting:[],stalled:[],pace:[]};for(const c of n.data?.rows??[])s[Ie(c)].push(c);for(const c of Object.values(s))c.sort((u,d)=>{const g=Date.parse(u.hired_at||"")||0;return(Date.parse(d.hired_at||"")||0)-g||b(u).localeCompare(b(d))});return s},[n.data?.rows]),F=n.data?.rows??[],y=F.filter(s=>s.kind==="candidate").length,p=n.data?.page?.candidate_total??(n.data?.summary_complete?n.data.summary.in_onboarding:null);_.useEffect(()=>{e?.(p)},[p,e]);async function ee(s){if(!s.candidate_id)return;const c=b(s);try{const u=await x.mutateAsync({id:s.candidate_id,tag:Ne}),d=u.workflowResult?.find(g=>g.status==="error");u.workflow!==Ee?f({title:"Tagged, but not converted",description:`${c} carries the active driver tag, but the conversion workflow did not run for this company's hiring mode. Finish from their candidate page.`,variant:"destructive"}):f(d?{title:`${c} converted with one failed step`,description:`${d.type??"A step"} failed: ${d.error??"reason not reported"}. Check their candidate page.`,variant:"destructive"}:{title:`${c} is now a driver`,description:"Stage moved to Active Day 1 and a driver record was created."}),n.refetch()}catch(u){throw f({title:"Could not convert to driver",description:le(u),variant:"destructive"}),u}}if(n.isUnavailable)return t.jsx(O,{reason:"Onboarding records are unavailable in your current access scope.",onRetry:()=>{n.refetch()}});if(i.isLoading||l&&n.isLoading&&!n.data)return t.jsx("div",{className:"overflow-hidden rounded-xl border border-hairline bg-surface",children:t.jsx(ye,{rows:5})});if(!l)return t.jsx(O,{reason:"You don’t have Hiring access for this station."});if(n.isError&&!n.data)return t.jsx(O,{reason:"Couldn’t load onboarding records.",onRetry:()=>{n.refetch()}});if(n.data?.flagDisabled)return t.jsx(W,{kind:"never-connected",title:"Onboarding tracking is not enabled",detail
1:"Ask an administrator to enable onboarding tracking for this company."});if(F.length===0)return t.jsx(W,{kind:"clear",title:"No onboarding records in this station scope",detail:"Candidates appear after they enter a hired or onboarding stage."});const te=[{key:"waiting",name:"Waiting on us"},{key:"stalled",name:"Stalled on them",consequence:`${fe}+ days without movement`},{key:"pace",name:"On pace"}],ne=p==null?0:Math.max(0,p-y);return t.jsx(pe,{available:!n.isError,children:t.jsxs("section",{"aria-label":"Onboarding records",className:"space-y-3",children:[n.isError&&n.data&&t.jsx("p",{role:"alert",className:"rounded-lg border border-warning-line bg-warning-tint px-3 py-2 text-s4 text-warning-deep",children:"The latest onboarding refresh failed. Showing the last loaded records; actions are disabled until a successful refresh."}),n.data?.paginationChanged&&t.jsxs("div",{role:"status",className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-warning-line bg-warning-tint px-3 py-2 text-s4 text-warning-deep",children:[t.jsx("span",{children:"The onboarding queue changed while pages were loading. Counts cover loaded records only. Refresh to load the latest records."}),t.jsx(m,{onClick:()=>{n.refetch()},children:"Refresh onboarding records"})]}),n.data?.paginationUnverified&&!n.data.paginationChanged&&t.jsxs("div",{role:"status",className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-warning-line bg-warning-tint px-3 py-2 text-s4 text-warning-deep",children:[t.jsx("span",{children:"Records were loaded across separate live pages. Counts cover loaded records only, not a verified whole-queue snapshot."}),t.jsx(m,{onClick:()=>{n.refetch()},children:"Refresh onboarding records"})]}),n.data?.truncated&&!n.data.paginationChanged&&!n.data.paginationUnverified&&t.jsx("p",{role:"alert",className:"rounded-lg border border-warning-line bg-warning-tint px-3 py-2 text-s4 text-warning-deep",children:p==null?`This server returned a bounded first ${y} onboarding candidates. More records exist, so group counts are incomplete.`:`Showing ${y} of ${p} onboarding candidates. Group counts cover loaded records only.`}),te.map(({key:s,name:c,consequence:u})=>{const d=X[s],g=z.has(s)?d:d.slice(0,ke);return t.jsxs(xe,{name:c,count:n.data?.truncated?void 0:d.length,code:n.data?.truncated?`${d.length} loaded`:void 0,tone:s==="waiting"?"blocking":s==="stalled"?"drifting":"neutral",consequence:u,metricLabel:"Recorded",action:t.jsx("span",{"aria-hidden":!0,className:G("inline-block",$e)}),className:Te,children:[d.length===0?t.jsx(_e,{children:"No candidates match this recorded state."}):g.map(r=>{const h=Pe(r,s),q=Fe(r),B=!!r.candidate_id&&M(i.data,"hiring.manage",{stationCode:r.intake_station_code,operation:"mutate"}),ae=M(i.data,"messages.hiring.send",{stationCode:r.intake_station_code,operation:"mutate"}),k=n.isError?"Refresh onboarding records before taking action":null,D=De(r),ie=q?t.jsx(ue,{candidate:q,hideDisqualify:!0}):t.jsx("span",{className:"font-ink-mono text-m3 uppercase text-faint",children:"legacy driver record"});let C=null;if(h?.kind==="step"){const N=E.has(h.step)?Oe(r):null,H=k??(B?N:"Hiring manage access required");C=H?t.jsx(m,{size:"sm",disabled:!0,disabledReason:H,children:h.label}):t.jsx(m,{size:"sm",onClick:()=>T({row:r,stepKey:h.step}),children:h.label})}else if(h?.kind==="text"){const N=k??Le(r,ae);C=N?t.jsx(m,{size:"sm",disabled:!0,disabledReason:N,children:"Text"}):t.jsx(m,{size:"sm",onClick:()=>o({candidateId:r.candidate_id??"",phone:r.phone,name:b(r)}),children:"Text"})}else h?.kind==="convert"&&(C=B&&!k?t.jsx(m,{size:"sm",variant:"primary",onClick:()=>w(r),children:"Convert to driver"}):t.jsx(m,{size:"sm",variant:"primary",disabled:!0,disabledReason:k??"Hiring manage access required",children:"Convert to driver"}));return t.jsx(be,{metric:t.jsx(ve,{tone:"muted",children:ze(r,s)}),action:t.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[C,ie]}),evidence:[r.kind==="legacy_da"?"Legacy driver record":null,Ue(r,s),D>0?`${D} step${D===1?"":"s"}
1 inferred from pipeline stage`:null].filter(Boolean).join(" · "),children:t.jsxs("span",{className:"flex min-w-0 items-center gap-4",children:[t.jsxs("span",{className:"min-w-[170px] flex-1 truncate",children:[t.jsx("span",{className:"font-medium text-ink",children:b(r)}),t.jsx("span",{className:"block text-s5 font-normal text-subtle",children:we(r)})]}),t.jsx(qe,{row:r}),t.jsxs("span",{className:"font-ink-mono text-m3 text-subtle",children:[Y(r),"/13 recorded"]})]})},r.row_id)}),!z.has(s)&&d.length>g.length&&t.jsx(Se,{count:d.length-g.length,label:`View all ${d.length}${n.data?.truncated?" loaded":""}`,onClick:()=>Q(r=>new Set(r).add(s))})]},s)}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl border border-hairline bg-surface px-4 py-3",children:[t.jsx("p",{className:"text-s4 font-normal text-subtle",children:p==null?`${y} loaded · total not reported by this server`:`${y} loaded of ${p} in onboarding`}),n.hasNextPage&&p!=null&&t.jsx(m,{onClick:()=>{n.fetchNextPage()},"aria-busy":n.isFetchingNextPage||void 0,children:n.isFetchingNextPage?"Loading more candidates…":`Load next ${Math.min(V,ne)} candidates`})]}),t.jsx("p",{className:"px-1 text-s5 text-subtle",children:"First-day time, onboarding capacity, missing documents, DOT status, and vendor response times are not recorded by this source."}),$&&!n.isError&&t.jsx(ge,{open:!0,row:$.row,stepKey:$.stepKey,onClose:()=>T(null)}),j&&!n.isError&&t.jsx(ce,{open:!0,onOpenChange:s=>{s||w(null)},title:`Convert ${b(j)} to a driver?`,consequence:t.jsxs("div",{className:"space-y-2",children:[t.jsxs("p",{children:["Moves them to Active Day 1, tags them as an active driver, stamps today as their active-since date, and creates their driver record from their name and phone",j.phone?.trim()?".":" — no phone is on file, so that record will have none until one is added."]}),t.jsx("p",{children:"This is the same action as the Active driver tag on their candidate page. Removing the tag later does not undo it."})]}),confirmLabel:"Convert to driver",destructive:!1,onConfirm:()=>ee(j)})]})})}export{_t as HiringOnboardingInk};

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.