'use strict';

var _7WVEMAKW_cjs = require('./7WVEMAKW.cjs');
var JGLHYXTW_cjs = require('./JGLHYXTW.cjs');
var U7VZULNU_cjs = require('./U7VZULNU.cjs');

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-env@3.879.0/node_modules/@aws-sdk/credential-provider-env/dist-es/index.js
U7VZULNU_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-env@3.879.0/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js
U7VZULNU_cjs.init_cjs_shims();
var ENV_KEY = "AWS_ACCESS_KEY_ID";
var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
var ENV_SESSION = "AWS_SESSION_TOKEN";
var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID";
var fromEnv = /* @__PURE__ */ U7VZULNU_cjs.__name((init) => async () => {
  init?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");
  const accessKeyId = process.env[ENV_KEY];
  const secretAccessKey = process.env[ENV_SECRET];
  const sessionToken = process.env[ENV_SESSION];
  const expiry = process.env[ENV_EXPIRATION];
  const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
  const accountId = process.env[ENV_ACCOUNT_ID];
  if (accessKeyId && secretAccessKey) {
    const credentials = {
      accessKeyId,
      secretAccessKey,
      ...sessionToken && {
        sessionToken
      },
      ...expiry && {
        expiration: new Date(expiry)
      },
      ...credentialScope && {
        credentialScope
      },
      ...accountId && {
        accountId
      }
    };
    _7WVEMAKW_cjs.setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS", "g");
    return credentials;
  }
  throw new JGLHYXTW_cjs.CredentialsProviderError("Unable to find environment variable credentials.", {
    logger: init?.logger
  });
}, "fromEnv");

exports.ENV_ACCOUNT_ID = ENV_ACCOUNT_ID;
exports.ENV_CREDENTIAL_SCOPE = ENV_CREDENTIAL_SCOPE;
exports.ENV_EXPIRATION = ENV_EXPIRATION;
exports.ENV_KEY = ENV_KEY;
exports.ENV_SECRET = ENV_SECRET;
exports.ENV_SESSION = ENV_SESSION;
exports.fromEnv = fromEnv;
//# sourceMappingURL=HN3U775J.cjs.map
//# sourceMappingURL=HN3U775J.cjs.map