import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{O as t,k as n}from"./vendor-markdown-DngssFHR.js";import{c as r,l as i}from"./vendor-react-Cts2Wj-s.js";import{J as a,N as o,Q as s,Y as c,i as l,nt as u,pt as d,q as f}from"./vendor-mui-Ckcy4Lfd.js";import"./vendor-md-editor-DC6xr_29.js";import{L as p,N as m,P as h,ft as g,ot as _}from"./vendor-mui-icons-606Bohdn.js";import{_ as v,f as y,p as b}from"./ui-BLXHSX1T.js";import{r as x}from"./help-DeFmOHyq.js";var S=e(n(),1),C=t(),w={overview:{label:`Overview`,color:`primary`,icon:(0,C.jsx)(m,{})},concept:{label:`Concept`,color:`warning`,icon:(0,C.jsx)(h,{})},guide:{label:`Guide`,color:`success`,icon:(0,C.jsx)(p,{})}};function T({article:e,onClick:t}){let{palette:n}=d(),r=w[e.category];return(0,C.jsx)(c,{variant:`outlined`,sx:{height:`100%`},children:(0,C.jsx)(a,{onClick:t,sx:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`stretch`},children:(0,C.jsxs)(f,{sx:{flex:1,display:`flex`,flexDirection:`column`,gap:1},children:[(0,C.jsxs)(s,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,C.jsx)(v,{label:r.label,color:r.color}),e.relatedTools.length>0&&(0,C.jsxs)(u,{variant:`caption`,sx:{color:n.custom.textMuted,ml:`auto`},children:[e.relatedTools.length,` tool`,e.relatedTools.length===1?``:`s`]})]}),(0,C.jsx)(u,{variant:`subtitle1`,fontWeight:700,children:e.title}),(0,C.jsx)(u,{variant:`body2`,sx:{color:n.custom.textMuted,flex:1},children:e.summary})]})})})}function E(){let{projectId:e}=i(),t=r(),{palette:n}=d(),[a,c]=(0,S.useState)(``),f=(0,S.useMemo)(()=>{if(!a)return x;let e=a.toLowerCase();return x.filter(t=>t.title.toLowerCase().includes(e)||t.summary.toLowerCase().includes(e)||t.relatedTools.some(t=>t.includes(e)))},[a]),p=(0,S.useMemo)(()=>{let e={overview:[],concept:[],guide:[]};for(let t of f)(e[t.category]??=[]).push(t);return e},[f]);return(0,C.jsxs)(s,{children:[(0,C.jsx)(b,{breadcrumbs:[{label:`Help`}]}),(0,C.jsxs)(y,{children:[(0,C.jsx)(l,{size:`small`,placeholder:`Search articles...`,value:a,onChange:e=>c(e.target.value),slotProps:{input:{startAdornment:(0,C.jsx)(o,{position:`start`,children:(0,C.jsx)(g,{fontSize:`small`})})}},sx:{minWidth:280}}),(0,C.jsxs)(u,{variant:`body2`,sx:{color:n.custom.textMuted,ml:`auto`},children:[f.length,` article`,f.length===1?``:`s`]})]}),f.length===0?(0,C.jsxs)(s,{sx:{display:`flex`,flexDirection:`column`,alignItems:`center`,py:6},children:[(0,C.jsx)(_,{sx:{fontSize:48,color:n.custom.textMuted,mb:2}}),(0,C.jsx)(u,{variant:`h6`,children:`No articles found`}),(0,C.jsx)(u,{variant:`body2`,sx:{color:n.custom.textMuted},children:`Try a different search term`})]}):Object.entries(p).map(([r,i])=>{if(i.length===0)return null;let a=w[r];return(0,C.jsxs)(s,{sx:{mb:3},children:[(0,C.jsxs)(s,{sx:{display:`flex`,alignItems:`center`,gap:1,mb:1.5},children:[(0,C.jsx)(s,{sx:{color:n.custom.textMuted,display:`flex`},children:a.icon}),(0,C.jsx)(u,{variant:`subtitle2`,sx:{textTransform:`uppercase`,letterSpacing:.5},children:r===`overview`?`Getting Started`:r===`concept`?`Concepts`:`Guides`})]}),(0,C.jsx)(s,{sx:{display:`grid`,gridTemplateColumns:{xs:`1fr`,sm:`1fr 1fr`,md:`1fr 1fr 1fr`},gap:2},children:i.map(n=>(0,C.jsx)(T,{article:n,onClick:()=>t(`/${e}/help/${n.id}`)},n.id))})]},r)})]})}export{E as default};