gemi 0.4.75 → 0.4.76

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.
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"../chunk-b943cac32cc3670f.js";import{A as H} from"../chunk-e3d242546d1a2927.js";import{$ as Ir,D as yr,E as Hg,F as Qg,G as Bg,H as Yg,I as Tw,J as n,K as p,L as ys,M as Ur,N as Wh,O as qg,P as Fh,Q as Gh,R as Kh,S as Og,T as dg,U as Pg,V as Eg,W as Ng,X as _g,Y as jg,Z as Vh,_ as kr,aa as cg,ba as $g,ca as Dg,da as bg,ea as Mg,fa as ig,ga as nr,ha as Ug,ia as Us,ja as Tg,ka as Cg,la as Xg,ma as Jg} from"../chunk-3abc648638ed6645.js";import{$a as rm,Aa as gg,Ba as wg,Da as Rg,Ea as Ag,Fa as bm,Ga as ag,Ha as Mf,Ia as Uf,Ja as ph,Ka as Ar,La as v,Na as as,Qa as Sr,Ra as uh,Sa as er,Ta as th,Ua as ws,Va as zr,Xa as zl,Ya as Dr,Za as Qh,_a as q,ab as kg,bb as Ig,cb as Zg,db as Lg,fb as z,hb as sm,na as Wg,oa as Vg,pa as X,qa as Br,ra as Qr,sa as vg,ta as rw,wa as fg,xa as hg,ya as $s,za as mg} from"../chunk-28c7d04b6f555350.js";import{jb as Cw} from"../chunk-4e37f45d636da627.js";import{kb as c,lb as Sg} from"../chunk-48b2990a93ae50b3.js";import"../chunk-5fb9d31b7b4629e9.js";import"../chunk-9631e167bae739a0.js";import{Eb as zg} from"../chunk-d4eceea16ddc567d.js";import{Fb as T3} from"../chunk-4ad752c87b795617.js";class sr{}class Hr extends sr{r;constructor(r=`${process.env.ROOT_DIR}/storage`){super();this.folderPath=r}async put(r){let s,l;if(r instanceof Blob)s=r,l=`${yr()}.${r.type.split("/")[1].split(";")[0]}`;else s=r.body,l=r.name;const f=s instanceof Buffer?s:Buffer.from(await s.arrayBuffer()),h=`${this.folderPath}/${l}`;return await Bun.write(h,f),l}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=`${this.folderPath}/${l}`,h=Bun.file(f),m=Bun.file(f).stream(),g=new Date(h.lastModified).toUTCString();return new Response(m,{headers:{"Content-Type":h.type,"Content-Length":String(h.size),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":g}})}}class lf{driver=new Hr}function Aw(r){return(s)=>async(l)=>{const{request:f}=l;if(X.isInstance(f)&&f.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")f.headers={...f.headers,Expect:"100-continue"}}return s({...l,request:f})}}var kw={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},ff=(r)=>({applyToStack:(s)=>{s.add(Aw(r),kw)}});function dw(){return(r,s)=>async(l)=>{const{request:f}=l;if(X.isInstance(f)){if(!(Iw in f.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof Qr))s.logger.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.");else console.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.")}return r({...l})}}var Iw="content-length",Pw={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},hf=(r)=>({applyToStack:(s)=>{s.add(dw(),Pw)}});var mf=(r)=>{return(s,l)=>async(f)=>{const h=await r.region(),m=r.region;let g=()=>{};if(l.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return l.__s3RegionRedirect}}),g=()=>Object.defineProperty(r,"region",{writable:!0,value:m});try{const w=await s(f);if(l.__s3RegionRedirect){g();const a=await r.region();if(h!==a)throw new Error("Region was not restored following S3 region redirect.")}return w}catch(w){throw g(),w}}},gf={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Ew(r){return(s,l)=>async(f)=>{try{return await s(f)}catch(h){if(r.followRegionRedirects&&h?.$metadata?.httpStatusCode===301){try{const m=h.$response.headers["x-amz-bucket-region"];l.logger?.debug(`Redirecting from ${await r.region()} to ${m}`),l.__s3RegionRedirect=m}catch(m){throw new Error("Region redirect failed: "+m)}return s(f)}else throw h}}}var Nw={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},wf=(r)=>({applyToStack:(s)=>{s.add(Ew(r),Nw),s.addRelativeTo(mf(r),gf)}});var $w=(r)=>{return(s,l)=>async(f)=>{const h=await s(f),{response:m}=h;if(Br.isInstance(m)){if(m.headers.expires){m.headers.expiresstring=m.headers.expires;try{Dr(m.headers.expires)}catch(g){l.logger?.warn(`AWS SDK Warning for ${l.clientName}::${l.commandName} response parsing (${m.headers.expires}): ${g}`),delete m.headers.expires}}}return h}},Dw={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},af=(r)=>({applyToStack:(s)=>{s.addRelativeTo($w(r),Dw)}});class lr{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+lr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const l=this.data[s];if(!l.isRefreshing){const f=await l.identity;if(f.expiration){if(f.expiration.getTime()<r)delete this.data[s]}}}}}lr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class fr{constructor(r,s=!1,l=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=l}get identity(){return this.accessed=Date.now(),this._identity}}class hr{constructor(r,s=new lr){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const l=s.Bucket,{cache:f}=this,h=f.get(l);if(h)return h.identity.then((m)=>{if((m.expiration?.getTime()??0)<Date.now())return f.set(l,new fr(this.getIdentity(l))).identity;if((m.expiration?.getTime()??0)<Date.now()+hr.REFRESH_WINDOW_MS&&!h.isRefreshing)h.isRefreshing=!0,this.getIdentity(l).then((a)=>{f.set(l,new fr(Promise.resolve(a)))});return m});return f.set(l,new fr(this.getIdentity(l))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((f)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+f)});const s=await this.createSessionFn(r);if(!s.Credentials?.AccessKeyId||!s.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretAccessKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration?new Date(s.Credentials.Expiration):void 0}}}hr.REFRESH_WINDOW_MS=60000;var If=H(Tw(),1);var Sf="Directory",ef="S3Express",Rf="sigv4-s3express",Yr="X-Amz-S3session-Token",Mr=Yr.toLowerCase(),Mw="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Uw="s3_disable_express_session_auth",Xs={environmentVariableSelector:(r)=>n(r,Mw,p.ENV),configFileSelector:(r)=>n(r,Uw,p.CONFIG),default:!1};var Af=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},kf=function(r,s){const l=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),f=r.credentialProvider,h=()=>{return clearTimeout(l),r.credentialProvider=f,Promise.resolve(s)};r.credentialProvider=h};class vr extends If.SignatureV4{async signWithCredentials(r,s,l){const f=Af(s);r.headers[Mr]=s.sessionToken;const h=this;return kf(h,f),h.signRequest(r,l??{})}async presignWithCredentials(r,s,l){const f=Af(s);return delete r.headers[Mr],r.headers[Yr]=s.sessionToken,r.query=r.query??{},r.query[Yr]=s.sessionToken,kf(this,f),this.presign(r,l)}}var df=(r)=>{return(s,l)=>async(f)=>{if(l.endpointV2){const h=l.endpointV2,m=h.properties?.authSchemes?.[0]?.name===Rf;if(h.properties?.backend===ef||h.properties?.bucketType===Sf)l.isS3ExpressBucket=!0;if(m){const w=f.input.Bucket;if(w){const a=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:w});if(l.s3ExpressIdentity=a,X.isInstance(f.request)&&a.sessionToken)f.request.headers[Mr]=a.sessionToken}}}return s(f)}},Pf={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},Js=(r)=>({applyToStack:(s)=>{s.add(df(r),Pf)}});var Nf=H(ys(),1);var zw=H(Cw(),1);var Ef=async(r,s,l,f)=>{const h=await f.signWithCredentials(l,r,{});if(h.headers["X-Amz-Security-Token"]||h.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return h};var Fw=(r)=>(s)=>{throw s},Gw=(r,s)=>{};var $f=(r)=>(s,l)=>async(f)=>{if(!X.isInstance(f.request))return s(f);const m=Ur(l).selectedHttpAuthScheme;if(!m)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:g={}},identity:w,signer:a}=m;let P;if(l.s3ExpressIdentity)P=await Ef(l.s3ExpressIdentity,g,f.request,await r.signer());else P=await a.sign(f.request,w,g);const E=await s({...f,request:P}).catch((a.errorHandler||Fw)(g));return(a.successHandler||Gw)(E.response,g),E},Hs=(r)=>({applyToStack:(s)=>{s.addRelativeTo($f(r),Nf.httpSigningMiddlewareOptions)}});var Df=(r,{session:s})=>{const[l,f]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new hr(async(h)=>l().send(new f({Bucket:h,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var Kw={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Ww=3000,Vw=(r)=>(s,l)=>async(f)=>{const h=await s(f),{response:m}=h;if(!Br.isInstance(m))return h;const{statusCode:g,body:w}=m;if(g<200||g>=300)return h;let a=w,P=w;if(w&&typeof w==="object"&&!(w instanceof Uint8Array))[a,P]=await Mf(w);m.body=P;const E=await Zw(a,{streamCollector:async(N)=>{return Uf(N,Ww)}});if(typeof a?.destroy==="function")a.destroy();const $=r.utf8Encoder(E.subarray(E.length-16));if(E.length===0&&Kw[l.commandName]){const N=new Error("S3 aborted request");throw N.name="InternalError",N}if($&&$.endsWith("</Error>"))m.statusCode=400;return h},Zw=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},Lw={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},qr=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Vw(r),Lw)}});var Qs=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function Tf(r){return(s,l)=>async(f)=>{if(r.bucketEndpoint){const h=l.endpointV2;if(h){const m=f.input.Bucket;if(typeof m==="string")try{const g=new URL(m);h.url=g}catch(g){const w=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${m} could not be parsed as URL.`;if(l.logger?.constructor?.name==="NoOpLogger")console.warn(w);else l.logger?.warn?.(w);throw g}}}return s(f)}}var Cf={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Xw({bucketEndpoint:r}){return(s)=>async(l)=>{const{input:{Bucket:f}}=l;if(!r&&typeof f==="string"&&!Qs(f)&&f.indexOf("/")>=0){const h=new Error(`Bucket name shouldn't contain '/', received '${f}'`);throw h.name="InvalidBucketName",h}return s({...l})}}var Jw={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},zf=(r)=>({applyToStack:(s)=>{s.add(Xw(r),Jw),s.addRelativeTo(Tf(r),Cf)}});var Pr=H(ys(),1);var Ff=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var pr=H(nr(),1);var Or={CrtSignerV4:null};class Bs{constructor(r){this.sigv4Signer=new vr(r),this.signerOptions=r}async sign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().sign(r,s)}return this.sigv4Signer.sign(r,s)}async signWithCredentials(r,s,l={}){if(l.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().signWithCredentials(r,s,l)}return this.sigv4Signer.signWithCredentials(r,s,l)}async presign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().presign(r,s)}return this.sigv4Signer.presign(r,s)}async presignWithCredentials(r,s,l={}){if(l.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,l)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=Or.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"},Tr={["required"]:!1,["type"]:"Boolean"},Y={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},d={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},I={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},U={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},Nh={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Gf={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},ir={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},V={["ref"]:"Bucket"},W={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},br={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},$h={["ref"]:"url"},Dh={["fn"]:"uriEncode",["argv"]:[V],["assign"]:"uri_encoded_bucket"},_={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},S={},Mh={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[V,!1]},Ys={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},xr={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},Kf={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},Wf={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},e={["fn"]:"not",["argv"]:[U]},Vf={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},Zf={["fn"]:"not",["argv"]:[ir]},Lf={["ref"]:"hardwareType"},Xf={["conditions"]:[e],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},_r={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},vs={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},yw={["ref"]:"ForcePathStyle"},M={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},C={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},F={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},k={["fn"]:"not",["argv"]:[C]},G={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},Jf={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},T={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},A={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},yf={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Hf={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},Qf={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},qs={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[$h,"isIp"]},!1]},Os={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:T,["headers"]:{}},al={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:T,["headers"]:{}},Bf={["endpoint"]:al,["type"]:"endpoint"},_s={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},Yf={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},jr={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},L={["ref"]:"bucketArn"},Uh={["ref"]:"arnType"},js={["fn"]:"getAttr",["argv"]:[L,"service"]},Sl={["ref"]:"accessPointName"},vf={["conditions"]:[I],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},qf={["conditions"]:[Y],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Of={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},cs={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},Th={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},Ch={["fn"]:"getAttr",["argv"]:[L,"accountId"]},bs={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},_f={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},is={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},xs={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},os={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},jf={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},cf={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Cr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},bf={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},xf={["fn"]:"aws.parseArn",["argv"]:[V]},of={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},nf={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},pf={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},ns={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},uf={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},tf={["ref"]:"UseObjectLambdaEndpoint"},ps={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},rh={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},sh={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},lh={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},us={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:T,["headers"]:{}},fh={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},ts=[{["ref"]:"Region"}],Hw=[{["ref"]:"Endpoint"}],Qw=[V],rl=[I],cr=[Y],u=[U,W],hh=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],mh=[br],sl=[Dh],ll=[Mh],wr=[d],gh=[{["fn"]:"substring",["argv"]:[V,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[V,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],wh=[{["conditions"]:[d],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:_,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:_,["headers"]:{}},["type"]:"endpoint"}],ah=[{["fn"]:"substring",["argv"]:[V,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[V,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],Sh=[{["conditions"]:[d],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:xr,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:xr,["headers"]:{}},["type"]:"endpoint"}],Bw=[ir],eh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],Rh=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Yw=["*"],b=[Nh],Ah=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],i=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],fl=[{["fn"]:"stringEquals",["argv"]:[Uh,"accesspoint"]}],kh=[{["fn"]:"getAttr",["argv"]:[L,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Sl,""]}]}],vw=[L,"resourceId[1]"],hl=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"region"]},""]}]}],Ih=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"resourceId[2]"]}]}]}],qw=[L,"resourceId[2]"],ml=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"region"]}],["assign"]:"bucketPartition"}],dh=[{["fn"]:"stringEquals",["argv"]:[Th,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],gl=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"region"]},!0]}],wl=[{["fn"]:"isValidHostLabel",["argv"]:[Ch,!1]}],Ph=[{["fn"]:"isValidHostLabel",["argv"]:[Sl,!1]}],Eh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],Ow={version:"1.0",parameters:{Bucket:mr,Region:mr,UseFIPS:gr,UseDualStack:gr,Endpoint:mr,ForcePathStyle:gr,Accelerate:gr,UseGlobalEndpoint:gr,UseObjectLambdaEndpoint:Tr,Key:mr,Prefix:mr,CopySource:mr,DisableAccessPoints:Tr,DisableMultiRegionAccessPoints:gr,UseArnRegion:Tr,UseS3ExpressControlEndpoint:Tr,DisableS3ExpressSessionAuth:Tr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:ts}],rules:[{["conditions"]:[Y,d],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[I,U],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[U,d],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[U,Y],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[d,Nh,Gf],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[ir,{["fn"]:"substring",["argv"]:[V,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:rl,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:cr,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:u,rules:[{["conditions"]:hh,rules:[{["conditions"]:mh,rules:[{["conditions"]:sl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:ll,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},Ys],["type"]:"tree"},{["conditions"]:mh,rules:[{["conditions"]:sl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:xr,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:ll,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:xr,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},Ys],["type"]:"tree"},{["conditions"]:[Kf,Wf],rules:[{["conditions"]:[Dh,e],rules:[{["conditions"]:wr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:_,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:ll,rules:[{["conditions"]:hh,rules:[{["conditions"]:gh,rules:wh,["type"]:"tree"},{["conditions"]:ah,rules:wh,["type"]:"tree"},Vf],["type"]:"tree"},{["conditions"]:gh,rules:Sh,["type"]:"tree"},{["conditions"]:ah,rules:Sh,["type"]:"tree"},Vf],["type"]:"tree"},Ys],["type"]:"tree"},{["conditions"]:[Zf,Kf,Wf],rules:[{["conditions"]:u,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:_,["headers"]:S},["type"]:"endpoint"},{["conditions"]:wr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:_,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[ir,{["fn"]:"substring",["argv"]:[V,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[V,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[V,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[V,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:ts,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:eh,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Lf,"e"]}],rules:[{["conditions"]:Rh,rules:[Xf,{["conditions"]:u,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:_r,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:_r,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Lf,"o"]}],rules:[{["conditions"]:Rh,rules:[Xf,{["conditions"]:u,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:_r,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:_r,["headers"]:S},["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"]:Bw,rules:[{["conditions"]:[U,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Hw}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[vs,Mh],rules:[{["conditions"]:b,rules:[{["conditions"]:Ah,rules:[{["conditions"]:[Y,Gf],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[I,d,M,e,C],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[I,d,M,e,k,G],rules:[{endpoint:Jf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,d,M,e,k,K],endpoint:Jf,["type"]:"endpoint"},{["conditions"]:[A,d,M,e,C],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,d,M,e,k,G],rules:[{endpoint:yf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,M,e,k,K],endpoint:yf,["type"]:"endpoint"},{["conditions"]:[I,R,Y,e,C],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[I,R,Y,e,k,G],rules:[{endpoint:Hf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,Y,e,k,K],endpoint:Hf,["type"]:"endpoint"},{["conditions"]:[I,R,M,e,C],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[I,R,M,e,k,G],rules:[{endpoint:Qf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,M,e,k,K],endpoint:Qf,["type"]:"endpoint"},{["conditions"]:[A,R,M,U,W,br,C],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,R,M,U,W,qs,C],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,R,M,U,W,br,k,G],rules:[{["conditions"]:i,endpoint:Os,["type"]:"endpoint"},{endpoint:Os,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,R,M,U,W,qs,k,G],rules:[{["conditions"]:i,endpoint:al,["type"]:"endpoint"},Bf],["type"]:"tree"},{["conditions"]:[A,R,M,U,W,br,k,K],endpoint:Os,["type"]:"endpoint"},{["conditions"]:[A,R,M,U,W,qs,k,K],endpoint:al,["type"]:"endpoint"},{["conditions"]:[A,R,Y,e,C],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,R,Y,e,k,G],rules:[{["conditions"]:i,endpoint:_s,["type"]:"endpoint"},{endpoint:_s,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,R,Y,e,k,K],endpoint:_s,["type"]:"endpoint"},{["conditions"]:[A,R,M,e,C],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,R,M,e,k,G],rules:[{["conditions"]:i,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:S},["type"]:"endpoint"},{endpoint:Yf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,R,M,e,k,K],endpoint:Yf,["type"]:"endpoint"}],["type"]:"tree"},jr],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[U,W,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[$h,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[V,!0]},vs,R,A,M],rules:[{["conditions"]:b,rules:[{["conditions"]:Ah,rules:[Bf],["type"]:"tree"},jr],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[vs,{["fn"]:"aws.parseArn",["argv"]:Qw,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[L,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Uh,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[js,"s3-object-lambda"]}],rules:[{["conditions"]:fl,rules:[{["conditions"]:kh,rules:[vf,qf,{["conditions"]:hl,rules:[Of,{["conditions"]:Ih,rules:[cs,{["conditions"]:ml,rules:[{["conditions"]:b,rules:[{["conditions"]:dh,rules:[{["conditions"]:gl,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Ch,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:wl,rules:[{["conditions"]:Ph,rules:[{["conditions"]:u,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:bs,["headers"]:S},["type"]:"endpoint"},{["conditions"]:wr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:bs,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:bs,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},_f],["type"]:"tree"},is],["type"]:"tree"},xs],["type"]:"tree"},os],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},jf],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},cf],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:fl,rules:[{["conditions"]:kh,rules:[{["conditions"]:hl,rules:[{["conditions"]:fl,rules:[{["conditions"]:hl,rules:[Of,{["conditions"]:Ih,rules:[cs,{["conditions"]:ml,rules:[{["conditions"]:b,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Th,"{partitionResult#name}"]}],rules:[{["conditions"]:gl,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[js,"s3"]}],rules:[{["conditions"]:wl,rules:[{["conditions"]:Ph,rules:[{["conditions"]:cr,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[d,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Cr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Cr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[R,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Cr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[R,A,U,W],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Cr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[R,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Cr,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},_f],["type"]:"tree"},is],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},xs],["type"]:"tree"},os],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},jf],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[Sl,!0]}],rules:[{["conditions"]:rl,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:wr,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:cr,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"]:ts,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[L,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:Yw}]},["headers"]:S},["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"},cf],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[js,"s3-outposts"]}],rules:[{["conditions"]:rl,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:wr,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:cr,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:vw,["assign"]:"outpostId"}],rules:[{["conditions"]:eh,rules:[cs,{["conditions"]:ml,rules:[{["conditions"]:b,rules:[{["conditions"]:dh,rules:[{["conditions"]:gl,rules:[{["conditions"]:wl,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:qw,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[L,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:u,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:bf,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:bf,["headers"]:S},["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"},is],["type"]:"tree"},xs],["type"]:"tree"},os],["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"]:[V,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[xf]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[yw,!0]},xf],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:sl,rules:[{["conditions"]:b,rules:[{["conditions"]:[M],rules:[{["conditions"]:[I,e,d,C],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[I,e,d,k,G],rules:[{endpoint:of,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,e,d,k,K],endpoint:of,["type"]:"endpoint"},{["conditions"]:[A,e,d,C],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,e,d,k,G],rules:[{endpoint:nf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,e,d,k,K],endpoint:nf,["type"]:"endpoint"},{["conditions"]:[I,e,R,C],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[I,e,R,k,G],rules:[{endpoint:pf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,e,R,k,K],endpoint:pf,["type"]:"endpoint"},{["conditions"]:[A,U,W,R,C],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,U,W,R,k,G],rules:[{["conditions"]:i,endpoint:ns,["type"]:"endpoint"},{endpoint:ns,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,U,W,R,k,K],endpoint:ns,["type"]:"endpoint"},{["conditions"]:[A,e,R,C],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,e,R,k,G],rules:[{["conditions"]:i,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:S},["type"]:"endpoint"},{endpoint:uf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,e,R,k,K],endpoint:uf,["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"]:[tf]},{["fn"]:"booleanEquals",["argv"]:[tf,!0]}],rules:[{["conditions"]:b,rules:[{["conditions"]:Eh,rules:[vf,qf,{["conditions"]:u,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:ps,["headers"]:S},["type"]:"endpoint"},{["conditions"]:wr,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:ps,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:ps,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},jr],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Zf],rules:[{["conditions"]:b,rules:[{["conditions"]:Eh,rules:[{["conditions"]:[d,I,e,C],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,I,e,k,G],rules:[{endpoint:rh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,I,e,k,K],endpoint:rh,["type"]:"endpoint"},{["conditions"]:[d,A,e,C],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,A,e,k,G],rules:[{endpoint:sh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,A,e,k,K],endpoint:sh,["type"]:"endpoint"},{["conditions"]:[R,I,e,C],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[R,I,e,k,G],rules:[{endpoint:lh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,I,e,k,K],endpoint:lh,["type"]:"endpoint"},{["conditions"]:[R,A,U,W,C],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[R,A,U,W,k,G],rules:[{["conditions"]:i,endpoint:us,["type"]:"endpoint"},{endpoint:us,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,A,U,W,k,K],endpoint:us,["type"]:"endpoint"},{["conditions"]:[R,A,e,C],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[R,A,e,k,G],rules:[{["conditions"]:i,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:S},["type"]:"endpoint"},{endpoint:fh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,A,e,k,K],endpoint:fh,["type"]:"endpoint"}],["type"]:"tree"},jr],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},zh=Ow;var or=(r,s={})=>{return Gh(zh,{endpointParams:r,logger:s.logger})};Fh.aws=Kh;var Lh=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},Xh=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},_w=(r)=>async(s,l,f)=>{if(!f)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const h=await r(s,l,f),m=Ur(l)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!m)throw new Error(`getEndpointParameterInstructions() is not defined on \`${l.commandName}\``);const g=await Vh(f,{getEndpointParameterInstructions:m},s);return Object.assign(h,g)},jw=async(r,s,l)=>{return{operation:Ur(s).operation,region:await Wh(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Zh=_w(jw),cw=(r,s,l)=>{return(h)=>{const g=r(h).properties?.authSchemes;if(!g)return s(h);const w=[];for(let a of g){const{name:P,properties:E={},...$}=a,N=P.toLowerCase();if(P!==N)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${P}\` to \`${N}\``);let J;if(N==="sigv4a"){J="aws.auth#sigv4a";const Jr=g.find((O)=>{const $r=O.name.toLowerCase();return $r!=="sigv4a"&&$r.startsWith("sigv4")});if(!Or.CrtSignerV4&&Jr)continue}else if(N.startsWith("sigv4"))J="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${N}\``);const y=l[J];if(!y)throw new Error(`Could not find HttpAuthOption create function for \`${J}\``);const B=y(h);B.schemeId=J,B.signingProperties={...B.signingProperties||{},...$,...E},w.push(B)}return w}},bw=(r)=>{const s=[];switch(r.operation){default:s.push(Lh(r)),s.push(Xh(r))}return s},Jh=cw(or,bw,{"aws.auth#sigv4":Lh,"aws.auth#sigv4a":Xh}),yh=(r)=>{const s=pr.resolveAwsSdkSigV4Config(r);return{...pr.resolveAwsSdkSigV4AConfig(s)}};var Hh=(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 Qh{constructor(r){super(r);Object.setPrototypeOf(this,Z.prototype)}}class ur extends Z{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,ur.prototype)}}class tr extends Z{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,tr.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 ss extends Z{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,ss.prototype)}}class ls extends Z{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,ls.prototype)}}var el;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(el||(el={}));var Rl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return l.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return l.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Rl||(Rl={}));var Al;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.AccessPointArn!==void 0)return l.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Al||(Al={}));var kl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(kl||(kl={}));class fs extends Z{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,fs.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class hs extends Z{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,hs.prototype)}}class ms extends Z{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,ms.prototype)}}var iw=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:v},...r.SessionToken&&{SessionToken:v}}),Bh=(r)=>({...r,...r.Credentials&&{Credentials:iw(r.Credentials)}});var Yh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v}}),vh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:v}});var Rr=H(nr(),1);var es=H(ys(),1);class gs extends Z{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,gs.prototype)}}var qh;(function(r){r.visit=(s,l)=>{if(s.Records!==void 0)return l.Records(s.Records);if(s.Stats!==void 0)return l.Stats(s.Stats);if(s.Progress!==void 0)return l.Progress(s.Progress);if(s.Cont!==void 0)return l.Cont(s.Cont);if(s.End!==void 0)return l.End(s.End);return l._(s.$unknown[0],s.$unknown[1])}})(qh||(qh={}));var Oh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}}),_h=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:v},...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}});var lm=async(r,s)=>{const l=es.requestBuilder(r,s),f=z({},j,{[l3]:r[Xa]});l.bp("/"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const h=z({[ua]:[,""]});let m;return l.m("GET").h(f).q(h).b(m),l.build()};var fm=async(r,s)=>{const l=es.requestBuilder(r,s),f=z({},j,{[va]:r[Na],[qa]:[()=>j(r[jh]),()=>zr(r[jh]).toString()],[Oa]:r[$a],[_a]:[()=>j(r[ch]),()=>zr(r[ch]).toString()],[ca]:r[Ca],[ks]:r[Rs],[Hm]:r[$m],[Is]:r[As],[Xm]:r[Nm],[Wm]:r[km],[s3]:r[Sa]});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const h=z({[Ym]:[,"GetObject"],[ba]:[,r[za]],[ia]:[,r[Fa]],[xa]:[,r[Ga]],[oa]:[,r[Ka]],[na]:[,r[Wa]],[pa]:[()=>r.ResponseExpires!==void 0,()=>zr(r[Va]).toString()],[ta]:[,r[Xl]],[ja]:[()=>r.PartNumber!==void 0,()=>r[Ta].toString()]});let m;return l.m("GET").h(f).q(h).b(m),l.build()};var hm=async(r,s)=>{const l=es.requestBuilder(r,s),f=z({},j,{[Fm]:r[Am]||"application/octet-stream",[r3]:r[ga],[Um]:r[am],[Tm]:r[Sm],[Cm]:r[em],[zm]:r[Rm],[Ul]:[()=>j(r[$l]),()=>r[$l].toString()],[Qa]:r[ea],[S3]:r[aa],[Jl]:r[Gl],[yl]:r[Kl],[Hl]:r[Wl],[Ql]:r[Vl],[Tl]:[()=>j(r[Dl]),()=>zr(r[Dl]).toString()],[f3]:r[Ia],[h3]:r[da],[m3]:r[Pa],[g3]:r[Ea],[Bl]:r[Zl],[Jm]:r[Gr],[Bm]:r[Mm],[ks]:r[Rs],[Hm]:r[$m],[Is]:r[As],[Yl]:r[Ll],[ym]:r[Dm],[Kr]:[()=>j(r[Ss]),()=>r[Ss].toString()],[Xm]:r[Nm],[e3]:r[Ja],[Zm]:r[Pm],[Cl]:[()=>j(r[Ml]),()=>sm(r[Ml]).toString()],[Vm]:r[dm],[Wm]:r[km],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((w,a)=>{return w[`x-amz-meta-${a.toLowerCase()}`]=r.Metadata[a],w},{})});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const h=z({[Ym]:[,"PutObject"]});let m,g;if(r.Body!==void 0)g=r.Body,m=g;return l.m("PUT").h(f).q(h).b(m),l.build()};var mm=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Fl(r,s);const l=z({$metadata:Q(r)}),f=Sr(uh(await Rr.parseXmlBody(r.body,s)),"body");if(f[Pl]!=null)l[Pl]=ma(f[Pl],s);return l};var gm=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Fl(r,s);const l=z({$metadata:Q(r),[Aa]:[()=>r.headers[ih]!==void 0,()=>as(r.headers[ih])],[wa]:[,r.headers[Ha]],[Fr]:[,r.headers[Km]],[La]:[,r.headers[w3]],[Da]:[()=>r.headers[bh]!==void 0,()=>Sr(Dr(r.headers[bh]))],[$l]:[()=>r.headers[Ul]!==void 0,()=>th(r.headers[Ul])],[Im]:[,r.headers[Gm]],[Gl]:[,r.headers[Jl]],[Kl]:[,r.headers[yl]],[Wl]:[,r.headers[Hl]],[Vl]:[,r.headers[Ql]],[Ma]:[()=>r.headers[xh]!==void 0,()=>ws(r.headers[xh])],[Xl]:[,r.headers[Qm]],[am]:[,r.headers[Um]],[Sm]:[,r.headers[Tm]],[em]:[,r.headers[Cm]],[Rm]:[,r.headers[zm]],[Ra]:[,r.headers[Ba]],[Am]:[,r.headers[Fm]],[Dl]:[()=>r.headers[Tl]!==void 0,()=>Sr(Dr(r.headers[Tl]))],[ka]:[,r.headers[Ya]],[Mm]:[,r.headers[Bm]],[Zl]:[,r.headers[Bl]],[Rs]:[,r.headers[ks]],[As]:[,r.headers[Is]],[Ll]:[,r.headers[Yl]],[Ss]:[()=>r.headers[Kr]!==void 0,()=>as(r.headers[Kr])],[Gr]:[,r.headers[Jm]],[Em]:[,r.headers[Lm]],[Za]:[,r.headers[a3]],[Ua]:[()=>r.headers[oh]!==void 0,()=>ws(r.headers[oh])],[ya]:[()=>r.headers[nh]!==void 0,()=>ws(r.headers[nh])],[Pm]:[,r.headers[Zm]],[Ml]:[()=>r.headers[Cl]!==void 0,()=>Sr(zl(r.headers[Cl]))],[dm]:[,r.headers[Vm]],Metadata:[,Object.keys(r.headers).filter((h)=>h.startsWith("x-amz-meta-")).reduce((h,m)=>{return h[m.substring(11)]=r.headers[m],h},{})]}),f=r.body;return s.sdkStreamMixin(f),l.Body=f,l};var wm=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Fl(r,s);const l=z({$metadata:Q(r),[Fr]:[,r.headers[Km]],[Im]:[,r.headers[Gm]],[Gl]:[,r.headers[Jl]],[Kl]:[,r.headers[yl]],[Wl]:[,r.headers[Hl]],[Vl]:[,r.headers[Ql]],[Zl]:[,r.headers[Bl]],[Xl]:[,r.headers[Qm]],[Rs]:[,r.headers[ks]],[As]:[,r.headers[Is]],[Ll]:[,r.headers[Yl]],[Dm]:[,r.headers[ym]],[Ss]:[()=>r.headers[Kr]!==void 0,()=>as(r.headers[Kr])],[Em]:[,r.headers[Lm]]});return await ph(r.body,s),l};var Fl=async(r,s)=>{const l={...r,body:await Rr.parseXmlErrorBody(r.body,s)},f=Rr.loadRestXmlErrorCode(r,l.body);switch(f){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await sa(l,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await ha(l,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await nw(l,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await pw(l,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await tw(l,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await uw(l,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await ra(l,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await la(l,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await fa(l,s);default:const h=l.body;return ow({output:r,parsedBody:h,errorCode:f})}},ow=rm(Z),nw=async(r,s)=>{const l=z({}),f=r.body,h=new rs({$metadata:Q(r),...l});return q(h,r.body)},pw=async(r,s)=>{const l=z({}),f=r.body,h=new ss({$metadata:Q(r),...l});return q(h,r.body)},uw=async(r,s)=>{const l=z({}),f=r.body;if(f[dl]!=null)l[dl]=er(f[dl]);if(f[Gr]!=null)l[Gr]=er(f[Gr]);const h=new fs({$metadata:Q(r),...l});return q(h,r.body)},tw=async(r,s)=>{const l=z({}),f=r.body,h=new ls({$metadata:Q(r),...l});return q(h,r.body)},ra=async(r,s)=>{const l=z({}),f=r.body,h=new hs({$metadata:Q(r),...l});return q(h,r.body)},sa=async(r,s)=>{const l=z({}),f=r.body,h=new ur({$metadata:Q(r),...l});return q(h,r.body)},la=async(r,s)=>{const l=z({}),f=r.body,h=new ms({$metadata:Q(r),...l});return q(h,r.body)},fa=async(r,s)=>{const l=z({}),f=r.body,h=new gs({$metadata:Q(r),...l});return q(h,r.body)},ha=async(r,s)=>{const l=z({}),f=r.body,h=new tr({$metadata:Q(r),...l});return q(h,r.body)};var ma=(r,s)=>{const l={};if(r[Il]!=null)l[Il]=er(r[Il]);if(r[El]!=null)l[El]=er(r[El]);if(r[Nl]!=null)l[Nl]=er(r[Nl]);if(r[Fr]!=null)l[Fr]=Sr(zl(r[Fr]));return l};var Q=(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 ga="ACL";var Il="AccessKeyId";var wa="AcceptRanges";var dl="AccessTier";var Ss="BucketKeyEnabled";var Pl="Credentials",aa="ChecksumAlgorithm";var am="CacheControl",Gl="ChecksumCRC32",Kl="ChecksumCRC32C",Sm="ContentDisposition";var em="ContentEncoding";var Rm="ContentLanguage",$l="ContentLength",Sa="ChecksumMode",ea="ContentMD5";var Ra="ContentRange";var Wl="ChecksumSHA1",Vl="ChecksumSHA256";var Am="ContentType";var Aa="DeleteMarker";var Dl="Expires";var km="ExpectedBucketOwner";var ka="ExpiresString";var Im="ETag";var Fr="Expiration";var Ia="GrantFullControl";var da="GrantRead",Pa="GrantReadACP";var Ea="GrantWriteACP";var Na="IfMatch",jh="IfModifiedSince",$a="IfNoneMatch";var ch="IfUnmodifiedSince";var Da="LastModified";var Ma="MissingMeta";var dm="ObjectLockLegalHoldStatus",Pm="ObjectLockMode";var Ml="ObjectLockRetainUntilDate";var Ua="PartsCount";var Ta="PartNumber";var Ca="Range";var Em="RequestCharged",za="ResponseCacheControl",Fa="ResponseContentDisposition",Ga="ResponseContentEncoding",Ka="ResponseContentLanguage",Wa="ResponseContentType";var Va="ResponseExpires";var Nm="RequestPayer";var Za="ReplicationStatus";var La="Restore";var El="SecretAccessKey";var Gr="StorageClass";var Xa="SessionMode";var Zl="ServerSideEncryption";var Rs="SSECustomerAlgorithm",$m="SSECustomerKey",As="SSECustomerKeyMD5";var Dm="SSEKMSEncryptionContext",Ll="SSEKMSKeyId";var Nl="SessionToken";var Ja="Tagging";var ya="TagCount";var Xl="VersionId";var Mm="WebsiteRedirectLocation";var Ha="accept-ranges";var Um="cache-control",Tm="content-disposition",Cm="content-encoding",zm="content-language",Ul="content-length",Qa="content-md5",Ba="content-range",Fm="content-type";var Tl="expires";var Gm="etag",Ya="expiresstring";var va="if-match",qa="if-modified-since";var Oa="if-none-match";var _a="if-unmodified-since";var bh="last-modified";var ja="partNumber";var ca="range",ba="response-cache-control",ia="response-content-disposition",xa="response-content-encoding",oa="response-content-language",na="response-content-type",pa="response-expires";var ua="session";var ta="versionId";var r3="x-amz-acl";var Jl="x-amz-checksum-crc32",yl="x-amz-checksum-crc32c",s3="x-amz-checksum-mode";var Hl="x-amz-checksum-sha1",Ql="x-amz-checksum-sha256";var l3="x-amz-create-session-mode";var ih="x-amz-delete-marker",Km="x-amz-expiration",Wm="x-amz-expected-bucket-owner";var f3="x-amz-grant-full-control",h3="x-amz-grant-read",m3="x-amz-grant-read-acp";var g3="x-amz-grant-write-acp";var xh="x-amz-missing-meta";var oh="x-amz-mp-parts-count";var Vm="x-amz-object-lock-legal-hold",Zm="x-amz-object-lock-mode",Cl="x-amz-object-lock-retain-until-date";var w3="x-amz-restore",Lm="x-amz-request-charged";var Xm="x-amz-request-payer";var a3="x-amz-replication-status";var Jm="x-amz-storage-class",S3="x-amz-sdk-checksum-algorithm";var Bl="x-amz-server-side-encryption",Yl="x-amz-server-side-encryption-aws-kms-key-id",Kr="x-amz-server-side-encryption-bucket-key-enabled",ym="x-amz-server-side-encryption-context",ks="x-amz-server-side-encryption-customer-algorithm",Hm="x-amz-server-side-encryption-customer-key",Is="x-amz-server-side-encryption-customer-key-md5",e3="x-amz-tagging",nh="x-amz-tagging-count";var Qm="x-amz-version-id",Bm="x-amz-website-redirect-location",Ym="x-id";class vl extends Ar.classBuilder().ep({...ar,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,l,f){return[kr(l,this.serialize,this.deserialize),Ir(l,r.getEndpointParameterInstructions()),qr(l)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(void 0,Bh).ser(lm).de(mm).build(){}var vm={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 Ts=H(nr(),1);var A3="AWS_S3_USE_ARN_REGION",k3="s3_use_arn_region",qm={environmentVariableSelector:(r)=>n(r,A3,p.ENV),configFileSelector:(r)=>n(r,k3,p.CONFIG),default:!1};var Om=H(T3(),1),{__extends:QR,__assign:BR,__rest:YR,__decorate:vR,__param:qR,__esDecorate:OR,__runInitializers:_R,__propKey:jR,__setFunctionName:cR,__metadata:bR,__awaiter:ds,__generator:Ps,__exportStar:iR,__createBinding:xR,__values:Es,__read:oR,__spread:nR,__spreadArrays:pR,__spreadArray:uR,__await:tR,__asyncGenerator:rA,__asyncDelegator:sA,__asyncValues:lA,__makeTemplateObject:fA,__importStar:hA,__importDefault:mA,__classPrivateFieldGet:gA,__classPrivateFieldSet:wA,__classPrivateFieldIn:aA,__addDisposableResource:SA,__disposeResources:eA}=Om.default;import{Buffer as _m} from"buffer";var jm=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?_m.from(r,s):_m.from(r)};var ql=(r)=>{const s=jm(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function Wr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return C3(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var C3=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:ql;function Vr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Zr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Lr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),l=0;while(l<r.length)s[l]=r[l],l+=1;return s}return Uint32Array.from(r)}var Ol=function(){function r(){this.crc32=new t}return r.prototype.update=function(s){if(Vr(s))return;this.crc32.update(Wr(s))},r.prototype.digest=function(){return ds(this,void 0,void 0,function(){return Ps(this,function(s){return[2,Zr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new t},r}();var t=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var h=Es(s),m=h.next();!m.done;m=h.next()){var g=m.value;this.checksum=this.checksum>>>8^F3[(this.checksum^g)&255]}}catch(w){l={error:w}}finally{try{if(m&&!m.done&&(f=h.return))f.call(h)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var z3=[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],F3=Lr(z3);var x=H(bm(),1);var im=H(bm(),1),cm=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 dr{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let l=7,f=Math.abs(Math.round(r));l>-1&&f>0;l--,f/=256)s[l]=f;if(r<0)cm(s);return new dr(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)cm(r);return parseInt(im.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class _l{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let h of Object.keys(r)){const m=this.fromUtf8(h);s.push(Uint8Array.from([m.byteLength]),m,this.formatHeaderValue(r[h]))}const l=new Uint8Array(s.reduce((h,m)=>h+m.byteLength,0));let f=0;for(let h of s)l.set(h,f),f+=h.byteLength;return l}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const l=new DataView(new ArrayBuffer(5));return l.setUint8(0,4),l.setInt32(1,r.value,!1),new Uint8Array(l.buffer);case"long":const f=new Uint8Array(9);return f[0]=5,f.set(r.value.bytes,1),f;case"binary":const h=new DataView(new ArrayBuffer(3+r.value.byteLength));h.setUint8(0,6),h.setUint16(1,r.value.byteLength,!1);const m=new Uint8Array(h.buffer);return m.set(r.value,3),m;case"string":const g=this.fromUtf8(r.value),w=new DataView(new ArrayBuffer(3+g.byteLength));w.setUint8(0,7),w.setUint16(1,g.byteLength,!1);const a=new Uint8Array(w.buffer);return a.set(g,3),a;case"timestamp":const P=new Uint8Array(9);return P[0]=8,P.set(dr.fromNumber(r.value.valueOf()).bytes,1),P;case"uuid":if(!y3.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const E=new Uint8Array(17);return E[0]=9,E.set(x.fromHex(r.value.replace(/\-/g,"")),1),E}}parse(r){const s={};let l=0;while(l<r.byteLength){const f=r.getUint8(l++),h=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,f));switch(l+=f,r.getUint8(l++)){case 0:s[h]={type:om,value:!0};break;case 1:s[h]={type:om,value:!1};break;case 2:s[h]={type:G3,value:r.getInt8(l++)};break;case 3:s[h]={type:K3,value:r.getInt16(l,!1)},l+=2;break;case 4:s[h]={type:W3,value:r.getInt32(l,!1)},l+=4;break;case 5:s[h]={type:V3,value:new dr(new Uint8Array(r.buffer,r.byteOffset+l,8))},l+=8;break;case 6:const m=r.getUint16(l,!1);l+=2,s[h]={type:Z3,value:new Uint8Array(r.buffer,r.byteOffset+l,m)},l+=m;break;case 7:const g=r.getUint16(l,!1);l+=2,s[h]={type:L3,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,g))},l+=g;break;case 8:s[h]={type:X3,value:new Date(new dr(new Uint8Array(r.buffer,r.byteOffset+l,8)).valueOf())},l+=8;break;case 9:const w=new Uint8Array(r.buffer,r.byteOffset+l,16);l+=16,s[h]={type:J3,value:`${x.toHex(w.subarray(0,4))}-${x.toHex(w.subarray(4,6))}-${x.toHex(w.subarray(6,8))}-${x.toHex(w.subarray(8,10))}-${x.toHex(w.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var xm;(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"})(xm||(xm={}));var om="boolean",G3="byte",K3="short",W3="integer",V3="long",Z3="binary",L3="string",X3="timestamp",J3="uuid",y3=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function pm({byteLength:r,byteOffset:s,buffer:l}){if(r<H3)throw new Error("Provided message too short to accommodate event stream message overhead");const f=new DataView(l,s,r),h=f.getUint32(0,!1);if(r!==h)throw new Error("Reported message length does not match received message length");const m=f.getUint32(nm,!1),g=f.getUint32(o,!1),w=f.getUint32(r-rr,!1),a=new t().update(new Uint8Array(l,s,o));if(g!==a.digest())throw new Error(`The prelude checksum specified in the message (${g}) does not match the calculated CRC32 checksum (${a.digest()})`);if(a.update(new Uint8Array(l,s+o,r-(o+rr))),w!==a.digest())throw new Error(`The message checksum (${a.digest()}) did not match the expected value of ${w}`);return{headers:new DataView(l,s+o+rr,m),body:new Uint8Array(l,s+o+rr+m,h-m-(o+rr+rr))}}var nm=4,o=nm*2,rr=4,H3=o+rr*2;class jl{constructor(r,s){this.headerMarshaller=new _l(r,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(r){this.messageBuffer.push(this.decode(r))}endOfStream(){this.isEndOfStream=!0}getMessage(){const r=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return r},isEndOfStream(){return s}}}getAvailableMessages(){const r=this.messageBuffer;this.messageBuffer=[];const s=this.isEndOfStream;return{getMessages(){return r},isEndOfStream(){return s}}}encode({headers:r,body:s}){const l=this.headerMarshaller.format(r),f=l.byteLength+s.byteLength+16,h=new Uint8Array(f),m=new DataView(h.buffer,h.byteOffset,h.byteLength),g=new t;return m.setUint32(0,f,!1),m.setUint32(4,l.byteLength,!1),m.setUint32(8,g.update(h.subarray(0,8)).digest(),!1),h.set(l,12),h.set(s,l.byteLength+12),m.setUint32(f-4,g.update(h.subarray(8,f-4)).digest(),!1),h}decode(r){const{headers:s,body:l}=pm(r);return{headers:this.headerMarshaller.parse(s),body:l}}formatHeaders(r){return this.headerMarshaller.format(r)}}class cl{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 bl{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 il{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 xl{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 um(r){let s=0,l=0,f=null,h=null;const m=(w)=>{if(typeof w!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+w);s=w,l=4,f=new Uint8Array(w),new DataView(f.buffer).setUint32(0,w,!1)},g=async function*(){const w=r[Symbol.asyncIterator]();while(!0){const{value:a,done:P}=await w.next();if(P){if(!s)return;else if(s===l)yield f;else throw new Error("Truncated event message received.");return}const E=a.length;let $=0;while($<E){if(!f){const J=E-$;if(!h)h=new Uint8Array(4);const y=Math.min(4-l,J);if(h.set(a.slice($,$+y),l),l+=y,$+=y,l<4)break;m(new DataView(h.buffer).getUint32(0,!1)),h=null}const N=Math.min(s-l,E-$);if(f.set(a.slice($,$+N),l),l+=N,$+=N,s&&s===l)yield f,f=null,s=0,l=0}}};return{[Symbol.asyncIterator]:g}}function tm(r,s){return async function(l){const{value:f}=l.headers[":message-type"];if(f==="error"){const h=new Error(l.headers[":error-message"].value||"UnknownError");throw h.name=l.headers[":error-code"].value,h}else if(f==="exception"){const h=l.headers[":exception-type"].value,m={[h]:l},g=await r(m);if(g.$unknown){const w=new Error(s(l.body));throw w.name=h,w}throw g[h]}else if(f==="event"){const h={[l.headers[":event-type"].value]:l},m=await r(h);if(m.$unknown)return;return m}else throw Error(`Unrecognizable event type: ${l.headers[":event-type"].value}`)}}class Ns{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new jl(r,s),this.utfEncoder=r}deserialize(r,s){const l=um(r);return new il({messageStream:new cl({inputStream:l,decoder:this.eventStreamCodec}),deserializer:tm(s,this.utfEncoder)})}serialize(r,s){return new bl({messageStream:new xl({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as Q3} from"stream";async function*rg(r){let s=!1,l=!1;const f=new Array;r.on("error",(h)=>{if(!s)s=!0;if(h)throw h}),r.on("data",(h)=>{f.push(h)}),r.on("end",()=>{s=!0});while(!l){const h=await new Promise((m)=>setTimeout(()=>m(f.shift()),0));if(h)yield h;l=s&&f.length===0}}class ol{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Ns({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const l=typeof r[Symbol.asyncIterator]==="function"?r:rg(r);return this.universalMarshaller.deserialize(l,s)}serialize(r,s){return Q3.from(this.universalMarshaller.serialize(r,s))}}var sg=(r)=>new ol(r);import{Writable as B3} from"stream";class Ds extends B3{constructor(r,s){super(s);this.hash=r}_write(r,s,l){try{this.hash.update($s(r))}catch(f){return l(f)}l()}}var lg=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const l=new r,f=new Ds(l);return s.pipe(f),new Promise((h,m)=>{s.on("error",(g)=>{f.end(),m(g)}),f.on("error",m),f.on("finish",()=>{l.digest().then(h).catch(m)})})};var Ms=H(nr(),1);var eg=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??fg,base64Encoder:r?.base64Encoder??gg,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??or,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??wg,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Jh,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Ms.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new Ms.AwsSdkSigV4ASigner}],logger:r?.logger??new Qr,sdkStreamMixin:r?.sdkStreamMixin??ag,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??Bs,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??Sg,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??hg,utf8Encoder:r?.utf8Encoder??mg}};var Fg=(r)=>{Ig(process.version);const s=Cg(r),l=()=>s().then(kg),f=eg(r);return Ts.emitWarningIfUnsupportedVersion(process.version),{...f,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??Tg,credentialDefaultProvider:r?.credentialDefaultProvider??zg,defaultUserAgentProvider:r?.defaultUserAgentProvider??Ug({serviceId:f.serviceId,clientVersion:vm.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??c(Xs),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??sg,maxAttempts:r?.maxAttempts??c(Dg),md5:r?.md5??Us.bind(null,"md5"),region:r?.region??c(Eg,Ng),requestHandler:Rg.create(r?.requestHandler??l),retryMode:r?.retryMode??c({...Mg,default:async()=>(await l()).retryMode||$g}),sha1:r?.sha1??Us.bind(null,"sha1"),sha256:r?.sha256??Us.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??c(Ts.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??Ag,streamHasher:r?.streamHasher??lg,useArnRegion:r?.useArnRegion??c(qm),useDualstackEndpoint:r?.useDualstackEndpoint??c(dg),useFipsEndpoint:r?.useFipsEndpoint??c(Pg)}};var Gg=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:l,credentials:f}=r;return{setHttpAuthScheme(h){const m=s.findIndex((g)=>g.schemeId===h.schemeId);if(m===-1)s.push(h);else s.splice(m,1,h)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(h){l=h},httpAuthSchemeProvider(){return l},setCredentials(h){f=h},credentials(){return f}}},Kg=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var Cs=(r)=>r,yg=(r,s)=>{const l={...Cs(Xg(r)),...Cs(Zg(r)),...Cs(Wg(r)),...Cs(Gg(r))};return s.forEach((f)=>f.configure(l)),{...r,...Jg(l),...Lg(l),...Vg(l),...Kg(l)}};class nl extends vg{constructor(...[r]){const s=Fg(r||{}),l=Hh(s),f=qg(l),h=bg(f),m=_g(h),g=Hg(m),w=cg(g),a=Ff(w),P=yh(a),E=Df(P,{session:[()=>this,vl]}),$=yg(E,r?.extensions||[]);super($);this.config=$,this.middlewareStack.use(Og(this.config)),this.middlewareStack.use(ig(this.config)),this.middlewareStack.use(jg(this.config)),this.middlewareStack.use(Qg(this.config)),this.middlewareStack.use(Bg(this.config)),this.middlewareStack.use(Yg(this.config)),this.middlewareStack.use(Pr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Zh,identityProviderConfigProvider:async(N)=>new Pr.DefaultIdentityProviderConfig({"aws.auth#sigv4":N.credentials,"aws.auth#sigv4a":N.credentials})})),this.middlewareStack.use(Pr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(zf(this.config)),this.middlewareStack.use(ff(this.config)),this.middlewareStack.use(wf(this.config)),this.middlewareStack.use(Js(this.config)),this.middlewareStack.use(Hs(this.config))}destroy(){super.destroy()}}function Y3(r){return(s)=>async(l)=>{const f={...l.input},h=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let m of h){const g=f[m.target];if(g){let w;if(typeof g==="string")if(q3(g,r))w=r.base64Decoder(g);else w=r.utf8Decoder(g),f[m.target]=r.base64Encoder(w);else w=ArrayBuffer.isView(g)?new Uint8Array(g.buffer,g.byteOffset,g.byteLength):new Uint8Array(g),f[m.target]=r.base64Encoder(w);const a=new r.md5;a.update(w),f[m.hash]=r.base64Encoder(await a.digest())}}return s({...l,input:f})}}function q3(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 v3={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},zs=(r)=>({applyToStack:(s)=>{s.add(Y3(r),v3)}});var D;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(D||(D={}));var xg;(function(r){r.HEADER="header",r.TRAILER="trailer"})(xg||(xg={}));var{MD5:og,CRC32:ng}=D;var Xr=[D.CRC32,D.CRC32C,D.SHA1,D.SHA256],pg=[D.CRC32,D.CRC32C,D.SHA1,D.SHA256];var ug=(r,{requestChecksumRequired:s,requestAlgorithmMember:l},f)=>{const h=f?ng:og;if(!l||!r[l])return s?h:void 0;const m=r[l];if(!Xr.includes(m))throw new Error(`The checksum algorithm "${m}" is not supported by the client.`+` Select one of ${Xr}.`);return m};var Er=(r)=>r===D.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var tg=(r,s)=>{const l=r.toLowerCase();for(let f of Object.keys(s))if(l===f.toLowerCase())return!0;return!1};var Nr=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!rw(r);var ul=function(){function r(){this.crc32c=new pl}return r.prototype.update=function(s){if(Vr(s))return;this.crc32c.update(Wr(s))},r.prototype.digest=function(){return ds(this,void 0,void 0,function(){return Ps(this,function(s){return[2,Zr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new pl},r}();var pl=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var h=Es(s),m=h.next();!m.done;m=h.next()){var g=m.value;this.checksum=this.checksum>>>8^_3[(this.checksum^g)&255]}}catch(w){l={error:w}}finally{try{if(m&&!m.done&&(f=h.return))f.call(h)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var O3=[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],_3=Lr(O3);var Fs=(r,s)=>({[D.MD5]:s.md5,[D.CRC32]:Ol,[D.CRC32C]:ul,[D.SHA1]:s.sha1,[D.SHA256]:s.sha256})[r];var Gs=(r,s)=>{const l=new r;return l.update($s(s||"")),l.digest()};var sw={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},lw=(r,s)=>(l,f)=>async(h)=>{if(!X.isInstance(h.request))return l(h);const{request:m}=h,{body:g,headers:w}=m,{base64Encoder:a,streamHasher:P}=r,{input:E,requestChecksumRequired:$,requestAlgorithmMember:N}=s,J=ug(E,{requestChecksumRequired:$,requestAlgorithmMember:N},!!f.isS3ExpressBucket);let y=g,B=w;if(J){const O=Er(J),$r=Fs(J,r);if(Nr(g)){const{getAwsChunkedEncodingStream:Ls,bodyLengthChecker:Rw}=r;y=Ls(g,{base64Encoder:a,bodyLengthChecker:Rw,checksumLocationName:O,checksumAlgorithmFn:$r,streamHasher:P}),B={...w,"content-encoding":w["content-encoding"]?`${w["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":w["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":O},delete B["content-length"]}else if(!tg(O,w)){const Ls=await Gs($r,g);B={...w,[O]:a(Ls)}}}return await l({...h,request:{...m,headers:B,body:y}})};var Ks=(r=[])=>{const s=[];for(let l of pg){if(!r.includes(l)||!Xr.includes(l))continue;s.push(l)}return s};var fw=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const l=r.slice(s+1);if(!l.startsWith("0")){const f=parseInt(l,10);if(!isNaN(f)&&f>=1&&f<=1e4)return!0}}return!1};import{Transform as j3} from"stream";function tl(r){const s=new j3;return s.push(r),s.push(null),s}var hw=async(r,{streamHasher:s,checksumAlgorithmFn:l,base64Encoder:f})=>{const h=Nr(r)?s(l,r):Gs(l,r);return f(await h)};var mw=async(r,{config:s,responseAlgorithms:l})=>{const f=Ks(l),{body:h,headers:m}=r;for(let g of f){const w=Er(g),a=m[w];if(a){const P=Fs(g,s),{streamHasher:E,base64Encoder:$}=s,N=await hw(h,{streamHasher:E,checksumAlgorithmFn:P,base64Encoder:$});if(N===a)break;throw new Error(`Checksum mismatch: expected "${N}" but received "${a}"`+` in response header "${w}".`)}}};var gw={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},ww=(r,s)=>(l,f)=>async(h)=>{if(!X.isInstance(h.request))return l(h);const m=h.input,g=await l(h),w=g.response;let a=void 0;const{requestValidationModeMember:P,responseAlgorithms:E}=s;if(P&&m[P]==="ENABLED"){const{clientName:$,commandName:N}=f;if($==="S3Client"&&N==="GetObjectCommand"&&Ks(E).every((B)=>{const Jr=Er(B),O=w.headers[Jr];return!O||fw(O)}))return g;const y=Nr(w.body);if(y)a=await r.streamCollector(w.body),w.body=tl(a);if(await mw(g.response,{config:r,responseAlgorithms:E}),y&&a)w.body=tl(a)}return g};var Ws=(r,s)=>({applyToStack:(l)=>{l.add(lw(r,s),sw),l.addRelativeTo(ww(r,s),gw)}});class rf extends Ar.classBuilder().ep({...ar,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[kr(l,this.serialize,this.deserialize),Ir(l,r.getEndpointParameterInstructions()),Ws(l,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),zs(l),af(l)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(vh,Yh).ser(fm).de(gm).build(){}class sf extends Ar.classBuilder().ep({...ar,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[kr(l,this.serialize,this.deserialize),Ir(l,r.getEndpointParameterInstructions()),Ws(l,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),hf(l),qr(l),zs(l)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(_h,Oh).ser(hm).de(wm).build(){}import{Buffer as aw} from"buffer";class Sw extends sr{client;constructor(...r){super();this.client=new nl(...r)}async put(r){let s,l,f,h=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,f=`${yr()}.${r.type.split("/")[1].split(";")[0]}`,l=r.type;else s=r.body,f=r.name,l=r.contentType;l=s instanceof Blob||s instanceof File?s.type:void 0;const m=s instanceof aw?s:aw.from(await s.arrayBuffer());return await this.client.send(new sf({Bucket:h,Key:f,Body:m,ContentType:l})),f}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=await this.client.send(new rf({Bucket:s,Key:l}));return new Response(f.Body.transformToWebStream(),{headers:{"Content-Type":f.ContentType,"Content-Length":f.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":f.LastModified?.toUTCString()||"",ETag:f.ETag||""}})}}class Vs{}class Zs extends Vs{constructor(){super(...arguments)}requests=new Map;consume(r,s){if(!this.requests.has(r))this.requests.set(r,{date:Date.now(),count:1});else{const l=this.requests.get(r),f=Date.now();if(f-l.date>=60000)this.requests.set(r,{date:f,count:1});else this.requests.set(r,{date:l.date,count:l.count+1})}return this.requests.get(r).count}}class ew{driver=new Zs}export{Sw as S3Driver,ew as RateLimiterServiceProvider,Vs as RateLimiterDriver,Zs as InMemoryRateLimiter,Hr as FileSystemDriver,lf as FileStorageServiceProvider,sr as FileStorageDriver};export{lf as t,ew as u};
2
+ import"../chunk-b943cac32cc3670f.js";import{A as W} from"../chunk-e3d242546d1a2927.js";import{$ as kr,D as Jr,E as Qg,F as Bg,G as Yg,H as vg,I as Fw,J as n,K as p,L as Yl,M as Js,N as Mr,O as Wh,P as Og,Q as Fh,R as Gh,S as Kh,T as _g,U as Pg,V as Eg,W as Ng,X as $g,Y as jg,Z as cg,_ as Vh,aa as bg,ba as Dg,ca as Mg,da as ig,ea as Ug,fa as xg,ga as or,ha as Tg,ia as Ms,ja as Cg,ka as zg,la as Jg,ma as yg} from"../chunk-8f24eed8ba226c72.js";import{$a as rm,Aa as wg,Ba as ag,Da as Ag,Ea as kg,Fa as im,Ga as Sg,Ha as Mf,Ia as Uf,Ja as ph,Ka as Ar,La as v,Na as ws,Qa as Sr,Ra as uh,Sa as er,Ta as th,Ua as gs,Va as Cr,Xa as Cl,Ya as $r,Za as Qh,_a as q,ab as Ig,bb as dg,cb as Lg,db as Xg,fb as z,hb as sm,na as Vg,oa as Zg,pa as J,qa as Qr,ra as Hr,sa as qg,ta as sw,wa as hg,xa as mg,ya as Ns,za as gg} from"../chunk-28c7d04b6f555350.js";import{jb as Gw} from"../chunk-4e37f45d636da627.js";import{kb as c,lb as eg} from"../chunk-48b2990a93ae50b3.js";import"../chunk-5fb9d31b7b4629e9.js";import"../chunk-9631e167bae739a0.js";import{Eb as Fg} from"../chunk-d4eceea16ddc567d.js";import{Fb as F3} from"../chunk-4ad752c87b795617.js";class sr{}class yr extends sr{r;constructor(r=`${process.env.ROOT_DIR}/storage`){super();this.folderPath=r}async put(r){let s,l;if(r instanceof Blob)s=r,l=`${Jr()}.${r.type.split("/")[1].split(";")[0]}`;else s=r.body,l=r.name;const f=s instanceof Buffer?s:Buffer.from(await s.arrayBuffer()),h=`${this.folderPath}/${l}`;return await Bun.write(h,f),l}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=`${this.folderPath}/${l}`,h=Bun.file(f),m=Bun.file(f).stream(),g=new Date(h.lastModified).toUTCString();return new Response(m,{headers:{"Content-Type":h.type,"Content-Length":String(h.size),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":g}})}}class lf{driver=new yr}function dw(r){return(s)=>async(l)=>{const{request:f}=l;if(J.isInstance(f)&&f.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")f.headers={...f.headers,Expect:"100-continue"}}return s({...l,request:f})}}var Pw={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},ff=(r)=>({applyToStack:(s)=>{s.add(dw(r),Pw)}});function Nw(){return(r,s)=>async(l)=>{const{request:f}=l;if(J.isInstance(f)){if(!(Ew in f.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof Hr))s.logger.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.");else console.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.")}return r({...l})}}var Ew="content-length",$w={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},hf=(r)=>({applyToStack:(s)=>{s.add(Nw(),$w)}});var mf=(r)=>{return(s,l)=>async(f)=>{const h=await r.region(),m=r.region;let g=()=>{};if(l.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return l.__s3RegionRedirect}}),g=()=>Object.defineProperty(r,"region",{writable:!0,value:m});try{const w=await s(f);if(l.__s3RegionRedirect){g();const a=await r.region();if(h!==a)throw new Error("Region was not restored following S3 region redirect.")}return w}catch(w){throw g(),w}}},gf={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Dw(r){return(s,l)=>async(f)=>{try{return await s(f)}catch(h){if(r.followRegionRedirects&&h?.$metadata?.httpStatusCode===301){try{const m=h.$response.headers["x-amz-bucket-region"];l.logger?.debug(`Redirecting from ${await r.region()} to ${m}`),l.__s3RegionRedirect=m}catch(m){throw new Error("Region redirect failed: "+m)}return s(f)}else throw h}}}var Mw={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},wf=(r)=>({applyToStack:(s)=>{s.add(Dw(r),Mw),s.addRelativeTo(mf(r),gf)}});var Uw=(r)=>{return(s,l)=>async(f)=>{const h=await s(f),{response:m}=h;if(Qr.isInstance(m)){if(m.headers.expires){m.headers.expiresstring=m.headers.expires;try{$r(m.headers.expires)}catch(g){l.logger?.warn(`AWS SDK Warning for ${l.clientName}::${l.commandName} response parsing (${m.headers.expires}): ${g}`),delete m.headers.expires}}}return h}},Tw={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},af=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Uw(r),Tw)}});class lr{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+lr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const l=this.data[s];if(!l.isRefreshing){const f=await l.identity;if(f.expiration){if(f.expiration.getTime()<r)delete this.data[s]}}}}}lr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class fr{constructor(r,s=!1,l=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=l}get identity(){return this.accessed=Date.now(),this._identity}}class hr{constructor(r,s=new lr){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const l=s.Bucket,{cache:f}=this,h=f.get(l);if(h)return h.identity.then((m)=>{if((m.expiration?.getTime()??0)<Date.now())return f.set(l,new fr(this.getIdentity(l))).identity;if((m.expiration?.getTime()??0)<Date.now()+hr.REFRESH_WINDOW_MS&&!h.isRefreshing)h.isRefreshing=!0,this.getIdentity(l).then((a)=>{f.set(l,new fr(Promise.resolve(a)))});return m});return f.set(l,new fr(this.getIdentity(l))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((f)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+f)});const s=await this.createSessionFn(r);if(!s.Credentials?.AccessKeyId||!s.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretAccessKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration?new Date(s.Credentials.Expiration):void 0}}}hr.REFRESH_WINDOW_MS=60000;var If=W(Fw(),1);var Sf="Directory",ef="S3Express",Rf="sigv4-s3express",Br="X-Amz-S3session-Token",Dr=Br.toLowerCase(),Cw="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",zw="s3_disable_express_session_auth",Ls={environmentVariableSelector:(r)=>n(r,Cw,p.ENV),configFileSelector:(r)=>n(r,zw,p.CONFIG),default:!1};var Af=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},kf=function(r,s){const l=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),f=r.credentialProvider,h=()=>{return clearTimeout(l),r.credentialProvider=f,Promise.resolve(s)};r.credentialProvider=h};class Yr extends If.SignatureV4{async signWithCredentials(r,s,l){const f=Af(s);r.headers[Dr]=s.sessionToken;const h=this;return kf(h,f),h.signRequest(r,l??{})}async presignWithCredentials(r,s,l){const f=Af(s);return delete r.headers[Dr],r.headers[Br]=s.sessionToken,r.query=r.query??{},r.query[Br]=s.sessionToken,kf(this,f),this.presign(r,l)}}var df=(r)=>{return(s,l)=>async(f)=>{if(l.endpointV2){const h=l.endpointV2,m=h.properties?.authSchemes?.[0]?.name===Rf;if(h.properties?.backend===ef||h.properties?.bucketType===Sf)l.isS3ExpressBucket=!0;if(m){const w=f.input.Bucket;if(w){const a=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:w});if(l.s3ExpressIdentity=a,J.isInstance(f.request)&&a.sessionToken)f.request.headers[Dr]=a.sessionToken}}}return s(f)}},Pf={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},Xs=(r)=>({applyToStack:(s)=>{s.add(df(r),Pf)}});var Nf=W(Js(),1);var Kw=W(Gw(),1);var Ef=async(r,s,l,f)=>{const h=await f.signWithCredentials(l,r,{});if(h.headers["X-Amz-Security-Token"]||h.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return h};var Ww=(r)=>(s)=>{throw s},Vw=(r,s)=>{};var $f=(r)=>(s,l)=>async(f)=>{if(!J.isInstance(f.request))return s(f);const m=Mr(l).selectedHttpAuthScheme;if(!m)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:g={}},identity:w,signer:a}=m;let P;if(l.s3ExpressIdentity)P=await Ef(l.s3ExpressIdentity,g,f.request,await r.signer());else P=await a.sign(f.request,w,g);const E=await s({...f,request:P}).catch((a.errorHandler||Ww)(g));return(a.successHandler||Vw)(E.response,g),E},ys=(r)=>({applyToStack:(s)=>{s.addRelativeTo($f(r),Nf.httpSigningMiddlewareOptions)}});var Df=(r,{session:s})=>{const[l,f]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new hr(async(h)=>l().send(new f({Bucket:h,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var Zw={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Lw=3000,Xw=(r)=>(s,l)=>async(f)=>{const h=await s(f),{response:m}=h;if(!Qr.isInstance(m))return h;const{statusCode:g,body:w}=m;if(g<200||g>=300)return h;let a=w,P=w;if(w&&typeof w==="object"&&!(w instanceof Uint8Array))[a,P]=await Mf(w);m.body=P;const E=await Jw(a,{streamCollector:async(N)=>{return Uf(N,Lw)}});if(typeof a?.destroy==="function")a.destroy();const $=r.utf8Encoder(E.subarray(E.length-16));if(E.length===0&&Zw[l.commandName]){const N=new Error("S3 aborted request");throw N.name="InternalError",N}if($&&$.endsWith("</Error>"))m.statusCode=400;return h},Jw=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},yw={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},vr=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Xw(r),yw)}});var Hs=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function Tf(r){return(s,l)=>async(f)=>{if(r.bucketEndpoint){const h=l.endpointV2;if(h){const m=f.input.Bucket;if(typeof m==="string")try{const g=new URL(m);h.url=g}catch(g){const w=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${m} could not be parsed as URL.`;if(l.logger?.constructor?.name==="NoOpLogger")console.warn(w);else l.logger?.warn?.(w);throw g}}}return s(f)}}var Cf={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Hw({bucketEndpoint:r}){return(s)=>async(l)=>{const{input:{Bucket:f}}=l;if(!r&&typeof f==="string"&&!Hs(f)&&f.indexOf("/")>=0){const h=new Error(`Bucket name shouldn't contain '/', received '${f}'`);throw h.name="InvalidBucketName",h}return s({...l})}}var Qw={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},zf=(r)=>({applyToStack:(s)=>{s.add(Hw(r),Qw),s.addRelativeTo(Tf(r),Cf)}});var dr=W(Js(),1);var Ff=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var nr=W(or(),1);var qr={CrtSignerV4:null};class Qs{constructor(r){this.sigv4Signer=new Yr(r),this.signerOptions=r}async sign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().sign(r,s)}return this.sigv4Signer.sign(r,s)}async signWithCredentials(r,s,l={}){if(l.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().signWithCredentials(r,s,l)}return this.sigv4Signer.signWithCredentials(r,s,l)}async presign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().presign(r,s)}return this.sigv4Signer.presign(r,s)}async presignWithCredentials(r,s,l={}){if(l.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,l)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=qr.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"},Ur={["required"]:!1,["type"]:"Boolean"},Y={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},d={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},I={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},U={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},Nh={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Gf={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},br={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},Z={["ref"]:"Bucket"},V={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},cr={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},$h={["ref"]:"url"},Dh={["fn"]:"uriEncode",["argv"]:[Z],["assign"]:"uri_encoded_bucket"},_={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},S={},Mh={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!1]},Bs={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},ir={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},Kf={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},Wf={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},e={["fn"]:"not",["argv"]:[U]},Vf={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},Zf={["fn"]:"not",["argv"]:[br]},Lf={["ref"]:"hardwareType"},Xf={["conditions"]:[e],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},Or={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},Ys={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},Bw={["ref"]:"ForcePathStyle"},M={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},C={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},F={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},k={["fn"]:"not",["argv"]:[C]},G={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},Jf={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},T={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},A={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},yf={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Hf={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},Qf={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},vs={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[$h,"isIp"]},!1]},qs={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:T,["headers"]:{}},wl={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:T,["headers"]:{}},Bf={["endpoint"]:wl,["type"]:"endpoint"},Os={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},Yf={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},_r={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},X={["ref"]:"bucketArn"},Uh={["ref"]:"arnType"},_s={["fn"]:"getAttr",["argv"]:[X,"service"]},al={["ref"]:"accessPointName"},vf={["conditions"]:[I],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},qf={["conditions"]:[Y],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Of={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},js={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[X,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},Th={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},Ch={["fn"]:"getAttr",["argv"]:[X,"accountId"]},cs={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},_f={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},bs={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},is={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},xs={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},jf={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},cf={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Tr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},bf={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},xf={["fn"]:"aws.parseArn",["argv"]:[Z]},of={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},nf={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},pf={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},os={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},uf={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},tf={["ref"]:"UseObjectLambdaEndpoint"},ns={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},rh={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},sh={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},lh={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},ps={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:T,["headers"]:{}},fh={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},us=[{["ref"]:"Region"}],Yw=[{["ref"]:"Endpoint"}],vw=[Z],ts=[I],jr=[Y],u=[U,V],hh=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],mh=[cr],rl=[Dh],sl=[Mh],wr=[d],gh=[{["fn"]:"substring",["argv"]:[Z,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],wh=[{["conditions"]:[d],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:_,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:_,["headers"]:{}},["type"]:"endpoint"}],ah=[{["fn"]:"substring",["argv"]:[Z,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],Sh=[{["conditions"]:[d],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:ir,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:ir,["headers"]:{}},["type"]:"endpoint"}],qw=[br],eh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],Rh=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Ow=["*"],b=[Nh],Ah=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],i=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],ll=[{["fn"]:"stringEquals",["argv"]:[Uh,"accesspoint"]}],kh=[{["fn"]:"getAttr",["argv"]:[X,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[al,""]}]}],_w=[X,"resourceId[1]"],fl=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[X,"region"]},""]}]}],Ih=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[X,"resourceId[2]"]}]}]}],jw=[X,"resourceId[2]"],hl=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[X,"region"]}],["assign"]:"bucketPartition"}],dh=[{["fn"]:"stringEquals",["argv"]:[Th,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],ml=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[X,"region"]},!0]}],gl=[{["fn"]:"isValidHostLabel",["argv"]:[Ch,!1]}],Ph=[{["fn"]:"isValidHostLabel",["argv"]:[al,!1]}],Eh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],cw={version:"1.0",parameters:{Bucket:mr,Region:mr,UseFIPS:gr,UseDualStack:gr,Endpoint:mr,ForcePathStyle:gr,Accelerate:gr,UseGlobalEndpoint:gr,UseObjectLambdaEndpoint:Ur,Key:mr,Prefix:mr,CopySource:mr,DisableAccessPoints:Ur,DisableMultiRegionAccessPoints:gr,UseArnRegion:Ur,UseS3ExpressControlEndpoint:Ur,DisableS3ExpressSessionAuth:Ur},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:us}],rules:[{["conditions"]:[Y,d],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[I,U],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[U,d],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[U,Y],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[d,Nh,Gf],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[br,{["fn"]:"substring",["argv"]:[Z,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:ts,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:jr,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:u,rules:[{["conditions"]:hh,rules:[{["conditions"]:mh,rules:[{["conditions"]:rl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:sl,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},Bs],["type"]:"tree"},{["conditions"]:mh,rules:[{["conditions"]:rl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:ir,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:sl,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:ir,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},Bs],["type"]:"tree"},{["conditions"]:[Kf,Wf],rules:[{["conditions"]:[Dh,e],rules:[{["conditions"]:wr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:_,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:sl,rules:[{["conditions"]:hh,rules:[{["conditions"]:gh,rules:wh,["type"]:"tree"},{["conditions"]:ah,rules:wh,["type"]:"tree"},Vf],["type"]:"tree"},{["conditions"]:gh,rules:Sh,["type"]:"tree"},{["conditions"]:ah,rules:Sh,["type"]:"tree"},Vf],["type"]:"tree"},Bs],["type"]:"tree"},{["conditions"]:[Zf,Kf,Wf],rules:[{["conditions"]:u,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:_,["headers"]:S},["type"]:"endpoint"},{["conditions"]:wr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:_,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[br,{["fn"]:"substring",["argv"]:[Z,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[Z,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[Z,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[Z,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:us,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:eh,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Lf,"e"]}],rules:[{["conditions"]:Rh,rules:[Xf,{["conditions"]:u,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:Or,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Or,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Lf,"o"]}],rules:[{["conditions"]:Rh,rules:[Xf,{["conditions"]:u,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:Or,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Or,["headers"]:S},["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"]:qw,rules:[{["conditions"]:[U,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Yw}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[Ys,Mh],rules:[{["conditions"]:b,rules:[{["conditions"]:Ah,rules:[{["conditions"]:[Y,Gf],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[I,d,M,e,C],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[I,d,M,e,k,G],rules:[{endpoint:Jf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,d,M,e,k,K],endpoint:Jf,["type"]:"endpoint"},{["conditions"]:[A,d,M,e,C],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,d,M,e,k,G],rules:[{endpoint:yf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,M,e,k,K],endpoint:yf,["type"]:"endpoint"},{["conditions"]:[I,R,Y,e,C],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[I,R,Y,e,k,G],rules:[{endpoint:Hf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,Y,e,k,K],endpoint:Hf,["type"]:"endpoint"},{["conditions"]:[I,R,M,e,C],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[I,R,M,e,k,G],rules:[{endpoint:Qf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,M,e,k,K],endpoint:Qf,["type"]:"endpoint"},{["conditions"]:[A,R,M,U,V,cr,C],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,R,M,U,V,vs,C],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,R,M,U,V,cr,k,G],rules:[{["conditions"]:i,endpoint:qs,["type"]:"endpoint"},{endpoint:qs,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,R,M,U,V,vs,k,G],rules:[{["conditions"]:i,endpoint:wl,["type"]:"endpoint"},Bf],["type"]:"tree"},{["conditions"]:[A,R,M,U,V,cr,k,K],endpoint:qs,["type"]:"endpoint"},{["conditions"]:[A,R,M,U,V,vs,k,K],endpoint:wl,["type"]:"endpoint"},{["conditions"]:[A,R,Y,e,C],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,R,Y,e,k,G],rules:[{["conditions"]:i,endpoint:Os,["type"]:"endpoint"},{endpoint:Os,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,R,Y,e,k,K],endpoint:Os,["type"]:"endpoint"},{["conditions"]:[A,R,M,e,C],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,R,M,e,k,G],rules:[{["conditions"]:i,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:S},["type"]:"endpoint"},{endpoint:Yf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,R,M,e,k,K],endpoint:Yf,["type"]:"endpoint"}],["type"]:"tree"},_r],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[U,V,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[$h,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!0]},Ys,R,A,M],rules:[{["conditions"]:b,rules:[{["conditions"]:Ah,rules:[Bf],["type"]:"tree"},_r],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Ys,{["fn"]:"aws.parseArn",["argv"]:vw,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[X,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Uh,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[_s,"s3-object-lambda"]}],rules:[{["conditions"]:ll,rules:[{["conditions"]:kh,rules:[vf,qf,{["conditions"]:fl,rules:[Of,{["conditions"]:Ih,rules:[js,{["conditions"]:hl,rules:[{["conditions"]:b,rules:[{["conditions"]:dh,rules:[{["conditions"]:ml,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Ch,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:gl,rules:[{["conditions"]:Ph,rules:[{["conditions"]:u,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:cs,["headers"]:S},["type"]:"endpoint"},{["conditions"]:wr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:cs,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:cs,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},_f],["type"]:"tree"},bs],["type"]:"tree"},is],["type"]:"tree"},xs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},jf],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},cf],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:ll,rules:[{["conditions"]:kh,rules:[{["conditions"]:fl,rules:[{["conditions"]:ll,rules:[{["conditions"]:fl,rules:[Of,{["conditions"]:Ih,rules:[js,{["conditions"]:hl,rules:[{["conditions"]:b,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Th,"{partitionResult#name}"]}],rules:[{["conditions"]:ml,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[_s,"s3"]}],rules:[{["conditions"]:gl,rules:[{["conditions"]:Ph,rules:[{["conditions"]:jr,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[d,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[R,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[R,A,U,V],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[R,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},_f],["type"]:"tree"},bs],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},is],["type"]:"tree"},xs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},jf],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[al,!0]}],rules:[{["conditions"]:ts,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:wr,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:jr,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"]:us,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[X,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:Ow}]},["headers"]:S},["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"},cf],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[_s,"s3-outposts"]}],rules:[{["conditions"]:ts,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:wr,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:jr,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[X,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:_w,["assign"]:"outpostId"}],rules:[{["conditions"]:eh,rules:[js,{["conditions"]:hl,rules:[{["conditions"]:b,rules:[{["conditions"]:dh,rules:[{["conditions"]:ml,rules:[{["conditions"]:gl,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:jw,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[X,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:u,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:bf,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:bf,["headers"]:S},["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"},bs],["type"]:"tree"},is],["type"]:"tree"},xs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The Outpost Id was not set",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: No ARN type specified",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"substring",["argv"]:[Z,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[xf]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[Bw,!0]},xf],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:rl,rules:[{["conditions"]:b,rules:[{["conditions"]:[M],rules:[{["conditions"]:[I,e,d,C],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[I,e,d,k,G],rules:[{endpoint:of,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,e,d,k,K],endpoint:of,["type"]:"endpoint"},{["conditions"]:[A,e,d,C],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,e,d,k,G],rules:[{endpoint:nf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,e,d,k,K],endpoint:nf,["type"]:"endpoint"},{["conditions"]:[I,e,R,C],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[I,e,R,k,G],rules:[{endpoint:pf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,e,R,k,K],endpoint:pf,["type"]:"endpoint"},{["conditions"]:[A,U,V,R,C],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,U,V,R,k,G],rules:[{["conditions"]:i,endpoint:os,["type"]:"endpoint"},{endpoint:os,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,U,V,R,k,K],endpoint:os,["type"]:"endpoint"},{["conditions"]:[A,e,R,C],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,e,R,k,G],rules:[{["conditions"]:i,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:S},["type"]:"endpoint"},{endpoint:uf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,e,R,k,K],endpoint:uf,["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"]:[tf]},{["fn"]:"booleanEquals",["argv"]:[tf,!0]}],rules:[{["conditions"]:b,rules:[{["conditions"]:Eh,rules:[vf,qf,{["conditions"]:u,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:ns,["headers"]:S},["type"]:"endpoint"},{["conditions"]:wr,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:ns,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:ns,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},_r],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Zf],rules:[{["conditions"]:b,rules:[{["conditions"]:Eh,rules:[{["conditions"]:[d,I,e,C],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,I,e,k,G],rules:[{endpoint:rh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,I,e,k,K],endpoint:rh,["type"]:"endpoint"},{["conditions"]:[d,A,e,C],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,A,e,k,G],rules:[{endpoint:sh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,A,e,k,K],endpoint:sh,["type"]:"endpoint"},{["conditions"]:[R,I,e,C],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[R,I,e,k,G],rules:[{endpoint:lh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,I,e,k,K],endpoint:lh,["type"]:"endpoint"},{["conditions"]:[R,A,U,V,C],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[R,A,U,V,k,G],rules:[{["conditions"]:i,endpoint:ps,["type"]:"endpoint"},{endpoint:ps,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,A,U,V,k,K],endpoint:ps,["type"]:"endpoint"},{["conditions"]:[R,A,e,C],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[R,A,e,k,G],rules:[{["conditions"]:i,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:S},["type"]:"endpoint"},{endpoint:fh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,A,e,k,K],endpoint:fh,["type"]:"endpoint"}],["type"]:"tree"},_r],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},zh=cw;var xr=(r,s={})=>{return Gh(zh,{endpointParams:r,logger:s.logger})};Fh.aws=Kh;var Lh=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},Xh=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},bw=(r)=>async(s,l,f)=>{if(!f)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const h=await r(s,l,f),m=Mr(l)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!m)throw new Error(`getEndpointParameterInstructions() is not defined on \`${l.commandName}\``);const g=await Vh(f,{getEndpointParameterInstructions:m},s);return Object.assign(h,g)},iw=async(r,s,l)=>{return{operation:Mr(s).operation,region:await Wh(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Zh=bw(iw),xw=(r,s,l)=>{return(h)=>{const g=r(h).properties?.authSchemes;if(!g)return s(h);const w=[];for(let a of g){const{name:P,properties:E={},...$}=a,N=P.toLowerCase();if(P!==N)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${P}\` to \`${N}\``);let y;if(N==="sigv4a"){y="aws.auth#sigv4a";const Xr=g.find((O)=>{const Nr=O.name.toLowerCase();return Nr!=="sigv4a"&&Nr.startsWith("sigv4")});if(!qr.CrtSignerV4&&Xr)continue}else if(N.startsWith("sigv4"))y="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${N}\``);const H=l[y];if(!H)throw new Error(`Could not find HttpAuthOption create function for \`${y}\``);const B=H(h);B.schemeId=y,B.signingProperties={...B.signingProperties||{},...$,...E},w.push(B)}return w}},ow=(r)=>{const s=[];switch(r.operation){default:s.push(Lh(r)),s.push(Xh(r))}return s},Jh=xw(xr,ow,{"aws.auth#sigv4":Lh,"aws.auth#sigv4a":Xh}),yh=(r)=>{const s=nr.resolveAwsSdkSigV4Config(r);return{...nr.resolveAwsSdkSigV4AConfig(s)}};var vm=W(Yl(),1);var Hh=(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 L extends Qh{constructor(r){super(r);Object.setPrototypeOf(this,L.prototype)}}class pr extends L{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,pr.prototype)}}class ur extends L{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,ur.prototype)}}class tr extends L{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,tr.prototype)}}class rs extends L{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,rs.prototype)}}class ss extends L{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,ss.prototype)}}var Sl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Sl||(Sl={}));var el;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return l.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return l.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(el||(el={}));var Rl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.AccessPointArn!==void 0)return l.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Rl||(Rl={}));var Al;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Al||(Al={}));class ls extends L{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,ls.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class fs extends L{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,fs.prototype)}}class hs extends L{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,hs.prototype)}}var nw=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:v},...r.SessionToken&&{SessionToken:v}}),Bh=(r)=>({...r,...r.Credentials&&{Credentials:nw(r.Credentials)}});var Yh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v}}),vh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:v}});var Rr=W(or(),1);var Ss=W(Js(),1);class ms extends L{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,ms.prototype)}}var qh;(function(r){r.visit=(s,l)=>{if(s.Records!==void 0)return l.Records(s.Records);if(s.Stats!==void 0)return l.Stats(s.Stats);if(s.Progress!==void 0)return l.Progress(s.Progress);if(s.Cont!==void 0)return l.Cont(s.Cont);if(s.End!==void 0)return l.End(s.End);return l._(s.$unknown[0],s.$unknown[1])}})(qh||(qh={}));var Oh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}}),_h=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:v},...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}});var lm=async(r,s)=>{const l=Ss.requestBuilder(r,s),f=z({},j,{[m3]:r[Ha]});l.bp("/"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const h=z({[s3]:[,""]});let m;return l.m("GET").h(f).q(h).b(m),l.build()};var fm=async(r,s)=>{const l=Ss.requestBuilder(r,s),f=z({},j,{[_a]:r[Ma],[ja]:[()=>j(r[jh]),()=>Cr(r[jh]).toString()],[ca]:r[Ua],[ba]:[()=>j(r[ch]),()=>Cr(r[ch]).toString()],[xa]:r[Ga],[As]:r[es],[Hm]:r[$m],[ks]:r[Rs],[Xm]:r[Nm],[Wm]:r[km],[h3]:r[Aa]});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const h=z({[Ym]:[,"GetObject"],[oa]:[,r[Ka]],[na]:[,r[Wa]],[pa]:[,r[Va]],[ua]:[,r[Za]],[ta]:[,r[La]],[r3]:[()=>r.ResponseExpires!==void 0,()=>Cr(r[Xa]).toString()],[l3]:[,r[Ll]],[ia]:[()=>r.PartNumber!==void 0,()=>r[Fa].toString()]});let m;return l.m("GET").h(f).q(h).b(m),l.build()};var hm=async(r,s)=>{const l=Ss.requestBuilder(r,s),f=z({},j,{[Fm]:r[Am]||"application/octet-stream",[f3]:r[Sa],[Um]:r[am],[Tm]:r[Sm],[Cm]:r[em],[zm]:r[Rm],[Ml]:[()=>j(r[Nl]),()=>r[Nl].toString()],[va]:r[ka],[A3]:r[Ra],[Xl]:r[Fl],[Jl]:r[Gl],[yl]:r[Kl],[Hl]:r[Wl],[Ul]:[()=>j(r[$l]),()=>Cr(r[$l]).toString()],[g3]:r[Ea],[w3]:r[Na],[a3]:r[$a],[S3]:r[Da],[Ql]:r[Vl],[Jm]:r[Fr],[Bm]:r[Mm],[As]:r[es],[Hm]:r[$m],[ks]:r[Rs],[Bl]:r[Zl],[ym]:r[Dm],[Gr]:[()=>j(r[as]),()=>r[as].toString()],[Xm]:r[Nm],[k3]:r[Qa],[Zm]:r[Pm],[Tl]:[()=>j(r[Dl]),()=>sm(r[Dl]).toString()],[Vm]:r[dm],[Wm]:r[km],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((w,a)=>{return w[`x-amz-meta-${a.toLowerCase()}`]=r.Metadata[a],w},{})});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const h=z({[Ym]:[,"PutObject"]});let m,g;if(r.Body!==void 0)g=r.Body,m=g;return l.m("PUT").h(f).q(h).b(m),l.build()};var mm=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return zl(r,s);const l=z({$metadata:Q(r)}),f=Sr(uh(await Rr.parseXmlBody(r.body,s)),"body");if(f[dl]!=null)l[dl]=aa(f[dl],s);return l};var gm=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return zl(r,s);const l=z({$metadata:Q(r),[da]:[()=>r.headers[ih]!==void 0,()=>ws(r.headers[ih])],[ea]:[,r.headers[Ya]],[zr]:[,r.headers[Km]],[ya]:[,r.headers[e3]],[Ta]:[()=>r.headers[bh]!==void 0,()=>Sr($r(r.headers[bh]))],[Nl]:[()=>r.headers[Ml]!==void 0,()=>th(r.headers[Ml])],[Im]:[,r.headers[Gm]],[Fl]:[,r.headers[Xl]],[Gl]:[,r.headers[Jl]],[Kl]:[,r.headers[yl]],[Wl]:[,r.headers[Hl]],[Ca]:[()=>r.headers[xh]!==void 0,()=>gs(r.headers[xh])],[Ll]:[,r.headers[Qm]],[am]:[,r.headers[Um]],[Sm]:[,r.headers[Tm]],[em]:[,r.headers[Cm]],[Rm]:[,r.headers[zm]],[Ia]:[,r.headers[qa]],[Am]:[,r.headers[Fm]],[$l]:[()=>r.headers[Ul]!==void 0,()=>Sr($r(r.headers[Ul]))],[Pa]:[,r.headers[Oa]],[Mm]:[,r.headers[Bm]],[Vl]:[,r.headers[Ql]],[es]:[,r.headers[As]],[Rs]:[,r.headers[ks]],[Zl]:[,r.headers[Bl]],[as]:[()=>r.headers[Gr]!==void 0,()=>ws(r.headers[Gr])],[Fr]:[,r.headers[Jm]],[Em]:[,r.headers[Lm]],[Ja]:[,r.headers[R3]],[za]:[()=>r.headers[oh]!==void 0,()=>gs(r.headers[oh])],[Ba]:[()=>r.headers[nh]!==void 0,()=>gs(r.headers[nh])],[Pm]:[,r.headers[Zm]],[Dl]:[()=>r.headers[Tl]!==void 0,()=>Sr(Cl(r.headers[Tl]))],[dm]:[,r.headers[Vm]],Metadata:[,Object.keys(r.headers).filter((h)=>h.startsWith("x-amz-meta-")).reduce((h,m)=>{return h[m.substring(11)]=r.headers[m],h},{})]}),f=r.body;return s.sdkStreamMixin(f),l.Body=f,l};var wm=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return zl(r,s);const l=z({$metadata:Q(r),[zr]:[,r.headers[Km]],[Im]:[,r.headers[Gm]],[Fl]:[,r.headers[Xl]],[Gl]:[,r.headers[Jl]],[Kl]:[,r.headers[yl]],[Wl]:[,r.headers[Hl]],[Vl]:[,r.headers[Ql]],[Ll]:[,r.headers[Qm]],[es]:[,r.headers[As]],[Rs]:[,r.headers[ks]],[Zl]:[,r.headers[Bl]],[Dm]:[,r.headers[ym]],[as]:[()=>r.headers[Gr]!==void 0,()=>ws(r.headers[Gr])],[Em]:[,r.headers[Lm]]});return await ph(r.body,s),l};var zl=async(r,s)=>{const l={...r,body:await Rr.parseXmlErrorBody(r.body,s)},f=Rr.loadRestXmlErrorCode(r,l.body);switch(f){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await ha(l,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await wa(l,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await tw(l,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await ra(l,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await la(l,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await sa(l,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await fa(l,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await ma(l,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await ga(l,s);default:const h=l.body;return uw({output:r,parsedBody:h,errorCode:f})}},uw=rm(L),tw=async(r,s)=>{const l=z({}),f=r.body,h=new tr({$metadata:Q(r),...l});return q(h,r.body)},ra=async(r,s)=>{const l=z({}),f=r.body,h=new rs({$metadata:Q(r),...l});return q(h,r.body)},sa=async(r,s)=>{const l=z({}),f=r.body;if(f[Il]!=null)l[Il]=er(f[Il]);if(f[Fr]!=null)l[Fr]=er(f[Fr]);const h=new ls({$metadata:Q(r),...l});return q(h,r.body)},la=async(r,s)=>{const l=z({}),f=r.body,h=new ss({$metadata:Q(r),...l});return q(h,r.body)},fa=async(r,s)=>{const l=z({}),f=r.body,h=new fs({$metadata:Q(r),...l});return q(h,r.body)},ha=async(r,s)=>{const l=z({}),f=r.body,h=new pr({$metadata:Q(r),...l});return q(h,r.body)},ma=async(r,s)=>{const l=z({}),f=r.body,h=new hs({$metadata:Q(r),...l});return q(h,r.body)},ga=async(r,s)=>{const l=z({}),f=r.body,h=new ms({$metadata:Q(r),...l});return q(h,r.body)},wa=async(r,s)=>{const l=z({}),f=r.body,h=new ur({$metadata:Q(r),...l});return q(h,r.body)};var aa=(r,s)=>{const l={};if(r[kl]!=null)l[kl]=er(r[kl]);if(r[Pl]!=null)l[Pl]=er(r[Pl]);if(r[El]!=null)l[El]=er(r[El]);if(r[zr]!=null)l[zr]=Sr(Cl(r[zr]));return l};var Q=(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 Sa="ACL";var kl="AccessKeyId";var ea="AcceptRanges";var Il="AccessTier";var as="BucketKeyEnabled";var dl="Credentials",Ra="ChecksumAlgorithm";var am="CacheControl",Fl="ChecksumCRC32",Gl="ChecksumCRC32C",Sm="ContentDisposition";var em="ContentEncoding";var Rm="ContentLanguage",Nl="ContentLength",Aa="ChecksumMode",ka="ContentMD5";var Ia="ContentRange";var Kl="ChecksumSHA1",Wl="ChecksumSHA256";var Am="ContentType";var da="DeleteMarker";var $l="Expires";var km="ExpectedBucketOwner";var Pa="ExpiresString";var Im="ETag";var zr="Expiration";var Ea="GrantFullControl";var Na="GrantRead",$a="GrantReadACP";var Da="GrantWriteACP";var Ma="IfMatch",jh="IfModifiedSince",Ua="IfNoneMatch";var ch="IfUnmodifiedSince";var Ta="LastModified";var Ca="MissingMeta";var dm="ObjectLockLegalHoldStatus",Pm="ObjectLockMode";var Dl="ObjectLockRetainUntilDate";var za="PartsCount";var Fa="PartNumber";var Ga="Range";var Em="RequestCharged",Ka="ResponseCacheControl",Wa="ResponseContentDisposition",Va="ResponseContentEncoding",Za="ResponseContentLanguage",La="ResponseContentType";var Xa="ResponseExpires";var Nm="RequestPayer";var Ja="ReplicationStatus";var ya="Restore";var Pl="SecretAccessKey";var Fr="StorageClass";var Ha="SessionMode";var Vl="ServerSideEncryption";var es="SSECustomerAlgorithm",$m="SSECustomerKey",Rs="SSECustomerKeyMD5";var Dm="SSEKMSEncryptionContext",Zl="SSEKMSKeyId";var El="SessionToken";var Qa="Tagging";var Ba="TagCount";var Ll="VersionId";var Mm="WebsiteRedirectLocation";var Ya="accept-ranges";var Um="cache-control",Tm="content-disposition",Cm="content-encoding",zm="content-language",Ml="content-length",va="content-md5",qa="content-range",Fm="content-type";var Ul="expires";var Gm="etag",Oa="expiresstring";var _a="if-match",ja="if-modified-since";var ca="if-none-match";var ba="if-unmodified-since";var bh="last-modified";var ia="partNumber";var xa="range",oa="response-cache-control",na="response-content-disposition",pa="response-content-encoding",ua="response-content-language",ta="response-content-type",r3="response-expires";var s3="session";var l3="versionId";var f3="x-amz-acl";var Xl="x-amz-checksum-crc32",Jl="x-amz-checksum-crc32c",h3="x-amz-checksum-mode";var yl="x-amz-checksum-sha1",Hl="x-amz-checksum-sha256";var m3="x-amz-create-session-mode";var ih="x-amz-delete-marker",Km="x-amz-expiration",Wm="x-amz-expected-bucket-owner";var g3="x-amz-grant-full-control",w3="x-amz-grant-read",a3="x-amz-grant-read-acp";var S3="x-amz-grant-write-acp";var xh="x-amz-missing-meta";var oh="x-amz-mp-parts-count";var Vm="x-amz-object-lock-legal-hold",Zm="x-amz-object-lock-mode",Tl="x-amz-object-lock-retain-until-date";var e3="x-amz-restore",Lm="x-amz-request-charged";var Xm="x-amz-request-payer";var R3="x-amz-replication-status";var Jm="x-amz-storage-class",A3="x-amz-sdk-checksum-algorithm";var Ql="x-amz-server-side-encryption",Bl="x-amz-server-side-encryption-aws-kms-key-id",Gr="x-amz-server-side-encryption-bucket-key-enabled",ym="x-amz-server-side-encryption-context",As="x-amz-server-side-encryption-customer-algorithm",Hm="x-amz-server-side-encryption-customer-key",ks="x-amz-server-side-encryption-customer-key-md5",k3="x-amz-tagging",nh="x-amz-tagging-count";var Qm="x-amz-version-id",Bm="x-amz-website-redirect-location",Ym="x-id";class vl extends Ar.classBuilder().ep({...ar,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,l,f){return[vm.getSerdePlugin(l,this.serialize,this.deserialize),kr(l,r.getEndpointParameterInstructions()),vr(l)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(void 0,Bh).ser(lm).de(mm).build(){}var qm={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 Us=W(or(),1);var d3="AWS_S3_USE_ARN_REGION",P3="s3_use_arn_region",Om={environmentVariableSelector:(r)=>n(r,d3,p.ENV),configFileSelector:(r)=>n(r,P3,p.CONFIG),default:!1};var _m=W(F3(),1),{__extends:YR,__assign:vR,__rest:qR,__decorate:OR,__param:_R,__esDecorate:jR,__runInitializers:cR,__propKey:bR,__setFunctionName:iR,__metadata:xR,__awaiter:Is,__generator:ds,__exportStar:oR,__createBinding:nR,__values:Ps,__read:pR,__spread:uR,__spreadArrays:tR,__spreadArray:rA,__await:sA,__asyncGenerator:lA,__asyncDelegator:fA,__asyncValues:hA,__makeTemplateObject:mA,__importStar:gA,__importDefault:wA,__classPrivateFieldGet:aA,__classPrivateFieldSet:SA,__classPrivateFieldIn:eA,__addDisposableResource:RA,__disposeResources:AA}=_m.default;import{Buffer as jm} from"buffer";var cm=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?jm.from(r,s):jm.from(r)};var ql=(r)=>{const s=cm(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function Kr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return G3(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var G3=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:ql;function Wr(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 Zr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),l=0;while(l<r.length)s[l]=r[l],l+=1;return s}return Uint32Array.from(r)}var Ol=function(){function r(){this.crc32=new t}return r.prototype.update=function(s){if(Wr(s))return;this.crc32.update(Kr(s))},r.prototype.digest=function(){return Is(this,void 0,void 0,function(){return ds(this,function(s){return[2,Vr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new t},r}();var t=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var h=Ps(s),m=h.next();!m.done;m=h.next()){var g=m.value;this.checksum=this.checksum>>>8^W3[(this.checksum^g)&255]}}catch(w){l={error:w}}finally{try{if(m&&!m.done&&(f=h.return))f.call(h)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var K3=[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],W3=Zr(K3);var x=W(im(),1);var xm=W(im(),1),bm=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 Ir{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let l=7,f=Math.abs(Math.round(r));l>-1&&f>0;l--,f/=256)s[l]=f;if(r<0)bm(s);return new Ir(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)bm(r);return parseInt(xm.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class _l{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let h of Object.keys(r)){const m=this.fromUtf8(h);s.push(Uint8Array.from([m.byteLength]),m,this.formatHeaderValue(r[h]))}const l=new Uint8Array(s.reduce((h,m)=>h+m.byteLength,0));let f=0;for(let h of s)l.set(h,f),f+=h.byteLength;return l}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const l=new DataView(new ArrayBuffer(5));return l.setUint8(0,4),l.setInt32(1,r.value,!1),new Uint8Array(l.buffer);case"long":const f=new Uint8Array(9);return f[0]=5,f.set(r.value.bytes,1),f;case"binary":const h=new DataView(new ArrayBuffer(3+r.value.byteLength));h.setUint8(0,6),h.setUint16(1,r.value.byteLength,!1);const m=new Uint8Array(h.buffer);return m.set(r.value,3),m;case"string":const g=this.fromUtf8(r.value),w=new DataView(new ArrayBuffer(3+g.byteLength));w.setUint8(0,7),w.setUint16(1,g.byteLength,!1);const a=new Uint8Array(w.buffer);return a.set(g,3),a;case"timestamp":const P=new Uint8Array(9);return P[0]=8,P.set(Ir.fromNumber(r.value.valueOf()).bytes,1),P;case"uuid":if(!B3.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const E=new Uint8Array(17);return E[0]=9,E.set(x.fromHex(r.value.replace(/\-/g,"")),1),E}}parse(r){const s={};let l=0;while(l<r.byteLength){const f=r.getUint8(l++),h=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,f));switch(l+=f,r.getUint8(l++)){case 0:s[h]={type:nm,value:!0};break;case 1:s[h]={type:nm,value:!1};break;case 2:s[h]={type:V3,value:r.getInt8(l++)};break;case 3:s[h]={type:Z3,value:r.getInt16(l,!1)},l+=2;break;case 4:s[h]={type:L3,value:r.getInt32(l,!1)},l+=4;break;case 5:s[h]={type:X3,value:new Ir(new Uint8Array(r.buffer,r.byteOffset+l,8))},l+=8;break;case 6:const m=r.getUint16(l,!1);l+=2,s[h]={type:J3,value:new Uint8Array(r.buffer,r.byteOffset+l,m)},l+=m;break;case 7:const g=r.getUint16(l,!1);l+=2,s[h]={type:y3,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,g))},l+=g;break;case 8:s[h]={type:H3,value:new Date(new Ir(new Uint8Array(r.buffer,r.byteOffset+l,8)).valueOf())},l+=8;break;case 9:const w=new Uint8Array(r.buffer,r.byteOffset+l,16);l+=16,s[h]={type:Q3,value:`${x.toHex(w.subarray(0,4))}-${x.toHex(w.subarray(4,6))}-${x.toHex(w.subarray(6,8))}-${x.toHex(w.subarray(8,10))}-${x.toHex(w.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var om;(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"})(om||(om={}));var nm="boolean",V3="byte",Z3="short",L3="integer",X3="long",J3="binary",y3="string",H3="timestamp",Q3="uuid",B3=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function um({byteLength:r,byteOffset:s,buffer:l}){if(r<Y3)throw new Error("Provided message too short to accommodate event stream message overhead");const f=new DataView(l,s,r),h=f.getUint32(0,!1);if(r!==h)throw new Error("Reported message length does not match received message length");const m=f.getUint32(pm,!1),g=f.getUint32(o,!1),w=f.getUint32(r-rr,!1),a=new t().update(new Uint8Array(l,s,o));if(g!==a.digest())throw new Error(`The prelude checksum specified in the message (${g}) does not match the calculated CRC32 checksum (${a.digest()})`);if(a.update(new Uint8Array(l,s+o,r-(o+rr))),w!==a.digest())throw new Error(`The message checksum (${a.digest()}) did not match the expected value of ${w}`);return{headers:new DataView(l,s+o+rr,m),body:new Uint8Array(l,s+o+rr+m,h-m-(o+rr+rr))}}var pm=4,o=pm*2,rr=4,Y3=o+rr*2;class jl{constructor(r,s){this.headerMarshaller=new _l(r,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(r){this.messageBuffer.push(this.decode(r))}endOfStream(){this.isEndOfStream=!0}getMessage(){const r=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return r},isEndOfStream(){return s}}}getAvailableMessages(){const r=this.messageBuffer;this.messageBuffer=[];const s=this.isEndOfStream;return{getMessages(){return r},isEndOfStream(){return s}}}encode({headers:r,body:s}){const l=this.headerMarshaller.format(r),f=l.byteLength+s.byteLength+16,h=new Uint8Array(f),m=new DataView(h.buffer,h.byteOffset,h.byteLength),g=new t;return m.setUint32(0,f,!1),m.setUint32(4,l.byteLength,!1),m.setUint32(8,g.update(h.subarray(0,8)).digest(),!1),h.set(l,12),h.set(s,l.byteLength+12),m.setUint32(f-4,g.update(h.subarray(8,f-4)).digest(),!1),h}decode(r){const{headers:s,body:l}=um(r);return{headers:this.headerMarshaller.parse(s),body:l}}formatHeaders(r){return this.headerMarshaller.format(r)}}class cl{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 bl{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 il{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 xl{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 tm(r){let s=0,l=0,f=null,h=null;const m=(w)=>{if(typeof w!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+w);s=w,l=4,f=new Uint8Array(w),new DataView(f.buffer).setUint32(0,w,!1)},g=async function*(){const w=r[Symbol.asyncIterator]();while(!0){const{value:a,done:P}=await w.next();if(P){if(!s)return;else if(s===l)yield f;else throw new Error("Truncated event message received.");return}const E=a.length;let $=0;while($<E){if(!f){const y=E-$;if(!h)h=new Uint8Array(4);const H=Math.min(4-l,y);if(h.set(a.slice($,$+H),l),l+=H,$+=H,l<4)break;m(new DataView(h.buffer).getUint32(0,!1)),h=null}const N=Math.min(s-l,E-$);if(f.set(a.slice($,$+N),l),l+=N,$+=N,s&&s===l)yield f,f=null,s=0,l=0}}};return{[Symbol.asyncIterator]:g}}function rg(r,s){return async function(l){const{value:f}=l.headers[":message-type"];if(f==="error"){const h=new Error(l.headers[":error-message"].value||"UnknownError");throw h.name=l.headers[":error-code"].value,h}else if(f==="exception"){const h=l.headers[":exception-type"].value,m={[h]:l},g=await r(m);if(g.$unknown){const w=new Error(s(l.body));throw w.name=h,w}throw g[h]}else if(f==="event"){const h={[l.headers[":event-type"].value]:l},m=await r(h);if(m.$unknown)return;return m}else throw Error(`Unrecognizable event type: ${l.headers[":event-type"].value}`)}}class Es{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new jl(r,s),this.utfEncoder=r}deserialize(r,s){const l=tm(r);return new il({messageStream:new cl({inputStream:l,decoder:this.eventStreamCodec}),deserializer:rg(s,this.utfEncoder)})}serialize(r,s){return new bl({messageStream:new xl({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as v3} from"stream";async function*sg(r){let s=!1,l=!1;const f=new Array;r.on("error",(h)=>{if(!s)s=!0;if(h)throw h}),r.on("data",(h)=>{f.push(h)}),r.on("end",()=>{s=!0});while(!l){const h=await new Promise((m)=>setTimeout(()=>m(f.shift()),0));if(h)yield h;l=s&&f.length===0}}class ol{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Es({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const l=typeof r[Symbol.asyncIterator]==="function"?r:sg(r);return this.universalMarshaller.deserialize(l,s)}serialize(r,s){return v3.from(this.universalMarshaller.serialize(r,s))}}var lg=(r)=>new ol(r);import{Writable as q3} from"stream";class $s extends q3{constructor(r,s){super(s);this.hash=r}_write(r,s,l){try{this.hash.update(Ns(r))}catch(f){return l(f)}l()}}var fg=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const l=new r,f=new $s(l);return s.pipe(f),new Promise((h,m)=>{s.on("error",(g)=>{f.end(),m(g)}),f.on("error",m),f.on("finish",()=>{l.digest().then(h).catch(m)})})};var Ds=W(or(),1);var Rg=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??hg,base64Encoder:r?.base64Encoder??wg,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??xr,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??ag,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Jh,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Ds.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new Ds.AwsSdkSigV4ASigner}],logger:r?.logger??new Hr,sdkStreamMixin:r?.sdkStreamMixin??Sg,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??Qs,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??eg,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??mg,utf8Encoder:r?.utf8Encoder??gg}};var Gg=(r)=>{dg(process.version);const s=zg(r),l=()=>s().then(Ig),f=Rg(r);return Us.emitWarningIfUnsupportedVersion(process.version),{...f,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??Cg,credentialDefaultProvider:r?.credentialDefaultProvider??Fg,defaultUserAgentProvider:r?.defaultUserAgentProvider??Tg({serviceId:f.serviceId,clientVersion:qm.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??c(Ls),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??lg,maxAttempts:r?.maxAttempts??c(Mg),md5:r?.md5??Ms.bind(null,"md5"),region:r?.region??c(Ng,$g),requestHandler:Ag.create(r?.requestHandler??l),retryMode:r?.retryMode??c({...Ug,default:async()=>(await l()).retryMode||Dg}),sha1:r?.sha1??Ms.bind(null,"sha1"),sha256:r?.sha256??Ms.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??c(Us.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??kg,streamHasher:r?.streamHasher??fg,useArnRegion:r?.useArnRegion??c(Om),useDualstackEndpoint:r?.useDualstackEndpoint??c(Pg),useFipsEndpoint:r?.useFipsEndpoint??c(Eg)}};var Kg=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:l,credentials:f}=r;return{setHttpAuthScheme(h){const m=s.findIndex((g)=>g.schemeId===h.schemeId);if(m===-1)s.push(h);else s.splice(m,1,h)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(h){l=h},httpAuthSchemeProvider(){return l},setCredentials(h){f=h},credentials(){return f}}},Wg=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var Ts=(r)=>r,Hg=(r,s)=>{const l={...Ts(Jg(r)),...Ts(Lg(r)),...Ts(Vg(r)),...Ts(Kg(r))};return s.forEach((f)=>f.configure(l)),{...r,...yg(l),...Xg(l),...Zg(l),...Wg(l)}};class nl extends qg{constructor(...[r]){const s=Gg(r||{}),l=Hh(s),f=Og(l),h=ig(f),m=jg(h),g=Qg(m),w=bg(g),a=Ff(w),P=yh(a),E=Df(P,{session:[()=>this,vl]}),$=Hg(E,r?.extensions||[]);super($);this.config=$,this.middlewareStack.use(_g(this.config)),this.middlewareStack.use(xg(this.config)),this.middlewareStack.use(cg(this.config)),this.middlewareStack.use(Bg(this.config)),this.middlewareStack.use(Yg(this.config)),this.middlewareStack.use(vg(this.config)),this.middlewareStack.use(dr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Zh,identityProviderConfigProvider:async(N)=>new dr.DefaultIdentityProviderConfig({"aws.auth#sigv4":N.credentials,"aws.auth#sigv4a":N.credentials})})),this.middlewareStack.use(dr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(zf(this.config)),this.middlewareStack.use(ff(this.config)),this.middlewareStack.use(wf(this.config)),this.middlewareStack.use(Xs(this.config)),this.middlewareStack.use(ys(this.config))}destroy(){super.destroy()}}function O3(r){return(s)=>async(l)=>{const f={...l.input},h=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let m of h){const g=f[m.target];if(g){let w;if(typeof g==="string")if(j3(g,r))w=r.base64Decoder(g);else w=r.utf8Decoder(g),f[m.target]=r.base64Encoder(w);else w=ArrayBuffer.isView(g)?new Uint8Array(g.buffer,g.byteOffset,g.byteLength):new Uint8Array(g),f[m.target]=r.base64Encoder(w);const a=new r.md5;a.update(w),f[m.hash]=r.base64Encoder(await a.digest())}}return s({...l,input:f})}}function j3(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 _3={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},Cs=(r)=>({applyToStack:(s)=>{s.add(O3(r),_3)}});var D;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(D||(D={}));var og;(function(r){r.HEADER="header",r.TRAILER="trailer"})(og||(og={}));var{MD5:ng,CRC32:pg}=D;var Lr=[D.CRC32,D.CRC32C,D.SHA1,D.SHA256],ug=[D.CRC32,D.CRC32C,D.SHA1,D.SHA256];var tg=(r,{requestChecksumRequired:s,requestAlgorithmMember:l},f)=>{const h=f?pg:ng;if(!l||!r[l])return s?h:void 0;const m=r[l];if(!Lr.includes(m))throw new Error(`The checksum algorithm "${m}" is not supported by the client.`+` Select one of ${Lr}.`);return m};var Pr=(r)=>r===D.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var rw=(r,s)=>{const l=r.toLowerCase();for(let f of Object.keys(s))if(l===f.toLowerCase())return!0;return!1};var Er=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!sw(r);var ul=function(){function r(){this.crc32c=new pl}return r.prototype.update=function(s){if(Wr(s))return;this.crc32c.update(Kr(s))},r.prototype.digest=function(){return Is(this,void 0,void 0,function(){return ds(this,function(s){return[2,Vr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new pl},r}();var pl=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var h=Ps(s),m=h.next();!m.done;m=h.next()){var g=m.value;this.checksum=this.checksum>>>8^b3[(this.checksum^g)&255]}}catch(w){l={error:w}}finally{try{if(m&&!m.done&&(f=h.return))f.call(h)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var c3=[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],b3=Zr(c3);var zs=(r,s)=>({[D.MD5]:s.md5,[D.CRC32]:Ol,[D.CRC32C]:ul,[D.SHA1]:s.sha1,[D.SHA256]:s.sha256})[r];var Fs=(r,s)=>{const l=new r;return l.update(Ns(s||"")),l.digest()};var lw={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},fw=(r,s)=>(l,f)=>async(h)=>{if(!J.isInstance(h.request))return l(h);const{request:m}=h,{body:g,headers:w}=m,{base64Encoder:a,streamHasher:P}=r,{input:E,requestChecksumRequired:$,requestAlgorithmMember:N}=s,y=tg(E,{requestChecksumRequired:$,requestAlgorithmMember:N},!!f.isS3ExpressBucket);let H=g,B=w;if(y){const O=Pr(y),Nr=zs(y,r);if(Er(g)){const{getAwsChunkedEncodingStream:Zs,bodyLengthChecker:Iw}=r;H=Zs(g,{base64Encoder:a,bodyLengthChecker:Iw,checksumLocationName:O,checksumAlgorithmFn:Nr,streamHasher:P}),B={...w,"content-encoding":w["content-encoding"]?`${w["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":w["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":O},delete B["content-length"]}else if(!rw(O,w)){const Zs=await Fs(Nr,g);B={...w,[O]:a(Zs)}}}return await l({...h,request:{...m,headers:B,body:H}})};var Gs=(r=[])=>{const s=[];for(let l of ug){if(!r.includes(l)||!Lr.includes(l))continue;s.push(l)}return s};var hw=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const l=r.slice(s+1);if(!l.startsWith("0")){const f=parseInt(l,10);if(!isNaN(f)&&f>=1&&f<=1e4)return!0}}return!1};import{Transform as i3} from"stream";function tl(r){const s=new i3;return s.push(r),s.push(null),s}var mw=async(r,{streamHasher:s,checksumAlgorithmFn:l,base64Encoder:f})=>{const h=Er(r)?s(l,r):Fs(l,r);return f(await h)};var gw=async(r,{config:s,responseAlgorithms:l})=>{const f=Gs(l),{body:h,headers:m}=r;for(let g of f){const w=Pr(g),a=m[w];if(a){const P=zs(g,s),{streamHasher:E,base64Encoder:$}=s,N=await mw(h,{streamHasher:E,checksumAlgorithmFn:P,base64Encoder:$});if(N===a)break;throw new Error(`Checksum mismatch: expected "${N}" but received "${a}"`+` in response header "${w}".`)}}};var ww={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},aw=(r,s)=>(l,f)=>async(h)=>{if(!J.isInstance(h.request))return l(h);const m=h.input,g=await l(h),w=g.response;let a=void 0;const{requestValidationModeMember:P,responseAlgorithms:E}=s;if(P&&m[P]==="ENABLED"){const{clientName:$,commandName:N}=f;if($==="S3Client"&&N==="GetObjectCommand"&&Gs(E).every((B)=>{const Xr=Pr(B),O=w.headers[Xr];return!O||hw(O)}))return g;const H=Er(w.body);if(H)a=await r.streamCollector(w.body),w.body=tl(a);if(await gw(g.response,{config:r,responseAlgorithms:E}),H&&a)w.body=tl(a)}return g};var Ks=(r,s)=>({applyToStack:(l)=>{l.add(fw(r,s),lw),l.addRelativeTo(aw(r,s),ww)}});var Sw=W(Yl(),1);class rf extends Ar.classBuilder().ep({...ar,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[Sw.getSerdePlugin(l,this.serialize,this.deserialize),kr(l,r.getEndpointParameterInstructions()),Ks(l,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),Cs(l),af(l)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(vh,Yh).ser(fm).de(gm).build(){}var ew=W(Yl(),1);class sf extends Ar.classBuilder().ep({...ar,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[ew.getSerdePlugin(l,this.serialize,this.deserialize),kr(l,r.getEndpointParameterInstructions()),Ks(l,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),hf(l),vr(l),Cs(l)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(_h,Oh).ser(hm).de(wm).build(){}import{Buffer as Rw} from"buffer";class Aw extends sr{client;constructor(...r){super();this.client=new nl(...r)}async put(r){let s,l,f,h=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,f=`${Jr()}.${r.type.split("/")[1].split(";")[0]}`,l=r.type;else s=r.body,f=r.name,l=r.contentType;l=s instanceof Blob||s instanceof File?s.type:void 0;const m=s instanceof Rw?s:Rw.from(await s.arrayBuffer());return await this.client.send(new sf({Bucket:h,Key:f,Body:m,ContentType:l})),f}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=await this.client.send(new rf({Bucket:s,Key:l}));return new Response(f.Body.transformToWebStream(),{headers:{"Content-Type":f.ContentType,"Content-Length":f.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":f.LastModified?.toUTCString()||"",ETag:f.ETag||""}})}}class Ws{}class Vs extends Ws{constructor(){super(...arguments)}requests=new Map;consume(r,s){if(!this.requests.has(r))this.requests.set(r,{date:Date.now(),count:1});else{const l=this.requests.get(r),f=Date.now();if(f-l.date>=60000)this.requests.set(r,{date:f,count:1});else this.requests.set(r,{date:l.date,count:l.count+1})}return this.requests.get(r).count}}class kw{driver=new Vs}export{Aw as S3Driver,kw as RateLimiterServiceProvider,Ws as RateLimiterDriver,Vs as InMemoryRateLimiter,yr as FileSystemDriver,lf as FileStorageServiceProvider,sr as FileStorageDriver};export{lf as t,kw as u};
@@ -19911,14 +19911,14 @@ async function customRequestParser(original) {
19911
19911
  }
19912
19912
  }
19913
19913
  function apiRouterParser(body) {
19914
- var _a, _b;
19914
+ var _a, _b, _c, _d, _e;
19915
19915
  for (const node of body) {
19916
19916
  if (node.key.name === "routes" && node.value.type === "ObjectExpression") {
19917
19917
  for (const property of node.value.properties) {
19918
19918
  if (((_a = property == null ? void 0 : property.value) == null ? void 0 : _a.type) === "Identifier") {
19919
19919
  continue;
19920
19920
  }
19921
- const args = property.value.callee.object.arguments ?? ((_b = property == null ? void 0 : property.value) == null ? void 0 : _b.arguments);
19921
+ const args = ((_d = (_c = (_b = property == null ? void 0 : property.value) == null ? void 0 : _b.callee) == null ? void 0 : _c.object) == null ? void 0 : _d.arguments) ?? ((_e = property == null ? void 0 : property.value) == null ? void 0 : _e.arguments);
19922
19922
  for (const arg of args ?? []) {
19923
19923
  if (!(arg.type === "ArrowFunctionExpression" || arg.type === "FunctionExpression")) {
19924
19924
  continue;
@@ -19949,7 +19949,7 @@ async function customRequestParser(original) {
19949
19949
  }
19950
19950
  }
19951
19951
  const orgFile = await main$2.parse(original, {
19952
- parser: await import("./typescript-Cv6BtTKL.mjs").then((n) => n.t)
19952
+ parser: await import("./typescript-x31i_8Ji.mjs").then((n) => n.t)
19953
19953
  });
19954
19954
  for (const body of orgFile.program.body) {
19955
19955
  if (!body || (body == null ? void 0 : body.type) === "ImportDeclaration") {
@@ -1,4 +1,4 @@
1
- import { g } from "./index-DgYsNMcB.mjs";
1
+ import { g } from "./index-BDp-rm3S.mjs";
2
2
  export {
3
3
  g as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { r as requireUtil, a as require$$0 } from "./index-DgYsNMcB.mjs";
1
+ import { r as requireUtil, a as require$$0 } from "./index-BDp-rm3S.mjs";
2
2
  function _mergeNamespaces(n, m) {
3
3
  for (var i = 0; i < m.length; i++) {
4
4
  const e = m[i];