@shumai-one/shumai 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/bin/{chunk-zf5cyxnt.js → chunk-03zkxckm.js} +1 -1
  2. package/bin/{chunk-2w6gve12.js → chunk-04nqnkzs.js} +3 -3
  3. package/bin/{chunk-rw5h0n0s.js → chunk-157axqz1.js} +1 -1
  4. package/bin/{chunk-w9z27p0m.js → chunk-1tesbv8w.js} +1 -1
  5. package/bin/{chunk-vzdgsfkf.js → chunk-24da4wg9.js} +1 -1
  6. package/bin/chunk-24nx3krz.js +2 -0
  7. package/bin/{chunk-twpc640e.js → chunk-26am2rzm.js} +1 -1
  8. package/bin/{chunk-8ayz61rc.js → chunk-2pt9h882.js} +3 -3
  9. package/bin/{chunk-mn108p93.js → chunk-2rrcdhkj.js} +1 -1
  10. package/bin/{chunk-ryepy5er.js → chunk-2w2bknn2.js} +4 -4
  11. package/bin/{chunk-ypkkfwfb.js → chunk-3ahax79y.js} +2 -2
  12. package/bin/{chunk-zdzkjp4q.js → chunk-3fjgf7eb.js} +2 -2
  13. package/bin/{chunk-rmvhyqyb.js → chunk-3wcvema0.js} +3 -3
  14. package/bin/{chunk-kvwec0p3.js → chunk-40tmh04g.js} +2 -2
  15. package/bin/chunk-45p7d22e.js +2 -0
  16. package/bin/chunk-461gcgrs.js +2 -0
  17. package/bin/{chunk-p0j4wpa5.js → chunk-4bc3gqmn.js} +1 -1
  18. package/bin/{chunk-8tzfcqtb.js → chunk-4nkwe7dz.js} +1 -1
  19. package/bin/{chunk-eqr0znmc.js → chunk-59ayg5am.js} +1 -1
  20. package/bin/{chunk-8zgq5sav.js → chunk-5ebb2pdf.js} +2 -2
  21. package/bin/{chunk-n76w2wcr.js → chunk-5y3kx4kk.js} +1 -1
  22. package/bin/{chunk-d2dgazjj.js → chunk-68xsb3t8.js} +1 -1
  23. package/bin/{chunk-n9vp9nbg.js → chunk-6hs63sva.js} +30 -30
  24. package/bin/{chunk-bpxw19ez.js → chunk-6pwf7qa6.js} +1 -1
  25. package/bin/{chunk-f5z3096k.js → chunk-6sq6dfa1.js} +2 -2
  26. package/bin/chunk-87secbzy.js +1 -0
  27. package/bin/chunk-8pykp70z.js +1 -0
  28. package/bin/{chunk-3pm6q6kg.js → chunk-8ts3xkme.js} +1 -1
  29. package/bin/{chunk-rza95y4z.js → chunk-909h3qzp.js} +2 -2
  30. package/bin/{chunk-0v9srsdz.js → chunk-929abwgr.js} +1 -1
  31. package/bin/{chunk-j53sjkxt.js → chunk-9ca8a5f2.js} +1 -1
  32. package/bin/{chunk-2pw7xcrn.js → chunk-9fyb95r5.js} +1 -1
  33. package/bin/{chunk-mneeg71d.js → chunk-axeq2pq5.js} +2 -2
  34. package/bin/{chunk-r249n1xe.js → chunk-b3tkvdfk.js} +2 -2
  35. package/bin/{chunk-9ggwc289.js → chunk-b6dbqs39.js} +1 -1
  36. package/bin/{chunk-w73v578p.js → chunk-b88tdt79.js} +2 -2
  37. package/bin/{chunk-19q13a80.js → chunk-bcyvxp1c.js} +4 -4
  38. package/bin/{chunk-7qvvf0yd.js → chunk-bn0taqr3.js} +2 -2
  39. package/bin/chunk-cb37q6t0.js +1 -0
  40. package/bin/chunk-cfqny70c.js +3 -0
  41. package/bin/{chunk-ffj9cq9y.js → chunk-cqnected.js} +1 -1
  42. package/bin/{chunk-98mg3dpd.js → chunk-cvfznrnt.js} +4 -4
  43. package/bin/{chunk-951r2rx1.js → chunk-d1q1tn36.js} +1 -1
  44. package/bin/{chunk-0asthrjf.js → chunk-d1rjpbgv.js} +2 -2
  45. package/bin/{chunk-81dawvn4.js → chunk-eshwjf91.js} +2 -2
  46. package/bin/{chunk-04avc4fn.js → chunk-fa9yq17g.js} +26 -26
  47. package/bin/{chunk-m6v8vt2b.js → chunk-fnkkwna8.js} +2 -2
  48. package/bin/{chunk-3q5qkfkc.js → chunk-fpjvr3qw.js} +1 -1
  49. package/bin/{chunk-ggfx2b0f.js → chunk-fsr83nb1.js} +1 -1
  50. package/bin/{chunk-kzr6ecke.js → chunk-fznchvm7.js} +1 -1
  51. package/bin/chunk-g2z0c39g.js +1 -0
  52. package/bin/{chunk-5vqbzsjv.js → chunk-gvcjqcjf.js} +1 -1
  53. package/bin/{chunk-0ge2mm8j.js → chunk-hbnpx0a5.js} +1 -1
  54. package/bin/{chunk-tvkekn4z.js → chunk-hgy9rqt1.js} +1 -1
  55. package/bin/chunk-hk659cg2.css +1 -0
  56. package/bin/{chunk-8ny7wvzb.js → chunk-hn2g40r6.js} +1 -1
  57. package/bin/{chunk-0y4zq3y4.js → chunk-hsx4pns6.js} +1 -1
  58. package/bin/{chunk-bbcmhcvc.js → chunk-hy5ncvpf.js} +2 -2
  59. package/bin/{chunk-5nqvqvqp.js → chunk-j420aqk8.js} +3 -3
  60. package/bin/{chunk-t1yamxgk.js → chunk-k3ds96cb.js} +1 -1
  61. package/bin/{chunk-dppfek34.js → chunk-m41tbrvt.js} +2 -2
  62. package/bin/chunk-m9f21ye9.js +1 -0
  63. package/bin/chunk-md7pgk86.js +2 -0
  64. package/bin/chunk-me3zmpj5.js +14 -0
  65. package/bin/chunk-mg6sybt0.js +1 -0
  66. package/bin/{chunk-jgfye6nf.js → chunk-mzme3m82.js} +1 -1
  67. package/bin/{chunk-ce0bhc72.js → chunk-n08h1jgx.js} +1 -1
  68. package/bin/{chunk-ae6zgjhd.js → chunk-ncv8v6mj.js} +2 -2
  69. package/bin/{chunk-cx32wsa1.js → chunk-nmd1901j.js} +1 -1
  70. package/bin/{chunk-wnqxyqrg.js → chunk-np39aknv.js} +2 -2
  71. package/bin/{chunk-dche0gy0.js → chunk-p7zw53ep.js} +1 -1
  72. package/bin/{chunk-xr2v0d6y.js → chunk-ppb4aj0y.js} +4 -4
  73. package/bin/{chunk-15vsw36h.js → chunk-pwq6dbb5.js} +5 -5
  74. package/bin/chunk-q1gfypy3.js +2 -0
  75. package/bin/{chunk-0j22699g.js → chunk-q4qqmes7.js} +2 -2
  76. package/bin/{chunk-vm2pz2hm.js → chunk-q7t5zs7n.js} +2 -2
  77. package/bin/{chunk-e439kt05.js → chunk-qcpeefhr.js} +1 -1
  78. package/bin/{chunk-6rn094yj.js → chunk-qjdvs1s5.js} +1 -1
  79. package/bin/{chunk-9zgqjdx1.js → chunk-qqapw198.js} +2 -2
  80. package/bin/chunk-qx553512.js +211 -0
  81. package/bin/chunk-r3s1x5wp.js +1 -0
  82. package/bin/{chunk-rtaya5wc.js → chunk-rh8dy99a.js} +2 -2
  83. package/bin/{chunk-5rzxekn4.js → chunk-s0vfj06y.js} +1 -1
  84. package/bin/{chunk-4zksqvwj.js → chunk-s6g2mzpn.js} +2 -2
  85. package/bin/{chunk-zckxc8m6.js → chunk-s9sf37dv.js} +2 -2
  86. package/bin/{chunk-19jpn3r6.js → chunk-scvepfv8.js} +1 -1
  87. package/bin/chunk-sjbvt3wa.js +2 -0
  88. package/bin/{chunk-mn208vrv.js → chunk-srmx5z3v.js} +2 -2
  89. package/bin/{chunk-r776bhsg.js → chunk-srv5kvm4.js} +1 -1
  90. package/bin/{chunk-qmrg2jhs.js → chunk-t1h12r3q.js} +5 -5
  91. package/bin/{chunk-gvas3xkp.js → chunk-t6myw0jf.js} +1 -1
  92. package/bin/{chunk-z8e4wc59.js → chunk-t8jfp3vx.js} +1 -1
  93. package/bin/{chunk-15w79661.js → chunk-tqdde9bj.js} +1 -1
  94. package/bin/chunk-vk9ecq8n.js +2 -0
  95. package/bin/{chunk-d5hbzp7t.js → chunk-vsnq4381.js} +1 -1
  96. package/bin/{chunk-1nvj833s.js → chunk-w4adkd0a.js} +5 -5
  97. package/bin/{chunk-qxscgcn9.js → chunk-wbmqbpgm.js} +1 -1
  98. package/bin/{chunk-v034sfw8.js → chunk-wperd2h9.js} +2 -2
  99. package/bin/{chunk-y2dhf3p0.js → chunk-xbw7ffrz.js} +2 -2
  100. package/bin/{chunk-9bakwac0.js → chunk-xdrpahym.js} +4 -4
  101. package/bin/{chunk-6jkjx0n2.js → chunk-xfmnfcv2.js} +3 -3
  102. package/bin/chunk-xhngtwn9.js +1 -0
  103. package/bin/chunk-xjnehexk.js +2 -0
  104. package/bin/chunk-xzb0t8mx.js +1 -0
  105. package/bin/{chunk-k3prp6c6.js → chunk-y5h5d5gx.js} +4 -4
  106. package/bin/{chunk-wwkhskce.js → chunk-y6xyc4wp.js} +2 -2
  107. package/bin/{chunk-93p27bbm.js → chunk-zpk87b33.js} +5 -5
  108. package/bin/{chunk-asy868kq.js → chunk-zq5j9wsc.js} +1 -1
  109. package/bin/{chunk-grjek810.js → chunk-zsg61vr0.js} +2 -2
  110. package/bin/chunk-zts21ft7.js +1 -0
  111. package/bin/{chunk-cpj562n6.js → chunk-zzbn0b6c.js} +1 -1
  112. package/bin/shumai-app.html +1 -1
  113. package/bin/shumai-app.js +350 -333
  114. package/package.json +7 -7
  115. package/prisma/migrations/20261014054332_add_embedding_768/migration.sql +8 -0
  116. package/prisma/schema.prisma +10 -8
  117. package/bin/chunk-2gf95tj0.js +0 -1
  118. package/bin/chunk-2tk5w3jc.js +0 -1
  119. package/bin/chunk-301e7g3z.js +0 -2
  120. package/bin/chunk-3kmjbc3m.js +0 -2
  121. package/bin/chunk-3td60k1m.js +0 -2
  122. package/bin/chunk-42hrvk6k.js +0 -211
  123. package/bin/chunk-5bk16qdp.js +0 -2
  124. package/bin/chunk-8abhmarc.js +0 -2
  125. package/bin/chunk-965102pf.js +0 -3
  126. package/bin/chunk-acn3r2m2.js +0 -1
  127. package/bin/chunk-ce75dw3k.css +0 -1
  128. package/bin/chunk-d9qpgkek.js +0 -2
  129. package/bin/chunk-dv6p6n5e.js +0 -1
  130. package/bin/chunk-qb178ntp.js +0 -2
  131. package/bin/chunk-s4r6e6ms.js +0 -1
  132. package/bin/chunk-syjjke3f.js +0 -1
  133. package/bin/chunk-tgfxe0sb.js +0 -1
  134. package/bin/chunk-tjretpx8.js +0 -1
  135. package/bin/chunk-w4yjgez6.js +0 -14
  136. package/bin/chunk-wjcebkpb.js +0 -1
  137. package/bin/chunk-ws71fg50.js +0 -2
  138. package/bin/chunk-yfp3q4da.js +0 -1
