PageSourceSearch

https://www.tracefiction.com/assets/SuggestionsPage-BGApgL5t.js

js tracefiction.com collected 2026-10-02 01:46:37 UTC 33,355 bytes, 1 lines download raw bytes

1import{r as p,j as e,L as ee}from"./vendor-react-2mXWPygV.js";import{w as te,x as Se,y as B,E as Ce}from"./vendor-app-Dz59apZY.js";import{ar as Re,as as Te,t as Ie,B as ne,at as P,au as Me,c as ae,av as re,u as se,q as j,T as Ae,b as Ee,D as Y,z as X,aw as De,ax as ze,ay as Be,A as $e}from"./index-Cp6Mk7n4.js";import{b as L,ag as G,am as Pe,aG as Le,P as O,a9 as Z,z as Ge,a3 as He,Z as Ke,O as ie,b0 as Oe,ay as Qe}from"./vendor-ui-BInLtbYF.js";import{M as qe}from"./mobile-primary-header.component-utDTvT7I.js";import{R as Fe}from"./rating.component-DPDKD9Os.js";const We="library-main-canvas relative min-h-[calc(100dvh-4rem)] w-full min-w-0 overflow-x-hidden pb-[max(6rem,env(safe-area-inset-bottom))]",oe="font-normal italic text-[var(--rust)]",Ue="relative mx-auto flex w-full min-w-0 max-w-[96rem] flex-col px-[18px] pb-[calc(6.5rem+env(safe-area-inset-bottom))] sm:px-12 sm:pb-16 lg:px-16",Ve="sticky top-0 z-20 border-b border-[var(--line)] bg-[color-mix(in_oklab,var(--paper)_92%,transparent)] backdrop-blur-md sm:relative sm:top-auto sm:z-auto sm:bg-transparent sm:backdrop-blur-0",Ye="mx-auto flex w-full max-w-[96rem] min-w-0 flex-wrap items-baseline gap-x-3 gap-y-1 px-[18px] py-3 sm:px-12 sm:py-5 lg:px-16",Xe="m-0 font-landing-serif text-2xl font-medium leading-tight tracking-normal text-[var(--ink)] sm:text-3xl",Ze="m-0 font-mono text-[0.68rem] leading-5 tracking-normal text-[var(--ink-4)]",Je="ml-auto font-mono text-[0.65rem] leading-5 tracking-normal text-[var(--ink-5)] max-sm:hidden",et="grid min-w-0 gap-7 pt-5 lg:grid-cols-[minmax(0,1fr)_320px] lg:items-start",tt="min-w-0",nt="px-1 pb-3",at="m-0 font-mono text-[0.66rem] font-medium uppercase leading-5 tracking-normal text-[var(--ink-4)]",rt="m-0 mt-1 max-w-2xl text-xs leading-5 text-[var(--ink-3)] sm:text-sm sm:leading-6",st="grid min-w-0 gap-3",le="min-w-0 rounded-[14px] border border-[var(--line-strong)] bg-[var(--card)] px-4 py-[15p
1x] shadow-[0_1px_0_color-mix(in_oklab,var(--ink)_5%,transparent)] sm:px-5 sm:py-4",ce="flex min-w-0 items-center gap-3",de="font-mono text-[0.6rem] font-medium uppercase leading-4 tracking-normal text-[var(--forest)]",it="font-mono text-[0.62rem] font-medium uppercase leading-4 tracking-normal text-[var(--ink-3)]",me="ml-auto size-4 shrink-0 text-[var(--ink-5)]",xe="m-0 mt-2 text-pretty font-landing-serif text-[1.18rem] font-medium leading-tight tracking-normal text-[var(--ink)] sm:text-[1.34rem]",pe="m-0 mt-1 max-w-3xl text-[0.84rem] font-medium leading-5 text-[var(--ink-2)]",$="m-0 font-mono text-[0.62rem] font-medium uppercase leading-4 tracking-normal text-[var(--ink-3)]",ue=L(["inline-flex min-h-9 items-center justify-center gap-2 whitespace-nowrap rounded-[9px] border px-3","text-[0.8rem] font-medium leading-none tracking-normal","transition-[background-color,border-color,color,box-shadow,transform] duration-150 ease-out","hover:-translate-y-0.5 active:translate-y-0","focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_color-mix(in_oklab,var(--honey)_20%,transparent)]","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none"].join(" "),{variants:{tone:{finished:"border-[color-mix(in_oklab,var(--status-completed)_40%,transparent)] bg-[color-mix(in_oklab,var(--status-completed)_12%,transparent)] text-[var(--status-completed)] hover:border-[color-mix(in_oklab,var(--status-completed)_70%,transparent)] hover:bg-[color-mix(in_oklab,var(--status-completed)_22%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_oklab,var(--status-completed)_22%,transparent)]",abandoned:"border-[color-mix(in_oklab,var(--rust)_40%,transparent)] bg-[color-mix(in_oklab,var(--rust)_10%,transparent)] text-[var(--rust)] hover:border-[color-mix(in_oklab,var(--rust)_68%,transparent)] hover:bg-[color-mix(in_oklab,var(--rust)_18%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_oklab,var(--rust)_20%,transparent)]",caughtup:"border-[color-mix(in_oklab,var(--status-caught-up)_40%,transparent)] bg-[color-mix(in_oklab,var(--status-caught-up)_13%,transparent)] text-[var(--status-caught-up)] hover:border-[color-mix(in_oklab,var(--status-caught-up)_68%,transparent)] hover:bg-[color-mix(in_oklab,var(--status-caught-up)_24%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_oklab,var(--status-caught-up)_22%,transparent)]",hiatus:"border-[color-mix(in_oklab,var(--honey)_40%,transparent)] bg-[color-mix(in_oklab,var(--honey)_13%,transparent)] text-[var(--honey)] hover:border-[color-mix(in_oklab,var(--honey)_68%,transparent)] hover:bg-[color-mix(in_oklab,var(--honey)_24%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_oklab,var(--honey)_22%,transparent)]"},block:{true:"w-full justify-between px-4",false:""}},defaultVariants:{tone:"finished",block:!1}}),ve="inline-flex min-w-0 items-center gap-2 text-left",he="shrink-0 font-mono text-[0.62rem] font-medium uppercase leading-none tracking-normal opacity-75",ge=L("size-1.5 shrink-0 rounded-pill bg-current",{variants:{tone:{finished:"text-[var(--status-completed)]",abandoned:"text-[var(--rust)]",hiatus:"text-[var(--honey)]",caughtup:"text-[var(--status-caught-up)]"}},defaultVariants:{tone:"finished"}}),ot="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 [--rating-star-off:var(--ink-4)] [--rating-star-on:var(--honey)] [--rating-star-preview:var(--honey)]",lt="shrink-0",ct="mt-4 grid gap-3 rounded-[11px] border border-[var(--line)] bg-[color-mix(in_oklab,var(--paper-2)_70%,transparent)] p-3",dt="grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-start gap-3",mt="grid min-w-0 gap-3 lg:grid-cols-[minmax(18rem,1fr)_minmax(13rem,0.58fr)] lg:items-start",xt="grid min-w-0 gap-1.5",pt="min-h-[4.75rem] rounded-[8px] border-[var(--line)] bg-[var(--paper)] px-3 py-2 text-sm leading-5 text-[var(--ink)] placeholder:text-[var(--ink-4)] focus-visible:border-[color-mix(in_oklab,var(--honey)_45%,var(--line))] focus-visible:shadow-[0_0_0_2px_color-mix(in_oklab,var(--honey)_18%,transparent)]",ut="relative grid min-w-0 gap-1.5",vt="flex min-h-[2.5rem] min-w-0 flex-wrap items-center gap-1.5 rounded-[8px] border border-[var(--line)] bg-[var(--paper)] px-2 py-1.5 focus-within:border-[color-mix(in_oklab,var(--honey)_45%,var(--line))] focus-within:shadow-[0_0_0_2px_color-mix(in_oklab,var(--honey)_18%,transparent)]",ht="h-7 min-w-[7.5rem] flex-1 border-0 bg-transparent px-1 text-sm leading-5 text-[var(--ink)] outline-none placeholder:text-[var(--ink-4)] disabled:cursor-not-allowed disabled:opacity-60",gt="inline-flex min-h-7 shrink-0 items-center justify-center gap-1 rounded-[7px] border border-[var(--line)] bg-[var(--paper-2)] px-2.5 font-sans text-xs font-semibold text-[var(--ink-2)] transition hover:border-[var(--line-strong)] hover:bg-[var(--paper-3)] disabled:cursor-not-allowed disabled:opacity-45 [&_svg]:size-3.5",bt="inline-flex min-h-7 max-w-full items-center gap-1.5 rounded-pill border border-[color-mix(in_oklab,var(--honey)_26%,var(--line))] bg-[color-mix(in_oklab,var(--honey)_9%,transparent)] px-2.5 font-sans text-xs font-semibold text-[var(--ink-2)] [&_svg]:size-3.5",kt="inline-flex size-5 shrink-0 items-center justify-center rounded-pill text-[var(--ink-3)] transition hover:bg-[var(--paper-3)] hover:text-[var(--ink)] disabled:cursor-not-allowed disabled:opacity-50",ft="absolute left-0 right-0 top-[calc(100%+0.375rem)] z-30 overflow-hidden rounded-[8px] border border-[var(--line)] bg-[var(--paper)] shadow-[0_10px_28px_color-mix(in_oklab,var(--ink)_16%,transparent)]",_t="flex min-w-0 items-center gap-1.5 border-b border-[var(--line)] px-2.5 py-1.5 font-mono text-[0.58rem] font-medium uppercase leading-4 tracking-normal text-[var(--ink-4)] [&_svg]:size-3.5",yt="px-2.5 py-2 text-xs leading-5 text-[var(--ink-4)]",jt="block w-full px-2.5 py-2 text-left text-xs font-medium leading-5 text-[var(--ink-3)] hover:bg-[var(--paper-2)] hover:text-[var(--ink)]",wt=L("flex min-w-0 
1w-full items-center gap-2 px-2.5 py-2 text-left text-xs font-semibold leading-5 text-[var(--ink-2)] transition-colors [&_svg]:size-3.5 [&_svg]:shrink-0",{variants:{active:{true:"bg-[color-mix(in_oklab,var(--honey)_12%,transparent)] text-[var(--ink)]",false:"hover:bg-[var(--paper-2)] hover:text-[var(--ink)]"}},defaultVariants:{active:!1}}),be="min-h-8 rounded-[8px] border-transparent bg-[var(--honey)] px-3 text-xs font-semibold text-[var(--paper)] hover:bg-[color-mix(in_oklab,var(--honey)_88%,white)] disabled:opacity-45",Nt="min-h-9 rounded-[9px] border-[var(--line-strong)] px-3 font-mono text-[0.68rem] uppercase tracking-normal text-[var(--ink-3)] hover:text-[var(--ink)]",St="m-0 mt-3 rounded-[9px] border border-[var(--line)] bg-[var(--paper-2)] px-3 py-2 font-mono text-[0.68rem] uppercase tracking-normal text-[var(--ink-3)]",Ct="m-0 px-6 py-4 text-center text-xs leading-5 text-[var(--ink-4)]",Rt="grid min-w-0 grid-cols-[1.5rem_minmax(0,1fr)_auto] items-center gap-3 rounded-[16px] border border-[var(--line)] bg-[var(--paper-2)] px-4 py-3 sm:grid-cols-[1.5rem_minmax(0,1fr)_auto_auto]",Tt="grid min-w-0 grid-cols-[1.5rem_minmax(0,1fr)_auto] items-center gap-3 rounded-[16px] border border-dashed border-[var(--line-strong)] bg-transparent px-4 py-3 sm:grid-cols-[1.5rem_minmax(0,1fr)_auto_auto]",It="grid size-6 place-items-center rounded-pill bg-[color-mix(in_oklab,var(--forest)_12%,transparent)] text-[var(--forest)] [&_svg]:size-4",Mt="grid size-6 place-items-center rounded-pill bg-[color-mix(in_oklab,var(--ink-4)_10%,transparent)] text-[var(--ink-4)] [&_svg]:size-4",At="min-w-0",Et="m-0 font-mono text-[0.62rem] font-medium uppercase leading-4 tracking-normal text-[var(--forest)]",Dt="m-0 font-mono text-[0.62rem] font-medium uppercase leading-4 tracking-normal text-[var(--ink-4)]",zt="m-0 text-sm leading-5 text-[var(--ink-2)] [&_b]:font-medium [&_b]:text-[var(--ink)]",Bt="mt-1 block font-mono text-[0.62rem] font-medium uppercase leading-4 tracking-normal text-[var(--ink-4)]",$t="hidden whitespace-nowrap text-sm leading-none text-[var(--honey)] sm:inline-flex sm:gap-0.5",Pt="min-h-8 rounded-[8px] px-2 font-mono text-[0.68rem] font-medium uppercase leading-none tracking-normal text-[var(--ink-4)] hover:text-[var(--ink-2)] focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_color-mix(in_oklab,var(--honey)_18%,transparent)] disabled:cursor-not-allowed disabled:opacity-50",Lt="flex min-w-0 items-center gap-3 rounded-[16px] border border-[var(--line-strong)] bg-[var(--card)] px-4 py-4 text-left transition-colors hover:border-[color-mix(in_oklab,var(--honey)_36%,var(--line-strong))] focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_color-mix(in_oklab,var(--honey)_18%,transparent)]",Gt="grid size-10 shrink-0 place-items-center rounded-[11px] bg-[color-mix(in_oklab,var(--forest)_12%,transparent)] text-[var(--forest)] [&_svg]:size-5",Ht="grid min-w-0 flex-1 gap-1",Kt="font-landing-serif text-[1.08rem] font-medium leading-tight text-[var(--ink)]",Ot="text-xs leading-5 text-[var(--ink-4)]",Qt="size-5 shrink-0 text-[var(--honey)]",qt="grid min-w-0 gap-5 border-t border-[var(--line)] pt-4 lg:sticky lg:top-5 lg:border-t-0 lg:pt-0",F="grid min-w-0 gap-3",W="m-0 font-mono text-[0.66rem] font-medium uppercase leading-5 tracking-normal text-[var(--ink-4)] [&_span]:text-[var(--ink-5)]",U="group flex min-w-0 w-full items-center gap-3 rounded-[13px] border border-dashed border-[var(--line-strong)] bg-transparent px-4 py-3 text-left no-underline transition-[background-color,border-color,box-shadow,transform] duration-150 ease-out hover:-translate-y-0.5 hover:border-[color-mix(in_oklab,var(--honey)_62%,var(--line-strong))] hover:bg-[color-mix(in_oklab,var(--honey)_10%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_oklab,var(--honey)_16%,transparent)] active:translate-y-0 focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_color-mix(in_oklab,var(--honey)_18%,transparent)]",Ft="shrink-0 text-[var(--ink-4)] transition-colors group-hover:text-[var(--honey)] [&_svg]:size-4",Wt="grid min-w-0 flex-1 gap-0.5",Ut="text-sm leading-5 text-[var(--ink-2)] transition-colors group-hover:text-[var(--ink)]",Vt="font-mono text-[0.64rem] leading-4 tracking-normal text-[var(--ink-5)] transition-colors group-hover:text-[var(--ink-4)]",Yt="relative overflow-hidden rounded-[14px] border border-[var(--line)] bg-[var(--card)] px-4 py-3",Xt="absolute left-0 top-0 h-full w-[3px] bg-[var(--honey)]",Zt="m-0 font-mono text-[0.62rem] font-medium uppercase leading-4 tracking-normal text-[var(--honey)]",Jt="m-0 mt-2 font-landing-serif text-lg font-medium leading-tight text-[var(--ink)]",en="m-0 mt-1 text-xs leading-5 text-[var(--ink-3)]",tn="mt-3 flex flex-wrap gap-2",nn="min-h-9 rounded-[9px] px-2 text-xs font-medium text-[var(--ink-4)] hover:text-[var(--ink-2)] focu
1s-visible:outline-none focus-visible:shadow-[0_0_0_2px_color-mix(in_oklab,var(--honey)_18%,transparent)]",an="grid min-w-0 gap-6 pt-5 lg:grid-cols-[minmax(0,1fr)_320px] lg:items-start",rn="flex min-h-[16rem] flex-col items-center justify-center px-6 py-10 text-center sm:min-h-[22rem] sm:py-12",ke="grid size-[60px] place-items-center rounded-pill bg-[color-mix(in_oklab,var(--forest)_12%,transparent)] text-[var(--forest)] [&_svg]:size-8",fe="m-0 mt-5 font-landing-serif text-2xl font-medium leading-tight text-[var(--ink)]",_e="m-0 mt-2 max-w-[18rem] text-sm leading-6 text-[var(--ink-3)]",sn=L("mt-5 grid min-w-0 grid-cols-[2.75rem_minmax(0,1fr)] gap-4 rounded-[16px] border p-4 sm:p-6",{variants:{kind:{loading:"border-[var(--line)] bg-[var(--card)]",error:"border-[color-mix(in_oklab,var(--rust)_32%,transparent)] bg-[color-mix(in_oklab,var(--rust)_6%,transparent)]"}},defaultVariants:{kind:"loading"}}),on=L("grid size-11 place-items-center rounded-[11px] border [&_svg]:size-5",{variants:{kind:{loading:"border-[var(--line)] bg-[var(--paper-2)] text-[var(--ink-3)]",error:"border-[color-mix(in_oklab,var(--rust)_30%,transparent)] bg-[color-mix(in_oklab,var(--rust)_10%,transparent)] text-[var(--rust)]"}},defaultVariants:{kind:"loading"}}),ln="m-0 font-landing-serif text-xl font-medium leading-tight text-[var(--ink)]",cn="m-0 mt-2 max-w-3xl text-sm leading-6 text-[var(--ink-2)]",dn="mt-4 flex flex-wrap gap-2",mn="library-main-canvas relative min-h-[100dvh] w-full min-w-0 overflow-x-hidden pb-[max(2rem,env(safe-area-inset-bottom))]",xn="sticky top-0 z-20 grid grid-cols-[2rem_minmax(0,1fr)_auto] items-center gap-3 border-b border-[var(--line)] bg-[color-mix(in_oklab,var(--paper)_92%,transparent)] px-4 pb-3 pt-10 backdrop-blur-md sm:px-8 sm:pt-5",pn="grid size-8 place-items-center rounded-[8px] text-[var(--ink-3)] transition-[background-color,color,box-shadow] hover:bg-[color-mix(in_oklab,var(--honey)_8%,transparent)] hover:text-[var(--ink)] focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_color-mix(in_oklab,var(--honey)_18%,transparent)] [&_svg]:size-5",un="m-0 truncate font-landing-serif text-lg font-medium leading-tight text-[var(--ink)]",vn="font-mono text-[0.68rem] leading-5 tracking-normal text-[var(--ink-4)]",hn="col-span-3 h-[3px] overflow-hidden rounded-pill bg-[var(--ink-5)]",gn="block h-full rounded-pill bg-[var(--honey)] transition-[width] duration-200",bn="mx-auto flex min-h-[calc(100dvh-6rem)] w-full max-w-[32rem] flex-col px-5 py-6",kn="flex flex-1 flex-col items-center justify-center px-4 py-16 text-center",fn="flex flex-1 flex-col",_n="m-0 mt-3 text-pretty font-landing-serif text-[1.7rem] font-medium leading-tight text-[var(--ink)]",yn="m-0 mt-2 text-sm leading-6 text-[var(--ink-3)]",ye="mt-3 grid gap-2",jn="mt-4 min-h-11 rounded-[9px] border border-[var(--line)] bg-[color-mix(in_oklab,var(--paper-2)_72%,transparent)] text-center font-mono text-[0.72rem] font-medium uppercase tracking-normal text-[var(--ink-3)] transition-[background-color,border-color,color,box-shadow] hover:border-[color-mix(in_oklab,var(--honey)_38%,var(--line))] hover:bg-[color-mix(in_oklab,var(--honey)_7%,transparent)] hover:text-[var(--ink-2)] focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_color-mix(in_oklab,var(--honey)_18%,transparent)]",wn="mt-3 inline-flex min-h-9 w-fit items-center rounded-[9px] border border-[var(--line)] bg-[color-mix(in_oklab,var(--paper-2)_72%,transparent)] px-3 font-mono text-[0.68rem] font-medium uppercase leading-none tracking-normal text-[var(--ink-3)] transition-[background-color,border-color,color,box-shadow] hover:border-[color-mix(in_oklab,var(--honey)_38%,var(--line))] hover:bg-[color-mix(in_oklab,var(--honey)_7%,transparent)] hover:text-[var(--ink-2)] focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_color-mix(in_oklab,var(--honey)_18%,transparent)] disabled:cursor-not-allowed disabled:opacity-50";function Nn({suggestions:t,workStateBacklog:n=[],weekKey:o,loading:x,error:i,busy:m,onRetry:g,actions:c,model:b,initialResolved:k={},initialStepperOpen:h=!1,tagSuggestionsFetcher:a}){const s=p.useMemo(()=>b??Re(t,n),[b,t,n]),[M,N]=p.useState(k),[A,f]=p.useState(()=>h&&s.groupedEntry?{kind:"grouped",group:s.groupedEntry}:null),[w,C]=p.useState(Te),E=s.gaps.slice(0,w),R=E.filter(d=>!M[d.id]),S=s.groupedEntry,y=R.length+(S?1:0),D=y>0?`${y} need${y===1?"s":""} you · this week`:"all clear",z=A?.group??null,T=Ie()==="app";return z?e.jsx(zn,{group:z,busy:m,actions:c,onBack:()=>f(null)}):e.jsxs("main",{className:We,"aria-labelledby":T?"check-in-mobile-heading":"check-in-heading",children:[T?e.jsx(qe,{title:e.jsxs(e.Fragment,{children:["Check-in",e.jsx("span",{className:oe,children:"."})]}),titleId:"check-in-mobile-heading",titleAriaLabel:"Check-in.",meta:D,runtime:"standalone"}):null,e.jsx(Sn,{countLine:D,weekKey:o,className:T?"max-sm:hidden":void 0}),e.jsx("div",{className:Ue,children:x?e.jsx(J,{kind:"loading",title:"Loading check-in.",body:"Trace is checking what genuinely needs you right now.",icon:e.jsx(G,{})}):i?e.jsx(J,{kind:"error",title:"Could not load check-in.",body:"Your library is unchanged. Retry when the connection is back.",icon:e.jsx(Pe,{}),action:e.jsx(ne,{type:"button",variant:"outline",size:"sm",className:Nt,onClick:g,children:"Retry"})}):y===0?e.jsx(Dn,{railItems:s.railItems,quietMaybe:s.quietMaybe,workStateBacklog:s.workStateBacklog,onOpenWorkStateBacklog:()=>{s.workStateBacklog&&f({kind:"work-state-backlog",group:s.workStateBacklog})}}):e.jsxs("div",{className:et,"aria-busy":m||void 0,children:[e.jsxs("section",{"aria-labelledby":"
1check-in-needs-heading",className:tt,children:[e.jsx(Cn,{intro:s.intro}),e.jsxs("div",{className:st,children:[E.map(d=>{const I=M[d.id];return I?e.jsx(In,{resolved:I,busy:m,onUndo:()=>{const l=I.kind==="skipped";N(_=>{const u={..._};return delete u[d.id],u}),!l&&(d.type==="work-state"?c.onUndoWorkState(d.suggestion):c.onUndoEvaluation(d.suggestion))}},d.id):d.type==="work-state"?e.jsx(Rn,{gap:d,busy:m,onSkip:()=>{C(l=>Math.min(l+1,s.gaps.length)),N(l=>({...l,[d.id]:{kind:"skipped",label:`Skipped / ${d.title}`,detail:"Still unresolved"}}))},onResolve:l=>{C(_=>Math.min(_+1,s.gaps.length)),N(_=>({..._,[d.id]:{kind:"resolved",label:`${Me(l)} / ${d.title}`,detail:`Your status: ${P(l)}`}})),c.onResolveWorkState(d.suggestion,l)}},d.id):e.jsx(Tn,{gap:d,busy:m,tagSuggestionsFetcher:a,onDone:l=>{C(u=>Math.min(u+1,s.gaps.length));const _=[typeof l.rating=="number"&&l.rating>0?`${l.rating} star${l.rating===1?"":"s"}`:null,l.notes?"note":null,l.tags?.length?"tags":null].filter(Boolean);N(u=>({...u,[d.id]:{label:`Captured / ${d.title}`,detail:_.length?`Saved ${_.join(", ")}`:void 0,rating:l.rating}})),c.onSaveEvaluation(d.suggestion,l)}},d.id)}),S?e.jsx(Mn,{group:S,onOpen:()=>f({kind:"grouped",group:S})}):null]}),m?e.jsx("p",{className:St,children:"Updating check-in..."}):null,e.jsx("p",{className:Ct,children:s.footer})]}),e.jsx(je,{railItems:s.railItems,quietMaybe:s.quietMaybe,workStateBacklog:s.workStateBacklog,onOpenWorkStateBacklog:()=>{s.workStateBacklog&&f({kind:"work-state-backlog",group:s.workStateBacklog})}})]})})]})}function Sn({countLine:t,weekKey:n,className:o}){return e.jsx("header",{className:ae(Ve,o),children:e.jsxs("div",{className:Ye,children:[e.jsxs("h1",{id:"check-in-heading",className:Xe,children:["Check-in",e.jsx("span",{className:oe,children:"."})]}),e.jsx("p",{className:Ze,children:t}),n?e.jsx("span",{className:Je,children:n}):null]})})}function Cn({intro:t}){return e.jsxs("div",{className:nt,children:[e.jsx("p",{id:"check-in-needs-heading",className:at,children:"What needs you"}),e.jsx("p",{className:rt,children:t})]})}function Rn({gap:t,busy:n,onResolve:o,onSkip:x}){return e.jsxs("article",{className:le,children:[e.jsxs("div",{className:ce,children:[e.jsx("span",{className:de,children:t.kicker}),e.jsx(G,{"aria-hidden":!0,className:me})]}),e.jsx("h2",{className:xe,children:t.title}),e.jsx("p",{className:pe,children:t.chapterLine}),e.jsx("p",{className:$,children:"Is the story..."}),e.jsx("div",{className:ye,children:re.map(i=>e.jsxs("button",{type:"button",className:ue({tone:i.tone,block:!0}),disabled:n,onClick:()=>o(i.value),"aria-label":`${i.label}; ${P(i.value)}`,children:[e.jsxs("span",{className:ve,children:[e.jsx("span",{className:ge({tone:i.tone}),"aria-hidden":!0}),e.jsx("span",{children:i.label})]}),e.jsx("span",{className:he,children:P(i.value)})]},i.value))}),e.jsx("button",{type:"button",className:wn,disabled:n,onClick:x,children:"Skip"})]})}function Tn({gap:t,busy:n,tagSuggestionsFetcher:o,onDone:x}){const i=se(),[m,g]=p.useState(t.rating),[c,b]=p.useState(""),k=t.suggestion.tags??[],[h,a]=p.useState(k),[s,M]=p.useState(""),[N,A]=p.useState(!1),[f,w]=p.useState(0),C=p.useId(),E=p.useId(),R=p.useId(),S=c.trim(),y=s.trim(),D=m!==t.rating&&m>0,z=S.length>0,T=h.length!==k.length||h.some((r,v)=>r!==k[v]),d=D||z||T,I=i.isReady||!!o,l=te({queryKey:j.library.tagSuggestions({q:y,limit:8}),queryFn:()=>o?o(y,8):i.suggestLibraryTags(y,8),enabled:N&&!n&&I,staleTime:6e4}),_=p.useMemo(()=>new Set(h.map(r=>r.trim().toLowerCase())),[h]),u=p.useMemo(()=>(l.data??[]).filter(r=>!_.has(r.trim().toLowerCase())),[_,l.data]),Q=N&&I&&(l.isPending||l.isError||u.length>0),V=u[f]??null;p.useEffect(()=>{w(0)},[y]),p.useEffect(()=>{f<u.length||w(Math.max(u.length-1,0))},[f,u.length]);const H=p.useCallback(r=>{const v=(r??s).trim();if(!v)return;h.some(q=>q.toLowerCase()===v.toLowerCase())||a(q=>[...q,v]),M(""),w(0)},[s,h]),we=r=>{a(v=>v.filter(K=>K!==r))},Ne=()=>{const r={};D&&(r.rating=m),z&&(r.notes=S),T&&(r.tags=h),Object.keys(r).length&&x(r)};return e.jsxs("article",{className:le,children:[e.jsxs("div",{className:ce,children:[e.jsx("span",{className:it,children:t.kicker}
1),e.jsx(G,{"aria-hidden":!0,className:me})]}),e.jsx("h2",{className:xe,children:t.title}),e.jsx("p",{className:pe,children:t.subline}),e.jsxs("div",{className:ct,children:[e.jsxs("div",{className:dt,children:[e.jsxs("div",{className:ot,children:[e.jsx("span",{className:$,children:"Rating"}),e.jsx(Fe,{value:m,size:"md",disabled:n,"aria-label":`Rate ${t.title}`,className:lt,onChange:r=>g(r)})]}),e.jsx(ne,{type:"button",variant:"solid",size:"sm",className:be,disabled:n||!d,onClick:Ne,children:"Done"})]}),e.jsxs("div",{className:mt,children:[e.jsxs("div",{className:xt,children:[e.jsx("label",{htmlFor:C,className:$,children:"Private note"}),e.jsx(Ae,{id:C,value:c,className:pt,placeholder:"One sentence is enough.",resize:"none",rows:2,disabled:n,onChange:r=>b(r.target.value)})]}),e.jsxs("div",{className:ut,children:[e.jsx("label",{htmlFor:E,className:$,children:"Personal tags"}),e.jsxs("div",{className:vt,children:[h.map(r=>e.jsxs("span",{className:bt,children:[e.jsx(Z,{"aria-hidden":!0}),e.jsx("span",{children:r}),e.jsx("button",{type:"button",className:kt,disabled:n,"aria-label":`Remove ${r}`,onClick:()=>we(r),children:e.jsx(Ge,{"aria-hidden":!0})})]},r)),e.jsx("input",{id:E,value:s,className:ht,placeholder:h.length?"Add tag":"comfort read",disabled:n,"aria-label":`Add a personal tag for ${t.title}`,role:"combobox","aria-expanded":Q,"aria-controls":Q?R:void 0,"aria-autocomplete":"list","aria-activedescendant":V?`${R}-option-${f}`:void 0,onFocus:()=>A(!0),onBlur:()=>A(!1),onChange:r=>M(r.target.value),onKeyDown:r=>{if(r.key==="ArrowDown"&&u.length){r.preventDefault(),w(v=>Math.min(v+1,u.length-1));return}if(r.key==="ArrowUp"&&u.length){r.preventDefault(),w(v=>Math.max(v-1,0));return}if(r.key==="Escape"){A(!1);return}if(r.key==="Enter"){r.preventDefault(),H(V??void 0);return}r.key===","&&(r.preventDefault(),H())}}),e.jsxs("button",{type:"button",className:gt,disabled:n||!s.trim(),onClick:()=>H(),children:[e.jsx(He,{"aria-hidden":!0}),"Add"]})]}),Q?e.jsxs("div",{className:ft,id:R,role:"listbox",children:[e.jsxs("div",{className:_t,children:[e.jsx(Ke,{"aria-hidden":!0}),e.jsx("span",{children:"Existing personal tags"})]}),l.isPending?e.jsx("div",{className:yt,children:"Searching tags..."}):l.isError?e.jsx("button",{type:"button",className:jt,onMouseDown:r=>r.preventDefault(),onClick:()=>{l.refetch()},children:"Could not load tags. Retry"}):u.map((r,v)=>e.jsxs("button",{id:`${R}-option-${v}`,type:"button",role:"option","aria-selected":v===f,className:wt({active:v===f}),onMouseDown:K=>K.preventDefault(),onMouseEnter:()=>w(v),onClick:()=>H(r),children:[e.jsx(Z,{"aria-hidden":!0}),e.jsx("span",{children:r})]},r))]}):null]})]})]})]})}function In({resolved:t,busy:n,onUndo:o}){return e.jsxs("div",{className:t.kind==="skipped"?Tt:Rt,children:[e.jsx("span",{className:t.kind==="skipped"?Mt:It,"aria-hidden":!0,children:t.kind==="skipped"?e.jsx(G,{}):e.jsx(O,{})}),e.jsxs("div",{className:At,children:[e.jsx("p",{className:t.kind==="skipped"?Dt:Et,children:t.kind==="skipped"?"Skipped":"Remembered"}),e.jsxs("p",{className:zt,children:[e.jsx("b",{children:t.label}),t.detail?e.jsx("span",{className:Bt,children:t.detail}):null]})]}),typeof t.rating=="number"?e.jsxs("span",{className:$t,"aria-label":`${t.rating} stars`,children:[t.rating," stars"]}):null,e.jsx("button",{type:"button",className:Pt,disabled:n,onClick:o,children:"Undo"})]})}function Mn({group:t,onOpen:n}){return e.jsxs("button",{type:"button",className:Lt,onClick:n,children:[e.jsx("span",{className:Gt,"aria-hidden":!0,children:e.jsx(ie,{})}),e.jsxs("span",{className:Ht,children:[e.jsx("span",{className:Kt,children:t.title}),e.jsx("span",{className:Ot,children:t.meta})]}),e.jsx(G,{"aria-hidden":!0,className:Qt})]})}function je({railItems:t,quietMaybe:n,workStateBacklog:o,onOpenWorkStateBacklog:x}){if(!t.length&&!n&&!o)return null;const i=t.filter(c=>c.section!=="optional"),m=t.filter(c=>c.section==="optional"),g=c=>c.map(b=>e.jsx(An,{item:b,onOpenWorkStateBacklog:x},b.id));return e.jsxs("aside",{className:qt,"aria-label":"Optional check-in items",children:[m.length?e.jsxs("div",{className:F,children:[e.jsx("p",{className:W,children:"Only if you feel like it"}),g(m)]}):null,i.length?e.jsxs("div",{className:F,children:[e.jsx("p",{className:W,children:"Tidy when you want"}),g(i)]}):null,n?e.jsxs("div",{className:F,children:[e.jsxs("p",{className:W,children:["A quiet maybe ",e.jsx("span",{children:"/ experimental"})]}),e.jsx(En,{quietMaybe:n})]}):null]})}function An({item:t,onOpenWorkStateBacklog:n}){const o=e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:Ft,"aria-hidden":!0,
1children:[t.icon==="bolt"?e.jsx(Qe,{}):null,t.icon==="check"?e.jsx(O,{}):null,t.icon==="layers"?e.jsx(ie,{}):null]}),e.jsxs("span",{className:Wt,children:[e.jsx("span",{className:Ut,children:t.title}),e.jsx("span",{className:Vt,children:t.meta})]})]});return t.action==="work-state-backlog"?e.jsx("button",{type:"button",className:U,onClick:n,children:o}):t.href?e.jsx(ee,{to:t.href,className:U,children:o}):e.jsx("div",{className:U,children:o})}function En({quietMaybe:t}){return e.jsxs("div",{className:Yt,children:[e.jsx("span",{className:Xt,"aria-hidden":!0}),e.jsx("p",{className:Zt,children:t.kicker}),e.jsx("h2",{className:Jt,children:t.title}),e.jsx("p",{className:en,children:t.body}),e.jsxs("div",{className:tn,children:[e.jsxs(ee,{to:t.href,className:ae(Ee({variant:"solid",size:"sm"}),be),children:[e.jsx(Oe,{"aria-hidden":!0}),"Pick it back up"]}),e.jsx("button",{type:"button",className:nn,children:"Not now"})]})]})}function Dn({railItems:t,quietMaybe:n,workStateBacklog:o,onOpenWorkStateBacklog:x}){return e.jsxs("div",{className:an,children:[e.jsxs("section",{className:rn,"aria-labelledby":"all-clear-title",children:[e.jsx("span",{className:ke,"aria-hidden":!0,children:e.jsx(O,{})}),e.jsx("h2",{id:"all-clear-title",className:fe,children:"All clear"}),e.jsx("p",{className:_e,children:"Check-ins appear as you finish reading."})]}),e.jsx(je,{railItems:t,quietMaybe:n,workStateBacklog:o,onOpenWorkStateBacklog:x})]})}function J({kind:t,title:n,body:o,icon:x,action:i}){return e.jsxs("div",{className:sn({kind:t}),children:[e.jsx("span",{className:on({kind:t}),"aria-hidden":!0,children:x}),e.jsxs("div",{children:[e.jsx("h2",{className:ln,children:n}),e.jsx("p",{className:cn,children:o}),i?e.jsx("div",{className:dn,children:i}):null]})]})}function zn({group:t,busy:n,actions:o,onBack:x}){const[i,m]=p.useState(0),g=i>=t.items.length,c=t.items[Math.min(i,t.items.length-1)],b=t.items.length?`${Math.min(i+1,t.items.length)} / ${t.items.length}`:"done";return e.jsxs("main",{className:mn,"aria-labelledby":"check-in-stepper-heading",children:[e.jsxs("header",{className:xn,children:[e.jsxs("button",{type:"button",className:pn,onClick:x,children:[e.jsx(Le,{"aria-hidden":!0}),e.jsx("span",{className:"sr-only",children:"Back to check-in"})]}),e.jsx("h1",{id:"check-in-stepper-heading",className:un,children:t.heading??"Qualify recent finishes"}),g?null:e.jsx("span",{className:vn,children:b}),e.jsx("div",{className:hn,"aria-hidden":!0,children:e.jsx("span",{className:gn,style:{width:`${Math.min(i,t.items.length)/Math.max(t.items.length,1)*100}%`}})})]}),e.jsx("div",{className:bn,children:g?e.jsxs("div",{className:kn,children:[e.jsx("span",{className:ke,"aria-hidden":!0,children:e.jsx(O,{})}),e.jsx("h2",{className:fe,children:t.doneTitle??`All ${t.items.length} sorted`}),e.jsx("p",{className:_e,children:t.doneBody??"Your library is that much more accurate. Nothing else needs you."})]}):e.jsx(Bn,{item:c,busy:n,onResolve:k=>{c.suggestion&&o.onResolveWorkState(c.suggestion,k),m(h=>h+1)},onNext:()=>m(k=>k+1)})})]})}function Bn({item:t,busy:n,onResolve:o,onNext:x}){return e.jsxs("section",{className:fn,children:[e.jsx("p",{className:de,children:t.kicker??`You finished all ${t.chapters} posted chapters`}),e.jsx("h2",{className:_n,children:t.title}),e.jsxs("p",{className:yn,children:["by ",t.author]}),e.jsx("p",{className:$,children:"Is the story..."}),e.jsx("div",{className:ye,children:re.map(i=>e.jsxs("button",{type:"button",className:ue({tone:i.tone,block:!0}),disabled:n,onClick:()=>o(i.value),"aria-label":`${i.label}; ${P(i.value)}`,children:[e.jsxs("span",{className:ve,children:[e.jsx("span",{className:ge({tone:i.tone}),"aria-hidden":!0}),e.jsx("span",{children:i.label})]}),e.jsx("span",{className:he,children:P(i.value)})]},i.value))}),e.jsx("button",{type:"button",className:jn,disabled:n,onClick:x,children:"Skip"})]})}function $n(){const t=se(),n=Se(),o=te({queryKey:j.suggestions,queryFn:()=>t.getSuggestions(),enabled:t.isReady}),x=()=>{n.invalidateQueries({queryKey:j.suggestions})},i=B({mutationFn:a=>t.dismissSuggestion(a),onSuccess:x}),m=B({mutationFn:a=>t.snoozeSuggestion(a,7),onSuccess:x}),g=B({mutationFn:async a=>{await Promise.all(a.map(s=>t.dismissSuggestion(s.fingerprint)))},onSuccess:x}),c=B({mutationFn:a=>t.patchEntry(a.entryId,a.patch),onSuccess:(a,s)=>{Y(s.entryId,s.patch),X(),n.invalidateQueries({queryKey:j.suggestions}),n.invalidateQueries({queryKey:j.library.all}),n.invalidateQueries({queryKey:j.stats.all})}}),b=B({mutationFn:async a=>{await t.patchEntry(a.suggestion.entry_id,a.patch),(typeof a.patch.rating!="number"||a.patch.rating<=0)&&await t.dismissSuggestion(a.suggestion.fingerprint)},onSuccess:(a,s)=>{Y(s.suggestion.entry_id,s.patch),X(),n.invalidateQueries({queryKey:j.suggestions}),n.invalidateQueries({queryKey:j.library.all}),n.invalidateQueries({queryKey:j.stats.all})}}),k=i.isPending||m.isPending||g.isPending||c.isPending||b.isPending,h={onDismiss:a=>i.mutate(a.fingerprint),onDismissAll:a=>g.mutate(Be(a)),onSnooze:a=>m.mutate(a.fingerprint),onPatchStatus:(a,s)=>c.mutate({entryId:a.entry_id,patch:{status:s}}
1),onResolveWorkState:(a,s)=>c.mutate({entryId:a.entry_id,patch:{status:ze(s),progress:a.progress_unit==="CHAPTER"?{unit:"CHAPTER",value:a.chapters_published??a.progress_total??a.progress_value,total:a.progress_total}:void 0,story_snapshot:{work_status_override:s}}}),onUndoWorkState:a=>c.mutate({entryId:a.entry_id,patch:{status:De(a.status)??"READING",story_snapshot:{work_status_override:null}}}),onSaveEvaluation:(a,s)=>b.mutate({suggestion:a,patch:s}),onUndoEvaluation:a=>c.mutate({entryId:a.entry_id,patch:{rating:0,notes:""}}),onClearAbandoned:a=>c.mutate({entryId:a.entry_id,patch:{story_snapshot:{work_status_override:null,abandoned_at_chapters_published:null}}})};return{query:o,suggestions:o.data?.suggestions??[],workStateBacklog:o.data?.work_state_backlog??[],weekKey:o.data?.week_key??"",busy:k,actions:h,retry:()=>{o.refetch()}}}function Qn(){const{query:t,suggestions:n,workStateBacklog:o,weekKey:x,busy:i,actions:m,retry:g}=$n();return e.jsxs($e,{className:"archive-editorial-shell",children:[e.jsx(Ce,{children:e.jsx("title",{children:"trace - Library check-in"})}),e.jsx(Nn,{suggestions:n,workStateBacklog:o,weekKey:x,loading:t.isPending,error:t.isError,busy:i,onRetry:g,actions:m})]})}export{Qn 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.