gemi 0.4.42 → 0.4.44

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 (45) hide show
  1. package/dist/chunk-00e9dad0734d9761.js +2 -0
  2. package/dist/chunk-01052ff9d1c07ef8.js +1 -1
  3. package/dist/chunk-0130e95410edb036.js +18 -0
  4. package/dist/chunk-03c8e645c994d40a.js +1 -1
  5. package/dist/chunk-1900e90c372bb1d6.js +1 -1
  6. package/dist/chunk-2ecc077efab285b4.js +2 -0
  7. package/dist/chunk-415d564ff61a8fe6.js +2 -0
  8. package/dist/chunk-487b7c0cb388d533.js +6 -0
  9. package/dist/chunk-4cb19a9e82653084.js +1 -1
  10. package/dist/chunk-5fd67245740e3908.js +9 -0
  11. package/dist/chunk-67351e678a7ccc10.js +2 -0
  12. package/dist/chunk-9113f22a5215c639.js +3 -0
  13. package/dist/chunk-a0003b7feea6fae6.js +2 -0
  14. package/dist/chunk-ae373c8ae2d526ae.js +18 -0
  15. package/dist/chunk-b0cc82fa84d5362d.js +2 -0
  16. package/dist/chunk-bf92f3127474b56a.js +3 -0
  17. package/dist/chunk-c1813278ccdc04b8.js +2 -0
  18. package/dist/chunk-c3eaa877d3aab9db.js +18 -0
  19. package/dist/chunk-c609d06153ed09ce.js +1 -1
  20. package/dist/chunk-d26ffb7722e6df54.js +1 -0
  21. package/dist/chunk-d5ddfacbfc84a47d.js +6 -0
  22. package/dist/chunk-dc7b0cf226ba3afa.js +1 -1
  23. package/dist/chunk-e1a08bb52ee7ea09.js +2 -0
  24. package/dist/chunk-f5a4295176f9b1c1.js +2 -0
  25. package/dist/chunk-f5e313cc7d724fbe.js +2 -0
  26. package/dist/chunk-f868cdf653dbe87e.js +2 -0
  27. package/dist/chunk-f9e6a0a946ebb032.js +2 -0
  28. package/dist/client/Mutation.d.ts +9 -13
  29. package/dist/client/Mutation.d.ts.map +1 -1
  30. package/dist/client/index.d.ts +2 -1
  31. package/dist/client/index.d.ts.map +1 -1
  32. package/dist/client/index.js +16 -4
  33. package/dist/client/{useRouter.d.ts → useNavigate.d.ts} +2 -2
  34. package/dist/client/useNavigate.d.ts.map +1 -0
  35. package/dist/client/useRoute.d.ts +8 -0
  36. package/dist/client/useRoute.d.ts.map +1 -0
  37. package/dist/http/ApiRouter.d.ts +4 -5
  38. package/dist/http/ApiRouter.d.ts.map +1 -1
  39. package/dist/http/I18nServiceContainer.d.ts.map +1 -1
  40. package/dist/http/index.js +1 -1
  41. package/dist/kernel/index.js +1 -1
  42. package/dist/server/index.js +1 -1
  43. package/dist/storage/index.js +4 -4
  44. package/package.json +1 -1
  45. package/dist/client/useRouter.d.ts.map +0 -1
@@ -1,11 +1,11 @@
1
1
  // @bun
