@shumai-one/shumai 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/bin/chunk-071x515q.js +4 -0
  2. package/bin/chunk-0cmx7k4c.js +1 -0
  3. package/bin/{chunk-cqb415s6.js → chunk-0qaq0sp8.js} +2 -2
  4. package/bin/chunk-0qjfahk9.js +2 -0
  5. package/bin/{chunk-9t1ne8xr.js → chunk-0zv3bks2.js} +2 -2
  6. package/bin/chunk-16xax8kk.js +1 -0
  7. package/bin/chunk-1gvscz88.js +5 -0
  8. package/bin/{chunk-6gg1ymer.js → chunk-1j27fzy1.js} +2 -2
  9. package/bin/chunk-1t167cvj.js +11 -0
  10. package/bin/{chunk-pb1zf0vb.js → chunk-1xh34aew.js} +2 -2
  11. package/bin/{chunk-zmv8cg4s.js → chunk-1zwajpwf.js} +3 -3
  12. package/bin/chunk-2w5xqhjm.js +1 -0
  13. package/bin/{chunk-f3ehv01n.js → chunk-3tedzb2j.js} +26 -26
  14. package/bin/{chunk-zehyn6vd.js → chunk-3ttrhqy3.js} +2 -2
  15. package/bin/chunk-3zkasqb8.js +1 -0
  16. package/bin/chunk-453ykvaw.js +2 -0
  17. package/bin/{chunk-3cyrcgm5.js → chunk-4991gz3y.js} +9 -9
  18. package/bin/chunk-4hkkdm2q.js +2 -0
  19. package/bin/chunk-4mjywsj8.js +3 -0
  20. package/bin/{chunk-cnxwmycy.js → chunk-4v41a1r9.js} +3 -3
  21. package/bin/{chunk-87zxtf66.js → chunk-4wy87hwd.js} +2 -2
  22. package/bin/{chunk-sfx2588q.js → chunk-579e4wv4.js} +2 -2
  23. package/bin/{chunk-1yacmegc.js → chunk-5adsx8x4.js} +2 -2
  24. package/bin/{chunk-b235azv4.js → chunk-5hg6kcfz.js} +13 -13
  25. package/bin/{chunk-rbj4fad9.js → chunk-5nm2jvg5.js} +13 -13
  26. package/bin/chunk-5tcdwep5.js +11 -0
  27. package/bin/chunk-5vzrpz50.js +2 -0
  28. package/bin/chunk-6ghcj4a9.js +3 -0
  29. package/bin/{chunk-b9yrw9et.js → chunk-77fmkpdz.js} +4 -4
  30. package/bin/chunk-7bcxj1jd.js +2 -0
  31. package/bin/{chunk-qf24e71w.js → chunk-7gmdnsdg.js} +1 -1
  32. package/bin/{chunk-fxswt9hc.js → chunk-7jtmwt5a.js} +2 -2
  33. package/bin/chunk-7kjgvxqa.js +2 -0
  34. package/bin/{chunk-bay038pj.js → chunk-7pw1550a.js} +2 -2
  35. package/bin/chunk-7rhz2gze.js +211 -0
  36. package/bin/chunk-837fky18.js +3 -0
  37. package/bin/chunk-84as6x83.js +1 -0
  38. package/bin/chunk-8e28hcny.js +2 -0
  39. package/bin/{chunk-k7hss0bd.js → chunk-914bp49r.js} +3 -3
  40. package/bin/chunk-97f2af6d.js +12 -0
  41. package/bin/{chunk-4r81ghg8.js → chunk-98715kc3.js} +2 -2
  42. package/bin/chunk-9ccw540k.js +2 -0
  43. package/bin/{chunk-ag6p3mbf.js → chunk-9t8n2des.js} +2 -2
  44. package/bin/chunk-9ybt6vbm.js +1 -0
  45. package/bin/{chunk-f15qyp41.js → chunk-a6gx7f5q.js} +1 -1
  46. package/bin/chunk-avwgktxb.js +2 -0
  47. package/bin/chunk-bkr5zm4h.js +2 -0
  48. package/bin/{chunk-2yxj593j.js → chunk-cbgq517y.js} +2 -2
  49. package/bin/chunk-d27mm390.js +1 -0
  50. package/bin/{chunk-185qefn1.js → chunk-dj92fss9.js} +2 -2
  51. package/bin/{chunk-v9w25rp2.js → chunk-dqxeztfa.js} +2 -2
  52. package/bin/chunk-drepsbb4.js +2 -0
  53. package/bin/chunk-f6svp4dp.js +2 -0
  54. package/bin/{chunk-q2bvyv39.js → chunk-fahk9h62.js} +2 -2
  55. package/bin/{chunk-v9b3w8q5.js → chunk-fb40xxz3.js} +2 -2
  56. package/bin/chunk-fnmwksnb.js +3 -0
  57. package/bin/chunk-fpc4p0j8.js +3 -0
  58. package/bin/{chunk-aqbrzx9z.js → chunk-fsyzs0tf.js} +1 -1
  59. package/bin/{chunk-e2mvmq2m.js → chunk-fxecgp5k.js} +1 -1
  60. package/bin/{chunk-wfzqnpc1.js → chunk-g3fpmyyn.js} +2 -2
  61. package/bin/{chunk-ehc9adfz.js → chunk-gc5sbfa5.js} +2 -2
  62. package/bin/chunk-gdm6yfqq.js +2 -0
  63. package/bin/{chunk-ea79xnn3.js → chunk-gk2q9a3f.js} +2 -2
  64. package/bin/{chunk-jje8nj8h.js → chunk-gt4csat6.js} +2 -2
  65. package/bin/chunk-gye8gabk.js +2 -0
  66. package/bin/{chunk-wry2hvrq.js → chunk-hk5rc6cd.js} +2 -2
  67. package/bin/{chunk-zqv0zhfb.js → chunk-hm0dkzed.js} +2 -2
  68. package/bin/chunk-hmpwg5za.js +16 -0
  69. package/bin/{chunk-rpywcvg1.js → chunk-j1tkmcae.js} +2 -2
  70. package/bin/chunk-j2bvj2yn.js +2 -0
  71. package/bin/chunk-jffktpqg.js +1 -0
  72. package/bin/chunk-jgs8an3h.js +18 -0
  73. package/bin/{chunk-8fmy5jtp.js → chunk-jmpb5633.js} +1 -1
  74. package/bin/{chunk-xp59apdb.js → chunk-jrjnqx78.js} +1 -1
  75. package/bin/chunk-k2k9vjq6.js +1 -0
  76. package/bin/{chunk-32pcmaqm.js → chunk-kpgfqkp0.js} +2 -2
  77. package/bin/{chunk-twdxayky.js → chunk-ks8xzc95.js} +2 -2
  78. package/bin/{chunk-qwqvt9v6.js → chunk-kswvyqq1.js} +2 -2
  79. package/bin/{chunk-gk3eqd50.js → chunk-m9pr03kn.js} +2 -2
  80. package/bin/chunk-mfn9qjm4.js +2 -0
  81. package/bin/{chunk-e99dv20z.js → chunk-msfw3jmc.js} +2 -2
  82. package/bin/chunk-mz0yjra0.js +5 -0
  83. package/bin/chunk-nbdw8fen.js +1 -0
  84. package/bin/{chunk-cak32x57.js → chunk-nkdk229f.js} +1 -1
  85. package/bin/chunk-nr20tvnw.js +3 -0
  86. package/bin/{chunk-ck8azecb.js → chunk-pazjhrnf.js} +5 -5
  87. package/bin/chunk-q806pqeh.js +1 -0
  88. package/bin/{chunk-abt0azmv.js → chunk-qka4mkmj.js} +2 -2
  89. package/bin/{chunk-0e4wawpq.js → chunk-qsr1a0rp.js} +1 -1
  90. package/bin/chunk-rchsme43.js +3 -0
  91. package/bin/{chunk-tf28796q.js → chunk-reyxk4bw.js} +1 -1
  92. package/bin/{chunk-av1a8fqp.js → chunk-rhvv1vvk.js} +2 -2
  93. package/bin/{chunk-a32vreya.js → chunk-rq0n0vcc.js} +2 -2
  94. package/bin/chunk-rqf7999q.js +42 -0
  95. package/bin/chunk-rssgmj7x.js +2 -0
  96. package/bin/chunk-ryzz5fht.js +2 -0
  97. package/bin/chunk-s2fnfyn9.js +2 -0
  98. package/bin/{chunk-83e12sjg.js → chunk-s2k4qntr.js} +2 -2
  99. package/bin/{chunk-c007p0t8.js → chunk-snhsjs4x.js} +56 -56
  100. package/bin/{chunk-j8fxp8ej.js → chunk-t2hy6tj9.js} +1 -1
  101. package/bin/chunk-t7nsgg5k.js +4 -0
  102. package/bin/chunk-tm7f32c7.js +14 -0
  103. package/bin/{chunk-2291ehh5.js → chunk-trveq4wg.js} +2 -2
  104. package/bin/chunk-vap4k11j.js +20 -0
  105. package/bin/chunk-vm5fx7td.js +3 -0
  106. package/bin/chunk-vy8gntez.js +1 -0
  107. package/bin/{chunk-awfwk64v.js → chunk-vyzptrea.js} +2 -2
  108. package/bin/{chunk-hfh0c082.js → chunk-w4ghe71n.js} +1 -1
  109. package/bin/chunk-wdsf44hs.js +2 -0
  110. package/bin/chunk-wjyaezs7.js +2 -0
  111. package/bin/{chunk-3a13dcs1.js → chunk-wndm3px3.js} +1 -1
  112. package/bin/chunk-x5jwwvs0.js +1 -0
  113. package/bin/chunk-x92cq59c.js +1 -0
  114. package/bin/{chunk-vgn5zcpv.js → chunk-xa18z1py.js} +2 -2
  115. package/bin/{chunk-4v5n0ayb.js → chunk-xarsrs08.js} +1 -1
  116. package/bin/{chunk-66hsjnw6.js → chunk-xx337zcw.js} +2 -2
  117. package/bin/chunk-xz6713tj.js +2 -0
  118. package/bin/chunk-yfnem6se.js +2 -0
  119. package/bin/{chunk-m7m9d4fb.js → chunk-ytdwk2fq.js} +2 -2
  120. package/bin/{chunk-jy006gcv.js → chunk-ze20rm02.js} +4 -4
  121. package/bin/chunk-zw86wnwe.js +7 -0
  122. package/bin/{chunk-h3tbf521.js → chunk-zxk7q0zk.js} +1 -1
  123. package/bin/shumai-app.html +1 -1
  124. package/bin/shumai-app.js +773 -776
  125. package/package.json +7 -7
  126. package/prisma/migrations/20260907021754_add_asset_upload_id/migration.sql +2 -0
  127. package/prisma/schema.prisma +1 -0
  128. package/bin/chunk-1kw2mbqb.js +0 -1
  129. package/bin/chunk-1wm6ptdx.js +0 -1
  130. package/bin/chunk-2520aq8j.js +0 -2
  131. package/bin/chunk-29zdp63z.js +0 -3
  132. package/bin/chunk-3swpwb9v.js +0 -1
  133. package/bin/chunk-3wmcx2bv.js +0 -2
  134. package/bin/chunk-5a8nt4me.js +0 -1
  135. package/bin/chunk-6bhn1p8v.js +0 -211
  136. package/bin/chunk-70c3xrgd.js +0 -2
  137. package/bin/chunk-7esm0hqb.js +0 -2
  138. package/bin/chunk-7fst8kdw.js +0 -12
  139. package/bin/chunk-8zqgaxvv.js +0 -1
  140. package/bin/chunk-a3dmtt2j.js +0 -1
  141. package/bin/chunk-ce8m4zeg.js +0 -3
  142. package/bin/chunk-e7mqtkzn.js +0 -2
  143. package/bin/chunk-ejbvfj4r.js +0 -1
  144. package/bin/chunk-ekfem7kf.js +0 -1
  145. package/bin/chunk-etwkk0xh.js +0 -1
  146. package/bin/chunk-evrdd32b.js +0 -2
  147. package/bin/chunk-fm6p03ad.js +0 -2
  148. package/bin/chunk-fyha3r13.js +0 -2
  149. package/bin/chunk-g0vs7k2x.js +0 -1
  150. package/bin/chunk-g84z2w7v.js +0 -16
  151. package/bin/chunk-h837fyed.js +0 -2
  152. package/bin/chunk-j20e0qsw.js +0 -7
  153. package/bin/chunk-n1jwdb0a.js +0 -1
  154. package/bin/chunk-p5gf1zdm.js +0 -4
  155. package/bin/chunk-pfgxggaj.js +0 -11
  156. package/bin/chunk-q16490pv.js +0 -2
  157. package/bin/chunk-qh81zhg1.js +0 -1
  158. package/bin/chunk-qwp3kwbz.js +0 -2
  159. package/bin/chunk-qydeqgyj.js +0 -5
  160. package/bin/chunk-r7dty1tg.js +0 -2
  161. package/bin/chunk-rhdxwebf.js +0 -2
  162. package/bin/chunk-rhh716z0.js +0 -42
  163. package/bin/chunk-rza4ae5z.js +0 -3
  164. package/bin/chunk-sk4e6rb1.js +0 -1
  165. package/bin/chunk-t2n1dbgx.js +0 -4
  166. package/bin/chunk-x8f4defx.js +0 -3
  167. package/bin/chunk-z3gkt8w1.js +0 -3
  168. package/bin/chunk-zh6fqq44.js +0 -1
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ss,$o}from"./chunk-vap4k11j.js";import{Go}from"./chunk-1gvscz88.js";import{Qo,mo,kt}from"./chunk-5tcdwep5.js";import{an,nr,He,Jr,Jt,go,jt}from"./chunk-jgs8an3h.js";var{awsEndpointFunctions:De,emitWarningIfUnsupportedVersion:Ne,createDefaultUserAgentProvider:we,NODE_APP_ID_CONFIG_OPTIONS:$e,getAwsRegionExtensionConfiguration:Ue,resolveAwsRegionExtensionConfiguration:Fe,resolveUserAgentConfig:be,resolveHostHeaderConfig:qe,getUserAgentPlugin:Me,getHostHeaderPlugin:Ve,getLoggerPlugin:We,getRecursionDetectionPlugin:Le}=kt(),{NoAuthSigner:ze,getHttpAuthSchemeEndpointRuleSetPlugin:Be,DefaultIdentityProviderConfig:je,getHttpSigningPlugin:Ge}=mo(),{normalizeProvider:se,getSmithyContext:Ke,ServiceException:Xe,NoOpLogger:Qe,emitWarningIfUnsupportedVersion:Ye,loadConfigsForDefaultMode:Je,getDefaultExtensionConfiguration:Ze,resolveDefaultRuntimeConfig:et,Client:ne,makeBuilder:tt,createAggregatedClient:st}=nr(),{Command:nt}=nr();var Fs=nt,bs=ne;var{resolveDefaultsModeConfig:ot,loadConfig:E,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:rt,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:it,NODE_REGION_CONFIG_OPTIONS:at,NODE_REGION_CONFIG_FILE_OPTIONS:ct,resolveRegionConfig:ut}=He(),{BinaryDecisionDiagram:pt,EndpointCache:dt,decideEndpoint:ht,customEndpointFunctions:gt,resolveEndpointConfig:lt,getEndpointPlugin:Et}=Jr(),{parseUrl:mt,getHttpHandlerExtensionConfiguration:At,resolveHttpHandlerRuntimeConfig:_t,getContentLengthPlugin:Ot}=jt(),{DEFAULT_RETRY_MODE:St,NODE_RETRY_MODE_CONFIG_OPTIONS:It,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:Ct,resolveRetryConfig:Rt,getRetryPlugin:vt}=Qo(),{TypeRegistry:oe,getSchemaSerdePlugin:ft}=an(),{resolveAwsSdkSigV4Config:Pt,AwsSdkSigV4Signer:Tt,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:xt}=$o(),{toUtf8:yt,fromUtf8:Dt,toBase64:Nt,fromBase64:wt,calculateBodyLength:$t}=Jt(),{streamCollector:Ut,NodeHttpHandler:Ft}=Go(),{AwsRestJsonProtocol:bt}=Ss(),{Sha256:qt}=go(),Mt=async(e,s,n)=>({operation:Ke(s).operation,region:await se(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Ht(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(s,n)=>({signingProperties:{config:s,context:n}})}}function Vt(e){return{schemeId:"smithy.api#noAuth"}}var Wt=(e)=>{let s=[];switch(e.operation){case"CreateOAuth2Token":{s.push(Vt());break}default:s.push(Ht(e))}return s},Lt=(e)=>{let s=Pt(e);return Object.assign(s,{authSchemePreference:se(e.authSchemePreference??[])})},zt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"signin"}),Bt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},Gt="3.997.43",Kt={version:Gt},h="ref",p=-1,V=!1,m=!0,W="isSet",A="booleanEquals",L="coalesce",w="PartitionResult",u="stringEquals",k="getAttr",z="https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",B={[h]:"Endpoint"},d={fn:k,argv:[{[h]:w},"name"]},re={[h]:"Region"},j={[h]:w},S={authSchemes:[{name:"sigv4",signingName:"signin",signingRegion:"{Region}"}]},r={},G=[re],K={conditions:[[W,G],[A,[{fn:L,argv:[{[h]:"IsControlPlane"},V]},m]],[W,[B]],["aws.partition",G,w],[A,[{[h]:"UseFIPS"},m]],[u,[d,"aws"]],[A,[{fn:L,argv:[{[h]:"IsOAuthEndpoint"},V]},m]],[A,[{[h]:"UseDualStack"},m]],[u,[d,"aws-cn"]],[u,[re,"us-gov-west-1"]],[u,[d,"aws-us-gov"]],[A,[{fn:k,argv:[j,"supportsFIPS"]},m]],[u,[d,"aws-iso"]],[u,[d,"aws-iso-b"]],[u,[d,"aws-iso-f"]],[u,[d,"aws-iso-e"]],[u,[d,"aws-eusc"]],[A,[{fn:k,argv:[j,"supportsDualStack"]},m]]],results:[[p],["https://signin.{Region}.api.aws",S],["https://signin.{Region}.api.amazonwebservices.com.cn",S],[z,S],[p,"FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation."],["https://{Region}.oauth.signin.aws",S],["https://{Region}.signin.aws.amazon.com",r],["https://{Region}.signin.amazonaws.cn",r],["https://{Region}.signin.amazonaws-us-gov.com",r],["https://{Region}.signin.c2shome.ic.gov",r],["https://{Region}.signin.sc2shome.sgov.gov",r],["https://{Region}.signin.csphome.hci.ic.gov",r],["https://{Region}.signin.csphome.adc-e.uk",r],["https://{Region}.signin.amazonaws-eusc.eu",r],["https://signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: FIPS and custom endpoint are not supported"],[p,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[B,r],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",r],[p,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",r],[p,"FIPS is enabled but this partition does not support FIPS"],[z,r],[p,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: Missing Region"]]},Xt=2,t=1e8,Qt=new Int32Array([-1,1,-1,0,6,3,2,36,4,4,5,t+27,6,t+4,t+27,1,29,7,2,36,8,3,9,31,4,22,10,5,19,11,7,21,12,8,t+7,13,10,t+8,14,12,t+9,15,13,t+10,16,14,t+11,17,15,t+12,18,16,t+13,t+16,6,t+5,20,7,21,t+6,17,t+24,t+25,6,t+4,23,7,27,24,9,t+14,25,10,t+15,26,11,t+22,t+23,11,28,t+21,17,t+20,t+21,2,35,30,3,39,31,4,32,t+27,6,t+4,33,7,t+27,34,9,t+14,t+27,3,39,36,4,38,37,7,t+18,t+19,6,t+4,t+17,5,t+1,40,8,t+2,t+3]),Yt=pt.from(Qt,Xt,K.conditions,K.results),Zt=new dt({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),es=(e,s={})=>Zt.get(e,()=>ht(Yt,{endpointParams:e,logger:s.logger}));gt.aws=De;class l extends Xe{constructor(e){super(e);Object.setPrototypeOf(this,l.prototype)}}class C extends l{name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error}}class R extends l{name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,R.prototype),this.error=e.error}}class v extends l{name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error}}class f extends l{name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e});Object.setPrototypeOf(this,f.prototype),this.error=e.error}}var ts="AccessDeniedException",ss="AccessToken",ns="CreateOAuth2Token",os="CreateOAuth2TokenRequest",rs="CreateOAuth2TokenRequestBody",is="CreateOAuth2TokenResponseBody",as="CreateOAuth2TokenResponse",cs="CreateOAuth2TokenWithIAM",us="CreateOAuth2TokenWithIAMRequest",ps="CreateOAuth2TokenWithIAMResponse",ds="InternalServerException",hs="OAuthAccessToken",gs="RefreshToken",ls="TooManyRequestsError",Es="ValidationException",X="accessKeyId",x="accessToken",ms="access_token",U="client",Q="clientId",Y="codeVerifier",As="code",g="error",y="expiresIn",_s="expires_in",D="grantType",Os="grant_type",ie="http",F="httpError",J="idToken",o="jsonName",P="message",Is="resource",I="refreshToken",Z="redirectUri",ae="smithy.ts.sdk.synthetic.com.amazonaws.signin",ee="secretAccessKey",te="sessionToken",Cs="server",Rs="tokenInput",vs="tokenOutput",N="tokenType",fs="token_type",i="com.amazonaws.signin",ce=oe.for(ae),ue=[-3,ae,"SigninServiceException",0,[],[]];ce.registerError(ue,l);var _=oe.for(i),pe=[-3,i,ts,{[g]:U},[g,P],[0,0],2];_.registerError(pe,C);var de=[-3,i,ds,{[g]:Cs,[F]:500},[g,P],[0,0],2];_.registerError(de,R);var he=[-3,i,ls,{[g]:U,[F]:429},[g,P],[0,0],2];_.registerError(he,v);var ge=[-3,i,Es,{[g]:U,[F]:400},[g,P],[0,0],2];_.registerError(ge,f);var le=[ce,_],Ps=[0,i,hs,8,0],Ee=[0,i,gs,8,0],me=[3,i,ss,8,[X,ee,te],[[0,{[o]:X}],[0,{[o]:ee}],[0,{[o]:te}]],3],Ae=[3,i,os,0,[Rs],[[()=>_e,16]],1],_e=[3,i,rs,0,[Q,D,As,Z,Y,I],[[0,{[o]:Q}],[0,{[o]:D}],0,[0,{[o]:Z}],[0,{[o]:Y}],[()=>Ee,{[o]:I}]],2],Oe=[3,i,as,0,[vs],[[()=>Se,16]],1],Se=[3,i,is,0,[x,N,y,I,J],[[()=>me,{[o]:x}],[0,{[o]:N}],[1,{[o]:y}],[()=>Ee,{[o]:I}],[0,{[o]:J}]],4],Ie=[3,i,us,0,[D,Is],[[0,{[o]:Os}],0],2],Ce=[3,i,ps,0,[x,N,y],[[()=>Ps,{[o]:ms}],[0,{[o]:fs}],[1,{[o]:_s}]],3],Re=[9,i,ns,{[ie]:["POST","/v1/token",200]},()=>Ae,()=>Oe],ve=[9,i,cs,{[ie]:["POST","/v1/token?x-amz-client-auth-method=iam",200]},()=>Ie,()=>Ce],Ts=(e)=>({apiVersion:"2023-01-01",base64Decoder:e?.base64Decoder??wt,base64Encoder:e?.base64Encoder??Nt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??es,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Wt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Tt},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ze}],logger:e?.logger??new Qe,protocol:e?.protocol??bt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:le,version:"2023-01-01",serviceTarget:"Signin"},serviceId:e?.serviceId??"Signin",sha256:e?.sha256??qt,urlParser:e?.urlParser??mt,utf8Decoder:e?.utf8Decoder??Dt,utf8Encoder:e?.utf8Encoder??yt}),ks=(e)=>{Ye(process.version);let s=ot(e),n=()=>s().then(Je),c=Ts(e);Ne(process.version);let a={profile:e?.profile,logger:c.logger};return{...c,...e,runtime:"node",defaultsMode:s,authSchemePreference:e?.authSchemePreference??E(xt,a),bodyLengthChecker:e?.bodyLengthChecker??$t,defaultUserAgentProvider:e?.defaultUserAgentProvider??we({serviceId:c.serviceId,clientVersion:Kt.version}),maxAttempts:e?.maxAttempts??E(Ct,e),region:e?.region??E(at,{...ct,...a}),requestHandler:Ft.create(e?.requestHandler??n),retryMode:e?.retryMode??E({...It,default:async()=>(await n()).retryMode||St},e),streamCollector:e?.streamCollector??Ut,useDualstackEndpoint:e?.useDualstackEndpoint??E(it,a),useFipsEndpoint:e?.useFipsEndpoint??E(rt,a),userAgentAppId:e?.userAgentAppId??E($e,a)}},xs=(e)=>{let{httpAuthSchemes:s,httpAuthSchemeProvider:n,credentials:c}=e;return{setHttpAuthScheme(a){let O=s.findIndex((T)=>T.schemeId===a.schemeId);if(O===-1)s.push(a);else s.splice(O,1,a)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(a){n=a},httpAuthSchemeProvider(){return n},setCredentials(a){c=a},credentials(){return c}}},ys=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Ds=(e,s)=>{let n=Object.assign(Ue(e),Ze(e),At(e),xs(e));return s.forEach((c)=>c.configure(n)),Object.assign(e,Fe(n),et(n),_t(n),ys(n))};class b extends ne{config;constructor(...[e]){let s=ks(e||{});super(s);this.initConfig=s;let n=zt(s),c=be(n),a=Rt(c),O=ut(a),T=qe(O),Te=lt(T),ke=Lt(Te),xe=Ds(ke,e?.extensions||[]);this.config=xe,this.middlewareStack.use(ft(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(vt(this.config)),this.middlewareStack.use(Ot(this.config)),this.middlewareStack.use(Ve(this.config)),this.middlewareStack.use(We(this.config)),this.middlewareStack.use(Le(this.config)),this.middlewareStack.use(Be(this.config,{httpAuthSchemeParametersProvider:Mt,identityProviderConfigProvider:async(ye)=>new je({"aws.auth#sigv4":ye.credentials})})),this.middlewareStack.use(Ge(this.config))}destroy(){super.destroy()}}var fe=tt(Bt,"Signin","SigninClient",Et),Ns={IsControlPlane:{type:"staticContextParams",value:!1}},ws={IsOAuthEndpoint:{type:"staticContextParams",value:!0}},Pe=(e,s,n,c)=>[];class q extends fe(Ns,Pe,"CreateOAuth2Token",Re){}class M extends fe(ws,Pe,"CreateOAuth2TokenWithIAM",ve){}var $s={CreateOAuth2TokenCommand:q,CreateOAuth2TokenWithIAMCommand:M};class H extends b{}st($s,H);var Us={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",CONFLICT:"CONFLICT",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",RESOURCE_NOT_FOUND:"RESOURCE_NOT_FOUND",SERVER_ERROR:"server_error",SERVICE_QUOTA_EXCEEDED:"SERVICE_QUOTA_EXCEEDED",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};var qs=C,Ms=pe,Hs=me,Vs=Re,Ws=q,Ls=Ae,zs=_e,Bs=Oe,js=Se,Gs=ve,Ks=M,Xs=Ie,Qs=Ce,Ys=R,Js=de,Zs=Us,en=H,tn=b,sn=l,nn=ue,on=v,rn=he,cn=f,un=ge,pn=le;export{Fs as $Command,bs as __Client,qs as AccessDeniedException,Ms as AccessDeniedException$,Hs as AccessToken$,Vs as CreateOAuth2Token$,Ws as CreateOAuth2TokenCommand,Ls as CreateOAuth2TokenRequest$,zs as CreateOAuth2TokenRequestBody$,Bs as CreateOAuth2TokenResponse$,js as CreateOAuth2TokenResponseBody$,Gs as CreateOAuth2TokenWithIAM$,Ks as CreateOAuth2TokenWithIAMCommand,Xs as CreateOAuth2TokenWithIAMRequest$,Qs as CreateOAuth2TokenWithIAMResponse$,Ys as InternalServerException,Js as InternalServerException$,Zs as OAuth2ErrorCode,en as Signin,tn as SigninClient,sn as SigninServiceException,nn as SigninServiceException$,on as TooManyRequestsError,rn as TooManyRequestsError$,cn as ValidationException,un as ValidationException$,pn as errorTypeRegistries};
@@ -1,2 +1,2 @@
1
- import{T}from"./chunk-6bhn1p8v.js";var c=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Er=T("copy",c);
2
- export{Er};
1
+ import{T}from"./chunk-7rhz2gze.js";var c=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Rr=T("copy",c);
2
+ export{Rr};
@@ -0,0 +1 @@
1
+ import{h,C,t,Z,Fe,A,it,_t,Up}from"./chunk-7rhz2gze.js";import"./chunk-7kjgvxqa.js";import"./chunk-tm7f32c7.js";import"./chunk-gc5sbfa5.js";import"./chunk-77fmkpdz.js";import"./chunk-1j27fzy1.js";import"./chunk-7pw1550a.js";import"./chunk-rssgmj7x.js";import"./chunk-8e28hcny.js";import"./chunk-914bp49r.js";import"./chunk-snhsjs4x.js";import"./chunk-0qaq0sp8.js";import{qn}from"./chunk-dj92fss9.js";import{er}from"./chunk-5vzrpz50.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-5adsx8x4.js";import"./chunk-j2bvj2yn.js";import"./chunk-cbgq517y.js";import"./chunk-gk2q9a3f.js";import"./chunk-9t8n2des.js";import"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";C();function l(){let{projectId:o}=c.useParams(),{teamId:r,ensureTeamIdForProject:a}=it();h(()=>{a(o)},[o,a]);let{data:s}=er(Up(o)),e=s?.rootFolder,{data:i}=Z({queryKey:["folders",e],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:e}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!e});if(!r||!e||!i)return t(_t,{});return t(qn,{teamId:r,projectId:o,projectName:s.name??"",assetId:e,rootFolderId:e})}var c=Fe("/projects/$projectId/")({component:l});export{c as Route};
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{Jt,jt}from"./chunk-jgs8an3h.js";import{v,G}from"./chunk-fnmwksnb.js";var Go=v(function(he){var{hasOwn:V}=Jt(),{streamCollector:te}=Jt();he.streamCollector=te;var{buildQueryString:K,HttpResponse:Q}=jt(),H=G("https"),{Readable:oe}=G("stream"),N=G("http2");function I(e){let t=e&&typeof e==="object"&&"reason"in e?e.reason:void 0;if(t){if(t instanceof Error){let s=Error("Request aborted");return s.name="AbortError",s.cause=t,s}let n=Error(String(t));return n.name="AbortError",n}let o=Error("Request aborted");return o.name="AbortError",o}var ne=["ECONNRESET","EPIPE","ETIMEDOUT"],J=(e)=>{let t={};for(let o in e){if(!V(e,o))continue;let n=e[o];t[o]=Array.isArray(n)?n.join(","):n}return t},h={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:(e)=>clearTimeout(e)},F=1000,se=(e,t,o=0)=>{if(!o)return-1;let n=(s)=>{let i=h.setTimeout(()=>{e.destroy(),t(Object.assign(Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${o} ms.`),{name:"TimeoutError"}))},o-s),c=(a)=>{if(a?.connecting)a.on("connect",()=>{h.clearTimeout(i)});else h.clearTimeout(i)};if(e.socket)c(e.socket);else e.on("socket",c)};if(o<2000)return n(0),0;return h.setTimeout(n.bind(null,F),F)},re=(e,t,o=0,n,s)=>{if(o)return h.setTimeout(()=>{let i=`@smithy/node-http-handler - [${n?"ERROR":"WARN"}] a request has exceeded the configured ${o} ms requestTimeout.`;if(n){let c=Object.assign(Error(i),{name:"TimeoutError",code:"ETIMEDOUT"});e.destroy(c),t(c)}else i+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",s?.warn?.(i)},o);return-1},ie=3000,ce=(e,{keepAlive:t,keepAliveMsecs:o},n=ie)=>{if(t!==!0)return-1;let s=()=>{if(e.socket)e.socket.setKeepAlive(t,o||0);else e.on("socket",(i)=>{i.setKeepAlive(t,o||0)})};if(n===0)return s(),0;return h.setTimeout(s,n)},j=3000,ae=(e,t,o=0)=>{let n=(s)=>{let i=o-s,c=()=>{e.destroy(),t(Object.assign(Error(`@smithy/node-http-handler - the request socket timed out after ${o} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};if(e.socket)e.socket.setTimeout(i,c),e.on("close",()=>e.socket?.removeListener("timeout",c));else e.setTimeout(i,c)};if(0<o&&o<6000)return n(0),0;return h.setTimeout(n.bind(null,o===0?0:j),j)},B=6000;async function X(e,t,o=B,n=!1){let s=t.headers,i=s?s.Expect||s.expect:void 0,c=-1,a=!0;if(!n&&i==="100-continue")a=await Promise.race([new Promise((u)=>{c=Number(h.setTimeout(()=>u(!0),Math.max(B,o)))}),new Promise((u)=>{e.on("continue",()=>{h.clearTimeout(c),u(!0)}),e.on("response",()=>{h.clearTimeout(c),u(!1)}),e.on("error",()=>{h.clearTimeout(c),u(!1)})})]);if(a)ue(e,t.body)}function ue(e,t){if(t instanceof oe){t.pipe(e);return}if(t){let o=Buffer.isBuffer(t);if(o||typeof t==="string"){if(o&&t.byteLength===0)e.end();else e.end(t);return}let s=t;if(typeof s==="object"&&s.buffer&&typeof s.byteOffset==="number"&&typeof s.byteLength==="number"){e.end(Buffer.from(s.buffer,s.byteOffset,s.byteLength));return}e.end(Buffer.from(t));return}e.end()}var fe=0,O=void 0,W=void 0;class L{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(e){if(typeof e?.handle==="function")return e;return new L(e)}static checkSocketUsage(e,t,o=console){let{sockets:n,requests:s,maxSockets:i}=e;if(typeof i!=="number"||i===1/0)return t;let c=15000;if(Date.now()-c<t)return t;if(n&&s)for(let a in n){if(!V(n,a))continue;let u=n[a]?.length??0,l=s[a]?.length??0;if(u>=i&&l>=2*i)return o?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${l} additional requests are enqueued.
3
+ See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
4
+ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){this.configProvider=new Promise((t,o)=>{if(typeof e==="function")e().then((n)=>{t(this.resolveDefaultConfig(n))}).catch(o);else t(this.resolveDefaultConfig(e))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:t,requestTimeout:o}={}){if(!this.config)this.config=await this.configProvider;let n=this.config,s=n.logger,i=e.protocol==="https:";if(!i&&!this.config.httpAgent)this.config.httpAgent=await this.config.httpAgentProvider();return new Promise((c,a)=>{let u=void 0,l=-1,m=-1,T=-1,A=-1,E=-1,k=()=>{h.clearTimeout(l),h.clearTimeout(m),h.clearTimeout(T),h.clearTimeout(A),h.clearTimeout(E)},U=async(r)=>{await u,k(),c(r)},p=async(r)=>{await u,k(),a(r)};if(t?.aborted){let r=I(t);p(r);return}let S=e.headers,R=S?(S.Expect??S.expect)==="100-continue":!1,C=i?n.httpsAgent:n.httpAgent;if(R&&!this.externalAgent)C=new(i?H.Agent:O)({keepAlive:!1,maxSockets:1/0});l=h.setTimeout(()=>{this.socketWarningTimestamp=L.checkSocketUsage(C,this.socketWarningTimestamp,s)},n.socketAcquisitionWarningTimeout??(n.requestTimeout??2000)+(n.connectionTimeout??1000));let D=e.query?K(e.query):"",x=void 0;if(e.username!=null||e.password!=null){let r=e.username??"",f=e.password??"";x=`${r}:${f}`}let P=e.path;if(D)P+=`?${D}`;if(e.fragment)P+=`#${e.fragment}`;let y=e.hostname??"";if(y[0]==="["&&y.endsWith("]"))y=e.hostname.slice(1,-1);else y=e.hostname;let _={headers:e.headers,host:y,method:e.method,path:P,port:e.port,agent:C,auth:x},g=(i?H.request:W)(_,(r)=>{let f=new Q({statusCode:r.statusCode||-1,reason:r.statusMessage,headers:J(r.headers),body:r});U({response:f})});if(g.on("error",(r)=>{if(ne.includes(r.code))p(Object.assign(r,{name:"TimeoutError"}));else p(r)}),t){let r=()=>{g.destroy();let f=I(t);p(f)};if(typeof t.addEventListener==="function"){let f=t;f.addEventListener("abort",r,{once:!0}),g.once("close",()=>f.removeEventListener("abort",r))}else t.onabort=r}let b=o??n.requestTimeout;m=se(g,p,n.connectionTimeout),T=re(g,p,b,n.throwOnRequestTimeout,s??console),A=ae(g,p,n.socketTimeout);let d=_.agent;if(typeof d==="object"&&"keepAlive"in d)E=ce(g,{keepAlive:d.keepAlive,keepAliveMsecs:d.keepAliveMsecs});u=X(g,e,b,this.externalAgent).catch((r)=>(k(),a(r)))})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((o)=>{if(e===Symbol.for("logger"))return{...o,logger:o.logger??t};return{...o,[e]:t}})}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:t,connectionTimeout:o,socketTimeout:n,socketAcquisitionWarningTimeout:s,httpAgent:i,httpsAgent:c,throwOnRequestTimeout:a,logger:u}=e||{},l=!0,m=50;return{connectionTimeout:o,requestTimeout:t,socketTimeout:n,socketAcquisitionWarningTimeout:s,throwOnRequestTimeout:a,httpAgentProvider:async()=>{let T=G("http"),{Agent:A,request:E}=T.default??T;if(W=E,O=A,i instanceof O||typeof i?.destroy==="function")return this.externalAgent=!0,i;return new O({keepAlive:!0,maxSockets:50,...i})},httpsAgent:(()=>{if(c instanceof H.Agent||typeof c?.destroy==="function")return this.externalAgent=!0,c;return new H.Agent({keepAlive:!0,maxSockets:50,...c})})(),logger:u}}}var de=new Uint16Array(1);class M{id=de[0]++;total=0;max=0;session;refs=0;constructor(e){e.unref(),this.session=e}retain(){if(this.session.destroyed)throw Error("@smithy/node-http-handler - cannot acquire reference to destroyed session.");this.refs+=1,this.total+=1,this.max=Math.max(this.refs,this.max),this.session.ref()}free(){if(this.session.destroyed)return;if(this.refs-=1,this.refs===0)this.session.unref();if(this.refs<0)throw Error("@smithy/node-http-handler - ClientHttp2Session refcount at zero, cannot decrement.")}deref(){return this.session}close(){if(!this.session.closed)this.session.close()}destroy(){if(this.refs=0,!this.session.destroyed)this.session.destroy()}useCount(){return this.refs}}class Y{sessions=[];maxConcurrency=0;constructor(e){this.sessions=(e??[]).map((t)=>new M(t))}poll(){let e=!1;for(let t of this.sessions){if(t.deref().destroyed){e=!0;continue}if(!this.maxConcurrency||t.useCount()<this.maxConcurrency)return t}if(e){for(let t of this.sessions)if(t.deref().destroyed)this.remove(t)}}offerLast(e){this.sessions.push(e)}remove(e){let t=this.sessions.indexOf(e);if(t>-1)this.sessions.splice(t,1)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}setMaxConcurrency(e){this.maxConcurrency=e}destroy(e){this.remove(e),e.destroy()}}class Z{config;connectOptions;connectionPools=new Map;constructor(e){if(this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw RangeError("maxConcurrency must be greater than zero.")}lease(e,t){let o=this.getUrlString(e),n=this.getPool(o);if(!this.config.disableConcurrency&&!t.isEventStream){let u=n.poll();if(u)return u.retain(),u}let s=new M(this.connect(o)),i=s.deref();if(this.config.maxConcurrency)i.settings({maxConcurrentStreams:this.config.maxConcurrency},(u)=>{if(u)throw Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+e.destination.toString())});let c=()=>{this.removeFromPoolAndClose(o,s)},a=()=>{this.removeFromPoolAndCheckedDestroy(o,s)};if(i.on("goaway",c),i.on("error",a),i.on("frameError",a),i.on("close",a),t.requestTimeout)i.setTimeout(t.requestTimeout,a);return n.offerLast(s),s.retain(),s}release(e,t){t.free()}createIsolatedSession(e,t){let o=this.getUrlString(e),n=new M(this.connect(o)),s=n.deref();s.settings({maxConcurrentStreams:1});let i=()=>{n.destroy()};if(s.on("error",i),s.on("frameError",i),s.on("close",i),t.requestTimeout)s.setTimeout(t.requestTimeout,i);return n.retain(),n}destroy(){for(let[e,t]of this.connectionPools){for(let o of[...t])o.destroy();this.connectionPools.delete(e)}}setMaxConcurrentStreams(e){if(e&&e<=0)throw RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=e;for(let t of this.connectionPools.values())t.setMaxConcurrency(e)}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}setNodeHttp2ConnectOptions(e){this.connectOptions=e}debug(){let e={};for(let[t,o]of this.connectionPools){let n=[];for(let s of o)n.push({id:s.id,active:s.useCount(),maxConcurrent:s.max,totalRequests:s.total});e[t]={sessions:n}}return e}removeFromPoolAndClose(e,t){this.connectionPools.get(e)?.remove(t),t.close()}removeFromPoolAndCheckedDestroy(e,t){this.connectionPools.get(e)?.remove(t),t.destroy()}getPool(e){if(!this.connectionPools.has(e)){let t=new Y;if(this.config.maxConcurrency)t.setMaxConcurrency(this.config.maxConcurrency);this.connectionPools.set(e,t)}return this.connectionPools.get(e)}getUrlString(e){return e.destination.toString()}connect(e){return this.connectOptions===void 0?N.connect(e):N.connect(e,this.connectOptions)}}var{constants:z}=N;class q{config;configProvider;metadata={handlerProtocol:"h2"};connectionManager=new Z({});static create(e){if(typeof e?.handle==="function")return e;return new q(e)}constructor(e){this.configProvider=new Promise((t,o)=>{if(typeof e==="function")e().then((n)=>{t(n||{})}).catch(o);else t(e||{})})}destroy(){this.connectionManager.destroy()}async handle(e,{abortSignal:t,requestTimeout:o,isEventStream:n}={}){if(!this.config){this.config=await this.configProvider;let{disableConcurrentStreams:u,maxConcurrentStreams:l,nodeHttp2ConnectOptions:m}=this.config;if(this.connectionManager.setDisableConcurrentStreams(u??!1),l)this.connectionManager.setMaxConcurrentStreams(l);if(m)this.connectionManager.setNodeHttp2ConnectOptions(m)}let{requestTimeout:s,disableConcurrentStreams:i}=this.config,c=i||n,a=o??s;return new Promise((u,l)=>{let m=!1,T=void 0,A=async(r)=>{await T,u(r)},E=async(r)=>{await T,l(r)};if(t?.aborted){m=!0;let r=I(t);E(r);return}let{hostname:k,method:U,port:p,protocol:S,query:R}=e,C="";if(e.username!=null||e.password!=null){let r=e.username??"",f=e.password??"";C=`${r}:${f}@`}let D=`${S}//${C}${k}${p?`:${p}`:""}`,x={destination:new URL(D)},P={requestTimeout:this.config?.sessionTimeout,isEventStream:n},y=c?this.connectionManager.createIsolatedSession(x,P):this.connectionManager.lease(x,P),_=y.deref(),w=(r)=>{if(c)y.destroy();m=!0,E(r)},g=R?K(R):"",b=e.path;if(g)b+=`?${g}`;if(e.fragment)b+=`#${e.fragment}`;let d=_.request({...e.headers,[z.HTTP2_HEADER_PATH]:b,[z.HTTP2_HEADER_METHOD]:U});if(a)d.setTimeout(a,()=>{d.close();let r=Error(`Stream timed out because of no activity for ${a} ms`);r.name="TimeoutError",w(r)});if(t){let r=()=>{d.close();let f=I(t);w(f)};if(typeof t.addEventListener==="function"){let f=t;f.addEventListener("abort",r,{once:!0}),d.once("close",()=>f.removeEventListener("abort",r))}else t.onabort=r}d.on("frameError",(r,f,ee)=>{w(Error(`Frame type id ${r} in stream id ${ee} has failed with code ${f}.`))}),d.on("error",w),d.on("aborted",()=>{w(Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${d.rstCode}.`))}),d.on("response",(r)=>{let f=new Q({statusCode:r[":status"]??-1,headers:J(r),body:d});if(m=!0,A({response:f}),c)_.close()}),d.on("close",()=>{if(c)y.destroy();else this.connectionManager.release(x,y);if(!m)w(Error("Unexpected error: http2 request did not get a response"))}),T=X(d,e,a)})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((o)=>({...o,[e]:t}))}httpHandlerConfigs(){return this.config??{}}}he.DEFAULT_REQUEST_TIMEOUT=fe;he.NodeHttp2Handler=q;he.NodeHttpHandler=L});
5
+ export{Go};
@@ -1,2 +1,2 @@
1
- import{N,h,v,u,C,B,t,o,Q,L,A,T,Z,fn,bt,_e,vt,Kt,Xt,de,ve,Oe,E,ly,cy,my,Ty,Vd,_m,n0,E0,J0,X0,dr,Wm,ff,Af,uh,Ow,zw,lx,xh,$f,ld,YC,$E,sp,ip,iI,rn,lp,se,st,Tr,yn,Wa,De,Ze,Le,Be,re,po,wa,Ht,pr}from"./chunk-6bhn1p8v.js";import{Uc,Sa}from"./chunk-b9yrw9et.js";import{xn}from"./chunk-gk3eqd50.js";import{mo}from"./chunk-1yacmegc.js";var Re=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],le=T("brain",Re);C();function ns({projectId:c,contextAssetId:S,file:x,currentTime:me,frameRate:q,startTimecode:U,formatTimestamp:H,onTyping:ce,onSelectMessage:X,selectedMessageId:ue}){let{isHistoryMode:g,setIsHistoryMode:I,currentSessionId:pe,chatAssets:fe,removeAsset:ge,messages:y,historySessions:G,isStreaming:j,fetchHistorySessions:Y,loadSession:xe,deleteSession:he,startNewSession:ee,sendMessage:be,abortActiveSession:ye,selectedAgentId:R,setSelectedAgentId:D,inputText:we,setInputText:ke}=pr(),{teamId:p,ensureTeamIdForProject:te}=st(),{videoTimeDisplayMode:Ne}=Ht(),[F,O]=u(null);h(()=>{if(c)te(c)},[c,te]);let{data:Se=[],isSuccess:oe}=L({queryKey:["chat-agents",c],queryFn:async()=>{if(!c)return[];let e=await A.api.projects[":projectId"]["chat-agents"].$get({param:{projectId:c}});if(!e.ok)throw Error("failed to fetch agents");return e.json()},enabled:!!c}),M=Se.filter((e)=>e.type==="chat"&&e.enabled);h(()=>{if(!oe)return;if(M.length>0){if(!M.some((r)=>r.id===R))D(M[0].id)}else if(R!==null)D(null)},[oe,M,R,D]);let ae=v(null),P=v(null),K=v(!0),z=v(!0);h(()=>{z.current=!0,K.current=!0},[c,S,g]),h(()=>{let e=P.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!e)return;let{scrollTop:r,isAtBottom:l}=pr.getState(),s=setTimeout(()=>{if(l)e.scrollTop=e.scrollHeight;else e.scrollTop=r;let m=setTimeout(()=>{z.current=!1},50);return()=>clearTimeout(m)},0);return()=>clearTimeout(s)},[c,S,g]),h(()=>{let e=P.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!e)return;let r=()=>{if(z.current)return;let l=e.scrollTop,s=e.scrollHeight-l-e.clientHeight<10;pr.getState().setScrollState(l,s)};return e.addEventListener("scroll",r),()=>{e.removeEventListener("scroll",r)}},[c,S,g]);let{ref:Te,isDropTarget:Ce}=Tr({id:"chatbot-sidebar",data:{type:"chatbot-sidebar"}});h(()=>{if(!g){let{isAtBottom:e}=pr.getState();if(e||j){let r=K.current?"auto":"smooth";ae.current?.scrollIntoView({behavior:r})}K.current=!1}},[y,j,g]),h(()=>{if(g&&p)Y(p)},[g,Y,p]);let k=Q(),Ae=N(()=>{k.invalidateQueries({queryKey:["search"]}),k.invalidateQueries({queryKey:["folders"]}),k.invalidateQueries({queryKey:["files"]}),k.invalidateQueries({queryKey:["file"]}),k.invalidateQueries({queryKey:["version_stacks"]}),k.invalidateQueries({queryKey:["projects"]})},[k]),V=(e)=>{if(typeof e==="string")return e;if(Array.isArray(e))return e.map((r)=>{if(typeof r==="string")return r;if(r&&typeof r==="object"&&"type"in r&&r.type==="text"&&"text"in r)return String(r.text);return""}).join("");return""},ne=(e)=>e.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:"),Me=(e)=>{switch(e.role){case"user":case"custom":{let r=e;if(e.role==="custom"&&r.customType==="context_display_info"){let m=r.details?.assets||[];if(m.length===0)return null;return o("div",{className:"text-xs text-muted-foreground bg-muted/40 p-2.5 rounded-lg border border-border/50 space-y-1 my-1",children:[t("div",{className:"font-semibold",children:cy()}),t("ul",{className:"list-disc list-inside space-y-0.5",children:m.map((n)=>o("li",{className:"truncate",children:[n.name," ",o("span",{className:"text-muted-foreground/70",children:["(",n.type,")"]})]},n.id))})]},e.id)}if(e.role==="user"||r.customType==="shumai_message"){let s=r.details,m=s?.referencedAssets||[],n=s?.attachedFiles||[],i=s?.position,f=s?.annotation||s?.annotations&&s.annotations.length>0,d=!s?.currentAsset?.id||S&&s.currentAsset.id===S||x?.id&&s.currentAsset.id===x.id,b=ue===e.id,_="";if(i?.type==="time")if(H)_=H(i.seconds);else if(q){let a=Math.round(i.seconds*q);_=xn(a,q,Ne,U)}else{let a=Math.floor(i.seconds/60),w=Math.floor(i.seconds%60);_=`${a.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}`}else if(i?.type==="page")_=xh({page:i.page});let ie=V(r.content),je=n.length>0||m.length>0;return t("div",{onClick:()=>{if(d&&X)X(e)},className:E("flex flex-col items-end w-full group transition-all duration-150",d&&(f||i)&&"cursor-pointer"),children:o("div",{className:E("bg-primary text-primary-foreground rounded-lg px-3 py-2 text-sm whitespace-pre-wrap shadow-xs break-words transition-all border",je?"w-full":"max-w-[85%]",b?"border-blue-500 dark:border-blue-400":"border-transparent"),children:[o("div",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:[f&&t("span",{className:"inline-flex items-center align-middle mr-1.5 p-0.5 rounded bg-primary-foreground/20 text-primary-foreground",title:n0(),children:t(Wa,{className:"w-3.5 h-3.5"})}),i&&t("span",{className:"inline-flex items-center align-middle mr-1.5 px-1.5 py-0.5 rounded text-xs font-mono font-bold bg-primary-foreground/20 text-primary-foreground",children:_}),ie&&t("span",{children:ie})]}),n.length>0&&o("div",{className:"mt-2.5 w-full",children:[t("div",{className:"text-xs font-medium text-primary-foreground/70 mb-1",children:my()}),t("div",{className:"flex flex-col gap-1.5 w-full",children:n.map((a)=>{let w=a.name||"file",W=wa(w)||a.mediaType==="image"||a.mimeType?.startsWith("image/");return o("div",{className:E("group/att relative flex items-center w-full max-w-full rounded-lg border border-primary-foreground/15 bg-primary-foreground/10 hover:bg-primary-foreground/15 transition-colors overflow-hidden",W?"h-18 p-1.5 gap-2.5 cursor-pointer":"h-9 px-2.5 gap-2.5"),onClick:(J)=>{if(J.stopPropagation(),a.url)if(W)O({url:a.url,name:w});else window.open(a.url,"_blank","noreferrer")},children:[W&&a.url?t("div",{className:"h-full aspect-square rounded-md overflow-hidden bg-black/20 shrink-0",children:t("img",{src:a.url,alt:w,className:"w-full h-full object-cover group-hover/att:scale-105 transition-transform duration-200"})}):t(Kt,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}),t("div",{className:"min-w-0 flex-1 overflow-hidden",children:t("p",{className:"text-xs font-medium text-primary-foreground truncate block w-full",title:w,children:w})}),a.url&&t("a",{href:a.url,target:"_blank",rel:"noreferrer",download:w,className:"p-1 text-primary-foreground/70 hover:text-primary-foreground shrink-0 rounded-md hover:bg-primary-foreground/20 transition-colors opacity-0 group-hover/att:opacity-100",onClick:(J)=>J.stopPropagation(),title:dr(),children:t(vt,{className:"w-3.5 h-3.5"})})]},a.id)})})]}),m.length>0&&o("div",{className:"mt-2.5 w-full",children:[t("div",{className:"text-xs font-medium text-primary-foreground/70 mb-1",children:ly()}),t("div",{className:"flex flex-col gap-1.5 w-full",children:m.map((a)=>o("div",{className:"flex items-center justify-between w-full h-9 px-2.5 rounded-lg border border-primary-foreground/15 bg-primary-foreground/10 hover:bg-primary-foreground/15 transition-colors overflow-hidden",children:[o("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[a.type==="folder"?t(Xt,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}):t(Kt,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}),t("span",{className:"text-xs font-medium truncate text-primary-foreground",title:a.name,children:a.name})]}),t("span",{className:"text-[10px] text-primary-foreground/60 uppercase shrink-0 font-mono ml-2",children:a.type})]},a.id))})]})]})},e.id)}let l=r.content||"";return t("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:V(l)},e.id)}case"assistant":{let l=e.content;if(!l)return null;let s=[];if(l.forEach((n,i)=>{if(!n||typeof n!=="object")return;let f=n;switch(f.type){case"text":{let d=f.text;if(typeof d!=="string"||!d.trim())return;s.push(t("div",{className:"text-sm leading-[1.8] prose prose-sm dark:prose-invert max-w-none break-words",children:t(po,{components:{pre:({node:b,..._})=>t("pre",{className:"whitespace-pre-wrap break-all break-words bg-muted text-foreground p-4 rounded-md border border-border/50 font-mono text-sm",..._})},children:ne(d)})},`txt-${i}`));break}case"thinking":{let d=f.thinking;if(typeof d!=="string"||!d.trim())return;s.push(o("details",{className:"group border border-border/50 rounded-lg bg-muted/20 my-2 overflow-hidden",children:[o("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-medium text-muted-foreground select-none cursor-pointer hover:bg-muted/40 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t(le,{className:"h-3.5 w-3.5 text-primary/70 animate-pulse"}),t("span",{children:$f()||"Thinking"}),t(_e,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),t("div",{className:"p-3 pt-0 text-xs text-muted-foreground/90 border-t border-border/40 bg-muted/10 leading-relaxed prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap font-sans",children:t(po,{children:ne(d)})})]},`think-${i}`));break}case"toolCall":{let d=String(f.name||f.toolName||rn()),b=f.arguments||f.args;s.push(o("details",{className:"group border border-border/50 rounded-lg bg-violet-500/5 my-2 overflow-hidden",children:[o("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-semibold text-violet-600 dark:text-violet-400 select-none cursor-pointer hover:bg-violet-500/10 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t(mo,{className:"h-3.5 w-3.5"}),t("span",{children:Vd()}),t("span",{className:"font-mono bg-violet-500/10 px-1.5 py-0.5 rounded text-[11px] text-violet-700 dark:text-violet-300",children:d}),t(_e,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),!!b&&o("div",{className:"p-3 pt-0 text-[10px] text-muted-foreground/90 border-t border-border/40 bg-violet-500/5 font-sans",children:[t("div",{className:"text-[9px] text-muted-foreground/60 uppercase font-bold tracking-wider mb-1.5",children:sp()||"Arguments"}),t("pre",{className:"font-mono bg-muted/30 p-2 rounded border border-border/30 overflow-x-auto max-h-32",children:JSON.stringify(b,null,2)})]})]},`tool-${i}`));break}case"image":{let d=String(f.mimeType||"image/png"),b=String(f.data||"");s.push(t("div",{className:"my-2 max-w-full",children:b?t("img",{src:b.startsWith("data:")?b:`data:${d};base64,${b}`,alt:"Attached asset",className:"max-h-60 rounded border border-border/50 object-contain shadow-xs"}):t("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:ff()})},`img-${i}`));break}default:{let d=JSON.stringify(n,null,2);if(d==="{}")return;s.push(t("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:d},`other-${i}`))}}}),s.length===0)return null;let m=!1;if(l.length>0){let n=l[l.length-1];if(typeof n==="string"&&n.trim().length>0)m=!0;else if(n&&typeof n==="object"){let i=n;if(i.type==="text"&&typeof i.text==="string"&&i.text.trim().length>0)m=!0}}return o("div",{className:"flex flex-col w-full space-y-1",children:[t("div",{className:"space-y-2 w-full",children:s}),m&&t("div",{className:"text-[10px] text-muted-foreground self-start italic pt-1",children:E0()})]},e.id)}case"toolResult":return t("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/40 p-2 rounded-md border border-border/50",children:t("span",{className:"font-semibold",children:ip({name:e.toolName||"tool"})})},e.id);case"thinking_level_change":{let l=e.content||"";return t("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:V(l)},e.id)}default:return null}};return o("div",{ref:Te,className:E("relative flex flex-col h-full bg-background transition-colors duration-200 min-h-0"),children:[Ce&&t("div",{className:"absolute inset-0 bg-accent/30 border-2 border-primary z-50 pointer-events-none flex items-center justify-center p-6 text-center animate-in fade-in duration-150",children:o("div",{className:"bg-background/95 text-foreground px-4 py-3 rounded-xl border border-border/80 flex flex-col items-center gap-2 shadow-lg max-w-[80%] animate-in zoom-in-95 duration-150",children:[t(bt,{className:"h-6 w-6 text-primary animate-bounce"}),t("span",{className:"text-sm font-semibold text-foreground",children:_m()})]})}),o("div",{className:"h-12 border-b border-border flex items-center justify-between px-4 flex-shrink-0 bg-background/50 backdrop-blur-sm",children:[o("div",{className:"flex items-center gap-2",children:[g&&t("button",{onClick:()=>I(!1),className:"p-1 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:Ty(),children:t(Uc,{className:"h-4 w-4"})}),t(bt,{className:"h-5 w-5 text-primary"}),t("span",{className:"font-semibold text-sm",children:g?Wm():YC()})]}),t("div",{className:"flex items-center gap-1",children:!g?o(B,{children:[t("button",{onClick:ee,className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:uh(),children:t(de,{className:"h-4 w-4"})}),t("button",{onClick:()=>I(!0),className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:Wm(),children:t(fn,{className:"h-4 w-4"})})]}):o("button",{onClick:()=>{ee(),I(!1)},className:"flex items-center gap-1 text-xs bg-primary text-primary-foreground px-2.5 py-1 rounded-md hover:bg-primary/90 transition-colors shadow-xs cursor-pointer",children:[t(de,{className:"h-3.5 w-3.5"}),t("span",{children:uh()})]})})]}),g?t(se,{className:"flex-1 p-3",children:G.length===0?t("div",{className:"text-center text-xs text-muted-foreground py-8",children:zw()}):t("div",{className:"space-y-1",children:G.map((e)=>{let r=e.id===pe;return o("div",{onClick:()=>{if(p)xe(p,e.id),I(!1)},className:E("group flex items-center justify-between p-2.5 rounded-lg text-xs cursor-pointer transition-all border border-transparent",r?"bg-accent/80 text-accent-foreground font-medium border-border/40":"hover:bg-muted/60 text-muted-foreground hover:text-foreground"),children:[o("div",{className:"flex flex-col min-w-0 pr-2",children:[t("span",{className:"truncate text-foreground font-medium text-xs",children:e.name||lp()}),t("span",{className:"text-[10px] text-muted-foreground",children:yn(e.updatedAt)})]}),t("button",{onClick:(l)=>{if(l.stopPropagation(),p&&window.confirm(X0()))he(p,e.id)},className:"opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-destructive p-1 rounded hover:bg-muted cursor-pointer",title:J0(),children:t(ve,{className:"h-4 w-4"})})]},e.id)})})}):o(B,{children:[t(se,{ref:P,className:"flex-1 p-4 min-h-0 [&>div>div]:!block",children:y.length===0?o("div",{className:"flex flex-col items-center justify-center h-48 border-2 border-dashed border-border rounded-lg text-muted-foreground p-4 text-center",children:[t(bt,{className:"h-8 w-8 mb-2 opacity-50 text-muted-foreground"}),t("p",{className:"text-sm",children:_m()})]}):o("div",{className:"space-y-4 pb-4",children:[y.map(Me),j&&y.length>0&&(y[y.length-1].role==="user"||y[y.length-1].customType==="shumai_message")&&o("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground italic",children:[t(Z,{className:"h-3 w-3 animate-spin text-primary"}),t("span",{children:$E()})]}),t("div",{ref:ae})]})}),t("div",{className:"p-2 flex-shrink-0 bg-background",children:t(Sa,{projectId:c,value:we,onChangeText:ke,placeholder:iI(),disabled:!R||!p,isStreaming:j,onAbort:()=>{if(p)ye(p)},allowMentions:!1,allowAttachments:!0,workspaceAssets:fe,onRemoveWorkspaceAsset:ge,allowMarkup:!0,canMarkup:!!x&&["image","video","pdf"].includes(x.proxyType||""),markupDisabledTooltip:!x?lx():Af(),allowTimestamp:x?.proxyType==="video"||x?.proxyType==="pdf",currentTime:me,frameRate:q||x?.media?.metadata?.frameRate||30,startTimecode:U||x?.media?.metadata?.startTimecode,formatTimestamp:H||(x?.proxyType==="pdf"?(e)=>xh({page:Math.round(e)}):void 0),onTyping:ce,onSendMessage:(e,r,l,s,m,n)=>{if(!p)return;be(p,e,c,S,Ae,r,l,m,n)},bottomLeftExtra:t("div",{className:"flex items-center gap-1.5 min-w-0 max-w-full",children:M.length>0?o(De,{value:R||"",onValueChange:(e)=>D(e),disabled:j,children:[t(Le,{className:"h-8 border-none bg-transparent hover:bg-muted text-muted-foreground hover:text-foreground focus:ring-0 focus:ring-offset-0 px-2 py-0 gap-1.5 text-xs shrink-0 select-none shadow-none max-w-full cursor-pointer",children:t(Ze,{placeholder:ld()})}),t(Be,{children:M.map((e)=>t(re,{value:e.id,className:"cursor-pointer",children:o("div",{className:"flex items-center gap-2",children:[e.avatar?t("img",{src:e.avatar,alt:e.name,className:"w-4 h-4 rounded-full object-cover"}):t(bt,{className:"w-4 h-4 text-muted-foreground"}),t("span",{className:"text-xs",children:e.name})]})},e.id))})]}):t("div",{className:"flex items-center gap-1.5 px-2 py-1 text-[11px] text-muted-foreground/60 italic select-none",children:t("span",{children:Ow()})})})})})]}),F&&o("div",{className:"fixed inset-0 z-[100] bg-black/95 flex flex-col items-center justify-center p-4 animate-in fade-in duration-200",onClick:()=>O(null),children:[t("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white hover:bg-white/20 rounded-full p-2 transition-colors z-50 cursor-pointer",children:t(Oe,{className:"w-8 h-8"})}),t("div",{className:"w-full h-full flex items-center justify-center p-2",children:t("img",{src:F.url,alt:F.name,className:"max-w-full max-h-[85vh] object-contain rounded shadow-2xl cursor-zoom-out",onClick:(e)=>{e.stopPropagation(),O(null)}})}),t("div",{className:"absolute bottom-6 text-white text-sm font-medium bg-black/50 px-4 py-2 rounded-full backdrop-blur-sm",children:F.name})]})]})}
2
- export{ns};
1
+ import{N,h,w,u,C,B,t,o,K,Z,A,T,L,_n,wt,be,vt,Xt,or,fe,ve,De,E,Ry,ky,Ly,Wy,Af,zm,C0,V0,b_,w_,gr,yh,Of,Uf,Ph,rx,lx,Rx,$h,mp,Md,_E,mI,Tp,Mp,MI,cn,Rp,ie,it,Pr,Cn,ua,Le,Ze,Be,Ue,ne,xo,Ls,Qt,yr}from"./chunk-7rhz2gze.js";import{iu,Us}from"./chunk-77fmkpdz.js";import{In}from"./chunk-m9pr03kn.js";import{So}from"./chunk-5adsx8x4.js";var Re=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],le=T("brain",Re);C();function ga({projectId:c,contextAssetId:S,file:x,currentTime:de,frameRate:q,startTimecode:U,formatTimestamp:H,onTyping:me,onSelectMessage:X,selectedMessageId:ce}){let{isHistoryMode:g,setIsHistoryMode:I,currentSessionId:ue,chatAssets:pe,removeAsset:ge,messages:v,historySessions:G,isStreaming:j,fetchHistorySessions:Y,loadSession:xe,deleteSession:he,startNewSession:ee,sendMessage:ye,abortActiveSession:we,selectedAgentId:R,setSelectedAgentId:D,inputText:ke,setInputText:Ne}=yr(),{teamId:p,ensureTeamIdForProject:te}=it(),{videoTimeDisplayMode:_e}=Qt(),[F,O]=u(null);h(()=>{if(c)te(c)},[c,te]);let{data:Se=[],isSuccess:re}=Z({queryKey:["chat-agents",c],queryFn:async()=>{if(!c)return[];let e=await A.api.projects[":projectId"]["chat-agents"].$get({param:{projectId:c}});if(!e.ok)throw Error("failed to fetch agents");return e.json()},enabled:!!c}),M=Se.filter((e)=>e.type==="chat"&&e.enabled);h(()=>{if(!re)return;if(M.length>0){if(!M.some((r)=>r.id===R))D(M[0].id)}else if(R!==null)D(null)},[re,M,R,D]);let oe=w(null),P=w(null),Q=w(!0),z=w(!0);h(()=>{z.current=!0,Q.current=!0},[c,S,g]),h(()=>{let e=P.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!e)return;let{scrollTop:r,isAtBottom:l}=yr.getState(),s=setTimeout(()=>{if(l)e.scrollTop=e.scrollHeight;else e.scrollTop=r;let m=setTimeout(()=>{z.current=!1},50);return()=>clearTimeout(m)},0);return()=>clearTimeout(s)},[c,S,g]),h(()=>{let e=P.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!e)return;let r=()=>{if(z.current)return;let l=e.scrollTop,s=e.scrollHeight-l-e.clientHeight<10;yr.getState().setScrollState(l,s)};return e.addEventListener("scroll",r),()=>{e.removeEventListener("scroll",r)}},[c,S,g]);let{ref:Te,isDropTarget:Ce}=Pr({id:"chatbot-sidebar",data:{type:"chatbot-sidebar"}});h(()=>{if(!g){let{isAtBottom:e}=yr.getState();if(e||j){let r=Q.current?"auto":"smooth";oe.current?.scrollIntoView({behavior:r})}Q.current=!1}},[v,j,g]),h(()=>{if(g&&p)Y(p)},[g,Y,p]);let k=K(),Ae=N(()=>{k.invalidateQueries({queryKey:["search"]}),k.invalidateQueries({queryKey:["folders"]}),k.invalidateQueries({queryKey:["files"]}),k.invalidateQueries({queryKey:["file"]}),k.invalidateQueries({queryKey:["version_stacks"]}),k.invalidateQueries({queryKey:["projects"]})},[k]),V=(e)=>{if(typeof e==="string")return e;if(Array.isArray(e))return e.map((r)=>{if(typeof r==="string")return r;if(r&&typeof r==="object"&&"type"in r&&r.type==="text"&&"text"in r)return String(r.text);return""}).join("");return""},se=(e)=>e.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:"),Me=(e)=>{switch(e.role){case"user":case"custom":{let r=e;if(e.role==="custom"&&r.customType==="context_display_info"){let m=r.details?.assets||[];if(m.length===0)return null;return o("div",{className:"text-xs text-muted-foreground bg-muted/40 p-2.5 rounded-lg border border-border/50 space-y-1 my-1",children:[t("div",{className:"font-semibold",children:ky()}),t("ul",{className:"list-disc list-inside space-y-0.5",children:m.map((n)=>o("li",{className:"truncate",children:[n.name," ",o("span",{className:"text-muted-foreground/70",children:["(",n.type,")"]})]},n.id))})]},e.id)}if(e.role==="user"||r.customType==="shumai_message"){let s=r.details,m=s?.referencedAssets||[],n=s?.attachedFiles||[],i=s?.position,f=s?.annotation||s?.annotations&&s.annotations.length>0,d=!s?.currentAsset?.id||S&&s.currentAsset.id===S||x?.id&&s.currentAsset.id===x.id,b=ce===e.id,_="";if(i?.type==="time")if(H)_=H(i.seconds);else if(q){let a=Math.round(i.seconds*q);_=In(a,q,_e,U)}else{let a=Math.floor(i.seconds/60),y=Math.floor(i.seconds%60);_=`${a.toString().padStart(2,"0")}:${y.toString().padStart(2,"0")}`}else if(i?.type==="page")_=$h({page:i.page});let ae=V(r.content),je=n.length>0||m.length>0;return t("div",{onClick:()=>{if(d&&X)X(e)},className:E("flex flex-col items-end w-full group transition-all duration-150",d&&(f||i)&&"cursor-pointer"),children:o("div",{className:E("bg-primary text-primary-foreground rounded-lg px-3 py-2 text-sm whitespace-pre-wrap shadow-xs break-words transition-all border",je?"w-full":"max-w-[85%]",b?"border-blue-500 dark:border-blue-400":"border-transparent"),children:[o("div",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:[f&&t("span",{className:"inline-flex items-center align-middle mr-1.5 p-0.5 rounded bg-primary-foreground/20 text-primary-foreground",title:C0(),children:t(ua,{className:"w-3.5 h-3.5"})}),i&&t("span",{className:"inline-flex items-center align-middle mr-1.5 px-1.5 py-0.5 rounded text-xs font-mono font-bold bg-primary-foreground/20 text-primary-foreground",children:_}),ae&&t("span",{children:ae})]}),n.length>0&&o("div",{className:"mt-2.5 w-full",children:[t("div",{className:"text-xs font-medium text-primary-foreground/70 mb-1",children:Ly()}),t("div",{className:"flex flex-col gap-1.5 w-full",children:n.map((a)=>{let y=a.name||"file",W=Ls(y)||a.mediaType==="image"||a.mimeType?.startsWith("image/");return o("div",{className:E("group/att relative flex items-center w-full max-w-full rounded-lg border border-primary-foreground/15 bg-primary-foreground/10 hover:bg-primary-foreground/15 transition-colors overflow-hidden",W?"h-18 p-1.5 gap-2.5 cursor-pointer":"h-9 px-2.5 gap-2.5"),onClick:(J)=>{if(J.stopPropagation(),a.url)if(W)O({url:a.url,name:y});else window.open(a.url,"_blank","noreferrer")},children:[W&&a.url?t("div",{className:"h-full aspect-square rounded-md overflow-hidden bg-black/20 shrink-0",children:t("img",{src:a.url,alt:y,className:"w-full h-full object-cover group-hover/att:scale-105 transition-transform duration-200"})}):t(Xt,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}),t("div",{className:"min-w-0 flex-1 overflow-hidden",children:t("p",{className:"text-xs font-medium text-primary-foreground truncate block w-full",title:y,children:y})}),a.url&&t("a",{href:a.url,target:"_blank",rel:"noreferrer",download:y,className:"p-1 text-primary-foreground/70 hover:text-primary-foreground shrink-0 rounded-md hover:bg-primary-foreground/20 transition-colors opacity-0 group-hover/att:opacity-100",onClick:(J)=>J.stopPropagation(),title:gr(),children:t(vt,{className:"w-3.5 h-3.5"})})]},a.id)})})]}),m.length>0&&o("div",{className:"mt-2.5 w-full",children:[t("div",{className:"text-xs font-medium text-primary-foreground/70 mb-1",children:Ry()}),t("div",{className:"flex flex-col gap-1.5 w-full",children:m.map((a)=>o("div",{className:"flex items-center justify-between w-full h-9 px-2.5 rounded-lg border border-primary-foreground/15 bg-primary-foreground/10 hover:bg-primary-foreground/15 transition-colors overflow-hidden",children:[o("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[a.type==="folder"?t(or,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}):t(Xt,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}),t("span",{className:"text-xs font-medium truncate text-primary-foreground",title:a.name,children:a.name})]}),t("span",{className:"text-[10px] text-primary-foreground/60 uppercase shrink-0 font-mono ml-2",children:a.type})]},a.id))})]})]})},e.id)}let l=r.content||"";return t("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:V(l)},e.id)}case"assistant":{let l=e.content;if(!l)return null;let s=[];if(l.forEach((n,i)=>{if(!n||typeof n!=="object")return;let f=n;switch(f.type){case"text":{let d=f.text;if(typeof d!=="string"||!d.trim())return;s.push(t("div",{className:"text-sm leading-[1.8] prose prose-sm dark:prose-invert max-w-none break-words",children:t(xo,{components:{pre:({node:b,..._})=>t("pre",{className:"whitespace-pre-wrap break-all break-words bg-muted text-foreground p-4 rounded-md border border-border/50 font-mono text-sm",..._})},children:se(d)})},`txt-${i}`));break}case"thinking":{let d=f.thinking;if(typeof d!=="string"||!d.trim())return;s.push(o("details",{className:"group border border-border/50 rounded-lg bg-muted/20 my-2 overflow-hidden",children:[o("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-medium text-muted-foreground select-none cursor-pointer hover:bg-muted/40 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t(le,{className:"h-3.5 w-3.5 text-primary/70 animate-pulse"}),t("span",{children:mp()||"Thinking"}),t(be,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),t("div",{className:"p-3 pt-0 text-xs text-muted-foreground/90 border-t border-border/40 bg-muted/10 leading-relaxed prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap font-sans",children:t(xo,{children:se(d)})})]},`think-${i}`));break}case"toolCall":{let d=String(f.name||f.toolName||cn()),b=f.arguments||f.args;s.push(o("details",{className:"group border border-border/50 rounded-lg bg-violet-500/5 my-2 overflow-hidden",children:[o("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-semibold text-violet-600 dark:text-violet-400 select-none cursor-pointer hover:bg-violet-500/10 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t(So,{className:"h-3.5 w-3.5"}),t("span",{children:Af()}),t("span",{className:"font-mono bg-violet-500/10 px-1.5 py-0.5 rounded text-[11px] text-violet-700 dark:text-violet-300",children:d}),t(be,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),!!b&&o("div",{className:"p-3 pt-0 text-[10px] text-muted-foreground/90 border-t border-border/40 bg-violet-500/5 font-sans",children:[t("div",{className:"text-[9px] text-muted-foreground/60 uppercase font-bold tracking-wider mb-1.5",children:Tp()||"Arguments"}),t("pre",{className:"font-mono bg-muted/30 p-2 rounded border border-border/30 overflow-x-auto max-h-32",children:JSON.stringify(b,null,2)})]})]},`tool-${i}`));break}case"image":{let d=String(f.mimeType||"image/png"),b=String(f.data||"");s.push(t("div",{className:"my-2 max-w-full",children:b?t("img",{src:b.startsWith("data:")?b:`data:${d};base64,${b}`,alt:"Attached asset",className:"max-h-60 rounded border border-border/50 object-contain shadow-xs"}):t("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:Of()})},`img-${i}`));break}default:{let d=JSON.stringify(n,null,2);if(d==="{}")return;s.push(t("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:d},`other-${i}`))}}}),s.length===0)return null;let m=!1;if(l.length>0){let n=l[l.length-1];if(typeof n==="string"&&n.trim().length>0)m=!0;else if(n&&typeof n==="object"){let i=n;if(i.type==="text"&&typeof i.text==="string"&&i.text.trim().length>0)m=!0}}return o("div",{className:"flex flex-col w-full space-y-1",children:[t("div",{className:"space-y-2 w-full",children:s}),m&&t("div",{className:"text-[10px] text-muted-foreground self-start italic pt-1",children:V0()})]},e.id)}case"toolResult":return t("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/40 p-2 rounded-md border border-border/50",children:t("span",{className:"font-semibold",children:Mp({name:e.toolName||"tool"})})},e.id);case"thinking_level_change":{let l=e.content||"";return t("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:V(l)},e.id)}default:return null}};return o("div",{ref:Te,className:E("relative flex flex-col h-full bg-background transition-colors duration-200 min-h-0"),children:[Ce&&t("div",{className:"absolute inset-0 bg-accent/30 border-2 border-primary z-50 pointer-events-none flex items-center justify-center p-6 text-center animate-in fade-in duration-150",children:o("div",{className:"bg-background/95 text-foreground px-4 py-3 rounded-xl border border-border/80 flex flex-col items-center gap-2 shadow-lg max-w-[80%] animate-in zoom-in-95 duration-150",children:[t(wt,{className:"h-6 w-6 text-primary animate-bounce"}),t("span",{className:"text-sm font-semibold text-foreground",children:zm()})]})}),o("div",{className:"h-12 border-b border-border flex items-center justify-between px-4 flex-shrink-0 bg-background/50 backdrop-blur-sm",children:[o("div",{className:"flex items-center gap-2",children:[g&&t("button",{onClick:()=>I(!1),className:"p-1 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:Wy(),children:t(iu,{className:"h-4 w-4"})}),t(wt,{className:"h-5 w-5 text-primary"}),t("span",{className:"font-semibold text-sm",children:g?yh():_E()})]}),t("div",{className:"flex items-center gap-1",children:!g?o(B,{children:[t("button",{onClick:ee,className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:Ph(),children:t(fe,{className:"h-4 w-4"})}),t("button",{onClick:()=>I(!0),className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:yh(),children:t(_n,{className:"h-4 w-4"})})]}):o("button",{onClick:()=>{ee(),I(!1)},className:"flex items-center gap-1 text-xs bg-primary text-primary-foreground px-2.5 py-1 rounded-md hover:bg-primary/90 transition-colors shadow-xs cursor-pointer",children:[t(fe,{className:"h-3.5 w-3.5"}),t("span",{children:Ph()})]})})]}),g?t(ie,{className:"flex-1 p-3",children:G.length===0?t("div",{className:"text-center text-xs text-muted-foreground py-8",children:lx()}):t("div",{className:"space-y-1",children:G.map((e)=>{let r=e.id===ue;return o("div",{onClick:()=>{if(p)xe(p,e.id),I(!1)},className:E("group flex items-center justify-between p-2.5 rounded-lg text-xs cursor-pointer transition-all border border-transparent",r?"bg-accent/80 text-accent-foreground font-medium border-border/40":"hover:bg-muted/60 text-muted-foreground hover:text-foreground"),children:[o("div",{className:"flex flex-col min-w-0 pr-2",children:[t("span",{className:"truncate text-foreground font-medium text-xs",children:e.name||Rp()}),t("span",{className:"text-[10px] text-muted-foreground",children:Cn(e.updatedAt)})]}),t("button",{onClick:(l)=>{if(l.stopPropagation(),p&&window.confirm(w_()))he(p,e.id)},className:"opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-destructive p-1 rounded hover:bg-muted cursor-pointer",title:b_(),children:t(ve,{className:"h-4 w-4"})})]},e.id)})})}):o(B,{children:[t(ie,{ref:P,className:"flex-1 p-4 min-h-0 [&>div>div]:!block",children:v.length===0?o("div",{className:"flex flex-col items-center justify-center h-48 border-2 border-dashed border-border rounded-lg text-muted-foreground p-4 text-center",children:[t(wt,{className:"h-8 w-8 mb-2 opacity-50 text-muted-foreground"}),t("p",{className:"text-sm",children:zm()})]}):o("div",{className:"space-y-4 pb-4",children:[v.map(Me),j&&v.length>0&&(v[v.length-1].role==="user"||v[v.length-1].customType==="shumai_message")&&o("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground italic",children:[t(L,{className:"h-3 w-3 animate-spin text-primary"}),t("span",{children:mI()})]}),t("div",{ref:oe})]})}),t("div",{className:"p-2 flex-shrink-0 bg-background",children:t(Us,{projectId:c,value:ke,onChangeText:Ne,placeholder:MI(),disabled:!R||!p,isStreaming:j,onAbort:()=>{if(p)we(p)},allowMentions:!1,allowAttachments:!0,workspaceAssets:pe,onRemoveWorkspaceAsset:ge,allowMarkup:!0,canMarkup:!!x&&["image","video","pdf"].includes(x.proxyType||""),markupDisabledTooltip:!x?Rx():Uf(),allowTimestamp:x?.proxyType==="video"||x?.proxyType==="pdf",currentTime:de,frameRate:q||x?.media?.metadata?.frameRate||30,startTimecode:U||x?.media?.metadata?.startTimecode,formatTimestamp:H||(x?.proxyType==="pdf"?(e)=>$h({page:Math.round(e)}):void 0),onTyping:me,onSendMessage:(e,r,l,s,m,n)=>{if(!p)return;ye(p,e,c,S,Ae,r,l,m,n)},bottomLeftExtra:t("div",{className:"flex items-center gap-1.5 min-w-0 max-w-full",children:M.length>0?o(Le,{value:R||"",onValueChange:(e)=>D(e),disabled:j,children:[t(Be,{className:"h-8 border-none bg-transparent hover:bg-muted text-muted-foreground hover:text-foreground focus:ring-0 focus:ring-offset-0 px-2 py-0 gap-1.5 text-xs shrink-0 select-none shadow-none max-w-full cursor-pointer",children:t(Ze,{placeholder:Md()})}),t(Ue,{children:M.map((e)=>t(ne,{value:e.id,className:"cursor-pointer",children:o("div",{className:"flex items-center gap-2",children:[e.avatar?t("img",{src:e.avatar,alt:e.name,className:"w-4 h-4 rounded-full object-cover"}):t(wt,{className:"w-4 h-4 text-muted-foreground"}),t("span",{className:"text-xs",children:e.name})]})},e.id))})]}):t("div",{className:"flex items-center gap-1.5 px-2 py-1 text-[11px] text-muted-foreground/60 italic select-none",children:t("span",{children:rx()})})})})})]}),F&&o("div",{className:"fixed inset-0 z-[100] bg-black/95 flex flex-col items-center justify-center p-4 animate-in fade-in duration-200",onClick:()=>O(null),children:[t("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white hover:bg-white/20 rounded-full p-2 transition-colors z-50 cursor-pointer",children:t(De,{className:"w-8 h-8"})}),t("div",{className:"w-full h-full flex items-center justify-center p-2",children:t("img",{src:F.url,alt:F.name,className:"max-w-full max-h-[85vh] object-contain rounded shadow-2xl cursor-zoom-out",onClick:(e)=>{e.stopPropagation(),O(null)}})}),t("div",{className:"absolute bottom-6 text-white text-sm font-medium bg-black/50 px-4 py-2 rounded-full backdrop-blur-sm",children:F.name})]})]})}
2
+ export{ga};