uploader-s3-12b720bf.7249fda8.js 210 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import{M as Dc,J as Lc,K as jc}from"./index.59c4c6ab.js";import{c as gn}from"./_commonjsHelpers-2f131a27.d3569fbf.js";import{l as Xn}from"./elementPlus.8e650391.js";import"./vue.86c1cb21.js";const Fc=e=>{let t=e.httpHandler;return{setHttpHandler(r){t=r},httpHandler(){return t},updateHttpClientConfig(r,n){t.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return t.httpHandlerConfigs()}}},Hc=e=>({httpHandler:e.httpHandler()});var Yn;(function(e){e.HEADER="header",e.QUERY="query"})(Yn||(Yn={}));var Jn;(function(e){e.HEADER="header",e.QUERY="query"})(Jn||(Jn={}));var Ut;(function(e){e.HTTP="http",e.HTTPS="https"})(Ut||(Ut={}));var Xt;(function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"})(Xt||(Xt={}));var Qn;(function(e){e[e.HEADER=0]="HEADER",e[e.TRAILER=1]="TRAILER"})(Qn||(Qn={}));const Xr="__smithy_context";var es;(function(e){e.PROFILE="profile",e.SSO_SESSION="sso-session",e.SERVICES="services"})(es||(es={}));var ts;(function(e){e.HTTP_0_9="http/0.9",e.HTTP_1_0="http/1.0",e.TDS_8_0="tds/8.0"})(ts||(ts={}));class fe{constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static isInstance(t){if(!t)return!1;const r=t;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){const t=new fe({...this,headers:{...this.headers}});return t.query&&(t.query=zc(t.query)),t}}function zc(e){return Object.keys(e).reduce((t,r)=>{const n=e[r];return{...t,[r]:Array.isArray(n)?[...n]:n}},{})}class Yt{constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const r=t;return typeof r.statusCode=="number"&&typeof r.headers=="object"}}function qc(e){return t=>async r=>{var n,s;const{request:i}=r;return fe.isInstance(i)&&i.body&&e.runtime==="node"&&((s=(n=e.requestHandler)==null?void 0:n.constructor)==null?void 0:s.name)!=="FetchHttpHandler"&&(i.headers={...i.headers,Expect:"100-continue"}),t({...r,request:i})}}const Vc={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Wc=e=>({applyToStack:t=>{t.add(qc(e),Vc)}}),Kc=e=>t=>async r=>{if(!fe.isInstance(r.request))return t(r);const{request:n}=r,{handlerProtocol:s=""}=e.requestHandler.metadata||{};if(s.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let i=n.hostname;n.port!=null&&(i+=`:${n.port}`),n.headers.host=i}return t(r)},Gc={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},Zc=e=>({applyToStack:t=>{t.add(Kc(e),Gc)}}),Xc=()=>(e,t)=>async r=>{var n,s;try{const i=await e(r),{clientName:o,commandName:a,logger:c,dynamoDbDocumentClientOptions:u={}}=t,{overrideInputFilterSensitiveLog:d,overrideOutputFilterSensitiveLog:p}=u,f=d??t.inputFilterSensitiveLog,g=p??t.outputFilterSensitiveLog,{$metadata:w,...b}=i.output;return(n=c==null?void 0:c.info)==null||n.call(c,{clientName:o,commandName:a,input:f(r.input),output:g(b),metadata:w}),i}catch(i){const{clientName:o,commandName:a,logger:c,dynamoDbDocumentClientOptions:u={}}=t,{overrideInputFilterSensitiveLog:d}=u,p=d??t.inputFilterSensitiveLog;throw(s=c==null?void 0:c.error)==null||s.call(c,{clientName:o,commandName:a,input:p(r.input),error:i,metadata:i.$metadata}),i}},Yc={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},Jc=e=>({applyToStack:t=>{t.add(Xc(),Yc)}}),rs="X-Amzn-Trace-Id",Qc="AWS_LAMBDA_FUNCTION_NAME",eu="_X_AMZN_TRACE_ID",tu=e=>t=>async r=>{const{request:n}=r;if(!fe.isInstance(n)||e.runtime!=="node"||n.headers.hasOwnProperty(rs))return t(r);const s=process.env[Qc],i=process.env[eu],o=a=>typeof a=="string"&&a.length>0;return o(s)&&o(i)&&(n.headers[rs]=i),t({...r,request:n})},ru={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},nu=e=>({applyToStack:t=>{t.add(tu(e),ru)}});class mn{trace(){}debug(){}info(){}warn(){}error(){}}const Ve=(e,t)=>{const r=[];if(e&&r.push(e),t)for(const n of t)r.push(n);return r},Ie=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,Jt=()=>{let e=[],t=[],r=!1;const n=new Set,s=p=>p.sort((f,g)=>ns[g.step]-ns[f.step]||ss[g.priority||"normal"]-ss[f.priority||"normal"]),i=p=>{let f=!1;const g=w=>{const b=Ve(w.name,w.aliases);if(b.includes(p)){f=!0;for(const C of b)n.delete(C);return!1}return!0};return e=e.filter(g),t=t.filter(g),f},o=p=>{let f=!1;const g=w=>{if(w.middleware===p){f=!0;for(const b of Ve(w.name,w.aliases))n.delete(b);return!1}return!0};return e=e.filter(g),t=t.filter(g),f},a=p=>{var f;return e.forEach(g=>{p.add(g.middleware,{...g})}),t.forEach(g=>{p.addRelativeTo(g.middleware,{...g})}),(f=p.identifyOnResolve)==null||f.call(p,d.identifyOnResolve()),p},c=p=>{const f=[];return p.before.forEach(g=>{g.before.length===0&&g.after.length===0?f.push(g):f.push(...c(g))}),f.push(p),p.after.reverse().forEach(g=>{g.before.length===0&&g.after.length===0?f.push(g):f.push(...c(g))}),f},u=(p=!1)=>{const f=[],g=[],w={};return e.forEach(b=>{const C={...b,before:[],after:[]};for(const I of Ve(C.name,C.aliases))w[I]=C;f.push(C)}),t.forEach(b=>{const C={...b,before:[],after:[]};for(const I of Ve(C.name,C.aliases))w[I]=C;g.push(C)}),g.forEach(b=>{if(b.toMiddleware){const C=w[b.toMiddleware];if(C===void 0){if(p)return;throw new Error(`${b.toMiddleware} is not found when adding ${Ie(b.name,b.aliases)} middleware ${b.relation} ${b.toMiddleware}`)}b.relation==="after"&&C.after.push(b),b.relation==="before"&&C.before.push(b)}}),s(f).map(c).reduce((b,C)=>(b.push(...C),b),[])},d={add:(p,f={})=>{const{name:g,override:w,aliases:b}=f,C={step:"initialize",priority:"normal",middleware:p,...f},I=Ve(g,b);if(I.length>0){if(I.some(U=>n.has(U))){if(!w)throw new Error(`Duplicate middleware name '${Ie(g,b)}'`);for(const U of I){const Z=e.findIndex(Se=>{var ut;return Se.name===U||((ut=Se.aliases)==null?void 0:ut.some(dr=>dr===U))});if(Z===-1)continue;const j=e[Z];if(j.step!==C.step||C.priority!==j.priority)throw new Error(`"${Ie(j.name,j.aliases)}" middleware with ${j.priority} priority in ${j.step} step cannot be overridden by "${Ie(g,b)}" middleware with ${C.priority} priority in ${C.step} step.`);e.splice(Z,1)}}for(const U of I)n.add(U)}e.push(C)},addRelativeTo:(p,f)=>{const{name:g,override:w,aliases:b}=f,C={middleware:p,...f},I=Ve(g,b);if(I.length>0){if(I.some(U=>n.has(U))){if(!w)throw new Error(`Duplicate middleware name '${Ie(g,b)}'`);for(const U of I){const Z=t.findIndex(Se=>{var ut;return Se.name===U||((ut=Se.aliases)==null?void 0:ut.some(dr=>dr===U))});if(Z===-1)continue;const j=t[Z];if(j.toMiddleware!==C.toMiddleware||j.relation!==C.relation)throw new Error(`"${Ie(j.name,j.aliases)}" middleware ${j.relation} "${j.toMiddleware}" middleware cannot be overridden by "${Ie(g,b)}" middleware ${C.relation} "${C.toMiddleware}" middleware.`);t.splice(Z,1)}}for(const U of I)n.add(U)}t.push(C)},clone:()=>a(Jt()),use:p=>{p.applyToStack(d)},remove:p=>typeof p=="string"?i(p):o(p),removeByTag:p=>{let f=!1;const g=w=>{const{tags:b,name:C,aliases:I}=w;if(b&&b.includes(p)){const U=Ve(C,I);for(const Z of U)n.delete(Z);return f=!0,!1}return!0};return e=e.filter(g),t=t.filter(g),f},concat:p=>{var f;const g=a(Jt());return g.use(p),g.identifyOnResolve(r||g.identifyOnResolve()||(((f=p.identifyOnResolve)==null?void 0:f.call(p))??!1)),g},applyToStack:a,identify:()=>u(!0).map(p=>{const f=p.step??p.relation+" "+p.toMiddleware;return Ie(p.name,p.aliases)+" - "+f}),identifyOnResolve(p){return typeof p=="boolean"&&(r=p),r},resolve:(p,f)=>{for(const g of u().map(w=>w.middleware).reverse())p=g(p,f);return p}};return d},ns={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},ss={high:3,normal:2,low:1};class su{constructor(t){this.middlewareStack=Jt(),this.config=t}send(t,r,n){const s=typeof r!="function"?r:void 0,i=typeof r=="function"?r:n,o=t.resolveMiddleware(this.middlewareStack,this.config,s);if(i)o(t).then(a=>i(null,a.output),a=>i(a)).catch(()=>{});else return o(t).then(a=>a.output)}destroy(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()}}const Fe={},at=new Array(64);for(let e=0,t="A".charCodeAt(0),r="Z".charCodeAt(0);e+t<=r;e++){const n=String.fromCharCode(e+t);Fe[n]=e,at[e]=n}for(let e=0,t="a".charCodeAt(0),r="z".charCodeAt(0);e+t<=r;e++){const n=String.fromCharCode(e+t),s=e+26;Fe[n]=s,at[s]=n}for(let e=0;e<10;e++){Fe[e.toString(10)]=e+52;const t=e.toString(10),r=e+52;Fe[t]=r,at[r]=t}Fe["+"]=62;at[62]="+";Fe["/"]=63;at[63]="/";const nt=6,Ot=8,iu=63,yn=e=>{let t=e.length/4*3;e.slice(-2)==="=="?t-=2:e.slice(-1)==="="&&t--;const r=new ArrayBuffer(t),n=new DataView(r);for(let s=0;s<e.length;s+=4){let i=0,o=0;for(let u=s,d=s+3;u<=d;u++)if(e[u]!=="="){if(!(e[u]in Fe))throw new TypeError(`Invalid character ${e[u]} in base64 string.`);i|=Fe[e[u]]<<(d-u)*nt,o+=nt}else i>>=nt;const a=s/4*3;i>>=o%Ot;const c=Math.floor(o/Ot);for(let u=0;u<c;u++){const d=(c-u-1)*Ot;n.setUint8(a+u,(i&255<<d)>>d)}}return new Uint8Array(r)},Ye=e=>new TextEncoder().encode(e),st=e=>typeof e=="string"?Ye(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),bn=e=>{if(typeof e=="string")return e;if(typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};function wn(e){let t;typeof e=="string"?t=Ye(e):t=e;const r=typeof t=="object"&&typeof t.length=="number",n=typeof t=="object"&&typeof t.byteOffset=="number"&&typeof t.byteLength=="number";if(!r&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let s="";for(let i=0;i<t.length;i+=3){let o=0,a=0;for(let u=i,d=Math.min(i+3,t.length);u<d;u++)o|=t[u]<<(d-u-1)*Ot,a+=Ot;const c=Math.ceil(a/nt);o<<=c*nt-a;for(let u=1;u<=c;u++){const d=(c-u)*nt;s+=at[(o&iu<<d)>>d]}s+="==".slice(0,4-c)}return s}function ou(e,t="utf-8"){return t==="base64"?wn(e):bn(e)}function au(e,t){return t==="base64"?Ze.mutate(yn(e)):Ze.mutate(Ye(e))}class Ze extends Uint8Array{static fromString(t,r="utf-8"){switch(typeof t){case"string":return au(t,r);default:throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}}static mutate(t){return Object.setPrototypeOf(t,Ze.prototype),t}transformToString(t="utf-8"){return ou(this,t)}}const cu=(e,t)=>{const{base64Encoder:r,bodyLengthChecker:n,checksumAlgorithmFn:s,checksumLocationName:i,streamHasher:o}=t,a=r!==void 0&&n!==void 0&&s!==void 0&&i!==void 0&&o!==void 0,c=a?o(s,e):void 0,u=e.getReader();return new ReadableStream({async pull(d){const{value:p,done:f}=await u.read();if(f){if(d.enqueue(`0\r
  2. `),a){const g=r(await c);d.enqueue(`${i}:${g}\r
  3. `),d.enqueue(`\r
  4. `)}d.close()}else d.enqueue(`${(n(p)||0).toString(16)}\r
  5. ${p}\r
  6. `)}})},je=e=>encodeURIComponent(e).replace(/[!'()*]/g,uu),uu=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function lu(e){const t=[];for(let r of Object.keys(e).sort()){const n=e[r];if(r=je(r),Array.isArray(n))for(let s=0,i=n.length;s<i;s++)t.push(`${r}=${je(n[s])}`);else{let s=r;(n||typeof n=="string")&&(s+=`=${je(n)}`),t.push(s)}}return t.join("&")}function du(e=0){return new Promise((t,r)=>{e&&setTimeout(()=>{const n=new Error(`Request did not complete within ${e} ms`);n.name="TimeoutError",r(n)},e)})}const hu={supported:typeof Request<"u"&&"keepalive"in new Request("https://[::1]")};class vn{static create(t){return typeof(t==null?void 0:t.handle)=="function"?t:new vn(t)}constructor(t){typeof t=="function"?this.configProvider=t().then(r=>r||{}):(this.config=t??{},this.configProvider=Promise.resolve(this.config))}destroy(){}async handle(t,{abortSignal:r}={}){this.config||(this.config=await this.configProvider);const n=this.config.requestTimeout,s=this.config.keepAlive===!0;if(r!=null&&r.aborted){const b=new Error("Request aborted");return b.name="AbortError",Promise.reject(b)}let i=t.path;const o=lu(t.query||{});o&&(i+=`?${o}`),t.fragment&&(i+=`#${t.fragment}`);let a="";if(t.username!=null||t.password!=null){const b=t.username??"",C=t.password??"";a=`${b}:${C}@`}const{port:c,method:u}=t,d=`${t.protocol}//${a}${t.hostname}${c?`:${c}`:""}${i}`,p=u==="GET"||u==="HEAD"?void 0:t.body,f={body:p,headers:new Headers(t.headers),method:u};p&&(f.duplex="half"),typeof AbortController<"u"&&(f.signal=r),hu.supported&&(f.keepalive=s);const g=new Request(d,f),w=[fetch(g).then(b=>{const C=b.headers,I={};for(const U of C.entries())I[U[0]]=U[1];return b.body!=null?{response:new Yt({headers:I,reason:b.statusText,statusCode:b.status,body:b.body})}:b.blob().then(U=>({response:new Yt({headers:I,reason:b.statusText,statusCode:b.status,body:U})}))}),du(n)];return r&&w.push(new Promise((b,C)=>{r.onabort=()=>{const I=new Error("Request aborted");I.name="AbortError",C(I)}})),Promise.race(w)}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[t]=r,n))}httpHandlerConfigs(){return this.config??{}}}const Do=e=>typeof Blob=="function"&&e instanceof Blob?pu(e):fu(e);async function pu(e){const t=await gu(e),r=yn(t);return new Uint8Array(r)}async function fu(e){const t=[],r=e.getReader();let n=!1,s=0;for(;!n;){const{done:a,value:c}=await r.read();c&&(t.push(c),s+=c.length),n=a}const i=new Uint8Array(s);let o=0;for(const a of t)i.set(a,o),o+=a.length;return i}function gu(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const s=n.result??"",i=s.indexOf(","),o=i>-1?i+1:s.length;t(s.substring(o))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})}const Lo={},Yr={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),Lo[e]=t,Yr[t]=e}function jo(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){const n=e.slice(r,r+2).toLowerCase();if(n in Yr)t[r/2]=Yr[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return t}function he(e){let t="";for(let r=0;r<e.byteLength;r++)t+=Lo[e[r]];return t}const is="The stream has already been transformed.",mu=e=>{var t,r;if(!os(e)&&!as(e)){const o=((r=(t=e==null?void 0:e.__proto__)==null?void 0:t.constructor)==null?void 0:r.name)||e;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`)}let n=!1;const s=async()=>{if(n)throw new Error(is);return n=!0,await Do(e)},i=o=>{if(typeof o.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
  7. If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return o.stream()};return Object.assign(e,{transformToByteArray:s,transformToString:async o=>{const a=await s();if(o==="base64")return wn(a);if(o==="hex")return he(a);if(o===void 0||o==="utf8"||o==="utf-8")return bn(a);if(typeof TextDecoder=="function")return new TextDecoder(o).decode(a);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(n)throw new Error(is);if(n=!0,os(e))return i(e);if(as(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},os=e=>typeof Blob=="function"&&e instanceof Blob,as=e=>typeof ReadableStream=="function"&&e instanceof ReadableStream,Fo=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return Ze.mutate(e);if(!e)return Ze.mutate(new Uint8Array);const r=t.streamCollector(e);return Ze.mutate(await r)};class Sn{constructor(){this.middlewareStack=Jt()}static classBuilder(){return new yu}resolveMiddlewareWithContext(t,r,n,{middlewareFn:s,clientName:i,commandName:o,inputFilterSensitiveLog:a,outputFilterSensitiveLog:c,smithyContext:u,additionalContext:d,CommandCtor:p}){for(const C of s.bind(this)(p,t,r,n))this.middlewareStack.use(C);const f=t.concat(this.middlewareStack),{logger:g}=r,w={logger:g,clientName:i,commandName:o,inputFilterSensitiveLog:a,outputFilterSensitiveLog:c,[Xr]:{...u},...d},{requestHandler:b}=r;return f.resolve(C=>b.handle(C.request,n||{}),w)}}class yu{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=t=>t,this._outputFilterSensitiveLog=t=>t,this._serializer=null,this._deserializer=null}init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,r,n={}){return this._smithyContext={service:t,operation:r,...n},this}c(t={}){return this._additionalContext=t,this}n(t,r){return this._clientName=t,this._commandName=r,this}f(t=n=>n,r=n=>n){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=r,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}build(){const t=this;let r;return r=class extends Sn{static getEndpointParameterInstructions(){return t._ep}constructor(...[n]){super(),this.serialize=t._serializer,this.deserialize=t._deserializer,this.input=n??{},t._init(this)}resolveMiddleware(n,s,i){return this.resolveMiddlewareWithContext(n,s,i,{CommandCtor:r,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog,outputFilterSensitiveLog:t._outputFilterSensitiveLog,smithyContext:t._smithyContext,additionalContext:t._additionalContext})}}}}const Xe="***SensitiveInformation***",bu=e=>{switch(e){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${e}"`)}},wu=e=>{if(e!=null){if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&Vo.warn(qo(`Expected number but observed string: ${e}`)),t}if(typeof e=="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},vu=Math.ceil(2**127*(2-2**-23)),Su=e=>{const t=wu(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>vu)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},Au=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}},Eu=e=>Ho(e,16),xu=e=>Ho(e,8),Ho=(e,t)=>{const r=Au(e);if(r!==void 0&&ku(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},ku=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},zo=(e,t)=>{if(e==null)throw t?new TypeError(`Expected a non-null value for ${t}`):new TypeError("Expected a non-null value");return e},Cu=e=>{if(e==null)return;if(typeof e=="object"&&!Array.isArray(e))return e;const t=Array.isArray(e)?"array":typeof e;throw new TypeError(`Expected object, got ${t}: ${e}`)},Nt=e=>{if(e!=null){if(typeof e=="string")return e;if(["boolean","number","bigint"].includes(typeof e))return Vo.warn(qo(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)}},Ru=e=>Su(typeof e=="string"?An(e):e),Tu=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,An=e=>{const t=e.match(Tu);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},Pu=e=>Eu(typeof e=="string"?An(e):e),_u=e=>xu(typeof e=="string"?An(e):e),qo=e=>String(new TypeError(e).stack||e).split(`
  8. `).slice(0,5).filter(t=>!t.includes("stackTraceWarning")).join(`
  9. `),Vo={warn:console.warn},Ou=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Wo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Nu(e){const t=e.getUTCFullYear(),r=e.getUTCMonth(),n=e.getUTCDay(),s=e.getUTCDate(),i=e.getUTCHours(),o=e.getUTCMinutes(),a=e.getUTCSeconds(),c=s<10?`0${s}`:`${s}`,u=i<10?`0${i}`:`${i}`,d=o<10?`0${o}`:`${o}`,p=a<10?`0${a}`:`${a}`;return`${Ou[n]}, ${c} ${Wo[r]} ${t} ${u}:${d}:${p} GMT`}const Mu=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Iu=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=Mu.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,s,i,o,a,c,u,d]=t,p=Pu(Ko(n)),f=Mt(s,"month",1,12),g=Mt(i,"day",1,31),w=Uu(p,f,g,{hours:o,minutes:a,seconds:c,fractionalMilliseconds:u});return d.toUpperCase()!="Z"&&w.setTime(w.getTime()-ju(d)),w},Uu=(e,t,r,n)=>{const s=t-1;return Bu(e,s,r),new Date(Date.UTC(e,s,r,Mt(n.hours,"hour",0,23),Mt(n.minutes,"minute",0,59),Mt(n.seconds,"seconds",0,60),Lu(n.fractionalMilliseconds)))},$u=[31,28,31,30,31,30,31,31,30,31,30,31],Bu=(e,t,r)=>{let n=$u[t];if(t===1&&Du(e)&&(n=29),r>n)throw new TypeError(`Invalid day for ${Wo[t]} in ${e}: ${r}`)},Du=e=>e%4===0&&(e%100!==0||e%400===0),Mt=(e,t,r,n)=>{const s=_u(Ko(e));if(s<r||s>n)throw new TypeError(`${t} must be between ${r} and ${n}, inclusive`);return s},Lu=e=>e==null?0:Ru("0."+e)*1e3,ju=e=>{const t=e[0];let r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);const n=Number(e.substring(1,3)),s=Number(e.substring(4,6));return r*(n*60+s)*60*1e3},Ko=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)==="0";)t++;return t===0?e:e.slice(t)};class En extends Error{constructor(t){super(t.message),Object.setPrototypeOf(this,En.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}}const Oe=(e,t={})=>{Object.entries(t).filter(([,n])=>n!==void 0).forEach(([n,s])=>{(e[n]==null||e[n]==="")&&(e[n]=s)});const r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e},Fu=({output:e,parsedBody:t,exceptionCtor:r,errorCode:n})=>{const s=zu(e),i=s.httpStatusCode?s.httpStatusCode+"":void 0,o=new r({name:(t==null?void 0:t.code)||(t==null?void 0:t.Code)||n||i||"UnknownError",$fault:"client",$metadata:s});throw Oe(o,t)},Hu=e=>({output:t,parsedBody:r,errorCode:n})=>{Fu({output:t,parsedBody:r,exceptionCtor:e,errorCode:n})},zu=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),qu=e=>{switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},Vu=e=>{const t=[];for(const r in Xt){const n=Xt[r];e[n]!==void 0&&t.push({algorithmId:()=>n,checksumConstructor:()=>e[n]})}return{_checksumAlgorithms:t,addChecksumAlgorithm(r){this._checksumAlgorithms.push(r)},checksumAlgorithms(){return this._checksumAlgorithms}}},Wu=e=>{const t={};return e.checksumAlgorithms().forEach(r=>{t[r.algorithmId()]=r.checksumConstructor()}),t},Ku=e=>{let t=e.retryStrategy;return{setRetryStrategy(r){t=r},retryStrategy(){return t}}},Gu=e=>{const t={};return t.retryStrategy=e.retryStrategy(),t},Zu=e=>({...Vu(e),...Ku(e)}),Xu=e=>({...Wu(e),...Gu(e)});function cs(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}const Go=e=>{const t="#text";for(const r in e)e.hasOwnProperty(r)&&e[r][t]!==void 0?e[r]=e[r][t]:typeof e[r]=="object"&&e[r]!==null&&(e[r]=Go(e[r]));return e},Jr=function(){const e=Object.getPrototypeOf(this).constructor,t=Function.bind.apply(String,[null,...arguments]),r=new t;return Object.setPrototypeOf(r,e.prototype),r};Jr.prototype=Object.create(String.prototype,{constructor:{value:Jr,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(Jr,String);function oe(e,t,r){let n,s,i;if(typeof t>"u"&&typeof r>"u")n={},i=e;else{if(n=e,typeof t=="function")return s=t,i=r,Yu(n,s,i);i=t}for(const o of Object.keys(i)){if(!Array.isArray(i[o])){n[o]=i[o];continue}Ju(n,null,i,o)}return n}const Yu=(e,t,r)=>oe(e,Object.entries(r).reduce((n,[s,i])=>(Array.isArray(i)?n[s]=i:typeof i=="function"?n[s]=[t,i()]:n[s]=[t,i],n),{})),Ju=(e,t,r,n)=>{if(t!==null){let o=r[n];typeof o=="function"&&(o=[,o]);const[a=Qu,c=el,u=n]=o;(typeof a=="function"&&a(t[u])||typeof a!="function"&&a)&&(e[n]=c(t[u]));return}let[s,i]=r[n];if(typeof i=="function"){let o;const a=s===void 0&&(o=i())!=null,c=typeof s=="function"&&!!s(void 0)||typeof s!="function"&&!!s;a?e[n]=o:c&&(e[n]=i())}else{const o=s===void 0&&i!=null,a=typeof s=="function"&&!!s(i)||typeof s!="function"&&!!s;(o||a)&&(e[n]=i)}},Qu=e=>e!=null,el=e=>e,tl=(e,t,r,n,s,i)=>{if(t!=null&&t[r]!==void 0){const o=n();if(o.length<=0)throw new Error("Empty value provided for input HTTP label: "+r+".");e=e.replace(s,i?o.split("/").map(a=>cs(a)).join("/"):cs(o))}else throw new Error("No value provided for input HTTP label: "+r+".");return e},rl=e=>e.toISOString().replace(".000Z","Z"),nl="content-length";function sl(){return(e,t)=>async r=>{var n;const{request:s}=r;if(fe.isInstance(s)&&!(nl in s.headers)){const i="Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.";typeof((n=t==null?void 0:t.logger)==null?void 0:n.warn)=="function"&&!(t.logger instanceof mn)&&t.logger.warn(i)}return e({...r})}}const il={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},ol=e=>({applyToStack:t=>{t.add(sl(),il)}}),al=e=>(t,r)=>async n=>{const s=await e.region(),i=e.region;r.__s3RegionRedirect&&(e.region=async()=>(e.region=i,r.__s3RegionRedirect));const o=await t(n);if(r.__s3RegionRedirect){const a=await e.region();if(s!==a)throw new Error("Region was not restored following S3 region redirect.")}return o},cl={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function ul(e){return(t,r)=>async n=>{var s,i;try{return await t(n)}catch(o){if(e.followRegionRedirects&&((s=o==null?void 0:o.$metadata)==null?void 0:s.httpStatusCode)===301){try{const a=o.$response.headers["x-amz-bucket-region"];(i=r.logger)==null||i.debug(`Redirecting from ${await e.region()} to ${a}`),r.__s3RegionRedirect=a}catch(a){throw new Error("Region redirect failed: "+a)}return t(n)}else throw o}}}const ll={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},dl=e=>({applyToStack:t=>{t.add(ul(e),ll),t.addRelativeTo(al(e),cl)}});class ir{constructor(t={}){this.data=t,this.lastPurgeTime=Date.now()}get(t){const r=this.data[t];if(r)return r}set(t,r){return this.data[t]=r,r}delete(t){delete this.data[t]}async purgeExpired(){const t=Date.now();if(!(this.lastPurgeTime+ir.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>t))for(const r in this.data){const n=this.data[r];if(!n.isRefreshing){const s=await n.identity;s.expiration&&s.expiration.getTime()<t&&delete this.data[r]}}}}ir.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=3e4;class hr{constructor(t,r=!1,n=Date.now()){this._identity=t,this.isRefreshing=r,this.accessed=n}get identity(){return this.accessed=Date.now(),this._identity}}class or{constructor(t,r=new ir){this.createSessionFn=t,this.cache=r}async getS3ExpressIdentity(t,r){const n=r.Bucket,{cache:s}=this,i=s.get(n);return i?i.identity.then(o=>{var a,c;return(((a=o.expiration)==null?void 0:a.getTime())??0)<Date.now()?s.set(n,new hr(this.getIdentity(n))).identity:((((c=o.expiration)==null?void 0:c.getTime())??0)<Date.now()+or.REFRESH_WINDOW_MS&&!i.isRefreshing&&(i.isRefreshing=!0,this.getIdentity(n).then(u=>{s.set(n,new hr(Promise.resolve(u)))})),o)}):s.set(n,new hr(this.getIdentity(n))).identity}async getIdentity(t){var r,n;await this.cache.purgeExpired().catch(i=>{});const s=await this.createSessionFn(t);if(!((r=s.Credentials)!=null&&r.AccessKeyId)||!((n=s.Credentials)!=null&&n.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}}}or.REFRESH_WINDOW_MS=6e4;const hl=e=>e[Xr]||(e[Xr]={}),ke=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t},pl="X-Amz-Algorithm",fl="X-Amz-Credential",Zo="X-Amz-Date",gl="X-Amz-SignedHeaders",ml="X-Amz-Expires",Xo="X-Amz-Signature",Yo="X-Amz-Security-Token",Jo="authorization",Qo=Zo.toLowerCase(),yl="date",bl=[Jo,Qo,yl],wl=Xo.toLowerCase(),Qr="x-amz-content-sha256",vl=Yo.toLowerCase(),Sl={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Al=/^proxy-/,El=/^sec-/,pr="AWS4-HMAC-SHA256",xl="AWS4-HMAC-SHA256-PAYLOAD",kl="UNSIGNED-PAYLOAD",Cl=50,ea="aws4_request",Rl=60*60*24*7,Lt={},fr=[],gr=(e,t,r)=>`${e}/${t}/${r}/${ea}`,Tl=async(e,t,r,n,s)=>{const i=await us(e,t.secretAccessKey,t.accessKeyId),o=`${r}:${n}:${s}:${he(i)}:${t.sessionToken}`;if(o in Lt)return Lt[o];for(fr.push(o);fr.length>Cl;)delete Lt[fr.shift()];let a=`AWS4${t.secretAccessKey}`;for(const c of[r,n,s,ea])a=await us(e,a,c);return Lt[o]=a},us=(e,t,r)=>{const n=new e(t);return n.update(st(r)),n.digest()},ls=({headers:e},t,r)=>{const n={};for(const s of Object.keys(e).sort()){if(e[s]==null)continue;const i=s.toLowerCase();(i in Sl||t!=null&&t.has(i)||Al.test(i)||El.test(i))&&(!r||r&&!r.has(i))||(n[i]=e[s].trim().replace(/\s+/g," "))}return n},Pl=({query:e={}})=>{const t=[],r={};for(const n of Object.keys(e).sort()){if(n.toLowerCase()===wl)continue;t.push(n);const s=e[n];typeof s=="string"?r[n]=`${je(n)}=${je(s)}`:Array.isArray(s)&&(r[n]=s.slice(0).reduce((i,o)=>i.concat([`${je(n)}=${je(o)}`]),[]).sort().join("&"))}return t.map(n=>r[n]).filter(n=>n).join("&")},ta=e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]",mr=async({headers:e,body:t},r)=>{for(const n of Object.keys(e))if(n.toLowerCase()===Qr)return e[n];if(t==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof t=="string"||ArrayBuffer.isView(t)||ta(t)){const n=new r;return n.update(st(t)),he(await n.digest())}return kl};class _l{format(t){const r=[];for(const i of Object.keys(t)){const o=Ye(i);r.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(t[i]))}const n=new Uint8Array(r.reduce((i,o)=>i+o.byteLength,0));let s=0;for(const i of r)n.set(i,s),s+=i.byteLength;return n}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,t.value,!1),new Uint8Array(r.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,t.value,!1),new Uint8Array(n.buffer);case"long":const s=new Uint8Array(9);return s[0]=5,s.set(t.value.bytes,1),s;case"binary":const i=new DataView(new ArrayBuffer(3+t.value.byteLength));i.setUint8(0,6),i.setUint16(1,t.value.byteLength,!1);const o=new Uint8Array(i.buffer);return o.set(t.value,3),o;case"string":const a=Ye(t.value),c=new DataView(new ArrayBuffer(3+a.byteLength));c.setUint8(0,7),c.setUint16(1,a.byteLength,!1);const u=new Uint8Array(c.buffer);return u.set(a,3),u;case"timestamp":const d=new Uint8Array(9);return d[0]=8,d.set(Nl.fromNumber(t.value.valueOf()).bytes,1),d;case"uuid":if(!Ol.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const p=new Uint8Array(17);return p[0]=9,p.set(jo(t.value.replace(/\-/g,"")),1),p}}}var ds;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(ds||(ds={}));const Ol=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;let Nl=class ra{constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(t));n>-1&&s>0;n--,s/=256)r[n]=s;return t<0&&hs(r),new ra(r)}valueOf(){const t=this.bytes.slice(0),r=t[0]&128;return r&&hs(t),parseInt(he(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}};function hs(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}const Ml=(e,t)=>{e=e.toLowerCase();for(const r of Object.keys(t))if(e===r.toLowerCase())return!0;return!1},na=({headers:e,query:t,...r})=>({...r,headers:{...e},query:t?Il(t):void 0}),Il=e=>Object.keys(e).reduce((t,r)=>{const n=e[r];return{...t,[r]:Array.isArray(n)?[...n]:n}},{}),Ul=(e,t={})=>{var r;const{headers:n,query:s={}}=typeof e.clone=="function"?e.clone():na(e);for(const i of Object.keys(n)){const o=i.toLowerCase();o.slice(0,6)==="x-amz-"&&!((r=t.unhoistableHeaders)!=null&&r.has(o))&&(s[i]=n[i],delete n[i])}return{...e,headers:n,query:s}},ps=e=>{e=typeof e.clone=="function"?e.clone():na(e);for(const t of Object.keys(e.headers))bl.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},$l=e=>Bl(e).toISOString().replace(/\.\d{3}Z$/,"Z"),Bl=e=>typeof e=="number"?new Date(e*1e3):typeof e=="string"?Number(e)?new Date(Number(e)*1e3):new Date(e):e;class en{constructor({applyChecksum:t,credentials:r,region:n,service:s,sha256:i,uriEscapePath:o=!0}){this.headerFormatter=new _l,this.service=s,this.sha256=i,this.uriEscapePath=o,this.applyChecksum=typeof t=="boolean"?t:!0,this.regionProvider=ke(n),this.credentialProvider=ke(r)}async presign(t,r={}){const{signingDate:n=new Date,expiresIn:s=3600,unsignableHeaders:i,unhoistableHeaders:o,signableHeaders:a,signingRegion:c,signingService:u}=r,d=await this.credentialProvider();this.validateResolvedCredentials(d);const p=c??await this.regionProvider(),{longDate:f,shortDate:g}=jt(n);if(s>Rl)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const w=gr(g,p,u??this.service),b=Ul(ps(t),{unhoistableHeaders:o});d.sessionToken&&(b.query[Yo]=d.sessionToken),b.query[pl]=pr,b.query[fl]=`${d.accessKeyId}/${w}`,b.query[Zo]=f,b.query[ml]=s.toString(10);const C=ls(b,i,a);return b.query[gl]=fs(C),b.query[Xo]=await this.getSignature(f,w,this.getSigningKey(d,p,g,u),this.createCanonicalRequest(b,C,await mr(t,this.sha256))),b}async sign(t,r){return typeof t=="string"?this.signString(t,r):t.headers&&t.payload?this.signEvent(t,r):t.message?this.signMessage(t,r):this.signRequest(t,r)}async signEvent({headers:t,payload:r},{signingDate:n=new Date,priorSignature:s,signingRegion:i,signingService:o}){const a=i??await this.regionProvider(),{shortDate:c,longDate:u}=jt(n),d=gr(c,a,o??this.service),p=await mr({headers:{},body:r},this.sha256),f=new this.sha256;f.update(t);const g=he(await f.digest()),w=[xl,u,d,s,g,p].join(`
  10. `);return this.signString(w,{signingDate:n,signingRegion:a,signingService:o})}async signMessage(t,{signingDate:r=new Date,signingRegion:n,signingService:s}){return this.signEvent({headers:this.headerFormatter.format(t.message.headers),payload:t.message.body},{signingDate:r,signingRegion:n,signingService:s,priorSignature:t.priorSignature}).then(i=>({message:t.message,signature:i}))}async signString(t,{signingDate:r=new Date,signingRegion:n,signingService:s}={}){const i=await this.credentialProvider();this.validateResolvedCredentials(i);const o=n??await this.regionProvider(),{shortDate:a}=jt(r),c=new this.sha256(await this.getSigningKey(i,o,a,s));return c.update(st(t)),he(await c.digest())}async signRequest(t,{signingDate:r=new Date,signableHeaders:n,unsignableHeaders:s,signingRegion:i,signingService:o}={}){const a=await this.credentialProvider();this.validateResolvedCredentials(a);const c=i??await this.regionProvider(),u=ps(t),{longDate:d,shortDate:p}=jt(r),f=gr(p,c,o??this.service);u.headers[Qo]=d,a.sessionToken&&(u.headers[vl]=a.sessionToken);const g=await mr(u,this.sha256);!Ml(Qr,u.headers)&&this.applyChecksum&&(u.headers[Qr]=g);const w=ls(u,s,n),b=await this.getSignature(d,f,this.getSigningKey(a,c,p,o),this.createCanonicalRequest(u,w,g));return u.headers[Jo]=`${pr} Credential=${a.accessKeyId}/${f}, SignedHeaders=${fs(w)}, Signature=${b}`,u}createCanonicalRequest(t,r,n){const s=Object.keys(r).sort();return`${t.method}
  11. ${this.getCanonicalPath(t)}
  12. ${Pl(t)}
  13. ${s.map(i=>`${i}:${r[i]}`).join(`
  14. `)}
  15. ${s.join(";")}
  16. ${n}`}async createStringToSign(t,r,n){const s=new this.sha256;s.update(st(n));const i=await s.digest();return`${pr}
  17. ${t}
  18. ${r}
  19. ${he(i)}`}getCanonicalPath({path:t}){if(this.uriEscapePath){const r=[];for(const s of t.split("/"))(s==null?void 0:s.length)!==0&&s!=="."&&(s===".."?r.pop():r.push(s));const n=`${t!=null&&t.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&t!=null&&t.endsWith("/")?"/":""}`;return je(n).replace(/%2F/g,"/")}return t}async getSignature(t,r,n,s){const i=await this.createStringToSign(t,r,s),o=new this.sha256(await n);return o.update(st(i)),he(await o.digest())}getSigningKey(t,r,n,s){return Tl(this.sha256,t,n,r,s||this.service)}validateResolvedCredentials(t){if(typeof t!="object"||typeof t.accessKeyId!="string"||typeof t.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}}const jt=e=>{const t=$l(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.slice(0,8)}},fs=e=>Object.keys(e).sort().join(";");var gs;(function(e){e.ENV="env",e.CONFIG="shared config entry"})(gs||(gs={}));const Dl="Directory",Ll="S3Express",jl="sigv4-s3express",tn="X-Amz-S3session-Token",rn=tn.toLowerCase();class Fl extends en{async signWithCredentials(t,r,n){const s=ms(r);t.headers[rn]=r.sessionToken;const i=this;return ys(i,s),i.signRequest(t,n??{})}async presignWithCredentials(t,r,n){const s=ms(r);return delete t.headers[rn],t.headers[tn]=r.sessionToken,t.query=t.query??{},t.query[tn]=r.sessionToken,ys(this,s),this.presign(t,n)}}function ms(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,expiration:e.expiration}}function ys(e,t){const r=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),n=e.credentialProvider,s=()=>(clearTimeout(r),e.credentialProvider=n,Promise.resolve(t));e.credentialProvider=s}const Hl=e=>(t,r)=>async n=>{var s,i,o,a,c;if(r.endpointV2){const u=r.endpointV2,d=((o=(i=(s=u.properties)==null?void 0:s.authSchemes)==null?void 0:i[0])==null?void 0:o.name)===jl;if((((a=u.properties)==null?void 0:a.backend)===Ll||((c=u.properties)==null?void 0:c.bucketType)===Dl)&&(r.isS3ExpressBucket=!0),d){const p=n.input.Bucket;if(p){const f=await e.s3ExpressIdentityProvider.getS3ExpressIdentity(await e.credentials(),{Bucket:p});r.s3ExpressIdentity=f,fe.isInstance(n.request)&&f.sessionToken&&(n.request.headers[rn]=f.sessionToken)}}}return t(n)},zl={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},ql=e=>({applyToStack:t=>{t.add(Hl(e),zl)}}),Vl=(e,{session:t})=>{const[r,n]=t;return{...e,forcePathStyle:e.forcePathStyle??!1,useAccelerateEndpoint:e.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:e.disableMultiregionAccessPoints??!1,followRegionRedirects:e.followRegionRedirects??!1,s3ExpressIdentityProvider:e.s3ExpressIdentityProvider??new or(async s=>r().send(new n({Bucket:s,SessionMode:"ReadWrite"}))),bucketEndpoint:e.bucketEndpoint??!1}},Wl=e=>typeof e=="string"&&e.indexOf("arn:")===0&&e.split(":").length>=6;function Kl(e){return(t,r)=>async n=>{var s,i,o,a;if(e.bucketEndpoint){const c=r.endpointV2;if(c){const u=n.input.Bucket;if(typeof u=="string")try{const d=new URL(u);c.url=d}catch(d){const p=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${u} could not be parsed as URL.`;throw((i=(s=r.logger)==null?void 0:s.constructor)==null?void 0:i.name)==="NoOpLogger"||(a=(o=r.logger)==null?void 0:o.warn)==null||a.call(o,p),d}}}return t(n)}}const Gl={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Zl({bucketEndpoint:e}){return t=>async r=>{const{input:{Bucket:n}}=r;if(!e&&typeof n=="string"&&!Wl(n)&&n.indexOf("/")>=0){const s=new Error(`Bucket name shouldn't contain '/', received '${n}'`);throw s.name="InvalidBucketName",s}return t({...r})}}const Xl={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Yl=e=>({applyToStack:t=>{t.add(Zl(e),Xl),t.addRelativeTo(Kl(e),Gl)}}),sa=(e,t,r)=>{let n,s,i,o=!1;const a=async()=>{s||(s=e());try{n=await s,i=!0,o=!1}finally{s=void 0}return n};return t===void 0?async c=>((!i||c!=null&&c.forceRefresh)&&(n=await a()),n):async c=>((!i||c!=null&&c.forceRefresh)&&(n=await a()),o?n:r&&!r(n)?(o=!0,n):(t(n)&&await a(),n))},Jl=3e5,Ql=e=>{const t=e.credentials?ed(e.credentials):e.credentialDefaultProvider(Object.assign({},e,{parentClientConfig:e})),{signingEscapePath:r=!0,systemClockOffset:n=e.systemClockOffset||0,sha256:s}=e;let i;return e.signer?i=ke(e.signer):e.regionInfoProvider?i=()=>ke(e.region)().then(async o=>[await e.regionInfoProvider(o,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},o]).then(([o,a])=>{const{signingRegion:c,signingService:u}=o;e.signingRegion=e.signingRegion||c||a,e.signingName=e.signingName||u||e.serviceId;const d={...e,credentials:t,region:e.signingRegion,service:e.signingName,sha256:s,uriEscapePath:r},p=e.signerConstructor||en;return new p(d)}):i=async o=>{o=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await ke(e.region)(),properties:{}},o);const a=(o==null?void 0:o.name)==="sigv4a",c=o.signingRegion,u=o.signingName;let d;a?d=e.signingRegion||c:(e.signingRegion=e.signingRegion||c,d=e.signingRegion),e.signingName=e.signingName||u||e.serviceId;const p={...e,credentials:t,region:d,service:e.signingName,sha256:s,uriEscapePath:r},f=e.signerConstructor||en;return new f(p)},{...e,systemClockOffset:n,signingEscapePath:r,credentials:t,signer:i}},ed=e=>typeof e=="function"?sa(e,t=>t.expiration!==void 0&&t.expiration.getTime()-Date.now()<Jl,t=>t.expiration!==void 0):ke(e),ia=e=>new Date(Date.now()+e),td=(e,t)=>Math.abs(ia(t).getTime()-e)>=3e5,bs=(e,t)=>{const r=Date.parse(e);return td(r,t)?r-Date.now():t},rd=e=>(t,r)=>async function(n){var s,i,o,a,c,u,d;if(!fe.isInstance(n.request))return t(n);let p,f;const g=(o=(i=(s=r.endpointV2)==null?void 0:s.properties)==null?void 0:i.authSchemes)==null?void 0:o[0],w=(u=(c=(a=r.endpointV2)==null?void 0:a.properties)==null?void 0:c.authSchemes)==null?void 0:u[1];if((g==null?void 0:g.name)==="sigv4a"&&w){f=await e.signer(p=g);const j=f;(()=>{var Se;if(typeof(j==null?void 0:j.getSigv4aSigner)=="function"){if(((Se=j==null?void 0:j.signerOptions)==null?void 0:Se.runtime)!=="node")return!1;try{return j.getSigv4aSigner(),!0}catch{}}return!1})()||(f=await e.signer(p=w))}else f=await e.signer(p=g);let b;const C=(p==null?void 0:p.name)==="sigv4a"?(d=p==null?void 0:p.signingRegionSet)==null?void 0:d.join(","):void 0,I={signingDate:ia(e.systemClockOffset),signingRegion:C||r.signing_region,signingService:r.signing_service};if(r.s3ExpressIdentity){if(b=await f.signWithCredentials(n.request,r.s3ExpressIdentity,I),b.headers["X-Amz-Security-Token"]||b.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.")}else b=await f.sign(n.request,I);const U=await t({...n,request:b}).catch(j=>{const Se=j.ServerTime??ws(j.$response);throw Se&&(e.systemClockOffset=bs(Se,e.systemClockOffset)),j}),Z=ws(U.response);return Z&&(e.systemClockOffset=bs(Z,e.systemClockOffset)),U},ws=e=>{var t,r;return Yt.isInstance(e)?((t=e.headers)==null?void 0:t.date)??((r=e.headers)==null?void 0:r.Date):void 0},nd={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},sd=e=>({applyToStack:t=>{t.addRelativeTo(rd(e),nd)}});function id(e){return{...e,customUserAgent:typeof e.customUserAgent=="string"?[[e.customUserAgent]]:e.customUserAgent}}const od=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),oa=e=>od.test(e)||e.startsWith("[")&&e.endsWith("]"),ad=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),xn=(e,t=!1)=>{if(!t)return ad.test(e);const r=e.split(".");for(const n of r)if(!xn(n))return!1;return!0},Qt={},$t="endpoints";function He(e){return typeof e!="object"||e==null?e:"ref"in e?`$${He(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(He).join(", ")})`:JSON.stringify(e,null,2)}class ge extends Error{constructor(t){super(t),this.name="EndpointError"}}const cd=(e,t)=>e===t,ud=e=>{const t=e.split("."),r=[];for(const n of t){const s=n.indexOf("[");if(s!==-1){if(n.indexOf("]")!==n.length-1)throw new ge(`Path: '${e}' does not end with ']'`);const i=n.slice(s+1,-1);if(Number.isNaN(parseInt(i)))throw new ge(`Invalid array index: '${i}' in path: '${e}'`);s!==0&&r.push(n.slice(0,s)),r.push(i)}else r.push(n)}return r},aa=(e,t)=>ud(t).reduce((r,n)=>{if(typeof r!="object")throw new ge(`Index '${n}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(r)?r[parseInt(n)]:r[n]},e),ld=e=>e!=null,dd=e=>!e,yr={[Ut.HTTP]:80,[Ut.HTTPS]:443},hd=e=>{const t=(()=>{try{if(e instanceof URL)return e;if(typeof e=="object"&&"hostname"in e){const{hostname:f,port:g,protocol:w="",path:b="",query:C={}}=e,I=new URL(`${w}//${f}${g?`:${g}`:""}${b}`);return I.search=Object.entries(C).map(([U,Z])=>`${U}=${Z}`).join("&"),I}return new URL(e)}catch{return null}})();if(!t)return null;const r=t.href,{host:n,hostname:s,pathname:i,protocol:o,search:a}=t;if(a)return null;const c=o.slice(0,-1);if(!Object.values(Ut).includes(c))return null;const u=oa(s),d=r.includes(`${n}:${yr[c]}`)||typeof e=="string"&&e.includes(`${n}:${yr[c]}`),p=`${n}${d?`:${yr[c]}`:""}`;return{scheme:c,authority:p,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:u}},pd=(e,t)=>e===t,fd=(e,t,r,n)=>t>=r||e.length<r?null:n?e.substring(e.length-r,e.length-t):e.substring(t,r),gd=e=>encodeURIComponent(e).replace(/[!*'()]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),md={booleanEquals:cd,getAttr:aa,isSet:ld,isValidHostLabel:xn,not:dd,parseURL:hd,stringEquals:pd,substring:fd,uriEncode:gd},ca=(e,t)=>{const r=[],n={...t.endpointParams,...t.referenceRecord};let s=0;for(;s<e.length;){const i=e.indexOf("{",s);if(i===-1){r.push(e.slice(s));break}r.push(e.slice(s,i));const o=e.indexOf("}",i);if(o===-1){r.push(e.slice(i));break}e[i+1]==="{"&&e[o+1]==="}"&&(r.push(e.slice(i+1,o)),s=o+2);const a=e.substring(i+1,o);if(a.includes("#")){const[c,u]=a.split("#");r.push(aa(n[c],u))}else r.push(n[a]);s=o+1}return r.join("")},yd=({ref:e},t)=>({...t.endpointParams,...t.referenceRecord})[e],ar=(e,t,r)=>{if(typeof e=="string")return ca(e,r);if(e.fn)return ua(e,r);if(e.ref)return yd(e,r);throw new ge(`'${t}': ${String(e)} is not a string, function or reference.`)},ua=({fn:e,argv:t},r)=>{const n=t.map(i=>["boolean","number"].includes(typeof i)?i:ar(i,"arg",r)),s=e.split(".");return s[0]in Qt&&s[1]!=null?Qt[s[0]][s[1]](...n):md[e](...n)},bd=({assign:e,...t},r)=>{var n,s;if(e&&e in r.referenceRecord)throw new ge(`'${e}' is already defined in Reference Record.`);const i=ua(t,r);return(s=(n=r.logger)==null?void 0:n.debug)==null||s.call(n,`${$t} evaluateCondition: ${He(t)} = ${He(i)}`),{result:i===""?!0:!!i,...e!=null&&{toAssign:{name:e,value:i}}}},kn=(e=[],t)=>{var r,n;const s={};for(const i of e){const{result:o,toAssign:a}=bd(i,{...t,referenceRecord:{...t.referenceRecord,...s}});if(!o)return{result:o};a&&(s[a.name]=a.value,(n=(r=t.logger)==null?void 0:r.debug)==null||n.call(r,`${$t} assign: ${a.name} := ${He(a.value)}`))}return{result:!0,referenceRecord:s}},wd=(e,t)=>Object.entries(e).reduce((r,[n,s])=>({...r,[n]:s.map(i=>{const o=ar(i,"Header value entry",t);if(typeof o!="string")throw new ge(`Header '${n}' value '${o}' is not a string`);return o})}),{}),la=(e,t)=>{if(Array.isArray(e))return e.map(r=>la(r,t));switch(typeof e){case"string":return ca(e,t);case"object":if(e===null)throw new ge(`Unexpected endpoint property: ${e}`);return da(e,t);case"boolean":return e;default:throw new ge(`Unexpected endpoint property type: ${typeof e}`)}},da=(e,t)=>Object.entries(e).reduce((r,[n,s])=>({...r,[n]:la(s,t)}),{}),vd=(e,t)=>{const r=ar(e,"Endpoint URL",t);if(typeof r=="string")try{return new URL(r)}catch(n){throw n}throw new ge(`Endpoint URL must be a string, got ${typeof r}`)},Sd=(e,t)=>{var r,n;const{conditions:s,endpoint:i}=e,{result:o,referenceRecord:a}=kn(s,t);if(!o)return;const c={...t,referenceRecord:{...t.referenceRecord,...a}},{url:u,properties:d,headers:p}=i;return(n=(r=t.logger)==null?void 0:r.debug)==null||n.call(r,`${$t} Resolving endpoint from template: ${He(i)}`),{...p!=null&&{headers:wd(p,c)},...d!=null&&{properties:da(d,c)},url:vd(u,c)}},Ad=(e,t)=>{const{conditions:r,error:n}=e,{result:s,referenceRecord:i}=kn(r,t);if(s)throw new ge(ar(n,"Error",{...t,referenceRecord:{...t.referenceRecord,...i}}))},Ed=(e,t)=>{const{conditions:r,rules:n}=e,{result:s,referenceRecord:i}=kn(r,t);if(s)return ha(n,{...t,referenceRecord:{...t.referenceRecord,...i}})},ha=(e,t)=>{for(const r of e)if(r.type==="endpoint"){const n=Sd(r,t);if(n)return n}else if(r.type==="error")Ad(r,t);else if(r.type==="tree"){const n=Ed(r,t);if(n)return n}else throw new ge(`Unknown endpoint rule: ${r}`);throw new ge("Rules evaluation failed")},xd=(e,t)=>{var r,n,s,i,o;const{endpointParams:a,logger:c}=t,{parameters:u,rules:d}=e;(n=(r=t.logger)==null?void 0:r.debug)==null||n.call(r,`${$t} Initial EndpointParams: ${He(a)}`);const p=Object.entries(u).filter(([,w])=>w.default!=null).map(([w,b])=>[w,b.default]);if(p.length>0)for(const[w,b]of p)a[w]=a[w]??b;const f=Object.entries(u).filter(([,w])=>w.required).map(([w])=>w);for(const w of f)if(a[w]==null)throw new ge(`Missing required parameter: '${w}'`);const g=ha(d,{endpointParams:a,logger:c,referenceRecord:{}});if((s=t.endpointParams)!=null&&s.Endpoint)try{const w=new URL(t.endpointParams.Endpoint),{protocol:b,port:C}=w;g.url.protocol=b,g.url.port=C}catch{}return(o=(i=t.logger)==null?void 0:i.debug)==null||o.call(i,`${$t} Resolved endpoint: ${He(g)}`),g},pa=(e,t=!1)=>{if(t){for(const r of e.split("."))if(!pa(r))return!1;return!0}return!(!xn(e)||e.length<3||e.length>63||e!==e.toLowerCase()||oa(e))},kd=e=>{const t=e.split(":");if(t.length<6)return null;const[r,n,s,i,o,...a]=t;return r!=="arn"||n===""||s===""||a[0]===""?null:{partition:n,service:s,region:i,accountId:o,resourceId:a[0].includes("/")?a[0].split("/"):a}},Cd=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"aws-global":{description:"AWS Standard global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"AWS China global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"AWS GovCloud (US) global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"c2s.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"AWS ISO (US) global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"sc2s.sgov.gov",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"AWS ISOB (US) global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"cloud.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"csp.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{}}],Rd="1.1",Td={partitions:Cd,version:Rd};let Pd=Td;const _d=e=>{const{partitions:t}=Pd;for(const n of t){const{regions:s,outputs:i}=n;for(const[o,a]of Object.entries(s))if(o===e)return{...i,...a}}for(const n of t){const{regionRegex:s,outputs:i}=n;if(new RegExp(s).test(e))return{...i}}const r=t.find(n=>n.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},fa={isVirtualHostableS3Bucket:pa,parseArn:kd,partition:_d};Qt.aws=fa;const vs="user-agent",br="x-amz-user-agent",Ss=" ",wr="/",Od=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,Nd=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,As="-",Md=e=>(t,r)=>async n=>{var s,i;const{request:o}=n;if(!fe.isInstance(o))return t(n);const{headers:a}=o,c=((s=r==null?void 0:r.userAgent)==null?void 0:s.map(vr))||[],u=(await e.defaultUserAgentProvider()).map(vr),d=((i=e==null?void 0:e.customUserAgent)==null?void 0:i.map(vr))||[],p=[].concat([...u,...c,...d]).join(Ss),f=[...u.filter(g=>g.startsWith("aws-sdk-")),...d].join(Ss);return e.runtime!=="browser"?(f&&(a[br]=a[br]?`${a[vs]} ${f}`:f),a[vs]=p):a[br]=p,t({...n,request:o})},vr=e=>{var t;const r=e[0].split(wr).map(a=>a.replace(Od,As)).join(wr),n=(t=e[1])==null?void 0:t.replace(Nd,As),s=r.indexOf(wr),i=r.substring(0,s);let o=r.substring(s+1);return i==="api"&&(o=o.toLowerCase()),[i,o,n].filter(a=>a&&a.length>0).reduce((a,c,u)=>{switch(u){case 0:return c;case 1:return`${a}/${c}`;default:return`${a}#${c}`}},"")},Id={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Ud=e=>({applyToStack:t=>{t.add(Md(e),Id)}}),$d=!1,Bd=!1,ga=e=>typeof e=="string"&&(e.startsWith("fips-")||e.endsWith("-fips")),Es=e=>ga(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,Dd=e=>{const{region:t,useFipsEndpoint:r}=e;if(!t)throw new Error("Region is missing");return{...e,region:async()=>{if(typeof t=="string")return Es(t);const n=await t();return Es(n)},useFipsEndpoint:async()=>{const n=typeof t=="string"?t:await t();return ga(n)?!0:typeof r!="function"?Promise.resolve(!!r):r()}}},Ld=e=>({...e,eventStreamMarshaller:e.eventStreamSerdeProvider(e)}),xs="content-length";function jd(e){return t=>async r=>{const n=r.request;if(fe.isInstance(n)){const{body:s,headers:i}=n;if(s&&Object.keys(i).map(o=>o.toLowerCase()).indexOf(xs)===-1)try{const o=e(s);n.headers={...n.headers,[xs]:String(o)}}catch{}}return t({...r,request:n})}}const Fd={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Hd=e=>({applyToStack:t=>{t.add(jd(e.bodyLengthChecker),Fd)}}),zd=async e=>{const t=(e==null?void 0:e.Bucket)||"";if(typeof e.Bucket=="string"&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),Gd(t)){if(e.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!Kd(t)||t.indexOf(".")!==-1&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e},qd=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Vd=/(\d+\.){3}\d+/,Wd=/\.\./,Kd=e=>qd.test(e)&&!Vd.test(e)&&!Wd.test(e),Gd=e=>{const[t,r,n,,,s]=e.split(":"),i=t==="arn"&&e.split(":").length>=6,o=!!(i&&r&&n&&s);if(i&&!o)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return o},Zd=(e,t,r)=>{const n=async()=>{const s=r[e]??r[t];return typeof s=="function"?s():s};return e==="credentialScope"||t==="CredentialScope"?async()=>{const s=typeof r.credentials=="function"?await r.credentials():r.credentials;return(s==null?void 0:s.credentialScope)??(s==null?void 0:s.CredentialScope)}:e==="endpoint"||t==="endpoint"?async()=>{const s=await n();if(s&&typeof s=="object"){if("url"in s)return s.url.href;if("hostname"in s){const{protocol:i,hostname:o,port:a,path:c}=s;return`${i}//${o}${a?":"+a:""}${c}`}}return s}:n},Xd=async e=>{};function Yd(e){const t={};if(e=e.replace(/^\?/,""),e)for(const r of e.split("&")){let[n,s=null]=r.split("=");n=decodeURIComponent(n),s&&(s=decodeURIComponent(s)),n in t?Array.isArray(t[n])?t[n].push(s):t[n]=[t[n],s]:t[n]=s}return t}const er=e=>{if(typeof e=="string")return er(new URL(e));const{hostname:t,pathname:r,port:n,protocol:s,search:i}=e;let o;return i&&(o=Yd(i)),{hostname:t,port:n?parseInt(n):void 0,protocol:s,path:r,query:o}},ma=e=>typeof e=="object"?"url"in e?er(e.url):e:er(e),Jd=async(e,t,r,n)=>{if(!r.endpoint){const i=await Xd(r.serviceId||"");i&&(r.endpoint=()=>Promise.resolve(ma(i)))}const s=await Qd(e,t,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return r.endpointProvider(s,n)},Qd=async(e,t,r)=>{var n;const s={},i=((n=t==null?void 0:t.getEndpointParameterInstructions)==null?void 0:n.call(t))||{};for(const[o,a]of Object.entries(i))switch(a.type){case"staticContextParams":s[o]=a.value;break;case"contextParams":s[o]=e[a.name];break;case"clientContextParams":case"builtInParams":s[o]=await Zd(a.name,o,r)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(a))}return Object.keys(i).length===0&&Object.assign(s,r),String(r.serviceId).toLowerCase()==="s3"&&await zd(s),s},eh=({config:e,instructions:t})=>(r,n)=>async s=>{var i,o,a;const c=await Jd(s.input,{getEndpointParameterInstructions(){return t}},{...e},n);n.endpointV2=c,n.authSchemes=(i=c.properties)==null?void 0:i.authSchemes;const u=(o=n.authSchemes)==null?void 0:o[0];if(u){n.signing_region=u.signingRegion,n.signing_service=u.signingName;const d=hl(n),p=(a=d==null?void 0:d.selectedHttpAuthScheme)==null?void 0:a.httpAuthOption;p&&(p.signingProperties=Object.assign(p.signingProperties||{},{signing_region:u.signingRegion,signingRegion:u.signingRegion,signing_service:u.signingName,signingName:u.signingName,signingRegionSet:u.signingRegionSet},u.properties))}return r({...s})},th=(e,t)=>r=>async n=>{const{response:s}=await r(n);try{const i=await t(s,e);return{response:s,output:i}}catch(i){if(Object.defineProperty(i,"$response",{value:s}),!("$metadata"in i)){const o="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";i.message+=`
  20. `+o,typeof i.$responseBodyText<"u"&&i.$response&&(i.$response.body=i.$responseBodyText)}throw i}},rh=(e,t)=>(r,n)=>async s=>{var i;const o=(i=n.endpointV2)!=null&&i.url&&e.urlParser?async()=>e.urlParser(n.endpointV2.url):e.endpoint;if(!o)throw new Error("No valid endpoint provider available.");const a=await t(s.input,{...e,endpoint:o});return r({...s,request:a})},nh={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Cn={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function ya(e,t,r){return{applyToStack:n=>{n.add(th(e,r),nh),n.add(rh(e,t),Cn)}}}const ba={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Cn.name},wa=(e,t)=>({applyToStack:r=>{r.addRelativeTo(eh({config:e,instructions:t}),ba)}}),sh=e=>{const t=e.tls??!0,{endpoint:r}=e,n=r!=null?async()=>ma(await ke(r)()):void 0;return{...e,endpoint:n,tls:t,isCustomEndpoint:!!r,useDualstackEndpoint:ke(e.useDualstackEndpoint??!1),useFipsEndpoint:ke(e.useFipsEndpoint??!1)}};var it;(function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"})(it||(it={}));const Rn=3,ih=it.STANDARD,oh=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],ah=["TimeoutError","RequestTimeout","RequestTimeoutException"],ch=[500,502,503,504],uh=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],lh=e=>{var t;return(t=e.$metadata)==null?void 0:t.clockSkewCorrected},va=e=>{var t,r;return((t=e.$metadata)==null?void 0:t.httpStatusCode)===429||oh.includes(e.name)||((r=e.$retryable)==null?void 0:r.throttling)==!0},Sa=e=>{var t;return lh(e)||ah.includes(e.name)||uh.includes((e==null?void 0:e.code)||"")||ch.includes(((t=e.$metadata)==null?void 0:t.httpStatusCode)||0)},dh=e=>{var t;if(((t=e.$metadata)==null?void 0:t.httpStatusCode)!==void 0){const r=e.$metadata.httpStatusCode;return 500<=r&&r<=599&&!Sa(e)}return!1};class hh{constructor(t){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=(t==null?void 0:t.beta)??.7,this.minCapacity=(t==null?void 0:t.minCapacity)??1,this.minFillRate=(t==null?void 0:t.minFillRate)??.5,this.scaleConstant=(t==null?void 0:t.scaleConstant)??.4,this.smooth=(t==null?void 0:t.smooth)??.8;const r=this.getCurrentTimeInSeconds();this.lastThrottleTime=r,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(t){if(this.enabled){if(this.refillTokenBucket(),t>this.currentCapacity){const r=(t-this.currentCapacity)/this.fillRate*1e3;await new Promise(n=>setTimeout(n,r))}this.currentCapacity=this.currentCapacity-t}}refillTokenBucket(){const t=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=t;return}const r=(t-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+r),this.lastTimestamp=t}updateClientSendingRate(t){let r;if(this.updateMeasuredRate(),va(t)){const s=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=s,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(s),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());const n=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(n)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(t){return this.getPrecise(t*this.beta)}cubicSuccess(t){return this.getPrecise(this.scaleConstant*Math.pow(t-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(t){this.refillTokenBucket(),this.fillRate=Math.max(t,this.minFillRate),this.maxCapacity=Math.max(t,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const t=this.getCurrentTimeInSeconds(),r=Math.floor(t*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){const n=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(t){return parseFloat(t.toFixed(8))}}const nn=100,Aa=20*1e3,ph=500,ks=500,fh=5,gh=10,mh=1,yh="amz-sdk-invocation-id",bh="amz-sdk-request",wh=()=>{let e=nn;return{computeNextBackoffDelay:t=>Math.floor(Math.min(Aa,Math.random()*2**t*e)),setDelayBase:t=>{e=t}}},Cs=({retryDelay:e,retryCount:t,retryCost:r})=>({getRetryCount:()=>t,getRetryDelay:()=>Math.min(Aa,e),getRetryCost:()=>r});class Ea{constructor(t){this.maxAttempts=t,this.mode=it.STANDARD,this.capacity=ks,this.retryBackoffStrategy=wh(),this.maxAttemptsProvider=typeof t=="function"?t:async()=>t}async acquireInitialRetryToken(t){return Cs({retryDelay:nn,retryCount:0})}async refreshRetryTokenForRetry(t,r){const n=await this.getMaxAttempts();if(this.shouldRetry(t,r,n)){const s=r.errorType;this.retryBackoffStrategy.setDelayBase(s==="THROTTLING"?ph:nn);const i=this.retryBackoffStrategy.computeNextBackoffDelay(t.getRetryCount()),o=r.retryAfterHint?Math.max(r.retryAfterHint.getTime()-Date.now()||0,i):i,a=this.getCapacityCost(s);return this.capacity-=a,Cs({retryDelay:o,retryCount:t.getRetryCount()+1,retryCost:a})}throw new Error("No retry token available")}recordSuccess(t){this.capacity=Math.max(ks,this.capacity+(t.getRetryCost()??mh))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return Rn}}shouldRetry(t,r,n){return t.getRetryCount()+1<n&&this.capacity>=this.getCapacityCost(r.errorType)&&this.isRetryableError(r.errorType)}getCapacityCost(t){return t==="TRANSIENT"?gh:fh}isRetryableError(t){return t==="THROTTLING"||t==="TRANSIENT"}}class vh{constructor(t,r){this.maxAttemptsProvider=t,this.mode=it.ADAPTIVE;const{rateLimiter:n}=r??{};this.rateLimiter=n??new hh,this.standardRetryStrategy=new Ea(t)}async acquireInitialRetryToken(t){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(t)}async refreshRetryTokenForRetry(t,r){return this.rateLimiter.updateClientSendingRate(r),this.standardRetryStrategy.refreshRetryTokenForRetry(t,r)}recordSuccess(t){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(t)}}let Ft;const Sh=new Uint8Array(16);function Ah(){if(!Ft&&(Ft=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ft))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ft(Sh)}const te=[];for(let e=0;e<256;++e)te.push((e+256).toString(16).slice(1));function Eh(e,t=0){return te[e[t+0]]+te[e[t+1]]+te[e[t+2]]+te[e[t+3]]+"-"+te[e[t+4]]+te[e[t+5]]+"-"+te[e[t+6]]+te[e[t+7]]+"-"+te[e[t+8]]+te[e[t+9]]+"-"+te[e[t+10]]+te[e[t+11]]+te[e[t+12]]+te[e[t+13]]+te[e[t+14]]+te[e[t+15]]}const xh=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Rs={randomUUID:xh};function kh(e,t,r){if(Rs.randomUUID&&!t&&!e)return Rs.randomUUID();e=e||{};const n=e.random||(e.rng||Ah)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let s=0;s<16;++s)t[r+s]=n[s];return t}return Eh(n)}const Ch=e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):typeof e=="string"?new Error(e):new Error(`AWS SDK error wrapper for ${e}`),Rh=e=>{const{retryStrategy:t}=e,r=ke(e.maxAttempts??Rn);return{...e,maxAttempts:r,retryStrategy:async()=>t||(await ke(e.retryMode)()===it.ADAPTIVE?new vh(r):new Ea(r))}},Th=e=>(e==null?void 0:e.body)instanceof ReadableStream,Ph=e=>(t,r)=>async n=>{var s;let i=await e.retryStrategy();const o=await e.maxAttempts();if(_h(i)){i=i;let a=await i.acquireInitialRetryToken(r.partition_id),c=new Error,u=0,d=0;const{request:p}=n,f=fe.isInstance(p);for(f&&(p.headers[yh]=kh());;)try{f&&(p.headers[bh]=`attempt=${u+1}; max=${o}`);const{response:g,output:w}=await t(n);return i.recordSuccess(a),w.$metadata.attempts=u+1,w.$metadata.totalRetryDelay=d,{response:g,output:w}}catch(g){const w=Oh(g);if(c=Ch(g),f&&Th(p))throw(s=r.logger instanceof mn?console:r.logger)==null||s.warn("An error was encountered in a non-retryable streaming request."),c;try{a=await i.refreshRetryTokenForRetry(a,w)}catch{throw c.$metadata||(c.$metadata={}),c.$metadata.attempts=u+1,c.$metadata.totalRetryDelay=d,c}u=a.getRetryCount();const b=a.getRetryDelay();d+=b,await new Promise(C=>setTimeout(C,b))}}else return i=i,i!=null&&i.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(t,n)},_h=e=>typeof e.acquireInitialRetryToken<"u"&&typeof e.refreshRetryTokenForRetry<"u"&&typeof e.recordSuccess<"u",Oh=e=>{const t={error:e,errorType:Nh(e)},r=Ih(e.$response);return r&&(t.retryAfterHint=r),t},Nh=e=>va(e)?"THROTTLING":Sa(e)?"TRANSIENT":dh(e)?"SERVER_ERROR":"CLIENT_ERROR",xa={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Mh=e=>({applyToStack:t=>{t.add(Ph(e),xa)}}),Ih=e=>{if(!Yt.isInstance(e))return;const t=Object.keys(e.headers).find(s=>s.toLowerCase()==="retry-after");if(!t)return;const r=e.headers[t],n=Number(r);return Number.isNaN(n)?new Date(r):new Date(n*1e3)},Uh=e=>({...e,useFipsEndpoint:e.useFipsEndpoint??!1,useDualstackEndpoint:e.useDualstackEndpoint??!1,forcePathStyle:e.forcePathStyle??!1,useAccelerateEndpoint:e.useAccelerateEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,disableMultiregionAccessPoints:e.disableMultiregionAccessPoints??!1,defaultSigningName:"s3"}),ka={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 ve extends En{constructor(t){super(t),Object.setPrototypeOf(this,ve.prototype)}}class Tn extends ve{constructor(t){super({name:"NoSuchUpload",$fault:"client",...t}),this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,Tn.prototype)}}class Pn extends ve{constructor(t){super({name:"ObjectNotInActiveTierError",$fault:"client",...t}),this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Pn.prototype)}}class _n extends ve{constructor(t){super({name:"BucketAlreadyExists",$fault:"client",...t}),this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,_n.prototype)}}class On extends ve{constructor(t){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...t}),this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,On.prototype)}}class Nn extends ve{constructor(t){super({name:"NoSuchBucket",$fault:"client",...t}),this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,Nn.prototype)}}var Ts;(function(e){e.visit=(t,r)=>t.Prefix!==void 0?r.Prefix(t.Prefix):t.Tag!==void 0?r.Tag(t.Tag):t.And!==void 0?r.And(t.And):r._(t.$unknown[0],t.$unknown[1])})(Ts||(Ts={}));var Ps;(function(e){e.visit=(t,r)=>t.Prefix!==void 0?r.Prefix(t.Prefix):t.Tag!==void 0?r.Tag(t.Tag):t.ObjectSizeGreaterThan!==void 0?r.ObjectSizeGreaterThan(t.ObjectSizeGreaterThan):t.ObjectSizeLessThan!==void 0?r.ObjectSizeLessThan(t.ObjectSizeLessThan):t.And!==void 0?r.And(t.And):r._(t.$unknown[0],t.$unknown[1])})(Ps||(Ps={}));var _s;(function(e){e.visit=(t,r)=>t.Prefix!==void 0?r.Prefix(t.Prefix):t.Tag!==void 0?r.Tag(t.Tag):t.AccessPointArn!==void 0?r.AccessPointArn(t.AccessPointArn):t.And!==void 0?r.And(t.And):r._(t.$unknown[0],t.$unknown[1])})(_s||(_s={}));var Os;(function(e){e.visit=(t,r)=>t.Prefix!==void 0?r.Prefix(t.Prefix):t.Tag!==void 0?r.Tag(t.Tag):t.And!==void 0?r.And(t.And):r._(t.$unknown[0],t.$unknown[1])})(Os||(Os={}));class Mn extends ve{constructor(t){super({name:"InvalidObjectState",$fault:"client",...t}),this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,Mn.prototype),this.StorageClass=t.StorageClass,this.AccessTier=t.AccessTier}}class In extends ve{constructor(t){super({name:"NoSuchKey",$fault:"client",...t}),this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,In.prototype)}}class Un extends ve{constructor(t){super({name:"NotFound",$fault:"client",...t}),this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,Un.prototype)}}const $h=e=>({...e,...e.SecretAccessKey&&{SecretAccessKey:Xe},...e.SessionToken&&{SessionToken:Xe}}),Bh=e=>({...e,...e.Credentials&&{Credentials:$h(e.Credentials)}});ba.name;Cn.name;xa.name;function Ca(e,t){return new Dh(e,t)}class Dh{constructor(t,r){this.input=t,this.context=r,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){const{hostname:t,protocol:r="https",port:n,path:s}=await this.context.endpoint();this.path=s;for(const i of this.resolvePathStack)i(this.path);return new fe({protocol:r,hostname:this.hostname||t,port:n,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(t){return this.hostname=t,this}bp(t){return this.resolvePathStack.push(r=>{this.path=`${r!=null&&r.endsWith("/")?r.slice(0,-1):r||""}`+t}),this}p(t,r,n,s){return this.resolvePathStack.push(i=>{this.path=tl(i,this.input,t,r,n,s)}),this}h(t){return this.headers=t,this}q(t){return this.query=t,this}b(t){return this.body=t,this}m(t){return this.method=t,this}}const Lh=(e,t)=>Fo(e,t).then(r=>t.utf8Encoder(r));var $n={},cr={};(function(e){const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r=t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",n="["+t+"]["+r+"]*",s=new RegExp("^"+n+"$"),i=function(a,c){const u=[];let d=c.exec(a);for(;d;){const p=[];p.startIndex=c.lastIndex-d[0].length;const f=d.length;for(let g=0;g<f;g++)p.push(d[g]);u.push(p),d=c.exec(a)}return u},o=function(a){const c=s.exec(a);return!(c===null||typeof c>"u")};e.isExist=function(a){return typeof a<"u"},e.isEmptyObject=function(a){return Object.keys(a).length===0},e.merge=function(a,c,u){if(c){const d=Object.keys(c),p=d.length;for(let f=0;f<p;f++)u==="strict"?a[d[f]]=[c[d[f]]]:a[d[f]]=c[d[f]]}},e.getValue=function(a){return e.isExist(a)?a:""},e.isName=o,e.getAllMatches=i,e.nameRegexp=n})(cr);const Bn=cr,jh={allowBooleanAttributes:!1,unpairedTags:[]};$n.validate=function(e,t){t=Object.assign({},jh,t);const r=[];let n=!1,s=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let i=0;i<e.length;i++)if(e[i]==="<"&&e[i+1]==="?"){if(i+=2,i=Ms(e,i),i.err)return i}else if(e[i]==="<"){let o=i;if(i++,e[i]==="!"){i=Is(e,i);continue}else{let a=!1;e[i]==="/"&&(a=!0,i++);let c="";for(;i<e.length&&e[i]!==">"&&e[i]!==" "&&e[i]!==" "&&e[i]!==`
  21. `&&e[i]!=="\r";i++)c+=e[i];if(c=c.trim(),c[c.length-1]==="/"&&(c=c.substring(0,c.length-1),i--),!Gh(c)){let p;return c.trim().length===0?p="Invalid space after '<'.":p="Tag '"+c+"' is an invalid name.",W("InvalidTag",p,de(e,i))}const u=zh(e,i);if(u===!1)return W("InvalidAttr","Attributes for '"+c+"' have open quote.",de(e,i));let d=u.value;if(i=u.index,d[d.length-1]==="/"){const p=i-d.length;d=d.substring(0,d.length-1);const f=Us(d,t);if(f===!0)n=!0;else return W(f.err.code,f.err.msg,de(e,p+f.err.line))}else if(a)if(u.tagClosed){if(d.trim().length>0)return W("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",de(e,o));{const p=r.pop();if(c!==p.tagName){let f=de(e,p.tagStartPos);return W("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+f.line+", col "+f.col+") instead of closing tag '"+c+"'.",de(e,o))}r.length==0&&(s=!0)}}else return W("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",de(e,i));else{const p=Us(d,t);if(p!==!0)return W(p.err.code,p.err.msg,de(e,i-d.length+p.err.line));if(s===!0)return W("InvalidXml","Multiple possible root nodes found.",de(e,i));t.unpairedTags.indexOf(c)!==-1||r.push({tagName:c,tagStartPos:o}),n=!0}for(i++;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="!"){i++,i=Is(e,i);continue}else if(e[i+1]==="?"){if(i=Ms(e,++i),i.err)return i}else break;else if(e[i]==="&"){const p=Wh(e,i);if(p==-1)return W("InvalidChar","char '&' is not expected.",de(e,i));i=p}else if(s===!0&&!Ns(e[i]))return W("InvalidXml","Extra text at the end",de(e,i));e[i]==="<"&&i--}}else{if(Ns(e[i]))continue;return W("InvalidChar","char '"+e[i]+"' is not expected.",de(e,i))}if(n){if(r.length==1)return W("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",de(e,r[0].tagStartPos));if(r.length>0)return W("InvalidXml","Invalid '"+JSON.stringify(r.map(i=>i.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return W("InvalidXml","Start tag expected.",1);return!0};function Ns(e){return e===" "||e===" "||e===`
  22. `||e==="\r"}function Ms(e,t){const r=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){const n=e.substr(r,t-r);if(t>5&&n==="xml")return W("InvalidXml","XML declaration allowed only at the start of the document.",de(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function Is(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let r=1;for(t+=8;t<e.length;t++)if(e[t]==="<")r++;else if(e[t]===">"&&(r--,r===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}const Fh='"',Hh="'";function zh(e,t){let r="",n="",s=!1;for(;t<e.length;t++){if(e[t]===Fh||e[t]===Hh)n===""?n=e[t]:n!==e[t]||(n="");else if(e[t]===">"&&n===""){s=!0;break}r+=e[t]}return n!==""?!1:{value:r,index:t,tagClosed:s}}const qh=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Us(e,t){const r=Bn.getAllMatches(e,qh),n={};for(let s=0;s<r.length;s++){if(r[s][1].length===0)return W("InvalidAttr","Attribute '"+r[s][2]+"' has no space in starting.",lt(r[s]));if(r[s][3]!==void 0&&r[s][4]===void 0)return W("InvalidAttr","Attribute '"+r[s][2]+"' is without value.",lt(r[s]));if(r[s][3]===void 0&&!t.allowBooleanAttributes)return W("InvalidAttr","boolean attribute '"+r[s][2]+"' is not allowed.",lt(r[s]));const i=r[s][2];if(!Kh(i))return W("InvalidAttr","Attribute '"+i+"' is an invalid name.",lt(r[s]));if(!n.hasOwnProperty(i))n[i]=1;else return W("InvalidAttr","Attribute '"+i+"' is repeated.",lt(r[s]))}return!0}function Vh(e,t){let r=/\d/;for(e[t]==="x"&&(t++,r=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(r))break}return-1}function Wh(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,Vh(e,t);let r=0;for(;t<e.length;t++,r++)if(!(e[t].match(/\w/)&&r<20)){if(e[t]===";")break;return-1}return t}function W(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}function Kh(e){return Bn.isName(e)}function Gh(e){return Bn.isName(e)}function de(e,t){const r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function lt(e){return e.startIndex+e[1].length}var Dn={};const Ra={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,r){return e}},Zh=function(e){return Object.assign({},Ra,e)};Dn.buildOptions=Zh;Dn.defaultOptions=Ra;class Xh{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:r})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}var Yh=Xh;const Jh=cr;function Qh(e,t){const r={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let n=1,s=!1,i=!1,o="";for(;t<e.length;t++)if(e[t]==="<"&&!i){if(s&&rp(e,t))t+=7,[entityName,val,t]=ep(e,t+1),val.indexOf("&")===-1&&(r[op(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(s&&np(e,t))t+=8;else if(s&&sp(e,t))t+=8;else if(s&&ip(e,t))t+=9;else if(tp)i=!0;else throw new Error("Invalid DOCTYPE");n++,o=""}else if(e[t]===">"){if(i?e[t-1]==="-"&&e[t-2]==="-"&&(i=!1,n--):n--,n===0)break}else e[t]==="["?s=!0:o+=e[t];if(n!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:t}}function ep(e,t){let r="";for(;t<e.length&&e[t]!=="'"&&e[t]!=='"';t++)r+=e[t];if(r=r.trim(),r.indexOf(" ")!==-1)throw new Error("External entites are not supported");const n=e[t++];let s="";for(;t<e.length&&e[t]!==n;t++)s+=e[t];return[r,s,t]}function tp(e,t){return e[t+1]==="!"&&e[t+2]==="-"&&e[t+3]==="-"}function rp(e,t){return e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="N"&&e[t+4]==="T"&&e[t+5]==="I"&&e[t+6]==="T"&&e[t+7]==="Y"}function np(e,t){return e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="L"&&e[t+4]==="E"&&e[t+5]==="M"&&e[t+6]==="E"&&e[t+7]==="N"&&e[t+8]==="T"}function sp(e,t){return e[t+1]==="!"&&e[t+2]==="A"&&e[t+3]==="T"&&e[t+4]==="T"&&e[t+5]==="L"&&e[t+6]==="I"&&e[t+7]==="S"&&e[t+8]==="T"}function ip(e,t){return e[t+1]==="!"&&e[t+2]==="N"&&e[t+3]==="O"&&e[t+4]==="T"&&e[t+5]==="A"&&e[t+6]==="T"&&e[t+7]==="I"&&e[t+8]==="O"&&e[t+9]==="N"}function op(e){if(Jh.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}var ap=Qh;const cp=/^[-+]?0x[a-fA-F0-9]+$/,up=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt);!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const lp={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function dp(e,t={}){if(t=Object.assign({},lp,t),!e||typeof e!="string")return e;let r=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(r))return e;if(t.hex&&cp.test(r))return Number.parseInt(r,16);{const n=up.exec(r);if(n){const s=n[1],i=n[2];let o=hp(n[3]);const a=n[4]||n[6];if(!t.leadingZeros&&i.length>0&&s&&r[2]!=="."||!t.leadingZeros&&i.length>0&&!s&&r[1]!==".")return e;{const c=Number(r),u=""+c;return u.search(/[eE]/)!==-1||a?t.eNotation?c:e:r.indexOf(".")!==-1?u==="0"&&o===""||u===o||s&&u==="-"+o?c:e:i?o===u||s+o===u?c:e:r===u||r===s+u?c:e}}else return e}}function hp(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substr(0,e.length-1))),e}var pp=dp;const Ln=cr,dt=Yh,fp=ap,gp=pp;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,Ln.nameRegexp);let mp=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=yp,this.parseXml=Ap,this.parseTextData=bp,this.resolveNameSpace=wp,this.buildAttributesMap=Sp,this.isItStopNode=Cp,this.replaceEntitiesValue=xp,this.readStopNodeData=Tp,this.saveTextToParentTag=kp,this.addChild=Ep}};function yp(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const n=t[r];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:e[n]}}}function bp(e,t,r,n,s,i,o){if(e!==void 0&&(this.options.trimValues&&!n&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));const a=this.options.tagValueProcessor(t,e,r,s,i);return a==null?e:typeof a!=typeof e||a!==e?a:this.options.trimValues?on(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?on(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function wp(e){if(this.options.removeNSPrefix){const t=e.split(":"),r=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=r+t[1])}return e}const vp=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Sp(e,t,r){if(!this.options.ignoreAttributes&&typeof e=="string"){const n=Ln.getAllMatches(e,vp),s=n.length,i={};for(let o=0;o<s;o++){const a=this.resolveNameSpace(n[o][1]);let c=n[o][4],u=this.options.attributeNamePrefix+a;if(a.length)if(this.options.transformAttributeName&&(u=this.options.transformAttributeName(u)),u==="__proto__"&&(u="#__proto__"),c!==void 0){this.options.trimValues&&(c=c.trim()),c=this.replaceEntitiesValue(c);const d=this.options.attributeValueProcessor(a,c,t);d==null?i[u]=c:typeof d!=typeof c||d!==c?i[u]=d:i[u]=on(c,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[u]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){const o={};return o[this.options.attributesGroupName]=i,o}return i}}const Ap=function(e){e=e.replace(/\r\n?/g,`
  23. `);const t=new dt("!xml");let r=t,n="",s="";for(let i=0;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="/"){const o=Ge(e,">",i,"Closing Tag is not closed.");let a=e.substring(i+2,o).trim();if(this.options.removeNSPrefix){const d=a.indexOf(":");d!==-1&&(a=a.substr(d+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),r&&(n=this.saveTextToParentTag(n,r,s));const c=s.substring(s.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${a}>`);let u=0;c&&this.options.unpairedTags.indexOf(c)!==-1?(u=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):u=s.lastIndexOf("."),s=s.substring(0,u),r=this.tagsNodeStack.pop(),n="",i=o}else if(e[i+1]==="?"){let o=sn(e,i,!1,"?>");if(!o)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,r,s),!(this.options.ignoreDeclaration&&o.tagName==="?xml"||this.options.ignorePiTags)){const a=new dt(o.tagName);a.add(this.options.textNodeName,""),o.tagName!==o.tagExp&&o.attrExpPresent&&(a[":@"]=this.buildAttributesMap(o.tagExp,s,o.tagName)),this.addChild(r,a,s)}i=o.closeIndex+1}else if(e.substr(i+1,3)==="!--"){const o=Ge(e,"-->",i+4,"Comment is not closed.");if(this.options.commentPropName){const a=e.substring(i+4,o-2);n=this.saveTextToParentTag(n,r,s),r.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}i=o}else if(e.substr(i+1,2)==="!D"){const o=fp(e,i);this.docTypeEntities=o.entities,i=o.i}else if(e.substr(i+1,2)==="!["){const o=Ge(e,"]]>",i,"CDATA is not closed.")-2,a=e.substring(i+9,o);if(n=this.saveTextToParentTag(n,r,s),this.options.cdataPropName)r.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]);else{let c=this.parseTextData(a,r.tagname,s,!0,!1,!0);c==null&&(c=""),r.add(this.options.textNodeName,c)}i=o+2}else{let o=sn(e,i,this.options.removeNSPrefix),a=o.tagName,c=o.tagExp,u=o.attrExpPresent,d=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),r&&n&&r.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,r,s,!1));const p=r;if(p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(r=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==t.tagname&&(s+=s?"."+a:a),this.isItStopNode(this.options.stopNodes,s,a)){let f="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)i=o.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)i=o.closeIndex;else{const w=this.readStopNodeData(e,a,d+1);if(!w)throw new Error(`Unexpected end of ${a}`);i=w.i,f=w.tagContent}const g=new dt(a);a!==c&&u&&(g[":@"]=this.buildAttributesMap(c,s,a)),f&&(f=this.parseTextData(f,a,s,!0,u,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),g.add(this.options.textNodeName,f),this.addChild(r,g,s)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),c=a):c=c.substr(0,c.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const f=new dt(a);a!==c&&u&&(f[":@"]=this.buildAttributesMap(c,s,a)),this.addChild(r,f,s),s=s.substr(0,s.lastIndexOf("."))}else{const f=new dt(a);this.tagsNodeStack.push(r),a!==c&&u&&(f[":@"]=this.buildAttributesMap(c,s,a)),this.addChild(r,f,s),r=f}n="",i=d}}else n+=e[i];return t.child};function Ep(e,t,r){const n=this.options.updateTag(t.tagname,r,t[":@"]);n===!1||(typeof n=="string"&&(t.tagname=n),e.addChild(t))}const xp=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const r=this.docTypeEntities[t];e=e.replace(r.regx,r.val)}for(let t in this.lastEntities){const r=this.lastEntities[t];e=e.replace(r.regex,r.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const r=this.htmlEntities[t];e=e.replace(r.regex,r.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function kp(e,t,r,n){return e&&(n===void 0&&(n=Object.keys(t.child).length===0),e=this.parseTextData(e,t.tagname,r,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,n),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function Cp(e,t,r){const n="*."+r;for(const s in e){const i=e[s];if(n===i||t===i)return!0}return!1}function Rp(e,t,r=">"){let n,s="";for(let i=t;i<e.length;i++){let o=e[i];if(n)o===n&&(n="");else if(o==='"'||o==="'")n=o;else if(o===r[0])if(r[1]){if(e[i+1]===r[1])return{data:s,index:i}}else return{data:s,index:i};else o===" "&&(o=" ");s+=o}}function Ge(e,t,r,n){const s=e.indexOf(t,r);if(s===-1)throw new Error(n);return s+t.length-1}function sn(e,t,r,n=">"){const s=Rp(e,t+1,n);if(!s)return;let i=s.data;const o=s.index,a=i.search(/\s/);let c=i,u=!0;if(a!==-1&&(c=i.substr(0,a).replace(/\s\s*$/,""),i=i.substr(a+1)),r){const d=c.indexOf(":");d!==-1&&(c=c.substr(d+1),u=c!==s.data.substr(d+1))}return{tagName:c,tagExp:i,closeIndex:o,attrExpPresent:u}}function Tp(e,t,r){const n=r;let s=1;for(;r<e.length;r++)if(e[r]==="<")if(e[r+1]==="/"){const i=Ge(e,">",r,`${t} is not closed`);if(e.substring(r+2,i).trim()===t&&(s--,s===0))return{tagContent:e.substring(n,r),i};r=i}else if(e[r+1]==="?")r=Ge(e,"?>",r+1,"StopNode is not closed.");else if(e.substr(r+1,3)==="!--")r=Ge(e,"-->",r+3,"StopNode is not closed.");else if(e.substr(r+1,2)==="![")r=Ge(e,"]]>",r,"StopNode is not closed.")-2;else{const i=sn(e,r,">");i&&((i&&i.tagName)===t&&i.tagExp[i.tagExp.length-1]!=="/"&&s++,r=i.closeIndex)}}function on(e,t,r){if(t&&typeof e=="string"){const n=e.trim();return n==="true"?!0:n==="false"?!1:gp(e,r)}else return Ln.isExist(e)?e:""}var Pp=mp,Ta={};function _p(e,t){return Pa(e,t)}function Pa(e,t,r){let n;const s={};for(let i=0;i<e.length;i++){const o=e[i],a=Op(o);let c="";if(r===void 0?c=a:c=r+"."+a,a===t.textNodeName)n===void 0?n=o[a]:n+=""+o[a];else{if(a===void 0)continue;if(o[a]){let u=Pa(o[a],t,c);const d=Mp(u,t);o[":@"]?Np(u,o[":@"],c,t):Object.keys(u).length===1&&u[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?u=u[t.textNodeName]:Object.keys(u).length===0&&(t.alwaysCreateTextNode?u[t.textNodeName]="":u=""),s[a]!==void 0&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(u)):t.isArray(a,c,d)?s[a]=[u]:s[a]=u}}}return typeof n=="string"?n.length>0&&(s[t.textNodeName]=n):n!==void 0&&(s[t.textNodeName]=n),s}function Op(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const n=t[r];if(n!==":@")return n}}function Np(e,t,r,n){if(t){const s=Object.keys(t),i=s.length;for(let o=0;o<i;o++){const a=s[o];n.isArray(a,r+"."+a,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function Mp(e,t){const{textNodeName:r}=t,n=Object.keys(e).length;return!!(n===0||n===1&&(e[r]||typeof e[r]=="boolean"||e[r]===0))}Ta.prettify=_p;const{buildOptions:Ip}=Dn,Up=Pp,{prettify:$p}=Ta,Bp=$n;let Dp=class{constructor(e){this.externalEntities={},this.options=Ip(e)}parse(e,t){if(typeof e!="string")if(e.toString)e=e.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(t){t===!0&&(t={});const s=Bp.validate(e,t);if(s!==!0)throw Error(`${s.err.msg}:${s.err.line}:${s.err.col}`)}const r=new Up(this.options);r.addExternalEntities(this.externalEntities);const n=r.parseXml(e);return this.options.preserveOrder||n===void 0?n:$p(n,this.options)}addEntity(e,t){if(t.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(t==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}};var Lp=Dp;const jp=`
  24. `;function Fp(e,t){let r="";return t.format&&t.indentBy.length>0&&(r=jp),_a(e,t,"",r)}function _a(e,t,r,n){let s="",i=!1;for(let o=0;o<e.length;o++){const a=e[o],c=Hp(a);let u="";if(r.length===0?u=c:u=`${r}.${c}`,c===t.textNodeName){let w=a[c];zp(u,t)||(w=t.tagValueProcessor(c,w),w=Oa(w,t)),i&&(s+=n),s+=w,i=!1;continue}else if(c===t.cdataPropName){i&&(s+=n),s+=`<![CDATA[${a[c][0][t.textNodeName]}]]>`,i=!1;continue}else if(c===t.commentPropName){s+=n+`<!--${a[c][0][t.textNodeName]}-->`,i=!0;continue}else if(c[0]==="?"){const w=$s(a[":@"],t),b=c==="?xml"?"":n;let C=a[c][0][t.textNodeName];C=C.length!==0?" "+C:"",s+=b+`<${c}${C}${w}?>`,i=!0;continue}let d=n;d!==""&&(d+=t.indentBy);const p=$s(a[":@"],t),f=n+`<${c}${p}`,g=_a(a[c],t,u,d);t.unpairedTags.indexOf(c)!==-1?t.suppressUnpairedNode?s+=f+">":s+=f+"/>":(!g||g.length===0)&&t.suppressEmptyNode?s+=f+"/>":g&&g.endsWith(">")?s+=f+`>${g}${n}</${c}>`:(s+=f+">",g&&n!==""&&(g.includes("/>")||g.includes("</"))?s+=n+t.indentBy+g+n:s+=g,s+=`</${c}>`),i=!0}return s}function Hp(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const n=t[r];if(n!==":@")return n}}function $s(e,t){let r="";if(e&&!t.ignoreAttributes)for(let n in e){let s=t.attributeValueProcessor(n,e[n]);s=Oa(s,t),s===!0&&t.suppressBooleanAttributes?r+=` ${n.substr(t.attributeNamePrefix.length)}`:r+=` ${n.substr(t.attributeNamePrefix.length)}="${s}"`}return r}function zp(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);let r=e.substr(e.lastIndexOf(".")+1);for(let n in t.stopNodes)if(t.stopNodes[n]===e||t.stopNodes[n]==="*."+r)return!0;return!1}function Oa(e,t){if(e&&e.length>0&&t.processEntities)for(let r=0;r<t.entities.length;r++){const n=t.entities[r];e=e.replace(n.regex,n.val)}return e}var qp=Fp;const Vp=qp,Wp={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ze(e){this.options=Object.assign({},Wp,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Zp),this.processTextOrObjNode=Kp,this.options.format?(this.indentate=Gp,this.tagEndChar=`>
  25. `,this.newLine=`
  26. `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}ze.prototype.build=function(e){return this.options.preserveOrder?Vp(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)};ze.prototype.j2x=function(e,t){let r="",n="";for(let s in e)if(!(typeof e[s]>"u"))if(e[s]===null)s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(e[s]instanceof Date)n+=this.buildTextValNode(e[s],s,"",t);else if(typeof e[s]!="object"){const i=this.isAttribute(s);if(i)r+=this.buildAttrPairStr(i,""+e[s]);else if(s===this.options.textNodeName){let o=this.options.tagValueProcessor(s,""+e[s]);n+=this.replaceEntitiesValue(o)}else n+=this.buildTextValNode(e[s],s,"",t)}else if(Array.isArray(e[s])){const i=e[s].length;let o="";for(let a=0;a<i;a++){const c=e[s][a];typeof c>"u"||(c===null?s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar:typeof c=="object"?this.options.oneListGroup?o+=this.j2x(c,t+1).val:o+=this.processTextOrObjNode(c,s,t):o+=this.buildTextValNode(c,s,"",t))}this.options.oneListGroup&&(o=this.buildObjectNode(o,s,"",t)),n+=o}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const i=Object.keys(e[s]),o=i.length;for(let a=0;a<o;a++)r+=this.buildAttrPairStr(i[a],""+e[s][i[a]])}else n+=this.processTextOrObjNode(e[s],s,t);return{attrStr:r,val:n}};ze.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'};function Kp(e,t,r){const n=this.j2x(e,r+1);return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,r):this.buildObjectNode(n.val,t,n.attrStr,r)}ze.prototype.buildObjectNode=function(e,t,r,n){if(e==="")return t[0]==="?"?this.indentate(n)+"<"+t+r+"?"+this.tagEndChar:this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar;{let s="</"+t+this.tagEndChar,i="";return t[0]==="?"&&(i="?",s=""),r&&e.indexOf("<")===-1?this.indentate(n)+"<"+t+r+i+">"+e+s:this.options.commentPropName!==!1&&t===this.options.commentPropName&&i.length===0?this.indentate(n)+`<!--${e}-->`+this.newLine:this.indentate(n)+"<"+t+r+i+this.tagEndChar+e+this.indentate(n)+s}};ze.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${e}`,t};ze.prototype.buildTextValNode=function(e,t,r,n){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(n)+`<!--${e}-->`+this.newLine;if(t[0]==="?")return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(t,e);return s=this.replaceEntitiesValue(s),s===""?this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+r+">"+s+"</"+t+this.tagEndChar}};ze.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const r=this.options.entities[t];e=e.replace(r.regex,r.val)}return e};function Gp(e){return this.options.indentBy.repeat(e)}function Zp(e){return e.startsWith(this.options.attributeNamePrefix)?e.substr(this.attrPrefixLen):!1}var Xp=ze;const Yp=$n,Jp=Lp,Qp=Xp;var ef={XMLParser:Jp,XMLValidator:Yp,XMLBuilder:Qp};const Na=(e,t)=>Lh(e,t).then(r=>{if(r.length){const n=new ef.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(c,u)=>u.trim()===""&&u.includes(`
  27. `)?"":void 0});n.addEntity("#xD","\r"),n.addEntity("#10",`
  28. `);let s;try{s=n.parse(r,!0)}catch(c){throw c&&typeof c=="object"&&Object.defineProperty(c,"$responseBodyText",{value:r}),c}const i="#text",o=Object.keys(s)[0],a=s[o];return a[i]&&(a[o]=a[i],delete a[i]),Go(a)}return{}}),tf=async(e,t)=>{const r=await Na(e,t);return r.Error&&(r.Error.message=r.Error.message??r.Error.Message),r},rf=(e,t)=>{var r;if(((r=t==null?void 0:t.Error)==null?void 0:r.Code)!==void 0)return t.Error.Code;if((t==null?void 0:t.Code)!==void 0)return t.Code;if(e.statusCode==404)return"NotFound"};class jn extends ve{constructor(t){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...t}),this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,jn.prototype)}}var Bs;(function(e){e.visit=(t,r)=>t.Records!==void 0?r.Records(t.Records):t.Stats!==void 0?r.Stats(t.Stats):t.Progress!==void 0?r.Progress(t.Progress):t.Cont!==void 0?r.Cont(t.Cont):t.End!==void 0?r.End(t.End):r._(t.$unknown[0],t.$unknown[1])})(Bs||(Bs={}));const nf=e=>({...e,...e.SSEKMSKeyId&&{SSEKMSKeyId:Xe},...e.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Xe}}),sf=e=>({...e,...e.SSECustomerKey&&{SSECustomerKey:Xe},...e.SSEKMSKeyId&&{SSEKMSKeyId:Xe},...e.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Xe}}),of=async(e,t)=>{const r=Ca(e,t),n=oe({},rt,{[tg]:e[Lf]});r.bp("/"),r.p("Bucket",()=>e.Bucket,"{Bucket}",!1);const s=oe({[Qf]:[,""]});let i;return r.m("GET").h(n).q(s).b(i),r.build()},af=async(e,t)=>{const r=Ca(e,t),n=oe({},rt,{[Xf]:e[Tf]||"application/octet-stream",[eg]:e[Sf],[qf]:e[Ef],[Vf]:e[xf],[Wf]:e[kf],[Kf]:e[Cf],[Gf]:[()=>rt(e[Ds]),()=>e[Ds].toString()],[Zf]:e[Rf],[fg]:e[Af],[za]:e[Ia],[qa]:e[Ua],[Va]:e[$a],[Wa]:e[Ba],[Yf]:[()=>rt(e[Ls]),()=>Nu(e[Ls]).toString()],[sg]:e[Of],[ig]:e[Nf],[og]:e[Mf],[ag]:e[If],[Ka]:e[Da],[pg]:e[Wt],[bg]:e[zf],[Xa]:e[La],[gg]:e[jf],[Ya]:e[ja],[Ga]:e[Ha],[Za]:e[Fa],[cn]:[()=>rt(e[an]),()=>e[an].toString()],[hg]:e[Df],[mg]:e[Ff],[ug]:e[$f],[lg]:[()=>rt(e[js]),()=>rl(e[js]).toString()],[cg]:e[Uf],[ng]:e[Pf],...e.Metadata!==void 0&&Object.keys(e.Metadata).reduce((a,c)=>(a[`x-amz-meta-${c.toLowerCase()}`]=e.Metadata[c],a),{})});r.bp("/{Key+}"),r.p("Bucket",()=>e.Bucket,"{Bucket}",!1),r.p("Key",()=>e.Key,"{Key+}",!0);const s=oe({[wg]:[,"PutObject"]});let i,o;return e.Body!==void 0&&(o=e.Body,i=o),r.m("PUT").h(n).q(s).b(i),r.build()},cf=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return Ma(e,t);const r=oe({$metadata:Ce(e)}),n=zo(Cu(await Na(e.body,t)),"body");return n[Er]!=null&&(r[Er]=vf(n[Er])),r},uf=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return Ma(e,t);const r=oe({$metadata:Ce(e),[Vt]:[,e.headers[rg]],[_f]:[,e.headers[Jf]],[Ia]:[,e.headers[za]],[Ua]:[,e.headers[qa]],[$a]:[,e.headers[Va]],[Ba]:[,e.headers[Wa]],[Da]:[,e.headers[Ka]],[Hf]:[,e.headers[yg]],[La]:[,e.headers[Xa]],[ja]:[,e.headers[Ya]],[Ha]:[,e.headers[Ga]],[Fa]:[,e.headers[Za]],[an]:[()=>e.headers[cn]!==void 0,()=>bu(e.headers[cn])],[Bf]:[,e.headers[dg]]});return await Fo(e.body,t),r},Ma=async(e,t)=>{const r={...e,body:await tf(e.body,t)},n=rf(e,r.body);switch(n){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await mf(r);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await wf(r);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await df(r);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await hf(r);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await ff(r);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await pf(r);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await gf(r);case"NotFound":case"com.amazonaws.s3#NotFound":throw await yf(r);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await bf(r);default:const s=r.body;return lf({output:e,parsedBody:s,errorCode:n})}},lf=Hu(ve),df=async(e,t)=>{const r=oe({});e.body;const n=new _n({$metadata:Ce(e),...r});return Oe(n,e.body)},hf=async(e,t)=>{const r=oe({});e.body;const n=new On({$metadata:Ce(e),...r});return Oe(n,e.body)},pf=async(e,t)=>{const r=oe({}),n=e.body;n[Ar]!=null&&(r[Ar]=Nt(n[Ar])),n[Wt]!=null&&(r[Wt]=Nt(n[Wt]));const s=new Mn({$metadata:Ce(e),...r});return Oe(s,e.body)},ff=async(e,t)=>{const r=oe({});e.body;const n=new Nn({$metadata:Ce(e),...r});return Oe(n,e.body)},gf=async(e,t)=>{const r=oe({});e.body;const n=new In({$metadata:Ce(e),...r});return Oe(n,e.body)},mf=async(e,t)=>{const r=oe({});e.body;const n=new Tn({$metadata:Ce(e),...r});return Oe(n,e.body)},yf=async(e,t)=>{const r=oe({});e.body;const n=new Un({$metadata:Ce(e),...r});return Oe(n,e.body)},bf=async(e,t)=>{const r=oe({});e.body;const n=new jn({$metadata:Ce(e),...r});return Oe(n,e.body)},wf=async(e,t)=>{const r=oe({});e.body;const n=new Pn({$metadata:Ce(e),...r});return Oe(n,e.body)},vf=(e,t)=>{const r={};return e[Sr]!=null&&(r[Sr]=Nt(e[Sr])),e[xr]!=null&&(r[xr]=Nt(e[xr])),e[kr]!=null&&(r[kr]=Nt(e[kr])),e[Vt]!=null&&(r[Vt]=zo(Iu(e[Vt]))),r},Ce=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),rt=e=>e!=null&&e!==""&&(!Object.getOwnPropertyNames(e).includes("length")||e.length!=0)&&(!Object.getOwnPropertyNames(e).includes("size")||e.size!=0),Sf="ACL",Sr="AccessKeyId",Ar="AccessTier",an="BucketKeyEnabled",Er="Credentials",Af="ChecksumAlgorithm",Ef="CacheControl",Ia="ChecksumCRC32",Ua="ChecksumCRC32C",xf="ContentDisposition",kf="ContentEncoding",Cf="ContentLanguage",Ds="ContentLength",Rf="ContentMD5",$a="ChecksumSHA1",Ba="ChecksumSHA256",Tf="ContentType",Ls="Expires",Pf="ExpectedBucketOwner",_f="ETag",Vt="Expiration",Of="GrantFullControl",Nf="GrantRead",Mf="GrantReadACP",If="GrantWriteACP",Uf="ObjectLockLegalHoldStatus",$f="ObjectLockMode",js="ObjectLockRetainUntilDate",Bf="RequestCharged",Df="RequestPayer",xr="SecretAccessKey",Wt="StorageClass",Lf="SessionMode",Da="ServerSideEncryption",La="SSECustomerAlgorithm",jf="SSECustomerKey",ja="SSECustomerKeyMD5",Fa="SSEKMSEncryptionContext",Ha="SSEKMSKeyId",kr="SessionToken",Ff="Tagging",Hf="VersionId",zf="WebsiteRedirectLocation",qf="cache-control",Vf="content-disposition",Wf="content-encoding",Kf="content-language",Gf="content-length",Zf="content-md5",Xf="content-type",Yf="expires",Jf="etag",Qf="session",eg="x-amz-acl",za="x-amz-checksum-crc32",qa="x-amz-checksum-crc32c",Va="x-amz-checksum-sha1",Wa="x-amz-checksum-sha256",tg="x-amz-create-session-mode",rg="x-amz-expiration",ng="x-amz-expected-bucket-owner",sg="x-amz-grant-full-control",ig="x-amz-grant-read",og="x-amz-grant-read-acp",ag="x-amz-grant-write-acp",cg="x-amz-object-lock-legal-hold",ug="x-amz-object-lock-mode",lg="x-amz-object-lock-retain-until-date",dg="x-amz-request-charged",hg="x-amz-request-payer",pg="x-amz-storage-class",fg="x-amz-sdk-checksum-algorithm",Ka="x-amz-server-side-encryption",Ga="x-amz-server-side-encryption-aws-kms-key-id",cn="x-amz-server-side-encryption-bucket-key-enabled",Za="x-amz-server-side-encryption-context",Xa="x-amz-server-side-encryption-customer-algorithm",gg="x-amz-server-side-encryption-customer-key",Ya="x-amz-server-side-encryption-customer-key-md5",mg="x-amz-tagging",yg="x-amz-version-id",bg="x-amz-website-redirect-location",wg="x-id";class vg extends Sn.classBuilder().ep({...ka,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(t,r,n,s){return[ya(n,this.serialize,this.deserialize),wa(n,t.getEndpointParameterInstructions())]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(void 0,Bh).ser(of).de(cf).build(){}const Sg="@aws-sdk/client-s3",Ag="AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",Eg="3.596.0",xg={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"},kg="./dist-cjs/index.js",Cg="./dist-types/index.d.ts",Rg="./dist-es/index.js",Tg=!1,Pg={"@aws-crypto/sha1-browser":"3.0.0","@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sso-oidc":"3.596.0","@aws-sdk/client-sts":"3.596.0","@aws-sdk/core":"3.592.0","@aws-sdk/credential-provider-node":"3.596.0","@aws-sdk/middleware-bucket-endpoint":"3.587.0","@aws-sdk/middleware-expect-continue":"3.577.0","@aws-sdk/middleware-flexible-checksums":"3.587.0","@aws-sdk/middleware-host-header":"3.577.0","@aws-sdk/middleware-location-constraint":"3.577.0","@aws-sdk/middleware-logger":"3.577.0","@aws-sdk/middleware-recursion-detection":"3.577.0","@aws-sdk/middleware-sdk-s3":"3.587.0","@aws-sdk/middleware-signing":"3.587.0","@aws-sdk/middleware-ssec":"3.577.0","@aws-sdk/middleware-user-agent":"3.587.0","@aws-sdk/region-config-resolver":"3.587.0","@aws-sdk/signature-v4-multi-region":"3.587.0","@aws-sdk/types":"3.577.0","@aws-sdk/util-endpoints":"3.587.0","@aws-sdk/util-user-agent-browser":"3.577.0","@aws-sdk/util-user-agent-node":"3.587.0","@aws-sdk/xml-builder":"3.575.0","@smithy/config-resolver":"^3.0.1","@smithy/core":"^2.2.0","@smithy/eventstream-serde-browser":"^3.0.0","@smithy/eventstream-serde-config-resolver":"^3.0.0","@smithy/eventstream-serde-node":"^3.0.0","@smithy/fetch-http-handler":"^3.0.1","@smithy/hash-blob-browser":"^3.0.0","@smithy/hash-node":"^3.0.0","@smithy/hash-stream-node":"^3.0.0","@smithy/invalid-dependency":"^3.0.0","@smithy/md5-js":"^3.0.0","@smithy/middleware-content-length":"^3.0.0","@smithy/middleware-endpoint":"^3.0.1","@smithy/middleware-retry":"^3.0.3","@smithy/middleware-serde":"^3.0.0","@smithy/middleware-stack":"^3.0.0","@smithy/node-config-provider":"^3.1.0","@smithy/node-http-handler":"^3.0.0","@smithy/protocol-http":"^4.0.0","@smithy/smithy-client":"^3.1.1","@smithy/types":"^3.0.0","@smithy/url-parser":"^3.0.0","@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.3","@smithy/util-defaults-mode-node":"^3.0.3","@smithy/util-endpoints":"^2.0.1","@smithy/util-retry":"^3.0.0","@smithy/util-stream":"^3.0.1","@smithy/util-utf8":"^3.0.0","@smithy/util-waiter":"^3.0.0",tslib:"^2.6.2"},_g={"@aws-sdk/signature-v4-crt":"3.587.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"},Og={node:">=16.0.0"},Ng={"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},Mg=["dist-*/**"],Ig={name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},Ug="Apache-2.0",$g={"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},Bg="https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",Dg={type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-s3"},Lg={name:Sg,description:Ag,version:Eg,scripts:xg,main:kg,types:Cg,module:Rg,sideEffects:Tg,dependencies:Pg,devDependencies:_g,engines:Og,typesVersions:Ng,files:Mg,author:Ig,license:Ug,browser:$g,"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:Bg,repository:Dg};var Ja={};/*! *****************************************************************************
  29. Copyright (c) Microsoft Corporation.
  30. Permission to use, copy, modify, and/or distribute this software for any
  31. purpose with or without fee is hereby granted.
  32. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  33. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  34. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  35. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  36. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  37. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  38. PERFORMANCE OF THIS SOFTWARE.
  39. ***************************************************************************** */var un=function(e,t){return un=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)n.hasOwnProperty(s)&&(r[s]=n[s])},un(e,t)};function jg(e,t){un(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var ln=function(){return ln=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},ln.apply(this,arguments)};function Fg(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function Hg(e,t,r,n){var s=arguments.length,i=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}function zg(e,t){return function(r,n){t(r,n,e)}}function qg(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Vg(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(d){try{u(n.next(d))}catch(p){o(p)}}function c(d){try{u(n.throw(d))}catch(p){o(p)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((n=n.apply(e,t||[])).next())})}function Wg(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,s&&(i=u[0]&2?s.return:u[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,u[1])).done)return i;switch(s=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,s=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(d){u=[6,d],s=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Kg(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}function Gg(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function dn(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Qa(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),s,i=[],o;try{for(;(t===void 0||t-- >0)&&!(s=n.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return i}function Zg(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Qa(arguments[t]));return e}function Xg(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),s=0,t=0;t<r;t++)for(var i=arguments[t],o=0,a=i.length;o<a;o++,s++)n[s]=i[o];return n}function Bt(e){return this instanceof Bt?(this.v=e,this):new Bt(e)}function Yg(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),s,i=[];return s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s;function o(f){n[f]&&(s[f]=function(g){return new Promise(function(w,b){i.push([f,g,w,b])>1||a(f,g)})})}function a(f,g){try{c(n[f](g))}catch(w){p(i[0][3],w)}}function c(f){f.value instanceof Bt?Promise.resolve(f.value.v).then(u,d):p(i[0][2],f)}function u(f){a("next",f)}function d(f){a("throw",f)}function p(f,g){f(g),i.shift(),i.length&&a(i[0][0],i[0][1])}}function Jg(e){var t,r;return t={},n("next"),n("throw",function(s){throw s}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(s,i){t[s]=e[s]?function(o){return(r=!r)?{value:Bt(e[s](o)),done:s==="return"}:i?i(o):o}:i}}function Qg(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof dn=="function"?dn(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(o){return new Promise(function(a,c){o=e[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}function e0(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function t0(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function r0(e){return e&&e.__esModule?e:{default:e}}function n0(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function s0(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}const i0=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return ln},__asyncDelegator:Jg,__asyncGenerator:Yg,__asyncValues:Qg,__await:Bt,__awaiter:Vg,__classPrivateFieldGet:n0,__classPrivateFieldSet:s0,__createBinding:Kg,__decorate:Hg,__exportStar:Gg,__extends:jg,__generator:Wg,__importDefault:r0,__importStar:t0,__makeTemplateObject:e0,__metadata:qg,__param:zg,__read:Qa,__rest:Fg,__spread:Zg,__spreadArrays:Xg,__values:dn},Symbol.toStringTag,{value:"Module"})),Re=gn(i0);var ht={},pt={},ft={},Fs;function ec(){if(Fs)return ft;Fs=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.isEmptyData=void 0;function e(t){return typeof t=="string"?t.length===0:t.byteLength===0}return ft.isEmptyData=e,ft}var Hs={},zs;function tc(){return zs||(zs=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EMPTY_DATA_SHA_1=e.SHA_1_HMAC_ALGO=e.SHA_1_HASH=void 0,e.SHA_1_HASH={name:"SHA-1"},e.SHA_1_HMAC_ALGO={name:"HMAC",hash:e.SHA_1_HASH},e.EMPTY_DATA_SHA_1=new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9])}(Hs)),Hs}const o0=e=>{const t=[];for(let r=0,n=e.length;r<n;r++){const s=e.charCodeAt(r);if(s<128)t.push(s);else if(s<2048)t.push(s>>6|192,s&63|128);else if(r+1<e.length&&(s&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320){const i=65536+((s&1023)<<10)+(e.charCodeAt(++r)&1023);t.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else t.push(s>>12|224,s>>6&63|128,s&63|128)}return Uint8Array.from(t)},a0=e=>{let t="";for(let r=0,n=e.length;r<n;r++){const s=e[r];if(s<128)t+=String.fromCharCode(s);else if(192<=s&&s<224){const i=e[++r];t+=String.fromCharCode((s&31)<<6|i&63)}else if(240<=s&&s<365){const i="%"+[s,e[++r],e[++r],e[++r]].map(o=>o.toString(16)).join("%");t+=decodeURIComponent(i)}else t+=String.fromCharCode((s&15)<<12|(e[++r]&63)<<6|e[++r]&63)}return t};function c0(e){return new TextEncoder().encode(e)}function u0(e){return new TextDecoder("utf-8").decode(e)}const l0=e=>typeof TextEncoder=="function"?c0(e):o0(e),d0=e=>typeof TextDecoder=="function"?u0(e):a0(e),h0=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:l0,toUtf8:d0},Symbol.toStringTag,{value:"Module"})),ur=gn(h0),p0={};function f0(){return typeof window<"u"?window:typeof self<"u"?self:p0}const g0=Object.freeze(Object.defineProperty({__proto__:null,locateWindow:f0},Symbol.toStringTag,{value:"Module"})),ct=gn(g0);var qs;function rc(){if(qs)return pt;qs=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.Sha1=void 0;var e=ec(),t=tc(),r=ur,n=ct,s=function(){function a(c){this.secret=c,this.reset()}return a.prototype.update=function(c){var u=this;(0,e.isEmptyData)(c)||(this.operation=this.operation.then(function(d){return d.onerror=function(){u.operation=Promise.reject(new Error("Error encountered updating hash"))},d.process(o(c)),d}),this.operation.catch(function(){}))},a.prototype.digest=function(){return this.operation.then(function(c){return new Promise(function(u,d){c.onerror=function(){d(new Error("Error encountered finalizing hash"))},c.oncomplete=function(){c.result&&u(new Uint8Array(c.result)),d(new Error("Error encountered finalizing hash"))},c.finish()})})},a.prototype.reset=function(){this.secret?(this.operation=i(this.secret).then(function(c){return(0,n.locateWindow)().msCrypto.subtle.sign(t.SHA_1_HMAC_ALGO,c)}),this.operation.catch(function(){})):this.operation=Promise.resolve((0,n.locateWindow)().msCrypto.subtle.digest("SHA-1"))},a}();pt.Sha1=s;function i(a){return new Promise(function(c,u){var d=(0,n.locateWindow)().msCrypto.subtle.importKey("raw",o(a),t.SHA_1_HMAC_ALGO,!1,["sign"]);d.oncomplete=function(){d.result&&c(d.result),u(new Error("ImportKey completed without importing key."))},d.onerror=function(){u(new Error("ImportKey failed to import key."))}})}function o(a){return typeof a=="string"?(0,r.fromUtf8)(a):ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(a)}return pt}var gt={},Vs;function nc(){if(Vs)return gt;Vs=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.Sha1=void 0;var e=ur,t=ec(),r=tc(),n=ct,s=function(){function o(a){this.toHash=new Uint8Array(0),a!==void 0&&(this.key=new Promise(function(c,u){(0,n.locateWindow)().crypto.subtle.importKey("raw",i(a),r.SHA_1_HMAC_ALGO,!1,["sign"]).then(c,u)}),this.key.catch(function(){}))}return o.prototype.update=function(a){if(!(0,t.isEmptyData)(a)){var c=i(a),u=new Uint8Array(this.toHash.byteLength+c.byteLength);u.set(this.toHash,0),u.set(c,this.toHash.byteLength),this.toHash=u}},o.prototype.digest=function(){var a=this;return this.key?this.key.then(function(c){return(0,n.locateWindow)().crypto.subtle.sign(r.SHA_1_HMAC_ALGO,c,a.toHash).then(function(u){return new Uint8Array(u)})}):(0,t.isEmptyData)(this.toHash)?Promise.resolve(r.EMPTY_DATA_SHA_1):Promise.resolve().then(function(){return(0,n.locateWindow)().crypto.subtle.digest(r.SHA_1_HASH,a.toHash)}).then(function(c){return Promise.resolve(new Uint8Array(c))})},o.prototype.reset=function(){this.toHash=new Uint8Array(0)},o}();gt.Sha1=s;function i(o){return typeof o=="string"?(0,e.fromUtf8)(o):ArrayBuffer.isView(o)?new Uint8Array(o.buffer,o.byteOffset,o.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(o)}return gt}var Ws={},Ae={},Ks;function m0(){if(Ks)return Ae;Ks=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.supportsZeroByteGCM=Ae.supportsSubtleCrypto=Ae.supportsSecureRandom=Ae.supportsWebCrypto=void 0;var e=Re,t=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function r(o){if(n(o)&&typeof o.crypto.subtle=="object"){var a=o.crypto.subtle;return s(a)}return!1}Ae.supportsWebCrypto=r;function n(o){if(typeof o=="object"&&typeof o.crypto=="object"){var a=o.crypto.getRandomValues;return typeof a=="function"}return!1}Ae.supportsSecureRandom=n;function s(o){return o&&t.every(function(a){return typeof o[a]=="function"})}Ae.supportsSubtleCrypto=s;function i(o){return e.__awaiter(this,void 0,void 0,function(){var a,c;return e.__generator(this,function(u){switch(u.label){case 0:if(!s(o))return[2,!1];u.label=1;case 1:return u.trys.push([1,4,,5]),[4,o.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return a=u.sent(),[4,o.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},a,new Uint8Array(0))];case 3:return c=u.sent(),[2,c.byteLength===16];case 4:return u.sent(),[2,!1];case 5:return[2]}})})}return Ae.supportsZeroByteGCM=i,Ae}var Gs;function sc(){return Gs||(Gs=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Re;t.__exportStar(m0(),e)}(Ws)),Ws}var Zs={},Xs={},Ys;function y0(){return Ys||(Ys=1,Object.defineProperty(Xs,"__esModule",{value:!0})),Xs}var Js={},Qs;function b0(){return Qs||(Qs=1,Object.defineProperty(Js,"__esModule",{value:!0})),Js}var ei={},ti;function w0(){return ti||(ti=1,Object.defineProperty(ei,"__esModule",{value:!0})),ei}var ri={},ni;function v0(){return ni||(ni=1,Object.defineProperty(ri,"__esModule",{value:!0})),ri}var mt={},si;function S0(){if(si)return mt;si=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.isMsWindow=void 0;var e=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function t(n){return"MSInputMethodContext"in n&&"msCrypto"in n}function r(n){if(t(n)&&n.msCrypto.subtle!==void 0){var s=n.msCrypto,i=s.getRandomValues,o=s.subtle;return e.map(function(a){return o[a]}).concat(i).every(function(a){return typeof a=="function"})}return!1}return mt.isMsWindow=r,mt}var ii;function ic(){return ii||(ii=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Re;t.__exportStar(y0(),e),t.__exportStar(b0(),e),t.__exportStar(w0(),e),t.__exportStar(v0(),e),t.__exportStar(S0(),e)}(Zs)),Zs}var oi={},yt={},ai;function A0(){if(ai)return yt;ai=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.convertToBuffer=void 0;var e=ur,t=typeof Buffer<"u"&&Buffer.from?function(n){return Buffer.from(n,"utf8")}:e.fromUtf8;function r(n){return n instanceof Uint8Array?n:typeof n=="string"?t(n):ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(n)}return yt.convertToBuffer=r,yt}var bt={},ci;function E0(){if(ci)return bt;ci=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.isEmptyData=void 0;function e(t){return typeof t=="string"?t.length===0:t.byteLength===0}return bt.isEmptyData=e,bt}var wt={},ui;function x0(){if(ui)return wt;ui=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.numToUint8=void 0;function e(t){return new Uint8Array([(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255])}return wt.numToUint8=e,wt}var vt={},li;function k0(){if(li)return vt;li=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.uint32ArrayFrom=void 0;function e(t){if(!Uint32Array.from){for(var r=new Uint32Array(t.length),n=0;n<t.length;)r[n]=t[n],n+=1;return r}return Uint32Array.from(t)}return vt.uint32ArrayFrom=e,vt}var di;function qe(){return di||(di=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uint32ArrayFrom=e.numToUint8=e.isEmptyData=e.convertToBuffer=void 0;var t=A0();Object.defineProperty(e,"convertToBuffer",{enumerable:!0,get:function(){return t.convertToBuffer}});var r=E0();Object.defineProperty(e,"isEmptyData",{enumerable:!0,get:function(){return r.isEmptyData}});var n=x0();Object.defineProperty(e,"numToUint8",{enumerable:!0,get:function(){return n.numToUint8}});var s=k0();Object.defineProperty(e,"uint32ArrayFrom",{enumerable:!0,get:function(){return s.uint32ArrayFrom}})}(oi)),oi}var hi;function C0(){if(hi)return ht;hi=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.Sha1=void 0;var e=rc(),t=nc(),r=sc(),n=ic(),s=ct,i=qe(),o=function(){function a(c){if((0,r.supportsWebCrypto)((0,s.locateWindow)()))this.hash=new t.Sha1(c);else if((0,n.isMsWindow)((0,s.locateWindow)()))this.hash=new e.Sha1(c);else throw new Error("SHA1 not supported")}return a.prototype.update=function(c,u){this.hash.update((0,i.convertToBuffer)(c))},a.prototype.digest=function(){return this.hash.digest()},a.prototype.reset=function(){this.hash.reset()},a}();return ht.Sha1=o,ht}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WebCryptoSha1=e.Ie11Sha1=void 0;var t=Re;t.__exportStar(C0(),e);var r=rc();Object.defineProperty(e,"Ie11Sha1",{enumerable:!0,get:function(){return r.Sha1}});var n=nc();Object.defineProperty(e,"WebCryptoSha1",{enumerable:!0,get:function(){return n.Sha1}})})(Ja);var oc={},St={},At={},Et={},pi;function R0(){if(pi)return Et;pi=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.isEmptyData=void 0;function e(t){return typeof t=="string"?t.length===0:t.byteLength===0}return Et.isEmptyData=e,Et}var fi={},gi;function ac(){return gi||(gi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EMPTY_DATA_SHA_256=e.SHA_256_HMAC_ALGO=e.SHA_256_HASH=void 0,e.SHA_256_HASH={name:"SHA-256"},e.SHA_256_HMAC_ALGO={name:"HMAC",hash:e.SHA_256_HASH},e.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])}(fi)),fi}var mi;function cc(){if(mi)return At;mi=1,Object.defineProperty(At,"__esModule",{value:!0}),At.Sha256=void 0;var e=R0(),t=ac(),r=ur,n=ct,s=function(){function a(c){this.secret=c,this.reset()}return a.prototype.update=function(c){var u=this;(0,e.isEmptyData)(c)||(this.operation=this.operation.then(function(d){return d.onerror=function(){u.operation=Promise.reject(new Error("Error encountered updating hash"))},d.process(o(c)),d}),this.operation.catch(function(){}))},a.prototype.digest=function(){return this.operation.then(function(c){return new Promise(function(u,d){c.onerror=function(){d(new Error("Error encountered finalizing hash"))},c.oncomplete=function(){c.result&&u(new Uint8Array(c.result)),d(new Error("Error encountered finalizing hash"))},c.finish()})})},a.prototype.reset=function(){this.secret?(this.operation=i(this.secret).then(function(c){return(0,n.locateWindow)().msCrypto.subtle.sign(t.SHA_256_HMAC_ALGO,c)}),this.operation.catch(function(){})):this.operation=Promise.resolve((0,n.locateWindow)().msCrypto.subtle.digest("SHA-256"))},a}();At.Sha256=s;function i(a){return new Promise(function(c,u){var d=(0,n.locateWindow)().msCrypto.subtle.importKey("raw",o(a),t.SHA_256_HMAC_ALGO,!1,["sign"]);d.oncomplete=function(){d.result&&c(d.result),u(new Error("ImportKey completed without importing key."))},d.onerror=function(){u(new Error("ImportKey failed to import key."))}})}function o(a){return typeof a=="string"?(0,r.fromUtf8)(a):ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(a)}return At}var xt={},yi;function uc(){if(yi)return xt;yi=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.Sha256=void 0;var e=qe(),t=ac(),r=ct,n=function(){function s(i){this.toHash=new Uint8Array(0),this.secret=i,this.reset()}return s.prototype.update=function(i){if(!(0,e.isEmptyData)(i)){var o=(0,e.convertToBuffer)(i),a=new Uint8Array(this.toHash.byteLength+o.byteLength);a.set(this.toHash,0),a.set(o,this.toHash.byteLength),this.toHash=a}},s.prototype.digest=function(){var i=this;return this.key?this.key.then(function(o){return(0,r.locateWindow)().crypto.subtle.sign(t.SHA_256_HMAC_ALGO,o,i.toHash).then(function(a){return new Uint8Array(a)})}):(0,e.isEmptyData)(this.toHash)?Promise.resolve(t.EMPTY_DATA_SHA_256):Promise.resolve().then(function(){return(0,r.locateWindow)().crypto.subtle.digest(t.SHA_256_HASH,i.toHash)}).then(function(o){return Promise.resolve(new Uint8Array(o))})},s.prototype.reset=function(){var i=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(o,a){(0,r.locateWindow)().crypto.subtle.importKey("raw",(0,e.convertToBuffer)(i.secret),t.SHA_256_HMAC_ALGO,!1,["sign"]).then(o,a)}),this.key.catch(function(){}))},s}();return xt.Sha256=n,xt}var bi={},kt={},be={},wi;function lc(){return wi||(wi=1,Object.defineProperty(be,"__esModule",{value:!0}),be.MAX_HASHABLE_LENGTH=be.INIT=be.KEY=be.DIGEST_LENGTH=be.BLOCK_SIZE=void 0,be.BLOCK_SIZE=64,be.DIGEST_LENGTH=32,be.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),be.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],be.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),be}var Ct={},vi;function T0(){if(vi)return Ct;vi=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.RawSha256=void 0;var e=lc(),t=function(){function r(){this.state=Int32Array.from(e.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return r.prototype.update=function(n){if(this.finished)throw new Error("Attempted to update an already finished hash.");var s=0,i=n.byteLength;if(this.bytesHashed+=i,this.bytesHashed*8>e.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;i>0;)this.buffer[this.bufferLength++]=n[s++],i--,this.bufferLength===e.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},r.prototype.digest=function(){if(!this.finished){var n=this.bytesHashed*8,s=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),i=this.bufferLength;if(s.setUint8(this.bufferLength++,128),i%e.BLOCK_SIZE>=e.BLOCK_SIZE-8){for(var o=this.bufferLength;o<e.BLOCK_SIZE;o++)s.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(var o=this.bufferLength;o<e.BLOCK_SIZE-8;o++)s.setUint8(o,0);s.setUint32(e.BLOCK_SIZE-8,Math.floor(n/4294967296),!0),s.setUint32(e.BLOCK_SIZE-4,n),this.hashBuffer(),this.finished=!0}for(var a=new Uint8Array(e.DIGEST_LENGTH),o=0;o<8;o++)a[o*4]=this.state[o]>>>24&255,a[o*4+1]=this.state[o]>>>16&255,a[o*4+2]=this.state[o]>>>8&255,a[o*4+3]=this.state[o]>>>0&255;return a},r.prototype.hashBuffer=function(){for(var n=this,s=n.buffer,i=n.state,o=i[0],a=i[1],c=i[2],u=i[3],d=i[4],p=i[5],f=i[6],g=i[7],w=0;w<e.BLOCK_SIZE;w++){if(w<16)this.temp[w]=(s[w*4]&255)<<24|(s[w*4+1]&255)<<16|(s[w*4+2]&255)<<8|s[w*4+3]&255;else{var b=this.temp[w-2],C=(b>>>17|b<<15)^(b>>>19|b<<13)^b>>>10;b=this.temp[w-15];var I=(b>>>7|b<<25)^(b>>>18|b<<14)^b>>>3;this.temp[w]=(C+this.temp[w-7]|0)+(I+this.temp[w-16]|0)}var U=(((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&p^~d&f)|0)+(g+(e.KEY[w]+this.temp[w]|0)|0)|0,Z=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+(o&a^o&c^a&c)|0;g=f,f=p,p=d,d=u+U|0,u=c,c=a,a=o,o=U+Z|0}i[0]+=o,i[1]+=a,i[2]+=c,i[3]+=u,i[4]+=d,i[5]+=p,i[6]+=f,i[7]+=g},r}();return Ct.RawSha256=t,Ct}var Si;function P0(){if(Si)return kt;Si=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.Sha256=void 0;var e=Re,t=lc(),r=T0(),n=qe(),s=function(){function o(a){this.secret=a,this.hash=new r.RawSha256,this.reset()}return o.prototype.update=function(a){if(!((0,n.isEmptyData)(a)||this.error))try{this.hash.update((0,n.convertToBuffer)(a))}catch(c){this.error=c}},o.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},o.prototype.digest=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.digestSync()]})})},o.prototype.reset=function(){if(this.hash=new r.RawSha256,this.secret){this.outer=new r.RawSha256;var a=i(this.secret),c=new Uint8Array(t.BLOCK_SIZE);c.set(a);for(var u=0;u<t.BLOCK_SIZE;u++)a[u]^=54,c[u]^=92;this.hash.update(a),this.outer.update(c);for(var u=0;u<a.byteLength;u++)a[u]=0}},o}();kt.Sha256=s;function i(o){var a=(0,n.convertToBuffer)(o);if(a.byteLength>t.BLOCK_SIZE){var c=new r.RawSha256;c.update(a),a=c.digest()}var u=new Uint8Array(t.BLOCK_SIZE);return u.set(a),u}return kt}var Ai;function _0(){return Ai||(Ai=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Re;t.__exportStar(P0(),e)}(bi)),bi}var Ei;function O0(){if(Ei)return St;Ei=1,Object.defineProperty(St,"__esModule",{value:!0}),St.Sha256=void 0;var e=cc(),t=uc(),r=_0(),n=sc(),s=ic(),i=ct,o=qe(),a=function(){function c(u){(0,n.supportsWebCrypto)((0,i.locateWindow)())?this.hash=new t.Sha256(u):(0,s.isMsWindow)((0,i.locateWindow)())?this.hash=new e.Sha256(u):this.hash=new r.Sha256(u)}return c.prototype.update=function(u,d){this.hash.update((0,o.convertToBuffer)(u))},c.prototype.digest=function(){return this.hash.digest()},c.prototype.reset=function(){this.hash.reset()},c}();return St.Sha256=a,St}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WebCryptoSha256=e.Ie11Sha256=void 0;var t=Re;t.__exportStar(O0(),e);var r=cc();Object.defineProperty(e,"Ie11Sha256",{enumerable:!0,get:function(){return r.Sha256}});var n=uc();Object.defineProperty(e,"WebCryptoSha256",{enumerable:!0,get:function(){return n.Sha256}})})(oc);const N0={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},dc={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},H={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},ce={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},De={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class v{static getFirstMatch(t,r){const n=r.match(t);return n&&n.length>0&&n[1]||""}static getSecondMatch(t,r){const n=r.match(t);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(t,r,n){if(t.test(r))return n}static getWindowsVersionName(t){switch(t){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(t){const r=t.split(".").splice(0,2).map(n=>parseInt(n,10)||0);if(r.push(0),r[0]===10)switch(r[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(t){const r=t.split(".").splice(0,2).map(n=>parseInt(n,10)||0);if(r.push(0),!(r[0]===1&&r[1]<5)){if(r[0]===1&&r[1]<6)return"Cupcake";if(r[0]===1&&r[1]>=6)return"Donut";if(r[0]===2&&r[1]<2)return"Eclair";if(r[0]===2&&r[1]===2)return"Froyo";if(r[0]===2&&r[1]>2)return"Gingerbread";if(r[0]===3)return"Honeycomb";if(r[0]===4&&r[1]<1)return"Ice Cream Sandwich";if(r[0]===4&&r[1]<4)return"Jelly Bean";if(r[0]===4&&r[1]>=4)return"KitKat";if(r[0]===5)return"Lollipop";if(r[0]===6)return"Marshmallow";if(r[0]===7)return"Nougat";if(r[0]===8)return"Oreo";if(r[0]===9)return"Pie"}}static getVersionPrecision(t){return t.split(".").length}static compareVersions(t,r,n=!1){const s=v.getVersionPrecision(t),i=v.getVersionPrecision(r);let o=Math.max(s,i),a=0;const c=v.map([t,r],u=>{const d=o-v.getVersionPrecision(u),p=u+new Array(d+1).join(".0");return v.map(p.split("."),f=>new Array(20-f.length).join("0")+f).reverse()});for(n&&(a=o-Math.min(s,i)),o-=1;o>=a;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===a)return 0;o-=1}else if(c[0][o]<c[1][o])return-1}}static map(t,r){const n=[];let s;if(Array.prototype.map)return Array.prototype.map.call(t,r);for(s=0;s<t.length;s+=1)n.push(r(t[s]));return n}static find(t,r){let n,s;if(Array.prototype.find)return Array.prototype.find.call(t,r);for(n=0,s=t.length;n<s;n+=1){const i=t[n];if(r(i,n))return i}}static assign(t,...r){const n=t;let s,i;if(Object.assign)return Object.assign(t,...r);for(s=0,i=r.length;s<i;s+=1){const o=r[s];typeof o=="object"&&o!==null&&Object.keys(o).forEach(a=>{n[a]=o[a]})}return t}static getBrowserAlias(t){return N0[t]}static getBrowserTypeByAlias(t){return dc[t]||""}}const $=/version\/(\d+(\.?_?\d+)+)/i,M0=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},r=v.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},r=v.getFirstMatch($,e)||v.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},r=v.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},r=v.getFirstMatch($,e)||v.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},r=v.getFirstMatch($,e)||v.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},r=v.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},r=v.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},r=v.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},r=v.getFirstMatch($,e)||v.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},r=v.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},r=v.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},r=v.getFirstMatch($,e)||v.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},r=v.getFirstMatch($,e)||v.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},r=v.getFirstMatch($,e)||v.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},r=v.getFirstMatch($,e)||v.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},r=v.getFirstMatch($,e)||v.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},r=v.getFirstMatch($,e)||v.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},r=v.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=v.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},r=v.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},r=v.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},r=v.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},r=v.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},r=v.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},r=v.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},r=v.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},r=v.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},r=v.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},r=v.getFirstMatch($,e)||v.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},r=v.getFirstMatch($,e)||v.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},r=v.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},r=v.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},r=v.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},r=v.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},r=v.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},r=v.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},r=v.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},r=v.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},r=v.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){const t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe(e){const t={name:"Android Browser"},r=v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},r=v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},r=v.getFirstMatch($,e);return r&&(t.version=r),t}},{test:[/.*/i],describe(e){const t=/^(.*)\/(.*) /,r=/^(.*)\/(.*)[ \t]\((.*)/,n=e.search("\\(")!==-1?r:t;return{name:v.getFirstMatch(n,e),version:v.getSecondMatch(n,e)}}}],I0=[{test:[/Roku\/DVP/],describe(e){const t=v.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:ce.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=v.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:ce.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=v.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=v.getWindowsVersionName(t);return{name:ce.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:ce.iOS},r=v.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe(e){const t=v.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=v.getMacOSVersionName(t),n={name:ce.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=v.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:ce.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe(e){const t=v.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=v.getAndroidVersionName(t),n={name:ce.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=v.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:ce.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=v.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||v.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||v.getFirstMatch(/\bbb(\d+)/i,e);return{name:ce.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=v.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:ce.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=v.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:ce.Tizen,version:t}}},{test:[/linux/i],describe(){return{name:ce.Linux}}},{test:[/CrOS/],describe(){return{name:ce.ChromeOS}}},{test:[/PlayStation 4/],describe(e){const t=v.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:ce.PlayStation4,version:t}}}],U0=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(e){const t=v.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:H.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:H.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:H.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:H.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:H.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:H.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:H.tablet}}},{test(e){const t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe(e){const t=v.getFirstMatch(/(ipod|iphone)/i,e);return{type:H.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:H.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:H.mobile}}},{test(e){return e.getBrowserName(!0)==="blackberry"},describe(){return{type:H.mobile,vendor:"BlackBerry"}}},{test(e){return e.getBrowserName(!0)==="bada"},describe(){return{type:H.mobile}}},{test(e){return e.getBrowserName()==="windows phone"},describe(){return{type:H.mobile,vendor:"Microsoft"}}},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return e.getOSName(!0)==="android"&&t>=3},describe(){return{type:H.tablet}}},{test(e){return e.getOSName(!0)==="android"},describe(){return{type:H.mobile}}},{test(e){return e.getOSName(!0)==="macos"},describe(){return{type:H.desktop,vendor:"Apple"}}},{test(e){return e.getOSName(!0)==="windows"},describe(){return{type:H.desktop}}},{test(e){return e.getOSName(!0)==="linux"},describe(){return{type:H.desktop}}},{test(e){return e.getOSName(!0)==="playstation 4"},describe(){return{type:H.tv}}},{test(e){return e.getOSName(!0)==="roku"},describe(){return{type:H.tv}}}],$0=[{test(e){return e.getBrowserName(!0)==="microsoft edge"},describe(e){if(/\sedg\//i.test(e))return{name:De.Blink};const t=v.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:De.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:De.Trident},r=v.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){return e.test(/presto/i)},describe(e){const t={name:De.Presto},r=v.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){const t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe(e){const t={name:De.Gecko},r=v.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:De.Blink}}},{test:[/(apple)?webkit/i],describe(e){const t={name:De.WebKit},r=v.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];class xi{constructor(t,r=!1){if(t==null||t==="")throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},r!==!0&&this.parse()}getUA(){return this._ua}test(t){return t.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const t=v.find(M0,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(t){return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const t=v.find(I0,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os}getOSName(t){const{name:r}=this.getOS();return t?String(r).toLowerCase()||"":r||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(t=!1){const{type:r}=this.getPlatform();return t?String(r).toLowerCase()||"":r||""}parsePlatform(){this.parsedResult.platform={};const t=v.find(U0,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const t=v.find($0,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return v.assign({},this.parsedResult)}satisfies(t){const r={};let n=0;const s={};let i=0;if(Object.keys(t).forEach(o=>{const a=t[o];typeof a=="string"?(s[o]=a,i+=1):typeof a=="object"&&(r[o]=a,n+=1)}),n>0){const o=Object.keys(r),a=v.find(o,u=>this.isOS(u));if(a){const u=this.satisfies(r[a]);if(u!==void 0)return u}const c=v.find(o,u=>this.isPlatform(u));if(c){const u=this.satisfies(r[c]);if(u!==void 0)return u}}if(i>0){const o=Object.keys(s),a=v.find(o,c=>this.isBrowser(c,!0));if(a!==void 0)return this.compareVersion(s[a])}}isBrowser(t,r=!1){const n=this.getBrowserName().toLowerCase();let s=t.toLowerCase();const i=v.getBrowserTypeByAlias(s);return r&&i&&(s=i.toLowerCase()),s===n}compareVersion(t){let r=[0],n=t,s=!1;const i=this.getBrowserVersion();if(typeof i=="string")return t[0]===">"||t[0]==="<"?(n=t.substr(1),t[1]==="="?(s=!0,n=t.substr(2)):r=[],t[0]===">"?r.push(1):r.push(-1)):t[0]==="="?n=t.substr(1):t[0]==="~"&&(s=!0,n=t.substr(1)),r.indexOf(v.compareVersions(i,n,s))>-1}isOS(t){return this.getOSName(!0)===String(t).toLowerCase()}isPlatform(t){return this.getPlatformType(!0)===String(t).toLowerCase()}isEngine(t){return this.getEngineName(!0)===String(t).toLowerCase()}is(t,r=!1){return this.isBrowser(t,r)||this.isOS(t)||this.isPlatform(t)}some(t=[]){return t.some(r=>this.is(r))}}/*!
  40. * Bowser - a browser detector
  41. * https://github.com/lancedikson/bowser
  42. * MIT License | (c) Dustin Diaz 2012-2015
  43. * MIT License | (c) Denis Demchenko 2015-2019
  44. */class hc{static getParser(t,r=!1){if(typeof t!="string")throw new Error("UserAgent should be a string");return new xi(t,r)}static parse(t){return new xi(t).getResult()}static get BROWSER_MAP(){return dc}static get ENGINE_MAP(){return De}static get OS_MAP(){return ce}static get PLATFORMS_MAP(){return H}}const B0=({serviceId:e,clientVersion:t})=>async()=>{var r,n,s,i,o;const a=typeof window<"u"&&(r=window==null?void 0:window.navigator)!=null&&r.userAgent?hc.parse(window.navigator.userAgent):void 0,c=[["aws-sdk-js",t],["ua","2.0"],[`os/${((n=a==null?void 0:a.os)==null?void 0:n.name)||"other"}`,(s=a==null?void 0:a.os)==null?void 0:s.version],["lang/js"],["md/browser",`${((i=a==null?void 0:a.browser)==null?void 0:i.name)??"unknown"}_${((o=a==null?void 0:a.browser)==null?void 0:o.version)??"unknown"}`]];return e&&c.push([`api/${e}`,t]),c};var ki={},Rt={},Ci;function D0(){if(Ci)return Rt;Ci=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.AwsCrc32=void 0;var e=Re,t=qe(),r=pc(),n=function(){function s(){this.crc32=new r.Crc32}return s.prototype.update=function(i){(0,t.isEmptyData)(i)||this.crc32.update((0,t.convertToBuffer)(i))},s.prototype.digest=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,(0,t.numToUint8)(this.crc32.digest())]})})},s.prototype.reset=function(){this.crc32=new r.Crc32},s}();return Rt.AwsCrc32=n,Rt}var Ri;function pc(){return Ri||(Ri=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AwsCrc32=e.Crc32=e.crc32=void 0;var t=Re,r=qe();function n(c){return new s().update(c).digest()}e.crc32=n;var s=function(){function c(){this.checksum=4294967295}return c.prototype.update=function(u){var d,p;try{for(var f=t.__values(u),g=f.next();!g.done;g=f.next()){var w=g.value;this.checksum=this.checksum>>>8^o[(this.checksum^w)&255]}}catch(b){d={error:b}}finally{try{g&&!g.done&&(p=f.return)&&p.call(f)}finally{if(d)throw d.error}}return this},c.prototype.digest=function(){return(this.checksum^4294967295)>>>0},c}();e.Crc32=s;var i=[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,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],o=(0,r.uint32ArrayFrom)(i),a=D0();Object.defineProperty(e,"AwsCrc32",{enumerable:!0,get:function(){return a.AwsCrc32}})}(ki)),ki}var Fn=pc();class It{constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(t));n>-1&&s>0;n--,s/=256)r[n]=s;return t<0&&Ti(r),new It(r)}valueOf(){const t=this.bytes.slice(0),r=t[0]&128;return r&&Ti(t),parseInt(he(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function Ti(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}class L0{constructor(t,r){this.toUtf8=t,this.fromUtf8=r}format(t){const r=[];for(const i of Object.keys(t)){const o=this.fromUtf8(i);r.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(t[i]))}const n=new Uint8Array(r.reduce((i,o)=>i+o.byteLength,0));let s=0;for(const i of r)n.set(i,s),s+=i.byteLength;return n}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,t.value,!1),new Uint8Array(r.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,t.value,!1),new Uint8Array(n.buffer);case"long":const s=new Uint8Array(9);return s[0]=5,s.set(t.value.bytes,1),s;case"binary":const i=new DataView(new ArrayBuffer(3+t.value.byteLength));i.setUint8(0,6),i.setUint16(1,t.value.byteLength,!1);const o=new Uint8Array(i.buffer);return o.set(t.value,3),o;case"string":const a=this.fromUtf8(t.value),c=new DataView(new ArrayBuffer(3+a.byteLength));c.setUint8(0,7),c.setUint16(1,a.byteLength,!1);const u=new Uint8Array(c.buffer);return u.set(a,3),u;case"timestamp":const d=new Uint8Array(9);return d[0]=8,d.set(It.fromNumber(t.value.valueOf()).bytes,1),d;case"uuid":if(!G0.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const p=new Uint8Array(17);return p[0]=9,p.set(jo(t.value.replace(/\-/g,"")),1),p}}parse(t){const r={};let n=0;for(;n<t.byteLength;){const s=t.getUint8(n++),i=this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+n,s));switch(n+=s,t.getUint8(n++)){case 0:r[i]={type:_i,value:!0};break;case 1:r[i]={type:_i,value:!1};break;case 2:r[i]={type:j0,value:t.getInt8(n++)};break;case 3:r[i]={type:F0,value:t.getInt16(n,!1)},n+=2;break;case 4:r[i]={type:H0,value:t.getInt32(n,!1)},n+=4;break;case 5:r[i]={type:z0,value:new It(new Uint8Array(t.buffer,t.byteOffset+n,8))},n+=8;break;case 6:const o=t.getUint16(n,!1);n+=2,r[i]={type:q0,value:new Uint8Array(t.buffer,t.byteOffset+n,o)},n+=o;break;case 7:const a=t.getUint16(n,!1);n+=2,r[i]={type:V0,value:this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+n,a))},n+=a;break;case 8:r[i]={type:W0,value:new Date(new It(new Uint8Array(t.buffer,t.byteOffset+n,8)).valueOf())},n+=8;break;case 9:const c=new Uint8Array(t.buffer,t.byteOffset+n,16);n+=16,r[i]={type:K0,value:`${he(c.subarray(0,4))}-${he(c.subarray(4,6))}-${he(c.subarray(6,8))}-${he(c.subarray(8,10))}-${he(c.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return r}}var Pi;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(Pi||(Pi={}));const _i="boolean",j0="byte",F0="short",H0="integer",z0="long",q0="binary",V0="string",W0="timestamp",K0="uuid",G0=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,fc=4,Le=fc*2,Ke=4,Z0=Le+Ke*2;function X0({byteLength:e,byteOffset:t,buffer:r}){if(e<Z0)throw new Error("Provided message too short to accommodate event stream message overhead");const n=new DataView(r,t,e),s=n.getUint32(0,!1);if(e!==s)throw new Error("Reported message length does not match received message length");const i=n.getUint32(fc,!1),o=n.getUint32(Le,!1),a=n.getUint32(e-Ke,!1),c=new Fn.Crc32().update(new Uint8Array(r,t,Le));if(o!==c.digest())throw new Error(`The prelude checksum specified in the message (${o}) does not match the calculated CRC32 checksum (${c.digest()})`);if(c.update(new Uint8Array(r,t+Le,e-(Le+Ke))),a!==c.digest())throw new Error(`The message checksum (${c.digest()}) did not match the expected value of ${a}`);return{headers:new DataView(r,t+Le+Ke,i),body:new Uint8Array(r,t+Le+Ke+i,s-i-(Le+Ke+Ke))}}class Y0{constructor(t,r){this.headerMarshaller=new L0(t,r),this.messageBuffer=[],this.isEndOfStream=!1}feed(t){this.messageBuffer.push(this.decode(t))}endOfStream(){this.isEndOfStream=!0}getMessage(){const t=this.messageBuffer.pop(),r=this.isEndOfStream;return{getMessage(){return t},isEndOfStream(){return r}}}getAvailableMessages(){const t=this.messageBuffer;this.messageBuffer=[];const r=this.isEndOfStream;return{getMessages(){return t},isEndOfStream(){return r}}}encode({headers:t,body:r}){const n=this.headerMarshaller.format(t),s=n.byteLength+r.byteLength+16,i=new Uint8Array(s),o=new DataView(i.buffer,i.byteOffset,i.byteLength),a=new Fn.Crc32;return o.setUint32(0,s,!1),o.setUint32(4,n.byteLength,!1),o.setUint32(8,a.update(i.subarray(0,8)).digest(),!1),i.set(n,12),i.set(r,n.byteLength+12),o.setUint32(s-4,a.update(i.subarray(8,s-4)).digest(),!1),i}decode(t){const{headers:r,body:n}=X0(t);return{headers:this.headerMarshaller.parse(r),body:n}}formatHeaders(t){return this.headerMarshaller.format(t)}}class J0{constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.inputStream)yield this.options.decoder.decode(t)}}class Q0{constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.messageStream)yield this.options.encoder.encode(t);this.options.includeEndFrame&&(yield new Uint8Array(0))}}class em{constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.messageStream){const r=await this.options.deserializer(t);r!==void 0&&(yield r)}}}class tm{constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.inputStream)yield this.options.serializer(t)}}function rm(e){let t=0,r=0,n=null,s=null;const i=a=>{if(typeof a!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+a);t=a,r=4,n=new Uint8Array(a),new DataView(n.buffer).setUint32(0,a,!1)},o=async function*(){const a=e[Symbol.asyncIterator]();for(;;){const{value:c,done:u}=await a.next();if(u){if(t)if(t===r)yield n;else throw new Error("Truncated event message received.");else return;return}const d=c.length;let p=0;for(;p<d;){if(!n){const g=d-p;s||(s=new Uint8Array(4));const w=Math.min(4-r,g);if(s.set(c.slice(p,p+w),r),r+=w,p+=w,r<4)break;i(new DataView(s.buffer).getUint32(0,!1)),s=null}const f=Math.min(t-r,d-p);n.set(c.slice(p,p+f),r),r+=f,p+=f,t&&t===r&&(yield n,n=null,t=0,r=0)}}};return{[Symbol.asyncIterator]:o}}function nm(e,t){return async function(r){const{value:n}=r.headers[":message-type"];if(n==="error"){const s=new Error(r.headers[":error-message"].value||"UnknownError");throw s.name=r.headers[":error-code"].value,s}else if(n==="exception"){const s=r.headers[":exception-type"].value,i={[s]:r},o=await e(i);if(o.$unknown){const a=new Error(t(r.body));throw a.name=s,a}throw o[s]}else if(n==="event"){const s={[r.headers[":event-type"].value]:r},i=await e(s);return i.$unknown?void 0:i}else throw Error(`Unrecognizable event type: ${r.headers[":event-type"].value}`)}}let sm=class{constructor({utf8Encoder:e,utf8Decoder:t}){this.eventStreamCodec=new Y0(e,t),this.utfEncoder=e}deserialize(e,t){const r=rm(e);return new em({messageStream:new J0({inputStream:r,decoder:this.eventStreamCodec}),deserializer:nm(t,this.utfEncoder)})}serialize(e,t){return new Q0({messageStream:new tm({inputStream:e,serializer:t}),encoder:this.eventStreamCodec,includeEndFrame:!0})}};const im=e=>({[Symbol.asyncIterator]:async function*(){const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)return;yield n}}finally{t.releaseLock()}}}),om=e=>{const t=e[Symbol.asyncIterator]();return new ReadableStream({async pull(r){const{done:n,value:s}=await t.next();if(n)return r.close();r.enqueue(s)}})};class am{constructor({utf8Encoder:t,utf8Decoder:r}){this.universalMarshaller=new sm({utf8Decoder:r,utf8Encoder:t})}deserialize(t,r){const n=cm(t)?im(t):t;return this.universalMarshaller.deserialize(n,r)}serialize(t,r){const n=this.universalMarshaller.serialize(t,r);return typeof ReadableStream=="function"?om(n):n}}const cm=e=>typeof ReadableStream=="function"&&e instanceof ReadableStream,um=e=>new am(e);function lm(e,t,r=1024*1024){return new Promise((n,s)=>{const i=new FileReader;i.addEventListener("error",s),i.addEventListener("abort",s);const o=e.size;let a=0;function c(){if(a>=o){n();return}i.readAsArrayBuffer(e.slice(a,Math.min(o,a+r)))}i.addEventListener("load",u=>{const d=u.target.result;t(new Uint8Array(d)),a+=d.byteLength,c()}),c()})}const dm=async function(e,t){const r=new e;return await lm(t,n=>{r.update(n)}),r.digest()},hm=e=>()=>Promise.reject(e),Ue=64,pm=16,fm=[1732584193,4023233417,2562383102,271733878];class gm{constructor(){this.reset()}update(t){if(mm(t))return;if(this.finished)throw new Error("Attempted to update an already finished hash.");const r=ym(t);let n=0,{byteLength:s}=r;for(this.bytesHashed+=s;s>0;)this.buffer.setUint8(this.bufferLength++,r[n++]),s--,this.bufferLength===Ue&&(this.hashBuffer(),this.bufferLength=0)}async digest(){if(!this.finished){const{buffer:r,bufferLength:n,bytesHashed:s}=this,i=s*8;if(r.setUint8(this.bufferLength++,128),n%Ue>=Ue-8){for(let o=this.bufferLength;o<Ue;o++)r.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(let o=this.bufferLength;o<Ue-8;o++)r.setUint8(o,0);r.setUint32(Ue-8,i>>>0,!0),r.setUint32(Ue-4,Math.floor(i/4294967296),!0),this.hashBuffer(),this.finished=!0}const t=new DataView(new ArrayBuffer(pm));for(let r=0;r<4;r++)t.setUint32(r*4,this.state[r],!0);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}hashBuffer(){const{buffer:t,state:r}=this;let n=r[0],s=r[1],i=r[2],o=r[3];n=re(n,s,i,o,t.getUint32(0,!0),7,3614090360),o=re(o,n,s,i,t.getUint32(4,!0),12,3905402710),i=re(i,o,n,s,t.getUint32(8,!0),17,606105819),s=re(s,i,o,n,t.getUint32(12,!0),22,3250441966),n=re(n,s,i,o,t.getUint32(16,!0),7,4118548399),o=re(o,n,s,i,t.getUint32(20,!0),12,1200080426),i=re(i,o,n,s,t.getUint32(24,!0),17,2821735955),s=re(s,i,o,n,t.getUint32(28,!0),22,4249261313),n=re(n,s,i,o,t.getUint32(32,!0),7,1770035416),o=re(o,n,s,i,t.getUint32(36,!0),12,2336552879),i=re(i,o,n,s,t.getUint32(40,!0),17,4294925233),s=re(s,i,o,n,t.getUint32(44,!0),22,2304563134),n=re(n,s,i,o,t.getUint32(48,!0),7,1804603682),o=re(o,n,s,i,t.getUint32(52,!0),12,4254626195),i=re(i,o,n,s,t.getUint32(56,!0),17,2792965006),s=re(s,i,o,n,t.getUint32(60,!0),22,1236535329),n=ne(n,s,i,o,t.getUint32(4,!0),5,4129170786),o=ne(o,n,s,i,t.getUint32(24,!0),9,3225465664),i=ne(i,o,n,s,t.getUint32(44,!0),14,643717713),s=ne(s,i,o,n,t.getUint32(0,!0),20,3921069994),n=ne(n,s,i,o,t.getUint32(20,!0),5,3593408605),o=ne(o,n,s,i,t.getUint32(40,!0),9,38016083),i=ne(i,o,n,s,t.getUint32(60,!0),14,3634488961),s=ne(s,i,o,n,t.getUint32(16,!0),20,3889429448),n=ne(n,s,i,o,t.getUint32(36,!0),5,568446438),o=ne(o,n,s,i,t.getUint32(56,!0),9,3275163606),i=ne(i,o,n,s,t.getUint32(12,!0),14,4107603335),s=ne(s,i,o,n,t.getUint32(32,!0),20,1163531501),n=ne(n,s,i,o,t.getUint32(52,!0),5,2850285829),o=ne(o,n,s,i,t.getUint32(8,!0),9,4243563512),i=ne(i,o,n,s,t.getUint32(28,!0),14,1735328473),s=ne(s,i,o,n,t.getUint32(48,!0),20,2368359562),n=se(n,s,i,o,t.getUint32(20,!0),4,4294588738),o=se(o,n,s,i,t.getUint32(32,!0),11,2272392833),i=se(i,o,n,s,t.getUint32(44,!0),16,1839030562),s=se(s,i,o,n,t.getUint32(56,!0),23,4259657740),n=se(n,s,i,o,t.getUint32(4,!0),4,2763975236),o=se(o,n,s,i,t.getUint32(16,!0),11,1272893353),i=se(i,o,n,s,t.getUint32(28,!0),16,4139469664),s=se(s,i,o,n,t.getUint32(40,!0),23,3200236656),n=se(n,s,i,o,t.getUint32(52,!0),4,681279174),o=se(o,n,s,i,t.getUint32(0,!0),11,3936430074),i=se(i,o,n,s,t.getUint32(12,!0),16,3572445317),s=se(s,i,o,n,t.getUint32(24,!0),23,76029189),n=se(n,s,i,o,t.getUint32(36,!0),4,3654602809),o=se(o,n,s,i,t.getUint32(48,!0),11,3873151461),i=se(i,o,n,s,t.getUint32(60,!0),16,530742520),s=se(s,i,o,n,t.getUint32(8,!0),23,3299628645),n=ie(n,s,i,o,t.getUint32(0,!0),6,4096336452),o=ie(o,n,s,i,t.getUint32(28,!0),10,1126891415),i=ie(i,o,n,s,t.getUint32(56,!0),15,2878612391),s=ie(s,i,o,n,t.getUint32(20,!0),21,4237533241),n=ie(n,s,i,o,t.getUint32(48,!0),6,1700485571),o=ie(o,n,s,i,t.getUint32(12,!0),10,2399980690),i=ie(i,o,n,s,t.getUint32(40,!0),15,4293915773),s=ie(s,i,o,n,t.getUint32(4,!0),21,2240044497),n=ie(n,s,i,o,t.getUint32(32,!0),6,1873313359),o=ie(o,n,s,i,t.getUint32(60,!0),10,4264355552),i=ie(i,o,n,s,t.getUint32(24,!0),15,2734768916),s=ie(s,i,o,n,t.getUint32(52,!0),21,1309151649),n=ie(n,s,i,o,t.getUint32(16,!0),6,4149444226),o=ie(o,n,s,i,t.getUint32(44,!0),10,3174756917),i=ie(i,o,n,s,t.getUint32(8,!0),15,718787259),s=ie(s,i,o,n,t.getUint32(36,!0),21,3951481745),r[0]=n+r[0]&4294967295,r[1]=s+r[1]&4294967295,r[2]=i+r[2]&4294967295,r[3]=o+r[3]&4294967295}reset(){this.state=Uint32Array.from(fm),this.buffer=new DataView(new ArrayBuffer(Ue)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}}function lr(e,t,r,n,s,i){return t=(t+e&4294967295)+(n+i&4294967295)&4294967295,(t<<s|t>>>32-s)+r&4294967295}function re(e,t,r,n,s,i,o){return lr(t&r|~t&n,e,t,s,i,o)}function ne(e,t,r,n,s,i,o){return lr(t&n|r&~n,e,t,s,i,o)}function se(e,t,r,n,s,i,o){return lr(t^r^n,e,t,s,i,o)}function ie(e,t,r,n,s,i,o){return lr(r^(t|~n),e,t,s,i,o)}function mm(e){return typeof e=="string"?e.length===0:e.byteLength===0}function ym(e){return typeof e=="string"?Ye(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}const Oi=typeof TextEncoder=="function"?new TextEncoder:null,bm=e=>{if(typeof e=="string"){if(Oi)return Oi.encode(e).byteLength;let t=e.length;for(let r=t-1;r>=0;r--){const n=e.charCodeAt(r);n>127&&n<=2047?t++:n>2047&&n<=65535&&(t+=2),n>=56320&&n<=57343&&r--}return t}else{if(typeof e.byteLength=="number")return e.byteLength;if(typeof e.size=="number")return e.size}throw new Error(`Body Length computation failed for ${e}`)},wm={CrtSignerV4:null};class vm{constructor(t){this.sigv4Signer=new Fl(t),this.signerOptions=t}async sign(t,r={}){if(r.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(t,r)}return this.sigv4Signer.sign(t,r)}async signWithCredentials(t,r,n={}){if(n.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(t,r,n)}return this.sigv4Signer.signWithCredentials(t,r,n)}async presign(t,r={}){if(r.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(t,r)}return this.sigv4Signer.presign(t,r)}async presignWithCredentials(t,r,n={}){if(n.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(t,r,n)}getSigv4aSigner(){if(!this.sigv4aSigner){let t=null;try{if(t=wm.CrtSignerV4,typeof t!="function")throw new Error}catch(r){throw r.message=`${r.message}
  45. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly.
  46. You 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";].
  47. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`,r}this.sigv4aSigner=new t({...this.signerOptions,signingAlgorithm:1})}return this.sigv4aSigner}}const Hn="required",l="type",h="conditions",m="fn",y="argv",T="ref",F="assign",E="url",x="properties",gc="backend",Te="authSchemes",me="disableDoubleEncoding",ye="signingName",Ne="signingRegion",k="headers",zn="signingRegionSet",Sm=!1,Ee=!0,we="isSet",ee="booleanEquals",R="error",tr="aws.partition",L="stringEquals",z="getAttr",ae="name",Pe="substring",Ni="bucketSuffix",mc="parseURL",Mi="{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",A="endpoint",S="tree",yc="aws.isVirtualHostableS3Bucket",Kt="{url#scheme}://{Bucket}.{url#authority}{url#path}",_e="not",Gt="{url#scheme}://{url#authority}{url#path}",bc="hardwareType",wc="regionPrefix",Ii="bucketAliasSuffix",hn="outpostId",Je="isValidHostLabel",qn="sigv4a",Dt="s3-outposts",ot="s3",vc="{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",Sc="https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",Ui="https://{Bucket}.s3.{partitionResult#dnsSuffix}",Ac="aws.parseArn",Ec="bucketArn",xc="arnType",rr="",Vn="s3-object-lambda",kc="accesspoint",Wn="accessPointName",$i="{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",Bi="mrapPartition",Di="outpostType",Li="arnPrefix",Cc="{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",ji="https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",Fi="https://s3.{partitionResult#dnsSuffix}",Qe={[Hn]:!1,[l]:"String"},et={[Hn]:!0,default:!1,[l]:"Boolean"},Tt={[Hn]:!1,[l]:"Boolean"},xe={[m]:ee,[y]:[{[T]:"Accelerate"},!0]},D={[m]:ee,[y]:[{[T]:"UseFIPS"},!0]},B={[m]:ee,[y]:[{[T]:"UseDualStack"},!0]},V={[m]:we,[y]:[{[T]:"Endpoint"}]},Rc={[m]:tr,[y]:[{[T]:"Region"}],[F]:"partitionResult"},Hi={[m]:L,[y]:[{[m]:z,[y]:[{[T]:"partitionResult"},ae]},"aws-cn"]},nr={[m]:we,[y]:[{[T]:"Bucket"}]},le={[T]:"Bucket"},ue={[m]:mc,[y]:[{[T]:"Endpoint"}],[F]:"url"},Zt={[m]:ee,[y]:[{[m]:z,[y]:[{[T]:"url"},"isIp"]},!0]},Tc={[T]:"url"},Pc={[m]:"uriEncode",[y]:[le],[F]:"uri_encoded_bucket"},Me={[gc]:"S3Express",[Te]:[{[me]:!0,[ae]:"sigv4",[ye]:"s3express",[Ne]:"{Region}"}]},P={},_c={[m]:yc,[y]:[le,!1]},Cr={[R]:"S3Express bucket name is not a valid virtual hostable name.",[l]:R},sr={[gc]:"S3Express",[Te]:[{[me]:!0,[ae]:"sigv4-s3express",[ye]:"s3express",[Ne]:"{Region}"}]},zi={[m]:we,[y]:[{[T]:"UseS3ExpressControlEndpoint"}]},qi={[m]:ee,[y]:[{[T]:"UseS3ExpressControlEndpoint"},!0]},_={[m]:_e,[y]:[V]},Vi={[R]:"Unrecognized S3Express bucket name format.",[l]:R},Wi={[m]:_e,[y]:[nr]},Ki={[T]:bc},Gi={[h]:[_],[R]:"Expected a endpoint to be specified but no endpoint was found",[l]:R},Ht={[Te]:[{[me]:!0,[ae]:qn,[ye]:Dt,[zn]:["*"]},{[me]:!0,[ae]:"sigv4",[ye]:Dt,[Ne]:"{Region}"}]},Rr={[m]:ee,[y]:[{[T]:"ForcePathStyle"},!1]},Am={[T]:"ForcePathStyle"},q={[m]:ee,[y]:[{[T]:"Accelerate"},!1]},G={[m]:L,[y]:[{[T]:"Region"},"aws-global"]},X={[Te]:[{[me]:!0,[ae]:"sigv4",[ye]:ot,[Ne]:"us-east-1"}]},M={[m]:_e,[y]:[G]},Y={[m]:ee,[y]:[{[T]:"UseGlobalEndpoint"},!0]},Zi={[E]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[x]:{[Te]:[{[me]:!0,[ae]:"sigv4",[ye]:ot,[Ne]:"{Region}"}]},[k]:{}},K={[Te]:[{[me]:!0,[ae]:"sigv4",[ye]:ot,[Ne]:"{Region}"}]},J={[m]:ee,[y]:[{[T]:"UseGlobalEndpoint"},!1]},N={[m]:ee,[y]:[{[T]:"UseDualStack"},!1]},Xi={[E]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",[x]:K,[k]:{}},O={[m]:ee,[y]:[{[T]:"UseFIPS"},!1]},Yi={[E]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",[x]:K,[k]:{}},Ji={[E]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[x]:K,[k]:{}},Tr={[m]:ee,[y]:[{[m]:z,[y]:[Tc,"isIp"]},!1]},Pr={[E]:vc,[x]:K,[k]:{}},pn={[E]:Kt,[x]:K,[k]:{}},Qi={[A]:pn,[l]:A},_r={[E]:Sc,[x]:K,[k]:{}},eo={[E]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",[x]:K,[k]:{}},zt={[R]:"Invalid region: region was not a valid DNS name.",[l]:R},pe={[T]:Ec},Oc={[T]:xc},Or={[m]:z,[y]:[pe,"service"]},Kn={[T]:Wn},to={[h]:[B],[R]:"S3 Object Lambda does not support Dual-stack",[l]:R},ro={[h]:[xe],[R]:"S3 Object Lambda does not support S3 Accelerate",[l]:R},no={[h]:[{[m]:we,[y]:[{[T]:"DisableAccessPoints"}]},{[m]:ee,[y]:[{[T]:"DisableAccessPoints"},!0]}],[R]:"Access points are not supported for this operation",[l]:R},Nr={[h]:[{[m]:we,[y]:[{[T]:"UseArnRegion"}]},{[m]:ee,[y]:[{[T]:"UseArnRegion"},!1]},{[m]:_e,[y]:[{[m]:L,[y]:[{[m]:z,[y]:[pe,"region"]},"{Region}"]}]}],[R]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",[l]:R},Nc={[m]:z,[y]:[{[T]:"bucketPartition"},ae]},Mc={[m]:z,[y]:[pe,"accountId"]},Mr={[Te]:[{[me]:!0,[ae]:"sigv4",[ye]:Vn,[Ne]:"{bucketArn#region}"}]},so={[R]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",[l]:R},Ir={[R]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",[l]:R},Ur={[R]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",[l]:R},$r={[R]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",[l]:R},io={[R]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",[l]:R},oo={[R]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",[l]:R},Pt={[Te]:[{[me]:!0,[ae]:"sigv4",[ye]:ot,[Ne]:"{bucketArn#region}"}]},ao={[Te]:[{[me]:!0,[ae]:qn,[ye]:Dt,[zn]:["*"]},{[me]:!0,[ae]:"sigv4",[ye]:Dt,[Ne]:"{bucketArn#region}"}]},co={[m]:Ac,[y]:[le]},uo={[E]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[x]:K,[k]:{}},lo={[E]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[x]:K,[k]:{}},ho={[E]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[x]:K,[k]:{}},Br={[E]:Cc,[x]:K,[k]:{}},po={[E]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[x]:K,[k]:{}},fo={[T]:"UseObjectLambdaEndpoint"},Dr={[Te]:[{[me]:!0,[ae]:"sigv4",[ye]:Vn,[Ne]:"{Region}"}]},go={[E]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[x]:K,[k]:{}},mo={[E]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",[x]:K,[k]:{}},yo={[E]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[x]:K,[k]:{}},Lr={[E]:Gt,[x]:K,[k]:{}},bo={[E]:"https://s3.{Region}.{partitionResult#dnsSuffix}",[x]:K,[k]:{}},jr=[{[T]:"Region"}],Em=[{[T]:"Endpoint"}],xm=[le],Fr=[B],qt=[xe],We=[V,ue],wo=[{[m]:we,[y]:[{[T]:"DisableS3ExpressSessionAuth"}]},{[m]:ee,[y]:[{[T]:"DisableS3ExpressSessionAuth"},!0]}],vo=[Zt],Hr=[Pc],zr=[_c],tt=[D],So=[{[m]:Pe,[y]:[le,6,14,!0],[F]:"s3expressAvailabilityZoneId"},{[m]:Pe,[y]:[le,14,16,!0],[F]:"s3expressAvailabilityZoneDelim"},{[m]:L,[y]:[{[T]:"s3expressAvailabilityZoneDelim"},"--"]}],Ao=[{[h]:[D],[A]:{[E]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",[x]:Me,[k]:{}},[l]:A},{[A]:{[E]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",[x]:Me,[k]:{}},[l]:A}],Eo=[{[m]:Pe,[y]:[le,6,15,!0],[F]:"s3expressAvailabilityZoneId"},{[m]:Pe,[y]:[le,15,17,!0],[F]:"s3expressAvailabilityZoneDelim"},{[m]:L,[y]:[{[T]:"s3expressAvailabilityZoneDelim"},"--"]}],xo=[{[h]:[D],[A]:{[E]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",[x]:sr,[k]:{}},[l]:A},{[A]:{[E]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",[x]:sr,[k]:{}},[l]:A}],km=[nr],ko=[{[m]:Je,[y]:[{[T]:hn},!1]}],Co=[{[m]:L,[y]:[{[T]:wc},"beta"]}],Cm=["*"],$e=[Rc],Ro=[{[m]:Je,[y]:[{[T]:"Region"},!1]}],Be=[{[m]:L,[y]:[{[T]:"Region"},"us-east-1"]}],qr=[{[m]:L,[y]:[Oc,kc]}],To=[{[m]:z,[y]:[pe,"resourceId[1]"],[F]:Wn},{[m]:_e,[y]:[{[m]:L,[y]:[Kn,rr]}]}],Rm=[pe,"resourceId[1]"],Vr=[{[m]:_e,[y]:[{[m]:L,[y]:[{[m]:z,[y]:[pe,"region"]},rr]}]}],Po=[{[m]:_e,[y]:[{[m]:we,[y]:[{[m]:z,[y]:[pe,"resourceId[2]"]}]}]}],Tm=[pe,"resourceId[2]"],Wr=[{[m]:tr,[y]:[{[m]:z,[y]:[pe,"region"]}],[F]:"bucketPartition"}],_o=[{[m]:L,[y]:[Nc,{[m]:z,[y]:[{[T]:"partitionResult"},ae]}]}],Kr=[{[m]:Je,[y]:[{[m]:z,[y]:[pe,"region"]},!0]}],Gr=[{[m]:Je,[y]:[Mc,!1]}],Oo=[{[m]:Je,[y]:[Kn,!1]}],No=[{[m]:Je,[y]:[{[T]:"Region"},!0]}],Pm={version:"1.0",parameters:{Bucket:Qe,Region:Qe,UseFIPS:et,UseDualStack:et,Endpoint:Qe,ForcePathStyle:et,Accelerate:et,UseGlobalEndpoint:et,UseObjectLambdaEndpoint:Tt,Key:Qe,Prefix:Qe,CopySource:Qe,DisableAccessPoints:Tt,DisableMultiRegionAccessPoints:et,UseArnRegion:Tt,UseS3ExpressControlEndpoint:Tt,DisableS3ExpressSessionAuth:Tt},rules:[{[h]:[{[m]:we,[y]:jr}],rules:[{[h]:[xe,D],error:"Accelerate cannot be used with FIPS",[l]:R},{[h]:[B,V],error:"Cannot set dual-stack in combination with a custom endpoint.",[l]:R},{[h]:[V,D],error:"A custom endpoint cannot be combined with FIPS",[l]:R},{[h]:[V,xe],error:"A custom endpoint cannot be combined with S3 Accelerate",[l]:R},{[h]:[D,Rc,Hi],error:"Partition does not support FIPS",[l]:R},{[h]:[nr,{[m]:Pe,[y]:[le,0,6,Ee],[F]:Ni},{[m]:L,[y]:[{[T]:Ni},"--x-s3"]}],rules:[{[h]:Fr,error:"S3Express does not support Dual-stack.",[l]:R},{[h]:qt,error:"S3Express does not support S3 Accelerate.",[l]:R},{[h]:We,rules:[{[h]:wo,rules:[{[h]:vo,rules:[{[h]:Hr,rules:[{endpoint:{[E]:Mi,[x]:Me,[k]:P},[l]:A}],[l]:S}],[l]:S},{[h]:zr,rules:[{endpoint:{[E]:Kt,[x]:Me,[k]:P},[l]:A}],[l]:S},Cr],[l]:S},{[h]:vo,rules:[{[h]:Hr,rules:[{endpoint:{[E]:Mi,[x]:sr,[k]:P},[l]:A}],[l]:S}],[l]:S},{[h]:zr,rules:[{endpoint:{[E]:Kt,[x]:sr,[k]:P},[l]:A}],[l]:S},Cr],[l]:S},{[h]:[zi,qi],rules:[{[h]:[Pc,_],rules:[{[h]:tt,endpoint:{[E]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",[x]:Me,[k]:P},[l]:A},{endpoint:{[E]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",[x]:Me,[k]:P},[l]:A}],[l]:S}],[l]:S},{[h]:zr,rules:[{[h]:wo,rules:[{[h]:So,rules:Ao,[l]:S},{[h]:Eo,rules:Ao,[l]:S},Vi],[l]:S},{[h]:So,rules:xo,[l]:S},{[h]:Eo,rules:xo,[l]:S},Vi],[l]:S},Cr],[l]:S},{[h]:[Wi,zi,qi],rules:[{[h]:We,endpoint:{[E]:Gt,[x]:Me,[k]:P},[l]:A},{[h]:tt,endpoint:{[E]:"https://s3express-control-fips.{Region}.amazonaws.com",[x]:Me,[k]:P},[l]:A},{endpoint:{[E]:"https://s3express-control.{Region}.amazonaws.com",[x]:Me,[k]:P},[l]:A}],[l]:S},{[h]:[nr,{[m]:Pe,[y]:[le,49,50,Ee],[F]:bc},{[m]:Pe,[y]:[le,8,12,Ee],[F]:wc},{[m]:Pe,[y]:[le,0,7,Ee],[F]:Ii},{[m]:Pe,[y]:[le,32,49,Ee],[F]:hn},{[m]:tr,[y]:jr,[F]:"regionPartition"},{[m]:L,[y]:[{[T]:Ii},"--op-s3"]}],rules:[{[h]:ko,rules:[{[h]:[{[m]:L,[y]:[Ki,"e"]}],rules:[{[h]:Co,rules:[Gi,{[h]:We,endpoint:{[E]:"https://{Bucket}.ec2.{url#authority}",[x]:Ht,[k]:P},[l]:A}],[l]:S},{endpoint:{[E]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[x]:Ht,[k]:P},[l]:A}],[l]:S},{[h]:[{[m]:L,[y]:[Ki,"o"]}],rules:[{[h]:Co,rules:[Gi,{[h]:We,endpoint:{[E]:"https://{Bucket}.op-{outpostId}.{url#authority}",[x]:Ht,[k]:P},[l]:A}],[l]:S},{endpoint:{[E]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[x]:Ht,[k]:P},[l]:A}],[l]:S},{error:'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"',[l]:R}],[l]:S},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",[l]:R}],[l]:S},{[h]:km,rules:[{[h]:[V,{[m]:_e,[y]:[{[m]:we,[y]:[{[m]:mc,[y]:Em}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",[l]:R},{[h]:[Rr,_c],rules:[{[h]:$e,rules:[{[h]:Ro,rules:[{[h]:[xe,Hi],error:"S3 Accelerate cannot be used in this region",[l]:R},{[h]:[B,D,q,_,G],endpoint:{[E]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[x]:X,[k]:P},[l]:A},{[h]:[B,D,q,_,M,Y],rules:[{endpoint:Zi,[l]:A}],[l]:S},{[h]:[B,D,q,_,M,J],endpoint:Zi,[l]:A},{[h]:[N,D,q,_,G],endpoint:{[E]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",[x]:X,[k]:P},[l]:A},{[h]:[N,D,q,_,M,Y],rules:[{endpoint:Xi,[l]:A}],[l]:S},{[h]:[N,D,q,_,M,J],endpoint:Xi,[l]:A},{[h]:[B,O,xe,_,G],endpoint:{[E]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",[x]:X,[k]:P},[l]:A},{[h]:[B,O,xe,_,M,Y],rules:[{endpoint:Yi,[l]:A}],[l]:S},{[h]:[B,O,xe,_,M,J],endpoint:Yi,[l]:A},{[h]:[B,O,q,_,G],endpoint:{[E]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[x]:X,[k]:P},[l]:A},{[h]:[B,O,q,_,M,Y],rules:[{endpoint:Ji,[l]:A}],[l]:S},{[h]:[B,O,q,_,M,J],endpoint:Ji,[l]:A},{[h]:[N,O,q,V,ue,Zt,G],endpoint:{[E]:vc,[x]:X,[k]:P},[l]:A},{[h]:[N,O,q,V,ue,Tr,G],endpoint:{[E]:Kt,[x]:X,[k]:P},[l]:A},{[h]:[N,O,q,V,ue,Zt,M,Y],rules:[{[h]:Be,endpoint:Pr,[l]:A},{endpoint:Pr,[l]:A}],[l]:S},{[h]:[N,O,q,V,ue,Tr,M,Y],rules:[{[h]:Be,endpoint:pn,[l]:A},Qi],[l]:S},{[h]:[N,O,q,V,ue,Zt,M,J],endpoint:Pr,[l]:A},{[h]:[N,O,q,V,ue,Tr,M,J],endpoint:pn,[l]:A},{[h]:[N,O,xe,_,G],endpoint:{[E]:Sc,[x]:X,[k]:P},[l]:A},{[h]:[N,O,xe,_,M,Y],rules:[{[h]:Be,endpoint:_r,[l]:A},{endpoint:_r,[l]:A}],[l]:S},{[h]:[N,O,xe,_,M,J],endpoint:_r,[l]:A},{[h]:[N,O,q,_,G],endpoint:{[E]:Ui,[x]:X,[k]:P},[l]:A},{[h]:[N,O,q,_,M,Y],rules:[{[h]:Be,endpoint:{[E]:Ui,[x]:K,[k]:P},[l]:A},{endpoint:eo,[l]:A}],[l]:S},{[h]:[N,O,q,_,M,J],endpoint:eo,[l]:A}],[l]:S},zt],[l]:S}],[l]:S},{[h]:[V,ue,{[m]:L,[y]:[{[m]:z,[y]:[Tc,"scheme"]},"http"]},{[m]:yc,[y]:[le,Ee]},Rr,O,N,q],rules:[{[h]:$e,rules:[{[h]:Ro,rules:[Qi],[l]:S},zt],[l]:S}],[l]:S},{[h]:[Rr,{[m]:Ac,[y]:xm,[F]:Ec}],rules:[{[h]:[{[m]:z,[y]:[pe,"resourceId[0]"],[F]:xc},{[m]:_e,[y]:[{[m]:L,[y]:[Oc,rr]}]}],rules:[{[h]:[{[m]:L,[y]:[Or,Vn]}],rules:[{[h]:qr,rules:[{[h]:To,rules:[to,ro,{[h]:Vr,rules:[no,{[h]:Po,rules:[Nr,{[h]:Wr,rules:[{[h]:$e,rules:[{[h]:_o,rules:[{[h]:Kr,rules:[{[h]:[{[m]:L,[y]:[Mc,rr]}],error:"Invalid ARN: Missing account id",[l]:R},{[h]:Gr,rules:[{[h]:Oo,rules:[{[h]:We,endpoint:{[E]:$i,[x]:Mr,[k]:P},[l]:A},{[h]:tt,endpoint:{[E]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[x]:Mr,[k]:P},[l]:A},{endpoint:{[E]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",[x]:Mr,[k]:P},[l]:A}],[l]:S},so],[l]:S},Ir],[l]:S},Ur],[l]:S},$r],[l]:S}],[l]:S}],[l]:S},io],[l]:S},{error:"Invalid ARN: bucket ARN is missing a region",[l]:R}],[l]:S},oo],[l]:S},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",[l]:R}],[l]:S},{[h]:qr,rules:[{[h]:To,rules:[{[h]:Vr,rules:[{[h]:qr,rules:[{[h]:Vr,rules:[no,{[h]:Po,rules:[Nr,{[h]:Wr,rules:[{[h]:$e,rules:[{[h]:[{[m]:L,[y]:[Nc,"{partitionResult#name}"]}],rules:[{[h]:Kr,rules:[{[h]:[{[m]:L,[y]:[Or,ot]}],rules:[{[h]:Gr,rules:[{[h]:Oo,rules:[{[h]:qt,error:"Access Points do not support S3 Accelerate",[l]:R},{[h]:[D,B],endpoint:{[E]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[x]:Pt,[k]:P},[l]:A},{[h]:[D,N],endpoint:{[E]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[x]:Pt,[k]:P},[l]:A},{[h]:[O,B],endpoint:{[E]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[x]:Pt,[k]:P},[l]:A},{[h]:[O,N,V,ue],endpoint:{[E]:$i,[x]:Pt,[k]:P},[l]:A},{[h]:[O,N],endpoint:{[E]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",[x]:Pt,[k]:P},[l]:A}],[l]:S},so],[l]:S},Ir],[l]:S},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",[l]:R}],[l]:S},Ur],[l]:S},$r],[l]:S}],[l]:S}],[l]:S},io],[l]:S}],[l]:S}],[l]:S},{[h]:[{[m]:Je,[y]:[Kn,Ee]}],rules:[{[h]:Fr,error:"S3 MRAP does not support dual-stack",[l]:R},{[h]:tt,error:"S3 MRAP does not support FIPS",[l]:R},{[h]:qt,error:"S3 MRAP does not support S3 Accelerate",[l]:R},{[h]:[{[m]:ee,[y]:[{[T]:"DisableMultiRegionAccessPoints"},Ee]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",[l]:R},{[h]:[{[m]:tr,[y]:jr,[F]:Bi}],rules:[{[h]:[{[m]:L,[y]:[{[m]:z,[y]:[{[T]:Bi},ae]},{[m]:z,[y]:[pe,"partition"]}]}],rules:[{endpoint:{[E]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",[x]:{[Te]:[{[me]:Ee,name:qn,[ye]:ot,[zn]:Cm}]},[k]:P},[l]:A}],[l]:S},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",[l]:R}],[l]:S}],[l]:S},{error:"Invalid Access Point Name",[l]:R}],[l]:S},oo],[l]:S},{[h]:[{[m]:L,[y]:[Or,Dt]}],rules:[{[h]:Fr,error:"S3 Outposts does not support Dual-stack",[l]:R},{[h]:tt,error:"S3 Outposts does not support FIPS",[l]:R},{[h]:qt,error:"S3 Outposts does not support S3 Accelerate",[l]:R},{[h]:[{[m]:we,[y]:[{[m]:z,[y]:[pe,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",[l]:R},{[h]:[{[m]:z,[y]:Rm,[F]:hn}],rules:[{[h]:ko,rules:[Nr,{[h]:Wr,rules:[{[h]:$e,rules:[{[h]:_o,rules:[{[h]:Kr,rules:[{[h]:Gr,rules:[{[h]:[{[m]:z,[y]:Tm,[F]:Di}],rules:[{[h]:[{[m]:z,[y]:[pe,"resourceId[3]"],[F]:Wn}],rules:[{[h]:[{[m]:L,[y]:[{[T]:Di},kc]}],rules:[{[h]:We,endpoint:{[E]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",[x]:ao,[k]:P},[l]:A},{endpoint:{[E]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",[x]:ao,[k]:P},[l]:A}],[l]:S},{error:"Expected an outpost type `accesspoint`, found {outpostType}",[l]:R}],[l]:S},{error:"Invalid ARN: expected an access point name",[l]:R}],[l]:S},{error:"Invalid ARN: Expected a 4-component resource",[l]:R}],[l]:S},Ir],[l]:S},Ur],[l]:S},$r],[l]:S}],[l]:S}],[l]:S},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",[l]:R}],[l]:S},{error:"Invalid ARN: The Outpost Id was not set",[l]:R}],[l]:S},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",[l]:R}],[l]:S},{error:"Invalid ARN: No ARN type specified",[l]:R}],[l]:S},{[h]:[{[m]:Pe,[y]:[le,0,4,Sm],[F]:Li},{[m]:L,[y]:[{[T]:Li},"arn:"]},{[m]:_e,[y]:[{[m]:we,[y]:[co]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",[l]:R},{[h]:[{[m]:ee,[y]:[Am,Ee]},co],error:"Path-style addressing cannot be used with ARN buckets",[l]:R},{[h]:Hr,rules:[{[h]:$e,rules:[{[h]:[q],rules:[{[h]:[B,_,D,G],endpoint:{[E]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[x]:X,[k]:P},[l]:A},{[h]:[B,_,D,M,Y],rules:[{endpoint:uo,[l]:A}],[l]:S},{[h]:[B,_,D,M,J],endpoint:uo,[l]:A},{[h]:[N,_,D,G],endpoint:{[E]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[x]:X,[k]:P},[l]:A},{[h]:[N,_,D,M,Y],rules:[{endpoint:lo,[l]:A}],[l]:S},{[h]:[N,_,D,M,J],endpoint:lo,[l]:A},{[h]:[B,_,O,G],endpoint:{[E]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[x]:X,[k]:P},[l]:A},{[h]:[B,_,O,M,Y],rules:[{endpoint:ho,[l]:A}],[l]:S},{[h]:[B,_,O,M,J],endpoint:ho,[l]:A},{[h]:[N,V,ue,O,G],endpoint:{[E]:Cc,[x]:X,[k]:P},[l]:A},{[h]:[N,V,ue,O,M,Y],rules:[{[h]:Be,endpoint:Br,[l]:A},{endpoint:Br,[l]:A}],[l]:S},{[h]:[N,V,ue,O,M,J],endpoint:Br,[l]:A},{[h]:[N,_,O,G],endpoint:{[E]:ji,[x]:X,[k]:P},[l]:A},{[h]:[N,_,O,M,Y],rules:[{[h]:Be,endpoint:{[E]:ji,[x]:K,[k]:P},[l]:A},{endpoint:po,[l]:A}],[l]:S},{[h]:[N,_,O,M,J],endpoint:po,[l]:A}],[l]:S},{error:"Path-style addressing cannot be used with S3 Accelerate",[l]:R}],[l]:S}],[l]:S}],[l]:S},{[h]:[{[m]:we,[y]:[fo]},{[m]:ee,[y]:[fo,Ee]}],rules:[{[h]:$e,rules:[{[h]:No,rules:[to,ro,{[h]:We,endpoint:{[E]:Gt,[x]:Dr,[k]:P},[l]:A},{[h]:tt,endpoint:{[E]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",[x]:Dr,[k]:P},[l]:A},{endpoint:{[E]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",[x]:Dr,[k]:P},[l]:A}],[l]:S},zt],[l]:S}],[l]:S},{[h]:[Wi],rules:[{[h]:$e,rules:[{[h]:No,rules:[{[h]:[D,B,_,G],endpoint:{[E]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[x]:X,[k]:P},[l]:A},{[h]:[D,B,_,M,Y],rules:[{endpoint:go,[l]:A}],[l]:S},{[h]:[D,B,_,M,J],endpoint:go,[l]:A},{[h]:[D,N,_,G],endpoint:{[E]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",[x]:X,[k]:P},[l]:A},{[h]:[D,N,_,M,Y],rules:[{endpoint:mo,[l]:A}],[l]:S},{[h]:[D,N,_,M,J],endpoint:mo,[l]:A},{[h]:[O,B,_,G],endpoint:{[E]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[x]:X,[k]:P},[l]:A},{[h]:[O,B,_,M,Y],rules:[{endpoint:yo,[l]:A}],[l]:S},{[h]:[O,B,_,M,J],endpoint:yo,[l]:A},{[h]:[O,N,V,ue,G],endpoint:{[E]:Gt,[x]:X,[k]:P},[l]:A},{[h]:[O,N,V,ue,M,Y],rules:[{[h]:Be,endpoint:Lr,[l]:A},{endpoint:Lr,[l]:A}],[l]:S},{[h]:[O,N,V,ue,M,J],endpoint:Lr,[l]:A},{[h]:[O,N,_,G],endpoint:{[E]:Fi,[x]:X,[k]:P},[l]:A},{[h]:[O,N,_,M,Y],rules:[{[h]:Be,endpoint:{[E]:Fi,[x]:K,[k]:P},[l]:A},{endpoint:bo,[l]:A}],[l]:S},{[h]:[O,N,_,M,J],endpoint:bo,[l]:A}],[l]:S},zt],[l]:S}],[l]:S}],[l]:S},{error:"A region must be set when sending requests to S3.",[l]:R}]},_m=Pm,Om=(e,t={})=>xd(_m,{endpointParams:e,logger:t.logger});Qt.aws=fa;const Nm=e=>({apiVersion:"2006-03-01",base64Decoder:(e==null?void 0:e.base64Decoder)??yn,base64Encoder:(e==null?void 0:e.base64Encoder)??wn,disableHostPrefix:(e==null?void 0:e.disableHostPrefix)??!1,endpointProvider:(e==null?void 0:e.endpointProvider)??Om,extensions:(e==null?void 0:e.extensions)??[],getAwsChunkedEncodingStream:(e==null?void 0:e.getAwsChunkedEncodingStream)??cu,logger:(e==null?void 0:e.logger)??new mn,sdkStreamMixin:(e==null?void 0:e.sdkStreamMixin)??mu,serviceId:(e==null?void 0:e.serviceId)??"S3",signerConstructor:(e==null?void 0:e.signerConstructor)??vm,signingEscapePath:(e==null?void 0:e.signingEscapePath)??!1,urlParser:(e==null?void 0:e.urlParser)??er,useArnRegion:(e==null?void 0:e.useArnRegion)??!1,utf8Decoder:(e==null?void 0:e.utf8Decoder)??Ye,utf8Encoder:(e==null?void 0:e.utf8Encoder)??bn}),Mm=["in-region","cross-region","mobile","standard","legacy"],Im=({defaultsMode:e}={})=>sa(async()=>{const t=typeof e=="function"?await e():e;switch(t==null?void 0:t.toLowerCase()){case"auto":return Promise.resolve(Um()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(t==null?void 0:t.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${Mm.join(", ")}, got ${t}`)}}),Um=()=>{var e,t;const r=typeof window<"u"&&(e=window==null?void 0:window.navigator)!=null&&e.userAgent?hc.parse(window.navigator.userAgent):void 0,n=(t=r==null?void 0:r.platform)==null?void 0:t.type;return n==="tablet"||n==="mobile"},$m=e=>{const t=Im(e),r=()=>t().then(qu),n=Nm(e);return{...n,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:(e==null?void 0:e.bodyLengthChecker)??bm,credentialDefaultProvider:(e==null?void 0:e.credentialDefaultProvider)??(s=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:(e==null?void 0:e.defaultUserAgentProvider)??B0({serviceId:n.serviceId,clientVersion:Lg.version}),eventStreamSerdeProvider:(e==null?void 0:e.eventStreamSerdeProvider)??um,maxAttempts:(e==null?void 0:e.maxAttempts)??Rn,md5:(e==null?void 0:e.md5)??gm,region:(e==null?void 0:e.region)??hm("Region is missing"),requestHandler:vn.create((e==null?void 0:e.requestHandler)??r),retryMode:(e==null?void 0:e.retryMode)??(async()=>(await r()).retryMode||ih),sha1:(e==null?void 0:e.sha1)??Ja.Sha1,sha256:(e==null?void 0:e.sha256)??oc.Sha256,streamCollector:(e==null?void 0:e.streamCollector)??Do,streamHasher:(e==null?void 0:e.streamHasher)??dm,useDualstackEndpoint:(e==null?void 0:e.useDualstackEndpoint)??(()=>Promise.resolve($d)),useFipsEndpoint:(e==null?void 0:e.useFipsEndpoint)??(()=>Promise.resolve(Bd))}},Bm=e=>{let t=async()=>{if(e.region===void 0)throw new Error("Region is missing from runtimeConfig");const r=e.region;return typeof r=="string"?r:r()};return{setRegion(r){t=r},region(){return t}}},Dm=e=>({region:e.region()}),Zr=e=>e,Lm=(e,t)=>{const r={...Zr(Bm(e)),...Zr(Zu(e)),...Zr(Fc(e))};return t.forEach(n=>n.configure(r)),{...e,...Dm(r),...Xu(r),...Hc(r)}};class jm extends su{constructor(...[t]){const r=$m(t||{}),n=Uh(r),s=Dd(n),i=sh(s),o=Rh(i),a=o,c=Ql(a),u=Vl(c,{session:[()=>this,vg]}),d=id(u),p=Ld(d),f=Lm(p,(t==null?void 0:t.extensions)||[]);super(f),this.config=f,this.middlewareStack.use(Mh(this.config)),this.middlewareStack.use(Hd(this.config)),this.middlewareStack.use(Zc(this.config)),this.middlewareStack.use(Jc(this.config)),this.middlewareStack.use(nu(this.config)),this.middlewareStack.use(sd(this.config)),this.middlewareStack.use(Yl(this.config)),this.middlewareStack.use(Wc(this.config)),this.middlewareStack.use(dl(this.config)),this.middlewareStack.use(ql(this.config)),this.middlewareStack.use(Ud(this.config))}destroy(){super.destroy()}}function Fm(e){return t=>async r=>{const n={...r.input},s=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(const i of s){const o=n[i.target];if(o){let a;typeof o=="string"?qm(o,e)?a=e.base64Decoder(o):(a=e.utf8Decoder(o),n[i.target]=e.base64Encoder(a)):(a=ArrayBuffer.isView(o)?new Uint8Array(o.buffer,o.byteOffset,o.byteLength):new Uint8Array(o),n[i.target]=e.base64Encoder(a));const c=new e.md5;c.update(a),n[i.hash]=e.base64Encoder(await c.digest())}}return t({...r,input:n})}}const Hm={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},zm=e=>({applyToStack:t=>{t.add(Fm(e),Hm)}});function qm(e,t){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e))return!1;try{return t.base64Decoder(e).length===32}catch{return!1}}var Q;(function(e){e.MD5="MD5",e.CRC32="CRC32",e.CRC32C="CRC32C",e.SHA1="SHA1",e.SHA256="SHA256"})(Q||(Q={}));var Mo;(function(e){e.HEADER="header",e.TRAILER="trailer"})(Mo||(Mo={}));const Vm=Q.MD5,Wm=Q.CRC32,fn=[Q.CRC32,Q.CRC32C,Q.SHA1,Q.SHA256],Km=[Q.CRC32,Q.CRC32C,Q.SHA1,Q.SHA256],Gm=(e,{requestChecksumRequired:t,requestAlgorithmMember:r},n)=>{const s=n?Wm:Vm;if(!r||!e[r])return t?s:void 0;const i=e[r];if(!fn.includes(i))throw new Error(`The checksum algorithm "${i}" is not supported by the client. Select one of ${fn}.`);return i},Gn=e=>e===Q.MD5?"content-md5":`x-amz-checksum-${e.toLowerCase()}`,Zm=(e,t)=>{const r=e.toLowerCase();for(const n of Object.keys(t))if(r===n.toLowerCase())return!0;return!1},Zn=e=>e!==void 0&&typeof e!="string"&&!ArrayBuffer.isView(e)&&!ta(e);var Io={},_t={},Uo;function Xm(){if(Uo)return _t;Uo=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.AwsCrc32c=void 0;var e=Re,t=qe(),r=Ic(),n=function(){function s(){this.crc32c=new r.Crc32c}return s.prototype.update=function(i){(0,t.isEmptyData)(i)||this.crc32c.update((0,t.convertToBuffer)(i))},s.prototype.digest=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,(0,t.numToUint8)(this.crc32c.digest())]})})},s.prototype.reset=function(){this.crc32c=new r.Crc32c},s}();return _t.AwsCrc32c=n,_t}var $o;function Ic(){return $o||($o=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AwsCrc32c=e.Crc32c=e.crc32c=void 0;var t=Re,r=qe();function n(c){return new s().update(c).digest()}e.crc32c=n;var s=function(){function c(){this.checksum=4294967295}return c.prototype.update=function(u){var d,p;try{for(var f=t.__values(u),g=f.next();!g.done;g=f.next()){var w=g.value;this.checksum=this.checksum>>>8^o[(this.checksum^w)&255]}}catch(b){d={error:b}}finally{try{g&&!g.done&&(p=f.return)&&p.call(f)}finally{if(d)throw d.error}}return this},c.prototype.digest=function(){return(this.checksum^4294967295)>>>0},c}();e.Crc32c=s;var i=[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],o=(0,r.uint32ArrayFrom)(i),a=Xm();Object.defineProperty(e,"AwsCrc32c",{enumerable:!0,get:function(){return a.AwsCrc32c}})}(Io)),Io}var Ym=Ic();const Uc=(e,t)=>({[Q.MD5]:t.md5,[Q.CRC32]:Fn.AwsCrc32,[Q.CRC32C]:Ym.AwsCrc32c,[Q.SHA1]:t.sha1,[Q.SHA256]:t.sha256})[e],$c=(e,t)=>{const r=new e;return r.update(st(t||"")),r.digest()},Jm={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},Qm=(e,t)=>(r,n)=>async s=>{if(!fe.isInstance(s.request))return r(s);const{request:i}=s,{body:o,headers:a}=i,{base64Encoder:c,streamHasher:u}=e,{input:d,requestChecksumRequired:p,requestAlgorithmMember:f}=t,g=Gm(d,{requestChecksumRequired:p,requestAlgorithmMember:f},!!n.isS3ExpressBucket);let w=o,b=a;if(g){const C=Gn(g),I=Uc(g,e);if(Zn(o)){const{getAwsChunkedEncodingStream:U,bodyLengthChecker:Z}=e;w=U(o,{base64Encoder:c,bodyLengthChecker:Z,checksumLocationName:C,checksumAlgorithmFn:I,streamHasher:u}),b={...a,"content-encoding":a["content-encoding"]?`${a["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":a["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":C},delete b["content-length"]}else if(!Zm(C,a)){const U=await $c(I,o);b={...a,[C]:c(U)}}}return await r({...s,request:{...i,headers:b,body:w}})},Bc=(e=[])=>{const t=[];for(const r of Km)!e.includes(r)||!fn.includes(r)||t.push(r);return t},ey=e=>{const t=e.lastIndexOf("-");if(t!==-1){const r=e.slice(t+1);if(!r.startsWith("0")){const n=parseInt(r,10);if(!isNaN(n)&&n>=1&&n<=1e4)return!0}}return!1};function Bo(e){return new Blob([e]).stream()}const ty=async(e,{streamHasher:t,checksumAlgorithmFn:r,base64Encoder:n})=>{const s=Zn(e)?t(r,e):$c(r,e);return n(await s)},ry=async(e,{config:t,responseAlgorithms:r})=>{const n=Bc(r),{body:s,headers:i}=e;for(const o of n){const a=Gn(o),c=i[a];if(c){const u=Uc(o,t),{streamHasher:d,base64Encoder:p}=t,f=await ty(s,{streamHasher:d,checksumAlgorithmFn:u,base64Encoder:p});if(f===c)break;throw new Error(`Checksum mismatch: expected "${f}" but received "${c}" in response header "${a}".`)}}},ny={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},sy=(e,t)=>(r,n)=>async s=>{if(!fe.isInstance(s.request))return r(s);const i=s.input,o=await r(s),a=o.response;let c;const{requestValidationModeMember:u,responseAlgorithms:d}=t;if(u&&i[u]==="ENABLED"){const{clientName:p,commandName:f}=n;if(p==="S3Client"&&f==="GetObjectCommand"&&Bc(d).every(w=>{const b=Gn(w),C=a.headers[b];return!C||ey(C)}))return o;const g=Zn(a.body);g&&(c=await e.streamCollector(a.body),a.body=Bo(c)),await ry(o.response,{config:e,responseAlgorithms:d}),g&&c&&(a.body=Bo(c))}return o},iy=(e,t)=>({applyToStack:r=>{r.add(Qm(e,t),Jm),r.addRelativeTo(sy(e,t),ny)}});class oy extends Sn.classBuilder().ep({...ka,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(t,r,n,s){return[ya(n,this.serialize,this.deserialize),wa(n,t.getEndpointParameterInstructions()),ol(),zm(n),iy(n,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1})]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(sf,nf).ser(af).de(uf).build(){}const ay=Dc.create({});async function cy(e,t,r){return e.getSignedUrl||console.error("请先配置uploader.getSignedUrl,该方法应该从后端获取签名url"),await e.getSignedUrl(e.bucket,t,e,r)}async function uy(e,t){const{file:r,onProgress:n,options:s}=e,i=await cy(s,t,"put"),o=decodeURIComponent(i);return await ay.put(o,r,{onUploadProgress:a=>{const{loaded:c,total:u}=a;n({percent:Math.round(c*100/u)})}})}async function ly(e){const{file:t,fileName:r,onProgress:n,options:s}=e,i=s,o=new jm({...(i==null?void 0:i.sdkOpts)||{}}),a=await Lc(t,r,i);async function c(){const u={url:i.sdkOpts.endpoint+"/"+i.bucket+"/"+a,key:a};return i.successHandle?await i.successHandle(u):u}if(i.getSignedUrl)await uy(e,a);else{const u={Bucket:i.bucket,Key:a};await o.send(new oy({Body:t,...u}))}return await c()}async function gy(e){const{getConfig:t}=jc(),r=t("s3"),n=e.options,s=Xn.merge(Xn.cloneDeep(r),n);return e.options=s,await ly(e)}export{cy as buildSignedUrl,gy as upload,uy as uploadUsingSignedUrl};