2
- import"../chunk-9326224d1e4c1a64.js";import{y as M} from"../chunk-7ce930fe69575c87.js";import{$ as hr,A as Mm,B as ym,Ba as G,C as L,D as Or,Da as xa,E as Br,G as Lm,H as br,K as nh,L as Tr,M as v,N as ph,O as uh,P as th,Q as p,R as em,S as lm,aa as rm,ba as kl,ca as Pl,da as qa,ea as Ir,fa as B,ha as Ds,ka as Sr,la as ja,ma as Rr,na as ia,oa as $s,pa as Kr,ra as qf,sa as Mr,ta as Ka,ua as O,va as ba,wa as am,xa as hm,ya as Um,za as Tm} from"../chunk-dcc432bd72fb7e46.js";import{Fa as vA} from"../chunk-6a28d299b5726bba.js";import{$a as Er,Ga as Gm,Ha as Hm,Ia as Km,Ja as Fm,Ka as ns,La as u,Ma as t,Na as he,Oa as rf,Pa as Wm,Qa as Da,Ra as Ma,Sa as ya,Ta as Xm,Ua as mm,Va as gm,Wa as wm,Xa as Am,Ya as Zm,Za as Qm,_a as Ua,ab as Vm,bb as Sm,cb as Te,db as Rm,eb as vm,fb as dm,gb as Jm,hb as kA,ib as gs,jb as Im,kb as Ws,lb as Em,mb as km,nb as Cm,ob as cm} from"../chunk-901e700a2c2d43f3.js";import{pb as Pg} from"../chunk-9501e589e3e86a96.js";import{rb as i,sb as sm} from"../chunk-08539d08fa7362f7.js";import{tb as Pm} from"../chunk-b05e4833f4bb2f8f.js";import"../chunk-c041f058dc3d571b.js";import"../chunk-488b4db0c522d44a.js";function lg(r){return(s)=>async(f)=>{const{request:e}=f;if(L.isInstance(e)&&e.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")e.headers={...e.headers,Expect:"100-continue"}}return s({...f,request:e})}}var ag={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Ce=(r)=>({applyToStack:(s)=>{s.add(lg(r),ag)}});function mg(){return(r,s)=>async(f)=>{const{request:e}=f;if(L.isInstance(e)){if(!(hg in e.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof Br))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({...f})}}var hg="content-length",gg={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},ce=(r)=>({applyToStack:(s)=>{s.add(mg(),gg)}});var ze=(r)=>{return(s,f)=>async(e)=>{const l=await r.region(),a=r.region;let h=()=>{};if(f.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return f.__s3RegionRedirect}}),h=()=>Object.defineProperty(r,"region",{writable:!0,value:a});try{const m=await s(e);if(f.__s3RegionRedirect){h();const g=await r.region();if(l!==g)throw new Error("Region was not restored following S3 region redirect.")}return m}catch(m){throw h(),m}}},Ge={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function wg(r){return(s,f)=>async(e)=>{try{return await s(e)}catch(l){if(r.followRegionRedirects&&l?.$metadata?.httpStatusCode===301){try{const a=l.$response.headers["x-amz-bucket-region"];f.logger?.debug(`Redirecting from ${await r.region()} to ${a}`),f.__s3RegionRedirect=a}catch(a){throw new Error("Region redirect failed: "+a)}return s(e)}else throw l}}}var Ag={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},He=(r)=>({applyToStack:(s)=>{s.add(wg(r),Ag),s.addRelativeTo(ze(r),Ge)}});var Sg=(r)=>{return(s,f)=>async(e)=>{const l=await s(e),{response:a}=l;if(Or.isInstance(a)){if(a.headers.expires){a.headers.expiresstring=a.headers.expires;try{Mr(a.headers.expires)}catch(h){f.logger?.warn(`AWS SDK Warning for ${f.clientName}::${f.commandName} response parsing (${a.headers.expires}): ${h}`),delete a.headers.expires}}}return l}},Rg={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},Ke=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Sg(r),Rg)}});class er{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+er.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const f=this.data[s];if(!f.isRefreshing){const e=await f.identity;if(e.expiration){if(e.expiration.getTime()<r)delete this.data[s]}}}}}er.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class lr{constructor(r,s=!1,f=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=f}get identity(){return this.accessed=Date.now(),this._identity}}class ar{constructor(r,s=new er){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const f=s.Bucket,{cache:e}=this,l=e.get(f);if(l)return l.identity.then((a)=>{if((a.expiration?.getTime()??0)<Date.now())return e.set(f,new lr(this.getIdentity(f))).identity;if((a.expiration?.getTime()??0)<Date.now()+ar.REFRESH_WINDOW_MS&&!l.isRefreshing)l.isRefreshing=!0,this.getIdentity(f).then((g)=>{e.set(f,new lr(Promise.resolve(g)))});return a});return e.set(f,new lr(this.getIdentity(f))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((e)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+e)});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}}}ar.REFRESH_WINDOW_MS=60000;var Cr=M(hr(),1),os=M(ns(),1);var Fe="X-Amz-Algorithm",Le="X-Amz-Credential",We="X-Amz-Date",Xe="X-Amz-SignedHeaders",Ze="X-Amz-Expires",Qe="X-Amz-Signature",Ve="X-Amz-Security-Token";var ve="authorization",Os="X-Amz-Date".toLowerCase();var Je=["authorization",Os,"date"],Ye="X-Amz-Signature".toLowerCase(),yr="x-amz-content-sha256",Be="X-Amz-Security-Token".toLowerCase();var Oe={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},_e=/^proxy-/,qe=/^sec-/;var _r="AWS4-HMAC-SHA256";var je="AWS4-HMAC-SHA256-PAYLOAD",ie="UNSIGNED-PAYLOAD",be=50,_s="aws4_request",xe=604800;var ne=M(hr(),1);var qr={},qs=[],jr=(r,s,f)=>`${r}/${s}/${f}/${_s}`,pe=async(r,s,f,e,l)=>{const a=await oe(r,s.secretAccessKey,s.accessKeyId),h=`${f}:${e}:${l}:${ne.toHex(a)}:${s.sessionToken}`;if(h in qr)return qr[h];qs.push(h);while(qs.length>be)delete qr[qs.shift()];let m=`AWS4${s.secretAccessKey}`;for(let g of[f,e,l,_s])m=await oe(r,m,g);return qr[h]=m};var oe=(r,s,f)=>{const e=new r(s);return e.update(v(f)),e.digest()};var ir=({headers:r},s,f)=>{const e={};for(let l of Object.keys(r).sort()){if(r[l]==null)continue;const a=l.toLowerCase();if(a in Oe||s?.has(a)||_e.test(a)||qe.test(a)){if(!f||f&&!f.has(a))continue}e[a]=r[l].trim().replace(/\s+/g," ")}return e};var js=({query:r={}})=>{const s=[],f={};for(let e of Object.keys(r).sort()){if(e.toLowerCase()===Ye)continue;s.push(e);const l=r[e];if(typeof l==="string")f[e]=`${p(e)}=${p(l)}`;else if(Array.isArray(l))f[e]=l.slice(0).reduce((a,h)=>a.concat([`${p(e)}=${p(h)}`]),[]).sort().join("&")}return s.map((e)=>f[e]).filter((e)=>e).join("&")};var ue=M(hr(),1);var Ur=async({headers:r,body:s},f)=>{for(let e of Object.keys(r))if(e.toLowerCase()===yr)return r[e];if(s==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof s==="string"||ArrayBuffer.isView(s)||br(s)){const e=new f;return e.update(v(s)),ue.toHex(await e.digest())}return ie};var xr=M(hr(),1);var rl=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 is{format(r){const s=[];for(let l of Object.keys(r)){const a=Tr(l);s.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(r[l]))}const f=new Uint8Array(s.reduce((l,a)=>l+a.byteLength,0));let e=0;for(let l of s)f.set(l,e),e+=l.byteLength;return f}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 f=new DataView(new ArrayBuffer(5));return f.setUint8(0,4),f.setInt32(1,r.value,!1),new Uint8Array(f.buffer);case"long":const e=new Uint8Array(9);return e[0]=5,e.set(r.value.bytes,1),e;case"binary":const l=new DataView(new ArrayBuffer(3+r.value.byteLength));l.setUint8(0,6),l.setUint16(1,r.value.byteLength,!1);const a=new Uint8Array(l.buffer);return a.set(r.value,3),a;case"string":const h=Tr(r.value),m=new DataView(new ArrayBuffer(3+h.byteLength));m.setUint8(0,7),m.setUint16(1,h.byteLength,!1);const g=new Uint8Array(m.buffer);return g.set(h,3),g;case"timestamp":const S=new Uint8Array(9);return S[0]=8,S.set(bs.fromNumber(r.value.valueOf()).bytes,1),S;case"uuid":if(!dg.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(xr.fromHex(r.value.replace(/\-/g,"")),1),d}}}var te;(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"})(te||(te={}));var dg=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class bs{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 f=7,e=Math.abs(Math.round(r));f>-1&&e>0;f--,e/=256)s[f]=e;if(r<0)rl(s);return new bs(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)rl(r);return parseInt(xr.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}var sl=(r,s)=>{r=r.toLowerCase();for(let f of Object.keys(s))if(r===f.toLowerCase())return!0;return!1};var xs=(r,s={})=>{const{headers:f,query:e={}}=L.clone(r);for(let l of Object.keys(f)){const a=l.toLowerCase();if(a.slice(0,6)==="x-amz-"&&!s.unhoistableHeaders?.has(a))e[l]=f[l],delete f[l]}return{...r,headers:f,query:e}};var or=(r)=>{r=L.clone(r);for(let s of Object.keys(r.headers))if(Je.indexOf(s.toLowerCase())>-1)delete r.headers[s];return r};var fl=(r)=>Ig(r).toISOString().replace(/\.\d{3}Z$/,"Z"),Ig=(r)=>{if(typeof r==="number")return new Date(r*1000);if(typeof r==="string"){if(Number(r))return new Date(Number(r)*1000);return new Date(r)}return r};class ps{constructor({applyChecksum:r,credentials:s,region:f,service:e,sha256:l,uriEscapePath:a=!0}){this.headerFormatter=new is,this.service=e,this.sha256=l,this.uriEscapePath=a,this.applyChecksum=typeof r==="boolean"?r:!0,this.regionProvider=os.normalizeProvider(f),this.credentialProvider=os.normalizeProvider(s)}async presign(r,s={}){const{signingDate:f=new Date,expiresIn:e=3600,unsignableHeaders:l,unhoistableHeaders:a,signableHeaders:h,signingRegion:m,signingService:g}=s,S=await this.credentialProvider();this.validateResolvedCredentials(S);const d=m??await this.regionProvider(),{longDate:k,shortDate:P}=nr(f);if(e>xe)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const U=jr(P,d,g??this.service),D=xs(or(r),{unhoistableHeaders:a});if(S.sessionToken)D.query[Ve]=S.sessionToken;D.query[Fe]=_r,D.query[Le]=`${S.accessKeyId}/${U}`,D.query[We]=k,D.query[Ze]=e.toString(10);const Q=ir(D,l,h);return D.query[Xe]=el(Q),D.query[Qe]=await this.getSignature(k,U,this.getSigningKey(S,d,P,g),this.createCanonicalRequest(D,Q,await Ur(r,this.sha256))),D}async sign(r,s){if(typeof r==="string")return this.signString(r,s);else if(r.headers&&r.payload)return this.signEvent(r,s);else if(r.message)return this.signMessage(r,s);else return this.signRequest(r,s)}async signEvent({headers:r,payload:s},{signingDate:f=new Date,priorSignature:e,signingRegion:l,signingService:a}){const h=l??await this.regionProvider(),{shortDate:m,longDate:g}=nr(f),S=jr(m,h,a??this.service),d=await Ur({headers:{},body:s},this.sha256),k=new this.sha256;k.update(r);const P=Cr.toHex(await k.digest()),U=[je,g,S,e,P,d].join("\n");return this.signString(U,{signingDate:f,signingRegion:h,signingService:a})}async signMessage(r,{signingDate:s=new Date,signingRegion:f,signingService:e}){return this.signEvent({headers:this.headerFormatter.format(r.message.headers),payload:r.message.body},{signingDate:s,signingRegion:f,signingService:e,priorSignature:r.priorSignature}).then((a)=>{return{message:r.message,signature:a}})}async signString(r,{signingDate:s=new Date,signingRegion:f,signingService:e}={}){const l=await this.credentialProvider();this.validateResolvedCredentials(l);const a=f??await this.regionProvider(),{shortDate:h}=nr(s),m=new this.sha256(await this.getSigningKey(l,a,h,e));return m.update(v(r)),Cr.toHex(await m.digest())}async signRequest(r,{signingDate:s=new Date,signableHeaders:f,unsignableHeaders:e,signingRegion:l,signingService:a}={}){const h=await this.credentialProvider();this.validateResolvedCredentials(h);const m=l??await this.regionProvider(),g=or(r),{longDate:S,shortDate:d}=nr(s),k=jr(d,m,a??this.service);if(g.headers[Os]=S,h.sessionToken)g.headers[Be]=h.sessionToken;const P=await Ur(g,this.sha256);if(!sl(yr,g.headers)&&this.applyChecksum)g.headers[yr]=P;const U=ir(g,e,f),D=await this.getSignature(S,k,this.getSigningKey(h,m,d,a),this.createCanonicalRequest(g,U,P));return g.headers[ve]=`${_r} `+`Credential=${h.accessKeyId}/${k}, `+`SignedHeaders=${el(U)}, `+`Signature=${D}`,g}createCanonicalRequest(r,s,f){const e=Object.keys(s).sort();return`${r.method}
2
+ import"../chunk-c1813278ccdc04b8.js";import{y as L} from"../chunk-7ce930fe69575c87.js";import{A as Nm,B as $m,C as F,D as qr,E as _r,F as Hm,G as or,J as bh,K as Cr,L as v,M as xh,N as oh,O as nh,P as p,Q as rm,R as sm,S as hr,T as ph,U as Il,V as El,W as Oa,X as Ir,Y as B,_ as ys,ba as Sr,ca as _a,da as Rr,ea as qa,fa as Ms,ga as Lr,ia as qf,ja as yr,ka as Ga,la as O,ma as ja,na as fm,oa as em,pa as Dm,qa as Mm,sa as z,ua as ia} from"../chunk-bf92f3127474b56a.js";import{wa as WA} from"../chunk-f08ca4bd263b132b.js";import{$a as SA,Aa as Gm,Ba as Hr,Ca as zr,Da as u,Ea as t,Fa as rf,Ga as Km,Ha as Na,Ia as $a,Ja as Da,Ka as Fm,La as lm,Ma as am,Na as hm,Oa as mm,Pa as Lm,Qa as Wm,Ra as Ma,Sa as Er,Ta as kr,Ua as Xm,Va as gm,Wa as Ue,Xa as wm,Ya as Zm,Za as Am,_a as Qm,ab as As,bb as Sm,cb as Zs,db as Rm,eb as dm,fb as ym,gb as Um,xa as Cm,ya as cm,za as zm} from"../chunk-c3eaa877d3aab9db.js";import{hb as Rg} from"../chunk-a0003b7feea6fae6.js";import{ib as i,jb as uh} from"../chunk-4cb19a9e82653084.js";import"../chunk-ff086fe014985526.js";import{qb as Im} from"../chunk-5fd67245740e3908.js";import"../chunk-d26ffb7722e6df54.js";function tm(r){return(s)=>async(f)=>{const{request:e}=f;if(F.isInstance(e)&&e.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")e.headers={...e.headers,Expect:"100-continue"}}return s({...f,request:e})}}var rg={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Te=(r)=>({applyToStack:(s)=>{s.add(tm(r),rg)}});function fg(){return(r,s)=>async(f)=>{const{request:e}=f;if(F.isInstance(e)){if(!(sg in e.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof _r))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({...f})}}var sg="content-length",eg={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},Ce=(r)=>({applyToStack:(s)=>{s.add(fg(),eg)}});var ce=(r)=>{return(s,f)=>async(e)=>{const l=await r.region(),a=r.region;let h=()=>{};if(f.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return f.__s3RegionRedirect}}),h=()=>Object.defineProperty(r,"region",{writable:!0,value:a});try{const m=await s(e);if(f.__s3RegionRedirect){h();const g=await r.region();if(l!==g)throw new Error("Region was not restored following S3 region redirect.")}return m}catch(m){throw h(),m}}},ze={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function lg(r){return(s,f)=>async(e)=>{try{return await s(e)}catch(l){if(r.followRegionRedirects&&l?.$metadata?.httpStatusCode===301){try{const a=l.$response.headers["x-amz-bucket-region"];f.logger?.debug(`Redirecting from ${await r.region()} to ${a}`),f.__s3RegionRedirect=a}catch(a){throw new Error("Region redirect failed: "+a)}return s(e)}else throw l}}}var ag={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},Ge=(r)=>({applyToStack:(s)=>{s.add(lg(r),ag),s.addRelativeTo(ce(r),ze)}});var hg=(r)=>{return(s,f)=>async(e)=>{const l=await s(e),{response:a}=l;if(qr.isInstance(a)){if(a.headers.expires){a.headers.expiresstring=a.headers.expires;try{yr(a.headers.expires)}catch(h){f.logger?.warn(`AWS SDK Warning for ${f.clientName}::${f.commandName} response parsing (${a.headers.expires}): ${h}`),delete a.headers.expires}}}return l}},mg={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},He=(r)=>({applyToStack:(s)=>{s.addRelativeTo(hg(r),mg)}});class er{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+er.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const f=this.data[s];if(!f.isRefreshing){const e=await f.identity;if(e.expiration){if(e.expiration.getTime()<r)delete this.data[s]}}}}}er.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class lr{constructor(r,s=!1,f=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=f}get identity(){return this.accessed=Date.now(),this._identity}}class ar{constructor(r,s=new er){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const f=s.Bucket,{cache:e}=this,l=e.get(f);if(l)return l.identity.then((a)=>{if((a.expiration?.getTime()??0)<Date.now())return e.set(f,new lr(this.getIdentity(f))).identity;if((a.expiration?.getTime()??0)<Date.now()+ar.REFRESH_WINDOW_MS&&!l.isRefreshing)l.isRefreshing=!0,this.getIdentity(f).then((g)=>{e.set(f,new lr(Promise.resolve(g)))});return a});return e.set(f,new lr(this.getIdentity(f))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((e)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+e)});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}}}ar.REFRESH_WINDOW_MS=60000;var cr=L(hr(),1);var Ke="X-Amz-Algorithm",Fe="X-Amz-Credential",Le="X-Amz-Date",We="X-Amz-SignedHeaders",Xe="X-Amz-Expires",Ze="X-Amz-Signature",Qe="X-Amz-Security-Token";var Ve="authorization",qs="X-Amz-Date".toLowerCase();var ve=["authorization",qs,"date"],Je="X-Amz-Signature".toLowerCase(),Ur="x-amz-content-sha256",Ye="X-Amz-Security-Token".toLowerCase();var Be={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Oe=/^proxy-/,_e=/^sec-/;var jr="AWS4-HMAC-SHA256";var qe="AWS4-HMAC-SHA256-PAYLOAD",je="UNSIGNED-PAYLOAD",ie=50,js="aws4_request",be=604800;var oe=L(hr(),1);var ir={},is=[],br=(r,s,f)=>`${r}/${s}/${f}/${js}`,ne=async(r,s,f,e,l)=>{const a=await xe(r,s.secretAccessKey,s.accessKeyId),h=`${f}:${e}:${l}:${oe.toHex(a)}:${s.sessionToken}`;if(h in ir)return ir[h];is.push(h);while(is.length>ie)delete ir[is.shift()];let m=`AWS4${s.secretAccessKey}`;for(let g of[f,e,l,js])m=await xe(r,m,g);return ir[h]=m};var xe=(r,s,f)=>{const e=new r(s);return e.update(v(f)),e.digest()};var xr=({headers:r},s,f)=>{const e={};for(let l of Object.keys(r).sort()){if(r[l]==null)continue;const a=l.toLowerCase();if(a in Be||s?.has(a)||Oe.test(a)||_e.test(a)){if(!f||f&&!f.has(a))continue}e[a]=r[l].trim().replace(/\s+/g," ")}return e};var bs=({query:r={}})=>{const s=[],f={};for(let e of Object.keys(r).sort()){if(e.toLowerCase()===Je)continue;s.push(e);const l=r[e];if(typeof l==="string")f[e]=`${p(e)}=${p(l)}`;else if(Array.isArray(l))f[e]=l.slice(0).reduce((a,h)=>a.concat([`${p(e)}=${p(h)}`]),[]).sort().join("&")}return s.map((e)=>f[e]).filter((e)=>e).join("&")};var pe=L(hr(),1);var Tr=async({headers:r,body:s},f)=>{for(let e of Object.keys(r))if(e.toLowerCase()===Ur)return r[e];if(s==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof s==="string"||ArrayBuffer.isView(s)||or(s)){const e=new f;return e.update(v(s)),pe.toHex(await e.digest())}return je};var nr=L(hr(),1);var te=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 xs{format(r){const s=[];for(let l of Object.keys(r)){const a=Cr(l);s.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(r[l]))}const f=new Uint8Array(s.reduce((l,a)=>l+a.byteLength,0));let e=0;for(let l of s)f.set(l,e),e+=l.byteLength;return f}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 f=new DataView(new ArrayBuffer(5));return f.setUint8(0,4),f.setInt32(1,r.value,!1),new Uint8Array(f.buffer);case"long":const e=new Uint8Array(9);return e[0]=5,e.set(r.value.bytes,1),e;case"binary":const l=new DataView(new ArrayBuffer(3+r.value.byteLength));l.setUint8(0,6),l.setUint16(1,r.value.byteLength,!1);const a=new Uint8Array(l.buffer);return a.set(r.value,3),a;case"string":const h=Cr(r.value),m=new DataView(new ArrayBuffer(3+h.byteLength));m.setUint8(0,7),m.setUint16(1,h.byteLength,!1);const g=new Uint8Array(m.buffer);return g.set(h,3),g;case"timestamp":const S=new Uint8Array(9);return S[0]=8,S.set(os.fromNumber(r.value.valueOf()).bytes,1),S;case"uuid":if(!gg.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(nr.fromHex(r.value.replace(/\-/g,"")),1),d}}}var ue;(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"})(ue||(ue={}));var gg=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class os{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 f=7,e=Math.abs(Math.round(r));f>-1&&e>0;f--,e/=256)s[f]=e;if(r<0)te(s);return new os(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)te(r);return parseInt(nr.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}var rl=(r,s)=>{r=r.toLowerCase();for(let f of Object.keys(s))if(r===f.toLowerCase())return!0;return!1};var ns=(r,s={})=>{const{headers:f,query:e={}}=F.clone(r);for(let l of Object.keys(f)){const a=l.toLowerCase();if(a.slice(0,6)==="x-amz-"&&!s.unhoistableHeaders?.has(a))e[l]=f[l],delete f[l]}return{...r,headers:f,query:e}};var pr=(r)=>{r=F.clone(r);for(let s of Object.keys(r.headers))if(ve.indexOf(s.toLowerCase())>-1)delete r.headers[s];return r};var sl=(r)=>wg(r).toISOString().replace(/\.\d{3}Z$/,"Z"),wg=(r)=>{if(typeof r==="number")return new Date(r*1000);if(typeof r==="string"){if(Number(r))return new Date(Number(r)*1000);return new Date(r)}return r};class ps{constructor({applyChecksum:r,credentials:s,region:f,service:e,sha256:l,uriEscapePath:a=!0}){this.headerFormatter=new xs,this.service=e,this.sha256=l,this.uriEscapePath=a,this.applyChecksum=typeof r==="boolean"?r:!0,this.regionProvider=zr(f),this.credentialProvider=zr(s)}async presign(r,s={}){const{signingDate:f=new Date,expiresIn:e=3600,unsignableHeaders:l,unhoistableHeaders:a,signableHeaders:h,signingRegion:m,signingService:g}=s,S=await this.credentialProvider();this.validateResolvedCredentials(S);const d=m??await this.regionProvider(),{longDate:k,shortDate:P}=ur(f);if(e>be)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const y=br(P,d,g??this.service),D=ns(pr(r),{unhoistableHeaders:a});if(S.sessionToken)D.query[Qe]=S.sessionToken;D.query[Ke]=jr,D.query[Fe]=`${S.accessKeyId}/${y}`,D.query[Le]=k,D.query[Xe]=e.toString(10);const Q=xr(D,l,h);return D.query[We]=fl(Q),D.query[Ze]=await this.getSignature(k,y,this.getSigningKey(S,d,P,g),this.createCanonicalRequest(D,Q,await Tr(r,this.sha256))),D}async sign(r,s){if(typeof r==="string")return this.signString(r,s);else if(r.headers&&r.payload)return this.signEvent(r,s);else if(r.message)return this.signMessage(r,s);else return this.signRequest(r,s)}async signEvent({headers:r,payload:s},{signingDate:f=new Date,priorSignature:e,signingRegion:l,signingService:a}){const h=l??await this.regionProvider(),{shortDate:m,longDate:g}=ur(f),S=br(m,h,a??this.service),d=await Tr({headers:{},body:s},this.sha256),k=new this.sha256;k.update(r);const P=cr.toHex(await k.digest()),y=[qe,g,S,e,P,d].join("\n");return this.signString(y,{signingDate:f,signingRegion:h,signingService:a})}async signMessage(r,{signingDate:s=new Date,signingRegion:f,signingService:e}){return this.signEvent({headers:this.headerFormatter.format(r.message.headers),payload:r.message.body},{signingDate:s,signingRegion:f,signingService:e,priorSignature:r.priorSignature}).then((a)=>{return{message:r.message,signature:a}})}async signString(r,{signingDate:s=new Date,signingRegion:f,signingService:e}={}){const l=await this.credentialProvider();this.validateResolvedCredentials(l);const a=f??await this.regionProvider(),{shortDate:h}=ur(s),m=new this.sha256(await this.getSigningKey(l,a,h,e));return m.update(v(r)),cr.toHex(await m.digest())}async signRequest(r,{signingDate:s=new Date,signableHeaders:f,unsignableHeaders:e,signingRegion:l,signingService:a}={}){const h=await this.credentialProvider();this.validateResolvedCredentials(h);const m=l??await this.regionProvider(),g=pr(r),{longDate:S,shortDate:d}=ur(s),k=br(d,m,a??this.service);if(g.headers[qs]=S,h.sessionToken)g.headers[Ye]=h.sessionToken;const P=await Tr(g,this.sha256);if(!rl(Ur,g.headers)&&this.applyChecksum)g.headers[Ur]=P;const y=xr(g,e,f),D=await this.getSignature(S,k,this.getSigningKey(h,m,d,a),this.createCanonicalRequest(g,y,P));return g.headers[Ve]=`${jr} `+`Credential=${h.accessKeyId}/${k}, `+`SignedHeaders=${fl(y)}, `+`Signature=${D}`,g}createCanonicalRequest(r,s,f){const e=Object.keys(s).sort();return`${r.method}
3
3
  ${this.getCanonicalPath(r)}
4
- ${js(r)}
4
+ ${bs(r)}
5
5
  ${e.map((l)=>`${l}:${s[l]}`).join("\n")}
6
6
 
7
7
  ${e.join(";")}
8
- ${f}`}async createStringToSign(r,s,f){const e=new this.sha256;e.update(v(f));const l=await e.digest();return`${_r}
8
+ ${f}`}async createStringToSign(r,s,f){const e=new this.sha256;e.update(v(f));const l=await e.digest();return`${jr}
9
9
  ${r}
10
10
  ${s}
11
- ${Cr.toHex(l)}`}getCanonicalPath({path:r}){if(this.uriEscapePath){const s=[];for(let l of r.split("/")){if(l?.length===0)continue;if(l===".")continue;if(l==="..")s.pop();else s.push(l)}const f=`${r?.startsWith("/")?"/":""}${s.join("/")}${s.length>0&&r?.endsWith("/")?"/":""}`;return p(f).replace(/%2F/g,"/")}return r}async getSignature(r,s,f,e){const l=await this.createStringToSign(r,s,e),a=new this.sha256(await f);return a.update(v(l)),Cr.toHex(await a.digest())}getSigningKey(r,s,f,e){return pe(this.sha256,r,f,s,e||this.service)}validateResolvedCredentials(r){if(typeof r!=="object"||typeof r.accessKeyId!=="string"||typeof r.secretAccessKey!=="string")throw new Error("Resolved credential object is not valid")}}var nr=(r)=>{const s=fl(r).replace(/[\-:]/g,"");return{longDate:s,shortDate:s.slice(0,8)}},el=(r)=>Object.keys(r).sort().join(";");var ll="Directory",al="S3Express",hl="sigv4-s3express",pr="X-Amz-S3session-Token",cr=pr.toLowerCase(),Eg="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",kg="s3_disable_express_session_auth",us={environmentVariableSelector:(r)=>u(r,Eg,t.ENV),configFileSelector:(r)=>u(r,kg,t.CONFIG),default:!1};var ml=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},gl=function(r,s){const f=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),e=r.credentialProvider,l=()=>{return clearTimeout(f),r.credentialProvider=e,Promise.resolve(s)};r.credentialProvider=l};class ur extends ps{async signWithCredentials(r,s,f){const e=ml(s);r.headers[cr]=s.sessionToken;const l=this;return gl(l,e),l.signRequest(r,f??{})}async presignWithCredentials(r,s,f){const e=ml(s);return delete r.headers[cr],r.headers[pr]=s.sessionToken,r.query=r.query??{},r.query[pr]=s.sessionToken,gl(this,e),this.presign(r,f)}}var wl=(r)=>{return(s,f)=>async(e)=>{if(f.endpointV2){const l=f.endpointV2,a=l.properties?.authSchemes?.[0]?.name===hl;if(l.properties?.backend===al||l.properties?.bucketType===ll)f.isS3ExpressBucket=!0;if(a){const m=e.input.Bucket;if(m){const g=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:m});if(f.s3ExpressIdentity=g,L.isInstance(e.request)&&g.sessionToken)e.request.headers[cr]=g.sessionToken}}}return s(e)}},Al={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},ts=(r)=>({applyToStack:(s)=>{s.add(wl(r),Al)}});var Rl=M(rf(),1);var Ng=M(Pg(),1),dl=M(ns(),1);var Sl=async(r,s,f,e)=>{const l=await e.signWithCredentials(f,r,{});if(l.headers["X-Amz-Security-Token"]||l.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return l};var $g=(r)=>(s)=>{throw s},Dg=(r,s)=>{};var Il=(r)=>(s,f)=>async(e)=>{if(!L.isInstance(e.request))return s(e);const a=dl.getSmithyContext(f).selectedHttpAuthScheme;if(!a)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:h={}},identity:m,signer:g}=a;let S;if(f.s3ExpressIdentity)S=await Sl(f.s3ExpressIdentity,h,e.request,await r.signer());else S=await g.sign(e.request,m,h);const d=await s({...e,request:S}).catch((g.errorHandler||$g)(h));return(g.successHandler||Dg)(d.response,h),d},sf=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Il(r),Rl.httpSigningMiddlewareOptions)}});var El=(r,{session:s})=>{const[f,e]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new ar(async(l)=>f().send(new e({Bucket:l,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var Mg={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},yg=3000,Ug=(r)=>(s,f)=>async(e)=>{const l=await s(e),{response:a}=l;if(!Or.isInstance(a))return l;const{statusCode:h,body:m}=a;if(h<200||h>=300)return l;let g=m,S=m;if(m&&typeof m==="object"&&!(m instanceof Uint8Array))[g,S]=await kl(m);a.body=S;const d=await Tg(g,{streamCollector:async(P)=>{return Pl(P,yg)}});if(typeof g?.destroy==="function")g.destroy();const k=r.utf8Encoder(d.subarray(d.length-16));if(d.length===0&&Mg[f.commandName]){const P=new Error("S3 aborted request");throw P.name="InternalError",P}if(k&&k.endsWith("</Error>"))a.statusCode=400;return l},Tg=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},Cg={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},tr=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Ug(r),Cg)}});var ff=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function Nl(r){return(s,f)=>async(e)=>{if(r.bucketEndpoint){const l=f.endpointV2;if(l){const a=e.input.Bucket;if(typeof a==="string")try{const h=new URL(a);l.url=h}catch(h){const m=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${a} could not be parsed as URL.`;if(f.logger?.constructor?.name==="NoOpLogger")console.warn(m);else f.logger?.warn?.(m);throw h}}}return s(e)}}var $l={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function cg({bucketEndpoint:r}){return(s)=>async(f)=>{const{input:{Bucket:e}}=f;if(!r&&typeof e==="string"&&!ff(e)&&e.indexOf("/")>=0){const l=new Error(`Bucket name shouldn't contain '/', received '${e}'`);throw l.name="InvalidBucketName",l}return s({...f})}}var zg={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Dl=(r)=>({applyToStack:(s)=>{s.add(cg(r),zg),s.addRelativeTo(Nl(r),$l)}});var Pr=M(rf(),1);var Ml=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var ws=M(gs(),1);var rs={CrtSignerV4:null};class ef{constructor(r){this.sigv4Signer=new ur(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,f={}){if(f.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,f)}return this.sigv4Signer.signWithCredentials(r,s,f)}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,f={}){if(f.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,f)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=rs.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 Hr=M(ns(),1);var mr={["required"]:!1,["type"]:"String"},gr={["required"]:!0,default:!1,["type"]:"Boolean"},zr={["required"]:!1,["type"]:"Boolean"},Y={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},$={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},N={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},C={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},Ra={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},yl={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},as={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},X={["ref"]:"Bucket"},W={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},ls={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},da={["ref"]:"url"},Ia={["fn"]:"uriEncode",["argv"]:[X],["assign"]:"uri_encoded_bucket"},q={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},w={},Ea={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[X,!1]},lf={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},hs={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},Ul={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},Tl={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},A={["fn"]:"not",["argv"]:[C]},Cl={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},cl={["fn"]:"not",["argv"]:[as]},zl={["ref"]:"hardwareType"},Gl={["conditions"]:[A],["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}"}]},af={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},Gg={["ref"]:"ForcePathStyle"},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},z={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},H={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[z]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},Hl={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},c={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},F={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},I={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},Kl={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Fl={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},Ll={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},hf={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[da,"isIp"]},!1]},mf={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:c,["headers"]:{}},zf={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:c,["headers"]:{}},Wl={["endpoint"]:zf,["type"]:"endpoint"},gf={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},Xl={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},fs={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},V={["ref"]:"bucketArn"},ka={["ref"]:"arnType"},wf={["fn"]:"getAttr",["argv"]:[V,"service"]},Gf={["ref"]:"accessPointName"},Zl={["conditions"]:[N],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},Ql={["conditions"]:[Y],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Vl={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},Af={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},Pa={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},Na={["fn"]:"getAttr",["argv"]:[V,"accountId"]},Sf={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},vl={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},Rf={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},df={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},If={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Jl={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},Yl={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Gr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},Bl={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},Ol={["fn"]:"aws.parseArn",["argv"]:[X]},_l={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},ql={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},jl={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},Ef={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},il={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},bl={["ref"]:"UseObjectLambdaEndpoint"},kf={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},xl={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},ol={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},nl={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},Pf={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:c,["headers"]:{}},pl={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},Nf=[{["ref"]:"Region"}],Hg=[{["ref"]:"Endpoint"}],Kg=[X],$f=[N],es=[Y],rr=[C,W],ul=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],tl=[ls],Df=[Ia],Mf=[Ea],wr=[$],ra=[{["fn"]:"substring",["argv"]:[X,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[X,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],sa=[{["conditions"]:[$],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:q,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:q,["headers"]:{}},["type"]:"endpoint"}],fa=[{["fn"]:"substring",["argv"]:[X,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[X,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],ea=[{["conditions"]:[$],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:hs,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:hs,["headers"]:{}},["type"]:"endpoint"}],Fg=[as],la=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],aa=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Lg=["*"],b=[Ra],ha=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],x=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],yf=[{["fn"]:"stringEquals",["argv"]:[ka,"accesspoint"]}],ma=[{["fn"]:"getAttr",["argv"]:[V,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Gf,""]}]}],Wg=[V,"resourceId[1]"],Uf=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]},""]}]}],ga=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"resourceId[2]"]}]}]}],Xg=[V,"resourceId[2]"],Tf=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]}],["assign"]:"bucketPartition"}],wa=[{["fn"]:"stringEquals",["argv"]:[Pa,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],Cf=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]},!0]}],cf=[{["fn"]:"isValidHostLabel",["argv"]:[Na,!1]}],Aa=[{["fn"]:"isValidHostLabel",["argv"]:[Gf,!1]}],Sa=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],Zg={version:"1.0",parameters:{Bucket:mr,Region:mr,UseFIPS:gr,UseDualStack:gr,Endpoint:mr,ForcePathStyle:gr,Accelerate:gr,UseGlobalEndpoint:gr,UseObjectLambdaEndpoint:zr,Key:mr,Prefix:mr,CopySource:mr,DisableAccessPoints:zr,DisableMultiRegionAccessPoints:gr,UseArnRegion:zr,UseS3ExpressControlEndpoint:zr,DisableS3ExpressSessionAuth:zr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:Nf}],rules:[{["conditions"]:[Y,$],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[N,C],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[C,$],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[C,Y],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[$,Ra,yl],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[as,{["fn"]:"substring",["argv"]:[X,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:$f,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:es,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:rr,rules:[{["conditions"]:ul,rules:[{["conditions"]:tl,rules:[{["conditions"]:Df,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Mf,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},lf],["type"]:"tree"},{["conditions"]:tl,rules:[{["conditions"]:Df,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:hs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Mf,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:hs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},lf],["type"]:"tree"},{["conditions"]:[Ul,Tl],rules:[{["conditions"]:[Ia,A],rules:[{["conditions"]:wr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:q,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Mf,rules:[{["conditions"]:ul,rules:[{["conditions"]:ra,rules:sa,["type"]:"tree"},{["conditions"]:fa,rules:sa,["type"]:"tree"},Cl],["type"]:"tree"},{["conditions"]:ra,rules:ea,["type"]:"tree"},{["conditions"]:fa,rules:ea,["type"]:"tree"},Cl],["type"]:"tree"},lf],["type"]:"tree"},{["conditions"]:[cl,Ul,Tl],rules:[{["conditions"]:rr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:q,["headers"]:w},["type"]:"endpoint"},{["conditions"]:wr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:q,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[as,{["fn"]:"substring",["argv"]:[X,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[X,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[X,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[X,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:Nf,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:la,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[zl,"e"]}],rules:[{["conditions"]:aa,rules:[Gl,{["conditions"]:rr,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"]:[zl,"o"]}],rules:[{["conditions"]:aa,rules:[Gl,{["conditions"]:rr,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"]:Fg,rules:[{["conditions"]:[C,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Hg}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[af,Ea],rules:[{["conditions"]:b,rules:[{["conditions"]:ha,rules:[{["conditions"]:[Y,yl],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[N,$,T,A,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,$,T,A,E,K],rules:[{endpoint:Hl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,$,T,A,E,F],endpoint:Hl,["type"]:"endpoint"},{["conditions"]:[I,$,T,A,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,$,T,A,E,K],rules:[{endpoint:Kl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,$,T,A,E,F],endpoint:Kl,["type"]:"endpoint"},{["conditions"]:[N,R,Y,A,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,R,Y,A,E,K],rules:[{endpoint:Fl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,R,Y,A,E,F],endpoint:Fl,["type"]:"endpoint"},{["conditions"]:[N,R,T,A,z],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,R,T,A,E,K],rules:[{endpoint:Ll,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,R,T,A,E,F],endpoint:Ll,["type"]:"endpoint"},{["conditions"]:[I,R,T,C,W,ls,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,T,C,W,hf,z],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,T,C,W,ls,E,K],rules:[{["conditions"]:x,endpoint:mf,["type"]:"endpoint"},{endpoint:mf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,T,C,W,hf,E,K],rules:[{["conditions"]:x,endpoint:zf,["type"]:"endpoint"},Wl],["type"]:"tree"},{["conditions"]:[I,R,T,C,W,ls,E,F],endpoint:mf,["type"]:"endpoint"},{["conditions"]:[I,R,T,C,W,hf,E,F],endpoint:zf,["type"]:"endpoint"},{["conditions"]:[I,R,Y,A,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,Y,A,E,K],rules:[{["conditions"]:x,endpoint:gf,["type"]:"endpoint"},{endpoint:gf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,Y,A,E,F],endpoint:gf,["type"]:"endpoint"},{["conditions"]:[I,R,T,A,z],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,T,A,E,K],rules:[{["conditions"]:x,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:w},["type"]:"endpoint"},{endpoint:Xl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,T,A,E,F],endpoint:Xl,["type"]:"endpoint"}],["type"]:"tree"},fs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[C,W,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[da,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[X,!0]},af,R,I,T],rules:[{["conditions"]:b,rules:[{["conditions"]:ha,rules:[Wl],["type"]:"tree"},fs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[af,{["fn"]:"aws.parseArn",["argv"]:Kg,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[V,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[ka,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[wf,"s3-object-lambda"]}],rules:[{["conditions"]:yf,rules:[{["conditions"]:ma,rules:[Zl,Ql,{["conditions"]:Uf,rules:[Vl,{["conditions"]:ga,rules:[Af,{["conditions"]:Tf,rules:[{["conditions"]:b,rules:[{["conditions"]:wa,rules:[{["conditions"]:Cf,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Na,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:cf,rules:[{["conditions"]:Aa,rules:[{["conditions"]:rr,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Sf,["headers"]:w},["type"]:"endpoint"},{["conditions"]:wr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Sf,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Sf,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},vl],["type"]:"tree"},Rf],["type"]:"tree"},df],["type"]:"tree"},If],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Jl],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},Yl],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:yf,rules:[{["conditions"]:ma,rules:[{["conditions"]:Uf,rules:[{["conditions"]:yf,rules:[{["conditions"]:Uf,rules:[Vl,{["conditions"]:ga,rules:[Af,{["conditions"]:Tf,rules:[{["conditions"]:b,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Pa,"{partitionResult#name}"]}],rules:[{["conditions"]:Cf,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[wf,"s3"]}],rules:[{["conditions"]:cf,rules:[{["conditions"]:Aa,rules:[{["conditions"]:es,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[$,N],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Gr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[$,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Gr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,N],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Gr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,C,W],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Gr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Gr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},vl],["type"]:"tree"},Rf],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},df],["type"]:"tree"},If],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Jl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[Gf,!0]}],rules:[{["conditions"]:$f,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:wr,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:es,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"]:Nf,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[V,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:Lg}]},["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"},Yl],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[wf,"s3-outposts"]}],rules:[{["conditions"]:$f,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:wr,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:es,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:Wg,["assign"]:"outpostId"}],rules:[{["conditions"]:la,rules:[Af,{["conditions"]:Tf,rules:[{["conditions"]:b,rules:[{["conditions"]:wa,rules:[{["conditions"]:Cf,rules:[{["conditions"]:cf,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:Xg,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[V,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:rr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:Bl,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Bl,["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"},Rf],["type"]:"tree"},df],["type"]:"tree"},If],["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"]:[X,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[Ol]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[Gg,!0]},Ol],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:Df,rules:[{["conditions"]:b,rules:[{["conditions"]:[T],rules:[{["conditions"]:[N,A,$,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,A,$,E,K],rules:[{endpoint:_l,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,A,$,E,F],endpoint:_l,["type"]:"endpoint"},{["conditions"]:[I,A,$,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,A,$,E,K],rules:[{endpoint:ql,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,A,$,E,F],endpoint:ql,["type"]:"endpoint"},{["conditions"]:[N,A,R,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,A,R,E,K],rules:[{endpoint:jl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,A,R,E,F],endpoint:jl,["type"]:"endpoint"},{["conditions"]:[I,C,W,R,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,C,W,R,E,K],rules:[{["conditions"]:x,endpoint:Ef,["type"]:"endpoint"},{endpoint:Ef,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,C,W,R,E,F],endpoint:Ef,["type"]:"endpoint"},{["conditions"]:[I,A,R,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,A,R,E,K],rules:[{["conditions"]:x,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:w},["type"]:"endpoint"},{endpoint:il,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,A,R,E,F],endpoint:il,["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"]:[bl]},{["fn"]:"booleanEquals",["argv"]:[bl,!0]}],rules:[{["conditions"]:b,rules:[{["conditions"]:Sa,rules:[Zl,Ql,{["conditions"]:rr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:kf,["headers"]:w},["type"]:"endpoint"},{["conditions"]:wr,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:kf,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:kf,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},fs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[cl],rules:[{["conditions"]:b,rules:[{["conditions"]:Sa,rules:[{["conditions"]:[$,N,A,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[$,N,A,E,K],rules:[{endpoint:xl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,N,A,E,F],endpoint:xl,["type"]:"endpoint"},{["conditions"]:[$,I,A,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[$,I,A,E,K],rules:[{endpoint:ol,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,I,A,E,F],endpoint:ol,["type"]:"endpoint"},{["conditions"]:[R,N,A,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,N,A,E,K],rules:[{endpoint:nl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,N,A,E,F],endpoint:nl,["type"]:"endpoint"},{["conditions"]:[R,I,C,W,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,C,W,E,K],rules:[{["conditions"]:x,endpoint:Pf,["type"]:"endpoint"},{endpoint:Pf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,I,C,W,E,F],endpoint:Pf,["type"]:"endpoint"},{["conditions"]:[R,I,A,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,A,E,K],rules:[{["conditions"]:x,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:w},["type"]:"endpoint"},{endpoint:pl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,I,A,E,F],endpoint:pl,["type"]:"endpoint"}],["type"]:"tree"},fs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},$a=Zg;var ms=(r,s={})=>{return Ma($a,{endpointParams:r,logger:s.logger})};Da.aws=ya;var Ca=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,f)=>({signingProperties:{config:s,context:f}})}},ca=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,f)=>({signingProperties:{config:s,context:f}})}},Qg=(r)=>async(s,f,e)=>{if(!e)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const l=await r(s,f,e),a=Hr.getSmithyContext(f)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!a)throw new Error(`getEndpointParameterInstructions() is not defined on \`${f.commandName}\``);const h=await Ua(e,{getEndpointParameterInstructions:a},s);return Object.assign(l,h)},Vg=async(r,s,f)=>{return{operation:Hr.getSmithyContext(s).operation,region:await Hr.normalizeProvider(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Ta=Qg(Vg),vg=(r,s,f)=>{return(l)=>{const h=r(l).properties?.authSchemes;if(!h)return s(l);const m=[];for(let g of h){const{name:S,properties:d={},...k}=g,P=S.toLowerCase();if(S!==P)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${S}\` to \`${P}\``);let U;if(P==="sigv4a"){U="aws.auth#sigv4a";const Yr=h.find((_)=>{const Dr=_.name.toLowerCase();return Dr!=="sigv4a"&&Dr.startsWith("sigv4")});if(!rs.CrtSignerV4&&Yr)continue}else if(P.startsWith("sigv4"))U="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${P}\``);const D=f[U];if(!D)throw new Error(`Could not find HttpAuthOption create function for \`${U}\``);const Q=D(l);Q.schemeId=U,Q.signingProperties={...Q.signingProperties||{},...k,...d},m.push(Q)}return m}},Jg=(r)=>{const s=[];switch(r.operation){default:s.push(Ca(r)),s.push(ca(r))}return s},za=vg(ms,Jg,{"aws.auth#sigv4":Ca,"aws.auth#sigv4a":ca}),Ga=(r)=>{const s=ws.resolveAwsSdkSigV4Config(r);return{...ws.resolveAwsSdkSigV4AConfig(s)}};var Wh=M(he(),1);var Ha=(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"}},Ar={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 Z extends Ka{constructor(r){super(r);Object.setPrototypeOf(this,Z.prototype)}}class As extends Z{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,As.prototype)}}class Ss extends Z{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Ss.prototype)}}class Rs extends Z{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,Rs.prototype)}}class ds extends Z{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,ds.prototype)}}class Is extends Z{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,Is.prototype)}}var Hf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Hf||(Hf={}));var Kf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return f.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return f.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Kf||(Kf={}));var Ff;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.AccessPointArn!==void 0)return f.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Ff||(Ff={}));var Lf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Lf||(Lf={}));class Es extends Z{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,Es.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class ks extends Z{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,ks.prototype)}}class Ps extends Z{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,Ps.prototype)}}var Yg=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:B},...r.SessionToken&&{SessionToken:B}}),Fa=(r)=>({...r,...r.Credentials&&{Credentials:Yg(r.Credentials)}});var La=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:B}}),Wa=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:B}});var dr=M(gs(),1);var ys=M(rf(),1);class Ns extends Z{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Ns.prototype)}}var Xa;(function(r){r.visit=(s,f)=>{if(s.Records!==void 0)return f.Records(s.Records);if(s.Stats!==void 0)return f.Stats(s.Stats);if(s.Progress!==void 0)return f.Progress(s.Progress);if(s.Cont!==void 0)return f.Cont(s.Cont);if(s.End!==void 0)return f.End(s.End);return f._(s.$unknown[0],s.$unknown[1])}})(Xa||(Xa={}));var Za=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:B},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:B}}),Qa=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:B},...r.SSEKMSKeyId&&{SSEKMSKeyId:B},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:B}});var oa=async(r,s)=>{const f=ys.requestBuilder(r,s),e=G({},j,{[ow]:r[cw]});f.bp("/"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const l=G({[jw]:[,""]});let a;return f.m("GET").h(e).q(l).b(a),f.build()};var na=async(r,s)=>{const f=ys.requestBuilder(r,s),e=G({},j,{[Ww]:r[Sw],[Xw]:[()=>j(r[Va]),()=>Kr(r[Va]).toString()],[Zw]:r[Rw],[Qw]:[()=>j(r[va]),()=>Kr(r[va]).toString()],[vw]:r[Pw],[Cs]:r[Us],[Hh]:r[Rh],[cs]:r[Ts],[ch]:r[Sh],[yh]:r[hh],[xw]:r[fw]});f.bp("/{Key+}"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1),f.p("Key",()=>r.Key,"{Key+}",!0);const l=G({[Lh]:[,"GetObject"],[Jw]:[,r[Nw]],[Yw]:[,r[$w]],[Bw]:[,r[Dw]],[Ow]:[,r[Mw]],[_w]:[,r[yw]],[qw]:[()=>r.ResponseExpires!==void 0,()=>Kr(r[Uw]).toString()],[iw]:[,r[tf]],[Vw]:[()=>r.PartNumber!==void 0,()=>r[kw].toString()]});let a;return f.m("GET").h(e).q(l).b(a),f.build()};var pa=async(r,s)=>{const f=ys.requestBuilder(r,s),e=G({},j,{[$h]:r[ah]||"application/octet-stream",[bw]:r[tg],[Eh]:r[sh],[kh]:r[fh],[Ph]:r[eh],[Nh]:r[lh],[Bf]:[()=>j(r[vf]),()=>r[vf].toString()],[Kw]:r[ew],[fA]:r[sw],[re]:r[bf],[se]:r[xf],[fe]:r[of],[ee]:r[nf],[Of]:[()=>j(r[Jf]),()=>Kr(r[Jf]).toString()],[nw]:r[mw],[pw]:r[gw],[uw]:r[ww],[tw]:r[Aw],[le]:r[pf],[zh]:r[Lr],[Fh]:r[Ih],[Cs]:r[Us],[Hh]:r[Rh],[cs]:r[Ts],[ae]:r[uf],[Gh]:r[dh],[Wr]:[()=>j(r[Ms]),()=>r[Ms].toString()],[ch]:r[Sh],[eA]:r[zw],[Th]:r[wh],[_f]:[()=>j(r[Yf]),()=>xa(r[Yf]).toString()],[Uh]:r[gh],[yh]:r[hh],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((m,g)=>{return m[`x-amz-meta-${g.toLowerCase()}`]=r.Metadata[g],m},{})});f.bp("/{Key+}"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1),f.p("Key",()=>r.Key,"{Key+}",!0);const l=G({[Lh]:[,"PutObject"]});let a,h;if(r.Body!==void 0)h=r.Body,a=h;return f.m("PUT").h(e).q(l).b(a),f.build()};var ua=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return jf(r,s);const f=G({$metadata:J(r)}),e=Sr(ja(await dr.parseXmlBody(r.body,s)),"body");if(e[Zf]!=null)f[Zf]=ug(e[Zf],s);return f};var ta=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return jf(r,s);const f=G({$metadata:J(r),[aw]:[()=>r.headers[Ya]!==void 0,()=>Ds(r.headers[Ya])],[rw]:[,r.headers[Hw]],[Fr]:[,r.headers[Mh]],[Cw]:[,r.headers[rA]],[dw]:[()=>r.headers[Ja]!==void 0,()=>Sr(Mr(r.headers[Ja]))],[vf]:[()=>r.headers[Bf]!==void 0,()=>ia(r.headers[Bf])],[mh]:[,r.headers[Dh]],[bf]:[,r.headers[re]],[xf]:[,r.headers[se]],[of]:[,r.headers[fe]],[nf]:[,r.headers[ee]],[Iw]:[()=>r.headers[Ba]!==void 0,()=>$s(r.headers[Ba])],[tf]:[,r.headers[Kh]],[sh]:[,r.headers[Eh]],[fh]:[,r.headers[kh]],[eh]:[,r.headers[Ph]],[lh]:[,r.headers[Nh]],[lw]:[,r.headers[Fw]],[ah]:[,r.headers[$h]],[Jf]:[()=>r.headers[Of]!==void 0,()=>Sr(Mr(r.headers[Of]))],[hw]:[,r.headers[Lw]],[Ih]:[,r.headers[Fh]],[pf]:[,r.headers[le]],[Us]:[,r.headers[Cs]],[Ts]:[,r.headers[cs]],[uf]:[,r.headers[ae]],[Ms]:[()=>r.headers[Wr]!==void 0,()=>Ds(r.headers[Wr])],[Lr]:[,r.headers[zh]],[Ah]:[,r.headers[Ch]],[Tw]:[,r.headers[sA]],[Ew]:[()=>r.headers[Oa]!==void 0,()=>$s(r.headers[Oa])],[Gw]:[()=>r.headers[_a]!==void 0,()=>$s(r.headers[_a])],[wh]:[,r.headers[Th]],[Yf]:[()=>r.headers[_f]!==void 0,()=>Sr(qf(r.headers[_f]))],[gh]:[,r.headers[Uh]],Metadata:[,Object.keys(r.headers).filter((l)=>l.startsWith("x-amz-meta-")).reduce((l,a)=>{return l[a.substring(11)]=r.headers[a],l},{})]}),e=r.body;return s.sdkStreamMixin(e),f.Body=e,f};var rh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return jf(r,s);const f=G({$metadata:J(r),[Fr]:[,r.headers[Mh]],[mh]:[,r.headers[Dh]],[bf]:[,r.headers[re]],[xf]:[,r.headers[se]],[of]:[,r.headers[fe]],[nf]:[,r.headers[ee]],[pf]:[,r.headers[le]],[tf]:[,r.headers[Kh]],[Us]:[,r.headers[Cs]],[Ts]:[,r.headers[cs]],[uf]:[,r.headers[ae]],[dh]:[,r.headers[Gh]],[Ms]:[()=>r.headers[Wr]!==void 0,()=>Ds(r.headers[Wr])],[Ah]:[,r.headers[Ch]]});return await qa(r.body,s),f};var jf=async(r,s)=>{const f={...r,body:await dr.parseXmlErrorBody(r.body,s)},e=dr.loadRestXmlErrorCode(r,f.body);switch(e){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await xg(f,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await pg(f,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await _g(f,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await qg(f,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await ig(f,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await jg(f,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await bg(f,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await og(f,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await ng(f,s);default:const l=f.body;return Og({output:r,parsedBody:l,errorCode:e})}},Og=ba(Z),_g=async(r,s)=>{const f=G({}),e=r.body,l=new Rs({$metadata:J(r),...f});return O(l,r.body)},qg=async(r,s)=>{const f=G({}),e=r.body,l=new ds({$metadata:J(r),...f});return O(l,r.body)},jg=async(r,s)=>{const f=G({}),e=r.body;if(e[Xf]!=null)f[Xf]=Rr(e[Xf]);if(e[Lr]!=null)f[Lr]=Rr(e[Lr]);const l=new Es({$metadata:J(r),...f});return O(l,r.body)},ig=async(r,s)=>{const f=G({}),e=r.body,l=new Is({$metadata:J(r),...f});return O(l,r.body)},bg=async(r,s)=>{const f=G({}),e=r.body,l=new ks({$metadata:J(r),...f});return O(l,r.body)},xg=async(r,s)=>{const f=G({}),e=r.body,l=new As({$metadata:J(r),...f});return O(l,r.body)},og=async(r,s)=>{const f=G({}),e=r.body,l=new Ps({$metadata:J(r),...f});return O(l,r.body)},ng=async(r,s)=>{const f=G({}),e=r.body,l=new Ns({$metadata:J(r),...f});return O(l,r.body)},pg=async(r,s)=>{const f=G({}),e=r.body,l=new Ss({$metadata:J(r),...f});return O(l,r.body)};var ug=(r,s)=>{const f={};if(r[Wf]!=null)f[Wf]=Rr(r[Wf]);if(r[Qf]!=null)f[Qf]=Rr(r[Qf]);if(r[Vf]!=null)f[Vf]=Rr(r[Vf]);if(r[Fr]!=null)f[Fr]=Sr(qf(r[Fr]));return f};var J=(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 j=(r)=>r!==void 0&&r!==null&&r!==""&&(!Object.getOwnPropertyNames(r).includes("length")||r.length!=0)&&(!Object.getOwnPropertyNames(r).includes("size")||r.size!=0);var tg="ACL";var Wf="AccessKeyId";var rw="AcceptRanges";var Xf="AccessTier";var Ms="BucketKeyEnabled";var Zf="Credentials",sw="ChecksumAlgorithm";var sh="CacheControl",bf="ChecksumCRC32",xf="ChecksumCRC32C",fh="ContentDisposition";var eh="ContentEncoding";var lh="ContentLanguage",vf="ContentLength",fw="ChecksumMode",ew="ContentMD5";var lw="ContentRange";var of="ChecksumSHA1",nf="ChecksumSHA256";var ah="ContentType";var aw="DeleteMarker";var Jf="Expires";var hh="ExpectedBucketOwner";var hw="ExpiresString";var mh="ETag";var Fr="Expiration";var mw="GrantFullControl";var gw="GrantRead",ww="GrantReadACP";var Aw="GrantWriteACP";var Sw="IfMatch",Va="IfModifiedSince",Rw="IfNoneMatch";var va="IfUnmodifiedSince";var dw="LastModified";var Iw="MissingMeta";var gh="ObjectLockLegalHoldStatus",wh="ObjectLockMode";var Yf="ObjectLockRetainUntilDate";var Ew="PartsCount";var kw="PartNumber";var Pw="Range";var Ah="RequestCharged",Nw="ResponseCacheControl",$w="ResponseContentDisposition",Dw="ResponseContentEncoding",Mw="ResponseContentLanguage",yw="ResponseContentType";var Uw="ResponseExpires";var Sh="RequestPayer";var Tw="ReplicationStatus";var Cw="Restore";var Qf="SecretAccessKey";var Lr="StorageClass";var cw="SessionMode";var pf="ServerSideEncryption";var Us="SSECustomerAlgorithm",Rh="SSECustomerKey",Ts="SSECustomerKeyMD5";var dh="SSEKMSEncryptionContext",uf="SSEKMSKeyId";var Vf="SessionToken";var zw="Tagging";var Gw="TagCount";var tf="VersionId";var Ih="WebsiteRedirectLocation";var Hw="accept-ranges";var Eh="cache-control",kh="content-disposition",Ph="content-encoding",Nh="content-language",Bf="content-length",Kw="content-md5",Fw="content-range",$h="content-type";var Of="expires";var Dh="etag",Lw="expiresstring";var Ww="if-match",Xw="if-modified-since";var Zw="if-none-match";var Qw="if-unmodified-since";var Ja="last-modified";var Vw="partNumber";var vw="range",Jw="response-cache-control",Yw="response-content-disposition",Bw="response-content-encoding",Ow="response-content-language",_w="response-content-type",qw="response-expires";var jw="session";var iw="versionId";var bw="x-amz-acl";var re="x-amz-checksum-crc32",se="x-amz-checksum-crc32c",xw="x-amz-checksum-mode";var fe="x-amz-checksum-sha1",ee="x-amz-checksum-sha256";var ow="x-amz-create-session-mode";var Ya="x-amz-delete-marker",Mh="x-amz-expiration",yh="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 Ba="x-amz-missing-meta";var Oa="x-amz-mp-parts-count";var Uh="x-amz-object-lock-legal-hold",Th="x-amz-object-lock-mode",_f="x-amz-object-lock-retain-until-date";var rA="x-amz-restore",Ch="x-amz-request-charged";var ch="x-amz-request-payer";var sA="x-amz-replication-status";var zh="x-amz-storage-class",fA="x-amz-sdk-checksum-algorithm";var le="x-amz-server-side-encryption",ae="x-amz-server-side-encryption-aws-kms-key-id",Wr="x-amz-server-side-encryption-bucket-key-enabled",Gh="x-amz-server-side-encryption-context",Cs="x-amz-server-side-encryption-customer-algorithm",Hh="x-amz-server-side-encryption-customer-key",cs="x-amz-server-side-encryption-customer-key-md5",eA="x-amz-tagging",_a="x-amz-tagging-count";var Kh="x-amz-version-id",Fh="x-amz-website-redirect-location",Lh="x-id";class me extends Ir.classBuilder().ep({...Ar,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,f,e){return[Wh.getSerdePlugin(f,this.serialize,this.deserialize),Er(f,r.getEndpointParameterInstructions()),tr(f)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(void 0,Fa).ser(oa).de(ua).build(){}var Xh={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.629.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.629.0","@aws-sdk/client-sts":"3.629.0","@aws-sdk/core":"3.629.0","@aws-sdk/credential-provider-node":"3.629.0","@aws-sdk/middleware-bucket-endpoint":"3.620.0","@aws-sdk/middleware-expect-continue":"3.620.0","@aws-sdk/middleware-flexible-checksums":"3.620.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-location-constraint":"3.609.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-sdk-s3":"3.629.0","@aws-sdk/middleware-ssec":"3.609.0","@aws-sdk/middleware-user-agent":"3.620.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/signature-v4-multi-region":"3.629.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.614.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@aws-sdk/xml-builder":"3.609.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.3.2","@smithy/eventstream-serde-browser":"^3.0.6","@smithy/eventstream-serde-config-resolver":"^3.0.3","@smithy/eventstream-serde-node":"^3.0.5","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-blob-browser":"^3.1.2","@smithy/hash-node":"^3.0.3","@smithy/hash-stream-node":"^3.1.2","@smithy/invalid-dependency":"^3.0.3","@smithy/md5-js":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.14","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.1.12","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@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.14","@smithy/util-defaults-mode-node":"^3.0.14","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-stream":"^3.1.3","@smithy/util-utf8":"^3.0.0","@smithy/util-waiter":"^3.1.2",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.629.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 Xs=M(gs(),1);var aA="AWS_S3_USE_ARN_REGION",hA="s3_use_arn_region",Zh={environmentVariableSelector:(r)=>u(r,aA,t.ENV),configFileSelector:(r)=>u(r,hA,t.CONFIG),default:!1};var Qh=M(kA(),1),{__extends:Rd,__assign:dd,__rest:Id,__decorate:Ed,__param:kd,__esDecorate:Pd,__runInitializers:Nd,__propKey:$d,__setFunctionName:Dd,__metadata:Md,__awaiter:zs,__generator:Gs,__exportStar:yd,__createBinding:Ud,__values:Hs,__read:Td,__spread:Cd,__spreadArrays:cd,__spreadArray:zd,__await:Gd,__asyncGenerator:Hd,__asyncDelegator:Kd,__asyncValues:Fd,__makeTemplateObject:Ld,__importStar:Wd,__importDefault:Xd,__classPrivateFieldGet:Zd,__classPrivateFieldSet:Qd,__classPrivateFieldIn:Vd,__addDisposableResource:vd,__disposeResources:Jd}=Qh.default;import{Buffer as Vh} from"buffer";var vh=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?Vh.from(r,s):Vh.from(r)};var ge=(r)=>{const s=vh(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function Xr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return PA(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var PA=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:ge;function Zr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Qr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Vr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),f=0;while(f<r.length)s[f]=r[f],f+=1;return s}return Uint32Array.from(r)}var we=function(){function r(){this.crc32=new sr}return r.prototype.update=function(s){if(Zr(s))return;this.crc32.update(Xr(s))},r.prototype.digest=function(){return zs(this,void 0,void 0,function(){return Gs(this,function(s){return[2,Qr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new sr},r}();var sr=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var f,e;try{for(var l=Hs(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^$A[(this.checksum^h)&255]}}catch(m){f={error:m}}finally{try{if(a&&!a.done&&(e=l.return))e.call(l)}finally{if(f)throw f.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var NA=[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],$A=Vr(NA);var o=M(hr(),1);var Yh=M(hr(),1),Jh=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 kr{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 f=7,e=Math.abs(Math.round(r));f>-1&&e>0;f--,e/=256)s[f]=e;if(r<0)Jh(s);return new kr(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Jh(r);return parseInt(Yh.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class Ae{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let l of Object.keys(r)){const a=this.fromUtf8(l);s.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(r[l]))}const f=new Uint8Array(s.reduce((l,a)=>l+a.byteLength,0));let e=0;for(let l of s)f.set(l,e),e+=l.byteLength;return f}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 f=new DataView(new ArrayBuffer(5));return f.setUint8(0,4),f.setInt32(1,r.value,!1),new Uint8Array(f.buffer);case"long":const e=new Uint8Array(9);return e[0]=5,e.set(r.value.bytes,1),e;case"binary":const l=new DataView(new ArrayBuffer(3+r.value.byteLength));l.setUint8(0,6),l.setUint16(1,r.value.byteLength,!1);const a=new Uint8Array(l.buffer);return a.set(r.value,3),a;case"string":const h=this.fromUtf8(r.value),m=new DataView(new ArrayBuffer(3+h.byteLength));m.setUint8(0,7),m.setUint16(1,h.byteLength,!1);const g=new Uint8Array(m.buffer);return g.set(h,3),g;case"timestamp":const S=new Uint8Array(9);return S[0]=8,S.set(kr.fromNumber(r.value.valueOf()).bytes,1),S;case"uuid":if(!GA.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(o.fromHex(r.value.replace(/\-/g,"")),1),d}}parse(r){const s={};let f=0;while(f<r.byteLength){const e=r.getUint8(f++),l=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+f,e));switch(f+=e,r.getUint8(f++)){case 0:s[l]={type:Oh,value:!0};break;case 1:s[l]={type:Oh,value:!1};break;case 2:s[l]={type:DA,value:r.getInt8(f++)};break;case 3:s[l]={type:MA,value:r.getInt16(f,!1)},f+=2;break;case 4:s[l]={type:yA,value:r.getInt32(f,!1)},f+=4;break;case 5:s[l]={type:UA,value:new kr(new Uint8Array(r.buffer,r.byteOffset+f,8))},f+=8;break;case 6:const a=r.getUint16(f,!1);f+=2,s[l]={type:TA,value:new Uint8Array(r.buffer,r.byteOffset+f,a)},f+=a;break;case 7:const h=r.getUint16(f,!1);f+=2,s[l]={type:CA,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+f,h))},f+=h;break;case 8:s[l]={type:cA,value:new Date(new kr(new Uint8Array(r.buffer,r.byteOffset+f,8)).valueOf())},f+=8;break;case 9:const m=new Uint8Array(r.buffer,r.byteOffset+f,16);f+=16,s[l]={type:zA,value:`${o.toHex(m.subarray(0,4))}-${o.toHex(m.subarray(4,6))}-${o.toHex(m.subarray(6,8))}-${o.toHex(m.subarray(8,10))}-${o.toHex(m.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var Bh;(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"})(Bh||(Bh={}));var Oh="boolean",DA="byte",MA="short",yA="integer",UA="long",TA="binary",CA="string",cA="timestamp",zA="uuid",GA=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function qh({byteLength:r,byteOffset:s,buffer:f}){if(r<HA)throw new Error("Provided message too short to accommodate event stream message overhead");const e=new DataView(f,s,r),l=e.getUint32(0,!1);if(r!==l)throw new Error("Reported message length does not match received message length");const a=e.getUint32(_h,!1),h=e.getUint32(n,!1),m=e.getUint32(r-fr,!1),g=new sr().update(new Uint8Array(f,s,n));if(h!==g.digest())throw new Error(`The prelude checksum specified in the message (${h}) does not match the calculated CRC32 checksum (${g.digest()})`);if(g.update(new Uint8Array(f,s+n,r-(n+fr))),m!==g.digest())throw new Error(`The message checksum (${g.digest()}) did not match the expected value of ${m}`);return{headers:new DataView(f,s+n+fr,a),body:new Uint8Array(f,s+n+fr+a,l-a-(n+fr+fr))}}var _h=4,n=_h*2,fr=4,HA=n+fr*2;class Se{constructor(r,s){this.headerMarshaller=new Ae(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 f=this.headerMarshaller.format(r),e=f.byteLength+s.byteLength+16,l=new Uint8Array(e),a=new DataView(l.buffer,l.byteOffset,l.byteLength),h=new sr;return a.setUint32(0,e,!1),a.setUint32(4,f.byteLength,!1),a.setUint32(8,h.update(l.subarray(0,8)).digest(),!1),l.set(f,12),l.set(s,f.byteLength+12),a.setUint32(e-4,h.update(l.subarray(8,e-4)).digest(),!1),l}decode(r){const{headers:s,body:f}=qh(r);return{headers:this.headerMarshaller.parse(s),body:f}}formatHeaders(r){return this.headerMarshaller.format(r)}}class Re{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 de{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 Ie{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 Ee{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 jh(r){let s=0,f=0,e=null,l=null;const a=(m)=>{if(typeof m!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+m);s=m,f=4,e=new Uint8Array(m),new DataView(e.buffer).setUint32(0,m,!1)},h=async function*(){const m=r[Symbol.asyncIterator]();while(!0){const{value:g,done:S}=await m.next();if(S){if(!s)return;else if(s===f)yield e;else throw new Error("Truncated event message received.");return}const d=g.length;let k=0;while(k<d){if(!e){const U=d-k;if(!l)l=new Uint8Array(4);const D=Math.min(4-f,U);if(l.set(g.slice(k,k+D),f),f+=D,k+=D,f<4)break;a(new DataView(l.buffer).getUint32(0,!1)),l=null}const P=Math.min(s-f,d-k);if(e.set(g.slice(k,k+P),f),f+=P,k+=P,s&&s===f)yield e,e=null,s=0,f=0}}};return{[Symbol.asyncIterator]:h}}function ih(r,s){return async function(f){const{value:e}=f.headers[":message-type"];if(e==="error"){const l=new Error(f.headers[":error-message"].value||"UnknownError");throw l.name=f.headers[":error-code"].value,l}else if(e==="exception"){const l=f.headers[":exception-type"].value,a={[l]:f},h=await r(a);if(h.$unknown){const m=new Error(s(f.body));throw m.name=l,m}throw h[l]}else if(e==="event"){const l={[f.headers[":event-type"].value]:f},a=await r(l);if(a.$unknown)return;return a}else throw Error(`Unrecognizable event type: ${f.headers[":event-type"].value}`)}}class Ks{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new Se(r,s),this.utfEncoder=r}deserialize(r,s){const f=jh(r);return new Ie({messageStream:new Re({inputStream:f,decoder:this.eventStreamCodec}),deserializer:ih(s,this.utfEncoder)})}serialize(r,s){return new de({messageStream:new Ee({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as KA} from"stream";async function*bh(r){let s=!1,f=!1;const e=new Array;r.on("error",(l)=>{if(!s)s=!0;if(l)throw l}),r.on("data",(l)=>{e.push(l)}),r.on("end",()=>{s=!0});while(!f){const l=await new Promise((a)=>setTimeout(()=>a(e.shift()),0));if(l)yield l;f=s&&e.length===0}}class ke{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Ks({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const f=typeof r[Symbol.asyncIterator]==="function"?r:bh(r);return this.universalMarshaller.deserialize(f,s)}serialize(r,s){return KA.from(this.universalMarshaller.serialize(r,s))}}var xh=(r)=>new ke(r);import{Writable as FA} from"stream";class Fs extends FA{constructor(r,s){super(s);this.hash=r}_write(r,s,f){try{this.hash.update(v(r))}catch(e){return f(e)}f()}}var oh=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const f=new r,e=new Fs(f);return s.pipe(e),new Promise((l,a)=>{s.on("error",(h)=>{e.end(),a(h)}),e.on("error",a),e.on("finish",()=>{f.digest().then(l).catch(a)})})};var Ls=M(gs(),1);var fm=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??nh,base64Encoder:r?.base64Encoder??uh,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??ms,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??th,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??za,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Ls.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new Ls.AwsSdkSigV4ASigner}],logger:r?.logger??new Br,sdkStreamMixin:r?.sdkStreamMixin??rm,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??ef,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??sm,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Tr,utf8Encoder:r?.utf8Encoder??ph}};var Nm=(r)=>{hm(process.version);const s=km(r),f=()=>s().then(am),e=fm(r);return Xs.emitWarningIfUnsupportedVersion(process.version),{...e,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??Em,credentialDefaultProvider:r?.credentialDefaultProvider??Pm,defaultUserAgentProvider:r?.defaultUserAgentProvider??Im({serviceId:e.serviceId,clientVersion:Xh.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??i(us),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??xh,maxAttempts:r?.maxAttempts??i(Rm),md5:r?.md5??Ws.bind(null,"md5"),region:r?.region??i(wm,Am),requestHandler:em.create(r?.requestHandler??f),retryMode:r?.retryMode??i({...dm,default:async()=>(await f()).retryMode||Sm}),sha1:r?.sha1??Ws.bind(null,"sha1"),sha256:r?.sha256??Ws.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??i(Xs.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??lm,streamHasher:r?.streamHasher??oh,useArnRegion:r?.useArnRegion??i(Zh),useDualstackEndpoint:r?.useDualstackEndpoint??i(mm),useFipsEndpoint:r?.useFipsEndpoint??i(gm)}};var $m=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:f,credentials:e}=r;return{setHttpAuthScheme(l){const a=s.findIndex((h)=>h.schemeId===l.schemeId);if(a===-1)s.push(l);else s.splice(a,1,l)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(l){f=l},httpAuthSchemeProvider(){return f},setCredentials(l){e=l},credentials(){return e}}},Dm=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var Zs=(r)=>r,zm=(r,s)=>{const f={...Zs(Cm(r)),...Zs(Um(r)),...Zs(Mm(r)),...Zs($m(r))};return s.forEach((e)=>e.configure(f)),{...r,...cm(f),...Tm(f),...ym(f),...Dm(f)}};class Pe extends Lm{constructor(...[r]){const s=Nm(r||{}),f=Ha(s),e=Wm(f),l=vm(e),a=Zm(l),h=Gm(a),m=Vm(h),g=Ml(m),S=Ga(g),d=El(S,{session:[()=>this,me]}),k=zm(d,r?.extensions||[]);super(k);this.config=k,this.middlewareStack.use(Xm(this.config)),this.middlewareStack.use(Jm(this.config)),this.middlewareStack.use(Qm(this.config)),this.middlewareStack.use(Hm(this.config)),this.middlewareStack.use(Km(this.config)),this.middlewareStack.use(Fm(this.config)),this.middlewareStack.use(Pr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Ta,identityProviderConfigProvider:async(P)=>new Pr.DefaultIdentityProviderConfig({"aws.auth#sigv4":P.credentials,"aws.auth#sigv4a":P.credentials})})),this.middlewareStack.use(Pr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(Dl(this.config)),this.middlewareStack.use(Ce(this.config)),this.middlewareStack.use(He(this.config)),this.middlewareStack.use(ts(this.config)),this.middlewareStack.use(sf(this.config))}destroy(){super.destroy()}}function LA(r){return(s)=>async(f)=>{const e={...f.input},l=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let a of l){const h=e[a.target];if(h){let m;if(typeof h==="string")if(XA(h,r))m=r.base64Decoder(h);else m=r.utf8Decoder(h),e[a.target]=r.base64Encoder(m);else m=ArrayBuffer.isView(h)?new Uint8Array(h.buffer,h.byteOffset,h.byteLength):new Uint8Array(h),e[a.target]=r.base64Encoder(m);const g=new r.md5;g.update(m),e[a.hash]=r.base64Encoder(await g.digest())}}return s({...f,input:e})}}function XA(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 WA={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},Qs=(r)=>({applyToStack:(s)=>{s.add(LA(r),WA)}});var y;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(y||(y={}));var Ym;(function(r){r.HEADER="header",r.TRAILER="trailer"})(Ym||(Ym={}));var{MD5:Bm,CRC32:Om}=y;var vr=[y.CRC32,y.CRC32C,y.SHA1,y.SHA256],_m=[y.CRC32,y.CRC32C,y.SHA1,y.SHA256];var qm=(r,{requestChecksumRequired:s,requestAlgorithmMember:f},e)=>{const l=e?Om:Bm;if(!f||!r[f])return s?l:void 0;const a=r[f];if(!vr.includes(a))throw new Error(`The checksum algorithm "${a}" is not supported by the client.`+` Select one of ${vr}.`);return a};var Nr=(r)=>r===y.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var jm=(r,s)=>{const f=r.toLowerCase();for(let e of Object.keys(s))if(f===e.toLowerCase())return!0;return!1};var $r=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!br(r);var $e=function(){function r(){this.crc32c=new Ne}return r.prototype.update=function(s){if(Zr(s))return;this.crc32c.update(Xr(s))},r.prototype.digest=function(){return zs(this,void 0,void 0,function(){return Gs(this,function(s){return[2,Qr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new Ne},r}();var Ne=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var f,e;try{for(var l=Hs(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^QA[(this.checksum^h)&255]}}catch(m){f={error:m}}finally{try{if(a&&!a.done&&(e=l.return))e.call(l)}finally{if(f)throw f.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var ZA=[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],QA=Vr(ZA);var Vs=(r,s)=>({[y.MD5]:s.md5,[y.CRC32]:we,[y.CRC32C]:$e,[y.SHA1]:s.sha1,[y.SHA256]:s.sha256})[r];var vs=(r,s)=>{const f=new r;return f.update(v(s||"")),f.digest()};var im={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},bm=(r,s)=>(f,e)=>async(l)=>{if(!L.isInstance(l.request))return f(l);const{request:a}=l,{body:h,headers:m}=a,{base64Encoder:g,streamHasher:S}=r,{input:d,requestChecksumRequired:k,requestAlgorithmMember:P}=s,U=qm(d,{requestChecksumRequired:k,requestAlgorithmMember:P},!!e.isS3ExpressBucket);let D=h,Q=m;if(U){const _=Nr(U),Dr=Vs(U,r);if($r(h)){const{getAwsChunkedEncodingStream:Bs,bodyLengthChecker:eg}=r;D=Bs(h,{base64Encoder:g,bodyLengthChecker:eg,checksumLocationName:_,checksumAlgorithmFn:Dr,streamHasher:S}),Q={...m,"content-encoding":m["content-encoding"]?`${m["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":m["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":_},delete Q["content-length"]}else if(!jm(_,m)){const Bs=await vs(Dr,h);Q={...m,[_]:g(Bs)}}}return await f({...l,request:{...a,headers:Q,body:D}})};var Js=(r=[])=>{const s=[];for(let f of _m){if(!r.includes(f)||!vr.includes(f))continue;s.push(f)}return s};var xm=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const f=r.slice(s+1);if(!f.startsWith("0")){const e=parseInt(f,10);if(!isNaN(e)&&e>=1&&e<=1e4)return!0}}return!1};import{Transform as VA} from"stream";function De(r){const s=new VA;return s.push(r),s.push(null),s}var om=async(r,{streamHasher:s,checksumAlgorithmFn:f,base64Encoder:e})=>{const l=$r(r)?s(f,r):vs(f,r);return e(await l)};var nm=async(r,{config:s,responseAlgorithms:f})=>{const e=Js(f),{body:l,headers:a}=r;for(let h of e){const m=Nr(h),g=a[m];if(g){const S=Vs(h,s),{streamHasher:d,base64Encoder:k}=s,P=await om(l,{streamHasher:d,checksumAlgorithmFn:S,base64Encoder:k});if(P===g)break;throw new Error(`Checksum mismatch: expected "${P}" but received "${g}"`+` in response header "${m}".`)}}};var pm={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},um=(r,s)=>(f,e)=>async(l)=>{if(!L.isInstance(l.request))return f(l);const a=l.input,h=await f(l),m=h.response;let g=void 0;const{requestValidationModeMember:S,responseAlgorithms:d}=s;if(S&&a[S]==="ENABLED"){const{clientName:k,commandName:P}=e;if(k==="S3Client"&&P==="GetObjectCommand"&&Js(d).every((Q)=>{const Yr=Nr(Q),_=m.headers[Yr];return!_||xm(_)}))return h;const D=$r(m.body);if(D)g=await r.streamCollector(m.body),m.body=De(g);if(await nm(h.response,{config:r,responseAlgorithms:d}),D&&g)m.body=De(g)}return h};var Ys=(r,s)=>({applyToStack:(f)=>{f.add(bm(r,s),im),f.addRelativeTo(um(r,s),pm)}});var tm=M(he(),1);class Me extends Ir.classBuilder().ep({...Ar,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,f,e){return[tm.getSerdePlugin(f,this.serialize,this.deserialize),Er(f,r.getEndpointParameterInstructions()),Ys(f,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),Qs(f),Ke(f)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(Wa,La).ser(na).de(ta).build(){}var rg=M(he(),1);class ye extends Ir.classBuilder().ep({...Ar,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,f,e){return[rg.getSerdePlugin(f,this.serialize,this.deserialize),Er(f,r.getEndpointParameterInstructions()),Ys(f,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),ce(f),tr(f),Qs(f)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(Qa,Za).ser(pa).de(rh).build(){}var fg=M(vA(),1);import{Buffer as Ue} from"buffer";var sg=new Pe;class Jr{static folder(r){if(!r||r.includes("null")||r.includes("undefined"))throw new Error("Folder path has to be specified.");return{put:async(s)=>{let f;if(s instanceof Blob)return f=`${Te()}.${s.type.split("/")[1]}`,Jr.put({body:s,name:`${r}/${f}`});return Jr.put({...s,name:`${r}/${f}`})},fetch:async(s)=>{let f=process.env.BUCKET_NAME,e;if(typeof s==="string")e=s;else f=s.bucket??f,e=s.name;if(!e)throw new Error("Object name has to be specified");return Jr.fetch({...s,name:`${r}/${e}`})}}}static async put(r){let s,f,e,l=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,e=`${Te()}.${r.type.split("/")[1]}`,f=r.type;else s=r.body,e=r.name,f=r.contentType;f=s instanceof Blob||s instanceof File?s.type:void 0;const a=s instanceof Ue?s:Ue.from(await s.arrayBuffer());return await sg.send(new ye({Bucket:l,Key:e,Body:a,ContentType:f})),e}static async metadata(r){const s=Ue.from(await r.arrayBuffer());try{return await fg.default(s).metadata()}catch{return{}}}static async fetch(r){let s=process.env.BUCKET_NAME,f;if(typeof r==="string")f=r;else s=r.bucket??s,f=r.name;if(!f)throw new Error("Object name has to be specified");const e=await sg.send(new Me({Bucket:s,Key:f}));return new Response(e.Body.transformToWebStream(),{headers:{"Content-Type":e.ContentType,"Content-Length":e.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":e.LastModified?.toUTCString()||"",ETag:e.ETag||""}})}static delete(){}}export{Jr as Storage};
11
+ ${cr.toHex(l)}`}getCanonicalPath({path:r}){if(this.uriEscapePath){const s=[];for(let l of r.split("/")){if(l?.length===0)continue;if(l===".")continue;if(l==="..")s.pop();else s.push(l)}const f=`${r?.startsWith("/")?"/":""}${s.join("/")}${s.length>0&&r?.endsWith("/")?"/":""}`;return p(f).replace(/%2F/g,"/")}return r}async getSignature(r,s,f,e){const l=await this.createStringToSign(r,s,e),a=new this.sha256(await f);return a.update(v(l)),cr.toHex(await a.digest())}getSigningKey(r,s,f,e){return ne(this.sha256,r,f,s,e||this.service)}validateResolvedCredentials(r){if(typeof r!=="object"||typeof r.accessKeyId!=="string"||typeof r.secretAccessKey!=="string")throw new Error("Resolved credential object is not valid")}}var ur=(r)=>{const s=sl(r).replace(/[\-:]/g,"");return{longDate:s,shortDate:s.slice(0,8)}},fl=(r)=>Object.keys(r).sort().join(";");var el="Directory",ll="S3Express",al="sigv4-s3express",tr="X-Amz-S3session-Token",Gr=tr.toLowerCase(),Ag="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Sg="s3_disable_express_session_auth",us={environmentVariableSelector:(r)=>u(r,Ag,t.ENV),configFileSelector:(r)=>u(r,Sg,t.CONFIG),default:!1};var hl=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},ml=function(r,s){const f=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),e=r.credentialProvider,l=()=>{return clearTimeout(f),r.credentialProvider=e,Promise.resolve(s)};r.credentialProvider=l};class rs extends ps{async signWithCredentials(r,s,f){const e=hl(s);r.headers[Gr]=s.sessionToken;const l=this;return ml(l,e),l.signRequest(r,f??{})}async presignWithCredentials(r,s,f){const e=hl(s);return delete r.headers[Gr],r.headers[tr]=s.sessionToken,r.query=r.query??{},r.query[tr]=s.sessionToken,ml(this,e),this.presign(r,f)}}var gl=(r)=>{return(s,f)=>async(e)=>{if(f.endpointV2){const l=f.endpointV2,a=l.properties?.authSchemes?.[0]?.name===al;if(l.properties?.backend===ll||l.properties?.bucketType===el)f.isS3ExpressBucket=!0;if(a){const m=e.input.Bucket;if(m){const g=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:m});if(f.s3ExpressIdentity=g,F.isInstance(e.request)&&g.sessionToken)e.request.headers[Gr]=g.sessionToken}}}return s(e)}},wl={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},ts=(r)=>({applyToStack:(s)=>{s.add(gl(r),wl)}});var Sl=L(rf(),1);var dg=L(Rg(),1);var Al=async(r,s,f,e)=>{const l=await e.signWithCredentials(f,r,{});if(l.headers["X-Amz-Security-Token"]||l.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return l};var Ig=(r)=>(s)=>{throw s},Eg=(r,s)=>{};var Rl=(r)=>(s,f)=>async(e)=>{if(!F.isInstance(e.request))return s(e);const a=Hr(f).selectedHttpAuthScheme;if(!a)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:h={}},identity:m,signer:g}=a;let S;if(f.s3ExpressIdentity)S=await Al(f.s3ExpressIdentity,h,e.request,await r.signer());else S=await g.sign(e.request,m,h);const d=await s({...e,request:S}).catch((g.errorHandler||Ig)(h));return(g.successHandler||Eg)(d.response,h),d},sf=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Rl(r),Sl.httpSigningMiddlewareOptions)}});var dl=(r,{session:s})=>{const[f,e]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new ar(async(l)=>f().send(new e({Bucket:l,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var kg={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Pg=3000,Ng=(r)=>(s,f)=>async(e)=>{const l=await s(e),{response:a}=l;if(!qr.isInstance(a))return l;const{statusCode:h,body:m}=a;if(h<200||h>=300)return l;let g=m,S=m;if(m&&typeof m==="object"&&!(m instanceof Uint8Array))[g,S]=await Il(m);a.body=S;const d=await $g(g,{streamCollector:async(P)=>{return El(P,Pg)}});if(typeof g?.destroy==="function")g.destroy();const k=r.utf8Encoder(d.subarray(d.length-16));if(d.length===0&&kg[f.commandName]){const P=new Error("S3 aborted request");throw P.name="InternalError",P}if(k&&k.endsWith("</Error>"))a.statusCode=400;return l},$g=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},Dg={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},ss=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Ng(r),Dg)}});var ff=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function kl(r){return(s,f)=>async(e)=>{if(r.bucketEndpoint){const l=f.endpointV2;if(l){const a=e.input.Bucket;if(typeof a==="string")try{const h=new URL(a);l.url=h}catch(h){const m=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${a} could not be parsed as URL.`;if(f.logger?.constructor?.name==="NoOpLogger")console.warn(m);else f.logger?.warn?.(m);throw h}}}return s(e)}}var Pl={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Mg({bucketEndpoint:r}){return(s)=>async(f)=>{const{input:{Bucket:e}}=f;if(!r&&typeof e==="string"&&!ff(e)&&e.indexOf("/")>=0){const l=new Error(`Bucket name shouldn't contain '/', received '${e}'`);throw l.name="InvalidBucketName",l}return s({...f})}}var yg={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Nl=(r)=>({applyToStack:(s)=>{s.add(Mg(r),yg),s.addRelativeTo(kl(r),Pl)}});var Nr=L(rf(),1);var $l=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var Ss=L(As(),1);var fs={CrtSignerV4:null};class ef{constructor(r){this.sigv4Signer=new rs(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,f={}){if(f.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,f)}return this.sigv4Signer.signWithCredentials(r,s,f)}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,f={}){if(f.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,f)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=fs.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 mr={["required"]:!1,["type"]:"String"},gr={["required"]:!0,default:!1,["type"]:"Boolean"},Kr={["required"]:!1,["type"]:"Boolean"},Y={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},$={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},N={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},T={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},Aa={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Dl={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},ms={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},X={["ref"]:"Bucket"},W={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},hs={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},Sa={["ref"]:"url"},Ra={["fn"]:"uriEncode",["argv"]:[X],["assign"]:"uri_encoded_bucket"},q={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},w={},da={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[X,!1]},lf={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},gs={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},Ml={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},yl={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},A={["fn"]:"not",["argv"]:[T]},Ul={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},Tl={["fn"]:"not",["argv"]:[ms]},Cl={["ref"]:"hardwareType"},cl={["conditions"]:[A],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},es={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},af={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},Ug={["ref"]:"ForcePathStyle"},U={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},c={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},G={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[c]},H={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},zl={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},C={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},I={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},Gl={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Hl={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Kl={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},hf={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Sa,"isIp"]},!1]},mf={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:C,["headers"]:{}},zf={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:C,["headers"]:{}},Fl={["endpoint"]:zf,["type"]:"endpoint"},gf={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Ll={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},ls={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},V={["ref"]:"bucketArn"},Ia={["ref"]:"arnType"},wf={["fn"]:"getAttr",["argv"]:[V,"service"]},Gf={["ref"]:"accessPointName"},Wl={["conditions"]:[N],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},Xl={["conditions"]:[Y],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Zl={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},Af={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},Ea={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},ka={["fn"]:"getAttr",["argv"]:[V,"accountId"]},Sf={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},Ql={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},Rf={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},df={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},If={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Vl={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},vl={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Fr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},Jl={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},Yl={["fn"]:"aws.parseArn",["argv"]:[X]},Bl={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},Ol={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},_l={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},Ef={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},ql={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},jl={["ref"]:"UseObjectLambdaEndpoint"},kf={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},il={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},bl={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},xl={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Pf={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:C,["headers"]:{}},ol={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Nf=[{["ref"]:"Region"}],Tg=[{["ref"]:"Endpoint"}],Cg=[X],$f=[N],as=[Y],rr=[T,W],nl=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],pl=[hs],Df=[Ra],Mf=[da],wr=[$],ul=[{["fn"]:"substring",["argv"]:[X,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[X,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],tl=[{["conditions"]:[$],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:q,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:q,["headers"]:{}},["type"]:"endpoint"}],ra=[{["fn"]:"substring",["argv"]:[X,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[X,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],sa=[{["conditions"]:[$],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:gs,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:gs,["headers"]:{}},["type"]:"endpoint"}],cg=[ms],fa=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],ea=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],zg=["*"],b=[Aa],la=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],x=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],yf=[{["fn"]:"stringEquals",["argv"]:[Ia,"accesspoint"]}],aa=[{["fn"]:"getAttr",["argv"]:[V,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Gf,""]}]}],Gg=[V,"resourceId[1]"],Uf=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]},""]}]}],ha=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"resourceId[2]"]}]}]}],Hg=[V,"resourceId[2]"],Tf=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]}],["assign"]:"bucketPartition"}],ma=[{["fn"]:"stringEquals",["argv"]:[Ea,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],Cf=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]},!0]}],cf=[{["fn"]:"isValidHostLabel",["argv"]:[ka,!1]}],ga=[{["fn"]:"isValidHostLabel",["argv"]:[Gf,!1]}],wa=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],Kg={version:"1.0",parameters:{Bucket:mr,Region:mr,UseFIPS:gr,UseDualStack:gr,Endpoint:mr,ForcePathStyle:gr,Accelerate:gr,UseGlobalEndpoint:gr,UseObjectLambdaEndpoint:Kr,Key:mr,Prefix:mr,CopySource:mr,DisableAccessPoints:Kr,DisableMultiRegionAccessPoints:gr,UseArnRegion:Kr,UseS3ExpressControlEndpoint:Kr,DisableS3ExpressSessionAuth:Kr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:Nf}],rules:[{["conditions"]:[Y,$],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[N,T],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[T,$],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[T,Y],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[$,Aa,Dl],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[ms,{["fn"]:"substring",["argv"]:[X,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:$f,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:as,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:rr,rules:[{["conditions"]:nl,rules:[{["conditions"]:pl,rules:[{["conditions"]:Df,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Mf,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},lf],["type"]:"tree"},{["conditions"]:pl,rules:[{["conditions"]:Df,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:gs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Mf,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:gs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},lf],["type"]:"tree"},{["conditions"]:[Ml,yl],rules:[{["conditions"]:[Ra,A],rules:[{["conditions"]:wr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:q,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Mf,rules:[{["conditions"]:nl,rules:[{["conditions"]:ul,rules:tl,["type"]:"tree"},{["conditions"]:ra,rules:tl,["type"]:"tree"},Ul],["type"]:"tree"},{["conditions"]:ul,rules:sa,["type"]:"tree"},{["conditions"]:ra,rules:sa,["type"]:"tree"},Ul],["type"]:"tree"},lf],["type"]:"tree"},{["conditions"]:[Tl,Ml,yl],rules:[{["conditions"]:rr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:q,["headers"]:w},["type"]:"endpoint"},{["conditions"]:wr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:q,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[ms,{["fn"]:"substring",["argv"]:[X,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[X,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[X,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[X,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:Nf,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:fa,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Cl,"e"]}],rules:[{["conditions"]:ea,rules:[cl,{["conditions"]:rr,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:es,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:es,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Cl,"o"]}],rules:[{["conditions"]:ea,rules:[cl,{["conditions"]:rr,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:es,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:es,["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"]:cg,rules:[{["conditions"]:[T,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Tg}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[af,da],rules:[{["conditions"]:b,rules:[{["conditions"]:la,rules:[{["conditions"]:[Y,Dl],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[N,$,U,A,c],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,$,U,A,E,H],rules:[{endpoint:zl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,$,U,A,E,K],endpoint:zl,["type"]:"endpoint"},{["conditions"]:[I,$,U,A,c],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,$,U,A,E,H],rules:[{endpoint:Gl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,$,U,A,E,K],endpoint:Gl,["type"]:"endpoint"},{["conditions"]:[N,R,Y,A,c],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,R,Y,A,E,H],rules:[{endpoint:Hl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,R,Y,A,E,K],endpoint:Hl,["type"]:"endpoint"},{["conditions"]:[N,R,U,A,c],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,R,U,A,E,H],rules:[{endpoint:Kl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,R,U,A,E,K],endpoint:Kl,["type"]:"endpoint"},{["conditions"]:[I,R,U,T,W,hs,c],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,U,T,W,hf,c],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,U,T,W,hs,E,H],rules:[{["conditions"]:x,endpoint:mf,["type"]:"endpoint"},{endpoint:mf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,U,T,W,hf,E,H],rules:[{["conditions"]:x,endpoint:zf,["type"]:"endpoint"},Fl],["type"]:"tree"},{["conditions"]:[I,R,U,T,W,hs,E,K],endpoint:mf,["type"]:"endpoint"},{["conditions"]:[I,R,U,T,W,hf,E,K],endpoint:zf,["type"]:"endpoint"},{["conditions"]:[I,R,Y,A,c],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,Y,A,E,H],rules:[{["conditions"]:x,endpoint:gf,["type"]:"endpoint"},{endpoint:gf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,Y,A,E,K],endpoint:gf,["type"]:"endpoint"},{["conditions"]:[I,R,U,A,c],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,U,A,E,H],rules:[{["conditions"]:x,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{endpoint:Ll,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,U,A,E,K],endpoint:Ll,["type"]:"endpoint"}],["type"]:"tree"},ls],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[T,W,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Sa,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[X,!0]},af,R,I,U],rules:[{["conditions"]:b,rules:[{["conditions"]:la,rules:[Fl],["type"]:"tree"},ls],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[af,{["fn"]:"aws.parseArn",["argv"]:Cg,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[V,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Ia,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[wf,"s3-object-lambda"]}],rules:[{["conditions"]:yf,rules:[{["conditions"]:aa,rules:[Wl,Xl,{["conditions"]:Uf,rules:[Zl,{["conditions"]:ha,rules:[Af,{["conditions"]:Tf,rules:[{["conditions"]:b,rules:[{["conditions"]:ma,rules:[{["conditions"]:Cf,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[ka,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:cf,rules:[{["conditions"]:ga,rules:[{["conditions"]:rr,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Sf,["headers"]:w},["type"]:"endpoint"},{["conditions"]:wr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Sf,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Sf,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Ql],["type"]:"tree"},Rf],["type"]:"tree"},df],["type"]:"tree"},If],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Vl],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},vl],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:yf,rules:[{["conditions"]:aa,rules:[{["conditions"]:Uf,rules:[{["conditions"]:yf,rules:[{["conditions"]:Uf,rules:[Zl,{["conditions"]:ha,rules:[Af,{["conditions"]:Tf,rules:[{["conditions"]:b,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Ea,"{partitionResult#name}"]}],rules:[{["conditions"]:Cf,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[wf,"s3"]}],rules:[{["conditions"]:cf,rules:[{["conditions"]:ga,rules:[{["conditions"]:as,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[$,N],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Fr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[$,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Fr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,N],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Fr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,T,W],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Fr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Fr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Ql],["type"]:"tree"},Rf],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},df],["type"]:"tree"},If],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Vl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[Gf,!0]}],rules:[{["conditions"]:$f,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:wr,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"]:Nf,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[V,"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"},vl],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[wf,"s3-outposts"]}],rules:[{["conditions"]:$f,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:wr,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"]:[V,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:Gg,["assign"]:"outpostId"}],rules:[{["conditions"]:fa,rules:[Af,{["conditions"]:Tf,rules:[{["conditions"]:b,rules:[{["conditions"]:ma,rules:[{["conditions"]:Cf,rules:[{["conditions"]:cf,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:Hg,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[V,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:rr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:Jl,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Jl,["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"},Rf],["type"]:"tree"},df],["type"]:"tree"},If],["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"]:[X,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[Yl]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[Ug,!0]},Yl],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:Df,rules:[{["conditions"]:b,rules:[{["conditions"]:[U],rules:[{["conditions"]:[N,A,$,c],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,A,$,E,H],rules:[{endpoint:Bl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,A,$,E,K],endpoint:Bl,["type"]:"endpoint"},{["conditions"]:[I,A,$,c],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,A,$,E,H],rules:[{endpoint:Ol,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,A,$,E,K],endpoint:Ol,["type"]:"endpoint"},{["conditions"]:[N,A,R,c],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,A,R,E,H],rules:[{endpoint:_l,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,A,R,E,K],endpoint:_l,["type"]:"endpoint"},{["conditions"]:[I,T,W,R,c],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,T,W,R,E,H],rules:[{["conditions"]:x,endpoint:Ef,["type"]:"endpoint"},{endpoint:Ef,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,T,W,R,E,K],endpoint:Ef,["type"]:"endpoint"},{["conditions"]:[I,A,R,c],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,A,R,E,H],rules:[{["conditions"]:x,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{endpoint:ql,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,A,R,E,K],endpoint:ql,["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"]:[jl]},{["fn"]:"booleanEquals",["argv"]:[jl,!0]}],rules:[{["conditions"]:b,rules:[{["conditions"]:wa,rules:[Wl,Xl,{["conditions"]:rr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:kf,["headers"]:w},["type"]:"endpoint"},{["conditions"]:wr,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:kf,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:kf,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},ls],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Tl],rules:[{["conditions"]:b,rules:[{["conditions"]:wa,rules:[{["conditions"]:[$,N,A,c],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[$,N,A,E,H],rules:[{endpoint:il,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,N,A,E,K],endpoint:il,["type"]:"endpoint"},{["conditions"]:[$,I,A,c],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[$,I,A,E,H],rules:[{endpoint:bl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,I,A,E,K],endpoint:bl,["type"]:"endpoint"},{["conditions"]:[R,N,A,c],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,N,A,E,H],rules:[{endpoint:xl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,N,A,E,K],endpoint:xl,["type"]:"endpoint"},{["conditions"]:[R,I,T,W,c],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,T,W,E,H],rules:[{["conditions"]:x,endpoint:Pf,["type"]:"endpoint"},{endpoint:Pf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,I,T,W,E,K],endpoint:Pf,["type"]:"endpoint"},{["conditions"]:[R,I,A,c],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,A,E,H],rules:[{["conditions"]:x,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{endpoint:ol,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,I,A,E,K],endpoint:ol,["type"]:"endpoint"}],["type"]:"tree"},ls],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},Pa=Kg;var ws=(r,s={})=>{return $a(Pa,{endpointParams:r,logger:s.logger})};Na.aws=Da;var Ua=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,f)=>({signingProperties:{config:s,context:f}})}},Ta=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,f)=>({signingProperties:{config:s,context:f}})}},Fg=(r)=>async(s,f,e)=>{if(!e)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const l=await r(s,f,e),a=Hr(f)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!a)throw new Error(`getEndpointParameterInstructions() is not defined on \`${f.commandName}\``);const h=await Ma(e,{getEndpointParameterInstructions:a},s);return Object.assign(l,h)},Lg=async(r,s,f)=>{return{operation:Hr(s).operation,region:await zr(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},ya=Fg(Lg),Wg=(r,s,f)=>{return(l)=>{const h=r(l).properties?.authSchemes;if(!h)return s(l);const m=[];for(let g of h){const{name:S,properties:d={},...k}=g,P=S.toLowerCase();if(S!==P)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${S}\` to \`${P}\``);let y;if(P==="sigv4a"){y="aws.auth#sigv4a";const Or=h.find((_)=>{const Mr=_.name.toLowerCase();return Mr!=="sigv4a"&&Mr.startsWith("sigv4")});if(!fs.CrtSignerV4&&Or)continue}else if(P.startsWith("sigv4"))y="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${P}\``);const D=f[y];if(!D)throw new Error(`Could not find HttpAuthOption create function for \`${y}\``);const Q=D(l);Q.schemeId=y,Q.signingProperties={...Q.signingProperties||{},...k,...d},m.push(Q)}return m}},Xg=(r)=>{const s=[];switch(r.operation){default:s.push(Ua(r)),s.push(Ta(r))}return s},Ca=Wg(ws,Xg,{"aws.auth#sigv4":Ua,"aws.auth#sigv4a":Ta}),ca=(r)=>{const s=Ss.resolveAwsSdkSigV4Config(r);return{...Ss.resolveAwsSdkSigV4AConfig(s)}};var za=(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"}},Ar={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 Z extends Ga{constructor(r){super(r);Object.setPrototypeOf(this,Z.prototype)}}class Rs extends Z{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,Rs.prototype)}}class ds extends Z{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,ds.prototype)}}class Is extends Z{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,Is.prototype)}}class Es extends Z{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,Es.prototype)}}class ks extends Z{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,ks.prototype)}}var Hf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Hf||(Hf={}));var Kf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return f.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return f.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Kf||(Kf={}));var Ff;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.AccessPointArn!==void 0)return f.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Ff||(Ff={}));var Lf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Lf||(Lf={}));class Ps extends Z{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,Ps.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class Ns extends Z{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,Ns.prototype)}}class $s extends Z{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,$s.prototype)}}var Zg=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:B},...r.SessionToken&&{SessionToken:B}}),Ha=(r)=>({...r,...r.Credentials&&{Credentials:Zg(r.Credentials)}});var Ka=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:B}}),Fa=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:B}});var dr=L(As(),1);var Ts=L(rf(),1);class Ds extends Z{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Ds.prototype)}}var La;(function(r){r.visit=(s,f)=>{if(s.Records!==void 0)return f.Records(s.Records);if(s.Stats!==void 0)return f.Stats(s.Stats);if(s.Progress!==void 0)return f.Progress(s.Progress);if(s.Cont!==void 0)return f.Cont(s.Cont);if(s.End!==void 0)return f.End(s.End);return f._(s.$unknown[0],s.$unknown[1])}})(La||(La={}));var Wa=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:B},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:B}}),Xa=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:B},...r.SSEKMSKeyId&&{SSEKMSKeyId:B},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:B}});var ba=async(r,s)=>{const f=Ts.requestBuilder(r,s),e=z({},j,{[qw]:r[Mw]});f.bp("/"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const l=z({[Yw]:[,""]});let a;return f.m("GET").h(e).q(l).b(a),f.build()};var xa=async(r,s)=>{const f=Ts.requestBuilder(r,s),e=z({},j,{[Gw]:r[hw],[Hw]:[()=>j(r[Za]),()=>Lr(r[Za]).toString()],[Kw]:r[mw],[Fw]:[()=>j(r[Qa]),()=>Lr(r[Qa]).toString()],[Ww]:r[Rw],[zs]:r[Cs],[zh]:r[Ah],[Gs]:r[cs],[Th]:r[wh],[Dh]:r[lh],[_w]:r[pg]});f.bp("/{Key+}"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1),f.p("Key",()=>r.Key,"{Key+}",!0);const l=z({[Kh]:[,"GetObject"],[Xw]:[,r[dw]],[Zw]:[,r[Iw]],[Qw]:[,r[Ew]],[Vw]:[,r[kw]],[vw]:[,r[Pw]],[Jw]:[()=>r.ResponseExpires!==void 0,()=>Lr(r[Nw]).toString()],[Bw]:[,r[tf]],[Lw]:[()=>r.PartNumber!==void 0,()=>r[Sw].toString()]});let a;return f.m("GET").h(e).q(l).b(a),f.build()};var oa=async(r,s)=>{const f=Ts.requestBuilder(r,s),e=z({},j,{[Ph]:r[eh]||"application/octet-stream",[Ow]:r[xg],[dh]:r[ta],[Ih]:r[rh],[Eh]:r[sh],[kh]:r[fh],[Bf]:[()=>j(r[vf]),()=>r[vf].toString()],[Cw]:r[ug],[pw]:r[ng],[re]:r[bf],[se]:r[xf],[fe]:r[of],[ee]:r[nf],[Of]:[()=>j(r[Jf]),()=>Lr(r[Jf]).toString()],[jw]:r[fw],[iw]:r[ew],[bw]:r[lw],[xw]:r[aw],[le]:r[pf],[Ch]:r[Xr],[Hh]:r[Rh],[zs]:r[Cs],[zh]:r[Ah],[Gs]:r[cs],[ae]:r[uf],[ch]:r[Sh],[Zr]:[()=>j(r[Us]),()=>r[Us].toString()],[Th]:r[wh],[uw]:r[yw],[yh]:r[mh],[_f]:[()=>j(r[Yf]),()=>ia(r[Yf]).toString()],[Mh]:r[hh],[Dh]:r[lh],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((m,g)=>{return m[`x-amz-meta-${g.toLowerCase()}`]=r.Metadata[g],m},{})});f.bp("/{Key+}"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1),f.p("Key",()=>r.Key,"{Key+}",!0);const l=z({[Kh]:[,"PutObject"]});let a,h;if(r.Body!==void 0)h=r.Body,a=h;return f.m("PUT").h(e).q(l).b(a),f.build()};var na=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return jf(r,s);const f=z({$metadata:J(r)}),e=Sr(_a(await dr.parseXmlBody(r.body,s)),"body");if(e[Zf]!=null)f[Zf]=bg(e[Zf],s);return f};var pa=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return jf(r,s);const f=z({$metadata:J(r),[rw]:[()=>r.headers[va]!==void 0,()=>ys(r.headers[va])],[og]:[,r.headers[Tw]],[Wr]:[,r.headers[$h]],[Dw]:[,r.headers[ow]],[gw]:[()=>r.headers[Va]!==void 0,()=>Sr(yr(r.headers[Va]))],[vf]:[()=>r.headers[Bf]!==void 0,()=>qa(r.headers[Bf])],[ah]:[,r.headers[Nh]],[bf]:[,r.headers[re]],[xf]:[,r.headers[se]],[of]:[,r.headers[fe]],[nf]:[,r.headers[ee]],[ww]:[()=>r.headers[Ja]!==void 0,()=>Ms(r.headers[Ja])],[tf]:[,r.headers[Gh]],[ta]:[,r.headers[dh]],[rh]:[,r.headers[Ih]],[sh]:[,r.headers[Eh]],[fh]:[,r.headers[kh]],[tg]:[,r.headers[cw]],[eh]:[,r.headers[Ph]],[Jf]:[()=>r.headers[Of]!==void 0,()=>Sr(yr(r.headers[Of]))],[sw]:[,r.headers[zw]],[Rh]:[,r.headers[Hh]],[pf]:[,r.headers[le]],[Cs]:[,r.headers[zs]],[cs]:[,r.headers[Gs]],[uf]:[,r.headers[ae]],[Us]:[()=>r.headers[Zr]!==void 0,()=>ys(r.headers[Zr])],[Xr]:[,r.headers[Ch]],[gh]:[,r.headers[Uh]],[$w]:[,r.headers[nw]],[Aw]:[()=>r.headers[Ya]!==void 0,()=>Ms(r.headers[Ya])],[Uw]:[()=>r.headers[Ba]!==void 0,()=>Ms(r.headers[Ba])],[mh]:[,r.headers[yh]],[Yf]:[()=>r.headers[_f]!==void 0,()=>Sr(qf(r.headers[_f]))],[hh]:[,r.headers[Mh]],Metadata:[,Object.keys(r.headers).filter((l)=>l.startsWith("x-amz-meta-")).reduce((l,a)=>{return l[a.substring(11)]=r.headers[a],l},{})]}),e=r.body;return s.sdkStreamMixin(e),f.Body=e,f};var ua=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return jf(r,s);const f=z({$metadata:J(r),[Wr]:[,r.headers[$h]],[ah]:[,r.headers[Nh]],[bf]:[,r.headers[re]],[xf]:[,r.headers[se]],[of]:[,r.headers[fe]],[nf]:[,r.headers[ee]],[pf]:[,r.headers[le]],[tf]:[,r.headers[Gh]],[Cs]:[,r.headers[zs]],[cs]:[,r.headers[Gs]],[uf]:[,r.headers[ae]],[Sh]:[,r.headers[ch]],[Us]:[()=>r.headers[Zr]!==void 0,()=>ys(r.headers[Zr])],[gh]:[,r.headers[Uh]]});return await Oa(r.body,s),f};var jf=async(r,s)=>{const f={...r,body:await dr.parseXmlErrorBody(r.body,s)},e=dr.loadRestXmlErrorCode(r,f.body);switch(e){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await _g(f,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await ig(f,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await vg(f,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await Jg(f,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await Bg(f,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await Yg(f,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await Og(f,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await qg(f,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await jg(f,s);default:const l=f.body;return Vg({output:r,parsedBody:l,errorCode:e})}},Vg=ja(Z),vg=async(r,s)=>{const f=z({}),e=r.body,l=new Is({$metadata:J(r),...f});return O(l,r.body)},Jg=async(r,s)=>{const f=z({}),e=r.body,l=new Es({$metadata:J(r),...f});return O(l,r.body)},Yg=async(r,s)=>{const f=z({}),e=r.body;if(e[Xf]!=null)f[Xf]=Rr(e[Xf]);if(e[Xr]!=null)f[Xr]=Rr(e[Xr]);const l=new Ps({$metadata:J(r),...f});return O(l,r.body)},Bg=async(r,s)=>{const f=z({}),e=r.body,l=new ks({$metadata:J(r),...f});return O(l,r.body)},Og=async(r,s)=>{const f=z({}),e=r.body,l=new Ns({$metadata:J(r),...f});return O(l,r.body)},_g=async(r,s)=>{const f=z({}),e=r.body,l=new Rs({$metadata:J(r),...f});return O(l,r.body)},qg=async(r,s)=>{const f=z({}),e=r.body,l=new $s({$metadata:J(r),...f});return O(l,r.body)},jg=async(r,s)=>{const f=z({}),e=r.body,l=new Ds({$metadata:J(r),...f});return O(l,r.body)},ig=async(r,s)=>{const f=z({}),e=r.body,l=new ds({$metadata:J(r),...f});return O(l,r.body)};var bg=(r,s)=>{const f={};if(r[Wf]!=null)f[Wf]=Rr(r[Wf]);if(r[Qf]!=null)f[Qf]=Rr(r[Qf]);if(r[Vf]!=null)f[Vf]=Rr(r[Vf]);if(r[Wr]!=null)f[Wr]=Sr(qf(r[Wr]));return f};var J=(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 j=(r)=>r!==void 0&&r!==null&&r!==""&&(!Object.getOwnPropertyNames(r).includes("length")||r.length!=0)&&(!Object.getOwnPropertyNames(r).includes("size")||r.size!=0);var xg="ACL";var Wf="AccessKeyId";var og="AcceptRanges";var Xf="AccessTier";var Us="BucketKeyEnabled";var Zf="Credentials",ng="ChecksumAlgorithm";var ta="CacheControl",bf="ChecksumCRC32",xf="ChecksumCRC32C",rh="ContentDisposition";var sh="ContentEncoding";var fh="ContentLanguage",vf="ContentLength",pg="ChecksumMode",ug="ContentMD5";var tg="ContentRange";var of="ChecksumSHA1",nf="ChecksumSHA256";var eh="ContentType";var rw="DeleteMarker";var Jf="Expires";var lh="ExpectedBucketOwner";var sw="ExpiresString";var ah="ETag";var Wr="Expiration";var fw="GrantFullControl";var ew="GrantRead",lw="GrantReadACP";var aw="GrantWriteACP";var hw="IfMatch",Za="IfModifiedSince",mw="IfNoneMatch";var Qa="IfUnmodifiedSince";var gw="LastModified";var ww="MissingMeta";var hh="ObjectLockLegalHoldStatus",mh="ObjectLockMode";var Yf="ObjectLockRetainUntilDate";var Aw="PartsCount";var Sw="PartNumber";var Rw="Range";var gh="RequestCharged",dw="ResponseCacheControl",Iw="ResponseContentDisposition",Ew="ResponseContentEncoding",kw="ResponseContentLanguage",Pw="ResponseContentType";var Nw="ResponseExpires";var wh="RequestPayer";var $w="ReplicationStatus";var Dw="Restore";var Qf="SecretAccessKey";var Xr="StorageClass";var Mw="SessionMode";var pf="ServerSideEncryption";var Cs="SSECustomerAlgorithm",Ah="SSECustomerKey",cs="SSECustomerKeyMD5";var Sh="SSEKMSEncryptionContext",uf="SSEKMSKeyId";var Vf="SessionToken";var yw="Tagging";var Uw="TagCount";var tf="VersionId";var Rh="WebsiteRedirectLocation";var Tw="accept-ranges";var dh="cache-control",Ih="content-disposition",Eh="content-encoding",kh="content-language",Bf="content-length",Cw="content-md5",cw="content-range",Ph="content-type";var Of="expires";var Nh="etag",zw="expiresstring";var Gw="if-match",Hw="if-modified-since";var Kw="if-none-match";var Fw="if-unmodified-since";var Va="last-modified";var Lw="partNumber";var Ww="range",Xw="response-cache-control",Zw="response-content-disposition",Qw="response-content-encoding",Vw="response-content-language",vw="response-content-type",Jw="response-expires";var Yw="session";var Bw="versionId";var Ow="x-amz-acl";var re="x-amz-checksum-crc32",se="x-amz-checksum-crc32c",_w="x-amz-checksum-mode";var fe="x-amz-checksum-sha1",ee="x-amz-checksum-sha256";var qw="x-amz-create-session-mode";var va="x-amz-delete-marker",$h="x-amz-expiration",Dh="x-amz-expected-bucket-owner";var jw="x-amz-grant-full-control",iw="x-amz-grant-read",bw="x-amz-grant-read-acp";var xw="x-amz-grant-write-acp";var Ja="x-amz-missing-meta";var Ya="x-amz-mp-parts-count";var Mh="x-amz-object-lock-legal-hold",yh="x-amz-object-lock-mode",_f="x-amz-object-lock-retain-until-date";var ow="x-amz-restore",Uh="x-amz-request-charged";var Th="x-amz-request-payer";var nw="x-amz-replication-status";var Ch="x-amz-storage-class",pw="x-amz-sdk-checksum-algorithm";var le="x-amz-server-side-encryption",ae="x-amz-server-side-encryption-aws-kms-key-id",Zr="x-amz-server-side-encryption-bucket-key-enabled",ch="x-amz-server-side-encryption-context",zs="x-amz-server-side-encryption-customer-algorithm",zh="x-amz-server-side-encryption-customer-key",Gs="x-amz-server-side-encryption-customer-key-md5",uw="x-amz-tagging",Ba="x-amz-tagging-count";var Gh="x-amz-version-id",Hh="x-amz-website-redirect-location",Kh="x-id";class he extends Ir.classBuilder().ep({...Ar,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,f,e){return[Er(f,this.serialize,this.deserialize),kr(f,r.getEndpointParameterInstructions()),ss(f)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(void 0,Ha).ser(ba).de(na).build(){}var Fh={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.629.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.629.0","@aws-sdk/client-sts":"3.629.0","@aws-sdk/core":"3.629.0","@aws-sdk/credential-provider-node":"3.629.0","@aws-sdk/middleware-bucket-endpoint":"3.620.0","@aws-sdk/middleware-expect-continue":"3.620.0","@aws-sdk/middleware-flexible-checksums":"3.620.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-location-constraint":"3.609.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-sdk-s3":"3.629.0","@aws-sdk/middleware-ssec":"3.609.0","@aws-sdk/middleware-user-agent":"3.620.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/signature-v4-multi-region":"3.629.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.614.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@aws-sdk/xml-builder":"3.609.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.3.2","@smithy/eventstream-serde-browser":"^3.0.6","@smithy/eventstream-serde-config-resolver":"^3.0.3","@smithy/eventstream-serde-node":"^3.0.5","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-blob-browser":"^3.1.2","@smithy/hash-node":"^3.0.3","@smithy/hash-stream-node":"^3.1.2","@smithy/invalid-dependency":"^3.0.3","@smithy/md5-js":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.14","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.1.12","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@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.14","@smithy/util-defaults-mode-node":"^3.0.14","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-stream":"^3.1.3","@smithy/util-utf8":"^3.0.0","@smithy/util-waiter":"^3.1.2",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.629.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 Qs=L(As(),1);var rA="AWS_S3_USE_ARN_REGION",sA="s3_use_arn_region",Lh={environmentVariableSelector:(r)=>u(r,rA,t.ENV),configFileSelector:(r)=>u(r,sA,t.CONFIG),default:!1};var Wh=L(SA(),1),{__extends:Sd,__assign:Rd,__rest:dd,__decorate:Id,__param:Ed,__esDecorate:kd,__runInitializers:Pd,__propKey:Nd,__setFunctionName:$d,__metadata:Dd,__awaiter:Hs,__generator:Ks,__exportStar:Md,__createBinding:yd,__values:Fs,__read:Ud,__spread:Td,__spreadArrays:Cd,__spreadArray:cd,__await:zd,__asyncGenerator:Gd,__asyncDelegator:Hd,__asyncValues:Kd,__makeTemplateObject:Fd,__importStar:Ld,__importDefault:Wd,__classPrivateFieldGet:Xd,__classPrivateFieldSet:Zd,__classPrivateFieldIn:Qd,__addDisposableResource:Vd,__disposeResources:vd}=Wh.default;import{Buffer as Xh} from"buffer";var Zh=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?Xh.from(r,s):Xh.from(r)};var me=(r)=>{const s=Zh(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function Qr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return RA(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var RA=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:me;function Vr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function vr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Jr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),f=0;while(f<r.length)s[f]=r[f],f+=1;return s}return Uint32Array.from(r)}var ge=function(){function r(){this.crc32=new sr}return r.prototype.update=function(s){if(Vr(s))return;this.crc32.update(Qr(s))},r.prototype.digest=function(){return Hs(this,void 0,void 0,function(){return Ks(this,function(s){return[2,vr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new sr},r}();var sr=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var f,e;try{for(var l=Fs(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^IA[(this.checksum^h)&255]}}catch(m){f={error:m}}finally{try{if(a&&!a.done&&(e=l.return))e.call(l)}finally{if(f)throw f.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var dA=[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],IA=Jr(dA);var o=L(hr(),1);var Vh=L(hr(),1),Qh=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 Pr{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 f=7,e=Math.abs(Math.round(r));f>-1&&e>0;f--,e/=256)s[f]=e;if(r<0)Qh(s);return new Pr(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Qh(r);return parseInt(Vh.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class we{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let l of Object.keys(r)){const a=this.fromUtf8(l);s.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(r[l]))}const f=new Uint8Array(s.reduce((l,a)=>l+a.byteLength,0));let e=0;for(let l of s)f.set(l,e),e+=l.byteLength;return f}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 f=new DataView(new ArrayBuffer(5));return f.setUint8(0,4),f.setInt32(1,r.value,!1),new Uint8Array(f.buffer);case"long":const e=new Uint8Array(9);return e[0]=5,e.set(r.value.bytes,1),e;case"binary":const l=new DataView(new ArrayBuffer(3+r.value.byteLength));l.setUint8(0,6),l.setUint16(1,r.value.byteLength,!1);const a=new Uint8Array(l.buffer);return a.set(r.value,3),a;case"string":const h=this.fromUtf8(r.value),m=new DataView(new ArrayBuffer(3+h.byteLength));m.setUint8(0,7),m.setUint16(1,h.byteLength,!1);const g=new Uint8Array(m.buffer);return g.set(h,3),g;case"timestamp":const S=new Uint8Array(9);return S[0]=8,S.set(Pr.fromNumber(r.value.valueOf()).bytes,1),S;case"uuid":if(!UA.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(o.fromHex(r.value.replace(/\-/g,"")),1),d}}parse(r){const s={};let f=0;while(f<r.byteLength){const e=r.getUint8(f++),l=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+f,e));switch(f+=e,r.getUint8(f++)){case 0:s[l]={type:Jh,value:!0};break;case 1:s[l]={type:Jh,value:!1};break;case 2:s[l]={type:EA,value:r.getInt8(f++)};break;case 3:s[l]={type:kA,value:r.getInt16(f,!1)},f+=2;break;case 4:s[l]={type:PA,value:r.getInt32(f,!1)},f+=4;break;case 5:s[l]={type:NA,value:new Pr(new Uint8Array(r.buffer,r.byteOffset+f,8))},f+=8;break;case 6:const a=r.getUint16(f,!1);f+=2,s[l]={type:$A,value:new Uint8Array(r.buffer,r.byteOffset+f,a)},f+=a;break;case 7:const h=r.getUint16(f,!1);f+=2,s[l]={type:DA,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+f,h))},f+=h;break;case 8:s[l]={type:MA,value:new Date(new Pr(new Uint8Array(r.buffer,r.byteOffset+f,8)).valueOf())},f+=8;break;case 9:const m=new Uint8Array(r.buffer,r.byteOffset+f,16);f+=16,s[l]={type:yA,value:`${o.toHex(m.subarray(0,4))}-${o.toHex(m.subarray(4,6))}-${o.toHex(m.subarray(6,8))}-${o.toHex(m.subarray(8,10))}-${o.toHex(m.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var vh;(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"})(vh||(vh={}));var Jh="boolean",EA="byte",kA="short",PA="integer",NA="long",$A="binary",DA="string",MA="timestamp",yA="uuid",UA=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function Bh({byteLength:r,byteOffset:s,buffer:f}){if(r<TA)throw new Error("Provided message too short to accommodate event stream message overhead");const e=new DataView(f,s,r),l=e.getUint32(0,!1);if(r!==l)throw new Error("Reported message length does not match received message length");const a=e.getUint32(Yh,!1),h=e.getUint32(n,!1),m=e.getUint32(r-fr,!1),g=new sr().update(new Uint8Array(f,s,n));if(h!==g.digest())throw new Error(`The prelude checksum specified in the message (${h}) does not match the calculated CRC32 checksum (${g.digest()})`);if(g.update(new Uint8Array(f,s+n,r-(n+fr))),m!==g.digest())throw new Error(`The message checksum (${g.digest()}) did not match the expected value of ${m}`);return{headers:new DataView(f,s+n+fr,a),body:new Uint8Array(f,s+n+fr+a,l-a-(n+fr+fr))}}var Yh=4,n=Yh*2,fr=4,TA=n+fr*2;class Ae{constructor(r,s){this.headerMarshaller=new we(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 f=this.headerMarshaller.format(r),e=f.byteLength+s.byteLength+16,l=new Uint8Array(e),a=new DataView(l.buffer,l.byteOffset,l.byteLength),h=new sr;return a.setUint32(0,e,!1),a.setUint32(4,f.byteLength,!1),a.setUint32(8,h.update(l.subarray(0,8)).digest(),!1),l.set(f,12),l.set(s,f.byteLength+12),a.setUint32(e-4,h.update(l.subarray(8,e-4)).digest(),!1),l}decode(r){const{headers:s,body:f}=Bh(r);return{headers:this.headerMarshaller.parse(s),body:f}}formatHeaders(r){return this.headerMarshaller.format(r)}}class Se{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 Re{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 de{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 Ie{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 Oh(r){let s=0,f=0,e=null,l=null;const a=(m)=>{if(typeof m!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+m);s=m,f=4,e=new Uint8Array(m),new DataView(e.buffer).setUint32(0,m,!1)},h=async function*(){const m=r[Symbol.asyncIterator]();while(!0){const{value:g,done:S}=await m.next();if(S){if(!s)return;else if(s===f)yield e;else throw new Error("Truncated event message received.");return}const d=g.length;let k=0;while(k<d){if(!e){const y=d-k;if(!l)l=new Uint8Array(4);const D=Math.min(4-f,y);if(l.set(g.slice(k,k+D),f),f+=D,k+=D,f<4)break;a(new DataView(l.buffer).getUint32(0,!1)),l=null}const P=Math.min(s-f,d-k);if(e.set(g.slice(k,k+P),f),f+=P,k+=P,s&&s===f)yield e,e=null,s=0,f=0}}};return{[Symbol.asyncIterator]:h}}function _h(r,s){return async function(f){const{value:e}=f.headers[":message-type"];if(e==="error"){const l=new Error(f.headers[":error-message"].value||"UnknownError");throw l.name=f.headers[":error-code"].value,l}else if(e==="exception"){const l=f.headers[":exception-type"].value,a={[l]:f},h=await r(a);if(h.$unknown){const m=new Error(s(f.body));throw m.name=l,m}throw h[l]}else if(e==="event"){const l={[f.headers[":event-type"].value]:f},a=await r(l);if(a.$unknown)return;return a}else throw Error(`Unrecognizable event type: ${f.headers[":event-type"].value}`)}}class Ls{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new Ae(r,s),this.utfEncoder=r}deserialize(r,s){const f=Oh(r);return new de({messageStream:new Se({inputStream:f,decoder:this.eventStreamCodec}),deserializer:_h(s,this.utfEncoder)})}serialize(r,s){return new Re({messageStream:new Ie({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as CA} from"stream";async function*qh(r){let s=!1,f=!1;const e=new Array;r.on("error",(l)=>{if(!s)s=!0;if(l)throw l}),r.on("data",(l)=>{e.push(l)}),r.on("end",()=>{s=!0});while(!f){const l=await new Promise((a)=>setTimeout(()=>a(e.shift()),0));if(l)yield l;f=s&&e.length===0}}class Ee{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Ls({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const f=typeof r[Symbol.asyncIterator]==="function"?r:qh(r);return this.universalMarshaller.deserialize(f,s)}serialize(r,s){return CA.from(this.universalMarshaller.serialize(r,s))}}var jh=(r)=>new Ee(r);import{Writable as cA} from"stream";class Ws extends cA{constructor(r,s){super(s);this.hash=r}_write(r,s,f){try{this.hash.update(v(r))}catch(e){return f(e)}f()}}var ih=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const f=new r,e=new Ws(f);return s.pipe(e),new Promise((l,a)=>{s.on("error",(h)=>{e.end(),a(h)}),e.on("error",a),e.on("finish",()=>{f.digest().then(l).catch(a)})})};var Xs=L(As(),1);var th=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??bh,base64Encoder:r?.base64Encoder??oh,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??ws,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??nh,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Ca,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Xs.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new Xs.AwsSdkSigV4ASigner}],logger:r?.logger??new _r,sdkStreamMixin:r?.sdkStreamMixin??ph,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??ef,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??uh,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Cr,utf8Encoder:r?.utf8Encoder??xh}};var Em=(r)=>{em(process.version);const s=dm(r),f=()=>s().then(fm),e=th(r);return Qs.emitWarningIfUnsupportedVersion(process.version),{...e,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??Rm,credentialDefaultProvider:r?.credentialDefaultProvider??Im,defaultUserAgentProvider:r?.defaultUserAgentProvider??Sm({serviceId:e.serviceId,clientVersion:Fh.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??i(us),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??jh,maxAttempts:r?.maxAttempts??i(wm),md5:r?.md5??Zs.bind(null,"md5"),region:r?.region??i(hm,mm),requestHandler:rm.create(r?.requestHandler??f),retryMode:r?.retryMode??i({...Am,default:async()=>(await f()).retryMode||gm}),sha1:r?.sha1??Zs.bind(null,"sha1"),sha256:r?.sha256??Zs.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??i(Qs.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??sm,streamHasher:r?.streamHasher??ih,useArnRegion:r?.useArnRegion??i(Lh),useDualstackEndpoint:r?.useDualstackEndpoint??i(lm),useFipsEndpoint:r?.useFipsEndpoint??i(am)}};var km=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:f,credentials:e}=r;return{setHttpAuthScheme(l){const a=s.findIndex((h)=>h.schemeId===l.schemeId);if(a===-1)s.push(l);else s.splice(a,1,l)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(l){f=l},httpAuthSchemeProvider(){return f},setCredentials(l){e=l},credentials(){return e}}},Pm=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var Vs=(r)=>r,Tm=(r,s)=>{const f={...Vs(ym(r)),...Vs(Dm(r)),...Vs(Nm(r)),...Vs(km(r))};return s.forEach((e)=>e.configure(f)),{...r,...Um(f),...Mm(f),...$m(f),...Pm(f)}};class ke extends Hm{constructor(...[r]){const s=Em(r||{}),f=za(s),e=Km(f),l=Zm(e),a=Lm(l),h=Cm(a),m=Xm(h),g=$l(m),S=ca(g),d=dl(S,{session:[()=>this,he]}),k=Tm(d,r?.extensions||[]);super(k);this.config=k,this.middlewareStack.use(Fm(this.config)),this.middlewareStack.use(Qm(this.config)),this.middlewareStack.use(Wm(this.config)),this.middlewareStack.use(cm(this.config)),this.middlewareStack.use(zm(this.config)),this.middlewareStack.use(Gm(this.config)),this.middlewareStack.use(Nr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:ya,identityProviderConfigProvider:async(P)=>new Nr.DefaultIdentityProviderConfig({"aws.auth#sigv4":P.credentials,"aws.auth#sigv4a":P.credentials})})),this.middlewareStack.use(Nr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(Nl(this.config)),this.middlewareStack.use(Te(this.config)),this.middlewareStack.use(Ge(this.config)),this.middlewareStack.use(ts(this.config)),this.middlewareStack.use(sf(this.config))}destroy(){super.destroy()}}function zA(r){return(s)=>async(f)=>{const e={...f.input},l=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let a of l){const h=e[a.target];if(h){let m;if(typeof h==="string")if(HA(h,r))m=r.base64Decoder(h);else m=r.utf8Decoder(h),e[a.target]=r.base64Encoder(m);else m=ArrayBuffer.isView(h)?new Uint8Array(h.buffer,h.byteOffset,h.byteLength):new Uint8Array(h),e[a.target]=r.base64Encoder(m);const g=new r.md5;g.update(m),e[a.hash]=r.base64Encoder(await g.digest())}}return s({...f,input:e})}}function HA(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 GA={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},vs=(r)=>({applyToStack:(s)=>{s.add(zA(r),GA)}});var M;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(M||(M={}));var Vm;(function(r){r.HEADER="header",r.TRAILER="trailer"})(Vm||(Vm={}));var{MD5:vm,CRC32:Jm}=M;var Yr=[M.CRC32,M.CRC32C,M.SHA1,M.SHA256],Ym=[M.CRC32,M.CRC32C,M.SHA1,M.SHA256];var Bm=(r,{requestChecksumRequired:s,requestAlgorithmMember:f},e)=>{const l=e?Jm:vm;if(!f||!r[f])return s?l:void 0;const a=r[f];if(!Yr.includes(a))throw new Error(`The checksum algorithm "${a}" is not supported by the client.`+` Select one of ${Yr}.`);return a};var $r=(r)=>r===M.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var Om=(r,s)=>{const f=r.toLowerCase();for(let e of Object.keys(s))if(f===e.toLowerCase())return!0;return!1};var Dr=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!or(r);var Ne=function(){function r(){this.crc32c=new Pe}return r.prototype.update=function(s){if(Vr(s))return;this.crc32c.update(Qr(s))},r.prototype.digest=function(){return Hs(this,void 0,void 0,function(){return Ks(this,function(s){return[2,vr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new Pe},r}();var Pe=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var f,e;try{for(var l=Fs(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^FA[(this.checksum^h)&255]}}catch(m){f={error:m}}finally{try{if(a&&!a.done&&(e=l.return))e.call(l)}finally{if(f)throw f.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var KA=[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],FA=Jr(KA);var Js=(r,s)=>({[M.MD5]:s.md5,[M.CRC32]:ge,[M.CRC32C]:Ne,[M.SHA1]:s.sha1,[M.SHA256]:s.sha256})[r];var Ys=(r,s)=>{const f=new r;return f.update(v(s||"")),f.digest()};var _m={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},qm=(r,s)=>(f,e)=>async(l)=>{if(!F.isInstance(l.request))return f(l);const{request:a}=l,{body:h,headers:m}=a,{base64Encoder:g,streamHasher:S}=r,{input:d,requestChecksumRequired:k,requestAlgorithmMember:P}=s,y=Bm(d,{requestChecksumRequired:k,requestAlgorithmMember:P},!!e.isS3ExpressBucket);let D=h,Q=m;if(y){const _=$r(y),Mr=Js(y,r);if(Dr(h)){const{getAwsChunkedEncodingStream:_s,bodyLengthChecker:um}=r;D=_s(h,{base64Encoder:g,bodyLengthChecker:um,checksumLocationName:_,checksumAlgorithmFn:Mr,streamHasher:S}),Q={...m,"content-encoding":m["content-encoding"]?`${m["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":m["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":_},delete Q["content-length"]}else if(!Om(_,m)){const _s=await Ys(Mr,h);Q={...m,[_]:g(_s)}}}return await f({...l,request:{...a,headers:Q,body:D}})};var Bs=(r=[])=>{const s=[];for(let f of Ym){if(!r.includes(f)||!Yr.includes(f))continue;s.push(f)}return s};var jm=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const f=r.slice(s+1);if(!f.startsWith("0")){const e=parseInt(f,10);if(!isNaN(e)&&e>=1&&e<=1e4)return!0}}return!1};import{Transform as LA} from"stream";function $e(r){const s=new LA;return s.push(r),s.push(null),s}var im=async(r,{streamHasher:s,checksumAlgorithmFn:f,base64Encoder:e})=>{const l=Dr(r)?s(f,r):Ys(f,r);return e(await l)};var bm=async(r,{config:s,responseAlgorithms:f})=>{const e=Bs(f),{body:l,headers:a}=r;for(let h of e){const m=$r(h),g=a[m];if(g){const S=Js(h,s),{streamHasher:d,base64Encoder:k}=s,P=await im(l,{streamHasher:d,checksumAlgorithmFn:S,base64Encoder:k});if(P===g)break;throw new Error(`Checksum mismatch: expected "${P}" but received "${g}"`+` in response header "${m}".`)}}};var xm={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},om=(r,s)=>(f,e)=>async(l)=>{if(!F.isInstance(l.request))return f(l);const a=l.input,h=await f(l),m=h.response;let g=void 0;const{requestValidationModeMember:S,responseAlgorithms:d}=s;if(S&&a[S]==="ENABLED"){const{clientName:k,commandName:P}=e;if(k==="S3Client"&&P==="GetObjectCommand"&&Bs(d).every((Q)=>{const Or=$r(Q),_=m.headers[Or];return!_||jm(_)}))return h;const D=Dr(m.body);if(D)g=await r.streamCollector(m.body),m.body=$e(g);if(await bm(h.response,{config:r,responseAlgorithms:d}),D&&g)m.body=$e(g)}return h};var Os=(r,s)=>({applyToStack:(f)=>{f.add(qm(r,s),_m),f.addRelativeTo(om(r,s),xm)}});class De extends Ir.classBuilder().ep({...Ar,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,f,e){return[Er(f,this.serialize,this.deserialize),kr(f,r.getEndpointParameterInstructions()),Os(f,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),vs(f),He(f)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(Fa,Ka).ser(xa).de(pa).build(){}class Me extends Ir.classBuilder().ep({...Ar,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,f,e){return[Er(f,this.serialize,this.deserialize),kr(f,r.getEndpointParameterInstructions()),Os(f,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),Ce(f),ss(f),vs(f)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(Xa,Wa).ser(oa).de(ua).build(){}var pm=L(WA(),1);import{Buffer as ye} from"buffer";var nm=new ke;class Br{static folder(r){if(!r||r.includes("null")||r.includes("undefined"))throw new Error("Folder path has to be specified.");return{put:async(s)=>{let f;if(s instanceof Blob)return f=`${Ue()}.${s.type.split("/")[1]}`,Br.put({body:s,name:`${r}/${f}`});return Br.put({...s,name:`${r}/${f}`})},fetch:async(s)=>{let f=process.env.BUCKET_NAME,e;if(typeof s==="string")e=s;else f=s.bucket??f,e=s.name;if(!e)throw new Error("Object name has to be specified");return Br.fetch({...s,name:`${r}/${e}`})}}}static async put(r){let s,f,e,l=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,e=`${Ue()}.${r.type.split("/")[1]}`,f=r.type;else s=r.body,e=r.name,f=r.contentType;f=s instanceof Blob||s instanceof File?s.type:void 0;const a=s instanceof ye?s:ye.from(await s.arrayBuffer());return await nm.send(new Me({Bucket:l,Key:e,Body:a,ContentType:f})),e}static async metadata(r){const s=ye.from(await r.arrayBuffer());try{return await pm.default(s).metadata()}catch{return{}}}static async fetch(r){let s=process.env.BUCKET_NAME,f;if(typeof r==="string")f=r;else s=r.bucket??s,f=r.name;if(!f)throw new Error("Object name has to be specified");const e=await nm.send(new De({Bucket:s,Key:f}));return new Response(e.Body.transformToWebStream(),{headers:{"Content-Type":e.ContentType,"Content-Length":e.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":e.LastModified?.toUTCString()||"",ETag:e.ETag||""}})}static delete(){}}export{Br as Storage};