@shumai-one/shumai 0.3.4 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/bin/{chunk-c4nenmry.js → chunk-0jesq6sm.js} +1 -1
  2. package/bin/{chunk-gg1wfpm8.js → chunk-0jr6q4j4.js} +2 -2
  3. package/bin/{chunk-cwpmf8tx.js → chunk-0sajh8fw.js} +2 -2
  4. package/bin/{chunk-ardp3pze.js → chunk-1b7shyfp.js} +1 -1
  5. package/bin/{chunk-kfbztymc.js → chunk-1f8rr3ef.js} +2 -2
  6. package/bin/{chunk-zpq34g0w.js → chunk-1fq10abj.js} +2 -2
  7. package/bin/chunk-1hn9v6hv.js +2 -0
  8. package/bin/{chunk-4rexdetz.js → chunk-20wtz3kc.js} +3 -3
  9. package/bin/chunk-2882s5sp.js +1 -0
  10. package/bin/{chunk-6gjn8trh.js → chunk-29nhtrfv.js} +1 -1
  11. package/bin/chunk-3egeywt8.js +1 -0
  12. package/bin/chunk-3htn4m2d.js +7 -0
  13. package/bin/{chunk-tbdgkpgw.js → chunk-47093mwk.js} +1 -1
  14. package/bin/{chunk-2mr99scd.js → chunk-4a9sdfyp.js} +2 -2
  15. package/bin/{chunk-3t7v2de9.js → chunk-4ajat3xv.js} +57 -57
  16. package/bin/{chunk-6b0f3d07.js → chunk-55myfmhy.js} +2 -2
  17. package/bin/{chunk-5e48saab.js → chunk-5wrakb8p.js} +1 -1
  18. package/bin/{chunk-d4sjezbk.js → chunk-6awkqp09.js} +1 -1
  19. package/bin/chunk-6bztpk7h.js +1 -0
  20. package/bin/{chunk-j5q3t199.js → chunk-6edadcpn.js} +2 -2
  21. package/bin/chunk-74zstxav.js +6 -0
  22. package/bin/chunk-76hs7g0x.js +2 -0
  23. package/bin/{chunk-s584wxzj.js → chunk-7b60a9sy.js} +2 -2
  24. package/bin/{chunk-v5zdafv4.js → chunk-7fm1hznx.js} +2 -2
  25. package/bin/{chunk-sfmhbk59.js → chunk-800vdz5n.js} +1 -1
  26. package/bin/{chunk-5qwzveck.js → chunk-89kqtj7x.js} +2 -2
  27. package/bin/chunk-8g0mhzsg.js +2 -0
  28. package/bin/chunk-8jdgzy22.js +2 -0
  29. package/bin/chunk-8js9m1j7.js +1 -0
  30. package/bin/{chunk-r9thyg31.js → chunk-9annjnj2.js} +2 -2
  31. package/bin/{chunk-pew69nxg.js → chunk-9hsfjqgq.js} +2 -2
  32. package/bin/{chunk-e6rmqgzv.js → chunk-9p5n3m2z.js} +1 -1
  33. package/bin/{chunk-8pa1n500.js → chunk-9tnfhrnh.js} +2 -2
  34. package/bin/{chunk-qw5yjhab.js → chunk-a5fw02xq.js} +3 -3
  35. package/bin/chunk-adekdctx.css +1 -0
  36. package/bin/{chunk-q9tm2d21.js → chunk-aeg4kya9.js} +1 -1
  37. package/bin/{chunk-vzx1r87y.js → chunk-bq2aq6v8.js} +2 -2
  38. package/bin/{chunk-ddfx823h.js → chunk-c9bpf8gp.js} +2 -2
  39. package/bin/{chunk-ankkm2wz.js → chunk-ce50f746.js} +2 -2
  40. package/bin/{chunk-h0k9zw29.js → chunk-crdvxq38.js} +2 -2
  41. package/bin/{chunk-3vbx3x11.js → chunk-d2qp8g98.js} +2 -2
  42. package/bin/{chunk-5dqn7egd.js → chunk-d8bpqbdw.js} +1 -1
  43. package/bin/{chunk-4a185tez.js → chunk-dfzmqx1v.js} +3 -3
  44. package/bin/{chunk-03pw611p.js → chunk-dmjzrdan.js} +2 -2
  45. package/bin/chunk-e5s7202g.js +2 -0
  46. package/bin/{chunk-bpb0szs5.js → chunk-ef5v7gta.js} +2 -2
  47. package/bin/{chunk-7kdz1eng.js → chunk-ew4cxkcc.js} +2 -2
  48. package/bin/{chunk-axe5rq99.js → chunk-ex4qa7gv.js} +1 -1
  49. package/bin/{chunk-75x3w5hx.js → chunk-f2eh802w.js} +1 -1
  50. package/bin/{chunk-c1j58ekb.js → chunk-f44d9fpd.js} +2 -2
  51. package/bin/chunk-f5zg7b38.js +1 -0
  52. package/bin/chunk-fdm1yc29.js +1 -0
  53. package/bin/{chunk-w3xzd86e.js → chunk-fwbrcfaq.js} +2 -2
  54. package/bin/{chunk-bhqrqt97.js → chunk-fzaw1e34.js} +2 -2
  55. package/bin/{chunk-58y9bagr.js → chunk-g70eyttc.js} +2 -2
  56. package/bin/{chunk-nabagpah.js → chunk-gct52xks.js} +2 -2
  57. package/bin/{chunk-j5dejr3e.js → chunk-gewh7p42.js} +6 -6
  58. package/bin/chunk-gg1gwjtn.js +2 -0
  59. package/bin/chunk-gh64hag9.js +2 -0
  60. package/bin/{chunk-898hrxwq.js → chunk-ghz19a7t.js} +2 -2
  61. package/bin/{chunk-n7cmya8k.js → chunk-gra3617w.js} +2 -2
  62. package/bin/{chunk-jnx8p6kj.js → chunk-gx5rjm9m.js} +1 -1
  63. package/bin/chunk-h0p8yew4.js +1 -0
  64. package/bin/{chunk-6ab9eftx.js → chunk-hcvpb1hw.js} +1 -1
  65. package/bin/chunk-hgngnc1k.js +1 -0
  66. package/bin/chunk-hqbzjzsm.js +2 -0
  67. package/bin/{chunk-d4sg0z3y.js → chunk-j1awxx51.js} +2 -2
  68. package/bin/{chunk-khc3dydj.js → chunk-js0genbf.js} +1 -1
  69. package/bin/chunk-jt4yh37q.js +62 -0
  70. package/bin/{chunk-c9f6n4sf.js → chunk-jtd7rydv.js} +1 -1
  71. package/bin/chunk-k0xpskyq.js +1 -0
  72. package/bin/{chunk-jgxhv36z.js → chunk-kaxwma6y.js} +1 -1
  73. package/bin/{chunk-8wzepzp3.js → chunk-kk0gx8eg.js} +2 -2
  74. package/bin/{chunk-8tnq43k9.js → chunk-mgbqjbfc.js} +1 -1
  75. package/bin/{chunk-xkh6b42h.js → chunk-mhj0pqq3.js} +2 -2
  76. package/bin/{chunk-05m8w09t.js → chunk-mmrtjcst.js} +1 -1
  77. package/bin/{chunk-bagxeg82.js → chunk-mxee09jk.js} +2 -2
  78. package/bin/{chunk-z544s59c.js → chunk-n198tewr.js} +2 -2
  79. package/bin/{chunk-1bfrnc6b.js → chunk-n9cjmkky.js} +1 -1
  80. package/bin/{chunk-4153rke8.js → chunk-nh31ma8d.js} +2 -2
  81. package/bin/{chunk-gg8dmkwd.js → chunk-nh8azwsx.js} +2 -2
  82. package/bin/chunk-nhc72y4x.js +2 -0
  83. package/bin/{chunk-8qe7cpbr.js → chunk-pm64et9d.js} +1 -1
  84. package/bin/chunk-px6q3jpz.js +1 -0
  85. package/bin/{chunk-q2shr586.js → chunk-q7xfrtnj.js} +1 -1
  86. package/bin/{chunk-scfbmsy7.js → chunk-rmm6y799.js} +2 -2
  87. package/bin/{chunk-sddrv3ep.js → chunk-snexx7ks.js} +1 -1
  88. package/bin/chunk-sx3by19j.js +1 -0
  89. package/bin/{chunk-2ydhnafa.js → chunk-sx7kparv.js} +2 -2
  90. package/bin/{chunk-2y9t0qxp.js → chunk-t5561vz5.js} +1 -1
  91. package/bin/chunk-thj4cpev.js +2 -0
  92. package/bin/{chunk-3xfhbvar.js → chunk-tqxmj05h.js} +2 -2
  93. package/bin/{chunk-d2xrh0vv.js → chunk-vgr9db5g.js} +2 -2
  94. package/bin/{chunk-7pcba64w.js → chunk-vqgz25av.js} +1 -1
  95. package/bin/{chunk-m8tnsds1.js → chunk-vw1rhgjs.js} +2 -2
  96. package/bin/chunk-vz75bqvx.js +2 -0
  97. package/bin/{chunk-zned6mj8.js → chunk-w16jgdfx.js} +1 -1
  98. package/bin/{chunk-s5s1rk4n.js → chunk-w4ycztv5.js} +1 -1
  99. package/bin/{chunk-38hp9gfh.js → chunk-w98wvk17.js} +2 -2
  100. package/bin/chunk-wa8k9fwx.js +1 -0
  101. package/bin/{chunk-89chaa11.js → chunk-y0yrmcf3.js} +2 -2
  102. package/bin/{chunk-2jnyk045.js → chunk-y1t47c7f.js} +1 -1
  103. package/bin/{chunk-1apsnd7e.js → chunk-y8vw7zv1.js} +1 -1
  104. package/bin/{chunk-k78m3rar.js → chunk-ym47952x.js} +2 -2
  105. package/bin/{chunk-kgr3ytpb.js → chunk-yzra1x8f.js} +2 -2
  106. package/bin/{chunk-7xfx7741.js → chunk-z0tbq08w.js} +1 -1
  107. package/bin/{chunk-9deae0n7.js → chunk-z0zevgb6.js} +1 -1
  108. package/bin/{chunk-2967rnmn.js → chunk-z2ef8zpz.js} +1 -1
  109. package/bin/chunk-z3p3qz9d.js +3 -0
  110. package/bin/chunk-zv85aqwb.css +1 -0
  111. package/bin/shumai-app.html +1 -1
  112. package/bin/shumai-app.js +490 -340
  113. package/package.json +7 -7
  114. package/prisma/migrations/20260810025327_add_mcp_servers/migration.sql +71 -0
  115. package/prisma/migrations/20260810074554_mcp_server_cleanup/migration.sql +12 -0
  116. package/prisma/migrations/20260810124707_add_mcp_server_instructions/migration.sql +2 -0
  117. package/prisma/schema.prisma +69 -0
  118. package/bin/chunk-0ark0qrm.js +0 -1
  119. package/bin/chunk-21h9kgp5.js +0 -1
  120. package/bin/chunk-2errtbmb.js +0 -2
  121. package/bin/chunk-2pxev94x.js +0 -2
  122. package/bin/chunk-61hfhfce.js +0 -2
  123. package/bin/chunk-7e39zmss.js +0 -1
  124. package/bin/chunk-7h1m1e0b.js +0 -1
  125. package/bin/chunk-8btfb5g6.js +0 -2
  126. package/bin/chunk-bn1sts8x.js +0 -3
  127. package/bin/chunk-cwh21vfb.js +0 -2
  128. package/bin/chunk-dtjx1097.js +0 -2
  129. package/bin/chunk-e32bzfza.js +0 -1
  130. package/bin/chunk-ersxsrz8.js +0 -62
  131. package/bin/chunk-gnx9g8px.js +0 -2
  132. package/bin/chunk-htrzgs2a.css +0 -1
  133. package/bin/chunk-j2jdrmaa.js +0 -2
  134. package/bin/chunk-k41vt2gq.js +0 -1
  135. package/bin/chunk-krpr6g8a.js +0 -1
  136. package/bin/chunk-mfmcsdd7.js +0 -1
  137. package/bin/chunk-msjv1ykh.js +0 -2
  138. package/bin/chunk-n73dbqps.js +0 -1
  139. package/bin/chunk-nn5qpr0q.js +0 -1
  140. package/bin/chunk-q7v8sj72.js +0 -1
  141. package/bin/chunk-twhj7h73.js +0 -1
  142. package/bin/chunk-yn7mxpmb.js +0 -7
