@shumai-one/shumai 0.2.2 → 0.2.3

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 (41) hide show
  1. package/bin/{chunk-fd5a3pdd.js → chunk-2a9n3dhx.js} +1 -1
  2. package/bin/{chunk-4e3jbp84.js → chunk-3hzj13pj.js} +1 -1
  3. package/bin/{chunk-fa2g2wge.js → chunk-3n1rezd0.js} +1 -1
  4. package/bin/{chunk-ry33f2qk.js → chunk-3qks722n.js} +1 -1
  5. package/bin/{chunk-sd86v1e6.js → chunk-5vkf99sk.js} +1 -1
  6. package/bin/{chunk-qqk51620.js → chunk-6xg65n5y.js} +1 -1
  7. package/bin/{chunk-h0ytx8zc.js → chunk-6zascpcz.js} +1 -1
  8. package/bin/{chunk-jf3vn5c3.js → chunk-898q6x3q.js} +1 -1
  9. package/bin/chunk-8dqq1fk0.js +2 -0
  10. package/bin/{chunk-xyjw8w3r.js → chunk-b73ktdmd.js} +1 -1
  11. package/bin/{chunk-szzff7gd.js → chunk-carknytp.js} +1 -1
  12. package/bin/chunk-chkx04mw.js +1 -0
  13. package/bin/{chunk-pq18zenh.js → chunk-crt1e1w1.js} +1 -1
  14. package/bin/{chunk-5m9be8an.js → chunk-dgat7wqv.js} +1 -1
  15. package/bin/{chunk-wg98cacx.js → chunk-dm2w12rc.js} +1 -1
  16. package/bin/{chunk-de99643r.js → chunk-g21jxrt9.js} +1 -1
  17. package/bin/{chunk-4jk0y1w1.js → chunk-hnhq0dh9.js} +1 -1
  18. package/bin/{chunk-y2qp11v9.js → chunk-j0c7d9y1.js} +1 -1
  19. package/bin/chunk-jqh8kavv.js +2 -0
  20. package/bin/{chunk-5r8858hx.js → chunk-js9yf457.js} +1 -1
  21. package/bin/{chunk-f14sqw1d.js → chunk-jyzegph4.js} +1 -1
  22. package/bin/{chunk-fepymbka.js → chunk-mnfqdxms.js} +1 -1
  23. package/bin/{chunk-7e06b2zb.js → chunk-nhsqp8jc.js} +1 -1
  24. package/bin/chunk-nnkkem25.js +3 -0
  25. package/bin/{chunk-92xxys10.js → chunk-qwg2e3wr.js} +2 -2
  26. package/bin/{chunk-tspps87j.js → chunk-se8rgwp8.js} +1 -1
  27. package/bin/{chunk-pmswtfe3.css → chunk-tm6z4hkd.css} +1 -1
  28. package/bin/chunk-wckjyvtb.js +5 -0
  29. package/bin/{chunk-q24epdh8.js → chunk-wfx81mfv.js} +1 -1
  30. package/bin/chunk-wtjc4565.js +1 -0
  31. package/bin/{chunk-r0w920zb.js → chunk-y79r28gd.js} +1 -1
  32. package/bin/{chunk-8mkfgcvb.js → chunk-yj4x7tpw.js} +1 -1
  33. package/bin/shumai-app.html +1 -1
  34. package/bin/shumai-app.js +2 -2
  35. package/package.json +8 -8
  36. package/bin/chunk-2g12s6mc.js +0 -2
  37. package/bin/chunk-54tr7y2x.js +0 -3
  38. package/bin/chunk-byqc8tzq.js +0 -1
  39. package/bin/chunk-ccw7mjgq.js +0 -5
  40. package/bin/chunk-f7sbkfmk.js +0 -2
  41. package/bin/chunk-g6zzg6v2.js +0 -1
