@shumai-one/shumai 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/bin/{chunk-1bgsphyz.js → chunk-05tnmf8h.js} +2 -2
  2. package/bin/chunk-0xsgx9ep.js +1 -0
  3. package/bin/{chunk-3d5rm1d1.js → chunk-0ygtayqf.js} +1 -1
  4. package/bin/{chunk-crja7whq.js → chunk-11c93g1m.js} +2 -2
  5. package/bin/chunk-1ajgdv26.js +1 -0
  6. package/bin/{chunk-ba33nf0q.js → chunk-1ntn42d2.js} +3 -3
  7. package/bin/chunk-2kxhdnma.js +3 -0
  8. package/bin/chunk-30dsxm8s.js +1 -0
  9. package/bin/chunk-3b6h719s.js +3 -0
  10. package/bin/{chunk-pdh9bnyj.js → chunk-3g5pyw2e.js} +2 -2
  11. package/bin/{chunk-p75f5pgq.js → chunk-3h9c5ak3.js} +2 -2
  12. package/bin/{chunk-2qjfpmcf.js → chunk-3m5kwcj7.js} +1 -1
  13. package/bin/{chunk-w1wxzqqb.js → chunk-3p1bb08a.js} +2 -2
  14. package/bin/{chunk-6vxzkrsj.js → chunk-3r5yc5wm.js} +4 -4
  15. package/bin/{chunk-sab7tjxw.js → chunk-3tyk9xgf.js} +3 -3
  16. package/bin/{chunk-h9mka9br.js → chunk-4a88wwg2.js} +1 -1
  17. package/bin/{chunk-z08bqvkc.js → chunk-4f5pnnah.js} +14 -14
  18. package/bin/{chunk-dpc11hpd.js → chunk-4jgq9m51.js} +7 -7
  19. package/bin/{chunk-d7fwggt6.js → chunk-4m8gk79m.js} +1 -1
  20. package/bin/{chunk-b9hyc0a1.js → chunk-53vtc74g.js} +2 -2
  21. package/bin/{chunk-1kt5dzjv.js → chunk-58e1a3re.js} +2 -2
  22. package/bin/{chunk-dmvvt8va.js → chunk-5qkwpy8c.js} +2 -2
  23. package/bin/{chunk-07jszkhj.js → chunk-5rk7dyx9.js} +58 -58
  24. package/bin/{chunk-ga3pahzf.js → chunk-5v4s2kp4.js} +1 -1
  25. package/bin/{chunk-v8v8vdf7.js → chunk-5wp37g6w.js} +4 -4
  26. package/bin/{chunk-hs2r9qaw.js → chunk-628k58ek.js} +2 -2
  27. package/bin/{chunk-rp4pc6kz.js → chunk-6kdf411z.js} +1 -1
  28. package/bin/chunk-6ksrrayx.css +1 -0
  29. package/bin/chunk-6rjkbwz6.js +14 -0
  30. package/bin/{chunk-md5pcq46.js → chunk-781990k7.js} +4 -4
  31. package/bin/{chunk-ey3h4sct.js → chunk-887pj9xd.js} +2 -2
  32. package/bin/{chunk-1jybg56e.js → chunk-8b1w6bj9.js} +1 -1
  33. package/bin/{chunk-0wvhahzh.js → chunk-8gna37dd.js} +1 -1
  34. package/bin/{chunk-rmzcarv9.js → chunk-8sf106rq.js} +1 -1
  35. package/bin/{chunk-2jrjwaqr.js → chunk-8ystwvdt.js} +1 -1
  36. package/bin/{chunk-3j5njrpr.js → chunk-9v6eqa3n.js} +2 -2
  37. package/bin/{chunk-rsd164d9.js → chunk-9va1mzeq.js} +1 -1
  38. package/bin/{chunk-kmbjp5kp.js → chunk-an6nsq1t.js} +1 -1
  39. package/bin/{chunk-vzj2j11x.js → chunk-ayq8dskd.js} +1 -1
  40. package/bin/{chunk-y20sbaz5.js → chunk-b0rjvx5g.js} +1 -1
  41. package/bin/chunk-bgm76rzj.js +1 -0
  42. package/bin/chunk-btmxr226.js +1 -0
  43. package/bin/chunk-camzbwqh.js +2 -0
  44. package/bin/{chunk-t350k3s1.js → chunk-ccvjwhqq.js} +1 -1
  45. package/bin/{chunk-pgj2kjnn.js → chunk-dkzyv61a.js} +2 -2
  46. package/bin/{chunk-y56yvezn.js → chunk-dyq6h9ha.js} +1 -1
  47. package/bin/{chunk-teqprbd8.js → chunk-e17daz1x.js} +1 -1
  48. package/bin/{chunk-dbw8c1jj.js → chunk-ebf1r872.js} +4 -4
  49. package/bin/{chunk-2vzzd0q6.js → chunk-ebx3bd4c.js} +1 -1
  50. package/bin/{chunk-161rxeq2.js → chunk-ee3mrvqp.js} +1 -1
  51. package/bin/chunk-fg6zf2gb.js +2 -0
  52. package/bin/{chunk-6y4xkcte.js → chunk-fhazy8f9.js} +1 -1
  53. package/bin/{chunk-gqr5hxhj.js → chunk-fk712d68.js} +1 -1
  54. package/bin/{chunk-afnzb9ne.js → chunk-fvgb6rps.js} +2 -2
  55. package/bin/chunk-g9gmht89.js +2 -0
  56. package/bin/{chunk-1t51fp6n.js → chunk-gf4n4ahk.js} +1 -1
  57. package/bin/{chunk-gcjsw9yp.js → chunk-h3wr8nnk.js} +1 -1
  58. package/bin/chunk-htpjtarr.js +2 -0
  59. package/bin/{chunk-kg8eg9z3.js → chunk-hye75kp0.js} +2 -2
  60. package/bin/{chunk-3tg39jx7.js → chunk-j41mya13.js} +2 -2
  61. package/bin/chunk-j547gtag.js +2 -0
  62. package/bin/{chunk-a4056d0r.js → chunk-jde9r5mj.js} +1 -1
  63. package/bin/chunk-jf4kcad0.js +1 -0
  64. package/bin/{chunk-tgr86ac4.js → chunk-jt04mf5s.js} +1 -1
  65. package/bin/{chunk-hnhdq2wd.js → chunk-k3qypq3x.js} +1 -1
  66. package/bin/chunk-k5hnrtrt.js +1 -0
  67. package/bin/{chunk-mtb9fpj2.js → chunk-k810fstm.js} +1 -1
  68. package/bin/{chunk-3n4224c0.js → chunk-kg2c445x.js} +1 -1
  69. package/bin/{chunk-edqd8evk.js → chunk-kq2qbwx1.js} +1 -1
  70. package/bin/{chunk-7nvk7waw.js → chunk-m2h7a172.js} +1 -1
  71. package/bin/{chunk-brwbhbmc.js → chunk-m638fg4n.js} +5 -5
  72. package/bin/{chunk-3dgahs95.js → chunk-mm1a0zja.js} +1 -1
  73. package/bin/{chunk-hxyg5q2a.js → chunk-njabdtvb.js} +2 -2
  74. package/bin/{chunk-b6q287d1.js → chunk-njqf50vw.js} +1 -1
  75. package/bin/{chunk-47tn3vtg.js → chunk-nn5hyf6f.js} +1 -1
  76. package/bin/{chunk-t7bvde99.js → chunk-nnq8g9yy.js} +3 -3
  77. package/bin/{chunk-8cn7fx40.js → chunk-ny7qjn6s.js} +1 -1
  78. package/bin/{chunk-3d9tfxp4.js → chunk-p5fwjk5c.js} +1 -1
  79. package/bin/{chunk-s05cdax2.js → chunk-pa1fmskf.js} +1 -1
  80. package/bin/{chunk-a796sgcw.js → chunk-pcspeqwq.js} +2 -2
  81. package/bin/{chunk-yfr0hzb7.js → chunk-q1d7x1cc.js} +1 -1
  82. package/bin/{chunk-y1b3ck7m.js → chunk-q45n02fs.js} +1 -1
  83. package/bin/chunk-q6jsw0rr.js +211 -0
  84. package/bin/chunk-qjzyze00.js +1 -0
  85. package/bin/{chunk-2yr5k567.js → chunk-r55htzxr.js} +1 -1
  86. package/bin/{chunk-46wfxyd7.js → chunk-r7e2fmmx.js} +2 -2
  87. package/bin/{chunk-5kvc1gp2.js → chunk-rbagbd0e.js} +1 -1
  88. package/bin/{chunk-dz076sh7.js → chunk-rdscv38p.js} +1 -1
  89. package/bin/chunk-rfhmk32e.js +1 -0
  90. package/bin/{chunk-qs7855cz.js → chunk-rkafv27g.js} +2 -2
  91. package/bin/{chunk-hd6dnnyg.js → chunk-rkqpnyzx.js} +1 -1
  92. package/bin/{chunk-z6jpt0h6.js → chunk-s30fjvzs.js} +3 -3
  93. package/bin/{chunk-dj5a6kkh.js → chunk-s41mgkse.js} +1 -1
  94. package/bin/{chunk-988casfy.js → chunk-s63vj79f.js} +1 -1
  95. package/bin/{chunk-9d0thqcy.js → chunk-t3t7dcfq.js} +1 -1
  96. package/bin/{chunk-gsfcpcye.js → chunk-twyxs4z2.js} +1 -1
  97. package/bin/{chunk-1dqsf5qj.js → chunk-typ46eqd.js} +5 -5
  98. package/bin/chunk-v1sgrg0r.js +1 -0
  99. package/bin/{chunk-j9ks8bd7.js → chunk-vdnmq163.js} +1 -1
  100. package/bin/{chunk-jg2v25d2.js → chunk-vx66rms0.js} +2 -2
  101. package/bin/{chunk-9nvymwqj.js → chunk-wvq717b5.js} +2 -2
  102. package/bin/chunk-xbge27m4.js +1 -0
  103. package/bin/{chunk-ysv80zyb.js → chunk-xca338dw.js} +3 -3
  104. package/bin/chunk-xcsz1wp7.js +1 -0
  105. package/bin/{chunk-ehpfg3km.js → chunk-xznabrt2.js} +1 -1
  106. package/bin/{chunk-pvg3msgw.js → chunk-xzyfnfck.js} +3 -3
  107. package/bin/{chunk-9trnkbtr.js → chunk-ycw3rwhx.js} +3 -3
  108. package/bin/{chunk-qbqym9m6.js → chunk-yqvhgtez.js} +2 -2
  109. package/bin/{chunk-4syt6rn0.js → chunk-yr03tf5r.js} +2 -2
  110. package/bin/{chunk-n3xjwszr.js → chunk-z9jpgxf1.js} +1 -1
  111. package/bin/chunk-zb0az2tq.js +2 -0
  112. package/bin/{chunk-pwkby9h7.js → chunk-zbt4h7n0.js} +1 -1
  113. package/bin/{chunk-kk42xhgz.js → chunk-zcdqsp1e.js} +1 -1
  114. package/bin/chunk-zej27b5c.js +2 -0
  115. package/bin/{chunk-axmd242s.js → chunk-zmjtv19e.js} +1 -1
  116. package/bin/{chunk-7e5z637e.js → chunk-zr11zfwc.js} +1 -1
  117. package/bin/{chunk-k6avge95.js → chunk-zz0522zr.js} +4 -4
  118. package/bin/shumai-app.html +1 -1
  119. package/bin/shumai-app.js +294 -293
  120. package/package.json +7 -7
  121. package/bin/chunk-0c67210c.js +0 -1
  122. package/bin/chunk-2z1pnt7h.js +0 -2
  123. package/bin/chunk-3vmapyk9.js +0 -1
  124. package/bin/chunk-886pnknh.js +0 -3
  125. package/bin/chunk-908pypkr.js +0 -1
  126. package/bin/chunk-952qwf17.js +0 -2
  127. package/bin/chunk-9a2tf0mh.js +0 -2
  128. package/bin/chunk-apfrw0wd.js +0 -3
  129. package/bin/chunk-batadmvr.js +0 -2
  130. package/bin/chunk-bvdvp192.js +0 -1
  131. package/bin/chunk-db1msmdh.js +0 -2
  132. package/bin/chunk-dkx3pmdz.js +0 -1
  133. package/bin/chunk-hacyjx1s.js +0 -1
  134. package/bin/chunk-he5nvmqw.js +0 -1
  135. package/bin/chunk-hyr1vtfp.js +0 -1
  136. package/bin/chunk-jh8q3885.js +0 -211
  137. package/bin/chunk-jzbrt2vk.js +0 -1
  138. package/bin/chunk-nqym3zbs.js +0 -1
  139. package/bin/chunk-sebbjvgv.css +0 -1
  140. package/bin/chunk-t8gv2ekj.js +0 -14
  141. package/bin/chunk-vm5tn0zm.js +0 -2
  142. package/bin/chunk-wmjp8dcm.js +0 -1
  143. package/bin/chunk-wy8dkyxj.js +0 -1