@@ -1,2 +0,0 @@
1
- import{e as RA}from"./chunk-2errtbmb.js";import{f as yA,g as DA}from"./chunk-3xfhbvar.js";import{l as xA}from"./chunk-3t7v2de9.js";import{o as wA}from"./chunk-yn7mxpmb.js";import{I as NA,w as OA}from"./chunk-8btfb5g6.js";import{U as MA}from"./chunk-m8tnsds1.js";import{Da as qA,Ga as kA,Ia as i,qa as y,ta as QA,ua as UA}from"./chunk-bpb0szs5.js";import{sf as WA,tf as l}from"./chunk-gg1wfpm8.js";import{uf as EA}from"./chunk-2mr99scd.js";import{cg as LA}from"./chunk-gg8dmkwd.js";import{wg as zA}from"./chunk-38hp9gfh.js";import{Ag as c,Bg as B,Cg as U,Dg as VA,Fj as TA,Gg as o,Ig as $A,Jg as r,Og as HA,dh as H,xj as KA,zg as J1}from"./chunk-ersxsrz8.js";import{Jk as G1}from"./chunk-8tnq43k9.js";var X=G1(J1(),1);function BA(Y,J,q,Z,E,K){let h=Y.type==="folder",T=J.type==="folder";if(h!==T)return null;let L=T?Z:E,k=L.findIndex(($)=>$.id===q),O=L.findIndex(($)=>$.id===J.id);if(k===-1||O===-1)return null;let C=Math.min(k,O),F=Math.max(k,O),M=L.slice(C,F+1),_=new Set(K);return M.forEach(($)=>{if($.id)_.add($.id)}),_}function X1({teamId:Y,projectId:J,projectName:q,assetId:Z,rootFolderId:E,collection:K,onUpdateCollection:h}){let T=HA(),L=VA(),{canEdit:k}=zA(J),{setFields:O}=OA(),C=H.api.files[":fileId"].metadata.$patch,{mutate:F}=$A({mutationFn:async(A)=>{if(!(await C(A)).ok)throw Error("Failed to patch metadata");return null}}),{data:M}=o({queryKey:["fields",J],queryFn:async()=>{let A=await H.api.projects[":projectId"].fields.$get({param:{projectId:J}});if(!A.ok)throw Error("Failed to fetch fields");return await A.json()},enabled:!!J});X.useEffect(()=>{if(M)O(M,J)},[M,J,O]);let _=Z==="recently-deleted",[$,g]=X.useState(null),[W,D]=X.useState(new Set),[u,a]=X.useState(null),[PA,vA]=X.useState(240),[bA,hA]=X.useState(360),{isChatbotOpen:f}=l(),{members:CA,fetchMembers:d}=NA(),{metadata:FA,fetchMetadata:s,setMetadata:gA}=LA();X.useEffect(()=>{if(Y)d(Y),s(Y)},[Y,d,s]);let S=X.useMemo(()=>{return K?.filter?.searchFilter?.conditions||[]},[K]),[N,j]=X.useState(S);X.useEffect(()=>{j(S)},[S]);let t=`project:${J}:sort`,w=FA[t]||{field:"custom",order:"asc"},uA=(A)=>{if(A)gA(Y,t,A)},z=!!K,p=N.length>0||z,{fileListLeftSidebarCollapsed:e,setFileListLeftSidebarCollapsed:fA,fileListRightSidebarCollapsed:AA,setFileListRightSidebarCollapsed:SA,viewModes:jA}=EA(),GA=jA[J]??"card",pA=X.useRef(null),{data:P}=_?{data:void 0}:o({queryKey:["folders",Z],queryFn:async()=>{let A=await H.api.folders[":folderId"].$get({param:{folderId:Z}});if(!A.ok)throw Error("failed to fetch folder");return await A.json()}}),{setProjectState:JA,clearProjectState:XA}=WA();X.useEffect(()=>{return JA({teamId:Y,projectId:J,projectName:q,ancestorFolders:P?.ancestorFolders??[],currentAsset:_?{name:"Recently Deleted",type:"folder"}:z?{name:K.name,type:"folder"}:{name:P?.name,type:"folder"},isRootFolder:!_&&!z&&Z===E,onFolderClick:(A)=>{T({to:"/projects/$projectId/folders/$folderId",params:{projectId:J,folderId:A}})}}),()=>XA()},[Y,J,q,P,_,Z,E,JA,XA,T]);let{data:m,fetchNextPage:mA,hasNextPage:nA,isFetchingNextPage:IA}=r({queryKey:_?["projects",J,"recently-deleted","folder"]:["search",Y,Z,"folder",N,w,z],queryFn:async({pageParam:A})=>{if(_||z){if(_){let V=await H.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:J},query:{assetType:"folder",after:A}});if(!V.ok)throw Error("failed to fetch recently deleted folders");return await V.json()}return{data:[],pageInfo:{total:0}}}if(p)return{data:[],pageInfo:{total:0}};let G=await H.api.folders[":folderId"].search.$post({param:{folderId:Z},json:{assetType:"folder",after:A,recursively:!1,sort:w,conditions:[]}});if(!G.ok)throw Error("failed to search folders");return await G.json()},enabled:!p,initialPageParam:"",getNextPageParam:(A)=>{return A.pageInfo?.cursor||void 0}}),{data:n,fetchNextPage:cA,hasNextPage:oA,isFetchingNextPage:rA}=r({queryKey:_?["projects",J,"recently-deleted","file"]:["search",Y,Z,"file",N,w,z],queryFn:async({pageParam:A})=>{if(_){let V=await H.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:J},query:{assetType:"file",after:A}});if(!V.ok)throw Error("failed to fetch recently deleted files");return await V.json()}let G=await H.api.folders[":folderId"].search.$post({param:{folderId:Z},json:{assetType:"file",after:A,recursively:p||z,conditions:N,sort:w}});if(!G.ok)throw Error("failed to search files");return await G.json()},initialPageParam:"",getNextPageParam:(A)=>{return A.pageInfo?.cursor||void 0}}),v=m?.pages.flatMap((A)=>A.data??[])??[],Q=n?.pages.flatMap((A)=>A.data??[])??[],lA=m?.pages[0]?.pageInfo?.total,iA=n?.pages[0]?.pageInfo?.total,aA=m?.pages[0]?.pageInfo?.totalSize,dA=n?.pages[0]?.pageInfo?.totalSize,YA=()=>{D(new Set),g(null),a(null)},{dragState:x,handleDragStart:sA,handleDragEnd:tA}=DA({teamId:Y,projectId:J,assetId:Z,folders:v,files:Q,selectedIds:W,onClearSelection:YA}),I=X.useMemo(()=>{if(W.size!==1)return null;let A=Array.from(W)[0];return Q.find((V)=>V.id===A)||null},[W,Q]),eA=(A)=>{if(_)return;if(A.type==="folder")j([]),T({to:"/projects/$projectId/folders/$folderId",params:{projectId:J,folderId:A.id}});else T({to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:A.versionStack?A.versionStack.id:A.id},search:{version:void 0}})},A1=(A,G)=>{let V=G.metaKey||G.ctrlKey;if(G.shiftKey&&u){let _A=[...v,...Q].find((b)=>b.id===u);if(_A){let b=BA(_A,A,u,v,Q,W);if(b){D(b),g(A);return}}}if(V){let R=new Set(W);if(R.has(A.id))R.delete(A.id);else R.add(A.id);D(R)}else D(new Set([A.id]));a(A.id),g(A)},ZA=(A,G,V)=>{F({param:{fileId:A},json:[{key:G,value:V}]},{onSuccess:()=>{L.invalidateQueries({queryKey:["folders",Z,"children",{assetType:"file"}]}),L.invalidateQueries({queryKey:["search",Y,Z]})}})};return U(qA,{modifiers:[yA.configure({anchor:{x:0,y:0}})],plugins:(A)=>A.map((G)=>{if(G===y)return y.configure({dropAnimation:null});if(typeof G==="object"&&G!==null&&"plugin"in G&&G.plugin===y)return y.configure({dropAnimation:null});return G}),sensors:_||!k?[]:[UA.configure({activationConstraints:[new QA.Distance({value:10})]})],onDragStart:sA,onDragEnd:tA,children:[B("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:U("div",{ref:pA,className:"flex flex-1 overflow-hidden relative",children:[!e&&B("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>fA(!0)}),(!AA||f)&&B("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>{SA(!0),l.getState().setIsChatbotOpen(!1)}}),!e&&U(c,{children:[B("div",{className:"bg-background",style:{width:PA},children:B(MA,{teamId:Y,projectId:J,projectName:q,rootFolderId:E,dragState:x,ancestorFolders:P?.ancestorFolders??[]})}),B(i,{onResize:(A)=>{vA((G)=>Math.max(180,Math.min(400,G+A)))},className:"hidden md:block"})]}),B(wA,{teamId:Y,projectId:J,assetId:Z,folders:v,files:Q,totalFolders:lA,totalFiles:iA,totalFoldersSize:aA,totalFilesSize:dA,selectedItem:$,selectedIds:W,onItemSelect:A1,onItemDoubleClick:eA,onSaveField:ZA,displayStyle:GA,onClearSelection:YA,fetchNextFoldersPage:mA,hasNextFoldersPage:nA||!1,isFetchingNextFoldersPage:IA,fetchNextFilesPage:cA,hasNextFilesPage:oA||!1,isFetchingNextFilesPage:rA,isRecentlyDeleted:_,filterConditions:N,onFilterChange:j,sort:w,onSortChange:uA,dragState:x,collection:K,onUpdateCollection:h,rootFolderId:E}),(!AA||f)&&U(c,{children:[B(i,{onResize:(A)=>{hA((G)=>Math.max(240,Math.min(600,G-A)))},className:"hidden md:block"}),B("div",{style:{width:bA},className:"bg-background flex flex-col flex-shrink-0",children:f?B(RA,{projectId:J,contextAssetId:Z}):I?B(xA,{teamId:Y,projectId:J,file:I,onSaveField:(A,G)=>ZA(I.id,A,G),members:CA,hideAnnotationControl:!0}):B("div",{className:"flex h-full items-center justify-center p-4 text-center text-sm text-muted-foreground",children:TA.select_asset_to_view_details()})})]})]})}),B(kA,{children:x?.isActive?B("div",{className:KA("flex items-center gap-2 rounded-md bg-popover px-3 py-2 text-sm font-medium text-popover-foreground shadow-md ring-1 ring-border cursor-grabbing",GA==="list"&&"w-30 h-[40px] px-0 flex-none overflow-hidden justify-center"),style:{transform:"translate(0px, 0px)"},children:U("span",{children:["Moving ",x.itemCount," item",x.itemCount!==1?"s":""]})}):null})]})}
2
- export{X1 as d};
@@ -1 +0,0 @@
1
- import{U as m}from"./chunk-m8tnsds1.js";import{Ia as p}from"./chunk-bpb0szs5.js";import{Ka as d,La as x,Ma as r,Na as D,Oa as G,Pa as M}from"./chunk-2ydhnafa.js";import"./chunk-nabagpah.js";import"./chunk-3vbx3x11.js";import{Fe as I}from"./chunk-zpq34g0w.js";import{Oe as g}from"./chunk-pew69nxg.js";import{uf as u}from"./chunk-2mr99scd.js";import{vf as f}from"./chunk-z544s59c.js";import{vg as b}from"./chunk-38hp9gfh.js";import{Ag as y,Aj as F,Bg as q,Bj as P,Cg as K,Cj as T,Dh as z,Fj as Y,Hg as R,Hh as C,Jg as k,Og as v,Tg as L,dh as N,ki as S,oh as h,zg as o}from"./chunk-ersxsrz8.js";import{Jk as t}from"./chunk-8tnq43k9.js";var Z=t(o(),1);var s=(X)=>{if(!X)return"??";return X.split(" ").map((_)=>_[0]).slice(0,2).join("").toUpperCase()};function e(){let{projectId:X}=qq.useParams(),{teamId:_,ensureTeamIdForProject:E}=b(),j=v();Z.useEffect(()=>{E(X)},[X,E]);let{data:O}=R(I(X)),W=O?.rootFolder,[n,i]=Z.useState(240),{fileListLeftSidebarCollapsed:A,setFileListLeftSidebarCollapsed:c}=u(),{data:B,isLoading:a,fetchNextPage:Q,hasNextPage:V,isFetchingNextPage:U}=k({queryKey:["collections",X],queryFn:async({pageParam:J})=>{let $=await N.api.projects[":projectId"].collections.$get({param:{projectId:X},query:{first:"20",after:J}});if(!$.ok)throw Error("Failed to fetch collections");return await $.json()},initialPageParam:"",getNextPageParam:(J)=>J.pageInfo?.cursor||void 0,enabled:!!X}),{ref:l,inView:H}=f();Z.useEffect(()=>{if(H&&V&&!U)Q()},[H,V,U,Q]);let w=Z.useMemo(()=>B?.pages.flatMap((J)=>J.data)||[],[B]);if(!_||!W||!O)return q(g,{});return q("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:K("div",{className:"flex flex-1 overflow-hidden relative",children:[!A&&q("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>c(!0)}),!A&&K(y,{children:[q("div",{className:"bg-background",style:{width:n},children:q(m,{teamId:_,projectId:X,projectName:O.name??"",rootFolderId:W})}),q(p,{onResize:(J)=>{i(($)=>Math.max(180,Math.min(400,$+J)))},className:"hidden md:block"})]}),K("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[q("header",{className:"h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10",children:K("div",{className:"flex items-center gap-2",children:[q(z,{className:"h-5 w-5 text-primary"}),q("h1",{className:"font-bold text-lg text-foreground",children:Y.all_collections()})]})}),q("div",{className:"flex-1 overflow-y-auto p-6",children:a?q("div",{className:"flex justify-center items-center h-64",children:q("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):w.length===0?K("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[q(S,{className:"h-10 w-10 text-muted-foreground/50"}),q("p",{children:Y.no_collections_yet()})]}):K("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[K(d,{children:[q(x,{children:K(D,{className:"hover:bg-transparent bg-muted/20",children:[q(G,{className:"font-semibold px-4 py-3",children:Y.collection_name()}),q(G,{className:"font-semibold px-4 py-3",children:Y.creator()}),q(G,{className:"font-semibold px-4 py-3 w-[200px]",children:Y.created_date()})]})}),q(r,{children:w.map((J)=>K(D,{className:"hover:bg-muted/10 transition-colors cursor-pointer",onClick:()=>j({to:"/projects/$projectId/collections/$collectionId",params:{projectId:X,collectionId:J.id}}),children:[q(M,{className:"font-medium px-4 py-3.5",children:K("div",{className:"flex items-center gap-2",children:[q(z,{className:"h-4 w-4 text-primary shrink-0"}),q("span",{className:"text-foreground font-semibold hover:underline",children:J.name})]})}),q(M,{className:"px-4 py-3.5",children:K("div",{className:"flex items-center gap-2",children:[K(F,{className:"h-6 w-6",children:[J.creator?.image&&q(P,{src:J.creator.image,alt:J.creator.name,className:"object-cover"}),q(T,{className:"text-[10px]",children:s(J.creator?.name)})]}),q("span",{className:"text-sm font-medium text-foreground truncate max-w-[200px]",children:J.creator?.name||Y.unknown()})]})}),q(M,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:K("div",{className:"flex items-center gap-2",children:[q(C,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),q("span",{children:new Date(J.createdAt).toLocaleDateString()})]})})]},J.id))})]}),q("div",{ref:l,className:"h-10 w-full flex items-center justify-center",children:U&&q(h,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var qq=L("/projects/$projectId/collections/")({component:e});export{qq as Route};
@@ -1 +0,0 @@
1
- import{d as V}from"./chunk-j2jdrmaa.js";import"./chunk-2errtbmb.js";import"./chunk-3xfhbvar.js";import"./chunk-3t7v2de9.js";import"./chunk-xkh6b42h.js";import"./chunk-yn7mxpmb.js";import"./chunk-8btfb5g6.js";import"./chunk-d4sg0z3y.js";import"./chunk-k78m3rar.js";import"./chunk-m8tnsds1.js";import"./chunk-bpb0szs5.js";import"./chunk-6b0f3d07.js";import"./chunk-cwpmf8tx.js";import"./chunk-2pxev94x.js";import"./chunk-nabagpah.js";import"./chunk-05m8w09t.js";import"./chunk-ankkm2wz.js";import"./chunk-3vbx3x11.js";import{Me as U}from"./chunk-5qwzveck.js";import{Oe as N}from"./chunk-pew69nxg.js";import"./chunk-bagxeg82.js";import"./chunk-vzx1r87y.js";import"./chunk-gg1wfpm8.js";import"./chunk-2mr99scd.js";import"./chunk-z544s59c.js";import"./chunk-898hrxwq.js";import"./chunk-j5q3t199.js";import"./chunk-gg8dmkwd.js";import"./chunk-s584wxzj.js";import"./chunk-c1j58ekb.js";import"./chunk-v5zdafv4.js";import{vg as K}from"./chunk-38hp9gfh.js";import{Bg as q,Gg as D,Hg as G,Tg as H,dh as J,zg as Z}from"./chunk-ersxsrz8.js";import{Jk as Y}from"./chunk-8tnq43k9.js";var W=Y(Z(),1);function _(){let{projectId:h}=$.useParams(),{teamId:v,ensureTeamIdForProject:w}=K();W.useEffect(()=>{w(h)},[h,w]);let{data:A}=G(U(h)),b=A?.rootFolder,{data:X}=D({queryKey:["folders",b],queryFn:async()=>{let B=await J.api.folders[":folderId"].$get({param:{folderId:b}});if(!B.ok)throw Error("failed to fetch folder");return await B.json()},enabled:!!b});if(!v||!b||!X)return q(N,{});return q(V,{teamId:v,projectId:h,projectName:A.name??"",assetId:b,rootFolderId:b})}var $=H("/projects/$projectId/")({component:_});export{$ as Route};
@@ -1 +0,0 @@
1
- import{a as B}from"./chunk-dtjx1097.js";import"./chunk-cwh21vfb.js";import"./chunk-3t7v2de9.js";import"./chunk-xkh6b42h.js";import"./chunk-yn7mxpmb.js";import"./chunk-8btfb5g6.js";import"./chunk-d4sg0z3y.js";import"./chunk-k78m3rar.js";import"./chunk-m8tnsds1.js";import"./chunk-bpb0szs5.js";import"./chunk-6b0f3d07.js";import"./chunk-cwpmf8tx.js";import"./chunk-2pxev94x.js";import"./chunk-nabagpah.js";import"./chunk-05m8w09t.js";import"./chunk-ankkm2wz.js";import"./chunk-3vbx3x11.js";import"./chunk-msjv1ykh.js";import"./chunk-bagxeg82.js";import"./chunk-vzx1r87y.js";import"./chunk-gg1wfpm8.js";import"./chunk-2mr99scd.js";import"./chunk-z544s59c.js";import"./chunk-898hrxwq.js";import"./chunk-j5q3t199.js";import"./chunk-d2xrh0vv.js";import"./chunk-s584wxzj.js";import"./chunk-c1j58ekb.js";import"./chunk-v5zdafv4.js";import"./chunk-38hp9gfh.js";import{Bg as q,Tg as w}from"./chunk-ersxsrz8.js";import"./chunk-8tnq43k9.js";function O(){let{shareId:C,fileId:D}=k.useParams(),{start:E,version:G,compare:H,cmpLeft:J,cmpRight:K,cmpActive:N}=k.useSearch();return q(B,{shareId:C,initialFileId:D,startTime:E,versionId:G,compare:H,compareLeftId:J,compareRightId:K,compareActiveSide:N})}var k=w("/share/$shareId/files/$fileId")({component:O});export{k as Route};
@@ -1,2 +0,0 @@
1
- import{ff as Jf,gf as Kf,hf as Qf,if as Wf,jf as Xf,mf as $f}from"./chunk-bagxeg82.js";import{sf as _f,tf as Bf}from"./chunk-gg1wfpm8.js";import{uf as Gf}from"./chunk-2mr99scd.js";import{Af as Sf,xf as Lf,yf as Vf,zf as Cf}from"./chunk-898hrxwq.js";import{dg as Hf}from"./chunk-s584wxzj.js";import{jg as Nf,kg as p,lg as Uf,mg as qf,ng as W,qg as zf,rg as g,sg as l,tg as c,ug as I,wg as Yf}from"./chunk-38hp9gfh.js";import{Ag as O,Bg as f,Cg as V,Eh as j,Fj as X,Jh as r,Kh as n,Og as d,Qg as x,_h as o,dh as D,gi as s,kh as e,ki as ff,oi as Rf,xj as a}from"./chunk-ersxsrz8.js";function Zf({teamId:K,projectId:L,projectName:_,ancestorFolders:B,currentAsset:U,isRootFolder:Y,displayStyle:E,onDisplayStyleChange:h,isLeftSidebarCollapsed:P,onLeftSidebarToggle:T,isRightSidebarCollapsed:$,onRightSidebarToggle:w,isChatbotOpen:Z=!1,onChatbotToggle:N,isPublic:Q=!1,onFolderClick:v,fileId:q,shareId:G,allowDownload:b=!0,downloadInfo:H,versions:S,compareMode:J=!1,canCompareVersions:m=!1,onCompareVersions:A}){let k=d(),{canEdit:y}=Yf(L),t=!1,i=(R)=>{if(!q)return;if(Q&&G){k({to:"/share/$shareId/files/$fileId",params:{shareId:G,fileId:q},search:(C)=>({...C,version:R})});return}if(!L)return;k({to:"/projects/$projectId/files/$fileId",params:{projectId:L,fileId:q},search:(C)=>({...C,version:R})})},M=async(R)=>{if(!q)return;try{let C=G?await D.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:G,fileId:q},json:{key:R}}):await D.api.files["download-url"].$post({json:{key:R,assetId:q}});if(!C.ok)return;let{url:z}=await C.json(),F=document.createElement("a");F.href=z,F.download="",document.body.appendChild(F),F.click(),document.body.removeChild(F)}catch{}},Ef=U.proxyType!=="audio"&&(H?.videoTranscodes?.length??0)>0,hf=Q?[{name:_,id:"root"},...B.slice().reverse().map((R)=>({name:R.name||"",id:R.id}))]:[{name:X.all_projects(),path:`/teams/${K}`,isMuted:!0},{name:_,path:`/projects/${L}`},...B.slice().reverse().map((R)=>({name:R.name||"",path:`/projects/${L}/folders/${R.id}`}))];return V("div",{className:"flex h-14 flex-wrap items-center justify-between gap-2 border-b border-border bg-card px-4 py-2",children:[V("div",{className:"flex min-w-0 flex-shrink items-center gap-1",children:[hf.map((R,C)=>V("div",{className:"flex items-center gap-1",children:[C>0&&f("span",{className:"text-muted-foreground",children:"/"}),R.path?f(x,{to:R.path,className:a("truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground",R.isMuted?"text-muted-foreground":"text-foreground"),children:R.name}):f("button",{onClick:()=>R.id&&v?.(R.id),className:"truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground text-foreground",children:R.name})]},C)),!Y&&!J&&V("div",{className:"flex items-center gap-1",children:[f("span",{className:"text-muted-foreground",children:"/"}),U.type==="folder"?f("span",{className:"truncate rounded px-2 py-1 text-sm font-medium text-foreground",children:U.name}):V(Nf,{children:[V(Uf,{className:"flex items-center gap-1 truncate rounded px-2 py-1 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:[f("span",{children:U.name}),U.version!==void 0&&V(Hf,{variant:"outline",className:"px-1 py-0 text-xs",children:["v",U.version]}),f(n,{className:"h-4 w-4"})]}),V(qf,{className:"w-56",children:[b&&(Ef?V(l,{children:[f(c,{className:"flex items-center gap-2",children:f("span",{children:X.download()})}),f(p,{children:V(I,{className:"w-48",children:[f(zf,{children:X.download()}),H?.videoTranscodes?.map((R)=>{let C=Math.max(R.width,R.height),z=`${R.height}p`;if(C>=3840)z="2160p";else if(C>=1920)z="1080p";else if(C>=1280)z="720p";else if(C>=960)z="540p";else if(C>=640)z="360p";else if(C>=320)z="180p";return V(W,{onClick:()=>M(R.key),className:"flex items-center justify-between",children:[f("span",{children:z}),f("span",{className:"text-xs text-muted-foreground",children:"MP4"})]},z)}),H?.originalKey&&V(O,{children:[f(g,{}),V(W,{onClick:()=>M(H.originalKey),className:"flex items-center justify-between",children:[f("span",{children:"Original"}),f("span",{className:"text-xs text-muted-foreground",children:U.name?.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):f(W,{onClick:()=>H?.originalKey&&M(H.originalKey),disabled:!H?.originalKey,children:X.download()})),y&&f(W,{onClick:()=>console.log("Rename"),children:"Rename"}),y&&f(W,{onClick:()=>console.log("Delete"),children:"Delete"}),m&&A&&V(O,{children:[f(g,{}),V(W,{onClick:()=>A(),children:[f(e,{className:"h-4 w-4"}),f("span",{children:X.compare_versions()})]})]}),S&&S.length>0&&V(O,{children:[f(g,{}),V(l,{children:[V(c,{className:"flex items-center gap-2",children:[f(s,{className:"h-4 w-4"}),f("span",{children:"Versions"})]}),f(p,{children:V(I,{className:"w-80 p-1",children:[f("div",{className:"flex flex-col gap-1 max-h-96 overflow-y-auto",children:S.map((R)=>{let C=U.version===R.version;return V(W,{onClick:()=>i(R.id),className:"flex items-center gap-3 py-2 px-3 rounded-md cursor-pointer focus:bg-accent focus:text-accent-foreground",children:[V("div",{className:"flex-shrink-0 flex items-center justify-center bg-muted dark:bg-muted-foreground/20 text-muted-foreground dark:text-muted-foreground rounded-full px-2 py-0.5 text-xs font-semibold select-none min-w-[2rem]",children:["v",R.version]}),f("div",{className:"h-10 w-16 flex-shrink-0 overflow-hidden rounded-md border border-border bg-muted flex items-center justify-center",children:R.previewUrl?f("img",{src:R.previewUrl,alt:R.name||void 0,className:"h-full w-full object-cover"}):f(o,{className:"h-4 w-4 text-muted-foreground"})}),V("div",{className:"flex flex-col flex-1 min-w-0 text-left",children:[f("span",{className:"truncate text-sm font-semibold text-foreground",children:R.name}),f("span",{className:"truncate text-xs text-muted-foreground",children:R.creator?.name||"Unknown"})]}),C&&f(r,{className:"h-4 w-4 text-primary ml-auto flex-shrink-0"})]},R.id)})}),f(g,{}),f("div",{className:"p-1",children:f("button",{className:"w-full text-center text-xs font-medium py-2 px-3 rounded-md bg-muted/80 hover:bg-muted text-foreground transition-colors",onClick:()=>console.log("Manage versions"),children:"Manage versions..."})})]})})]})]})]})]})]})]}),V("div",{className:"flex items-center gap-2",children:[V("div",{className:"flex flex-shrink-0 items-center gap-1 rounded-md border border-border bg-background p-1",children:[!q&&!Q&&T&&f("button",{onClick:T,className:"rounded p-1.5 text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",title:P?"Show Left Sidebar":"Hide Left Sidebar",children:P?f(Jf,{className:"h-4 w-4"}):f(Qf,{className:"h-4 w-4 fill-primary stroke-0"})}),!q&&!Q&&E&&h&&V(O,{children:[f("button",{onClick:()=>h("card"),className:`rounded p-1.5 transition-colors ${E==="card"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"Card View",children:f(ff,{className:"h-4 w-4"})}),f("button",{onClick:()=>h("list"),className:`rounded p-1.5 transition-colors ${E==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"List View",children:f(Rf,{className:"h-4 w-4"})})]}),f("button",{onClick:w,className:`rounded p-1.5 transition-colors ${!$&&!Z?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:$?"Show Right Sidebar":"Hide Right Sidebar",children:!$&&!Z?f(Wf,{className:"h-4 w-4 fill-primary stroke-0"}):f(Kf,{className:"h-4 w-4"})})]}),!Q&&N&&f(Lf,{children:V(Vf,{children:[f(Cf,{asChild:!0,children:f("span",{children:f("button",{disabled:!1,onClick:N,className:a("h-9 w-9 flex items-center justify-center rounded-full border border-border bg-background transition-colors",Z?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground",!1),children:Z?f(Xf,{className:"h-6 w-6 text-primary transition-colors"}):f(j,{className:"h-6 w-6 text-muted-foreground transition-colors"})})})}),f(Sf,{children:f("p",{children:Z?X.hide_chatbot():X.show_chatbot()})})]})})]})]})}function If(){let{projectState:K}=_f(),L=Gf(),{isChatbotOpen:_,setIsChatbotOpen:B}=Bf();if(!K)return f(Ff,{});let{teamId:U,projectId:Y,projectName:E,ancestorFolders:h,currentAsset:P,isRootFolder:T,fileId:$,downloadInfo:w,versions:Z,isPublic:N,shareId:Q,allowDownload:v,onFolderClick:q,compareMode:G,canCompareVersions:b,onCompareVersions:H}=K,S=!!$,J=!!Q&&!S,m=S?L.fileViewLeftSidebarCollapsed:J?L.shareConfigLeftSidebarCollapsed:L.fileListLeftSidebarCollapsed,A=N?void 0:()=>S?L.setFileViewLeftSidebarCollapsed(!L.fileViewLeftSidebarCollapsed):J?L.setShareConfigLeftSidebarCollapsed(!L.shareConfigLeftSidebarCollapsed):L.setFileListLeftSidebarCollapsed(!L.fileListLeftSidebarCollapsed),k=N&&K.isRightSidebarCollapsed!==void 0?K.isRightSidebarCollapsed:S?L.fileViewRightSidebarCollapsed:J?L.shareConfigRightSidebarCollapsed:L.fileListRightSidebarCollapsed,y=N&&K.onRightSidebarToggle?K.onRightSidebarToggle:()=>{if(!N&&_)if(B(!1),S)L.setFileViewRightSidebarCollapsed(!1);else if(J)L.setShareConfigRightSidebarCollapsed(!1);else L.setFileListRightSidebarCollapsed(!1);else if(S)L.setFileViewRightSidebarCollapsed(!L.fileViewRightSidebarCollapsed);else if(J)L.setShareConfigRightSidebarCollapsed(!L.shareConfigRightSidebarCollapsed);else L.setFileListRightSidebarCollapsed(!L.fileListRightSidebarCollapsed)},t=N?void 0:()=>{B(!_)},i=Y?L.viewModes[Y]??"card":"card";return f(Zf,{teamId:U,projectId:Y,projectName:E,ancestorFolders:h,currentAsset:P,isRootFolder:T,displayStyle:S||J?void 0:i,onDisplayStyleChange:S||J?void 0:N?void 0:(u)=>{if(Y)L.setViewMode(Y,u)},isLeftSidebarCollapsed:m,onLeftSidebarToggle:A,isRightSidebarCollapsed:k,onRightSidebarToggle:y,isChatbotOpen:!N&&_,onChatbotToggle:t,isPublic:N,shareId:Q,allowDownload:v,fileId:$,downloadInfo:w,versions:Z,onFolderClick:q,compareMode:G,canCompareVersions:b,onCompareVersions:H})}function Ff(){return f("div",{className:"flex h-14 flex-wrap items-center justify-center gap-2 border-b border-border bg-card px-4 py-2 flex-shrink-0",children:f($f,{className:"w-10 h-10 text-orange-600"})})}
2
- export{If as Le};
@@ -1 +0,0 @@
1
- import{U as t}from"./chunk-m8tnsds1.js";import{Ia as r}from"./chunk-bpb0szs5.js";import{Ka as a,La as s,Ma as e,Na as E,Oa as $,Pa as q}from"./chunk-2ydhnafa.js";import"./chunk-nabagpah.js";import{db as x}from"./chunk-05m8w09t.js";import{eb as j}from"./chunk-ankkm2wz.js";import"./chunk-3vbx3x11.js";import{De as l}from"./chunk-r9thyg31.js";import{Oe as o}from"./chunk-pew69nxg.js";import{uf as i}from"./chunk-2mr99scd.js";import{vf as d}from"./chunk-z544s59c.js";import{vg as h}from"./chunk-38hp9gfh.js";import{Ag as k,Aj as p,Bg as G,Bj as c,Cg as K,Cj as n,Dg as L,Fj as X,Hg as y,Hh as T,Ig as F,Jg as S,Mi as u,Og as P,Tg as C,Uh as g,Yh as b,bh as B,dh as A,li as I,oh as f,zg as OG,zj as m}from"./chunk-ersxsrz8.js";import{Jk as qG}from"./chunk-8tnq43k9.js";var _=qG(OG(),1);var zG=(Y)=>{if(!Y)return"??";return Y.split(" ").map((z)=>z[0]).slice(0,2).join("").toUpperCase()};function BG(){let{projectId:Y}=MG.useParams(),{teamId:z,ensureTeamIdForProject:U}=h(),GG=L(),JG=P();_.useEffect(()=>{U(Y)},[Y,U]);let{data:M}=y(l(Y)),D=M?.rootFolder,[KG,XG]=_.useState(240),{shareConfigLeftSidebarCollapsed:Q,setShareConfigLeftSidebarCollapsed:YG}=i(),{data:V,isLoading:ZG,fetchNextPage:R,hasNextPage:v,isFetchingNextPage:W}=S({queryKey:["shares",Y],queryFn:async({pageParam:J})=>{let Z=await A.api.projects[":projectId"].shares.$get({param:{projectId:Y},query:{first:"20",after:J}});if(!Z.ok)throw Error("Failed to fetch share links");return await Z.json()},initialPageParam:"",getNextPageParam:(J)=>J.pageInfo?.cursor||void 0,enabled:!!Y}),{ref:_G,inView:w}=d();_.useEffect(()=>{if(w&&v&&!W)R()},[w,v,W,R]);let H=_.useMemo(()=>V?.pages.flatMap((J)=>J.data)||[],[V]),{mutate:$G}=F({mutationFn:async({id:J,isDisabled:Z})=>{let O=await A.api.shares[":shareId"].$put({param:{shareId:J},json:{isDisabled:Z}});if(!O.ok)throw Error("Failed to update share link");return await O.json()},onSuccess:()=>{GG.invalidateQueries({queryKey:["shares",Y]}),B.success(X.share_link_status_updated())},onError:(J)=>{B.error(X.error_message({message:J.message}))}});if(!z||!D||!M)return G(o,{});let N=async(J)=>{let Z=`${window.location.origin}/share/${J}`;if(await x(Z))B.success(X.link_copied())};return G("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:K("div",{className:"flex flex-1 overflow-hidden relative",children:[!Q&&G("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>YG(!0)}),!Q&&K(k,{children:[G("div",{className:"bg-background",style:{width:KG},children:G(t,{teamId:z,projectId:Y,projectName:M.name??"",rootFolderId:D})}),G(r,{onResize:(J)=>{XG((Z)=>Math.max(180,Math.min(400,Z+J)))},className:"hidden md:block"})]}),K("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[G("header",{className:"h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10",children:K("div",{className:"flex items-center gap-2",children:[G(u,{className:"h-5 w-5 text-primary"}),G("h1",{className:"font-bold text-lg text-foreground",children:X.all_share_links()})]})}),G("div",{className:"flex-1 overflow-y-auto p-6",children:ZG?G("div",{className:"flex justify-center items-center h-64",children:G("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):H.length===0?K("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[G(I,{className:"h-10 w-10 text-muted-foreground/50"}),G("p",{children:X.no_share_links_yet()})]}):K("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[K(a,{children:[G(s,{children:K(E,{className:"hover:bg-transparent bg-muted/20",children:[G($,{className:"font-semibold px-4 py-3",children:X.name()}),G($,{className:"font-semibold px-4 py-3",children:X.public_link()}),G($,{className:"font-semibold px-4 py-3",children:X.creator()}),G($,{className:"font-semibold px-4 py-3 w-[150px]",children:X.created_date()}),G($,{className:"font-semibold px-4 py-3 text-right w-[120px]",children:X.active()})]})}),G(e,{children:H.map((J)=>{let Z=`${window.location.origin}/share/${J.id}`;return K(E,{className:"hover:bg-muted/10 transition-colors",children:[G(q,{className:"font-medium px-4 py-3.5",children:G("span",{className:"cursor-pointer hover:underline text-foreground",onClick:()=>JG({to:"/projects/$projectId/shares/$shareId",params:{projectId:Y,shareId:J.id}}),children:J.name})}),G(q,{className:"px-4 py-3.5 max-w-[300px]",children:K("div",{className:"flex items-center gap-2 group",children:[G("span",{className:"truncate text-xs font-mono bg-muted/50 text-muted-foreground px-2 py-1 rounded-md border border-border cursor-pointer hover:bg-muted transition-colors flex-1",onClick:()=>N(J.id),title:X.click_to_copy_link(),children:Z}),G(m,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>N(J.id),children:G(g,{className:"h-3.5 w-3.5"})}),G("a",{href:Z,target:"_blank",rel:"noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center",children:G(b,{className:"h-3.5 w-3.5"})})]})}),G(q,{className:"px-4 py-3.5",children:K("div",{className:"flex items-center gap-2",children:[K(p,{className:"h-6 w-6",children:[J.creator?.image&&G(c,{src:J.creator.image,alt:J.creator.name,className:"object-cover"}),G(n,{className:"text-[10px]",children:zG(J.creator?.name)})]}),G("span",{className:"text-sm font-medium text-foreground truncate max-w-[150px]",children:J.creator?.name||X.unknown()})]})}),G(q,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:K("div",{className:"flex items-center gap-2",children:[G(T,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),G("span",{children:new Date(J.createdAt).toLocaleDateString()})]})}),G(q,{className:"px-4 py-3.5 text-right",children:G("div",{className:"flex justify-end",children:G(j,{checked:!J.isDisabled,onCheckedChange:(O)=>$G({id:J.id,isDisabled:!O})})})})]},J.id)})})]}),G("div",{ref:_G,className:"h-10 w-full flex items-center justify-center",children:W&&G(f,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var MG=C("/projects/$projectId/shares/")({component:BG});export{MG as Route};
@@ -1 +0,0 @@
1
- import{n as q0}from"./chunk-xkh6b42h.js";import{Q as J0}from"./chunk-d4sg0z3y.js";import{R as K0,S as W0,T as Y0}from"./chunk-k78m3rar.js";import{Ka as H,La as S,Ma as C,Na as w,Oa as Y,Pa as Z}from"./chunk-2ydhnafa.js";import{$a as k0}from"./chunk-2pxev94x.js";import{vf as s}from"./chunk-z544s59c.js";import{Wf as a}from"./chunk-j5q3t199.js";import{$f as c,Yf as T,Zf as I,_f as o,ag as i}from"./chunk-d2xrh0vv.js";import{dg as q}from"./chunk-s584wxzj.js";import"./chunk-c1j58ekb.js";import{Aj as A,Bg as f,Bj as g,Cg as z,Cj as u,Fg as E0,Fj as p,Gg as B,Gj as h0,Jg as m,Ki as y0,Ni as M0,Tg as N0,cj as Q0,dh as y,gh as D0,gj as $0,nh as _0,oh as Q,vh as f0,vj as V0,xi as x,xj as D,zg as t,zj as b}from"./chunk-ersxsrz8.js";import{Jk as l}from"./chunk-8tnq43k9.js";var L0=l(t(),1);var G0=l(t(),1);var j=l(t(),1);var O0=$0("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 min-w-9 px-2",sm:"h-8 min-w-8 px-1.5",lg:"h-10 min-w-10 px-2.5"}},defaultVariants:{variant:"default",size:"default"}});var X0=j.createContext({size:"default",variant:"default",spacing:0});function p0({className:K,variant:J,size:X,spacing:W=0,children:E,...$}){return f(V0.Root,{"data-slot":"toggle-group","data-variant":J,"data-size":X,"data-spacing":W,style:{"--gap":W},className:D("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",K),...$,children:f(X0.Provider,{value:{variant:J,size:X,spacing:W},children:E})})}function F({className:K,children:J,variant:X,size:W,...E}){let $=j.useContext(X0);return f(V0.Item,{"data-slot":"toggle-group-item","data-variant":$.variant||X,"data-size":$.size||W,"data-spacing":$.spacing,className:D(O0({variant:$.variant||X,size:$.size||W}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",K),...E,children:J})}function R0({teamId:K}){let[J,X]=G0.useState("team"),[W,E]=G0.useState("1h"),{data:$,isLoading:M}=B({queryKey:["teams",K,"ai-usage",W,"team"],queryFn:async()=>{let G=await y.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:K},query:{timeframe:W}});if(!G.ok)throw Error("Failed to fetch team AI usage");return await G.json()},enabled:!!K&&J==="team"}),{data:n,isLoading:L}=B({queryKey:["teams",K,"members"],queryFn:async()=>{let G=await y.api.teams[":teamId"].members.$get({param:{teamId:K},query:{}});if(!G.ok)throw Error("Failed to fetch team members");return await G.json()},enabled:!!K&&J==="members"}),U=E0({queries:(n||[]).map((G)=>({queryKey:["teams",K,"ai-usage",W,G.id],queryFn:async()=>{let R=await y.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:K},query:{timeframe:W,userId:G.id}});if(!R.ok)throw Error(`Failed to fetch AI usage for member ${G.id}`);return await R.json()},enabled:!!K&&J==="members"}))}),k=L||U.some((G)=>G.isLoading),v=(G)=>{if(!G)return"U";let R=G.split(" ");if(R.length>1)return`${R[0][0]}${R[R.length-1][0]}`.toUpperCase();return G.substring(0,2).toUpperCase()},d=(G)=>{if(!G)return"";switch(G.toLowerCase()){case"owner":return p.owner();case"editor":return p.editor();case"reviewer":return p.reviewer();default:return G}},_=(G)=>(G??0).toLocaleString(),P=(G)=>`$${(G??0).toFixed(6)}`;return z(T,{className:"border-border/60 shadow-sm",children:[z(I,{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between pb-6",children:[z("div",{children:[f(o,{className:"text-xl font-semibold tracking-tight",children:p.ai_usage()}),f(c,{className:"text-sm text-muted-foreground mt-1",children:p.ai_usage_description()})]}),z("div",{className:"flex flex-wrap items-center gap-3",children:[z(p0,{type:"single",value:J,onValueChange:(G)=>{if(G)X(G)},className:"border rounded-lg p-1 bg-muted/30",children:[f(F,{value:"team",className:"px-3 py-1.5 text-xs font-medium",children:p.team_view()}),f(F,{value:"members",className:"px-3 py-1.5 text-xs font-medium",children:p.members_view()})]}),z(p0,{type:"single",value:W,onValueChange:(G)=>{if(G)E(G)},className:"border rounded-lg p-1 bg-muted/30",children:[f(F,{value:"1h",className:"px-2.5 py-1.5 text-xs font-medium",children:"1h"}),f(F,{value:"24h",className:"px-2.5 py-1.5 text-xs font-medium",children:"24h"}),f(F,{value:"7d",className:"px-2.5 py-1.5 text-xs font-medium",children:"7d"}),f(F,{value:"30d",className:"px-2.5 py-1.5 text-xs font-medium",children:"30d"})]})]})]}),f(i,{children:J==="team"?M?f("div",{className:"flex h-48 items-center justify-center",children:f(Q,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):f("div",{className:"rounded-md border",children:z(H,{children:[f(S,{children:z(w,{children:[f(Y,{children:p.team()}),f(Y,{className:"text-right",children:p.input_tokens()}),f(Y,{className:"text-right",children:p.output_tokens()}),f(Y,{className:"text-right",children:p.cache_read_tokens()}),f(Y,{className:"text-right",children:p.total_tokens()}),f(Y,{className:"text-right",children:p.cost()})]})}),f(C,{children:z(w,{children:[f(Z,{className:"font-medium",children:p.team()}),f(Z,{className:"text-right",children:_($?.team?.inputTokens)}),f(Z,{className:"text-right",children:_($?.team?.outputTokens)}),f(Z,{className:"text-right",children:_($?.team?.cacheReadTokens)}),f(Z,{className:"text-right font-medium",children:_($?.team?.totalTokens)}),f(Z,{className:"text-right font-medium",children:P($?.team?.cost)})]})})]})}):k?f("div",{className:"flex h-48 items-center justify-center",children:f(Q,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):f("div",{className:"rounded-md border",children:z(H,{children:[f(S,{children:z(w,{children:[f(Y,{children:p.members()}),f(Y,{children:p.role()}),f(Y,{className:"text-right",children:p.input_tokens()}),f(Y,{className:"text-right",children:p.output_tokens()}),f(Y,{className:"text-right",children:p.cache_read_tokens()}),f(Y,{className:"text-right",children:p.total_tokens()}),f(Y,{className:"text-right",children:p.cost()})]})}),f(C,{children:(n||[]).map((G,R)=>{let N=U[R]?.data?.member;return z(w,{children:[f(Z,{children:z("div",{className:"flex items-center gap-3",children:[z(A,{className:"h-8 w-8 rounded-full",children:[G.image&&f(g,{src:G.image,alt:G.name,className:"object-cover"}),f(u,{className:"bg-primary/20 text-xs",children:v(G.name)})]}),z("div",{className:"flex flex-col",children:[f("span",{className:"text-sm font-medium leading-none",children:G.name}),f("span",{className:"text-xs text-muted-foreground mt-0.5",children:G.email})]})]})}),f(Z,{className:"text-xs text-muted-foreground",children:d(G.role)}),f(Z,{className:"text-right",children:_(N?.inputTokens)}),f(Z,{className:"text-right",children:_(N?.outputTokens)}),f(Z,{className:"text-right",children:_(N?.cacheReadTokens)}),f(Z,{className:"text-right font-medium",children:_(N?.totalTokens)}),f(Z,{className:"text-right font-medium",children:P(N?.cost)})]},G.id)})})]})})})]})}var e=l(t(),1);function w0({teamId:K}){let[J,X]=e.useState(null),{ref:W,inView:E}=s(),{data:$,isLoading:M,isError:n,fetchNextPage:L,hasNextPage:U,isFetchingNextPage:k}=m({queryKey:["teams",K,"agent-sessions"],queryFn:async({pageParam:_})=>{let P=await y.api.teams[":teamId"]["agent-sessions"].$get({param:{teamId:K},query:{first:"20",after:_?String(_):void 0}});if(!P.ok)throw Error("Failed to fetch agent sessions");return await P.json()},initialPageParam:"",getNextPageParam:(_)=>_.pageInfo.cursor||void 0,enabled:!!K});e.useEffect(()=>{if(E&&U&&!k)L()},[E,U,k,L]);let v=$?.pages.flatMap((_)=>_.data).filter((_)=>_.id!=="pending")||[],d=(_)=>{switch(_){case"comment":return f(q,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",children:p.session_type_comment()});case"chat":return f(q,{variant:"outline",className:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20",children:p.session_type_chat()});case"naming":return f(q,{variant:"outline",className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",children:p.session_type_naming()});default:return f(q,{variant:"outline",className:"bg-muted text-muted-foreground border-border",children:_})}};return z("div",{className:"space-y-6",children:[z(T,{className:"border border-border/50 shadow-xs",children:[f(I,{className:"pb-4",children:f("div",{className:"flex items-center justify-between",children:z("div",{children:[z(o,{className:"text-xl font-bold flex items-center gap-2",children:[f(x,{className:"w-5 h-5 text-violet-500"}),p.sessions()]}),f(c,{className:"mt-1 text-sm text-muted-foreground",children:p.sessions_description()})]})})}),f(i,{children:M?f("div",{className:"flex h-64 items-center justify-center",children:f(Q,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):n?f("div",{className:"flex h-64 items-center justify-center text-destructive",children:"Failed to load agent sessions."}):v.length===0?z("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[f(x,{className:"w-10 h-10 text-muted-foreground/40 mb-3"}),f("p",{className:"text-base font-medium",children:p.no_sessions_found()})]}):z("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[z(H,{children:[f(S,{className:"bg-muted/40",children:z(w,{children:[f(Y,{children:p.session_name()}),f(Y,{children:p.creator()}),f(Y,{children:p.session_type()}),f(Y,{className:"text-right",children:p.create_time()})]})}),f(C,{children:v.map((_)=>z(w,{onClick:()=>X(_.id),className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[f(Z,{className:"font-medium",children:z("div",{className:"flex flex-col",children:[f("span",{className:"text-sm font-semibold text-foreground",children:_.name||p.untitled_session()}),f("span",{className:"text-xs font-mono text-muted-foreground/70",children:_.id})]})}),f(Z,{children:z("div",{className:"flex items-center gap-2",children:[z(A,{className:"h-6 w-6",children:[f(g,{src:_.creator?.image||void 0}),f(u,{className:"text-[10px]",children:_.creator?.name?.[0]?.toUpperCase()||"?"})]}),f("span",{className:"text-sm text-foreground/90",children:_.creator?.name||"System / Agent"})]})}),f(Z,{children:d(_.type)}),f(Z,{className:"text-right text-xs text-muted-foreground",children:a(_.createdAt)})]},_.id))})]}),f("div",{ref:W,className:"py-4 flex justify-center",children:k&&f(Q,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})})]}),f(q0,{sessionId:J,open:!!J,onOpenChange:(_)=>{if(!_)X(null)}})]})}var r=l(t(),1);var H0=Object.values(k0);function P0({teamId:K}){let[J,X]=r.useState([]),[W,E]=r.useState([]),[$,M]=r.useState(""),{ref:n,inView:L}=s(),{data:U}=B({queryKey:["teams",K,"members"],queryFn:async()=>{let V=await y.api.teams[":teamId"].members.$get({param:{teamId:K},query:{}});if(!V.ok)return[];return await V.json()},enabled:!!K}),k=U||[],{data:v,isLoading:d,isError:_,fetchNextPage:P,hasNextPage:G,isFetchingNextPage:R}=m({queryKey:["teams",K,"audit-logs",J,W,$],queryFn:async({pageParam:V})=>{let O=await y.api.teams[":teamId"]["audit-logs"].$get({param:{teamId:K},query:{first:"20",after:V?String(V):void 0,actions:J.length>0?J:void 0,userIds:W.length>0?W:void 0,itemId:$.trim()||void 0}});if(!O.ok)throw Error("Failed to fetch audit logs");return await O.json()},initialPageParam:"",getNextPageParam:(V)=>V.pageInfo.endCursor||void 0,enabled:!!K});r.useEffect(()=>{if(L&&G&&!R)P()},[L,G,R,P]);let N=v?.pages.flatMap((V)=>V.nodes)||[],Z0=v?.pages[0]?.total??0,U0=(V)=>{X((O)=>O.includes(V)?O.filter((h)=>h!==V):[...O,V])},v0=(V)=>{E((O)=>O.includes(V)?O.filter((h)=>h!==V):[...O,V])},F0=(V)=>{if(V.includes("delete")||V.includes("remove")||V.includes("revoke"))return f(q,{variant:"outline",className:"bg-destructive/10 text-destructive border-destructive/20 font-mono text-xs",children:V});if(V.includes("create")||V.includes("add"))return f(q,{variant:"outline",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20 font-mono text-xs",children:V});if(V.includes("update")||V.includes("reparent")||V.includes("copy"))return f(q,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20 font-mono text-xs",children:V});return f(q,{variant:"outline",className:"bg-muted text-muted-foreground border-border font-mono text-xs",children:V})},B0=new Map(k.map((V)=>[V.userId||V.id,V]));return f("div",{className:"space-y-6",children:z(T,{className:"border border-border/50 shadow-xs",children:[z(I,{className:"pb-4",children:[z("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[z("div",{children:[z(o,{className:"text-xl font-bold flex items-center gap-2",children:[f(f0,{className:"h-5 w-5 text-primary"}),p.audit_logs()]}),f(c,{className:"mt-1",children:p.audit_logs_description()})]}),Z0>0&&z(q,{variant:"secondary",className:"w-fit text-xs font-normal",children:[Z0," ",p.audit_logs()]})]}),z("div",{className:"mt-4 flex flex-wrap items-center gap-3 pt-4 border-t border-border/40",children:[z(K0,{children:[f(W0,{asChild:!0,children:z(b,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[f(_0,{className:"h-3.5 w-3.5"}),p.filter_by_action(),J.length>0&&f(q,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:J.length})]})}),z(Y0,{className:"w-64 p-2",align:"start",children:[f("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:p.select_actions()}),f("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:H0.map((V)=>z("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[f(J0,{checked:J.includes(V),onCheckedChange:()=>U0(V)}),f("span",{className:"font-mono",children:V})]},V))}),J.length>0&&f(b,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>X([]),children:"Clear Actions"})]})]}),z(K0,{children:[f(W0,{asChild:!0,children:z(b,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[f(_0,{className:"h-3.5 w-3.5"}),p.filter_by_user(),W.length>0&&f(q,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:W.length})]})}),z(Y0,{className:"w-64 p-2",align:"start",children:[f("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:p.select_users()}),f("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:k.map((V)=>{let O=V.userId||V.user?.id||V.id,h=V.user?.name||V.name||O,z0=V.user?.image||V.image;return z("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[f(J0,{checked:W.includes(O),onCheckedChange:()=>v0(O)}),z(A,{className:"h-5 w-5",children:[f(g,{src:z0||void 0}),f(u,{className:"text-[10px]",children:h.slice(0,2).toUpperCase()})]}),f("span",{className:"truncate",children:h})]},O)})}),W.length>0&&f(b,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>E([]),children:"Clear Users"})]})]}),z("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[f(y0,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),f(h0,{type:"text",placeholder:p.search_item_id(),value:$,onChange:(V)=>M(V.target.value),className:"pl-8 pr-8 h-9 text-xs"}),$&&f("button",{onClick:()=>M(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground",children:f(Q0,{className:"h-4 w-4"})})]}),(J.length>0||W.length>0||$)&&f(b,{variant:"ghost",size:"sm",className:"h-9 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{X([]),E([]),M("")},children:"Clear all"})]})]}),z(i,{className:"p-0",children:[d?f("div",{className:"flex h-64 items-center justify-center",children:f(Q,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):_?f("div",{className:"p-8 text-center text-sm text-destructive",children:"Failed to load audit logs."}):N.length===0?f("div",{className:"p-12 text-center text-sm text-muted-foreground",children:p.no_audit_logs()}):z(H,{children:[f(S,{children:z(w,{className:"hover:bg-transparent border-b border-border/50",children:[f(Y,{className:"w-[180px] text-xs font-semibold",children:p.action()}),f(Y,{className:"w-[200px] text-xs font-semibold",children:p.user()}),f(Y,{className:"text-xs font-semibold",children:p.item_id()}),f(Y,{className:"text-xs font-semibold",children:p.project_id()}),f(Y,{className:"w-[160px] text-right text-xs font-semibold",children:p.timestamp()})]})}),f(C,{children:N.map((V)=>{let O=V.userId?B0.get(V.userId):null,h=O?.user?.name||O?.name||V.userId||"System",z0=O?.user?.image||O?.image;return z(w,{className:"hover:bg-muted/40 transition-colors",children:[f(Z,{className:"py-3 font-medium",children:F0(V.action)}),f(Z,{className:"py-3",children:z("div",{className:"flex items-center gap-2",children:[z(A,{className:"h-6 w-6",children:[f(g,{src:z0||void 0}),f(u,{className:"text-[10px]",children:h.slice(0,2).toUpperCase()})]}),f("span",{className:"text-xs font-medium text-foreground truncate max-w-[140px]",children:h})]})}),f(Z,{className:"py-3 text-xs font-mono text-muted-foreground",children:V.itemId||"-"}),f(Z,{className:"py-3 text-xs font-mono text-muted-foreground",children:V.projectId||"-"}),f(Z,{className:"py-3 text-right text-xs text-muted-foreground",children:a(V.createdAt)})]},V.id)})})]}),f("div",{ref:n,className:"py-4 flex justify-center",children:R&&f(Q,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})]})})}function S0(){let{teamId:K}=C0.useParams(),[J,X]=L0.useState("audit-logs"),{data:W,isLoading:E}=B({queryKey:["teams",K,"me"],queryFn:async()=>{let $=await y.api.teams[":teamId"].me.$get({param:{teamId:K}});if(!$.ok)throw Error("Failed to fetch me");return await $.json()},enabled:!!K});if(E)return f("div",{className:"flex h-screen items-center justify-center",children:f(Q,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(W?.role?.toLowerCase()!=="owner")return z("div",{className:"flex h-full flex-col items-center justify-center p-8 text-center",children:[f(M0,{className:"h-12 w-12 text-destructive mb-4"}),f("h2",{className:"text-xl font-bold tracking-tight mb-2",children:p.access_denied()}),f("p",{className:"text-sm text-muted-foreground max-w-md",children:p.only_owner_dashboard()})]});return f("div",{className:"h-full bg-background font-sans selection:bg-primary/20 transition-colors duration-300",children:z("div",{className:"flex flex-col md:flex-row h-full",children:[f("div",{className:"w-full h-full md:w-72 bg-sidebar border-b md:border-b-0 md:border-r border-sidebar-border z-10 md:left-16 overflow-y-auto transition-colors duration-300",children:z("nav",{className:"p-4 space-y-1 mt-4",children:[f("div",{className:"mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider",children:p.dashboard()}),f("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:p.team_category()}),z("button",{onClick:()=>X("audit-logs"),className:D("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",J==="audit-logs"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[f(f0,{className:"w-5 h-5"}),p.audit_logs(),J==="audit-logs"&&f("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),f("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:p.ai()}),z("button",{onClick:()=>X("ai-usage"),className:D("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",J==="ai-usage"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[f(D0,{className:"w-5 h-5"}),p.usage(),J==="ai-usage"&&f("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),z("button",{onClick:()=>X("ai-sessions"),className:D("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",J==="ai-sessions"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[f(x,{className:"w-5 h-5"}),p.sessions(),J==="ai-sessions"&&f("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]})]})}),f("div",{className:"flex-1 overflow-y-auto p-4 md:p-8",children:z("div",{className:"max-w-6xl mx-auto space-y-8",children:[J==="audit-logs"&&f(P0,{teamId:K}),J==="ai-usage"&&f(R0,{teamId:K}),J==="ai-sessions"&&f(w0,{teamId:K})]})})]})})}var C0=N0("/teams/$teamId/dashboard")({component:S0});export{C0 as Route};
@@ -1 +0,0 @@
1
- import{d as _}from"./chunk-j2jdrmaa.js";import"./chunk-2errtbmb.js";import"./chunk-3xfhbvar.js";import"./chunk-3t7v2de9.js";import"./chunk-xkh6b42h.js";import"./chunk-yn7mxpmb.js";import"./chunk-8btfb5g6.js";import"./chunk-d4sg0z3y.js";import"./chunk-k78m3rar.js";import"./chunk-m8tnsds1.js";import"./chunk-bpb0szs5.js";import"./chunk-6b0f3d07.js";import"./chunk-cwpmf8tx.js";import"./chunk-2pxev94x.js";import"./chunk-nabagpah.js";import"./chunk-05m8w09t.js";import"./chunk-ankkm2wz.js";import"./chunk-3vbx3x11.js";import{ye as Y,ze as Z}from"./chunk-w3xzd86e.js";import"./chunk-bagxeg82.js";import"./chunk-vzx1r87y.js";import"./chunk-gg1wfpm8.js";import"./chunk-2mr99scd.js";import"./chunk-z544s59c.js";import"./chunk-898hrxwq.js";import"./chunk-j5q3t199.js";import"./chunk-gg8dmkwd.js";import"./chunk-s584wxzj.js";import"./chunk-c1j58ekb.js";import"./chunk-v5zdafv4.js";import{vg as X}from"./chunk-38hp9gfh.js";import{Bg as w,Fj as W,Gg as A,Hg as N,Ig as U,Tg as V,dh as B,zg as O}from"./chunk-ersxsrz8.js";import{Jk as M}from"./chunk-8tnq43k9.js";var h=M(O(),1);function R(){let{projectId:k,collectionId:D}=P.useParams(),{teamId:G,ensureTeamIdForProject:H}=X();h.useEffect(()=>{H(k)},[k,H]);let{data:J}=N(Y(k)),{data:v,refetch:z}=A({...Z(D)}),{mutate:E}=U({mutationFn:async(q)=>{let K=await B.api.collections[":collectionId"].$patch({param:{collectionId:D},json:q});if(!K.ok)throw Error("Failed to update collection");return await K.json()},onSuccess:()=>{z()}}),b=J?.rootFolder,{data:L}=A({queryKey:["folders",b],queryFn:async()=>{let q=await B.api.folders[":folderId"].$get({param:{folderId:b}});if(!q.ok)throw Error("Failed to fetch folder");return await q.json()},enabled:!!b});if(!G||!b||!L||!v)return w("div",{children:W.loading_collection()});let $=v.filter.sourceFolderId||b;return w(_,{teamId:G,projectId:k,projectName:J.name??"",assetId:$,rootFolderId:b,collection:v,onUpdateCollection:E})}var P=V("/projects/$projectId/collections/$collectionId")({component:R});export{P as Route};
@@ -1 +0,0 @@
1
- import{d as V}from"./chunk-j2jdrmaa.js";import"./chunk-2errtbmb.js";import"./chunk-3xfhbvar.js";import"./chunk-3t7v2de9.js";import"./chunk-xkh6b42h.js";import"./chunk-yn7mxpmb.js";import"./chunk-8btfb5g6.js";import"./chunk-d4sg0z3y.js";import"./chunk-k78m3rar.js";import"./chunk-m8tnsds1.js";import"./chunk-bpb0szs5.js";import"./chunk-6b0f3d07.js";import"./chunk-cwpmf8tx.js";import"./chunk-2pxev94x.js";import"./chunk-nabagpah.js";import"./chunk-05m8w09t.js";import"./chunk-ankkm2wz.js";import"./chunk-3vbx3x11.js";import{Be as U}from"./chunk-89chaa11.js";import{Oe as N}from"./chunk-pew69nxg.js";import"./chunk-bagxeg82.js";import"./chunk-vzx1r87y.js";import"./chunk-gg1wfpm8.js";import"./chunk-2mr99scd.js";import"./chunk-z544s59c.js";import"./chunk-898hrxwq.js";import"./chunk-j5q3t199.js";import"./chunk-gg8dmkwd.js";import"./chunk-s584wxzj.js";import"./chunk-c1j58ekb.js";import"./chunk-v5zdafv4.js";import{vg as K}from"./chunk-38hp9gfh.js";import{Bg as q,Gg as B,Hg as G,Tg as H,dh as J,zg as Z}from"./chunk-ersxsrz8.js";import{Jk as Y}from"./chunk-8tnq43k9.js";var W=Y(Z(),1);function _(){let{projectId:h}=$.useParams(),{teamId:v,ensureTeamIdForProject:w}=K();W.useEffect(()=>{w(h)},[h,w]);let{data:A}=G(U(h)),b=A?.rootFolder,{data:X}=B({queryKey:["folders",b],queryFn:()=>(async()=>{return await(await J.api.folders[":folderId"].$get({param:{folderId:b}})).json()})(),enabled:!!b});if(!v||!b||!X)return q(N,{});return q(V,{teamId:v,projectId:h,projectName:A.name??"",assetId:"recently-deleted",rootFolderId:b})}var $=H("/projects/$projectId/recently-deleted")({component:_});export{$ as Route};