@@ -1 +1 @@
1
- import{g as v}from"./chunk-qqk51620.js";import"./chunk-h0ytx8zc.js";import"./chunk-xyjw8w3r.js";import"./chunk-ccw7mjgq.js";import"./chunk-pq18zenh.js";import"./chunk-wsyg4rwg.js";import"./chunk-7e06b2zb.js";import"./chunk-srn8t0v7.js";import"./chunk-kfhtk3eh.js";import"./chunk-kr06nrbx.js";import"./chunk-b8js74jk.js";import"./chunk-0xbf8bcg.js";import"./chunk-wg98cacx.js";import"./chunk-15sefy5t.js";import"./chunk-77r8w95d.js";import"./chunk-t3t6021k.js";import"./chunk-54tr7y2x.js";import"./chunk-1xpec5r8.js";import"./chunk-0rxhc7ka.js";import"./chunk-fa2g2wge.js";import"./chunk-fz88kkk1.js";import"./chunk-dghtwyq1.js";import"./chunk-gswbc6y9.js";import{Gh as q,oh as k}from"./chunk-nyhqy6q2.js";import"./chunk-0qkj838r.js";function B(){let{shareId:w,folderId:A}=C.useParams();return k(v,{shareId:w,initialFolderId:A})}var C=q("/share/$shareId/folders/$folderId")({component:B});export{C as Route};
1
+ import{g as v}from"./chunk-6xg65n5y.js";import"./chunk-6zascpcz.js";import"./chunk-b73ktdmd.js";import"./chunk-wckjyvtb.js";import"./chunk-crt1e1w1.js";import"./chunk-wsyg4rwg.js";import"./chunk-nhsqp8jc.js";import"./chunk-srn8t0v7.js";import"./chunk-kfhtk3eh.js";import"./chunk-kr06nrbx.js";import"./chunk-b8js74jk.js";import"./chunk-0xbf8bcg.js";import"./chunk-dm2w12rc.js";import"./chunk-15sefy5t.js";import"./chunk-77r8w95d.js";import"./chunk-t3t6021k.js";import"./chunk-nnkkem25.js";import"./chunk-1xpec5r8.js";import"./chunk-0rxhc7ka.js";import"./chunk-3n1rezd0.js";import"./chunk-fz88kkk1.js";import"./chunk-dghtwyq1.js";import"./chunk-gswbc6y9.js";import{Gh as q,oh as k}from"./chunk-nyhqy6q2.js";import"./chunk-0qkj838r.js";function B(){let{shareId:w,folderId:A}=C.useParams();return k(v,{shareId:w,initialFolderId:A})}var C=q("/share/$shareId/folders/$folderId")({component:B});export{C as Route};
@@ -1 +1 @@
1
- import{h as RB,i as bB}from"./chunk-h0ytx8zc.js";import{k as gB}from"./chunk-f7sbkfmk.js";import{p as LB,s as MB}from"./chunk-xyjw8w3r.js";import{O as NB}from"./chunk-pq18zenh.js";import"./chunk-wsyg4rwg.js";import{Va as DB}from"./chunk-srn8t0v7.js";import"./chunk-kfhtk3eh.js";import"./chunk-b8js74jk.js";import"./chunk-0xbf8bcg.js";import{Af as kB}from"./chunk-ry33f2qk.js";import"./chunk-77r8w95d.js";import{hg as VB,ig as wB}from"./chunk-54tr7y2x.js";import"./chunk-0rxhc7ka.js";import{og as $B,pg as EB}from"./chunk-fa2g2wge.js";import"./chunk-fz88kkk1.js";import"./chunk-dghtwyq1.js";import{bh as PB}from"./chunk-gswbc6y9.js";import{Bh as qB,Dh as YB,Gh as TB,Mi as _B,Sh as q,ai as p,gk as UB,kh as d,mh as XB,mk as yB,nh as zB,ni as ZB,oh as G,ph as D,qh as HB,th as j,vh as QB}from"./chunk-nyhqy6q2.js";import{Vk as KB}from"./chunk-0qkj838r.js";var $=KB(XB(),1);var tB=({item:J})=>{if(J.preview?.thumbnailUrl)return G("img",{src:J.preview.thumbnailUrl,alt:"Preview",className:"w-full h-full object-cover"});if(J.preview?.proxyType==="audio"||J.proxyType==="audio")return G("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:G(ZB,{className:"w-5 h-5 text-muted-foreground"})});return G("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:G(_B,{className:"w-5 h-5 text-muted-foreground"})})},OB=({projectId:J,currentAssetId:X,parentFolderId:Q,initialFiles:_,initialNextCursor:w})=>{let{ref:z,inView:k}=$B({threshold:0,rootMargin:"200px"}),T=$.useRef(null),N=$.useRef(!1),[O,y]=$.useState(_),[Z,R]=$.useState(w),[b,S]=$.useState(!!w),[L,P]=$.useState(!1);return $.useEffect(()=>{y(_),R(w),S(!!w),N.current=!1},[_,w]),$.useEffect(()=>{(async()=>{if(!Z||L||!k||!b)return;P(!0);try{let W=await q.api.folders[":folderId"].search.$post({param:{folderId:Q},json:{assetType:"file",after:Z,first:200,recursively:!1,conditions:[]}});if(!W.ok)throw Error("Failed to fetch next page");let g=await W.json(),M=g.data||[];y((f)=>[...f,...M]),R(g.pageInfo?.cursor||void 0),S(!!g.pageInfo?.cursor&&M.length>0)}catch(W){console.error("Error fetching next page:",W)}finally{P(!1)}})()},[k,Z,b,L,Q]),$.useEffect(()=>{N.current=!1},[X]),$.useEffect(()=>{if(O.some((W)=>W?.id===X)&&T.current&&!N.current)T.current.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}),N.current=!0},[O,X]),G("div",{className:"h-24 md:h-full w-full md:w-24 bg-gray-100 dark:bg-gray-950 flex flex-row md:flex-col flex-shrink-0 select-none",children:D("div",{className:"flex-1 overflow-x-auto overflow-y-hidden md:overflow-y-auto md:overflow-x-hidden px-4 md:px-0 py-2 md:py-4 flex flex-row md:flex-col items-center gap-3 no-scrollbar",children:[O.map((H)=>{if(!H)return null;let W=H.id===X;return G("div",{ref:H.id===X?T:null,className:"flex-shrink-0",children:G(YB,{to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:H.id},search:{version:void 0},className:UB("rounded-lg border overflow-hidden flex items-center justify-center transition-all bg-muted/30 block",W?"w-[62px] h-[62px] opacity-100":"w-[52px] h-[52px] opacity-60 hover:opacity-100"),children:G(tB,{item:H})})},H.id)}),b&&G("div",{ref:z,className:"px-2 md:px-0 py-2 md:py-4 flex justify-center items-center h-full md:w-full flex-shrink-0",children:L&&G(p,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})})};var Y=KB(XB(),1);function eB(){let{projectId:J,fileId:X}=WB.useParams(),Q=WB.useSearch(),_=Q.version,w=Q.start,z=_||X,k=Q.cmpLeft,T=Q.cmpRight,N=Q.cmpActive??"left",O=!!Q.compare&&!!k&&!!T,y=Y.useRef(null),{teamId:Z,ensureTeamIdForProject:R}=PB(),[b,S]=Y.useState(360),[L,P]=Y.useState([]),{fileViewRightSidebarCollapsed:H}=EB(),{isChatbotOpen:W}=wB(),[g,M]=Y.useState(0),[f,C]=Y.useState(null),[l,AB]=Y.useState(null),[xB,jB]=Y.useState(void 0),[A,I]=Y.useState({show:!1,files:[],nextCursor:void 0,folderId:void 0}),SB=q.api.files[":fileId"].metadata.$patch,{mutate:CB}=QB({mutationFn:async(B)=>{let K=await SB(B);if(!K.ok)throw Error("Failed to patch metadata");return await K.json()}}),hB=HB(),{members:FB,fetchMembers:n}=NB();Y.useEffect(()=>{R(J)},[J,R]),Y.useEffect(()=>{if(Z)n(Z,!0)},[Z,n]);let{data:o,isLoading:vB,isError:pB,isFetching:fB}=j({queryKey:["files",X],queryFn:async()=>{let B=await q.api.files[":fileId"].$get({param:{fileId:X}});if(!B.ok)throw Error("Failed to fetch stack");return await B.json()},enabled:!!Z,placeholderData:d}),{data:IB,isLoading:mB,isError:uB,isFetching:cB}=j({queryKey:["files",_],queryFn:async()=>{let B=await q.api.files[":fileId"].$get({param:{fileId:_}});if(!B.ok)throw Error("Failed to fetch version");return await B.json()},enabled:!!Z&&!!_,placeholderData:d}),{data:dB}=j({queryKey:["version_stacks",X,"versions"],queryFn:async()=>{let B=await q.api.version_stacks[":stackId"].versions.$get({param:{stackId:X}});if(!B.ok)throw Error("Failed to fetch versions");return await B.json()},enabled:!!J&&!!X&&(!!_||O)}),{data:x}=j({queryKey:["projects",J],queryFn:async()=>{let B=await q.api.projects[":projectId"].$get({param:{projectId:J}});if(!B.ok)throw Error("Failed to fetch project");return await B.json()}}),h=qB(),{setProjectState:a,clearProjectState:r}=VB(),lB=vB||!!_&&mB,nB=pB||!!_&&uB,oB=fB||!!_&&cB,U=IB||o,V=_?dB:o?.versionStack?.versions;Y.useEffect(()=>{if(U&&x&&Z)a({teamId:Z,projectId:J,projectName:x.name??"",ancestorFolders:U.ancestorFolders??[],currentAsset:{name:U.name,type:"file",version:V?V.find((B)=>B.id===z)?.version??V.length:void 0,proxyType:U.proxyType},isRootFolder:!1,fileId:X,downloadInfo:{originalKey:U.media?.original?.key,videoTranscodes:U.media?.videoTranscodes?.map((B)=>({key:B.key,width:B.width,height:B.height,isRaw:B.isRaw}))},versions:V,compareMode:O,canCompareVersions:(V?.length??0)>=2,onCompareVersions:()=>{let B=LB(V);if(!B)return;h({to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:X},search:(K)=>({...K,version:void 0,compare:!0,cmpLeft:B.left.id,cmpRight:B.right.id,cmpActive:"left"})})},onFolderClick:(B)=>{h({to:"/projects/$projectId/folders/$folderId",params:{projectId:J,folderId:B}})}});return()=>r()},[Z,J,x,U,V,z,X,O,a,r,h]);let E=U?.ancestorFolders?.[0]?.id??x?.rootFolder??"";if(Y.useEffect(()=>{if(!E||!z)return;if(A.folderId===E)return;let B=!0;return(async()=>{try{let F="",t=!1,e=[],BB=void 0;for(let GB=0;GB<5;GB++){let JB=await q.api.folders[":folderId"].search.$post({param:{folderId:E},json:{assetType:"file",after:F,first:200,recursively:!1,conditions:[]}});if(!JB.ok)throw Error("Failed to search parent folder for carousel");let v=await JB.json(),c=v.data||[];if(e.push(...c),c.some((sB)=>sB.id===z)){t=!0,BB=v.pageInfo?.cursor||void 0;break}if(!v.pageInfo?.cursor||c.length<200)break;F=v.pageInfo.cursor}if(B)if(t)I({show:!0,files:e,nextCursor:BB,folderId:E});else I({show:!1,files:[],nextCursor:void 0,folderId:E})}catch(F){if(console.error(F),B)I({show:!1,files:[],nextCursor:void 0,folderId:E})}})(),()=>{B=!1}},[E,z,A.folderId]),Y.useEffect(()=>{M(0),C(null),P([])},[U?.id]),Y.useEffect(()=>{C(null),P([])},[l?.id]),lB&&!U)return G(kB,{});if(nB||!U||!x||!Z)return G("div",{children:yB.file_not_found()});let m=O?l:U,i=m?.id??z,aB=(B,K)=>{if(!Z)return;CB({param:{fileId:i},json:[{key:B,value:K}]},{onSuccess:()=>{hB.invalidateQueries({queryKey:["files",i]})}})},u=(B)=>{h({to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:X},search:(K)=>({...K,...B})})},rB=()=>{u({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:N==="left"?k:T})},iB=(B)=>{C(B.id||null);let K=B.annotations;if(K&&K.length>0)P(K);else P([]);if(O){if(B.second!==null&&B.second!==void 0)jB({second:B.second,nonce:Date.now()});return}if(B.second!==null&&B.second!==void 0)y.current?.seekTo(B.second),y.current?.pause();else if(K&&K.length>0)y.current?.pause()},s=()=>{P([]),C(null)};return G("div",{className:"h-full flex flex-1 flex-col bg-background",children:D("div",{className:"h-full flex flex-1 overflow-hidden",children:[D("div",{className:"flex-1 relative",children:[oB&&!O&&G("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:G(p,{className:"h-8 w-8 animate-spin text-foreground"})}),O&&k&&T?G(bB,{versions:V??[],leftId:k,rightId:T,activeSide:N,annotations:L,seekRequest:xB,onActiveSideChange:(B)=>u({cmpActive:B}),onSwitchVersion:(B,K)=>u(B==="left"?{cmpLeft:K}:{cmpRight:K}),onExit:rB,onActiveAssetChange:AB,onPlay:s,onTimeUpdate:M}):G(RB,{file:U,mediaControllerRef:y,onPlay:s,onTimeUpdate:M,annotations:L,startTime:w,children:A.show&&G(OB,{projectId:J,currentAssetId:z,parentFolderId:E,initialFiles:A.files,initialNextCursor:A.nextCursor})})]}),(!H||W)&&D(zB,{children:[G(DB,{onResize:(B)=>{S((K)=>Math.max(300,Math.min(600,K-B)))},className:"hidden md:block"}),G("div",{style:{width:b},className:"flex-shrink-0 bg-background flex flex-col",children:W?G(gB,{projectId:J,contextAssetId:z}):G(MB,{teamId:Z,projectId:J,file:m,onSaveField:aB,members:FB,onCommentSelect:iB,currentTime:g,onTyping:()=>{if(O)return;y.current?.pause()},selectedCommentId:f,hideAnnotationControl:m?.proxyType==="audio"})})]})]})})}var WB=TB("/projects/$projectId/files/$fileId")({component:eB});export{WB as Route};
1
+ import{h as RB,i as bB}from"./chunk-6zascpcz.js";import{k as gB}from"./chunk-8dqq1fk0.js";import{p as LB,s as MB}from"./chunk-b73ktdmd.js";import{O as NB}from"./chunk-crt1e1w1.js";import"./chunk-wsyg4rwg.js";import{Va as DB}from"./chunk-srn8t0v7.js";import"./chunk-kfhtk3eh.js";import"./chunk-b8js74jk.js";import"./chunk-0xbf8bcg.js";import{Af as kB}from"./chunk-3qks722n.js";import"./chunk-77r8w95d.js";import{hg as VB,ig as wB}from"./chunk-nnkkem25.js";import"./chunk-0rxhc7ka.js";import{og as $B,pg as EB}from"./chunk-3n1rezd0.js";import"./chunk-fz88kkk1.js";import"./chunk-dghtwyq1.js";import{bh as PB}from"./chunk-gswbc6y9.js";import{Bh as qB,Dh as YB,Gh as TB,Mi as _B,Sh as q,ai as p,gk as UB,kh as d,mh as XB,mk as yB,nh as zB,ni as ZB,oh as G,ph as D,qh as HB,th as j,vh as QB}from"./chunk-nyhqy6q2.js";import{Vk as KB}from"./chunk-0qkj838r.js";var $=KB(XB(),1);var tB=({item:J})=>{if(J.preview?.thumbnailUrl)return G("img",{src:J.preview.thumbnailUrl,alt:"Preview",className:"w-full h-full object-cover"});if(J.preview?.proxyType==="audio"||J.proxyType==="audio")return G("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:G(ZB,{className:"w-5 h-5 text-muted-foreground"})});return G("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:G(_B,{className:"w-5 h-5 text-muted-foreground"})})},OB=({projectId:J,currentAssetId:X,parentFolderId:Q,initialFiles:_,initialNextCursor:w})=>{let{ref:z,inView:k}=$B({threshold:0,rootMargin:"200px"}),T=$.useRef(null),N=$.useRef(!1),[O,y]=$.useState(_),[Z,R]=$.useState(w),[b,S]=$.useState(!!w),[L,P]=$.useState(!1);return $.useEffect(()=>{y(_),R(w),S(!!w),N.current=!1},[_,w]),$.useEffect(()=>{(async()=>{if(!Z||L||!k||!b)return;P(!0);try{let W=await q.api.folders[":folderId"].search.$post({param:{folderId:Q},json:{assetType:"file",after:Z,first:200,recursively:!1,conditions:[]}});if(!W.ok)throw Error("Failed to fetch next page");let g=await W.json(),M=g.data||[];y((f)=>[...f,...M]),R(g.pageInfo?.cursor||void 0),S(!!g.pageInfo?.cursor&&M.length>0)}catch(W){console.error("Error fetching next page:",W)}finally{P(!1)}})()},[k,Z,b,L,Q]),$.useEffect(()=>{N.current=!1},[X]),$.useEffect(()=>{if(O.some((W)=>W?.id===X)&&T.current&&!N.current)T.current.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}),N.current=!0},[O,X]),G("div",{className:"h-24 md:h-full w-full md:w-24 bg-gray-100 dark:bg-gray-950 flex flex-row md:flex-col flex-shrink-0 select-none",children:D("div",{className:"flex-1 overflow-x-auto overflow-y-hidden md:overflow-y-auto md:overflow-x-hidden px-4 md:px-0 py-2 md:py-4 flex flex-row md:flex-col items-center gap-3 no-scrollbar",children:[O.map((H)=>{if(!H)return null;let W=H.id===X;return G("div",{ref:H.id===X?T:null,className:"flex-shrink-0",children:G(YB,{to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:H.id},search:{version:void 0},className:UB("rounded-lg border overflow-hidden flex items-center justify-center transition-all bg-muted/30 block",W?"w-[62px] h-[62px] opacity-100":"w-[52px] h-[52px] opacity-60 hover:opacity-100"),children:G(tB,{item:H})})},H.id)}),b&&G("div",{ref:z,className:"px-2 md:px-0 py-2 md:py-4 flex justify-center items-center h-full md:w-full flex-shrink-0",children:L&&G(p,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})})};var Y=KB(XB(),1);function eB(){let{projectId:J,fileId:X}=WB.useParams(),Q=WB.useSearch(),_=Q.version,w=Q.start,z=_||X,k=Q.cmpLeft,T=Q.cmpRight,N=Q.cmpActive??"left",O=!!Q.compare&&!!k&&!!T,y=Y.useRef(null),{teamId:Z,ensureTeamIdForProject:R}=PB(),[b,S]=Y.useState(360),[L,P]=Y.useState([]),{fileViewRightSidebarCollapsed:H}=EB(),{isChatbotOpen:W}=wB(),[g,M]=Y.useState(0),[f,C]=Y.useState(null),[l,AB]=Y.useState(null),[xB,jB]=Y.useState(void 0),[A,I]=Y.useState({show:!1,files:[],nextCursor:void 0,folderId:void 0}),SB=q.api.files[":fileId"].metadata.$patch,{mutate:CB}=QB({mutationFn:async(B)=>{let K=await SB(B);if(!K.ok)throw Error("Failed to patch metadata");return await K.json()}}),hB=HB(),{members:FB,fetchMembers:n}=NB();Y.useEffect(()=>{R(J)},[J,R]),Y.useEffect(()=>{if(Z)n(Z,!0)},[Z,n]);let{data:o,isLoading:vB,isError:pB,isFetching:fB}=j({queryKey:["files",X],queryFn:async()=>{let B=await q.api.files[":fileId"].$get({param:{fileId:X}});if(!B.ok)throw Error("Failed to fetch stack");return await B.json()},enabled:!!Z,placeholderData:d}),{data:IB,isLoading:mB,isError:uB,isFetching:cB}=j({queryKey:["files",_],queryFn:async()=>{let B=await q.api.files[":fileId"].$get({param:{fileId:_}});if(!B.ok)throw Error("Failed to fetch version");return await B.json()},enabled:!!Z&&!!_,placeholderData:d}),{data:dB}=j({queryKey:["version_stacks",X,"versions"],queryFn:async()=>{let B=await q.api.version_stacks[":stackId"].versions.$get({param:{stackId:X}});if(!B.ok)throw Error("Failed to fetch versions");return await B.json()},enabled:!!J&&!!X&&(!!_||O)}),{data:x}=j({queryKey:["projects",J],queryFn:async()=>{let B=await q.api.projects[":projectId"].$get({param:{projectId:J}});if(!B.ok)throw Error("Failed to fetch project");return await B.json()}}),h=qB(),{setProjectState:a,clearProjectState:r}=VB(),lB=vB||!!_&&mB,nB=pB||!!_&&uB,oB=fB||!!_&&cB,U=IB||o,V=_?dB:o?.versionStack?.versions;Y.useEffect(()=>{if(U&&x&&Z)a({teamId:Z,projectId:J,projectName:x.name??"",ancestorFolders:U.ancestorFolders??[],currentAsset:{name:U.name,type:"file",version:V?V.find((B)=>B.id===z)?.version??V.length:void 0,proxyType:U.proxyType},isRootFolder:!1,fileId:X,downloadInfo:{originalKey:U.media?.original?.key,videoTranscodes:U.media?.videoTranscodes?.map((B)=>({key:B.key,width:B.width,height:B.height,isRaw:B.isRaw}))},versions:V,compareMode:O,canCompareVersions:(V?.length??0)>=2,onCompareVersions:()=>{let B=LB(V);if(!B)return;h({to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:X},search:(K)=>({...K,version:void 0,compare:!0,cmpLeft:B.left.id,cmpRight:B.right.id,cmpActive:"left"})})},onFolderClick:(B)=>{h({to:"/projects/$projectId/folders/$folderId",params:{projectId:J,folderId:B}})}});return()=>r()},[Z,J,x,U,V,z,X,O,a,r,h]);let E=U?.ancestorFolders?.[0]?.id??x?.rootFolder??"";if(Y.useEffect(()=>{if(!E||!z)return;if(A.folderId===E)return;let B=!0;return(async()=>{try{let F="",t=!1,e=[],BB=void 0;for(let GB=0;GB<5;GB++){let JB=await q.api.folders[":folderId"].search.$post({param:{folderId:E},json:{assetType:"file",after:F,first:200,recursively:!1,conditions:[]}});if(!JB.ok)throw Error("Failed to search parent folder for carousel");let v=await JB.json(),c=v.data||[];if(e.push(...c),c.some((sB)=>sB.id===z)){t=!0,BB=v.pageInfo?.cursor||void 0;break}if(!v.pageInfo?.cursor||c.length<200)break;F=v.pageInfo.cursor}if(B)if(t)I({show:!0,files:e,nextCursor:BB,folderId:E});else I({show:!1,files:[],nextCursor:void 0,folderId:E})}catch(F){if(console.error(F),B)I({show:!1,files:[],nextCursor:void 0,folderId:E})}})(),()=>{B=!1}},[E,z,A.folderId]),Y.useEffect(()=>{M(0),C(null),P([])},[U?.id]),Y.useEffect(()=>{C(null),P([])},[l?.id]),lB&&!U)return G(kB,{});if(nB||!U||!x||!Z)return G("div",{children:yB.file_not_found()});let m=O?l:U,i=m?.id??z,aB=(B,K)=>{if(!Z)return;CB({param:{fileId:i},json:[{key:B,value:K}]},{onSuccess:()=>{hB.invalidateQueries({queryKey:["files",i]})}})},u=(B)=>{h({to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:X},search:(K)=>({...K,...B})})},rB=()=>{u({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:N==="left"?k:T})},iB=(B)=>{C(B.id||null);let K=B.annotations;if(K&&K.length>0)P(K);else P([]);if(O){if(B.second!==null&&B.second!==void 0)jB({second:B.second,nonce:Date.now()});return}if(B.second!==null&&B.second!==void 0)y.current?.seekTo(B.second),y.current?.pause();else if(K&&K.length>0)y.current?.pause()},s=()=>{P([]),C(null)};return G("div",{className:"h-full flex flex-1 flex-col bg-background",children:D("div",{className:"h-full flex flex-1 overflow-hidden",children:[D("div",{className:"flex-1 relative",children:[oB&&!O&&G("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:G(p,{className:"h-8 w-8 animate-spin text-foreground"})}),O&&k&&T?G(bB,{versions:V??[],leftId:k,rightId:T,activeSide:N,annotations:L,seekRequest:xB,onActiveSideChange:(B)=>u({cmpActive:B}),onSwitchVersion:(B,K)=>u(B==="left"?{cmpLeft:K}:{cmpRight:K}),onExit:rB,onActiveAssetChange:AB,onPlay:s,onTimeUpdate:M}):G(RB,{file:U,mediaControllerRef:y,onPlay:s,onTimeUpdate:M,annotations:L,startTime:w,children:A.show&&G(OB,{projectId:J,currentAssetId:z,parentFolderId:E,initialFiles:A.files,initialNextCursor:A.nextCursor})})]}),(!H||W)&&D(zB,{children:[G(DB,{onResize:(B)=>{S((K)=>Math.max(300,Math.min(600,K-B)))},className:"hidden md:block"}),G("div",{style:{width:b},className:"flex-shrink-0 bg-background flex flex-col",children:W?G(gB,{projectId:J,contextAssetId:z}):G(MB,{teamId:Z,projectId:J,file:m,onSaveField:aB,members:FB,onCommentSelect:iB,currentTime:g,onTyping:()=>{if(O)return;y.current?.pause()},selectedCommentId:f,hideAnnotationControl:m?.proxyType==="audio"})})]})]})})}var WB=TB("/projects/$projectId/files/$fileId")({component:eB});export{WB as Route};
@@ -1,2 +1,2 @@
1
- import{Lh as g,Nh as _,Oh as h,gk as a,mh as x,oh as v}from"./chunk-nyhqy6q2.js";import{Vk as M}from"./chunk-0qkj838r.js";var m=M(x(),1),J=M(x(),1),N=M(x(),1);var T=new Map,W=new WeakMap,O=0,I;function w(S){if(!S)return"0";if(W.has(S))return W.get(S);return O+=1,W.set(S,O.toString()),W.get(S)}function p(S){return Object.keys(S).sort().filter((d)=>S[d]!==void 0).map((d)=>{return`${d}_${d==="root"?w(S.root):S[d]}`}).toString()}function k(S){let d=p(S),C=T.get(d);if(!C){let D=new Map,q,F=new IntersectionObserver((f)=>{f.forEach((L)=>{var U;let G=L.isIntersecting&&q.some((A)=>L.intersectionRatio>=A);if(S.trackVisibility&&typeof L.isVisible>"u")L.isVisible=G;[...(U=D.get(L.target))!=null?U:[]].forEach((A)=>{A(G,L)})})},S);q=F.thresholds||(Array.isArray(S.threshold)?S.threshold:[S.threshold||0]),C={id:d,observer:F,elements:D},T.set(d,C)}return C}function V(S,d,C={},D=I){if(typeof window.IntersectionObserver>"u"&&D!==void 0){let U=S.getBoundingClientRect();return d(D,{isIntersecting:D,target:S,intersectionRatio:typeof C.threshold==="number"?C.threshold:0,time:0,boundingClientRect:U,intersectionRect:U,rootBounds:U}),()=>{}}let{id:q,observer:F,elements:f}=k(C),L=f.get(S)||[];if(!f.has(S))f.set(S,L);return L.push(d),F.observe(S),function(){if(L.splice(L.indexOf(d),1),L.length===0)f.delete(S),F.unobserve(S);if(f.size===0)F.disconnect(),T.delete(q)}}function y({threshold:S,delay:d,trackVisibility:C,rootMargin:D,root:q,triggerOnce:F,skip:f,initialInView:L,fallbackInView:U,onChange:G}={}){var A;let[K,b]=J.useState(null),X=J.useRef(G),H=J.useRef(L),[Y,j]=J.useState({inView:!!L,entry:void 0});X.current=G,J.useEffect(()=>{if(H.current===void 0)H.current=L;if(f||!K)return;let B;return B=V(K,(Q,$)=>{let u=H.current;if(H.current=Q,u===void 0&&!Q)return;if(j({inView:Q,entry:$}),X.current)X.current(Q,$);if($.isIntersecting&&F&&B)B(),B=void 0},{root:q,rootMargin:D,threshold:S,trackVisibility:C,delay:d},U),()=>{if(B)B()}},[Array.isArray(S)?S.toString():S,K,q,D,F,f,C,U,d]);let Z=(A=Y.entry)==null?void 0:A.target,E=J.useRef(void 0);if(!K&&Z&&!F&&!f&&E.current!==Z)E.current=Z,j({inView:!!L,entry:void 0}),H.current=L;let z=[b,Y.inView,Y.entry];return z.ref=z[0],z.inView=z[1],z.entry=z[2],z}var P,R,l=(R=(P=("useInsertionEffect"in N)?N.useInsertionEffect:void 0)!=null?P:N.useLayoutEffect)!=null?R:N.useEffect;var o=g()(h((S)=>({fileViewLeftSidebarCollapsed:!0,setFileViewLeftSidebarCollapsed:(d)=>S({fileViewLeftSidebarCollapsed:d}),fileViewRightSidebarCollapsed:!0,setFileViewRightSidebarCollapsed:(d)=>S({fileViewRightSidebarCollapsed:d}),fileListLeftSidebarCollapsed:!1,setFileListLeftSidebarCollapsed:(d)=>S({fileListLeftSidebarCollapsed:d}),fileListRightSidebarCollapsed:!0,setFileListRightSidebarCollapsed:(d)=>S({fileListRightSidebarCollapsed:d}),shareConfigLeftSidebarCollapsed:!1,setShareConfigLeftSidebarCollapsed:(d)=>S({shareConfigLeftSidebarCollapsed:d}),shareConfigRightSidebarCollapsed:!1,setShareConfigRightSidebarCollapsed:(d)=>S({shareConfigRightSidebarCollapsed:d}),viewModes:{},setViewMode:(d,C)=>S((D)=>({viewModes:{...D.viewModes,[d]:C}})),videoTimeDisplayMode:"standard",setVideoTimeDisplayMode:(d)=>S({videoTimeDisplayMode:d})}),{name:"ui-storage",storage:_(()=>localStorage)}));function n({className:S,...d}){return v("div",{"data-slot":"skeleton",className:a("animate-pulse rounded-md bg-accent",S),...d})}
1
+ import{Lh as g,Nh as _,Oh as h,gk as a,mh as x,oh as v}from"./chunk-nyhqy6q2.js";import{Vk as M}from"./chunk-0qkj838r.js";var m=M(x(),1),J=M(x(),1),N=M(x(),1);var T=new Map,W=new WeakMap,O=0,I;function w(S){if(!S)return"0";if(W.has(S))return W.get(S);return O+=1,W.set(S,O.toString()),W.get(S)}function p(S){return Object.keys(S).sort().filter((d)=>S[d]!==void 0).map((d)=>{return`${d}_${d==="root"?w(S.root):S[d]}`}).toString()}function k(S){let d=p(S),C=T.get(d);if(!C){let f=new Map,q,F=new IntersectionObserver((D)=>{D.forEach((L)=>{var U;let G=L.isIntersecting&&q.some((A)=>L.intersectionRatio>=A);if(S.trackVisibility&&typeof L.isVisible>"u")L.isVisible=G;[...(U=f.get(L.target))!=null?U:[]].forEach((A)=>{A(G,L)})})},S);q=F.thresholds||(Array.isArray(S.threshold)?S.threshold:[S.threshold||0]),C={id:d,observer:F,elements:f},T.set(d,C)}return C}function V(S,d,C={},f=I){if(typeof window.IntersectionObserver>"u"&&f!==void 0){let U=S.getBoundingClientRect();return d(f,{isIntersecting:f,target:S,intersectionRatio:typeof C.threshold==="number"?C.threshold:0,time:0,boundingClientRect:U,intersectionRect:U,rootBounds:U}),()=>{}}let{id:q,observer:F,elements:D}=k(C),L=D.get(S)||[];if(!D.has(S))D.set(S,L);return L.push(d),F.observe(S),function(){if(L.splice(L.indexOf(d),1),L.length===0)D.delete(S),F.unobserve(S);if(D.size===0)F.disconnect(),T.delete(q)}}function y({threshold:S,delay:d,trackVisibility:C,rootMargin:f,root:q,triggerOnce:F,skip:D,initialInView:L,fallbackInView:U,onChange:G}={}){var A;let[K,b]=J.useState(null),X=J.useRef(G),H=J.useRef(L),[Y,j]=J.useState({inView:!!L,entry:void 0});X.current=G,J.useEffect(()=>{if(H.current===void 0)H.current=L;if(D||!K)return;let B;return B=V(K,(Q,$)=>{let u=H.current;if(H.current=Q,u===void 0&&!Q)return;if(j({inView:Q,entry:$}),X.current)X.current(Q,$);if($.isIntersecting&&F&&B)B(),B=void 0},{root:q,rootMargin:f,threshold:S,trackVisibility:C,delay:d},U),()=>{if(B)B()}},[Array.isArray(S)?S.toString():S,K,q,f,F,D,C,U,d]);let Z=(A=Y.entry)==null?void 0:A.target,E=J.useRef(void 0);if(!K&&Z&&!F&&!D&&E.current!==Z)E.current=Z,j({inView:!!L,entry:void 0}),H.current=L;let z=[b,Y.inView,Y.entry];return z.ref=z[0],z.inView=z[1],z.entry=z[2],z}var P,R,l=(R=(P=("useInsertionEffect"in N)?N.useInsertionEffect:void 0)!=null?P:N.useLayoutEffect)!=null?R:N.useEffect;var o=g()(h((S)=>({fileViewLeftSidebarCollapsed:!0,setFileViewLeftSidebarCollapsed:(d)=>S({fileViewLeftSidebarCollapsed:d}),fileViewRightSidebarCollapsed:!1,setFileViewRightSidebarCollapsed:(d)=>S({fileViewRightSidebarCollapsed:d}),fileListLeftSidebarCollapsed:!1,setFileListLeftSidebarCollapsed:(d)=>S({fileListLeftSidebarCollapsed:d}),fileListRightSidebarCollapsed:!0,setFileListRightSidebarCollapsed:(d)=>S({fileListRightSidebarCollapsed:d}),shareConfigLeftSidebarCollapsed:!1,setShareConfigLeftSidebarCollapsed:(d)=>S({shareConfigLeftSidebarCollapsed:d}),shareConfigRightSidebarCollapsed:!1,setShareConfigRightSidebarCollapsed:(d)=>S({shareConfigRightSidebarCollapsed:d}),viewModes:{},setViewMode:(d,C)=>S((f)=>({viewModes:{...f.viewModes,[d]:C}})),videoTimeDisplayMode:"standard",setVideoTimeDisplayMode:(d)=>S({videoTimeDisplayMode:d})}),{name:"ui-storage",storage:_(()=>localStorage)}));function n({className:S,...d}){return v("div",{"data-slot":"skeleton",className:a("animate-pulse rounded-md bg-accent",S),...d})}
2
2
  export{y as og,o as pg,n as qg};
@@ -1,2 +1,2 @@
1
- import{qg as f}from"./chunk-fa2g2wge.js";import{oh as b,ph as q}from"./chunk-nyhqy6q2.js";function z(){return q("div",{className:"flex h-screen flex-col bg-background min-h-0",children:[q("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-24"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-32"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-8 w-8 rounded-md"}),b(f,{className:"h-8 w-20 rounded-md"})]})]}),q("div",{className:"flex flex-1 overflow-hidden",children:[q("div",{className:"w-[240px] border-r p-4 space-y-4 hidden md:block shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-4 rounded"}),b(f,{className:"h-4 w-24"})]}),q("div",{className:"pl-4 space-y-3",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-28"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-20"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-24"})]})]})]}),q("div",{className:"flex-1 p-6 space-y-6 overflow-y-auto",children:[q("div",{className:"flex items-center justify-between border-b pb-4",children:[q("div",{className:"flex items-center gap-4",children:[b(f,{className:"h-5 w-40"}),b(f,{className:"h-4 w-20"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-8 w-8 rounded"}),b(f,{className:"h-8 w-8 rounded"}),b(f,{className:"h-8 w-32 rounded"})]})]}),q("div",{className:"space-y-4",children:[b("div",{className:"flex items-center gap-2",children:b(f,{className:"h-4 w-24"})}),b("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:Array.from({length:10}).map((w,v)=>q("div",{className:"flex flex-col rounded-lg border bg-card p-3 space-y-3",children:[b(f,{className:"aspect-square w-full rounded-md"}),q("div",{className:"space-y-2",children:[b(f,{className:"h-4 w-3/4"}),q("div",{className:"flex justify-between items-center",children:[b(f,{className:"h-3 w-1/4"}),b(f,{className:"h-3 w-1/3"})]})]})]},v))})]})]})]})]})}function A(){return q("div",{className:"h-screen flex flex-col bg-background",children:[q("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-16"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-28"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-32"})]}),b("div",{className:"flex items-center gap-2",children:b(f,{className:"h-8 w-20 rounded"})})]}),q("div",{className:"flex flex-1 overflow-hidden",children:[q("div",{className:"w-[280px] border-r p-4 flex flex-col gap-4 shrink-0 hidden md:flex",children:[b(f,{className:"h-5 w-24"}),b("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:4}).map((w,v)=>q("div",{className:"flex gap-3 p-2 rounded border",children:[b(f,{className:"h-12 w-12 rounded bg-muted shrink-0"}),q("div",{className:"space-y-2 flex-1",children:[b(f,{className:"h-3 w-2/3"}),b(f,{className:"h-2 w-1/2"})]})]},v))})]}),q("div",{className:"flex-1 bg-muted/20 p-6 flex flex-col justify-between relative min-w-0",children:[b("div",{className:"flex-1 flex items-center justify-center",children:b(f,{className:"w-full max-w-4xl aspect-video rounded-lg shadow-lg"})}),q("div",{className:"mt-4 flex items-center justify-between shrink-0",children:[q("div",{className:"flex items-center gap-4",children:[b(f,{className:"h-8 w-8 rounded-full"}),b(f,{className:"h-4 w-32"})]}),b(f,{className:"h-4 w-24"})]})]}),q("div",{className:"w-[360px] border-l p-4 flex flex-col gap-6 shrink-0 hidden lg:flex bg-card",children:[q("div",{className:"space-y-4",children:[b(f,{className:"h-5 w-32"}),b("div",{className:"space-y-3",children:Array.from({length:3}).map((w,v)=>q("div",{className:"flex justify-between items-center py-1 border-b",children:[b(f,{className:"h-3 w-20"}),b(f,{className:"h-3 w-32"})]},v))})]}),q("div",{className:"flex-1 flex flex-col gap-4",children:[b(f,{className:"h-5 w-24"}),b("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:3}).map((w,v)=>q("div",{className:"flex gap-3 p-3 rounded-lg border bg-muted/10",children:[b(f,{className:"h-8 w-8 rounded-full shrink-0"}),q("div",{className:"space-y-2 flex-1",children:[q("div",{className:"flex justify-between",children:[b(f,{className:"h-3 w-24"}),b(f,{className:"h-2 w-12"})]}),b(f,{className:"h-3 w-full"}),b(f,{className:"h-3 w-5/6"})]})]},v))})]})]})]})]})}
1
+ import{qg as f}from"./chunk-3n1rezd0.js";import{oh as b,ph as q}from"./chunk-nyhqy6q2.js";function z(){return q("div",{className:"flex h-screen flex-col bg-background min-h-0",children:[q("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-24"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-32"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-8 w-8 rounded-md"}),b(f,{className:"h-8 w-20 rounded-md"})]})]}),q("div",{className:"flex flex-1 overflow-hidden",children:[q("div",{className:"w-[240px] border-r p-4 space-y-4 hidden md:block shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-4 rounded"}),b(f,{className:"h-4 w-24"})]}),q("div",{className:"pl-4 space-y-3",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-28"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-20"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-24"})]})]})]}),q("div",{className:"flex-1 p-6 space-y-6 overflow-y-auto",children:[q("div",{className:"flex items-center justify-between border-b pb-4",children:[q("div",{className:"flex items-center gap-4",children:[b(f,{className:"h-5 w-40"}),b(f,{className:"h-4 w-20"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-8 w-8 rounded"}),b(f,{className:"h-8 w-8 rounded"}),b(f,{className:"h-8 w-32 rounded"})]})]}),q("div",{className:"space-y-4",children:[b("div",{className:"flex items-center gap-2",children:b(f,{className:"h-4 w-24"})}),b("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:Array.from({length:10}).map((w,v)=>q("div",{className:"flex flex-col rounded-lg border bg-card p-3 space-y-3",children:[b(f,{className:"aspect-square w-full rounded-md"}),q("div",{className:"space-y-2",children:[b(f,{className:"h-4 w-3/4"}),q("div",{className:"flex justify-between items-center",children:[b(f,{className:"h-3 w-1/4"}),b(f,{className:"h-3 w-1/3"})]})]})]},v))})]})]})]})]})}function A(){return q("div",{className:"h-screen flex flex-col bg-background",children:[q("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-16"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-28"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-32"})]}),b("div",{className:"flex items-center gap-2",children:b(f,{className:"h-8 w-20 rounded"})})]}),q("div",{className:"flex flex-1 overflow-hidden",children:[q("div",{className:"w-[280px] border-r p-4 flex flex-col gap-4 shrink-0 hidden md:flex",children:[b(f,{className:"h-5 w-24"}),b("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:4}).map((w,v)=>q("div",{className:"flex gap-3 p-2 rounded border",children:[b(f,{className:"h-12 w-12 rounded bg-muted shrink-0"}),q("div",{className:"space-y-2 flex-1",children:[b(f,{className:"h-3 w-2/3"}),b(f,{className:"h-2 w-1/2"})]})]},v))})]}),q("div",{className:"flex-1 bg-muted/20 p-6 flex flex-col justify-between relative min-w-0",children:[b("div",{className:"flex-1 flex items-center justify-center",children:b(f,{className:"w-full max-w-4xl aspect-video rounded-lg shadow-lg"})}),q("div",{className:"mt-4 flex items-center justify-between shrink-0",children:[q("div",{className:"flex items-center gap-4",children:[b(f,{className:"h-8 w-8 rounded-full"}),b(f,{className:"h-4 w-32"})]}),b(f,{className:"h-4 w-24"})]})]}),q("div",{className:"w-[360px] border-l p-4 flex flex-col gap-6 shrink-0 hidden lg:flex bg-card",children:[q("div",{className:"space-y-4",children:[b(f,{className:"h-5 w-32"}),b("div",{className:"space-y-3",children:Array.from({length:3}).map((w,v)=>q("div",{className:"flex justify-between items-center py-1 border-b",children:[b(f,{className:"h-3 w-20"}),b(f,{className:"h-3 w-32"})]},v))})]}),q("div",{className:"flex-1 flex flex-col gap-4",children:[b(f,{className:"h-5 w-24"}),b("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:3}).map((w,v)=>q("div",{className:"flex gap-3 p-3 rounded-lg border bg-muted/10",children:[b(f,{className:"h-8 w-8 rounded-full shrink-0"}),q("div",{className:"space-y-2 flex-1",children:[q("div",{className:"flex justify-between",children:[b(f,{className:"h-3 w-24"}),b(f,{className:"h-2 w-12"})]}),b(f,{className:"h-3 w-full"}),b(f,{className:"h-3 w-5/6"})]})]},v))})]})]})]})]})}
2
2
  export{z as zf,A as Af};
@@ -1 +1 @@
1
- import{a as r,b as a,c as s,d as E,e as $,f as q}from"./chunk-wc8sc9r9.js";import{fa as j}from"./chunk-7e06b2zb.js";import{Va as t}from"./chunk-srn8t0v7.js";import"./chunk-kfhtk3eh.js";import{Za as x}from"./chunk-b8js74jk.js";import"./chunk-0xbf8bcg.js";import{jf as l}from"./chunk-q24epdh8.js";import{zf as o}from"./chunk-ry33f2qk.js";import{og as d,pg as i}from"./chunk-fa2g2wge.js";import{Qg as m,bh as h}from"./chunk-gswbc6y9.js";import{Bh as C,Gh as P,Gi as b,Ki as g,Qh as B,Sh as A,Xi as I,ai as f,hk as p,ik as c,jk as n,mh as qG,mk as X,nh as k,oh as G,ph as K,qh as y,ti as T,uh as L,uj as u,vh as F,wh as S}from"./chunk-nyhqy6q2.js";import{Vk as $G}from"./chunk-0qkj838r.js";var _=$G(qG(),1);var OG=(Y)=>{if(!Y)return"??";return Y.split(" ").map((O)=>O[0]).slice(0,2).join("").toUpperCase()};function zG(){let{projectId:Y}=BG.useParams(),{teamId:O,ensureTeamIdForProject:U}=h(),e=y(),GG=C();_.useEffect(()=>{U(Y)},[Y,U]);let{data:M}=L(l(Y)),D=M?.rootFolder,[JG,KG]=_.useState(240),{shareConfigLeftSidebarCollapsed:Q,setShareConfigLeftSidebarCollapsed:XG}=i(),{data:V,isLoading:YG,fetchNextPage:R,hasNextPage:v,isFetchingNextPage:W}=S({queryKey:["shares",Y],queryFn:async({pageParam:J})=>{let Z=await A.api.projects[":projectId"].shares.$get({param:{projectId:Y},query:{first:"20",after:J}});if(!Z.ok)throw Error("Failed to fetch share links");return await Z.json()},initialPageParam:"",getNextPageParam:(J)=>J.pageInfo?.cursor||void 0,enabled:!!Y}),{ref:ZG,inView:w}=d();_.useEffect(()=>{if(w&&v&&!W)R()},[w,v,W,R]);let H=_.useMemo(()=>V?.pages.flatMap((J)=>J.data)||[],[V]),{mutate:_G}=F({mutationFn:async({id:J,isDisabled:Z})=>{let z=await A.api.shares[":shareId"].$put({param:{shareId:J},json:{isDisabled:Z}});if(!z.ok)throw Error("Failed to update share link");return await z.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["shares",Y]}),B.success(X.share_link_status_updated())},onError:(J)=>{B.error(X.error_message({message:J.message}))}});if(!O||!D||!M)return G(o,{});let N=(J)=>{let Z=`${window.location.origin}/share/${J}`;navigator.clipboard.writeText(Z),B.success(X.link_copied())};return G("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:K("div",{className:"flex flex-1 overflow-hidden relative",children:[!Q&&G("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>XG(!0)}),!Q&&K(k,{children:[G("div",{className:"bg-background",style:{width:JG},children:G(j,{teamId:O,projectId:Y,projectName:M.name??"",rootFolderId:D})}),G(t,{onResize:(J)=>{KG((Z)=>Math.max(180,Math.min(400,Z+J)))},className:"hidden md:block"})]}),K("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[G("header",{className:"h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10",children:K("div",{className:"flex items-center gap-2",children:[G(u,{className:"h-5 w-5 text-primary"}),G("h1",{className:"font-bold text-lg text-foreground",children:X.all_share_links()})]})}),G("div",{className:"flex-1 overflow-y-auto p-6",children:YG?G("div",{className:"flex justify-center items-center h-64",children:G("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):H.length===0?K("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[G(I,{className:"h-10 w-10 text-muted-foreground/50"}),G("p",{children:X.no_share_links_yet()})]}):K("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[K(r,{children:[G(a,{children:K(E,{className:"hover:bg-transparent bg-muted/20",children:[G($,{className:"font-semibold px-4 py-3",children:X.name()}),G($,{className:"font-semibold px-4 py-3",children:X.public_link()}),G($,{className:"font-semibold px-4 py-3",children:X.creator()}),G($,{className:"font-semibold px-4 py-3 w-[150px]",children:X.created_date()}),G($,{className:"font-semibold px-4 py-3 text-right w-[120px]",children:X.active()})]})}),G(s,{children:H.map((J)=>{let Z=`${window.location.origin}/share/${J.id}`;return K(E,{className:"hover:bg-muted/10 transition-colors",children:[G(q,{className:"font-medium px-4 py-3.5",children:G("span",{className:"cursor-pointer hover:underline text-foreground",onClick:()=>GG({to:"/projects/$projectId/shares/$shareId",params:{projectId:Y,shareId:J.id}}),children:J.name})}),G(q,{className:"px-4 py-3.5 max-w-[300px]",children:K("div",{className:"flex items-center gap-2 group",children:[G("span",{className:"truncate text-xs font-mono bg-muted/50 text-muted-foreground px-2 py-1 rounded-md border border-border cursor-pointer hover:bg-muted transition-colors flex-1",onClick:()=>N(J.id),title:X.click_to_copy_link(),children:Z}),G(m,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>N(J.id),children:G(b,{className:"h-3.5 w-3.5"})}),G("a",{href:Z,target:"_blank",rel:"noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center",children:G(g,{className:"h-3.5 w-3.5"})})]})}),G(q,{className:"px-4 py-3.5",children:K("div",{className:"flex items-center gap-2",children:[K(p,{className:"h-6 w-6",children:[J.creator?.image&&G(c,{src:J.creator.image,alt:J.creator.name,className:"object-cover"}),G(n,{className:"text-[10px]",children:OG(J.creator?.name)})]}),G("span",{className:"text-sm font-medium text-foreground truncate max-w-[150px]",children:J.creator?.name||X.unknown()})]})}),G(q,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:K("div",{className:"flex items-center gap-2",children:[G(T,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),G("span",{children:new Date(J.createdAt).toLocaleDateString()})]})}),G(q,{className:"px-4 py-3.5 text-right",children:G("div",{className:"flex justify-end",children:G(x,{checked:!J.isDisabled,onCheckedChange:(z)=>_G({id:J.id,isDisabled:!z})})})})]},J.id)})})]}),G("div",{ref:ZG,className:"h-10 w-full flex items-center justify-center",children:W&&G(f,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var BG=P("/projects/$projectId/shares/")({component:zG});export{BG as Route};
1
+ import{a as r,b as a,c as s,d as E,e as $,f as q}from"./chunk-wc8sc9r9.js";import{fa as j}from"./chunk-nhsqp8jc.js";import{Va as t}from"./chunk-srn8t0v7.js";import"./chunk-kfhtk3eh.js";import{Za as x}from"./chunk-b8js74jk.js";import"./chunk-0xbf8bcg.js";import{jf as l}from"./chunk-wfx81mfv.js";import{zf as o}from"./chunk-3qks722n.js";import{og as d,pg as i}from"./chunk-3n1rezd0.js";import{Qg as m,bh as h}from"./chunk-gswbc6y9.js";import{Bh as C,Gh as P,Gi as b,Ki as g,Qh as B,Sh as A,Xi as I,ai as f,hk as p,ik as c,jk as n,mh as qG,mk as X,nh as k,oh as G,ph as K,qh as y,ti as T,uh as L,uj as u,vh as F,wh as S}from"./chunk-nyhqy6q2.js";import{Vk as $G}from"./chunk-0qkj838r.js";var _=$G(qG(),1);var OG=(Y)=>{if(!Y)return"??";return Y.split(" ").map((O)=>O[0]).slice(0,2).join("").toUpperCase()};function zG(){let{projectId:Y}=BG.useParams(),{teamId:O,ensureTeamIdForProject:U}=h(),e=y(),GG=C();_.useEffect(()=>{U(Y)},[Y,U]);let{data:M}=L(l(Y)),D=M?.rootFolder,[JG,KG]=_.useState(240),{shareConfigLeftSidebarCollapsed:Q,setShareConfigLeftSidebarCollapsed:XG}=i(),{data:V,isLoading:YG,fetchNextPage:R,hasNextPage:v,isFetchingNextPage:W}=S({queryKey:["shares",Y],queryFn:async({pageParam:J})=>{let Z=await A.api.projects[":projectId"].shares.$get({param:{projectId:Y},query:{first:"20",after:J}});if(!Z.ok)throw Error("Failed to fetch share links");return await Z.json()},initialPageParam:"",getNextPageParam:(J)=>J.pageInfo?.cursor||void 0,enabled:!!Y}),{ref:ZG,inView:w}=d();_.useEffect(()=>{if(w&&v&&!W)R()},[w,v,W,R]);let H=_.useMemo(()=>V?.pages.flatMap((J)=>J.data)||[],[V]),{mutate:_G}=F({mutationFn:async({id:J,isDisabled:Z})=>{let z=await A.api.shares[":shareId"].$put({param:{shareId:J},json:{isDisabled:Z}});if(!z.ok)throw Error("Failed to update share link");return await z.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["shares",Y]}),B.success(X.share_link_status_updated())},onError:(J)=>{B.error(X.error_message({message:J.message}))}});if(!O||!D||!M)return G(o,{});let N=(J)=>{let Z=`${window.location.origin}/share/${J}`;navigator.clipboard.writeText(Z),B.success(X.link_copied())};return G("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:K("div",{className:"flex flex-1 overflow-hidden relative",children:[!Q&&G("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>XG(!0)}),!Q&&K(k,{children:[G("div",{className:"bg-background",style:{width:JG},children:G(j,{teamId:O,projectId:Y,projectName:M.name??"",rootFolderId:D})}),G(t,{onResize:(J)=>{KG((Z)=>Math.max(180,Math.min(400,Z+J)))},className:"hidden md:block"})]}),K("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[G("header",{className:"h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10",children:K("div",{className:"flex items-center gap-2",children:[G(u,{className:"h-5 w-5 text-primary"}),G("h1",{className:"font-bold text-lg text-foreground",children:X.all_share_links()})]})}),G("div",{className:"flex-1 overflow-y-auto p-6",children:YG?G("div",{className:"flex justify-center items-center h-64",children:G("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):H.length===0?K("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[G(I,{className:"h-10 w-10 text-muted-foreground/50"}),G("p",{children:X.no_share_links_yet()})]}):K("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[K(r,{children:[G(a,{children:K(E,{className:"hover:bg-transparent bg-muted/20",children:[G($,{className:"font-semibold px-4 py-3",children:X.name()}),G($,{className:"font-semibold px-4 py-3",children:X.public_link()}),G($,{className:"font-semibold px-4 py-3",children:X.creator()}),G($,{className:"font-semibold px-4 py-3 w-[150px]",children:X.created_date()}),G($,{className:"font-semibold px-4 py-3 text-right w-[120px]",children:X.active()})]})}),G(s,{children:H.map((J)=>{let Z=`${window.location.origin}/share/${J.id}`;return K(E,{className:"hover:bg-muted/10 transition-colors",children:[G(q,{className:"font-medium px-4 py-3.5",children:G("span",{className:"cursor-pointer hover:underline text-foreground",onClick:()=>GG({to:"/projects/$projectId/shares/$shareId",params:{projectId:Y,shareId:J.id}}),children:J.name})}),G(q,{className:"px-4 py-3.5 max-w-[300px]",children:K("div",{className:"flex items-center gap-2 group",children:[G("span",{className:"truncate text-xs font-mono bg-muted/50 text-muted-foreground px-2 py-1 rounded-md border border-border cursor-pointer hover:bg-muted transition-colors flex-1",onClick:()=>N(J.id),title:X.click_to_copy_link(),children:Z}),G(m,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>N(J.id),children:G(b,{className:"h-3.5 w-3.5"})}),G("a",{href:Z,target:"_blank",rel:"noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center",children:G(g,{className:"h-3.5 w-3.5"})})]})}),G(q,{className:"px-4 py-3.5",children:K("div",{className:"flex items-center gap-2",children:[K(p,{className:"h-6 w-6",children:[J.creator?.image&&G(c,{src:J.creator.image,alt:J.creator.name,className:"object-cover"}),G(n,{className:"text-[10px]",children:OG(J.creator?.name)})]}),G("span",{className:"text-sm font-medium text-foreground truncate max-w-[150px]",children:J.creator?.name||X.unknown()})]})}),G(q,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:K("div",{className:"flex items-center gap-2",children:[G(T,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),G("span",{children:new Date(J.createdAt).toLocaleDateString()})]})}),G(q,{className:"px-4 py-3.5 text-right",children:G("div",{className:"flex justify-end",children:G(x,{checked:!J.isDisabled,onCheckedChange:(z)=>_G({id:J.id,isDisabled:!z})})})})]},J.id)})})]}),G("div",{ref:ZG,className:"h-10 w-full flex items-center justify-center",children:W&&G(f,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var BG=P("/projects/$projectId/shares/")({component:zG});export{BG as Route};
@@ -1,2 +1,2 @@
1
- import{h as WG,i as VG}from"./chunk-h0ytx8zc.js";import{p as qG,s as BG}from"./chunk-xyjw8w3r.js";import{t as zG}from"./chunk-ccw7mjgq.js";import{Va as HG}from"./chunk-srn8t0v7.js";import{pf as _G}from"./chunk-wg98cacx.js";import{qf as v,rf as g,sf as F,uf as u}from"./chunk-15sefy5t.js";import{hg as ZG}from"./chunk-54tr7y2x.js";import{Qg as XG,dh as $G}from"./chunk-gswbc6y9.js";import{$i as UG,Bh as KG,Sh as B,Wh as OG,ai as P,mh as oG,mk as YG,nh as JG,oh as O,ph as z,th as N,wh as w}from"./chunk-nyhqy6q2.js";import{Vk as nG}from"./chunk-0qkj838r.js";var X=nG(oG(),1);function $J({shareId:K,initialFolderId:QG,initialFileId:f,startTime:TG,versionId:V,compare:MG,compareLeftId:b,compareRightId:A,compareActiveSide:p="left"}){let H=KG(),W=!!MG&&!!b&&!!A,[Z,h]=X.useState(()=>{return localStorage.getItem(`share_pwd_${K}`)||""}),[D,NG]=X.useState(""),{data:U,error:Q,isLoading:yG}=N({queryKey:["share-info",K,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].info.$get({param:{shareId:K}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");if(G.status===403){let J=await G.json();throw Error(J.error||"Forbidden")}if(!G.ok)throw Error("Failed to fetch share info");return await G.json()},retry:!1}),Y=QG||U?.rootFolderId,_=f||null,m=V||_,[c,l]=X.useState([]),{data:R}=N({queryKey:["public-share-folder",K,Y,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:K,fileId:Y}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");return await G.json()},enabled:!!U&&!!Y});X.useEffect(()=>{if(R?.ancestorFolders&&U){let G=R.ancestorFolders.findIndex((J)=>J.id===U.rootFolderId);if(G!==-1)l(R.ancestorFolders.slice(0,G));else if(Y===U.rootFolderId)l([])}},[R,U,Y]);let[y,E]=X.useState(new Set),[EG,LG]=X.useState(360),[j,kG]=X.useState(()=>!f),L=X.useRef(null),[I,C]=X.useState([]),[bG,n]=X.useState(0),[AG,o]=X.useState(null),[d,RG]=X.useState(null),[PG,DG]=X.useState(void 0),{data:i,fetchNextPage:jG,hasNextPage:CG,isFetchingNextPage:SG,error:t}=w({queryKey:["public-share-children",K,Y,"folder",Z],queryFn:async({pageParam:G})=>{let J=await B.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:K,folderId:Y},query:{assetType:"folder",after:G}},{headers:{"x-share-password":Z}});if(J.status===401)throw Error("Unauthorized");if(J.status===403)throw Error("Expired");return await J.json()},enabled:!!U&&!!Y,initialPageParam:"",getNextPageParam:(G)=>G.pageInfo?.cursor||void 0,retry:!1}),{data:a,fetchNextPage:xG,hasNextPage:wG,isFetchingNextPage:vG}=w({queryKey:["public-share-children",K,Y,"file",Z],queryFn:async({pageParam:G})=>{let J=await B.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:K,folderId:Y},query:{assetType:"file",after:G}},{headers:{"x-share-password":Z}});if(J.status===401)throw Error("Unauthorized");if(J.status===403)throw Error("Expired");return await J.json()},enabled:!!U&&!!Y,initialPageParam:"",getNextPageParam:(G)=>G.pageInfo?.cursor||void 0,retry:!1}),{data:gG}=N({queryKey:["public-share-fields",K,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].fields.$get({param:{shareId:K}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");return await G.json()},enabled:!!U}),{data:q,isLoading:FG}=N({queryKey:["public-share-file",K,_,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:K,fileId:_}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");return await G.json()},enabled:!!_&&!!U}),{data:uG,isLoading:fG}=N({queryKey:["public-share-file",K,V,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:K,fileId:V}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");return await G.json()},enabled:!!V&&!!U}),$=V?uG:q,pG=FG||!!V&&fG;X.useEffect(()=>{if(t?.message==="Unauthorized")h(""),localStorage.removeItem(`share_pwd_${K}`)},[t,K]);let k=X.useMemo(()=>i?.pages.flatMap((G)=>G.data??[])??[],[i]),S=X.useMemo(()=>a?.pages.flatMap((G)=>G.data??[])??[],[a]),s=X.useMemo(()=>{if($)return $;if(y.size!==1)return null;let G=Array.from(y)[0];return[...k,...S].find((J)=>J.id===G)||null},[y,k,S,$]),hG=(G)=>{G.preventDefault(),h(D),localStorage.setItem(`share_pwd_${K}`,D)},mG=(G)=>{if(G.type==="folder"||G.targetType==="folder")H({to:"/share/$shareId/folders/$folderId",params:{shareId:K,folderId:G.id}});else H({to:"/share/$shareId/files/$fileId",params:{shareId:K,fileId:G.versionStack?G.versionStack.id:G.id}});E(new Set)},cG=(G)=>{if(!U)return;let J=G==="root"?U.rootFolderId:G;if(J===U.rootFolderId)H({to:"/share/$shareId",params:{shareId:K}});else H({to:"/share/$shareId/folders/$folderId",params:{shareId:K,folderId:J}});E(new Set)},lG=(G)=>{o(G.id||null);let J=G.annotations;if(J&&J.length>0)C(J);else C([]);if(W){if(G.second!==null&&G.second!==void 0)DG({second:G.second,nonce:Date.now()});return}if(G.second!==null&&G.second!==void 0)L.current?.seekTo(G.second),L.current?.pause();else if(J&&J.length>0)L.current?.pause()},r=()=>{C([]),o(null)},x=(G)=>{if(!_)return;H({to:"/share/$shareId/files/$fileId",params:{shareId:K,fileId:_},search:(J)=>({...J,...G})})},IG=()=>{x({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:p==="left"?b:A})},{setProjectState:e,clearProjectState:GG}=ZG();X.useEffect(()=>{if(U&&Y){let G=Y===U.rootFolderId?U.name:k.find((J)=>J.id===Y)?.name||U.name;e({teamId:"",projectId:U.projectId,projectName:U.name,ancestorFolders:c,currentAsset:{name:$?.name||G,type:_?"file":"folder",version:q?.versionStack?q.versionStack.versions.find((J)=>J.id===m)?.version??q.versionStack.versions.length:void 0,proxyType:$?.proxyType||null},isRootFolder:Y===U.rootFolderId&&!_,isPublic:!0,shareId:K,fileId:_||void 0,downloadInfo:$?{originalKey:$.media?.original?.key,videoTranscodes:$.media?.videoTranscodes?.map((J)=>({key:J.key,width:J.width,height:J.height,isRaw:J.isRaw}))}:void 0,onFolderClick:cG,isRightSidebarCollapsed:j,onRightSidebarToggle:()=>kG((J)=>!J),versions:q?.versionStack?.versions,compareMode:W,canCompareVersions:(q?.versionStack?.versions?.length??0)>=2,onCompareVersions:()=>{let J=qG(q?.versionStack?.versions);if(!J||!_)return;H({to:"/share/$shareId/files/$fileId",params:{shareId:K,fileId:_},search:(M)=>({...M,compare:!0,cmpLeft:J.left.id,cmpRight:J.right.id,cmpActive:"left"})})}})}return()=>GG()},[U,Y,k,$,q,m,_,c,e,GG,j,W,H,K]);let T;if(yG&&!Q)T=O("div",{className:"flex flex-1 items-center justify-center bg-background",children:O(P,{className:"h-8 w-8 animate-spin text-foreground"})});else if(Q)if(Q.message==="Unauthorized"){let G=Z!=="";T=O("div",{className:"flex flex-1 items-center justify-center p-4",children:z(v,{className:"w-full max-w-md",children:[z(g,{className:"text-center",children:[O("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:O(UG,{className:"h-6 w-6 text-primary"})}),O(F,{children:YG.password_protected()})]}),O(u,{children:z("form",{onSubmit:hG,className:"space-y-4",children:[z("div",{className:"space-y-2",children:[O($G,{type:"password",placeholder:"Enter password",value:D,onChange:(J)=>NG(J.target.value),autoFocus:!0}),G&&O("p",{className:"text-sm font-medium text-destructive",children:"Incorrect password. Please try again."})]}),O(XG,{type:"submit",className:"w-full",children:"Access Share"})]})})]})})}else{let G=Q.message.includes("expired"),J=Q.message.includes("disabled");T=O("div",{className:"flex flex-1 items-center justify-center p-4",children:z(v,{className:"w-full max-w-md",children:[z(g,{className:"text-center",children:[O("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:O(OG,{className:"h-6 w-6 text-destructive"})}),O(F,{children:G?"Share Expired":J?"Share Disabled":"Error"})]}),O(u,{className:"text-center text-muted-foreground",children:Q.message})]})})}else if(!U)T=O("div",{className:"flex flex-1 items-center justify-center bg-background",children:O(P,{className:"h-8 w-8 animate-spin text-foreground"})});else T=z("div",{className:"flex flex-1 overflow-hidden relative",children:[_?z("div",{className:"flex-1 relative bg-muted/30",children:[pG&&!W&&O("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:O(P,{className:"h-8 w-8 animate-spin text-foreground"})}),W&&b&&A?O(VG,{isPublic:!0,shareId:K,versions:$?.versionStack?.versions??[],leftId:b,rightId:A,activeSide:p,annotations:I,seekRequest:PG,onActiveSideChange:(G)=>x({cmpActive:G}),onSwitchVersion:(G,J)=>x(G==="left"?{cmpLeft:J}:{cmpRight:J}),onExit:IG,onActiveAssetChange:RG,onPlay:r,onTimeUpdate:n}):$&&O(WG,{file:$,mediaControllerRef:L,onPlay:r,onTimeUpdate:n,annotations:I,startTime:TG,shareId:K})]}):Y&&O(zG,{teamId:"",projectId:U.projectId,assetId:Y,folders:k,files:S,selectedItem:null,selectedIds:y,onItemSelect:(G,J)=>{if(J.metaKey||J.ctrlKey){let M=new Set(y);if(M.has(G.id))M.delete(G.id);else M.add(G.id);E(M)}else E(new Set([G.id]))},onItemDoubleClick:mG,onSaveField:()=>{},displayStyle:U.viewMode??"card",onClearSelection:()=>E(new Set),fetchNextFoldersPage:jG,hasNextFoldersPage:CG,isFetchingNextFoldersPage:SG,fetchNextFilesPage:xG,hasNextFilesPage:wG,isFetchingNextFilesPage:vG,isShareView:!0,isPublic:!0}),!j&&z(JG,{children:[O(HG,{onResize:(G)=>LG((J)=>Math.max(240,Math.min(600,J-G)))}),O("div",{style:{width:EG},className:"flex-shrink-0 border-l",children:O(BG,{teamId:"",projectId:U.projectId,file:W?d:s,onSaveField:()=>{},members:[],readOnly:!0,publicFields:gG,onCommentSelect:lG,isPublic:!0,shareId:K,currentTime:bG,onTyping:()=>{L.current?.pause()},selectedCommentId:AG,hideAnnotationControl:(W?d:s)?.proxyType==="audio"})})]})]});return z("div",{className:"flex h-screen flex-col bg-background",children:[O(_G,{}),T]})}
1
+ import{h as WG,i as VG}from"./chunk-6zascpcz.js";import{p as qG,s as BG}from"./chunk-b73ktdmd.js";import{t as zG}from"./chunk-wckjyvtb.js";import{Va as HG}from"./chunk-srn8t0v7.js";import{pf as _G}from"./chunk-dm2w12rc.js";import{qf as v,rf as g,sf as F,uf as u}from"./chunk-15sefy5t.js";import{hg as ZG}from"./chunk-nnkkem25.js";import{Qg as XG,dh as $G}from"./chunk-gswbc6y9.js";import{$i as UG,Bh as KG,Sh as B,Wh as OG,ai as P,mh as oG,mk as YG,nh as JG,oh as O,ph as z,th as N,wh as w}from"./chunk-nyhqy6q2.js";import{Vk as nG}from"./chunk-0qkj838r.js";var X=nG(oG(),1);function $J({shareId:K,initialFolderId:QG,initialFileId:f,startTime:TG,versionId:V,compare:MG,compareLeftId:b,compareRightId:A,compareActiveSide:p="left"}){let H=KG(),W=!!MG&&!!b&&!!A,[Z,h]=X.useState(()=>{return localStorage.getItem(`share_pwd_${K}`)||""}),[D,NG]=X.useState(""),{data:U,error:Q,isLoading:yG}=N({queryKey:["share-info",K,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].info.$get({param:{shareId:K}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");if(G.status===403){let J=await G.json();throw Error(J.error||"Forbidden")}if(!G.ok)throw Error("Failed to fetch share info");return await G.json()},retry:!1}),Y=QG||U?.rootFolderId,_=f||null,m=V||_,[c,l]=X.useState([]),{data:R}=N({queryKey:["public-share-folder",K,Y,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:K,fileId:Y}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");return await G.json()},enabled:!!U&&!!Y});X.useEffect(()=>{if(R?.ancestorFolders&&U){let G=R.ancestorFolders.findIndex((J)=>J.id===U.rootFolderId);if(G!==-1)l(R.ancestorFolders.slice(0,G));else if(Y===U.rootFolderId)l([])}},[R,U,Y]);let[y,E]=X.useState(new Set),[EG,LG]=X.useState(360),[j,kG]=X.useState(()=>!f),L=X.useRef(null),[I,C]=X.useState([]),[bG,n]=X.useState(0),[AG,o]=X.useState(null),[d,RG]=X.useState(null),[PG,DG]=X.useState(void 0),{data:i,fetchNextPage:jG,hasNextPage:CG,isFetchingNextPage:SG,error:t}=w({queryKey:["public-share-children",K,Y,"folder",Z],queryFn:async({pageParam:G})=>{let J=await B.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:K,folderId:Y},query:{assetType:"folder",after:G}},{headers:{"x-share-password":Z}});if(J.status===401)throw Error("Unauthorized");if(J.status===403)throw Error("Expired");return await J.json()},enabled:!!U&&!!Y,initialPageParam:"",getNextPageParam:(G)=>G.pageInfo?.cursor||void 0,retry:!1}),{data:a,fetchNextPage:xG,hasNextPage:wG,isFetchingNextPage:vG}=w({queryKey:["public-share-children",K,Y,"file",Z],queryFn:async({pageParam:G})=>{let J=await B.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:K,folderId:Y},query:{assetType:"file",after:G}},{headers:{"x-share-password":Z}});if(J.status===401)throw Error("Unauthorized");if(J.status===403)throw Error("Expired");return await J.json()},enabled:!!U&&!!Y,initialPageParam:"",getNextPageParam:(G)=>G.pageInfo?.cursor||void 0,retry:!1}),{data:gG}=N({queryKey:["public-share-fields",K,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].fields.$get({param:{shareId:K}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");return await G.json()},enabled:!!U}),{data:q,isLoading:FG}=N({queryKey:["public-share-file",K,_,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:K,fileId:_}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");return await G.json()},enabled:!!_&&!!U}),{data:uG,isLoading:fG}=N({queryKey:["public-share-file",K,V,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:K,fileId:V}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");return await G.json()},enabled:!!V&&!!U}),$=V?uG:q,pG=FG||!!V&&fG;X.useEffect(()=>{if(t?.message==="Unauthorized")h(""),localStorage.removeItem(`share_pwd_${K}`)},[t,K]);let k=X.useMemo(()=>i?.pages.flatMap((G)=>G.data??[])??[],[i]),S=X.useMemo(()=>a?.pages.flatMap((G)=>G.data??[])??[],[a]),s=X.useMemo(()=>{if($)return $;if(y.size!==1)return null;let G=Array.from(y)[0];return[...k,...S].find((J)=>J.id===G)||null},[y,k,S,$]),hG=(G)=>{G.preventDefault(),h(D),localStorage.setItem(`share_pwd_${K}`,D)},mG=(G)=>{if(G.type==="folder"||G.targetType==="folder")H({to:"/share/$shareId/folders/$folderId",params:{shareId:K,folderId:G.id}});else H({to:"/share/$shareId/files/$fileId",params:{shareId:K,fileId:G.versionStack?G.versionStack.id:G.id}});E(new Set)},cG=(G)=>{if(!U)return;let J=G==="root"?U.rootFolderId:G;if(J===U.rootFolderId)H({to:"/share/$shareId",params:{shareId:K}});else H({to:"/share/$shareId/folders/$folderId",params:{shareId:K,folderId:J}});E(new Set)},lG=(G)=>{o(G.id||null);let J=G.annotations;if(J&&J.length>0)C(J);else C([]);if(W){if(G.second!==null&&G.second!==void 0)DG({second:G.second,nonce:Date.now()});return}if(G.second!==null&&G.second!==void 0)L.current?.seekTo(G.second),L.current?.pause();else if(J&&J.length>0)L.current?.pause()},r=()=>{C([]),o(null)},x=(G)=>{if(!_)return;H({to:"/share/$shareId/files/$fileId",params:{shareId:K,fileId:_},search:(J)=>({...J,...G})})},IG=()=>{x({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:p==="left"?b:A})},{setProjectState:e,clearProjectState:GG}=ZG();X.useEffect(()=>{if(U&&Y){let G=Y===U.rootFolderId?U.name:k.find((J)=>J.id===Y)?.name||U.name;e({teamId:"",projectId:U.projectId,projectName:U.name,ancestorFolders:c,currentAsset:{name:$?.name||G,type:_?"file":"folder",version:q?.versionStack?q.versionStack.versions.find((J)=>J.id===m)?.version??q.versionStack.versions.length:void 0,proxyType:$?.proxyType||null},isRootFolder:Y===U.rootFolderId&&!_,isPublic:!0,shareId:K,fileId:_||void 0,downloadInfo:$?{originalKey:$.media?.original?.key,videoTranscodes:$.media?.videoTranscodes?.map((J)=>({key:J.key,width:J.width,height:J.height,isRaw:J.isRaw}))}:void 0,onFolderClick:cG,isRightSidebarCollapsed:j,onRightSidebarToggle:()=>kG((J)=>!J),versions:q?.versionStack?.versions,compareMode:W,canCompareVersions:(q?.versionStack?.versions?.length??0)>=2,onCompareVersions:()=>{let J=qG(q?.versionStack?.versions);if(!J||!_)return;H({to:"/share/$shareId/files/$fileId",params:{shareId:K,fileId:_},search:(M)=>({...M,compare:!0,cmpLeft:J.left.id,cmpRight:J.right.id,cmpActive:"left"})})}})}return()=>GG()},[U,Y,k,$,q,m,_,c,e,GG,j,W,H,K]);let T;if(yG&&!Q)T=O("div",{className:"flex flex-1 items-center justify-center bg-background",children:O(P,{className:"h-8 w-8 animate-spin text-foreground"})});else if(Q)if(Q.message==="Unauthorized"){let G=Z!=="";T=O("div",{className:"flex flex-1 items-center justify-center p-4",children:z(v,{className:"w-full max-w-md",children:[z(g,{className:"text-center",children:[O("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:O(UG,{className:"h-6 w-6 text-primary"})}),O(F,{children:YG.password_protected()})]}),O(u,{children:z("form",{onSubmit:hG,className:"space-y-4",children:[z("div",{className:"space-y-2",children:[O($G,{type:"password",placeholder:"Enter password",value:D,onChange:(J)=>NG(J.target.value),autoFocus:!0}),G&&O("p",{className:"text-sm font-medium text-destructive",children:"Incorrect password. Please try again."})]}),O(XG,{type:"submit",className:"w-full",children:"Access Share"})]})})]})})}else{let G=Q.message.includes("expired"),J=Q.message.includes("disabled");T=O("div",{className:"flex flex-1 items-center justify-center p-4",children:z(v,{className:"w-full max-w-md",children:[z(g,{className:"text-center",children:[O("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:O(OG,{className:"h-6 w-6 text-destructive"})}),O(F,{children:G?"Share Expired":J?"Share Disabled":"Error"})]}),O(u,{className:"text-center text-muted-foreground",children:Q.message})]})})}else if(!U)T=O("div",{className:"flex flex-1 items-center justify-center bg-background",children:O(P,{className:"h-8 w-8 animate-spin text-foreground"})});else T=z("div",{className:"flex flex-1 overflow-hidden relative",children:[_?z("div",{className:"flex-1 relative bg-muted/30",children:[pG&&!W&&O("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:O(P,{className:"h-8 w-8 animate-spin text-foreground"})}),W&&b&&A?O(VG,{isPublic:!0,shareId:K,versions:$?.versionStack?.versions??[],leftId:b,rightId:A,activeSide:p,annotations:I,seekRequest:PG,onActiveSideChange:(G)=>x({cmpActive:G}),onSwitchVersion:(G,J)=>x(G==="left"?{cmpLeft:J}:{cmpRight:J}),onExit:IG,onActiveAssetChange:RG,onPlay:r,onTimeUpdate:n}):$&&O(WG,{file:$,mediaControllerRef:L,onPlay:r,onTimeUpdate:n,annotations:I,startTime:TG,shareId:K})]}):Y&&O(zG,{teamId:"",projectId:U.projectId,assetId:Y,folders:k,files:S,selectedItem:null,selectedIds:y,onItemSelect:(G,J)=>{if(J.metaKey||J.ctrlKey){let M=new Set(y);if(M.has(G.id))M.delete(G.id);else M.add(G.id);E(M)}else E(new Set([G.id]))},onItemDoubleClick:mG,onSaveField:()=>{},displayStyle:U.viewMode??"card",onClearSelection:()=>E(new Set),fetchNextFoldersPage:jG,hasNextFoldersPage:CG,isFetchingNextFoldersPage:SG,fetchNextFilesPage:xG,hasNextFilesPage:wG,isFetchingNextFilesPage:vG,isShareView:!0,isPublic:!0}),!j&&z(JG,{children:[O(HG,{onResize:(G)=>LG((J)=>Math.max(240,Math.min(600,J-G)))}),O("div",{style:{width:EG},className:"flex-shrink-0 border-l",children:O(BG,{teamId:"",projectId:U.projectId,file:W?d:s,onSaveField:()=>{},members:[],readOnly:!0,publicFields:gG,onCommentSelect:lG,isPublic:!0,shareId:K,currentTime:bG,onTyping:()=>{L.current?.pause()},selectedCommentId:AG,hideAnnotationControl:(W?d:s)?.proxyType==="audio"})})]})]});return z("div",{className:"flex h-screen flex-col bg-background",children:[O(_G,{}),T]})}
2
2
  export{$J as g};
@@ -1,2 +1,2 @@
1
- import{o as s,q as t,r as b}from"./chunk-xyjw8w3r.js";import{Rg as YG,Tg as _G,Ug as $G,Vg as QG}from"./chunk-gswbc6y9.js";import{Mi as JG,Mj as WG,Sh as c,ai as A,dj as i,gk as C,hj as a,mh as SG,mk as r,nh as d,oh as H,ph as O,th as KG,vi as GG,wi as HG}from"./chunk-nyhqy6q2.js";import{Vk as AG}from"./chunk-0qkj838r.js";function vG({file:Y,mediaControllerRef:X,onPlay:K,onPause:N,onTimeUpdate:V,annotations:_,startTime:M,shareId:Z,children:U}){let L=b(Y).viewer;return H(L,{ref:X,file:Y,onPlay:K,onPause:N,onTimeUpdate:V,annotations:_,startTime:M,shareId:Z,children:U},Y.id)}var J=AG(SG(),1);function e({activeState:Y,activeAsset:X,previewUrl:K,isFullScreen:N,onTogglePlay:V,onToggleLoop:_,onSeek:M,onVolumeChange:Z,onToggleMute:U,onChangePlaybackRate:B,onChangeResolution:L,onZoomIn:w,onZoomOut:T,onFit:z,onDownload:F,onToggleFullScreen:E}){if(Y?.kind==="video"&&Y.video&&X){let $=Y.video,y=$.totalFrames/$.frameRate,p=$.currentFrame/$.frameRate,S={isPlaying:$.isPlaying,progress:y>0?p/y*100:0,currentTime:p,duration:y,volume:$.volume,isMuted:$.isMuted,isLooping:$.isLooping,playbackRate:$.playbackRate,isFullScreen:N,showFrames:!1,currentResolution:$.currentResolution},g=K&&!X.media?.videoPreview?{...X,media:{...X.media,videoPreview:{url:K}}}:X;return H(s,{state:S,zoom:Y.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:$.buffered,data:g,resolutions:$.resolutions,togglePlay:V,toggleLoop:_,toggleMute:U,handleVolumeChange:Z,changePlaybackRate:B,changeResolution:(k)=>L(k.resolution),handleDownload:(k)=>F(k),toggleFullScreen:E,onZoomChange:(k)=>k>=Y.zoom?w():T(),onZoomReset:z,frameRate:$.frameRate,totalFrames:$.totalFrames,currentFrame:$.currentFrame,seekToFrame:M})}if(Y?.kind==="image")return H(t,{zoom:Y.zoom,onZoomIn:w,onZoomOut:T,onFit:z,onDownload:()=>F(),canDownload:!!X?.media?.original?.key,fullscreen:{isFullScreen:N,onToggle:E}});return H("div",{className:"relative z-10 flex items-center justify-end gap-2 border-t border-border bg-card px-4 py-3",children:H("button",{onClick:E,className:"text-foreground transition-colors hover:text-primary",title:"Fullscreen",children:N?H(a,{className:"h-5 w-5"}):H(i,{className:"h-5 w-5"})})})}function v({side:Y,fileName:X,version:K,activeVersionId:N,versions:V,isActive:_,onActivate:M,onSwitchVersion:Z,onExit:U}){let B=C("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",_?"text-foreground":"text-muted-foreground hover:text-foreground"),L=H("button",{onClick:U,title:r.exit_compare(),className:B,children:H(WG,{className:"h-4 w-4"})}),w=O("button",{onClick:M,className:C("flex min-w-0 items-center gap-1 rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-muted",_?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[H("span",{className:"truncate",children:X}),K!==void 0&&O("span",{className:C("flex-shrink-0 rounded border px-1 py-0 text-xs",_?"border-foreground/40":"border-border"),children:["v",K]})]}),T=O(YG,{children:[H(_G,{onClick:M,title:r.switch_version(),className:B,children:H(HG,{className:"h-4 w-4"})}),H($G,{align:Y==="left"?"start":"end",className:"w-80 p-1",children:H("div",{className:"flex max-h-96 flex-col gap-1 overflow-y-auto",children:V.map((z)=>{let F=z.id===N;return O(QG,{onClick:()=>Z(z.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",z.version]}),H("div",{className:"flex h-10 w-16 flex-shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:z.previewUrl?H("img",{src:z.previewUrl,alt:z.name||void 0,className:"h-full w-full object-cover"}):H(JG,{className:"h-4 w-4 text-muted-foreground"})}),O("div",{className:"flex min-w-0 flex-1 flex-col text-left",children:[H("span",{className:"truncate text-sm font-semibold text-foreground",children:z.name}),H("span",{className:"truncate text-xs text-muted-foreground",children:z.creator?.name||"Unknown"})]}),F&&H(GG,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},z.id)})})})]});return H("div",{onMouseDown:M,className:C("dark flex h-10 flex-shrink-0 items-center gap-1 border-b bg-background px-2 transition-colors",_?"border-b-2 border-primary":"border-border"),children:Y==="left"?O(d,{children:[L,w,T]}):O(d,{children:[w,T,H("div",{className:"ml-auto"}),L]})})}function XG(Y,X,K){return KG({queryKey:X?["public-share-file",K,Y,localStorage.getItem(`share_pwd_${K}`)||""]:["files",Y],queryFn:async()=>{if(X){let V=localStorage.getItem(`share_pwd_${K}`)||"",_=await c.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:K,fileId:Y}},{headers:{"x-share-password":V}});if(!_.ok)throw Error("Failed to fetch version asset");return await _.json()}let N=await c.api.files[":fileId"].$get({param:{fileId:Y}});if(!N.ok)throw Error("Failed to fetch version asset");return await N.json()},enabled:!!Y&&(!X||!!K)})}function NH({isPublic:Y=!1,shareId:X,versions:K,leftId:N,rightId:V,activeSide:_,annotations:M,seekRequest:Z,onActiveSideChange:U,onSwitchVersion:B,onExit:L,onActiveAssetChange:w,onPlay:T,onTimeUpdate:z}){let F=J.useRef(null),E=J.useRef(null),$=J.useRef(null),[y,p]=J.useState(null),[S,g]=J.useState(null),[k,NG]=J.useState(1),[zG,l]=J.useState(!1),[OG,qG]=J.useState(!1),{data:P,isLoading:VG}=XG(N,Y,X),{data:R,isLoading:ZG}=XG(V,Y,X),MG=b(P),UG=b(R),I=!!P&&!!R&&MG.id===UG.id,f=_==="left"?P:R,u=_==="left"?y:S,D=J.useCallback(()=>_==="left"?E.current:$.current,[_]),h=J.useCallback(()=>_==="left"?$.current:E.current,[_]);J.useEffect(()=>{w(f??null)},[f,w]),J.useEffect(()=>{if(!Z)return;let G=D();if(G?.seekToSecond(Z.second),G?.pause(),I){let W=h();W?.seekToSecond(Z.second),W?.pause()}},[Z?.nonce]),J.useEffect(()=>{let G=()=>qG(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",G),()=>document.removeEventListener("fullscreenchange",G)},[]);let LG=J.useCallback((G)=>p(G),[]),DG=J.useCallback((G)=>g(G),[]),q=J.useCallback((G)=>{let W=D();if(W)G(W);if(I){let Q=h();if(Q)G(Q)}},[D,h,I]),m=J.useCallback(()=>{let G=!u?.video?.isPlaying;q((W)=>G?W.play():W.pause())},[u?.video?.isPlaying,q]);J.useEffect(()=>{let G=(W)=>{let Q=document.activeElement;if(Q&&(Q.tagName==="INPUT"||Q.tagName==="TEXTAREA"||Q instanceof HTMLElement&&Q.isContentEditable))return;let x=W.key===" ",j=Q&&(Q.tagName==="BUTTON"||Q.tagName==="A"||Q.tagName==="SELECT"||Q.tagName==="OPTION"||Q.getAttribute("role")==="button"||Q.getAttribute("role")==="link"||Q.getAttribute("role")==="checkbox"||Q.getAttribute("role")==="radio"||Q.getAttribute("role")==="menuitem");if(x&&j)return;if(W.key===" "||W.key.toLowerCase()==="k")W.preventDefault(),m()};return window.addEventListener("keydown",G),()=>{window.removeEventListener("keydown",G)}},[m]);let BG=J.useCallback((G)=>q((W)=>W.seekToFrame(G)),[q]),wG=J.useCallback(()=>D()?.toggleLoop(),[D]),FG=J.useCallback((G)=>{NG(G),l(G===0)},[]),EG=J.useCallback(()=>l((G)=>!G),[]),PG=J.useCallback((G)=>q((W)=>W.setPlaybackRate(G)),[q]),RG=J.useCallback((G)=>D()?.changeResolution(G),[D]),TG=J.useCallback(()=>q((G)=>G.zoomBy(1.2)),[q]),kG=J.useCallback(()=>q((G)=>G.zoomBy(0.8)),[q]),IG=J.useCallback(()=>q((G)=>G.fit()),[q]),bG=J.useCallback((G)=>{D()?.download(G)},[D]),yG=J.useCallback(()=>{if(!F.current)return;if(!document.fullscreenElement)F.current.requestFullscreen();else document.exitFullscreen()},[]),fG=J.useCallback((G,W)=>{if(I)$.current?.panBy(G,W)},[I]),mG=J.useCallback((G,W)=>{if(I)E.current?.panBy(G,W)},[I]),jG=J.useCallback(()=>m(),[m]),n=J.useCallback((G)=>K.find((W)=>W.id===G)?.version,[K]),CG=J.useMemo(()=>f?.media?.videoPreview?.url,[f?.media?.videoPreview?.url]),o=(G,W)=>{let x=b(W)?.comparePane;if(!x)return H("div",{className:"flex flex-1 items-center justify-center bg-gray-100 dark:bg-gray-950",children:H("p",{className:"text-muted-foreground",children:"Preview unavailable"})});let j=_===G;return H(x,{ref:G==="left"?E:$,file:W,shareId:X,isActive:j,annotations:j?M:[],onStateChange:G==="left"?LG:DG,onUserPan:G==="left"?fG:mG,onActivate:()=>U(G),muted:j?zG:!0,volume:k,onPlay:T,onTimeUpdate:z,onRequestTogglePlay:jG},W.id)},pG=!!P&&!!R,xG=VG||ZG;return O("div",{ref:F,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:[P&&H(v,{side:"left",fileName:P.name,version:n(N),activeVersionId:N,versions:K,isActive:_==="left",onActivate:()=>U("left"),onSwitchVersion:(G)=>B("left",G),onExit:L}),H("div",{className:"relative flex min-h-0 flex-1",children:P?o("left",P):H("div",{className:"flex flex-1 items-center justify-center",children:H(A,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),O("div",{className:"flex min-w-0 flex-1 flex-col",children:[R&&H(v,{side:"right",fileName:R.name,version:n(V),activeVersionId:V,versions:K,isActive:_==="right",onActivate:()=>U("right"),onSwitchVersion:(G)=>B("right",G),onExit:L}),H("div",{className:"relative flex min-h-0 flex-1",children:R?o("right",R):H("div",{className:"flex flex-1 items-center justify-center",children:H(A,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),xG&&!pG&&H("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:H(A,{className:"h-8 w-8 animate-spin text-foreground"})}),H(e,{activeState:u,activeAsset:f??null,previewUrl:CG,isFullScreen:OG,onTogglePlay:m,onToggleLoop:wG,onSeek:BG,onVolumeChange:FG,onToggleMute:EG,onChangePlaybackRate:PG,onChangeResolution:RG,onZoomIn:TG,onZoomOut:kG,onFit:IG,onDownload:bG,onToggleFullScreen:yG})]})}
1
+ import{o as s,q as t,r as b}from"./chunk-b73ktdmd.js";import{Rg as YG,Tg as _G,Ug as $G,Vg as QG}from"./chunk-gswbc6y9.js";import{Mi as JG,Mj as WG,Sh as c,ai as A,dj as i,gk as C,hj as a,mh as SG,mk as r,nh as d,oh as H,ph as O,th as KG,vi as GG,wi as HG}from"./chunk-nyhqy6q2.js";import{Vk as AG}from"./chunk-0qkj838r.js";function vG({file:Y,mediaControllerRef:X,onPlay:K,onPause:N,onTimeUpdate:V,annotations:_,startTime:M,shareId:Z,children:U}){let L=b(Y).viewer;return H(L,{ref:X,file:Y,onPlay:K,onPause:N,onTimeUpdate:V,annotations:_,startTime:M,shareId:Z,children:U},Y.id)}var J=AG(SG(),1);function e({activeState:Y,activeAsset:X,previewUrl:K,isFullScreen:N,onTogglePlay:V,onToggleLoop:_,onSeek:M,onVolumeChange:Z,onToggleMute:U,onChangePlaybackRate:B,onChangeResolution:L,onZoomIn:w,onZoomOut:T,onFit:z,onDownload:F,onToggleFullScreen:E}){if(Y?.kind==="video"&&Y.video&&X){let $=Y.video,y=$.totalFrames/$.frameRate,p=$.currentFrame/$.frameRate,S={isPlaying:$.isPlaying,progress:y>0?p/y*100:0,currentTime:p,duration:y,volume:$.volume,isMuted:$.isMuted,isLooping:$.isLooping,playbackRate:$.playbackRate,isFullScreen:N,showFrames:!1,currentResolution:$.currentResolution},g=K&&!X.media?.videoPreview?{...X,media:{...X.media,videoPreview:{url:K}}}:X;return H(s,{state:S,zoom:Y.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:$.buffered,data:g,resolutions:$.resolutions,togglePlay:V,toggleLoop:_,toggleMute:U,handleVolumeChange:Z,changePlaybackRate:B,changeResolution:(k)=>L(k.resolution),handleDownload:(k)=>F(k),toggleFullScreen:E,onZoomChange:(k)=>k>=Y.zoom?w():T(),onZoomReset:z,frameRate:$.frameRate,totalFrames:$.totalFrames,currentFrame:$.currentFrame,seekToFrame:M})}if(Y?.kind==="image")return H(t,{zoom:Y.zoom,onZoomIn:w,onZoomOut:T,onFit:z,onDownload:()=>F(),canDownload:!!X?.media?.original?.key,fullscreen:{isFullScreen:N,onToggle:E}});return H("div",{className:"relative z-10 flex items-center justify-end gap-2 border-t border-border bg-card px-4 py-3",children:H("button",{onClick:E,className:"text-foreground transition-colors hover:text-primary",title:"Fullscreen",children:N?H(a,{className:"h-5 w-5"}):H(i,{className:"h-5 w-5"})})})}function v({side:Y,fileName:X,version:K,activeVersionId:N,versions:V,isActive:_,onActivate:M,onSwitchVersion:Z,onExit:U}){let B=C("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",_?"text-foreground":"text-muted-foreground hover:text-foreground"),L=H("button",{onClick:U,title:r.exit_compare(),className:B,children:H(WG,{className:"h-4 w-4"})}),w=O("button",{onClick:M,className:C("flex min-w-0 items-center gap-1 rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-muted",_?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[H("span",{className:"truncate",children:X}),K!==void 0&&O("span",{className:C("flex-shrink-0 rounded border px-1 py-0 text-xs",_?"border-foreground/40":"border-border"),children:["v",K]})]}),T=O(YG,{children:[H(_G,{onClick:M,title:r.switch_version(),className:B,children:H(HG,{className:"h-4 w-4"})}),H($G,{align:Y==="left"?"start":"end",className:"w-80 p-1",children:H("div",{className:"flex max-h-96 flex-col gap-1 overflow-y-auto",children:V.map((z)=>{let F=z.id===N;return O(QG,{onClick:()=>Z(z.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",z.version]}),H("div",{className:"flex h-10 w-16 flex-shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:z.previewUrl?H("img",{src:z.previewUrl,alt:z.name||void 0,className:"h-full w-full object-cover"}):H(JG,{className:"h-4 w-4 text-muted-foreground"})}),O("div",{className:"flex min-w-0 flex-1 flex-col text-left",children:[H("span",{className:"truncate text-sm font-semibold text-foreground",children:z.name}),H("span",{className:"truncate text-xs text-muted-foreground",children:z.creator?.name||"Unknown"})]}),F&&H(GG,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},z.id)})})})]});return H("div",{onMouseDown:M,className:C("dark flex h-10 flex-shrink-0 items-center gap-1 border-b bg-background px-2 transition-colors",_?"border-b-2 border-primary":"border-border"),children:Y==="left"?O(d,{children:[L,w,T]}):O(d,{children:[w,T,H("div",{className:"ml-auto"}),L]})})}function XG(Y,X,K){return KG({queryKey:X?["public-share-file",K,Y,localStorage.getItem(`share_pwd_${K}`)||""]:["files",Y],queryFn:async()=>{if(X){let V=localStorage.getItem(`share_pwd_${K}`)||"",_=await c.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:K,fileId:Y}},{headers:{"x-share-password":V}});if(!_.ok)throw Error("Failed to fetch version asset");return await _.json()}let N=await c.api.files[":fileId"].$get({param:{fileId:Y}});if(!N.ok)throw Error("Failed to fetch version asset");return await N.json()},enabled:!!Y&&(!X||!!K)})}function NH({isPublic:Y=!1,shareId:X,versions:K,leftId:N,rightId:V,activeSide:_,annotations:M,seekRequest:Z,onActiveSideChange:U,onSwitchVersion:B,onExit:L,onActiveAssetChange:w,onPlay:T,onTimeUpdate:z}){let F=J.useRef(null),E=J.useRef(null),$=J.useRef(null),[y,p]=J.useState(null),[S,g]=J.useState(null),[k,NG]=J.useState(1),[zG,l]=J.useState(!1),[OG,qG]=J.useState(!1),{data:P,isLoading:VG}=XG(N,Y,X),{data:R,isLoading:ZG}=XG(V,Y,X),MG=b(P),UG=b(R),I=!!P&&!!R&&MG.id===UG.id,f=_==="left"?P:R,u=_==="left"?y:S,D=J.useCallback(()=>_==="left"?E.current:$.current,[_]),h=J.useCallback(()=>_==="left"?$.current:E.current,[_]);J.useEffect(()=>{w(f??null)},[f,w]),J.useEffect(()=>{if(!Z)return;let G=D();if(G?.seekToSecond(Z.second),G?.pause(),I){let W=h();W?.seekToSecond(Z.second),W?.pause()}},[Z?.nonce]),J.useEffect(()=>{let G=()=>qG(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",G),()=>document.removeEventListener("fullscreenchange",G)},[]);let LG=J.useCallback((G)=>p(G),[]),DG=J.useCallback((G)=>g(G),[]),q=J.useCallback((G)=>{let W=D();if(W)G(W);if(I){let Q=h();if(Q)G(Q)}},[D,h,I]),m=J.useCallback(()=>{let G=!u?.video?.isPlaying;q((W)=>G?W.play():W.pause())},[u?.video?.isPlaying,q]);J.useEffect(()=>{let G=(W)=>{let Q=document.activeElement;if(Q&&(Q.tagName==="INPUT"||Q.tagName==="TEXTAREA"||Q instanceof HTMLElement&&Q.isContentEditable))return;let x=W.key===" ",j=Q&&(Q.tagName==="BUTTON"||Q.tagName==="A"||Q.tagName==="SELECT"||Q.tagName==="OPTION"||Q.getAttribute("role")==="button"||Q.getAttribute("role")==="link"||Q.getAttribute("role")==="checkbox"||Q.getAttribute("role")==="radio"||Q.getAttribute("role")==="menuitem");if(x&&j)return;if(W.key===" "||W.key.toLowerCase()==="k")W.preventDefault(),m()};return window.addEventListener("keydown",G),()=>{window.removeEventListener("keydown",G)}},[m]);let BG=J.useCallback((G)=>q((W)=>W.seekToFrame(G)),[q]),wG=J.useCallback(()=>D()?.toggleLoop(),[D]),FG=J.useCallback((G)=>{NG(G),l(G===0)},[]),EG=J.useCallback(()=>l((G)=>!G),[]),PG=J.useCallback((G)=>q((W)=>W.setPlaybackRate(G)),[q]),RG=J.useCallback((G)=>D()?.changeResolution(G),[D]),TG=J.useCallback(()=>q((G)=>G.zoomBy(1.2)),[q]),kG=J.useCallback(()=>q((G)=>G.zoomBy(0.8)),[q]),IG=J.useCallback(()=>q((G)=>G.fit()),[q]),bG=J.useCallback((G)=>{D()?.download(G)},[D]),yG=J.useCallback(()=>{if(!F.current)return;if(!document.fullscreenElement)F.current.requestFullscreen();else document.exitFullscreen()},[]),fG=J.useCallback((G,W)=>{if(I)$.current?.panBy(G,W)},[I]),mG=J.useCallback((G,W)=>{if(I)E.current?.panBy(G,W)},[I]),jG=J.useCallback(()=>m(),[m]),n=J.useCallback((G)=>K.find((W)=>W.id===G)?.version,[K]),CG=J.useMemo(()=>f?.media?.videoPreview?.url,[f?.media?.videoPreview?.url]),o=(G,W)=>{let x=b(W)?.comparePane;if(!x)return H("div",{className:"flex flex-1 items-center justify-center bg-gray-100 dark:bg-gray-950",children:H("p",{className:"text-muted-foreground",children:"Preview unavailable"})});let j=_===G;return H(x,{ref:G==="left"?E:$,file:W,shareId:X,isActive:j,annotations:j?M:[],onStateChange:G==="left"?LG:DG,onUserPan:G==="left"?fG:mG,onActivate:()=>U(G),muted:j?zG:!0,volume:k,onPlay:T,onTimeUpdate:z,onRequestTogglePlay:jG},W.id)},pG=!!P&&!!R,xG=VG||ZG;return O("div",{ref:F,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:[P&&H(v,{side:"left",fileName:P.name,version:n(N),activeVersionId:N,versions:K,isActive:_==="left",onActivate:()=>U("left"),onSwitchVersion:(G)=>B("left",G),onExit:L}),H("div",{className:"relative flex min-h-0 flex-1",children:P?o("left",P):H("div",{className:"flex flex-1 items-center justify-center",children:H(A,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),O("div",{className:"flex min-w-0 flex-1 flex-col",children:[R&&H(v,{side:"right",fileName:R.name,version:n(V),activeVersionId:V,versions:K,isActive:_==="right",onActivate:()=>U("right"),onSwitchVersion:(G)=>B("right",G),onExit:L}),H("div",{className:"relative flex min-h-0 flex-1",children:R?o("right",R):H("div",{className:"flex flex-1 items-center justify-center",children:H(A,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),xG&&!pG&&H("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:H(A,{className:"h-8 w-8 animate-spin text-foreground"})}),H(e,{activeState:u,activeAsset:f??null,previewUrl:CG,isFullScreen:OG,onTogglePlay:m,onToggleLoop:wG,onSeek:BG,onVolumeChange:FG,onToggleMute:EG,onChangePlaybackRate:PG,onChangeResolution:RG,onZoomIn:TG,onZoomOut:kG,onFit:IG,onDownload:bG,onToggleFullScreen:yG})]})}
2
2
  export{vG as h,NH as i};
