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,8BAA6B,qBAAoB,QAAS,GAAgB,EAAgB,CAAC,KAC7G,MAAM,YAAE,EAAW,OAAE,GAAW,EAC1B,EAAa,CAAE,cAAa,UAClC,OAAO,iBAAiB,QAAQ,iBAAiB,MAAM,QAAQ,EAA6B,GAAa,sBAAsB,EAAoB,GAAgB,WAAW,IAAe,EAGjM,QAAQ,WAAa","file":"/npm/@smithy/node-config-provider@4.3.13/dist-cjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@smithy/node-config-provider@4.3.13/dist-cjs/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nvar propertyProvider = require('@smithy/property-provider');\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\n\nfunction getSelectorName(functionString) {\n    try {\n        const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? []));\n        constants.delete(\"CONFIG\");\n        constants.delete(\"CONFIG_PREFIX_SEPARATOR\");\n        constants.delete(\"ENV\");\n        return [...constants].join(\", \");\n    }\n    catch (e) {\n        return functionString;\n    }\n}\n\nconst fromEnv = (envVarSelector, options) => async () => {\n    try {\n        const config = envVarSelector(process.env, options);\n        if (config === undefined) {\n            throw new Error();\n        }\n        return config;\n    }\n    catch (e) {\n        throw new propertyProvider.CredentialsProviderError(e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger });\n    }\n};\n\nconst fromSharedConfigFiles = (configSelector, { preferredFile = \"config\", ...init } = {}) => async () => {\n    const profile = sharedIniFileLoader.getProfileName(init);\n    const { configFile, credentialsFile } = await sharedIniFileLoader.loadSharedConfigFiles(init);\n    const profileFromCredentials = credentialsFile[profile] || {};\n    const profileFromConfig = configFile[profile] || {};\n    const mergedProfile = preferredFile === \"config\"\n        ? { ...profileFromCredentials, ...profileFromConfig }\n        : { ...profileFromConfig, ...profileFromCredentials };\n    try {\n        const cfgFile = preferredFile === \"config\" ? configFile : credentialsFile;\n        const configValue = configSelector(mergedProfile, cfgFile);\n        if (configValue === undefined) {\n            throw new Error();\n        }\n        return configValue;\n    }\n    catch (e) {\n        throw new propertyProvider.CredentialsProviderError(e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger });\n    }\n};\n\nconst isFunction = (func) => typeof func === \"function\";\nconst fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : propertyProvider.fromStatic(defaultValue);\n\nconst loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => {\n    const { signingName, logger } = configuration;\n    const envOptions = { signingName, logger };\n    return propertyProvider.memoize(propertyProvider.chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue)));\n};\n\nexports.loadConfig = loadConfig;\n"]}