import{a as $,b as w,c as z}from"./chunk-t49ytmk0.js";import{sb as q,ub as G,wb as Y}from"./chunk-agapayce.js";import{yb as Z}from"./chunk-59vbpar7.js";var H="AWS_EC2_METADATA_DISABLED",Q=async(b)=>{const{ENV_CMDS_FULL_URI:j,ENV_CMDS_RELATIVE_URI:x,fromContainerMetadata:y,fromInstanceMetadata:J}=await import("./chunk-zpm61fm8.js");if(process.env[x]||process.env[j]){b.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");const{fromHttp:K}=await import("./chunk-1mphypxn.js");return G(K(b),y(b))}if(process.env[H])return async()=>{throw new q("EC2 Instance Metadata Service access disabled",{logger:b.logger})};return b.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),J(b)};var X=!1,W=(b={})=>Y(G(async()=>{if(b.profile??process.env[Z]){if(process.env[$]&&process.env[w]){if(!X)(b.logger?.warn&&b.logger?.constructor?.name!=="NoOpLogger"?b.logger.warn:console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
    Multiple credential sources detected: 
    Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
    This SDK will proceed with the AWS_PROFILE value.
    
    However, a future version may change this behavior to prefer the ENV static credentials.
    Please ensure that your environment only sets either the AWS_PROFILE or the
    AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
`),X=!0}throw new q("AWS_PROFILE is set, skipping fromEnv provider.",{logger:b.logger,tryNextLink:!0})}return b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),z(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");const{ssoStartUrl:j,ssoAccountId:x,ssoRegion:y,ssoRoleName:J,ssoSession:K}=b;if(!j&&!x&&!y&&!J&&!K)throw new q("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:b.logger});const{fromSSO:B}=await import("./chunk-nnneyqej.js");return B(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");const{fromIni:j}=await import("./chunk-pj6d7hvk.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");const{fromProcess:j}=await import("./chunk-gqfh2x89.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");const{fromTokenFile:j}=await import("./chunk-cpn7yy6s.js");return j(b)()},async()=>{return b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await Q(b))()},async()=>{throw new q("Could not load credentials from any providers",{tryNextLink:!1,logger:b.logger})}),v,k),k=(b)=>b?.expiration!==void 0,v=(b)=>b?.expiration!==void 0&&b.expiration.getTime()-Date.now()<300000;export{W as xb};

//# debugId=306C2219024B958364756E2164756E21
//# sourceMappingURL=chunk-vc4pnt6y.js.map
