1import{e as y,j as e,L as r}from"./vendor-react-CbELOEYt.js";import{r as n}from"./charts-DbFxHTAl.js";import{L as b,S as w,B as l,I as _,n as L,c as x,g as p,O as f}from"./index-C3TIOleg.js";import{u as C,R as S}from"./ResearchDiscussions-FlIZgm8l.js";import{b as k,d as q}from"./useGillean-BTjUP6Os.js";import{V as E,j as R,bj as M,K as $}from"./icons-Bx4C25jK.js";import{f as P}from"./vendor-date-cgj7qViA.js";import"./vendor-ui-CMQ6LlpP.js";import"./vendor-supabase-DFdou4aS.js";function A(){var u;const[j]=y(),t=j.get("evidence"),[i,g]=n.useState(""),{data:o,isLoading:v}=C({limit:100}),{data:c}=k(),{data:d}=q(),N=n.useMemo(()=>{const s=new Map;return(c??[]).forEach(a=>s.set(a.id,{label:`Question ${a.ref}`,href:`/research/gillean/questions/${a.ref}`})),s},[c]),m=n.useMemo(()=>{const s=new Map;return(d??[]).forEach(a=>s.set(a.id,{label:`Evidence ${a.ref}`,href:`/research/gillean/evidence#ev-${a.ref}`})),s},[d]),h=n.useMemo(()=>{const s=i.trim().toLowerCase();return s?(o??[]).filter(a=>[a.title,a.author_name??""].join(" ").toLowerCase().includes(s)):o??[]},[o,i]);return e.jsxs(b,{children:[e.jsx(w,{title:"Research forum | The Two Lines of Gillean",description:"Public discussions on the clan history and origins research: open questions, evidence items, sources and archive visits. Read freely; post as a clan member.",noindex:!0}),e.jsxs("div",{className:"container mx-auto max-w-4xl px-4 py-10",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Clan history and origins research"}),e.jsx("h1",{className:"font-serif text-3xl",children:"Research forum"}),e.jsx("p",{className:"mt-2 max-w-2xl text-muted-foreground",children:"Where the research is talked through: readings of a document, help with a repository, progress on an open question, and second opinions on evidence. Anyone can read; clan members can post and reply."}),e.jsxs("div",{className:"mt-6 flex flex-wrap gap-2 text-sm",children:[e.jsx(l,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(r,{to:"/research/gillean/questions",children:"Open questions"})}),e.jsx(l,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(r,{to:"/research/gillean/evidence",children:"Evidence ledger"})}),e.jsx(l,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(r,{to:"/research/gillean/contribute",children:"Submit a finding"})})]}),e.jsxs("div",{className:"mt-8 grid gap-6 lg:grid-cols-[1fr,20rem]",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"relative",children:[e.jsx(E,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(_,{value:i,onChange:s=>g(s.target.value),placeholder:"Search discussions","aria-label":"Search research discussions",className:"pl-9"})]}),v?e.jsx("div",{className:"mt-4 space-y-3",children:[1,2,3].map(s=>e.jsx(L,{className:"h-20 w-full"},s))}):h.length===0?e.jsx(x,{className:"mt-4",children:e.jsxs(p,{className:"p-8 text-center text-muted-foreground",children:[e.jsx(R,{className:"mx-auto mb-3 h-10 w-10 opacity-50"}),e.jsx("p",{className:"font-serif",children:"No discussions yet"}),e.jsx("p",{className:"text-sm",children:"Open the first one â or start from a question or evidence item so it is attached to the right place."})]})}):e.jsx("div",{className:"mt-4 divide-y rounded-lg border",children:h.map(s=>{const a=s.gillean_question_id&&N.get(s.gillean_question_id)||s.gillean_evidence_id&&m.get(s.gillean_evidence_id)||null;return e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.is_pinned&&e.jsx(M,{className:"h-3.5 w-3.5 text-clan-gold"}),s.is_locked&&e.jsxs(f,{variant:"secondary",className:"gap-1",children:[e.jsx($,{className:"h-3 w-3"}),"Locked"]}),a&&e.jsx(r,{to:a.href,children:e.jsx(f,{variant:"outline",children:a.label})})]}),e.jsx(r,{to:`/forum/topic/${s.id}`,className:"mt-1 block font-medium transition-colors hover:text-primary",children:s.title}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.reply_count," ",s.reply_count===1?"reply":"replies",s.author_name?` · started by ${s.author_name}`:""," · last activity"," ",P(new Date(s.updated_at),{addSuffix:!0})]})]},s.id)})})]}),e.jsxs("aside",{className:"space-y-4",children:[e.jsx(S,{limit:5,evidenceId:t,subject:t?((u=m.get(t))==null?void 0:u.label)??void 0:void 0}),e.jsx(x,{children:e.jsxs(p,{className:"space-y-2 p-5 text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-medium text-foreground",children:"How discussions are moderated"}),e.jsx("p",{children:"Posts are read by the research team and the site moderators. Threads may be pinned, locked or edited
1where a claim needs a source, and anything off-topic or discourteous is removed."}),e.jsxs("p",{children:["Please cite what you rely on â see the"," ",e.jsx(r,{to:"/research/gillean/faq",className:"underline",children:"research FAQ"})," ","for citation and provenance guidance."]})]})})]})]})]})]})}export{A 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.