@shumai-one/shumai 0.4.4 → 0.4.6
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-snhsjs4x.js → chunk-07jszkhj.js} +62 -62
- package/bin/chunk-0c67210c.js +1 -0
- package/bin/{chunk-kswvyqq1.js → chunk-0wvhahzh.js} +2 -2
- package/bin/chunk-161rxeq2.js +2 -0
- package/bin/{chunk-trveq4wg.js → chunk-1bgsphyz.js} +2 -2
- package/bin/{chunk-vap4k11j.js → chunk-1dqsf5qj.js} +6 -6
- package/bin/{chunk-zxk7q0zk.js → chunk-1jybg56e.js} +1 -1
- package/bin/chunk-1kt5dzjv.js +2 -0
- package/bin/{chunk-drepsbb4.js → chunk-1t51fp6n.js} +1 -1
- package/bin/{chunk-cbgq517y.js → chunk-2jrjwaqr.js} +2 -2
- package/bin/chunk-2qjfpmcf.js +2 -0
- package/bin/{chunk-wjyaezs7.js → chunk-2vzzd0q6.js} +1 -1
- package/bin/chunk-2yr5k567.js +2 -0
- package/bin/chunk-2z1pnt7h.js +2 -0
- package/bin/{chunk-0zv3bks2.js → chunk-3d5rm1d1.js} +1 -1
- package/bin/{chunk-w4ghe71n.js → chunk-3d9tfxp4.js} +1 -1
- package/bin/{chunk-0qjfahk9.js → chunk-3dgahs95.js} +1 -1
- package/bin/{chunk-dqxeztfa.js → chunk-3j5njrpr.js} +2 -2
- package/bin/{chunk-ryzz5fht.js → chunk-3n4224c0.js} +1 -1
- package/bin/{chunk-914bp49r.js → chunk-3tg39jx7.js} +3 -3
- package/bin/chunk-3vmapyk9.js +1 -0
- package/bin/{chunk-g3fpmyyn.js → chunk-46wfxyd7.js} +2 -2
- package/bin/{chunk-4hkkdm2q.js → chunk-47tn3vtg.js} +1 -1
- package/bin/{chunk-1zwajpwf.js → chunk-4syt6rn0.js} +3 -3
- package/bin/chunk-5kvc1gp2.js +1 -0
- package/bin/{chunk-xa18z1py.js → chunk-5vvvgjvz.js} +2 -2
- package/bin/{chunk-5nm2jvg5.js → chunk-6vxzkrsj.js} +11 -11
- package/bin/{chunk-ytdwk2fq.js → chunk-6y4xkcte.js} +2 -2
- package/bin/{chunk-fpc4p0j8.js → chunk-7e5z637e.js} +2 -2
- package/bin/chunk-7nvk7waw.js +1 -0
- package/bin/{chunk-rq0n0vcc.js → chunk-80qz30dc.js} +2 -2
- package/bin/chunk-886pnknh.js +3 -0
- package/bin/{chunk-6ghcj4a9.js → chunk-8cn7fx40.js} +1 -1
- package/bin/chunk-908pypkr.js +1 -0
- package/bin/chunk-952qwf17.js +2 -0
- package/bin/chunk-988casfy.js +1 -0
- package/bin/chunk-9a2tf0mh.js +2 -0
- package/bin/{chunk-nkdk229f.js → chunk-9d0thqcy.js} +1 -1
- package/bin/{chunk-s2k4qntr.js → chunk-9nvymwqj.js} +2 -2
- package/bin/{chunk-mz0yjra0.js → chunk-9trnkbtr.js} +4 -4
- package/bin/{chunk-t2hy6tj9.js → chunk-a4056d0r.js} +1 -1
- package/bin/{chunk-ze20rm02.js → chunk-a796sgcw.js} +4 -4
- package/bin/{chunk-kpgfqkp0.js → chunk-afnzb9ne.js} +2 -2
- package/bin/chunk-apfrw0wd.js +3 -0
- package/bin/{chunk-wndm3px3.js → chunk-axmd242s.js} +1 -1
- package/bin/{chunk-nr20tvnw.js → chunk-b3aqmcps.js} +2 -2
- package/bin/chunk-b6q287d1.js +2 -0
- package/bin/{chunk-j1tkmcae.js → chunk-b9hyc0a1.js} +2 -2
- package/bin/chunk-ba33nf0q.js +4 -0
- package/bin/chunk-batadmvr.js +2 -0
- package/bin/{chunk-1t167cvj.js → chunk-brwbhbmc.js} +7 -7
- package/bin/chunk-bvdvp192.js +1 -0
- package/bin/{chunk-fahk9h62.js → chunk-crja7whq.js} +2 -2
- package/bin/{chunk-98715kc3.js → chunk-d7fwggt6.js} +2 -2
- package/bin/chunk-db1msmdh.js +2 -0
- package/bin/{chunk-97f2af6d.js → chunk-dbw8c1jj.js} +5 -5
- package/bin/{chunk-7gmdnsdg.js → chunk-dj5a6kkh.js} +1 -1
- package/bin/chunk-dkx3pmdz.js +1 -0
- package/bin/{chunk-071x515q.js → chunk-dmvvt8va.js} +2 -2
- package/bin/{chunk-3tedzb2j.js → chunk-dpc11hpd.js} +9 -9
- package/bin/{chunk-ks8xzc95.js → chunk-dscq4a4k.js} +2 -2
- package/bin/{chunk-jmpb5633.js → chunk-dz076sh7.js} +1 -1
- package/bin/chunk-edqd8evk.js +2 -0
- package/bin/{chunk-0qaq0sp8.js → chunk-ehpfg3km.js} +2 -2
- package/bin/chunk-ey3h4sct.js +2 -0
- package/bin/{chunk-vm5fx7td.js → chunk-ga3pahzf.js} +1 -1
- package/bin/chunk-gc6m7agb.js +3 -0
- package/bin/{chunk-7bcxj1jd.js → chunk-gcjsw9yp.js} +1 -1
- package/bin/chunk-gqr5hxhj.js +2 -0
- package/bin/{chunk-jrjnqx78.js → chunk-gsfcpcye.js} +1 -1
- package/bin/chunk-h9mka9br.js +2 -0
- package/bin/chunk-hacyjx1s.js +1 -0
- package/bin/chunk-hd6dnnyg.js +2 -0
- package/bin/chunk-he5nvmqw.js +1 -0
- package/bin/{chunk-reyxk4bw.js → chunk-hnhdq2wd.js} +1 -1
- package/bin/{chunk-gt4csat6.js → chunk-hs2r9qaw.js} +2 -2
- package/bin/{chunk-fb40xxz3.js → chunk-hxyg5q2a.js} +2 -2
- package/bin/chunk-hyr1vtfp.js +1 -0
- package/bin/{chunk-zw86wnwe.js → chunk-j9ks8bd7.js} +2 -2
- package/bin/{chunk-1gvscz88.js → chunk-jg2v25d2.js} +2 -2
- package/bin/chunk-jh8q3885.js +211 -0
- package/bin/chunk-jzbrt2vk.js +1 -0
- package/bin/chunk-k6avge95.js +10 -0
- package/bin/{chunk-msfw3jmc.js → chunk-kg8eg9z3.js} +2 -2
- package/bin/chunk-kk42xhgz.js +1 -0
- package/bin/{chunk-3ttrhqy3.js → chunk-kmbjp5kp.js} +2 -2
- package/bin/{chunk-jgs8an3h.js → chunk-md5pcq46.js} +8 -8
- package/bin/{chunk-xarsrs08.js → chunk-mtb9fpj2.js} +1 -1
- package/bin/chunk-n3xjwszr.js +2 -0
- package/bin/chunk-nqym3zbs.js +1 -0
- package/bin/{chunk-579e4wv4.js → chunk-p75f5pgq.js} +2 -2
- package/bin/{chunk-hm0dkzed.js → chunk-pdh9bnyj.js} +2 -2
- package/bin/{chunk-rhvv1vvk.js → chunk-pgj2kjnn.js} +2 -2
- package/bin/{chunk-hmpwg5za.js → chunk-pvg3msgw.js} +8 -8
- package/bin/{chunk-4991gz3y.js → chunk-pwkby9h7.js} +6 -6
- package/bin/{chunk-fnmwksnb.js → chunk-qbqym9m6.js} +2 -2
- package/bin/{chunk-4wy87hwd.js → chunk-qgkbxw1k.js} +2 -2
- package/bin/{chunk-1j27fzy1.js → chunk-qs7855cz.js} +2 -2
- package/bin/{chunk-7jtmwt5a.js → chunk-radcwage.js} +2 -2
- package/bin/{chunk-gk2q9a3f.js → chunk-rmzcarv9.js} +2 -2
- package/bin/{chunk-s2fnfyn9.js → chunk-rp4pc6kz.js} +1 -1
- package/bin/{chunk-5adsx8x4.js → chunk-rsd164d9.js} +2 -2
- package/bin/{chunk-hk5rc6cd.js → chunk-s05cdax2.js} +4 -4
- package/bin/{chunk-pazjhrnf.js → chunk-sab7tjxw.js} +5 -5
- package/bin/chunk-sebbjvgv.css +1 -0
- package/bin/{chunk-bkr5zm4h.js → chunk-t350k3s1.js} +1 -1
- package/bin/{chunk-4v41a1r9.js → chunk-t7bvde99.js} +3 -3
- package/bin/chunk-t8gv2ekj.js +14 -0
- package/bin/chunk-teqprbd8.js +2 -0
- package/bin/chunk-tgr86ac4.js +2 -0
- package/bin/{chunk-5hg6kcfz.js → chunk-v8v8vdf7.js} +9 -9
- package/bin/chunk-vm5tn0zm.js +2 -0
- package/bin/chunk-vzj2j11x.js +2 -0
- package/bin/chunk-w1wxzqqb.js +2 -0
- package/bin/chunk-wmjp8dcm.js +1 -0
- package/bin/chunk-wy8dkyxj.js +1 -0
- package/bin/{chunk-a6gx7f5q.js → chunk-y1b3ck7m.js} +1 -1
- package/bin/{chunk-1xh34aew.js → chunk-y20sbaz5.js} +2 -2
- package/bin/{chunk-qsr1a0rp.js → chunk-y56yvezn.js} +1 -1
- package/bin/{chunk-9t8n2des.js → chunk-yfr0hzb7.js} +2 -2
- package/bin/chunk-ysv80zyb.js +5 -0
- package/bin/chunk-z08bqvkc.js +42 -0
- package/bin/{chunk-5tcdwep5.js → chunk-z6jpt0h6.js} +4 -4
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +605 -370
- package/package.json +7 -7
- package/prisma/migrations/20260913130237_add_asset_comment_asset_id_idx/migration.sql +2 -0
- package/prisma/migrations/20260914024424_add_asset_comment_reactions/migration.sql +22 -0
- package/prisma/migrations/20260914064432_limit_reaction_code_length/migration.sql +8 -0
- package/prisma/migrations/20260914092940_add_jpeg_preview_flags/migration.sql +5 -0
- package/prisma/schema.prisma +22 -0
- package/bin/chunk-0cmx7k4c.js +0 -1
- package/bin/chunk-16xax8kk.js +0 -1
- package/bin/chunk-2w5xqhjm.js +0 -1
- package/bin/chunk-3zkasqb8.js +0 -1
- package/bin/chunk-453ykvaw.js +0 -2
- package/bin/chunk-4mjywsj8.js +0 -3
- package/bin/chunk-5vzrpz50.js +0 -2
- package/bin/chunk-77fmkpdz.js +0 -10
- package/bin/chunk-7kjgvxqa.js +0 -2
- package/bin/chunk-7pw1550a.js +0 -2
- package/bin/chunk-7rhz2gze.js +0 -211
- package/bin/chunk-837fky18.js +0 -3
- package/bin/chunk-84as6x83.js +0 -1
- package/bin/chunk-8e28hcny.js +0 -2
- package/bin/chunk-9ccw540k.js +0 -2
- package/bin/chunk-9ybt6vbm.js +0 -1
- package/bin/chunk-avwgktxb.js +0 -2
- package/bin/chunk-d27mm390.js +0 -1
- package/bin/chunk-dj92fss9.js +0 -2
- package/bin/chunk-f6svp4dp.js +0 -2
- package/bin/chunk-fsyzs0tf.js +0 -1
- package/bin/chunk-fxecgp5k.js +0 -1
- package/bin/chunk-gc5sbfa5.js +0 -2
- package/bin/chunk-gdm6yfqq.js +0 -2
- package/bin/chunk-gye8gabk.js +0 -2
- package/bin/chunk-j2bvj2yn.js +0 -2
- package/bin/chunk-jffktpqg.js +0 -1
- package/bin/chunk-k2k9vjq6.js +0 -1
- package/bin/chunk-m9pr03kn.js +0 -2
- package/bin/chunk-mfn9qjm4.js +0 -2
- package/bin/chunk-nbdw8fen.js +0 -1
- package/bin/chunk-q806pqeh.js +0 -1
- package/bin/chunk-qka4mkmj.js +0 -2
- package/bin/chunk-rchsme43.js +0 -3
- package/bin/chunk-rqf7999q.js +0 -42
- package/bin/chunk-rssgmj7x.js +0 -2
- package/bin/chunk-t7nsgg5k.js +0 -4
- package/bin/chunk-tm7f32c7.js +0 -14
- package/bin/chunk-vy8gntez.js +0 -1
- package/bin/chunk-vyzptrea.js +0 -2
- package/bin/chunk-wdsf44hs.js +0 -2
- package/bin/chunk-x5jwwvs0.js +0 -1
- package/bin/chunk-x92cq59c.js +0 -1
- package/bin/chunk-xtf3c29c.css +0 -1
- package/bin/chunk-xx337zcw.js +0 -2
- package/bin/chunk-xz6713tj.js +0 -2
- package/bin/chunk-yfnem6se.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{at,O,P,dt,D,b,S,t,C,us,pt,Y,Ft,se,Hn,da,fl,pl}from"./chunk-jh8q3885.js";S();S();var M=Object.defineProperty,k=(s,e)=>M(s,"name",{value:e,configurable:!0}),F="Toggle",T=O(k(function(e,o){let{pressed:r,defaultPressed:n,onPressedChange:a,...g}=e,[l,i]=Ft({prop:r,onChange:a,defaultProp:n??!1,caller:F});return t(se.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...g,ref:o,onClick:Y(e.onClick,()=>{if(!e.disabled)i(!l)})})},"Toggle"));S();var A=Object.defineProperty,p=(s,e)=>A(s,"name",{value:e,configurable:!0}),m="ToggleGroup",[h,ie]=pt(m,[da]),x=da(),E=O(p(function(e,o){let{type:r,...n}=e;if(r==="single")return t(N,{role:"radiogroup",...n,ref:o});if(r==="multiple")return t(j,{role:"toolbar",...n,ref:o});throw Error(`Missing prop \`type\` expected on \`${m}\``)},"ToggleGroup")),[I,_]=h(m),N=O(p(function(e,o){let{value:r,defaultValue:n,onValueChange:a=p(()=>{},"onValueChange"),...g}=e,[l,i]=Ft({prop:r,defaultProp:n??"",onChange:a,caller:m});return t(I,{scope:e.__scopeToggleGroup,type:"single",value:D(()=>l?[l]:[],[l]),onItemActivate:i,onItemDeactivate:P(()=>i(""),[i]),children:t(V,{...g,ref:o})})},"ToggleGroupImplSingle")),j=O(p(function(e,o){let{value:r,defaultValue:n,onValueChange:a=p(()=>{},"onValueChange"),...g}=e,[l,i]=Ft({prop:r,defaultProp:n??[],onChange:a,caller:m}),u=P((c)=>i((d=[])=>[...d,c]),[i]),f=P((c)=>i((d=[])=>d.filter((z)=>z!==c)),[i]);return t(I,{scope:e.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:f,children:t(V,{...g,ref:o})})},"ToggleGroupImplMultiple")),[B,H]=h(m),V=O(p(function(e,o){let{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:a=!0,orientation:g,dir:l,loop:i=!0,...u}=e,f=x(r),c=Hn(l),d={dir:c,...u};return t(B,{scope:r,rovingFocus:a,disabled:n,children:a?t(fl,{asChild:!0,...f,orientation:g,dir:c,loop:i,children:t(se.div,{...d,ref:o})}):t(se.div,{...d,ref:o})})},"ToggleGroupImpl")),v="ToggleGroupItem",L=O(p(function(e,o){let r=_(v,e.__scopeToggleGroup),n=H(v,e.__scopeToggleGroup),a=x(e.__scopeToggleGroup),g=r.value.includes(e.value),l=n.disabled||e.disabled,i={...e,pressed:g,disabled:l},u=b(null);return n.rovingFocus?t(pl,{asChild:!0,...a,focusable:!l,active:g,ref:u,children:t(R,{...i,ref:o})}):t(R,{...i,ref:o})},"ToggleGroupItem")),R=O(p(function(e,o){let{__scopeToggleGroup:r,value:n,...a}=e,g=_(v,r),l={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=g.type==="single"?l:void 0;return t(T,{...i,...a,ref:o,onPressedChange:(u)=>{if(u)g.onItemActivate(n);else g.onItemDeactivate(n)}})},"ToggleGroupItemImpl"));var y=us("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 min-w-9 px-2",sm:"h-8 min-w-8 px-1.5",lg:"h-10 min-w-10 px-2.5"}},defaultVariants:{variant:"default",size:"default"}});var w=at({size:"default",variant:"default",spacing:0});function To({className:s,variant:e,size:o,spacing:r=0,children:n,...a}){return t(E,{"data-slot":"toggle-group","data-variant":e,"data-size":o,"data-spacing":r,style:{"--gap":r},className:C("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",s),...a,children:t(w.Provider,{value:{variant:e,size:o,spacing:r},children:n})})}function gr({className:s,children:e,variant:o,size:r,...n}){let a=dt(w);return t(L,{"data-slot":"toggle-group-item","data-variant":a.variant||o,"data-size":a.size||r,"data-spacing":a.spacing,className:C(y({variant:a.variant||o,size:a.size||r}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",s),...n,children:e})}
|
|
2
|
+
export{To,gr};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,S,t,L,Ue,A,lt,wt,$p}from"./chunk-jh8q3885.js";import"./chunk-07jszkhj.js";import"./chunk-t8gv2ekj.js";import"./chunk-w1wxzqqb.js";import"./chunk-ey3h4sct.js";import"./chunk-k6avge95.js";import"./chunk-qs7855cz.js";import"./chunk-2yr5k567.js";import"./chunk-vzj2j11x.js";import"./chunk-h9mka9br.js";import"./chunk-3tg39jx7.js";import"./chunk-ysv80zyb.js";import"./chunk-ehpfg3km.js";import{Gn}from"./chunk-edqd8evk.js";import{tr}from"./chunk-2z1pnt7h.js";import"./chunk-d7fwggt6.js";import"./chunk-rsd164d9.js";import"./chunk-tgr86ac4.js";import"./chunk-2jrjwaqr.js";import"./chunk-rmzcarv9.js";import"./chunk-yfr0hzb7.js";import"./chunk-6y4xkcte.js";import"./chunk-3d5rm1d1.js";S();function l(){let{projectId:o}=c.useParams(),{teamId:r,ensureTeamIdForProject:a}=lt();h(()=>{a(o)},[o,a]);let{data:s}=tr($p(o)),e=s?.rootFolder,{data:i}=L({queryKey:["folders",e],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:e}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!e});if(!r||!e||!i)return t(wt,{});return t(Gn,{teamId:r,projectId:o,projectName:s.name??"",assetId:e,rootFolderId:e})}var c=Ue("/projects/$projectId/")({component:l});export{c as Route};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,Ue}from"./chunk-jh8q3885.js";import"./chunk-t8gv2ekj.js";import"./chunk-07jszkhj.js";import"./chunk-w1wxzqqb.js";import"./chunk-ey3h4sct.js";import"./chunk-vzj2j11x.js";import"./chunk-h9mka9br.js";import"./chunk-3tg39jx7.js";import"./chunk-ysv80zyb.js";import"./chunk-k6avge95.js";import"./chunk-161rxeq2.js";import"./chunk-ehpfg3km.js";import{ba}from"./chunk-1kt5dzjv.js";import"./chunk-d7fwggt6.js";import"./chunk-tgr86ac4.js";import"./chunk-2jrjwaqr.js";import"./chunk-rmzcarv9.js";import"./chunk-yfr0hzb7.js";import"./chunk-6y4xkcte.js";import"./chunk-3d5rm1d1.js";function s(){let{shareId:e,folderId:a}=n.useParams();return t(ba,{shareId:e,initialFolderId:a})}var n=Ue("/share/$shareId/folders/$folderId")({component:s});export{n as Route};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h,w,u,C,B,t,o,K,wi,Z,U,Re,Fe,A,T,cr,L,Me,fe,De,E,S,Ee,Ie,Te,ge,Ae,ye,W,uA,dA,My,ke,_0,L0,F0,_f,at,A_,y_,E_,ob,Eb,Ib,Dc,Bw,xx,gS,_S,xS,SS,CS,ES,IS,Yh,TS,hC,Ds,Bc,xl,SE,Sl,Uc,Fc,EE,zc,TE,eI,RI,NI,DI,LI,Np,Op,Je,Xe,et,tt,rt,nt,ot,st,pe,ue,me,$e,de,Tt,H,Pt,R,Vg,V,qe,Lo}from"./chunk-7rhz2gze.js";import{Fl}from"./chunk-rssgmj7x.js";import{Pl}from"./chunk-453ykvaw.js";import{ui}from"./chunk-qka4mkmj.js";import{so}from"./chunk-9t8n2des.js";import{rn}from"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";var Le=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],te=T("arrow-down-wide-narrow",Le);var Ke=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],se=T("sliders-vertical",Ke);C();function ie({open:a,onOpenChange:c,mode:d,teamId:v,project:l}){let f=K(),p=Re(),[n,b]=u(""),[k,N]=u(!0),[F,x]=u(void 0),[_,y]=u(void 0),[g,M]=u(!1),D=w(null);h(()=>{if(a)if(d==="edit"&&l)b(l.name||""),x(l.coverImageKey),y(l.coverImage),N(l.enableNotification!==!1);else b(""),x(void 0),y(void 0),N(!0)},[a,d,l]);let P=A.api.teams[":teamId"].projects.$post,{mutate:Y}=U({mutationFn:async(i)=>{let s=await P({param:{teamId:v},json:i});if(!s.ok)throw Error(ob());return await s.json()},onSuccess:(i)=>{f.invalidateQueries({queryKey:["teams",v,"projects"]}),c(!1);let s=i;if(s&&typeof s.id==="string")p({to:"/projects/$projectId",params:{projectId:s.id}})}}),q=A.api.projects[":projectId"].$put,{mutate:G}=U({mutationFn:async(i)=>{let s=await q({param:{projectId:l.id},json:i});if(!s.ok)throw Error(Eb());return await s.json()},onSuccess:()=>{f.invalidateQueries({queryKey:["teams",v,"projects"]}),c(!1)}}),J=A.api.teams[":teamId"].files.$post,{mutate:O}=U({mutationFn:async({file:i})=>{let s=await J({param:{teamId:v},form:{file:i}});if(!s.ok)throw Error(Dc());return await s.json()},onSuccess:(i)=>{let s=i;if(s&&typeof s.key==="string")x(s.key);M(!1)},onError:()=>{M(!1)}}),m=(i)=>{let s=i.target.files?.[0];if(s){M(!0);let ee=URL.createObjectURL(s);y(ee),O({file:s})}},j=()=>{D.current?.click()},z=(i)=>{i.stopPropagation(),x(void 0),y(void 0)},I=()=>{if(!n.trim())return;if(d==="create")Y({name:n.trim(),coverImageKey:F,enableNotification:k});else if(d==="edit"&&l?.id)G({name:n.trim(),coverImageKey:F,enableNotification:k})};return t(pe,{open:a,onOpenChange:c,children:o(ue,{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:[o(me,{className:"relative overflow-hidden bg-gradient-to-br from-primary/5 to-transparent p-6 border-b border-border/40",children:[t("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/10 rounded-full blur-2xl pointer-events-none"}),t("div",{className:"absolute bottom-0 left-10 w-32 h-12 bg-primary/5 rounded-full blur-xl pointer-events-none"}),t("div",{className:"flex items-center gap-3",children:o("div",{children:[t(de,{className:"text-xl font-semibold tracking-tight text-foreground",children:d==="create"?F0():Yh()}),t(Tt,{className:"text-xs text-muted-foreground/80 mt-1",children:d==="create"?_0():Bw()})]})})]}),o("div",{className:"space-y-6 p-6 max-h-[75vh] overflow-y-auto",children:[o("div",{className:"space-y-2",children:[t(V,{htmlFor:"name",className:"text-sm font-semibold tracking-tight text-foreground",children:xS()}),o("div",{className:"relative",children:[t(H,{id:"name",value:n,onChange:(i)=>b(i.target.value),placeholder:CS(),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"}),n.trim()&&t("div",{className:"absolute inset-y-0 right-3 flex items-center",children:t(Me,{className:"w-4 h-4 text-primary"})})]}),t("p",{className:"text-[11px] text-muted-foreground",children:SS()})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o("div",{className:"flex items-center justify-between",children:[o(V,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(rn,{className:"w-4 h-4 text-primary"}),_S()]}),_&&o("button",{type:"button",onClick:z,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:[t(De,{className:"w-3.5 h-3.5"}),hC()]})]}),o("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:j,children:[t("input",{type:"file",ref:D,className:"hidden",accept:"image/*",onChange:m}),g&&t("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:o("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[t(L,{className:"w-4 h-4 animate-spin text-primary"}),t("span",{className:"text-xs font-semibold text-foreground",children:Op()})]})}),_?o(B,{children:[t("img",{src:_,alt:L0(),className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),o("div",{className:"absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-center gap-1.5 text-white z-10",children:[t(so,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),t("span",{className:"text-xs font-semibold",children:Np()})]})]}):o("div",{className:"flex flex-col items-center gap-2 text-center p-4",children:[t("div",{className:"p-2.5 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:t(so,{className:"w-4 h-4 text-muted-foreground"})}),o("div",{children:[t("p",{className:"text-xs font-medium text-foreground",children:DI()}),t("p",{className:"text-[11px] text-muted-foreground mt-0.5 max-w-[140px] mx-auto leading-normal",children:LI()})]})]})]})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o(V,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(se,{className:"w-4 h-4 text-primary"}),IS()]}),o("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:[o("div",{className:"space-y-1 pr-4",children:[o("div",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[t(ui,{className:"w-4 h-4 text-primary"}),uA()]}),t("p",{className:"text-xs text-muted-foreground leading-normal",children:dA()})]}),t(qe,{checked:k,onCheckedChange:N,disabled:g,className:"mt-0.5"})]})]})]}),o($e,{className:"flex items-center justify-end gap-3 px-6 py-4 bg-muted/20 border-t border-border/40",children:[t(S,{type:"button",variant:"ghost",onClick:()=>c(!1),disabled:g,className:"rounded-xl h-10 px-4 hover:bg-muted font-medium text-sm text-muted-foreground hover:text-foreground transition-colors",children:ke()}),t(S,{type:"submit",onClick:I,disabled:!n.trim()||g,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:g?o(B,{children:[t(L,{className:"w-4 h-4 animate-spin"}),gS()]}):d==="create"?_f():Ds()})]})]})})}function le({sortBy:a,sortDirection:c,onSortChange:d}){let v=(n)=>{d(n,c)},l=()=>{d(a,c==="asc"?"desc":"asc")},f=(n)=>{switch(n){case"name":return Sl();case"created_at":return SE();case"updated_at":return EE();default:return n}},p=c==="asc";return o(ge,{children:[t(Ae,{asChild:!0,children:o(S,{variant:"outline",className:"gap-2 bg-muted/50",children:[t("span",{className:"text-muted-foreground",children:TE()}),t("span",{className:"font-medium text-foreground",children:f(a)})]})}),o(ye,{align:"end",className:"w-56 p-2",children:[t("div",{className:"text-xs font-semibold text-muted-foreground mb-2 px-2",children:xl()}),o(ge,{children:[t(Ae,{asChild:!0,children:o(S,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted mb-2 border",children:[t("span",{children:f(a)}),t(te,{className:"h-4 w-4 opacity-50"})]})}),t(ye,{className:"w-52",children:["name","created_at","updated_at"].map((n)=>o(W,{onClick:()=>v(n),className:"justify-between",children:[f(n),a===n&&t(Me,{className:"h-4 w-4"})]},n))})]}),o(S,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted border",onClick:l,children:[t("span",{className:"text-muted-foreground",children:a==="name"?p?t(B,{children:Bc()}):t(B,{children:zc()}):p?t(B,{children:Fc()}):t(B,{children:Uc()})}),p?t(Pl,{className:"h-4 w-4 opacity-50"}):t(te,{className:"h-4 w-4 opacity-50"})]})]})]})}C();function Ue(){let{teamId:a}=Oe.useParams(),{canEdit:c,canAdmin:d}=Pt(),v=Re(),l=K(),[f,p]=u(null),[n,b]=u(!1),[k,N]=u("create"),[F,x]=u(void 0),[_,y]=u(!1),[g,M]=u(void 0),[D,P]=u(""),[Y,q]=u(!1),{metadata:G,setMetadata:J}=Lo(),O=`team:${a}:projects:sort`,m=G[O],[j,z]=u(()=>m?.sortBy||"name"),[I,i]=u(()=>m?.sortDirection||"asc");h(()=>{if(m?.sortBy&&m.sortBy!==j)z(m.sortBy);if(m?.sortDirection&&m.sortDirection!==I)i(m.sortDirection)},[m]);let s=A.api.teams[":teamId"].projects.$get,{data:ee}=Z({queryKey:["teams",a,"projects",j,I],queryFn:async()=>{let e=await s({param:{teamId:a},query:{sortBy:j,sortDirection:I}});if(!e.ok)throw Error("Failed to fetch projects");return await e.json()},placeholderData:wi}),{data:oe}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let e=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!e.ok)throw Error("Failed to fetch members");return await e.json()}}),{data:re}=Z({queryKey:["teams",a,"me"],queryFn:async()=>{let e=await A.api.teams[":teamId"].me.$get({param:{teamId:a}});if(!e.ok)throw Error("Failed to fetch me");return await e.json()}}),ce=A.api.teams[":teamId"].invite.$post,ve=U({mutationFn:async(e)=>{let r=await ce(e);if(!r.ok)throw Error("Failed to invite");return await r.json()}}),Q=U({mutationFn:async(e)=>{if(!(await A.api.projects[":projectId"].$delete({param:{projectId:e}})).ok)throw Error("Failed to delete project")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]})}}),he=U({mutationFn:async(e)=>{let r=await A.api.projects[":projectId"].$put({param:{projectId:e.id},json:{enableNotification:!e.enableNotification}});if(!r.ok)throw Error("Failed to update project notification settings");return await r.json()},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]}),R.success(ES())},onError:(e)=>{R.error(e instanceof Error?e.message:Ib())}}),ae=()=>{N("create"),x(void 0),b(!0)},be=()=>{p("create"),setTimeout(()=>{p(null)},100),setTimeout(()=>{ae()},200)},we=(e)=>{N("edit"),x(e),b(!0)},xe=(e)=>{M(e),P(""),y(!0)},Ne=async()=>{if(g&&D==="delete")try{await Q.mutateAsync(g.id),y(!1)}catch(e){console.error(e)}},je=(e,r)=>{if(r.detail>1)return;p(e),setTimeout(()=>{p(null)},100),setTimeout(()=>{v({to:"/projects/$projectId",params:{projectId:e}})},200)},Ce=async(e)=>(await ve.mutateAsync({param:{teamId:a},json:{role:e}})).code,_e=U({mutationFn:async({userId:e,role:r})=>{if(!(await A.api.teams[":teamId"].members[":userId"].$patch({param:{teamId:a,userId:e},json:{role:r}})).ok)throw Error("Failed to update member role")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),Pe=U({mutationFn:async(e)=>{if(!(await A.api.teams[":teamId"].members[":userId"].$delete({param:{teamId:a,userId:e}})).ok)throw Error("Failed to remove member")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),Be=(e)=>{if(!e)return"??";return e.split(" ").map((r)=>r[0]).slice(0,2).join("").toUpperCase()},Se=(e,r)=>{z(e),i(r),J(a,O,{sortBy:e,sortDirection:r})},X=Array.isArray(oe)?oe:[];return o("div",{className:"flex-1 overflow-y-auto p-4",children:[o("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-4",children:[t("h1",{className:"text-2xl font-bold",children:TS()}),o("div",{className:"flex flex-wrap items-center gap-4",children:[o("div",{className:"flex items-center -space-x-2 cursor-pointer hover:opacity-90",onClick:()=>q(!0),"data-testid":"team-members-trigger",children:[X.slice(0,3).map((e)=>o(Ee,{className:"border-2 border-background w-8 h-8",children:[e.image&&t(Ie,{src:e.image,alt:e.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:Be(e.name)})]},e.id)),X.length>3&&o("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border-2 border-background bg-muted text-[10px] font-medium",children:["+",X.length-3]})]}),t(le,{sortBy:j,sortDirection:I,onSortChange:Se}),c&&o(S,{className:"bg-orange-600 hover:bg-orange-700 text-white gap-2",onClick:ae,children:[t(fe,{className:"w-4 h-4"}),_f()]})]})]}),o("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:[ee?.data?.map((e)=>t("div",{className:E("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out",f===e.id?"scale-95":"scale-100"),onClick:(r)=>je(e.id,r),children:o("div",{className:"flex flex-col",children:[o("div",{className:"relative w-full h-full aspect-square flex items-center justify-center bg-zinc-400/20",children:[e.coverImage?t("img",{src:e.coverImage,alt:e.name,className:"w-full h-full object-cover rounded"}):o("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:[t("polygon",{fill:"#FC9F8E",points:"0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6"}),t("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"}),t("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"}),t("polygon",{fill:"#EC5B6C",points:"0 76.0 0 164.7 151.69 164.7"}),t("polygon",{fill:"#E85C71",points:"180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6"}),t("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"}),t("polygon",{fill:"#FFCCBE",points:"90.53 51.6 63.69 68.1 90.53 83.4"}),t("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"}),t("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"}),t("polygon",{fill:"#FFCFB5",points:"64.02 99.3 90.53 114.9 90.53 83.4"}),t("path",{fill:"#F67D73",d:"M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z"}),t("path",{fill:"#F26560",d:"M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z"}),t("polygon",{fill:"#EB5F5B",points:"80.08 67.5 90.53 73.5 90.53 61.3"}),t("polygon",{fill:"#DB4D50",points:"90.53 61.3 90.53 73.5 100.87 67.4"})]}),t("div",{className:"absolute bottom-0 left-0 w-full h-[65%] bg-linear-to-t from-black/35 to-black/0"}),t("p",{className:"absolute left-1 bottom-2 text-white",children:e.name})]}),o("div",{className:"px-2 h-10 flex justify-between items-center",children:[o("p",{className:"truncate pr-1 text-xs text-muted-foreground",children:[NI()," ",Vg(e.updatedAt??"")]}),t("div",{onClick:(r)=>r.stopPropagation(),children:o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:t("button",{className:"hover:bg-muted outline-none flex px-1",children:t(cr,{className:"w-5 h-5 text-muted-foreground"})})}),o(ye,{align:"end",children:[c&&t(W,{onClick:(r)=>{r.stopPropagation(),we(e)},children:Yh()}),o(W,{className:"flex items-center justify-between gap-4 cursor-pointer",onSelect:(r)=>{r.preventDefault(),he.mutate(e)},children:[t("span",{children:xx()}),t(qe,{checked:e.enableNotification??!0,className:"pointer-events-none"})]}),d&&t(W,{className:"text-destructive focus:text-destructive",onClick:()=>xe(e),children:at()})]})]})})]})]})},e.id)),c&&t("div",{className:E("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",f==="create"?"scale-95":"scale-100"),onClick:be,children:o("div",{className:"flex flex-col",children:[t("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:t(fe,{className:"w-8 h-8 text-zinc-400 group-hover:text-orange-600 transition-colors"})}),t("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:t("p",{className:"text-sm text-muted-foreground group-hover:text-orange-600 transition-colors",children:_f()})})]})})]}),t(ie,{open:n,onOpenChange:b,mode:k,teamId:a,project:F}),t(Je,{open:_,onOpenChange:y,children:o(Xe,{children:[o(et,{children:[t(rt,{children:My()}),o(nt,{children:[y_({name:g?.name??""}),o("div",{className:"mt-4 flex flex-col gap-2 text-foreground",children:[t("span",{className:"text-sm font-medium",children:RI()}),t(H,{value:D,onChange:(e)=>P(e.target.value),placeholder:A_(),className:"h-9",autoFocus:!0})]})]})]}),o(tt,{children:[t(st,{disabled:Q.isPending,children:ke()}),t(ot,{onClick:(e)=>{e.preventDefault(),Ne()},disabled:D!=="delete"||Q.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Q.isPending?E_():at()})]})]})}),t(Fl,{open:Y,onOpenChange:q,title:eI(),type:"team",members:X,isOwner:re?.role==="owner",onInvite:Ce,onUpdateRole:async(e,r)=>{await _e.mutateAsync({userId:e,role:r})},onRemoveMember:async(e)=>{await Pe.mutateAsync(e)},currentUserId:re?.id})]})}var Oe=Fe("/teams/$teamId/")({component:Ue});export{Oe as Route};
|
|
1
|
+
import{h,b,u,S,Z,t,o,K,Si,L,B,Me,Ue,A,I,rr,F,ke,pe,Re,C,E,Ce,Ie,Te,he,ge,Ae,W,vA,wA,U0,Ne,k_,V_,Y_,Sf,it,Ty,My,Ly,gb,Bb,Ub,Zc,Xv,Ox,TS,RS,OS,FS,LS,ZS,BS,lg,US,kE,Us,zc,Cl,UC,Il,jc,qc,jC,Hc,HC,g1,G1,K1,Y1,J1,Bp,Up,Je,Xe,et,tt,rt,nt,ot,st,ue,ie,me,Ge,le,Tt,H,Pt,k,sA,Q,je,hr}from"./chunk-jh8q3885.js";import{ql}from"./chunk-vzj2j11x.js";import{Ol}from"./chunk-2qjfpmcf.js";import{fi}from"./chunk-teqprbd8.js";import{lo}from"./chunk-yfr0hzb7.js";import{sn}from"./chunk-6y4xkcte.js";import"./chunk-3d5rm1d1.js";var Se=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],te=I("arrow-down-wide-narrow",Se);var $e=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],se=I("sliders-vertical",$e);S();function ce({open:a,onOpenChange:c,mode:d,teamId:v,project:l}){let f=K(),p=Me(),[n,w]=u(""),[M,N]=u(!0),[q,x]=u(void 0),[P,y]=u(void 0),[g,T]=u(!1),D=b(null);h(()=>{if(a)if(d==="edit"&&l)w(l.name||""),x(l.coverImageKey),y(l.coverImage),N(l.enableNotification!==!1);else w(""),x(void 0),y(void 0),N(!0)},[a,d,l]);let R=A.api.teams[":teamId"].projects.$post,{mutate:Y}=B({mutationFn:async(i)=>{let s=await R({param:{teamId:v},json:i});if(!s.ok)throw Error(gb());return await s.json()},onSuccess:(i)=>{f.invalidateQueries({queryKey:["teams",v,"projects"]}),c(!1);let s=i;if(s&&typeof s.id==="string")p({to:"/projects/$projectId",params:{projectId:s.id}})}}),U=A.api.projects[":projectId"].$put,{mutate:G}=B({mutationFn:async(i)=>{let s=await U({param:{projectId:l.id},json:i});if(!s.ok)throw Error(Bb());return await s.json()},onSuccess:()=>{f.invalidateQueries({queryKey:["teams",v,"projects"]}),c(!1)}}),J=A.api.teams[":teamId"].files.$post,{mutate:O}=B({mutationFn:async({file:i})=>{let s=await J({param:{teamId:v},form:{file:i}});if(!s.ok)throw Error(Zc());return await s.json()},onSuccess:(i)=>{let s=i;if(s&&typeof s.key==="string")x(s.key);T(!1)},onError:()=>{T(!1)}}),m=(i)=>{let s=i.target.files?.[0];if(s){T(!0);let ee=URL.createObjectURL(s);y(ee),O({file:s})}},j=()=>{D.current?.click()},z=(i)=>{i.stopPropagation(),x(void 0),y(void 0)},_=()=>{if(!n.trim())return;if(d==="create")Y({name:n.trim(),coverImageKey:q,enableNotification:M});else if(d==="edit"&&l?.id)G({name:n.trim(),coverImageKey:q,enableNotification:M})};return t(ue,{open:a,onOpenChange:c,children:o(ie,{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:[o(me,{className:"relative overflow-hidden bg-gradient-to-br from-primary/5 to-transparent p-6 border-b border-border/40",children:[t("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/10 rounded-full blur-2xl pointer-events-none"}),t("div",{className:"absolute bottom-0 left-10 w-32 h-12 bg-primary/5 rounded-full blur-xl pointer-events-none"}),t("div",{className:"flex items-center gap-3",children:o("div",{children:[t(le,{className:"text-xl font-semibold tracking-tight text-foreground",children:d==="create"?Y_():lg()}),t(Tt,{className:"text-xs text-muted-foreground/80 mt-1",children:d==="create"?k_():Xv()})]})})]}),o("div",{className:"space-y-6 p-6 max-h-[75vh] overflow-y-auto",children:[o("div",{className:"space-y-2",children:[t(Q,{htmlFor:"name",className:"text-sm font-semibold tracking-tight text-foreground",children:OS()}),o("div",{className:"relative",children:[t(H,{id:"name",value:n,onChange:(i)=>w(i.target.value),placeholder:LS(),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"}),n.trim()&&t("div",{className:"absolute inset-y-0 right-3 flex items-center",children:t(ke,{className:"w-4 h-4 text-primary"})})]}),t("p",{className:"text-[11px] text-muted-foreground",children:FS()})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o("div",{className:"flex items-center justify-between",children:[o(Q,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(sn,{className:"w-4 h-4 text-primary"}),RS()]}),P&&o("button",{type:"button",onClick:z,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:[t(Re,{className:"w-3.5 h-3.5"}),kE()]})]}),o("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:j,children:[t("input",{type:"file",ref:D,className:"hidden",accept:"image/*",onChange:m}),g&&t("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:o("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[t(F,{className:"w-4 h-4 animate-spin text-primary"}),t("span",{className:"text-xs font-semibold text-foreground",children:Up()})]})}),P?o(Z,{children:[t("img",{src:P,alt:V_(),className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),o("div",{className:"absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-center gap-1.5 text-white z-10",children:[t(lo,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),t("span",{className:"text-xs font-semibold",children:Bp()})]})]}):o("div",{className:"flex flex-col items-center gap-2 text-center p-4",children:[t("div",{className:"p-2.5 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:t(lo,{className:"w-4 h-4 text-muted-foreground"})}),o("div",{children:[t("p",{className:"text-xs font-medium text-foreground",children:Y1()}),t("p",{className:"text-[11px] text-muted-foreground mt-0.5 max-w-[140px] mx-auto leading-normal",children:J1()})]})]})]})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o(Q,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(se,{className:"w-4 h-4 text-primary"}),BS()]}),o("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:[o("div",{className:"space-y-1 pr-4",children:[o("div",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[t(fi,{className:"w-4 h-4 text-primary"}),vA()]}),t("p",{className:"text-xs text-muted-foreground leading-normal",children:wA()})]}),t(je,{checked:M,onCheckedChange:N,disabled:g,className:"mt-0.5"})]})]})]}),o(Ge,{className:"flex items-center justify-end gap-3 px-6 py-4 bg-muted/20 border-t border-border/40",children:[t(E,{type:"button",variant:"ghost",onClick:()=>c(!1),disabled:g,className:"rounded-xl h-10 px-4 hover:bg-muted font-medium text-sm text-muted-foreground hover:text-foreground transition-colors",children:Ne()}),t(E,{type:"submit",onClick:_,disabled:!n.trim()||g,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:g?o(Z,{children:[t(F,{className:"w-4 h-4 animate-spin"}),TS()]}):d==="create"?Sf():Us()})]})]})})}function de({sortBy:a,sortDirection:c,onSortChange:d}){let v=(n)=>{d(n,c)},l=()=>{d(a,c==="asc"?"desc":"asc")},f=(n)=>{switch(n){case"name":return Il();case"created_at":return UC();case"updated_at":return jC();default:return n}},p=c==="asc";return o(he,{children:[t(ge,{asChild:!0,children:o(E,{variant:"outline",className:"gap-2 bg-muted/50",children:[t("span",{className:"text-muted-foreground",children:HC()}),t("span",{className:"font-medium text-foreground",children:f(a)})]})}),o(Ae,{align:"end",className:"w-56 p-2",children:[t("div",{className:"text-xs font-semibold text-muted-foreground mb-2 px-2",children:Cl()}),o(he,{children:[t(ge,{asChild:!0,children:o(E,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted mb-2 border",children:[t("span",{children:f(a)}),t(te,{className:"h-4 w-4 opacity-50"})]})}),t(Ae,{className:"w-52",children:["name","created_at","updated_at"].map((n)=>o(W,{onClick:()=>v(n),className:"justify-between",children:[f(n),a===n&&t(ke,{className:"h-4 w-4"})]},n))})]}),o(E,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted border",onClick:l,children:[t("span",{className:"text-muted-foreground",children:a==="name"?p?t(Z,{children:zc()}):t(Z,{children:Hc()}):p?t(Z,{children:qc()}):t(Z,{children:jc()})}),p?t(Ol,{className:"h-4 w-4 opacity-50"}):t(te,{className:"h-4 w-4 opacity-50"})]})]})]})}S();function Le(){let{teamId:a}=Ke.useParams(),{canEdit:c,canAdmin:d}=Pt(),v=Me(),l=K(),[f,p]=u(null),[n,w]=u(!1),[M,N]=u("create"),[q,x]=u(void 0),[P,y]=u(!1),[g,T]=u(void 0),[D,R]=u(""),[Y,U]=u(!1),{metadata:G,setMetadata:J}=hr(),O=`team:${a}:projects:sort`,m=G[O],[j,z]=u(()=>m?.sortBy||"name"),[_,i]=u(()=>m?.sortDirection||"asc");h(()=>{if(m?.sortBy&&m.sortBy!==j)z(m.sortBy);if(m?.sortDirection&&m.sortDirection!==_)i(m.sortDirection)},[m]);let s=A.api.teams[":teamId"].projects.$get,{data:ee}=L({queryKey:["teams",a,"projects",j,_],queryFn:async()=>{let e=await s({param:{teamId:a},query:{sortBy:j,sortDirection:_}});if(!e.ok)throw Error("Failed to fetch projects");return await e.json()},placeholderData:Si}),{data:oe}=L({queryKey:["teams",a,"members"],queryFn:async()=>{let e=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!e.ok)throw Error("Failed to fetch members");return await e.json()}}),{data:re}=L({queryKey:["teams",a,"me"],queryFn:async()=>{let e=await A.api.teams[":teamId"].me.$get({param:{teamId:a}});if(!e.ok)throw Error("Failed to fetch me");return await e.json()}}),fe=A.api.teams[":teamId"].invite.$post,ve=B({mutationFn:async(e)=>{let r=await fe(e);if(!r.ok)throw Error("Failed to invite");return await r.json()}}),V=B({mutationFn:async(e)=>{if(!(await A.api.projects[":projectId"].$delete({param:{projectId:e}})).ok)throw Error("Failed to delete project")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]})}}),ye=B({mutationFn:async(e)=>{let r=await A.api.projects[":projectId"].$put({param:{projectId:e.id},json:{enableNotification:!e.enableNotification}});if(!r.ok)throw Error("Failed to update project notification settings");return await r.json()},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]}),k.success(ZS())},onError:(e)=>{k.error(e instanceof Error?e.message:Ub())}}),ae=()=>{N("create"),x(void 0),w(!0)},be=()=>{p("create"),setTimeout(()=>{p(null)},100),setTimeout(()=>{ae()},200)},we=(e)=>{N("edit"),x(e),w(!0)},xe=(e)=>{T(e),R(""),y(!0)},De=async()=>{if(g&&D==="delete")try{await V.mutateAsync(g.id),y(!1)}catch(e){console.error(e)}},_e=(e,r)=>{if(r.detail>1)return;p(e),setTimeout(()=>{p(null)},100),setTimeout(()=>{v({to:"/projects/$projectId",params:{projectId:e}})},200)},Fe=async(e)=>(await ve.mutateAsync({param:{teamId:a},json:{role:e}})).code,Pe=B({mutationFn:async({userId:e,role:r})=>{if(!(await A.api.teams[":teamId"].members[":userId"].$patch({param:{teamId:a,userId:e},json:{role:r}})).ok)throw Error("Failed to update member role")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),Ee=B({mutationFn:async(e)=>{if(!(await A.api.teams[":teamId"].members[":userId"].$delete({param:{teamId:a,userId:e}})).ok)throw Error("Failed to remove member")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),qe=(e)=>{if(!e)return"??";return e.split(" ").map((r)=>r[0]).slice(0,2).join("").toUpperCase()},Be=(e,r)=>{z(e),i(r),J(a,O,{sortBy:e,sortDirection:r})},X=Array.isArray(oe)?oe:[];return o("div",{className:"flex-1 overflow-y-auto p-4",children:[o("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-4",children:[t("h1",{className:"text-2xl font-bold",children:US()}),o("div",{className:"flex flex-wrap items-center gap-4",children:[o("div",{className:"flex items-center -space-x-2 cursor-pointer hover:opacity-90",onClick:()=>U(!0),"data-testid":"team-members-trigger",children:[X.slice(0,3).map((e)=>o(Ce,{className:"border-2 border-background w-8 h-8",children:[e.image&&t(Ie,{src:e.image,alt:e.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:qe(e.name)})]},e.id)),X.length>3&&o("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border-2 border-background bg-muted text-[10px] font-medium",children:["+",X.length-3]})]}),t(de,{sortBy:j,sortDirection:_,onSortChange:Be}),c&&o(E,{className:"bg-orange-600 hover:bg-orange-700 text-white gap-2",onClick:ae,children:[t(pe,{className:"w-4 h-4"}),Sf()]})]})]}),o("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:[ee?.data?.map((e)=>t("div",{className:C("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out",f===e.id?"scale-95":"scale-100"),onClick:(r)=>_e(e.id,r),children:o("div",{className:"flex flex-col",children:[o("div",{className:"relative w-full h-full aspect-square flex items-center justify-center bg-zinc-400/20",children:[e.coverImage?t("img",{src:e.coverImage,alt:e.name,className:"w-full h-full object-cover rounded"}):o("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:[t("polygon",{fill:"#FC9F8E",points:"0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6"}),t("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"}),t("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"}),t("polygon",{fill:"#EC5B6C",points:"0 76.0 0 164.7 151.69 164.7"}),t("polygon",{fill:"#E85C71",points:"180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6"}),t("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"}),t("polygon",{fill:"#FFCCBE",points:"90.53 51.6 63.69 68.1 90.53 83.4"}),t("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"}),t("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"}),t("polygon",{fill:"#FFCFB5",points:"64.02 99.3 90.53 114.9 90.53 83.4"}),t("path",{fill:"#F67D73",d:"M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z"}),t("path",{fill:"#F26560",d:"M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z"}),t("polygon",{fill:"#EB5F5B",points:"80.08 67.5 90.53 73.5 90.53 61.3"}),t("polygon",{fill:"#DB4D50",points:"90.53 61.3 90.53 73.5 100.87 67.4"})]}),t("div",{className:"absolute bottom-0 left-0 w-full h-[65%] bg-linear-to-t from-black/35 to-black/0"}),t("p",{className:"absolute left-1 bottom-2 text-white",children:e.name})]}),o("div",{className:"px-2 h-10 flex justify-between items-center",children:[o("p",{className:"truncate pr-1 text-xs text-muted-foreground",children:[K1()," ",sA(e.updatedAt??"")]}),t("div",{onClick:(r)=>r.stopPropagation(),children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t("button",{className:"hover:bg-muted outline-none flex px-1",children:t(rr,{className:"w-5 h-5 text-muted-foreground"})})}),o(Ae,{align:"end",children:[c&&t(W,{onClick:(r)=>{r.stopPropagation(),we(e)},children:lg()}),o(W,{className:"flex items-center justify-between gap-4 cursor-pointer",onSelect:(r)=>{r.preventDefault(),ye.mutate(e)},children:[t("span",{children:Ox()}),t(je,{checked:e.enableNotification??!0,className:"pointer-events-none"})]}),d&&t(W,{className:"text-destructive focus:text-destructive",onClick:()=>xe(e),children:it()})]})]})})]})]})},e.id)),c&&t("div",{className:C("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",f==="create"?"scale-95":"scale-100"),onClick:be,children:o("div",{className:"flex flex-col",children:[t("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:t(pe,{className:"w-8 h-8 text-zinc-400 group-hover:text-orange-600 transition-colors"})}),t("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:t("p",{className:"text-sm text-muted-foreground group-hover:text-orange-600 transition-colors",children:Sf()})})]})})]}),t(ce,{open:n,onOpenChange:w,mode:M,teamId:a,project:q}),t(Je,{open:P,onOpenChange:y,children:o(Xe,{children:[o(et,{children:[t(rt,{children:U0()}),o(nt,{children:[My({name:g?.name??""}),o("div",{className:"mt-4 flex flex-col gap-2 text-foreground",children:[t("span",{className:"text-sm font-medium",children:G1()}),t(H,{value:D,onChange:(e)=>R(e.target.value),placeholder:Ty(),className:"h-9",autoFocus:!0})]})]})]}),o(tt,{children:[t(st,{disabled:V.isPending,children:Ne()}),t(ot,{onClick:(e)=>{e.preventDefault(),De()},disabled:D!=="delete"||V.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:V.isPending?Ly():it()})]})]})}),t(ql,{open:Y,onOpenChange:U,title:g1(),type:"team",members:X,isOwner:re?.role==="owner",onInvite:Fe,onUpdateRole:async(e,r)=>{await Pe.mutateAsync({userId:e,role:r})},onRemoveMember:async(e)=>{await Ee.mutateAsync(e)},currentUserId:re?.id})]})}var Ke=Ue("/teams/$teamId/")({component:Le});export{Ke as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{I}from"./chunk-jh8q3885.js";var t=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Bi=I("list-todo",t);
|
|
2
|
+
export{Bi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{We}from"./chunk-s05cdax2.js";import{lr}from"./chunk-p75f5pgq.js";import"./chunk-9trnkbtr.js";import{Fa}from"./chunk-5vvvgjvz.js";import{La,Za}from"./chunk-dscq4a4k.js";import{Ks,Ws,Ys}from"./chunk-sab7tjxw.js";import{os}from"./chunk-apfrw0wd.js";import{wn,xn}from"./chunk-qgkbxw1k.js";import{ss}from"./chunk-hs2r9qaw.js";import{Qn,Cr}from"./chunk-pdh9bnyj.js";import{ln}from"./chunk-gc6m7agb.js";import{Hr}from"./chunk-1bgsphyz.js";import{Yt}from"./chunk-b3aqmcps.js";var O=new Set(["openai","openai-codex","opencode"]),E=16;function h(e,o){if(!e)return!1;let r=o.toLowerCase();for(let[t,s]of Object.entries(e))if(t.toLowerCase()===r&&s!==null&&s.trim().length>0)return!0;return!1}function g(e,o,r){if(o)return o;if(h(r,"authorization")||h(r,"cf-aig-authorization"))return"unused";throw Error(`No API key for provider: ${e}`)}function I(e){return e.provider==="openrouter"||e.baseUrl.includes("openrouter.ai")?"openrouter":"openai"}function R(e,o){if(e)return e;if(lr("PI_CACHE_RETENTION",o)==="long")return"long";return"short"}function m(e){return{supportsDeveloperRole:e.compat?.supportsDeveloperRole??!0,sessionAffinityFormat:e.compat?.sessionAffinityFormat??I(e),supportsLongCacheRetention:e.compat?.supportsLongCacheRetention??!0,supportsStrictMode:e.compat?.supportsStrictMode??!1,supportsOpenAIGrammarTools:e.compat?.supportsOpenAIGrammarTools??!1,supportsToolSearch:e.compat?.supportsToolSearch??!1,supportsExplicitPromptCacheMode:e.compat?.supportsExplicitPromptCacheMode??!1}}function P(e,o){return o==="long"&&e.supportsLongCacheRetention?"24h":void 0}function S(e){return xn(wn(e),"OpenAI API error")}var C=(e,o,r)=>{let t=new Yt;return(async()=>{let s={role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let i=g(e.provider,r?.apiKey,r?.headers),c=R(r?.cacheRetention,r?.env)==="none"?void 0:r?.sessionId,p=m(e),a=Qn(o.tools,p.supportsOpenAIGrammarTools),u=w(e,o,i,r?.headers,c),f=M(e,o,r,p,a),l=await r?.onPayload?.(f,e);if(l!==void 0)f=l;let v={...r?.signal?{signal:r.signal}:{},...r?.timeoutMs!==void 0?{timeout:r.timeoutMs}:{},maxRetries:0},{data:y,response:d}=await ss(()=>u.responses.create(f,v).withResponse(),{maxRetries:r?.maxRetries,maxRetryDelayMs:r?.maxRetryDelayMs,signal:r?.signal});if(await r?.onResponse?.({status:d.status,headers:ln(d.headers)},e),t.push({type:"start",partial:s}),await Ys(y,s,t,e,{serviceTier:r?.serviceTier,grammarToolInputProperties:a,applyServiceTierPricing:(T,A)=>b(T,A,e)}),r?.signal?.aborted)throw Error("Request was aborted");if(s.stopReason==="aborted"||s.stopReason==="error")throw Error("An unknown error occurred");t.push({type:"done",reason:s.stopReason,message:s}),t.end()}catch(i){for(let n of s.content)delete n.index,delete n.partialJson,delete n.customInput;s.stopReason=r?.signal?.aborted?"aborted":"error",s.errorMessage=S(i),t.push({type:"error",reason:s.stopReason,error:s}),t.end()}})(),t},z=(e,o,r)=>{g(e.provider,r?.apiKey,r?.headers);let t=Cr(e,o,r,r?.apiKey),s=r?.reasoning?Hr(e,r.reasoning):void 0;return C(e,o,{...t,reasoningEffort:s==="off"?void 0:s})};function w(e,o,r,t,s){let i=m(e),n={...e.headers};if(e.provider==="github-copilot"){let c=La(o.messages),p=Za({messages:o.messages,hasImages:c});Object.assign(n,p)}if(s)if(i.sessionAffinityFormat==="openrouter")n["x-session-id"]=s;else{if(i.sessionAffinityFormat==="openai")n.session_id=s;n["x-client-request-id"]=s}if(t)Object.assign(n,t);return new We({apiKey:r,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:n})}function M(e,o,r,t=m(e),s=Qn(o.tools,t.supportsOpenAIGrammarTools)){let i=Fa(o,t.supportsToolSearch),n=Ks(e,o,O,{grammarToolInputProperties:s,deferredTools:i.deferred,toolOptions:{supportsStrictMode:t.supportsStrictMode,supportsOpenAIGrammarTools:t.supportsOpenAIGrammarTools}}),c=R(r?.cacheRetention,r?.env),p=c==="none"&&t.supportsExplicitPromptCacheMode,a={model:e.id,input:n,stream:!0,prompt_cache_key:c==="none"?void 0:os(r?.sessionId),prompt_cache_retention:P(t,c),prompt_cache_options:p?{mode:"explicit"}:void 0,store:!1};if(r?.maxTokens)a.max_output_tokens=Math.max(r.maxTokens,E);if(r?.temperature!==void 0)a.temperature=r?.temperature;if(r?.serviceTier!==void 0)a.service_tier=r.serviceTier;if(i.immediate.length>0)a.tools=Ws(i.immediate,{supportsStrictMode:t.supportsStrictMode,supportsOpenAIGrammarTools:t.supportsOpenAIGrammarTools});if(r?.toolChoice!==void 0)a.tool_choice=r.toolChoice;if(e.reasoning){if(r?.reasoningEffort||r?.reasoningSummary){let u=r?.reasoningEffort?e.thinkingLevelMap?.[r.reasoningEffort]??r.reasoningEffort:"medium";a.reasoning={effort:u,summary:r?.reasoningSummary||"auto"},a.include=["reasoning.encrypted_content"]}else if(e.provider!=="github-copilot"&&e.thinkingLevelMap?.off!==null)a.reasoning={effort:e.thinkingLevelMap?.off??"none"};if(e.provider==="xai")a.include=["reasoning.encrypted_content"]}return a}function _(e,o){switch(o){case"flex":return 0.5;case"priority":return e.id==="gpt-5.5"?2.5:2;default:return 1}}function b(e,o,r){let t=_(r,o);if(t===1)return;e.cost.input*=t,e.cost.output*=t,e.cost.cacheRead*=t,e.cost.cacheWrite*=t,e.cost.total=e.cost.input+e.cost.output+e.cost.cacheRead+e.cost.cacheWrite}export{C as stream,z as streamSimple};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{I}from"./chunk-jh8q3885.js";var a=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],lo=I("upload",a);
|
|
2
|
+
export{lo};
|