import{r as m,j as u,c as s,u as x,e as L,p as R,q as b,s as j}from"./index-DoPpOINE.js";import{a as P,r as l}from"./vendor-DJo4KD8w.js";import{a as S}from"./routing-o1npPvOW.js";import{r as $,L as k}from"./routing-BybXhU8X.js";import{T as w}from"./ToolbarPanels-CjWlSOUC.js";import"./i18n-BbpF47i1.js";import"./XMarkIcon-KMKD47CF.js";function q(){const o=P(),r=m(o==null?void 0:o.id);return u.jsx(D,{rId:r},r)}function D({rId:o}){const r=S(),e=s(x().activeSession$),d=s(e==null?void 0:e.streamState$)??"initial",c=(e==null?void 0:e.kb)??null,f=e==null?void 0:e.client,t=L(()=>R(f,o)),a=s(t.resource$),n=s(t.isLoading$)??!0;l.useEffect(()=>{!n&&!a&&console.error(`[Document] Resource ${o} not found`)},[n,o,a]);const p=l.useCallback(async()=>{t.invalidate()},[t]);if(n||!a)return u.jsx(b,{});const i=a,g=m(i["@id"]);return u.jsx(j,{resource:i,rUri:g,locale:r,Link:k,routes:$,ToolbarPanels:w,refetchDocument:p,streamStatus:d,knowledgeBaseName:c==null?void 0:c.label})}export{q as default};
//# sourceMappingURL=page-CV0h_zZE.js.map
