@shumai-one/shumai 0.5.1 → 0.5.2
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.
- package/bin/{chunk-1dt700ws.js → chunk-04avc4fn.js} +49 -49
- package/bin/chunk-0asthrjf.js +2 -0
- package/bin/chunk-0ge2mm8j.js +1 -0
- package/bin/{chunk-3z20b2hz.js → chunk-0j22699g.js} +2 -2
- package/bin/{chunk-j909v9p5.js → chunk-0v9srsdz.js} +1 -1
- package/bin/{chunk-exgtwask.js → chunk-0y4zq3y4.js} +1 -1
- package/bin/{chunk-5yd9cv7f.js → chunk-15vsw36h.js} +5 -5
- package/bin/{chunk-3584j9fc.js → chunk-15w79661.js} +2 -2
- package/bin/{chunk-xvdd04gy.js → chunk-19jpn3r6.js} +1 -1
- package/bin/{chunk-grsgkkrb.js → chunk-19q13a80.js} +6 -6
- package/bin/{chunk-r6gkv98n.js → chunk-1nvj833s.js} +6 -6
- package/bin/chunk-23780yj6.js +3 -0
- package/bin/chunk-2gf95tj0.js +1 -0
- package/bin/{chunk-6vvs18bw.js → chunk-2pw7xcrn.js} +1 -1
- package/bin/chunk-2tk5w3jc.js +1 -0
- package/bin/chunk-2w6gve12.js +4 -0
- package/bin/chunk-301e7g3z.js +2 -0
- package/bin/chunk-3kmjbc3m.js +2 -0
- package/bin/{chunk-zhe16jvg.js → chunk-3pm6q6kg.js} +1 -1
- package/bin/{chunk-zfqz72sd.js → chunk-3q5qkfkc.js} +1 -1
- package/bin/chunk-3td60k1m.js +2 -0
- package/bin/chunk-42hrvk6k.js +211 -0
- package/bin/chunk-4zksqvwj.js +2 -0
- package/bin/chunk-5bk16qdp.js +2 -0
- package/bin/{chunk-y03z5rrg.js → chunk-5nqvqvqp.js} +3 -3
- package/bin/{chunk-e3r1m6rb.js → chunk-5rzxekn4.js} +1 -1
- package/bin/{chunk-h9x81yp6.js → chunk-5vqbzsjv.js} +1 -1
- package/bin/{chunk-628k58ek.js → chunk-6hzktewz.js} +2 -2
- package/bin/{chunk-s978ftze.js → chunk-6jkjx0n2.js} +3 -3
- package/bin/{chunk-gy8z8sd7.js → chunk-6rn094yj.js} +1 -1
- package/bin/{chunk-3cvbb6kh.js → chunk-7qvvf0yd.js} +2 -2
- package/bin/{chunk-asgxtqf0.js → chunk-81dawvn4.js} +2 -2
- package/bin/chunk-8abhmarc.js +2 -0
- package/bin/{chunk-vre5andt.js → chunk-8ayz61rc.js} +3 -3
- package/bin/{chunk-03bfjh8k.js → chunk-8ny7wvzb.js} +2 -2
- package/bin/{chunk-m5cpsm28.js → chunk-8tzfcqtb.js} +2 -2
- package/bin/{chunk-5patxztz.js → chunk-8zgq5sav.js} +3 -3
- package/bin/{chunk-m1xc3t0p.js → chunk-93p27bbm.js} +6 -6
- package/bin/chunk-951r2rx1.js +1 -0
- package/bin/chunk-965102pf.js +3 -0
- package/bin/{chunk-hr2027z3.js → chunk-98mg3dpd.js} +8 -8
- package/bin/{chunk-v42jcex0.js → chunk-9bakwac0.js} +4 -4
- package/bin/{chunk-z8mmqfm4.js → chunk-9ggwc289.js} +1 -1
- package/bin/{chunk-dvkzhpxx.js → chunk-9zgqjdx1.js} +2 -2
- package/bin/{chunk-kzsdp31a.js → chunk-a8bymrv1.js} +2 -2
- package/bin/chunk-acn3r2m2.js +1 -0
- package/bin/{chunk-z1r86fna.js → chunk-ae6zgjhd.js} +2 -2
- package/bin/{chunk-trndqdaa.js → chunk-asy868kq.js} +1 -1
- package/bin/{chunk-r1m4q8vw.js → chunk-b5r0be06.js} +2 -2
- package/bin/{chunk-6ns2vhbd.js → chunk-bbcmhcvc.js} +2 -2
- package/bin/{chunk-0e8xg41c.js → chunk-bpxw19ez.js} +1 -1
- package/bin/{chunk-sg7n2g3z.js → chunk-cdk8vqeg.js} +4 -4
- package/bin/chunk-ce0bhc72.js +2 -0
- package/bin/chunk-ce75dw3k.css +1 -0
- package/bin/{chunk-zf2h3w7t.js → chunk-cpj562n6.js} +1 -1
- package/bin/{chunk-h153xefb.js → chunk-cx32wsa1.js} +1 -1
- package/bin/{chunk-4437dnfa.js → chunk-d2dgazjj.js} +1 -1
- package/bin/{chunk-3zvvct3r.js → chunk-d5hbzp7t.js} +1 -1
- package/bin/chunk-d9qpgkek.js +2 -0
- package/bin/{chunk-9h6nn1a3.js → chunk-dche0gy0.js} +1 -1
- package/bin/{chunk-zcrtr8qd.js → chunk-dppfek34.js} +2 -2
- package/bin/chunk-dv6p6n5e.js +1 -0
- package/bin/{chunk-hx76pje1.js → chunk-e439kt05.js} +1 -1
- package/bin/{chunk-gptzcgte.js → chunk-eqr0znmc.js} +1 -1
- package/bin/{chunk-q5mkbnr9.js → chunk-f5z3096k.js} +2 -2
- package/bin/{chunk-3m6ch1x5.js → chunk-ffj9cq9y.js} +2 -2
- package/bin/{chunk-80qz30dc.js → chunk-fxg81vtx.js} +2 -2
- package/bin/{chunk-5jbx9gqe.js → chunk-ggfx2b0f.js} +1 -1
- package/bin/chunk-gnt9gewm.js +2 -0
- package/bin/{chunk-t597y392.js → chunk-grjek810.js} +2 -2
- package/bin/chunk-gvas3xkp.js +2 -0
- package/bin/{chunk-0ttr4a6b.js → chunk-j53sjkxt.js} +2 -2
- package/bin/{chunk-xyk7vk42.js → chunk-jgfye6nf.js} +2 -2
- package/bin/{chunk-tcat7q9p.js → chunk-jt6v15wx.js} +2 -2
- package/bin/{chunk-rn9rktp4.js → chunk-k3prp6c6.js} +4 -4
- package/bin/{chunk-mqr096rn.js → chunk-k97axrc4.js} +1 -1
- package/bin/{chunk-20anqpf1.js → chunk-kvwec0p3.js} +2 -2
- package/bin/{chunk-tcp4q15p.js → chunk-kzr6ecke.js} +1 -1
- package/bin/{chunk-rkq6jvhb.js → chunk-m6v8vt2b.js} +2 -2
- package/bin/{chunk-xyh5dkr5.js → chunk-mn108p93.js} +1 -1
- package/bin/{chunk-31vx01aw.js → chunk-mn208vrv.js} +2 -2
- package/bin/chunk-mneeg71d.js +2 -0
- package/bin/{chunk-d7mgjqf8.js → chunk-n76w2wcr.js} +1 -1
- package/bin/{chunk-m2dtwvg0.js → chunk-n9vp9nbg.js} +29 -29
- package/bin/{chunk-2g5qdx4s.js → chunk-p0j4wpa5.js} +2 -2
- package/bin/chunk-qb178ntp.js +2 -0
- package/bin/{chunk-7vd5yajk.js → chunk-qmrg2jhs.js} +7 -7
- package/bin/{chunk-4mq874m3.js → chunk-qxscgcn9.js} +2 -2
- package/bin/{chunk-z7p7s55t.js → chunk-r249n1xe.js} +2 -2
- package/bin/{chunk-36r20sj7.js → chunk-r776bhsg.js} +1 -1
- package/bin/{chunk-1k16xsqq.js → chunk-rmvhyqyb.js} +6 -6
- package/bin/{chunk-zwb9kamp.js → chunk-rtaya5wc.js} +2 -2
- package/bin/chunk-rw5h0n0s.js +1 -0
- package/bin/{chunk-6v6c2921.js → chunk-ryepy5er.js} +4 -4
- package/bin/{chunk-ehhsezbj.js → chunk-rza95y4z.js} +2 -2
- package/bin/chunk-s4r6e6ms.js +1 -0
- package/bin/{chunk-qgkbxw1k.js → chunk-sbyyn9yw.js} +2 -2
- package/bin/chunk-syjjke3f.js +1 -0
- package/bin/chunk-t1yamxgk.js +2 -0
- package/bin/chunk-tgfxe0sb.js +1 -0
- package/bin/chunk-tjretpx8.js +1 -0
- package/bin/chunk-tvkekn4z.js +1 -0
- package/bin/{chunk-5t05jpna.js → chunk-twpc640e.js} +1 -1
- package/bin/{chunk-kvqp50dm.js → chunk-v034sfw8.js} +2 -2
- package/bin/{chunk-wydd7sz7.js → chunk-v5hz09a1.js} +2 -2
- package/bin/{chunk-j3xaq9s3.js → chunk-vm2pz2hm.js} +2 -2
- package/bin/{chunk-mt532a33.js → chunk-vzdgsfkf.js} +1 -1
- package/bin/chunk-w4yjgez6.js +14 -0
- package/bin/{chunk-0yv0nnmh.js → chunk-w73v578p.js} +2 -2
- package/bin/{chunk-zp5b1mb6.js → chunk-w9z27p0m.js} +2 -2
- package/bin/chunk-wjcebkpb.js +1 -0
- package/bin/{chunk-62sj29j8.js → chunk-wnqxyqrg.js} +2 -2
- package/bin/chunk-ws71fg50.js +2 -0
- package/bin/{chunk-rsdpycdr.js → chunk-wwkhskce.js} +2 -2
- package/bin/{chunk-kgfa5y9w.js → chunk-xr2v0d6y.js} +5 -5
- package/bin/{chunk-wkxm6yny.js → chunk-y2dhf3p0.js} +2 -2
- package/bin/chunk-yfp3q4da.js +1 -0
- package/bin/{chunk-f22nrm6r.js → chunk-ypkkfwfb.js} +4 -4
- package/bin/chunk-z8e4wc59.js +1 -0
- package/bin/{chunk-c4wnhekn.js → chunk-zckxc8m6.js} +2 -2
- package/bin/{chunk-3fjgf7eb.js → chunk-zdzkjp4q.js} +2 -2
- package/bin/chunk-zf5cyxnt.js +2 -0
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +401 -396
- package/package.json +7 -7
- package/prisma/migrations/20261008134859_add_transcode_3d/migration.sql +2 -0
- package/prisma/schema.prisma +1 -0
- package/bin/chunk-088e1ath.js +0 -3
- package/bin/chunk-18kgmvme.js +0 -2
- package/bin/chunk-1ya6vx4k.js +0 -1
- package/bin/chunk-3xw70yr4.js +0 -2
- package/bin/chunk-4frhvsy0.js +0 -1
- package/bin/chunk-57nqvcg7.js +0 -1
- package/bin/chunk-58hdvwj2.js +0 -1
- package/bin/chunk-5seey9ee.js +0 -2
- package/bin/chunk-66hdwm6f.js +0 -2
- package/bin/chunk-6devq6jh.js +0 -2
- package/bin/chunk-756mr32b.js +0 -2
- package/bin/chunk-9k86d2a3.js +0 -4
- package/bin/chunk-a5fsqkt7.js +0 -1
- package/bin/chunk-ar6kq7hh.js +0 -2
- package/bin/chunk-axfwh5et.js +0 -2
- package/bin/chunk-c0vbj8za.js +0 -1
- package/bin/chunk-dcmfn4hs.js +0 -2
- package/bin/chunk-dy79b8kd.js +0 -1
- package/bin/chunk-ehvyq65t.js +0 -2
- package/bin/chunk-g21k2awz.js +0 -2
- package/bin/chunk-g9f9nzcc.js +0 -1
- package/bin/chunk-gzzfta3s.js +0 -2
- package/bin/chunk-k9cgfzgk.js +0 -3
- package/bin/chunk-nbfcknsq.js +0 -1
- package/bin/chunk-phzemmmy.js +0 -2
- package/bin/chunk-qcf3tb72.js +0 -1
- package/bin/chunk-rgfh5apb.js +0 -1
- package/bin/chunk-rh1hs8wa.js +0 -2
- package/bin/chunk-rpxayeqd.js +0 -1
- package/bin/chunk-s33pcxn0.js +0 -1
- package/bin/chunk-s9svhjv6.js +0 -2
- package/bin/chunk-vnk2p7mq.css +0 -1
- package/bin/chunk-vsefjzzj.js +0 -211
- package/bin/chunk-wf32n1s3.js +0 -1
- package/bin/chunk-yd1k76na.js +0 -2
- package/bin/chunk-yfm9xwes.js +0 -14
- package/bin/chunk-zkep4r7d.js +0 -1
package/bin/chunk-18kgmvme.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h,N,y,u,S,L,t,o,Z,pt,Re,A,O,on,E,WS,q,un,Lo,tf,ut,Tt,Mt,xt}from"./chunk-vsefjzzj.js";import{Ci}from"./chunk-yfm9xwes.js";import{Hl,rs}from"./chunk-1dt700ws.js";import{ql}from"./chunk-rh1hs8wa.js";import{Ii}from"./chunk-s978ftze.js";import{Ul,zl}from"./chunk-ehvyq65t.js";import{Ir}from"./chunk-0e8xg41c.js";import{fr}from"./chunk-dvkzhpxx.js";S();function Si({shareId:r,initialFolderId:ye,initialFileId:X,startTime:G,versionId:b,compare:Ie,compareLeftId:j,compareRightId:z,compareActiveSide:J="left"}){let f=Re(),D=Lo(),w=!!Ie&&!!j&&!!z,[c,Y]=u(()=>localStorage.getItem(`share_pwd_${r}`)||""),[V,Fe]=u(""),{data:a,error:P,isLoading:be}=Z({queryKey:["share-info",r,c],queryFn:async()=>{let e=await A.api.shares[":shareId"].info.$get({param:{shareId:r}},{headers:{"x-share-password":c}});if(e.status===401)throw Error("Unauthorized");if(e.status===403){let s=await e.json();throw Error(s.error||"Forbidden")}if(!e.ok)throw Error("Failed to fetch share info");return await e.json()},retry:!1}),n=ye||a?.rootFolderId,d=X||null,U=b||d,[_,ee]=u([]),{data:T}=Z({queryKey:["public-share-folder",r,n,c],queryFn:async()=>{let e=await A.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:n}},{headers:{"x-share-password":c}});if(e.status===401)throw Error("Unauthorized");return await e.json()},enabled:!!a&&!!n});h(()=>{if(T?.ancestorFolders&&a){let e=T.ancestorFolders.findIndex((s)=>s.id===a.rootFolderId);if(e!==-1)ee(T.ancestorFolders.slice(0,e));else if(n===a.rootFolderId)ee([])}},[T,a,n]);let[R,m]=u(null),[v,p]=u(new Set),[Se,Pe]=u(360),[B,Ne]=u(()=>!X),C=y(null),[te,W]=u([]),[Ce,se]=u(0),[ke,ae]=u(null),[oe,Ae]=u(null),[je,ze]=u(void 0),{data:M,fetchNextPage:re,hasNextPage:ne,isFetchingNextPage:ie,isLoading:le,error:de}=pt({queryKey:["public-share-children",r,n,"folder",c],queryFn:async({pageParam:e})=>{let s=await A.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:r,folderId:n},query:{assetType:"folder",after:e}},{headers:{"x-share-password":c}});if(s.status===401)throw Error("Unauthorized");if(s.status===403)throw Error("Expired");return await s.json()},enabled:!!a&&!!n,initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0,retry:!1}),{data:K,fetchNextPage:ce,hasNextPage:fe,isFetchingNextPage:ue,isLoading:pe}=pt({queryKey:["public-share-children",r,n,"file",c],queryFn:async({pageParam:e})=>{let s=await A.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:r,folderId:n},query:{assetType:"file",after:e}},{headers:{"x-share-password":c}});if(s.status===401)throw Error("Unauthorized");if(s.status===403)throw Error("Expired");return await s.json()},enabled:!!a&&!!n,initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0,retry:!1}),{data:me}=Z({queryKey:["public-share-fields",r,c],queryFn:async()=>{let e=await A.api.shares[":shareId"].fields.$get({param:{shareId:r}},{headers:{"x-share-password":c}});if(e.status===401)throw Error("Unauthorized");return await e.json()},enabled:!!a}),{data:g,isLoading:De}=Z({queryKey:["public-share-file",r,d,c],queryFn:async()=>{let e=await A.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:d}},{headers:{"x-share-password":c}});if(e.status===401)throw Error("Unauthorized");return await e.json()},enabled:!!d&&!!a}),{data:Te,isLoading:$e}=Z({queryKey:["public-share-file",r,b,c],queryFn:async()=>{let e=await A.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:b}},{headers:{"x-share-password":c}});if(e.status===401)throw Error("Unauthorized");return await e.json()},enabled:!!b&&!!a}),i=b?Te:g,Ee=De||!!b&&$e;h(()=>{if(de?.message==="Unauthorized")Y(""),localStorage.removeItem(`share_pwd_${r}`)},[de,r]);let x=N(()=>M?.pages.flatMap((e)=>e.data??[])??[],[M]),I=N(()=>K?.pages.flatMap((e)=>e.data??[])??[],[K]),Le=M?.pages[0]?.pageInfo?.total,qe=K?.pages[0]?.pageInfo?.total,Me=M?.pages[0]?.pageInfo?.totalSize,Ke=K?.pages[0]?.pageInfo?.totalSize,he=N(()=>{if(i)return i;if(v.size!==1)return null;let e=Array.from(v)[0];return[...x,...I].find((s)=>s.id===e)||null},[v,x,I,i]),Ve=(e)=>{e.preventDefault(),Y(V),localStorage.setItem(`share_pwd_${r}`,V)},ge=(e)=>{if(e.type==="folder"||e.targetType==="folder")f({to:"/share/$shareId/folders/$folderId",params:{shareId:r,folderId:e.id}});else f({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:e.versionStack?e.versionStack.id:e.id}});p(new Set)},Ue=(e)=>{if(!a)return;let s=e==="root"?a.rootFolderId:e;if(s===a.rootFolderId)f({to:"/share/$shareId",params:{shareId:r}});else f({to:"/share/$shareId/folders/$folderId",params:{shareId:r,folderId:s}});p(new Set),m(null)},_e=(e)=>{ae(e.id||null);let s=e.annotations;if(s&&s.length>0)W(s);else W([]);if(w){if(e.second!==null&&e.second!==void 0)ze({second:e.second,nonce:Date.now()});return}if(e.second!==null&&e.second!==void 0)C.current?.seekTo(e.second),C.current?.pause();else if(s&&s.length>0)C.current?.pause()},we=()=>{W([]),ae(null)},H=(e)=>{if(!d)return;f({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:d},search:(s)=>({...s,...e})})},Be=()=>{H({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:J==="left"?j:z})},{setProjectState:xe,clearProjectState:ve}=un();h(()=>{if(a&&n){let e=n===a.rootFolderId?a.name:x.find((s)=>s.id===n)?.name||a.name;xe({teamId:"",projectId:a.projectId,projectName:a.name,ancestorFolders:_,currentAsset:{name:i?.name||e,type:d?"file":"folder",version:g?.versionStack?g.versionStack.versions.find((s)=>s.id===U)?.version??g.versionStack.versions.length:void 0,proxyType:i?.proxyType||null},isRootFolder:n===a.rootFolderId&&!d,isPublic:!0,shareId:r,fileId:d||void 0,allowDownload:a.allowDownload,downloadInfo:i?{originalKey:i.media?.original?.key,videoTranscodes:i.media?.videoTranscodes?.map((s)=>({key:s.key,width:s.width,height:s.height,resolution:s.resolution,hdr:s.hdr}))}:void 0,onFolderClick:Ue,isRightSidebarCollapsed:B,onRightSidebarToggle:()=>Ne((s)=>!s),versions:g?.versionStack?.versions,compareMode:w,canCompareVersions:(g?.versionStack?.versions?.length??0)>=2,onCompareVersions:()=>{let s=Hl(g?.versionStack?.versions);if(!s||!d)return;f({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:d},search:(l)=>({...l,compare:!0,cmpLeft:s.left.id,cmpRight:s.right.id,cmpActive:"left"})})}})}return()=>ve()},[a,n,x,i,g,U,d,_,xe,ve,B,w,f,r]);let F;if(be&&!P)F=t("div",{className:"flex flex-1 items-center justify-center bg-background",children:t(O,{className:"h-8 w-8 animate-spin text-foreground"})});else if(P)if(P.message==="Unauthorized"){let e=c!=="";F=t("div",{className:"flex flex-1 items-center justify-center p-4",children:o(ut,{className:"w-full max-w-md",children:[o(Tt,{className:"text-center",children:[t("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:t(on,{className:"h-6 w-6 text-primary"})}),t(Mt,{children:WS()})]}),t(xt,{children:o("form",{onSubmit:Ve,className:"space-y-4",children:[o("div",{className:"space-y-2",children:[t(q,{type:"password",placeholder:"Enter password",value:V,onChange:(s)=>Fe(s.target.value),autoFocus:!0}),e&&t("p",{className:"text-sm font-medium text-destructive",children:"Incorrect password. Please try again."})]}),t(E,{type:"submit",className:"w-full",children:"Access Share"})]})})]})})}else{let e=P.message.includes("expired"),s=P.message.includes("disabled");F=t("div",{className:"flex flex-1 items-center justify-center p-4",children:o(ut,{className:"w-full max-w-md",children:[o(Tt,{className:"text-center",children:[t("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:t(fr,{className:"h-6 w-6 text-destructive"})}),t(Mt,{children:e?"Share Expired":s?"Share Disabled":"Error"})]}),t(xt,{className:"text-center text-muted-foreground",children:P.message})]})})}else if(!a)F=t("div",{className:"flex flex-1 items-center justify-center bg-background",children:t(O,{className:"h-8 w-8 animate-spin text-foreground"})});else if(D&&d&&!w&&i){let e=i?.ancestorFolders?.[0]?.id||(n!==a.rootFolderId?n:void 0),s=i?.ancestorFolders&&i.ancestorFolders.length>0?i.ancestorFolders:_;F=t(Ul,{projectId:a.projectId,fileId:d,file:i,projectInfo:{name:a.name,rootFolder:a.rootFolderId},ancestorFolders:s,versions:g?.versionStack?.versions??i?.versionStack?.versions,activeFileId:U||d,startTime:G,isPublic:!0,shareId:r,allowDownload:a.allowDownload,publicFields:me,siblingFiles:I,onNavigateToFile:(l)=>{f({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:l}})},onNavigateBack:()=>{if(e&&e!==a.rootFolderId)f({to:"/share/$shareId/folders/$folderId",params:{shareId:r,folderId:e}});else f({to:"/share/$shareId",params:{shareId:r}})},onSelectVersion:(l)=>{f({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:d},search:(k)=>({...k,version:l})})},onSaveField:()=>{}})}else F=o("div",{className:"flex flex-1 overflow-hidden relative",children:[d?o("div",{className:"flex-1 relative bg-muted/30",children:[Ee&&!w&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:t(O,{className:"h-8 w-8 animate-spin text-foreground"})}),w&&j&&z?t(zl,{isPublic:!0,shareId:r,versions:i?.versionStack?.versions??[],leftId:j,rightId:z,activeSide:J,annotations:te,seekRequest:je,allowDownload:a.allowDownload,onActiveSideChange:(e)=>H({cmpActive:e}),onSwitchVersion:(e,s)=>H(e==="left"?{cmpLeft:s}:{cmpRight:s}),onExit:Be,onActiveAssetChange:Ae,onPlay:we,onTimeUpdate:se}):i&&t(rs,{file:i,mediaControllerRef:C,onPlay:we,onTimeUpdate:se,annotations:te,startTime:G,shareId:r,allowDownload:a.allowDownload})]}):n&&(D?t(ql,{teamId:"",projectId:a.projectId,assetId:n,folders:x,files:I,totalFolders:Le,totalFiles:qe,totalFoldersSize:Me,totalFilesSize:Ke,selectedItem:R,selectedIds:v,onItemSelect:(e,s)=>{if(s.metaKey||s.ctrlKey){let l=new Set(v);if(l.has(e.id)){if(l.delete(e.id),p(l),R?.id===e.id){let k=[...x,...I].find((Q)=>l.has(Q.id));m(k||null)}}else l.add(e.id),p(l),m(e)}else p(new Set([e.id])),m(e)},onItemDoubleClick:ge,onClearSelection:()=>{p(new Set),m(null)},fetchNextFoldersPage:re,hasNextFoldersPage:ne,isFetchingNextFoldersPage:ie,fetchNextFilesPage:ce,hasNextFilesPage:fe,isFetchingNextFilesPage:ue,isLoading:le||pe,isShareView:!0,isPublic:!0,shareId:r,allowDownload:a.allowDownload}):t(Ci,{teamId:"",projectId:a.projectId,assetId:n,folders:x,files:I,selectedItem:R,selectedIds:v,onItemSelect:(e,s)=>{if(s.metaKey||s.ctrlKey){let l=new Set(v);if(l.has(e.id)){if(l.delete(e.id),p(l),R?.id===e.id){let k=[...x,...I].find((Q)=>l.has(Q.id));m(k||null)}}else l.add(e.id),p(l),m(e)}else p(new Set([e.id])),m(e)},onItemDoubleClick:ge,onSaveField:()=>{},displayStyle:a.viewMode??"card",onClearSelection:()=>{p(new Set),m(null)},fetchNextFoldersPage:re,hasNextFoldersPage:ne,isFetchingNextFoldersPage:ie,fetchNextFilesPage:ce,hasNextFilesPage:fe,isFetchingNextFilesPage:ue,isLoading:le||pe,isShareView:!0,isPublic:!0,shareId:r,sharePassword:c,allowDownload:a.allowDownload})),!B&&!D&&o(L,{children:[t(Ir,{onResize:(e)=>Pe((s)=>Math.max(240,Math.min(600,s-e)))}),t("div",{style:{width:Se},className:"flex-shrink-0 border-l",children:t(Ii,{teamId:"",projectId:a.projectId,file:w?oe:he,onSaveField:()=>{},members:[],readOnly:!0,publicFields:me,onCommentSelect:_e,isPublic:!0,shareId:r,currentTime:Ce,onTyping:()=>{C.current?.pause()},selectedCommentId:ke,hideAnnotationControl:(w?oe:he)?.proxyType==="audio"})})]})]});return o("div",{className:"flex h-[100dvh] flex-col bg-background",children:[(!D||!d)&&t(tf,{}),F]})}
|
|
2
|
-
export{Si};
|
package/bin/chunk-1ya6vx4k.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,S,t,Z,ze,A,lt,St,em}from"./chunk-vsefjzzj.js";import"./chunk-1dt700ws.js";import"./chunk-yfm9xwes.js";import"./chunk-zp5b1mb6.js";import"./chunk-3m6ch1x5.js";import"./chunk-62sj29j8.js";import"./chunk-6v6c2921.js";import"./chunk-c4wnhekn.js";import"./chunk-ehhsezbj.js";import"./chunk-dcmfn4hs.js";import"./chunk-rh1hs8wa.js";import"./chunk-vre5andt.js";import"./chunk-s978ftze.js";import"./chunk-0e8xg41c.js";import{Gn}from"./chunk-gzzfta3s.js";import{nr}from"./chunk-g21k2awz.js";import"./chunk-rsdpycdr.js";import"./chunk-3584j9fc.js";import"./chunk-s9svhjv6.js";import"./chunk-m5cpsm28.js";import"./chunk-dvkzhpxx.js";import"./chunk-4mq874m3.js";import"./chunk-t597y392.js";import"./chunk-4437dnfa.js";S();function i(){let{projectId:o}=l.useParams(),{teamId:r,ensureTeamIdForProject:a}=lt();h(()=>{a(o)},[o,a]);let{data:s}=nr(em(o)),e=s?.rootFolder,{data:n}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!n)return t(St,{});return t(Gn,{teamId:r,projectId:o,projectName:s.name??"",assetId:"recents",rootFolderId:e})}var l=ze("/projects/$projectId/recents")({component:i});export{l as Route};
|
package/bin/chunk-3xw70yr4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{uf,Dn,dc,fc,pc,mc,xu,Su,mm,LA,Cs,jo,jr}from"./chunk-h9x81yp6.js";export{pc as EncryptJWT,fc as SignJWT,mm as UnsecuredJWT,uf as base64url,mc as calculateJwkThumbprint,xu as createLocalJWKSet,Su as createRemoteJWKSet,jr as decodeJwt,jo as decodeProtectedHeader,Cs as importJWK,LA as importPKCS8,dc as jwtDecrypt,Dn as jwtVerify};
|
package/bin/chunk-4frhvsy0.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,S,t,Z,B,ze,A,Hh,lt,am,FA}from"./chunk-vsefjzzj.js";import"./chunk-1dt700ws.js";import"./chunk-yfm9xwes.js";import"./chunk-zp5b1mb6.js";import"./chunk-3m6ch1x5.js";import"./chunk-62sj29j8.js";import"./chunk-6v6c2921.js";import"./chunk-c4wnhekn.js";import"./chunk-ehhsezbj.js";import"./chunk-dcmfn4hs.js";import"./chunk-rh1hs8wa.js";import"./chunk-vre5andt.js";import"./chunk-s978ftze.js";import"./chunk-0e8xg41c.js";import{Gn}from"./chunk-gzzfta3s.js";import{nr}from"./chunk-g21k2awz.js";import"./chunk-rsdpycdr.js";import"./chunk-3584j9fc.js";import"./chunk-s9svhjv6.js";import"./chunk-m5cpsm28.js";import"./chunk-dvkzhpxx.js";import"./chunk-4mq874m3.js";import"./chunk-t597y392.js";import"./chunk-4437dnfa.js";S();function u(){let{projectId:o,collectionId:r}=y.useParams(),{teamId:s,ensureTeamIdForProject:i}=lt();h(()=>{i(o)},[o,i]);let{data:l}=nr(am(o)),{data:a,refetch:d}=Z({...FA(r)}),{mutate:p}=B({mutationFn:async(n)=>{let c=await A.api.collections[":collectionId"].$patch({param:{collectionId:r},json:n});if(!c.ok)throw Error("Failed to update collection");return await c.json()},onSuccess:()=>{d()}}),e=l?.rootFolder,{data:f}=Z({queryKey:["folders",e],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:e}});if(!n.ok)throw Error("Failed to fetch folder");return await n.json()},enabled:!!e});if(!s||!e||!f||!a)return t("div",{children:Hh()});let m=a.filter.sourceFolderId||e;return t(Gn,{teamId:s,projectId:o,projectName:l.name??"",assetId:m,rootFolderId:e,collection:a,onUpdateCollection:p})}var y=ze("/projects/$projectId/collections/$collectionId")({component:u});export{y as Route};
|
package/bin/chunk-57nqvcg7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,N,u,S,L,t,o,Q,Z,B,pt,ze,A,I,or,O,Vr,Ct,jn,nn,vt,Ma,rr,Bs,vo,pe,wo,we,Ne,C,E,Ce,Ie,Te,he,ge,Ae,K,Qm,eh,De,D_,U_,Zc,hy,gy,Nf,at,qy,Hy,eb,tb,hd,db,Ah,Tn,Uv,zv,jv,qv,Hv,$v,Gv,vd,Ew,Dx,ag,nS,hS,vg,qg,qs,Zd,Pp,Bd,dA,Up,AT,_T,fA,pA,mA,hA,gA,zd,AA,ST,As,Je,Xe,et,tt,rt,nt,ot,st,ue,ae,fe,qe,le,It,q,ce,Xo,Dr,_n,$n,ys,Or,Hd,Pt,M,xe,gr,Qe,Ur,bi,PA,oo,Jp,aa,la,wi,W,Me,Le,Ze,Be,Ue,ne,xi,Kd,Wd,Yd,Xd}from"./chunk-vsefjzzj.js";import{qa}from"./chunk-z7p7s55t.js";import{Vn,ao}from"./chunk-m5cpsm28.js";import{dn}from"./chunk-t597y392.js";S();var it=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Se=I("pen",it);function Ke({scope:e,onScopeChange:r,selectedGoal:x,onClearGoal:p,onCreateTask:w,canCreateTask:v=!0}){return o("header",{className:"h-14 border-b border-border bg-card/60 backdrop-blur-sm px-4 flex items-center justify-between gap-3 shrink-0 select-none",children:[o("div",{className:"flex items-center gap-3 min-w-0",children:[o("div",{className:"flex items-center bg-muted/60 p-0.5 rounded-lg border border-border/50",children:[o(E,{variant:e==="team"?"secondary":"ghost",size:"sm",onClick:()=>r("team"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${e==="team"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[t(ao,{className:"w-3.5 h-3.5"}),t("span",{children:ST()})]}),o(E,{variant:e==="my"?"secondary":"ghost",size:"sm",onClick:()=>r("my"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${e==="my"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[t(Vn,{className:"w-3.5 h-3.5"}),t("span",{children:Dx()})]})]}),x&&o("div",{className:"hidden sm:flex items-center gap-1.5 px-2 py-1 rounded-md bg-sidebar-accent border border-sidebar-border text-xs text-sidebar-accent-foreground min-w-0 max-w-[200px] md:max-w-[280px]",children:[t(wo,{className:"w-3.5 h-3.5 text-sidebar-primary shrink-0"}),t("span",{className:"truncate font-medium",children:x.id===bi?As():x.title}),t(E,{variant:"ghost",size:"icon-xs",onClick:p,className:"h-4 w-4 p-0 ml-0.5 text-muted-foreground hover:text-foreground",title:U_(),children:t(Ne,{className:"w-3 h-3"})})]})]}),v&&t("div",{className:"flex items-center gap-2 shrink-0",children:o(E,{size:"sm",onClick:w,className:"h-8 px-3 text-xs gap-1.5 shadow-xs",children:[t(pe,{className:"w-3.5 h-3.5"}),t("span",{children:Nf()})]})})]})}S();S();function me({teamId:e,isOpen:r,onClose:x,goalToEdit:p}){let w=Q(),[v,_]=u(""),[g,P]=u("");h(()=>{if(p)_(p.title),P(p.description||"");else _(""),P("")},[p,r]);let{mutate:G,isPending:z}=B({mutationFn:async()=>{let n=await A.api.teams[":teamId"].kanban.goals.$post({param:{teamId:e},json:{title:v.trim(),description:g.trim()||void 0}});if(!n.ok){let b=await n.json().catch(()=>({message:Tn()}));throw Error(b.message||Tn())}return await n.json()},onSuccess:()=>{w.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),M.success(Uv()),x()},onError:(n)=>{M.error(n.message)}}),{mutate:R,isPending:F}=B({mutationFn:async()=>{if(!p)return;let n=await A.api.teams[":teamId"].kanban.goals[":goalId"].$patch({param:{teamId:e,goalId:p.id},json:{title:v.trim(),description:g.trim()||null}});if(!n.ok){let b=await n.json().catch(()=>({message:Tn()}));throw Error(b.message||Tn())}return await n.json()},onSuccess:()=>{w.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),M.success(Gv()),x()},onError:(n)=>{M.error(n.message)}}),U=(n)=>{if(n.preventDefault(),!v.trim())return;if(p)R();else G()},d=z||F;return t(ue,{open:r,onOpenChange:(n)=>!n&&x(),children:t(ae,{className:"sm:max-w-xl",children:o("form",{onSubmit:U,className:"space-y-4",children:[o(fe,{children:[t(le,{children:p?Ah():gy()}),t(It,{children:p?Ah():hy()})]}),o("div",{className:"space-y-3 py-2",children:[o("div",{className:"space-y-1.5",children:[t(W,{htmlFor:"goal-title",children:Hv()}),t(q,{id:"goal-title",value:v,onChange:(n)=>_(n.target.value),placeholder:$v(),required:!0,autoFocus:!0})]}),o("div",{className:"space-y-1.5",children:[t(W,{htmlFor:"goal-description",children:jv()}),t(wi,{id:"goal-description",value:g,onChange:(n)=>P(n.target.value),placeholder:qv(),rows:3})]})]}),o(qe,{children:[t(E,{type:"button",variant:"outline",onClick:x,disabled:d,children:De()}),o(E,{type:"submit",disabled:!v.trim()||d,children:[d&&t(O,{className:"w-4 h-4 mr-1.5 animate-spin"}),p?qs():Zc()]})]})]})})})}function _e({teamId:e,selectedGoalId:r,onSelectGoal:x,isOwnerOrEditor:p=!0}){let w=Q(),[v,_]=u(!1),[g,P]=u(null),[G,z]=u(null),[R,F]=u(!1),{data:U,isLoading:d}=Z({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let i=await A.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!i.ok)throw Error("Failed to fetch goals");return await i.json()},enabled:!!e}),n=U?.data||[],b=n.reduce((i,s)=>i+(s.taskCount||0),0),{mutate:D,isPending:l}=B({mutationFn:async(i)=>{let s=await A.api.teams[":teamId"].kanban.goals[":goalId"].$delete({param:{teamId:e,goalId:i}});if(!s.ok){let m=await s.json().catch(()=>({message:Tn()}));throw Error(m.message||Tn())}return await s.json()},onSuccess:(i,s)=>{if(w.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),w.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),M.success(zv()),r===s)x(null);z(null)},onError:(i)=>{M.error(i.message)}});if(R)return o("div",{className:"border-r border-sidebar-border bg-sidebar flex flex-col items-center w-12 shrink-0 transition-all duration-300",children:[t("div",{className:"h-14 flex items-center justify-center border-b border-sidebar-border w-full shrink-0",children:t(E,{variant:"ghost",size:"icon-sm",onClick:()=>F(!1),title:vd(),className:"text-sidebar-foreground/70 hover:text-sidebar-foreground",children:t(vt,{className:"w-4 h-4"})})}),o("div",{className:"mt-3 flex flex-col items-center gap-2",children:[t(E,{variant:r===null?"secondary":"ghost",size:"icon-sm",onClick:()=>x(null),title:Qm(),className:C("w-8 h-8 rounded-md",r===null&&"bg-sidebar-accent text-sidebar-accent-foreground"),children:t(qa,{className:"w-4 h-4"})}),t(E,{variant:"ghost",size:"icon-sm",onClick:()=>_(!0),title:ag(),className:"w-8 h-8 rounded-md text-sidebar-foreground/70 hover:text-sidebar-foreground",children:t(pe,{className:"w-4 h-4"})})]}),v&&t(me,{teamId:e,isOpen:v,onClose:()=>_(!1)})]});return o("aside",{className:"w-64 border-r border-sidebar-border bg-sidebar flex flex-col shrink-0 transition-all duration-300 select-none",children:[o("div",{className:"h-14 px-3 flex items-center justify-between border-b border-sidebar-border shrink-0",children:[o("div",{className:"flex items-center gap-2 font-semibold text-xs tracking-wider uppercase text-sidebar-foreground/70",children:[t(wo,{className:"w-4 h-4 text-sidebar-primary"}),t("span",{children:vd()})]}),o("div",{className:"flex items-center gap-1",children:[p&&t(E,{variant:"ghost",size:"icon-sm",onClick:()=>_(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:ag(),children:t(pe,{className:"w-4 h-4"})}),t(E,{variant:"ghost",size:"icon-sm",onClick:()=>F(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:"Collapse",children:t(nn,{className:"w-4 h-4"})})]})]}),t(ce,{className:"flex-1 p-2",children:o("div",{className:"space-y-1",children:[o("div",{onClick:()=>x(null),className:C("flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group h-8 min-h-[32px]",r===null?"bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),children:[o("div",{className:"flex items-center gap-2 truncate min-w-0",children:[t(qa,{className:"w-3.5 h-3.5 shrink-0 text-sidebar-primary"}),t("span",{className:"truncate",children:Qm()})]}),b>0&&t("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 shrink-0",children:b})]}),d?t("div",{className:"flex items-center justify-center p-4",children:t(O,{className:"w-4 h-4 animate-spin text-muted-foreground"})}):n.length===0?t("div",{className:"px-2.5 py-4 text-center text-xs text-muted-foreground",children:nS()}):n.map((i)=>{let s=r===i.id,m=i.id===bi,k=m?As():i.title,f=p&&!m;return o("div",{onClick:()=>x(i.id),className:C("flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group relative min-h-[32px]",s?"bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),children:[o("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t(wo,{className:C("w-3.5 h-3.5 shrink-0",s?"text-sidebar-primary":"text-muted-foreground")}),t("span",{className:"line-clamp-2 break-words leading-tight",title:k,children:k})]}),t("div",{className:"flex items-center shrink-0 ml-1",children:f?o(L,{children:[(i.taskCount??0)>0&&t("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 group-hover:hidden group-focus-within:hidden [&:has(~_div_[data-state=open])]:hidden",children:i.taskCount}),t("div",{className:"hidden group-hover:flex group-focus-within:flex [&:has([data-state=open])]:flex items-center",onClick:(c)=>c.stopPropagation(),children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(E,{variant:"ghost",size:"icon-xs",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",children:t(or,{className:"w-3.5 h-3.5"})})}),o(Ae,{align:"end",className:"w-36",children:[o(K,{onClick:()=>{P(i)},children:[t(Se,{className:"w-3.5 h-3.5 mr-2"}),db()]}),o(K,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{z(i)},children:[t(we,{className:"w-3.5 h-3.5 mr-2"}),at()]})]})]})})]}):(i.taskCount??0)>0&&t("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60",children:i.taskCount})})]},i.id)})]})}),(v||g)&&t(me,{teamId:e,isOpen:v||!!g,goalToEdit:g,onClose:()=>{_(!1),P(null)}}),G&&t(Je,{open:!!G,onOpenChange:(i)=>!i&&z(null),children:o(Xe,{children:[o(et,{children:[t(rt,{children:qy()}),t(nt,{children:Hy({title:G.title})})]}),o(tt,{children:[t(st,{disabled:l,children:De()}),o(ot,{onClick:()=>D(G.id),disabled:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[l&&t(O,{className:"w-4 h-4 mr-1.5 animate-spin"}),at()]})]})]})})]})}S();S();function Pe(e){return+xe(e)<Date.now()}function Fe({task:e,onClick:r,onDelete:x,disabled:p,isFirst:w,isLast:v,showBottomIndicator:_,currentUserId:g,currentUserRole:P}){let{source:G}=Hd(),z=!!G,R=P?.toLowerCase()==="owner",F=P?.toLowerCase()==="editor",U=!!g&&e.creator?.id===g,d=e.reporter?.id===g||U,n=e.assignee?.id===g,b=R||F||d||n,D=U||R||d,l=p||!b,{ref:i,isDragging:s}=ys({id:e.id,data:{type:"kanban_task",task:e},disabled:l}),{ref:m,isDropTarget:k}=Or({id:`reorder-before-${e.id}`,data:{type:"reorder",task:e,position:"before"},disabled:s||p}),{ref:f,isDropTarget:c}=Or({id:`reorder-after-${e.id}`,data:{type:"reorder",task:e,position:"after"},disabled:s||p}),T=e.isAgentTask,j=e.status===Qe.BLOCKED,y=e.dueDate?Pe(new Date(e.dueDate))&&e.status!==Qe.DONE:!1;return o("div",{className:"relative",children:[t("div",{ref:m,className:C("absolute left-0 right-0 z-20",w?"-top-6 h-[calc(50%+24px)]":"-top-1 h-[calc(50%+4px)]",z&&!s?"pointer-events-auto":"pointer-events-none")}),t("div",{ref:f,className:C("absolute bottom-0 left-0 right-0 z-20",v?"-bottom-6 h-[calc(50%+24px)]":"h-1/2",z&&!s?"pointer-events-auto":"pointer-events-none")}),k&&!s&&t("div",{className:"absolute -top-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none"}),(c||_)&&!s&&t("div",{className:"absolute -bottom-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none"}),o("div",{ref:i,onClick:()=>r(e),className:C("group relative flex flex-col gap-2 p-3 rounded-lg border text-card-foreground transition-all duration-200 cursor-pointer select-none",s&&"opacity-40 scale-95 shadow-lg ring-2 ring-primary",!s&&"hover:shadow-md","border-border/80 bg-card hover:border-primary/50 shadow-2xs",j&&"border-red-500/60 bg-red-500/[0.03] ring-1 ring-red-500/20"),children:[o("div",{className:"flex items-center justify-between gap-1.5 min-w-0",children:[o("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[t("span",{className:C("px-1.5 py-0.5 rounded text-[10px] font-medium border uppercase tracking-wider shrink-0",la(e.priority)),children:aa(e.priority)}),T&&o("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-semibold bg-orange-500/15 text-orange-600 dark:text-orange-400 border border-orange-500/30 shrink-0",children:[t(Ct,{className:"w-3 h-3"}),t("span",{children:zd()})]}),e.goal&&o("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-muted text-muted-foreground border border-border/70 truncate max-w-[130px]",children:[t(wo,{className:"w-2.5 h-2.5 shrink-0"}),t("span",{className:"truncate",children:e.goal.title})]})]}),t("div",{className:"flex items-center gap-1 shrink-0",children:D&&t("div",{className:"opacity-0 group-hover:opacity-100 [&:has([data-state=open])]:opacity-100 focus-within:opacity-100 transition-opacity flex items-center",onClick:(X)=>X.stopPropagation(),children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(E,{variant:"ghost",size:"icon-xs",className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground",children:t(or,{className:"w-3.5 h-3.5"})})}),t(Ae,{align:"end",className:"w-32",children:o(K,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>x?.(e),children:[t(we,{className:"w-3.5 h-3.5 mr-2"}),at()]})})]})})})]}),t("h4",{className:"text-xs font-semibold leading-snug line-clamp-2 text-foreground break-words",children:e.title}),j&&o("div",{className:"flex items-start gap-1.5 p-1.5 rounded bg-red-500/10 border border-red-500/20 text-[11px] text-red-600 dark:text-red-400",children:[t(Vr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),t("span",{className:"line-clamp-2 break-words",children:e.latestStatusEvent?.blockReason||e.latestStatusEvent?.reason||e.latestStatusEvent?.summary||dA()})]}),e.status===Qe.IN_REVIEW&&e.latestStatusEvent?.summary&&o("div",{className:"flex items-start gap-1.5 p-1.5 rounded bg-purple-500/10 border border-purple-500/20 text-[11px] text-purple-600 dark:text-purple-400",children:[t(dn,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),t("span",{className:"line-clamp-2 break-words",children:e.latestStatusEvent.summary})]}),o("div",{className:"flex items-center justify-between gap-2 pt-1 mt-auto border-t border-border/40 text-[11px] text-muted-foreground",children:[t("div",{className:"flex items-center gap-1.5 min-w-0",children:e.assignee?o(L,{children:[T?t("div",{className:"w-5 h-5 rounded-full bg-orange-500/15 border border-orange-500/30 flex items-center justify-center shrink-0",children:t(Ct,{className:"w-3 h-3 text-orange-600 dark:text-orange-400"})}):o(Ce,{size:"sm",className:"w-5 h-5 border border-border",children:[t(Ie,{src:e.assignee.image}),t(Te,{className:"text-[9px]",children:e.assignee.name.slice(0,2).toUpperCase()})]}),t("span",{className:"truncate text-xs font-medium text-foreground/80 max-w-[90px]",children:e.assignee.name})]}):t("span",{className:"text-[11px] italic text-muted-foreground/60",children:As()})}),o("div",{className:"flex items-center gap-2 shrink-0",children:[e.dueDate&&o("div",{className:C("flex items-center gap-1 text-[10px] font-mono",y?"text-red-500 font-semibold":"text-muted-foreground"),title:gr(new Date(e.dueDate),"yyyy/MM/dd HH:mm"),children:[t(jn,{className:"w-3 h-3"}),t("span",{children:gr(new Date(e.dueDate),"MM/dd")})]}),e.assetCount>0&&o("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:Ew({count:e.assetCount}),children:[t(Ma,{className:"w-3 h-3"}),t("span",{children:e.assetCount})]}),e.dependencyCount>0&&o("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${e.dependencyCount} dependencies`,children:[t(Bs,{className:"w-3 h-3"}),t("span",{children:e.dependencyCount})]}),e.commentCount>0&&o("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${e.commentCount} comments`,children:[t(vo,{className:"w-3 h-3"}),t("span",{children:e.commentCount})]})]})]})]})]})}function Ee({teamId:e,status:r,selectedGoalId:x,scope:p,currentUserId:w,currentUserRole:v,onTaskClick:_,onDeleteTask:g,onCreateTaskInColumn:P}){let G=v?.toLowerCase()==="owner"||v?.toLowerCase()==="editor",z=p==="my"?w:void 0,{data:R,fetchNextPage:F,hasNextPage:U,isFetchingNextPage:d,isLoading:n}=pt({queryKey:["teams",e,"kanban","tasks",{status:r,goalId:x,assigneeId:z}],queryFn:async({pageParam:H=""})=>{let J=await A.api.teams[":teamId"].kanban.tasks.$get({param:{teamId:e},query:{status:r,goalId:x||void 0,assigneeId:z||void 0,first:"20",after:H||void 0}});if(!J.ok)throw Error("Failed to fetch column tasks");return await J.json()},initialPageParam:"",getNextPageParam:(H)=>H.pageInfo?.cursor||void 0,refetchInterval:5000,enabled:!!e}),{ref:b,inView:D}=Pt({threshold:0.1});h(()=>{if(D&&U&&!d)F()},[D,U,d,F]);let l=N(()=>R?.pages?.flatMap((H)=>Array.isArray(H?.data)?H.data:[])||[],[R]),{source:i,target:s}=Hd(),m=l.filter((H)=>H.id!==i?.id).at(-1),{ref:k,isDropTarget:f}=Or({id:r,data:{type:"kanban_column",status:r,lastTask:m}}),c=i?.data?.type==="kanban_task",T=c&&(f||s?.data?.type==="kanban_column"&&s.data.status===r||s?.data?.type==="reorder"&&s.data.task?.status===r),j=c&&s?.data?.type==="kanban_column"&&s.data.status===r,y=R?.pages?.[0]?.pageInfo?.total??l.length,X=Jp(r);return o("div",{ref:k,className:C("flex flex-col h-full max-h-full w-80 md:w-84 shrink-0 rounded-xl bg-card/60 border border-border/70 shadow-xs transition-colors duration-200 overflow-hidden select-none",T&&"ring-2 ring-primary/60 bg-primary/[0.03] border-primary/40"),children:[o("div",{className:"h-11 px-3.5 flex items-center justify-between border-b border-border/60 bg-card/80 shrink-0",children:[o("div",{className:"flex items-center gap-2 min-w-0",children:[t("div",{className:C("w-2.5 h-2.5 rounded-full shrink-0",X.dot)}),t("h3",{className:"text-xs font-bold tracking-wide uppercase text-foreground/90 truncate",children:oo(r)})]}),t("div",{className:"flex items-center gap-1 shrink-0",children:t("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-muted font-medium text-muted-foreground",children:y})})]}),t(ce,{className:"flex-1 min-h-0 [&>div>div]:block!",children:o("div",{className:"p-2.5 space-y-2.5 min-h-full flex flex-col",children:[n?t("div",{className:"flex items-center justify-center py-10",children:t(O,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):l.length===0?t("div",{className:"flex flex-col items-center justify-center py-10 px-4 text-center",children:t("p",{className:"text-xs text-muted-foreground/70",children:hS()})}):l.map((H,J)=>t(Fe,{task:H,onClick:_,onDelete:g,isFirst:J===0,isLast:J===l.length-1,showBottomIndicator:j&&H.id===m?.id,currentUserId:w,currentUserRole:v},H.id)),t("div",{ref:b,className:"h-2"}),d&&t("div",{className:"flex justify-center py-2",children:t(O,{className:"w-4 h-4 animate-spin text-muted-foreground"})})]})}),G&&t("div",{className:"p-2 border-t border-border/50 bg-card/90 shrink-0",children:o(E,{variant:"ghost",size:"sm",onClick:()=>P(r),className:"w-full justify-center h-8 text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted/80 border border-dashed border-border/80",children:[t(pe,{className:"w-3.5 h-3.5 mr-1.5"}),t("span",{children:Nf()})]})})]})}function Oe({teamId:e,selectedGoalId:r,scope:x,currentUserId:p,currentUserRole:w,onTaskClick:v,onCreateTaskInColumn:_}){let g=Q(),[P,G]=u(null),{mutate:z,isPending:R}=B({mutationFn:async(d)=>{let n=await A.api.teams[":teamId"].kanban.tasks[":taskId"].$delete({param:{teamId:e,taskId:d}});if(!n.ok){let b=await n.json().catch(()=>({message:Tn()}));throw Error(b.message||Tn())}return await n.json()},onSuccess:()=>{g.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),g.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),M.success(_T()),G(null)},onError:(d)=>{M.error(d.message)}}),{mutate:F}=B({mutationFn:async({taskId:d,fromStatus:n,status:b,reason:D,beforeIndex:l,afterIndex:i})=>{let s=await A.api.teams[":teamId"].kanban.tasks[":taskId"].$patch({param:{teamId:e,taskId:d},json:{fromStatus:n,status:b,reason:D,beforeIndex:l,afterIndex:i}});if(!s.ok){let m=await s.json().catch(()=>({message:Tn()}));throw Error(m.message||Tn())}return await s.json()},onMutate:async({taskId:d,status:n,targetTaskId:b,position:D})=>{await g.cancelQueries({queryKey:["teams",e,"kanban","tasks"]});let l=g.getQueriesData({queryKey:["teams",e,"kanban","tasks"]}),i=null,s=(m)=>m[0]==="teams"&&m[1]===e&&m[2]==="kanban"&&m[3]==="tasks"&&typeof m[4]==="object"&&m[4]!==null&&("status"in m[4]);if(g.setQueriesData({predicate:(m)=>s(m.queryKey)},(m)=>{if(!m||!Array.isArray(m.pages))return m;let k=!1,f=m.pages.map((c)=>{if(!c||!Array.isArray(c.data))return c;let T=c.data.find((j)=>j.id===d);if(T)return i={...T,status:n},k=!0,{...c,data:c.data.filter((j)=>j.id!==d),pageInfo:{...c.pageInfo,total:Math.max(0,(c.pageInfo?.total??c.data.length)-1)}};return c});return k?{...m,pages:f}:m}),i){let m=i;g.setQueriesData({predicate:(k)=>{if(!s(k.queryKey))return!1;return k.queryKey[4]?.status===n}},(k)=>{if(!k||!Array.isArray(k.pages))return k;let f=k.pages.flatMap((y)=>y?.data??[]).filter((y)=>y.id!==d),c=f.length;if(b){let y=f.findIndex((X)=>X.id===b);if(y!==-1)c=D==="before"?y:y+1}f.splice(c,0,m);let T=0,j=k.pages.map((y,X)=>{let H=y?.data?y.data.length:0,J=X===0&&H===0?1:X===k.pages.length-1?f.length-T:H,te=f.slice(T,T+J);return T+=J,{...y,data:te,pageInfo:{...y?.pageInfo,total:(y?.pageInfo?.total??0)+1}}});if(T<f.length&&j.length>0){let y=j.length-1;j[y]={...j[y],data:[...j[y]?.data??[],...f.slice(T)]}}return{...k,pages:j}})}return{previousQueries:l}},onError:(d,n,b)=>{if(b?.previousQueries)for(let[D,l]of b.previousQueries)g.setQueryData(D,l);M.error(d.message)},onSettled:()=>{g.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]})}}),U=(d)=>{if(d.canceled)return;let{source:n,target:b}=d.operation;if(!n||!b)return;let D=n.data;if(D?.type!=="kanban_task"||!D.task)return;let l=D.task,i=w?.toLowerCase()==="owner",s=w?.toLowerCase()==="editor",m=l.reporter?.id===p||l.creator?.id===p,k=l.assignee?.id===p;if(!i&&!s&&!m&&!k){M.error(D_());return}let f=b.data;if(!f)return;if(f.type==="reorder"&&f.task&&f.position){let c=f.task,T=c.status;if(l.id===c.id)return;let j=f.position==="before"?c.sortIndex??void 0:void 0,y=f.position==="after"?c.sortIndex??void 0:void 0;F({taskId:l.id,fromStatus:l.status,status:T,beforeIndex:j,afterIndex:y,targetTaskId:c.id,position:f.position});return}if(f.type==="kanban_column"&&f.status){let{status:c,lastTask:T}=f;if(T){if(l.id===T.id){if(l.status===c)return;F({taskId:l.id,fromStatus:l.status,status:c});return}F({taskId:l.id,fromStatus:l.status,status:c,afterIndex:T.sortIndex??void 0,targetTaskId:T.id,position:"after"});return}if(l.status===c)return;F({taskId:l.id,fromStatus:l.status,status:c})}};return o($n,{sensors:[_n.configure({activationConstraints:[new Dr.Distance({value:8})]}),Xo],onDragEnd:U,children:[t("div",{className:"flex-1 min-h-0 overflow-x-auto overflow-y-hidden p-4 bg-background/50",children:t("div",{className:"flex gap-4 h-full min-w-max pb-2",children:PA.map((d)=>t(Ee,{teamId:e,status:d,selectedGoalId:r,scope:x,currentUserId:p,currentUserRole:w,onTaskClick:v,onDeleteTask:(n)=>G(n),onCreateTaskInColumn:_},d))})}),P&&t(Je,{open:!!P,onOpenChange:(d)=>!d&&G(null),children:o(Xe,{children:[o(et,{children:[t(rt,{children:eb()}),t(nt,{children:tb({title:P.title})})]}),o(tt,{children:[t(st,{disabled:R,children:De()}),o(ot,{onClick:()=>z(P.id),disabled:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[R&&t(O,{className:"w-4 h-4 mr-1.5 animate-spin"}),at()]})]})]})})]})}S();function Ge({teamId:e,isOpen:r,onClose:x,initialGoalId:p}){let w=Q(),v=p===bi||!p?"none":p,[_,g]=u(""),[P,G]=u(""),[z,R]=u(!1),[F,U]=u(Ur.MEDIUM),[d,n]=u(v),[b,D]=u("none"),[l,i]=u("none"),[s,m]=u(void 0),[k,f]=u(void 0),[c,T]=u(null),[j,y]=u(null),[X,H]=u(null),[J,te]=u([]),[re,oe]=u([]),[be,ve]=u(!1),{data:ke}=Z({queryKey:["teams",e,"me"],queryFn:async()=>{let a=await A.api.teams[":teamId"].me.$get({param:{teamId:e}});if(!a.ok)return null;return await a.json()},enabled:!!e&&r});h(()=>{if(r)g(""),G(""),R(!1),U(Ur.MEDIUM),n(v),D("none"),i(ke?.id||"none"),m(void 0),f(void 0),T(null),y(null),H(null),te([]),oe([])},[r,v,ke?.id]);let{data:ye=[]}=Z({queryKey:["teams",e,"members","human"],queryFn:async()=>{let a=await A.api.teams[":teamId"].members.$get({param:{teamId:e},query:{includeAgents:"false"}});if(!a.ok)return[];let V=await a.json();return Array.isArray(V)?V:[]},enabled:!!e&&r}),{data:$e=[]}=Z({queryKey:["teams",e,"agents"],queryFn:async()=>{let a=await A.api.teams[":teamId"].agents.$get({param:{teamId:e}});if(!a.ok)return[];return await a.json()||[]},enabled:!!e&&r}),{data:He}=Z({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let a=await A.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!a.ok)return{data:[]};return await a.json()},enabled:!!e&&r}),Ve=He?.data||[],{mutate:We,isPending:se}=B({mutationFn:async()=>{let a=await A.api.teams[":teamId"].kanban.tasks.$post({param:{teamId:e},json:{title:_.trim(),description:P.trim()||void 0,isAgentTask:z,priority:F,goalId:d!=="none"?d:void 0,assigneeId:b!=="none"?b:void 0,reporterId:l!=="none"?l:void 0,startDate:s?s.toISOString():void 0,dueDate:k?k.toISOString():void 0,projectId:c||void 0,targetFolderId:j||void 0,parentIds:J.length>0?J:void 0,assetIds:re.length>0?re.map((V)=>V.id):void 0}});if(!a.ok){let V=await a.text().catch(()=>""),Y=Tn();if(V)try{let de=JSON.parse(V);if(de&&typeof de.message==="string")Y=de.message}catch{Y=V}throw Error(Y)}return await a.json()},onSuccess:()=>{w.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),w.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),M.success(AT()),x()},onError:(a)=>{M.error(a.message)}}),Ye=(a)=>{if(a.preventDefault(),!_.trim()||se)return;We()},ie=z;return t(ue,{open:r,onOpenChange:(a)=>!a&&x(),children:o(ae,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[o("form",{onSubmit:Ye,className:"space-y-4",children:[t(fe,{children:t(le,{children:Nf()})}),o("div",{className:"space-y-3.5 py-1",children:[o("div",{className:"space-y-1.5",children:[t(W,{htmlFor:"create-task-title",children:hA()}),t(q,{id:"create-task-title",value:_,onChange:(a)=>g(a.target.value),placeholder:gA(),required:!0,autoFocus:!0})]}),o("div",{className:"space-y-1.5",children:[t(W,{htmlFor:"create-task-desc",children:fA()}),t(wi,{id:"create-task-desc",value:P,onChange:(a)=>G(a.target.value),placeholder:pA(),rows:3})]}),o("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[o("div",{className:"sm:col-span-2 flex items-center justify-between space-x-2 rounded-lg border border-border/80 bg-muted/30 p-2.5 h-14",children:[o("div",{className:"space-y-0.5 min-w-0 pr-2",children:[o(W,{htmlFor:"create-is-agent-task",className:"text-xs font-medium cursor-pointer flex items-center gap-1.5",children:[t(Ct,{className:"w-3.5 h-3.5 text-orange-500"}),t("span",{children:zd()})]}),t("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:AA()})]}),t(Me,{id:"create-is-agent-task",checked:z,onCheckedChange:(a)=>{R(a),D("none")}})]}),o("div",{className:"space-y-1.5",children:[t(W,{className:"text-xs font-medium text-muted-foreground",children:mA()}),o(Le,{value:F,onValueChange:(a)=>U(a),children:[t(Be,{className:"w-full h-9 text-xs",children:t(Ze,{})}),t(Ue,{children:Object.values(Ur).map((a)=>t(ne,{value:a,children:t("span",{className:C("px-1.5 py-0.5 rounded text-[10px] uppercase font-medium",la(a)),children:aa(a)})},a))})]})]}),o("div",{className:"space-y-1.5",children:[t(W,{className:"text-xs font-medium text-muted-foreground",children:vd()}),o(Le,{value:d,onValueChange:n,children:[t(Be,{className:"w-full h-9 text-xs",children:t(Ze,{placeholder:"None"})}),o(Ue,{children:[t(ne,{value:"none",children:t("span",{className:"text-muted-foreground italic",children:"None"})}),Ve.filter((a)=>a.id!==bi).map((a)=>t(ne,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[t(wo,{className:"w-3.5 h-3.5 text-primary"}),t("span",{children:a.title})]})},a.id))]})]})]}),o("div",{className:"space-y-1.5",children:[t(W,{className:"text-xs font-medium text-muted-foreground",children:ie?Zd():eh()}),o(Le,{value:b,onValueChange:D,children:[t(Be,{className:"w-full h-9 text-xs",children:t(Ze,{placeholder:As()})}),o(Ue,{children:[t(ne,{value:"none",children:t("span",{className:"text-muted-foreground italic",children:As()})}),ie?$e.map((a)=>t(ne,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[t(Ct,{className:"w-3.5 h-3.5 text-purple-500"}),t("span",{children:a.name})]})},a.id)):ye.map((a)=>t(ne,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{size:"sm",className:"w-4 h-4",children:[t(Ie,{src:a.image}),t(Te,{className:"text-[8px]",children:a.name.slice(0,2).toUpperCase()})]}),t("span",{children:a.name})]})},a.id))]})]})]}),o("div",{className:"space-y-1.5",children:[t(W,{className:"text-xs font-medium text-muted-foreground",children:qg()}),o(Le,{value:l,onValueChange:i,children:[t(Be,{className:"w-full h-9 text-xs",children:t(Ze,{placeholder:As()})}),o(Ue,{children:[t(ne,{value:"none",children:t("span",{className:"text-muted-foreground italic",children:As()})}),ye.map((a)=>t(ne,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{size:"sm",className:"w-4 h-4",children:[t(Ie,{src:a.image}),t(Te,{className:"text-[8px]",children:a.name.slice(0,2).toUpperCase()})]}),t("span",{children:a.name})]})},a.id))]})]})]}),ie&&o("div",{className:"sm:col-span-2 space-y-1.5",children:[t(W,{className:"text-xs font-medium text-muted-foreground",children:Up()}),o(E,{type:"button",variant:"outline",size:"sm",onClick:()=>ve(!0),className:"w-full justify-start h-9 text-xs truncate font-normal",children:[t(rr,{className:"w-3.5 h-3.5 mr-2 text-primary shrink-0"}),t("span",{className:"truncate",children:X||Pp()})]})]}),o("div",{className:"space-y-1.5",children:[t(W,{className:"text-xs font-medium text-muted-foreground",children:Bd()}),t(xi,{value:s,onChange:m,placeholder:Bd(),className:"h-9 text-xs"})]}),o("div",{className:"space-y-1.5",children:[t(W,{className:"text-xs font-medium text-muted-foreground",children:hd()}),t(xi,{value:k,onChange:f,placeholder:hd(),className:"h-9 text-xs"})]}),o("div",{className:"sm:col-span-2 space-y-1.5",children:[t(W,{className:"text-xs font-medium text-muted-foreground",children:vg()}),t(Kd,{teamId:e,value:J,onChange:te})]}),t("div",{className:"sm:col-span-2 pt-1",children:t(Wd,{teamId:e,projectId:c,assets:re,onAddAssets:(a)=>oe((V)=>[...V,...a]),onRemoveAsset:(a)=>oe((V)=>V.filter((Y)=>Y.id!==a))})})]})]}),o(qe,{children:[t(E,{type:"button",variant:"outline",onClick:x,disabled:se,children:De()}),o(E,{type:"submit",disabled:!_.trim()||se,children:[se&&t(O,{className:"w-4 h-4 mr-1.5 animate-spin"}),Zc()]})]})]}),be&&t(Yd,{teamId:e,currentProjectId:c,currentTargetFolderId:j,isOpen:be,onClose:()=>ve(!1),onSelect:(a,V,Y)=>{T(a),y(V),H(Y||"Selected Folder")}})]})})}function je({teamId:e,initialTaskId:r}){let[x,p]=u("team"),[w,v]=u(null),[_,g]=u(r??null),[P,G]=u(!1);h(()=>{if(r)g(r)},[r]);let[z,R]=u(Qe.TODO),{data:F,isLoading:U}=Z({queryKey:["teams",e,"me"],queryFn:async()=>{let s=await A.api.teams[":teamId"].me.$get({param:{teamId:e}});if(!s.ok)throw Error("Failed to fetch me");return await s.json()},enabled:!!e}),{data:d}=Z({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let s=await A.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!s.ok)return{data:[]};return await s.json()},enabled:!!e}),n=d?.data||[],b=w?n.find((s)=>s.id===w)||null:null,D=F?.role?.toLowerCase()==="owner"||F?.role?.toLowerCase()==="editor",l=(s=Qe.TODO)=>{R(s),G(!0)},i=(s)=>{g(s.id)};if(U)return t("div",{className:"flex h-full items-center justify-center",children:t(O,{className:"w-8 h-8 animate-spin text-muted-foreground"})});return o("div",{className:"flex flex-row h-full bg-background overflow-hidden font-sans",children:[t(_e,{teamId:e,selectedGoalId:w,onSelectGoal:v,isOwnerOrEditor:D}),o("div",{className:"flex-1 flex flex-col min-w-0 h-full overflow-hidden",children:[t(Ke,{scope:x,onScopeChange:p,selectedGoal:b,onClearGoal:()=>v(null),onCreateTask:()=>l(Qe.TODO),canCreateTask:D}),t(Oe,{teamId:e,selectedGoalId:w,scope:x,currentUserId:F?.id,currentUserRole:F?.role,onTaskClick:i,onCreateTaskInColumn:(s)=>l(s)})]}),_&&t(Xd,{teamId:e,taskId:_,isOpen:!!_,onClose:()=>g(null),canEdit:D}),P&&t(Ge,{teamId:e,isOpen:P,initialStatus:z,initialGoalId:w,onClose:()=>G(!1)})]})}function lt(){let{teamId:e}=Re.useParams(),{taskId:r}=Re.useSearch();return t(je,{teamId:e,initialTaskId:r})}var Re=ze("/teams/$teamId/kanban")({component:lt});export{Re as Route};
|
package/bin/chunk-58hdvwj2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,S,t,Z,ze,A,lt,St,lm}from"./chunk-vsefjzzj.js";import"./chunk-62sj29j8.js";import"./chunk-6v6c2921.js";import"./chunk-c4wnhekn.js";import"./chunk-0e8xg41c.js";import{ja}from"./chunk-m2dtwvg0.js";import"./chunk-xyk7vk42.js";import"./chunk-z7p7s55t.js";import{nr}from"./chunk-g21k2awz.js";import"./chunk-rsdpycdr.js";import"./chunk-yd1k76na.js";import"./chunk-3584j9fc.js";import"./chunk-dvkzhpxx.js";S();function p(){let{projectId:e,folderId:d}=s.useParams(),{teamId:r,ensureTeamIdForProject:i}=lt();h(()=>{i(e)},[e,i]);let{data:a}=nr(lm(e)),o=a?.rootFolder,{data:l}=Z({queryKey:["folders",o],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:o}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!o});if(!r||!o||!l)return t(St,{});return t(ja,{teamId:r,projectId:e,projectName:a.name??"",assetId:d,rootFolderId:o,isRoot:!1})}var s=ze("/projects/$projectId/folders/$folderId_/agentsmd")({component:p});export{s as Route};
|
package/bin/chunk-5seey9ee.js
DELETED
package/bin/chunk-66hdwm6f.js
DELETED
package/bin/chunk-6devq6jh.js
DELETED
package/bin/chunk-756mr32b.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Nt}from"./chunk-f22nrm6r.js";import{Ge}from"./chunk-rn9rktp4.js";import{H}from"./chunk-kzsdp31a.js";var _=H(Nt()),N=H(Ge()),Cc="AWS_ACCESS_KEY_ID",Ic="AWS_SECRET_ACCESS_KEY",S="AWS_SESSION_TOKEN",C="AWS_CREDENTIAL_EXPIRATION",A="AWS_CREDENTIAL_SCOPE",p="AWS_ACCOUNT_ID",zu=(e)=>async()=>{e?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let o=process.env[Cc],E=process.env[Ic],r=process.env[S],n=process.env[C],s=process.env[A],t=process.env[p];if(o&&E){let c={accessKeyId:o,secretAccessKey:E,...r&&{sessionToken:r},...n&&{expiration:new Date(n)},...s&&{credentialScope:s},...t&&{accountId:t}};return _.setCredentialFeature(c,"CREDENTIALS_ENV_VARS","g"),c}throw new N.CredentialsProviderError("Unable to find environment variable credentials.",{logger:e?.logger})};export{Cc,Ic,zu};
|
package/bin/chunk-9k86d2a3.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Lr,ri,ff,e,m,d,x,U,i,r,T,_,l,s}from"./chunk-7vd5yajk.js";function c(t,n){let o={};if(!Object.keys(n).length)return o=t,o;for(let[u,a]of Object.entries(t)){let p=n[u];if(p===null)continue;o[p??u]=a}return o}function b(t){let n={};for(let[o,u]of Object.entries(t))if(typeof u<"u")n[o]=u;return n}class I extends Error{rawValue;rawMessage;static[Symbol.hasInstance](t){if(!(t instanceof Error))return!1;if(!("rawValue"in t))return!1;if(!("rawMessage"in t))return!1;if(!("pretty"in t))return!1;if(typeof t.pretty!=="function")return!1;return!0}constructor(t,n,o){super(`${t}: ${n}`);this.name="SDKValidationError",this.cause=n,this.rawValue=o,this.rawMessage=t}pretty(){if(this.cause instanceof ri)return`${this.rawMessage}
|
|
3
|
-
${of(this.cause)}`;else return this.toString()}}function of(t){return ff(t)}function _a(t){return{ok:!0,value:t}}function ns(t){return{ok:!1,error:t}}async function P(t){let n=await t;if(!n.ok)throw n.error;return n.value}function v(t,n,o){try{return _a(n(t))}catch(u){return ns(new I(o,u,t))}}var zo=r({prompt_tokens:m().default(0),completion_tokens:m().default(0),total_tokens:m().default(0),prompt_audio_seconds:s(m()).optional()}).catchall(x()).transform((t)=>c(t,{prompt_tokens:"promptTokens",completion_tokens:"completionTokens",total_tokens:"totalTokens",prompt_audio_seconds:"promptAudioSeconds"})),lc=r({promptTokens:m().default(0),completionTokens:m().default(0),totalTokens:m().default(0),promptAudioSeconds:s(m()).optional()}).catchall(x()).transform((t)=>({...c(t,{promptTokens:"prompt_tokens",completionTokens:"completion_tokens",totalTokens:"total_tokens",promptAudioSeconds:"prompt_audio_seconds"})}));function w(t){return O++,t}var O=0,A=0;function N(){A++;let t=O;return{end:(n)=>{let o=O-t;if(O=t+(n??o),--A===0)O=0;return o}}}function J(t){let n=Object.values(t);return T([...n.map((o)=>l(o)),e().transform((o)=>w(o))])}function Ka(t){let n=Object.values(t).filter((o)=>typeof o==="number");return T([...n.map((o)=>l(o)),m().transform((o)=>w(o))])}function dt(t){return e()}function um(t){return m()}var M=Symbol("UNKNOWN");function K(t){return typeof t==="object"&&t!==null&&M in t}function Ke(t,n,o={}){let{unknownValue:u="UNKNOWN",outputPropertyName:a}=o;return U().transform((p)=>{let h=Object.defineProperties({raw:p,[a??t]:u,isUnknown:!0},{[M]:{value:!0,enumerable:!1,configurable:!1}});if(!(typeof p==="object"&&p!==null))return h;let S=p[t];if(typeof S!=="string")return h;if(!(S in n))return h;let F=n[S];if(!F)return h;let g=N(),C=F.safeParse(p);if(!C.success)return g.end(0),h;if(g.end(),a)C.data[a]=S;return C.data})}var Y=/^\d{4}-\d{2}-\d{2}$/;class j{serialized;static today(){return new j(new Date)}constructor(t){if(typeof t==="string"&&!Y.test(t))throw RangeError("RFCDate: date strings must be in the format YYYY-MM-DD: "+t);let n=new Date(t);if(isNaN(+n))throw RangeError("RFCDate: invalid date provided: "+t);if(this.serialized=n.toISOString().slice(0,10),!Y.test(this.serialized))throw TypeError(`RFCDate: failed to build valid date with given value: ${t} serialized to ${this.serialized}`)}toJSON(){return this.toString()}toString(){return this.serialized}}function k(t){return U().transform((n,o)=>{let u=[],a=t.map(()=>[]),p=N();for(let[z,S]of t.entries()){let F=N(),g=S.safeParse(n),C=F.end(),ie=0;if(g.success){u.push({data:g.data,inexactCount:C,zeroDefaultCount:0,fieldCount:-1});continue}a[z].push(...g.error.issues)}if(u.length===0)return p.end(0),o.addIssue({input:n,code:"invalid_union",errors:a}),Lr;let h=u[0];for(let z of u){if(u.length>1)z.fieldCount=ne(z.data);h=te(z,h)}return p.end(h.inexactCount),h.data})}function te(t,n){let o=t.inexactCount===0,u=n.inexactCount===0;if(o!==u)return o?t:n;let a=t.fieldCount-t.zeroDefaultCount,p=n.fieldCount-n.zeroDefaultCount;if(a!==p)return a>p?t:n;return t.inexactCount<n.inexactCount?t:n}function ne(t){let n=0,o=[t],u=0;while(u<o.length){let a=o[u++];if(a===void 0||K(a))continue;let p=typeof a;if(a===null||p==="number"||p==="string"||p==="boolean"||p==="bigint"||a instanceof Date||a instanceof j){n++;continue}if(Array.isArray(a)){o.push(...a);continue}if(p==="object")o.push(...Object.values(a))}return n}var B=r({type:l("input_audio"),input_audio:e()}).transform((t)=>c(t,{input_audio:"inputAudio"})),V=r({type:l("input_audio"),inputAudio:e()}).transform((t)=>c(t,{inputAudio:"input_audio"}));var Fi=r({type:l("document_url").default("document_url"),document_url:e(),document_name:s(e()).optional()}).transform((t)=>c(t,{document_url:"documentUrl",document_name:"documentName"})),Ks=r({type:l("document_url").default("document_url"),documentUrl:e(),documentName:s(e()).optional()}).transform((t)=>c(t,{documentUrl:"document_url",documentName:"document_name"}));var W=r({type:l("file").default("file"),file_id:e()}).transform((t)=>c(t,{file_id:"fileId"})),ic=r({type:l("file").default("file"),fileId:e()}).transform((t)=>c(t,{fileId:"file_id"}));var Z={Low:"low",Auto:"auto",High:"high"},q=J(Z),G=dt(Z);var E=r({url:e(),detail:s(q).optional()}),L=r({url:e(),detail:s(G).optional()});var De=k([E,e()]),Ee=k([L,e()]);var Li=r({type:l("image_url").default("image_url"),image_url:k([E,e()])}).transform((t)=>c(t,{image_url:"imageUrl"})),Ws=r({type:l("image_url").default("image_url"),imageUrl:k([L,e()])}).transform((t)=>c(t,{imageUrl:"image_url"}));var Pe=k([m(),e()]),Me=k([m(),e()]);var y=r({type:l("reference").default("reference"),reference_ids:i(k([m(),e()]))}).transform((t)=>c(t,{reference_ids:"referenceIds"})),R=r({type:l("reference").default("reference"),referenceIds:i(k([m(),e()]))}).transform((t)=>c(t,{referenceIds:"reference_ids"}));var os=r({type:l("text").default("text"),text:e()}),ss=r({type:l("text").default("text"),text:e()});var H={WebSearch:"web_search",WebSearchPremium:"web_search_premium",CodeInterpreter:"code_interpreter",ImageGeneration:"image_generation",DocumentLibrary:"document_library"},fn=J(H),Ys=dt(H);var qe=k([fn,e()]),Ge=k([Ys,e()]);var ya=r({type:l("tool_reference").default("tool_reference"),tool:k([fn,e()]),title:e(),url:s(e()).optional(),favicon:s(e()).optional(),description:s(e()).optional()}),ac=r({type:l("tool_reference").default("tool_reference"),tool:k([Ys,e()]),title:e(),url:s(e()).optional(),favicon:s(e()).optional(),description:s(e()).optional()});var nt=k([ya,os,y]),ot=k([ac,ss,R]);var Zi=r({type:l("thinking").default("thinking"),thinking:i(k([ya,os,y])),signature:s(e()).optional(),closed:d().optional()}),Bi=r({type:l("thinking").default("thinking"),thinking:i(k([ac,ss,R])),signature:s(e()).optional(),closed:d().optional()});var Wa=Ke("type",{image_url:Li.and(r({type:l("image_url")})),document_url:Fi.and(r({type:l("document_url")})),text:os.and(r({type:l("text")})),reference:y.and(r({type:l("reference")})),file:W.and(r({type:l("file")})),thinking:Zi.and(r({type:l("thinking")})),input_audio:B}),Js=T([Ws.and(r({type:l("image_url")})),Ks.and(r({type:l("document_url")})),ss.and(r({type:l("text")})),R.and(r({type:l("reference")})),ic.and(r({type:l("file")})),Bi.and(r({type:l("thinking")})),V]);var zt=k([_(e(),x()),e()]),St=k([_(e(),x()),e()]);var Q=r({name:e(),arguments:k([_(e(),x()),e()])}),X=r({name:e(),arguments:k([_(e(),x()),e()])});var bu=r({id:e().default("null"),type:e().optional(),function:Q,index:m().default(0)}),dm=r({id:e().default("null"),type:e().optional(),function:X,index:m().default(0)});var Jt=k([e(),i(Wa)]);var vu=r({role:s(e()).optional(),content:s(k([e(),i(Wa)])).optional(),tool_calls:s(i(bu)).optional(),tool_call_id:s(e()).optional(),index:s(m()).optional(),metadata:s(_(e(),x())).optional()}).transform((t)=>c(t,{tool_calls:"toolCalls",tool_call_id:"toolCallId"}));var oe={Stop:"stop",Length:"length",Error:"error",ToolCalls:"tool_calls"},re=J(oe),ee=r({index:m(),delta:vu,finish_reason:s(re)}).transform((t)=>c(t,{finish_reason:"finishReason"}));var sf=r({id:e(),object:e().optional(),created:m().optional(),model:e(),usage:zo.optional(),choices:i(ee)});function fm(t){return v(t,(n)=>sf.parse(JSON.parse(n)),"Failed to parse 'CompletionChunk' from JSON")}
|
|
4
|
-
export{of,_a,ns,P,v,c,b,J,Ka,dt,um,Ke,k,Fi,Ks,ic,Li,Ws,os,ss,fn,Ys,ya,ac,Zi,Bi,Wa,Js,bu,dm,vu,zo,lc,sf,fm};
|
package/bin/chunk-a5fsqkt7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F,D,h,N,y,u,Yn,S,L,t,o,Q,qu,Hu,yr,Mc,Yi,bo,Ht,Ko,$u,Gu,Vu,Qu,kc,Ku,Z,B,pt,ze,A,I,xr,O,Ct,ve,er,Ut,Yo,Ne,C,mt,_e,Y,Rt,Er,Lt,se,ar,E,Ce,Ie,Te,BA,UA,z0,H0,$0,Tf,m_,rh,De,na,ah,wy,Bc,dh,Us,Jo,Ih,Th,Ev,Cv,qh,gw,Ax,_x,Yx,lp,cp,dS,xS,Ag,$c,AE,Lg,LE,BE,_p,zE,HE,Bg,GE,VE,Ug,QE,WE,Dd,Od,Fd,Tl,Sp,oC,sC,iC,aC,Ld,js,IC,jC,$C,iI,AI,yI,bI,vI,wI,aA,xI,jd,vT,ET,UT,bA,An,$p,u1,d1,Jc,Je,Xe,et,tt,rt,nt,ot,st,q,Pt,M,Dl,Mn,Yp,be,ht,gt,At,vr,rf,ut,Tt,Mt,Ot,xt}from"./chunk-vsefjzzj.js";import{Mo,_r}from"./chunk-3m6ch1x5.js";import{Gl}from"./chunk-vre5andt.js";import{Qs,Bo,Wl,Qa,Oi,Yl}from"./chunk-asgxtqf0.js";import{Rn,Pn,Nn,wr,Et,yt}from"./chunk-ar6kq7hh.js";import"./chunk-3584j9fc.js";import"./chunk-s9svhjv6.js";import{Vn,ao}from"./chunk-m5cpsm28.js";S();function te(a,e){let s=new Set(e);return a.filter((i)=>!s.has(i))}var ae=class extends bo{#r;#e;#o;#a;#t;#s;#i;#n;#l;#d=[];constructor(a,e,s){super();this.#r=a,this.#a=s,this.#o=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){if(this.listeners.size===1)this.#t.forEach((a)=>{a.subscribe((e)=>{this.#p(a,e)})})}onUnsubscribe(){if(!this.listeners.size)this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach((a)=>{a.destroy()})}setQueries(a,e){this.#o=a,this.#a=e,Ht.batch(()=>{let s=this.#t,i=this.#u(this.#o);i.forEach((c)=>c.observer.setOptions(c.defaultedQueryOptions));let m=i.map((c)=>c.observer),r=m.map((c)=>c.getCurrentResult()),p=s.length!==m.length,f=m.some((c,x)=>c!==s[x]),g=p||f,v=g?!0:r.some((c,x)=>{let w=this.#e[x];return!w||!Yi(c,w)});if(!g&&!v)return;if(g)this.#d=i,this.#t=m;if(this.#e=r,!this.hasListeners())return;if(g)te(s,m).forEach((c)=>{c.destroy()}),te(m,s).forEach((c)=>{c.subscribe((x)=>{this.#p(c,x)})});this.#f()})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map((a)=>a.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(a,e){let s=this.#u(a),i=s.map((r)=>r.observer.getOptimisticResult(r.defaultedQueryOptions)),m=s.map((r)=>r.defaultedQueryOptions.queryHash);return[i,(r)=>this.#c(r??i,e,m),()=>this.#m(i,s)]}#m(a,e){let s=new Set;return e.map((i,m)=>{let r=a[m];return!i.defaultedQueryOptions.notifyOnChangeProps?i.observer.trackResult(r,(p)=>{if(!s.has(p))s.add(p),e.forEach((f)=>{f.observer.trackProp(p)})}):r})}#c(a,e,s){if(e){let i=this.#l,m=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((r,p)=>r!==i[p]));if(this.#e!==this.#n||m||e!==this.#i){if(this.#i=e,this.#n=this.#e,s!==void 0)this.#l=s;this.#s=Mc(this.#s,e(a))}return this.#s}return a}#g(){return!this.#a?.combine||this.#t.some((a,e)=>a.options.suspense&&this.#e[e]?.data===void 0)}#u(a){let e=new Map;this.#t.forEach((i)=>{let m=i.options.queryHash;if(!m)return;let r=e.get(m);if(r)r.push(i);else e.set(m,[i])});let s=[];return a.forEach((i)=>{let m=this.#r.defaultQueryOptions(i),r=e.get(m.queryHash)?.shift()??new Ko(this.#r,m);s.push({defaultedQueryOptions:m,observer:r})}),s}#p(a,e){let s=this.#t.indexOf(a);if(s!==-1)this.#e=this.#e.slice(),this.#e[s]=e,this.#f()}#f(){if(this.hasListeners()){let a=this.#g(),e=this.#s,s=a?e:this.#c(this.#m(this.#e,this.#d),this.#a?.combine);if(a||e!==s)Ht.batch(()=>{this.listeners.forEach((i)=>{i(this.#e)})})}}};S();function re({queries:a,...e},s){let i=Q(s),m=qu(),r=Hu(),p=e.subscribed!==!1,f=N(()=>a.map((d)=>{let b=i.defaultQueryOptions(d);return b._optimisticResults=m?"isRestoring":p?"optimistic":void 0,b}),[a,i,m,p]);f.forEach((d)=>{Qu(d);let b=i.getQueryCache().get(d.queryHash);$u(d,r,b)}),Gu(r);let[g]=u(()=>new ae(i,f,e)),[v,c,x]=g.getOptimisticResult(f,e.combine),w=!m&&p;Yn(D((d)=>w?g.subscribe(Ht.batchCalls(d)):yr,[g,w]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),h(()=>{g.setQueries(f,e)},[f,e,g]);let n=v.some((d,b)=>kc(f[b],d))?v.flatMap((d,b)=>{let T=f[b];if(T&&kc(T,d)){let H=new Ko(i,T);return Ku(T,H,r)}return[]}):[];if(n.length>0)throw Promise.all(n);let _=v.find((d,b)=>{let T=f[b];return T&&Vu({result:d,errorResetBoundary:r,throwOnError:T.throwOnError,query:i.getQueryCache().get(T.queryHash),suspense:T.suspense})});if(_)throw _.error;return c(x())}S();S();var xe=Object.defineProperty,j=(a,e)=>xe(a,"name",{value:e,configurable:!0}),W="Collapsible",[ye,Bt]=mt(W),[we,X]=ye(W),Re=F(j(function(e,s){let{__scopeCollapsible:i,open:m,defaultOpen:r,disabled:p,onOpenChange:f,...g}=e,[v,c]=Lt({prop:m,defaultProp:r??!1,onChange:f,caller:W});return t(we,{scope:i,disabled:p,contentId:Er(),open:v,onOpenToggle:D(()=>c((x)=>!x),[c]),children:t(se.div,{"data-state":G(v),"data-disabled":p?"":void 0,...g,ref:s})})},"Collapsible")),ke="CollapsibleTrigger",Ae=F(j(function(e,s){let{__scopeCollapsible:i,...m}=e,r=X(ke,i);return t(se.button,{type:"button","aria-controls":r.open?r.contentId:void 0,"aria-expanded":r.open||!1,"data-state":G(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...m,ref:s,onClick:Y(e.onClick,r.onOpenToggle)})},"CollapsibleTrigger")),oe="CollapsibleContent",qe=F(j(function(e,s){let{forceMount:i,...m}=e,r=X(oe,e.__scopeCollapsible);return t(ar,{present:i||r.open,children:({present:p})=>t(Pe,{...m,ref:s,present:p})})},"CollapsibleContent")),Pe=F(j(function(e,s){let{__scopeCollapsible:i,present:m,children:r,...p}=e,f=X(oe,i),[g,v]=u(m),c=y(null),x=_e(s,c),w=y(0),n=w.current,_=y(0),d=_.current,b=f.open||g,T=y(b),H=y(void 0);return h(()=>{let k=requestAnimationFrame(()=>T.current=!1);return()=>cancelAnimationFrame(k)},[]),Rt(()=>{let k=c.current;if(k){H.current=H.current||{transitionDuration:k.style.transitionDuration,animationName:k.style.animationName},k.style.transitionDuration="0s",k.style.animationName="none";let z=k.getBoundingClientRect();if(w.current=z.height,_.current=z.width,!T.current)k.style.transitionDuration=H.current.transitionDuration,k.style.animationName=H.current.animationName;v(m)}},[f.open,m]),t(se.div,{"data-state":G(f.open),"data-disabled":f.disabled?"":void 0,id:f.contentId,hidden:!b,...p,ref:x,style:{["--radix-collapsible-content-height"]:n?`${n}px`:void 0,["--radix-collapsible-content-width"]:d?`${d}px`:void 0,...e.style},children:b&&r})},"CollapsibleContentImpl"));function G(a){return a?"open":"closed"}j(G,"getState");var Se=Re;var He=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],ie=I("chart-no-axes-column",He);var Oe=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],J=I("funnel",Oe);var Qe=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],U=I("messages-square",Qe);function ne({teamId:a}){let[e,s]=u("team"),[i,m]=u("1h"),{data:r,isLoading:p}=Z({queryKey:["teams",a,"ai-usage",i,"team"],queryFn:async()=>{let d=await A.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:a},query:{timeframe:i}});if(!d.ok)throw Error("Failed to fetch team AI usage");return await d.json()},enabled:!!a&&e==="team"}),{data:f,isLoading:g}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let d=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!d.ok)throw Error("Failed to fetch team members");return await d.json()},enabled:!!a&&e==="members"}),v=re({queries:(f||[]).map((d)=>({queryKey:["teams",a,"ai-usage",i,d.id],queryFn:async()=>{let b=await A.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:a},query:{timeframe:i,userId:d.id}});if(!b.ok)throw Error(`Failed to fetch AI usage for member ${d.id}`);return await b.json()},enabled:!!a&&e==="members"}))}),c=g||v.some((d)=>d.isLoading),x=(d)=>{if(!d)return"U";let b=d.split(" ");if(b.length>1)return`${b[0][0]}${b[b.length-1][0]}`.toUpperCase();return d.substring(0,2).toUpperCase()},w=(d)=>{if(!d)return"";switch(d.toLowerCase()){case"owner":return $c();case"editor":return Us();case"reviewer":return js();default:return d}},n=(d)=>(d??0).toLocaleString(),_=(d)=>`$${(d??0).toFixed(6)}`;return o(ut,{className:"border-border/60 shadow-sm",children:[o(Tt,{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between pb-6",children:[o("div",{children:[t(Mt,{className:"text-xl font-semibold tracking-tight",children:H0()}),t(Ot,{className:"text-sm text-muted-foreground mt-1",children:$0()})]}),o("div",{className:"flex flex-wrap items-center gap-3",children:[o(Mo,{type:"single",value:e,onValueChange:(d)=>{if(d)s(d)},className:"border rounded-lg p-1 bg-muted/30",children:[t(_r,{value:"team",className:"px-3 py-1.5 text-xs font-medium",children:ET()}),t(_r,{value:"members",className:"px-3 py-1.5 text-xs font-medium",children:_x()})]}),o(Mo,{type:"single",value:i,onValueChange:(d)=>{if(d)m(d)},className:"border rounded-lg p-1 bg-muted/30",children:[t(_r,{value:"1h",className:"px-2.5 py-1.5 text-xs font-medium",children:"1h"}),t(_r,{value:"24h",className:"px-2.5 py-1.5 text-xs font-medium",children:"24h"}),t(_r,{value:"7d",className:"px-2.5 py-1.5 text-xs font-medium",children:"7d"}),t(_r,{value:"30d",className:"px-2.5 py-1.5 text-xs font-medium",children:"30d"})]})]})]}),t(xt,{children:e==="team"?p?t("div",{className:"flex h-48 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t("div",{className:"rounded-md border",children:o(Rn,{children:[t(Pn,{children:o(wr,{children:[t(Et,{children:jd()}),t(Et,{className:"text-right",children:qh()}),t(Et,{className:"text-right",children:Ag()}),t(Et,{className:"text-right",children:rh()}),t(Et,{className:"text-right",children:bA()}),t(Et,{className:"text-right",children:ah()})]})}),t(Nn,{children:o(wr,{children:[t(yt,{className:"font-medium",children:jd()}),t(yt,{className:"text-right",children:n(r?.team?.inputTokens)}),t(yt,{className:"text-right",children:n(r?.team?.outputTokens)}),t(yt,{className:"text-right",children:n(r?.team?.cacheReadTokens)}),t(yt,{className:"text-right font-medium",children:n(r?.team?.totalTokens)}),t(yt,{className:"text-right font-medium",children:_(r?.team?.cost)})]})})]})}):c?t("div",{className:"flex h-48 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t("div",{className:"rounded-md border",children:o(Rn,{children:[t(Pn,{children:o(wr,{children:[t(Et,{children:Ax()}),t(Et,{children:IC()}),t(Et,{className:"text-right",children:qh()}),t(Et,{className:"text-right",children:Ag()}),t(Et,{className:"text-right",children:rh()}),t(Et,{className:"text-right",children:bA()}),t(Et,{className:"text-right",children:ah()})]})}),t(Nn,{children:(f||[]).map((d,b)=>{let T=v[b]?.data?.member;return o(wr,{children:[t(yt,{children:o("div",{className:"flex items-center gap-3",children:[o(Ce,{className:"h-8 w-8 rounded-full",children:[d.image&&t(Ie,{src:d.image,alt:d.name,className:"object-cover"}),t(Te,{className:"bg-primary/20 text-xs",children:x(d.name)})]}),o("div",{className:"flex flex-col",children:[t("span",{className:"text-sm font-medium leading-none",children:d.name}),t("span",{className:"text-xs text-muted-foreground mt-0.5",children:d.email})]})]})}),t(yt,{className:"text-xs text-muted-foreground",children:w(d.role)}),t(yt,{className:"text-right",children:n(T?.inputTokens)}),t(yt,{className:"text-right",children:n(T?.outputTokens)}),t(yt,{className:"text-right",children:n(T?.cacheReadTokens)}),t(yt,{className:"text-right font-medium",children:n(T?.totalTokens)}),t(yt,{className:"text-right font-medium",children:_(T?.cost)})]},d.id)})})]})})})]})}S();function le({teamId:a}){let[e,s]=u(null),{ref:i,inView:m}=Pt(),{data:r,isLoading:p,isError:f,fetchNextPage:g,hasNextPage:v,isFetchingNextPage:c}=pt({queryKey:["teams",a,"agent-sessions"],queryFn:async({pageParam:n})=>{let _=await A.api.teams[":teamId"]["agent-sessions"].$get({param:{teamId:a},query:{first:"20",after:n?String(n):void 0}});if(!_.ok)throw Error("Failed to fetch agent sessions");return await _.json()},initialPageParam:"",getNextPageParam:(n)=>n.pageInfo.cursor||void 0,enabled:!!a});h(()=>{if(m&&v&&!c)g()},[m,v,c,g]);let x=r?.pages.flatMap((n)=>n.data).filter((n)=>n.id!=="pending")||[],w=(n)=>{switch(n){case"comment":return t(be,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",children:vI()});case"chat":return t(be,{variant:"outline",className:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20",children:bI()});case"naming":return t(be,{variant:"outline",className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",children:wI()});default:return t(be,{variant:"outline",className:"bg-muted text-muted-foreground border-border",children:n})}};return o("div",{className:"space-y-6",children:[o(ut,{className:"border border-border/50 shadow-xs",children:[t(Tt,{className:"pb-4",children:t("div",{className:"flex items-center justify-between",children:o("div",{children:[o(Mt,{className:"text-xl font-bold flex items-center gap-2",children:[t(U,{className:"w-5 h-5 text-violet-500"}),aA()]}),t(Ot,{className:"mt-1 text-sm text-muted-foreground",children:xI()})]})})}),t(xt,{children:p?t("div",{className:"flex h-64 items-center justify-center",children:t(O,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):f?t("div",{className:"flex h-64 items-center justify-center text-destructive",children:"Failed to load agent sessions."}):x.length===0?o("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[t(U,{className:"w-10 h-10 text-muted-foreground/40 mb-3"}),t("p",{className:"text-base font-medium",children:dS()})]}):o("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[o(Rn,{children:[t(Pn,{className:"bg-muted/40",children:o(wr,{children:[t(Et,{children:AI()}),t(Et,{children:Bc()}),t(Et,{children:yI()}),t(Et,{className:"text-right",children:wy()})]})}),t(Nn,{children:x.map((n)=>o(wr,{onClick:()=>s(n.id),className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[t(yt,{className:"font-medium",children:o("div",{className:"flex flex-col",children:[t("span",{className:"text-sm font-semibold text-foreground",children:n.name||$p()}),t("span",{className:"text-xs font-mono text-muted-foreground/70",children:n.id})]})}),t(yt,{children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[t(Ie,{src:n.creator?.image||void 0}),t(Te,{className:"text-[10px]",children:n.creator?.name?.[0]?.toUpperCase()||"?"})]}),t("span",{className:"text-sm text-foreground/90",children:n.creator?.name||"System / Agent"})]})}),t(yt,{children:w(n.type)}),t(yt,{className:"text-right text-xs text-muted-foreground",children:Mn(n.createdAt)})]},n.id))})]}),t("div",{ref:i,className:"py-4 flex justify-center",children:c&&t(O,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})})]}),t(Gl,{sessionId:e,open:!!e,onOpenChange:(n)=>{if(!n)s(null)}})]})}S();function de({...a}){return t(Se,{"data-slot":"collapsible",...a})}function me({...a}){return t(Ae,{"data-slot":"collapsible-trigger",...a})}function ce({...a}){return t(qe,{"data-slot":"collapsible-content",...a})}function ee(a){switch(a.toLowerCase()){case"owner":return $c();case"editor":return Us();case"reviewer":return js();default:return a}}function Le(a,e){if(typeof a==="object"&&a!==null&&"message"in a){let s=a.message;if(typeof s==="string")return s}return e}function Be({rule:a}){let e=a.resourceData??{};if(a.resource==="agent_mcp_call_count")return t("span",{children:sC({value:String(e.id??"")})});if(a.resource==="agent_bash_call_count")return t("span",{children:oC({value:String(e.match??"*")})});if(a.resource==="agent_tool_call_count")return t("span",{children:iC({value:String(e.name??e.toolName??"*")})});return null}function Me({rule:a}){if(a.scopeMode==="all_members")return o(be,{variant:"secondary",className:"gap-1 text-xs",children:[t(ao,{className:"h-3 w-3"}),o("span",{children:[Dd(),a.role?` (${ee(a.role)})`:` (${Tl()})`]})]});if(a.scopeMode==="each_member")return o(be,{variant:"secondary",className:"gap-1 text-xs",children:[t(Vn,{className:"h-3 w-3"}),o("span",{children:[Od(),a.role?` (${ee(a.role)})`:` (${Tl()})`]})]});return o(be,{variant:"secondary",className:"gap-1 text-xs",children:[t(Yo,{className:"h-3 w-3"}),o("span",{children:[Fd()," (",a.userIds?.length||0,")"]})]})}function Fe({teamId:a,rule:e,record:s}){let i=Q(),[m,r]=u(!1),[p,f]=u(()=>new Date),g=Qa[e.resource],v=e.scopeMode==="all_members",c=s.percent>=100,x=v?e.role?`${WE()}: ${ee(e.role)}`:aC():s.user?.name||s.userId||An();h(()=>{if(!s.isWindowActive||!s.periodEnd)return;let n=window.setInterval(()=>f(new Date),60000);return()=>window.clearInterval(n)},[s.isWindowActive,s.periodEnd]);let w=B({mutationFn:async()=>{let n=await A.api.teams[":teamId"].quotas[":id"].records.reset.$post({param:{teamId:a,id:e.id},json:{userId:s.userId??null}});if(!n.ok){let _=await n.json().catch(()=>null);throw Error(Le(_,Th()))}return await n.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["teams",a,"quotas",e.id,"records"]}),i.invalidateQueries({queryKey:["teams",a,"quotas"]}),r(!1),M.success(VE())},onError:(n)=>{let _=n instanceof Error?n.message:Th();r(!1),M.error(_)}});return o(L,{children:[o("div",{className:"space-y-3 rounded-xl border border-border/70 bg-card p-4 text-card-foreground shadow-2xs",children:[o("div",{className:"flex items-center justify-between gap-3",children:[o("div",{className:"flex min-w-0 items-center gap-3",children:[v?t("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t(ao,{className:"h-5 w-5"})}):o(Ce,{className:"h-9 w-9 shrink-0 border border-border/50",children:[t(Ie,{src:s.user?.image||void 0}),t(Te,{className:"text-xs font-semibold",children:s.user?.name?.[0]?.toUpperCase()||"U"})]}),o("div",{className:"min-w-0",children:[t("div",{className:"truncate text-sm font-semibold text-foreground",children:x}),!v&&s.user?.email&&t("div",{className:"truncate text-xs text-muted-foreground",children:s.user.email})]})]}),o("div",{className:"flex shrink-0 items-center gap-2",children:[s.isWindowActive&&s.periodEnd?o(be,{variant:"outline",className:"hidden gap-1 border-primary/30 bg-primary/5 text-xs text-primary sm:flex",children:[t(er,{className:"h-3 w-3"}),t("span",{children:Bg({time:Yp(s.periodEnd,p)})})]}):o(be,{variant:"secondary",className:"hidden gap-1 text-xs text-muted-foreground sm:flex",children:[t(xr,{className:"h-3 w-3 text-primary"}),t("span",{children:Lg()})]}),o(E,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>r(!0),disabled:w.isPending,children:[w.isPending?t(O,{className:"h-3.5 w-3.5 animate-spin"}):t(Qs,{className:"h-3.5 w-3.5"}),Ug()]})]})]}),o("div",{className:"space-y-1.5 pt-1",children:[t(rf,{value:Math.min(100,Math.max(0,s.percent)),className:"h-2"}),o("div",{className:"flex items-center justify-between gap-2 text-xs font-medium",children:[o("span",{className:c?"font-bold text-destructive":"text-foreground",children:[Oi(e.resource,s.consumed)," /"," ",Oi(e.resource,e.limit)," ",g?.unit]}),o("span",{className:c?"font-bold text-destructive":"text-muted-foreground",children:[s.percent,"%"]})]})]}),o("div",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground sm:hidden",children:[s.isWindowActive&&s.periodEnd?o("span",{className:"flex items-center gap-1 text-primary",children:[t(er,{className:"h-3 w-3"}),Bg({time:Yp(s.periodEnd,p)})]}):o("span",{className:"flex items-center gap-1",children:[t(xr,{className:"h-3 w-3 text-primary"}),Lg()]}),o("span",{children:[GE(),": ",Oi(e.resource,s.remaining)," ",g?.unit]})]})]}),t(Je,{open:m,onOpenChange:r,children:o(Xe,{children:[o(et,{children:[t(rt,{children:Ug()}),t(nt,{children:QE({target:x})})]}),o(tt,{children:[t(st,{disabled:w.isPending,children:De()}),o(ot,{onClick:(n)=>{n.preventDefault(),w.mutate()},disabled:w.isPending,children:[w.isPending&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),na()]})]})]})})]})}function je({teamId:a,rule:e}){let[s,i]=u(!1),[m,r]=u(""),p=Qa[e.resource],f=p?.icon||Bo,{data:g,isLoading:v,isError:c}=Z({queryKey:["teams",a,"quotas",e.id,"records"],queryFn:async()=>{let n=await A.api.teams[":teamId"].quotas[":id"].records.$get({param:{teamId:a,id:e.id}});if(!n.ok)throw Error(Ih());return await n.json()},enabled:s,refetchInterval:s?1e4:!1}),x=g?.records??[],w=x.filter((n)=>{if(!m.trim())return!0;let _=m.toLowerCase();return n.user?.name.toLowerCase().includes(_)||n.user?.email.toLowerCase().includes(_)});return o(de,{open:s,onOpenChange:i,className:"rounded-xl border border-border/70",children:[t(me,{asChild:!0,children:o("button",{type:"button","aria-label":s?LE():zE(),className:"flex w-full items-center justify-between gap-4 p-4 text-left transition-colors hover:bg-muted/40",children:[o("div",{className:"flex min-w-0 items-start gap-3",children:[t("div",{className:"mt-0.5 rounded-lg bg-primary/10 p-2 text-primary",children:t(f,{className:"h-5 w-5"})}),o("div",{className:"min-w-0",children:[o("div",{className:"flex flex-wrap items-center gap-2",children:[t("span",{className:"font-semibold text-foreground",children:p?.label()||e.resource}),!e.enabled&&t(be,{variant:"secondary",children:_p()})]}),o("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",children:[t(Me,{rule:e}),o(be,{variant:"outline",className:"gap-1 text-xs",children:[t(er,{className:"h-3 w-3"}),Oi(e.resource,e.limit)," ",p?.unit," /"," ",Yl(e.period)]}),t(Be,{rule:e})]})]})]}),t(ve,{className:`h-5 w-5 shrink-0 text-muted-foreground transition-transform ${s?"rotate-180":""}`})]})}),t(ce,{children:o("div",{className:"space-y-3 border-t border-border/60 bg-muted/10 p-4",children:[e.scopeMode!=="all_members"&&x.length>3&&o("div",{className:"relative",children:[t(Ut,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),t(q,{value:m,onChange:(n)=>r(n.target.value),placeholder:Sp(),className:"h-9 pl-9 text-sm"})]}),v?t("div",{className:"flex justify-center py-10",children:t(O,{className:"h-7 w-7 animate-spin text-primary"})}):c?t("div",{className:"py-8 text-center text-sm text-destructive",children:Ih()}):w.length===0?t("div",{className:"py-8 text-center text-sm text-muted-foreground",children:HE()}):w.map((n,_)=>t(Fe,{teamId:a,rule:e,record:n},n.id||n.userId||`record-${_}`))]})})]})}function ue({teamId:a}){let{data:e,isLoading:s,isError:i}=Z({queryKey:["teams",a,"quotas"],queryFn:async()=>{let r=await A.api.teams[":teamId"].quotas.$get({param:{teamId:a}});if(!r.ok)throw Error(Jo());return await r.json()},enabled:!!a}),m=e?.rules??[];return o(ut,{className:"border-border/60 shadow-sm",children:[o(Tt,{children:[o(Mt,{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[t(Bo,{className:"h-5 w-5 text-primary"}),Ld()]}),t(Ot,{children:BE()})]}),t(xt,{children:s?t("div",{className:"flex h-48 items-center justify-center",children:t(O,{className:"h-7 w-7 animate-spin text-muted-foreground"})}):i?t("div",{className:"py-10 text-center text-sm text-destructive",children:Jo()}):m.length===0?o("div",{className:"flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-border py-12 text-center",children:[t(Bo,{className:"mb-3 h-10 w-10 text-muted-foreground/50"}),t("p",{className:"text-base font-medium text-foreground",children:cp()}),t("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:lp()})]}):t("div",{className:"space-y-3",children:m.map((r)=>t(je,{teamId:a,rule:r},r.id))})})]})}S();var Ue=Object.values(Dl);function pe({teamId:a}){let[e,s]=u([]),[i,m]=u([]),[r,p]=u(""),{ref:f,inView:g}=Pt(),{data:v}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let l=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!l.ok)return[];return await l.json()},enabled:!!a}),c=v||[],{data:x,isLoading:w,isError:n,fetchNextPage:_,hasNextPage:d,isFetchingNextPage:b}=pt({queryKey:["teams",a,"audit-logs",e,i,r],queryFn:async({pageParam:l})=>{let R=await A.api.teams[":teamId"]["audit-logs"].$get({param:{teamId:a},query:{first:"20",after:l?String(l):void 0,actions:e.length>0?e:void 0,userIds:i.length>0?i:void 0,itemId:r.trim()||void 0}});if(!R.ok)throw Error("Failed to fetch audit logs");return await R.json()},initialPageParam:"",getNextPageParam:(l)=>l.pageInfo.endCursor||void 0,enabled:!!a});h(()=>{if(g&&d&&!b)_()},[g,d,b,_]);let T=x?.pages.flatMap((l)=>l.nodes)||[],H=x?.pages[0]?.total??0,k=(l)=>{s((R)=>R.includes(l)?R.filter((P)=>P!==l):[...R,l])},z=(l)=>{m((R)=>R.includes(l)?R.filter((P)=>P!==l):[...R,l])},fe=(l)=>{if(l.includes("delete")||l.includes("remove")||l.includes("revoke"))return t(be,{variant:"outline",className:"bg-destructive/10 text-destructive border-destructive/20 font-mono text-xs",children:l});if(l.includes("create")||l.includes("add"))return t(be,{variant:"outline",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20 font-mono text-xs",children:l});if(l.includes("update")||l.includes("reparent")||l.includes("copy"))return t(be,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20 font-mono text-xs",children:l});return t(be,{variant:"outline",className:"bg-muted text-muted-foreground border-border font-mono text-xs",children:l})},ge=new Map(c.map((l)=>[l.userId||l.id,l]));return t("div",{className:"space-y-6",children:o(ut,{className:"border border-border/50 shadow-xs",children:[o(Tt,{className:"pb-4",children:[o("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[o("div",{children:[o(Mt,{className:"text-xl font-bold flex items-center gap-2",children:[t(Qs,{className:"h-5 w-5 text-primary"}),Tf()]}),t(Ot,{className:"mt-1",children:m_()})]}),H>0&&o(be,{variant:"secondary",className:"w-fit text-xs font-normal",children:[H," ",Tf()]})]}),o("div",{className:"mt-4 flex flex-wrap items-center gap-3 pt-4 border-t border-border/40",children:[o(ht,{children:[t(gt,{asChild:!0,children:o(E,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[t(J,{className:"h-3.5 w-3.5"}),Ev(),e.length>0&&t(be,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:e.length})]})}),o(At,{className:"w-64 p-2",align:"start",children:[t("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:$C()}),t("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:Ue.map((l)=>o("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[t(vr,{checked:e.includes(l),onCheckedChange:()=>k(l)}),t("span",{className:"font-mono",children:l})]},l))}),e.length>0&&t(E,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>s([]),children:"Clear Actions"})]})]}),o(ht,{children:[t(gt,{asChild:!0,children:o(E,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[t(J,{className:"h-3.5 w-3.5"}),Cv(),i.length>0&&t(be,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:i.length})]})}),o(At,{className:"w-64 p-2",align:"start",children:[t("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:iI()}),t("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:c.map((l)=>{let R=l.userId||l.user?.id||l.id,P=l.user?.name||l.name||R,K=l.user?.image||l.image;return o("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[t(vr,{checked:i.includes(R),onCheckedChange:()=>z(R)}),o(Ce,{className:"h-5 w-5",children:[t(Ie,{src:K||void 0}),t(Te,{className:"text-[10px]",children:P.slice(0,2).toUpperCase()})]}),t("span",{className:"truncate",children:P})]},R)})}),i.length>0&&t(E,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>m([]),children:"Clear Users"})]})]}),o("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[t(Ut,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t(q,{type:"text",placeholder:jC(),value:r,onChange:(l)=>p(l.target.value),className:"pl-8 pr-8 h-9 text-xs"}),r&&t("button",{onClick:()=>p(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground",children:t(Ne,{className:"h-4 w-4"})})]}),(e.length>0||i.length>0||r)&&t(E,{variant:"ghost",size:"sm",className:"h-9 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{s([]),m([]),p("")},children:"Clear all"})]})]}),o(xt,{className:"p-0",children:[w?t("div",{className:"flex h-64 items-center justify-center",children:t(O,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):n?t("div",{className:"p-8 text-center text-sm text-destructive",children:"Failed to load audit logs."}):T.length===0?t("div",{className:"p-12 text-center text-sm text-muted-foreground",children:Yx()}):o(Rn,{children:[t(Pn,{children:o(wr,{className:"hover:bg-transparent border-b border-border/50",children:[t(Et,{className:"w-[180px] text-xs font-semibold",children:UA()}),t(Et,{className:"w-[200px] text-xs font-semibold",children:d1()}),t(Et,{className:"text-xs font-semibold",children:gw()}),t(Et,{className:"text-xs font-semibold",children:AE()}),t(Et,{className:"w-[160px] text-right text-xs font-semibold",children:UT()})]})}),t(Nn,{children:T.map((l)=>{let R=l.userId?ge.get(l.userId):null,P=R?.user?.name||R?.name||l.userId||"System",K=R?.user?.image||R?.image;return o(wr,{className:"hover:bg-muted/40 transition-colors",children:[t(yt,{className:"py-3 font-medium",children:fe(l.action)}),t(yt,{className:"py-3",children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[t(Ie,{src:K||void 0}),t(Te,{className:"text-[10px]",children:P.slice(0,2).toUpperCase()})]}),t("span",{className:"text-xs font-medium text-foreground truncate max-w-[160px]",children:l.agent?Jc({user:P,agent:l.agent.name}):P}),l.agent&&t(Ct,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"})]})}),t(yt,{className:"py-3 text-xs font-mono text-muted-foreground",children:l.itemId||"-"}),t(yt,{className:"py-3 text-xs font-mono text-muted-foreground",children:l.projectId||"-"}),t(yt,{className:"py-3 text-right text-xs text-muted-foreground",children:Mn(l.createdAt)})]},l.id)})})]}),t("div",{ref:f,className:"py-4 flex justify-center",children:b&&t(O,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})]})})}function $e(){let{teamId:a}=Ge.useParams(),[e,s]=u("audit-logs"),{data:i,isLoading:m}=Z({queryKey:["teams",a,"me"],queryFn:async()=>{let r=await A.api.teams[":teamId"].me.$get({param:{teamId:a}});if(!r.ok)throw Error("Failed to fetch me");return await r.json()},enabled:!!a});if(m)return t("div",{className:"flex h-screen items-center justify-center",children:t(O,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(i?.role?.toLowerCase()!=="owner")return o("div",{className:"flex h-full flex-col items-center justify-center p-8 text-center",children:[t(Wl,{className:"h-12 w-12 text-destructive mb-4"}),t("h2",{className:"text-xl font-bold tracking-tight mb-2",children:BA()}),t("p",{className:"text-sm text-muted-foreground max-w-md",children:xS()})]});return t("div",{className:"h-full bg-background font-sans selection:bg-primary/20 transition-colors duration-300",children:o("div",{className:"flex flex-col md:flex-row h-full",children:[t("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:o("nav",{className:"p-4 space-y-1 mt-4",children:[t("div",{className:"mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider",children:dh()}),t("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:vT()}),o("button",{onClick:()=>s("audit-logs"),className:C("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="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:[t(Qs,{className:"w-5 h-5"}),Tf(),e==="audit-logs"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),o("button",{onClick:()=>s("quotas"),className:C("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="quotas"?"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:[t(Bo,{className:"w-5 h-5"}),Ld(),e==="quotas"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),t("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:z0()}),o("button",{onClick:()=>s("ai-usage"),className:C("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="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:[t(ie,{className:"w-5 h-5"}),u1(),e==="ai-usage"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),o("button",{onClick:()=>s("ai-sessions"),className:C("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="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:[t(U,{className:"w-5 h-5"}),aA(),e==="ai-sessions"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]})]})}),t("div",{className:"flex-1 overflow-y-auto p-4 md:p-8",children:o("div",{className:"max-w-6xl mx-auto space-y-8",children:[e==="audit-logs"&&t(pe,{teamId:a}),e==="ai-usage"&&t(ne,{teamId:a}),e==="ai-sessions"&&t(le,{teamId:a}),e==="quotas"&&t(ue,{teamId:a})]})})]})})}var Ge=ze("/teams/$teamId/dashboard")({component:$e});export{Ge as Route};
|
package/bin/chunk-ar6kq7hh.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t,C}from"./chunk-vsefjzzj.js";function Rn({className:e,...a}){return t("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t("table",{"data-slot":"table",className:C("w-full caption-bottom text-sm",e),...a})})}function Pn({className:e,...a}){return t("thead",{"data-slot":"table-header",className:C("[&_tr]:border-b",e),...a})}function Nn({className:e,...a}){return t("tbody",{"data-slot":"table-body",className:C("[&_tr:last-child]:border-0",e),...a})}function wr({className:e,...a}){return t("tr",{"data-slot":"table-row",className:C("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...a})}function Et({className:e,...a}){return t("th",{"data-slot":"table-head",className:C("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a})}function yt({className:e,...a}){return t("td",{"data-slot":"table-cell",className:C("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a})}
|
|
2
|
-
export{Rn,Pn,Nn,wr,Et,yt};
|
package/bin/chunk-axfwh5et.js
DELETED
package/bin/chunk-c0vbj8za.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,N,u,S,L,t,o,pt,Re,ze,A,O,ta,jn,to,Ce,Ie,Te,G0,q_,Df,Bc,Xx,An,lt,Pt,br,$t,St,om}from"./chunk-vsefjzzj.js";import{Ir}from"./chunk-0e8xg41c.js";import{nr}from"./chunk-g21k2awz.js";import{Rn,Pn,Nn,wr,Et,yt}from"./chunk-ar6kq7hh.js";S();var T=(a)=>{if(!a)return"??";return a.split(" ").map((r)=>r[0]).slice(0,2).join("").toUpperCase()};function j(){let{projectId:a}=C.useParams(),{teamId:r,ensureTeamIdForProject:n}=lt(),g=Re();h(()=>{n(a)},[a,n]);let{data:i}=nr(om(a)),d=i?.rootFolder,[v,y]=u(240),{fileListLeftSidebarCollapsed:m,setFileListLeftSidebarCollapsed:w}=$t(),{data:c,isLoading:I,fetchNextPage:f,hasNextPage:p,isFetchingNextPage:l}=pt({queryKey:["collections",a],queryFn:async({pageParam:e})=>{let s=await A.api.projects[":projectId"].collections.$get({param:{projectId:a},query:{first:"20",after:e}});if(!s.ok)throw Error("Failed to fetch collections");return await s.json()},initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0,enabled:!!a}),{ref:k,inView:b}=Pt();h(()=>{if(b&&p&&!l)f()},[b,p,l,f]);let x=N(()=>c?.pages.flatMap((e)=>e.data)||[],[c]);if(!r||!d||!i)return t(St,{});return t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{className:"flex flex-1 overflow-hidden relative",children:[!m&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>w(!0)}),!m&&o(L,{children:[t("div",{className:"bg-background",style:{width:v},children:t(br,{teamId:r,projectId:a,projectName:i.name??"",rootFolderId:d})}),t(Ir,{onResize:(e)=>{y((s)=>Math.max(180,Math.min(400,s+e)))},className:"hidden md:block"})]}),o("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[t("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:o("div",{className:"flex items-center gap-2",children:[t(ta,{className:"h-5 w-5 text-primary"}),t("h1",{className:"font-bold text-lg text-foreground",children:G0()})]})}),t("div",{className:"flex-1 overflow-y-auto p-6",children:I?t("div",{className:"flex justify-center items-center h-64",children:t("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):x.length===0?o("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[t(to,{className:"h-10 w-10 text-muted-foreground/50"}),t("p",{children:Xx()})]}):o("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[o(Rn,{children:[t(Pn,{children:o(wr,{className:"hover:bg-transparent bg-muted/20",children:[t(Et,{className:"font-semibold px-4 py-3",children:q_()}),t(Et,{className:"font-semibold px-4 py-3",children:Bc()}),t(Et,{className:"font-semibold px-4 py-3 w-[200px]",children:Df()})]})}),t(Nn,{children:x.map((e)=>o(wr,{className:"hover:bg-muted/10 transition-colors cursor-pointer",onClick:()=>g({to:"/projects/$projectId/collections/$collectionId",params:{projectId:a,collectionId:e.id}}),children:[t(yt,{className:"font-medium px-4 py-3.5",children:o("div",{className:"flex items-center gap-2",children:[t(ta,{className:"h-4 w-4 text-primary shrink-0"}),t("span",{className:"text-foreground font-semibold hover:underline",children:e.name})]})}),t(yt,{className:"px-4 py-3.5",children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[e.creator?.image&&t(Ie,{src:e.creator.image,alt:e.creator.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:T(e.creator?.name)})]}),t("span",{className:"text-sm font-medium text-foreground truncate max-w-[200px]",children:e.creator?.name||An()})]})}),t(yt,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:o("div",{className:"flex items-center gap-2",children:[t(jn,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),t("span",{children:new Date(e.createdAt).toLocaleDateString()})]})})]},e.id))})]}),t("div",{ref:k,className:"h-10 w-full flex items-center justify-center",children:l&&t(O,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var C=ze("/projects/$projectId/collections/")({component:j});export{C as Route};
|
package/bin/chunk-dcmfn4hs.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{u,S,L,t,o,O,ve,we,E,sn,an,ln,cn,Ce,Ie,Te,he,ge,Ae,Nc,_i,WA,YA,n0,o0,s0,Pm,De,Us,Sh,Wb,ev,nv,Lv,mw,hw,hx,gx,$c,hE,Ap,_E,Ml,AC,_C,js,SI,jd,zp,Je,Xe,et,tt,rt,nt,ot,st,ue,ae,fe,le,q,M}from"./chunk-vsefjzzj.js";import{co}from"./chunk-80qz30dc.js";import{Nr}from"./chunk-4437dnfa.js";S();function Vl({open:P,onOpenChange:G,title:F,members:_,isOwner:i,onInvite:g,onUpdateRole:D,onRemoveMember:y,currentUserId:V,availableMembersToAdd:C,onAddMember:c,type:n="team"}){let[x,b]=u("editor"),[m,A]=u(null),[T,j]=u(!1),[f,p]=u(null),[l,w]=u(null),[R,I]=u({}),[s,d]=u(null),v=(e)=>{if(!e)return"";switch(e.toLowerCase()){case"owner":return $c();case"editor":return Us();case"reviewer":return js();default:return e}},k=(e,a)=>{I((r)=>({...r,[e]:a}))},H=async(e,a)=>{if(!D)return;p(e);try{await D(e,a),M.success(gx())}catch(r){console.error(r),M.error(nv())}finally{p(null)}},U=async()=>{if(!y||!l?.id)return;p(l.id);try{await y(l.id),M.success(hx()),w(null)}catch(e){console.error(e),M.error(ev())}finally{p(null)}},J=async()=>{if(!g)return;j(!0);try{let e=await g(x),a=`${window.location.origin}/signup?inviteCode=${e}`;A(a)}catch(e){console.error(e),M.error(Wb())}finally{j(!1)}},K=async()=>{if(m){if(await co(m))M.success(mw())}},h=(e)=>{if(!e)return"??";return e.split(" ").map((a)=>a[0]).slice(0,2).join("").toUpperCase()},Q=(e)=>{if(!e)A(null),b("editor"),I({}),d(null);G(e)},N=Array.isArray(_)?_:[],W=Array.isArray(C)?C:[],X=n==="project"&&i?N.filter((e)=>e.role==="owner"||e.scope==="project"||e.hasCustomRole):N,z=n==="project"&&i?N.filter((e)=>e.scope==="team"&&e.role!=="owner"&&!e.hasCustomRole):[],B=n==="project"&&i?W.filter((e)=>e.scope==="project"):[];return t(ue,{open:P,onOpenChange:Q,children:o(ae,{className:"sm:max-w-xl",onOpenAutoFocus:(e)=>e.preventDefault(),children:[t(fe,{children:t(le,{children:F})}),o("div",{className:"space-y-4",children:[t("div",{className:"max-h-[300px] overflow-y-auto space-y-2",children:X.map((e)=>{let a=n==="team"&&e.scope==="project";return o("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-muted/50",children:[o("div",{className:"flex items-center gap-3",children:[o(Ce,{children:[e.image&&t(Ie,{src:e.image,alt:e.name,className:"object-cover"}),t(Te,{children:h(e.name)})]}),o("div",{className:"flex flex-col",children:[t("span",{className:"text-sm font-medium",children:e.name}),o("div",{className:"flex items-center gap-2",children:[!a&&t("span",{className:"text-xs text-muted-foreground capitalize",children:v(e.role)}),e.scope&&o(L,{children:[!a&&t("span",{className:"text-[10px] text-muted-foreground/70",children:"•"}),t("span",{className:"text-xs text-muted-foreground capitalize",children:e.scope==="team"?zp():Ap()})]})]})]})]}),i&&e.role!=="owner"&&e.id!==V&&o("div",{className:"flex items-center gap-2",children:[a?t(sn,{children:o(an,{children:[t(ln,{asChild:!0,children:t("span",{children:t(E,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26 justify-between",disabled:!0,children:t(ve,{className:"ml-auto h-3 w-3 opacity-50"})})})}),t(cn,{side:"top",children:t("p",{className:"text-xs",children:_E()})})]})}):o(he,{children:[t(ge,{asChild:!0,children:o(E,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:f===e.id,children:[v(e.role),t(ve,{className:"ml-1 h-3 w-3 opacity-50"})]})}),t(Ae,{children:o(Nc,{value:e.role,onValueChange:(r)=>H(e.id,r),children:[t(_i,{value:"editor",className:"text-xs",children:Us()}),t(_i,{value:"reviewer",className:"text-xs",children:js()})]})})]}),t(E,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>w(e),disabled:f===e.id,children:f===e.id?t(O,{className:"h-3 w-3 animate-spin"}):t(we,{className:"h-3 w-3"})})]})]},e.id)})}),t(Je,{open:!!l,onOpenChange:(e)=>!e&&w(null),children:o(Xe,{children:[o(et,{children:[t(rt,{children:AC()}),t(nt,{children:_C({name:l?.name||"",type:n==="project"?hE():jd()})})]}),o(tt,{children:[t(st,{children:De()}),t(ot,{onClick:U,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ml()})]})]})})," ",i&&c&&z.length>0&&o("div",{className:"border-t pt-4",children:[t("h4",{className:"text-sm font-medium mb-1",children:n0()}),t("p",{className:"text-xs text-muted-foreground mb-3 font-normal",children:o0()}),t("div",{className:"max-h-[200px] overflow-y-auto space-y-2 pr-1",children:z.map((e)=>{let a=R[e.id]||"editor";return o("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-muted/50",children:[o("div",{className:"flex items-center gap-3",children:[o(Ce,{children:[e.image&&t(Ie,{src:e.image,alt:e.name,className:"object-cover"}),t(Te,{children:h(e.name)})]}),o("div",{className:"flex flex-col",children:[t("span",{className:"text-sm font-medium",children:e.name}),t("span",{className:"text-xs text-muted-foreground capitalize",children:e.scope==="team"?zp():Ap()})]})]}),o("div",{className:"flex items-center gap-2",children:[o(he,{children:[t(ge,{asChild:!0,children:o(E,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:s===e.id,children:[v(a),t(ve,{className:"ml-1 h-3 w-3 opacity-50"})]})}),t(Ae,{children:o(Nc,{value:a,onValueChange:(r)=>k(e.id,r),children:[t(_i,{value:"editor",className:"text-xs",children:Us()}),t(_i,{value:"reviewer",className:"text-xs",children:js()})]})})]}),t(E,{onClick:async()=>{d(e.id);try{await c(e.id,a),M.success(Pm({name:e.name||""}))}catch(r){console.error(r),M.error(Sh({name:e.name||""}))}finally{d(null)}},disabled:s!==null,size:"sm",className:"h-8 text-xs px-3",children:s===e.id?t(O,{className:"h-3 w-3 animate-spin"}):SI()})]})]},e.id)})})]}),i&&c&&B.length>0&&o("div",{className:"border-t pt-4",children:[t("h4",{className:"text-sm font-medium mb-1",children:WA()}),t("p",{className:"text-xs text-muted-foreground mb-3 font-normal",children:YA()}),t("div",{className:"max-h-[200px] overflow-y-auto space-y-2 pr-1",children:B.map((e)=>{let a=R[e.id]||"editor";return o("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-muted/50",children:[o("div",{className:"flex items-center gap-3",children:[o(Ce,{children:[e.image&&t(Ie,{src:e.image,alt:e.name,className:"object-cover"}),t(Te,{children:h(e.name)})]}),o("div",{className:"flex flex-col",children:[t("span",{className:"text-sm font-medium",children:e.name}),t("span",{className:"text-xs text-muted-foreground capitalize",children:e.scope==="team"?zp():Ap()})]})]}),o("div",{className:"flex items-center gap-2",children:[o(he,{children:[t(ge,{asChild:!0,children:o(E,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:s===e.id,children:[v(a),t(ve,{className:"ml-1 h-3 w-3 opacity-50"})]})}),t(Ae,{children:o(Nc,{value:a,onValueChange:(r)=>k(e.id,r),children:[t(_i,{value:"editor",className:"text-xs",children:Us()}),t(_i,{value:"reviewer",className:"text-xs",children:js()})]})})]}),t(E,{onClick:async()=>{d(e.id);try{await c(e.id,a),M.success(Pm({name:e.name||""}))}catch(r){console.error(r),M.error(Sh({name:e.name||""}))}finally{d(null)}},disabled:s!==null,size:"sm",className:"h-8 text-xs px-3",children:s===e.id?t(O,{className:"h-3 w-3 animate-spin"}):s0()})]})]},e.id)})})]}),i&&g&&o("div",{className:"border-t pt-4",children:[t("h4",{className:"text-sm font-medium mb-3",children:hw()}),o("div",{className:"space-y-3",children:[o("div",{className:"flex gap-2",children:[o(he,{children:[t(ge,{asChild:!0,children:o(E,{variant:"outline",className:"w-[120px] justify-between",children:[x==="editor"?Us():js(),t(ve,{className:"h-4 w-4 opacity-50"})]})}),t(Ae,{children:o(Nc,{value:x,onValueChange:(e)=>b(e),children:[t(_i,{value:"editor",children:Us()}),t(_i,{value:"reviewer",children:js()})]})})]}),o(E,{onClick:J,disabled:T,className:"flex-1",children:[T&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),Lv()]})]}),m&&o("div",{className:"flex gap-2",children:[t(q,{value:m,readOnly:!0}),t(E,{variant:"outline",size:"icon",onClick:K,children:t(Nr,{className:"h-4 w-4"})})]})]})]})]})]})})}
|
|
2
|
-
export{Vl};
|
package/bin/chunk-dy79b8kd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,ze}from"./chunk-vsefjzzj.js";import"./chunk-yfm9xwes.js";import"./chunk-zp5b1mb6.js";import"./chunk-3m6ch1x5.js";import"./chunk-1dt700ws.js";import"./chunk-62sj29j8.js";import"./chunk-dcmfn4hs.js";import"./chunk-rh1hs8wa.js";import"./chunk-vre5andt.js";import"./chunk-s978ftze.js";import"./chunk-6v6c2921.js";import"./chunk-ehvyq65t.js";import"./chunk-0e8xg41c.js";import{Si}from"./chunk-18kgmvme.js";import"./chunk-rsdpycdr.js";import"./chunk-s9svhjv6.js";import"./chunk-m5cpsm28.js";import"./chunk-dvkzhpxx.js";import"./chunk-4mq874m3.js";import"./chunk-t597y392.js";import"./chunk-4437dnfa.js";function s(){let{shareId:e,folderId:a}=n.useParams();return t(Si,{shareId:e,initialFolderId:a})}var n=ze("/share/$shareId/folders/$folderId")({component:s});export{n as Route};
|
package/bin/chunk-ehvyq65t.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{D,h,N,y,u,S,L,t,o,Q,Z,B,pt,A,I,Sr,O,Do,Pe,ve,nn,vt,wt,tr,we,Ne,C,E,he,ra,ge,Ae,K,Qr,Vt,ps,ms,hs,Ef,De,pd,at,Uc,zc,hr,gd,Fb,Xb,Da,Wf,np,lg,cg,Oa,Sg,gp,Fo,xo,Ud,Je,Xe,et,tt,rt,nt,ot,st,ue,ae,fe,qe,le,q,ce,Dt,Pt,M,So,Eo,Kr,kn,be,bs,zr,ef}from"./chunk-vsefjzzj.js";import{Ti,Mi,Fr,mu,hu,ts,rs,vs,xs}from"./chunk-1dt700ws.js";import{Ha,fu}from"./chunk-s978ftze.js";import{Gs}from"./chunk-6v6c2921.js";var ct=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Qe=I("pencil",ct);S();S();function Ge({teamId:m,projectId:s,file:r,onSaveField:d,members:F,onCommentSelect:x,hideAnnotationControl:R=!1,readOnly:b=!1,publicFields:v,isPublic:c=!1,shareId:k,currentTime:H,onTyping:ee,selectedCommentId:f,heightPercent:V,onHeightPercentChange:U}){let{canEdit:_}=Dt(s),{fields:i,setFields:X}=Fr(),se=Q(),{ref:oe,inView:me}=Pt(),[a,j]=u(null),[Ce,te]=u(!1),[ke,ze]=u(null),G=y(!1),Ve=y(0),Y=y(V),je=(e)=>{G.current=!0,Ve.current=e.clientY,Y.current=V,e.target.setPointerCapture?.(e.pointerId)},Me=D((e)=>{if(!G.current)return;let w=(Ve.current-e.clientY)/window.innerHeight*100,ne=Math.min(85,Math.max(10,Y.current+w));U(ne)},[U]),Te=(e)=>{G.current=!1;try{e.target.releasePointerCapture?.(e.pointerId)}catch{}},{data:J}=Z({queryKey:["fields",s],queryFn:async()=>{let e=await A.api.projects[":projectId"].fields.$get({param:{projectId:s}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!s&&!v}),T=ts(r);h(()=>{if(v)X(v,s);else if(J)X(J,s)},[J,v,s,X]);let{data:pe,fetchNextPage:W,hasNextPage:Ie}=pt({queryKey:c?["shares",k,"files",r?.id,"comments"]:["files",r?.id,"comments"],queryFn:async({pageParam:e})=>{if(c){let l=localStorage.getItem(`share_pwd_${k}`)||"",w=await A.api.shares[":shareId"].files[":fileId"].comments.$get({param:{shareId:k,fileId:r.id},query:{after:e}},{headers:{"x-share-password":l}});if(!w.ok)throw Error("Failed to fetch comments");return await w.json()}else{let l=await A.api.files[":fileId"].comments.$get({param:{fileId:r.id},query:{after:e}});if(!l.ok)throw Error("Failed to fetch comments");return await l.json()}},enabled:!!r?.id&&(!c||!!k),initialPageParam:"",refetchInterval:2000,getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{mutate:Se}=B({mutationFn:async({text:e,attachmentIds:l,annotations:w,replyToId:ne,guestUserId:xe,second:ye})=>{if(c){let ie=localStorage.getItem(`share_pwd_${k}`)||"",Be=await A.api.shares[":shareId"].files[":fileId"].comments.$post({param:{shareId:k,fileId:r.id},json:{message:e,attachmentIds:l,replyToId:ne??void 0,annotations:w,second:ye??void 0}},{headers:{"x-share-password":ie,...xe?{"x-guest-user-id":xe}:{}}});if(!Be.ok)throw Error("Failed to create comment");return await Be.json()}else{let ie=await A.api.files[":fileId"].comments.$post({param:{fileId:r.id},json:{message:e,attachmentIds:l,replyToId:ne??void 0,annotations:w,second:ye??void 0}});if(!ie.ok)throw Error("Failed to create comment");return await ie.json()}},onSuccess:()=>{se.invalidateQueries({queryKey:c?["shares",k,"files",r?.id,"comments"]:["files",r?.id,"comments"]})},onError:()=>{M.error(Xb?.()||"Failed to post comment")}}),Fe=pe?.pages?.[0]?.pageInfo?.total??pe?.pages.reduce((e,l)=>e+(l.data?.length||0),0)??0;h(()=>{if(me&&Ie)W()},[me,W,Ie]);let z=N(()=>(r?.fieldValues||[]).reduce((e,l)=>(e[l.fieldId]=l,e),{}),[r?.fieldValues]),re=N(()=>[...i].sort((e,l)=>{let w=e.config?.name?.toLowerCase()||"",ne=l.config?.name?.toLowerCase()||"";if(w<ne)return-1;if(w>ne)return 1;return 0}),[i]),Ee=pe?.pages.flatMap((e)=>e.data??[])??[],_e=(e,l,w=[],ne,xe)=>{if(!e.trim()&&l.length===0&&w.length===0)return;let ye=ne||a?.id||null;if(c){let ie=localStorage.getItem(`guest_user_id_${k}`);if(!ie)ze({text:e,attachmentIds:l,annotations:w,replyToId:ye,second:xe}),te(!0);else Se({text:e,attachmentIds:l,annotations:w,replyToId:ye,guestUserId:ie,second:xe})}else Se({text:e,attachmentIds:l,annotations:w,replyToId:ye,second:xe});j(null)},He=(e)=>{if(ke)Se({...ke,guestUserId:e}),ze(null),j(null)},Re=(e)=>{let l=F.find((w)=>w.id===e);if(l)return l;return{id:"unknown",name:"Unknown",role:"unknown"}},Le=V<=15;return o("div",{style:{height:`${V}dvh`},className:"shrink-0 flex flex-col bg-background border-t border-border shadow-2xl rounded-t-2xl overflow-hidden select-none z-20","data-testid":"mobile-bottom-sheet",children:[t("div",{onPointerDown:je,onPointerMove:Me,onPointerUp:Te,onPointerCancel:Te,className:"w-full pt-2 pb-1.5 flex flex-col items-center justify-center cursor-grab active:cursor-grabbing touch-none shrink-0","aria-label":"Drag to resize bottom sheet",children:t("div",{className:"w-10 h-1 rounded-full bg-muted-foreground/30 hover:bg-muted-foreground/50 transition-colors"})}),o(So,{defaultValue:"comments",className:"flex-1 flex flex-col min-h-0 px-2 pb-1 overflow-hidden",children:[o(Eo,{className:"w-full shrink-0 h-9 bg-muted/60 p-1",children:[o(Kr,{value:"comments",className:"flex-1 text-xs font-semibold py-1",children:[pd()," ",Fe>0&&`(${Fe})`]}),t(Kr,{value:"fields",className:"flex-1 text-xs font-semibold py-1",children:Da()})]}),o(kn,{value:"comments",className:C("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Le&&"hidden"),children:[t("div",{className:"flex items-center justify-between px-2 pb-1.5 shrink-0 border-b border-border/50",children:o("span",{className:"text-xs font-bold text-foreground",children:[Ef?.()||"All comments",Fe>0?` (${Fe})`:""]})}),t(ce,{className:"flex-1 min-h-0 px-2 py-2 [&>div>div]:block!",children:Ee.length===0?t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:cg()}):o("div",{className:"space-y-3",children:[Ee.map((e)=>o("div",{children:[t(Ha,{teamId:m,message:e,getUser:Re,onReply:j,hasReplies:!!e.replies?.length,formatTimestamp:T?.commentsConfig?.formatTimestamp,frameRate:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:f===e.id,onSelect:()=>{x?.(e)},readOnly:b,isPublic:c}),e.replies?.map((l,w)=>t("div",{children:t(Ha,{teamId:m,isReply:!0,message:l,getUser:Re,onReply:j,hasReplies:!1,isLastReply:w===(e.replies?.length??0)-1,formatTimestamp:T?.commentsConfig?.formatTimestamp,frameRate:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:f===l.id,onSelect:()=>{x?.(l)},readOnly:b,isPublic:c})},l.id))]},e.id)),t("div",{ref:oe})]})}),(!b||c)&&t("div",{className:"mt-auto shrink-0 bg-background border-t border-border pt-1",children:t(fu,{isOpen:Ce,onClose:()=>te(!1),onSuccess:He,children:t(Gs,{projectId:s,onSendMessage:_e,replyingTo:a,onCancelReply:()=>j(null),hideAnnotationControl:R,disableMentions:c,currentTime:T?.commentsConfig?.hasTimestamp?H:void 0,formatTimestamp:T?.commentsConfig?.formatTimestamp,frameRate:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,onTyping:ee})})})]}),t(kn,{value:"fields",className:C("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Le&&"hidden"),children:t(ce,{className:"flex-1 px-3 py-2 min-h-0 [&>div>div]:block!",children:re&&re.length>0?t("div",{className:"space-y-4 pb-6",children:re.map((e)=>o("div",{className:"space-y-1.5",children:[t("label",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:e.config?.name}),t("div",{className:"min-h-[32px]",children:t(xs,{fieldId:e.id,config:e.config,value:z[e.id]?.value,onSave:_?(l)=>d(e.id,l):void 0,readOnly:b||e.readOnly||!_})})]},e.id))}):t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:"No custom fields defined"})})})]})]})}function Ye({fileName:m,folderName:s,version:r,versions:d,activeFileId:F,isPublic:x=!1,shareId:R,allowDownload:b=!0,downloadInfo:v,canEdit:c=!1,onBack:k,onPrevFile:H,onNextFile:ee,hasPrevFile:f=!1,hasNextFile:V=!1,onSelectVersion:U,onRename:_,onDelete:i,onLinkedTasks:X,linkedTaskCount:se=0}){let oe=async(a)=>{try{let j=x&&R?await A.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:R,fileId:F},json:{key:a}}):await A.api.files["download-url"].$post({json:{key:a,assetId:F}});if(!j.ok)return;let{url:Ce}=await j.json(),te=document.createElement("a");te.href=Ce,te.download="",document.body.appendChild(te),te.click(),document.body.removeChild(te)}catch{}},me=(v?.videoTranscodes?.length??0)>0;return o("header",{className:"flex h-12 w-full items-center justify-between border-b border-border bg-card px-2 py-1.5 shrink-0 select-none z-30",children:[t("div",{className:"flex items-center",children:t(E,{variant:"ghost",size:"icon",onClick:k,className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":gp(),children:t(nn,{className:"h-5 w-5"})})}),o("div",{className:"flex flex-1 items-center justify-center gap-1 min-w-0 px-1",children:[o("div",{className:"flex items-center min-w-0 max-w-[65vw]",children:[s&&o(L,{children:[t("span",{className:"truncate text-xs font-medium text-muted-foreground max-w-[80px]",children:s}),t("span",{className:"text-muted-foreground mx-1 text-xs",children:"/"})]}),d&&d.length>1?o(he,{modal:!1,children:[t(ge,{asChild:!0,children:o("button",{className:"flex items-center gap-1 min-w-0 truncate text-xs font-medium text-foreground hover:bg-accent rounded px-1 py-0.5 transition-colors cursor-pointer",children:[t("span",{className:"truncate max-w-[120px] font-semibold",children:m}),r!==void 0&&o(be,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]}),t(ve,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]})}),o(Ae,{align:"center",className:"w-48 z-40",children:[t(Qr,{className:"text-xs",children:Ud()}),d.map((a)=>o(K,{onClick:()=>U?.(a.id),className:C("flex items-center justify-between text-xs cursor-pointer",a.id===F?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",a.version]}),t("span",{className:"text-[11px] text-muted-foreground truncate max-w-[120px]",children:a.name||m})]},a.id))]})]}):o("div",{className:"flex items-center gap-1 min-w-0 truncate",children:[t("span",{className:"truncate text-xs font-semibold text-foreground max-w-[140px]",children:m}),r!==void 0&&o(be,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]})]})]}),(f||V)&&o("div",{className:"flex items-center gap-0.5 shrink-0 bg-muted/60 rounded p-0.5 ml-1",children:[t(E,{variant:"ghost",size:"icon",disabled:!f,onClick:H,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:Sg(),"aria-label":Sg(),children:t(nn,{className:"h-3.5 w-3.5"})}),t(E,{variant:"ghost",size:"icon",disabled:!V,onClick:ee,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:lg(),"aria-label":lg(),children:t(vt,{className:"h-3.5 w-3.5"})})]})]}),t("div",{className:"flex items-center gap-1",children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(E,{variant:"ghost",size:"icon",className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":np(),children:t(Sr,{className:"h-4 w-4"})})}),o(Ae,{align:"end",className:"w-52 z-40",children:[b&&(me?o(ps,{children:[o(ms,{className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(wt,{className:"h-3.5 w-3.5"}),t("span",{children:hr()})]}),t(ra,{children:o(hs,{className:"w-48 z-50",children:[t(Qr,{className:"text-xs",children:hr()}),v?.videoTranscodes?.map((a)=>{let j=bs(a),Ce=a.hdr?`${j} (HDR)`:j;return o(K,{onClick:()=>oe(a.key),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:Ce}),t("span",{className:"text-[10px] text-muted-foreground",children:"MP4"})]},a.key||`${j}-${a.hdr?"hdr":"sdr"}`)}),v?.originalKey&&o(L,{children:[t(Vt,{}),o(K,{onClick:()=>oe(v.originalKey),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:Oa?.()||"Original"}),t("span",{className:"text-[10px] text-muted-foreground",children:m.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):o(K,{onClick:()=>v?.originalKey&&oe(v.originalKey),disabled:!v?.originalKey,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(wt,{className:"h-3.5 w-3.5"}),t("span",{children:hr()})]})),d&&d.length>1&&U&&o(ps,{children:[t(ms,{className:"flex items-center gap-2 text-xs cursor-pointer",children:t("span",{children:Ud?.()||"Switch version"})}),t(ra,{children:o(hs,{className:"w-48 z-50",children:[t(Qr,{className:"text-xs",children:Ud?.()||"Switch version"}),d.map((a)=>o(K,{onClick:()=>U(a.id),className:C("flex items-center justify-between text-xs cursor-pointer",a.id===F?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",a.version]}),t("span",{className:"text-[10px] text-muted-foreground truncate max-w-[120px]",children:a.name||m})]},a.id))]})})]}),X&&o(K,{onClick:X,className:"flex items-center justify-between text-xs cursor-pointer",children:[o("span",{className:"flex items-center gap-2",children:[t(Do,{className:"h-3.5 w-3.5"}),t("span",{children:Wf?.()||"Linked Tasks"})]}),se>0&&t("span",{className:"inline-flex items-center justify-center px-1.5 py-0.2 text-[10px] font-semibold rounded-full bg-muted-foreground/15 text-foreground",children:se})]}),c&&_&&o(K,{onClick:_,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(Qe,{className:"h-3.5 w-3.5"}),t("span",{children:Fo()})]}),c&&i&&o(L,{children:[t(Vt,{}),o(K,{onClick:i,className:"flex items-center gap-2 text-xs text-destructive focus:text-destructive cursor-pointer",children:[t(we,{className:"h-3.5 w-3.5"}),t("span",{children:at()})]})]})]})]})})]})}function Ul({projectId:m,teamId:s="",fileId:r,file:d,projectInfo:F,ancestorFolders:x=[],versions:R,activeFileId:b,startTime:v,isPublic:c=!1,shareId:k,allowDownload:H=!0,publicFields:ee,siblingFiles:f=[],onNavigateToFile:V,onNavigateBack:U,onRenameFile:_,onDeleteFile:i,onSaveField:X,onSelectVersion:se}){let{canEdit:oe}=Dt(m),{members:me}=zr(),a=y(null),[j,Ce]=u(50),[te,ke]=u([]),[ze,G]=u(0),[Ve,Y]=u(null),[je,Me]=u(!1),[Te,J]=u(""),T=y(null),[pe,W]=u(!1),[Ie,Se]=u(!1),[Fe,z]=u(!1),[re,Ee]=u(!1),{data:_e}=Z({queryKey:["teams",s,"kanban","assets",b,"tasks"],queryFn:async()=>{if(!s||!b||c)return{data:[],total:0};let g=await A.api.teams[":teamId"].kanban.assets[":assetId"].tasks.$get({param:{teamId:s,assetId:b}});if(!g.ok)return{data:[],total:0};return await g.json()},enabled:!!s&&!!b&&!c}),He=_e?.total??_e?.data?.length??0,{prevFile:Re,nextFile:Le}=N(()=>{if(!f||f.length===0)return{prevFile:null,nextFile:null};let g=f.findIndex((de)=>de.id===r||de.id===b);if(g===-1)return{prevFile:null,nextFile:null};return{prevFile:g>0?f[g-1]:null,nextFile:g<f.length-1?f[g+1]:null}},[f,r,b]),e=x.length>0?x[0]?.name:F?.name,w=R?.find((g)=>g.id===b)?.version??(R&&R.length>0?R.length:void 0),ne=N(()=>({originalKey:d.media?.original?.key,videoTranscodes:d.media?.videoTranscodes?.map((g)=>({key:g.key,width:g.width,height:g.height,resolution:g.resolution,hdr:g.hdr}))}),[d.media]),xe=()=>{ke([]),Y(null)},ye=(g)=>{Y(g.id||null);let de=g.annotations;if(de&&de.length>0)ke(de);else ke([]);if(g.second!==null&&g.second!==void 0)a.current?.seekTo(g.second),a.current?.pause();else if(de&&de.length>0)a.current?.pause()},ie=async(g)=>{if(g?.preventDefault(),!Te.trim()||!_)return;try{Se(!0),await _(Te.trim()),Me(!1)}finally{Se(!1)}},Be=async()=>{if(!i)return;try{W(!0),await i(),z(!1)}finally{W(!1)}};return h(()=>{G(0),Y(null),ke([])},[d?.id]),o("div",{className:"flex h-[100dvh] w-full flex-col bg-background overflow-hidden relative",children:[t(Ye,{fileName:d.name,folderName:e,version:w,versions:R,activeFileId:b,isPublic:c,shareId:k,allowDownload:H,downloadInfo:ne,canEdit:oe,onBack:U,hasPrevFile:!!Re,hasNextFile:!!Le,onPrevFile:()=>Re&&V(Re.id),onNextFile:()=>Le&&V(Le.id),onSelectVersion:se,onRename:()=>{J(d.name),Me(!0)},onDelete:()=>z(!0),onLinkedTasks:!c?()=>Ee(!0):void 0,linkedTaskCount:He}),t("div",{className:"relative flex-1 min-h-0 bg-background overflow-hidden flex flex-col",children:t(rs,{file:d,mediaControllerRef:a,onPlay:xe,onTimeUpdate:G,annotations:te,startTime:v,shareId:k,allowDownload:H})}),t(Ge,{teamId:s,projectId:m,file:d,onSaveField:X,members:me,onCommentSelect:ye,hideAnnotationControl:d.proxyType==="audio",readOnly:c||!oe,publicFields:ee,isPublic:c,shareId:k,currentTime:ze,onTyping:()=>a.current?.pause(),selectedCommentId:Ve,heightPercent:j,onHeightPercentChange:Ce}),!c&&re&&t(ef,{teamId:s,assetId:b,assetName:d.name,isOpen:re,onClose:()=>Ee(!1)}),!c&&t(ue,{open:je,onOpenChange:Me,children:t(ae,{children:o("form",{onSubmit:ie,children:[t(fe,{children:t(le,{children:Fo()})}),t("div",{className:"py-4",children:t(q,{ref:T,value:Te,onChange:(g)=>J(g.target.value),placeholder:gd?.()||"Enter new name",onFocus:()=>{setTimeout(()=>{if(T.current)vs(T.current)},0)},autoFocus:!0})}),o(qe,{children:[t(E,{type:"button",variant:"outline",onClick:()=>Me(!1),children:De()}),o(E,{type:"submit",disabled:Ie||!Te.trim(),children:[Ie&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),xo()]})]})]})})}),!c&&t(Je,{open:Fe,onOpenChange:z,children:o(Xe,{children:[o(et,{children:[t(rt,{children:zc?.()||"Delete Asset?"}),t(nt,{children:Uc?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),o(tt,{children:[t(st,{children:De()}),o(ot,{onClick:Be,disabled:pe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[pe&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),at()]})]})]})})]})}S();function We({activeState:m,activeAsset:s,previewUrl:r,isFullScreen:d,onTogglePlay:F,onToggleLoop:x,onSeek:R,onVolumeChange:b,onToggleMute:v,onChangePlaybackRate:c,onChangeResolution:k,onZoomIn:H,onZoomOut:ee,onFit:f,onDownload:V,onToggleFullScreen:U,allowDownload:_=!0}){if(m?.kind==="video"&&m.video&&s){let i=m.video,X=i.totalFrames/i.frameRate,se=i.currentFrame/i.frameRate,oe={isPlaying:i.isPlaying,progress:X>0?se/X*100:0,currentTime:se,duration:X,volume:i.volume,isMuted:i.isMuted,isLooping:i.isLooping,playbackRate:i.playbackRate,isFullScreen:d,showFrames:!1,currentResolution:i.currentResolution,isCurrentHdr:i.isCurrentHdr,activeAutoResolution:i.activeAutoResolution,isHlsManualSupported:i.isHlsManualSupported,isLoading:i.isLoading},me=r&&!s.media?.videoPreview?{...s,media:{...s.media,videoPreview:{url:r}}}:s;return t(mu,{state:oe,zoom:m.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:i.buffered,data:me,resolutions:i.resolutions,togglePlay:F,toggleLoop:x,toggleMute:v,handleVolumeChange:b,changePlaybackRate:c,changeResolution:(a)=>k(a.resolution,a.hdr),handleDownload:(a)=>V(a),toggleFullScreen:U,onZoomChange:(a)=>a>=m.zoom?H():ee(),onZoomReset:f,frameRate:i.frameRate,totalFrames:i.totalFrames,currentFrame:i.currentFrame,seekToFrame:R,allowDownload:_})}if(m?.kind==="image")return t(hu,{zoom:m.zoom,onZoomIn:H,onZoomOut:ee,onFit:f,onDownload:()=>V(),canDownload:!!s?.media?.original?.key,fullscreen:{isFullScreen:d,onToggle:U},allowDownload:_});return t("div",{className:"relative z-10 flex items-center justify-end gap-2 border-t border-border bg-card px-4 py-3",children:t("button",{onClick:U,className:"text-foreground transition-colors hover:text-primary",title:"Fullscreen",children:d?t(Mi,{className:"h-5 w-5"}):t(Ti,{className:"h-5 w-5"})})})}function Ke({side:m,fileName:s,version:r,activeVersionId:d,versions:F,isActive:x,onActivate:R,onSwitchVersion:b,onExit:v}){let c=C("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",x?"text-foreground":"text-muted-foreground hover:text-foreground"),k=t("button",{onClick:v,title:Fb(),className:c,children:t(Ne,{className:"h-4 w-4"})}),H=o("button",{onClick:R,className:C("flex min-w-0 items-center gap-1 rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-muted",x?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[t("span",{className:"truncate",children:s}),r!==void 0&&o("span",{className:C("flex-shrink-0 rounded border px-1 py-0 text-xs",x?"border-foreground/40":"border-border"),children:["v",r]})]}),ee=o(he,{children:[t(ge,{onClick:R,title:Ud(),className:c,children:t(ve,{className:"h-4 w-4"})}),t(Ae,{align:m==="left"?"start":"end",className:"w-80 p-1",children:t("div",{className:"flex max-h-96 flex-col gap-1 overflow-y-auto",children:F.map((f)=>{let V=f.id===d;return o(K,{onClick:()=>b(f.id),className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2",children:[o("div",{className:"flex min-w-[2rem] flex-shrink-0 items-center justify-center rounded-full bg-muted px-2 py-0.5 text-xs font-semibold text-muted-foreground select-none",children:["v",f.version]}),t("div",{className:"flex h-10 w-16 flex-shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.previewUrl?t("img",{src:f.previewUrl,alt:f.name||void 0,className:"h-full w-full object-cover"}):t(tr,{className:"h-4 w-4 text-muted-foreground"})}),o("div",{className:"flex min-w-0 flex-1 flex-col text-left",children:[t("span",{className:"truncate text-sm font-semibold text-foreground",children:f.name}),t("span",{className:"truncate text-xs text-muted-foreground",children:f.creator?.name||"Unknown"})]}),V&&t(Pe,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},f.id)})})})]});return t("div",{onMouseDown:R,className:C("dark flex h-10 flex-shrink-0 items-center gap-1 border-b bg-background px-2 transition-colors",x?"border-b-2 border-primary":"border-border"),children:m==="left"?o(L,{children:[k,H,ee]}):o(L,{children:[H,ee,t("div",{className:"ml-auto"}),k]})})}function it(m,s,r){return Z({queryKey:s?["public-share-file",r,m,localStorage.getItem(`share_pwd_${r}`)||""]:["files",m],queryFn:async()=>{if(s){let F=localStorage.getItem(`share_pwd_${r}`)||"",x=await A.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:m}},{headers:{"x-share-password":F}});if(!x.ok)throw Error("Failed to fetch version asset");return await x.json()}let d=await A.api.files[":fileId"].$get({param:{fileId:m}});if(!d.ok)throw Error("Failed to fetch version asset");return await d.json()},enabled:!!m&&(!s||!!r)})}function zl({isPublic:m=!1,shareId:s,versions:r,leftId:d,rightId:F,activeSide:x,annotations:R,seekRequest:b,onActiveSideChange:v,onSwitchVersion:c,onExit:k,onActiveAssetChange:H,onPlay:ee,onTimeUpdate:f,allowDownload:V=!0}){let U=y(null),_=y(null),i=y(null),[X,se]=u(null),[oe,me]=u(null),[a,j]=u(1),[Ce,te]=u(!1),[ke,ze]=u(!1),{data:G,isLoading:Ve}=it(d,m,s),{data:Y,isLoading:je}=it(F,m,s),Me=ts(G),Te=ts(Y),J=!!G&&!!Y&&Me.id===Te.id,T=x==="left"?G:Y,pe=x==="left"?X:oe,W=D(()=>x==="left"?_.current:i.current,[x]),Ie=D(()=>x==="left"?i.current:_.current,[x]);h(()=>{H(T??null)},[T,H]),h(()=>{if(!b)return;let n=W();if(n?.seekToSecond(b.second),n?.pause(),J){let p=Ie();p?.seekToSecond(b.second),p?.pause()}},[b?.nonce]),h(()=>{let n=()=>ze(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",n),()=>document.removeEventListener("fullscreenchange",n)},[]);let Se=D((n)=>se(n),[]),Fe=D((n)=>me(n),[]),z=D((n)=>{let p=W();if(p)n(p);if(J){let P=Ie();if(P)n(P)}},[W,Ie,J]),re=D(()=>{let n=!pe?.video?.isPlaying;z((p)=>n?p.play():p.pause())},[pe?.video?.isPlaying,z]);h(()=>{let n=(p)=>{let P=document.activeElement;if(P&&(P.tagName==="INPUT"||P.tagName==="TEXTAREA"||P instanceof HTMLElement&&P.isContentEditable))return;let Ue=p.key===" ",Oe=P&&(P.tagName==="BUTTON"||P.tagName==="A"||P.tagName==="SELECT"||P.tagName==="OPTION"||P.getAttribute("role")==="button"||P.getAttribute("role")==="link"||P.getAttribute("role")==="checkbox"||P.getAttribute("role")==="radio"||P.getAttribute("role")==="menuitem");if(Ue&&Oe)return;if(p.key===" "||p.key.toLowerCase()==="k")p.preventDefault(),re()};return window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}},[re]);let Ee=D((n)=>z((p)=>p.seekToFrame(n)),[z]),_e=D(()=>W()?.toggleLoop(),[W]),He=D((n)=>{j(n),te(n===0)},[]),Re=D(()=>te((n)=>!n),[]),Le=D((n)=>z((p)=>p.setPlaybackRate(n)),[z]),e=D((n,p)=>W()?.changeResolution(n,p),[W]),l=D(()=>z((n)=>n.zoomBy(1.2)),[z]),w=D(()=>z((n)=>n.zoomBy(0.8)),[z]),ne=D(()=>z((n)=>n.fit()),[z]),xe=D((n)=>{W()?.download(n)},[W]),ye=D(()=>{let n=U.current;if(!n||typeof n.requestFullscreen!=="function")return;if(!document.fullscreenElement)n.requestFullscreen().catch(()=>{});else if(document.exitFullscreen)document.exitFullscreen().catch(()=>{})},[]),ie=D((n,p)=>{if(J)i.current?.panBy(n,p)},[J]),Be=D((n,p)=>{if(J)_.current?.panBy(n,p)},[J]),g=D(()=>re(),[re]),de=D((n)=>r.find((p)=>p.id===n)?.version,[r]),lt=N(()=>T?.media?.videoPreview?.url,[T?.media?.videoPreview?.url]),Ze=(n,p)=>{let Ue=ts(p)?.comparePane;if(!Ue)return t("div",{className:"flex flex-1 items-center justify-center bg-gray-100 dark:bg-gray-950",children:t("p",{className:"text-muted-foreground",children:"Preview unavailable"})});let Oe=x===n;return t(Ue,{ref:n==="left"?_:i,file:p,shareId:s,isActive:Oe,annotations:Oe?R:[],onStateChange:n==="left"?Se:Fe,onUserPan:n==="left"?ie:Be,onActivate:()=>v(n),muted:Oe?Ce:!0,volume:a,onPlay:ee,onTimeUpdate:f,onRequestTogglePlay:g},p.id)},dt=!!G&&!!Y,mt=Ve||je;return o("div",{ref:U,className:"flex h-full flex-1 flex-col bg-background",children:[o("div",{className:"flex min-h-0 flex-1",children:[o("div",{className:"flex min-w-0 flex-1 flex-col border-r border-zinc-800",children:[G&&t(Ke,{side:"left",fileName:G.name,version:de(d),activeVersionId:d,versions:r,isActive:x==="left",onActivate:()=>v("left"),onSwitchVersion:(n)=>c("left",n),onExit:k}),t("div",{className:"relative flex min-h-0 flex-1",children:G?Ze("left",G):t("div",{className:"flex flex-1 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),o("div",{className:"flex min-w-0 flex-1 flex-col",children:[Y&&t(Ke,{side:"right",fileName:Y.name,version:de(F),activeVersionId:F,versions:r,isActive:x==="right",onActivate:()=>v("right"),onSwitchVersion:(n)=>c("right",n),onExit:k}),t("div",{className:"relative flex min-h-0 flex-1",children:Y?Ze("right",Y):t("div",{className:"flex flex-1 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),mt&&!dt&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:t(O,{className:"h-8 w-8 animate-spin text-foreground"})}),t(We,{activeState:pe,activeAsset:T??null,previewUrl:lt,isFullScreen:ke,onTogglePlay:re,onToggleLoop:_e,onSeek:Ee,onVolumeChange:He,onToggleMute:Re,onChangePlaybackRate:Le,onChangeResolution:e,onZoomIn:l,onZoomOut:w,onFit:ne,onDownload:xe,onToggleFullScreen:ye,allowDownload:V})]})}
|
|
2
|
-
export{Ul,zl};
|
package/bin/chunk-g21k2awz.js
DELETED
package/bin/chunk-g9f9nzcc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,ze}from"./chunk-vsefjzzj.js";import"./chunk-yfm9xwes.js";import"./chunk-zp5b1mb6.js";import"./chunk-3m6ch1x5.js";import"./chunk-1dt700ws.js";import"./chunk-62sj29j8.js";import"./chunk-dcmfn4hs.js";import"./chunk-rh1hs8wa.js";import"./chunk-vre5andt.js";import"./chunk-s978ftze.js";import"./chunk-6v6c2921.js";import"./chunk-ehvyq65t.js";import"./chunk-0e8xg41c.js";import{Si}from"./chunk-18kgmvme.js";import"./chunk-rsdpycdr.js";import"./chunk-s9svhjv6.js";import"./chunk-m5cpsm28.js";import"./chunk-dvkzhpxx.js";import"./chunk-4mq874m3.js";import"./chunk-t597y392.js";import"./chunk-4437dnfa.js";function p(){let{shareId:a,fileId:s}=e.useParams(),{start:n,version:o,compare:r,cmpLeft:i,cmpRight:l,cmpActive:c}=e.useSearch();return t(Si,{shareId:a,initialFileId:s,startTime:n,versionId:o,compare:r,compareLeftId:i,compareRightId:l,compareActiveSide:c})}var e=ze("/share/$shareId/files/$fileId")({component:p});export{e as Route};
|
package/bin/chunk-gzzfta3s.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h,N,y,u,S,L,t,o,Q,Z,B,pt,Re,A,C,zg,jg,GC,Dt,_s,Dr,_n,$n,Xc,br,un,zr,$t,lr,Ar,Lo}from"./chunk-vsefjzzj.js";import{Fr}from"./chunk-1dt700ws.js";import{Ci}from"./chunk-yfm9xwes.js";import{Ei}from"./chunk-c4wnhekn.js";import{ua,jl}from"./chunk-ehhsezbj.js";import{ql}from"./chunk-rh1hs8wa.js";import{Ii}from"./chunk-s978ftze.js";import{Ir}from"./chunk-0e8xg41c.js";S();function ke(i,s,P,r,c,f){let O=i.type==="folder",x=s.type==="folder";if(O!==x)return null;let b=x?r:c,k=b.findIndex((a)=>a.id===P),v=b.findIndex((a)=>a.id===s.id);if(k===-1||v===-1)return null;let W=Math.min(k,v),U=Math.max(k,v),M=b.slice(W,U+1),l=new Set(f);return M.forEach((a)=>{if(a.id)l.add(a.id)}),l}function Gn({teamId:i,projectId:s,projectName:P,assetId:r,rootFolderId:c,collection:f,onUpdateCollection:O}){let x=Re(),b=Q(),{canEdit:k}=Dt(s),{setFields:v}=Fr(),W=A.api.files[":fileId"].metadata.$patch,{mutate:U}=B({mutationFn:async(e)=>{if(!(await W(e)).ok)throw Error("Failed to patch metadata");return null}}),{data:M}=Z({queryKey:["fields",s],queryFn:async()=>{let e=await A.api.projects[":projectId"].fields.$get({param:{projectId:s}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!s});h(()=>{if(M)v(M,s)},[M,s,v]);let l=r==="recently-deleted",a=r==="recents",[_,z]=u(null),[p,R]=u(new Set),[H,E]=u(null),[Ne,Me]=u(240),[Ae,ze]=u(360),{isChatbotOpen:V}=lr(),{members:Le,fetchMembers:oe}=zr(),{metadata:ae,fetchMetadata:re,setMetadata:je}=Ar(),ie=Boolean(ae["appearance.hideAgent"]);h(()=>{if(i)oe(i),re(i)},[i,oe,re]);let X=N(()=>f?.filter?.searchFilter?.conditions||[],[f]),[j,G]=u(X);h(()=>{G(X)},[X]);let le=`project:${s}:sort`,D=ae[le]||{field:"custom",order:"asc"},De=(e)=>{if(e)je(i,le,e)},F=!!f,K=j.length>0||F,{fileListLeftSidebarCollapsed:de,setFileListLeftSidebarCollapsed:$e,fileListRightSidebarCollapsed:ce,setFileListRightSidebarCollapsed:Te,viewModes:qe}=$t(),fe=qe[s]??"card",Ee=y(null),{data:T}=l||a?{data:void 0}:Z({queryKey:["folders",r],queryFn:async()=>{let e=await A.api.folders[":folderId"].$get({param:{folderId:r}});if(!e.ok)throw Error("failed to fetch folder");return await e.json()}}),{setProjectState:pe,clearProjectState:ue}=un();h(()=>(pe({teamId:i,projectId:s,projectName:P,rootFolderId:c,ancestorFolders:T?.ancestorFolders??[],currentAsset:l?{name:zg(),type:"folder"}:a?{name:jg(),type:"folder"}:F?{id:f.id,name:f.name,type:"folder"}:{id:T?.id||r,name:T?.name,type:"folder"},isRootFolder:!l&&!a&&!F&&r===c,onFolderClick:(e)=>{x({to:"/projects/$projectId/folders/$folderId",params:{projectId:s,folderId:e}})}}),()=>ue()),[i,s,P,T,l,a,r,c,pe,ue,x]);let{data:J,fetchNextPage:ge,hasNextPage:he,isFetchingNextPage:me,isLoading:Ke}=pt({queryKey:l?["projects",s,"recently-deleted","folder"]:a?["projects",s,"recents","folder"]:["search",i,r,"folder",j,D,F],queryFn:async({pageParam:e})=>{if(l||F||a){if(l){let d=await A.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:s},query:{assetType:"folder",after:e}});if(!d.ok)throw Error("failed to fetch recently deleted folders");return await d.json()}return{data:[],pageInfo:{total:0}}}if(K)return{data:[],pageInfo:{total:0}};let n=await A.api.folders[":folderId"].search.$post({param:{folderId:r},json:{assetType:"folder",after:e,recursively:!1,sort:D,conditions:[]}});if(!n.ok)throw Error("failed to search folders");return await n.json()},enabled:!K&&!a,initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{data:Y,fetchNextPage:ye,hasNextPage:xe,isFetchingNextPage:Se,isLoading:Qe}=pt({queryKey:l?["projects",s,"recently-deleted","file"]:a?["projects",s,"recents","file"]:["search",i,r,"file",j,D,F],queryFn:async({pageParam:e})=>{if(l){let d=await A.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:s},query:{assetType:"file",after:e}});if(!d.ok)throw Error("failed to fetch recently deleted files");return await d.json()}if(a){let d=await A.api.projects[":projectId"].recents.$get({param:{projectId:s},query:{after:e,first:"20"}});if(!d.ok)throw Error("failed to fetch recent files");return await d.json()}let n=await A.api.folders[":folderId"].search.$post({param:{folderId:r},json:{assetType:"file",after:e,recursively:K||F,conditions:j,sort:D}});if(!n.ok)throw Error("failed to search files");return await n.json()},initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),I=J?.pages.flatMap((e)=>e.data??[])??[],g=Y?.pages.flatMap((e)=>e.data??[])??[],Fe=(!K&&!a?Ke:!1)||Qe,we=J?.pages[0]?.pageInfo?.total,be=Y?.pages[0]?.pageInfo?.total,ve=J?.pages[0]?.pageInfo?.totalSize,Ie=Y?.pages[0]?.pageInfo?.totalSize,ee=()=>{R(new Set),z(null),E(null)},{dragState:q,handleDragStart:Oe,handleDragEnd:We}=jl({teamId:i,projectId:s,assetId:r,folders:I,files:g,selectedIds:p,onClearSelection:ee}),te=N(()=>{if(p.size!==1)return null;let e=Array.from(p)[0];return g.find((d)=>d.id===e)||null},[p,g]),Ce=(e)=>{if(l)return;if(e.type==="folder")G([]),x({to:"/projects/$projectId/folders/$folderId",params:{projectId:s,folderId:e.id}});else x({to:"/projects/$projectId/files/$fileId",params:{projectId:s,fileId:e.versionStack?e.versionStack.id:e.id},search:{version:void 0}})},Pe=(e,n)=>{let d=n.metaKey||n.ctrlKey;if(n.shiftKey&&H){let ne=[...I,...g].find((m)=>m.id===H);if(ne){let m=ke(ne,e,H,I,g,p);if(m){R(m),z(e);return}}}if(d){let w=new Set(p);if(w.has(e.id)){if(w.delete(e.id),R(w),_?.id===e.id){let m=[...I,...g].find((Ue)=>w.has(Ue.id));z(m||null),E(m?m.id:null)}}else w.add(e.id),R(w),E(e.id),z(e);return}R(new Set([e.id])),E(e.id),z(e)},se=(e,n,d)=>{U({param:{fileId:e},json:[{key:n,value:d}]},{onSuccess:()=>{b.invalidateQueries({queryKey:["folders",r,"children",{assetType:"file"}]}),b.invalidateQueries({queryKey:["search",i,r]})}})};if(Lo())return t(ql,{teamId:i,projectId:s,assetId:r,folders:I,files:g,totalFolders:we,totalFiles:be,totalFoldersSize:ve,totalFilesSize:Ie,selectedItem:_,selectedIds:p,onItemSelect:Pe,onItemDoubleClick:Ce,onSaveField:se,onClearSelection:ee,fetchNextFoldersPage:ge,hasNextFoldersPage:he||!1,isFetchingNextFoldersPage:me,fetchNextFilesPage:ye,hasNextFilesPage:xe||!1,isFetchingNextFilesPage:Se,isRecentlyDeleted:l,isRecents:a,isLoading:Fe,rootFolderId:c});return o($n,{modifiers:[ua.configure({anchor:{x:0,y:0}})],plugins:(e)=>e.map((n)=>{if(n===_s)return _s.configure({dropAnimation:null});if(typeof n==="object"&&n!==null&&"plugin"in n&&n.plugin===_s)return _s.configure({dropAnimation:null});return n}),sensors:l||a||!k?[]:[_n.configure({activationConstraints:[new Dr.Distance({value:10})]})],onDragStart:Oe,onDragEnd:We,children:[t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{ref:Ee,className:"flex flex-1 overflow-hidden relative",children:[!de&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>$e(!0)}),(!ce||V)&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>{Te(!0),lr.getState().setIsChatbotOpen(!1)}}),!de&&o(L,{children:[t("div",{className:"bg-background",style:{width:Ne},children:t(br,{teamId:i,projectId:s,projectName:P,rootFolderId:c,dragState:q,ancestorFolders:T?.ancestorFolders??[]})}),t(Ir,{onResize:(e)=>{Me((n)=>Math.max(180,Math.min(400,n+e)))},className:"hidden md:block"})]}),t(Ci,{teamId:i,projectId:s,assetId:r,folders:I,files:g,totalFolders:we,totalFiles:be,totalFoldersSize:ve,totalFilesSize:Ie,selectedItem:_,selectedIds:p,onItemSelect:Pe,onItemDoubleClick:Ce,onSaveField:se,displayStyle:fe,onClearSelection:ee,fetchNextFoldersPage:ge,hasNextFoldersPage:he||!1,isFetchingNextFoldersPage:me,fetchNextFilesPage:ye,hasNextFilesPage:xe||!1,isFetchingNextFilesPage:Se,isRecentlyDeleted:l,isRecents:a,isLoading:Fe,filterConditions:j,onFilterChange:G,sort:D,onSortChange:De,dragState:q,collection:f,onUpdateCollection:O,rootFolderId:c}),(!ce||V&&!ie)&&o(L,{children:[t(Ir,{onResize:(e)=>{ze((n)=>Math.max(240,Math.min(600,n-e)))},className:"hidden md:block"}),t("div",{style:{width:Ae},className:"bg-background flex flex-col flex-shrink-0",children:V&&!ie?t(Ei,{projectId:s,contextAssetId:r}):te?t(Ii,{teamId:i,projectId:s,file:te,onSaveField:(e,n)=>se(te.id,e,n),members:Le,hideAnnotationControl:!0}):t("div",{className:"flex h-full items-center justify-center p-4 text-center text-sm text-muted-foreground",children:GC()})})]})]})}),t(Xc,{children:q?.isActive?t("div",{className:C("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",fe==="list"&&"w-30 h-[40px] px-0 flex-none overflow-hidden justify-center"),style:{transform:"translate(0px, 0px)"},children:o("span",{children:["Moving ",q.itemCount," item",q.itemCount!==1?"s":""]})}):null})]})}
|
|
2
|
-
export{Gn};
|
package/bin/chunk-k9cgfzgk.js
DELETED
package/bin/chunk-nbfcknsq.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,S,t,Z,ze,A,lt,St,rm}from"./chunk-vsefjzzj.js";import"./chunk-62sj29j8.js";import"./chunk-6v6c2921.js";import"./chunk-c4wnhekn.js";import"./chunk-0e8xg41c.js";import{ja}from"./chunk-m2dtwvg0.js";import"./chunk-xyk7vk42.js";import"./chunk-z7p7s55t.js";import{nr}from"./chunk-g21k2awz.js";import"./chunk-rsdpycdr.js";import"./chunk-yd1k76na.js";import"./chunk-3584j9fc.js";import"./chunk-dvkzhpxx.js";S();function l(){let{projectId:e}=p.useParams(),{teamId:r,ensureTeamIdForProject:i}=lt();h(()=>{i(e)},[e,i]);let{data:a}=nr(rm(e)),o=a?.rootFolder,{data:d}=Z({queryKey:["folders",o],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:o}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!o});if(!r||!o||!d)return t(St,{});return t(ja,{teamId:r,projectId:e,projectName:a.name??"",assetId:o,rootFolderId:o,isRoot:!0})}var p=ze("/projects/$projectId/agentsmd")({component:l});export{p as Route};
|
package/bin/chunk-phzemmmy.js
DELETED
package/bin/chunk-qcf3tb72.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,S,t,Z,ze,A,lt,St,tm}from"./chunk-vsefjzzj.js";import"./chunk-1dt700ws.js";import"./chunk-yfm9xwes.js";import"./chunk-zp5b1mb6.js";import"./chunk-3m6ch1x5.js";import"./chunk-62sj29j8.js";import"./chunk-6v6c2921.js";import"./chunk-c4wnhekn.js";import"./chunk-ehhsezbj.js";import"./chunk-dcmfn4hs.js";import"./chunk-rh1hs8wa.js";import"./chunk-vre5andt.js";import"./chunk-s978ftze.js";import"./chunk-0e8xg41c.js";import{Gn}from"./chunk-gzzfta3s.js";import{nr}from"./chunk-g21k2awz.js";import"./chunk-rsdpycdr.js";import"./chunk-3584j9fc.js";import"./chunk-s9svhjv6.js";import"./chunk-m5cpsm28.js";import"./chunk-dvkzhpxx.js";import"./chunk-4mq874m3.js";import"./chunk-t597y392.js";import"./chunk-4437dnfa.js";S();function i(){let{projectId:o}=l.useParams(),{teamId:r,ensureTeamIdForProject:a}=lt();h(()=>{a(o)},[o,a]);let{data:n}=nr(tm(o)),e=n?.rootFolder,{data:s}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!s)return t(St,{});return t(Gn,{teamId:r,projectId:o,projectName:n.name??"",assetId:"recently-deleted",rootFolderId:e})}var l=ze("/projects/$projectId/recently-deleted")({component:i});export{l as Route};
|
package/bin/chunk-rgfh5apb.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,S,t,Z,ze,A,lt,St,im}from"./chunk-vsefjzzj.js";import"./chunk-1dt700ws.js";import"./chunk-yfm9xwes.js";import"./chunk-zp5b1mb6.js";import"./chunk-3m6ch1x5.js";import"./chunk-62sj29j8.js";import"./chunk-6v6c2921.js";import"./chunk-c4wnhekn.js";import"./chunk-ehhsezbj.js";import"./chunk-dcmfn4hs.js";import"./chunk-rh1hs8wa.js";import"./chunk-vre5andt.js";import"./chunk-s978ftze.js";import"./chunk-0e8xg41c.js";import{Gn}from"./chunk-gzzfta3s.js";import{nr}from"./chunk-g21k2awz.js";import"./chunk-rsdpycdr.js";import"./chunk-3584j9fc.js";import"./chunk-s9svhjv6.js";import"./chunk-m5cpsm28.js";import"./chunk-dvkzhpxx.js";import"./chunk-4mq874m3.js";import"./chunk-t597y392.js";import"./chunk-4437dnfa.js";S();function l(){let{projectId:o,folderId:n}=c.useParams(),{teamId:r,ensureTeamIdForProject:a}=lt();h(()=>{a(o)},[o,a]);let{data:s}=nr(im(o)),e=s?.rootFolder,{data:i}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!i)return t(St,{});return t(Gn,{teamId:r,projectId:o,projectName:s.name??"",assetId:n,rootFolderId:e})}var c=ze("/projects/$projectId/folders/$folderId")({component:l});export{c as Route};
|
package/bin/chunk-rh1hs8wa.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h,y,u,S,L,t,o,Q,B,A,O,Vr,ve,vt,wt,Ls,pe,E,he,ge,Ae,K,De,na,sh,at,Uc,zc,gh,bb,vb,Fh,Lh,Zh,op,sp,ip,ap,xl,dg,up,dp,wg,xg,Cp,$g,uA,jp,YT,Gp,Vp,Je,Xe,et,tt,rt,nt,ot,st,ue,ae,fe,qe,le,It,q,Dt,Pt,M,Wr,yn,OA}from"./chunk-vsefjzzj.js";import{au,lu,cu,uu,du}from"./chunk-yfm9xwes.js";import{Zo}from"./chunk-1dt700ws.js";import{lo}from"./chunk-4mq874m3.js";S();var Se=[];function ql({teamId:r,projectId:D,assetId:m,folders:a,files:l,totalFolders:Me,totalFiles:Re,totalFoldersSize:ze,totalFilesSize:Ue,selectedItem:J,selectedIds:w,onItemSelect:X,onItemDoubleClick:Y,onSaveField:Be,onClearSelection:$e,fetchNextFoldersPage:Z,hasNextFoldersPage:ee,isFetchingNextFoldersPage:b,fetchNextFilesPage:te,hasNextFilesPage:oe,isFetchingNextFilesPage:x,isRecentlyDeleted:k=!1,isRecents:C=!1,isLoading:se=!1,isShareView:U=!1,isPublic:ie=!1,shareId:Oe,allowDownload:re=!0}){let d=Q(),{canEdit:N,canAdmin:We}=Dt(D),ne=y(null),de=y(null),[W,je]=u(!0),[j,Qe]=u(!0),[He,_]=u(!1),[F,ce]=u(""),[Ke,H]=u(!1),me=Me??a.length,we=Re??l.length,ye=ze??(a.length>0?a.reduce((e,s)=>e+(s.sizeByte||0),0):-1),be=Ue??(l.length>0?l.reduce((e,s)=>e+(s.sizeByte||0),0):-1),Le=ye>-1,Pe=be>-1,xe=(e,s)=>{if(s)return e===1?sp({count:e}):op({count:e});else return e===1?ap({count:e}):ip({count:e})},{editingItemId:ke,setEditingItemId:Ce,handleAction:Ne,onRenameSubmit:_e,isDeleteDialogOpen:Ve,setIsDeleteDialogOpen:Ge,confirmDelete:Ye,isDownloadDialogOpen:Ze,setIsDownloadDialogOpen:P,isLoadingLinks:I,resolvedFiles:Fe,startDownload:it}=du({teamId:r,projectId:D,assetId:m,folders:a,files:l,selectedIds:w,isPublic:ie,shareId:Oe}),{ref:lt,inView:Ie}=Pt();h(()=>{if(Ie){if(ee&&!b)Z();else if(oe&&!x)te()}},[Ie,ee,b,oe,x,Z,te]);let dt=yn((e)=>e.startTask),ct=A.api.teams[":teamId"].upload.tasks.$post,{mutate:mt}=B({mutationFn:async(e)=>{let s=await ct(e);if(!s.ok)throw Error("Failed to create upload task");return await s.json()},onMutate:()=>({files:[...Se]}),onSuccess:async(e,s,n)=>{let p=n?.files||[],f=p.map((i)=>{let v=e.createdAssets?.find((c)=>c.tempId===i.id),R=e.presignedUrls?.find((c)=>c.id===i.id);return{fileId:v?.assetId||R?.fileId||i.id,name:i.file.name,size:i.file.size}}).filter((i)=>!!i.fileId),g=p.filter((i)=>!i.file.name.startsWith(".")),T=g.length===1?g[0].file.name:`${g.length} Items`;if(e.taskId)dt(e.taskId,T,f);d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]}),await lu({files:p,taskId:e.taskId,teamId:r,storageBackend:e.storageBackend||"local",createdAssets:e.createdAssets,presignedUrls:e.presignedUrls,onFileFinished:async()=>{await d.invalidateQueries({queryKey:["search",r,m]})}}),d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]})}}),Te=(e)=>{if(!e||e.length===0)return;let s=[],n=[],p=new Map;for(let f of e){let g=(f.webkitRelativePath||f.name).split("/");if(g.some((z)=>z.startsWith(".")))continue;let T=g.pop(),i=n,v="";for(let z of g)if(v=`${v}/${z}`,!p.has(v)){let G=[],yt={name:z,type:"folder",id:Zo(),children:G,size:0};i.push(yt),p.set(v,G),i=G}else i=p.get(v);let R={file:f,id:Zo()};s.push(R);let c=f.type;if(T.toLowerCase().endsWith(".wma")&&c?.startsWith("video/"))c=c.replace(/^video\//,"audio/");i.push({name:T,size:f.size,type:"file",id:R.id,children:[],mediaType:c})}Se=s,mt({param:{teamId:r},json:{parentId:m,files:n}})},pt=A.api.folders.$post,{mutate:ut,isPending:Ee}=B({mutationFn:async(e)=>{let s=await pt({json:{name:e,parentId:m}});if(!s.ok)throw Error("Failed to create folder");return await s.json()},onSuccess:()=>{M.success(xl()),_(!1),ce(""),d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["folders"]})},onError:(e)=>{M.error(`Error: ${e.message}`)}}),{mutate:ft,isPending:V}=B({mutationFn:async()=>{let e=await A.api.projects[":projectId"]["empty-trash"].$post({param:{projectId:D}});if(!e.ok)throw Error("Failed to empty trash");return await e.json()},onSuccess:()=>{M.success(YT()),d.invalidateQueries({queryKey:["projects",D,"recently-deleted"]}),$e(),H(!1)},onError:(e)=>{M.error(`Error: ${e.message}`)}}),gt=(e)=>{if(e.preventDefault(),!F.trim())return;ut(F.trim())},ht=!se&&a.length===0&&l.length===0&&!b&&!x;return o("div",{className:"flex-1 flex flex-col min-h-0 bg-background overflow-hidden relative",children:[N&&o(L,{children:[t("input",{type:"file",ref:ne,multiple:!0,className:"hidden",onChange:(e)=>{if(e.target.files)Te(e.target.files)}}),t("input",{type:"file",ref:de,multiple:!0,webkitdirectory:"true",className:"hidden",onChange:(e)=>{if(e.target.files)Te(e.target.files)}})]}),k&&o("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border text-sm shrink-0",children:[o("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t(Vr,{className:"h-4 w-4 text-amber-500 shrink-0"}),t("span",{className:"text-xs",children:Cp()})]}),We&&t(E,{variant:"destructive",size:"sm",disabled:V||a.length===0&&l.length===0,onClick:()=>H(!0),className:"h-7 px-2.5 text-xs font-medium bg-destructive/10 text-destructive border border-destructive/20 hover:bg-destructive hover:text-destructive-foreground",children:"Delete"})]}),o("div",{className:"flex-1 overflow-y-auto min-h-0 p-3 pb-24",children:[se&&a.length===0&&l.length===0?t(OA,{}):o("div",{className:"max-w-lg mx-auto w-full",children:[me>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>je(!W),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[W?t(ve,{className:"h-4 w-4"}):t(vt,{className:"h-4 w-4"}),o("span",{children:[xe(me,!1),Le?` • ${Wr(ye)}`:""]})]}),W&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:a.map((e)=>t(uu,{item:e,isSelected:J?.id===e.id,isChecked:w.has(e.id),isEditing:ke===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>_e(e,s),onFinishEditing:()=>Ce(null),onAction:(s,n)=>Ne(s,n),isRecentlyDeleted:k,isRecents:C,selectedCount:w.size,canEdit:N,isShareView:U,allowDownload:re},e.id))})]}),we>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>Qe(!j),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[j?t(ve,{className:"h-4 w-4"}):t(vt,{className:"h-4 w-4"}),o("span",{children:[xe(we,!0),Pe?` • ${Wr(be)}`:""]})]}),j&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:l.map((e)=>t(cu,{teamId:r,item:e,isSelected:J?.id===e.id,isChecked:w.has(e.id),isEditing:ke===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>_e(e,s),onFinishEditing:()=>Ce(null),onSaveField:(s,n)=>Be?.(e.id,s,n),fields:[],onAction:(s,n)=>Ne(s,n),isRecentlyDeleted:k,isRecents:C,selectedCount:w.size,canEdit:N,isShareView:U,allowDownload:re},e.id))})]})]}),ht&&t("div",{className:"flex flex-col items-center justify-center h-64 text-sm text-muted-foreground p-6 text-center",children:C?o("div",{className:"flex flex-col items-center gap-2",children:[t(Ls,{className:"h-10 w-10 text-muted-foreground/40 mb-1"}),t("p",{className:"font-medium text-foreground",children:up()}),t("p",{className:"text-xs text-muted-foreground",children:dp()})]}):t("span",{children:jp()})}),t("div",{ref:lt,className:"py-4 flex justify-center items-center min-h-6",children:(b||x)&&t(O,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]}),N&&!k&&!C&&!U&&!ie&&t("div",{className:"fixed bottom-6 right-6 z-30",children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(E,{size:"icon",className:"h-14 w-14 rounded-full bg-primary text-primary-foreground shadow-lg shadow-primary/25 hover:bg-primary/90 flex items-center justify-center","aria-label":"Actions",children:t(pe,{className:"h-6 w-6"})})}),o(Ae,{align:"end",side:"top",className:"w-48 mb-2",children:[o(K,{onClick:()=>ne.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(lo,{className:"h-4 w-4"}),t("span",{children:Gp()})]}),o(K,{onClick:()=>de.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(lo,{className:"h-4 w-4"}),t("span",{children:Vp()})]}),o(K,{onClick:()=>_(!0),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(au,{className:"h-4 w-4"}),t("span",{children:xl()})]})]})]})}),t(ue,{open:He,onOpenChange:_,children:t(ae,{className:"sm:max-w-md",children:o("form",{onSubmit:gt,children:[o(fe,{children:[t(le,{children:xl()}),t(It,{children:Lh()})]}),t("div",{className:"py-4",children:t(q,{autoFocus:!0,placeholder:Lh(),value:F,onChange:(e)=>ce(e.target.value)})}),o(qe,{children:[t(E,{type:"button",variant:"outline",onClick:()=>_(!1),children:De()}),o(E,{type:"submit",disabled:!F.trim()||Ee,children:[Ee?t(O,{className:"h-4 w-4 animate-spin mr-2"}):null,na()]})]})]})})}),t(Je,{open:Ve,onOpenChange:Ge,children:o(Xe,{children:[o(et,{children:[t(rt,{children:zc()}),t(nt,{children:Uc()})]}),o(tt,{children:[t(st,{children:De()}),t(ot,{onClick:()=>Ye(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:at()})]})]})}),t(Je,{open:Ke,onOpenChange:H,children:o(Xe,{children:[o(et,{children:[t(rt,{children:vb()}),t(nt,{children:bb()})]}),o(tt,{children:[t(st,{children:De()}),t(ot,{onClick:(e)=>{e.preventDefault(),ft()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:V,children:V?"Deleting...":at()})]})]})}),t(ue,{open:Ze,onOpenChange:P,children:o(ae,{className:"sm:max-w-md",children:[o(fe,{children:[t(le,{children:I?wg():sh()}),t(It,{children:I?$g():Fh()})]}),I?o("div",{className:"space-y-4 py-6 flex flex-col items-center justify-center",children:[t(O,{className:"h-8 w-8 animate-spin text-primary"}),t("span",{className:"text-sm font-medium text-muted-foreground mt-2",children:xg()})]}):o("div",{className:"space-y-4 py-2",children:[t("div",{className:"text-sm text-muted-foreground",children:gh({count:Fe.length})}),o("div",{className:"flex items-start gap-3 p-3 text-sm rounded-lg bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300 border border-amber-200 dark:border-amber-900/30",children:[t(Vr,{className:"h-5 w-5 shrink-0 mt-0.5"}),o("div",{children:[t("p",{className:"font-semibold",children:dg()}),t("p",{className:"mt-0.5 text-xs text-amber-700/90 dark:text-amber-400/90",children:Zh()})]})]})]}),t(qe,{children:!I?o(L,{children:[t(E,{variant:"outline",onClick:()=>P(!1),children:De()}),o(E,{onClick:it,className:"gap-2",disabled:Fe.length===0,children:[t(wt,{className:"h-4 w-4"}),uA()]})]}):t(E,{variant:"outline",onClick:()=>P(!1),children:De()})})]})})]})}
|
|
2
|
-
export{ql};
|
package/bin/chunk-rpxayeqd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,y,u,S,L,t,o,Q,Ia,Z,B,Re,Un,ze,A,O,tr,C,E,De,at,Uc,zc,rb,gd,Na,tv,Dh,Fo,bC,xo,Je,Xe,et,tt,rt,nt,ot,st,ue,ae,fe,qe,le,q,lt,Pt,M,un,zr,$t,lr,Ar,Lo,NA}from"./chunk-vsefjzzj.js";import"./chunk-zp5b1mb6.js";import"./chunk-3m6ch1x5.js";import{Yr}from"./chunk-62sj29j8.js";import"./chunk-6v6c2921.js";import{Ei}from"./chunk-c4wnhekn.js";import{es,Hl,rs,vs}from"./chunk-1dt700ws.js";import{Ul,zl}from"./chunk-ehvyq65t.js";import"./chunk-vre5andt.js";import{Ii}from"./chunk-s978ftze.js";import{Ir}from"./chunk-0e8xg41c.js";import"./chunk-3584j9fc.js";import"./chunk-s9svhjv6.js";import"./chunk-m5cpsm28.js";import"./chunk-dvkzhpxx.js";import"./chunk-t597y392.js";import"./chunk-4437dnfa.js";S();var kt=({item:n})=>{if(n.preview?.thumbnailUrl)return t("img",{src:n.preview.thumbnailUrl,alt:"Preview",className:"w-full h-full object-cover"});if(n.preview?.proxyType==="audio"||n.proxyType==="audio")return t("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:t(es,{className:"w-5 h-5 text-muted-foreground"})});return t("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:t(tr,{className:"w-5 h-5 text-muted-foreground"})})},Me=({projectId:n,currentAssetId:s,parentFolderId:x,initialFiles:d,initialNextCursor:k})=>{let{ref:a,inView:T}=Pt({threshold:0,rootMargin:"200px"}),b=y(null),N=y(!0),[c,p]=u(d),[f,U]=u(k),[W,Y]=u(!!k),[V,g]=u(!1);return h(()=>{p(d),U(k),Y(!!k),N.current=!0},[d,k]),h(()=>{(async()=>{if(!f||V||!T||!W)return;g(!0);try{let I=await A.api.folders[":folderId"].search.$post({param:{folderId:x},json:{assetType:"file",after:f,first:200,recursively:!1,conditions:[]}});if(!I.ok)throw Error("Failed to fetch next page");let P=await I.json(),X=P.data||[];p((G)=>[...G,...X]),U(P.pageInfo?.cursor||void 0),Y(!!P.pageInfo?.cursor&&X.length>0)}catch(I){console.error("Error fetching next page:",I)}finally{g(!1)}})()},[T,f,W,V,x]),h(()=>{if(c.some((I)=>I?.id===s)&&b.current)if(N.current)b.current.scrollIntoView({block:"center",inline:"center",behavior:"auto"}),N.current=!1;else b.current.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[c,s]),t("div",{className:"h-24 md:h-full w-full md:w-24 bg-gray-100 dark:bg-gray-950 flex flex-row md:flex-col flex-shrink-0 select-none",children:o("div",{className:"flex-1 overflow-x-auto overflow-y-hidden md:overflow-y-auto md:overflow-x-hidden px-4 md:px-0 py-2 md:py-4 flex flex-row md:flex-col items-center gap-3 no-scrollbar",children:[c.map((m)=>{if(!m)return null;let I=m.id===s;return t("div",{ref:m.id===s?b:null,className:"flex-shrink-0",children:o(Un,{to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:m.id},search:{version:void 0},className:C("rounded-lg border overflow-hidden flex items-center justify-center transition-all bg-muted/30 block relative",I?"w-[62px] h-[62px] opacity-100":"w-[52px] h-[52px] opacity-60 hover:opacity-100"),children:[t(kt,{item:m}),m.agent&&t("span",{className:"absolute top-1 right-1 z-10 pointer-events-none select-none rounded bg-black/60 px-1 py-0.5 text-[10px] font-medium leading-none text-white",title:m.agent.name,"data-testid":"carousel-agent-badge",children:"AI"})]})},m.id)}),W&&t("div",{ref:a,className:"px-2 md:px-0 py-2 md:py-4 flex justify-center items-center h-full md:w-full flex-shrink-0",children:V&&t(O,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})})};S();function At(){let{projectId:n,fileId:s}=Ne.useParams(),x=Ne.useSearch(),{version:d,start:k}=x,a=d||s,{cmpLeft:T,cmpRight:b}=x,N=x.cmpActive??"left",c=!!x.compare&&!!T&&!!b,p=y(null),{teamId:f,ensureTeamIdForProject:U}=lt(),[W,Y]=u(360),[V,g]=u([]),{fileViewRightSidebarCollapsed:m}=$t(),{isChatbotOpen:I}=lr(),P=Ar((e)=>Boolean(e.metadata["appearance.hideAgent"])),[X,G]=u(0),[he,z]=u(null),[ge,Le]=u(null),[Ee,ye]=u(void 0),[_,ne]=u({show:!1,files:[],nextCursor:void 0,folderId:void 0}),Ve=A.api.files[":fileId"].metadata.$patch,{mutate:Pe}=B({mutationFn:async(e)=>{let r=await Ve(e);if(!r.ok)throw Error("Failed to patch metadata");return await r.json()}}),J=Q(),{members:_e,fetchProjectMembers:Ie}=zr(),Ke=Lo();h(()=>{U(n)},[n,U]),h(()=>{if(n)Ie(n,!0)},[n,Ie]),h(()=>{if(n&&s)A.api.projects[":projectId"].recents.view.$post({param:{projectId:n},json:{assetId:s}}).catch(()=>{})},[n,s]);let{data:ve,isLoading:Oe,isError:He,isFetching:Qe}=Z({queryKey:["files",s],queryFn:async()=>{let e=await A.api.files[":fileId"].$get({param:{fileId:s}});if(!e.ok)throw Error("Failed to fetch stack");return await e.json()},enabled:!!f,placeholderData:Ia}),{data:Be,isLoading:Ue,isError:We,isFetching:Ge}=Z({queryKey:["files",d],queryFn:async()=>{let e=await A.api.files[":fileId"].$get({param:{fileId:d}});if(!e.ok)throw Error("Failed to fetch version");return await e.json()},enabled:!!f&&!!d,placeholderData:Ia}),{data:Ye}=Z({queryKey:["version_stacks",s,"versions"],queryFn:async()=>{let e=await A.api.version_stacks[":stackId"].versions.$get({param:{stackId:s}});if(!e.ok)throw Error("Failed to fetch versions");return await e.json()},enabled:!!n&&!!s&&(!!d||c)}),{data:j}=Z({queryKey:["projects",n],queryFn:async()=>{let e=await A.api.projects[":projectId"].$get({param:{projectId:n}});if(!e.ok)throw Error("Failed to fetch project");return await e.json()}}),v=Re(),{setProjectState:we,clearProjectState:xe}=un(),Ze=Oe||!!d&&Ue,it=He||!!d&&We,ct=Qe||!!d&&Ge,i=Be||ve,F=d?Ye:ve?.versionStack?.versions,l=i?.ancestorFolders?.[0]?.id??j?.rootFolder??"",[re,ee]=u(!1),[te,be]=u(""),se=y(null),ie=y(!1),[dt,ce]=u(!1),ft=A.api.files[":fileId"].$put,{mutate:pt,mutateAsync:ut,isPending:Fe}=B({mutationFn:async(e)=>{let r=await ft(e);if(!r.ok)throw Error("Failed to rename file");return await r.json()},onSuccess:()=>{J.invalidateQueries({queryKey:["files"]}),J.invalidateQueries({queryKey:["version_stacks"]}),M.success(bC?.()||"Renamed successfully"),ee(!1)},onError:()=>{M.error(tv?.()||"Failed to rename")}}),mt=A.api.files.$delete,{mutate:ht,mutateAsync:gt,isPending:ke}=B({mutationFn:async(e)=>{if(!(await mt(e)).ok)throw Error("Failed to delete file")},onSuccess:()=>{if(J.invalidateQueries({queryKey:["files"]}),J.invalidateQueries({queryKey:["version_stacks"]}),M.success(rb?.()||"Deleted"),ce(!1),l&&l!==j?.rootFolder)v({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:l}});else v({to:"/projects/$projectId",params:{projectId:n}})},onError:()=>{M.error(Na?.()||"Failed to delete")}}),yt=(e)=>{if(e?.preventDefault(),!te.trim()||!a)return;pt({param:{fileId:a},json:{name:te.trim()}})},It=()=>{if(!a)return;ht({json:{ids:[a]}})};h(()=>{if(i&&j&&f)we({teamId:f,projectId:n,projectName:j.name??"",ancestorFolders:i.ancestorFolders??[],currentAsset:{id:a||s,name:i.name,type:"file",version:F?F.find((e)=>e.id===a)?.version??F.length:void 0,proxyType:i.proxyType},isRootFolder:!1,fileId:s,downloadInfo:{originalKey:i.media?.original?.key,videoTranscodes:i.media?.videoTranscodes?.map((e)=>({key:e.key,width:e.width,height:e.height,resolution:e.resolution,hdr:e.hdr}))},versions:F,compareMode:c,canCompareVersions:(F?.length??0)>=2,onCompareVersions:()=>{let e=Hl(F);if(!e)return;v({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,version:void 0,compare:!0,cmpLeft:e.left.id,cmpRight:e.right.id,cmpActive:"left"})})},onFolderClick:(e)=>{v({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:e}})},onRename:()=>{ie.current=!1,be(i?.name??""),ee(!0)},onDelete:()=>{ce(!0)}});return()=>xe()},[f,n,j,i,F,a,s,c,we,xe,v]),h(()=>{if(!re)return;let e=setTimeout(()=>{ie.current=!0},1000);return()=>clearTimeout(e)},[re]);let vt=()=>{if(ie.current)return;setTimeout(()=>{if(se.current)vs(se.current)},0)};if(h(()=>{if(!l||!a)return;if(_.folderId===l)return;let e=!0;return(async()=>{try{let w="",D=!1,R=[],pe=void 0;for(let Se=0;Se<5;Se++){let Te=await A.api.folders[":folderId"].search.$post({param:{folderId:l},json:{assetType:"file",after:w,first:200,recursively:!1,conditions:[]}});if(!Te.ok)throw Error("Failed to search parent folder for carousel");let H=await Te.json(),me=H.data||[];if(R.push(...me),me.some((oe)=>oe.id===a)){if(D=!0,pe=H.pageInfo?.cursor||void 0,H.pageInfo?.cursor)try{let oe=await A.api.folders[":folderId"].search.$post({param:{folderId:l},json:{assetType:"file",after:H.pageInfo.cursor,first:200,recursively:!1,conditions:[]}});if(oe.ok){let $e=await oe.json(),Ft=$e.data||[];R.push(...Ft),pe=$e.pageInfo?.cursor||void 0}}catch{}break}if(!H.pageInfo?.cursor||me.length<200)break;w=H.pageInfo.cursor}if(e)if(D)ne({show:!0,files:R,nextCursor:pe,folderId:l});else ne({show:!1,files:[],nextCursor:void 0,folderId:l})}catch(w){if(console.error(w),e)ne({show:!1,files:[],nextCursor:void 0,folderId:l})}})(),()=>{e=!1}},[l,a,_.folderId]),h(()=>{G(0),z(null),g([])},[i?.id]),h(()=>{z(null),g([])},[ge?.id]),h(()=>{Yr.getState().reset(),Yr.getState().setIsDrawing(!1),g([]),z(null)},[a]),Ze&&!i)return t(NA,{});if(it||!i||!j||!f)return t("div",{children:Dh()});let K=c?ge:i,Ae=K?.id??a,je=(e,r)=>{if(!f)return;Pe({param:{fileId:Ae},json:[{key:e,value:r}]},{onSuccess:()=>{J.invalidateQueries({queryKey:["files",Ae]})}})},de=(e)=>{v({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,...e})})},wt=()=>{de({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:N==="left"?T:b})},xt=(e)=>{z(e.id||null);let r=e.annotations;if(r&&r.length>0)g(r);else g([]);if(c){if(e.second!==null&&e.second!==void 0)ye({second:e.second,nonce:Date.now()});return}if(e.second!==null&&e.second!==void 0)p.current?.seekTo(e.second),p.current?.pause();else if(r&&r.length>0)p.current?.pause()},bt=(e)=>{z(e.id||null);let w=e.details,D=w?.annotations;if(D&&D.length>0)g(D);else g([]);let R=w?.position?.type==="time"?w.position.seconds:w?.position?.type==="page"?w.position.page:void 0;if(c){if(R!==void 0)ye({second:R,nonce:Date.now()});return}if(R!==void 0)p.current?.seekTo(R),p.current?.pause();else if(D&&D.length>0)p.current?.pause()},Ce=()=>{g([]),z(null)};if(Ke&&!c)return t(Ul,{projectId:n,teamId:f,fileId:s,file:i,projectInfo:j,ancestorFolders:i.ancestorFolders??[],parentFolderId:l,versions:F,activeFileId:a,startTime:k,siblingFiles:_.files,onNavigateToFile:(e)=>{v({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:e}})},onNavigateBack:()=>{if(l&&l!==j?.rootFolder)v({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:l}});else v({to:"/projects/$projectId",params:{projectId:n}})},onSelectVersion:(e)=>{v({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,version:e})})},onRenameFile:async(e)=>{await ut({param:{fileId:a},json:{name:e}})},onDeleteFile:async()=>{await gt({json:{ids:[a]}})},onSaveField:je});return o("div",{className:"h-full flex flex-1 flex-col bg-background",children:[o("div",{className:"h-full flex flex-1 overflow-hidden",children:[o("div",{className:"flex-1 relative",children:[ct&&!c&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:t(O,{className:"h-8 w-8 animate-spin text-foreground"})}),c&&T&&b?t(zl,{versions:F??[],leftId:T,rightId:b,activeSide:N,annotations:V,seekRequest:Ee,onActiveSideChange:(e)=>de({cmpActive:e}),onSwitchVersion:(e,r)=>de(e==="left"?{cmpLeft:r}:{cmpRight:r}),onExit:wt,onActiveAssetChange:Le,onPlay:Ce,onTimeUpdate:G}):t(rs,{file:i,mediaControllerRef:p,onPlay:Ce,onTimeUpdate:G,annotations:V,startTime:k,children:_.show&&t(Me,{projectId:n,currentAssetId:a,parentFolderId:l,initialFiles:_.files,initialNextCursor:_.nextCursor})})]}),(!m||I&&!P)&&o(L,{children:[t(Ir,{onResize:(e)=>{Y((r)=>Math.max(300,Math.min(600,r-e)))},className:"hidden md:block"}),t("div",{style:{width:W},className:"flex-shrink-0 bg-background flex flex-col",children:I&&!P?t(Ei,{projectId:n,contextAssetId:a,file:K,currentTime:X,frameRate:K?.media?.metadata?.frameRate||30,startTimecode:K?.media?.metadata?.startTimecode,onTyping:()=>{if(c)return;p.current?.pause()},onSelectMessage:bt,selectedMessageId:he}):t(Ii,{teamId:f,projectId:n,file:K,onSaveField:je,members:_e,onCommentSelect:xt,currentTime:X,onTyping:()=>{if(c)return;p.current?.pause()},selectedCommentId:he,hideAnnotationControl:K?.proxyType==="audio"})})]})]}),t(ue,{open:re,onOpenChange:ee,children:t(ae,{children:o("form",{onSubmit:yt,children:[t(fe,{children:t(le,{children:Fo()})}),t("div",{className:"py-4",children:t(q,{ref:se,value:te,onChange:(e)=>be(e.target.value),placeholder:gd?.()||"Enter new name",onFocus:vt,autoFocus:!0})}),o(qe,{children:[t(E,{type:"button",variant:"outline",onClick:()=>ee(!1),children:De()}),o(E,{type:"submit",disabled:Fe||!te.trim(),children:[Fe&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),xo()]})]})]})})}),t(Je,{open:dt,onOpenChange:ce,children:o(Xe,{children:[o(et,{children:[t(rt,{children:zc?.()||"Delete Asset?"}),t(nt,{children:Uc?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),o(tt,{children:[t(st,{children:De()}),o(ot,{onClick:It,disabled:ke,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[ke&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),at()]})]})]})})]})}var Ne=ze("/projects/$projectId/files/$fileId")({component:At});export{Ne as Route};
|