gemi 0.4.89 → 0.4.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/auth/AuthenticationServiceProvider.d.ts +4 -0
  2. package/dist/auth/AuthenticationServiceProvider.d.ts.map +1 -1
  3. package/dist/chunk-00c56e78353444bd.js +2 -0
  4. package/dist/chunk-0f500a6384fcd132.js +2 -0
  5. package/dist/chunk-1663f14acf1c15e4.js +2 -0
  6. package/dist/chunk-5bfe9d4cbecd160a.js +1 -0
  7. package/dist/chunk-631b243096f99070.js +2 -0
  8. package/dist/chunk-6b1b2297cf4e98bf.js +6 -0
  9. package/dist/chunk-73ad537019659405.js +2 -0
  10. package/dist/chunk-77f51fc60eb8f53d.js +2 -0
  11. package/dist/{chunk-a96c2e272f0ddf6c.js → chunk-b033519a526dfb3f.js} +1 -1
  12. package/dist/chunk-ce91e437af790f62.js +9 -0
  13. package/dist/chunk-d5f34554362c0fde.js +18 -0
  14. package/dist/chunk-d96668bed492732f.js +3 -0
  15. package/dist/chunk-da0be6c2c54903f4.js +2 -0
  16. package/dist/chunk-e51fe90ab8cb869b.js +2 -0
  17. package/dist/chunk-f28fe28ab592bd2a.js +2 -0
  18. package/dist/chunk-f7a2f27070c1a0cf.js +2 -0
  19. package/dist/kernel/index.js +1 -1
  20. package/dist/services/index.js +1 -1
  21. package/package.json +1 -1
  22. package/dist/chunk-116e493e1848228a.js +0 -2
  23. package/dist/chunk-24341645f1dbb11b.js +0 -2
  24. package/dist/chunk-37a23ee8398a9bdf.js +0 -9
  25. package/dist/chunk-4df444d8a20035e1.js +0 -2
  26. package/dist/chunk-6c96e8e51232f838.js +0 -2
  27. package/dist/chunk-6fbe844659c3b67d.js +0 -6
  28. package/dist/chunk-833e8b963e935111.js +0 -2
  29. package/dist/chunk-8f66c4705c7ddab7.js +0 -18
  30. package/dist/chunk-905d85c9a9ca1c9e.js +0 -2
  31. package/dist/chunk-a4e7e8a00a47ba85.js +0 -2
  32. package/dist/chunk-acf6e39c4caa6aeb.js +0 -3
  33. package/dist/chunk-b0131f371340bf21.js +0 -2
  34. package/dist/chunk-c36af52cbe0d034e.js +0 -2
  35. package/dist/chunk-e5ed2736da251b56.js +0 -1
  36. package/dist/chunk-f6597f92f878d2dc.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"../chunk-f6597f92f878d2dc.js";import{B as L} from"../chunk-24a86f8f5ddc0cbd.js";import{G as $f,H as Vd} from"../chunk-0ba2cc302113ab40.js";import{M as sg} from"../chunk-28694e5e949df0ff.js";import{$ as Se,N as br,O as Zr,P as Kr,Q as $m,R as Dm,S as Um,T as Mm,U as Pg,V as rr,W as sr,X as ef,Y as hl,Z as Cm,_ as de,aa as Re,ba as Ae,ca as Fm,da as ua,ea as ta,fa as rm,ga as sm,ha as zm,ia as Gm,ja as Ee,ka as Dr,la as ym,ma as lm,na as fm,oa as Wm,pa as hm,qa as Km,ra as Ns,sa as em,ta as Ys,ua as am,va as mm,wa as km,xa as Pm} from"../chunk-8f66c4705c7ddab7.js";import{$a as kr,Aa as X,Ba as as,Ca as Kf,Fa as Ya,Ga as ss,Ha as Ba,Ia as es,Ja as Tm,Ka as Oa,La as qa,Ma as _a,Oa as xa,Pa as oa,Qa as Wa,Ra as ja,Sa as ah,Ta as mh,Ua as Je,Va as $r,Wa as v,Ya as cr,ab as Xe,bb as Pr,cb as Qe,db as Ws,eb as Jr,gb as xl,hb as Lr,ib as Ue,jb as _,kb as ce,lb as na,mb as pa,nb as Em,ob as Im,qb as G,sb as Ye,ya as Rm,za as Am} from"../chunk-acf6e39c4caa6aeb.js";import{ub as Ng} from"../chunk-786985b106091b91.js";import{vb as yd,wb as O} from"../chunk-e5ed2736da251b56.js";import"../chunk-b0131f371340bf21.js";import{yb as gm} from"../chunk-37a23ee8398a9bdf.js";import"../chunk-a96c2e272f0ddf6c.js";class er{}class xr extends er{r;constructor(r=`${process.env.ROOT_DIR}/storage`){super();this.folderPath=r}async put(r){let s,l;if(r instanceof Blob)s=r,l=`${br()}.${r.type.split("/")[1].split(";")[0]}`;else s=r.body,l=r.name;const f=s instanceof Buffer?s:Buffer.from(await s.arrayBuffer()),h=`${this.folderPath}/${l}`;return await Bun.write(h,f),l}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=`${this.folderPath}/${l}`,h=Bun.file(f),e=Bun.file(f).stream(),m=new Date(h.lastModified).toUTCString();return new Response(e,{headers:{"Content-Type":h.type,"Content-Length":String(h.size),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":m}})}}class Df{driver=new xr}function om(r){return(s)=>async(l)=>{const{request:f}=l;if(X.isInstance(f)&&f.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")f.headers={...f.headers,Expect:"100-continue"}}return s({...l,request:f})}}var nm={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Uf=(r)=>({applyToStack:(s)=>{s.add(om(r),nm)}});var Cr={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},or=Cr.WHEN_SUPPORTED,ns={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},nr=Cr.WHEN_SUPPORTED,U;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(U||(U={}));var Mf;(function(r){r.HEADER="header",r.TRAILER="trailer"})(Mf||(Mf={}));var{MD5:Tf,CRC32:Cf}=U;var b;(function(r){r.ENV="env",r.CONFIG="shared config entry"})(b||(b={}));var ar=(r,s,l,f)=>{if(!(s in r))return;const h=r[s].toUpperCase();if(!Object.values(l).includes(h))throw new TypeError(`Cannot load ${f} '${s}'. Expected one of ${Object.values(l)}, got '${r[s]}'.`);return h};var pm="AWS_REQUEST_CHECKSUM_CALCULATION",um="request_checksum_calculation",Ff={environmentVariableSelector:(r)=>ar(r,pm,Cr,b.ENV),configFileSelector:(r)=>ar(r,um,Cr,b.CONFIG),default:or};var tm="AWS_RESPONSE_CHECKSUM_VALIDATION",rg="response_checksum_validation",zf={environmentVariableSelector:(r)=>ar(r,tm,ns,b.ENV),configFileSelector:(r)=>ar(r,rg,ns,b.CONFIG),default:nr};var Fr=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256],Gf=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256];var yf=(r,{requestChecksumRequired:s,requestAlgorithmMember:l},f)=>{const h=f?Cf:Tf;if(!l||!r[l])return s?h:void 0;const e=r[l];if(!Fr.includes(e))throw new Error(`The checksum algorithm "${e}" is not supported by the client.`+` Select one of ${Fr}.`);return e};var mr=(r)=>r===U.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var Wf=(r,s)=>{const l=r.toLowerCase();for(let f of Object.keys(s))if(l===f.toLowerCase())return!0;return!1};var gr=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!Kf(r);var Lf=L(sg(),1),{__extends:y3,__assign:W3,__rest:K3,__decorate:L3,__param:V3,__esDecorate:Z3,__runInitializers:H3,__propKey:v3,__setFunctionName:J3,__metadata:X3,__awaiter:pr,__generator:ur,__exportStar:Q3,__createBinding:c3,__values:tr,__read:Y3,__spread:B3,__spreadArrays:O3,__spreadArray:q3,__await:_3,__asyncGenerator:j3,__asyncDelegator:i3,__asyncValues:b3,__makeTemplateObject:x3,__importStar:o3,__importDefault:n3,__classPrivateFieldGet:p3,__classPrivateFieldSet:u3,__classPrivateFieldIn:t3,__addDisposableResource:rS,__disposeResources:sS}=Lf.default;import{Buffer as Vf} from"buffer";var Zf=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?Vf.from(r,s):Vf.from(r)};var ps=(r)=>{const s=Zf(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function zr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return lg(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var lg=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:ps;function Gr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function yr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Wr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),l=0;while(l<r.length)s[l]=r[l],l+=1;return s}return Uint32Array.from(r)}var us=function(){function r(){this.crc32=new t}return r.prototype.update=function(s){if(Gr(s))return;this.crc32.update(zr(s))},r.prototype.digest=function(){return pr(this,void 0,void 0,function(){return ur(this,function(s){return[2,yr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new t},r}();var t=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var h=tr(s),e=h.next();!e.done;e=h.next()){var m=e.value;this.checksum=this.checksum>>>8^hg[(this.checksum^m)&255]}}catch(a){l={error:a}}finally{try{if(e&&!e.done&&(f=h.return))f.call(h)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var fg=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],hg=Wr(fg);var rl=function(){function r(){this.crc32c=new ts}return r.prototype.update=function(s){if(Gr(s))return;this.crc32c.update(zr(s))},r.prototype.digest=function(){return pr(this,void 0,void 0,function(){return ur(this,function(s){return[2,yr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new ts},r}();var ts=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var h=tr(s),e=h.next();!e.done;e=h.next()){var m=e.value;this.checksum=this.checksum>>>8^ag[(this.checksum^m)&255]}}catch(a){l={error:a}}finally{try{if(e&&!e.done&&(f=h.return))f.call(h)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var eg=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],ag=Wr(eg);var rs=(r,s)=>({[U.MD5]:s.md5,[U.CRC32]:us,[U.CRC32C]:rl,[U.SHA1]:s.sha1,[U.SHA256]:s.sha256})[r];var ls=(r,s)=>{const l=new r;return l.update(ss(s||"")),l.digest()};var Hf={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},vf=(r,s)=>(l,f)=>async(h)=>{if(!X.isInstance(h.request))return l(h);const{request:e}=h,{body:m,headers:a}=e,{base64Encoder:g,streamHasher:R}=r,{input:N,requestChecksumRequired:$,requestAlgorithmMember:D}=s,M=yf(N,{requestChecksumRequired:$,requestAlgorithmMember:D},!!f.isS3ExpressBucket);let Q=m,Y=a;if(M){const j=mr(M),Tr=rs(M,r);if(gr(m)){const{getAwsChunkedEncodingStream:os,bodyLengthChecker:xm}=r;Q=os(m,{base64Encoder:g,bodyLengthChecker:xm,checksumLocationName:j,checksumAlgorithmFn:Tr,streamHasher:R}),Y={...a,"content-encoding":a["content-encoding"]?`${a["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":a["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":j},delete Y["content-length"]}else if(!Wf(j,a)){const os=await ls(Tr,m);Y={...a,[j]:g(os)}}}return await l({...h,request:{...e,headers:Y,body:Q}})};var fs=(r=[])=>{const s=[];for(let l of Gf){if(!r.includes(l)||!Fr.includes(l))continue;s.push(l)}return s};var Jf=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const l=r.slice(s+1);if(!l.startsWith("0")){const f=parseInt(l,10);if(!isNaN(f)&&f>=1&&f<=1e4)return!0}}return!1};import{Transform as mg} from"stream";function sl(r){const s=new mg;return s.push(r),s.push(null),s}var Xf=async(r,{streamHasher:s,checksumAlgorithmFn:l,base64Encoder:f})=>{const h=gr(r)?s(l,r):ls(l,r);return f(await h)};var Qf=async(r,{config:s,responseAlgorithms:l})=>{const f=fs(l),{body:h,headers:e}=r;for(let m of f){const a=mr(m),g=e[a];if(g){const R=rs(m,s),{streamHasher:N,base64Encoder:$}=s,D=await Xf(h,{streamHasher:N,checksumAlgorithmFn:R,base64Encoder:$});if(D===g)break;throw new Error(`Checksum mismatch: expected "${D}" but received "${g}"`+` in response header "${a}".`)}}};var cf={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},Yf=(r,s)=>(l,f)=>async(h)=>{if(!X.isInstance(h.request))return l(h);const e=h.input,m=await l(h),a=m.response;let g=void 0;const{requestValidationModeMember:R,responseAlgorithms:N}=s;if(R&&e[R]==="ENABLED"){const{clientName:$,commandName:D}=f;if($==="S3Client"&&D==="GetObjectCommand"&&fs(N).every((Y)=>{const ir=mr(Y),j=a.headers[ir];return!j||Jf(j)}))return m;const Q=gr(a.body);if(Q)g=await r.streamCollector(a.body),a.body=sl(g);if(await Qf(m.response,{config:r,responseAlgorithms:N}),Q&&g)a.body=sl(g)}return m};var hs=(r,s)=>({applyToStack:(l)=>{l.add(vf(r,s),Hf),l.addRelativeTo(Yf(r,s),cf)}});var Bf=(r)=>({...r,requestChecksumCalculation:Kr(r.requestChecksumCalculation??or),responseChecksumValidation:Kr(r.responseChecksumValidation??nr)});function wg(){return(r,s)=>async(l)=>{const{request:f}=l;if(X.isInstance(f)){if(!(gg in f.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof es))s.logger.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.");else console.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.")}return r({...l})}}var gg="content-length",dg={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},Of=(r)=>({applyToStack:(s)=>{s.add(wg(),dg)}});var qf=(r)=>{return(s,l)=>async(f)=>{const h=await r.region(),e=r.region;let m=()=>{};if(l.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return l.__s3RegionRedirect}}),m=()=>Object.defineProperty(r,"region",{writable:!0,value:e});try{const a=await s(f);if(l.__s3RegionRedirect){m();const g=await r.region();if(h!==g)throw new Error("Region was not restored following S3 region redirect.")}return a}catch(a){throw m(),a}}},_f={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Sg(r){return(s,l)=>async(f)=>{try{return await s(f)}catch(h){if(r.followRegionRedirects&&h?.$metadata?.httpStatusCode===301){try{const e=h.$response.headers["x-amz-bucket-region"];l.logger?.debug(`Redirecting from ${await r.region()} to ${e}`),l.__s3RegionRedirect=e}catch(e){throw new Error("Region redirect failed: "+e)}return s(f)}else throw h}}}var Rg={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},jf=(r)=>({applyToStack:(s)=>{s.add(Sg(r),Rg),s.addRelativeTo(qf(r),_f)}});var Ag=(r)=>{return(s,l)=>async(f)=>{const h=await s(f),{response:e}=h;if(as.isInstance(e)){if(e.headers.expires){e.headers.expiresstring=e.headers.expires;try{Lr(e.headers.expires)}catch(m){l.logger?.warn(`AWS SDK Warning for ${l.clientName}::${l.commandName} response parsing (${e.headers.expires}): ${m}`),delete e.headers.expires}}}return h}},Eg={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},bf=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Ag(r),Eg)}});class wr{constructor(r={}){this.data=r,this.lastPurgeTime=Date.now()}get(r){const s=this.data[r];if(!s)return;return s}set(r,s){return this.data[r]=s,s}delete(r){delete this.data[r]}async purgeExpired(){const r=Date.now();if(this.lastPurgeTime+wr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const l=this.data[s];if(!l.isRefreshing){const f=await l.identity;if(f.expiration){if(f.expiration.getTime()<r)delete this.data[s]}}}}}wr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class dr{constructor(r,s=!1,l=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=l}get identity(){return this.accessed=Date.now(),this._identity}}class Sr{constructor(r,s=new wr){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const l=s.Bucket,{cache:f}=this,h=f.get(l);if(h)return h.identity.then((e)=>{if((e.expiration?.getTime()??0)<Date.now())return f.set(l,new dr(this.getIdentity(l))).identity;if((e.expiration?.getTime()??0)<Date.now()+Sr.REFRESH_WINDOW_MS&&!h.isRefreshing)h.isRefreshing=!0,this.getIdentity(l).then((g)=>{f.set(l,new dr(Promise.resolve(g)))});return e});return f.set(l,new dr(this.getIdentity(l))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((f)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+f)});const s=await this.createSessionFn(r);if(!s.Credentials?.AccessKeyId||!s.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretAccessKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration?new Date(s.Credentials.Expiration):void 0}}}Sr.REFRESH_WINDOW_MS=60000;var tf=L(Pg(),1);var xf="Directory",of="S3Express",nf="sigv4-s3express",ms="X-Amz-S3session-Token",Vr=ms.toLowerCase(),Ig="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",kg="s3_disable_express_session_auth",ll={environmentVariableSelector:(r)=>rr(r,Ig,sr.ENV),configFileSelector:(r)=>rr(r,kg,sr.CONFIG),default:!1};var pf=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},uf=function(r,s){const l=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),f=r.credentialProvider,h=()=>{return clearTimeout(l),r.credentialProvider=f,Promise.resolve(s)};r.credentialProvider=h};class gs extends tf.SignatureV4{async signWithCredentials(r,s,l){const f=pf(s);r.headers[Vr]=s.sessionToken;const h=this;return uf(h,f),h.signRequest(r,l??{})}async presignWithCredentials(r,s,l){const f=pf(s);return delete r.headers[Vr],r.headers[ms]=s.sessionToken,r.query=r.query??{},r.query[ms]=s.sessionToken,uf(this,f),this.presign(r,l)}}var rh=(r)=>{return(s,l)=>async(f)=>{if(l.endpointV2){const h=l.endpointV2,e=h.properties?.authSchemes?.[0]?.name===nf;if(h.properties?.backend===of||h.properties?.bucketType===xf)l.isS3ExpressBucket=!0;if(e){const a=f.input.Bucket;if(a){const g=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:a});if(l.s3ExpressIdentity=g,X.isInstance(f.request)&&g.sessionToken)f.request.headers[Vr]=g.sessionToken}}}return s(f)}},sh={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},fl=(r)=>({applyToStack:(s)=>{s.add(rh(r),sh)}});var fh=L(hl(),1);var $g=L(Ng(),1);var lh=async(r,s,l,f)=>{const h=await f.signWithCredentials(l,r,{});if(h.headers["X-Amz-Security-Token"]||h.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return h};var Dg=(r)=>(s)=>{throw s},Ug=(r,s)=>{};var hh=(r)=>(s,l)=>async(f)=>{if(!X.isInstance(f.request))return s(f);const e=Zr(l).selectedHttpAuthScheme;if(!e)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:m={}},identity:a,signer:g}=e;let R;if(l.s3ExpressIdentity)R=await lh(l.s3ExpressIdentity,m,f.request,await r.signer());else R=await g.sign(f.request,a,m);const N=await s({...f,request:R}).catch((g.errorHandler||Dg)(m));return(g.successHandler||Ug)(N.response,m),N},el=(r)=>({applyToStack:(s)=>{s.addRelativeTo(hh(r),fh.httpSigningMiddlewareOptions)}});var eh=(r,{session:s})=>{const[l,f]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new Sr(async(h)=>l().send(new f({Bucket:h,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var Mg={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Tg=3000,Cg=(r)=>(s,l)=>async(f)=>{const h=await s(f),{response:e}=h;if(!as.isInstance(e))return h;const{statusCode:m,body:a}=e;if(m<200||m>=300)return h;if(!(typeof a?.stream==="function"||typeof a?.pipe==="function"||typeof a?.tee==="function"))return h;let R=a,N=a;if(a&&typeof a==="object"&&!(a instanceof Uint8Array))[R,N]=await ah(a);e.body=N;const $=await Fg(R,{streamCollector:async(M)=>{return mh(M,Tg)}});if(typeof R?.destroy==="function")R.destroy();const D=r.utf8Encoder($.subarray($.length-16));if($.length===0&&Mg[l.commandName]){const M=new Error("S3 aborted request");throw M.name="InternalError",M}if(D&&D.endsWith("</Error>"))e.statusCode=400;return h},Fg=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},zg={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},ws=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Cg(r),zg)}});var al=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function gh(r){return(s,l)=>async(f)=>{if(r.bucketEndpoint){const h=l.endpointV2;if(h){const e=f.input.Bucket;if(typeof e==="string")try{const m=new URL(e);l.endpointV2={...h,url:m}}catch(m){const a=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${e} could not be parsed as URL.`;if(l.logger?.constructor?.name==="NoOpLogger")console.warn(a);else l.logger?.warn?.(a);throw m}}}return s(f)}}var wh={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Gg({bucketEndpoint:r}){return(s)=>async(l)=>{const{input:{Bucket:f}}=l;if(!r&&typeof f==="string"&&!al(f)&&f.indexOf("/")>=0){const h=new Error(`Bucket name shouldn't contain '/', received '${f}'`);throw h.name="InvalidBucketName",h}return s({...l})}}var yg={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},dh=(r)=>({applyToStack:(s)=>{s.add(Gg(r),yg),s.addRelativeTo(gh(r),wh)}});var Mr=L(hl(),1);var Sh=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var $s=L(Ns(),1);var ds={CrtSignerV4:null};class ml{constructor(r){this.sigv4Signer=new gs(r),this.signerOptions=r}async sign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().sign(r,s)}return this.sigv4Signer.sign(r,s)}async signWithCredentials(r,s,l={}){if(l.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().signWithCredentials(r,s,l)}return this.sigv4Signer.signWithCredentials(r,s,l)}async presign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().presign(r,s)}return this.sigv4Signer.presign(r,s)}async presignWithCredentials(r,s,l={}){if(l.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,l)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=ds.CrtSignerV4,typeof r!=="function")throw new Error}catch(s){throw s.message=`${s.message}\n`+'Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \nYou must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. \nFor more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt',s}this.sigv4aSigner=new r({...this.signerOptions,signingAlgorithm:1})}return this.sigv4aSigner}}var Rr={["required"]:!1,["type"]:"String"},Ar={["required"]:!0,default:!1,["type"]:"Boolean"},Hr={["required"]:!1,["type"]:"Boolean"},B={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},P={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},k={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},C={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},le={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Rh={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},Is={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},Z={["ref"]:"Bucket"},V={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},Es={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},fe={["ref"]:"url"},he={["fn"]:"uriEncode",["argv"]:[Z],["assign"]:"uri_encoded_bucket"},i={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},w={},ee={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!1]},gl={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},ks={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},Ah={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},Eh={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},d={["fn"]:"not",["argv"]:[C]},Ih={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},kh={["fn"]:"not",["argv"]:[Is]},Ph={["ref"]:"hardwareType"},Nh={["conditions"]:[d],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},Ss={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},wl={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},Wg={["ref"]:"ForcePathStyle"},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},z={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},y={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[z]},W={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},$h={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},F={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},A={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},Dh={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},S={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Uh={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Mh={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},dl={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[fe,"isIp"]},!1]},Sl={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:F,["headers"]:{}},Ll={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:F,["headers"]:{}},Th={["endpoint"]:Ll,["type"]:"endpoint"},Rl={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Ch={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Rs={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},J={["ref"]:"bucketArn"},ae={["ref"]:"arnType"},Al={["fn"]:"getAttr",["argv"]:[J,"service"]},Vl={["ref"]:"accessPointName"},Fh={["conditions"]:[k],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},zh={["conditions"]:[B],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Gh={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},El={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},me={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},ge={["fn"]:"getAttr",["argv"]:[J,"accountId"]},Il={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},yh={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},kl={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},Pl={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},Nl={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Wh={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},Kh={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},vr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},Lh={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},Vh={["fn"]:"aws.parseArn",["argv"]:[Z]},Zh={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Hh={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},vh={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},$l={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Jh={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Xh={["ref"]:"UseObjectLambdaEndpoint"},Dl={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},Qh={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},ch={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Yh={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Ul={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:F,["headers"]:{}},Bh={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Ml=[{["ref"]:"Region"}],Kg=[{["ref"]:"Endpoint"}],Lg=[Z],Tl=[k],As=[B],lr=[C,V],Oh=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],qh=[Es],Cl=[he],Fl=[ee],Er=[P],_h=[{["fn"]:"substring",["argv"]:[Z,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],jh=[{["conditions"]:[P],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:i,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:i,["headers"]:{}},["type"]:"endpoint"}],ih=[{["fn"]:"substring",["argv"]:[Z,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],bh=[{["conditions"]:[P],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:ks,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:ks,["headers"]:{}},["type"]:"endpoint"}],Vg=[Is],xh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],oh=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Zg=["*"],x=[le],nh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],o=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],zl=[{["fn"]:"stringEquals",["argv"]:[ae,"accesspoint"]}],ph=[{["fn"]:"getAttr",["argv"]:[J,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Vl,""]}]}],Hg=[J,"resourceId[1]"],Gl=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},""]}]}],uh=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[2]"]}]}]}],vg=[J,"resourceId[2]"],yl=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]}],["assign"]:"bucketPartition"}],th=[{["fn"]:"stringEquals",["argv"]:[me,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],Wl=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},!0]}],Kl=[{["fn"]:"isValidHostLabel",["argv"]:[ge,!1]}],re=[{["fn"]:"isValidHostLabel",["argv"]:[Vl,!1]}],se=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],Jg={version:"1.0",parameters:{Bucket:Rr,Region:Rr,UseFIPS:Ar,UseDualStack:Ar,Endpoint:Rr,ForcePathStyle:Ar,Accelerate:Ar,UseGlobalEndpoint:Ar,UseObjectLambdaEndpoint:Hr,Key:Rr,Prefix:Rr,CopySource:Rr,DisableAccessPoints:Hr,DisableMultiRegionAccessPoints:Ar,UseArnRegion:Hr,UseS3ExpressControlEndpoint:Hr,DisableS3ExpressSessionAuth:Hr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:Ml}],rules:[{["conditions"]:[B,P],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[k,C],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[C,P],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[C,B],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[P,le,Rh],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[Is,{["fn"]:"substring",["argv"]:[Z,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:Tl,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:As,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:lr,rules:[{["conditions"]:Oh,rules:[{["conditions"]:qh,rules:[{["conditions"]:Cl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:i,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Fl,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:i,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},gl],["type"]:"tree"},{["conditions"]:qh,rules:[{["conditions"]:Cl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:ks,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Fl,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:ks,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},gl],["type"]:"tree"},{["conditions"]:[Ah,Eh],rules:[{["conditions"]:[he,d],rules:[{["conditions"]:Er,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:i,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:i,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Fl,rules:[{["conditions"]:Oh,rules:[{["conditions"]:_h,rules:jh,["type"]:"tree"},{["conditions"]:ih,rules:jh,["type"]:"tree"},Ih],["type"]:"tree"},{["conditions"]:_h,rules:bh,["type"]:"tree"},{["conditions"]:ih,rules:bh,["type"]:"tree"},Ih],["type"]:"tree"},gl],["type"]:"tree"},{["conditions"]:[kh,Ah,Eh],rules:[{["conditions"]:lr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:i,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Er,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:i,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:i,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[Is,{["fn"]:"substring",["argv"]:[Z,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[Z,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[Z,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[Z,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:Ml,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:xh,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Ph,"e"]}],rules:[{["conditions"]:oh,rules:[Nh,{["conditions"]:lr,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:Ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Ph,"o"]}],rules:[{["conditions"]:oh,rules:[Nh,{["conditions"]:lr,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:Ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Unrecognized hardware type: \"Expected hardware type o or e but got {hardwareType}\"",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:Vg,rules:[{["conditions"]:[C,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Kg}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[wl,ee],rules:[{["conditions"]:x,rules:[{["conditions"]:nh,rules:[{["conditions"]:[B,Rh],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[k,P,T,d,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,P,T,d,E,W],rules:[{endpoint:$h,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,P,T,d,E,K],endpoint:$h,["type"]:"endpoint"},{["conditions"]:[A,P,T,d,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,P,T,d,E,W],rules:[{endpoint:Dh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,P,T,d,E,K],endpoint:Dh,["type"]:"endpoint"},{["conditions"]:[k,S,B,d,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,S,B,d,E,W],rules:[{endpoint:Uh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,S,B,d,E,K],endpoint:Uh,["type"]:"endpoint"},{["conditions"]:[k,S,T,d,z],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,S,T,d,E,W],rules:[{endpoint:Mh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,S,T,d,E,K],endpoint:Mh,["type"]:"endpoint"},{["conditions"]:[A,S,T,C,V,Es,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,C,V,dl,z],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,C,V,Es,E,W],rules:[{["conditions"]:o,endpoint:Sl,["type"]:"endpoint"},{endpoint:Sl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,T,C,V,dl,E,W],rules:[{["conditions"]:o,endpoint:Ll,["type"]:"endpoint"},Th],["type"]:"tree"},{["conditions"]:[A,S,T,C,V,Es,E,K],endpoint:Sl,["type"]:"endpoint"},{["conditions"]:[A,S,T,C,V,dl,E,K],endpoint:Ll,["type"]:"endpoint"},{["conditions"]:[A,S,B,d,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,B,d,E,W],rules:[{["conditions"]:o,endpoint:Rl,["type"]:"endpoint"},{endpoint:Rl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,B,d,E,K],endpoint:Rl,["type"]:"endpoint"},{["conditions"]:[A,S,T,d,z],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,d,E,W],rules:[{["conditions"]:o,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:Ch,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,T,d,E,K],endpoint:Ch,["type"]:"endpoint"}],["type"]:"tree"},Rs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[C,V,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[fe,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!0]},wl,S,A,T],rules:[{["conditions"]:x,rules:[{["conditions"]:nh,rules:[Th],["type"]:"tree"},Rs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[wl,{["fn"]:"aws.parseArn",["argv"]:Lg,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[ae,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Al,"s3-object-lambda"]}],rules:[{["conditions"]:zl,rules:[{["conditions"]:ph,rules:[Fh,zh,{["conditions"]:Gl,rules:[Gh,{["conditions"]:uh,rules:[El,{["conditions"]:yl,rules:[{["conditions"]:x,rules:[{["conditions"]:th,rules:[{["conditions"]:Wl,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[ge,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:Kl,rules:[{["conditions"]:re,rules:[{["conditions"]:lr,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Il,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Er,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Il,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Il,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},yh],["type"]:"tree"},kl],["type"]:"tree"},Pl],["type"]:"tree"},Nl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Wh],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},Kh],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:zl,rules:[{["conditions"]:ph,rules:[{["conditions"]:Gl,rules:[{["conditions"]:zl,rules:[{["conditions"]:Gl,rules:[Gh,{["conditions"]:uh,rules:[El,{["conditions"]:yl,rules:[{["conditions"]:x,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[me,"{partitionResult#name}"]}],rules:[{["conditions"]:Wl,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Al,"s3"]}],rules:[{["conditions"]:Kl,rules:[{["conditions"]:re,rules:[{["conditions"]:As,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[P,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:vr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:vr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:vr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,C,V],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:vr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:vr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},yh],["type"]:"tree"},kl],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},Pl],["type"]:"tree"},Nl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Wh],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[Vl,!0]}],rules:[{["conditions"]:Tl,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:Er,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:As,error:"S3 MRAP does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableMultiRegionAccessPoints"},!0]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",["type"]:"error"},{["conditions"]:[{["fn"]:"aws.partition",["argv"]:Ml,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[J,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:Zg}]},["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Access Point Name",["type"]:"error"}],["type"]:"tree"},Kh],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Al,"s3-outposts"]}],rules:[{["conditions"]:Tl,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:Er,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:As,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:Hg,["assign"]:"outpostId"}],rules:[{["conditions"]:xh,rules:[El,{["conditions"]:yl,rules:[{["conditions"]:x,rules:[{["conditions"]:th,rules:[{["conditions"]:Wl,rules:[{["conditions"]:Kl,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:vg,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:lr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:Lh,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Lh,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Expected an outpost type `accesspoint`, found {outpostType}",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: expected an access point name",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Expected a 4-component resource",["type"]:"error"}],["type"]:"tree"},kl],["type"]:"tree"},Pl],["type"]:"tree"},Nl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The Outpost Id was not set",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: No ARN type specified",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"substring",["argv"]:[Z,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[Vh]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[Wg,!0]},Vh],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:Cl,rules:[{["conditions"]:x,rules:[{["conditions"]:[T],rules:[{["conditions"]:[k,d,P,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,d,P,E,W],rules:[{endpoint:Zh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,d,P,E,K],endpoint:Zh,["type"]:"endpoint"},{["conditions"]:[A,d,P,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,d,P,E,W],rules:[{endpoint:Hh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,P,E,K],endpoint:Hh,["type"]:"endpoint"},{["conditions"]:[k,d,S,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,d,S,E,W],rules:[{endpoint:vh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,d,S,E,K],endpoint:vh,["type"]:"endpoint"},{["conditions"]:[A,C,V,S,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,C,V,S,E,W],rules:[{["conditions"]:o,endpoint:$l,["type"]:"endpoint"},{endpoint:$l,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,C,V,S,E,K],endpoint:$l,["type"]:"endpoint"},{["conditions"]:[A,d,S,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,d,S,E,W],rules:[{["conditions"]:o,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:Jh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,S,E,K],endpoint:Jh,["type"]:"endpoint"}],["type"]:"tree"},{error:"Path-style addressing cannot be used with S3 Accelerate",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[Xh]},{["fn"]:"booleanEquals",["argv"]:[Xh,!0]}],rules:[{["conditions"]:x,rules:[{["conditions"]:se,rules:[Fh,zh,{["conditions"]:lr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:Dl,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Er,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:Dl,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:Dl,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Rs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[kh],rules:[{["conditions"]:x,rules:[{["conditions"]:se,rules:[{["conditions"]:[P,k,d,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,k,d,E,W],rules:[{endpoint:Qh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[P,k,d,E,K],endpoint:Qh,["type"]:"endpoint"},{["conditions"]:[P,A,d,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,A,d,E,W],rules:[{endpoint:ch,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[P,A,d,E,K],endpoint:ch,["type"]:"endpoint"},{["conditions"]:[S,k,d,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,k,d,E,W],rules:[{endpoint:Yh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,k,d,E,K],endpoint:Yh,["type"]:"endpoint"},{["conditions"]:[S,A,C,V,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,C,V,E,W],rules:[{["conditions"]:o,endpoint:Ul,["type"]:"endpoint"},{endpoint:Ul,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,C,V,E,K],endpoint:Ul,["type"]:"endpoint"},{["conditions"]:[S,A,d,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,d,E,W],rules:[{["conditions"]:o,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:Bh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,d,E,K],endpoint:Bh,["type"]:"endpoint"}],["type"]:"tree"},Rs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},we=Jg;var Xg=new de({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),Ps=(r,s={})=>{return Xg.get(r,()=>Re(we,{endpointParams:r,logger:s.logger}))};Se.aws=Ae;var ke=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},Pe=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},Qg=(r)=>async(s,l,f)=>{if(!f)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const h=await r(s,l,f),e=Zr(l)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!e)throw new Error(`getEndpointParameterInstructions() is not defined on \`${l.commandName}\``);const m=await Ee(f,{getEndpointParameterInstructions:e},s);return Object.assign(h,m)},cg=async(r,s,l)=>{return{operation:Zr(s).operation,region:await Kr(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Ie=Qg(cg),Yg=(r,s,l)=>{return(h)=>{const m=r(h).properties?.authSchemes;if(!m)return s(h);const a=[];for(let g of m){const{name:R,properties:N={},...$}=g,D=R.toLowerCase();if(R!==D)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${R}\` to \`${D}\``);let M;if(D==="sigv4a"){M="aws.auth#sigv4a";const ir=m.find((j)=>{const Tr=j.name.toLowerCase();return Tr!=="sigv4a"&&Tr.startsWith("sigv4")});if(!ds.CrtSignerV4&&ir)continue}else if(D.startsWith("sigv4"))M="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${D}\``);const Q=l[M];if(!Q)throw new Error(`Could not find HttpAuthOption create function for \`${M}\``);const Y=Q(h);Y.schemeId=M,Y.signingProperties={...Y.signingProperties||{},...$,...N},a.push(Y)}return a}},Bg=(r)=>{const s=[];switch(r.operation){default:s.push(ke(r)),s.push(Pe(r))}return s},Ne=Yg(Ps,Bg,{"aws.auth#sigv4":ke,"aws.auth#sigv4a":Pe}),$e=(r)=>{const s=$s.resolveAwsSdkSigV4Config(r);return{...$s.resolveAwsSdkSigV4AConfig(s)}};var Fa=L(ef(),1);var De=(r)=>{return{...r,useFipsEndpoint:r.useFipsEndpoint??!1,useDualstackEndpoint:r.useDualstackEndpoint??!1,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,defaultSigningName:"s3"}},Ir={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class H extends Ue{constructor(r){super(r);Object.setPrototypeOf(this,H.prototype)}}class Ds extends H{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,Ds.prototype)}}class Us extends H{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Us.prototype)}}class Ms extends H{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,Ms.prototype)}}class Ts extends H{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,Ts.prototype)}}class Cs extends H{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,Cs.prototype)}}var Zl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Zl||(Zl={}));var Hl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return l.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return l.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Hl||(Hl={}));var vl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.AccessPointArn!==void 0)return l.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(vl||(vl={}));var Jl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Jl||(Jl={}));class Fs extends H{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,Fs.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class zs extends H{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,zs.prototype)}}class Gs extends H{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,Gs.prototype)}}var Og=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:v},...r.SessionToken&&{SessionToken:v}}),Me=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v},...r.Credentials&&{Credentials:Og(r.Credentials)}}),Te=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}});var Ce=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v}}),Fe=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:v}});var Nr=L(Ns(),1);var Ks=L(hl(),1);class ys extends H{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,ys.prototype)}}var ze;(function(r){r.visit=(s,l)=>{if(s.Records!==void 0)return l.Records(s.Records);if(s.Stats!==void 0)return l.Stats(s.Stats);if(s.Progress!==void 0)return l.Progress(s.Progress);if(s.Cont!==void 0)return l.Cont(s.Cont);if(s.End!==void 0)return l.End(s.End);return l._(s.$unknown[0],s.$unknown[1])}})(ze||(ze={}));var Ge=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}}),ye=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:v},...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}});var Be=async(r,s)=>{const l=Ks.requestBuilder(r,s),f=G({},q,{[ow]:r[Gw],[Or]:r[Yr],[qr]:r[Br],[Hs]:r[Zs],[n]:[()=>q(r[fr]),()=>r[fr].toString()]});l.bp("/"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const h=G({[jw]:[,""]});let e;return l.m("GET").h(f).q(h).b(e),l.build()};var Oe=async(r,s)=>{const l=Ks.requestBuilder(r,s),f=G({},q,{[Hw]:r[Aw],[vw]:[()=>q(r[We]),()=>Jr(r[We]).toString()],[Aa]:r[ra],[Jw]:[()=>q(r[Ke]),()=>Jr(r[Ke]).toString()],[Qw]:r[Nw],[vs]:r[Ls],[Ua]:r[ea],[Js]:r[Vs],[$a]:r[ha],[Ia]:r[ue],[xw]:r[hw]});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const h=G({[Ca]:[,"GetObject"],[cw]:[,r[$w]],[Yw]:[,r[Dw]],[Bw]:[,r[Uw]],[Ow]:[,r[Mw]],[qw]:[,r[Tw]],[_w]:[()=>r.ResponseExpires!==void 0,()=>Jr(r[Cw]).toString()],[iw]:[,r[rf]],[Xw]:[()=>r.PartNumber!==void 0,()=>r[Pw].toString()]});let e;return l.m("GET").h(f).q(h).b(e),l.build()};var qe=async(r,s)=>{const l=Ks.requestBuilder(r,s),f=G({},q,{[Sa]:r[pe]||"application/octet-stream",[bw]:r[sw],[ma]:r[be],[ga]:r[xe],[wa]:r[oe],[da]:r[ne],[jl]:[()=>q(r[Ol]),()=>r[Ol].toString()],[Lw]:r[ew],[ld]:r[fw],[sf]:r[nl],[lf]:r[pl],[ff]:r[ul],[hf]:r[tl],[il]:[()=>q(r[ql]),()=>Jr(r[ql]).toString()],[Aa]:r[ra],[nw]:r[ww],[pw]:r[dw],[uw]:r[Sw],[tw]:r[Rw],[Or]:r[Yr],[Da]:r[Qr],[Ta]:r[aa],[vs]:r[Ls],[Ua]:r[ea],[Js]:r[Vs],[qr]:r[Br],[Hs]:r[Zs],[n]:[()=>q(r[fr]),()=>r[fr].toString()],[$a]:r[ha],[fd]:r[yw],[Pa]:r[la],[bl]:[()=>q(r[_l]),()=>Ye(r[_l]).toString()],[ka]:r[sa],[Ia]:r[ue],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((a,g)=>{return a[`x-amz-meta-${g.toLowerCase()}`]=r.Metadata[g],a},{})});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const h=G({[Ca]:[,"PutObject"]});let e,m;if(r.Body!==void 0)m=r.Body,e=m;return l.m("PUT").h(f).q(h).b(e),l.build()};var _e=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return ol(r,s);const l=G({$metadata:c(r),[Yr]:[,r.headers[Or]],[Br]:[,r.headers[qr]],[Zs]:[,r.headers[Hs]],[fr]:[()=>r.headers[n]!==void 0,()=>cr(r.headers[n])]}),f=kr(Xe(await Nr.parseXmlBody(r.body,s)),"body");if(f[cl]!=null)l[cl]=rw(f[cl],s);return l};var je=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return ol(r,s);const l=G({$metadata:c(r),[mw]:[()=>r.headers[Ve]!==void 0,()=>cr(r.headers[Ve])],[lw]:[,r.headers[Kw]],[Xr]:[,r.headers[Ea]],[zw]:[,r.headers[rd]],[Ew]:[()=>r.headers[Le]!==void 0,()=>kr(Lr(r.headers[Le]))],[Ol]:[()=>r.headers[jl]!==void 0,()=>Qe(r.headers[jl])],[te]:[,r.headers[Ra]],[nl]:[,r.headers[sf]],[pl]:[,r.headers[lf]],[ul]:[,r.headers[ff]],[tl]:[,r.headers[hf]],[Iw]:[()=>r.headers[Ze]!==void 0,()=>Ws(r.headers[Ze])],[rf]:[,r.headers[Ma]],[be]:[,r.headers[ma]],[xe]:[,r.headers[ga]],[oe]:[,r.headers[wa]],[ne]:[,r.headers[da]],[aw]:[,r.headers[Vw]],[pe]:[,r.headers[Sa]],[ql]:[()=>r.headers[il]!==void 0,()=>kr(Lr(r.headers[il]))],[gw]:[,r.headers[Zw]],[aa]:[,r.headers[Ta]],[Yr]:[,r.headers[Or]],[Ls]:[,r.headers[vs]],[Vs]:[,r.headers[Js]],[Br]:[,r.headers[qr]],[fr]:[()=>r.headers[n]!==void 0,()=>cr(r.headers[n])],[Qr]:[,r.headers[Da]],[fa]:[,r.headers[Na]],[Fw]:[,r.headers[sd]],[kw]:[()=>r.headers[He]!==void 0,()=>Ws(r.headers[He])],[Ww]:[()=>r.headers[ve]!==void 0,()=>Ws(r.headers[ve])],[la]:[,r.headers[Pa]],[_l]:[()=>r.headers[bl]!==void 0,()=>kr(xl(r.headers[bl]))],[sa]:[,r.headers[ka]],Metadata:[,Object.keys(r.headers).filter((h)=>h.startsWith("x-amz-meta-")).reduce((h,e)=>{return h[e.substring(11)]=r.headers[e],h},{})]}),f=r.body;return s.sdkStreamMixin(f),l.Body=f,l};var ie=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return ol(r,s);const l=G({$metadata:c(r),[Xr]:[,r.headers[Ea]],[te]:[,r.headers[Ra]],[nl]:[,r.headers[sf]],[pl]:[,r.headers[lf]],[ul]:[,r.headers[ff]],[tl]:[,r.headers[hf]],[Yr]:[,r.headers[Or]],[rf]:[,r.headers[Ma]],[Ls]:[,r.headers[vs]],[Vs]:[,r.headers[Js]],[Br]:[,r.headers[qr]],[Zs]:[,r.headers[Hs]],[fr]:[()=>r.headers[n]!==void 0,()=>cr(r.headers[n])],[fa]:[,r.headers[Na]]});return await Je(r.body,s),l};var ol=async(r,s)=>{const l={...r,body:await Nr.parseXmlErrorBody(r.body,s)},f=Nr.loadRestXmlErrorCode(r,l.body);switch(f){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await ng(l,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await tg(l,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await jg(l,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await ig(l,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await xg(l,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await bg(l,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await og(l,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await pg(l,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await ug(l,s);default:const h=l.body;return _g({output:r,parsedBody:h,errorCode:f})}},_g=ce(H),jg=async(r,s)=>{const l=G({}),f=r.body,h=new Ms({$metadata:c(r),...l});return _(h,r.body)},ig=async(r,s)=>{const l=G({}),f=r.body,h=new Ts({$metadata:c(r),...l});return _(h,r.body)},bg=async(r,s)=>{const l=G({}),f=r.body;if(f[Ql]!=null)l[Ql]=Pr(f[Ql]);if(f[Qr]!=null)l[Qr]=Pr(f[Qr]);const h=new Fs({$metadata:c(r),...l});return _(h,r.body)},xg=async(r,s)=>{const l=G({}),f=r.body,h=new Cs({$metadata:c(r),...l});return _(h,r.body)},og=async(r,s)=>{const l=G({}),f=r.body,h=new zs({$metadata:c(r),...l});return _(h,r.body)},ng=async(r,s)=>{const l=G({}),f=r.body,h=new Ds({$metadata:c(r),...l});return _(h,r.body)},pg=async(r,s)=>{const l=G({}),f=r.body,h=new Gs({$metadata:c(r),...l});return _(h,r.body)},ug=async(r,s)=>{const l=G({}),f=r.body,h=new ys({$metadata:c(r),...l});return _(h,r.body)},tg=async(r,s)=>{const l=G({}),f=r.body,h=new Us({$metadata:c(r),...l});return _(h,r.body)};var rw=(r,s)=>{const l={};if(r[Xl]!=null)l[Xl]=Pr(r[Xl]);if(r[Yl]!=null)l[Yl]=Pr(r[Yl]);if(r[Bl]!=null)l[Bl]=Pr(r[Bl]);if(r[Xr]!=null)l[Xr]=kr(xl(r[Xr]));return l};var c=(r)=>({httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]});var q=(r)=>r!==void 0&&r!==null&&r!==""&&(!Object.getOwnPropertyNames(r).includes("length")||r.length!=0)&&(!Object.getOwnPropertyNames(r).includes("size")||r.size!=0);var sw="ACL";var Xl="AccessKeyId";var lw="AcceptRanges";var Ql="AccessTier";var fr="BucketKeyEnabled";var cl="Credentials",fw="ChecksumAlgorithm";var be="CacheControl",nl="ChecksumCRC32",pl="ChecksumCRC32C",xe="ContentDisposition";var oe="ContentEncoding";var ne="ContentLanguage",Ol="ContentLength",hw="ChecksumMode",ew="ContentMD5";var aw="ContentRange";var ul="ChecksumSHA1",tl="ChecksumSHA256";var pe="ContentType";var mw="DeleteMarker";var ql="Expires";var ue="ExpectedBucketOwner";var gw="ExpiresString";var te="ETag";var Xr="Expiration";var ww="GrantFullControl";var dw="GrantRead",Sw="GrantReadACP";var Rw="GrantWriteACP";var Aw="IfMatch",We="IfModifiedSince",ra="IfNoneMatch";var Ke="IfUnmodifiedSince";var Ew="LastModified";var Iw="MissingMeta";var sa="ObjectLockLegalHoldStatus",la="ObjectLockMode";var _l="ObjectLockRetainUntilDate";var kw="PartsCount";var Pw="PartNumber";var Nw="Range";var fa="RequestCharged",$w="ResponseCacheControl",Dw="ResponseContentDisposition",Uw="ResponseContentEncoding",Mw="ResponseContentLanguage",Tw="ResponseContentType";var Cw="ResponseExpires";var ha="RequestPayer";var Fw="ReplicationStatus";var zw="Restore";var Yl="SecretAccessKey";var Qr="StorageClass";var Gw="SessionMode";var Yr="ServerSideEncryption";var Ls="SSECustomerAlgorithm",ea="SSECustomerKey",Vs="SSECustomerKeyMD5";var Zs="SSEKMSEncryptionContext",Br="SSEKMSKeyId";var Bl="SessionToken";var yw="Tagging";var Ww="TagCount";var rf="VersionId";var aa="WebsiteRedirectLocation";var Kw="accept-ranges";var ma="cache-control",ga="content-disposition",wa="content-encoding",da="content-language",jl="content-length",Lw="content-md5",Vw="content-range",Sa="content-type";var il="expires";var Ra="etag",Zw="expiresstring";var Hw="if-match",vw="if-modified-since";var Aa="if-none-match";var Jw="if-unmodified-since";var Le="last-modified";var Xw="partNumber";var Qw="range",cw="response-cache-control",Yw="response-content-disposition",Bw="response-content-encoding",Ow="response-content-language",qw="response-content-type",_w="response-expires";var jw="session";var iw="versionId";var bw="x-amz-acl";var sf="x-amz-checksum-crc32",lf="x-amz-checksum-crc32c",xw="x-amz-checksum-mode";var ff="x-amz-checksum-sha1",hf="x-amz-checksum-sha256";var ow="x-amz-create-session-mode";var Ve="x-amz-delete-marker",Ea="x-amz-expiration",Ia="x-amz-expected-bucket-owner";var nw="x-amz-grant-full-control",pw="x-amz-grant-read",uw="x-amz-grant-read-acp";var tw="x-amz-grant-write-acp";var Ze="x-amz-missing-meta";var He="x-amz-mp-parts-count";var ka="x-amz-object-lock-legal-hold",Pa="x-amz-object-lock-mode",bl="x-amz-object-lock-retain-until-date";var rd="x-amz-restore",Na="x-amz-request-charged";var $a="x-amz-request-payer";var sd="x-amz-replication-status";var Da="x-amz-storage-class",ld="x-amz-sdk-checksum-algorithm";var Or="x-amz-server-side-encryption",qr="x-amz-server-side-encryption-aws-kms-key-id",n="x-amz-server-side-encryption-bucket-key-enabled",Hs="x-amz-server-side-encryption-context",vs="x-amz-server-side-encryption-customer-algorithm",Ua="x-amz-server-side-encryption-customer-key",Js="x-amz-server-side-encryption-customer-key-md5",fd="x-amz-tagging",ve="x-amz-tagging-count";var Ma="x-amz-version-id",Ta="x-amz-website-redirect-location",Ca="x-id";class af extends $r.classBuilder().ep({...Ir,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,l,f){return[Fa.getSerdePlugin(l,this.serialize,this.deserialize),Dr(l,r.getEndpointParameterInstructions()),ws(l)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(Te,Me).ser(Be).de(_e).build(){}var za={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.654.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn test:unit","test:e2e":"yarn test:e2e:node && yarn test:e2e:browser","test:e2e:browser":"ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js","test:e2e:node":"jest --c jest.config.e2e.js","test:unit":"ts-mocha test/unit/**/*.spec.ts"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.654.0","@aws-sdk/client-sts":"3.654.0","@aws-sdk/core":"3.654.0","@aws-sdk/credential-provider-node":"3.654.0","@aws-sdk/middleware-bucket-endpoint":"3.654.0","@aws-sdk/middleware-expect-continue":"3.654.0","@aws-sdk/middleware-flexible-checksums":"3.654.0","@aws-sdk/middleware-host-header":"3.654.0","@aws-sdk/middleware-location-constraint":"3.654.0","@aws-sdk/middleware-logger":"3.654.0","@aws-sdk/middleware-recursion-detection":"3.654.0","@aws-sdk/middleware-sdk-s3":"3.654.0","@aws-sdk/middleware-ssec":"3.654.0","@aws-sdk/middleware-user-agent":"3.654.0","@aws-sdk/region-config-resolver":"3.654.0","@aws-sdk/signature-v4-multi-region":"3.654.0","@aws-sdk/types":"3.654.0","@aws-sdk/util-endpoints":"3.654.0","@aws-sdk/util-user-agent-browser":"3.654.0","@aws-sdk/util-user-agent-node":"3.654.0","@aws-sdk/xml-builder":"3.654.0","@smithy/config-resolver":"^3.0.8","@smithy/core":"^2.4.3","@smithy/eventstream-serde-browser":"^3.0.9","@smithy/eventstream-serde-config-resolver":"^3.0.6","@smithy/eventstream-serde-node":"^3.0.8","@smithy/fetch-http-handler":"^3.2.7","@smithy/hash-blob-browser":"^3.1.5","@smithy/hash-node":"^3.0.6","@smithy/hash-stream-node":"^3.1.5","@smithy/invalid-dependency":"^3.0.6","@smithy/md5-js":"^3.0.6","@smithy/middleware-content-length":"^3.0.8","@smithy/middleware-endpoint":"^3.1.3","@smithy/middleware-retry":"^3.0.18","@smithy/middleware-serde":"^3.0.6","@smithy/middleware-stack":"^3.0.6","@smithy/node-config-provider":"^3.1.7","@smithy/node-http-handler":"^3.2.2","@smithy/protocol-http":"^4.1.3","@smithy/smithy-client":"^3.3.2","@smithy/types":"^3.4.2","@smithy/url-parser":"^3.0.6","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.18","@smithy/util-defaults-mode-node":"^3.0.18","@smithy/util-endpoints":"^2.1.2","@smithy/util-middleware":"^3.0.6","@smithy/util-retry":"^3.0.6","@smithy/util-stream":"^3.1.6","@smithy/util-utf8":"^3.0.0","@smithy/util-waiter":"^3.1.5",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.654.0","@tsconfig/node16":"16.1.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-s3"}};var Bs=L(Ns(),1);var ed="AWS_S3_USE_ARN_REGION",ad="s3_use_arn_region",Ga={environmentVariableSelector:(r)=>rr(r,ed,sr.ENV),configFileSelector:(r)=>rr(r,ad,sr.CONFIG),default:!1};var p=L(Wa(),1);var Ka=L(Wa(),1),ya=function(r){for(let s=0;s<8;s++)r[s]^=255;for(let s=7;s>-1;s--)if(r[s]++,r[s]!==0)break};class Ur{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let l=7,f=Math.abs(Math.round(r));l>-1&&f>0;l--,f/=256)s[l]=f;if(r<0)ya(s);return new Ur(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)ya(r);return parseInt(Ka.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class mf{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let h of Object.keys(r)){const e=this.fromUtf8(h);s.push(Uint8Array.from([e.byteLength]),e,this.formatHeaderValue(r[h]))}const l=new Uint8Array(s.reduce((h,e)=>h+e.byteLength,0));let f=0;for(let h of s)l.set(h,f),f+=h.byteLength;return l}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const l=new DataView(new ArrayBuffer(5));return l.setUint8(0,4),l.setInt32(1,r.value,!1),new Uint8Array(l.buffer);case"long":const f=new Uint8Array(9);return f[0]=5,f.set(r.value.bytes,1),f;case"binary":const h=new DataView(new ArrayBuffer(3+r.value.byteLength));h.setUint8(0,6),h.setUint16(1,r.value.byteLength,!1);const e=new Uint8Array(h.buffer);return e.set(r.value,3),e;case"string":const m=this.fromUtf8(r.value),a=new DataView(new ArrayBuffer(3+m.byteLength));a.setUint8(0,7),a.setUint16(1,m.byteLength,!1);const g=new Uint8Array(a.buffer);return g.set(m,3),g;case"timestamp":const R=new Uint8Array(9);return R[0]=8,R.set(Ur.fromNumber(r.value.valueOf()).bytes,1),R;case"uuid":if(!Cd.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const N=new Uint8Array(17);return N[0]=9,N.set(p.fromHex(r.value.replace(/\-/g,"")),1),N}}parse(r){const s={};let l=0;while(l<r.byteLength){const f=r.getUint8(l++),h=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,f));switch(l+=f,r.getUint8(l++)){case 0:s[h]={type:Va,value:!0};break;case 1:s[h]={type:Va,value:!1};break;case 2:s[h]={type:kd,value:r.getInt8(l++)};break;case 3:s[h]={type:Pd,value:r.getInt16(l,!1)},l+=2;break;case 4:s[h]={type:Nd,value:r.getInt32(l,!1)},l+=4;break;case 5:s[h]={type:$d,value:new Ur(new Uint8Array(r.buffer,r.byteOffset+l,8))},l+=8;break;case 6:const e=r.getUint16(l,!1);l+=2,s[h]={type:Dd,value:new Uint8Array(r.buffer,r.byteOffset+l,e)},l+=e;break;case 7:const m=r.getUint16(l,!1);l+=2,s[h]={type:Ud,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,m))},l+=m;break;case 8:s[h]={type:Md,value:new Date(new Ur(new Uint8Array(r.buffer,r.byteOffset+l,8)).valueOf())},l+=8;break;case 9:const a=new Uint8Array(r.buffer,r.byteOffset+l,16);l+=16,s[h]={type:Td,value:`${p.toHex(a.subarray(0,4))}-${p.toHex(a.subarray(4,6))}-${p.toHex(a.subarray(6,8))}-${p.toHex(a.subarray(8,10))}-${p.toHex(a.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var La;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(La||(La={}));var Va="boolean",kd="byte",Pd="short",Nd="integer",$d="long",Dd="binary",Ud="string",Md="timestamp",Td="uuid",Cd=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function Ha({byteLength:r,byteOffset:s,buffer:l}){if(r<Fd)throw new Error("Provided message too short to accommodate event stream message overhead");const f=new DataView(l,s,r),h=f.getUint32(0,!1);if(r!==h)throw new Error("Reported message length does not match received message length");const e=f.getUint32(Za,!1),m=f.getUint32(u,!1),a=f.getUint32(r-hr,!1),g=new t().update(new Uint8Array(l,s,u));if(m!==g.digest())throw new Error(`The prelude checksum specified in the message (${m}) does not match the calculated CRC32 checksum (${g.digest()})`);if(g.update(new Uint8Array(l,s+u,r-(u+hr))),a!==g.digest())throw new Error(`The message checksum (${g.digest()}) did not match the expected value of ${a}`);return{headers:new DataView(l,s+u+hr,e),body:new Uint8Array(l,s+u+hr+e,h-e-(u+hr+hr))}}var Za=4,u=Za*2,hr=4,Fd=u+hr*2;class gf{constructor(r,s){this.headerMarshaller=new mf(r,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(r){this.messageBuffer.push(this.decode(r))}endOfStream(){this.isEndOfStream=!0}getMessage(){const r=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return r},isEndOfStream(){return s}}}getAvailableMessages(){const r=this.messageBuffer;this.messageBuffer=[];const s=this.isEndOfStream;return{getMessages(){return r},isEndOfStream(){return s}}}encode({headers:r,body:s}){const l=this.headerMarshaller.format(r),f=l.byteLength+s.byteLength+16,h=new Uint8Array(f),e=new DataView(h.buffer,h.byteOffset,h.byteLength),m=new t;return e.setUint32(0,f,!1),e.setUint32(4,l.byteLength,!1),e.setUint32(8,m.update(h.subarray(0,8)).digest(),!1),h.set(l,12),h.set(s,l.byteLength+12),e.setUint32(f-4,m.update(h.subarray(8,f-4)).digest(),!1),h}decode(r){const{headers:s,body:l}=Ha(r);return{headers:this.headerMarshaller.parse(s),body:l}}formatHeaders(r){return this.headerMarshaller.format(r)}}class wf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.decoder.decode(r)}}class df{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream)yield this.options.encoder.encode(r);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class Sf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream){const s=await this.options.deserializer(r);if(s===void 0)continue;yield s}}}class Rf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.serializer(r)}}function va(r){let s=0,l=0,f=null,h=null;const e=(a)=>{if(typeof a!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+a);s=a,l=4,f=new Uint8Array(a),new DataView(f.buffer).setUint32(0,a,!1)},m=async function*(){const a=r[Symbol.asyncIterator]();while(!0){const{value:g,done:R}=await a.next();if(R){if(!s)return;else if(s===l)yield f;else throw new Error("Truncated event message received.");return}const N=g.length;let $=0;while($<N){if(!f){const M=N-$;if(!h)h=new Uint8Array(4);const Q=Math.min(4-l,M);if(h.set(g.slice($,$+Q),l),l+=Q,$+=Q,l<4)break;e(new DataView(h.buffer).getUint32(0,!1)),h=null}const D=Math.min(s-l,N-$);if(f.set(g.slice($,$+D),l),l+=D,$+=D,s&&s===l)yield f,f=null,s=0,l=0}}};return{[Symbol.asyncIterator]:m}}function Ja(r,s){return async function(l){const{value:f}=l.headers[":message-type"];if(f==="error"){const h=new Error(l.headers[":error-message"].value||"UnknownError");throw h.name=l.headers[":error-code"].value,h}else if(f==="exception"){const h=l.headers[":exception-type"].value,e={[h]:l},m=await r(e);if(m.$unknown){const a=new Error(s(l.body));throw a.name=h,a}throw m[h]}else if(f==="event"){const h={[l.headers[":event-type"].value]:l},e=await r(h);if(e.$unknown)return;return e}else throw Error(`Unrecognizable event type: ${l.headers[":event-type"].value}`)}}class Xs{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new gf(r,s),this.utfEncoder=r}deserialize(r,s){const l=va(r);return new Sf({messageStream:new wf({inputStream:l,decoder:this.eventStreamCodec}),deserializer:Ja(s,this.utfEncoder)})}serialize(r,s){return new df({messageStream:new Rf({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as zd} from"stream";async function*Xa(r){let s=!1,l=!1;const f=new Array;r.on("error",(h)=>{if(!s)s=!0;if(h)throw h}),r.on("data",(h)=>{f.push(h)}),r.on("end",()=>{s=!0});while(!l){const h=await new Promise((e)=>setTimeout(()=>e(f.shift()),0));if(h)yield h;l=s&&f.length===0}}class Af{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Xs({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const l=typeof r[Symbol.asyncIterator]==="function"?r:Xa(r);return this.universalMarshaller.deserialize(l,s)}serialize(r,s){return zd.from(this.universalMarshaller.serialize(r,s))}}var Qa=(r)=>new Af(r);import{Writable as Gd} from"stream";class Qs extends Gd{constructor(r,s){super(s);this.hash=r}_write(r,s,l){try{this.hash.update(ss(r))}catch(f){return l(f)}l()}}var ca=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const l=new r,f=new Qs(l);return s.pipe(f),new Promise((h,e)=>{s.on("error",(m)=>{f.end(),e(m)}),f.on("error",e),f.on("finish",()=>{l.digest().then(h).catch(e)})})};var cs=L(Ns(),1);var ia=L(yd(),1);var ba=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??Oa,base64Encoder:r?.base64Encoder??qa,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??Ps,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??_a,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Ne,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new cs.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new cs.AwsSdkSigV4ASigner}],logger:r?.logger??new es,sdkStreamMixin:r?.sdkStreamMixin??ja,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??ml,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??ia.parseUrl,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Ya,utf8Encoder:r?.utf8Encoder??Ba}};var wm=(r)=>{pa(process.version);const s=mm(r),l=()=>s().then(na),f=ba(r);return Bs.emitWarningIfUnsupportedVersion(process.version),{...f,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??am,credentialDefaultProvider:r?.credentialDefaultProvider??gm,defaultUserAgentProvider:r?.defaultUserAgentProvider??em({serviceId:f.serviceId,clientVersion:za.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??O(ll),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??Qa,maxAttempts:r?.maxAttempts??O(fm),md5:r?.md5??Ys.bind(null,"md5"),region:r?.region??O(rm,sm),requestChecksumCalculation:r?.requestChecksumCalculation??O(Ff),requestHandler:xa.create(r?.requestHandler??l),responseChecksumValidation:r?.responseChecksumValidation??O(zf),retryMode:r?.retryMode??O({...hm,default:async()=>(await l()).retryMode||lm}),sha1:r?.sha1??Ys.bind(null,"sha1"),sha256:r?.sha256??Ys.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??O(Bs.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??oa,streamHasher:r?.streamHasher??ca,useArnRegion:r?.useArnRegion??O(Ga),useDualstackEndpoint:r?.useDualstackEndpoint??O(ua),useFipsEndpoint:r?.useFipsEndpoint??O(ta)}};var dm=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:l,credentials:f}=r;return{setHttpAuthScheme(h){const e=s.findIndex((m)=>m.schemeId===h.schemeId);if(e===-1)s.push(h);else s.splice(e,1,h)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(h){l=h},httpAuthSchemeProvider(){return l},setCredentials(h){f=h},credentials(){return f}}},Sm=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var Os=(r)=>r,Nm=(r,s)=>{const l={...Os(km(r)),...Os(Em(r)),...Os(Rm(r)),...Os(dm(r))};return s.forEach((f)=>f.configure(l)),{...r,...Pm(l),...Im(l),...Am(l),...Sm(l)}};class Ef extends Tm{constructor(...[r]){const s=wm(r||{}),l=De(s),f=Cm(l),h=Bf(f),e=Wm(h),m=zm(e),a=$m(m),g=ym(a),R=Sh(g),N=$e(R),$=eh(N,{session:[()=>this,af]}),D=Nm($,r?.extensions||[]);super(D);this.config=D,this.middlewareStack.use(Fm(this.config)),this.middlewareStack.use(Km(this.config)),this.middlewareStack.use(Gm(this.config)),this.middlewareStack.use(Dm(this.config)),this.middlewareStack.use(Um(this.config)),this.middlewareStack.use(Mm(this.config)),this.middlewareStack.use(Mr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Ie,identityProviderConfigProvider:async(M)=>new Mr.DefaultIdentityProviderConfig({"aws.auth#sigv4":M.credentials,"aws.auth#sigv4a":M.credentials})})),this.middlewareStack.use(Mr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(dh(this.config)),this.middlewareStack.use(Uf(this.config)),this.middlewareStack.use(jf(this.config)),this.middlewareStack.use(fl(this.config)),this.middlewareStack.use(el(this.config))}destroy(){super.destroy()}}function Wd(r){return(s)=>async(l)=>{const f={...l.input},h=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let e of h){const m=f[e.target];if(m){let a;if(typeof m==="string")if(Ld(m,r))a=r.base64Decoder(m);else a=r.utf8Decoder(m),f[e.target]=r.base64Encoder(a);else a=ArrayBuffer.isView(m)?new Uint8Array(m.buffer,m.byteOffset,m.byteLength):new Uint8Array(m),f[e.target]=r.base64Encoder(a);const g=new r.md5;g.update(a),f[e.hash]=r.base64Encoder(await g.digest())}}return s({...l,input:f})}}function Ld(r,s){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r))return!1;try{return s.base64Decoder(r).length===32}catch{return!1}}var Kd={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},qs=(r)=>({applyToStack:(s)=>{s.add(Wd(r),Kd)}});var Lm=L(ef(),1);class If extends $r.classBuilder().ep({...Ir,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[Lm.getSerdePlugin(l,this.serialize,this.deserialize),Dr(l,r.getEndpointParameterInstructions()),hs(l,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),qs(l),bf(l)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(Fe,Ce).ser(Oe).de(je).build(){}var Vm=L(ef(),1);class kf extends $r.classBuilder().ep({...Ir,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[Vm.getSerdePlugin(l,this.serialize,this.deserialize),Dr(l,r.getEndpointParameterInstructions()),hs(l,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),Of(l),ws(l),qs(l)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(ye,Ge).ser(qe).de(ie).build(){}import{Buffer as Zm} from"buffer";class Hm extends er{client;constructor(...r){super();this.client=new Ef(...r)}async put(r){let s,l,f,h=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,f=`${br()}.${r.type.split("/")[1].split(";")[0]}`,l=r.type;else s=r.body,f=r.name,l=r.contentType;l=s instanceof Blob||s instanceof File?s.type:void 0;const e=s instanceof Zm?s:Zm.from(await s.arrayBuffer());return await this.client.send(new kf({Bucket:h,Key:f,Body:e,ContentType:l})),f}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=await this.client.send(new If({Bucket:s,Key:l}));return new Response(f.Body.transformToWebStream(),{headers:{"Content-Type":f.ContentType,"Content-Length":f.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":f.LastModified?.toUTCString()||"",ETag:f.ETag||""}})}}class _s{}class js extends _s{constructor(){super(...arguments)}requests=new Map;consume(r,s){if(!this.requests.has(r))this.requests.set(r,{date:Date.now(),count:1});else{const l=this.requests.get(r),f=Date.now();if(f-l.date>=60000)this.requests.set(r,{date:f,count:1});else this.requests.set(r,{date:l.date,count:l.count+1})}return this.requests.get(r).count}}class vm{driver=new js}class _r{}import*as Jd from"react-dom/server";var Ym=L(Vd(),1);import{Writable as Yd} from"stream";var{defineProperty:Zd,getOwnPropertySymbols:Jm}=Object,Hd=Object.prototype.hasOwnProperty,vd=Object.prototype.propertyIsEnumerable,Xm=(r,s,l)=>(s in r)?Zd(r,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[s]=l,Pf=(r,s)=>{for(var l in s||(s={}))if(Hd.call(s,l))Xm(r,l,s[l]);if(Jm){for(var l of Jm(s))if(vd.call(s,l))Xm(r,l,s[l])}return r},Nf=(r,s,l)=>{return new Promise((f,h)=>{var e=(g)=>{try{a(l.next(g))}catch(R){h(R)}},m=(g)=>{try{a(l.throw(g))}catch(R){h(R)}},a=(g)=>g.done?f(g.value):Promise.resolve(g.value).then(e,m);a((l=l.apply(r,s)).next())})},Xd={unformatted:["code","pre","em","strong","span"],indent_inner_html:!0,indent_char:" ",indent_size:2,sep:"\n"},Qd=(r,s={})=>{return Ym.default.html(r,Pf(Pf({},Xd),s))},cd=[{selector:"img",format:"skip"},{selector:"#__react-email-preview",format:"skip"},{selector:"a",options:{linkBrackets:!1}}];var Qm=new TextDecoder("utf-8"),cm=(r)=>Nf(void 0,null,function*(){let s="";if("pipeTo"in r){const l=new WritableStream({write(f){s+=Qm.decode(f)}});yield r.pipeTo(l)}else{const l=new Yd({write(f,h,e){s+=Qm.decode(f),e()}});return r.pipe(l),new Promise((f,h)=>{l.on("error",h),l.on("close",()=>{f(s)})})}return s}),is=(r,s)=>Nf(void 0,null,function*(){const{default:l}=yield import("react-dom/server");let f;if(Object.hasOwn(l,"renderToReadableStream"))f=yield cm(yield l.renderToReadableStream(r));else yield new Promise((m,a)=>{const g=l.renderToPipeableStream(r,{onAllReady(){return Nf(this,null,function*(){f=yield cm(g),m()})},onError(R){a(R)}})});if(s==null?void 0:s.plainText)return $f(f,Pf({selectors:cd},s.htmlToTextOptions));const e=`${'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'}${f.replace(/<!DOCTYPE.*?>/,"")}`;if(s==null?void 0:s.pretty)return Qd(e);return e});var{defineProperty:Bd,defineProperties:Od,getOwnPropertyDescriptors:qd,getOwnPropertySymbols:Bm}=Object,_d=Object.prototype.hasOwnProperty,jd=Object.prototype.propertyIsEnumerable,Om=(r,s,l)=>(s in r)?Bd(r,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[s]=l,jr=(r,s)=>{for(var l in s||(s={}))if(_d.call(s,l))Om(r,l,s[l]);if(Bm){for(var l of Bm(s))if(jd.call(s,l))Om(r,l,s[l])}return r},id=(r,s)=>Od(r,qd(s)),I=(r,s,l)=>{return new Promise((f,h)=>{var e=(g)=>{try{a(l.next(g))}catch(R){h(R)}},m=(g)=>{try{a(l.throw(g))}catch(R){h(R)}},a=(g)=>g.done?f(g.value):Promise.resolve(g.value).then(e,m);a((l=l.apply(r,s)).next())})},bd="3.5.0",xd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/api-keys",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/api-keys")})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/api-keys/${r}`)})}},od=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/audiences",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/audiences")})}get(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r}`)})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/audiences/${r}`)})}},nd=class{constructor(r){this.resend=r}send(r){return I(this,arguments,function*(s,l={}){return this.create(s,l)})}create(r){return I(this,arguments,function*(s,l={}){for(let h of s)if(h.react)h.html=yield is(h.react),delete h.react;return yield this.resend.post("/emails/batch",s,l)})}},pd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post(`/audiences/${s.audienceId}/contacts`,{unsubscribed:s.unsubscribed,email:s.email,first_name:s.firstName,last_name:s.lastName},l)})}list(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts`)})}get(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts/${r.id}`)})}update(r){return I(this,null,function*(){return yield this.resend.patch(`/audiences/${r.audienceId}/contacts/${r.id}`,{unsubscribed:r.unsubscribed,first_name:r.firstName,last_name:r.lastName})})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/audiences/${r.audienceId}/contacts/${(r==null?void 0:r.email)?r==null?void 0:r.email:r==null?void 0:r.id}`)})}},ud=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/domains",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/domains")})}get(r){return I(this,null,function*(){return yield this.resend.get(`/domains/${r}`)})}update(r){return I(this,null,function*(){return yield this.resend.patch(`/domains/${r.id}`,{click_tracking:r.clickTracking,open_tracking:r.openTracking,tls:r.tls})})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/domains/${r}`)})}verify(r){return I(this,null,function*(){return yield this.resend.post(`/domains/${r}/verify`)})}},td=class{constructor(r){this.resend=r}send(r){return I(this,arguments,function*(s,l={}){return this.create(s,l)})}create(r){return I(this,arguments,function*(s,l={}){if(s.react)s.html=yield is(s.react),delete s.react;return yield this.resend.post("/emails",s,l)})}get(r){return I(this,null,function*(){return yield this.resend.get(`/emails/${r}`)})}},qm="https://api.resend.com",_m=`resend-node:${bd}`,r3=typeof process!=="undefined"&&process.env?process.env.RESEND_BASE_URL||qm:qm,s3=typeof process!=="undefined"&&process.env?process.env.RESEND_USER_AGENT||_m:_m,jm=class{constructor(r){if(this.key=r,this.apiKeys=new xd(this),this.audiences=new od(this),this.batch=new nd(this),this.contacts=new pd(this),this.domains=new ud(this),this.emails=new td(this),!r){if(typeof process!=="undefined"&&process.env)this.key=process.env.RESEND_API_KEY;if(!this.key)throw new Error('Missing API key. Pass it to the constructor `new Resend("re_123")`')}this.headers=new Headers({Authorization:`Bearer ${this.key}`,"User-Agent":s3,"Content-Type":"application/json"})}fetchRequest(r){return I(this,arguments,function*(s,l={}){try{const f=yield fetch(`${r3}${s}`,l);if(!f.ok)try{const e=yield f.text();return{data:null,error:JSON.parse(e)}}catch(e){if(e instanceof SyntaxError)return{data:null,error:{name:"application_error",message:"Internal server error. We are unable to process your request right now, please try again later."}};const m={message:f.statusText,name:"application_error"};if(e instanceof Error)return{data:null,error:id(jr({},m),{message:e.message})};return{data:null,error:m}}return{data:yield f.json(),error:null}}catch(f){return{data:null,error:{name:"application_error",message:"Unable to fetch data. The request could not be resolved."}}}})}post(r,s){return I(this,arguments,function*(l,f,h={}){const e=jr({method:"POST",headers:this.headers,body:JSON.stringify(f)},h);return this.fetchRequest(l,e)})}get(r){return I(this,arguments,function*(s,l={}){const f=jr({method:"GET",headers:this.headers},l);return this.fetchRequest(s,f)})}put(r,s){return I(this,arguments,function*(l,f,h={}){const e=jr({method:"PUT",headers:this.headers,body:JSON.stringify(f)},h);return this.fetchRequest(l,e)})}patch(r,s){return I(this,arguments,function*(l,f,h={}){const e=jr({method:"PATCH",headers:this.headers,body:JSON.stringify(f)},h);return this.fetchRequest(l,e)})}delete(r,s){return I(this,null,function*(){const l={method:"DELETE",headers:this.headers,body:JSON.stringify(s)};return this.fetchRequest(r,l)})}};class bs{}class xs extends bs{r;constructor(r=process.env.RESEND_API_KEY){super();this.apiKey=r}async send(r){const s=new jm(this.apiKey),{data:l,error:f}=await s.emails.send({...r});if(f)throw f;if(l)return!0}}class im extends _r{constructor(){super(...arguments)}debug=!0;defaultFrom="";driver=new xs;boot(){}}class bm extends _r{constructor(){super(...arguments)}channels={};boot(){}}export{Hm as S3Driver,xs as ResendDriver,vm as RateLimiterServiceProvider,_s as RateLimiterDriver,js as InMemoryRateLimiter,xr as FileSystemDriver,Df as FileStorageServiceProvider,er as FileStorageDriver,im as EmailServiceProvider,bs as EmailDriver,bm as BroadcastingServiceProvider};export{Df as p,_r as q,vm as r,im as s,bm as t};
2
+ import"../chunk-0f500a6384fcd132.js";import{B as L} from"../chunk-24a86f8f5ddc0cbd.js";import{G as Df,H as Kd} from"../chunk-0ba2cc302113ab40.js";import{M as rg} from"../chunk-28694e5e949df0ff.js";import{$ as Ie,N as br,O as fl,P as Dm,Q as Um,R as Mm,S as Tm,T as kg,U as rr,V as sr,W as al,X as Fm,Y as Re,Z as Ae,_ as Ee,aa as zm,ba as ta,ca as rm,da as sm,ea as lm,fa as Gm,ga as ym,ha as ke,ia as Dr,ja as Ur,ka as Wm,la as fm,ma as hm,na as Km,oa as em,pa as Lm,qa as Ns,ra as am,sa as Ys,ta as mm,ua as gm,va as Pm,wa as Nm} from"../chunk-d5f34554362c0fde.js";import{$a as kr,Aa as as,Ba as Lf,Ea as Ba,Fa as ss,Ga as Oa,Ha as es,Ja as Cm,Ka as qa,La as _a,Ma as ja,Oa as oa,Pa as na,Qa as Ka,Ra as ia,Sa as gh,Ta as wh,Ua as Qe,Va as $r,Wa as v,Ya as cr,ab as ce,bb as Pr,cb as Ye,db as Ws,eb as Jr,gb as nl,hb as Lr,ib as Te,jb as _,kb as Be,lb as pa,mb as ua,nb as Im,ob as km,qb as G,sb as Oe,xa as Am,ya as Em,za as X} from"../chunk-d96668bed492732f.js";import{ub as Pg} from"../chunk-786985b106091b91.js";import{vb as O,wb as ba} from"../chunk-f7a2f27070c1a0cf.js";import"../chunk-5bfe9d4cbecd160a.js";import{Db as wm} from"../chunk-ce91e437af790f62.js";import"../chunk-b033519a526dfb3f.js";class er{}class xr extends er{r;constructor(r=`${process.env.ROOT_DIR}/storage`){super();this.folderPath=r}async put(r){let s,l;if(r instanceof Blob)s=r,l=`${br()}.${r.type.split("/")[1].split(";")[0]}`;else s=r.body,l=r.name;const f=s instanceof Buffer?s:Buffer.from(await s.arrayBuffer()),h=`${this.folderPath}/${l}`;return await Bun.write(h,f),l}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=`${this.folderPath}/${l}`,h=Bun.file(f),e=Bun.file(f).stream(),m=new Date(h.lastModified).toUTCString();return new Response(e,{headers:{"Content-Type":h.type,"Content-Length":String(h.size),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":m}})}}class Uf{driver=new xr}function xm(r){return(s)=>async(l)=>{const{request:f}=l;if(X.isInstance(f)&&f.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")f.headers={...f.headers,Expect:"100-continue"}}return s({...l,request:f})}}var om={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Mf=(r)=>({applyToStack:(s)=>{s.add(xm(r),om)}});var Fr={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},or=Fr.WHEN_SUPPORTED,ns={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},nr=Fr.WHEN_SUPPORTED,U;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(U||(U={}));var Tf;(function(r){r.HEADER="header",r.TRAILER="trailer"})(Tf||(Tf={}));var{MD5:Cf,CRC32:Ff}=U;var b;(function(r){r.ENV="env",r.CONFIG="shared config entry"})(b||(b={}));var ar=(r,s,l,f)=>{if(!(s in r))return;const h=r[s].toUpperCase();if(!Object.values(l).includes(h))throw new TypeError(`Cannot load ${f} '${s}'. Expected one of ${Object.values(l)}, got '${r[s]}'.`);return h};var nm="AWS_REQUEST_CHECKSUM_CALCULATION",pm="request_checksum_calculation",zf={environmentVariableSelector:(r)=>ar(r,nm,Fr,b.ENV),configFileSelector:(r)=>ar(r,pm,Fr,b.CONFIG),default:or};var um="AWS_RESPONSE_CHECKSUM_VALIDATION",tm="response_checksum_validation",Gf={environmentVariableSelector:(r)=>ar(r,um,ns,b.ENV),configFileSelector:(r)=>ar(r,tm,ns,b.CONFIG),default:nr};var zr=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256],yf=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256];var Wf=(r,{requestChecksumRequired:s,requestAlgorithmMember:l},f)=>{const h=f?Ff:Cf;if(!l||!r[l])return s?h:void 0;const e=r[l];if(!zr.includes(e))throw new Error(`The checksum algorithm "${e}" is not supported by the client.`+` Select one of ${zr}.`);return e};var mr=(r)=>r===U.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var Kf=(r,s)=>{const l=r.toLowerCase();for(let f of Object.keys(s))if(l===f.toLowerCase())return!0;return!1};var gr=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!Lf(r);var Vf=L(rg(),1),{__extends:z3,__assign:G3,__rest:y3,__decorate:W3,__param:K3,__esDecorate:L3,__runInitializers:V3,__propKey:Z3,__setFunctionName:H3,__metadata:v3,__awaiter:pr,__generator:ur,__exportStar:J3,__createBinding:X3,__values:tr,__read:Q3,__spread:c3,__spreadArrays:Y3,__spreadArray:B3,__await:O3,__asyncGenerator:q3,__asyncDelegator:_3,__asyncValues:j3,__makeTemplateObject:i3,__importStar:b3,__importDefault:x3,__classPrivateFieldGet:o3,__classPrivateFieldSet:n3,__classPrivateFieldIn:p3,__addDisposableResource:u3,__disposeResources:t3}=Vf.default;import{Buffer as Zf} from"buffer";var Hf=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?Zf.from(r,s):Zf.from(r)};var ps=(r)=>{const s=Hf(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function Gr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return sg(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var sg=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:ps;function yr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Wr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Kr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),l=0;while(l<r.length)s[l]=r[l],l+=1;return s}return Uint32Array.from(r)}var us=function(){function r(){this.crc32=new t}return r.prototype.update=function(s){if(yr(s))return;this.crc32.update(Gr(s))},r.prototype.digest=function(){return pr(this,void 0,void 0,function(){return ur(this,function(s){return[2,Wr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new t},r}();var t=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var h=tr(s),e=h.next();!e.done;e=h.next()){var m=e.value;this.checksum=this.checksum>>>8^fg[(this.checksum^m)&255]}}catch(a){l={error:a}}finally{try{if(e&&!e.done&&(f=h.return))f.call(h)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var lg=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],fg=Kr(lg);var rl=function(){function r(){this.crc32c=new ts}return r.prototype.update=function(s){if(yr(s))return;this.crc32c.update(Gr(s))},r.prototype.digest=function(){return pr(this,void 0,void 0,function(){return ur(this,function(s){return[2,Wr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new ts},r}();var ts=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var h=tr(s),e=h.next();!e.done;e=h.next()){var m=e.value;this.checksum=this.checksum>>>8^eg[(this.checksum^m)&255]}}catch(a){l={error:a}}finally{try{if(e&&!e.done&&(f=h.return))f.call(h)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var hg=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],eg=Kr(hg);var rs=(r,s)=>({[U.MD5]:s.md5,[U.CRC32]:us,[U.CRC32C]:rl,[U.SHA1]:s.sha1,[U.SHA256]:s.sha256})[r];var ls=(r,s)=>{const l=new r;return l.update(ss(s||"")),l.digest()};var vf={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},Jf=(r,s)=>(l,f)=>async(h)=>{if(!X.isInstance(h.request))return l(h);const{request:e}=h,{body:m,headers:a}=e,{base64Encoder:g,streamHasher:R}=r,{input:N,requestChecksumRequired:$,requestAlgorithmMember:D}=s,M=Wf(N,{requestChecksumRequired:$,requestAlgorithmMember:D},!!f.isS3ExpressBucket);let Q=m,Y=a;if(M){const j=mr(M),Cr=rs(M,r);if(gr(m)){const{getAwsChunkedEncodingStream:os,bodyLengthChecker:bm}=r;Q=os(m,{base64Encoder:g,bodyLengthChecker:bm,checksumLocationName:j,checksumAlgorithmFn:Cr,streamHasher:R}),Y={...a,"content-encoding":a["content-encoding"]?`${a["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":a["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":j},delete Y["content-length"]}else if(!Kf(j,a)){const os=await ls(Cr,m);Y={...a,[j]:g(os)}}}return await l({...h,request:{...e,headers:Y,body:Q}})};var fs=(r=[])=>{const s=[];for(let l of yf){if(!r.includes(l)||!zr.includes(l))continue;s.push(l)}return s};var Xf=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const l=r.slice(s+1);if(!l.startsWith("0")){const f=parseInt(l,10);if(!isNaN(f)&&f>=1&&f<=1e4)return!0}}return!1};import{Transform as ag} from"stream";function sl(r){const s=new ag;return s.push(r),s.push(null),s}var Qf=async(r,{streamHasher:s,checksumAlgorithmFn:l,base64Encoder:f})=>{const h=gr(r)?s(l,r):ls(l,r);return f(await h)};var cf=async(r,{config:s,responseAlgorithms:l})=>{const f=fs(l),{body:h,headers:e}=r;for(let m of f){const a=mr(m),g=e[a];if(g){const R=rs(m,s),{streamHasher:N,base64Encoder:$}=s,D=await Qf(h,{streamHasher:N,checksumAlgorithmFn:R,base64Encoder:$});if(D===g)break;throw new Error(`Checksum mismatch: expected "${D}" but received "${g}"`+` in response header "${a}".`)}}};var Yf={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},Bf=(r,s)=>(l,f)=>async(h)=>{if(!X.isInstance(h.request))return l(h);const e=h.input,m=await l(h),a=m.response;let g=void 0;const{requestValidationModeMember:R,responseAlgorithms:N}=s;if(R&&e[R]==="ENABLED"){const{clientName:$,commandName:D}=f;if($==="S3Client"&&D==="GetObjectCommand"&&fs(N).every((Y)=>{const ir=mr(Y),j=a.headers[ir];return!j||Xf(j)}))return m;const Q=gr(a.body);if(Q)g=await r.streamCollector(a.body),a.body=sl(g);if(await cf(m.response,{config:r,responseAlgorithms:N}),Q&&g)a.body=sl(g)}return m};var hs=(r,s)=>({applyToStack:(l)=>{l.add(Jf(r,s),vf),l.addRelativeTo(Bf(r,s),Yf)}});var ll=L(fl(),1);var Of=(r)=>({...r,requestChecksumCalculation:ll.normalizeProvider(r.requestChecksumCalculation??or),responseChecksumValidation:ll.normalizeProvider(r.responseChecksumValidation??nr)});function gg(){return(r,s)=>async(l)=>{const{request:f}=l;if(X.isInstance(f)){if(!(mg in f.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof es))s.logger.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.");else console.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.")}return r({...l})}}var mg="content-length",wg={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},qf=(r)=>({applyToStack:(s)=>{s.add(gg(),wg)}});var _f=(r)=>{return(s,l)=>async(f)=>{const h=await r.region(),e=r.region;let m=()=>{};if(l.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return l.__s3RegionRedirect}}),m=()=>Object.defineProperty(r,"region",{writable:!0,value:e});try{const a=await s(f);if(l.__s3RegionRedirect){m();const g=await r.region();if(h!==g)throw new Error("Region was not restored following S3 region redirect.")}return a}catch(a){throw m(),a}}},jf={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function dg(r){return(s,l)=>async(f)=>{try{return await s(f)}catch(h){if(r.followRegionRedirects&&h?.$metadata?.httpStatusCode===301){try{const e=h.$response.headers["x-amz-bucket-region"];l.logger?.debug(`Redirecting from ${await r.region()} to ${e}`),l.__s3RegionRedirect=e}catch(e){throw new Error("Region redirect failed: "+e)}return s(f)}else throw h}}}var Sg={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},bf=(r)=>({applyToStack:(s)=>{s.add(dg(r),Sg),s.addRelativeTo(_f(r),jf)}});var Rg=(r)=>{return(s,l)=>async(f)=>{const h=await s(f),{response:e}=h;if(as.isInstance(e)){if(e.headers.expires){e.headers.expiresstring=e.headers.expires;try{Lr(e.headers.expires)}catch(m){l.logger?.warn(`AWS SDK Warning for ${l.clientName}::${l.commandName} response parsing (${e.headers.expires}): ${m}`),delete e.headers.expires}}}return h}},Ag={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},xf=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Rg(r),Ag)}});class wr{constructor(r={}){this.data=r,this.lastPurgeTime=Date.now()}get(r){const s=this.data[r];if(!s)return;return s}set(r,s){return this.data[r]=s,s}delete(r){delete this.data[r]}async purgeExpired(){const r=Date.now();if(this.lastPurgeTime+wr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const l=this.data[s];if(!l.isRefreshing){const f=await l.identity;if(f.expiration){if(f.expiration.getTime()<r)delete this.data[s]}}}}}wr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class dr{constructor(r,s=!1,l=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=l}get identity(){return this.accessed=Date.now(),this._identity}}class Sr{constructor(r,s=new wr){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const l=s.Bucket,{cache:f}=this,h=f.get(l);if(h)return h.identity.then((e)=>{if((e.expiration?.getTime()??0)<Date.now())return f.set(l,new dr(this.getIdentity(l))).identity;if((e.expiration?.getTime()??0)<Date.now()+Sr.REFRESH_WINDOW_MS&&!h.isRefreshing)h.isRefreshing=!0,this.getIdentity(l).then((g)=>{f.set(l,new dr(Promise.resolve(g)))});return e});return f.set(l,new dr(this.getIdentity(l))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((f)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+f)});const s=await this.createSessionFn(r);if(!s.Credentials?.AccessKeyId||!s.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretAccessKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration?new Date(s.Credentials.Expiration):void 0}}}Sr.REFRESH_WINDOW_MS=60000;var rh=L(kg(),1);var of="Directory",nf="S3Express",pf="sigv4-s3express",ms="X-Amz-S3session-Token",Vr=ms.toLowerCase(),Eg="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Ig="s3_disable_express_session_auth",hl={environmentVariableSelector:(r)=>rr(r,Eg,sr.ENV),configFileSelector:(r)=>rr(r,Ig,sr.CONFIG),default:!1};var uf=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},tf=function(r,s){const l=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),f=r.credentialProvider,h=()=>{return clearTimeout(l),r.credentialProvider=f,Promise.resolve(s)};r.credentialProvider=h};class gs extends rh.SignatureV4{async signWithCredentials(r,s,l){const f=uf(s);r.headers[Vr]=s.sessionToken;const h=this;return tf(h,f),h.signRequest(r,l??{})}async presignWithCredentials(r,s,l){const f=uf(s);return delete r.headers[Vr],r.headers[ms]=s.sessionToken,r.query=r.query??{},r.query[ms]=s.sessionToken,tf(this,f),this.presign(r,l)}}var sh=(r)=>{return(s,l)=>async(f)=>{if(l.endpointV2){const h=l.endpointV2,e=h.properties?.authSchemes?.[0]?.name===pf;if(h.properties?.backend===nf||h.properties?.bucketType===of)l.isS3ExpressBucket=!0;if(e){const a=f.input.Bucket;if(a){const g=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:a});if(l.s3ExpressIdentity=g,X.isInstance(f.request)&&g.sessionToken)f.request.headers[Vr]=g.sessionToken}}}return s(f)}},lh={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},el=(r)=>({applyToStack:(s)=>{s.add(sh(r),lh)}});var hh=L(al(),1);var Ng=L(Pg(),1),eh=L(fl(),1);var fh=async(r,s,l,f)=>{const h=await f.signWithCredentials(l,r,{});if(h.headers["X-Amz-Security-Token"]||h.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return h};var $g=(r)=>(s)=>{throw s},Dg=(r,s)=>{};var ah=(r)=>(s,l)=>async(f)=>{if(!X.isInstance(f.request))return s(f);const e=eh.getSmithyContext(l).selectedHttpAuthScheme;if(!e)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:m={}},identity:a,signer:g}=e;let R;if(l.s3ExpressIdentity)R=await fh(l.s3ExpressIdentity,m,f.request,await r.signer());else R=await g.sign(f.request,a,m);const N=await s({...f,request:R}).catch((g.errorHandler||$g)(m));return(g.successHandler||Dg)(N.response,m),N},ml=(r)=>({applyToStack:(s)=>{s.addRelativeTo(ah(r),hh.httpSigningMiddlewareOptions)}});var mh=(r,{session:s})=>{const[l,f]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new Sr(async(h)=>l().send(new f({Bucket:h,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var Ug={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Mg=3000,Tg=(r)=>(s,l)=>async(f)=>{const h=await s(f),{response:e}=h;if(!as.isInstance(e))return h;const{statusCode:m,body:a}=e;if(m<200||m>=300)return h;if(!(typeof a?.stream==="function"||typeof a?.pipe==="function"||typeof a?.tee==="function"))return h;let R=a,N=a;if(a&&typeof a==="object"&&!(a instanceof Uint8Array))[R,N]=await gh(a);e.body=N;const $=await Cg(R,{streamCollector:async(M)=>{return wh(M,Mg)}});if(typeof R?.destroy==="function")R.destroy();const D=r.utf8Encoder($.subarray($.length-16));if($.length===0&&Ug[l.commandName]){const M=new Error("S3 aborted request");throw M.name="InternalError",M}if(D&&D.endsWith("</Error>"))e.statusCode=400;return h},Cg=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},Fg={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},ws=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Tg(r),Fg)}});var gl=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function dh(r){return(s,l)=>async(f)=>{if(r.bucketEndpoint){const h=l.endpointV2;if(h){const e=f.input.Bucket;if(typeof e==="string")try{const m=new URL(e);l.endpointV2={...h,url:m}}catch(m){const a=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${e} could not be parsed as URL.`;if(l.logger?.constructor?.name==="NoOpLogger")console.warn(a);else l.logger?.warn?.(a);throw m}}}return s(f)}}var Sh={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function zg({bucketEndpoint:r}){return(s)=>async(l)=>{const{input:{Bucket:f}}=l;if(!r&&typeof f==="string"&&!gl(f)&&f.indexOf("/")>=0){const h=new Error(`Bucket name shouldn't contain '/', received '${f}'`);throw h.name="InvalidBucketName",h}return s({...l})}}var Gg={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Rh=(r)=>({applyToStack:(s)=>{s.add(zg(r),Gg),s.addRelativeTo(dh(r),Sh)}});var Tr=L(al(),1);var Ah=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var $s=L(Ns(),1);var ds={CrtSignerV4:null};class wl{constructor(r){this.sigv4Signer=new gs(r),this.signerOptions=r}async sign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().sign(r,s)}return this.sigv4Signer.sign(r,s)}async signWithCredentials(r,s,l={}){if(l.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().signWithCredentials(r,s,l)}return this.sigv4Signer.signWithCredentials(r,s,l)}async presign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().presign(r,s)}return this.sigv4Signer.presign(r,s)}async presignWithCredentials(r,s,l={}){if(l.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,l)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=ds.CrtSignerV4,typeof r!=="function")throw new Error}catch(s){throw s.message=`${s.message}\n`+'Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \nYou must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. \nFor more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt',s}this.sigv4aSigner=new r({...this.signerOptions,signingAlgorithm:1})}return this.sigv4aSigner}}var vr=L(fl(),1);var Rr={["required"]:!1,["type"]:"String"},Ar={["required"]:!0,default:!1,["type"]:"Boolean"},Zr={["required"]:!1,["type"]:"Boolean"},B={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},P={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},k={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},C={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},he={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Eh={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},Is={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},Z={["ref"]:"Bucket"},V={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},Es={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},ee={["ref"]:"url"},ae={["fn"]:"uriEncode",["argv"]:[Z],["assign"]:"uri_encoded_bucket"},i={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},w={},me={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!1]},dl={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},ks={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},Ih={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},kh={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},d={["fn"]:"not",["argv"]:[C]},Ph={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},Nh={["fn"]:"not",["argv"]:[Is]},$h={["ref"]:"hardwareType"},Dh={["conditions"]:[d],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},Ss={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},Sl={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},yg={["ref"]:"ForcePathStyle"},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},z={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},y={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[z]},W={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},Uh={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},F={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},A={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},Mh={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},S={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Th={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Ch={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Rl={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[ee,"isIp"]},!1]},Al={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:F,["headers"]:{}},Zl={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:F,["headers"]:{}},Fh={["endpoint"]:Zl,["type"]:"endpoint"},El={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},zh={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Rs={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},J={["ref"]:"bucketArn"},ge={["ref"]:"arnType"},Il={["fn"]:"getAttr",["argv"]:[J,"service"]},Hl={["ref"]:"accessPointName"},Gh={["conditions"]:[k],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},yh={["conditions"]:[B],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Wh={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},kl={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},we={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},de={["fn"]:"getAttr",["argv"]:[J,"accountId"]},Pl={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},Kh={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},Nl={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},$l={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},Dl={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Lh={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},Vh={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Hr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},Zh={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},Hh={["fn"]:"aws.parseArn",["argv"]:[Z]},vh={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Jh={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Xh={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Ul={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Qh={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},ch={["ref"]:"UseObjectLambdaEndpoint"},Ml={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},Yh={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Bh={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Oh={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Tl={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:F,["headers"]:{}},qh={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Cl=[{["ref"]:"Region"}],Wg=[{["ref"]:"Endpoint"}],Kg=[Z],Fl=[k],As=[B],lr=[C,V],_h=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],jh=[Es],zl=[ae],Gl=[me],Er=[P],ih=[{["fn"]:"substring",["argv"]:[Z,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],bh=[{["conditions"]:[P],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:i,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:i,["headers"]:{}},["type"]:"endpoint"}],xh=[{["fn"]:"substring",["argv"]:[Z,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],oh=[{["conditions"]:[P],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:ks,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:ks,["headers"]:{}},["type"]:"endpoint"}],Lg=[Is],nh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],ph=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Vg=["*"],x=[he],uh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],o=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],yl=[{["fn"]:"stringEquals",["argv"]:[ge,"accesspoint"]}],th=[{["fn"]:"getAttr",["argv"]:[J,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Hl,""]}]}],Zg=[J,"resourceId[1]"],Wl=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},""]}]}],re=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[2]"]}]}]}],Hg=[J,"resourceId[2]"],Kl=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]}],["assign"]:"bucketPartition"}],se=[{["fn"]:"stringEquals",["argv"]:[we,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],Ll=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},!0]}],Vl=[{["fn"]:"isValidHostLabel",["argv"]:[de,!1]}],le=[{["fn"]:"isValidHostLabel",["argv"]:[Hl,!1]}],fe=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],vg={version:"1.0",parameters:{Bucket:Rr,Region:Rr,UseFIPS:Ar,UseDualStack:Ar,Endpoint:Rr,ForcePathStyle:Ar,Accelerate:Ar,UseGlobalEndpoint:Ar,UseObjectLambdaEndpoint:Zr,Key:Rr,Prefix:Rr,CopySource:Rr,DisableAccessPoints:Zr,DisableMultiRegionAccessPoints:Ar,UseArnRegion:Zr,UseS3ExpressControlEndpoint:Zr,DisableS3ExpressSessionAuth:Zr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:Cl}],rules:[{["conditions"]:[B,P],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[k,C],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[C,P],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[C,B],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[P,he,Eh],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[Is,{["fn"]:"substring",["argv"]:[Z,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:Fl,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:As,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:lr,rules:[{["conditions"]:_h,rules:[{["conditions"]:jh,rules:[{["conditions"]:zl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:i,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Gl,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:i,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},dl],["type"]:"tree"},{["conditions"]:jh,rules:[{["conditions"]:zl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:ks,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Gl,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:ks,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},dl],["type"]:"tree"},{["conditions"]:[Ih,kh],rules:[{["conditions"]:[ae,d],rules:[{["conditions"]:Er,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:i,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:i,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Gl,rules:[{["conditions"]:_h,rules:[{["conditions"]:ih,rules:bh,["type"]:"tree"},{["conditions"]:xh,rules:bh,["type"]:"tree"},Ph],["type"]:"tree"},{["conditions"]:ih,rules:oh,["type"]:"tree"},{["conditions"]:xh,rules:oh,["type"]:"tree"},Ph],["type"]:"tree"},dl],["type"]:"tree"},{["conditions"]:[Nh,Ih,kh],rules:[{["conditions"]:lr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:i,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Er,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:i,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:i,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[Is,{["fn"]:"substring",["argv"]:[Z,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[Z,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[Z,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[Z,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:Cl,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:nh,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[$h,"e"]}],rules:[{["conditions"]:ph,rules:[Dh,{["conditions"]:lr,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:Ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[$h,"o"]}],rules:[{["conditions"]:ph,rules:[Dh,{["conditions"]:lr,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:Ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Unrecognized hardware type: \"Expected hardware type o or e but got {hardwareType}\"",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:Lg,rules:[{["conditions"]:[C,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Wg}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[Sl,me],rules:[{["conditions"]:x,rules:[{["conditions"]:uh,rules:[{["conditions"]:[B,Eh],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[k,P,T,d,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,P,T,d,E,W],rules:[{endpoint:Uh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,P,T,d,E,K],endpoint:Uh,["type"]:"endpoint"},{["conditions"]:[A,P,T,d,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,P,T,d,E,W],rules:[{endpoint:Mh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,P,T,d,E,K],endpoint:Mh,["type"]:"endpoint"},{["conditions"]:[k,S,B,d,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,S,B,d,E,W],rules:[{endpoint:Th,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,S,B,d,E,K],endpoint:Th,["type"]:"endpoint"},{["conditions"]:[k,S,T,d,z],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,S,T,d,E,W],rules:[{endpoint:Ch,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,S,T,d,E,K],endpoint:Ch,["type"]:"endpoint"},{["conditions"]:[A,S,T,C,V,Es,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,C,V,Rl,z],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,C,V,Es,E,W],rules:[{["conditions"]:o,endpoint:Al,["type"]:"endpoint"},{endpoint:Al,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,T,C,V,Rl,E,W],rules:[{["conditions"]:o,endpoint:Zl,["type"]:"endpoint"},Fh],["type"]:"tree"},{["conditions"]:[A,S,T,C,V,Es,E,K],endpoint:Al,["type"]:"endpoint"},{["conditions"]:[A,S,T,C,V,Rl,E,K],endpoint:Zl,["type"]:"endpoint"},{["conditions"]:[A,S,B,d,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,B,d,E,W],rules:[{["conditions"]:o,endpoint:El,["type"]:"endpoint"},{endpoint:El,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,B,d,E,K],endpoint:El,["type"]:"endpoint"},{["conditions"]:[A,S,T,d,z],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,d,E,W],rules:[{["conditions"]:o,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:zh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,T,d,E,K],endpoint:zh,["type"]:"endpoint"}],["type"]:"tree"},Rs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[C,V,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[ee,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!0]},Sl,S,A,T],rules:[{["conditions"]:x,rules:[{["conditions"]:uh,rules:[Fh],["type"]:"tree"},Rs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Sl,{["fn"]:"aws.parseArn",["argv"]:Kg,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[ge,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Il,"s3-object-lambda"]}],rules:[{["conditions"]:yl,rules:[{["conditions"]:th,rules:[Gh,yh,{["conditions"]:Wl,rules:[Wh,{["conditions"]:re,rules:[kl,{["conditions"]:Kl,rules:[{["conditions"]:x,rules:[{["conditions"]:se,rules:[{["conditions"]:Ll,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[de,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:Vl,rules:[{["conditions"]:le,rules:[{["conditions"]:lr,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Pl,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Er,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Pl,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Pl,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Kh],["type"]:"tree"},Nl],["type"]:"tree"},$l],["type"]:"tree"},Dl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Lh],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},Vh],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:yl,rules:[{["conditions"]:th,rules:[{["conditions"]:Wl,rules:[{["conditions"]:yl,rules:[{["conditions"]:Wl,rules:[Wh,{["conditions"]:re,rules:[kl,{["conditions"]:Kl,rules:[{["conditions"]:x,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[we,"{partitionResult#name}"]}],rules:[{["conditions"]:Ll,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Il,"s3"]}],rules:[{["conditions"]:Vl,rules:[{["conditions"]:le,rules:[{["conditions"]:As,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[P,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,C,V],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Kh],["type"]:"tree"},Nl],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},$l],["type"]:"tree"},Dl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Lh],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[Hl,!0]}],rules:[{["conditions"]:Fl,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:Er,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:As,error:"S3 MRAP does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableMultiRegionAccessPoints"},!0]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",["type"]:"error"},{["conditions"]:[{["fn"]:"aws.partition",["argv"]:Cl,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[J,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:Vg}]},["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Access Point Name",["type"]:"error"}],["type"]:"tree"},Vh],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Il,"s3-outposts"]}],rules:[{["conditions"]:Fl,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:Er,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:As,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:Zg,["assign"]:"outpostId"}],rules:[{["conditions"]:nh,rules:[kl,{["conditions"]:Kl,rules:[{["conditions"]:x,rules:[{["conditions"]:se,rules:[{["conditions"]:Ll,rules:[{["conditions"]:Vl,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:Hg,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:lr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:Zh,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Zh,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Expected an outpost type `accesspoint`, found {outpostType}",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: expected an access point name",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Expected a 4-component resource",["type"]:"error"}],["type"]:"tree"},Nl],["type"]:"tree"},$l],["type"]:"tree"},Dl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The Outpost Id was not set",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: No ARN type specified",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"substring",["argv"]:[Z,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[Hh]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[yg,!0]},Hh],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:zl,rules:[{["conditions"]:x,rules:[{["conditions"]:[T],rules:[{["conditions"]:[k,d,P,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,d,P,E,W],rules:[{endpoint:vh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,d,P,E,K],endpoint:vh,["type"]:"endpoint"},{["conditions"]:[A,d,P,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,d,P,E,W],rules:[{endpoint:Jh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,P,E,K],endpoint:Jh,["type"]:"endpoint"},{["conditions"]:[k,d,S,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,d,S,E,W],rules:[{endpoint:Xh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,d,S,E,K],endpoint:Xh,["type"]:"endpoint"},{["conditions"]:[A,C,V,S,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,C,V,S,E,W],rules:[{["conditions"]:o,endpoint:Ul,["type"]:"endpoint"},{endpoint:Ul,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,C,V,S,E,K],endpoint:Ul,["type"]:"endpoint"},{["conditions"]:[A,d,S,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,d,S,E,W],rules:[{["conditions"]:o,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:Qh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,S,E,K],endpoint:Qh,["type"]:"endpoint"}],["type"]:"tree"},{error:"Path-style addressing cannot be used with S3 Accelerate",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[ch]},{["fn"]:"booleanEquals",["argv"]:[ch,!0]}],rules:[{["conditions"]:x,rules:[{["conditions"]:fe,rules:[Gh,yh,{["conditions"]:lr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:Ml,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Er,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:Ml,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:Ml,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Rs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Nh],rules:[{["conditions"]:x,rules:[{["conditions"]:fe,rules:[{["conditions"]:[P,k,d,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,k,d,E,W],rules:[{endpoint:Yh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[P,k,d,E,K],endpoint:Yh,["type"]:"endpoint"},{["conditions"]:[P,A,d,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,A,d,E,W],rules:[{endpoint:Bh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[P,A,d,E,K],endpoint:Bh,["type"]:"endpoint"},{["conditions"]:[S,k,d,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,k,d,E,W],rules:[{endpoint:Oh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,k,d,E,K],endpoint:Oh,["type"]:"endpoint"},{["conditions"]:[S,A,C,V,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,C,V,E,W],rules:[{["conditions"]:o,endpoint:Tl,["type"]:"endpoint"},{endpoint:Tl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,C,V,E,K],endpoint:Tl,["type"]:"endpoint"},{["conditions"]:[S,A,d,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,d,E,W],rules:[{["conditions"]:o,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:qh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,d,E,K],endpoint:qh,["type"]:"endpoint"}],["type"]:"tree"},Rs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},Se=vg;var Jg=new Re({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),Ps=(r,s={})=>{return Jg.get(r,()=>Ee(Se,{endpointParams:r,logger:s.logger}))};Ae.aws=Ie;var Ne=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},$e=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},Xg=(r)=>async(s,l,f)=>{if(!f)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const h=await r(s,l,f),e=vr.getSmithyContext(l)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!e)throw new Error(`getEndpointParameterInstructions() is not defined on \`${l.commandName}\``);const m=await ke(f,{getEndpointParameterInstructions:e},s);return Object.assign(h,m)},Qg=async(r,s,l)=>{return{operation:vr.getSmithyContext(s).operation,region:await vr.normalizeProvider(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Pe=Xg(Qg),cg=(r,s,l)=>{return(h)=>{const m=r(h).properties?.authSchemes;if(!m)return s(h);const a=[];for(let g of m){const{name:R,properties:N={},...$}=g,D=R.toLowerCase();if(R!==D)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${R}\` to \`${D}\``);let M;if(D==="sigv4a"){M="aws.auth#sigv4a";const ir=m.find((j)=>{const Cr=j.name.toLowerCase();return Cr!=="sigv4a"&&Cr.startsWith("sigv4")});if(!ds.CrtSignerV4&&ir)continue}else if(D.startsWith("sigv4"))M="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${D}\``);const Q=l[M];if(!Q)throw new Error(`Could not find HttpAuthOption create function for \`${M}\``);const Y=Q(h);Y.schemeId=M,Y.signingProperties={...Y.signingProperties||{},...$,...N},a.push(Y)}return a}},Yg=(r)=>{const s=[];switch(r.operation){default:s.push(Ne(r)),s.push($e(r))}return s},De=cg(Ps,Yg,{"aws.auth#sigv4":Ne,"aws.auth#sigv4a":$e}),Ue=(r)=>{const s=$s.resolveAwsSdkSigV4Config(r);return{...$s.resolveAwsSdkSigV4AConfig(s)}};var Me=(r)=>{return{...r,useFipsEndpoint:r.useFipsEndpoint??!1,useDualstackEndpoint:r.useDualstackEndpoint??!1,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,defaultSigningName:"s3"}},Ir={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class H extends Te{constructor(r){super(r);Object.setPrototypeOf(this,H.prototype)}}class Ds extends H{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,Ds.prototype)}}class Us extends H{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Us.prototype)}}class Ms extends H{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,Ms.prototype)}}class Ts extends H{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,Ts.prototype)}}class Cs extends H{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,Cs.prototype)}}var vl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(vl||(vl={}));var Jl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return l.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return l.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Jl||(Jl={}));var Xl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.AccessPointArn!==void 0)return l.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Xl||(Xl={}));var Ql;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Ql||(Ql={}));class Fs extends H{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,Fs.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class zs extends H{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,zs.prototype)}}class Gs extends H{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,Gs.prototype)}}var Bg=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:v},...r.SessionToken&&{SessionToken:v}}),Ce=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v},...r.Credentials&&{Credentials:Bg(r.Credentials)}}),Fe=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}});var ze=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v}}),Ge=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:v}});var Nr=L(Ns(),1);var Ks=L(al(),1);class ys extends H{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,ys.prototype)}}var ye;(function(r){r.visit=(s,l)=>{if(s.Records!==void 0)return l.Records(s.Records);if(s.Stats!==void 0)return l.Stats(s.Stats);if(s.Progress!==void 0)return l.Progress(s.Progress);if(s.Cont!==void 0)return l.Cont(s.Cont);if(s.End!==void 0)return l.End(s.End);return l._(s.$unknown[0],s.$unknown[1])}})(ye||(ye={}));var We=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}}),Ke=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:v},...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}});var qe=async(r,s)=>{const l=Ks.requestBuilder(r,s),f=G({},q,{[xw]:r[zw],[Or]:r[Yr],[qr]:r[Br],[Hs]:r[Zs],[n]:[()=>q(r[fr]),()=>r[fr].toString()]});l.bp("/"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const h=G({[_w]:[,""]});let e;return l.m("GET").h(f).q(h).b(e),l.build()};var _e=async(r,s)=>{const l=Ks.requestBuilder(r,s),f=G({},q,{[Zw]:r[Rw],[Hw]:[()=>q(r[Le]),()=>Jr(r[Le]).toString()],[Ia]:r[la],[vw]:[()=>q(r[Ve]),()=>Jr(r[Ve]).toString()],[Xw]:r[Pw],[vs]:r[Ls],[Ta]:r[ma],[Js]:r[Vs],[Ua]:r[aa],[Pa]:r[ra],[bw]:r[fw]});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const h=G({[za]:[,"GetObject"],[Qw]:[,r[Nw]],[cw]:[,r[$w]],[Yw]:[,r[Dw]],[Bw]:[,r[Uw]],[Ow]:[,r[Mw]],[qw]:[()=>r.ResponseExpires!==void 0,()=>Jr(r[Tw]).toString()],[jw]:[,r[lf]],[Jw]:[()=>r.PartNumber!==void 0,()=>r[kw].toString()]});let e;return l.m("GET").h(f).q(h).b(e),l.build()};var je=async(r,s)=>{const l=Ks.requestBuilder(r,s),f=G({},q,{[Aa]:r[te]||"application/octet-stream",[iw]:r[rw],[wa]:r[oe],[da]:r[ne],[Sa]:r[pe],[Ra]:r[ue],[bl]:[()=>q(r[_l]),()=>r[_l].toString()],[Kw]:r[hw],[sd]:r[lw],[ff]:r[ul],[hf]:r[tl],[ef]:r[rf],[af]:r[sf],[xl]:[()=>q(r[jl]),()=>Jr(r[jl]).toString()],[Ia]:r[la],[ow]:r[gw],[nw]:r[ww],[pw]:r[dw],[uw]:r[Sw],[Or]:r[Yr],[Ma]:r[Qr],[Fa]:r[ga],[vs]:r[Ls],[Ta]:r[ma],[Js]:r[Vs],[qr]:r[Br],[Hs]:r[Zs],[n]:[()=>q(r[fr]),()=>r[fr].toString()],[Ua]:r[aa],[ld]:r[Gw],[$a]:r[ha],[ol]:[()=>q(r[il]),()=>Oe(r[il]).toString()],[Na]:r[fa],[Pa]:r[ra],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((a,g)=>{return a[`x-amz-meta-${g.toLowerCase()}`]=r.Metadata[g],a},{})});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const h=G({[za]:[,"PutObject"]});let e,m;if(r.Body!==void 0)m=r.Body,e=m;return l.m("PUT").h(f).q(h).b(e),l.build()};var ie=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return pl(r,s);const l=G({$metadata:c(r),[Yr]:[,r.headers[Or]],[Br]:[,r.headers[qr]],[Zs]:[,r.headers[Hs]],[fr]:[()=>r.headers[n]!==void 0,()=>cr(r.headers[n])]}),f=kr(ce(await Nr.parseXmlBody(r.body,s)),"body");if(f[Bl]!=null)l[Bl]=tg(f[Bl],s);return l};var be=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return pl(r,s);const l=G({$metadata:c(r),[aw]:[()=>r.headers[He]!==void 0,()=>cr(r.headers[He])],[sw]:[,r.headers[Ww]],[Xr]:[,r.headers[ka]],[Fw]:[,r.headers[tw]],[Aw]:[()=>r.headers[Ze]!==void 0,()=>kr(Lr(r.headers[Ze]))],[_l]:[()=>r.headers[bl]!==void 0,()=>Ye(r.headers[bl])],[sa]:[,r.headers[Ea]],[ul]:[,r.headers[ff]],[tl]:[,r.headers[hf]],[rf]:[,r.headers[ef]],[sf]:[,r.headers[af]],[Ew]:[()=>r.headers[ve]!==void 0,()=>Ws(r.headers[ve])],[lf]:[,r.headers[Ca]],[oe]:[,r.headers[wa]],[ne]:[,r.headers[da]],[pe]:[,r.headers[Sa]],[ue]:[,r.headers[Ra]],[ew]:[,r.headers[Lw]],[te]:[,r.headers[Aa]],[jl]:[()=>r.headers[xl]!==void 0,()=>kr(Lr(r.headers[xl]))],[mw]:[,r.headers[Vw]],[ga]:[,r.headers[Fa]],[Yr]:[,r.headers[Or]],[Ls]:[,r.headers[vs]],[Vs]:[,r.headers[Js]],[Br]:[,r.headers[qr]],[fr]:[()=>r.headers[n]!==void 0,()=>cr(r.headers[n])],[Qr]:[,r.headers[Ma]],[ea]:[,r.headers[Da]],[Cw]:[,r.headers[rd]],[Iw]:[()=>r.headers[Je]!==void 0,()=>Ws(r.headers[Je])],[yw]:[()=>r.headers[Xe]!==void 0,()=>Ws(r.headers[Xe])],[ha]:[,r.headers[$a]],[il]:[()=>r.headers[ol]!==void 0,()=>kr(nl(r.headers[ol]))],[fa]:[,r.headers[Na]],Metadata:[,Object.keys(r.headers).filter((h)=>h.startsWith("x-amz-meta-")).reduce((h,e)=>{return h[e.substring(11)]=r.headers[e],h},{})]}),f=r.body;return s.sdkStreamMixin(f),l.Body=f,l};var xe=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return pl(r,s);const l=G({$metadata:c(r),[Xr]:[,r.headers[ka]],[sa]:[,r.headers[Ea]],[ul]:[,r.headers[ff]],[tl]:[,r.headers[hf]],[rf]:[,r.headers[ef]],[sf]:[,r.headers[af]],[Yr]:[,r.headers[Or]],[lf]:[,r.headers[Ca]],[Ls]:[,r.headers[vs]],[Vs]:[,r.headers[Js]],[Br]:[,r.headers[qr]],[Zs]:[,r.headers[Hs]],[fr]:[()=>r.headers[n]!==void 0,()=>cr(r.headers[n])],[ea]:[,r.headers[Da]]});return await Qe(r.body,s),l};var pl=async(r,s)=>{const l={...r,body:await Nr.parseXmlErrorBody(r.body,s)},f=Nr.loadRestXmlErrorCode(r,l.body);switch(f){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await og(l,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await ug(l,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await _g(l,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await jg(l,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await bg(l,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await ig(l,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await xg(l,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await ng(l,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await pg(l,s);default:const h=l.body;return qg({output:r,parsedBody:h,errorCode:f})}},qg=Be(H),_g=async(r,s)=>{const l=G({}),f=r.body,h=new Ms({$metadata:c(r),...l});return _(h,r.body)},jg=async(r,s)=>{const l=G({}),f=r.body,h=new Ts({$metadata:c(r),...l});return _(h,r.body)},ig=async(r,s)=>{const l=G({}),f=r.body;if(f[Yl]!=null)l[Yl]=Pr(f[Yl]);if(f[Qr]!=null)l[Qr]=Pr(f[Qr]);const h=new Fs({$metadata:c(r),...l});return _(h,r.body)},bg=async(r,s)=>{const l=G({}),f=r.body,h=new Cs({$metadata:c(r),...l});return _(h,r.body)},xg=async(r,s)=>{const l=G({}),f=r.body,h=new zs({$metadata:c(r),...l});return _(h,r.body)},og=async(r,s)=>{const l=G({}),f=r.body,h=new Ds({$metadata:c(r),...l});return _(h,r.body)},ng=async(r,s)=>{const l=G({}),f=r.body,h=new Gs({$metadata:c(r),...l});return _(h,r.body)},pg=async(r,s)=>{const l=G({}),f=r.body,h=new ys({$metadata:c(r),...l});return _(h,r.body)},ug=async(r,s)=>{const l=G({}),f=r.body,h=new Us({$metadata:c(r),...l});return _(h,r.body)};var tg=(r,s)=>{const l={};if(r[cl]!=null)l[cl]=Pr(r[cl]);if(r[Ol]!=null)l[Ol]=Pr(r[Ol]);if(r[ql]!=null)l[ql]=Pr(r[ql]);if(r[Xr]!=null)l[Xr]=kr(nl(r[Xr]));return l};var c=(r)=>({httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]});var q=(r)=>r!==void 0&&r!==null&&r!==""&&(!Object.getOwnPropertyNames(r).includes("length")||r.length!=0)&&(!Object.getOwnPropertyNames(r).includes("size")||r.size!=0);var rw="ACL";var cl="AccessKeyId";var sw="AcceptRanges";var Yl="AccessTier";var fr="BucketKeyEnabled";var Bl="Credentials",lw="ChecksumAlgorithm";var oe="CacheControl",ul="ChecksumCRC32",tl="ChecksumCRC32C",ne="ContentDisposition";var pe="ContentEncoding";var ue="ContentLanguage",_l="ContentLength",fw="ChecksumMode",hw="ContentMD5";var ew="ContentRange";var rf="ChecksumSHA1",sf="ChecksumSHA256";var te="ContentType";var aw="DeleteMarker";var jl="Expires";var ra="ExpectedBucketOwner";var mw="ExpiresString";var sa="ETag";var Xr="Expiration";var gw="GrantFullControl";var ww="GrantRead",dw="GrantReadACP";var Sw="GrantWriteACP";var Rw="IfMatch",Le="IfModifiedSince",la="IfNoneMatch";var Ve="IfUnmodifiedSince";var Aw="LastModified";var Ew="MissingMeta";var fa="ObjectLockLegalHoldStatus",ha="ObjectLockMode";var il="ObjectLockRetainUntilDate";var Iw="PartsCount";var kw="PartNumber";var Pw="Range";var ea="RequestCharged",Nw="ResponseCacheControl",$w="ResponseContentDisposition",Dw="ResponseContentEncoding",Uw="ResponseContentLanguage",Mw="ResponseContentType";var Tw="ResponseExpires";var aa="RequestPayer";var Cw="ReplicationStatus";var Fw="Restore";var Ol="SecretAccessKey";var Qr="StorageClass";var zw="SessionMode";var Yr="ServerSideEncryption";var Ls="SSECustomerAlgorithm",ma="SSECustomerKey",Vs="SSECustomerKeyMD5";var Zs="SSEKMSEncryptionContext",Br="SSEKMSKeyId";var ql="SessionToken";var Gw="Tagging";var yw="TagCount";var lf="VersionId";var ga="WebsiteRedirectLocation";var Ww="accept-ranges";var wa="cache-control",da="content-disposition",Sa="content-encoding",Ra="content-language",bl="content-length",Kw="content-md5",Lw="content-range",Aa="content-type";var xl="expires";var Ea="etag",Vw="expiresstring";var Zw="if-match",Hw="if-modified-since";var Ia="if-none-match";var vw="if-unmodified-since";var Ze="last-modified";var Jw="partNumber";var Xw="range",Qw="response-cache-control",cw="response-content-disposition",Yw="response-content-encoding",Bw="response-content-language",Ow="response-content-type",qw="response-expires";var _w="session";var jw="versionId";var iw="x-amz-acl";var ff="x-amz-checksum-crc32",hf="x-amz-checksum-crc32c",bw="x-amz-checksum-mode";var ef="x-amz-checksum-sha1",af="x-amz-checksum-sha256";var xw="x-amz-create-session-mode";var He="x-amz-delete-marker",ka="x-amz-expiration",Pa="x-amz-expected-bucket-owner";var ow="x-amz-grant-full-control",nw="x-amz-grant-read",pw="x-amz-grant-read-acp";var uw="x-amz-grant-write-acp";var ve="x-amz-missing-meta";var Je="x-amz-mp-parts-count";var Na="x-amz-object-lock-legal-hold",$a="x-amz-object-lock-mode",ol="x-amz-object-lock-retain-until-date";var tw="x-amz-restore",Da="x-amz-request-charged";var Ua="x-amz-request-payer";var rd="x-amz-replication-status";var Ma="x-amz-storage-class",sd="x-amz-sdk-checksum-algorithm";var Or="x-amz-server-side-encryption",qr="x-amz-server-side-encryption-aws-kms-key-id",n="x-amz-server-side-encryption-bucket-key-enabled",Hs="x-amz-server-side-encryption-context",vs="x-amz-server-side-encryption-customer-algorithm",Ta="x-amz-server-side-encryption-customer-key",Js="x-amz-server-side-encryption-customer-key-md5",ld="x-amz-tagging",Xe="x-amz-tagging-count";var Ca="x-amz-version-id",Fa="x-amz-website-redirect-location",za="x-id";class mf extends $r.classBuilder().ep({...Ir,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,l,f){return[Dr(l,this.serialize,this.deserialize),Ur(l,r.getEndpointParameterInstructions()),ws(l)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(Fe,Ce).ser(qe).de(ie).build(){}var Ga={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.654.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn test:unit","test:e2e":"yarn test:e2e:node && yarn test:e2e:browser","test:e2e:browser":"ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js","test:e2e:node":"jest --c jest.config.e2e.js","test:unit":"ts-mocha test/unit/**/*.spec.ts"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.654.0","@aws-sdk/client-sts":"3.654.0","@aws-sdk/core":"3.654.0","@aws-sdk/credential-provider-node":"3.654.0","@aws-sdk/middleware-bucket-endpoint":"3.654.0","@aws-sdk/middleware-expect-continue":"3.654.0","@aws-sdk/middleware-flexible-checksums":"3.654.0","@aws-sdk/middleware-host-header":"3.654.0","@aws-sdk/middleware-location-constraint":"3.654.0","@aws-sdk/middleware-logger":"3.654.0","@aws-sdk/middleware-recursion-detection":"3.654.0","@aws-sdk/middleware-sdk-s3":"3.654.0","@aws-sdk/middleware-ssec":"3.654.0","@aws-sdk/middleware-user-agent":"3.654.0","@aws-sdk/region-config-resolver":"3.654.0","@aws-sdk/signature-v4-multi-region":"3.654.0","@aws-sdk/types":"3.654.0","@aws-sdk/util-endpoints":"3.654.0","@aws-sdk/util-user-agent-browser":"3.654.0","@aws-sdk/util-user-agent-node":"3.654.0","@aws-sdk/xml-builder":"3.654.0","@smithy/config-resolver":"^3.0.8","@smithy/core":"^2.4.3","@smithy/eventstream-serde-browser":"^3.0.9","@smithy/eventstream-serde-config-resolver":"^3.0.6","@smithy/eventstream-serde-node":"^3.0.8","@smithy/fetch-http-handler":"^3.2.7","@smithy/hash-blob-browser":"^3.1.5","@smithy/hash-node":"^3.0.6","@smithy/hash-stream-node":"^3.1.5","@smithy/invalid-dependency":"^3.0.6","@smithy/md5-js":"^3.0.6","@smithy/middleware-content-length":"^3.0.8","@smithy/middleware-endpoint":"^3.1.3","@smithy/middleware-retry":"^3.0.18","@smithy/middleware-serde":"^3.0.6","@smithy/middleware-stack":"^3.0.6","@smithy/node-config-provider":"^3.1.7","@smithy/node-http-handler":"^3.2.2","@smithy/protocol-http":"^4.1.3","@smithy/smithy-client":"^3.3.2","@smithy/types":"^3.4.2","@smithy/url-parser":"^3.0.6","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.18","@smithy/util-defaults-mode-node":"^3.0.18","@smithy/util-endpoints":"^2.1.2","@smithy/util-middleware":"^3.0.6","@smithy/util-retry":"^3.0.6","@smithy/util-stream":"^3.1.6","@smithy/util-utf8":"^3.0.0","@smithy/util-waiter":"^3.1.5",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.654.0","@tsconfig/node16":"16.1.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-s3"}};var Bs=L(Ns(),1);var hd="AWS_S3_USE_ARN_REGION",ed="s3_use_arn_region",ya={environmentVariableSelector:(r)=>rr(r,hd,sr.ENV),configFileSelector:(r)=>rr(r,ed,sr.CONFIG),default:!1};var p=L(Ka(),1);var La=L(Ka(),1),Wa=function(r){for(let s=0;s<8;s++)r[s]^=255;for(let s=7;s>-1;s--)if(r[s]++,r[s]!==0)break};class Mr{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let l=7,f=Math.abs(Math.round(r));l>-1&&f>0;l--,f/=256)s[l]=f;if(r<0)Wa(s);return new Mr(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Wa(r);return parseInt(La.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class gf{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let h of Object.keys(r)){const e=this.fromUtf8(h);s.push(Uint8Array.from([e.byteLength]),e,this.formatHeaderValue(r[h]))}const l=new Uint8Array(s.reduce((h,e)=>h+e.byteLength,0));let f=0;for(let h of s)l.set(h,f),f+=h.byteLength;return l}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const l=new DataView(new ArrayBuffer(5));return l.setUint8(0,4),l.setInt32(1,r.value,!1),new Uint8Array(l.buffer);case"long":const f=new Uint8Array(9);return f[0]=5,f.set(r.value.bytes,1),f;case"binary":const h=new DataView(new ArrayBuffer(3+r.value.byteLength));h.setUint8(0,6),h.setUint16(1,r.value.byteLength,!1);const e=new Uint8Array(h.buffer);return e.set(r.value,3),e;case"string":const m=this.fromUtf8(r.value),a=new DataView(new ArrayBuffer(3+m.byteLength));a.setUint8(0,7),a.setUint16(1,m.byteLength,!1);const g=new Uint8Array(a.buffer);return g.set(m,3),g;case"timestamp":const R=new Uint8Array(9);return R[0]=8,R.set(Mr.fromNumber(r.value.valueOf()).bytes,1),R;case"uuid":if(!Td.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const N=new Uint8Array(17);return N[0]=9,N.set(p.fromHex(r.value.replace(/\-/g,"")),1),N}}parse(r){const s={};let l=0;while(l<r.byteLength){const f=r.getUint8(l++),h=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,f));switch(l+=f,r.getUint8(l++)){case 0:s[h]={type:Za,value:!0};break;case 1:s[h]={type:Za,value:!1};break;case 2:s[h]={type:Id,value:r.getInt8(l++)};break;case 3:s[h]={type:kd,value:r.getInt16(l,!1)},l+=2;break;case 4:s[h]={type:Pd,value:r.getInt32(l,!1)},l+=4;break;case 5:s[h]={type:Nd,value:new Mr(new Uint8Array(r.buffer,r.byteOffset+l,8))},l+=8;break;case 6:const e=r.getUint16(l,!1);l+=2,s[h]={type:$d,value:new Uint8Array(r.buffer,r.byteOffset+l,e)},l+=e;break;case 7:const m=r.getUint16(l,!1);l+=2,s[h]={type:Dd,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,m))},l+=m;break;case 8:s[h]={type:Ud,value:new Date(new Mr(new Uint8Array(r.buffer,r.byteOffset+l,8)).valueOf())},l+=8;break;case 9:const a=new Uint8Array(r.buffer,r.byteOffset+l,16);l+=16,s[h]={type:Md,value:`${p.toHex(a.subarray(0,4))}-${p.toHex(a.subarray(4,6))}-${p.toHex(a.subarray(6,8))}-${p.toHex(a.subarray(8,10))}-${p.toHex(a.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var Va;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(Va||(Va={}));var Za="boolean",Id="byte",kd="short",Pd="integer",Nd="long",$d="binary",Dd="string",Ud="timestamp",Md="uuid",Td=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function va({byteLength:r,byteOffset:s,buffer:l}){if(r<Cd)throw new Error("Provided message too short to accommodate event stream message overhead");const f=new DataView(l,s,r),h=f.getUint32(0,!1);if(r!==h)throw new Error("Reported message length does not match received message length");const e=f.getUint32(Ha,!1),m=f.getUint32(u,!1),a=f.getUint32(r-hr,!1),g=new t().update(new Uint8Array(l,s,u));if(m!==g.digest())throw new Error(`The prelude checksum specified in the message (${m}) does not match the calculated CRC32 checksum (${g.digest()})`);if(g.update(new Uint8Array(l,s+u,r-(u+hr))),a!==g.digest())throw new Error(`The message checksum (${g.digest()}) did not match the expected value of ${a}`);return{headers:new DataView(l,s+u+hr,e),body:new Uint8Array(l,s+u+hr+e,h-e-(u+hr+hr))}}var Ha=4,u=Ha*2,hr=4,Cd=u+hr*2;class wf{constructor(r,s){this.headerMarshaller=new gf(r,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(r){this.messageBuffer.push(this.decode(r))}endOfStream(){this.isEndOfStream=!0}getMessage(){const r=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return r},isEndOfStream(){return s}}}getAvailableMessages(){const r=this.messageBuffer;this.messageBuffer=[];const s=this.isEndOfStream;return{getMessages(){return r},isEndOfStream(){return s}}}encode({headers:r,body:s}){const l=this.headerMarshaller.format(r),f=l.byteLength+s.byteLength+16,h=new Uint8Array(f),e=new DataView(h.buffer,h.byteOffset,h.byteLength),m=new t;return e.setUint32(0,f,!1),e.setUint32(4,l.byteLength,!1),e.setUint32(8,m.update(h.subarray(0,8)).digest(),!1),h.set(l,12),h.set(s,l.byteLength+12),e.setUint32(f-4,m.update(h.subarray(8,f-4)).digest(),!1),h}decode(r){const{headers:s,body:l}=va(r);return{headers:this.headerMarshaller.parse(s),body:l}}formatHeaders(r){return this.headerMarshaller.format(r)}}class df{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.decoder.decode(r)}}class Sf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream)yield this.options.encoder.encode(r);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class Rf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream){const s=await this.options.deserializer(r);if(s===void 0)continue;yield s}}}class Af{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.serializer(r)}}function Ja(r){let s=0,l=0,f=null,h=null;const e=(a)=>{if(typeof a!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+a);s=a,l=4,f=new Uint8Array(a),new DataView(f.buffer).setUint32(0,a,!1)},m=async function*(){const a=r[Symbol.asyncIterator]();while(!0){const{value:g,done:R}=await a.next();if(R){if(!s)return;else if(s===l)yield f;else throw new Error("Truncated event message received.");return}const N=g.length;let $=0;while($<N){if(!f){const M=N-$;if(!h)h=new Uint8Array(4);const Q=Math.min(4-l,M);if(h.set(g.slice($,$+Q),l),l+=Q,$+=Q,l<4)break;e(new DataView(h.buffer).getUint32(0,!1)),h=null}const D=Math.min(s-l,N-$);if(f.set(g.slice($,$+D),l),l+=D,$+=D,s&&s===l)yield f,f=null,s=0,l=0}}};return{[Symbol.asyncIterator]:m}}function Xa(r,s){return async function(l){const{value:f}=l.headers[":message-type"];if(f==="error"){const h=new Error(l.headers[":error-message"].value||"UnknownError");throw h.name=l.headers[":error-code"].value,h}else if(f==="exception"){const h=l.headers[":exception-type"].value,e={[h]:l},m=await r(e);if(m.$unknown){const a=new Error(s(l.body));throw a.name=h,a}throw m[h]}else if(f==="event"){const h={[l.headers[":event-type"].value]:l},e=await r(h);if(e.$unknown)return;return e}else throw Error(`Unrecognizable event type: ${l.headers[":event-type"].value}`)}}class Xs{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new wf(r,s),this.utfEncoder=r}deserialize(r,s){const l=Ja(r);return new Rf({messageStream:new df({inputStream:l,decoder:this.eventStreamCodec}),deserializer:Xa(s,this.utfEncoder)})}serialize(r,s){return new Sf({messageStream:new Af({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as Fd} from"stream";async function*Qa(r){let s=!1,l=!1;const f=new Array;r.on("error",(h)=>{if(!s)s=!0;if(h)throw h}),r.on("data",(h)=>{f.push(h)}),r.on("end",()=>{s=!0});while(!l){const h=await new Promise((e)=>setTimeout(()=>e(f.shift()),0));if(h)yield h;l=s&&f.length===0}}class Ef{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Xs({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const l=typeof r[Symbol.asyncIterator]==="function"?r:Qa(r);return this.universalMarshaller.deserialize(l,s)}serialize(r,s){return Fd.from(this.universalMarshaller.serialize(r,s))}}var ca=(r)=>new Ef(r);import{Writable as zd} from"stream";class Qs extends zd{constructor(r,s){super(s);this.hash=r}_write(r,s,l){try{this.hash.update(ss(r))}catch(f){return l(f)}l()}}var Ya=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const l=new r,f=new Qs(l);return s.pipe(f),new Promise((h,e)=>{s.on("error",(m)=>{f.end(),e(m)}),f.on("error",e),f.on("finish",()=>{l.digest().then(h).catch(e)})})};var cs=L(Ns(),1);var xa=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??qa,base64Encoder:r?.base64Encoder??_a,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??Ps,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??ja,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??De,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new cs.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new cs.AwsSdkSigV4ASigner}],logger:r?.logger??new es,sdkStreamMixin:r?.sdkStreamMixin??ia,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??wl,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??ba,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Ba,utf8Encoder:r?.utf8Encoder??Oa}};var dm=(r)=>{ua(process.version);const s=gm(r),l=()=>s().then(pa),f=xa(r);return Bs.emitWarningIfUnsupportedVersion(process.version),{...f,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??mm,credentialDefaultProvider:r?.credentialDefaultProvider??wm,defaultUserAgentProvider:r?.defaultUserAgentProvider??am({serviceId:f.serviceId,clientVersion:Ga.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??O(hl),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??ca,maxAttempts:r?.maxAttempts??O(hm),md5:r?.md5??Ys.bind(null,"md5"),region:r?.region??O(sm,lm),requestChecksumCalculation:r?.requestChecksumCalculation??O(zf),requestHandler:oa.create(r?.requestHandler??l),responseChecksumValidation:r?.responseChecksumValidation??O(Gf),retryMode:r?.retryMode??O({...em,default:async()=>(await l()).retryMode||fm}),sha1:r?.sha1??Ys.bind(null,"sha1"),sha256:r?.sha256??Ys.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??O(Bs.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??na,streamHasher:r?.streamHasher??Ya,useArnRegion:r?.useArnRegion??O(ya),useDualstackEndpoint:r?.useDualstackEndpoint??O(ta),useFipsEndpoint:r?.useFipsEndpoint??O(rm)}};var Sm=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:l,credentials:f}=r;return{setHttpAuthScheme(h){const e=s.findIndex((m)=>m.schemeId===h.schemeId);if(e===-1)s.push(h);else s.splice(e,1,h)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(h){l=h},httpAuthSchemeProvider(){return l},setCredentials(h){f=h},credentials(){return f}}},Rm=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var Os=(r)=>r,$m=(r,s)=>{const l={...Os(Pm(r)),...Os(Im(r)),...Os(Am(r)),...Os(Sm(r))};return s.forEach((f)=>f.configure(l)),{...r,...Nm(l),...km(l),...Em(l),...Rm(l)}};class If extends Cm{constructor(...[r]){const s=dm(r||{}),l=Me(s),f=Fm(l),h=Of(f),e=Km(h),m=Gm(e),a=Dm(m),g=Wm(a),R=Ah(g),N=Ue(R),$=mh(N,{session:[()=>this,mf]}),D=$m($,r?.extensions||[]);super(D);this.config=D,this.middlewareStack.use(zm(this.config)),this.middlewareStack.use(Lm(this.config)),this.middlewareStack.use(ym(this.config)),this.middlewareStack.use(Um(this.config)),this.middlewareStack.use(Mm(this.config)),this.middlewareStack.use(Tm(this.config)),this.middlewareStack.use(Tr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Pe,identityProviderConfigProvider:async(M)=>new Tr.DefaultIdentityProviderConfig({"aws.auth#sigv4":M.credentials,"aws.auth#sigv4a":M.credentials})})),this.middlewareStack.use(Tr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(Rh(this.config)),this.middlewareStack.use(Mf(this.config)),this.middlewareStack.use(bf(this.config)),this.middlewareStack.use(el(this.config)),this.middlewareStack.use(ml(this.config))}destroy(){super.destroy()}}function Gd(r){return(s)=>async(l)=>{const f={...l.input},h=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let e of h){const m=f[e.target];if(m){let a;if(typeof m==="string")if(Wd(m,r))a=r.base64Decoder(m);else a=r.utf8Decoder(m),f[e.target]=r.base64Encoder(a);else a=ArrayBuffer.isView(m)?new Uint8Array(m.buffer,m.byteOffset,m.byteLength):new Uint8Array(m),f[e.target]=r.base64Encoder(a);const g=new r.md5;g.update(a),f[e.hash]=r.base64Encoder(await g.digest())}}return s({...l,input:f})}}function Wd(r,s){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r))return!1;try{return s.base64Decoder(r).length===32}catch{return!1}}var yd={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},qs=(r)=>({applyToStack:(s)=>{s.add(Gd(r),yd)}});class kf extends $r.classBuilder().ep({...Ir,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[Dr(l,this.serialize,this.deserialize),Ur(l,r.getEndpointParameterInstructions()),hs(l,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),qs(l),xf(l)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(Ge,ze).ser(_e).de(be).build(){}class Pf extends $r.classBuilder().ep({...Ir,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[Dr(l,this.serialize,this.deserialize),Ur(l,r.getEndpointParameterInstructions()),hs(l,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),qf(l),ws(l),qs(l)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(Ke,We).ser(je).de(xe).build(){}import{Buffer as Vm} from"buffer";class Zm extends er{client;constructor(...r){super();this.client=new If(...r)}async put(r){let s,l,f,h=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,f=`${br()}.${r.type.split("/")[1].split(";")[0]}`,l=r.type;else s=r.body,f=r.name,l=r.contentType;l=s instanceof Blob||s instanceof File?s.type:void 0;const e=s instanceof Vm?s:Vm.from(await s.arrayBuffer());return await this.client.send(new Pf({Bucket:h,Key:f,Body:e,ContentType:l})),f}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=await this.client.send(new kf({Bucket:s,Key:l}));return new Response(f.Body.transformToWebStream(),{headers:{"Content-Type":f.ContentType,"Content-Length":f.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":f.LastModified?.toUTCString()||"",ETag:f.ETag||""}})}}class _s{}class js extends _s{constructor(){super(...arguments)}requests=new Map;consume(r,s){if(!this.requests.has(r))this.requests.set(r,{date:Date.now(),count:1});else{const l=this.requests.get(r),f=Date.now();if(f-l.date>=60000)this.requests.set(r,{date:f,count:1});else this.requests.set(r,{date:l.date,count:l.count+1})}return this.requests.get(r).count}}class Hm{driver=new js}class _r{}import*as Hd from"react-dom/server";var cm=L(Kd(),1);import{Writable as Qd} from"stream";var{defineProperty:Ld,getOwnPropertySymbols:vm}=Object,Vd=Object.prototype.hasOwnProperty,Zd=Object.prototype.propertyIsEnumerable,Jm=(r,s,l)=>(s in r)?Ld(r,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[s]=l,Nf=(r,s)=>{for(var l in s||(s={}))if(Vd.call(s,l))Jm(r,l,s[l]);if(vm){for(var l of vm(s))if(Zd.call(s,l))Jm(r,l,s[l])}return r},$f=(r,s,l)=>{return new Promise((f,h)=>{var e=(g)=>{try{a(l.next(g))}catch(R){h(R)}},m=(g)=>{try{a(l.throw(g))}catch(R){h(R)}},a=(g)=>g.done?f(g.value):Promise.resolve(g.value).then(e,m);a((l=l.apply(r,s)).next())})},vd={unformatted:["code","pre","em","strong","span"],indent_inner_html:!0,indent_char:" ",indent_size:2,sep:"\n"},Jd=(r,s={})=>{return cm.default.html(r,Nf(Nf({},vd),s))},Xd=[{selector:"img",format:"skip"},{selector:"#__react-email-preview",format:"skip"},{selector:"a",options:{linkBrackets:!1}}];var Xm=new TextDecoder("utf-8"),Qm=(r)=>$f(void 0,null,function*(){let s="";if("pipeTo"in r){const l=new WritableStream({write(f){s+=Xm.decode(f)}});yield r.pipeTo(l)}else{const l=new Qd({write(f,h,e){s+=Xm.decode(f),e()}});return r.pipe(l),new Promise((f,h)=>{l.on("error",h),l.on("close",()=>{f(s)})})}return s}),is=(r,s)=>$f(void 0,null,function*(){const{default:l}=yield import("react-dom/server");let f;if(Object.hasOwn(l,"renderToReadableStream"))f=yield Qm(yield l.renderToReadableStream(r));else yield new Promise((m,a)=>{const g=l.renderToPipeableStream(r,{onAllReady(){return $f(this,null,function*(){f=yield Qm(g),m()})},onError(R){a(R)}})});if(s==null?void 0:s.plainText)return Df(f,Nf({selectors:Xd},s.htmlToTextOptions));const e=`${'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'}${f.replace(/<!DOCTYPE.*?>/,"")}`;if(s==null?void 0:s.pretty)return Jd(e);return e});var{defineProperty:cd,defineProperties:Yd,getOwnPropertyDescriptors:Bd,getOwnPropertySymbols:Ym}=Object,Od=Object.prototype.hasOwnProperty,qd=Object.prototype.propertyIsEnumerable,Bm=(r,s,l)=>(s in r)?cd(r,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[s]=l,jr=(r,s)=>{for(var l in s||(s={}))if(Od.call(s,l))Bm(r,l,s[l]);if(Ym){for(var l of Ym(s))if(qd.call(s,l))Bm(r,l,s[l])}return r},_d=(r,s)=>Yd(r,Bd(s)),I=(r,s,l)=>{return new Promise((f,h)=>{var e=(g)=>{try{a(l.next(g))}catch(R){h(R)}},m=(g)=>{try{a(l.throw(g))}catch(R){h(R)}},a=(g)=>g.done?f(g.value):Promise.resolve(g.value).then(e,m);a((l=l.apply(r,s)).next())})},jd="3.5.0",id=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/api-keys",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/api-keys")})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/api-keys/${r}`)})}},bd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/audiences",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/audiences")})}get(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r}`)})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/audiences/${r}`)})}},xd=class{constructor(r){this.resend=r}send(r){return I(this,arguments,function*(s,l={}){return this.create(s,l)})}create(r){return I(this,arguments,function*(s,l={}){for(let h of s)if(h.react)h.html=yield is(h.react),delete h.react;return yield this.resend.post("/emails/batch",s,l)})}},od=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post(`/audiences/${s.audienceId}/contacts`,{unsubscribed:s.unsubscribed,email:s.email,first_name:s.firstName,last_name:s.lastName},l)})}list(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts`)})}get(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts/${r.id}`)})}update(r){return I(this,null,function*(){return yield this.resend.patch(`/audiences/${r.audienceId}/contacts/${r.id}`,{unsubscribed:r.unsubscribed,first_name:r.firstName,last_name:r.lastName})})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/audiences/${r.audienceId}/contacts/${(r==null?void 0:r.email)?r==null?void 0:r.email:r==null?void 0:r.id}`)})}},nd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/domains",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/domains")})}get(r){return I(this,null,function*(){return yield this.resend.get(`/domains/${r}`)})}update(r){return I(this,null,function*(){return yield this.resend.patch(`/domains/${r.id}`,{click_tracking:r.clickTracking,open_tracking:r.openTracking,tls:r.tls})})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/domains/${r}`)})}verify(r){return I(this,null,function*(){return yield this.resend.post(`/domains/${r}/verify`)})}},pd=class{constructor(r){this.resend=r}send(r){return I(this,arguments,function*(s,l={}){return this.create(s,l)})}create(r){return I(this,arguments,function*(s,l={}){if(s.react)s.html=yield is(s.react),delete s.react;return yield this.resend.post("/emails",s,l)})}get(r){return I(this,null,function*(){return yield this.resend.get(`/emails/${r}`)})}},Om="https://api.resend.com",qm=`resend-node:${jd}`,ud=typeof process!=="undefined"&&process.env?process.env.RESEND_BASE_URL||Om:Om,td=typeof process!=="undefined"&&process.env?process.env.RESEND_USER_AGENT||qm:qm,_m=class{constructor(r){if(this.key=r,this.apiKeys=new id(this),this.audiences=new bd(this),this.batch=new xd(this),this.contacts=new od(this),this.domains=new nd(this),this.emails=new pd(this),!r){if(typeof process!=="undefined"&&process.env)this.key=process.env.RESEND_API_KEY;if(!this.key)throw new Error('Missing API key. Pass it to the constructor `new Resend("re_123")`')}this.headers=new Headers({Authorization:`Bearer ${this.key}`,"User-Agent":td,"Content-Type":"application/json"})}fetchRequest(r){return I(this,arguments,function*(s,l={}){try{const f=yield fetch(`${ud}${s}`,l);if(!f.ok)try{const e=yield f.text();return{data:null,error:JSON.parse(e)}}catch(e){if(e instanceof SyntaxError)return{data:null,error:{name:"application_error",message:"Internal server error. We are unable to process your request right now, please try again later."}};const m={message:f.statusText,name:"application_error"};if(e instanceof Error)return{data:null,error:_d(jr({},m),{message:e.message})};return{data:null,error:m}}return{data:yield f.json(),error:null}}catch(f){return{data:null,error:{name:"application_error",message:"Unable to fetch data. The request could not be resolved."}}}})}post(r,s){return I(this,arguments,function*(l,f,h={}){const e=jr({method:"POST",headers:this.headers,body:JSON.stringify(f)},h);return this.fetchRequest(l,e)})}get(r){return I(this,arguments,function*(s,l={}){const f=jr({method:"GET",headers:this.headers},l);return this.fetchRequest(s,f)})}put(r,s){return I(this,arguments,function*(l,f,h={}){const e=jr({method:"PUT",headers:this.headers,body:JSON.stringify(f)},h);return this.fetchRequest(l,e)})}patch(r,s){return I(this,arguments,function*(l,f,h={}){const e=jr({method:"PATCH",headers:this.headers,body:JSON.stringify(f)},h);return this.fetchRequest(l,e)})}delete(r,s){return I(this,null,function*(){const l={method:"DELETE",headers:this.headers,body:JSON.stringify(s)};return this.fetchRequest(r,l)})}};class bs{}class xs extends bs{r;constructor(r=process.env.RESEND_API_KEY){super();this.apiKey=r}async send(r){const s=new _m(this.apiKey),{data:l,error:f}=await s.emails.send({...r});if(f)throw f;if(l)return!0}}class jm extends _r{constructor(){super(...arguments)}debug=!0;defaultFrom="";driver=new xs;boot(){}}class im extends _r{constructor(){super(...arguments)}channels={};boot(){}}export{Zm as S3Driver,xs as ResendDriver,Hm as RateLimiterServiceProvider,_s as RateLimiterDriver,js as InMemoryRateLimiter,xr as FileSystemDriver,Uf as FileStorageServiceProvider,er as FileStorageDriver,jm as EmailServiceProvider,bs as EmailDriver,im as BroadcastingServiceProvider};export{Uf as p,_r as q,Hm as r,jm as s,im as t};