import{j as B}from"./query-ATBhtd3K.js";import{r as u}from"./vendor-EnoIVk-c.js";import{a as w}from"./routing-nZgBtxly.js";import{d as E,e as L,f as N,g as x,h as C,i as F,R as k}from"./en-IUV4ZXKH-BjYNERUx.js";import{T as j}from"./ToolbarPanels-tcvPzqNN.js";import{u as A}from"./i18n-BYxb14hm.js";import"./index-D4SjcYxX.js";import"./useAuth-CqtZE9nt.js";import"./AuthContext-CYne_gJM.js";import"./KnowledgeBaseContext-CgnF8K-_.js";import"./PlusIcon-qGFPUzg0.js";function H(){const{t:l}=A(),e=(s,P)=>l(`Discover.${s}`,P),n=w(),{activePanel:m}=E(),{theme:Q,setTheme:a,resolvedTheme:h}=L(),{showLineNumbers:d,toggleLineNumbers:c}=N(),g=u.useCallback(({theme:s})=>{a(s)},[a]),p=u.useCallback(()=>{c()},[c]);x({"settings:theme-changed":g,"settings:line-numbers-toggled":p});const i=C(),R=F(),{data:t,isLoading:T}=i.list.useQuery({limit:10,archived:!1}),{data:o}=R.list.useQuery(),{data:r,isFetching:y}=i.search.useQuery("",20),b=(t==null?void 0:t.resources)||[],v=(r==null?void 0:r.resources)||[],f=(o==null?void 0:o.entityTypes)||[];return B.jsx(k,{recentDocuments:b,searchDocuments:v,entityTypes:f,isLoadingRecent:T,isSearching:y,theme:h,showLineNumbers:d,activePanel:m,onNavigateToResource:s=>{n.push(`/know/resource/${encodeURIComponent(s)}`)},onNavigateToCompose:()=>{n.push("/know/compose")},translations:{title:e("title"),subtitle:e("subtitle"),searchPlaceholder:e("searchPlaceholder"),searchButton:e("searchButton"),searching:e("searching"),filterByEntityType:e("filterByEntityType"),all:e("all"),recentResources:e("recentResources"),searchResults:s=>e("searchResults",{count:s}),documentsTaggedWith:s=>e("documentsTaggedWith",{entityType:s}),noResultsFound:s=>e("noResultsFound",{query:s}),noResourcesAvailable:e("noResourcesAvailable"),composeFirstResource:e("composeFirstResource"),archived:e("archived"),created:e("created"),loadingKnowledgeBase:e("loadingKnowledgeBase")},ToolbarPanels:j})}export{H as default};
//# sourceMappingURL=page-fN3EjI48.js.map