@@ -1 +1 @@
1
- import{m,_,u,S,L,t,o,V,Ta,Z,B,Re,An,ze,A,O,tr,E,C,De,ct,jc,qc,ab,Ad,Da,iv,Fh,Zo,FC,Gn,Xe,et,tt,rt,nt,ot,st,it,ue,ae,pe,qe,le,z,ut,Nt,M,dn,jr,$t,ur,_r,Bo,ZA}from"./chunk-42hrvk6k.js";import"./chunk-w9z27p0m.js";import"./chunk-ffj9cq9y.js";import{Lr}from"./chunk-wnqxyqrg.js";import"./chunk-ryepy5er.js";import{Ii}from"./chunk-zckxc8m6.js";import{ts,Gl,ns,Ss}from"./chunk-04avc4fn.js";import{jl,ql}from"./chunk-mneeg71d.js";import"./chunk-8ayz61rc.js";import{Mi}from"./chunk-6jkjx0n2.js";import{Ir}from"./chunk-bpxw19ez.js";import"./chunk-15w79661.js";import"./chunk-zf5cyxnt.js";import"./chunk-8tzfcqtb.js";import"./chunk-9zgqjdx1.js";import"./chunk-grjek810.js";import"./chunk-d2dgazjj.js";S();var At=({item:n})=>{if(n.preview?.thumbnailUrl)return t("img",{src:n.preview.thumbnailUrl,alt:"Preview",className:"w-full h-full object-cover"});if(n.preview?.proxyType==="audio"||n.proxyType==="audio")return t("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:t(ts,{className:"w-5 h-5 text-muted-foreground"})});return t("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:t(tr,{className:"w-5 h-5 text-muted-foreground"})})},Me=({projectId:n,currentAssetId:s,parentFolderId:w,initialFiles:d,initialNextCursor:F})=>{let{ref:a,inView:R}=Nt({threshold:0,rootMargin:"200px"}),x=_(null),N=_(!0),[c,p]=u(d),[f,U]=u(F),[W,Y]=u(!!F),[q,h]=u(!1);return m(()=>{p(d),U(F),Y(!!F),N.current=!0},[d,F]),m(()=>{(async()=>{if(!f||q||!R||!W)return;h(!0);try{let y=await A.api.folders[":folderId"].search.$post({param:{folderId:w},json:{assetType:"file",after:f,first:200,recursively:!1,conditions:[]}});if(!y.ok)throw Error("Failed to fetch next page");let P=await y.json(),X=P.data||[];p((G)=>[...G,...X]),U(P.pageInfo?.cursor||void 0),Y(!!P.pageInfo?.cursor&&X.length>0)}catch(y){console.error("Error fetching next page:",y)}finally{h(!1)}})()},[R,f,W,q,w]),m(()=>{if(c.some((y)=>y?.id===s)&&x.current)if(N.current)x.current.scrollIntoView({block:"center",inline:"center",behavior:"auto"}),N.current=!1;else x.current.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[c,s]),t("div",{className:"h-24 md:h-full w-full md:w-24 bg-gray-100 dark:bg-gray-950 flex flex-row md:flex-col flex-shrink-0 select-none",children:o("div",{className:"flex-1 overflow-x-auto overflow-y-hidden md:overflow-y-auto md:overflow-x-hidden px-4 md:px-0 py-2 md:py-4 flex flex-row md:flex-col items-center gap-3 no-scrollbar",children:[c.map((g)=>{if(!g)return null;let y=g.id===s;return t("div",{ref:g.id===s?x:null,className:"flex-shrink-0",children:o(An,{to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:g.id},search:{version:void 0},className:E("rounded-lg border overflow-hidden flex items-center justify-center transition-all bg-muted/30 block relative",y?"w-[62px] h-[62px] opacity-100":"w-[52px] h-[52px] opacity-60 hover:opacity-100"),children:[t(At,{item:g}),g.agent&&t("span",{className:"absolute top-1 right-1 z-10 pointer-events-none select-none rounded bg-black/60 px-1 py-0.5 text-[10px] font-medium leading-none text-white",title:g.agent.name,"data-testid":"carousel-agent-badge",children:"AI"})]})},g.id)}),W&&t("div",{ref:a,className:"px-2 md:px-0 py-2 md:py-4 flex justify-center items-center h-full md:w-full flex-shrink-0",children:q&&t(O,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})})};S();function jt(){let{projectId:n,fileId:s}=Ne.useParams(),w=Ne.useSearch(),{version:d,start:F}=w,a=d||s,{cmpLeft:R,cmpRight:x}=w,N=w.cmpActive??"left",c=!!w.compare&&!!R&&!!x,p=_(null),{teamId:f,ensureTeamIdForProject:U}=ut(),[W,Y]=u(360),[q,h]=u([]),{fileViewRightSidebarCollapsed:g}=$t(),{isChatbotOpen:y}=ur(),P=_r((e)=>Boolean(e.metadata["appearance.hideAgent"])),[X,G]=u(0),[he,T]=u(null),[ge,Le]=u(null),[Ee,ye]=u(void 0),[K,ne]=u({show:!1,files:[],nextCursor:void 0,folderId:void 0}),Ve=A.api.files[":fileId"].metadata.$patch,{mutate:Pe}=B({mutationFn:async(e)=>{let r=await Ve(e);if(!r.ok)throw Error("Failed to patch metadata");return await r.json()}}),J=V(),{members:_e,fetchProjectMembers:Ie}=jr(),Ke=Bo();m(()=>{U(n)},[n,U]),m(()=>{if(n)Ie(n,!0)},[n,Ie]),m(()=>{if(n&&s)A.api.projects[":projectId"].recents.view.$post({param:{projectId:n},json:{assetId:s}}).catch(()=>{})},[n,s]);let{data:ve,isLoading:Oe,isError:He,isFetching:Qe}=Z({queryKey:["files",s],queryFn:async()=>{let e=await A.api.files[":fileId"].$get({param:{fileId:s}});if(!e.ok)throw Error("Failed to fetch stack");return await e.json()},enabled:!!f,placeholderData:Ta}),{data:Be,isLoading:Ue,isError:We,isFetching:Ge}=Z({queryKey:["files",d],queryFn:async()=>{let e=await A.api.files[":fileId"].$get({param:{fileId:d}});if(!e.ok)throw Error("Failed to fetch version");return await e.json()},enabled:!!f&&!!d,placeholderData:Ta}),{data:Je}=Z({queryKey:["version_stacks",s,"versions"],queryFn:async()=>{let e=await A.api.version_stacks[":stackId"].versions.$get({param:{stackId:s}});if(!e.ok)throw Error("Failed to fetch versions");return await e.json()},enabled:!!n&&!!s&&(!!d||c)}),{data:k}=Z({queryKey:["projects",n],queryFn:async()=>{let e=await A.api.projects[":projectId"].$get({param:{projectId:n}});if(!e.ok)throw Error("Failed to fetch project");return await e.json()}}),I=Re(),{setProjectState:we,clearProjectState:xe}=dn(),Ye=Oe||!!d&&Ue,Ze=He||!!d&&We,at=Qe||!!d&&Ge,i=Be||ve,b=d?Je:ve?.versionStack?.versions,l=i?.ancestorFolders?.[0]?.id??k?.rootFolder??"",[re,ee]=u(!1),[te,be]=u(""),se=_(null),ie=_(!1),[lt,ce]=u(!1),dt=A.api.files[":fileId"].$put,{mutate:ft,mutateAsync:pt,isPending:Fe}=B({mutationFn:async(e)=>{let r=await dt(e);if(!r.ok)throw Error("Failed to rename file");return await r.json()},onSuccess:()=>{J.invalidateQueries({queryKey:["files"]}),J.invalidateQueries({queryKey:["version_stacks"]}),M.success(FC?.()||"Renamed successfully"),ee(!1)},onError:()=>{M.error(iv?.()||"Failed to rename")}}),mt=A.api.files.$delete,{mutate:ht,mutateAsync:gt,isPending:ke}=B({mutationFn:async(e)=>{if(!(await mt(e)).ok)throw Error("Failed to delete file")},onSuccess:()=>{if(J.invalidateQueries({queryKey:["files"]}),J.invalidateQueries({queryKey:["version_stacks"]}),M.success(ab?.()||"Deleted"),ce(!1),l&&l!==k?.rootFolder)I({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:l}});else I({to:"/projects/$projectId",params:{projectId:n}})},onError:()=>{M.error(Da?.()||"Failed to delete")}}),yt=(e)=>{if(e?.preventDefault(),!te.trim()||!a)return;ft({param:{fileId:a},json:{name:te.trim()}})},It=()=>{if(!a)return;ht({json:{ids:[a]}})};m(()=>{if(i&&k&&f)we({teamId:f,projectId:n,projectName:k.name??"",ancestorFolders:i.ancestorFolders??[],currentAsset:{id:a||s,name:i.name,type:"file",version:b?b.find((e)=>e.id===a)?.version??b.length:void 0,proxyType:i.proxyType},isRootFolder:!1,fileId:s,downloadInfo:{originalKey:i.media?.original?.key,videoTranscodes:i.media?.videoTranscodes?.map((e)=>({key:e.key,width:e.width,height:e.height,resolution:e.resolution,hdr:e.hdr}))},versions:b,compareMode:c,canCompareVersions:(b?.length??0)>=2,onCompareVersions:()=>{let e=Gl(b);if(!e)return;I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,version:void 0,compare:!0,cmpLeft:e.left.id,cmpRight:e.right.id,cmpActive:"left"})})},onFolderClick:(e)=>{I({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:e}})},onRename:()=>{ie.current=!1,be(i?.name??""),ee(!0)},onDelete:()=>{ce(!0)}});return()=>xe()},[f,n,k,i,b,a,s,c,we,xe,I]),m(()=>{if(!re)return;let e=setTimeout(()=>{ie.current=!0},1000);return()=>clearTimeout(e)},[re]);let vt=()=>{if(ie.current)return;setTimeout(()=>{if(se.current)Ss(se.current)},0)};if(m(()=>{if(!l||!a)return;if(K.folderId===l)return;let e=!0;return(async()=>{try{let v="",j=!1,D=[],fe=void 0;for(let Se=0;Se<5;Se++){let Te=await A.api.folders[":folderId"].search.$post({param:{folderId:l},json:{assetType:"file",after:v,first:200,recursively:!1,conditions:[]}});if(!Te.ok)throw Error("Failed to search parent folder for carousel");let Q=await Te.json(),me=Q.data||[];if(D.push(...me),me.some((oe)=>oe.id===a)){if(j=!0,fe=Q.pageInfo?.cursor||void 0,Q.pageInfo?.cursor)try{let oe=await A.api.folders[":folderId"].search.$post({param:{folderId:l},json:{assetType:"file",after:Q.pageInfo.cursor,first:200,recursively:!1,conditions:[]}});if(oe.ok){let $e=await oe.json(),kt=$e.data||[];D.push(...kt),fe=$e.pageInfo?.cursor||void 0}}catch{}break}if(!Q.pageInfo?.cursor||me.length<200)break;v=Q.pageInfo.cursor}if(e)if(j)ne({show:!0,files:D,nextCursor:fe,folderId:l});else ne({show:!1,files:[],nextCursor:void 0,folderId:l})}catch(v){if(console.error(v),e)ne({show:!1,files:[],nextCursor:void 0,folderId:l})}})(),()=>{e=!1}},[l,a,K.folderId]),m(()=>{G(0),T(null),h([])},[i?.id]),m(()=>{T(null),h([])},[ge?.id]),m(()=>{Lr.getState().reset(),Lr.getState().setIsDrawing(!1),h([]),T(null)},[a]),Ye&&!i)return t(ZA,{});if(Ze||!i||!k||!f)return t("div",{children:Fh()});let H=c?ge:i,Ae=H?.id??a,je=(e,r)=>{if(!f)return;Pe({param:{fileId:Ae},json:[{key:e,value:r}]},{onSuccess:()=>{J.invalidateQueries({queryKey:["files",Ae]})}})},de=(e)=>{I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,...e})})},wt=()=>{de({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:N==="left"?R:x})},xt=(e)=>{T(e.id||null);let r=e.annotations;if(r&&r.length>0)h(r);else h([]);if(c){if(e.second!==null&&e.second!==void 0)ye({second:e.second,nonce:Date.now()});return}if(e.second!==null&&e.second!==void 0)p.current?.seekTo(e.second),p.current?.pause();else if(r&&r.length>0)p.current?.pause()},bt=(e)=>{T(e.id||null);let v=e.details,j=v?.annotations;if(j&&j.length>0)h(j);else h([]);let D=v?.position?.type==="time"?v.position.seconds:v?.position?.type==="page"?v.position.page:void 0;if(c){if(D!==void 0)ye({second:D,nonce:Date.now()});return}if(D!==void 0)p.current?.seekTo(D),p.current?.pause();else if(j&&j.length>0)p.current?.pause()},Ce=()=>{h([]),T(null)},Ft=()=>{h([]),T(null)};if(Ke&&!c)return t(jl,{projectId:n,teamId:f,fileId:s,file:i,projectInfo:k,ancestorFolders:i.ancestorFolders??[],parentFolderId:l,versions:b,activeFileId:a,startTime:F,siblingFiles:K.files,onNavigateToFile:(e)=>{I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:e}})},onNavigateBack:()=>{if(l&&l!==k?.rootFolder)I({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:l}});else I({to:"/projects/$projectId",params:{projectId:n}})},onSelectVersion:(e)=>{I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,version:e})})},onRenameFile:async(e)=>{await pt({param:{fileId:a},json:{name:e}})},onDeleteFile:async()=>{await gt({json:{ids:[a]}})},onSaveField:je});return o("div",{className:"h-full flex flex-1 flex-col bg-background",children:[o("div",{className:"h-full flex flex-1 overflow-hidden",children:[o("div",{className:"flex-1 relative",children:[at&&!c&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:t(O,{className:"h-8 w-8 animate-spin text-foreground"})}),c&&R&&x?t(ql,{versions:b??[],leftId:R,rightId:x,activeSide:N,annotations:q,seekRequest:Ee,onActiveSideChange:(e)=>de({cmpActive:e}),onSwitchVersion:(e,r)=>de(e==="left"?{cmpLeft:r}:{cmpRight:r}),onExit:wt,onActiveAssetChange:Le,onPlay:Ce,onTimeUpdate:G}):t(ns,{file:i,mediaControllerRef:p,onPlay:Ce,onTimeUpdate:G,onSeek:Ft,annotations:q,startTime:F,children:K.show&&t(Me,{projectId:n,currentAssetId:a,parentFolderId:l,initialFiles:K.files,initialNextCursor:K.nextCursor})})]}),(!g||y&&!P)&&o(L,{children:[t(Ir,{onResize:(e)=>{Y((r)=>Math.max(300,Math.min(600,r-e)))},className:"hidden md:block"}),t("div",{style:{width:W},className:"flex-shrink-0 bg-background flex flex-col",children:y&&!P?t(Ii,{projectId:n,contextAssetId:a,file:H,currentTime:X,frameRate:H?.media?.metadata?.frameRate||30,startTimecode:H?.media?.metadata?.startTimecode,onTyping:()=>{if(c)return;p.current?.pause()},onSelectMessage:bt,selectedMessageId:he}):t(Mi,{teamId:f,projectId:n,file:H,onSaveField:je,members:_e,onCommentSelect:xt,currentTime:X,onTyping:()=>{if(c)return;p.current?.pause()},selectedCommentId:he,hideAnnotationControl:H?.proxyType==="audio"})})]})]}),t(ue,{open:re,onOpenChange:ee,children:t(ae,{children:o("form",{onSubmit:yt,children:[t(pe,{children:t(le,{children:Zo()})}),t("div",{className:"py-4",children:t(z,{ref:se,value:te,onChange:(e)=>be(e.target.value),placeholder:Ad?.()||"Enter new name",onFocus:vt,autoFocus:!0})}),o(qe,{children:[t(C,{type:"button",variant:"outline",onClick:()=>ee(!1),children:De()}),o(C,{type:"submit",disabled:Fe||!te.trim(),children:[Fe&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),Gn()]})]})]})})}),t(Xe,{open:lt,onOpenChange:ce,children:o(et,{children:[o(tt,{children:[t(nt,{children:qc?.()||"Delete Asset?"}),t(ot,{children:jc?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),o(rt,{children:[t(it,{children:De()}),o(st,{onClick:It,disabled:ke,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[ke&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),ct()]})]})]})})]})}var Ne=ze("/projects/$projectId/files/$fileId")({component:jt});export{Ne as Route};
1
+ import{m,_,u,S,L,t,o,V,Ta,Z,B,Re,gn,ze,A,O,ar,C,E,De,ct,Hc,$c,lb,Ad,Oa,av,Fh,Zo,FC,Gn,Xe,et,tt,rt,nt,ot,st,it,ue,ae,pe,qe,le,z,ut,Nt,M,un,jr,$t,ur,_r,Bo,LA}from"./chunk-qx553512.js";import"./chunk-1tesbv8w.js";import"./chunk-cqnected.js";import{Lr}from"./chunk-np39aknv.js";import"./chunk-2w2bknn2.js";import{Ti}from"./chunk-s9sf37dv.js";import{ts,Kl,ns,Ss}from"./chunk-fa9yq17g.js";import{$l,Gl}from"./chunk-axeq2pq5.js";import"./chunk-2pt9h882.js";import{ki}from"./chunk-xfmnfcv2.js";import{Ir}from"./chunk-6pwf7qa6.js";import"./chunk-tqdde9bj.js";import"./chunk-03zkxckm.js";import"./chunk-4nkwe7dz.js";import"./chunk-qqapw198.js";import"./chunk-zsg61vr0.js";import"./chunk-68xsb3t8.js";S();var At=({item:n})=>{if(n.preview?.thumbnailUrl)return t("img",{src:n.preview.thumbnailUrl,alt:"Preview",className:"w-full h-full object-cover"});if(n.preview?.proxyType==="audio"||n.proxyType==="audio")return t("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:t(ts,{className:"w-5 h-5 text-muted-foreground"})});return t("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:t(ar,{className:"w-5 h-5 text-muted-foreground"})})},Me=({projectId:n,currentAssetId:s,parentFolderId:w,initialFiles:d,initialNextCursor:F})=>{let{ref:a,inView:R}=Nt({threshold:0,rootMargin:"200px"}),x=_(null),N=_(!0),[c,p]=u(d),[f,U]=u(F),[W,Y]=u(!!F),[q,h]=u(!1);return m(()=>{p(d),U(F),Y(!!F),N.current=!0},[d,F]),m(()=>{(async()=>{if(!f||q||!R||!W)return;h(!0);try{let y=await A.api.folders[":folderId"].search.$post({param:{folderId:w},json:{assetType:"file",after:f,first:200,recursively:!1,conditions:[]}});if(!y.ok)throw Error("Failed to fetch next page");let P=await y.json(),X=P.data||[];p((G)=>[...G,...X]),U(P.pageInfo?.cursor||void 0),Y(!!P.pageInfo?.cursor&&X.length>0)}catch(y){console.error("Error fetching next page:",y)}finally{h(!1)}})()},[R,f,W,q,w]),m(()=>{if(c.some((y)=>y?.id===s)&&x.current)if(N.current)x.current.scrollIntoView({block:"center",inline:"center",behavior:"auto"}),N.current=!1;else x.current.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[c,s]),t("div",{className:"h-24 md:h-full w-full md:w-24 bg-gray-100 dark:bg-gray-950 flex flex-row md:flex-col flex-shrink-0 select-none",children:o("div",{className:"flex-1 overflow-x-auto overflow-y-hidden md:overflow-y-auto md:overflow-x-hidden px-4 md:px-0 py-2 md:py-4 flex flex-row md:flex-col items-center gap-3 no-scrollbar",children:[c.map((g)=>{if(!g)return null;let y=g.id===s;return t("div",{ref:g.id===s?x:null,className:"flex-shrink-0",children:o(gn,{to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:g.id},search:{version:void 0},className:C("rounded-lg border overflow-hidden flex items-center justify-center transition-all bg-muted/30 block relative",y?"w-[62px] h-[62px] opacity-100":"w-[52px] h-[52px] opacity-60 hover:opacity-100"),children:[t(At,{item:g}),g.agent&&t("span",{className:"absolute top-1 right-1 z-10 pointer-events-none select-none rounded bg-black/60 px-1 py-0.5 text-[10px] font-medium leading-none text-white",title:g.agent.name,"data-testid":"carousel-agent-badge",children:"AI"})]})},g.id)}),W&&t("div",{ref:a,className:"px-2 md:px-0 py-2 md:py-4 flex justify-center items-center h-full md:w-full flex-shrink-0",children:q&&t(O,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})})};S();function jt(){let{projectId:n,fileId:s}=Ne.useParams(),w=Ne.useSearch(),{version:d,start:F}=w,a=d||s,{cmpLeft:R,cmpRight:x}=w,N=w.cmpActive??"left",c=!!w.compare&&!!R&&!!x,p=_(null),{teamId:f,ensureTeamIdForProject:U}=ut(),[W,Y]=u(360),[q,h]=u([]),{fileViewRightSidebarCollapsed:g}=$t(),{isChatbotOpen:y}=ur(),P=_r((e)=>Boolean(e.metadata["appearance.hideAgent"])),[X,G]=u(0),[he,T]=u(null),[ge,Le]=u(null),[Ee,ye]=u(void 0),[K,ne]=u({show:!1,files:[],nextCursor:void 0,folderId:void 0}),Ve=A.api.files[":fileId"].metadata.$patch,{mutate:Pe}=B({mutationFn:async(e)=>{let r=await Ve(e);if(!r.ok)throw Error("Failed to patch metadata");return await r.json()}}),J=V(),{members:_e,fetchProjectMembers:Ie}=jr(),Ke=Bo();m(()=>{U(n)},[n,U]),m(()=>{if(n)Ie(n,!0)},[n,Ie]),m(()=>{if(n&&s)A.api.projects[":projectId"].recents.view.$post({param:{projectId:n},json:{assetId:s}}).catch(()=>{})},[n,s]);let{data:ve,isLoading:Oe,isError:He,isFetching:Qe}=Z({queryKey:["files",s],queryFn:async()=>{let e=await A.api.files[":fileId"].$get({param:{fileId:s}});if(!e.ok)throw Error("Failed to fetch stack");return await e.json()},enabled:!!f,placeholderData:Ta}),{data:Be,isLoading:Ue,isError:We,isFetching:Ge}=Z({queryKey:["files",d],queryFn:async()=>{let e=await A.api.files[":fileId"].$get({param:{fileId:d}});if(!e.ok)throw Error("Failed to fetch version");return await e.json()},enabled:!!f&&!!d,placeholderData:Ta}),{data:Je}=Z({queryKey:["version_stacks",s,"versions"],queryFn:async()=>{let e=await A.api.version_stacks[":stackId"].versions.$get({param:{stackId:s}});if(!e.ok)throw Error("Failed to fetch versions");return await e.json()},enabled:!!n&&!!s&&(!!d||c)}),{data:k}=Z({queryKey:["projects",n],queryFn:async()=>{let e=await A.api.projects[":projectId"].$get({param:{projectId:n}});if(!e.ok)throw Error("Failed to fetch project");return await e.json()}}),I=Re(),{setProjectState:we,clearProjectState:xe}=un(),Ye=Oe||!!d&&Ue,Ze=He||!!d&&We,at=Qe||!!d&&Ge,i=Be||ve,b=d?Je:ve?.versionStack?.versions,l=i?.ancestorFolders?.[0]?.id??k?.rootFolder??"",[re,ee]=u(!1),[te,be]=u(""),se=_(null),ie=_(!1),[lt,ce]=u(!1),dt=A.api.files[":fileId"].$put,{mutate:ft,mutateAsync:pt,isPending:Fe}=B({mutationFn:async(e)=>{let r=await dt(e);if(!r.ok)throw Error("Failed to rename file");return await r.json()},onSuccess:()=>{J.invalidateQueries({queryKey:["files"]}),J.invalidateQueries({queryKey:["version_stacks"]}),M.success(FC?.()||"Renamed successfully"),ee(!1)},onError:()=>{M.error(av?.()||"Failed to rename")}}),mt=A.api.files.$delete,{mutate:ht,mutateAsync:gt,isPending:ke}=B({mutationFn:async(e)=>{if(!(await mt(e)).ok)throw Error("Failed to delete file")},onSuccess:()=>{if(J.invalidateQueries({queryKey:["files"]}),J.invalidateQueries({queryKey:["version_stacks"]}),M.success(lb?.()||"Deleted"),ce(!1),l&&l!==k?.rootFolder)I({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:l}});else I({to:"/projects/$projectId",params:{projectId:n}})},onError:()=>{M.error(Oa?.()||"Failed to delete")}}),yt=(e)=>{if(e?.preventDefault(),!te.trim()||!a)return;ft({param:{fileId:a},json:{name:te.trim()}})},It=()=>{if(!a)return;ht({json:{ids:[a]}})};m(()=>{if(i&&k&&f)we({teamId:f,projectId:n,projectName:k.name??"",ancestorFolders:i.ancestorFolders??[],currentAsset:{id:a||s,name:i.name,type:"file",version:b?b.find((e)=>e.id===a)?.version??b.length:void 0,proxyType:i.proxyType},isRootFolder:!1,fileId:s,downloadInfo:{originalKey:i.media?.original?.key,videoTranscodes:i.media?.videoTranscodes?.map((e)=>({key:e.key,width:e.width,height:e.height,resolution:e.resolution,hdr:e.hdr}))},versions:b,compareMode:c,canCompareVersions:(b?.length??0)>=2,onCompareVersions:()=>{let e=Kl(b);if(!e)return;I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,version:void 0,compare:!0,cmpLeft:e.left.id,cmpRight:e.right.id,cmpActive:"left"})})},onFolderClick:(e)=>{I({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:e}})},onRename:()=>{ie.current=!1,be(i?.name??""),ee(!0)},onDelete:()=>{ce(!0)}});return()=>xe()},[f,n,k,i,b,a,s,c,we,xe,I]),m(()=>{if(!re)return;let e=setTimeout(()=>{ie.current=!0},1000);return()=>clearTimeout(e)},[re]);let vt=()=>{if(ie.current)return;setTimeout(()=>{if(se.current)Ss(se.current)},0)};if(m(()=>{if(!l||!a)return;if(K.folderId===l)return;let e=!0;return(async()=>{try{let v="",j=!1,D=[],fe=void 0;for(let Se=0;Se<5;Se++){let Te=await A.api.folders[":folderId"].search.$post({param:{folderId:l},json:{assetType:"file",after:v,first:200,recursively:!1,conditions:[]}});if(!Te.ok)throw Error("Failed to search parent folder for carousel");let Q=await Te.json(),me=Q.data||[];if(D.push(...me),me.some((oe)=>oe.id===a)){if(j=!0,fe=Q.pageInfo?.cursor||void 0,Q.pageInfo?.cursor)try{let oe=await A.api.folders[":folderId"].search.$post({param:{folderId:l},json:{assetType:"file",after:Q.pageInfo.cursor,first:200,recursively:!1,conditions:[]}});if(oe.ok){let $e=await oe.json(),kt=$e.data||[];D.push(...kt),fe=$e.pageInfo?.cursor||void 0}}catch{}break}if(!Q.pageInfo?.cursor||me.length<200)break;v=Q.pageInfo.cursor}if(e)if(j)ne({show:!0,files:D,nextCursor:fe,folderId:l});else ne({show:!1,files:[],nextCursor:void 0,folderId:l})}catch(v){if(console.error(v),e)ne({show:!1,files:[],nextCursor:void 0,folderId:l})}})(),()=>{e=!1}},[l,a,K.folderId]),m(()=>{G(0),T(null),h([])},[i?.id]),m(()=>{T(null),h([])},[ge?.id]),m(()=>{Lr.getState().reset(),Lr.getState().setIsDrawing(!1),h([]),T(null)},[a]),Ye&&!i)return t(LA,{});if(Ze||!i||!k||!f)return t("div",{children:Fh()});let H=c?ge:i,Ae=H?.id??a,je=(e,r)=>{if(!f)return;Pe({param:{fileId:Ae},json:[{key:e,value:r}]},{onSuccess:()=>{J.invalidateQueries({queryKey:["files",Ae]})}})},de=(e)=>{I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,...e})})},wt=()=>{de({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:N==="left"?R:x})},xt=(e)=>{T(e.id||null);let r=e.annotations;if(r&&r.length>0)h(r);else h([]);if(c){if(e.second!==null&&e.second!==void 0)ye({second:e.second,nonce:Date.now()});return}if(e.second!==null&&e.second!==void 0)p.current?.seekTo(e.second),p.current?.pause();else if(r&&r.length>0)p.current?.pause()},bt=(e)=>{T(e.id||null);let v=e.details,j=v?.annotations;if(j&&j.length>0)h(j);else h([]);let D=v?.position?.type==="time"?v.position.seconds:v?.position?.type==="page"?v.position.page:void 0;if(c){if(D!==void 0)ye({second:D,nonce:Date.now()});return}if(D!==void 0)p.current?.seekTo(D),p.current?.pause();else if(j&&j.length>0)p.current?.pause()},Ce=()=>{h([]),T(null)},Ft=()=>{h([]),T(null)};if(Ke&&!c)return t($l,{projectId:n,teamId:f,fileId:s,file:i,projectInfo:k,ancestorFolders:i.ancestorFolders??[],parentFolderId:l,versions:b,activeFileId:a,startTime:F,siblingFiles:K.files,onNavigateToFile:(e)=>{I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:e}})},onNavigateBack:()=>{if(l&&l!==k?.rootFolder)I({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:l}});else I({to:"/projects/$projectId",params:{projectId:n}})},onSelectVersion:(e)=>{I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,version:e})})},onRenameFile:async(e)=>{await pt({param:{fileId:a},json:{name:e}})},onDeleteFile:async()=>{await gt({json:{ids:[a]}})},onSaveField:je});return o("div",{className:"h-full flex flex-1 flex-col bg-background",children:[o("div",{className:"h-full flex flex-1 overflow-hidden",children:[o("div",{className:"flex-1 relative",children:[at&&!c&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:t(O,{className:"h-8 w-8 animate-spin text-foreground"})}),c&&R&&x?t(Gl,{versions:b??[],leftId:R,rightId:x,activeSide:N,annotations:q,seekRequest:Ee,onActiveSideChange:(e)=>de({cmpActive:e}),onSwitchVersion:(e,r)=>de(e==="left"?{cmpLeft:r}:{cmpRight:r}),onExit:wt,onActiveAssetChange:Le,onPlay:Ce,onTimeUpdate:G}):t(ns,{file:i,mediaControllerRef:p,onPlay:Ce,onTimeUpdate:G,onSeek:Ft,annotations:q,startTime:F,children:K.show&&t(Me,{projectId:n,currentAssetId:a,parentFolderId:l,initialFiles:K.files,initialNextCursor:K.nextCursor})})]}),(!g||y&&!P)&&o(L,{children:[t(Ir,{onResize:(e)=>{Y((r)=>Math.max(300,Math.min(600,r-e)))},className:"hidden md:block"}),t("div",{style:{width:W},className:"flex-shrink-0 bg-background flex flex-col",children:y&&!P?t(Ti,{projectId:n,contextAssetId:a,file:H,currentTime:X,frameRate:H?.media?.metadata?.frameRate||30,startTimecode:H?.media?.metadata?.startTimecode,onTyping:()=>{if(c)return;p.current?.pause()},onSelectMessage:bt,selectedMessageId:he}):t(ki,{teamId:f,projectId:n,file:H,onSaveField:je,members:_e,onCommentSelect:xt,currentTime:X,onTyping:()=>{if(c)return;p.current?.pause()},selectedCommentId:he,hideAnnotationControl:H?.proxyType==="audio"})})]})]}),t(ue,{open:re,onOpenChange:ee,children:t(ae,{children:o("form",{onSubmit:yt,children:[t(pe,{children:t(le,{children:Zo()})}),t("div",{className:"py-4",children:t(z,{ref:se,value:te,onChange:(e)=>be(e.target.value),placeholder:Ad?.()||"Enter new name",onFocus:vt,autoFocus:!0})}),o(qe,{children:[t(E,{type:"button",variant:"outline",onClick:()=>ee(!1),children:De()}),o(E,{type:"submit",disabled:Fe||!te.trim(),children:[Fe&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),Gn()]})]})]})})}),t(Xe,{open:lt,onOpenChange:ce,children:o(et,{children:[o(tt,{children:[t(nt,{children:$c?.()||"Delete Asset?"}),t(ot,{children:Hc?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),o(rt,{children:[t(it,{children:De()}),o(st,{onClick:It,disabled:ke,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[ke&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),ct()]})]})]})})]})}var Ne=ze("/projects/$projectId/files/$fileId")({component:jt});export{Ne as Route};
@@ -1,2 +1,2 @@
1
- import{I}from"./chunk-42hrvk6k.js";var c=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Mo=I("wrench",c);
1
+ import{I}from"./chunk-qx553512.js";var c=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Mo=I("wrench",c);
2
2
  export{Mo};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{pf,On,gc,Ac,_c,yc,Su,Eu,Am,zA,ks,Ho,qr}from"./chunk-gvcjqcjf.js";export{_c as EncryptJWT,Ac as SignJWT,Am as UnsecuredJWT,pf as base64url,yc as calculateJwkThumbprint,Su as createLocalJWKSet,Eu as createRemoteJWKSet,qr as decodeJwt,Ho as decodeProtectedHeader,ks as importJWK,zA as importPKCS8,gc as jwtDecrypt,On as jwtVerify};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Os,Qo}from"./chunk-1nvj833s.js";import{Ko}from"./chunk-p0j4wpa5.js";import{Wo,yo,Dt}from"./chunk-ypkkfwfb.js";import{gn,ar,Ge,tn,Xt,vo,qt}from"./chunk-k3prp6c6.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:He,getLoggerPlugin:Ve,getRecursionDetectionPlugin:We}=Dt(),{NoAuthSigner:Le,getHttpAuthSchemeEndpointRuleSetPlugin:ze,DefaultIdentityProviderConfig:Be,getHttpSigningPlugin:je}=yo(),{normalizeProvider:se,getSmithyContext:Ke,ServiceException:Xe,NoOpLogger:Qe,emitWarningIfUnsupportedVersion:Ye,loadConfigsForDefaultMode:Je,getDefaultExtensionConfiguration:Ze,resolveDefaultRuntimeConfig:et,Client:ne,makeBuilder:tt,createAggregatedClient:st}=ar(),{Command:nt}=ar();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}=Ge(),{BinaryDecisionDiagram:pt,EndpointCache:dt,decideEndpoint:ht,customEndpointFunctions:gt,resolveEndpointConfig:lt,getEndpointPlugin:Et}=tn(),{parseUrl:mt,getHttpHandlerExtensionConfiguration:At,resolveHttpHandlerRuntimeConfig:_t,getContentLengthPlugin:Ot}=qt(),{DEFAULT_RETRY_MODE:St,NODE_RETRY_MODE_CONFIG_OPTIONS:It,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:Ct,resolveRetryConfig:Rt,getRetryPlugin:vt}=Wo(),{TypeRegistry:oe,getSchemaSerdePlugin:ft}=gn(),{resolveAwsSdkSigV4Config:Pt,AwsSdkSigV4Signer:Tt,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:kt}=Qo(),{toUtf8:xt,fromUtf8:yt,toBase64:Nt,fromBase64:wt,calculateBodyLength:$t}=Xt(),{streamCollector:Ut,NodeHttpHandler:Ft}=Ko(),{AwsRestJsonProtocol:bt}=Os(),{Sha256:Mt}=vo(),Ht=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 Vt(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(s,n)=>({signingProperties:{config:s,context:n}})}}function Wt(e){return{schemeId:"smithy.api#noAuth"}}var Lt=(e)=>{let s=[];switch(e.operation){case"CreateOAuth2Token":{s.push(Wt());break}default:s.push(Vt(e))}return s},zt=(e)=>{let s=Pt(e);return Object.assign(s,{authSchemePreference:se(e.authSchemePreference??[])})},Bt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"signin"}),jt={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"]]},Qt=2,t=1e8,Yt=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]),Jt=pt.from(Yt,Qt,K.conditions,K.results),Zt=new dt({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),es=(e,s={})=>Zt.get(e,()=>ht(Jt,{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",Ss="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]:Ss}],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??Lt,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 Le}],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??Mt,urlParser:e?.urlParser??mt,utf8Decoder:e?.utf8Decoder??yt,utf8Encoder:e?.utf8Encoder??xt}),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(kt,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=Bt(s),c=be(n),a=Rt(c),O=ut(a),T=qe(O),Te=lt(T),ke=zt(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(He(this.config)),this.middlewareStack.use(Ve(this.config)),this.middlewareStack.use(We(this.config)),this.middlewareStack.use(ze(this.config,{httpAuthSchemeParametersProvider:Ht,identityProviderConfigProvider:async(ye)=>new Be({"aws.auth#sigv4":ye.credentials})})),this.middlewareStack.use(je(this.config))}destroy(){super.destroy()}}var fe=tt(jt,"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,sn=b,nn=l,on=ue,rn=v,an=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,sn as SigninClient,nn as SigninServiceException,on as SigninServiceException$,rn as TooManyRequestsError,an as TooManyRequestsError$,cn as ValidationException,un as ValidationException$,pn as errorTypeRegistries};
