import{c as R,A as S,S as A}from"./loadSts-CegQl9v1.js";import{n as Y,b as Z,e as O,f as ee,g as te,h as oe,d as ne,C as ie,o as se,E as re,u as ae,I as ce,s as le,i as de,t as me,j as pe,p as ue,M as ge,q as fe,P as Ce,k as Re,l as Se,r as Ae,R as Ee,a as Ie,m as ye,T as xe}from"./loadSts-CegQl9v1.js";import{C as E,g as I,s as l}from"./index-3CDT-S6-.js";import{a as Te}from"./index-3CDT-S6-.js";import"./normalizeProvider-EC8cbfMc.js";import"./preload-helper-BlTxHScW.js";import"./index-ByoFSJEC.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-ChvoNxcO.js";import"./__vite-browser-external-DLjrMatA.js";import"./inherits_browser-nmOknR35-Bp0mvRSL.js";import"./index-6mKfgpcs-DsgiI2lM.js";import"./_commonjsHelpers-B4e78b8K-W3E8ocG7.js";import"./index-DsIu-45t-Bejjlpz4.js";import"./index-DSosZ5sh-Ceejs_jv.js";import"./index-69shuAsh-DF18H7zf.js";import"./index-BJBOx-Z---hbiLl7B.js";import"./index.browser-BHPvGrwi-6Mh8eUw-.js";import"./_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js";import"./_commonjs-dynamic-modules-B7n8ZNar.js";function y(){return async()=>"us-east-1"}class x extends E.classBuilder().ep(R).m(function(t,n,i,o){return[I(i,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").sc(S).build(){}const $=e=>{if(typeof e?.Arn=="string"){const t=e.Arn.split(":");if(t.length>4&&t[4]!=="")return t[4]}},T=async(e,t,n,i={})=>{const o=typeof e=="function"?await e():e,a=typeof t=="function"?await t():t;let s="";const r=o??a??(s=await y()());return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${o} (credential provider clientConfig)`,`${a} (contextual client)`,`${s} (STS default: AWS_REGION, profile region, or us-east-1)`),r},W=(e,t)=>{let n;return async i=>{if(!n){const{logger:d=e?.parentClientConfig?.logger,profile:m=e?.parentClientConfig?.profile,region:p,requestHandler:c=e?.parentClientConfig?.requestHandler,credentialProviderLogger:u,userAgentAppId:g=e?.parentClientConfig?.userAgentAppId}=e,f=await T(p,e?.parentClientConfig?.region,u,{}),C=!P(c);n=new t({...e,userAgentAppId:g,profile:m,region:f,requestHandler:C?c:void 0,logger:d})}const{Credentials:o,AssumedRoleUser:a}=await n.send(new x(i));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${i.RoleArn}`);const s=$(a),r={accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration,...o.CredentialScope&&{credentialScope:o.CredentialScope},...s&&{accountId:s}};return s&&l(r,"RESOLVED_ACCOUNT_ID","T"),l(r,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),r}},P=e=>e?.metadata?.handlerProtocol==="h2",D=(e,t)=>t?class extends e{constructor(i){super(i);for(const o of t)this.middlewareStack.use(o)}}:e,J=(e={},t)=>W(e,D(A,t));export{E as $Command,Y as AssumeRole$,Z as AssumeRoleCommand,O as AssumeRoleRequest$,ee as AssumeRoleResponse$,S as AssumeRoleWithWebIdentity$,x as AssumeRoleWithWebIdentityCommand,te as AssumeRoleWithWebIdentityRequest$,oe as AssumeRoleWithWebIdentityResponse$,ne as AssumedRoleUser$,ie as Credentials$,se as ExpiredTokenException,re as ExpiredTokenException$,ae as IDPCommunicationErrorException,ce as IDPCommunicationErrorException$,le as IDPRejectedClaimException,de as IDPRejectedClaimException$,me as InvalidIdentityTokenException,pe as InvalidIdentityTokenException$,ue as MalformedPolicyDocumentException,ge as MalformedPolicyDocumentException$,fe as PackedPolicyTooLargeException,Ce as PackedPolicyTooLargeException$,Re as PolicyDescriptorType$,Se as ProvidedContext$,Ae as RegionDisabledException,Ee as RegionDisabledException$,A as STSClient,Ie as STSServiceException,ye as STSServiceException$,xe as Tag$,Te as __Client,J as getDefaultRoleAssumerWithWebIdentity};
