@shumai-one/shumai 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{chunk-d3kpqay2.js → chunk-0bbhm7dp.js} +2 -2
- package/bin/{chunk-9e99n265.js → chunk-17bewdr0.js} +2 -2
- package/bin/{chunk-41m51y08.js → chunk-1fqpgz02.js} +1 -1
- package/bin/chunk-21hvrvzj.js +2 -0
- package/bin/chunk-23mj9p82.js +1 -0
- package/bin/chunk-24mag65w.js +1 -0
- package/bin/chunk-29203j0e.js +7 -0
- package/bin/{chunk-gpmaaca1.js → chunk-2jfbxefd.js} +2 -2
- package/bin/chunk-2jv9re91.js +2 -0
- package/bin/chunk-2rmceamt.js +1 -0
- package/bin/{chunk-bd6x5ns9.js → chunk-3mprq5kb.js} +2 -2
- package/bin/{chunk-wtzkfwmx.js → chunk-3w9vybrh.js} +2 -2
- package/bin/{chunk-gh4w2bdg.js → chunk-3ydjrkbd.js} +1 -1
- package/bin/{chunk-ts9f4zqh.js → chunk-43mhpb0k.js} +2 -2
- package/bin/{chunk-wkth5xwr.js → chunk-4b8ms2ct.js} +2 -2
- package/bin/{chunk-p8enen2a.js → chunk-4rz2105a.js} +1 -1
- package/bin/{chunk-g097058z.js → chunk-4sdrjye2.js} +2 -2
- package/bin/{chunk-yfkcv10v.js → chunk-52qe6z8w.js} +1 -1
- package/bin/{chunk-vg6mkdj1.js → chunk-54hmgj96.js} +2 -2
- package/bin/{chunk-2fc5hk8r.js → chunk-5r55htaw.js} +1 -1
- package/bin/{chunk-am1m29pv.js → chunk-5yxngq5n.js} +1 -1
- package/bin/{chunk-9vgjhemh.js → chunk-6j6dejtd.js} +1 -1
- package/bin/chunk-6kv3jyfc.js +2 -0
- package/bin/{chunk-xcbb21j9.js → chunk-6vn44e4d.js} +2 -2
- package/bin/{chunk-57kgmgfs.js → chunk-7jkvjm4x.js} +2 -2
- package/bin/{chunk-5cm4vge8.js → chunk-7mkk8ahk.js} +2 -2
- package/bin/{chunk-mm810jv7.js → chunk-7w2tx08e.js} +2 -2
- package/bin/{chunk-m6sssvg3.js → chunk-7zdmpbt6.js} +1 -1
- package/bin/{chunk-cdqvg03f.js → chunk-8fsrs7mh.js} +1 -1
- package/bin/{chunk-mggfc9ya.js → chunk-8hq6sn31.js} +2 -2
- package/bin/{chunk-m268vcdm.js → chunk-8mzg29m4.js} +2 -2
- package/bin/chunk-8na8a41a.js +2 -0
- package/bin/{chunk-7x7jtkh8.js → chunk-8skgcmxm.js} +1 -1
- package/bin/chunk-8ttfy5yy.js +1 -0
- package/bin/{chunk-3gcnj1eq.js → chunk-8vc1m0kw.js} +2 -2
- package/bin/{chunk-7anqxx1z.js → chunk-8vvr1ez5.js} +1 -1
- package/bin/chunk-95qc4bkh.js +2 -0
- package/bin/{chunk-3g9g2c7h.js → chunk-97y52q3a.js} +3 -3
- package/bin/{chunk-q8me9zev.js → chunk-9nd5m7hy.js} +1 -1
- package/bin/{chunk-4g7h9qhr.js → chunk-afzc5eae.js} +1 -1
- package/bin/{chunk-1rsp4hc5.js → chunk-ampyjbj4.js} +1 -1
- package/bin/{chunk-749c09cw.js → chunk-arxd4qb9.js} +1 -1
- package/bin/{chunk-x0r8dcq0.js → chunk-avvzqqk2.js} +2 -2
- package/bin/{chunk-525eypdk.js → chunk-b93djch5.js} +1 -1
- package/bin/{chunk-va6hxm7n.js → chunk-bg10gwm1.js} +2 -2
- package/bin/{chunk-h73653yp.js → chunk-bkcf4hw5.js} +1 -1
- package/bin/{chunk-gaemak59.js → chunk-bv642x5z.js} +2 -2
- package/bin/{chunk-rt0pvhdf.js → chunk-c2a5x1pk.js} +1 -1
- package/bin/{chunk-g224r7mc.js → chunk-c5esphve.js} +2 -2
- package/bin/chunk-cbjfw47x.js +62 -0
- package/bin/{chunk-9g6vy76b.js → chunk-d1zpcags.js} +2 -2
- package/bin/{chunk-qshm5vcn.js → chunk-d4zx3r12.js} +1 -1
- package/bin/{chunk-ey7vty63.js → chunk-f70xdh07.js} +2 -2
- package/bin/{chunk-tc7q988r.js → chunk-f7fevgv2.js} +2 -2
- package/bin/{chunk-p1bcbtmg.js → chunk-fcvtv783.js} +1 -1
- package/bin/chunk-fgda7ncw.js +2 -0
- package/bin/{chunk-vf3bg920.js → chunk-fnkrzqrn.js} +2 -2
- package/bin/{chunk-xgb533n0.js → chunk-fq6emqwq.js} +3 -3
- package/bin/{chunk-5vwkfxy7.js → chunk-fw5k0xrc.js} +2 -2
- package/bin/{chunk-3823qzr0.js → chunk-g0jy85re.js} +2 -2
- package/bin/{chunk-6jgq154r.js → chunk-g5mpp3nc.js} +1 -1
- package/bin/{chunk-t15a1vp6.js → chunk-gd1x3rgn.js} +1 -1
- package/bin/chunk-gwxzjc0m.js +1 -0
- package/bin/chunk-h2tztyxs.js +1 -0
- package/bin/{chunk-v0yhkcj5.js → chunk-hbrndqpj.js} +2 -2
- package/bin/{chunk-0dcv6kpk.js → chunk-hk7a2mgn.js} +2 -2
- package/bin/chunk-htrzgs2a.css +1 -0
- package/bin/{chunk-2475z7vk.js → chunk-jf5ytqxd.js} +1 -1
- package/bin/{chunk-r5jmnsqj.js → chunk-jkapr5we.js} +1 -1
- package/bin/chunk-jqyprvqd.js +1 -0
- package/bin/chunk-jyeyp8p3.js +1 -0
- package/bin/{chunk-xsw3pb5p.js → chunk-kn4tnhbw.js} +2 -2
- package/bin/{chunk-jkh04dka.js → chunk-ks8deg42.js} +1 -1
- package/bin/chunk-kwr4m6vh.js +1 -0
- package/bin/chunk-n62kyrh1.js +1 -0
- package/bin/{chunk-9sdhdhv4.js → chunk-n67rfv86.js} +2 -2
- package/bin/{chunk-8a75zqbz.js → chunk-nh4tzzn8.js} +2 -2
- package/bin/{chunk-zgsy3k3h.js → chunk-ntxwp6aa.js} +1 -1
- package/bin/{chunk-7pjes19z.js → chunk-p33nq4pp.js} +2 -2
- package/bin/{chunk-h4a3ms2b.js → chunk-p3k6nzhe.js} +2 -2
- package/bin/{chunk-67rr836p.js → chunk-q0znwxfe.js} +1 -1
- package/bin/{chunk-gpeyctxd.js → chunk-qm9w9fcv.js} +2 -2
- package/bin/chunk-qxwfhv63.js +2 -0
- package/bin/{chunk-9a7a1p1j.js → chunk-r9s1zs4g.js} +2 -2
- package/bin/{chunk-yj6tmjsc.js → chunk-rek85wwv.js} +2 -2
- package/bin/{chunk-wpntb95k.js → chunk-s0g0bc6t.js} +2 -2
- package/bin/{chunk-pdajhyqm.js → chunk-s0k2r6ym.js} +2 -2
- package/bin/{chunk-fwqpq2sy.js → chunk-sx1neqgr.js} +1 -1
- package/bin/{chunk-2jvqhps9.js → chunk-t58kqafx.js} +2 -2
- package/bin/{chunk-qx2mzv89.js → chunk-th07gms7.js} +1 -1
- package/bin/chunk-v0cdg3n6.js +307 -0
- package/bin/{chunk-tzmzqmcg.js → chunk-v4re49f5.js} +1 -1
- package/bin/{chunk-c7rj0f5r.js → chunk-vpq224tm.js} +1 -1
- package/bin/{chunk-mhwp74hh.js → chunk-vvr179pz.js} +1 -1
- package/bin/{chunk-p86w1eaw.js → chunk-vzb2b89p.js} +1 -1
- package/bin/{chunk-bw6wyw7k.js → chunk-w8vk30ze.js} +2 -2
- package/bin/{chunk-0a0sdyta.js → chunk-weean2ja.js} +1 -1
- package/bin/{chunk-pqxh0cg7.js → chunk-wg5tjyj9.js} +2 -2
- package/bin/{chunk-xn9cpax1.js → chunk-wknqst3v.js} +3 -3
- package/bin/chunk-x217skr3.js +2 -0
- package/bin/{chunk-bn4ewsy8.js → chunk-x2z5zz01.js} +1 -1
- package/bin/{chunk-hz6s7by4.js → chunk-xnzyt0kq.js} +1 -1
- package/bin/{chunk-9zvteyz0.js → chunk-xqkwpr7s.js} +2 -2
- package/bin/{chunk-yedr4r8a.js → chunk-xt9n0y9a.js} +1 -1
- package/bin/{chunk-7436fyrg.js → chunk-y6aa5ee0.js} +1 -1
- package/bin/{chunk-v75fanse.js → chunk-zj1rz1s9.js} +2 -2
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +503 -408
- package/package.json +7 -7
- package/prisma/migrations/20260806082136_add_sharelink_watermark/migration.sql +69 -0
- package/prisma/migrations/20260806085643_add_watermark_file_status/migration.sql +7 -0
- package/prisma/migrations/20260807140837_clean_media_remove_raw_transcodes_and_original_download_url/migration.sql +86 -0
- package/prisma/migrations/20260808014542_add_sharelink_allow_download/migration.sql +2 -0
- package/prisma/schema.prisma +68 -0
- package/bin/chunk-1cjgpspz.js +0 -2
- package/bin/chunk-1pgtq4rc.js +0 -2
- package/bin/chunk-25qj10ny.js +0 -1
- package/bin/chunk-4v5ykazp.js +0 -1
- package/bin/chunk-5x3vzer8.js +0 -1
- package/bin/chunk-804ndet8.js +0 -2
- package/bin/chunk-a8daqpfh.js +0 -7
- package/bin/chunk-c0c88nje.js +0 -307
- package/bin/chunk-d6v81kjj.js +0 -1
- package/bin/chunk-dfcrtdk2.js +0 -1
- package/bin/chunk-eczsk2xd.js +0 -62
- package/bin/chunk-g5e93f59.js +0 -2
- package/bin/chunk-g5xkj9p3.js +0 -2
- package/bin/chunk-hp139z0j.js +0 -2
- package/bin/chunk-j4y8c864.js +0 -1
- package/bin/chunk-pbb1tdwt.js +0 -1
- package/bin/chunk-pbfkw90e.js +0 -1
- package/bin/chunk-s10v4b01.css +0 -1
- package/bin/chunk-s1b5kf34.js +0 -2
- package/bin/chunk-v0xbr5e6.js +0 -2
- package/bin/chunk-yfjn4qn2.js +0 -1
- package/bin/chunk-z9560a6e.js +0 -1
package/bin/chunk-s1b5kf34.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h as s,j as t,k as b}from"./chunk-c0c88nje.js";import{ig as YG,kg as _G,lg as $G,mg as QG}from"./chunk-m268vcdm.js";import{Ag as H,Bg as O,Bj as r,Fg as KG,Ih as GG,Jh as HG,Zh as JG,_i as WG,ch as c,nh as A,qi as i,tj as C,vi as a,yg as SG,zg as d}from"./chunk-eczsk2xd.js";import{Fk as AG}from"./chunk-t15a1vp6.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
|
-
export{vG as b,NH as c};
|
package/bin/chunk-v0xbr5e6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$ as j,ba as F}from"./chunk-5vwkfxy7.js";import{sf as p}from"./chunk-vf3bg920.js";import{Cg as q,Hg as P,ah as _,ch as f,yg as s}from"./chunk-eczsk2xd.js";import{Fk as l}from"./chunk-t15a1vp6.js";var i={x:0.5,y:0.5};class D extends F{apply({activatorEvent:Z,shape:L,transform:E}){if(!L||!(Z instanceof PointerEvent))return E;let M=this.options?.anchor??i,{boundingRectangle:G}=L.initial,Q=G.left+G.width*M.x,J=G.top+G.height*M.y;return{x:E.x+Z.clientX-Q,y:E.y+Z.clientY-J}}static configure=j(D)}var C=l(s(),1);function YO({teamId:Z,projectId:L,assetId:E,folders:M,files:G,selectedIds:Q,onClearSelection:J}){let T=q(),[N,A]=C.useState(void 0),y=(Y,R)=>{let h=["search",Z,E,Y?"folder":"file"],U=T.getQueriesData({queryKey:h}),H=(X)=>{if(typeof X!=="object"||X===null)return!1;let O=X;return"field"in O&&"order"in O&&typeof O.field==="string"&&(O.order==="asc"||O.order==="desc")};for(let[X,O]of U){if(!O||!Array.isArray(O.pages))continue;let z=X.find(H),k=O.pages.flatMap((w)=>w.data??[]),K=k.findIndex((w)=>w.id===R.id);if(K===-1)continue;if(k[K]={...k[K],...R},z?.field==="custom"){let w=z.order==="desc";k.sort((B,x)=>{let $=B.sortIndex??"",b=x.sortIndex??"";if($===b)return 0;if(w)return $<b?1:-1;else return $<b?-1:1})}let V=0,o=O.pages.map((w)=>{let B=w.data?w.data.length:0,x=k.slice(V,V+B);return V+=B,{...w,data:x}});T.setQueryData(X,{...O,pages:o})}},v=f.api.projects[":projectId"].reparent.$post,{mutate:c}=P({mutationFn:async(Y)=>{if(!(await v(Y)).ok)throw Error("Failed to move assets");return null}}),n=f.api.folders[":folderId"].order.$patch,{mutate:u}=P({mutationFn:async(Y)=>{let R=await n(Y);if(!R.ok)throw Error("Failed to reorder folder");return await R.json()}}),m=f.api.files[":fileId"].order.$patch,{mutate:S}=P({mutationFn:async(Y)=>{let R=await m(Y);if(!R.ok)throw Error("Failed to reorder file");return await R.json()}}),I=f.api.shares[":shareId"].assets.$post,{mutate:g}=P({mutationFn:async(Y)=>{let R=await I(Y);if(!R.ok)throw Error("Failed to add asset to share");return await R.json()}});return{dragState:N,handleDragStart:(Y)=>{let R=Y.operation.source;if(!R)return;let W=R.id.split(":").pop(),h=R.data;if(!h)return;let U,H;if(Q.has(W))U=new Set(Q),H=[...M,...G].filter((O)=>Q.has(O.id));else U=new Set([W]),H=[h.item];let X=H.some((O)=>O.type==="folder");A({isActive:!0,draggedIds:U,hasFolders:X,itemCount:U.size})},handleDragEnd:(Y)=>{let{target:R}=Y.operation;if(R&&N){let W=R.id.split(":").pop(),h=R.data;if(h?.type==="chatbot-sidebar"){let X=[...M,...G].filter((O)=>N.draggedIds.has(O.id)).map((O)=>({id:O.id,name:O.name||"Unnamed",type:O.type}));p.getState().addAssets(X),J(),A(void 0);return}if(h?.type==="share-link"){let H=W,X=Array.from(N.draggedIds);g({param:{shareId:H},json:{assetIds:X}},{onSuccess:(O)=>{if(O.addedCount===0)_.info("Assets already exists in share");else _.success(`Added ${O.addedCount} item(s) to share link`);T.invalidateQueries({queryKey:["shares",L]}),J()},onError:(O)=>{_.error(`Failed to add to share: ${O.message}`)}}),A(void 0);return}let U=!1;if(h&&!N.draggedIds.has(W)){if(h.type==="folder"||h.type==="reorder")U=!0;else if(h.type==="file"){if(!N.hasFolders&&N.itemCount===1)U=!0}}if(h?.type==="reorder"){let{position:H,item:X}=h,O=N.hasFolders,z=Array.from(N.draggedIds)[0];if(O)u({param:{folderId:z},json:H==="before"?{beforeIndex:X.sortIndex??void 0}:{afterIndex:X.sortIndex??void 0}},{onSuccess:(k)=>{_.success("Folder reordered"),y(!0,k),J()},onError:(k)=>{_.error(`Failed to reorder: ${k.message}`)}});else S({param:{fileId:z},json:H==="before"?{beforeIndex:X.sortIndex??void 0}:{afterIndex:X.sortIndex??void 0}},{onSuccess:(k)=>{_.success("File reordered"),y(!1,k),J()},onError:(k)=>{_.error(`Failed to reorder: ${k.message}`)}})}else if(U)c({param:{projectId:L},json:{assetIds:Array.from(N.draggedIds),newParentId:W}},{onSuccess:()=>{_.success("Assets moved successfully"),T.invalidateQueries({queryKey:["search",Z,E]}),T.invalidateQueries({queryKey:["folders"]}),J()},onError:()=>{_.error("Failed to move assets")}})}A(void 0)}}}
|
|
2
|
-
export{D as f,YO as g};
|
package/bin/chunk-yfjn4qn2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as q}from"./chunk-g5e93f59.js";import"./chunk-s1b5kf34.js";import"./chunk-c0c88nje.js";import"./chunk-fwqpq2sy.js";import"./chunk-a8daqpfh.js";import"./chunk-804ndet8.js";import"./chunk-9g6vy76b.js";import"./chunk-wpntb95k.js";import"./chunk-pdajhyqm.js";import"./chunk-5vwkfxy7.js";import"./chunk-3gcnj1eq.js";import"./chunk-8a75zqbz.js";import"./chunk-1cjgpspz.js";import"./chunk-x0r8dcq0.js";import"./chunk-p8enen2a.js";import"./chunk-tc7q988r.js";import"./chunk-yj6tmjsc.js";import"./chunk-1pgtq4rc.js";import"./chunk-mggfc9ya.js";import"./chunk-v75fanse.js";import"./chunk-vf3bg920.js";import"./chunk-xcbb21j9.js";import"./chunk-ey7vty63.js";import"./chunk-gpeyctxd.js";import"./chunk-9sdhdhv4.js";import"./chunk-vg6mkdj1.js";import"./chunk-57kgmgfs.js";import"./chunk-9a7a1p1j.js";import"./chunk-wtzkfwmx.js";import"./chunk-m268vcdm.js";import{Ag as f,Sg as k}from"./chunk-eczsk2xd.js";import"./chunk-t15a1vp6.js";function w(){let{shareId:v}=A.useParams();return f(q,{shareId:v})}var A=k("/share/$shareId/")({component:w});export{A as Route};
|
package/bin/chunk-z9560a6e.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ia as lz}from"./chunk-3gcnj1eq.js";import"./chunk-p8enen2a.js";import{db as a}from"./chunk-tc7q988r.js";import{eb as yz,fb as Dz,gb as bz,hb as Cz,ib as fz,jb as Iz,kb as gz,lb as uz}from"./chunk-yj6tmjsc.js";import"./chunk-gpeyctxd.js";import{Wf as hz}from"./chunk-9sdhdhv4.js";import{hg as c}from"./chunk-wtzkfwmx.js";import{ig as b,kg as C,lg as f,mg as M,vg as wz}from"./chunk-m268vcdm.js";import{Ag as z,Bg as J,Bh as Tz,Bj as V,Cg as x,Ci as Zz,Cj as n,Dj as Rz,Ej as Kz,Fg as Vz,Fj as kz,Gg as Oz,Gj as qz,Hg as k,Hj as Az,Ih as i,Ij as Ez,Ng as m,Sg as Pz,Ti as Gz,_i as Lz,ah as Yz,ch as X,dh as Jz,eh as Uz,lh as Bz,nh as zz,ph as Wz,qh as $z,tj as _z,vj as E,wj as Sz,xj as Mz,yg as Xz,yj as vz,zg as N}from"./chunk-eczsk2xd.js";import{Fk as Qz}from"./chunk-t15a1vp6.js";var K=Qz(Xz(),1);function Fz({open:Z,onOpenChange:$,mode:T,teamId:F,project:W}){let q=x(),R=m(),[H,O]=K.useState(""),[v,B]=K.useState(!0),[I,P]=K.useState(void 0),[h,U]=K.useState(void 0),[A,w]=K.useState(!1),S=K.useRef(null);K.useEffect(()=>{if(Z)if(T==="edit"&&W)O(W.name||""),P(W.coverImageKey),U(W.coverImage),B(W.enableNotification!==!1);else O(""),P(void 0),U(void 0),B(!0)},[Z,T,W]);let g=X.api.teams[":teamId"].projects.$post,{mutate:j}=k({mutationFn:async(Q)=>{let _=await g({param:{teamId:F},json:Q});if(!_.ok)throw Error(V.failed_create_project());return await _.json()},onSuccess:(Q)=>{q.invalidateQueries({queryKey:["teams",F,"projects"]}),$(!1);let _=Q;if(_&&typeof _.id==="string")R({to:"/projects/$projectId",params:{projectId:_.id}})}}),u=X.api.projects[":projectId"].$put,{mutate:y}=k({mutationFn:async(Q)=>{let _=await u({param:{projectId:W.id},json:Q});if(!_.ok)throw Error(V.failed_update_project());return await _.json()},onSuccess:()=>{q.invalidateQueries({queryKey:["teams",F,"projects"]}),$(!1)}}),r=X.api.teams[":teamId"].files.$post,{mutate:D}=k({mutationFn:async({file:Q})=>{let _=await r({param:{teamId:F},form:{file:Q}});if(!_.ok)throw Error(V.failed_upload_file());return await _.json()},onSuccess:(Q)=>{let _=Q;if(_&&typeof _.key==="string")P(_.key);w(!1)},onError:()=>{w(!1)}}),o=(Q)=>{let _=Q.target.files?.[0];if(_){w(!0);let e=URL.createObjectURL(_);U(e),D({file:_})}},t=()=>{S.current?.click()},s=(Q)=>{Q.stopPropagation(),P(void 0),U(void 0)},l=()=>{if(!H.trim())return;if(T==="create")j({name:H.trim(),coverImageKey:I,enableNotification:v});else if(T==="edit"&&W?.id)y({name:H.trim(),coverImageKey:I,enableNotification:v})};return z(Rz,{open:Z,onOpenChange:$,children:J(Kz,{className:"sm:max-w-[550px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 backdrop-blur-md shadow-2xl p-0 gap-0",children:[J(kz,{className:"relative overflow-hidden bg-gradient-to-br from-primary/5 to-transparent p-6 border-b border-border/40",children:[z("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/10 rounded-full blur-2xl pointer-events-none"}),z("div",{className:"absolute bottom-0 left-10 w-32 h-12 bg-primary/5 rounded-full blur-xl pointer-events-none"}),z("div",{className:"flex items-center gap-3",children:J("div",{children:[z(Az,{className:"text-xl font-semibold tracking-tight text-foreground",children:T==="create"?V.create_new_project():V.project_settings()}),z(Ez,{className:"text-xs text-muted-foreground/80 mt-1",children:T==="create"?V.configure_new_project_description():V.manage_project_description()})]})})]}),J("div",{className:"space-y-6 p-6 max-h-[75vh] overflow-y-auto",children:[J("div",{className:"space-y-2",children:[z(c,{htmlFor:"name",className:"text-sm font-semibold tracking-tight text-foreground",children:V.project_name()}),J("div",{className:"relative",children:[z(n,{id:"name",value:H,onChange:(Q)=>O(Q.target.value),placeholder:V.project_name_placeholder(),className:"h-11 px-4 rounded-xl border-border/80 focus-visible:ring-ring/25 focus-visible:border-primary transition-all shadow-xs pr-10"}),H.trim()&&z("div",{className:"absolute inset-y-0 right-3 flex items-center",children:z(i,{className:"w-4 h-4 text-primary"})})]}),z("p",{className:"text-[11px] text-muted-foreground",children:V.project_name_hint()})]}),J("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[J("div",{className:"flex items-center justify-between",children:[J(c,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[z($z,{className:"w-4 h-4 text-primary"}),V.project_cover()]}),h&&J("button",{type:"button",onClick:s,className:"text-xs text-muted-foreground hover:text-destructive hover:bg-destructive/5 px-2.5 py-1 rounded-lg transition-all flex items-center gap-1 font-medium",children:[z(Lz,{className:"w-3.5 h-3.5"}),V.remove_cover()]})]}),J("div",{className:"relative aspect-square w-48 mx-auto rounded-2xl border border-dashed border-border flex items-center justify-center cursor-pointer overflow-hidden group shadow-inner bg-muted/20 transition-all duration-300 hover:border-primary/50 hover:bg-muted/40",onClick:t,children:[z("input",{type:"file",ref:S,className:"hidden",accept:"image/*",onChange:o}),A&&z("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:J("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[z(zz,{className:"w-4 h-4 animate-spin text-primary"}),z("span",{className:"text-xs font-semibold text-foreground",children:V.uploading()})]})}),h?J(N,{children:[z("img",{src:h,alt:V.cover_preview(),className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),J("div",{className:"absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-center gap-1.5 text-white z-10",children:[z(Gz,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),z("span",{className:"text-xs font-semibold",children:V.upload_image()})]})]}):J("div",{className:"flex flex-col items-center gap-2 text-center p-4",children:[z("div",{className:"p-2.5 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:z(Gz,{className:"w-4 h-4 text-muted-foreground"})}),J("div",{children:[z("p",{className:"text-xs font-medium text-foreground",children:V.upload_cover()}),z("p",{className:"text-[11px] text-muted-foreground mt-0.5 max-w-[140px] mx-auto leading-normal",children:V.upload_cover_hint()})]})]})]})]}),J("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[J(c,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[z(Wz,{className:"w-4 h-4 text-primary"}),V.project_preferences()]}),J("div",{className:"flex items-start justify-between rounded-xl border border-border/50 bg-muted/10 p-4 transition-all duration-300 hover:bg-muted/20",children:[J("div",{className:"space-y-1 pr-4",children:[J("div",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[z(Tz,{className:"w-4 h-4 text-primary"}),V.activity_notifications()]}),z("p",{className:"text-xs text-muted-foreground leading-normal",children:V.activity_notifications_description()})]}),z(a,{checked:v,onCheckedChange:B,disabled:A,className:"mt-0.5"})]})]})]}),J(qz,{className:"flex items-center justify-end gap-3 px-6 py-4 bg-muted/20 border-t border-border/40",children:[z(E,{type:"button",variant:"ghost",onClick:()=>$(!1),disabled:A,className:"rounded-xl h-10 px-4 hover:bg-muted font-medium text-sm text-muted-foreground hover:text-foreground transition-colors",children:V.cancel()}),z(E,{type:"submit",onClick:l,disabled:!H.trim()||A,className:"rounded-xl h-10 px-5 bg-primary text-primary-foreground hover:bg-primary/90 font-semibold text-sm shadow-lg shadow-primary/10 hover:shadow-primary/20 active:scale-98 transition-all flex items-center gap-2",children:A?J(N,{children:[z(zz,{className:"w-4 h-4 animate-spin"}),V.processing()]}):T==="create"?V.create_project():V.save_changes()})]})]})})}function Nz({sortBy:Z,sortDirection:$,onSortChange:T}){let F=(H)=>{T(H,$)},W=()=>{T(Z,$==="asc"?"desc":"asc")},q=(H)=>{switch(H){case"name":return V.sort_name();case"created_at":return V.sort_created();case"updated_at":return V.sort_updated();default:return H}},R=$==="asc";return J(b,{children:[z(C,{asChild:!0,children:J(E,{variant:"outline",className:"gap-2 bg-muted/50",children:[z("span",{className:"text-muted-foreground",children:V.sorted_by_label()}),z("span",{className:"font-medium text-foreground",children:q(Z)})]})}),J(f,{align:"end",className:"w-56 p-2",children:[z("div",{className:"text-xs font-semibold text-muted-foreground mb-2 px-2",children:V.sort_by()}),J(b,{children:[z(C,{asChild:!0,children:J(E,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted mb-2 border",children:[z("span",{children:q(Z)}),z(Jz,{className:"h-4 w-4 opacity-50"})]})}),z(f,{className:"w-52",children:["name","created_at","updated_at"].map((H)=>J(M,{onClick:()=>F(H),className:"justify-between",children:[q(H),Z===H&&z(i,{className:"h-4 w-4"})]},H))})]}),J(E,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted border",onClick:W,children:[z("span",{className:"text-muted-foreground",children:Z==="name"?R?z(N,{children:V.sort_a_to_z()}):z(N,{children:V.sort_z_to_a()}):R?z(N,{children:V.sort_oldest_to_newest()}):z(N,{children:V.sort_newest_to_oldest()})}),R?z(Uz,{className:"h-4 w-4 opacity-50"}):z(Jz,{className:"h-4 w-4 opacity-50"})]})]})]})}var L=Qz(Xz(),1);function tz(){let{teamId:Z}=sz.useParams(),{canEdit:$,canAdmin:T}=wz(),F=m(),W=x(),[q,R]=L.useState(null),[H,O]=L.useState(!1),[v,B]=L.useState("create"),[I,P]=L.useState(void 0),[h,U]=L.useState(!1),[A,w]=L.useState(void 0),[S,g]=L.useState(""),[j,u]=L.useState(!1),[y,r]=L.useState("name"),[D,o]=L.useState("asc"),t=X.api.teams[":teamId"].projects.$get,{data:s}=Oz({queryKey:["teams",Z,"projects",y,D],queryFn:async()=>{let G=await t({param:{teamId:Z},query:{sortBy:y,sortDirection:D}});if(!G.ok)throw Error("Failed to fetch projects");return await G.json()}}),{data:l}=Vz({queryKey:["teams",Z,"members"],queryFn:async()=>{let G=await X.api.teams[":teamId"].members.$get({param:{teamId:Z},query:{}});if(!G.ok)throw Error("Failed to fetch members");return await G.json()}}),{data:Q}=Vz({queryKey:["teams",Z,"me"],queryFn:async()=>{let G=await X.api.teams[":teamId"].me.$get({param:{teamId:Z}});if(!G.ok)throw Error("Failed to fetch me");return await G.json()}}),_=X.api.teams[":teamId"].invite.$post,e=k({mutationFn:async(G)=>{let Y=await _(G);if(!Y.ok)throw Error("Failed to invite");return await Y.json()}}),d=k({mutationFn:async(G)=>{if(!(await X.api.projects[":projectId"].$delete({param:{projectId:G}})).ok)throw Error("Failed to delete project")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"projects"]})}}),dz=k({mutationFn:async(G)=>{let Y=await X.api.projects[":projectId"].$put({param:{projectId:G.id},json:{enableNotification:!G.enableNotification}});if(!Y.ok)throw Error("Failed to update project notification settings");return await Y.json()},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"projects"]}),Yz.success(V.project_notification_updated())},onError:(G)=>{Yz.error(G instanceof Error?G.message:V.failed_update_project_notification())}}),Hz=()=>{B("create"),P(void 0),O(!0)},pz=()=>{R("create"),setTimeout(()=>{R(null)},100),setTimeout(()=>{Hz()},200)},cz=(G)=>{B("edit"),P(G),O(!0)},xz=(G)=>{w(G),g(""),U(!0)},mz=async()=>{if(A&&S==="delete")try{await d.mutateAsync(A.id),U(!1)}catch(G){console.error(G)}},iz=(G,Y)=>{if(Y.detail>1)return;R(G),setTimeout(()=>{R(null)},100),setTimeout(()=>{F({to:"/projects/$projectId",params:{projectId:G}})},200)},nz=async(G)=>{return(await e.mutateAsync({param:{teamId:Z},json:{role:G}})).code},az=k({mutationFn:async({userId:G,role:Y})=>{if(!(await X.api.teams[":teamId"].members[":userId"].$patch({param:{teamId:Z,userId:G},json:{role:Y}})).ok)throw Error("Failed to update member role")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"members"]})}}),jz=k({mutationFn:async(G)=>{if(!(await X.api.teams[":teamId"].members[":userId"].$delete({param:{teamId:Z,userId:G}})).ok)throw Error("Failed to remove member")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"members"]})}}),rz=(G)=>{if(!G)return"??";return G.split(" ").map((Y)=>Y[0]).slice(0,2).join("").toUpperCase()},oz=(G,Y)=>{r(G),o(Y)},p=Array.isArray(l)?l:[];return J("div",{className:"flex-1 overflow-y-auto p-4",children:[J("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-4",children:[z("h1",{className:"text-2xl font-bold",children:V.projects()}),J("div",{className:"flex flex-wrap items-center gap-4",children:[J("div",{className:"flex items-center -space-x-2 cursor-pointer hover:opacity-90",onClick:()=>u(!0),"data-testid":"team-members-trigger",children:[p.slice(0,3).map((G)=>J(Sz,{className:"border-2 border-background w-8 h-8",children:[G.image&&z(Mz,{src:G.image,alt:G.name,className:"object-cover"}),z(vz,{className:"text-[10px]",children:rz(G.name)})]},G.id)),p.length>3&&J("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border-2 border-background bg-muted text-[10px] font-medium",children:["+",p.length-3]})]}),z(Nz,{sortBy:y,sortDirection:D,onSortChange:oz}),$&&J(E,{className:"bg-orange-600 hover:bg-orange-700 text-white gap-2",onClick:Hz,children:[z(Zz,{className:"w-4 h-4"}),V.create_project()]})]})]}),J("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4",children:[s.data?.map((G)=>z("div",{className:_z("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out",q===G.id?"scale-95":"scale-100"),onClick:(Y)=>iz(G.id,Y),children:J("div",{className:"flex flex-col",children:[J("div",{className:"relative w-full h-full aspect-square flex items-center justify-center bg-zinc-400/20",children:[G.coverImage?z("img",{src:G.coverImage,alt:G.name,className:"w-full h-full object-cover rounded"}):J("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180.95 164.7",preserveAspectRatio:"xMidYMid slice",className:"w-full h-full object-cover rounded",children:[z("polygon",{fill:"#FC9F8E",points:"0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6"}),z("polygon",{fill:"#FEBAB8",points:"0 0 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0"}),z("polyline",{fill:"#FAA5A5",points:"0 18.5 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0 0 0"}),z("polygon",{fill:"#EC5B6C",points:"0 76.0 0 164.7 151.69 164.7"}),z("polygon",{fill:"#E85C71",points:"180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6"}),z("polygon",{fill:"#C8405B",points:"117.26 73.4 117.37 99.0 90.53 114.9 174.35 164.7 180.95 164.7 180.95 113.6"}),z("polygon",{fill:"#FFCCBE",points:"90.53 51.6 63.69 68.1 90.53 83.4"}),z("path",{fill:"#FB9991",d:"M 90.53 51.6 L 90.53 61.3 L 100.87 67.4 L 90.53 73.5 L 90.53 83.4 L 117.37 68.0 C 117.15 67.6 90.53 51.6 90.53 51.6 Z"}),z("path",{fill:"#FFEACD",d:"M 63.69 68.1 C 63.47 68.5 64.02 99.3 64.02 99.3 C 64.02 99.3 64.46 99.6 64.9 99.9 L 90.53 83.4 L 63.69 68.1 Z"}),z("polygon",{fill:"#FFCFB5",points:"64.02 99.3 90.53 114.9 90.53 83.4"}),z("path",{fill:"#F67D73",d:"M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z"}),z("path",{fill:"#F26560",d:"M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z"}),z("polygon",{fill:"#EB5F5B",points:"80.08 67.5 90.53 73.5 90.53 61.3"}),z("polygon",{fill:"#DB4D50",points:"90.53 61.3 90.53 73.5 100.87 67.4"})]}),z("div",{className:"absolute bottom-0 left-0 w-full h-[65%] bg-linear-to-t from-black/35 to-black/0"}),z("p",{className:"absolute left-1 bottom-2 text-white",children:G.name})]}),J("div",{className:"px-2 h-10 flex justify-between items-center",children:[J("p",{className:"truncate pr-1 text-xs text-muted-foreground",children:[V.updated_ago()," ",hz(G.updatedAt??"")]}),z("div",{onClick:(Y)=>Y.stopPropagation(),children:J(b,{modal:!1,children:[z(C,{asChild:!0,children:z("button",{className:"hover:bg-muted outline-none flex px-1",children:z(Bz,{className:"w-5 h-5 text-muted-foreground"})})}),J(f,{align:"end",children:[$&&z(M,{onClick:(Y)=>{Y.stopPropagation(),cz(G)},children:V.project_settings()}),J(M,{className:"flex items-center justify-between gap-4 cursor-pointer",onSelect:(Y)=>{Y.preventDefault(),dz.mutate(G)},children:[z("span",{children:V.notification()}),z(a,{checked:G.enableNotification??!0,className:"pointer-events-none"})]}),T&&z(M,{className:"text-destructive focus:text-destructive",onClick:()=>xz(G),children:V.delete()})]})]})})]})]})},G.id)),$&&z("div",{className:_z("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out border-dashed hover:border-orange-600/50 group",q==="create"?"scale-95":"scale-100"),onClick:pz,children:J("div",{className:"flex flex-col",children:[z("div",{className:"relative w-full aspect-square flex items-center justify-center bg-zinc-400/5 group-hover:bg-orange-600/5 transition-colors",children:z(Zz,{className:"w-8 h-8 text-zinc-400 group-hover:text-orange-600 transition-colors"})}),z("div",{className:"px-2 h-10 flex items-center justify-center bg-zinc-400/10 border-t group-hover:bg-orange-600/10 transition-colors",children:z("p",{className:"text-sm text-muted-foreground group-hover:text-orange-600 transition-colors",children:V.create_project()})})]})})]}),z(Fz,{open:H,onOpenChange:O,mode:v,teamId:Z,project:I}),z(yz,{open:h,onOpenChange:U,children:J(Dz,{children:[J(bz,{children:[z(fz,{children:V.are_you_sure()}),J(Iz,{children:[V.delete_project_warning({name:A?.name??""}),J("div",{className:"mt-4 flex flex-col gap-2 text-foreground",children:[z("span",{className:"text-sm font-medium",children:V.type_delete_to_confirm()}),z(n,{value:S,onChange:(G)=>g(G.target.value),placeholder:V.delete_placeholder(),className:"h-9",autoFocus:!0})]})]})]}),J(Cz,{children:[z(uz,{disabled:d.isPending,children:V.cancel()}),z(gz,{onClick:(G)=>{G.preventDefault(),mz()},disabled:S!=="delete"||d.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:d.isPending?V.deleting():V.delete()})]})]})}),z(lz,{open:j,onOpenChange:u,title:V.team_members(),type:"team",members:p,isOwner:Q?.role==="owner",onInvite:nz,onUpdateRole:async(G,Y)=>{await az.mutateAsync({userId:G,role:Y})},onRemoveMember:async(G)=>{await jz.mutateAsync(G)},currentUserId:Q?.id})]})}var sz=Pz("/teams/$teamId/")({component:tz});export{sz as Route};
|