@@ -1 +0,0 @@
1
- import{P,h,D,b,u,S,Z,t,o,K,L,B,ft,Ue,A,I,F,ke,rn,bt,eo,to,Po,pe,we,Re,E,he,ge,Ae,W,Vr,Vt,mf,ym,gf,M0,k0,_f,yf,Ne,E_,Xa,z_,H_,th,it,Tf,Ky,ib,fh,mb,_b,yb,bb,vb,wb,ki,ma,Zc,Pf,Ri,Qb,rv,yv,Tv,kv,$v,Vv,Qv,gd,Kw,Nx,Px,zx,qx,op,tg,sp,SS,ES,El,PE,HE,Fo,QE,oC,iC,Zg,zg,zc,Cl,Cp,Ip,Tp,Il,jc,qc,Mp,kp,Hc,b1,v1,w1,x1,S1,gn,Bp,X1,eI,Up,nA,iI,lI,cI,uI,dI,ue,ie,me,Ge,le,H,ce,lt,Nr,An,$n,Gc,k,yr,on,Q,je,Fe,Le,Ze,Be,ne,ya,$t,hr,wt,Yp}from"./chunk-jh8q3885.js";import{zi,Ia}from"./chunk-07jszkhj.js";import{Xc,wa}from"./chunk-t8gv2ekj.js";import"./chunk-w1wxzqqb.js";import"./chunk-ey3h4sct.js";import"./chunk-vzj2j11x.js";import{Er}from"./chunk-ehpfg3km.js";import{ai,Zl}from"./chunk-2yr5k567.js";import{si}from"./chunk-kmbjp5kp.js";import{Pl}from"./chunk-0wvhahzh.js";import{Ol}from"./chunk-2qjfpmcf.js";import{tr}from"./chunk-2z1pnt7h.js";import"./chunk-d7fwggt6.js";import{Hl,$l}from"./chunk-n3xjwszr.js";import"./chunk-2jrjwaqr.js";import"./chunk-rmzcarv9.js";import{lo}from"./chunk-yfr0hzb7.js";import"./chunk-6y4xkcte.js";import{co}from"./chunk-80qz30dc.js";import{Rr}from"./chunk-3d5rm1d1.js";S();var Ct=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],dt=I("folder-open",Ct);var _t=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],ct=I("list-filter",_t);S();function It({ratio:a}){switch(a){case"16:9":return t("span",{className:"inline-block w-4 h-2.5 border border-current rounded-[1px] shrink-0"});case"9:16":return t("span",{className:"inline-block w-2.5 h-4 border border-current rounded-[1px] shrink-0"});case"4:3":return t("span",{className:"inline-block w-3.5 h-2.5 border border-current rounded-[1px] shrink-0"});case"3:4":return t("span",{className:"inline-block w-2.5 h-3.5 border border-current rounded-[1px] shrink-0"});case"1:1":return t("span",{className:"inline-block w-3 h-3 border border-current rounded-[1px] shrink-0"});default:return t("span",{className:"inline-block w-4 h-2.5 border border-current rounded-[1px] shrink-0"})}}function st(){return Math.random().toString(36).substring(2,9)}function mt(){return{id:st(),type:"text",text:"CONFIDENTIAL",x:0.5,y:0.5,size:0.05,color:"#999999",opacity:0.5,rotation:-30}}function Ft(){return{id:st(),type:"image",imageAssetKey:"",x:0.5,y:0.5,size:0.15,opacity:0.5,rotation:0}}var rt=[{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"}],Dt={"16:9":1.7777777777777777,"9:16":0.5625,"4:3":1.3333333333333333,"3:4":0.75,"1:1":1};function pt({open:a,onOpenChange:N,initialConfig:x,shareId:p,teamId:C,onSaveSuccess:v}){let q=K(),[d,w]=u([]),[c,g]=u(null),[R,V]=u(null),[_,xe]=u("16:9"),[be,ye]=u("grid"),[Ie,J]=u(!1),[ve,oe]=u("new"),[fe,ee]=u(""),[te,ae]=u(null),M=b(null),re=b(null),[se,De]=u({w:0,h:0}),[T,G]=u(!1),s=P((e)=>{if(re.current=e,!e)return;let l=()=>{let{clientWidth:z,clientHeight:y}=e;if(z<=0||y<=0)return;let U=Dt[_],at=z,qe=at/U;if(qe>y)qe=y,at=qe*U;De({w:Math.round(at),h:Math.round(qe)})};l();let n=new ResizeObserver(l);return n.observe(e),()=>{n.disconnect(),re.current=null}},[_]),X=lt((e)=>e.teamId),Se=C||X,[Ke,Pe]=u(!1),[Y,Me]=u({}),de=b(null),Ce=A.api.teams[":teamId"].files.$post,Te=async(e,l)=>{let n=e.target.files?.[0];if(!n)return;if(n.size>1048576){if(k.error(Qb()),de.current)de.current.value="";return}if(!Se){k.error(Zc());return}Pe(!0);let z=URL.createObjectURL(n);Me((y)=>({...y,[l]:z}));try{let y=await Ce({param:{teamId:Se},form:{file:n}});if(!y.ok)throw Error(Zc());let U=await y.json();j(l,{imageAssetKey:U.key,imageAssetUrl:U.url})}catch(y){let U=y instanceof Error?y.message:Zc();k.error(U)}finally{if(Pe(!1),de.current)de.current.value=""}};h(()=>{if(a){if(x?.blocks&&x.blocks.length>0)w(x.blocks),g(x.blocks[0].id);else{let e=mt();w([e]),g(e.id)}V(null)}},[a,x]);let{data:O=[]}=L({queryKey:["watermark-templates",C],queryFn:async()=>{let e=await A.api["watermark-templates"].$get({query:C?{teamId:C}:{}});if(!e.ok)return[];return await e.json()},enabled:a}),Ee=A.api.shares[":shareId"].watermark.$put,{mutate:_e,isPending:Qe}=B({mutationFn:async(e)=>{let l=await Ee({param:{shareId:p},json:{enabled:!0,config:e}});if(!l.ok){let n=await l.json().catch(()=>null);throw Error(n?.error||ma())}return await l.json()},onSuccess:()=>{q.invalidateQueries({queryKey:["share",p]}),q.invalidateQueries({queryKey:["shares"]}),k.success(dI()),N(!1),v?.()},onError:(e)=>{k.error(e.message||ma())}}),Ve=A.api["watermark-templates"].$post,{mutate:He,isPending:Xe}=B({mutationFn:async({name:e,config:l})=>{let n=await Ve({json:{name:e,teamId:C||void 0,config:l}});if(!n.ok)throw Error(ma());return await n.json()},onSuccess:(e)=>{q.invalidateQueries({queryKey:["watermark-templates"]}),V(e.id),J(!1),k.success(w1())},onError:()=>{k.error(ma())}}),Ye=A.api["watermark-templates"][":templateId"].$put,{mutate:ze,isPending:Je}=B({mutationFn:async({templateId:e,config:l})=>{let n=await Ye({param:{templateId:e},json:{config:l}});if(!n.ok)throw Error(ma());return await n.json()},onSuccess:()=>{q.invalidateQueries({queryKey:["watermark-templates"]}),J(!1),k.success(x1())},onError:()=>{k.error(ma())}}),r=A.api["watermark-templates"][":templateId"].$delete,{mutate:m}=B({mutationFn:async(e)=>{if(!(await r({param:{templateId:e}})).ok)throw Error(ki())},onSuccess:(e,l)=>{if(q.invalidateQueries({queryKey:["watermark-templates"]}),R===l)V(null);k.success(b1())},onError:()=>{k.error(ki())}}),f=d.findIndex((e)=>e.id===c),i=f>=0?d[f]:null,We=()=>{let e=mt();w((l)=>[...l,e]),g(e.id)},xt=()=>{let e=Ft();w((l)=>[...l,e]),g(e.id)},nt=(e)=>{if(!e)return;w((l)=>{let n=l.filter((z)=>z.id!==e);if(c===e)g(n.length>0?n[Math.max(0,f-1)].id:null);return n})},j=(e,l)=>{w((n)=>n.map((z)=>z.id===e?{...z,...l}:z))},ht=()=>{if(d.length===0)return;let e=(f-1+d.length)%d.length;g(d[e].id)},vt=()=>{if(d.length===0)return;let e=(f+1)%d.length;g(d[e].id)},yt=(e,l)=>{e.stopPropagation(),g(l),G(!0)},et=P((e)=>{if(!T||!c||!M.current)return;let l=M.current.getBoundingClientRect(),n=(e.clientX-l.left)/l.width,z=(e.clientY-l.top)/l.height,y=Math.max(0,Math.min(1,Math.round(n*100)/100)),U=Math.max(0,Math.min(1,Math.round(z*100)/100));j(c,{x:y,y:U})},[T,c]),tt=P(()=>{G(!1)},[]);h(()=>{if(T)window.addEventListener("mousemove",et),window.addEventListener("mouseup",tt);return()=>{window.removeEventListener("mousemove",et),window.removeEventListener("mouseup",tt)}},[T,et,tt]),h(()=>{let e=(l)=>{if(!a||!c)return;let n=l.target?.tagName?.toLowerCase();if(n==="input"||n==="textarea"||n==="select")return;if(l.key==="Delete"||l.key==="Backspace")l.preventDefault(),nt(c)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a,c,f]);let Nt=(e)=>{if(e.config?.blocks&&e.config.blocks.length>0){let l=e.config.blocks.map((n)=>({...n,id:st()}));w(l),g(l[0].id),V(e.id)}},kt=()=>{if(d.length===0){k.error(Px());return}_e({blocks:d})},St=()=>{if(ve==="new"){if(!fe.trim()){k.error(fh());return}He({name:fe.trim(),config:{blocks:d}})}else{let e=te||R;if(!e){k.error(Zg());return}ze({templateId:e,config:{blocks:d}})}};return o(Z,{children:[t(ue,{open:a,onOpenChange:N,children:o(ie,{showCloseButton:!1,className:"sm:max-w-[1400px] max-w-[95vw] w-[95vw] h-[88vh] flex flex-col p-0 gap-0 overflow-hidden",onPointerDownOutside:(e)=>e.preventDefault(),children:[o("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border bg-card",children:[t("div",{className:"flex items-center gap-3",children:t(le,{className:"text-base font-semibold",children:lI()})}),o("div",{className:"flex items-center gap-2",children:[o(he,{modal:!1,children:[t(ge,{asChild:!0,children:o(E,{variant:"outline",size:"sm",className:"gap-2 text-xs",children:[t(dt,{className:"h-4 w-4 text-muted-foreground"}),cI()]})}),o(Ae,{align:"end",className:"w-56",children:[t(Vr,{className:"text-xs font-semibold text-muted-foreground",children:Qv()}),O.length===0?t("div",{className:"px-2 py-1.5 text-xs text-muted-foreground italic",children:Nx()}):O.map((e)=>o(W,{onClick:()=>Nt(e),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{className:"truncate flex-1",children:e.name}),R===e.id&&t(ke,{className:"h-3.5 w-3.5 text-primary ml-2 flex-shrink-0"}),t(E,{variant:"ghost",size:"icon",className:"h-5 w-5 hover:bg-destructive/10 hover:text-destructive ml-1",onClick:(l)=>{l.stopPropagation(),m(e.id)},children:t(we,{className:"h-3 w-3"})})]},e.id)),t(Vt,{}),o(W,{onClick:()=>{oe("new"),ee(""),J(!0)},className:"text-xs gap-2 cursor-pointer",children:[t(pe,{className:"h-3.5 w-3.5 text-primary"}),th()]}),O.length>0&&o(W,{onClick:()=>{oe("overwrite"),ae(R||O[0].id),J(!0)},className:"text-xs gap-2 cursor-pointer",children:[t(si,{className:"h-3.5 w-3.5 text-muted-foreground"}),tg()]})]})]}),t(E,{variant:"outline",size:"sm",className:"text-xs",onClick:()=>N(!1),children:Ne()}),o(E,{size:"sm",className:"text-xs bg-primary hover:bg-primary/90 text-primary-foreground gap-1.5",disabled:Qe,onClick:kt,children:[t(si,{className:"h-3.5 w-3.5"}),QE()]})]})]}),o("div",{className:"flex-1 flex overflow-hidden",children:[o("div",{className:"w-[65%] flex flex-col p-4 bg-muted/20 border-r border-border overflow-hidden select-none",children:[o("div",{className:"flex items-center justify-between mb-3",children:[t("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((e)=>o(E,{variant:_===e?"secondary":"ghost",size:"sm",className:$e("h-7 px-2.5 text-xs gap-1.5 font-mono transition-all",_===e?"bg-background shadow-xs font-semibold text-foreground border border-border/50":"text-muted-foreground hover:text-foreground"),onClick:()=>xe(e),children:[t(It,{ratio:e}),t("span",{children:e})]},e))}),t("div",{className:"flex items-center gap-1.5 bg-background border border-border/60 rounded-md p-1",children:rt.map((e)=>t("button",{type:"button",onClick:()=>ye(e.id),style:{backgroundColor:e.bg},className:$e("w-5 h-5 rounded-full border border-border/80 transition-all cursor-pointer relative",be===e.id?"ring-2 ring-primary ring-offset-1 scale-110":"hover:scale-105 opacity-80 hover:opacity-100"),title:e.label},e.id))})]}),t("div",{ref:s,className:"flex-1 flex items-center justify-center overflow-hidden",children:(()=>{let e=rt.find((n)=>n.id===be)||rt[0],l=se.w>0&&se.h>0;return t("div",{ref:M,onClick:()=>g(null),style:{backgroundColor:e.bg,backgroundImage:`radial-gradient(${e.dot} 1px, transparent 1px)`,backgroundSize:"16px 16px",...l?{width:se.w,height:se.h}:{}},className:$e("relative rounded-lg border border-border overflow-hidden shadow-inner transition-all",_==="16:9"&&"aspect-[16/9] w-full max-h-full",_==="9:16"&&"aspect-[9/16] h-full max-w-full",_==="4:3"&&"aspect-[4/3] w-full max-h-full",_==="3:4"&&"aspect-[3/4] h-full max-w-full",_==="1:1"&&"aspect-square h-full max-w-full"),children:d.map((n)=>{let z=n.id===c,y=n.size*(se.w||640);return t("div",{onMouseDown:(U)=>yt(U,n.id),onClick:(U)=>{U.stopPropagation(),g(n.id)},style:{left:`${n.x*100}%`,top:`${n.y*100}%`,transform:`translate(-50%, -50%) rotate(${n.rotation}deg)`,opacity:n.opacity},className:$e("absolute cursor-move select-none transition-shadow rounded p-1.5 flex items-center justify-center",z?"ring-2 ring-primary ring-offset-2 ring-offset-background/80 bg-primary/10":"hover:ring-1 hover:ring-muted-foreground/50"),children:n.type==="text"?t("span",{style:{fontSize:`${y}px`,color:n.color,lineHeight:1,whiteSpace:"nowrap",fontWeight:700,textShadow:"0 1px 3px rgba(0,0,0,0.5)"},children:n.text||"Text"}):t("div",{style:{width:`${y}px`,height:`${y}px`},className:"bg-primary/20 border border-primary/40 rounded flex items-center justify-center p-1 overflow-hidden",children:Y[n.id]||n.imageAssetUrl?t("img",{src:Y[n.id]||n.imageAssetUrl,alt:"Watermark logo",className:"w-full h-full object-contain pointer-events-none"}):t(eo,{className:"h-1/2 w-1/2 opacity-70 text-primary"})})},n.id)})})})()})]}),o("div",{className:"w-[35%] flex flex-col bg-card overflow-hidden border-l border-border",children:[t("div",{className:"p-4 border-b border-border bg-muted/10 flex items-center justify-between",children:o("div",{className:"flex items-center gap-2",children:[t(to,{className:"h-4 w-4 text-muted-foreground"}),t("span",{className:"text-xs font-semibold",children:nA()})]})}),o("div",{className:"p-3 border-b border-border bg-background flex items-center justify-between gap-2",children:[o("div",{className:"flex items-center gap-1",children:[t(E,{variant:"outline",size:"icon",className:"h-7 w-7",disabled:d.length<=1,onClick:ht,children:t(rn,{className:"h-4 w-4"})}),o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(E,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs font-mono",children:d.length===0?"0 / 0":`${f+1} / ${d.length}`})}),t(Ae,{align:"start",className:"w-48",children:d.map((e,l)=>o(W,{onClick:()=>g(e.id),className:"text-xs flex items-center justify-between cursor-pointer",children:[o("span",{className:"flex items-center gap-2 truncate",children:[e.type==="text"?t(zi,{className:"h-3.5 w-3.5 text-muted-foreground"}):t(eo,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.type==="text"?e.text||"Text":e.imageAssetKey||"Image"]}),o("span",{className:"text-[10px] font-mono text-muted-foreground ml-2",children:["#",l+1]})]},e.id))})]}),t(E,{variant:"outline",size:"icon",className:"h-7 w-7",disabled:d.length<=1,onClick:vt,children:t(bt,{className:"h-4 w-4"})})]}),o("div",{className:"flex items-center gap-1",children:[i&&t(E,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:bg-destructive/10",title:it(),onClick:()=>nt(i.id),children:t(we,{className:"h-4 w-4"})}),o(he,{modal:!1,children:[t(ge,{asChild:!0,children:o(E,{size:"sm",className:"h-7 text-xs gap-1",children:[t(pe,{className:"h-3.5 w-3.5"}),mf()]})}),o(Ae,{align:"end",children:[o(W,{onClick:We,className:"text-xs gap-2 cursor-pointer",children:[t(zi,{className:"h-3.5 w-3.5"}),gf()]}),o(W,{onClick:xt,className:"text-xs gap-2 cursor-pointer",children:[t(eo,{className:"h-3.5 w-3.5"}),ym()]})]})]})]})]}),t(ce,{className:"flex-1 min-h-0 p-4",children:i?o("div",{className:"space-y-5 text-xs",children:[o("div",{className:"flex items-center justify-between pb-2 border-b border-border",children:[o("span",{className:"font-semibold text-muted-foreground flex items-center gap-1.5",children:[i.type==="text"?t(zi,{className:"h-4 w-4 text-primary"}):t(eo,{className:"h-4 w-4 text-primary"}),i.type==="text"?gf():ym()]}),o("span",{className:"text-[10px] font-mono text-muted-foreground",children:["ID: ",i.id.slice(0,6)]})]}),i.type==="text"&&o("div",{className:"space-y-2",children:[t(Q,{className:"text-xs",children:S1()}),t(H,{type:"text",value:i.text,onChange:(e)=>j(i.id,{text:e.target.value}),className:"text-xs h-8"})]}),i.type==="image"&&o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(Q,{className:"text-xs",children:Tv()}),i.imageAssetKey&&o("button",{type:"button",onClick:()=>j(i.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:[t(Re,{className:"w-3.5 h-3.5"}),El?El():"Remove"]})]}),t("input",{type:"file",ref:de,className:"hidden",accept:"image/*",onChange:(e)=>Te(e,i.id)}),o("div",{onClick:()=>de.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:[Ke&&t("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:o("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[t(F,{className:"w-4 h-4 animate-spin text-primary"}),t("span",{className:"text-xs font-semibold",children:Up()})]})}),Y[i.id]||i.imageAssetUrl?o(Z,{children:[t("img",{src:Y[i.id]||i.imageAssetUrl,alt:"Uploaded logo preview",className:"max-w-full max-h-full object-contain transition-transform duration-300 group-hover:scale-105"}),o("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:[t(lo,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),t("span",{className:"text-xs font-semibold",children:Bp()})]})]}):o("div",{className:"flex flex-col items-center gap-1.5 text-center p-3",children:[t("div",{className:"p-2 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:t(lo,{className:"w-4 h-4 text-muted-foreground"})}),o("div",{children:[t("p",{className:"text-xs font-medium text-foreground",children:X1()}),t("p",{className:"text-[10px] text-muted-foreground mt-0.5 max-w-[150px] mx-auto leading-normal",children:eI()})]})]})]})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(Q,{className:"text-xs",children:i.type==="text"?rv():kv()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(i.size*100),"%"]})]}),o("div",{className:"flex items-center gap-3",children:[t(Ia,{min:i.type==="text"?0.01:0.02,max:i.type==="text"?0.12:0.5,step:0.005,value:[i.size],onValueChange:([e])=>j(i.id,{size:e}),className:"flex-1"}),t(H,{type:"number",min:1,max:100,value:Math.round(i.size*100),onChange:(e)=>j(i.id,{size:Math.min(1,Math.max(0.001,Number(e.target.value)/100))}),className:"w-16 h-7 text-xs font-mono text-right"})]})]}),i.type==="text"&&o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(Q,{className:"text-xs",children:E_()}),t("span",{className:"font-mono text-[11px] text-muted-foreground uppercase",children:i.color})]}),o("div",{className:"flex items-center gap-2",children:[t("input",{type:"color",value:i.color,onChange:(e)=>j(i.id,{color:e.target.value}),className:"w-8 h-8 rounded border border-border cursor-pointer bg-transparent p-0"}),t(H,{type:"text",value:i.color,onChange:(e)=>j(i.id,{color:e.target.value}),className:"flex-1 h-8 text-xs font-mono"})]}),t("div",{className:"flex items-center gap-1.5 pt-1",children:["#FFFFFF","#000000","#999999","#EF4444","#3B82F6","#10B981","#F59E0B"].map((e)=>t("button",{type:"button",onClick:()=>j(i.id,{color:e}),style:{backgroundColor:e},className:"w-5 h-5 rounded-full border border-border hover:scale-110 transition-transform"},e))})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(Q,{className:"text-xs",children:zx()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(i.opacity*100),"%"]})]}),t(Ia,{min:0,max:1,step:0.01,value:[i.opacity],onValueChange:([e])=>j(i.id,{opacity:e})})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(Q,{className:"text-xs",children:HE()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[i.rotation,"°"]})]}),t(Ia,{min:-180,max:180,step:1,value:[i.rotation],onValueChange:([e])=>j(i.id,{rotation:e})}),t("div",{className:"flex items-center gap-1.5 pt-1",children:[-45,-30,0,30,45].map((e)=>o(E,{variant:"outline",size:"sm",className:"h-6 text-[10px] flex-1 px-1 font-mono",onClick:()=>j(i.id,{rotation:e}),children:[e,"°"]},e))})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(Q,{className:"text-xs",children:SS()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(i.x*100),"%"]})]}),t(Ia,{min:0,max:1,step:0.01,value:[i.x],onValueChange:([e])=>j(i.id,{x:e})})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(Q,{className:"text-xs",children:ES()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(i.y*100),"%"]})]}),t(Ia,{min:0,max:1,step:0.01,value:[i.y],onValueChange:([e])=>j(i.id,{y:e})})]})]}):o("div",{className:"py-12 text-center text-xs text-muted-foreground space-y-3",children:[t("p",{children:iC()}),o(E,{size:"sm",variant:"outline",onClick:We,children:[t(pe,{className:"h-3.5 w-3.5 mr-1"}),gf()]})]})})]})]})]})}),t(ue,{open:Ie,onOpenChange:J,children:o(ie,{className:"max-w-md",children:[t(me,{children:t(le,{className:"text-sm font-semibold",children:ve==="new"?th():tg()})}),t("div",{className:"py-3 space-y-4 text-xs",children:ve==="new"?o("div",{className:"space-y-2",children:[t(Q,{children:v1()}),t(H,{type:"text",value:fe,onChange:(e)=>ee(e.target.value),placeholder:fh(),className:"text-xs"})]}):o("div",{className:"space-y-2",children:[t(Q,{children:Zg()}),t("select",{value:te||"",onChange:(e)=>ae(e.target.value),className:"w-full h-9 rounded-md border border-input bg-background px-3 text-xs",children:O.map((e)=>t("option",{value:e.id,children:e.name},e.id))})]})}),o(Ge,{children:[t(E,{variant:"outline",size:"sm",className:"text-xs",onClick:()=>J(!1),children:Ne()}),t(E,{size:"sm",className:"text-xs",disabled:Xe||Je,onClick:St,children:Xa()})]})]})})]})}function $e(...a){return a.filter(Boolean).join(" ")}S();function gt({shareLink:a,viewMode:N,onViewModeChange:x,defaultSortOrder:p,onSortOrderChange:C}){let v=K(),[q,d]=u(a.password||""),[w,c]=u(a.expireAt?new Date(a.expireAt):void 0),[g,R]=u(!1);h(()=>{d(a.password||"")},[a.password]);let[V,_]=u(a.hasPassword),[xe,be]=u(!!a.expireAt),{data:ye,refetch:Ie}=L({queryKey:["share-watermark",a.id],queryFn:async()=>{let s=await A.api.shares[":shareId"].watermark.$get({param:{shareId:a.id}});if(!s.ok)return null;return await s.json()},refetchInterval:(s)=>(s.state.data?.watermarkStatus||a.watermarkStatus)==="processing"?3000:!1}),J=A.api.shares[":shareId"].watermark.$put,{mutate:ve}=B({mutationFn:async()=>{let s=await J({param:{shareId:a.id},json:{enabled:!1}});if(!s.ok)throw Error(ma());return await s.json()},onSuccess:()=>{v.invalidateQueries({queryKey:["shares",a.projectId]}),v.invalidateQueries({queryKey:["share",a.id]}),v.invalidateQueries({queryKey:["share-watermark",a.id]}),k.success(iI())}}),oe=ye?.watermarkStatus??a.watermarkStatus??(a.watermarkConfigId?"ready":"disabled"),fe=ye?.watermarkConfig?.config??a.watermarkConfig?.config??null,ee=fe!==null&&oe!=="disabled",{data:te}=L({queryKey:["fields",a.projectId],queryFn:async()=>{let s=await A.api.projects[":projectId"].fields.$get({param:{projectId:a.projectId}});if(!s.ok)throw Error(_b());return await s.json()},enabled:!!a.projectId}),ae=A.api.shares[":shareId"].$put,{mutate:M}=B({mutationFn:async(s)=>{let X=await ae({param:{shareId:a.id},json:s});if(!X.ok)throw Error(ma());return await X.json()},onSuccess:()=>{v.invalidateQueries({queryKey:["shares",a.projectId]}),v.invalidateQueries({queryKey:["share",a.id]}),k.success(zg())}}),re=`${window.location.origin}/share/${a.id}`,se=async(s)=>{if(await co(s))k.success(z_())},De=(s)=>{let X=a.fieldVisibility||{},Se={...X,[s]:!X[s]};M({fieldVisibility:Se})},T="index",G="asc";if(p){let s=p.split(":");T=s[0],G=s[1]||"asc"}return o("div",{className:"flex flex-col h-full bg-background border-l border-border",children:[t("div",{className:"flex-1 overflow-y-auto",children:o("div",{className:"p-4 space-y-6",children:[o("div",{className:"space-y-4",children:[o("div",{className:"flex items-center justify-between",children:[t("h3",{className:"text-sm font-medium",children:$v()}),t(je,{checked:!a.isDisabled,onCheckedChange:(s)=>M({isDisabled:!s})})]}),o("div",{className:"relative w-full",children:[t(H,{value:re,readOnly:!0,className:"pr-10 bg-muted/50 text-xs"}),t(E,{variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full",onClick:()=>se(re),children:t(Rr,{className:"h-4 w-4"})})]})]}),o("div",{className:"space-y-1",children:[t(Oe,{title:oC(),icon:t($l,{className:"h-4 w-4"}),children:o("div",{className:"p-3 space-y-4 pt-2",children:[o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(Q,{className:"text-xs",children:sp()}),t(je,{checked:V,onCheckedChange:(s)=>{if(_(s),!s)M({password:null})}})]}),V&&o("div",{className:"flex gap-2 animate-in fade-in slide-in-from-top-1 duration-200",children:[t(H,{type:"text",value:q,onChange:(s)=>d(s.target.value),placeholder:ib(),className:"text-xs"}),t(E,{size:"sm",onClick:()=>M({password:q}),children:Fo()})]})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(Q,{className:"text-xs",children:mb()}),t(je,{checked:xe,onCheckedChange:(s)=>{if(be(s),!s)c(void 0),M({expireAt:null})}})]}),xe&&t("div",{className:"animate-in fade-in slide-in-from-top-1 duration-200",children:t(ya,{value:w,onChange:(s)=>{c(s),M({expireAt:s?s.toISOString():null})},className:"text-xs"})})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(Q,{className:"text-xs",children:M0()}),t(je,{checked:a.allowDownload,onCheckedChange:(s)=>M({allowDownload:s})})]}),t("p",{className:"text-xs text-muted-foreground",children:k0()})]}),o("div",{className:"space-y-2 pt-2 border-t border-border/50",children:[o("div",{className:"flex items-center justify-between",children:[t(Q,{className:"text-xs",children:nA()}),t(je,{checked:ee,disabled:oe==="processing",onCheckedChange:(s)=>{if(!s)ve();else R(!0)}})]}),ee&&oe==="processing"&&o("div",{className:"flex items-center gap-2 text-xs text-amber-600 dark:text-amber-400 font-medium py-1 animate-pulse",children:[t(F,{className:"h-3.5 w-3.5 animate-spin"}),t("span",{children:uI()})]}),ee&&oe!=="processing"&&t(E,{variant:"outline",size:"sm",className:"w-full text-xs gap-1.5 mt-1",onClick:()=>R(!0),children:Ky()})]})]})}),t(Oe,{title:_f(),icon:t(Hl,{className:"h-4 w-4"}),children:o("div",{className:"p-3 space-y-3 pt-2 flex gap-2",children:[o(E,{variant:N==="card"?"secondary":"outline",size:"sm",className:"flex-1 gap-2 text-xs",onClick:()=>x("card"),children:[t(to,{className:"h-4 w-4"}),yv()]}),o(E,{variant:N==="list"?"secondary":"outline",size:"sm",className:"flex-1 gap-2 text-xs",onClick:()=>x("list"),children:[t(Po,{className:"h-4 w-4"}),Vv()]})]})}),t(Oe,{title:Ri(),icon:t(ct,{className:"h-4 w-4"}),children:t("div",{className:"p-3 space-y-3 pt-2",children:te?.map((s)=>o("div",{className:"flex items-center justify-between",children:[t(Q,{className:"text-xs",children:s.config?.name}),t(je,{checked:a.fieldVisibility?.[s.id]??!1,onCheckedChange:()=>De(s.id)})]},s.id))})}),t(Oe,{title:Cl(),icon:t(Ol,{className:"h-4 w-4"}),children:o("div",{className:"p-3 space-y-4 pt-2",children:[o("div",{className:"space-y-2",children:[t(Q,{className:"text-xs text-muted-foreground",children:Pf()}),o(Fe,{value:T,onValueChange:(s)=>{if(s==="index")C(null);else C(`${s}:${G}`)},children:[t(Ze,{className:"w-full text-xs h-9",children:t(Le,{})}),o(Be,{children:[t(ne,{value:"index",children:Cp()}),t(ne,{value:"name",children:Il()}),t(ne,{value:"createdAt",children:Ip()}),t(ne,{value:"size",children:Mp()})]})]})]}),o("div",{className:"space-y-2",children:[t(Q,{className:"text-xs text-muted-foreground",children:op()}),o(E,{variant:"outline",className:"w-full justify-between font-normal text-xs h-9",disabled:T==="index",onClick:()=>{C(`${T}:${G==="asc"?"desc":"asc"}`)},children:[t("span",{children:T==="name"?G==="asc"?zc():Hc():T==="createdAt"?G==="asc"?qc():jc():T==="size"?G==="asc"?kp():Tp():G==="asc"?yf():Tf()}),t(Xc,{className:"h-4 w-4 opacity-50"})]})]})]})})]})]})}),o("div",{className:"p-4 border-t border-border space-y-2",children:[o(E,{variant:"outline",className:"w-full justify-center",onClick:()=>window.open(re,"_blank"),children:[t(Pl,{className:"h-4 w-4 mr-2"}),qx()]}),o(E,{className:"w-full justify-center bg-blue-600 hover:bg-blue-700 text-white",onClick:()=>se(re),children:[t(Rr,{className:"h-4 w-4 mr-2"}),H_()]})]}),t(pt,{open:g,onOpenChange:R,initialConfig:fe,shareId:a.id,onSaveSuccess:()=>{Ie(),v.invalidateQueries({queryKey:["share",a.id]}),v.invalidateQueries({queryKey:["shares",a.projectId]})}})]})}function Oe({title:a,icon:N,children:x}){let[p,C]=u(!1);return o("div",{className:"border-b border-border last:border-0",children:[o("button",{onClick:()=>C(!p),className:"w-full flex items-center justify-between py-3 px-2 hover:bg-muted/50 transition-colors",children:[o("div",{className:"flex items-center gap-3",children:[N,t("span",{className:"text-sm font-medium",children:a})]}),t(bt,{className:Mt("h-4 w-4 transition-transform",p&&"rotate-90")})]}),p&&x&&t("div",{className:"animate-in fade-in slide-in-from-top-1 duration-200",children:x})]})}function Mt(...a){return a.filter(Boolean).join(" ")}function ot({teamId:a,projectId:N,projectName:x,shareId:p,rootFolderId:C}){let v=K(),{fetchMetadata:q}=hr();h(()=>{if(a)q(a)},[a,q]);let{data:d}=L({queryKey:["share",p],queryFn:async()=>{let r=await A.api.shares[":shareId"].$get({param:{shareId:p}});if(!r.ok)throw Error(vb());return await r.json()}}),w=d?.rootFolderId,[c,g]=u(null),[R,V]=u([]);h(()=>{if(w)g(w),V([]),O(new Set)},[w,p]);let _=on((r)=>r.setProjectState),xe=on((r)=>r.clearProjectState),be=(r)=>{if(r===c)return;if(r===w)g(w),V([]);else{let m=R.findIndex((f)=>f.id===r);if(m!==-1)g(r),V(R.slice(m+1))}O(new Set)},[ye,Ie]=u(240),[J,ve]=u(360),{shareConfigLeftSidebarCollapsed:oe,shareConfigRightSidebarCollapsed:fe}=$t(),ee=d?.defaultSortOrder||null,te,ae;if(ee){let r=ee.split(":");te=r[0],ae=r[1]}let M=d?.viewMode??"card",{data:re,fetchNextPage:se,hasNextPage:De,isFetchingNextPage:T,isLoading:G}=ft({queryKey:["folder-children",a,c,"folder",te,ae],queryFn:async({pageParam:r})=>{let m=await A.api.folders[":folderId"].children.$get({param:{folderId:c},query:{assetType:"folder",after:r,sort:te,order:ae}});if(!m.ok)throw Error(bb());return await m.json()},enabled:!!c,initialPageParam:"",getNextPageParam:(r)=>r.pageInfo?.cursor||void 0}),{data:s,fetchNextPage:X,hasNextPage:Se,isFetchingNextPage:Ke,isLoading:Pe}=ft({queryKey:["folder-children",a,c,"file",te,ae],queryFn:async({pageParam:r})=>{let m=await A.api.folders[":folderId"].children.$get({param:{folderId:c},query:{assetType:"file",after:r,sort:te,order:ae}});if(!m.ok)throw Error(yb());return await m.json()},enabled:!!c,initialPageParam:"",getNextPageParam:(r)=>r.pageInfo?.cursor||void 0}),Y=D(()=>re?.pages.flatMap((r)=>r.data??[])??[],[re]),Me=D(()=>s?.pages.flatMap((r)=>r.data??[])??[],[s]);h(()=>{if(d)_({teamId:a,projectId:N,projectName:x,ancestorFolders:R,currentAsset:{name:c===w?d.name:Y.find((r)=>r.id===c)?.name||d.name,type:"folder"},isRootFolder:!1,shareId:p,onFolderClick:be});return()=>xe()},[a,N,x,R,c,w,d,p,Y,_,xe]);let[de,Ce]=u(null),[Te,O]=u(new Set),Ee=()=>{O(new Set),Ce(null)},{dragState:_e,handleDragStart:Qe,handleDragEnd:Ve}=Zl({teamId:a,projectId:N,assetId:c||"",folders:Y,files:Me,selectedIds:Te,onClearSelection:Ee}),He=A.api.shares[":shareId"].assets[":assetId"].$delete,{mutate:Xe}=B({mutationFn:async(r)=>{if(!(await He({param:{shareId:p,assetId:r}})).ok)throw Error(wb())},onSuccess:()=>{v.invalidateQueries({queryKey:["folder-children",a,c]}),k.success(PE())}}),Ye=A.api.shares[":shareId"].$put,{mutate:ze}=B({mutationFn:async(r)=>{let m=await Ye({param:{shareId:p},json:r});if(!m.ok)throw Error(ma());return await m.json()},onSuccess:()=>{v.invalidateQueries({queryKey:["share",p]}),k.success(zg())}}),Je=(r)=>{if(r.type==="folder"||r.targetType==="folder"){let m=c===w?d?.name||"":Y.find((f)=>f.id===c)?.name||gn();V((f)=>[{id:c,name:m},...f]),g(r.id),O(new Set)}};if(!d)return t("div",{children:gd()});return o($n,{modifiers:[ai.configure({anchor:{x:0,y:0}})],sensors:[An.configure({activationConstraints:[new Nr.Distance({value:10})]})],onDragStart:Qe,onDragEnd:Ve,children:[t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{className:"flex flex-1 overflow-hidden relative",children:[!oe&&o(Z,{children:[t("div",{className:"bg-background",style:{width:ye},children:t(yr,{teamId:a,projectId:N,projectName:x,rootFolderId:C,dragState:_e})}),t(Er,{onResize:(r)=>Ie((m)=>Math.max(180,Math.min(400,m+r)))})]}),t(wa,{teamId:a,projectId:N,assetId:c||"",folders:Y,files:Me,selectedItem:de,selectedIds:Te,onItemSelect:(r,m)=>{if(m.metaKey||m.ctrlKey){let f=new Set(Te);if(f.has(r.id)){if(f.delete(r.id),O(f),de?.id===r.id){let i=[...Y,...Me].find((We)=>f.has(We.id));Ce(i||null)}}else f.add(r.id),O(f),Ce(r)}else O(new Set([r.id])),Ce(r)},onItemDoubleClick:Je,onSaveField:()=>{},displayStyle:M,onClearSelection:Ee,fetchNextFoldersPage:se,hasNextFoldersPage:De,isFetchingNextFoldersPage:T,fetchNextFilesPage:X,hasNextFilesPage:Se,isFetchingNextFilesPage:Ke,isLoading:G||Pe,filterConditions:[],onFilterChange:()=>{},dragState:_e,isShareView:!0,onRemoveFromShare:(r)=>{r.forEach((m)=>Xe(m.id))},fieldVisibility:d.fieldVisibility}),!fe&&o(Z,{children:[t(Er,{onResize:(r)=>ve((m)=>Math.max(240,Math.min(600,m-r)))}),t("div",{style:{width:J},className:"flex-shrink-0 h-full",children:t(gt,{shareLink:d,viewMode:M,onViewModeChange:(r)=>ze({viewMode:r}),defaultSortOrder:ee,onSortOrderChange:(r)=>ze({defaultSortOrder:r})})})]})]})}),t(Gc,{children:_e?.isActive?t("div",{className:"flex items-center gap-2 rounded-md bg-popover px-3 py-2 text-sm font-medium shadow-md",children:Kw({count:_e.itemCount})}):null})]})}S();function Tt(){let{projectId:a,shareId:N}=jt.useParams(),{teamId:x,ensureTeamIdForProject:p}=lt();h(()=>{p(a)},[a,p]);let{data:C}=tr(Yp(a)),v=C?.rootFolder,{data:q}=L({queryKey:["folders",v],queryFn:async()=>{let d=await A.api.folders[":folderId"].$get({param:{folderId:v}});if(!d.ok)throw Error("Failed to fetch folder");return await d.json()},enabled:!!v});if(!x||!v||!q)return t(wt,{});return t(ot,{teamId:x,projectId:a,projectName:C.name??"",shareId:N,rootFolderId:v})}var jt=Ue("/projects/$projectId/shares/$shareId")({component:Tt});export{jt as Route};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Wi}from"./chunk-afnzb9ne.js";export default Wi();
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-dbw8c1jj.js";import{af,vI}from"./chunk-t7bvde99.js";export{af as createKyselyAdapter,vI as kyselyAdapter};
@@ -1,3 +0,0 @@
1
- // @bun
2
- function os(_){if(_===void 0)return;let n=Array.from(_);if(n.length<=64)return _;return n.slice(0,64).join("")}
3
- export{os};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ef}from"./chunk-kg8eg9z3.js";export default ef();
@@ -1 +0,0 @@
1
- import{h,S,t,L,Ue,A,lt,wt,Qp}from"./chunk-jh8q3885.js";import"./chunk-ey3h4sct.js";import"./chunk-k6avge95.js";import"./chunk-qs7855cz.js";import"./chunk-ehpfg3km.js";import{Zi}from"./chunk-z08bqvkc.js";import"./chunk-kmbjp5kp.js";import"./chunk-y20sbaz5.js";import{tr}from"./chunk-2z1pnt7h.js";import"./chunk-d7fwggt6.js";import"./chunk-gqr5hxhj.js";import"./chunk-rsd164d9.js";import"./chunk-rmzcarv9.js";S();function l(){let{projectId:e}=p.useParams(),{teamId:r,ensureTeamIdForProject:i}=lt();h(()=>{i(e)},[e,i]);let{data:a}=tr(Qp(e)),o=a?.rootFolder,{data:d}=L({queryKey:["folders",o],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:o}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!o});if(!r||!o||!d)return t(wt,{});return t(Zi,{teamId:r,projectId:e,projectName:a.name??"",assetId:o,rootFolderId:o,isRoot:!0})}var p=Ue("/projects/$projectId/agentsmd")({component:l});export{p as Route};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{tf,Pn,ic,lc,cc,uc,Au,_u,am,mA,xs,zo,zr}from"./chunk-9d0thqcy.js";export{cc as EncryptJWT,lc as SignJWT,am as UnsecuredJWT,tf as base64url,uc as calculateJwkThumbprint,Au as createLocalJWKSet,_u as createRemoteJWKSet,zr as decodeJwt,zo as decodeProtectedHeader,xs as importJWK,mA as importPKCS8,ic as jwtDecrypt,Pn as jwtVerify};
@@ -1 +0,0 @@
1
- import{h,b,u,S,Z,t,o,K,Si,L,B,Me,Un,Ue,A,F,Xt,C,E,Ne,it,Fc,Lc,Fy,ud,ki,Nb,bh,Oo,OE,Fo,Je,Xe,et,tt,rt,nt,ot,st,ue,ie,me,Ge,le,H,lt,Nt,k,on,Ur,$t,ir,hr,Lo,uA}from"./chunk-jh8q3885.js";import{Jo,Ul,es,_s}from"./chunk-07jszkhj.js";import"./chunk-w1wxzqqb.js";import{Wr}from"./chunk-ey3h4sct.js";import"./chunk-k6avge95.js";import{va}from"./chunk-qs7855cz.js";import{Fl,Ll}from"./chunk-161rxeq2.js";import"./chunk-3tg39jx7.js";import{xa}from"./chunk-ysv80zyb.js";import{Er}from"./chunk-ehpfg3km.js";import"./chunk-rsd164d9.js";import"./chunk-tgr86ac4.js";import"./chunk-2jrjwaqr.js";import"./chunk-6y4xkcte.js";import"./chunk-3d5rm1d1.js";S();var kt=({item:n})=>{if(n.preview?.thumbnailUrl)return t("img",{src:n.preview.thumbnailUrl,alt:"Preview",className:"w-full h-full object-cover"});if(n.preview?.proxyType==="audio"||n.proxyType==="audio")return t("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:t(Jo,{className:"w-5 h-5 text-muted-foreground"})});return t("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:t(Xt,{className:"w-5 h-5 text-muted-foreground"})})},Te=({projectId:n,currentAssetId:s,parentFolderId:w,initialFiles:d,initialNextCursor:D})=>{let{ref:a,inView:N}=Nt({threshold:0,rootMargin:"200px"}),x=b(null),V=b(!0),[c,p]=u(d),[f,U]=u(D),[W,Y]=u(!!D),[q,g]=u(!1);return h(()=>{p(d),U(D),Y(!!D),V.current=!0},[d,D]),h(()=>{(async()=>{if(!f||q||!N||!W)return;g(!0);try{let y=await A.api.folders[":folderId"].search.$post({param:{folderId:w},json:{assetType:"file",after:f,first:200,recursively:!1,conditions:[]}});if(!y.ok)throw Error("Failed to fetch next page");let P=await y.json(),X=P.data||[];p((G)=>[...G,...X]),U(P.pageInfo?.cursor||void 0),Y(!!P.pageInfo?.cursor&&X.length>0)}catch(y){console.error("Error fetching next page:",y)}finally{g(!1)}})()},[N,f,W,q,w]),h(()=>{if(c.some((y)=>y?.id===s)&&x.current)if(V.current)x.current.scrollIntoView({block:"center",inline:"center",behavior:"auto"}),V.current=!1;else x.current.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[c,s]),t("div",{className:"h-24 md:h-full w-full md:w-24 bg-gray-100 dark:bg-gray-950 flex flex-row md:flex-col flex-shrink-0 select-none",children:o("div",{className:"flex-1 overflow-x-auto overflow-y-hidden md:overflow-y-auto md:overflow-x-hidden px-4 md:px-0 py-2 md:py-4 flex flex-row md:flex-col items-center gap-3 no-scrollbar",children:[c.map((m)=>{if(!m)return null;let y=m.id===s;return t("div",{ref:m.id===s?x:null,className:"flex-shrink-0",children:o(Un,{to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:m.id},search:{version:void 0},className:C("rounded-lg border overflow-hidden flex items-center justify-center transition-all bg-muted/30 block relative",y?"w-[62px] h-[62px] opacity-100":"w-[52px] h-[52px] opacity-60 hover:opacity-100"),children:[t(kt,{item:m}),m.agent&&t("span",{className:"absolute top-1 right-1 z-10 pointer-events-none select-none rounded bg-black/60 px-1 py-0.5 text-[10px] font-medium leading-none text-white",title:m.agent.name,"data-testid":"carousel-agent-badge",children:"AI"})]})},m.id)}),W&&t("div",{ref:a,className:"px-2 md:px-0 py-2 md:py-4 flex justify-center items-center h-full md:w-full flex-shrink-0",children:q&&t(F,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})})};S();function At(){let{projectId:n,fileId:s}=$e.useParams(),w=$e.useSearch(),{version:d,start:D}=w,a=d||s,{cmpLeft:N,cmpRight:x}=w,V=w.cmpActive??"left",c=!!w.compare&&!!N&&!!x,p=b(null),{teamId:f,ensureTeamIdForProject:U}=lt(),[W,Y]=u(360),[q,g]=u([]),{fileViewRightSidebarCollapsed:m}=$t(),{isChatbotOpen:y}=ir(),P=hr((e)=>Boolean(e.metadata["appearance.hideAgent"])),[X,G]=u(0),[he,z]=u(null),[ge,Le]=u(null),[Ee,ye]=u(void 0),[_,ne]=u({show:!1,files:[],nextCursor:void 0,folderId:void 0}),Ve=A.api.files[":fileId"].metadata.$patch,{mutate:qe}=B({mutationFn:async(e)=>{let r=await Ve(e);if(!r.ok)throw Error("Failed to patch metadata");return await r.json()}}),J=K(),{members:Pe,fetchProjectMembers:Ie}=Ur(),ze=Lo();h(()=>{U(n)},[n,U]),h(()=>{if(n)Ie(n,!0)},[n,Ie]),h(()=>{if(n&&s)A.api.projects[":projectId"].recents.view.$post({param:{projectId:n},json:{assetId:s}}).catch(()=>{})},[n,s]);let{data:ve,isLoading:_e,isError:Ke,isFetching:Oe}=L({queryKey:["files",s],queryFn:async()=>{let e=await A.api.files[":fileId"].$get({param:{fileId:s}});if(!e.ok)throw Error("Failed to fetch stack");return await e.json()},enabled:!!f,placeholderData:Si}),{data:He,isLoading:Qe,isError:Be,isFetching:We}=L({queryKey:["files",d],queryFn:async()=>{let e=await A.api.files[":fileId"].$get({param:{fileId:d}});if(!e.ok)throw Error("Failed to fetch version");return await e.json()},enabled:!!f&&!!d,placeholderData:Si}),{data:Ye}=L({queryKey:["version_stacks",s,"versions"],queryFn:async()=>{let e=await A.api.version_stacks[":stackId"].versions.$get({param:{stackId:s}});if(!e.ok)throw Error("Failed to fetch versions");return await e.json()},enabled:!!n&&!!s&&(!!d||c)}),{data:R}=L({queryKey:["projects",n],queryFn:async()=>{let e=await A.api.projects[":projectId"].$get({param:{projectId:n}});if(!e.ok)throw Error("Failed to fetch project");return await e.json()}}),I=Me(),{setProjectState:we,clearProjectState:xe}=on(),Ze=_e||!!d&&Qe,at=Ke||!!d&&Be,ct=Oe||!!d&&We,i=He||ve,j=d?Ye:ve?.versionStack?.versions,l=i?.ancestorFolders?.[0]?.id??R?.rootFolder??"",[re,ee]=u(!1),[te,be]=u(""),se=b(null),ae=b(!1),[dt,ce]=u(!1),ft=A.api.files[":fileId"].$put,{mutate:pt,mutateAsync:ut,isPending:Fe}=B({mutationFn:async(e)=>{let r=await ft(e);if(!r.ok)throw Error("Failed to rename file");return await r.json()},onSuccess:()=>{J.invalidateQueries({queryKey:["files"]}),J.invalidateQueries({queryKey:["version_stacks"]}),k.success(OE?.()||"Renamed successfully"),ee(!1)},onError:()=>{k.error(Nb?.()||"Failed to rename")}}),mt=A.api.files.$delete,{mutate:ht,mutateAsync:gt,isPending:ke}=B({mutationFn:async(e)=>{if(!(await mt(e)).ok)throw Error("Failed to delete file")},onSuccess:()=>{if(J.invalidateQueries({queryKey:["files"]}),J.invalidateQueries({queryKey:["version_stacks"]}),k.success(Fy?.()||"Deleted"),ce(!1),l&&l!==R?.rootFolder)I({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:l}});else I({to:"/projects/$projectId",params:{projectId:n}})},onError:()=>{k.error(ki?.()||"Failed to delete")}}),yt=(e)=>{if(e?.preventDefault(),!te.trim()||!a)return;pt({param:{fileId:a},json:{name:te.trim()}})},It=()=>{if(!a)return;ht({json:{ids:[a]}})};h(()=>{if(i&&R&&f)we({teamId:f,projectId:n,projectName:R.name??"",ancestorFolders:i.ancestorFolders??[],currentAsset:{id:a||s,name:i.name,type:"file",version:j?j.find((e)=>e.id===a)?.version??j.length:void 0,proxyType:i.proxyType},isRootFolder:!1,fileId:s,downloadInfo:{originalKey:i.media?.original?.key,videoTranscodes:i.media?.videoTranscodes?.map((e)=>({key:e.key,width:e.width,height:e.height}))},versions:j,compareMode:c,canCompareVersions:(j?.length??0)>=2,onCompareVersions:()=>{let e=Ul(j);if(!e)return;I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,version:void 0,compare:!0,cmpLeft:e.left.id,cmpRight:e.right.id,cmpActive:"left"})})},onFolderClick:(e)=>{I({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:e}})},onRename:()=>{ae.current=!1,be(i?.name??""),ee(!0)},onDelete:()=>{ce(!0)}});return()=>xe()},[f,n,R,i,j,a,s,c,we,xe,I]),h(()=>{if(!re)return;let e=setTimeout(()=>{ae.current=!0},1000);return()=>clearTimeout(e)},[re]);let vt=()=>{if(ae.current)return;setTimeout(()=>{if(se.current)_s(se.current)},0)};if(h(()=>{if(!l||!a)return;if(_.folderId===l)return;let e=!0;return(async()=>{try{let v="",T=!1,M=[],fe=void 0;for(let De=0;De<5;De++){let Se=await A.api.folders[":folderId"].search.$post({param:{folderId:l},json:{assetType:"file",after:v,first:200,recursively:!1,conditions:[]}});if(!Se.ok)throw Error("Failed to search parent folder for carousel");let Q=await Se.json(),pe=Q.data||[];if(M.push(...pe),pe.some((oe)=>oe.id===a)){if(T=!0,fe=Q.pageInfo?.cursor||void 0,Q.pageInfo?.cursor)try{let oe=await A.api.folders[":folderId"].search.$post({param:{folderId:l},json:{assetType:"file",after:Q.pageInfo.cursor,first:200,recursively:!1,conditions:[]}});if(oe.ok){let Re=await oe.json(),Ft=Re.data||[];M.push(...Ft),fe=Re.pageInfo?.cursor||void 0}}catch{}break}if(!Q.pageInfo?.cursor||pe.length<200)break;v=Q.pageInfo.cursor}if(e)if(T)ne({show:!0,files:M,nextCursor:fe,folderId:l});else ne({show:!1,files:[],nextCursor:void 0,folderId:l})}catch(v){if(console.error(v),e)ne({show:!1,files:[],nextCursor:void 0,folderId:l})}})(),()=>{e=!1}},[l,a,_.folderId]),h(()=>{G(0),z(null),g([])},[i?.id]),h(()=>{z(null),g([])},[ge?.id]),h(()=>{Wr.getState().reset(),Wr.getState().setIsDrawing(!1),g([]),z(null)},[a]),Ze&&!i)return t(uA,{});if(at||!i||!R||!f)return t("div",{children:bh()});let O=c?ge:i,Ae=O?.id??a,je=(e,r)=>{if(!f)return;qe({param:{fileId:Ae},json:[{key:e,value:r}]},{onSuccess:()=>{J.invalidateQueries({queryKey:["files",Ae]})}})},de=(e)=>{I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,...e})})},wt=()=>{de({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:V==="left"?N:x})},xt=(e)=>{z(e.id||null);let r=e.annotations;if(r&&r.length>0)g(r);else g([]);if(c){if(e.second!==null&&e.second!==void 0)ye({second:e.second,nonce:Date.now()});return}if(e.second!==null&&e.second!==void 0)p.current?.seekTo(e.second),p.current?.pause();else if(r&&r.length>0)p.current?.pause()},bt=(e)=>{z(e.id||null);let v=e.details,T=v?.annotations;if(T&&T.length>0)g(T);else g([]);let M=v?.position?.type==="time"?v.position.seconds:v?.position?.type==="page"?v.position.page:void 0;if(c){if(M!==void 0)ye({second:M,nonce:Date.now()});return}if(M!==void 0)p.current?.seekTo(M),p.current?.pause();else if(T&&T.length>0)p.current?.pause()},Ce=()=>{g([]),z(null)};if(ze&&!c)return t(Fl,{projectId:n,teamId:f,fileId:s,file:i,projectInfo:R,ancestorFolders:i.ancestorFolders??[],parentFolderId:l,versions:j,activeFileId:a,startTime:D,siblingFiles:_.files,onNavigateToFile:(e)=>{I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:e}})},onNavigateBack:()=>{if(l&&l!==R?.rootFolder)I({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:l}});else I({to:"/projects/$projectId",params:{projectId:n}})},onSelectVersion:(e)=>{I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,version:e})})},onRenameFile:async(e)=>{await ut({param:{fileId:a},json:{name:e}})},onDeleteFile:async()=>{await gt({json:{ids:[a]}})},onSaveField:je});return o("div",{className:"h-full flex flex-1 flex-col bg-background",children:[o("div",{className:"h-full flex flex-1 overflow-hidden",children:[o("div",{className:"flex-1 relative",children:[ct&&!c&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:t(F,{className:"h-8 w-8 animate-spin text-foreground"})}),c&&N&&x?t(Ll,{versions:j??[],leftId:N,rightId:x,activeSide:V,annotations:q,seekRequest:Ee,onActiveSideChange:(e)=>de({cmpActive:e}),onSwitchVersion:(e,r)=>de(e==="left"?{cmpLeft:r}:{cmpRight:r}),onExit:wt,onActiveAssetChange:Le,onPlay:Ce,onTimeUpdate:G}):t(es,{file:i,mediaControllerRef:p,onPlay:Ce,onTimeUpdate:G,annotations:q,startTime:D,children:_.show&&t(Te,{projectId:n,currentAssetId:a,parentFolderId:l,initialFiles:_.files,initialNextCursor:_.nextCursor})})]}),(!m||y&&!P)&&o(Z,{children:[t(Er,{onResize:(e)=>{Y((r)=>Math.max(300,Math.min(600,r-e)))},className:"hidden md:block"}),t("div",{style:{width:W},className:"flex-shrink-0 bg-background flex flex-col",children:y&&!P?t(va,{projectId:n,contextAssetId:a,file:O,currentTime:X,frameRate:O?.media?.metadata?.frameRate||30,startTimecode:O?.media?.metadata?.startTimecode,onTyping:()=>{if(c)return;p.current?.pause()},onSelectMessage:bt,selectedMessageId:he}):t(xa,{teamId:f,projectId:n,file:O,onSaveField:je,members:Pe,onCommentSelect:xt,currentTime:X,onTyping:()=>{if(c)return;p.current?.pause()},selectedCommentId:he,hideAnnotationControl:O?.proxyType==="audio"})})]})]}),t(ue,{open:re,onOpenChange:ee,children:t(ie,{children:o("form",{onSubmit:yt,children:[t(me,{children:t(le,{children:Oo()})}),t("div",{className:"py-4",children:t(H,{ref:se,value:te,onChange:(e)=>be(e.target.value),placeholder:ud?.()||"Enter new name",onFocus:vt,autoFocus:!0})}),o(Ge,{children:[t(E,{type:"button",variant:"outline",onClick:()=>ee(!1),children:Ne()}),o(E,{type:"submit",disabled:Fe||!te.trim(),children:[Fe&&t(F,{className:"mr-2 h-4 w-4 animate-spin"}),Fo()]})]})]})})}),t(Je,{open:dt,onOpenChange:ce,children:o(Xe,{children:[o(et,{children:[t(rt,{children:Lc?.()||"Delete Asset?"}),t(nt,{children:Fc?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),o(tt,{children:[t(st,{children:Ne()}),o(ot,{onClick:It,disabled:ke,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[ke&&t(F,{className:"mr-2 h-4 w-4 animate-spin"}),it()]})]})]})})]})}var $e=Ue("/projects/$projectId/files/$fileId")({component:At});export{$e as Route};
@@ -1 +0,0 @@
1
- import{t,Ue}from"./chunk-jh8q3885.js";import"./chunk-t8gv2ekj.js";import"./chunk-07jszkhj.js";import"./chunk-w1wxzqqb.js";import"./chunk-ey3h4sct.js";import"./chunk-vzj2j11x.js";import"./chunk-h9mka9br.js";import"./chunk-3tg39jx7.js";import"./chunk-ysv80zyb.js";import"./chunk-k6avge95.js";import"./chunk-161rxeq2.js";import"./chunk-ehpfg3km.js";import{ba}from"./chunk-1kt5dzjv.js";import"./chunk-d7fwggt6.js";import"./chunk-tgr86ac4.js";import"./chunk-2jrjwaqr.js";import"./chunk-rmzcarv9.js";import"./chunk-yfr0hzb7.js";import"./chunk-6y4xkcte.js";import"./chunk-3d5rm1d1.js";function a(){let{shareId:e}=s.useParams();return t(ba,{shareId:e})}var s=Ue("/share/$shareId/")({component:a});export{s as Route};
@@ -1 +0,0 @@
1
- import{h,S,t,L,B,Ue,A,kh,lt,Xp,pA}from"./chunk-jh8q3885.js";import"./chunk-07jszkhj.js";import"./chunk-t8gv2ekj.js";import"./chunk-w1wxzqqb.js";import"./chunk-ey3h4sct.js";import"./chunk-k6avge95.js";import"./chunk-qs7855cz.js";import"./chunk-2yr5k567.js";import"./chunk-vzj2j11x.js";import"./chunk-h9mka9br.js";import"./chunk-3tg39jx7.js";import"./chunk-ysv80zyb.js";import"./chunk-ehpfg3km.js";import{Gn}from"./chunk-edqd8evk.js";import{tr}from"./chunk-2z1pnt7h.js";import"./chunk-d7fwggt6.js";import"./chunk-rsd164d9.js";import"./chunk-tgr86ac4.js";import"./chunk-2jrjwaqr.js";import"./chunk-rmzcarv9.js";import"./chunk-yfr0hzb7.js";import"./chunk-6y4xkcte.js";import"./chunk-3d5rm1d1.js";S();function u(){let{projectId:o,collectionId:r}=y.useParams(),{teamId:s,ensureTeamIdForProject:i}=lt();h(()=>{i(o)},[o,i]);let{data:l}=tr(Xp(o)),{data:a,refetch:d}=L({...pA(r)}),{mutate:p}=B({mutationFn:async(n)=>{let c=await A.api.collections[":collectionId"].$patch({param:{collectionId:r},json:n});if(!c.ok)throw Error("Failed to update collection");return await c.json()},onSuccess:()=>{d()}}),e=l?.rootFolder,{data:f}=L({queryKey:["folders",e],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:e}});if(!n.ok)throw Error("Failed to fetch folder");return await n.json()},enabled:!!e});if(!s||!e||!f||!a)return t("div",{children:kh()});let m=a.filter.sourceFolderId||e;return t(Gn,{teamId:s,projectId:o,projectName:l.name??"",assetId:m,rootFolderId:e,collection:a,onUpdateCollection:p})}var y=Ue("/projects/$projectId/collections/$collectionId")({component:u});export{y as Route};
@@ -1 +0,0 @@
1
- import{h,S,t,L,Ue,A,lt,wt,em}from"./chunk-jh8q3885.js";import"./chunk-ey3h4sct.js";import"./chunk-k6avge95.js";import"./chunk-qs7855cz.js";import"./chunk-ehpfg3km.js";import{Zi}from"./chunk-z08bqvkc.js";import"./chunk-kmbjp5kp.js";import"./chunk-y20sbaz5.js";import{tr}from"./chunk-2z1pnt7h.js";import"./chunk-d7fwggt6.js";import"./chunk-gqr5hxhj.js";import"./chunk-rsd164d9.js";import"./chunk-rmzcarv9.js";S();function p(){let{projectId:e,folderId:d}=s.useParams(),{teamId:r,ensureTeamIdForProject:i}=lt();h(()=>{i(e)},[e,i]);let{data:a}=tr(em(e)),o=a?.rootFolder,{data:l}=L({queryKey:["folders",o],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:o}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!o});if(!r||!o||!l)return t(wt,{});return t(Zi,{teamId:r,projectId:e,projectName:a.name??"",assetId:d,rootFolderId:o,isRoot:!1})}var s=Ue("/projects/$projectId/folders/$folderId_/agentsmd")({component:p});export{s as Route};