'use strict';
import { environmentVariables } from '../constants/ci-constants.js';
import { cliLogWarning } from '../../../fd-toolbox/logging/cli-logger.js';
import { S3Client } from '@aws-sdk/client-s3';
import { remoteBlobConstants } from '../../../base-repo/constants/remote-blob-constants.js';
import { getStringEnvSetting } from '../../../fd-toolbox/infra/env-functions.js';

var __defProp=Object['defineProperty'],__name=(_0x3c2b15,_0x4bc5f7)=>__defProp(_0x3c2b15,'name',{'value':_0x4bc5f7,'configurable':!![]});function getS3Client(){const _0x56f13f=getStringEnvSetting(environmentVariables['r2NxCacheBucketName']),_0x2a1090=getStringEnvSetting(environmentVariables['r2AccountId']),_0x1e8a71=getStringEnvSetting(environmentVariables['r2AccessKeyId']),_0xb7b311=getStringEnvSetting(environmentVariables['r2SecretAccessKey']);let _0x151dc1;if(!_0x56f13f||!_0x2a1090||!_0x1e8a71||!_0xb7b311)cliLogWarning('Missing\x20R2\x20environment\x20variables\x20for\x20rollup\x20cache\x20cloud\x20operations.');else {const _0x49a7bc=new URL('https://'+_0x2a1090+'.r2.cloudflarestorage.com')['href'];_0x151dc1=new S3Client({'region':remoteBlobConstants['blobClientRegion'],'endpoint':_0x49a7bc,'credentials':{'accessKeyId':_0x1e8a71,'secretAccessKey':_0xb7b311}});}return _0x151dc1;}__name(getS3Client,'getS3Client');

export { getS3Client };
