gemi 0.4.52 → 0.4.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-0113570164c56f57.js +2 -0
- package/dist/chunk-03a72299591d45a7.js +18 -0
- package/dist/chunk-03c8e645c994d40a.js +1 -1
- package/dist/chunk-0909c7f6b64b8806.js +2 -0
- package/dist/chunk-0d8ab901365b9696.js +2 -0
- package/dist/chunk-132c71db605759c9.js +1 -1
- package/dist/chunk-1900e90c372bb1d6.js +1 -1
- package/dist/chunk-2b3eabd01b2ae3f8.js +1 -1
- package/dist/chunk-2bfbc777c6995d9a.js +18 -0
- package/dist/chunk-2ecc077efab285b4.js +1 -1
- package/dist/chunk-412ad792487747bc.js +2 -0
- package/dist/chunk-4f01c5a98726e704.js +2 -0
- package/dist/chunk-5d3431e9686096af.js +18 -0
- package/dist/chunk-5e13846c554dc272.js +1 -1
- package/dist/chunk-60d70dcbf4e79276.js +2 -0
- package/dist/chunk-a210ec2b987fa5f7.js +2 -0
- package/dist/chunk-a7a144f5e4772c35.js +2 -0
- package/dist/chunk-abb2f588bd34adff.js +2 -0
- package/dist/chunk-ad8e7de66d8bf8c5.js +2 -0
- package/dist/chunk-b7f9e29074a9f36a.js +2 -0
- package/dist/chunk-b9f4c1fce7152fc8.js +1 -1
- package/dist/chunk-c609d06153ed09ce.js +1 -1
- package/dist/chunk-cf3d1744ea801f48.js +6 -0
- package/dist/chunk-dba84b47adec2108.js +2 -0
- package/dist/chunk-dfadfa4e09b4db22.js +2 -0
- package/dist/chunk-e05db2eae976681b.js +3 -0
- package/dist/chunk-e33c33445a92adf1.js +1 -0
- package/dist/chunk-e9c96f9b825f8de7.js +2 -0
- package/dist/chunk-f1ac22ad55dbab7a.js +9 -0
- package/dist/chunk-f74928c3f9ae5359.js +2 -0
- package/dist/chunk-f900b5868b14827e.js +1 -1
- package/dist/chunk-f9084650419a23c4.js +2 -0
- package/dist/client/QueryManager.d.ts +1 -1
- package/dist/client/QueryManager.d.ts.map +1 -1
- package/dist/client/auth/useForgotPassword.d.ts +1 -1
- package/dist/client/auth/useResetPassword.d.ts +1 -1
- package/dist/client/auth/useSignIn.d.ts +2 -2
- package/dist/client/auth/useSignOut.d.ts +1 -1
- package/dist/client/auth/useSignUp.d.ts +2 -2
- package/dist/client/index.js +42 -10
- package/dist/client/useQuery.d.ts +16 -7
- package/dist/client/useQuery.d.ts.map +1 -1
- package/dist/http/ApiRouter.d.ts.map +1 -1
- package/dist/storage/index.js +4 -4
- package/dist/utils/type.d.ts +8 -0
- package/dist/utils/type.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{y as X0,z as M} from"./chunk-7ce930fe69575c87.js";import{C as x,D as Pw,E as $R,F as EI,I as sw,J as t8,M as a8,Q as lG,T as CE} from"./chunk-f34a78d9e3a62c43.js";import{hb as Q0} from"./chunk-a0003b7feea6fae6.js";import{ib as Z0,jb as Ow} from"./chunk-4cb19a9e82653084.js";import{pb as G4} from"./chunk-ff086fe014985526.js";import{vb as Kw} from"./chunk-d26ffb7722e6df54.js";var n=M((G7,$U)=>{var{defineProperty:$1,getOwnPropertyDescriptor:z4,getOwnPropertyNames:Q4}=Object,M4=Object.prototype.hasOwnProperty,aw=($,w)=>$1($,"name",{value:w,configurable:!0}),J4=($,w)=>{for(var U in w)$1($,U,{get:w[U],enumerable:!0})},T4=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of Q4(w))if(!M4.call($,f)&&f!==U)$1($,f,{get:()=>w[f],enumerable:!(G=z4(w,f))||G.enumerable})}return $},K4=($)=>T4($1({},"__esModule",{value:!0}),$),ew={};J4(ew,{getSmithyContext:()=>O4,normalizeProvider:()=>A4});$U.exports=K4(ew);var tw=Q0(),O4=aw(($)=>$[tw.SMITHY_CONTEXT_KEY]||($[tw.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),A4=aw(($)=>{if(typeof $==="function")return $;const w=Promise.resolve($);return()=>w},"normalizeProvider")});var X$=M((E7,EU)=>{var{defineProperty:w1,getOwnPropertyDescriptor:B4,getOwnPropertyNames:V4}=Object,H4=Object.prototype.hasOwnProperty,E0=($,w)=>w1($,"name",{value:w,configurable:!0}),C4=($,w)=>{for(var U in w)w1($,U,{get:w[U],enumerable:!0})},N4=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of V4(w))if(!H4.call($,f)&&f!==U)w1($,f,{get:()=>w[f],enumerable:!(G=B4(w,f))||G.enumerable})}return $},q4=($)=>N4(w1({},"__esModule",{value:!0}),$),wU={};C4(wU,{CredentialsProviderError:()=>j4,ProviderError:()=>U1,TokenProviderError:()=>P4,chain:()=>S4,fromStatic:()=>b4,memoize:()=>h4});EU.exports=q4(wU);var UU=class $ extends Error{constructor(w,U=!0){var G;let f,E=!0;if(typeof U==="boolean")f=void 0,E=U;else if(U!=null&&typeof U==="object")f=U.logger,E=U.tryNextLink??!0;super(w);this.name="ProviderError",this.tryNextLink=E,Object.setPrototypeOf(this,$.prototype),(G=f==null?void 0:f.debug)==null||G.call(f,`@smithy/property-provider ${E?"->":"(!)"} ${w}`)}static from(w,U=!0){return Object.assign(new this(w.message,U),w)}};E0(UU,"ProviderError");var U1=UU,fU=class $ extends U1{constructor(w,U=!0){super(w,U);this.name="CredentialsProviderError",Object.setPrototypeOf(this,$.prototype)}};E0(fU,"CredentialsProviderError");var j4=fU,GU=class $ extends U1{constructor(w,U=!0){super(w,U);this.name="TokenProviderError",Object.setPrototypeOf(this,$.prototype)}};E0(GU,"TokenProviderError");var P4=GU,S4=E0((...$)=>async()=>{if($.length===0)throw new U1("No providers in chain");let w;for(let U of $)try{return await U()}catch(G){if(w=G,G==null?void 0:G.tryNextLink)continue;throw G}throw w},"chain"),b4=E0(($)=>()=>Promise.resolve($),"fromStatic"),h4=E0(($,w,U)=>{let G,f,E,W=!1;const L=E0(async()=>{if(!f)f=$();try{G=await f,E=!0,W=!1}finally{f=void 0}return G},"coalesceProvider");if(w===void 0)return async(R)=>{if(!E||(R==null?void 0:R.forceRefresh))G=await L();return G};return async(R)=>{if(!E||(R==null?void 0:R.forceRefresh))G=await L();if(W)return G;if(U&&!U(G))return W=!0,G;if(w(G))return await L(),G;return G}},"memoize")});var M0=M((WU)=>{Object.defineProperty(WU,"__esModule",{value:!0});WU.getHomeDir=void 0;var D4=import.meta.require("os"),k4=import.meta.require("path"),Z$={},c4=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},v4=()=>{const{HOME:$,USERPROFILE:w,HOMEPATH:U,HOMEDRIVE:G=`C:${k4.sep}`}=process.env;if($)return $;if(w)return w;if(U)return`${G}${U}`;const f=c4();if(!Z$[f])Z$[f]=D4.homedir();return Z$[f]};WU.getHomeDir=v4});var F$=M((RU)=>{Object.defineProperty(RU,"__esModule",{value:!0});RU.getSSOTokenFilepath=void 0;var x4=import.meta.require("crypto"),y4=import.meta.require("path"),u4=M0(),_4=($)=>{const U=x4.createHash("sha1").update($).digest("hex");return y4.join(u4.getHomeDir(),".aws","sso","cache",`${U}.json`)};RU.getSSOTokenFilepath=_4});var IU=M((ZU)=>{Object.defineProperty(ZU,"__esModule",{value:!0});ZU.getSSOTokenFromFile=void 0;var d4=import.meta.require("fs"),p4=F$(),{readFile:g4}=d4.promises,l4=async($)=>{const w=p4.getSSOTokenFilepath($),U=await g4(w,"utf8");return JSON.parse(U)};ZU.getSSOTokenFromFile=l4});var Y$=M((YU)=>{Object.defineProperty(YU,"__esModule",{value:!0});YU.slurpFile=void 0;var n4=import.meta.require("fs"),{readFile:s4}=n4.promises,I$={},m4=($,w)=>{if(!I$[$]||(w===null||w===void 0?void 0:w.ignoreCache))I$[$]=s4($,"utf8");return I$[$]};YU.slurpFile=m4});var J$=M((Z7,b0)=>{var{defineProperty:E1,getOwnPropertyDescriptor:i4,getOwnPropertyNames:r4}=Object,o4=Object.prototype.hasOwnProperty,y=($,w)=>E1($,"name",{value:w,configurable:!0}),t4=($,w)=>{for(var U in w)E1($,U,{get:w[U],enumerable:!0})},z$=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of r4(w))if(!o4.call($,f)&&f!==U)E1($,f,{get:()=>w[f],enumerable:!(G=i4(w,f))||G.enumerable})}return $},M$=($,w,U)=>(z$($,w,"default"),U&&z$(U,w,"default")),a4=($)=>z$(E1({},"__esModule",{value:!0}),$),S0={};t4(S0,{CONFIG_PREFIX_SEPARATOR:()=>W0,DEFAULT_PROFILE:()=>TU,ENV_PROFILE:()=>JU,getProfileName:()=>e4,loadSharedConfigFiles:()=>OU,loadSsoSessionData:()=>I6,parseKnownFiles:()=>z6});b0.exports=a4(S0);M$(S0,M0(),b0.exports);var JU="AWS_PROFILE",TU="default",e4=y(($)=>$.profile||process.env[JU]||TU,"getProfileName");M$(S0,F$(),b0.exports);M$(S0,IU(),b0.exports);var f1=Q0(),$6=y(($)=>Object.entries($).filter(([w])=>{const U=w.indexOf(W0);if(U===-1)return!1;return Object.values(f1.IniSectionType).includes(w.substring(0,U))}).reduce((w,[U,G])=>{const f=U.indexOf(W0),E=U.substring(0,f)===f1.IniSectionType.PROFILE?U.substring(f+1):U;return w[E]=G,w},{...$.default&&{default:$.default}}),"getConfigData"),G1=import.meta.require("path"),w6=M0(),U6="AWS_CONFIG_FILE",KU=y(()=>process.env[U6]||G1.join(w6.getHomeDir(),".aws","config"),"getConfigFilepath"),f6=M0(),G6="AWS_SHARED_CREDENTIALS_FILE",E6=y(()=>process.env[G6]||G1.join(f6.getHomeDir(),".aws","credentials"),"getCredentialsFilepath"),W6=M0(),L6=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,R6=["__proto__","profile __proto__"],Q$=y(($)=>{const w={};let U,G;for(let f of $.split(/\r?\n/)){const E=f.split(/(^|\s)[;#]/)[0].trim();if(E[0]==="["&&E[E.length-1]==="]"){U=void 0,G=void 0;const L=E.substring(1,E.length-1),R=L6.exec(L);if(R){const[,X,,Z]=R;if(Object.values(f1.IniSectionType).includes(X))U=[X,Z].join(W0)}else U=L;if(R6.includes(L))throw new Error(`Found invalid profile name "${L}"`)}else if(U){const L=E.indexOf("=");if(![0,-1].includes(L)){const[R,X]=[E.substring(0,L).trim(),E.substring(L+1).trim()];if(X==="")G=R;else{if(G&&f.trimStart()===f)G=void 0;w[U]=w[U]||{};const Z=G?[G,R].join(W0):R;w[U][Z]=X}}}}return w},"parseIni"),QU=Y$(),MU=y(()=>({}),"swallowError"),W0=".",OU=y(async($={})=>{const{filepath:w=E6(),configFilepath:U=KU()}=$,G=W6.getHomeDir();let E=w;if(w.startsWith("~/"))E=G1.join(G,w.slice(2));let W=U;if(U.startsWith("~/"))W=G1.join(G,U.slice(2));const L=await Promise.all([QU.slurpFile(W,{ignoreCache:$.ignoreCache}).then(Q$).then($6).catch(MU),QU.slurpFile(E,{ignoreCache:$.ignoreCache}).then(Q$).catch(MU)]);return{configFile:L[0],credentialsFile:L[1]}},"loadSharedConfigFiles"),X6=y(($)=>Object.entries($).filter(([w])=>w.startsWith(f1.IniSectionType.SSO_SESSION+W0)).reduce((w,[U,G])=>({...w,[U.substring(U.indexOf(W0)+1)]:G}),{}),"getSsoSessionData"),Z6=Y$(),F6=y(()=>({}),"swallowError"),I6=y(async($={})=>Z6.slurpFile($.configFilepath??KU()).then(Q$).then(X6).catch(F6),"loadSsoSessionData"),Y6=y((...$)=>{const w={};for(let U of $)for(let[G,f]of Object.entries(U))if(w[G]!==void 0)Object.assign(w[G],f);else w[G]=f;return w},"mergeConfigFiles"),z6=y(async($)=>{const w=await OU($);return Y6(w.configFile,w.credentialsFile)},"parseKnownFiles")});var HU=M((F7,VU)=>{var T$=function($){try{const w=new Set(Array.from($.match(/([A-Z_]){3,}/g)??[]));return w.delete("CONFIG"),w.delete("CONFIG_PREFIX_SEPARATOR"),w.delete("ENV"),[...w].join(", ")}catch(w){return $}},W1=Object.defineProperty,Q6=Object.getOwnPropertyDescriptor,M6=Object.getOwnPropertyNames,J6=Object.prototype.hasOwnProperty,J0=($,w)=>W1($,"name",{value:w,configurable:!0}),T6=($,w)=>{for(var U in w)W1($,U,{get:w[U],enumerable:!0})},K6=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of M6(w))if(!J6.call($,f)&&f!==U)W1($,f,{get:()=>w[f],enumerable:!(G=Q6(w,f))||G.enumerable})}return $},O6=($)=>K6(W1({},"__esModule",{value:!0}),$),BU={};T6(BU,{loadConfig:()=>C6});VU.exports=O6(BU);var h0=X$();J0(T$,"getSelectorName");var A6=J0(($,w)=>async()=>{try{const U=$(process.env);if(U===void 0)throw new Error;return U}catch(U){throw new h0.CredentialsProviderError(U.message||`Not found in ENV: ${T$($.toString())}`,{logger:w})}},"fromEnv"),AU=J$(),B6=J0(($,{preferredFile:w="config",...U}={})=>async()=>{const G=AU.getProfileName(U),{configFile:f,credentialsFile:E}=await AU.loadSharedConfigFiles(U),W=E[G]||{},L=f[G]||{},R=w==="config"?{...W,...L}:{...L,...W};try{const Z=$(R,w==="config"?f:E);if(Z===void 0)throw new Error;return Z}catch(X){throw new h0.CredentialsProviderError(X.message||`Not found in config files w/ profile [${G}]: ${T$($.toString())}`,{logger:U.logger})}},"fromSharedConfigFiles"),V6=J0(($)=>typeof $==="function","isFunction"),H6=J0(($)=>V6($)?async()=>await $():h0.fromStatic($),"fromStatic"),C6=J0(({environmentVariableSelector:$,configFileSelector:w,default:U},G={})=>h0.memoize(h0.chain(A6($),B6(w,G),H6(U))),"loadConfig")});var SU=M((jU)=>{Object.defineProperty(jU,"__esModule",{value:!0});jU.getEndpointUrlConfig=void 0;var CU=J$(),NU="AWS_ENDPOINT_URL",qU="endpoint_url",N6=($)=>({environmentVariableSelector:(w)=>{const U=$.split(" ").map((E)=>E.toUpperCase()),G=w[[NU,...U].join("_")];if(G)return G;const f=w[NU];if(f)return f;return},configFileSelector:(w,U)=>{if(U&&w.services){const f=U[["services",w.services].join(CU.CONFIG_PREFIX_SEPARATOR)];if(f){const E=$.split(" ").map((L)=>L.toLowerCase()),W=f[[E.join("_"),qU].join(CU.CONFIG_PREFIX_SEPARATOR)];if(W)return W}}const G=w[qU];if(G)return G;return},default:void 0});jU.getEndpointUrlConfig=N6});var DU=M((bU)=>{Object.defineProperty(bU,"__esModule",{value:!0});bU.getEndpointFromConfig=void 0;var q6=HU(),j6=SU(),P6=async($)=>q6.loadConfig(j6.getEndpointUrlConfig($))();bU.getEndpointFromConfig=P6});var xU=M((z7,vU)=>{var cU=function($){const w={};if($=$.replace(/^\?/,""),$)for(let U of $.split("&")){let[G,f=null]=U.split("=");if(G=decodeURIComponent(G),f)f=decodeURIComponent(f);if(!(G in w))w[G]=f;else if(Array.isArray(w[G]))w[G].push(f);else w[G]=[w[G],f]}return w},L1=Object.defineProperty,S6=Object.getOwnPropertyDescriptor,b6=Object.getOwnPropertyNames,h6=Object.prototype.hasOwnProperty,D6=($,w)=>L1($,"name",{value:w,configurable:!0}),k6=($,w)=>{for(var U in w)L1($,U,{get:w[U],enumerable:!0})},c6=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of b6(w))if(!h6.call($,f)&&f!==U)L1($,f,{get:()=>w[f],enumerable:!(G=S6(w,f))||G.enumerable})}return $},v6=($)=>c6(L1({},"__esModule",{value:!0}),$),kU={};k6(kU,{parseQueryString:()=>cU});vU.exports=v6(kU);D6(cU,"parseQueryString")});var dU=M((Q7,_U)=>{var{defineProperty:R1,getOwnPropertyDescriptor:x6,getOwnPropertyNames:y6}=Object,u6=Object.prototype.hasOwnProperty,_6=($,w)=>R1($,"name",{value:w,configurable:!0}),d6=($,w)=>{for(var U in w)R1($,U,{get:w[U],enumerable:!0})},p6=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of y6(w))if(!u6.call($,f)&&f!==U)R1($,f,{get:()=>w[f],enumerable:!(G=x6(w,f))||G.enumerable})}return $},g6=($)=>p6(R1({},"__esModule",{value:!0}),$),yU={};d6(yU,{parseUrl:()=>uU});_U.exports=g6(yU);var l6=xU(),uU=_6(($)=>{if(typeof $==="string")return uU(new URL($));const{hostname:w,pathname:U,port:G,protocol:f,search:E}=$;let W;if(E)W=l6.parseQueryString(E);return{hostname:w,port:G?parseInt(G):void 0,protocol:f,path:U,query:W}},"parseUrl")});var O$=M((M7,iU)=>{var mU=function($,w,U){return{applyToStack:(G)=>{G.add(gU($,U),nU),G.add(lU($,w),sU)}}},X1=Object.defineProperty,n6=Object.getOwnPropertyDescriptor,s6=Object.getOwnPropertyNames,m6=Object.prototype.hasOwnProperty,K$=($,w)=>X1($,"name",{value:w,configurable:!0}),i6=($,w)=>{for(var U in w)X1($,U,{get:w[U],enumerable:!0})},r6=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of s6(w))if(!m6.call($,f)&&f!==U)X1($,f,{get:()=>w[f],enumerable:!(G=n6(w,f))||G.enumerable})}return $},o6=($)=>r6(X1({},"__esModule",{value:!0}),$),pU={};i6(pU,{deserializerMiddleware:()=>gU,deserializerMiddlewareOption:()=>nU,getSerdePlugin:()=>mU,serializerMiddleware:()=>lU,serializerMiddlewareOption:()=>sU});iU.exports=o6(pU);var gU=K$(($,w)=>(U)=>async(G)=>{const{response:f}=await U(G);try{const E=await w(f,$);return{response:f,output:E}}catch(E){if(Object.defineProperty(E,"$response",{value:f}),!("$metadata"in E)){if(E.message+="\n Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.",typeof E.$responseBodyText!=="undefined"){if(E.$response)E.$response.body=E.$responseBodyText}}throw E}},"deserializerMiddleware"),lU=K$(($,w)=>(U,G)=>async(f)=>{var E;const W=((E=G.endpointV2)==null?void 0:E.url)&&$.urlParser?async()=>$.urlParser(G.endpointV2.url):$.endpoint;if(!W)throw new Error("No valid endpoint provider available.");const L=await w(f.input,{...$,endpoint:W});return U({...f,request:L})},"serializerMiddleware"),nU={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},sU={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};K$(mU,"getSerdePlugin")});var Uf=M((J7,wf)=>{var{defineProperty:F1,getOwnPropertyDescriptor:t6,getOwnPropertyNames:a6}=Object,e6=Object.prototype.hasOwnProperty,d=($,w)=>F1($,"name",{value:w,configurable:!0}),$X=($,w)=>{for(var U in w)F1($,U,{get:w[U],enumerable:!0})},wX=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of a6(w))if(!e6.call($,f)&&f!==U)F1($,f,{get:()=>w[f],enumerable:!(G=t6(w,f))||G.enumerable})}return $},UX=($)=>wX(F1({},"__esModule",{value:!0}),$),oU={};$X(oU,{endpointMiddleware:()=>eU,endpointMiddlewareOptions:()=>$f,getEndpointFromInstructions:()=>tU,getEndpointPlugin:()=>IX,resolveEndpointConfig:()=>YX,resolveParams:()=>aU,toEndpointV1:()=>A$});wf.exports=UX(oU);var fX=d(async($)=>{const w=($==null?void 0:$.Bucket)||"";if(typeof $.Bucket==="string")$.Bucket=w.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(RX(w)){if($.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!LX(w)||w.indexOf(".")!==-1&&!String($.Endpoint).startsWith("http:")||w.toLowerCase()!==w||w.length<3)$.ForcePathStyle=!0;if($.DisableMultiRegionAccessPoints)$.disableMultiRegionAccessPoints=!0,$.DisableMRAP=!0;return $},"resolveParamsForS3"),GX=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,EX=/(\d+\.){3}\d+/,WX=/\.\./,LX=d(($)=>GX.test($)&&!EX.test($)&&!WX.test($),"isDnsCompatibleBucketName"),RX=d(($)=>{const[w,U,G,,,f]=$.split(":"),E=w==="arn"&&$.split(":").length>=6,W=Boolean(E&&U&&G&&f);if(E&&!W)throw new Error(`Invalid ARN: ${$} was an invalid ARN.`);return W},"isArnBucketName"),XX=d(($,w,U)=>{const G=d(async()=>{const f=U[$]??U[w];if(typeof f==="function")return f();return f},"configProvider");if($==="credentialScope"||w==="CredentialScope")return async()=>{const f=typeof U.credentials==="function"?await U.credentials():U.credentials;return(f==null?void 0:f.credentialScope)??(f==null?void 0:f.CredentialScope)};if($==="accountId"||w==="AccountId")return async()=>{const f=typeof U.credentials==="function"?await U.credentials():U.credentials;return(f==null?void 0:f.accountId)??(f==null?void 0:f.AccountId)};if($==="endpoint"||w==="endpoint")return async()=>{const f=await G();if(f&&typeof f==="object"){if("url"in f)return f.url.href;if("hostname"in f){const{protocol:E,hostname:W,port:L,path:R}=f;return`${E}//${W}${L?":"+L:""}${R}`}}return f};return G},"createConfigValueProvider"),ZX=DU(),rU=dU(),A$=d(($)=>{if(typeof $==="object"){if("url"in $)return rU.parseUrl($.url);return $}return rU.parseUrl($)},"toEndpointV1"),tU=d(async($,w,U,G)=>{if(!U.endpoint){const W=await ZX.getEndpointFromConfig(U.serviceId||"");if(W)U.endpoint=()=>Promise.resolve(A$(W))}const f=await aU($,w,U);if(typeof U.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return U.endpointProvider(f,G)},"getEndpointFromInstructions"),aU=d(async($,w,U)=>{var G;const f={},E=((G=w==null?void 0:w.getEndpointParameterInstructions)==null?void 0:G.call(w))||{};for(let[W,L]of Object.entries(E))switch(L.type){case"staticContextParams":f[W]=L.value;break;case"contextParams":f[W]=$[L.name];break;case"clientContextParams":case"builtInParams":f[W]=await XX(L.name,W,U)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(L))}if(Object.keys(E).length===0)Object.assign(f,U);if(String(U.serviceId).toLowerCase()==="s3")await fX(f);return f},"resolveParams"),Z1=n(),eU=d(({config:$,instructions:w})=>{return(U,G)=>async(f)=>{var E,W,L;const R=await tU(f.input,{getEndpointParameterInstructions(){return w}},{...$},G);G.endpointV2=R,G.authSchemes=(E=R.properties)==null?void 0:E.authSchemes;const X=(W=G.authSchemes)==null?void 0:W[0];if(X){G.signing_region=X.signingRegion,G.signing_service=X.signingName;const Z=Z1.getSmithyContext(G),F=(L=Z==null?void 0:Z.selectedHttpAuthScheme)==null?void 0:L.httpAuthOption;if(F)F.signingProperties=Object.assign(F.signingProperties||{},{signing_region:X.signingRegion,signingRegion:X.signingRegion,signing_service:X.signingName,signingName:X.signingName,signingRegionSet:X.signingRegionSet},X.properties)}return U({...f})}},"endpointMiddleware"),FX=O$(),$f={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:FX.serializerMiddlewareOption.name},IX=d(($,w)=>({applyToStack:(U)=>{U.addRelativeTo(eU({config:$,instructions:w}),$f)}}),"getEndpointPlugin"),YX=d(($)=>{const w=$.tls??!0,{endpoint:U}=$,G=U!=null?async()=>A$(await Z1.normalizeProvider(U)()):void 0;return{...$,endpoint:G,tls:w,isCustomEndpoint:!!U,useDualstackEndpoint:Z1.normalizeProvider($.useDualstackEndpoint??!1),useFipsEndpoint:Z1.normalizeProvider($.useFipsEndpoint??!1)}},"resolveEndpointConfig")});var i=M((T7,Ff)=>{var Rf=function($){return Object.keys($).reduce((w,U)=>{const G=$[U];return{...w,[U]:Array.isArray(G)?[...G]:G}},{})},Zf=function($){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test($)},I1=Object.defineProperty,zX=Object.getOwnPropertyDescriptor,QX=Object.getOwnPropertyNames,MX=Object.prototype.hasOwnProperty,a=($,w)=>I1($,"name",{value:w,configurable:!0}),JX=($,w)=>{for(var U in w)I1($,U,{get:w[U],enumerable:!0})},TX=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of QX(w))if(!MX.call($,f)&&f!==U)I1($,f,{get:()=>w[f],enumerable:!(G=zX(w,f))||G.enumerable})}return $},KX=($)=>TX(I1({},"__esModule",{value:!0}),$),ff={};JX(ff,{Field:()=>BX,Fields:()=>VX,HttpRequest:()=>HX,HttpResponse:()=>CX,IHttpRequest:()=>Gf.HttpRequest,getHttpHandlerExtensionConfiguration:()=>OX,isValidHostname:()=>Zf,resolveHttpHandlerRuntimeConfig:()=>AX});Ff.exports=KX(ff);var OX=a(($)=>{let w=$.httpHandler;return{setHttpHandler(U){w=U},httpHandler(){return w},updateHttpClientConfig(U,G){w.updateHttpClientConfig(U,G)},httpHandlerConfigs(){return w.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),AX=a(($)=>{return{httpHandler:$.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),Gf=Q0(),Ef=class ${constructor({name:w,kind:U=Gf.FieldPosition.HEADER,values:G=[]}){this.name=w,this.kind=U,this.values=G}add(w){this.values.push(w)}set(w){this.values=w}remove(w){this.values=this.values.filter((U)=>U!==w)}toString(){return this.values.map((w)=>w.includes(",")||w.includes(" ")?`"${w}"`:w).join(", ")}get(){return this.values}};a(Ef,"Field");var BX=Ef,Wf=class ${constructor({fields:w=[],encoding:U="utf-8"}){this.entries={},w.forEach(this.setField.bind(this)),this.encoding=U}setField(w){this.entries[w.name.toLowerCase()]=w}getField(w){return this.entries[w.toLowerCase()]}removeField(w){delete this.entries[w.toLowerCase()]}getByType(w){return Object.values(this.entries).filter((U)=>U.kind===w)}};a(Wf,"Fields");var VX=Wf,Lf=class ${constructor(w){this.method=w.method||"GET",this.hostname=w.hostname||"localhost",this.port=w.port,this.query=w.query||{},this.headers=w.headers||{},this.body=w.body,this.protocol=w.protocol?w.protocol.slice(-1)!==":"?`${w.protocol}:`:w.protocol:"https:",this.path=w.path?w.path.charAt(0)!=="/"?`/${w.path}`:w.path:"/",this.username=w.username,this.password=w.password,this.fragment=w.fragment}static clone(w){const U=new $({...w,headers:{...w.headers}});if(U.query)U.query=Rf(U.query);return U}static isInstance(w){if(!w)return!1;const U=w;return"method"in U&&"protocol"in U&&"hostname"in U&&"path"in U&&typeof U.query==="object"&&typeof U.headers==="object"}clone(){return $.clone(this)}};a(Lf,"HttpRequest");var HX=Lf;a(Rf,"cloneQuery");var Xf=class ${constructor(w){this.statusCode=w.statusCode,this.reason=w.reason,this.headers=w.headers||{},this.body=w.body}static isInstance(w){if(!w)return!1;const U=w;return typeof U.statusCode==="number"&&typeof U.headers==="object"}};a(Xf,"HttpResponse");var CX=Xf;a(Zf,"isValidHostname")});var B$=M((If)=>{var qX=function($){return $&&$.__esModule?$:{default:$}},jX=function(){if(Y1>z1.length-16)NX.default.randomFillSync(z1),Y1=0;return z1.slice(Y1,Y1+=16)};Object.defineProperty(If,"__esModule",{value:!0});If.default=jX;var NX=qX(import.meta.require("crypto")),z1=new Uint8Array(256),Y1=z1.length});var Qf=M((Yf)=>{Object.defineProperty(Yf,"__esModule",{value:!0});Yf.default=void 0;var SX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;Yf.default=SX});var D0=M((Mf)=>{var hX=function($){return $&&$.__esModule?$:{default:$}},DX=function($){return typeof $==="string"&&bX.default.test($)};Object.defineProperty(Mf,"__esModule",{value:!0});Mf.default=void 0;var bX=hX(Qf()),kX=DX;Mf.default=kX});var k0=M((Kf)=>{var vX=function($){return $&&$.__esModule?$:{default:$}},Tf=function($,w=0){return h[$[w+0]]+h[$[w+1]]+h[$[w+2]]+h[$[w+3]]+"-"+h[$[w+4]]+h[$[w+5]]+"-"+h[$[w+6]]+h[$[w+7]]+"-"+h[$[w+8]]+h[$[w+9]]+"-"+h[$[w+10]]+h[$[w+11]]+h[$[w+12]]+h[$[w+13]]+h[$[w+14]]+h[$[w+15]]},xX=function($,w=0){const U=Tf($,w);if(!cX.default(U))throw TypeError("Stringified UUID is invalid");return U};Object.defineProperty(Kf,"__esModule",{value:!0});Kf.default=void 0;Kf.unsafeStringify=Tf;var cX=vX(D0()),h=[];for(let $=0;$<256;++$)h.push(($+256).toString(16).slice(1));var yX=xX;Kf.default=yX});var Hf=M((Bf)=>{var pX=function($){return $&&$.__esModule?$:{default:$}},gX=function($,w,U){let G=w&&U||0;const f=w||new Array(16);$=$||{};let E=$.node||Af,W=$.clockseq!==void 0?$.clockseq:V$;if(E==null||W==null){const Y=$.random||($.rng||_X.default)();if(E==null)E=Af=[Y[0]|1,Y[1],Y[2],Y[3],Y[4],Y[5]];if(W==null)W=V$=(Y[6]<<8|Y[7])&16383}let L=$.msecs!==void 0?$.msecs:Date.now(),R=$.nsecs!==void 0?$.nsecs:C$+1;const X=L-H$+(R-C$)/1e4;if(X<0&&$.clockseq===void 0)W=W+1&16383;if((X<0||L>H$)&&$.nsecs===void 0)R=0;if(R>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");H$=L,C$=R,V$=W,L+=12219292800000;const Z=((L&268435455)*1e4+R)%4294967296;f[G++]=Z>>>24&255,f[G++]=Z>>>16&255,f[G++]=Z>>>8&255,f[G++]=Z&255;const F=L/4294967296*1e4&268435455;f[G++]=F>>>8&255,f[G++]=F&255,f[G++]=F>>>24&15|16,f[G++]=F>>>16&255,f[G++]=W>>>8|128,f[G++]=W&255;for(let Y=0;Y<6;++Y)f[G+Y]=E[Y];return w||dX.unsafeStringify(f)};Object.defineProperty(Bf,"__esModule",{value:!0});Bf.default=void 0;var _X=pX(B$()),dX=k0(),Af,V$,H$=0,C$=0,lX=gX;Bf.default=lX});var N$=M((Cf)=>{var sX=function($){return $&&$.__esModule?$:{default:$}},mX=function($){if(!nX.default($))throw TypeError("Invalid UUID");let w;const U=new Uint8Array(16);return U[0]=(w=parseInt($.slice(0,8),16))>>>24,U[1]=w>>>16&255,U[2]=w>>>8&255,U[3]=w&255,U[4]=(w=parseInt($.slice(9,13),16))>>>8,U[5]=w&255,U[6]=(w=parseInt($.slice(14,18),16))>>>8,U[7]=w&255,U[8]=(w=parseInt($.slice(19,23),16))>>>8,U[9]=w&255,U[10]=(w=parseInt($.slice(24,36),16))/1099511627776&255,U[11]=w/4294967296&255,U[12]=w>>>24&255,U[13]=w>>>16&255,U[14]=w>>>8&255,U[15]=w&255,U};Object.defineProperty(Cf,"__esModule",{value:!0});Cf.default=void 0;var nX=sX(D0()),iX=mX;Cf.default=iX});var q$=M((Pf)=>{var tX=function($){return $&&$.__esModule?$:{default:$}},aX=function($){$=unescape(encodeURIComponent($));const w=[];for(let U=0;U<$.length;++U)w.push($.charCodeAt(U));return w},eX=function($,w,U){function G(f,E,W,L){var R;if(typeof f==="string")f=aX(f);if(typeof E==="string")E=oX.default(E);if(((R=E)===null||R===void 0?void 0:R.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let X=new Uint8Array(16+f.length);if(X.set(E),X.set(f,E.length),X=U(X),X[6]=X[6]&15|w,X[8]=X[8]&63|128,W){L=L||0;for(let Z=0;Z<16;++Z)W[L+Z]=X[Z];return W}return rX.unsafeStringify(X)}try{G.name=$}catch(f){}return G.DNS=qf,G.URL=jf,G};Object.defineProperty(Pf,"__esModule",{value:!0});Pf.URL=Pf.DNS=void 0;Pf.default=eX;var rX=k0(),oX=tX(N$()),qf="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Pf.DNS=qf;var jf="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Pf.URL=jf});var Df=M((bf)=>{var f2=function($){return $&&$.__esModule?$:{default:$}},G2=function($){if(Array.isArray($))$=Buffer.from($);else if(typeof $==="string")$=Buffer.from($,"utf8");return U2.default.createHash("md5").update($).digest()};Object.defineProperty(bf,"__esModule",{value:!0});bf.default=void 0;var U2=f2(import.meta.require("crypto")),E2=G2;bf.default=E2});var xf=M((cf)=>{var kf=function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(cf,"__esModule",{value:!0});cf.default=void 0;var W2=kf(q$()),L2=kf(Df()),R2=W2.default("v3",48,L2.default),X2=R2;cf.default=X2});var _f=M((yf)=>{var F2=function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(yf,"__esModule",{value:!0});yf.default=void 0;var Z2=F2(import.meta.require("crypto")),I2={randomUUID:Z2.default.randomUUID};yf.default=I2});var nf=M((gf)=>{var pf=function($){return $&&$.__esModule?$:{default:$}},Q2=function($,w,U){if(df.default.randomUUID&&!w&&!$)return df.default.randomUUID();$=$||{};const G=$.random||($.rng||Y2.default)();if(G[6]=G[6]&15|64,G[8]=G[8]&63|128,w){U=U||0;for(let f=0;f<16;++f)w[U+f]=G[f];return w}return z2.unsafeStringify(G)};Object.defineProperty(gf,"__esModule",{value:!0});gf.default=void 0;var df=pf(_f()),Y2=pf(B$()),z2=k0(),M2=Q2;gf.default=M2});var rf=M((sf)=>{var T2=function($){return $&&$.__esModule?$:{default:$}},K2=function($){if(Array.isArray($))$=Buffer.from($);else if(typeof $==="string")$=Buffer.from($,"utf8");return J2.default.createHash("sha1").update($).digest()};Object.defineProperty(sf,"__esModule",{value:!0});sf.default=void 0;var J2=T2(import.meta.require("crypto")),O2=K2;sf.default=O2});var ef=M((tf)=>{var of=function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(tf,"__esModule",{value:!0});tf.default=void 0;var A2=of(q$()),B2=of(rf()),V2=A2.default("v5",80,B2.default),H2=V2;tf.default=H2});var UG=M(($G)=>{Object.defineProperty($G,"__esModule",{value:!0});$G.default=void 0;var C2="00000000-0000-0000-0000-000000000000";$G.default=C2});var EG=M((fG)=>{var q2=function($){return $&&$.__esModule?$:{default:$}},j2=function($){if(!N2.default($))throw TypeError("Invalid UUID");return parseInt($.slice(14,15),16)};Object.defineProperty(fG,"__esModule",{value:!0});fG.default=void 0;var N2=q2(D0()),P2=j2;fG.default=P2});var j$=M((p)=>{var r=function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(p,"__esModule",{value:!0});Object.defineProperty(p,"NIL",{enumerable:!0,get:function(){return k2.default}});Object.defineProperty(p,"parse",{enumerable:!0,get:function(){return y2.default}});Object.defineProperty(p,"stringify",{enumerable:!0,get:function(){return x2.default}});Object.defineProperty(p,"v1",{enumerable:!0,get:function(){return S2.default}});Object.defineProperty(p,"v3",{enumerable:!0,get:function(){return b2.default}});Object.defineProperty(p,"v4",{enumerable:!0,get:function(){return h2.default}});Object.defineProperty(p,"v5",{enumerable:!0,get:function(){return D2.default}});Object.defineProperty(p,"validate",{enumerable:!0,get:function(){return v2.default}});Object.defineProperty(p,"version",{enumerable:!0,get:function(){return c2.default}});var S2=r(Hf()),b2=r(xf()),h2=r(nf()),D2=r(ef()),k2=r(UG()),c2=r(EG()),v2=r(D0()),x2=r(k0()),y2=r(N$())});var P$=M((c7,XG)=>{var{defineProperty:Q1,getOwnPropertyDescriptor:u2,getOwnPropertyNames:_2}=Object,d2=Object.prototype.hasOwnProperty,T0=($,w)=>Q1($,"name",{value:w,configurable:!0}),p2=($,w)=>{for(var U in w)Q1($,U,{get:w[U],enumerable:!0})},g2=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of _2(w))if(!d2.call($,f)&&f!==U)Q1($,f,{get:()=>w[f],enumerable:!(G=u2(w,f))||G.enumerable})}return $},l2=($)=>g2(Q1({},"__esModule",{value:!0}),$),WG={};p2(WG,{isClockSkewCorrectedError:()=>LG,isClockSkewError:()=>t2,isRetryableByTrait:()=>o2,isServerError:()=>e2,isThrottlingError:()=>a2,isTransientError:()=>RG});XG.exports=l2(WG);var n2=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],s2=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],m2=["TimeoutError","RequestTimeout","RequestTimeoutException"],i2=[500,502,503,504],r2=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],o2=T0(($)=>$.$retryable!==void 0,"isRetryableByTrait"),t2=T0(($)=>n2.includes($.name),"isClockSkewError"),LG=T0(($)=>{var w;return(w=$.$metadata)==null?void 0:w.clockSkewCorrected},"isClockSkewCorrectedError"),a2=T0(($)=>{var w,U;return((w=$.$metadata)==null?void 0:w.httpStatusCode)===429||s2.includes($.name)||((U=$.$retryable)==null?void 0:U.throttling)==!0},"isThrottlingError"),RG=T0(($)=>{var w;return LG($)||m2.includes($.name)||r2.includes(($==null?void 0:$.code)||"")||i2.includes(((w=$.$metadata)==null?void 0:w.httpStatusCode)||0)},"isTransientError"),e2=T0(($)=>{var w;if(((w=$.$metadata)==null?void 0:w.httpStatusCode)!==void 0){const U=$.$metadata.httpStatusCode;if(500<=U&&U<=599&&!RG($))return!0;return!1}return!1},"isServerError")});var VG=M((v7,BG)=>{var{defineProperty:M1,getOwnPropertyDescriptor:$Z,getOwnPropertyNames:wZ}=Object,UZ=Object.prototype.hasOwnProperty,g=($,w)=>M1($,"name",{value:w,configurable:!0}),fZ=($,w)=>{for(var U in w)M1($,U,{get:w[U],enumerable:!0})},GZ=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of wZ(w))if(!UZ.call($,f)&&f!==U)M1($,f,{get:()=>w[f],enumerable:!(G=$Z(w,f))||G.enumerable})}return $},EZ=($)=>GZ(M1({},"__esModule",{value:!0}),$),FG={};fZ(FG,{AdaptiveRetryStrategy:()=>FZ,ConfiguredRetryStrategy:()=>IZ,DEFAULT_MAX_ATTEMPTS:()=>S$,DEFAULT_RETRY_DELAY_BASE:()=>c0,DEFAULT_RETRY_MODE:()=>WZ,DefaultRateLimiter:()=>zG,INITIAL_RETRY_TOKENS:()=>b$,INVOCATION_ID_HEADER:()=>RZ,MAXIMUM_RETRY_DELAY:()=>h$,NO_RETRY_INCREMENT:()=>TG,REQUEST_HEADER:()=>XZ,RETRY_COST:()=>MG,RETRY_MODES:()=>IG,StandardRetryStrategy:()=>D$,THROTTLING_RETRY_DELAY_BASE:()=>QG,TIMEOUT_RETRY_COST:()=>JG});BG.exports=EZ(FG);var IG=(($)=>{return $.STANDARD="standard",$.ADAPTIVE="adaptive",$})(IG||{}),S$=3,WZ="standard",LZ=P$(),YG=class ${constructor(w){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=(w==null?void 0:w.beta)??0.7,this.minCapacity=(w==null?void 0:w.minCapacity)??1,this.minFillRate=(w==null?void 0:w.minFillRate)??0.5,this.scaleConstant=(w==null?void 0:w.scaleConstant)??0.4,this.smooth=(w==null?void 0:w.smooth)??0.8;const U=this.getCurrentTimeInSeconds();this.lastThrottleTime=U,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1000}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(w){if(!this.enabled)return;if(this.refillTokenBucket(),w>this.currentCapacity){const U=(w-this.currentCapacity)/this.fillRate*1000;await new Promise((G)=>setTimeout(G,U))}this.currentCapacity=this.currentCapacity-w}refillTokenBucket(){const w=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=w;return}const U=(w-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+U),this.lastTimestamp=w}updateClientSendingRate(w){let U;if(this.updateMeasuredRate(),LZ.isThrottlingError(w)){const f=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=f,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),U=this.cubicThrottle(f),this.enableTokenBucket()}else this.calculateTimeWindow(),U=this.cubicSuccess(this.getCurrentTimeInSeconds());const G=Math.min(U,2*this.measuredTxRate);this.updateTokenBucketRate(G)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(w){return this.getPrecise(w*this.beta)}cubicSuccess(w){return this.getPrecise(this.scaleConstant*Math.pow(w-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(w){this.refillTokenBucket(),this.fillRate=Math.max(w,this.minFillRate),this.maxCapacity=Math.max(w,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const w=this.getCurrentTimeInSeconds(),U=Math.floor(w*2)/2;if(this.requestCount++,U>this.lastTxRateBucket){const G=this.requestCount/(U-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(G*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=U}}getPrecise(w){return parseFloat(w.toFixed(8))}};g(YG,"DefaultRateLimiter");var zG=YG,c0=100,h$=20000,QG=500,b$=500,MG=5,JG=10,TG=1,RZ="amz-sdk-invocation-id",XZ="amz-sdk-request",ZZ=g(()=>{let $=c0;return{computeNextBackoffDelay:g((G)=>{return Math.floor(Math.min(h$,Math.random()*2**G*$))},"computeNextBackoffDelay"),setDelayBase:g((G)=>{$=G},"setDelayBase")}},"getDefaultRetryBackoffStrategy"),ZG=g(({retryDelay:$,retryCount:w,retryCost:U})=>{return{getRetryCount:g(()=>w,"getRetryCount"),getRetryDelay:g(()=>Math.min(h$,$),"getRetryDelay"),getRetryCost:g(()=>U,"getRetryCost")}},"createDefaultRetryToken"),KG=class ${constructor(w){this.maxAttempts=w,this.mode="standard",this.capacity=b$,this.retryBackoffStrategy=ZZ(),this.maxAttemptsProvider=typeof w==="function"?w:async()=>w}async acquireInitialRetryToken(w){return ZG({retryDelay:c0,retryCount:0})}async refreshRetryTokenForRetry(w,U){const G=await this.getMaxAttempts();if(this.shouldRetry(w,U,G)){const f=U.errorType;this.retryBackoffStrategy.setDelayBase(f==="THROTTLING"?QG:c0);const E=this.retryBackoffStrategy.computeNextBackoffDelay(w.getRetryCount()),W=U.retryAfterHint?Math.max(U.retryAfterHint.getTime()-Date.now()||0,E):E,L=this.getCapacityCost(f);return this.capacity-=L,ZG({retryDelay:W,retryCount:w.getRetryCount()+1,retryCost:L})}throw new Error("No retry token available")}recordSuccess(w){this.capacity=Math.max(b$,this.capacity+(w.getRetryCost()??TG))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(w){return console.warn(`Max attempts provider could not resolve. Using default of ${S$}`),S$}}shouldRetry(w,U,G){return w.getRetryCount()+1<G&&this.capacity>=this.getCapacityCost(U.errorType)&&this.isRetryableError(U.errorType)}getCapacityCost(w){return w==="TRANSIENT"?JG:MG}isRetryableError(w){return w==="THROTTLING"||w==="TRANSIENT"}};g(KG,"StandardRetryStrategy");var D$=KG,OG=class ${constructor(w,U){this.maxAttemptsProvider=w,this.mode="adaptive";const{rateLimiter:G}=U??{};this.rateLimiter=G??new zG,this.standardRetryStrategy=new D$(w)}async acquireInitialRetryToken(w){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(w)}async refreshRetryTokenForRetry(w,U){return this.rateLimiter.updateClientSendingRate(U),this.standardRetryStrategy.refreshRetryTokenForRetry(w,U)}recordSuccess(w){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(w)}};g(OG,"AdaptiveRetryStrategy");var FZ=OG,AG=class $ extends D${constructor(w,U=c0){super(typeof w==="function"?w:async()=>w);if(typeof U==="number")this.computeNextBackoffDelay=()=>U;else this.computeNextBackoffDelay=U}async refreshRetryTokenForRetry(w,U){const G=await super.refreshRetryTokenForRetry(w,U);return G.getRetryDelay=()=>this.computeNextBackoffDelay(G.getRetryCount()),G}};g(AG,"ConfiguredRetryStrategy");var IZ=AG});var k$=M((x7,CG)=>{var{defineProperty:J1,getOwnPropertyDescriptor:YZ,getOwnPropertyNames:zZ}=Object,QZ=Object.prototype.hasOwnProperty,MZ=($,w)=>J1($,"name",{value:w,configurable:!0}),JZ=($,w)=>{for(var U in w)J1($,U,{get:w[U],enumerable:!0})},TZ=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of zZ(w))if(!QZ.call($,f)&&f!==U)J1($,f,{get:()=>w[f],enumerable:!(G=YZ(w,f))||G.enumerable})}return $},KZ=($)=>TZ(J1({},"__esModule",{value:!0}),$),HG={};JZ(HG,{isArrayBuffer:()=>OZ});CG.exports=KZ(HG);var OZ=MZ(($)=>typeof ArrayBuffer==="function"&&$ instanceof ArrayBuffer||Object.prototype.toString.call($)==="[object ArrayBuffer]","isArrayBuffer")});var v0=M((y7,jG)=>{var{defineProperty:T1,getOwnPropertyDescriptor:AZ,getOwnPropertyNames:BZ}=Object,VZ=Object.prototype.hasOwnProperty,NG=($,w)=>T1($,"name",{value:w,configurable:!0}),HZ=($,w)=>{for(var U in w)T1($,U,{get:w[U],enumerable:!0})},CZ=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of BZ(w))if(!VZ.call($,f)&&f!==U)T1($,f,{get:()=>w[f],enumerable:!(G=AZ(w,f))||G.enumerable})}return $},NZ=($)=>CZ(T1({},"__esModule",{value:!0}),$),qG={};HZ(qG,{fromArrayBuffer:()=>jZ,fromString:()=>PZ});jG.exports=NZ(qG);var qZ=k$(),c$=import.meta.require("buffer"),jZ=NG(($,w=0,U=$.byteLength-w)=>{if(!qZ.isArrayBuffer($))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof $} (${$})`);return c$.Buffer.from($,w,U)},"fromArrayBuffer"),PZ=NG(($,w)=>{if(typeof $!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof $} (${$})`);return w?c$.Buffer.from($,w):c$.Buffer.from($)},"fromString")});var bG=M((PG)=>{Object.defineProperty(PG,"__esModule",{value:!0});PG.fromBase64=void 0;var SZ=v0(),bZ=/^[A-Za-z0-9+/]*={0,2}$/,hZ=($)=>{if($.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!bZ.exec($))throw new TypeError("Invalid base64 string.");const w=SZ.fromString($,"base64");return new Uint8Array(w.buffer,w.byteOffset,w.byteLength)};PG.fromBase64=hZ});var e=M((_7,cG)=>{var{defineProperty:K1,getOwnPropertyDescriptor:DZ,getOwnPropertyNames:kZ}=Object,cZ=Object.prototype.hasOwnProperty,v$=($,w)=>K1($,"name",{value:w,configurable:!0}),vZ=($,w)=>{for(var U in w)K1($,U,{get:w[U],enumerable:!0})},xZ=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of kZ(w))if(!cZ.call($,f)&&f!==U)K1($,f,{get:()=>w[f],enumerable:!(G=DZ(w,f))||G.enumerable})}return $},yZ=($)=>xZ(K1({},"__esModule",{value:!0}),$),hG={};vZ(hG,{fromUtf8:()=>kG,toUint8Array:()=>uZ,toUtf8:()=>_Z});cG.exports=yZ(hG);var DG=v0(),kG=v$(($)=>{const w=DG.fromString($,"utf8");return new Uint8Array(w.buffer,w.byteOffset,w.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),uZ=v$(($)=>{if(typeof $==="string")return kG($);if(ArrayBuffer.isView($))return new Uint8Array($.buffer,$.byteOffset,$.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array($)},"toUint8Array"),_Z=v$(($)=>{if(typeof $==="string")return $;if(typeof $!=="object"||typeof $.byteOffset!=="number"||typeof $.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return DG.fromArrayBuffer($.buffer,$.byteOffset,$.byteLength).toString("utf8")},"toUtf8")});var yG=M((vG)=>{Object.defineProperty(vG,"__esModule",{value:!0});vG.toBase64=void 0;var dZ=v0(),pZ=e(),gZ=($)=>{let w;if(typeof $==="string")w=pZ.fromUtf8($);else w=$;if(typeof w!=="object"||typeof w.byteOffset!=="number"||typeof w.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return dZ.fromArrayBuffer(w.buffer,w.byteOffset,w.byteLength).toString("base64")};vG.toBase64=gZ});var A1=M((p7,O1)=>{var{defineProperty:uG,getOwnPropertyDescriptor:lZ,getOwnPropertyNames:nZ}=Object,sZ=Object.prototype.hasOwnProperty,x$=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of nZ(w))if(!sZ.call($,f)&&f!==U)uG($,f,{get:()=>w[f],enumerable:!(G=lZ(w,f))||G.enumerable})}return $},_G=($,w,U)=>(x$($,w,"default"),U&&x$(U,w,"default")),mZ=($)=>x$(uG({},"__esModule",{value:!0}),$),y$={};O1.exports=mZ(y$);_G(y$,bG(),O1.exports);_G(y$,yG(),O1.exports)});var gG=M((dG)=>{Object.defineProperty(dG,"__esModule",{value:!0});dG.getAwsChunkedEncodingStream=void 0;var iZ=import.meta.require("stream"),rZ=($,w)=>{const{base64Encoder:U,bodyLengthChecker:G,checksumAlgorithmFn:f,checksumLocationName:E,streamHasher:W}=w,L=U!==void 0&&f!==void 0&&E!==void 0&&W!==void 0,R=L?W(f,$):void 0,X=new iZ.Readable({read:()=>{}});return $.on("data",(Z)=>{const F=G(Z)||0;X.push(`${F.toString(16)}\r\n`),X.push(Z),X.push("\r\n")}),$.on("end",async()=>{if(X.push("0\r\n"),L){const Z=U(await R);X.push(`${E}:${Z}\r\n`),X.push("\r\n")}X.push(null)}),X};dG.getAwsChunkedEncodingStream=rZ});var _$=M((l7,mG)=>{var sG=function($){const w=[];for(let U of Object.keys($).sort()){const G=$[U];if(U=u$.escapeUri(U),Array.isArray(G))for(let f=0,E=G.length;f<E;f++)w.push(`${U}=${u$.escapeUri(G[f])}`);else{let f=U;if(G||typeof G==="string")f+=`=${u$.escapeUri(G)}`;w.push(f)}}return w.join("&")},B1=Object.defineProperty,oZ=Object.getOwnPropertyDescriptor,tZ=Object.getOwnPropertyNames,aZ=Object.prototype.hasOwnProperty,eZ=($,w)=>B1($,"name",{value:w,configurable:!0}),$F=($,w)=>{for(var U in w)B1($,U,{get:w[U],enumerable:!0})},wF=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of tZ(w))if(!aZ.call($,f)&&f!==U)B1($,f,{get:()=>w[f],enumerable:!(G=oZ(w,f))||G.enumerable})}return $},UF=($)=>wF(B1({},"__esModule",{value:!0}),$),nG={};$F(nG,{buildQueryString:()=>sG});mG.exports=UF(nG);var u$=lG();eZ(sG,"buildQueryString")});var ZE=M((n7,XE)=>{async function g$($,w,U=iG){const G=w.headers??{},f=G.Expect||G.expect;let E=-1,W=!1;if(f==="100-continue")await Promise.race([new Promise((L)=>{E=Number(setTimeout(L,Math.max(iG,U)))}),new Promise((L)=>{$.on("continue",()=>{clearTimeout(E),L()}),$.on("error",()=>{W=!0,clearTimeout(E),L()})})]);if(!W)UE($,w.body)}var UE=function($,w){if(w instanceof wE.Readable){w.pipe($);return}if(w){if(Buffer.isBuffer(w)||typeof w==="string"){$.end(w);return}const U=w;if(typeof U==="object"&&U.buffer&&typeof U.byteOffset==="number"&&typeof U.byteLength==="number"){$.end(Buffer.from(U.buffer,U.byteOffset,U.byteLength));return}$.end(Buffer.from(w));return}$.end()};async function RE($){const w=[],U=$.getReader();let G=!1,f=0;while(!G){const{done:L,value:R}=await U.read();if(R)w.push(R),f+=R.length;G=L}const E=new Uint8Array(f);let W=0;for(let L of w)E.set(L,W),W+=L.length;return E}var{create:fF,defineProperty:x0,getOwnPropertyDescriptor:GF,getOwnPropertyNames:EF,getPrototypeOf:WF}=Object,LF=Object.prototype.hasOwnProperty,q=($,w)=>x0($,"name",{value:w,configurable:!0}),RF=($,w)=>{for(var U in w)x0($,U,{get:w[U],enumerable:!0})},oG=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of EF(w))if(!LF.call($,f)&&f!==U)x0($,f,{get:()=>w[f],enumerable:!(G=GF(w,f))||G.enumerable})}return $},XF=($,w,U)=>(U=$!=null?fF(WF($)):{},oG(w||!$||!$.__esModule?x0(U,"default",{value:$,enumerable:!0}):U,$)),ZF=($)=>oG(x0({},"__esModule",{value:!0}),$),tG={};RF(tG,{DEFAULT_REQUEST_TIMEOUT:()=>QF,NodeHttp2Handler:()=>OF,NodeHttpHandler:()=>MF,streamCollector:()=>BF});XE.exports=ZF(tG);var aG=i(),eG=_$(),d$=import.meta.require("http"),p$=import.meta.require("https"),FF=["ECONNRESET","EPIPE","ETIMEDOUT"],$E=q(($)=>{const w={};for(let U of Object.keys($)){const G=$[U];w[U]=Array.isArray(G)?G.join(","):G}return w},"getTransformedHeaders"),IF=q(($,w,U=0)=>{if(!U)return;const G=setTimeout(()=>{$.destroy(),w(Object.assign(new Error(`Socket timed out without establishing a connection within ${U} ms`),{name:"TimeoutError"}))},U);$.on("socket",(f)=>{if(f.connecting)f.on("connect",()=>{clearTimeout(G)});else clearTimeout(G)})},"setConnectionTimeout"),YF=q(($,{keepAlive:w,keepAliveMsecs:U})=>{if(w!==!0)return;$.on("socket",(G)=>{G.setKeepAlive(w,U||0)})},"setSocketKeepAlive"),zF=q(($,w,U=0)=>{$.setTimeout(U,()=>{$.destroy(),w(Object.assign(new Error(`Connection timed out after ${U} ms`),{name:"TimeoutError"}))})},"setSocketTimeout"),wE=import.meta.require("stream"),iG=1000;q(g$,"writeRequestBody");q(UE,"writeBody");var QF=0,fE=class ${constructor(w){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((U,G)=>{if(typeof w==="function")w().then((f)=>{U(this.resolveDefaultConfig(f))}).catch(G);else U(this.resolveDefaultConfig(w))})}static create(w){if(typeof(w==null?void 0:w.handle)==="function")return w;return new $(w)}static checkSocketUsage(w,U,G=console){var f,E,W;const{sockets:L,requests:R,maxSockets:X}=w;if(typeof X!=="number"||X===Infinity)return U;const Z=15000;if(Date.now()-Z<U)return U;if(L&&R)for(let F in L){const Y=((f=L[F])==null?void 0:f.length)??0,I=((E=R[F])==null?void 0:E.length)??0;if(Y>=X&&I>=2*X)return(W=G==null?void 0:G.warn)==null||W.call(G,`@smithy/node-http-handler:WARN - socket usage at capacity=${Y} and ${I} additional requests are enqueued.
|
|
2
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
3
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return U}resolveDefaultConfig(w){const{requestTimeout:U,connectionTimeout:G,socketTimeout:f,httpAgent:E,httpsAgent:W}=w||{};return{connectionTimeout:G,requestTimeout:U??f,httpAgent:(()=>{if(E instanceof d$.Agent||typeof(E==null?void 0:E.destroy)==="function")return E;return new d$.Agent({keepAlive:!0,maxSockets:50,...E})})(),httpsAgent:(()=>{if(W instanceof p$.Agent||typeof(W==null?void 0:W.destroy)==="function")return W;return new p$.Agent({keepAlive:!0,maxSockets:50,...W})})(),logger:console}}destroy(){var w,U,G,f;(U=(w=this.config)==null?void 0:w.httpAgent)==null||U.destroy(),(f=(G=this.config)==null?void 0:G.httpsAgent)==null||f.destroy()}async handle(w,{abortSignal:U}={}){if(!this.config)this.config=await this.configProvider;let G;return new Promise((f,E)=>{let W=void 0;const L=q(async(K)=>{await W,clearTimeout(G),f(K)},"resolve"),R=q(async(K)=>{await W,clearTimeout(G),E(K)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(U==null?void 0:U.aborted){const K=new Error("Request aborted");K.name="AbortError",R(K);return}const X=w.protocol==="https:",Z=X?this.config.httpsAgent:this.config.httpAgent;G=setTimeout(()=>{this.socketWarningTimestamp=$.checkSocketUsage(Z,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000));const F=eG.buildQueryString(w.query||{});let Y=void 0;if(w.username!=null||w.password!=null){const K=w.username??"",A=w.password??"";Y=`${K}:${A}`}let I=w.path;if(F)I+=`?${F}`;if(w.fragment)I+=`#${w.fragment}`;const z={headers:w.headers,host:w.hostname,method:w.method,path:I,port:w.port,agent:Z,auth:Y},O=(X?p$.request:d$.request)(z,(K)=>{const A=new aG.HttpResponse({statusCode:K.statusCode||-1,reason:K.statusMessage,headers:$E(K.headers),body:K});L({response:A})});if(O.on("error",(K)=>{if(FF.includes(K.code))R(Object.assign(K,{name:"TimeoutError"}));else R(K)}),IF(O,R,this.config.connectionTimeout),zF(O,R,this.config.requestTimeout),U){const K=q(()=>{O.destroy();const A=new Error("Request aborted");A.name="AbortError",R(A)},"onAbort");if(typeof U.addEventListener==="function"){const A=U;A.addEventListener("abort",K,{once:!0}),O.once("close",()=>A.removeEventListener("abort",K))}else U.onabort=K}const T=z.agent;if(typeof T==="object"&&"keepAlive"in T)YF(O,{keepAlive:T.keepAlive,keepAliveMsecs:T.keepAliveMsecs});W=g$(O,w,this.config.requestTimeout).catch((K)=>{return clearTimeout(G),E(K)})})}updateHttpClientConfig(w,U){this.config=void 0,this.configProvider=this.configProvider.then((G)=>{return{...G,[w]:U}})}httpHandlerConfigs(){return this.config??{}}};q(fE,"NodeHttpHandler");var MF=fE,rG=import.meta.require("http2"),JF=XF(import.meta.require("http2")),GE=class ${constructor(w){this.sessions=[],this.sessions=w??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(w){this.sessions.push(w)}contains(w){return this.sessions.includes(w)}remove(w){this.sessions=this.sessions.filter((U)=>U!==w)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(w){for(let U of this.sessions)if(U===w){if(!U.destroyed)U.destroy()}}};q(GE,"NodeHttp2ConnectionPool");var TF=GE,EE=class ${constructor(w){if(this.sessionCache=new Map,this.config=w,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(w,U){const G=this.getUrlString(w),f=this.sessionCache.get(G);if(f){const R=f.poll();if(R&&!this.config.disableConcurrency)return R}const E=JF.default.connect(G);if(this.config.maxConcurrency)E.settings({maxConcurrentStreams:this.config.maxConcurrency},(R)=>{if(R)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+w.destination.toString())});E.unref();const W=q(()=>{E.destroy(),this.deleteSession(G,E)},"destroySessionCb");if(E.on("goaway",W),E.on("error",W),E.on("frameError",W),E.on("close",()=>this.deleteSession(G,E)),U.requestTimeout)E.setTimeout(U.requestTimeout,W);const L=this.sessionCache.get(G)||new TF;return L.offerLast(E),this.sessionCache.set(G,L),E}deleteSession(w,U){const G=this.sessionCache.get(w);if(!G)return;if(!G.contains(U))return;G.remove(U),this.sessionCache.set(w,G)}release(w,U){var G;const f=this.getUrlString(w);(G=this.sessionCache.get(f))==null||G.offerLast(U)}destroy(){for(let[w,U]of this.sessionCache){for(let G of U){if(!G.destroyed)G.destroy();U.remove(G)}this.sessionCache.delete(w)}}setMaxConcurrentStreams(w){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=w}setDisableConcurrentStreams(w){this.config.disableConcurrency=w}getUrlString(w){return w.destination.toString()}};q(EE,"NodeHttp2ConnectionManager");var KF=EE,WE=class ${constructor(w){this.metadata={handlerProtocol:"h2"},this.connectionManager=new KF({}),this.configProvider=new Promise((U,G)=>{if(typeof w==="function")w().then((f)=>{U(f||{})}).catch(G);else U(w||{})})}static create(w){if(typeof(w==null?void 0:w.handle)==="function")return w;return new $(w)}destroy(){this.connectionManager.destroy()}async handle(w,{abortSignal:U}={}){if(!this.config){if(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams)this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams)}const{requestTimeout:G,disableConcurrentStreams:f}=this.config;return new Promise((E,W)=>{var L;let R=!1,X=void 0;const Z=q(async(N)=>{await X,E(N)},"resolve"),F=q(async(N)=>{await X,W(N)},"reject");if(U==null?void 0:U.aborted){R=!0;const N=new Error("Request aborted");N.name="AbortError",F(N);return}const{hostname:Y,method:I,port:z,protocol:J,query:O}=w;let T="";if(w.username!=null||w.password!=null){const N=w.username??"",_=w.password??"";T=`${N}:${_}@`}const K=`${J}//${T}${Y}${z?`:${z}`:""}`,A={destination:new URL(K)},V=this.connectionManager.lease(A,{requestTimeout:(L=this.config)==null?void 0:L.sessionTimeout,disableConcurrentStreams:f||!1}),S=q((N)=>{if(f)this.destroySession(V);R=!0,F(N)},"rejectWithDestroy"),rw=eG.buildQueryString(O||{});let R$=w.path;if(rw)R$+=`?${rw}`;if(w.fragment)R$+=`#${w.fragment}`;const v=V.request({...w.headers,[rG.constants.HTTP2_HEADER_PATH]:R$,[rG.constants.HTTP2_HEADER_METHOD]:I});if(V.ref(),v.on("response",(N)=>{const _=new aG.HttpResponse({statusCode:N[":status"]||-1,headers:$E(N),body:v});if(R=!0,Z({response:_}),f)V.close(),this.connectionManager.deleteSession(K,V)}),G)v.setTimeout(G,()=>{v.close();const N=new Error(`Stream timed out because of no activity for ${G} ms`);N.name="TimeoutError",S(N)});if(U){const N=q(()=>{v.close();const _=new Error("Request aborted");_.name="AbortError",S(_)},"onAbort");if(typeof U.addEventListener==="function"){const _=U;_.addEventListener("abort",N,{once:!0}),v.once("close",()=>_.removeEventListener("abort",N))}else U.onabort=N}v.on("frameError",(N,_,E4)=>{S(new Error(`Frame type id ${N} in stream id ${E4} has failed with code ${_}.`))}),v.on("error",S),v.on("aborted",()=>{S(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${v.rstCode}.`))}),v.on("close",()=>{if(V.unref(),f)V.destroy();if(!R)S(new Error("Unexpected error: http2 request did not get a response"))}),X=g$(v,w,G)})}updateHttpClientConfig(w,U){this.config=void 0,this.configProvider=this.configProvider.then((G)=>{return{...G,[w]:U}})}httpHandlerConfigs(){return this.config??{}}destroySession(w){if(!w.destroyed)w.destroy()}};q(WE,"NodeHttp2Handler");var OF=WE,LE=class $ extends wE.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(w,U,G){this.bufferedBytes.push(w),G()}};q(LE,"Collector");var AF=LE,BF=q(($)=>{if(VF($))return RE($);return new Promise((w,U)=>{const G=new AF;$.pipe(G),$.on("error",(f)=>{G.end(),U(f)}),G.on("error",U),G.on("finish",function(){const f=new Uint8Array(Buffer.concat(this.bufferedBytes));w(f)})})},"streamCollector"),VF=q(($)=>typeof ReadableStream==="function"&&$ instanceof ReadableStream,"isReadableStreamInstance");q(RE,"collectReadableStream")});var KE=M((s7,TE)=>{var YE=function($=0){return new Promise((w,U)=>{if($)setTimeout(()=>{const G=new Error(`Request did not complete within ${$} ms`);G.name="TimeoutError",U(G)},$)})};async function QE($){const w=await JE($),U=hF.fromBase64(w);return new Uint8Array(U)}async function ME($){const w=[],U=$.getReader();let G=!1,f=0;while(!G){const{done:L,value:R}=await U.read();if(R)w.push(R),f+=R.length;G=L}const E=new Uint8Array(f);let W=0;for(let L of w)E.set(L,W),W+=L.length;return E}var JE=function($){return new Promise((w,U)=>{const G=new FileReader;G.onloadend=()=>{if(G.readyState!==2)return U(new Error("Reader aborted too early"));const f=G.result??"",E=f.indexOf(","),W=E>-1?E+1:f.length;w(f.substring(W))},G.onabort=()=>U(new Error("Read aborted")),G.onerror=()=>U(G.error),G.readAsDataURL($)})},H1=Object.defineProperty,HF=Object.getOwnPropertyDescriptor,CF=Object.getOwnPropertyNames,NF=Object.prototype.hasOwnProperty,o=($,w)=>H1($,"name",{value:w,configurable:!0}),qF=($,w)=>{for(var U in w)H1($,U,{get:w[U],enumerable:!0})},jF=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of CF(w))if(!NF.call($,f)&&f!==U)H1($,f,{get:()=>w[f],enumerable:!(G=HF(w,f))||G.enumerable})}return $},PF=($)=>jF(H1({},"__esModule",{value:!0}),$),IE={};qF(IE,{FetchHttpHandler:()=>bF,keepAliveSupport:()=>V1,streamCollector:()=>DF});TE.exports=PF(IE);var FE=i(),SF=_$();o(YE,"requestTimeout");var V1={supported:void 0},zE=class ${static create(w){if(typeof(w==null?void 0:w.handle)==="function")return w;return new $(w)}constructor(w){if(typeof w==="function")this.configProvider=w().then((U)=>U||{});else this.config=w??{},this.configProvider=Promise.resolve(this.config);if(V1.supported===void 0)V1.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(w,{abortSignal:U}={}){if(!this.config)this.config=await this.configProvider;const G=this.config.requestTimeout,f=this.config.keepAlive===!0,E=this.config.credentials;if(U==null?void 0:U.aborted){const T=new Error("Request aborted");return T.name="AbortError",Promise.reject(T)}let W=w.path;const L=SF.buildQueryString(w.query||{});if(L)W+=`?${L}`;if(w.fragment)W+=`#${w.fragment}`;let R="";if(w.username!=null||w.password!=null){const T=w.username??"",K=w.password??"";R=`${T}:${K}@`}const{port:X,method:Z}=w,F=`${w.protocol}//${R}${w.hostname}${X?`:${X}`:""}${W}`,Y=Z==="GET"||Z==="HEAD"?void 0:w.body,I={body:Y,headers:new Headers(w.headers),method:Z,credentials:E};if(Y)I.duplex="half";if(typeof AbortController!=="undefined")I.signal=U;if(V1.supported)I.keepalive=f;let z=o(()=>{},"removeSignalEventListener");const J=new Request(F,I),O=[fetch(J).then((T)=>{const K=T.headers,A={};for(let S of K.entries())A[S[0]]=S[1];if(T.body==null)return T.blob().then((S)=>({response:new FE.HttpResponse({headers:A,reason:T.statusText,statusCode:T.status,body:S})}));return{response:new FE.HttpResponse({headers:A,reason:T.statusText,statusCode:T.status,body:T.body})}}),YE(G)];if(U)O.push(new Promise((T,K)=>{const A=o(()=>{const V=new Error("Request aborted");V.name="AbortError",K(V)},"onAbort");if(typeof U.addEventListener==="function"){const V=U;V.addEventListener("abort",A,{once:!0}),z=o(()=>V.removeEventListener("abort",A),"removeSignalEventListener")}else U.onabort=A}));return Promise.race(O).finally(z)}updateHttpClientConfig(w,U){this.config=void 0,this.configProvider=this.configProvider.then((G)=>{return G[w]=U,G})}httpHandlerConfigs(){return this.config??{}}};o(zE,"FetchHttpHandler");var bF=zE,hF=A1(),DF=o(($)=>{if(typeof Blob==="function"&&$ instanceof Blob)return QE($);return ME($)},"streamCollector");o(QE,"collectBlob");o(ME,"collectStream");o(JE,"readToBase64")});var y0=M((OE)=>{Object.defineProperty(OE,"__esModule",{value:!0});OE.isReadableStream=void 0;var kF=($)=>{var w;return typeof ReadableStream==="function"&&(((w=$===null||$===void 0?void 0:$.constructor)===null||w===void 0?void 0:w.name)===ReadableStream.name||$ instanceof ReadableStream)};OE.isReadableStream=kF});var jE=M((NE)=>{Object.defineProperty(NE,"__esModule",{value:!0});NE.sdkStreamMixin=void 0;var cF=KE(),vF=A1(),xF=CE(),yF=e(),BE=y0(),VE="The stream has already been transformed.",uF=($)=>{var w,U;if(!HE($)&&!BE.isReadableStream($)){const W=((U=(w=$===null||$===void 0?void 0:$.__proto__)===null||w===void 0?void 0:w.constructor)===null||U===void 0?void 0:U.name)||$;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${W}`)}let G=!1;const f=async()=>{if(G)throw new Error(VE);return G=!0,await cF.streamCollector($)},E=(W)=>{if(typeof W.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return W.stream()};return Object.assign($,{transformToByteArray:f,transformToString:async(W)=>{const L=await f();if(W==="base64")return vF.toBase64(L);else if(W==="hex")return xF.toHex(L);else if(W===void 0||W==="utf8"||W==="utf-8")return yF.toUtf8(L);else if(typeof TextDecoder==="function")return new TextDecoder(W).decode(L);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(G)throw new Error(VE);if(G=!0,HE($))return E($);else if(BE.isReadableStream($))return $;else throw new Error(`Cannot transform payload to web stream, got ${$}`)}})};NE.sdkStreamMixin=uF;var HE=($)=>typeof Blob==="function"&&$ instanceof Blob});var hE=M((SE)=>{Object.defineProperty(SE,"__esModule",{value:!0});SE.sdkStreamMixin=void 0;var _F=ZE(),dF=v0(),l$=import.meta.require("stream"),pF=import.meta.require("util"),gF=jE(),PE="The stream has already been transformed.",lF=($)=>{var w,U;if(!($ instanceof l$.Readable))try{return gF.sdkStreamMixin($)}catch(E){const W=((U=(w=$===null||$===void 0?void 0:$.__proto__)===null||w===void 0?void 0:w.constructor)===null||U===void 0?void 0:U.name)||$;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${W}`)}let G=!1;const f=async()=>{if(G)throw new Error(PE);return G=!0,await _F.streamCollector($)};return Object.assign($,{transformToByteArray:f,transformToString:async(E)=>{const W=await f();if(E===void 0||Buffer.isEncoding(E))return dF.fromArrayBuffer(W.buffer,W.byteOffset,W.byteLength).toString(E);else return new pF.TextDecoder(E).decode(W)},transformToWebStream:()=>{if(G)throw new Error(PE);if($.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof l$.Readable.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return G=!0,l$.Readable.toWeb($)}})};SE.sdkStreamMixin=lF});var cE=M((DE)=>{async function nF($){if(typeof $.stream==="function")$=$.stream();return $.tee()}Object.defineProperty(DE,"__esModule",{value:!0});DE.splitStream=void 0;DE.splitStream=nF});var uE=M((xE)=>{async function iF($){if(mF.isReadableStream($))return sF.splitStream($);const w=new vE.PassThrough,U=new vE.PassThrough;return $.pipe(w),$.pipe(U),[w,U]}Object.defineProperty(xE,"__esModule",{value:!0});xE.splitStream=void 0;var vE=import.meta.require("stream"),sF=cE(),mF=y0();xE.splitStream=iF});var pE=M((_E)=>{async function rF($,w){var U;let G=0;const f=[],E=$.getReader();let W=!1;while(!W){const{done:X,value:Z}=await E.read();if(Z)f.push(Z),G+=(U=Z===null||Z===void 0?void 0:Z.byteLength)!==null&&U!==void 0?U:0;if(G>=w)break;W=X}E.releaseLock();const L=new Uint8Array(Math.min(w,G));let R=0;for(let X of f){if(X.byteLength>L.byteLength-R){L.set(X.subarray(0,L.byteLength-R),R);break}else L.set(X,R);R+=X.length}return L}Object.defineProperty(_E,"__esModule",{value:!0});_E.headStream=void 0;_E.headStream=rF});var sE=M((lE)=>{Object.defineProperty(lE,"__esModule",{value:!0});lE.headStream=void 0;var oF=import.meta.require("stream"),tF=pE(),aF=y0(),eF=($,w)=>{if(aF.isReadableStream($))return tF.headStream($,w);return new Promise((U,G)=>{const f=new gE;f.limit=w,$.pipe(f),$.on("error",(E)=>{f.end(),G(E)}),f.on("error",G),f.on("finish",function(){const E=new Uint8Array(Buffer.concat(this.buffers));U(E)})})};lE.headStream=eF;class gE extends oF.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=Infinity,this.bytesBuffered=0}_write($,w,U){var G;if(this.buffers.push($),this.bytesBuffered+=(G=$.byteLength)!==null&&G!==void 0?G:0,this.bytesBuffered>=this.limit){const f=this.bytesBuffered-this.limit,E=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=E.subarray(0,E.byteLength-f),this.emit("finish")}U()}}});var aE=M(($M,R0)=>{var rE=function($,w="utf-8"){if(w==="base64")return mE.toBase64($);return iE.toUtf8($)},oE=function($,w){if(w==="base64")return s$.mutate(mE.fromBase64($));return s$.mutate(iE.fromUtf8($))},C1=Object.defineProperty,$I=Object.getOwnPropertyDescriptor,wI=Object.getOwnPropertyNames,UI=Object.prototype.hasOwnProperty,m$=($,w)=>C1($,"name",{value:w,configurable:!0}),fI=($,w)=>{for(var U in w)C1($,U,{get:w[U],enumerable:!0})},n$=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of wI(w))if(!UI.call($,f)&&f!==U)C1($,f,{get:()=>w[f],enumerable:!(G=$I(w,f))||G.enumerable})}return $},u0=($,w,U)=>(n$($,w,"default"),U&&n$(U,w,"default")),GI=($)=>n$(C1({},"__esModule",{value:!0}),$),L0={};fI(L0,{Uint8ArrayBlobAdapter:()=>s$});R0.exports=GI(L0);var mE=A1(),iE=e();m$(rE,"transformToString");m$(oE,"transformFromString");var tE=class $ extends Uint8Array{static fromString(w,U="utf-8"){switch(typeof w){case"string":return oE(w,U);default:throw new Error(`Unsupported conversion from ${typeof w} to Uint8ArrayBlobAdapter.`)}}static mutate(w){return Object.setPrototypeOf(w,$.prototype),w}transformToString(w="utf-8"){return rE(this,w)}};m$(tE,"Uint8ArrayBlobAdapter");var s$=tE;u0(L0,gG(),R0.exports);u0(L0,hE(),R0.exports);u0(L0,uE(),R0.exports);u0(L0,sE(),R0.exports);u0(L0,y0(),R0.exports)});var B0=M((wM,AW)=>{var IW=function($){const w=$.getUTCFullYear(),U=$.getUTCMonth(),G=$.getUTCDay(),f=$.getUTCDate(),E=$.getUTCHours(),W=$.getUTCMinutes(),L=$.getUTCSeconds(),R=f<10?`0${f}`:`${f}`,X=E<10?`0${E}`:`${E}`,Z=W<10?`0${W}`:`${W}`,F=L<10?`0${L}`:`${L}`;return`${DI[G]}, ${R} ${Gw[U]} ${w} ${X}:${Z}:${F} GMT`},j1=function($){return encodeURIComponent($).replace(/[!'()*]/g,function(w){return"%"+w.charCodeAt(0).toString(16).toUpperCase()})},Ew=function($,w,U){let G,f,E;if(typeof w==="undefined"&&typeof U==="undefined")G={},E=$;else if(G=$,typeof w==="function")return f=w,E=U,IY(G,f,E);else E=w;for(let W of Object.keys(E)){if(!Array.isArray(E[W])){G[W]=E[W];continue}KW(G,null,E,W)}return G},OW=function($,w,U){if(U<=0||!Number.isInteger(U))throw new Error("Invalid number of delimiters ("+U+") for splitEvery.");const G=$.split(w);if(U===1)return G;const f=[];let E="";for(let W=0;W<G.length;W++){if(E==="")E=G[W];else E+=w+G[W];if((W+1)%U===0)f.push(E),E=""}if(E!=="")f.push(E);return f},P1=Object.defineProperty,WI=Object.getOwnPropertyDescriptor,LI=Object.getOwnPropertyNames,RI=Object.prototype.hasOwnProperty,Q=($,w)=>P1($,"name",{value:w,configurable:!0}),XI=($,w)=>{for(var U in w)P1($,U,{get:w[U],enumerable:!0})},ZI=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of LI(w))if(!RI.call($,f)&&f!==U)P1($,f,{get:()=>w[f],enumerable:!(G=WI(w,f))||G.enumerable})}return $},FI=($)=>ZI(P1({},"__esModule",{value:!0}),$),$W={};XI($W,{Client:()=>YI,Command:()=>EW,LazyJsonString:()=>XY,NoOpLogger:()=>II,SENSITIVE_STRING:()=>MI,ServiceException:()=>tI,StringWrapper:()=>l0,_json:()=>$w,collectBody:()=>zI,convertMap:()=>ZY,createAggregatedClient:()=>JI,dateToUtcString:()=>IW,decorateServiceException:()=>zW,emitWarningIfUnsupportedVersion:()=>wY,expectBoolean:()=>KI,expectByte:()=>e$,expectFloat32:()=>N1,expectInt:()=>AI,expectInt32:()=>t$,expectLong:()=>p0,expectNonNull:()=>VI,expectNumber:()=>d0,expectObject:()=>LW,expectShort:()=>a$,expectString:()=>HI,expectUnion:()=>CI,extendedEncodeURIComponent:()=>j1,getArrayIfSingleItem:()=>RY,getDefaultClientConfiguration:()=>WY,getDefaultExtensionConfiguration:()=>MW,getValueFromTextNode:()=>JW,handleFloat:()=>jI,limitedParseDouble:()=>fw,limitedParseFloat:()=>PI,limitedParseFloat32:()=>SI,loadConfigsForDefaultMode:()=>$Y,logger:()=>g0,map:()=>Ew,parseBoolean:()=>TI,parseEpochTimestamp:()=>pI,parseRfc3339DateTime:()=>cI,parseRfc3339DateTimeWithOffset:()=>xI,parseRfc7231DateTime:()=>dI,resolveDefaultRuntimeConfig:()=>LY,resolvedPath:()=>QY,serializeDateTime:()=>JY,serializeFloat:()=>MY,splitEvery:()=>OW,strictParseByte:()=>FW,strictParseDouble:()=>Uw,strictParseFloat:()=>NI,strictParseFloat32:()=>RW,strictParseInt:()=>bI,strictParseInt32:()=>hI,strictParseLong:()=>ZW,strictParseShort:()=>K0,take:()=>FY,throwDefaultError:()=>QW,withBaseException:()=>aI});AW.exports=FI($W);var wW=class ${trace(){}debug(){}info(){}warn(){}error(){}};Q(wW,"NoOpLogger");var II=wW,UW=EI(),fW=class ${constructor(w){this.middlewareStack=UW.constructStack(),this.config=w}send(w,U,G){const f=typeof U!=="function"?U:void 0,E=typeof U==="function"?U:G,W=w.resolveMiddleware(this.middlewareStack,this.config,f);if(E)W(w).then((L)=>E(null,L.output),(L)=>E(L)).catch(()=>{});else return W(w).then((L)=>L.output)}destroy(){if(this.config.requestHandler.destroy)this.config.requestHandler.destroy()}};Q(fW,"Client");var YI=fW,i$=aE(),zI=Q(async($=new Uint8Array,w)=>{if($ instanceof Uint8Array)return i$.Uint8ArrayBlobAdapter.mutate($);if(!$)return i$.Uint8ArrayBlobAdapter.mutate(new Uint8Array);const U=w.streamCollector($);return i$.Uint8ArrayBlobAdapter.mutate(await U)},"collectBody"),o$=Q0(),GW=class ${constructor(){this.middlewareStack=UW.constructStack()}static classBuilder(){return new QI}resolveMiddlewareWithContext(w,U,G,{middlewareFn:f,clientName:E,commandName:W,inputFilterSensitiveLog:L,outputFilterSensitiveLog:R,smithyContext:X,additionalContext:Z,CommandCtor:F}){for(let O of f.bind(this)(F,w,U,G))this.middlewareStack.use(O);const Y=w.concat(this.middlewareStack),{logger:I}=U,z={logger:I,clientName:E,commandName:W,inputFilterSensitiveLog:L,outputFilterSensitiveLog:R,[o$.SMITHY_CONTEXT_KEY]:{commandInstance:this,...X},...Z},{requestHandler:J}=U;return Y.resolve((O)=>J.handle(O.request,G||{}),z)}};Q(GW,"Command");var EW=GW,WW=class ${constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(w)=>w,this._outputFilterSensitiveLog=(w)=>w,this._serializer=null,this._deserializer=null}init(w){this._init=w}ep(w){return this._ep=w,this}m(w){return this._middlewareFn=w,this}s(w,U,G={}){return this._smithyContext={service:w,operation:U,...G},this}c(w={}){return this._additionalContext=w,this}n(w,U){return this._clientName=w,this._commandName=U,this}f(w=(G)=>G,U=(G)=>G){return this._inputFilterSensitiveLog=w,this._outputFilterSensitiveLog=U,this}ser(w){return this._serializer=w,this}de(w){return this._deserializer=w,this}build(){var w;const U=this;let G;return G=(w=class extends EW{constructor(...[f]){super();this.serialize=U._serializer,this.deserialize=U._deserializer,this.input=f??{},U._init(this)}static getEndpointParameterInstructions(){return U._ep}resolveMiddleware(f,E,W){return this.resolveMiddlewareWithContext(f,E,W,{CommandCtor:G,middlewareFn:U._middlewareFn,clientName:U._clientName,commandName:U._commandName,inputFilterSensitiveLog:U._inputFilterSensitiveLog,outputFilterSensitiveLog:U._outputFilterSensitiveLog,smithyContext:U._smithyContext,additionalContext:U._additionalContext})}},Q(w,"CommandRef"),w)}};Q(WW,"ClassBuilder");var QI=WW,MI="***SensitiveInformation***",JI=Q(($,w)=>{for(let U of Object.keys($)){const G=$[U],f=Q(async function(W,L,R){const X=new G(W);if(typeof L==="function")this.send(X,L);else if(typeof R==="function"){if(typeof L!=="object")throw new Error(`Expected http options but got ${typeof L}`);this.send(X,L||{},R)}else return this.send(X,L)},"methodImpl"),E=(U[0].toLowerCase()+U.slice(1)).replace(/Command$/,"");w.prototype[E]=f}},"createAggregatedClient"),TI=Q(($)=>{switch($){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${$}"`)}},"parseBoolean"),KI=Q(($)=>{if($===null||$===void 0)return;if(typeof $==="number"){if($===0||$===1)g0.warn(q1(`Expected boolean, got ${typeof $}: ${$}`));if($===0)return!1;if($===1)return!0}if(typeof $==="string"){const w=$.toLowerCase();if(w==="false"||w==="true")g0.warn(q1(`Expected boolean, got ${typeof $}: ${$}`));if(w==="false")return!1;if(w==="true")return!0}if(typeof $==="boolean")return $;throw new TypeError(`Expected boolean, got ${typeof $}: ${$}`)},"expectBoolean"),d0=Q(($)=>{if($===null||$===void 0)return;if(typeof $==="string"){const w=parseFloat($);if(!Number.isNaN(w)){if(String(w)!==String($))g0.warn(q1(`Expected number but observed string: ${$}`));return w}}if(typeof $==="number")return $;throw new TypeError(`Expected number, got ${typeof $}: ${$}`)},"expectNumber"),OI=Math.ceil(340282346638528860000000000000000000000),N1=Q(($)=>{const w=d0($);if(w!==void 0&&!Number.isNaN(w)&&w!==Infinity&&w!==(-Infinity)){if(Math.abs(w)>OI)throw new TypeError(`Expected 32-bit float, got ${$}`)}return w},"expectFloat32"),p0=Q(($)=>{if($===null||$===void 0)return;if(Number.isInteger($)&&!Number.isNaN($))return $;throw new TypeError(`Expected integer, got ${typeof $}: ${$}`)},"expectLong"),AI=p0,t$=Q(($)=>ww($,32),"expectInt32"),a$=Q(($)=>ww($,16),"expectShort"),e$=Q(($)=>ww($,8),"expectByte"),ww=Q(($,w)=>{const U=p0($);if(U!==void 0&&BI(U,w)!==U)throw new TypeError(`Expected ${w}-bit integer, got ${$}`);return U},"expectSizedInt"),BI=Q(($,w)=>{switch(w){case 32:return Int32Array.of($)[0];case 16:return Int16Array.of($)[0];case 8:return Int8Array.of($)[0]}},"castInt"),VI=Q(($,w)=>{if($===null||$===void 0){if(w)throw new TypeError(`Expected a non-null value for ${w}`);throw new TypeError("Expected a non-null value")}return $},"expectNonNull"),LW=Q(($)=>{if($===null||$===void 0)return;if(typeof $==="object"&&!Array.isArray($))return $;const w=Array.isArray($)?"array":typeof $;throw new TypeError(`Expected object, got ${w}: ${$}`)},"expectObject"),HI=Q(($)=>{if($===null||$===void 0)return;if(typeof $==="string")return $;if(["boolean","number","bigint"].includes(typeof $))return g0.warn(q1(`Expected string, got ${typeof $}: ${$}`)),String($);throw new TypeError(`Expected string, got ${typeof $}: ${$}`)},"expectString"),CI=Q(($)=>{if($===null||$===void 0)return;const w=LW($),U=Object.entries(w).filter(([,G])=>G!=null).map(([G])=>G);if(U.length===0)throw new TypeError("Unions must have exactly one non-null member. None were found.");if(U.length>1)throw new TypeError(`Unions must have exactly one non-null member. Keys ${U} were not null.`);return w},"expectUnion"),Uw=Q(($)=>{if(typeof $=="string")return d0(A0($));return d0($)},"strictParseDouble"),NI=Uw,RW=Q(($)=>{if(typeof $=="string")return N1(A0($));return N1($)},"strictParseFloat32"),qI=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,A0=Q(($)=>{const w=$.match(qI);if(w===null||w[0].length!==$.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat($)},"parseNumber"),fw=Q(($)=>{if(typeof $=="string")return XW($);return d0($)},"limitedParseDouble"),jI=fw,PI=fw,SI=Q(($)=>{if(typeof $=="string")return XW($);return N1($)},"limitedParseFloat32"),XW=Q(($)=>{switch($){case"NaN":return NaN;case"Infinity":return Infinity;case"-Infinity":return (-Infinity);default:throw new Error(`Unable to parse float value: ${$}`)}},"parseFloatString"),ZW=Q(($)=>{if(typeof $==="string")return p0(A0($));return p0($)},"strictParseLong"),bI=ZW,hI=Q(($)=>{if(typeof $==="string")return t$(A0($));return t$($)},"strictParseInt32"),K0=Q(($)=>{if(typeof $==="string")return a$(A0($));return a$($)},"strictParseShort"),FW=Q(($)=>{if(typeof $==="string")return e$(A0($));return e$($)},"strictParseByte"),q1=Q(($)=>{return String(new TypeError($).stack||$).split("\n").slice(0,5).filter((w)=>!w.includes("stackTraceWarning")).join("\n")},"stackTraceWarning"),g0={warn:console.warn},DI=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Gw=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Q(IW,"dateToUtcString");var kI=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),cI=Q(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const w=kI.exec($);if(!w)throw new TypeError("Invalid RFC-3339 date-time value");const[U,G,f,E,W,L,R,X]=w,Z=K0(O0(G)),F=s(f,"month",1,12),Y=s(E,"day",1,31);return _0(Z,F,Y,{hours:W,minutes:L,seconds:R,fractionalMilliseconds:X})},"parseRfc3339DateTime"),vI=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),xI=Q(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const w=vI.exec($);if(!w)throw new TypeError("Invalid RFC-3339 date-time value");const[U,G,f,E,W,L,R,X,Z]=w,F=K0(O0(G)),Y=s(f,"month",1,12),I=s(E,"day",1,31),z=_0(F,Y,I,{hours:W,minutes:L,seconds:R,fractionalMilliseconds:X});if(Z.toUpperCase()!="Z")z.setTime(z.getTime()-oI(Z));return z},"parseRfc3339DateTimeWithOffset"),yI=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),uI=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),_I=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),dI=Q(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let w=yI.exec($);if(w){const[U,G,f,E,W,L,R,X]=w;return _0(K0(O0(E)),r$(f),s(G,"day",1,31),{hours:W,minutes:L,seconds:R,fractionalMilliseconds:X})}if(w=uI.exec($),w){const[U,G,f,E,W,L,R,X]=w;return nI(_0(gI(E),r$(f),s(G,"day",1,31),{hours:W,minutes:L,seconds:R,fractionalMilliseconds:X}))}if(w=_I.exec($),w){const[U,G,f,E,W,L,R,X]=w;return _0(K0(O0(X)),r$(G),s(f.trimLeft(),"day",1,31),{hours:E,minutes:W,seconds:L,fractionalMilliseconds:R})}throw new TypeError("Invalid RFC-7231 date-time value")},"parseRfc7231DateTime"),pI=Q(($)=>{if($===null||$===void 0)return;let w;if(typeof $==="number")w=$;else if(typeof $==="string")w=Uw($);else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(w)||w===Infinity||w===(-Infinity))throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(w*1000))},"parseEpochTimestamp"),_0=Q(($,w,U,G)=>{const f=w-1;return mI($,f,U),new Date(Date.UTC($,f,U,s(G.hours,"hour",0,23),s(G.minutes,"minute",0,59),s(G.seconds,"seconds",0,60),rI(G.fractionalMilliseconds)))},"buildDate"),gI=Q(($)=>{const w=(new Date()).getUTCFullYear(),U=Math.floor(w/100)*100+K0(O0($));if(U<w)return U+100;return U},"parseTwoDigitYear"),lI=1576800000000,nI=Q(($)=>{if($.getTime()-(new Date()).getTime()>lI)return new Date(Date.UTC($.getUTCFullYear()-100,$.getUTCMonth(),$.getUTCDate(),$.getUTCHours(),$.getUTCMinutes(),$.getUTCSeconds(),$.getUTCMilliseconds()));return $},"adjustRfc850Year"),r$=Q(($)=>{const w=Gw.indexOf($);if(w<0)throw new TypeError(`Invalid month: ${$}`);return w+1},"parseMonthByShortName"),sI=[31,28,31,30,31,30,31,31,30,31,30,31],mI=Q(($,w,U)=>{let G=sI[w];if(w===1&&iI($))G=29;if(U>G)throw new TypeError(`Invalid day for ${Gw[w]} in ${$}: ${U}`)},"validateDayOfMonth"),iI=Q(($)=>{return $%4===0&&($%100!==0||$%400===0)},"isLeapYear"),s=Q(($,w,U,G)=>{const f=FW(O0($));if(f<U||f>G)throw new TypeError(`${w} must be between ${U} and ${G}, inclusive`);return f},"parseDateValue"),rI=Q(($)=>{if($===null||$===void 0)return 0;return RW("0."+$)*1000},"parseMilliseconds"),oI=Q(($)=>{const w=$[0];let U=1;if(w=="+")U=1;else if(w=="-")U=-1;else throw new TypeError(`Offset direction, ${w}, must be "+" or "-"`);const G=Number($.substring(1,3)),f=Number($.substring(4,6));return U*(G*60+f)*60*1000},"parseOffsetToMilliseconds"),O0=Q(($)=>{let w=0;while(w<$.length-1&&$.charAt(w)==="0")w++;if(w===0)return $;return $.slice(w)},"stripLeadingZeroes"),YW=class $ extends Error{constructor(w){super(w.message);Object.setPrototypeOf(this,$.prototype),this.name=w.name,this.$fault=w.$fault,this.$metadata=w.$metadata}};Q(YW,"ServiceException");var tI=YW,zW=Q(($,w={})=>{Object.entries(w).filter(([,G])=>G!==void 0).forEach(([G,f])=>{if($[G]==null||$[G]==="")$[G]=f});const U=$.message||$.Message||"UnknownError";return $.message=U,delete $.Message,$},"decorateServiceException"),QW=Q(({output:$,parsedBody:w,exceptionCtor:U,errorCode:G})=>{const f=eI($),E=f.httpStatusCode?f.httpStatusCode+"":void 0,W=new U({name:(w==null?void 0:w.code)||(w==null?void 0:w.Code)||G||E||"UnknownError",$fault:"client",$metadata:f});throw zW(W,w)},"throwDefaultError"),aI=Q(($)=>{return({output:w,parsedBody:U,errorCode:G})=>{QW({output:w,parsedBody:U,exceptionCtor:$,errorCode:G})}},"withBaseException"),eI=Q(($)=>({httpStatusCode:$.statusCode,requestId:$.headers["x-amzn-requestid"]??$.headers["x-amzn-request-id"]??$.headers["x-amz-request-id"],extendedRequestId:$.headers["x-amz-id-2"],cfId:$.headers["x-amz-cf-id"]}),"deserializeMetadata"),$Y=Q(($)=>{switch($){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:30000};default:return{}}},"loadConfigsForDefaultMode"),eE=!1,wY=Q(($)=>{if($&&!eE&&parseInt($.substring(1,$.indexOf(".")))<16)eE=!0},"emitWarningIfUnsupportedVersion"),UY=Q(($)=>{const w=[];for(let U in o$.AlgorithmId){const G=o$.AlgorithmId[U];if($[G]===void 0)continue;w.push({algorithmId:()=>G,checksumConstructor:()=>$[G]})}return{_checksumAlgorithms:w,addChecksumAlgorithm(U){this._checksumAlgorithms.push(U)},checksumAlgorithms(){return this._checksumAlgorithms}}},"getChecksumConfiguration"),fY=Q(($)=>{const w={};return $.checksumAlgorithms().forEach((U)=>{w[U.algorithmId()]=U.checksumConstructor()}),w},"resolveChecksumRuntimeConfig"),GY=Q(($)=>{let w=$.retryStrategy;return{setRetryStrategy(U){w=U},retryStrategy(){return w}}},"getRetryConfiguration"),EY=Q(($)=>{const w={};return w.retryStrategy=$.retryStrategy(),w},"resolveRetryRuntimeConfig"),MW=Q(($)=>{return{...UY($),...GY($)}},"getDefaultExtensionConfiguration"),WY=MW,LY=Q(($)=>{return{...fY($),...EY($)}},"resolveDefaultRuntimeConfig");Q(j1,"extendedEncodeURIComponent");var RY=Q(($)=>Array.isArray($)?$:[$],"getArrayIfSingleItem"),JW=Q(($)=>{for(let U in $)if($.hasOwnProperty(U)&&$[U]["#text"]!==void 0)$[U]=$[U]["#text"];else if(typeof $[U]==="object"&&$[U]!==null)$[U]=JW($[U]);return $},"getValueFromTextNode"),l0=Q(function(){const $=Object.getPrototypeOf(this).constructor,U=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(U,$.prototype),U},"StringWrapper");l0.prototype=Object.create(String.prototype,{constructor:{value:l0,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(l0,String);var TW=class $ extends l0{deserializeJSON(){return JSON.parse(super.toString())}toJSON(){return super.toString()}static fromObject(w){if(w instanceof $)return w;else if(w instanceof String||typeof w==="string")return new $(w);return new $(JSON.stringify(w))}};Q(TW,"LazyJsonString");var XY=TW;Q(Ew,"map");var ZY=Q(($)=>{const w={};for(let[U,G]of Object.entries($||{}))w[U]=[,G];return w},"convertMap"),FY=Q(($,w)=>{const U={};for(let G in w)KW(U,$,w,G);return U},"take"),IY=Q(($,w,U)=>{return Ew($,Object.entries(U).reduce((G,[f,E])=>{if(Array.isArray(E))G[f]=E;else if(typeof E==="function")G[f]=[w,E()];else G[f]=[w,E];return G},{}))},"mapWithFilter"),KW=Q(($,w,U,G)=>{if(w!==null){let W=U[G];if(typeof W==="function")W=[,W];const[L=YY,R=zY,X=G]=W;if(typeof L==="function"&&L(w[X])||typeof L!=="function"&&!!L)$[G]=R(w[X]);return}let[f,E]=U[G];if(typeof E==="function"){let W;const L=f===void 0&&(W=E())!=null,R=typeof f==="function"&&!!f(void 0)||typeof f!=="function"&&!!f;if(L)$[G]=W;else if(R)$[G]=E()}else{const W=f===void 0&&E!=null,L=typeof f==="function"&&!!f(E)||typeof f!=="function"&&!!f;if(W||L)$[G]=E}},"applyInstruction"),YY=Q(($)=>$!=null,"nonNullish"),zY=Q(($)=>$,"pass"),QY=Q(($,w,U,G,f,E)=>{if(w!=null&&w[U]!==void 0){const W=G();if(W.length<=0)throw new Error("Empty value provided for input HTTP label: "+U+".");$=$.replace(f,E?W.split("/").map((L)=>j1(L)).join("/"):j1(W))}else throw new Error("No value provided for input HTTP label: "+U+".");return $},"resolvedPath"),MY=Q(($)=>{if($!==$)return"NaN";switch($){case Infinity:return"Infinity";case (-Infinity):return"-Infinity";default:return $}},"serializeFloat"),JY=Q(($)=>$.toISOString().replace(".000Z","Z"),"serializeDateTime"),$w=Q(($)=>{if($==null)return{};if(Array.isArray($))return $.filter((w)=>w!=null).map($w);if(typeof $==="object"){const w={};for(let U of Object.keys($)){if($[U]==null)continue;w[U]=$w($[U])}return w}return $},"_json");Q(OW,"splitEvery")});var HW=M((BW)=>{Object.defineProperty(BW,"__esModule",{value:!0});BW.isStreamingPayload=void 0;var TY=import.meta.require("stream"),KY=($)=>($===null||$===void 0?void 0:$.body)instanceof TY.Readable||typeof ReadableStream!=="undefined"&&($===null||$===void 0?void 0:$.body)instanceof ReadableStream;BW.isStreamingPayload=KY});var pW=M((GM,dW)=>{var{defineProperty:S1,getOwnPropertyDescriptor:OY,getOwnPropertyNames:AY}=Object,BY=Object.prototype.hasOwnProperty,P=($,w)=>S1($,"name",{value:w,configurable:!0}),VY=($,w)=>{for(var U in w)S1($,U,{get:w[U],enumerable:!0})},HY=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of AY(w))if(!BY.call($,f)&&f!==U)S1($,f,{get:()=>w[f],enumerable:!(G=OY(w,f))||G.enumerable})}return $},CY=($)=>HY(S1({},"__esModule",{value:!0}),$),NW={};VY(NW,{AdaptiveRetryStrategy:()=>jY,CONFIG_MAX_ATTEMPTS:()=>Lw,CONFIG_RETRY_MODE:()=>cW,ENV_MAX_ATTEMPTS:()=>Ww,ENV_RETRY_MODE:()=>kW,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>PY,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>bY,StandardRetryStrategy:()=>hW,defaultDelayDecider:()=>jW,defaultRetryDecider:()=>PW,getOmitRetryHeadersPlugin:()=>hY,getRetryAfterHint:()=>_W,getRetryPlugin:()=>yY,omitRetryHeadersMiddleware:()=>vW,omitRetryHeadersMiddlewareOptions:()=>xW,resolveRetryConfig:()=>SY,retryMiddleware:()=>yW,retryMiddlewareOptions:()=>uW});dW.exports=CY(NW);var V0=i(),qW=j$(),C=VG(),NY=P(($,w)=>{const U=$,G=(w==null?void 0:w.noRetryIncrement)??C.NO_RETRY_INCREMENT,f=(w==null?void 0:w.retryCost)??C.RETRY_COST,E=(w==null?void 0:w.timeoutRetryCost)??C.TIMEOUT_RETRY_COST;let W=$;const L=P((F)=>F.name==="TimeoutError"?E:f,"getCapacityAmount"),R=P((F)=>L(F)<=W,"hasRetryTokens");return Object.freeze({hasRetryTokens:R,retrieveRetryTokens:P((F)=>{if(!R(F))throw new Error("No retry token available");const Y=L(F);return W-=Y,Y},"retrieveRetryTokens"),releaseRetryTokens:P((F)=>{W+=F??G,W=Math.min(W,U)},"releaseRetryTokens")})},"getDefaultRetryQuota"),jW=P(($,w)=>Math.floor(Math.min(C.MAXIMUM_RETRY_DELAY,Math.random()*2**w*$)),"defaultDelayDecider"),$0=P$(),PW=P(($)=>{if(!$)return!1;return $0.isRetryableByTrait($)||$0.isClockSkewError($)||$0.isThrottlingError($)||$0.isTransientError($)},"defaultRetryDecider"),SW=P(($)=>{if($ instanceof Error)return $;if($ instanceof Object)return Object.assign(new Error,$);if(typeof $==="string")return new Error($);return new Error(`AWS SDK error wrapper for ${$}`)},"asSdkError"),bW=class ${constructor(w,U){this.maxAttemptsProvider=w,this.mode=C.RETRY_MODES.STANDARD,this.retryDecider=(U==null?void 0:U.retryDecider)??PW,this.delayDecider=(U==null?void 0:U.delayDecider)??jW,this.retryQuota=(U==null?void 0:U.retryQuota)??NY(C.INITIAL_RETRY_TOKENS)}shouldRetry(w,U,G){return U<G&&this.retryDecider(w)&&this.retryQuota.hasRetryTokens(w)}async getMaxAttempts(){let w;try{w=await this.maxAttemptsProvider()}catch(U){w=C.DEFAULT_MAX_ATTEMPTS}return w}async retry(w,U,G){let f,E=0,W=0;const L=await this.getMaxAttempts(),{request:R}=U;if(V0.HttpRequest.isInstance(R))R.headers[C.INVOCATION_ID_HEADER]=qW.v4();while(!0)try{if(V0.HttpRequest.isInstance(R))R.headers[C.REQUEST_HEADER]=`attempt=${E+1}; max=${L}`;if(G==null?void 0:G.beforeRequest)await G.beforeRequest();const{response:X,output:Z}=await w(U);if(G==null?void 0:G.afterRequest)G.afterRequest(X);return this.retryQuota.releaseRetryTokens(f),Z.$metadata.attempts=E+1,Z.$metadata.totalRetryDelay=W,{response:X,output:Z}}catch(X){const Z=SW(X);if(E++,this.shouldRetry(Z,E,L)){f=this.retryQuota.retrieveRetryTokens(Z);const F=this.delayDecider($0.isThrottlingError(Z)?C.THROTTLING_RETRY_DELAY_BASE:C.DEFAULT_RETRY_DELAY_BASE,E),Y=qY(Z.$response),I=Math.max(Y||0,F);W+=I,await new Promise((z)=>setTimeout(z,I));continue}if(!Z.$metadata)Z.$metadata={};throw Z.$metadata.attempts=E,Z.$metadata.totalRetryDelay=W,Z}}};P(bW,"StandardRetryStrategy");var hW=bW,qY=P(($)=>{if(!V0.HttpResponse.isInstance($))return;const w=Object.keys($.headers).find((E)=>E.toLowerCase()==="retry-after");if(!w)return;const U=$.headers[w],G=Number(U);if(!Number.isNaN(G))return G*1000;return new Date(U).getTime()-Date.now()},"getDelayFromRetryAfterHeader"),DW=class $ extends hW{constructor(w,U){const{rateLimiter:G,...f}=U??{};super(w,f);this.rateLimiter=G??new C.DefaultRateLimiter,this.mode=C.RETRY_MODES.ADAPTIVE}async retry(w,U){return super.retry(w,U,{beforeRequest:async()=>{return this.rateLimiter.getSendToken()},afterRequest:(G)=>{this.rateLimiter.updateClientSendingRate(G)}})}};P(DW,"AdaptiveRetryStrategy");var jY=DW,CW=n(),Ww="AWS_MAX_ATTEMPTS",Lw="max_attempts",PY={environmentVariableSelector:($)=>{const w=$[Ww];if(!w)return;const U=parseInt(w);if(Number.isNaN(U))throw new Error(`Environment variable ${Ww} mast be a number, got "${w}"`);return U},configFileSelector:($)=>{const w=$[Lw];if(!w)return;const U=parseInt(w);if(Number.isNaN(U))throw new Error(`Shared config file entry ${Lw} mast be a number, got "${w}"`);return U},default:C.DEFAULT_MAX_ATTEMPTS},SY=P(($)=>{const{retryStrategy:w}=$,U=CW.normalizeProvider($.maxAttempts??C.DEFAULT_MAX_ATTEMPTS);return{...$,maxAttempts:U,retryStrategy:async()=>{if(w)return w;if(await CW.normalizeProvider($.retryMode)()===C.RETRY_MODES.ADAPTIVE)return new C.AdaptiveRetryStrategy(U);return new C.StandardRetryStrategy(U)}}},"resolveRetryConfig"),kW="AWS_RETRY_MODE",cW="retry_mode",bY={environmentVariableSelector:($)=>$[kW],configFileSelector:($)=>$[cW],default:C.DEFAULT_RETRY_MODE},vW=P(()=>($)=>async(w)=>{const{request:U}=w;if(V0.HttpRequest.isInstance(U))delete U.headers[C.INVOCATION_ID_HEADER],delete U.headers[C.REQUEST_HEADER];return $(w)},"omitRetryHeadersMiddleware"),xW={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},hY=P(($)=>({applyToStack:(w)=>{w.addRelativeTo(vW(),xW)}}),"getOmitRetryHeadersPlugin"),DY=B0(),kY=HW(),yW=P(($)=>(w,U)=>async(G)=>{var f;let E=await $.retryStrategy();const W=await $.maxAttempts();if(cY(E)){E=E;let L=await E.acquireInitialRetryToken(U.partition_id),R=new Error,X=0,Z=0;const{request:F}=G,Y=V0.HttpRequest.isInstance(F);if(Y)F.headers[C.INVOCATION_ID_HEADER]=qW.v4();while(!0)try{if(Y)F.headers[C.REQUEST_HEADER]=`attempt=${X+1}; max=${W}`;const{response:I,output:z}=await w(G);return E.recordSuccess(L),z.$metadata.attempts=X+1,z.$metadata.totalRetryDelay=Z,{response:I,output:z}}catch(I){const z=vY(I);if(R=SW(I),Y&&kY.isStreamingPayload(F))throw(f=U.logger instanceof DY.NoOpLogger?console:U.logger)==null||f.warn("An error was encountered in a non-retryable streaming request."),R;try{L=await E.refreshRetryTokenForRetry(L,z)}catch(O){if(!R.$metadata)R.$metadata={};throw R.$metadata.attempts=X+1,R.$metadata.totalRetryDelay=Z,R}X=L.getRetryCount();const J=L.getRetryDelay();Z+=J,await new Promise((O)=>setTimeout(O,J))}}else{if(E=E,E==null?void 0:E.mode)U.userAgent=[...U.userAgent||[],["cfg/retry-mode",E.mode]];return E.retry(w,G)}},"retryMiddleware"),cY=P(($)=>typeof $.acquireInitialRetryToken!=="undefined"&&typeof $.refreshRetryTokenForRetry!=="undefined"&&typeof $.recordSuccess!=="undefined","isRetryStrategyV2"),vY=P(($)=>{const w={error:$,errorType:xY($)},U=_W($.$response);if(U)w.retryAfterHint=U;return w},"getRetryErrorInfo"),xY=P(($)=>{if($0.isThrottlingError($))return"THROTTLING";if($0.isTransientError($))return"TRANSIENT";if($0.isServerError($))return"SERVER_ERROR";return"CLIENT_ERROR"},"getRetryErrorType"),uW={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},yY=P(($)=>({applyToStack:(w)=>{w.add(yW($),uW)}}),"getRetryPlugin"),_W=P(($)=>{if(!V0.HttpResponse.isInstance($))return;const w=Object.keys($.headers).find((E)=>E.toLowerCase()==="retry-after");if(!w)return;const U=$.headers[w],G=Number(U);if(!Number.isNaN(G))return new Date(G*1000);return new Date(U)},"getRetryAfterHint")});var Xw=M((EM,LL)=>{var nW=function($){const w=new Map;for(let U of $)w.set(U.schemeId,U);return w},fL=function($,w){return new EL($,w)},WL=function($,w,U,G,f){return H(async function*E(W,L,...R){let X=W.startingToken||void 0,Z=!0,F;while(Z){if(L[U]=X,f)L[f]=L[f]??W.pageSize;if(W.client instanceof $)F=await R5(w,W.client,L,...R);else throw new Error(`Invalid client, expected instance of ${$.name}`);yield F;const Y=X;X=X5(F,G),Z=!!(X&&(!W.stopOnSameToken||X!==Y))}return},"paginateOperation")},h1=Object.defineProperty,uY=Object.getOwnPropertyDescriptor,_Y=Object.getOwnPropertyNames,dY=Object.prototype.hasOwnProperty,H=($,w)=>h1($,"name",{value:w,configurable:!0}),pY=($,w)=>{for(var U in w)h1($,U,{get:w[U],enumerable:!0})},gY=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of _Y(w))if(!dY.call($,f)&&f!==U)h1($,f,{get:()=>w[f],enumerable:!(G=uY(w,f))||G.enumerable})}return $},lY=($)=>gY(h1({},"__esModule",{value:!0}),$),gW={};pY(gW,{DefaultIdentityProviderConfig:()=>eY,EXPIRATION_MS:()=>wL,HttpApiKeyAuthSigner:()=>$5,HttpBearerAuthSigner:()=>w5,NoAuthSigner:()=>U5,RequestBuilder:()=>EL,createIsIdentityExpiredFunction:()=>$L,createPaginator:()=>WL,doesIdentityRequireRefresh:()=>UL,getHttpAuthSchemeEndpointRuleSetPlugin:()=>sY,getHttpAuthSchemePlugin:()=>iY,getHttpSigningPlugin:()=>aY,getSmithyContext:()=>E5,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>sW,httpAuthSchemeMiddleware:()=>Rw,httpAuthSchemeMiddlewareOptions:()=>mW,httpSigningMiddleware:()=>iW,httpSigningMiddlewareOptions:()=>rW,isIdentityExpired:()=>f5,memoizeIdentityProvider:()=>G5,normalizeProvider:()=>W5,requestBuilder:()=>fL});LL.exports=lY(gW);var lW=n();H(nW,"convertHttpAuthSchemesToMap");var Rw=H(($,w)=>(U,G)=>async(f)=>{var E;const W=$.httpAuthSchemeProvider(await w.httpAuthSchemeParametersProvider($,G,f.input)),L=nW($.httpAuthSchemes),R=lW.getSmithyContext(G),X=[];for(let Z of W){const F=L.get(Z.schemeId);if(!F){X.push(`HttpAuthScheme \`${Z.schemeId}\` was not enabled for this service.`);continue}const Y=F.identityProvider(await w.identityProviderConfigProvider($));if(!Y){X.push(`HttpAuthScheme \`${Z.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:I={},signingProperties:z={}}=((E=Z.propertiesExtractor)==null?void 0:E.call(Z,$,G))||{};Z.identityProperties=Object.assign(Z.identityProperties||{},I),Z.signingProperties=Object.assign(Z.signingProperties||{},z),R.selectedHttpAuthScheme={httpAuthOption:Z,identity:await Y(Z.identityProperties),signer:F.signer};break}if(!R.selectedHttpAuthScheme)throw new Error(X.join("\n"));return U(f)},"httpAuthSchemeMiddleware"),nY=Uf(),sW={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:nY.endpointMiddlewareOptions.name},sY=H(($,{httpAuthSchemeParametersProvider:w,identityProviderConfigProvider:U})=>({applyToStack:(G)=>{G.addRelativeTo(Rw($,{httpAuthSchemeParametersProvider:w,identityProviderConfigProvider:U}),sW)}}),"getHttpAuthSchemeEndpointRuleSetPlugin"),mY=O$(),mW={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:mY.serializerMiddlewareOption.name},iY=H(($,{httpAuthSchemeParametersProvider:w,identityProviderConfigProvider:U})=>({applyToStack:(G)=>{G.addRelativeTo(Rw($,{httpAuthSchemeParametersProvider:w,identityProviderConfigProvider:U}),mW)}}),"getHttpAuthSchemePlugin"),D1=i(),rY=H(($)=>(w)=>{throw w},"defaultErrorHandler"),oY=H(($,w)=>{},"defaultSuccessHandler"),iW=H(($)=>(w,U)=>async(G)=>{if(!D1.HttpRequest.isInstance(G.request))return w(G);const E=lW.getSmithyContext(U).selectedHttpAuthScheme;if(!E)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:W={}},identity:L,signer:R}=E,X=await w({...G,request:await R.sign(G.request,L,W)}).catch((R.errorHandler||rY)(W));return(R.successHandler||oY)(X.response,W),X},"httpSigningMiddleware"),tY=pW(),rW={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:tY.retryMiddlewareOptions.name},aY=H(($)=>({applyToStack:(w)=>{w.addRelativeTo(iW($),rW)}}),"getHttpSigningPlugin"),oW=class ${constructor(w){this.authSchemes=new Map;for(let[U,G]of Object.entries(w))if(G!==void 0)this.authSchemes.set(U,G)}getIdentityProvider(w){return this.authSchemes.get(w)}};H(oW,"DefaultIdentityProviderConfig");var eY=oW,b1=Q0(),tW=class ${async sign(w,U,G){if(!G)throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!G.name)throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!G.in)throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!U.apiKey)throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");const f=D1.HttpRequest.clone(w);if(G.in===b1.HttpApiKeyAuthLocation.QUERY)f.query[G.name]=U.apiKey;else if(G.in===b1.HttpApiKeyAuthLocation.HEADER)f.headers[G.name]=G.scheme?`${G.scheme} ${U.apiKey}`:U.apiKey;else throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+G.in+"`");return f}};H(tW,"HttpApiKeyAuthSigner");var $5=tW,aW=class ${async sign(w,U,G){const f=D1.HttpRequest.clone(w);if(!U.token)throw new Error("request could not be signed with `token` since the `token` is not defined");return f.headers.Authorization=`Bearer ${U.token}`,f}};H(aW,"HttpBearerAuthSigner");var w5=aW,eW=class ${async sign(w,U,G){return w}};H(eW,"NoAuthSigner");var U5=eW,$L=H(($)=>(w)=>UL(w)&&w.expiration.getTime()-Date.now()<$,"createIsIdentityExpiredFunction"),wL=300000,f5=$L(wL),UL=H(($)=>$.expiration!==void 0,"doesIdentityRequireRefresh"),G5=H(($,w,U)=>{if($===void 0)return;const G=typeof $!=="function"?async()=>Promise.resolve($):$;let f,E,W,L=!1;const R=H(async(X)=>{if(!E)E=G(X);try{f=await E,W=!0,L=!1}finally{E=void 0}return f},"coalesceProvider");if(w===void 0)return async(X)=>{if(!W||(X==null?void 0:X.forceRefresh))f=await R(X);return f};return async(X)=>{if(!W||(X==null?void 0:X.forceRefresh))f=await R(X);if(L)return f;if(!U(f))return L=!0,f;if(w(f))return await R(X),f;return f}},"memoizeIdentityProvider"),E5=H(($)=>$[b1.SMITHY_CONTEXT_KEY]||($[b1.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),W5=H(($)=>{if(typeof $==="function")return $;const w=Promise.resolve($);return()=>w},"normalizeProvider"),L5=B0();H(fL,"requestBuilder");var GL=class ${constructor(w,U){this.input=w,this.context=U,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){const{hostname:w,protocol:U="https",port:G,path:f}=await this.context.endpoint();this.path=f;for(let E of this.resolvePathStack)E(this.path);return new D1.HttpRequest({protocol:U,hostname:this.hostname||w,port:G,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(w){return this.hostname=w,this}bp(w){return this.resolvePathStack.push((U)=>{this.path=`${(U==null?void 0:U.endsWith("/"))?U.slice(0,-1):U||""}`+w}),this}p(w,U,G,f){return this.resolvePathStack.push((E)=>{this.path=L5.resolvedPath(E,this.input,w,U,G,f)}),this}h(w){return this.headers=w,this}q(w){return this.query=w,this}b(w){return this.body=w,this}m(w){return this.method=w,this}};H(GL,"RequestBuilder");var EL=GL,R5=H(async($,w,U,...G)=>{return await w.send(new $(U),...G)},"makePagedClientRequest");H(WL,"createPaginator");var X5=H(($,w)=>{let U=$;const G=w.split(".");for(let f of G){if(!U||typeof U!=="object")return;U=U[f]}return U},"get")});var jR=M((VA,a1)=>{var wR,UR,fR,GR,ER,WR,LR,RR,XR,ZR,FR,IR,YR,o1,Sw,zR,QR,MR,j0,JR,TR,KR,OR,AR,BR,VR,HR,CR,t1,NR,qR;(function($){var w=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function(G){$(U(w,U(G)))});else if(typeof a1==="object"&&typeof VA==="object")$(U(w,U(VA)));else $(U(w));function U(G,f){if(G!==w)if(typeof Object.create==="function")Object.defineProperty(G,"__esModule",{value:!0});else G.__esModule=!0;return function(E,W){return G[E]=f?f(E,W):W}}})(function($){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,E){f.__proto__=E}||function(f,E){for(var W in E)if(Object.prototype.hasOwnProperty.call(E,W))f[W]=E[W]};wR=function(f,E){if(typeof E!=="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");w(f,E);function W(){this.constructor=f}f.prototype=E===null?Object.create(E):(W.prototype=E.prototype,new W)},UR=Object.assign||function(f){for(var E,W=1,L=arguments.length;W<L;W++){E=arguments[W];for(var R in E)if(Object.prototype.hasOwnProperty.call(E,R))f[R]=E[R]}return f},fR=function(f,E){var W={};for(var L in f)if(Object.prototype.hasOwnProperty.call(f,L)&&E.indexOf(L)<0)W[L]=f[L];if(f!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var R=0,L=Object.getOwnPropertySymbols(f);R<L.length;R++)if(E.indexOf(L[R])<0&&Object.prototype.propertyIsEnumerable.call(f,L[R]))W[L[R]]=f[L[R]]}return W},GR=function(f,E,W,L){var R=arguments.length,X=R<3?E:L===null?L=Object.getOwnPropertyDescriptor(E,W):L,Z;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")X=Reflect.decorate(f,E,W,L);else for(var F=f.length-1;F>=0;F--)if(Z=f[F])X=(R<3?Z(X):R>3?Z(E,W,X):Z(E,W))||X;return R>3&&X&&Object.defineProperty(E,W,X),X},ER=function(f,E){return function(W,L){E(W,L,f)}},WR=function(f,E,W,L,R,X){function Z(S){if(S!==void 0&&typeof S!=="function")throw new TypeError("Function expected");return S}var F=L.kind,Y=F==="getter"?"get":F==="setter"?"set":"value",I=!E&&f?L.static?f:f.prototype:null,z=E||(I?Object.getOwnPropertyDescriptor(I,L.name):{}),J,O=!1;for(var T=W.length-1;T>=0;T--){var K={};for(var A in L)K[A]=A==="access"?{}:L[A];for(var A in L.access)K.access[A]=L.access[A];K.addInitializer=function(S){if(O)throw new TypeError("Cannot add initializers after decoration has completed");X.push(Z(S||null))};var V=W[T](F==="accessor"?{get:z.get,set:z.set}:z[Y],K);if(F==="accessor"){if(V===void 0)continue;if(V===null||typeof V!=="object")throw new TypeError("Object expected");if(J=Z(V.get))z.get=J;if(J=Z(V.set))z.set=J;if(J=Z(V.init))R.unshift(J)}else if(J=Z(V))if(F==="field")R.unshift(J);else z[Y]=J}if(I)Object.defineProperty(I,L.name,z);O=!0},LR=function(f,E,W){var L=arguments.length>2;for(var R=0;R<E.length;R++)W=L?E[R].call(f,W):E[R].call(f);return L?W:void 0},RR=function(f){return typeof f==="symbol"?f:"".concat(f)},XR=function(f,E,W){if(typeof E==="symbol")E=E.description?"[".concat(E.description,"]"):"";return Object.defineProperty(f,"name",{configurable:!0,value:W?"".concat(W," ",E):E})},ZR=function(f,E){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(f,E)},FR=function(f,E,W,L){function R(X){return X instanceof W?X:new W(function(Z){Z(X)})}return new(W||(W=Promise))(function(X,Z){function F(z){try{I(L.next(z))}catch(J){Z(J)}}function Y(z){try{I(L.throw(z))}catch(J){Z(J)}}function I(z){z.done?X(z.value):R(z.value).then(F,Y)}I((L=L.apply(f,E||[])).next())})},IR=function(f,E){var W={label:0,sent:function(){if(X[0]&1)throw X[1];return X[1]},trys:[],ops:[]},L,R,X,Z;return Z={next:F(0),throw:F(1),return:F(2)},typeof Symbol==="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function F(I){return function(z){return Y([I,z])}}function Y(I){if(L)throw new TypeError("Generator is already executing.");while(Z&&(Z=0,I[0]&&(W=0)),W)try{if(L=1,R&&(X=I[0]&2?R.return:I[0]?R.throw||((X=R.return)&&X.call(R),0):R.next)&&!(X=X.call(R,I[1])).done)return X;if(R=0,X)I=[I[0]&2,X.value];switch(I[0]){case 0:case 1:X=I;break;case 4:return W.label++,{value:I[1],done:!1};case 5:W.label++,R=I[1],I=[0];continue;case 7:I=W.ops.pop(),W.trys.pop();continue;default:if((X=W.trys,!(X=X.length>0&&X[X.length-1]))&&(I[0]===6||I[0]===2)){W=0;continue}if(I[0]===3&&(!X||I[1]>X[0]&&I[1]<X[3])){W.label=I[1];break}if(I[0]===6&&W.label<X[1]){W.label=X[1],X=I;break}if(X&&W.label<X[2]){W.label=X[2],W.ops.push(I);break}if(X[2])W.ops.pop();W.trys.pop();continue}I=E.call(f,W)}catch(z){I=[6,z],R=0}finally{L=X=0}if(I[0]&5)throw I[1];return{value:I[0]?I[1]:void 0,done:!0}}},YR=function(f,E){for(var W in f)if(W!=="default"&&!Object.prototype.hasOwnProperty.call(E,W))t1(E,f,W)},t1=Object.create?function(f,E,W,L){if(L===void 0)L=W;var R=Object.getOwnPropertyDescriptor(E,W);if(!R||("get"in R?!E.__esModule:R.writable||R.configurable))R={enumerable:!0,get:function(){return E[W]}};Object.defineProperty(f,L,R)}:function(f,E,W,L){if(L===void 0)L=W;f[L]=E[W]},o1=function(f){var E=typeof Symbol==="function"&&Symbol.iterator,W=E&&f[E],L=0;if(W)return W.call(f);if(f&&typeof f.length==="number")return{next:function(){if(f&&L>=f.length)f=void 0;return{value:f&&f[L++],done:!f}}};throw new TypeError(E?"Object is not iterable.":"Symbol.iterator is not defined.")},Sw=function(f,E){var W=typeof Symbol==="function"&&f[Symbol.iterator];if(!W)return f;var L=W.call(f),R,X=[],Z;try{while((E===void 0||E-- >0)&&!(R=L.next()).done)X.push(R.value)}catch(F){Z={error:F}}finally{try{if(R&&!R.done&&(W=L.return))W.call(L)}finally{if(Z)throw Z.error}}return X},zR=function(){for(var f=[],E=0;E<arguments.length;E++)f=f.concat(Sw(arguments[E]));return f},QR=function(){for(var f=0,E=0,W=arguments.length;E<W;E++)f+=arguments[E].length;for(var L=Array(f),R=0,E=0;E<W;E++)for(var X=arguments[E],Z=0,F=X.length;Z<F;Z++,R++)L[R]=X[Z];return L},MR=function(f,E,W){if(W||arguments.length===2){for(var L=0,R=E.length,X;L<R;L++)if(X||!(L in E)){if(!X)X=Array.prototype.slice.call(E,0,L);X[L]=E[L]}}return f.concat(X||Array.prototype.slice.call(E))},j0=function(f){return this instanceof j0?(this.v=f,this):new j0(f)},JR=function(f,E,W){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var L=W.apply(f,E||[]),R,X=[];return R={},F("next"),F("throw"),F("return",Z),R[Symbol.asyncIterator]=function(){return this},R;function Z(T){return function(K){return Promise.resolve(K).then(T,J)}}function F(T,K){if(L[T]){if(R[T]=function(A){return new Promise(function(V,S){X.push([T,A,V,S])>1||Y(T,A)})},K)R[T]=K(R[T])}}function Y(T,K){try{I(L[T](K))}catch(A){O(X[0][3],A)}}function I(T){T.value instanceof j0?Promise.resolve(T.value.v).then(z,J):O(X[0][2],T)}function z(T){Y("next",T)}function J(T){Y("throw",T)}function O(T,K){if(T(K),X.shift(),X.length)Y(X[0][0],X[0][1])}},TR=function(f){var E,W;return E={},L("next"),L("throw",function(R){throw R}),L("return"),E[Symbol.iterator]=function(){return this},E;function L(R,X){E[R]=f[R]?function(Z){return(W=!W)?{value:j0(f[R](Z)),done:!1}:X?X(Z):Z}:X}},KR=function(f){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var E=f[Symbol.asyncIterator],W;return E?E.call(f):(f=typeof o1==="function"?o1(f):f[Symbol.iterator](),W={},L("next"),L("throw"),L("return"),W[Symbol.asyncIterator]=function(){return this},W);function L(X){W[X]=f[X]&&function(Z){return new Promise(function(F,Y){Z=f[X](Z),R(F,Y,Z.done,Z.value)})}}function R(X,Z,F,Y){Promise.resolve(Y).then(function(I){X({value:I,done:F})},Z)}},OR=function(f,E){if(Object.defineProperty)Object.defineProperty(f,"raw",{value:E});else f.raw=E;return f};var U=Object.create?function(f,E){Object.defineProperty(f,"default",{enumerable:!0,value:E})}:function(f,E){f.default=E};AR=function(f){if(f&&f.__esModule)return f;var E={};if(f!=null){for(var W in f)if(W!=="default"&&Object.prototype.hasOwnProperty.call(f,W))t1(E,f,W)}return U(E,f),E},BR=function(f){return f&&f.__esModule?f:{default:f}},VR=function(f,E,W,L){if(W==="a"&&!L)throw new TypeError("Private accessor was defined without a getter");if(typeof E==="function"?f!==E||!L:!E.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return W==="m"?L:W==="a"?L.call(f):L?L.value:E.get(f)},HR=function(f,E,W,L,R){if(L==="m")throw new TypeError("Private method is not writable");if(L==="a"&&!R)throw new TypeError("Private accessor was defined without a setter");if(typeof E==="function"?f!==E||!R:!E.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return L==="a"?R.call(f,W):R?R.value=W:E.set(f,W),W},CR=function(f,E){if(E===null||typeof E!=="object"&&typeof E!=="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof f==="function"?E===f:f.has(E)},NR=function(f,E,W){if(E!==null&&E!==void 0){if(typeof E!=="object"&&typeof E!=="function")throw new TypeError("Object expected.");var L,R;if(W){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");L=E[Symbol.asyncDispose]}if(L===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");if(L=E[Symbol.dispose],W)R=L}if(typeof L!=="function")throw new TypeError("Object not disposable.");if(R)L=function(){try{R.call(this)}catch(X){return Promise.reject(X)}};f.stack.push({value:E,dispose:L,async:W})}else if(W)f.stack.push({async:!0});return E};var G=typeof SuppressedError==="function"?SuppressedError:function(f,E,W){var L=new Error(W);return L.name="SuppressedError",L.error=f,L.suppressed=E,L};qR=function(f){function E(L){f.error=f.hasError?new G(L,f.error,"An error was suppressed during disposal."):L,f.hasError=!0}function W(){while(f.stack.length){var L=f.stack.pop();try{var R=L.dispose&&L.dispose.call(L.value);if(L.async)return Promise.resolve(R).then(W,function(X){return E(X),W()})}catch(X){E(X)}}if(f.hasError)throw f.error}return W()},$("__extends",wR),$("__assign",UR),$("__rest",fR),$("__decorate",GR),$("__param",ER),$("__esDecorate",WR),$("__runInitializers",LR),$("__propKey",RR),$("__setFunctionName",XR),$("__metadata",ZR),$("__awaiter",FR),$("__generator",IR),$("__exportStar",YR),$("__createBinding",t1),$("__values",o1),$("__read",Sw),$("__spread",zR),$("__spreadArrays",QR),$("__spreadArray",MR),$("__await",j0),$("__asyncGenerator",JR),$("__asyncDelegator",TR),$("__asyncValues",KR),$("__makeTemplateObject",OR),$("__importStar",AR),$("__importDefault",BR),$("__classPrivateFieldGet",VR),$("__classPrivateFieldSet",HR),$("__classPrivateFieldIn",CR),$("__addDisposableResource",NR),$("__disposeResources",qR)})});var hR=M((HA,bR)=>{var{defineProperty:e1,getOwnPropertyDescriptor:n5,getOwnPropertyNames:s5}=Object,m5=Object.prototype.hasOwnProperty,i5=($,w)=>e1($,"name",{value:w,configurable:!0}),r5=($,w)=>{for(var U in w)e1($,U,{get:w[U],enumerable:!0})},o5=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of s5(w))if(!m5.call($,f)&&f!==U)e1($,f,{get:()=>w[f],enumerable:!(G=n5(w,f))||G.enumerable})}return $},t5=($)=>o5(e1({},"__esModule",{value:!0}),$),SR={};r5(SR,{emitWarningIfUnsupportedVersion:()=>a5});bR.exports=t5(SR);var PR=!1,a5=i5(($)=>{if($&&!PR&&parseInt($.substring(1,$.indexOf(".")))<18)PR=!0,process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
|
|
4
|
+
no longer support Node.js 16.x on January 6, 2025.
|
|
5
|
+
|
|
6
|
+
To continue receiving updates to AWS services, bug fixes, and security
|
|
7
|
+
updates please upgrade to a supported Node.js LTS version.
|
|
8
|
+
|
|
9
|
+
More information can be found at: https://a.co/74kJMmI`)},"emitWarningIfUnsupportedVersion")});var aR=M((CA,tR)=>{var cw=function($){for(let w=0;w<8;w++)$[w]^=255;for(let w=7;w>-1;w--)if($[w]++,$[w]!==0)break},G$=Object.defineProperty,e5=Object.getOwnPropertyDescriptor,$z=Object.getOwnPropertyNames,wz=Object.prototype.hasOwnProperty,b=($,w)=>G$($,"name",{value:w,configurable:!0}),Uz=($,w)=>{for(var U in w)G$($,U,{get:w[U],enumerable:!0})},fz=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of $z(w))if(!wz.call($,f)&&f!==U)G$($,f,{get:()=>w[f],enumerable:!(G=e5(w,f))||G.enumerable})}return $},Gz=($)=>fz(G$({},"__esModule",{value:!0}),$),xR={};Uz(xR,{SignatureV4:()=>Sz,clearCredentialCache:()=>Az,createScope:()=>U$,getCanonicalHeaders:()=>kw,getCanonicalQuery:()=>nR,getPayloadHash:()=>f$,getSigningKey:()=>lR,moveHeadersToQuery:()=>rR,prepareRequest:()=>vw});tR.exports=Gz(xR);var DR=n(),bw=e(),Ez="X-Amz-Algorithm",Wz="X-Amz-Credential",yR="X-Amz-Date",Lz="X-Amz-SignedHeaders",Rz="X-Amz-Expires",uR="X-Amz-Signature",_R="X-Amz-Security-Token",dR="authorization",pR=yR.toLowerCase(),Xz="date",Zz=[dR,pR,Xz],Fz=uR.toLowerCase(),Dw="x-amz-content-sha256",Iz=_R.toLowerCase(),Yz={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},zz=/^proxy-/,Qz=/^sec-/,hw="AWS4-HMAC-SHA256",Mz="AWS4-HMAC-SHA256-PAYLOAD",Jz="UNSIGNED-PAYLOAD",Tz=50,gR="aws4_request",Kz=604800,f0=CE(),Oz=e(),P0={},w$=[],U$=b(($,w,U)=>`${$}/${w}/${U}/${gR}`,"createScope"),lR=b(async($,w,U,G,f)=>{const E=await kR($,w.secretAccessKey,w.accessKeyId),W=`${U}:${G}:${f}:${f0.toHex(E)}:${w.sessionToken}`;if(W in P0)return P0[W];w$.push(W);while(w$.length>Tz)delete P0[w$.shift()];let L=`AWS4${w.secretAccessKey}`;for(let R of[U,G,f,gR])L=await kR($,L,R);return P0[W]=L},"getSigningKey"),Az=b(()=>{w$.length=0,Object.keys(P0).forEach(($)=>{delete P0[$]})},"clearCredentialCache"),kR=b(($,w,U)=>{const G=new $(w);return G.update(Oz.toUint8Array(U)),G.digest()},"hmac"),kw=b(({headers:$},w,U)=>{const G={};for(let f of Object.keys($).sort()){if($[f]==null)continue;const E=f.toLowerCase();if(E in Yz||(w==null?void 0:w.has(E))||zz.test(E)||Qz.test(E)){if(!U||U&&!U.has(E))continue}G[E]=$[f].trim().replace(/\s+/g," ")}return G},"getCanonicalHeaders"),r0=lG(),nR=b(({query:$={}})=>{const w=[],U={};for(let G of Object.keys($).sort()){if(G.toLowerCase()===Fz)continue;w.push(G);const f=$[G];if(typeof f==="string")U[G]=`${r0.escapeUri(G)}=${r0.escapeUri(f)}`;else if(Array.isArray(f))U[G]=f.slice(0).reduce((E,W)=>E.concat([`${r0.escapeUri(G)}=${r0.escapeUri(W)}`]),[]).sort().join("&")}return w.map((G)=>U[G]).filter((G)=>G).join("&")},"getCanonicalQuery"),Bz=k$(),Vz=e(),f$=b(async({headers:$,body:w},U)=>{for(let G of Object.keys($))if(G.toLowerCase()===Dw)return $[G];if(w==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof w==="string"||ArrayBuffer.isView(w)||Bz.isArrayBuffer(w)){const G=new U;return G.update(Vz.toUint8Array(w)),f0.toHex(await G.digest())}return Jz},"getPayloadHash"),cR=e(),sR=class ${format(w){const U=[];for(let E of Object.keys(w)){const W=cR.fromUtf8(E);U.push(Uint8Array.from([W.byteLength]),W,this.formatHeaderValue(w[E]))}const G=new Uint8Array(U.reduce((E,W)=>E+W.byteLength,0));let f=0;for(let E of U)G.set(E,f),f+=E.byteLength;return G}formatHeaderValue(w){switch(w.type){case"boolean":return Uint8Array.from([w.value?0:1]);case"byte":return Uint8Array.from([2,w.value]);case"short":const U=new DataView(new ArrayBuffer(3));return U.setUint8(0,3),U.setInt16(1,w.value,!1),new Uint8Array(U.buffer);case"integer":const G=new DataView(new ArrayBuffer(5));return G.setUint8(0,4),G.setInt32(1,w.value,!1),new Uint8Array(G.buffer);case"long":const f=new Uint8Array(9);return f[0]=5,f.set(w.value.bytes,1),f;case"binary":const E=new DataView(new ArrayBuffer(3+w.value.byteLength));E.setUint8(0,6),E.setUint16(1,w.value.byteLength,!1);const W=new Uint8Array(E.buffer);return W.set(w.value,3),W;case"string":const L=cR.fromUtf8(w.value),R=new DataView(new ArrayBuffer(3+L.byteLength));R.setUint8(0,7),R.setUint16(1,L.byteLength,!1);const X=new Uint8Array(R.buffer);return X.set(L,3),X;case"timestamp":const Z=new Uint8Array(9);return Z[0]=8,Z.set(Nz.fromNumber(w.value.valueOf()).bytes,1),Z;case"uuid":if(!Cz.test(w.value))throw new Error(`Invalid UUID received: ${w.value}`);const F=new Uint8Array(17);return F[0]=9,F.set(f0.fromHex(w.value.replace(/\-/g,"")),1),F}}};b(sR,"HeaderFormatter");var Hz=sR,Cz=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,mR=class ${constructor(w){if(this.bytes=w,w.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(w){if(w>9223372036854776000||w<-9223372036854776000)throw new Error(`${w} is too large (or, if negative, too small) to represent as an Int64`);const U=new Uint8Array(8);for(let G=7,f=Math.abs(Math.round(w));G>-1&&f>0;G--,f/=256)U[G]=f;if(w<0)cw(U);return new $(U)}valueOf(){const w=this.bytes.slice(0),U=w[0]&128;if(U)cw(w);return parseInt(f0.toHex(w),16)*(U?-1:1)}toString(){return String(this.valueOf())}};b(mR,"Int64");var Nz=mR;b(cw,"negate");var qz=b(($,w)=>{$=$.toLowerCase();for(let U of Object.keys(w))if($===U.toLowerCase())return!0;return!1},"hasHeader"),iR=i(),rR=b(($,w={})=>{var U;const{headers:G,query:f={}}=iR.HttpRequest.clone($);for(let E of Object.keys(G)){const W=E.toLowerCase();if(W.slice(0,6)==="x-amz-"&&!((U=w.unhoistableHeaders)==null?void 0:U.has(W)))f[E]=G[E],delete G[E]}return{...$,headers:G,query:f}},"moveHeadersToQuery"),vw=b(($)=>{$=iR.HttpRequest.clone($);for(let w of Object.keys($.headers))if(Zz.indexOf(w.toLowerCase())>-1)delete $.headers[w];return $},"prepareRequest"),jz=b(($)=>Pz($).toISOString().replace(/\.\d{3}Z$/,"Z"),"iso8601"),Pz=b(($)=>{if(typeof $==="number")return new Date($*1000);if(typeof $==="string"){if(Number($))return new Date(Number($)*1000);return new Date($)}return $},"toDate"),oR=class ${constructor({applyChecksum:w,credentials:U,region:G,service:f,sha256:E,uriEscapePath:W=!0}){this.headerFormatter=new Hz,this.service=f,this.sha256=E,this.uriEscapePath=W,this.applyChecksum=typeof w==="boolean"?w:!0,this.regionProvider=DR.normalizeProvider(G),this.credentialProvider=DR.normalizeProvider(U)}async presign(w,U={}){const{signingDate:G=new Date,expiresIn:f=3600,unsignableHeaders:E,unhoistableHeaders:W,signableHeaders:L,signingRegion:R,signingService:X}=U,Z=await this.credentialProvider();this.validateResolvedCredentials(Z);const F=R??await this.regionProvider(),{longDate:Y,shortDate:I}=$$(G);if(f>Kz)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const z=U$(I,F,X??this.service),J=rR(vw(w),{unhoistableHeaders:W});if(Z.sessionToken)J.query[_R]=Z.sessionToken;J.query[Ez]=hw,J.query[Wz]=`${Z.accessKeyId}/${z}`,J.query[yR]=Y,J.query[Rz]=f.toString(10);const O=kw(J,E,L);return J.query[Lz]=vR(O),J.query[uR]=await this.getSignature(Y,z,this.getSigningKey(Z,F,I,X),this.createCanonicalRequest(J,O,await f$(w,this.sha256))),J}async sign(w,U){if(typeof w==="string")return this.signString(w,U);else if(w.headers&&w.payload)return this.signEvent(w,U);else if(w.message)return this.signMessage(w,U);else return this.signRequest(w,U)}async signEvent({headers:w,payload:U},{signingDate:G=new Date,priorSignature:f,signingRegion:E,signingService:W}){const L=E??await this.regionProvider(),{shortDate:R,longDate:X}=$$(G),Z=U$(R,L,W??this.service),F=await f$({headers:{},body:U},this.sha256),Y=new this.sha256;Y.update(w);const I=f0.toHex(await Y.digest()),z=[Mz,X,Z,f,I,F].join("\n");return this.signString(z,{signingDate:G,signingRegion:L,signingService:W})}async signMessage(w,{signingDate:U=new Date,signingRegion:G,signingService:f}){return this.signEvent({headers:this.headerFormatter.format(w.message.headers),payload:w.message.body},{signingDate:U,signingRegion:G,signingService:f,priorSignature:w.priorSignature}).then((W)=>{return{message:w.message,signature:W}})}async signString(w,{signingDate:U=new Date,signingRegion:G,signingService:f}={}){const E=await this.credentialProvider();this.validateResolvedCredentials(E);const W=G??await this.regionProvider(),{shortDate:L}=$$(U),R=new this.sha256(await this.getSigningKey(E,W,L,f));return R.update(bw.toUint8Array(w)),f0.toHex(await R.digest())}async signRequest(w,{signingDate:U=new Date,signableHeaders:G,unsignableHeaders:f,signingRegion:E,signingService:W}={}){const L=await this.credentialProvider();this.validateResolvedCredentials(L);const R=E??await this.regionProvider(),X=vw(w),{longDate:Z,shortDate:F}=$$(U),Y=U$(F,R,W??this.service);if(X.headers[pR]=Z,L.sessionToken)X.headers[Iz]=L.sessionToken;const I=await f$(X,this.sha256);if(!qz(Dw,X.headers)&&this.applyChecksum)X.headers[Dw]=I;const z=kw(X,f,G),J=await this.getSignature(Z,Y,this.getSigningKey(L,R,F,W),this.createCanonicalRequest(X,z,I));return X.headers[dR]=`${hw} Credential=${L.accessKeyId}/${Y}, SignedHeaders=${vR(z)}, Signature=${J}`,X}createCanonicalRequest(w,U,G){const f=Object.keys(U).sort();return`${w.method}
|
|
10
|
+
${this.getCanonicalPath(w)}
|
|
11
|
+
${nR(w)}
|
|
12
|
+
${f.map((E)=>`${E}:${U[E]}`).join("\n")}
|
|
13
|
+
|
|
14
|
+
${f.join(";")}
|
|
15
|
+
${G}`}async createStringToSign(w,U,G){const f=new this.sha256;f.update(bw.toUint8Array(G));const E=await f.digest();return`${hw}
|
|
16
|
+
${w}
|
|
17
|
+
${U}
|
|
18
|
+
${f0.toHex(E)}`}getCanonicalPath({path:w}){if(this.uriEscapePath){const U=[];for(let E of w.split("/")){if((E==null?void 0:E.length)===0)continue;if(E===".")continue;if(E==="..")U.pop();else U.push(E)}const G=`${(w==null?void 0:w.startsWith("/"))?"/":""}${U.join("/")}${U.length>0&&(w==null?void 0:w.endsWith("/"))?"/":""}`;return r0.escapeUri(G).replace(/%2F/g,"/")}return w}async getSignature(w,U,G,f){const E=await this.createStringToSign(w,U,f),W=new this.sha256(await G);return W.update(bw.toUint8Array(E)),f0.toHex(await W.digest())}getSigningKey(w,U,G,f){return lR(this.sha256,w,G,U,f||this.service)}validateResolvedCredentials(w){if(typeof w!=="object"||typeof w.accessKeyId!=="string"||typeof w.secretAccessKey!=="string")throw new Error("Resolved credential object is not valid")}};b(oR,"SignatureV4");var Sz=oR,$$=b(($)=>{const w=jz($).replace(/[\-:]/g,"");return{longDate:w,shortDate:w.slice(0,8)}},"formatDate"),vR=b(($)=>Object.keys($).sort().join(";"),"getCanonicalHeaderList")});var R8=M((NA,L8)=>{var{defineProperty:E$,getOwnPropertyDescriptor:bz,getOwnPropertyNames:hz}=Object,Dz=Object.prototype.hasOwnProperty,k=($,w)=>E$($,"name",{value:w,configurable:!0}),kz=($,w)=>{for(var U in w)E$($,U,{get:w[U],enumerable:!0})},cz=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of hz(w))if(!Dz.call($,f)&&f!==U)E$($,f,{get:()=>w[f],enumerable:!(G=bz(w,f))||G.enumerable})}return $},vz=($)=>cz(E$({},"__esModule",{value:!0}),$),f8={};kz(f8,{AWSSDKSigV4Signer:()=>_z,AwsSdkSigV4ASigner:()=>pz,AwsSdkSigV4Signer:()=>uw,NODE_SIGV4A_CONFIG_OPTIONS:()=>nz,resolveAWSSDKSigV4Config:()=>sz,resolveAwsSdkSigV4AConfig:()=>lz,resolveAwsSdkSigV4Config:()=>W8,validateSigningProperties:()=>yw});L8.exports=vz(f8);var xz=i(),yz=i(),eR=k(($)=>{var w,U;return yz.HttpResponse.isInstance($)?((w=$.headers)==null?void 0:w.date)??((U=$.headers)==null?void 0:U.Date):void 0},"getDateHeader"),xw=k(($)=>new Date(Date.now()+$),"getSkewCorrectedDate"),uz=k(($,w)=>Math.abs(xw(w).getTime()-$)>=300000,"isClockSkewed"),$8=k(($,w)=>{const U=Date.parse($);if(uz(U,w))return U-Date.now();return w},"getUpdatedSystemClockOffset"),o0=k(($,w)=>{if(!w)throw new Error(`Property \`${$}\` is not resolved for AWS SDK SigV4Auth`);return w},"throwSigningPropertyError"),yw=k(async($)=>{var w,U,G;const f=o0("context",$.context),E=o0("config",$.config),W=(G=(U=(w=f.endpointV2)==null?void 0:w.properties)==null?void 0:U.authSchemes)==null?void 0:G[0],R=await o0("signer",E.signer)(W),X=$==null?void 0:$.signingRegion,Z=$==null?void 0:$.signingRegionSet,F=$==null?void 0:$.signingName;return{config:E,signer:R,signingRegion:X,signingRegionSet:Z,signingName:F}},"validateSigningProperties"),G8=class ${async sign(w,U,G){var f;if(!xz.HttpRequest.isInstance(w))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const E=await yw(G),{config:W,signer:L}=E;let{signingRegion:R,signingName:X}=E;const Z=G.context;if(((f=Z==null?void 0:Z.authSchemes)==null?void 0:f.length)??0>1){const[Y,I]=Z.authSchemes;if((Y==null?void 0:Y.name)==="sigv4a"&&(I==null?void 0:I.name)==="sigv4")R=(I==null?void 0:I.signingRegion)??R,X=(I==null?void 0:I.signingName)??X}return await L.sign(w,{signingDate:xw(W.systemClockOffset),signingRegion:R,signingService:X})}errorHandler(w){return(U)=>{const G=U.ServerTime??eR(U.$response);if(G){const f=o0("config",w.config),E=f.systemClockOffset;if(f.systemClockOffset=$8(G,f.systemClockOffset),f.systemClockOffset!==E&&U.$metadata)U.$metadata.clockSkewCorrected=!0}throw U}}successHandler(w,U){const G=eR(w);if(G){const f=o0("config",U.config);f.systemClockOffset=$8(G,f.systemClockOffset)}}};k(G8,"AwsSdkSigV4Signer");var uw=G8,_z=uw,dz=i(),E8=class $ extends uw{async sign(w,U,G){var f;if(!dz.HttpRequest.isInstance(w))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:E,signer:W,signingRegion:L,signingRegionSet:R,signingName:X}=await yw(G),F=(await((f=E.sigv4aSigningRegionSet)==null?void 0:f.call(E))??R??[L]).join(",");return await W.sign(w,{signingDate:xw(E.systemClockOffset),signingRegion:F,signingService:X})}};k(E8,"AwsSdkSigV4ASigner");var pz=E8,gz=Xw(),w8=X$(),lz=k(($)=>{return $.sigv4aSigningRegionSet=gz.normalizeProvider($.sigv4aSigningRegionSet),$},"resolveAwsSdkSigV4AConfig"),nz={environmentVariableSelector($){if($.AWS_SIGV4A_SIGNING_REGION_SET)return $.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((w)=>w.trim());throw new w8.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector($){if($.sigv4a_signing_region_set)return($.sigv4a_signing_region_set??"").split(",").map((w)=>w.trim());throw new w8.ProviderError("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},Y0=Xw(),U8=aR(),W8=k(($)=>{let w;if($.credentials)w=Y0.memoizeIdentityProvider($.credentials,Y0.isIdentityExpired,Y0.doesIdentityRequireRefresh);if(!w)if($.credentialDefaultProvider)w=Y0.normalizeProvider($.credentialDefaultProvider(Object.assign({},$,{parentClientConfig:$})));else w=k(async()=>{throw new Error("`credentials` is missing")},"normalizedCreds");const{signingEscapePath:U=!0,systemClockOffset:G=$.systemClockOffset||0,sha256:f}=$;let E;if($.signer)E=Y0.normalizeProvider($.signer);else if($.regionInfoProvider)E=k(()=>Y0.normalizeProvider($.region)().then(async(W)=>[await $.regionInfoProvider(W,{useFipsEndpoint:await $.useFipsEndpoint(),useDualstackEndpoint:await $.useDualstackEndpoint()})||{},W]).then(([W,L])=>{const{signingRegion:R,signingService:X}=W;$.signingRegion=$.signingRegion||R||L,$.signingName=$.signingName||X||$.serviceId;const Z={...$,credentials:w,region:$.signingRegion,service:$.signingName,sha256:f,uriEscapePath:U};return new($.signerConstructor||U8.SignatureV4)(Z)}),"signer");else E=k(async(W)=>{W=Object.assign({},{name:"sigv4",signingName:$.signingName||$.defaultSigningName,signingRegion:await Y0.normalizeProvider($.region)(),properties:{}},W);const{signingRegion:L,signingName:R}=W;$.signingRegion=$.signingRegion||L,$.signingName=$.signingName||R||$.serviceId;const X={...$,credentials:w,region:$.signingRegion,service:$.signingName,sha256:f,uriEscapePath:U};return new($.signerConstructor||U8.SignatureV4)(X)},"signer");return{...$,systemClockOffset:G,signingEscapePath:U,credentials:w,signer:E}},"resolveAwsSdkSigV4Config"),sz=W8});var W$=M((tz)=>{var mz=":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\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",X8="[: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]["+mz+"]*",iz=new RegExp("^"+X8+"$"),rz=function($,w){const U=[];let G=w.exec($);while(G){const f=[];f.startIndex=w.lastIndex-G[0].length;const E=G.length;for(let W=0;W<E;W++)f.push(G[W]);U.push(f),G=w.exec($)}return U},oz=function($){const w=iz.exec($);return!(w===null||typeof w==="undefined")};tz.isExist=function($){return typeof $!=="undefined"};tz.isEmptyObject=function($){return Object.keys($).length===0};tz.merge=function($,w,U){if(w){const G=Object.keys(w),f=G.length;for(let E=0;E<f;E++)if(U==="strict")$[G[E]]=[w[G[E]]];else $[G[E]]=w[G[E]]}};tz.getValue=function($){if(tz.isExist($))return $;else return""};tz.isName=oz;tz.getAllMatches=rz;tz.nameRegexp=X8});var dw=M((Y9)=>{var F8=function($){return $===" "||$==="\t"||$==="\n"||$==="\r"},I8=function($,w){const U=w;for(;w<$.length;w++)if($[w]=="?"||$[w]==" "){const G=$.substr(U,w-U);if(w>5&&G==="xml")return j("InvalidXml","XML declaration allowed only at the start of the document.",D($,w));else if($[w]=="?"&&$[w+1]==">"){w++;break}else continue}return w},Y8=function($,w){if($.length>w+5&&$[w+1]==="-"&&$[w+2]==="-"){for(w+=3;w<$.length;w++)if($[w]==="-"&&$[w+1]==="-"&&$[w+2]===">"){w+=2;break}}else if($.length>w+8&&$[w+1]==="D"&&$[w+2]==="O"&&$[w+3]==="C"&&$[w+4]==="T"&&$[w+5]==="Y"&&$[w+6]==="P"&&$[w+7]==="E"){let U=1;for(w+=8;w<$.length;w++)if($[w]==="<")U++;else if($[w]===">"){if(U--,U===0)break}}else if($.length>w+9&&$[w+1]==="["&&$[w+2]==="C"&&$[w+3]==="D"&&$[w+4]==="A"&&$[w+5]==="T"&&$[w+6]==="A"&&$[w+7]==="["){for(w+=8;w<$.length;w++)if($[w]==="]"&&$[w+1]==="]"&&$[w+2]===">"){w+=2;break}}return w},L9=function($,w){let U="",G="",f=!1;for(;w<$.length;w++){if($[w]===E9||$[w]===W9)if(G==="")G=$[w];else if(G!==$[w]);else G="";else if($[w]===">"){if(G===""){f=!0;break}}U+=$[w]}if(G!=="")return!1;return{value:U,index:w,tagClosed:f}},z8=function($,w){const U=_w.getAllMatches($,R9),G={};for(let f=0;f<U.length;f++){if(U[f][1].length===0)return j("InvalidAttr","Attribute '"+U[f][2]+"' has no space in starting.",t0(U[f]));else if(U[f][3]!==void 0&&U[f][4]===void 0)return j("InvalidAttr","Attribute '"+U[f][2]+"' is without value.",t0(U[f]));else if(U[f][3]===void 0&&!w.allowBooleanAttributes)return j("InvalidAttr","boolean attribute '"+U[f][2]+"' is not allowed.",t0(U[f]));const E=U[f][2];if(!F9(E))return j("InvalidAttr","Attribute '"+E+"' is an invalid name.",t0(U[f]));if(!G.hasOwnProperty(E))G[E]=1;else return j("InvalidAttr","Attribute '"+E+"' is repeated.",t0(U[f]))}return!0},X9=function($,w){let U=/\d/;if($[w]==="x")w++,U=/[\da-fA-F]/;for(;w<$.length;w++){if($[w]===";")return w;if(!$[w].match(U))break}return-1},Z9=function($,w){if(w++,$[w]===";")return-1;if($[w]==="#")return w++,X9($,w);let U=0;for(;w<$.length;w++,U++){if($[w].match(/\w/)&&U<20)continue;if($[w]===";")break;return-1}return w},j=function($,w,U){return{err:{code:$,msg:w,line:U.line||U,col:U.col}}},F9=function($){return _w.isName($)},I9=function($){return _w.isName($)},D=function($,w){const U=$.substring(0,w).split(/\r?\n/);return{line:U.length,col:U[U.length-1].length+1}},t0=function($){return $.startIndex+$[1].length},_w=W$(),G9={allowBooleanAttributes:!1,unpairedTags:[]};Y9.validate=function($,w){w=Object.assign({},G9,w);const U=[];let G=!1,f=!1;if($[0]==="\uFEFF")$=$.substr(1);for(let E=0;E<$.length;E++)if($[E]==="<"&&$[E+1]==="?"){if(E+=2,E=I8($,E),E.err)return E}else if($[E]==="<"){let W=E;if(E++,$[E]==="!"){E=Y8($,E);continue}else{let L=!1;if($[E]==="/")L=!0,E++;let R="";for(;E<$.length&&$[E]!==">"&&$[E]!==" "&&$[E]!=="\t"&&$[E]!=="\n"&&$[E]!=="\r";E++)R+=$[E];if(R=R.trim(),R[R.length-1]==="/")R=R.substring(0,R.length-1),E--;if(!I9(R)){let F;if(R.trim().length===0)F="Invalid space after '<'.";else F="Tag '"+R+"' is an invalid name.";return j("InvalidTag",F,D($,E))}const X=L9($,E);if(X===!1)return j("InvalidAttr","Attributes for '"+R+"' have open quote.",D($,E));let Z=X.value;if(E=X.index,Z[Z.length-1]==="/"){const F=E-Z.length;Z=Z.substring(0,Z.length-1);const Y=z8(Z,w);if(Y===!0)G=!0;else return j(Y.err.code,Y.err.msg,D($,F+Y.err.line))}else if(L)if(!X.tagClosed)return j("InvalidTag","Closing tag '"+R+"' doesn't have proper closing.",D($,E));else if(Z.trim().length>0)return j("InvalidTag","Closing tag '"+R+"' can't have attributes or invalid starting.",D($,W));else if(U.length===0)return j("InvalidTag","Closing tag '"+R+"' has not been opened.",D($,W));else{const F=U.pop();if(R!==F.tagName){let Y=D($,F.tagStartPos);return j("InvalidTag","Expected closing tag '"+F.tagName+"' (opened in line "+Y.line+", col "+Y.col+") instead of closing tag '"+R+"'.",D($,W))}if(U.length==0)f=!0}else{const F=z8(Z,w);if(F!==!0)return j(F.err.code,F.err.msg,D($,E-Z.length+F.err.line));if(f===!0)return j("InvalidXml","Multiple possible root nodes found.",D($,E));else if(w.unpairedTags.indexOf(R)!==-1);else U.push({tagName:R,tagStartPos:W});G=!0}for(E++;E<$.length;E++)if($[E]==="<")if($[E+1]==="!"){E++,E=Y8($,E);continue}else if($[E+1]==="?"){if(E=I8($,++E),E.err)return E}else break;else if($[E]==="&"){const F=Z9($,E);if(F==-1)return j("InvalidChar","char '&' is not expected.",D($,E));E=F}else if(f===!0&&!F8($[E]))return j("InvalidXml","Extra text at the end",D($,E));if($[E]==="<")E--}}else{if(F8($[E]))continue;return j("InvalidChar","char '"+$[E]+"' is not expected.",D($,E))}if(!G)return j("InvalidXml","Start tag expected.",1);else if(U.length==1)return j("InvalidTag","Unclosed tag '"+U[0].tagName+"'.",D($,U[0].tagStartPos));else if(U.length>0)return j("InvalidXml","Invalid '"+JSON.stringify(U.map((E)=>E.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1});return!0};var E9='"',W9="'",R9=new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s\\S])*?)\\5)?',"g")});var M8=M((M9)=>{var Q8={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($,w){return w},attributeValueProcessor:function($,w){return w},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function($,w,U){return $}},Q9=function($){return Object.assign({},Q8,$)};M9.buildOptions=Q9;M9.defaultOptions=Q8});var K8=M((SA,T8)=>{class J8{constructor($){this.tagname=$,this.child=[],this[":@"]={}}add($,w){if($==="__proto__")$="#__proto__";this.child.push({[$]:w})}addChild($){if($.tagname==="__proto__")$.tagname="#__proto__";if($[":@"]&&Object.keys($[":@"]).length>0)this.child.push({[$.tagname]:$.child,[":@"]:$[":@"]});else this.child.push({[$.tagname]:$.child})}}T8.exports=J8});var A8=M((bA,O8)=>{var O9=function($,w){const U={};if($[w+3]==="O"&&$[w+4]==="C"&&$[w+5]==="T"&&$[w+6]==="Y"&&$[w+7]==="P"&&$[w+8]==="E"){w=w+9;let G=1,f=!1,E=!1,W="";for(;w<$.length;w++)if($[w]==="<"&&!E){if(f&&V9($,w)){if(w+=7,[entityName,val,w]=A9($,w+1),val.indexOf("&")===-1)U[q9(entityName)]={regx:RegExp(`&${entityName};`,"g"),val}}else if(f&&H9($,w))w+=8;else if(f&&C9($,w))w+=8;else if(f&&N9($,w))w+=9;else if(B9)E=!0;else throw new Error("Invalid DOCTYPE");G++,W=""}else if($[w]===">"){if(E){if($[w-1]==="-"&&$[w-2]==="-")E=!1,G--}else G--;if(G===0)break}else if($[w]==="[")f=!0;else W+=$[w];if(G!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:U,i:w}},A9=function($,w){let U="";for(;w<$.length&&($[w]!=="'"&&$[w]!=='"');w++)U+=$[w];if(U=U.trim(),U.indexOf(" ")!==-1)throw new Error("External entites are not supported");const G=$[w++];let f="";for(;w<$.length&&$[w]!==G;w++)f+=$[w];return[U,f,w]},B9=function($,w){if($[w+1]==="!"&&$[w+2]==="-"&&$[w+3]==="-")return!0;return!1},V9=function($,w){if($[w+1]==="!"&&$[w+2]==="E"&&$[w+3]==="N"&&$[w+4]==="T"&&$[w+5]==="I"&&$[w+6]==="T"&&$[w+7]==="Y")return!0;return!1},H9=function($,w){if($[w+1]==="!"&&$[w+2]==="E"&&$[w+3]==="L"&&$[w+4]==="E"&&$[w+5]==="M"&&$[w+6]==="E"&&$[w+7]==="N"&&$[w+8]==="T")return!0;return!1},C9=function($,w){if($[w+1]==="!"&&$[w+2]==="A"&&$[w+3]==="T"&&$[w+4]==="T"&&$[w+5]==="L"&&$[w+6]==="I"&&$[w+7]==="S"&&$[w+8]==="T")return!0;return!1},N9=function($,w){if($[w+1]==="!"&&$[w+2]==="N"&&$[w+3]==="O"&&$[w+4]==="T"&&$[w+5]==="A"&&$[w+6]==="T"&&$[w+7]==="I"&&$[w+8]==="O"&&$[w+9]==="N")return!0;return!1},q9=function($){if(K9.isName($))return $;else throw new Error(`Invalid entity name ${$}`)},K9=W$();O8.exports=O9});var V8=M((hA,B8)=>{var b9=function($,w={}){if(w=Object.assign({},S9,w),!$||typeof $!=="string")return $;let U=$.trim();if(w.skipLike!==void 0&&w.skipLike.test(U))return $;else if(w.hex&&j9.test(U))return Number.parseInt(U,16);else{const G=P9.exec(U);if(G){const f=G[1],E=G[2];let W=h9(G[3]);const L=G[4]||G[6];if(!w.leadingZeros&&E.length>0&&f&&U[2]!==".")return $;else if(!w.leadingZeros&&E.length>0&&!f&&U[1]!==".")return $;else{const R=Number(U),X=""+R;if(X.search(/[eE]/)!==-1)if(w.eNotation)return R;else return $;else if(L)if(w.eNotation)return R;else return $;else if(U.indexOf(".")!==-1)if(X==="0"&&W==="")return R;else if(X===W)return R;else if(f&&X==="-"+W)return R;else return $;if(E)if(W===X)return R;else if(f+W===X)return R;else return $;if(U===X)return R;else if(U===f+X)return R;return $}}else return $}},h9=function($){if($&&$.indexOf(".")!==-1){if($=$.replace(/0+$/,""),$===".")$="0";else if($[0]===".")$="0"+$;else if($[$.length-1]===".")$=$.substr(0,$.length-1);return $}return $},j9=/^[-+]?0x[a-fA-F0-9]+$/,P9=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;if(!Number.parseInt&&window.parseInt)Number.parseInt=window.parseInt;if(!Number.parseFloat&&window.parseFloat)Number.parseFloat=window.parseFloat;var S9={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};B8.exports=b9});var q8=M((DA,N8)=>{var c9=function($){const w=Object.keys($);for(let U=0;U<w.length;U++){const G=w[U];this.lastEntities[G]={regex:new RegExp("&"+G+";","g"),val:$[G]}}},v9=function($,w,U,G,f,E,W){if($!==void 0){if(this.options.trimValues&&!G)$=$.trim();if($.length>0){if(!W)$=this.replaceEntitiesValue($);const L=this.options.tagValueProcessor(w,$,U,f,E);if(L===null||L===void 0)return $;else if(typeof L!==typeof $||L!==$)return L;else if(this.options.trimValues)return gw($,this.options.parseTagValue,this.options.numberParseOptions);else if($.trim()===$)return gw($,this.options.parseTagValue,this.options.numberParseOptions);else return $}}},x9=function($){if(this.options.removeNSPrefix){const w=$.split(":"),U=$.charAt(0)==="/"?"/":"";if(w[0]==="xmlns")return"";if(w.length===2)$=U+w[1]}return $},u9=function($,w,U){if(!this.options.ignoreAttributes&&typeof $==="string"){const G=H8.getAllMatches($,y9),f=G.length,E={};for(let W=0;W<f;W++){const L=this.resolveNameSpace(G[W][1]);let R=G[W][4],X=this.options.attributeNamePrefix+L;if(L.length){if(this.options.transformAttributeName)X=this.options.transformAttributeName(X);if(X==="__proto__")X="#__proto__";if(R!==void 0){if(this.options.trimValues)R=R.trim();R=this.replaceEntitiesValue(R);const Z=this.options.attributeValueProcessor(L,R,w);if(Z===null||Z===void 0)E[X]=R;else if(typeof Z!==typeof R||Z!==R)E[X]=Z;else E[X]=gw(R,this.options.parseAttributeValue,this.options.numberParseOptions)}else if(this.options.allowBooleanAttributes)E[X]=!0}}if(!Object.keys(E).length)return;if(this.options.attributesGroupName){const W={};return W[this.options.attributesGroupName]=E,W}return E}},d9=function($,w,U){const G=this.options.updateTag(w.tagname,U,w[":@"]);if(G===!1);else if(typeof G==="string")w.tagname=G,$.addChild(w);else $.addChild(w)},g9=function($,w,U,G){if($){if(G===void 0)G=Object.keys(w.child).length===0;if($=this.parseTextData($,w.tagname,U,!1,w[":@"]?Object.keys(w[":@"]).length!==0:!1,G),$!==void 0&&$!=="")w.add(this.options.textNodeName,$);$=""}return $},l9=function($,w,U){const G="*."+U;for(let f in $){const E=$[f];if(G===E||w===E)return!0}return!1},n9=function($,w,U=">"){let G,f="";for(let E=w;E<$.length;E++){let W=$[E];if(G){if(W===G)G=""}else if(W==='"'||W==="'")G=W;else if(W===U[0])if(U[1]){if($[E+1]===U[1])return{data:f,index:E}}else return{data:f,index:E};else if(W==="\t")W=" ";f+=W}},z0=function($,w,U,G){const f=$.indexOf(w,U);if(f===-1)throw new Error(G);else return f+w.length-1},pw=function($,w,U,G=">"){const f=n9($,w+1,G);if(!f)return;let E=f.data;const W=f.index,L=E.search(/\s/);let R=E,X=!0;if(L!==-1)R=E.substring(0,L),E=E.substring(L+1).trimStart();const Z=R;if(U){const F=R.indexOf(":");if(F!==-1)R=R.substr(F+1),X=R!==f.data.substr(F+1)}return{tagName:R,tagExp:E,closeIndex:W,attrExpPresent:X,rawTagName:Z}},s9=function($,w,U){const G=U;let f=1;for(;U<$.length;U++)if($[U]==="<")if($[U+1]==="/"){const E=z0($,">",U,`${w} is not closed`);if($.substring(U+2,E).trim()===w){if(f--,f===0)return{tagContent:$.substring(G,U),i:E}}U=E}else if($[U+1]==="?")U=z0($,"?>",U+1,"StopNode is not closed.");else if($.substr(U+1,3)==="!--")U=z0($,"-->",U+3,"StopNode is not closed.");else if($.substr(U+1,2)==="![")U=z0($,"]]>",U,"StopNode is not closed.")-2;else{const E=pw($,U,">");if(E){if((E&&E.tagName)===w&&E.tagExp[E.tagExp.length-1]!=="/")f++;U=E.closeIndex}}},gw=function($,w,U){if(w&&typeof $==="string"){const G=$.trim();if(G==="true")return!0;else if(G==="false")return!1;else return k9($,U)}else if(H8.isExist($))return $;else return""},H8=W$(),a0=K8(),D9=A8(),k9=V8();class C8{constructor($){this.options=$,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:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(w,U)=>String.fromCharCode(Number.parseInt(U,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(w,U)=>String.fromCharCode(Number.parseInt(U,16))}},this.addExternalEntities=c9,this.parseXml=_9,this.parseTextData=v9,this.resolveNameSpace=x9,this.buildAttributesMap=u9,this.isItStopNode=l9,this.replaceEntitiesValue=p9,this.readStopNodeData=s9,this.saveTextToParentTag=g9,this.addChild=d9}}var y9=new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?',"gm"),_9=function($){$=$.replace(/\r\n?/g,"\n");const w=new a0("!xml");let U=w,G="",f="";for(let E=0;E<$.length;E++)if($[E]==="<")if($[E+1]==="/"){const L=z0($,">",E,"Closing Tag is not closed.");let R=$.substring(E+2,L).trim();if(this.options.removeNSPrefix){const F=R.indexOf(":");if(F!==-1)R=R.substr(F+1)}if(this.options.transformTagName)R=this.options.transformTagName(R);if(U)G=this.saveTextToParentTag(G,U,f);const X=f.substring(f.lastIndexOf(".")+1);if(R&&this.options.unpairedTags.indexOf(R)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${R}>`);let Z=0;if(X&&this.options.unpairedTags.indexOf(X)!==-1)Z=f.lastIndexOf(".",f.lastIndexOf(".")-1),this.tagsNodeStack.pop();else Z=f.lastIndexOf(".");f=f.substring(0,Z),U=this.tagsNodeStack.pop(),G="",E=L}else if($[E+1]==="?"){let L=pw($,E,!1,"?>");if(!L)throw new Error("Pi Tag is not closed.");if(G=this.saveTextToParentTag(G,U,f),this.options.ignoreDeclaration&&L.tagName==="?xml"||this.options.ignorePiTags);else{const R=new a0(L.tagName);if(R.add(this.options.textNodeName,""),L.tagName!==L.tagExp&&L.attrExpPresent)R[":@"]=this.buildAttributesMap(L.tagExp,f,L.tagName);this.addChild(U,R,f)}E=L.closeIndex+1}else if($.substr(E+1,3)==="!--"){const L=z0($,"-->",E+4,"Comment is not closed.");if(this.options.commentPropName){const R=$.substring(E+4,L-2);G=this.saveTextToParentTag(G,U,f),U.add(this.options.commentPropName,[{[this.options.textNodeName]:R}])}E=L}else if($.substr(E+1,2)==="!D"){const L=D9($,E);this.docTypeEntities=L.entities,E=L.i}else if($.substr(E+1,2)==="!["){const L=z0($,"]]>",E,"CDATA is not closed.")-2,R=$.substring(E+9,L);G=this.saveTextToParentTag(G,U,f);let X=this.parseTextData(R,U.tagname,f,!0,!1,!0,!0);if(X==null)X="";if(this.options.cdataPropName)U.add(this.options.cdataPropName,[{[this.options.textNodeName]:R}]);else U.add(this.options.textNodeName,X);E=L+2}else{let L=pw($,E,this.options.removeNSPrefix),R=L.tagName;const X=L.rawTagName;let{tagExp:Z,attrExpPresent:F,closeIndex:Y}=L;if(this.options.transformTagName)R=this.options.transformTagName(R);if(U&&G){if(U.tagname!=="!xml")G=this.saveTextToParentTag(G,U,f,!1)}const I=U;if(I&&this.options.unpairedTags.indexOf(I.tagname)!==-1)U=this.tagsNodeStack.pop(),f=f.substring(0,f.lastIndexOf("."));if(R!==w.tagname)f+=f?"."+R:R;if(this.isItStopNode(this.options.stopNodes,f,R)){let z="";if(Z.length>0&&Z.lastIndexOf("/")===Z.length-1){if(R[R.length-1]==="/")R=R.substr(0,R.length-1),f=f.substr(0,f.length-1),Z=R;else Z=Z.substr(0,Z.length-1);E=L.closeIndex}else if(this.options.unpairedTags.indexOf(R)!==-1)E=L.closeIndex;else{const O=this.readStopNodeData($,X,Y+1);if(!O)throw new Error(`Unexpected end of ${X}`);E=O.i,z=O.tagContent}const J=new a0(R);if(R!==Z&&F)J[":@"]=this.buildAttributesMap(Z,f,R);if(z)z=this.parseTextData(z,R,f,!0,F,!0,!0);f=f.substr(0,f.lastIndexOf(".")),J.add(this.options.textNodeName,z),this.addChild(U,J,f)}else{if(Z.length>0&&Z.lastIndexOf("/")===Z.length-1){if(R[R.length-1]==="/")R=R.substr(0,R.length-1),f=f.substr(0,f.length-1),Z=R;else Z=Z.substr(0,Z.length-1);if(this.options.transformTagName)R=this.options.transformTagName(R);const z=new a0(R);if(R!==Z&&F)z[":@"]=this.buildAttributesMap(Z,f,R);this.addChild(U,z,f),f=f.substr(0,f.lastIndexOf("."))}else{const z=new a0(R);if(this.tagsNodeStack.push(U),R!==Z&&F)z[":@"]=this.buildAttributesMap(Z,f,R);this.addChild(U,z,f),U=z}G="",E=Y}}else G+=$[E];return w.child},p9=function($){if(this.options.processEntities){for(let w in this.docTypeEntities){const U=this.docTypeEntities[w];$=$.replace(U.regx,U.val)}for(let w in this.lastEntities){const U=this.lastEntities[w];$=$.replace(U.regex,U.val)}if(this.options.htmlEntities)for(let w in this.htmlEntities){const U=this.htmlEntities[w];$=$.replace(U.regex,U.val)}$=$.replace(this.ampEntity.regex,this.ampEntity.val)}return $};N8.exports=C8});var P8=M((t9)=>{var m9=function($,w){return j8($,w)},j8=function($,w,U){let G;const f={};for(let E=0;E<$.length;E++){const W=$[E],L=i9(W);let R="";if(U===void 0)R=L;else R=U+"."+L;if(L===w.textNodeName)if(G===void 0)G=W[L];else G+=""+W[L];else if(L===void 0)continue;else if(W[L]){let X=j8(W[L],w,R);const Z=o9(X,w);if(W[":@"])r9(X,W[":@"],R,w);else if(Object.keys(X).length===1&&X[w.textNodeName]!==void 0&&!w.alwaysCreateTextNode)X=X[w.textNodeName];else if(Object.keys(X).length===0)if(w.alwaysCreateTextNode)X[w.textNodeName]="";else X="";if(f[L]!==void 0&&f.hasOwnProperty(L)){if(!Array.isArray(f[L]))f[L]=[f[L]];f[L].push(X)}else if(w.isArray(L,R,Z))f[L]=[X];else f[L]=X}}if(typeof G==="string"){if(G.length>0)f[w.textNodeName]=G}else if(G!==void 0)f[w.textNodeName]=G;return f},i9=function($){const w=Object.keys($);for(let U=0;U<w.length;U++){const G=w[U];if(G!==":@")return G}},r9=function($,w,U,G){if(w){const f=Object.keys(w),E=f.length;for(let W=0;W<E;W++){const L=f[W];if(G.isArray(L,U+"."+L,!0,!0))$[L]=[w[L]];else $[L]=w[L]}}},o9=function($,w){const{textNodeName:U}=w,G=Object.keys($).length;if(G===0)return!0;if(G===1&&($[U]||typeof $[U]==="boolean"||$[U]===0))return!0;return!1};t9.prettify=m9});var h8=M((cA,b8)=>{var{buildOptions:e9}=M8(),$Q=q8(),{prettify:wQ}=P8(),UQ=dw();class S8{constructor($){this.externalEntities={},this.options=e9($)}parse($,w){if(typeof $==="string");else if($.toString)$=$.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(w){if(w===!0)w={};const f=UQ.validate($,w);if(f!==!0)throw Error(`${f.err.msg}:${f.err.line}:${f.err.col}`)}const U=new $Q(this.options);U.addExternalEntities(this.externalEntities);const G=U.parseXml($);if(this.options.preserveOrder||G===void 0)return G;else return wQ(G,this.options)}addEntity($,w){if(w.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");else if($.indexOf("&")!==-1||$.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");else if(w==="&")throw new Error("An entity with value '&' is not permitted");else this.externalEntities[$]=w}}b8.exports=S8});var x8=M((vA,v8)=>{var fQ=function($,w){let U="";if(w.format&&w.indentBy.length>0)U="\n";return k8($,w,"",U)},k8=function($,w,U,G){let f="",E=!1;for(let W=0;W<$.length;W++){const L=$[W],R=GQ(L);if(R===void 0)continue;let X="";if(U.length===0)X=R;else X=`${U}.${R}`;if(R===w.textNodeName){let z=L[R];if(!EQ(X,w))z=w.tagValueProcessor(R,z),z=c8(z,w);if(E)f+=G;f+=z,E=!1;continue}else if(R===w.cdataPropName){if(E)f+=G;f+=`<![CDATA[${L[R][0][w.textNodeName]}]]>`,E=!1;continue}else if(R===w.commentPropName){f+=G+`<!--${L[R][0][w.textNodeName]}-->`,E=!0;continue}else if(R[0]==="?"){const z=D8(L[":@"],w),J=R==="?xml"?"":G;let O=L[R][0][w.textNodeName];O=O.length!==0?" "+O:"",f+=J+`<${R}${O}${z}?>`,E=!0;continue}let Z=G;if(Z!=="")Z+=w.indentBy;const F=D8(L[":@"],w),Y=G+`<${R}${F}`,I=k8(L[R],w,X,Z);if(w.unpairedTags.indexOf(R)!==-1)if(w.suppressUnpairedNode)f+=Y+">";else f+=Y+"/>";else if((!I||I.length===0)&&w.suppressEmptyNode)f+=Y+"/>";else if(I&&I.endsWith(">"))f+=Y+`>${I}${G}</${R}>`;else{if(f+=Y+">",I&&G!==""&&(I.includes("/>")||I.includes("</")))f+=G+w.indentBy+I+G;else f+=I;f+=`</${R}>`}E=!0}return f},GQ=function($){const w=Object.keys($);for(let U=0;U<w.length;U++){const G=w[U];if(!$.hasOwnProperty(G))continue;if(G!==":@")return G}},D8=function($,w){let U="";if($&&!w.ignoreAttributes)for(let G in $){if(!$.hasOwnProperty(G))continue;let f=w.attributeValueProcessor(G,$[G]);if(f=c8(f,w),f===!0&&w.suppressBooleanAttributes)U+=` ${G.substr(w.attributeNamePrefix.length)}`;else U+=` ${G.substr(w.attributeNamePrefix.length)}="${f}"`}return U},EQ=function($,w){$=$.substr(0,$.length-w.textNodeName.length-1);let U=$.substr($.lastIndexOf(".")+1);for(let G in w.stopNodes)if(w.stopNodes[G]===$||w.stopNodes[G]==="*."+U)return!0;return!1},c8=function($,w){if($&&$.length>0&&w.processEntities)for(let U=0;U<w.entities.length;U++){const G=w.entities[U];$=$.replace(G.regex,G.val)}return $};v8.exports=fQ});var u8=M((xA,y8)=>{var G0=function($){if(this.options=Object.assign({},LQ,$),this.options.ignoreAttributes||this.options.attributesGroupName)this.isAttribute=function(){return!1};else this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ZQ;if(this.processTextOrObjNode=RQ,this.options.format)this.indentate=XQ,this.tagEndChar=">\n",this.newLine="\n";else this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""},RQ=function($,w,U){const G=this.j2x($,U+1);if($[this.options.textNodeName]!==void 0&&Object.keys($).length===1)return this.buildTextValNode($[this.options.textNodeName],w,G.attrStr,U);else return this.buildObjectNode(G.val,w,G.attrStr,U)},XQ=function($){return this.options.indentBy.repeat($)},ZQ=function($){if($.startsWith(this.options.attributeNamePrefix)&&$!==this.options.textNodeName)return $.substr(this.attrPrefixLen);else return!1},WQ=x8(),LQ={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function($,w){return w},attributeValueProcessor:function($,w){return w},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("\'","g"),val:"'"},{regex:new RegExp("\"","g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};G0.prototype.build=function($){if(this.options.preserveOrder)return WQ($,this.options);else{if(Array.isArray($)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1)$={[this.options.arrayNodeName]:$};return this.j2x($,0).val}};G0.prototype.j2x=function($,w){let U="",G="";for(let f in $){if(!Object.prototype.hasOwnProperty.call($,f))continue;if(typeof $[f]==="undefined"){if(this.isAttribute(f))G+=""}else if($[f]===null)if(this.isAttribute(f))G+="";else if(f[0]==="?")G+=this.indentate(w)+"<"+f+"?"+this.tagEndChar;else G+=this.indentate(w)+"<"+f+"/"+this.tagEndChar;else if($[f]instanceof Date)G+=this.buildTextValNode($[f],f,"",w);else if(typeof $[f]!=="object"){const E=this.isAttribute(f);if(E)U+=this.buildAttrPairStr(E,""+$[f]);else if(f===this.options.textNodeName){let W=this.options.tagValueProcessor(f,""+$[f]);G+=this.replaceEntitiesValue(W)}else G+=this.buildTextValNode($[f],f,"",w)}else if(Array.isArray($[f])){const E=$[f].length;let W="",L="";for(let R=0;R<E;R++){const X=$[f][R];if(typeof X==="undefined");else if(X===null)if(f[0]==="?")G+=this.indentate(w)+"<"+f+"?"+this.tagEndChar;else G+=this.indentate(w)+"<"+f+"/"+this.tagEndChar;else if(typeof X==="object")if(this.options.oneListGroup){const Z=this.j2x(X,w+1);if(W+=Z.val,this.options.attributesGroupName&&X.hasOwnProperty(this.options.attributesGroupName))L+=Z.attrStr}else W+=this.processTextOrObjNode(X,f,w);else if(this.options.oneListGroup){let Z=this.options.tagValueProcessor(f,X);Z=this.replaceEntitiesValue(Z),W+=Z}else W+=this.buildTextValNode(X,f,"",w)}if(this.options.oneListGroup)W=this.buildObjectNode(W,f,L,w);G+=W}else if(this.options.attributesGroupName&&f===this.options.attributesGroupName){const E=Object.keys($[f]),W=E.length;for(let L=0;L<W;L++)U+=this.buildAttrPairStr(E[L],""+$[f][E[L]])}else G+=this.processTextOrObjNode($[f],f,w)}return{attrStr:U,val:G}};G0.prototype.buildAttrPairStr=function($,w){if(w=this.options.attributeValueProcessor($,""+w),w=this.replaceEntitiesValue(w),this.options.suppressBooleanAttributes&&w==="true")return" "+$;else return" "+$+'="'+w+'"'};G0.prototype.buildObjectNode=function($,w,U,G){if($==="")if(w[0]==="?")return this.indentate(G)+"<"+w+U+"?"+this.tagEndChar;else return this.indentate(G)+"<"+w+U+this.closeTag(w)+this.tagEndChar;else{let f="</"+w+this.tagEndChar,E="";if(w[0]==="?")E="?",f="";if((U||U==="")&&$.indexOf("<")===-1)return this.indentate(G)+"<"+w+U+E+">"+$+f;else if(this.options.commentPropName!==!1&&w===this.options.commentPropName&&E.length===0)return this.indentate(G)+`<!--${$}-->`+this.newLine;else return this.indentate(G)+"<"+w+U+E+this.tagEndChar+$+this.indentate(G)+f}};G0.prototype.closeTag=function($){let w="";if(this.options.unpairedTags.indexOf($)!==-1){if(!this.options.suppressUnpairedNode)w="/"}else if(this.options.suppressEmptyNode)w="/";else w=`></${$}`;return w};G0.prototype.buildTextValNode=function($,w,U,G){if(this.options.cdataPropName!==!1&&w===this.options.cdataPropName)return this.indentate(G)+`<![CDATA[${$}]]>`+this.newLine;else if(this.options.commentPropName!==!1&&w===this.options.commentPropName)return this.indentate(G)+`<!--${$}-->`+this.newLine;else if(w[0]==="?")return this.indentate(G)+"<"+w+U+"?"+this.tagEndChar;else{let f=this.options.tagValueProcessor(w,$);if(f=this.replaceEntitiesValue(f),f==="")return this.indentate(G)+"<"+w+U+this.closeTag(w)+this.tagEndChar;else return this.indentate(G)+"<"+w+U+">"+f+"</"+w+this.tagEndChar}};G0.prototype.replaceEntitiesValue=function($){if($&&$.length>0&&this.options.processEntities)for(let w=0;w<this.options.entities.length;w++){const U=this.options.entities[w];$=$.replace(U.regex,U.val)}return $};y8.exports=G0});var d8=M((yA,_8)=>{var FQ=dw(),IQ=h8(),YQ=u8();_8.exports={XMLParser:IQ,XMLValidator:FQ,XMLBuilder:YQ}});var m8=M((uA,s8)=>{var{defineProperty:L$,getOwnPropertyDescriptor:zQ,getOwnPropertyNames:QQ}=Object,MQ=Object.prototype.hasOwnProperty,c=($,w)=>L$($,"name",{value:w,configurable:!0}),JQ=($,w)=>{for(var U in w)L$($,U,{get:w[U],enumerable:!0})},TQ=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of QQ(w))if(!MQ.call($,f)&&f!==U)L$($,f,{get:()=>w[f],enumerable:!(G=zQ(w,f))||G.enumerable})}return $},KQ=($)=>TQ(L$({},"__esModule",{value:!0}),$),p8={};JQ(p8,{_toBool:()=>AQ,_toNum:()=>BQ,_toStr:()=>OQ,awsExpectUnion:()=>HQ,loadRestJsonErrorCode:()=>qQ,loadRestXmlErrorCode:()=>bQ,parseJsonBody:()=>l8,parseJsonErrorBody:()=>NQ,parseXmlBody:()=>n8,parseXmlErrorBody:()=>SQ});s8.exports=KQ(p8);var OQ=c(($)=>{if($==null)return $;if(typeof $==="number"||typeof $==="bigint"){const w=new Error(`Received number ${$} where a string was expected.`);return w.name="Warning",console.warn(w),String($)}if(typeof $==="boolean"){const w=new Error(`Received boolean ${$} where a string was expected.`);return w.name="Warning",console.warn(w),String($)}return $},"_toStr"),AQ=c(($)=>{if($==null)return $;if(typeof $==="string"){const w=$.toLowerCase();if($!==""&&w!=="false"&&w!=="true"){const U=new Error(`Received string "${$}" where a boolean was expected.`);U.name="Warning",console.warn(U)}return $!==""&&w!=="false"}return $},"_toBool"),BQ=c(($)=>{if($==null)return $;if(typeof $==="string"){const w=Number($);if(w.toString()!==$){const U=new Error(`Received string "${$}" where a number was expected.`);return U.name="Warning",console.warn(U),$}return w}return $},"_toNum"),VQ=B0(),HQ=c(($)=>{if($==null)return;if(typeof $==="object"&&"__type"in $)delete $.__type;return VQ.expectUnion($)},"awsExpectUnion"),CQ=B0(),g8=c(($,w)=>CQ.collectBody($,w).then((U)=>w.utf8Encoder(U)),"collectBodyString"),l8=c(($,w)=>g8($,w).then((U)=>{if(U.length)try{return JSON.parse(U)}catch(G){if((G==null?void 0:G.name)==="SyntaxError")Object.defineProperty(G,"$responseBodyText",{value:U});throw G}return{}}),"parseJsonBody"),NQ=c(async($,w)=>{const U=await l8($,w);return U.message=U.message??U.Message,U},"parseJsonErrorBody"),qQ=c(($,w)=>{const U=c((E,W)=>Object.keys(E).find((L)=>L.toLowerCase()===W.toLowerCase()),"findKey"),G=c((E)=>{let W=E;if(typeof W==="number")W=W.toString();if(W.indexOf(",")>=0)W=W.split(",")[0];if(W.indexOf(":")>=0)W=W.split(":")[0];if(W.indexOf("#")>=0)W=W.split("#")[1];return W},"sanitizeErrorCode"),f=U($.headers,"x-amzn-errortype");if(f!==void 0)return G($.headers[f]);if(w.code!==void 0)return G(w.code);if(w.__type!==void 0)return G(w.__type)},"loadRestJsonErrorCode"),jQ=B0(),PQ=d8(),n8=c(($,w)=>g8($,w).then((U)=>{if(U.length){const G=new PQ.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(R,X)=>X.trim()===""&&X.includes("\n")?"":void 0});G.addEntity("#xD","\r"),G.addEntity("#10","\n");let f;try{f=G.parse(U,!0)}catch(R){if(R&&typeof R==="object")Object.defineProperty(R,"$responseBodyText",{value:U});throw R}const E="#text",W=Object.keys(f)[0],L=f[W];if(L[E])L[W]=L[E],delete L[E];return jQ.getValueFromTextNode(L)}return{}}),"parseXmlBody"),SQ=c(async($,w)=>{const U=await n8($,w);if(U.Error)U.Error.message=U.Error.message??U.Error.Message;return U},"parseXmlErrorBody"),bQ=c(($,w)=>{var U;if(((U=w==null?void 0:w.Error)==null?void 0:U.Code)!==void 0)return w.Error.Code;if((w==null?void 0:w.Code)!==void 0)return w.Code;if($.statusCode==404)return"NotFound"},"loadRestXmlErrorCode")});var hQ=M((e0)=>{Object.defineProperty(e0,"__esModule",{value:!0});var lw=jR();lw.__exportStar(hR(),e0);lw.__exportStar(R8(),e0);lw.__exportStar(m8(),e0)});function iQ($){return $}var W4=($)=>(w)=>async(U)=>{if(!x.isInstance(U.request))return w(U);const{request:G}=U,{handlerProtocol:f=""}=$.requestHandler.metadata||{};if(f.indexOf("h2")>=0&&!G.headers[":authority"])delete G.headers.host,G.headers[":authority"]=G.hostname+(G.port?":"+G.port:"");else if(!G.headers.host){let E=G.hostname;if(G.port!=null)E+=`:${G.port}`;G.headers.host=E}return w(U)},L4={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},rQ=($)=>({applyToStack:(w)=>{w.add(W4($),L4)}});var R4=()=>($,w)=>async(U)=>{try{const G=await $(U),{clientName:f,commandName:E,logger:W,dynamoDbDocumentClientOptions:L={}}=w,{overrideInputFilterSensitiveLog:R,overrideOutputFilterSensitiveLog:X}=L,Z=R??w.inputFilterSensitiveLog,F=X??w.outputFilterSensitiveLog,{$metadata:Y,...I}=G.output;return W?.info?.({clientName:f,commandName:E,input:Z(U.input),output:F(I),metadata:Y}),G}catch(G){const{clientName:f,commandName:E,logger:W,dynamoDbDocumentClientOptions:L={}}=w,{overrideInputFilterSensitiveLog:R}=L,X=R??w.inputFilterSensitiveLog;throw W?.error?.({clientName:f,commandName:E,input:X(U.input),error:G,metadata:G.$metadata}),G}},X4={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},tQ=($)=>({applyToStack:(w)=>{w.add(R4(),X4)}});var ow="X-Amzn-Trace-Id",Z4="AWS_LAMBDA_FUNCTION_NAME",F4="_X_AMZN_TRACE_ID",I4=($)=>(w)=>async(U)=>{const{request:G}=U;if(!x.isInstance(G)||$.runtime!=="node"||G.headers.hasOwnProperty(ow))return w(U);const f=process.env[Z4],E=process.env[F4],W=(L)=>typeof L==="string"&&L.length>0;if(W(f)&&W(E))G.headers[ow]=E;return w({...U,request:G})},Y4={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},U7=($)=>({applyToStack:(w)=>{w.add(I4($),Y4)}});function WM($){return{...$,customUserAgent:typeof $.customUserAgent==="string"?[[$.customUserAgent]]:$.customUserAgent}}var Z5=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}$"),n0=($)=>Z5.test($)||$.startsWith("[")&&$.endsWith("]");var F5=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),s0=($,w=!1)=>{if(!w)return F5.test($);const U=$.split(".");for(let G of U)if(!s0(G))return!1;return!0};var m0={};var t="endpoints";function u($){if(typeof $!=="object"||$==null)return $;if("ref"in $)return`\$${u($.ref)}`;if("fn"in $)return`${$.fn}(${($.argv||[]).map(u).join(", ")})`;return JSON.stringify($,null,2)}class B extends Error{constructor($){super($);this.name="EndpointError"}}var RL=($,w)=>$===w;var XL=($)=>{const w=$.split("."),U=[];for(let G of w){const f=G.indexOf("[");if(f!==-1){if(G.indexOf("]")!==G.length-1)throw new B(`Path: '${$}' does not end with ']'`);const E=G.slice(f+1,-1);if(Number.isNaN(parseInt(E)))throw new B(`Invalid array index: '${E}' in path: '${$}'`);if(f!==0)U.push(G.slice(0,f));U.push(E)}else U.push(G)}return U};var k1=($,w)=>XL(w).reduce((U,G)=>{if(typeof U!=="object")throw new B(`Index '${G}' in '${w}' not found in '${JSON.stringify($)}'`);else if(Array.isArray(U))return U[parseInt(G)];return U[G]},$);var ZL=($)=>$!=null;var FL=($)=>!$;var c1=X0(Q0(),1);var Zw={[c1.EndpointURLScheme.HTTP]:80,[c1.EndpointURLScheme.HTTPS]:443},IL=($)=>{const w=(()=>{try{if($ instanceof URL)return $;if(typeof $==="object"&&"hostname"in $){const{hostname:Y,port:I,protocol:z="",path:J="",query:O={}}=$,T=new URL(`${z}//${Y}${I?`:${I}`:""}${J}`);return T.search=Object.entries(O).map(([K,A])=>`${K}=${A}`).join("&"),T}return new URL($)}catch(Y){return null}})();if(!w)return console.error(`Unable to parse ${JSON.stringify($)} as a whatwg URL.`),null;const U=w.href,{host:G,hostname:f,pathname:E,protocol:W,search:L}=w;if(L)return null;const R=W.slice(0,-1);if(!Object.values(c1.EndpointURLScheme).includes(R))return null;const X=n0(f),Z=U.includes(`${G}:${Zw[R]}`)||typeof $==="string"&&$.includes(`${G}:${Zw[R]}`),F=`${G}${Z?`:${Zw[R]}`:""}`;return{scheme:R,authority:F,path:E,normalizedPath:E.endsWith("/")?E:`${E}/`,isIp:X}};var YL=($,w)=>$===w;var zL=($,w,U,G)=>{if(w>=U||$.length<U)return null;if(!G)return $.substring(w,U);return $.substring($.length-U,$.length-w)};var QL=($)=>encodeURIComponent($).replace(/[!*'()]/g,(w)=>`%${w.charCodeAt(0).toString(16).toUpperCase()}`);var ML={booleanEquals:RL,getAttr:k1,isSet:ZL,isValidHostLabel:s0,not:FL,parseURL:IL,stringEquals:YL,substring:zL,uriEncode:QL};var v1=($,w)=>{const U=[],G={...w.endpointParams,...w.referenceRecord};let f=0;while(f<$.length){const E=$.indexOf("{",f);if(E===-1){U.push($.slice(f));break}U.push($.slice(f,E));const W=$.indexOf("}",E);if(W===-1){U.push($.slice(E));break}if($[E+1]==="{"&&$[W+1]==="}")U.push($.slice(E+1,W)),f=W+2;const L=$.substring(E+1,W);if(L.includes("#")){const[R,X]=L.split("#");U.push(k1(G[R],X))}else U.push(G[L]);f=W+1}return U.join("")};var JL=({ref:$},w)=>{return{...w.endpointParams,...w.referenceRecord}[$]};var w0=($,w,U)=>{if(typeof $==="string")return v1($,U);else if($.fn)return x1($,U);else if($.ref)return JL($,U);throw new B(`'${w}': ${String($)} is not a string, function or reference.`)};var x1=({fn:$,argv:w},U)=>{const G=w.map((E)=>["boolean","number"].includes(typeof E)?E:w0(E,"arg",U)),f=$.split(".");if(f[0]in m0&&f[1]!=null)return m0[f[0]][f[1]](...G);return ML[$](...G)};var TL=({assign:$,...w},U)=>{if($&&$ in U.referenceRecord)throw new B(`'${$}' is already defined in Reference Record.`);const G=x1(w,U);return U.logger?.debug?.(`${t} evaluateCondition: ${u(w)} = ${u(G)}`),{result:G===""?!0:!!G,...$!=null&&{toAssign:{name:$,value:G}}}};var H0=($=[],w)=>{const U={};for(let G of $){const{result:f,toAssign:E}=TL(G,{...w,referenceRecord:{...w.referenceRecord,...U}});if(!f)return{result:f};if(E)U[E.name]=E.value,w.logger?.debug?.(`${t} assign: ${E.name} := ${u(E.value)}`)}return{result:!0,referenceRecord:U}};var KL=($,w)=>Object.entries($).reduce((U,[G,f])=>({...U,[G]:f.map((E)=>{const W=w0(E,"Header value entry",w);if(typeof W!=="string")throw new B(`Header '${G}' value '${W}' is not a string`);return W})}),{});var Fw=($,w)=>{if(Array.isArray($))return $.map((U)=>Fw(U,w));switch(typeof $){case"string":return v1($,w);case"object":if($===null)throw new B(`Unexpected endpoint property: ${$}`);return y1($,w);case"boolean":return $;default:throw new B(`Unexpected endpoint property type: ${typeof $}`)}};var y1=($,w)=>Object.entries($).reduce((U,[G,f])=>({...U,[G]:Fw(f,w)}),{});var OL=($,w)=>{const U=w0($,"Endpoint URL",w);if(typeof U==="string")try{return new URL(U)}catch(G){throw console.error(`Failed to construct URL with ${U}`,G),G}throw new B(`Endpoint URL must be a string, got ${typeof U}`)};var AL=($,w)=>{const{conditions:U,endpoint:G}=$,{result:f,referenceRecord:E}=H0(U,w);if(!f)return;const W={...w,referenceRecord:{...w.referenceRecord,...E}},{url:L,properties:R,headers:X}=G;return w.logger?.debug?.(`${t} Resolving endpoint from template: ${u(G)}`),{...X!=null&&{headers:KL(X,W)},...R!=null&&{properties:y1(R,W)},url:OL(L,W)}};var BL=($,w)=>{const{conditions:U,error:G}=$,{result:f,referenceRecord:E}=H0(U,w);if(!f)return;throw new B(w0(G,"Error",{...w,referenceRecord:{...w.referenceRecord,...E}}))};var VL=($,w)=>{const{conditions:U,rules:G}=$,{result:f,referenceRecord:E}=H0(U,w);if(!f)return;return u1(G,{...w,referenceRecord:{...w.referenceRecord,...E}})};var u1=($,w)=>{for(let U of $)if(U.type==="endpoint"){const G=AL(U,w);if(G)return G}else if(U.type==="error")BL(U,w);else if(U.type==="tree"){const G=VL(U,w);if(G)return G}else throw new B(`Unknown endpoint rule: ${U}`);throw new B("Rules evaluation failed")};var I5=($,w)=>{const{endpointParams:U,logger:G}=w,{parameters:f,rules:E}=$;w.logger?.debug?.(`${t} Initial EndpointParams: ${u(U)}`);const W=Object.entries(f).filter(([,X])=>X.default!=null).map(([X,Z])=>[X,Z.default]);if(W.length>0)for(let[X,Z]of W)U[X]=U[X]??Z;const L=Object.entries(f).filter(([,X])=>X.required).map(([X])=>X);for(let X of L)if(U[X]==null)throw new B(`Missing required parameter: '${X}'`);const R=u1(E,{endpointParams:U,logger:G,referenceRecord:{}});if(w.endpointParams?.Endpoint)try{const X=new URL(w.endpointParams.Endpoint),{protocol:Z,port:F}=X;R.url.protocol=Z,R.url.port=F}catch(X){}return w.logger?.debug?.(`${t} Resolved endpoint: ${u(R)}`),R};var Iw=($,w=!1)=>{if(w){for(let U of $.split("."))if(!Iw(U))return!1;return!0}if(!s0($))return!1;if($.length<3||$.length>63)return!1;if($!==$.toLowerCase())return!1;if(n0($))return!1;return!0};var HL=($)=>{const w=$.split(":");if(w.length<6)return null;const[U,G,f,E,W,...L]=w;if(U!=="arn"||G===""||f===""||L[0]==="")return null;return{partition:G,service:f,region:E,accountId:W,resourceId:L[0].includes("/")?L[0].split("/"):L}};var CL={partitions:[{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:{}}],version:"1.1"};var z5=CL,Q5="",NL=($)=>{const{partitions:w}=z5;for(let G of w){const{regions:f,outputs:E}=G;for(let[W,L]of Object.entries(f))if(W===$)return{...E,...L}}for(let G of w){const{regionRegex:f,outputs:E}=G;if(new RegExp(f).test($))return{...E}}const U=w.find((G)=>G.id==="aws");if(!U)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...U.outputs}};var qL=()=>Q5;var M5={isVirtualHostableS3Bucket:Iw,parseArn:HL,partition:NL};m0.aws=M5;var Yw="user-agent",_1="x-amz-user-agent",zw=" ",d1="/",jL=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,PL=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,Qw="-";var J5=($)=>(w,U)=>async(G)=>{const{request:f}=G;if(!x.isInstance(f))return w(G);const{headers:E}=f,W=U?.userAgent?.map(Mw)||[],L=(await $.defaultUserAgentProvider()).map(Mw),R=$?.customUserAgent?.map(Mw)||[],X=qL(),Z=(X?[X]:[]).concat([...L,...W,...R]).join(zw),F=[...L.filter((Y)=>Y.startsWith("aws-sdk-")),...R].join(zw);if($.runtime!=="browser"){if(F)E[_1]=E[_1]?`${E[Yw]} ${F}`:F;E[Yw]=Z}else E[_1]=Z;return w({...G,request:f})},Mw=($)=>{const w=$[0].split(d1).map((W)=>W.replace(jL,Qw)).join(d1),U=$[1]?.replace(PL,Qw),G=w.indexOf(d1),f=w.substring(0,G);let E=w.substring(G+1);if(f==="api")E=E.toLowerCase();return[f,E,U].filter((W)=>W&&W.length>0).reduce((W,L,R)=>{switch(R){case 0:return L;case 1:return`${W}/${L}`;default:return`${W}#${L}`}},"")},T5={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},uT=($)=>({applyToStack:(w)=>{w.add(J5($),T5)}});var p1=($)=>typeof $==="string"&&($.startsWith("fips-")||$.endsWith("-fips"));var Jw=($)=>p1($)?["fips-aws-global","aws-fips"].includes($)?"us-east-1":$.replace(/fips-(dkr-|prod-)?|-fips/,""):$;var rT=($)=>{const{region:w,useFipsEndpoint:U}=$;if(!w)throw new Error("Region is missing");return{...$,region:async()=>{if(typeof w==="string")return Jw(w);const G=await w();return Jw(G)},useFipsEndpoint:async()=>{const G=typeof w==="string"?w:await w();if(p1(G))return!0;return typeof U!=="function"?Promise.resolve(!!U):U()}}};var C0=($,w,U)=>{if(!(w in $))return;if($[w]==="true")return!0;if($[w]==="false")return!1;throw new Error(`Cannot load ${U} "${w}". Expected "true" or "false", got ${$[w]}.`)};var U0;(function($){$.ENV="env",$.CONFIG="shared config entry"})(U0||(U0={}));var K5="AWS_USE_DUALSTACK_ENDPOINT",O5="use_dualstack_endpoint";var E3={environmentVariableSelector:($)=>C0($,K5,U0.ENV),configFileSelector:($)=>C0($,O5,U0.CONFIG),default:!1};var A5="AWS_USE_FIPS_ENDPOINT",B5="use_fips_endpoint";var R3={environmentVariableSelector:($)=>C0($,A5,U0.ENV),configFileSelector:($)=>C0($,B5,U0.CONFIG),default:!1};var V5=X0(n(),1);var H5=X0(n(),1);var SL={environmentVariableSelector:($)=>$["AWS_REGION"],configFileSelector:($)=>$["region"],default:()=>{throw new Error("Region is missing")}},O3={preferredFile:"credentials"};function C5($){return(w)=>async(U)=>{const G=U.request;if(x.isInstance(G)){const{body:f,headers:E}=G;if(f&&Object.keys(E).map((W)=>W.toLowerCase()).indexOf(bL)===-1)try{const W=$(f);G.headers={...G.headers,[bL]:String(W)}}catch(W){}}return w({...U,request:G})}}var bL="content-length",N5={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},m3=($)=>({applyToStack:(w)=>{w.add(C5($.bodyLengthChecker),N5)}});var hL=($,w)=>(U)=>async(G)=>{const{response:f}=await U(G);try{const E=await w(f,$);return{response:f,output:E}}catch(E){if(Object.defineProperty(E,"$response",{value:f}),!("$metadata"in E)){if(E.message+="\n Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.",typeof E.$responseBodyText!=="undefined"){if(E.$response)E.$response.body=E.$responseBodyText}}throw E}};var DL=($,w)=>(U,G)=>async(f)=>{const E=G.endpointV2?.url&&$.urlParser?async()=>$.urlParser(G.endpointV2.url):$.endpoint;if(!E)throw new Error("No valid endpoint provider available.");const W=await w(f.input,{...$,endpoint:E});return U({...f,request:W})};function e3($,w,U){return{applyToStack:(G)=>{G.add(hL($,U),q5),G.add(DL($,w),Tw)}}}var q5={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Tw={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};var dL=X0(n(),1);var kL=async($)=>{const w=$?.Bucket||"";if(typeof $.Bucket==="string")$.Bucket=w.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(h5(w)){if($.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!b5(w)||w.indexOf(".")!==-1&&!String($.Endpoint).startsWith("http:")||w.toLowerCase()!==w||w.length<3)$.ForcePathStyle=!0;if($.DisableMultiRegionAccessPoints)$.disableMultiRegionAccessPoints=!0,$.DisableMRAP=!0;return $},j5=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,P5=/(\d+\.){3}\d+/,S5=/\.\./;var b5=($)=>j5.test($)&&!P5.test($)&&!S5.test($),h5=($)=>{const[w,U,G,,,f]=$.split(":"),E=w==="arn"&&$.split(":").length>=6,W=Boolean(E&&U&&G&&f);if(E&&!W)throw new Error(`Invalid ARN: ${$} was an invalid ARN.`);return W};var cL=($,w,U)=>{const G=async()=>{const f=U[$]??U[w];if(typeof f==="function")return f();return f};if($==="credentialScope"||w==="CredentialScope")return async()=>{const f=typeof U.credentials==="function"?await U.credentials():U.credentials;return f?.credentialScope??f?.CredentialScope};if($==="accountId"||w==="AccountId")return async()=>{const f=typeof U.credentials==="function"?await U.credentials():U.credentials;return f?.accountId??f?.AccountId};if($==="endpoint"||w==="endpoint")return async()=>{const f=await G();if(f&&typeof f==="object"){if("url"in f)return f.url.href;if("hostname"in f){const{protocol:E,hostname:W,port:L,path:R}=f;return`${E}//${W}${L?":"+L:""}${R}`}}return f};return G};var vL="AWS_ENDPOINT_URL",xL="endpoint_url",yL=($)=>({environmentVariableSelector:(w)=>{const U=$.split(" ").map((E)=>E.toUpperCase()),G=w[[vL,...U].join("_")];if(G)return G;const f=w[vL];if(f)return f;return},configFileSelector:(w,U)=>{if(U&&w.services){const f=U[["services",w.services].join(Kw)];if(f){const E=$.split(" ").map((L)=>L.toLowerCase()),W=f[[E.join("_"),xL].join(Kw)];if(W)return W}}const G=w[xL];if(G)return G;return},default:void 0});var uL=async($)=>Z0(yL($))();var g1=($)=>{if(typeof $==="object"){if("url"in $)return Ow($.url);return $}return Ow($)};var _L=async($,w,U,G)=>{if(!U.endpoint){const W=await uL(U.serviceId||"");if(W)U.endpoint=()=>Promise.resolve(g1(W))}const f=await D5($,w,U);if(typeof U.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return U.endpointProvider(f,G)},D5=async($,w,U)=>{const G={},f=w?.getEndpointParameterInstructions?.()||{};for(let[E,W]of Object.entries(f))switch(W.type){case"staticContextParams":G[E]=W.value;break;case"contextParams":G[E]=$[W.name];break;case"clientContextParams":case"builtInParams":G[E]=await cL(W.name,E,U)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(W))}if(Object.keys(f).length===0)Object.assign(G,U);if(String(U.serviceId).toLowerCase()==="s3")await kL(G);return G};var pL=({config:$,instructions:w})=>{return(U,G)=>async(f)=>{const E=await _L(f.input,{getEndpointParameterInstructions(){return w}},{...$},G);G.endpointV2=E,G.authSchemes=E.properties?.authSchemes;const W=G.authSchemes?.[0];if(W){G.signing_region=W.signingRegion,G.signing_service=W.signingName;const R=dL.getSmithyContext(G)?.selectedHttpAuthScheme?.httpAuthOption;if(R)R.signingProperties=Object.assign(R.signingProperties||{},{signing_region:W.signingRegion,signingRegion:W.signingRegion,signing_service:W.signingName,signingName:W.signingName,signingRegionSet:W.signingRegionSet},W.properties)}return U({...f})}};var k5={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Tw.name},CK=($,w)=>({applyToStack:(U)=>{U.addRelativeTo(pL({config:$,instructions:w}),k5)}});var l1=X0(n(),1);var jK=($)=>{const w=$.tls??!0,{endpoint:U}=$,G=U!=null?async()=>g1(await l1.normalizeProvider(U)()):void 0;return{...$,endpoint:G,tls:w,isCustomEndpoint:!!U,useDualstackEndpoint:l1.normalizeProvider($.useDualstackEndpoint??!1),useFipsEndpoint:l1.normalizeProvider($.useFipsEndpoint??!1)}};var m=X0(j$(),1),uK=m.default.v1,_K=m.default.v3,gL=m.default.v4,dK=m.default.v5,pK=m.default.NIL,gK=m.default.version,lK=m.default.validate,nK=m.default.stringify,sK=m.default.parse;var qw=X0(n(),1);var l;(function($){$.STANDARD="standard",$.ADAPTIVE="adaptive"})(l||(l={}));var F0=3,lL=l.STANDARD;var nL=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],sL=["TimeoutError","RequestTimeout","RequestTimeoutException"],mL=[500,502,503,504],iL=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"];var c5=($)=>$.$metadata?.clockSkewCorrected,N0=($)=>$.$metadata?.httpStatusCode===429||nL.includes($.name)||$.$retryable?.throttling==!0,n1=($)=>c5($)||sL.includes($.name)||iL.includes($?.code||"")||mL.includes($.$metadata?.httpStatusCode||0),rL=($)=>{if($.$metadata?.httpStatusCode!==void 0){const w=$.$metadata.httpStatusCode;if(500<=w&&w<=599&&!n1($))return!0;return!1}return!1};class s1{constructor($){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=$?.beta??0.7,this.minCapacity=$?.minCapacity??1,this.minFillRate=$?.minFillRate??0.5,this.scaleConstant=$?.scaleConstant??0.4,this.smooth=$?.smooth??0.8;const w=this.getCurrentTimeInSeconds();this.lastThrottleTime=w,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1000}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket($){if(!this.enabled)return;if(this.refillTokenBucket(),$>this.currentCapacity){const w=($-this.currentCapacity)/this.fillRate*1000;await new Promise((U)=>setTimeout(U,w))}this.currentCapacity=this.currentCapacity-$}refillTokenBucket(){const $=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=$;return}const w=($-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+w),this.lastTimestamp=$}updateClientSendingRate($){let w;if(this.updateMeasuredRate(),N0($)){const G=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=G,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),w=this.cubicThrottle(G),this.enableTokenBucket()}else this.calculateTimeWindow(),w=this.cubicSuccess(this.getCurrentTimeInSeconds());const U=Math.min(w,2*this.measuredTxRate);this.updateTokenBucketRate(U)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle($){return this.getPrecise($*this.beta)}cubicSuccess($){return this.getPrecise(this.scaleConstant*Math.pow($-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate($){this.refillTokenBucket(),this.fillRate=Math.max($,this.minFillRate),this.maxCapacity=Math.max($,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const $=this.getCurrentTimeInSeconds(),w=Math.floor($*2)/2;if(this.requestCount++,w>this.lastTxRateBucket){const U=this.requestCount/(w-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(U*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=w}}getPrecise($){return parseFloat($.toFixed(8))}}var I0=100,i0=20000,Aw=500,m1=500,Bw=5,Vw=10,Hw=1,i1="amz-sdk-invocation-id",r1="amz-sdk-request";var oL=()=>{let $=I0;return{computeNextBackoffDelay:(G)=>{return Math.floor(Math.min(i0,Math.random()*2**G*$))},setDelayBase:(G)=>{$=G}}};var Cw=({retryDelay:$,retryCount:w,retryCost:U})=>{return{getRetryCount:()=>w,getRetryDelay:()=>Math.min(i0,$),getRetryCost:()=>U}};class q0{constructor($){this.maxAttempts=$,this.mode=l.STANDARD,this.capacity=m1,this.retryBackoffStrategy=oL(),this.maxAttemptsProvider=typeof $==="function"?$:async()=>$}async acquireInitialRetryToken($){return Cw({retryDelay:I0,retryCount:0})}async refreshRetryTokenForRetry($,w){const U=await this.getMaxAttempts();if(this.shouldRetry($,w,U)){const G=w.errorType;this.retryBackoffStrategy.setDelayBase(G==="THROTTLING"?Aw:I0);const f=this.retryBackoffStrategy.computeNextBackoffDelay($.getRetryCount()),E=w.retryAfterHint?Math.max(w.retryAfterHint.getTime()-Date.now()||0,f):f,W=this.getCapacityCost(G);return this.capacity-=W,Cw({retryDelay:E,retryCount:$.getRetryCount()+1,retryCost:W})}throw new Error("No retry token available")}recordSuccess($){this.capacity=Math.max(m1,this.capacity+($.getRetryCost()??Hw))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch($){return console.warn(`Max attempts provider could not resolve. Using default of ${F0}`),F0}}shouldRetry($,w,U){return $.getRetryCount()+1<U&&this.capacity>=this.getCapacityCost(w.errorType)&&this.isRetryableError(w.errorType)}getCapacityCost($){return $==="TRANSIENT"?Vw:Bw}isRetryableError($){return $==="THROTTLING"||$==="TRANSIENT"}}class Nw{constructor($,w){this.maxAttemptsProvider=$,this.mode=l.ADAPTIVE;const{rateLimiter:U}=w??{};this.rateLimiter=U??new s1,this.standardRetryStrategy=new q0($)}async acquireInitialRetryToken($){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken($)}async refreshRetryTokenForRetry($,w){return this.rateLimiter.updateClientSendingRate(w),this.standardRetryStrategy.refreshRetryTokenForRetry($,w)}recordSuccess($){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess($)}}var tL="AWS_MAX_ATTEMPTS",aL="max_attempts",qO={environmentVariableSelector:($)=>{const w=$[tL];if(!w)return;const U=parseInt(w);if(Number.isNaN(U))throw new Error(`Environment variable ${tL} mast be a number, got "${w}"`);return U},configFileSelector:($)=>{const w=$[aL];if(!w)return;const U=parseInt(w);if(Number.isNaN(U))throw new Error(`Shared config file entry ${aL} mast be a number, got "${w}"`);return U},default:F0},jO=($)=>{const{retryStrategy:w}=$,U=qw.normalizeProvider($.maxAttempts??F0);return{...$,maxAttempts:U,retryStrategy:async()=>{if(w)return w;if(await qw.normalizeProvider($.retryMode)()===l.ADAPTIVE)return new Nw(U);return new q0(U)}}},v5="AWS_RETRY_MODE",x5="retry_mode",PO={environmentVariableSelector:($)=>$[v5],configFileSelector:($)=>$[x5],default:lL};import{Readable as y5} from"stream";var eL=($)=>$?.body instanceof y5||typeof ReadableStream!=="undefined"&&$?.body instanceof ReadableStream;var jw=($)=>{if($ instanceof Error)return $;if($ instanceof Object)return Object.assign(new Error,$);if(typeof $==="string")return new Error($);return new Error(`AWS SDK error wrapper for ${$}`)};var u5=($)=>(w,U)=>async(G)=>{let f=await $.retryStrategy();const E=await $.maxAttempts();if(_5(f)){f=f;let W=await f.acquireInitialRetryToken(U.partition_id),L=new Error,R=0,X=0;const{request:Z}=G,F=x.isInstance(Z);if(F)Z.headers[i1]=gL();while(!0)try{if(F)Z.headers[r1]=`attempt=${R+1}; max=${E}`;const{response:Y,output:I}=await w(G);return f.recordSuccess(W),I.$metadata.attempts=R+1,I.$metadata.totalRetryDelay=X,{response:Y,output:I}}catch(Y){const I=d5(Y);if(L=jw(Y),F&&eL(Z))throw(U.logger instanceof $R?console:U.logger)?.warn("An error was encountered in a non-retryable streaming request."),L;try{W=await f.refreshRetryTokenForRetry(W,I)}catch(J){if(!L.$metadata)L.$metadata={};throw L.$metadata.attempts=R+1,L.$metadata.totalRetryDelay=X,L}R=W.getRetryCount();const z=W.getRetryDelay();X+=z,await new Promise((J)=>setTimeout(J,z))}}else{if(f=f,f?.mode)U.userAgent=[...U.userAgent||[],["cfg/retry-mode",f.mode]];return f.retry(w,G)}},_5=($)=>typeof $.acquireInitialRetryToken!=="undefined"&&typeof $.refreshRetryTokenForRetry!=="undefined"&&typeof $.recordSuccess!=="undefined",d5=($)=>{const w={error:$,errorType:p5($)},U=l5($.$response);if(U)w.retryAfterHint=U;return w},p5=($)=>{if(N0($))return"THROTTLING";if(n1($))return"TRANSIENT";if(rL($))return"SERVER_ERROR";return"CLIENT_ERROR"},g5={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},dO=($)=>({applyToStack:(w)=>{w.add(u5($),g5)}}),l5=($)=>{if(!Pw.isInstance($))return;const w=Object.keys($.headers).find((E)=>E.toLowerCase()==="retry-after");if(!w)return;const U=$.headers[w],G=Number(U);if(!Number.isNaN(G))return new Date(G*1000);return new Date(U)};import{platform as DQ,release as kQ} from"os";import{env as r8,versions as cQ} from"process";var nw={isCrtAvailable:!1};var i8=()=>{if(nw.isCrtAvailable)return["md/crt-avail"];return null};var vQ="AWS_SDK_UA_APP_ID",xQ="sdk-ua-app-id",iA=({serviceId:$,clientVersion:w})=>{const U=[["aws-sdk-js",w],["ua","2.0"],[`os/${DQ()}`,kQ()],["lang/js"],["md/nodejs",`${cQ.node}`]],G=i8();if(G)U.push(G);if($)U.push([`api/${$}`,w]);if(r8.AWS_EXECUTION_ENV)U.push([`exec-env/${r8.AWS_EXECUTION_ENV}`]);const f=Z0({environmentVariableSelector:(W)=>W[vQ],configFileSelector:(W)=>W[xQ],default:void 0})();let E=void 0;return async()=>{if(!E){const W=await f;E=W?[...U,[`app/${W}`]]:[...U]}return E}};import{Buffer as yQ} from"buffer";import{createHash as uQ,createHmac as _Q} from"crypto";var o8=function($,w){if(yQ.isBuffer($))return $;if(typeof $==="string")return t8($,w);if(ArrayBuffer.isView($))return sw($.buffer,$.byteOffset,$.byteLength);return sw($)};class dQ{constructor($,w){this.algorithmIdentifier=$,this.secret=w,this.reset()}update($,w){this.hash.update(a8(o8($,w)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?_Q(this.algorithmIdentifier,o8(this.secret)):uQ(this.algorithmIdentifier)}}import{fstatSync as pQ,lstatSync as gQ} from"fs";var fB=($)=>{if(!$)return 0;if(typeof $==="string")return Buffer.byteLength($);else if(typeof $.byteLength==="number")return $.byteLength;else if(typeof $.size==="number")return $.size;else if(typeof $.start==="number"&&typeof $.end==="number")return $.end+1-$.start;else if(typeof $.path==="string"||Buffer.isBuffer($.path))return gQ($.path).size;else if(typeof $.fd==="number")return pQ($.fd).size;throw new Error(`Body Length computation failed for ${$}`)};var e8="AWS_EXECUTION_ENV",mw="AWS_REGION",iw="AWS_DEFAULT_REGION",$4="AWS_EC2_METADATA_DISABLED",w4=["in-region","cross-region","mobile","standard","legacy"],U4="/latest/meta-data/placement/region";var f4={environmentVariableSelector:($)=>{return $["AWS_DEFAULTS_MODE"]},configFileSelector:($)=>{return $["defaults_mode"]},default:"legacy"};var zB=({region:$=Z0(SL),defaultsMode:w=Z0(f4)}={})=>G4(async()=>{const U=typeof w==="function"?await w():w;switch(U?.toLowerCase()){case"auto":return lQ($);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(U?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${w4.join(", ")}, got ${U}`)}}),lQ=async($)=>{if($){const w=typeof $==="function"?await $():$,U=await nQ();if(!U)return"standard";if(w===U)return"in-region";else return"cross-region"}return"standard"},nQ=async()=>{if(process.env[e8]&&(process.env[mw]||process.env[iw]))return process.env[mw]??process.env[iw];if(!process.env[$4])try{const{getInstanceMetadataEndpoint:$,httpRequest:w}=await import("./chunk-01052ff9d1c07ef8.js"),U=await $();return(await w({...U,path:U4})).toString()}catch($){}};var TB=($)=>{let w=async()=>{if($.region===void 0)throw new Error("Region is missing from runtimeConfig");const U=$.region;if(typeof U==="string")return U;return U()};return{setRegion(U){w=U},region(){return w}}},KB=($)=>{return{region:$.region()}};export{iQ as ya,rQ as za,tQ as Aa,U7 as Ba,n as Ca,C0 as Da,U0 as Ea,Xw as Fa,WM as Ga,m0 as Ha,I5 as Ia,M5 as Ja,uT as Ka,E3 as La,R3 as Ma,SL as Na,O3 as Oa,rT as Pa,m3 as Qa,D5 as Ra,e3 as Sa,CK as Ta,jK as Ua,lL as Va,gL as Wa,qO as Xa,jO as Ya,PO as Za,dO as _a,jR as $a,hQ as ab,iA as bb,dQ as cb,fB as db,zB as eb,TB as fb,KB as gb};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-7ce930fe69575c87.js";import"./chunk-a0003b7feea6fae6.js";import{lb as c,nb as m} from"./chunk-ff086fe014985526.js";import{sb as l,yb as S} from"./chunk-d26ffb7722e6df54.js";var w=(e,s,r)=>{const i={EcsContainer:async(t)=>{const{fromHttp:n}=await import("./chunk-d5709251a0493152.js"),{fromContainerMetadata:d}=await import("./chunk-01052ff9d1c07ef8.js");return r?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),m(n(t??{}),d(t))},Ec2InstanceMetadata:async(t)=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");const{fromInstanceMetadata:n}=await import("./chunk-01052ff9d1c07ef8.js");return n(t)},Environment:async(t)=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");const{fromEnv:n}=await import("./chunk-c1813278ccdc04b8.js");return n(t)}};if(e in i)return i[e];else throw new c(`Unsupported credential source in profile ${s}. Got ${e}, `+"expected EcsContainer or Ec2InstanceMetadata or Environment.",{logger:r})};var y=(e,{profile:s="default",logger:r}={})=>{return Boolean(e)&&typeof e==="object"&&typeof e.role_arn==="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1&&["undefined","string"].indexOf(typeof e.external_id)>-1&&["undefined","string"].indexOf(typeof e.mfa_serial)>-1&&(h(e,{profile:s,logger:r})||D(e,{profile:s,logger:r}))},h=(e,{profile:s,logger:r})=>{const i=typeof e.source_profile==="string"&&typeof e.credential_source==="undefined";if(i)r?.debug?.(` ${s} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`);return i},D=(e,{profile:s,logger:r})=>{const i=typeof e.credential_source==="string"&&typeof e.source_profile==="undefined";if(i)r?.debug?.(` ${s} isCredentialSourceProfile credential_source=${e.credential_source}`);return i},C=async(e,s,r,i={})=>{r.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");const t=s[e];if(!r.roleAssumer){const{getDefaultRoleAssumer:R}=await import("./chunk-
|
|
2
|
+
import"./chunk-7ce930fe69575c87.js";import"./chunk-a0003b7feea6fae6.js";import{lb as c,nb as m} from"./chunk-ff086fe014985526.js";import{sb as l,yb as S} from"./chunk-d26ffb7722e6df54.js";var w=(e,s,r)=>{const i={EcsContainer:async(t)=>{const{fromHttp:n}=await import("./chunk-d5709251a0493152.js"),{fromContainerMetadata:d}=await import("./chunk-01052ff9d1c07ef8.js");return r?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),m(n(t??{}),d(t))},Ec2InstanceMetadata:async(t)=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");const{fromInstanceMetadata:n}=await import("./chunk-01052ff9d1c07ef8.js");return n(t)},Environment:async(t)=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");const{fromEnv:n}=await import("./chunk-c1813278ccdc04b8.js");return n(t)}};if(e in i)return i[e];else throw new c(`Unsupported credential source in profile ${s}. Got ${e}, `+"expected EcsContainer or Ec2InstanceMetadata or Environment.",{logger:r})};var y=(e,{profile:s="default",logger:r}={})=>{return Boolean(e)&&typeof e==="object"&&typeof e.role_arn==="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1&&["undefined","string"].indexOf(typeof e.external_id)>-1&&["undefined","string"].indexOf(typeof e.mfa_serial)>-1&&(h(e,{profile:s,logger:r})||D(e,{profile:s,logger:r}))},h=(e,{profile:s,logger:r})=>{const i=typeof e.source_profile==="string"&&typeof e.credential_source==="undefined";if(i)r?.debug?.(` ${s} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`);return i},D=(e,{profile:s,logger:r})=>{const i=typeof e.credential_source==="string"&&typeof e.source_profile==="undefined";if(i)r?.debug?.(` ${s} isCredentialSourceProfile credential_source=${e.credential_source}`);return i},C=async(e,s,r,i={})=>{r.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");const t=s[e];if(!r.roleAssumer){const{getDefaultRoleAssumer:R}=await import("./chunk-60d70dcbf4e79276.js");r.roleAssumer=R({...r.clientConfig,credentialProviderLogger:r.logger,parentClientConfig:r?.parentClientConfig},r.clientPlugins)}const{source_profile:n}=t;if(n&&n in i)throw new c("Detected a cycle attempting to resolve credentials for profile"+` ${l(r)}. Profiles visited: `+Object.keys(i).join(", "),{logger:r.logger});r.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${n?`source_profile=[${n}]`:`profile=[${e}]`}`);const d=n?o(n,{...s,[n]:{...s[n],role_arn:t.role_arn??s[n].role_arn}},r,{...i,[n]:!0}):(await w(t.credential_source,e,r.logger)(r))(),u={RoleArn:t.role_arn,RoleSessionName:t.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:t.external_id,DurationSeconds:parseInt(t.duration_seconds||"3600",10)},{mfa_serial:f}=t;if(f){if(!r.mfaCodeProvider)throw new c(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:r.logger,tryNextLink:!1});u.SerialNumber=f,u.TokenCode=await r.mfaCodeProvider(f)}const $=await d;return r.roleAssumer($,u)};var P=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.credential_process==="string",v=async(e,s)=>import("./chunk-dc7b0cf226ba3afa.js").then(({fromProcess:r})=>r({...e,profile:s})());var x=async(e,s={})=>{const{fromSSO:r}=await import("./chunk-c609d06153ed09ce.js");return r({profile:e,logger:s.logger})()},b=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var _=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.aws_access_key_id==="string"&&typeof e.aws_secret_access_key==="string"&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1&&["undefined","string"].indexOf(typeof e.aws_account_id)>-1,a=(e,s)=>{return s?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials"),Promise.resolve({accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}})};var A=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.web_identity_token_file==="string"&&typeof e.role_arn==="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1,k=async(e,s)=>import("./chunk-1900e90c372bb1d6.js").then(({fromTokenFile:r})=>r({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:s.roleAssumerWithWebIdentity,logger:s.logger,parentClientConfig:s.parentClientConfig})());var o=async(e,s,r,i={})=>{const t=s[e];if(Object.keys(i).length>0&&_(t))return a(t,r);if(y(t,{profile:e,logger:r.logger}))return C(e,s,r,i);if(_(t))return a(t,r);if(A(t))return k(t,r);if(P(t))return v(r,e);if(b(t))return await x(e,r);throw new c(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:r.logger})};var H=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");const s=await S(e);return o(l(e),s,e)};export{H as fromIni};
|