2
+ import{Fs,Qo}from"./chunk-w4adkd0a.js";import{Ko}from"./chunk-4bc3gqmn.js";import{Wo,yo,Dt}from"./chunk-3ahax79y.js";import{hn,sr,Ge,en,Xt,vo,qt}from"./chunk-y5h5d5gx.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:He,getLoggerPlugin:Ve,getRecursionDetectionPlugin:We}=Dt(),{NoAuthSigner:Le,getHttpAuthSchemeEndpointRuleSetPlugin:ze,DefaultIdentityProviderConfig:Be,getHttpSigningPlugin:je}=yo(),{normalizeProvider:se,getSmithyContext:Ke,ServiceException:Xe,NoOpLogger:Qe,emitWarningIfUnsupportedVersion:Ye,loadConfigsForDefaultMode:Je,getDefaultExtensionConfiguration:Ze,resolveDefaultRuntimeConfig:et,Client:ne,makeBuilder:tt,createAggregatedClient:st}=sr(),{Command:nt}=sr();var Us=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}=Ge(),{BinaryDecisionDiagram:pt,EndpointCache:dt,decideEndpoint:ht,customEndpointFunctions:gt,resolveEndpointConfig:lt,getEndpointPlugin:Et}=en(),{parseUrl:mt,getHttpHandlerExtensionConfiguration:At,resolveHttpHandlerRuntimeConfig:_t,getContentLengthPlugin:Ot}=qt(),{DEFAULT_RETRY_MODE:St,NODE_RETRY_MODE_CONFIG_OPTIONS:It,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:Ct,resolveRetryConfig:Rt,getRetryPlugin:vt}=Wo(),{TypeRegistry:oe,getSchemaSerdePlugin:ft}=hn(),{resolveAwsSdkSigV4Config:Pt,AwsSdkSigV4Signer:Tt,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:kt}=Qo(),{toUtf8:xt,fromUtf8:yt,toBase64:Nt,fromBase64:wt,calculateBodyLength:$t}=Xt(),{streamCollector:Ut,NodeHttpHandler:Ft}=Ko(),{AwsRestJsonProtocol:bt}=Fs(),{Sha256:Mt}=vo(),Ht=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 Vt(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(s,n)=>({signingProperties:{config:s,context:n}})}}function Wt(e){return{schemeId:"smithy.api#noAuth"}}var Lt=(e)=>{let s=[];switch(e.operation){case"CreateOAuth2Token":{s.push(Wt());break}default:s.push(Vt(e))}return s},zt=(e)=>{let s=Pt(e);return Object.assign(s,{authSchemePreference:se(e.authSchemePreference??[])})},Bt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"signin"}),jt={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"]]},Qt=2,t=1e8,Yt=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]),Jt=pt.from(Yt,Qt,K.conditions,K.results),Zt=new dt({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),es=(e,s={})=>Zt.get(e,()=>ht(Jt,{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",Ss="resource",I="refreshToken",Z="redirectUri",ae="smithy.ts.sdk.synthetic.com.amazonaws.signin",ee="secretAccessKey",te="sessionToken",Is="server",Cs="tokenInput",Rs="tokenOutput",N="tokenType",vs="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]:Is,[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,_],fs=[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,[Cs],[[()=>_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,[Rs],[[()=>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,Ss],[[0,{[o]:Os}],0],2],Ce=[3,i,ps,0,[x,N,y],[[()=>fs,{[o]:ms}],[0,{[o]:vs}],[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],Ps=(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??Lt,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 Le}],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??Mt,urlParser:e?.urlParser??mt,utf8Decoder:e?.utf8Decoder??yt,utf8Encoder:e?.utf8Encoder??xt}),Ts=(e)=>{Ye(process.version);let s=ot(e),n=()=>s().then(Je),c=Ps(e);Ne(process.version);let a={profile:e?.profile,logger:c.logger};return{...c,...e,runtime:"node",defaultsMode:s,authSchemePreference:e?.authSchemePreference??E(kt,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)}},ks=(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}}},xs=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),ys=(e,s)=>{let n=Object.assign(Ue(e),Ze(e),At(e),ks(e));return s.forEach((c)=>c.configure(n)),Object.assign(e,Fe(n),et(n),_t(n),xs(n))};class b extends ne{config;constructor(...[e]){let s=Ts(e||{});super(s);this.initConfig=s;let n=Bt(s),c=be(n),a=Rt(c),O=ut(a),T=qe(O),Te=lt(T),ke=zt(Te),xe=ys(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(He(this.config)),this.middlewareStack.use(Ve(this.config)),this.middlewareStack.use(We(this.config)),this.middlewareStack.use(ze(this.config,{httpAuthSchemeParametersProvider:Ht,identityProviderConfigProvider:async(ye)=>new Be({"aws.auth#sigv4":ye.credentials})})),this.middlewareStack.use(je(this.config))}destroy(){super.destroy()}}var fe=tt(jt,"Signin","SigninClient",Et),Ds={IsControlPlane:{type:"staticContextParams",value:!1}},Ns={IsOAuthEndpoint:{type:"staticContextParams",value:!0}},Pe=(e,s,n,c)=>[];class q extends fe(Ds,Pe,"CreateOAuth2Token",Re){}class M extends fe(Ns,Pe,"CreateOAuth2TokenWithIAM",ve){}var ws={CreateOAuth2TokenCommand:q,CreateOAuth2TokenWithIAMCommand:M};class H extends b{}st(ws,H);var $s={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=$s,tn=H,sn=b,nn=l,on=ue,rn=v,an=he,cn=f,un=ge,pn=le;export{Us 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,tn as Signin,sn as SigninClient,nn as SigninServiceException,on as SigninServiceException$,rn as TooManyRequestsError,an as TooManyRequestsError$,cn as ValidationException,un as ValidationException$,pn as errorTypeRegistries};