@shumai-one/shumai 0.4.8 → 0.5.0

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 (167) hide show
  1. package/bin/{chunk-qw76wcrb.js → chunk-03bfjh8k.js} +2 -2
  2. package/bin/{chunk-6xqpbkb6.js → chunk-0tf15vee.js} +2 -2
  3. package/bin/{chunk-e333evwr.js → chunk-0vtk7wrf.js} +2 -2
  4. package/bin/{chunk-b93qxjts.js → chunk-0yv0nnmh.js} +2 -2
  5. package/bin/{chunk-pg5mayjc.js → chunk-12npypek.js} +2 -2
  6. package/bin/chunk-13d525jm.js +2 -0
  7. package/bin/{chunk-qrmkkxjh.js → chunk-1k16xsqq.js} +10 -10
  8. package/bin/{chunk-dk2trprj.js → chunk-1yt1gsyy.js} +1 -1
  9. package/bin/{chunk-wqqdy0xb.js → chunk-20anqpf1.js} +2 -2
  10. package/bin/{chunk-tjhbr5ks.js → chunk-2g5qdx4s.js} +1 -1
  11. package/bin/{chunk-0b5s5ge0.js → chunk-31vx01aw.js} +2 -2
  12. package/bin/{chunk-tycap2k9.js → chunk-32japja5.js} +1 -1
  13. package/bin/chunk-35mpp84e.js +2 -0
  14. package/bin/{chunk-d9dmr2vc.js → chunk-36r20sj7.js} +1 -1
  15. package/bin/{chunk-67ewr4j4.js → chunk-3btc8a0p.js} +2 -2
  16. package/bin/{chunk-2y7y60pc.js → chunk-3cvbb6kh.js} +2 -2
  17. package/bin/chunk-3ewmtf1c.js +1 -0
  18. package/bin/chunk-3fjgf7eb.js +3 -0
  19. package/bin/chunk-3xw70yr4.js +2 -0
  20. package/bin/{chunk-1qk4e3j9.js → chunk-3z20b2hz.js} +2 -2
  21. package/bin/{chunk-hed37kyr.js → chunk-3zvvct3r.js} +1 -1
  22. package/bin/{chunk-1zpsbvq9.js → chunk-51h2bgpf.js} +3 -3
  23. package/bin/{chunk-5vvvgjvz.js → chunk-5bpvwv66.js} +2 -2
  24. package/bin/{chunk-4tpkx2ft.js → chunk-5jbx9gqe.js} +1 -1
  25. package/bin/{chunk-vfv27kve.js → chunk-5patxztz.js} +4 -4
  26. package/bin/chunk-5seey9ee.js +2 -0
  27. package/bin/{chunk-251rat7t.js → chunk-5t05jpna.js} +3 -3
  28. package/bin/{chunk-pbq64m5k.js → chunk-5yd9cv7f.js} +5 -5
  29. package/bin/chunk-66hdwm6f.js +2 -0
  30. package/bin/{chunk-mcq3pe4v.js → chunk-6bgbx563.js} +2 -2
  31. package/bin/{chunk-j3qz3wa3.js → chunk-6vvs18bw.js} +1 -1
  32. package/bin/chunk-756mr32b.js +2 -0
  33. package/bin/{chunk-fezar34g.js → chunk-7vd5yajk.js} +5 -5
  34. package/bin/chunk-7wb3dga5.js +2 -0
  35. package/bin/{chunk-tf3hke5h.js → chunk-9h6nn1a3.js} +1 -1
  36. package/bin/chunk-9k86d2a3.js +4 -0
  37. package/bin/chunk-9wk11jtz.js +1 -0
  38. package/bin/chunk-a1crhhzy.js +1 -0
  39. package/bin/chunk-axfwh5et.js +2 -0
  40. package/bin/{chunk-yeb5bcxz.js → chunk-b9j5575n.js} +2 -2
  41. package/bin/chunk-cgsxyw07.js +2 -0
  42. package/bin/{chunk-5pcv139g.js → chunk-cw8z9w5c.js} +2 -2
  43. package/bin/{chunk-4tm9cw4v.js → chunk-czny5thj.js} +2 -2
  44. package/bin/{chunk-jwhgybtg.js → chunk-d7mgjqf8.js} +1 -1
  45. package/bin/{chunk-jgnp68ez.js → chunk-d9btz95y.js} +1 -1
  46. package/bin/chunk-dckdnqc0.js +2 -0
  47. package/bin/chunk-dx0wz749.js +211 -0
  48. package/bin/{chunk-mn9ax7qa.js → chunk-dz33q4v1.js} +2 -2
  49. package/bin/chunk-dz4fdrmk.js +1 -0
  50. package/bin/{chunk-29wjvgwv.js → chunk-e3r1m6rb.js} +1 -1
  51. package/bin/chunk-edjtb7pk.js +2 -0
  52. package/bin/{chunk-j95fjg69.js → chunk-eez1yncf.js} +2 -2
  53. package/bin/{chunk-x33bf3ay.js → chunk-exgtwask.js} +1 -1
  54. package/bin/{chunk-ws216bmf.js → chunk-f22nrm6r.js} +4 -4
  55. package/bin/{chunk-xmn5v64e.js → chunk-fhq5m9ya.js} +2 -2
  56. package/bin/{chunk-gj3vrbkx.js → chunk-fyssg02c.js} +31 -31
  57. package/bin/{chunk-rzannb5e.js → chunk-g8h1e1kh.js} +2 -2
  58. package/bin/{chunk-qje7g7t7.js → chunk-ghjhyajn.js} +2 -2
  59. package/bin/{chunk-9v10mkts.js → chunk-gptzcgte.js} +1 -1
  60. package/bin/{chunk-r8ss8xm1.js → chunk-grsgkkrb.js} +5 -5
  61. package/bin/{chunk-dpn61sht.js → chunk-gy8z8sd7.js} +1 -1
  62. package/bin/{chunk-e3qxpswy.js → chunk-h153xefb.js} +1 -1
  63. package/bin/chunk-h82r29wm.js +129 -0
  64. package/bin/{chunk-ze3msq86.js → chunk-h9x81yp6.js} +1 -1
  65. package/bin/{chunk-b9p9yhky.js → chunk-hr2027z3.js} +8 -8
  66. package/bin/{chunk-7rvyq5gr.js → chunk-hx76pje1.js} +1 -1
  67. package/bin/chunk-hz9stgvn.js +1 -0
  68. package/bin/chunk-hzr8100w.js +3 -0
  69. package/bin/{chunk-4sq35ks7.js → chunk-j3xaq9s3.js} +2 -2
  70. package/bin/{chunk-pbmkewt5.js → chunk-j909v9p5.js} +1 -1
  71. package/bin/chunk-jb6d142z.js +1 -0
  72. package/bin/chunk-k9cgfzgk.js +3 -0
  73. package/bin/{chunk-zhx4vsgt.js → chunk-kgfa5y9w.js} +10 -10
  74. package/bin/{chunk-1ymyhrh2.js → chunk-kzsdp31a.js} +2 -2
  75. package/bin/{chunk-9ht2kr33.js → chunk-m1xc3t0p.js} +7 -7
  76. package/bin/{chunk-wdbew0hx.js → chunk-m7dp8rqv.js} +1 -1
  77. package/bin/{chunk-0jaj2807.js → chunk-m9sp00a9.js} +4 -4
  78. package/bin/{chunk-qn37fsy3.js → chunk-mcd7zas7.js} +2 -2
  79. package/bin/chunk-meyvvmgk.js +1 -0
  80. package/bin/{chunk-y4pe65d1.js → chunk-mqr096rn.js} +1 -1
  81. package/bin/{chunk-ybnykjsg.js → chunk-mt532a33.js} +1 -1
  82. package/bin/{chunk-twx715xf.js → chunk-myd3wg9a.js} +2 -2
  83. package/bin/chunk-n1b3pt17.js +14 -0
  84. package/bin/chunk-n5v48hz5.js +2 -0
  85. package/bin/{chunk-65ets3f0.js → chunk-p5v22g5n.js} +2 -2
  86. package/bin/chunk-phzemmmy.js +2 -0
  87. package/bin/{chunk-w53gqdnw.js → chunk-q5mkbnr9.js} +2 -2
  88. package/bin/chunk-qhzat67w.js +2 -0
  89. package/bin/{chunk-7nv7r7zx.js → chunk-r1m4q8vw.js} +1 -1
  90. package/bin/{chunk-jhxcm88f.js → chunk-r5rpdhed.js} +2 -2
  91. package/bin/{chunk-v6tjp5qt.js → chunk-r6gkv98n.js} +6 -6
  92. package/bin/{chunk-s26a26h3.js → chunk-rkq6jvhb.js} +3 -3
  93. package/bin/{chunk-drpdjxmw.js → chunk-rn9rktp4.js} +5 -5
  94. package/bin/{chunk-dscq4a4k.js → chunk-rq2h2bwt.js} +2 -2
  95. package/bin/{chunk-dp1mrw7m.js → chunk-sg7n2g3z.js} +1 -1
  96. package/bin/chunk-smcn7ep7.js +2 -0
  97. package/bin/{chunk-p706vjvr.js → chunk-tcat7q9p.js} +2 -2
  98. package/bin/chunk-tf8q7h6b.js +1 -0
  99. package/bin/{chunk-6t5r26bm.js → chunk-trndqdaa.js} +1 -1
  100. package/bin/chunk-tvr5rm1g.js +1 -0
  101. package/bin/chunk-ty88m3yg.js +2 -0
  102. package/bin/chunk-v2x9915x.js +1 -0
  103. package/bin/{chunk-fnca3xqw.js → chunk-v42jcex0.js} +4 -4
  104. package/bin/{chunk-pq3pyrvy.js → chunk-vbbn4hth.js} +1 -1
  105. package/bin/chunk-vnk2p7mq.css +1 -0
  106. package/bin/{chunk-r7e2fmmx.js → chunk-wkxm6yny.js} +2 -2
  107. package/bin/{chunk-t2sqtc9p.js → chunk-wydd7sz7.js} +2 -2
  108. package/bin/chunk-x8hky9td.js +1 -0
  109. package/bin/{chunk-frma9pgq.js → chunk-xvdd04gy.js} +1 -1
  110. package/bin/{chunk-ht64xpjp.js → chunk-y03z5rrg.js} +3 -3
  111. package/bin/chunk-y12ah7c6.js +1 -0
  112. package/bin/chunk-y7jz31ay.js +1 -0
  113. package/bin/chunk-ydk3edsw.js +1 -0
  114. package/bin/{chunk-6h76kqv2.js → chunk-yfe6hkzk.js} +3 -3
  115. package/bin/{chunk-afsm0ct9.js → chunk-z1r86fna.js} +2 -2
  116. package/bin/{chunk-bcjkapyp.js → chunk-z8mmqfm4.js} +1 -1
  117. package/bin/chunk-zbma2zeh.js +1 -0
  118. package/bin/{chunk-45mheqnm.js → chunk-zcrtr8qd.js} +2 -2
  119. package/bin/{chunk-czwpfv0w.js → chunk-zfqz72sd.js} +1 -1
  120. package/bin/{chunk-nradb5py.js → chunk-zhe16jvg.js} +1 -1
  121. package/bin/{chunk-75x3b8ds.js → chunk-zwb9kamp.js} +2 -2
  122. package/bin/shumai-app.html +1 -1
  123. package/bin/shumai-app.js +572 -321
  124. package/package.json +9 -8
  125. package/prisma/migrations/20260927092537_add_notification_email_status/migration.sql +11 -0
  126. package/prisma/migrations/20261001015042_migrate_video_strategy_multi_and_resolutions/migration.sql +16 -0
  127. package/prisma/migrations/20261002104921_add_asset_status_failed/migration.sql +2 -0
  128. package/prisma/schema.prisma +11 -0
  129. package/bin/chunk-07pgpftg.js +0 -14
  130. package/bin/chunk-1y7nvhgx.js +0 -3
  131. package/bin/chunk-2ftmxhr5.js +0 -2
  132. package/bin/chunk-2kxhdnma.js +0 -3
  133. package/bin/chunk-3rjdkmhb.js +0 -2
  134. package/bin/chunk-43dzhk24.js +0 -211
  135. package/bin/chunk-55n569j1.js +0 -1
  136. package/bin/chunk-6jaf9hxa.js +0 -1
  137. package/bin/chunk-6vst0k0k.js +0 -2
  138. package/bin/chunk-7hxd4st0.js +0 -1
  139. package/bin/chunk-9kb55e6b.js +0 -1
  140. package/bin/chunk-bbk5v964.js +0 -1
  141. package/bin/chunk-bcqhjbpy.js +0 -2
  142. package/bin/chunk-bxksbrcm.js +0 -1
  143. package/bin/chunk-c1a1srsw.js +0 -2
  144. package/bin/chunk-c7yxnyep.js +0 -1
  145. package/bin/chunk-da4fd4f8.js +0 -2
  146. package/bin/chunk-dmewtzbe.js +0 -1
  147. package/bin/chunk-faaqparg.js +0 -2
  148. package/bin/chunk-g82qnxw6.js +0 -2
  149. package/bin/chunk-gc6m7agb.js +0 -3
  150. package/bin/chunk-j6ptdqp9.js +0 -2
  151. package/bin/chunk-kdg245g7.js +0 -1
  152. package/bin/chunk-mg4p33eg.js +0 -2
  153. package/bin/chunk-mrdznst9.js +0 -1
  154. package/bin/chunk-msg8j3hj.css +0 -1
  155. package/bin/chunk-n4f1he1g.js +0 -4
  156. package/bin/chunk-nsvfcp3f.js +0 -1
  157. package/bin/chunk-nx782n1x.js +0 -2
  158. package/bin/chunk-p4hwyysm.js +0 -2
  159. package/bin/chunk-qw4v0qdg.js +0 -1
  160. package/bin/chunk-rvj965cr.js +0 -1
  161. package/bin/chunk-sf9ezxgy.js +0 -2
  162. package/bin/chunk-twwpbp8d.js +0 -2
  163. package/bin/chunk-v3yfee88.js +0 -2
  164. package/bin/chunk-vq24vj88.js +0 -1
  165. package/bin/chunk-x79scans.js +0 -299
  166. package/bin/chunk-xktxk53n.js +0 -1
  167. package/bin/chunk-yvz2b957.js +0 -2
