@kya-os/mcp-i
Version:
The TypeScript MCP framework with identity features built-in
1 lines • 205 kB
JavaScript
exports.id=207,exports.ids=[207],exports.modules={2914:(e,t,n)=>{"use strict";n.d(t,{P:()=>s});var r=n(25272);const s=e=>{if("string"==typeof e)return e;if("object"!=typeof e||"number"!=typeof e.byteOffset||"number"!=typeof e.byteLength)throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return(0,r.Q)(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}},4866:(e,t,n)=>{"use strict";n.d(t,{M:()=>a});var r=n(96440),s=n(86880),i=n(77337),o=n(52445);class a extends o.t{async serializeRequest(e,t,n){const i=this.serializer,o={},a={},c=await n.endpoint(),u=r.l.of(e?.input),l=u.getSchema();let d;const p=new s.K({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:o,headers:a,body:void 0});c&&(this.updateServiceEndpoint(p,c),this.setHostPrefix(p,e,t));const m={...t};if(t){const e=u.getEventStreamMember();if(e){if(m[e]){const t={};for(const[n,r]of u.structIterator())n!==e&&m[n]&&(i.write(r,m[n]),t[n]=i.flush());d=await this.serializeEventStream({eventStream:m[e],requestSchema:u,initialRequest:t})}}else i.write(l,m),d=i.flush()}return p.headers=a,p.query=o,p.body=d,p.method="POST",p}async deserializeResponse(e,t,n){const s=this.deserializer,o=r.l.of(e.output),a={};if(n.statusCode>=300){const r=await(0,i.P)(n.body,t);throw r.byteLength>0&&Object.assign(a,await s.read(15,r)),await this.handleError(e,t,n,a,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const e in n.headers){const t=n.headers[e];delete n.headers[e],n.headers[e.toLowerCase()]=t}const c=o.getEventStreamMember();if(c)a[c]=await this.deserializeEventStream({response:n,responseSchema:o,initialResponseContainer:a});else{const e=await(0,i.P)(n.body,t);e.byteLength>0&&Object.assign(a,await s.read(o,e))}return a.$metadata=this.deserializeMetadata(n),a}}},6141:(e,t,n)=>{"use strict";var r;n.d(t,{Gz:()=>s,L0:()=>i,cm:()=>r}),function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"}(r||(r={}));const s=3,i=r.STANDARD},7317:(e,t,n)=>{"use strict";n.d(t,{vK:()=>o});var r=n(86880);const s="content-length",i={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},o=e=>({applyToStack:t=>{var n;t.add((n=e.bodyLengthChecker,e=>async t=>{const i=t.request;if(r.K.isInstance(i)){const{body:e,headers:t}=i;if(e&&-1===Object.keys(t).map(e=>e.toLowerCase()).indexOf(s))try{const t=n(e);i.headers={...i.headers,[s]:String(t)}}catch(e){}}return e({...t,request:i})}),i)}})},7940:(e,t,n)=>{"use strict";n.d(t,{$:()=>p});var r=n(23034),s=n(33938),i=n(58611),o=n(65692);const a=["ECONNRESET","EPIPE","ETIMEDOUT"],c=e=>{const t={};for(const n of Object.keys(e)){const r=e[n];t[n]=Array.isArray(r)?r.join(","):r}return t},u=(e,t)=>setTimeout(e,t),l=e=>clearTimeout(e);var d=n(2203);class p{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(e){return"function"==typeof e?.handle?e:new p(e)}static checkSocketUsage(e,t,n=console){const{sockets:r,requests:s,maxSockets:i}=e;if("number"!=typeof i||i===1/0)return t;if(Date.now()-15e3<t)return t;if(r&&s)for(const e in r){const t=r[e]?.length??0,o=s[e]?.length??0;if(t>=i&&o>=2*i)return n?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${t} and ${o} additional requests are enqueued.\nSee https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html\nor increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){this.configProvider=new Promise((t,n)=>{"function"==typeof e?e().then(e=>{t(this.resolveDefaultConfig(e))}).catch(n):t(this.resolveDefaultConfig(e))})}resolveDefaultConfig(e){const{requestTimeout:t,connectionTimeout:n,socketTimeout:r,socketAcquisitionWarningTimeout:s,httpAgent:a,httpsAgent:c,throwOnRequestTimeout:u}=e||{},l=!0;return{connectionTimeout:n,requestTimeout:t,socketTimeout:r,socketAcquisitionWarningTimeout:s,throwOnRequestTimeout:u,httpAgent:(()=>a instanceof i.Agent||"function"==typeof a?.destroy?(this.externalAgent=!0,a):new i.Agent({keepAlive:l,maxSockets:50,...a}))(),httpsAgent:(()=>c instanceof o.Agent||"function"==typeof c?.destroy?(this.externalAgent=!0,c):new o.Agent({keepAlive:l,maxSockets:50,...c}))(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:t,requestTimeout:n}={}){return this.config||(this.config=await this.configProvider),new Promise((m,h)=>{const f=this.config;let g;const y=[],b=async e=>{await g,y.forEach(l),h(e)};if(t?.aborted){const e=new Error("Request aborted");return e.name="AbortError",void b(e)}const E="https:"===e.protocol,S=e.headers??{},T="100-continue"===(S.Expect??S.expect);let C=E?f.httpsAgent:f.httpAgent;T&&!this.externalAgent&&(C=new(E?o.Agent:i.Agent)({keepAlive:!1,maxSockets:1/0})),y.push(u(()=>{this.socketWarningTimestamp=p.checkSocketUsage(C,this.socketWarningTimestamp,f.logger)},f.socketAcquisitionWarningTimeout??(f.requestTimeout??2e3)+(f.connectionTimeout??1e3)));const I=function(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=(0,s.o)(n),Array.isArray(r))for(let e=0,i=r.length;e<i;e++)t.push(`${n}=${(0,s.o)(r[e])}`);else{let e=n;(r||"string"==typeof r)&&(e+=`=${(0,s.o)(r)}`),t.push(e)}}return t.join("&")}(e.query||{});let D;null==e.username&&null==e.password||(D=`${e.username??""}:${e.password??""}`);let A=e.path;I&&(A+=`?${I}`),e.fragment&&(A+=`#${e.fragment}`);let w=e.hostname??"";w="["===w[0]&&w.endsWith("]")?e.hostname.slice(1,-1):e.hostname;const v={headers:e.headers,host:w,method:e.method,path:A,port:e.port,agent:C,auth:D},x=(E?o.request:i.request)(v,e=>{(async e=>{await g,y.forEach(l),m(e)})({response:new r.c({statusCode:e.statusCode||-1,reason:e.statusMessage,headers:c(e.headers),body:e})})});if(x.on("error",e=>{a.includes(e.code)?b(Object.assign(e,{name:"TimeoutError"})):b(e)}),t){const e=()=>{x.destroy();const e=new Error("Request aborted");e.name="AbortError",b(e)};if("function"==typeof t.addEventListener){const n=t;n.addEventListener("abort",e,{once:!0}),x.once("close",()=>n.removeEventListener("abort",e))}else t.onabort=e}const R=n??f.requestTimeout;y.push(((e,t,n=0)=>{if(!n)return-1;const r=r=>{const s=u(()=>{e.destroy(),t(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${n} ms.`),{name:"TimeoutError"}))},n-r),i=e=>{e?.connecting?e.on("connect",()=>{l(s)}):l(s)};e.socket?i(e.socket):e.on("socket",i)};return n<2e3?(r(0),0):u(r.bind(null,1e3),1e3)})(x,b,f.connectionTimeout)),y.push(((e,t,n=0,r,s)=>n?u(()=>{let i=`@smithy/node-http-handler - [${r?"ERROR":"WARN"}] a request has exceeded the configured ${n} ms requestTimeout.`;if(r){const n=Object.assign(new Error(i),{name:"TimeoutError",code:"ETIMEDOUT"});e.destroy(n),t(n)}else i+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",s?.warn?.(i)},n):-1)(x,b,R,f.throwOnRequestTimeout,f.logger??console)),y.push(((e,t,n=0)=>{const r=r=>{const s=n-r,i=()=>{e.destroy(),t(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${n} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};e.socket?(e.socket.setTimeout(s,i),e.on("close",()=>e.socket?.removeListener("timeout",i))):e.setTimeout(s,i)};return 0<n&&n<6e3?(r(0),0):u(r.bind(null,0===n?0:3e3),3e3)})(x,b,f.socketTimeout));const P=v.agent;"object"==typeof P&&"keepAlive"in P&&y.push(((e,{keepAlive:t,keepAliveMsecs:n},r=3e3)=>{if(!0!==t)return-1;const s=()=>{e.socket?e.socket.setKeepAlive(t,n||0):e.on("socket",e=>{e.setKeepAlive(t,n||0)})};return 0===r?(s(),0):u(s,r)})(x,{keepAlive:P.keepAlive,keepAliveMsecs:P.keepAliveMsecs})),g=async function(e,t,n=6e3,r=!1){const s=t.headers??{},i=s.Expect||s.expect;let o=-1,a=!0;r||"100-continue"!==i||(a=await Promise.race([new Promise(e=>{o=Number(u(()=>e(!0),Math.max(6e3,n)))}),new Promise(t=>{e.on("continue",()=>{l(o),t(!0)}),e.on("response",()=>{l(o),t(!1)}),e.on("error",()=>{l(o),t(!1)})})])),a&&function(e,t){if(t instanceof d.Readable)t.pipe(e);else{if(t){if(Buffer.isBuffer(t)||"string"==typeof t)return void e.end(t);const n=t;return"object"==typeof n&&n.buffer&&"number"==typeof n.byteOffset&&"number"==typeof n.byteLength?void e.end(Buffer.from(n.buffer,n.byteOffset,n.byteLength)):void e.end(Buffer.from(t))}e.end()}}(e,t.body)}(x,e,R,this.externalAgent).catch(e=>(y.forEach(l),h(e)))})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>({...n,[e]:t}))}httpHandlerConfigs(){return this.config??{}}}},10669:(e,t)=>{var n=Math.pow(2,8)-1,r=Math.pow(2,16)-1,s=Math.pow(2,32)-1,i=Math.pow(2,7)-1,o=Math.pow(2,15)-1,a=Math.pow(2,31)-1;t.getPointerArray=function(e){var t=e-1;return t<=n?Uint8Array:t<=r?Uint16Array:t<=s?Uint32Array:Float64Array},t.getSignedPointerArray=function(e){var t=e-1;return t<=i?Int8Array:t<=o?Int16Array:t<=a?Int32Array:Float64Array},t.getNumberType=function(e){return e===(0|e)?-1===Math.sign(e)?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var c={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(e,n){var r,s,i,o,a,u=null,l=0;for(o=0,a=e.length;o<a;o++)i=n?n(e[o]):e[o],s=t.getNumberType(i),(r=c[s.name])>l&&(l=r,u=s);return u},t.isTypedArray=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)},t.concat=function(){var e,t,n,r=0;for(e=0,n=arguments.length;e<n;e++)r+=arguments[e].length;var s=new arguments[0].constructor(r);for(e=0,t=0;e<n;e++)s.set(arguments[e],t),t+=arguments[e].length;return s},t.indices=function(e){for(var n=new(t.getPointerArray(e))(e),r=0;r<e;r++)n[r]=r;return n}},11904:(e,t,n)=>{"use strict";n.d(t,{u:()=>s});var r=n(18431);const s=e=>e[r.V]||(e[r.V]={})},12544:(e,t,n)=>{"use strict";n.d(t,{E:()=>i});var r=n(25272);const s=/^[A-Za-z0-9+/]*={0,2}$/,i=e=>{if(3*e.length%4!=0)throw new TypeError("Incorrect padding on base64 string.");if(!s.exec(e))throw new TypeError("Invalid base64 string.");const t=(0,r.s)(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}},14497:(e,t,n)=>{var r=n(53924),s=n(10669);function i(e){return"number"==typeof e.length?e.length:"number"==typeof e.size?e.size:void 0}t.isArrayLike=function(e){return Array.isArray(e)||s.isTypedArray(e)},t.guessLength=i,t.toArray=function(e){var t=i(e),n="number"==typeof t?new Array(t):[],s=0;return r(e,function(e){n[s++]=e}),n},t.toArrayWithIndices=function(e){var t=i(e),n="number"==typeof t?s.getPointerArray(t):Array,o="number"==typeof t?new Array(t):[],a="number"==typeof t?new n(t):[],c=0;return r(e,function(e){o[c]=e,a[c]=c++}),[o,a]}},17209:(e,t,n)=>{"use strict";n.d(t,{N:()=>r});class r{trace(){}debug(){}info(){}warn(){}error(){}}},17735:(e,t,n)=>{"use strict";function r(e,t){if(t.timestampFormat.useTrait&&e.isTimestampSchema()&&(5===e.getSchema()||6===e.getSchema()||7===e.getSchema()))return e.getSchema();const{httpLabel:n,httpPrefixHeaders:r,httpHeader:s,httpQuery:i}=e.getMergedTraits();return(t.httpBindings?"string"==typeof r||Boolean(s)?6:Boolean(i)||Boolean(n)?5:void 0:void 0)??t.timestampFormat.default}n.d(t,{V:()=>r})},17801:(e,t,n)=>{"use strict";n.d(t,{r:()=>p});var r=n(11904);const s=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,i=/(\d+\.){3}\d+/,o=/\.\./,a=(e,t,n)=>{const r=async()=>{const r=n[e]??n[t];return"function"==typeof r?r():r};return"credentialScope"===e||"CredentialScope"===t?async()=>{const e="function"==typeof n.credentials?await n.credentials():n.credentials;return e?.credentialScope??e?.CredentialScope}:"accountId"===e||"AccountId"===t?async()=>{const e="function"==typeof n.credentials?await n.credentials():n.credentials;return e?.accountId??e?.AccountId}:"endpoint"===e||"endpoint"===t?async()=>{if(!1===n.isCustomEndpoint)return;const e=await r();if(e&&"object"==typeof e){if("url"in e)return e.url.href;if("hostname"in e){const{protocol:t,hostname:n,port:r,path:s}=e;return`${t}//${n}${r?":"+r:""}${s}`}}return e}:r};var c=n(92255),u=n(23204);const l=async(e,t,n)=>{const r={},c=t?.getEndpointParameterInstructions?.()||{};for(const[t,s]of Object.entries(c))switch(s.type){case"staticContextParams":r[t]=s.value;break;case"contextParams":r[t]=e[s.name];break;case"clientContextParams":case"builtInParams":r[t]=await a(s.name,t,n)();break;case"operationContextParams":r[t]=s.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return 0===Object.keys(c).length&&Object.assign(r,n),"s3"===String(n.serviceId).toLowerCase()&&await(async e=>{const t=e?.Bucket||"";if("string"==typeof e.Bucket&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),(e=>{const[t,n,r,,,s]=e.split(":"),i="arn"===t&&e.split(":").length>=6,o=Boolean(i&&n&&r&&s);if(i&&!o)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return o})(t)){if(!0===e.ForcePathStyle)throw new Error("Path-style addressing cannot be used with ARN buckets")}else n=t,(!s.test(n)||i.test(n)||o.test(n)||-1!==t.indexOf(".")&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);var n;return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e})(r),r},d={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"},p=(e,t)=>({applyToStack:n=>{n.addRelativeTo((({config:e,instructions:t})=>(n,s)=>async i=>{e.isCustomEndpoint&&function(e){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features.ENDPOINT_OVERRIDE="N"}(s);const o=await(async(e,t,n,r)=>{if(!n.isCustomEndpoint){let e;e=n.serviceConfiguredEndpoint?await n.serviceConfiguredEndpoint():await(0,c.k)(n.serviceId),e&&(n.endpoint=()=>Promise.resolve((0,u.a)(e)),n.isCustomEndpoint=!0)}const s=await l(e,t,n);if("function"!=typeof n.endpointProvider)throw new Error("config.endpointProvider is not set.");return n.endpointProvider(s,r)})(i.input,{getEndpointParameterInstructions:()=>t},{...e},s);s.endpointV2=o,s.authSchemes=o.properties?.authSchemes;const a=s.authSchemes?.[0];if(a){s.signing_region=a.signingRegion,s.signing_service=a.signingName;const e=(0,r.u)(s),t=e?.selectedHttpAuthScheme?.httpAuthOption;t&&(t.signingProperties=Object.assign(t.signingProperties||{},{signing_region:a.signingRegion,signingRegion:a.signingRegion,signing_service:a.signingName,signingName:a.signingName,signingRegionSet:a.signingRegionSet},a.properties))}return n({...i})})({config:e,instructions:t}),d)}})},18241:(e,t,n)=>{"use strict";var r;n.d(t,{c:()=>r}),function(e){e.ENV="env",e.CONFIG="shared config entry"}(r||(r={}))},18431:(e,t,n)=>{"use strict";n.d(t,{V:()=>r});const r="__smithy_context"},19849:(e,t,n)=>{"use strict";n.d(t,{B:()=>r});const r=(e,t,n)=>{let r,s,i,o=!1;const a=async()=>{s||(s=e());try{r=await s,i=!0,o=!1}finally{s=void 0}return r};return void 0===t?async e=>(i&&!e?.forceRefresh||(r=await a()),r):async e=>(i&&!e?.forceRefresh||(r=await a()),o?r:n&&!n(r)?(o=!0,r):t(r)?(await a(),r):r)}},21055:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});const r=(e,t)=>{const n=[];if(e&&n.push(e),t)for(const e of t)n.push(e);return n},s=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,i=()=>{let e=[],t=[],n=!1;const c=new Set,u=n=>(e.forEach(e=>{n.add(e.middleware,{...e})}),t.forEach(e=>{n.addRelativeTo(e.middleware,{...e})}),n.identifyOnResolve?.(p.identifyOnResolve()),n),l=e=>{const t=[];return e.before.forEach(e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...l(e))}),t.push(e),e.after.reverse().forEach(e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...l(e))}),t},d=(n=!1)=>{const i=[],c=[],u={};var d;return e.forEach(e=>{const t={...e,before:[],after:[]};for(const e of r(t.name,t.aliases))u[e]=t;i.push(t)}),t.forEach(e=>{const t={...e,before:[],after:[]};for(const e of r(t.name,t.aliases))u[e]=t;c.push(t)}),c.forEach(e=>{if(e.toMiddleware){const t=u[e.toMiddleware];if(void 0===t){if(n)return;throw new Error(`${e.toMiddleware} is not found when adding ${s(e.name,e.aliases)} middleware ${e.relation} ${e.toMiddleware}`)}"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}}),(d=i,d.sort((e,t)=>o[t.step]-o[e.step]||a[t.priority||"normal"]-a[e.priority||"normal"])).map(l).reduce((e,t)=>(e.push(...t),e),[])},p={add:(t,n={})=>{const{name:i,override:o,aliases:a}=n,u={step:"initialize",priority:"normal",middleware:t,...n},l=r(i,a);if(l.length>0){if(l.some(e=>c.has(e))){if(!o)throw new Error(`Duplicate middleware name '${s(i,a)}'`);for(const t of l){const n=e.findIndex(e=>e.name===t||e.aliases?.some(e=>e===t));if(-1===n)continue;const r=e[n];if(r.step!==u.step||u.priority!==r.priority)throw new Error(`"${s(r.name,r.aliases)}" middleware with ${r.priority} priority in ${r.step} step cannot be overridden by "${s(i,a)}" middleware with ${u.priority} priority in ${u.step} step.`);e.splice(n,1)}}for(const e of l)c.add(e)}e.push(u)},addRelativeTo:(e,n)=>{const{name:i,override:o,aliases:a}=n,u={middleware:e,...n},l=r(i,a);if(l.length>0){if(l.some(e=>c.has(e))){if(!o)throw new Error(`Duplicate middleware name '${s(i,a)}'`);for(const e of l){const n=t.findIndex(t=>t.name===e||t.aliases?.some(t=>t===e));if(-1===n)continue;const r=t[n];if(r.toMiddleware!==u.toMiddleware||r.relation!==u.relation)throw new Error(`"${s(r.name,r.aliases)}" middleware ${r.relation} "${r.toMiddleware}" middleware cannot be overridden by "${s(i,a)}" middleware ${u.relation} "${u.toMiddleware}" middleware.`);t.splice(n,1)}}for(const e of l)c.add(e)}t.push(u)},clone:()=>u(i()),use:e=>{e.applyToStack(p)},remove:n=>"string"==typeof n?(n=>{let s=!1;const i=e=>{const t=r(e.name,e.aliases);if(t.includes(n)){s=!0;for(const e of t)c.delete(e);return!1}return!0};return e=e.filter(i),t=t.filter(i),s})(n):(n=>{let s=!1;const i=e=>{if(e.middleware===n){s=!0;for(const t of r(e.name,e.aliases))c.delete(t);return!1}return!0};return e=e.filter(i),t=t.filter(i),s})(n),removeByTag:n=>{let s=!1;const i=e=>{const{tags:t,name:i,aliases:o}=e;if(t&&t.includes(n)){const e=r(i,o);for(const t of e)c.delete(t);return s=!0,!1}return!0};return e=e.filter(i),t=t.filter(i),s},concat:e=>{const t=u(i());return t.use(e),t.identifyOnResolve(n||t.identifyOnResolve()||(e.identifyOnResolve?.()??!1)),t},applyToStack:u,identify:()=>d(!0).map(e=>{const t=e.step??e.relation+" "+e.toMiddleware;return s(e.name,e.aliases)+" - "+t}),identifyOnResolve:e=>("boolean"==typeof e&&(n=e),n),resolve:(e,t)=>{for(const n of d().map(e=>e.middleware).reverse())e=n(e,t);return n&&console.log(p.identify()),e}};return p},o={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},a={high:3,normal:2,low:1}},21954:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});class r{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(!1===n)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const e=this.data.keys();let t=0;for(;;){const{value:n,done:r}=e.next();if(this.data.delete(n),r||++t>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(0===n.length)return!1;for(const r of n){const n=String(e[r]??"");if(n.includes("|;"))return!1;t+=n+"|;"}return t}}},22461:(e,t,n)=>{"use strict";n.d(t,{cJ:()=>o,Y2:()=>i});var r=n(77337),s=n(2914);const i=(e,t)=>((e,t)=>(0,r.P)(e,t).then(e=>(t?.utf8Encoder??s.P)(e)))(e,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(t){throw"SyntaxError"===t?.name&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}return{}}),o=(e,t)=>{const n=(e,t)=>Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase()),r=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},s=n(e.headers,"x-amzn-errortype");if(void 0!==s)return r(e.headers[s]);if(t&&"object"==typeof t){const e=n(t,"code");if(e&&void 0!==t[e])return r(t[e]);if(void 0!==t.__type)return r(t.__type)}}},23034:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});class r{statusCode;reason;headers;body;constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers}}},23204:(e,t,n)=>{"use strict";n.d(t,{a:()=>s});var r=n(71918);const s=e=>"object"==typeof e?"url"in e?(0,r.D)(e.url):e:(0,r.D)(e)},25272:(e,t,n)=>{"use strict";n.d(t,{Q:()=>i,s:()=>o});var r=n(82752),s=n(20181);const i=(e,t=0,n=e.byteLength-t)=>{if(!(0,r.m)(e))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return s.Buffer.from(e,t,n)},o=(e,t)=>{if("string"!=typeof e)throw new TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?s.Buffer.from(e,t):s.Buffer.from(e)}},26433:(e,t,n)=>{"use strict";n.d(t,{g:()=>i});var r=n(16928),s=n(51362);const i=()=>process.env.AWS_CONFIG_FILE||(0,r.join)((0,s.R)(),".aws","config")},28075:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(19849),s=n(76896),i=n(84122);function o(e){try{const t=new Set(Array.from(e.match(/([A-Z_]){3,}/g)??[]));return t.delete("CONFIG"),t.delete("CONFIG_PREFIX_SEPARATOR"),t.delete("ENV"),[...t].join(", ")}catch(t){return e}}var a=n(76682),c=n(64549);const u=({environmentVariableSelector:e,configFileSelector:t,default:n},u={})=>{const{signingName:l,logger:d}=u,p={signingName:l,logger:d};return(0,r.B)((0,s.c)((m=e,h=p,async()=>{try{const e=m(process.env,h);if(void 0===e)throw new Error;return e}catch(e){throw new i.C(e.message||`Not found in ENV: ${o(m.toString())}`,{logger:h?.logger})}}),((e,{preferredFile:t="config",...n}={})=>async()=>{const r=(0,a.Bz)(n),{configFile:s,credentialsFile:u}=await(0,c.p)(n),l=u[r]||{},d=s[r]||{},p="config"===t?{...l,...d}:{...d,...l};try{const n=e(p,"config"===t?s:u);if(void 0===n)throw new Error;return n}catch(t){throw new i.C(t.message||`Not found in config files w/ profile [${r}]: ${o(e.toString())}`,{logger:n.logger})}})(t,u),(e=>{return"function"==typeof e?async()=>await e():(t=e,()=>Promise.resolve(t));var t})(n)));var m,h}},29624:(e,t,n)=>{"use strict";n.d(t,{GQ:()=>l,Qb:()=>c,bV:()=>u});const r=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],s=["TimeoutError","RequestTimeout","RequestTimeoutException"],i=[500,502,503,504],o=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],a=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],c=e=>429===e.$metadata?.httpStatusCode||r.includes(e.name)||1==e.$retryable?.throttling,u=(e,t=0)=>(e=>void 0!==e?.$retryable)(e)||(e=>e.$metadata?.clockSkewCorrected)(e)||s.includes(e.name)||o.includes(e?.code||"")||a.includes(e?.code||"")||i.includes(e.$metadata?.httpStatusCode||0)||(e=>{const t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return!!(e&&e instanceof TypeError)&&t.has(e.message)})(e)||void 0!==e.cause&&t<=10&&u(e.cause,t+1),l=e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!u(e)}return!1}},30379:(e,t,n)=>{"use strict";n.d(t,{h:()=>W});var r=n(53243),s=n(75289);const i=function(e){return o(e)&&e.expiration.getTime()-Date.now()<3e5};const o=e=>void 0!==e.expiration;var a=n(92278),c=n(87140);const u="X-Amz-Date",l="X-Amz-Signature",d="X-Amz-Security-Token",p="authorization",m=u.toLowerCase(),h=[p,m,"date"],f=l.toLowerCase(),g="x-amz-content-sha256",y=d.toLowerCase(),b={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},E=/^proxy-/,S=/^sec-/,T="AWS4-HMAC-SHA256",C="AWS4-HMAC-SHA256-PAYLOAD",I="aws4_request",D={},A=[],w=(e,t,n)=>`${e}/${t}/${n}/${I}`,v=(e,t,n)=>{const r=new e(t);return r.update((0,c.F)(n)),r.digest()},x=({headers:e},t,n)=>{const r={};for(const s of Object.keys(e).sort()){if(null==e[s])continue;const i=s.toLowerCase();(i in b||t?.has(i)||E.test(i)||S.test(i))&&(!n||n&&!n.has(i))||(r[i]=e[s].trim().replace(/\s+/g," "))}return r};var R=n(82752);const P=async({headers:e,body:t},n)=>{for(const t of Object.keys(e))if(t.toLowerCase()===g)return e[t];if(null==t)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if("string"==typeof t||ArrayBuffer.isView(t)||(0,R.m)(t)){const e=new n;return e.update((0,c.F)(t)),(0,a.n)(await e.digest())}return"UNSIGNED-PAYLOAD"};var N,O=n(40935);class L{format(e){const t=[];for(const n of Object.keys(e)){const r=(0,O.a)(n);t.push(Uint8Array.from([r.byteLength]),r,this.formatHeaderValue(e[n]))}const n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0));let r=0;for(const e of t)n.set(e,r),r+=e.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const r=new Uint8Array(9);return r[0]=5,r.set(e.value.bytes,1),r;case"binary":const s=new DataView(new ArrayBuffer(3+e.value.byteLength));s.setUint8(0,6),s.setUint16(1,e.value.byteLength,!1);const i=new Uint8Array(s.buffer);return i.set(e.value,3),i;case"string":const o=(0,O.a)(e.value),c=new DataView(new ArrayBuffer(3+o.byteLength));c.setUint8(0,7),c.setUint16(1,o.byteLength,!1);const u=new Uint8Array(c.buffer);return u.set(o,3),u;case"timestamp":const l=new Uint8Array(9);return l[0]=8,l.set(_.fromNumber(e.value.valueOf()).bytes,1),l;case"uuid":if(!B.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const d=new Uint8Array(17);return d[0]=9,d.set((0,a.a)(e.value.replace(/\-/g,"")),1),d}}}!function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"}(N||(N={}));const B=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class _{bytes;constructor(e){if(this.bytes=e,8!==e.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let n=7,r=Math.abs(Math.round(e));n>-1&&r>0;n--,r/=256)t[n]=r;return e<0&&k(t),new _(t)}valueOf(){const e=this.bytes.slice(0),t=128&e[0];return t&&k(e),parseInt((0,a.n)(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function k(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,0===e[t]);t--);}var U=n(86880);const $=e=>{e=U.K.clone(e);for(const t of Object.keys(e.headers))h.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e};var M=n(98367),G=n(33938);class F{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:s,uriEscapePath:i=!0}){this.service=r,this.sha256=s,this.uriEscapePath=i,this.applyChecksum="boolean"!=typeof e||e,this.regionProvider=(0,M.t)(n),this.credentialProvider=(0,M.t)(t)}createCanonicalRequest(e,t,n){const r=Object.keys(t).sort();return`${e.method}\n${this.getCanonicalPath(e)}\n${(({query:e={}})=>{const t=[],n={};for(const r of Object.keys(e)){if(r.toLowerCase()===f)continue;const s=(0,G.o)(r);t.push(s);const i=e[r];"string"==typeof i?n[s]=`${s}=${(0,G.o)(i)}`:Array.isArray(i)&&(n[s]=i.slice(0).reduce((e,t)=>e.concat([`${s}=${(0,G.o)(t)}`]),[]).sort().join("&"))}return t.sort().map(e=>n[e]).filter(e=>e).join("&")})(e)}\n${r.map(e=>`${e}:${t[e]}`).join("\n")}\n\n${r.join(";")}\n${n}`}async createStringToSign(e,t,n,r){const s=new this.sha256;s.update((0,c.F)(n));const i=await s.digest();return`${r}\n${e}\n${t}\n${(0,a.n)(i)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const n of e.split("/"))0!==n?.length&&"."!==n&&(".."===n?t.pop():t.push(n));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return(0,G.o)(n).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if("object"!=typeof e||"string"!=typeof e.accessKeyId||"string"!=typeof e.secretAccessKey)throw new Error("Resolved credential object is not valid")}formatDate(e){const t=(n=e,(e=>"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e)(n).toISOString().replace(/\.\d{3}Z$/,"Z")).replace(/[\-:]/g,"");var n;return{longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}class j extends F{headerFormatter=new L;constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:s,uriEscapePath:i=!0}){super({applyChecksum:e,credentials:t,region:n,service:r,sha256:s,uriEscapePath:i})}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:r=3600,unsignableHeaders:s,unhoistableHeaders:i,signableHeaders:o,hoistableHeaders:a,signingRegion:c,signingService:p}=t,m=await this.credentialProvider();this.validateResolvedCredentials(m);const h=c??await this.regionProvider(),{longDate:f,shortDate:g}=this.formatDate(n);if(r>604800)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const y=w(g,h,p??this.service),b=((e,t={})=>{const{headers:n,query:r={}}=U.K.clone(e);for(const e of Object.keys(n)){const s=e.toLowerCase();("x-amz-"===s.slice(0,6)&&!t.unhoistableHeaders?.has(s)||t.hoistableHeaders?.has(s))&&(r[e]=n[e],delete n[e])}return{...e,headers:n,query:r}})($(e),{unhoistableHeaders:i,hoistableHeaders:a});m.sessionToken&&(b.query[d]=m.sessionToken),b.query["X-Amz-Algorithm"]=T,b.query["X-Amz-Credential"]=`${m.accessKeyId}/${y}`,b.query[u]=f,b.query["X-Amz-Expires"]=r.toString(10);const E=x(b,s,o);return b.query["X-Amz-SignedHeaders"]=this.getCanonicalHeaderList(E),b.query[l]=await this.getSignature(f,y,this.getSigningKey(m,h,g,p),this.createCanonicalRequest(b,E,await P(e,this.sha256))),b}async sign(e,t){return"string"==typeof e?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:r,signingRegion:s,signingService:i}){const o=s??await this.regionProvider(),{shortDate:c,longDate:u}=this.formatDate(n),l=w(c,o,i??this.service),d=await P({headers:{},body:t},this.sha256),p=new this.sha256;p.update(e);const m=(0,a.n)(await p.digest()),h=[C,u,l,r,m,d].join("\n");return this.signString(h,{signingDate:n,signingRegion:o,signingService:i})}async signMessage(e,{signingDate:t=new Date,signingRegion:n,signingService:r}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:n,signingService:r,priorSignature:e.priorSignature}).then(t=>({message:e.message,signature:t}))}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:r}={}){const s=await this.credentialProvider();this.validateResolvedCredentials(s);const i=n??await this.regionProvider(),{shortDate:o}=this.formatDate(t),u=new this.sha256(await this.getSigningKey(s,i,o,r));return u.update((0,c.F)(e)),(0,a.n)(await u.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:r,signingRegion:s,signingService:i}={}){const o=await this.credentialProvider();this.validateResolvedCredentials(o);const a=s??await this.regionProvider(),c=$(e),{longDate:u,shortDate:l}=this.formatDate(t),d=w(l,a,i??this.service);c.headers[m]=u,o.sessionToken&&(c.headers[y]=o.sessionToken);const h=await P(c,this.sha256);!((e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1})(g,c.headers)&&this.applyChecksum&&(c.headers[g]=h);const f=x(c,r,n),b=await this.getSignature(u,d,this.getSigningKey(o,a,l,i),this.createCanonicalRequest(c,f,h));return c.headers[p]=`${T} Credential=${o.accessKeyId}/${d}, SignedHeaders=${this.getCanonicalHeaderList(f)}, Signature=${b}`,c}async getSignature(e,t,n,r){const s=await this.createStringToSign(e,t,r,T),i=new this.sha256(await n);return i.update((0,c.F)(s)),(0,a.n)(await i.digest())}getSigningKey(e,t,n,r){return(async(e,t,n,r,s)=>{const i=await v(e,t.secretAccessKey,t.accessKeyId),o=`${n}:${r}:${s}:${(0,a.n)(i)}:${t.sessionToken}`;if(o in D)return D[o];for(A.push(o);A.length>50;)delete D[A.shift()];let c=`AWS4${t.secretAccessKey}`;for(const t of[n,r,s,I])c=await v(e,c,t);return D[o]=c})(this.sha256,e,n,t,r||this.service)}}const W=e=>{let t,n=e.credentials,a=!!e.credentials;Object.defineProperty(e,"credentials",{set(c){c&&c!==n&&c!==t&&(a=!0),n=c;const u=function(e,{credentials:t,credentialDefaultProvider:n}){let r;return r=t?t?.memoized?t:((e,t,n)=>{if(void 0===e)return;const r="function"!=typeof e?async()=>Promise.resolve(e):e;let s,i,o,a=!1;const c=async e=>{i||(i=r(e));try{s=await i,o=!0,a=!1}finally{i=void 0}return s};return void 0===t?async e=>(o&&!e?.forceRefresh||(s=await c(e)),s):async e=>(o&&!e?.forceRefresh||(s=await c(e)),a?s:n(s)?t(s)?(await c(e),s):s:(a=!0,s))})(t,i,o):n?(0,s.t)(n(Object.assign({},e,{parentClientConfig:e}))):async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},r.memoized=!0,r}(e,{credentials:n,credentialDefaultProvider:e.credentialDefaultProvider}),l=function(e,t){if(t.configBound)return t;const n=async n=>t({...n,callerClientConfig:e});return n.memoized=t.memoized,n.configBound=!0,n}(e,u);a&&!l.attributed?(t=async e=>l(e).then(e=>(0,r.g)(e,"CREDENTIALS_CODE","e")),t.memoized=l.memoized,t.configBound=l.configBound,t.attributed=!0):t=l},get:()=>t,enumerable:!0,configurable:!0}),e.credentials=n;const{signingEscapePath:c=!0,systemClockOffset:u=e.systemClockOffset||0,sha256:l}=e;let d;return d=e.signer?(0,s.t)(e.signer):e.regionInfoProvider?()=>(0,s.t)(e.region)().then(async t=>[await e.regionInfoProvider(t,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},t]).then(([t,n])=>{const{signingRegion:r,signingService:s}=t;e.signingRegion=e.signingRegion||r||n,e.signingName=e.signingName||s||e.serviceId;const i={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:l,uriEscapePath:c};return new(e.signerConstructor||j)(i)}):async t=>{const n=(t=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await(0,s.t)(e.region)(),properties:{}},t)).signingRegion,r=t.signingName;e.signingRegion=e.signingRegion||n,e.signingName=e.signingName||r||e.serviceId;const i={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:l,uriEscapePath:c};return new(e.signerConstructor||j)(i)},Object.assign(e,{systemClockOffset:u,signingEscapePath:c,signer:d})}},30970:(e,t,n)=>{"use strict";n.d(t,{Df:()=>o,G8:()=>s,Rn:()=>c,XP:()=>u,XS:()=>a,bp:()=>r,jh:()=>i,l5:()=>l,ok:()=>d});const r=100,s=2e4,i=500,o=500,a=5,c=10,u=1,l="amz-sdk-invocation-id",d="amz-sdk-request"},31965:(e,t,n)=>{"use strict";n.d(t,{qs:()=>m,kN:()=>f,$z:()=>h});var r=n(98367),s=n(6141),i=n(29624);class o{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;currentCapacity=0;enabled=!1;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8;const t=this.getCurrentTimeInSeconds();this.lastThrottleTime=t,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){const t=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise(e=>o.setTimeoutFn(e,t))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp)return void(this.lastTimestamp=e);const t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}updateClientSendingRate(e){let t;if(this.updateMeasuredRate(),(0,i.Qb)(e)){const e=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=e,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(e),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const n=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(n)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){const e=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(e*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}var a=n(30970);const c=({retryDelay:e,retryCount:t,retryCost:n})=>({getRetryCount:()=>t,getRetryDelay:()=>Math.min(a.G8,e),getRetryCost:()=>n});class u{maxAttempts;mode=s.cm.STANDARD;capacity=a.Df;retryBackoffStrategy=(()=>{let e=a.bp;return{computeNextBackoffDelay:t=>Math.floor(Math.min(a.G8,Math.random()*2**t*e)),setDelayBase:t=>{e=t}}})();maxAttemptsProvider;constructor(e){this.maxAttempts=e,this.maxAttemptsProvider="function"==typeof e?e:async()=>e}async acquireInitialRetryToken(e){return c({retryDelay:a.bp,retryCount:0})}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts();if(this.shouldRetry(e,t,n)){const n=t.errorType;this.retryBackoffStrategy.setDelayBase("THROTTLING"===n?a.jh:a.bp);const r=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),s=t.retryAfterHint?Math.max(t.retryAfterHint.getTime()-Date.now()||0,r):r,i=this.getCapacityCost(n);return this.capacity-=i,c({retryDelay:s,retryCount:e.getRetryCount()+1,retryCost:i})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(a.Df,this.capacity+(e.getRetryCost()??a.XP))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(e){return console.warn(`Max attempts provider could not resolve. Using default of ${s.Gz}`),s.Gz}}shouldRetry(e,t,n){return e.getRetryCount()+1<n&&this.capacity>=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return"TRANSIENT"===e?a.Rn:a.XS}isRetryableError(e){return"THROTTLING"===e||"TRANSIENT"===e}}class l{maxAttemptsProvider;rateLimiter;standardRetryStrategy;mode=s.cm.ADAPTIVE;constructor(e,t){this.maxAttemptsProvider=e;const{rateLimiter:n}=t??{};this.rateLimiter=n??new o,this.standardRetryStrategy=new u(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}const d="AWS_MAX_ATTEMPTS",p="max_attempts",m={environmentVariableSelector:e=>{const t=e[d];if(!t)return;const n=parseInt(t);if(Number.isNaN(n))throw new Error(`Environment variable ${d} mast be a number, got "${t}"`);return n},configFileSelector:e=>{const t=e[p];if(!t)return;const n=parseInt(t);if(Number.isNaN(n))throw new Error(`Shared config file entry ${p} mast be a number, got "${t}"`);return n},default:s.Gz},h=e=>{const{retryStrategy:t,retryMode:n,maxAttempts:i}=e,o=(0,r.t)(i??s.Gz);return Object.assign(e,{maxAttempts:o,retryStrategy:async()=>t||(await(0,r.t)(n)()===s.cm.ADAPTIVE?new l(o):new u(o))})},f={environmentVariableSelector:e=>e.AWS_RETRY_MODE,configFileSelector:e=>e.retry_mode,default:s.L0}},33938:(e,t,n)=>{"use strict";n.d(t,{o:()=>r});const r=e=>encodeURIComponent(e).replace(/[!'()*]/g,s),s=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`},33939:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(62022),s=n(45223);const i=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,o=["__proto__","profile __proto__"],a=e=>{const t={};let n,a;for(const c of e.split(/\r?\n/)){const e=c.split(/(^|\s)[;#]/)[0].trim();if("["===e[0]&&"]"===e[e.length-1]){n=void 0,a=void 0;const t=e.substring(1,e.length-1),c=i.exec(t);if(c){const[,e,,t]=c;Object.values(r.I).includes(e)&&(n=[e,t].join(s.Q))}else n=t;if(o.includes(t))throw new Error(`Found invalid profile name "${t}"`)}else if(n){const r=e.indexOf("=");if(![0,-1].includes(r)){const[i,o]=[e.substring(0,r).trim(),e.substring(r+1).trim()];if(""===o)a=i;else{a&&c.trimStart()===c&&(a=void 0),t[n]=t[n]||{};const e=a?[a,i].join(s.Q):i;t[n][e]=o}}}}return t}},34708:(e,t,n)=>{"use strict";n.d(t,{v4:()=>a});var r=n(76982),s=n.n(r);const i=s().randomUUID.bind(s()),o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),a=()=>{if(i)return i();const e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128,o[e[0]]+o[e[1]]+o[e[2]]+o[e[3]]+"-"+o[e[4]]+o[e[5]]+"-"+o[e[6]]+o[e[7]]+"-"+o[e[8]]+o[e[9]]+"-"+o[e[10]]+o[e[11]]+o[e[12]]+o[e[13]]+o[e[14]]+o[e[15]]}},37882:(e,t,n)=>{"use strict";n.d(t,{JV:()=>h,l3:()=>I,EI:()=>g,t_:()=>b,xE:()=>C});const r=e=>{if(null!=e){if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&d.warn(l(`Expected number but observed string: ${e}`)),t}if("number"==typeof e)return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},s=Math.ceil(2**127*(2-2**-23)),i=(e,t)=>{const n=(e=>{if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}})(e);if(void 0!==n&&o(n,t)!==n)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return n},o=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},a=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,c=e=>{const t=e.match(a);if(null===t||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},u=e=>(e=>i(e,16))("string"==typeof e?c(e):e),l=e=>String(new TypeError(e).stack||e).split("\n").slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join("\n"),d={warn:console.warn},p=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function h(e){const t=e.getUTCFullYear(),n=e.getUTCMonth(),r=e.getUTCDay(),s=e.getUTCDate(),i=e.getUTCHours(),o=e.getUTCMinutes(),a=e.getUTCSeconds(),c=s<10?`0${s}`:`${s}`,u=i<10?`0${i}`:`${i}`,l=o<10?`0${o}`:`${o}`,d=a<10?`0${a}`:`${a}`;return`${p[r]}, ${c} ${m[n]} ${t} ${u}:${l}:${d} GMT`}const f=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),g=e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=f.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[n,r,s,i,o,a,c,l]=t,d=u(B(r)),p=N(s,"month",1,12),m=N(i,"day",1,31);return D(d,p,m,{hours:o,minutes:a,seconds:c,fractionalMilliseconds:l})},y=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),b=e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=y.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[n,r,s,i,o,a,c,l,d]=t,p=u(B(r)),m=N(s,"month",1,12),h=N(i,"day",1,31),f=D(p,m,h,{hours:o,minutes:a,seconds:c,fractionalMilliseconds:l});return"Z"!=d.toUpperCase()&&f.setTime(f.getTime()-L(d)),f},E=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$/),S=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$/),T=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})$/),C=e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=E.exec(e);if(t){const[e,n,r,s,i,o,a,c]=t;return D(u(B(s)),v(r),N(n,"day",1,31),{hours:i,minutes:o,seconds:a,fractionalMilliseconds:c})}if(t=S.exec(e),t){const[e,n,r,s,i,o,a,c]=t;return w(D(A(s),v(r),N(n,"day",1,31),{hours:i,minutes:o,seconds:a,fractionalMilliseconds:c}))}if(t=T.exec(e),t){const[e,n,r,s,i,o,a,c]=t;return D(u(B(c)),v(n),N(r.trimLeft(),"day",1,31),{hours:s,minutes:i,seconds:o,fractionalMilliseconds:a})}throw new TypeError("Invalid RFC-7231 date-time value")},I=e=>{if(null==e)return;let t;if("number"==typeof e)t=e;else if("string"==typeof e)t=(e=>r("string"==typeof e?c(e):e))(e);else{if("object"!=typeof e||1!==e.tag)throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");t=e.value}if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(1e3*t))},D=(e,t,n,r)=>{const s=t-1;return R(e,s,n),new Date(Date.UTC(e,s,n,N(r.hours,"hour",0,23),N(r.minutes,"minute",0,59),N(r.seconds,"seconds",0,60),O(r.fractionalMilliseconds)))},A=e=>{const t=(new Date).getUTCFullYear(),n=100*Math.floor(t/100)+u(B(e));return n<t?n+100:n},w=e=>e.getTime()-(new Date).getTime()>15768e8?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,v=e=>{const t=m.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},x=[31,28,31,30,31,30,31,31,30,31,30,31],R=(e,t,n)=>{let r=x[t];if(1===t&&P(e)&&(r=29),n>r)throw new TypeError(`Invalid day for ${m[t]} in ${e}: ${n}`)},P=e=>e%4==0&&(e%100!=0||e%400==0),N=(e,t,n,r)=>{const s=(e=>(e=>i(e,8))("string"==typeof e?c(e):e))(B(e));if(s<n||s>r)throw new TypeError(`${t} must be between ${n} and ${r}, inclusive`);return s},O=e=>null==e?0:1e3*(e=>(e=>{const t=r(e);if(void 0!==t&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>s)throw new TypeError(`Expected 32-bit float, got ${e}`);return t})("string"==typeof e?c(e):e))("0."+e),L=e=>{const t=e[0];let n=1;if("+"==t)n=1;else{if("-"!=t)throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);n=-1}return n*(60*Number(e.substring(1,3))+Number(e.substring(4,6)))*60*1e3},B=e=>{let t=0;for(;t<e.length-1&&"0"===e.charAt(t);)t++;return 0===t?e:e.slice(t)}},38796:(e,t,n)=>{"use strict";n.d(t,{O:()=>r});class r{namespace;schemas;exceptions;static registries=new Map;constructor(e,t=new Map,n=new Map){this.namespace=e,this.schemas=t,this.exceptions=n}static for(e){return r.registries.has(e)||r.registries.set(e,new r(e)),r.registries.get(e)}register(e,t){const n=this.normalizeShapeId(e);r.for(n.split("#")[0]).schemas.set(n,t)}getSchema(e){const t=this.normalizeShapeId(e);if(!this.schemas.has(t))throw new Error(`@smithy/core/schema - schema not found for ${t}`);return this.schemas.get(t)}registerError(e,t){const n=e,s=r.for(n[1]);s.schemas.set(n[1]+"#"+n[2],n),s.exceptions.set(n,t)}getErrorCtor(e){const t=e;return r.for(t[1]).exceptions.get(t)}getBaseException(){for(const e of this.exceptions.keys())if(Array.isArray(e)){const[,t,n]=e,r=t+"#"+n;if(r.startsWith("smithy.ts.sdk.synthetic.")&&r.endsWith("ServiceException"))return e}}find(e){return[...this.schemas.values()].find(e)}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}}},39181:(e,t,n)=>{"use strict";n.d(t,{n:()=>i});var r=n(25272),s=n(40935);const i=e=>{let t;if(t="string"==typeof e?(0,s.a)(e):e,"object"!=typeof t||"number"!=typeof t.byteOffset||"number"!=typeof t.byteLength)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return(0,r.Q)(t.buffer,t.byteOffset,t.byteLength).toString("base64")}},40935:(e,t,n)=>{"use strict";n.d(t,{a:()=>s});var r=n(25272);const s=e=>{const t=(0,r.s)(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)}},41206:e=>{function t(e){Object.defineProperty(this,"_