@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-n3xn2ve1.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as IZ,f as pZ}from"./chunk-0wgqr4jg.js";import{r as hZ}from"./chunk-hks5k0tm.js";import{R as QJ}from"./chunk-kchbbtdm.js";import"./chunk-12ps84z8.js";import{V as eJ}from"./chunk-kcg7d7pk.js";import"./chunk-har4xctf.js";import{X as TZ}from"./chunk-nw03w9pa.js";import{ce as xZ}from"./chunk-8qg6jjz4.js";import{we as jZ}from"./chunk-gwzk0fvn.js";import{Fe as SZ}from"./chunk-nzrrvn6c.js";import{Re as wZ}from"./chunk-byjze6hm.js";import"./chunk-y1pnq12c.js";import"./chunk-7anqxpyv.js";import"./chunk-6ts5az6h.js";import"./chunk-02b97gsf.js";import"./chunk-5nk7y4ec.js";import"./chunk-mm995mvc.js";import"./chunk-8b11b9cj.js";import{Sf as sJ}from"./chunk-wch8ygpt.js";import{Uf as MZ,Vf as DZ,Wf as OZ,Xf as FZ,Yf as RJ}from"./chunk-ntqn09r0.js";import"./chunk-ctx1ms5t.js";import{$f as gZ}from"./chunk-bthrbggg.js";import{ag as bZ}from"./chunk-day0vn14.js";import{Bg as vZ,Cg as LZ,Lg as fZ,Og as BZ}from"./chunk-3ztat2q9.js";import{Rg as WZ}from"./chunk-2s97ngr8.js";import"./chunk-dyen2t1p.js";import"./chunk-sepsqqdf.js";import"./chunk-dwkv3bx5.js";import"./chunk-qh3w5w8e.js";import"./chunk-4pj17byj.js";import"./chunk-ps2hw0ps.js";import{Mh as KJ}from"./chunk-qrnw89xg.js";import"./chunk-5dfy6173.js";import{Qh as FJ,Sh as wJ,Th as TJ,Uh as GJ,Xh as _Z,Yh as $Z,ai as bJ}from"./chunk-qrhf20g2.js";import{ei as WJ,hi as o,ii as kZ,ji as j,ki as tJ,qi as U,ri as dJ,ti as lJ,ui as QZ,vi as zZ,wi as oJ,yi as N}from"./chunk-jsqsrcse.js";import{Ii as P}from"./chunk-8zar6cc4.js";import{$l as X,Ji as vJ,Jj as GZ,Ki as zJ,Li as J,Lj as KZ,Mi as Y,Mj as fJ,Mk as PZ,Qk as DJ,Uj as aJ,Wi as uZ,Yj as EZ,Yk as iJ,Yl as A,aj as AZ,am as t,ck as HZ,dl as yZ,kj as LJ,ll as cJ,ml as OJ,nk as UJ,ql as nJ,tk as BJ,uj as NZ,wk as UZ,yl as VZ,zk as RZ}from"./chunk-48yphy68.js";import{Zm as CJ}from"./chunk-69at8jm8.js";var I=CJ(vJ(),1);var W=CJ(vJ(),1);function eZ({ratio:G}){switch(G){case"16:9":return J("span",{className:"inline-block w-4 h-2.5 border border-current rounded-[1px] shrink-0"});case"9:16":return J("span",{className:"inline-block w-2.5 h-4 border border-current rounded-[1px] shrink-0"});case"4:3":return J("span",{className:"inline-block w-3.5 h-2.5 border border-current rounded-[1px] shrink-0"});case"3:4":return J("span",{className:"inline-block w-2.5 h-3.5 border border-current rounded-[1px] shrink-0"});case"1:1":return J("span",{className:"inline-block w-3 h-3 border border-current rounded-[1px] shrink-0"});default:return J("span",{className:"inline-block w-4 h-2.5 border border-current rounded-[1px] shrink-0"})}}function rJ(){return Math.random().toString(36).substring(2,9)}function XZ(){return{id:rJ(),type:"text",text:"CONFIDENTIAL",x:0.5,y:0.5,size:0.05,color:"#999999",opacity:0.5,rotation:-30}}function J0(){return{id:rJ(),type:"image",imageAssetKey:"",x:0.5,y:0.5,size:0.15,opacity:0.5,rotation:0}}var mJ=[{id:"dark",label:"Dark Slate",bg:"#1e293b",dot:"#475569"},{id:"black",label:"Black",bg:"#000000",dot:"#404040"},{id:"gray",label:"Slate Gray",bg:"#64748b",dot:"#cbd5e1"},{id:"white",label:"White",bg:"#ffffff",dot:"#94a3b8"},{id:"green",label:"Chroma Green",bg:"#059669",dot:"#047857"}],Z0={"16:9":1.7777777777777777,"9:16":0.5625,"4:3":1.3333333333333333,"3:4":0.75,"1:1":1};function qZ({open:G,onOpenChange:F,initialConfig:y,shareId:E,teamId:w,onSaveSuccess:M}){let B=WJ(),[Q,D]=W.useState([]),[z,R]=W.useState(null),[b,p]=W.useState(null),[T,s]=W.useState("16:9"),[HJ,VJ]=W.useState("grid"),[qJ,x]=W.useState(!1),[e,l]=W.useState("new"),[a,m]=W.useState(""),[i,c]=W.useState(null),C=W.useRef(null),n=W.useRef(null),[d,AJ]=W.useState({w:0,h:0}),[v,g]=W.useState(!1),H=W.useCallback((Z)=>{if(n.current=Z,!Z)return;let $=()=>{let{clientWidth:f,clientHeight:O}=Z;if(f<=0||O<=0)return;let h=Z0[T],xJ=f,yJ=xJ/h;if(yJ>O)yJ=O,xJ=yJ*h;AJ({w:Math.round(xJ),h:Math.round(yJ)})};$();let V=new ResizeObserver($);return V.observe(Z),()=>{V.disconnect(),n.current=null}},[T]),u=bJ((Z)=>Z.teamId),_J=w||u,[JJ,NJ]=W.useState(!1),[ZJ,EJ]=W.useState({}),S=W.useRef(null),$J=U.api.teams[":teamId"].files.$post,SJ=async(Z,$)=>{let V=Z.target.files?.[0];if(!V)return;if(V.size>1048576){if(N.error(X.file_exceeds_1mb_limit()),S.current)S.current.value="";return}if(!_J){N.error(X.failed_upload_file());return}NJ(!0);let f=URL.createObjectURL(V);EJ((O)=>({...O,[$]:f}));try{let O=await $J({param:{teamId:_J},form:{file:V}});if(!O.ok)throw Error(X.failed_upload_file());let h=await O.json();L($,{imageAssetKey:h.key,imageAssetUrl:h.url})}catch(O){let h=O instanceof Error?O.message:X.failed_upload_file();N.error(h)}finally{if(NJ(!1),S.current)S.current.value=""}};W.useEffect(()=>{if(G){if(y?.blocks&&y.blocks.length>0)D(y.blocks),R(y.blocks[0].id);else{let Z=XZ();D([Z]),R(Z.id)}p(null)}},[G,y]);let{data:YJ=[]}=o({queryKey:["watermark-templates",w],queryFn:async()=>{let Z=await U.api["watermark-templates"].$get({query:w?{teamId:w}:{}});if(!Z.ok)return[];return await Z.json()},enabled:G}),hJ=U.api.shares[":shareId"].watermark.$put,{mutate:IJ,isPending:pJ}=j({mutationFn:async(Z)=>{let $=await hJ({param:{shareId:E},json:{enabled:!0,config:Z}});if(!$.ok){let V=await $.json().catch(()=>null);throw Error(V?.error||X.failed_update())}return await $.json()},onSuccess:()=>{B.invalidateQueries({queryKey:["share",E]}),B.invalidateQueries({queryKey:["shares"]}),N.success(X.watermark_updated()),F(!1),M?.()},onError:(Z)=>{N.error(Z.message||X.failed_update())}}),PJ=U.api["watermark-templates"].$post,{mutate:kJ,isPending:K}=j({mutationFn:async({name:Z,config:$})=>{let V=await PJ({json:{name:Z,teamId:w||void 0,config:$}});if(!V.ok)throw Error(X.failed_update());return await V.json()},onSuccess:(Z)=>{B.invalidateQueries({queryKey:["watermark-templates"]}),p(Z.id),x(!1),N.success(X.template_saved())},onError:()=>{N.error(X.failed_update())}}),q=U.api["watermark-templates"][":templateId"].$put,{mutate:k,isPending:iZ}=j({mutationFn:async({templateId:Z,config:$})=>{let V=await q({param:{templateId:Z},json:{config:$}});if(!V.ok)throw Error(X.failed_update());return await V.json()},onSuccess:()=>{B.invalidateQueries({queryKey:["watermark-templates"]}),x(!1),N.success(X.template_updated())},onError:()=>{N.error(X.failed_update())}}),cZ=U.api["watermark-templates"][":templateId"].$delete,{mutate:nZ}=j({mutationFn:async(Z)=>{if(!(await cZ({param:{templateId:Z}})).ok)throw Error(X.failed_to_delete())},onSuccess:(Z,$)=>{if(B.invalidateQueries({queryKey:["watermark-templates"]}),b===$)p(null);N.success(X.template_deleted())},onError:()=>{N.error(X.failed_to_delete())}}),XJ=Q.findIndex((Z)=>Z.id===z),_=XJ>=0?Q[XJ]:null,ZZ=()=>{let Z=XZ();D(($)=>[...$,Z]),R(Z.id)},dZ=()=>{let Z=J0();D(($)=>[...$,Z]),R(Z.id)},YZ=(Z)=>{if(!Z)return;D(($)=>{let V=$.filter((f)=>f.id!==Z);if(z===Z)R(V.length>0?V[Math.max(0,XJ-1)].id:null);return V})},L=(Z,$)=>{D((V)=>V.map((f)=>f.id===Z?{...f,...$}:f))},lZ=()=>{if(Q.length===0)return;let Z=(XJ-1+Q.length)%Q.length;R(Q[Z].id)},oZ=()=>{if(Q.length===0)return;let Z=(XJ+1)%Q.length;R(Q[Z].id)},rZ=(Z,$)=>{Z.stopPropagation(),R($),g(!0)},uJ=W.useCallback((Z)=>{if(!v||!z||!C.current)return;let $=C.current.getBoundingClientRect(),V=(Z.clientX-$.left)/$.width,f=(Z.clientY-$.top)/$.height,O=Math.max(0,Math.min(1,Math.round(V*100)/100)),h=Math.max(0,Math.min(1,Math.round(f*100)/100));L(z,{x:O,y:h})},[v,z]),jJ=W.useCallback(()=>{g(!1)},[]);W.useEffect(()=>{if(v)window.addEventListener("mousemove",uJ),window.addEventListener("mouseup",jJ);return()=>{window.removeEventListener("mousemove",uJ),window.removeEventListener("mouseup",jJ)}},[v,uJ,jJ]),W.useEffect(()=>{let Z=($)=>{if(!G||!z)return;let V=$.target?.tagName?.toLowerCase();if(V==="input"||V==="textarea"||V==="select")return;if($.key==="Delete"||$.key==="Backspace")$.preventDefault(),YZ(z)};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[G,z,XJ]);let aZ=(Z)=>{if(Z.config?.blocks&&Z.config.blocks.length>0){let $=Z.config.blocks.map((V)=>({...V,id:rJ()}));D($),R($[0].id),p(Z.id)}},tZ=()=>{if(Q.length===0){N.error(X.no_watermark_blocks());return}IJ({blocks:Q})},sZ=()=>{if(e==="new"){if(!a.trim()){N.error(X.enter_template_name());return}kJ({name:a.trim(),config:{blocks:Q}})}else{let Z=i||b;if(!Z){N.error(X.select_template_to_overwrite());return}k({templateId:Z,config:{blocks:Q}})}};return Y(zJ,{children:[J(dJ,{open:G,onOpenChange:F,children:Y(lJ,{showCloseButton:!1,className:"sm:max-w-[1400px] max-w-[95vw] w-[95vw] h-[88vh] flex flex-col p-0 gap-0 overflow-hidden",onPointerDownOutside:(Z)=>Z.preventDefault(),children:[Y("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border bg-card",children:[J("div",{className:"flex items-center gap-3",children:J(oJ,{className:"text-base font-semibold",children:X.watermark_editor()})}),Y("div",{className:"flex items-center gap-2",children:[Y(FJ,{modal:!1,children:[J(wJ,{asChild:!0,children:Y(A,{variant:"outline",size:"sm",className:"gap-2 text-xs",children:[J(HZ,{className:"h-4 w-4 text-muted-foreground"}),X.watermark_templates()]})}),Y(TJ,{align:"end",className:"w-56",children:[J(_Z,{className:"text-xs font-semibold text-muted-foreground",children:X.load_template()}),YJ.length===0?J("div",{className:"px-2 py-1.5 text-xs text-muted-foreground italic",children:X.no_templates_found()}):YJ.map((Z)=>Y(GJ,{onClick:()=>aZ(Z),className:"flex items-center justify-between text-xs cursor-pointer",children:[J("span",{className:"truncate flex-1",children:Z.name}),b===Z.id&&J(GZ,{className:"h-3.5 w-3.5 text-primary ml-2 flex-shrink-0"}),J(A,{variant:"ghost",size:"icon",className:"h-5 w-5 hover:bg-destructive/10 hover:text-destructive ml-1",onClick:($)=>{$.stopPropagation(),nZ(Z.id)},children:J(cJ,{className:"h-3 w-3"})})]},Z.id)),J($Z,{}),Y(GJ,{onClick:()=>{l("new"),m(""),x(!0)},className:"text-xs gap-2 cursor-pointer",children:[J(DJ,{className:"h-3.5 w-3.5 text-primary"}),X.create_new_template()]}),YJ.length>0&&Y(GJ,{onClick:()=>{l("overwrite"),c(b||YJ[0].id),x(!0)},className:"text-xs gap-2 cursor-pointer",children:[J(iJ,{className:"h-3.5 w-3.5 text-muted-foreground"}),X.overwrite_existing_template()]})]})]}),J(A,{variant:"outline",size:"sm",className:"text-xs",onClick:()=>F(!1),children:X.cancel()}),Y(A,{size:"sm",className:"text-xs bg-primary hover:bg-primary/90 text-primary-foreground gap-1.5",disabled:pJ,onClick:tZ,children:[J(iJ,{className:"h-3.5 w-3.5"}),X.save_watermark()]})]})]}),Y("div",{className:"flex-1 flex overflow-hidden",children:[Y("div",{className:"w-[65%] flex flex-col p-4 bg-muted/20 border-r border-border overflow-hidden select-none",children:[Y("div",{className:"flex items-center justify-between mb-3",children:[J("div",{className:"flex items-center gap-1 bg-muted/60 p-1 rounded-md border border-border/60",children:["16:9","9:16","4:3","3:4","1:1"].map((Z)=>Y(A,{variant:T===Z?"secondary":"ghost",size:"sm",className:MJ("h-7 px-2.5 text-xs gap-1.5 font-mono transition-all",T===Z?"bg-background shadow-xs font-semibold text-foreground border border-border/50":"text-muted-foreground hover:text-foreground"),onClick:()=>s(Z),children:[J(eZ,{ratio:Z}),J("span",{children:Z})]},Z))}),J("div",{className:"flex items-center gap-1.5 bg-background border border-border/60 rounded-md p-1",children:mJ.map((Z)=>J("button",{type:"button",onClick:()=>VJ(Z.id),style:{backgroundColor:Z.bg},className:MJ("w-5 h-5 rounded-full border border-border/80 transition-all cursor-pointer relative",HJ===Z.id?"ring-2 ring-primary ring-offset-1 scale-110":"hover:scale-105 opacity-80 hover:opacity-100"),title:Z.label},Z.id))})]}),J("div",{ref:H,className:"flex-1 flex items-center justify-center overflow-hidden",children:(()=>{let Z=mJ.find((V)=>V.id===HJ)||mJ[0],$=d.w>0&&d.h>0;return J("div",{ref:C,onClick:()=>R(null),style:{backgroundColor:Z.bg,backgroundImage:`radial-gradient(${Z.dot} 1px, transparent 1px)`,backgroundSize:"16px 16px",...$?{width:d.w,height:d.h}:{}},className:MJ("relative rounded-lg border border-border overflow-hidden shadow-inner transition-all",T==="16:9"&&"aspect-[16/9] w-full max-h-full",T==="9:16"&&"aspect-[9/16] h-full max-w-full",T==="4:3"&&"aspect-[4/3] w-full max-h-full",T==="3:4"&&"aspect-[3/4] h-full max-w-full",T==="1:1"&&"aspect-square h-full max-w-full"),children:Q.map((V)=>{let f=V.id===z,O=V.size*(d.w||640);return J("div",{onMouseDown:(h)=>rZ(h,V.id),onClick:(h)=>{h.stopPropagation(),R(V.id)},style:{left:`${V.x*100}%`,top:`${V.y*100}%`,transform:`translate(-50%, -50%) rotate(${V.rotation}deg)`,opacity:V.opacity},className:MJ("absolute cursor-move select-none transition-shadow rounded p-1.5 flex items-center justify-center",f?"ring-2 ring-primary ring-offset-2 ring-offset-background/80 bg-primary/10":"hover:ring-1 hover:ring-muted-foreground/50"),children:V.type==="text"?J("span",{style:{fontSize:`${O}px`,color:V.color,lineHeight:1,whiteSpace:"nowrap",fontWeight:700,textShadow:"0 1px 3px rgba(0,0,0,0.5)"},children:V.text||"Text"}):J("div",{style:{width:`${O}px`,height:`${O}px`},className:"bg-primary/20 border border-primary/40 rounded flex items-center justify-center p-1 overflow-hidden",children:ZJ[V.id]||V.imageAssetUrl?J("img",{src:ZJ[V.id]||V.imageAssetUrl,alt:"Watermark logo",className:"w-full h-full object-contain pointer-events-none"}):J(UJ,{className:"h-1/2 w-1/2 opacity-70 text-primary"})})},V.id)})})})()})]}),Y("div",{className:"w-[35%] flex flex-col bg-card overflow-hidden border-l border-border",children:[J("div",{className:"p-4 border-b border-border bg-muted/10 flex items-center justify-between",children:Y("div",{className:"flex items-center gap-2",children:[J(BJ,{className:"h-4 w-4 text-muted-foreground"}),J("span",{className:"text-xs font-semibold",children:X.watermark()})]})}),Y("div",{className:"p-3 border-b border-border bg-background flex items-center justify-between gap-2",children:[Y("div",{className:"flex items-center gap-1",children:[J(A,{variant:"outline",size:"icon",className:"h-7 w-7",disabled:Q.length<=1,onClick:lZ,children:J(KZ,{className:"h-4 w-4"})}),Y(FJ,{modal:!1,children:[J(wJ,{asChild:!0,children:J(A,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs font-mono",children:Q.length===0?"0 / 0":`${XJ+1} / ${Q.length}`})}),J(TJ,{align:"start",className:"w-48",children:Q.map((Z,$)=>Y(GJ,{onClick:()=>R(Z.id),className:"text-xs flex items-center justify-between cursor-pointer",children:[Y("span",{className:"flex items-center gap-2 truncate",children:[Z.type==="text"?J(OJ,{className:"h-3.5 w-3.5 text-muted-foreground"}):J(UJ,{className:"h-3.5 w-3.5 text-muted-foreground"}),Z.type==="text"?Z.text||"Text":Z.imageAssetKey||"Image"]}),Y("span",{className:"text-[10px] font-mono text-muted-foreground ml-2",children:["#",$+1]})]},Z.id))})]}),J(A,{variant:"outline",size:"icon",className:"h-7 w-7",disabled:Q.length<=1,onClick:oZ,children:J(fJ,{className:"h-4 w-4"})})]}),Y("div",{className:"flex items-center gap-1",children:[_&&J(A,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:bg-destructive/10",title:X.delete(),onClick:()=>YZ(_.id),children:J(cJ,{className:"h-4 w-4"})}),Y(FJ,{modal:!1,children:[J(wJ,{asChild:!0,children:Y(A,{size:"sm",className:"h-7 text-xs gap-1",children:[J(DJ,{className:"h-3.5 w-3.5"}),X.add()]})}),Y(TJ,{align:"end",children:[Y(GJ,{onClick:ZZ,className:"text-xs gap-2 cursor-pointer",children:[J(OJ,{className:"h-3.5 w-3.5"}),X.add_text_block()]}),Y(GJ,{onClick:dZ,className:"text-xs gap-2 cursor-pointer",children:[J(UJ,{className:"h-3.5 w-3.5"}),X.add_image_block()]})]})]})]})]}),J(WZ,{className:"flex-1 min-h-0 p-4",children:_?Y("div",{className:"space-y-5 text-xs",children:[Y("div",{className:"flex items-center justify-between pb-2 border-b border-border",children:[Y("span",{className:"font-semibold text-muted-foreground flex items-center gap-1.5",children:[_.type==="text"?J(OJ,{className:"h-4 w-4 text-primary"}):J(UJ,{className:"h-4 w-4 text-primary"}),_.type==="text"?X.add_text_block():X.add_image_block()]}),Y("span",{className:"text-[10px] font-mono text-muted-foreground",children:["ID: ",_.id.slice(0,6)]})]}),_.type==="text"&&Y("div",{className:"space-y-2",children:[J(P,{className:"text-xs",children:X.text_content()}),J(t,{type:"text",value:_.text,onChange:(Z)=>L(_.id,{text:Z.target.value}),className:"text-xs h-8"})]}),_.type==="image"&&Y("div",{className:"space-y-2",children:[Y("div",{className:"flex items-center justify-between",children:[J(P,{className:"text-xs",children:X.image_asset_key()}),_.imageAssetKey&&Y("button",{type:"button",onClick:()=>L(_.id,{imageAssetKey:"",imageAssetUrl:void 0}),className:"text-xs text-muted-foreground hover:text-destructive flex items-center gap-1 font-medium transition-colors cursor-pointer",children:[J(VZ,{className:"w-3.5 h-3.5"}),X.remove?X.remove():"Remove"]})]}),J("input",{type:"file",ref:S,className:"hidden",accept:"image/*",onChange:(Z)=>SJ(Z,_.id)}),Y("div",{onClick:()=>S.current?.click(),className:"relative aspect-square w-full rounded-xl border border-dashed border-border flex items-center justify-center cursor-pointer overflow-hidden group shadow-inner bg-muted/20 hover:border-primary/50 hover:bg-muted/40 transition-all p-2",children:[JJ&&J("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:Y("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[J(LJ,{className:"w-4 h-4 animate-spin text-primary"}),J("span",{className:"text-xs font-semibold",children:X.uploading()})]})}),ZJ[_.id]||_.imageAssetUrl?Y(zJ,{children:[J("img",{src:ZJ[_.id]||_.imageAssetUrl,alt:"Uploaded logo preview",className:"max-w-full max-h-full object-contain transition-transform duration-300 group-hover:scale-105"}),Y("div",{className:"absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-center gap-1 text-white z-10",children:[J(nJ,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),J("span",{className:"text-xs font-semibold",children:X.upload_image()})]})]}):Y("div",{className:"flex flex-col items-center gap-1.5 text-center p-3",children:[J("div",{className:"p-2 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:J(nJ,{className:"w-4 h-4 text-muted-foreground"})}),Y("div",{children:[J("p",{className:"text-xs font-medium text-foreground",children:X.upload_watermark_image()}),J("p",{className:"text-[10px] text-muted-foreground mt-0.5 max-w-[150px] mx-auto leading-normal",children:X.upload_watermark_image_hint()})]})]})]})]}),Y("div",{className:"space-y-2",children:[Y("div",{className:"flex items-center justify-between",children:[J(P,{className:"text-xs",children:_.type==="text"?X.font_size():X.image_size()}),Y("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(_.size*100),"%"]})]}),Y("div",{className:"flex items-center gap-3",children:[J(QJ,{min:_.type==="text"?0.01:0.02,max:_.type==="text"?0.12:0.5,step:0.005,value:[_.size],onValueChange:([Z])=>L(_.id,{size:Z}),className:"flex-1"}),J(t,{type:"number",min:1,max:100,value:Math.round(_.size*100),onChange:(Z)=>L(_.id,{size:Math.min(1,Math.max(0.001,Number(Z.target.value)/100))}),className:"w-16 h-7 text-xs font-mono text-right"})]})]}),_.type==="text"&&Y("div",{className:"space-y-2",children:[Y("div",{className:"flex items-center justify-between",children:[J(P,{className:"text-xs",children:X.color()}),J("span",{className:"font-mono text-[11px] text-muted-foreground uppercase",children:_.color})]}),Y("div",{className:"flex items-center gap-2",children:[J("input",{type:"color",value:_.color,onChange:(Z)=>L(_.id,{color:Z.target.value}),className:"w-8 h-8 rounded border border-border cursor-pointer bg-transparent p-0"}),J(t,{type:"text",value:_.color,onChange:(Z)=>L(_.id,{color:Z.target.value}),className:"flex-1 h-8 text-xs font-mono"})]}),J("div",{className:"flex items-center gap-1.5 pt-1",children:["#FFFFFF","#000000","#999999","#EF4444","#3B82F6","#10B981","#F59E0B"].map((Z)=>J("button",{type:"button",onClick:()=>L(_.id,{color:Z}),style:{backgroundColor:Z},className:"w-5 h-5 rounded-full border border-border hover:scale-110 transition-transform"},Z))})]}),Y("div",{className:"space-y-2",children:[Y("div",{className:"flex items-center justify-between",children:[J(P,{className:"text-xs",children:X.opacity()}),Y("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(_.opacity*100),"%"]})]}),J(QJ,{min:0,max:1,step:0.01,value:[_.opacity],onValueChange:([Z])=>L(_.id,{opacity:Z})})]}),Y("div",{className:"space-y-2",children:[Y("div",{className:"flex items-center justify-between",children:[J(P,{className:"text-xs",children:X.rotation()}),Y("span",{className:"font-mono text-[11px] text-muted-foreground",children:[_.rotation,"°"]})]}),J(QJ,{min:-180,max:180,step:1,value:[_.rotation],onValueChange:([Z])=>L(_.id,{rotation:Z})}),J("div",{className:"flex items-center gap-1.5 pt-1",children:[-45,-30,0,30,45].map((Z)=>Y(A,{variant:"outline",size:"sm",className:"h-6 text-[10px] flex-1 px-1 font-mono",onClick:()=>L(_.id,{rotation:Z}),children:[Z,"°"]},Z))})]}),Y("div",{className:"space-y-2",children:[Y("div",{className:"flex items-center justify-between",children:[J(P,{className:"text-xs",children:X.position_x()}),Y("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(_.x*100),"%"]})]}),J(QJ,{min:0,max:1,step:0.01,value:[_.x],onValueChange:([Z])=>L(_.id,{x:Z})})]}),Y("div",{className:"space-y-2",children:[Y("div",{className:"flex items-center justify-between",children:[J(P,{className:"text-xs",children:X.position_y()}),Y("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(_.y*100),"%"]})]}),J(QJ,{min:0,max:1,step:0.01,value:[_.y],onValueChange:([Z])=>L(_.id,{y:Z})})]})]}):Y("div",{className:"py-12 text-center text-xs text-muted-foreground space-y-3",children:[J("p",{children:X.select_block_to_edit()}),Y(A,{size:"sm",variant:"outline",onClick:ZZ,children:[J(DJ,{className:"h-3.5 w-3.5 mr-1"}),X.add_text_block()]})]})})]})]})]})}),J(dJ,{open:qJ,onOpenChange:x,children:Y(lJ,{className:"max-w-md",children:[J(QZ,{children:J(oJ,{className:"text-sm font-semibold",children:e==="new"?X.create_new_template():X.overwrite_existing_template()})}),J("div",{className:"py-3 space-y-4 text-xs",children:e==="new"?Y("div",{className:"space-y-2",children:[J(P,{children:X.template_name()}),J(t,{type:"text",value:a,onChange:(Z)=>m(Z.target.value),placeholder:X.enter_template_name(),className:"text-xs"})]}):Y("div",{className:"space-y-2",children:[J(P,{children:X.select_template_to_overwrite()}),J("select",{value:i||"",onChange:(Z)=>c(Z.target.value),className:"w-full h-9 rounded-md border border-input bg-background px-3 text-xs",children:YJ.map((Z)=>J("option",{value:Z.id,children:Z.name},Z.id))})]})}),Y(zZ,{children:[J(A,{variant:"outline",size:"sm",className:"text-xs",onClick:()=>x(!1),children:X.cancel()}),J(A,{size:"sm",className:"text-xs",disabled:K||iZ,onClick:sZ,children:X.confirm()})]})]})})]})}function MJ(...G){return G.filter(Boolean).join(" ")}var r=CJ(vJ(),1);function CZ({shareLink:G,viewMode:F,onViewModeChange:y,defaultSortOrder:E,onSortOrderChange:w}){let M=WJ(),[B,Q]=r.useState(G.password||""),[D,z]=r.useState(G.expireAt?new Date(G.expireAt):void 0),[R,b]=r.useState(!1);r.default.useEffect(()=>{Q(G.password||"")},[G.password]);let[p,T]=r.useState(G.hasPassword),[s,HJ]=r.useState(!!G.expireAt),{data:VJ,refetch:qJ}=o({queryKey:["share-watermark",G.id],queryFn:async()=>{let H=await U.api.shares[":shareId"].watermark.$get({param:{shareId:G.id}});if(!H.ok)return null;return await H.json()},refetchInterval:(H)=>{return(H.state.data?.watermarkStatus||G.watermarkStatus)==="processing"?3000:!1}}),x=U.api.shares[":shareId"].watermark.$put,{mutate:e}=j({mutationFn:async()=>{let H=await x({param:{shareId:G.id},json:{enabled:!1}});if(!H.ok)throw Error(X.failed_update());return await H.json()},onSuccess:()=>{M.invalidateQueries({queryKey:["shares",G.projectId]}),M.invalidateQueries({queryKey:["share",G.id]}),M.invalidateQueries({queryKey:["share-watermark",G.id]}),N.success(X.watermark_disabled_msg())}}),l=VJ?.watermarkStatus??G.watermarkStatus??(G.watermarkConfigId?"ready":"disabled"),a=VJ?.watermarkConfig?.config??G.watermarkConfig?.config??null,m=a!==null&&l!=="disabled",{data:i}=o({queryKey:["fields",G.projectId],queryFn:async()=>{let H=await U.api.projects[":projectId"].fields.$get({param:{projectId:G.projectId}});if(!H.ok)throw Error(X.failed_fetch_fields());return await H.json()},enabled:!!G.projectId}),c=U.api.shares[":shareId"].$put,{mutate:C}=j({mutationFn:async(H)=>{let u=await c({param:{shareId:G.id},json:H});if(!u.ok)throw Error(X.failed_update());return await u.json()},onSuccess:()=>{M.invalidateQueries({queryKey:["shares",G.projectId]}),M.invalidateQueries({queryKey:["share",G.id]}),N.success(X.settings_updated())}}),n=`${window.location.origin}/share/${G.id}`,d=async(H)=>{if(await TZ(H))N.success(X.copied_to_clipboard())},AJ=(H)=>{let u=G.fieldVisibility||{},_J={...u,[H]:!u[H]};C({fieldVisibility:_J})},v="index",g="asc";if(E){let H=E.split(":");v=H[0],g=H[1]||"asc"}return Y("div",{className:"flex flex-col h-full bg-background border-l border-border",children:[J("div",{className:"flex-1 overflow-y-auto",children:Y("div",{className:"p-4 space-y-6",children:[Y("div",{className:"space-y-4",children:[Y("div",{className:"flex items-center justify-between",children:[J("h3",{className:"text-sm font-medium",children:X.link_visibility()}),J(KJ,{checked:!G.isDisabled,onCheckedChange:(H)=>C({isDisabled:!H})})]}),Y("div",{className:"relative w-full",children:[J(t,{value:n,readOnly:!0,className:"pr-10 bg-muted/50 text-xs"}),J(A,{variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full",onClick:()=>d(n),children:J(aJ,{className:"h-4 w-4"})})]})]}),Y("div",{className:"space-y-1",children:[J(gJ,{title:X.security(),icon:J(yZ,{className:"h-4 w-4"}),children:Y("div",{className:"p-3 space-y-4 pt-2",children:[Y("div",{className:"space-y-2",children:[Y("div",{className:"flex items-center justify-between",children:[J(P,{className:"text-xs",children:X.password()}),J(KJ,{checked:p,onCheckedChange:(H)=>{if(T(H),!H)C({password:null})}})]}),p&&Y("div",{className:"flex gap-2 animate-in fade-in slide-in-from-top-1 duration-200",children:[J(t,{type:"text",value:B,onChange:(H)=>Q(H.target.value),placeholder:X.enter_password(),className:"text-xs"}),J(A,{size:"sm",onClick:()=>C({password:B}),children:X.save()})]})]}),Y("div",{className:"space-y-2",children:[Y("div",{className:"flex items-center justify-between",children:[J(P,{className:"text-xs",children:X.expiration_date()}),J(KJ,{checked:s,onCheckedChange:(H)=>{if(HJ(H),!H)z(void 0),C({expireAt:null})}})]}),s&&J("div",{className:"animate-in fade-in slide-in-from-top-1 duration-200",children:J(wZ,{value:D,onChange:(H)=>{z(H),C({expireAt:H?H.toISOString():null})},className:"text-xs"})})]}),Y("div",{className:"space-y-2",children:[Y("div",{className:"flex items-center justify-between",children:[J(P,{className:"text-xs",children:X.allow_download()}),J(KJ,{checked:G.allowDownload,onCheckedChange:(H)=>C({allowDownload:H})})]}),J("p",{className:"text-xs text-muted-foreground",children:X.allow_download_description()})]}),Y("div",{className:"space-y-2 pt-2 border-t border-border/50",children:[Y("div",{className:"flex items-center justify-between",children:[J(P,{className:"text-xs",children:X.watermark()}),J(KJ,{checked:m,disabled:l==="processing",onCheckedChange:(H)=>{if(!H)e();else b(!0)}})]}),m&&l==="processing"&&Y("div",{className:"flex items-center gap-2 text-xs text-amber-600 dark:text-amber-400 font-medium py-1 animate-pulse",children:[J(LJ,{className:"h-3.5 w-3.5 animate-spin"}),J("span",{children:X.watermark_transcoding_processing()})]}),m&&l!=="processing"&&J(A,{variant:"outline",size:"sm",className:"w-full text-xs gap-1.5 mt-1",onClick:()=>b(!0),children:X.edit_watermark()})]})]})}),J(gJ,{title:X.appearance(),icon:J(PZ,{className:"h-4 w-4"}),children:Y("div",{className:"p-3 space-y-3 pt-2 flex gap-2",children:[Y(A,{variant:F==="card"?"secondary":"outline",size:"sm",className:"flex-1 gap-2 text-xs",onClick:()=>y("card"),children:[J(BJ,{className:"h-4 w-4"}),X.grid()]}),Y(A,{variant:F==="list"?"secondary":"outline",size:"sm",className:"flex-1 gap-2 text-xs",onClick:()=>y("list"),children:[J(RZ,{className:"h-4 w-4"}),X.list()]})]})}),J(gJ,{title:X.fields(),icon:J(UZ,{className:"h-4 w-4"}),children:J("div",{className:"p-3 space-y-3 pt-2",children:i?.map((H)=>Y("div",{className:"flex items-center justify-between",children:[J(P,{className:"text-xs",children:H.config?.name}),J(KJ,{checked:G.fieldVisibility?.[H.id]??!1,onCheckedChange:()=>AJ(H.id)})]},H.id))})}),J(gJ,{title:X.sort_by(),icon:J(AZ,{className:"h-4 w-4"}),children:Y("div",{className:"p-3 space-y-4 pt-2",children:[Y("div",{className:"space-y-2",children:[J(P,{className:"text-xs text-muted-foreground",children:X.field()}),Y(MZ,{value:v,onValueChange:(H)=>{if(H==="index")w(null);else w(`${H}:${g}`)},children:[J(OZ,{className:"w-full text-xs h-9",children:J(DZ,{})}),Y(FZ,{children:[J(RJ,{value:"index",children:X.sort_custom()}),J(RJ,{value:"name",children:X.sort_name()}),J(RJ,{value:"createdAt",children:X.sort_date_created()}),J(RJ,{value:"size",children:X.sort_size()})]})]})]}),Y("div",{className:"space-y-2",children:[J(P,{className:"text-xs text-muted-foreground",children:X.order()}),Y(A,{variant:"outline",className:"w-full justify-between font-normal text-xs h-9",disabled:v==="index",onClick:()=>{w(`${v}:${g==="asc"?"desc":"asc"}`)},children:[J("span",{children:v==="name"?g==="asc"?X.sort_a_to_z():X.sort_z_to_a():v==="createdAt"?g==="asc"?X.sort_oldest_to_newest():X.sort_newest_to_oldest():v==="size"?g==="asc"?X.sort_smallest_to_largest():X.sort_largest_to_smallest():g==="asc"?X.ascending():X.descending()}),J(NZ,{className:"h-4 w-4 opacity-50"})]})]})]})})]})]})}),Y("div",{className:"p-4 border-t border-border space-y-2",children:[Y(A,{variant:"outline",className:"w-full justify-center",onClick:()=>window.open(n,"_blank"),children:[J(EZ,{className:"h-4 w-4 mr-2"}),X.open_share_link()]}),Y(A,{className:"w-full justify-center bg-blue-600 hover:bg-blue-700 text-white",onClick:()=>d(n),children:[J(aJ,{className:"h-4 w-4 mr-2"}),X.copy_link()]})]}),J(qZ,{open:R,onOpenChange:b,initialConfig:a,shareId:G.id,onSaveSuccess:()=>{qJ(),M.invalidateQueries({queryKey:["share",G.id]}),M.invalidateQueries({queryKey:["shares",G.projectId]})}})]})}function gJ({title:G,icon:F,children:y}){let[E,w]=r.useState(!1);return Y("div",{className:"border-b border-border last:border-0",children:[Y("button",{onClick:()=>w(!E),className:"w-full flex items-center justify-between py-3 px-2 hover:bg-muted/50 transition-colors",children:[Y("div",{className:"flex items-center gap-3",children:[F,J("span",{className:"text-sm font-medium",children:G})]}),J(fJ,{className:Y0("h-4 w-4 transition-transform",E&&"rotate-90")})]}),E&&y&&J("div",{className:"animate-in fade-in slide-in-from-top-1 duration-200",children:y})]})}function Y0(...G){return G.filter(Boolean).join(" ")}function JZ({teamId:G,projectId:F,projectName:y,shareId:E,rootFolderId:w}){let M=WJ(),{fetchMetadata:B}=SZ();I.useEffect(()=>{if(G)B(G)},[G,B]);let{data:Q}=o({queryKey:["share",E],queryFn:async()=>{let K=await U.api.shares[":shareId"].$get({param:{shareId:E}});if(!K.ok)throw Error(X.failed_fetch_share_link());return await K.json()}}),D=Q?.rootFolderId,[z,R]=I.useState(null),[b,p]=I.useState([]);I.useEffect(()=>{if(D)R(D),p([]),S(new Set)},[D,E]);let T=sJ((K)=>K.setProjectState),s=sJ((K)=>K.clearProjectState),HJ=(K)=>{if(K===z)return;if(K===D)R(D),p([]);else{let q=b.findIndex((k)=>k.id===K);if(q!==-1)R(K),p(b.slice(q+1))}S(new Set)},[VJ,qJ]=I.useState(240),[x,e]=I.useState(360),{shareConfigLeftSidebarCollapsed:l,shareConfigRightSidebarCollapsed:a}=gZ(),m=Q?.defaultSortOrder||null,i,c;if(m){let K=m.split(":");i=K[0],c=K[1]}let C=Q?.viewMode??"card",{data:n,fetchNextPage:d,hasNextPage:AJ,isFetchingNextPage:v}=tJ({queryKey:["folder-children",G,z,"folder",i,c],queryFn:async({pageParam:K})=>{let q=await U.api.folders[":folderId"].children.$get({param:{folderId:z},query:{assetType:"folder",after:K,sort:i,order:c}});if(!q.ok)throw Error(X.failed_fetch_folders());return await q.json()},enabled:!!z,initialPageParam:"",getNextPageParam:(K)=>K.pageInfo?.cursor||void 0}),{data:g,fetchNextPage:H,hasNextPage:u,isFetchingNextPage:_J}=tJ({queryKey:["folder-children",G,z,"file",i,c],queryFn:async({pageParam:K})=>{let q=await U.api.folders[":folderId"].children.$get({param:{folderId:z},query:{assetType:"file",after:K,sort:i,order:c}});if(!q.ok)throw Error(X.failed_fetch_files());return await q.json()},enabled:!!z,initialPageParam:"",getNextPageParam:(K)=>K.pageInfo?.cursor||void 0}),JJ=I.useMemo(()=>n?.pages.flatMap((K)=>K.data??[])??[],[n]),NJ=I.useMemo(()=>g?.pages.flatMap((K)=>K.data??[])??[],[g]);I.useEffect(()=>{if(Q)T({teamId:G,projectId:F,projectName:y,ancestorFolders:b,currentAsset:{name:z===D?Q.name:JJ.find((K)=>K.id===z)?.name||Q.name,type:"folder"},isRootFolder:!1,shareId:E,onFolderClick:HJ});return()=>s()},[G,F,y,b,z,D,Q,E,JJ,T,s]);let ZJ=()=>{S(new Set)},[EJ,S]=I.useState(new Set),{dragState:$J,handleDragStart:SJ,handleDragEnd:YJ}=pZ({teamId:G,projectId:F,assetId:z||"",folders:JJ,files:NJ,selectedIds:EJ,onClearSelection:ZJ}),hJ=U.api.shares[":shareId"].assets[":assetId"].$delete,{mutate:IJ}=j({mutationFn:async(K)=>{if(!(await hJ({param:{shareId:E,assetId:K}})).ok)throw Error(X.failed_remove())},onSuccess:()=>{M.invalidateQueries({queryKey:["folder-children",G,z]}),N.success(X.removed_from_share())}}),pJ=U.api.shares[":shareId"].$put,{mutate:PJ}=j({mutationFn:async(K)=>{let q=await pJ({param:{shareId:E},json:K});if(!q.ok)throw Error(X.failed_update());return await q.json()},onSuccess:()=>{M.invalidateQueries({queryKey:["share",E]}),N.success(X.settings_updated())}}),kJ=(K)=>{if(K.type==="folder"||K.targetType==="folder"){let q=z===D?Q?.name||"":JJ.find((k)=>k.id===z)?.name||X.unknown();p((k)=>[{id:z,name:q},...k]),R(K.id),S(new Set)}};if(!Q)return J("div",{children:X.loading()});return Y(fZ,{modifiers:[IZ.configure({anchor:{x:0,y:0}})],sensors:[LZ.configure({activationConstraints:[new vZ.Distance({value:10})]})],onDragStart:SJ,onDragEnd:YJ,children:[J("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:Y("div",{className:"flex flex-1 overflow-hidden relative",children:[!l&&Y(zJ,{children:[J("div",{className:"bg-background",style:{width:VJ},children:J(bZ,{teamId:G,projectId:F,projectName:y,rootFolderId:w,dragState:$J})}),J(eJ,{onResize:(K)=>qJ((q)=>Math.max(180,Math.min(400,q+K)))})]}),J(hZ,{teamId:G,projectId:F,assetId:z||"",folders:JJ,files:NJ,selectedItem:null,selectedIds:EJ,onItemSelect:(K,q)=>{if(q.metaKey||q.ctrlKey){let k=new Set(EJ);if(k.has(K.id))k.delete(K.id);else k.add(K.id);S(k)}else S(new Set([K.id]))},onItemDoubleClick:kJ,onSaveField:()=>{},displayStyle:C,onClearSelection:ZJ,fetchNextFoldersPage:d,hasNextFoldersPage:AJ,isFetchingNextFoldersPage:v,fetchNextFilesPage:H,hasNextFilesPage:u,isFetchingNextFilesPage:_J,filterConditions:[],onFilterChange:()=>{},dragState:$J,isShareView:!0,onRemoveFromShare:(K)=>{K.forEach((q)=>IJ(q.id))},fieldVisibility:Q.fieldVisibility}),!a&&Y(zJ,{children:[J(eJ,{onResize:(K)=>e((q)=>Math.max(240,Math.min(600,q-K)))}),J("div",{style:{width:x},className:"flex-shrink-0 h-full",children:J(CZ,{shareLink:Q,viewMode:C,onViewModeChange:(K)=>PJ({viewMode:K}),defaultSortOrder:m,onSortOrderChange:(K)=>PJ({defaultSortOrder:K})})})]})]})}),J(BZ,{children:$J?.isActive?J("div",{className:"flex items-center gap-2 rounded-md bg-popover px-3 py-2 text-sm font-medium shadow-md",children:X.moving_items({count:$J.itemCount})}):null})]})}var mZ=CJ(vJ(),1);function X0(){let{projectId:G,shareId:F}=G0.useParams(),{teamId:y,ensureTeamIdForProject:E}=bJ();mZ.useEffect(()=>{E(G)},[G,E]);let{data:w}=kZ(xZ(G)),M=w?.rootFolder,{data:B}=o({queryKey:["folders",M],queryFn:async()=>{let Q=await U.api.folders[":folderId"].$get({param:{folderId:M}});if(!Q.ok)throw Error("Failed to fetch folder");return await Q.json()},enabled:!!M});if(!y||!M||!B)return J(jZ,{});return J(JZ,{teamId:y,projectId:G,projectName:w.name??"",shareId:F,rootFolderId:M})}var G0=uZ("/projects/$projectId/shares/$shareId")({component:X0});export{G0 as Route};
|
package/bin/chunk-q3fdffq5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as a}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 e,Wi as t}from"./chunk-48yphy68.js";import"./chunk-69at8jm8.js";function n(){let{shareId:s}=o.useParams();return e(a,{shareId:s})}var o=t("/share/$shareId/")({component:n});export{o as Route};
|
package/bin/chunk-rd2n0rs6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as x}from"./chunk-7t31qfw5.js";import"./chunk-mkwrrdme.js";import"./chunk-kcg7d7pk.js";import{je as f}from"./chunk-szf2q87p.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 v,Li as e,Wi as p}from"./chunk-48yphy68.js";import{Zm as m}from"./chunk-69at8jm8.js";var g=m(v(),1);function k(){let{projectId:i,folderId:h}=y.useParams(),{teamId:r,ensureTeamIdForProject:t}=s();g.useEffect(()=>{t(i)},[i,t]);let{data:a}=l(f(i)),o=a?.rootFolder,{data:u}=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||!u)return e(c,{});return e(x,{teamId:r,projectId:i,projectName:a.name??"",assetId:h,rootFolderId:o,isRoot:!1})}var y=p("/projects/$projectId/folders/$folderId_/agentsmd")({component:k});export{y as Route};
|
package/bin/chunk-sttc4axf.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{ee as f}from"./chunk-ghw914d2.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 v,Li as a,Wi as o}from"./chunk-48yphy68.js";import{Zm as w}from"./chunk-69at8jm8.js";var g=w(v(),1);function y(){let{projectId:e,folderId:b}=d.useParams(),{teamId:s,ensureTeamIdForProject:n}=h();g.useEffect(()=>{n(e)},[e,n]);let{data:i}=r(f(e)),t=i?.rootFolder,{data:m}=l({queryKey:["folders",t],queryFn:()=>(async()=>{return await(await c.api.folders[":folderId"].$get({param:{folderId:t}})).json()})(),enabled:!!t});if(!s||!t||!m)return a(p,{});return a(x,{teamId:s,projectId:e,projectName:i.name??"",assetId:b,rootFolderId:t})}var d=o("/projects/$projectId/folders/$folderId")({component:y});export{d as Route};
|
package/bin/chunk-t6pmgmg2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as g}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{le as x}from"./chunk-s04f76tb.js";import{we as f}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 p}from"./chunk-qrhf20g2.js";import{hi as r,ii as o,qi as h}from"./chunk-jsqsrcse.js";import"./chunk-8zar6cc4.js";import{Ji as v,Li as a,Wi as c}from"./chunk-48yphy68.js";import{Zm as w}from"./chunk-69at8jm8.js";var b=w(v(),1);function d(){let{projectId:e}=y.useParams(),{teamId:s,ensureTeamIdForProject:n}=p();b.useEffect(()=>{n(e)},[e,n]);let{data:i}=o(x(e)),t=i?.rootFolder,{data:m}=r({queryKey:["folders",t],queryFn:async()=>{let l=await h.api.folders[":folderId"].$get({param:{folderId:t}});if(!l.ok)throw Error("failed to fetch folder");return await l.json()},enabled:!!t});if(!s||!t||!m)return a(f,{});return a(g,{teamId:s,projectId:e,projectName:i.name??"",assetId:t,rootFolderId:t})}var y=c("/projects/$projectId/")({component:d});export{y as Route};
|
package/bin/chunk-txpqhfqw.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as y}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{ge as v,he as m}from"./chunk-xfzk0mrt.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 w}from"./chunk-qrhf20g2.js";import{hi as i,ii as f,ji as x,qi as r}from"./chunk-jsqsrcse.js";import"./chunk-8zar6cc4.js";import{$l as g,Ji as q,Li as n,Wi as b}from"./chunk-48yphy68.js";import{Zm as W}from"./chunk-69at8jm8.js";var d=W(q(),1);function A(){let{projectId:e,collectionId:l}=K.useParams(),{teamId:o,ensureTeamIdForProject:h}=w();d.useEffect(()=>{h(e)},[e,h]);let{data:p}=f(v(e)),{data:s,refetch:z}=i({...m(l)}),{mutate:k}=x({mutationFn:async(a)=>{let c=await r.api.collections[":collectionId"].$patch({param:{collectionId:l},json:a});if(!c.ok)throw Error("Failed to update collection");return await c.json()},onSuccess:()=>{z()}}),t=p?.rootFolder,{data:u}=i({queryKey:["folders",t],queryFn:async()=>{let a=await r.api.folders[":folderId"].$get({param:{folderId:t}});if(!a.ok)throw Error("Failed to fetch folder");return await a.json()},enabled:!!t});if(!o||!t||!u||!s)return n("div",{children:g.loading_collection()});let C=s.filter.sourceFolderId||t;return n(y,{teamId:o,projectId:e,projectName:p.name??"",assetId:C,rootFolderId:t,collection:s,onUpdateCollection:k})}var K=b("/projects/$projectId/collections/$collectionId")({component:A});export{K as Route};
|
package/bin/chunk-vrdbqapq.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Ie as _0,Ke as f0,Le as r0,Me as o0,Qe as a0}from"./chunk-gx8sz5bw.js";import{nf as g0,of as p0}from"./chunk-7anqxpyv.js";import{Af as H1}from"./chunk-5nk7y4ec.js";import{Cf as u0,Df as i0,Ef as d0,Ff as I}from"./chunk-8b11b9cj.js";import{Sf as q1,Tf as h1}from"./chunk-wch8ygpt.js";import{$f as L1}from"./chunk-bthrbggg.js";import{Ag as S0,Bg as T0,Cg as D0,Lg as b0}from"./chunk-3ztat2q9.js";import{Rg as r}from"./chunk-2s97ngr8.js";import{Vg as N1,Wg as R1,Xg as Q1,Yg as F1,Zg as B1,ah as E1}from"./chunk-y0k1f3gk.js";import{jh as Z1,kh as $1,lh as X1,mh as _1}from"./chunk-qh3w5w8e.js";import{ph as y0}from"./chunk-4pj17byj.js";import{Lh as A0}from"./chunk-ps2hw0ps.js";import{Nh as I0,Oh as l0,Ph as x0}from"./chunk-5dfy6173.js";import{$h as h0,Qh as J0,Rh as q0,Sh as U0,Th as W0,Uh as b,Xh as G1,Yh as n,Zh as E0,_h as L0,bi as K1}from"./chunk-qrhf20g2.js";import{ei as s,hi as x,ji as u,qi as O,ri as Y0,ti as Z0,ui as $0,wi as X0,yi as m}from"./chunk-jsqsrcse.js";import{$l as $,Ej as G0,Ji as B0,Jj as z1,Ki as k,Kj as J1,Li as z,Mi as J,Qk as k0,Ri as t0,Ti as e0,Wl as D,Yl as c,Zk as m0,_j as z0,am as j0,gj as s0,hj as V0,hk as w0,kj as K0,ll as M0,mk as U1,pj as a,tk as W1,yl as c0,zk as Y1}from"./chunk-48yphy68.js";import{Zm as F0}from"./chunk-69at8jm8.js";var P0=F0(B0(),1);var o=F0(B0(),1);function A1(Y){if(!Y)return null;try{let W=y0(Y);if(isNaN(W.getTime()))return null;return A0(W,"MMM d, yyyy")}catch{return null}}function y1({version:Y,displayVersionNumber:W,index:F,canEdit:E,onRemove:_}){let[Q,K]=o.useState(!1),{ref:f,handleRef:L}=p0({id:Y.id,index:F,disabled:!E}),q=A1(Y.createdAt);return J("div",{ref:f,className:"group flex items-center gap-3 p-2.5 rounded-lg border border-border bg-card hover:bg-accent/40 transition-colors",children:[J("div",{className:"flex-shrink-0 flex items-center justify-center bg-muted text-muted-foreground rounded-full px-2.5 py-0.5 text-xs font-semibold select-none min-w-[2.25rem]",children:["v",W]}),E?z("div",{ref:L,className:"cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground p-1 -m-1 rounded touch-none flex items-center justify-center",children:z(w0,{className:"h-4 w-4"})}):z("div",{className:"w-4"}),z("div",{className:"h-12 w-20 flex-shrink-0 overflow-hidden rounded-md border border-border bg-muted flex items-center justify-center",children:Y.previewUrl?z("img",{src:Y.previewUrl,alt:Y.name||"",className:"h-full w-full object-cover"}):z(z0,{className:"h-5 w-5 text-muted-foreground"})}),J("div",{className:"flex flex-col flex-1 min-w-0 text-left",children:[z("span",{className:"truncate text-sm font-medium text-foreground",title:Y.name||"",children:Y.name||"Untitled"}),J("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground truncate",children:[z("span",{children:Y.creator?.name||$.unknown()}),q&&J(k,{children:[z("span",{children:"•"}),z("span",{children:q})]})]})]}),E&&J(J0,{modal:!1,open:Q,onOpenChange:K,children:[z(U0,{asChild:!0,children:z(c,{variant:"ghost",size:"icon","aria-label":"More options",className:D("h-8 w-8 text-muted-foreground hover:text-foreground transition-opacity flex-shrink-0",Q?"opacity-100":"opacity-0 group-hover:opacity-100 focus:opacity-100"),children:z(V0,{className:"h-4 w-4"})})}),z(W0,{align:"end",children:J(b,{onClick:()=>_(Y.id),className:"text-destructive focus:text-destructive cursor-pointer",children:[z(M0,{className:"h-4 w-4 mr-2"}),z("span",{children:$.remove_from_stack()})]})})]})]})}function v0({open:Y,onOpenChange:W,stackId:F,canEdit:E=!0,onVersionRemoved:_,onStackDissolved:Q}){let K=s(),[f,L]=o.useState([]),{data:q,isLoading:M}=x({queryKey:["version_stacks",F,"versions"],queryFn:async()=>{let X=await O.api.version_stacks[":stackId"].versions.$get({param:{stackId:F}});if(!X.ok)throw Error("Failed to fetch versions");return await X.json()},enabled:Y&&!!F});o.useEffect(()=>{if(q)L(q)},[q]);let{mutate:S}=u({mutationFn:async({fileId:X,beforeId:G})=>{if(!(await O.api.version_stacks[":stackId"].order.$post({param:{stackId:F},json:{fileId:X,beforeId:G}})).ok)throw Error("Failed to reorder versions")},onSuccess:()=>{K.invalidateQueries({queryKey:["version_stacks"]}),K.invalidateQueries({queryKey:["files"]}),K.invalidateQueries({queryKey:["projects"]}),m.success($.version_reordered_successfully())},onError:()=>{if(m.error($.failed_to_reorder_versions()),q)L(q)}}),{mutate:g,isPending:A}=u({mutationFn:async(X)=>{if(!(await O.api.version_stacks[":stackId"].versions[":versionId"].$delete({param:{stackId:F,versionId:X}})).ok)throw Error("Failed to remove version from stack");return X},onSuccess:(X)=>{m.success($.version_removed_successfully());let G=f.filter((P)=>P.id!==X);if(L(G),K.invalidateQueries({queryKey:["version_stacks"]}),K.invalidateQueries({queryKey:["files"]}),K.invalidateQueries({queryKey:["projects"]}),G.length<=1){let P=G[0];if(W(!1),P)Q?.(P.id)}else _?.(X,G)},onError:()=>{m.error($.failed_to_remove_version())}}),h=(X)=>{if(X.canceled)return;let{source:G}=X.operation;if(!g0(G))return;let{initialIndex:P,index:H}=G;if(P===H)return;let C=[...f],[p]=C.splice(P,1);C.splice(H,0,p),L(C);let w=H===C.length-1?"-1":C[H+1].id;S({fileId:p.id,beforeId:w})},V=(X)=>{if(A)return;g(X)};return z(Y0,{open:Y,onOpenChange:W,children:J(Z0,{className:"max-w-lg p-0 gap-0 overflow-hidden",children:[z($0,{className:"p-4 pb-3 border-b border-border",children:z(X0,{className:"text-base font-semibold",children:$.manage_versions_title()})}),z(r,{className:"max-h-[60vh] p-4",children:M?z("div",{className:"py-8 text-center text-sm text-muted-foreground",children:$.loading?.()||"Loading..."}):f.length===0?z("div",{className:"py-8 text-center text-sm text-muted-foreground",children:$.no_versions_found()}):z("div",{className:"space-y-2",children:z(b0,{sensors:[D0.configure({activationConstraints:[new T0.Distance({value:6})]}),S0],onDragEnd:h,children:f.map((X,G)=>z(y1,{version:X,displayVersionNumber:f.length-G,index:G,canEdit:E,onRemove:V},X.id))})})})]})})}var l=F0(B0(),1);var S1=[I.TODO,I.READY,I.IN_PROGRESS,I.IN_REVIEW,I.DONE,I.BLOCKED];function n0({teamId:Y,assetId:W,assetName:F,isOpen:E,onClose:_}){let Q=s(),[K,f]=l.useState(null),[L,q]=l.useState(!1),[M,S]=l.useState(I.TODO),[g,A]=l.useState(""),{data:h,isLoading:V}=x({queryKey:["teams",Y,"kanban","assets",W,"tasks"],queryFn:async()=>{let U=await O.api.teams[":teamId"].kanban.assets[":assetId"].tasks.$get({param:{teamId:Y,assetId:W}});if(!U.ok)throw Error("Failed to fetch linked tasks");return await U.json()},enabled:!!Y&&!!W&&E}),X=h?.data||[],G=l.useMemo(()=>new Set(X.map((U)=>U.id)),[X]),{data:P,isLoading:H}=x({queryKey:["teams",Y,"kanban","tasks","status",M],queryFn:async()=>{let U=await O.api.teams[":teamId"].kanban.tasks.$get({param:{teamId:Y},query:{status:M,first:"100"}});if(!U.ok)return{data:[]};return await U.json()},enabled:!!Y&&L&&E}),C=P?.data||[],p=l.useMemo(()=>{let U=g.trim().toLowerCase();return C.filter((N)=>{if(G.has(N.id))return!1;if(!U)return!0;return N.title.toLowerCase().includes(U)})},[C,G,g]),w=u({mutationFn:async(U)=>{let N=await O.api.teams[":teamId"].kanban.assets[":assetId"].tasks.$post({param:{teamId:Y,assetId:W},json:{taskId:U}});if(!N.ok)throw Error("Failed to link task");return await N.json()},onSuccess:()=>{Q.invalidateQueries({queryKey:["teams",Y,"kanban","assets",W,"tasks"]}),Q.invalidateQueries({queryKey:["teams",Y,"kanban"]}),m.success($.asset_linked())}}),B=u({mutationFn:async(U)=>{let N=await O.api.teams[":teamId"].kanban.assets[":assetId"].tasks[":taskId"].$delete({param:{teamId:Y,assetId:W,taskId:U}});if(!N.ok)throw Error("Failed to unlink task");return await N.json()},onSuccess:()=>{Q.invalidateQueries({queryKey:["teams",Y,"kanban","assets",W,"tasks"]}),Q.invalidateQueries({queryKey:["teams",Y,"kanban"]}),m.success($.asset_unlinked())}});return J(k,{children:[z(Y0,{open:E,onOpenChange:(U)=>!U&&_(),children:J(Z0,{className:"sm:max-w-2xl flex flex-col h-[520px] p-0 overflow-hidden",children:[z($0,{className:"p-4 border-b flex flex-row items-center justify-between space-y-0 shrink-0",children:J("div",{className:"flex items-center gap-2 min-w-0 pr-4",children:[z(a,{className:"w-5 h-5 text-primary shrink-0"}),J("div",{className:"min-w-0",children:[z(X0,{className:"text-sm font-semibold truncate",children:$.linked_tasks()}),F&&z("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:F})]})]})}),z("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden bg-background",children:z(r,{className:"flex-1 min-h-0 p-4 [&>div>div]:block!",children:V?z("div",{className:"flex items-center justify-center p-12",children:z(K0,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):X.length===0?J("div",{className:"flex flex-col items-center justify-center p-12 text-center text-xs text-muted-foreground gap-2",children:[z(a,{className:"w-8 h-8 opacity-30"}),z("p",{children:$.no_linked_tasks()})]}):z("div",{className:"space-y-2",children:X.map((U)=>J("div",{onClick:()=>f(U.id),className:"flex items-center justify-between gap-3 p-2.5 rounded-lg border border-border/60 bg-muted/20 hover:bg-muted/50 cursor-pointer transition-all hover:border-border",children:[J("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[U.isAgentTask&&z("span",{className:"p-1 rounded bg-orange-500/15 text-orange-600 dark:text-orange-400 shrink-0",children:z(G0,{className:"w-3.5 h-3.5"})}),z("span",{className:D("text-[10px] px-1.5 py-0.5 rounded border uppercase font-medium shrink-0",f0(U.status)),children:_0(U.status)}),z("span",{className:D("text-[10px] px-1.5 py-0.5 rounded border uppercase font-medium shrink-0",o0(U.priority)),children:r0(U.priority)}),z("span",{className:"text-xs font-medium text-foreground truncate flex-1",children:U.title})]}),J("div",{className:"flex items-center gap-2 shrink-0",children:[U.assignee&&J("div",{className:"flex items-center gap-1 text-[11px] text-muted-foreground",title:U.assignee.name,children:[J(I0,{className:"w-4 h-4 text-[9px]",children:[z(l0,{src:U.assignee.image||void 0}),z(x0,{children:U.assignee.name.slice(0,1).toUpperCase()})]}),z("span",{className:"hidden sm:inline text-[11px] max-w-[70px] truncate",children:U.assignee.name})]}),z(c,{type:"button",variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:(N)=>{N.stopPropagation(),B.mutate(U.id)},title:$.unlink_task(),children:z(c0,{className:"w-3.5 h-3.5"})})]})]},U.id))})})}),J("div",{className:"p-3 px-4 border-t bg-muted/10 flex items-center justify-between shrink-0",children:[J(u0,{open:L,onOpenChange:q,children:[z(i0,{asChild:!0,children:J(c,{variant:"outline",size:"sm",className:"gap-1.5 text-xs h-8",children:[z(k0,{className:"w-3.5 h-3.5"}),z("span",{children:$.link_to_task()})]})}),J(d0,{className:"w-80 sm:w-96 p-0",align:"start",children:[z("div",{className:"p-2 border-b",children:J("div",{className:"relative",children:[z(m0,{className:"w-3.5 h-3.5 absolute left-2.5 top-2.5 text-muted-foreground"}),z(j0,{placeholder:$.search_tasks(),value:g,onChange:(U)=>A(U.target.value),className:"pl-8 h-8 text-xs bg-muted/30",autoFocus:!0})]})}),z("div",{className:"flex border-b overflow-x-auto p-1 gap-1 bg-muted/20",children:S1.map((U)=>z("button",{type:"button",onClick:()=>S(U),className:D("px-2 py-1 text-[11px] font-medium rounded transition-colors whitespace-nowrap",M===U?"bg-background shadow-xs text-foreground font-semibold":"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:_0(U)},U))}),z(r,{className:"h-56",children:H?J("div",{className:"flex items-center justify-center p-6 text-xs text-muted-foreground",children:[z(K0,{className:"w-4 h-4 animate-spin mr-1.5"}),z("span",{children:$.loading()})]}):p.length===0?z("div",{className:"p-6 text-center text-xs text-muted-foreground",children:$.no_matching_tasks()}):z("div",{className:"p-1 space-y-0.5",children:p.map((U)=>J("button",{type:"button",onClick:()=>{w.mutate(U.id),q(!1)},className:"w-full text-left p-2 rounded hover:bg-muted/60 transition-colors flex items-center justify-between gap-2 text-xs group",children:[z("span",{className:"truncate flex-1 font-medium text-foreground",children:U.title}),z("span",{className:D("text-[10px] px-1.5 py-0.5 rounded border uppercase shrink-0",f0(U.status)),children:_0(U.status)})]},U.id))})})]})]}),z(c,{variant:"ghost",size:"sm",onClick:_,className:"text-xs h-8",children:$.close()})]})]})}),K&&z(a0,{teamId:Y,taskId:K,isOpen:!0,onClose:()=>f(null)})]})}function f1({teamId:Y,projectId:W,projectName:F,ancestorFolders:E,currentAsset:_,isRootFolder:Q,customTerminalBreadcrumb:K,displayStyle:f,onDisplayStyleChange:L,isLeftSidebarCollapsed:q,onLeftSidebarToggle:M,isRightSidebarCollapsed:S,onRightSidebarToggle:g,isChatbotOpen:A=!1,onChatbotToggle:h,isPublic:V=!1,onFolderClick:X,onRename:G,onDelete:P,fileId:H,shareId:C,allowDownload:p=!0,downloadInfo:w,versions:B,compareMode:U=!1,canCompareVersions:N=!1,onCompareVersions:t}){let j=t0(),{canEdit:i}=K1(W),[H0,d]=P0.useState(!1),[e,N0]=P0.useState(!1),v=H||_.id,P1=_.name==="Recently Deleted",C1=_.name==="All Collections",R0=!V&&!Q&&!P1&&!C1&&!U&&!!v,{data:C0}=x({queryKey:["teams",Y,"kanban","assets",v,"tasks"],queryFn:async()=>{if(!Y||!v)return{data:[],total:0};let Z=await O.api.teams[":teamId"].kanban.assets[":assetId"].tasks.$get({param:{teamId:Y,assetId:v}});if(!Z.ok)return{data:[],total:0};return await Z.json()},enabled:!!Y&&!!v&&R0}),O0=C0?.total??C0?.data?.length??0,D1=!1,O1=(Z)=>{if(!H)return;if(V&&C){j({to:"/share/$shareId/files/$fileId",params:{shareId:C,fileId:H},search:(R)=>({...R,version:Z})});return}if(!W)return;j({to:"/projects/$projectId/files/$fileId",params:{projectId:W,fileId:H},search:(R)=>({...R,version:Z})})},Q0=async(Z)=>{if(!H)return;try{let R=C?await O.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:C,fileId:H},json:{key:Z}}):await O.api.files["download-url"].$post({json:{key:Z,assetId:H}});if(!R.ok)return;let{url:y}=await R.json(),T=document.createElement("a");T.href=y,T.download="",document.body.appendChild(T),T.click(),document.body.removeChild(T)}catch{}},V1=_.proxyType!=="audio"&&(w?.videoTranscodes?.length??0)>0,w1=V?[{name:F,id:"root"},...E.slice().reverse().map((Z)=>({name:Z.name||"",id:Z.id}))]:[{name:$.all_projects(),path:`/teams/${Y}`,isMuted:!0},{name:F,path:`/projects/${W}`},...E.slice().reverse().map((Z)=>({name:Z.name||"",path:`/projects/${W}/folders/${Z.id}`}))];return J("div",{className:"flex h-14 flex-wrap items-center justify-between gap-2 border-b border-border bg-card px-4 py-2",children:[J("div",{className:"flex min-w-0 flex-shrink items-center gap-1",children:[w1.map((Z,R)=>J("div",{className:"flex items-center gap-1",children:[R>0&&z("span",{className:"text-muted-foreground",children:"/"}),Z.path?z(e0,{to:Z.path,className:D("truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground",Z.isMuted?"text-muted-foreground":"text-foreground"),children:Z.name}):z("button",{onClick:()=>Z.id&&X?.(Z.id),className:"truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground text-foreground",children:Z.name})]},R)),K?J("div",{className:"flex items-center gap-1",children:[z("span",{className:"text-muted-foreground",children:"/"}),z("span",{className:"truncate rounded px-2 py-1 text-sm font-medium text-foreground",children:K})]}):!Q&&!U?J("div",{className:"flex items-center gap-1",children:[z("span",{className:"text-muted-foreground",children:"/"}),_.type==="folder"?z("span",{className:"truncate rounded px-2 py-1 text-sm font-medium text-foreground",children:_.name}):J(J0,{modal:!1,children:[J(U0,{className:"flex items-center gap-1 truncate rounded px-2 py-1 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:[z("span",{children:_.name}),_.version!==void 0&&J(H1,{variant:"outline",className:"px-1 py-0 text-xs",children:["v",_.version]}),z(J1,{className:"h-4 w-4"})]}),J(W0,{className:"w-56",children:[p&&(V1?J(E0,{children:[z(L0,{className:"flex items-center gap-2",children:z("span",{children:$.download()})}),z(q0,{children:J(h0,{className:"w-48",children:[z(G1,{children:$.download()}),w?.videoTranscodes?.map((Z)=>{let R=Math.max(Z.width,Z.height),y=`${Z.height}p`;if(R>=3840)y="2160p";else if(R>=1920)y="1080p";else if(R>=1280)y="720p";else if(R>=960)y="540p";else if(R>=640)y="360p";else if(R>=320)y="180p";return J(b,{onClick:()=>Q0(Z.key),className:"flex items-center justify-between",children:[z("span",{children:y}),z("span",{className:"text-xs text-muted-foreground",children:"MP4"})]},y)}),w?.originalKey&&J(k,{children:[z(n,{}),J(b,{onClick:()=>Q0(w.originalKey),className:"flex items-center justify-between",children:[z("span",{children:"Original"}),z("span",{className:"text-xs text-muted-foreground",children:_.name?.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):z(b,{onClick:()=>w?.originalKey&&Q0(w.originalKey),disabled:!w?.originalKey,children:$.download()})),i&&G&&z(b,{onClick:G,children:$.rename()}),i&&P&&z(b,{onClick:P,className:"text-destructive focus:text-destructive",children:$.delete()}),N&&t&&J(k,{children:[z(n,{}),J(b,{onClick:()=>t(),children:[z(s0,{className:"h-4 w-4"}),z("span",{children:$.compare_versions()})]})]}),B&&B.length>0&&J(k,{children:[z(n,{}),J(E0,{children:[J(L0,{className:"flex items-center gap-2",children:[z(U1,{className:"h-4 w-4"}),z("span",{children:"Versions"})]}),z(q0,{children:J(h0,{className:"w-80 p-1",children:[z("div",{className:"flex flex-col gap-1 max-h-96 overflow-y-auto",children:B.map((Z)=>{let R=_.version===Z.version;return J(b,{onClick:()=>O1(Z.id),className:"flex items-center gap-3 py-2 px-3 rounded-md cursor-pointer focus:bg-accent focus:text-accent-foreground",children:[J("div",{className:"flex-shrink-0 flex items-center justify-center bg-muted dark:bg-muted-foreground/20 text-muted-foreground dark:text-muted-foreground rounded-full px-2 py-0.5 text-xs font-semibold select-none min-w-[2rem]",children:["v",Z.version]}),z("div",{className:"h-10 w-16 flex-shrink-0 overflow-hidden rounded-md border border-border bg-muted flex items-center justify-center",children:Z.previewUrl?z("img",{src:Z.previewUrl,alt:Z.name||void 0,className:"h-full w-full object-cover"}):z(z0,{className:"h-4 w-4 text-muted-foreground"})}),J("div",{className:"flex flex-col flex-1 min-w-0 text-left",children:[z("span",{className:"truncate text-sm font-semibold text-foreground",children:Z.name}),z("span",{className:"truncate text-xs text-muted-foreground",children:Z.creator?.name||"Unknown"})]}),R&&z(z1,{className:"h-4 w-4 text-primary ml-auto flex-shrink-0"})]},Z.id)})}),z(n,{}),z("div",{className:"p-1",children:z("button",{className:"w-full text-center text-xs font-medium py-2 px-3 rounded-md bg-muted/80 hover:bg-muted text-foreground transition-colors cursor-pointer",onClick:()=>d(!0),children:$.manage_versions()})})]})})]})]})]})]})]}):null,R0&&J(c,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1.5 text-muted-foreground hover:text-foreground hover:bg-muted ml-1 cursor-pointer",onClick:()=>N0(!0),title:$.linked_tasks(),children:[z(a,{className:"w-4 h-4"}),O0>0&&z("span",{className:"inline-flex items-center justify-center px-1.5 py-0.2 text-[10px] font-semibold rounded-full bg-muted-foreground/15 text-foreground",children:O0})]}),R0&&e&&v&&z(n0,{teamId:Y,assetId:v,assetName:_.name,isOpen:e,onClose:()=>N0(!1)}),H&&B&&B.length>0&&z(v0,{open:H0,onOpenChange:d,stackId:H,canEdit:i,onStackDissolved:(Z)=>{d(!1),j({to:"/projects/$projectId/files/$fileId",params:{projectId:W,fileId:Z}})},onVersionRemoved:(Z,R)=>{if((_.version?B.find((T)=>T.version===_.version)?.id:void 0)===Z){let T=R[0];if(T)j({to:"/projects/$projectId/files/$fileId",params:{projectId:W,fileId:H},search:(M1)=>({...M1,version:T.id})})}}})]}),J("div",{className:"flex items-center gap-2",children:[J("div",{className:"flex flex-shrink-0 items-center gap-1 rounded-md border border-border bg-background p-1",children:[!H&&!V&&M&&z("button",{onClick:M,className:"rounded p-1.5 text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",title:q?"Show Left Sidebar":"Hide Left Sidebar",children:q?z(N1,{className:"h-4 w-4"}):z(Q1,{className:"h-4 w-4 fill-primary stroke-0"})}),!H&&!V&&f&&L&&J(k,{children:[z("button",{onClick:()=>L("card"),className:`rounded p-1.5 transition-colors ${f==="card"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"Card View",children:z(W1,{className:"h-4 w-4"})}),z("button",{onClick:()=>L("list"),className:`rounded p-1.5 transition-colors ${f==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"List View",children:z(Y1,{className:"h-4 w-4"})})]}),z("button",{onClick:g,className:`rounded p-1.5 transition-colors ${!S&&!A?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:S?"Show Right Sidebar":"Hide Right Sidebar",children:!S&&!A?z(F1,{className:"h-4 w-4 fill-primary stroke-0"}):z(R1,{className:"h-4 w-4"})})]}),!V&&h&&z(Z1,{children:J($1,{children:[z(X1,{asChild:!0,children:z("span",{children:z("button",{disabled:!1,onClick:h,className:D("h-9 w-9 flex items-center justify-center rounded-full border border-border bg-background transition-colors",A?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground",!1),children:A?z(B1,{className:"h-6 w-6 text-primary transition-colors"}):z(G0,{className:"h-6 w-6 text-muted-foreground transition-colors"})})})}),z(_1,{children:z("p",{children:A?$.hide_chatbot():$.show_chatbot()})})]})})]})]})}function g2(){let{projectState:Y}=q1(),W=L1(),{isChatbotOpen:F,setIsChatbotOpen:E}=h1();if(!Y)return z(T1,{});let{teamId:_,projectId:Q,projectName:K,ancestorFolders:f,currentAsset:L,isRootFolder:q,customTerminalBreadcrumb:M,fileId:S,downloadInfo:g,versions:A,isPublic:h,shareId:V,allowDownload:X,onFolderClick:G,onRename:P,onDelete:H,compareMode:C,canCompareVersions:p,onCompareVersions:w}=Y,B=!!S,U=!!M,N=!!V&&!B,t=B?W.fileViewLeftSidebarCollapsed:N?W.shareConfigLeftSidebarCollapsed:W.fileListLeftSidebarCollapsed,j=h?void 0:()=>B?W.setFileViewLeftSidebarCollapsed(!W.fileViewLeftSidebarCollapsed):N?W.setShareConfigLeftSidebarCollapsed(!W.shareConfigLeftSidebarCollapsed):W.setFileListLeftSidebarCollapsed(!W.fileListLeftSidebarCollapsed),i=h&&Y.isRightSidebarCollapsed!==void 0?Y.isRightSidebarCollapsed:B?W.fileViewRightSidebarCollapsed:N?W.shareConfigRightSidebarCollapsed:W.fileListRightSidebarCollapsed,H0=h&&Y.onRightSidebarToggle?Y.onRightSidebarToggle:()=>{if(!h&&F)if(E(!1),B)W.setFileViewRightSidebarCollapsed(!1);else if(N)W.setShareConfigRightSidebarCollapsed(!1);else W.setFileListRightSidebarCollapsed(!1);else if(B)W.setFileViewRightSidebarCollapsed(!W.fileViewRightSidebarCollapsed);else if(N)W.setShareConfigRightSidebarCollapsed(!W.shareConfigRightSidebarCollapsed);else W.setFileListRightSidebarCollapsed(!W.fileListRightSidebarCollapsed)},d=h?void 0:()=>{E(!F)},e=Q?W.viewModes[Q]??"card":"card";return z(f1,{teamId:_,projectId:Q,projectName:K,ancestorFolders:f,currentAsset:L,isRootFolder:q,customTerminalBreadcrumb:M,displayStyle:B||N||U?void 0:e,onDisplayStyleChange:B||N||U?void 0:h?void 0:(v)=>{if(Q)W.setViewMode(Q,v)},isLeftSidebarCollapsed:t,onLeftSidebarToggle:j,isRightSidebarCollapsed:i,onRightSidebarToggle:H0,isChatbotOpen:!h&&F,onChatbotToggle:d,isPublic:h,shareId:V,allowDownload:X,fileId:S,downloadInfo:g,versions:A,onFolderClick:G,onRename:P,onDelete:H,compareMode:C,canCompareVersions:p,onCompareVersions:w})}function T1(){return z("div",{className:"flex h-14 flex-wrap items-center justify-center gap-2 border-b border-border bg-card px-4 py-2 flex-shrink-0",children:z(E1,{className:"w-10 h-10 text-orange-600"})})}
|
|
2
|
-
export{g2 as Ge};
|
package/bin/chunk-vwa17b2r.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as QJ,b as a,c as dJ}from"./chunk-50vzkdc8.js";import{i as c,j as i,k as j,l as R,m as q,n as E}from"./chunk-axnvvkdf.js";import{S as LJ}from"./chunk-0ash207y.js";import{T as _J,U as u}from"./chunk-12ps84z8.js";import{ne as jJ}from"./chunk-b78s1cxz.js";import{Te as v,Ue as T,Ve as I,We as b,Xe as g}from"./chunk-8bv8qsb8.js";import{Af as O}from"./chunk-5nk7y4ec.js";import{Bf as HJ}from"./chunk-mm995mvc.js";import{Cf as kJ,Df as FJ,Ef as MJ,Pf as mJ}from"./chunk-8b11b9cj.js";import"./chunk-esa954t1.js";import"./chunk-ctx1ms5t.js";import"./chunk-dyen2t1p.js";import{Ug as KJ}from"./chunk-sepsqqdf.js";import"./chunk-dwkv3bx5.js";import{qh as JJ,sh as qJ}from"./chunk-4pj17byj.js";import"./chunk-ps2hw0ps.js";import{Nh as S,Oh as C,Ph as A}from"./chunk-5dfy6173.js";import{Ai as TJ,Bi as IJ,Ci as bJ,Di as gJ,Ei as nJ,Fi as uJ,Gi as cJ,Hi as iJ,ei as SJ,gi as BJ,hi as D,ji as CJ,ki as e,qi as M,yi as EJ}from"./chunk-jsqsrcse.js";import{$l as W,Ik as r,Il as YJ,Ji as t,Ki as hJ,Kj as AJ,Li as J,Mi as K,Sj as ZJ,Wi as tJ,Wl as s,Yl as n,Zk as $J,am as XJ,bj as rJ,bl as aJ,dj as GJ,fk as x,jj as wJ,kj as k,rl as pJ,tj as l,tl as vJ,ul as NJ,yl as lJ}from"./chunk-48yphy68.js";import{Zm as o}from"./chunk-69at8jm8.js";var sJ=o(t(),1);var VJ=o(t(),1);function UJ({teamId:Y}){let[Z,z]=VJ.useState("team"),[G,Q]=VJ.useState("1h"),{data:V,isLoading:H}=D({queryKey:["teams",Y,"ai-usage",G,"team"],queryFn:async()=>{let _=await M.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:Y},query:{timeframe:G}});if(!_.ok)throw Error("Failed to fetch team AI usage");return await _.json()},enabled:!!Y&&Z==="team"}),{data:f,isLoading:y}=D({queryKey:["teams",Y,"members"],queryFn:async()=>{let _=await M.api.teams[":teamId"].members.$get({param:{teamId:Y},query:{}});if(!_.ok)throw Error("Failed to fetch team members");return await _.json()},enabled:!!Y&&Z==="members"}),P=BJ({queries:(f||[]).map((_)=>({queryKey:["teams",Y,"ai-usage",G,_.id],queryFn:async()=>{let L=await M.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:Y},query:{timeframe:G,userId:_.id}});if(!L.ok)throw Error(`Failed to fetch AI usage for member ${_.id}`);return await L.json()},enabled:!!Y&&Z==="members"}))}),B=y||P.some((_)=>_.isLoading),U=(_)=>{if(!_)return"U";let L=_.split(" ");if(L.length>1)return`${L[0][0]}${L[L.length-1][0]}`.toUpperCase();return _.substring(0,2).toUpperCase()},F=(_)=>{if(!_)return"";switch(_.toLowerCase()){case"owner":return W.owner();case"editor":return W.editor();case"reviewer":return W.reviewer();default:return _}},X=(_)=>(_??0).toLocaleString(),w=(_)=>`$${(_??0).toFixed(6)}`;return K(v,{className:"border-border/60 shadow-sm",children:[K(T,{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between pb-6",children:[K("div",{children:[J(I,{className:"text-xl font-semibold tracking-tight",children:W.ai_usage()}),J(b,{className:"text-sm text-muted-foreground mt-1",children:W.ai_usage_description()})]}),K("div",{className:"flex flex-wrap items-center gap-3",children:[K(_J,{type:"single",value:Z,onValueChange:(_)=>{if(_)z(_)},className:"border rounded-lg p-1 bg-muted/30",children:[J(u,{value:"team",className:"px-3 py-1.5 text-xs font-medium",children:W.team_view()}),J(u,{value:"members",className:"px-3 py-1.5 text-xs font-medium",children:W.members_view()})]}),K(_J,{type:"single",value:G,onValueChange:(_)=>{if(_)Q(_)},className:"border rounded-lg p-1 bg-muted/30",children:[J(u,{value:"1h",className:"px-2.5 py-1.5 text-xs font-medium",children:"1h"}),J(u,{value:"24h",className:"px-2.5 py-1.5 text-xs font-medium",children:"24h"}),J(u,{value:"7d",className:"px-2.5 py-1.5 text-xs font-medium",children:"7d"}),J(u,{value:"30d",className:"px-2.5 py-1.5 text-xs font-medium",children:"30d"})]})]})]}),J(g,{children:Z==="team"?H?J("div",{className:"flex h-48 items-center justify-center",children:J(k,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):J("div",{className:"rounded-md border",children:K(c,{children:[J(i,{children:K(R,{children:[J(q,{children:W.team()}),J(q,{className:"text-right",children:W.input_tokens()}),J(q,{className:"text-right",children:W.output_tokens()}),J(q,{className:"text-right",children:W.cache_read_tokens()}),J(q,{className:"text-right",children:W.total_tokens()}),J(q,{className:"text-right",children:W.cost()})]})}),J(j,{children:K(R,{children:[J(E,{className:"font-medium",children:W.team()}),J(E,{className:"text-right",children:X(V?.team?.inputTokens)}),J(E,{className:"text-right",children:X(V?.team?.outputTokens)}),J(E,{className:"text-right",children:X(V?.team?.cacheReadTokens)}),J(E,{className:"text-right font-medium",children:X(V?.team?.totalTokens)}),J(E,{className:"text-right font-medium",children:w(V?.team?.cost)})]})})]})}):B?J("div",{className:"flex h-48 items-center justify-center",children:J(k,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):J("div",{className:"rounded-md border",children:K(c,{children:[J(i,{children:K(R,{children:[J(q,{children:W.members()}),J(q,{children:W.role()}),J(q,{className:"text-right",children:W.input_tokens()}),J(q,{className:"text-right",children:W.output_tokens()}),J(q,{className:"text-right",children:W.cache_read_tokens()}),J(q,{className:"text-right",children:W.total_tokens()}),J(q,{className:"text-right",children:W.cost()})]})}),J(j,{children:(f||[]).map((_,L)=>{let p=P[L]?.data?.member;return K(R,{children:[J(E,{children:K("div",{className:"flex items-center gap-3",children:[K(S,{className:"h-8 w-8 rounded-full",children:[_.image&&J(C,{src:_.image,alt:_.name,className:"object-cover"}),J(A,{className:"bg-primary/20 text-xs",children:U(_.name)})]}),K("div",{className:"flex flex-col",children:[J("span",{className:"text-sm font-medium leading-none",children:_.name}),J("span",{className:"text-xs text-muted-foreground mt-0.5",children:_.email})]})]})}),J(E,{className:"text-xs text-muted-foreground",children:F(_.role)}),J(E,{className:"text-right",children:X(p?.inputTokens)}),J(E,{className:"text-right",children:X(p?.outputTokens)}),J(E,{className:"text-right",children:X(p?.cacheReadTokens)}),J(E,{className:"text-right font-medium",children:X(p?.totalTokens)}),J(E,{className:"text-right font-medium",children:w(p?.cost)})]},_.id)})})]})})})]})}var WJ=o(t(),1);function yJ({teamId:Y}){let[Z,z]=WJ.useState(null),{ref:G,inView:Q}=KJ(),{data:V,isLoading:H,isError:f,fetchNextPage:y,hasNextPage:P,isFetchingNextPage:B}=e({queryKey:["teams",Y,"agent-sessions"],queryFn:async({pageParam:X})=>{let w=await M.api.teams[":teamId"]["agent-sessions"].$get({param:{teamId:Y},query:{first:"20",after:X?String(X):void 0}});if(!w.ok)throw Error("Failed to fetch agent sessions");return await w.json()},initialPageParam:"",getNextPageParam:(X)=>X.pageInfo.cursor||void 0,enabled:!!Y});WJ.useEffect(()=>{if(Q&&P&&!B)y()},[Q,P,B,y]);let U=V?.pages.flatMap((X)=>X.data).filter((X)=>X.id!=="pending")||[],F=(X)=>{switch(X){case"comment":return J(O,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",children:W.session_type_comment()});case"chat":return J(O,{variant:"outline",className:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20",children:W.session_type_chat()});case"naming":return J(O,{variant:"outline",className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",children:W.session_type_naming()});default:return J(O,{variant:"outline",className:"bg-muted text-muted-foreground border-border",children:X})}};return K("div",{className:"space-y-6",children:[K(v,{className:"border border-border/50 shadow-xs",children:[J(T,{className:"pb-4",children:J("div",{className:"flex items-center justify-between",children:K("div",{children:[K(I,{className:"text-xl font-bold flex items-center gap-2",children:[J(r,{className:"w-5 h-5 text-violet-500"}),W.sessions()]}),J(b,{className:"mt-1 text-sm text-muted-foreground",children:W.sessions_description()})]})})}),J(g,{children:H?J("div",{className:"flex h-64 items-center justify-center",children:J(k,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):f?J("div",{className:"flex h-64 items-center justify-center text-destructive",children:"Failed to load agent sessions."}):U.length===0?K("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[J(r,{className:"w-10 h-10 text-muted-foreground/40 mb-3"}),J("p",{className:"text-base font-medium",children:W.no_sessions_found()})]}):K("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[K(c,{children:[J(i,{className:"bg-muted/40",children:K(R,{children:[J(q,{children:W.session_name()}),J(q,{children:W.creator()}),J(q,{children:W.session_type()}),J(q,{className:"text-right",children:W.create_time()})]})}),J(j,{children:U.map((X)=>K(R,{onClick:()=>z(X.id),className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[J(E,{className:"font-medium",children:K("div",{className:"flex flex-col",children:[J("span",{className:"text-sm font-semibold text-foreground",children:X.name||W.untitled_session()}),J("span",{className:"text-xs font-mono text-muted-foreground/70",children:X.id})]})}),J(E,{children:K("div",{className:"flex items-center gap-2",children:[K(S,{className:"h-6 w-6",children:[J(C,{src:X.creator?.image||void 0}),J(A,{className:"text-[10px]",children:X.creator?.name?.[0]?.toUpperCase()||"?"})]}),J("span",{className:"text-sm text-foreground/90",children:X.creator?.name||"System / Agent"})]})}),J(E,{children:F(X.type)}),J(E,{className:"text-right text-xs text-muted-foreground",children:JJ(X.createdAt)})]},X.id))})]}),J("div",{ref:G,className:"py-4 flex justify-center",children:B&&J(k,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})})]}),J(LJ,{sessionId:Z,open:!!Z,onOpenChange:(X)=>{if(!X)z(null)}})]})}var d=o(t(),1);function RJ({...Y}){return J(YJ.Root,{"data-slot":"collapsible",...Y})}function fJ({...Y}){return J(YJ.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...Y})}function DJ({...Y}){return J(YJ.CollapsibleContent,{"data-slot":"collapsible-content",...Y})}function OJ(Y){switch(Y.toLowerCase()){case"owner":return W.owner();case"editor":return W.editor();case"reviewer":return W.reviewer();default:return Y}}function YK(Y,Z){if(typeof Y==="object"&&Y!==null&&"message"in Y){let z=Y.message;if(typeof z==="string")return z}return Z}function ZK({rule:Y}){let Z=Y.resourceData??{};if(Y.resource==="agent_mcp_call_count")return J("span",{children:W.quota_target_server({value:String(Z.id??"")})});if(Y.resource==="agent_bash_call_count")return J("span",{children:W.quota_target_match({value:String(Z.match??"*")})});if(Y.resource==="agent_tool_call_count")return J("span",{children:W.quota_target_tool({value:String(Z.name??Z.toolName??"*")})});return null}function $K({rule:Y}){if(Y.scopeMode==="all_members")return K(O,{variant:"secondary",className:"gap-1 text-xs",children:[J(NJ,{className:"h-3 w-3"}),K("span",{children:[W.quota_scope_mode_all_members(),Y.role?` (${OJ(Y.role)})`:` (${W.quota_scope_team()})`]})]});if(Y.scopeMode==="each_member")return K(O,{variant:"secondary",className:"gap-1 text-xs",children:[J(vJ,{className:"h-3 w-3"}),K("span",{children:[W.quota_scope_mode_each_member(),Y.role?` (${OJ(Y.role)})`:` (${W.quota_scope_team()})`]})]});return K(O,{variant:"secondary",className:"gap-1 text-xs",children:[J(pJ,{className:"h-3 w-3"}),K("span",{children:[W.quota_scope_mode_selected_members()," (",Y.userIds?.length||0,")"]})]})}function XK({teamId:Y,rule:Z,record:z}){let G=SJ(),[Q,V]=d.useState(!1),[H,f]=d.useState(()=>new Date),y=QJ[Z.resource],P=Z.scopeMode==="all_members",B=z.percent>=100,U=P?Z.role?`${W.quota_role_shared_pool()}: ${OJ(Z.role)}`:W.quota_team_shared_pool():z.user?.name||z.userId||W.unknown();d.useEffect(()=>{if(!z.isWindowActive||!z.periodEnd)return;let X=window.setInterval(()=>f(new Date),60000);return()=>window.clearInterval(X)},[z.isWindowActive,z.periodEnd]);let F=CJ({mutationFn:async()=>{let X=await M.api.teams[":teamId"].quotas[":id"].records.reset.$post({param:{teamId:Y,id:Z.id},json:{userId:z.userId??null}});if(!X.ok){let w=await X.json().catch(()=>null);throw Error(YK(w,W.failed_to_reset_quota()))}return await X.json()},onSuccess:()=>{G.invalidateQueries({queryKey:["teams",Y,"quotas",Z.id,"records"]}),G.invalidateQueries({queryKey:["teams",Y,"quotas"]}),V(!1),EJ.success(W.quota_reset_successfully())},onError:(X)=>{let w=X instanceof Error?X.message:W.failed_to_reset_quota();V(!1),EJ.error(w)}});return K(hJ,{children:[K("div",{className:"space-y-3 rounded-xl border border-border/70 bg-card p-4 text-card-foreground shadow-2xs",children:[K("div",{className:"flex items-center justify-between gap-3",children:[K("div",{className:"flex min-w-0 items-center gap-3",children:[P?J("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:J(NJ,{className:"h-5 w-5"})}):K(S,{className:"h-9 w-9 shrink-0 border border-border/50",children:[J(C,{src:z.user?.image||void 0}),J(A,{className:"text-xs font-semibold",children:z.user?.name?.[0]?.toUpperCase()||"U"})]}),K("div",{className:"min-w-0",children:[J("div",{className:"truncate text-sm font-semibold text-foreground",children:U}),!P&&z.user?.email&&J("div",{className:"truncate text-xs text-muted-foreground",children:z.user.email})]})]}),K("div",{className:"flex shrink-0 items-center gap-2",children:[z.isWindowActive&&z.periodEnd?K(O,{variant:"outline",className:"hidden gap-1 border-primary/30 bg-primary/5 text-xs text-primary sm:flex",children:[J(ZJ,{className:"h-3 w-3"}),J("span",{children:W.quota_refreshes_in({time:qJ(z.periodEnd,H)})})]}):K(O,{variant:"secondary",className:"hidden gap-1 text-xs text-muted-foreground sm:flex",children:[J(GJ,{className:"h-3 w-3 text-primary"}),J("span",{children:W.quota_available()})]}),K(n,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>V(!0),disabled:F.isPending,children:[F.isPending?J(k,{className:"h-3.5 w-3.5 animate-spin"}):J(l,{className:"h-3.5 w-3.5"}),W.quota_reset_usage()]})]})]}),K("div",{className:"space-y-1.5 pt-1",children:[J(jJ,{value:Math.min(100,Math.max(0,z.percent)),className:"h-2"}),K("div",{className:"flex items-center justify-between gap-2 text-xs font-medium",children:[K("span",{className:B?"font-bold text-destructive":"text-foreground",children:[a(Z.resource,z.consumed)," /"," ",a(Z.resource,Z.limit)," ",y?.unit]}),K("span",{className:B?"font-bold text-destructive":"text-muted-foreground",children:[z.percent,"%"]})]})]}),K("div",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground sm:hidden",children:[z.isWindowActive&&z.periodEnd?K("span",{className:"flex items-center gap-1 text-primary",children:[J(ZJ,{className:"h-3 w-3"}),W.quota_refreshes_in({time:qJ(z.periodEnd,H)})]}):K("span",{className:"flex items-center gap-1",children:[J(GJ,{className:"h-3 w-3 text-primary"}),W.quota_available()]}),K("span",{children:[W.quota_remaining(),": ",a(Z.resource,z.remaining)," ",y?.unit]})]})]}),J(TJ,{open:Q,onOpenChange:V,children:K(IJ,{children:[K(bJ,{children:[J(nJ,{children:W.quota_reset_usage()}),J(uJ,{children:W.quota_reset_usage_confirm({target:U})})]}),K(gJ,{children:[J(iJ,{disabled:F.isPending,children:W.cancel()}),K(cJ,{onClick:(X)=>{X.preventDefault(),F.mutate()},disabled:F.isPending,children:[F.isPending&&J(k,{className:"mr-2 h-4 w-4 animate-spin"}),W.confirm()]})]})]})})]})}function zK({teamId:Y,rule:Z}){let[z,G]=d.useState(!1),[Q,V]=d.useState(""),H=QJ[Z.resource],f=H?.icon||x,{data:y,isLoading:P,isError:B}=D({queryKey:["teams",Y,"quotas",Z.id,"records"],queryFn:async()=>{let X=await M.api.teams[":teamId"].quotas[":id"].records.$get({param:{teamId:Y,id:Z.id}});if(!X.ok)throw Error(W.failed_to_load_quota_usage());return await X.json()},enabled:z,refetchInterval:z?1e4:!1}),U=y?.records??[],F=U.filter((X)=>{if(!Q.trim())return!0;let w=Q.toLowerCase();return X.user?.name.toLowerCase().includes(w)||X.user?.email.toLowerCase().includes(w)});return K(RJ,{open:z,onOpenChange:G,className:"rounded-xl border border-border/70",children:[J(fJ,{asChild:!0,children:K("button",{type:"button","aria-label":z?W.quota_collapse_rule():W.quota_expand_rule(),className:"flex w-full items-center justify-between gap-4 p-4 text-left transition-colors hover:bg-muted/40",children:[K("div",{className:"flex min-w-0 items-start gap-3",children:[J("div",{className:"mt-0.5 rounded-lg bg-primary/10 p-2 text-primary",children:J(f,{className:"h-5 w-5"})}),K("div",{className:"min-w-0",children:[K("div",{className:"flex flex-wrap items-center gap-2",children:[J("span",{className:"font-semibold text-foreground",children:H?.label()||Z.resource}),!Z.enabled&&J(O,{variant:"secondary",children:W.quota_disabled()})]}),K("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",children:[J($K,{rule:Z}),K(O,{variant:"outline",className:"gap-1 text-xs",children:[J(ZJ,{className:"h-3 w-3"}),a(Z.resource,Z.limit)," ",H?.unit," /"," ",dJ(Z.period)]}),J(ZK,{rule:Z})]})]})]}),J(AJ,{className:`h-5 w-5 shrink-0 text-muted-foreground transition-transform ${z?"rotate-180":""}`})]})}),J(DJ,{children:K("div",{className:"space-y-3 border-t border-border/60 bg-muted/10 p-4",children:[Z.scopeMode!=="all_members"&&U.length>3&&K("div",{className:"relative",children:[J($J,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),J(XJ,{value:Q,onChange:(X)=>V(X.target.value),placeholder:W.quota_search_members(),className:"h-9 pl-9 text-sm"})]}),P?J("div",{className:"flex justify-center py-10",children:J(k,{className:"h-7 w-7 animate-spin text-primary"})}):B?J("div",{className:"py-8 text-center text-sm text-destructive",children:W.failed_to_load_quota_usage()}):F.length===0?J("div",{className:"py-8 text-center text-sm text-muted-foreground",children:W.quota_no_usage_records()}):F.map((X,w)=>J(XK,{teamId:Y,rule:Z,record:X},X.id||X.userId||`record-${w}`))]})})]})}function xJ({teamId:Y}){let{data:Z,isLoading:z,isError:G}=D({queryKey:["teams",Y,"quotas"],queryFn:async()=>{let V=await M.api.teams[":teamId"].quotas.$get({param:{teamId:Y}});if(!V.ok)throw Error(W.failed_load_settings());return await V.json()},enabled:!!Y}),Q=Z?.rules??[];return K(v,{className:"border-border/60 shadow-sm",children:[K(T,{children:[K(I,{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[J(x,{className:"h-5 w-5 text-primary"}),W.quotas()]}),J(b,{children:W.quota_dashboard_description()})]}),J(g,{children:z?J("div",{className:"flex h-48 items-center justify-center",children:J(k,{className:"h-7 w-7 animate-spin text-muted-foreground"})}):G?J("div",{className:"py-10 text-center text-sm text-destructive",children:W.failed_load_settings()}):Q.length===0?K("div",{className:"flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-border py-12 text-center",children:[J(x,{className:"mb-3 h-10 w-10 text-muted-foreground/50"}),J("p",{className:"text-base font-medium text-foreground",children:W.no_quotas_title()}),J("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:W.no_quotas_description()})]}):J("div",{className:"space-y-3",children:Q.map((V)=>J(zK,{teamId:Y,rule:V},V.id))})})]})}var m=o(t(),1);var _K=Object.values(mJ);function oJ({teamId:Y}){let[Z,z]=m.useState([]),[G,Q]=m.useState([]),[V,H]=m.useState(""),{ref:f,inView:y}=KJ(),{data:P}=D({queryKey:["teams",Y,"members"],queryFn:async()=>{let $=await M.api.teams[":teamId"].members.$get({param:{teamId:Y},query:{}});if(!$.ok)return[];return await $.json()},enabled:!!Y}),B=P||[],{data:U,isLoading:F,isError:X,fetchNextPage:w,hasNextPage:_,isFetchingNextPage:L}=e({queryKey:["teams",Y,"audit-logs",Z,G,V],queryFn:async({pageParam:$})=>{let N=await M.api.teams[":teamId"]["audit-logs"].$get({param:{teamId:Y},query:{first:"20",after:$?String($):void 0,actions:Z.length>0?Z:void 0,userIds:G.length>0?G:void 0,itemId:V.trim()||void 0}});if(!N.ok)throw Error("Failed to fetch audit logs");return await N.json()},initialPageParam:"",getNextPageParam:($)=>$.pageInfo.endCursor||void 0,enabled:!!Y});m.useEffect(()=>{if(y&&_&&!L)w()},[y,_,L,w]);let p=U?.pages.flatMap(($)=>$.nodes)||[],PJ=U?.pages[0]?.total??0,eJ=($)=>{z((N)=>N.includes($)?N.filter((h)=>h!==$):[...N,$])},JK=($)=>{Q((N)=>N.includes($)?N.filter((h)=>h!==$):[...N,$])},KK=($)=>{if($.includes("delete")||$.includes("remove")||$.includes("revoke"))return J(O,{variant:"outline",className:"bg-destructive/10 text-destructive border-destructive/20 font-mono text-xs",children:$});if($.includes("create")||$.includes("add"))return J(O,{variant:"outline",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20 font-mono text-xs",children:$});if($.includes("update")||$.includes("reparent")||$.includes("copy"))return J(O,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20 font-mono text-xs",children:$});return J(O,{variant:"outline",className:"bg-muted text-muted-foreground border-border font-mono text-xs",children:$})},WK=new Map(B.map(($)=>[$.userId||$.id,$]));return J("div",{className:"space-y-6",children:K(v,{className:"border border-border/50 shadow-xs",children:[K(T,{className:"pb-4",children:[K("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[K("div",{children:[K(I,{className:"text-xl font-bold flex items-center gap-2",children:[J(l,{className:"h-5 w-5 text-primary"}),W.audit_logs()]}),J(b,{className:"mt-1",children:W.audit_logs_description()})]}),PJ>0&&K(O,{variant:"secondary",className:"w-fit text-xs font-normal",children:[PJ," ",W.audit_logs()]})]}),K("div",{className:"mt-4 flex flex-wrap items-center gap-3 pt-4 border-t border-border/40",children:[K(kJ,{children:[J(FJ,{asChild:!0,children:K(n,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[J(wJ,{className:"h-3.5 w-3.5"}),W.filter_by_action(),Z.length>0&&J(O,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:Z.length})]})}),K(MJ,{className:"w-64 p-2",align:"start",children:[J("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:W.select_actions()}),J("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:_K.map(($)=>K("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[J(HJ,{checked:Z.includes($),onCheckedChange:()=>eJ($)}),J("span",{className:"font-mono",children:$})]},$))}),Z.length>0&&J(n,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>z([]),children:"Clear Actions"})]})]}),K(kJ,{children:[J(FJ,{asChild:!0,children:K(n,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[J(wJ,{className:"h-3.5 w-3.5"}),W.filter_by_user(),G.length>0&&J(O,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:G.length})]})}),K(MJ,{className:"w-64 p-2",align:"start",children:[J("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:W.select_users()}),J("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:B.map(($)=>{let N=$.userId||$.user?.id||$.id,h=$.user?.name||$.name||N,zJ=$.user?.image||$.image;return K("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[J(HJ,{checked:G.includes(N),onCheckedChange:()=>JK(N)}),K(S,{className:"h-5 w-5",children:[J(C,{src:zJ||void 0}),J(A,{className:"text-[10px]",children:h.slice(0,2).toUpperCase()})]}),J("span",{className:"truncate",children:h})]},N)})}),G.length>0&&J(n,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>Q([]),children:"Clear Users"})]})]}),K("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[J($J,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),J(XJ,{type:"text",placeholder:W.search_item_id(),value:V,onChange:($)=>H($.target.value),className:"pl-8 pr-8 h-9 text-xs"}),V&&J("button",{onClick:()=>H(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground",children:J(lJ,{className:"h-4 w-4"})})]}),(Z.length>0||G.length>0||V)&&J(n,{variant:"ghost",size:"sm",className:"h-9 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{z([]),Q([]),H("")},children:"Clear all"})]})]}),K(g,{className:"p-0",children:[F?J("div",{className:"flex h-64 items-center justify-center",children:J(k,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):X?J("div",{className:"p-8 text-center text-sm text-destructive",children:"Failed to load audit logs."}):p.length===0?J("div",{className:"p-12 text-center text-sm text-muted-foreground",children:W.no_audit_logs()}):K(c,{children:[J(i,{children:K(R,{className:"hover:bg-transparent border-b border-border/50",children:[J(q,{className:"w-[180px] text-xs font-semibold",children:W.action()}),J(q,{className:"w-[200px] text-xs font-semibold",children:W.user()}),J(q,{className:"text-xs font-semibold",children:W.item_id()}),J(q,{className:"text-xs font-semibold",children:W.project_id()}),J(q,{className:"w-[160px] text-right text-xs font-semibold",children:W.timestamp()})]})}),J(j,{children:p.map(($)=>{let N=$.userId?WK.get($.userId):null,h=N?.user?.name||N?.name||$.userId||"System",zJ=N?.user?.image||N?.image;return K(R,{className:"hover:bg-muted/40 transition-colors",children:[J(E,{className:"py-3 font-medium",children:KK($.action)}),J(E,{className:"py-3",children:K("div",{className:"flex items-center gap-2",children:[K(S,{className:"h-6 w-6",children:[J(C,{src:zJ||void 0}),J(A,{className:"text-[10px]",children:h.slice(0,2).toUpperCase()})]}),J("span",{className:"text-xs font-medium text-foreground truncate max-w-[140px]",children:h})]})}),J(E,{className:"py-3 text-xs font-mono text-muted-foreground",children:$.itemId||"-"}),J(E,{className:"py-3 text-xs font-mono text-muted-foreground",children:$.projectId||"-"}),J(E,{className:"py-3 text-right text-xs text-muted-foreground",children:JJ($.createdAt)})]},$.id)})})]}),J("div",{ref:f,className:"py-4 flex justify-center",children:L&&J(k,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})]})})}function VK(){let{teamId:Y}=GK.useParams(),[Z,z]=sJ.useState("audit-logs"),{data:G,isLoading:Q}=D({queryKey:["teams",Y,"me"],queryFn:async()=>{let V=await M.api.teams[":teamId"].me.$get({param:{teamId:Y}});if(!V.ok)throw Error("Failed to fetch me");return await V.json()},enabled:!!Y});if(Q)return J("div",{className:"flex h-screen items-center justify-center",children:J(k,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(G?.role?.toLowerCase()!=="owner")return K("div",{className:"flex h-full flex-col items-center justify-center p-8 text-center",children:[J(aJ,{className:"h-12 w-12 text-destructive mb-4"}),J("h2",{className:"text-xl font-bold tracking-tight mb-2",children:W.access_denied()}),J("p",{className:"text-sm text-muted-foreground max-w-md",children:W.only_owner_dashboard()})]});return J("div",{className:"h-full bg-background font-sans selection:bg-primary/20 transition-colors duration-300",children:K("div",{className:"flex flex-col md:flex-row h-full",children:[J("div",{className:"w-full h-full md:w-72 bg-sidebar border-b md:border-b-0 md:border-r border-sidebar-border z-10 md:left-16 overflow-y-auto transition-colors duration-300",children:K("nav",{className:"p-4 space-y-1 mt-4",children:[J("div",{className:"mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider",children:W.dashboard()}),J("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:W.team_category()}),K("button",{onClick:()=>z("audit-logs"),className:s("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",Z==="audit-logs"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[J(l,{className:"w-5 h-5"}),W.audit_logs(),Z==="audit-logs"&&J("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),K("button",{onClick:()=>z("quotas"),className:s("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",Z==="quotas"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[J(x,{className:"w-5 h-5"}),W.quotas(),Z==="quotas"&&J("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),J("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:W.ai()}),K("button",{onClick:()=>z("ai-usage"),className:s("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",Z==="ai-usage"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[J(rJ,{className:"w-5 h-5"}),W.usage(),Z==="ai-usage"&&J("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),K("button",{onClick:()=>z("ai-sessions"),className:s("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",Z==="ai-sessions"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[J(r,{className:"w-5 h-5"}),W.sessions(),Z==="ai-sessions"&&J("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]})]})}),J("div",{className:"flex-1 overflow-y-auto p-4 md:p-8",children:K("div",{className:"max-w-6xl mx-auto space-y-8",children:[Z==="audit-logs"&&J(oJ,{teamId:Y}),Z==="ai-usage"&&J(UJ,{teamId:Y}),Z==="ai-sessions"&&J(yJ,{teamId:Y}),Z==="quotas"&&J(xJ,{teamId:Y})]})})]})})}var GK=tJ("/teams/$teamId/dashboard")({component:VK});export{GK as Route};
|
package/bin/chunk-wch8ygpt.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{li as w,qi as F,yi as $}from"./chunk-jsqsrcse.js";var z=null,c=w((J)=>({projectState:null,setProjectState:(D)=>{if(z)clearTimeout(z),z=null;J({projectState:D})},clearProjectState:()=>{if(z)clearTimeout(z);z=setTimeout(()=>{J({projectState:null}),z=null},10)}}));var T="shumai_selected_agent_id",M=()=>{if(typeof window<"u"&&window.localStorage)return localStorage.getItem(T);return null},K=w((J)=>({isChatbotOpen:!1,setIsChatbotOpen:(D)=>J({isChatbotOpen:D}),isHistoryMode:!1,setIsHistoryMode:(D)=>J({isHistoryMode:D}),currentSessionId:null,setCurrentSessionId:(D)=>J({currentSessionId:D}),chatAssets:[],addAssets:(D)=>J((H)=>{let L=new Set(H.chatAssets.map((V)=>V.id)),Q=D.filter((V)=>!L.has(V.id));return{chatAssets:[...H.chatAssets,...Q]}}),removeAsset:(D)=>J((H)=>({chatAssets:H.chatAssets.filter((L)=>L.id!==D)})),clearAssets:()=>J({chatAssets:[]}),messages:[],setMessages:(D)=>J({messages:D}),historySessions:[],setHistorySessions:(D)=>J({historySessions:D}),isStreaming:!1,setIsStreaming:(D)=>J({isStreaming:D}),selectedAgentId:M(),setSelectedAgentId:(D)=>{if(typeof window<"u"&&window.localStorage)if(D)localStorage.setItem(T,D);else localStorage.removeItem(T);J({selectedAgentId:D})},inputText:"",setInputText:(D)=>J({inputText:D}),scrollTop:0,isAtBottom:!0,setScrollState:(D,H)=>J({scrollTop:D,isAtBottom:H}),fetchHistorySessions:async(D)=>{try{let H=await F.api.teams[":teamId"].chat.sessions.$get({param:{teamId:D},query:{first:"50"}});if(H.ok){let L=await H.json();J({historySessions:L.data||[]})}}catch(H){console.error("Failed to fetch history sessions:",H)}},loadSession:async(D,H)=>{try{let L=await F.api.teams[":teamId"].chat.sessions[":sessionId"].messages.$get({param:{teamId:D,sessionId:H}});if(L.ok){let Q=await L.json(),U=K.getState().historySessions.find((P)=>P.id===H)?.agentId||null;J({currentSessionId:H,messages:Q,isHistoryMode:!1,scrollTop:0,isAtBottom:!0,...U?{selectedAgentId:U}:{}})}else throw Error("Failed to load session messages")}catch(L){let Q=L instanceof Error?L.message:"Failed to load session";$.error(Q)}},deleteSession:async(D,H)=>{try{if((await F.api.teams[":teamId"].chat.sessions[":sessionId"].$delete({param:{teamId:D,sessionId:H}})).ok)$.success("Session deleted successfully"),J((Q)=>({historySessions:Q.historySessions.filter((V)=>V.id!==H),currentSessionId:Q.currentSessionId===H?null:Q.currentSessionId,messages:Q.currentSessionId===H?[]:Q.messages}));else throw Error("Failed to delete session")}catch(L){let Q=L instanceof Error?L.message:"Failed to delete session";$.error(Q)}},startNewSession:()=>{let D=M();J({currentSessionId:null,messages:[],chatAssets:[],inputText:"",scrollTop:0,isAtBottom:!0,...D?{selectedAgentId:D}:{}})},sendMessage:async(D,H,L,Q,V)=>{let U=K.getState();if(U.isStreaming)return;let P=`temp-${Date.now()}`,b={id:P,role:"user",content:[{type:"text",text:H}],timestamp:Date.now()},v=[...U.messages];if(U.chatAssets.length>0){let B={id:`temp-context-${Date.now()}`,role:"custom",customType:"context_display_info",details:{assets:U.chatAssets.map((k)=>({id:k.id,name:k.name,type:k.type}))},timestamp:Date.now()-1};v.push(B)}v.push(b),J({messages:v,isStreaming:!0,chatAssets:[],isAtBottom:!0});let p=U.chatAssets.map((X)=>X.id),h=U.selectedAgentId;if(!h){$.error("No agent selected");return}try{let X=await F.api.teams[":teamId"].chat.$post({param:{teamId:D},json:{agentId:h,textPrompt:H,assetIds:p,sessionId:U.currentSessionId||void 0,contextAssetId:Q,projectId:L}});if(!X.ok)throw Error("Failed to start chat");let B=X.headers.get("x-session-id");if(B&&!U.currentSessionId)J({currentSessionId:B});let k=X.body?.getReader();if(!k)throw Error("No stream body");let j=new TextDecoder,G="";while(!0){let{done:S,value:x}=await k.read();if(S)break;G+=j.decode(x,{stream:!0});let C=G.split(`
|
|
2
|
-
`);G=C.pop()||"";for(let y of C){let N=y.trim();if(!N)continue;if(N.startsWith("data: ")){let A=N.slice(6);try{let Z=JSON.parse(A);if(Z.type==="session"){if(!K.getState().currentSessionId)J({currentSessionId:Z.sessionId})}else if(Z.type==="entry"){let q=Z.entry,Y=q;if(Y.role==="toolResult"&&typeof Y.toolName==="string"&&["create_file","create_folder","create_version"].includes(Y.toolName)&&!Y.isError)V?.();J((_)=>{let R=_.messages.some((W)=>W.id===q.id),O=_.messages.filter((W)=>{if(q.role==="user"&&!R)return!(W.id.startsWith("temp-")&&!W.id.startsWith("temp-context-"));if(q.role==="custom"&&q.customType==="context_display_info"&&!R)return!W.id.startsWith("temp-context-");return!0}),f=O.findIndex((W)=>W.id===q.id);if(f!==-1){let W=[...O];return W[f]=q,{messages:W}}else return{messages:[...O,q]}})}else if(Z.type==="done"){if(Z.status==="failed")$.error(Z.error||"Workflow failed")}}catch(Z){console.error("Error parsing SSE line:",Z)}}}}K.getState().fetchHistorySessions(D)}catch(X){let B=X instanceof Error?X.message:"Failed to send message";$.error(B),J((k)=>({messages:k.messages.filter((j)=>j.id!==P)}))}finally{J({isStreaming:!1})}},abortActiveSession:async(D)=>{let{currentSessionId:H,isStreaming:L}=K.getState();if(!H||!L)return;try{if((await F.api.teams[":teamId"].chat.sessions[":sessionId"].abort.$post({param:{teamId:D,sessionId:H}})).ok)$.success("Agent execution stopped");else throw Error("Failed to abort agent execution")}catch(Q){let V=Q instanceof Error?Q.message:"Failed to abort execution";$.error(V)}}}));
|
|
3
|
-
export{c as Sf,K as Tf};
|
package/bin/chunk-wqwvxskj.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{oe as f}from"./chunk-s0jy7grq.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 m,Li as a,Wi as o}from"./chunk-48yphy68.js";import{Zm as d}from"./chunk-69at8jm8.js";var g=d(m(),1);function w(){let{projectId:e}=v.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:"recents",rootFolderId:t})}var v=o("/projects/$projectId/recents")({component:w});export{v as Route};
|
package/bin/chunk-wr3q8a9n.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{W as cz}from"./chunk-har4xctf.js";import"./chunk-nw03w9pa.js";import{Fe as pz}from"./chunk-nzrrvn6c.js";import"./chunk-qh3w5w8e.js";import{rh as yz}from"./chunk-4pj17byj.js";import"./chunk-ps2hw0ps.js";import{Mh as r}from"./chunk-qrnw89xg.js";import{Nh as hz,Oh as Sz,Ph as wz}from"./chunk-5dfy6173.js";import{Qh as C,Sh as f,Th as I,Uh as w,bi as bz}from"./chunk-qrhf20g2.js";import{Ai as Dz,Bi as Cz,Ci as fz,Di as Iz,Ei as gz,Fi as uz,Gi as lz,Hi as dz,ci as Mz,ei as i,hi as o,ji as q,qi as X,ri as kz,ti as qz,ui as Az,vi as Ez,wi as Fz,xi as Uz,yi as _z}from"./chunk-jsqsrcse.js";import{Ii as m}from"./chunk-8zar6cc4.js";import{$i as Vz,$l as V,Bj as Rz,Ji as $z,Jj as a,Ki as P,Li as z,Mi as J,Qk as Yz,Ri as n,Wi as Bz,Wl as Zz,Yl as F,aj as Pz,am as j,ij as vz,kj as Gz,nj as Tz,oj as Lz,ql as Jz,yl as Kz}from"./chunk-48yphy68.js";import{Zm as Wz}from"./chunk-69at8jm8.js";var k=Wz($z(),1);function Nz({open:Z,onOpenChange:T,mode:L,teamId:U,project:W}){let A=i(),K=n(),[H,O]=k.useState(""),[y,B]=k.useState(!0),[g,M]=k.useState(void 0),[b,N]=k.useState(void 0),[E,D]=k.useState(!1),v=k.useRef(null);k.useEffect(()=>{if(Z)if(L==="edit"&&W)O(W.name||""),M(W.coverImageKey),N(W.coverImage),B(W.enableNotification!==!1);else O(""),M(void 0),N(void 0),B(!0)},[Z,L,W]);let u=X.api.teams[":teamId"].projects.$post,{mutate:t}=q({mutationFn:async(Q)=>{let _=await u({param:{teamId:U},json:Q});if(!_.ok)throw Error(V.failed_create_project());return await _.json()},onSuccess:(Q)=>{A.invalidateQueries({queryKey:["teams",U,"projects"]}),T(!1);let _=Q;if(_&&typeof _.id==="string")K({to:"/projects/$projectId",params:{projectId:_.id}})}}),l=X.api.projects[":projectId"].$put,{mutate:s}=q({mutationFn:async(Q)=>{let _=await l({param:{projectId:W.id},json:Q});if(!_.ok)throw Error(V.failed_update_project());return await _.json()},onSuccess:()=>{A.invalidateQueries({queryKey:["teams",U,"projects"]}),T(!1)}}),e=X.api.teams[":teamId"].files.$post,{mutate:d}=q({mutationFn:async({file:Q})=>{let _=await e({param:{teamId:U},form:{file:Q}});if(!_.ok)throw Error(V.failed_upload_file());return await _.json()},onSuccess:(Q)=>{let _=Q;if(_&&typeof _.key==="string")M(_.key);D(!1)},onError:()=>{D(!1)}}),R=(Q)=>{let _=Q.target.files?.[0];if(_){D(!0);let zz=URL.createObjectURL(_);N(zz),d({file:_})}},h=()=>{v.current?.click()},p=(Q)=>{Q.stopPropagation(),M(void 0),N(void 0)},S=()=>{if(!H.trim())return;if(L==="create")t({name:H.trim(),coverImageKey:g,enableNotification:y});else if(L==="edit"&&W?.id)s({name:H.trim(),coverImageKey:g,enableNotification:y})};return z(kz,{open:Z,onOpenChange:T,children:J(qz,{className:"sm:max-w-[550px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 backdrop-blur-md shadow-2xl p-0 gap-0",children:[J(Az,{className:"relative overflow-hidden bg-gradient-to-br from-primary/5 to-transparent p-6 border-b border-border/40",children:[z("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/10 rounded-full blur-2xl pointer-events-none"}),z("div",{className:"absolute bottom-0 left-10 w-32 h-12 bg-primary/5 rounded-full blur-xl pointer-events-none"}),z("div",{className:"flex items-center gap-3",children:J("div",{children:[z(Fz,{className:"text-xl font-semibold tracking-tight text-foreground",children:L==="create"?V.create_new_project():V.project_settings()}),z(Uz,{className:"text-xs text-muted-foreground/80 mt-1",children:L==="create"?V.configure_new_project_description():V.manage_project_description()})]})})]}),J("div",{className:"space-y-6 p-6 max-h-[75vh] overflow-y-auto",children:[J("div",{className:"space-y-2",children:[z(m,{htmlFor:"name",className:"text-sm font-semibold tracking-tight text-foreground",children:V.project_name()}),J("div",{className:"relative",children:[z(j,{id:"name",value:H,onChange:(Q)=>O(Q.target.value),placeholder:V.project_name_placeholder(),className:"h-11 px-4 rounded-xl border-border/80 focus-visible:ring-ring/25 focus-visible:border-primary transition-all shadow-xs pr-10"}),H.trim()&&z("div",{className:"absolute inset-y-0 right-3 flex items-center",children:z(a,{className:"w-4 h-4 text-primary"})})]}),z("p",{className:"text-[11px] text-muted-foreground",children:V.project_name_hint()})]}),J("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[J("div",{className:"flex items-center justify-between",children:[J(m,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[z(Lz,{className:"w-4 h-4 text-primary"}),V.project_cover()]}),b&&J("button",{type:"button",onClick:p,className:"text-xs text-muted-foreground hover:text-destructive hover:bg-destructive/5 px-2.5 py-1 rounded-lg transition-all flex items-center gap-1 font-medium",children:[z(Kz,{className:"w-3.5 h-3.5"}),V.remove_cover()]})]}),J("div",{className:"relative aspect-square w-48 mx-auto rounded-2xl border border-dashed border-border flex items-center justify-center cursor-pointer overflow-hidden group shadow-inner bg-muted/20 transition-all duration-300 hover:border-primary/50 hover:bg-muted/40",onClick:h,children:[z("input",{type:"file",ref:v,className:"hidden",accept:"image/*",onChange:R}),E&&z("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:J("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[z(Gz,{className:"w-4 h-4 animate-spin text-primary"}),z("span",{className:"text-xs font-semibold text-foreground",children:V.uploading()})]})}),b?J(P,{children:[z("img",{src:b,alt:V.cover_preview(),className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),J("div",{className:"absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-center gap-1.5 text-white z-10",children:[z(Jz,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),z("span",{className:"text-xs font-semibold",children:V.upload_image()})]})]}):J("div",{className:"flex flex-col items-center gap-2 text-center p-4",children:[z("div",{className:"p-2.5 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:z(Jz,{className:"w-4 h-4 text-muted-foreground"})}),J("div",{children:[z("p",{className:"text-xs font-medium text-foreground",children:V.upload_cover()}),z("p",{className:"text-[11px] text-muted-foreground mt-0.5 max-w-[140px] mx-auto leading-normal",children:V.upload_cover_hint()})]})]})]})]}),J("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[J(m,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[z(Tz,{className:"w-4 h-4 text-primary"}),V.project_preferences()]}),J("div",{className:"flex items-start justify-between rounded-xl border border-border/50 bg-muted/10 p-4 transition-all duration-300 hover:bg-muted/20",children:[J("div",{className:"space-y-1 pr-4",children:[J("div",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[z(Rz,{className:"w-4 h-4 text-primary"}),V.activity_notifications()]}),z("p",{className:"text-xs text-muted-foreground leading-normal",children:V.activity_notifications_description()})]}),z(r,{checked:y,onCheckedChange:B,disabled:E,className:"mt-0.5"})]})]})]}),J(Ez,{className:"flex items-center justify-end gap-3 px-6 py-4 bg-muted/20 border-t border-border/40",children:[z(F,{type:"button",variant:"ghost",onClick:()=>T(!1),disabled:E,className:"rounded-xl h-10 px-4 hover:bg-muted font-medium text-sm text-muted-foreground hover:text-foreground transition-colors",children:V.cancel()}),z(F,{type:"submit",onClick:S,disabled:!H.trim()||E,className:"rounded-xl h-10 px-5 bg-primary text-primary-foreground hover:bg-primary/90 font-semibold text-sm shadow-lg shadow-primary/10 hover:shadow-primary/20 active:scale-98 transition-all flex items-center gap-2",children:E?J(P,{children:[z(Gz,{className:"w-4 h-4 animate-spin"}),V.processing()]}):L==="create"?V.create_project():V.save_changes()})]})]})})}function Oz({sortBy:Z,sortDirection:T,onSortChange:L}){let U=(H)=>{L(H,T)},W=()=>{L(Z,T==="asc"?"desc":"asc")},A=(H)=>{switch(H){case"name":return V.sort_name();case"created_at":return V.sort_created();case"updated_at":return V.sort_updated();default:return H}},K=T==="asc";return J(C,{children:[z(f,{asChild:!0,children:J(F,{variant:"outline",className:"gap-2 bg-muted/50",children:[z("span",{className:"text-muted-foreground",children:V.sorted_by_label()}),z("span",{className:"font-medium text-foreground",children:A(Z)})]})}),J(I,{align:"end",className:"w-56 p-2",children:[z("div",{className:"text-xs font-semibold text-muted-foreground mb-2 px-2",children:V.sort_by()}),J(C,{children:[z(f,{asChild:!0,children:J(F,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted mb-2 border",children:[z("span",{children:A(Z)}),z(Vz,{className:"h-4 w-4 opacity-50"})]})}),z(I,{className:"w-52",children:["name","created_at","updated_at"].map((H)=>J(w,{onClick:()=>U(H),className:"justify-between",children:[A(H),Z===H&&z(a,{className:"h-4 w-4"})]},H))})]}),J(F,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted border",onClick:W,children:[z("span",{className:"text-muted-foreground",children:Z==="name"?K?z(P,{children:V.sort_a_to_z()}):z(P,{children:V.sort_z_to_a()}):K?z(P,{children:V.sort_oldest_to_newest()}):z(P,{children:V.sort_newest_to_oldest()})}),K?z(Pz,{className:"h-4 w-4 opacity-50"}):z(Vz,{className:"h-4 w-4 opacity-50"})]})]})]})}var $=Wz($z(),1);function JG(){let{teamId:Z}=VG.useParams(),{canEdit:T,canAdmin:L}=bz(),U=n(),W=i(),[A,K]=$.useState(null),[H,O]=$.useState(!1),[y,B]=$.useState("create"),[g,M]=$.useState(void 0),[b,N]=$.useState(!1),[E,D]=$.useState(void 0),[v,u]=$.useState(""),[t,l]=$.useState(!1),{metadata:s,setMetadata:e}=pz(),d=`team:${Z}:projects:sort`,R=s[d],[h,p]=$.useState(()=>R?.sortBy||"name"),[S,Q]=$.useState(()=>R?.sortDirection||"asc");$.useEffect(()=>{if(R?.sortBy&&R.sortBy!==h)p(R.sortBy);if(R?.sortDirection&&R.sortDirection!==S)Q(R.sortDirection)},[R]);let _=X.api.teams[":teamId"].projects.$get,{data:zz}=o({queryKey:["teams",Z,"projects",h,S],queryFn:async()=>{let G=await _({param:{teamId:Z},query:{sortBy:h,sortDirection:S}});if(!G.ok)throw Error("Failed to fetch projects");return await G.json()},placeholderData:Mz}),{data:Hz}=o({queryKey:["teams",Z,"members"],queryFn:async()=>{let G=await X.api.teams[":teamId"].members.$get({param:{teamId:Z},query:{}});if(!G.ok)throw Error("Failed to fetch members");return await G.json()}}),{data:Qz}=o({queryKey:["teams",Z,"me"],queryFn:async()=>{let G=await X.api.teams[":teamId"].me.$get({param:{teamId:Z}});if(!G.ok)throw Error("Failed to fetch me");return await G.json()}}),xz=X.api.teams[":teamId"].invite.$post,mz=q({mutationFn:async(G)=>{let Y=await xz(G);if(!Y.ok)throw Error("Failed to invite");return await Y.json()}}),c=q({mutationFn:async(G)=>{if(!(await X.api.projects[":projectId"].$delete({param:{projectId:G}})).ok)throw Error("Failed to delete project")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"projects"]})}}),iz=q({mutationFn:async(G)=>{let Y=await X.api.projects[":projectId"].$put({param:{projectId:G.id},json:{enableNotification:!G.enableNotification}});if(!Y.ok)throw Error("Failed to update project notification settings");return await Y.json()},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"projects"]}),_z.success(V.project_notification_updated())},onError:(G)=>{_z.error(G instanceof Error?G.message:V.failed_update_project_notification())}}),Xz=()=>{B("create"),M(void 0),O(!0)},nz=()=>{K("create"),setTimeout(()=>{K(null)},100),setTimeout(()=>{Xz()},200)},az=(G)=>{B("edit"),M(G),O(!0)},jz=(G)=>{D(G),u(""),N(!0)},rz=async()=>{if(E&&v==="delete")try{await c.mutateAsync(E.id),N(!1)}catch(G){console.error(G)}},oz=(G,Y)=>{if(Y.detail>1)return;K(G),setTimeout(()=>{K(null)},100),setTimeout(()=>{U({to:"/projects/$projectId",params:{projectId:G}})},200)},tz=async(G)=>{return(await mz.mutateAsync({param:{teamId:Z},json:{role:G}})).code},sz=q({mutationFn:async({userId:G,role:Y})=>{if(!(await X.api.teams[":teamId"].members[":userId"].$patch({param:{teamId:Z,userId:G},json:{role:Y}})).ok)throw Error("Failed to update member role")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"members"]})}}),ez=q({mutationFn:async(G)=>{if(!(await X.api.teams[":teamId"].members[":userId"].$delete({param:{teamId:Z,userId:G}})).ok)throw Error("Failed to remove member")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"members"]})}}),zG=(G)=>{if(!G)return"??";return G.split(" ").map((Y)=>Y[0]).slice(0,2).join("").toUpperCase()},GG=(G,Y)=>{p(G),Q(Y),e(Z,d,{sortBy:G,sortDirection:Y})},x=Array.isArray(Hz)?Hz:[];return J("div",{className:"flex-1 overflow-y-auto p-4",children:[J("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-4",children:[z("h1",{className:"text-2xl font-bold",children:V.projects()}),J("div",{className:"flex flex-wrap items-center gap-4",children:[J("div",{className:"flex items-center -space-x-2 cursor-pointer hover:opacity-90",onClick:()=>l(!0),"data-testid":"team-members-trigger",children:[x.slice(0,3).map((G)=>J(hz,{className:"border-2 border-background w-8 h-8",children:[G.image&&z(Sz,{src:G.image,alt:G.name,className:"object-cover"}),z(wz,{className:"text-[10px]",children:zG(G.name)})]},G.id)),x.length>3&&J("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border-2 border-background bg-muted text-[10px] font-medium",children:["+",x.length-3]})]}),z(Oz,{sortBy:h,sortDirection:S,onSortChange:GG}),T&&J(F,{className:"bg-orange-600 hover:bg-orange-700 text-white gap-2",onClick:Xz,children:[z(Yz,{className:"w-4 h-4"}),V.create_project()]})]})]}),J("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4",children:[zz?.data?.map((G)=>z("div",{className:Zz("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out",A===G.id?"scale-95":"scale-100"),onClick:(Y)=>oz(G.id,Y),children:J("div",{className:"flex flex-col",children:[J("div",{className:"relative w-full h-full aspect-square flex items-center justify-center bg-zinc-400/20",children:[G.coverImage?z("img",{src:G.coverImage,alt:G.name,className:"w-full h-full object-cover rounded"}):J("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180.95 164.7",preserveAspectRatio:"xMidYMid slice",className:"w-full h-full object-cover rounded",children:[z("polygon",{fill:"#FC9F8E",points:"0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6"}),z("polygon",{fill:"#FEBAB8",points:"0 0 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0"}),z("polyline",{fill:"#FAA5A5",points:"0 18.5 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0 0 0"}),z("polygon",{fill:"#EC5B6C",points:"0 76.0 0 164.7 151.69 164.7"}),z("polygon",{fill:"#E85C71",points:"180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6"}),z("polygon",{fill:"#C8405B",points:"117.26 73.4 117.37 99.0 90.53 114.9 174.35 164.7 180.95 164.7 180.95 113.6"}),z("polygon",{fill:"#FFCCBE",points:"90.53 51.6 63.69 68.1 90.53 83.4"}),z("path",{fill:"#FB9991",d:"M 90.53 51.6 L 90.53 61.3 L 100.87 67.4 L 90.53 73.5 L 90.53 83.4 L 117.37 68.0 C 117.15 67.6 90.53 51.6 90.53 51.6 Z"}),z("path",{fill:"#FFEACD",d:"M 63.69 68.1 C 63.47 68.5 64.02 99.3 64.02 99.3 C 64.02 99.3 64.46 99.6 64.9 99.9 L 90.53 83.4 L 63.69 68.1 Z"}),z("polygon",{fill:"#FFCFB5",points:"64.02 99.3 90.53 114.9 90.53 83.4"}),z("path",{fill:"#F67D73",d:"M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z"}),z("path",{fill:"#F26560",d:"M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z"}),z("polygon",{fill:"#EB5F5B",points:"80.08 67.5 90.53 73.5 90.53 61.3"}),z("polygon",{fill:"#DB4D50",points:"90.53 61.3 90.53 73.5 100.87 67.4"})]}),z("div",{className:"absolute bottom-0 left-0 w-full h-[65%] bg-linear-to-t from-black/35 to-black/0"}),z("p",{className:"absolute left-1 bottom-2 text-white",children:G.name})]}),J("div",{className:"px-2 h-10 flex justify-between items-center",children:[J("p",{className:"truncate pr-1 text-xs text-muted-foreground",children:[V.updated_ago()," ",yz(G.updatedAt??"")]}),z("div",{onClick:(Y)=>Y.stopPropagation(),children:J(C,{modal:!1,children:[z(f,{asChild:!0,children:z("button",{className:"hover:bg-muted outline-none flex px-1",children:z(vz,{className:"w-5 h-5 text-muted-foreground"})})}),J(I,{align:"end",children:[T&&z(w,{onClick:(Y)=>{Y.stopPropagation(),az(G)},children:V.project_settings()}),J(w,{className:"flex items-center justify-between gap-4 cursor-pointer",onSelect:(Y)=>{Y.preventDefault(),iz.mutate(G)},children:[z("span",{children:V.notification()}),z(r,{checked:G.enableNotification??!0,className:"pointer-events-none"})]}),L&&z(w,{className:"text-destructive focus:text-destructive",onClick:()=>jz(G),children:V.delete()})]})]})})]})]})},G.id)),T&&z("div",{className:Zz("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out border-dashed hover:border-orange-600/50 group",A==="create"?"scale-95":"scale-100"),onClick:nz,children:J("div",{className:"flex flex-col",children:[z("div",{className:"relative w-full aspect-square flex items-center justify-center bg-zinc-400/5 group-hover:bg-orange-600/5 transition-colors",children:z(Yz,{className:"w-8 h-8 text-zinc-400 group-hover:text-orange-600 transition-colors"})}),z("div",{className:"px-2 h-10 flex items-center justify-center bg-zinc-400/10 border-t group-hover:bg-orange-600/10 transition-colors",children:z("p",{className:"text-sm text-muted-foreground group-hover:text-orange-600 transition-colors",children:V.create_project()})})]})})]}),z(Nz,{open:H,onOpenChange:O,mode:y,teamId:Z,project:g}),z(Dz,{open:b,onOpenChange:N,children:J(Cz,{children:[J(fz,{children:[z(gz,{children:V.are_you_sure()}),J(uz,{children:[V.delete_project_warning({name:E?.name??""}),J("div",{className:"mt-4 flex flex-col gap-2 text-foreground",children:[z("span",{className:"text-sm font-medium",children:V.type_delete_to_confirm()}),z(j,{value:v,onChange:(G)=>u(G.target.value),placeholder:V.delete_placeholder(),className:"h-9",autoFocus:!0})]})]})]}),J(Iz,{children:[z(dz,{disabled:c.isPending,children:V.cancel()}),z(lz,{onClick:(G)=>{G.preventDefault(),rz()},disabled:v!=="delete"||c.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:c.isPending?V.deleting():V.delete()})]})]})}),z(cz,{open:t,onOpenChange:l,title:V.team_members(),type:"team",members:x,isOwner:Qz?.role==="owner",onInvite:tz,onUpdateRole:async(G,Y)=>{await sz.mutateAsync({userId:G,role:Y})},onRemoveMember:async(G)=>{await ez.mutateAsync(G)},currentUserId:Qz?.id})]})}var VG=Bz("/teams/$teamId/")({component:JG});export{VG as Route};
|
package/bin/chunk-wt01m93x.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as d,j as x,k as r,l as D,m as G,n as M}from"./chunk-axnvvkdf.js";import{V as p}from"./chunk-kcg7d7pk.js";import{ae as m}from"./chunk-hpm4razn.js";import{we as I}from"./chunk-gwzk0fvn.js";import{$f as g}from"./chunk-bthrbggg.js";import{ag as u}from"./chunk-day0vn14.js";import"./chunk-3ztat2q9.js";import"./chunk-2s97ngr8.js";import"./chunk-dyen2t1p.js";import{Ug as f}from"./chunk-sepsqqdf.js";import{Nh as F,Oh as P,Ph as T}from"./chunk-5dfy6173.js";import{ai as b}from"./chunk-qrhf20g2.js";import{ii as R,ki as k,qi as N}from"./chunk-jsqsrcse.js";import{$l as Y,Dj as z,Hj as C,Ji as o,Ki as y,Li as q,Mi as K,Ri as v,Wi as L,kj as h,tk as S}from"./chunk-48yphy68.js";import{Zm as t}from"./chunk-69at8jm8.js";var Z=t(o(),1);var s=(X)=>{if(!X)return"??";return X.split(" ").map((_)=>_[0]).slice(0,2).join("").toUpperCase()};function e(){let{projectId:X}=qq.useParams(),{teamId:_,ensureTeamIdForProject:E}=b(),j=v();Z.useEffect(()=>{E(X)},[X,E]);let{data:O}=R(m(X)),W=O?.rootFolder,[n,i]=Z.useState(240),{fileListLeftSidebarCollapsed:A,setFileListLeftSidebarCollapsed:c}=g(),{data:B,isLoading:a,fetchNextPage:Q,hasNextPage:V,isFetchingNextPage:U}=k({queryKey:["collections",X],queryFn:async({pageParam:J})=>{let $=await N.api.projects[":projectId"].collections.$get({param:{projectId:X},query:{first:"20",after:J}});if(!$.ok)throw Error("Failed to fetch collections");return await $.json()},initialPageParam:"",getNextPageParam:(J)=>J.pageInfo?.cursor||void 0,enabled:!!X}),{ref:l,inView:H}=f();Z.useEffect(()=>{if(H&&V&&!U)Q()},[H,V,U,Q]);let w=Z.useMemo(()=>B?.pages.flatMap((J)=>J.data)||[],[B]);if(!_||!W||!O)return q(I,{});return q("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:K("div",{className:"flex flex-1 overflow-hidden relative",children:[!A&&q("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>c(!0)}),!A&&K(y,{children:[q("div",{className:"bg-background",style:{width:n},children:q(u,{teamId:_,projectId:X,projectName:O.name??"",rootFolderId:W})}),q(p,{onResize:(J)=>{i(($)=>Math.max(180,Math.min(400,$+J)))},className:"hidden md:block"})]}),K("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[q("header",{className:"h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10",children:K("div",{className:"flex items-center gap-2",children:[q(z,{className:"h-5 w-5 text-primary"}),q("h1",{className:"font-bold text-lg text-foreground",children:Y.all_collections()})]})}),q("div",{className:"flex-1 overflow-y-auto p-6",children:a?q("div",{className:"flex justify-center items-center h-64",children:q("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):w.length===0?K("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[q(S,{className:"h-10 w-10 text-muted-foreground/50"}),q("p",{children:Y.no_collections_yet()})]}):K("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[K(d,{children:[q(x,{children:K(D,{className:"hover:bg-transparent bg-muted/20",children:[q(G,{className:"font-semibold px-4 py-3",children:Y.collection_name()}),q(G,{className:"font-semibold px-4 py-3",children:Y.creator()}),q(G,{className:"font-semibold px-4 py-3 w-[200px]",children:Y.created_date()})]})}),q(r,{children:w.map((J)=>K(D,{className:"hover:bg-muted/10 transition-colors cursor-pointer",onClick:()=>j({to:"/projects/$projectId/collections/$collectionId",params:{projectId:X,collectionId:J.id}}),children:[q(M,{className:"font-medium px-4 py-3.5",children:K("div",{className:"flex items-center gap-2",children:[q(z,{className:"h-4 w-4 text-primary shrink-0"}),q("span",{className:"text-foreground font-semibold hover:underline",children:J.name})]})}),q(M,{className:"px-4 py-3.5",children:K("div",{className:"flex items-center gap-2",children:[K(F,{className:"h-6 w-6",children:[J.creator?.image&&q(P,{src:J.creator.image,alt:J.creator.name,className:"object-cover"}),q(T,{className:"text-[10px]",children:s(J.creator?.name)})]}),q("span",{className:"text-sm font-medium text-foreground truncate max-w-[200px]",children:J.creator?.name||Y.unknown()})]})}),q(M,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:K("div",{className:"flex items-center gap-2",children:[q(C,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),q("span",{children:new Date(J.createdAt).toLocaleDateString()})]})})]},J.id))})]}),q("div",{ref:l,className:"h-10 w-full flex items-center justify-center",children:U&&q(h,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var qq=L("/projects/$projectId/collections/")({component:e});export{qq as Route};
|