gemi 0.4.85 → 0.4.87
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/app/App.d.ts +1 -1
- package/dist/app/App.d.ts.map +1 -1
- package/dist/app/index.js +1 -141
- package/dist/app/prismaExtension.d.ts +1 -5
- package/dist/app/prismaExtension.d.ts.map +1 -1
- package/dist/bin/index.js +124 -69
- package/dist/chunk-28694e5e949df0ff.js +2 -0
- package/dist/chunk-332553172e3ab961.js +2 -0
- package/dist/chunk-43b1a27bc037bc09.js +2 -0
- package/dist/chunk-519593bc19f7cb9f.js +18 -0
- package/dist/chunk-5806220e55ac164c.js +1 -0
- package/dist/chunk-5f01223b8fbe1ed8.js +2 -0
- package/dist/chunk-6434d2c5758f4125.js +2 -0
- package/dist/chunk-69b5648fcd0f0a18.js +3 -0
- package/dist/{chunk-b99af11a56fdd395.js → chunk-6b18189b2aabf6b7.js} +1 -1
- package/dist/chunk-8e55cff6329b67a9.js +2 -0
- package/dist/chunk-8ee09f1f74206a04.js +1 -1
- package/dist/chunk-8f2c54f2cd43402a.js +2 -0
- package/dist/chunk-9383d727762ecba1.js +2 -0
- package/dist/chunk-b38c0c4618d0dd89.js +2 -0
- package/dist/chunk-b3eca9338a13f510.js +2 -0
- package/dist/chunk-b4cbb4706a35f5d5.js +2 -0
- package/dist/chunk-c160211e5cc4c447.js +2 -0
- package/dist/chunk-c4b0f134a6b82c51.js +2 -0
- package/dist/chunk-cc7158438e52b9ab.js +9 -0
- package/dist/chunk-d0b9873261cd82b7.js +6 -0
- package/dist/{chunk-63e9bc71922dbe80.js → chunk-fa61561237819f16.js} +1 -1
- package/dist/client/index.js +10 -10
- package/dist/facades/index.js +1 -1
- package/dist/kernel/index.js +1 -1
- package/dist/server/index.js +1 -1
- package/dist/services/index.js +1 -10
- package/dist/vite/{index-BDp-rm3S.mjs → index-CePL3kqT.mjs} +15 -11
- package/dist/vite/index.mjs +1 -1
- package/dist/vite/{typescript-x31i_8Ji.mjs → typescript-CaGEH4-o.mjs} +45 -23
- package/package.json +7 -1
- package/dist/app/createFlatApiRoutes.d.ts +0 -12
- package/dist/app/createFlatApiRoutes.d.ts.map +0 -1
- package/dist/chunk-0ddb821fe8124f54.js +0 -9
- package/dist/chunk-2335866508ec8b1b.js +0 -2
- package/dist/chunk-25ee58bc6072bd58.js +0 -2
- package/dist/chunk-2786cd9024d0d164.js +0 -2
- package/dist/chunk-3043d333fa68d342.js +0 -2
- package/dist/chunk-309e27a19cd3a645.js +0 -18
- package/dist/chunk-38315b1e3dd78ca7.js +0 -2
- package/dist/chunk-63c98893e07b1644.js +0 -2
- package/dist/chunk-8b950df276d04054.js +0 -2
- package/dist/chunk-9007899b37535873.js +0 -2
- package/dist/chunk-958e406572d457ca.js +0 -2
- package/dist/chunk-c27a654eada9167e.js +0 -2
- package/dist/chunk-c6ab6f8e07a028ac.js +0 -6
- package/dist/chunk-d16ef78d852a6856.js +0 -1
- package/dist/chunk-da07ce723d8218db.js +0 -3
- package/dist/chunk-f6a80fc55311e0c8.js +0 -2
- package/dist/chunk-f9f264ce0c8e9699.js +0 -2
- package/dist/chunk-ff8cd8fd047cfee5.js +0 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{B as g,C as I} from"./chunk-24a86f8f5ddc0cbd.js";import{M as az} from"./chunk-28694e5e949df0ff.js";import{Aa as x,Ba as GU,Da as BU,Ea as nL,Ga as iL,Ia as TX,Ja as TY,Oa as R2,Ra as w0,Sa as P5,Ta as K2,Ua as WY,Va as R0,Wa as UW,Xa as t5,Ya as GW} from"./chunk-69b5648fcd0f0a18.js";import{Cb as J0} from"./chunk-6b18189b2aabf6b7.js";import{Db as Gw,Eb as L0} from"./chunk-5806220e55ac164c.js";import{Fb as Z$} from"./chunk-b4cbb4706a35f5d5.js";import{Lb as n$} from"./chunk-fa61561237819f16.js";var l1=I((HU)=>{var w4=function($){return $&&$.__esModule?$:{default:$}},W4=function(){if(o0>a0.length-16)G4.default.randomFillSync(a0),o0=0;return a0.slice(o0,o0+=16)};Object.defineProperty(HU,"__esModule",{value:!0});HU.default=W4;var G4=w4(import.meta.require("crypto")),a0=new Uint8Array(256),o0=a0.length});var qU=I((OU)=>{Object.defineProperty(OU,"__esModule",{value:!0});OU.default=void 0;var L4=/^(?:[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;OU.default=L4});var N0=I((CU)=>{var Y4=function($){return $&&$.__esModule?$:{default:$}},Q4=function($){return typeof $==="string"&&Z4.default.test($)};Object.defineProperty(CU,"__esModule",{value:!0});CU.default=void 0;var Z4=Y4(qU()),z4=Q4;CU.default=z4});var P0=I((jU)=>{var J4=function($){return $&&$.__esModule?$:{default:$}},PU=function($,U=0){return j[$[U+0]]+j[$[U+1]]+j[$[U+2]]+j[$[U+3]]+"-"+j[$[U+4]]+j[$[U+5]]+"-"+j[$[U+6]]+j[$[U+7]]+"-"+j[$[U+8]]+j[$[U+9]]+"-"+j[$[U+10]]+j[$[U+11]]+j[$[U+12]]+j[$[U+13]]+j[$[U+14]]+j[$[U+15]]},M4=function($,U=0){const G=PU($,U);if(!F4.default(G))throw TypeError("Stringified UUID is invalid");return G};Object.defineProperty(jU,"__esModule",{value:!0});jU.default=void 0;jU.unsafeStringify=PU;var F4=J4(N0()),j=[];for(let $=0;$<256;++$)j.push(($+256).toString(16).slice(1));var f4=M4;jU.default=f4});var DU=I((bU)=>{var B4=function($){return $&&$.__esModule?$:{default:$}},E4=function($,U,G){let w=U&&G||0;const W=U||new Array(16);$=$||{};let X=$.node||kU,L=$.clockseq!==void 0?$.clockseq:m1;if(X==null||L==null){const J=$.random||($.rng||R4.default)();if(X==null)X=kU=[J[0]|1,J[1],J[2],J[3],J[4],J[5]];if(L==null)L=m1=(J[6]<<8|J[7])&16383}let Z=$.msecs!==void 0?$.msecs:Date.now(),Y=$.nsecs!==void 0?$.nsecs:i1+1;const Q=Z-n1+(Y-i1)/1e4;if(Q<0&&$.clockseq===void 0)L=L+1&16383;if((Q<0||Z>n1)&&$.nsecs===void 0)Y=0;if(Y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");n1=Z,i1=Y,m1=L,Z+=12219292800000;const z=((Z&268435455)*1e4+Y)%4294967296;W[w++]=z>>>24&255,W[w++]=z>>>16&255,W[w++]=z>>>8&255,W[w++]=z&255;const F=Z/4294967296*1e4&268435455;W[w++]=F>>>8&255,W[w++]=F&255,W[w++]=F>>>24&15|16,W[w++]=F>>>16&255,W[w++]=L>>>8|128,W[w++]=L&255;for(let J=0;J<6;++J)W[w+J]=X[J];return U||K4.unsafeStringify(W)};Object.defineProperty(bU,"__esModule",{value:!0});bU.default=void 0;var R4=B4(l1()),K4=P0(),kU,m1,n1=0,i1=0,A4=E4;bU.default=A4});var r1=I((xU)=>{var H4=function($){return $&&$.__esModule?$:{default:$}},O4=function($){if(!V4.default($))throw TypeError("Invalid UUID");let U;const G=new Uint8Array(16);return G[0]=(U=parseInt($.slice(0,8),16))>>>24,G[1]=U>>>16&255,G[2]=U>>>8&255,G[3]=U&255,G[4]=(U=parseInt($.slice(9,13),16))>>>8,G[5]=U&255,G[6]=(U=parseInt($.slice(14,18),16))>>>8,G[7]=U&255,G[8]=(U=parseInt($.slice(19,23),16))>>>8,G[9]=U&255,G[10]=(U=parseInt($.slice(24,36),16))/1099511627776&255,G[11]=U/4294967296&255,G[12]=U>>>24&255,G[13]=U>>>16&255,G[14]=U>>>8&255,G[15]=U&255,G};Object.defineProperty(xU,"__esModule",{value:!0});xU.default=void 0;var V4=H4(N0()),T4=O4;xU.default=T4});var o1=I((_U)=>{var N4=function($){return $&&$.__esModule?$:{default:$}},P4=function($){$=unescape(encodeURIComponent($));const U=[];for(let G=0;G<$.length;++G)U.push($.charCodeAt(G));return U},j4=function($,U,G){function w(W,X,L,Z){var Y;if(typeof W==="string")W=P4(W);if(typeof X==="string")X=C4.default(X);if(((Y=X)===null||Y===void 0?void 0:Y.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let Q=new Uint8Array(16+W.length);if(Q.set(X),Q.set(W,X.length),Q=G(Q),Q[6]=Q[6]&15|U,Q[8]=Q[8]&63|128,L){Z=Z||0;for(let z=0;z<16;++z)L[Z+z]=Q[z];return L}return q4.unsafeStringify(Q)}try{w.name=$}catch(W){}return w.DNS=cU,w.URL=yU,w};Object.defineProperty(_U,"__esModule",{value:!0});_U.URL=_U.DNS=void 0;_U.default=j4;var q4=P0(),C4=N4(r1()),cU="6ba7b810-9dad-11d1-80b4-00c04fd430c8";_U.DNS=cU;var yU="6ba7b811-9dad-11d1-80b4-00c04fd430c8";_U.URL=yU});var gU=I((dU)=>{var h4=function($){return $&&$.__esModule?$:{default:$}},D4=function($){if(Array.isArray($))$=Buffer.from($);else if(typeof $==="string")$=Buffer.from($,"utf8");return b4.default.createHash("md5").update($).digest()};Object.defineProperty(dU,"__esModule",{value:!0});dU.default=void 0;var b4=h4(import.meta.require("crypto")),x4=D4;dU.default=x4});var nU=I((lU)=>{var sU=function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(lU,"__esModule",{value:!0});lU.default=void 0;var v4=sU(o1()),c4=sU(gU()),y4=v4.default("v3",48,c4.default),_4=y4;lU.default=_4});var oU=I((iU)=>{var d4=function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(iU,"__esModule",{value:!0});iU.default=void 0;var u4=d4(import.meta.require("crypto")),p4={randomUUID:u4.default.randomUUID};iU.default=p4});var UG=I((eU)=>{var tU=function($){return $&&$.__esModule?$:{default:$}},l4=function($,U,G){if(aU.default.randomUUID&&!U&&!$)return aU.default.randomUUID();$=$||{};const w=$.random||($.rng||g4.default)();if(w[6]=w[6]&15|64,w[8]=w[8]&63|128,U){G=G||0;for(let W=0;W<16;++W)U[G+W]=w[W];return U}return s4.unsafeStringify(w)};Object.defineProperty(eU,"__esModule",{value:!0});eU.default=void 0;var aU=tU(oU()),g4=tU(l1()),s4=P0(),m4=l4;eU.default=m4});var WG=I((GG)=>{var i4=function($){return $&&$.__esModule?$:{default:$}},r4=function($){if(Array.isArray($))$=Buffer.from($);else if(typeof $==="string")$=Buffer.from($,"utf8");return n4.default.createHash("sha1").update($).digest()};Object.defineProperty(GG,"__esModule",{value:!0});GG.default=void 0;var n4=i4(import.meta.require("crypto")),o4=r4;GG.default=o4});var YG=I((LG)=>{var XG=function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(LG,"__esModule",{value:!0});LG.default=void 0;var a4=XG(o1()),t4=XG(WG()),e4=a4.default("v5",80,t4.default),$Z=e4;LG.default=$Z});var FG=I((QG)=>{Object.defineProperty(QG,"__esModule",{value:!0});QG.default=void 0;var UZ="00000000-0000-0000-0000-000000000000";QG.default=UZ});var fG=I((JG)=>{var wZ=function($){return $&&$.__esModule?$:{default:$}},WZ=function($){if(!GZ.default($))throw TypeError("Invalid UUID");return parseInt($.slice(14,15),16)};Object.defineProperty(JG,"__esModule",{value:!0});JG.default=void 0;var GZ=wZ(N0()),XZ=WZ;JG.default=XZ});var a1=I((_)=>{var n=function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(_,"__esModule",{value:!0});Object.defineProperty(_,"NIL",{enumerable:!0,get:function(){return zZ.default}});Object.defineProperty(_,"parse",{enumerable:!0,get:function(){return fZ.default}});Object.defineProperty(_,"stringify",{enumerable:!0,get:function(){return MZ.default}});Object.defineProperty(_,"v1",{enumerable:!0,get:function(){return LZ.default}});Object.defineProperty(_,"v3",{enumerable:!0,get:function(){return ZZ.default}});Object.defineProperty(_,"v4",{enumerable:!0,get:function(){return YZ.default}});Object.defineProperty(_,"v5",{enumerable:!0,get:function(){return QZ.default}});Object.defineProperty(_,"validate",{enumerable:!0,get:function(){return JZ.default}});Object.defineProperty(_,"version",{enumerable:!0,get:function(){return FZ.default}});var LZ=n(DU()),ZZ=n(nU()),YZ=n(UG()),QZ=n(YG()),zZ=n(FG()),FZ=n(fG()),JZ=n(N0()),MZ=n(P0()),fZ=n(r1())});var e0=I((rF,OG)=>{var HG=function($,U,G){return{applyToStack:(w)=>{w.add(BG($,G),AG),w.add(EG($,U),VG)}}},t0=Object.defineProperty,OZ=Object.getOwnPropertyDescriptor,TZ=Object.getOwnPropertyNames,qZ=Object.prototype.hasOwnProperty,t1=($,U)=>t0($,"name",{value:U,configurable:!0}),CZ=($,U)=>{for(var G in U)t0($,G,{get:U[G],enumerable:!0})},NZ=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of TZ(U))if(!qZ.call($,W)&&W!==G)t0($,W,{get:()=>U[W],enumerable:!(w=OZ(U,W))||w.enumerable})}return $},PZ=($)=>NZ(t0({},"__esModule",{value:!0}),$),KG={};CZ(KG,{deserializerMiddleware:()=>BG,deserializerMiddlewareOption:()=>AG,getSerdePlugin:()=>HG,serializerMiddleware:()=>EG,serializerMiddlewareOption:()=>VG});OG.exports=PZ(KG);var BG=t1(($,U)=>(G)=>async(w)=>{const{response:W}=await G(w);try{const X=await U(W,$);return{response:W,output:X}}catch(X){if(Object.defineProperty(X,"$response",{value:W}),!("$metadata"in X)){if(X.message+="\n Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.",typeof X.$responseBodyText!=="undefined"){if(X.$response)X.$response.body=X.$responseBodyText}}throw X}},"deserializerMiddleware"),EG=t1(($,U)=>(G,w)=>async(W)=>{var X;const L=((X=w.endpointV2)==null?void 0:X.url)&&$.urlParser?async()=>$.urlParser(w.endpointV2.url):$.endpoint;if(!L)throw new Error("No valid endpoint provider available.");const Z=await U(W.input,{...$,endpoint:L});return G({...W,request:Z})},"serializerMiddleware"),AG={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},VG={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};t1(HG,"getSerdePlugin")});var j0=I((oF,NG)=>{var{defineProperty:$1,getOwnPropertyDescriptor:jZ,getOwnPropertyNames:SZ}=Object,kZ=Object.prototype.hasOwnProperty,qG=($,U)=>$1($,"name",{value:U,configurable:!0}),bZ=($,U)=>{for(var G in U)$1($,G,{get:U[G],enumerable:!0})},hZ=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of SZ(U))if(!kZ.call($,W)&&W!==G)$1($,W,{get:()=>U[W],enumerable:!(w=jZ(U,W))||w.enumerable})}return $},DZ=($)=>hZ($1({},"__esModule",{value:!0}),$),CG={};bZ(CG,{getSmithyContext:()=>xZ,normalizeProvider:()=>vZ});NG.exports=DZ(CG);var TG=J0(),xZ=qG(($)=>$[TG.SMITHY_CONTEXT_KEY]||($[TG.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),vZ=qG(($)=>{if(typeof $==="function")return $;const U=Promise.resolve($);return()=>U},"normalizeProvider")});var M0=I((PG)=>{Object.defineProperty(PG,"__esModule",{value:!0});PG.getHomeDir=void 0;var cZ=import.meta.require("os"),yZ=import.meta.require("path"),e1={},_Z=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},uZ=()=>{const{HOME:$,USERPROFILE:U,HOMEPATH:G,HOMEDRIVE:w=`C:${yZ.sep}`}=process.env;if($)return $;if(U)return U;if(G)return`${w}${G}`;const W=_Z();if(!e1[W])e1[W]=cZ.homedir();return e1[W]};PG.getHomeDir=uZ});var $$=I((SG)=>{Object.defineProperty(SG,"__esModule",{value:!0});SG.getSSOTokenFilepath=void 0;var dZ=import.meta.require("crypto"),pZ=import.meta.require("path"),gZ=M0(),sZ=($)=>{const G=dZ.createHash("sha1").update($).digest("hex");return pZ.join(gZ.getHomeDir(),".aws","sso","cache",`${G}.json`)};SG.getSSOTokenFilepath=sZ});var DG=I((bG)=>{Object.defineProperty(bG,"__esModule",{value:!0});bG.getSSOTokenFromFile=void 0;var lZ=import.meta.require("fs"),mZ=$$(),{readFile:nZ}=lZ.promises,iZ=async($)=>{const U=mZ.getSSOTokenFilepath($),G=await nZ(U,"utf8");return JSON.parse(G)};bG.getSSOTokenFromFile=iZ});var G$=I((xG)=>{Object.defineProperty(xG,"__esModule",{value:!0});xG.slurpFile=void 0;var rZ=import.meta.require("fs"),{readFile:oZ}=rZ.promises,U$={},aZ=($,U)=>{if(!U$[$]||(U===null||U===void 0?void 0:U.ignoreCache))U$[$]=oZ($,"utf8");return U$[$]};xG.slurpFile=aZ});var L$=I((UJ,k0)=>{var{defineProperty:w1,getOwnPropertyDescriptor:tZ,getOwnPropertyNames:eZ}=Object,$6=Object.prototype.hasOwnProperty,v=($,U)=>w1($,"name",{value:U,configurable:!0}),U6=($,U)=>{for(var G in U)w1($,G,{get:U[G],enumerable:!0})},w$=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of eZ(U))if(!$6.call($,W)&&W!==G)w1($,W,{get:()=>U[W],enumerable:!(w=tZ(U,W))||w.enumerable})}return $},X$=($,U,G)=>(w$($,U,"default"),G&&w$(G,U,"default")),G6=($)=>w$(w1({},"__esModule",{value:!0}),$),S0={};U6(S0,{CONFIG_PREFIX_SEPARATOR:()=>U0,DEFAULT_PROFILE:()=>uG,ENV_PROFILE:()=>_G,getProfileName:()=>w6,loadSharedConfigFiles:()=>pG,loadSsoSessionData:()=>R6,parseKnownFiles:()=>B6});k0.exports=G6(S0);X$(S0,M0(),k0.exports);var _G="AWS_PROFILE",uG="default",w6=v(($)=>$.profile||process.env[_G]||uG,"getProfileName");X$(S0,$$(),k0.exports);X$(S0,DG(),k0.exports);var U1=J0(),W6=v(($)=>Object.entries($).filter(([U])=>{const G=U.indexOf(U0);if(G===-1)return!1;return Object.values(U1.IniSectionType).includes(U.substring(0,G))}).reduce((U,[G,w])=>{const W=G.indexOf(U0),X=G.substring(0,W)===U1.IniSectionType.PROFILE?G.substring(W+1):G;return U[X]=w,U},{...$.default&&{default:$.default}}),"getConfigData"),G1=import.meta.require("path"),X6=M0(),L6="AWS_CONFIG_FILE",dG=v(()=>process.env[L6]||G1.join(X6.getHomeDir(),".aws","config"),"getConfigFilepath"),Z6=M0(),Y6="AWS_SHARED_CREDENTIALS_FILE",Q6=v(()=>process.env[Y6]||G1.join(Z6.getHomeDir(),".aws","credentials"),"getCredentialsFilepath"),z6=M0(),F6=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,J6=["__proto__","profile __proto__"],W$=v(($)=>{const U={};let G,w;for(let W of $.split(/\r?\n/)){const X=W.split(/(^|\s)[;#]/)[0].trim();if(X[0]==="["&&X[X.length-1]==="]"){G=void 0,w=void 0;const Z=X.substring(1,X.length-1),Y=F6.exec(Z);if(Y){const[,Q,,z]=Y;if(Object.values(U1.IniSectionType).includes(Q))G=[Q,z].join(U0)}else G=Z;if(J6.includes(Z))throw new Error(`Found invalid profile name "${Z}"`)}else if(G){const Z=X.indexOf("=");if(![0,-1].includes(Z)){const[Y,Q]=[X.substring(0,Z).trim(),X.substring(Z+1).trim()];if(Q==="")w=Y;else{if(w&&W.trimStart()===W)w=void 0;U[G]=U[G]||{};const z=w?[w,Y].join(U0):Y;U[G][z]=Q}}}}return U},"parseIni"),cG=G$(),yG=v(()=>({}),"swallowError"),U0=".",pG=v(async($={})=>{const{filepath:U=Q6(),configFilepath:G=dG()}=$,w=z6.getHomeDir();let X=U;if(U.startsWith("~/"))X=G1.join(w,U.slice(2));let L=G;if(G.startsWith("~/"))L=G1.join(w,G.slice(2));const Z=await Promise.all([cG.slurpFile(L,{ignoreCache:$.ignoreCache}).then(W$).then(W6).catch(yG),cG.slurpFile(X,{ignoreCache:$.ignoreCache}).then(W$).catch(yG)]);return{configFile:Z[0],credentialsFile:Z[1]}},"loadSharedConfigFiles"),M6=v(($)=>Object.entries($).filter(([U])=>U.startsWith(U1.IniSectionType.SSO_SESSION+U0)).reduce((U,[G,w])=>({...U,[G.substring(G.indexOf(U0)+1)]:w}),{}),"getSsoSessionData"),f6=G$(),I6=v(()=>({}),"swallowError"),R6=v(async($={})=>f6.slurpFile($.configFilepath??dG()).then(W$).then(M6).catch(I6),"loadSsoSessionData"),K6=v((...$)=>{const U={};for(let G of $)for(let[w,W]of Object.entries(G))if(U[w]!==void 0)Object.assign(U[w],W);else U[w]=W;return U},"mergeConfigFiles"),B6=v(async($)=>{const U=await pG($);return K6(U.configFile,U.credentialsFile)},"parseKnownFiles")});var mG=I((GJ,lG)=>{var Y$=function($){try{const U=new Set(Array.from($.match(/([A-Z_]){3,}/g)??[]));return U.delete("CONFIG"),U.delete("CONFIG_PREFIX_SEPARATOR"),U.delete("ENV"),[...U].join(", ")}catch(U){return $}},W1=Object.defineProperty,E6=Object.getOwnPropertyDescriptor,A6=Object.getOwnPropertyNames,V6=Object.prototype.hasOwnProperty,f0=($,U)=>W1($,"name",{value:U,configurable:!0}),H6=($,U)=>{for(var G in U)W1($,G,{get:U[G],enumerable:!0})},O6=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of A6(U))if(!V6.call($,W)&&W!==G)W1($,W,{get:()=>U[W],enumerable:!(w=E6(U,W))||w.enumerable})}return $},T6=($)=>O6(W1({},"__esModule",{value:!0}),$),sG={};H6(sG,{loadConfig:()=>j6});lG.exports=T6(sG);var b0=Z$();f0(Y$,"getSelectorName");var q6=f0(($,U)=>async()=>{try{const G=$(process.env);if(G===void 0)throw new Error;return G}catch(G){throw new b0.CredentialsProviderError(G.message||`Not found in ENV: ${Y$($.toString())}`,{logger:U})}},"fromEnv"),gG=L$(),C6=f0(($,{preferredFile:U="config",...G}={})=>async()=>{const w=gG.getProfileName(G),{configFile:W,credentialsFile:X}=await gG.loadSharedConfigFiles(G),L=X[w]||{},Z=W[w]||{},Y=U==="config"?{...L,...Z}:{...Z,...L};try{const z=$(Y,U==="config"?W:X);if(z===void 0)throw new Error;return z}catch(Q){throw new b0.CredentialsProviderError(Q.message||`Not found in config files w/ profile [${w}]: ${Y$($.toString())}`,{logger:G.logger})}},"fromSharedConfigFiles"),N6=f0(($)=>typeof $==="function","isFunction"),P6=f0(($)=>N6($)?async()=>await $():b0.fromStatic($),"fromStatic"),j6=f0(({environmentVariableSelector:$,configFileSelector:U,default:G},w={})=>b0.memoize(b0.chain(q6($),C6(U,w),P6(G))),"loadConfig")});var tG=I((oG)=>{Object.defineProperty(oG,"__esModule",{value:!0});oG.getEndpointUrlConfig=void 0;var nG=L$(),iG="AWS_ENDPOINT_URL",rG="endpoint_url",S6=($)=>({environmentVariableSelector:(U)=>{const G=$.split(" ").map((X)=>X.toUpperCase()),w=U[[iG,...G].join("_")];if(w)return w;const W=U[iG];if(W)return W;return},configFileSelector:(U,G)=>{if(G&&U.services){const W=G[["services",U.services].join(nG.CONFIG_PREFIX_SEPARATOR)];if(W){const X=$.split(" ").map((Z)=>Z.toLowerCase()),L=W[[X.join("_"),rG].join(nG.CONFIG_PREFIX_SEPARATOR)];if(L)return L}}const w=U[rG];if(w)return w;return},default:void 0});oG.getEndpointUrlConfig=S6});var Q$=I((eG)=>{Object.defineProperty(eG,"__esModule",{value:!0});eG.getEndpointFromConfig=void 0;var k6=mG(),b6=tG(),h6=async($)=>k6.loadConfig(b6.getEndpointUrlConfig($!==null&&$!==void 0?$:""))();eG.getEndpointFromConfig=h6});var Qw=I((XJ,Yw)=>{var{defineProperty:L1,getOwnPropertyDescriptor:D6,getOwnPropertyNames:x6}=Object,v6=Object.prototype.hasOwnProperty,u=($,U)=>L1($,"name",{value:U,configurable:!0}),c6=($,U)=>{for(var G in U)L1($,G,{get:U[G],enumerable:!0})},y6=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of x6(U))if(!v6.call($,W)&&W!==G)L1($,W,{get:()=>U[W],enumerable:!(w=D6(U,W))||w.enumerable})}return $},_6=($)=>y6(L1({},"__esModule",{value:!0}),$),ww={};c6(ww,{endpointMiddleware:()=>Lw,endpointMiddlewareOptions:()=>Zw,getEndpointFromInstructions:()=>Ww,getEndpointPlugin:()=>r6,resolveEndpointConfig:()=>a6,resolveParams:()=>Xw,toEndpointV1:()=>z$});Yw.exports=_6(ww);var u6=u(async($)=>{const U=($==null?void 0:$.Bucket)||"";if(typeof $.Bucket==="string")$.Bucket=U.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(l6(U)){if($.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!s6(U)||U.indexOf(".")!==-1&&!String($.Endpoint).startsWith("http:")||U.toLowerCase()!==U||U.length<3)$.ForcePathStyle=!0;if($.DisableMultiRegionAccessPoints)$.disableMultiRegionAccessPoints=!0,$.DisableMRAP=!0;return $},"resolveParamsForS3"),d6=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,p6=/(\d+\.){3}\d+/,g6=/\.\./,s6=u(($)=>d6.test($)&&!p6.test($)&&!g6.test($),"isDnsCompatibleBucketName"),l6=u(($)=>{const[U,G,w,,,W]=$.split(":"),X=U==="arn"&&$.split(":").length>=6,L=Boolean(X&&G&&w&&W);if(X&&!L)throw new Error(`Invalid ARN: ${$} was an invalid ARN.`);return L},"isArnBucketName"),m6=u(($,U,G)=>{const w=u(async()=>{const W=G[$]??G[U];if(typeof W==="function")return W();return W},"configProvider");if($==="credentialScope"||U==="CredentialScope")return async()=>{const W=typeof G.credentials==="function"?await G.credentials():G.credentials;return(W==null?void 0:W.credentialScope)??(W==null?void 0:W.CredentialScope)};if($==="accountId"||U==="AccountId")return async()=>{const W=typeof G.credentials==="function"?await G.credentials():G.credentials;return(W==null?void 0:W.accountId)??(W==null?void 0:W.AccountId)};if($==="endpoint"||U==="endpoint")return async()=>{const W=await w();if(W&&typeof W==="object"){if("url"in W)return W.url.href;if("hostname"in W){const{protocol:X,hostname:L,port:Z,path:Y}=W;return`${X}//${L}${Z?":"+Z:""}${Y}`}}return W};return w},"createConfigValueProvider"),n6=Q$(),Uw=Gw(),z$=u(($)=>{if(typeof $==="object"){if("url"in $)return Uw.parseUrl($.url);return $}return Uw.parseUrl($)},"toEndpointV1"),Ww=u(async($,U,G,w)=>{if(!G.endpoint){let L;if(G.serviceConfiguredEndpoint)L=await G.serviceConfiguredEndpoint();else L=await n6.getEndpointFromConfig(G.serviceId);if(L)G.endpoint=()=>Promise.resolve(z$(L))}const W=await Xw($,U,G);if(typeof G.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return G.endpointProvider(W,w)},"getEndpointFromInstructions"),Xw=u(async($,U,G)=>{var w;const W={},X=((w=U==null?void 0:U.getEndpointParameterInstructions)==null?void 0:w.call(U))||{};for(let[L,Z]of Object.entries(X))switch(Z.type){case"staticContextParams":W[L]=Z.value;break;case"contextParams":W[L]=$[Z.name];break;case"clientContextParams":case"builtInParams":W[L]=await m6(Z.name,L,G)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(Z))}if(Object.keys(X).length===0)Object.assign(W,G);if(String(G.serviceId).toLowerCase()==="s3")await u6(W);return W},"resolveParams"),X1=j0(),Lw=u(({config:$,instructions:U})=>{return(G,w)=>async(W)=>{var X,L,Z;const Y=await Ww(W.input,{getEndpointParameterInstructions(){return U}},{...$},w);w.endpointV2=Y,w.authSchemes=(X=Y.properties)==null?void 0:X.authSchemes;const Q=(L=w.authSchemes)==null?void 0:L[0];if(Q){w.signing_region=Q.signingRegion,w.signing_service=Q.signingName;const z=X1.getSmithyContext(w),F=(Z=z==null?void 0:z.selectedHttpAuthScheme)==null?void 0:Z.httpAuthOption;if(F)F.signingProperties=Object.assign(F.signingProperties||{},{signing_region:Q.signingRegion,signingRegion:Q.signingRegion,signing_service:Q.signingName,signingName:Q.signingName,signingRegionSet:Q.signingRegionSet},Q.properties)}return G({...W})}},"endpointMiddleware"),i6=e0(),Zw={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:i6.serializerMiddlewareOption.name},r6=u(($,U)=>({applyToStack:(G)=>{G.addRelativeTo(Lw({config:$,instructions:U}),Zw)}}),"getEndpointPlugin"),o6=Q$(),a6=u(($)=>{const U=$.tls??!0,{endpoint:G}=$,w=G!=null?async()=>z$(await X1.normalizeProvider(G)()):void 0,X={...$,endpoint:w,tls:U,isCustomEndpoint:!!G,useDualstackEndpoint:X1.normalizeProvider($.useDualstackEndpoint??!1),useFipsEndpoint:X1.normalizeProvider($.useFipsEndpoint??!1)};let L=void 0;return X.serviceConfiguredEndpoint=async()=>{if($.serviceId&&!L)L=o6.getEndpointFromConfig($.serviceId);return L},X},"resolveEndpointConfig")});var G0=I((LJ,Mw)=>{var{defineProperty:Z1,getOwnPropertyDescriptor:t6,getOwnPropertyNames:e6}=Object,$5=Object.prototype.hasOwnProperty,I0=($,U)=>Z1($,"name",{value:U,configurable:!0}),U5=($,U)=>{for(var G in U)Z1($,G,{get:U[G],enumerable:!0})},G5=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of e6(U))if(!$5.call($,W)&&W!==G)Z1($,W,{get:()=>U[W],enumerable:!(w=t6(U,W))||w.enumerable})}return $},w5=($)=>G5(Z1({},"__esModule",{value:!0}),$),zw={};U5(zw,{isClockSkewCorrectedError:()=>Fw,isClockSkewError:()=>z5,isRetryableByTrait:()=>Q5,isServerError:()=>J5,isThrottlingError:()=>F5,isTransientError:()=>Jw});Mw.exports=w5(zw);var W5=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],X5=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],L5=["TimeoutError","RequestTimeout","RequestTimeoutException"],Z5=[500,502,503,504],Y5=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Q5=I0(($)=>$.$retryable!==void 0,"isRetryableByTrait"),z5=I0(($)=>W5.includes($.name),"isClockSkewError"),Fw=I0(($)=>{var U;return(U=$.$metadata)==null?void 0:U.clockSkewCorrected},"isClockSkewCorrectedError"),F5=I0(($)=>{var U,G;return((U=$.$metadata)==null?void 0:U.httpStatusCode)===429||X5.includes($.name)||((G=$.$retryable)==null?void 0:G.throttling)==!0},"isThrottlingError"),Jw=I0(($)=>{var U;return Fw($)||L5.includes($.name)||Y5.includes(($==null?void 0:$.code)||"")||Z5.includes(((U=$.$metadata)==null?void 0:U.httpStatusCode)||0)},"isTransientError"),J5=I0(($)=>{var U;if(((U=$.$metadata)==null?void 0:U.httpStatusCode)!==void 0){const G=$.$metadata.httpStatusCode;if(500<=G&&G<=599&&!Jw($))return!0;return!1}return!1},"isServerError")});var Nw=I((ZJ,Cw)=>{var{defineProperty:Y1,getOwnPropertyDescriptor:M5,getOwnPropertyNames:f5}=Object,I5=Object.prototype.hasOwnProperty,d=($,U)=>Y1($,"name",{value:U,configurable:!0}),R5=($,U)=>{for(var G in U)Y1($,G,{get:U[G],enumerable:!0})},K5=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of f5(U))if(!I5.call($,W)&&W!==G)Y1($,W,{get:()=>U[W],enumerable:!(w=M5(U,W))||w.enumerable})}return $},B5=($)=>K5(Y1({},"__esModule",{value:!0}),$),Iw={};R5(Iw,{AdaptiveRetryStrategy:()=>T5,ConfiguredRetryStrategy:()=>q5,DEFAULT_MAX_ATTEMPTS:()=>F$,DEFAULT_RETRY_DELAY_BASE:()=>h0,DEFAULT_RETRY_MODE:()=>E5,DefaultRateLimiter:()=>Bw,INITIAL_RETRY_TOKENS:()=>J$,INVOCATION_ID_HEADER:()=>V5,MAXIMUM_RETRY_DELAY:()=>M$,NO_RETRY_INCREMENT:()=>Hw,REQUEST_HEADER:()=>H5,RETRY_COST:()=>Aw,RETRY_MODES:()=>Rw,StandardRetryStrategy:()=>f$,THROTTLING_RETRY_DELAY_BASE:()=>Ew,TIMEOUT_RETRY_COST:()=>Vw});Cw.exports=B5(Iw);var Rw=(($)=>{return $.STANDARD="standard",$.ADAPTIVE="adaptive",$})(Rw||{}),F$=3,E5="standard",A5=G0(),Kw=class ${constructor(U){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=(U==null?void 0:U.beta)??0.7,this.minCapacity=(U==null?void 0:U.minCapacity)??1,this.minFillRate=(U==null?void 0:U.minFillRate)??0.5,this.scaleConstant=(U==null?void 0:U.scaleConstant)??0.4,this.smooth=(U==null?void 0:U.smooth)??0.8;const G=this.getCurrentTimeInSeconds();this.lastThrottleTime=G,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(U){if(!this.enabled)return;if(this.refillTokenBucket(),U>this.currentCapacity){const G=(U-this.currentCapacity)/this.fillRate*1000;await new Promise((w)=>setTimeout(w,G))}this.currentCapacity=this.currentCapacity-U}refillTokenBucket(){const U=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=U;return}const G=(U-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+G),this.lastTimestamp=U}updateClientSendingRate(U){let G;if(this.updateMeasuredRate(),A5.isThrottlingError(U)){const W=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=W,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),G=this.cubicThrottle(W),this.enableTokenBucket()}else this.calculateTimeWindow(),G=this.cubicSuccess(this.getCurrentTimeInSeconds());const w=Math.min(G,2*this.measuredTxRate);this.updateTokenBucketRate(w)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(U){return this.getPrecise(U*this.beta)}cubicSuccess(U){return this.getPrecise(this.scaleConstant*Math.pow(U-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(U){this.refillTokenBucket(),this.fillRate=Math.max(U,this.minFillRate),this.maxCapacity=Math.max(U,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const U=this.getCurrentTimeInSeconds(),G=Math.floor(U*2)/2;if(this.requestCount++,G>this.lastTxRateBucket){const w=this.requestCount/(G-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(w*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=G}}getPrecise(U){return parseFloat(U.toFixed(8))}};d(Kw,"DefaultRateLimiter");var Bw=Kw,h0=100,M$=20000,Ew=500,J$=500,Aw=5,Vw=10,Hw=1,V5="amz-sdk-invocation-id",H5="amz-sdk-request",O5=d(()=>{let $=h0;return{computeNextBackoffDelay:d((w)=>{return Math.floor(Math.min(M$,Math.random()*2**w*$))},"computeNextBackoffDelay"),setDelayBase:d((w)=>{$=w},"setDelayBase")}},"getDefaultRetryBackoffStrategy"),fw=d(({retryDelay:$,retryCount:U,retryCost:G})=>{return{getRetryCount:d(()=>U,"getRetryCount"),getRetryDelay:d(()=>Math.min(M$,$),"getRetryDelay"),getRetryCost:d(()=>G,"getRetryCost")}},"createDefaultRetryToken"),Ow=class ${constructor(U){this.maxAttempts=U,this.mode="standard",this.capacity=J$,this.retryBackoffStrategy=O5(),this.maxAttemptsProvider=typeof U==="function"?U:async()=>U}async acquireInitialRetryToken(U){return fw({retryDelay:h0,retryCount:0})}async refreshRetryTokenForRetry(U,G){const w=await this.getMaxAttempts();if(this.shouldRetry(U,G,w)){const W=G.errorType;this.retryBackoffStrategy.setDelayBase(W==="THROTTLING"?Ew:h0);const X=this.retryBackoffStrategy.computeNextBackoffDelay(U.getRetryCount()),L=G.retryAfterHint?Math.max(G.retryAfterHint.getTime()-Date.now()||0,X):X,Z=this.getCapacityCost(W);return this.capacity-=Z,fw({retryDelay:L,retryCount:U.getRetryCount()+1,retryCost:Z})}throw new Error("No retry token available")}recordSuccess(U){this.capacity=Math.max(J$,this.capacity+(U.getRetryCost()??Hw))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(U){return console.warn(`Max attempts provider could not resolve. Using default of ${F$}`),F$}}shouldRetry(U,G,w){return U.getRetryCount()+1<w&&this.capacity>=this.getCapacityCost(G.errorType)&&this.isRetryableError(G.errorType)}getCapacityCost(U){return U==="TRANSIENT"?Vw:Aw}isRetryableError(U){return U==="THROTTLING"||U==="TRANSIENT"}};d(Ow,"StandardRetryStrategy");var f$=Ow,Tw=class ${constructor(U,G){this.maxAttemptsProvider=U,this.mode="adaptive";const{rateLimiter:w}=G??{};this.rateLimiter=w??new Bw,this.standardRetryStrategy=new f$(U)}async acquireInitialRetryToken(U){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(U)}async refreshRetryTokenForRetry(U,G){return this.rateLimiter.updateClientSendingRate(G),this.standardRetryStrategy.refreshRetryTokenForRetry(U,G)}recordSuccess(U){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(U)}};d(Tw,"AdaptiveRetryStrategy");var T5=Tw,qw=class $ extends f${constructor(U,G=h0){super(typeof U==="function"?U:async()=>U);if(typeof G==="number")this.computeNextBackoffDelay=()=>G;else this.computeNextBackoffDelay=G}async refreshRetryTokenForRetry(U,G){const w=await super.refreshRetryTokenForRetry(U,G);return w.getRetryDelay=()=>this.computeNextBackoffDelay(w.getRetryCount()),w}};d(qw,"ConfiguredRetryStrategy");var q5=qw});var Sw=I((Pw)=>{Object.defineProperty(Pw,"__esModule",{value:!0});Pw.getAwsChunkedEncodingStream=void 0;var C5=import.meta.require("stream"),N5=($,U)=>{const{base64Encoder:G,bodyLengthChecker:w,checksumAlgorithmFn:W,checksumLocationName:X,streamHasher:L}=U,Z=G!==void 0&&W!==void 0&&X!==void 0&&L!==void 0,Y=Z?L(W,$):void 0,Q=new C5.Readable({read:()=>{}});return $.on("data",(z)=>{const F=w(z)||0;Q.push(`${F.toString(16)}\r\n`),Q.push(z),Q.push("\r\n")}),$.on("end",async()=>{if(Q.push("0\r\n"),Z){const z=G(await Y);Q.push(`${X}:${z}\r\n`),Q.push("\r\n")}Q.push(null)}),Q};Pw.getAwsChunkedEncodingStream=N5});var rw=I((QJ,iw)=>{async function K$($,U,G=hw){const w=U.headers??{},W=w.Expect||w.expect;let X=-1,L=!1;if(W==="100-continue")await Promise.race([new Promise((Z)=>{X=Number(setTimeout(Z,Math.max(hw,G)))}),new Promise((Z)=>{$.on("continue",()=>{clearTimeout(X),Z()}),$.on("error",()=>{L=!0,clearTimeout(X),Z()})})]);if(!L)dw($,U.body)}var dw=function($,U){if(U instanceof uw.Readable){U.pipe($);return}if(U){if(Buffer.isBuffer(U)||typeof U==="string"){$.end(U);return}const G=U;if(typeof G==="object"&&G.buffer&&typeof G.byteOffset==="number"&&typeof G.byteLength==="number"){$.end(Buffer.from(G.buffer,G.byteOffset,G.byteLength));return}$.end(Buffer.from(U));return}$.end()};async function nw($){const U=[],G=$.getReader();let w=!1,W=0;while(!w){const{done:Z,value:Y}=await G.read();if(Y)U.push(Y),W+=Y.length;w=Z}const X=new Uint8Array(W);let L=0;for(let Z of U)X.set(Z,L),L+=Z.length;return X}var{create:j5,defineProperty:D0,getOwnPropertyDescriptor:S5,getOwnPropertyNames:k5,getPrototypeOf:b5}=Object,h5=Object.prototype.hasOwnProperty,E=($,U)=>D0($,"name",{value:U,configurable:!0}),D5=($,U)=>{for(var G in U)D0($,G,{get:U[G],enumerable:!0})},xw=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of k5(U))if(!h5.call($,W)&&W!==G)D0($,W,{get:()=>U[W],enumerable:!(w=S5(U,W))||w.enumerable})}return $},x5=($,U,G)=>(G=$!=null?j5(b5($)):{},xw(U||!$||!$.__esModule?D0(G,"default",{value:$,enumerable:!0}):G,$)),v5=($)=>xw(D0({},"__esModule",{value:!0}),$),vw={};D5(vw,{DEFAULT_REQUEST_TIMEOUT:()=>p5,NodeHttp2Handler:()=>n5,NodeHttpHandler:()=>g5,streamCollector:()=>r5});iw.exports=v5(vw);var cw=w0(),yw=P5(),I$=import.meta.require("http"),R$=import.meta.require("https"),c5=["ECONNRESET","EPIPE","ETIMEDOUT"],_w=E(($)=>{const U={};for(let G of Object.keys($)){const w=$[G];U[G]=Array.isArray(w)?w.join(","):w}return U},"getTransformedHeaders"),kw=1000,y5=E(($,U,G=0)=>{if(!G)return-1;const w=E((W)=>{const X=setTimeout(()=>{$.destroy(),U(Object.assign(new Error(`Socket timed out without establishing a connection within ${G} ms`),{name:"TimeoutError"}))},G-W),L=E((Z)=>{if(Z==null?void 0:Z.connecting)Z.on("connect",()=>{clearTimeout(X)});else clearTimeout(X)},"doWithSocket");if($.socket)L($.socket);else $.on("socket",L)},"registerTimeout");if(G<2000)return w(0),0;return setTimeout(w.bind(null,kw),kw)},"setConnectionTimeout"),_5=3000,u5=E(($,{keepAlive:U,keepAliveMsecs:G},w=_5)=>{if(U!==!0)return-1;const W=E(()=>{if($.socket)$.socket.setKeepAlive(U,G||0);else $.on("socket",(X)=>{X.setKeepAlive(U,G||0)})},"registerListener");if(w===0)return W(),0;return setTimeout(W,w)},"setSocketKeepAlive"),bw=3000,d5=E(($,U,G=0)=>{const w=E((W)=>{$.setTimeout(G-W,()=>{$.destroy(),U(Object.assign(new Error(`Connection timed out after ${G} ms`),{name:"TimeoutError"}))})},"registerTimeout");if(0<G&&G<6000)return w(0),0;return setTimeout(w.bind(null,G===0?0:bw),bw)},"setSocketTimeout"),uw=import.meta.require("stream"),hw=1000;E(K$,"writeRequestBody");E(dw,"writeBody");var p5=0,pw=class ${constructor(U){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((G,w)=>{if(typeof U==="function")U().then((W)=>{G(this.resolveDefaultConfig(W))}).catch(w);else G(this.resolveDefaultConfig(U))})}static create(U){if(typeof(U==null?void 0:U.handle)==="function")return U;return new $(U)}static checkSocketUsage(U,G,w=console){var W,X,L;const{sockets:Z,requests:Y,maxSockets:Q}=U;if(typeof Q!=="number"||Q===Infinity)return G;const z=15000;if(Date.now()-z<G)return G;if(Z&&Y)for(let F in Z){const J=((W=Z[F])==null?void 0:W.length)??0,f=((X=Y[F])==null?void 0:X.length)??0;if(J>=Q&&f>=2*Q)return(L=w==null?void 0:w.warn)==null||L.call(w,`@smithy/node-http-handler:WARN - socket usage at capacity=${J} and ${f} 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 G}resolveDefaultConfig(U){const{requestTimeout:G,connectionTimeout:w,socketTimeout:W,httpAgent:X,httpsAgent:L}=U||{};return{connectionTimeout:w,requestTimeout:G??W,httpAgent:(()=>{if(X instanceof I$.Agent||typeof(X==null?void 0:X.destroy)==="function")return X;return new I$.Agent({keepAlive:!0,maxSockets:50,...X})})(),httpsAgent:(()=>{if(L instanceof R$.Agent||typeof(L==null?void 0:L.destroy)==="function")return L;return new R$.Agent({keepAlive:!0,maxSockets:50,...L})})(),logger:console}}destroy(){var U,G,w,W;(G=(U=this.config)==null?void 0:U.httpAgent)==null||G.destroy(),(W=(w=this.config)==null?void 0:w.httpsAgent)==null||W.destroy()}async handle(U,{abortSignal:G}={}){if(!this.config)this.config=await this.configProvider;return new Promise((w,W)=>{let X=void 0;const L=[],Z=E(async(B)=>{await X,L.forEach(clearTimeout),w(B)},"resolve"),Y=E(async(B)=>{await X,L.forEach(clearTimeout),W(B)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(G==null?void 0:G.aborted){const B=new Error("Request aborted");B.name="AbortError",Y(B);return}const Q=U.protocol==="https:",z=Q?this.config.httpsAgent:this.config.httpAgent;L.push(setTimeout(()=>{this.socketWarningTimestamp=$.checkSocketUsage(z,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));const F=yw.buildQueryString(U.query||{});let J=void 0;if(U.username!=null||U.password!=null){const B=U.username??"",P=U.password??"";J=`${B}:${P}`}let f=U.path;if(F)f+=`?${F}`;if(U.fragment)f+=`#${U.fragment}`;let R=U.hostname??"";if(R[0]==="["&&R.endsWith("]"))R=U.hostname.slice(1,-1);else R=U.hostname;const K={headers:U.headers,host:R,method:U.method,path:f,port:U.port,agent:z,auth:J},k=(Q?R$.request:I$.request)(K,(B)=>{const P=new cw.HttpResponse({statusCode:B.statusCode||-1,reason:B.statusMessage,headers:_w(B.headers),body:B});Z({response:P})});if(k.on("error",(B)=>{if(c5.includes(B.code))Y(Object.assign(B,{name:"TimeoutError"}));else Y(B)}),G){const B=E(()=>{k.destroy();const P=new Error("Request aborted");P.name="AbortError",Y(P)},"onAbort");if(typeof G.addEventListener==="function"){const P=G;P.addEventListener("abort",B,{once:!0}),k.once("close",()=>P.removeEventListener("abort",B))}else G.onabort=B}L.push(y5(k,Y,this.config.connectionTimeout)),L.push(d5(k,Y,this.config.requestTimeout));const m=K.agent;if(typeof m==="object"&&"keepAlive"in m)L.push(u5(k,{keepAlive:m.keepAlive,keepAliveMsecs:m.keepAliveMsecs}));X=K$(k,U,this.config.requestTimeout).catch((B)=>{return L.forEach(clearTimeout),W(B)})})}updateHttpClientConfig(U,G){this.config=void 0,this.configProvider=this.configProvider.then((w)=>{return{...w,[U]:G}})}httpHandlerConfigs(){return this.config??{}}};E(pw,"NodeHttpHandler");var g5=pw,Dw=import.meta.require("http2"),s5=x5(import.meta.require("http2")),gw=class ${constructor(U){this.sessions=[],this.sessions=U??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(U){this.sessions.push(U)}contains(U){return this.sessions.includes(U)}remove(U){this.sessions=this.sessions.filter((G)=>G!==U)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(U){for(let G of this.sessions)if(G===U){if(!G.destroyed)G.destroy()}}};E(gw,"NodeHttp2ConnectionPool");var l5=gw,sw=class ${constructor(U){if(this.sessionCache=new Map,this.config=U,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(U,G){const w=this.getUrlString(U),W=this.sessionCache.get(w);if(W){const Y=W.poll();if(Y&&!this.config.disableConcurrency)return Y}const X=s5.default.connect(w);if(this.config.maxConcurrency)X.settings({maxConcurrentStreams:this.config.maxConcurrency},(Y)=>{if(Y)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+U.destination.toString())});X.unref();const L=E(()=>{X.destroy(),this.deleteSession(w,X)},"destroySessionCb");if(X.on("goaway",L),X.on("error",L),X.on("frameError",L),X.on("close",()=>this.deleteSession(w,X)),G.requestTimeout)X.setTimeout(G.requestTimeout,L);const Z=this.sessionCache.get(w)||new l5;return Z.offerLast(X),this.sessionCache.set(w,Z),X}deleteSession(U,G){const w=this.sessionCache.get(U);if(!w)return;if(!w.contains(G))return;w.remove(G),this.sessionCache.set(U,w)}release(U,G){var w;const W=this.getUrlString(U);(w=this.sessionCache.get(W))==null||w.offerLast(G)}destroy(){for(let[U,G]of this.sessionCache){for(let w of G){if(!w.destroyed)w.destroy();G.remove(w)}this.sessionCache.delete(U)}}setMaxConcurrentStreams(U){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=U}setDisableConcurrentStreams(U){this.config.disableConcurrency=U}getUrlString(U){return U.destination.toString()}};E(sw,"NodeHttp2ConnectionManager");var m5=sw,lw=class ${constructor(U){this.metadata={handlerProtocol:"h2"},this.connectionManager=new m5({}),this.configProvider=new Promise((G,w)=>{if(typeof U==="function")U().then((W)=>{G(W||{})}).catch(w);else G(U||{})})}static create(U){if(typeof(U==null?void 0:U.handle)==="function")return U;return new $(U)}destroy(){this.connectionManager.destroy()}async handle(U,{abortSignal:G}={}){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:w,disableConcurrentStreams:W}=this.config;return new Promise((X,L)=>{var Z;let Y=!1,Q=void 0;const z=E(async(T)=>{await Q,X(T)},"resolve"),F=E(async(T)=>{await Q,L(T)},"reject");if(G==null?void 0:G.aborted){Y=!0;const T=new Error("Request aborted");T.name="AbortError",F(T);return}const{hostname:J,method:f,port:R,protocol:K,query:H}=U;let k="";if(U.username!=null||U.password!=null){const T=U.username??"",y=U.password??"";k=`${T}:${y}@`}const m=`${K}//${k}${J}${R?`:${R}`:""}`,B={destination:new URL(m)},P=this.connectionManager.lease(B,{requestTimeout:(Z=this.config)==null?void 0:Z.sessionTimeout,disableConcurrentStreams:W||!1}),F0=E((T)=>{if(W)this.destroySession(P);Y=!0,F(T)},"rejectWithDestroy"),VU=yw.buildQueryString(H||{});let s1=U.path;if(VU)s1+=`?${VU}`;if(U.fragment)s1+=`#${U.fragment}`;const D=P.request({...U.headers,[Dw.constants.HTTP2_HEADER_PATH]:s1,[Dw.constants.HTTP2_HEADER_METHOD]:f});if(P.ref(),D.on("response",(T)=>{const y=new cw.HttpResponse({statusCode:T[":status"]||-1,headers:_w(T),body:D});if(Y=!0,z({response:y}),W)P.close(),this.connectionManager.deleteSession(m,P)}),w)D.setTimeout(w,()=>{D.close();const T=new Error(`Stream timed out because of no activity for ${w} ms`);T.name="TimeoutError",F0(T)});if(G){const T=E(()=>{D.close();const y=new Error("Request aborted");y.name="AbortError",F0(y)},"onAbort");if(typeof G.addEventListener==="function"){const y=G;y.addEventListener("abort",T,{once:!0}),D.once("close",()=>y.removeEventListener("abort",T))}else G.onabort=T}D.on("frameError",(T,y,U4)=>{F0(new Error(`Frame type id ${T} in stream id ${U4} has failed with code ${y}.`))}),D.on("error",F0),D.on("aborted",()=>{F0(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${D.rstCode}.`))}),D.on("close",()=>{if(P.unref(),W)P.destroy();if(!Y)F0(new Error("Unexpected error: http2 request did not get a response"))}),Q=K$(D,U,w)})}updateHttpClientConfig(U,G){this.config=void 0,this.configProvider=this.configProvider.then((w)=>{return{...w,[U]:G}})}httpHandlerConfigs(){return this.config??{}}destroySession(U){if(!U.destroyed)U.destroy()}};E(lw,"NodeHttp2Handler");var n5=lw,mw=class $ extends uw.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(U,G,w){this.bufferedBytes.push(U),w()}};E(mw,"Collector");var i5=mw,r5=E(($)=>{if(o5($))return nw($);return new Promise((U,G)=>{const w=new i5;$.pipe(w),$.on("error",(W)=>{w.end(),G(W)}),w.on("error",G),w.on("finish",function(){const W=new Uint8Array(Buffer.concat(this.bufferedBytes));U(W)})})},"streamCollector"),o5=E(($)=>typeof ReadableStream==="function"&&$ instanceof ReadableStream,"isReadableStreamInstance");E(nw,"collectReadableStream")});var x0=I((ow)=>{Object.defineProperty(ow,"__esModule",{value:!0});ow.isReadableStream=void 0;var a5=($)=>{var U;return typeof ReadableStream==="function"&&(((U=$===null||$===void 0?void 0:$.constructor)===null||U===void 0?void 0:U.name)===ReadableStream.name||$ instanceof ReadableStream)};ow.isReadableStream=a5});var XW=I((wW)=>{Object.defineProperty(wW,"__esModule",{value:!0});wW.sdkStreamMixin=void 0;var e5=t5(),$Y=UW(),UY=GW(),GY=R0(),tw=x0(),ew="The stream has already been transformed.",wY=($)=>{var U,G;if(!$W($)&&!tw.isReadableStream($)){const L=((G=(U=$===null||$===void 0?void 0:$.__proto__)===null||U===void 0?void 0:U.constructor)===null||G===void 0?void 0:G.name)||$;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${L}`)}let w=!1;const W=async()=>{if(w)throw new Error(ew);return w=!0,await e5.streamCollector($)},X=(L)=>{if(typeof L.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 L.stream()};return Object.assign($,{transformToByteArray:W,transformToString:async(L)=>{const Z=await W();if(L==="base64")return $Y.toBase64(Z);else if(L==="hex")return UY.toHex(Z);else if(L===void 0||L==="utf8"||L==="utf-8")return GY.toUtf8(Z);else if(typeof TextDecoder==="function")return new TextDecoder(L).decode(Z);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(w)throw new Error(ew);if(w=!0,$W($))return X($);else if(tw.isReadableStream($))return $;else throw new Error(`Cannot transform payload to web stream, got ${$}`)}})};wW.sdkStreamMixin=wY;var $W=($)=>typeof Blob==="function"&&$ instanceof Blob});var QW=I((ZW)=>{Object.defineProperty(ZW,"__esModule",{value:!0});ZW.sdkStreamMixin=void 0;var XY=rw(),LY=WY(),B$=import.meta.require("stream"),ZY=import.meta.require("util"),YY=XW(),LW="The stream has already been transformed.",QY=($)=>{var U,G;if(!($ instanceof B$.Readable))try{return YY.sdkStreamMixin($)}catch(X){const L=((G=(U=$===null||$===void 0?void 0:$.__proto__)===null||U===void 0?void 0:U.constructor)===null||G===void 0?void 0:G.name)||$;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${L}`)}let w=!1;const W=async()=>{if(w)throw new Error(LW);return w=!0,await XY.streamCollector($)};return Object.assign($,{transformToByteArray:W,transformToString:async(X)=>{const L=await W();if(X===void 0||Buffer.isEncoding(X))return LY.fromArrayBuffer(L.buffer,L.byteOffset,L.byteLength).toString(X);else return new ZY.TextDecoder(X).decode(L)},transformToWebStream:()=>{if(w)throw new Error(LW);if($.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof B$.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 w=!0,B$.Readable.toWeb($)}})};ZW.sdkStreamMixin=QY});var JW=I((zW)=>{async function zY($){if(typeof $.stream==="function")$=$.stream();return $.tee()}Object.defineProperty(zW,"__esModule",{value:!0});zW.splitStream=void 0;zW.splitStream=zY});var RW=I((fW)=>{async function MY($){if(JY.isReadableStream($))return FY.splitStream($);const U=new MW.PassThrough,G=new MW.PassThrough;return $.pipe(U),$.pipe(G),[U,G]}Object.defineProperty(fW,"__esModule",{value:!0});fW.splitStream=void 0;var MW=import.meta.require("stream"),FY=JW(),JY=x0();fW.splitStream=MY});var EW=I((KW)=>{async function fY($,U){var G;let w=0;const W=[],X=$.getReader();let L=!1;while(!L){const{done:Q,value:z}=await X.read();if(z)W.push(z),w+=(G=z===null||z===void 0?void 0:z.byteLength)!==null&&G!==void 0?G:0;if(w>=U)break;L=Q}X.releaseLock();const Z=new Uint8Array(Math.min(U,w));let Y=0;for(let Q of W){if(Q.byteLength>Z.byteLength-Y){Z.set(Q.subarray(0,Z.byteLength-Y),Y);break}else Z.set(Q,Y);Y+=Q.length}return Z}Object.defineProperty(KW,"__esModule",{value:!0});KW.headStream=void 0;KW.headStream=fY});var OW=I((VW)=>{Object.defineProperty(VW,"__esModule",{value:!0});VW.headStream=void 0;var IY=import.meta.require("stream"),RY=EW(),KY=x0(),BY=($,U)=>{if(KY.isReadableStream($))return RY.headStream($,U);return new Promise((G,w)=>{const W=new AW;W.limit=U,$.pipe(W),$.on("error",(X)=>{W.end(),w(X)}),W.on("error",w),W.on("finish",function(){const X=new Uint8Array(Buffer.concat(this.buffers));G(X)})})};VW.headStream=BY;class AW extends IY.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=Infinity,this.bytesBuffered=0}_write($,U,G){var w;if(this.buffers.push($),this.bytesBuffered+=(w=$.byteLength)!==null&&w!==void 0?w:0,this.bytesBuffered>=this.limit){const W=this.bytesBuffered-this.limit,X=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=X.subarray(0,X.byteLength-W),this.emit("finish")}G()}}});var jW=I((KJ,X0)=>{var CW=function($,U="utf-8"){if(U==="base64")return TW.toBase64($);return qW.toUtf8($)},NW=function($,U){if(U==="base64")return A$.mutate(TW.fromBase64($));return A$.mutate(qW.fromUtf8($))},Q1=Object.defineProperty,EY=Object.getOwnPropertyDescriptor,AY=Object.getOwnPropertyNames,VY=Object.prototype.hasOwnProperty,V$=($,U)=>Q1($,"name",{value:U,configurable:!0}),HY=($,U)=>{for(var G in U)Q1($,G,{get:U[G],enumerable:!0})},E$=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of AY(U))if(!VY.call($,W)&&W!==G)Q1($,W,{get:()=>U[W],enumerable:!(w=EY(U,W))||w.enumerable})}return $},v0=($,U,G)=>(E$($,U,"default"),G&&E$(G,U,"default")),OY=($)=>E$(Q1({},"__esModule",{value:!0}),$),W0={};HY(W0,{Uint8ArrayBlobAdapter:()=>A$});X0.exports=OY(W0);var TW=UW(),qW=R0();V$(CW,"transformToString");V$(NW,"transformFromString");var PW=class $ extends Uint8Array{static fromString(U,G="utf-8"){switch(typeof U){case"string":return NW(U,G);default:throw new Error(`Unsupported conversion from ${typeof U} to Uint8ArrayBlobAdapter.`)}}static mutate(U){return Object.setPrototypeOf(U,$.prototype),U}transformToString(U="utf-8"){return CW(this,U)}};V$(PW,"Uint8ArrayBlobAdapter");var A$=PW;v0(W0,Sw(),X0.exports);v0(W0,QW(),X0.exports);v0(W0,RW(),X0.exports);v0(W0,OW(),X0.exports);v0(W0,x0(),X0.exports)});var A0=I((BJ,tW)=>{var gW=function($){const U=$.getUTCFullYear(),G=$.getUTCMonth(),w=$.getUTCDay(),W=$.getUTCDate(),X=$.getUTCHours(),L=$.getUTCMinutes(),Z=$.getUTCSeconds(),Y=W<10?`0${W}`:`${W}`,Q=X<10?`0${X}`:`${X}`,z=L<10?`0${L}`:`${L}`,F=Z<10?`0${Z}`:`${Z}`;return`${tY[w]}, ${Y} ${b$[G]} ${U} ${Q}:${z}:${F} GMT`},J1=function($){return encodeURIComponent($).replace(/[!'()*]/g,function(U){return"%"+U.charCodeAt(0).toString(16).toUpperCase()})},h$=function($,U,G){let w,W,X;if(typeof U==="undefined"&&typeof G==="undefined")w={},X=$;else if(w=$,typeof U==="function")return W=U,X=G,k7(w,W,X);else X=U;for(let L of Object.keys(X)){if(!Array.isArray(X[L])){w[L]=X[L];continue}oW(w,null,X,L)}return w},aW=function($,U,G){if(G<=0||!Number.isInteger(G))throw new Error("Invalid number of delimiters ("+G+") for splitEvery.");const w=$.split(U);if(G===1)return w;const W=[];let X="";for(let L=0;L<w.length;L++){if(X==="")X=w[L];else X+=U+w[L];if((L+1)%G===0)W.push(X),X=""}if(X!=="")W.push(X);return W},M1=Object.defineProperty,qY=Object.getOwnPropertyDescriptor,CY=Object.getOwnPropertyNames,NY=Object.prototype.hasOwnProperty,M=($,U)=>M1($,"name",{value:U,configurable:!0}),PY=($,U)=>{for(var G in U)M1($,G,{get:U[G],enumerable:!0})},jY=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of CY(U))if(!NY.call($,W)&&W!==G)M1($,W,{get:()=>U[W],enumerable:!(w=qY(U,W))||w.enumerable})}return $},SY=($)=>jY(M1({},"__esModule",{value:!0}),$),kW={};PY(kW,{Client:()=>bY,Command:()=>vW,LazyJsonString:()=>P7,NoOpLogger:()=>kY,SENSITIVE_STRING:()=>xY,ServiceException:()=>R7,StringWrapper:()=>d0,_json:()=>P$,collectBody:()=>hY,convertMap:()=>j7,createAggregatedClient:()=>vY,dateToUtcString:()=>gW,decorateServiceException:()=>lW,emitWarningIfUnsupportedVersion:()=>A7,expectBoolean:()=>yY,expectByte:()=>N$,expectFloat32:()=>z1,expectInt:()=>uY,expectInt32:()=>q$,expectLong:()=>_0,expectNonNull:()=>pY,expectNumber:()=>y0,expectObject:()=>yW,expectShort:()=>C$,expectString:()=>gY,expectUnion:()=>sY,extendedEncodeURIComponent:()=>J1,getArrayIfSingleItem:()=>N7,getDefaultClientConfiguration:()=>q7,getDefaultExtensionConfiguration:()=>nW,getValueFromTextNode:()=>iW,handleFloat:()=>nY,limitedParseDouble:()=>k$,limitedParseFloat:()=>iY,limitedParseFloat32:()=>rY,loadConfigsForDefaultMode:()=>E7,logger:()=>u0,map:()=>h$,parseBoolean:()=>cY,parseEpochTimestamp:()=>Z7,parseRfc3339DateTime:()=>$7,parseRfc3339DateTimeWithOffset:()=>G7,parseRfc7231DateTime:()=>L7,resolveDefaultRuntimeConfig:()=>C7,resolvedPath:()=>D7,serializeDateTime:()=>v7,serializeFloat:()=>x7,splitEvery:()=>aW,strictParseByte:()=>pW,strictParseDouble:()=>S$,strictParseFloat:()=>lY,strictParseFloat32:()=>_W,strictParseInt:()=>oY,strictParseInt32:()=>aY,strictParseLong:()=>dW,strictParseShort:()=>K0,take:()=>S7,throwDefaultError:()=>mW,withBaseException:()=>K7});tW.exports=SY(kW);var bW=class ${trace(){}debug(){}info(){}warn(){}error(){}};M(bW,"NoOpLogger");var kY=bW,hW=TY(),DW=class ${constructor(U){this.config=U,this.middlewareStack=hW.constructStack()}send(U,G,w){const W=typeof G!=="function"?G:void 0,X=typeof G==="function"?G:w,L=W===void 0&&this.config.cacheMiddleware===!0;let Z;if(L){if(!this.handlers)this.handlers=new WeakMap;const Y=this.handlers;if(Y.has(U.constructor))Z=Y.get(U.constructor);else Z=U.resolveMiddleware(this.middlewareStack,this.config,W),Y.set(U.constructor,Z)}else delete this.handlers,Z=U.resolveMiddleware(this.middlewareStack,this.config,W);if(X)Z(U).then((Y)=>X(null,Y.output),(Y)=>X(Y)).catch(()=>{});else return Z(U).then((Y)=>Y.output)}destroy(){var U,G,w;(w=(G=(U=this.config)==null?void 0:U.requestHandler)==null?void 0:G.destroy)==null||w.call(G),delete this.handlers}};M(DW,"Client");var bY=DW,H$=jW(),hY=M(async($=new Uint8Array,U)=>{if($ instanceof Uint8Array)return H$.Uint8ArrayBlobAdapter.mutate($);if(!$)return H$.Uint8ArrayBlobAdapter.mutate(new Uint8Array);const G=U.streamCollector($);return H$.Uint8ArrayBlobAdapter.mutate(await G)},"collectBody"),T$=J0(),xW=class ${constructor(){this.middlewareStack=hW.constructStack()}static classBuilder(){return new DY}resolveMiddlewareWithContext(U,G,w,{middlewareFn:W,clientName:X,commandName:L,inputFilterSensitiveLog:Z,outputFilterSensitiveLog:Y,smithyContext:Q,additionalContext:z,CommandCtor:F}){for(let H of W.bind(this)(F,U,G,w))this.middlewareStack.use(H);const J=U.concat(this.middlewareStack),{logger:f}=G,R={logger:f,clientName:X,commandName:L,inputFilterSensitiveLog:Z,outputFilterSensitiveLog:Y,[T$.SMITHY_CONTEXT_KEY]:{commandInstance:this,...Q},...z},{requestHandler:K}=G;return J.resolve((H)=>K.handle(H.request,w||{}),R)}};M(xW,"Command");var vW=xW,cW=class ${constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(U)=>U,this._outputFilterSensitiveLog=(U)=>U,this._serializer=null,this._deserializer=null}init(U){this._init=U}ep(U){return this._ep=U,this}m(U){return this._middlewareFn=U,this}s(U,G,w={}){return this._smithyContext={service:U,operation:G,...w},this}c(U={}){return this._additionalContext=U,this}n(U,G){return this._clientName=U,this._commandName=G,this}f(U=(w)=>w,G=(w)=>w){return this._inputFilterSensitiveLog=U,this._outputFilterSensitiveLog=G,this}ser(U){return this._serializer=U,this}de(U){return this._deserializer=U,this}build(){var U;const G=this;let w;return w=(U=class extends vW{constructor(...[W]){super();this.serialize=G._serializer,this.deserialize=G._deserializer,this.input=W??{},G._init(this)}static getEndpointParameterInstructions(){return G._ep}resolveMiddleware(W,X,L){return this.resolveMiddlewareWithContext(W,X,L,{CommandCtor:w,middlewareFn:G._middlewareFn,clientName:G._clientName,commandName:G._commandName,inputFilterSensitiveLog:G._inputFilterSensitiveLog,outputFilterSensitiveLog:G._outputFilterSensitiveLog,smithyContext:G._smithyContext,additionalContext:G._additionalContext})}},M(U,"CommandRef"),U)}};M(cW,"ClassBuilder");var DY=cW,xY="***SensitiveInformation***",vY=M(($,U)=>{for(let G of Object.keys($)){const w=$[G],W=M(async function(L,Z,Y){const Q=new w(L);if(typeof Z==="function")this.send(Q,Z);else if(typeof Y==="function"){if(typeof Z!=="object")throw new Error(`Expected http options but got ${typeof Z}`);this.send(Q,Z||{},Y)}else return this.send(Q,Z)},"methodImpl"),X=(G[0].toLowerCase()+G.slice(1)).replace(/Command$/,"");U.prototype[X]=W}},"createAggregatedClient"),cY=M(($)=>{switch($){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${$}"`)}},"parseBoolean"),yY=M(($)=>{if($===null||$===void 0)return;if(typeof $==="number"){if($===0||$===1)u0.warn(F1(`Expected boolean, got ${typeof $}: ${$}`));if($===0)return!1;if($===1)return!0}if(typeof $==="string"){const U=$.toLowerCase();if(U==="false"||U==="true")u0.warn(F1(`Expected boolean, got ${typeof $}: ${$}`));if(U==="false")return!1;if(U==="true")return!0}if(typeof $==="boolean")return $;throw new TypeError(`Expected boolean, got ${typeof $}: ${$}`)},"expectBoolean"),y0=M(($)=>{if($===null||$===void 0)return;if(typeof $==="string"){const U=parseFloat($);if(!Number.isNaN(U)){if(String(U)!==String($))u0.warn(F1(`Expected number but observed string: ${$}`));return U}}if(typeof $==="number")return $;throw new TypeError(`Expected number, got ${typeof $}: ${$}`)},"expectNumber"),_Y=Math.ceil(340282346638528860000000000000000000000),z1=M(($)=>{const U=y0($);if(U!==void 0&&!Number.isNaN(U)&&U!==Infinity&&U!==(-Infinity)){if(Math.abs(U)>_Y)throw new TypeError(`Expected 32-bit float, got ${$}`)}return U},"expectFloat32"),_0=M(($)=>{if($===null||$===void 0)return;if(Number.isInteger($)&&!Number.isNaN($))return $;throw new TypeError(`Expected integer, got ${typeof $}: ${$}`)},"expectLong"),uY=_0,q$=M(($)=>j$($,32),"expectInt32"),C$=M(($)=>j$($,16),"expectShort"),N$=M(($)=>j$($,8),"expectByte"),j$=M(($,U)=>{const G=_0($);if(G!==void 0&&dY(G,U)!==G)throw new TypeError(`Expected ${U}-bit integer, got ${$}`);return G},"expectSizedInt"),dY=M(($,U)=>{switch(U){case 32:return Int32Array.of($)[0];case 16:return Int16Array.of($)[0];case 8:return Int8Array.of($)[0]}},"castInt"),pY=M(($,U)=>{if($===null||$===void 0){if(U)throw new TypeError(`Expected a non-null value for ${U}`);throw new TypeError("Expected a non-null value")}return $},"expectNonNull"),yW=M(($)=>{if($===null||$===void 0)return;if(typeof $==="object"&&!Array.isArray($))return $;const U=Array.isArray($)?"array":typeof $;throw new TypeError(`Expected object, got ${U}: ${$}`)},"expectObject"),gY=M(($)=>{if($===null||$===void 0)return;if(typeof $==="string")return $;if(["boolean","number","bigint"].includes(typeof $))return u0.warn(F1(`Expected string, got ${typeof $}: ${$}`)),String($);throw new TypeError(`Expected string, got ${typeof $}: ${$}`)},"expectString"),sY=M(($)=>{if($===null||$===void 0)return;const U=yW($),G=Object.entries(U).filter(([,w])=>w!=null).map(([w])=>w);if(G.length===0)throw new TypeError("Unions must have exactly one non-null member. None were found.");if(G.length>1)throw new TypeError(`Unions must have exactly one non-null member. Keys ${G} were not null.`);return U},"expectUnion"),S$=M(($)=>{if(typeof $=="string")return y0(E0($));return y0($)},"strictParseDouble"),lY=S$,_W=M(($)=>{if(typeof $=="string")return z1(E0($));return z1($)},"strictParseFloat32"),mY=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,E0=M(($)=>{const U=$.match(mY);if(U===null||U[0].length!==$.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat($)},"parseNumber"),k$=M(($)=>{if(typeof $=="string")return uW($);return y0($)},"limitedParseDouble"),nY=k$,iY=k$,rY=M(($)=>{if(typeof $=="string")return uW($);return z1($)},"limitedParseFloat32"),uW=M(($)=>{switch($){case"NaN":return NaN;case"Infinity":return Infinity;case"-Infinity":return (-Infinity);default:throw new Error(`Unable to parse float value: ${$}`)}},"parseFloatString"),dW=M(($)=>{if(typeof $==="string")return _0(E0($));return _0($)},"strictParseLong"),oY=dW,aY=M(($)=>{if(typeof $==="string")return q$(E0($));return q$($)},"strictParseInt32"),K0=M(($)=>{if(typeof $==="string")return C$(E0($));return C$($)},"strictParseShort"),pW=M(($)=>{if(typeof $==="string")return N$(E0($));return N$($)},"strictParseByte"),F1=M(($)=>{return String(new TypeError($).stack||$).split("\n").slice(0,5).filter((U)=>!U.includes("stackTraceWarning")).join("\n")},"stackTraceWarning"),u0={warn:console.warn},tY=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],b$=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];M(gW,"dateToUtcString");var eY=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),$7=M(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const U=eY.exec($);if(!U)throw new TypeError("Invalid RFC-3339 date-time value");const[G,w,W,X,L,Z,Y,Q]=U,z=K0(B0(w)),F=l(W,"month",1,12),J=l(X,"day",1,31);return c0(z,F,J,{hours:L,minutes:Z,seconds:Y,fractionalMilliseconds:Q})},"parseRfc3339DateTime"),U7=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),G7=M(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const U=U7.exec($);if(!U)throw new TypeError("Invalid RFC-3339 date-time value");const[G,w,W,X,L,Z,Y,Q,z]=U,F=K0(B0(w)),J=l(W,"month",1,12),f=l(X,"day",1,31),R=c0(F,J,f,{hours:L,minutes:Z,seconds:Y,fractionalMilliseconds:Q});if(z.toUpperCase()!="Z")R.setTime(R.getTime()-I7(z));return R},"parseRfc3339DateTimeWithOffset"),w7=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$/),W7=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$/),X7=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})$/),L7=M(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let U=w7.exec($);if(U){const[G,w,W,X,L,Z,Y,Q]=U;return c0(K0(B0(X)),O$(W),l(w,"day",1,31),{hours:L,minutes:Z,seconds:Y,fractionalMilliseconds:Q})}if(U=W7.exec($),U){const[G,w,W,X,L,Z,Y,Q]=U;return z7(c0(Y7(X),O$(W),l(w,"day",1,31),{hours:L,minutes:Z,seconds:Y,fractionalMilliseconds:Q}))}if(U=X7.exec($),U){const[G,w,W,X,L,Z,Y,Q]=U;return c0(K0(B0(Q)),O$(w),l(W.trimLeft(),"day",1,31),{hours:X,minutes:L,seconds:Z,fractionalMilliseconds:Y})}throw new TypeError("Invalid RFC-7231 date-time value")},"parseRfc7231DateTime"),Z7=M(($)=>{if($===null||$===void 0)return;let U;if(typeof $==="number")U=$;else if(typeof $==="string")U=S$($);else if(typeof $==="object"&&$.tag===1)U=$.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(U)||U===Infinity||U===(-Infinity))throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(U*1000))},"parseEpochTimestamp"),c0=M(($,U,G,w)=>{const W=U-1;return J7($,W,G),new Date(Date.UTC($,W,G,l(w.hours,"hour",0,23),l(w.minutes,"minute",0,59),l(w.seconds,"seconds",0,60),f7(w.fractionalMilliseconds)))},"buildDate"),Y7=M(($)=>{const U=(new Date()).getUTCFullYear(),G=Math.floor(U/100)*100+K0(B0($));if(G<U)return G+100;return G},"parseTwoDigitYear"),Q7=1576800000000,z7=M(($)=>{if($.getTime()-(new Date()).getTime()>Q7)return new Date(Date.UTC($.getUTCFullYear()-100,$.getUTCMonth(),$.getUTCDate(),$.getUTCHours(),$.getUTCMinutes(),$.getUTCSeconds(),$.getUTCMilliseconds()));return $},"adjustRfc850Year"),O$=M(($)=>{const U=b$.indexOf($);if(U<0)throw new TypeError(`Invalid month: ${$}`);return U+1},"parseMonthByShortName"),F7=[31,28,31,30,31,30,31,31,30,31,30,31],J7=M(($,U,G)=>{let w=F7[U];if(U===1&&M7($))w=29;if(G>w)throw new TypeError(`Invalid day for ${b$[U]} in ${$}: ${G}`)},"validateDayOfMonth"),M7=M(($)=>{return $%4===0&&($%100!==0||$%400===0)},"isLeapYear"),l=M(($,U,G,w)=>{const W=pW(B0($));if(W<G||W>w)throw new TypeError(`${U} must be between ${G} and ${w}, inclusive`);return W},"parseDateValue"),f7=M(($)=>{if($===null||$===void 0)return 0;return _W("0."+$)*1000},"parseMilliseconds"),I7=M(($)=>{const U=$[0];let G=1;if(U=="+")G=1;else if(U=="-")G=-1;else throw new TypeError(`Offset direction, ${U}, must be "+" or "-"`);const w=Number($.substring(1,3)),W=Number($.substring(4,6));return G*(w*60+W)*60*1000},"parseOffsetToMilliseconds"),B0=M(($)=>{let U=0;while(U<$.length-1&&$.charAt(U)==="0")U++;if(U===0)return $;return $.slice(U)},"stripLeadingZeroes"),sW=class $ extends Error{constructor(U){super(U.message);Object.setPrototypeOf(this,$.prototype),this.name=U.name,this.$fault=U.$fault,this.$metadata=U.$metadata}};M(sW,"ServiceException");var R7=sW,lW=M(($,U={})=>{Object.entries(U).filter(([,w])=>w!==void 0).forEach(([w,W])=>{if($[w]==null||$[w]==="")$[w]=W});const G=$.message||$.Message||"UnknownError";return $.message=G,delete $.Message,$},"decorateServiceException"),mW=M(({output:$,parsedBody:U,exceptionCtor:G,errorCode:w})=>{const W=B7($),X=W.httpStatusCode?W.httpStatusCode+"":void 0,L=new G({name:(U==null?void 0:U.code)||(U==null?void 0:U.Code)||w||X||"UnknownError",$fault:"client",$metadata:W});throw lW(L,U)},"throwDefaultError"),K7=M(($)=>{return({output:U,parsedBody:G,errorCode:w})=>{mW({output:U,parsedBody:G,exceptionCtor:$,errorCode:w})}},"withBaseException"),B7=M(($)=>({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"),E7=M(($)=>{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"),SW=!1,A7=M(($)=>{if($&&!SW&&parseInt($.substring(1,$.indexOf(".")))<16)SW=!0},"emitWarningIfUnsupportedVersion"),V7=M(($)=>{const U=[];for(let G in T$.AlgorithmId){const w=T$.AlgorithmId[G];if($[w]===void 0)continue;U.push({algorithmId:()=>w,checksumConstructor:()=>$[w]})}return{_checksumAlgorithms:U,addChecksumAlgorithm(G){this._checksumAlgorithms.push(G)},checksumAlgorithms(){return this._checksumAlgorithms}}},"getChecksumConfiguration"),H7=M(($)=>{const U={};return $.checksumAlgorithms().forEach((G)=>{U[G.algorithmId()]=G.checksumConstructor()}),U},"resolveChecksumRuntimeConfig"),O7=M(($)=>{let U=$.retryStrategy;return{setRetryStrategy(G){U=G},retryStrategy(){return U}}},"getRetryConfiguration"),T7=M(($)=>{const U={};return U.retryStrategy=$.retryStrategy(),U},"resolveRetryRuntimeConfig"),nW=M(($)=>{return{...V7($),...O7($)}},"getDefaultExtensionConfiguration"),q7=nW,C7=M(($)=>{return{...H7($),...T7($)}},"resolveDefaultRuntimeConfig");M(J1,"extendedEncodeURIComponent");var N7=M(($)=>Array.isArray($)?$:[$],"getArrayIfSingleItem"),iW=M(($)=>{for(let G in $)if($.hasOwnProperty(G)&&$[G]["#text"]!==void 0)$[G]=$[G]["#text"];else if(typeof $[G]==="object"&&$[G]!==null)$[G]=iW($[G]);return $},"getValueFromTextNode"),d0=M(function(){const $=Object.getPrototypeOf(this).constructor,G=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(G,$.prototype),G},"StringWrapper");d0.prototype=Object.create(String.prototype,{constructor:{value:d0,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(d0,String);var rW=class $ extends d0{deserializeJSON(){return JSON.parse(super.toString())}toJSON(){return super.toString()}static fromObject(U){if(U instanceof $)return U;else if(U instanceof String||typeof U==="string")return new $(U);return new $(JSON.stringify(U))}};M(rW,"LazyJsonString");var P7=rW;M(h$,"map");var j7=M(($)=>{const U={};for(let[G,w]of Object.entries($||{}))U[G]=[,w];return U},"convertMap"),S7=M(($,U)=>{const G={};for(let w in U)oW(G,$,U,w);return G},"take"),k7=M(($,U,G)=>{return h$($,Object.entries(G).reduce((w,[W,X])=>{if(Array.isArray(X))w[W]=X;else if(typeof X==="function")w[W]=[U,X()];else w[W]=[U,X];return w},{}))},"mapWithFilter"),oW=M(($,U,G,w)=>{if(U!==null){let L=G[w];if(typeof L==="function")L=[,L];const[Z=b7,Y=h7,Q=w]=L;if(typeof Z==="function"&&Z(U[Q])||typeof Z!=="function"&&!!Z)$[w]=Y(U[Q]);return}let[W,X]=G[w];if(typeof X==="function"){let L;const Z=W===void 0&&(L=X())!=null,Y=typeof W==="function"&&!!W(void 0)||typeof W!=="function"&&!!W;if(Z)$[w]=L;else if(Y)$[w]=X()}else{const L=W===void 0&&X!=null,Z=typeof W==="function"&&!!W(X)||typeof W!=="function"&&!!W;if(L||Z)$[w]=X}},"applyInstruction"),b7=M(($)=>$!=null,"nonNullish"),h7=M(($)=>$,"pass"),D7=M(($,U,G,w,W,X)=>{if(U!=null&&U[G]!==void 0){const L=w();if(L.length<=0)throw new Error("Empty value provided for input HTTP label: "+G+".");$=$.replace(W,X?L.split("/").map((Z)=>J1(Z)).join("/"):J1(L))}else throw new Error("No value provided for input HTTP label: "+G+".");return $},"resolvedPath"),x7=M(($)=>{if($!==$)return"NaN";switch($){case Infinity:return"Infinity";case (-Infinity):return"-Infinity";default:return $}},"serializeFloat"),v7=M(($)=>$.toISOString().replace(".000Z","Z"),"serializeDateTime"),P$=M(($)=>{if($==null)return{};if(Array.isArray($))return $.filter((U)=>U!=null).map(P$);if(typeof $==="object"){const U={};for(let G of Object.keys($)){if($[G]==null)continue;U[G]=P$($[G])}return U}return $},"_json");M(aW,"splitEvery")});var U8=I((eW)=>{Object.defineProperty(eW,"__esModule",{value:!0});eW.isStreamingPayload=void 0;var c7=import.meta.require("stream"),y7=($)=>($===null||$===void 0?void 0:$.body)instanceof c7.Readable||typeof ReadableStream!=="undefined"&&($===null||$===void 0?void 0:$.body)instanceof ReadableStream;eW.isStreamingPayload=y7});var E8=I((VJ,B8)=>{var{defineProperty:f1,getOwnPropertyDescriptor:_7,getOwnPropertyNames:u7}=Object,d7=Object.prototype.hasOwnProperty,C=($,U)=>f1($,"name",{value:U,configurable:!0}),p7=($,U)=>{for(var G in U)f1($,G,{get:U[G],enumerable:!0})},g7=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of u7(U))if(!d7.call($,W)&&W!==G)f1($,W,{get:()=>U[W],enumerable:!(w=_7(U,W))||w.enumerable})}return $},s7=($)=>g7(f1({},"__esModule",{value:!0}),$),w8={};p7(w8,{AdaptiveRetryStrategy:()=>n7,CONFIG_MAX_ATTEMPTS:()=>x$,CONFIG_RETRY_MODE:()=>J8,ENV_MAX_ATTEMPTS:()=>D$,ENV_RETRY_MODE:()=>F8,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>i7,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>o7,StandardRetryStrategy:()=>Q8,defaultDelayDecider:()=>X8,defaultRetryDecider:()=>L8,getOmitRetryHeadersPlugin:()=>a7,getRetryAfterHint:()=>K8,getRetryPlugin:()=>w9,omitRetryHeadersMiddleware:()=>M8,omitRetryHeadersMiddlewareOptions:()=>f8,resolveRetryConfig:()=>r7,retryMiddleware:()=>I8,retryMiddlewareOptions:()=>R8});B8.exports=s7(w8);var V0=w0(),W8=a1(),O=Nw(),l7=C(($,U)=>{const G=$,w=(U==null?void 0:U.noRetryIncrement)??O.NO_RETRY_INCREMENT,W=(U==null?void 0:U.retryCost)??O.RETRY_COST,X=(U==null?void 0:U.timeoutRetryCost)??O.TIMEOUT_RETRY_COST;let L=$;const Z=C((F)=>F.name==="TimeoutError"?X:W,"getCapacityAmount"),Y=C((F)=>Z(F)<=L,"hasRetryTokens");return Object.freeze({hasRetryTokens:Y,retrieveRetryTokens:C((F)=>{if(!Y(F))throw new Error("No retry token available");const J=Z(F);return L-=J,J},"retrieveRetryTokens"),releaseRetryTokens:C((F)=>{L+=F??w,L=Math.min(L,G)},"releaseRetryTokens")})},"getDefaultRetryQuota"),X8=C(($,U)=>Math.floor(Math.min(O.MAXIMUM_RETRY_DELAY,Math.random()*2**U*$)),"defaultDelayDecider"),o=G0(),L8=C(($)=>{if(!$)return!1;return o.isRetryableByTrait($)||o.isClockSkewError($)||o.isThrottlingError($)||o.isTransientError($)},"defaultRetryDecider"),Z8=C(($)=>{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"),Y8=class ${constructor(U,G){this.maxAttemptsProvider=U,this.mode=O.RETRY_MODES.STANDARD,this.retryDecider=(G==null?void 0:G.retryDecider)??L8,this.delayDecider=(G==null?void 0:G.delayDecider)??X8,this.retryQuota=(G==null?void 0:G.retryQuota)??l7(O.INITIAL_RETRY_TOKENS)}shouldRetry(U,G,w){return G<w&&this.retryDecider(U)&&this.retryQuota.hasRetryTokens(U)}async getMaxAttempts(){let U;try{U=await this.maxAttemptsProvider()}catch(G){U=O.DEFAULT_MAX_ATTEMPTS}return U}async retry(U,G,w){let W,X=0,L=0;const Z=await this.getMaxAttempts(),{request:Y}=G;if(V0.HttpRequest.isInstance(Y))Y.headers[O.INVOCATION_ID_HEADER]=W8.v4();while(!0)try{if(V0.HttpRequest.isInstance(Y))Y.headers[O.REQUEST_HEADER]=`attempt=${X+1}; max=${Z}`;if(w==null?void 0:w.beforeRequest)await w.beforeRequest();const{response:Q,output:z}=await U(G);if(w==null?void 0:w.afterRequest)w.afterRequest(Q);return this.retryQuota.releaseRetryTokens(W),z.$metadata.attempts=X+1,z.$metadata.totalRetryDelay=L,{response:Q,output:z}}catch(Q){const z=Z8(Q);if(X++,this.shouldRetry(z,X,Z)){W=this.retryQuota.retrieveRetryTokens(z);const F=this.delayDecider(o.isThrottlingError(z)?O.THROTTLING_RETRY_DELAY_BASE:O.DEFAULT_RETRY_DELAY_BASE,X),J=m7(z.$response),f=Math.max(J||0,F);L+=f,await new Promise((R)=>setTimeout(R,f));continue}if(!z.$metadata)z.$metadata={};throw z.$metadata.attempts=X,z.$metadata.totalRetryDelay=L,z}}};C(Y8,"StandardRetryStrategy");var Q8=Y8,m7=C(($)=>{if(!V0.HttpResponse.isInstance($))return;const U=Object.keys($.headers).find((X)=>X.toLowerCase()==="retry-after");if(!U)return;const G=$.headers[U],w=Number(G);if(!Number.isNaN(w))return w*1000;return new Date(G).getTime()-Date.now()},"getDelayFromRetryAfterHeader"),z8=class $ extends Q8{constructor(U,G){const{rateLimiter:w,...W}=G??{};super(U,W);this.rateLimiter=w??new O.DefaultRateLimiter,this.mode=O.RETRY_MODES.ADAPTIVE}async retry(U,G){return super.retry(U,G,{beforeRequest:async()=>{return this.rateLimiter.getSendToken()},afterRequest:(w)=>{this.rateLimiter.updateClientSendingRate(w)}})}};C(z8,"AdaptiveRetryStrategy");var n7=z8,G8=j0(),D$="AWS_MAX_ATTEMPTS",x$="max_attempts",i7={environmentVariableSelector:($)=>{const U=$[D$];if(!U)return;const G=parseInt(U);if(Number.isNaN(G))throw new Error(`Environment variable ${D$} mast be a number, got "${U}"`);return G},configFileSelector:($)=>{const U=$[x$];if(!U)return;const G=parseInt(U);if(Number.isNaN(G))throw new Error(`Shared config file entry ${x$} mast be a number, got "${U}"`);return G},default:O.DEFAULT_MAX_ATTEMPTS},r7=C(($)=>{const{retryStrategy:U}=$,G=G8.normalizeProvider($.maxAttempts??O.DEFAULT_MAX_ATTEMPTS);return{...$,maxAttempts:G,retryStrategy:async()=>{if(U)return U;if(await G8.normalizeProvider($.retryMode)()===O.RETRY_MODES.ADAPTIVE)return new O.AdaptiveRetryStrategy(G);return new O.StandardRetryStrategy(G)}}},"resolveRetryConfig"),F8="AWS_RETRY_MODE",J8="retry_mode",o7={environmentVariableSelector:($)=>$[F8],configFileSelector:($)=>$[J8],default:O.DEFAULT_RETRY_MODE},M8=C(()=>($)=>async(U)=>{const{request:G}=U;if(V0.HttpRequest.isInstance(G))delete G.headers[O.INVOCATION_ID_HEADER],delete G.headers[O.REQUEST_HEADER];return $(U)},"omitRetryHeadersMiddleware"),f8={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},a7=C(($)=>({applyToStack:(U)=>{U.addRelativeTo(M8(),f8)}}),"getOmitRetryHeadersPlugin"),t7=A0(),e7=U8(),I8=C(($)=>(U,G)=>async(w)=>{var W;let X=await $.retryStrategy();const L=await $.maxAttempts();if($9(X)){X=X;let Z=await X.acquireInitialRetryToken(G.partition_id),Y=new Error,Q=0,z=0;const{request:F}=w,J=V0.HttpRequest.isInstance(F);if(J)F.headers[O.INVOCATION_ID_HEADER]=W8.v4();while(!0)try{if(J)F.headers[O.REQUEST_HEADER]=`attempt=${Q+1}; max=${L}`;const{response:f,output:R}=await U(w);return X.recordSuccess(Z),R.$metadata.attempts=Q+1,R.$metadata.totalRetryDelay=z,{response:f,output:R}}catch(f){const R=U9(f);if(Y=Z8(f),J&&e7.isStreamingPayload(F))throw(W=G.logger instanceof t7.NoOpLogger?console:G.logger)==null||W.warn("An error was encountered in a non-retryable streaming request."),Y;try{Z=await X.refreshRetryTokenForRetry(Z,R)}catch(H){if(!Y.$metadata)Y.$metadata={};throw Y.$metadata.attempts=Q+1,Y.$metadata.totalRetryDelay=z,Y}Q=Z.getRetryCount();const K=Z.getRetryDelay();z+=K,await new Promise((H)=>setTimeout(H,K))}}else{if(X=X,X==null?void 0:X.mode)G.userAgent=[...G.userAgent||[],["cfg/retry-mode",X.mode]];return X.retry(U,w)}},"retryMiddleware"),$9=C(($)=>typeof $.acquireInitialRetryToken!=="undefined"&&typeof $.refreshRetryTokenForRetry!=="undefined"&&typeof $.recordSuccess!=="undefined","isRetryStrategyV2"),U9=C(($)=>{const U={error:$,errorType:G9($)},G=K8($.$response);if(G)U.retryAfterHint=G;return U},"getRetryErrorInfo"),G9=C(($)=>{if(o.isThrottlingError($))return"THROTTLING";if(o.isTransientError($))return"TRANSIENT";if(o.isServerError($))return"SERVER_ERROR";return"CLIENT_ERROR"},"getRetryErrorType"),R8={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},w9=C(($)=>({applyToStack:(U)=>{U.add(I8($),R8)}}),"getRetryPlugin"),K8=C(($)=>{if(!V0.HttpResponse.isInstance($))return;const U=Object.keys($.headers).find((X)=>X.toLowerCase()==="retry-after");if(!U)return;const G=$.headers[U],w=Number(G);if(!Number.isNaN(w))return new Date(w*1000);return new Date(G)},"getRetryAfterHint")});var c$=I((HJ,y8)=>{var H8=function($){const U=new Map;for(let G of $)U.set(G.schemeId,G);return U},D8=function($,U){return new v8($,U)},c8=function($,U,G,w,W){return V(async function*X(L,Z,...Y){let Q=L.startingToken||void 0,z=!0,F;while(z){if(Z[G]=Q,W)Z[W]=Z[W]??L.pageSize;if(L.client instanceof $)F=await N9(U,L.client,Z,...Y);else throw new Error(`Invalid client, expected instance of ${$.name}`);yield F;const J=Q;Q=P9(F,w),z=!!(Q&&(!L.stopOnSameToken||Q!==J))}return},"paginateOperation")},R1=Object.defineProperty,W9=Object.getOwnPropertyDescriptor,X9=Object.getOwnPropertyNames,L9=Object.prototype.hasOwnProperty,V=($,U)=>R1($,"name",{value:U,configurable:!0}),Z9=($,U)=>{for(var G in U)R1($,G,{get:U[G],enumerable:!0})},Y9=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of X9(U))if(!L9.call($,W)&&W!==G)R1($,W,{get:()=>U[W],enumerable:!(w=W9(U,W))||w.enumerable})}return $},Q9=($)=>Y9(R1({},"__esModule",{value:!0}),$),A8={};Z9(A8,{DefaultIdentityProviderConfig:()=>B9,EXPIRATION_MS:()=>b8,HttpApiKeyAuthSigner:()=>E9,HttpBearerAuthSigner:()=>A9,NoAuthSigner:()=>V9,RequestBuilder:()=>v8,createIsIdentityExpiredFunction:()=>k8,createPaginator:()=>c8,doesIdentityRequireRefresh:()=>h8,getHttpAuthSchemeEndpointRuleSetPlugin:()=>F9,getHttpAuthSchemePlugin:()=>M9,getHttpSigningPlugin:()=>K9,getSmithyContext:()=>T9,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>O8,httpAuthSchemeMiddleware:()=>v$,httpAuthSchemeMiddlewareOptions:()=>T8,httpSigningMiddleware:()=>q8,httpSigningMiddlewareOptions:()=>C8,isIdentityExpired:()=>H9,memoizeIdentityProvider:()=>O9,normalizeProvider:()=>q9,requestBuilder:()=>D8});y8.exports=Q9(A8);var V8=j0();V(H8,"convertHttpAuthSchemesToMap");var v$=V(($,U)=>(G,w)=>async(W)=>{var X;const L=$.httpAuthSchemeProvider(await U.httpAuthSchemeParametersProvider($,w,W.input)),Z=H8($.httpAuthSchemes),Y=V8.getSmithyContext(w),Q=[];for(let z of L){const F=Z.get(z.schemeId);if(!F){Q.push(`HttpAuthScheme \`${z.schemeId}\` was not enabled for this service.`);continue}const J=F.identityProvider(await U.identityProviderConfigProvider($));if(!J){Q.push(`HttpAuthScheme \`${z.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:f={},signingProperties:R={}}=((X=z.propertiesExtractor)==null?void 0:X.call(z,$,w))||{};z.identityProperties=Object.assign(z.identityProperties||{},f),z.signingProperties=Object.assign(z.signingProperties||{},R),Y.selectedHttpAuthScheme={httpAuthOption:z,identity:await J(z.identityProperties),signer:F.signer};break}if(!Y.selectedHttpAuthScheme)throw new Error(Q.join("\n"));return G(W)},"httpAuthSchemeMiddleware"),z9=Qw(),O8={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:z9.endpointMiddlewareOptions.name},F9=V(($,{httpAuthSchemeParametersProvider:U,identityProviderConfigProvider:G})=>({applyToStack:(w)=>{w.addRelativeTo(v$($,{httpAuthSchemeParametersProvider:U,identityProviderConfigProvider:G}),O8)}}),"getHttpAuthSchemeEndpointRuleSetPlugin"),J9=e0(),T8={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:J9.serializerMiddlewareOption.name},M9=V(($,{httpAuthSchemeParametersProvider:U,identityProviderConfigProvider:G})=>({applyToStack:(w)=>{w.addRelativeTo(v$($,{httpAuthSchemeParametersProvider:U,identityProviderConfigProvider:G}),T8)}}),"getHttpAuthSchemePlugin"),K1=w0(),f9=V(($)=>(U)=>{throw U},"defaultErrorHandler"),I9=V(($,U)=>{},"defaultSuccessHandler"),q8=V(($)=>(U,G)=>async(w)=>{if(!K1.HttpRequest.isInstance(w.request))return U(w);const X=V8.getSmithyContext(G).selectedHttpAuthScheme;if(!X)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:L={}},identity:Z,signer:Y}=X,Q=await U({...w,request:await Y.sign(w.request,Z,L)}).catch((Y.errorHandler||f9)(L));return(Y.successHandler||I9)(Q.response,L),Q},"httpSigningMiddleware"),R9=E8(),C8={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:R9.retryMiddlewareOptions.name},K9=V(($)=>({applyToStack:(U)=>{U.addRelativeTo(q8($),C8)}}),"getHttpSigningPlugin"),N8=class ${constructor(U){this.authSchemes=new Map;for(let[G,w]of Object.entries(U))if(w!==void 0)this.authSchemes.set(G,w)}getIdentityProvider(U){return this.authSchemes.get(U)}};V(N8,"DefaultIdentityProviderConfig");var B9=N8,I1=J0(),P8=class ${async sign(U,G,w){if(!w)throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!w.name)throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!w.in)throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!G.apiKey)throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");const W=K1.HttpRequest.clone(U);if(w.in===I1.HttpApiKeyAuthLocation.QUERY)W.query[w.name]=G.apiKey;else if(w.in===I1.HttpApiKeyAuthLocation.HEADER)W.headers[w.name]=w.scheme?`${w.scheme} ${G.apiKey}`:G.apiKey;else throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+w.in+"`");return W}};V(P8,"HttpApiKeyAuthSigner");var E9=P8,j8=class ${async sign(U,G,w){const W=K1.HttpRequest.clone(U);if(!G.token)throw new Error("request could not be signed with `token` since the `token` is not defined");return W.headers.Authorization=`Bearer ${G.token}`,W}};V(j8,"HttpBearerAuthSigner");var A9=j8,S8=class ${async sign(U,G,w){return U}};V(S8,"NoAuthSigner");var V9=S8,k8=V(($)=>(U)=>h8(U)&&U.expiration.getTime()-Date.now()<$,"createIsIdentityExpiredFunction"),b8=300000,H9=k8(b8),h8=V(($)=>$.expiration!==void 0,"doesIdentityRequireRefresh"),O9=V(($,U,G)=>{if($===void 0)return;const w=typeof $!=="function"?async()=>Promise.resolve($):$;let W,X,L,Z=!1;const Y=V(async(Q)=>{if(!X)X=w(Q);try{W=await X,L=!0,Z=!1}finally{X=void 0}return W},"coalesceProvider");if(U===void 0)return async(Q)=>{if(!L||(Q==null?void 0:Q.forceRefresh))W=await Y(Q);return W};return async(Q)=>{if(!L||(Q==null?void 0:Q.forceRefresh))W=await Y(Q);if(Z)return W;if(!G(W))return Z=!0,W;if(U(W))return await Y(Q),W;return W}},"memoizeIdentityProvider"),T9=V(($)=>$[I1.SMITHY_CONTEXT_KEY]||($[I1.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),q9=V(($)=>{if(typeof $==="function")return $;const U=Promise.resolve($);return()=>U},"normalizeProvider"),C9=A0();V(D8,"requestBuilder");var x8=class ${constructor(U,G){this.input=U,this.context=G,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){const{hostname:U,protocol:G="https",port:w,path:W}=await this.context.endpoint();this.path=W;for(let X of this.resolvePathStack)X(this.path);return new K1.HttpRequest({protocol:G,hostname:this.hostname||U,port:w,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(U){return this.hostname=U,this}bp(U){return this.resolvePathStack.push((G)=>{this.path=`${(G==null?void 0:G.endsWith("/"))?G.slice(0,-1):G||""}`+U}),this}p(U,G,w,W){return this.resolvePathStack.push((X)=>{this.path=C9.resolvedPath(X,this.input,U,G,w,W)}),this}h(U){return this.headers=U,this}q(U){return this.query=U,this}b(U){return this.body=U,this}m(U){return this.method=U,this}};V(x8,"RequestBuilder");var v8=x8,N9=V(async($,U,G,...w)=>{return await U.send(new $(G),...w)},"makePagedClientRequest");V(c8,"createPaginator");var P9=V(($,U)=>{let G=$;const w=U.split(".");for(let W of w){if(!G||typeof G!=="object")return;G=G[W]}return G},"get")});var PX=I((OK,NX)=>{var{defineProperty:D1,getOwnPropertyDescriptor:Y2,getOwnPropertyNames:Q2}=Object,z2=Object.prototype.hasOwnProperty,F2=($,U)=>D1($,"name",{value:U,configurable:!0}),J2=($,U)=>{for(var G in U)D1($,G,{get:U[G],enumerable:!0})},M2=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of Q2(U))if(!z2.call($,W)&&W!==G)D1($,W,{get:()=>U[W],enumerable:!(w=Y2(U,W))||w.enumerable})}return $},f2=($)=>M2(D1({},"__esModule",{value:!0}),$),CX={};J2(CX,{emitWarningIfUnsupportedVersion:()=>I2});NX.exports=f2(CX);var qX=!1,I2=F2(($)=>{if($&&!qX&&parseInt($.substring(1,$.indexOf(".")))<18)qX=!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 iX=I((TK,nX)=>{var ZU=function($){for(let U=0;U<8;U++)$[U]^=255;for(let U=7;U>-1;U--)if($[U]++,$[U]!==0)break},u1=Object.defineProperty,B2=Object.getOwnPropertyDescriptor,E2=Object.getOwnPropertyNames,A2=Object.prototype.hasOwnProperty,N=($,U)=>u1($,"name",{value:U,configurable:!0}),V2=($,U)=>{for(var G in U)u1($,G,{get:U[G],enumerable:!0})},H2=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of E2(U))if(!A2.call($,W)&&W!==G)u1($,W,{get:()=>U[W],enumerable:!(w=B2(U,W))||w.enumerable})}return $},O2=($)=>H2(u1({},"__esModule",{value:!0}),$),hX={};V2(hX,{SignatureV4:()=>r2,clearCredentialCache:()=>u2,createScope:()=>c1,getCanonicalHeaders:()=>LU,getCanonicalQuery:()=>dX,getPayloadHash:()=>_1,getSigningKey:()=>uX,moveHeadersToQuery:()=>lX,prepareRequest:()=>YU});nX.exports=O2(hX);var jX=j0(),wU=R0(),T2="X-Amz-Algorithm",q2="X-Amz-Credential",DX="X-Amz-Date",C2="X-Amz-SignedHeaders",N2="X-Amz-Expires",xX="X-Amz-Signature",vX="X-Amz-Security-Token",cX="authorization",yX=DX.toLowerCase(),P2="date",j2=[cX,yX,P2],S2=xX.toLowerCase(),XU="x-amz-content-sha256",k2=vX.toLowerCase(),b2={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},h2=/^proxy-/,D2=/^sec-/,WU="AWS4-HMAC-SHA256",x2="AWS4-HMAC-SHA256-PAYLOAD",v2="UNSIGNED-PAYLOAD",c2=50,_X="aws4_request",y2=604800,e=GW(),_2=R0(),C0={},v1=[],c1=N(($,U,G)=>`${$}/${U}/${G}/${_X}`,"createScope"),uX=N(async($,U,G,w,W)=>{const X=await SX($,U.secretAccessKey,U.accessKeyId),L=`${G}:${w}:${W}:${e.toHex(X)}:${U.sessionToken}`;if(L in C0)return C0[L];v1.push(L);while(v1.length>c2)delete C0[v1.shift()];let Z=`AWS4${U.secretAccessKey}`;for(let Y of[G,w,W,_X])Z=await SX($,Z,Y);return C0[L]=Z},"getSigningKey"),u2=N(()=>{v1.length=0,Object.keys(C0).forEach(($)=>{delete C0[$]})},"clearCredentialCache"),SX=N(($,U,G)=>{const w=new $(U);return w.update(_2.toUint8Array(G)),w.digest()},"hmac"),LU=N(({headers:$},U,G)=>{const w={};for(let W of Object.keys($).sort()){if($[W]==null)continue;const X=W.toLowerCase();if(X in b2||(U==null?void 0:U.has(X))||h2.test(X)||D2.test(X)){if(!G||G&&!G.has(X))continue}w[X]=$[W].trim().replace(/\s+/g," ")}return w},"getCanonicalHeaders"),y1=R2(),dX=N(({query:$={}})=>{const U=[],G={};for(let w of Object.keys($)){if(w.toLowerCase()===S2)continue;const W=y1.escapeUri(w);U.push(W);const X=$[w];if(typeof X==="string")G[W]=`${W}=${y1.escapeUri(X)}`;else if(Array.isArray(X))G[W]=X.slice(0).reduce((L,Z)=>L.concat([`${W}=${y1.escapeUri(Z)}`]),[]).sort().join("&")}return U.sort().map((w)=>G[w]).filter((w)=>w).join("&")},"getCanonicalQuery"),d2=K2(),p2=R0(),_1=N(async({headers:$,body:U},G)=>{for(let w of Object.keys($))if(w.toLowerCase()===XU)return $[w];if(U==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof U==="string"||ArrayBuffer.isView(U)||d2.isArrayBuffer(U)){const w=new G;return w.update(p2.toUint8Array(U)),e.toHex(await w.digest())}return v2},"getPayloadHash"),kX=R0(),pX=class ${format(U){const G=[];for(let X of Object.keys(U)){const L=kX.fromUtf8(X);G.push(Uint8Array.from([L.byteLength]),L,this.formatHeaderValue(U[X]))}const w=new Uint8Array(G.reduce((X,L)=>X+L.byteLength,0));let W=0;for(let X of G)w.set(X,W),W+=X.byteLength;return w}formatHeaderValue(U){switch(U.type){case"boolean":return Uint8Array.from([U.value?0:1]);case"byte":return Uint8Array.from([2,U.value]);case"short":const G=new DataView(new ArrayBuffer(3));return G.setUint8(0,3),G.setInt16(1,U.value,!1),new Uint8Array(G.buffer);case"integer":const w=new DataView(new ArrayBuffer(5));return w.setUint8(0,4),w.setInt32(1,U.value,!1),new Uint8Array(w.buffer);case"long":const W=new Uint8Array(9);return W[0]=5,W.set(U.value.bytes,1),W;case"binary":const X=new DataView(new ArrayBuffer(3+U.value.byteLength));X.setUint8(0,6),X.setUint16(1,U.value.byteLength,!1);const L=new Uint8Array(X.buffer);return L.set(U.value,3),L;case"string":const Z=kX.fromUtf8(U.value),Y=new DataView(new ArrayBuffer(3+Z.byteLength));Y.setUint8(0,7),Y.setUint16(1,Z.byteLength,!1);const Q=new Uint8Array(Y.buffer);return Q.set(Z,3),Q;case"timestamp":const z=new Uint8Array(9);return z[0]=8,z.set(l2.fromNumber(U.value.valueOf()).bytes,1),z;case"uuid":if(!s2.test(U.value))throw new Error(`Invalid UUID received: ${U.value}`);const F=new Uint8Array(17);return F[0]=9,F.set(e.fromHex(U.value.replace(/\-/g,"")),1),F}}};N(pX,"HeaderFormatter");var g2=pX,s2=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,gX=class ${constructor(U){if(this.bytes=U,U.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(U){if(U>9223372036854776000||U<-9223372036854776000)throw new Error(`${U} is too large (or, if negative, too small) to represent as an Int64`);const G=new Uint8Array(8);for(let w=7,W=Math.abs(Math.round(U));w>-1&&W>0;w--,W/=256)G[w]=W;if(U<0)ZU(G);return new $(G)}valueOf(){const U=this.bytes.slice(0),G=U[0]&128;if(G)ZU(U);return parseInt(e.toHex(U),16)*(G?-1:1)}toString(){return String(this.valueOf())}};N(gX,"Int64");var l2=gX;N(ZU,"negate");var m2=N(($,U)=>{$=$.toLowerCase();for(let G of Object.keys(U))if($===G.toLowerCase())return!0;return!1},"hasHeader"),sX=w0(),lX=N(($,U={})=>{var G;const{headers:w,query:W={}}=sX.HttpRequest.clone($);for(let X of Object.keys(w)){const L=X.toLowerCase();if(L.slice(0,6)==="x-amz-"&&!((G=U.unhoistableHeaders)==null?void 0:G.has(L)))W[X]=w[X],delete w[X]}return{...$,headers:w,query:W}},"moveHeadersToQuery"),YU=N(($)=>{$=sX.HttpRequest.clone($);for(let U of Object.keys($.headers))if(j2.indexOf(U.toLowerCase())>-1)delete $.headers[U];return $},"prepareRequest"),n2=N(($)=>i2($).toISOString().replace(/\.\d{3}Z$/,"Z"),"iso8601"),i2=N(($)=>{if(typeof $==="number")return new Date($*1000);if(typeof $==="string"){if(Number($))return new Date(Number($)*1000);return new Date($)}return $},"toDate"),mX=class ${constructor({applyChecksum:U,credentials:G,region:w,service:W,sha256:X,uriEscapePath:L=!0}){this.headerFormatter=new g2,this.service=W,this.sha256=X,this.uriEscapePath=L,this.applyChecksum=typeof U==="boolean"?U:!0,this.regionProvider=jX.normalizeProvider(w),this.credentialProvider=jX.normalizeProvider(G)}async presign(U,G={}){const{signingDate:w=new Date,expiresIn:W=3600,unsignableHeaders:X,unhoistableHeaders:L,signableHeaders:Z,signingRegion:Y,signingService:Q}=G,z=await this.credentialProvider();this.validateResolvedCredentials(z);const F=Y??await this.regionProvider(),{longDate:J,shortDate:f}=x1(w);if(W>y2)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const R=c1(f,F,Q??this.service),K=lX(YU(U),{unhoistableHeaders:L});if(z.sessionToken)K.query[vX]=z.sessionToken;K.query[T2]=WU,K.query[q2]=`${z.accessKeyId}/${R}`,K.query[DX]=J,K.query[N2]=W.toString(10);const H=LU(K,X,Z);return K.query[C2]=bX(H),K.query[xX]=await this.getSignature(J,R,this.getSigningKey(z,F,f,Q),this.createCanonicalRequest(K,H,await _1(U,this.sha256))),K}async sign(U,G){if(typeof U==="string")return this.signString(U,G);else if(U.headers&&U.payload)return this.signEvent(U,G);else if(U.message)return this.signMessage(U,G);else return this.signRequest(U,G)}async signEvent({headers:U,payload:G},{signingDate:w=new Date,priorSignature:W,signingRegion:X,signingService:L}){const Z=X??await this.regionProvider(),{shortDate:Y,longDate:Q}=x1(w),z=c1(Y,Z,L??this.service),F=await _1({headers:{},body:G},this.sha256),J=new this.sha256;J.update(U);const f=e.toHex(await J.digest()),R=[x2,Q,z,W,f,F].join("\n");return this.signString(R,{signingDate:w,signingRegion:Z,signingService:L})}async signMessage(U,{signingDate:G=new Date,signingRegion:w,signingService:W}){return this.signEvent({headers:this.headerFormatter.format(U.message.headers),payload:U.message.body},{signingDate:G,signingRegion:w,signingService:W,priorSignature:U.priorSignature}).then((L)=>{return{message:U.message,signature:L}})}async signString(U,{signingDate:G=new Date,signingRegion:w,signingService:W}={}){const X=await this.credentialProvider();this.validateResolvedCredentials(X);const L=w??await this.regionProvider(),{shortDate:Z}=x1(G),Y=new this.sha256(await this.getSigningKey(X,L,Z,W));return Y.update(wU.toUint8Array(U)),e.toHex(await Y.digest())}async signRequest(U,{signingDate:G=new Date,signableHeaders:w,unsignableHeaders:W,signingRegion:X,signingService:L}={}){const Z=await this.credentialProvider();this.validateResolvedCredentials(Z);const Y=X??await this.regionProvider(),Q=YU(U),{longDate:z,shortDate:F}=x1(G),J=c1(F,Y,L??this.service);if(Q.headers[yX]=z,Z.sessionToken)Q.headers[k2]=Z.sessionToken;const f=await _1(Q,this.sha256);if(!m2(XU,Q.headers)&&this.applyChecksum)Q.headers[XU]=f;const R=LU(Q,W,w),K=await this.getSignature(z,J,this.getSigningKey(Z,Y,F,L),this.createCanonicalRequest(Q,R,f));return Q.headers[cX]=`${WU} Credential=${Z.accessKeyId}/${J}, SignedHeaders=${bX(R)}, Signature=${K}`,Q}createCanonicalRequest(U,G,w){const W=Object.keys(G).sort();return`${U.method}
|
|
10
|
+
${this.getCanonicalPath(U)}
|
|
11
|
+
${dX(U)}
|
|
12
|
+
${W.map((X)=>`${X}:${G[X]}`).join("\n")}
|
|
13
|
+
|
|
14
|
+
${W.join(";")}
|
|
15
|
+
${w}`}async createStringToSign(U,G,w){const W=new this.sha256;W.update(wU.toUint8Array(w));const X=await W.digest();return`${WU}
|
|
16
|
+
${U}
|
|
17
|
+
${G}
|
|
18
|
+
${e.toHex(X)}`}getCanonicalPath({path:U}){if(this.uriEscapePath){const G=[];for(let X of U.split("/")){if((X==null?void 0:X.length)===0)continue;if(X===".")continue;if(X==="..")G.pop();else G.push(X)}const w=`${(U==null?void 0:U.startsWith("/"))?"/":""}${G.join("/")}${G.length>0&&(U==null?void 0:U.endsWith("/"))?"/":""}`;return y1.escapeUri(w).replace(/%2F/g,"/")}return U}async getSignature(U,G,w,W){const X=await this.createStringToSign(U,G,W),L=new this.sha256(await w);return L.update(wU.toUint8Array(X)),e.toHex(await L.digest())}getSigningKey(U,G,w,W){return uX(this.sha256,U,w,G,W||this.service)}validateResolvedCredentials(U){if(typeof U!=="object"||typeof U.accessKeyId!=="string"||typeof U.secretAccessKey!=="string")throw new Error("Resolved credential object is not valid")}};N(mX,"SignatureV4");var r2=mX,x1=N(($)=>{const U=n2($).replace(/[\-:]/g,"");return{longDate:U,shortDate:U.slice(0,8)}},"formatDate"),bX=N(($)=>Object.keys($).sort().join(";"),"getCanonicalHeaderList")});var WL=I((qK,wL)=>{var{defineProperty:d1,getOwnPropertyDescriptor:o2,getOwnPropertyNames:a2}=Object,t2=Object.prototype.hasOwnProperty,b=($,U)=>d1($,"name",{value:U,configurable:!0}),e2=($,U)=>{for(var G in U)d1($,G,{get:U[G],enumerable:!0})},$Q=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of a2(U))if(!t2.call($,W)&&W!==G)d1($,W,{get:()=>U[W],enumerable:!(w=o2(U,W))||w.enumerable})}return $},UQ=($)=>$Q(d1({},"__esModule",{value:!0}),$),eX={};e2(eX,{AWSSDKSigV4Signer:()=>XQ,AwsSdkSigV4ASigner:()=>ZQ,AwsSdkSigV4Signer:()=>FU,NODE_SIGV4A_CONFIG_OPTIONS:()=>zQ,resolveAWSSDKSigV4Config:()=>FQ,resolveAwsSdkSigV4AConfig:()=>QQ,resolveAwsSdkSigV4Config:()=>GL,validateSigningProperties:()=>zU});wL.exports=UQ(eX);var GQ=w0(),wQ=w0(),rX=b(($)=>{var U,G;return wQ.HttpResponse.isInstance($)?((U=$.headers)==null?void 0:U.date)??((G=$.headers)==null?void 0:G.Date):void 0},"getDateHeader"),QU=b(($)=>new Date(Date.now()+$),"getSkewCorrectedDate"),WQ=b(($,U)=>Math.abs(QU(U).getTime()-$)>=300000,"isClockSkewed"),oX=b(($,U)=>{const G=Date.parse($);if(WQ(G,U))return G-Date.now();return U},"getUpdatedSystemClockOffset"),m0=b(($,U)=>{if(!U)throw new Error(`Property \`${$}\` is not resolved for AWS SDK SigV4Auth`);return U},"throwSigningPropertyError"),zU=b(async($)=>{var U,G,w;const W=m0("context",$.context),X=m0("config",$.config),L=(w=(G=(U=W.endpointV2)==null?void 0:U.properties)==null?void 0:G.authSchemes)==null?void 0:w[0],Y=await m0("signer",X.signer)(L),Q=$==null?void 0:$.signingRegion,z=$==null?void 0:$.signingRegionSet,F=$==null?void 0:$.signingName;return{config:X,signer:Y,signingRegion:Q,signingRegionSet:z,signingName:F}},"validateSigningProperties"),$L=class ${async sign(U,G,w){var W;if(!GQ.HttpRequest.isInstance(U))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const X=await zU(w),{config:L,signer:Z}=X;let{signingRegion:Y,signingName:Q}=X;const z=w.context;if(((W=z==null?void 0:z.authSchemes)==null?void 0:W.length)??0>1){const[J,f]=z.authSchemes;if((J==null?void 0:J.name)==="sigv4a"&&(f==null?void 0:f.name)==="sigv4")Y=(f==null?void 0:f.signingRegion)??Y,Q=(f==null?void 0:f.signingName)??Q}return await Z.sign(U,{signingDate:QU(L.systemClockOffset),signingRegion:Y,signingService:Q})}errorHandler(U){return(G)=>{const w=G.ServerTime??rX(G.$response);if(w){const W=m0("config",U.config),X=W.systemClockOffset;if(W.systemClockOffset=oX(w,W.systemClockOffset),W.systemClockOffset!==X&&G.$metadata)G.$metadata.clockSkewCorrected=!0}throw G}}successHandler(U,G){const w=rX(U);if(w){const W=m0("config",G.config);W.systemClockOffset=oX(w,W.systemClockOffset)}}};b($L,"AwsSdkSigV4Signer");var FU=$L,XQ=FU,LQ=w0(),UL=class $ extends FU{async sign(U,G,w){var W;if(!LQ.HttpRequest.isInstance(U))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:X,signer:L,signingRegion:Z,signingRegionSet:Y,signingName:Q}=await zU(w),F=(await((W=X.sigv4aSigningRegionSet)==null?void 0:W.call(X))??Y??[Z]).join(",");return await L.sign(U,{signingDate:QU(X.systemClockOffset),signingRegion:F,signingService:Q})}};b(UL,"AwsSdkSigV4ASigner");var ZQ=UL,YQ=c$(),aX=Z$(),QQ=b(($)=>{return $.sigv4aSigningRegionSet=YQ.normalizeProvider($.sigv4aSigningRegionSet),$},"resolveAwsSdkSigV4AConfig"),zQ={environmentVariableSelector($){if($.AWS_SIGV4A_SIGNING_REGION_SET)return $.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((U)=>U.trim());throw new aX.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((U)=>U.trim());throw new aX.ProviderError("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},Q0=c$(),tX=iX(),GL=b(($)=>{let U;if($.credentials)U=Q0.memoizeIdentityProvider($.credentials,Q0.isIdentityExpired,Q0.doesIdentityRequireRefresh);if(!U)if($.credentialDefaultProvider)U=Q0.normalizeProvider($.credentialDefaultProvider(Object.assign({},$,{parentClientConfig:$})));else U=b(async()=>{throw new Error("`credentials` is missing")},"normalizedCreds");const{signingEscapePath:G=!0,systemClockOffset:w=$.systemClockOffset||0,sha256:W}=$;let X;if($.signer)X=Q0.normalizeProvider($.signer);else if($.regionInfoProvider)X=b(()=>Q0.normalizeProvider($.region)().then(async(L)=>[await $.regionInfoProvider(L,{useFipsEndpoint:await $.useFipsEndpoint(),useDualstackEndpoint:await $.useDualstackEndpoint()})||{},L]).then(([L,Z])=>{const{signingRegion:Y,signingService:Q}=L;$.signingRegion=$.signingRegion||Y||Z,$.signingName=$.signingName||Q||$.serviceId;const z={...$,credentials:U,region:$.signingRegion,service:$.signingName,sha256:W,uriEscapePath:G};return new($.signerConstructor||tX.SignatureV4)(z)}),"signer");else X=b(async(L)=>{L=Object.assign({},{name:"sigv4",signingName:$.signingName||$.defaultSigningName,signingRegion:await Q0.normalizeProvider($.region)(),properties:{}},L);const{signingRegion:Z,signingName:Y}=L;$.signingRegion=$.signingRegion||Z,$.signingName=$.signingName||Y||$.serviceId;const Q={...$,credentials:U,region:$.signingRegion,service:$.signingName,sha256:W,uriEscapePath:G};return new($.signerConstructor||tX.SignatureV4)(Q)},"signer");return{...$,systemClockOffset:w,signingEscapePath:G,credentials:U,signer:X}},"resolveAwsSdkSigV4Config"),FQ=GL});var p1=I((RQ)=>{var JQ=":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",XL="[: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]["+JQ+"]*",MQ=new RegExp("^"+XL+"$"),fQ=function($,U){const G=[];let w=U.exec($);while(w){const W=[];W.startIndex=U.lastIndex-w[0].length;const X=w.length;for(let L=0;L<X;L++)W.push(w[L]);G.push(W),w=U.exec($)}return G},IQ=function($){const U=MQ.exec($);return!(U===null||typeof U==="undefined")};RQ.isExist=function($){return typeof $!=="undefined"};RQ.isEmptyObject=function($){return Object.keys($).length===0};RQ.merge=function($,U,G){if(U){const w=Object.keys(U),W=w.length;for(let X=0;X<W;X++)if(G==="strict")$[w[X]]=[U[w[X]]];else $[w[X]]=U[w[X]]}};RQ.getValue=function($){if(RQ.isExist($))return $;else return""};RQ.isName=IQ;RQ.getAllMatches=fQ;RQ.nameRegexp=XL});var MU=I((bQ)=>{var ZL=function($){return $===" "||$==="\t"||$==="\n"||$==="\r"},YL=function($,U){const G=U;for(;U<$.length;U++)if($[U]=="?"||$[U]==" "){const w=$.substr(G,U-G);if(U>5&&w==="xml")return q("InvalidXml","XML declaration allowed only at the start of the document.",S($,U));else if($[U]=="?"&&$[U+1]==">"){U++;break}else continue}return U},QL=function($,U){if($.length>U+5&&$[U+1]==="-"&&$[U+2]==="-"){for(U+=3;U<$.length;U++)if($[U]==="-"&&$[U+1]==="-"&&$[U+2]===">"){U+=2;break}}else if($.length>U+8&&$[U+1]==="D"&&$[U+2]==="O"&&$[U+3]==="C"&&$[U+4]==="T"&&$[U+5]==="Y"&&$[U+6]==="P"&&$[U+7]==="E"){let G=1;for(U+=8;U<$.length;U++)if($[U]==="<")G++;else if($[U]===">"){if(G--,G===0)break}}else if($.length>U+9&&$[U+1]==="["&&$[U+2]==="C"&&$[U+3]==="D"&&$[U+4]==="A"&&$[U+5]==="T"&&$[U+6]==="A"&&$[U+7]==="["){for(U+=8;U<$.length;U++)if($[U]==="]"&&$[U+1]==="]"&&$[U+2]===">"){U+=2;break}}return U},CQ=function($,U){let G="",w="",W=!1;for(;U<$.length;U++){if($[U]===TQ||$[U]===qQ)if(w==="")w=$[U];else if(w!==$[U]);else w="";else if($[U]===">"){if(w===""){W=!0;break}}G+=$[U]}if(w!=="")return!1;return{value:G,index:U,tagClosed:W}},zL=function($,U){const G=JU.getAllMatches($,NQ),w={};for(let W=0;W<G.length;W++){if(G[W][1].length===0)return q("InvalidAttr","Attribute '"+G[W][2]+"' has no space in starting.",n0(G[W]));else if(G[W][3]!==void 0&&G[W][4]===void 0)return q("InvalidAttr","Attribute '"+G[W][2]+"' is without value.",n0(G[W]));else if(G[W][3]===void 0&&!U.allowBooleanAttributes)return q("InvalidAttr","boolean attribute '"+G[W][2]+"' is not allowed.",n0(G[W]));const X=G[W][2];if(!SQ(X))return q("InvalidAttr","Attribute '"+X+"' is an invalid name.",n0(G[W]));if(!w.hasOwnProperty(X))w[X]=1;else return q("InvalidAttr","Attribute '"+X+"' is repeated.",n0(G[W]))}return!0},PQ=function($,U){let G=/\d/;if($[U]==="x")U++,G=/[\da-fA-F]/;for(;U<$.length;U++){if($[U]===";")return U;if(!$[U].match(G))break}return-1},jQ=function($,U){if(U++,$[U]===";")return-1;if($[U]==="#")return U++,PQ($,U);let G=0;for(;U<$.length;U++,G++){if($[U].match(/\w/)&&G<20)continue;if($[U]===";")break;return-1}return U},q=function($,U,G){return{err:{code:$,msg:U,line:G.line||G,col:G.col}}},SQ=function($){return JU.isName($)},kQ=function($){return JU.isName($)},S=function($,U){const G=$.substring(0,U).split(/\r?\n/);return{line:G.length,col:G[G.length-1].length+1}},n0=function($){return $.startIndex+$[1].length},JU=p1(),OQ={allowBooleanAttributes:!1,unpairedTags:[]};bQ.validate=function($,U){U=Object.assign({},OQ,U);const G=[];let w=!1,W=!1;if($[0]==="\uFEFF")$=$.substr(1);for(let X=0;X<$.length;X++)if($[X]==="<"&&$[X+1]==="?"){if(X+=2,X=YL($,X),X.err)return X}else if($[X]==="<"){let L=X;if(X++,$[X]==="!"){X=QL($,X);continue}else{let Z=!1;if($[X]==="/")Z=!0,X++;let Y="";for(;X<$.length&&$[X]!==">"&&$[X]!==" "&&$[X]!=="\t"&&$[X]!=="\n"&&$[X]!=="\r";X++)Y+=$[X];if(Y=Y.trim(),Y[Y.length-1]==="/")Y=Y.substring(0,Y.length-1),X--;if(!kQ(Y)){let F;if(Y.trim().length===0)F="Invalid space after '<'.";else F="Tag '"+Y+"' is an invalid name.";return q("InvalidTag",F,S($,X))}const Q=CQ($,X);if(Q===!1)return q("InvalidAttr","Attributes for '"+Y+"' have open quote.",S($,X));let z=Q.value;if(X=Q.index,z[z.length-1]==="/"){const F=X-z.length;z=z.substring(0,z.length-1);const J=zL(z,U);if(J===!0)w=!0;else return q(J.err.code,J.err.msg,S($,F+J.err.line))}else if(Z)if(!Q.tagClosed)return q("InvalidTag","Closing tag '"+Y+"' doesn't have proper closing.",S($,X));else if(z.trim().length>0)return q("InvalidTag","Closing tag '"+Y+"' can't have attributes or invalid starting.",S($,L));else if(G.length===0)return q("InvalidTag","Closing tag '"+Y+"' has not been opened.",S($,L));else{const F=G.pop();if(Y!==F.tagName){let J=S($,F.tagStartPos);return q("InvalidTag","Expected closing tag '"+F.tagName+"' (opened in line "+J.line+", col "+J.col+") instead of closing tag '"+Y+"'.",S($,L))}if(G.length==0)W=!0}else{const F=zL(z,U);if(F!==!0)return q(F.err.code,F.err.msg,S($,X-z.length+F.err.line));if(W===!0)return q("InvalidXml","Multiple possible root nodes found.",S($,X));else if(U.unpairedTags.indexOf(Y)!==-1);else G.push({tagName:Y,tagStartPos:L});w=!0}for(X++;X<$.length;X++)if($[X]==="<")if($[X+1]==="!"){X++,X=QL($,X);continue}else if($[X+1]==="?"){if(X=YL($,++X),X.err)return X}else break;else if($[X]==="&"){const F=jQ($,X);if(F==-1)return q("InvalidChar","char '&' is not expected.",S($,X));X=F}else if(W===!0&&!ZL($[X]))return q("InvalidXml","Extra text at the end",S($,X));if($[X]==="<")X--}}else{if(ZL($[X]))continue;return q("InvalidChar","char '"+$[X]+"' is not expected.",S($,X))}if(!w)return q("InvalidXml","Start tag expected.",1);else if(G.length==1)return q("InvalidTag","Unclosed tag '"+G[0].tagName+"'.",S($,G[0].tagStartPos));else if(G.length>0)return q("InvalidXml","Invalid '"+JSON.stringify(G.map((X)=>X.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1});return!0};var TQ='"',qQ="'",NQ=new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s\\S])*?)\\5)?',"g")});var JL=I((xQ)=>{var FL={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($,U){return U},attributeValueProcessor:function($,U){return U},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function($,U,G){return $}},DQ=function($){return Object.assign({},FL,$)};xQ.buildOptions=DQ;xQ.defaultOptions=FL});var IL=I((jK,fL)=>{class ML{constructor($){this.tagname=$,this.child=[],this[":@"]={}}add($,U){if($==="__proto__")$="#__proto__";this.child.push({[$]:U})}addChild($){if($.tagname==="__proto__")$.tagname="#__proto__";if($[":@"]&&Object.keys($[":@"]).length>0)this.child.push({[$.tagname]:$.child,[":@"]:$[":@"]});else this.child.push({[$.tagname]:$.child})}}fL.exports=ML});var KL=I((SK,RL)=>{var _Q=function($,U){const G={};if($[U+3]==="O"&&$[U+4]==="C"&&$[U+5]==="T"&&$[U+6]==="Y"&&$[U+7]==="P"&&$[U+8]==="E"){U=U+9;let w=1,W=!1,X=!1,L="";for(;U<$.length;U++)if($[U]==="<"&&!X){if(W&&pQ($,U)){if(U+=7,[entityName,val,U]=uQ($,U+1),val.indexOf("&")===-1)G[mQ(entityName)]={regx:RegExp(`&${entityName};`,"g"),val}}else if(W&&gQ($,U))U+=8;else if(W&&sQ($,U))U+=8;else if(W&&lQ($,U))U+=9;else if(dQ)X=!0;else throw new Error("Invalid DOCTYPE");w++,L=""}else if($[U]===">"){if(X){if($[U-1]==="-"&&$[U-2]==="-")X=!1,w--}else w--;if(w===0)break}else if($[U]==="[")W=!0;else L+=$[U];if(w!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:G,i:U}},uQ=function($,U){let G="";for(;U<$.length&&($[U]!=="'"&&$[U]!=='"');U++)G+=$[U];if(G=G.trim(),G.indexOf(" ")!==-1)throw new Error("External entites are not supported");const w=$[U++];let W="";for(;U<$.length&&$[U]!==w;U++)W+=$[U];return[G,W,U]},dQ=function($,U){if($[U+1]==="!"&&$[U+2]==="-"&&$[U+3]==="-")return!0;return!1},pQ=function($,U){if($[U+1]==="!"&&$[U+2]==="E"&&$[U+3]==="N"&&$[U+4]==="T"&&$[U+5]==="I"&&$[U+6]==="T"&&$[U+7]==="Y")return!0;return!1},gQ=function($,U){if($[U+1]==="!"&&$[U+2]==="E"&&$[U+3]==="L"&&$[U+4]==="E"&&$[U+5]==="M"&&$[U+6]==="E"&&$[U+7]==="N"&&$[U+8]==="T")return!0;return!1},sQ=function($,U){if($[U+1]==="!"&&$[U+2]==="A"&&$[U+3]==="T"&&$[U+4]==="T"&&$[U+5]==="L"&&$[U+6]==="I"&&$[U+7]==="S"&&$[U+8]==="T")return!0;return!1},lQ=function($,U){if($[U+1]==="!"&&$[U+2]==="N"&&$[U+3]==="O"&&$[U+4]==="T"&&$[U+5]==="A"&&$[U+6]==="T"&&$[U+7]==="I"&&$[U+8]==="O"&&$[U+9]==="N")return!0;return!1},mQ=function($){if(yQ.isName($))return $;else throw new Error(`Invalid entity name ${$}`)},yQ=p1();RL.exports=_Q});var EL=I((kK,BL)=>{var oQ=function($,U={}){if(U=Object.assign({},rQ,U),!$||typeof $!=="string")return $;let G=$.trim();if(U.skipLike!==void 0&&U.skipLike.test(G))return $;else if(U.hex&&nQ.test(G))return Number.parseInt(G,16);else{const w=iQ.exec(G);if(w){const W=w[1],X=w[2];let L=aQ(w[3]);const Z=w[4]||w[6];if(!U.leadingZeros&&X.length>0&&W&&G[2]!==".")return $;else if(!U.leadingZeros&&X.length>0&&!W&&G[1]!==".")return $;else{const Y=Number(G),Q=""+Y;if(Q.search(/[eE]/)!==-1)if(U.eNotation)return Y;else return $;else if(Z)if(U.eNotation)return Y;else return $;else if(G.indexOf(".")!==-1)if(Q==="0"&&L==="")return Y;else if(Q===L)return Y;else if(W&&Q==="-"+L)return Y;else return $;if(X)if(L===Q)return Y;else if(W+L===Q)return Y;else return $;if(G===Q)return Y;else if(G===W+Q)return Y;return $}}else return $}},aQ=function($){if($&&$.indexOf(".")!==-1){if($=$.replace(/0+$/,""),$===".")$="0";else if($[0]===".")$="0"+$;else if($[$.length-1]===".")$=$.substr(0,$.length-1);return $}return $},nQ=/^[-+]?0x[a-fA-F0-9]+$/,iQ=/^([\-\+])?(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 rQ={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};BL.exports=oQ});var OL=I((bK,HL)=>{var $z=function($){const U=Object.keys($);for(let G=0;G<U.length;G++){const w=U[G];this.lastEntities[w]={regex:new RegExp("&"+w+";","g"),val:$[w]}}},Uz=function($,U,G,w,W,X,L){if($!==void 0){if(this.options.trimValues&&!w)$=$.trim();if($.length>0){if(!L)$=this.replaceEntitiesValue($);const Z=this.options.tagValueProcessor(U,$,G,W,X);if(Z===null||Z===void 0)return $;else if(typeof Z!==typeof $||Z!==$)return Z;else if(this.options.trimValues)return IU($,this.options.parseTagValue,this.options.numberParseOptions);else if($.trim()===$)return IU($,this.options.parseTagValue,this.options.numberParseOptions);else return $}}},Gz=function($){if(this.options.removeNSPrefix){const U=$.split(":"),G=$.charAt(0)==="/"?"/":"";if(U[0]==="xmlns")return"";if(U.length===2)$=G+U[1]}return $},Wz=function($,U,G){if(!this.options.ignoreAttributes&&typeof $==="string"){const w=AL.getAllMatches($,wz),W=w.length,X={};for(let L=0;L<W;L++){const Z=this.resolveNameSpace(w[L][1]);let Y=w[L][4],Q=this.options.attributeNamePrefix+Z;if(Z.length){if(this.options.transformAttributeName)Q=this.options.transformAttributeName(Q);if(Q==="__proto__")Q="#__proto__";if(Y!==void 0){if(this.options.trimValues)Y=Y.trim();Y=this.replaceEntitiesValue(Y);const z=this.options.attributeValueProcessor(Z,Y,U);if(z===null||z===void 0)X[Q]=Y;else if(typeof z!==typeof Y||z!==Y)X[Q]=z;else X[Q]=IU(Y,this.options.parseAttributeValue,this.options.numberParseOptions)}else if(this.options.allowBooleanAttributes)X[Q]=!0}}if(!Object.keys(X).length)return;if(this.options.attributesGroupName){const L={};return L[this.options.attributesGroupName]=X,L}return X}},Lz=function($,U,G){const w=this.options.updateTag(U.tagname,G,U[":@"]);if(w===!1);else if(typeof w==="string")U.tagname=w,$.addChild(U);else $.addChild(U)},Yz=function($,U,G,w){if($){if(w===void 0)w=Object.keys(U.child).length===0;if($=this.parseTextData($,U.tagname,G,!1,U[":@"]?Object.keys(U[":@"]).length!==0:!1,w),$!==void 0&&$!=="")U.add(this.options.textNodeName,$);$=""}return $},Qz=function($,U,G){const w="*."+G;for(let W in $){const X=$[W];if(w===X||U===X)return!0}return!1},zz=function($,U,G=">"){let w,W="";for(let X=U;X<$.length;X++){let L=$[X];if(w){if(L===w)w=""}else if(L==='"'||L==="'")w=L;else if(L===G[0])if(G[1]){if($[X+1]===G[1])return{data:W,index:X}}else return{data:W,index:X};else if(L==="\t")L=" ";W+=L}},z0=function($,U,G,w){const W=$.indexOf(U,G);if(W===-1)throw new Error(w);else return W+U.length-1},fU=function($,U,G,w=">"){const W=zz($,U+1,w);if(!W)return;let X=W.data;const L=W.index,Z=X.search(/\s/);let Y=X,Q=!0;if(Z!==-1)Y=X.substring(0,Z),X=X.substring(Z+1).trimStart();const z=Y;if(G){const F=Y.indexOf(":");if(F!==-1)Y=Y.substr(F+1),Q=Y!==W.data.substr(F+1)}return{tagName:Y,tagExp:X,closeIndex:L,attrExpPresent:Q,rawTagName:z}},Fz=function($,U,G){const w=G;let W=1;for(;G<$.length;G++)if($[G]==="<")if($[G+1]==="/"){const X=z0($,">",G,`${U} is not closed`);if($.substring(G+2,X).trim()===U){if(W--,W===0)return{tagContent:$.substring(w,G),i:X}}G=X}else if($[G+1]==="?")G=z0($,"?>",G+1,"StopNode is not closed.");else if($.substr(G+1,3)==="!--")G=z0($,"-->",G+3,"StopNode is not closed.");else if($.substr(G+1,2)==="![")G=z0($,"]]>",G,"StopNode is not closed.")-2;else{const X=fU($,G,">");if(X){if((X&&X.tagName)===U&&X.tagExp[X.tagExp.length-1]!=="/")W++;G=X.closeIndex}}},IU=function($,U,G){if(U&&typeof $==="string"){const w=$.trim();if(w==="true")return!0;else if(w==="false")return!1;else return eQ($,G)}else if(AL.isExist($))return $;else return""},AL=p1(),i0=IL(),tQ=KL(),eQ=EL();class VL{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:(U,G)=>String.fromCharCode(Number.parseInt(G,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(U,G)=>String.fromCharCode(Number.parseInt(G,16))}},this.addExternalEntities=$z,this.parseXml=Xz,this.parseTextData=Uz,this.resolveNameSpace=Gz,this.buildAttributesMap=Wz,this.isItStopNode=Qz,this.replaceEntitiesValue=Zz,this.readStopNodeData=Fz,this.saveTextToParentTag=Yz,this.addChild=Lz}}var wz=new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?',"gm"),Xz=function($){$=$.replace(/\r\n?/g,"\n");const U=new i0("!xml");let G=U,w="",W="";for(let X=0;X<$.length;X++)if($[X]==="<")if($[X+1]==="/"){const Z=z0($,">",X,"Closing Tag is not closed.");let Y=$.substring(X+2,Z).trim();if(this.options.removeNSPrefix){const F=Y.indexOf(":");if(F!==-1)Y=Y.substr(F+1)}if(this.options.transformTagName)Y=this.options.transformTagName(Y);if(G)w=this.saveTextToParentTag(w,G,W);const Q=W.substring(W.lastIndexOf(".")+1);if(Y&&this.options.unpairedTags.indexOf(Y)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${Y}>`);let z=0;if(Q&&this.options.unpairedTags.indexOf(Q)!==-1)z=W.lastIndexOf(".",W.lastIndexOf(".")-1),this.tagsNodeStack.pop();else z=W.lastIndexOf(".");W=W.substring(0,z),G=this.tagsNodeStack.pop(),w="",X=Z}else if($[X+1]==="?"){let Z=fU($,X,!1,"?>");if(!Z)throw new Error("Pi Tag is not closed.");if(w=this.saveTextToParentTag(w,G,W),this.options.ignoreDeclaration&&Z.tagName==="?xml"||this.options.ignorePiTags);else{const Y=new i0(Z.tagName);if(Y.add(this.options.textNodeName,""),Z.tagName!==Z.tagExp&&Z.attrExpPresent)Y[":@"]=this.buildAttributesMap(Z.tagExp,W,Z.tagName);this.addChild(G,Y,W)}X=Z.closeIndex+1}else if($.substr(X+1,3)==="!--"){const Z=z0($,"-->",X+4,"Comment is not closed.");if(this.options.commentPropName){const Y=$.substring(X+4,Z-2);w=this.saveTextToParentTag(w,G,W),G.add(this.options.commentPropName,[{[this.options.textNodeName]:Y}])}X=Z}else if($.substr(X+1,2)==="!D"){const Z=tQ($,X);this.docTypeEntities=Z.entities,X=Z.i}else if($.substr(X+1,2)==="!["){const Z=z0($,"]]>",X,"CDATA is not closed.")-2,Y=$.substring(X+9,Z);w=this.saveTextToParentTag(w,G,W);let Q=this.parseTextData(Y,G.tagname,W,!0,!1,!0,!0);if(Q==null)Q="";if(this.options.cdataPropName)G.add(this.options.cdataPropName,[{[this.options.textNodeName]:Y}]);else G.add(this.options.textNodeName,Q);X=Z+2}else{let Z=fU($,X,this.options.removeNSPrefix),Y=Z.tagName;const Q=Z.rawTagName;let{tagExp:z,attrExpPresent:F,closeIndex:J}=Z;if(this.options.transformTagName)Y=this.options.transformTagName(Y);if(G&&w){if(G.tagname!=="!xml")w=this.saveTextToParentTag(w,G,W,!1)}const f=G;if(f&&this.options.unpairedTags.indexOf(f.tagname)!==-1)G=this.tagsNodeStack.pop(),W=W.substring(0,W.lastIndexOf("."));if(Y!==U.tagname)W+=W?"."+Y:Y;if(this.isItStopNode(this.options.stopNodes,W,Y)){let R="";if(z.length>0&&z.lastIndexOf("/")===z.length-1){if(Y[Y.length-1]==="/")Y=Y.substr(0,Y.length-1),W=W.substr(0,W.length-1),z=Y;else z=z.substr(0,z.length-1);X=Z.closeIndex}else if(this.options.unpairedTags.indexOf(Y)!==-1)X=Z.closeIndex;else{const H=this.readStopNodeData($,Q,J+1);if(!H)throw new Error(`Unexpected end of ${Q}`);X=H.i,R=H.tagContent}const K=new i0(Y);if(Y!==z&&F)K[":@"]=this.buildAttributesMap(z,W,Y);if(R)R=this.parseTextData(R,Y,W,!0,F,!0,!0);W=W.substr(0,W.lastIndexOf(".")),K.add(this.options.textNodeName,R),this.addChild(G,K,W)}else{if(z.length>0&&z.lastIndexOf("/")===z.length-1){if(Y[Y.length-1]==="/")Y=Y.substr(0,Y.length-1),W=W.substr(0,W.length-1),z=Y;else z=z.substr(0,z.length-1);if(this.options.transformTagName)Y=this.options.transformTagName(Y);const R=new i0(Y);if(Y!==z&&F)R[":@"]=this.buildAttributesMap(z,W,Y);this.addChild(G,R,W),W=W.substr(0,W.lastIndexOf("."))}else{const R=new i0(Y);if(this.tagsNodeStack.push(G),Y!==z&&F)R[":@"]=this.buildAttributesMap(z,W,Y);this.addChild(G,R,W),G=R}w="",X=J}}else w+=$[X];return U.child},Zz=function($){if(this.options.processEntities){for(let U in this.docTypeEntities){const G=this.docTypeEntities[U];$=$.replace(G.regx,G.val)}for(let U in this.lastEntities){const G=this.lastEntities[U];$=$.replace(G.regex,G.val)}if(this.options.htmlEntities)for(let U in this.htmlEntities){const G=this.htmlEntities[U];$=$.replace(G.regex,G.val)}$=$.replace(this.ampEntity.regex,this.ampEntity.val)}return $};HL.exports=VL});var qL=I((Rz)=>{var Jz=function($,U){return TL($,U)},TL=function($,U,G){let w;const W={};for(let X=0;X<$.length;X++){const L=$[X],Z=Mz(L);let Y="";if(G===void 0)Y=Z;else Y=G+"."+Z;if(Z===U.textNodeName)if(w===void 0)w=L[Z];else w+=""+L[Z];else if(Z===void 0)continue;else if(L[Z]){let Q=TL(L[Z],U,Y);const z=Iz(Q,U);if(L[":@"])fz(Q,L[":@"],Y,U);else if(Object.keys(Q).length===1&&Q[U.textNodeName]!==void 0&&!U.alwaysCreateTextNode)Q=Q[U.textNodeName];else if(Object.keys(Q).length===0)if(U.alwaysCreateTextNode)Q[U.textNodeName]="";else Q="";if(W[Z]!==void 0&&W.hasOwnProperty(Z)){if(!Array.isArray(W[Z]))W[Z]=[W[Z]];W[Z].push(Q)}else if(U.isArray(Z,Y,z))W[Z]=[Q];else W[Z]=Q}}if(typeof w==="string"){if(w.length>0)W[U.textNodeName]=w}else if(w!==void 0)W[U.textNodeName]=w;return W},Mz=function($){const U=Object.keys($);for(let G=0;G<U.length;G++){const w=U[G];if(w!==":@")return w}},fz=function($,U,G,w){if(U){const W=Object.keys(U),X=W.length;for(let L=0;L<X;L++){const Z=W[L];if(w.isArray(Z,G+"."+Z,!0,!0))$[Z]=[U[Z]];else $[Z]=U[Z]}}},Iz=function($,U){const{textNodeName:G}=U,w=Object.keys($).length;if(w===0)return!0;if(w===1&&($[G]||typeof $[G]==="boolean"||$[G]===0))return!0;return!1};Rz.prettify=Jz});var PL=I((DK,NL)=>{var{buildOptions:Bz}=JL(),Ez=OL(),{prettify:Az}=qL(),Vz=MU();class CL{constructor($){this.externalEntities={},this.options=Bz($)}parse($,U){if(typeof $==="string");else if($.toString)$=$.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(U){if(U===!0)U={};const W=Vz.validate($,U);if(W!==!0)throw Error(`${W.err.msg}:${W.err.line}:${W.err.col}`)}const G=new Ez(this.options);G.addExternalEntities(this.externalEntities);const w=G.parseXml($);if(this.options.preserveOrder||w===void 0)return w;else return Az(w,this.options)}addEntity($,U){if(U.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(U==="&")throw new Error("An entity with value '&' is not permitted");else this.externalEntities[$]=U}}NL.exports=CL});var hL=I((xK,bL)=>{var Hz=function($,U){let G="";if(U.format&&U.indentBy.length>0)G="\n";return SL($,U,"",G)},SL=function($,U,G,w){let W="",X=!1;for(let L=0;L<$.length;L++){const Z=$[L],Y=Oz(Z);if(Y===void 0)continue;let Q="";if(G.length===0)Q=Y;else Q=`${G}.${Y}`;if(Y===U.textNodeName){let R=Z[Y];if(!Tz(Q,U))R=U.tagValueProcessor(Y,R),R=kL(R,U);if(X)W+=w;W+=R,X=!1;continue}else if(Y===U.cdataPropName){if(X)W+=w;W+=`<![CDATA[${Z[Y][0][U.textNodeName]}]]>`,X=!1;continue}else if(Y===U.commentPropName){W+=w+`<!--${Z[Y][0][U.textNodeName]}-->`,X=!0;continue}else if(Y[0]==="?"){const R=jL(Z[":@"],U),K=Y==="?xml"?"":w;let H=Z[Y][0][U.textNodeName];H=H.length!==0?" "+H:"",W+=K+`<${Y}${H}${R}?>`,X=!0;continue}let z=w;if(z!=="")z+=U.indentBy;const F=jL(Z[":@"],U),J=w+`<${Y}${F}`,f=SL(Z[Y],U,Q,z);if(U.unpairedTags.indexOf(Y)!==-1)if(U.suppressUnpairedNode)W+=J+">";else W+=J+"/>";else if((!f||f.length===0)&&U.suppressEmptyNode)W+=J+"/>";else if(f&&f.endsWith(">"))W+=J+`>${f}${w}</${Y}>`;else{if(W+=J+">",f&&w!==""&&(f.includes("/>")||f.includes("</")))W+=w+U.indentBy+f+w;else W+=f;W+=`</${Y}>`}X=!0}return W},Oz=function($){const U=Object.keys($);for(let G=0;G<U.length;G++){const w=U[G];if(!$.hasOwnProperty(w))continue;if(w!==":@")return w}},jL=function($,U){let G="";if($&&!U.ignoreAttributes)for(let w in $){if(!$.hasOwnProperty(w))continue;let W=U.attributeValueProcessor(w,$[w]);if(W=kL(W,U),W===!0&&U.suppressBooleanAttributes)G+=` ${w.substr(U.attributeNamePrefix.length)}`;else G+=` ${w.substr(U.attributeNamePrefix.length)}="${W}"`}return G},Tz=function($,U){$=$.substr(0,$.length-U.textNodeName.length-1);let G=$.substr($.lastIndexOf(".")+1);for(let w in U.stopNodes)if(U.stopNodes[w]===$||U.stopNodes[w]==="*."+G)return!0;return!1},kL=function($,U){if($&&$.length>0&&U.processEntities)for(let G=0;G<U.entities.length;G++){const w=U.entities[G];$=$.replace(w.regex,w.val)}return $};bL.exports=Hz});var xL=I((vK,DL)=>{var $0=function($){if(this.options=Object.assign({},Cz,$),this.options.ignoreAttributes||this.options.attributesGroupName)this.isAttribute=function(){return!1};else this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=jz;if(this.processTextOrObjNode=Nz,this.options.format)this.indentate=Pz,this.tagEndChar=">\n",this.newLine="\n";else this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""},Nz=function($,U,G){const w=this.j2x($,G+1);if($[this.options.textNodeName]!==void 0&&Object.keys($).length===1)return this.buildTextValNode($[this.options.textNodeName],U,w.attrStr,G);else return this.buildObjectNode(w.val,U,w.attrStr,G)},Pz=function($){return this.options.indentBy.repeat($)},jz=function($){if($.startsWith(this.options.attributeNamePrefix)&&$!==this.options.textNodeName)return $.substr(this.attrPrefixLen);else return!1},qz=hL(),Cz={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function($,U){return U},attributeValueProcessor:function($,U){return U},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};$0.prototype.build=function($){if(this.options.preserveOrder)return qz($,this.options);else{if(Array.isArray($)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1)$={[this.options.arrayNodeName]:$};return this.j2x($,0).val}};$0.prototype.j2x=function($,U){let G="",w="";for(let W in $){if(!Object.prototype.hasOwnProperty.call($,W))continue;if(typeof $[W]==="undefined"){if(this.isAttribute(W))w+=""}else if($[W]===null)if(this.isAttribute(W))w+="";else if(W[0]==="?")w+=this.indentate(U)+"<"+W+"?"+this.tagEndChar;else w+=this.indentate(U)+"<"+W+"/"+this.tagEndChar;else if($[W]instanceof Date)w+=this.buildTextValNode($[W],W,"",U);else if(typeof $[W]!=="object"){const X=this.isAttribute(W);if(X)G+=this.buildAttrPairStr(X,""+$[W]);else if(W===this.options.textNodeName){let L=this.options.tagValueProcessor(W,""+$[W]);w+=this.replaceEntitiesValue(L)}else w+=this.buildTextValNode($[W],W,"",U)}else if(Array.isArray($[W])){const X=$[W].length;let L="",Z="";for(let Y=0;Y<X;Y++){const Q=$[W][Y];if(typeof Q==="undefined");else if(Q===null)if(W[0]==="?")w+=this.indentate(U)+"<"+W+"?"+this.tagEndChar;else w+=this.indentate(U)+"<"+W+"/"+this.tagEndChar;else if(typeof Q==="object")if(this.options.oneListGroup){const z=this.j2x(Q,U+1);if(L+=z.val,this.options.attributesGroupName&&Q.hasOwnProperty(this.options.attributesGroupName))Z+=z.attrStr}else L+=this.processTextOrObjNode(Q,W,U);else if(this.options.oneListGroup){let z=this.options.tagValueProcessor(W,Q);z=this.replaceEntitiesValue(z),L+=z}else L+=this.buildTextValNode(Q,W,"",U)}if(this.options.oneListGroup)L=this.buildObjectNode(L,W,Z,U);w+=L}else if(this.options.attributesGroupName&&W===this.options.attributesGroupName){const X=Object.keys($[W]),L=X.length;for(let Z=0;Z<L;Z++)G+=this.buildAttrPairStr(X[Z],""+$[W][X[Z]])}else w+=this.processTextOrObjNode($[W],W,U)}return{attrStr:G,val:w}};$0.prototype.buildAttrPairStr=function($,U){if(U=this.options.attributeValueProcessor($,""+U),U=this.replaceEntitiesValue(U),this.options.suppressBooleanAttributes&&U==="true")return" "+$;else return" "+$+'="'+U+'"'};$0.prototype.buildObjectNode=function($,U,G,w){if($==="")if(U[0]==="?")return this.indentate(w)+"<"+U+G+"?"+this.tagEndChar;else return this.indentate(w)+"<"+U+G+this.closeTag(U)+this.tagEndChar;else{let W="</"+U+this.tagEndChar,X="";if(U[0]==="?")X="?",W="";if((G||G==="")&&$.indexOf("<")===-1)return this.indentate(w)+"<"+U+G+X+">"+$+W;else if(this.options.commentPropName!==!1&&U===this.options.commentPropName&&X.length===0)return this.indentate(w)+`<!--${$}-->`+this.newLine;else return this.indentate(w)+"<"+U+G+X+this.tagEndChar+$+this.indentate(w)+W}};$0.prototype.closeTag=function($){let U="";if(this.options.unpairedTags.indexOf($)!==-1){if(!this.options.suppressUnpairedNode)U="/"}else if(this.options.suppressEmptyNode)U="/";else U=`></${$}`;return U};$0.prototype.buildTextValNode=function($,U,G,w){if(this.options.cdataPropName!==!1&&U===this.options.cdataPropName)return this.indentate(w)+`<![CDATA[${$}]]>`+this.newLine;else if(this.options.commentPropName!==!1&&U===this.options.commentPropName)return this.indentate(w)+`<!--${$}-->`+this.newLine;else if(U[0]==="?")return this.indentate(w)+"<"+U+G+"?"+this.tagEndChar;else{let W=this.options.tagValueProcessor(U,$);if(W=this.replaceEntitiesValue(W),W==="")return this.indentate(w)+"<"+U+G+this.closeTag(U)+this.tagEndChar;else return this.indentate(w)+"<"+U+G+">"+W+"</"+U+this.tagEndChar}};$0.prototype.replaceEntitiesValue=function($){if($&&$.length>0&&this.options.processEntities)for(let U=0;U<this.options.entities.length;U++){const G=this.options.entities[U];$=$.replace(G.regex,G.val)}return $};DL.exports=$0});var cL=I((cK,vL)=>{var Sz=MU(),kz=PL(),bz=xL();vL.exports={XMLParser:kz,XMLValidator:Sz,XMLBuilder:bz}});var gL=I((yK,pL)=>{var{defineProperty:g1,getOwnPropertyDescriptor:hz,getOwnPropertyNames:Dz}=Object,xz=Object.prototype.hasOwnProperty,h=($,U)=>g1($,"name",{value:U,configurable:!0}),vz=($,U)=>{for(var G in U)g1($,G,{get:U[G],enumerable:!0})},cz=($,U,G,w)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let W of Dz(U))if(!xz.call($,W)&&W!==G)g1($,W,{get:()=>U[W],enumerable:!(w=hz(U,W))||w.enumerable})}return $},yz=($)=>cz(g1({},"__esModule",{value:!0}),$),yL={};vz(yL,{_toBool:()=>uz,_toNum:()=>dz,_toStr:()=>_z,awsExpectUnion:()=>gz,loadRestJsonErrorCode:()=>mz,loadRestXmlErrorCode:()=>oz,parseJsonBody:()=>uL,parseJsonErrorBody:()=>lz,parseXmlBody:()=>dL,parseXmlErrorBody:()=>rz});pL.exports=yz(yL);var _z=h(($)=>{if($==null)return $;if(typeof $==="number"||typeof $==="bigint"){const U=new Error(`Received number ${$} where a string was expected.`);return U.name="Warning",console.warn(U),String($)}if(typeof $==="boolean"){const U=new Error(`Received boolean ${$} where a string was expected.`);return U.name="Warning",console.warn(U),String($)}return $},"_toStr"),uz=h(($)=>{if($==null)return $;if(typeof $==="string"){const U=$.toLowerCase();if($!==""&&U!=="false"&&U!=="true"){const G=new Error(`Received string "${$}" where a boolean was expected.`);G.name="Warning",console.warn(G)}return $!==""&&U!=="false"}return $},"_toBool"),dz=h(($)=>{if($==null)return $;if(typeof $==="string"){const U=Number($);if(U.toString()!==$){const G=new Error(`Received string "${$}" where a number was expected.`);return G.name="Warning",console.warn(G),$}return U}return $},"_toNum"),pz=A0(),gz=h(($)=>{if($==null)return;if(typeof $==="object"&&"__type"in $)delete $.__type;return pz.expectUnion($)},"awsExpectUnion"),sz=A0(),_L=h(($,U)=>sz.collectBody($,U).then((G)=>U.utf8Encoder(G)),"collectBodyString"),uL=h(($,U)=>_L($,U).then((G)=>{if(G.length)try{return JSON.parse(G)}catch(w){if((w==null?void 0:w.name)==="SyntaxError")Object.defineProperty(w,"$responseBodyText",{value:G});throw w}return{}}),"parseJsonBody"),lz=h(async($,U)=>{const G=await uL($,U);return G.message=G.message??G.Message,G},"parseJsonErrorBody"),mz=h(($,U)=>{const G=h((X,L)=>Object.keys(X).find((Z)=>Z.toLowerCase()===L.toLowerCase()),"findKey"),w=h((X)=>{let L=X;if(typeof L==="number")L=L.toString();if(L.indexOf(",")>=0)L=L.split(",")[0];if(L.indexOf(":")>=0)L=L.split(":")[0];if(L.indexOf("#")>=0)L=L.split("#")[1];return L},"sanitizeErrorCode"),W=G($.headers,"x-amzn-errortype");if(W!==void 0)return w($.headers[W]);if(U.code!==void 0)return w(U.code);if(U.__type!==void 0)return w(U.__type)},"loadRestJsonErrorCode"),nz=A0(),iz=cL(),dL=h(($,U)=>_L($,U).then((G)=>{if(G.length){const w=new iz.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(Y,Q)=>Q.trim()===""&&Q.includes("\n")?"":void 0});w.addEntity("#xD","\r"),w.addEntity("#10","\n");let W;try{W=w.parse(G,!0)}catch(Y){if(Y&&typeof Y==="object")Object.defineProperty(Y,"$responseBodyText",{value:G});throw Y}const X="#text",L=Object.keys(W)[0],Z=W[L];if(Z[X])Z[L]=Z[X],delete Z[X];return nz.getValueFromTextNode(Z)}return{}}),"parseXmlBody"),rz=h(async($,U)=>{const G=await dL($,U);if(G.Error)G.Error.message=G.Error.message??G.Error.Message;return G},"parseXmlErrorBody"),oz=h(($,U)=>{var G;if(((G=U==null?void 0:U.Error)==null?void 0:G.Code)!==void 0)return U.Error.Code;if((U==null?void 0:U.Code)!==void 0)return U.Code;if($.statusCode==404)return"NotFound"},"loadRestXmlErrorCode")});var tz=I((r0)=>{Object.defineProperty(r0,"__esModule",{value:!0});var RU=az();RU.__exportStar(PX(),r0);RU.__exportStar(WL(),r0);RU.__exportStar(gL(),r0)});var s=g(a1(),1),jF=s.default.v1,SF=s.default.v3,IG=s.default.v4,kF=s.default.v5,bF=s.default.NIL,hF=s.default.version,DF=s.default.validate,xF=s.default.stringify,vF=s.default.parse;function _F($){return $}var IZ=($)=>(U)=>async(G)=>{if(!x.isInstance(G.request))return U(G);const{request:w}=G,{handlerProtocol:W=""}=$.requestHandler.metadata||{};if(W.indexOf("h2")>=0&&!w.headers[":authority"])delete w.headers.host,w.headers[":authority"]=w.hostname+(w.port?":"+w.port:"");else if(!w.headers.host){let X=w.hostname;if(w.port!=null)X+=`:${w.port}`;w.headers.host=X}return U(G)},RZ={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},uF=($)=>({applyToStack:(U)=>{U.add(IZ($),RZ)}});var KZ=()=>($,U)=>async(G)=>{try{const w=await $(G),{clientName:W,commandName:X,logger:L,dynamoDbDocumentClientOptions:Z={}}=U,{overrideInputFilterSensitiveLog:Y,overrideOutputFilterSensitiveLog:Q}=Z,z=Y??U.inputFilterSensitiveLog,F=Q??U.outputFilterSensitiveLog,{$metadata:J,...f}=w.output;return L?.info?.({clientName:W,commandName:X,input:z(G.input),output:F(f),metadata:J}),w}catch(w){const{clientName:W,commandName:X,logger:L,dynamoDbDocumentClientOptions:Z={}}=U,{overrideInputFilterSensitiveLog:Y}=Z,Q=Y??U.inputFilterSensitiveLog;throw L?.error?.({clientName:W,commandName:X,input:Q(G.input),error:w,metadata:w.$metadata}),w}},BZ={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},pF=($)=>({applyToStack:(U)=>{U.add(KZ(),BZ)}});var RG="X-Amzn-Trace-Id",EZ="AWS_LAMBDA_FUNCTION_NAME",AZ="_X_AMZN_TRACE_ID",VZ=($)=>(U)=>async(G)=>{const{request:w}=G;if(!x.isInstance(w)||$.runtime!=="node"||w.headers.hasOwnProperty(RG))return U(G);const W=process.env[EZ],X=process.env[AZ],L=(Z)=>typeof Z==="string"&&Z.length>0;if(L(W)&&L(X))w.headers[RG]=X;return U({...G,request:w})},HZ={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},nF=($)=>({applyToStack:(U)=>{U.add(VZ($),HZ)}});function OJ($){return{...$,customUserAgent:typeof $.customUserAgent==="string"?[[$.customUserAgent]]:$.customUserAgent}}class j9{constructor({size:$,params:U}){if(this.data=new Map,this.parameters=[],this.capacity=$??50,U)this.parameters=U}get($,U){const G=this.hash($);if(G===!1)return U();if(!this.data.has(G)){if(this.data.size>this.capacity+10){const w=this.data.keys();let W=0;while(!0){const{value:X,done:L}=w.next();if(this.data.delete(X),L||++W>10)break}}this.data.set(G,U())}return this.data.get(G)}size(){return this.data.size}hash($){let U="";const{parameters:G}=this;if(G.length===0)return!1;for(let w of G){const W=String($[w]??"");if(W.includes("|;"))return!1;U+=W+"|;"}return U}}var S9=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}$"),p0=($)=>S9.test($)||$.startsWith("[")&&$.endsWith("]");var k9=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),g0=($,U=!1)=>{if(!U)return k9.test($);const G=$.split(".");for(let w of G)if(!g0(w))return!1;return!0};var s0={};var i="endpoints";function c($){if(typeof $!=="object"||$==null)return $;if("ref"in $)return`\$${c($.ref)}`;if("fn"in $)return`${$.fn}(${($.argv||[]).map(c).join(", ")})`;return JSON.stringify($,null,2)}class A extends Error{constructor($){super($);this.name="EndpointError"}}var _8=($,U)=>$===U;var u8=($)=>{const U=$.split("."),G=[];for(let w of U){const W=w.indexOf("[");if(W!==-1){if(w.indexOf("]")!==w.length-1)throw new A(`Path: '${$}' does not end with ']'`);const X=w.slice(W+1,-1);if(Number.isNaN(parseInt(X)))throw new A(`Invalid array index: '${X}' in path: '${$}'`);if(W!==0)G.push(w.slice(0,W));G.push(X)}else G.push(w)}return G};var B1=($,U)=>u8(U).reduce((G,w)=>{if(typeof G!=="object")throw new A(`Index '${w}' in '${U}' not found in '${JSON.stringify($)}'`);else if(Array.isArray(G))return G[parseInt(w)];return G[w]},$);var d8=($)=>$!=null;var p8=($)=>!$;var E1=g(J0(),1);var y$={[E1.EndpointURLScheme.HTTP]:80,[E1.EndpointURLScheme.HTTPS]:443},g8=($)=>{const U=(()=>{try{if($ instanceof URL)return $;if(typeof $==="object"&&"hostname"in $){const{hostname:J,port:f,protocol:R="",path:K="",query:H={}}=$,k=new URL(`${R}//${J}${f?`:${f}`:""}${K}`);return k.search=Object.entries(H).map(([m,B])=>`${m}=${B}`).join("&"),k}return new URL($)}catch(J){return null}})();if(!U)return console.error(`Unable to parse ${JSON.stringify($)} as a whatwg URL.`),null;const G=U.href,{host:w,hostname:W,pathname:X,protocol:L,search:Z}=U;if(Z)return null;const Y=L.slice(0,-1);if(!Object.values(E1.EndpointURLScheme).includes(Y))return null;const Q=p0(W),z=G.includes(`${w}:${y$[Y]}`)||typeof $==="string"&&$.includes(`${w}:${y$[Y]}`),F=`${w}${z?`:${y$[Y]}`:""}`;return{scheme:Y,authority:F,path:X,normalizedPath:X.endsWith("/")?X:`${X}/`,isIp:Q}};var s8=($,U)=>$===U;var l8=($,U,G,w)=>{if(U>=G||$.length<G)return null;if(!w)return $.substring(U,G);return $.substring($.length-G,$.length-U)};var m8=($)=>encodeURIComponent($).replace(/[!*'()]/g,(U)=>`%${U.charCodeAt(0).toString(16).toUpperCase()}`);var n8={booleanEquals:_8,getAttr:B1,isSet:d8,isValidHostLabel:g0,not:p8,parseURL:g8,stringEquals:s8,substring:l8,uriEncode:m8};var A1=($,U)=>{const G=[],w={...U.endpointParams,...U.referenceRecord};let W=0;while(W<$.length){const X=$.indexOf("{",W);if(X===-1){G.push($.slice(W));break}G.push($.slice(W,X));const L=$.indexOf("}",X);if(L===-1){G.push($.slice(X));break}if($[X+1]==="{"&&$[L+1]==="}")G.push($.slice(X+1,L)),W=L+2;const Z=$.substring(X+1,L);if(Z.includes("#")){const[Y,Q]=Z.split("#");G.push(B1(w[Y],Q))}else G.push(w[Z]);W=L+1}return G.join("")};var i8=({ref:$},U)=>{return{...U.endpointParams,...U.referenceRecord}[$]};var a=($,U,G)=>{if(typeof $==="string")return A1($,G);else if($.fn)return V1($,G);else if($.ref)return i8($,G);throw new A(`'${U}': ${String($)} is not a string, function or reference.`)};var V1=({fn:$,argv:U},G)=>{const w=U.map((X)=>["boolean","number"].includes(typeof X)?X:a(X,"arg",G)),W=$.split(".");if(W[0]in s0&&W[1]!=null)return s0[W[0]][W[1]](...w);return n8[$](...w)};var r8=({assign:$,...U},G)=>{if($&&$ in G.referenceRecord)throw new A(`'${$}' is already defined in Reference Record.`);const w=V1(U,G);return G.logger?.debug?.(`${i} evaluateCondition: ${c(U)} = ${c(w)}`),{result:w===""?!0:!!w,...$!=null&&{toAssign:{name:$,value:w}}}};var H0=($=[],U)=>{const G={};for(let w of $){const{result:W,toAssign:X}=r8(w,{...U,referenceRecord:{...U.referenceRecord,...G}});if(!W)return{result:W};if(X)G[X.name]=X.value,U.logger?.debug?.(`${i} assign: ${X.name} := ${c(X.value)}`)}return{result:!0,referenceRecord:G}};var o8=($,U)=>Object.entries($).reduce((G,[w,W])=>({...G,[w]:W.map((X)=>{const L=a(X,"Header value entry",U);if(typeof L!=="string")throw new A(`Header '${w}' value '${L}' is not a string`);return L})}),{});var _$=($,U)=>{if(Array.isArray($))return $.map((G)=>_$(G,U));switch(typeof $){case"string":return A1($,U);case"object":if($===null)throw new A(`Unexpected endpoint property: ${$}`);return H1($,U);case"boolean":return $;default:throw new A(`Unexpected endpoint property type: ${typeof $}`)}};var H1=($,U)=>Object.entries($).reduce((G,[w,W])=>({...G,[w]:_$(W,U)}),{});var a8=($,U)=>{const G=a($,"Endpoint URL",U);if(typeof G==="string")try{return new URL(G)}catch(w){throw console.error(`Failed to construct URL with ${G}`,w),w}throw new A(`Endpoint URL must be a string, got ${typeof G}`)};var t8=($,U)=>{const{conditions:G,endpoint:w}=$,{result:W,referenceRecord:X}=H0(G,U);if(!W)return;const L={...U,referenceRecord:{...U.referenceRecord,...X}},{url:Z,properties:Y,headers:Q}=w;return U.logger?.debug?.(`${i} Resolving endpoint from template: ${c(w)}`),{...Q!=null&&{headers:o8(Q,L)},...Y!=null&&{properties:H1(Y,L)},url:a8(Z,L)}};var e8=($,U)=>{const{conditions:G,error:w}=$,{result:W,referenceRecord:X}=H0(G,U);if(!W)return;throw new A(a(w,"Error",{...U,referenceRecord:{...U.referenceRecord,...X}}))};var $X=($,U)=>{const{conditions:G,rules:w}=$,{result:W,referenceRecord:X}=H0(G,U);if(!W)return;return O1(w,{...U,referenceRecord:{...U.referenceRecord,...X}})};var O1=($,U)=>{for(let G of $)if(G.type==="endpoint"){const w=t8(G,U);if(w)return w}else if(G.type==="error")e8(G,U);else if(G.type==="tree"){const w=$X(G,U);if(w)return w}else throw new A(`Unknown endpoint rule: ${G}`);throw new A("Rules evaluation failed")};var b9=($,U)=>{const{endpointParams:G,logger:w}=U,{parameters:W,rules:X}=$;U.logger?.debug?.(`${i} Initial EndpointParams: ${c(G)}`);const L=Object.entries(W).filter(([,Q])=>Q.default!=null).map(([Q,z])=>[Q,z.default]);if(L.length>0)for(let[Q,z]of L)G[Q]=G[Q]??z;const Z=Object.entries(W).filter(([,Q])=>Q.required).map(([Q])=>Q);for(let Q of Z)if(G[Q]==null)throw new A(`Missing required parameter: '${Q}'`);const Y=O1(X,{endpointParams:G,logger:w,referenceRecord:{}});return U.logger?.debug?.(`${i} Resolved endpoint: ${c(Y)}`),Y};var u$=($,U=!1)=>{if(U){for(let G of $.split("."))if(!u$(G))return!1;return!0}if(!g0($))return!1;if($.length<3||$.length>63)return!1;if($!==$.toLowerCase())return!1;if(p0($))return!1;return!0};var UX=($)=>{const U=$.split(":");if(U.length<6)return null;const[G,w,W,X,L,...Z]=U;if(G!=="arn"||w===""||W===""||Z.join(":")==="")return null;const Y=Z.map((Q)=>Q.split("/")).flat();return{partition:w,service:W,region:X,accountId:L,resourceId:Y}};var GX={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|mx)\\-\\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)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"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 D9=GX,x9="",wX=($)=>{const{partitions:U}=D9;for(let w of U){const{regions:W,outputs:X}=w;for(let[L,Z]of Object.entries(W))if(L===$)return{...X,...Z}}for(let w of U){const{regionRegex:W,outputs:X}=w;if(new RegExp(W).test($))return{...X}}const G=U.find((w)=>w.id==="aws");if(!G)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...G.outputs}};var WX=()=>x9;var v9={isVirtualHostableS3Bucket:u$,parseArn:UX,partition:wX};s0.aws=v9;var d$="user-agent",T1="x-amz-user-agent",p$=" ",q1="/",XX=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,LX=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,g$="-";var c9=($)=>(U,G)=>async(w)=>{const{request:W}=w;if(!x.isInstance(W))return U(w);const{headers:X}=W,L=G?.userAgent?.map(s$)||[],Z=(await $.defaultUserAgentProvider()).map(s$),Y=$?.customUserAgent?.map(s$)||[],Q=WX(),z=(Q?[Q]:[]).concat([...Z,...L,...Y]).join(p$),F=[...Z.filter((J)=>J.startsWith("aws-sdk-")),...Y].join(p$);if($.runtime!=="browser"){if(F)X[T1]=X[T1]?`${X[d$]} ${F}`:F;X[d$]=z}else X[T1]=z;return U({...w,request:W})},s$=($)=>{const U=$[0].split(q1).map((L)=>L.replace(XX,g$)).join(q1),G=$[1]?.replace(LX,g$),w=U.indexOf(q1),W=U.substring(0,w);let X=U.substring(w+1);if(W==="api")X=X.toLowerCase();return[W,X,G].filter((L)=>L&&L.length>0).reduce((L,Z,Y)=>{switch(Y){case 0:return Z;case 1:return`${L}/${Z}`;default:return`${L}#${Z}`}},"")},y9={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Wf=($)=>({applyToStack:(U)=>{U.add(c9($),y9)}});var C1=($)=>typeof $==="string"&&($.startsWith("fips-")||$.endsWith("-fips"));var l$=($)=>C1($)?["fips-aws-global","aws-fips"].includes($)?"us-east-1":$.replace(/fips-(dkr-|prod-)?|-fips/,""):$;var ff=($)=>{const{region:U,useFipsEndpoint:G}=$;if(!U)throw new Error("Region is missing");return{...$,region:async()=>{if(typeof U==="string")return l$(U);const w=await U();return l$(w)},useFipsEndpoint:async()=>{const w=typeof U==="string"?U:await U();if(C1(w))return!0;return typeof G!=="function"?Promise.resolve(!!G):G()}}};var O0=($,U,G)=>{if(!(U in $))return;if($[U]==="true")return!0;if($[U]==="false")return!1;throw new Error(`Cannot load ${G} "${U}". Expected "true" or "false", got ${$[U]}.`)};var t;(function($){$.ENV="env",$.CONFIG="shared config entry"})(t||(t={}));var _9="AWS_USE_DUALSTACK_ENDPOINT",u9="use_dualstack_endpoint";var Tf={environmentVariableSelector:($)=>O0($,_9,t.ENV),configFileSelector:($)=>O0($,u9,t.CONFIG),default:!1};var d9="AWS_USE_FIPS_ENDPOINT",p9="use_fips_endpoint";var Nf={environmentVariableSelector:($)=>O0($,d9,t.ENV),configFileSelector:($)=>O0($,p9,t.CONFIG),default:!1};var m$=g(J0(),1),ZX=($)=>$[m$.SMITHY_CONTEXT_KEY]||($[m$.SMITHY_CONTEXT_KEY]={});var r=($)=>{if(typeof $==="function")return $;const U=Promise.resolve($);return()=>U};var YX={environmentVariableSelector:($)=>$["AWS_REGION"],configFileSelector:($)=>$["region"],default:()=>{throw new Error("Region is missing")}},mf={preferredFile:"credentials"};function g9($){return(U)=>async(G)=>{const w=G.request;if(x.isInstance(w)){const{body:W,headers:X}=w;if(W&&Object.keys(X).map((L)=>L.toLowerCase()).indexOf(QX)===-1)try{const L=$(W);w.headers={...w.headers,[QX]:String(L)}}catch(L){}}return U({...G,request:w})}}var QX="content-length",s9={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},AI=($)=>({applyToStack:(U)=>{U.add(g9($.bodyLengthChecker),s9)}});var KX=g(e0(),1);var zX=async($)=>{const U=$?.Bucket||"";if(typeof $.Bucket==="string")$.Bucket=U.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(r9(U)){if($.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!i9(U)||U.indexOf(".")!==-1&&!String($.Endpoint).startsWith("http:")||U.toLowerCase()!==U||U.length<3)$.ForcePathStyle=!0;if($.DisableMultiRegionAccessPoints)$.disableMultiRegionAccessPoints=!0,$.DisableMRAP=!0;return $},l9=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,m9=/(\d+\.){3}\d+/,n9=/\.\./;var i9=($)=>l9.test($)&&!m9.test($)&&!n9.test($),r9=($)=>{const[U,G,w,,,W]=$.split(":"),X=U==="arn"&&$.split(":").length>=6,L=Boolean(X&&G&&w&&W);if(X&&!L)throw new Error(`Invalid ARN: ${$} was an invalid ARN.`);return L};var FX=($,U,G)=>{const w=async()=>{const W=G[$]??G[U];if(typeof W==="function")return W();return W};if($==="credentialScope"||U==="CredentialScope")return async()=>{const W=typeof G.credentials==="function"?await G.credentials():G.credentials;return W?.credentialScope??W?.CredentialScope};if($==="accountId"||U==="AccountId")return async()=>{const W=typeof G.credentials==="function"?await G.credentials():G.credentials;return W?.accountId??W?.AccountId};if($==="endpoint"||U==="endpoint")return async()=>{const W=await w();if(W&&typeof W==="object"){if("url"in W)return W.url.href;if("hostname"in W){const{protocol:X,hostname:L,port:Z,path:Y}=W;return`${X}//${L}${Z?":"+Z:""}${Y}`}}return W};return w};var JX="AWS_ENDPOINT_URL",MX="endpoint_url",fX=($)=>({environmentVariableSelector:(U)=>{const G=$.split(" ").map((X)=>X.toUpperCase()),w=U[[JX,...G].join("_")];if(w)return w;const W=U[JX];if(W)return W;return},configFileSelector:(U,G)=>{if(G&&U.services){const W=G[["services",U.services].join(n$)];if(W){const X=$.split(" ").map((Z)=>Z.toLowerCase()),L=W[[X.join("_"),MX].join(n$)];if(L)return L}}const w=U[MX];if(w)return w;return},default:void 0});var N1=async($)=>L0(fX($??""))();var i$=g(Gw(),1),P1=($)=>{if(typeof $==="object"){if("url"in $)return i$.parseUrl($.url);return $}return i$.parseUrl($)};var IX=async($,U,G,w)=>{if(!G.endpoint){let L;if(G.serviceConfiguredEndpoint)L=await G.serviceConfiguredEndpoint();else L=await N1(G.serviceId);if(L)G.endpoint=()=>Promise.resolve(P1(L))}const W=await o9($,U,G);if(typeof G.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return G.endpointProvider(W,w)},o9=async($,U,G)=>{const w={},W=U?.getEndpointParameterInstructions?.()||{};for(let[X,L]of Object.entries(W))switch(L.type){case"staticContextParams":w[X]=L.value;break;case"contextParams":w[X]=$[L.name];break;case"clientContextParams":case"builtInParams":w[X]=await FX(L.name,X,G)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(L))}if(Object.keys(W).length===0)Object.assign(w,G);if(String(G.serviceId).toLowerCase()==="s3")await zX(w);return w};var RX=({config:$,instructions:U})=>{return(G,w)=>async(W)=>{const X=await IX(W.input,{getEndpointParameterInstructions(){return U}},{...$},w);w.endpointV2=X,w.authSchemes=X.properties?.authSchemes;const L=w.authSchemes?.[0];if(L){w.signing_region=L.signingRegion,w.signing_service=L.signingName;const Y=ZX(w)?.selectedHttpAuthScheme?.httpAuthOption;if(Y)Y.signingProperties=Object.assign(Y.signingProperties||{},{signing_region:L.signingRegion,signingRegion:L.signingRegion,signing_service:L.signingName,signingName:L.signingName,signingRegionSet:L.signingRegionSet},L.properties)}return G({...W})}};var a9={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:KX.serializerMiddlewareOption.name},dI=($,U)=>({applyToStack:(G)=>{G.addRelativeTo(RX({config:$,instructions:U}),a9)}});var mI=($)=>{const U=$.tls??!0,{endpoint:G}=$,w=G!=null?async()=>P1(await r(G)()):void 0,X={...$,endpoint:w,tls:U,isCustomEndpoint:!!G,useDualstackEndpoint:r($.useDualstackEndpoint??!1),useFipsEndpoint:r($.useFipsEndpoint??!1)};let L=void 0;return X.serviceConfiguredEndpoint=async()=>{if($.serviceId&&!L)L=N1($.serviceId);return L},X};var p;(function($){$.STANDARD="standard",$.ADAPTIVE="adaptive"})(p||(p={}));var Z0=3,BX=p.STANDARD;var EX=g(G0(),1);class j1{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 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($){if(!this.enabled)return;if(this.refillTokenBucket(),$>this.currentCapacity){const U=($-this.currentCapacity)/this.fillRate*1000;await new Promise((G)=>setTimeout(G,U))}this.currentCapacity=this.currentCapacity-$}refillTokenBucket(){const $=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=$;return}const U=($-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+U),this.lastTimestamp=$}updateClientSendingRate($){let U;if(this.updateMeasuredRate(),EX.isThrottlingError($)){const w=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=w,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),U=this.cubicThrottle(w),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($){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(),U=Math.floor($*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($){return parseFloat($.toFixed(8))}}var Y0=100,l0=20000,r$=500,S1=500,o$=5,a$=10,t$=1,k1="amz-sdk-invocation-id",b1="amz-sdk-request";var AX=()=>{let $=Y0;return{computeNextBackoffDelay:(w)=>{return Math.floor(Math.min(l0,Math.random()*2**w*$))},setDelayBase:(w)=>{$=w}}};var e$=({retryDelay:$,retryCount:U,retryCost:G})=>{return{getRetryCount:()=>U,getRetryDelay:()=>Math.min(l0,$),getRetryCost:()=>G}};class T0{constructor($){this.maxAttempts=$,this.mode=p.STANDARD,this.capacity=S1,this.retryBackoffStrategy=AX(),this.maxAttemptsProvider=typeof $==="function"?$:async()=>$}async acquireInitialRetryToken($){return e$({retryDelay:Y0,retryCount:0})}async refreshRetryTokenForRetry($,U){const G=await this.getMaxAttempts();if(this.shouldRetry($,U,G)){const w=U.errorType;this.retryBackoffStrategy.setDelayBase(w==="THROTTLING"?r$:Y0);const W=this.retryBackoffStrategy.computeNextBackoffDelay($.getRetryCount()),X=U.retryAfterHint?Math.max(U.retryAfterHint.getTime()-Date.now()||0,W):W,L=this.getCapacityCost(w);return this.capacity-=L,e$({retryDelay:X,retryCount:$.getRetryCount()+1,retryCost:L})}throw new Error("No retry token available")}recordSuccess($){this.capacity=Math.max(S1,this.capacity+($.getRetryCost()??t$))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch($){return console.warn(`Max attempts provider could not resolve. Using default of ${Z0}`),Z0}}shouldRetry($,U,G){return $.getRetryCount()+1<G&&this.capacity>=this.getCapacityCost(U.errorType)&&this.isRetryableError(U.errorType)}getCapacityCost($){return $==="TRANSIENT"?a$:o$}isRetryableError($){return $==="THROTTLING"||$==="TRANSIENT"}}class $U{constructor($,U){this.maxAttemptsProvider=$,this.mode=p.ADAPTIVE;const{rateLimiter:G}=U??{};this.rateLimiter=G??new j1,this.standardRetryStrategy=new T0($)}async acquireInitialRetryToken($){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken($)}async refreshRetryTokenForRetry($,U){return this.rateLimiter.updateClientSendingRate(U),this.standardRetryStrategy.refreshRetryTokenForRetry($,U)}recordSuccess($){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess($)}}var VX="AWS_MAX_ATTEMPTS",HX="max_attempts",bR={environmentVariableSelector:($)=>{const U=$[VX];if(!U)return;const G=parseInt(U);if(Number.isNaN(G))throw new Error(`Environment variable ${VX} mast be a number, got "${U}"`);return G},configFileSelector:($)=>{const U=$[HX];if(!U)return;const G=parseInt(U);if(Number.isNaN(G))throw new Error(`Shared config file entry ${HX} mast be a number, got "${U}"`);return G},default:Z0},hR=($)=>{const{retryStrategy:U}=$,G=r($.maxAttempts??Z0);return{...$,maxAttempts:G,retryStrategy:async()=>{if(U)return U;if(await r($.retryMode)()===p.ADAPTIVE)return new $U(G);return new T0(G)}}},t9="AWS_RETRY_MODE",e9="retry_mode",DR={environmentVariableSelector:($)=>$[t9],configFileSelector:($)=>$[e9],default:BX};var q0=g(G0(),1);import{Readable as $2} from"stream";var OX=($)=>$?.body instanceof $2||typeof ReadableStream!=="undefined"&&$?.body instanceof ReadableStream;var UU=($)=>{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 U2=($)=>(U,G)=>async(w)=>{let W=await $.retryStrategy();const X=await $.maxAttempts();if(G2(W)){W=W;let L=await W.acquireInitialRetryToken(G.partition_id),Z=new Error,Y=0,Q=0;const{request:z}=w,F=x.isInstance(z);if(F)z.headers[k1]=IG();while(!0)try{if(F)z.headers[b1]=`attempt=${Y+1}; max=${X}`;const{response:J,output:f}=await U(w);return W.recordSuccess(L),f.$metadata.attempts=Y+1,f.$metadata.totalRetryDelay=Q,{response:J,output:f}}catch(J){const f=w2(J);if(Z=UU(J),F&&OX(z))throw(G.logger instanceof TX?console:G.logger)?.warn("An error was encountered in a non-retryable streaming request."),Z;try{L=await W.refreshRetryTokenForRetry(L,f)}catch(K){if(!Z.$metadata)Z.$metadata={};throw Z.$metadata.attempts=Y+1,Z.$metadata.totalRetryDelay=Q,Z}Y=L.getRetryCount();const R=L.getRetryDelay();Q+=R,await new Promise((K)=>setTimeout(K,R))}}else{if(W=W,W?.mode)G.userAgent=[...G.userAgent||[],["cfg/retry-mode",W.mode]];return W.retry(U,w)}},G2=($)=>typeof $.acquireInitialRetryToken!=="undefined"&&typeof $.refreshRetryTokenForRetry!=="undefined"&&typeof $.recordSuccess!=="undefined",w2=($)=>{const U={error:$,errorType:W2($)},G=L2($.$response);if(G)U.retryAfterHint=G;return U},W2=($)=>{if(q0.isThrottlingError($))return"THROTTLING";if(q0.isTransientError($))return"TRANSIENT";if(q0.isServerError($))return"SERVER_ERROR";return"CLIENT_ERROR"},X2={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},lR=($)=>({applyToStack:(U)=>{U.add(U2($),X2)}}),L2=($)=>{if(!GU.isInstance($))return;const U=Object.keys($.headers).find((X)=>X.toLowerCase()==="retry-after");if(!U)return;const G=$.headers[U],w=Number(G);if(!Number.isNaN(w))return new Date(w*1000);return new Date(G)};var Z2=g(G0(),1);var h1=g(G0(),1);import{platform as ez,release as $F} from"os";import{env as lL,versions as UF} from"process";var KU={isCrtAvailable:!1};var sL=()=>{if(KU.isCrtAvailable)return["md/crt-avail"];return null};var GF="AWS_SDK_UA_APP_ID",wF="sdk-ua-app-id",nK=({serviceId:$,clientVersion:U})=>{const G=[["aws-sdk-js",U],["ua","2.0"],[`os/${ez()}`,$F()],["lang/js"],["md/nodejs",`${UF.node}`]],w=sL();if(w)G.push(w);if($)G.push([`api/${$}`,U]);if(lL.AWS_EXECUTION_ENV)G.push([`exec-env/${lL.AWS_EXECUTION_ENV}`]);const W=L0({environmentVariableSelector:(L)=>L[GF],configFileSelector:(L)=>L[wF],default:void 0})();let X=void 0;return async()=>{if(!X){const L=await W;X=L?[...G,[`app/${L}`]]:[...G]}return X}};import{Buffer as WF} from"buffer";import{createHash as XF,createHmac as LF} from"crypto";var mL=function($,U){if(WF.isBuffer($))return $;if(typeof $==="string")return nL($,U);if(ArrayBuffer.isView($))return BU($.buffer,$.byteOffset,$.byteLength);return BU($)};class ZF{constructor($,U){this.algorithmIdentifier=$,this.secret=U,this.reset()}update($,U){this.hash.update(iL(mL($,U)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?LF(this.algorithmIdentifier,mL(this.secret)):XF(this.algorithmIdentifier)}}import{fstatSync as YF,lstatSync as QF} from"fs";var GB=($)=>{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 QF($.path).size;else if(typeof $.fd==="number")return YF($.fd).size;throw new Error(`Body Length computation failed for ${$}`)};var $4=g(Z$(),1);var rL="AWS_EXECUTION_ENV",EU="AWS_REGION",AU="AWS_DEFAULT_REGION",oL="AWS_EC2_METADATA_DISABLED",aL=["in-region","cross-region","mobile","standard","legacy"],tL="/latest/meta-data/placement/region";var eL={environmentVariableSelector:($)=>{return $["AWS_DEFAULTS_MODE"]},configFileSelector:($)=>{return $["defaults_mode"]},default:"legacy"};var JB=({region:$=L0(YX),defaultsMode:U=L0(eL)}={})=>$4.memoize(async()=>{const G=typeof U==="function"?await U():U;switch(G?.toLowerCase()){case"auto":return zF($);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(G?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${aL.join(", ")}, got ${G}`)}}),zF=async($)=>{if($){const U=typeof $==="function"?await $():$,G=await FF();if(!G)return"standard";if(U===G)return"in-region";else return"cross-region"}return"standard"},FF=async()=>{if(process.env[rL]&&(process.env[EU]||process.env[AU]))return process.env[EU]??process.env[AU];if(!process.env[oL])try{const{getInstanceMetadataEndpoint:$,httpRequest:U}=await import("./chunk-9383d727762ecba1.js"),G=await $();return(await U({...G,path:tL})).toString()}catch($){}};var RB=($)=>{let U=async()=>{if($.region===void 0)throw new Error("Region is missing from runtimeConfig");const G=$.region;if(typeof G==="string")return G;return G()};return{setRegion(G){U=G},region(){return U}}},KB=($)=>{return{region:$.region()}};export{IG as N,ZX as O,r as P,_F as Q,uF as R,pF as S,nF as T,iX as U,O0 as V,t as W,e0 as X,c$ as Y,OJ as Z,j9 as _,s0 as $,b9 as aa,v9 as ba,Wf as ca,Tf as da,Nf as ea,YX as fa,mf as ga,ff as ha,AI as ia,o9 as ja,dI as ka,mI as la,BX as ma,bR as na,hR as oa,DR as pa,lR as qa,tz as ra,nK as sa,ZF as ta,GB as ua,JB as va,RB as wa,KB as xa};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as h,C as G} from"./chunk-24a86f8f5ddc0cbd.js";import{Fb as I} from"./chunk-b4cbb4706a35f5d5.js";import{Ib as H,Mb as K} from"./chunk-fa61561237819f16.js";var t=G((r,j)=>{var T=function(c){const i={};if(c=c.replace(/^\?/,""),c)for(let n of c.split("&")){let[F,f=null]=n.split("=");if(F=decodeURIComponent(F),f)f=decodeURIComponent(f);if(!(F in i))i[F]=f;else if(Array.isArray(i[F]))i[F].push(f);else i[F]=[i[F],f]}return i},o=Object.defineProperty,M=Object.getOwnPropertyDescriptor,Q=Object.getOwnPropertyNames,U=Object.prototype.hasOwnProperty,O=(c,i)=>o(c,"name",{value:i,configurable:!0}),d=(c,i)=>{for(var n in i)o(c,n,{get:i[n],enumerable:!0})},v=(c,i,n,F)=>{if(i&&typeof i==="object"||typeof i==="function"){for(let f of Q(i))if(!U.call(c,f)&&f!==n)o(c,f,{get:()=>i[f],enumerable:!(F=M(i,f))||F.enumerable})}return c},J=(c)=>v(o({},"__esModule",{value:!0}),c),S={};d(S,{parseQueryString:()=>T});j.exports=J(S);O(T,"parseQueryString")});var a=G((y,Z)=>{var{defineProperty:w,getOwnPropertyDescriptor:x,getOwnPropertyNames:P}=Object,s=Object.prototype.hasOwnProperty,l=(c,i)=>w(c,"name",{value:i,configurable:!0}),m=(c,i)=>{for(var n in i)w(c,n,{get:i[n],enumerable:!0})},k=(c,i,n,F)=>{if(i&&typeof i==="object"||typeof i==="function"){for(let f of P(i))if(!s.call(c,f)&&f!==n)w(c,f,{get:()=>i[f],enumerable:!(F=x(i,f))||F.enumerable})}return c},q=(c)=>k(w({},"__esModule",{value:!0}),c),z={};m(z,{parseUrl:()=>X});Z.exports=q(z);var p=t(),X=l((c)=>{if(typeof c==="string")return X(new URL(c));const{hostname:i,pathname:n,port:F,protocol:f,search:E}=c;let N;if(E)N=p.parseQueryString(E);return{hostname:i,port:F?parseInt(F):void 0,protocol:f,path:n,query:N}},"parseUrl")});var R=h(I(),1);var b=h(I(),1);function C(c){try{const i=new Set(Array.from(c.match(/([A-Z_]){3,}/g)??[]));return i.delete("CONFIG"),i.delete("CONFIG_PREFIX_SEPARATOR"),i.delete("ENV"),[...i].join(", ")}catch(i){return c}}var B=(c,i)=>async()=>{try{const n=c(process.env);if(n===void 0)throw new Error;return n}catch(n){throw new b.CredentialsProviderError(n.message||`Not found in ENV: ${C(c.toString())}`,{logger:i})}};var L=h(I(),1);var V=(c,{preferredFile:i="config",...n}={})=>async()=>{const F=H(n),{configFile:f,credentialsFile:E}=await K(n),N=E[F]||{},$=f[F]||{},D=i==="config"?{...N,...$}:{...$,...N};try{const A=c(D,i==="config"?f:E);if(A===void 0)throw new Error;return A}catch(g){throw new L.CredentialsProviderError(g.message||`Not found in config files w/ profile [${F}]: ${C(c.toString())}`,{logger:n.logger})}};var W=h(I(),1),u=(c)=>typeof c==="function",Y=(c)=>u(c)?async()=>await c():W.fromStatic(c);var wi=({environmentVariableSelector:c,configFileSelector:i,default:n},F={})=>R.memoize(R.chain(B(c),V(i,F),Y(n)));export{a as Db,wi as Eb};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{B as _} from"./chunk-24a86f8f5ddc0cbd.js";import{Fb as S} from"./chunk-b4cbb4706a35f5d5.js";var E=_(S(),1),p="AWS_ACCESS_KEY_ID",A="AWS_SECRET_ACCESS_KEY",C="AWS_SESSION_TOKEN",N="AWS_CREDENTIAL_EXPIRATION",I="AWS_CREDENTIAL_SCOPE",a="AWS_ACCOUNT_ID",i=(e)=>async()=>{e?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");const o=process.env[p],r=process.env[A],n=process.env[C],s=process.env[N],t=process.env[I],c=process.env[a];if(o&&r)return{accessKeyId:o,secretAccessKey:r,...n&&{sessionToken:n},...s&&{expiration:new Date(s)},...t&&{credentialScope:t},...c&&{accountId:c}};throw new E.CredentialsProviderError("Unable to find environment variable credentials.",{logger:e?.logger})};export{i as fromEnv,C as ENV_SESSION,A as ENV_SECRET,p as ENV_KEY,N as ENV_EXPIRATION,I as ENV_CREDENTIAL_SCOPE,a as ENV_ACCOUNT_ID};export{p as u,A as v,i as w};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{B as h} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-6b18189b2aabf6b7.js";import{Fb as _} from"./chunk-b4cbb4706a35f5d5.js";import{Ib as N,Jb as W,Kb as I,Nb as v,Ob as P} from"./chunk-fa61561237819f16.js";var T=h(_(),1);var H=(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 u=h(_(),1);var K=300000,g="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var R={},b=async(e)=>{const{SSOOIDCClient:r}=await import("./chunk-8e55cff6329b67a9.js");if(R[e])return R[e];const s=new r({region:e});return R[e]=s,s};var G=async(e,r)=>{const{CreateTokenCommand:s}=await import("./chunk-8e55cff6329b67a9.js");return(await b(r)).send(new s({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var U=h(_(),1);var D=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new U.TokenProviderError(`Token is expired. ${g}`,!1)};var q=h(_(),1);var p=(e,r,s=!1)=>{if(typeof r==="undefined")throw new q.TokenProviderError(`Value not present for '${e}' in SSO Token${s?". Cannot refresh":""}. ${g}`,!1)};import{promises as B} from"fs";var{writeFile:Q}=B,j=(e,r)=>{const s=W(e),t=JSON.stringify(r,null,2);return Q(s,t)};var X=new Date(0),z=(e={})=>async()=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");const r=await P(e),s=N(e),t=r[s];if(!t)throw new u.TokenProviderError(`Profile '${s}' could not be found in shared credentials file.`,!1);else if(!t.sso_session)throw new u.TokenProviderError(`Profile '${s}' is missing required property 'sso_session'.`);const i=t.sso_session,a=(await v(e))[i];if(!a)throw new u.TokenProviderError(`Sso session '${i}' could not be found in shared credentials file.`,!1);for(let n of["sso_start_url","sso_region"])if(!a[n])throw new u.TokenProviderError(`Sso session '${i}' is missing required property '${n}'.`,!1);const{sso_start_url:l,sso_region:f}=a;let o;try{o=await I(i)}catch(n){throw new u.TokenProviderError(`The SSO session token associated with profile=${s} was not found or is invalid. ${g}`,!1)}p("accessToken",o.accessToken),p("expiresAt",o.expiresAt);const{accessToken:E,expiresAt:x}=o,c={token:E,expiration:new Date(x)};if(c.expiration.getTime()-Date.now()>K)return c;if(Date.now()-X.getTime()<30000)return D(c),c;p("clientId",o.clientId,!0),p("clientSecret",o.clientSecret,!0),p("refreshToken",o.refreshToken,!0);try{X.setTime(Date.now());const n=await G(o,f);p("accessToken",n.accessToken),p("expiresIn",n.expiresIn);const w=new Date(Date.now()+n.expiresIn*1000);try{await j(i,{...o,accessToken:n.accessToken,expiresAt:w.toISOString(),refreshToken:n.refreshToken})}catch(C){}return{token:n.accessToken,expiration:w}}catch(n){return D(c),c}};var k=h(_(),1);var y=!1,A=async({ssoStartUrl:e,ssoSession:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:i,ssoClient:S,clientConfig:a,profile:l,logger:f})=>{let o;const E="To refresh this SSO session run aws sso login with the corresponding profile.";if(r)try{const d=await z({profile:l})();o={accessToken:d.token,expiresAt:new Date(d.expiration).toISOString()}}catch(d){throw new k.CredentialsProviderError(d.message,{tryNextLink:y,logger:f})}else try{o=await I(e)}catch(d){throw new k.CredentialsProviderError("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:y,logger:f})}if(new Date(o.expiresAt).getTime()-Date.now()<=0)throw new k.CredentialsProviderError("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:y,logger:f});const{accessToken:x}=o,{SSOClient:c,GetRoleCredentialsCommand:n}=await import("./chunk-b38c0c4618d0dd89.js"),w=S||new c(Object.assign({},a??{},{region:a?.region??t}));let C;try{C=await w.send(new n({accountId:s,roleName:i,accessToken:x}))}catch(d){throw new k.CredentialsProviderError(d,{tryNextLink:y,logger:f})}const{roleCredentials:{accessKeyId:m,secretAccessKey:O,sessionToken:$,expiration:F,credentialScope:L,accountId:M}={}}=C;if(!m||!O||!$||!F)throw new k.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:y,logger:f});return{accessKeyId:m,secretAccessKey:O,sessionToken:$,expiration:new Date(F),...L&&{credentialScope:L},...M&&{accountId:M}}};var J=h(_(),1),V=(e,r)=>{const{sso_start_url:s,sso_account_id:t,sso_region:i,sso_role_name:S}=e;if(!s||!t||!i||!S)throw new J.CredentialsProviderError('Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", '+`"sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:r});return e};var Ee=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");const{ssoStartUrl:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:i,ssoSession:S}=e,{ssoClient:a}=e,l=N(e);if(!r&&!s&&!t&&!i&&!S){const o=(await P(e))[l];if(!o)throw new T.CredentialsProviderError(`Profile ${l} was not found.`,{logger:e.logger});if(!H(o))throw new T.CredentialsProviderError(`Profile ${l} is not configured with SSO credentials.`,{logger:e.logger});if(o?.sso_session){const m=(await v(e))[o.sso_session],O=` configurations in profile ${l} and sso-session ${o.sso_session}`;if(t&&t!==m.sso_region)throw new T.CredentialsProviderError("Conflicting SSO region"+O,{tryNextLink:!1,logger:e.logger});if(r&&r!==m.sso_start_url)throw new T.CredentialsProviderError("Conflicting SSO start_url"+O,{tryNextLink:!1,logger:e.logger});o.sso_region=m.sso_region,o.sso_start_url=m.sso_start_url}const{sso_start_url:E,sso_account_id:x,sso_region:c,sso_role_name:n,sso_session:w}=V(o,e.logger);return A({ssoStartUrl:E,ssoSession:w,ssoAccountId:x,ssoRegion:c,ssoRoleName:n,ssoClient:a,clientConfig:e.clientConfig,profile:l})}else if(!r||!s||!t||!i)throw new T.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return A({ssoStartUrl:r,ssoSession:S,ssoAccountId:s,ssoRegion:t,ssoRoleName:i,ssoClient:a,clientConfig:e.clientConfig,profile:l})};export{V as validateSsoProfile,H as isSsoProfile,Ee as fromSSO};
|