@shumai-one/shumai 0.3.11 → 0.4.1
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-082zg4nr.js +307 -0
- package/bin/chunk-09pe07g6.js +7 -0
- package/bin/chunk-0qdzjcny.js +2 -0
- package/bin/chunk-0z1p2pvf.js +1 -0
- package/bin/{chunk-cmd0feyq.js → chunk-116p639c.js} +2 -2
- package/bin/{chunk-cyjh5qsk.js → chunk-13ypr8v0.js} +1 -1
- package/bin/{chunk-sepsqqdf.js → chunk-16txy3r1.js} +2 -2
- package/bin/{chunk-dyen2t1p.js → chunk-1vs91e4q.js} +2 -2
- package/bin/chunk-29e0mb43.js +1 -0
- package/bin/chunk-2a0egvsg.js +1 -0
- package/bin/chunk-2f35h4fn.js +2 -0
- package/bin/{chunk-tdp1jjv1.js → chunk-2jsjrqw4.js} +2 -2
- package/bin/chunk-2q7ew7yz.js +2 -0
- package/bin/{chunk-ps2hw0ps.js → chunk-2sc2jxd3.js} +1 -1
- package/bin/chunk-2vc6pw8q.js +2 -0
- package/bin/{chunk-f9ydhm8q.js → chunk-3gqdepkd.js} +2 -2
- package/bin/chunk-44370df5.js +4 -0
- package/bin/chunk-44xtwvd7.js +2 -0
- package/bin/{chunk-7t31qfw5.js → chunk-47r5b77s.js} +2 -2
- package/bin/chunk-4azttb3w.js +1 -0
- package/bin/{chunk-whm06pnc.js → chunk-4ee336e3.js} +1 -1
- package/bin/{chunk-qrhf20g2.js → chunk-4k2d8w9w.js} +2 -2
- package/bin/{chunk-kcg7d7pk.js → chunk-4yhd7bmp.js} +2 -2
- package/bin/chunk-4yybby29.js +2 -0
- package/bin/{chunk-0g0gt4bj.js → chunk-5395g4kq.js} +2 -2
- package/bin/{chunk-gx410cm2.js → chunk-5bkj2n94.js} +2 -2
- package/bin/{chunk-aq7q5e36.js → chunk-5c4h0t33.js} +2 -2
- package/bin/{chunk-byjze6hm.js → chunk-6nrynqdw.js} +2 -2
- package/bin/chunk-6tv7rm3x.js +2 -0
- package/bin/chunk-785kxysj.js +68 -0
- package/bin/{chunk-c16vvzdj.js → chunk-78cxvbjd.js} +1 -1
- package/bin/chunk-7g2k89gq.js +2 -0
- package/bin/chunk-7psq38hv.js +1 -0
- package/bin/{chunk-xsqk7ek2.js → chunk-7qzt5nhz.js} +1 -1
- package/bin/{chunk-b78s1cxz.js → chunk-7sf0gbbm.js} +2 -2
- package/bin/{chunk-9qytehed.js → chunk-7wvw67f3.js} +2 -2
- package/bin/chunk-7xcyn1ba.js +2 -0
- package/bin/{chunk-vvx62hp4.js → chunk-7zgvmn5q.js} +1 -1
- package/bin/{chunk-12r8a5ev.js → chunk-8pfgh13x.js} +2 -2
- package/bin/{chunk-xext4yvc.js → chunk-8rcfhfq5.js} +1 -1
- package/bin/{chunk-8qg6jjz4.js → chunk-8yt4m2pb.js} +2 -2
- package/bin/{chunk-y0k1f3gk.js → chunk-90tbc5f4.js} +2 -2
- package/bin/{chunk-mvkqjrcd.js → chunk-92yvt66q.js} +1 -1
- package/bin/chunk-93v3tm93.js +1 -0
- package/bin/{chunk-s04f76tb.js → chunk-9f83pnfc.js} +2 -2
- package/bin/chunk-a5b3aevg.js +2 -0
- package/bin/{chunk-0vqefpcw.js → chunk-af6m9p1d.js} +1 -1
- package/bin/chunk-ajryg2e2.js +1 -0
- package/bin/chunk-axb1f1ae.js +2 -0
- package/bin/chunk-b0cqsrse.js +9 -0
- package/bin/chunk-b27jgdsf.css +1 -0
- package/bin/{chunk-qz3kfrpr.js → chunk-bbar8rsh.js} +1 -1
- package/bin/{chunk-8bv8qsb8.js → chunk-be9a7kc6.js} +2 -2
- package/bin/{chunk-dwkv3bx5.js → chunk-bkbqvxfv.js} +2 -2
- package/bin/chunk-bwyph9a0.js +1 -0
- package/bin/{chunk-0xqf53hc.js → chunk-c43nmcfq.js} +1 -1
- package/bin/{chunk-4yke5y3z.js → chunk-c97vh5wb.js} +3 -3
- package/bin/{chunk-1dzby9bb.js → chunk-cerjktz2.js} +1 -1
- package/bin/chunk-cyvx7gcx.js +2 -0
- package/bin/{chunk-esa954t1.js → chunk-d6d1j7qq.js} +2 -2
- package/bin/{chunk-6edh2e59.js → chunk-d9sh922y.js} +1 -1
- package/bin/chunk-dbjc1vxt.js +1 -0
- package/bin/{chunk-pz7ms4n2.js → chunk-djkajvn7.js} +1 -1
- package/bin/{chunk-s0jy7grq.js → chunk-dyvmwafa.js} +2 -2
- package/bin/{chunk-zvjx64p5.js → chunk-ewge52nq.js} +1 -1
- package/bin/{chunk-qrnw89xg.js → chunk-f32kxe6c.js} +2 -2
- package/bin/{chunk-7anqxpyv.js → chunk-f4d3v0nc.js} +2 -2
- package/bin/{chunk-xfzk0mrt.js → chunk-f8ysqfyv.js} +2 -2
- package/bin/{chunk-dhhfwbns.js → chunk-fcsar7p0.js} +1 -1
- package/bin/{chunk-kbw63gr4.js → chunk-gfdfkqrc.js} +3 -3
- package/bin/chunk-gr30nssh.js +1 -0
- package/bin/chunk-gtwhwdbs.js +1 -0
- package/bin/{chunk-xsgxk1fj.js → chunk-gyaem1t4.js} +1 -1
- package/bin/chunk-hk6tvf7b.js +1 -0
- package/bin/{chunk-ntqn09r0.js → chunk-hmmzbyy1.js} +2 -2
- package/bin/{chunk-s9yzt7s3.js → chunk-hx2mvd20.js} +2 -2
- package/bin/chunk-hzz4hsss.js +1 -0
- package/bin/{chunk-5nk7y4ec.js → chunk-j10gz94w.js} +2 -2
- package/bin/{chunk-p9w4ar11.js → chunk-j5rx3x1q.js} +1 -1
- package/bin/{chunk-knh1stxe.js → chunk-j9q9rjvd.js} +2 -2
- package/bin/{chunk-ty32j999.js → chunk-jw00fmkp.js} +2 -2
- package/bin/chunk-k1f3gj25.js +3 -0
- package/bin/{chunk-393g7z2g.js → chunk-k20w9eaz.js} +1 -1
- package/bin/{chunk-31f07jzm.js → chunk-kejt7kcr.js} +2 -2
- package/bin/{chunk-k1jcdr0n.js → chunk-kkveddbn.js} +1 -1
- package/bin/chunk-ktvmxqfg.js +5 -0
- package/bin/{chunk-szf2q87p.js → chunk-m49g5tf4.js} +2 -2
- package/bin/{chunk-77c2xm0z.js → chunk-me3xj7na.js} +1 -1
- package/bin/{chunk-nw03w9pa.js → chunk-mgnxa0vy.js} +1 -1
- package/bin/{chunk-fv14er33.js → chunk-mgytr7nc.js} +1 -1
- package/bin/chunk-mkb4dycy.js +2 -0
- package/bin/chunk-n21a21vx.js +2 -0
- package/bin/{chunk-8r2agmv2.js → chunk-n8gsjwht.js} +2 -2
- package/bin/{chunk-t2z4qys8.js → chunk-nndzhn3n.js} +1 -1
- package/bin/{chunk-ghw914d2.js → chunk-pcxjm1re.js} +2 -2
- package/bin/{chunk-3qva5sqr.js → chunk-pg00gkr4.js} +2 -2
- package/bin/{chunk-wdgwymdp.js → chunk-pn94h6x7.js} +1 -1
- package/bin/chunk-pt51m9h1.js +2 -0
- package/bin/{chunk-hpm4razn.js → chunk-px2cvc1n.js} +2 -2
- package/bin/{chunk-rr12edz4.js → chunk-q059y3wx.js} +2 -2
- package/bin/{chunk-a5ja6d97.js → chunk-q46rc697.js} +1 -1
- package/bin/{chunk-sdjss6ja.js → chunk-r6g1srb3.js} +1 -1
- package/bin/chunk-r88vwaxc.js +1 -0
- package/bin/chunk-r9pzpqst.js +2 -0
- package/bin/{chunk-fsj3kxya.js → chunk-rar0gk7s.js} +2 -2
- package/bin/chunk-rfrpb986.js +1 -0
- package/bin/{chunk-4pj17byj.js → chunk-rfsbzd39.js} +2 -2
- package/bin/{chunk-jsqsrcse.js → chunk-s503pcvb.js} +3 -3
- package/bin/{chunk-50vzkdc8.js → chunk-s9sgkkjp.js} +1 -1
- package/bin/{chunk-12ps84z8.js → chunk-srs9jq8f.js} +2 -2
- package/bin/chunk-t77dwtcc.js +2 -0
- package/bin/{chunk-res6r4tm.js → chunk-tcqw0q8x.js} +1 -1
- package/bin/{chunk-sqy50q9g.js → chunk-thd9zasr.js} +1 -1
- package/bin/chunk-tkgpc6c9.js +2 -0
- package/bin/{chunk-qh3w5w8e.js → chunk-ts10cfmc.js} +2 -2
- package/bin/{chunk-69at8jm8.js → chunk-txkmks1h.js} +1 -1
- package/bin/chunk-v9hbssqd.js +3 -0
- package/bin/chunk-v9zc56qr.js +1 -0
- package/bin/{chunk-v073nwjn.js → chunk-vh7eb7tp.js} +2 -2
- package/bin/chunk-w9p59ahz.js +73 -0
- package/bin/{chunk-7888x3vz.js → chunk-wfee9d83.js} +3 -3
- package/bin/{chunk-r18tcdds.js → chunk-wxsq9zmf.js} +1 -1
- package/bin/chunk-wzdnsgwq.js +2 -0
- package/bin/chunk-x2nnv4j8.js +1 -0
- package/bin/chunk-xxtcmzcv.js +2 -0
- package/bin/{chunk-axnvvkdf.js → chunk-xyzmew7g.js} +1 -1
- package/bin/{chunk-2s97ngr8.js → chunk-ygsbmfcy.js} +2 -2
- package/bin/{chunk-z8crenxd.js → chunk-ym9xavj0.js} +1 -1
- package/bin/{chunk-3j47y8ah.js → chunk-z340qkez.js} +1 -1
- package/bin/{chunk-6qzcnkgx.js → chunk-za7ga4bf.js} +2 -2
- package/bin/{chunk-nzrrvn6c.js → chunk-zqvavykq.js} +2 -2
- package/bin/{chunk-f5c9g4y9.js → chunk-zt15ht52.js} +1 -1
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +283 -315
- package/package.json +7 -7
- package/prisma/schema.prisma +1 -1
- package/bin/chunk-02b97gsf.js +0 -2
- package/bin/chunk-0ash207y.js +0 -2
- package/bin/chunk-0j3yb84c.js +0 -1
- package/bin/chunk-0wgqr4jg.js +0 -2
- package/bin/chunk-1tby7q3f.js +0 -1
- package/bin/chunk-3ztat2q9.js +0 -68
- package/bin/chunk-48yphy68.js +0 -73
- package/bin/chunk-4t2qcxp5.js +0 -1
- package/bin/chunk-5dfy6173.js +0 -2
- package/bin/chunk-68bfd8x7.js +0 -3
- package/bin/chunk-6ts5az6h.js +0 -2
- package/bin/chunk-72nj00dp.js +0 -1
- package/bin/chunk-8b11b9cj.js +0 -2
- package/bin/chunk-8ekjxb5q.js +0 -2
- package/bin/chunk-8zar6cc4.js +0 -2
- package/bin/chunk-9m9bn55a.js +0 -1
- package/bin/chunk-ayr3tsz3.js +0 -2
- package/bin/chunk-bthrbggg.js +0 -2
- package/bin/chunk-csh1ggtt.js +0 -1
- package/bin/chunk-ctx1ms5t.js +0 -2
- package/bin/chunk-day0vn14.js +0 -2
- package/bin/chunk-e5r6rnt9.js +0 -2
- package/bin/chunk-gwzk0fvn.js +0 -2
- package/bin/chunk-gx8sz5bw.js +0 -2
- package/bin/chunk-gydktfnx.js +0 -2
- package/bin/chunk-h5j1dqc0.js +0 -1
- package/bin/chunk-h7kyj2g2.js +0 -2
- package/bin/chunk-har4xctf.js +0 -2
- package/bin/chunk-hks5k0tm.js +0 -7
- package/bin/chunk-hv4t9h3e.js +0 -9
- package/bin/chunk-kchbbtdm.js +0 -2
- package/bin/chunk-mkwrrdme.js +0 -2
- package/bin/chunk-mm995mvc.js +0 -2
- package/bin/chunk-mz9pthjh.js +0 -2
- package/bin/chunk-n2ae527q.js +0 -307
- package/bin/chunk-n3xn2ve1.js +0 -1
- package/bin/chunk-q3fdffq5.js +0 -1
- package/bin/chunk-rd2n0rs6.js +0 -1
- package/bin/chunk-sttc4axf.js +0 -1
- package/bin/chunk-t6pmgmg2.js +0 -1
- package/bin/chunk-txpqhfqw.js +0 -1
- package/bin/chunk-vrdbqapq.js +0 -2
- package/bin/chunk-vwa17b2r.js +0 -1
- package/bin/chunk-wch8ygpt.js +0 -3
- package/bin/chunk-wqwvxskj.js +0 -1
- package/bin/chunk-wr3q8a9n.js +0 -1
- package/bin/chunk-wt01m93x.js +0 -1
- package/bin/chunk-xr1wr22v.css +0 -1
- package/bin/chunk-y1pnq12c.js +0 -2
- /package/bin/{chunk-xg9xscqz.js → chunk-kryt6pg3.js} +0 -0
package/bin/chunk-6ts5az6h.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function i(o){if(!o||o<=0)return"0 B";let n=1000,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],t=Math.floor(Math.log(o)/Math.log(n));if(t<0)t=0;if(t>=r.length)t=r.length-1;let a=o/Math.pow(n,t);if(t===0)return`${Math.round(a)} B`;let e=parseFloat(a.toFixed(2));if(e>=1000&&t<r.length-1)return parseFloat((o/Math.pow(n,t+1)).toFixed(2))+" "+r[t+1];return`${e} ${r[t]}`}
|
|
2
|
-
export{i as pf};
|
package/bin/chunk-72nj00dp.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as w1}from"./chunk-mkwrrdme.js";import{p as z1,q as y1}from"./chunk-ayr3tsz3.js";import{t as iz,w as tz}from"./chunk-n2ae527q.js";import{C as sz}from"./chunk-kchbbtdm.js";import"./chunk-0ash207y.js";import"./chunk-12ps84z8.js";import{V as ez}from"./chunk-kcg7d7pk.js";import{xe as rz}from"./chunk-gwzk0fvn.js";import"./chunk-8ekjxb5q.js";import"./chunk-7anqxpyv.js";import"./chunk-31f07jzm.js";import{zf as nz}from"./chunk-02b97gsf.js";import"./chunk-8b11b9cj.js";import{Sf as Rz,Tf as az}from"./chunk-wch8ygpt.js";import"./chunk-ntqn09r0.js";import"./chunk-esa954t1.js";import"./chunk-ctx1ms5t.js";import{$f as oz}from"./chunk-bthrbggg.js";import"./chunk-3ztat2q9.js";import"./chunk-2s97ngr8.js";import"./chunk-dyen2t1p.js";import{Ug as Pz}from"./chunk-sepsqqdf.js";import"./chunk-y0k1f3gk.js";import"./chunk-dwkv3bx5.js";import"./chunk-qh3w5w8e.js";import"./chunk-4pj17byj.js";import"./chunk-ps2hw0ps.js";import"./chunk-qrnw89xg.js";import"./chunk-5dfy6173.js";import{ai as Az}from"./chunk-qrhf20g2.js";import{Ai as pz,Bi as jz,Ci as mz,Di as cz,Ei as Iz,Fi as uz,Gi as dz,Hi as lz,ci as zz,ei as Mz,hi as f,ji as d,qi as H,ri as vz,ti as Cz,ui as Sz,vi as Dz,wi as fz,yi as F}from"./chunk-jsqsrcse.js";import"./chunk-8zar6cc4.js";import{$l as _,Ji as bz,Ki as Lz,Li as y,Mi as Z,Ri as gz,Ti as Oz,Wi as xz,Wl as qz,Yl as yz,_j as hz,am as Fz,kj as A,zj as Vz}from"./chunk-48yphy68.js";import{Zm as kz}from"./chunk-69at8jm8.js";var $=kz(bz(),1);var v1=({item:w})=>{if(w.preview?.thumbnailUrl)return y("img",{src:w.preview.thumbnailUrl,alt:"Preview",className:"w-full h-full object-cover"});if(w.preview?.proxyType==="audio"||w.proxyType==="audio")return y("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:y(Vz,{className:"w-5 h-5 text-muted-foreground"})});return y("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:y(hz,{className:"w-5 h-5 text-muted-foreground"})})},Ez=({projectId:w,currentAssetId:G,parentFolderId:b,initialFiles:U,initialNextCursor:P})=>{let{ref:J,inView:E}=Pz({threshold:0,rootMargin:"200px"}),O=$.useRef(null),N=$.useRef(!0),[W,V]=$.useState(U),[B,R]=$.useState(P),[v,p]=$.useState(!!P),[L,h]=$.useState(!1);return $.useEffect(()=>{V(U),R(P),p(!!P),N.current=!0},[U,P]),$.useEffect(()=>{(async()=>{if(!B||L||!E||!v)return;h(!0);try{let Q=await H.api.folders[":folderId"].search.$post({param:{folderId:b},json:{assetType:"file",after:B,first:200,recursively:!1,conditions:[]}});if(!Q.ok)throw Error("Failed to fetch next page");let C=await Q.json(),M=C.data||[];V((l)=>[...l,...M]),R(C.pageInfo?.cursor||void 0),p(!!C.pageInfo?.cursor&&M.length>0)}catch(Q){console.error("Error fetching next page:",Q)}finally{h(!1)}})()},[E,B,v,L,b]),$.useEffect(()=>{if(W.some((Q)=>Q?.id===G)&&O.current)if(N.current)O.current.scrollIntoView({block:"center",inline:"center",behavior:"auto"}),N.current=!1;else O.current.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[W,G]),y("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:Z("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:[W.map((k)=>{if(!k)return null;let Q=k.id===G;return y("div",{ref:k.id===G?O:null,className:"flex-shrink-0",children:y(Oz,{to:"/projects/$projectId/files/$fileId",params:{projectId:w,fileId:k.id},search:{version:void 0},className:qz("rounded-lg border overflow-hidden flex items-center justify-center transition-all bg-muted/30 block",Q?"w-[62px] h-[62px] opacity-100":"w-[52px] h-[52px] opacity-60 hover:opacity-100"),children:y(v1,{item:k})})},k.id)}),v&&y("div",{ref:J,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:L&&y(A,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})})};var X=kz(bz(),1);function C1(){let{projectId:w,fileId:G}=Nz.useParams(),b=Nz.useSearch(),U=b.version,P=b.start,J=U||G,E=b.cmpLeft,O=b.cmpRight,N=b.cmpActive??"left",W=!!b.compare&&!!E&&!!O,V=X.useRef(null),{teamId:B,ensureTeamIdForProject:R}=Az(),[v,p]=X.useState(360),[L,h]=X.useState([]),{fileViewRightSidebarCollapsed:k}=oz(),{isChatbotOpen:Q}=az(),[C,M]=X.useState(0),[l,j]=X.useState(null),[wz,K1]=X.useState(null),[X1,G1]=X.useState(void 0),[S,n]=X.useState({show:!1,files:[],nextCursor:void 0,folderId:void 0}),J1=H.api.files[":fileId"].metadata.$patch,{mutate:Y1}=d({mutationFn:async(z)=>{let K=await J1(z);if(!K.ok)throw Error("Failed to patch metadata");return await K.json()}}),D=Mz(),{members:Z1,fetchProjectMembers:Kz}=nz();X.useEffect(()=>{R(w)},[w,R]),X.useEffect(()=>{if(w)Kz(w,!0)},[w,Kz]),X.useEffect(()=>{if(w&&G)H.api.projects[":projectId"].recents.view.$post({param:{projectId:w},json:{assetId:G}}).catch(()=>{})},[w,G]);let{data:Xz,isLoading:_1,isError:U1,isFetching:W1}=f({queryKey:["files",G],queryFn:async()=>{let z=await H.api.files[":fileId"].$get({param:{fileId:G}});if(!z.ok)throw Error("Failed to fetch stack");return await z.json()},enabled:!!B,placeholderData:zz}),{data:B1,isLoading:$1,isError:H1,isFetching:Q1}=f({queryKey:["files",U],queryFn:async()=>{let z=await H.api.files[":fileId"].$get({param:{fileId:U}});if(!z.ok)throw Error("Failed to fetch version");return await z.json()},enabled:!!B&&!!U,placeholderData:zz}),{data:T1}=f({queryKey:["version_stacks",G,"versions"],queryFn:async()=>{let z=await H.api.version_stacks[":stackId"].versions.$get({param:{stackId:G}});if(!z.ok)throw Error("Failed to fetch versions");return await z.json()},enabled:!!w&&!!G&&(!!U||W)}),{data:g}=f({queryKey:["projects",w],queryFn:async()=>{let z=await H.api.projects[":projectId"].$get({param:{projectId:w}});if(!z.ok)throw Error("Failed to fetch project");return await z.json()}}),x=gz(),{setProjectState:Gz,clearProjectState:Jz}=Rz(),k1=_1||!!U&&$1,b1=U1||!!U&&H1,O1=W1||!!U&&Q1,Y=B1||Xz,q=U?T1:Xz?.versionStack?.versions,T=Y?.ancestorFolders?.[0]?.id??g?.rootFolder??"",[o,m]=X.useState(!1),[c,Yz]=X.useState(""),a=X.useRef(null),r=X.useRef(!1),[V1,s]=X.useState(!1),h1=H.api.files[":fileId"].$put,{mutate:q1,isPending:Zz}=d({mutationFn:async(z)=>{let K=await h1(z);if(!K.ok)throw Error("Failed to rename file");return await K.json()},onSuccess:()=>{D.invalidateQueries({queryKey:["files"]}),D.invalidateQueries({queryKey:["version_stacks"]}),F.success(_.renamed_successfully?.()||"Renamed successfully"),m(!1)},onError:()=>{F.error(_.failed_to_rename?.()||"Failed to rename")}}),P1=H.api.files.$delete,{mutate:E1,isPending:_z}=d({mutationFn:async(z)=>{if(!(await P1(z)).ok)throw Error("Failed to delete file")},onSuccess:()=>{if(D.invalidateQueries({queryKey:["files"]}),D.invalidateQueries({queryKey:["version_stacks"]}),F.success(_.deleted?.()||"Deleted"),s(!1),T&&T!==g?.rootFolder)x({to:"/projects/$projectId/folders/$folderId",params:{projectId:w,folderId:T}});else x({to:"/projects/$projectId",params:{projectId:w}})},onError:()=>{F.error(_.failed_to_delete?.()||"Failed to delete")}}),N1=(z)=>{if(z?.preventDefault(),!c.trim()||!J)return;q1({param:{fileId:J},json:{name:c.trim()}})},L1=()=>{if(!J)return;E1({json:{ids:[J]}})};X.useEffect(()=>{if(Y&&g&&B)Gz({teamId:B,projectId:w,projectName:g.name??"",ancestorFolders:Y.ancestorFolders??[],currentAsset:{id:J||G,name:Y.name,type:"file",version:q?q.find((z)=>z.id===J)?.version??q.length:void 0,proxyType:Y.proxyType},isRootFolder:!1,fileId:G,downloadInfo:{originalKey:Y.media?.original?.key,videoTranscodes:Y.media?.videoTranscodes?.map((z)=>({key:z.key,width:z.width,height:z.height}))},versions:q,compareMode:W,canCompareVersions:(q?.length??0)>=2,onCompareVersions:()=>{let z=iz(q);if(!z)return;x({to:"/projects/$projectId/files/$fileId",params:{projectId:w,fileId:G},search:(K)=>({...K,version:void 0,compare:!0,cmpLeft:z.left.id,cmpRight:z.right.id,cmpActive:"left"})})},onFolderClick:(z)=>{x({to:"/projects/$projectId/folders/$folderId",params:{projectId:w,folderId:z}})},onRename:()=>{r.current=!1,Yz(Y?.name??""),m(!0)},onDelete:()=>{s(!0)}});return()=>Jz()},[B,w,g,Y,q,J,G,W,Gz,Jz,x]),X.useEffect(()=>{if(!o)return;let z=setTimeout(()=>{r.current=!0},1000);return()=>clearTimeout(z)},[o]);let M1=()=>{if(r.current)return;setTimeout(()=>{if(a.current)sz(a.current)},0)};if(X.useEffect(()=>{if(!T||!J)return;if(S.folderId===T)return;let z=!0;return(async()=>{try{let I="",Bz=!1,$z=[],Hz=void 0;for(let Qz=0;Qz<5;Qz++){let Tz=await H.api.folders[":folderId"].search.$post({param:{folderId:T},json:{assetType:"file",after:I,first:200,recursively:!1,conditions:[]}});if(!Tz.ok)throw Error("Failed to search parent folder for carousel");let u=await Tz.json(),e=u.data||[];if($z.push(...e),e.some((R1)=>R1.id===J)){Bz=!0,Hz=u.pageInfo?.cursor||void 0;break}if(!u.pageInfo?.cursor||e.length<200)break;I=u.pageInfo.cursor}if(z)if(Bz)n({show:!0,files:$z,nextCursor:Hz,folderId:T});else n({show:!1,files:[],nextCursor:void 0,folderId:T})}catch(I){if(console.error(I),z)n({show:!1,files:[],nextCursor:void 0,folderId:T})}})(),()=>{z=!1}},[T,J,S.folderId]),X.useEffect(()=>{M(0),j(null),h([])},[Y?.id]),X.useEffect(()=>{j(null),h([])},[wz?.id]),k1&&!Y)return y(rz,{});if(b1||!Y||!g||!B)return y("div",{children:_.file_not_found()});let i=W?wz:Y,Uz=i?.id??J,g1=(z,K)=>{if(!B)return;Y1({param:{fileId:Uz},json:[{key:z,value:K}]},{onSuccess:()=>{D.invalidateQueries({queryKey:["files",Uz]})}})},t=(z)=>{x({to:"/projects/$projectId/files/$fileId",params:{projectId:w,fileId:G},search:(K)=>({...K,...z})})},x1=()=>{t({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:N==="left"?E:O})},A1=(z)=>{j(z.id||null);let K=z.annotations;if(K&&K.length>0)h(K);else h([]);if(W){if(z.second!==null&&z.second!==void 0)G1({second:z.second,nonce:Date.now()});return}if(z.second!==null&&z.second!==void 0)V.current?.seekTo(z.second),V.current?.pause();else if(K&&K.length>0)V.current?.pause()},Wz=()=>{h([]),j(null)};return Z("div",{className:"h-full flex flex-1 flex-col bg-background",children:[Z("div",{className:"h-full flex flex-1 overflow-hidden",children:[Z("div",{className:"flex-1 relative",children:[O1&&!W&&y("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:y(A,{className:"h-8 w-8 animate-spin text-foreground"})}),W&&E&&O?y(y1,{versions:q??[],leftId:E,rightId:O,activeSide:N,annotations:L,seekRequest:X1,onActiveSideChange:(z)=>t({cmpActive:z}),onSwitchVersion:(z,K)=>t(z==="left"?{cmpLeft:K}:{cmpRight:K}),onExit:x1,onActiveAssetChange:K1,onPlay:Wz,onTimeUpdate:M}):y(z1,{file:Y,mediaControllerRef:V,onPlay:Wz,onTimeUpdate:M,annotations:L,startTime:P,children:S.show&&y(Ez,{projectId:w,currentAssetId:J,parentFolderId:T,initialFiles:S.files,initialNextCursor:S.nextCursor})})]}),(!k||Q)&&Z(Lz,{children:[y(ez,{onResize:(z)=>{p((K)=>Math.max(300,Math.min(600,K-z)))},className:"hidden md:block"}),y("div",{style:{width:v},className:"flex-shrink-0 bg-background flex flex-col",children:Q?y(w1,{projectId:w,contextAssetId:J}):y(tz,{teamId:B,projectId:w,file:i,onSaveField:g1,members:Z1,onCommentSelect:A1,currentTime:C,onTyping:()=>{if(W)return;V.current?.pause()},selectedCommentId:l,hideAnnotationControl:i?.proxyType==="audio"})})]})]}),y(vz,{open:o,onOpenChange:m,children:y(Cz,{children:Z("form",{onSubmit:N1,children:[y(Sz,{children:y(fz,{children:_.rename()})}),y("div",{className:"py-4",children:y(Fz,{ref:a,value:c,onChange:(z)=>Yz(z.target.value),placeholder:_.enter_new_name?.()||"Enter new name",onFocus:M1,autoFocus:!0})}),Z(Dz,{children:[y(yz,{type:"button",variant:"outline",onClick:()=>m(!1),children:_.cancel()}),Z(yz,{type:"submit",disabled:Zz||!c.trim(),children:[Zz&&y(A,{className:"mr-2 h-4 w-4 animate-spin"}),_.save()]})]})]})})}),y(pz,{open:V1,onOpenChange:s,children:Z(jz,{children:[Z(mz,{children:[y(Iz,{children:_.delete_asset_title?.()||"Delete Asset?"}),y(uz,{children:_.delete_asset_description?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),Z(cz,{children:[y(lz,{children:_.cancel()}),Z(dz,{onClick:L1,disabled:_z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[_z&&y(A,{className:"mr-2 h-4 w-4 animate-spin"}),_.delete()]})]})]})})]})}var Nz=xz("/projects/$projectId/files/$fileId")({component:C1});export{Nz as Route};
|
package/bin/chunk-8b11b9cj.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ih as e}from"./chunk-dwkv3bx5.js";import{Li as l,Ml as m,Wl as te}from"./chunk-48yphy68.js";var u={human:"human",agent:"agent"};var h={editor:"editor",reviewer:"reviewer"};var N={team:"team",project:"project"};var w={all_members:"all_members",each_member:"each_member",selected_members:"selected_members"};var Q={agent_total_tokens:"agent_total_tokens",agent_cost:"agent_cost",agent_mcp_call_count:"agent_mcp_call_count",agent_bash_call_count:"agent_bash_call_count",agent_tool_call_count:"agent_tool_call_count"},s={TODO:"TODO",READY:"READY",IN_PROGRESS:"IN_PROGRESS",BLOCKED:"BLOCKED",IN_REVIEW:"IN_REVIEW",DONE:"DONE"},c={LOW:"LOW",MEDIUM:"MEDIUM",HIGH:"HIGH",URGENT:"URGENT"},d={CREATED:"CREATED",STATUS_CHANGED:"STATUS_CHANGED",ASSIGNED:"ASSIGNED",UNASSIGNED:"UNASSIGNED",COMMENTED:"COMMENTED",CHANGES_REQUESTED:"CHANGES_REQUESTED",BLOCKED:"BLOCKED",UNBLOCKED:"UNBLOCKED",PRIORITY_CHANGED:"PRIORITY_CHANGED",GOAL_CHANGED:"GOAL_CHANGED",DEPENDENCY_ADDED:"DEPENDENCY_ADDED",DEPENDENCY_REMOVED:"DEPENDENCY_REMOVED"},L={chat:"chat",autofill:"autofill",embedding:"embedding"};var p=e.object({cursor:e.string().optional(),total:e.number().optional(),totalSize:e.number().optional()}),a=e.object({first:e.coerce.number().optional(),after:e.string().optional()});var ze=e.object({name:e.string()}),re=e.object({id:e.string(),name:e.string(),rootFolder:e.string().optional(),updatedAt:e.union([e.string(),e.date()])});var et=e.object({data:e.array(re),pageInfo:p}),tt=e.object({teamId:e.string(),userId:e.string()}),ot=e.object({id:e.string(),name:e.string(),email:e.string().optional(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),image:e.string().optional(),unreadNotificationCount:e.number().optional()}),rt=e.object({name:e.string().optional(),imageKey:e.string().nullable().optional()}),at=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),email:e.string().optional(),type:e.nativeEnum(u).optional(),image:e.string().optional(),scope:e.nativeEnum(N).optional()}),nt=e.object({includeAgents:e.string().optional().transform((t)=>t==="true")}),ae={best_match:"best_match",all:"all"},st=e.union([e.object({key:e.literal("transcode.videoStrategy"),value:e.nativeEnum(ae)})]),it=e.object({networkSandboxEnabled:e.boolean(),allowedDomains:e.array(e.string()),pendingDomains:e.array(e.string()).default([])}),pt=e.object({networkSandboxEnabled:e.boolean().optional(),allowedDomains:e.array(e.string()).optional(),pendingDomains:e.array(e.string()).optional()}),ct=e.object({role:e.enum(["editor","reviewer"])});var A=e.nativeEnum(L),O=e.enum(["off","minimal","low","medium","high","xhigh"]),S=e.enum(["owner","editor","reviewer"]),ne=e.object({id:e.string().optional(),skillId:e.string(),skill:e.object({id:e.string(),name:e.string()}).optional()}),dt=e.object({id:e.string(),name:e.string(),type:A,enabled:e.boolean(),permission:S.optional().default("reviewer"),avatar:e.string().optional(),providerId:e.string().optional(),modelId:e.string().optional(),thinkingLevel:O.optional().default("off"),systemPrompt:e.string().optional(),soul:e.string().optional(),skills:e.array(ne).optional(),mcpServerIds:e.array(e.string()).optional(),deniedTools:e.array(e.string()).optional()}),F=e.object({name:e.string().min(1),type:A,enabled:e.boolean().optional().default(!0),permission:S.optional(),avatar:e.string().optional(),providerId:e.string().optional(),modelId:e.string().optional(),thinkingLevel:O.optional().default("off"),systemPrompt:e.string().optional(),soul:e.string().optional(),skills:e.array(e.string()).optional(),mcpServerIds:e.array(e.string()).optional(),deniedTools:e.array(e.string()).optional()}),ft=F.superRefine((t,r)=>{if(t.type==="chat"||t.type==="autofill"){if(!t.providerId)r.addIssue({code:e.ZodIssueCode.custom,message:"providerId is required for chat/autofill agents",path:["providerId"]});if(!t.modelId)r.addIssue({code:e.ZodIssueCode.custom,message:"modelId is required for chat/autofill agents",path:["modelId"]})}}),gt=F.superRefine((t,r)=>{if(t.type==="chat"||t.type==="autofill"){if(!t.providerId)r.addIssue({code:e.ZodIssueCode.custom,message:"providerId is required for chat/autofill agents",path:["providerId"]});if(!t.modelId)r.addIssue({code:e.ZodIssueCode.custom,message:"modelId is required for chat/autofill agents",path:["modelId"]})}}),yt=e.object({permission:S}),bt=e.object({id:e.string(),sessionId:e.string(),entry:e.unknown()}),ht=e.object({id:e.string(),name:e.string().nullable().optional(),type:e.string(),createdAt:e.string(),creator:e.object({id:e.string(),name:e.string().nullable().optional(),email:e.string().nullable().optional(),image:e.string().nullable().optional()}).nullable().optional(),agentId:e.string().optional()});var xt=e.object({apiKey:e.string().optional(),baseUrl:e.string().optional(),chatModels:e.array(e.string()).optional()}),se=e.enum(["1h","24h","7d","30d"]),Rt=e.object({timeframe:se.default("30d"),userId:e.string().optional()});var vt=e.object({data:e.array(e.lazy(()=>me)),pageInfo:p}),G=e.object({proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),thumbnailUrl:e.string().optional(),originalHeight:e.number().optional(),originalWidth:e.number().optional(),spriteUrl:e.string().optional(),duration:e.number().optional(),pageCount:e.number().optional()}),ie=e.object({type:e.string().nullable(),preview:G.nullable()}),f=e.object({id:e.string(),name:e.string(),image:e.string().optional()}),pe=e.object({fieldId:e.string(),value:e.any()}),ce=e.object({id:e.string(),name:e.string()}),le=e.object({duration:e.number().optional(),originalWidth:e.number().optional(),originalHeight:e.number().optional(),frameRate:e.number().optional(),totalFrames:e.number().optional(),startTimecode:e.string().optional()}),me=e.object({id:e.string(),name:e.string(),sizeByte:e.number(),fileCount:e.number(),type:e.string(),targetType:e.string().optional().nullable(),status:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),latestChildren:e.array(ie).optional(),preview:G.nullable().optional(),createdAt:e.string(),updatedAt:e.string(),deletedAt:e.string().nullable().optional(),projectId:e.string().optional().nullable(),creator:f.nullable().optional(),fieldValues:e.array(pe).optional(),sortIndex:e.string().optional().nullable(),startTime:e.number().optional().nullable(),endTime:e.number().optional().nullable(),hasAgentsMd:e.boolean().optional(),media:e.object({original:e.object({key:e.string().optional()}).optional(),videoTranscodes:e.array(e.object({id:e.string(),url:e.string(),key:e.string(),width:e.number(),height:e.number(),size:e.number()})).optional(),imageTranscodes:e.array(e.object({id:e.string(),url:e.string(),key:e.string(),width:e.number(),height:e.number(),size:e.number()})).optional(),videoPreview:e.object({url:e.string(),key:e.string().optional()}).optional(),pdfTranscode:e.object({url:e.string(),key:e.string().optional()}).optional(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),metadata:le.optional()}).optional(),ancestorFolders:e.array(ce).optional(),versionStack:e.object({id:e.string(),versions:e.array(e.object({version:e.number(),current:e.boolean(),id:e.string(),name:e.string().optional().nullable(),previewUrl:e.string().optional().nullable(),createdAt:e.string().optional().nullable(),creator:e.object({id:e.string(),name:e.string().nullable(),image:e.string().optional().nullable()}).nullable().optional()}))}).optional().nullable()}),jt=e.object({name:e.string(),type:e.string(),projectId:e.string().optional(),parentId:e.string().optional(),key:e.string().optional(),sizeByte:e.number().optional(),contentType:e.string().optional(),creatorId:e.string().optional()}),qt=e.object({assetId:e.string()}),Pt=e.object({id:e.string(),name:e.string()}),Et=e.object({assetId:e.string().optional(),assetType:e.string(),projectId:e.string().optional(),showDeleted:e.boolean().optional(),prefix:e.string().optional(),sort:e.string().optional(),order:e.string().optional(),...a.shape}),Ct=e.object({assetId:e.string(),userId:e.string(),replyToId:e.string().optional(),message:e.string(),annotations:e.any().optional(),second:e.number().optional(),attachmentIds:e.array(e.string())}),ue=e.object({id:e.string(),assetId:e.string(),url:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional()}),de=e.object({id:e.string(),assetId:e.string(),message:e.string().nullable(),annotations:e.any(),second:e.number().nullable(),creator:f,replies:e.array(e.lazy(()=>de)),attachments:e.array(ue),mentions:e.array(f),createdAt:e.string(),updatedAt:e.string(),sessionId:e.string().nullable(),isCompleted:e.boolean(),completionLastChangedBy:f.nullable()}),Mt=e.object({isCompleted:e.boolean()}),Dt=e.object({newParentId:e.string(),assetIds:e.array(e.string()),creatorId:e.string().optional()}),Ut=e.object({newParentId:e.string(),assetIds:e.array(e.string()),withComments:e.boolean().default(!1),creatorId:e.string().optional()}),Kt=e.object({name:e.string()}),Nt=e.object({beforeIndex:e.string().optional(),afterIndex:e.string().optional()}),wt=e.object({ids:e.array(e.string())}),Qt=e.object({ids:e.array(e.string())}),Lt=e.object({file:e.instanceof(File)}),At=e.object({key:e.string()}),Ot=e.object({fileName:e.string(),contentType:e.string(),size:e.number()}),Ft=e.object({id:e.string(),uploadUrl:e.string()}),Gt=e.object({ids:e.array(e.string())}),fe=e.object({id:e.string(),name:e.string(),url:e.string()}),Vt=e.object({files:e.array(fe)});var Bt=e.object({userCount:e.number()}),Zt=e.object({name:e.string().min(1,"Name is required").max(100,"Name is too long")}),Yt=e.object({id:e.string(),token:e.string(),name:e.string(),createdAt:e.string()});var ge=e.enum(["is","eq","neq","gt","gte","lt","lte","contains","notContains","isEmpty","isNotEmpty","in","notIn","hasAny","hasAll","hasNone","isWithin"]),ye=e.object({field:e.string(),operator:ge,value:e.any()}),be=e.enum(["asc","desc"]),he=e.object({field:e.string(),order:be}),Se=e.enum(["AND","OR"]),_e=e.enum(["file","folder"]),_=e.object({operator:Se.optional().default("AND"),conditions:e.array(ye).optional().default([]),sort:he.optional(),assetType:_e.optional(),showSymlink:e.boolean().optional(),recursively:e.boolean().optional().default(!0),query:e.string().optional(),isSemantic:e.boolean().optional().default(!1)}),zt=_.extend(a.shape);var x=e.object({sourceFolderId:e.string(),searchFilter:_}),xe=e.object({id:e.string(),name:e.string(),filter:x,projectId:e.string(),createdAt:e.string(),updatedAt:e.string(),creator:e.object({id:e.string(),name:e.string(),image:e.string().optional().nullable()}).optional().nullable()}),ao=e.object({name:e.string(),filter:x}),no=e.object({name:e.string().optional(),filter:x.optional()});var so=e.object({data:e.array(xe),pageInfo:e.object({cursor:e.string().optional(),total:e.number().optional()})});var co=e.object({name:e.string(),parentId:e.string()}),lo=e.object({name:e.string()}),mo=e.object({ids:e.array(e.string())}),uo=e.object({ids:e.array(e.string())}),fo=e.object({content:e.string().max(1e5)});var ho=e.object({code:e.string(),role:e.string(),teamId:e.string(),teamName:e.string(),projectId:e.string().optional(),projectName:e.string().optional(),inviterName:e.string(),isUsed:e.boolean()}),So=e.object({role:e.nativeEnum(h)}),_o=e.object({role:e.nativeEnum(h)}),xo=e.object({code:e.string()});var vo={text:"text",longText:"longText",select:"select",selectMulti:"selectMulti",rating:"rating",number:"number",toggle:"toggle",date:"date",user:"user",userMulti:"userMulti"},Re={NONE:"NONE",CONTENT:"CONTENT",CREATION_CONTEXT:"CREATION_CONTEXT"},jo=e.object({id:e.string(),displayName:e.string(),color:e.string().optional()}),R=e.object({name:e.string(),type:e.enum(["text","longText","select","selectMulti","rating","number","toggle","date","user","userMulti"]),autofillSource:e.nativeEnum(Re).optional(),text:e.any().optional(),longText:e.any().optional(),select:e.any().optional(),selectMulti:e.any().optional(),rating:e.any().optional(),number:e.any().optional(),toggle:e.any().optional(),date:e.any().optional(),user:e.any().optional(),userMulti:e.any().optional()}),qo=e.object({key:e.string().optional(),label:e.string().optional(),scope:e.string().optional(),config:R,description:e.string().default("")}),Po=e.object({label:e.string().optional(),config:R,description:e.string().optional()}),ke=e.object({fieldId:e.string(),visible:e.boolean()}),Eo=e.array(ke),Ie=e.object({key:e.string(),value:e.any()}),Co=e.array(Ie),Mo=e.object({id:e.string(),config:R,scope:e.string(),readOnly:e.boolean(),visible:e.boolean(),description:e.string()});var V=e.enum(["auto","none","bearer","oauth"]),k=e.enum(["streamable_http","sse"]),g=e.enum(["owner","editor","reviewer"]),Te=e.object({grantType:e.enum(["authorization_code","client_credentials"]).optional(),clientId:e.string().optional(),clientSecret:e.string().optional(),scope:e.string().optional(),authorizationParams:e.record(e.string(),e.string()).optional(),redirectUri:e.string().optional(),clientName:e.string().optional(),clientUri:e.string().optional(),skipIssuerMetadataValidation:e.boolean().optional()}),W=e.object({type:V.optional(),bearerToken:e.string().optional(),headers:e.record(e.string(),e.string()).optional(),oauth:Te.optional()}),I=e.object({excludeTools:e.array(e.string()).optional(),requestTimeoutMs:e.number().int().positive().optional(),idleTimeoutMs:e.number().int().positive().optional(),keepAlive:e.boolean().optional(),protocolVersion:e.enum(["legacy","auto","2026-07-28"]).optional(),directTools:e.array(e.string()).optional()}),ve=e.object({name:e.string(),title:e.string().optional(),description:e.string().optional(),inputSchema:e.unknown().optional()}),Ko=e.object({url:e.string().url(),transport:k.optional(),authConfig:W.optional(),config:I.optional(),permission:g.optional()}),No=e.object({transport:k.optional(),authConfig:W.optional(),config:I.optional(),permission:g.optional()}),wo=e.object({permission:g}),je=e.object({id:e.string(),name:e.string(),description:e.string().optional(),instructions:e.string().optional(),url:e.string(),transport:k,authType:V,config:I.optional(),permission:g,status:e.string(),lastError:e.string().nullable().optional(),toolCount:e.number(),hasCredential:e.boolean(),createdAt:e.string(),updatedAt:e.string()}),Qo=e.object({servers:e.array(je)}),Lo=e.object({}),Ao=e.object({tools:e.array(ve)}),H=e.enum(["authenticated","expired","not_authenticated","in_progress"]),Oo=e.object({status:H}),Fo=e.object({authorizationUrl:e.string().optional(),status:H}),Go=e.object({code:e.string(),iss:e.string().optional()}),Vo=e.object({ok:e.boolean(),toolCount:e.number(),message:e.string().optional()});var B=e.object({id:e.string().optional(),name:e.string().optional(),role:e.string().optional()}),Z=e.object({id:e.string().optional(),name:e.string().optional()}),qe=e.object({id:e.string().optional(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),name:e.string().optional(),preview:e.string().optional(),thumbnailUrl:e.string().optional(),originalWidth:e.number().optional(),originalHeight:e.number().optional()}),Pe=e.object({id:e.string().optional(),title:e.string().optional(),status:e.string().optional()}),Bo=e.object({id:e.string().optional(),creator:B.optional(),type:e.string().optional(),team:Z.optional(),project:Z.optional(),asset:qe.optional(),kanbanTask:Pe.optional(),user:B.optional(),createdAt:e.string().optional(),isRead:e.boolean().optional()}),Zo=e.object({unreadOnly:e.union([e.boolean(),e.string()]).transform((t)=>t===!0||t==="true").optional(),after:e.string().optional(),pageSize:e.coerce.number().optional()}),Yo=e.object({notificationId:e.string().min(1)}),Jo=e.object({comments:e.boolean().default(!0),replies:e.boolean().default(!0),mentions:e.boolean().default(!0),yourUploads:e.boolean().default(!1),otherUploads:e.boolean().default(!0),statusUpdates:e.boolean().default(!0),kanbanTasks:e.boolean().default(!0),kanbanComments:e.boolean().default(!0)});var tr=e.object({name:e.string(),coverImageKey:e.string().optional(),enableNotification:e.boolean().default(!0)}),or=e.object({name:e.string().optional(),coverImageKey:e.string().optional(),enableNotification:e.boolean().optional()}),Ee=e.object({id:e.string(),name:e.string(),teamId:e.string(),rootFolder:e.string().optional(),coverImage:e.string().optional(),coverImageKey:e.string().optional(),enableNotification:e.boolean(),updatedAt:e.union([e.string(),e.date()])}),rr=e.object({sortBy:e.string().optional(),sortDirection:e.enum(["asc","desc"]).optional()}).merge(a),ar=e.object({data:e.array(Ee),pageInfo:p}),nr=e.object({teamId:e.string()}),sr=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),type:e.nativeEnum(u).optional(),image:e.string().optional(),scope:e.enum(["team","project"]).optional(),hasCustomRole:e.boolean().optional()}),ir=e.object({assetType:e.string(),sort:e.enum(["createdAt","name","size"]).optional(),order:e.enum(["asc","desc"]).optional()}).merge(a),pr=e.object({role:e.enum(["editor","reviewer"])}),cr=e.object({userId:e.string(),role:e.enum(["owner","editor","reviewer"])}),lr=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),image:e.string().optional()});var Y=["openai-completions","mistral-conversations","openai-responses","azure-openai-responses","openai-codex-responses","anthropic-messages","bedrock-converse-stream","google-generative-ai","google-vertex"],Ce=e.object({api:e.enum(Y).optional(),reasoning:e.boolean().default(!1),input:e.array(e.enum(["text","image"])).default(["text"]),contextWindow:e.number().int().positive().default(128000),maxTokens:e.number().int().positive().default(4096),cost:e.object({input:e.number().nonnegative().default(0),output:e.number().nonnegative().default(0),cacheRead:e.number().nonnegative().default(0),cacheWrite:e.number().nonnegative().default(0)})}),T=e.object({id:e.string().optional(),modelId:e.string().min(1,"Model ID is required"),name:e.string().min(0).default(""),config:Ce}),v=e.object({baseUrl:e.string().url("Must be a valid URL").optional().or(e.literal("")),apiKey:e.string().optional().or(e.literal("")),api:e.enum(Y),headers:e.record(e.string(),e.string()).optional(),authHeader:e.boolean().optional()}),dr=e.object({name:e.string().min(1,"Provider name is required"),config:v,models:e.array(T).min(1,"At least one model is required")}),fr=e.object({config:v,models:e.array(T).min(1,"At least one model is required")}),gr=e.object({id:e.string(),name:e.string(),isBuiltin:e.boolean(),config:v,models:e.array(T).optional(),modelsCount:e.number().optional(),createdAt:e.date(),updatedAt:e.date()});var Sr=e.object({name:e.string().min(1),expireAt:e.string().datetime().optional(),password:e.string().optional(),isDisabled:e.boolean().optional(),allowDownload:e.boolean().optional(),defaultSortOrder:e.string().optional(),viewMode:e.string().optional()}),_r=e.object({name:e.string().min(1).optional(),expireAt:e.string().datetime().optional().nullable(),password:e.string().optional().nullable(),isDisabled:e.boolean().optional(),allowDownload:e.boolean().optional(),defaultSortOrder:e.string().optional().nullable(),viewMode:e.string().optional().nullable(),fieldVisibility:e.record(e.string(),e.boolean()).optional().nullable()}),xr=a.extend({projectId:e.string().optional()}),Rr=e.object({assetIds:e.array(e.string().min(1)).min(1)});var Tr=e.object({assetId:e.string().optional(),githubUrl:e.string().optional(),override:e.boolean().optional()}),vr=e.object({config:e.object({environmentVariables:e.array(e.object({name:e.string(),default:e.string().optional()}))})}),jr=e.object({permission:e.enum(["owner","editor","reviewer"])});var J=e.lazy(()=>e.object({name:e.string(),id:e.string(),size:e.number(),children:e.array(J),type:e.string(),mediaType:e.string().optional()})),Er=e.object({parentId:e.string(),files:e.array(J)}),Me=e.object({id:e.string(),fileId:e.string(),url:e.string()}),Cr=e.object({taskId:e.string(),presignedUrls:e.array(Me),createdAssets:e.array(e.object({tempId:e.string(),assetId:e.string()})).optional()}),Mr=e.object({fileId:e.string(),errorMessage:e.string().optional()}),Dr=e.object({id:e.string(),name:e.string(),total:e.number(),uploaded:e.number(),createdAt:e.string()}),Ur=e.object({bucket:e.string(),key:e.string(),Signature:e.string()}),Kr=e.object({file:e.instanceof(File)});var De=e.object({key:e.string(),value:e.unknown()}),Qr=e.object({value:e.unknown()}),Lr=e.array(De);var Fr=e.object({fileIds:e.array(e.string())}),Gr=e.object({fileId:e.string(),beforeId:e.string()}),Vr=e.object({id:e.string(),version:e.number(),name:e.string().optional().nullable(),previewUrl:e.string().optional().nullable(),createdAt:e.string().optional().nullable(),creator:e.object({id:e.string(),name:e.string().nullable(),image:e.string().optional().nullable()}).nullable().optional()});var Br=e.object({agentId:e.string(),textPrompt:e.string().optional(),attachedFiles:e.array(e.string()).optional(),assetIds:e.array(e.string()).optional(),sessionId:e.string().optional(),contextAssetId:e.string().optional(),projectId:e.string().optional()}).superRefine((t,r)=>{let n=t.textPrompt&&t.textPrompt.trim().length>0,b=t.attachedFiles&&t.attachedFiles.length>0,oe=t.assetIds&&t.assetIds.length>0;if(!n&&!b&&!oe)r.addIssue({code:e.ZodIssueCode.custom,message:"At least one of textPrompt, attachedFiles, or assetIds must be provided.",path:["textPrompt"]})}),Zr=e.object({id:e.string(),agentId:e.string(),userId:e.string().nullable(),assetId:e.string().nullable(),userCommentId:e.string().nullable(),name:e.string().nullable().optional(),createdAt:e.string(),updatedAt:e.string()}),Yr=e.intersection(e.object({id:e.string()}),e.unknown());var y;((o)=>{o.team_create="team_create";o.team_update="team_update";o.team_delete="team_delete";o.team_member_add="team_member_add";o.team_member_update="team_member_update";o.team_member_remove="team_member_remove";o.project_create="project_create";o.project_update="project_update";o.project_delete="project_delete";o.project_empty_trash="project_empty_trash";o.project_member_add="project_member_add";o.project_member_update="project_member_update";o.project_member_remove="project_member_remove";o.file_create="file_create";o.file_update="file_update";o.file_delete="file_delete";o.folder_create="folder_create";o.folder_update="folder_update";o.folder_delete="folder_delete";o.asset_reparent="asset_reparent";o.asset_copy="asset_copy";o.share_create="share_create";o.share_update="share_update";o.share_delete="share_delete";o.agent_create="agent_create";o.agent_update="agent_update";o.agent_delete="agent_delete";o.skill_create="skill_create";o.skill_update="skill_update";o.skill_delete="skill_delete";o.mcp_server_create="mcp_server_create";o.mcp_server_update="mcp_server_update";o.mcp_server_delete="mcp_server_delete";o.provider_create="provider_create";o.provider_update="provider_update";o.provider_delete="provider_delete";o.invite_create="invite_create";o.invite_revoke="invite_revoke";o.metadata_field_create="metadata_field_create";o.metadata_field_update="metadata_field_update";o.metadata_field_delete="metadata_field_delete";o.comment_create="comment_create";o.comment_update="comment_update";o.comment_delete="comment_delete";o.comment_complete="comment_complete";o.quota_rule_create="quota_rule_create";o.quota_rule_update="quota_rule_update";o.quota_rule_delete="quota_rule_delete";o.quota_record_reset="quota_record_reset";o.quota_policy_create="quota_policy_create";o.quota_policy_update="quota_policy_update";o.quota_policy_delete="quota_policy_delete";o.kanban_goal_create="kanban_goal_create";o.kanban_goal_update="kanban_goal_update";o.kanban_goal_delete="kanban_goal_delete";o.kanban_task_create="kanban_task_create";o.kanban_task_update="kanban_task_update";o.kanban_task_delete="kanban_task_delete";o.kanban_comment_create="kanban_comment_create";o.kanban_comment_delete="kanban_comment_delete";o.kanban_dependency_add="kanban_dependency_add";o.kanban_dependency_remove="kanban_dependency_remove"})(y||={});var Ue=e.object({id:e.string(),action:e.nativeEnum(y),teamId:e.string(),userId:e.string().nullable().optional(),projectId:e.string().nullable().optional(),itemId:e.string().nullable().optional(),createdAt:e.string()}),$r=e.object({first:e.coerce.number().optional(),after:e.string().optional(),actions:e.union([e.nativeEnum(y),e.array(e.nativeEnum(y))]).transform((t)=>Array.isArray(t)?t:[t]).optional(),userIds:e.union([e.string(),e.array(e.string())]).transform((t)=>Array.isArray(t)?t:[t]).optional(),itemId:e.string().optional()}),zr=e.object({nodes:e.array(Ue),pageInfo:e.object({hasNextPage:e.boolean(),endCursor:e.string().nullable()}),total:e.number()});var Ke=e.object({id:e.string(),type:e.literal("text"),x:e.number().min(0).max(1),y:e.number().min(0).max(1),opacity:e.number().min(0).max(1),rotation:e.number().min(-180).max(180),text:e.string(),size:e.number().positive().max(1),color:e.string()}),Ne=e.object({id:e.string(),type:e.literal("image"),x:e.number().min(0).max(1),y:e.number().min(0).max(1),opacity:e.number().min(0).max(1),rotation:e.number().min(-180).max(180),imageAssetKey:e.string().min(1),imageAssetUrl:e.string().optional(),size:e.number().positive().max(1)}),we=e.discriminatedUnion("type",[Ke,Ne]),j=e.object({blocks:e.array(we)}),oa=e.object({name:e.string().min(1),teamId:e.string().optional(),config:j}),ra=e.object({name:e.string().min(1).optional(),config:j.optional()}),aa=e.object({enabled:e.boolean(),config:j.optional()}).superRefine((t,r)=>{if(t.enabled&&(!t.config||t.config.blocks.length===0))r.addIssue({code:"custom",path:["config"],message:"Watermark configuration is required when enabling watermark"})});var q=e.nativeEnum(w),P=e.enum(["1hour","5hour","1day","7day","one_hour","five_hours","one_day","seven_days"]);function ca(t){switch(t){case"one_hour":case"1hour":return"1hour";case"five_hours":case"5hour":return"5hour";case"one_day":case"1day":return"1day";case"seven_days":case"7day":return"7day";default:return t}}var E=e.nativeEnum(Q),C=e.enum(["owner","editor","reviewer"]),X=e.object({id:e.string().min(1,"MCP server ID is required")}),$=e.object({match:e.string().min(1,"Bash match wildcard is required")}),z=e.object({name:e.string().min(1,"Tool name is required")}),M=e.record(e.string(),e.unknown()),Qe=e.object({id:e.string().nullable(),ruleId:e.string(),teamId:e.string(),userId:e.string().nullable().optional(),user:e.object({id:e.string(),name:e.string(),email:e.string(),image:e.string().nullable().optional()}).nullable().optional(),periodStart:e.string().nullable().optional(),periodEnd:e.string().nullable().optional(),consumed:e.number(),remaining:e.number(),percent:e.number(),isWindowActive:e.boolean()}),la=e.object({records:e.array(Qe),total:e.number()}),Le=e.object({id:e.string(),teamId:e.string(),scopeMode:q,role:C.nullable().optional(),userIds:e.array(e.string()).nullable().optional(),resource:E,resourceData:M.nullable().optional(),limit:e.number(),period:P,enabled:e.boolean(),recordsCount:e.number().optional(),createdAt:e.string(),updatedAt:e.string()}),ma=e.object({rules:e.array(Le),total:e.number()}),ua=e.object({scopeMode:q,role:C.optional().nullable(),userIds:e.array(e.string()).optional().nullable(),resource:E,resourceData:M.optional().nullable(),limit:e.number().positive("Limit must be greater than 0"),period:P,enabled:e.boolean().optional().default(!0)}).superRefine((t,r)=>{if(t.scopeMode==="selected_members"){if(!t.userIds||t.userIds.length===0)r.addIssue({code:e.ZodIssueCode.custom,message:'userIds must contain at least one user when scopeMode is "selected_members"',path:["userIds"]})}if(t.resource==="agent_mcp_call_count"){if(!X.safeParse(t.resourceData).success)r.addIssue({code:e.ZodIssueCode.custom,message:"resourceData.id is required for agent_mcp_call_count",path:["resourceData","id"]})}else if(t.resource==="agent_bash_call_count"){if(!$.safeParse(t.resourceData).success)r.addIssue({code:e.ZodIssueCode.custom,message:"resourceData.match is required for agent_bash_call_count",path:["resourceData","match"]})}else if(t.resource==="agent_tool_call_count"){if(!z.safeParse(t.resourceData).success)r.addIssue({code:e.ZodIssueCode.custom,message:"resourceData.name is required for agent_tool_call_count",path:["resourceData","name"]})}}),da=e.object({userId:e.string().nullable()}),fa=e.object({scopeMode:q.optional(),role:C.optional().nullable(),userIds:e.array(e.string()).optional().nullable(),resource:E.optional(),resourceData:M.optional().nullable(),limit:e.number().positive("Limit must be greater than 0").optional(),period:P.optional(),enabled:e.boolean().optional()}).superRefine((t,r)=>{if(t.scopeMode==="selected_members"&&t.userIds!==void 0){if(!t.userIds||t.userIds.length===0)r.addIssue({code:e.ZodIssueCode.custom,message:'userIds must contain at least one user when scopeMode is "selected_members"',path:["userIds"]})}if(t.resource==="agent_mcp_call_count"&&t.resourceData!==void 0){if(!X.safeParse(t.resourceData).success)r.addIssue({code:e.ZodIssueCode.custom,message:"resourceData.id is required for agent_mcp_call_count",path:["resourceData","id"]})}else if(t.resource==="agent_bash_call_count"&&t.resourceData!==void 0){if(!$.safeParse(t.resourceData).success)r.addIssue({code:e.ZodIssueCode.custom,message:"resourceData.match is required for agent_bash_call_count",path:["resourceData","match"]})}else if(t.resource==="agent_tool_call_count"&&t.resourceData!==void 0){if(!z.safeParse(t.resourceData).success)r.addIssue({code:e.ZodIssueCode.custom,message:"resourceData.name is required for agent_tool_call_count",path:["resourceData","name"]})}});var ba="unassigned",ha=e.object({title:e.string().min(1),description:e.string().optional()}),Sa=e.object({title:e.string().min(1).optional(),description:e.string().nullable().optional()}),Ae=e.object({id:e.string(),title:e.string(),description:e.string().nullable().optional(),teamId:e.string(),creatorId:e.string().nullable().optional(),taskCount:e.number().optional(),createdAt:e.union([e.string(),e.date()]),updatedAt:e.union([e.string(),e.date()])}),_a=e.object({}),xa=e.object({data:e.array(Ae)});var i=e.object({id:e.string(),name:e.string(),image:e.string().optional()}),Oe=e.object({summary:e.string().optional(),blockReason:e.string().optional(),blockKind:e.string().optional(),reason:e.string().optional(),assets:e.array(e.object({id:e.string(),type:e.string().optional(),name:e.string().optional(),description:e.string().optional()})).optional()}).passthrough(),D=e.object({id:e.string(),taskId:e.string(),actor:i.nullable().optional(),type:e.nativeEnum(d),fromStatus:e.nativeEnum(s).nullable().optional(),toStatus:e.nativeEnum(s).nullable().optional(),data:Oe.nullable().optional(),createdAt:e.union([e.string(),e.date()])}),Ta=e.object({data:e.array(D)});var Fe=e.object({id:e.string(),name:e.string(),key:e.string(),sizeByte:e.number(),contentType:e.string().nullable().optional(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional()}),Ge=e.object({id:e.string(),name:e.string(),sizeByte:e.number(),contentType:e.string().nullable().optional(),url:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional()}),Pa=e.object({id:e.string(),name:e.string(),key:e.string(),sizeByte:e.number(),contentType:e.string().nullable().optional(),uploadUrl:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional()}),Ea=e.object({body:e.string().default(""),attachments:e.array(Fe).optional()}).refine((t)=>t.body.trim().length>0||t.attachments&&t.attachments.length>0,{message:"Comment body or attachments required"}),U=e.object({id:e.string(),taskId:e.string(),author:i,body:e.string(),attachments:e.array(Ge).default([]),createdAt:e.union([e.string(),e.date()]),updatedAt:e.union([e.string(),e.date()])}),Ca=e.object({data:e.array(U)});var Qa=e.object({title:e.string().min(1),description:e.string().optional(),isAgentTask:e.boolean().optional(),priority:e.nativeEnum(c).optional(),startDate:e.union([e.string(),e.date()]).optional(),dueDate:e.union([e.string(),e.date()]).optional(),goalId:e.string().optional(),projectId:e.string().optional(),reporterId:e.string().optional(),assigneeId:e.string().optional(),targetFolderId:e.string().optional(),parentIds:e.array(e.string()).optional(),assetIds:e.array(e.string()).optional()}),La=e.object({fromStatus:e.nativeEnum(s).optional(),title:e.string().min(1).optional(),description:e.string().nullable().optional(),status:e.nativeEnum(s).optional(),reason:e.string().optional(),priority:e.nativeEnum(c).optional(),startDate:e.union([e.string(),e.date()]).nullable().optional(),dueDate:e.union([e.string(),e.date()]).nullable().optional(),goalId:e.string().nullable().optional(),projectId:e.string().nullable().optional(),reporterId:e.string().nullable().optional(),assigneeId:e.string().nullable().optional(),targetFolderId:e.string().nullable().optional(),beforeIndex:e.string().optional(),afterIndex:e.string().optional(),parentIds:e.array(e.string()).optional(),assetIds:e.array(e.string()).optional()}),Aa=e.object({status:e.nativeEnum(s).optional(),isAgentTask:e.union([e.boolean(),e.string()]).transform((t)=>t===!0||t==="true").optional(),goalId:e.string().optional(),projectId:e.string().optional(),priority:e.nativeEnum(c).optional(),assigneeId:e.string().optional(),reporterId:e.string().optional()}).merge(a),Ve=e.object({id:e.string(),type:e.nativeEnum(d),actor:i.nullable().optional(),summary:e.string().optional(),blockReason:e.string().optional(),blockKind:e.string().optional(),reason:e.string().optional(),createdAt:e.union([e.string(),e.date()])}),We=e.object({id:e.string(),title:e.string()}),ee=e.object({id:e.string(),title:e.string(),isAgentTask:e.boolean(),status:e.nativeEnum(s),priority:e.nativeEnum(c),sortIndex:e.string().nullable().optional()}),He=e.object({id:e.string(),name:e.string(),type:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),thumbnailUrl:e.string().nullable().optional(),path:e.string(),creator:i.nullable().optional(),sizeByte:e.number().optional(),fileCount:e.number().optional(),projectId:e.string().nullable().optional(),createdAt:e.union([e.string(),e.date()])}),K=e.object({id:e.string(),title:e.string(),description:e.string().nullable().optional(),isAgentTask:e.boolean(),status:e.nativeEnum(s),priority:e.nativeEnum(c),startDate:e.union([e.string(),e.date()]).nullable().optional(),dueDate:e.union([e.string(),e.date()]).nullable().optional(),startedAt:e.union([e.string(),e.date()]).nullable().optional(),completedAt:e.union([e.string(),e.date()]).nullable().optional(),teamId:e.string(),projectId:e.string().nullable().optional(),sortIndex:e.string().nullable().optional(),creator:i,reporter:i.nullable().optional(),assignee:i.nullable().optional(),goal:We.nullable().optional(),targetFolderId:e.string().nullable().optional(),latestStatusEvent:Ve.nullable().optional(),commentCount:e.number().default(0),dependencyCount:e.number().default(0),dependentCount:e.number().default(0),assetCount:e.number().default(0),createdAt:e.union([e.string(),e.date()]),updatedAt:e.union([e.string(),e.date()])}),Oa=K.extend({dependencies:e.array(ee),dependents:e.array(ee),assets:e.array(He),comments:e.array(U),events:e.array(D)}),Fa=e.object({data:e.array(K),pageInfo:p}),Ga=e.object({taskId:e.string()}),Va=e.object({assetIds:e.array(e.string())}),Wa=e.object({data:e.array(K),total:e.number()});var en=e.object({assetId:e.string()});function Dn({...t}){return l(m.Root,{"data-slot":"popover",...t})}function Un({...t}){return l(m.Trigger,{"data-slot":"popover-trigger",...t})}function Kn({className:t,align:r="center",sideOffset:n=4,...b}){return l(m.Portal,{children:l(m.Content,{"data-slot":"popover-content",align:r,sideOffset:n,className:te("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",t),...b})})}
|
|
2
|
-
export{Dn as Cf,Un as Df,Kn as Ef,s as Ff,c as Gf,d as Hf,O as If,vo as Jf,Re as Kf,Y as Lf,T as Mf,v as Nf,ae as Of,y as Pf,ca as Qf,ba as Rf};
|
package/bin/chunk-8ekjxb5q.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{an as h}from"./chunk-69at8jm8.js";function W(j,z){var w=j.length;j.push(z);j:for(;0<w;){var A=w-1>>>1,B=j[A];if(0<S(B,z))j[A]=z,j[w]=B,w=A;else break j}}function F(j){return j.length===0?null:j[0]}function U(j){if(j.length===0)return null;var z=j[0],w=j.pop();if(w!==z){j[0]=w;j:for(var A=0,B=j.length,Y=B>>>1;A<Y;){var q=2*(A+1)-1,M=j[q],N=q+1,C=j[N];if(0>S(M,w))N<B&&0>S(C,M)?(j[A]=C,j[N]=w,A=N):(j[A]=M,j[q]=w,A=q);else if(N<B&&0>S(C,w))j[A]=C,j[N]=w,A=N;else break j}}return z}function S(j,z){var w=j.sortIndex-z.sortIndex;return w!==0?w:j.id-z.id}function Q(j){for(var z=F(J);z!==null;){if(z.callback===null)U(J);else if(z.startTime<=j)U(J),z.sortIndex=z.expirationTime,W(G,z);else break;z=F(J)}}function k(j){if(_=!1,Q(j),!Z)if(F(G)!==null)Z=!0,X||(X=!0,V());else{var z=F(J);z!==null&&y(k,z.startTime-j)}}function d(){return x?!0:K()-v<m?!1:!0}function D(){if(x=!1,X){var j=K();v=j;var z=!0;try{j:{Z=!1,_&&(_=!1,L($),$=-1),I=!0;var w=O;try{w:{Q(j);for(E=F(G);E!==null&&!(E.expirationTime>j&&d());){var A=E.callback;if(typeof A==="function"){E.callback=null,O=E.priorityLevel;var B=A(E.expirationTime<=j);if(j=K(),typeof B==="function"){E.callback=B,Q(j),z=!0;break w}E===F(G)&&U(G),Q(j)}else U(G);E=F(G)}if(E!==null)z=!0;else{var Y=F(J);Y!==null&&y(k,Y.startTime-j),z=!1}}break j}finally{E=null,O=w,I=!1}z=void 0}}finally{z?V():X=!1}}}function y(j,z){$=T(function(){j(K())},z)}var K=void 0,b,R,P,G,J,c=1,E=null,O=3,I=!1,Z=!1,_=!1,x=!1,T,L,f,X=!1,$=-1,m=5,v=-1,V,H,g,u=5,s=1,p=4,l=3,a=2,n=function(j){j.callback=null},o=function(){return O},t=function(){x=!0},i=function(j,z){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var w=O;O=j;try{return z()}finally{O=w}},r=function(j,z,w){var A=K();switch(typeof w==="object"&&w!==null?(w=w.delay,w=typeof w==="number"&&0<w?A+w:A):w=A,j){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5000}return B=w+B,j={id:c++,callback:z,priorityLevel:j,startTime:w,expirationTime:B,sortIndex:-1},w>A?(j.sortIndex=w,W(J,j),F(G)===null&&j===F(J)&&(_?(L($),$=-1):_=!0,y(k,w-A))):(j.sortIndex=B,W(G,j),Z||I||(Z=!0,X||(X=!0,V()))),j},e;var jj=h(()=>{if(typeof performance==="object"&&typeof performance.now==="function")b=performance,K=function(){return b.now()};else R=Date,P=R.now(),K=function(){return R.now()-P};G=[],J=[],T=typeof setTimeout==="function"?setTimeout:null,L=typeof clearTimeout==="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;if(typeof f==="function")V=function(){f(D)};else if(typeof MessageChannel<"u")H=new MessageChannel,g=H.port2,H.port1.onmessage=D,V=function(){g.postMessage(null)};else V=function(){T(D,0)};e=d});
|
|
2
|
-
export{K as $e,u as af,s as bf,p as cf,l as df,a as ef,n as ff,o as gf,t as hf,i as if,r as jf,e as kf,jj as lf};
|
package/bin/chunk-8zar6cc4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Li as e,Ll as o,Wl as t}from"./chunk-48yphy68.js";function n({className:a,...r}){return e(o.Root,{"data-slot":"label",className:t("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",a),...r})}
|
|
2
|
-
export{n as Ii};
|
package/bin/chunk-9m9bn55a.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as x}from"./chunk-h7kyj2g2.js";import"./chunk-0wgqr4jg.js";import"./chunk-mkwrrdme.js";import"./chunk-hks5k0tm.js";import"./chunk-n2ae527q.js";import"./chunk-kchbbtdm.js";import"./chunk-0ash207y.js";import"./chunk-12ps84z8.js";import"./chunk-kcg7d7pk.js";import"./chunk-har4xctf.js";import"./chunk-nw03w9pa.js";import{qe as f}from"./chunk-rr12edz4.js";import{we as p}from"./chunk-gwzk0fvn.js";import"./chunk-nzrrvn6c.js";import"./chunk-y1pnq12c.js";import"./chunk-8ekjxb5q.js";import"./chunk-7anqxpyv.js";import"./chunk-6ts5az6h.js";import"./chunk-31f07jzm.js";import"./chunk-02b97gsf.js";import"./chunk-5nk7y4ec.js";import"./chunk-mm995mvc.js";import"./chunk-8b11b9cj.js";import"./chunk-wch8ygpt.js";import"./chunk-ntqn09r0.js";import"./chunk-esa954t1.js";import"./chunk-ctx1ms5t.js";import"./chunk-bthrbggg.js";import"./chunk-day0vn14.js";import"./chunk-3ztat2q9.js";import"./chunk-2s97ngr8.js";import"./chunk-dyen2t1p.js";import"./chunk-sepsqqdf.js";import"./chunk-y0k1f3gk.js";import"./chunk-dwkv3bx5.js";import"./chunk-qh3w5w8e.js";import"./chunk-4pj17byj.js";import"./chunk-ps2hw0ps.js";import"./chunk-qrnw89xg.js";import"./chunk-5dfy6173.js";import{ai as h}from"./chunk-qrhf20g2.js";import{hi as l,ii as r,qi as c}from"./chunk-jsqsrcse.js";import"./chunk-8zar6cc4.js";import{Ji as w,Li as a,Wi as o}from"./chunk-48yphy68.js";import{Zm as m}from"./chunk-69at8jm8.js";var g=m(w(),1);function v(){let{projectId:e}=d.useParams(),{teamId:s,ensureTeamIdForProject:n}=h();g.useEffect(()=>{n(e)},[e,n]);let{data:i}=r(f(e)),t=i?.rootFolder,{data:b}=l({queryKey:["folders",t],queryFn:()=>(async()=>{return await(await c.api.folders[":folderId"].$get({param:{folderId:t}})).json()})(),enabled:!!t});if(!s||!t||!b)return a(p,{});return a(x,{teamId:s,projectId:e,projectName:i.name??"",assetId:"recently-deleted",rootFolderId:t})}var d=o("/projects/$projectId/recently-deleted")({component:v});export{d as Route};
|
package/bin/chunk-ayr3tsz3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{s,u as e,v as R}from"./chunk-n2ae527q.js";import{Qh as X1,Sh as Y1,Th as _1,Uh as $1}from"./chunk-qrhf20g2.js";import{hi as Q1,qi as o}from"./chunk-jsqsrcse.js";import{$l as n,Ek as a,Ji as S1,Jj as W1,Jk as i,Ki as d,Kj as G1,Li as W,Mi as N,Wl as C,_j as H1,kj as A,yl as J1}from"./chunk-48yphy68.js";import{Zm as A1}from"./chunk-69at8jm8.js";function l1({file:J,mediaControllerRef:$,onPlay:K,onPause:Q,onTimeUpdate:q,annotations:X,startTime:M,shareId:f,allowDownload:Z,children:U}){let V=R(J),w=V.viewer;return W(w,{ref:$,file:J,onPlay:K,onPause:Q,onTimeUpdate:q,annotations:X,startTime:M,shareId:f,allowDownload:Z,children:U},V.id)}var G=A1(S1(),1);function z1({activeState:J,activeAsset:$,previewUrl:K,isFullScreen:Q,onTogglePlay:q,onToggleLoop:X,onSeek:M,onVolumeChange:f,onToggleMute:Z,onChangePlaybackRate:U,onChangeResolution:V,onZoomIn:w,onZoomOut:m,onFit:p,onDownload:P,onToggleFullScreen:B,allowDownload:D=!0}){if(J?.kind==="video"&&J.video&&$){let Y=J.video,T=Y.totalFrames/Y.frameRate,j=Y.currentFrame/Y.frameRate,S={isPlaying:Y.isPlaying,progress:T>0?j/T*100:0,currentTime:j,duration:T,volume:Y.volume,isMuted:Y.isMuted,isLooping:Y.isLooping,playbackRate:Y.playbackRate,isFullScreen:Q,showFrames:!1,currentResolution:Y.currentResolution},h=K&&!$.media?.videoPreview?{...$,media:{...$.media,videoPreview:{url:K}}}:$;return W(s,{state:S,zoom:J.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:Y.buffered,data:h,resolutions:Y.resolutions,togglePlay:q,toggleLoop:X,toggleMute:Z,handleVolumeChange:f,changePlaybackRate:U,changeResolution:(F)=>V(F.resolution),handleDownload:(F)=>P(F),toggleFullScreen:B,onZoomChange:(F)=>F>=J.zoom?w():m(),onZoomReset:p,frameRate:Y.frameRate,totalFrames:Y.totalFrames,currentFrame:Y.currentFrame,seekToFrame:M,allowDownload:D})}if(J?.kind==="image")return W(e,{zoom:J.zoom,onZoomIn:w,onZoomOut:m,onFit:p,onDownload:()=>P(),canDownload:!!$?.media?.original?.key,fullscreen:{isFullScreen:Q,onToggle:B},allowDownload:D});return W("div",{className:"relative z-10 flex items-center justify-end gap-2 border-t border-border bg-card px-4 py-3",children:W("button",{onClick:B,className:"text-foreground transition-colors hover:text-primary",title:"Fullscreen",children:Q?W(i,{className:"h-5 w-5"}):W(a,{className:"h-5 w-5"})})})}function c({side:J,fileName:$,version:K,activeVersionId:Q,versions:q,isActive:X,onActivate:M,onSwitchVersion:f,onExit:Z}){let U=C("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",X?"text-foreground":"text-muted-foreground hover:text-foreground"),V=W("button",{onClick:Z,title:n.exit_compare(),className:U,children:W(J1,{className:"h-4 w-4"})}),w=N("button",{onClick:M,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:[W("span",{className:"truncate",children:$}),K!==void 0&&N("span",{className:C("flex-shrink-0 rounded border px-1 py-0 text-xs",X?"border-foreground/40":"border-border"),children:["v",K]})]}),m=N(X1,{children:[W(Y1,{onClick:M,title:n.switch_version(),className:U,children:W(G1,{className:"h-4 w-4"})}),W(_1,{align:J==="left"?"start":"end",className:"w-80 p-1",children:W("div",{className:"flex max-h-96 flex-col gap-1 overflow-y-auto",children:q.map((p)=>{let P=p.id===Q;return N($1,{onClick:()=>f(p.id),className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2",children:[N("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",p.version]}),W("div",{className:"flex h-10 w-16 flex-shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:p.previewUrl?W("img",{src:p.previewUrl,alt:p.name||void 0,className:"h-full w-full object-cover"}):W(H1,{className:"h-4 w-4 text-muted-foreground"})}),N("div",{className:"flex min-w-0 flex-1 flex-col text-left",children:[W("span",{className:"truncate text-sm font-semibold text-foreground",children:p.name}),W("span",{className:"truncate text-xs text-muted-foreground",children:p.creator?.name||"Unknown"})]}),P&&W(W1,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},p.id)})})})]});return W("div",{onMouseDown:M,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:J==="left"?N(d,{children:[V,w,m]}):N(d,{children:[w,m,W("div",{className:"ml-auto"}),V]})})}function K1(J,$,K){return Q1({queryKey:$?["public-share-file",K,J,localStorage.getItem(`share_pwd_${K}`)||""]:["files",J],queryFn:async()=>{if($){let q=localStorage.getItem(`share_pwd_${K}`)||"",X=await o.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:K,fileId:J}},{headers:{"x-share-password":q}});if(!X.ok)throw Error("Failed to fetch version asset");return await X.json()}let Q=await o.api.files[":fileId"].$get({param:{fileId:J}});if(!Q.ok)throw Error("Failed to fetch version asset");return await Q.json()},enabled:!!J&&(!$||!!K)})}function Oz({isPublic:J=!1,shareId:$,versions:K,leftId:Q,rightId:q,activeSide:X,annotations:M,seekRequest:f,onActiveSideChange:Z,onSwitchVersion:U,onExit:V,onActiveAssetChange:w,onPlay:m,onTimeUpdate:p,allowDownload:P=!0}){let B=G.useRef(null),D=G.useRef(null),Y=G.useRef(null),[T,j]=G.useState(null),[S,h]=G.useState(null),[F,p1]=G.useState(1),[N1,l]=G.useState(!1),[O1,q1]=G.useState(!1),{data:y,isLoading:f1}=K1(Q,J,$),{data:b,isLoading:V1}=K1(q,J,$),w1=R(y),M1=R(b),E=!!y&&!!b&&w1.id===M1.id,k=X==="left"?y:b,g=X==="left"?T:S,L=G.useCallback(()=>X==="left"?D.current:Y.current,[X]),u=G.useCallback(()=>X==="left"?Y.current:D.current,[X]);G.useEffect(()=>{w(k??null)},[k,w]),G.useEffect(()=>{if(!f)return;let z=L();if(z?.seekToSecond(f.second),z?.pause(),E){let H=u();H?.seekToSecond(f.second),H?.pause()}},[f?.nonce]),G.useEffect(()=>{let z=()=>q1(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",z),()=>document.removeEventListener("fullscreenchange",z)},[]);let Z1=G.useCallback((z)=>j(z),[]),U1=G.useCallback((z)=>h(z),[]),O=G.useCallback((z)=>{let H=L();if(H)z(H);if(E){let _=u();if(_)z(_)}},[L,u,E]),x=G.useCallback(()=>{let z=!g?.video?.isPlaying;O((H)=>z?H.play():H.pause())},[g?.video?.isPlaying,O]);G.useEffect(()=>{let z=(H)=>{let _=document.activeElement;if(_&&(_.tagName==="INPUT"||_.tagName==="TEXTAREA"||_ instanceof HTMLElement&&_.isContentEditable))return;let r=H.key===" ",I=_&&(_.tagName==="BUTTON"||_.tagName==="A"||_.tagName==="SELECT"||_.tagName==="OPTION"||_.getAttribute("role")==="button"||_.getAttribute("role")==="link"||_.getAttribute("role")==="checkbox"||_.getAttribute("role")==="radio"||_.getAttribute("role")==="menuitem");if(r&&I)return;if(H.key===" "||H.key.toLowerCase()==="k")H.preventDefault(),x()};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[x]);let L1=G.useCallback((z)=>O((H)=>H.seekToFrame(z)),[O]),y1=G.useCallback(()=>L()?.toggleLoop(),[L]),b1=G.useCallback((z)=>{p1(z),l(z===0)},[]),m1=G.useCallback(()=>l((z)=>!z),[]),B1=G.useCallback((z)=>O((H)=>H.setPlaybackRate(z)),[O]),D1=G.useCallback((z)=>L()?.changeResolution(z),[L]),F1=G.useCallback(()=>O((z)=>z.zoomBy(1.2)),[O]),E1=G.useCallback(()=>O((z)=>z.zoomBy(0.8)),[O]),P1=G.useCallback(()=>O((z)=>z.fit()),[O]),R1=G.useCallback((z)=>{L()?.download(z)},[L]),T1=G.useCallback(()=>{if(!B.current)return;if(!document.fullscreenElement)B.current.requestFullscreen();else document.exitFullscreen()},[]),k1=G.useCallback((z,H)=>{if(E)Y.current?.panBy(z,H)},[E]),x1=G.useCallback((z,H)=>{if(E)D.current?.panBy(z,H)},[E]),I1=G.useCallback(()=>x(),[x]),v=G.useCallback((z)=>K.find((H)=>H.id===z)?.version,[K]),C1=G.useMemo(()=>k?.media?.videoPreview?.url,[k?.media?.videoPreview?.url]),t=(z,H)=>{let r=R(H)?.comparePane;if(!r)return W("div",{className:"flex flex-1 items-center justify-center bg-gray-100 dark:bg-gray-950",children:W("p",{className:"text-muted-foreground",children:"Preview unavailable"})});let I=X===z;return W(r,{ref:z==="left"?D:Y,file:H,shareId:$,isActive:I,annotations:I?M:[],onStateChange:z==="left"?Z1:U1,onUserPan:z==="left"?k1:x1,onActivate:()=>Z(z),muted:I?N1:!0,volume:F,onPlay:m,onTimeUpdate:p,onRequestTogglePlay:I1},H.id)},j1=!!y&&!!b,r1=f1||V1;return N("div",{ref:B,className:"flex h-full flex-1 flex-col bg-background",children:[N("div",{className:"flex min-h-0 flex-1",children:[N("div",{className:"flex min-w-0 flex-1 flex-col border-r border-zinc-800",children:[y&&W(c,{side:"left",fileName:y.name,version:v(Q),activeVersionId:Q,versions:K,isActive:X==="left",onActivate:()=>Z("left"),onSwitchVersion:(z)=>U("left",z),onExit:V}),W("div",{className:"relative flex min-h-0 flex-1",children:y?t("left",y):W("div",{className:"flex flex-1 items-center justify-center",children:W(A,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),N("div",{className:"flex min-w-0 flex-1 flex-col",children:[b&&W(c,{side:"right",fileName:b.name,version:v(q),activeVersionId:q,versions:K,isActive:X==="right",onActivate:()=>Z("right"),onSwitchVersion:(z)=>U("right",z),onExit:V}),W("div",{className:"relative flex min-h-0 flex-1",children:b?t("right",b):W("div",{className:"flex flex-1 items-center justify-center",children:W(A,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),r1&&!j1&&W("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:W(A,{className:"h-8 w-8 animate-spin text-foreground"})}),W(z1,{activeState:g,activeAsset:k??null,previewUrl:C1,isFullScreen:O1,onTogglePlay:x,onToggleLoop:y1,onSeek:L1,onVolumeChange:b1,onToggleMute:m1,onChangePlaybackRate:B1,onChangeResolution:D1,onZoomIn:F1,onZoomOut:E1,onFit:P1,onDownload:R1,onToggleFullScreen:T1,allowDownload:P})]})}
|
|
2
|
-
export{l1 as p,Oz as q};
|
package/bin/chunk-bthrbggg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{li as a,ni as l,oi as o}from"./chunk-jsqsrcse.js";var p=a()(o((i)=>({fileViewLeftSidebarCollapsed:!0,setFileViewLeftSidebarCollapsed:(e)=>i({fileViewLeftSidebarCollapsed:e}),fileViewRightSidebarCollapsed:!1,setFileViewRightSidebarCollapsed:(e)=>i({fileViewRightSidebarCollapsed:e}),fileListLeftSidebarCollapsed:!1,setFileListLeftSidebarCollapsed:(e)=>i({fileListLeftSidebarCollapsed:e}),fileListRightSidebarCollapsed:!0,setFileListRightSidebarCollapsed:(e)=>i({fileListRightSidebarCollapsed:e}),shareConfigLeftSidebarCollapsed:!1,setShareConfigLeftSidebarCollapsed:(e)=>i({shareConfigLeftSidebarCollapsed:e}),shareConfigRightSidebarCollapsed:!1,setShareConfigRightSidebarCollapsed:(e)=>i({shareConfigRightSidebarCollapsed:e}),viewModes:{},setViewMode:(e,d)=>i((s)=>({viewModes:{...s.viewModes,[e]:d}})),videoTimeDisplayMode:"standard",setVideoTimeDisplayMode:(e)=>i({videoTimeDisplayMode:e})}),{name:"ui-storage",storage:l(()=>localStorage)}));
|
|
2
|
-
export{p as $f};
|
package/bin/chunk-csh1ggtt.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as x}from"./chunk-7t31qfw5.js";import"./chunk-mkwrrdme.js";import"./chunk-kcg7d7pk.js";import{se as f}from"./chunk-tdp1jjv1.js";import{we as c}from"./chunk-gwzk0fvn.js";import"./chunk-wch8ygpt.js";import"./chunk-ntqn09r0.js";import"./chunk-esa954t1.js";import"./chunk-ctx1ms5t.js";import"./chunk-bthrbggg.js";import"./chunk-day0vn14.js";import"./chunk-3ztat2q9.js";import"./chunk-2s97ngr8.js";import"./chunk-dyen2t1p.js";import"./chunk-sepsqqdf.js";import"./chunk-4pj17byj.js";import"./chunk-ps2hw0ps.js";import{ai as s}from"./chunk-qrhf20g2.js";import{hi as d,ii as l,qi as b}from"./chunk-jsqsrcse.js";import{Ji as m,Li as e,Wi as p}from"./chunk-48yphy68.js";import{Zm as u}from"./chunk-69at8jm8.js";var g=u(m(),1);function v(){let{projectId:i}=k.useParams(),{teamId:r,ensureTeamIdForProject:t}=s();g.useEffect(()=>{t(i)},[i,t]);let{data:a}=l(f(i)),o=a?.rootFolder,{data:h}=d({queryKey:["folders",o],queryFn:async()=>{let n=await b.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||!h)return e(c,{});return e(x,{teamId:r,projectId:i,projectName:a.name??"",assetId:o,rootFolderId:o,isRoot:!0})}var k=p("/projects/$projectId/agentsmd")({component:v});export{k as Route};
|
package/bin/chunk-ctx1ms5t.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Li as o,Ql as t,Wl as a}from"./chunk-48yphy68.js";function m({className:r,orientation:i="horizontal",decorative:e=!0,...n}){return o(t.Root,{"data-slot":"separator",decorative:e,orientation:i,className:a("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",r),...n})}
|
|
2
|
-
export{m as _f};
|
package/bin/chunk-day0vn14.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Ng as _K,Pg as xJ}from"./chunk-3ztat2q9.js";import{Rg as GJ}from"./chunk-2s97ngr8.js";import{Ug as QJ}from"./chunk-sepsqqdf.js";import{Qh as BJ,Sh as bJ,Th as qJ,Uh as F,Yh as XK,bi as YK}from"./chunk-qrhf20g2.js";import{Ai as GK,Bi as zK,Ci as QK,Di as HK,Ei as UK,Fi as BK,Gi as bK,Hi as qK,ei as nJ,ji as y,ki as zJ,qi as U,ri as SJ,ti as fJ,ui as hJ,vi as DJ,wi as uJ,xi as ZK,yi as z}from"./chunk-jsqsrcse.js";import{$l as W,Dj as oJ,Ji as TK,Ki as dJ,Kj as sJ,Li as J,Mi as X,Mj as tJ,Oj as _J,Pi as TJ,Pj as $J,Qi as S,Qk as RJ,Ri as HJ,Rj as eJ,Wl as V,Xj as gJ,Yl as E,al as WK,am as $K,bk as JK,ek as KK,ij as UJ,kj as j,ll as IJ,qj as aJ,sj as rJ,tk as kJ}from"./chunk-48yphy68.js";import{Zm as wK}from"./chunk-69at8jm8.js";var _=wK(TK(),1);function nK({teamId:B,projectId:Y,projectName:$,rootFolderId:P,dragState:b,onSelect:M,selectedFolderId:A,hideCollections:c,hideShares:v,hideRecentlyDeleted:f,hideRecents:h,ancestorFolders:D}){let Q=HJ(),q=nJ(),{canEdit:O}=YK(Y),r=TJ({from:"/projects/$projectId/recently-deleted",shouldThrow:!1}),o=TJ({from:"/projects/$projectId/recents",shouldThrow:!1}),[u,VJ]=_.useState(!0),[g,AJ]=_.useState(!0),[w,i]=_.useState(!0),{data:T,fetchNextPage:s,hasNextPage:t,isFetchingNextPage:I}=zJ({queryKey:["shares",Y],queryFn:async({pageParam:K})=>{let Z=await U.api.projects[":projectId"].shares.$get({param:{projectId:Y},query:{first:"20",after:K}});if(!Z.ok)throw Error(W.failed_fetch_share_links());return await Z.json()},initialPageParam:"",getNextPageParam:(K)=>K.pageInfo?.cursor||void 0,enabled:!!Y}),{data:l,fetchNextPage:e,hasNextPage:JJ,isFetchingNextPage:d}=zJ({queryKey:["collections",Y],queryFn:async({pageParam:K})=>{let Z=await U.api.projects[":projectId"].collections.$get({param:{projectId:Y},query:{first:"20",after:K}});if(!Z.ok)throw Error(W.failed_fetch_collections());return await Z.json()},initialPageParam:"",getNextPageParam:(K)=>K.pageInfo?.cursor||void 0,enabled:!!Y}),{ref:OJ,inView:KJ}=QJ(),{ref:PJ,inView:WJ}=QJ();_.useEffect(()=>{if(KJ&&JJ&&!d)e()},[KJ,JJ,d,e]),_.useEffect(()=>{if(WJ&&t&&!I)s()},[WJ,t,I,s]);let MJ=_.useMemo(()=>l?.pages.flatMap((K)=>K.data)||[],[l]),LJ=_.useMemo(()=>T?.pages.flatMap((K)=>K.data)||[],[T]),{mutate:yJ}=y({mutationFn:async()=>{let K=await U.api.projects[":projectId"].collections.$post({param:{projectId:Y},json:{name:W.untitled_collection(),filter:{sourceFolderId:P,searchFilter:{conditions:[],recursively:!0}}}});if(!K.ok)throw Error(W.failed_create_collection());return await K.json()},onSuccess:(K)=>{q.invalidateQueries({queryKey:["collections",Y]}),z.success(W.collection_created()),Q({to:"/projects/$projectId/collections/$collectionId",params:{projectId:Y,collectionId:K.id}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:G}=y({mutationFn:async()=>{let K=await U.api.projects[":projectId"].shares.$post({param:{projectId:Y},json:{name:new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}});if(!K.ok)throw Error(W.failed_create_share_link());return await K.json()},onSuccess:(K)=>{q.invalidateQueries({queryKey:["shares",Y]}),z.success(W.share_link_created()),Q({to:"/projects/$projectId/shares/$shareId",params:{projectId:Y,shareId:K.id}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),n=S({from:"/projects/$projectId/collections/$collectionId",shouldThrow:!1}),AK=S({from:"/projects/$projectId/shares/$shareId",shouldThrow:!1}),OK=S({from:"/projects/$projectId/folders/$folderId",shouldThrow:!1}),[x,EJ]=_.useState(null),[N,vJ]=_.useState("collection"),[L,XJ]=_.useState(""),[PK,C]=_.useState(!1),[NJ,CJ]=_.useState(null),[k,FJ]=_.useState("collection"),[MK,R]=_.useState(!1),{mutate:pJ}=y({mutationFn:async({id:K,name:Z})=>{let H=await U.api.folders[":folderId"].$put({param:{folderId:K},json:{name:Z}});if(!H.ok)throw Error(W.failed_rename_folder());return await H.json()},onSuccess:()=>{q.invalidateQueries({queryKey:["search",B]}),q.invalidateQueries({queryKey:["folders"]}),z.success(W.folder_renamed()),C(!1)},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:LK}=y({mutationFn:async(K)=>{if(!(await U.api.folders.$delete({json:{ids:[K]}})).ok)throw Error(W.failed_delete_folder());return K},onSuccess:(K)=>{if(q.invalidateQueries({queryKey:["search",B]}),q.invalidateQueries({queryKey:["folders"]}),z.success(W.folder_deleted()),R(!1),OK?.folderId===K)Q({to:"/projects/$projectId",params:{projectId:Y}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),[yK,a]=_.useState(!1),[YJ,mJ]=_.useState(!1),[wJ,jJ]=_.useState([]),EK=async(K)=>{a(!0),mJ(!0),jJ([]);try{let Z=await U.api.files["download-links"].$post({json:{ids:[K]}});if(!Z.ok)throw Error(W.failed_to_prepare_download_links());let H=await Z.json();jJ(H.files)}catch(Z){z.error(W.failed_to_prepare_download_links()),a(!1),console.error(Z)}finally{mJ(!1)}},vK=()=>{let K=[...wJ];if(a(!1),K.length===0)return;z.info(W.starting_download_files({count:K.length}),{duration:5000});let Z=(ZJ)=>new Promise((p)=>setTimeout(p,ZJ));(async()=>{for(let p=0;p<K.length;p+=5){let FK=K.slice(p,p+5);for(let lJ of FK){let m=document.createElement("a");m.href=lJ.url,m.download=lJ.name,m.target="_blank",document.body.appendChild(m),m.click(),m.remove()}await Z(1000)}})().catch((ZJ)=>{console.error("Background downloads failed:",ZJ),z.error(W.some_downloads_failed())})},{mutate:cJ}=y({mutationFn:async({id:K,name:Z})=>{let H=await U.api.collections[":collectionId"].$patch({param:{collectionId:K},json:{name:Z}});if(!H.ok)throw Error(W.failed_rename_collection());return await H.json()},onSuccess:()=>{q.invalidateQueries({queryKey:["collections",Y]}),z.success(W.collection_renamed()),C(!1)},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:NK}=y({mutationFn:async(K)=>{let Z=await U.api.collections[":collectionId"].$delete({param:{collectionId:K}});if(!Z.ok)throw Error(W.failed_delete_collection());return await Z.json()},onSuccess:(K,Z)=>{if(q.invalidateQueries({queryKey:["collections",Y]}),z.success(W.collection_deleted()),R(!1),n?.collectionId===Z)Q({to:"/projects/$projectId",params:{projectId:Y}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:iJ}=y({mutationFn:async({id:K,name:Z})=>{let H=await U.api.shares[":shareId"].$put({param:{shareId:K},json:{name:Z}});if(!H.ok)throw Error(W.failed_rename_share_link());return await H.json()},onSuccess:()=>{q.invalidateQueries({queryKey:["shares",Y]}),z.success(W.share_link_renamed()),C(!1)},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:CK}=y({mutationFn:async(K)=>{if(!(await U.api.shares[":shareId"].$delete({param:{shareId:K}})).ok)throw Error(W.failed_delete_share_link());return K},onSuccess:(K)=>{if(q.invalidateQueries({queryKey:["shares",Y]}),z.success(W.share_link_deleted()),R(!1),AK?.shareId===K)Q({to:"/projects/$projectId",params:{projectId:Y}})},onError:(K)=>{z.error(`Error: ${K.message}`)}});return X("div",{className:"flex flex-col h-full overflow-hidden p-3 gap-4 bg-background",children:[X("div",{className:V("flex flex-col overflow-hidden transition-all duration-300 ease-in-out border-b border-border pb-4",u?"flex-1 min-h-[50%] h-full":"flex-none h-[44px] max-h-[44px]"),children:[J("header",{className:"group flex items-center justify-between px-2 mb-1 flex-none",children:X("div",{className:"flex-1 flex items-center gap-1.5 cursor-pointer select-none text-muted-foreground hover:text-foreground transition-colors",onClick:()=>VJ(!u),children:[J("h3",{className:"text-xs font-semibold uppercase tracking-wider",children:W.folder_tree_assets()}),u?J(_J,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"}):J($J,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"})]})}),J(GJ,{className:V("flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!",u?"opacity-100 visible pointer-events-auto":"opacity-0 invisible pointer-events-none h-0"),children:X("div",{className:"space-y-0.5 pr-3",children:[!h&&X("div",{className:V("group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",o&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium"),onClick:()=>Q({to:"/projects/$projectId/recents",params:{projectId:Y}}),children:[J("div",{className:"flex h-4 w-4 items-center justify-center",children:J(JK,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:W.recents()})]}),J(VK,{teamId:B,projectId:Y,folder:{id:P,name:$,type:"folder",sizeByte:0,fileCount:0,status:"processed",createdAt:"",updatedAt:""},level:0,isRoot:!0,dragState:b,onSelect:M,selectedFolderId:A,canEdit:O,onRenameTrigger:(K,Z)=>{EJ(K),vJ("folder"),XJ(Z),C(!0)},onDeleteTrigger:(K)=>{CJ(K),FJ("folder"),R(!0)},onDownloadTrigger:(K)=>{EK(K)},ancestorFolders:D},P),O&&!f&&X("div",{className:V("group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",r&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium"),onClick:()=>Q({to:"/projects/$projectId/recently-deleted",params:{projectId:Y}}),children:[J("div",{className:"flex h-4 w-4 items-center justify-center",children:J(IJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:W.recently_deleted()})]})]})})]}),!c&&X("div",{className:V("flex flex-col overflow-hidden transition-all duration-300 ease-in-out border-b border-border pb-4",g?"flex-1 min-h-0 h-full":"flex-none h-[44px] max-h-[44px]"),children:[X("header",{className:"group flex items-center justify-between px-2 mb-1 flex-none",children:[X("div",{className:"flex-1 flex items-center gap-1.5 cursor-pointer select-none text-muted-foreground hover:text-foreground transition-colors",onClick:()=>AJ(!g),children:[J("h3",{className:"text-xs font-semibold uppercase tracking-wider",children:W.collections()}),g?J(_J,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"}):J($J,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"})]}),O&&J("button",{"data-testid":"create-collection",onClick:()=>yJ(),className:"text-muted-foreground hover:text-foreground flex-none",children:J(RJ,{className:"h-3.5 w-3.5"})})]}),J(GJ,{className:V("flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!",g?"opacity-100 visible pointer-events-auto":"opacity-0 invisible pointer-events-none h-0"),children:X("div",{className:"space-y-0.5 pr-3",children:[X("div",{className:"group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",onClick:()=>Q({to:"/projects/$projectId/collections",params:{projectId:Y}}),children:[J("div",{className:"flex h-4 w-4 items-center justify-center",children:J(kJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:W.all_collections_count({count:l?.pages[0]?.pageInfo?.total||0})})]}),MJ.map((K)=>{let Z=n?.collectionId===K.id;return X("div",{className:V("group flex cursor-pointer items-center justify-between rounded-md px-2 py-1 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0",Z&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium"),onClick:()=>Q({to:"/projects/$projectId/collections/$collectionId",params:{projectId:Y,collectionId:K.id}}),children:[X("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[J("div",{className:"flex h-4 w-4 items-center justify-center shrink-0",children:J(oJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"truncate text-sidebar-foreground flex-1",children:K.name})]}),O&&J("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:(H)=>H.stopPropagation(),children:X(BJ,{modal:!1,children:[J(bJ,{asChild:!0,children:J(E,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 shrink-0 hover:bg-muted hover:text-muted-foreground p-0",children:J(UJ,{className:"h-3.5 w-3.5"})})}),X(qJ,{align:"end",className:"w-32",children:[J(F,{onClick:()=>{EJ(K.id),vJ("collection"),XJ(K.name),C(!0)},children:W.rename()}),J(F,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{CJ(K.id),FJ("collection"),R(!0)},children:W.delete()})]})]})})]},K.id)}),J("div",{ref:OJ,className:"h-1"}),d&&J("div",{className:"flex justify-center p-2",children:J(j,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]})})]}),!v&&X("div",{className:V("flex flex-col overflow-hidden transition-all duration-300 ease-in-out",w?"flex-1 min-h-0 h-full":"flex-none h-[44px] max-h-[44px]"),children:[X("header",{className:"group flex items-center justify-between px-2 mb-1 flex-none",children:[X("div",{className:"flex-1 flex items-center gap-1.5 cursor-pointer select-none text-muted-foreground hover:text-foreground transition-colors",onClick:()=>i(!w),children:[J("h3",{className:"text-xs font-semibold uppercase tracking-wider",children:W.share_links()}),w?J(_J,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"}):J($J,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"})]}),O&&J("div",{className:"flex items-center gap-1 flex-none",children:J("button",{onClick:()=>G(),className:"text-muted-foreground hover:text-foreground",children:J(RJ,{className:"h-3.5 w-3.5"})})})]}),J(GJ,{className:V("flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!",w?"opacity-100 visible pointer-events-auto":"opacity-0 invisible pointer-events-none h-0"),children:X("div",{className:"space-y-0.5 pr-3",children:[X("div",{className:"group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",onClick:()=>Q({to:"/projects/$projectId/shares",params:{projectId:Y}}),children:[J("div",{className:"flex h-4 w-4 items-center justify-center",children:J(kJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:W.all_share_links_count({count:T?.pages[0]?.pageInfo?.total||0})})]}),LJ.map((K)=>J(kK,{link:K,projectId:Y,dragState:b,canEdit:O,onRenameTrigger:(Z,H)=>{EJ(Z),vJ("share"),XJ(H),C(!0)},onDeleteTrigger:(Z)=>{CJ(Z),FJ("share"),R(!0)}},K.id)),J("div",{ref:PJ,className:"h-1"}),I&&J("div",{className:"flex justify-center p-2",children:J(j,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]})})]}),J(SJ,{open:PK,onOpenChange:C,children:X(fJ,{onClick:(K)=>K.stopPropagation(),children:[J(hJ,{children:J(uJ,{children:N==="collection"?W.rename_collection():N==="share"?W.rename_share_link():W.rename_folder()})}),J("div",{className:"py-4",children:J($K,{value:L,onChange:(K)=>XJ(K.target.value),placeholder:W.enter_new_name(),onKeyDown:(K)=>{if(K.key==="Enter"&&L.trim()){if(N==="collection")cJ({id:x,name:L});else if(N==="share")iJ({id:x,name:L});else if(N==="folder")pJ({id:x,name:L})}}})}),X(DJ,{children:[J(E,{variant:"ghost",onClick:()=>C(!1),children:W.cancel()}),J(E,{disabled:!L.trim(),onClick:()=>{if(N==="collection")cJ({id:x,name:L});else if(N==="share")iJ({id:x,name:L});else if(N==="folder")pJ({id:x,name:L})},children:W.rename()})]})]})}),J(GK,{open:MK,onOpenChange:R,children:X(zK,{onClick:(K)=>K.stopPropagation(),children:[X(QK,{children:[J(UK,{children:k==="collection"?W.delete_collection_confirm():k==="share"?W.delete_share_link_confirm():W.delete_folder_confirm()}),J(BK,{children:W.delete_confirm_description({type:k==="collection"?W.collection():k==="share"?W.share_link():W.folder().toLowerCase()})})]}),X(HK,{children:[J(qK,{children:W.cancel()}),J(bK,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{if(k==="collection")NK(NJ);else if(k==="share")CK(NJ);else if(k==="folder")LK(NJ)},children:W.delete()})]})]})}),J(SJ,{open:yK,onOpenChange:a,children:X(fJ,{className:"sm:max-w-md",children:[X(hJ,{children:[J(uJ,{children:YJ?W.preparing_download():W.confirm_download()}),J(ZK,{children:YJ?W.resolving_files_wait():W.folder_files_download_description()})]}),YJ?X("div",{className:"space-y-4 py-6 flex flex-col items-center justify-center",children:[J(j,{className:"h-8 w-8 animate-spin text-primary"}),J("span",{className:"text-sm font-medium text-muted-foreground mt-2",children:W.preparing_download_links()})]}):X("div",{className:"space-y-4 py-2",children:[J("div",{className:"text-sm text-muted-foreground",children:W.download_includes_files({count:wJ.length})}),X("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:[J(rJ,{className:"h-5 w-5 shrink-0 mt-0.5"}),X("div",{children:[J("p",{className:"font-semibold",children:W.no_folder_structure()}),J("p",{className:"mt-0.5 text-xs text-amber-700/90 dark:text-amber-400/90",children:W.folder_structure_warning()})]})]})]}),J(DJ,{children:!YJ?X(dJ,{children:[J(E,{variant:"outline",onClick:()=>a(!1),children:W.cancel()}),X(E,{onClick:vK,className:"gap-2",disabled:wJ.length===0,children:[J(gJ,{className:"h-4 w-4"}),W.start_download()]})]}):J(E,{disabled:!0,variant:"outline",children:W.cancel()})})]})})]})}function kK({link:B,projectId:Y,dragState:$,canEdit:P,onRenameTrigger:b,onDeleteTrigger:M}){let A=HJ(),v=S({from:"/projects/$projectId/shares/$shareId",shouldThrow:!1})?.shareId===B.id,{ref:f,isDropTarget:h}=xJ({id:`share:${B.id}`,data:{type:"share-link",id:B.id}}),D=!!$?.isActive;return X("div",{ref:f,className:V("group flex cursor-pointer items-center justify-between rounded-md px-2 py-1 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0",v&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium",h&&D&&"bg-sidebar-accent ring-2 ring-primary ring-inset"),onClick:()=>A({to:"/projects/$projectId/shares/$shareId",params:{projectId:Y,shareId:B.id}}),children:[X("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[J("div",{className:"flex h-4 w-4 items-center justify-center shrink-0",children:J(WK,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"truncate text-sidebar-foreground flex-1",children:B.name})]}),P&&J("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:(Q)=>Q.stopPropagation(),children:X(BJ,{modal:!1,children:[J(bJ,{asChild:!0,children:J(E,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 shrink-0 hover:bg-muted hover:text-muted-foreground p-0",children:J(UJ,{className:"h-3.5 w-3.5"})})}),X(qJ,{align:"end",className:"w-32",children:[J(F,{onClick:()=>{b(B.id,B.name)},children:W.rename()}),J(F,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{M(B.id)},children:W.delete()})]})]})})]})}function VK({teamId:B,projectId:Y,folder:$,level:P,isRoot:b,dragState:M,onSelect:A,selectedFolderId:c,canEdit:v,onRenameTrigger:f,onDeleteTrigger:h,onDownloadTrigger:D,ancestorFolders:Q}){let q=_.useMemo(()=>{return Q?.some((G)=>G.id===$.id)??!1},[Q,$.id]),[O,r]=_.useState(b||q);_.useEffect(()=>{if(q)r(!0)},[q]);let o=HJ(),u=S({from:"/projects/$projectId/folders/$folderId",select:(G)=>({folderId:G.folderId}),shouldThrow:!1}),VJ=S({from:"/projects/$projectId/",shouldThrow:!1}),g=b?!!VJ:u?.folderId===$.id,{data:AJ,fetchNextPage:w,hasNextPage:i,isFetchingNextPage:T,isLoading:s}=zJ({queryKey:["folders",$.id,"children",{assetType:"folder"}],queryFn:async({pageParam:G})=>{let n=await U.api.folders[":folderId"].children.$get({param:{folderId:$.id},query:{assetType:"folder",after:G,first:"20"}});if(!n.ok)throw Error(W.failed_to_fetch_folder_children());return await n.json()},initialPageParam:"",getNextPageParam:(G)=>{return G.pageInfo?.cursor||void 0},enabled:O||!!b}),{ref:t,inView:I}=QJ();_.useEffect(()=>{if(I&&i&&!T)w()},[I,i,T,w]);let l=AJ?.pages.flatMap((G)=>G.data??[])??[],e=(G)=>{G.stopPropagation(),r(!O)},JJ=()=>{if(A){A($);return}if(b)o({to:"/projects/$projectId",params:{projectId:Y}});else o({to:"/projects/$projectId/folders/$folderId",params:{projectId:Y,folderId:$.id}})},{ref:d,isDragging:OJ}=_K({id:`tree:${$.id}`,data:{type:"folder",item:$},disabled:!!b||!!A||!v}),{ref:KJ,isDropTarget:PJ}=xJ({id:`tree:${$.id}`,data:{type:"folder",item:$},disabled:M?.draggedIds.has($.id)||!!A||!v}),WJ=(G)=>{d(G),KJ(G)},MJ=_.useMemo(()=>{if(A)return!1;if(!M?.isActive)return!1;if(M.draggedIds.has($.id))return!1;return!0},[M,$.id,A]),LJ=PJ&&MJ,yJ=c===$.id;return X("div",{children:[X("div",{ref:WJ,className:V("group flex cursor-pointer items-center gap-1 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0",(g||yJ)&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium",OJ&&"opacity-50",LJ&&"bg-sidebar-accent ring-2 ring-primary ring-inset"),style:{...b?{}:{paddingLeft:`${P*12+8}px`}},onClick:JJ,children:[!b&&J("button",{onClick:e,className:"flex h-4 w-4 items-center justify-center shrink-0",children:O?J(sJ,{className:"h-3 w-3"}):J(tJ,{className:"h-3 w-3"})}),b?J(eJ,{className:"h-4 w-4 text-sidebar-primary shrink-0"}):J(KK,{className:"h-4 w-4 text-sidebar-primary shrink-0"}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:$.name}),v&&!b&&J("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:(G)=>G.stopPropagation(),children:X(BJ,{modal:!1,children:[J(bJ,{asChild:!0,children:J(E,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 shrink-0 hover:bg-muted hover:text-muted-foreground p-0",children:J(UJ,{className:"h-3.5 w-3.5"})})}),X(qJ,{align:"end",className:"w-32",children:[X(F,{onClick:()=>{f($.id,$.name)},children:[J(aJ,{className:"mr-2 h-4 w-4"}),W.rename()]}),X(F,{onClick:()=>{D($.id)},children:[J(gJ,{className:"mr-2 h-4 w-4"}),W.download()]}),J(XK,{}),X(F,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{h($.id)},children:[J(IJ,{className:"mr-2 h-4 w-4"}),W.delete()]})]})]})})]}),O&&X("div",{children:[s&&J("div",{className:"flex items-center justify-center p-2",style:{paddingLeft:`${(P+1)*12+8}px`},children:J(j,{className:"h-4 w-4 animate-spin"})}),l.map((G)=>J(VK,{teamId:B,projectId:Y,folder:G,level:P+1,dragState:M,onSelect:A,selectedFolderId:c,canEdit:v,onRenameTrigger:f,onDeleteTrigger:h,onDownloadTrigger:D,ancestorFolders:Q},G.id)),i&&J("div",{ref:t,className:"flex items-center justify-center p-2",style:{paddingLeft:`${(P+1)*12+8}px`},children:T&&J(j,{className:"h-4 w-4 animate-spin"})})]})]})}
|
|
2
|
-
export{nK as ag};
|
package/bin/chunk-e5r6rnt9.js
DELETED
package/bin/chunk-gwzk0fvn.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Tg as f}from"./chunk-dyen2t1p.js";import{Li as b,Mi as q}from"./chunk-48yphy68.js";function z(){return q("div",{className:"flex h-screen flex-col bg-background min-h-0",children:[q("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-24"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-32"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-8 w-8 rounded-md"}),b(f,{className:"h-8 w-20 rounded-md"})]})]}),q("div",{className:"flex flex-1 overflow-hidden",children:[q("div",{className:"w-[240px] border-r p-4 space-y-4 hidden md:block shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-4 rounded"}),b(f,{className:"h-4 w-24"})]}),q("div",{className:"pl-4 space-y-3",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-28"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-20"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-24"})]})]})]}),q("div",{className:"flex-1 p-6 space-y-6 overflow-y-auto",children:[q("div",{className:"flex items-center justify-between border-b pb-4",children:[q("div",{className:"flex items-center gap-4",children:[b(f,{className:"h-5 w-40"}),b(f,{className:"h-4 w-20"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-8 w-8 rounded"}),b(f,{className:"h-8 w-8 rounded"}),b(f,{className:"h-8 w-32 rounded"})]})]}),q("div",{className:"space-y-4",children:[b("div",{className:"flex items-center gap-2",children:b(f,{className:"h-4 w-24"})}),b("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:Array.from({length:10}).map((w,v)=>q("div",{className:"flex flex-col rounded-lg border bg-card p-3 space-y-3",children:[b(f,{className:"aspect-square w-full rounded-md"}),q("div",{className:"space-y-2",children:[b(f,{className:"h-4 w-3/4"}),q("div",{className:"flex justify-between items-center",children:[b(f,{className:"h-3 w-1/4"}),b(f,{className:"h-3 w-1/3"})]})]})]},v))})]})]})]})]})}function A(){return q("div",{className:"h-screen flex flex-col bg-background",children:[q("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-16"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-28"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-32"})]}),b("div",{className:"flex items-center gap-2",children:b(f,{className:"h-8 w-20 rounded"})})]}),q("div",{className:"flex flex-1 overflow-hidden",children:[q("div",{className:"w-[280px] border-r p-4 flex flex-col gap-4 shrink-0 hidden md:flex",children:[b(f,{className:"h-5 w-24"}),b("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:4}).map((w,v)=>q("div",{className:"flex gap-3 p-2 rounded border",children:[b(f,{className:"h-12 w-12 rounded bg-muted shrink-0"}),q("div",{className:"space-y-2 flex-1",children:[b(f,{className:"h-3 w-2/3"}),b(f,{className:"h-2 w-1/2"})]})]},v))})]}),q("div",{className:"flex-1 bg-muted/20 p-6 flex flex-col justify-between relative min-w-0",children:[b("div",{className:"flex-1 flex items-center justify-center",children:b(f,{className:"w-full max-w-4xl aspect-video rounded-lg shadow-lg"})}),q("div",{className:"mt-4 flex items-center justify-between shrink-0",children:[q("div",{className:"flex items-center gap-4",children:[b(f,{className:"h-8 w-8 rounded-full"}),b(f,{className:"h-4 w-32"})]}),b(f,{className:"h-4 w-24"})]})]}),q("div",{className:"w-[360px] border-l p-4 flex flex-col gap-6 shrink-0 hidden lg:flex bg-card",children:[q("div",{className:"space-y-4",children:[b(f,{className:"h-5 w-32"}),b("div",{className:"space-y-3",children:Array.from({length:3}).map((w,v)=>q("div",{className:"flex justify-between items-center py-1 border-b",children:[b(f,{className:"h-3 w-20"}),b(f,{className:"h-3 w-32"})]},v))})]}),q("div",{className:"flex-1 flex flex-col gap-4",children:[b(f,{className:"h-5 w-24"}),b("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:3}).map((w,v)=>q("div",{className:"flex gap-3 p-3 rounded-lg border bg-muted/10",children:[b(f,{className:"h-8 w-8 rounded-full shrink-0"}),q("div",{className:"space-y-2 flex-1",children:[q("div",{className:"flex justify-between",children:[b(f,{className:"h-3 w-24"}),b(f,{className:"h-2 w-12"})]}),b(f,{className:"h-3 w-full"}),b(f,{className:"h-3 w-5/6"})]})]},v))})]})]})]})]})}
|
|
2
|
-
export{z as we,A as xe};
|
package/bin/chunk-gx8sz5bw.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Re as o0}from"./chunk-byjze6hm.js";import{Se as $b}from"./chunk-gx410cm2.js";import{pf as Q0}from"./chunk-6ts5az6h.js";import{qf as Sb,rf as rb,sf as u0,tf as I0}from"./chunk-31f07jzm.js";import{zf as Pb}from"./chunk-02b97gsf.js";import{Bf as t0}from"./chunk-mm995mvc.js";import{Cf as l0,Df as i0,Ef as x0,Ff as Q,Gf as x,Hf as m,Rf as Gb}from"./chunk-8b11b9cj.js";import{Uf as H0,Vf as W0,Wf as y0,Xf as J0,Yf as I}from"./chunk-ntqn09r0.js";import{Zf as Rb}from"./chunk-esa954t1.js";import{_f as bb}from"./chunk-ctx1ms5t.js";import{ag as p0}from"./chunk-day0vn14.js";import{Rg as u}from"./chunk-2s97ngr8.js";import{Ug as a0}from"./chunk-sepsqqdf.js";import{Lh as S0}from"./chunk-ps2hw0ps.js";import{Mh as Yb}from"./chunk-qrnw89xg.js";import{Nh as Z0,Oh as f0,Ph as z0}from"./chunk-5dfy6173.js";import{Qh as Jb,Sh as Zb,Th as fb,Uh as zb}from"./chunk-qrhf20g2.js";import{Ai as Xb,Bi as Ub,Ci as Db,Di as Vb,Ei as Ob,Fi as qb,Gi as Bb,Hi as Qb,ei as R0,hi as S,ji as _0,ki as r0,qi as R,ri as V0,ti as O0,ui as q0,vi as h0,wi as B0,yi as c}from"./chunk-jsqsrcse.js";import{Ii as d}from"./chunk-8zar6cc4.js";import{$j as e0,$l as K,Ej as L0,Hk as gb,Ji as Y0,Jj as M0,Ki as w0,Li as b,Mi as N,Nk as Mb,Qk as g0,Wl as j,Xj as k0,Yl as r,Zj as A0,Zk as d0,_j as C0,am as P0,ek as a,ij as Wb,il as Kb,kj as h,ll as yb,nk as vb,uk as m0,xj as Lb,yl as U0}from"./chunk-48yphy68.js";import{Zm as $0}from"./chunk-69at8jm8.js";var db=[Q.TODO,Q.READY,Q.IN_PROGRESS,Q.BLOCKED,Q.IN_REVIEW,Q.DONE];function K0(_){switch(_){case Q.TODO:return K.status_todo();case Q.READY:return K.status_ready();case Q.IN_PROGRESS:return K.status_in_progress();case Q.BLOCKED:return K.status_blocked();case Q.IN_REVIEW:return K.status_in_review();case Q.DONE:return K.status_done();default:return _}}function ub(_){switch(_){case Q.TODO:return{badge:"bg-muted text-muted-foreground border-border",border:"border-border",dot:"bg-muted-foreground",bg:"bg-muted/30"};case Q.READY:return{badge:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",border:"border-blue-500/30",dot:"bg-blue-500",bg:"bg-blue-500/5"};case Q.IN_PROGRESS:return{badge:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",border:"border-amber-500/30",dot:"bg-amber-500",bg:"bg-amber-500/5"};case Q.BLOCKED:return{badge:"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20",border:"border-red-500/30",dot:"bg-red-500",bg:"bg-red-500/5"};case Q.IN_REVIEW:return{badge:"bg-purple-500/10 text-purple-600 dark:text-purple-400 border-purple-500/20",border:"border-purple-500/30",dot:"bg-purple-500",bg:"bg-purple-500/5"};case Q.DONE:return{badge:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20",border:"border-emerald-500/30",dot:"bg-emerald-500",bg:"bg-emerald-500/5"}}}function T0(_){return ub(_).badge}function c0(_){switch(_){case x.LOW:return K.priority_low();case x.MEDIUM:return K.priority_medium();case x.HIGH:return K.priority_high();case x.URGENT:return K.priority_urgent();default:return _}}function n0(_){switch(_){case x.LOW:return"bg-muted text-muted-foreground border-border";case x.MEDIUM:return"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20";case x.HIGH:return"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20";case x.URGENT:return"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20 font-semibold";default:return"bg-muted text-muted-foreground border-border"}}var X0=$0(Y0(),1);var G0=$0(Y0(),1);var Ib=[Q.TODO,Q.READY,Q.IN_PROGRESS,Q.IN_REVIEW,Q.DONE,Q.BLOCKED];function j0({teamId:_,currentTaskId:G,excludeTaskIds:Y=[],value:Z=[],knownTasks:O=[],onChange:D,disabled:X=!1,canEdit:L=!0,className:y}){let[U,T]=G0.useState(!1),[P,v]=G0.useState(Q.TODO),[W,f]=G0.useState(""),[p,z]=G0.useState(()=>{let H={};for(let q of O)H[q.id]={title:q.title,status:q.status};return H}),{data:w,isLoading:E0}=S({queryKey:["teams",_,"kanban","tasks","status",P],queryFn:async()=>{let H=await R.api.teams[":teamId"].kanban.tasks.$get({param:{teamId:_},query:{status:P,first:"100"}});if(!H.ok)return{data:[]};return await H.json()},enabled:!!_&&U}),k=w?.data||[];G0.useMemo(()=>{if(k.length>0)z((H)=>{let q=!1,A={...H};for(let o of k)if(!A[o.id]||A[o.id].title!==o.title||A[o.id].status!==o.status)A[o.id]={title:o.title,status:o.status},q=!0;return q?A:H})},[k]);let F=G0.useMemo(()=>{let H=new Set(Y);if(G)H.add(G);return H},[G,Y]),l=G0.useMemo(()=>{let H=W.trim().toLowerCase();return k.filter((q)=>{if(F.has(q.id))return!1;if(!H)return!0;return q.title.toLowerCase().includes(H)})},[k,F,W]),i=(H)=>{if(!L||X)return;let A=Z.includes(H)?Z.filter((o)=>o!==H):[...Z,H];D?.(A)},E=(H,q)=>{if(q.stopPropagation(),!L||X)return;D?.(Z.filter((A)=>A!==H))},V=L&&!X;return N(l0,{open:U&&V,onOpenChange:(H)=>V&&T(H),children:[b(i0,{asChild:!0,children:b("div",{role:"button",tabIndex:V?0:-1,className:j("w-full min-h-[36px] px-2.5 py-1.5 flex flex-wrap items-center gap-1.5 rounded-md border border-input bg-background text-xs transition-colors",V?"cursor-pointer hover:border-ring/60 focus:outline-none focus:ring-2 focus:ring-ring/50":"cursor-not-allowed opacity-70",y),children:Z.length===0?N("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[b(m0,{className:"w-3.5 h-3.5 text-muted-foreground/70"}),b("span",{children:K.select_parent_tasks()})]}):Z.map((H)=>{let q=p[H];return N("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-[11px] bg-muted text-foreground border border-border/80 shrink-0 max-w-[220px]",children:[q?.status&&b("span",{className:j("px-1 py-0.2 rounded text-[9px] uppercase font-semibold shrink-0",T0(q.status)),children:K0(q.status)}),b("span",{className:"truncate font-medium",children:q?.title||H}),V&&b("button",{type:"button",onClick:(A)=>E(H,A),className:"text-muted-foreground hover:text-destructive shrink-0 p-0.5 -mr-1",children:b(U0,{className:"w-3 h-3"})})]},H)})})}),N(x0,{align:"start",sideOffset:4,className:"w-[var(--radix-popover-trigger-width)] min-w-[320px] sm:min-w-[420px] max-w-[500px] p-2.5 space-y-2 bg-popover border border-border rounded-lg shadow-lg",children:[b("div",{className:"flex flex-wrap gap-1.5 pb-0.5",children:Ib.map((H)=>{return b("button",{type:"button",onClick:()=>v(H),className:j("text-[11px] h-7 px-2.5 rounded-md font-medium transition-colors border shrink-0",P===H?"bg-primary text-primary-foreground border-primary shadow-xs":"bg-muted/50 hover:bg-accent text-muted-foreground hover:text-foreground border-border/60"),children:K0(H)},H)})}),N("div",{className:"relative",children:[b(d0,{className:"w-3.5 h-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),b(P0,{value:W,onChange:(H)=>f(H.target.value),placeholder:K.filter_tasks_placeholder(),className:"h-8 pl-8 text-xs bg-muted/40",autoFocus:!0})]}),b("div",{className:"border rounded-md overflow-hidden bg-background/50",children:b(u,{className:"h-48 p-1",children:E0?b("div",{className:"flex items-center justify-center py-8",children:b(h,{className:"w-4 h-4 animate-spin text-muted-foreground"})}):l.length===0?b("div",{className:"py-8 text-center text-xs text-muted-foreground italic",children:K.no_matching_tasks()}):b("div",{className:"space-y-1",children:l.map((H)=>{let q=Z.includes(H.id);return N("div",{onClick:()=>i(H.id),className:j("flex items-center justify-between p-2 rounded-md hover:bg-accent cursor-pointer transition-colors text-xs border border-transparent",q&&"bg-accent/50 border-border/50"),children:[N("div",{className:"flex items-center gap-2 min-w-0 flex-1 pr-2",children:[b("div",{className:j("w-4 h-4 rounded border flex items-center justify-center shrink-0 transition-colors",q?"bg-primary border-primary text-primary-foreground":"border-input bg-background"),children:q&&b(M0,{className:"w-3 h-3 stroke-[3]"})}),b("span",{className:j("px-1.5 py-0.5 rounded text-[10px] uppercase font-medium shrink-0",T0(H.status)),children:K0(H.status)}),b("span",{className:"font-medium text-foreground truncate",children:H.title})]}),H.assignee&&b("span",{className:"text-[10px] text-muted-foreground truncate shrink-0",children:H.assignee.name})]},H.id)})})})})]})]})}var Nb=$0(Y0(),1);var D0=$0(Y0(),1);function s0({teamId:_,initialProjectId:G,excludeAssetIds:Y=[],isOpen:Z,onClose:O,onConfirm:D}){let[X,L]=D0.useState(G||""),[y,U]=D0.useState(null),[T,P]=D0.useState(new Map),{data:v,isLoading:W}=S({queryKey:["teams",_,"projects"],queryFn:async()=>{let $=await R.api.teams[":teamId"].projects.$get({param:{teamId:_},query:{first:"100"}});if(!$.ok)throw Error("Failed to fetch projects");return await $.json()},enabled:!!_&&Z}),f=v?.data||[],p=X||(f[0]?.id??""),z=f.find(($)=>$.id===p),w=y?.id||z?.rootFolder||"",E0=w===z?.rootFolder,{data:k,fetchNextPage:F,hasNextPage:l,isFetchingNextPage:i,isLoading:E}=r0({queryKey:["folders",w,"children","folder","picker"],queryFn:async({pageParam:$})=>{let g=await R.api.folders[":folderId"].children.$get({param:{folderId:w},query:{assetType:"folder",after:$,first:"20"}});if(!g.ok)throw Error("Failed to fetch folders");return await g.json()},initialPageParam:"",getNextPageParam:($)=>$.pageInfo?.cursor||void 0,enabled:!!w&&Z}),{data:V,fetchNextPage:H,hasNextPage:q,isFetchingNextPage:A,isLoading:o}=r0({queryKey:["folders",w,"children","file","picker"],queryFn:async({pageParam:$})=>{let g=await R.api.folders[":folderId"].children.$get({param:{folderId:w},query:{assetType:"file",after:$,first:"20"}});if(!g.ok)throw Error("Failed to fetch files");return await g.json()},initialPageParam:"",getNextPageParam:($)=>$.pageInfo?.cursor||void 0,enabled:!!w&&Z}),{ref:J,inView:B}=a0();D0.useEffect(()=>{if(B){if(l&&!i)F();else if(q&&!A)H()}},[B,l,i,F,q,A,H]);let t=E&&!k||o&&!V,C=i||A,M=D0.useMemo(()=>{let $=k?.pages.flatMap((N0)=>N0.data??[])??[],g=V?.pages.flatMap((N0)=>N0.data??[])??[];return[...$,...g]},[k,V]),s=($)=>{let g=new Map(T);if(g.has($.id))g.delete($.id);else{let N0=z?`/${[z.name,...($.ancestorFolders||[]).map((v0)=>v0.name)].filter(Boolean).join("/")}`:"/";g.set($.id,{id:$.id,name:$.name,type:$.type,proxyType:$.proxyType??null,thumbnailUrl:$.preview?.thumbnailUrl??null,path:N0,creator:$.creator?{id:$.creator.id,name:$.creator.name,image:$.creator.image??void 0}:null,sizeByte:$.sizeByte??0,fileCount:$.fileCount??null,projectId:$.projectId??z?.id??null,createdAt:$.createdAt??new Date().toISOString()})}P(g)},e=()=>{if(!y||E0)return;let $=new Map(T);if($.has(y.id))$.delete(y.id);else{let g=z?`/${[z.name,...(y.ancestorFolders||[]).map((N0)=>N0.name)].filter(Boolean).join("/")}`:"/";$.set(y.id,{id:y.id,name:y.name,type:"folder",proxyType:null,thumbnailUrl:null,path:g,creator:y.creator?{id:y.creator.id,name:y.creator.name,image:y.creator.image??void 0}:null,sizeByte:y.sizeByte??0,fileCount:y.fileCount??null,projectId:y.projectId??z?.id??null,createdAt:y.createdAt??new Date().toISOString()})}P($)},b0=()=>{D(Array.from(T.values())),O()};return b(V0,{open:Z,onOpenChange:($)=>{if(!$)O()},children:N(O0,{className:"sm:max-w-4xl flex flex-col h-[650px] p-0 overflow-hidden gap-1",children:[b(q0,{className:"px-4 py-3 border-b shrink-0",children:N("div",{className:"flex items-center gap-2",children:[b(a,{className:"w-5 h-5 text-primary"}),b(B0,{children:K.select_assets()})]})}),N("div",{className:"flex items-center gap-2.5 px-4 py-1.5 border-b bg-transparent shrink-0",children:[N("span",{className:"text-xs font-medium text-muted-foreground whitespace-nowrap",children:[K.current_project_label(),":"]}),b("div",{className:"w-64",children:N(H0,{value:p,onValueChange:($)=>{L($),U(null)},children:[b(y0,{className:"h-8 text-xs bg-background",children:b(W0,{placeholder:K.select_project()})}),b(J0,{children:f.map(($)=>b(I,{value:$.id,className:"text-xs",children:$.name},$.id))})]})})]}),N("div",{className:"flex-1 min-h-0 flex overflow-hidden",children:[b("div",{className:"w-1/3 min-h-0 border-r bg-sidebar/30 flex flex-col overflow-hidden",children:b(u,{className:"flex-1 min-h-0 [&>div>div]:block!",children:z&&z.rootFolder?b("div",{className:"p-2",children:b(p0,{teamId:_,projectId:z.id,projectName:z.name,rootFolderId:z.rootFolder,onSelect:($)=>U($),selectedFolderId:w,hideCollections:!0,hideShares:!0,hideRecentlyDeleted:!0})}):b("div",{className:"flex items-center justify-center h-full p-6 text-xs text-muted-foreground",children:W?b(h,{className:"w-5 h-5 animate-spin text-muted-foreground"}):K.no_project_selected()})})}),N("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden bg-background",children:[N("div",{className:"p-2.5 px-4 border-b flex items-center justify-between bg-muted/20 shrink-0",children:[N("div",{className:"flex items-center gap-2 text-xs font-medium truncate",children:[b(a,{className:"w-4 h-4 text-muted-foreground shrink-0"}),b("span",{className:"truncate",children:y?y.name:z?.name||""}),E0&&b("span",{className:"text-[10px] text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"Root"})]}),!E0&&y&&b(r,{size:"sm",variant:T.has(y.id)?"secondary":"outline",className:"h-7 text-xs gap-1.5",onClick:e,disabled:Y.includes(y.id),children:T.has(y.id)?N(w0,{children:[b(M0,{className:"w-3.5 h-3.5 text-primary"}),K.saved()]}):N(w0,{children:[b(g0,{className:"w-3.5 h-3.5"}),K.select_current_folder()]})})]}),b(u,{className:"flex-1 min-h-0 [&>div>div]:block!",children:t?b("div",{className:"flex items-center justify-center p-12",children:b(h,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):M.length===0?N("div",{className:"flex flex-col items-center justify-center p-12 text-center text-xs text-muted-foreground gap-2",children:[b(a,{className:"w-8 h-8 opacity-30"}),b("p",{children:K.no_assets_in_folder()})]}):N("div",{className:"divide-y divide-border/40",children:[M.map(($)=>{let g=Y.includes($.id),N0=T.has($.id),v0=$.type==="folder";return N("div",{onClick:()=>{if(!g)s($)},className:`flex items-center gap-3 px-4 py-2.5 hover:bg-muted/40 cursor-pointer transition-colors ${N0?"bg-primary/5":""} ${g?"opacity-50 cursor-not-allowed":""}`,children:[b(t0,{checked:N0,disabled:g,onCheckedChange:()=>{if(!g)s($)},onClick:(kb)=>kb.stopPropagation()}),b("div",{className:"w-9 h-9 rounded bg-muted/60 border shrink-0 flex items-center justify-center overflow-hidden",children:$.preview?.thumbnailUrl?b("img",{src:$.preview.thumbnailUrl,alt:$.name,className:"w-full h-full object-cover"}):v0?b(a,{className:"w-5 h-5 text-primary fill-primary/20"}):b(C0,{className:"w-5 h-5 text-muted-foreground"})}),N("div",{className:"flex-1 min-w-0",children:[b("p",{className:"text-xs font-medium truncate text-foreground",children:$.name}),N("p",{className:"text-[11px] text-muted-foreground truncate",children:[v0?`${$.fileCount??0} items`:Q0($.sizeByte||0),$.creator?.name?` • ${$.creator.name}`:""]})]})]},$.id)}),b("div",{ref:J,className:"h-1"}),C&&b("div",{className:"flex items-center justify-center p-3",children:b(h,{className:"w-4 h-4 animate-spin text-muted-foreground"})})]})})]})]}),N(h0,{className:"p-3 px-4 border-t flex items-center justify-between sm:justify-between bg-muted/10 shrink-0",children:[b("div",{className:"text-xs text-muted-foreground",children:T.size>0&&K.n_assets_selected({count:T.size})}),N("div",{className:"flex items-center gap-2",children:[b(r,{variant:"outline",size:"sm",onClick:O,children:K.cancel()}),b(r,{size:"sm",onClick:b0,disabled:T.size===0,children:K.add_assets()})]})]})]})})}function _b({teamId:_,projectId:G,assets:Y,onAddAssets:Z,onRemoveAsset:O,disabled:D=!1}){let[X,L]=Nb.useState(!1),y=(U)=>{let T=new Set(Y.map((v)=>v.id)),P=U.filter((v)=>!T.has(v.id));if(P.length>0)Z(P)};return N("div",{className:"space-y-2",children:[N("div",{className:"flex items-center justify-between",children:[N("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-foreground",children:[b(e0,{className:"w-3.5 h-3.5 text-muted-foreground"}),b("span",{children:K.related_assets()}),Y.length>0&&N("span",{className:"text-[11px] text-muted-foreground font-normal",children:["(",Y.length,")"]})]}),!D&&b(r,{type:"button",variant:"ghost",size:"sm",className:"h-6 w-6 p-0 hover:bg-muted",onClick:()=>L(!0),title:K.add_assets(),children:b(g0,{className:"w-3.5 h-3.5"})})]}),b(bb,{}),Y.length===0?b("p",{className:"text-xs text-muted-foreground/70 py-1 italic",children:K.no_related_assets()}):b("div",{className:"space-y-1.5 max-h-48 overflow-y-auto pr-1",children:Y.map((U)=>{let T=U.type==="folder";return N("div",{className:"flex items-center justify-between gap-2 p-1.5 px-2 rounded-md bg-muted/40 hover:bg-muted/70 transition-colors text-xs border border-border/40",children:[N("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[b("div",{className:"w-7 h-7 rounded bg-muted border shrink-0 flex items-center justify-center overflow-hidden",children:U.thumbnailUrl?b("img",{src:U.thumbnailUrl,alt:U.name,className:"w-full h-full object-cover"}):T?b(a,{className:"w-4 h-4 text-primary fill-primary/20"}):b(C0,{className:"w-4 h-4 text-muted-foreground"})}),N("div",{className:"flex-1 min-w-0",children:[b("p",{className:"font-medium truncate text-foreground leading-snug",children:U.name}),b("p",{className:"text-[10px] text-muted-foreground truncate leading-none mt-0.5",children:U.path||"/"})]})]}),N("div",{className:"flex items-center gap-2 shrink-0",children:[U.creator&&N("div",{className:"flex items-center gap-1 text-[11px] text-muted-foreground",title:U.creator.name,children:[N(Z0,{className:"w-4 h-4 text-[9px]",children:[b(f0,{src:U.creator.image||void 0}),b(z0,{children:U.creator.name.slice(0,1).toUpperCase()})]}),b("span",{className:"hidden sm:inline text-[11px] max-w-[80px] truncate",children:U.creator.name})]}),!D&&b(r,{type:"button",variant:"ghost",size:"sm",className:"h-5 w-5 p-0 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:()=>O(U.id),title:K.unlink_asset(),children:b(U0,{className:"w-3 h-3"})})]})]},U.id)})}),X&&b(s0,{teamId:_,initialProjectId:G,excludeAssetIds:Y.map((U)=>U.id),isOpen:X,onClose:()=>L(!1),onConfirm:y})]})}var F0=$0(Y0(),1);function Eb({teamId:_,currentProjectId:G,currentTargetFolderId:Y,isOpen:Z,onClose:O,onSelect:D}){let[X,L]=F0.useState(G||""),[y,U]=F0.useState(null),{data:T,isLoading:P}=S({queryKey:["teams",_,"projects"],queryFn:async()=>{let z=await R.api.teams[":teamId"].projects.$get({param:{teamId:_},query:{first:"100"}});if(!z.ok)throw Error("Failed to fetch projects");return await z.json()},enabled:!!_&&Z}),v=T?.data||[],W=X||(v[0]?.id??""),f=v.find((z)=>z.id===W),p=()=>{if(!W)return;let z=y?.id||f?.rootFolder;if(z)D(W,z,y?.name||f?.name),O()};return b(V0,{open:Z,onOpenChange:(z)=>!z&&O(),children:N(O0,{className:"sm:max-w-2xl flex flex-col h-[580px]",children:[b(q0,{children:N("div",{className:"flex items-center gap-2",children:[b(a,{className:"w-5 h-5 text-primary"}),b(B0,{children:K.select_target_folder()})]})}),N("div",{className:"flex flex-col gap-3 flex-1 overflow-hidden py-2",children:[N("div",{className:"space-y-1.5",children:[b("label",{className:"text-xs font-medium text-muted-foreground",children:K.select_project()}),N(H0,{value:W,onValueChange:(z)=>{L(z),U(null)},children:[b(y0,{className:"h-9",children:b(W0,{placeholder:K.select_project()})}),b(J0,{children:v.map((z)=>b(I,{value:z.id,children:z.name},z.id))})]})]}),N("div",{className:"space-y-1.5 flex-1 flex flex-col overflow-hidden",children:[b("label",{className:"text-xs font-medium text-muted-foreground",children:K.target_folder()}),b("div",{className:"border rounded-md flex-1 overflow-hidden bg-sidebar/50",children:b(u,{className:"h-full",children:f&&f.rootFolder?b(p0,{teamId:_,projectId:f.id,projectName:f.name,rootFolderId:f.rootFolder,onSelect:U,selectedFolderId:y?.id||Y||f.rootFolder,hideCollections:!0,hideShares:!0,hideRecentlyDeleted:!0}):b("div",{className:"flex items-center justify-center h-full p-6 text-xs text-muted-foreground",children:P?b(h,{className:"w-5 h-5 animate-spin text-muted-foreground"}):K.no_project_selected()})})})]})]}),N(h0,{children:[b(r,{variant:"outline",onClick:O,children:K.cancel()}),b(r,{onClick:p,disabled:!W,children:K.confirm()})]})]})})}function Hb({teamId:_,task:G,canEdit:Y=!0}){let Z=R0(),[O,D]=X0.useState(G.title),[X,L]=X0.useState(G.description||""),[y,U]=X0.useState(!1),[T,P]=X0.useState(null),v=X0.useRef(null);X0.useEffect(()=>{D(G.title),L(G.description||"")},[G.id,G.title,G.description]);let{data:W=[]}=S({queryKey:["teams",_,"members","human"],queryFn:async()=>{let E=await R.api.teams[":teamId"].members.$get({param:{teamId:_},query:{includeAgents:"false"}});if(!E.ok)return[];let V=await E.json();return Array.isArray(V)?V:[]},enabled:!!_}),{data:f=[]}=S({queryKey:["teams",_,"agents"],queryFn:async()=>{let E=await R.api.teams[":teamId"].agents.$get({param:{teamId:_}});if(!E.ok)return[];return await E.json()||[]},enabled:!!_}),{data:p}=S({queryKey:["teams",_,"kanban","goals"],queryFn:async()=>{let E=await R.api.teams[":teamId"].kanban.goals.$get({param:{teamId:_},query:{}});if(!E.ok)return{data:[]};return await E.json()},enabled:!!_}),z=p?.data||[],{mutate:w,isPending:E0}=_0({mutationFn:async(E)=>{let V=await R.api.teams[":teamId"].kanban.tasks[":taskId"].$patch({param:{teamId:_,taskId:G.id},json:E});if(!V.ok){let H=await V.json().catch(()=>({message:K.error()}));throw Error(H.message||K.error())}return await V.json()},onSuccess:()=>{Z.invalidateQueries({queryKey:["teams",_,"kanban","task",G.id]}),Z.invalidateQueries({queryKey:["teams",_,"kanban","tasks"]})},onError:(E)=>{c.error(E.message)}}),{mutate:k}=_0({mutationFn:async(E)=>{let V=await R.api.teams[":teamId"].kanban.tasks[":taskId"].assets.$post({param:{teamId:_,taskId:G.id},json:{assetIds:E.map((H)=>H.id)}});if(!V.ok)throw Error("Failed to link assets");return await V.json()},onSuccess:()=>{Z.invalidateQueries({queryKey:["teams",_,"kanban","task",G.id]}),Z.invalidateQueries({queryKey:["teams",_,"kanban","tasks"]}),c.success(K.asset_linked())},onError:(E)=>{c.error(E.message)}}),{mutate:F}=_0({mutationFn:async(E)=>{let V=await R.api.teams[":teamId"].kanban.tasks[":taskId"].assets[":assetId"].$delete({param:{teamId:_,taskId:G.id,assetId:E}});if(!V.ok)throw Error("Failed to unlink asset");return await V.json()},onSuccess:()=>{Z.invalidateQueries({queryKey:["teams",_,"kanban","task",G.id]}),Z.invalidateQueries({queryKey:["teams",_,"kanban","tasks"]}),c.success(K.asset_unlinked())},onError:(E)=>{c.error(E.message)}}),l=(E,V)=>{if(E==="title")D(V);if(E==="description")L(V);if(v.current)clearTimeout(v.current);v.current=setTimeout(()=>{if(E==="title"&&V.trim()&&V.trim()!==G.title)w({title:V.trim()});else if(E==="description"&&V!==(G.description||""))w({description:V.trim()||null})},600)},i=G.isAgentTask;return N(u,{className:"h-full p-5",children:[N("div",{className:"space-y-6 w-full pr-3",children:[N("div",{className:"space-y-1.5",children:[N("div",{className:"flex items-center justify-between",children:[b(d,{htmlFor:"task-title",className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:K.task_title()}),E0&&N("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground animate-pulse",children:[b(h,{className:"w-3 h-3 animate-spin"}),K.saving()]})]}),b(P0,{id:"task-title",value:O,onChange:(E)=>l("title",E.target.value),disabled:!Y,className:"text-base font-semibold h-10 bg-background",placeholder:K.task_title_placeholder()})]}),N("div",{className:"space-y-1.5",children:[b(d,{htmlFor:"task-description",className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:K.task_description()}),b($b,{id:"task-description",value:X,onChange:(E)=>l("description",E.target.value),disabled:!Y,rows:5,className:"text-xs leading-relaxed bg-background",placeholder:K.task_description_placeholder()})]}),N("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 p-4 rounded-lg bg-muted/20 border border-border/60",children:[N("div",{className:"sm:col-span-2 flex items-center justify-between space-x-2 rounded-md border border-border/60 bg-background/50 px-3 py-2 h-14",children:[N("div",{className:"space-y-0.5 min-w-0 pr-2",children:[N(d,{className:"text-xs font-medium text-muted-foreground flex items-center gap-1.5",children:[b(L0,{className:"w-3.5 h-3.5 text-orange-500"}),b("span",{children:K.task_type_agent()})]}),b("p",{className:"text-[11px] text-muted-foreground/80 line-clamp-1",children:K.task_type_agent_desc()})]}),b(Yb,{checked:G.isAgentTask,disabled:!0})]}),N("div",{className:"space-y-1.5",children:[b(d,{className:"text-xs font-medium text-muted-foreground",children:K.task_priority()}),N(H0,{value:G.priority,onValueChange:(E)=>w({priority:E}),disabled:!Y,children:[b(y0,{className:"w-full h-8 text-xs bg-background",children:b(W0,{})}),b(J0,{children:Object.values(x).map((E)=>b(I,{value:E,children:b("span",{className:j("px-1.5 py-0.5 rounded text-[10px] uppercase font-medium",n0(E)),children:c0(E)})},E))})]})]}),N("div",{className:"space-y-1.5",children:[b(d,{className:"text-xs font-medium text-muted-foreground",children:K.goals()}),N(H0,{value:G.goal?.id||"none",onValueChange:(E)=>w({goalId:E==="none"?null:E}),disabled:!Y,children:[b(y0,{className:"w-full h-8 text-xs bg-background",children:b(W0,{placeholder:K.no_folder_selected()})}),N(J0,{children:[b(I,{value:"none",children:b("span",{className:"text-muted-foreground italic",children:"None"})}),z.filter((E)=>E.id!==Gb).map((E)=>b(I,{value:E.id,children:N("div",{className:"flex items-center gap-2",children:[b(Kb,{className:"w-3.5 h-3.5 text-primary"}),b("span",{children:E.title})]})},E.id))]})]})]}),N("div",{className:"space-y-1.5",children:[b(d,{className:"text-xs font-medium text-muted-foreground",children:i?K.select_agent():K.assignee()}),N(H0,{value:G.assignee?.id||"none",onValueChange:(E)=>w({assigneeId:E==="none"?null:E}),disabled:!Y,children:[b(y0,{className:"w-full h-8 text-xs bg-background",children:b(W0,{placeholder:K.unassigned()})}),N(J0,{children:[b(I,{value:"none",children:b("span",{className:"text-muted-foreground italic",children:K.unassigned()})}),i?f.map((E)=>b(I,{value:E.id,children:N("div",{className:"flex items-center gap-2",children:[b(L0,{className:"w-3.5 h-3.5 text-purple-500"}),b("span",{children:E.name})]})},E.id)):W.map((E)=>b(I,{value:E.id,children:N("div",{className:"flex items-center gap-2",children:[N(Z0,{size:"sm",className:"w-4 h-4",children:[b(f0,{src:E.image}),b(z0,{className:"text-[8px]",children:E.name.slice(0,2).toUpperCase()})]}),b("span",{children:E.name})]})},E.id))]})]})]}),N("div",{className:"space-y-1.5",children:[b(d,{className:"text-xs font-medium text-muted-foreground",children:K.reporter()}),N(H0,{value:G.reporter?.id||"none",onValueChange:(E)=>w({reporterId:E==="none"?null:E}),disabled:!Y,children:[b(y0,{className:"w-full h-8 text-xs bg-background",children:b(W0,{placeholder:K.unassigned()})}),N(J0,{children:[b(I,{value:"none",children:b("span",{className:"text-muted-foreground italic",children:K.unassigned()})}),W.map((E)=>b(I,{value:E.id,children:N("div",{className:"flex items-center gap-2",children:[N(Z0,{size:"sm",className:"w-4 h-4",children:[b(f0,{src:E.image}),b(z0,{className:"text-[8px]",children:E.name.slice(0,2).toUpperCase()})]}),b("span",{children:E.name})]})},E.id))]})]})]}),i&&N("div",{className:"sm:col-span-2 space-y-1.5",children:[b(d,{className:"text-xs font-medium text-muted-foreground",children:K.target_folder()}),b("div",{className:"flex items-center gap-2",children:N(r,{type:"button",variant:"outline",size:"sm",onClick:()=>U(!0),disabled:!Y,className:"w-full justify-start h-8 text-xs bg-background truncate font-normal",children:[b(a,{className:"w-3.5 h-3.5 mr-2 text-primary shrink-0"}),b("span",{className:"truncate",children:T||(G.targetFolderId?"Selected Folder":K.select_target_folder())})]})})]}),N("div",{className:"space-y-1.5",children:[b(d,{className:"text-xs font-medium text-muted-foreground",children:K.start_date()}),b(o0,{value:G.startDate?new Date(G.startDate):void 0,onChange:(E)=>w({startDate:E?E.toISOString():null}),disabled:!Y,placeholder:K.start_date(),className:"h-8 text-xs bg-background"})]}),N("div",{className:"space-y-1.5",children:[b(d,{className:"text-xs font-medium text-muted-foreground",children:K.due_date()}),b(o0,{value:G.dueDate?new Date(G.dueDate):void 0,onChange:(E)=>w({dueDate:E?E.toISOString():null}),disabled:!Y,placeholder:K.due_date(),className:"h-8 text-xs bg-background"})]}),N("div",{className:"sm:col-span-2 space-y-1.5",children:[b(d,{className:"text-xs font-medium text-muted-foreground",children:K.parent_tasks()}),b(j0,{teamId:_,currentTaskId:G.id,excludeTaskIds:G.dependents.map((E)=>E.id),value:G.dependencies.map((E)=>E.id),knownTasks:[...G.dependencies,...G.dependents],onChange:(E)=>w({parentIds:E}),canEdit:Y})]}),b("div",{className:"sm:col-span-2 pt-1",children:b(_b,{teamId:_,projectId:G.projectId,assets:G.assets||[],onAddAssets:(E)=>k(E),onRemoveAsset:(E)=>F(E),disabled:!Y})})]})]}),y&&b(Eb,{teamId:_,currentProjectId:G.projectId,currentTargetFolderId:G.targetFolderId,isOpen:y,onClose:()=>U(!1),onSelect:(E,V,H)=>{P(H||"Selected Folder"),w({projectId:E,targetFolderId:V})}})]})}var Fb=$0(Y0(),1);var hb=$0(Y0(),1);var Tb=$0(Y0(),1);function wb({teamId:_,taskId:G,comment:Y,currentUserId:Z,isOwnerOrAdmin:O,onViewAttachment:D}){let X=R0(),[L,y]=Tb.useState(!1),U=O||Y.author.id===Z,{mutate:T,isPending:P}=_0({mutationFn:async()=>{let W=await R.api.teams[":teamId"].kanban.tasks[":taskId"].comments[":commentId"].$delete({param:{teamId:_,taskId:G,commentId:Y.id}});if(!W.ok){let f=await W.json().catch(()=>({message:K.error()}));throw Error(f.message||K.error())}return await W.json()},onSuccess:()=>{X.invalidateQueries({queryKey:["teams",_,"kanban","tasks",G,"comments"]}),X.invalidateQueries({queryKey:["teams",_,"kanban","task",G]}),X.invalidateQueries({queryKey:["teams",_,"kanban","tasks"]}),c.success("Comment deleted"),y(!1)},onError:(W)=>{c.error(W.message)}}),v=(Y.author.name||"U").split(" ").map((W)=>W[0]).slice(0,2).join("").toUpperCase();return N("div",{className:"relative flex gap-3 p-3 rounded-xl border border-transparent bg-foreground/[0.03] dark:bg-foreground/[0.08] hover:bg-foreground/[0.06] dark:hover:bg-foreground/[0.12] transition-colors group",children:[N(Z0,{className:"w-7 h-7 shrink-0 mt-0.5 border border-border",children:[Y.author.image&&b(f0,{src:Y.author.image,alt:Y.author.name}),b(z0,{className:"text-[10px] font-medium bg-muted text-muted-foreground",children:v})]}),N("div",{className:"flex-1 min-w-0 space-y-1.5",children:[N("div",{className:"flex items-center justify-between gap-2",children:[N("div",{className:"flex items-center gap-2 min-w-0",children:[b("span",{className:"font-semibold text-xs text-foreground truncate",children:Y.author.name}),b("span",{className:"text-[10px] text-muted-foreground shrink-0 font-mono",children:S0(new Date(Y.createdAt),"MMM d, h:mm a")})]}),U&&b("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",children:N(Jb,{modal:!1,children:[b(Zb,{asChild:!0,children:b(r,{size:"icon-xs",variant:"ghost",className:"h-5 w-5 text-muted-foreground",children:b(Wb,{className:"h-3.5 w-3.5"})})}),b(fb,{align:"end",children:N(zb,{className:"text-destructive focus:text-destructive cursor-pointer text-xs",onClick:()=>y(!0),children:[b(yb,{className:"mr-1.5 h-3.5 w-3.5"}),b("span",{children:K.delete()})]})})]})})]}),Y.body&&b("div",{className:"text-xs leading-relaxed prose prose-xs dark:prose-invert max-w-none break-words text-foreground/90 font-sans",children:b(Rb,{children:Y.body})}),Y.attachments&&Y.attachments.length>0&&b("div",{className:"flex flex-wrap gap-2 pt-1.5",children:Y.attachments.map((W)=>{let f=W.proxyType==="image"||W.contentType?.startsWith("image/");return b("div",{className:"relative group/att rounded-lg border border-border bg-card overflow-hidden transition-all duration-200",children:f?N("div",{className:"w-40 h-28 relative cursor-pointer overflow-hidden bg-muted/40",onClick:()=>D?.(W),children:[b("img",{src:W.url,alt:W.name,className:"w-full h-full object-cover group-hover/att:scale-105 transition-transform duration-200"}),b("a",{href:W.url,download:W.name,target:"_blank",rel:"noreferrer",className:"absolute right-1.5 bottom-1.5 bg-black/60 hover:bg-black/80 text-white p-1 rounded-md opacity-0 group-hover/att:opacity-100 transition-opacity shadow-xs",onClick:(p)=>p.stopPropagation(),title:"Download",children:b(k0,{className:"w-3.5 h-3.5"})})]}):N("div",{className:"flex items-center gap-2.5 p-2.5 max-w-[240px] bg-card hover:bg-muted/40 transition-colors",children:[b(A0,{className:"w-7 h-7 text-primary/80 shrink-0"}),N("div",{className:"min-w-0 flex-1",children:[b("p",{className:"text-xs font-medium text-foreground truncate",title:W.name,children:W.name}),b("p",{className:"text-[10px] text-muted-foreground font-mono",children:Q0(W.sizeByte)})]}),b("a",{href:W.url,download:W.name,target:"_blank",rel:"noreferrer",className:"p-1 text-muted-foreground hover:text-foreground shrink-0 rounded-md hover:bg-muted transition-colors",title:"Download",children:b(k0,{className:"w-3.5 h-3.5"})})]})},W.id)})})]}),b(Xb,{open:L,onOpenChange:y,children:N(Ub,{children:[N(Db,{children:[b(Ob,{children:K.delete_comment_confirm()}),b(qb,{children:K.delete_comment_description()})]}),N(Vb,{children:[b(Qb,{disabled:P,children:K.cancel()}),b(Bb,{className:"bg-destructive hover:bg-destructive/90 text-white",disabled:P,onClick:()=>T(),children:K.delete()})]})]})})]})}var n=$0(Y0(),1);function Cb({teamId:_,onSendMessage:G,isSubmitting:Y}){let[Z,O]=n.useState(""),[D,X]=n.useState([]),[L,y]=n.useState(!1),[U,T]=n.useState(""),[P,v]=n.useState(0),W=n.useRef(null),f=n.useRef(null),p=n.useRef(null),{members:z,fetchMembers:w}=Pb();n.useEffect(()=>{if(_)w(_,!0,!0)},[_,w]);let{mutateAsync:E0}=_0({mutationFn:async(J)=>{let B=await R.api.teams[":teamId"].kanban.attachments.$post({param:{teamId:_},json:J});if(!B.ok)throw Error("Failed to get attachment upload url");return await B.json()}}),k=(J)=>{let B=J.target.value;if(O(B),W.current)W.current.style.height="auto",W.current.style.height=`${Math.min(W.current.scrollHeight,160)}px`;let t=J.target.selectionStart||0,C=B.slice(0,t),M=C.lastIndexOf("@");if(M!==-1){let s=M===0,e=C[M-1];if(s||/\s/.test(e)){let $=C.slice(M+1);if(!/\s/.test($)){T($),y(!0);return}}}y(!1)},F=z.filter((J)=>J.name?.toLowerCase().includes(U.toLowerCase()));n.useEffect(()=>{v(0)},[U,L]);let l=(J)=>{if(!W.current)return;let B=W.current.selectionStart||0,t=Z.slice(0,B),C=Z.slice(B),M=t.lastIndexOf("@");if(M!==-1){let s=`${Z.slice(0,M)}@${J.name} ${C}`;O(s),y(!1),setTimeout(()=>{if(W.current){W.current.focus();let e=M+J.name.length+2;W.current.setSelectionRange(e,e)}},0)}},i=async(J)=>{let B=Array.from(J.target.files||[]);if(B.length===0)return;let t=B.map((C)=>({id:`${Date.now()}-${C.name}-${Math.random()}`,file:C,isUploading:!0}));X((C)=>[...C,...t]);for(let C of t)try{let M=await E0({fileName:C.file.name,size:C.file.size,contentType:C.file.type||"application/octet-stream"});if(!(await fetch(M.uploadUrl,{method:"PUT",body:C.file,headers:{"Content-Type":C.file.type||"application/octet-stream"}})).ok)throw Error("Failed to upload file to storage");X((e)=>e.map((b0)=>b0.id===C.id?{...b0,isUploading:!1,payload:{id:M.id,name:M.name,key:M.key,sizeByte:M.sizeByte,contentType:M.contentType,proxyType:M.proxyType}}:b0))}catch(M){let s=M instanceof Error?M.message:"Upload failed";c.error(`${C.file.name}: ${s}`),X((e)=>e.map((b0)=>b0.id===C.id?{...b0,isUploading:!1,error:s}:b0))}if(f.current)f.current.value=""},E=(J)=>{X((B)=>B.filter((t)=>t.id!==J))},V=D.some((J)=>J.isUploading),H=D.map((J)=>J.payload).filter((J)=>!!J),q=(Z.trim().length>0||H.length>0)&&!V,A=async()=>{if(!q||Y)return;try{if(await G(Z.trim(),H.length>0?H:void 0),O(""),X([]),W.current)W.current.style.height="auto"}catch{}},o=(J)=>{if(L&&F.length>0){if(J.key==="ArrowDown"){J.preventDefault(),v((B)=>(B+1)%F.length);return}if(J.key==="ArrowUp"){J.preventDefault(),v((B)=>(B-1+F.length)%F.length);return}if(J.key==="Enter"||J.key==="Tab"){J.preventDefault();let B=F[P];if(B)l(B);return}if(J.key==="Escape"){y(!1);return}}if(J.key==="Enter"&&(J.metaKey||J.ctrlKey))J.preventDefault(),A()};return N("div",{className:"relative flex flex-col w-full border border-border focus-within:border-foreground/40 bg-card rounded-2xl p-2.5 shadow-2xs transition-all",children:[L&&F.length>0&&b("div",{ref:p,className:"absolute bottom-full left-0 mb-2 w-64 max-h-48 overflow-y-auto rounded-xl border border-border bg-popover p-1 shadow-lg z-50",children:F.map((J,B)=>N("button",{type:"button",onClick:()=>l(J),className:`w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-colors text-left ${B===P?"bg-primary text-primary-foreground font-medium":"hover:bg-muted text-foreground"}`,children:[N(Z0,{className:"w-5 h-5",children:[J.image&&b(f0,{src:J.image}),b(z0,{className:"text-[9px]",children:J.name?.slice(0,2).toUpperCase()})]}),b("span",{className:"truncate",children:J.name})]},J.id))}),D.length>0&&b("div",{className:"flex flex-wrap gap-1.5 pb-2 mb-1.5 border-b border-border/50",children:D.map((J)=>{let B=J.file.type.startsWith("image/");return N("div",{className:"flex items-center gap-1.5 pl-2 pr-1.5 py-1 rounded-lg bg-muted/60 border border-border text-xs max-w-[200px]",children:[J.isUploading?b(h,{className:"w-3.5 h-3.5 animate-spin text-primary shrink-0"}):B?b(vb,{className:"w-3.5 h-3.5 text-primary shrink-0"}):b(A0,{className:"w-3.5 h-3.5 text-muted-foreground shrink-0"}),N("div",{className:"min-w-0 flex-1 truncate",children:[b("span",{className:"truncate block font-medium text-[11px]",children:J.file.name}),b("span",{className:"text-[9px] text-muted-foreground font-mono",children:Q0(J.file.size)})]}),b("button",{type:"button",onClick:()=>E(J.id),className:"p-0.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted shrink-0",children:b(U0,{className:"w-3 h-3"})})]},J.id)})}),b("textarea",{ref:W,value:Z,onChange:k,onKeyDown:o,placeholder:K.comment_placeholder(),rows:1,className:"w-full min-h-[44px] max-h-[160px] bg-transparent border-0 focus:outline-hidden focus-visible:ring-0 resize-none text-xs text-foreground placeholder:text-muted-foreground/70 p-1 font-sans leading-relaxed"}),N("div",{className:"flex items-center justify-between pt-1 mt-1 border-t border-border/40",children:[N("div",{className:"flex items-center gap-1",children:[b("input",{ref:f,type:"file",multiple:!0,className:"hidden",onChange:i}),b(r,{type:"button",variant:"ghost",size:"icon-xs",onClick:()=>f.current?.click(),className:"h-7 w-7 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted",title:"Attach files",disabled:Y,children:b(Mb,{className:"w-3.5 h-3.5"})}),b("span",{className:"text-[10px] text-muted-foreground/60 hidden sm:inline pl-1",children:"Cmd+Enter to send"})]}),b(r,{type:"button",size:"icon-xs",onClick:A,disabled:!q||Y,className:"h-7 w-7 rounded-full shadow-xs bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-40 transition-all shrink-0",title:"Send comment",children:Y||V?b(h,{className:"w-3.5 h-3.5 animate-spin"}):b(Lb,{className:"w-3.5 h-3.5 stroke-[2.5]"})})]})]})}function pb({teamId:_,taskId:G,initialComments:Y}){let Z=R0(),[O,D]=hb.useState(null),{data:X}=S({queryKey:["teams",_,"me"],queryFn:async()=>{let f=await R.api.teams[":teamId"].me.$get({param:{teamId:_}});if(!f.ok)throw Error("Failed to fetch me");return await f.json()},enabled:!!_}),L=X?.role?.toLowerCase()==="owner"||X?.role?.toLowerCase()==="editor",{data:y,isLoading:U}=S({queryKey:["teams",_,"kanban","tasks",G,"comments"],queryFn:async()=>{let f=await R.api.teams[":teamId"].kanban.tasks[":taskId"].comments.$get({param:{teamId:_,taskId:G}});if(!f.ok)throw Error("Failed to fetch comments");return await f.json()},initialData:Y?{data:Y}:void 0,enabled:!!_&&!!G,refetchInterval:4000}),T=y?.data||[],{mutateAsync:P,isPending:v}=_0({mutationFn:async({body:f,attachments:p})=>{let z=await R.api.teams[":teamId"].kanban.tasks[":taskId"].comments.$post({param:{teamId:_,taskId:G},json:{body:f,attachments:p}});if(!z.ok){let w=await z.json().catch(()=>({message:K.error()}));throw Error(w.message||K.error())}return await z.json()},onSuccess:()=>{Z.invalidateQueries({queryKey:["teams",_,"kanban","tasks",G,"comments"]}),Z.invalidateQueries({queryKey:["teams",_,"kanban","task",G]}),Z.invalidateQueries({queryKey:["teams",_,"kanban","tasks"]})},onError:(f)=>{c.error(f.message)}}),W=async(f,p)=>{await P({body:f,attachments:p})};return N("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[O&&N("div",{className:"fixed inset-0 z-50 bg-black/90 flex flex-col items-center justify-center p-4 animate-in fade-in duration-150",onClick:()=>D(null),children:[b("button",{type:"button",onClick:()=>D(null),className:"absolute top-4 right-4 text-white/80 hover:text-white bg-white/10 hover:bg-white/20 rounded-full p-2 transition-colors z-50 cursor-pointer",title:"Close",children:b(U0,{className:"w-6 h-6"})}),b("div",{className:"w-full h-full flex items-center justify-center p-2",children:b("img",{src:O.url,alt:O.name,className:"max-w-full max-h-[85vh] object-contain rounded-lg shadow-2xl",onClick:(f)=>f.stopPropagation()})})]}),b(u,{className:"flex-1 p-3.5",children:b("div",{className:"space-y-3 pr-1 pb-2",children:U?b("div",{className:"flex items-center justify-center py-12",children:b(h,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):T.length===0?N("div",{className:"flex flex-col items-center justify-center py-16 text-center text-xs text-muted-foreground/80 space-y-2",children:[b("div",{className:"w-10 h-10 rounded-full bg-muted/60 flex items-center justify-center",children:b(gb,{className:"w-5 h-5 opacity-40"})}),b("p",{className:"font-medium",children:K.no_comments_yet()})]}):T.map((f)=>b(wb,{teamId:_,taskId:G,comment:f,currentUserId:X?.id,isOwnerOrAdmin:L,onViewAttachment:(p)=>D(p)},f.id))})}),b("div",{className:"p-3 border-t border-border/60 bg-card/60 shrink-0",children:b(Cb,{teamId:_,onSendMessage:W,isSubmitting:v})})]})}function cb(_){let G=_.data||{};switch(_.type){case m.CREATED:return"Created task";case m.STATUS_CHANGED:return`Changed status from ${_.fromStatus?K0(_.fromStatus):"None"} to ${_.toStatus?K0(_.toStatus):"None"}`;case m.ASSIGNED:return"Assigned task";case m.UNASSIGNED:return"Unassigned task";case m.PRIORITY_CHANGED:return`Changed priority to ${String(G.to||"")}`;case m.GOAL_CHANGED:return"Updated goal association";case m.DEPENDENCY_ADDED:return"Added prerequisite dependency";case m.DEPENDENCY_REMOVED:return"Removed prerequisite dependency";case m.CHANGES_REQUESTED:return`Requested changes: "${String(G.reason||"")}"`;case m.BLOCKED:return`Task blocked: "${String(G.reason||G.blockReason||"")}"`;case m.UNBLOCKED:return"Task unblocked";case m.COMMENTED:return"Added a comment";default:return _.type}}function Ab({teamId:_,taskId:G,initialEvents:Y}){let{data:Z,isLoading:O}=S({queryKey:["teams",_,"kanban","tasks",G,"events"],queryFn:async()=>{let X=await R.api.teams[":teamId"].kanban.tasks[":taskId"].events.$get({param:{teamId:_,taskId:G}});if(!X.ok)throw Error("Failed to fetch events");return await X.json()},initialData:Y?{data:Y}:void 0,enabled:!!_&&!!G}),D=Z?.data||[];return b(u,{className:"h-full p-3",children:b("div",{className:"space-y-4 pr-2",children:b("div",{className:"space-y-2",children:O?b("div",{className:"flex items-center justify-center py-6",children:b(h,{className:"w-4 h-4 animate-spin text-muted-foreground"})}):D.length===0?b("div",{className:"py-6 text-center text-xs text-muted-foreground",children:K.no_activity_yet()}):b("div",{className:"relative pl-5 space-y-3 before:absolute before:left-[4px] before:top-2 before:bottom-2 before:w-[2px] before:bg-border/60",children:D.map((X)=>N("div",{className:"relative flex items-start gap-2 text-xs",children:[b("div",{className:"absolute -left-5 top-[3px] w-2.5 h-2.5 rounded-full bg-background border-2 border-primary shrink-0"}),N("div",{className:"flex-1 min-w-0",children:[N("div",{className:"flex items-center justify-between gap-1",children:[b("span",{className:"font-medium text-foreground truncate",children:X.actor?.name||"System"}),b("span",{className:"text-[10px] text-muted-foreground font-mono shrink-0",children:S0(new Date(X.createdAt),"MM/dd HH:mm")})]}),b("p",{className:"text-[11px] text-muted-foreground leading-snug mt-0.5",children:cb(X)})]})]},X.id))})})})})}function ob({teamId:_,task:G}){let[Y,Z]=Fb.useState("comments");return b("div",{className:"flex flex-col h-full bg-sidebar/30 border-l border-border/60 overflow-hidden",children:N(Sb,{value:Y,onValueChange:(O)=>Z(O),className:"flex flex-col h-full",children:[b("div",{className:"px-3 pt-2.5 pb-1 border-b border-border/60 bg-card/50 shrink-0",children:N(rb,{className:"w-full grid grid-cols-2 h-8 bg-muted/60",children:[N(u0,{value:"comments",className:"text-xs h-7",children:[b("span",{children:K.comments()}),G.comments.length>0&&N("span",{className:"text-[10px] font-mono text-muted-foreground ml-1",children:["(",G.comments.length,")"]})]}),b(u0,{value:"activity",className:"text-xs h-7",children:b("span",{children:K.activity()})})]})}),N("div",{className:"flex-1 overflow-hidden",children:[b(I0,{value:"comments",className:"h-full m-0 data-[state=active]:flex data-[state=active]:flex-col",children:b(pb,{teamId:_,taskId:G.id,initialComments:G.comments})}),b(I0,{value:"activity",className:"h-full m-0 data-[state=active]:block",children:b(Ab,{teamId:_,taskId:G.id,initialEvents:G.events})})]})]})})}function z_({teamId:_,taskId:G,isOpen:Y,onClose:Z,canEdit:O=!0}){let{data:D,isLoading:X,error:L}=S({queryKey:["teams",_,"kanban","task",G],queryFn:async()=>{if(!G)return null;let y=await R.api.teams[":teamId"].kanban.tasks[":taskId"].$get({param:{teamId:_,taskId:G}});if(!y.ok)throw Error("Failed to fetch task details");return await y.json()},enabled:!!_&&!!G&&Y});return b(V0,{open:Y,onOpenChange:(y)=>!y&&Z(),children:N(O0,{className:"sm:max-w-5xl w-[95vw] h-[88vh] p-0 gap-0 flex flex-col overflow-hidden bg-background",children:[b(q0,{className:"px-5 py-3 border-b border-border/70 flex flex-row items-center justify-between space-y-0 shrink-0 bg-card/80",children:N("div",{className:"flex items-center gap-2 min-w-0 pr-4",children:[D?.isAgentTask&&N("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-[11px] font-semibold bg-orange-500/15 text-orange-600 dark:text-orange-400 border border-orange-500/30 shrink-0",children:[b(L0,{className:"w-3.5 h-3.5"}),b("span",{children:K.task_type_agent()})]}),D?.status&&b("span",{className:j("px-2 py-0.5 rounded text-[11px] font-medium border uppercase shrink-0",T0(D.status)),children:K0(D.status)}),b(B0,{className:"text-sm font-semibold truncate text-foreground",children:D?.title||K.edit_task()})]})}),b("div",{className:"flex-1 flex flex-col md:flex-row overflow-hidden",children:X?b("div",{className:"flex-1 flex items-center justify-center p-12",children:b(h,{className:"w-8 h-8 animate-spin text-muted-foreground"})}):L||!D?b("div",{className:"flex-1 flex items-center justify-center p-12 text-xs text-muted-foreground",children:K.file_not_found()}):N(w0,{children:[b("div",{className:"flex-1 md:w-2/3 h-full overflow-hidden flex flex-col",children:b(Hb,{teamId:_,task:D,canEdit:O})}),b("div",{className:"md:w-1/3 h-full overflow-hidden flex flex-col",children:b(ob,{teamId:_,task:D})})]})})]})})}
|
|
2
|
-
export{db as He,K0 as Ie,ub as Je,T0 as Ke,c0 as Le,n0 as Me,j0 as Ne,_b as Oe,Eb as Pe,z_ as Qe};
|
package/bin/chunk-gydktfnx.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p as qy,q as By}from"./chunk-ayr3tsz3.js";import{r as Zy}from"./chunk-hks5k0tm.js";import{t as _y,w as $y}from"./chunk-n2ae527q.js";import{V as Wy}from"./chunk-kcg7d7pk.js";import{Ge as Yy}from"./chunk-vrdbqapq.js";import{Te as p,Ue as v,Ve as g,Xe as f}from"./chunk-8bv8qsb8.js";import{Sf as Jy}from"./chunk-wch8ygpt.js";import{hi as Q,ki as w,qi as $}from"./chunk-jsqsrcse.js";import{$l as Gy,Ak as Oy,Ji as oy,Ki as zy,Li as O,Mi as Z,Ri as by,Yl as Xy,am as Uy,cj as Ky,kj as R}from"./chunk-48yphy68.js";import{Zm as ty}from"./chunk-69at8jm8.js";var X=ty(oy(),1);function _z({shareId:b,initialFolderId:Hy,initialFileId:u,startTime:Ty,versionId:B,compare:Vy,compareLeftId:L,compareRightId:x,compareActiveSide:F="left"}){let W=by(),q=!!Vy&&!!L&&!!x,[J,c]=X.useState(()=>{return localStorage.getItem(`share_pwd_${b}`)||""}),[P,Qy]=X.useState(""),{data:K,error:H,isLoading:ky}=Q({queryKey:["share-info",b,J],queryFn:async()=>{let y=await $.api.shares[":shareId"].info.$get({param:{shareId:b}},{headers:{"x-share-password":J}});if(y.status===401)throw Error("Unauthorized");if(y.status===403){let z=await y.json();throw Error(z.error||"Forbidden")}if(!y.ok)throw Error("Failed to fetch share info");return await y.json()},retry:!1}),G=Hy||K?.rootFolderId,U=u||null,h=B||U,[l,m]=X.useState([]),{data:A}=Q({queryKey:["public-share-folder",b,G,J],queryFn:async()=>{let y=await $.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:b,fileId:G}},{headers:{"x-share-password":J}});if(y.status===401)throw Error("Unauthorized");return await y.json()},enabled:!!K&&!!G});X.useEffect(()=>{if(A?.ancestorFolders&&K){let y=A.ancestorFolders.findIndex((z)=>z.id===K.rootFolderId);if(y!==-1)m(A.ancestorFolders.slice(0,y));else if(G===K.rootFolderId)m([])}},[A,K,G]);let[k,M]=X.useState(new Set),[My,Ny]=X.useState(360),[D,Ey]=X.useState(()=>!u),N=X.useRef(null),[n,C]=X.useState([]),[Ly,t]=X.useState(0),[xy,o]=X.useState(null),[I,Ay]=X.useState(null),[Ry,Py]=X.useState(void 0),{data:i,fetchNextPage:Dy,hasNextPage:Cy,isFetchingNextPage:jy,error:a}=w({queryKey:["public-share-children",b,G,"folder",J],queryFn:async({pageParam:y})=>{let z=await $.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:b,folderId:G},query:{assetType:"folder",after:y}},{headers:{"x-share-password":J}});if(z.status===401)throw Error("Unauthorized");if(z.status===403)throw Error("Expired");return await z.json()},enabled:!!K&&!!G,initialPageParam:"",getNextPageParam:(y)=>y.pageInfo?.cursor||void 0,retry:!1}),{data:d,fetchNextPage:Sy,hasNextPage:wy,isFetchingNextPage:py}=w({queryKey:["public-share-children",b,G,"file",J],queryFn:async({pageParam:y})=>{let z=await $.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:b,folderId:G},query:{assetType:"file",after:y}},{headers:{"x-share-password":J}});if(z.status===401)throw Error("Unauthorized");if(z.status===403)throw Error("Expired");return await z.json()},enabled:!!K&&!!G,initialPageParam:"",getNextPageParam:(y)=>y.pageInfo?.cursor||void 0,retry:!1}),{data:vy}=Q({queryKey:["public-share-fields",b,J],queryFn:async()=>{let y=await $.api.shares[":shareId"].fields.$get({param:{shareId:b}},{headers:{"x-share-password":J}});if(y.status===401)throw Error("Unauthorized");return await y.json()},enabled:!!K}),{data:_,isLoading:gy}=Q({queryKey:["public-share-file",b,U,J],queryFn:async()=>{let y=await $.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:b,fileId:U}},{headers:{"x-share-password":J}});if(y.status===401)throw Error("Unauthorized");return await y.json()},enabled:!!U&&!!K}),{data:fy,isLoading:uy}=Q({queryKey:["public-share-file",b,B,J],queryFn:async()=>{let y=await $.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:b,fileId:B}},{headers:{"x-share-password":J}});if(y.status===401)throw Error("Unauthorized");return await y.json()},enabled:!!B&&!!K}),Y=B?fy:_,Fy=gy||!!B&&uy;X.useEffect(()=>{if(a?.message==="Unauthorized")c(""),localStorage.removeItem(`share_pwd_${b}`)},[a,b]);let E=X.useMemo(()=>i?.pages.flatMap((y)=>y.data??[])??[],[i]),j=X.useMemo(()=>d?.pages.flatMap((y)=>y.data??[])??[],[d]),s=X.useMemo(()=>{if(Y)return Y;if(k.size!==1)return null;let y=Array.from(k)[0];return[...E,...j].find((z)=>z.id===y)||null},[k,E,j,Y]),cy=(y)=>{y.preventDefault(),c(P),localStorage.setItem(`share_pwd_${b}`,P)},hy=(y)=>{if(y.type==="folder"||y.targetType==="folder")W({to:"/share/$shareId/folders/$folderId",params:{shareId:b,folderId:y.id}});else W({to:"/share/$shareId/files/$fileId",params:{shareId:b,fileId:y.versionStack?y.versionStack.id:y.id}});M(new Set)},ly=(y)=>{if(!K)return;let z=y==="root"?K.rootFolderId:y;if(z===K.rootFolderId)W({to:"/share/$shareId",params:{shareId:b}});else W({to:"/share/$shareId/folders/$folderId",params:{shareId:b,folderId:z}});M(new Set)},my=(y)=>{o(y.id||null);let z=y.annotations;if(z&&z.length>0)C(z);else C([]);if(q){if(y.second!==null&&y.second!==void 0)Py({second:y.second,nonce:Date.now()});return}if(y.second!==null&&y.second!==void 0)N.current?.seekTo(y.second),N.current?.pause();else if(z&&z.length>0)N.current?.pause()},r=()=>{C([]),o(null)},S=(y)=>{if(!U)return;W({to:"/share/$shareId/files/$fileId",params:{shareId:b,fileId:U},search:(z)=>({...z,...y})})},ny=()=>{S({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:F==="left"?L:x})},{setProjectState:e,clearProjectState:yy}=Jy();X.useEffect(()=>{if(K&&G){let y=G===K.rootFolderId?K.name:E.find((z)=>z.id===G)?.name||K.name;e({teamId:"",projectId:K.projectId,projectName:K.name,ancestorFolders:l,currentAsset:{name:Y?.name||y,type:U?"file":"folder",version:_?.versionStack?_.versionStack.versions.find((z)=>z.id===h)?.version??_.versionStack.versions.length:void 0,proxyType:Y?.proxyType||null},isRootFolder:G===K.rootFolderId&&!U,isPublic:!0,shareId:b,fileId:U||void 0,allowDownload:K.allowDownload,downloadInfo:Y?{originalKey:Y.media?.original?.key,videoTranscodes:Y.media?.videoTranscodes?.map((z)=>({key:z.key,width:z.width,height:z.height}))}:void 0,onFolderClick:ly,isRightSidebarCollapsed:D,onRightSidebarToggle:()=>Ey((z)=>!z),versions:_?.versionStack?.versions,compareMode:q,canCompareVersions:(_?.versionStack?.versions?.length??0)>=2,onCompareVersions:()=>{let z=_y(_?.versionStack?.versions);if(!z||!U)return;W({to:"/share/$shareId/files/$fileId",params:{shareId:b,fileId:U},search:(V)=>({...V,compare:!0,cmpLeft:z.left.id,cmpRight:z.right.id,cmpActive:"left"})})}})}return()=>yy()},[K,G,E,Y,_,h,U,l,e,yy,D,q,W,b]);let T;if(ky&&!H)T=O("div",{className:"flex flex-1 items-center justify-center bg-background",children:O(R,{className:"h-8 w-8 animate-spin text-foreground"})});else if(H)if(H.message==="Unauthorized"){let y=J!=="";T=O("div",{className:"flex flex-1 items-center justify-center p-4",children:Z(p,{className:"w-full max-w-md",children:[Z(v,{className:"text-center",children:[O("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:O(Oy,{className:"h-6 w-6 text-primary"})}),O(g,{children:Gy.password_protected()})]}),O(f,{children:Z("form",{onSubmit:cy,className:"space-y-4",children:[Z("div",{className:"space-y-2",children:[O(Uy,{type:"password",placeholder:"Enter password",value:P,onChange:(z)=>Qy(z.target.value),autoFocus:!0}),y&&O("p",{className:"text-sm font-medium text-destructive",children:"Incorrect password. Please try again."})]}),O(Xy,{type:"submit",className:"w-full",children:"Access Share"})]})})]})})}else{let y=H.message.includes("expired"),z=H.message.includes("disabled");T=O("div",{className:"flex flex-1 items-center justify-center p-4",children:Z(p,{className:"w-full max-w-md",children:[Z(v,{className:"text-center",children:[O("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:O(Ky,{className:"h-6 w-6 text-destructive"})}),O(g,{children:y?"Share Expired":z?"Share Disabled":"Error"})]}),O(f,{className:"text-center text-muted-foreground",children:H.message})]})})}else if(!K)T=O("div",{className:"flex flex-1 items-center justify-center bg-background",children:O(R,{className:"h-8 w-8 animate-spin text-foreground"})});else T=Z("div",{className:"flex flex-1 overflow-hidden relative",children:[U?Z("div",{className:"flex-1 relative bg-muted/30",children:[Fy&&!q&&O("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:O(R,{className:"h-8 w-8 animate-spin text-foreground"})}),q&&L&&x?O(By,{isPublic:!0,shareId:b,versions:Y?.versionStack?.versions??[],leftId:L,rightId:x,activeSide:F,annotations:n,seekRequest:Ry,allowDownload:K.allowDownload,onActiveSideChange:(y)=>S({cmpActive:y}),onSwitchVersion:(y,z)=>S(y==="left"?{cmpLeft:z}:{cmpRight:z}),onExit:ny,onActiveAssetChange:Ay,onPlay:r,onTimeUpdate:t}):Y&&O(qy,{file:Y,mediaControllerRef:N,onPlay:r,onTimeUpdate:t,annotations:n,startTime:Ty,shareId:b,allowDownload:K.allowDownload})]}):G&&O(Zy,{teamId:"",projectId:K.projectId,assetId:G,folders:E,files:j,selectedItem:null,selectedIds:k,onItemSelect:(y,z)=>{if(z.metaKey||z.ctrlKey){let V=new Set(k);if(V.has(y.id))V.delete(y.id);else V.add(y.id);M(V)}else M(new Set([y.id]))},onItemDoubleClick:hy,onSaveField:()=>{},displayStyle:K.viewMode??"card",onClearSelection:()=>M(new Set),fetchNextFoldersPage:Dy,hasNextFoldersPage:Cy,isFetchingNextFoldersPage:jy,fetchNextFilesPage:Sy,hasNextFilesPage:wy,isFetchingNextFilesPage:py,isShareView:!0,isPublic:!0,shareId:b,allowDownload:K.allowDownload}),!D&&Z(zy,{children:[O(Wy,{onResize:(y)=>Ny((z)=>Math.max(240,Math.min(600,z-y)))}),O("div",{style:{width:My},className:"flex-shrink-0 border-l",children:O($y,{teamId:"",projectId:K.projectId,file:q?I:s,onSaveField:()=>{},members:[],readOnly:!0,publicFields:vy,onCommentSelect:my,isPublic:!0,shareId:b,currentTime:Ly,onTyping:()=>{N.current?.pause()},selectedCommentId:xy,hideAnnotationControl:(q?I:s)?.proxyType==="audio"})})]})]});return Z("div",{className:"flex h-screen flex-col bg-background",children:[O(Yy,{}),T]})}
|
|
2
|
-
export{_z as o};
|
package/bin/chunk-h5j1dqc0.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as s}from"./chunk-gydktfnx.js";import"./chunk-ayr3tsz3.js";import"./chunk-hks5k0tm.js";import"./chunk-n2ae527q.js";import"./chunk-kchbbtdm.js";import"./chunk-0ash207y.js";import"./chunk-12ps84z8.js";import"./chunk-kcg7d7pk.js";import"./chunk-har4xctf.js";import"./chunk-nw03w9pa.js";import"./chunk-vrdbqapq.js";import"./chunk-gx8sz5bw.js";import"./chunk-byjze6hm.js";import"./chunk-gx410cm2.js";import"./chunk-8bv8qsb8.js";import"./chunk-y1pnq12c.js";import"./chunk-8ekjxb5q.js";import"./chunk-7anqxpyv.js";import"./chunk-6ts5az6h.js";import"./chunk-31f07jzm.js";import"./chunk-02b97gsf.js";import"./chunk-5nk7y4ec.js";import"./chunk-mm995mvc.js";import"./chunk-8b11b9cj.js";import"./chunk-wch8ygpt.js";import"./chunk-ntqn09r0.js";import"./chunk-esa954t1.js";import"./chunk-ctx1ms5t.js";import"./chunk-bthrbggg.js";import"./chunk-day0vn14.js";import"./chunk-3ztat2q9.js";import"./chunk-2s97ngr8.js";import"./chunk-dyen2t1p.js";import"./chunk-sepsqqdf.js";import"./chunk-y0k1f3gk.js";import"./chunk-dwkv3bx5.js";import"./chunk-qh3w5w8e.js";import"./chunk-4pj17byj.js";import"./chunk-ps2hw0ps.js";import"./chunk-qrnw89xg.js";import"./chunk-5dfy6173.js";import"./chunk-qrhf20g2.js";import"./chunk-jsqsrcse.js";import"./chunk-8zar6cc4.js";import{Li as t,Wi as a}from"./chunk-48yphy68.js";import"./chunk-69at8jm8.js";function h(){let{shareId:n,fileId:o}=e.useParams(),{start:r,version:i,compare:l,cmpLeft:c,cmpRight:p,cmpActive:d}=e.useSearch();return t(s,{shareId:n,initialFileId:o,startTime:r,versionId:i,compare:l,compareLeftId:c,compareRightId:p,compareActiveSide:d})}var e=a("/share/$shareId/files/$fileId")({component:h});export{e as Route};
|
package/bin/chunk-h7kyj2g2.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as M1,f as n1}from"./chunk-0wgqr4jg.js";import{h as v1}from"./chunk-mkwrrdme.js";import{r as Q1}from"./chunk-hks5k0tm.js";import{w as U1}from"./chunk-n2ae527q.js";import{z as E1}from"./chunk-kchbbtdm.js";import{V as i}from"./chunk-kcg7d7pk.js";import{Fe as q1}from"./chunk-nzrrvn6c.js";import{zf as L1}from"./chunk-02b97gsf.js";import{Sf as K1,Tf as l}from"./chunk-wch8ygpt.js";import{$f as O1}from"./chunk-bthrbggg.js";import{ag as y1}from"./chunk-day0vn14.js";import{Bg as $1,Cg as k1,Lg as H1,Og as W1,yg as n}from"./chunk-3ztat2q9.js";import{bi as V1}from"./chunk-qrhf20g2.js";import{ei as Y1,hi as a,ji as Z1,ki as I,qi as Z}from"./chunk-jsqsrcse.js";import{$l as D,Ji as wx,Ki as r,Li as J,Mi as y,Ri as _1,Wl as B1}from"./chunk-48yphy68.js";import{Zm as hx}from"./chunk-69at8jm8.js";var T=hx(wx(),1);function J1(X,z,L,w,$,_){let g=X.type==="folder",B=z.type==="folder";if(g!==B)return null;let k=B?w:$,O=k.findIndex((A)=>A.id===L),H=k.findIndex((A)=>A.id===z.id);if(O===-1||H===-1)return null;let u=Math.min(O,H),P=Math.max(O,H),q=k.slice(u,P+1),G=new Set(_);return q.forEach((A)=>{if(A.id)G.add(A.id)}),G}function Ax({teamId:X,projectId:z,projectName:L,assetId:w,rootFolderId:$,collection:_,onUpdateCollection:g}){let B=_1(),k=Y1(),{canEdit:O}=V1(z),{setFields:H}=E1(),u=Z.api.files[":fileId"].metadata.$patch,{mutate:P}=Z1({mutationFn:async(x)=>{if(!(await u(x)).ok)throw Error("Failed to patch metadata");return null}}),{data:q}=a({queryKey:["fields",z],queryFn:async()=>{let x=await Z.api.projects[":projectId"].fields.$get({param:{projectId:z}});if(!x.ok)throw Error("Failed to fetch fields");return await x.json()},enabled:!!z});T.useEffect(()=>{if(q)H(q,z)},[q,z,H]);let G=w==="recently-deleted",A=w==="recents",[N1,R]=T.useState(null),[K,N]=T.useState(new Set),[C,s]=T.useState(null),[b1,f1]=T.useState(240),[D1,g1]=T.useState(360),{isChatbotOpen:F}=l(),{members:u1,fetchMembers:d}=L1(),{metadata:P1,fetchMetadata:t,setMetadata:R1}=q1();T.useEffect(()=>{if(X)d(X),t(X)},[X,d,t]);let p=T.useMemo(()=>{return _?.filter?.searchFilter?.conditions||[]},[_]),[E,S]=T.useState(p);T.useEffect(()=>{S(p)},[p]);let e=`project:${z}:sort`,Q=P1[e]||{field:"custom",order:"asc"},C1=(x)=>{if(x)R1(X,e,x)},V=!!_,m=E.length>0||V,{fileListLeftSidebarCollapsed:x1,setFileListLeftSidebarCollapsed:F1,fileListRightSidebarCollapsed:z1,setFileListRightSidebarCollapsed:p1,viewModes:S1}=O1(),h1=S1[z]??"card",m1=T.useRef(null),{data:U}=G||A?{data:void 0}:a({queryKey:["folders",w],queryFn:async()=>{let x=await Z.api.folders[":folderId"].$get({param:{folderId:w}});if(!x.ok)throw Error("failed to fetch folder");return await x.json()}}),{setProjectState:w1,clearProjectState:A1}=K1();T.useEffect(()=>{return w1({teamId:X,projectId:z,projectName:L,ancestorFolders:U?.ancestorFolders??[],currentAsset:G?{name:D.recently_deleted(),type:"folder"}:A?{name:D.recents(),type:"folder"}:V?{id:_.id,name:_.name,type:"folder"}:{id:U?.id||w,name:U?.name,type:"folder"},isRootFolder:!G&&!A&&!V&&w===$,onFolderClick:(x)=>{B({to:"/projects/$projectId/folders/$folderId",params:{projectId:z,folderId:x}})}}),()=>A1()},[X,z,L,U,G,A,w,$,w1,A1,B]);let{data:j,fetchNextPage:j1,hasNextPage:o1,isFetchingNextPage:c1}=I({queryKey:G?["projects",z,"recently-deleted","folder"]:A?["projects",z,"recents","folder"]:["search",X,w,"folder",E,Q,V],queryFn:async({pageParam:x})=>{if(G||V||A){if(G){let Y=await Z.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:z},query:{assetType:"folder",after:x}});if(!Y.ok)throw Error("failed to fetch recently deleted folders");return await Y.json()}return{data:[],pageInfo:{total:0}}}if(m)return{data:[],pageInfo:{total:0}};let h=await Z.api.folders[":folderId"].search.$post({param:{folderId:w},json:{assetType:"folder",after:x,recursively:!1,sort:Q,conditions:[]}});if(!h.ok)throw Error("failed to search folders");return await h.json()},enabled:!m&&!A,initialPageParam:"",getNextPageParam:(x)=>{return x.pageInfo?.cursor||void 0}}),{data:o,fetchNextPage:r1,hasNextPage:a1,isFetchingNextPage:I1}=I({queryKey:G?["projects",z,"recently-deleted","file"]:A?["projects",z,"recents","file"]:["search",X,w,"file",E,Q,V],queryFn:async({pageParam:x})=>{if(G){let Y=await Z.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:z},query:{assetType:"file",after:x}});if(!Y.ok)throw Error("failed to fetch recently deleted files");return await Y.json()}if(A){let Y=await Z.api.projects[":projectId"].recents.$get({param:{projectId:z},query:{after:x,first:"20"}});if(!Y.ok)throw Error("failed to fetch recent files");return await Y.json()}let h=await Z.api.folders[":folderId"].search.$post({param:{folderId:w},json:{assetType:"file",after:x,recursively:m||V,conditions:E,sort:Q}});if(!h.ok)throw Error("failed to search files");return await h.json()},initialPageParam:"",getNextPageParam:(x)=>{return x.pageInfo?.cursor||void 0}}),b=j?.pages.flatMap((x)=>x.data??[])??[],W=o?.pages.flatMap((x)=>x.data??[])??[],l1=j?.pages[0]?.pageInfo?.total,i1=o?.pages[0]?.pageInfo?.total,s1=j?.pages[0]?.pageInfo?.totalSize,d1=o?.pages[0]?.pageInfo?.totalSize,T1=()=>{N(new Set),R(null),s(null)},{dragState:v,handleDragStart:t1,handleDragEnd:e1}=n1({teamId:X,projectId:z,assetId:w,folders:b,files:W,selectedIds:K,onClearSelection:T1}),c=T.useMemo(()=>{if(K.size!==1)return null;let x=Array.from(K)[0];return W.find((Y)=>Y.id===x)||null},[K,W]),xx=(x)=>{if(G)return;if(x.type==="folder")S([]),B({to:"/projects/$projectId/folders/$folderId",params:{projectId:z,folderId:x.id}});else B({to:"/projects/$projectId/files/$fileId",params:{projectId:z,fileId:x.versionStack?x.versionStack.id:x.id},search:{version:void 0}})},zx=(x,h)=>{let Y=h.metaKey||h.ctrlKey;if(h.shiftKey&&C){let G1=[...b,...W].find((f)=>f.id===C);if(G1){let f=J1(G1,x,C,b,W,K);if(f){N(f),R(x);return}}}if(Y){let M=new Set(K);if(M.has(x.id))M.delete(x.id);else M.add(x.id);N(M)}else N(new Set([x.id]));s(x.id),R(x)},X1=(x,h,Y)=>{P({param:{fileId:x},json:[{key:h,value:Y}]},{onSuccess:()=>{k.invalidateQueries({queryKey:["folders",w,"children",{assetType:"file"}]}),k.invalidateQueries({queryKey:["search",X,w]})}})};return y(H1,{modifiers:[M1.configure({anchor:{x:0,y:0}})],plugins:(x)=>x.map((h)=>{if(h===n)return n.configure({dropAnimation:null});if(typeof h==="object"&&h!==null&&"plugin"in h&&h.plugin===n)return n.configure({dropAnimation:null});return h}),sensors:G||A||!O?[]:[k1.configure({activationConstraints:[new $1.Distance({value:10})]})],onDragStart:t1,onDragEnd:e1,children:[J("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:y("div",{ref:m1,className:"flex flex-1 overflow-hidden relative",children:[!x1&&J("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>F1(!0)}),(!z1||F)&&J("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>{p1(!0),l.getState().setIsChatbotOpen(!1)}}),!x1&&y(r,{children:[J("div",{className:"bg-background",style:{width:b1},children:J(y1,{teamId:X,projectId:z,projectName:L,rootFolderId:$,dragState:v,ancestorFolders:U?.ancestorFolders??[]})}),J(i,{onResize:(x)=>{f1((h)=>Math.max(180,Math.min(400,h+x)))},className:"hidden md:block"})]}),J(Q1,{teamId:X,projectId:z,assetId:w,folders:b,files:W,totalFolders:l1,totalFiles:i1,totalFoldersSize:s1,totalFilesSize:d1,selectedItem:N1,selectedIds:K,onItemSelect:zx,onItemDoubleClick:xx,onSaveField:X1,displayStyle:h1,onClearSelection:T1,fetchNextFoldersPage:j1,hasNextFoldersPage:o1||!1,isFetchingNextFoldersPage:c1,fetchNextFilesPage:r1,hasNextFilesPage:a1||!1,isFetchingNextFilesPage:I1,isRecentlyDeleted:G,isRecents:A,filterConditions:E,onFilterChange:S,sort:Q,onSortChange:C1,dragState:v,collection:_,onUpdateCollection:g,rootFolderId:$}),(!z1||F)&&y(r,{children:[J(i,{onResize:(x)=>{g1((h)=>Math.max(240,Math.min(600,h-x)))},className:"hidden md:block"}),J("div",{style:{width:D1},className:"bg-background flex flex-col flex-shrink-0",children:F?J(v1,{projectId:z,contextAssetId:w}):c?J(U1,{teamId:X,projectId:z,file:c,onSaveField:(x,h)=>X1(c.id,x,h),members:u1,hideAnnotationControl:!0}):J("div",{className:"flex h-full items-center justify-center p-4 text-center text-sm text-muted-foreground",children:D.select_asset_to_view_details()})})]})]})}),J(W1,{children:v?.isActive?J("div",{className:B1("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",h1==="list"&&"w-30 h-[40px] px-0 flex-none overflow-hidden justify-center"),style:{transform:"translate(0px, 0px)"},children:y("span",{children:["Moving ",v.itemCount," item",v.itemCount!==1?"s":""]})}):null})]})}
|
|
2
|
-
export{Ax as d};
|
package/bin/chunk-har4xctf.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{X as Vq}from"./chunk-nw03w9pa.js";import{jh as o,kh as r,lh as m,mh as e}from"./chunk-qh3w5w8e.js";import{Nh as h,Oh as C,Ph as O}from"./chunk-5dfy6173.js";import{Qh as P,Sh as k,Th as G,Vh as B,Wh as Y}from"./chunk-qrhf20g2.js";import{Ai as Qq,Bi as Wq,Ci as Xq,Di as Yq,Ei as Zq,Fi as _q,Gi as $q,Hi as Hq,ri as qq,ti as Eq,ui as Jq,wi as Kq,yi as X}from"./chunk-jsqsrcse.js";import{$l as J,Ji as Cq,Ki as t,Kj as H,Li as E,Mi as K,Uj as n,Yl as W,am as Nq,kj as z,ll as s}from"./chunk-48yphy68.js";import{Zm as hq}from"./chunk-69at8jm8.js";var Z=hq(Cq(),1);function uq({open:fq,onOpenChange:Fq,title:zq,members:g,isOwner:_,onInvite:c,onUpdateRole:I,onRemoveMember:v,currentUserId:Pq,availableMembersToAdd:M,onAddMember:L,type:V="team"}){let[T,u]=Z.useState("editor"),[S,p]=Z.useState(null),[l,x]=Z.useState(!1),[D,U]=Z.useState(null),[f,A]=Z.useState(null),[j,i]=Z.useState({}),[$,F]=Z.useState(null),y=(q)=>{if(!q)return"";switch(q.toLowerCase()){case"owner":return J.owner();case"editor":return J.editor();case"reviewer":return J.reviewer();default:return q}},a=(q,N)=>{i((Q)=>({...Q,[q]:N}))},kq=async(q,N)=>{if(!I)return;U(q);try{await I(q,N),X.success(J.member_role_updated())}catch(Q){console.error(Q),X.error(J.failed_to_update_member_role())}finally{U(null)}},Gq=async()=>{if(!v||!f?.id)return;U(f.id);try{await v(f.id),X.success(J.member_removed()),A(null)}catch(q){console.error(q),X.error(J.failed_to_remove_member())}finally{U(null)}},Bq=async()=>{if(!c)return;x(!0);try{let q=await c(T),N=`${window.location.origin}/signup?inviteCode=${q}`;p(N)}catch(q){console.error(q),X.error(J.failed_to_generate_invite_link())}finally{x(!1)}},Lq=async()=>{if(S){if(await Vq(S))X.success(J.invite_link_copied())}},R=(q)=>{if(!q)return"??";return q.split(" ").map((N)=>N[0]).slice(0,2).join("").toUpperCase()},Sq=(q)=>{if(!q)p(null),u("editor"),i({}),F(null);Fq(q)},w=Array.isArray(g)?g:[],Uq=Array.isArray(M)?M:[],yq=V==="project"&&_?w.filter((q)=>q.role==="owner"||q.scope==="project"||q.hasCustomRole):w,d=V==="project"&&_?w.filter((q)=>q.scope==="team"&&q.role!=="owner"&&!q.hasCustomRole):[],b=V==="project"&&_?Uq.filter((q)=>q.scope==="project"):[];return E(qq,{open:fq,onOpenChange:Sq,children:K(Eq,{className:"sm:max-w-xl",onOpenAutoFocus:(q)=>q.preventDefault(),children:[E(Jq,{children:E(Kq,{children:zq})}),K("div",{className:"space-y-4",children:[E("div",{className:"max-h-[300px] overflow-y-auto space-y-2",children:yq.map((q)=>{let N=V==="team"&&q.scope==="project";return K("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-muted/50",children:[K("div",{className:"flex items-center gap-3",children:[K(h,{children:[q.image&&E(C,{src:q.image,alt:q.name,className:"object-cover"}),E(O,{children:R(q.name)})]}),K("div",{className:"flex flex-col",children:[E("span",{className:"text-sm font-medium",children:q.name}),K("div",{className:"flex items-center gap-2",children:[!N&&E("span",{className:"text-xs text-muted-foreground capitalize",children:y(q.role)}),q.scope&&K(t,{children:[!N&&E("span",{className:"text-[10px] text-muted-foreground/70",children:"•"}),E("span",{className:"text-xs text-muted-foreground capitalize",children:q.scope==="team"?J.team_member():J.project_member()})]})]})]})]}),_&&q.role!=="owner"&&q.id!==Pq&&K("div",{className:"flex items-center gap-2",children:[N?E(o,{children:K(r,{children:[E(m,{asChild:!0,children:E("span",{children:E(W,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26 justify-between",disabled:!0,children:E(H,{className:"ml-auto h-3 w-3 opacity-50"})})})}),E(e,{side:"top",children:E("p",{className:"text-xs",children:J.project_member_role_tooltip()})})]})}):K(P,{children:[E(k,{asChild:!0,children:K(W,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:D===q.id,children:[y(q.role),E(H,{className:"ml-1 h-3 w-3 opacity-50"})]})}),E(G,{children:K(B,{value:q.role,onValueChange:(Q)=>kq(q.id,Q),children:[E(Y,{value:"editor",className:"text-xs",children:J.editor()}),E(Y,{value:"reviewer",className:"text-xs",children:J.reviewer()})]})})]}),E(W,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>A(q),disabled:D===q.id,children:D===q.id?E(z,{className:"h-3 w-3 animate-spin"}):E(s,{className:"h-3 w-3"})})]})]},q.id)})}),E(Qq,{open:!!f,onOpenChange:(q)=>!q&&A(null),children:K(Wq,{children:[K(Xq,{children:[E(Zq,{children:J.remove_member()}),E(_q,{children:J.remove_member_confirmation({name:f?.name||"",type:V==="project"?J.project():J.team()})})]}),K(Yq,{children:[E(Hq,{children:J.cancel()}),E($q,{onClick:Gq,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:J.remove()})]})]})})," ",_&&L&&d.length>0&&K("div",{className:"border-t pt-4",children:[E("h4",{className:"text-sm font-medium mb-1",children:J.add_team_member_to_project()}),E("p",{className:"text-xs text-muted-foreground mb-3 font-normal",children:J.add_team_member_to_project_hint()}),E("div",{className:"max-h-[200px] overflow-y-auto space-y-2 pr-1",children:d.map((q)=>{let N=j[q.id]||"editor";return K("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-muted/50",children:[K("div",{className:"flex items-center gap-3",children:[K(h,{children:[q.image&&E(C,{src:q.image,alt:q.name,className:"object-cover"}),E(O,{children:R(q.name)})]}),K("div",{className:"flex flex-col",children:[E("span",{className:"text-sm font-medium",children:q.name}),E("span",{className:"text-xs text-muted-foreground capitalize",children:q.scope==="team"?J.team_member():J.project_member()})]})]}),K("div",{className:"flex items-center gap-2",children:[K(P,{children:[E(k,{asChild:!0,children:K(W,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:$===q.id,children:[y(N),E(H,{className:"ml-1 h-3 w-3 opacity-50"})]})}),E(G,{children:K(B,{value:N,onValueChange:(Q)=>a(q.id,Q),children:[E(Y,{value:"editor",className:"text-xs",children:J.editor()}),E(Y,{value:"reviewer",className:"text-xs",children:J.reviewer()})]})})]}),E(W,{onClick:async()=>{F(q.id);try{await L(q.id,N),X.success(J.added_member_successfully({name:q.name||""}))}catch(Q){console.error(Q),X.error(J.failed_to_add_member({name:q.name||""}))}finally{F(null)}},disabled:$!==null,size:"sm",className:"h-8 text-xs px-3",children:$===q.id?E(z,{className:"h-3 w-3 animate-spin"}):J.set_role()})]})]},q.id)})})]}),_&&L&&b.length>0&&K("div",{className:"border-t pt-4",children:[E("h4",{className:"text-sm font-medium mb-1",children:J.add_members_from_other_projects()}),E("p",{className:"text-xs text-muted-foreground mb-3 font-normal",children:J.add_members_from_other_projects_hint()}),E("div",{className:"max-h-[200px] overflow-y-auto space-y-2 pr-1",children:b.map((q)=>{let N=j[q.id]||"editor";return K("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-muted/50",children:[K("div",{className:"flex items-center gap-3",children:[K(h,{children:[q.image&&E(C,{src:q.image,alt:q.name,className:"object-cover"}),E(O,{children:R(q.name)})]}),K("div",{className:"flex flex-col",children:[E("span",{className:"text-sm font-medium",children:q.name}),E("span",{className:"text-xs text-muted-foreground capitalize",children:q.scope==="team"?J.team_member():J.project_member()})]})]}),K("div",{className:"flex items-center gap-2",children:[K(P,{children:[E(k,{asChild:!0,children:K(W,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:$===q.id,children:[y(N),E(H,{className:"ml-1 h-3 w-3 opacity-50"})]})}),E(G,{children:K(B,{value:N,onValueChange:(Q)=>a(q.id,Q),children:[E(Y,{value:"editor",className:"text-xs",children:J.editor()}),E(Y,{value:"reviewer",className:"text-xs",children:J.reviewer()})]})})]}),E(W,{onClick:async()=>{F(q.id);try{await L(q.id,N),X.success(J.added_member_successfully({name:q.name||""}))}catch(Q){console.error(Q),X.error(J.failed_to_add_member({name:q.name||""}))}finally{F(null)}},disabled:$!==null,size:"sm",className:"h-8 text-xs px-3",children:$===q.id?E(z,{className:"h-3 w-3 animate-spin"}):J.add_to_project()})]})]},q.id)})})]}),_&&c&&K("div",{className:"border-t pt-4",children:[E("h4",{className:"text-sm font-medium mb-3",children:J.invite_new_member()}),K("div",{className:"space-y-3",children:[K("div",{className:"flex gap-2",children:[K(P,{children:[E(k,{asChild:!0,children:K(W,{variant:"outline",className:"w-[120px] justify-between",children:[T==="editor"?J.editor():J.reviewer(),E(H,{className:"h-4 w-4 opacity-50"})]})}),E(G,{children:K(B,{value:T,onValueChange:(q)=>u(q),children:[E(Y,{value:"editor",children:J.editor()}),E(Y,{value:"reviewer",children:J.reviewer()})]})})]}),K(W,{onClick:Bq,disabled:l,className:"flex-1",children:[l&&E(z,{className:"mr-2 h-4 w-4 animate-spin"}),J.generate_link()]})]}),S&&K("div",{className:"flex gap-2",children:[E(Nq,{value:S,readOnly:!0}),E(W,{variant:"outline",size:"icon",onClick:Lq,children:E(n,{className:"h-4 w-4"})})]})]})]})]})]})})}
|
|
2
|
-
export{uq as W};
|