@@ -1,2 +1,2 @@
1
- import{zf as A}from"./chunk-ry33f2qk.js";import{Fh as w,Sh as z,oh as v}from"./chunk-nyhqy6q2.js";var B=(b)=>({queryKey:["projects",b],queryFn:async()=>{let h=await z.api.projects[":projectId"].$get({param:{projectId:b}});if(!h.ok)throw Error("Failed to fetch project");return await h.json()}}),H=w("/projects/$projectId/folders/$folderId")({loader:({context:{queryClient:b},params:{projectId:h}})=>b.ensureQueryData(B(h)),pendingComponent:()=>v(A,{})});
1
+ import{zf as A}from"./chunk-3qks722n.js";import{Fh as w,Sh as z,oh as v}from"./chunk-nyhqy6q2.js";var B=(b)=>({queryKey:["projects",b],queryFn:async()=>{let h=await z.api.projects[":projectId"].$get({param:{projectId:b}});if(!h.ok)throw Error("Failed to fetch project");return await h.json()}}),H=w("/projects/$projectId/folders/$folderId")({loader:({context:{queryClient:b},params:{projectId:h}})=>b.ensureQueryData(B(h)),pendingComponent:()=>v(A,{})});
2
2
  export{B as cf,H as df};
@@ -0,0 +1,2 @@
1
+ import{n as p}from"./chunk-b73ktdmd.js";import{V as Yz,W as Zz,X as _z,Y as $z,Z as Kz}from"./chunk-wsyg4rwg.js";import{Ua as Uz}from"./chunk-srn8t0v7.js";import{Wa as S}from"./chunk-kfhtk3eh.js";import{ig as v}from"./chunk-nnkkem25.js";import{Mg as Jz}from"./chunk-fz88kkk1.js";import{bh as Xz}from"./chunk-gswbc6y9.js";import{Cj as A,Lj as Gz,Sh as r,Ti as h,ai as o,gk as T,ji as t,li as e,mh as Bz,mk as Y,nh as B,oh as z,oj as zz,ph as J,qh as a,qi as M,ri as s,th as n,wi as b}from"./chunk-nyhqy6q2.js";import{Vk as Rz}from"./chunk-0qkj838r.js";var Z=Rz(Bz(),1);function uz({projectId:O,contextAssetId:R}){let{isHistoryMode:W,setIsHistoryMode:I,currentSessionId:Vz,chatAssets:u,removeAsset:Wz,messages:E,historySessions:g,isStreaming:D,fetchHistorySessions:m,loadSession:Lz,deleteSession:Nz,startNewSession:Qz,sendMessage:Pz,abortActiveSession:Oz,selectedAgentId:H,setSelectedAgentId:w}=v(),{teamId:_,ensureTeamIdForProject:l}=Xz();Z.useEffect(()=>{if(O)l(O)},[O,l]);let{data:Dz=[]}=n({queryKey:["agents",_],queryFn:async()=>{if(!_)return[];let G=await r.api.teams[":teamId"].agents.$get({param:{teamId:_}});if(!G.ok)throw Error("failed to fetch agents");return G.json()},enabled:!!_}),F=Dz.filter((G)=>G.type==="chat"&&G.enabled);Z.useEffect(()=>{if(F.length>0){if(!F.some((X)=>X.id===H))w(F[0].id)}},[F,H,w]);let[C,j]=Z.useState(""),d=Z.useRef(null),y=Z.useRef(null),k=Z.useRef(!0),f=Z.useRef(!0);Z.useEffect(()=>{f.current=!0,k.current=!0},[O,R,W]),Z.useEffect(()=>{let G=y.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!G)return;let{scrollTop:X,isAtBottom:$}=v.getState(),V=setTimeout(()=>{if($)G.scrollTop=G.scrollHeight;else G.scrollTop=X;let Q=setTimeout(()=>{f.current=!1},50);return()=>clearTimeout(Q)},0);return()=>clearTimeout(V)},[O,R,W]),Z.useEffect(()=>{let G=y.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!G)return;let X=()=>{if(f.current)return;let $=G.scrollTop,V=G.scrollHeight-$-G.clientHeight<10;v.getState().setScrollState($,V)};return G.addEventListener("scroll",X),()=>{G.removeEventListener("scroll",X)}},[O,R,W]);let{ref:qz,isDropTarget:Ez}=Uz({id:"chatbot-sidebar",data:{type:"chatbot-sidebar"}});Z.useEffect(()=>{if(!W){let{isAtBottom:G}=v.getState();if(G||D){let X=k.current?"auto":"smooth";d.current?.scrollIntoView({behavior:X})}k.current=!1}},[E,D,W]),Z.useEffect(()=>{if(W&&_)m(_)},[W,m,_]);let q=a(),Fz=Z.useCallback(()=>{q.invalidateQueries({queryKey:["search"]}),q.invalidateQueries({queryKey:["folders"]}),q.invalidateQueries({queryKey:["files"]}),q.invalidateQueries({queryKey:["file"]}),q.invalidateQueries({queryKey:["version_stacks"]}),q.invalidateQueries({queryKey:["projects"]})},[q]),x=()=>{if(!C.trim()||D||!_)return;Pz(_,C,O,R,Fz),j("")},Hz=(G)=>{if(G.nativeEvent.isComposing)return;if(G.key==="Enter"&&!G.shiftKey)G.preventDefault(),x()},c=(G)=>{if(typeof G==="string")return G;if(Array.isArray(G))return G.map((X)=>{if(typeof X==="string")return X;if(X&&typeof X==="object"&&"type"in X&&X.type==="text"&&"text"in X)return String(X.text);return""}).join("");return""},i=(G)=>{return G.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:")},Cz=(G)=>{switch(G.role){case"user":return z("div",{className:"flex justify-end w-full",children:z("div",{className:"bg-primary text-primary-foreground rounded-lg px-3 py-2 max-w-[85%] text-sm whitespace-pre-wrap shadow-xs break-words",children:c(G.content)})},G.id);case"assistant":{let $=G.content;if(!$)return null;let V=[];if($.forEach((K,L)=>{if(!K||typeof K!=="object")return;let N=K;switch(N.type){case"text":{let U=N.text;if(typeof U!=="string"||!U.trim())return;V.push(z("div",{className:"text-sm leading-[1.8] prose prose-sm dark:prose-invert max-w-none break-words",children:z(p,{components:{pre:({node:P,...vz})=>z("pre",{className:"whitespace-pre-wrap break-all break-words bg-muted text-foreground p-4 rounded-md border border-border/50 font-mono text-sm",...vz})},children:i(U)})},`txt-${L}`));break}case"thinking":{let U=N.thinking;if(typeof U!=="string"||!U.trim())return;V.push(J("details",{className:"group border border-border/50 rounded-lg bg-muted/20 my-2 overflow-hidden",children:[J("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-medium text-muted-foreground select-none cursor-pointer hover:bg-muted/40 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[z(s,{className:"h-3.5 w-3.5 text-primary/70 animate-pulse"}),z("span",{children:Y.role_thinking()||"Thinking"}),z(b,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),z("div",{className:"p-3 pt-0 text-xs text-muted-foreground/90 border-t border-border/40 bg-muted/10 leading-relaxed prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap font-sans",children:z(p,{children:i(U)})})]},`think-${L}`));break}case"toolCall":{let U=String(N.name||N.toolName||Y.unknown()),P=N.arguments||N.args;V.push(J("details",{className:"group border border-border/50 rounded-lg bg-violet-500/5 my-2 overflow-hidden",children:[J("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-semibold text-violet-600 dark:text-violet-400 select-none cursor-pointer hover:bg-violet-500/10 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[z(Gz,{className:"h-3.5 w-3.5"}),z("span",{children:Y.calling_tool()}),z("span",{className:"font-mono bg-violet-500/10 px-1.5 py-0.5 rounded text-[11px] text-violet-700 dark:text-violet-300",children:U}),z(b,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),!!P&&J("div",{className:"p-3 pt-0 text-[10px] text-muted-foreground/90 border-t border-border/40 bg-violet-500/5 font-sans",children:[z("div",{className:"text-[9px] text-muted-foreground/60 uppercase font-bold tracking-wider mb-1.5",children:Y.tool_arguments()||"Arguments"}),z("pre",{className:"font-mono bg-muted/30 p-2 rounded border border-border/30 overflow-x-auto max-h-32",children:JSON.stringify(P,null,2)})]})]},`tool-${L}`));break}case"image":{let U=String(N.mimeType||"image/png"),P=String(N.data||"");V.push(z("div",{className:"my-2 max-w-full",children:P?z("img",{src:P.startsWith("data:")?P:`data:${U};base64,${P}`,alt:"Attached asset",className:"max-h-60 rounded border border-border/50 object-contain shadow-xs"}):z("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:Y.image_object()})},`img-${L}`));break}default:{let U=JSON.stringify(K,null,2);if(U==="{}")return;V.push(z("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:U},`other-${L}`))}}}),V.length===0)return null;let Q=!1;if($.length>0){let K=$[$.length-1];if(typeof K==="string"&&K.trim().length>0)Q=!0;else if(K&&typeof K==="object"){let L=K;if(L.type==="text"&&typeof L.text==="string"&&L.text.trim().length>0)Q=!0}}return J("div",{className:"flex flex-col w-full space-y-1",children:[z("div",{className:"space-y-2 w-full",children:V}),Q&&z("div",{className:"text-[10px] text-muted-foreground self-start italic pt-1",children:Y.created_by_agent()})]},G.id)}case"toolResult":return z("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/40 p-2 rounded-md border border-border/50",children:z("span",{className:"font-semibold",children:Y.tool_result_with_name({name:G.toolName||"tool"})})},G.id);case"thinking_level_change":case"custom":{let X=G;if(X.customType==="context_display_info"){let Q=X.details?.assets||[];if(Q.length===0)return null;return J("div",{className:"text-xs text-muted-foreground bg-muted/40 p-2.5 rounded-lg border border-border/50 space-y-1 my-1",children:[z("div",{className:"font-semibold",children:Y.assets_added_to_context()}),z("ul",{className:"list-disc list-inside space-y-0.5",children:Q.map((K)=>J("li",{className:"truncate",children:[K.name," ",J("span",{className:"text-muted-foreground/70",children:["(",K.type,")"]})]},K.id))})]},G.id)}let $=X.content||"";return z("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:c($)},G.id)}default:return null}};return J("div",{ref:qz,className:T("relative flex flex-col h-full bg-background transition-colors duration-200 min-h-0"),children:[Ez&&z("div",{className:"absolute inset-0 bg-accent/30 border-2 border-primary z-50 pointer-events-none flex items-center justify-center p-6 text-center animate-in fade-in duration-150",children:J("div",{className:"bg-background/95 text-foreground px-4 py-3 rounded-xl border border-border/80 flex flex-col items-center gap-2 shadow-lg max-w-[80%] animate-in zoom-in-95 duration-150",children:[z(M,{className:"h-6 w-6 text-primary animate-bounce"}),z("span",{className:"text-sm font-semibold text-foreground",children:Y.chatbot_drag_drop_hint()||"Drop assets here"})]})}),z("div",{className:"flex items-center justify-between p-4 pt-[0.7rem] flex-shrink-0",children:W?J(B,{children:[z("div",{className:"flex items-center gap-2 font-semibold",children:z("span",{children:Y.history()})}),z("button",{onClick:()=>I(!1),className:"p-1.5 hover:bg-accent rounded-md text-muted-foreground hover:text-foreground transition-colors",title:"Close History",children:z(t,{className:"h-4 w-4"})})]}):J(B,{children:[z("div",{className:"flex items-center gap-2 font-semibold",children:z("span",{children:Y.shumai_agent()})}),J("div",{className:"flex items-center gap-1",children:[z("button",{onClick:Qz,className:"p-1.5 hover:bg-accent rounded-md text-muted-foreground hover:text-foreground transition-colors",title:Y.new_chat(),children:z(zz,{className:"h-4 w-4"})}),z("button",{onClick:()=>I(!0),className:"p-1.5 hover:bg-accent rounded-md text-muted-foreground hover:text-foreground transition-colors",title:Y.history(),children:z(h,{className:"h-4 w-4"})})]})]})}),W?z(S,{className:"flex-1 p-4 min-h-0",children:g.length===0?J("div",{className:"flex flex-col items-center justify-center h-48 text-muted-foreground p-4 text-center",children:[z(h,{className:"h-8 w-8 mb-2 opacity-50 text-muted-foreground"}),z("p",{className:"text-sm",children:Y.no_history_sessions()})]}):z("div",{className:"space-y-2 pb-4",children:g.map((G)=>{let X=G.id===Vz;return J("div",{className:T("group relative flex items-center justify-between p-3 border rounded-lg transition-all cursor-pointer bg-card",X?"border-primary":"border-border hover:bg-accent/30"),children:[J("div",{onClick:()=>_&&Lz(_,G.id),className:"flex-1 min-w-0 pr-6",children:[z("div",{className:"text-sm font-semibold text-foreground truncate",children:G.name||Y.new_chat()}),z("div",{className:"text-xs text-muted-foreground mt-0.5",children:Jz(G.createdAt)})]}),z("button",{onClick:($)=>{if($.stopPropagation(),_&&confirm(Y.delete_session_confirm()))Nz(_,G.id)},className:"absolute right-3 opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-destructive p-1 rounded hover:bg-muted",title:"Delete Session",children:z(A,{className:"h-4 w-4"})})]},G.id)})})}):J(B,{children:[z(S,{ref:y,className:"flex-1 p-4 min-h-0 [&>div>div]:!block",children:E.length===0?J("div",{className:"flex flex-col items-center justify-center h-48 border-2 border-dashed border-border rounded-lg text-muted-foreground p-4 text-center",children:[z(M,{className:"h-8 w-8 mb-2 opacity-50 text-muted-foreground"}),z("p",{className:"text-sm",children:Y.chatbot_drag_drop_hint()})]}):J("div",{className:"space-y-4 pb-4",children:[E.map(Cz),D&&E.length>0&&E[E.length-1].role==="user"&&J("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground italic",children:[z(o,{className:"h-3 w-3 animate-spin text-primary"}),z("span",{children:"Thinking..."})]}),z("div",{ref:d})]})}),z("div",{className:"p-2 flex-shrink-0 bg-background",children:J("div",{className:"relative flex flex-col w-full border border-foreground/20 rounded-2xl shadow-xs transition-all duration-200 focus-within:ring-2 focus-within:ring-primary focus-within:border-transparent bg-background overflow-hidden",children:[u.length>0&&z("div",{className:"flex flex-col gap-1.5 min-h-0 max-h-[160px] overflow-y-auto border-b border-border bg-muted/5 p-3 divide-y divide-border/50",children:u.map((G)=>J("div",{className:"flex items-center justify-between py-1.5 text-xs group",children:[J("div",{className:"flex items-baseline gap-1.5 min-w-0 pr-2",children:[z("span",{className:"truncate font-medium text-foreground",children:G.name}),z("span",{className:"text-[9px] text-muted-foreground uppercase flex-shrink-0",children:G.type})]}),z("button",{onClick:()=>Wz(G.id),className:"text-muted-foreground hover:text-destructive transition-colors p-0.5",title:Y.remove_from_context(),children:z(A,{className:"h-3.5 w-3.5"})})]},G.id))}),z("textarea",{value:C,onChange:(G)=>j(G.target.value),onKeyDown:Hz,placeholder:"Type a message...",rows:2,className:"w-full bg-transparent border-none focus:ring-0 focus:outline-hidden resize-none min-h-[44px] max-h-[120px] px-3 py-2 text-sm focus-visible:outline-hidden focus:ring-transparent focus:border-transparent focus-visible:ring-0",disabled:D}),J("div",{className:"flex justify-between items-center px-3 pb-2 pt-1",children:[z("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[70%]",children:F.length>0?J(Yz,{value:H||"",onValueChange:(G)=>w(G),disabled:D,children:[z(_z,{className:"h-8 border-none bg-transparent hover:bg-muted text-muted-foreground hover:text-foreground focus:ring-0 focus:ring-offset-0 px-2 py-0 gap-1.5 text-xs shrink-0 select-none shadow-none max-w-full",children:z(Zz,{placeholder:Y.select_agent()})}),z($z,{children:F.map((G)=>z(Kz,{value:G.id,children:J("div",{className:"flex items-center gap-2",children:[G.avatar?z("img",{src:G.avatar,alt:G.name,className:"w-4 h-4 rounded-full object-cover"}):z(M,{className:"w-4 h-4 text-muted-foreground"}),z("span",{className:"text-xs",children:G.name})]})},G.id))})]}):z("div",{className:"flex items-center gap-1.5 px-2 py-1 text-[11px] text-muted-foreground/60 italic select-none",children:z("span",{children:Y.no_chat_agents_warning()})})}),D?z("button",{onClick:()=>{if(_)Oz(_)},className:"p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 shadow-sm bg-destructive text-destructive-foreground hover:bg-destructive/90 transform hover:-translate-y-0.5",title:"Stop generation",children:z("div",{className:"h-4 w-4 flex items-center justify-center",children:z("div",{className:"h-3 w-3 bg-current rounded-[2px] bg-white"})})}):z("button",{onClick:x,disabled:!C.trim()||!H,className:T("p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 shadow-sm",C.trim()&&H?"bg-primary text-primary-foreground hover:bg-primary/95 transform hover:-translate-y-0.5":"bg-muted text-muted-foreground cursor-not-allowed opacity-50"),children:z(e,{className:"h-4 w-4"})})]})]})})]})]})}
2
+ export{uz as k};
@@ -1,4 +1,4 @@
1
- import{B as gO,D as Jd,F as F5,G as B5,H as O5,O as Qd,P as bO,Q as $k,R as cl,S as i3,T as P7,U as H3}from"./chunk-pq18zenh.js";import{ea as Ed}from"./chunk-wsyg4rwg.js";import{Wa as _p}from"./chunk-kfhtk3eh.js";import{$a as Hd,_a as Od,ab as Md,bb as Dd,cb as Td,db as Rd,eb as Nd,fb as zd}from"./chunk-0xbf8bcg.js";import{Bf as C3,Cf as _3,Df as v_,Ff as kb,Gf as S_,Hf as y_,Jf as k_,Kf as M_,Lf as Cb,Mf as C_,Nf as __,Of as wd,Pf as jd,Qf as dd,Rf as qd,Sf as hO,Tf as cO,Uf as kp,Vf as Cp,ag as _5}from"./chunk-77r8w95d.js";import{og as uO,pg as wo,qg as hi}from"./chunk-fa2g2wge.js";import{Mg as yd}from"./chunk-fz88kkk1.js";import{Og as c8}from"./chunk-dghtwyq1.js";import{Qg as Ln,Rg as Mf,Tg as Df,Ug as Tf,Vg as l1,Yg as n3,bh as Yd,ch as mO,dh as h8,eh as kd,fh as Cd,gh as _d,ih as Fd,jh as Bd}from"./chunk-gswbc6y9.js";import{$h as bd,Aj as l8,Cj as pd,Ei as Gd,Ej as Vd,Gi as $_,Ji as Vn,Jj as Qk,Kj as Zk,Lh as xd,Mi as C5,Mj as qo,Sh as Le,ai as Zd,bk as E2,dj as l3,gk as Mi,hj as f3,hk as Ad,ij as ul,ik as vd,ji as Ud,jk as Sd,li as r8,lj as Xd,mh as Pa,mj as Vk,mk as It,nh as mo,ni as O3,nj as hh,oh as x,oj as ch,ph as rt,qh as k5,qj as Kd,rj as Yk,si as Id,th as po,tj as Jk,vh as Hf,vi as oh,wh as oO,wi as jo,xi as aO,xj as Ld,yi as iO}from"./chunk-nyhqy6q2.js";import{Vk as Ie,Wk as Me,Xk as o4}from"./chunk-0qkj838r.js";var kw=Me((lJ,yw)=>{var qw=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,wM=/\n/g,jM=/^\s*/,dM=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,qM=/^:\s*/,AM=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,vM=/^[;\s]*/,SM=/^\s+|\s+$/g,yM=`
1
+ import{B as gO,D as Jd,F as F5,G as B5,H as O5,O as Qd,P as bO,Q as $k,R as cl,S as i3,T as P7,U as H3}from"./chunk-crt1e1w1.js";import{ea as Ed}from"./chunk-wsyg4rwg.js";import{Wa as _p}from"./chunk-kfhtk3eh.js";import{$a as Hd,_a as Od,ab as Md,bb as Dd,cb as Td,db as Rd,eb as Nd,fb as zd}from"./chunk-0xbf8bcg.js";import{Bf as C3,Cf as _3,Df as v_,Ff as kb,Gf as S_,Hf as y_,Jf as k_,Kf as M_,Lf as Cb,Mf as C_,Nf as __,Of as wd,Pf as jd,Qf as dd,Rf as qd,Sf as hO,Tf as cO,Uf as kp,Vf as Cp,ag as _5}from"./chunk-77r8w95d.js";import{og as uO,pg as wo,qg as hi}from"./chunk-3n1rezd0.js";import{Mg as yd}from"./chunk-fz88kkk1.js";import{Og as c8}from"./chunk-dghtwyq1.js";import{Qg as Ln,Rg as Mf,Tg as Df,Ug as Tf,Vg as l1,Yg as n3,bh as Yd,ch as mO,dh as h8,eh as kd,fh as Cd,gh as _d,ih as Fd,jh as Bd}from"./chunk-gswbc6y9.js";import{$h as bd,Aj as l8,Cj as pd,Ei as Gd,Ej as Vd,Gi as $_,Ji as Vn,Jj as Qk,Kj as Zk,Lh as xd,Mi as C5,Mj as qo,Sh as Le,ai as Zd,bk as E2,dj as l3,gk as Mi,hj as f3,hk as Ad,ij as ul,ik as vd,ji as Ud,jk as Sd,li as r8,lj as Xd,mh as Pa,mj as Vk,mk as It,nh as mo,ni as O3,nj as hh,oh as x,oj as ch,ph as rt,qh as k5,qj as Kd,rj as Yk,si as Id,th as po,tj as Jk,vh as Hf,vi as oh,wh as oO,wi as jo,xi as aO,xj as Ld,yi as iO}from"./chunk-nyhqy6q2.js";import{Vk as Ie,Wk as Me,Xk as o4}from"./chunk-0qkj838r.js";var kw=Me((lJ,yw)=>{var qw=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,wM=/\n/g,jM=/^\s*/,dM=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,qM=/^:\s*/,AM=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,vM=/^[;\s]*/,SM=/^\s+|\s+$/g,yM=`
2
2
  `,Aw="/",vw="*",Cf="",kM="comment",CM="declaration";function _M(t,e){if(typeof t!=="string")throw TypeError("First argument must be a string");if(!t)return[];e=e||{};var a=1,i=1;function s(d){var v=d.match(wM);if(v)a+=v.length;var k=d.lastIndexOf(yM);i=~k?d.length-k:i+d.length}function n(){var d={line:a,column:i};return function(v){return v.position=new l(d),c(),v}}function l(d){this.start=d,this.end={line:a,column:i},this.source=e.source}l.prototype.content=t;function f(d){var v=Error(e.source+":"+a+":"+i+": "+d);if(v.reason=d,v.filename=e.source,v.line=a,v.column=i,v.source=t,e.silent);else throw v}function o(d){var v=d.exec(t);if(!v)return;var k=v[0];return s(k),t=t.slice(k.length),v}function c(){o(jM)}function u(d){var v;d=d||[];while(v=m())if(v!==!1)d.push(v);return d}function m(){var d=n();if(Aw!=t.charAt(0)||vw!=t.charAt(1))return;var v=2;while(Cf!=t.charAt(v)&&(vw!=t.charAt(v)||Aw!=t.charAt(v+1)))++v;if(v+=2,Cf===t.charAt(v-1))return f("End of comment missing");var k=t.slice(2,v-2);return i+=2,s(k),t=t.slice(v),i+=2,d({type:kM,comment:k})}function p(){var d=n(),v=o(dM);if(!v)return;if(m(),!o(qM))return f("property missing ':'");var k=o(AM),y=d({type:CM,property:Sw(v[0].replace(qw,Cf)),value:k?Sw(k[0].replace(qw,Cf)):Cf});return o(vM),y}function w(){var d=[];u(d);var v;while(v=p())if(v!==!1)d.push(v),u(d);return d}return c(),w()}function Sw(t){return t?t.replace(SM,Cf):Cf}yw.exports=_M});var Cw=Me((Dc)=>{var FM=Dc&&Dc.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.default=OM;var BM=FM(kw());function OM(t,e){let a=null;if(!t||typeof t!=="string")return a;let i=(0,BM.default)(t),s=typeof e==="function";return i.forEach((n)=>{if(n.type!=="declaration")return;let{property:l,value:f}=n;if(s)e(l,f,n);else if(f)a=a||{},a[l]=f}),a}});var Ow=Me((Fw)=>{Object.defineProperty(Fw,"__esModule",{value:!0});Fw.camelCase=void 0;var HM=/^--[a-zA-Z0-9_-]+$/,MM=/-([a-z])/g,DM=/^[^-]+$/,TM=/^-(webkit|moz|ms|o|khtml)-/,RM=/^-(ms)-/,NM=function(t){return!t||DM.test(t)||HM.test(t)},zM=function(t,e){return e.toUpperCase()},_w=function(t,e){return"".concat(e,"-")},EM=function(t,e){if(e===void 0)e={};if(NM(t))return t;if(t=t.toLowerCase(),e.reactCompat)t=t.replace(RM,_w);else t=t.replace(TM,_w);return t.replace(MM,zM)};Fw.camelCase=EM});var Mw=Me((j4,Hw)=>{var xM=j4&&j4.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},UM=xM(Cw()),IM=Ow();function w4(t,e){var a={};if(!t||typeof t!=="string")return a;return(0,UM.default)(t,function(i,s){if(i&&s)a[(0,IM.camelCase)(i,e)]=s}),a}w4.default=w4;Hw.exports=w4});var ad=Me((ZP,ed)=>{var v5=Object.prototype.hasOwnProperty,td=Object.prototype.toString,Jj=Object.defineProperty,Qj=Object.getOwnPropertyDescriptor,Zj=function(e){if(typeof Array.isArray==="function")return Array.isArray(e);return td.call(e)==="[object Array]"},$j=function(e){if(!e||td.call(e)!=="[object Object]")return!1;var a=v5.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&v5.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!i)return!1;var s;for(s in e);return typeof s>"u"||v5.call(e,s)},Wj=function(e,a){if(Jj&&a.name==="__proto__")Jj(e,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0});else e[a.name]=a.newValue},Pj=function(e,a){if(a==="__proto__"){if(!v5.call(e,a))return;else if(Qj)return Qj(e,a).value}return e[a]};ed.exports=function t(){var e,a,i,s,n,l,f=arguments[0],o=1,c=arguments.length,u=!1;if(typeof f==="boolean")u=f,f=arguments[1]||{},o=2;if(f==null||typeof f!=="object"&&typeof f!=="function")f={};for(;o<c;++o)if(e=arguments[o],e!=null){for(a in e)if(i=Pj(f,a),s=Pj(e,a),f!==s){if(u&&s&&($j(s)||(n=Zj(s)))){if(n)n=!1,l=i&&Zj(i)?i:[];else l=i&&$j(i)?i:{};Wj(f,{name:a,newValue:t(u,l,s)})}else if(typeof s<"u")Wj(f,{name:a,newValue:s})}}return f}});var h0=Me((Met,Wd)=>{var $c;if(typeof window<"u")$c=window;else if(typeof global<"u")$c=global;else if(typeof self<"u")$c=self;else $c={};Wd.exports=$c});var u8=Me((Det,tq)=>{var Pd=Array.prototype.slice;tq.exports=AR;function AR(t,e){if(!("length"in t))t=[t];t=Pd.call(t);while(t.length){var a=t.shift(),i=e(a);if(i)return i;if(a.childNodes&&a.childNodes.length)t=Pd.call(a.childNodes).concat(t)}}});var aq=Me((Tet,eq)=>{eq.exports=Ao;function Ao(t,e){if(!(this instanceof Ao))return new Ao(t,e);this.data=t,this.nodeValue=t,this.length=t.length,this.ownerDocument=e||null}Ao.prototype.nodeType=8;Ao.prototype.nodeName="#comment";Ao.prototype.toString=function(){return"[object Comment]"}});var sq=Me((Ret,iq)=>{iq.exports=ml;function ml(t,e){if(!(this instanceof ml))return new ml(t);this.data=t||"",this.length=this.data.length,this.ownerDocument=e||null}ml.prototype.type="DOMTextNode";ml.prototype.nodeType=3;ml.prototype.nodeName="#text";ml.prototype.toString=function(){return this.data};ml.prototype.replaceData=function(e,a,i){var s=this.data,n=s.substring(0,e),l=s.substring(e+a,s.length);this.data=n+i+l,this.length=this.data.length}});var m8=Me((Net,nq)=>{nq.exports=vR;function vR(t){var e=this,a=t.type;if(!t.target)t.target=e;if(!e.listeners)e.listeners={};var i=e.listeners[a];if(i)return i.forEach(function(s){if(t.currentTarget=e,typeof s==="function")s(t);else s.handleEvent(t)});if(e.parentNode)e.parentNode.dispatchEvent(t)}});var g8=Me((zet,lq)=>{lq.exports=SR;function SR(t,e){var a=this;if(!a.listeners)a.listeners={};if(!a.listeners[t])a.listeners[t]=[];if(a.listeners[t].indexOf(e)===-1)a.listeners[t].push(e)}});var b8=Me((Eet,fq)=>{fq.exports=yR;function yR(t,e){var a=this;if(!a.listeners)return;if(!a.listeners[t])return;var i=a.listeners[t],s=i.indexOf(e);if(s!==-1)i.splice(s,1)}});var cq=Me((xet,hq)=>{hq.exports=rq;var kR=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function rq(t){switch(t.nodeType){case 3:return p8(t.data);case 8:return"<!--"+t.data+"-->";default:return CR(t)}}function CR(t){var e=[],a=t.tagName;if(t.namespaceURI==="http://www.w3.org/1999/xhtml")a=a.toLowerCase();if(e.push("<"+a+OR(t)+BR(t)),kR.indexOf(a)>-1)e.push(" />");else{if(e.push(">"),t.childNodes.length)e.push.apply(e,t.childNodes.map(rq));else if(t.textContent||t.innerText)e.push(p8(t.textContent||t.innerText));else if(t.innerHTML)e.push(t.innerHTML);e.push("</"+a+">")}return e.join("")}function _R(t,e){var a=typeof t[e];if(e==="style"&&Object.keys(t.style).length>0)return!0;return t.hasOwnProperty(e)&&(a==="string"||a==="boolean"||a==="number")&&e!=="nodeName"&&e!=="className"&&e!=="tagName"&&e!=="textContent"&&e!=="innerText"&&e!=="namespaceURI"&&e!=="innerHTML"}function FR(t){if(typeof t==="string")return t;var e="";return Object.keys(t).forEach(function(a){var i=t[a];a=a.replace(/[A-Z]/g,function(s){return"-"+s.toLowerCase()}),e+=a+":"+i+";"}),e}function BR(t){var e=t.dataset,a=[];for(var i in e)a.push({name:"data-"+i,value:e[i]});return a.length?oq(a):""}function oq(t){var e=[];return t.forEach(function(a){var{name:i,value:s}=a;if(i==="style")s=FR(s);e.push(i+'="'+HR(s)+'"')}),e.length?" "+e.join(" "):""}function OR(t){var e=[];for(var a in t)if(_R(t,a))e.push({name:a,value:t[a]});for(var i in t._attributes)for(var s in t._attributes[i]){var n=t._attributes[i][s],l=(n.prefix?n.prefix+":":"")+s;e.push({name:l,value:n.value})}if(t.className)e.push({name:"class",value:t.className});return e.length?oq(e):""}function p8(t){var e="";if(typeof t==="string")e=t;else if(t)e=t.toString();return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function HR(t){return p8(t).replace(/"/g,"&quot;")}});var j8=Me((Uet,mq)=>{var w8=u8(),MR=m8(),DR=g8(),TR=b8(),RR=cq(),uq="http://www.w3.org/1999/xhtml";mq.exports=Ca;function Ca(t,e,a){if(!(this instanceof Ca))return new Ca(t);var i=a===void 0?uq:a||null;if(this.tagName=i===uq?String(t).toUpperCase():t,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=e||null,this.namespaceURI=i,this._attributes={},this.tagName==="INPUT")this.type="text"}Ca.prototype.type="DOMElement";Ca.prototype.nodeType=1;Ca.prototype.appendChild=function(e){if(e.parentNode)e.parentNode.removeChild(e);return this.childNodes.push(e),e.parentNode=this,e};Ca.prototype.replaceChild=function(e,a){if(e.parentNode)e.parentNode.removeChild(e);var i=this.childNodes.indexOf(a);return a.parentNode=null,this.childNodes[i]=e,e.parentNode=this,a};Ca.prototype.removeChild=function(e){var a=this.childNodes.indexOf(e);return this.childNodes.splice(a,1),e.parentNode=null,e};Ca.prototype.insertBefore=function(e,a){if(e.parentNode)e.parentNode.removeChild(e);var i=a===null||a===void 0?-1:this.childNodes.indexOf(a);if(i>-1)this.childNodes.splice(i,0,e);else this.childNodes.push(e);return e.parentNode=this,e};Ca.prototype.setAttributeNS=function(e,a,i){var s=null,n=a,l=a.indexOf(":");if(l>-1)s=a.substr(0,l),n=a.substr(l+1);if(this.tagName==="INPUT"&&a==="type")this.type=i;else{var f=this._attributes[e]||(this._attributes[e]={});f[n]={value:i,prefix:s}}};Ca.prototype.getAttributeNS=function(e,a){var i=this._attributes[e],s=i&&i[a]&&i[a].value;if(this.tagName==="INPUT"&&a==="type")return this.type;if(typeof s!=="string")return null;return s};Ca.prototype.removeAttributeNS=function(e,a){if(!Object.prototype.hasOwnProperty.call(this._attributes,e))return;var i=this._attributes[e];if(i&&Object.prototype.hasOwnProperty.call(i,a))delete i[a]};Ca.prototype.hasAttributeNS=function(e,a){var i=this._attributes[e];return!!i&&a in i};Ca.prototype.setAttribute=function(e,a){return this.setAttributeNS(null,e,a)};Ca.prototype.getAttribute=function(e){return this.getAttributeNS(null,e)};Ca.prototype.removeAttribute=function(e){return this.removeAttributeNS(null,e)};Ca.prototype.hasAttribute=function(e){return this.hasAttributeNS(null,e)};Ca.prototype.removeEventListener=TR;Ca.prototype.addEventListener=DR;Ca.prototype.dispatchEvent=MR;Ca.prototype.focus=function(){return};Ca.prototype.toString=function(){return RR(this)};Ca.prototype.getElementsByClassName=function(e){var a=e.split(" "),i=[];return w8(this,function(s){if(s.nodeType===1){var n=s.className||"",l=n.split(" ");if(a.every(function(f){return l.indexOf(f)!==-1}))i.push(s)}}),i};Ca.prototype.getElementsByTagName=function(e){e=e.toLowerCase();var a=[];return w8(this.childNodes,function(i){if(i.nodeType===1&&(e==="*"||i.tagName.toLowerCase()===e))a.push(i)}),a};Ca.prototype.contains=function(e){return w8(this,function(a){return e===a})||!1}});var bq=Me((Iet,gq)=>{var d8=j8();gq.exports=c0;function c0(t){if(!(this instanceof c0))return new c0;this.childNodes=[],this.parentNode=null,this.ownerDocument=t||null}c0.prototype.type="DocumentFragment";c0.prototype.nodeType=11;c0.prototype.nodeName="#document-fragment";c0.prototype.appendChild=d8.prototype.appendChild;c0.prototype.replaceChild=d8.prototype.replaceChild;c0.prototype.removeChild=d8.prototype.removeChild;c0.prototype.toString=function(){return this.childNodes.map(function(e){return String(e)}).join("")}});var wq=Me((Get,pq)=>{pq.exports=q8;function q8(t){}q8.prototype.initEvent=function(e,a,i){this.type=e,this.bubbles=a,this.cancelable=i};q8.prototype.preventDefault=function(){}});var dq=Me((Xet,jq)=>{var NR=u8(),zR=aq(),ER=sq(),Wc=j8(),xR=bq(),UR=wq(),IR=m8(),GR=g8(),XR=b8();jq.exports=H5;function H5(){if(!(this instanceof H5))return new H5;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}var Ws=H5.prototype;Ws.createTextNode=function(e){return new ER(e,this)};Ws.createElementNS=function(e,a){var i=e===null?null:String(e);return new Wc(a,this,i)};Ws.createElement=function(e){return new Wc(e,this)};Ws.createDocumentFragment=function(){return new xR(this)};Ws.createEvent=function(e){return new UR(e)};Ws.createComment=function(e){return new zR(e,this)};Ws.getElementById=function(e){e=String(e);var a=NR(this.childNodes,function(i){if(String(i.id)===e)return i});return a||null};Ws.getElementsByClassName=Wc.prototype.getElementsByClassName;Ws.getElementsByTagName=Wc.prototype.getElementsByTagName;Ws.contains=Wc.prototype.contains;Ws.removeEventListener=XR;Ws.addEventListener=GR;Ws.dispatchEvent=IR});var Aq=Me((Ket,qq)=>{var KR=dq();qq.exports=new KR});var A8=Me((Let,Sq)=>{var vq=typeof global<"u"?global:typeof window<"u"?window:{},LR=Aq(),Pc;if(typeof document<"u")Pc=document;else if(Pc=vq["__GLOBAL_DOCUMENT_CACHE@4"],!Pc)Pc=vq["__GLOBAL_DOCUMENT_CACHE@4"]=LR;Sq.exports=Pc});var yq=Me((Vet,f1)=>{function v8(){return f1.exports=v8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var i in a)({}).hasOwnProperty.call(a,i)&&(t[i]=a[i])}return t},f1.exports.__esModule=!0,f1.exports.default=f1.exports,v8.apply(null,arguments)}f1.exports=v8,f1.exports.__esModule=!0,f1.exports.default=f1.exports});var Cq=Me((Yet,kq)=>{kq.exports=YR;var VR=Object.prototype.toString;function YR(t){if(!t)return!1;var e=VR.call(t);return e==="[object Function]"||typeof t==="function"&&e!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}});var Bq=Me((Jet,Fq)=>{function JR(t,e){var a=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(a)return(a=a.call(t)).next.bind(a);if(Array.isArray(t)||(a=QR(t))||e&&t&&typeof t.length==="number"){if(a)t=a;var i=0;return function(){if(i>=t.length)return{done:!0};return{done:!1,value:t[i++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QR(t,e){if(!t)return;if(typeof t==="string")return _q(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);if(a==="Object"&&t.constructor)a=t.constructor.name;if(a==="Map"||a==="Set")return Array.from(t);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _q(t,e)}function _q(t,e){if(e==null||e>t.length)e=t.length;for(var a=0,i=Array(e);a<e;a++)i[a]=t[a];return i}var ZR=function(){function t(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var e=t.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},e.addInterceptor=function(i,s){if(!this.typeToInterceptorsMap_.has(i))this.typeToInterceptorsMap_.set(i,new Set);var n=this.typeToInterceptorsMap_.get(i);if(n.has(s))return!1;return n.add(s),!0},e.removeInterceptor=function(i,s){var n=this.typeToInterceptorsMap_.get(i);if(n&&n.has(s))return n.delete(s),!0;return!1},e.clearInterceptorsByType=function(i){var s=this.typeToInterceptorsMap_.get(i);if(!s)return!1;return this.typeToInterceptorsMap_.delete(i),this.typeToInterceptorsMap_.set(i,new Set),!0},e.clear=function(){if(!this.typeToInterceptorsMap_.size)return!1;return this.typeToInterceptorsMap_=new Map,!0},e.getForType=function(i){return this.typeToInterceptorsMap_.get(i)||new Set},e.execute=function(i,s){var n=this.getForType(i);for(var l=JR(n),f;!(f=l()).done;){var o=f.value;try{s=o(s)}catch(c){}}return s},t}();Fq.exports=ZR});var Hq=Me((Qet,Oq)=>{var $R=function(){function t(){this.maxAttempts_=1,this.delayFactor_=0.1,this.fuzzFactor_=0.1,this.initialDelay_=1000,this.enabled_=!1}var e=t.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.maxAttempts_=1,this.delayFactor_=0.1,this.fuzzFactor_=0.1,this.initialDelay_=1000,this.enabled_=!1},e.getMaxAttempts=function(){return this.maxAttempts_},e.setMaxAttempts=function(i){this.maxAttempts_=i},e.getDelayFactor=function(){return this.delayFactor_},e.setDelayFactor=function(i){this.delayFactor_=i},e.getFuzzFactor=function(){return this.fuzzFactor_},e.setFuzzFactor=function(i){this.fuzzFactor_=i},e.getInitialDelay=function(){return this.initialDelay_},e.setInitialDelay=function(i){this.initialDelay_=i},e.createRetry=function(i){var s=i===void 0?{}:i,n=s.maxAttempts,l=s.delayFactor,f=s.fuzzFactor,o=s.initialDelay;return new WR({maxAttempts:n||this.maxAttempts_,delayFactor:l||this.delayFactor_,fuzzFactor:f||this.fuzzFactor_,initialDelay:o||this.initialDelay_})},t}(),WR=function(){function t(a){this.maxAttempts_=a.maxAttempts,this.delayFactor_=a.delayFactor,this.fuzzFactor_=a.fuzzFactor,this.currentDelay_=a.initialDelay,this.currentAttempt_=1}var e=t.prototype;return e.moveToNextAttempt=function(){this.currentAttempt_++;var i=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+i},e.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},e.getCurrentDelay=function(){return this.currentDelay_},e.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},e.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},e.getCurrentFuzzedDelay=function(){var i=this.getCurrentMinPossibleDelay(),s=this.getCurrentMaxPossibleDelay();return i+Math.random()*(s-i)},t}();Oq.exports=$R});var Dq=Me((Zet,Mq)=>{var PR=h0(),tN=function(e,a){if(a===void 0)a=!1;return function(i,s,n){if(i){e(i);return}if(s.statusCode>=400&&s.statusCode<=599){var l=n;if(a)if(PR.TextDecoder){var f=eN(s.headers&&s.headers["content-type"]);try{l=new TextDecoder(f).decode(n)}catch(o){}}else l=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:l});return}e(null,n)}};function eN(t){if(t===void 0)t="";return t.toLowerCase().split(";").reduce(function(e,a){var i=a.split("="),s=i[0],n=i[1];if(s.trim()==="charset")return n.trim();return e},"utf-8")}Mq.exports=tN});var zq=Me(($et,y8)=>{var Tq=h0(),aN=yq(),iN=Cq(),Rq=Bq(),sN=Hq();ti.httpHandler=Dq();ti.requestInterceptorsStorage=new Rq;ti.responseInterceptorsStorage=new Rq;ti.retryManager=new sN;var nN=function(e){var a={};if(!e)return a;return e.trim().split(`
4
4
  `).forEach(function(i){var s=i.indexOf(":"),n=i.slice(0,s).trim().toLowerCase(),l=i.slice(s+1).trim();if(typeof a[n]>"u")a[n]=l;else if(Array.isArray(a[n]))a[n].push(l);else a[n]=[a[n],l]}),a};y8.exports=ti;y8.exports.default=ti;ti.XMLHttpRequest=Tq.XMLHttpRequest||oN;ti.XDomainRequest="withCredentials"in new ti.XMLHttpRequest?ti.XMLHttpRequest:Tq.XDomainRequest;lN(["get","put","post","patch","head","delete"],function(t){ti[t==="delete"?"del":t]=function(e,a,i){return a=Nq(e,a,i),a.method=t.toUpperCase(),S8(a)}});function lN(t,e){for(var a=0;a<t.length;a++)e(t[a])}function fN(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function Nq(t,e,a){var i=t;if(iN(e)){if(a=e,typeof t==="string")i={uri:t}}else i=aN({},e,{uri:t});return i.callback=a,i}function ti(t,e,a){return e=Nq(t,e,a),S8(e)}function S8(t){if(typeof t.callback>"u")throw Error("callback argument missing");if(t.requestType&&ti.requestInterceptorsStorage.getIsEnabled()){var e={uri:t.uri||t.url,headers:t.headers||{},body:t.body,metadata:t.metadata||{},retry:t.retry,timeout:t.timeout},a=ti.requestInterceptorsStorage.execute(t.requestType,e);t.uri=a.uri,t.headers=a.headers,t.body=a.body,t.metadata=a.metadata,t.retry=a.retry,t.timeout=a.timeout}var i=!1,s=function(D,T,z){if(!i)i=!0,t.callback(D,T,z)};function n(){if(c.readyState===4&&!ti.responseInterceptorsStorage.getIsEnabled())setTimeout(o,0)}function l(){var M=void 0;if(c.response)M=c.response;else M=c.responseText||rN(c);if(y)try{M=JSON.parse(M)}catch(D){}return M}function f(M){if(clearTimeout(B),clearTimeout(t.retryTimeout),!(M instanceof Error))M=Error(""+(M||"Unknown XMLHttpRequest Error"));if(M.statusCode=0,!m&&ti.retryManager.getIsEnabled()&&t.retry&&t.retry.shouldRetry()){t.retryTimeout=setTimeout(function(){t.retry.moveToNextAttempt(),t.xhr=c,S8(t)},t.retry.getCurrentFuzzedDelay());return}if(t.requestType&&ti.responseInterceptorsStorage.getIsEnabled()){var D={headers:H.headers||{},body:H.body,responseUrl:c.responseURL,responseType:c.responseType},T=ti.responseInterceptorsStorage.execute(t.requestType,D);H.body=T.body,H.headers=T.headers}return s(M,H)}function o(){if(m)return;var M;if(clearTimeout(B),clearTimeout(t.retryTimeout),t.useXDR&&c.status===void 0)M=200;else M=c.status===1223?204:c.status;var D=H,T=null;if(M!==0){if(D={body:l(),statusCode:M,method:w,headers:{},url:p,rawRequest:c},c.getAllResponseHeaders)D.headers=nN(c.getAllResponseHeaders())}else T=Error("Internal XMLHttpRequest Error");if(t.requestType&&ti.responseInterceptorsStorage.getIsEnabled()){var z={headers:D.headers||{},body:D.body,responseUrl:c.responseURL,responseType:c.responseType},E=ti.responseInterceptorsStorage.execute(t.requestType,z);D.body=E.body,D.headers=E.headers}return s(T,D,D.body)}var c=t.xhr||null;if(!c)if(t.cors||t.useXDR)c=new ti.XDomainRequest;else c=new ti.XMLHttpRequest;var u,m,p=c.url=t.uri||t.url,w=c.method=t.method||"GET",d=t.body||t.data,v=c.headers=t.headers||{},k=!!t.sync,y=!1,B,H={body:void 0,headers:{},statusCode:0,method:w,url:p,rawRequest:c};if("json"in t&&t.json!==!1){if(y=!0,v.accept||v.Accept||(v.Accept="application/json"),w!=="GET"&&w!=="HEAD")v["content-type"]||v["Content-Type"]||(v["Content-Type"]="application/json"),d=JSON.stringify(t.json===!0?d:t.json)}if(c.onreadystatechange=n,c.onload=o,c.onerror=f,c.onprogress=function(){},c.onabort=function(){m=!0,clearTimeout(t.retryTimeout)},c.ontimeout=f,c.open(w,p,!k,t.username,t.password),!k)c.withCredentials=!!t.withCredentials;if(!k&&t.timeout>0)B=setTimeout(function(){if(m)return;m=!0,c.abort("timeout");var M=Error("XMLHttpRequest timeout");M.code="ETIMEDOUT",f(M)},t.timeout);if(c.setRequestHeader){for(u in v)if(v.hasOwnProperty(u))c.setRequestHeader(u,v[u])}else if(t.headers&&!fN(t.headers))throw Error("Headers cannot be set on an XDomainRequest object");if("responseType"in t)c.responseType=t.responseType;if("beforeSend"in t&&typeof t.beforeSend==="function")t.beforeSend(c);return c.send(d||null),c}function rN(t){try{if(t.responseType==="document")return t.responseXML;var e=t.responseXML&&t.responseXML.documentElement.nodeName==="parsererror";if(t.responseType===""&&!e)return t.responseXML}catch(a){}return null}function oN(){}});var Kq=Me((Wet,Xq)=>{var Eq=A8(),C8=Object.create||function(){function t(){}return function(e){if(arguments.length!==1)throw Error("Object.create shim only accepts one parameter.");return t.prototype=e,new t}}();function Ps(t,e){this.name="ParsingError",this.code=t.code,this.message=e||t.message}Ps.prototype=C8(Error.prototype);Ps.prototype.constructor=Ps;Ps.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function _8(t){function e(i,s,n,l){return(i|0)*3600+(s|0)*60+(n|0)+(l|0)/1000}var a=t.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);if(!a)return null;if(a[3])return e(a[1],a[2],a[3].replace(":",""),a[4]);else if(a[1]>59)return e(a[1],a[2],0,a[4]);else return e(0,a[1],a[2],a[4])}function e2(){this.values=C8(null)}e2.prototype={set:function(t,e){if(!this.get(t)&&e!=="")this.values[t]=e},get:function(t,e,a){if(a)return this.has(t)?this.values[t]:e[a];return this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,a){for(var i=0;i<a.length;++i)if(e===a[i]){this.set(t,e);break}},integer:function(t,e){if(/^-?\d+$/.test(e))this.set(t,parseInt(e,10))},percent:function(t,e){var a;if(a=e.match(/^([\d]{1,3})(\.[\d]*)?%$/)){if(e=parseFloat(e),e>=0&&e<=100)return this.set(t,e),!0}return!1}};function t2(t,e,a,i){var s=i?t.split(i):[t];for(var n in s){if(typeof s[n]!=="string")continue;var l=s[n].split(a);if(l.length!==2)continue;var f=l[0].trim(),o=l[1].trim();e(f,o)}}function hN(t,e,a){var i=t;function s(){var f=_8(t);if(f===null)throw new Ps(Ps.Errors.BadTimeStamp,"Malformed timestamp: "+i);return t=t.replace(/^[^\sa-zA-Z-]+/,""),f}function n(f,o){var c=new e2;t2(f,function(u,m){switch(u){case"region":for(var p=a.length-1;p>=0;p--)if(a[p].id===m){c.set(u,a[p].region);break}break;case"vertical":c.alt(u,m,["rl","lr"]);break;case"line":var w=m.split(","),d=w[0];if(c.integer(u,d),c.percent(u,d)&&c.set("snapToLines",!1),c.alt(u,d,["auto"]),w.length===2)c.alt("lineAlign",w[1],["start","center","end"]);break;case"position":if(w=m.split(","),c.percent(u,w[0]),w.length===2)c.alt("positionAlign",w[1],["start","center","end"]);break;case"size":c.percent(u,m);break;case"align":c.alt(u,m,["start","center","end","left","right"]);break}},/:/,/\s/),o.region=c.get("region",null),o.vertical=c.get("vertical","");try{o.line=c.get("line","auto")}catch(u){}o.lineAlign=c.get("lineAlign","start"),o.snapToLines=c.get("snapToLines",!0),o.size=c.get("size",100);try{o.align=c.get("align","center")}catch(u){o.align=c.get("align","middle")}try{o.position=c.get("position","auto")}catch(u){o.position=c.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},o.align)}o.positionAlign=c.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},o.align)}function l(){t=t.replace(/^\s+/,"")}if(l(),e.startTime=s(),l(),t.substr(0,3)!=="-->")throw new Ps(Ps.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+i);t=t.substr(3),l(),e.endTime=s(),l(),n(t,e)}var k8=Eq.createElement&&Eq.createElement("textarea"),cN={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},xq={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},uN={v:"title",lang:"lang"},Uq={rt:"ruby"};function Gq(t,e){function a(){if(!e)return null;function d(k){return e=e.substr(k.length),k}var v=e.match(/^([^<]*)(<[^>]*>?)?/);return d(v[1]?v[1]:v[2])}function i(d){return k8.innerHTML=d,d=k8.textContent,k8.textContent="",d}function s(d,v){return!Uq[v.localName]||Uq[v.localName]===d.localName}function n(d,v){var k=cN[d];if(!k)return null;var y=t.document.createElement(k),B=uN[d];if(B&&v)y[B]=v.trim();return y}var l=t.document.createElement("div"),f=l,o,c=[];while((o=a())!==null){if(o[0]==="<"){if(o[1]==="/"){if(c.length&&c[c.length-1]===o.substr(2).replace(">",""))c.pop(),f=f.parentNode;continue}var u=_8(o.substr(1,o.length-2)),m;if(u){m=t.document.createProcessingInstruction("timestamp",u),f.appendChild(m);continue}var p=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!p)continue;if(m=n(p[1],p[3]),!m)continue;if(!s(f,m))continue;if(p[2]){var w=p[2].split(".");w.forEach(function(d){var v=/^bg_/.test(d),k=v?d.slice(3):d;if(xq.hasOwnProperty(k)){var y=v?"background-color":"color",B=xq[k];m.style[y]=B}}),m.className=w.join(" ")}c.push(p[1]),f.appendChild(m),f=m;continue}f.appendChild(t.document.createTextNode(i(o)))}return l}var Iq=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function mN(t){for(var e=0;e<Iq.length;e++){var a=Iq[e];if(t>=a[0]&&t<=a[1])return!0}return!1}function gN(t){var e=[],a="",i;if(!t||!t.childNodes)return"ltr";function s(f,o){for(var c=o.childNodes.length-1;c>=0;c--)f.push(o.childNodes[c])}function n(f){if(!f||!f.length)return null;var o=f.pop(),c=o.textContent||o.innerText;if(c){var u=c.match(/^.*(\n|\r)/);if(u)return f.length=0,u[0];return c}if(o.tagName==="ruby")return n(f);if(o.childNodes)return s(f,o),n(f)}s(e,t);while(a=n(e))for(var l=0;l<a.length;l++)if(i=a.charCodeAt(l),mN(i))return"rtl";return"ltr"}function bN(t){if(typeof t.line==="number"&&(t.snapToLines||t.line>=0&&t.line<=100))return t.line;if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement)return-1;var e=t.track,a=e.textTrackList,i=0;for(var s=0;s<a.length&&a[s]!==e;s++)if(a[s].mode==="showing")i++;return++i*-1}function D5(){}D5.prototype.applyStyles=function(t,e){e=e||this.div;for(var a in t)if(t.hasOwnProperty(a))e.style[a]=t[a]};D5.prototype.formatStyle=function(t,e){return t===0?0:t+e};function M5(t,e,a){D5.call(this),this.cue=e,this.cueDiv=Gq(t,e.text);var i={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(i,this.cueDiv),this.div=t.document.createElement("div"),i={direction:gN(this.cueDiv),writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:e.align==="middle"?"center":e.align,font:a.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(i),this.div.appendChild(this.cueDiv);var s=0;switch(e.positionAlign){case"start":case"line-left":s=e.position;break;case"center":s=e.position-e.size/2;break;case"end":case"line-right":s=e.position-e.size;break}if(e.vertical==="")this.applyStyles({left:this.formatStyle(s,"%"),width:this.formatStyle(e.size,"%")});else this.applyStyles({top:this.formatStyle(s,"%"),height:this.formatStyle(e.size,"%")});this.move=function(n){this.applyStyles({top:this.formatStyle(n.top,"px"),bottom:this.formatStyle(n.bottom,"px"),left:this.formatStyle(n.left,"px"),right:this.formatStyle(n.right,"px"),height:this.formatStyle(n.height,"px"),width:this.formatStyle(n.width,"px")})}}M5.prototype=C8(D5.prototype);M5.prototype.constructor=M5;function hs(t){var e,a,i,s;if(t.div){a=t.div.offsetHeight,i=t.div.offsetWidth,s=t.div.offsetTop;var n=(n=t.div.childNodes)&&(n=n[0])&&n.getClientRects&&n.getClientRects();t=t.div.getBoundingClientRect(),e=n?Math.max(n[0]&&n[0].height||0,t.height/n.length):0}this.left=t.left,this.right=t.right,this.top=t.top||s,this.height=t.height||a,this.bottom=t.bottom||s+(t.height||a),this.width=t.width||i,this.lineHeight=e!==void 0?e:t.lineHeight}hs.prototype.move=function(t,e){switch(e=e!==void 0?e:this.lineHeight,t){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e;break}};hs.prototype.overlaps=function(t){return this.left<t.right&&this.right>t.left&&this.top<t.bottom&&this.bottom>t.top};hs.prototype.overlapsAny=function(t){for(var e=0;e<t.length;e++)if(this.overlaps(t[e]))return!0;return!1};hs.prototype.within=function(t){return this.top>=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right};hs.prototype.overlapsOppositeAxis=function(t,e){switch(e){case"+x":return this.left<t.left;case"-x":return this.right>t.right;case"+y":return this.top<t.top;case"-y":return this.bottom>t.bottom}};hs.prototype.intersectPercentage=function(t){var e=Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left)),a=Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top)),i=e*a;return i/(this.height*this.width)};hs.prototype.toCSSCompatValues=function(t){return{top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}};hs.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,a=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,i=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t;var s={left:t.left,right:t.right,top:t.top||i,height:t.height||e,bottom:t.bottom||i+(t.height||e),width:t.width||a};return s};function pN(t,e,a,i){function s(k,y){var B,H=new hs(k),M=1;for(var D=0;D<y.length;D++){while(k.overlapsOppositeAxis(a,y[D])||k.within(a)&&k.overlapsAny(i))k.move(y[D]);if(k.within(a))return k;var T=k.intersectPercentage(a);if(M>T)B=new hs(k),M=T;k=new hs(H)}return B||H}var n=new hs(e),l=e.cue,f=bN(l),o=[];if(l.snapToLines){var c;switch(l.vertical){case"":o=["+y","-y"],c="height";break;case"rl":o=["+x","-x"],c="width";break;case"lr":o=["-x","+x"],c="width";break}var u=n.lineHeight,m=u*Math.round(f),p=a[c]+u,w=o[0];if(Math.abs(m)>p)m=m<0?-1:1,m*=Math.ceil(p/u)*u;if(f<0)m+=l.vertical===""?a.height:a.width,o=o.reverse();n.move(w,m)}else{var d=n.lineHeight/a.height*100;switch(l.lineAlign){case"center":f-=d/2;break;case"end":f-=d;break}switch(l.vertical){case"":e.applyStyles({top:e.formatStyle(f,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(f,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(f,"%")});break}o=["+y","-x","+x","-y"],n=new hs(e)}var v=s(n,o);e.move(v.toCSSCompatValues(a))}function vo(){}vo.StringDecoder=function(){return{decode:function(t){if(!t)return"";if(typeof t!=="string")throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}};vo.convertCueToDOMTree=function(t,e){if(!t||!e)return null;return Gq(t,e)};var wN=0.05,jN="sans-serif",dN="1.5%";vo.processCues=function(t,e,a){if(!t||!e||!a)return null;while(a.firstChild)a.removeChild(a.firstChild);var i=t.document.createElement("div");i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",i.style.margin=dN,a.appendChild(i);function s(u){for(var m=0;m<u.length;m++)if(u[m].hasBeenReset||!u[m].displayState)return!0;return!1}if(!s(e)){for(var n=0;n<e.length;n++)i.appendChild(e[n].displayState);return}var l=[],f=hs.getSimpleBoxPosition(i),o=Math.round(f.height*wN*100)/100,c={font:o+"px "+jN};(function(){var u,m;for(var p=0;p<e.length;p++)m=e[p],u=new M5(t,m,c),i.appendChild(u.div),pN(t,u,f,l),m.displayState=u.div,l.push(hs.getSimpleBoxPosition(u))})()};vo.Parser=function(t,e,a){if(!a)a=e,e={};if(!e)e={};this.window=t,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=a||new TextDecoder("utf8"),this.regionList=[]};vo.Parser.prototype={reportOrThrowError:function(t){if(t instanceof Ps)this.onparsingerror&&this.onparsingerror(t);else throw t},parse:function(t){var e=this;if(t)e.buffer+=e.decoder.decode(t,{stream:!0});function a(){var u=e.buffer,m=0;while(m<u.length&&u[m]!=="\r"&&u[m]!==`
@@ -1 +1 @@
1
- import{j as V}from"./chunk-2g12s6mc.js";import"./chunk-f7sbkfmk.js";import"./chunk-fepymbka.js";import"./chunk-xyjw8w3r.js";import"./chunk-ccw7mjgq.js";import"./chunk-pq18zenh.js";import"./chunk-wsyg4rwg.js";import"./chunk-7e06b2zb.js";import"./chunk-srn8t0v7.js";import"./chunk-kfhtk3eh.js";import"./chunk-kr06nrbx.js";import"./chunk-b8js74jk.js";import"./chunk-0xbf8bcg.js";import{wf as U}from"./chunk-5r8858hx.js";import"./chunk-88fg1sw7.js";import{zf as N}from"./chunk-ry33f2qk.js";import"./chunk-77r8w95d.js";import"./chunk-t3t6021k.js";import"./chunk-54tr7y2x.js";import"./chunk-1xpec5r8.js";import"./chunk-0rxhc7ka.js";import"./chunk-fa2g2wge.js";import"./chunk-fz88kkk1.js";import"./chunk-dghtwyq1.js";import{bh as K}from"./chunk-gswbc6y9.js";import{Gh as H,Sh as J,mh as Z,oh as q,th as D,uh as G}from"./chunk-nyhqy6q2.js";import{Vk as Y}from"./chunk-0qkj838r.js";var W=Y(Z(),1);function _(){let{projectId:h}=$.useParams(),{teamId:v,ensureTeamIdForProject:w}=K();W.useEffect(()=>{w(h)},[h,w]);let{data:A}=G(U(h)),b=A?.rootFolder,{data:X}=D({queryKey:["folders",b],queryFn:async()=>{let B=await J.api.folders[":folderId"].$get({param:{folderId:b}});if(!B.ok)throw Error("failed to fetch folder");return await B.json()},enabled:!!b});if(!v||!b||!X)return q(N,{});return q(V,{teamId:v,projectId:h,projectName:A.name??"",assetId:b,rootFolderId:b})}var $=H("/projects/$projectId/")({component:_});export{$ as Route};
1
+ import{j as V}from"./chunk-jqh8kavv.js";import"./chunk-8dqq1fk0.js";import"./chunk-mnfqdxms.js";import"./chunk-b73ktdmd.js";import"./chunk-wckjyvtb.js";import"./chunk-crt1e1w1.js";import"./chunk-wsyg4rwg.js";import"./chunk-nhsqp8jc.js";import"./chunk-srn8t0v7.js";import"./chunk-kfhtk3eh.js";import"./chunk-kr06nrbx.js";import"./chunk-b8js74jk.js";import"./chunk-0xbf8bcg.js";import{wf as U}from"./chunk-js9yf457.js";import"./chunk-88fg1sw7.js";import{zf as N}from"./chunk-3qks722n.js";import"./chunk-77r8w95d.js";import"./chunk-t3t6021k.js";import"./chunk-nnkkem25.js";import"./chunk-1xpec5r8.js";import"./chunk-0rxhc7ka.js";import"./chunk-3n1rezd0.js";import"./chunk-fz88kkk1.js";import"./chunk-dghtwyq1.js";import{bh as K}from"./chunk-gswbc6y9.js";import{Gh as H,Sh as J,mh as Z,oh as q,th as D,uh as G}from"./chunk-nyhqy6q2.js";import{Vk as Y}from"./chunk-0qkj838r.js";var W=Y(Z(),1);function _(){let{projectId:h}=$.useParams(),{teamId:v,ensureTeamIdForProject:w}=K();W.useEffect(()=>{w(h)},[h,w]);let{data:A}=G(U(h)),b=A?.rootFolder,{data:X}=D({queryKey:["folders",b],queryFn:async()=>{let B=await J.api.folders[":folderId"].$get({param:{folderId:b}});if(!B.ok)throw Error("failed to fetch folder");return await B.json()},enabled:!!b});if(!v||!b||!X)return q(N,{});return q(V,{teamId:v,projectId:h,projectName:A.name??"",assetId:b,rootFolderId:b})}var $=H("/projects/$projectId/")({component:_});export{$ as Route};
@@ -0,0 +1 @@
1
+ import{g as q}from"./chunk-6xg65n5y.js";import"./chunk-6zascpcz.js";import"./chunk-b73ktdmd.js";import"./chunk-wckjyvtb.js";import"./chunk-crt1e1w1.js";import"./chunk-wsyg4rwg.js";import"./chunk-nhsqp8jc.js";import"./chunk-srn8t0v7.js";import"./chunk-kfhtk3eh.js";import"./chunk-kr06nrbx.js";import"./chunk-b8js74jk.js";import"./chunk-0xbf8bcg.js";import"./chunk-dm2w12rc.js";import"./chunk-15sefy5t.js";import"./chunk-77r8w95d.js";import"./chunk-t3t6021k.js";import"./chunk-nnkkem25.js";import"./chunk-1xpec5r8.js";import"./chunk-0rxhc7ka.js";import"./chunk-3n1rezd0.js";import"./chunk-fz88kkk1.js";import"./chunk-dghtwyq1.js";import"./chunk-gswbc6y9.js";import{Gh as k,oh as f}from"./chunk-nyhqy6q2.js";import"./chunk-0qkj838r.js";function w(){let{shareId:v}=A.useParams();return f(q,{shareId:v})}var A=k("/share/$shareId/")({component:w});export{A as Route};