1import{r as o,q as N,u as k,V as S,o as n,K as p,ap as f,aq as b,a9 as T}from"./index-VJAOPiQ0.js";import{D as E,F as O}from"./FolderItem-CmXxpTpP.js";import{a as d}from"./vendor-BuNY4Ty6.js";import{u as q}from"./Login-CZKqxjSf.js";import"./react-B2Ij4Vfr.js";import"./index-DrHgT_Mg.js";import"./Layout-BIzjb6g4.js";const A=async()=>{const{data:r}=await d.get("web/usercategories");return r},K=async r=>{const{data:i}=await d.get("web/usercategories/"+r+"/documents");return i},L=async()=>{const{data:r}=await d.get("web/userdocuments/unassigned");return r};function J(){const r=q(),[i]=o.useState([]),[C,m]=o.useState([]),[u]=N(T),[D,j]=o.useState({}),[l,w]=o.useState({}),[g,y]=o.useState([]),{token:h}=k(s=>s.auth),x=o.useCallback(s=>{const e=u.find(t=>t.id===s);return e?e.text:null},[u]);o.useEffect(()=>{r(S({title:x(14)})),U()},[r,x]);function U(){A().then(s=>{m(s.items),L().then(e=>{e.items.length>0&&m(t=>t.find(a=>a.id===-1)?t:[...t,{id:-1,name:"Ohne Kategorie"}]),y(e.items)})})}const v=async s=>{try{const e=await K(s);w(t=>({...t,[s]:e.items}))}catch(e){console.error("Error fetching child data:",e)}};function F(s){j(e=>{const t=!e[s];return t&&!l[s]&&(s===-1||v(s)),{...e,[s]:t}})}if(i==null)return n.jsx(n.Fragment,{});function I(){return[...C].sort((e,t)=>e.id===-1?1:t.id===-1?-1:e.name.localeCompare(t.name,"de",{sensitivity:"base"})).map(e=>{const t=D[e.id]||!1,c=l[e.id]||[];return n.jsxs("div",{className:"pl-4 text-normal-1 mb-3",children:[n.jsx(O,{name:e.name,hasChildren:!0,isOpen:t,onToggle:()=>F(e.id)}),t&&c.length>0&&c.map(a=>n.jsx("div",{className:"flex items-center py-2 mb-3",style:{paddingLeft:"30px"},children:n.jsx(p,{downloadUrl:h?f(a.id):b(a.id),name:a.name,fileext:a.fileext})},a.id)),e.id===-1&&t&&g.length>0&&g.map(a=>n.jsx("div",{className:"flex items-center py-2 mb-3",style:{paddingLeft:"30px"},children:n.jsx(p,{downloadUrl:h?f(a.id):b(a.id),name:a.name,fileext:a.fileext})},a.id))]},e.id)})}return n.jsxs(n.Fragment,{children:[n.jsx(E,{}),n.jsx("div",{className:"folder-structure text-white bg-base-100 dark:bg-base_dark p-4 rounded-md mt-5",children:I()})]})}export{J 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.