'use strict';

var WH45T4LS_cjs = require('./WH45T4LS.cjs');
var AHQNBZE4_cjs = require('./AHQNBZE4.cjs');
var ZQFCLTYU_cjs = require('./ZQFCLTYU.cjs');
var _7ZH64OYR_cjs = require('./7ZH64OYR.cjs');
var OT5L7ME6_cjs = require('./OT5L7ME6.cjs');
var OWTMHDOF_cjs = require('./OWTMHDOF.cjs');
require('./7WVEMAKW.cjs');
var F7OAIAEX_cjs = require('./F7OAIAEX.cjs');
require('./P5BPMTGP.cjs');
require('./WDSPHVPJ.cjs');
require('./JGLHYXTW.cjs');
var U7VZULNU_cjs = require('./U7VZULNU.cjs');

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

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js
U7VZULNU_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthSchemeProvider.js
U7VZULNU_cjs.init_cjs_shims();
var defaultSSOHttpAuthSchemeParametersProvider = /* @__PURE__ */ U7VZULNU_cjs.__name(async (config, context, input) => {
  return {
    operation: _7ZH64OYR_cjs.getSmithyContext(context).operation,
    region: await _7ZH64OYR_cjs.normalizeProvider(config.region)() || (() => {
      throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
    })()
  };
}, "defaultSSOHttpAuthSchemeParametersProvider");
function createAwsAuthSigv4HttpAuthOption(authParameters) {
  return {
    schemeId: "aws.auth#sigv4",
    signingProperties: {
      name: "awsssoportal",
      region: authParameters.region
    },
    propertiesExtractor: /* @__PURE__ */ U7VZULNU_cjs.__name((config, context) => ({
      signingProperties: {
        config,
        context
      }
    }), "propertiesExtractor")
  };
}
U7VZULNU_cjs.__name(createAwsAuthSigv4HttpAuthOption, "createAwsAuthSigv4HttpAuthOption");
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
  return {
    schemeId: "smithy.api#noAuth"
  };
}
U7VZULNU_cjs.__name(createSmithyApiNoAuthHttpAuthOption, "createSmithyApiNoAuthHttpAuthOption");
var defaultSSOHttpAuthSchemeProvider = /* @__PURE__ */ U7VZULNU_cjs.__name((authParameters) => {
  const options = [];
  switch (authParameters.operation) {
    case "GetRoleCredentials": {
      options.push(createSmithyApiNoAuthHttpAuthOption());
      break;
    }
    case "ListAccountRoles": {
      options.push(createSmithyApiNoAuthHttpAuthOption());
      break;
    }
    case "ListAccounts": {
      options.push(createSmithyApiNoAuthHttpAuthOption());
      break;
    }
    case "Logout": {
      options.push(createSmithyApiNoAuthHttpAuthOption());
      break;
    }
    default: {
      options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
    }
  }
  return options;
}, "defaultSSOHttpAuthSchemeProvider");
var resolveHttpAuthSchemeConfig = /* @__PURE__ */ U7VZULNU_cjs.__name((config) => {
  const config_0 = _7ZH64OYR_cjs.resolveAwsSdkSigV4Config(config);
  return Object.assign(config_0, {
    authSchemePreference: _7ZH64OYR_cjs.normalizeProvider(config.authSchemePreference ?? [])
  });
}, "resolveHttpAuthSchemeConfig");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/EndpointParameters.js
U7VZULNU_cjs.init_cjs_shims();
var resolveClientEndpointParameters = /* @__PURE__ */ U7VZULNU_cjs.__name((options) => {
  return Object.assign(options, {
    useDualstackEndpoint: options.useDualstackEndpoint ?? false,
    useFipsEndpoint: options.useFipsEndpoint ?? false,
    defaultSigningName: "awsssoportal"
  });
}, "resolveClientEndpointParameters");
var commonParams = {
  UseFIPS: {
    type: "builtInParams",
    name: "useFipsEndpoint"
  },
  Endpoint: {
    type: "builtInParams",
    name: "endpoint"
  },
  Region: {
    type: "builtInParams",
    name: "region"
  },
  UseDualStack: {
    type: "builtInParams",
    name: "useDualstackEndpoint"
  }
};

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js
U7VZULNU_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/package.json
var package_default = {
  version: "3.879.0"};

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js
U7VZULNU_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js
U7VZULNU_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/ruleset.js
U7VZULNU_cjs.init_cjs_shims();
var u = "required";
var v = "fn";
var w = "argv";
var x = "ref";
var a = true;
var b = "isSet";
var c = "booleanEquals";
var d = "error";
var e = "endpoint";
var f = "tree";
var g = "PartitionResult";
var h = "getAttr";
var i = {
  [u]: false,
  "type": "String"
};
var j = {
  [u]: true,
  "default": false,
  "type": "Boolean"
};
var k = {
  [x]: "Endpoint"
};
var l = {
  [v]: c,
  [w]: [
    {
      [x]: "UseFIPS"
    },
    true
  ]
};
var m = {
  [v]: c,
  [w]: [
    {
      [x]: "UseDualStack"
    },
    true
  ]
};
var n = {};
var o = {
  [v]: h,
  [w]: [
    {
      [x]: g
    },
    "supportsFIPS"
  ]
};
var p = {
  [x]: g
};
var q = {
  [v]: c,
  [w]: [
    true,
    {
      [v]: h,
      [w]: [
        p,
        "supportsDualStack"
      ]
    }
  ]
};
var r = [
  l
];
var s = [
  m
];
var t = [
  {
    [x]: "Region"
  }
];
var _data = {
  version: "1.0",
  parameters: {
    Region: i,
    UseDualStack: j,
    UseFIPS: j,
    Endpoint: i
  },
  rules: [
    {
      conditions: [
        {
          [v]: b,
          [w]: [
            k
          ]
        }
      ],
      rules: [
        {
          conditions: r,
          error: "Invalid Configuration: FIPS and custom endpoint are not supported",
          type: d
        },
        {
          conditions: s,
          error: "Invalid Configuration: Dualstack and custom endpoint are not supported",
          type: d
        },
        {
          endpoint: {
            url: k,
            properties: n,
            headers: n
          },
          type: e
        }
      ],
      type: f
    },
    {
      conditions: [
        {
          [v]: b,
          [w]: t
        }
      ],
      rules: [
        {
          conditions: [
            {
              [v]: "aws.partition",
              [w]: t,
              assign: g
            }
          ],
          rules: [
            {
              conditions: [
                l,
                m
              ],
              rules: [
                {
                  conditions: [
                    {
                      [v]: c,
                      [w]: [
                        a,
                        o
                      ]
                    },
                    q
                  ],
                  rules: [
                    {
                      endpoint: {
                        url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
                        properties: n,
                        headers: n
                      },
                      type: e
                    }
                  ],
                  type: f
                },
                {
                  error: "FIPS and DualStack are enabled, but this partition does not support one or both",
                  type: d
                }
              ],
              type: f
            },
            {
              conditions: r,
              rules: [
                {
                  conditions: [
                    {
                      [v]: c,
                      [w]: [
                        o,
                        a
                      ]
                    }
                  ],
                  rules: [
                    {
                      conditions: [
                        {
                          [v]: "stringEquals",
                          [w]: [
                            {
                              [v]: h,
                              [w]: [
                                p,
                                "name"
                              ]
                            },
                            "aws-us-gov"
                          ]
                        }
                      ],
                      endpoint: {
                        url: "https://portal.sso.{Region}.amazonaws.com",
                        properties: n,
                        headers: n
                      },
                      type: e
                    },
                    {
                      endpoint: {
                        url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",
                        properties: n,
                        headers: n
                      },
                      type: e
                    }
                  ],
                  type: f
                },
                {
                  error: "FIPS is enabled but this partition does not support FIPS",
                  type: d
                }
              ],
              type: f
            },
            {
              conditions: s,
              rules: [
                {
                  conditions: [
                    q
                  ],
                  rules: [
                    {
                      endpoint: {
                        url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",
                        properties: n,
                        headers: n
                      },
                      type: e
                    }
                  ],
                  type: f
                },
                {
                  error: "DualStack is enabled but this partition does not support DualStack",
                  type: d
                }
              ],
              type: f
            },
            {
              endpoint: {
                url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",
                properties: n,
                headers: n
              },
              type: e
            }
          ],
          type: f
        }
      ],
      type: f
    },
    {
      error: "Invalid Configuration: Missing Region",
      type: d
    }
  ]
};
var ruleSet = _data;

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js
var cache = new _7ZH64OYR_cjs.EndpointCache({
  size: 50,
  params: [
    "Endpoint",
    "Region",
    "UseDualStack",
    "UseFIPS"
  ]
});
var defaultEndpointResolver = /* @__PURE__ */ U7VZULNU_cjs.__name((endpointParams, context = {}) => {
  return cache.get(endpointParams, () => _7ZH64OYR_cjs.resolveEndpoint(ruleSet, {
    endpointParams,
    logger: context.logger
  }));
}, "defaultEndpointResolver");
_7ZH64OYR_cjs.customEndpointFunctions.aws = _7ZH64OYR_cjs.awsEndpointFunctions;

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js
var getRuntimeConfig = /* @__PURE__ */ U7VZULNU_cjs.__name((config) => {
  return {
    apiVersion: "2019-06-10",
    base64Decoder: config?.base64Decoder ?? OT5L7ME6_cjs.fromBase64,
    base64Encoder: config?.base64Encoder ?? OT5L7ME6_cjs.toBase64,
    disableHostPrefix: config?.disableHostPrefix ?? false,
    endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
    extensions: config?.extensions ?? [],
    httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOHttpAuthSchemeProvider,
    httpAuthSchemes: config?.httpAuthSchemes ?? [
      {
        schemeId: "aws.auth#sigv4",
        identityProvider: /* @__PURE__ */ U7VZULNU_cjs.__name((ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), "identityProvider"),
        signer: new _7ZH64OYR_cjs.AwsSdkSigV4Signer()
      },
      {
        schemeId: "smithy.api#noAuth",
        identityProvider: /* @__PURE__ */ U7VZULNU_cjs.__name((ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), "identityProvider"),
        signer: new AHQNBZE4_cjs.NoAuthSigner()
      }
    ],
    logger: config?.logger ?? new OT5L7ME6_cjs.NoOpLogger(),
    serviceId: config?.serviceId ?? "SSO",
    urlParser: config?.urlParser ?? F7OAIAEX_cjs.parseUrl,
    utf8Decoder: config?.utf8Decoder ?? OWTMHDOF_cjs.fromUtf8,
    utf8Encoder: config?.utf8Encoder ?? OWTMHDOF_cjs.toUtf8
  };
}, "getRuntimeConfig");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js
var getRuntimeConfig2 = /* @__PURE__ */ U7VZULNU_cjs.__name((config) => {
  OT5L7ME6_cjs.emitWarningIfUnsupportedVersion(process.version);
  const defaultsMode = _7ZH64OYR_cjs.resolveDefaultsModeConfig(config);
  const defaultConfigProvider = /* @__PURE__ */ U7VZULNU_cjs.__name(() => defaultsMode().then(OT5L7ME6_cjs.loadConfigsForDefaultMode), "defaultConfigProvider");
  const clientSharedValues = getRuntimeConfig(config);
  _7ZH64OYR_cjs.emitWarningIfUnsupportedVersion(process.version);
  const loaderConfig = {
    profile: config?.profile,
    logger: clientSharedValues.logger
  };
  return {
    ...clientSharedValues,
    ...config,
    runtime: "node",
    defaultsMode,
    authSchemePreference: config?.authSchemePreference ?? F7OAIAEX_cjs.loadConfig(_7ZH64OYR_cjs.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
    bodyLengthChecker: config?.bodyLengthChecker ?? _7ZH64OYR_cjs.calculateBodyLength,
    defaultUserAgentProvider: config?.defaultUserAgentProvider ?? _7ZH64OYR_cjs.createDefaultUserAgentProvider({
      serviceId: clientSharedValues.serviceId,
      clientVersion: package_default.version
    }),
    maxAttempts: config?.maxAttempts ?? F7OAIAEX_cjs.loadConfig(_7ZH64OYR_cjs.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
    region: config?.region ?? F7OAIAEX_cjs.loadConfig(_7ZH64OYR_cjs.NODE_REGION_CONFIG_OPTIONS, {
      ..._7ZH64OYR_cjs.NODE_REGION_CONFIG_FILE_OPTIONS,
      ...loaderConfig
    }),
    requestHandler: OT5L7ME6_cjs.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
    retryMode: config?.retryMode ?? F7OAIAEX_cjs.loadConfig({
      ..._7ZH64OYR_cjs.NODE_RETRY_MODE_CONFIG_OPTIONS,
      default: /* @__PURE__ */ U7VZULNU_cjs.__name(async () => (await defaultConfigProvider()).retryMode || _7ZH64OYR_cjs.DEFAULT_RETRY_MODE, "default")
    }, config),
    sha256: config?.sha256 ?? _7ZH64OYR_cjs.Hash.bind(null, "sha256"),
    streamCollector: config?.streamCollector ?? OT5L7ME6_cjs.streamCollector,
    useDualstackEndpoint: config?.useDualstackEndpoint ?? F7OAIAEX_cjs.loadConfig(_7ZH64OYR_cjs.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
    useFipsEndpoint: config?.useFipsEndpoint ?? F7OAIAEX_cjs.loadConfig(_7ZH64OYR_cjs.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
    userAgentAppId: config?.userAgentAppId ?? F7OAIAEX_cjs.loadConfig(_7ZH64OYR_cjs.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig)
  };
}, "getRuntimeConfig");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeExtensions.js
U7VZULNU_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthExtensionConfiguration.js
U7VZULNU_cjs.init_cjs_shims();
var getHttpAuthExtensionConfiguration = /* @__PURE__ */ U7VZULNU_cjs.__name((runtimeConfig) => {
  const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
  let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
  let _credentials = runtimeConfig.credentials;
  return {
    setHttpAuthScheme(httpAuthScheme) {
      const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
      if (index === -1) {
        _httpAuthSchemes.push(httpAuthScheme);
      } else {
        _httpAuthSchemes.splice(index, 1, httpAuthScheme);
      }
    },
    httpAuthSchemes() {
      return _httpAuthSchemes;
    },
    setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
      _httpAuthSchemeProvider = httpAuthSchemeProvider;
    },
    httpAuthSchemeProvider() {
      return _httpAuthSchemeProvider;
    },
    setCredentials(credentials) {
      _credentials = credentials;
    },
    credentials() {
      return _credentials;
    }
  };
}, "getHttpAuthExtensionConfiguration");
var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ U7VZULNU_cjs.__name((config) => {
  return {
    httpAuthSchemes: config.httpAuthSchemes(),
    httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
    credentials: config.credentials()
  };
}, "resolveHttpAuthRuntimeConfig");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeExtensions.js
var resolveRuntimeExtensions = /* @__PURE__ */ U7VZULNU_cjs.__name((runtimeConfig, extensions) => {
  const extensionConfiguration = Object.assign(_7ZH64OYR_cjs.getAwsRegionExtensionConfiguration(runtimeConfig), OT5L7ME6_cjs.getDefaultExtensionConfiguration(runtimeConfig), OT5L7ME6_cjs.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
  return Object.assign(runtimeConfig, _7ZH64OYR_cjs.resolveAwsRegionExtensionConfiguration(extensionConfiguration), OT5L7ME6_cjs.resolveDefaultRuntimeConfig(extensionConfiguration), OT5L7ME6_cjs.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
}, "resolveRuntimeExtensions");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js
var SSOClient = class extends OT5L7ME6_cjs.Client {
  static {
    U7VZULNU_cjs.__name(this, "SSOClient");
  }
  config;
  constructor(...[configuration]) {
    const _config_0 = getRuntimeConfig2(configuration || {});
    super(_config_0);
    this.initConfig = _config_0;
    const _config_1 = resolveClientEndpointParameters(_config_0);
    const _config_2 = _7ZH64OYR_cjs.resolveUserAgentConfig(_config_1);
    const _config_3 = _7ZH64OYR_cjs.resolveRetryConfig(_config_2);
    const _config_4 = _7ZH64OYR_cjs.resolveRegionConfig(_config_3);
    const _config_5 = _7ZH64OYR_cjs.resolveHostHeaderConfig(_config_4);
    const _config_6 = _7ZH64OYR_cjs.resolveEndpointConfig(_config_5);
    const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
    const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
    this.config = _config_8;
    this.middlewareStack.use(_7ZH64OYR_cjs.getUserAgentPlugin(this.config));
    this.middlewareStack.use(_7ZH64OYR_cjs.getRetryPlugin(this.config));
    this.middlewareStack.use(_7ZH64OYR_cjs.getContentLengthPlugin(this.config));
    this.middlewareStack.use(_7ZH64OYR_cjs.getHostHeaderPlugin(this.config));
    this.middlewareStack.use(_7ZH64OYR_cjs.getLoggerPlugin(this.config));
    this.middlewareStack.use(_7ZH64OYR_cjs.getRecursionDetectionPlugin(this.config));
    this.middlewareStack.use(_7ZH64OYR_cjs.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
      httpAuthSchemeParametersProvider: defaultSSOHttpAuthSchemeParametersProvider,
      identityProviderConfigProvider: /* @__PURE__ */ U7VZULNU_cjs.__name(async (config) => new _7ZH64OYR_cjs.DefaultIdentityProviderConfig({
        "aws.auth#sigv4": config.credentials
      }), "identityProviderConfigProvider")
    }));
    this.middlewareStack.use(_7ZH64OYR_cjs.getHttpSigningPlugin(this.config));
  }
  destroy() {
    super.destroy();
  }
};

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js
U7VZULNU_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js
U7VZULNU_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/models/SSOServiceException.js
U7VZULNU_cjs.init_cjs_shims();
var SSOServiceException = class _SSOServiceException extends OT5L7ME6_cjs.ServiceException {
  static {
    U7VZULNU_cjs.__name(this, "SSOServiceException");
  }
  constructor(options) {
    super(options);
    Object.setPrototypeOf(this, _SSOServiceException.prototype);
  }
};

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js
var InvalidRequestException = class _InvalidRequestException extends SSOServiceException {
  static {
    U7VZULNU_cjs.__name(this, "InvalidRequestException");
  }
  name = "InvalidRequestException";
  $fault = "client";
  constructor(opts) {
    super({
      name: "InvalidRequestException",
      $fault: "client",
      ...opts
    });
    Object.setPrototypeOf(this, _InvalidRequestException.prototype);
  }
};
var ResourceNotFoundException = class _ResourceNotFoundException extends SSOServiceException {
  static {
    U7VZULNU_cjs.__name(this, "ResourceNotFoundException");
  }
  name = "ResourceNotFoundException";
  $fault = "client";
  constructor(opts) {
    super({
      name: "ResourceNotFoundException",
      $fault: "client",
      ...opts
    });
    Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
  }
};
var TooManyRequestsException = class _TooManyRequestsException extends SSOServiceException {
  static {
    U7VZULNU_cjs.__name(this, "TooManyRequestsException");
  }
  name = "TooManyRequestsException";
  $fault = "client";
  constructor(opts) {
    super({
      name: "TooManyRequestsException",
      $fault: "client",
      ...opts
    });
    Object.setPrototypeOf(this, _TooManyRequestsException.prototype);
  }
};
var UnauthorizedException = class _UnauthorizedException extends SSOServiceException {
  static {
    U7VZULNU_cjs.__name(this, "UnauthorizedException");
  }
  name = "UnauthorizedException";
  $fault = "client";
  constructor(opts) {
    super({
      name: "UnauthorizedException",
      $fault: "client",
      ...opts
    });
    Object.setPrototypeOf(this, _UnauthorizedException.prototype);
  }
};
var GetRoleCredentialsRequestFilterSensitiveLog = /* @__PURE__ */ U7VZULNU_cjs.__name((obj) => ({
  ...obj,
  ...obj.accessToken && {
    accessToken: OT5L7ME6_cjs.SENSITIVE_STRING
  }
}), "GetRoleCredentialsRequestFilterSensitiveLog");
var RoleCredentialsFilterSensitiveLog = /* @__PURE__ */ U7VZULNU_cjs.__name((obj) => ({
  ...obj,
  ...obj.secretAccessKey && {
    secretAccessKey: OT5L7ME6_cjs.SENSITIVE_STRING
  },
  ...obj.sessionToken && {
    sessionToken: OT5L7ME6_cjs.SENSITIVE_STRING
  }
}), "RoleCredentialsFilterSensitiveLog");
var GetRoleCredentialsResponseFilterSensitiveLog = /* @__PURE__ */ U7VZULNU_cjs.__name((obj) => ({
  ...obj,
  ...obj.roleCredentials && {
    roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials)
  }
}), "GetRoleCredentialsResponseFilterSensitiveLog");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/protocols/Aws_restJson1.js
U7VZULNU_cjs.init_cjs_shims();
var se_GetRoleCredentialsCommand = /* @__PURE__ */ U7VZULNU_cjs.__name(async (input, context) => {
  const b2 = WH45T4LS_cjs.requestBuilder(input, context);
  const headers = OT5L7ME6_cjs.map({}, OT5L7ME6_cjs.isSerializableHeaderValue, {
    [_xasbt]: input[_aT]
  });
  b2.bp("/federation/credentials");
  const query = OT5L7ME6_cjs.map({
    [_rn]: [
      ,
      OT5L7ME6_cjs.expectNonNull(input[_rN], `roleName`)
    ],
    [_ai]: [
      ,
      OT5L7ME6_cjs.expectNonNull(input[_aI], `accountId`)
    ]
  });
  let body;
  b2.m("GET").h(headers).q(query).b(body);
  return b2.build();
}, "se_GetRoleCredentialsCommand");
var de_GetRoleCredentialsCommand = /* @__PURE__ */ U7VZULNU_cjs.__name(async (output, context) => {
  if (output.statusCode !== 200 && output.statusCode >= 300) {
    return de_CommandError(output, context);
  }
  const contents = OT5L7ME6_cjs.map({
    $metadata: deserializeMetadata(output)
  });
  const data = OT5L7ME6_cjs.expectNonNull(OT5L7ME6_cjs.expectObject(await ZQFCLTYU_cjs.parseJsonBody(output.body, context)), "body");
  const doc = OT5L7ME6_cjs.take(data, {
    roleCredentials: OT5L7ME6_cjs._json
  });
  Object.assign(contents, doc);
  return contents;
}, "de_GetRoleCredentialsCommand");
var de_CommandError = /* @__PURE__ */ U7VZULNU_cjs.__name(async (output, context) => {
  const parsedOutput = {
    ...output,
    body: await ZQFCLTYU_cjs.parseJsonErrorBody(output.body, context)
  };
  const errorCode = ZQFCLTYU_cjs.loadRestJsonErrorCode(output, parsedOutput.body);
  switch (errorCode) {
    case "InvalidRequestException":
    case "com.amazonaws.sso#InvalidRequestException":
      throw await de_InvalidRequestExceptionRes(parsedOutput, context);
    case "ResourceNotFoundException":
    case "com.amazonaws.sso#ResourceNotFoundException":
      throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
    case "TooManyRequestsException":
    case "com.amazonaws.sso#TooManyRequestsException":
      throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
    case "UnauthorizedException":
    case "com.amazonaws.sso#UnauthorizedException":
      throw await de_UnauthorizedExceptionRes(parsedOutput, context);
    default:
      const parsedBody = parsedOutput.body;
      return throwDefaultError({
        output,
        parsedBody,
        errorCode
      });
  }
}, "de_CommandError");
var throwDefaultError = OT5L7ME6_cjs.withBaseException(SSOServiceException);
var de_InvalidRequestExceptionRes = /* @__PURE__ */ U7VZULNU_cjs.__name(async (parsedOutput, context) => {
  const contents = OT5L7ME6_cjs.map({});
  const data = parsedOutput.body;
  const doc = OT5L7ME6_cjs.take(data, {
    message: OT5L7ME6_cjs.expectString
  });
  Object.assign(contents, doc);
  const exception = new InvalidRequestException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return OT5L7ME6_cjs.decorateServiceException(exception, parsedOutput.body);
}, "de_InvalidRequestExceptionRes");
var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ U7VZULNU_cjs.__name(async (parsedOutput, context) => {
  const contents = OT5L7ME6_cjs.map({});
  const data = parsedOutput.body;
  const doc = OT5L7ME6_cjs.take(data, {
    message: OT5L7ME6_cjs.expectString
  });
  Object.assign(contents, doc);
  const exception = new ResourceNotFoundException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return OT5L7ME6_cjs.decorateServiceException(exception, parsedOutput.body);
}, "de_ResourceNotFoundExceptionRes");
var de_TooManyRequestsExceptionRes = /* @__PURE__ */ U7VZULNU_cjs.__name(async (parsedOutput, context) => {
  const contents = OT5L7ME6_cjs.map({});
  const data = parsedOutput.body;
  const doc = OT5L7ME6_cjs.take(data, {
    message: OT5L7ME6_cjs.expectString
  });
  Object.assign(contents, doc);
  const exception = new TooManyRequestsException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return OT5L7ME6_cjs.decorateServiceException(exception, parsedOutput.body);
}, "de_TooManyRequestsExceptionRes");
var de_UnauthorizedExceptionRes = /* @__PURE__ */ U7VZULNU_cjs.__name(async (parsedOutput, context) => {
  const contents = OT5L7ME6_cjs.map({});
  const data = parsedOutput.body;
  const doc = OT5L7ME6_cjs.take(data, {
    message: OT5L7ME6_cjs.expectString
  });
  Object.assign(contents, doc);
  const exception = new UnauthorizedException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return OT5L7ME6_cjs.decorateServiceException(exception, parsedOutput.body);
}, "de_UnauthorizedExceptionRes");
var deserializeMetadata = /* @__PURE__ */ U7VZULNU_cjs.__name((output) => ({
  httpStatusCode: output.statusCode,
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
  extendedRequestId: output.headers["x-amz-id-2"],
  cfId: output.headers["x-amz-cf-id"]
}), "deserializeMetadata");
var _aI = "accountId";
var _aT = "accessToken";
var _ai = "account_id";
var _rN = "roleName";
var _rn = "role_name";
var _xasbt = "x-amz-sso_bearer_token";

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js
var GetRoleCredentialsCommand = class extends OT5L7ME6_cjs.Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o2) {
  return [
    _7ZH64OYR_cjs.getSerdePlugin(config, this.serialize, this.deserialize),
    _7ZH64OYR_cjs.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
  ];
}).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").f(GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog).ser(se_GetRoleCredentialsCommand).de(de_GetRoleCredentialsCommand).build() {
  static {
    U7VZULNU_cjs.__name(this, "GetRoleCredentialsCommand");
  }
};

exports.GetRoleCredentialsCommand = GetRoleCredentialsCommand;
exports.SSOClient = SSOClient;
//# sourceMappingURL=SHJCZ6NL.cjs.map
//# sourceMappingURL=SHJCZ6NL.cjs.map