@stacksjs/buddy 0.70.3 → 0.70.4

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.
Files changed (45) hide show
  1. package/dist/{chunk-tkegy5p0.js → chunk-2pj0cr49.js} +1 -1
  2. package/dist/chunk-2xrqj8ap.js +2 -0
  3. package/dist/{chunk-0fgzbrz9.js → chunk-5eh2tfep.js} +2 -2
  4. package/dist/chunk-5vhayxpk.js +25 -0
  5. package/dist/{chunk-2q3mcqfe.js → chunk-5x7y4ng3.js} +1 -1
  6. package/dist/chunk-5yawz4bx.js +2 -0
  7. package/dist/{chunk-966n174t.js → chunk-7kc7thq5.js} +97 -97
  8. package/dist/{chunk-345bdf4a.js → chunk-7mjm5rg8.js} +2 -2
  9. package/dist/{chunk-7t0ysgm2.js → chunk-8acb2bq0.js} +1 -1
  10. package/dist/chunk-9gzvq5jq.js +2 -0
  11. package/dist/{chunk-71cavm44.js → chunk-bgqy98qw.js} +2 -2
  12. package/dist/chunk-e1kefb68.js +2 -0
  13. package/dist/{chunk-pz29bmgq.js → chunk-fds99vbx.js} +1 -1
  14. package/dist/chunk-jky37dv1.js +5 -0
  15. package/dist/{chunk-rhdqf1fg.js → chunk-ks9kq37e.js} +1 -1
  16. package/dist/chunk-mzgfvbmm.js +2 -0
  17. package/dist/chunk-tv4f0d0g.js +2 -0
  18. package/dist/{chunk-fbrv75rg.js → chunk-tx5yb9wb.js} +1 -1
  19. package/dist/chunk-v3a5yzn6.js +3 -0
  20. package/dist/chunk-vrd8j1ky.js +3 -0
  21. package/dist/{chunk-twkarr5s.js → chunk-ww48v0ap.js} +2 -2
  22. package/dist/chunk-wz2wxp9f.js +6 -0
  23. package/dist/chunk-y4k8k1by.js +3 -0
  24. package/dist/chunk-yatzvt36.js +2 -0
  25. package/dist/{chunk-ztm93vkv.js → chunk-yv49ttdw.js} +1 -1
  26. package/dist/chunk-z80nypa9.js +1 -0
  27. package/dist/chunk-zm0j2nyb.js +1 -0
  28. package/dist/cli.js +1 -1
  29. package/dist/index.js +1 -1
  30. package/package.json +45 -45
  31. package/dist/chunk-03ymr2cw.js +0 -3
  32. package/dist/chunk-0khc6tza.js +0 -2
  33. package/dist/chunk-301er4b5.js +0 -6
  34. package/dist/chunk-3f7fcm7g.js +0 -3
  35. package/dist/chunk-8aafqzex.js +0 -2
  36. package/dist/chunk-bjcpc2fx.js +0 -2
  37. package/dist/chunk-fqsv3t0n.js +0 -2
  38. package/dist/chunk-jfawek76.js +0 -2
  39. package/dist/chunk-kvbqhdsx.js +0 -2
  40. package/dist/chunk-nxggmsrw.js +0 -3
  41. package/dist/chunk-pq7ppnwe.js +0 -5
  42. package/dist/chunk-tanrsj9k.js +0 -2
  43. package/dist/chunk-w7sdm1re.js +0 -2
  44. package/dist/chunk-wemxm45h.js +0 -2
  45. package/dist/chunk-xf02hg29.js +0 -25
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{G as D,i as C}from"./chunk-2q3mcqfe.js";import"./chunk-tkegy5p0.js";class E{constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:(c)=>this.replacement=c}}replace(c,r,f,s){if(c&&r)if(f!=null)c[r][f]=s;else c[r]=s}remove(c,r,f){if(c&&r)if(f!==null&&f!==void 0)c[r].splice(f,1);else delete c[r]}}class w extends E{constructor(c,r){super();this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:(f)=>this.replacement=f},this.enter=c,this.leave=r}visit(c,r,f,s){if(c){if(this.enter){let i=this.should_skip,I=this.should_remove,l=this.replacement;if(this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,c,r,f,s),this.replacement)c=this.replacement,this.replace(r,f,s,c);if(this.should_remove)this.remove(r,f,s);let t=this.should_skip,m=this.should_remove;if(this.should_skip=i,this.should_remove=I,this.replacement=l,t)return c;if(m)return null}let a;for(a in c){let i=c[a];if(i&&typeof i==="object"){if(Array.isArray(i)){let I=i;for(let l=0;l<I.length;l+=1){let t=I[l];if(e(t)){if(!this.visit(t,c,a,l))l--}}}else if(e(i))this.visit(i,c,a,null)}}if(this.leave){let i=this.replacement,I=this.should_remove;if(this.replacement=null,this.should_remove=!1,this.leave.call(this.context,c,r,f,s),this.replacement)c=this.replacement,this.replace(r,f,s,c);if(this.should_remove)this.remove(r,f,s);let l=this.should_remove;if(this.replacement=i,this.should_remove=I,l)return null}}return c}}function e(c){return c!==null&&typeof c==="object"&&"type"in c&&typeof c.type==="string"}function b(c,{enter:r,leave:f}){return new w(r,f).visit(c,null)}async function G(c,r,f){let s=D(c),a=await r.getImportMap(),i=[],I=f?.autoImport!==!1,l=f?.transformVirtualImports!==!1&&r.options.virtualImports?.length;if(I||l){let t=C(s.original,{sourceType:"module",ecmaVersion:"latest",locations:!0}),m=y(a,r.options.virtualImports),u=V(t,l?m.walk:{});if(I){let S=u.unmatched;i.push(...Array.from(S).map((g)=>{let h=a.get(g);if(h&&!h.disabled)return h;return null}).filter(Boolean));for(let g of r.addons)i=await g.matchImports?.call(r,S,i)||i}m.ranges.forEach(([S,g])=>{s.remove(S,g)}),i.push(...m.imports)}return{s,strippedCode:c.toString(),matchedImports:i,isCJSContext:!1,firstOccurrence:0}}function V(c,r){let f=[],s=void 0,a=[];function i(t){s={node:t,parent:s,declarations:new Set,references:new Set},f.push(s),a.push(s)}function I(t){if(a.pop()?.node!==t)throw new Error("Scope mismatch");s=a[a.length-1]}i(void 0),b(c,{enter(t,m,u,S){switch(r?.enter?.call(this,t,m,u,S),t.type){case"ImportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":s.declarations.add(t.local.name);return;case"FunctionDeclaration":case"ClassDeclaration":if(t.id)s.declarations.add(t.id.name);return;case"VariableDeclarator":if(t.id.type==="Identifier")s.declarations.add(t.id.name);else b(t.id,{enter(g){if(g.type==="ObjectPattern")g.properties.forEach((h)=>{if(h.type==="Property"&&h.value.type==="Identifier")s.declarations.add(h.value.name);else if(h.type==="RestElement"&&h.argument.type==="Identifier")s.declarations.add(h.argument.name)});else if(g.type==="ArrayPattern")g.elements.forEach((h)=>{if(h?.type==="Identifier")s.declarations.add(h.name);if(h?.type==="RestElement"&&h.argument.type==="Identifier")s.declarations.add(h.argument.name)})}});return;case"BlockStatement":i(t);return;case"Identifier":switch(m?.type){case"CallExpression":if(m.callee===t||m.arguments.includes(t))s.references.add(t.name);return;case"MemberExpression":if(m.object===t)s.references.add(t.name);return;case"VariableDeclarator":if(m.init===t)s.references.add(t.name);return;case"SpreadElement":if(m.argument===t)s.references.add(t.name);return;case"ClassDeclaration":if(m.superClass===t)s.references.add(t.name);return;case"Property":if(m.value===t)s.references.add(t.name);return;case"TemplateLiteral":if(m.expressions.includes(t))s.references.add(t.name);return;case"AssignmentExpression":if(m.right===t)s.references.add(t.name);return;case"IfStatement":case"WhileStatement":case"DoWhileStatement":if(m.test===t)s.references.add(t.name);return;case"SwitchStatement":if(m.discriminant===t)s.references.add(t.name);return}if(m?.type.includes("Expression"))s.references.add(t.name)}},leave(t,m,u,S){switch(r?.leave?.call(this,t,m,u,S),t.type){case"BlockStatement":I(t)}}});let l=new Set;for(let t of f)for(let m of t.references){let u=!1,S=t;while(S){if(S.declarations.has(m)){u=!0;break}S=S?.parent}if(!u)l.add(m)}return{unmatched:l,scopes:f}}function y(c,r=[]){let f=[],s=[];return{imports:f,ranges:s,walk:{enter(a){if(a.type==="ImportDeclaration"){if(r.includes(a.source.value))s.push([a.start,a.end]),a.specifiers.forEach((i)=>{if(i.type==="ImportSpecifier"&&i.imported.type==="Identifier"){let I=c.get(i.imported.name);if(!I)throw new Error(`[unimport] failed to find "${i.imported.name}" imported from "${a.source.value}"`);f.push({from:I.from,name:I.name,as:i.local.name})}})}}}}}export{V as traveseScopes,G as detectImportsAcorn,y as createVirtualImportsAcronWalker};
2
+ import{G as D,i as C}from"./chunk-5x7y4ng3.js";import"./chunk-2pj0cr49.js";class E{constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:(c)=>this.replacement=c}}replace(c,r,f,s){if(c&&r)if(f!=null)c[r][f]=s;else c[r]=s}remove(c,r,f){if(c&&r)if(f!==null&&f!==void 0)c[r].splice(f,1);else delete c[r]}}class w extends E{constructor(c,r){super();this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:(f)=>this.replacement=f},this.enter=c,this.leave=r}visit(c,r,f,s){if(c){if(this.enter){let i=this.should_skip,I=this.should_remove,l=this.replacement;if(this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,c,r,f,s),this.replacement)c=this.replacement,this.replace(r,f,s,c);if(this.should_remove)this.remove(r,f,s);let t=this.should_skip,m=this.should_remove;if(this.should_skip=i,this.should_remove=I,this.replacement=l,t)return c;if(m)return null}let a;for(a in c){let i=c[a];if(i&&typeof i==="object"){if(Array.isArray(i)){let I=i;for(let l=0;l<I.length;l+=1){let t=I[l];if(e(t)){if(!this.visit(t,c,a,l))l--}}}else if(e(i))this.visit(i,c,a,null)}}if(this.leave){let i=this.replacement,I=this.should_remove;if(this.replacement=null,this.should_remove=!1,this.leave.call(this.context,c,r,f,s),this.replacement)c=this.replacement,this.replace(r,f,s,c);if(this.should_remove)this.remove(r,f,s);let l=this.should_remove;if(this.replacement=i,this.should_remove=I,l)return null}}return c}}function e(c){return c!==null&&typeof c==="object"&&"type"in c&&typeof c.type==="string"}function b(c,{enter:r,leave:f}){return new w(r,f).visit(c,null)}async function G(c,r,f){let s=D(c),a=await r.getImportMap(),i=[],I=f?.autoImport!==!1,l=f?.transformVirtualImports!==!1&&r.options.virtualImports?.length;if(I||l){let t=C(s.original,{sourceType:"module",ecmaVersion:"latest",locations:!0}),m=y(a,r.options.virtualImports),u=V(t,l?m.walk:{});if(I){let S=u.unmatched;i.push(...Array.from(S).map((g)=>{let h=a.get(g);if(h&&!h.disabled)return h;return null}).filter(Boolean));for(let g of r.addons)i=await g.matchImports?.call(r,S,i)||i}m.ranges.forEach(([S,g])=>{s.remove(S,g)}),i.push(...m.imports)}return{s,strippedCode:c.toString(),matchedImports:i,isCJSContext:!1,firstOccurrence:0}}function V(c,r){let f=[],s=void 0,a=[];function i(t){s={node:t,parent:s,declarations:new Set,references:new Set},f.push(s),a.push(s)}function I(t){if(a.pop()?.node!==t)throw new Error("Scope mismatch");s=a[a.length-1]}i(void 0),b(c,{enter(t,m,u,S){switch(r?.enter?.call(this,t,m,u,S),t.type){case"ImportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":s.declarations.add(t.local.name);return;case"FunctionDeclaration":case"ClassDeclaration":if(t.id)s.declarations.add(t.id.name);return;case"VariableDeclarator":if(t.id.type==="Identifier")s.declarations.add(t.id.name);else b(t.id,{enter(g){if(g.type==="ObjectPattern")g.properties.forEach((h)=>{if(h.type==="Property"&&h.value.type==="Identifier")s.declarations.add(h.value.name);else if(h.type==="RestElement"&&h.argument.type==="Identifier")s.declarations.add(h.argument.name)});else if(g.type==="ArrayPattern")g.elements.forEach((h)=>{if(h?.type==="Identifier")s.declarations.add(h.name);if(h?.type==="RestElement"&&h.argument.type==="Identifier")s.declarations.add(h.argument.name)})}});return;case"BlockStatement":i(t);return;case"Identifier":switch(m?.type){case"CallExpression":if(m.callee===t||m.arguments.includes(t))s.references.add(t.name);return;case"MemberExpression":if(m.object===t)s.references.add(t.name);return;case"VariableDeclarator":if(m.init===t)s.references.add(t.name);return;case"SpreadElement":if(m.argument===t)s.references.add(t.name);return;case"ClassDeclaration":if(m.superClass===t)s.references.add(t.name);return;case"Property":if(m.value===t)s.references.add(t.name);return;case"TemplateLiteral":if(m.expressions.includes(t))s.references.add(t.name);return;case"AssignmentExpression":if(m.right===t)s.references.add(t.name);return;case"IfStatement":case"WhileStatement":case"DoWhileStatement":if(m.test===t)s.references.add(t.name);return;case"SwitchStatement":if(m.discriminant===t)s.references.add(t.name);return}if(m?.type.includes("Expression"))s.references.add(t.name)}},leave(t,m,u,S){switch(r?.leave?.call(this,t,m,u,S),t.type){case"BlockStatement":I(t)}}});let l=new Set;for(let t of f)for(let m of t.references){let u=!1,S=t;while(S){if(S.declarations.has(m)){u=!0;break}S=S?.parent}if(!u)l.add(m)}return{unmatched:l,scopes:f}}function y(c,r=[]){let f=[],s=[];return{imports:f,ranges:s,walk:{enter(a){if(a.type==="ImportDeclaration"){if(r.includes(a.source.value))s.push([a.start,a.end]),a.specifiers.forEach((i)=>{if(i.type==="ImportSpecifier"&&i.imported.type==="Identifier"){let I=c.get(i.imported.name);if(!I)throw new Error(`[unimport] failed to find "${i.imported.name}" imported from "${a.source.value}"`);f.push({from:I.from,name:I.name,as:i.local.name})}})}}}}}export{V as traveseScopes,G as detectImportsAcorn,y as createVirtualImportsAcronWalker};
@@ -0,0 +1,3 @@
1
+ import{gc as y0,hc as X$,ic as j4,kc as p0,lc as Qz,mc as rj,nc as Wz}from"./chunk-5vhayxpk.js";import{oc as l,qc as oz,rc as tz}from"./chunk-ww48v0ap.js";import{Gc as R1}from"./chunk-5eh2tfep.js";import{Tc as q,Wc as F}from"./chunk-2pj0cr49.js";var a5=q((FQ,b1)=>{var{defineProperty:n,getOwnPropertyDescriptor:c5,getOwnPropertyNames:d5}=Object,l5=Object.prototype.hasOwnProperty,I0=(j,$)=>n(j,"name",{value:$,configurable:!0}),_5=(j,$)=>{for(var z in $)n(j,z,{get:$[z],enumerable:!0})},s5=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of d5($))if(!l5.call(j,W)&&W!==z)n(j,W,{get:()=>$[W],enumerable:!(Q=c5($,W))||Q.enumerable})}return j},m5=(j)=>s5(n({},"__esModule",{value:!0}),j),w1={};_5(w1,{getHostHeaderPlugin:()=>i5,hostHeaderMiddleware:()=>L1,hostHeaderMiddlewareOptions:()=>M1,resolveHostHeaderConfig:()=>U1});b1.exports=m5(w1);var p5=l();function U1(j){return j}I0(U1,"resolveHostHeaderConfig");var L1=I0((j)=>($)=>async(z)=>{if(!p5.HttpRequest.isInstance(z.request))return $(z);let{request:Q}=z,{handlerProtocol:W=""}=j.requestHandler.metadata||{};if(W.indexOf("h2")>=0&&!Q.headers[":authority"])delete Q.headers.host,Q.headers[":authority"]=Q.hostname+(Q.port?":"+Q.port:"");else if(!Q.headers.host){let Z=Q.hostname;if(Q.port!=null)Z+=`:${Q.port}`;Q.headers.host=Z}return $(z)},"hostHeaderMiddleware"),M1={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},i5=I0((j)=>({applyToStack:($)=>{$.add(L1(j),M1)}}),"getHostHeaderPlugin")});var zj=q((DQ,O1)=>{var{defineProperty:r,getOwnPropertyDescriptor:n5,getOwnPropertyNames:r5}=Object,o5=Object.prototype.hasOwnProperty,F1=(j,$)=>r(j,"name",{value:$,configurable:!0}),t5=(j,$)=>{for(var z in $)r(j,z,{get:$[z],enumerable:!0})},e5=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of r5($))if(!o5.call(j,W)&&W!==z)r(j,W,{get:()=>$[W],enumerable:!(Q=n5($,W))||Q.enumerable})}return j},jj=(j)=>e5(r({},"__esModule",{value:!0}),j),D1={};t5(D1,{getLoggerPlugin:()=>$j,loggerMiddleware:()=>h1,loggerMiddlewareOptions:()=>N1});O1.exports=jj(D1);var h1=F1(()=>(j,$)=>async(z)=>{try{let Q=await j(z),{clientName:W,commandName:Z,logger:X,dynamoDbDocumentClientOptions:J={}}=$,{overrideInputFilterSensitiveLog:K,overrideOutputFilterSensitiveLog:G}=J,V=K??$.inputFilterSensitiveLog,Y=G??$.outputFilterSensitiveLog,{$metadata:B,...b}=Q.output;return X?.info?.({clientName:W,commandName:Z,input:V(z.input),output:Y(b),metadata:B}),Q}catch(Q){let{clientName:W,commandName:Z,logger:X,dynamoDbDocumentClientOptions:J={}}=$,{overrideInputFilterSensitiveLog:K}=J,G=K??$.inputFilterSensitiveLog;throw X?.error?.({clientName:W,commandName:Z,input:G(z.input),error:Q,metadata:Q.$metadata}),Q}},"loggerMiddleware"),N1={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},$j=F1((j)=>({applyToStack:($)=>{$.add(h1(),N1)}}),"getLoggerPlugin")});var Vj=q((hQ,v1)=>{var{defineProperty:t,getOwnPropertyDescriptor:Qj,getOwnPropertyNames:Wj}=Object,Zj=Object.prototype.hasOwnProperty,o=(j,$)=>t(j,"name",{value:$,configurable:!0}),Xj=(j,$)=>{for(var z in $)t(j,z,{get:$[z],enumerable:!0})},Jj=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of Wj($))if(!Zj.call(j,W)&&W!==z)t(j,W,{get:()=>$[W],enumerable:!(Q=Qj($,W))||Q.enumerable})}return j},Kj=(j)=>Jj(t({},"__esModule",{value:!0}),j),C1={};Xj(C1,{addRecursionDetectionMiddlewareOptions:()=>I1,getRecursionDetectionPlugin:()=>qj,recursionDetectionMiddleware:()=>T1});v1.exports=Kj(C1);var Gj=l(),v0="X-Amzn-Trace-Id",Yj="AWS_LAMBDA_FUNCTION_NAME",Bj="_X_AMZN_TRACE_ID",T1=o((j)=>($)=>async(z)=>{let{request:Q}=z;if(!Gj.HttpRequest.isInstance(Q)||j.runtime!=="node")return $(z);let W=Object.keys(Q.headers??{}).find((K)=>K.toLowerCase()===v0.toLowerCase())??v0;if(Q.headers.hasOwnProperty(W))return $(z);let Z=process.env[Yj],X=process.env[Bj],J=o((K)=>typeof K==="string"&&K.length>0,"nonEmptyString");if(J(Z)&&J(X))Q.headers[v0]=X;return $({...z,request:Q})},"recursionDetectionMiddleware"),I1={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},qj=o((j)=>({applyToStack:o(($)=>{$.add(T1(j),I1)},"applyToStack")}),"getRecursionDetectionPlugin")});var u1=q((NQ,g1)=>{var{defineProperty:e,getOwnPropertyDescriptor:Hj,getOwnPropertyNames:wj}=Object,Uj=Object.prototype.hasOwnProperty,H=(j,$)=>e(j,"name",{value:$,configurable:!0}),Lj=(j,$)=>{for(var z in $)e(j,z,{get:$[z],enumerable:!0})},Mj=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of wj($))if(!Uj.call(j,W)&&W!==z)e(j,W,{get:()=>$[W],enumerable:!(Q=Hj($,W))||Q.enumerable})}return j},bj=(j)=>Mj(e({},"__esModule",{value:!0}),j),S1={};Lj(S1,{EndpointCache:()=>Fj,EndpointError:()=>h,customEndpointFunctions:()=>S0,isIpAddress:()=>k1,isValidHostLabel:()=>P0,resolveEndpoint:()=>uj});g1.exports=bj(S1);var Fj=class{constructor({size:j,params:$}){if(this.data=new Map,this.parameters=[],this.capacity=j??50,$)this.parameters=$}static{H(this,"EndpointCache")}get(j,$){let z=this.hash(j);if(z===!1)return $();if(!this.data.has(z)){if(this.data.size>this.capacity+10){let Q=this.data.keys(),W=0;while(!0){let{value:Z,done:X}=Q.next();if(this.data.delete(Z),X||++W>10)break}}this.data.set(z,$())}return this.data.get(z)}size(){return this.data.size}hash(j){let $="",{parameters:z}=this;if(z.length===0)return!1;for(let Q of z){let W=String(j[Q]??"");if(W.includes("|;"))return!1;$+=W+"|;"}return $}},Dj=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}$"),k1=H((j)=>Dj.test(j)||j.startsWith("[")&&j.endsWith("]"),"isIpAddress"),hj=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),P0=H((j,$=!1)=>{if(!$)return hj.test(j);let z=j.split(".");for(let Q of z)if(!P0(Q))return!1;return!0},"isValidHostLabel"),S0={},_="endpoints";function S(j){if(typeof j!=="object"||j==null)return j;if("ref"in j)return`$${S(j.ref)}`;if("fn"in j)return`${j.fn}(${(j.argv||[]).map(S).join(", ")})`;return JSON.stringify(j,null,2)}H(S,"toDebugString");var h=class extends Error{static{H(this,"EndpointError")}constructor(j){super(j);this.name="EndpointError"}},Nj=H((j,$)=>j===$,"booleanEquals"),Oj=H((j)=>{let $=j.split("."),z=[];for(let Q of $){let W=Q.indexOf("[");if(W!==-1){if(Q.indexOf("]")!==Q.length-1)throw new h(`Path: '${j}' does not end with ']'`);let Z=Q.slice(W+1,-1);if(Number.isNaN(parseInt(Z)))throw new h(`Invalid array index: '${Z}' in path: '${j}'`);if(W!==0)z.push(Q.slice(0,W));z.push(Z)}else z.push(Q)}return z},"getAttrPathList"),P1=H((j,$)=>Oj($).reduce((z,Q)=>{if(typeof z!=="object")throw new h(`Index '${Q}' in '${$}' not found in '${JSON.stringify(j)}'`);else if(Array.isArray(z))return z[parseInt(Q)];return z[Q]},j),"getAttr"),Cj=H((j)=>j!=null,"isSet"),Tj=H((j)=>!j,"not"),k0=R1(),R0={[k0.EndpointURLScheme.HTTP]:80,[k0.EndpointURLScheme.HTTPS]:443},Ij=H((j)=>{let $=(()=>{try{if(j instanceof URL)return j;if(typeof j==="object"&&"hostname"in j){let{hostname:B,port:b,protocol:D="",path:O="",query:f5={}}=j,H1=new URL(`${D}//${B}${b?`:${b}`:""}${O}`);return H1.search=Object.entries(f5).map(([g5,u5])=>`${g5}=${u5}`).join("&"),H1}return new URL(j)}catch(B){return null}})();if(!$)return console.error(`Unable to parse ${JSON.stringify(j)} as a whatwg URL.`),null;let z=$.href,{host:Q,hostname:W,pathname:Z,protocol:X,search:J}=$;if(J)return null;let K=X.slice(0,-1);if(!Object.values(k0.EndpointURLScheme).includes(K))return null;let G=k1(W),V=z.includes(`${Q}:${R0[K]}`)||typeof j==="string"&&j.includes(`${Q}:${R0[K]}`),Y=`${Q}${V?`:${R0[K]}`:""}`;return{scheme:K,authority:Y,path:Z,normalizedPath:Z.endsWith("/")?Z:`${Z}/`,isIp:G}},"parseURL"),vj=H((j,$)=>j===$,"stringEquals"),Rj=H((j,$,z,Q)=>{if($>=z||j.length<z)return null;if(!Q)return j.substring($,z);return j.substring(j.length-z,j.length-$)},"substring"),Sj=H((j)=>encodeURIComponent(j).replace(/[!*'()]/g,($)=>`%${$.charCodeAt(0).toString(16).toUpperCase()}`),"uriEncode"),kj={booleanEquals:Nj,getAttr:P1,isSet:Cj,isValidHostLabel:P0,not:Tj,parseURL:Ij,stringEquals:vj,substring:Rj,uriEncode:Sj},x1=H((j,$)=>{let z=[],Q={...$.endpointParams,...$.referenceRecord},W=0;while(W<j.length){let Z=j.indexOf("{",W);if(Z===-1){z.push(j.slice(W));break}z.push(j.slice(W,Z));let X=j.indexOf("}",Z);if(X===-1){z.push(j.slice(Z));break}if(j[Z+1]==="{"&&j[X+1]==="}")z.push(j.slice(Z+1,X)),W=X+2;let J=j.substring(Z+1,X);if(J.includes("#")){let[K,G]=J.split("#");z.push(P1(Q[K],G))}else z.push(Q[J]);W=X+1}return z.join("")},"evaluateTemplate"),Pj=H(({ref:j},$)=>{return{...$.endpointParams,...$.referenceRecord}[j]},"getReferenceValue"),j0=H((j,$,z)=>{if(typeof j==="string")return x1(j,z);else if(j.fn)return A1(j,z);else if(j.ref)return Pj(j,z);throw new h(`'${$}': ${String(j)} is not a string, function or reference.`)},"evaluateExpression"),A1=H(({fn:j,argv:$},z)=>{let Q=$.map((Z)=>["boolean","number"].includes(typeof Z)?Z:j0(Z,"arg",z)),W=j.split(".");if(W[0]in S0&&W[1]!=null)return S0[W[0]][W[1]](...Q);return kj[j](...Q)},"callFunction"),xj=H(({assign:j,...$},z)=>{if(j&&j in z.referenceRecord)throw new h(`'${j}' is already defined in Reference Record.`);let Q=A1($,z);return z.logger?.debug?.(`${_} evaluateCondition: ${S($)} = ${S(Q)}`),{result:Q===""?!0:!!Q,...j!=null&&{toAssign:{name:j,value:Q}}}},"evaluateCondition"),x0=H((j=[],$)=>{let z={};for(let Q of j){let{result:W,toAssign:Z}=xj(Q,{...$,referenceRecord:{...$.referenceRecord,...z}});if(!W)return{result:W};if(Z)z[Z.name]=Z.value,$.logger?.debug?.(`${_} assign: ${Z.name} := ${S(Z.value)}`)}return{result:!0,referenceRecord:z}},"evaluateConditions"),Aj=H((j,$)=>Object.entries(j).reduce((z,[Q,W])=>({...z,[Q]:W.map((Z)=>{let X=j0(Z,"Header value entry",$);if(typeof X!=="string")throw new h(`Header '${Q}' value '${X}' is not a string`);return X})}),{}),"getEndpointHeaders"),E1=H((j,$)=>{if(Array.isArray(j))return j.map((z)=>E1(z,$));switch(typeof j){case"string":return x1(j,$);case"object":if(j===null)throw new h(`Unexpected endpoint property: ${j}`);return y1(j,$);case"boolean":return j;default:throw new h(`Unexpected endpoint property type: ${typeof j}`)}},"getEndpointProperty"),y1=H((j,$)=>Object.entries(j).reduce((z,[Q,W])=>({...z,[Q]:E1(W,$)}),{}),"getEndpointProperties"),Ej=H((j,$)=>{let z=j0(j,"Endpoint URL",$);if(typeof z==="string")try{return new URL(z)}catch(Q){throw console.error(`Failed to construct URL with ${z}`,Q),Q}throw new h(`Endpoint URL must be a string, got ${typeof z}`)},"getEndpointUrl"),yj=H((j,$)=>{let{conditions:z,endpoint:Q}=j,{result:W,referenceRecord:Z}=x0(z,$);if(!W)return;let X={...$,referenceRecord:{...$.referenceRecord,...Z}},{url:J,properties:K,headers:G}=Q;return $.logger?.debug?.(`${_} Resolving endpoint from template: ${S(Q)}`),{...G!=null&&{headers:Aj(G,X)},...K!=null&&{properties:y1(K,X)},url:Ej(J,X)}},"evaluateEndpointRule"),fj=H((j,$)=>{let{conditions:z,error:Q}=j,{result:W,referenceRecord:Z}=x0(z,$);if(!W)return;throw new h(j0(Q,"Error",{...$,referenceRecord:{...$.referenceRecord,...Z}}))},"evaluateErrorRule"),gj=H((j,$)=>{let{conditions:z,rules:Q}=j,{result:W,referenceRecord:Z}=x0(z,$);if(!W)return;return f1(Q,{...$,referenceRecord:{...$.referenceRecord,...Z}})},"evaluateTreeRule"),f1=H((j,$)=>{for(let z of j)if(z.type==="endpoint"){let Q=yj(z,$);if(Q)return Q}else if(z.type==="error")fj(z,$);else if(z.type==="tree"){let Q=gj(z,$);if(Q)return Q}else throw new h(`Unknown endpoint rule: ${z}`);throw new h("Rules evaluation failed")},"evaluateRules"),uj=H((j,$)=>{let{endpointParams:z,logger:Q}=$,{parameters:W,rules:Z}=j;$.logger?.debug?.(`${_} Initial EndpointParams: ${S(z)}`);let X=Object.entries(W).filter(([,G])=>G.default!=null).map(([G,V])=>[G,V.default]);if(X.length>0)for(let[G,V]of X)z[G]=z[G]??V;let J=Object.entries(W).filter(([,G])=>G.required).map(([G])=>G);for(let G of J)if(z[G]==null)throw new h(`Missing required parameter: '${G}'`);let K=f1(Z,{endpointParams:z,logger:Q,referenceRecord:{}});return $.logger?.debug?.(`${_} Resolved endpoint: ${S(K)}`),K},"resolveEndpoint")});var r1=q((TQ,n1)=>{var{defineProperty:$0,getOwnPropertyDescriptor:cj,getOwnPropertyNames:dj}=Object,lj=Object.prototype.hasOwnProperty,E=(j,$)=>$0(j,"name",{value:$,configurable:!0}),_j=(j,$)=>{for(var z in $)$0(j,z,{get:$[z],enumerable:!0})},sj=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of dj($))if(!lj.call(j,W)&&W!==z)$0(j,W,{get:()=>$[W],enumerable:!(Q=cj($,W))||Q.enumerable})}return j},mj=(j)=>sj($0({},"__esModule",{value:!0}),j),d1={};_j(d1,{ConditionObject:()=>w.ConditionObject,DeprecatedObject:()=>w.DeprecatedObject,EndpointError:()=>w.EndpointError,EndpointObject:()=>w.EndpointObject,EndpointObjectHeaders:()=>w.EndpointObjectHeaders,EndpointObjectProperties:()=>w.EndpointObjectProperties,EndpointParams:()=>w.EndpointParams,EndpointResolverOptions:()=>w.EndpointResolverOptions,EndpointRuleObject:()=>w.EndpointRuleObject,ErrorRuleObject:()=>w.ErrorRuleObject,EvaluateOptions:()=>w.EvaluateOptions,Expression:()=>w.Expression,FunctionArgv:()=>w.FunctionArgv,FunctionObject:()=>w.FunctionObject,FunctionReturn:()=>w.FunctionReturn,ParameterObject:()=>w.ParameterObject,ReferenceObject:()=>w.ReferenceObject,ReferenceRecord:()=>w.ReferenceRecord,RuleSetObject:()=>w.RuleSetObject,RuleSetRules:()=>w.RuleSetRules,TreeRuleObject:()=>w.TreeRuleObject,awsEndpointFunctions:()=>a1,getUserAgentPrefix:()=>nj,isIpAddress:()=>w.isIpAddress,partition:()=>p1,resolveEndpoint:()=>w.resolveEndpoint,setPartitionInfo:()=>i1,useDefaultPartitionInfo:()=>aj});n1.exports=mj(d1);var w=u1(),l1=E((j,$=!1)=>{if($){for(let z of j.split("."))if(!l1(z))return!1;return!0}if(!w.isValidHostLabel(j))return!1;if(j.length<3||j.length>63)return!1;if(j!==j.toLowerCase())return!1;if(w.isIpAddress(j))return!1;return!0},"isVirtualHostableS3Bucket"),c1=":",pj="/",ij=E((j)=>{let $=j.split(c1);if($.length<6)return null;let[z,Q,W,Z,X,...J]=$;if(z!=="arn"||Q===""||W===""||J.join(c1)==="")return null;let K=J.map((G)=>G.split(pj)).flat();return{partition:Q,service:W,region:Z,accountId:X,resourceId:K}},"parseArn"),_1={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)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"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)"},"mx-central-1":{description:"Mexico (Central)"},"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:{"aws-iso-f-global":{description:"AWS ISOF global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}}],version:"1.1"},s1=_1,m1="",p1=E((j)=>{let{partitions:$}=s1;for(let Q of $){let{regions:W,outputs:Z}=Q;for(let[X,J]of Object.entries(W))if(X===j)return{...Z,...J}}for(let Q of $){let{regionRegex:W,outputs:Z}=Q;if(new RegExp(W).test(j))return{...Z}}let z=$.find((Q)=>Q.id==="aws");if(!z)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...z.outputs}},"partition"),i1=E((j,$="")=>{s1=j,m1=$},"setPartitionInfo"),aj=E(()=>{i1(_1,"")},"useDefaultPartitionInfo"),nj=E(()=>m1,"getUserAgentPrefix"),a1={isVirtualHostableS3Bucket:l1,parseArn:ij,partition:p1};w.customEndpointFunctions.aws=a1});var Y4=q((IQ,G4)=>{var{defineProperty:Q0,getOwnPropertyDescriptor:oj,getOwnPropertyNames:tj}=Object,ej=Object.prototype.hasOwnProperty,x=(j,$)=>Q0(j,"name",{value:$,configurable:!0}),j8=(j,$)=>{for(var z in $)Q0(j,z,{get:$[z],enumerable:!0})},$8=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of tj($))if(!ej.call(j,W)&&W!==z)Q0(j,W,{get:()=>$[W],enumerable:!(Q=oj($,W))||Q.enumerable})}return j},z8=(j)=>$8(Q0({},"__esModule",{value:!0}),j),$4={};j8($4,{DEFAULT_UA_APP_ID:()=>z4,getUserAgentMiddlewareOptions:()=>K4,getUserAgentPlugin:()=>Y8,resolveUserAgentConfig:()=>W4,userAgentMiddleware:()=>J4});G4.exports=z8($4);var Q8=j4(),z4=void 0;function Q4(j){if(j===void 0)return!0;return typeof j==="string"&&j.length<=50}x(Q4,"isValidUserAgentAppId");function W4(j){let $=Q8.normalizeProvider(j.userAgentAppId??z4);return{...j,customUserAgent:typeof j.customUserAgent==="string"?[[j.customUserAgent]]:j.customUserAgent,userAgentAppId:async()=>{let z=await $();if(!Q4(z)){let Q=j.logger?.constructor?.name==="NoOpLogger"||!j.logger?console:j.logger;if(typeof z!=="string")Q?.warn("userAgentAppId must be a string or undefined.");else if(z.length>50)Q?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return z}}}x(W4,"resolveUserAgentConfig");var W8=r1(),Z8=l(),v=rj(),X8=/\d{12}\.ddb/;async function Z4(j,$,z){if(z.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor")v.setFeature(j,"PROTOCOL_RPC_V2_CBOR","M");if(typeof $.retryStrategy==="function"){let Z=await $.retryStrategy();if(typeof Z.acquireInitialRetryToken==="function")if(Z.constructor?.name?.includes("Adaptive"))v.setFeature(j,"RETRY_MODE_ADAPTIVE","F");else v.setFeature(j,"RETRY_MODE_STANDARD","E");else v.setFeature(j,"RETRY_MODE_LEGACY","D")}if(typeof $.accountIdEndpointMode==="function"){let Z=j.endpointV2;if(String(Z?.url?.hostname).match(X8))v.setFeature(j,"ACCOUNT_ID_ENDPOINT","O");switch(await $.accountIdEndpointMode?.()){case"disabled":v.setFeature(j,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":v.setFeature(j,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":v.setFeature(j,"ACCOUNT_ID_MODE_REQUIRED","R");break}}let W=j.__smithy_context?.selectedHttpAuthScheme?.identity;if(W?.$source){let Z=W;if(Z.accountId)v.setFeature(j,"RESOLVED_ACCOUNT_ID","T");for(let[X,J]of Object.entries(Z.$source??{}))v.setFeature(j,X,J)}}x(Z4,"checkFeatures");var o1="user-agent",A0="x-amz-user-agent",t1=" ",E0="/",J8=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,K8=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,e1="-",G8=1024;function X4(j){let $="";for(let z in j){let Q=j[z];if($.length+Q.length+1<=G8){if($.length)$+=","+Q;else $+=Q;continue}break}return $}x(X4,"encodeFeatures");var J4=x((j)=>($,z)=>async(Q)=>{let{request:W}=Q;if(!Z8.HttpRequest.isInstance(W))return $(Q);let{headers:Z}=W,X=z?.userAgent?.map(z0)||[],J=(await j.defaultUserAgentProvider()).map(z0);await Z4(z,j,Q);let K=z;J.push(`m/${X4(Object.assign({},z.__smithy_context?.features,K.__aws_sdk_context?.features))}`);let G=j?.customUserAgent?.map(z0)||[],V=await j.userAgentAppId();if(V)J.push(z0([`app/${V}`]));let Y=W8.getUserAgentPrefix(),B=(Y?[Y]:[]).concat([...J,...X,...G]).join(t1),b=[...J.filter((D)=>D.startsWith("aws-sdk-")),...G].join(t1);if(j.runtime!=="browser"){if(b)Z[A0]=Z[A0]?`${Z[o1]} ${b}`:b;Z[o1]=B}else Z[A0]=B;return $({...Q,request:W})},"userAgentMiddleware"),z0=x((j)=>{let $=j[0].split(E0).map((X)=>X.replace(J8,e1)).join(E0),z=j[1]?.replace(K8,e1),Q=$.indexOf(E0),W=$.substring(0,Q),Z=$.substring(Q+1);if(W==="api")Z=Z.toLowerCase();return[W,Z,z].filter((X)=>X&&X.length>0).reduce((X,J,K)=>{switch(K){case 0:return J;case 1:return`${X}/${J}`;default:return`${X}#${J}`}},"")},"escapeUserAgent"),K4={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Y8=x((j)=>({applyToStack:($)=>{$.add(J4(j),K4)}}),"getUserAgentPlugin")});var w4=q((vQ,H4)=>{var{defineProperty:W0,getOwnPropertyDescriptor:B8,getOwnPropertyNames:q8}=Object,V8=Object.prototype.hasOwnProperty,B4=(j,$)=>W0(j,"name",{value:$,configurable:!0}),H8=(j,$)=>{for(var z in $)W0(j,z,{get:$[z],enumerable:!0})},w8=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of q8($))if(!V8.call(j,W)&&W!==z)W0(j,W,{get:()=>$[W],enumerable:!(Q=B8($,W))||Q.enumerable})}return j},U8=(j)=>w8(W0({},"__esModule",{value:!0}),j),q4={};H8(q4,{SelectorType:()=>V4,booleanSelector:()=>L8,numberSelector:()=>M8});H4.exports=U8(q4);var L8=B4((j,$,z)=>{if(!($ in j))return;if(j[$]==="true")return!0;if(j[$]==="false")return!1;throw new Error(`Cannot load ${z} "${$}". Expected "true" or "false", got ${j[$]}.`)},"booleanSelector"),M8=B4((j,$,z)=>{if(!($ in j))return;let Q=parseInt(j[$],10);if(Number.isNaN(Q))throw new TypeError(`Cannot load ${z} '${$}'. Expected number, got '${j[$]}'.`);return Q},"numberSelector"),V4=((j)=>{return j.ENV="env",j.CONFIG="shared config entry",j})(V4||{})});var I4=q((RQ,T4)=>{var{defineProperty:X0,getOwnPropertyDescriptor:b8,getOwnPropertyNames:F8}=Object,D8=Object.prototype.hasOwnProperty,C=(j,$)=>X0(j,"name",{value:$,configurable:!0}),h8=(j,$)=>{for(var z in $)X0(j,z,{get:$[z],enumerable:!0})},N8=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of F8($))if(!D8.call(j,W)&&W!==z)X0(j,W,{get:()=>$[W],enumerable:!(Q=b8($,W))||Q.enumerable})}return j},O8=(j)=>N8(X0({},"__esModule",{value:!0}),j),M4={};h8(M4,{CONFIG_USE_DUALSTACK_ENDPOINT:()=>F4,CONFIG_USE_FIPS_ENDPOINT:()=>h4,DEFAULT_USE_DUALSTACK_ENDPOINT:()=>C8,DEFAULT_USE_FIPS_ENDPOINT:()=>I8,ENV_USE_DUALSTACK_ENDPOINT:()=>b4,ENV_USE_FIPS_ENDPOINT:()=>D4,NODE_REGION_CONFIG_FILE_OPTIONS:()=>x8,NODE_REGION_CONFIG_OPTIONS:()=>P8,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:()=>T8,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:()=>v8,REGION_ENV_NAME:()=>N4,REGION_INI_NAME:()=>O4,getRegionInfo:()=>g8,resolveCustomEndpointsConfig:()=>R8,resolveEndpointsConfig:()=>k8,resolveRegionConfig:()=>A8});T4.exports=O8(M4);var k=w4(),b4="AWS_USE_DUALSTACK_ENDPOINT",F4="use_dualstack_endpoint",C8=!1,T8={environmentVariableSelector:(j)=>k.booleanSelector(j,b4,k.SelectorType.ENV),configFileSelector:(j)=>k.booleanSelector(j,F4,k.SelectorType.CONFIG),default:!1},D4="AWS_USE_FIPS_ENDPOINT",h4="use_fips_endpoint",I8=!1,v8={environmentVariableSelector:(j)=>k.booleanSelector(j,D4,k.SelectorType.ENV),configFileSelector:(j)=>k.booleanSelector(j,h4,k.SelectorType.CONFIG),default:!1},Z0=y0(),R8=C((j)=>{let{endpoint:$,urlParser:z}=j;return{...j,tls:j.tls??!0,endpoint:Z0.normalizeProvider(typeof $==="string"?z($):$),isCustomEndpoint:!0,useDualstackEndpoint:Z0.normalizeProvider(j.useDualstackEndpoint??!1)}},"resolveCustomEndpointsConfig"),S8=C(async(j)=>{let{tls:$=!0}=j,z=await j.region();if(!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(z))throw new Error("Invalid region in client config");let W=await j.useDualstackEndpoint(),Z=await j.useFipsEndpoint(),{hostname:X}=await j.regionInfoProvider(z,{useDualstackEndpoint:W,useFipsEndpoint:Z})??{};if(!X)throw new Error("Cannot resolve hostname from client config");return j.urlParser(`${$?"https:":"http:"}//${X}`)},"getEndpointFromRegion"),k8=C((j)=>{let $=Z0.normalizeProvider(j.useDualstackEndpoint??!1),{endpoint:z,useFipsEndpoint:Q,urlParser:W}=j;return{...j,tls:j.tls??!0,endpoint:z?Z0.normalizeProvider(typeof z==="string"?W(z):z):()=>S8({...j,useDualstackEndpoint:$,useFipsEndpoint:Q}),isCustomEndpoint:!!z,useDualstackEndpoint:$}},"resolveEndpointsConfig"),N4="AWS_REGION",O4="region",P8={environmentVariableSelector:(j)=>j[N4],configFileSelector:(j)=>j[O4],default:()=>{throw new Error("Region is missing")}},x8={preferredFile:"credentials"},C4=C((j)=>typeof j==="string"&&(j.startsWith("fips-")||j.endsWith("-fips")),"isFipsRegion"),U4=C((j)=>C4(j)?["fips-aws-global","aws-fips"].includes(j)?"us-east-1":j.replace(/fips-(dkr-|prod-)?|-fips/,""):j,"getRealRegion"),A8=C((j)=>{let{region:$,useFipsEndpoint:z}=j;if(!$)throw new Error("Region is missing");return{...j,region:async()=>{if(typeof $==="string")return U4($);let Q=await $();return U4(Q)},useFipsEndpoint:async()=>{let Q=typeof $==="string"?$:await $();if(C4(Q))return!0;return typeof z!=="function"?Promise.resolve(!!z):z()}}},"resolveRegionConfig"),L4=C((j=[],{useFipsEndpoint:$,useDualstackEndpoint:z})=>j.find(({tags:Q})=>$===Q.includes("fips")&&z===Q.includes("dualstack"))?.hostname,"getHostnameFromVariants"),E8=C((j,{regionHostname:$,partitionHostname:z})=>$?$:z?z.replace("{region}",j):void 0,"getResolvedHostname"),y8=C((j,{partitionHash:$})=>Object.keys($||{}).find((z)=>$[z].regions.includes(j))??"aws","getResolvedPartition"),f8=C((j,{signingRegion:$,regionRegex:z,useFipsEndpoint:Q})=>{if($)return $;else if(Q){let W=z.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),Z=j.match(W);if(Z)return Z[0].slice(1,-1)}},"getResolvedSigningRegion"),g8=C((j,{useFipsEndpoint:$=!1,useDualstackEndpoint:z=!1,signingService:Q,regionHash:W,partitionHash:Z})=>{let X=y8(j,{partitionHash:Z}),J=j in W?j:Z[X]?.endpoint??j,K={useFipsEndpoint:$,useDualstackEndpoint:z},G=L4(W[J]?.variants,K),V=L4(Z[X]?.variants,K),Y=E8(J,{regionHostname:G,partitionHostname:V});if(Y===void 0)throw new Error(`Endpoint resolution failed for: ${{resolvedRegion:J,useFipsEndpoint:$,useDualstackEndpoint:z}}`);let B=f8(Y,{signingRegion:W[J]?.signingRegion,regionRegex:Z[X].regionRegex,useFipsEndpoint:$});return{partition:X,signingService:Q,hostname:Y,...B&&{signingRegion:B},...W[J]?.signingService&&{signingService:W[J].signingService}}},"getRegionInfo")});var i8=q((SQ,P4)=>{var{defineProperty:J0,getOwnPropertyDescriptor:u8,getOwnPropertyNames:c8}=Object,d8=Object.prototype.hasOwnProperty,R4=(j,$)=>J0(j,"name",{value:$,configurable:!0}),l8=(j,$)=>{for(var z in $)J0(j,z,{get:$[z],enumerable:!0})},_8=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of c8($))if(!d8.call(j,W)&&W!==z)J0(j,W,{get:()=>$[W],enumerable:!(Q=u8($,W))||Q.enumerable})}return j},s8=(j)=>_8(J0({},"__esModule",{value:!0}),j),S4={};l8(S4,{contentLengthMiddleware:()=>f0,contentLengthMiddlewareOptions:()=>k4,getContentLengthPlugin:()=>p8});P4.exports=s8(S4);var m8=l(),v4="content-length";function f0(j){return($)=>async(z)=>{let Q=z.request;if(m8.HttpRequest.isInstance(Q)){let{body:W,headers:Z}=Q;if(W&&Object.keys(Z).map((X)=>X.toLowerCase()).indexOf(v4)===-1)try{let X=j(W);Q.headers={...Q.headers,[v4]:String(X)}}catch(X){}}return $({...z,request:Q})}}R4(f0,"contentLengthMiddleware");var k4={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},p8=R4((j)=>({applyToStack:($)=>{$.add(f0(j.bodyLengthChecker),k4)}}),"getContentLengthPlugin")});var y=q((x4)=>{Object.defineProperty(x4,"__esModule",{value:!0});x4.getHomeDir=void 0;var a8=F("os"),n8=F("path"),g0={},r8=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},o8=()=>{let{HOME:j,USERPROFILE:$,HOMEPATH:z,HOMEDRIVE:Q=`C:${n8.sep}`}=process.env;if(j)return j;if($)return $;if(z)return`${Q}${z}`;let W=r8();if(!g0[W])g0[W]=a8.homedir();return g0[W]};x4.getHomeDir=o8});var u0=q((E4)=>{Object.defineProperty(E4,"__esModule",{value:!0});E4.getSSOTokenFilepath=void 0;var t8=F("crypto"),e8=F("path"),j6=y(),$6=(j)=>{let z=t8.createHash("sha1").update(j).digest("hex");return e8.join(j6.getHomeDir(),".aws","sso","cache",`${z}.json`)};E4.getSSOTokenFilepath=$6});var u4=q((f4)=>{Object.defineProperty(f4,"__esModule",{value:!0});f4.getSSOTokenFromFile=void 0;var z6=F("fs"),Q6=u0(),{readFile:W6}=z6.promises,Z6=async(j)=>{let $=Q6.getSSOTokenFilepath(j),z=await W6($,"utf8");return JSON.parse(z)};f4.getSSOTokenFromFile=Z6});var d0=q((c4)=>{Object.defineProperty(c4,"__esModule",{value:!0});c4.slurpFile=void 0;var X6=F("fs"),{readFile:J6}=X6.promises,c0={},K6=(j,$)=>{if(!c0[j]||($===null||$===void 0?void 0:$.ignoreCache))c0[j]=J6(j,"utf8");return c0[j]};c4.slurpFile=K6});var m0=q((EQ,m)=>{var{defineProperty:Y0,getOwnPropertyDescriptor:G6,getOwnPropertyNames:Y6}=Object,B6=Object.prototype.hasOwnProperty,N=(j,$)=>Y0(j,"name",{value:$,configurable:!0}),q6=(j,$)=>{for(var z in $)Y0(j,z,{get:$[z],enumerable:!0})},l0=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of Y6($))if(!B6.call(j,W)&&W!==z)Y0(j,W,{get:()=>$[W],enumerable:!(Q=G6($,W))||Q.enumerable})}return j},s0=(j,$,z)=>(l0(j,$,"default"),z&&l0(z,$,"default")),V6=(j)=>l0(Y0({},"__esModule",{value:!0}),j),s={};q6(s,{CONFIG_PREFIX_SEPARATOR:()=>A,DEFAULT_PROFILE:()=>m4,ENV_PROFILE:()=>s4,getProfileName:()=>H6,loadSharedConfigFiles:()=>i4,loadSsoSessionData:()=>I6,parseKnownFiles:()=>R6});m.exports=V6(s);s0(s,y(),m.exports);var s4="AWS_PROFILE",m4="default",H6=N((j)=>j.profile||process.env[s4]||m4,"getProfileName");s0(s,u0(),m.exports);s0(s,u4(),m.exports);var K0=R1(),w6=N((j)=>Object.entries(j).filter(([$])=>{let z=$.indexOf(A);if(z===-1)return!1;return Object.values(K0.IniSectionType).includes($.substring(0,z))}).reduce(($,[z,Q])=>{let W=z.indexOf(A),Z=z.substring(0,W)===K0.IniSectionType.PROFILE?z.substring(W+1):z;return $[Z]=Q,$},{...j.default&&{default:j.default}}),"getConfigData"),G0=F("path"),U6=y(),L6="AWS_CONFIG_FILE",p4=N(()=>process.env[L6]||G0.join(U6.getHomeDir(),".aws","config"),"getConfigFilepath"),M6=y(),b6="AWS_SHARED_CREDENTIALS_FILE",F6=N(()=>process.env[b6]||G0.join(M6.getHomeDir(),".aws","credentials"),"getCredentialsFilepath"),D6=y(),h6=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,N6=["__proto__","profile __proto__"],_0=N((j)=>{let $={},z,Q;for(let W of j.split(/\r?\n/)){let Z=W.split(/(^|\s)[;#]/)[0].trim();if(Z[0]==="["&&Z[Z.length-1]==="]"){z=void 0,Q=void 0;let J=Z.substring(1,Z.length-1),K=h6.exec(J);if(K){let[,G,,V]=K;if(Object.values(K0.IniSectionType).includes(G))z=[G,V].join(A)}else z=J;if(N6.includes(J))throw new Error(`Found invalid profile name "${J}"`)}else if(z){let J=Z.indexOf("=");if(![0,-1].includes(J)){let[K,G]=[Z.substring(0,J).trim(),Z.substring(J+1).trim()];if(G==="")Q=K;else{if(Q&&W.trimStart()===W)Q=void 0;$[z]=$[z]||{};let V=Q?[Q,K].join(A):K;$[z][V]=G}}}}return $},"parseIni"),l4=d0(),_4=N(()=>({}),"swallowError"),A=".",i4=N(async(j={})=>{let{filepath:$=F6(),configFilepath:z=p4()}=j,Q=D6.getHomeDir(),W="~/",Z=$;if($.startsWith("~/"))Z=G0.join(Q,$.slice(2));let X=z;if(z.startsWith("~/"))X=G0.join(Q,z.slice(2));let J=await Promise.all([l4.slurpFile(X,{ignoreCache:j.ignoreCache}).then(_0).then(w6).catch(_4),l4.slurpFile(Z,{ignoreCache:j.ignoreCache}).then(_0).catch(_4)]);return{configFile:J[0],credentialsFile:J[1]}},"loadSharedConfigFiles"),O6=N((j)=>Object.entries(j).filter(([$])=>$.startsWith(K0.IniSectionType.SSO_SESSION+A)).reduce(($,[z,Q])=>({...$,[z.substring(z.indexOf(A)+1)]:Q}),{}),"getSsoSessionData"),C6=d0(),T6=N(()=>({}),"swallowError"),I6=N(async(j={})=>C6.slurpFile(j.configFilepath??p4()).then(_0).then(O6).catch(T6),"loadSsoSessionData"),v6=N((...j)=>{let $={};for(let z of j)for(let[Q,W]of Object.entries(z))if($[Q]!==void 0)Object.assign($[Q],W);else $[Q]=W;return $},"mergeConfigFiles"),R6=N(async(j)=>{let $=await i4(j);return v6($.configFile,$.credentialsFile)},"parseKnownFiles")});var q0=q((yQ,r4)=>{var{defineProperty:B0,getOwnPropertyDescriptor:S6,getOwnPropertyNames:k6}=Object,P6=Object.prototype.hasOwnProperty,f=(j,$)=>B0(j,"name",{value:$,configurable:!0}),x6=(j,$)=>{for(var z in $)B0(j,z,{get:$[z],enumerable:!0})},A6=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of k6($))if(!P6.call(j,W)&&W!==z)B0(j,W,{get:()=>$[W],enumerable:!(Q=S6($,W))||Q.enumerable})}return j},E6=(j)=>A6(B0({},"__esModule",{value:!0}),j),n4={};x6(n4,{loadConfig:()=>c6});r4.exports=E6(n4);var p=p0();function i0(j){try{let $=new Set(Array.from(j.match(/([A-Z_]){3,}/g)??[]));return $.delete("CONFIG"),$.delete("CONFIG_PREFIX_SEPARATOR"),$.delete("ENV"),[...$].join(", ")}catch($){return j}}f(i0,"getSelectorName");var y6=f((j,$)=>async()=>{try{let z=j(process.env);if(z===void 0)throw new Error;return z}catch(z){throw new p.CredentialsProviderError(z.message||`Not found in ENV: ${i0(j.toString())}`,{logger:$})}},"fromEnv"),a4=m0(),f6=f((j,{preferredFile:$="config",...z}={})=>async()=>{let Q=a4.getProfileName(z),{configFile:W,credentialsFile:Z}=await a4.loadSharedConfigFiles(z),X=Z[Q]||{},J=W[Q]||{},K=$==="config"?{...X,...J}:{...J,...X};try{let V=j(K,$==="config"?W:Z);if(V===void 0)throw new Error;return V}catch(G){throw new p.CredentialsProviderError(G.message||`Not found in config files w/ profile [${Q}]: ${i0(j.toString())}`,{logger:z.logger})}},"fromSharedConfigFiles"),g6=f((j)=>typeof j==="function","isFunction"),u6=f((j)=>g6(j)?async()=>await j():p.fromStatic(j),"fromStatic"),c6=f(({environmentVariableSelector:j,configFileSelector:$,default:z},Q={})=>p.memoize(p.chain(y6(j),f6($,Q),u6(z))),"loadConfig")});var z7=q((j7)=>{Object.defineProperty(j7,"__esModule",{value:!0});j7.getEndpointUrlConfig=void 0;var o4=m0(),t4="AWS_ENDPOINT_URL",e4="endpoint_url",d6=(j)=>({environmentVariableSelector:($)=>{let z=j.split(" ").map((Z)=>Z.toUpperCase()),Q=$[[t4,...z].join("_")];if(Q)return Q;let W=$[t4];if(W)return W;return},configFileSelector:($,z)=>{if(z&&$.services){let W=z[["services",$.services].join(o4.CONFIG_PREFIX_SEPARATOR)];if(W){let Z=j.split(" ").map((J)=>J.toLowerCase()),X=W[[Z.join("_"),e4].join(o4.CONFIG_PREFIX_SEPARATOR)];if(X)return X}}let Q=$[e4];if(Q)return Q;return},default:void 0});j7.getEndpointUrlConfig=d6});var a0=q((Q7)=>{Object.defineProperty(Q7,"__esModule",{value:!0});Q7.getEndpointFromConfig=void 0;var l6=q0(),_6=z7(),s6=async(j)=>l6.loadConfig(_6.getEndpointUrlConfig(j!==null&&j!==void 0?j:""))();Q7.getEndpointFromConfig=s6});var K7=q((uQ,J7)=>{var{defineProperty:V0,getOwnPropertyDescriptor:m6,getOwnPropertyNames:p6}=Object,i6=Object.prototype.hasOwnProperty,a6=(j,$)=>V0(j,"name",{value:$,configurable:!0}),n6=(j,$)=>{for(var z in $)V0(j,z,{get:$[z],enumerable:!0})},r6=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of p6($))if(!i6.call(j,W)&&W!==z)V0(j,W,{get:()=>$[W],enumerable:!(Q=m6($,W))||Q.enumerable})}return j},o6=(j)=>r6(V0({},"__esModule",{value:!0}),j),Z7={};n6(Z7,{parseQueryString:()=>X7});J7.exports=o6(Z7);function X7(j){let $={};if(j=j.replace(/^\?/,""),j)for(let z of j.split("&")){let[Q,W=null]=z.split("=");if(Q=decodeURIComponent(Q),W)W=decodeURIComponent(W);if(!(Q in $))$[Q]=W;else if(Array.isArray($[Q]))$[Q].push(W);else $[Q]=[$[Q],W]}return $}a6(X7,"parseQueryString")});var n0=q((cQ,B7)=>{var{defineProperty:H0,getOwnPropertyDescriptor:t6,getOwnPropertyNames:e6}=Object,j$=Object.prototype.hasOwnProperty,$$=(j,$)=>H0(j,"name",{value:$,configurable:!0}),z$=(j,$)=>{for(var z in $)H0(j,z,{get:$[z],enumerable:!0})},Q$=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of e6($))if(!j$.call(j,W)&&W!==z)H0(j,W,{get:()=>$[W],enumerable:!(Q=t6($,W))||Q.enumerable})}return j},W$=(j)=>Q$(H0({},"__esModule",{value:!0}),j),G7={};z$(G7,{parseUrl:()=>Y7});B7.exports=W$(G7);var Z$=K7(),Y7=$$((j)=>{if(typeof j==="string")return Y7(new URL(j));let{hostname:$,pathname:z,port:Q,protocol:W,search:Z}=j,X;if(Z)X=Z$.parseQueryString(Z);return{hostname:$,port:Q?parseInt(Q):void 0,protocol:W,path:z,query:X}},"parseUrl")});var T$=q((dQ,M7)=>{var{defineProperty:U0,getOwnPropertyDescriptor:J$,getOwnPropertyNames:K$}=Object,G$=Object.prototype.hasOwnProperty,T=(j,$)=>U0(j,"name",{value:$,configurable:!0}),Y$=(j,$)=>{for(var z in $)U0(j,z,{get:$[z],enumerable:!0})},B$=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of K$($))if(!G$.call(j,W)&&W!==z)U0(j,W,{get:()=>$[W],enumerable:!(Q=J$($,W))||Q.enumerable})}return j},q$=(j)=>B$(U0({},"__esModule",{value:!0}),j),V7={};Y$(V7,{endpointMiddleware:()=>U7,endpointMiddlewareOptions:()=>L7,getEndpointFromInstructions:()=>H7,getEndpointPlugin:()=>N$,resolveEndpointConfig:()=>C$,resolveParams:()=>w7,toEndpointV1:()=>r0});M7.exports=q$(V7);var V$=T(async(j)=>{let $=j?.Bucket||"";if(typeof j.Bucket==="string")j.Bucket=$.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(M$($)){if(j.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!L$($)||$.indexOf(".")!==-1&&!String(j.Endpoint).startsWith("http:")||$.toLowerCase()!==$||$.length<3)j.ForcePathStyle=!0;if(j.DisableMultiRegionAccessPoints)j.disableMultiRegionAccessPoints=!0,j.DisableMRAP=!0;return j},"resolveParamsForS3"),H$=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,w$=/(\d+\.){3}\d+/,U$=/\.\./,L$=T((j)=>H$.test(j)&&!w$.test(j)&&!U$.test(j),"isDnsCompatibleBucketName"),M$=T((j)=>{let[$,z,Q,,,W]=j.split(":"),Z=$==="arn"&&j.split(":").length>=6,X=Boolean(Z&&z&&Q&&W);if(Z&&!X)throw new Error(`Invalid ARN: ${j} was an invalid ARN.`);return X},"isArnBucketName"),b$=T((j,$,z)=>{let Q=T(async()=>{let W=z[j]??z[$];if(typeof W==="function")return W();return W},"configProvider");if(j==="credentialScope"||$==="CredentialScope")return async()=>{let W=typeof z.credentials==="function"?await z.credentials():z.credentials;return W?.credentialScope??W?.CredentialScope};if(j==="accountId"||$==="AccountId")return async()=>{let W=typeof z.credentials==="function"?await z.credentials():z.credentials;return W?.accountId??W?.AccountId};if(j==="endpoint"||$==="endpoint")return async()=>{let W=await Q();if(W&&typeof W==="object"){if("url"in W)return W.url.href;if("hostname"in W){let{protocol:Z,hostname:X,port:J,path:K}=W;return`${Z}//${X}${J?":"+J:""}${K}`}}return W};return Q},"createConfigValueProvider"),F$=a0(),q7=n0(),r0=T((j)=>{if(typeof j==="object"){if("url"in j)return q7.parseUrl(j.url);return j}return q7.parseUrl(j)},"toEndpointV1"),H7=T(async(j,$,z,Q)=>{if(!z.endpoint){let X;if(z.serviceConfiguredEndpoint)X=await z.serviceConfiguredEndpoint();else X=await F$.getEndpointFromConfig(z.serviceId);if(X)z.endpoint=()=>Promise.resolve(r0(X))}let W=await w7(j,$,z);if(typeof z.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return z.endpointProvider(W,Q)},"getEndpointFromInstructions"),w7=T(async(j,$,z)=>{let Q={},W=$?.getEndpointParameterInstructions?.()||{};for(let[Z,X]of Object.entries(W))switch(X.type){case"staticContextParams":Q[Z]=X.value;break;case"contextParams":Q[Z]=j[X.name];break;case"clientContextParams":case"builtInParams":Q[Z]=await b$(X.name,Z,z)();break;case"operationContextParams":Q[Z]=X.get(j);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(X))}if(Object.keys(W).length===0)Object.assign(Q,z);if(String(z.serviceId).toLowerCase()==="s3")await V$(Q);return Q},"resolveParams"),D$=j4(),w0=y0(),U7=T(({config:j,instructions:$})=>{return(z,Q)=>async(W)=>{if(j.endpoint)D$.setFeature(Q,"ENDPOINT_OVERRIDE","N");let Z=await H7(W.input,{getEndpointParameterInstructions(){return $}},{...j},Q);Q.endpointV2=Z,Q.authSchemes=Z.properties?.authSchemes;let X=Q.authSchemes?.[0];if(X){Q.signing_region=X.signingRegion,Q.signing_service=X.signingName;let K=w0.getSmithyContext(Q)?.selectedHttpAuthScheme?.httpAuthOption;if(K)K.signingProperties=Object.assign(K.signingProperties||{},{signing_region:X.signingRegion,signingRegion:X.signingRegion,signing_service:X.signingName,signingName:X.signingName,signingRegionSet:X.signingRegionSet},X.properties)}return z({...W})}},"endpointMiddleware"),h$=X$(),L7={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:h$.serializerMiddlewareOption.name},N$=T((j,$)=>({applyToStack:(z)=>{z.addRelativeTo(U7({config:j,instructions:$}),L7)}}),"getEndpointPlugin"),O$=a0(),C$=T((j)=>{let $=j.tls??!0,{endpoint:z}=j,Q=z!=null?async()=>r0(await w0.normalizeProvider(z)()):void 0,Z={...j,endpoint:Q,tls:$,isCustomEndpoint:!!z,useDualstackEndpoint:w0.normalizeProvider(j.useDualstackEndpoint??!1),useFipsEndpoint:w0.normalizeProvider(j.useFipsEndpoint??!1)},X=void 0;return Z.serviceConfiguredEndpoint=async()=>{if(j.serviceId&&!X)X=O$.getEndpointFromConfig(j.serviceId);return X},Z},"resolveEndpointConfig")});var t0=q((lQ,D7)=>{var{defineProperty:L0,getOwnPropertyDescriptor:I$,getOwnPropertyNames:v$}=Object,R$=Object.prototype.hasOwnProperty,g=(j,$)=>L0(j,"name",{value:$,configurable:!0}),S$=(j,$)=>{for(var z in $)L0(j,z,{get:$[z],enumerable:!0})},k$=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of v$($))if(!R$.call(j,W)&&W!==z)L0(j,W,{get:()=>$[W],enumerable:!(Q=I$($,W))||Q.enumerable})}return j},P$=(j)=>k$(L0({},"__esModule",{value:!0}),j),b7={};S$(b7,{isClockSkewCorrectedError:()=>F7,isClockSkewError:()=>u$,isRetryableByTrait:()=>g$,isServerError:()=>d$,isThrottlingError:()=>c$,isTransientError:()=>o0});D7.exports=P$(b7);var x$=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],A$=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],E$=["TimeoutError","RequestTimeout","RequestTimeoutException"],y$=[500,502,503,504],f$=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],g$=g((j)=>j.$retryable!==void 0,"isRetryableByTrait"),u$=g((j)=>x$.includes(j.name),"isClockSkewError"),F7=g((j)=>j.$metadata?.clockSkewCorrected,"isClockSkewCorrectedError"),c$=g((j)=>j.$metadata?.httpStatusCode===429||A$.includes(j.name)||j.$retryable?.throttling==!0,"isThrottlingError"),o0=g((j,$=0)=>F7(j)||E$.includes(j.name)||f$.includes(j?.code||"")||y$.includes(j.$metadata?.httpStatusCode||0)||j.cause!==void 0&&$<=10&&o0(j.cause,$+1),"isTransientError"),d$=g((j)=>{if(j.$metadata?.httpStatusCode!==void 0){let $=j.$metadata.httpStatusCode;if(500<=$&&$<=599&&!o0(j))return!0;return!1}return!1},"isServerError")});var k7=q((_Q,S7)=>{var{defineProperty:M0,getOwnPropertyDescriptor:l$,getOwnPropertyNames:_$}=Object,s$=Object.prototype.hasOwnProperty,I=(j,$)=>M0(j,"name",{value:$,configurable:!0}),m$=(j,$)=>{for(var z in $)M0(j,z,{get:$[z],enumerable:!0})},p$=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of _$($))if(!s$.call(j,W)&&W!==z)M0(j,W,{get:()=>$[W],enumerable:!(Q=l$($,W))||Q.enumerable})}return j},i$=(j)=>p$(M0({},"__esModule",{value:!0}),j),N7={};m$(N7,{AdaptiveRetryStrategy:()=>e$,ConfiguredRetryStrategy:()=>jz,DEFAULT_MAX_ATTEMPTS:()=>e0,DEFAULT_RETRY_DELAY_BASE:()=>i,DEFAULT_RETRY_MODE:()=>a$,DefaultRateLimiter:()=>C7,INITIAL_RETRY_TOKENS:()=>j1,INVOCATION_ID_HEADER:()=>r$,MAXIMUM_RETRY_DELAY:()=>$1,NO_RETRY_INCREMENT:()=>R7,REQUEST_HEADER:()=>o$,RETRY_COST:()=>I7,RETRY_MODES:()=>O7,StandardRetryStrategy:()=>z1,THROTTLING_RETRY_DELAY_BASE:()=>T7,TIMEOUT_RETRY_COST:()=>v7});S7.exports=i$(N7);var O7=((j)=>{return j.STANDARD="standard",j.ADAPTIVE="adaptive",j})(O7||{}),e0=3,a$="standard",n$=t0(),C7=class j{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;let z=this.getCurrentTimeInSeconds();this.lastThrottleTime=z,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}static{I(this,"DefaultRateLimiter")}static{this.setTimeoutFn=setTimeout}getCurrentTimeInSeconds(){return Date.now()/1000}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket($){if(!this.enabled)return;if(this.refillTokenBucket(),$>this.currentCapacity){let z=($-this.currentCapacity)/this.fillRate*1000;await new Promise((Q)=>j.setTimeoutFn(Q,z))}this.currentCapacity=this.currentCapacity-$}refillTokenBucket(){let $=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=$;return}let z=($-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+z),this.lastTimestamp=$}updateClientSendingRate($){let z;if(this.updateMeasuredRate(),n$.isThrottlingError($)){let W=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=W,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),z=this.cubicThrottle(W),this.enableTokenBucket()}else this.calculateTimeWindow(),z=this.cubicSuccess(this.getCurrentTimeInSeconds());let Q=Math.min(z,2*this.measuredTxRate);this.updateTokenBucketRate(Q)}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(){let $=this.getCurrentTimeInSeconds(),z=Math.floor($*2)/2;if(this.requestCount++,z>this.lastTxRateBucket){let Q=this.requestCount/(z-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(Q*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=z}}getPrecise($){return parseFloat($.toFixed(8))}},i=100,$1=20000,T7=500,j1=500,I7=5,v7=10,R7=1,r$="amz-sdk-invocation-id",o$="amz-sdk-request",t$=I(()=>{let j=i;return{computeNextBackoffDelay:I((Q)=>{return Math.floor(Math.min($1,Math.random()*2**Q*j))},"computeNextBackoffDelay"),setDelayBase:I((Q)=>{j=Q},"setDelayBase")}},"getDefaultRetryBackoffStrategy"),h7=I(({retryDelay:j,retryCount:$,retryCost:z})=>{return{getRetryCount:I(()=>$,"getRetryCount"),getRetryDelay:I(()=>Math.min($1,j),"getRetryDelay"),getRetryCost:I(()=>z,"getRetryCost")}},"createDefaultRetryToken"),z1=class{constructor(j){this.maxAttempts=j,this.mode="standard",this.capacity=j1,this.retryBackoffStrategy=t$(),this.maxAttemptsProvider=typeof j==="function"?j:async()=>j}static{I(this,"StandardRetryStrategy")}async acquireInitialRetryToken(j){return h7({retryDelay:i,retryCount:0})}async refreshRetryTokenForRetry(j,$){let z=await this.getMaxAttempts();if(this.shouldRetry(j,$,z)){let Q=$.errorType;this.retryBackoffStrategy.setDelayBase(Q==="THROTTLING"?T7:i);let W=this.retryBackoffStrategy.computeNextBackoffDelay(j.getRetryCount()),Z=$.retryAfterHint?Math.max($.retryAfterHint.getTime()-Date.now()||0,W):W,X=this.getCapacityCost(Q);return this.capacity-=X,h7({retryDelay:Z,retryCount:j.getRetryCount()+1,retryCost:X})}throw new Error("No retry token available")}recordSuccess(j){this.capacity=Math.max(j1,this.capacity+(j.getRetryCost()??R7))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(j){return console.warn(`Max attempts provider could not resolve. Using default of ${e0}`),e0}}shouldRetry(j,$,z){return j.getRetryCount()+1<z&&this.capacity>=this.getCapacityCost($.errorType)&&this.isRetryableError($.errorType)}getCapacityCost(j){return j==="TRANSIENT"?v7:I7}isRetryableError(j){return j==="THROTTLING"||j==="TRANSIENT"}},e$=class{constructor(j,$){this.maxAttemptsProvider=j,this.mode="adaptive";let{rateLimiter:z}=$??{};this.rateLimiter=z??new C7,this.standardRetryStrategy=new z1(j)}static{I(this,"AdaptiveRetryStrategy")}async acquireInitialRetryToken(j){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(j)}async refreshRetryTokenForRetry(j,$){return this.rateLimiter.updateClientSendingRate($),this.standardRetryStrategy.refreshRetryTokenForRetry(j,$)}recordSuccess(j){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(j)}},jz=class extends z1{static{I(this,"ConfiguredRetryStrategy")}constructor(j,$=i){super(typeof j==="function"?j:async()=>j);if(typeof $==="number")this.computeNextBackoffDelay=()=>$;else this.computeNextBackoffDelay=$}async refreshRetryTokenForRetry(j,$){let z=await super.refreshRetryTokenForRetry(j,$);return z.getRetryDelay=()=>this.computeNextBackoffDelay(z.getRetryCount()),z}}});var A7=q((P7)=>{Object.defineProperty(P7,"__esModule",{value:!0});P7.isStreamingPayload=void 0;var $z=F("stream"),zz=(j)=>(j===null||j===void 0?void 0:j.body)instanceof $z.Readable||typeof ReadableStream!=="undefined"&&(j===null||j===void 0?void 0:j.body)instanceof ReadableStream;P7.isStreamingPayload=zz});var Oz=q((aQ,n7)=>{var{defineProperty:b0,getOwnPropertyDescriptor:Zz,getOwnPropertyNames:Xz}=Object,Jz=Object.prototype.hasOwnProperty,L=(j,$)=>b0(j,"name",{value:$,configurable:!0}),Kz=(j,$)=>{for(var z in $)b0(j,z,{get:$[z],enumerable:!0})},Gz=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of Xz($))if(!Jz.call(j,W)&&W!==z)b0(j,W,{get:()=>$[W],enumerable:!(Q=Zz($,W))||Q.enumerable})}return j},Yz=(j)=>Gz(b0({},"__esModule",{value:!0}),j),y7={};Kz(y7,{AdaptiveRetryStrategy:()=>Vz,CONFIG_MAX_ATTEMPTS:()=>W1,CONFIG_RETRY_MODE:()=>_7,ENV_MAX_ATTEMPTS:()=>Q1,ENV_RETRY_MODE:()=>l7,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>Hz,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>Uz,StandardRetryStrategy:()=>d7,defaultDelayDecider:()=>g7,defaultRetryDecider:()=>u7,getOmitRetryHeadersPlugin:()=>Lz,getRetryAfterHint:()=>a7,getRetryPlugin:()=>Nz,omitRetryHeadersMiddleware:()=>s7,omitRetryHeadersMiddlewareOptions:()=>m7,resolveRetryConfig:()=>wz,retryMiddleware:()=>p7,retryMiddlewareOptions:()=>i7});n7.exports=Yz(y7);var u=l(),f7=Wz(),U=k7(),Bz=L((j,$)=>{let z=j,Q=$?.noRetryIncrement??U.NO_RETRY_INCREMENT,W=$?.retryCost??U.RETRY_COST,Z=$?.timeoutRetryCost??U.TIMEOUT_RETRY_COST,X=j,J=L((Y)=>Y.name==="TimeoutError"?Z:W,"getCapacityAmount"),K=L((Y)=>J(Y)<=X,"hasRetryTokens");return Object.freeze({hasRetryTokens:K,retrieveRetryTokens:L((Y)=>{if(!K(Y))throw new Error("No retry token available");let B=J(Y);return X-=B,B},"retrieveRetryTokens"),releaseRetryTokens:L((Y)=>{X+=Y??Q,X=Math.min(X,z)},"releaseRetryTokens")})},"getDefaultRetryQuota"),g7=L((j,$)=>Math.floor(Math.min(U.MAXIMUM_RETRY_DELAY,Math.random()*2**$*j)),"defaultDelayDecider"),P=t0(),u7=L((j)=>{if(!j)return!1;return P.isRetryableByTrait(j)||P.isClockSkewError(j)||P.isThrottlingError(j)||P.isTransientError(j)},"defaultRetryDecider"),c7=L((j)=>{if(j instanceof Error)return j;if(j instanceof Object)return Object.assign(new Error,j);if(typeof j==="string")return new Error(j);return new Error(`AWS SDK error wrapper for ${j}`)},"asSdkError"),d7=class{constructor(j,$){this.maxAttemptsProvider=j,this.mode=U.RETRY_MODES.STANDARD,this.retryDecider=$?.retryDecider??u7,this.delayDecider=$?.delayDecider??g7,this.retryQuota=$?.retryQuota??Bz(U.INITIAL_RETRY_TOKENS)}static{L(this,"StandardRetryStrategy")}shouldRetry(j,$,z){return $<z&&this.retryDecider(j)&&this.retryQuota.hasRetryTokens(j)}async getMaxAttempts(){let j;try{j=await this.maxAttemptsProvider()}catch($){j=U.DEFAULT_MAX_ATTEMPTS}return j}async retry(j,$,z){let Q,W=0,Z=0,X=await this.getMaxAttempts(),{request:J}=$;if(u.HttpRequest.isInstance(J))J.headers[U.INVOCATION_ID_HEADER]=f7.v4();while(!0)try{if(u.HttpRequest.isInstance(J))J.headers[U.REQUEST_HEADER]=`attempt=${W+1}; max=${X}`;if(z?.beforeRequest)await z.beforeRequest();let{response:K,output:G}=await j($);if(z?.afterRequest)z.afterRequest(K);return this.retryQuota.releaseRetryTokens(Q),G.$metadata.attempts=W+1,G.$metadata.totalRetryDelay=Z,{response:K,output:G}}catch(K){let G=c7(K);if(W++,this.shouldRetry(G,W,X)){Q=this.retryQuota.retrieveRetryTokens(G);let V=this.delayDecider(P.isThrottlingError(G)?U.THROTTLING_RETRY_DELAY_BASE:U.DEFAULT_RETRY_DELAY_BASE,W),Y=qz(G.$response),B=Math.max(Y||0,V);Z+=B,await new Promise((b)=>setTimeout(b,B));continue}if(!G.$metadata)G.$metadata={};throw G.$metadata.attempts=W,G.$metadata.totalRetryDelay=Z,G}}},qz=L((j)=>{if(!u.HttpResponse.isInstance(j))return;let $=Object.keys(j.headers).find((Z)=>Z.toLowerCase()==="retry-after");if(!$)return;let z=j.headers[$],Q=Number(z);if(!Number.isNaN(Q))return Q*1000;return new Date(z).getTime()-Date.now()},"getDelayFromRetryAfterHeader"),Vz=class extends d7{static{L(this,"AdaptiveRetryStrategy")}constructor(j,$){let{rateLimiter:z,...Q}=$??{};super(j,Q);this.rateLimiter=z??new U.DefaultRateLimiter,this.mode=U.RETRY_MODES.ADAPTIVE}async retry(j,$){return super.retry(j,$,{beforeRequest:async()=>{return this.rateLimiter.getSendToken()},afterRequest:(z)=>{this.rateLimiter.updateClientSendingRate(z)}})}},E7=y0(),Q1="AWS_MAX_ATTEMPTS",W1="max_attempts",Hz={environmentVariableSelector:(j)=>{let $=j[Q1];if(!$)return;let z=parseInt($);if(Number.isNaN(z))throw new Error(`Environment variable ${Q1} mast be a number, got "${$}"`);return z},configFileSelector:(j)=>{let $=j[W1];if(!$)return;let z=parseInt($);if(Number.isNaN(z))throw new Error(`Shared config file entry ${W1} mast be a number, got "${$}"`);return z},default:U.DEFAULT_MAX_ATTEMPTS},wz=L((j)=>{let{retryStrategy:$}=j,z=E7.normalizeProvider(j.maxAttempts??U.DEFAULT_MAX_ATTEMPTS);return{...j,maxAttempts:z,retryStrategy:async()=>{if($)return $;if(await E7.normalizeProvider(j.retryMode)()===U.RETRY_MODES.ADAPTIVE)return new U.AdaptiveRetryStrategy(z);return new U.StandardRetryStrategy(z)}}},"resolveRetryConfig"),l7="AWS_RETRY_MODE",_7="retry_mode",Uz={environmentVariableSelector:(j)=>j[l7],configFileSelector:(j)=>j[_7],default:U.DEFAULT_RETRY_MODE},s7=L(()=>(j)=>async($)=>{let{request:z}=$;if(u.HttpRequest.isInstance(z))delete z.headers[U.INVOCATION_ID_HEADER],delete z.headers[U.REQUEST_HEADER];return j($)},"omitRetryHeadersMiddleware"),m7={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},Lz=L((j)=>({applyToStack:($)=>{$.addRelativeTo(s7(),m7)}}),"getOmitRetryHeadersPlugin"),Mz=Qz(),bz=A7(),p7=L((j)=>($,z)=>async(Q)=>{let W=await j.retryStrategy(),Z=await j.maxAttempts();if(Fz(W)){W=W;let X=await W.acquireInitialRetryToken(z.partition_id),J=new Error,K=0,G=0,{request:V}=Q,Y=u.HttpRequest.isInstance(V);if(Y)V.headers[U.INVOCATION_ID_HEADER]=f7.v4();while(!0)try{if(Y)V.headers[U.REQUEST_HEADER]=`attempt=${K+1}; max=${Z}`;let{response:B,output:b}=await $(Q);return W.recordSuccess(X),b.$metadata.attempts=K+1,b.$metadata.totalRetryDelay=G,{response:B,output:b}}catch(B){let b=Dz(B);if(J=c7(B),Y&&bz.isStreamingPayload(V))throw(z.logger instanceof Mz.NoOpLogger?console:z.logger)?.warn("An error was encountered in a non-retryable streaming request."),J;try{X=await W.refreshRetryTokenForRetry(X,b)}catch(O){if(!J.$metadata)J.$metadata={};throw J.$metadata.attempts=K+1,J.$metadata.totalRetryDelay=G,J}K=X.getRetryCount();let D=X.getRetryDelay();G+=D,await new Promise((O)=>setTimeout(O,D))}}else{if(W=W,W?.mode)z.userAgent=[...z.userAgent||[],["cfg/retry-mode",W.mode]];return W.retry($,Q)}},"retryMiddleware"),Fz=L((j)=>typeof j.acquireInitialRetryToken!=="undefined"&&typeof j.refreshRetryTokenForRetry!=="undefined"&&typeof j.recordSuccess!=="undefined","isRetryStrategyV2"),Dz=L((j)=>{let $={error:j,errorType:hz(j)},z=a7(j.$response);if(z)$.retryAfterHint=z;return $},"getRetryErrorInfo"),hz=L((j)=>{if(P.isThrottlingError(j))return"THROTTLING";if(P.isTransientError(j))return"TRANSIENT";if(P.isServerError(j))return"SERVER_ERROR";return"CLIENT_ERROR"},"getRetryErrorType"),i7={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Nz=L((j)=>({applyToStack:($)=>{$.add(p7(j),i7)}}),"getRetryPlugin"),a7=L((j)=>{if(!u.HttpResponse.isInstance(j))return;let $=Object.keys(j.headers).find((Z)=>Z.toLowerCase()==="retry-after");if(!$)return;let z=j.headers[$],Q=Number(z);if(!Number.isNaN(Q))return new Date(Q*1000);return new Date(z)},"getRetryAfterHint")});var yz=q((oQ,$5)=>{var{defineProperty:F0,getOwnPropertyDescriptor:Cz,getOwnPropertyNames:Tz}=Object,Iz=Object.prototype.hasOwnProperty,c=(j,$)=>F0(j,"name",{value:$,configurable:!0}),vz=(j,$)=>{for(var z in $)F0(j,z,{get:$[z],enumerable:!0})},Rz=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of Tz($))if(!Iz.call(j,W)&&W!==z)F0(j,W,{get:()=>$[W],enumerable:!(Q=Cz($,W))||Q.enumerable})}return j},Sz=(j)=>Rz(F0({},"__esModule",{value:!0}),j),o7={};vz(o7,{NODE_REGION_CONFIG_FILE_OPTIONS:()=>Az,NODE_REGION_CONFIG_OPTIONS:()=>xz,REGION_ENV_NAME:()=>t7,REGION_INI_NAME:()=>e7,getAwsRegionExtensionConfiguration:()=>kz,resolveAwsRegionExtensionConfiguration:()=>Pz,resolveRegionConfig:()=>Ez});$5.exports=Sz(o7);var kz=c((j)=>{let $=c(async()=>{if(j.region===void 0)throw new Error("Region is missing from runtimeConfig");let z=j.region;if(typeof z==="string")return z;return z()},"runtimeConfigRegion");return{setRegion(z){$=z},region(){return $}}},"getAwsRegionExtensionConfiguration"),Pz=c((j)=>{return{region:j.region()}},"resolveAwsRegionExtensionConfiguration"),t7="AWS_REGION",e7="region",xz={environmentVariableSelector:(j)=>j[t7],configFileSelector:(j)=>j[e7],default:()=>{throw new Error("Region is missing")}},Az={preferredFile:"credentials"},j5=c((j)=>typeof j==="string"&&(j.startsWith("fips-")||j.endsWith("-fips")),"isFipsRegion"),r7=c((j)=>j5(j)?["fips-aws-global","aws-fips"].includes(j)?"us-east-1":j.replace(/fips-(dkr-|prod-)?|-fips/,""):j,"getRealRegion"),Ez=c((j)=>{let{region:$,useFipsEndpoint:z}=j;if(!$)throw new Error("Region is missing");return{...j,region:async()=>{if(typeof $==="string")return r7($);let Q=await $();return r7(Q)},useFipsEndpoint:async()=>{let Q=typeof $==="string"?$:await $();if(j5(Q))return!0;return typeof z!=="function"?Promise.resolve(!!z):z()}}},"resolveRegionConfig")});var gz=q((tQ,fz)=>{fz.exports={name:"@aws-sdk/nested-clients",version:"3.772.0",description:"Nested clients for AWS SDK packages.",main:"./dist-cjs/index.js",module:"./dist-es/index.js",types:"./dist-types/index.d.ts",scripts:{build:"yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline nested-clients","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo",lint:"node ../../scripts/validation/submodules-linter.js --pkg nested-clients",test:"yarn g:vitest run","test:watch":"yarn g:vitest watch"},engines:{node:">=18.0.0"},author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.758.0","@aws-sdk/middleware-host-header":"3.734.0","@aws-sdk/middleware-logger":"3.734.0","@aws-sdk/middleware-recursion-detection":"3.772.0","@aws-sdk/middleware-user-agent":"3.758.0","@aws-sdk/region-config-resolver":"3.734.0","@aws-sdk/types":"3.734.0","@aws-sdk/util-endpoints":"3.743.0","@aws-sdk/util-user-agent-browser":"3.734.0","@aws-sdk/util-user-agent-node":"3.758.0","@smithy/config-resolver":"^4.0.1","@smithy/core":"^3.1.5","@smithy/fetch-http-handler":"^5.0.1","@smithy/hash-node":"^4.0.1","@smithy/invalid-dependency":"^4.0.1","@smithy/middleware-content-length":"^4.0.1","@smithy/middleware-endpoint":"^4.0.6","@smithy/middleware-retry":"^4.0.7","@smithy/middleware-serde":"^4.0.2","@smithy/middleware-stack":"^4.0.1","@smithy/node-config-provider":"^4.0.1","@smithy/node-http-handler":"^4.0.3","@smithy/protocol-http":"^5.0.1","@smithy/smithy-client":"^4.1.6","@smithy/types":"^4.1.0","@smithy/url-parser":"^4.0.1","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.7","@smithy/util-defaults-mode-node":"^4.0.7","@smithy/util-endpoints":"^3.0.1","@smithy/util-middleware":"^4.0.1","@smithy/util-retry":"^4.0.1","@smithy/util-utf8":"^4.0.0",tslib:"^2.6.2"},devDependencies:{concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~5.2.2"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["./sso-oidc.d.ts","./sso-oidc.js","./sts.d.ts","./sts.js","dist-*/**"],browser:{"./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},"react-native":{},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"packages/nested-clients"},exports:{"./sso-oidc":{module:"./dist-es/submodules/sso-oidc/index.js",node:"./dist-cjs/submodules/sso-oidc/index.js",import:"./dist-es/submodules/sso-oidc/index.js",require:"./dist-cjs/submodules/sso-oidc/index.js",types:"./dist-types/submodules/sso-oidc/index.d.ts"},"./sts":{module:"./dist-es/submodules/sts/index.js",node:"./dist-cjs/submodules/sts/index.js",import:"./dist-es/submodules/sts/index.js",require:"./dist-cjs/submodules/sts/index.js",types:"./dist-types/submodules/sts/index.d.ts"}}}});var rz=q((eQ,G5)=>{var{defineProperty:D0,getOwnPropertyDescriptor:uz,getOwnPropertyNames:cz}=Object,dz=Object.prototype.hasOwnProperty,Q5=(j,$)=>D0(j,"name",{value:$,configurable:!0}),lz=(j,$)=>{for(var z in $)D0(j,z,{get:$[z],enumerable:!0})},_z=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of cz($))if(!dz.call(j,W)&&W!==z)D0(j,W,{get:()=>$[W],enumerable:!(Q=uz($,W))||Q.enumerable})}return j},sz=(j)=>_z(D0({},"__esModule",{value:!0}),j),W5={};lz(W5,{NODE_APP_ID_CONFIG_OPTIONS:()=>nz,UA_APP_ID_ENV_NAME:()=>J5,UA_APP_ID_INI_NAME:()=>K5,createDefaultUserAgentProvider:()=>X5,crtAvailability:()=>Z5,defaultUserAgent:()=>pz});G5.exports=sz(W5);var z5=F("os"),Z1=F("process"),Z5={isCrtAvailable:!1},mz=Q5(()=>{if(Z5.isCrtAvailable)return["md/crt-avail"];return null},"isCrtAvailable"),X5=Q5(({serviceId:j,clientVersion:$})=>{return async(z)=>{let Q=[["aws-sdk-js",$],["ua","2.1"],[`os/${z5.platform()}`,z5.release()],["lang/js"],["md/nodejs",`${Z1.versions.node}`]],W=mz();if(W)Q.push(W);if(j)Q.push([`api/${j}`,$]);if(Z1.env.AWS_EXECUTION_ENV)Q.push([`exec-env/${Z1.env.AWS_EXECUTION_ENV}`]);let Z=await z?.userAgentAppId?.();return Z?[...Q,[`app/${Z}`]]:[...Q]}},"createDefaultUserAgentProvider"),pz=X5,iz=Y4(),J5="AWS_SDK_UA_APP_ID",K5="sdk_ua_app_id",az="sdk-ua-app-id",nz={environmentVariableSelector:(j)=>j[J5],configFileSelector:(j)=>j[K5]??j[az],default:iz.DEFAULT_UA_APP_ID}});var K9=q((jW,V5)=>{var{defineProperty:h0,getOwnPropertyDescriptor:ez,getOwnPropertyNames:j9}=Object,$9=Object.prototype.hasOwnProperty,B5=(j,$)=>h0(j,"name",{value:$,configurable:!0}),z9=(j,$)=>{for(var z in $)h0(j,z,{get:$[z],enumerable:!0})},Q9=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of j9($))if(!$9.call(j,W)&&W!==z)h0(j,W,{get:()=>$[W],enumerable:!(Q=ez($,W))||Q.enumerable})}return j},W9=(j)=>Q9(h0({},"__esModule",{value:!0}),j),q5={};z9(q5,{Hash:()=>J9});V5.exports=W9(q5);var X1=oz(),Z9=tz(),X9=F("buffer"),Y5=F("crypto"),J9=class{static{B5(this,"Hash")}constructor(j,$){this.algorithmIdentifier=j,this.secret=$,this.reset()}update(j,$){this.hash.update(Z9.toUint8Array(J1(j,$)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?Y5.createHmac(this.algorithmIdentifier,J1(this.secret)):Y5.createHash(this.algorithmIdentifier)}};function J1(j,$){if(X9.Buffer.isBuffer(j))return j;if(typeof j==="string")return X1.fromString(j,$);if(ArrayBuffer.isView(j))return X1.fromArrayBuffer(j.buffer,j.byteOffset,j.byteLength);return X1.fromArrayBuffer(j)}B5(J1,"castSourceData")});var L9=q((zW,U5)=>{var{defineProperty:N0,getOwnPropertyDescriptor:G9,getOwnPropertyNames:Y9}=Object,B9=Object.prototype.hasOwnProperty,q9=(j,$)=>N0(j,"name",{value:$,configurable:!0}),V9=(j,$)=>{for(var z in $)N0(j,z,{get:$[z],enumerable:!0})},H9=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of Y9($))if(!B9.call(j,W)&&W!==z)N0(j,W,{get:()=>$[W],enumerable:!(Q=G9($,W))||Q.enumerable})}return j},w9=(j)=>H9(N0({},"__esModule",{value:!0}),j),w5={};V9(w5,{calculateBodyLength:()=>U9});U5.exports=w9(w5);var H5=F("fs"),U9=q9((j)=>{if(!j)return 0;if(typeof j==="string")return Buffer.byteLength(j);else if(typeof j.byteLength==="number")return j.byteLength;else if(typeof j.size==="number")return j.size;else if(typeof j.start==="number"&&typeof j.end==="number")return j.end+1-j.start;else if(typeof j.path==="string"||Buffer.isBuffer(j.path))return H5.lstatSync(j.path).size;else if(typeof j.fd==="number")return H5.fstatSync(j.fd).size;throw new Error(`Body Length computation failed for ${j}`)},"calculateBodyLength")});var S5=q((QW,R5)=>{var{defineProperty:T0,getOwnPropertyDescriptor:M9,getOwnPropertyNames:b9}=Object,F9=Object.prototype.hasOwnProperty,M=(j,$)=>T0(j,"name",{value:$,configurable:!0}),D9=(j,$)=>{for(var z in $)T0(j,z,{get:$[z],enumerable:!0})},h9=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of b9($))if(!F9.call(j,W)&&W!==z)T0(j,W,{get:()=>$[W],enumerable:!(Q=M9($,W))||Q.enumerable})}return j},N9=(j)=>h9(T0({},"__esModule",{value:!0}),j),F5={};D9(F5,{DEFAULT_MAX_RETRIES:()=>O5,DEFAULT_TIMEOUT:()=>N5,ENV_CMDS_AUTH_TOKEN:()=>Y1,ENV_CMDS_FULL_URI:()=>O0,ENV_CMDS_RELATIVE_URI:()=>C0,Endpoint:()=>C5,fromContainerMetadata:()=>I9,fromInstanceMetadata:()=>a9,getInstanceMetadataEndpoint:()=>I5,httpRequest:()=>d,providerConfigFromInit:()=>B1});R5.exports=N9(F5);var O9=F("url"),R=p0(),C9=F("buffer"),T9=F("http");function d(j){return new Promise(($,z)=>{let Q=T9.request({method:"GET",...j,hostname:j.hostname?.replace(/^\[(.+)\]$/,"$1")});Q.on("error",(W)=>{z(Object.assign(new R.ProviderError("Unable to connect to instance metadata service"),W)),Q.destroy()}),Q.on("timeout",()=>{z(new R.ProviderError("TimeoutError from instance metadata service")),Q.destroy()}),Q.on("response",(W)=>{let{statusCode:Z=400}=W;if(Z<200||300<=Z)z(Object.assign(new R.ProviderError("Error response received from instance metadata service"),{statusCode:Z})),Q.destroy();let X=[];W.on("data",(J)=>{X.push(J)}),W.on("end",()=>{$(C9.Buffer.concat(X)),Q.destroy()})}),Q.end()})}M(d,"httpRequest");var D5=M((j)=>Boolean(j)&&typeof j==="object"&&typeof j.AccessKeyId==="string"&&typeof j.SecretAccessKey==="string"&&typeof j.Token==="string"&&typeof j.Expiration==="string","isImdsCredentials"),h5=M((j)=>({accessKeyId:j.AccessKeyId,secretAccessKey:j.SecretAccessKey,sessionToken:j.Token,expiration:new Date(j.Expiration),...j.AccountId&&{accountId:j.AccountId}}),"fromImdsCredentials"),N5=1000,O5=0,B1=M(({maxRetries:j=O5,timeout:$=N5})=>({maxRetries:j,timeout:$}),"providerConfigFromInit"),G1=M((j,$)=>{let z=j();for(let Q=0;Q<$;Q++)z=z.catch(j);return z},"retry"),O0="AWS_CONTAINER_CREDENTIALS_FULL_URI",C0="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",Y1="AWS_CONTAINER_AUTHORIZATION_TOKEN",I9=M((j={})=>{let{timeout:$,maxRetries:z}=B1(j);return()=>G1(async()=>{let Q=await P9({logger:j.logger}),W=JSON.parse(await v9($,Q));if(!D5(W))throw new R.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:j.logger});return h5(W)},z)},"fromContainerMetadata"),v9=M(async(j,$)=>{if(process.env[Y1])$.headers={...$.headers,Authorization:process.env[Y1]};return(await d({...$,timeout:j})).toString()},"requestFromEcsImds"),R9="169.254.170.2",S9={localhost:!0,"127.0.0.1":!0},k9={"http:":!0,"https:":!0},P9=M(async({logger:j})=>{if(process.env[C0])return{hostname:R9,path:process.env[C0]};if(process.env[O0]){let $=O9.parse(process.env[O0]);if(!$.hostname||!($.hostname in S9))throw new R.CredentialsProviderError(`${$.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:j});if(!$.protocol||!($.protocol in k9))throw new R.CredentialsProviderError(`${$.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:j});return{...$,port:$.port?parseInt($.port,10):void 0}}throw new R.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${C0} or ${O0} environment variable is set`,{tryNextLink:!1,logger:j})},"getCmdsUri"),x9=class j extends R.CredentialsProviderError{constructor($,z=!0){super($,z);this.tryNextLink=z,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,j.prototype)}static{M(this,"InstanceMetadataV1FallbackError")}},q1=q0(),A9=n0(),C5=((j)=>{return j.IPv4="http://169.254.169.254",j.IPv6="http://[fd00:ec2::254]",j})(C5||{}),E9="AWS_EC2_METADATA_SERVICE_ENDPOINT",y9="ec2_metadata_service_endpoint",f9={environmentVariableSelector:(j)=>j[E9],configFileSelector:(j)=>j[y9],default:void 0},T5=((j)=>{return j.IPv4="IPv4",j.IPv6="IPv6",j})(T5||{}),g9="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",u9="ec2_metadata_service_endpoint_mode",c9={environmentVariableSelector:(j)=>j[g9],configFileSelector:(j)=>j[u9],default:"IPv4"},I5=M(async()=>A9.parseUrl(await d9()||await l9()),"getInstanceMetadataEndpoint"),d9=M(async()=>q1.loadConfig(f9)(),"getFromEndpointConfig"),l9=M(async()=>{let j=await q1.loadConfig(c9)();switch(j){case"IPv4":return"http://169.254.169.254";case"IPv6":return"http://[fd00:ec2::254]";default:throw new Error(`Unsupported endpoint mode: ${j}. Select from ${Object.values(T5)}`)}},"getFromEndpointModeConfig"),_9=300,s9=300,m9="https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html",L5=M((j,$)=>{let z=_9+Math.floor(Math.random()*s9),Q=new Date(Date.now()+z*1000);$.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(Q)}.
2
+ For more information, please visit: `+m9);let W=j.originalExpiration??j.expiration;return{...j,...W?{originalExpiration:W}:{},expiration:Q}},"getExtendedInstanceMetadataCredentials"),p9=M((j,$={})=>{let z=$?.logger||console,Q;return async()=>{let W;try{if(W=await j(),W.expiration&&W.expiration.getTime()<Date.now())W=L5(W,z)}catch(Z){if(Q)z.warn("Credential renew failed: ",Z),W=L5(Q,z);else throw Z}return Q=W,W}},"staticStabilityProvider"),v5="/latest/meta-data/iam/security-credentials/",i9="/latest/api/token",K1="AWS_EC2_METADATA_V1_DISABLED",M5="ec2_metadata_v1_disabled",b5="x-aws-ec2-metadata-token",a9=M((j={})=>p9(n9(j),{logger:j.logger}),"fromInstanceMetadata"),n9=M((j={})=>{let $=!1,{logger:z,profile:Q}=j,{timeout:W,maxRetries:Z}=B1(j),X=M(async(J,K)=>{if($||K.headers?.[b5]==null){let Y=!1,B=!1,b=await q1.loadConfig({environmentVariableSelector:(D)=>{let O=D[K1];if(B=!!O&&O!=="false",O===void 0)throw new R.CredentialsProviderError(`${K1} not set in env, checking config file next.`,{logger:j.logger});return B},configFileSelector:(D)=>{let O=D[M5];return Y=!!O&&O!=="false",Y},default:!1},{profile:Q})();if(j.ec2MetadataV1Disabled||b){let D=[];if(j.ec2MetadataV1Disabled)D.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(Y)D.push(`config file profile (${M5})`);if(B)D.push(`process environment variable (${K1})`);throw new x9(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${D.join(", ")}].`)}}let V=(await G1(async()=>{let Y;try{Y=await o9(K)}catch(B){if(B.statusCode===401)$=!1;throw B}return Y},J)).trim();return G1(async()=>{let Y;try{Y=await t9(V,K,j)}catch(B){if(B.statusCode===401)$=!1;throw B}return Y},J)},"getCredentials");return async()=>{let J=await I5();if($)return z?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),X(Z,{...J,timeout:W});else{let K;try{K=(await r9({...J,timeout:W})).toString()}catch(G){if(G?.statusCode===400)throw Object.assign(G,{message:"EC2 Metadata token request returned error"});else if(G.message==="TimeoutError"||[403,404,405].includes(G.statusCode))$=!0;return z?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),X(Z,{...J,timeout:W})}return X(Z,{...J,headers:{[b5]:K},timeout:W})}}},"getInstanceMetadataProvider"),r9=M(async(j)=>d({...j,path:i9,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),"getMetadataToken"),o9=M(async(j)=>(await d({...j,path:v5})).toString(),"getProfile"),t9=M(async(j,$,z)=>{let Q=JSON.parse((await d({...$,path:v5+j})).toString());if(!D5(Q))throw new R.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:z.logger});return h5(Q)},"getCredentialsFromProfile")});var bQ=q((WW,y5)=>{var{create:e9,defineProperty:a,getOwnPropertyDescriptor:jQ,getOwnPropertyNames:$Q,getPrototypeOf:zQ}=Object,QQ=Object.prototype.hasOwnProperty,V1=(j,$)=>a(j,"name",{value:$,configurable:!0}),WQ=(j,$)=>{for(var z in $)a(j,z,{get:$[z],enumerable:!0})},A5=(j,$,z,Q)=>{if($&&typeof $==="object"||typeof $==="function"){for(let W of $Q($))if(!QQ.call(j,W)&&W!==z)a(j,W,{get:()=>$[W],enumerable:!(Q=jQ($,W))||Q.enumerable})}return j},ZQ=(j,$,z)=>(z=j!=null?e9(zQ(j)):{},A5($||!j||!j.__esModule?a(z,"default",{value:j,enumerable:!0}):z,j)),XQ=(j)=>A5(a({},"__esModule",{value:!0}),j),E5={};WQ(E5,{resolveDefaultsModeConfig:()=>UQ});y5.exports=XQ(E5);var JQ=I4(),k5=q0(),KQ=p0(),GQ="AWS_EXECUTION_ENV",P5="AWS_REGION",x5="AWS_DEFAULT_REGION",YQ="AWS_EC2_METADATA_DISABLED",BQ=["in-region","cross-region","mobile","standard","legacy"],qQ="/latest/meta-data/placement/region",VQ="AWS_DEFAULTS_MODE",HQ="defaults_mode",wQ={environmentVariableSelector:(j)=>{return j[VQ]},configFileSelector:(j)=>{return j[HQ]},default:"legacy"},UQ=V1(({region:j=k5.loadConfig(JQ.NODE_REGION_CONFIG_OPTIONS),defaultsMode:$=k5.loadConfig(wQ)}={})=>KQ.memoize(async()=>{let z=typeof $==="function"?await $():$;switch(z?.toLowerCase()){case"auto":return LQ(j);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(z?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${BQ.join(", ")}, got ${z}`)}}),"resolveDefaultsModeConfig"),LQ=V1(async(j)=>{if(j){let $=typeof j==="function"?await j():j,z=await MQ();if(!z)return"standard";if($===z)return"in-region";else return"cross-region"}return"standard"},"resolveNodeDefaultsModeAuto"),MQ=V1(async()=>{if(process.env[GQ]&&(process.env[P5]||process.env[x5]))return process.env[P5]??process.env[x5];if(!process.env[YQ])try{let{getInstanceMetadataEndpoint:j,httpRequest:$}=await Promise.resolve().then(()=>ZQ(S5())),z=await j();return(await $({...z,path:qQ})).toString()}catch(j){}},"inferPhysicalRegion")});
3
+ export{a5 as Da,zj as Ea,Vj as Fa,u1 as Ga,r1 as Ha,Y4 as Ia,I4 as Ja,i8 as Ka,q0 as La,n0 as Ma,T$ as Na,k7 as Oa,Oz as Pa,gz as Qa,rz as Ra,K9 as Sa,L9 as Ta,bQ as Ua,yz as Va};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Eb as z,Fb as B}from"./chunk-e1kefb68.js";import"./chunk-8acb2bq0.js";import"./chunk-5eh2tfep.js";import{Kc as K,Lc as y}from"./chunk-z80nypa9.js";import"./chunk-2pj0cr49.js";import{parse as p}from"url";import{Buffer as M}from"buffer";import{request as k}from"http";function E(c){return new Promise((I,x)=>{let T=k({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});T.on("error",(N)=>{x(Object.assign(new K("Unable to connect to instance metadata service"),N)),T.destroy()}),T.on("timeout",()=>{x(new K("TimeoutError from instance metadata service")),T.destroy()}),T.on("response",(N)=>{let{statusCode:O=400}=N;if(O<200||300<=O)x(Object.assign(new K("Error response received from instance metadata service"),{statusCode:O})),T.destroy();let $=[];N.on("data",(w)=>{$.push(w)}),N.on("end",()=>{I(M.concat($)),T.destroy()})}),T.end()})}var _=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",D=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var hc=1000,Yc=0,G=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var m=(c,I)=>{let x=c();for(let T=0;T<I;T++)x=x.catch(c);return x};var X="AWS_CONTAINER_CREDENTIALS_FULL_URI",Z="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",b="AWS_CONTAINER_AUTHORIZATION_TOKEN",mc=(c={})=>{let{timeout:I,maxRetries:x}=G(c);return()=>m(async()=>{let T=await s({logger:c.logger}),N=JSON.parse(await C(I,T));if(!_(N))throw new y("Invalid response received from instance metadata service.",{logger:c.logger});return D(N)},x)},C=async(c,I)=>{if(process.env[b])I.headers={...I.headers,Authorization:process.env[b]};return(await E({...I,timeout:c})).toString()},a="169.254.170.2",n={localhost:!0,"127.0.0.1":!0},o={"http:":!0,"https:":!0},s=async({logger:c})=>{if(process.env[Z])return{hostname:a,path:process.env[Z]};if(process.env[X]){let I=p(process.env[X]);if(!I.hostname||!(I.hostname in n))throw new y(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in o))throw new y(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{...I,port:I.port?parseInt(I.port,10):void 0}}throw new y(`The container metadata credential provider cannot be used unless the ${Z} or ${X} environment variable is set`,{tryNextLink:!1,logger:c})};class Q extends y{constructor(c,I=!0){super(c,I);this.tryNextLink=I,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,Q.prototype)}}var J;(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(J||(J={}));var H={environmentVariableSelector:(c)=>c.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(c)=>c.ec2_metadata_service_endpoint,default:void 0};var u;(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(u||(u={}));var g="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",l="ec2_metadata_service_endpoint_mode",q={environmentVariableSelector:(c)=>c[g],configFileSelector:(c)=>c[l],default:u.IPv4};var v=async()=>B(await r()||await d()),r=async()=>z(H)(),d=async()=>{let c=await z(q)();switch(c){case u.IPv4:return J.IPv4;case u.IPv6:return J.IPv6;default:throw new Error(`Unsupported endpoint mode: ${c}. Select from ${Object.values(u)}`)}};var L=(c,I)=>{let x=300+Math.floor(Math.random()*300),T=new Date(Date.now()+x*1000);I.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(T)}.
3
+ For more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);let N=c.originalExpiration??c.expiration;return{...c,...N?{originalExpiration:N}:{},expiration:T}};var U=(c,I={})=>{let x=I?.logger||console,T;return async()=>{let N;try{if(N=await c(),N.expiration&&N.expiration.getTime()<Date.now())N=L(N,x)}catch(O){if(T)x.warn("Credential renew failed: ",O),N=L(T,x);else throw O}return T=N,N}};var P="/latest/meta-data/iam/security-credentials/",e="/latest/api/token",W="AWS_EC2_METADATA_V1_DISABLED",t="ec2_metadata_v1_disabled",F="x-aws-ec2-metadata-token",oc=(c={})=>U(i(c),{logger:c.logger}),i=(c={})=>{let I=!1,{logger:x,profile:T}=c,{timeout:N,maxRetries:O}=G(c),$=async(w,j)=>{if(I||j.headers?.[F]==null){let h=!1,Y=!1,R=await z({environmentVariableSelector:(S)=>{let A=S[W];if(Y=!!A&&A!=="false",A===void 0)throw new y(`${W} not set in env, checking config file next.`,{logger:c.logger});return Y},configFileSelector:(S)=>{let A=S[t];return h=!!A&&A!=="false",h},default:!1},{profile:T})();if(c.ec2MetadataV1Disabled||R){let S=[];if(c.ec2MetadataV1Disabled)S.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(h)S.push(`config file profile (${t})`);if(Y)S.push(`process environment variable (${W})`);throw new Q(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${S.join(", ")}].`)}}let V=(await m(async()=>{let h;try{h=await Ic(j)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)).trim();return m(async()=>{let h;try{h=await Tc(V,j,c)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)};return async()=>{let w=await v();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),$(O,{...w,timeout:N});else{let j;try{j=(await cc({...w,timeout:N})).toString()}catch(f){if(f?.statusCode===400)throw Object.assign(f,{message:"EC2 Metadata token request returned error"});else if(f.message==="TimeoutError"||[403,404,405].includes(f.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),$(O,{...w,timeout:N})}return $(O,{...w,headers:{[F]:j},timeout:N})}}},cc=async(c)=>E({...c,path:e,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),Ic=async(c)=>(await E({...c,path:P})).toString(),Tc=async(c,I,x)=>{let T=JSON.parse((await E({...I,path:P+c})).toString());if(!_(T))throw new y("Invalid response received from instance metadata service.",{logger:x.logger});return D(T)};export{G as providerConfigFromInit,E as httpRequest,v as getInstanceMetadataEndpoint,oc as fromInstanceMetadata,mc as fromContainerMetadata,J as Endpoint,Z as ENV_CMDS_RELATIVE_URI,X as ENV_CMDS_FULL_URI,b as ENV_CMDS_AUTH_TOKEN,hc as DEFAULT_TIMEOUT,Yc as DEFAULT_MAX_RETRIES};
@@ -1,4 +1,4 @@
1
- import{Hc as l6}from"./chunk-0fgzbrz9.js";import{Pc as U,Sc as N}from"./chunk-tkegy5p0.js";var u=U((Ew,M0)=>{var{defineProperty:l,getOwnPropertyDescriptor:u6,getOwnPropertyNames:d6}=Object,i6=Object.prototype.hasOwnProperty,y=($,w)=>l($,"name",{value:w,configurable:!0}),p6=($,w)=>{for(var z in w)l($,z,{get:w[z],enumerable:!0})},_6=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of d6(w))if(!i6.call($,Z)&&Z!==z)l($,Z,{get:()=>w[Z],enumerable:!(L=u6(w,Z))||L.enumerable})}return $},a6=($)=>_6(l({},"__esModule",{value:!0}),$),A0={};p6(A0,{Field:()=>s6,Fields:()=>r6,HttpRequest:()=>t6,HttpResponse:()=>o6,IHttpRequest:()=>R0.HttpRequest,getHttpHandlerExtensionConfiguration:()=>n6,isValidHostname:()=>I0,resolveHttpHandlerRuntimeConfig:()=>m6});M0.exports=a6(A0);var n6=y(($)=>{let w=$.httpHandler;return{setHttpHandler(z){w=z},httpHandler(){return w},updateHttpClientConfig(z,L){w.updateHttpClientConfig(z,L)},httpHandlerConfigs(){return w.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),m6=y(($)=>{return{httpHandler:$.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),R0=l6(),s6=class{static{y(this,"Field")}constructor({name:$,kind:w=R0.FieldPosition.HEADER,values:z=[]}){this.name=$,this.kind=w,this.values=z}add($){this.values.push($)}set($){this.values=$}remove($){this.values=this.values.filter((w)=>w!==$)}toString(){return this.values.map(($)=>$.includes(",")||$.includes(" ")?`"${$}"`:$).join(", ")}get(){return this.values}},r6=class{constructor({fields:$=[],encoding:w="utf-8"}){this.entries={},$.forEach(this.setField.bind(this)),this.encoding=w}static{y(this,"Fields")}setField($){this.entries[$.name.toLowerCase()]=$}getField($){return this.entries[$.toLowerCase()]}removeField($){delete this.entries[$.toLowerCase()]}getByType($){return Object.values(this.entries).filter((w)=>w.kind===$)}},t6=class ${static{y(this,"HttpRequest")}constructor(w){this.method=w.method||"GET",this.hostname=w.hostname||"localhost",this.port=w.port,this.query=w.query||{},this.headers=w.headers||{},this.body=w.body,this.protocol=w.protocol?w.protocol.slice(-1)!==":"?`${w.protocol}:`:w.protocol:"https:",this.path=w.path?w.path.charAt(0)!=="/"?`/${w.path}`:w.path:"/",this.username=w.username,this.password=w.password,this.fragment=w.fragment}static clone(w){let z=new $({...w,headers:{...w.headers}});if(z.query)z.query=N0(z.query);return z}static isInstance(w){if(!w)return!1;let z=w;return"method"in z&&"protocol"in z&&"hostname"in z&&"path"in z&&typeof z.query==="object"&&typeof z.headers==="object"}clone(){return $.clone(this)}};function N0($){return Object.keys($).reduce((w,z)=>{let L=$[z];return{...w,[z]:Array.isArray(L)?[...L]:L}},{})}y(N0,"cloneQuery");var o6=class{static{y(this,"HttpResponse")}constructor($){this.statusCode=$.statusCode,this.reason=$.reason,this.headers=$.headers||{},this.body=$.body}static isInstance($){if(!$)return!1;let w=$;return typeof w.statusCode==="number"&&typeof w.headers==="object"}};function I0($){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test($)}y(I0,"isValidHostname")});var x0=U((gw,S0)=>{var{defineProperty:d,getOwnPropertyDescriptor:e6,getOwnPropertyNames:$4}=Object,w4=Object.prototype.hasOwnProperty,w0=($,w)=>d($,"name",{value:w,configurable:!0}),z4=($,w)=>{for(var z in w)d($,z,{get:w[z],enumerable:!0})},Z4=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of $4(w))if(!w4.call($,Z)&&Z!==z)d($,Z,{get:()=>w[Z],enumerable:!(L=e6(w,Z))||L.enumerable})}return $},L4=($)=>Z4(d({},"__esModule",{value:!0}),$),O0={};z4(O0,{escapeUri:()=>b0,escapeUriPath:()=>K4});S0.exports=L4(O0);var b0=w0(($)=>encodeURIComponent($).replace(/[!'()*]/g,Y4),"escapeUri"),Y4=w0(($)=>`%${$.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),K4=w0(($)=>$.split("/").map(b0).join("/"),"escapeUriPath")});var Z0=U((lw,k0)=>{var{defineProperty:i,getOwnPropertyDescriptor:Q4,getOwnPropertyNames:X4}=Object,G4=Object.prototype.hasOwnProperty,B4=($,w)=>i($,"name",{value:w,configurable:!0}),F4=($,w)=>{for(var z in w)i($,z,{get:w[z],enumerable:!0})},U4=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of X4(w))if(!G4.call($,Z)&&Z!==z)i($,Z,{get:()=>w[Z],enumerable:!(L=Q4(w,Z))||L.enumerable})}return $},V4=($)=>U4(i({},"__esModule",{value:!0}),$),T0={};F4(T0,{buildQueryString:()=>y0});k0.exports=V4(T0);var z0=x0();function y0($){let w=[];for(let z of Object.keys($).sort()){let L=$[z];if(z=z0.escapeUri(z),Array.isArray(L))for(let Z=0,Q=L.length;Z<Q;Z++)w.push(`${z}=${z0.escapeUri(L[Z])}`);else{let Z=z;if(L||typeof L==="string")Z+=`=${z0.escapeUri(L)}`;w.push(Z)}}return w.join("&")}B4(y0,"buildQueryString")});var m0=U((uw,n0)=>{var{create:h4,defineProperty:q,getOwnPropertyDescriptor:W4,getOwnPropertyNames:J4,getPrototypeOf:j4}=Object,D4=Object.prototype.hasOwnProperty,V=($,w)=>q($,"name",{value:w,configurable:!0}),v4=($,w)=>{for(var z in w)q($,z,{get:w[z],enumerable:!0})},q0=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of J4(w))if(!D4.call($,Z)&&Z!==z)q($,Z,{get:()=>w[Z],enumerable:!(L=W4(w,Z))||L.enumerable})}return $},C4=($,w,z)=>(z=$!=null?h4(j4($)):{},q0(w||!$||!$.__esModule?q(z,"default",{value:$,enumerable:!0}):z,$)),H4=($)=>q0(q({},"__esModule",{value:!0}),$),g0={};v4(g0,{DEFAULT_REQUEST_TIMEOUT:()=>_0,NodeHttp2Handler:()=>T4,NodeHttpHandler:()=>O4,streamCollector:()=>k4});n0.exports=H4(g0);var l0=u(),u0=Z0(),L0=N("http"),Y0=N("https"),A4=["ECONNRESET","EPIPE","ETIMEDOUT"],d0=V(($)=>{let w={};for(let z of Object.keys($)){let L=$[z];w[z]=Array.isArray(L)?L.join(","):L}return w},"getTransformedHeaders"),H={setTimeout:($,w)=>setTimeout($,w),clearTimeout:($)=>clearTimeout($)},f0=1000,R4=V(($,w,z=0)=>{if(!z)return-1;let L=V((Z)=>{let Q=H.setTimeout(()=>{$.destroy(),w(Object.assign(new Error(`Socket timed out without establishing a connection within ${z} ms`),{name:"TimeoutError"}))},z-Z),Y=V((K)=>{if(K?.connecting)K.on("connect",()=>{H.clearTimeout(Q)});else H.clearTimeout(Q)},"doWithSocket");if($.socket)Y($.socket);else $.on("socket",Y)},"registerTimeout");if(z<2000)return L(0),0;return H.setTimeout(L.bind(null,f0),f0)},"setConnectionTimeout"),N4=3000,I4=V(($,{keepAlive:w,keepAliveMsecs:z},L=N4)=>{if(w!==!0)return-1;let Z=V(()=>{if($.socket)$.socket.setKeepAlive(w,z||0);else $.on("socket",(Q)=>{Q.setKeepAlive(w,z||0)})},"registerListener");if(L===0)return Z(),0;return H.setTimeout(Z,L)},"setSocketKeepAlive"),E0=3000,M4=V(($,w,z=_0)=>{let L=V((Z)=>{let Q=z-Z,Y=V(()=>{$.destroy(),w(Object.assign(new Error(`Connection timed out after ${z} ms`),{name:"TimeoutError"}))},"onTimeout");if($.socket)$.socket.setTimeout(Q,Y),$.on("close",()=>$.socket?.removeListener("timeout",Y));else $.setTimeout(Q,Y)},"registerTimeout");if(0<z&&z<6000)return L(0),0;return H.setTimeout(L.bind(null,z===0?0:E0),E0)},"setSocketTimeout"),i0=N("stream"),P0=6000;async function K0($,w,z=P0){let L=w.headers??{},Z=L.Expect||L.expect,Q=-1,Y=!0;if(Z==="100-continue")Y=await Promise.race([new Promise((K)=>{Q=Number(H.setTimeout(()=>K(!0),Math.max(P0,z)))}),new Promise((K)=>{$.on("continue",()=>{H.clearTimeout(Q),K(!0)}),$.on("response",()=>{H.clearTimeout(Q),K(!1)}),$.on("error",()=>{H.clearTimeout(Q),K(!1)})})]);if(Y)p0($,w.body)}V(K0,"writeRequestBody");function p0($,w){if(w instanceof i0.Readable){w.pipe($);return}if(w){if(Buffer.isBuffer(w)||typeof w==="string"){$.end(w);return}let z=w;if(typeof z==="object"&&z.buffer&&typeof z.byteOffset==="number"&&typeof z.byteLength==="number"){$.end(Buffer.from(z.buffer,z.byteOffset,z.byteLength));return}$.end(Buffer.from(w));return}$.end()}V(p0,"writeBody");var _0=0,O4=class ${constructor(w){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((z,L)=>{if(typeof w==="function")w().then((Z)=>{z(this.resolveDefaultConfig(Z))}).catch(L);else z(this.resolveDefaultConfig(w))})}static{V(this,"NodeHttpHandler")}static create(w){if(typeof w?.handle==="function")return w;return new $(w)}static checkSocketUsage(w,z,L=console){let{sockets:Z,requests:Q,maxSockets:Y}=w;if(typeof Y!=="number"||Y===1/0)return z;let K=15000;if(Date.now()-K<z)return z;if(Z&&Q)for(let X in Z){let G=Z[X]?.length??0,F=Q[X]?.length??0;if(G>=Y&&F>=2*Y)return L?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${G} and ${F} additional requests are enqueued.
1
+ import{Gc as l6}from"./chunk-5eh2tfep.js";import{Tc as U,Wc as N}from"./chunk-2pj0cr49.js";var u=U((Ew,M0)=>{var{defineProperty:l,getOwnPropertyDescriptor:u6,getOwnPropertyNames:d6}=Object,i6=Object.prototype.hasOwnProperty,y=($,w)=>l($,"name",{value:w,configurable:!0}),p6=($,w)=>{for(var z in w)l($,z,{get:w[z],enumerable:!0})},_6=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of d6(w))if(!i6.call($,Z)&&Z!==z)l($,Z,{get:()=>w[Z],enumerable:!(L=u6(w,Z))||L.enumerable})}return $},a6=($)=>_6(l({},"__esModule",{value:!0}),$),A0={};p6(A0,{Field:()=>s6,Fields:()=>r6,HttpRequest:()=>t6,HttpResponse:()=>o6,IHttpRequest:()=>R0.HttpRequest,getHttpHandlerExtensionConfiguration:()=>n6,isValidHostname:()=>I0,resolveHttpHandlerRuntimeConfig:()=>m6});M0.exports=a6(A0);var n6=y(($)=>{let w=$.httpHandler;return{setHttpHandler(z){w=z},httpHandler(){return w},updateHttpClientConfig(z,L){w.updateHttpClientConfig(z,L)},httpHandlerConfigs(){return w.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),m6=y(($)=>{return{httpHandler:$.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),R0=l6(),s6=class{static{y(this,"Field")}constructor({name:$,kind:w=R0.FieldPosition.HEADER,values:z=[]}){this.name=$,this.kind=w,this.values=z}add($){this.values.push($)}set($){this.values=$}remove($){this.values=this.values.filter((w)=>w!==$)}toString(){return this.values.map(($)=>$.includes(",")||$.includes(" ")?`"${$}"`:$).join(", ")}get(){return this.values}},r6=class{constructor({fields:$=[],encoding:w="utf-8"}){this.entries={},$.forEach(this.setField.bind(this)),this.encoding=w}static{y(this,"Fields")}setField($){this.entries[$.name.toLowerCase()]=$}getField($){return this.entries[$.toLowerCase()]}removeField($){delete this.entries[$.toLowerCase()]}getByType($){return Object.values(this.entries).filter((w)=>w.kind===$)}},t6=class ${static{y(this,"HttpRequest")}constructor(w){this.method=w.method||"GET",this.hostname=w.hostname||"localhost",this.port=w.port,this.query=w.query||{},this.headers=w.headers||{},this.body=w.body,this.protocol=w.protocol?w.protocol.slice(-1)!==":"?`${w.protocol}:`:w.protocol:"https:",this.path=w.path?w.path.charAt(0)!=="/"?`/${w.path}`:w.path:"/",this.username=w.username,this.password=w.password,this.fragment=w.fragment}static clone(w){let z=new $({...w,headers:{...w.headers}});if(z.query)z.query=N0(z.query);return z}static isInstance(w){if(!w)return!1;let z=w;return"method"in z&&"protocol"in z&&"hostname"in z&&"path"in z&&typeof z.query==="object"&&typeof z.headers==="object"}clone(){return $.clone(this)}};function N0($){return Object.keys($).reduce((w,z)=>{let L=$[z];return{...w,[z]:Array.isArray(L)?[...L]:L}},{})}y(N0,"cloneQuery");var o6=class{static{y(this,"HttpResponse")}constructor($){this.statusCode=$.statusCode,this.reason=$.reason,this.headers=$.headers||{},this.body=$.body}static isInstance($){if(!$)return!1;let w=$;return typeof w.statusCode==="number"&&typeof w.headers==="object"}};function I0($){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test($)}y(I0,"isValidHostname")});var x0=U((gw,S0)=>{var{defineProperty:d,getOwnPropertyDescriptor:e6,getOwnPropertyNames:$4}=Object,w4=Object.prototype.hasOwnProperty,w0=($,w)=>d($,"name",{value:w,configurable:!0}),z4=($,w)=>{for(var z in w)d($,z,{get:w[z],enumerable:!0})},Z4=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of $4(w))if(!w4.call($,Z)&&Z!==z)d($,Z,{get:()=>w[Z],enumerable:!(L=e6(w,Z))||L.enumerable})}return $},L4=($)=>Z4(d({},"__esModule",{value:!0}),$),O0={};z4(O0,{escapeUri:()=>b0,escapeUriPath:()=>K4});S0.exports=L4(O0);var b0=w0(($)=>encodeURIComponent($).replace(/[!'()*]/g,Y4),"escapeUri"),Y4=w0(($)=>`%${$.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),K4=w0(($)=>$.split("/").map(b0).join("/"),"escapeUriPath")});var Z0=U((lw,k0)=>{var{defineProperty:i,getOwnPropertyDescriptor:Q4,getOwnPropertyNames:X4}=Object,G4=Object.prototype.hasOwnProperty,B4=($,w)=>i($,"name",{value:w,configurable:!0}),F4=($,w)=>{for(var z in w)i($,z,{get:w[z],enumerable:!0})},U4=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of X4(w))if(!G4.call($,Z)&&Z!==z)i($,Z,{get:()=>w[Z],enumerable:!(L=Q4(w,Z))||L.enumerable})}return $},V4=($)=>U4(i({},"__esModule",{value:!0}),$),T0={};F4(T0,{buildQueryString:()=>y0});k0.exports=V4(T0);var z0=x0();function y0($){let w=[];for(let z of Object.keys($).sort()){let L=$[z];if(z=z0.escapeUri(z),Array.isArray(L))for(let Z=0,Q=L.length;Z<Q;Z++)w.push(`${z}=${z0.escapeUri(L[Z])}`);else{let Z=z;if(L||typeof L==="string")Z+=`=${z0.escapeUri(L)}`;w.push(Z)}}return w.join("&")}B4(y0,"buildQueryString")});var m0=U((uw,n0)=>{var{create:h4,defineProperty:q,getOwnPropertyDescriptor:W4,getOwnPropertyNames:J4,getPrototypeOf:j4}=Object,D4=Object.prototype.hasOwnProperty,V=($,w)=>q($,"name",{value:w,configurable:!0}),v4=($,w)=>{for(var z in w)q($,z,{get:w[z],enumerable:!0})},q0=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of J4(w))if(!D4.call($,Z)&&Z!==z)q($,Z,{get:()=>w[Z],enumerable:!(L=W4(w,Z))||L.enumerable})}return $},C4=($,w,z)=>(z=$!=null?h4(j4($)):{},q0(w||!$||!$.__esModule?q(z,"default",{value:$,enumerable:!0}):z,$)),H4=($)=>q0(q({},"__esModule",{value:!0}),$),g0={};v4(g0,{DEFAULT_REQUEST_TIMEOUT:()=>_0,NodeHttp2Handler:()=>T4,NodeHttpHandler:()=>O4,streamCollector:()=>k4});n0.exports=H4(g0);var l0=u(),u0=Z0(),L0=N("http"),Y0=N("https"),A4=["ECONNRESET","EPIPE","ETIMEDOUT"],d0=V(($)=>{let w={};for(let z of Object.keys($)){let L=$[z];w[z]=Array.isArray(L)?L.join(","):L}return w},"getTransformedHeaders"),H={setTimeout:($,w)=>setTimeout($,w),clearTimeout:($)=>clearTimeout($)},f0=1000,R4=V(($,w,z=0)=>{if(!z)return-1;let L=V((Z)=>{let Q=H.setTimeout(()=>{$.destroy(),w(Object.assign(new Error(`Socket timed out without establishing a connection within ${z} ms`),{name:"TimeoutError"}))},z-Z),Y=V((K)=>{if(K?.connecting)K.on("connect",()=>{H.clearTimeout(Q)});else H.clearTimeout(Q)},"doWithSocket");if($.socket)Y($.socket);else $.on("socket",Y)},"registerTimeout");if(z<2000)return L(0),0;return H.setTimeout(L.bind(null,f0),f0)},"setConnectionTimeout"),N4=3000,I4=V(($,{keepAlive:w,keepAliveMsecs:z},L=N4)=>{if(w!==!0)return-1;let Z=V(()=>{if($.socket)$.socket.setKeepAlive(w,z||0);else $.on("socket",(Q)=>{Q.setKeepAlive(w,z||0)})},"registerListener");if(L===0)return Z(),0;return H.setTimeout(Z,L)},"setSocketKeepAlive"),E0=3000,M4=V(($,w,z=_0)=>{let L=V((Z)=>{let Q=z-Z,Y=V(()=>{$.destroy(),w(Object.assign(new Error(`Connection timed out after ${z} ms`),{name:"TimeoutError"}))},"onTimeout");if($.socket)$.socket.setTimeout(Q,Y),$.on("close",()=>$.socket?.removeListener("timeout",Y));else $.setTimeout(Q,Y)},"registerTimeout");if(0<z&&z<6000)return L(0),0;return H.setTimeout(L.bind(null,z===0?0:E0),E0)},"setSocketTimeout"),i0=N("stream"),P0=6000;async function K0($,w,z=P0){let L=w.headers??{},Z=L.Expect||L.expect,Q=-1,Y=!0;if(Z==="100-continue")Y=await Promise.race([new Promise((K)=>{Q=Number(H.setTimeout(()=>K(!0),Math.max(P0,z)))}),new Promise((K)=>{$.on("continue",()=>{H.clearTimeout(Q),K(!0)}),$.on("response",()=>{H.clearTimeout(Q),K(!1)}),$.on("error",()=>{H.clearTimeout(Q),K(!1)})})]);if(Y)p0($,w.body)}V(K0,"writeRequestBody");function p0($,w){if(w instanceof i0.Readable){w.pipe($);return}if(w){if(Buffer.isBuffer(w)||typeof w==="string"){$.end(w);return}let z=w;if(typeof z==="object"&&z.buffer&&typeof z.byteOffset==="number"&&typeof z.byteLength==="number"){$.end(Buffer.from(z.buffer,z.byteOffset,z.byteLength));return}$.end(Buffer.from(w));return}$.end()}V(p0,"writeBody");var _0=0,O4=class ${constructor(w){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((z,L)=>{if(typeof w==="function")w().then((Z)=>{z(this.resolveDefaultConfig(Z))}).catch(L);else z(this.resolveDefaultConfig(w))})}static{V(this,"NodeHttpHandler")}static create(w){if(typeof w?.handle==="function")return w;return new $(w)}static checkSocketUsage(w,z,L=console){let{sockets:Z,requests:Q,maxSockets:Y}=w;if(typeof Y!=="number"||Y===1/0)return z;let K=15000;if(Date.now()-K<z)return z;if(Z&&Q)for(let X in Z){let G=Z[X]?.length??0,F=Q[X]?.length??0;if(G>=Y&&F>=2*Y)return L?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${G} and ${F} additional requests are enqueued.
2
2
  See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
3
3
  or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return z}resolveDefaultConfig(w){let{requestTimeout:z,connectionTimeout:L,socketTimeout:Z,socketAcquisitionWarningTimeout:Q,httpAgent:Y,httpsAgent:K}=w||{},X=!0,G=50;return{connectionTimeout:L,requestTimeout:z??Z,socketAcquisitionWarningTimeout:Q,httpAgent:(()=>{if(Y instanceof L0.Agent||typeof Y?.destroy==="function")return Y;return new L0.Agent({keepAlive:!0,maxSockets:50,...Y})})(),httpsAgent:(()=>{if(K instanceof Y0.Agent||typeof K?.destroy==="function")return K;return new Y0.Agent({keepAlive:!0,maxSockets:50,...K})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(w,{abortSignal:z}={}){if(!this.config)this.config=await this.configProvider;return new Promise((L,Z)=>{let Q=void 0,Y=[],K=V(async(B)=>{await Q,Y.forEach(H.clearTimeout),L(B)},"resolve"),X=V(async(B)=>{await Q,Y.forEach(H.clearTimeout),Z(B)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(z?.aborted){let B=new Error("Request aborted");B.name="AbortError",X(B);return}let G=w.protocol==="https:",F=G?this.config.httpsAgent:this.config.httpAgent;Y.push(H.setTimeout(()=>{this.socketWarningTimestamp=$.checkSocketUsage(F,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let v=u0.buildQueryString(w.query||{}),D=void 0;if(w.username!=null||w.password!=null){let B=w.username??"",W=w.password??"";D=`${B}:${W}`}let j=w.path;if(v)j+=`?${v}`;if(w.fragment)j+=`#${w.fragment}`;let C=w.hostname??"";if(C[0]==="["&&C.endsWith("]"))C=w.hostname.slice(1,-1);else C=w.hostname;let x={headers:w.headers,host:C,method:w.method,path:j,port:w.port,agent:F,auth:D},h=(G?Y0.request:L0.request)(x,(B)=>{let W=new l0.HttpResponse({statusCode:B.statusCode||-1,reason:B.statusMessage,headers:d0(B.headers),body:B});K({response:W})});if(h.on("error",(B)=>{if(A4.includes(B.code))X(Object.assign(B,{name:"TimeoutError"}));else X(B)}),z){let B=V(()=>{h.destroy();let W=new Error("Request aborted");W.name="AbortError",X(W)},"onAbort");if(typeof z.addEventListener==="function"){let W=z;W.addEventListener("abort",B,{once:!0}),h.once("close",()=>W.removeEventListener("abort",B))}else z.onabort=B}Y.push(R4(h,X,this.config.connectionTimeout)),Y.push(M4(h,X,this.config.requestTimeout));let A=x.agent;if(typeof A==="object"&&"keepAlive"in A)Y.push(I4(h,{keepAlive:A.keepAlive,keepAliveMsecs:A.keepAliveMsecs}));Q=K0(h,w,this.config.requestTimeout).catch((B)=>{return Y.forEach(H.clearTimeout),Z(B)})})}updateHttpClientConfig(w,z){this.config=void 0,this.configProvider=this.configProvider.then((L)=>{return{...L,[w]:z}})}httpHandlerConfigs(){return this.config??{}}},c0=N("http2"),b4=C4(N("http2")),S4=class{constructor($){this.sessions=[],this.sessions=$??[]}static{V(this,"NodeHttp2ConnectionPool")}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast($){this.sessions.push($)}contains($){return this.sessions.includes($)}remove($){this.sessions=this.sessions.filter((w)=>w!==$)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy($){for(let w of this.sessions)if(w===$){if(!w.destroyed)w.destroy()}}},x4=class{constructor($){if(this.sessionCache=new Map,this.config=$,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}static{V(this,"NodeHttp2ConnectionManager")}lease($,w){let z=this.getUrlString($),L=this.sessionCache.get(z);if(L){let K=L.poll();if(K&&!this.config.disableConcurrency)return K}let Z=b4.default.connect(z);if(this.config.maxConcurrency)Z.settings({maxConcurrentStreams:this.config.maxConcurrency},(K)=>{if(K)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+$.destination.toString())});Z.unref();let Q=V(()=>{Z.destroy(),this.deleteSession(z,Z)},"destroySessionCb");if(Z.on("goaway",Q),Z.on("error",Q),Z.on("frameError",Q),Z.on("close",()=>this.deleteSession(z,Z)),w.requestTimeout)Z.setTimeout(w.requestTimeout,Q);let Y=this.sessionCache.get(z)||new S4;return Y.offerLast(Z),this.sessionCache.set(z,Y),Z}deleteSession($,w){let z=this.sessionCache.get($);if(!z)return;if(!z.contains(w))return;z.remove(w),this.sessionCache.set($,z)}release($,w){let z=this.getUrlString($);this.sessionCache.get(z)?.offerLast(w)}destroy(){for(let[$,w]of this.sessionCache){for(let z of w){if(!z.destroyed)z.destroy();w.remove(z)}this.sessionCache.delete($)}}setMaxConcurrentStreams($){if($&&$<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=$}setDisableConcurrentStreams($){this.config.disableConcurrency=$}getUrlString($){return $.destination.toString()}},T4=class ${constructor(w){this.metadata={handlerProtocol:"h2"},this.connectionManager=new x4({}),this.configProvider=new Promise((z,L)=>{if(typeof w==="function")w().then((Z)=>{z(Z||{})}).catch(L);else z(w||{})})}static{V(this,"NodeHttp2Handler")}static create(w){if(typeof w?.handle==="function")return w;return new $(w)}destroy(){this.connectionManager.destroy()}async handle(w,{abortSignal:z}={}){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)}let{requestTimeout:L,disableConcurrentStreams:Z}=this.config;return new Promise((Q,Y)=>{let K=!1,X=void 0,G=V(async(J)=>{await X,Q(J)},"resolve"),F=V(async(J)=>{await X,Y(J)},"reject");if(z?.aborted){K=!0;let J=new Error("Request aborted");J.name="AbortError",F(J);return}let{hostname:v,method:D,port:j,protocol:C,query:x}=w,T="";if(w.username!=null||w.password!=null){let J=w.username??"",I=w.password??"";T=`${J}:${I}@`}let h=`${C}//${T}${v}${j?`:${j}`:""}`,A={destination:new URL(h)},B=this.connectionManager.lease(A,{requestTimeout:this.config?.sessionTimeout,disableConcurrentStreams:Z||!1}),W=V((J)=>{if(Z)this.destroySession(B);K=!0,F(J)},"rejectWithDestroy"),E=u0.buildQueryString(x||{}),$0=w.path;if(E)$0+=`?${E}`;if(w.fragment)$0+=`#${w.fragment}`;let R=B.request({...w.headers,[c0.constants.HTTP2_HEADER_PATH]:$0,[c0.constants.HTTP2_HEADER_METHOD]:D});if(B.ref(),R.on("response",(J)=>{let I=new l0.HttpResponse({statusCode:J[":status"]||-1,headers:d0(J),body:R});if(K=!0,G({response:I}),Z)B.close(),this.connectionManager.deleteSession(h,B)}),L)R.setTimeout(L,()=>{R.close();let J=new Error(`Stream timed out because of no activity for ${L} ms`);J.name="TimeoutError",W(J)});if(z){let J=V(()=>{R.close();let I=new Error("Request aborted");I.name="AbortError",W(I)},"onAbort");if(typeof z.addEventListener==="function"){let I=z;I.addEventListener("abort",J,{once:!0}),R.once("close",()=>I.removeEventListener("abort",J))}else z.onabort=J}R.on("frameError",(J,I,g6)=>{W(new Error(`Frame type id ${J} in stream id ${g6} has failed with code ${I}.`))}),R.on("error",W),R.on("aborted",()=>{W(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${R.rstCode}.`))}),R.on("close",()=>{if(B.unref(),Z)B.destroy();if(!K)W(new Error("Unexpected error: http2 request did not get a response"))}),X=K0(R,w,L)})}updateHttpClientConfig(w,z){this.config=void 0,this.configProvider=this.configProvider.then((L)=>{return{...L,[w]:z}})}httpHandlerConfigs(){return this.config??{}}destroySession(w){if(!w.destroyed)w.destroy()}},y4=class extends i0.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}static{V(this,"Collector")}_write($,w,z){this.bufferedBytes.push($),z()}},k4=V(($)=>{if(f4($))return a0($);return new Promise((w,z)=>{let L=new y4;$.pipe(L),$.on("error",(Z)=>{L.end(),z(Z)}),L.on("error",z),L.on("finish",function(){let Z=new Uint8Array(Buffer.concat(this.bufferedBytes));w(Z)})})},"streamCollector"),f4=V(($)=>typeof ReadableStream==="function"&&$ instanceof ReadableStream,"isReadableStreamInstance");async function a0($){let w=[],z=$.getReader(),L=!1,Z=0;while(!L){let{done:K,value:X}=await z.read();if(X)w.push(X),Z+=X.length;L=K}let Q=new Uint8Array(Z),Y=0;for(let K of w)Q.set(K,Y),Y+=K.length;return Q}V(a0,"collectReadableStream")});var t0=U((_w,r0)=>{var{defineProperty:p,getOwnPropertyDescriptor:E4,getOwnPropertyNames:P4}=Object,c4=Object.prototype.hasOwnProperty,q4=($,w)=>p($,"name",{value:w,configurable:!0}),g4=($,w)=>{for(var z in w)p($,z,{get:w[z],enumerable:!0})},l4=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of P4(w))if(!c4.call($,Z)&&Z!==z)p($,Z,{get:()=>w[Z],enumerable:!(L=E4(w,Z))||L.enumerable})}return $},u4=($)=>l4(p({},"__esModule",{value:!0}),$),s0={};g4(s0,{isArrayBuffer:()=>d4});r0.exports=u4(s0);var d4=q4(($)=>typeof ArrayBuffer==="function"&&$ instanceof ArrayBuffer||Object.prototype.toString.call($)==="[object ArrayBuffer]","isArrayBuffer")});var g=U((aw,$1)=>{var{defineProperty:_,getOwnPropertyDescriptor:i4,getOwnPropertyNames:p4}=Object,_4=Object.prototype.hasOwnProperty,o0=($,w)=>_($,"name",{value:w,configurable:!0}),a4=($,w)=>{for(var z in w)_($,z,{get:w[z],enumerable:!0})},n4=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of p4(w))if(!_4.call($,Z)&&Z!==z)_($,Z,{get:()=>w[Z],enumerable:!(L=i4(w,Z))||L.enumerable})}return $},m4=($)=>n4(_({},"__esModule",{value:!0}),$),e0={};a4(e0,{fromArrayBuffer:()=>r4,fromString:()=>t4});$1.exports=m4(e0);var s4=t0(),Q0=N("buffer"),r4=o0(($,w=0,z=$.byteLength-w)=>{if(!s4.isArrayBuffer($))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof $} (${$})`);return Q0.Buffer.from($,w,z)},"fromArrayBuffer"),t4=o0(($,w)=>{if(typeof $!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof $} (${$})`);return w?Q0.Buffer.from($,w):Q0.Buffer.from($)},"fromString")});var Z1=U((w1)=>{Object.defineProperty(w1,"__esModule",{value:!0});w1.fromBase64=void 0;var o4=g(),e4=/^[A-Za-z0-9+/]*={0,2}$/,$$=($)=>{if($.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!e4.exec($))throw new TypeError("Invalid base64 string.");let w=o4.fromString($,"base64");return new Uint8Array(w.buffer,w.byteOffset,w.byteLength)};w1.fromBase64=$$});var n=U((mw,Q1)=>{var{defineProperty:a,getOwnPropertyDescriptor:w$,getOwnPropertyNames:z$}=Object,Z$=Object.prototype.hasOwnProperty,X0=($,w)=>a($,"name",{value:w,configurable:!0}),L$=($,w)=>{for(var z in w)a($,z,{get:w[z],enumerable:!0})},Y$=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of z$(w))if(!Z$.call($,Z)&&Z!==z)a($,Z,{get:()=>w[Z],enumerable:!(L=w$(w,Z))||L.enumerable})}return $},K$=($)=>Y$(a({},"__esModule",{value:!0}),$),L1={};L$(L1,{fromUtf8:()=>K1,toUint8Array:()=>Q$,toUtf8:()=>X$});Q1.exports=K$(L1);var Y1=g(),K1=X0(($)=>{let w=Y1.fromString($,"utf8");return new Uint8Array(w.buffer,w.byteOffset,w.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),Q$=X0(($)=>{if(typeof $==="string")return K1($);if(ArrayBuffer.isView($))return new Uint8Array($.buffer,$.byteOffset,$.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array($)},"toUint8Array"),X$=X0(($)=>{if(typeof $==="string")return $;if(typeof $!=="object"||typeof $.byteOffset!=="number"||typeof $.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return Y1.fromArrayBuffer($.buffer,$.byteOffset,$.byteLength).toString("utf8")},"toUtf8")});var B1=U((X1)=>{Object.defineProperty(X1,"__esModule",{value:!0});X1.toBase64=void 0;var G$=g(),B$=n(),F$=($)=>{let w;if(typeof $==="string")w=B$.fromUtf8($);else w=$;if(typeof w!=="object"||typeof w.byteOffset!=="number"||typeof w.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return G$.fromArrayBuffer(w.buffer,w.byteOffset,w.byteLength).toString("base64")};X1.toBase64=F$});var P=U((rw,m)=>{var{defineProperty:F1,getOwnPropertyDescriptor:U$,getOwnPropertyNames:V$}=Object,h$=Object.prototype.hasOwnProperty,G0=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of V$(w))if(!h$.call($,Z)&&Z!==z)F1($,Z,{get:()=>w[Z],enumerable:!(L=U$(w,Z))||L.enumerable})}return $},U1=($,w,z)=>(G0($,w,"default"),z&&G0(z,w,"default")),W$=($)=>G0(F1({},"__esModule",{value:!0}),$),B0={};m.exports=W$(B0);U1(B0,Z1(),m.exports);U1(B0,B1(),m.exports)});var F0=U((h1)=>{Object.defineProperty(h1,"__esModule",{value:!0});h1.ChecksumStream=void 0;var J$=P(),j$=N("stream");class V1 extends j$.Duplex{constructor({expectedChecksum:$,checksum:w,source:z,checksumSourceLocation:L,base64Encoder:Z}){var Q,Y;super();if(typeof z.pipe==="function")this.source=z;else throw new Error(`@smithy/util-stream: unsupported source type ${(Y=(Q=z===null||z===void 0?void 0:z.constructor)===null||Q===void 0?void 0:Q.name)!==null&&Y!==void 0?Y:z} in ChecksumStream.`);this.base64Encoder=Z!==null&&Z!==void 0?Z:J$.toBase64,this.expectedChecksum=$,this.checksum=w,this.checksumSourceLocation=L,this.source.pipe(this)}_read($){}_write($,w,z){try{this.checksum.update($),this.push($)}catch(L){return z(L)}return z()}async _final($){try{let w=await this.checksum.digest(),z=this.base64Encoder(w);if(this.expectedChecksum!==z)return $(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${z}" in response header "${this.checksumSourceLocation}".`))}catch(w){return $(w)}return this.push(null),$()}}h1.ChecksumStream=V1});var k=U((J1)=>{Object.defineProperty(J1,"__esModule",{value:!0});J1.isBlob=J1.isReadableStream=void 0;var D$=($)=>{var w;return typeof ReadableStream==="function"&&(((w=$===null||$===void 0?void 0:$.constructor)===null||w===void 0?void 0:w.name)===ReadableStream.name||$ instanceof ReadableStream)};J1.isReadableStream=D$;var v$=($)=>{var w;return typeof Blob==="function"&&(((w=$===null||$===void 0?void 0:$.constructor)===null||w===void 0?void 0:w.name)===Blob.name||$ instanceof Blob)};J1.isBlob=v$});var H1=U((v1)=>{Object.defineProperty(v1,"__esModule",{value:!0});v1.ChecksumStream=void 0;var H$=typeof ReadableStream==="function"?ReadableStream:function(){};class D1 extends H${}v1.ChecksumStream=D1});var N1=U((A1)=>{Object.defineProperty(A1,"__esModule",{value:!0});A1.createChecksumStream=void 0;var A$=P(),R$=k(),N$=H1(),I$=({expectedChecksum:$,checksum:w,source:z,checksumSourceLocation:L,base64Encoder:Z})=>{var Q,Y;if(!R$.isReadableStream(z))throw new Error(`@smithy/util-stream: unsupported source type ${(Y=(Q=z===null||z===void 0?void 0:z.constructor)===null||Q===void 0?void 0:Q.name)!==null&&Y!==void 0?Y:z} in ChecksumStream.`);let K=Z!==null&&Z!==void 0?Z:A$.toBase64;if(typeof TransformStream!=="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let X=new TransformStream({start(){},async transform(F,v){w.update(F),v.enqueue(F)},async flush(F){let v=await w.digest(),D=K(v);if($!==D){let j=new Error(`Checksum mismatch: expected "${$}" but received "${D}" in response header "${L}".`);F.error(j)}else F.terminate()}});z.pipeThrough(X);let G=X.readable;return Object.setPrototypeOf(G,N$.ChecksumStream.prototype),G};A1.createChecksumStream=I$});var O1=U((I1)=>{Object.defineProperty(I1,"__esModule",{value:!0});I1.createChecksumStream=void 0;var M$=k(),O$=F0(),b$=N1();function S$($){if(typeof ReadableStream==="function"&&M$.isReadableStream($.source))return b$.createChecksumStream($);return new O$.ChecksumStream($)}I1.createChecksumStream=S$});var U0=U((S1)=>{Object.defineProperty(S1,"__esModule",{value:!0});S1.ByteArrayCollector=void 0;class b1{constructor($){this.allocByteArray=$,this.byteLength=0,this.byteArrays=[]}push($){this.byteArrays.push($),this.byteLength+=$.byteLength}flush(){if(this.byteArrays.length===1){let z=this.byteArrays[0];return this.reset(),z}let $=this.allocByteArray(this.byteLength),w=0;for(let z=0;z<this.byteArrays.length;++z){let L=this.byteArrays[z];$.set(L,w),w+=L.byteLength}return this.reset(),$}reset(){this.byteArrays=[],this.byteLength=0}}S1.ByteArrayCollector=b1});var P1=U((f1)=>{Object.defineProperty(f1,"__esModule",{value:!0});f1.modeOf=f1.sizeOf=f1.flush=f1.merge=f1.createBufferedReadable=f1.createBufferedReadableStream=void 0;var x$=U0();function T1($,w,z){let L=$.getReader(),Z=!1,Q=0,Y=["",new x$.ByteArrayCollector((G)=>new Uint8Array(G))],K=-1,X=async(G)=>{let{value:F,done:v}=await L.read(),D=F;if(v){if(K!==-1){let j=s(Y,K);if(c(j)>0)G.enqueue(j)}G.close()}else{let j=k1(D);if(K!==j){if(K>=0)G.enqueue(s(Y,K));K=j}if(K===-1){G.enqueue(D);return}let C=c(D);Q+=C;let x=c(Y[K]);if(C>=w&&x===0)G.enqueue(D);else{let T=y1(Y,K,D);if(!Z&&Q>w*2)Z=!0,z===null||z===void 0||z.warn(`@smithy/util-stream - stream chunk size ${C} is below threshold of ${w}, automatically buffering.`);if(T>=w)G.enqueue(s(Y,K));else await X(G)}}};return new ReadableStream({pull:X})}f1.createBufferedReadableStream=T1;f1.createBufferedReadable=T1;function y1($,w,z){switch(w){case 0:return $[0]+=z,c($[0]);case 1:case 2:return $[w].push(z),c($[w])}}f1.merge=y1;function s($,w){switch(w){case 0:let z=$[0];return $[0]="",z;case 1:case 2:return $[w].flush()}throw new Error(`@smithy/util-stream - invalid index ${w} given to flush()`)}f1.flush=s;function c($){var w,z;return(z=(w=$===null||$===void 0?void 0:$.byteLength)!==null&&w!==void 0?w:$===null||$===void 0?void 0:$.length)!==null&&z!==void 0?z:0}f1.sizeOf=c;function k1($){if(typeof Buffer!=="undefined"&&$ instanceof Buffer)return 2;if($ instanceof Uint8Array)return 1;if(typeof $==="string")return 0;return-1}f1.modeOf=k1});var l1=U((q1)=>{Object.defineProperty(q1,"__esModule",{value:!0});q1.createBufferedReadable=void 0;var P$=N("stream"),c1=U0(),S=P1(),c$=k();function q$($,w,z){if(c$.isReadableStream($))return S.createBufferedReadableStream($,w,z);let L=new P$.Readable({read(){}}),Z=!1,Q=0,Y=["",new c1.ByteArrayCollector((X)=>new Uint8Array(X)),new c1.ByteArrayCollector((X)=>Buffer.from(new Uint8Array(X)))],K=-1;return $.on("data",(X)=>{let G=S.modeOf(X);if(K!==G){if(K>=0)L.push(S.flush(Y,K));K=G}if(K===-1){L.push(X);return}let F=S.sizeOf(X);Q+=F;let v=S.sizeOf(Y[K]);if(F>=w&&v===0)L.push(X);else{let D=S.merge(Y,K,X);if(!Z&&Q>w*2)Z=!0,z===null||z===void 0||z.warn(`@smithy/util-stream - stream chunk size ${F} is below threshold of ${w}, automatically buffering.`);if(D>=w)L.push(S.flush(Y,K))}}),$.on("end",()=>{if(K!==-1){let X=S.flush(Y,K);if(S.sizeOf(X)>0)L.push(X)}L.push(null)}),L}q1.createBufferedReadable=q$});var i1=U((u1)=>{Object.defineProperty(u1,"__esModule",{value:!0});u1.getAwsChunkedEncodingStream=void 0;var g$=N("stream"),l$=($,w)=>{let{base64Encoder:z,bodyLengthChecker:L,checksumAlgorithmFn:Z,checksumLocationName:Q,streamHasher:Y}=w,K=z!==void 0&&Z!==void 0&&Q!==void 0&&Y!==void 0,X=K?Y(Z,$):void 0,G=new g$.Readable({read:()=>{}});return $.on("data",(F)=>{let v=L(F)||0;G.push(`${v.toString(16)}\r
4
4
  `),G.push(F),G.push(`\r
@@ -7,4 +7,4 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
7
7
  `),G.push(`\r
8
8
  `)}G.push(null)}),G};u1.getAwsChunkedEncodingStream=l$});var a1=U((p1)=>{Object.defineProperty(p1,"__esModule",{value:!0});p1.headStream=void 0;async function u$($,w){var z;let L=0,Z=[],Q=$.getReader(),Y=!1;while(!Y){let{done:G,value:F}=await Q.read();if(F)Z.push(F),L+=(z=F===null||F===void 0?void 0:F.byteLength)!==null&&z!==void 0?z:0;if(L>=w)break;Y=G}Q.releaseLock();let K=new Uint8Array(Math.min(w,L)),X=0;for(let G of Z){if(G.byteLength>K.byteLength-X){K.set(G.subarray(0,K.byteLength-X),X);break}else K.set(G,X);X+=G.length}return K}p1.headStream=u$});var r1=U((m1)=>{Object.defineProperty(m1,"__esModule",{value:!0});m1.headStream=void 0;var d$=N("stream"),i$=a1(),p$=k(),_$=($,w)=>{if(p$.isReadableStream($))return i$.headStream($,w);return new Promise((z,L)=>{let Z=new n1;Z.limit=w,$.pipe(Z),$.on("error",(Q)=>{Z.end(),L(Q)}),Z.on("error",L),Z.on("finish",function(){let Q=new Uint8Array(Buffer.concat(this.buffers));z(Q)})})};m1.headStream=_$;class n1 extends d$.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=1/0,this.bytesBuffered=0}_write($,w,z){var L;if(this.buffers.push($),this.bytesBuffered+=(L=$.byteLength)!==null&&L!==void 0?L:0,this.bytesBuffered>=this.limit){let Z=this.bytesBuffered-this.limit,Q=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=Q.subarray(0,Q.byteLength-Z),this.emit("finish")}z()}}});var L6=U((X8,Z6)=>{var{defineProperty:t,getOwnPropertyDescriptor:a$,getOwnPropertyNames:n$}=Object,m$=Object.prototype.hasOwnProperty,M=($,w)=>t($,"name",{value:w,configurable:!0}),s$=($,w)=>{for(var z in w)t($,z,{get:w[z],enumerable:!0})},r$=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of n$(w))if(!m$.call($,Z)&&Z!==z)t($,Z,{get:()=>w[Z],enumerable:!(L=a$(w,Z))||L.enumerable})}return $},t$=($)=>r$(t({},"__esModule",{value:!0}),$),o1={};s$(o1,{FetchHttpHandler:()=>e$,keepAliveSupport:()=>r,streamCollector:()=>ww});Z6.exports=t$(o1);var t1=u(),o$=Z0();function V0($,w){return new Request($,w)}M(V0,"createRequest");function e1($=0){return new Promise((w,z)=>{if($)setTimeout(()=>{let L=new Error(`Request did not complete within ${$} ms`);L.name="TimeoutError",z(L)},$)})}M(e1,"requestTimeout");var r={supported:void 0},e$=class ${static{M(this,"FetchHttpHandler")}static create(w){if(typeof w?.handle==="function")return w;return new $(w)}constructor(w){if(typeof w==="function")this.configProvider=w().then((z)=>z||{});else this.config=w??{},this.configProvider=Promise.resolve(this.config);if(r.supported===void 0)r.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in V0("https://[::1]"))}destroy(){}async handle(w,{abortSignal:z}={}){if(!this.config)this.config=await this.configProvider;let L=this.config.requestTimeout,Z=this.config.keepAlive===!0,Q=this.config.credentials;if(z?.aborted){let h=new Error("Request aborted");return h.name="AbortError",Promise.reject(h)}let Y=w.path,K=o$.buildQueryString(w.query||{});if(K)Y+=`?${K}`;if(w.fragment)Y+=`#${w.fragment}`;let X="";if(w.username!=null||w.password!=null){let h=w.username??"",A=w.password??"";X=`${h}:${A}@`}let{port:G,method:F}=w,v=`${w.protocol}//${X}${w.hostname}${G?`:${G}`:""}${Y}`,D=F==="GET"||F==="HEAD"?void 0:w.body,j={body:D,headers:new Headers(w.headers),method:F,credentials:Q};if(this.config?.cache)j.cache=this.config.cache;if(D)j.duplex="half";if(typeof AbortController!=="undefined")j.signal=z;if(r.supported)j.keepalive=Z;if(typeof this.config.requestInit==="function")Object.assign(j,this.config.requestInit(w));let C=M(()=>{},"removeSignalEventListener"),x=V0(v,j),T=[fetch(x).then((h)=>{let A=h.headers,B={};for(let E of A.entries())B[E[0]]=E[1];if(h.body==null)return h.blob().then((E)=>({response:new t1.HttpResponse({headers:B,reason:h.statusText,statusCode:h.status,body:E})}));return{response:new t1.HttpResponse({headers:B,reason:h.statusText,statusCode:h.status,body:h.body})}}),e1(L)];if(z)T.push(new Promise((h,A)=>{let B=M(()=>{let W=new Error("Request aborted");W.name="AbortError",A(W)},"onAbort");if(typeof z.addEventListener==="function"){let W=z;W.addEventListener("abort",B,{once:!0}),C=M(()=>W.removeEventListener("abort",B),"removeSignalEventListener")}else z.onabort=B}));return Promise.race(T).finally(C)}updateHttpClientConfig(w,z){this.config=void 0,this.configProvider=this.configProvider.then((L)=>{return L[w]=z,L})}httpHandlerConfigs(){return this.config??{}}},$w=P(),ww=M(async($)=>{if(typeof Blob==="function"&&$ instanceof Blob||$.constructor?.name==="Blob"){if(Blob.prototype.arrayBuffer!==void 0)return new Uint8Array(await $.arrayBuffer());return $6($)}return w6($)},"streamCollector");async function $6($){let w=await z6($),z=$w.fromBase64(w);return new Uint8Array(z)}M($6,"collectBlob");async function w6($){let w=[],z=$.getReader(),L=!1,Z=0;while(!L){let{done:K,value:X}=await z.read();if(X)w.push(X),Z+=X.length;L=K}let Q=new Uint8Array(Z),Y=0;for(let K of w)Q.set(K,Y),Y+=K.length;return Q}M(w6,"collectStream");function z6($){return new Promise((w,z)=>{let L=new FileReader;L.onloadend=()=>{if(L.readyState!==2)return z(new Error("Reader aborted too early"));let Z=L.result??"",Q=Z.indexOf(","),Y=Q>-1?Q+1:Z.length;w(Z.substring(Y))},L.onabort=()=>z(new Error("Read aborted")),L.onerror=()=>z(L.error),L.readAsDataURL($)})}M(z6,"readToBase64")});var F6=U((G8,B6)=>{var{defineProperty:o,getOwnPropertyDescriptor:zw,getOwnPropertyNames:Zw}=Object,Lw=Object.prototype.hasOwnProperty,Y6=($,w)=>o($,"name",{value:w,configurable:!0}),Yw=($,w)=>{for(var z in w)o($,z,{get:w[z],enumerable:!0})},Kw=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of Zw(w))if(!Lw.call($,Z)&&Z!==z)o($,Z,{get:()=>w[Z],enumerable:!(L=zw(w,Z))||L.enumerable})}return $},Qw=($)=>Kw(o({},"__esModule",{value:!0}),$),K6={};Yw(K6,{fromHex:()=>X6,toHex:()=>G6});B6.exports=Qw(K6);var Q6={},h0={};for(let $=0;$<256;$++){let w=$.toString(16).toLowerCase();if(w.length===1)w=`0${w}`;Q6[$]=w,h0[w]=$}function X6($){if($.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let w=new Uint8Array($.length/2);for(let z=0;z<$.length;z+=2){let L=$.slice(z,z+2).toLowerCase();if(L in h0)w[z/2]=h0[L];else throw new Error(`Cannot decode unrecognized sequence ${L} as hexadecimal`)}return w}Y6(X6,"fromHex");function G6($){let w="";for(let z=0;z<$.byteLength;z++)w+=Q6[$[z]];return w}Y6(G6,"toHex")});var j6=U((W6)=>{Object.defineProperty(W6,"__esModule",{value:!0});W6.sdkStreamMixin=void 0;var Xw=L6(),Gw=P(),Bw=F6(),Fw=n(),U6=k(),V6="The stream has already been transformed.",Uw=($)=>{var w,z;if(!h6($)&&!U6.isReadableStream($)){let Y=((z=(w=$===null||$===void 0?void 0:$.__proto__)===null||w===void 0?void 0:w.constructor)===null||z===void 0?void 0:z.name)||$;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${Y}`)}let L=!1,Z=async()=>{if(L)throw new Error(V6);return L=!0,await Xw.streamCollector($)},Q=(Y)=>{if(typeof Y.stream!=="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
9
9
  If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return Y.stream()};return Object.assign($,{transformToByteArray:Z,transformToString:async(Y)=>{let K=await Z();if(Y==="base64")return Gw.toBase64(K);else if(Y==="hex")return Bw.toHex(K);else if(Y===void 0||Y==="utf8"||Y==="utf-8")return Fw.toUtf8(K);else if(typeof TextDecoder==="function")return new TextDecoder(Y).decode(K);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(L)throw new Error(V6);if(L=!0,h6($))return Q($);else if(U6.isReadableStream($))return $;else throw new Error(`Cannot transform payload to web stream, got ${$}`)}})};W6.sdkStreamMixin=Uw;var h6=($)=>typeof Blob==="function"&&$ instanceof Blob});var H6=U((v6)=>{Object.defineProperty(v6,"__esModule",{value:!0});v6.sdkStreamMixin=void 0;var Vw=m0(),hw=g(),W0=N("stream"),Ww=j6(),D6="The stream has already been transformed.",Jw=($)=>{var w,z;if(!($ instanceof W0.Readable))try{return Ww.sdkStreamMixin($)}catch(Q){let Y=((z=(w=$===null||$===void 0?void 0:$.__proto__)===null||w===void 0?void 0:w.constructor)===null||z===void 0?void 0:z.name)||$;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${Y}`)}let L=!1,Z=async()=>{if(L)throw new Error(D6);return L=!0,await Vw.streamCollector($)};return Object.assign($,{transformToByteArray:Z,transformToString:async(Q)=>{let Y=await Z();if(Q===void 0||Buffer.isEncoding(Q))return hw.fromArrayBuffer(Y.buffer,Y.byteOffset,Y.byteLength).toString(Q);else return new TextDecoder(Q).decode(Y)},transformToWebStream:()=>{if(L)throw new Error(D6);if($.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof W0.Readable.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return L=!0,W0.Readable.toWeb($)}})};v6.sdkStreamMixin=Jw});var N6=U((A6)=>{Object.defineProperty(A6,"__esModule",{value:!0});A6.splitStream=void 0;async function jw($){if(typeof $.stream==="function")$=$.stream();return $.tee()}A6.splitStream=jw});var S6=U((O6)=>{Object.defineProperty(O6,"__esModule",{value:!0});O6.splitStream=void 0;var I6=N("stream"),Dw=N6(),M6=k();async function vw($){if(M6.isReadableStream($)||M6.isBlob($))return Dw.splitStream($);let w=new I6.PassThrough,z=new I6.PassThrough;return $.pipe(w),$.pipe(z),[w,z]}O6.splitStream=vw});var f6=U((h8,b)=>{var{defineProperty:e,getOwnPropertyDescriptor:Cw,getOwnPropertyNames:Hw}=Object,Aw=Object.prototype.hasOwnProperty,D0=($,w)=>e($,"name",{value:w,configurable:!0}),Rw=($,w)=>{for(var z in w)e($,z,{get:w[z],enumerable:!0})},J0=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of Hw(w))if(!Aw.call($,Z)&&Z!==z)e($,Z,{get:()=>w[Z],enumerable:!(L=Cw(w,Z))||L.enumerable})}return $},f=($,w,z)=>(J0($,w,"default"),z&&J0(z,w,"default")),Nw=($)=>J0(e({},"__esModule",{value:!0}),$),O={};Rw(O,{Uint8ArrayBlobAdapter:()=>j0});b.exports=Nw(O);var x6=P(),T6=n();function y6($,w="utf-8"){if(w==="base64")return x6.toBase64($);return T6.toUtf8($)}D0(y6,"transformToString");function k6($,w){if(w==="base64")return j0.mutate(x6.fromBase64($));return j0.mutate(T6.fromUtf8($))}D0(k6,"transformFromString");var j0=class $ extends Uint8Array{static{D0(this,"Uint8ArrayBlobAdapter")}static fromString(w,z="utf-8"){switch(typeof w){case"string":return k6(w,z);default:throw new Error(`Unsupported conversion from ${typeof w} to Uint8ArrayBlobAdapter.`)}}static mutate(w){return Object.setPrototypeOf(w,$.prototype),w}transformToString(w="utf-8"){return y6(this,w)}};f(O,F0(),b.exports);f(O,O1(),b.exports);f(O,l1(),b.exports);f(O,i1(),b.exports);f(O,r1(),b.exports);f(O,H6(),b.exports);f(O,S6(),b.exports);f(O,k(),b.exports)});var fw=U((W8,q6)=>{var{defineProperty:H0,getOwnPropertyDescriptor:Iw,getOwnPropertyNames:Mw}=Object,Ow=Object.prototype.hasOwnProperty,bw=($,w)=>{for(var z in w)H0($,z,{get:w[z],enumerable:!0})},Sw=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of Mw(w))if(!Ow.call($,Z)&&Z!==z)H0($,Z,{get:()=>w[Z],enumerable:!(L=Iw(w,Z))||L.enumerable})}return $},xw=($)=>Sw(H0({},"__esModule",{value:!0}),$),E6={};bw(E6,{RequestBuilder:()=>c6,collectBody:()=>Tw,extendedEncodeURIComponent:()=>C0,requestBuilder:()=>kw,resolvedPath:()=>P6});q6.exports=xw(E6);var v0=f6(),Tw=async($=new Uint8Array,w)=>{if($ instanceof Uint8Array)return v0.Uint8ArrayBlobAdapter.mutate($);if(!$)return v0.Uint8ArrayBlobAdapter.mutate(new Uint8Array);let z=w.streamCollector($);return v0.Uint8ArrayBlobAdapter.mutate(await z)};function C0($){return encodeURIComponent($).replace(/[!'()*]/g,function(w){return"%"+w.charCodeAt(0).toString(16).toUpperCase()})}var yw=u(),P6=($,w,z,L,Z,Q)=>{if(w!=null&&w[z]!==void 0){let Y=L();if(Y.length<=0)throw new Error("Empty value provided for input HTTP label: "+z+".");$=$.replace(Z,Q?Y.split("/").map((K)=>C0(K)).join("/"):C0(Y))}else throw new Error("No value provided for input HTTP label: "+z+".");return $};function kw($,w){return new c6($,w)}var c6=class{constructor($,w){this.input=$,this.context=w,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){let{hostname:$,protocol:w="https",port:z,path:L}=await this.context.endpoint();this.path=L;for(let Z of this.resolvePathStack)Z(this.path);return new yw.HttpRequest({protocol:w,hostname:this.hostname||$,port:z,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn($){return this.hostname=$,this}bp($){return this.resolvePathStack.push((w)=>{this.path=`${w?.endsWith("/")?w.slice(0,-1):w||""}`+$}),this}p($,w,z,L){return this.resolvePathStack.push((Z)=>{this.path=P6(Z,this.input,$,w,z,L)}),this}h($){return this.headers=$,this}q($){return this.query=$,this}b($){return this.body=$,this}m($){return this.method=$,this}}});
10
- export{u as oc,t0 as pc,g as qc,n as rc,P as sc,x0 as tc,Z0 as uc,m0 as vc,F6 as wc,f6 as xc,fw as yc};
10
+ export{u as oc,t0 as pc,g as qc,n as rc,P as sc,x0 as tc,m0 as uc,F6 as vc,f6 as wc,fw as xc};
@@ -0,0 +1,6 @@
1
+ // @bun
2
+ import{Ib as y,Rb as C,ec as P}from"./chunk-jky37dv1.js";import{wc as u}from"./chunk-ww48v0ap.js";import"./chunk-5eh2tfep.js";import{Lc as n}from"./chunk-z80nypa9.js";import{Qc as A}from"./chunk-bgqy98qw.js";import{Rc as d}from"./chunk-2pj0cr49.js";var K=d(A(),1);import O from"fs/promises";var E="169.254.170.2",R="169.254.170.23",p="[fd00:ec2::23]",i=(e,a)=>{if(e.protocol==="https:")return;if(e.hostname===E||e.hostname===R||e.hostname===p)return;if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;let c=e.hostname.split("."),r=(t)=>{let s=parseInt(t,10);return 0<=s&&s<=255};if(c[0]==="127"&&r(c[1])&&r(c[2])&&r(c[3])&&c.length===4)return}throw new n(`URL not accepted. It must either be HTTPS or match one of the following:
3
+ - loopback CIDR 127.0.0.0/8 or [::1/128]
4
+ - ECS container host 169.254.170.2
5
+ - EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:a})};var S=d(u(),1);function g(e){return new y({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((a,[c,r])=>{return a[c]=r,a},{}),fragment:e.hash})}async function w(e,a){let r=await S.sdkStreamMixin(e.body).transformToString();if(e.statusCode===200){let t=JSON.parse(r);if(typeof t.AccessKeyId!=="string"||typeof t.SecretAccessKey!=="string"||typeof t.Token!=="string"||typeof t.Expiration!=="string")throw new n("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:a});return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:C(t.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let t={};try{t=JSON.parse(r)}catch(s){}throw Object.assign(new n(`Server responded with status: ${e.statusCode}`,{logger:a}),{Code:t.Code,Message:t.Message})}throw new n(`Server responded with status: ${e.statusCode}`,{logger:a})}var I=(e,a,c)=>{return async()=>{for(let r=0;r<a;++r)try{return await e()}catch(t){await new Promise((s)=>setTimeout(s,c))}return await e()}};var b="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",v="http://169.254.170.2",_="AWS_CONTAINER_CREDENTIALS_FULL_URI",B="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",D="AWS_CONTAINER_AUTHORIZATION_TOKEN",M=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let a,c=e.awsContainerCredentialsRelativeUri??process.env[b],r=e.awsContainerCredentialsFullUri??process.env[_],t=e.awsContainerAuthorizationToken??process.env[D],s=e.awsContainerAuthorizationTokenFile??process.env[B],m=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console.warn:e.logger.warn;if(c&&r)m("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),m("awsContainerCredentialsFullUri will take precedence.");if(t&&s)m("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),m("awsContainerAuthorizationToken will take precedence.");if(r)a=r;else if(c)a=`${v}${c}`;else throw new n(`No HTTP credential provider host provided.
6
+ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:e.logger});let h=new URL(a);i(h,e.logger);let T=new P({requestTimeout:e.timeout??1000,connectionTimeout:e.timeout??1000});return I(async()=>{let o=g(h);if(t)o.headers.Authorization=t;else if(s)o.headers.Authorization=(await O.readFile(s)).toString();try{let f=await T.handle(o);return w(f.response).then((x)=>K.setCredentialFeature(x,"CREDENTIALS_HTTP","z"))}catch(f){throw new n(String(f),{logger:e.logger})}},e.maxRetries??3,e.timeout??1000)};export{M as fromHttp};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Ac as q,Bc as N,Ec as I,Fc as R,zc as C}from"./chunk-8acb2bq0.js";import"./chunk-5eh2tfep.js";import{Lc as a,Mc as m}from"./chunk-z80nypa9.js";import{Qc as Y}from"./chunk-bgqy98qw.js";import{Rc as O,Wc as A}from"./chunk-2pj0cr49.js";var K=(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 D=O(Y(),1);var b=300000,u="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var H=async(e,s={})=>{let{SSOOIDCClient:o}=await import("./chunk-9gzvq5jq.js");return new o(Object.assign({},s.clientConfig??{},{region:e??s.clientConfig?.region,logger:s.clientConfig?.logger??s.parentClientConfig?.logger}))};var U=async(e,s,o={})=>{let{CreateTokenCommand:i}=await import("./chunk-9gzvq5jq.js");return(await H(s,o)).send(new i({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var P=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new m(`Token is expired. ${u}`,!1)};var w=(e,s,o=!1)=>{if(typeof s==="undefined")throw new m(`Value not present for '${e}' in SSO Token${o?". Cannot refresh":""}. ${u}`,!1)};import{promises as J}from"fs";var{writeFile:V}=J,W=(e,s)=>{let o=q(e),i=JSON.stringify(s,null,2);return V(o,i)};var j=new Date(0),X=(e={})=>async({callerClientConfig:s}={})=>{let o={...e,parentClientConfig:{...s,...e.parentClientConfig}};o.logger?.debug("@aws-sdk/token-providers - fromSso");let i=await R(o),r=C({profile:o.profile??s?.profile}),p=i[r];if(!p)throw new m(`Profile '${r}' could not be found in shared credentials file.`,!1);else if(!p.sso_session)throw new m(`Profile '${r}' is missing required property 'sso_session'.`);let c=p.sso_session,l=(await I(o))[c];if(!l)throw new m(`Sso session '${c}' could not be found in shared credentials file.`,!1);for(let n of["sso_start_url","sso_region"])if(!l[n])throw new m(`Sso session '${c}' is missing required property '${n}'.`,!1);let{sso_start_url:d,sso_region:t}=l,f;try{f=await N(c)}catch(n){throw new m(`The SSO session token associated with profile=${r} was not found or is invalid. ${u}`,!1)}w("accessToken",f.accessToken),w("expiresAt",f.expiresAt);let{accessToken:k,expiresAt:T}=f,S={token:k,expiration:new Date(T)};if(S.expiration.getTime()-Date.now()>b)return S;if(Date.now()-j.getTime()<30000)return P(S),S;w("clientId",f.clientId,!0),w("clientSecret",f.clientSecret,!0),w("refreshToken",f.refreshToken,!0);try{j.setTime(Date.now());let n=await U(f,t,o);w("accessToken",n.accessToken),w("expiresIn",n.expiresIn);let h=new Date(Date.now()+n.expiresIn*1000);try{await W(c,{...f,accessToken:n.accessToken,expiresAt:h.toISOString(),refreshToken:n.refreshToken})}catch(g){}return{token:n.accessToken,expiration:h}}catch(n){return P(S),S}};var E=!1,$=async({ssoStartUrl:e,ssoSession:s,ssoAccountId:o,ssoRegion:i,ssoRoleName:r,ssoClient:p,clientConfig:c,parentClientConfig:x,profile:l,logger:d})=>{let t,f="To refresh this SSO session run aws sso login with the corresponding profile.";if(s)try{let _=await X({profile:l})();t={accessToken:_.token,expiresAt:new Date(_.expiration).toISOString()}}catch(_){throw new a(_.message,{tryNextLink:E,logger:d})}else try{t=await N(e)}catch(_){throw new a("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:E,logger:d})}if(new Date(t.expiresAt).getTime()-Date.now()<=0)throw new a("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:E,logger:d});let{accessToken:k}=t,{SSOClient:T,GetRoleCredentialsCommand:S}=await import("./chunk-fds99vbx.js"),n=p||new T(Object.assign({},c??{},{logger:c?.logger??x?.logger,region:c?.region??i})),h;try{h=await n.send(new S({accountId:o,roleName:r,accessToken:k}))}catch(_){throw new a(_,{tryNextLink:E,logger:d})}let{roleCredentials:{accessKeyId:g,secretAccessKey:y,sessionToken:F,expiration:L,credentialScope:M,accountId:G}={}}=h;if(!g||!y||!F||!L)throw new a("SSO returns an invalid temporary credential.",{tryNextLink:E,logger:d});let v={accessKeyId:g,secretAccessKey:y,sessionToken:F,expiration:new Date(L),...M&&{credentialScope:M},...G&&{accountId:G}};if(s)D.setCredentialFeature(v,"CREDENTIALS_SSO","s");else D.setCredentialFeature(v,"CREDENTIALS_SSO_LEGACY","u");return v};var z=(e,s)=>{let{sso_start_url:o,sso_account_id:i,sso_region:r,sso_role_name:p}=e;if(!o||!i||!r||!p)throw new a(`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(", ")}
3
+ Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:s});return e};var ve=(e={})=>async({callerClientConfig:s}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:o,ssoAccountId:i,ssoRegion:r,ssoRoleName:p,ssoSession:c}=e,{ssoClient:x}=e,l=C({profile:e.profile??s?.profile});if(!o&&!i&&!r&&!p&&!c){let t=(await R(e))[l];if(!t)throw new a(`Profile ${l} was not found.`,{logger:e.logger});if(!K(t))throw new a(`Profile ${l} is not configured with SSO credentials.`,{logger:e.logger});if(t?.sso_session){let g=(await I(e))[t.sso_session],y=` configurations in profile ${l} and sso-session ${t.sso_session}`;if(r&&r!==g.sso_region)throw new a("Conflicting SSO region"+y,{tryNextLink:!1,logger:e.logger});if(o&&o!==g.sso_start_url)throw new a("Conflicting SSO start_url"+y,{tryNextLink:!1,logger:e.logger});t.sso_region=g.sso_region,t.sso_start_url=g.sso_start_url}let{sso_start_url:f,sso_account_id:k,sso_region:T,sso_role_name:S,sso_session:n}=z(t,e.logger);return $({ssoStartUrl:f,ssoSession:n,ssoAccountId:k,ssoRegion:T,ssoRoleName:S,ssoClient:x,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,profile:l})}else if(!o||!i||!r||!p)throw new a('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return $({ssoStartUrl:o,ssoSession:c,ssoAccountId:i,ssoRegion:r,ssoRoleName:p,ssoClient:x,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,profile:l})};export{z as validateSsoProfile,K as isSsoProfile,ve as fromSSO};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Lc as c}from"./chunk-z80nypa9.js";import{Qc as T}from"./chunk-bgqy98qw.js";import{Rc as E,Wc as p}from"./chunk-2pj0cr49.js";var N=E(T(),1);import{readFileSync as f}from"fs";var i=(e)=>async(o)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:r,roleSessionName:s,webIdentityToken:n,providerId:S,policyArns:d,policy:l,durationSeconds:m}=e,{roleAssumerWithWebIdentity:t}=e;if(!t){let{getDefaultRoleAssumerWithWebIdentity:a}=await import("./chunk-5yawz4bx.js");t=a({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...o?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return t({RoleArn:r,RoleSessionName:s??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:n,ProviderId:S,PolicyArns:d,Policy:l,DurationSeconds:m})};var _="AWS_WEB_IDENTITY_TOKEN_FILE",A="AWS_ROLE_ARN",I="AWS_ROLE_SESSION_NAME",k=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let o=e?.webIdentityTokenFile??process.env[_],r=e?.roleArn??process.env[A],s=e?.roleSessionName??process.env[I];if(!o||!r)throw new c("Web identity configuration not specified",{logger:e.logger});let n=await i({...e,webIdentityToken:f(o,{encoding:"ascii"}),roleArn:r,roleSessionName:s})();if(o===process.env[_])N.setCredentialFeature(n,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return n};export{i as fromWebToken,k as fromTokenFile};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Nc as sJ,Pc as X,Sc as Q}from"./chunk-tkegy5p0.js";var u=X((SE)=>{SE.fromCallback=function(q){return Object.defineProperty(function(...n){if(typeof n[n.length-1]==="function")q.apply(this,n);else return new Promise((E,y)=>{n.push((J,O)=>J!=null?y(J):E(O)),q.apply(this,n)})},"name",{value:q.name})};SE.fromPromise=function(q){return Object.defineProperty(function(...n){let E=n[n.length-1];if(typeof E!=="function")return q.apply(this,n);else n.pop(),q.apply(this,n).then((y)=>E(null,y),E)},"name",{value:q.name})}});var hq=X((UO,iq)=>{var f=Q("constants"),iE=process.cwd,Pq=null,hE=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!Pq)Pq=iE.call(process);return Pq};try{process.cwd()}catch(q){}if(typeof process.chdir==="function"){if(Aq=process.chdir,process.chdir=function(q){Pq=null,Aq.call(process,q)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,Aq)}var Aq;iq.exports=lE;function lE(q){if(f.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))n(q);if(!q.lutimes)E(q);if(q.chown=O(q.chown),q.fchown=O(q.fchown),q.lchown=O(q.lchown),q.chmod=y(q.chmod),q.fchmod=y(q.fchmod),q.lchmod=y(q.lchmod),q.chownSync=_(q.chownSync),q.fchownSync=_(q.fchownSync),q.lchownSync=_(q.lchownSync),q.chmodSync=J(q.chmodSync),q.fchmodSync=J(q.fchmodSync),q.lchmodSync=J(q.lchmodSync),q.stat=U(q.stat),q.fstat=U(q.fstat),q.lstat=U(q.lstat),q.statSync=j(q.statSync),q.fstatSync=j(q.fstatSync),q.lstatSync=j(q.lstatSync),q.chmod&&!q.lchmod)q.lchmod=function(V,A,L){if(L)process.nextTick(L)},q.lchmodSync=function(){};if(q.chown&&!q.lchown)q.lchown=function(V,A,L,K){if(K)process.nextTick(K)},q.lchownSync=function(){};if(hE==="win32")q.rename=typeof q.rename!=="function"?q.rename:function(V){function A(L,K,P){var N=Date.now(),C=0;V(L,K,function R(h){if(h&&(h.code==="EACCES"||h.code==="EPERM"||h.code==="EBUSY")&&Date.now()-N<60000){if(setTimeout(function(){q.stat(K,function(m,Jq){if(m&&m.code==="ENOENT")V(L,K,R);else P(h)})},C),C<100)C+=10;return}if(P)P(h)})}if(Object.setPrototypeOf)Object.setPrototypeOf(A,V);return A}(q.rename);q.read=typeof q.read!=="function"?q.read:function(V){function A(L,K,P,N,C,R){var h;if(R&&typeof R==="function"){var m=0;h=function(Jq,gq,bq){if(Jq&&Jq.code==="EAGAIN"&&m<10)return m++,V.call(q,L,K,P,N,C,h);R.apply(this,arguments)}}return V.call(q,L,K,P,N,C,h)}if(Object.setPrototypeOf)Object.setPrototypeOf(A,V);return A}(q.read),q.readSync=typeof q.readSync!=="function"?q.readSync:function(V){return function(A,L,K,P,N){var C=0;while(!0)try{return V.call(q,A,L,K,P,N)}catch(R){if(R.code==="EAGAIN"&&C<10){C++;continue}throw R}}}(q.readSync);function n(V){V.lchmod=function(A,L,K){V.open(A,f.O_WRONLY|f.O_SYMLINK,L,function(P,N){if(P){if(K)K(P);return}V.fchmod(N,L,function(C){V.close(N,function(R){if(K)K(C||R)})})})},V.lchmodSync=function(A,L){var K=V.openSync(A,f.O_WRONLY|f.O_SYMLINK,L),P=!0,N;try{N=V.fchmodSync(K,L),P=!1}finally{if(P)try{V.closeSync(K)}catch(C){}else V.closeSync(K)}return N}}function E(V){if(f.hasOwnProperty("O_SYMLINK")&&V.futimes)V.lutimes=function(A,L,K,P){V.open(A,f.O_SYMLINK,function(N,C){if(N){if(P)P(N);return}V.futimes(C,L,K,function(R){V.close(C,function(h){if(P)P(R||h)})})})},V.lutimesSync=function(A,L,K){var P=V.openSync(A,f.O_SYMLINK),N,C=!0;try{N=V.futimesSync(P,L,K),C=!1}finally{if(C)try{V.closeSync(P)}catch(R){}else V.closeSync(P)}return N};else if(V.futimes)V.lutimes=function(A,L,K,P){if(P)process.nextTick(P)},V.lutimesSync=function(){}}function y(V){if(!V)return V;return function(A,L,K){return V.call(q,A,L,function(P){if($(P))P=null;if(K)K.apply(this,arguments)})}}function J(V){if(!V)return V;return function(A,L){try{return V.call(q,A,L)}catch(K){if(!$(K))throw K}}}function O(V){if(!V)return V;return function(A,L,K,P){return V.call(q,A,L,K,function(N){if($(N))N=null;if(P)P.apply(this,arguments)})}}function _(V){if(!V)return V;return function(A,L,K){try{return V.call(q,A,L,K)}catch(P){if(!$(P))throw P}}}function U(V){if(!V)return V;return function(A,L,K){if(typeof L==="function")K=L,L=null;function P(N,C){if(C){if(C.uid<0)C.uid+=4294967296;if(C.gid<0)C.gid+=4294967296}if(K)K.apply(this,arguments)}return L?V.call(q,A,L,P):V.call(q,A,P)}}function j(V){if(!V)return V;return function(A,L){var K=L?V.call(q,A,L):V.call(q,A);if(K){if(K.uid<0)K.uid+=4294967296;if(K.gid<0)K.gid+=4294967296}return K}}function $(V){if(!V)return!0;if(V.code==="ENOSYS")return!0;var A=!process.getuid||process.getuid()!==0;if(A){if(V.code==="EINVAL"||V.code==="EPERM")return!0}return!1}}});var cq=X((zO,pq)=>{var lq=Q("stream").Stream;pq.exports=pE;function pE(q){return{ReadStream:n,WriteStream:E};function n(y,J){if(!(this instanceof n))return new n(y,J);lq.call(this);var O=this;this.path=y,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,J=J||{};var _=Object.keys(J);for(var U=0,j=_.length;U<j;U++){var $=_[U];this[$]=J[$]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){O._read()});return}q.open(this.path,this.flags,this.mode,function(V,A){if(V){O.emit("error",V),O.readable=!1;return}O.fd=A,O.emit("open",A),O._read()})}function E(y,J){if(!(this instanceof E))return new E(y,J);lq.call(this),this.path=y,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,J=J||{};var O=Object.keys(J);for(var _=0,U=O.length;_<U;_++){var j=O[_];this[j]=J[j]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=q.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var fq=X((LO,oq)=>{oq.exports=oE;var cE=Object.getPrototypeOf||function(q){return q.__proto__};function oE(q){if(q===null||typeof q!=="object")return q;if(q instanceof Object)var n={__proto__:cE(q)};else var n=Object.create(null);return Object.getOwnPropertyNames(q).forEach(function(E){Object.defineProperty(n,E,Object.getOwnPropertyDescriptor(q,E))}),n}});var qq=X((PO,Iq)=>{var B=Q("fs"),fE=hq(),dE=cq(),rE=fq(),Gq=Q("util"),F,Yq;if(typeof Symbol==="function"&&typeof Symbol.for==="function")F=Symbol.for("graceful-fs.queue"),Yq=Symbol.for("graceful-fs.previous");else F="___graceful-fs.queue",Yq="___graceful-fs.previous";function aE(){}function rq(q,n){Object.defineProperty(q,F,{get:function(){return n}})}var e=aE;if(Gq.debuglog)e=Gq.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))e=function(){var q=Gq.format.apply(Gq,arguments);q="GFS4: "+q.split(/\n/).join(`
2
+ import{Rc as sJ,Tc as X,Wc as Q}from"./chunk-2pj0cr49.js";var u=X((SE)=>{SE.fromCallback=function(q){return Object.defineProperty(function(...n){if(typeof n[n.length-1]==="function")q.apply(this,n);else return new Promise((E,y)=>{n.push((J,O)=>J!=null?y(J):E(O)),q.apply(this,n)})},"name",{value:q.name})};SE.fromPromise=function(q){return Object.defineProperty(function(...n){let E=n[n.length-1];if(typeof E!=="function")return q.apply(this,n);else n.pop(),q.apply(this,n).then((y)=>E(null,y),E)},"name",{value:q.name})}});var hq=X((UO,iq)=>{var f=Q("constants"),iE=process.cwd,Pq=null,hE=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!Pq)Pq=iE.call(process);return Pq};try{process.cwd()}catch(q){}if(typeof process.chdir==="function"){if(Aq=process.chdir,process.chdir=function(q){Pq=null,Aq.call(process,q)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,Aq)}var Aq;iq.exports=lE;function lE(q){if(f.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))n(q);if(!q.lutimes)E(q);if(q.chown=O(q.chown),q.fchown=O(q.fchown),q.lchown=O(q.lchown),q.chmod=y(q.chmod),q.fchmod=y(q.fchmod),q.lchmod=y(q.lchmod),q.chownSync=_(q.chownSync),q.fchownSync=_(q.fchownSync),q.lchownSync=_(q.lchownSync),q.chmodSync=J(q.chmodSync),q.fchmodSync=J(q.fchmodSync),q.lchmodSync=J(q.lchmodSync),q.stat=U(q.stat),q.fstat=U(q.fstat),q.lstat=U(q.lstat),q.statSync=j(q.statSync),q.fstatSync=j(q.fstatSync),q.lstatSync=j(q.lstatSync),q.chmod&&!q.lchmod)q.lchmod=function(V,A,L){if(L)process.nextTick(L)},q.lchmodSync=function(){};if(q.chown&&!q.lchown)q.lchown=function(V,A,L,K){if(K)process.nextTick(K)},q.lchownSync=function(){};if(hE==="win32")q.rename=typeof q.rename!=="function"?q.rename:function(V){function A(L,K,P){var N=Date.now(),C=0;V(L,K,function R(h){if(h&&(h.code==="EACCES"||h.code==="EPERM"||h.code==="EBUSY")&&Date.now()-N<60000){if(setTimeout(function(){q.stat(K,function(m,Jq){if(m&&m.code==="ENOENT")V(L,K,R);else P(h)})},C),C<100)C+=10;return}if(P)P(h)})}if(Object.setPrototypeOf)Object.setPrototypeOf(A,V);return A}(q.rename);q.read=typeof q.read!=="function"?q.read:function(V){function A(L,K,P,N,C,R){var h;if(R&&typeof R==="function"){var m=0;h=function(Jq,gq,bq){if(Jq&&Jq.code==="EAGAIN"&&m<10)return m++,V.call(q,L,K,P,N,C,h);R.apply(this,arguments)}}return V.call(q,L,K,P,N,C,h)}if(Object.setPrototypeOf)Object.setPrototypeOf(A,V);return A}(q.read),q.readSync=typeof q.readSync!=="function"?q.readSync:function(V){return function(A,L,K,P,N){var C=0;while(!0)try{return V.call(q,A,L,K,P,N)}catch(R){if(R.code==="EAGAIN"&&C<10){C++;continue}throw R}}}(q.readSync);function n(V){V.lchmod=function(A,L,K){V.open(A,f.O_WRONLY|f.O_SYMLINK,L,function(P,N){if(P){if(K)K(P);return}V.fchmod(N,L,function(C){V.close(N,function(R){if(K)K(C||R)})})})},V.lchmodSync=function(A,L){var K=V.openSync(A,f.O_WRONLY|f.O_SYMLINK,L),P=!0,N;try{N=V.fchmodSync(K,L),P=!1}finally{if(P)try{V.closeSync(K)}catch(C){}else V.closeSync(K)}return N}}function E(V){if(f.hasOwnProperty("O_SYMLINK")&&V.futimes)V.lutimes=function(A,L,K,P){V.open(A,f.O_SYMLINK,function(N,C){if(N){if(P)P(N);return}V.futimes(C,L,K,function(R){V.close(C,function(h){if(P)P(R||h)})})})},V.lutimesSync=function(A,L,K){var P=V.openSync(A,f.O_SYMLINK),N,C=!0;try{N=V.futimesSync(P,L,K),C=!1}finally{if(C)try{V.closeSync(P)}catch(R){}else V.closeSync(P)}return N};else if(V.futimes)V.lutimes=function(A,L,K,P){if(P)process.nextTick(P)},V.lutimesSync=function(){}}function y(V){if(!V)return V;return function(A,L,K){return V.call(q,A,L,function(P){if($(P))P=null;if(K)K.apply(this,arguments)})}}function J(V){if(!V)return V;return function(A,L){try{return V.call(q,A,L)}catch(K){if(!$(K))throw K}}}function O(V){if(!V)return V;return function(A,L,K,P){return V.call(q,A,L,K,function(N){if($(N))N=null;if(P)P.apply(this,arguments)})}}function _(V){if(!V)return V;return function(A,L,K){try{return V.call(q,A,L,K)}catch(P){if(!$(P))throw P}}}function U(V){if(!V)return V;return function(A,L,K){if(typeof L==="function")K=L,L=null;function P(N,C){if(C){if(C.uid<0)C.uid+=4294967296;if(C.gid<0)C.gid+=4294967296}if(K)K.apply(this,arguments)}return L?V.call(q,A,L,P):V.call(q,A,P)}}function j(V){if(!V)return V;return function(A,L){var K=L?V.call(q,A,L):V.call(q,A);if(K){if(K.uid<0)K.uid+=4294967296;if(K.gid<0)K.gid+=4294967296}return K}}function $(V){if(!V)return!0;if(V.code==="ENOSYS")return!0;var A=!process.getuid||process.getuid()!==0;if(A){if(V.code==="EINVAL"||V.code==="EPERM")return!0}return!1}}});var cq=X((zO,pq)=>{var lq=Q("stream").Stream;pq.exports=pE;function pE(q){return{ReadStream:n,WriteStream:E};function n(y,J){if(!(this instanceof n))return new n(y,J);lq.call(this);var O=this;this.path=y,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,J=J||{};var _=Object.keys(J);for(var U=0,j=_.length;U<j;U++){var $=_[U];this[$]=J[$]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){O._read()});return}q.open(this.path,this.flags,this.mode,function(V,A){if(V){O.emit("error",V),O.readable=!1;return}O.fd=A,O.emit("open",A),O._read()})}function E(y,J){if(!(this instanceof E))return new E(y,J);lq.call(this),this.path=y,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,J=J||{};var O=Object.keys(J);for(var _=0,U=O.length;_<U;_++){var j=O[_];this[j]=J[j]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=q.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var fq=X((LO,oq)=>{oq.exports=oE;var cE=Object.getPrototypeOf||function(q){return q.__proto__};function oE(q){if(q===null||typeof q!=="object")return q;if(q instanceof Object)var n={__proto__:cE(q)};else var n=Object.create(null);return Object.getOwnPropertyNames(q).forEach(function(E){Object.defineProperty(n,E,Object.getOwnPropertyDescriptor(q,E))}),n}});var qq=X((PO,Iq)=>{var B=Q("fs"),fE=hq(),dE=cq(),rE=fq(),Gq=Q("util"),F,Yq;if(typeof Symbol==="function"&&typeof Symbol.for==="function")F=Symbol.for("graceful-fs.queue"),Yq=Symbol.for("graceful-fs.previous");else F="___graceful-fs.queue",Yq="___graceful-fs.previous";function aE(){}function rq(q,n){Object.defineProperty(q,F,{get:function(){return n}})}var e=aE;if(Gq.debuglog)e=Gq.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))e=function(){var q=Gq.format.apply(Gq,arguments);q="GFS4: "+q.split(/\n/).join(`
3
3
  GFS4: `),console.error(q)};if(!B[F]){if(wq=global[F]||[],rq(B,wq),B.close=function(q){function n(E,y){return q.call(B,E,function(J){if(!J)dq();if(typeof y==="function")y.apply(this,arguments)})}return Object.defineProperty(n,Yq,{value:q}),n}(B.close),B.closeSync=function(q){function n(E){q.apply(B,arguments),dq()}return Object.defineProperty(n,Yq,{value:q}),n}(B.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){e(B[F]),Q("assert").equal(B[F].length,0)})}var wq;if(!global[F])rq(global,B[F]);Iq.exports=Bq(rE(B));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!B.__patched)Iq.exports=Bq(B),B.__patched=!0;function Bq(q){fE(q),q.gracefulify=Bq,q.createReadStream=gq,q.createWriteStream=bq;var n=q.readFile;q.readFile=E;function E(z,Z,Y){if(typeof Z==="function")Y=Z,Z=null;return M(z,Z,Y);function M(T,I,w,D){return n(T,I,function(H){if(H&&(H.code==="EMFILE"||H.code==="ENFILE"))s([M,[T,I,w],H,D||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var y=q.writeFile;q.writeFile=J;function J(z,Z,Y,M){if(typeof Y==="function")M=Y,Y=null;return T(z,Z,Y,M);function T(I,w,D,H,k){return y(I,w,D,function(x){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))s([T,[I,w,D,H],x,k||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var O=q.appendFile;if(O)q.appendFile=_;function _(z,Z,Y,M){if(typeof Y==="function")M=Y,Y=null;return T(z,Z,Y,M);function T(I,w,D,H,k){return O(I,w,D,function(x){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))s([T,[I,w,D,H],x,k||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var U=q.copyFile;if(U)q.copyFile=j;function j(z,Z,Y,M){if(typeof Y==="function")M=Y,Y=0;return T(z,Z,Y,M);function T(I,w,D,H,k){return U(I,w,D,function(x){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))s([T,[I,w,D,H],x,k||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var $=q.readdir;q.readdir=A;var V=/^v[0-5]\./;function A(z,Z,Y){if(typeof Z==="function")Y=Z,Z=null;var M=V.test(process.version)?function I(w,D,H,k){return $(w,T(w,D,H,k))}:function I(w,D,H,k){return $(w,D,T(w,D,H,k))};return M(z,Z,Y);function T(I,w,D,H){return function(k,x){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))s([M,[I,w,D],k,H||Date.now(),Date.now()]);else{if(x&&x.sort)x.sort();if(typeof D==="function")D.call(this,k,x)}}}}if(process.version.substr(0,4)==="v0.8"){var L=dE(q);R=L.ReadStream,m=L.WriteStream}var K=q.ReadStream;if(K)R.prototype=Object.create(K.prototype),R.prototype.open=h;var P=q.WriteStream;if(P)m.prototype=Object.create(P.prototype),m.prototype.open=Jq;Object.defineProperty(q,"ReadStream",{get:function(){return R},set:function(z){R=z},enumerable:!0,configurable:!0}),Object.defineProperty(q,"WriteStream",{get:function(){return m},set:function(z){m=z},enumerable:!0,configurable:!0});var N=R;Object.defineProperty(q,"FileReadStream",{get:function(){return N},set:function(z){N=z},enumerable:!0,configurable:!0});var C=m;Object.defineProperty(q,"FileWriteStream",{get:function(){return C},set:function(z){C=z},enumerable:!0,configurable:!0});function R(z,Z){if(this instanceof R)return K.apply(this,arguments),this;else return R.apply(Object.create(R.prototype),arguments)}function h(){var z=this;Rq(z.path,z.flags,z.mode,function(Z,Y){if(Z){if(z.autoClose)z.destroy();z.emit("error",Z)}else z.fd=Y,z.emit("open",Y),z.read()})}function m(z,Z){if(this instanceof m)return P.apply(this,arguments),this;else return m.apply(Object.create(m.prototype),arguments)}function Jq(){var z=this;Rq(z.path,z.flags,z.mode,function(Z,Y){if(Z)z.destroy(),z.emit("error",Z);else z.fd=Y,z.emit("open",Y)})}function gq(z,Z){return new q.ReadStream(z,Z)}function bq(z,Z){return new q.WriteStream(z,Z)}var mE=q.open;q.open=Rq;function Rq(z,Z,Y,M){if(typeof Y==="function")M=Y,Y=null;return T(z,Z,Y,M);function T(I,w,D,H,k){return mE(I,w,D,function(x,VO){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))s([T,[I,w,D,H],x,k||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}return q}function s(q){e("ENQUEUE",q[0].name,q[1]),B[F].push(q),Dq()}var Xq;function dq(){var q=Date.now();for(var n=0;n<B[F].length;++n)if(B[F][n].length>2)B[F][n][3]=q,B[F][n][4]=q;Dq()}function Dq(){if(clearTimeout(Xq),Xq=void 0,B[F].length===0)return;var q=B[F].shift(),n=q[0],E=q[1],y=q[2],J=q[3],O=q[4];if(J===void 0)e("RETRY",n.name,E),n.apply(null,E);else if(Date.now()-J>=60000){e("TIMEOUT",n.name,E);var _=E.pop();if(typeof _==="function")_.call(null,y)}else{var U=Date.now()-O,j=Math.max(O-J,1),$=Math.min(j*1.2,100);if(U>=$)e("RETRY",n.name,E),n.apply(null,E.concat([J]));else B[F].push(q)}if(Xq===void 0)Xq=setTimeout(Dq,0)}});var g=X((uq)=>{var aq=u().fromCallback,S=qq(),eE=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter((q)=>{return typeof S[q]==="function"});Object.assign(uq,S);eE.forEach((q)=>{uq[q]=aq(S[q])});uq.exists=function(q,n){if(typeof n==="function")return S.exists(q,n);return new Promise((E)=>{return S.exists(q,E)})};uq.read=function(q,n,E,y,J,O){if(typeof O==="function")return S.read(q,n,E,y,J,O);return new Promise((_,U)=>{S.read(q,n,E,y,J,(j,$,V)=>{if(j)return U(j);_({bytesRead:$,buffer:V})})})};uq.write=function(q,n,...E){if(typeof E[E.length-1]==="function")return S.write(q,n,...E);return new Promise((y,J)=>{S.write(q,n,...E,(O,_,U)=>{if(O)return J(O);y({bytesWritten:_,buffer:U})})})};uq.readv=function(q,n,...E){if(typeof E[E.length-1]==="function")return S.readv(q,n,...E);return new Promise((y,J)=>{S.readv(q,n,...E,(O,_,U)=>{if(O)return J(O);y({bytesRead:_,buffers:U})})})};uq.writev=function(q,n,...E){if(typeof E[E.length-1]==="function")return S.writev(q,n,...E);return new Promise((y,J)=>{S.writev(q,n,...E,(O,_,U)=>{if(O)return J(O);y({bytesWritten:_,buffers:U})})})};if(typeof S.realpath.native==="function")uq.realpath.native=aq(S.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var tq=X((Jy,eq)=>{var yy=Q("path");Jy.checkPath=function q(n){if(process.platform==="win32"){if(/[<>:"|?*]/.test(n.replace(yy.parse(n).root,""))){let y=new Error(`Path contains invalid characters: ${n}`);throw y.code="EINVAL",y}}}});var En=X((_y,Qq)=>{var sq=g(),{checkPath:qn}=tq(),nn=(q)=>{let n={mode:511};if(typeof q==="number")return q;return{...n,...q}.mode};_y.makeDir=async(q,n)=>{return qn(q),sq.mkdir(q,{mode:nn(n),recursive:!0})};_y.makeDirSync=(q,n)=>{return qn(q),sq.mkdirSync(q,{mode:nn(n),recursive:!0})}});var l=X((XO,yn)=>{var Uy=u().fromPromise,{makeDir:zy,makeDirSync:Wq}=En(),Mq=Uy(zy);yn.exports={mkdirs:Mq,mkdirsSync:Wq,mkdirp:Mq,mkdirpSync:Wq,ensureDir:Mq,ensureDirSync:Wq}});var d=X((YO,On)=>{var Ly=u().fromPromise,Jn=g();function Py(q){return Jn.access(q).then(()=>!0).catch(()=>!1)}On.exports={pathExists:Ly(Py),pathExistsSync:Jn.existsSync}});var Tq=X((ZO,_n)=>{var nq=g(),Ay=u().fromPromise;async function Gy(q,n,E){let y=await nq.open(q,"r+"),J=null;try{await nq.futimes(y,n,E)}finally{try{await nq.close(y)}catch(O){J=O}}if(J)throw J}function Xy(q,n,E){let y=nq.openSync(q,"r+");return nq.futimesSync(y,n,E),nq.closeSync(y)}_n.exports={utimesMillis:Ay(Gy),utimesMillisSync:Xy}});var t=X((CO,zn)=>{var Eq=g(),W=Q("path"),Vn=u().fromPromise;function Yy(q,n,E){let y=E.dereference?(J)=>Eq.stat(J,{bigint:!0}):(J)=>Eq.lstat(J,{bigint:!0});return Promise.all([y(q),y(n).catch((J)=>{if(J.code==="ENOENT")return null;throw J})]).then(([J,O])=>({srcStat:J,destStat:O}))}function Zy(q,n,E){let y,J=E.dereference?(_)=>Eq.statSync(_,{bigint:!0}):(_)=>Eq.lstatSync(_,{bigint:!0}),O=J(q);try{y=J(n)}catch(_){if(_.code==="ENOENT")return{srcStat:O,destStat:null};throw _}return{srcStat:O,destStat:y}}async function Cy(q,n,E,y){let{srcStat:J,destStat:O}=await Yy(q,n,y);if(O){if(Oq(J,O)){let _=W.basename(q),U=W.basename(n);if(E==="move"&&_!==U&&_.toLowerCase()===U.toLowerCase())return{srcStat:J,destStat:O,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(J.isDirectory()&&!O.isDirectory())throw new Error(`Cannot overwrite non-directory '${n}' with directory '${q}'.`);if(!J.isDirectory()&&O.isDirectory())throw new Error(`Cannot overwrite directory '${n}' with non-directory '${q}'.`)}if(J.isDirectory()&&kq(q,n))throw new Error(Zq(q,n,E));return{srcStat:J,destStat:O}}function Hy(q,n,E,y){let{srcStat:J,destStat:O}=Zy(q,n,y);if(O){if(Oq(J,O)){let _=W.basename(q),U=W.basename(n);if(E==="move"&&_!==U&&_.toLowerCase()===U.toLowerCase())return{srcStat:J,destStat:O,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(J.isDirectory()&&!O.isDirectory())throw new Error(`Cannot overwrite non-directory '${n}' with directory '${q}'.`);if(!J.isDirectory()&&O.isDirectory())throw new Error(`Cannot overwrite directory '${n}' with non-directory '${q}'.`)}if(J.isDirectory()&&kq(q,n))throw new Error(Zq(q,n,E));return{srcStat:J,destStat:O}}async function Kn(q,n,E,y){let J=W.resolve(W.dirname(q)),O=W.resolve(W.dirname(E));if(O===J||O===W.parse(O).root)return;let _;try{_=await Eq.stat(O,{bigint:!0})}catch(U){if(U.code==="ENOENT")return;throw U}if(Oq(n,_))throw new Error(Zq(q,E,y));return Kn(q,n,O,y)}function Un(q,n,E,y){let J=W.resolve(W.dirname(q)),O=W.resolve(W.dirname(E));if(O===J||O===W.parse(O).root)return;let _;try{_=Eq.statSync(O,{bigint:!0})}catch(U){if(U.code==="ENOENT")return;throw U}if(Oq(n,_))throw new Error(Zq(q,E,y));return Un(q,n,O,y)}function Oq(q,n){return n.ino&&n.dev&&n.ino===q.ino&&n.dev===q.dev}function kq(q,n){let E=W.resolve(q).split(W.sep).filter((J)=>J),y=W.resolve(n).split(W.sep).filter((J)=>J);return E.every((J,O)=>y[O]===J)}function Zq(q,n,E){return`Cannot ${E} '${q}' to a subdirectory of itself, '${n}'.`}zn.exports={checkPaths:Vn(Cy),checkPathsSync:Hy,checkParentPaths:Vn(Kn),checkParentPathsSync:Un,isSrcSubdir:kq,areIdentical:Oq}});var Xn=X((HO,Gn)=>{var v=g(),_q=Q("path"),{mkdirs:Ny}=l(),{pathExists:xy}=d(),{utimesMillis:jy}=Tq(),Vq=t();async function Ry(q,n,E={}){if(typeof E==="function")E={filter:E};if(E.clobber="clobber"in E?!!E.clobber:!0,E.overwrite="overwrite"in E?!!E.overwrite:E.clobber,E.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
4
4
 
5
5
  see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:y,destStat:J}=await Vq.checkPaths(q,n,"copy",E);if(await Vq.checkParentPaths(q,y,n,"copy"),!await Pn(q,n,E))return;let _=_q.dirname(n);if(!await xy(_))await Ny(_);await An(J,q,n,E)}async function Pn(q,n,E){if(!E.filter)return!0;return E.filter(q,n)}async function An(q,n,E,y){let O=await(y.dereference?v.stat:v.lstat)(n);if(O.isDirectory())return Iy(O,q,n,E,y);if(O.isFile()||O.isCharacterDevice()||O.isBlockDevice())return wy(O,q,n,E,y);if(O.isSymbolicLink())return uy(q,n,E,y);if(O.isSocket())throw new Error(`Cannot copy a socket file: ${n}`);if(O.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${n}`);throw new Error(`Unknown file: ${n}`)}async function wy(q,n,E,y,J){if(!n)return Ln(q,E,y,J);if(J.overwrite)return await v.unlink(y),Ln(q,E,y,J);if(J.errorOnExist)throw new Error(`'${y}' already exists`)}async function Ln(q,n,E,y){if(await v.copyFile(n,E),y.preserveTimestamps){if(By(q.mode))await Dy(E,q.mode);let J=await v.stat(n);await jy(E,J.atime,J.mtime)}return v.chmod(E,q.mode)}function By(q){return(q&128)===0}function Dy(q,n){return v.chmod(q,n|128)}async function Iy(q,n,E,y,J){if(!n)await v.mkdir(y);let O=[];for await(let _ of await v.opendir(E)){let U=_q.join(E,_.name),j=_q.join(y,_.name);O.push(Pn(U,j,J).then(($)=>{if($)return Vq.checkPaths(U,j,"copy",J).then(({destStat:V})=>{return An(V,U,j,J)})}))}if(await Promise.all(O),!n)await v.chmod(y,q.mode)}async function uy(q,n,E,y){let J=await v.readlink(n);if(y.dereference)J=_q.resolve(process.cwd(),J);if(!q)return v.symlink(J,E);let O=null;try{O=await v.readlink(E)}catch(_){if(_.code==="EINVAL"||_.code==="UNKNOWN")return v.symlink(J,E);throw _}if(y.dereference)O=_q.resolve(process.cwd(),O);if(Vq.isSrcSubdir(J,O))throw new Error(`Cannot copy '${J}' to a subdirectory of itself, '${O}'.`);if(Vq.isSrcSubdir(O,J))throw new Error(`Cannot overwrite '${O}' with '${J}'.`);return await v.unlink(E),v.symlink(J,E)}Gn.exports=Ry});var Nn=X((NO,Hn)=>{var b=qq(),Kq=Q("path"),Qy=l().mkdirsSync,Wy=Tq().utimesMillisSync,Uq=t();function My(q,n,E){if(typeof E==="function")E={filter:E};if(E=E||{},E.clobber="clobber"in E?!!E.clobber:!0,E.overwrite="overwrite"in E?!!E.overwrite:E.clobber,E.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
@@ -0,0 +1 @@
1
+ class n extends Error{constructor(t,e=!0){let o,r=!0;if(typeof e==="boolean")o=void 0,r=e;else if(e!=null&&typeof e==="object")o=e.logger,r=e.tryNextLink??!0;super(t);this.name="ProviderError",this.tryNextLink=r,Object.setPrototypeOf(this,n.prototype),o?.debug?.(`@smithy/property-provider ${r?"->":"(!)"} ${t}`)}static from(t,e=!0){return Object.assign(new this(t.message,e),t)}}class u extends n{constructor(t,e=!0){super(t,e);this.name="CredentialsProviderError",Object.setPrototypeOf(this,u.prototype)}}class l extends n{constructor(t,e=!0){super(t,e);this.name="TokenProviderError",Object.setPrototypeOf(this,l.prototype)}}var v=(...t)=>async()=>{if(t.length===0)throw new n("No providers in chain");let e;for(let o of t)try{return await o()}catch(r){if(e=r,r?.tryNextLink)continue;throw r}throw e};var w=(t)=>()=>Promise.resolve(t);var b=(t,e,o)=>{let r,i,s,f=!1,a=async()=>{if(!i)i=t();try{r=await i,s=!0,f=!1}finally{i=void 0}return r};if(e===void 0)return async(c)=>{if(!s||c?.forceRefresh)r=await a();return r};return async(c)=>{if(!s||c?.forceRefresh)r=await a();if(f)return r;if(o&&!o(r))return f=!0,r;if(e(r))return await a(),r;return r}};export{n as Kc,u as Lc,l as Mc,v as Nc,w as Oc,b as Pc};