import{$ as e,C as t,D as n,E as r,F as i,H as a,I as o,Q as s,S as c,T as l,U as u,Y as d,_ as f,b as p,g as m,n as h,p as g,q as _,x as v}from"./app-BUJlOoW4.js";import{t as y}from"./i18n-DSO-aWC8.js";import{t as b}from"./AppLayout-D6JnKLGO.js";import{n as x,t as S}from"./EmptyState-Dl6LMehO.js";var C={class:`mx-auto max-w-3xl`},w={class:`mb-4 text-2xl font-extrabold tracking-tight`},T=[`placeholder`],E={type:`submit`,class:`rounded-c bg-primary px-5 py-2.5 text-sm font-semibold text-white hover:bg-primary-600`},D={key:0,class:`mt-3 text-sm text-ink-muted`},O={key:0,class:`ml-1 rounded-full bg-primary/10 px-2 py-0.5 text-xs font-bold text-primary`},k={key:1,class:`mt-5 space-y-3`},A={key:3,class:`mt-10 text-center text-ink-muted`},j=n({__name:`Search`,props:{q:{},results:{},mode:{}},setup(n){let j=_(n.q);function M(){e.get(`/search`,{q:j.value.trim()},{preserveState:!0})}return(e,_)=>(i(),t(f,null,[r(d(h),{title:n.q?d(y)(`Search: {q}`,{q:n.q}):d(y)(`Search`)},null,8,[`title`]),r(b,null,{default:a(()=>[p(`div`,C,[p(`h1`,w,s(d(y)(`Search`)),1),p(`form`,{class:`flex gap-2`,onSubmit:m(M,[`prevent`])},[u(p(`input`,{"onUpdate:modelValue":_[0]||=e=>j.value=e,type:`search`,autofocus:``,placeholder:d(y)(`Search the community…`),class:`flex-1 rounded-c border-line bg-surface-2 text-ink placeholder:text-ink-muted focus:border-primary focus:ring-primary`},null,8,T),[[g,j.value]]),p(`button`,E,s(d(y)(`Search`)),1)],32),n.q?(i(),t(`p`,D,[l(s(n.results.length===1?d(y)(`{n} result for “{q}”`,{n:n.results.length,q:n.q}):d(y)(`{n} results for “{q}”`,{n:n.results.length,q:n.q}))+` `,1),n.mode===`semantic`?(i(),t(`span`,O,s(d(y)(`✦ semantic`)),1)):c(``,!0)])):c(``,!0),n.results.length?(i(),t(`div`,k,[(i(!0),t(f,null,o(n.results,e=>(i(),v(x,{key:e.id,topic:e},null,8,[`topic`]))),128))])):n.q?(i(),v(S,{key:2,class:`mt-10`,title:d(y)(`No matching discussions`),body:d(y)(`Nothing came up for “{q}”. Try different words — or start a new topic and let the community (and the assistant) help.`,{q:n.q})},null,8,[`title`,`body`])):(i(),t(`p`,A,s(d(y)(`Type a question or a few keywords to search every discussion.`)),1))])]),_:1})],64))}});export{j as default};