@@ -1 +0,0 @@
1
- import{h,S,t,Z,Ue,A,lt,wt,Kp}from"./chunk-43dzhk24.js";import"./chunk-x79scans.js";import"./chunk-07pgpftg.js";import"./chunk-6vst0k0k.js";import"./chunk-yeb5bcxz.js";import"./chunk-5pcv139g.js";import"./chunk-0jaj2807.js";import"./chunk-xmn5v64e.js";import"./chunk-qn37fsy3.js";import"./chunk-yvz2b957.js";import"./chunk-bcqhjbpy.js";import"./chunk-1zpsbvq9.js";import"./chunk-6h76kqv2.js";import"./chunk-twx715xf.js";import{Gn}from"./chunk-dk2trprj.js";import{rr}from"./chunk-faaqparg.js";import"./chunk-rzannb5e.js";import"./chunk-j95fjg69.js";import"./chunk-sf9ezxgy.js";import"./chunk-67ewr4j4.js";import"./chunk-mcq3pe4v.js";import"./chunk-jgnp68ez.js";import"./chunk-4tm9cw4v.js";import"./chunk-jhxcm88f.js";S();function i(){let{projectId:o}=l.useParams(),{teamId:r,ensureTeamIdForProject:a}=lt();h(()=>{a(o)},[o,a]);let{data:n}=rr(Kp(o)),e=n?.rootFolder,{data:s}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!s)return t(wt,{});return t(Gn,{teamId:r,projectId:o,projectName:n.name??"",assetId:"recently-deleted",rootFolderId:e})}var l=Ue("/projects/$projectId/recently-deleted")({component:i});export{l as Route};
@@ -1 +0,0 @@
1
- import{h,S,t,Z,Ue,A,lt,wt,em}from"./chunk-43dzhk24.js";import"./chunk-x79scans.js";import"./chunk-07pgpftg.js";import"./chunk-6vst0k0k.js";import"./chunk-yeb5bcxz.js";import"./chunk-5pcv139g.js";import"./chunk-0jaj2807.js";import"./chunk-xmn5v64e.js";import"./chunk-qn37fsy3.js";import"./chunk-yvz2b957.js";import"./chunk-bcqhjbpy.js";import"./chunk-1zpsbvq9.js";import"./chunk-6h76kqv2.js";import"./chunk-twx715xf.js";import{Gn}from"./chunk-dk2trprj.js";import{rr}from"./chunk-faaqparg.js";import"./chunk-rzannb5e.js";import"./chunk-j95fjg69.js";import"./chunk-sf9ezxgy.js";import"./chunk-67ewr4j4.js";import"./chunk-mcq3pe4v.js";import"./chunk-jgnp68ez.js";import"./chunk-4tm9cw4v.js";import"./chunk-jhxcm88f.js";S();function l(){let{projectId:o,folderId:n}=c.useParams(),{teamId:r,ensureTeamIdForProject:a}=lt();h(()=>{a(o)},[o,a]);let{data:s}=rr(em(o)),e=s?.rootFolder,{data:i}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!i)return t(wt,{});return t(Gn,{teamId:r,projectId:o,projectName:s.name??"",assetId:n,rootFolderId:e})}var c=Ue("/projects/$projectId/folders/$folderId")({component:l});export{c as Route};
@@ -1,2 +0,0 @@
1
- import{O,h,D,b,u,S,L,t,o,C,pt,_e,Y,Ft,se,ua,da,Hn,pa,Tc}from"./chunk-43dzhk24.js";S();S();var De=Object.defineProperty,f=(a,e)=>De(a,"name",{value:e,configurable:!0}),ue=["PageUp","PageDown"],fe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],me={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},F="Slider",[J,Ve,Ie]=da(F),[Q,it]=pt(F,[Ie]),[Ae,U]=Q(F),Be=O(f(function(e,r){let{name:i,min:s=0,max:n=100,step:c=1,orientation:d="horizontal",disabled:m=!1,minStepsBetweenThumbs:g=0,defaultValue:v=[s],value:R,onValueChange:l=f(()=>{},"onValueChange"),onValueCommit:p=f(()=>{},"onValueCommit"),inverted:x=!1,form:w,...y}=e,T=b(new Set),_=b(0),E=b(!1),V=d==="horizontal"?Ke:ke,[B,te]=u(null),j=_e(r,te),[I=[],X]=Ft({prop:R,defaultProp:v,onChange:f((P)=>{[...T.current][_.current]?.focus({preventScroll:!0,focusVisible:E.current}),E.current=!1,l(P)},"onChange")}),ne=b(I),Ce=b(I);h(()=>{let P=w?B?.ownerDocument.getElementById(w):B?.closest("form");if(P instanceof HTMLFormElement){let A=f(()=>X(Ce.current),"reset");return P.addEventListener("reset",A),()=>P.removeEventListener("reset",A)}},[B,w,X]);function re(P){let A=we(I,P);k(P,A)}f(re,"handleSlideStart");function oe(P){k(P,_.current)}f(oe,"handleSlideMove");function ie(){if(String(I)!==String(ne.current))p(I)}f(ie,"handleSlideEnd");function k(P,A,{commit:ae}={commit:!1}){let le=ee(c),W=H(Math.round((P-s)/c)*c+s,le),z=pa(W,[s,n]);X((N=[])=>{let K=ve(N,z,A);if(ye(K,g*c)){_.current=K.indexOf(z);let ce=String(K)!==String(N);if(ce&&ae)p(K);return ce?K:N}else return N})}return f(k,"updateValues"),t(Ae,{scope:e.__scopeSlider,name:i,disabled:m,min:s,max:n,valueIndexToChangeRef:_,thumbs:T.current,values:I,orientation:d,form:w,children:t(J.Provider,{scope:e.__scopeSlider,children:t(J.Slot,{scope:e.__scopeSlider,children:t(V,{"aria-disabled":m,"data-disabled":m?"":void 0,...y,ref:j,onPointerDown:Y(y.onPointerDown,()=>{if(!m)ne.current=I,E.current=!1}),min:s,max:n,inverted:x,onSlideStart:m?void 0:re,onSlideMove:m?void 0:oe,onSlideEnd:m?void 0:ie,onHomeKeyDown:()=>{if(!m)E.current=!0,k(s,0,{commit:!0})},onEndKeyDown:()=>{if(!m)E.current=!0,k(n,I.length-1,{commit:!0})},onStepKeyDown:({event:P,direction:A})=>{if(!m){E.current=!0;let W=ue.includes(P.key)||P.shiftKey&&fe.includes(P.key)?10:1,z=_.current,N=I[z],K=Te(N,{min:s,step:c,direction:A,multiplier:W});k(K,z,{commit:!0})}}})})})})},"Slider")),[Se,he]=Q(F,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Ke=O(f(function(e,r){let{min:i,max:s,dir:n,inverted:c,onSlideStart:d,onSlideMove:m,onSlideEnd:g,onStepKeyDown:v,...R}=e,[l,p]=u(null),x=_e(r,p),w=b(void 0),y=Hn(n),T=y==="ltr",_=T&&!c||!T&&c;function E(M){let V=w.current||l.getBoundingClientRect(),B=[0,V.width],j=G(B,_?[i,s]:[s,i]);return w.current=V,j(M-V.left)}return f(E,"getValueFromPointer"),t(Se,{scope:e.__scopeSlider,startEdge:_?"left":"right",endEdge:_?"right":"left",direction:_?1:-1,size:"width",children:t(pe,{dir:y,"data-orientation":"horizontal",...R,ref:x,style:{...R.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:(M)=>{let V=E(M.clientX);d?.(V)},onSlideMove:(M)=>{let V=E(M.clientX);m?.(V)},onSlideEnd:()=>{w.current=void 0,g?.()},onStepKeyDown:(M)=>{let B=me[_?"from-left":"from-right"].includes(M.key);v?.({event:M,direction:B?-1:1})}})})},"SliderHorizontal")),ke=O(f(function(e,r){let{min:i,max:s,inverted:n,onSlideStart:c,onSlideMove:d,onSlideEnd:m,onStepKeyDown:g,...v}=e,R=b(null),l=_e(r,R),p=b(void 0),x=!n;function w(y){let T=p.current||R.current.getBoundingClientRect(),_=[0,T.height],M=G(_,x?[s,i]:[i,s]);return p.current=T,M(y-T.top)}return f(w,"getValueFromPointer"),t(Se,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:t(pe,{"data-orientation":"vertical",...v,ref:l,style:{...v.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:(y)=>{let T=w(y.clientY);c?.(T)},onSlideMove:(y)=>{let T=w(y.clientY);d?.(T)},onSlideEnd:()=>{p.current=void 0,m?.()},onStepKeyDown:(y)=>{let _=me[x?"from-bottom":"from-top"].includes(y.key);g?.({event:y,direction:_?-1:1})}})})},"SliderVertical")),pe=O(f(function(e,r){let{__scopeSlider:i,onSlideStart:s,onSlideMove:n,onSlideEnd:c,onHomeKeyDown:d,onEndKeyDown:m,onStepKeyDown:g,...v}=e,R=U(F,i);return t(se.span,{...v,ref:r,onKeyDown:Y(e.onKeyDown,(l)=>{if(l.key==="Home")d(l),l.preventDefault();else if(l.key==="End")m(l),l.preventDefault();else if(ue.concat(fe).includes(l.key))g(l),l.preventDefault()}),onPointerDown:Y(e.onPointerDown,(l)=>{let p=l.target;if(p.setPointerCapture(l.pointerId),l.preventDefault(),R.thumbs.has(p))p.focus({preventScroll:!0,focusVisible:!1});else s(l)}),onPointerMove:Y(e.onPointerMove,(l)=>{if(l.target.hasPointerCapture(l.pointerId))n(l)}),onPointerUp:Y(e.onPointerUp,(l)=>{let p=l.target;if(p.hasPointerCapture(l.pointerId))p.releasePointerCapture(l.pointerId),c(l)})})},"SliderImpl")),Ne="SliderTrack",ze=O(f(function(e,r){let{__scopeSlider:i,...s}=e,n=U(Ne,i);return t(se.span,{"data-disabled":n.disabled?"":void 0,"data-orientation":n.orientation,...s,ref:r})},"SliderTrack")),de="SliderRange",He=O(f(function(e,r){let{__scopeSlider:i,...s}=e,n=U(de,i),c=he(de,i),d=b(null),m=_e(r,d),g=n.values.length,v=n.values.map((p)=>Z(p,n.min,n.max)),R=g>1?Math.min(...v):0,l=100-Math.max(...v);return t(se.span,{"data-orientation":n.orientation,"data-disabled":n.disabled?"":void 0,...s,ref:m,style:{...e.style,[c.startEdge]:R+"%",[c.endEdge]:l+"%"}})},"SliderRange")),Fe="SliderThumb",[Le,ge]=Q(Fe),Oe="SliderThumbProvider";function be(a){let{__scopeSlider:e,name:r,children:i,internal_do_not_use_render:s}=a,n=U(Oe,e),c=Ve(e),[d,m]=u(null),g=D(()=>d?c().findIndex((y)=>y.ref.current===d):-1,[c,d]),v=ua(d),R=d?!!n.form||!!d.closest("form"):!0,l=n.values[g],p=r??(n.name?n.name+(n.values.length>1?"[]":""):void 0),x=l===void 0?0:Z(l,n.min,n.max);h(()=>{if(d)return n.thumbs.add(d),()=>{n.thumbs.delete(d)}},[d,n.thumbs]);let w={value:l,name:p,form:n.form,isFormControl:R,index:g,thumb:d,onThumbChange:m,percent:x,size:v};return t(Le,{scope:e,...w,children:Ee(s)?s(w):i})}f(be,"SliderThumbProvider");var q="SliderThumbTrigger",Ue=O(f(function(e,r){let{__scopeSlider:i,...s}=e,n=U(q,i),c=he(q,i),{index:d,value:m,percent:g,size:v,onThumbChange:R}=ge(q,i),l=_e(r,R),p=Re(d,n.values.length),x=v?.[c.size],w=x?Pe(x,g,c.direction):0;return t("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${g}% + ${w}px)`},children:t(J.ItemSlot,{scope:i,children:t(se.span,{role:"slider","aria-label":e["aria-label"]||p,"aria-valuemin":n.min,"aria-valuenow":m,"aria-valuemax":n.max,"aria-orientation":n.orientation,"data-orientation":n.orientation,"data-disabled":n.disabled?"":void 0,tabIndex:n.disabled?void 0:0,...s,ref:l,style:m===void 0?{display:"none"}:e.style,onFocus:Y(e.onFocus,()=>{n.valueIndexToChangeRef.current=d})})})})},"SliderThumbTrigger")),Ye=O(f(function(e,r){let{__scopeSlider:i,name:s,...n}=e;return t(be,{__scopeSlider:i,name:s,internal_do_not_use_render:({index:c,isFormControl:d})=>o(L,{children:[t(Ue,{...n,ref:r,__scopeSlider:i}),d?t($e,{__scopeSlider:i},c):null]})})},"SliderThumb")),Ge="SliderBubbleInput",$e=O(f(function({__scopeSlider:e,...r},i){let{value:s,name:n,form:c}=ge(Ge,e),d=b(null),m=_e(d,i),g=Tc(s);return h(()=>{let v=d.current;if(!v)return;let R=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(R,"value").set;if(g!==s&&p){let x=new Event("input",{bubbles:!0});p.call(v,s),v.dispatchEvent(x)}},[g,s]),t(se.input,{style:{display:"none"},name:n,form:c,...r,ref:m,defaultValue:s})},"SliderBubbleInput"));function ve(a=[],e,r){let i=[...a];return i[r]=e,i.sort((s,n)=>s-n)}f(ve,"getNextSortedValues");function Z(a,e,r){let n=100/(r-e)*(a-e);return pa(n,[0,100])}f(Z,"convertValueToPercentage");function Re(a,e){if(e>2)return`Value ${a+1} of ${e}`;else if(e===2)return["Minimum","Maximum"][a];else return}f(Re,"getLabel");function we(a,e){if(a.length===1)return 0;let r=a.map((s)=>Math.abs(s-e)),i=Math.min(...r);return r.indexOf(i)}f(we,"getClosestValueIndex");function Pe(a,e,r){let i=a/2,s=50,n=G([0,50],[0,i]);return(i-n(e)*r)*r}f(Pe,"getThumbInBoundsOffset");function xe(a){return a.slice(0,-1).map((e,r)=>a[r+1]-e)}f(xe,"getStepsBetweenValues");function ye(a,e){if(e>0){let r=xe(a);return Math.min(...r)>=e}return!0}f(ye,"hasMinStepsBetweenValues");function G(a,e){return(r)=>{if(a[0]===a[1]||e[0]===e[1])return e[0];let i=(e[1]-e[0])/(a[1]-a[0]);return e[0]+i*(r-a[0])}}f(G,"linearScale");function ee(a){if(!Number.isFinite(a))return 0;let e=a.toString();if(e.includes("e")){let[i,s]=e.split("e"),n=i.split(".")[1]||"",c=Number(s);return Math.max(0,n.length-c)}let r=e.split(".")[1];return r?r.length:0}f(ee,"getDecimalCount");function H(a,e){let r=Math.pow(10,e);return Math.round(a*r)/r}f(H,"roundValue");function Te(a,{min:e,step:r,direction:i,multiplier:s}){let n=ee(r),c=(a-e)/r,d=Math.round(c),m=H(d*r+e,n)===H(a,n),g;if(m)g=d+s*i;else if(i>0)g=Math.ceil(c);else g=Math.floor(c);return H(g*r+e,n)}f(Te,"getNextStepValue");function Ee(a){return typeof a==="function"}f(Ee,"isFunction");function Uo({className:a,defaultValue:e,value:r,min:i=0,max:s=100,...n}){let c=D(()=>Array.isArray(r)?r:Array.isArray(e)?e:[i,s],[r,e,i,s]);return o(Be,{"data-slot":"slider",defaultValue:e,value:r,min:i,max:s,className:C("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",a),...n,children:[t(ze,{"data-slot":"slider-track",className:C("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:t(He,{"data-slot":"slider-range",className:C("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:c.length},(d,m)=>t(Ye,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},m))]})}
2
- export{Uo};
@@ -1 +0,0 @@
1
- import{h,S,t,Z,B,Ue,A,Dh,lt,tm,yA}from"./chunk-43dzhk24.js";import"./chunk-x79scans.js";import"./chunk-07pgpftg.js";import"./chunk-6vst0k0k.js";import"./chunk-yeb5bcxz.js";import"./chunk-5pcv139g.js";import"./chunk-0jaj2807.js";import"./chunk-xmn5v64e.js";import"./chunk-qn37fsy3.js";import"./chunk-yvz2b957.js";import"./chunk-bcqhjbpy.js";import"./chunk-1zpsbvq9.js";import"./chunk-6h76kqv2.js";import"./chunk-twx715xf.js";import{Gn}from"./chunk-dk2trprj.js";import{rr}from"./chunk-faaqparg.js";import"./chunk-rzannb5e.js";import"./chunk-j95fjg69.js";import"./chunk-sf9ezxgy.js";import"./chunk-67ewr4j4.js";import"./chunk-mcq3pe4v.js";import"./chunk-jgnp68ez.js";import"./chunk-4tm9cw4v.js";import"./chunk-jhxcm88f.js";S();function u(){let{projectId:o,collectionId:r}=y.useParams(),{teamId:s,ensureTeamIdForProject:i}=lt();h(()=>{i(o)},[o,i]);let{data:l}=rr(tm(o)),{data:a,refetch:d}=Z({...yA(r)}),{mutate:p}=B({mutationFn:async(n)=>{let c=await A.api.collections[":collectionId"].$patch({param:{collectionId:r},json:n});if(!c.ok)throw Error("Failed to update collection");return await c.json()},onSuccess:()=>{d()}}),e=l?.rootFolder,{data:f}=Z({queryKey:["folders",e],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:e}});if(!n.ok)throw Error("Failed to fetch folder");return await n.json()},enabled:!!e});if(!s||!e||!f||!a)return t("div",{children:Dh()});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,Z,Ue,A,lt,wt,Qp}from"./chunk-43dzhk24.js";import"./chunk-x79scans.js";import"./chunk-07pgpftg.js";import"./chunk-6vst0k0k.js";import"./chunk-yeb5bcxz.js";import"./chunk-5pcv139g.js";import"./chunk-0jaj2807.js";import"./chunk-xmn5v64e.js";import"./chunk-qn37fsy3.js";import"./chunk-yvz2b957.js";import"./chunk-bcqhjbpy.js";import"./chunk-1zpsbvq9.js";import"./chunk-6h76kqv2.js";import"./chunk-twx715xf.js";import{Gn}from"./chunk-dk2trprj.js";import{rr}from"./chunk-faaqparg.js";import"./chunk-rzannb5e.js";import"./chunk-j95fjg69.js";import"./chunk-sf9ezxgy.js";import"./chunk-67ewr4j4.js";import"./chunk-mcq3pe4v.js";import"./chunk-jgnp68ez.js";import"./chunk-4tm9cw4v.js";import"./chunk-jhxcm88f.js";S();function i(){let{projectId:o}=l.useParams(),{teamId:r,ensureTeamIdForProject:a}=lt();h(()=>{a(o)},[o,a]);let{data:s}=rr(Qp(o)),e=s?.rootFolder,{data:n}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!n)return t(wt,{});return t(Gn,{teamId:r,projectId:o,projectName:s.name??"",assetId:"recents",rootFolderId:e})}var l=Ue("/projects/$projectId/recents")({component:i});export{l as Route};
@@ -1 +0,0 @@
1
- import{P,h,D,b,u,S,L,t,o,K,Z,B,ft,Ue,A,I,F,ke,rn,bt,eo,to,Po,fe,we,Re,E,he,ge,Ae,W,Vr,Vt,Af,vm,yf,O0,F0,vf,wf,Ne,R_,Xa,V_,W_,nh,it,Rf,tb,pb,hh,bb,Sb,Eb,Cb,Ib,Tb,ki,ha,Zc,Lf,Ri,nv,dv,Tv,Lv,Bv,ew,rw,nw,_d,ox,zx,qx,Wx,Jx,ip,ag,lp,DS,PS,El,HE,eC,Fo,oC,mC,AC,qg,Gg,jc,Cl,Mp,kp,Rp,Il,qc,Hc,Np,Dp,$c,k1,R1,N1,D1,P1,gn,jp,uI,dI,Gc,cA,_I,yI,bI,vI,wI,ue,ie,me,Ge,le,H,ce,lt,Nr,An,$n,Qc,k,yr,on,Q,je,Fe,Le,Ze,Be,ne,ba,$t,gr,wt,Xp}from"./chunk-43dzhk24.js";import{ji}from"./chunk-x79scans.js";import{tu,xa}from"./chunk-07pgpftg.js";import{Uo}from"./chunk-6vst0k0k.js";import"./chunk-yeb5bcxz.js";import"./chunk-5pcv139g.js";import"./chunk-yvz2b957.js";import{Er}from"./chunk-twx715xf.js";import{ai,Zl}from"./chunk-qn37fsy3.js";import{si}from"./chunk-6xqpbkb6.js";import{Pl}from"./chunk-65ets3f0.js";import{Ol}from"./chunk-p4hwyysm.js";import{rr}from"./chunk-faaqparg.js";import"./chunk-rzannb5e.js";import{Hl,$l}from"./chunk-mn9ax7qa.js";import"./chunk-67ewr4j4.js";import"./chunk-mcq3pe4v.js";import{lo}from"./chunk-jgnp68ez.js";import"./chunk-4tm9cw4v.js";import{co}from"./chunk-80qz30dc.js";import{Rr}from"./chunk-jhxcm88f.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"),[pe,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(nv()),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=[]}=Z({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||ha())}return await l.json()},onSuccess:()=>{q.invalidateQueries({queryKey:["share",p]}),q.invalidateQueries({queryKey:["shares"]}),k.success(wI()),N(!1),v?.()},onError:(e)=>{k.error(e.message||ha())}}),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(ha());return await n.json()},onSuccess:(e)=>{q.invalidateQueries({queryKey:["watermark-templates"]}),V(e.id),J(!1),k.success(N1())},onError:()=>{k.error(ha())}}),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(ha());return await n.json()},onSuccess:()=>{q.invalidateQueries({queryKey:["watermark-templates"]}),J(!1),k.success(D1())},onError:()=>{k.error(ha())}}),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(k1())},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(qx());return}_e({blocks:d})},St=()=>{if(ve==="new"){if(!pe.trim()){k.error(hh());return}He({name:pe.trim(),config:{blocks:d}})}else{let e=te||R;if(!e){k.error(qg());return}ze({templateId:e,config:{blocks:d}})}};return o(L,{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:yI()})}),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"}),bI()]})}),o(Ae,{align:"end",className:"w-56",children:[t(Vr,{className:"text-xs font-semibold text-muted-foreground",children:nw()}),O.length===0?t("div",{className:"px-2 py-1.5 text-xs text-muted-foreground italic",children:zx()}):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(fe,{className:"h-3.5 w-3.5 text-primary"}),nh()]}),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"}),ag()]})]})]}),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"}),oC()]})]})]}),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:cA()})]})}),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(ji,{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(fe,{className:"h-3.5 w-3.5"}),Af()]})}),o(Ae,{align:"end",children:[o(W,{onClick:We,className:"text-xs gap-2 cursor-pointer",children:[t(ji,{className:"h-3.5 w-3.5"}),yf()]}),o(W,{onClick:xt,className:"text-xs gap-2 cursor-pointer",children:[t(eo,{className:"h-3.5 w-3.5"}),vm()]})]})]})]})]}),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(ji,{className:"h-4 w-4 text-primary"}):t(eo,{className:"h-4 w-4 text-primary"}),i.type==="text"?yf():vm()]}),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:P1()}),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:Lv()}),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:Gc()})]})}),Y[i.id]||i.imageAssetUrl?o(L,{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:jp()})]})]}):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:uI()}),t("p",{className:"text-[10px] text-muted-foreground mt-0.5 max-w-[150px] mx-auto leading-normal",children:dI()})]})]})]})]}),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"?dv():Bv()}),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(Uo,{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:R_()}),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:Wx()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(i.opacity*100),"%"]})]}),t(Uo,{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:eC()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[i.rotation,"°"]})]}),t(Uo,{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:DS()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(i.x*100),"%"]})]}),t(Uo,{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:PS()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(i.y*100),"%"]})]}),t(Uo,{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:AC()}),o(E,{size:"sm",variant:"outline",onClick:We,children:[t(fe,{className:"h-3.5 w-3.5 mr-1"}),yf()]})]})})]})]})]})}),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"?nh():ag()})}),t("div",{className:"py-3 space-y-4 text-xs",children:ve==="new"?o("div",{className:"space-y-2",children:[t(Q,{children:R1()}),t(H,{type:"text",value:pe,onChange:(e)=>ee(e.target.value),placeholder:hh(),className:"text-xs"})]}):o("div",{className:"space-y-2",children:[t(Q,{children:qg()}),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}=Z({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(ha());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(_I())}}),oe=ye?.watermarkStatus??a.watermarkStatus??(a.watermarkConfigId?"ready":"disabled"),pe=ye?.watermarkConfig?.config??a.watermarkConfig?.config??null,ee=pe!==null&&oe!=="disabled",{data:te}=Z({queryKey:["fields",a.projectId],queryFn:async()=>{let s=await A.api.projects[":projectId"].fields.$get({param:{projectId:a.projectId}});if(!s.ok)throw Error(Sb());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(ha());return await X.json()},onSuccess:()=>{v.invalidateQueries({queryKey:["shares",a.projectId]}),v.invalidateQueries({queryKey:["share",a.id]}),k.success(Gg())}}),re=`${window.location.origin}/share/${a.id}`,se=async(s)=>{if(await co(s))k.success(V_())},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:ew()}),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:mC(),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:lp()}),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:pb(),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:bb()}),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(ba,{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:O0()}),t(je,{checked:a.allowDownload,onCheckedChange:(s)=>M({allowDownload:s})})]}),t("p",{className:"text-xs text-muted-foreground",children:F0()})]}),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:cA()}),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:vI()})]}),ee&&oe!=="processing"&&t(E,{variant:"outline",size:"sm",className:"w-full text-xs gap-1.5 mt-1",onClick:()=>R(!0),children:tb()})]})]})}),t(Oe,{title:vf(),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"}),Tv()]}),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"}),rw()]})]})}),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:Lf()}),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:Mp()}),t(ne,{value:"name",children:Il()}),t(ne,{value:"createdAt",children:kp()}),t(ne,{value:"size",children:Np()})]})]})]}),o("div",{className:"space-y-2",children:[t(Q,{className:"text-xs text-muted-foreground",children:ip()}),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"?jc():$c():T==="createdAt"?G==="asc"?Hc():qc():T==="size"?G==="asc"?Dp():Rp():G==="asc"?wf():Rf()}),t(tu,{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"}),Jx()]}),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"}),W_()]})]}),t(pt,{open:g,onOpenChange:R,initialConfig:pe,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}=gr();h(()=>{if(a)q(a)},[a,q]);let{data:d}=Z({queryKey:["share",p],queryFn:async()=>{let r=await A.api.shares[":shareId"].$get({param:{shareId:p}});if(!r.ok)throw Error(Ib());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:pe}=$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(Cb());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(Eb());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(Tb())},onSuccess:()=>{v.invalidateQueries({queryKey:["folder-children",a,c]}),k.success(HE())}}),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(ha());return await m.json()},onSuccess:()=>{v.invalidateQueries({queryKey:["share",p]}),k.success(Gg())}}),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:_d()});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(L,{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(xa,{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}),!pe&&o(L,{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(Qc,{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:ox({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}=rr(Xp(a)),v=C?.rootFolder,{data:q}=Z({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
- import{h,b,u,S,L,t,o,K,B,A,F,Gr,ve,bt,vt,Os,fe,E,he,ge,Ae,W,Ne,Xa,Xm,it,Fc,Lc,uh,sb,ab,Eh,Ch,Ih,Jf,Xf,ep,tp,bl,Xh,op,sp,cg,ug,bp,Rg,Kg,Fp,X1,Up,zp,Je,Xe,et,tt,rt,nt,ot,st,ue,ie,me,Ge,le,Tt,H,Pt,Nt,k,Kr,_n,_A}from"./chunk-43dzhk24.js";import{ru,nu,ou,su,au}from"./chunk-07pgpftg.js";import{Zo}from"./chunk-x79scans.js";import{lo}from"./chunk-jgnp68ez.js";S();var Se=[];function Bl({teamId:r,projectId:D,assetId:m,folders:a,files:l,totalFolders:Me,totalFiles:Re,totalFoldersSize:ze,totalFilesSize:Ue,selectedItem:J,selectedIds:w,onItemSelect:X,onItemDoubleClick:Y,onSaveField:Be,onClearSelection:qe,fetchNextFoldersPage:Z,hasNextFoldersPage:ee,isFetchingNextFoldersPage:y,fetchNextFilesPage:te,hasNextFilesPage:oe,isFetchingNextFilesPage:x,isRecentlyDeleted:C=!1,isRecents:N=!1,isLoading:se=!1,isShareView:q=!1,isPublic:re=!1,shareId:$e,allowDownload:ne=!0}){let d=K(),{canEdit:_,canAdmin:Oe}=Pt(D),ae=b(null),de=b(null),[O,We]=u(!0),[j,je]=u(!0),[Qe,I]=u(!1),[T,ce]=u(""),[He,Q]=u(!1),pe=Me??a.length,we=Re??l.length,De=ze??(a.length>0?a.reduce((e,s)=>e+(s.sizeByte||0),0):-1),ye=Ue??(l.length>0?l.reduce((e,s)=>e+(s.sizeByte||0),0):-1),Ke=De>-1,Le=ye>-1,be=(e,s)=>{if(s)return e===1?Xf({count:e}):Jf({count:e});else return e===1?tp({count:e}):ep({count:e})},{editingItemId:xe,setEditingItemId:ke,handleAction:Ce,onRenameSubmit:_e,isDeleteDialogOpen:Pe,setIsDeleteDialogOpen:Ve,confirmDelete:Ye,isDownloadDialogOpen:Ze,setIsDownloadDialogOpen:P,isLoadingLinks:M,resolvedFiles:Fe,startDownload:at}=au({teamId:r,projectId:D,assetId:m,folders:a,files:l,selectedIds:w,isPublic:re,shareId:$e}),{ref:lt,inView:Ie}=Nt();h(()=>{if(Ie){if(ee&&!y)Z();else if(oe&&!x)te()}},[Ie,ee,y,oe,x,Z,te]);let dt=_n((e)=>e.startTask),ct=A.api.teams[":teamId"].upload.tasks.$post,{mutate:mt}=B({mutationFn:async(e)=>{let s=await ct(e);if(!s.ok)throw Error("Failed to create upload task");return await s.json()},onMutate:()=>({files:[...Se]}),onSuccess:async(e,s,n)=>{let p=n?.files||[],f=p.map((i)=>{let v=e.createdAssets?.find((c)=>c.tempId===i.id),z=e.presignedUrls?.find((c)=>c.id===i.id);return{fileId:v?.assetId||z?.fileId||i.id,name:i.file.name,size:i.file.size}}).filter((i)=>!!i.fileId),g=p.filter((i)=>!i.file.name.startsWith(".")),R=g.length===1?g[0].file.name:`${g.length} Items`;if(e.taskId)dt(e.taskId,R,f);d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]}),await nu({files:p,taskId:e.taskId,teamId:r,storageBackend:e.storageBackend||"local",createdAssets:e.createdAssets,presignedUrls:e.presignedUrls,onFileFinished:async()=>{await d.invalidateQueries({queryKey:["search",r,m]})}}),d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]})}}),Te=(e)=>{if(!e||e.length===0)return;let s=[],n=[],p=new Map;for(let f of e){let g=(f.webkitRelativePath||f.name).split("/");if(g.some((U)=>U.startsWith(".")))continue;let R=g.pop(),i=n,v="";for(let U of g)if(v=`${v}/${U}`,!p.has(v)){let G=[],wt={name:U,type:"folder",id:Zo(),children:G,size:0};i.push(wt),p.set(v,G),i=G}else i=p.get(v);let z={file:f,id:Zo()};s.push(z);let c=f.type;if(R.toLowerCase().endsWith(".wma")&&c?.startsWith("video/"))c=c.replace(/^video\//,"audio/");i.push({name:R,size:f.size,type:"file",id:z.id,children:[],mediaType:c})}Se=s,mt({param:{teamId:r},json:{parentId:m,files:n}})},pt=A.api.folders.$post,{mutate:ut,isPending:Ee}=B({mutationFn:async(e)=>{let s=await pt({json:{name:e,parentId:m}});if(!s.ok)throw Error("Failed to create folder");return await s.json()},onSuccess:()=>{k.success(bl()),I(!1),ce(""),d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["folders"]})},onError:(e)=>{k.error(`Error: ${e.message}`)}}),{mutate:ft,isPending:V}=B({mutationFn:async()=>{let e=await A.api.projects[":projectId"]["empty-trash"].$post({param:{projectId:D}});if(!e.ok)throw Error("Failed to empty trash");return await e.json()},onSuccess:()=>{k.success(X1()),d.invalidateQueries({queryKey:["projects",D,"recently-deleted"]}),qe(),Q(!1)},onError:(e)=>{k.error(`Error: ${e.message}`)}}),gt=(e)=>{if(e.preventDefault(),!T.trim())return;ut(T.trim())},ht=!se&&a.length===0&&l.length===0&&!y&&!x;return o("div",{className:"flex-1 flex flex-col min-h-0 bg-background overflow-hidden relative",children:[_&&o(L,{children:[t("input",{type:"file",ref:ae,multiple:!0,className:"hidden",onChange:(e)=>{if(e.target.files)Te(e.target.files)}}),t("input",{type:"file",ref:de,multiple:!0,webkitdirectory:"true",className:"hidden",onChange:(e)=>{if(e.target.files)Te(e.target.files)}})]}),C&&o("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border text-sm shrink-0",children:[o("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t(Gr,{className:"h-4 w-4 text-amber-500 shrink-0"}),t("span",{className:"text-xs",children:bp()})]}),Oe&&t(E,{variant:"destructive",size:"sm",disabled:V||a.length===0&&l.length===0,onClick:()=>Q(!0),className:"h-7 px-2.5 text-xs font-medium bg-destructive/10 text-destructive border border-destructive/20 hover:bg-destructive hover:text-destructive-foreground",children:"Delete"})]}),o("div",{className:"flex-1 overflow-y-auto min-h-0 p-3 pb-24",children:[se&&a.length===0&&l.length===0?t(_A,{}):o("div",{className:"max-w-lg mx-auto w-full",children:[pe>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>We(!O),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[O?t(ve,{className:"h-4 w-4"}):t(bt,{className:"h-4 w-4"}),o("span",{children:[be(pe,!1),Ke?` • ${Kr(De)}`:""]})]}),O&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:a.map((e)=>t(su,{item:e,isSelected:J?.id===e.id,isChecked:w.has(e.id),isEditing:xe===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>_e(e,s),onFinishEditing:()=>ke(null),onAction:(s,n)=>Ce(s,n),isRecentlyDeleted:C,isRecents:N,selectedCount:w.size,canEdit:_,isShareView:q,allowDownload:ne},e.id))})]}),we>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>je(!j),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[j?t(ve,{className:"h-4 w-4"}):t(bt,{className:"h-4 w-4"}),o("span",{children:[be(we,!0),Le?` • ${Kr(ye)}`:""]})]}),j&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:l.map((e)=>t(ou,{teamId:r,item:e,isSelected:J?.id===e.id,isChecked:w.has(e.id),isEditing:xe===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>_e(e,s),onFinishEditing:()=>ke(null),onSaveField:(s,n)=>Be?.(e.id,s,n),fields:[],onAction:(s,n)=>Ce(s,n),isRecentlyDeleted:C,isRecents:N,selectedCount:w.size,canEdit:_,isShareView:q,allowDownload:ne},e.id))})]})]}),ht&&t("div",{className:"flex flex-col items-center justify-center h-64 text-sm text-muted-foreground p-6 text-center",children:N?o("div",{className:"flex flex-col items-center gap-2",children:[t(Os,{className:"h-10 w-10 text-muted-foreground/40 mb-1"}),t("p",{className:"font-medium text-foreground",children:op()}),t("p",{className:"text-xs text-muted-foreground",children:sp()})]}):t("span",{children:Fp()})}),t("div",{ref:lt,className:"py-4 flex justify-center items-center min-h-6",children:(y||x)&&t(F,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]}),_&&!C&&!N&&!q&&!re&&t("div",{className:"fixed bottom-6 right-6 z-30",children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(E,{size:"icon",className:"h-14 w-14 rounded-full bg-primary text-primary-foreground shadow-lg shadow-primary/25 hover:bg-primary/90 flex items-center justify-center","aria-label":"Actions",children:t(fe,{className:"h-6 w-6"})})}),o(Ae,{align:"end",side:"top",className:"w-48 mb-2",children:[o(W,{onClick:()=>ae.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(lo,{className:"h-4 w-4"}),t("span",{children:Up()})]}),o(W,{onClick:()=>de.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(lo,{className:"h-4 w-4"}),t("span",{children:zp()})]}),o(W,{onClick:()=>I(!0),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(ru,{className:"h-4 w-4"}),t("span",{children:bl()})]})]})]})}),t(ue,{open:Qe,onOpenChange:I,children:t(ie,{className:"sm:max-w-md",children:o("form",{onSubmit:gt,children:[o(me,{children:[t(le,{children:bl()}),t(Tt,{children:Ch()})]}),t("div",{className:"py-4",children:t(H,{autoFocus:!0,placeholder:Ch(),value:T,onChange:(e)=>ce(e.target.value)})}),o(Ge,{children:[t(E,{type:"button",variant:"outline",onClick:()=>I(!1),children:Ne()}),o(E,{type:"submit",disabled:!T.trim()||Ee,children:[Ee?t(F,{className:"h-4 w-4 animate-spin mr-2"}):null,Xa()]})]})]})})}),t(Je,{open:Pe,onOpenChange:Ve,children:o(Xe,{children:[o(et,{children:[t(rt,{children:Lc()}),t(nt,{children:Fc()})]}),o(tt,{children:[t(st,{children:Ne()}),t(ot,{onClick:()=>Ye(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:it()})]})]})}),t(Je,{open:He,onOpenChange:Q,children:o(Xe,{children:[o(et,{children:[t(rt,{children:ab()}),t(nt,{children:sb()})]}),o(tt,{children:[t(st,{children:Ne()}),t(ot,{onClick:()=>ft(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:V,children:V?"Deleting...":it()})]})]})}),t(ue,{open:Ze,onOpenChange:P,children:o(ie,{className:"sm:max-w-md",children:[o(me,{children:[t(le,{children:M?cg():Xm()}),t(Tt,{children:M?Rg():Eh()})]}),M?o("div",{className:"space-y-4 py-6 flex flex-col items-center justify-center",children:[t(F,{className:"h-8 w-8 animate-spin text-primary"}),t("span",{className:"text-sm font-medium text-muted-foreground mt-2",children:ug()})]}):o("div",{className:"space-y-4 py-2",children:[t("div",{className:"text-sm text-muted-foreground",children:uh({count:Fe.length})}),o("div",{className:"flex items-start gap-3 p-3 text-sm rounded-lg bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300 border border-amber-200 dark:border-amber-900/30",children:[t(Gr,{className:"h-5 w-5 shrink-0 mt-0.5"}),o("div",{children:[t("p",{className:"font-semibold",children:Xh()}),t("p",{className:"mt-0.5 text-xs text-amber-700/90 dark:text-amber-400/90",children:Ih()})]})]})]}),t(Ge,{children:!M?o(L,{children:[t(E,{variant:"outline",onClick:()=>P(!1),children:Ne()}),o(E,{onClick:at,className:"gap-2",disabled:Fe.length===0,children:[t(vt,{className:"h-4 w-4"}),Kg()]})]}):t(E,{variant:"outline",onClick:()=>P(!1),children:Ne()})})]})})]})}
2
- export{Bl};
@@ -1 +0,0 @@
1
- import{h,D,u,S,L,t,o,K,Z,B,ft,Ue,A,I,nr,F,Gr,St,jn,rn,bt,Ci,tr,Ls,vo,fe,wo,we,Re,C,E,Ce,Ie,Te,he,ge,Ae,W,jm,Qm,Ne,b_,C_,Pc,ty,ry,Tf,it,My,ky,Uy,zy,dd,Yy,dh,Tn,vv,wv,xv,Sv,Ev,Cv,Iv,Ad,tw,sx,Kh,Tx,Ux,lg,Mg,zs,Pd,Cp,Od,Wg,Pp,w1,x1,Yg,Jg,Xg,eA,tA,Ld,rA,T1,gs,Je,Xe,et,tt,rt,nt,ot,st,ue,ie,me,Ge,le,Tt,H,ce,Jo,Nr,An,$n,_s,Dr,Ud,Nt,k,xe,hr,Qe,Br,Aa,hA,oo,Gp,ni,oi,ya,Q,je,Fe,Le,Ze,Be,ne,ba,$d,Gd,Vd,Kd}from"./chunk-43dzhk24.js";import{Ui}from"./chunk-e333evwr.js";import{Vn,io}from"./chunk-67ewr4j4.js";import{sn}from"./chunk-4tm9cw4v.js";S();var at=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],De=I("pen",at);function Se({scope:e,onScopeChange:r,selectedGoal:x,onClearGoal:p,onCreateTask:N,canCreateTask:v=!0}){return o("header",{className:"h-14 border-b border-border bg-card/60 backdrop-blur-sm px-4 flex items-center justify-between gap-3 shrink-0 select-none",children:[o("div",{className:"flex items-center gap-3 min-w-0",children:[o("div",{className:"flex items-center bg-muted/60 p-0.5 rounded-lg border border-border/50",children:[o(E,{variant:e==="team"?"secondary":"ghost",size:"sm",onClick:()=>r("team"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${e==="team"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[t(io,{className:"w-3.5 h-3.5"}),t("span",{children:T1()})]}),o(E,{variant:e==="my"?"secondary":"ghost",size:"sm",onClick:()=>r("my"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${e==="my"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[t(Vn,{className:"w-3.5 h-3.5"}),t("span",{children:sx()})]})]}),x&&o("div",{className:"hidden sm:flex items-center gap-1.5 px-2 py-1 rounded-md bg-sidebar-accent border border-sidebar-border text-xs text-sidebar-accent-foreground min-w-0 max-w-[200px] md:max-w-[280px]",children:[t(wo,{className:"w-3.5 h-3.5 text-sidebar-primary shrink-0"}),t("span",{className:"truncate font-medium",children:x.id===Aa?gs():x.title}),t(E,{variant:"ghost",size:"icon-xs",onClick:p,className:"h-4 w-4 p-0 ml-0.5 text-muted-foreground hover:text-foreground",title:C_(),children:t(Re,{className:"w-3 h-3"})})]})]}),v&&t("div",{className:"flex items-center gap-2 shrink-0",children:o(E,{size:"sm",onClick:N,className:"h-8 px-3 text-xs gap-1.5 shadow-xs",children:[t(fe,{className:"w-3.5 h-3.5"}),t("span",{children:Tf()})]})})]})}S();S();function pe({teamId:e,isOpen:r,onClose:x,goalToEdit:p}){let N=K(),[v,P]=u(""),[g,M]=u("");h(()=>{if(p)P(p.title),M(p.description||"");else P(""),M("")},[p,r]);let{mutate:G,isPending:q}=B({mutationFn:async()=>{let n=await A.api.teams[":teamId"].kanban.goals.$post({param:{teamId:e},json:{title:v.trim(),description:g.trim()||void 0}});if(!n.ok){let b=await n.json().catch(()=>({message:Tn()}));throw Error(b.message||Tn())}return await n.json()},onSuccess:()=>{N.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),k.success(vv()),x()},onError:(n)=>{k.error(n.message)}}),{mutate:z,isPending:O}=B({mutationFn:async()=>{if(!p)return;let n=await A.api.teams[":teamId"].kanban.goals[":goalId"].$patch({param:{teamId:e,goalId:p.id},json:{title:v.trim(),description:g.trim()||null}});if(!n.ok){let b=await n.json().catch(()=>({message:Tn()}));throw Error(b.message||Tn())}return await n.json()},onSuccess:()=>{N.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),k.success(Iv()),x()},onError:(n)=>{k.error(n.message)}}),U=(n)=>{if(n.preventDefault(),!v.trim())return;if(p)z();else G()},d=q||O;return t(ue,{open:r,onOpenChange:(n)=>!n&&x(),children:t(ie,{className:"sm:max-w-xl",children:o("form",{onSubmit:U,className:"space-y-4",children:[o(me,{children:[t(le,{children:p?dh():ry()}),t(Tt,{children:p?dh():ty()})]}),o("div",{className:"space-y-3 py-2",children:[o("div",{className:"space-y-1.5",children:[t(Q,{htmlFor:"goal-title",children:Ev()}),t(H,{id:"goal-title",value:v,onChange:(n)=>P(n.target.value),placeholder:Cv(),required:!0,autoFocus:!0})]}),o("div",{className:"space-y-1.5",children:[t(Q,{htmlFor:"goal-description",children:xv()}),t(ya,{id:"goal-description",value:g,onChange:(n)=>M(n.target.value),placeholder:Sv(),rows:3})]})]}),o(Ge,{children:[t(E,{type:"button",variant:"outline",onClick:x,disabled:d,children:Ne()}),o(E,{type:"submit",disabled:!v.trim()||d,children:[d&&t(F,{className:"w-4 h-4 mr-1.5 animate-spin"}),p?zs():Pc()]})]})]})})})}function Ke({teamId:e,selectedGoalId:r,onSelectGoal:x,isOwnerOrEditor:p=!0}){let N=K(),[v,P]=u(!1),[g,M]=u(null),[G,q]=u(null),[z,O]=u(!1),{data:U,isLoading:d}=Z({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let i=await A.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!i.ok)throw Error("Failed to fetch goals");return await i.json()},enabled:!!e}),n=U?.data||[],b=n.reduce((i,s)=>i+(s.taskCount||0),0),{mutate:T,isPending:l}=B({mutationFn:async(i)=>{let s=await A.api.teams[":teamId"].kanban.goals[":goalId"].$delete({param:{teamId:e,goalId:i}});if(!s.ok){let m=await s.json().catch(()=>({message:Tn()}));throw Error(m.message||Tn())}return await s.json()},onSuccess:(i,s)=>{if(N.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),N.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),k.success(wv()),r===s)x(null);q(null)},onError:(i)=>{k.error(i.message)}});if(z)return o("div",{className:"border-r border-sidebar-border bg-sidebar flex flex-col items-center w-12 shrink-0 transition-all duration-300",children:[t("div",{className:"h-14 flex items-center justify-center border-b border-sidebar-border w-full shrink-0",children:t(E,{variant:"ghost",size:"icon-sm",onClick:()=>O(!1),title:Ad(),className:"text-sidebar-foreground/70 hover:text-sidebar-foreground",children:t(bt,{className:"w-4 h-4"})})}),o("div",{className:"mt-3 flex flex-col items-center gap-2",children:[t(E,{variant:r===null?"secondary":"ghost",size:"icon-sm",onClick:()=>x(null),title:jm(),className:C("w-8 h-8 rounded-md",r===null&&"bg-sidebar-accent text-sidebar-accent-foreground"),children:t(Ui,{className:"w-4 h-4"})}),t(E,{variant:"ghost",size:"icon-sm",onClick:()=>P(!0),title:Kh(),className:"w-8 h-8 rounded-md text-sidebar-foreground/70 hover:text-sidebar-foreground",children:t(fe,{className:"w-4 h-4"})})]}),v&&t(pe,{teamId:e,isOpen:v,onClose:()=>P(!1)})]});return o("aside",{className:"w-64 border-r border-sidebar-border bg-sidebar flex flex-col shrink-0 transition-all duration-300 select-none",children:[o("div",{className:"h-14 px-3 flex items-center justify-between border-b border-sidebar-border shrink-0",children:[o("div",{className:"flex items-center gap-2 font-semibold text-xs tracking-wider uppercase text-sidebar-foreground/70",children:[t(wo,{className:"w-4 h-4 text-sidebar-primary"}),t("span",{children:Ad()})]}),o("div",{className:"flex items-center gap-1",children:[p&&t(E,{variant:"ghost",size:"icon-sm",onClick:()=>P(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:Kh(),children:t(fe,{className:"w-4 h-4"})}),t(E,{variant:"ghost",size:"icon-sm",onClick:()=>O(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:"Collapse",children:t(rn,{className:"w-4 h-4"})})]})]}),t(ce,{className:"flex-1 p-2",children:o("div",{className:"space-y-1",children:[o("div",{onClick:()=>x(null),className:C("flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group h-8 min-h-[32px]",r===null?"bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),children:[o("div",{className:"flex items-center gap-2 truncate min-w-0",children:[t(Ui,{className:"w-3.5 h-3.5 shrink-0 text-sidebar-primary"}),t("span",{className:"truncate",children:jm()})]}),b>0&&t("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 shrink-0",children:b})]}),d?t("div",{className:"flex items-center justify-center p-4",children:t(F,{className:"w-4 h-4 animate-spin text-muted-foreground"})}):n.length===0?t("div",{className:"px-2.5 py-4 text-center text-xs text-muted-foreground",children:Tx()}):n.map((i)=>{let s=r===i.id,m=i.id===Aa,y=m?gs():i.title,f=p&&!m;return o("div",{onClick:()=>x(i.id),className:C("flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group relative min-h-[32px]",s?"bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),children:[o("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t(wo,{className:C("w-3.5 h-3.5 shrink-0",s?"text-sidebar-primary":"text-muted-foreground")}),t("span",{className:"line-clamp-2 break-words leading-tight",title:y,children:y})]}),t("div",{className:"flex items-center shrink-0 ml-1",children:f?o(L,{children:[(i.taskCount??0)>0&&t("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 group-hover:hidden group-focus-within:hidden [&:has(~_div_[data-state=open])]:hidden",children:i.taskCount}),t("div",{className:"hidden group-hover:flex group-focus-within:flex [&:has([data-state=open])]:flex items-center",onClick:(c)=>c.stopPropagation(),children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(E,{variant:"ghost",size:"icon-xs",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",children:t(nr,{className:"w-3.5 h-3.5"})})}),o(Ae,{align:"end",className:"w-36",children:[o(W,{onClick:()=>{M(i)},children:[t(De,{className:"w-3.5 h-3.5 mr-2"}),Yy()]}),o(W,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{q(i)},children:[t(we,{className:"w-3.5 h-3.5 mr-2"}),it()]})]})]})})]}):(i.taskCount??0)>0&&t("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60",children:i.taskCount})})]},i.id)})]})}),(v||g)&&t(pe,{teamId:e,isOpen:v||!!g,goalToEdit:g,onClose:()=>{P(!1),M(null)}}),G&&t(Je,{open:!!G,onOpenChange:(i)=>!i&&q(null),children:o(Xe,{children:[o(et,{children:[t(rt,{children:My()}),t(nt,{children:ky({title:G.title})})]}),o(tt,{children:[t(st,{disabled:l,children:Ne()}),o(ot,{onClick:()=>T(G.id),disabled:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[l&&t(F,{className:"w-4 h-4 mr-1.5 animate-spin"}),it()]})]})]})})]})}S();S();function _e(e){return+xe(e)<Date.now()}function Pe({task:e,onClick:r,onDelete:x,disabled:p,isFirst:N,isLast:v,showBottomIndicator:P,currentUserId:g,currentUserRole:M}){let{source:G}=Ud(),q=!!G,z=M?.toLowerCase()==="owner",O=M?.toLowerCase()==="editor",U=!!g&&e.creator?.id===g,d=e.reporter?.id===g||U,n=e.assignee?.id===g,b=z||O||d||n,T=U||z||d,l=p||!b,{ref:i,isDragging:s}=_s({id:e.id,data:{type:"kanban_task",task:e},disabled:l}),{ref:m,isDropTarget:y}=Dr({id:`reorder-before-${e.id}`,data:{type:"reorder",task:e,position:"before"},disabled:s||p}),{ref:f,isDropTarget:c}=Dr({id:`reorder-after-${e.id}`,data:{type:"reorder",task:e,position:"after"},disabled:s||p}),_=e.isAgentTask,j=e.status===Qe.BLOCKED,w=e.dueDate?_e(new Date(e.dueDate))&&e.status!==Qe.DONE:!1;return o("div",{className:"relative",children:[t("div",{ref:m,className:C("absolute left-0 right-0 z-20",N?"-top-6 h-[calc(50%+24px)]":"-top-1 h-[calc(50%+4px)]",q&&!s?"pointer-events-auto":"pointer-events-none")}),t("div",{ref:f,className:C("absolute bottom-0 left-0 right-0 z-20",v?"-bottom-6 h-[calc(50%+24px)]":"h-1/2",q&&!s?"pointer-events-auto":"pointer-events-none")}),y&&!s&&t("div",{className:"absolute -top-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none"}),(c||P)&&!s&&t("div",{className:"absolute -bottom-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none"}),o("div",{ref:i,onClick:()=>r(e),className:C("group relative flex flex-col gap-2 p-3 rounded-lg border text-card-foreground transition-all duration-200 cursor-pointer select-none",s&&"opacity-40 scale-95 shadow-lg ring-2 ring-primary",!s&&"hover:shadow-md","border-border/80 bg-card hover:border-primary/50 shadow-2xs",j&&"border-red-500/60 bg-red-500/[0.03] ring-1 ring-red-500/20"),children:[o("div",{className:"flex items-center justify-between gap-1.5 min-w-0",children:[o("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[t("span",{className:C("px-1.5 py-0.5 rounded text-[10px] font-medium border uppercase tracking-wider shrink-0",oi(e.priority)),children:ni(e.priority)}),_&&o("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-semibold bg-orange-500/15 text-orange-600 dark:text-orange-400 border border-orange-500/30 shrink-0",children:[t(St,{className:"w-3 h-3"}),t("span",{children:Ld()})]}),e.goal&&o("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-muted text-muted-foreground border border-border/70 truncate max-w-[130px]",children:[t(wo,{className:"w-2.5 h-2.5 shrink-0"}),t("span",{className:"truncate",children:e.goal.title})]})]}),t("div",{className:"flex items-center gap-1 shrink-0",children:T&&t("div",{className:"opacity-0 group-hover:opacity-100 [&:has([data-state=open])]:opacity-100 focus-within:opacity-100 transition-opacity flex items-center",onClick:(X)=>X.stopPropagation(),children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(E,{variant:"ghost",size:"icon-xs",className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground",children:t(nr,{className:"w-3.5 h-3.5"})})}),t(Ae,{align:"end",className:"w-32",children:o(W,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>x?.(e),children:[t(we,{className:"w-3.5 h-3.5 mr-2"}),it()]})})]})})})]}),t("h4",{className:"text-xs font-semibold leading-snug line-clamp-2 text-foreground break-words",children:e.title}),j&&o("div",{className:"flex items-start gap-1.5 p-1.5 rounded bg-red-500/10 border border-red-500/20 text-[11px] text-red-600 dark:text-red-400",children:[t(Gr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),t("span",{className:"line-clamp-2 break-words",children:e.latestStatusEvent?.blockReason||e.latestStatusEvent?.reason||e.latestStatusEvent?.summary||Wg()})]}),e.status===Qe.IN_REVIEW&&e.latestStatusEvent?.summary&&o("div",{className:"flex items-start gap-1.5 p-1.5 rounded bg-purple-500/10 border border-purple-500/20 text-[11px] text-purple-600 dark:text-purple-400",children:[t(sn,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),t("span",{className:"line-clamp-2 break-words",children:e.latestStatusEvent.summary})]}),o("div",{className:"flex items-center justify-between gap-2 pt-1 mt-auto border-t border-border/40 text-[11px] text-muted-foreground",children:[t("div",{className:"flex items-center gap-1.5 min-w-0",children:e.assignee?o(L,{children:[_?t("div",{className:"w-5 h-5 rounded-full bg-orange-500/15 border border-orange-500/30 flex items-center justify-center shrink-0",children:t(St,{className:"w-3 h-3 text-orange-600 dark:text-orange-400"})}):o(Ce,{size:"sm",className:"w-5 h-5 border border-border",children:[t(Ie,{src:e.assignee.image}),t(Te,{className:"text-[9px]",children:e.assignee.name.slice(0,2).toUpperCase()})]}),t("span",{className:"truncate text-xs font-medium text-foreground/80 max-w-[90px]",children:e.assignee.name})]}):t("span",{className:"text-[11px] italic text-muted-foreground/60",children:gs()})}),o("div",{className:"flex items-center gap-2 shrink-0",children:[e.dueDate&&o("div",{className:C("flex items-center gap-1 text-[10px] font-mono",w?"text-red-500 font-semibold":"text-muted-foreground"),title:hr(new Date(e.dueDate),"yyyy/MM/dd HH:mm"),children:[t(jn,{className:"w-3 h-3"}),t("span",{children:hr(new Date(e.dueDate),"MM/dd")})]}),e.assetCount>0&&o("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:tw({count:e.assetCount}),children:[t(Ci,{className:"w-3 h-3"}),t("span",{children:e.assetCount})]}),e.dependencyCount>0&&o("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${e.dependencyCount} dependencies`,children:[t(Ls,{className:"w-3 h-3"}),t("span",{children:e.dependencyCount})]}),e.commentCount>0&&o("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${e.commentCount} comments`,children:[t(vo,{className:"w-3 h-3"}),t("span",{children:e.commentCount})]})]})]})]})]})}function Ee({teamId:e,status:r,selectedGoalId:x,scope:p,currentUserId:N,currentUserRole:v,onTaskClick:P,onDeleteTask:g,onCreateTaskInColumn:M}){let G=v?.toLowerCase()==="owner"||v?.toLowerCase()==="editor",q=p==="my"?N:void 0,{data:z,fetchNextPage:O,hasNextPage:U,isFetchingNextPage:d,isLoading:n}=ft({queryKey:["teams",e,"kanban","tasks",{status:r,goalId:x,assigneeId:q}],queryFn:async({pageParam:R=""})=>{let J=await A.api.teams[":teamId"].kanban.tasks.$get({param:{teamId:e},query:{status:r,goalId:x||void 0,assigneeId:q||void 0,first:"20",after:R||void 0}});if(!J.ok)throw Error("Failed to fetch column tasks");return await J.json()},initialPageParam:"",getNextPageParam:(R)=>R.pageInfo?.cursor||void 0,refetchInterval:5000,enabled:!!e}),{ref:b,inView:T}=Nt({threshold:0.1});h(()=>{if(T&&U&&!d)O()},[T,U,d,O]);let l=D(()=>z?.pages?.flatMap((R)=>Array.isArray(R?.data)?R.data:[])||[],[z]),{source:i,target:s}=Ud(),m=l.filter((R)=>R.id!==i?.id).at(-1),{ref:y,isDropTarget:f}=Dr({id:r,data:{type:"kanban_column",status:r,lastTask:m}}),c=i?.data?.type==="kanban_task",_=c&&(f||s?.data?.type==="kanban_column"&&s.data.status===r||s?.data?.type==="reorder"&&s.data.task?.status===r),j=c&&s?.data?.type==="kanban_column"&&s.data.status===r,w=z?.pages?.[0]?.pageInfo?.total??l.length,X=Gp(r);return o("div",{ref:y,className:C("flex flex-col h-full max-h-full w-80 md:w-84 shrink-0 rounded-xl bg-card/60 border border-border/70 shadow-xs transition-colors duration-200 overflow-hidden select-none",_&&"ring-2 ring-primary/60 bg-primary/[0.03] border-primary/40"),children:[o("div",{className:"h-11 px-3.5 flex items-center justify-between border-b border-border/60 bg-card/80 shrink-0",children:[o("div",{className:"flex items-center gap-2 min-w-0",children:[t("div",{className:C("w-2.5 h-2.5 rounded-full shrink-0",X.dot)}),t("h3",{className:"text-xs font-bold tracking-wide uppercase text-foreground/90 truncate",children:oo(r)})]}),t("div",{className:"flex items-center gap-1 shrink-0",children:t("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-muted font-medium text-muted-foreground",children:w})})]}),t(ce,{className:"flex-1 min-h-0 [&>div>div]:block!",children:o("div",{className:"p-2.5 space-y-2.5 min-h-full flex flex-col",children:[n?t("div",{className:"flex items-center justify-center py-10",children:t(F,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):l.length===0?t("div",{className:"flex flex-col items-center justify-center py-10 px-4 text-center",children:t("p",{className:"text-xs text-muted-foreground/70",children:Ux()})}):l.map((R,J)=>t(Pe,{task:R,onClick:P,onDelete:g,isFirst:J===0,isLast:J===l.length-1,showBottomIndicator:j&&R.id===m?.id,currentUserId:N,currentUserRole:v},R.id)),t("div",{ref:b,className:"h-2"}),d&&t("div",{className:"flex justify-center py-2",children:t(F,{className:"w-4 h-4 animate-spin text-muted-foreground"})})]})}),G&&t("div",{className:"p-2 border-t border-border/50 bg-card/90 shrink-0",children:o(E,{variant:"ghost",size:"sm",onClick:()=>M(r),className:"w-full justify-center h-8 text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted/80 border border-dashed border-border/80",children:[t(fe,{className:"w-3.5 h-3.5 mr-1.5"}),t("span",{children:Tf()})]})})]})}function Me({teamId:e,selectedGoalId:r,scope:x,currentUserId:p,currentUserRole:N,onTaskClick:v,onCreateTaskInColumn:P}){let g=K(),[M,G]=u(null),{mutate:q,isPending:z}=B({mutationFn:async(d)=>{let n=await A.api.teams[":teamId"].kanban.tasks[":taskId"].$delete({param:{teamId:e,taskId:d}});if(!n.ok){let b=await n.json().catch(()=>({message:Tn()}));throw Error(b.message||Tn())}return await n.json()},onSuccess:()=>{g.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),g.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),k.success(x1()),G(null)},onError:(d)=>{k.error(d.message)}}),{mutate:O}=B({mutationFn:async({taskId:d,fromStatus:n,status:b,reason:T,beforeIndex:l,afterIndex:i})=>{let s=await A.api.teams[":teamId"].kanban.tasks[":taskId"].$patch({param:{teamId:e,taskId:d},json:{fromStatus:n,status:b,reason:T,beforeIndex:l,afterIndex:i}});if(!s.ok){let m=await s.json().catch(()=>({message:Tn()}));throw Error(m.message||Tn())}return await s.json()},onMutate:async({taskId:d,status:n,targetTaskId:b,position:T})=>{await g.cancelQueries({queryKey:["teams",e,"kanban","tasks"]});let l=g.getQueriesData({queryKey:["teams",e,"kanban","tasks"]}),i=null,s=(m)=>m[0]==="teams"&&m[1]===e&&m[2]==="kanban"&&m[3]==="tasks"&&typeof m[4]==="object"&&m[4]!==null&&("status"in m[4]);if(g.setQueriesData({predicate:(m)=>s(m.queryKey)},(m)=>{if(!m||!Array.isArray(m.pages))return m;let y=!1,f=m.pages.map((c)=>{if(!c||!Array.isArray(c.data))return c;let _=c.data.find((j)=>j.id===d);if(_)return i={..._,status:n},y=!0,{...c,data:c.data.filter((j)=>j.id!==d),pageInfo:{...c.pageInfo,total:Math.max(0,(c.pageInfo?.total??c.data.length)-1)}};return c});return y?{...m,pages:f}:m}),i){let m=i;g.setQueriesData({predicate:(y)=>{if(!s(y.queryKey))return!1;return y.queryKey[4]?.status===n}},(y)=>{if(!y||!Array.isArray(y.pages))return y;let f=y.pages.flatMap((w)=>w?.data??[]).filter((w)=>w.id!==d),c=f.length;if(b){let w=f.findIndex((X)=>X.id===b);if(w!==-1)c=T==="before"?w:w+1}f.splice(c,0,m);let _=0,j=y.pages.map((w,X)=>{let R=w?.data?w.data.length:0,J=X===0&&R===0?1:X===y.pages.length-1?f.length-_:R,te=f.slice(_,_+J);return _+=J,{...w,data:te,pageInfo:{...w?.pageInfo,total:(w?.pageInfo?.total??0)+1}}});if(_<f.length&&j.length>0){let w=j.length-1;j[w]={...j[w],data:[...j[w]?.data??[],...f.slice(_)]}}return{...y,pages:j}})}return{previousQueries:l}},onError:(d,n,b)=>{if(b?.previousQueries)for(let[T,l]of b.previousQueries)g.setQueryData(T,l);k.error(d.message)},onSettled:()=>{g.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]})}}),U=(d)=>{if(d.canceled)return;let{source:n,target:b}=d.operation;if(!n||!b)return;let T=n.data;if(T?.type!=="kanban_task"||!T.task)return;let l=T.task,i=N?.toLowerCase()==="owner",s=N?.toLowerCase()==="editor",m=l.reporter?.id===p||l.creator?.id===p,y=l.assignee?.id===p;if(!i&&!s&&!m&&!y){k.error(b_());return}let f=b.data;if(!f)return;if(f.type==="reorder"&&f.task&&f.position){let c=f.task,_=c.status;if(l.id===c.id)return;let j=f.position==="before"?c.sortIndex??void 0:void 0,w=f.position==="after"?c.sortIndex??void 0:void 0;O({taskId:l.id,fromStatus:l.status,status:_,beforeIndex:j,afterIndex:w,targetTaskId:c.id,position:f.position});return}if(f.type==="kanban_column"&&f.status){let{status:c,lastTask:_}=f;if(_){if(l.id===_.id){if(l.status===c)return;O({taskId:l.id,fromStatus:l.status,status:c});return}O({taskId:l.id,fromStatus:l.status,status:c,afterIndex:_.sortIndex??void 0,targetTaskId:_.id,position:"after"});return}if(l.status===c)return;O({taskId:l.id,fromStatus:l.status,status:c})}};return o($n,{sensors:[An.configure({activationConstraints:[new Nr.Distance({value:8})]}),Jo],onDragEnd:U,children:[t("div",{className:"flex-1 min-h-0 overflow-x-auto overflow-y-hidden p-4 bg-background/50",children:t("div",{className:"flex gap-4 h-full min-w-max pb-2",children:hA.map((d)=>t(Ee,{teamId:e,status:d,selectedGoalId:r,scope:x,currentUserId:p,currentUserRole:N,onTaskClick:v,onDeleteTask:(n)=>G(n),onCreateTaskInColumn:P},d))})}),M&&t(Je,{open:!!M,onOpenChange:(d)=>!d&&G(null),children:o(Xe,{children:[o(et,{children:[t(rt,{children:Uy()}),t(nt,{children:zy({title:M.title})})]}),o(tt,{children:[t(st,{disabled:z,children:Ne()}),o(ot,{onClick:()=>q(M.id),disabled:z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[z&&t(F,{className:"w-4 h-4 mr-1.5 animate-spin"}),it()]})]})]})})]})}S();function Oe({teamId:e,isOpen:r,onClose:x,initialGoalId:p}){let N=K(),v=p===Aa||!p?"none":p,[P,g]=u(""),[M,G]=u(""),[q,z]=u(!1),[O,U]=u(Br.MEDIUM),[d,n]=u(v),[b,T]=u("none"),[l,i]=u("none"),[s,m]=u(void 0),[y,f]=u(void 0),[c,_]=u(null),[j,w]=u(null),[X,R]=u(null),[J,te]=u([]),[se,re]=u([]),[be,ve]=u(!1),{data:ke}=Z({queryKey:["teams",e,"me"],queryFn:async()=>{let a=await A.api.teams[":teamId"].me.$get({param:{teamId:e}});if(!a.ok)return null;return await a.json()},enabled:!!e&&r});h(()=>{if(r)g(""),G(""),z(!1),U(Br.MEDIUM),n(v),T("none"),i(ke?.id||"none"),m(void 0),f(void 0),_(null),w(null),R(null),te([]),re([])},[r,v,ke?.id]);let{data:ye=[]}=Z({queryKey:["teams",e,"members","human"],queryFn:async()=>{let a=await A.api.teams[":teamId"].members.$get({param:{teamId:e},query:{includeAgents:"false"}});if(!a.ok)return[];let V=await a.json();return Array.isArray(V)?V:[]},enabled:!!e&&r}),{data:$e=[]}=Z({queryKey:["teams",e,"agents"],queryFn:async()=>{let a=await A.api.teams[":teamId"].agents.$get({param:{teamId:e}});if(!a.ok)return[];return await a.json()||[]},enabled:!!e&&r}),{data:He}=Z({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let a=await A.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!a.ok)return{data:[]};return await a.json()},enabled:!!e&&r}),Ve=He?.data||[],{mutate:We,isPending:ae}=B({mutationFn:async()=>{let a=await A.api.teams[":teamId"].kanban.tasks.$post({param:{teamId:e},json:{title:P.trim(),description:M.trim()||void 0,isAgentTask:q,priority:O,goalId:d!=="none"?d:void 0,assigneeId:b!=="none"?b:void 0,reporterId:l!=="none"?l:void 0,startDate:s?s.toISOString():void 0,dueDate:y?y.toISOString():void 0,projectId:c||void 0,targetFolderId:j||void 0,parentIds:J.length>0?J:void 0,assetIds:se.length>0?se.map((V)=>V.id):void 0}});if(!a.ok){let V=await a.text().catch(()=>""),Y=Tn();if(V)try{let de=JSON.parse(V);if(de&&typeof de.message==="string")Y=de.message}catch{Y=V}throw Error(Y)}return await a.json()},onSuccess:()=>{N.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),N.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),k.success(w1()),x()},onError:(a)=>{k.error(a.message)}}),Ye=(a)=>{if(a.preventDefault(),!P.trim()||ae)return;We()},oe=q;return t(ue,{open:r,onOpenChange:(a)=>!a&&x(),children:o(ie,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[o("form",{onSubmit:Ye,className:"space-y-4",children:[t(me,{children:t(le,{children:Tf()})}),o("div",{className:"space-y-3.5 py-1",children:[o("div",{className:"space-y-1.5",children:[t(Q,{htmlFor:"create-task-title",children:eA()}),t(H,{id:"create-task-title",value:P,onChange:(a)=>g(a.target.value),placeholder:tA(),required:!0,autoFocus:!0})]}),o("div",{className:"space-y-1.5",children:[t(Q,{htmlFor:"create-task-desc",children:Yg()}),t(ya,{id:"create-task-desc",value:M,onChange:(a)=>G(a.target.value),placeholder:Jg(),rows:3})]}),o("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[o("div",{className:"sm:col-span-2 flex items-center justify-between space-x-2 rounded-lg border border-border/80 bg-muted/30 p-2.5 h-14",children:[o("div",{className:"space-y-0.5 min-w-0 pr-2",children:[o(Q,{htmlFor:"create-is-agent-task",className:"text-xs font-medium cursor-pointer flex items-center gap-1.5",children:[t(St,{className:"w-3.5 h-3.5 text-orange-500"}),t("span",{children:Ld()})]}),t("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:rA()})]}),t(je,{id:"create-is-agent-task",checked:q,onCheckedChange:(a)=>{z(a),T("none")}})]}),o("div",{className:"space-y-1.5",children:[t(Q,{className:"text-xs font-medium text-muted-foreground",children:Xg()}),o(Fe,{value:O,onValueChange:(a)=>U(a),children:[t(Ze,{className:"w-full h-9 text-xs",children:t(Le,{})}),t(Be,{children:Object.values(Br).map((a)=>t(ne,{value:a,children:t("span",{className:C("px-1.5 py-0.5 rounded text-[10px] uppercase font-medium",oi(a)),children:ni(a)})},a))})]})]}),o("div",{className:"space-y-1.5",children:[t(Q,{className:"text-xs font-medium text-muted-foreground",children:Ad()}),o(Fe,{value:d,onValueChange:n,children:[t(Ze,{className:"w-full h-9 text-xs",children:t(Le,{placeholder:"None"})}),o(Be,{children:[t(ne,{value:"none",children:t("span",{className:"text-muted-foreground italic",children:"None"})}),Ve.filter((a)=>a.id!==Aa).map((a)=>t(ne,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[t(wo,{className:"w-3.5 h-3.5 text-primary"}),t("span",{children:a.title})]})},a.id))]})]})]}),o("div",{className:"space-y-1.5",children:[t(Q,{className:"text-xs font-medium text-muted-foreground",children:oe?Pd():Qm()}),o(Fe,{value:b,onValueChange:T,children:[t(Ze,{className:"w-full h-9 text-xs",children:t(Le,{placeholder:gs()})}),o(Be,{children:[t(ne,{value:"none",children:t("span",{className:"text-muted-foreground italic",children:gs()})}),oe?$e.map((a)=>t(ne,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[t(St,{className:"w-3.5 h-3.5 text-purple-500"}),t("span",{children:a.name})]})},a.id)):ye.map((a)=>t(ne,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{size:"sm",className:"w-4 h-4",children:[t(Ie,{src:a.image}),t(Te,{className:"text-[8px]",children:a.name.slice(0,2).toUpperCase()})]}),t("span",{children:a.name})]})},a.id))]})]})]}),o("div",{className:"space-y-1.5",children:[t(Q,{className:"text-xs font-medium text-muted-foreground",children:Mg()}),o(Fe,{value:l,onValueChange:i,children:[t(Ze,{className:"w-full h-9 text-xs",children:t(Le,{placeholder:gs()})}),o(Be,{children:[t(ne,{value:"none",children:t("span",{className:"text-muted-foreground italic",children:gs()})}),ye.map((a)=>t(ne,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{size:"sm",className:"w-4 h-4",children:[t(Ie,{src:a.image}),t(Te,{className:"text-[8px]",children:a.name.slice(0,2).toUpperCase()})]}),t("span",{children:a.name})]})},a.id))]})]})]}),oe&&o("div",{className:"sm:col-span-2 space-y-1.5",children:[t(Q,{className:"text-xs font-medium text-muted-foreground",children:Pp()}),o(E,{type:"button",variant:"outline",size:"sm",onClick:()=>ve(!0),className:"w-full justify-start h-9 text-xs truncate font-normal",children:[t(tr,{className:"w-3.5 h-3.5 mr-2 text-primary shrink-0"}),t("span",{className:"truncate",children:X||Cp()})]})]}),o("div",{className:"space-y-1.5",children:[t(Q,{className:"text-xs font-medium text-muted-foreground",children:Od()}),t(ba,{value:s,onChange:m,placeholder:Od(),className:"h-9 text-xs"})]}),o("div",{className:"space-y-1.5",children:[t(Q,{className:"text-xs font-medium text-muted-foreground",children:dd()}),t(ba,{value:y,onChange:f,placeholder:dd(),className:"h-9 text-xs"})]}),o("div",{className:"sm:col-span-2 space-y-1.5",children:[t(Q,{className:"text-xs font-medium text-muted-foreground",children:lg()}),t($d,{teamId:e,value:J,onChange:te})]}),t("div",{className:"sm:col-span-2 pt-1",children:t(Gd,{teamId:e,projectId:c,assets:se,onAddAssets:(a)=>re((V)=>[...V,...a]),onRemoveAsset:(a)=>re((V)=>V.filter((Y)=>Y.id!==a))})})]})]}),o(Ge,{children:[t(E,{type:"button",variant:"outline",onClick:x,disabled:ae,children:Ne()}),o(E,{type:"submit",disabled:!P.trim()||ae,children:[ae&&t(F,{className:"w-4 h-4 mr-1.5 animate-spin"}),Pc()]})]})]}),be&&t(Vd,{teamId:e,currentProjectId:c,currentTargetFolderId:j,isOpen:be,onClose:()=>ve(!1),onSelect:(a,V,Y)=>{_(a),w(V),R(Y||"Selected Folder")}})]})})}function qe({teamId:e,initialTaskId:r}){let[x,p]=u("team"),[N,v]=u(null),[P,g]=u(r??null),[M,G]=u(!1);h(()=>{if(r)g(r)},[r]);let[q,z]=u(Qe.TODO),{data:O,isLoading:U}=Z({queryKey:["teams",e,"me"],queryFn:async()=>{let s=await A.api.teams[":teamId"].me.$get({param:{teamId:e}});if(!s.ok)throw Error("Failed to fetch me");return await s.json()},enabled:!!e}),{data:d}=Z({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let s=await A.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!s.ok)return{data:[]};return await s.json()},enabled:!!e}),n=d?.data||[],b=N?n.find((s)=>s.id===N)||null:null,T=O?.role?.toLowerCase()==="owner"||O?.role?.toLowerCase()==="editor",l=(s=Qe.TODO)=>{z(s),G(!0)},i=(s)=>{g(s.id)};if(U)return t("div",{className:"flex h-full items-center justify-center",children:t(F,{className:"w-8 h-8 animate-spin text-muted-foreground"})});return o("div",{className:"flex flex-row h-full bg-background overflow-hidden font-sans",children:[t(Ke,{teamId:e,selectedGoalId:N,onSelectGoal:v,isOwnerOrEditor:T}),o("div",{className:"flex-1 flex flex-col min-w-0 h-full overflow-hidden",children:[t(Se,{scope:x,onScopeChange:p,selectedGoal:b,onClearGoal:()=>v(null),onCreateTask:()=>l(Qe.TODO),canCreateTask:T}),t(Me,{teamId:e,selectedGoalId:N,scope:x,currentUserId:O?.id,currentUserRole:O?.role,onTaskClick:i,onCreateTaskInColumn:(s)=>l(s)})]}),P&&t(Kd,{teamId:e,taskId:P,isOpen:!!P,onClose:()=>g(null),canEdit:T}),M&&t(Oe,{teamId:e,isOpen:M,initialStatus:q,initialGoalId:N,onClose:()=>G(!1)})]})}function lt(){let{teamId:e}=ze.useParams(),{taskId:r}=ze.useSearch();return t(qe,{teamId:e,initialTaskId:r})}var ze=Ue("/teams/$teamId/kanban")({component:lt});export{ze as Route};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{wc,xc,Lu}from"./chunk-3rjdkmhb.js";export{wc as ENV_KEY,xc as ENV_SECRET,Lu as fromEnv};
@@ -1 +0,0 @@
1
- import{t,Ue}from"./chunk-43dzhk24.js";import"./chunk-07pgpftg.js";import"./chunk-6vst0k0k.js";import"./chunk-yeb5bcxz.js";import"./chunk-x79scans.js";import"./chunk-5pcv139g.js";import"./chunk-yvz2b957.js";import"./chunk-bcqhjbpy.js";import"./chunk-1zpsbvq9.js";import"./chunk-6h76kqv2.js";import"./chunk-0jaj2807.js";import"./chunk-g82qnxw6.js";import"./chunk-twx715xf.js";import{va}from"./chunk-j6ptdqp9.js";import"./chunk-rzannb5e.js";import"./chunk-sf9ezxgy.js";import"./chunk-67ewr4j4.js";import"./chunk-mcq3pe4v.js";import"./chunk-jgnp68ez.js";import"./chunk-4tm9cw4v.js";import"./chunk-jhxcm88f.js";function s(){let{shareId:e,folderId:a}=n.useParams();return t(va,{shareId:e,initialFolderId:a})}var n=Ue("/share/$shareId/folders/$folderId")({component:s});export{n as Route};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Yi}from"./chunk-2y7y60pc.js";export default Yi();
@@ -1 +0,0 @@
1
- import{h,D,u,S,L,t,o,ft,Me,Ue,A,F,Ya,jn,to,Ce,Ie,Te,k0,M_,Mf,Oc,Sx,gn,lt,Nt,yr,$t,wt,Jp}from"./chunk-43dzhk24.js";import{Er}from"./chunk-twx715xf.js";import{rr}from"./chunk-faaqparg.js";import{Rn,Nn,Dn,br,xt,_t}from"./chunk-pg5mayjc.js";S();var k=(a)=>{if(!a)return"??";return a.split(" ").map((r)=>r[0]).slice(0,2).join("").toUpperCase()};function T(){let{projectId:a}=j.useParams(),{teamId:r,ensureTeamIdForProject:n}=lt(),g=Me();h(()=>{n(a)},[a,n]);let{data:i}=rr(Jp(a)),d=i?.rootFolder,[v,N]=u(240),{fileListLeftSidebarCollapsed:m,setFileListLeftSidebarCollapsed:y}=$t(),{data:c,isLoading:w,fetchNextPage:f,hasNextPage:p,isFetchingNextPage:l}=ft({queryKey:["collections",a],queryFn:async({pageParam:e})=>{let s=await A.api.projects[":projectId"].collections.$get({param:{projectId:a},query:{first:"20",after:e}});if(!s.ok)throw Error("Failed to fetch collections");return await s.json()},initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0,enabled:!!a}),{ref:I,inView:b}=Nt();h(()=>{if(b&&p&&!l)f()},[b,p,l,f]);let x=D(()=>c?.pages.flatMap((e)=>e.data)||[],[c]);if(!r||!d||!i)return t(wt,{});return t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{className:"flex flex-1 overflow-hidden relative",children:[!m&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>y(!0)}),!m&&o(L,{children:[t("div",{className:"bg-background",style:{width:v},children:t(yr,{teamId:r,projectId:a,projectName:i.name??"",rootFolderId:d})}),t(Er,{onResize:(e)=>{N((s)=>Math.max(180,Math.min(400,s+e)))},className:"hidden md:block"})]}),o("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[t("header",{className:"h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10",children:o("div",{className:"flex items-center gap-2",children:[t(Ya,{className:"h-5 w-5 text-primary"}),t("h1",{className:"font-bold text-lg text-foreground",children:k0()})]})}),t("div",{className:"flex-1 overflow-y-auto p-6",children:w?t("div",{className:"flex justify-center items-center h-64",children:t("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):x.length===0?o("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[t(to,{className:"h-10 w-10 text-muted-foreground/50"}),t("p",{children:Sx()})]}):o("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[o(Rn,{children:[t(Nn,{children:o(br,{className:"hover:bg-transparent bg-muted/20",children:[t(xt,{className:"font-semibold px-4 py-3",children:M_()}),t(xt,{className:"font-semibold px-4 py-3",children:Oc()}),t(xt,{className:"font-semibold px-4 py-3 w-[200px]",children:Mf()})]})}),t(Dn,{children:x.map((e)=>o(br,{className:"hover:bg-muted/10 transition-colors cursor-pointer",onClick:()=>g({to:"/projects/$projectId/collections/$collectionId",params:{projectId:a,collectionId:e.id}}),children:[t(_t,{className:"font-medium px-4 py-3.5",children:o("div",{className:"flex items-center gap-2",children:[t(Ya,{className:"h-4 w-4 text-primary shrink-0"}),t("span",{className:"text-foreground font-semibold hover:underline",children:e.name})]})}),t(_t,{className:"px-4 py-3.5",children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[e.creator?.image&&t(Ie,{src:e.creator.image,alt:e.creator.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:k(e.creator?.name)})]}),t("span",{className:"text-sm font-medium text-foreground truncate max-w-[200px]",children:e.creator?.name||gn()})]})}),t(_t,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:o("div",{className:"flex items-center gap-2",children:[t(jn,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),t("span",{children:new Date(e.createdAt).toLocaleDateString()})]})})]},e.id))})]}),t("div",{ref:I,className:"h-10 w-full flex items-center justify-center",children:l&&t(F,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var j=Ue("/projects/$projectId/collections/")({component:T});export{j as Route};
@@ -1,2 +0,0 @@
1
- import{Ko,ym,il}from"./chunk-43dzhk24.js";function rr(e,r){return il({...e,enabled:!0,suspense:!0,throwOnError:ym,placeholderData:void 0},Ko,r)}
2
- export{rr};
@@ -1,2 +0,0 @@
1
- import{P,h,D,b,u,S,L,t,o,K,Z,B,ft,A,I,wr,F,Do,ke,ve,rn,bt,vt,er,we,Re,C,E,he,Ja,ge,Ae,W,Vr,Vt,fs,ps,ms,bf,Ne,cd,it,Fc,Lc,mr,fd,yb,Fb,Ri,Hf,Yf,Wh,Yh,Ni,dg,up,Oo,Fo,Fd,Je,Xe,et,tt,rt,nt,ot,st,ue,ie,me,Ge,le,H,ce,Pt,Nt,k,xo,So,Qr,kn,be,Ur,Wd}from"./chunk-43dzhk24.js";import{Ea,Ca,Or,cu,uu,es,ts,ys,vs}from"./chunk-x79scans.js";import{zi,iu}from"./chunk-6h76kqv2.js";import{qs}from"./chunk-0jaj2807.js";var ct=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Ze=I("pencil",ct);S();S();function Qe({teamId:d,projectId:s,file:r,onSaveField:l,members:z,onCommentSelect:g,hideAnnotationControl:V=!1,readOnly:w=!1,publicFields:y,isPublic:m=!1,shareId:N,currentTime:q,onTyping:ne,selectedCommentId:f,heightPercent:j,onHeightPercentChange:Q}){let{canEdit:U}=Pt(s),{fields:c,setFields:ee}=Or(),se=K(),{ref:re,inView:fe}=Nt(),[a,M]=u(null),[O,G]=u(!1),[Te,ze]=u(null),Y=b(!1),Ve=b(0),X=b(j),je=(e)=>{Y.current=!0,Ve.current=e.clientY,X.current=j,e.target.setPointerCapture?.(e.pointerId)},Me=P((e)=>{if(!Y.current)return;let v=(Ve.current-e.clientY)/window.innerHeight*100,oe=Math.min(85,Math.max(10,X.current+v));Q(oe)},[Q]),De=(e)=>{Y.current=!1;try{e.target.releasePointerCapture?.(e.pointerId)}catch{}},{data:te}=Z({queryKey:["fields",s],queryFn:async()=>{let e=await A.api.projects[":projectId"].fields.$get({param:{projectId:s}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!s&&!y}),T=es(r);h(()=>{if(y)ee(y,s);else if(te)ee(te,s)},[te,y,s,ee]);let{data:xe,fetchNextPage:J,hasNextPage:Ie}=ft({queryKey:m?["shares",N,"files",r?.id,"comments"]:["files",r?.id,"comments"],queryFn:async({pageParam:e})=>{if(m){let i=localStorage.getItem(`share_pwd_${N}`)||"",v=await A.api.shares[":shareId"].files[":fileId"].comments.$get({param:{shareId:N,fileId:r.id},query:{after:e}},{headers:{"x-share-password":i}});if(!v.ok)throw Error("Failed to fetch comments");return await v.json()}else{let i=await A.api.files[":fileId"].comments.$get({param:{fileId:r.id},query:{after:e}});if(!i.ok)throw Error("Failed to fetch comments");return await i.json()}},enabled:!!r?.id&&(!m||!!N),initialPageParam:"",refetchInterval:2000,getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{mutate:Pe}=B({mutationFn:async({text:e,attachmentIds:i,annotations:v,replyToId:oe,guestUserId:ye,second:Ce})=>{if(m){let de=localStorage.getItem(`share_pwd_${N}`)||"",Be=await A.api.shares[":shareId"].files[":fileId"].comments.$post({param:{shareId:N,fileId:r.id},json:{message:e,attachmentIds:i,replyToId:oe??void 0,annotations:v,second:Ce??void 0}},{headers:{"x-share-password":de,...ye?{"x-guest-user-id":ye}:{}}});if(!Be.ok)throw Error("Failed to create comment");return await Be.json()}else{let de=await A.api.files[":fileId"].comments.$post({param:{fileId:r.id},json:{message:e,attachmentIds:i,replyToId:oe??void 0,annotations:v,second:Ce??void 0}});if(!de.ok)throw Error("Failed to create comment");return await de.json()}},onSuccess:()=>{se.invalidateQueries({queryKey:m?["shares",N,"files",r?.id,"comments"]:["files",r?.id,"comments"]})},onError:()=>{k.error(Fb?.()||"Failed to post comment")}}),Se=xe?.pages?.[0]?.pageInfo?.total??xe?.pages.reduce((e,i)=>e+(i.data?.length||0),0)??0;h(()=>{if(fe&&Ie)J()},[fe,J,Ie]);let _=D(()=>(r?.fieldValues||[]).reduce((e,i)=>(e[i.fieldId]=i,e),{}),[r?.fieldValues]),ae=D(()=>[...c].sort((e,i)=>{let v=e.config?.name?.toLowerCase()||"",oe=i.config?.name?.toLowerCase()||"";if(v<oe)return-1;if(v>oe)return 1;return 0}),[c]),Ee=xe?.pages.flatMap((e)=>e.data??[])??[],_e=(e,i,v=[],oe,ye)=>{if(!e.trim()&&i.length===0&&v.length===0)return;let Ce=oe||a?.id||null;if(m){let de=localStorage.getItem(`guest_user_id_${N}`);if(!de)ze({text:e,attachmentIds:i,annotations:v,replyToId:Ce,second:ye}),G(!0);else Pe({text:e,attachmentIds:i,annotations:v,replyToId:Ce,guestUserId:de,second:ye})}else Pe({text:e,attachmentIds:i,annotations:v,replyToId:Ce,second:ye});M(null)},Oe=(e)=>{if(Te)Pe({...Te,guestUserId:e}),ze(null),M(null)},Fe=(e)=>{let i=z.find((v)=>v.id===e);if(i)return i;return{id:"unknown",name:"Unknown",role:"unknown"}},Le=j<=15;return o("div",{style:{height:`${j}dvh`},className:"shrink-0 flex flex-col bg-background border-t border-border shadow-2xl rounded-t-2xl overflow-hidden select-none z-20","data-testid":"mobile-bottom-sheet",children:[t("div",{onPointerDown:je,onPointerMove:Me,onPointerUp:De,onPointerCancel:De,className:"w-full pt-2 pb-1.5 flex flex-col items-center justify-center cursor-grab active:cursor-grabbing touch-none shrink-0","aria-label":"Drag to resize bottom sheet",children:t("div",{className:"w-10 h-1 rounded-full bg-muted-foreground/30 hover:bg-muted-foreground/50 transition-colors"})}),o(xo,{defaultValue:"comments",className:"flex-1 flex flex-col min-h-0 px-2 pb-1 overflow-hidden",children:[o(So,{className:"w-full shrink-0 h-9 bg-muted/60 p-1",children:[o(Qr,{value:"comments",className:"flex-1 text-xs font-semibold py-1",children:[cd()," ",Se>0&&`(${Se})`]}),t(Qr,{value:"fields",className:"flex-1 text-xs font-semibold py-1",children:Ri()})]}),o(kn,{value:"comments",className:C("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Le&&"hidden"),children:[t("div",{className:"flex items-center justify-between px-2 pb-1.5 shrink-0 border-b border-border/50",children:o("span",{className:"text-xs font-bold text-foreground",children:[bf?.()||"All comments",Se>0?` (${Se})`:""]})}),t(ce,{className:"flex-1 min-h-0 px-2 py-2 [&>div>div]:block!",children:Ee.length===0?t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:Yh()}):o("div",{className:"space-y-3",children:[Ee.map((e)=>o("div",{children:[t(zi,{teamId:d,message:e,getUser:Fe,onReply:M,hasReplies:!!e.replies?.length,formatTimestamp:T?.commentsConfig?.formatTimestamp,frameRate:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:f===e.id,onSelect:()=>{g?.(e)},readOnly:w,isPublic:m}),e.replies?.map((i,v)=>t("div",{children:t(zi,{teamId:d,isReply:!0,message:i,getUser:Fe,onReply:M,hasReplies:!1,isLastReply:v===(e.replies?.length??0)-1,formatTimestamp:T?.commentsConfig?.formatTimestamp,frameRate:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:f===i.id,onSelect:()=>{g?.(i)},readOnly:w,isPublic:m})},i.id))]},e.id)),t("div",{ref:re})]})}),(!w||m)&&t("div",{className:"mt-auto shrink-0 bg-background border-t border-border pt-1",children:t(iu,{isOpen:O,onClose:()=>G(!1),onSuccess:Oe,children:t(qs,{projectId:s,onSendMessage:_e,replyingTo:a,onCancelReply:()=>M(null),hideAnnotationControl:V,disableMentions:m,currentTime:T?.commentsConfig?.hasTimestamp?q:void 0,formatTimestamp:T?.commentsConfig?.formatTimestamp,frameRate:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,onTyping:ne})})})]}),t(kn,{value:"fields",className:C("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Le&&"hidden"),children:t(ce,{className:"flex-1 px-3 py-2 min-h-0 [&>div>div]:block!",children:ae&&ae.length>0?t("div",{className:"space-y-4 pb-6",children:ae.map((e)=>o("div",{className:"space-y-1.5",children:[t("label",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:e.config?.name}),t("div",{className:"min-h-[32px]",children:t(vs,{fieldId:e.id,config:e.config,value:_[e.id]?.value,onSave:U?(i)=>l(e.id,i):void 0,readOnly:w||e.readOnly||!U})})]},e.id))}):t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:"No custom fields defined"})})})]})]})}function Ye({fileName:d,folderName:s,version:r,versions:l,activeFileId:z,isPublic:g=!1,shareId:V,allowDownload:w=!0,downloadInfo:y,canEdit:m=!1,onBack:N,onPrevFile:q,onNextFile:ne,hasPrevFile:f=!1,hasNextFile:j=!1,onSelectVersion:Q,onRename:U,onDelete:c,onLinkedTasks:ee,linkedTaskCount:se=0}){let re=async(a)=>{try{let M=g&&V?await A.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:V,fileId:z},json:{key:a}}):await A.api.files["download-url"].$post({json:{key:a,assetId:z}});if(!M.ok)return;let{url:O}=await M.json(),G=document.createElement("a");G.href=O,G.download="",document.body.appendChild(G),G.click(),document.body.removeChild(G)}catch{}},fe=(y?.videoTranscodes?.length??0)>0;return o("header",{className:"flex h-12 w-full items-center justify-between border-b border-border bg-card px-2 py-1.5 shrink-0 select-none z-30",children:[t("div",{className:"flex items-center",children:t(E,{variant:"ghost",size:"icon",onClick:N,className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":up(),children:t(rn,{className:"h-5 w-5"})})}),o("div",{className:"flex flex-1 items-center justify-center gap-1 min-w-0 px-1",children:[o("div",{className:"flex items-center min-w-0 max-w-[65vw]",children:[s&&o(L,{children:[t("span",{className:"truncate text-xs font-medium text-muted-foreground max-w-[80px]",children:s}),t("span",{className:"text-muted-foreground mx-1 text-xs",children:"/"})]}),l&&l.length>1?o(he,{modal:!1,children:[t(ge,{asChild:!0,children:o("button",{className:"flex items-center gap-1 min-w-0 truncate text-xs font-medium text-foreground hover:bg-accent rounded px-1 py-0.5 transition-colors cursor-pointer",children:[t("span",{className:"truncate max-w-[120px] font-semibold",children:d}),r!==void 0&&o(be,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]}),t(ve,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]})}),o(Ae,{align:"center",className:"w-48 z-40",children:[t(Vr,{className:"text-xs",children:Fd()}),l.map((a)=>o(W,{onClick:()=>Q?.(a.id),className:C("flex items-center justify-between text-xs cursor-pointer",a.id===z?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",a.version]}),t("span",{className:"text-[11px] text-muted-foreground truncate max-w-[120px]",children:a.name||d})]},a.id))]})]}):o("div",{className:"flex items-center gap-1 min-w-0 truncate",children:[t("span",{className:"truncate text-xs font-semibold text-foreground max-w-[140px]",children:d}),r!==void 0&&o(be,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]})]})]}),(f||j)&&o("div",{className:"flex items-center gap-0.5 shrink-0 bg-muted/60 rounded p-0.5 ml-1",children:[t(E,{variant:"ghost",size:"icon",disabled:!f,onClick:q,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:dg(),"aria-label":dg(),children:t(rn,{className:"h-3.5 w-3.5"})}),t(E,{variant:"ghost",size:"icon",disabled:!j,onClick:ne,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:Wh(),"aria-label":Wh(),children:t(bt,{className:"h-3.5 w-3.5"})})]})]}),t("div",{className:"flex items-center gap-1",children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(E,{variant:"ghost",size:"icon",className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":Yf(),children:t(wr,{className:"h-4 w-4"})})}),o(Ae,{align:"end",className:"w-52 z-40",children:[w&&(fe?o(fs,{children:[o(ps,{className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(vt,{className:"h-3.5 w-3.5"}),t("span",{children:mr()})]}),t(Ja,{children:o(ms,{className:"w-48 z-50",children:[t(Vr,{className:"text-xs",children:mr()}),y?.videoTranscodes?.map((a)=>{let M=Math.max(a.width,a.height),O=`${a.height}p`;if(M>=3840)O="2160p";else if(M>=1920)O="1080p";else if(M>=1280)O="720p";else if(M>=960)O="540p";else if(M>=640)O="360p";else if(M>=320)O="180p";let G=a.hdr?`${O} (HDR)`:O;return o(W,{onClick:()=>re(a.key),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:G}),t("span",{className:"text-[10px] text-muted-foreground",children:"MP4"})]},a.key||`${O}-${a.hdr?"hdr":"sdr"}`)}),y?.originalKey&&o(L,{children:[t(Vt,{}),o(W,{onClick:()=>re(y.originalKey),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:Ni?.()||"Original"}),t("span",{className:"text-[10px] text-muted-foreground",children:d.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):o(W,{onClick:()=>y?.originalKey&&re(y.originalKey),disabled:!y?.originalKey,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(vt,{className:"h-3.5 w-3.5"}),t("span",{children:mr()})]})),l&&l.length>1&&Q&&o(fs,{children:[t(ps,{className:"flex items-center gap-2 text-xs cursor-pointer",children:t("span",{children:Fd?.()||"Switch version"})}),t(Ja,{children:o(ms,{className:"w-48 z-50",children:[t(Vr,{className:"text-xs",children:Fd?.()||"Switch version"}),l.map((a)=>o(W,{onClick:()=>Q(a.id),className:C("flex items-center justify-between text-xs cursor-pointer",a.id===z?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",a.version]}),t("span",{className:"text-[10px] text-muted-foreground truncate max-w-[120px]",children:a.name||d})]},a.id))]})})]}),ee&&o(W,{onClick:ee,className:"flex items-center justify-between text-xs cursor-pointer",children:[o("span",{className:"flex items-center gap-2",children:[t(Do,{className:"h-3.5 w-3.5"}),t("span",{children:Hf?.()||"Linked Tasks"})]}),se>0&&t("span",{className:"inline-flex items-center justify-center px-1.5 py-0.2 text-[10px] font-semibold rounded-full bg-muted-foreground/15 text-foreground",children:se})]}),m&&U&&o(W,{onClick:U,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(Ze,{className:"h-3.5 w-3.5"}),t("span",{children:Oo()})]}),m&&c&&o(L,{children:[t(Vt,{}),o(W,{onClick:c,className:"flex items-center gap-2 text-xs text-destructive focus:text-destructive cursor-pointer",children:[t(we,{className:"h-3.5 w-3.5"}),t("span",{children:it()})]})]})]})]})})]})}function Fl({projectId:d,teamId:s="",fileId:r,file:l,projectInfo:z,ancestorFolders:g=[],versions:V,activeFileId:w,startTime:y,isPublic:m=!1,shareId:N,allowDownload:q=!0,publicFields:ne,siblingFiles:f=[],onNavigateToFile:j,onNavigateBack:Q,onRenameFile:U,onDeleteFile:c,onSaveField:ee,onSelectVersion:se}){let{canEdit:re}=Pt(d),{members:fe}=Ur(),a=b(null),[M,O]=u(50),[G,Te]=u([]),[ze,Y]=u(0),[Ve,X]=u(null),[je,Me]=u(!1),[De,te]=u(""),T=b(null),[xe,J]=u(!1),[Ie,Pe]=u(!1),[Se,_]=u(!1),[ae,Ee]=u(!1),{data:_e}=Z({queryKey:["teams",s,"kanban","assets",w,"tasks"],queryFn:async()=>{if(!s||!w||m)return{data:[],total:0};let x=await A.api.teams[":teamId"].kanban.assets[":assetId"].tasks.$get({param:{teamId:s,assetId:w}});if(!x.ok)return{data:[],total:0};return await x.json()},enabled:!!s&&!!w&&!m}),Oe=_e?.total??_e?.data?.length??0,{prevFile:Fe,nextFile:Le}=D(()=>{if(!f||f.length===0)return{prevFile:null,nextFile:null};let x=f.findIndex((pe)=>pe.id===r||pe.id===w);if(x===-1)return{prevFile:null,nextFile:null};return{prevFile:x>0?f[x-1]:null,nextFile:x<f.length-1?f[x+1]:null}},[f,r,w]),e=g.length>0?g[0]?.name:z?.name,v=V?.find((x)=>x.id===w)?.version??(V&&V.length>0?V.length:void 0),oe=D(()=>({originalKey:l.media?.original?.key,videoTranscodes:l.media?.videoTranscodes?.map((x)=>({key:x.key,width:x.width,height:x.height,hdr:x.hdr}))}),[l.media]),ye=()=>{Te([]),X(null)},Ce=(x)=>{X(x.id||null);let pe=x.annotations;if(pe&&pe.length>0)Te(pe);else Te([]);if(x.second!==null&&x.second!==void 0)a.current?.seekTo(x.second),a.current?.pause();else if(pe&&pe.length>0)a.current?.pause()},de=async(x)=>{if(x?.preventDefault(),!De.trim()||!U)return;try{Pe(!0),await U(De.trim()),Me(!1)}finally{Pe(!1)}},Be=async()=>{if(!c)return;try{J(!0),await c(),_(!1)}finally{J(!1)}};return h(()=>{Y(0),X(null),Te([])},[l?.id]),o("div",{className:"flex h-[100dvh] w-full flex-col bg-background overflow-hidden relative",children:[t(Ye,{fileName:l.name,folderName:e,version:v,versions:V,activeFileId:w,isPublic:m,shareId:N,allowDownload:q,downloadInfo:oe,canEdit:re,onBack:Q,hasPrevFile:!!Fe,hasNextFile:!!Le,onPrevFile:()=>Fe&&j(Fe.id),onNextFile:()=>Le&&j(Le.id),onSelectVersion:se,onRename:()=>{te(l.name),Me(!0)},onDelete:()=>_(!0),onLinkedTasks:!m?()=>Ee(!0):void 0,linkedTaskCount:Oe}),t("div",{className:"relative flex-1 min-h-0 bg-background overflow-hidden flex flex-col",children:t(ts,{file:l,mediaControllerRef:a,onPlay:ye,onTimeUpdate:Y,annotations:G,startTime:y,shareId:N,allowDownload:q})}),t(Qe,{teamId:s,projectId:d,file:l,onSaveField:ee,members:fe,onCommentSelect:Ce,hideAnnotationControl:l.proxyType==="audio",readOnly:m||!re,publicFields:ne,isPublic:m,shareId:N,currentTime:ze,onTyping:()=>a.current?.pause(),selectedCommentId:Ve,heightPercent:M,onHeightPercentChange:O}),!m&&ae&&t(Wd,{teamId:s,assetId:w,assetName:l.name,isOpen:ae,onClose:()=>Ee(!1)}),!m&&t(ue,{open:je,onOpenChange:Me,children:t(ie,{children:o("form",{onSubmit:de,children:[t(me,{children:t(le,{children:Oo()})}),t("div",{className:"py-4",children:t(H,{ref:T,value:De,onChange:(x)=>te(x.target.value),placeholder:fd?.()||"Enter new name",onFocus:()=>{setTimeout(()=>{if(T.current)ys(T.current)},0)},autoFocus:!0})}),o(Ge,{children:[t(E,{type:"button",variant:"outline",onClick:()=>Me(!1),children:Ne()}),o(E,{type:"submit",disabled:Ie||!De.trim(),children:[Ie&&t(F,{className:"mr-2 h-4 w-4 animate-spin"}),Fo()]})]})]})})}),!m&&t(Je,{open:Se,onOpenChange:_,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:Be,disabled:xe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[xe&&t(F,{className:"mr-2 h-4 w-4 animate-spin"}),it()]})]})]})})]})}S();function We({activeState:d,activeAsset:s,previewUrl:r,isFullScreen:l,onTogglePlay:z,onToggleLoop:g,onSeek:V,onVolumeChange:w,onToggleMute:y,onChangePlaybackRate:m,onChangeResolution:N,onZoomIn:q,onZoomOut:ne,onFit:f,onDownload:j,onToggleFullScreen:Q,allowDownload:U=!0}){if(d?.kind==="video"&&d.video&&s){let c=d.video,ee=c.totalFrames/c.frameRate,se=c.currentFrame/c.frameRate,re={isPlaying:c.isPlaying,progress:ee>0?se/ee*100:0,currentTime:se,duration:ee,volume:c.volume,isMuted:c.isMuted,isLooping:c.isLooping,playbackRate:c.playbackRate,isFullScreen:l,showFrames:!1,currentResolution:c.currentResolution,isCurrentHdr:c.isCurrentHdr},fe=r&&!s.media?.videoPreview?{...s,media:{...s.media,videoPreview:{url:r}}}:s;return t(cu,{state:re,zoom:d.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:c.buffered,data:fe,resolutions:c.resolutions,togglePlay:z,toggleLoop:g,toggleMute:y,handleVolumeChange:w,changePlaybackRate:m,changeResolution:(a)=>N(a.resolution,a.hdr),handleDownload:(a)=>j(a),toggleFullScreen:Q,onZoomChange:(a)=>a>=d.zoom?q():ne(),onZoomReset:f,frameRate:c.frameRate,totalFrames:c.totalFrames,currentFrame:c.currentFrame,seekToFrame:V,allowDownload:U})}if(d?.kind==="image")return t(uu,{zoom:d.zoom,onZoomIn:q,onZoomOut:ne,onFit:f,onDownload:()=>j(),canDownload:!!s?.media?.original?.key,fullscreen:{isFullScreen:l,onToggle:Q},allowDownload:U});return t("div",{className:"relative z-10 flex items-center justify-end gap-2 border-t border-border bg-card px-4 py-3",children:t("button",{onClick:Q,className:"text-foreground transition-colors hover:text-primary",title:"Fullscreen",children:l?t(Ca,{className:"h-5 w-5"}):t(Ea,{className:"h-5 w-5"})})})}function qe({side:d,fileName:s,version:r,activeVersionId:l,versions:z,isActive:g,onActivate:V,onSwitchVersion:w,onExit:y}){let m=C("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",g?"text-foreground":"text-muted-foreground hover:text-foreground"),N=t("button",{onClick:y,title:yb(),className:m,children:t(Re,{className:"h-4 w-4"})}),q=o("button",{onClick:V,className:C("flex min-w-0 items-center gap-1 rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-muted",g?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[t("span",{className:"truncate",children:s}),r!==void 0&&o("span",{className:C("flex-shrink-0 rounded border px-1 py-0 text-xs",g?"border-foreground/40":"border-border"),children:["v",r]})]}),ne=o(he,{children:[t(ge,{onClick:V,title:Fd(),className:m,children:t(ve,{className:"h-4 w-4"})}),t(Ae,{align:d==="left"?"start":"end",className:"w-80 p-1",children:t("div",{className:"flex max-h-96 flex-col gap-1 overflow-y-auto",children:z.map((f)=>{let j=f.id===l;return o(W,{onClick:()=>w(f.id),className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2",children:[o("div",{className:"flex min-w-[2rem] flex-shrink-0 items-center justify-center rounded-full bg-muted px-2 py-0.5 text-xs font-semibold text-muted-foreground select-none",children:["v",f.version]}),t("div",{className:"flex h-10 w-16 flex-shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.previewUrl?t("img",{src:f.previewUrl,alt:f.name||void 0,className:"h-full w-full object-cover"}):t(er,{className:"h-4 w-4 text-muted-foreground"})}),o("div",{className:"flex min-w-0 flex-1 flex-col text-left",children:[t("span",{className:"truncate text-sm font-semibold text-foreground",children:f.name}),t("span",{className:"truncate text-xs text-muted-foreground",children:f.creator?.name||"Unknown"})]}),j&&t(ke,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},f.id)})})})]});return t("div",{onMouseDown:V,className:C("dark flex h-10 flex-shrink-0 items-center gap-1 border-b bg-background px-2 transition-colors",g?"border-b-2 border-primary":"border-border"),children:d==="left"?o(L,{children:[N,q,ne]}):o(L,{children:[q,ne,t("div",{className:"ml-auto"}),N]})})}function at(d,s,r){return Z({queryKey:s?["public-share-file",r,d,localStorage.getItem(`share_pwd_${r}`)||""]:["files",d],queryFn:async()=>{if(s){let z=localStorage.getItem(`share_pwd_${r}`)||"",g=await A.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:d}},{headers:{"x-share-password":z}});if(!g.ok)throw Error("Failed to fetch version asset");return await g.json()}let l=await A.api.files[":fileId"].$get({param:{fileId:d}});if(!l.ok)throw Error("Failed to fetch version asset");return await l.json()},enabled:!!d&&(!s||!!r)})}function Ll({isPublic:d=!1,shareId:s,versions:r,leftId:l,rightId:z,activeSide:g,annotations:V,seekRequest:w,onActiveSideChange:y,onSwitchVersion:m,onExit:N,onActiveAssetChange:q,onPlay:ne,onTimeUpdate:f,allowDownload:j=!0}){let Q=b(null),U=b(null),c=b(null),[ee,se]=u(null),[re,fe]=u(null),[a,M]=u(1),[O,G]=u(!1),[Te,ze]=u(!1),{data:Y,isLoading:Ve}=at(l,d,s),{data:X,isLoading:je}=at(z,d,s),Me=es(Y),De=es(X),te=!!Y&&!!X&&Me.id===De.id,T=g==="left"?Y:X,xe=g==="left"?ee:re,J=P(()=>g==="left"?U.current:c.current,[g]),Ie=P(()=>g==="left"?c.current:U.current,[g]);h(()=>{q(T??null)},[T,q]),h(()=>{if(!w)return;let n=J();if(n?.seekToSecond(w.second),n?.pause(),te){let p=Ie();p?.seekToSecond(w.second),p?.pause()}},[w?.nonce]),h(()=>{let n=()=>ze(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",n),()=>document.removeEventListener("fullscreenchange",n)},[]);let Pe=P((n)=>se(n),[]),Se=P((n)=>fe(n),[]),_=P((n)=>{let p=J();if(p)n(p);if(te){let R=Ie();if(R)n(R)}},[J,Ie,te]),ae=P(()=>{let n=!xe?.video?.isPlaying;_((p)=>n?p.play():p.pause())},[xe?.video?.isPlaying,_]);h(()=>{let n=(p)=>{let R=document.activeElement;if(R&&(R.tagName==="INPUT"||R.tagName==="TEXTAREA"||R instanceof HTMLElement&&R.isContentEditable))return;let He=p.key===" ",Ue=R&&(R.tagName==="BUTTON"||R.tagName==="A"||R.tagName==="SELECT"||R.tagName==="OPTION"||R.getAttribute("role")==="button"||R.getAttribute("role")==="link"||R.getAttribute("role")==="checkbox"||R.getAttribute("role")==="radio"||R.getAttribute("role")==="menuitem");if(He&&Ue)return;if(p.key===" "||p.key.toLowerCase()==="k")p.preventDefault(),ae()};return window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}},[ae]);let Ee=P((n)=>_((p)=>p.seekToFrame(n)),[_]),_e=P(()=>J()?.toggleLoop(),[J]),Oe=P((n)=>{M(n),G(n===0)},[]),Fe=P(()=>G((n)=>!n),[]),Le=P((n)=>_((p)=>p.setPlaybackRate(n)),[_]),e=P((n,p)=>J()?.changeResolution(n,p),[J]),i=P(()=>_((n)=>n.zoomBy(1.2)),[_]),v=P(()=>_((n)=>n.zoomBy(0.8)),[_]),oe=P(()=>_((n)=>n.fit()),[_]),ye=P((n)=>{J()?.download(n)},[J]),Ce=P(()=>{let n=Q.current;if(!n||typeof n.requestFullscreen!=="function")return;if(!document.fullscreenElement)n.requestFullscreen().catch(()=>{});else if(document.exitFullscreen)document.exitFullscreen().catch(()=>{})},[]),de=P((n,p)=>{if(te)c.current?.panBy(n,p)},[te]),Be=P((n,p)=>{if(te)U.current?.panBy(n,p)},[te]),x=P(()=>ae(),[ae]),pe=P((n)=>r.find((p)=>p.id===n)?.version,[r]),lt=D(()=>T?.media?.videoPreview?.url,[T?.media?.videoPreview?.url]),Ke=(n,p)=>{let He=es(p)?.comparePane;if(!He)return t("div",{className:"flex flex-1 items-center justify-center bg-gray-100 dark:bg-gray-950",children:t("p",{className:"text-muted-foreground",children:"Preview unavailable"})});let Ue=g===n;return t(He,{ref:n==="left"?U:c,file:p,shareId:s,isActive:Ue,annotations:Ue?V:[],onStateChange:n==="left"?Pe:Se,onUserPan:n==="left"?de:Be,onActivate:()=>y(n),muted:Ue?O:!0,volume:a,onPlay:ne,onTimeUpdate:f,onRequestTogglePlay:x},p.id)},dt=!!Y&&!!X,mt=Ve||je;return o("div",{ref:Q,className:"flex h-full flex-1 flex-col bg-background",children:[o("div",{className:"flex min-h-0 flex-1",children:[o("div",{className:"flex min-w-0 flex-1 flex-col border-r border-zinc-800",children:[Y&&t(qe,{side:"left",fileName:Y.name,version:pe(l),activeVersionId:l,versions:r,isActive:g==="left",onActivate:()=>y("left"),onSwitchVersion:(n)=>m("left",n),onExit:N}),t("div",{className:"relative flex min-h-0 flex-1",children:Y?Ke("left",Y):t("div",{className:"flex flex-1 items-center justify-center",children:t(F,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),o("div",{className:"flex min-w-0 flex-1 flex-col",children:[X&&t(qe,{side:"right",fileName:X.name,version:pe(z),activeVersionId:z,versions:r,isActive:g==="right",onActivate:()=>y("right"),onSwitchVersion:(n)=>m("right",n),onExit:N}),t("div",{className:"relative flex min-h-0 flex-1",children:X?Ke("right",X):t("div",{className:"flex flex-1 items-center justify-center",children:t(F,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),mt&&!dt&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:t(F,{className:"h-8 w-8 animate-spin text-foreground"})}),t(We,{activeState:xe,activeAsset:T??null,previewUrl:lt,isFullScreen:Te,onTogglePlay:ae,onToggleLoop:_e,onSeek:Ee,onVolumeChange:Oe,onToggleMute:Fe,onChangePlaybackRate:Le,onChangeResolution:e,onZoomIn:i,onZoomOut:v,onFit:oe,onDownload:ye,onToggleFullScreen:Ce,allowDownload:j})]})}
2
- export{Fl,Ll};
@@ -1,3 +0,0 @@
1
- // @bun
2
- function ln(n){let e={};for(let[t,r]of n.entries())e[t]=r;return e}function Ba(n){if(!n)return;let e={};for(let[t,r]of Object.entries(n))if(r!==null)e[t]=r;return Object.keys(e).length>0?e:void 0}
3
- export{ln,Ba};
@@ -1,2 +0,0 @@
1
- import{h,D,b,u,S,L,t,o,Z,ft,Me,A,F,nn,E,wS,H,on,Lo,Yd,Et,kt,Rt,Mt}from"./chunk-43dzhk24.js";import{xa}from"./chunk-07pgpftg.js";import{Ul,ts}from"./chunk-x79scans.js";import{Bl}from"./chunk-bcqhjbpy.js";import{Sa}from"./chunk-6h76kqv2.js";import{Fl,Ll}from"./chunk-g82qnxw6.js";import{Er}from"./chunk-twx715xf.js";import{vn}from"./chunk-mcq3pe4v.js";S();function va({shareId:r,initialFolderId:ye,initialFileId:X,startTime:G,versionId:P,compare:Ie,compareLeftId:j,compareRightId:z,compareActiveSide:J="left"}){let f=Me(),T=Lo(),w=!!Ie&&!!j&&!!z,[c,Y]=u(()=>localStorage.getItem(`share_pwd_${r}`)||""),[V,Fe]=u(""),{data:a,error:N,isLoading:be}=Z({queryKey:["share-info",r,c],queryFn:async()=>{let e=await A.api.shares[":shareId"].info.$get({param:{shareId:r}},{headers:{"x-share-password":c}});if(e.status===401)throw Error("Unauthorized");if(e.status===403){let s=await e.json();throw Error(s.error||"Forbidden")}if(!e.ok)throw Error("Failed to fetch share info");return await e.json()},retry:!1}),n=ye||a?.rootFolderId,d=X||null,U=P||d,[_,ee]=u([]),{data:q}=Z({queryKey:["public-share-folder",r,n,c],queryFn:async()=>{let e=await A.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:n}},{headers:{"x-share-password":c}});if(e.status===401)throw Error("Unauthorized");return await e.json()},enabled:!!a&&!!n});h(()=>{if(q?.ancestorFolders&&a){let e=q.ancestorFolders.findIndex((s)=>s.id===a.rootFolderId);if(e!==-1)ee(q.ancestorFolders.slice(0,e));else if(n===a.rootFolderId)ee([])}},[q,a,n]);let[R,m]=u(null),[v,p]=u(new Set),[Se,Pe]=u(360),[B,Ne]=u(()=>!X),C=b(null),[te,W]=u([]),[Ce,se]=u(0),[ke,ae]=u(null),[oe,Ae]=u(null),[je,ze]=u(void 0),{data:M,fetchNextPage:re,hasNextPage:ne,isFetchingNextPage:ie,isLoading:le,error:de}=ft({queryKey:["public-share-children",r,n,"folder",c],queryFn:async({pageParam:e})=>{let s=await A.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:r,folderId:n},query:{assetType:"folder",after:e}},{headers:{"x-share-password":c}});if(s.status===401)throw Error("Unauthorized");if(s.status===403)throw Error("Expired");return await s.json()},enabled:!!a&&!!n,initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0,retry:!1}),{data:K,fetchNextPage:ce,hasNextPage:fe,isFetchingNextPage:ue,isLoading:pe}=ft({queryKey:["public-share-children",r,n,"file",c],queryFn:async({pageParam:e})=>{let s=await A.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:r,folderId:n},query:{assetType:"file",after:e}},{headers:{"x-share-password":c}});if(s.status===401)throw Error("Unauthorized");if(s.status===403)throw Error("Expired");return await s.json()},enabled:!!a&&!!n,initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0,retry:!1}),{data:me}=Z({queryKey:["public-share-fields",r,c],queryFn:async()=>{let e=await A.api.shares[":shareId"].fields.$get({param:{shareId:r}},{headers:{"x-share-password":c}});if(e.status===401)throw Error("Unauthorized");return await e.json()},enabled:!!a}),{data:g,isLoading:De}=Z({queryKey:["public-share-file",r,d,c],queryFn:async()=>{let e=await A.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:d}},{headers:{"x-share-password":c}});if(e.status===401)throw Error("Unauthorized");return await e.json()},enabled:!!d&&!!a}),{data:Te,isLoading:$e}=Z({queryKey:["public-share-file",r,P,c],queryFn:async()=>{let e=await A.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:P}},{headers:{"x-share-password":c}});if(e.status===401)throw Error("Unauthorized");return await e.json()},enabled:!!P&&!!a}),i=P?Te:g,Ee=De||!!P&&$e;h(()=>{if(de?.message==="Unauthorized")Y(""),localStorage.removeItem(`share_pwd_${r}`)},[de,r]);let x=D(()=>M?.pages.flatMap((e)=>e.data??[])??[],[M]),y=D(()=>K?.pages.flatMap((e)=>e.data??[])??[],[K]),Le=M?.pages[0]?.pageInfo?.total,qe=K?.pages[0]?.pageInfo?.total,Re=M?.pages[0]?.pageInfo?.totalSize,Ke=K?.pages[0]?.pageInfo?.totalSize,he=D(()=>{if(i)return i;if(v.size!==1)return null;let e=Array.from(v)[0];return[...x,...y].find((s)=>s.id===e)||null},[v,x,y,i]),Ve=(e)=>{e.preventDefault(),Y(V),localStorage.setItem(`share_pwd_${r}`,V)},ge=(e)=>{if(e.type==="folder"||e.targetType==="folder")f({to:"/share/$shareId/folders/$folderId",params:{shareId:r,folderId:e.id}});else f({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:e.versionStack?e.versionStack.id:e.id}});p(new Set)},Ue=(e)=>{if(!a)return;let s=e==="root"?a.rootFolderId:e;if(s===a.rootFolderId)f({to:"/share/$shareId",params:{shareId:r}});else f({to:"/share/$shareId/folders/$folderId",params:{shareId:r,folderId:s}});p(new Set),m(null)},_e=(e)=>{ae(e.id||null);let s=e.annotations;if(s&&s.length>0)W(s);else W([]);if(w){if(e.second!==null&&e.second!==void 0)ze({second:e.second,nonce:Date.now()});return}if(e.second!==null&&e.second!==void 0)C.current?.seekTo(e.second),C.current?.pause();else if(s&&s.length>0)C.current?.pause()},we=()=>{W([]),ae(null)},O=(e)=>{if(!d)return;f({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:d},search:(s)=>({...s,...e})})},Be=()=>{O({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:J==="left"?j:z})},{setProjectState:xe,clearProjectState:ve}=on();h(()=>{if(a&&n){let e=n===a.rootFolderId?a.name:x.find((s)=>s.id===n)?.name||a.name;xe({teamId:"",projectId:a.projectId,projectName:a.name,ancestorFolders:_,currentAsset:{name:i?.name||e,type:d?"file":"folder",version:g?.versionStack?g.versionStack.versions.find((s)=>s.id===U)?.version??g.versionStack.versions.length:void 0,proxyType:i?.proxyType||null},isRootFolder:n===a.rootFolderId&&!d,isPublic:!0,shareId:r,fileId:d||void 0,allowDownload:a.allowDownload,downloadInfo:i?{originalKey:i.media?.original?.key,videoTranscodes:i.media?.videoTranscodes?.map((s)=>({key:s.key,width:s.width,height:s.height,hdr:s.hdr}))}:void 0,onFolderClick:Ue,isRightSidebarCollapsed:B,onRightSidebarToggle:()=>Ne((s)=>!s),versions:g?.versionStack?.versions,compareMode:w,canCompareVersions:(g?.versionStack?.versions?.length??0)>=2,onCompareVersions:()=>{let s=Ul(g?.versionStack?.versions);if(!s||!d)return;f({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:d},search:(l)=>({...l,compare:!0,cmpLeft:s.left.id,cmpRight:s.right.id,cmpActive:"left"})})}})}return()=>ve()},[a,n,x,i,g,U,d,_,xe,ve,B,w,f,r]);let I;if(be&&!N)I=t("div",{className:"flex flex-1 items-center justify-center bg-background",children:t(F,{className:"h-8 w-8 animate-spin text-foreground"})});else if(N)if(N.message==="Unauthorized"){let e=c!=="";I=t("div",{className:"flex flex-1 items-center justify-center p-4",children:o(Et,{className:"w-full max-w-md",children:[o(kt,{className:"text-center",children:[t("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:t(nn,{className:"h-6 w-6 text-primary"})}),t(Rt,{children:wS()})]}),t(Mt,{children:o("form",{onSubmit:Ve,className:"space-y-4",children:[o("div",{className:"space-y-2",children:[t(H,{type:"password",placeholder:"Enter password",value:V,onChange:(s)=>Fe(s.target.value),autoFocus:!0}),e&&t("p",{className:"text-sm font-medium text-destructive",children:"Incorrect password. Please try again."})]}),t(E,{type:"submit",className:"w-full",children:"Access Share"})]})})]})})}else{let e=N.message.includes("expired"),s=N.message.includes("disabled");I=t("div",{className:"flex flex-1 items-center justify-center p-4",children:o(Et,{className:"w-full max-w-md",children:[o(kt,{className:"text-center",children:[t("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:t(vn,{className:"h-6 w-6 text-destructive"})}),t(Rt,{children:e?"Share Expired":s?"Share Disabled":"Error"})]}),t(Mt,{className:"text-center text-muted-foreground",children:N.message})]})})}else if(!a)I=t("div",{className:"flex flex-1 items-center justify-center bg-background",children:t(F,{className:"h-8 w-8 animate-spin text-foreground"})});else if(T&&d&&!w&&i){let e=i?.ancestorFolders?.[0]?.id||(n!==a.rootFolderId?n:void 0),s=i?.ancestorFolders&&i.ancestorFolders.length>0?i.ancestorFolders:_;I=t(Fl,{projectId:a.projectId,fileId:d,file:i,projectInfo:{name:a.name,rootFolder:a.rootFolderId},ancestorFolders:s,versions:g?.versionStack?.versions??i?.versionStack?.versions,activeFileId:U||d,startTime:G,isPublic:!0,shareId:r,allowDownload:a.allowDownload,publicFields:me,siblingFiles:y,onNavigateToFile:(l)=>{f({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:l}})},onNavigateBack:()=>{if(e&&e!==a.rootFolderId)f({to:"/share/$shareId/folders/$folderId",params:{shareId:r,folderId:e}});else f({to:"/share/$shareId",params:{shareId:r}})},onSelectVersion:(l)=>{f({to:"/share/$shareId/files/$fileId",params:{shareId:r,fileId:d},search:(k)=>({...k,version:l})})},onSaveField:()=>{}})}else I=o("div",{className:"flex flex-1 overflow-hidden relative",children:[d?o("div",{className:"flex-1 relative bg-muted/30",children:[Ee&&!w&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:t(F,{className:"h-8 w-8 animate-spin text-foreground"})}),w&&j&&z?t(Ll,{isPublic:!0,shareId:r,versions:i?.versionStack?.versions??[],leftId:j,rightId:z,activeSide:J,annotations:te,seekRequest:je,allowDownload:a.allowDownload,onActiveSideChange:(e)=>O({cmpActive:e}),onSwitchVersion:(e,s)=>O(e==="left"?{cmpLeft:s}:{cmpRight:s}),onExit:Be,onActiveAssetChange:Ae,onPlay:we,onTimeUpdate:se}):i&&t(ts,{file:i,mediaControllerRef:C,onPlay:we,onTimeUpdate:se,annotations:te,startTime:G,shareId:r,allowDownload:a.allowDownload})]}):n&&(T?t(Bl,{teamId:"",projectId:a.projectId,assetId:n,folders:x,files:y,totalFolders:Le,totalFiles:qe,totalFoldersSize:Re,totalFilesSize:Ke,selectedItem:R,selectedIds:v,onItemSelect:(e,s)=>{if(s.metaKey||s.ctrlKey){let l=new Set(v);if(l.has(e.id)){if(l.delete(e.id),p(l),R?.id===e.id){let k=[...x,...y].find((Q)=>l.has(Q.id));m(k||null)}}else l.add(e.id),p(l),m(e)}else p(new Set([e.id])),m(e)},onItemDoubleClick:ge,onClearSelection:()=>{p(new Set),m(null)},fetchNextFoldersPage:re,hasNextFoldersPage:ne,isFetchingNextFoldersPage:ie,fetchNextFilesPage:ce,hasNextFilesPage:fe,isFetchingNextFilesPage:ue,isLoading:le||pe,isShareView:!0,isPublic:!0,shareId:r,allowDownload:a.allowDownload}):t(xa,{teamId:"",projectId:a.projectId,assetId:n,folders:x,files:y,selectedItem:R,selectedIds:v,onItemSelect:(e,s)=>{if(s.metaKey||s.ctrlKey){let l=new Set(v);if(l.has(e.id)){if(l.delete(e.id),p(l),R?.id===e.id){let k=[...x,...y].find((Q)=>l.has(Q.id));m(k||null)}}else l.add(e.id),p(l),m(e)}else p(new Set([e.id])),m(e)},onItemDoubleClick:ge,onSaveField:()=>{},displayStyle:a.viewMode??"card",onClearSelection:()=>{p(new Set),m(null)},fetchNextFoldersPage:re,hasNextFoldersPage:ne,isFetchingNextFoldersPage:ie,fetchNextFilesPage:ce,hasNextFilesPage:fe,isFetchingNextFilesPage:ue,isLoading:le||pe,isShareView:!0,isPublic:!0,shareId:r,sharePassword:c,allowDownload:a.allowDownload})),!B&&!T&&o(L,{children:[t(Er,{onResize:(e)=>Pe((s)=>Math.max(240,Math.min(600,s-e)))}),t("div",{style:{width:Se},className:"flex-shrink-0 border-l",children:t(Sa,{teamId:"",projectId:a.projectId,file:w?oe:he,onSaveField:()=>{},members:[],readOnly:!0,publicFields:me,onCommentSelect:_e,isPublic:!0,shareId:r,currentTime:Ce,onTyping:()=>{C.current?.pause()},selectedCommentId:ke,hideAnnotationControl:(w?oe:he)?.proxyType==="audio"})})]})]});return o("div",{className:"flex h-[100dvh] flex-col bg-background",children:[(!T||!d)&&t(Yd,{}),I]})}
2
- export{va};
@@ -1 +0,0 @@
1
- import{h,S,t,Z,Ue,A,lt,wt,Vp}from"./chunk-43dzhk24.js";import"./chunk-x79scans.js";import"./chunk-07pgpftg.js";import"./chunk-6vst0k0k.js";import"./chunk-yeb5bcxz.js";import"./chunk-5pcv139g.js";import"./chunk-0jaj2807.js";import"./chunk-xmn5v64e.js";import"./chunk-qn37fsy3.js";import"./chunk-yvz2b957.js";import"./chunk-bcqhjbpy.js";import"./chunk-1zpsbvq9.js";import"./chunk-6h76kqv2.js";import"./chunk-twx715xf.js";import{Gn}from"./chunk-dk2trprj.js";import{rr}from"./chunk-faaqparg.js";import"./chunk-rzannb5e.js";import"./chunk-j95fjg69.js";import"./chunk-sf9ezxgy.js";import"./chunk-67ewr4j4.js";import"./chunk-mcq3pe4v.js";import"./chunk-jgnp68ez.js";import"./chunk-4tm9cw4v.js";import"./chunk-jhxcm88f.js";S();function l(){let{projectId:o}=c.useParams(),{teamId:r,ensureTeamIdForProject:a}=lt();h(()=>{a(o)},[o,a]);let{data:s}=rr(Vp(o)),e=s?.rootFolder,{data:i}=Z({queryKey:["folders",e],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:e}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!e});if(!r||!e||!i)return t(wt,{});return t(Gn,{teamId:r,projectId:o,projectName:s.name??"",assetId:e,rootFolderId:e})}var c=Ue("/projects/$projectId/")({component:l});export{c as Route};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{of,Pn,ic,lc,cc,uc,yu,bu,lm,bA,Ss,jo,zr}from"./chunk-ze3msq86.js";export{cc as EncryptJWT,lc as SignJWT,lm as UnsecuredJWT,of as base64url,uc as calculateJwkThumbprint,yu as createLocalJWKSet,bu as createRemoteJWKSet,zr as decodeJwt,jo as decodeProtectedHeader,Ss as importJWK,bA as importPKCS8,ic as jwtDecrypt,Pn as jwtVerify};
@@ -1 +0,0 @@
1
- import{t,Ue}from"./chunk-43dzhk24.js";import"./chunk-07pgpftg.js";import"./chunk-6vst0k0k.js";import"./chunk-yeb5bcxz.js";import"./chunk-x79scans.js";import"./chunk-5pcv139g.js";import"./chunk-yvz2b957.js";import"./chunk-bcqhjbpy.js";import"./chunk-1zpsbvq9.js";import"./chunk-6h76kqv2.js";import"./chunk-0jaj2807.js";import"./chunk-g82qnxw6.js";import"./chunk-twx715xf.js";import{va}from"./chunk-j6ptdqp9.js";import"./chunk-rzannb5e.js";import"./chunk-sf9ezxgy.js";import"./chunk-67ewr4j4.js";import"./chunk-mcq3pe4v.js";import"./chunk-jgnp68ez.js";import"./chunk-4tm9cw4v.js";import"./chunk-jhxcm88f.js";function a(){let{shareId:e}=s.useParams();return t(va,{shareId:e})}var s=Ue("/share/$shareId/")({component:a});export{s as Route};