@stacksjs/buddy 0.68.2 → 0.69.2

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 (188) hide show
  1. package/README.md +1 -1
  2. package/dist/chunk-0ara6h0a.js +2 -0
  3. package/dist/chunk-0pxb6cz2.js +3 -0
  4. package/dist/chunk-1v5v7cn7.js +2 -0
  5. package/dist/chunk-3v3zq8w4.js +2 -0
  6. package/dist/{chunk-jr4naxsv.js → chunk-3yp4xe8e.js} +1 -1
  7. package/dist/{chunk-3wpw5xgd.js → chunk-5d1pmfaj.js} +1 -1
  8. package/dist/chunk-7dhp3rzj.js +61 -0
  9. package/dist/chunk-8y9rns0z.js +2 -0
  10. package/dist/chunk-c0awzy8k.js +10 -0
  11. package/dist/chunk-c6ermrr1.js +3 -0
  12. package/dist/{chunk-8gx9at51.js → chunk-cdnqz7bt.js} +1 -1
  13. package/dist/{chunk-27ksm11g.js → chunk-f0ywgmn1.js} +2 -2
  14. package/dist/chunk-fzqy272g.js +2 -0
  15. package/dist/chunk-hmvbpz4z.js +25 -0
  16. package/dist/chunk-kqn7aa4r.js +5442 -0
  17. package/dist/chunk-n337bav6.js +5 -0
  18. package/dist/chunk-rez6aknn.js +29 -0
  19. package/dist/chunk-rvzykrtp.js +10 -0
  20. package/dist/{chunk-b3wr7cpk.js → chunk-tnqbven5.js} +2 -2
  21. package/dist/{chunk-25nxsybw.js → chunk-vs0pve8j.js} +2 -2
  22. package/dist/{chunk-hgrs6wcy.js → chunk-x4zbf5c8.js} +1 -1
  23. package/dist/{chunk-z1h35hsa.js → chunk-xqcyxfy4.js} +2 -1
  24. package/dist/{chunk-0q0jn0kk.js → chunk-yajm5bx9.js} +1 -1
  25. package/dist/chunk-ybkvyfqx.js +2 -0
  26. package/dist/{chunk-f0ksrase.js → chunk-zmz07e1t.js} +2 -2
  27. package/dist/chunk-zxexe5eh.js +2 -0
  28. package/dist/cli.js +1 -1
  29. package/dist/index.js +1 -1
  30. package/dist/ports.d.ts +0 -1
  31. package/dist/queue.d.ts +3 -0
  32. package/dist/schedule.d.ts +3 -0
  33. package/dist/search.d.ts +3 -0
  34. package/package.json +54 -55
  35. package/dist/chunk-06g79v9j.js +0 -2
  36. package/dist/chunk-08bm2xax.js +0 -2
  37. package/dist/chunk-0enrsn65.js +0 -978
  38. package/dist/chunk-0m218zhk.js +0 -2
  39. package/dist/chunk-0qvaepnz.js +0 -2
  40. package/dist/chunk-0yyhz107.js +0 -2
  41. package/dist/chunk-11vhe2za.js +0 -2
  42. package/dist/chunk-13143jmy.js +0 -3
  43. package/dist/chunk-1agj4qty.js +0 -2
  44. package/dist/chunk-1c4yywmn.js +0 -9
  45. package/dist/chunk-1e2f0z80.js +0 -2
  46. package/dist/chunk-1v13dkfw.js +0 -2
  47. package/dist/chunk-20e0mpcw.js +0 -9
  48. package/dist/chunk-2mhj5ght.js +0 -2
  49. package/dist/chunk-2wrs9p57.js +0 -1
  50. package/dist/chunk-2yj4j69j.js +0 -2
  51. package/dist/chunk-2ymn50ck.js +0 -2
  52. package/dist/chunk-3vjfkr7v.js +0 -978
  53. package/dist/chunk-3y0gapf6.js +0 -2
  54. package/dist/chunk-4rb5r88h.js +0 -978
  55. package/dist/chunk-4wb68jfr.js +0 -2
  56. package/dist/chunk-5ewcj9vd.js +0 -2
  57. package/dist/chunk-5fm9mfqs.js +0 -2
  58. package/dist/chunk-5jhkn5by.js +0 -2
  59. package/dist/chunk-5m9xts4v.js +0 -2
  60. package/dist/chunk-63pxna7y.js +0 -978
  61. package/dist/chunk-6sqy7049.js +0 -2
  62. package/dist/chunk-6yazdvb4.js +0 -2
  63. package/dist/chunk-746p83dw.js +0 -2
  64. package/dist/chunk-76g7tr80.js +0 -2
  65. package/dist/chunk-7fz1p8p3.js +0 -10
  66. package/dist/chunk-814adsn3.js +0 -2
  67. package/dist/chunk-831wk0b3.js +0 -2
  68. package/dist/chunk-833tanrb.js +0 -2
  69. package/dist/chunk-8cx90pvv.js +0 -2
  70. package/dist/chunk-8yky4bsd.js +0 -10
  71. package/dist/chunk-91pnyybg.js +0 -9
  72. package/dist/chunk-99syj1p0.js +0 -2
  73. package/dist/chunk-9bxh78vd.js +0 -5
  74. package/dist/chunk-9jaqey2q.js +0 -2
  75. package/dist/chunk-9tyaew40.js +0 -2
  76. package/dist/chunk-9zcyq5gh.js +0 -2
  77. package/dist/chunk-a4g1e1n0.js +0 -2
  78. package/dist/chunk-a6g2jk1y.js +0 -2
  79. package/dist/chunk-aaqd43t5.js +0 -2
  80. package/dist/chunk-adswb3gq.js +0 -2
  81. package/dist/chunk-akkmfscs.js +0 -978
  82. package/dist/chunk-atnw2cq3.js +0 -2
  83. package/dist/chunk-avdharmq.js +0 -2
  84. package/dist/chunk-b13gbfg3.js +0 -2
  85. package/dist/chunk-bngyck4v.js +0 -2
  86. package/dist/chunk-brb5zthb.js +0 -1
  87. package/dist/chunk-bx2vf8g7.js +0 -5
  88. package/dist/chunk-c343n0yt.js +0 -2
  89. package/dist/chunk-c4msw6hf.js +0 -2
  90. package/dist/chunk-cdwpqzrw.js +0 -2
  91. package/dist/chunk-cm7bwdk9.js +0 -2
  92. package/dist/chunk-cs5k02gt.js +0 -1
  93. package/dist/chunk-cv8f2v27.js +0 -2
  94. package/dist/chunk-d2dbhn2h.js +0 -2
  95. package/dist/chunk-d3awsfqm.js +0 -9
  96. package/dist/chunk-d9q17hb8.js +0 -2
  97. package/dist/chunk-dw62d69f.js +0 -2
  98. package/dist/chunk-e8p8v7ca.js +0 -978
  99. package/dist/chunk-ehhrhkwe.js +0 -9
  100. package/dist/chunk-enhf12a1.js +0 -2
  101. package/dist/chunk-f2d9w3nr.js +0 -2
  102. package/dist/chunk-f3y73e4b.js +0 -6
  103. package/dist/chunk-fe3xb8z9.js +0 -2
  104. package/dist/chunk-fg5gh4dn.js +0 -2
  105. package/dist/chunk-fh4rw8kr.js +0 -5
  106. package/dist/chunk-fxsv4p5c.js +0 -8
  107. package/dist/chunk-gezc36zy.js +0 -2
  108. package/dist/chunk-gg80s18j.js +0 -2
  109. package/dist/chunk-gjefq0nq.js +0 -2
  110. package/dist/chunk-h5saw32v.js +0 -2
  111. package/dist/chunk-ha75r57f.js +0 -8
  112. package/dist/chunk-hrsat16n.js +0 -8
  113. package/dist/chunk-hxy5t7tm.js +0 -10
  114. package/dist/chunk-hzfqtj82.js +0 -2
  115. package/dist/chunk-j2n86dsz.js +0 -2
  116. package/dist/chunk-jbpgmjzs.js +0 -2
  117. package/dist/chunk-jg68fsnk.js +0 -10
  118. package/dist/chunk-jhvjhf1j.js +0 -2
  119. package/dist/chunk-jms0s1vh.js +0 -6
  120. package/dist/chunk-js6y6fm1.js +0 -2
  121. package/dist/chunk-jtax0mpm.js +0 -2
  122. package/dist/chunk-k59kbbvm.js +0 -2
  123. package/dist/chunk-kanz993c.js +0 -2
  124. package/dist/chunk-kg9abatp.js +0 -2
  125. package/dist/chunk-kvghsjg7.js +0 -5
  126. package/dist/chunk-ky8p46ae.js +0 -5
  127. package/dist/chunk-kzm498bh.js +0 -2
  128. package/dist/chunk-m4gwjnfh.js +0 -6
  129. package/dist/chunk-m6regb6b.js +0 -2
  130. package/dist/chunk-mevackhg.js +0 -9
  131. package/dist/chunk-msv6dcc2.js +0 -2
  132. package/dist/chunk-mxdajhb4.js +0 -10
  133. package/dist/chunk-mxzjn2gs.js +0 -978
  134. package/dist/chunk-n1bqkqk7.js +0 -10
  135. package/dist/chunk-n2c2dcxa.js +0 -2
  136. package/dist/chunk-njtyervf.js +0 -1
  137. package/dist/chunk-nx1598yr.js +0 -2
  138. package/dist/chunk-p18kqenr.js +0 -1
  139. package/dist/chunk-p23aswbf.js +0 -2
  140. package/dist/chunk-p55ntqj0.js +0 -2
  141. package/dist/chunk-p5va3trj.js +0 -2
  142. package/dist/chunk-p88bsqtc.js +0 -10
  143. package/dist/chunk-p9z7f8c8.js +0 -2
  144. package/dist/chunk-ppkzf21q.js +0 -8
  145. package/dist/chunk-prqq5zw2.js +0 -2
  146. package/dist/chunk-pv6hp18q.js +0 -10
  147. package/dist/chunk-q9ycfthp.js +0 -2
  148. package/dist/chunk-qhcx6dmf.js +0 -2
  149. package/dist/chunk-qma4ysd8.js +0 -9
  150. package/dist/chunk-qpdxnnf8.js +0 -10
  151. package/dist/chunk-qq851psj.js +0 -6
  152. package/dist/chunk-qqp394c2.js +0 -2
  153. package/dist/chunk-qzxab3cn.js +0 -2
  154. package/dist/chunk-r6rhrt1p.js +0 -2
  155. package/dist/chunk-ra5sfgg4.js +0 -2
  156. package/dist/chunk-rfd43z7p.js +0 -5
  157. package/dist/chunk-rtfeef82.js +0 -2
  158. package/dist/chunk-ryjbc6dz.js +0 -5
  159. package/dist/chunk-s2n3hw0a.js +0 -2
  160. package/dist/chunk-scc3z70n.js +0 -2
  161. package/dist/chunk-sk3x55wm.js +0 -2
  162. package/dist/chunk-sm7vvfqf.js +0 -2
  163. package/dist/chunk-sqbdav33.js +0 -2
  164. package/dist/chunk-sy4d4hnx.js +0 -2
  165. package/dist/chunk-t0b356bb.js +0 -978
  166. package/dist/chunk-t9wdnzz4.js +0 -6
  167. package/dist/chunk-v25g7h01.js +0 -2
  168. package/dist/chunk-v7zy7xda.js +0 -1
  169. package/dist/chunk-v9kknk69.js +0 -2
  170. package/dist/chunk-vg4vfkzk.js +0 -6
  171. package/dist/chunk-vgcre8jy.js +0 -2
  172. package/dist/chunk-vqyngnj0.js +0 -9
  173. package/dist/chunk-w17d2rbd.js +0 -6
  174. package/dist/chunk-x22v9kvb.js +0 -2
  175. package/dist/chunk-xacjs4ar.js +0 -6
  176. package/dist/chunk-xmdbxa8w.js +0 -1
  177. package/dist/chunk-xy6hjazn.js +0 -978
  178. package/dist/chunk-y0m35t3m.js +0 -2
  179. package/dist/chunk-y1tre8v8.js +0 -8
  180. package/dist/chunk-y50mc7dt.js +0 -2
  181. package/dist/chunk-y5vqt054.js +0 -5
  182. package/dist/chunk-y93ke5m6.js +0 -2
  183. package/dist/chunk-yktee4wv.js +0 -1
  184. package/dist/chunk-yvmyw2r2.js +0 -2
  185. package/dist/chunk-z6xydw90.js +0 -2
  186. package/dist/chunk-zak32nab.js +0 -2
  187. package/dist/chunk-zanq4wm3.js +0 -9
  188. package/dist/stacks +0 -0
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$ as pe,M as Le,N as Me,O as We,P as Ae,Q as ys,R as F,S as Ke,T as V,U as O,V as N,W as f,X as x,Y as Qe,Z as ie,_ as le,aa as ye,ba as Xe,ca as Ye,da as ds,ea as ns,fa as Ze,ga as me,ha as he,ia as Te,ja as ue,ka as He,la as ke,ma as Re,na as te,oa as re,pa as Ee,qa as qe,ra as ae,sa as de,ta as Se,ua as Ie,va as Pe}from"./chunk-7fz1p8p3.js";import{wa as l,xa as ee}from"./chunk-kzm498bh.js";import{Ka as je,La as os,Ma as R,Qa as D,Ra as fe,Sa as h,Wa as Ve,Xa as u,Ya as ge,Za as we,_a as be,ab as $e,bb as Je,db as es,eb as se,fb as i,gb as y,hb as ss,ib as xe,jb as ve,ya as Ue,za as _e}from"./chunk-fh4rw8kr.js";import"./chunk-cs5k02gt.js";import"./chunk-2wrs9p57.js";import"./chunk-ppkzf21q.js";import"./chunk-3wpw5xgd.js";import{Gb as c}from"./chunk-0m218zhk.js";var p=c(F(),1);var _=c(x(),1),v=c(ys(),1),$=async(e,s,t)=>{return{operation:v.getSmithyContext(s).operation,region:await v.normalizeProvider(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};function ms(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:e.region},propertiesExtractor:(s,t)=>({signingProperties:{config:s,context:t}})}}function b(e){return{schemeId:"smithy.api#noAuth"}}var J=(e)=>{let s=[];switch(e.operation){case"GetRoleCredentials":{s.push(b(e));break}case"ListAccountRoles":{s.push(b(e));break}case"ListAccounts":{s.push(b(e));break}case"Logout":{s.push(b(e));break}default:s.push(ms(e))}return s},I=(e)=>{return{..._.resolveAwsSdkSigV4Config(e)}};var P=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}},C={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var L={name:"@aws-sdk/client-sso",description:"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",version:"3.679.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.679.0","@aws-sdk/middleware-host-header":"3.679.0","@aws-sdk/middleware-logger":"3.679.0","@aws-sdk/middleware-recursion-detection":"3.679.0","@aws-sdk/middleware-user-agent":"3.679.0","@aws-sdk/region-config-resolver":"3.679.0","@aws-sdk/types":"3.679.0","@aws-sdk/util-endpoints":"3.679.0","@aws-sdk/util-user-agent-browser":"3.679.0","@aws-sdk/util-user-agent-node":"3.679.0","@smithy/config-resolver":"^3.0.9","@smithy/core":"^2.4.8","@smithy/fetch-http-handler":"^3.2.9","@smithy/hash-node":"^3.0.7","@smithy/invalid-dependency":"^3.0.7","@smithy/middleware-content-length":"^3.0.9","@smithy/middleware-endpoint":"^3.1.4","@smithy/middleware-retry":"^3.0.23","@smithy/middleware-serde":"^3.0.7","@smithy/middleware-stack":"^3.0.7","@smithy/node-config-provider":"^3.1.8","@smithy/node-http-handler":"^3.2.4","@smithy/protocol-http":"^4.1.4","@smithy/smithy-client":"^3.4.0","@smithy/types":"^3.5.0","@smithy/url-parser":"^3.0.7","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.23","@smithy/util-defaults-mode-node":"^3.0.23","@smithy/util-endpoints":"^2.1.3","@smithy/util-middleware":"^3.0.7","@smithy/util-retry":"^3.0.7","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso"}};var ze=c(x(),1);var ne=c(x(),1),oe=c(F(),1);var M={["required"]:!1,type:"String"},W={["required"]:!0,default:!1,type:"Boolean"},A={["ref"]:"Endpoint"},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},j={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},n={},K={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},H={["ref"]:"PartitionResult"},Q={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[H,"supportsDualStack"]}]},X=[T],Y=[j],Z=[{["ref"]:"Region"}],us={version:"1.0",parameters:{Region:M,UseDualStack:W,UseFIPS:W,Endpoint:M},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[A]}],rules:[{conditions:X,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:Y,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:A,properties:n,headers:n},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:Z}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:Z,assign:"PartitionResult"}],rules:[{conditions:[T,j],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,K]},Q],rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:X,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[K,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[H,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:n,headers:n},type:"endpoint"},{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:Y,rules:[{conditions:[Q],rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},G=us;var ws=new V({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),g=(e,s={})=>{return ws.get(e,()=>N(G,{endpointParams:e,logger:s.logger}))};O.aws=f;var ce=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??ae,base64Encoder:e?.base64Encoder??de,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??g,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??J,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new ne.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new oe.NoAuthSigner}],logger:e?.logger??new se,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??ee,utf8Decoder:e?.utf8Decoder??te,utf8Encoder:e?.utf8Encoder??re}};var De=(e)=>{be(process.version);let s=Se(e),t=()=>s().then(we),r=ce(e);return ze.emitWarningIfUnsupportedVersion(process.version),{...r,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??qe,defaultUserAgentProvider:e?.defaultUserAgentProvider??ke({serviceId:r.serviceId,clientVersion:L.version}),maxAttempts:e?.maxAttempts??l(he),region:e?.region??l(pe,ye),requestHandler:xe.create(e?.requestHandler??t),retryMode:e?.retryMode??l({...ue,default:async()=>(await t()).retryMode||me}),sha256:e?.sha256??Ee.bind(null,"sha256"),streamCollector:e?.streamCollector??ve,useDualstackEndpoint:e?.useDualstackEndpoint??l(ie),useFipsEndpoint:e?.useFipsEndpoint??l(le),userAgentAppId:e?.userAgentAppId??l(Re)}};var Be=(e)=>{let{httpAuthSchemes:s,httpAuthSchemeProvider:t,credentials:r}=e;return{setHttpAuthScheme(a){let d=s.findIndex((B)=>B.schemeId===a.schemeId);if(d===-1)s.push(a);else s.splice(d,1,a)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(a){t=a},httpAuthSchemeProvider(){return t},setCredentials(a){r=a},credentials(){return r}}},Fe=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var k=(e)=>e,Ce=(e,s)=>{let t={...k(Ie(e)),...k($e(e)),...k(Ue(e)),...k(Be(e))};return s.forEach((r)=>r.configure(t)),{...e,...Pe(t),...Je(t),..._e(t),...Fe(t)}};class Ge extends je{constructor(...[e]){let s=De(e||{}),t=P(s),r=Ke(t),a=Te(r),d=Xe(a),B=Le(d),is=Ze(B),ls=I(is),U=Ce(ls,e?.extensions||[]);super(U);this.config=U,this.middlewareStack.use(Qe(this.config)),this.middlewareStack.use(He(this.config)),this.middlewareStack.use(Ye(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(We(this.config)),this.middlewareStack.use(Ae(this.config)),this.middlewareStack.use(p.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:$,identityProviderConfigProvider:async(ps)=>new p.DefaultIdentityProviderConfig({"aws.auth#sigv4":ps.credentials})})),this.middlewareStack.use(p.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class o extends Ve{constructor(e){super(e);Object.setPrototypeOf(this,o.prototype)}}class E extends o{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,E.prototype)}}class q extends o{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,q.prototype)}}class S extends o{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e});this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,S.prototype)}}class z extends o{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e});this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,z.prototype)}}var Oe=(e)=>({...e,...e.accessToken&&{accessToken:R}}),bs=(e)=>({...e,...e.secretAccessKey&&{secretAccessKey:R},...e.sessionToken&&{sessionToken:R}}),Ne=(e)=>({...e,...e.roleCredentials&&{roleCredentials:bs(e.roleCredentials)}});var m=c(x(),1),ts=c(F(),1);var rs=async(e,s)=>{let t=ts.requestBuilder(e,s),r=i({},es,{[Us]:e[zs]});t.bp("/federation/credentials");let a=i({[Fs]:[,D(e[Bs],"roleName")],[Ds]:[,D(e[Ss],"accountId")]}),d;return t.m("GET").h(r).q(a).b(d),t.build()};var as=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return xs(e,s);let t=i({$metadata:w(e)}),r=D(fe(await m.parseJsonBody(e.body,s)),"body"),a=y(r,{roleCredentials:ss});return Object.assign(t,a),t};var xs=async(e,s)=>{let t={...e,body:await m.parseJsonErrorBody(e.body,s)},r=m.loadRestJsonErrorCode(e,t.body);switch(r){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await ks(t,s);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await Rs(t,s);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await Es(t,s);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await qs(t,s);default:let a=t.body;return vs({output:e,parsedBody:a,errorCode:r})}},vs=ge(o),ks=async(e,s)=>{let t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);let d=new E({$metadata:w(e),...t});return u(d,e.body)},Rs=async(e,s)=>{let t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);let d=new q({$metadata:w(e),...t});return u(d,e.body)},Es=async(e,s)=>{let t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);let d=new S({$metadata:w(e),...t});return u(d,e.body)},qs=async(e,s)=>{let t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);let d=new z({$metadata:w(e),...t});return u(d,e.body)},w=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var Ss="accountId",zs="accessToken",Ds="account_id";var Bs="roleName",Fs="role_name",Us="x-amz-sso_bearer_token";class cs extends os.classBuilder().ep(C).m(function(e,s,t,r){return[ds(t,this.serialize,this.deserialize),ns(t,e.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(Oe,Ne).ser(rs).de(as).build(){}export{Ge as SSOClient,cs as GetRoleCredentialsCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Cb as e6,Eb as P}from"./chunk-p9z7f8c8.js";var N=P((nO)=>{nO.fromCallback=function(q){return Object.defineProperty(function(...J){if(typeof J[J.length-1]==="function")q.apply(this,J);else return new Promise((O,z)=>{J.push((U,X)=>U!=null?z(U):O(X)),q.apply(this,J)})},"name",{value:q.name})};nO.fromPromise=function(q){return Object.defineProperty(function(...J){let O=J[J.length-1];if(typeof O!=="function")return q.apply(this,J);else J.pop(),q.apply(this,J).then((z)=>O(null,z),O)},"name",{value:q.name})}});var mq=P((Z4,bq)=>{var d=import.meta.require("constants"),gO=process.cwd,Hq=null,bO=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!Hq)Hq=gO.call(process);return Hq};try{process.cwd()}catch(q){}if(typeof process.chdir==="function"){if(jq=process.chdir,process.chdir=function(q){Hq=null,jq.call(process,q)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,jq)}var jq;bq.exports=mO;function mO(q){if(d.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))J(q);if(!q.lutimes)O(q);if(q.chown=X(q.chown),q.fchown=X(q.fchown),q.lchown=X(q.lchown),q.chmod=z(q.chmod),q.fchmod=z(q.fchmod),q.lchmod=z(q.lchmod),q.chownSync=Y(q.chownSync),q.fchownSync=Y(q.fchownSync),q.lchownSync=Y(q.lchownSync),q.chmodSync=U(q.chmodSync),q.fchmodSync=U(q.fchmodSync),q.lchmodSync=U(q.lchmodSync),q.stat=K(q.stat),q.fstat=K(q.fstat),q.lstat=K(q.lstat),q.statSync=j(q.statSync),q.fstatSync=j(q.fstatSync),q.lstatSync=j(q.lstatSync),q.chmod&&!q.lchmod)q.lchmod=function(Z,V,H){if(H)process.nextTick(H)},q.lchmodSync=function(){};if(q.chown&&!q.lchown)q.lchown=function(Z,V,H,G){if(G)process.nextTick(G)},q.lchownSync=function(){};if(bO==="win32")q.rename=typeof q.rename!=="function"?q.rename:function(Z){function V(H,G,L){var C=Date.now(),w=0;Z(H,G,function R(h){if(h&&(h.code==="EACCES"||h.code==="EPERM"||h.code==="EBUSY")&&Date.now()-C<60000){if(setTimeout(function(){q.stat(G,function(v,zq){if(v&&v.code==="ENOENT")Z(H,G,R);else L(h)})},w),w<100)w+=10;return}if(L)L(h)})}if(Object.setPrototypeOf)Object.setPrototypeOf(V,Z);return V}(q.rename);q.read=typeof q.read!=="function"?q.read:function(Z){function V(H,G,L,C,w,R){var h;if(R&&typeof R==="function"){var v=0;h=function(zq,Sq,gq){if(zq&&zq.code==="EAGAIN"&&v<10)return v++,Z.call(q,H,G,L,C,w,h);R.apply(this,arguments)}}return Z.call(q,H,G,L,C,w,h)}if(Object.setPrototypeOf)Object.setPrototypeOf(V,Z);return V}(q.read),q.readSync=typeof q.readSync!=="function"?q.readSync:function(Z){return function(V,H,G,L,C){var w=0;while(!0)try{return Z.call(q,V,H,G,L,C)}catch(R){if(R.code==="EAGAIN"&&w<10){w++;continue}throw R}}}(q.readSync);function J(Z){Z.lchmod=function(V,H,G){Z.open(V,d.O_WRONLY|d.O_SYMLINK,H,function(L,C){if(L){if(G)G(L);return}Z.fchmod(C,H,function(w){Z.close(C,function(R){if(G)G(w||R)})})})},Z.lchmodSync=function(V,H){var G=Z.openSync(V,d.O_WRONLY|d.O_SYMLINK,H),L=!0,C;try{C=Z.fchmodSync(G,H),L=!1}finally{if(L)try{Z.closeSync(G)}catch(w){}else Z.closeSync(G)}return C}}function O(Z){if(d.hasOwnProperty("O_SYMLINK")&&Z.futimes)Z.lutimes=function(V,H,G,L){Z.open(V,d.O_SYMLINK,function(C,w){if(C){if(L)L(C);return}Z.futimes(w,H,G,function(R){Z.close(w,function(h){if(L)L(R||h)})})})},Z.lutimesSync=function(V,H,G){var L=Z.openSync(V,d.O_SYMLINK),C,w=!0;try{C=Z.futimesSync(L,H,G),w=!1}finally{if(w)try{Z.closeSync(L)}catch(R){}else Z.closeSync(L)}return C};else if(Z.futimes)Z.lutimes=function(V,H,G,L){if(L)process.nextTick(L)},Z.lutimesSync=function(){}}function z(Z){if(!Z)return Z;return function(V,H,G){return Z.call(q,V,H,function(L){if(n(L))L=null;if(G)G.apply(this,arguments)})}}function U(Z){if(!Z)return Z;return function(V,H){try{return Z.call(q,V,H)}catch(G){if(!n(G))throw G}}}function X(Z){if(!Z)return Z;return function(V,H,G,L){return Z.call(q,V,H,G,function(C){if(n(C))C=null;if(L)L.apply(this,arguments)})}}function Y(Z){if(!Z)return Z;return function(V,H,G){try{return Z.call(q,V,H,G)}catch(L){if(!n(L))throw L}}}function K(Z){if(!Z)return Z;return function(V,H,G){if(typeof H==="function")G=H,H=null;function L(C,w){if(w){if(w.uid<0)w.uid+=4294967296;if(w.gid<0)w.gid+=4294967296}if(G)G.apply(this,arguments)}return H?Z.call(q,V,H,L):Z.call(q,V,L)}}function j(Z){if(!Z)return Z;return function(V,H){var G=H?Z.call(q,V,H):Z.call(q,V);if(G){if(G.uid<0)G.uid+=4294967296;if(G.gid<0)G.gid+=4294967296}return G}}function n(Z){if(!Z)return!0;if(Z.code==="ENOSYS")return!0;var V=!process.getuid||process.getuid()!==0;if(V){if(Z.code==="EINVAL"||Z.code==="EPERM")return!0}return!1}}});var lq=P((G4,iq)=>{var hq=import.meta.require("stream").Stream;iq.exports=hO;function hO(q){return{ReadStream:J,WriteStream:O};function J(z,U){if(!(this instanceof J))return new J(z,U);hq.call(this);var X=this;this.path=z,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,U=U||{};var Y=Object.keys(U);for(var K=0,j=Y.length;K<j;K++){var n=Y[K];this[n]=U[n]}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(){X._read()});return}q.open(this.path,this.flags,this.mode,function(Z,V){if(Z){X.emit("error",Z),X.readable=!1;return}X.fd=V,X.emit("open",V),X._read()})}function O(z,U){if(!(this instanceof O))return new O(z,U);hq.call(this),this.path=z,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,U=U||{};var X=Object.keys(U);for(var Y=0,K=X.length;Y<K;Y++){var j=X[Y];this[j]=U[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 cq=P((K4,pq)=>{pq.exports=lO;var iO=Object.getPrototypeOf||function(q){return q.__proto__};function lO(q){if(q===null||typeof q!=="object")return q;if(q instanceof Object)var J={__proto__:iO(q)};else var J=Object.create(null);return Object.getOwnPropertyNames(q).forEach(function(O){Object.defineProperty(J,O,Object.getOwnPropertyDescriptor(q,O))}),J}});var s=P((_4,yq)=>{var y=import.meta.require("fs"),pO=mq(),cO=lq(),dO=cq(),Lq=import.meta.require("util"),k,Vq;if(typeof Symbol==="function"&&typeof Symbol.for==="function")k=Symbol.for("graceful-fs.queue"),Vq=Symbol.for("graceful-fs.previous");else k="___graceful-fs.queue",Vq="___graceful-fs.previous";function fO(){}function oq(q,J){Object.defineProperty(q,k,{get:function(){return J}})}var a=fO;if(Lq.debuglog)a=Lq.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))a=function(){var q=Lq.format.apply(Lq,arguments);q="GFS4: "+q.split(/\n/).join("\nGFS4: "),console.error(q)};if(!y[k]){if(dq=global[k]||[],oq(y,dq),y.close=function(q){function J(O,z){return q.call(y,O,function(U){if(!U)fq();if(typeof z==="function")z.apply(this,arguments)})}return Object.defineProperty(J,Vq,{value:q}),J}(y.close),y.closeSync=function(q){function J(O){q.apply(y,arguments),fq()}return Object.defineProperty(J,Vq,{value:q}),J}(y.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){a(y[k]),import.meta.require("assert").equal(y[k].length,0)})}var dq;if(!global[k])oq(global,y[k]);yq.exports=Rq(dO(y));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!y.__patched)yq.exports=Rq(y),y.__patched=!0;function Rq(q){pO(q),q.gracefulify=Rq,q.createReadStream=Sq,q.createWriteStream=gq;var J=q.readFile;q.readFile=O;function O(_,x,A){if(typeof x==="function")A=x,x=null;return T(_,x,A);function T(F,I,Q,W){return J(F,I,function(B){if(B&&(B.code==="EMFILE"||B.code==="ENFILE"))t([T,[F,I,Q],B,W||Date.now(),Date.now()]);else if(typeof Q==="function")Q.apply(this,arguments)})}}var z=q.writeFile;q.writeFile=U;function U(_,x,A,T){if(typeof A==="function")T=A,A=null;return F(_,x,A,T);function F(I,Q,W,B,$){return z(I,Q,W,function(D){if(D&&(D.code==="EMFILE"||D.code==="ENFILE"))t([F,[I,Q,W,B],D,$||Date.now(),Date.now()]);else if(typeof B==="function")B.apply(this,arguments)})}}var X=q.appendFile;if(X)q.appendFile=Y;function Y(_,x,A,T){if(typeof A==="function")T=A,A=null;return F(_,x,A,T);function F(I,Q,W,B,$){return X(I,Q,W,function(D){if(D&&(D.code==="EMFILE"||D.code==="ENFILE"))t([F,[I,Q,W,B],D,$||Date.now(),Date.now()]);else if(typeof B==="function")B.apply(this,arguments)})}}var K=q.copyFile;if(K)q.copyFile=j;function j(_,x,A,T){if(typeof A==="function")T=A,A=0;return F(_,x,A,T);function F(I,Q,W,B,$){return K(I,Q,W,function(D){if(D&&(D.code==="EMFILE"||D.code==="ENFILE"))t([F,[I,Q,W,B],D,$||Date.now(),Date.now()]);else if(typeof B==="function")B.apply(this,arguments)})}}var n=q.readdir;q.readdir=V;var Z=/^v[0-5]\./;function V(_,x,A){if(typeof x==="function")A=x,x=null;var T=Z.test(process.version)?function I(Q,W,B,$){return n(Q,F(Q,W,B,$))}:function I(Q,W,B,$){return n(Q,W,F(Q,W,B,$))};return T(_,x,A);function F(I,Q,W,B){return function($,D){if($&&($.code==="EMFILE"||$.code==="ENFILE"))t([T,[I,Q,W],$,B||Date.now(),Date.now()]);else{if(D&&D.sort)D.sort();if(typeof W==="function")W.call(this,$,D)}}}}if(process.version.substr(0,4)==="v0.8"){var H=cO(q);R=H.ReadStream,v=H.WriteStream}var G=q.ReadStream;if(G)R.prototype=Object.create(G.prototype),R.prototype.open=h;var L=q.WriteStream;if(L)v.prototype=Object.create(L.prototype),v.prototype.open=zq;Object.defineProperty(q,"ReadStream",{get:function(){return R},set:function(_){R=_},enumerable:!0,configurable:!0}),Object.defineProperty(q,"WriteStream",{get:function(){return v},set:function(_){v=_},enumerable:!0,configurable:!0});var C=R;Object.defineProperty(q,"FileReadStream",{get:function(){return C},set:function(_){C=_},enumerable:!0,configurable:!0});var w=v;Object.defineProperty(q,"FileWriteStream",{get:function(){return w},set:function(_){w=_},enumerable:!0,configurable:!0});function R(_,x){if(this instanceof R)return G.apply(this,arguments),this;else return R.apply(Object.create(R.prototype),arguments)}function h(){var _=this;Dq(_.path,_.flags,_.mode,function(x,A){if(x){if(_.autoClose)_.destroy();_.emit("error",x)}else _.fd=A,_.emit("open",A),_.read()})}function v(_,x){if(this instanceof v)return L.apply(this,arguments),this;else return v.apply(Object.create(v.prototype),arguments)}function zq(){var _=this;Dq(_.path,_.flags,_.mode,function(x,A){if(x)_.destroy(),_.emit("error",x);else _.fd=A,_.emit("open",A)})}function Sq(_,x){return new q.ReadStream(_,x)}function gq(_,x){return new q.WriteStream(_,x)}var uO=q.open;q.open=Dq;function Dq(_,x,A,T){if(typeof A==="function")T=A,A=null;return F(_,x,A,T);function F(I,Q,W,B,$){return uO(I,Q,W,function(D,X4){if(D&&(D.code==="EMFILE"||D.code==="ENFILE"))t([F,[I,Q,W,B],D,$||Date.now(),Date.now()]);else if(typeof B==="function")B.apply(this,arguments)})}}return q}function t(q){a("ENQUEUE",q[0].name,q[1]),y[k].push(q),Qq()}var Eq;function fq(){var q=Date.now();for(var J=0;J<y[k].length;++J)if(y[k][J].length>2)y[k][J][3]=q,y[k][J][4]=q;Qq()}function Qq(){if(clearTimeout(Eq),Eq=void 0,y[k].length===0)return;var q=y[k].shift(),J=q[0],O=q[1],z=q[2],U=q[3],X=q[4];if(U===void 0)a("RETRY",J.name,O),J.apply(null,O);else if(Date.now()-U>=60000){a("TIMEOUT",J.name,O);var Y=O.pop();if(typeof Y==="function")Y.call(null,z)}else{var K=Date.now()-X,j=Math.max(X-U,1),n=Math.min(j*1.2,100);if(K>=n)a("RETRY",J.name,O),J.apply(null,O.concat([U]));else y[k].push(q)}if(Eq===void 0)Eq=setTimeout(Qq,0)}});var g=P((Wq)=>{var rq=N().fromCallback,S=s(),oO=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((q)=>{return typeof S[q]==="function"});Object.assign(Wq,S);oO.forEach((q)=>{Wq[q]=rq(S[q])});Wq.exists=function(q,J){if(typeof J==="function")return S.exists(q,J);return new Promise((O)=>{return S.exists(q,O)})};Wq.read=function(q,J,O,z,U,X){if(typeof X==="function")return S.read(q,J,O,z,U,X);return new Promise((Y,K)=>{S.read(q,J,O,z,U,(j,n,Z)=>{if(j)return K(j);Y({bytesRead:n,buffer:Z})})})};Wq.write=function(q,J,...O){if(typeof O[O.length-1]==="function")return S.write(q,J,...O);return new Promise((z,U)=>{S.write(q,J,...O,(X,Y,K)=>{if(X)return U(X);z({bytesWritten:Y,buffer:K})})})};Wq.readv=function(q,J,...O){if(typeof O[O.length-1]==="function")return S.readv(q,J,...O);return new Promise((z,U)=>{S.readv(q,J,...O,(X,Y,K)=>{if(X)return U(X);z({bytesRead:Y,buffers:K})})})};Wq.writev=function(q,J,...O){if(typeof O[O.length-1]==="function")return S.writev(q,J,...O);return new Promise((z,U)=>{S.writev(q,J,...O,(X,Y,K)=>{if(X)return U(X);z({bytesWritten:Y,buffers:K})})})};if(typeof S.realpath.native==="function")Wq.realpath.native=rq(S.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var eq=P((J0,aq)=>{var q0=import.meta.require("path");J0.checkPath=function q(J){if(process.platform==="win32"){if(/[<>:"|?*]/.test(J.replace(q0.parse(J).root,""))){let z=new Error(`Path contains invalid characters: ${J}`);throw z.code="EINVAL",z}}}});var JJ=P((z0,Iq)=>{var tq=g(),{checkPath:sq}=eq(),qJ=(q)=>{let J={mode:511};if(typeof q==="number")return q;return{...J,...q}.mode};z0.makeDir=async(q,J)=>{return sq(q),tq.mkdir(q,{mode:qJ(J),recursive:!0})};z0.makeDirSync=(q,J)=>{return sq(q),tq.mkdirSync(q,{mode:qJ(J),recursive:!0})}});var i=P((E4,OJ)=>{var Y0=N().fromPromise,{makeDir:Z0,makeDirSync:Nq}=JJ(),Mq=Y0(Z0);OJ.exports={mkdirs:Mq,mkdirsSync:Nq,mkdirp:Mq,mkdirpSync:Nq,ensureDir:Mq,ensureDirSync:Nq}});var f=P((V4,UJ)=>{var G0=N().fromPromise,zJ=g();function K0(q){return zJ.access(q).then(()=>!0).catch(()=>!1)}UJ.exports={pathExists:G0(K0),pathExistsSync:zJ.existsSync}});var Tq=P((P4,XJ)=>{var qq=g(),_0=N().fromPromise;async function H0(q,J,O){let z=await qq.open(q,"r+"),U=null;try{await qq.futimes(z,J,O)}finally{try{await qq.close(z)}catch(X){U=X}}if(U)throw U}function L0(q,J,O){let z=qq.openSync(q,"r+");return qq.futimesSync(z,J,O),qq.closeSync(z)}XJ.exports={utimesMillis:_0(H0),utimesMillisSync:L0}});var e=P((A4,KJ)=>{var Jq=g(),M=import.meta.require("path"),YJ=N().fromPromise;function E0(q,J,O){let z=O.dereference?(U)=>Jq.stat(U,{bigint:!0}):(U)=>Jq.lstat(U,{bigint:!0});return Promise.all([z(q),z(J).catch((U)=>{if(U.code==="ENOENT")return null;throw U})]).then(([U,X])=>({srcStat:U,destStat:X}))}function V0(q,J,O){let z,U=O.dereference?(Y)=>Jq.statSync(Y,{bigint:!0}):(Y)=>Jq.lstatSync(Y,{bigint:!0}),X=U(q);try{z=U(J)}catch(Y){if(Y.code==="ENOENT")return{srcStat:X,destStat:null};throw Y}return{srcStat:X,destStat:z}}async function P0(q,J,O,z){let{srcStat:U,destStat:X}=await E0(q,J,z);if(X){if(Uq(U,X)){let Y=M.basename(q),K=M.basename(J);if(O==="move"&&Y!==K&&Y.toLowerCase()===K.toLowerCase())return{srcStat:U,destStat:X,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(U.isDirectory()&&!X.isDirectory())throw new Error(`Cannot overwrite non-directory '${J}' with directory '${q}'.`);if(!U.isDirectory()&&X.isDirectory())throw new Error(`Cannot overwrite directory '${J}' with non-directory '${q}'.`)}if(U.isDirectory()&&Fq(q,J))throw new Error(Pq(q,J,O));return{srcStat:U,destStat:X}}function A0(q,J,O,z){let{srcStat:U,destStat:X}=V0(q,J,z);if(X){if(Uq(U,X)){let Y=M.basename(q),K=M.basename(J);if(O==="move"&&Y!==K&&Y.toLowerCase()===K.toLowerCase())return{srcStat:U,destStat:X,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(U.isDirectory()&&!X.isDirectory())throw new Error(`Cannot overwrite non-directory '${J}' with directory '${q}'.`);if(!U.isDirectory()&&X.isDirectory())throw new Error(`Cannot overwrite directory '${J}' with non-directory '${q}'.`)}if(U.isDirectory()&&Fq(q,J))throw new Error(Pq(q,J,O));return{srcStat:U,destStat:X}}async function ZJ(q,J,O,z){let U=M.resolve(M.dirname(q)),X=M.resolve(M.dirname(O));if(X===U||X===M.parse(X).root)return;let Y;try{Y=await Jq.stat(X,{bigint:!0})}catch(K){if(K.code==="ENOENT")return;throw K}if(Uq(J,Y))throw new Error(Pq(q,O,z));return ZJ(q,J,X,z)}function GJ(q,J,O,z){let U=M.resolve(M.dirname(q)),X=M.resolve(M.dirname(O));if(X===U||X===M.parse(X).root)return;let Y;try{Y=Jq.statSync(X,{bigint:!0})}catch(K){if(K.code==="ENOENT")return;throw K}if(Uq(J,Y))throw new Error(Pq(q,O,z));return GJ(q,J,X,z)}function Uq(q,J){return J.ino&&J.dev&&J.ino===q.ino&&J.dev===q.dev}function Fq(q,J){let O=M.resolve(q).split(M.sep).filter((U)=>U),z=M.resolve(J).split(M.sep).filter((U)=>U);return O.every((U,X)=>z[X]===U)}function Pq(q,J,O){return`Cannot ${O} '${q}' to a subdirectory of itself, '${J}'.`}KJ.exports={checkPaths:YJ(P0),checkPathsSync:A0,checkParentPaths:YJ(ZJ),checkParentPathsSync:GJ,isSrcSubdir:Fq,areIdentical:Uq}});var VJ=P((x4,EJ)=>{var u=g(),Xq=import.meta.require("path"),{mkdirs:x0}=i(),{pathExists:w0}=f(),{utimesMillis:B0}=Tq(),Yq=e();async function C0(q,J,O={}){if(typeof O==="function")O={filter:O};if(O.clobber="clobber"in O?!!O.clobber:!0,O.overwrite="overwrite"in O?!!O.overwrite:O.clobber,O.preserveTimestamps&&process.arch==="ia32")process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001");let{srcStat:z,destStat:U}=await Yq.checkPaths(q,J,"copy",O);if(await Yq.checkParentPaths(q,z,J,"copy"),!await HJ(q,J,O))return;let Y=Xq.dirname(J);if(!await w0(Y))await x0(Y);await LJ(U,q,J,O)}async function HJ(q,J,O){if(!O.filter)return!0;return O.filter(q,J)}async function LJ(q,J,O,z){let X=await(z.dereference?u.stat:u.lstat)(J);if(X.isDirectory())return Q0(X,q,J,O,z);if(X.isFile()||X.isCharacterDevice()||X.isBlockDevice())return D0(X,q,J,O,z);if(X.isSymbolicLink())return y0(q,J,O,z);if(X.isSocket())throw new Error(`Cannot copy a socket file: ${J}`);if(X.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${J}`);throw new Error(`Unknown file: ${J}`)}async function D0(q,J,O,z,U){if(!J)return _J(q,O,z,U);if(U.overwrite)return await u.unlink(z),_J(q,O,z,U);if(U.errorOnExist)throw new Error(`'${z}' already exists`)}async function _J(q,J,O,z){if(await u.copyFile(J,O),z.preserveTimestamps){if(j0(q.mode))await R0(O,q.mode);let U=await u.stat(J);await B0(O,U.atime,U.mtime)}return u.chmod(O,q.mode)}function j0(q){return(q&128)===0}function R0(q,J){return u.chmod(q,J|128)}async function Q0(q,J,O,z,U){if(!J)await u.mkdir(z);let X=await u.readdir(O);if(await Promise.all(X.map(async(Y)=>{let K=Xq.join(O,Y),j=Xq.join(z,Y);if(!await HJ(K,j,U))return;let{destStat:Z}=await Yq.checkPaths(K,j,"copy",U);return LJ(Z,K,j,U)})),!J)await u.chmod(z,q.mode)}async function y0(q,J,O,z){let U=await u.readlink(J);if(z.dereference)U=Xq.resolve(process.cwd(),U);if(!q)return u.symlink(U,O);let X=null;try{X=await u.readlink(O)}catch(Y){if(Y.code==="EINVAL"||Y.code==="UNKNOWN")return u.symlink(U,O);throw Y}if(z.dereference)X=Xq.resolve(process.cwd(),X);if(Yq.isSrcSubdir(U,X))throw new Error(`Cannot copy '${U}' to a subdirectory of itself, '${X}'.`);if(Yq.isSrcSubdir(X,U))throw new Error(`Cannot overwrite '${X}' with '${U}'.`);return await u.unlink(O),u.symlink(U,O)}EJ.exports=C0});var BJ=P((w4,wJ)=>{var b=s(),Zq=import.meta.require("path"),W0=i().mkdirsSync,I0=Tq().utimesMillisSync,Gq=e();function N0(q,J,O){if(typeof O==="function")O={filter:O};if(O=O||{},O.clobber="clobber"in O?!!O.clobber:!0,O.overwrite="overwrite"in O?!!O.overwrite:O.clobber,O.preserveTimestamps&&process.arch==="ia32")process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");let{srcStat:z,destStat:U}=Gq.checkPathsSync(q,J,"copy",O);if(Gq.checkParentPathsSync(q,z,J,"copy"),O.filter&&!O.filter(q,J))return;let X=Zq.dirname(J);if(!b.existsSync(X))W0(X);return PJ(U,q,J,O)}function PJ(q,J,O,z){let X=(z.dereference?b.statSync:b.lstatSync)(J);if(X.isDirectory())return n0(X,q,J,O,z);else if(X.isFile()||X.isCharacterDevice()||X.isBlockDevice())return M0(X,q,J,O,z);else if(X.isSymbolicLink())return g0(q,J,O,z);else if(X.isSocket())throw new Error(`Cannot copy a socket file: ${J}`);else if(X.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${J}`);throw new Error(`Unknown file: ${J}`)}function M0(q,J,O,z,U){if(!J)return AJ(q,O,z,U);return T0(q,O,z,U)}function T0(q,J,O,z){if(z.overwrite)return b.unlinkSync(O),AJ(q,J,O,z);else if(z.errorOnExist)throw new Error(`'${O}' already exists`)}function AJ(q,J,O,z){if(b.copyFileSync(J,O),z.preserveTimestamps)F0(q.mode,J,O);return $q(O,q.mode)}function F0(q,J,O){if($0(q))k0(O,q);return u0(J,O)}function $0(q){return(q&128)===0}function k0(q,J){return $q(q,J|128)}function $q(q,J){return b.chmodSync(q,J)}function u0(q,J){let O=b.statSync(q);return I0(J,O.atime,O.mtime)}function n0(q,J,O,z,U){if(!J)return v0(q.mode,O,z,U);return xJ(O,z,U)}function v0(q,J,O,z){return b.mkdirSync(O),xJ(J,O,z),$q(O,q)}function xJ(q,J,O){b.readdirSync(q).forEach((z)=>S0(z,q,J,O))}function S0(q,J,O,z){let U=Zq.join(J,q),X=Zq.join(O,q);if(z.filter&&!z.filter(U,X))return;let{destStat:Y}=Gq.checkPathsSync(U,X,"copy",z);return PJ(Y,U,X,z)}function g0(q,J,O,z){let U=b.readlinkSync(J);if(z.dereference)U=Zq.resolve(process.cwd(),U);if(!q)return b.symlinkSync(U,O);else{let X;try{X=b.readlinkSync(O)}catch(Y){if(Y.code==="EINVAL"||Y.code==="UNKNOWN")return b.symlinkSync(U,O);throw Y}if(z.dereference)X=Zq.resolve(process.cwd(),X);if(Gq.isSrcSubdir(U,X))throw new Error(`Cannot copy '${U}' to a subdirectory of itself, '${X}'.`);if(Gq.isSrcSubdir(X,U))throw new Error(`Cannot overwrite '${X}' with '${U}'.`);return b0(U,O)}}function b0(q,J){return b.unlinkSync(J),b.symlinkSync(q,J)}wJ.exports=N0});var Aq=P((B4,CJ)=>{var m0=N().fromPromise;CJ.exports={copy:m0(VJ()),copySync:BJ()}});var Kq=P((C4,jJ)=>{var DJ=s(),h0=N().fromCallback;function i0(q,J){DJ.rm(q,{recursive:!0,force:!0},J)}function l0(q){DJ.rmSync(q,{recursive:!0,force:!0})}jJ.exports={remove:h0(i0),removeSync:l0}});var TJ=P((D4,MJ)=>{var p0=N().fromPromise,yJ=g(),WJ=import.meta.require("path"),IJ=i(),NJ=Kq(),RJ=p0(async function q(J){let O;try{O=await yJ.readdir(J)}catch{return IJ.mkdirs(J)}return Promise.all(O.map((z)=>NJ.remove(WJ.join(J,z))))});function QJ(q){let J;try{J=yJ.readdirSync(q)}catch{return IJ.mkdirsSync(q)}J.forEach((O)=>{O=WJ.join(q,O),NJ.removeSync(O)})}MJ.exports={emptyDirSync:QJ,emptydirSync:QJ,emptyDir:RJ,emptydir:RJ}});var uJ=P((j4,kJ)=>{var c0=N().fromPromise,FJ=import.meta.require("path"),p=g(),$J=i();async function d0(q){let J;try{J=await p.stat(q)}catch{}if(J&&J.isFile())return;let O=FJ.dirname(q),z=null;try{z=await p.stat(O)}catch(U){if(U.code==="ENOENT"){await $J.mkdirs(O),await p.writeFile(q,"");return}else throw U}if(z.isDirectory())await p.writeFile(q,"");else await p.readdir(O)}function f0(q){let J;try{J=p.statSync(q)}catch{}if(J&&J.isFile())return;let O=FJ.dirname(q);try{if(!p.statSync(O).isDirectory())p.readdirSync(O)}catch(z){if(z&&z.code==="ENOENT")$J.mkdirsSync(O);else throw z}p.writeFileSync(q,"")}kJ.exports={createFile:c0(d0),createFileSync:f0}});var bJ=P((R4,gJ)=>{var o0=N().fromPromise,nJ=import.meta.require("path"),o=g(),vJ=i(),{pathExists:r0}=f(),{areIdentical:SJ}=e();async function a0(q,J){let O;try{O=await o.lstat(J)}catch{}let z;try{z=await o.lstat(q)}catch(Y){throw Y.message=Y.message.replace("lstat","ensureLink"),Y}if(O&&SJ(z,O))return;let U=nJ.dirname(J);if(!await r0(U))await vJ.mkdirs(U);await o.link(q,J)}function e0(q,J){let O;try{O=o.lstatSync(J)}catch{}try{let X=o.lstatSync(q);if(O&&SJ(X,O))return}catch(X){throw X.message=X.message.replace("lstat","ensureLink"),X}let z=nJ.dirname(J);if(o.existsSync(z))return o.linkSync(q,J);return vJ.mkdirsSync(z),o.linkSync(q,J)}gJ.exports={createLink:o0(a0),createLinkSync:e0}});var hJ=P((Q4,mJ)=>{var r=import.meta.require("path"),_q=g(),{pathExists:t0}=f(),s0=N().fromPromise;async function q6(q,J){if(r.isAbsolute(q)){try{await _q.lstat(q)}catch(X){throw X.message=X.message.replace("lstat","ensureSymlink"),X}return{toCwd:q,toDst:q}}let O=r.dirname(J),z=r.join(O,q);if(await t0(z))return{toCwd:z,toDst:q};try{await _q.lstat(q)}catch(X){throw X.message=X.message.replace("lstat","ensureSymlink"),X}return{toCwd:q,toDst:r.relative(O,q)}}function J6(q,J){if(r.isAbsolute(q)){if(!_q.existsSync(q))throw new Error("absolute srcpath does not exist");return{toCwd:q,toDst:q}}let O=r.dirname(J),z=r.join(O,q);if(_q.existsSync(z))return{toCwd:z,toDst:q};if(!_q.existsSync(q))throw new Error("relative srcpath does not exist");return{toCwd:q,toDst:r.relative(O,q)}}mJ.exports={symlinkPaths:s0(q6),symlinkPathsSync:J6}});var pJ=P((y4,lJ)=>{var iJ=g(),O6=N().fromPromise;async function z6(q,J){if(J)return J;let O;try{O=await iJ.lstat(q)}catch{return"file"}return O&&O.isDirectory()?"dir":"file"}function U6(q,J){if(J)return J;let O;try{O=iJ.lstatSync(q)}catch{return"file"}return O&&O.isDirectory()?"dir":"file"}lJ.exports={symlinkType:O6(z6),symlinkTypeSync:U6}});var oJ=P((W4,fJ)=>{var X6=N().fromPromise,cJ=import.meta.require("path"),l=g(),{mkdirs:Y6,mkdirsSync:Z6}=i(),{symlinkPaths:G6,symlinkPathsSync:K6}=hJ(),{symlinkType:_6,symlinkTypeSync:H6}=pJ(),{pathExists:L6}=f(),{areIdentical:dJ}=e();async function E6(q,J,O){let z;try{z=await l.lstat(J)}catch{}if(z&&z.isSymbolicLink()){let[K,j]=await Promise.all([l.stat(q),l.stat(J)]);if(dJ(K,j))return}let U=await G6(q,J);q=U.toDst;let X=await _6(U.toCwd,O),Y=cJ.dirname(J);if(!await L6(Y))await Y6(Y);return l.symlink(q,J,X)}function V6(q,J,O){let z;try{z=l.lstatSync(J)}catch{}if(z&&z.isSymbolicLink()){let K=l.statSync(q),j=l.statSync(J);if(dJ(K,j))return}let U=K6(q,J);q=U.toDst,O=H6(U.toCwd,O);let X=cJ.dirname(J);if(l.existsSync(X))return l.symlinkSync(q,J,O);return Z6(X),l.symlinkSync(q,J,O)}fJ.exports={createSymlink:X6(E6),createSymlinkSync:V6}});var OO=P((I4,JO)=>{var{createFile:rJ,createFileSync:aJ}=uJ(),{createLink:eJ,createLinkSync:tJ}=bJ(),{createSymlink:sJ,createSymlinkSync:qO}=oJ();JO.exports={createFile:rJ,createFileSync:aJ,ensureFile:rJ,ensureFileSync:aJ,createLink:eJ,createLinkSync:tJ,ensureLink:eJ,ensureLinkSync:tJ,createSymlink:sJ,createSymlinkSync:qO,ensureSymlink:sJ,ensureSymlinkSync:qO}});var xq=P((N4,zO)=>{function P6(q,{EOL:J="\n",finalEOL:O=!0,replacer:z=null,spaces:U}={}){let X=O?J:"";return JSON.stringify(q,z,U).replace(/\n/g,J)+X}function A6(q){if(Buffer.isBuffer(q))q=q.toString("utf8");return q.replace(/^\uFEFF/,"")}zO.exports={stringify:P6,stripBom:A6}});var ZO=P((M4,YO)=>{var Oq;try{Oq=s()}catch(q){Oq=import.meta.require("fs")}var wq=N(),{stringify:UO,stripBom:XO}=xq();async function x6(q,J={}){if(typeof J==="string")J={encoding:J};let O=J.fs||Oq,z="throws"in J?J.throws:!0,U=await wq.fromCallback(O.readFile)(q,J);U=XO(U);let X;try{X=JSON.parse(U,J?J.reviver:null)}catch(Y){if(z)throw Y.message=`${q}: ${Y.message}`,Y;else return null}return X}var w6=wq.fromPromise(x6);function B6(q,J={}){if(typeof J==="string")J={encoding:J};let O=J.fs||Oq,z="throws"in J?J.throws:!0;try{let U=O.readFileSync(q,J);return U=XO(U),JSON.parse(U,J.reviver)}catch(U){if(z)throw U.message=`${q}: ${U.message}`,U;else return null}}async function C6(q,J,O={}){let z=O.fs||Oq,U=UO(J,O);await wq.fromCallback(z.writeFile)(q,U,O)}var D6=wq.fromPromise(C6);function j6(q,J,O={}){let z=O.fs||Oq,U=UO(J,O);return z.writeFileSync(q,U,O)}var R6={readFile:w6,readFileSync:B6,writeFile:D6,writeFileSync:j6};YO.exports=R6});var KO=P((T4,GO)=>{var Bq=ZO();GO.exports={readJson:Bq.readFile,readJsonSync:Bq.readFileSync,writeJson:Bq.writeFile,writeJsonSync:Bq.writeFileSync}});var Cq=P((F4,LO)=>{var Q6=N().fromPromise,kq=g(),_O=import.meta.require("path"),HO=i(),y6=f().pathExists;async function W6(q,J,O="utf-8"){let z=_O.dirname(q);if(!await y6(z))await HO.mkdirs(z);return kq.writeFile(q,J,O)}function I6(q,...J){let O=_O.dirname(q);if(!kq.existsSync(O))HO.mkdirsSync(O);kq.writeFileSync(q,...J)}LO.exports={outputFile:Q6(W6),outputFileSync:I6}});var VO=P(($4,EO)=>{var{stringify:N6}=xq(),{outputFile:M6}=Cq();async function T6(q,J,O={}){let z=N6(J,O);await M6(q,z,O)}EO.exports=T6});var AO=P((k4,PO)=>{var{stringify:F6}=xq(),{outputFileSync:$6}=Cq();function k6(q,J,O){let z=F6(J,O);$6(q,z,O)}PO.exports=k6});var wO=P((u4,xO)=>{var u6=N().fromPromise,m=KO();m.outputJson=u6(VO());m.outputJsonSync=AO();m.outputJSON=m.outputJson;m.outputJSONSync=m.outputJsonSync;m.writeJSON=m.writeJson;m.writeJSONSync=m.writeJsonSync;m.readJSON=m.readJson;m.readJSONSync=m.readJsonSync;xO.exports=m});var RO=P((n4,jO)=>{var n6=g(),BO=import.meta.require("path"),{copy:v6}=Aq(),{remove:DO}=Kq(),{mkdirp:S6}=i(),{pathExists:g6}=f(),CO=e();async function b6(q,J,O={}){let z=O.overwrite||O.clobber||!1,{srcStat:U,isChangingCase:X=!1}=await CO.checkPaths(q,J,"move",O);await CO.checkParentPaths(q,U,J,"move");let Y=BO.dirname(J);if(BO.parse(Y).root!==Y)await S6(Y);return m6(q,J,z,X)}async function m6(q,J,O,z){if(!z){if(O)await DO(J);else if(await g6(J))throw new Error("dest already exists.")}try{await n6.rename(q,J)}catch(U){if(U.code!=="EXDEV")throw U;await h6(q,J,O)}}async function h6(q,J,O){return await v6(q,J,{overwrite:O,errorOnExist:!0,preserveTimestamps:!0}),DO(q)}jO.exports=b6});var NO=P((v4,IO)=>{var yO=s(),nq=import.meta.require("path"),i6=Aq().copySync,WO=Kq().removeSync,l6=i().mkdirpSync,QO=e();function p6(q,J,O){O=O||{};let z=O.overwrite||O.clobber||!1,{srcStat:U,isChangingCase:X=!1}=QO.checkPathsSync(q,J,"move",O);if(QO.checkParentPathsSync(q,U,J,"move"),!c6(J))l6(nq.dirname(J));return d6(q,J,z,X)}function c6(q){let J=nq.dirname(q);return nq.parse(J).root===J}function d6(q,J,O,z){if(z)return uq(q,J,O);if(O)return WO(J),uq(q,J,O);if(yO.existsSync(J))throw new Error("dest already exists.");return uq(q,J,O)}function uq(q,J,O){try{yO.renameSync(q,J)}catch(z){if(z.code!=="EXDEV")throw z;return f6(q,J,O)}}function f6(q,J,O){return i6(q,J,{overwrite:O,errorOnExist:!0,preserveTimestamps:!0}),WO(q)}IO.exports=p6});var TO=P((S4,MO)=>{var o6=N().fromPromise;MO.exports={move:o6(RO()),moveSync:NO()}});var $O=P((g4,FO)=>{FO.exports={...g(),...Aq(),...TJ(),...OO(),...wO(),...i(),...TO(),...Cq(),...f(),...Kq()}});var vq=e6($O(),1);import t6 from"process";import{projectPath as s6}from"@stacksjs/path";import{ValidationBoolean as q4,ValidationEnum as J4,ValidationNumber as O4}from"@stacksjs/validation";import{schema as c}from"@stacksjs/validation";import{schema as E}from"@stacksjs/validation";var kO={APP_NAME:E.string(),APP_ENV:E.enum(["local","dev","stage","prod"]),APP_KEY:E.string(),APP_URL:E.string(),PORT:E.number(),PORT_BACKEND:E.number(),PORT_ADMIN:E.number(),PORT_LIBRARY:E.number(),PORT_DESKTOP:E.number(),PORT_EMAIL:E.number(),PORT_DOCS:E.number(),PORT_INSPECT:E.number(),PORT_API:E.number(),PORT_SYSTEM_TRAY:E.number(),APP_MAINTENANCE:E.boolean(),DEBUG:E.boolean(),API_PREFIX:E.string(),DOCS_PREFIX:E.string(),DB_CONNECTION:E.enum(["mysql","sqlite","postgres"]),DB_HOST:E.string(),DB_PORT:E.number(),DB_DATABASE:E.string(),DB_USERNAME:E.string(),DB_PASSWORD:E.string(),AWS_ACCOUNT_ID:E.string(),AWS_ACCESS_KEY_ID:E.string(),AWS_SECRET_ACCESS_KEY:E.string(),AWS_DEFAULT_REGION:E.string(),AWS_DEFAULT_PASSWORD:E.string(),MAIL_MAILER:E.enum(["ses","sendmail","log","smtp"]),MAIL_HOST:E.string(),MAIL_PORT:E.number(),MAIL_USERNAME:E.string(),MAIL_PASSWORD:E.string(),MAIL_ENCRYPTION:E.string(),MAIL_FROM_NAME:E.string(),MAIL_FROM_ADDRESS:E.string(),SEARCH_ENGINE_DRIVER:E.enum(["meilisearch","algolia","typesense"]),MEILISEARCH_HOST:E.string(),MEILISEARCH_KEY:E.string(),FRONTEND_APP_ENV:E.enum(["development","staging","production"]),FRONTEND_APP_URL:E.string()};var r6={APP_ENV:["local","dev","development","staging","prod","production"],DB_CONNECTION:["mysql","sqlite","postgres","dynamodb"],MAIL_MAILER:["smtp","mailgun","ses","postmark","sendmail","log"],SEARCH_ENGINE_DRIVER:["opensearch"],FRONTEND_APP_ENV:["development","staging","production"]},a6=Object.entries(kO).reduce((q,[J,O])=>{let z;switch(typeof O){case"string":z=c.string();break;case"number":z=c.number();break;case"boolean":z=c.boolean();break;default:if(Array.isArray(O)){z=c.enum(O);break}if(typeof O==="object"){let X=Symbol.for("schema_name"),Y=O[X];if(Y==="vine.string"){z=c.string();break}if(Y==="vine.number"){z=c.number();break}if(Y==="vine.boolean"){z=c.boolean();break}if(!Y){z=c.enum(r6.APP_ENV);break}console.error("Unknown env value type",typeof O)}throw new Error(`Invalid env value for ${J}`)}let U=J;return q[U]=z,q},{}),l4=c.object(a6);var z4={get:(q,J)=>{let O=q[J];if(typeof O==="string"&&/^\d+$/.test(O)&&J!=="AWS_ACCOUNT_ID")return Number(O);if(typeof O==="string"&&/^true|false$/.test(O))return O==="true";if(O instanceof J4)return q[J];if(O instanceof q4)return!!q[J];if(O instanceof O4)return Number(q[J]);return O}};function U4(){return typeof Bun!=="undefined"?Bun.env:t6.env}var o4=new Proxy(U4(),z4);function r4(q,J,O){let z=O?.path||s6(".env"),X=vq.default.readFileSync(z,"utf-8").split("\n"),Y=X.findIndex((K)=>K.startsWith(`${q}=`));if(Y!==-1)X[Y]=`${q}=${J}`;else X.push(`${q}=${J}`);vq.default.writeFileSync(z,X.join("\n"))}export{r4 as writeEnv,U4 as process,l4 as envSchema,r6 as envEnum,o4 as env};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ib as L,ob as m}from"./chunk-p18kqenr.js";import"./chunk-25nxsybw.js";import{tb as O}from"./chunk-f0ksrase.js";import{ub as R}from"./chunk-08bm2xax.js";import{vb as k}from"./chunk-qqp394c2.js";var h=k(R(),1);var $=k(O(),1),q=k(R(),1);var J=k(O(),1),E=k(R(),1),Q=(y,w,_)=>{let I={EcsContainer:async(b)=>{let{fromHttp:x}=await import("./chunk-vg4vfkzk.js"),{fromContainerMetadata:j}=await import("./chunk-s2n3hw0a.js");return _?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>E.chain(x(b??{}),j(b))().then(C)},Ec2InstanceMetadata:async(b)=>{_?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");let{fromInstanceMetadata:x}=await import("./chunk-s2n3hw0a.js");return async()=>x(b)().then(C)},Environment:async(b)=>{_?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");let{fromEnv:x}=await import("./chunk-aaqd43t5.js");return async()=>x(b)().then(C)}};if(y in I)return I[y];else throw new E.CredentialsProviderError(`Unsupported credential source in profile ${w}. Got ${y}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:_})},C=(y)=>J.setCredentialFeature(y,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p");var U=(y,{profile:w="default",logger:_}={})=>{return Boolean(y)&&typeof y==="object"&&typeof y.role_arn==="string"&&["undefined","string"].indexOf(typeof y.role_session_name)>-1&&["undefined","string"].indexOf(typeof y.external_id)>-1&&["undefined","string"].indexOf(typeof y.mfa_serial)>-1&&(P(y,{profile:w,logger:_})||N(y,{profile:w,logger:_}))},P=(y,{profile:w,logger:_})=>{let I=typeof y.source_profile==="string"&&typeof y.credential_source==="undefined";if(I)_?.debug?.(` ${w} isAssumeRoleWithSourceProfile source_profile=${y.source_profile}`);return I},N=(y,{profile:w,logger:_})=>{let I=typeof y.credential_source==="string"&&typeof y.source_profile==="undefined";if(I)_?.debug?.(` ${w} isCredentialSourceProfile credential_source=${y.credential_source}`);return I},V=async(y,w,_,I={})=>{_.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");let b=w[y];if(!_.roleAssumer){let{getDefaultRoleAssumer:K}=await import("./chunk-6sqy7049.js");_.roleAssumer=K({..._.clientConfig,credentialProviderLogger:_.logger,parentClientConfig:_?.parentClientConfig},_.clientPlugins)}let{source_profile:x}=b;if(x&&x in I)throw new q.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${L(_)}. Profiles visited: `+Object.keys(I).join(", "),{logger:_.logger});_.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${x?`source_profile=[${x}]`:`profile=[${y}]`}`);let j=x?A(x,w,_,{...I,[x]:!0},T(w[x]??{})):(await Q(b.credential_source,y,_.logger)(_))();if(T(b))return j.then((K)=>$.setCredentialFeature(K,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));else{let K={RoleArn:b.role_arn,RoleSessionName:b.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:b.external_id,DurationSeconds:parseInt(b.duration_seconds||"3600",10)},{mfa_serial:B}=b;if(B){if(!_.mfaCodeProvider)throw new q.CredentialsProviderError(`Profile ${y} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:_.logger,tryNextLink:!1});K.SerialNumber=B,K.TokenCode=await _.mfaCodeProvider(B)}let u=await j;return _.roleAssumer(u,K).then((v)=>$.setCredentialFeature(v,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},T=(y)=>{return!y.role_arn&&!!y.credential_source};var W=k(O(),1),X=(y)=>Boolean(y)&&typeof y==="object"&&typeof y.credential_process==="string",Y=async(y,w)=>import("./chunk-nx1598yr.js").then(({fromProcess:_})=>_({...y,profile:w})().then((I)=>W.setCredentialFeature(I,"CREDENTIALS_PROFILE_PROCESS","v")));var z=k(O(),1),Z=async(y,w,_={})=>{let{fromSSO:I}=await import("./chunk-833tanrb.js");return I({profile:y,logger:_.logger})().then((b)=>{if(w.sso_session)return z.setCredentialFeature(b,"CREDENTIALS_PROFILE_SSO","r");else return z.setCredentialFeature(b,"CREDENTIALS_PROFILE_SSO_LEGACY","t")})},H=(y)=>y&&(typeof y.sso_start_url==="string"||typeof y.sso_account_id==="string"||typeof y.sso_session==="string"||typeof y.sso_region==="string"||typeof y.sso_role_name==="string");var c=k(O(),1),D=(y)=>Boolean(y)&&typeof y==="object"&&typeof y.aws_access_key_id==="string"&&typeof y.aws_secret_access_key==="string"&&["undefined","string"].indexOf(typeof y.aws_session_token)>-1&&["undefined","string"].indexOf(typeof y.aws_account_id)>-1,G=async(y,w)=>{w?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");let _={accessKeyId:y.aws_access_key_id,secretAccessKey:y.aws_secret_access_key,sessionToken:y.aws_session_token,...y.aws_credential_scope&&{credentialScope:y.aws_credential_scope},...y.aws_account_id&&{accountId:y.aws_account_id}};return c.setCredentialFeature(_,"CREDENTIALS_PROFILE","n")};var S=k(O(),1),F=(y)=>Boolean(y)&&typeof y==="object"&&typeof y.web_identity_token_file==="string"&&typeof y.role_arn==="string"&&["undefined","string"].indexOf(typeof y.role_session_name)>-1,M=async(y,w)=>import("./chunk-831wk0b3.js").then(({fromTokenFile:_})=>_({webIdentityTokenFile:y.web_identity_token_file,roleArn:y.role_arn,roleSessionName:y.role_session_name,roleAssumerWithWebIdentity:w.roleAssumerWithWebIdentity,logger:w.logger,parentClientConfig:w.parentClientConfig})().then((I)=>S.setCredentialFeature(I,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q")));var A=async(y,w,_,I={},b=!1)=>{let x=w[y];if(Object.keys(I).length>0&&D(x))return G(x,_);if(b||U(x,{profile:y,logger:_.logger}))return V(y,w,_,I);if(D(x))return G(x,_);if(F(x))return M(x,_);if(X(x))return Y(_,y);if(H(x))return await Z(y,x,_);throw new h.CredentialsProviderError(`Could not resolve credentials using profile: [${y}] in configuration/credentials file(s).`,{logger:_.logger})};var Iy=(y={})=>async()=>{y.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");let w=await m(y);return A(L(y),w,y)};export{Iy as fromIni};
@@ -1,5 +0,0 @@
1
- import{rb as p}from"./chunk-6yazdvb4.js";import{xb as K,zb as g}from"./chunk-d2dbhn2h.js";var kt=g((sf,Bt)=>{var{defineProperty:B,getOwnPropertyDescriptor:Li,getOwnPropertyNames:zi}=Object,Mi=Object.prototype.hasOwnProperty,Ui=(t,n)=>B(t,"name",{value:n,configurable:!0}),bi=(t,n)=>{for(var e in n)B(t,e,{get:n[e],enumerable:!0})},Ri=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of zi(n))if(!Mi.call(t,r)&&r!==e)B(t,r,{get:()=>n[r],enumerable:!(i=Li(n,r))||i.enumerable})}return t},Di=(t)=>Ri(B({},"__esModule",{value:!0}),t),pt={};bi(pt,{isArrayBuffer:()=>Ai});Bt.exports=Di(pt);var Ai=Ui((t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]","isArrayBuffer")});var V=g((cf,vt)=>{var{defineProperty:k,getOwnPropertyDescriptor:Yi,getOwnPropertyNames:Wi}=Object,Zi=Object.prototype.hasOwnProperty,Ht=(t,n)=>k(t,"name",{value:n,configurable:!0}),Qi=(t,n)=>{for(var e in n)k(t,e,{get:n[e],enumerable:!0})},Ki=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of Wi(n))if(!Zi.call(t,r)&&r!==e)k(t,r,{get:()=>n[r],enumerable:!(i=Yi(n,r))||i.enumerable})}return t},Vi=(t)=>Ki(k({},"__esModule",{value:!0}),t),Ot={};Qi(Ot,{fromArrayBuffer:()=>Gi,fromString:()=>ji});vt.exports=Vi(Ot);var Xi=kt(),ft=import.meta.require("buffer"),Gi=Ht((t,n=0,e=t.byteLength-n)=>{if(!Xi.isArrayBuffer(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return ft.Buffer.from(t,n,e)},"fromArrayBuffer"),ji=Ht((t,n)=>{if(typeof t!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return n?ft.Buffer.from(t,n):ft.Buffer.from(t)},"fromString")});var qt=g((Pt)=>{Object.defineProperty(Pt,"__esModule",{value:!0});Pt.fromBase64=void 0;var Ji=V(),pi=/^[A-Za-z0-9+/]*={0,2}$/,Bi=(t)=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!pi.exec(t))throw new TypeError("Invalid base64 string.");let n=Ji.fromString(t,"base64");return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)};Pt.fromBase64=Bi});var O=g((hf,en)=>{var{defineProperty:H,getOwnPropertyDescriptor:ki,getOwnPropertyNames:Hi}=Object,Oi=Object.prototype.hasOwnProperty,ht=(t,n)=>H(t,"name",{value:n,configurable:!0}),vi=(t,n)=>{for(var e in n)H(t,e,{get:n[e],enumerable:!0})},Pi=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of Hi(n))if(!Oi.call(t,r)&&r!==e)H(t,r,{get:()=>n[r],enumerable:!(i=ki(n,r))||i.enumerable})}return t},mi=(t)=>Pi(H({},"__esModule",{value:!0}),t),_t={};vi(_t,{fromUtf8:()=>nn,toUint8Array:()=>qi,toUtf8:()=>_i});en.exports=mi(_t);var tn=V(),nn=ht((t)=>{let n=tn.fromString(t,"utf8");return new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),qi=ht((t)=>{if(typeof t==="string")return nn(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)},"toUint8Array"),_i=ht((t)=>{if(typeof t==="string")return t;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return tn.fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength).toString("utf8")},"toUtf8")});var cn=g((rn)=>{Object.defineProperty(rn,"__esModule",{value:!0});rn.toBase64=void 0;var tr=V(),nr=O(),er=(t)=>{let n;if(typeof t==="string")n=nr.fromUtf8(t);else n=t;if(typeof n!=="object"||typeof n.byteOffset!=="number"||typeof n.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return tr.fromArrayBuffer(n.buffer,n.byteOffset,n.byteLength).toString("base64")};rn.toBase64=er});var X=g((df,v)=>{var{defineProperty:fn,getOwnPropertyDescriptor:ir,getOwnPropertyNames:rr}=Object,sr=Object.prototype.hasOwnProperty,ot=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of rr(n))if(!sr.call(t,r)&&r!==e)fn(t,r,{get:()=>n[r],enumerable:!(i=ir(n,r))||i.enumerable})}return t},hn=(t,n,e)=>(ot(t,n,"default"),e&&ot(e,n,"default")),cr=(t)=>ot(fn({},"__esModule",{value:!0}),t),dt={};v.exports=cr(dt);hn(dt,qt(),v.exports);hn(dt,cn(),v.exports)});var un=g((on)=>{Object.defineProperty(on,"__esModule",{value:!0});on.getAwsChunkedEncodingStream=void 0;var fr=import.meta.require("stream"),hr=(t,n)=>{let{base64Encoder:e,bodyLengthChecker:i,checksumAlgorithmFn:r,checksumLocationName:s,streamHasher:c}=n,f=e!==void 0&&r!==void 0&&s!==void 0&&c!==void 0,o=f?c(r,t):void 0,a=new fr.Readable({read:()=>{}});return t.on("data",(x)=>{let h=i(x)||0;a.push(`${h.toString(16)}\r\n`),a.push(x),a.push("\r\n")}),t.on("end",async()=>{if(a.push("0\r\n"),f){let x=e(await o);a.push(`${s}:${x}\r\n`),a.push("\r\n")}a.push(null)}),a};on.getAwsChunkedEncodingStream=hr});var m=g((lf,Cn)=>{var{defineProperty:P,getOwnPropertyDescriptor:or,getOwnPropertyNames:dr}=Object,ur=Object.prototype.hasOwnProperty,R=(t,n)=>P(t,"name",{value:n,configurable:!0}),lr=(t,n)=>{for(var e in n)P(t,e,{get:n[e],enumerable:!0})},ar=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of dr(n))if(!ur.call(t,r)&&r!==e)P(t,r,{get:()=>n[r],enumerable:!(i=or(n,r))||i.enumerable})}return t},wr=(t)=>ar(P({},"__esModule",{value:!0}),t),ln={};lr(ln,{Field:()=>Er,Fields:()=>xr,HttpRequest:()=>Tr,HttpResponse:()=>Cr,IHttpRequest:()=>an.HttpRequest,getHttpHandlerExtensionConfiguration:()=>yr,isValidHostname:()=>Tn,resolveHttpHandlerRuntimeConfig:()=>$r});Cn.exports=wr(ln);var yr=R((t)=>{let n=t.httpHandler;return{setHttpHandler(e){n=e},httpHandler(){return n},updateHttpClientConfig(e,i){n.updateHttpClientConfig(e,i)},httpHandlerConfigs(){return n.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),$r=R((t)=>{return{httpHandler:t.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),an=p(),wn=class t{constructor({name:n,kind:e=an.FieldPosition.HEADER,values:i=[]}){this.name=n,this.kind=e,this.values=i}add(n){this.values.push(n)}set(n){this.values=n}remove(n){this.values=this.values.filter((e)=>e!==n)}toString(){return this.values.map((n)=>n.includes(",")||n.includes(" ")?`"${n}"`:n).join(", ")}get(){return this.values}};R(wn,"Field");var Er=wn,yn=class t{constructor({fields:n=[],encoding:e="utf-8"}){this.entries={},n.forEach(this.setField.bind(this)),this.encoding=e}setField(n){this.entries[n.name.toLowerCase()]=n}getField(n){return this.entries[n.toLowerCase()]}removeField(n){delete this.entries[n.toLowerCase()]}getByType(n){return Object.values(this.entries).filter((e)=>e.kind===n)}};R(yn,"Fields");var xr=yn,$n=class t{constructor(n){this.method=n.method||"GET",this.hostname=n.hostname||"localhost",this.port=n.port,this.query=n.query||{},this.headers=n.headers||{},this.body=n.body,this.protocol=n.protocol?n.protocol.slice(-1)!==":"?`${n.protocol}:`:n.protocol:"https:",this.path=n.path?n.path.charAt(0)!=="/"?`/${n.path}`:n.path:"/",this.username=n.username,this.password=n.password,this.fragment=n.fragment}static clone(n){let e=new t({...n,headers:{...n.headers}});if(e.query)e.query=En(e.query);return e}static isInstance(n){if(!n)return!1;let e=n;return"method"in e&&"protocol"in e&&"hostname"in e&&"path"in e&&typeof e.query==="object"&&typeof e.headers==="object"}clone(){return t.clone(this)}};R($n,"HttpRequest");var Tr=$n;function En(t){return Object.keys(t).reduce((n,e)=>{let i=t[e];return{...n,[e]:Array.isArray(i)?[...i]:i}},{})}R(En,"cloneQuery");var xn=class t{constructor(n){this.statusCode=n.statusCode,this.reason=n.reason,this.headers=n.headers||{},this.body=n.body}static isInstance(n){if(!n)return!1;let e=n;return typeof e.statusCode==="number"&&typeof e.headers==="object"}};R(xn,"HttpResponse");var Cr=xn;function Tn(t){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(t)}R(Tn,"isValidHostname")});var In=g((af,Fn)=>{var{defineProperty:q,getOwnPropertyDescriptor:gr,getOwnPropertyNames:Sr}=Object,Fr=Object.prototype.hasOwnProperty,ut=(t,n)=>q(t,"name",{value:n,configurable:!0}),Ir=(t,n)=>{for(var e in n)q(t,e,{get:n[e],enumerable:!0})},Nr=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of Sr(n))if(!Fr.call(t,r)&&r!==e)q(t,r,{get:()=>n[r],enumerable:!(i=gr(n,r))||i.enumerable})}return t},Lr=(t)=>Nr(q({},"__esModule",{value:!0}),t),gn={};Ir(gn,{escapeUri:()=>Sn,escapeUriPath:()=>Mr});Fn.exports=Lr(gn);var Sn=ut((t)=>encodeURIComponent(t).replace(/[!'()*]/g,zr),"escapeUri"),zr=ut((t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),Mr=ut((t)=>t.split("/").map(Sn).join("/"),"escapeUriPath")});var at=g((wf,zn)=>{var{defineProperty:_,getOwnPropertyDescriptor:Ur,getOwnPropertyNames:br}=Object,Rr=Object.prototype.hasOwnProperty,Dr=(t,n)=>_(t,"name",{value:n,configurable:!0}),Ar=(t,n)=>{for(var e in n)_(t,e,{get:n[e],enumerable:!0})},Yr=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of br(n))if(!Rr.call(t,r)&&r!==e)_(t,r,{get:()=>n[r],enumerable:!(i=Ur(n,r))||i.enumerable})}return t},Wr=(t)=>Yr(_({},"__esModule",{value:!0}),t),Nn={};Ar(Nn,{buildQueryString:()=>Ln});zn.exports=Wr(Nn);var lt=In();function Ln(t){let n=[];for(let e of Object.keys(t).sort()){let i=t[e];if(e=lt.escapeUri(e),Array.isArray(i))for(let r=0,s=i.length;r<s;r++)n.push(`${e}=${lt.escapeUri(i[r])}`);else{let r=e;if(i||typeof i==="string")r+=`=${lt.escapeUri(i)}`;n.push(r)}}return n.join("&")}Dr(Ln,"buildQueryString")});var kn=g((yf,Bn)=>{var{create:Zr,defineProperty:G,getOwnPropertyDescriptor:Qr,getOwnPropertyNames:Kr,getPrototypeOf:Vr}=Object,Xr=Object.prototype.hasOwnProperty,S=(t,n)=>G(t,"name",{value:n,configurable:!0}),Gr=(t,n)=>{for(var e in n)G(t,e,{get:n[e],enumerable:!0})},Dn=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of Kr(n))if(!Xr.call(t,r)&&r!==e)G(t,r,{get:()=>n[r],enumerable:!(i=Qr(n,r))||i.enumerable})}return t},jr=(t,n,e)=>(e=t!=null?Zr(Vr(t)):{},Dn(n||!t||!t.__esModule?G(e,"default",{value:t,enumerable:!0}):e,t)),Jr=(t)=>Dn(G({},"__esModule",{value:!0}),t),An={};Gr(An,{DEFAULT_REQUEST_TIMEOUT:()=>vr,NodeHttp2Handler:()=>ts,NodeHttpHandler:()=>Pr,streamCollector:()=>es});Bn.exports=Jr(An);var Yn=m(),Wn=at(),wt=import.meta.require("http"),yt=import.meta.require("https"),pr=["ECONNRESET","EPIPE","ETIMEDOUT"],Zn=S((t)=>{let n={};for(let e of Object.keys(t)){let i=t[e];n[e]=Array.isArray(i)?i.join(","):i}return n},"getTransformedHeaders"),Mn=1000,Br=S((t,n,e=0)=>{if(!e)return-1;let i=S((r)=>{let s=setTimeout(()=>{t.destroy(),n(Object.assign(new Error(`Socket timed out without establishing a connection within ${e} ms`),{name:"TimeoutError"}))},e-r),c=S((f)=>{if(f==null?void 0:f.connecting)f.on("connect",()=>{clearTimeout(s)});else clearTimeout(s)},"doWithSocket");if(t.socket)c(t.socket);else t.on("socket",c)},"registerTimeout");if(e<2000)return i(0),0;return setTimeout(i.bind(null,Mn),Mn)},"setConnectionTimeout"),kr=3000,Hr=S((t,{keepAlive:n,keepAliveMsecs:e},i=kr)=>{if(n!==!0)return-1;let r=S(()=>{if(t.socket)t.socket.setKeepAlive(n,e||0);else t.on("socket",(s)=>{s.setKeepAlive(n,e||0)})},"registerListener");if(i===0)return r(),0;return setTimeout(r,i)},"setSocketKeepAlive"),Un=3000,Or=S((t,n,e=0)=>{let i=S((r)=>{t.setTimeout(e-r,()=>{t.destroy(),n(Object.assign(new Error(`Connection timed out after ${e} ms`),{name:"TimeoutError"}))})},"registerTimeout");if(0<e&&e<6000)return i(0),0;return setTimeout(i.bind(null,e===0?0:Un),Un)},"setSocketTimeout"),Qn=import.meta.require("stream"),bn=1000;async function $t(t,n,e=bn){let i=n.headers??{},r=i.Expect||i.expect,s=-1,c=!1;if(r==="100-continue")await Promise.race([new Promise((f)=>{s=Number(setTimeout(f,Math.max(bn,e)))}),new Promise((f)=>{t.on("continue",()=>{clearTimeout(s),f()}),t.on("error",()=>{c=!0,clearTimeout(s),f()})})]);if(!c)Kn(t,n.body)}S($t,"writeRequestBody");function Kn(t,n){if(n instanceof Qn.Readable){n.pipe(t);return}if(n){if(Buffer.isBuffer(n)||typeof n==="string"){t.end(n);return}let e=n;if(typeof e==="object"&&e.buffer&&typeof e.byteOffset==="number"&&typeof e.byteLength==="number"){t.end(Buffer.from(e.buffer,e.byteOffset,e.byteLength));return}t.end(Buffer.from(n));return}t.end()}S(Kn,"writeBody");var vr=0,Vn=class t{constructor(n){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((e,i)=>{if(typeof n==="function")n().then((r)=>{e(this.resolveDefaultConfig(r))}).catch(i);else e(this.resolveDefaultConfig(n))})}static create(n){if(typeof(n==null?void 0:n.handle)==="function")return n;return new t(n)}static checkSocketUsage(n,e,i=console){var r,s,c;let{sockets:f,requests:o,maxSockets:a}=n;if(typeof a!=="number"||a===1/0)return e;let x=15000;if(Date.now()-x<e)return e;if(f&&o)for(let h in f){let u=((r=f[h])==null?void 0:r.length)??0,l=((s=o[h])==null?void 0:s.length)??0;if(u>=a&&l>=2*a)return(c=i==null?void 0:i.warn)==null||c.call(i,`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${l} additional requests are enqueued.
2
- See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
3
- or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return e}resolveDefaultConfig(n){let{requestTimeout:e,connectionTimeout:i,socketTimeout:r,httpAgent:s,httpsAgent:c}=n||{},f=!0,o=50;return{connectionTimeout:i,requestTimeout:e??r,httpAgent:(()=>{if(s instanceof wt.Agent||typeof(s==null?void 0:s.destroy)==="function")return s;return new wt.Agent({keepAlive:!0,maxSockets:50,...s})})(),httpsAgent:(()=>{if(c instanceof yt.Agent||typeof(c==null?void 0:c.destroy)==="function")return c;return new yt.Agent({keepAlive:!0,maxSockets:50,...c})})(),logger:console}}destroy(){var n,e,i,r;(e=(n=this.config)==null?void 0:n.httpAgent)==null||e.destroy(),(r=(i=this.config)==null?void 0:i.httpsAgent)==null||r.destroy()}async handle(n,{abortSignal:e}={}){if(!this.config)this.config=await this.configProvider;return new Promise((i,r)=>{let s=void 0,c=[],f=S(async(w)=>{await s,c.forEach(clearTimeout),i(w)},"resolve"),o=S(async(w)=>{await s,c.forEach(clearTimeout),r(w)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(e==null?void 0:e.aborted){let w=new Error("Request aborted");w.name="AbortError",o(w);return}let a=n.protocol==="https:",x=a?this.config.httpsAgent:this.config.httpAgent;c.push(setTimeout(()=>{this.socketWarningTimestamp=t.checkSocketUsage(x,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let h=Wn.buildQueryString(n.query||{}),u=void 0;if(n.username!=null||n.password!=null){let w=n.username??"",T=n.password??"";u=`${w}:${T}`}let l=n.path;if(h)l+=`?${h}`;if(n.fragment)l+=`#${n.fragment}`;let E=n.hostname??"";if(E[0]==="["&&E.endsWith("]"))E=n.hostname.slice(1,-1);else E=n.hostname;let C={headers:n.headers,host:E,method:n.method,path:l,port:n.port,agent:x,auth:u},$=(a?yt.request:wt.request)(C,(w)=>{let T=new Yn.HttpResponse({statusCode:w.statusCode||-1,reason:w.statusMessage,headers:Zn(w.headers),body:w});f({response:T})});if($.on("error",(w)=>{if(pr.includes(w.code))o(Object.assign(w,{name:"TimeoutError"}));else o(w)}),e){let w=S(()=>{$.destroy();let T=new Error("Request aborted");T.name="AbortError",o(T)},"onAbort");if(typeof e.addEventListener==="function"){let T=e;T.addEventListener("abort",w,{once:!0}),$.once("close",()=>T.removeEventListener("abort",w))}else e.onabort=w}c.push(Br($,o,this.config.connectionTimeout)),c.push(Or($,o,this.config.requestTimeout));let d=C.agent;if(typeof d==="object"&&"keepAlive"in d)c.push(Hr($,{keepAlive:d.keepAlive,keepAliveMsecs:d.keepAliveMsecs}));s=$t($,n,this.config.requestTimeout).catch((w)=>{return c.forEach(clearTimeout),r(w)})})}updateHttpClientConfig(n,e){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return{...i,[n]:e}})}httpHandlerConfigs(){return this.config??{}}};S(Vn,"NodeHttpHandler");var Pr=Vn,Rn=import.meta.require("http2"),mr=jr(import.meta.require("http2")),Xn=class t{constructor(n){this.sessions=[],this.sessions=n??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(n){this.sessions.push(n)}contains(n){return this.sessions.includes(n)}remove(n){this.sessions=this.sessions.filter((e)=>e!==n)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(n){for(let e of this.sessions)if(e===n){if(!e.destroyed)e.destroy()}}};S(Xn,"NodeHttp2ConnectionPool");var qr=Xn,Gn=class t{constructor(n){if(this.sessionCache=new Map,this.config=n,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(n,e){let i=this.getUrlString(n),r=this.sessionCache.get(i);if(r){let o=r.poll();if(o&&!this.config.disableConcurrency)return o}let s=mr.default.connect(i);if(this.config.maxConcurrency)s.settings({maxConcurrentStreams:this.config.maxConcurrency},(o)=>{if(o)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+n.destination.toString())});s.unref();let c=S(()=>{s.destroy(),this.deleteSession(i,s)},"destroySessionCb");if(s.on("goaway",c),s.on("error",c),s.on("frameError",c),s.on("close",()=>this.deleteSession(i,s)),e.requestTimeout)s.setTimeout(e.requestTimeout,c);let f=this.sessionCache.get(i)||new qr;return f.offerLast(s),this.sessionCache.set(i,f),s}deleteSession(n,e){let i=this.sessionCache.get(n);if(!i)return;if(!i.contains(e))return;i.remove(e),this.sessionCache.set(n,i)}release(n,e){var i;let r=this.getUrlString(n);(i=this.sessionCache.get(r))==null||i.offerLast(e)}destroy(){for(let[n,e]of this.sessionCache){for(let i of e){if(!i.destroyed)i.destroy();e.remove(i)}this.sessionCache.delete(n)}}setMaxConcurrentStreams(n){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=n}setDisableConcurrentStreams(n){this.config.disableConcurrency=n}getUrlString(n){return n.destination.toString()}};S(Gn,"NodeHttp2ConnectionManager");var _r=Gn,jn=class t{constructor(n){this.metadata={handlerProtocol:"h2"},this.connectionManager=new _r({}),this.configProvider=new Promise((e,i)=>{if(typeof n==="function")n().then((r)=>{e(r||{})}).catch(i);else e(n||{})})}static create(n){if(typeof(n==null?void 0:n.handle)==="function")return n;return new t(n)}destroy(){this.connectionManager.destroy()}async handle(n,{abortSignal:e}={}){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:i,disableConcurrentStreams:r}=this.config;return new Promise((s,c)=>{var f;let o=!1,a=void 0,x=S(async(F)=>{await a,s(F)},"resolve"),h=S(async(F)=>{await a,c(F)},"reject");if(e==null?void 0:e.aborted){o=!0;let F=new Error("Request aborted");F.name="AbortError",h(F);return}let{hostname:u,method:l,port:E,protocol:C,query:y}=n,$="";if(n.username!=null||n.password!=null){let F=n.username??"",z=n.password??"";$=`${F}:${z}@`}let d=`${C}//${$}${u}${E?`:${E}`:""}`,w={destination:new URL(d)},T=this.connectionManager.lease(w,{requestTimeout:(f=this.config)==null?void 0:f.sessionTimeout,disableConcurrentStreams:r||!1}),I=S((F)=>{if(r)this.destroySession(T);o=!0,h(F)},"rejectWithDestroy"),L=Wn.buildQueryString(y||{}),ct=n.path;if(L)ct+=`?${L}`;if(n.fragment)ct+=`#${n.fragment}`;let N=T.request({...n.headers,[Rn.constants.HTTP2_HEADER_PATH]:ct,[Rn.constants.HTTP2_HEADER_METHOD]:l});if(T.ref(),N.on("response",(F)=>{let z=new Yn.HttpResponse({statusCode:F[":status"]||-1,headers:Zn(F),body:N});if(o=!0,x({response:z}),r)T.close(),this.connectionManager.deleteSession(d,T)}),i)N.setTimeout(i,()=>{N.close();let F=new Error(`Stream timed out because of no activity for ${i} ms`);F.name="TimeoutError",I(F)});if(e){let F=S(()=>{N.close();let z=new Error("Request aborted");z.name="AbortError",I(z)},"onAbort");if(typeof e.addEventListener==="function"){let z=e;z.addEventListener("abort",F,{once:!0}),N.once("close",()=>z.removeEventListener("abort",F))}else e.onabort=F}N.on("frameError",(F,z,Ii)=>{I(new Error(`Frame type id ${F} in stream id ${Ii} has failed with code ${z}.`))}),N.on("error",I),N.on("aborted",()=>{I(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${N.rstCode}.`))}),N.on("close",()=>{if(T.unref(),r)T.destroy();if(!o)I(new Error("Unexpected error: http2 request did not get a response"))}),a=$t(N,n,i)})}updateHttpClientConfig(n,e){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return{...i,[n]:e}})}httpHandlerConfigs(){return this.config??{}}destroySession(n){if(!n.destroyed)n.destroy()}};S(jn,"NodeHttp2Handler");var ts=jn,Jn=class t extends Qn.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(n,e,i){this.bufferedBytes.push(n),i()}};S(Jn,"Collector");var ns=Jn,es=S((t)=>{if(is(t))return pn(t);return new Promise((n,e)=>{let i=new ns;t.pipe(i),t.on("error",(r)=>{i.end(),e(r)}),i.on("error",e),i.on("finish",function(){let r=new Uint8Array(Buffer.concat(this.bufferedBytes));n(r)})})},"streamCollector"),is=S((t)=>typeof ReadableStream==="function"&&t instanceof ReadableStream,"isReadableStreamInstance");async function pn(t){let n=[],e=t.getReader(),i=!1,r=0;while(!i){let{done:f,value:o}=await e.read();if(o)n.push(o),r+=o.length;i=f}let s=new Uint8Array(r),c=0;for(let f of n)s.set(f,c),c+=f.length;return s}S(pn,"collectReadableStream")});var _n=g(($f,qn)=>{var{defineProperty:nt,getOwnPropertyDescriptor:rs,getOwnPropertyNames:ss}=Object,cs=Object.prototype.hasOwnProperty,A=(t,n)=>nt(t,"name",{value:n,configurable:!0}),fs=(t,n)=>{for(var e in n)nt(t,e,{get:n[e],enumerable:!0})},hs=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of ss(n))if(!cs.call(t,r)&&r!==e)nt(t,r,{get:()=>n[r],enumerable:!(i=rs(n,r))||i.enumerable})}return t},os=(t)=>hs(nt({},"__esModule",{value:!0}),t),On={};fs(On,{FetchHttpHandler:()=>us,keepAliveSupport:()=>tt,streamCollector:()=>ls});qn.exports=os(On);var Hn=m(),ds=at();function vn(t=0){return new Promise((n,e)=>{if(t)setTimeout(()=>{let i=new Error(`Request did not complete within ${t} ms`);i.name="TimeoutError",e(i)},t)})}A(vn,"requestTimeout");var tt={supported:void 0},Pn=class t{static create(n){if(typeof(n==null?void 0:n.handle)==="function")return n;return new t(n)}constructor(n){if(typeof n==="function")this.configProvider=n().then((e)=>e||{});else this.config=n??{},this.configProvider=Promise.resolve(this.config);if(tt.supported===void 0)tt.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(n,{abortSignal:e}={}){var i;if(!this.config)this.config=await this.configProvider;let r=this.config.requestTimeout,s=this.config.keepAlive===!0,c=this.config.credentials;if(e==null?void 0:e.aborted){let d=new Error("Request aborted");return d.name="AbortError",Promise.reject(d)}let f=n.path,o=ds.buildQueryString(n.query||{});if(o)f+=`?${o}`;if(n.fragment)f+=`#${n.fragment}`;let a="";if(n.username!=null||n.password!=null){let d=n.username??"",w=n.password??"";a=`${d}:${w}@`}let{port:x,method:h}=n,u=`${n.protocol}//${a}${n.hostname}${x?`:${x}`:""}${f}`,l=h==="GET"||h==="HEAD"?void 0:n.body,E={body:l,headers:new Headers(n.headers),method:h,credentials:c};if((i=this.config)==null?void 0:i.cache)E.cache=this.config.cache;if(l)E.duplex="half";if(typeof AbortController!=="undefined")E.signal=e;if(tt.supported)E.keepalive=s;if(typeof this.config.requestInit==="function")Object.assign(E,this.config.requestInit(n));let C=A(()=>{},"removeSignalEventListener"),y=new Request(u,E),$=[fetch(y).then((d)=>{let w=d.headers,T={};for(let L of w.entries())T[L[0]]=L[1];if(d.body==null)return d.blob().then((L)=>({response:new Hn.HttpResponse({headers:T,reason:d.statusText,statusCode:d.status,body:L})}));return{response:new Hn.HttpResponse({headers:T,reason:d.statusText,statusCode:d.status,body:d.body})}}),vn(r)];if(e)$.push(new Promise((d,w)=>{let T=A(()=>{let I=new Error("Request aborted");I.name="AbortError",w(I)},"onAbort");if(typeof e.addEventListener==="function"){let I=e;I.addEventListener("abort",T,{once:!0}),C=A(()=>I.removeEventListener("abort",T),"removeSignalEventListener")}else e.onabort=T}));return Promise.race($).finally(C)}updateHttpClientConfig(n,e){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return i[n]=e,i})}httpHandlerConfigs(){return this.config??{}}};A(Pn,"FetchHttpHandler");var us=Pn,ls=A(async(t)=>{if(typeof Blob==="function"&&t instanceof Blob)return new Uint8Array(await t.arrayBuffer());return mn(t)},"streamCollector");async function mn(t){let n=[],e=t.getReader(),i=!1,r=0;while(!i){let{done:f,value:o}=await e.read();if(o)n.push(o),r+=o.length;i=f}let s=new Uint8Array(r),c=0;for(let f of n)s.set(f,c),c+=f.length;return s}A(mn,"collectStream")});var ce=g((Ef,se)=>{var{defineProperty:et,getOwnPropertyDescriptor:as,getOwnPropertyNames:ws}=Object,ys=Object.prototype.hasOwnProperty,te=(t,n)=>et(t,"name",{value:n,configurable:!0}),$s=(t,n)=>{for(var e in n)et(t,e,{get:n[e],enumerable:!0})},Es=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of ws(n))if(!ys.call(t,r)&&r!==e)et(t,r,{get:()=>n[r],enumerable:!(i=as(n,r))||i.enumerable})}return t},xs=(t)=>Es(et({},"__esModule",{value:!0}),t),ne={};$s(ne,{fromHex:()=>ie,toHex:()=>re});se.exports=xs(ne);var ee={},Et={};for(let t=0;t<256;t++){let n=t.toString(16).toLowerCase();if(n.length===1)n=`0${n}`;ee[t]=n,Et[n]=t}function ie(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2){let i=t.slice(e,e+2).toLowerCase();if(i in Et)n[e/2]=Et[i];else throw new Error(`Cannot decode unrecognized sequence ${i} as hexadecimal`)}return n}te(ie,"fromHex");function re(t){let n="";for(let e=0;e<t.byteLength;e++)n+=ee[t[e]];return n}te(re,"toHex")});var Y=g((fe)=>{Object.defineProperty(fe,"__esModule",{value:!0});fe.isReadableStream=void 0;var Ts=(t)=>{var n;return typeof ReadableStream==="function"&&(((n=t===null||t===void 0?void 0:t.constructor)===null||n===void 0?void 0:n.name)===ReadableStream.name||t instanceof ReadableStream)};fe.isReadableStream=Ts});var we=g((le)=>{Object.defineProperty(le,"__esModule",{value:!0});le.sdkStreamMixin=void 0;var Cs=_n(),gs=X(),Ss=ce(),Fs=O(),oe=Y(),de="The stream has already been transformed.",Is=(t)=>{var n,e;if(!ue(t)&&!oe.isReadableStream(t)){let c=((e=(n=t===null||t===void 0?void 0:t.__proto__)===null||n===void 0?void 0:n.constructor)===null||e===void 0?void 0:e.name)||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${c}`)}let i=!1,r=async()=>{if(i)throw new Error(de);return i=!0,await Cs.streamCollector(t)},s=(c)=>{if(typeof c.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return c.stream()};return Object.assign(t,{transformToByteArray:r,transformToString:async(c)=>{let f=await r();if(c==="base64")return gs.toBase64(f);else if(c==="hex")return Ss.toHex(f);else if(c===void 0||c==="utf8"||c==="utf-8")return Fs.toUtf8(f);else if(typeof TextDecoder==="function")return new TextDecoder(c).decode(f);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(i)throw new Error(de);if(i=!0,ue(t))return s(t);else if(oe.isReadableStream(t))return t;else throw new Error(`Cannot transform payload to web stream, got ${t}`)}})};le.sdkStreamMixin=Is;var ue=(t)=>typeof Blob==="function"&&t instanceof Blob});var xe=g(($e)=>{Object.defineProperty($e,"__esModule",{value:!0});$e.sdkStreamMixin=void 0;var Ns=kn(),Ls=V(),xt=import.meta.require("stream"),zs=import.meta.require("util"),Ms=we(),ye="The stream has already been transformed.",Us=(t)=>{var n,e;if(!(t instanceof xt.Readable))try{return Ms.sdkStreamMixin(t)}catch(s){let c=((e=(n=t===null||t===void 0?void 0:t.__proto__)===null||n===void 0?void 0:n.constructor)===null||e===void 0?void 0:e.name)||t;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${c}`)}let i=!1,r=async()=>{if(i)throw new Error(ye);return i=!0,await Ns.streamCollector(t)};return Object.assign(t,{transformToByteArray:r,transformToString:async(s)=>{let c=await r();if(s===void 0||Buffer.isEncoding(s))return Ls.fromArrayBuffer(c.buffer,c.byteOffset,c.byteLength).toString(s);else return new zs.TextDecoder(s).decode(c)},transformToWebStream:()=>{if(i)throw new Error(ye);if(t.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof xt.Readable.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return i=!0,xt.Readable.toWeb(t)}})};$e.sdkStreamMixin=Us});var ge=g((Te)=>{Object.defineProperty(Te,"__esModule",{value:!0});Te.splitStream=void 0;async function bs(t){if(typeof t.stream==="function")t=t.stream();return t.tee()}Te.splitStream=bs});var Ne=g((Fe)=>{Object.defineProperty(Fe,"__esModule",{value:!0});Fe.splitStream=void 0;var Se=import.meta.require("stream"),Rs=ge(),Ds=Y();async function As(t){if(Ds.isReadableStream(t))return Rs.splitStream(t);let n=new Se.PassThrough,e=new Se.PassThrough;return t.pipe(n),t.pipe(e),[n,e]}Fe.splitStream=As});var Me=g((Le)=>{Object.defineProperty(Le,"__esModule",{value:!0});Le.headStream=void 0;async function Ys(t,n){var e;let i=0,r=[],s=t.getReader(),c=!1;while(!c){let{done:a,value:x}=await s.read();if(x)r.push(x),i+=(e=x===null||x===void 0?void 0:x.byteLength)!==null&&e!==void 0?e:0;if(i>=n)break;c=a}s.releaseLock();let f=new Uint8Array(Math.min(n,i)),o=0;for(let a of r){if(a.byteLength>f.byteLength-o){f.set(a.subarray(0,f.byteLength-o),o);break}else f.set(a,o);o+=a.length}return f}Le.headStream=Ys});var De=g((be)=>{Object.defineProperty(be,"__esModule",{value:!0});be.headStream=void 0;var Ws=import.meta.require("stream"),Zs=Me(),Qs=Y(),Ks=(t,n)=>{if(Qs.isReadableStream(t))return Zs.headStream(t,n);return new Promise((e,i)=>{let r=new Ue;r.limit=n,t.pipe(r),t.on("error",(s)=>{r.end(),i(s)}),r.on("error",i),r.on("finish",function(){let s=new Uint8Array(Buffer.concat(this.buffers));e(s)})})};be.headStream=Ks;class Ue extends Ws.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=1/0,this.bytesBuffered=0}_write(t,n,e){var i;if(this.buffers.push(t),this.bytesBuffered+=(i=t.byteLength)!==null&&i!==void 0?i:0,this.bytesBuffered>=this.limit){let r=this.bytesBuffered-this.limit,s=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=s.subarray(0,s.byteLength-r),this.emit("finish")}e()}}});var Tt=g((Ye)=>{Object.defineProperty(Ye,"__esModule",{value:!0});Ye.ChecksumStream=void 0;var Vs=X(),Xs=import.meta.require("stream");class Ae extends Xs.Duplex{constructor({expectedChecksum:t,checksum:n,source:e,checksumSourceLocation:i,base64Encoder:r}){var s,c;super();if(typeof e.pipe==="function")this.source=e;else throw new Error(`@smithy/util-stream: unsupported source type ${(c=(s=e===null||e===void 0?void 0:e.constructor)===null||s===void 0?void 0:s.name)!==null&&c!==void 0?c:e} in ChecksumStream.`);this.base64Encoder=r!==null&&r!==void 0?r:Vs.toBase64,this.expectedChecksum=t,this.checksum=n,this.checksumSourceLocation=i,this.source.pipe(this)}_read(t){}_write(t,n,e){try{this.checksum.update(t),this.push(t)}catch(i){return e(i)}return e()}async _final(t){try{let n=await this.checksum.digest(),e=this.base64Encoder(n);if(this.expectedChecksum!==e)return t(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${e}" in response header "${this.checksumSourceLocation}".`))}catch(n){return t(n)}return this.push(null),t()}}Ye.ChecksumStream=Ae});var Ve=g((Qe)=>{Object.defineProperty(Qe,"__esModule",{value:!0});Qe.ChecksumStream=void 0;var Gs=typeof ReadableStream==="function"?ReadableStream:function(){};class Ze extends Gs{}Qe.ChecksumStream=Ze});var je=g((Xe)=>{Object.defineProperty(Xe,"__esModule",{value:!0});Xe.createChecksumStream=void 0;var js=X(),Js=Y(),ps=Ve(),Bs=({expectedChecksum:t,checksum:n,source:e,checksumSourceLocation:i,base64Encoder:r})=>{var s,c;if(!Js.isReadableStream(e))throw new Error(`@smithy/util-stream: unsupported source type ${(c=(s=e===null||e===void 0?void 0:e.constructor)===null||s===void 0?void 0:s.name)!==null&&c!==void 0?c:e} in ChecksumStream.`);let f=r!==null&&r!==void 0?r:js.toBase64;if(typeof TransformStream!=="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let o=new TransformStream({start(){},async transform(x,h){n.update(x),h.enqueue(x)},async flush(x){let h=await n.digest(),u=f(h);if(t!==u){let l=new Error(`Checksum mismatch: expected "${t}" but received "${u}" in response header "${i}".`);x.error(l)}else x.terminate()}});e.pipeThrough(o);let a=o.readable;return Object.setPrototypeOf(a,ps.ChecksumStream.prototype),a};Xe.createChecksumStream=Bs});var Be=g((Je)=>{Object.defineProperty(Je,"__esModule",{value:!0});Je.createChecksumStream=void 0;var ks=Y(),Hs=Tt(),Os=je();function vs(t){if(typeof ReadableStream==="function"&&ks.isReadableStream(t.source))return Os.createChecksumStream(t);return new Hs.ChecksumStream(t)}Je.createChecksumStream=vs});var me=g((Uf,U)=>{var{defineProperty:it,getOwnPropertyDescriptor:Ps,getOwnPropertyNames:ms}=Object,qs=Object.prototype.hasOwnProperty,St=(t,n)=>it(t,"name",{value:n,configurable:!0}),_s=(t,n)=>{for(var e in n)it(t,e,{get:n[e],enumerable:!0})},Ct=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of ms(n))if(!qs.call(t,r)&&r!==e)it(t,r,{get:()=>n[r],enumerable:!(i=Ps(n,r))||i.enumerable})}return t},W=(t,n,e)=>(Ct(t,n,"default"),e&&Ct(e,n,"default")),tc=(t)=>Ct(it({},"__esModule",{value:!0}),t),M={};_s(M,{Uint8ArrayBlobAdapter:()=>gt});U.exports=tc(M);var ke=X(),He=O();function Oe(t,n="utf-8"){if(n==="base64")return ke.toBase64(t);return He.toUtf8(t)}St(Oe,"transformToString");function ve(t,n){if(n==="base64")return gt.mutate(ke.fromBase64(t));return gt.mutate(He.fromUtf8(t))}St(ve,"transformFromString");var Pe=class t extends Uint8Array{static fromString(n,e="utf-8"){switch(typeof n){case"string":return ve(n,e);default:throw new Error(`Unsupported conversion from ${typeof n} to Uint8ArrayBlobAdapter.`)}}static mutate(n){return Object.setPrototypeOf(n,t.prototype),n}transformToString(n="utf-8"){return Oe(this,n)}};St(Pe,"Uint8ArrayBlobAdapter");var gt=Pe;W(M,un(),U.exports);W(M,xe(),U.exports);W(M,Ne(),U.exports);W(M,De(),U.exports);W(M,Y(),U.exports);W(M,Be(),U.exports);W(M,Tt(),U.exports)});var j=g((bf,ti)=>{var{defineProperty:Nt,getOwnPropertyDescriptor:nc,getOwnPropertyNames:ec}=Object,ic=Object.prototype.hasOwnProperty,rc=(t,n)=>{for(var e in n)Nt(t,e,{get:n[e],enumerable:!0})},sc=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of ec(n))if(!ic.call(t,r)&&r!==e)Nt(t,r,{get:()=>n[r],enumerable:!(i=nc(n,r))||i.enumerable})}return t},cc=(t)=>sc(Nt({},"__esModule",{value:!0}),t),qe={};rc(qe,{RequestBuilder:()=>_e,collectBody:()=>fc,extendedEncodeURIComponent:()=>It,requestBuilder:()=>dc,resolvedPath:()=>uc});ti.exports=cc(qe);var Ft=me(),fc=async(t=new Uint8Array,n)=>{if(t instanceof Uint8Array)return Ft.Uint8ArrayBlobAdapter.mutate(t);if(!t)return Ft.Uint8ArrayBlobAdapter.mutate(new Uint8Array);let e=n.streamCollector(t);return Ft.Uint8ArrayBlobAdapter.mutate(await e)};function It(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16).toUpperCase()})}var hc=j(),oc=m();function dc(t,n){return new _e(t,n)}var _e=class{constructor(t,n){this.input=t,this.context=n,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){let{hostname:t,protocol:n="https",port:e,path:i}=await this.context.endpoint();this.path=i;for(let r of this.resolvePathStack)r(this.path);return new oc.HttpRequest({protocol:n,hostname:this.hostname||t,port:e,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(t){return this.hostname=t,this}bp(t){return this.resolvePathStack.push((n)=>{this.path=`${(n==null?void 0:n.endsWith("/"))?n.slice(0,-1):n||""}`+t}),this}p(t,n,e,i){return this.resolvePathStack.push((r)=>{this.path=hc.resolvedPath(r,this.input,t,n,e,i)}),this}h(t){return this.headers=t,this}q(t){return this.query=t,this}b(t){return this.body=t,this}m(t){return this.method=t,this}},uc=(t,n,e,i,r,s)=>{if(n!=null&&n[e]!==void 0){let c=i();if(c.length<=0)throw new Error("Empty value provided for input HTTP label: "+e+".");t=t.replace(r,s?c.split("/").map((f)=>It(f)).join("/"):It(c))}else throw new Error("No value provided for input HTTP label: "+e+".");return t}});var D=(t,n)=>{let e=[];if(t)e.push(t);if(n)for(let i of n)e.push(i);return e},b=(t,n)=>{return`${t||"anonymous"}${n&&n.length>0?` (a.k.a. ${n.join(",")})`:""}`},Q=()=>{let t=[],n=[],e=!1,i=new Set,r=(h)=>h.sort((u,l)=>Qt[l.step]-Qt[u.step]||Kt[l.priority||"normal"]-Kt[u.priority||"normal"]),s=(h)=>{let u=!1,l=(E)=>{let C=D(E.name,E.aliases);if(C.includes(h)){u=!0;for(let y of C)i.delete(y);return!1}return!0};return t=t.filter(l),n=n.filter(l),u},c=(h)=>{let u=!1,l=(E)=>{if(E.middleware===h){u=!0;for(let C of D(E.name,E.aliases))i.delete(C);return!1}return!0};return t=t.filter(l),n=n.filter(l),u},f=(h)=>{return t.forEach((u)=>{h.add(u.middleware,{...u})}),n.forEach((u)=>{h.addRelativeTo(u.middleware,{...u})}),h.identifyOnResolve?.(x.identifyOnResolve()),h},o=(h)=>{let u=[];return h.before.forEach((l)=>{if(l.before.length===0&&l.after.length===0)u.push(l);else u.push(...o(l))}),u.push(h),h.after.reverse().forEach((l)=>{if(l.before.length===0&&l.after.length===0)u.push(l);else u.push(...o(l))}),u},a=(h=!1)=>{let u=[],l=[],E={};return t.forEach((y)=>{let $={...y,before:[],after:[]};for(let d of D($.name,$.aliases))E[d]=$;u.push($)}),n.forEach((y)=>{let $={...y,before:[],after:[]};for(let d of D($.name,$.aliases))E[d]=$;l.push($)}),l.forEach((y)=>{if(y.toMiddleware){let $=E[y.toMiddleware];if($===void 0){if(h)return;throw new Error(`${y.toMiddleware} is not found when adding ${b(y.name,y.aliases)} middleware ${y.relation} ${y.toMiddleware}`)}if(y.relation==="after")$.after.push(y);if(y.relation==="before")$.before.push(y)}}),r(u).map(o).reduce((y,$)=>{return y.push(...$),y},[])},x={add:(h,u={})=>{let{name:l,override:E,aliases:C}=u,y={step:"initialize",priority:"normal",middleware:h,...u},$=D(l,C);if($.length>0){if($.some((d)=>i.has(d))){if(!E)throw new Error(`Duplicate middleware name '${b(l,C)}'`);for(let d of $){let w=t.findIndex((I)=>I.name===d||I.aliases?.some((L)=>L===d));if(w===-1)continue;let T=t[w];if(T.step!==y.step||y.priority!==T.priority)throw new Error(`"${b(T.name,T.aliases)}" middleware with ${T.priority} priority in ${T.step} step cannot be overridden by "${b(l,C)}" middleware with ${y.priority} priority in ${y.step} step.`);t.splice(w,1)}}for(let d of $)i.add(d)}t.push(y)},addRelativeTo:(h,u)=>{let{name:l,override:E,aliases:C}=u,y={middleware:h,...u},$=D(l,C);if($.length>0){if($.some((d)=>i.has(d))){if(!E)throw new Error(`Duplicate middleware name '${b(l,C)}'`);for(let d of $){let w=n.findIndex((I)=>I.name===d||I.aliases?.some((L)=>L===d));if(w===-1)continue;let T=n[w];if(T.toMiddleware!==y.toMiddleware||T.relation!==y.relation)throw new Error(`"${b(T.name,T.aliases)}" middleware ${T.relation} "${T.toMiddleware}" middleware cannot be overridden by "${b(l,C)}" middleware ${y.relation} "${y.toMiddleware}" middleware.`);n.splice(w,1)}}for(let d of $)i.add(d)}n.push(y)},clone:()=>f(Q()),use:(h)=>{h.applyToStack(x)},remove:(h)=>{if(typeof h==="string")return s(h);else return c(h)},removeByTag:(h)=>{let u=!1,l=(E)=>{let{tags:C,name:y,aliases:$}=E;if(C&&C.includes(h)){let d=D(y,$);for(let w of d)i.delete(w);return u=!0,!1}return!0};return t=t.filter(l),n=n.filter(l),u},concat:(h)=>{let u=f(Q());return u.use(h),u.identifyOnResolve(e||u.identifyOnResolve()||(h.identifyOnResolve?.()??!1)),u},applyToStack:f,identify:()=>{return a(!0).map((h)=>{let u=h.step??h.relation+" "+h.toMiddleware;return b(h.name,h.aliases)+" - "+u})},identifyOnResolve(h){if(typeof h==="boolean")e=h;return e},resolve:(h,u)=>{for(let l of a().map((E)=>E.middleware).reverse())h=l(h,u);if(e)console.log(x.identify());return h}};return x},Qt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Kt={high:3,normal:2,low:1};class Ni{constructor(t){this.config=t,this.middlewareStack=Q()}send(t,n,e){let i=typeof n!=="function"?n:void 0,r=typeof n==="function"?n:e,s=i===void 0&&this.config.cacheMiddleware===!0,c;if(s){if(!this.handlers)this.handlers=new WeakMap;let f=this.handlers;if(f.has(t.constructor))c=f.get(t.constructor);else c=t.resolveMiddleware(this.middlewareStack,this.config,i),f.set(t.constructor,c)}else delete this.handlers,c=t.resolveMiddleware(this.middlewareStack,this.config,i);if(r)c(t).then((f)=>r(null,f.output),(f)=>r(f)).catch(()=>{});else return c(t).then((f)=>f.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var Vt=K(p(),1);class Xt{constructor(){this.middlewareStack=Q()}static classBuilder(){return new Gt}resolveMiddlewareWithContext(t,n,e,{middlewareFn:i,clientName:r,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:f,smithyContext:o,additionalContext:a,CommandCtor:x}){for(let C of i.bind(this)(x,t,n,e))this.middlewareStack.use(C);let h=t.concat(this.middlewareStack),{logger:u}=n,l={logger:u,clientName:r,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:f,[Vt.SMITHY_CONTEXT_KEY]:{commandInstance:this,...o},...a},{requestHandler:E}=n;return h.resolve((C)=>E.handle(C.request,e||{}),l)}}class Gt{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(t)=>t,this._outputFilterSensitiveLog=(t)=>t,this._serializer=null,this._deserializer=null}init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,n,e={}){return this._smithyContext={service:t,operation:n,...e},this}c(t={}){return this._additionalContext=t,this}n(t,n){return this._clientName=t,this._commandName=n,this}f(t=(e)=>e,n=(e)=>e){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=n,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}build(){let t=this,n;return n=class extends Xt{static getEndpointParameterInstructions(){return t._ep}constructor(...[e]){super();this.serialize=t._serializer,this.deserialize=t._deserializer,this.input=e??{},t._init(this)}resolveMiddleware(e,i,r){return this.resolveMiddlewareWithContext(e,i,r,{CommandCtor:n,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog,outputFilterSensitiveLog:t._outputFilterSensitiveLog,smithyContext:t._smithyContext,additionalContext:t._additionalContext})}}}}var _c="***SensitiveInformation***";var nf=(t,n)=>{for(let e of Object.keys(t)){let i=t[e],r=async function(c,f,o){let a=new i(c);if(typeof f==="function")this.send(a,f);else if(typeof o==="function"){if(typeof f!=="object")throw new Error(`Expected http options but got ${typeof f}`);this.send(a,f||{},o)}else return this.send(a,f)},s=(e[0].toLowerCase()+e.slice(1)).replace(/Command$/,"");n.prototype[s]=r}};class jt extends Error{constructor(t){super(t.message);Object.setPrototypeOf(this,jt.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}}var Jt=(t,n={})=>{Object.entries(n).filter(([,i])=>i!==void 0).forEach(([i,r])=>{if(t[i]==null||t[i]==="")t[i]=r});let e=t.message||t.Message||"UnknownError";return t.message=e,delete t.Message,t};var lc=K(j(),1);var ac=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string"){let n=parseFloat(t);if(!Number.isNaN(n)){if(String(n)!==String(t))hi.warn(fi(`Expected number but observed string: ${t}`));return n}}if(typeof t==="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)},wc=Math.ceil(340282346638528860000000000000000000000),ni=(t)=>{let n=ac(t);if(n!==void 0&&!Number.isNaN(n)&&n!==1/0&&n!==-1/0){if(Math.abs(n)>wc)throw new TypeError(`Expected 32-bit float, got ${t}`)}return n},yc=(t)=>{if(t===null||t===void 0)return;if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw new TypeError(`Expected integer, got ${typeof t}: ${t}`)};var ei=(t)=>Lt(t,32),ii=(t)=>Lt(t,16),ri=(t)=>Lt(t,8),Lt=(t,n)=>{let e=yc(t);if(e!==void 0&&$c(e,n)!==e)throw new TypeError(`Expected ${n}-bit integer, got ${t}`);return e},$c=(t,n)=>{switch(n){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},Af=(t,n)=>{if(t===null||t===void 0){if(n)throw new TypeError(`Expected a non-null value for ${n}`);throw new TypeError("Expected a non-null value")}return t},Yf=(t)=>{if(t===null||t===void 0)return;if(typeof t==="object"&&!Array.isArray(t))return t;let n=Array.isArray(t)?"array":typeof t;throw new TypeError(`Expected object, got ${n}: ${t}`)},Wf=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string")return t;if(["boolean","number","bigint"].includes(typeof t))return hi.warn(fi(`Expected string, got ${typeof t}: ${t}`)),String(t);throw new TypeError(`Expected string, got ${typeof t}: ${t}`)};var si=(t)=>{if(typeof t=="string")return ni(rt(t));return ni(t)},Ec=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,rt=(t)=>{let n=t.match(Ec);if(n===null||n[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)};var Zf=(t)=>{if(typeof t==="string")return ei(rt(t));return ei(t)},zt=(t)=>{if(typeof t==="string")return ii(rt(t));return ii(t)},ci=(t)=>{if(typeof t==="string")return ri(rt(t));return ri(t)},fi=(t)=>{return String(new TypeError(t).stack||t).split("\n").slice(0,5).filter((n)=>!n.includes("stackTraceWarning")).join("\n")},hi={warn:console.warn};var xc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var Tc=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Xf=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let n=Tc.exec(t);if(!n)throw new TypeError("Invalid RFC-3339 date-time value");let[e,i,r,s,c,f,o,a]=n,x=zt(Mt(i)),h=Z(r,"month",1,12),u=Z(s,"day",1,31);return oi(x,h,u,{hours:c,minutes:f,seconds:o,fractionalMilliseconds:a})},Cc=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Gf=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let n=Cc.exec(t);if(!n)throw new TypeError("Invalid RFC-3339 date-time value");let[e,i,r,s,c,f,o,a,x]=n,h=zt(Mt(i)),u=Z(r,"month",1,12),l=Z(s,"day",1,31),E=oi(h,u,l,{hours:c,minutes:f,seconds:o,fractionalMilliseconds:a});if(x.toUpperCase()!="Z")E.setTime(E.getTime()-Nc(x));return E},jf=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Jf=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),pf=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);var oi=(t,n,e,i)=>{let r=n-1;return Sc(t,r,e),new Date(Date.UTC(t,r,e,Z(i.hours,"hour",0,23),Z(i.minutes,"minute",0,59),Z(i.seconds,"seconds",0,60),Ic(i.fractionalMilliseconds)))};var gc=[31,28,31,30,31,30,31,31,30,31,30,31],Sc=(t,n,e)=>{let i=gc[n];if(n===1&&Fc(t))i=29;if(e>i)throw new TypeError(`Invalid day for ${xc[n]} in ${t}: ${e}`)},Fc=(t)=>{return t%4===0&&(t%100!==0||t%400===0)},Z=(t,n,e,i)=>{let r=ci(Mt(t));if(r<e||r>i)throw new TypeError(`${n} must be between ${e} and ${i}, inclusive`);return r},Ic=(t)=>{if(t===null||t===void 0)return 0;return si("0."+t)*1000},Nc=(t)=>{let n=t[0],e=1;if(n=="+")e=1;else if(n=="-")e=-1;else throw new TypeError(`Offset direction, ${n}, must be "+" or "-"`);let i=Number(t.substring(1,3)),r=Number(t.substring(4,6));return e*(i*60+r)*60*1000},Mt=(t)=>{let n=0;while(n<t.length-1&&t.charAt(n)==="0")n++;if(n===0)return t;return t.slice(n)};var Lc=({output:t,parsedBody:n,exceptionCtor:e,errorCode:i})=>{let r=zc(t),s=r.httpStatusCode?r.httpStatusCode+"":void 0,c=new e({name:n?.code||n?.Code||i||s||"UnknownError",$fault:"client",$metadata:r});throw Jt(c,n)},Hf=(t)=>{return({output:n,parsedBody:e,errorCode:i})=>{Lc({output:n,parsedBody:e,exceptionCtor:t,errorCode:i})}},zc=(t)=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]});var vf=(t)=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}};var di=!1,mf=(t)=>{if(t&&!di&&parseInt(t.substring(1,t.indexOf(".")))<16)di=!0};var Mc=K(j(),1);var Ut=K(p(),1);var ui=(t)=>{let n=[];for(let e in Ut.AlgorithmId){let i=Ut.AlgorithmId[e];if(t[i]===void 0)continue;n.push({algorithmId:()=>i,checksumConstructor:()=>t[i]})}return{_checksumAlgorithms:n,addChecksumAlgorithm(e){this._checksumAlgorithms.push(e)},checksumAlgorithms(){return this._checksumAlgorithms}}},li=(t)=>{let n={};return t.checksumAlgorithms().forEach((e)=>{n[e.algorithmId()]=e.checksumConstructor()}),n};var ai=(t)=>{let n=t.retryStrategy;return{setRetryStrategy(e){n=e},retryStrategy(){return n}}},wi=(t)=>{let n={};return n.retryStrategy=t.retryStrategy(),n};var rh=(t)=>{return{...ui(t),...ai(t)}};var sh=(t)=>{return{...li(t),...wi(t)}};var oh=(t)=>Array.isArray(t)?t:[t];var lh=(t)=>{return t!=null};var bt=function(){let t=Object.getPrototypeOf(this).constructor,e=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(e,t.prototype),e};bt.prototype=Object.create(String.prototype,{constructor:{value:bt,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(bt,String);class Uc{trace(){}debug(){}info(){}warn(){}error(){}}function bc(t,n,e){let i,r,s;if(typeof n==="undefined"&&typeof e==="undefined")i={},s=t;else if(i=t,typeof n==="function")return r=n,s=e,Rc(i,r,s);else s=n;for(let c of Object.keys(s)){if(!Array.isArray(s[c])){i[c]=s[c];continue}yi(i,null,s,c)}return i}var $h=(t,n)=>{let e={};for(let i in n)yi(e,t,n,i);return e},Rc=(t,n,e)=>{return bc(t,Object.entries(e).reduce((i,[r,s])=>{if(Array.isArray(s))i[r]=s;else if(typeof s==="function")i[r]=[n,s()];else i[r]=[n,s];return i},{}))},yi=(t,n,e,i)=>{if(n!==null){let c=e[i];if(typeof c==="function")c=[,c];let[f=Dc,o=Ac,a=i]=c;if(typeof f==="function"&&f(n[a])||typeof f!=="function"&&!!f)t[i]=o(n[a]);return}let[r,s]=e[i];if(typeof s==="function"){let c,f=r===void 0&&(c=s())!=null,o=typeof r==="function"&&!!r(void 0)||typeof r!=="function"&&!!r;if(f)t[i]=c;else if(o)t[i]=s()}else{let c=r===void 0&&s!=null,f=typeof r==="function"&&!!r(s)||typeof r!=="function"&&!!r;if(c||f)t[i]=s}},Dc=(t)=>t!=null,Ac=(t)=>t;var Yc=K(j(),1);var $i=(t)=>{if(t==null)return{};if(Array.isArray(t))return t.filter((n)=>n!=null).map($i);if(typeof t==="object"){let n={};for(let e of Object.keys(t)){if(t[e]==null)continue;n[e]=$i(t[e])}return n}return t};var Ph=(t)=>{let n=t.httpHandler;return{setHttpHandler(e){n=e},httpHandler(){return n},updateHttpClientConfig(e,i){n.updateHttpClientConfig(e,i)},httpHandlerConfigs(){return n.httpHandlerConfigs()}}},mh=(t)=>{return{httpHandler:t.httpHandler()}};var Wc=K(p(),1);class Rt{constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){let n=new Rt({...t,headers:{...t.headers}});if(n.query)n.query=Zc(n.query);return n}static isInstance(t){if(!t)return!1;let n=t;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query==="object"&&typeof n.headers==="object"}clone(){return Rt.clone(this)}}function Zc(t){return Object.keys(t).reduce((n,e)=>{let i=t[e];return{...n,[e]:Array.isArray(i)?[...i]:i}},{})}class st{constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;let n=t;return typeof n.statusCode==="number"&&typeof n.headers==="object"}}var J=(t)=>encodeURIComponent(t).replace(/[!'()*]/g,Qc),Qc=(t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`;function Dt(t){let n=[];for(let e of Object.keys(t).sort()){let i=t[e];if(e=J(e),Array.isArray(i))for(let r=0,s=i.length;r<s;r++)n.push(`${e}=${J(i[r])}`);else{let r=e;if(i||typeof i==="string")r+=`=${J(i)}`;n.push(r)}}return n.join("&")}import{Agent as Si,request as Xc}from"http";import{Agent as Fi,request as Gc}from"https";var Ei=["ECONNRESET","EPIPE","ETIMEDOUT"];var At=(t)=>{let n={};for(let e of Object.keys(t)){let i=t[e];n[e]=Array.isArray(i)?i.join(","):i}return n};var xi=(t,n,e=0)=>{if(!e)return-1;let i=(r)=>{let s=setTimeout(()=>{t.destroy(),n(Object.assign(new Error(`Socket timed out without establishing a connection within ${e} ms`),{name:"TimeoutError"}))},e-r),c=(f)=>{if(f?.connecting)f.on("connect",()=>{clearTimeout(s)});else clearTimeout(s)};if(t.socket)c(t.socket);else t.on("socket",c)};if(e<2000)return i(0),0;return setTimeout(i.bind(null,1000),1000)};var Ti=(t,{keepAlive:n,keepAliveMsecs:e},i=3000)=>{if(n!==!0)return-1;let r=()=>{if(t.socket)t.socket.setKeepAlive(n,e||0);else t.on("socket",(s)=>{s.setKeepAlive(n,e||0)})};if(i===0)return r(),0;return setTimeout(r,i)};var Ci=(t,n,e=0)=>{let i=(r)=>{t.setTimeout(e-r,()=>{t.destroy(),n(Object.assign(new Error(`Connection timed out after ${e} ms`),{name:"TimeoutError"}))})};if(0<e&&e<6000)return i(0),0;return setTimeout(i.bind(null,e===0?0:3000),3000)};import{Readable as Kc}from"stream";var gi=1000;async function Yt(t,n,e=gi){let i=n.headers??{},r=i.Expect||i.expect,s=-1,c=!1;if(r==="100-continue")await Promise.race([new Promise((f)=>{s=Number(setTimeout(f,Math.max(gi,e)))}),new Promise((f)=>{t.on("continue",()=>{clearTimeout(s),f()}),t.on("error",()=>{c=!0,clearTimeout(s),f()})})]);if(!c)Vc(t,n.body)}function Vc(t,n){if(n instanceof Kc){n.pipe(t);return}if(n){if(Buffer.isBuffer(n)||typeof n==="string"){t.end(n);return}let e=n;if(typeof e==="object"&&e.buffer&&typeof e.byteOffset==="number"&&typeof e.byteLength==="number"){t.end(Buffer.from(e.buffer,e.byteOffset,e.byteLength));return}t.end(Buffer.from(n));return}t.end()}class Wt{static create(t){if(typeof t?.handle==="function")return t;return new Wt(t)}static checkSocketUsage(t,n,e=console){let{sockets:i,requests:r,maxSockets:s}=t;if(typeof s!=="number"||s===1/0)return n;let c=15000;if(Date.now()-c<n)return n;if(i&&r)for(let f in i){let o=i[f]?.length??0,a=r[f]?.length??0;if(o>=s&&a>=2*s)return e?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${o} and ${a} additional requests are enqueued.
4
- See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
5
- or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return n}constructor(t){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((n,e)=>{if(typeof t==="function")t().then((i)=>{n(this.resolveDefaultConfig(i))}).catch(e);else n(this.resolveDefaultConfig(t))})}resolveDefaultConfig(t){let{requestTimeout:n,connectionTimeout:e,socketTimeout:i,httpAgent:r,httpsAgent:s}=t||{},c=!0,f=50;return{connectionTimeout:e,requestTimeout:n??i,httpAgent:(()=>{if(r instanceof Si||typeof r?.destroy==="function")return r;return new Si({keepAlive:!0,maxSockets:50,...r})})(),httpsAgent:(()=>{if(s instanceof Fi||typeof s?.destroy==="function")return s;return new Fi({keepAlive:!0,maxSockets:50,...s})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:n}={}){if(!this.config)this.config=await this.configProvider;return new Promise((e,i)=>{let r=void 0,s=[],c=async(d)=>{await r,s.forEach(clearTimeout),e(d)},f=async(d)=>{await r,s.forEach(clearTimeout),i(d)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(n?.aborted){let d=new Error("Request aborted");d.name="AbortError",f(d);return}let o=t.protocol==="https:",a=o?this.config.httpsAgent:this.config.httpAgent;s.push(setTimeout(()=>{this.socketWarningTimestamp=Wt.checkSocketUsage(a,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let x=Dt(t.query||{}),h=void 0;if(t.username!=null||t.password!=null){let d=t.username??"",w=t.password??"";h=`${d}:${w}`}let u=t.path;if(x)u+=`?${x}`;if(t.fragment)u+=`#${t.fragment}`;let l=t.hostname??"";if(l[0]==="["&&l.endsWith("]"))l=t.hostname.slice(1,-1);else l=t.hostname;let E={headers:t.headers,host:l,method:t.method,path:u,port:t.port,agent:a,auth:h},y=(o?Gc:Xc)(E,(d)=>{let w=new st({statusCode:d.statusCode||-1,reason:d.statusMessage,headers:At(d.headers),body:d});c({response:w})});if(y.on("error",(d)=>{if(Ei.includes(d.code))f(Object.assign(d,{name:"TimeoutError"}));else f(d)}),n){let d=()=>{y.destroy();let w=new Error("Request aborted");w.name="AbortError",f(w)};if(typeof n.addEventListener==="function"){let w=n;w.addEventListener("abort",d,{once:!0}),y.once("close",()=>w.removeEventListener("abort",d))}else n.onabort=d}s.push(xi(y,f,this.config.connectionTimeout)),s.push(Ci(y,f,this.config.requestTimeout));let $=E.agent;if(typeof $==="object"&&"keepAlive"in $)s.push(Ti(y,{keepAlive:$.keepAlive,keepAliveMsecs:$.keepAliveMsecs}));r=Yt(y,t,this.config.requestTimeout).catch((d)=>{return s.forEach(clearTimeout),i(d)})})}updateHttpClientConfig(t,n){this.config=void 0,this.configProvider=this.configProvider.then((e)=>{return{...e,[t]:n}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as jc}from"stream";class Zt extends jc{constructor(){super(...arguments);this.bufferedBytes=[]}_write(t,n,e){this.bufferedBytes.push(t),e()}}var ed=(t)=>{if(Jc(t))return pc(t);return new Promise((n,e)=>{let i=new Zt;t.pipe(i),t.on("error",(r)=>{i.end(),e(r)}),i.on("error",e),i.on("finish",function(){let r=new Uint8Array(Buffer.concat(this.bufferedBytes));n(r)})})},Jc=(t)=>typeof ReadableStream==="function"&&t instanceof ReadableStream;async function pc(t){let n=[],e=t.getReader(),i=!1,r=0;while(!i){let{done:f,value:o}=await e.read();if(o)n.push(o),r+=o.length;i=f}let s=new Uint8Array(r),c=0;for(let f of n)s.set(f,c),c+=f.length;return s}export{Ph as xa,mh as ya,Rt as za,st as Aa,m as Ba,kt as Ca,O as Da,X as Ea,In as Fa,ce as Ga,me as Ha,j as Ia,Ni as Ja,Xt as Ka,_c as La,nf as Ma,yc as Na,ei as Oa,Af as Pa,Yf as Qa,Wf as Ra,Zf as Sa,Xf as Ta,Gf as Ua,jt as Va,Jt as Wa,Hf as Xa,vf as Ya,mf as Za,Mc as _a,rh as $a,sh as ab,oh as bb,lh as cb,Uc as db,bc as eb,$h as fb,$i as gb,Wt as hb,ed as ib};
@@ -1,5 +0,0 @@
1
- import{rb as p}from"./chunk-avdharmq.js";import{Cb as K,Eb as g}from"./chunk-p9z7f8c8.js";var kt=g((sf,Bt)=>{var{defineProperty:B,getOwnPropertyDescriptor:Li,getOwnPropertyNames:zi}=Object,Mi=Object.prototype.hasOwnProperty,Ui=(t,n)=>B(t,"name",{value:n,configurable:!0}),bi=(t,n)=>{for(var e in n)B(t,e,{get:n[e],enumerable:!0})},Ri=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of zi(n))if(!Mi.call(t,r)&&r!==e)B(t,r,{get:()=>n[r],enumerable:!(i=Li(n,r))||i.enumerable})}return t},Di=(t)=>Ri(B({},"__esModule",{value:!0}),t),pt={};bi(pt,{isArrayBuffer:()=>Ai});Bt.exports=Di(pt);var Ai=Ui((t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]","isArrayBuffer")});var V=g((cf,vt)=>{var{defineProperty:k,getOwnPropertyDescriptor:Yi,getOwnPropertyNames:Wi}=Object,Zi=Object.prototype.hasOwnProperty,Ht=(t,n)=>k(t,"name",{value:n,configurable:!0}),Qi=(t,n)=>{for(var e in n)k(t,e,{get:n[e],enumerable:!0})},Ki=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of Wi(n))if(!Zi.call(t,r)&&r!==e)k(t,r,{get:()=>n[r],enumerable:!(i=Yi(n,r))||i.enumerable})}return t},Vi=(t)=>Ki(k({},"__esModule",{value:!0}),t),Ot={};Qi(Ot,{fromArrayBuffer:()=>Gi,fromString:()=>ji});vt.exports=Vi(Ot);var Xi=kt(),ft=import.meta.require("buffer"),Gi=Ht((t,n=0,e=t.byteLength-n)=>{if(!Xi.isArrayBuffer(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return ft.Buffer.from(t,n,e)},"fromArrayBuffer"),ji=Ht((t,n)=>{if(typeof t!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return n?ft.Buffer.from(t,n):ft.Buffer.from(t)},"fromString")});var qt=g((Pt)=>{Object.defineProperty(Pt,"__esModule",{value:!0});Pt.fromBase64=void 0;var Ji=V(),pi=/^[A-Za-z0-9+/]*={0,2}$/,Bi=(t)=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!pi.exec(t))throw new TypeError("Invalid base64 string.");let n=Ji.fromString(t,"base64");return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)};Pt.fromBase64=Bi});var O=g((hf,en)=>{var{defineProperty:H,getOwnPropertyDescriptor:ki,getOwnPropertyNames:Hi}=Object,Oi=Object.prototype.hasOwnProperty,ht=(t,n)=>H(t,"name",{value:n,configurable:!0}),vi=(t,n)=>{for(var e in n)H(t,e,{get:n[e],enumerable:!0})},Pi=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of Hi(n))if(!Oi.call(t,r)&&r!==e)H(t,r,{get:()=>n[r],enumerable:!(i=ki(n,r))||i.enumerable})}return t},mi=(t)=>Pi(H({},"__esModule",{value:!0}),t),_t={};vi(_t,{fromUtf8:()=>nn,toUint8Array:()=>qi,toUtf8:()=>_i});en.exports=mi(_t);var tn=V(),nn=ht((t)=>{let n=tn.fromString(t,"utf8");return new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),qi=ht((t)=>{if(typeof t==="string")return nn(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)},"toUint8Array"),_i=ht((t)=>{if(typeof t==="string")return t;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return tn.fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength).toString("utf8")},"toUtf8")});var cn=g((rn)=>{Object.defineProperty(rn,"__esModule",{value:!0});rn.toBase64=void 0;var tr=V(),nr=O(),er=(t)=>{let n;if(typeof t==="string")n=nr.fromUtf8(t);else n=t;if(typeof n!=="object"||typeof n.byteOffset!=="number"||typeof n.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return tr.fromArrayBuffer(n.buffer,n.byteOffset,n.byteLength).toString("base64")};rn.toBase64=er});var X=g((df,v)=>{var{defineProperty:fn,getOwnPropertyDescriptor:ir,getOwnPropertyNames:rr}=Object,sr=Object.prototype.hasOwnProperty,ot=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of rr(n))if(!sr.call(t,r)&&r!==e)fn(t,r,{get:()=>n[r],enumerable:!(i=ir(n,r))||i.enumerable})}return t},hn=(t,n,e)=>(ot(t,n,"default"),e&&ot(e,n,"default")),cr=(t)=>ot(fn({},"__esModule",{value:!0}),t),dt={};v.exports=cr(dt);hn(dt,qt(),v.exports);hn(dt,cn(),v.exports)});var un=g((on)=>{Object.defineProperty(on,"__esModule",{value:!0});on.getAwsChunkedEncodingStream=void 0;var fr=import.meta.require("stream"),hr=(t,n)=>{let{base64Encoder:e,bodyLengthChecker:i,checksumAlgorithmFn:r,checksumLocationName:s,streamHasher:c}=n,f=e!==void 0&&r!==void 0&&s!==void 0&&c!==void 0,o=f?c(r,t):void 0,a=new fr.Readable({read:()=>{}});return t.on("data",(x)=>{let h=i(x)||0;a.push(`${h.toString(16)}\r\n`),a.push(x),a.push("\r\n")}),t.on("end",async()=>{if(a.push("0\r\n"),f){let x=e(await o);a.push(`${s}:${x}\r\n`),a.push("\r\n")}a.push(null)}),a};on.getAwsChunkedEncodingStream=hr});var m=g((lf,Cn)=>{var{defineProperty:P,getOwnPropertyDescriptor:or,getOwnPropertyNames:dr}=Object,ur=Object.prototype.hasOwnProperty,R=(t,n)=>P(t,"name",{value:n,configurable:!0}),lr=(t,n)=>{for(var e in n)P(t,e,{get:n[e],enumerable:!0})},ar=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of dr(n))if(!ur.call(t,r)&&r!==e)P(t,r,{get:()=>n[r],enumerable:!(i=or(n,r))||i.enumerable})}return t},wr=(t)=>ar(P({},"__esModule",{value:!0}),t),ln={};lr(ln,{Field:()=>Er,Fields:()=>xr,HttpRequest:()=>Tr,HttpResponse:()=>Cr,IHttpRequest:()=>an.HttpRequest,getHttpHandlerExtensionConfiguration:()=>yr,isValidHostname:()=>Tn,resolveHttpHandlerRuntimeConfig:()=>$r});Cn.exports=wr(ln);var yr=R((t)=>{let n=t.httpHandler;return{setHttpHandler(e){n=e},httpHandler(){return n},updateHttpClientConfig(e,i){n.updateHttpClientConfig(e,i)},httpHandlerConfigs(){return n.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),$r=R((t)=>{return{httpHandler:t.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),an=p(),wn=class t{constructor({name:n,kind:e=an.FieldPosition.HEADER,values:i=[]}){this.name=n,this.kind=e,this.values=i}add(n){this.values.push(n)}set(n){this.values=n}remove(n){this.values=this.values.filter((e)=>e!==n)}toString(){return this.values.map((n)=>n.includes(",")||n.includes(" ")?`"${n}"`:n).join(", ")}get(){return this.values}};R(wn,"Field");var Er=wn,yn=class t{constructor({fields:n=[],encoding:e="utf-8"}){this.entries={},n.forEach(this.setField.bind(this)),this.encoding=e}setField(n){this.entries[n.name.toLowerCase()]=n}getField(n){return this.entries[n.toLowerCase()]}removeField(n){delete this.entries[n.toLowerCase()]}getByType(n){return Object.values(this.entries).filter((e)=>e.kind===n)}};R(yn,"Fields");var xr=yn,$n=class t{constructor(n){this.method=n.method||"GET",this.hostname=n.hostname||"localhost",this.port=n.port,this.query=n.query||{},this.headers=n.headers||{},this.body=n.body,this.protocol=n.protocol?n.protocol.slice(-1)!==":"?`${n.protocol}:`:n.protocol:"https:",this.path=n.path?n.path.charAt(0)!=="/"?`/${n.path}`:n.path:"/",this.username=n.username,this.password=n.password,this.fragment=n.fragment}static clone(n){let e=new t({...n,headers:{...n.headers}});if(e.query)e.query=En(e.query);return e}static isInstance(n){if(!n)return!1;let e=n;return"method"in e&&"protocol"in e&&"hostname"in e&&"path"in e&&typeof e.query==="object"&&typeof e.headers==="object"}clone(){return t.clone(this)}};R($n,"HttpRequest");var Tr=$n;function En(t){return Object.keys(t).reduce((n,e)=>{let i=t[e];return{...n,[e]:Array.isArray(i)?[...i]:i}},{})}R(En,"cloneQuery");var xn=class t{constructor(n){this.statusCode=n.statusCode,this.reason=n.reason,this.headers=n.headers||{},this.body=n.body}static isInstance(n){if(!n)return!1;let e=n;return typeof e.statusCode==="number"&&typeof e.headers==="object"}};R(xn,"HttpResponse");var Cr=xn;function Tn(t){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(t)}R(Tn,"isValidHostname")});var In=g((af,Fn)=>{var{defineProperty:q,getOwnPropertyDescriptor:gr,getOwnPropertyNames:Sr}=Object,Fr=Object.prototype.hasOwnProperty,ut=(t,n)=>q(t,"name",{value:n,configurable:!0}),Ir=(t,n)=>{for(var e in n)q(t,e,{get:n[e],enumerable:!0})},Nr=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of Sr(n))if(!Fr.call(t,r)&&r!==e)q(t,r,{get:()=>n[r],enumerable:!(i=gr(n,r))||i.enumerable})}return t},Lr=(t)=>Nr(q({},"__esModule",{value:!0}),t),gn={};Ir(gn,{escapeUri:()=>Sn,escapeUriPath:()=>Mr});Fn.exports=Lr(gn);var Sn=ut((t)=>encodeURIComponent(t).replace(/[!'()*]/g,zr),"escapeUri"),zr=ut((t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),Mr=ut((t)=>t.split("/").map(Sn).join("/"),"escapeUriPath")});var at=g((wf,zn)=>{var{defineProperty:_,getOwnPropertyDescriptor:Ur,getOwnPropertyNames:br}=Object,Rr=Object.prototype.hasOwnProperty,Dr=(t,n)=>_(t,"name",{value:n,configurable:!0}),Ar=(t,n)=>{for(var e in n)_(t,e,{get:n[e],enumerable:!0})},Yr=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of br(n))if(!Rr.call(t,r)&&r!==e)_(t,r,{get:()=>n[r],enumerable:!(i=Ur(n,r))||i.enumerable})}return t},Wr=(t)=>Yr(_({},"__esModule",{value:!0}),t),Nn={};Ar(Nn,{buildQueryString:()=>Ln});zn.exports=Wr(Nn);var lt=In();function Ln(t){let n=[];for(let e of Object.keys(t).sort()){let i=t[e];if(e=lt.escapeUri(e),Array.isArray(i))for(let r=0,s=i.length;r<s;r++)n.push(`${e}=${lt.escapeUri(i[r])}`);else{let r=e;if(i||typeof i==="string")r+=`=${lt.escapeUri(i)}`;n.push(r)}}return n.join("&")}Dr(Ln,"buildQueryString")});var kn=g((yf,Bn)=>{var{create:Zr,defineProperty:G,getOwnPropertyDescriptor:Qr,getOwnPropertyNames:Kr,getPrototypeOf:Vr}=Object,Xr=Object.prototype.hasOwnProperty,S=(t,n)=>G(t,"name",{value:n,configurable:!0}),Gr=(t,n)=>{for(var e in n)G(t,e,{get:n[e],enumerable:!0})},Dn=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of Kr(n))if(!Xr.call(t,r)&&r!==e)G(t,r,{get:()=>n[r],enumerable:!(i=Qr(n,r))||i.enumerable})}return t},jr=(t,n,e)=>(e=t!=null?Zr(Vr(t)):{},Dn(n||!t||!t.__esModule?G(e,"default",{value:t,enumerable:!0}):e,t)),Jr=(t)=>Dn(G({},"__esModule",{value:!0}),t),An={};Gr(An,{DEFAULT_REQUEST_TIMEOUT:()=>vr,NodeHttp2Handler:()=>ts,NodeHttpHandler:()=>Pr,streamCollector:()=>es});Bn.exports=Jr(An);var Yn=m(),Wn=at(),wt=import.meta.require("http"),yt=import.meta.require("https"),pr=["ECONNRESET","EPIPE","ETIMEDOUT"],Zn=S((t)=>{let n={};for(let e of Object.keys(t)){let i=t[e];n[e]=Array.isArray(i)?i.join(","):i}return n},"getTransformedHeaders"),Mn=1000,Br=S((t,n,e=0)=>{if(!e)return-1;let i=S((r)=>{let s=setTimeout(()=>{t.destroy(),n(Object.assign(new Error(`Socket timed out without establishing a connection within ${e} ms`),{name:"TimeoutError"}))},e-r),c=S((f)=>{if(f==null?void 0:f.connecting)f.on("connect",()=>{clearTimeout(s)});else clearTimeout(s)},"doWithSocket");if(t.socket)c(t.socket);else t.on("socket",c)},"registerTimeout");if(e<2000)return i(0),0;return setTimeout(i.bind(null,Mn),Mn)},"setConnectionTimeout"),kr=3000,Hr=S((t,{keepAlive:n,keepAliveMsecs:e},i=kr)=>{if(n!==!0)return-1;let r=S(()=>{if(t.socket)t.socket.setKeepAlive(n,e||0);else t.on("socket",(s)=>{s.setKeepAlive(n,e||0)})},"registerListener");if(i===0)return r(),0;return setTimeout(r,i)},"setSocketKeepAlive"),Un=3000,Or=S((t,n,e=0)=>{let i=S((r)=>{t.setTimeout(e-r,()=>{t.destroy(),n(Object.assign(new Error(`Connection timed out after ${e} ms`),{name:"TimeoutError"}))})},"registerTimeout");if(0<e&&e<6000)return i(0),0;return setTimeout(i.bind(null,e===0?0:Un),Un)},"setSocketTimeout"),Qn=import.meta.require("stream"),bn=1000;async function $t(t,n,e=bn){let i=n.headers??{},r=i.Expect||i.expect,s=-1,c=!1;if(r==="100-continue")await Promise.race([new Promise((f)=>{s=Number(setTimeout(f,Math.max(bn,e)))}),new Promise((f)=>{t.on("continue",()=>{clearTimeout(s),f()}),t.on("error",()=>{c=!0,clearTimeout(s),f()})})]);if(!c)Kn(t,n.body)}S($t,"writeRequestBody");function Kn(t,n){if(n instanceof Qn.Readable){n.pipe(t);return}if(n){if(Buffer.isBuffer(n)||typeof n==="string"){t.end(n);return}let e=n;if(typeof e==="object"&&e.buffer&&typeof e.byteOffset==="number"&&typeof e.byteLength==="number"){t.end(Buffer.from(e.buffer,e.byteOffset,e.byteLength));return}t.end(Buffer.from(n));return}t.end()}S(Kn,"writeBody");var vr=0,Vn=class t{constructor(n){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((e,i)=>{if(typeof n==="function")n().then((r)=>{e(this.resolveDefaultConfig(r))}).catch(i);else e(this.resolveDefaultConfig(n))})}static create(n){if(typeof(n==null?void 0:n.handle)==="function")return n;return new t(n)}static checkSocketUsage(n,e,i=console){var r,s,c;let{sockets:f,requests:o,maxSockets:a}=n;if(typeof a!=="number"||a===1/0)return e;let x=15000;if(Date.now()-x<e)return e;if(f&&o)for(let h in f){let u=((r=f[h])==null?void 0:r.length)??0,l=((s=o[h])==null?void 0:s.length)??0;if(u>=a&&l>=2*a)return(c=i==null?void 0:i.warn)==null||c.call(i,`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${l} additional requests are enqueued.
2
- See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
3
- or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return e}resolveDefaultConfig(n){let{requestTimeout:e,connectionTimeout:i,socketTimeout:r,httpAgent:s,httpsAgent:c}=n||{},f=!0,o=50;return{connectionTimeout:i,requestTimeout:e??r,httpAgent:(()=>{if(s instanceof wt.Agent||typeof(s==null?void 0:s.destroy)==="function")return s;return new wt.Agent({keepAlive:!0,maxSockets:50,...s})})(),httpsAgent:(()=>{if(c instanceof yt.Agent||typeof(c==null?void 0:c.destroy)==="function")return c;return new yt.Agent({keepAlive:!0,maxSockets:50,...c})})(),logger:console}}destroy(){var n,e,i,r;(e=(n=this.config)==null?void 0:n.httpAgent)==null||e.destroy(),(r=(i=this.config)==null?void 0:i.httpsAgent)==null||r.destroy()}async handle(n,{abortSignal:e}={}){if(!this.config)this.config=await this.configProvider;return new Promise((i,r)=>{let s=void 0,c=[],f=S(async(w)=>{await s,c.forEach(clearTimeout),i(w)},"resolve"),o=S(async(w)=>{await s,c.forEach(clearTimeout),r(w)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(e==null?void 0:e.aborted){let w=new Error("Request aborted");w.name="AbortError",o(w);return}let a=n.protocol==="https:",x=a?this.config.httpsAgent:this.config.httpAgent;c.push(setTimeout(()=>{this.socketWarningTimestamp=t.checkSocketUsage(x,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let h=Wn.buildQueryString(n.query||{}),u=void 0;if(n.username!=null||n.password!=null){let w=n.username??"",T=n.password??"";u=`${w}:${T}`}let l=n.path;if(h)l+=`?${h}`;if(n.fragment)l+=`#${n.fragment}`;let E=n.hostname??"";if(E[0]==="["&&E.endsWith("]"))E=n.hostname.slice(1,-1);else E=n.hostname;let C={headers:n.headers,host:E,method:n.method,path:l,port:n.port,agent:x,auth:u},$=(a?yt.request:wt.request)(C,(w)=>{let T=new Yn.HttpResponse({statusCode:w.statusCode||-1,reason:w.statusMessage,headers:Zn(w.headers),body:w});f({response:T})});if($.on("error",(w)=>{if(pr.includes(w.code))o(Object.assign(w,{name:"TimeoutError"}));else o(w)}),e){let w=S(()=>{$.destroy();let T=new Error("Request aborted");T.name="AbortError",o(T)},"onAbort");if(typeof e.addEventListener==="function"){let T=e;T.addEventListener("abort",w,{once:!0}),$.once("close",()=>T.removeEventListener("abort",w))}else e.onabort=w}c.push(Br($,o,this.config.connectionTimeout)),c.push(Or($,o,this.config.requestTimeout));let d=C.agent;if(typeof d==="object"&&"keepAlive"in d)c.push(Hr($,{keepAlive:d.keepAlive,keepAliveMsecs:d.keepAliveMsecs}));s=$t($,n,this.config.requestTimeout).catch((w)=>{return c.forEach(clearTimeout),r(w)})})}updateHttpClientConfig(n,e){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return{...i,[n]:e}})}httpHandlerConfigs(){return this.config??{}}};S(Vn,"NodeHttpHandler");var Pr=Vn,Rn=import.meta.require("http2"),mr=jr(import.meta.require("http2")),Xn=class t{constructor(n){this.sessions=[],this.sessions=n??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(n){this.sessions.push(n)}contains(n){return this.sessions.includes(n)}remove(n){this.sessions=this.sessions.filter((e)=>e!==n)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(n){for(let e of this.sessions)if(e===n){if(!e.destroyed)e.destroy()}}};S(Xn,"NodeHttp2ConnectionPool");var qr=Xn,Gn=class t{constructor(n){if(this.sessionCache=new Map,this.config=n,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(n,e){let i=this.getUrlString(n),r=this.sessionCache.get(i);if(r){let o=r.poll();if(o&&!this.config.disableConcurrency)return o}let s=mr.default.connect(i);if(this.config.maxConcurrency)s.settings({maxConcurrentStreams:this.config.maxConcurrency},(o)=>{if(o)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+n.destination.toString())});s.unref();let c=S(()=>{s.destroy(),this.deleteSession(i,s)},"destroySessionCb");if(s.on("goaway",c),s.on("error",c),s.on("frameError",c),s.on("close",()=>this.deleteSession(i,s)),e.requestTimeout)s.setTimeout(e.requestTimeout,c);let f=this.sessionCache.get(i)||new qr;return f.offerLast(s),this.sessionCache.set(i,f),s}deleteSession(n,e){let i=this.sessionCache.get(n);if(!i)return;if(!i.contains(e))return;i.remove(e),this.sessionCache.set(n,i)}release(n,e){var i;let r=this.getUrlString(n);(i=this.sessionCache.get(r))==null||i.offerLast(e)}destroy(){for(let[n,e]of this.sessionCache){for(let i of e){if(!i.destroyed)i.destroy();e.remove(i)}this.sessionCache.delete(n)}}setMaxConcurrentStreams(n){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=n}setDisableConcurrentStreams(n){this.config.disableConcurrency=n}getUrlString(n){return n.destination.toString()}};S(Gn,"NodeHttp2ConnectionManager");var _r=Gn,jn=class t{constructor(n){this.metadata={handlerProtocol:"h2"},this.connectionManager=new _r({}),this.configProvider=new Promise((e,i)=>{if(typeof n==="function")n().then((r)=>{e(r||{})}).catch(i);else e(n||{})})}static create(n){if(typeof(n==null?void 0:n.handle)==="function")return n;return new t(n)}destroy(){this.connectionManager.destroy()}async handle(n,{abortSignal:e}={}){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:i,disableConcurrentStreams:r}=this.config;return new Promise((s,c)=>{var f;let o=!1,a=void 0,x=S(async(F)=>{await a,s(F)},"resolve"),h=S(async(F)=>{await a,c(F)},"reject");if(e==null?void 0:e.aborted){o=!0;let F=new Error("Request aborted");F.name="AbortError",h(F);return}let{hostname:u,method:l,port:E,protocol:C,query:y}=n,$="";if(n.username!=null||n.password!=null){let F=n.username??"",z=n.password??"";$=`${F}:${z}@`}let d=`${C}//${$}${u}${E?`:${E}`:""}`,w={destination:new URL(d)},T=this.connectionManager.lease(w,{requestTimeout:(f=this.config)==null?void 0:f.sessionTimeout,disableConcurrentStreams:r||!1}),I=S((F)=>{if(r)this.destroySession(T);o=!0,h(F)},"rejectWithDestroy"),L=Wn.buildQueryString(y||{}),ct=n.path;if(L)ct+=`?${L}`;if(n.fragment)ct+=`#${n.fragment}`;let N=T.request({...n.headers,[Rn.constants.HTTP2_HEADER_PATH]:ct,[Rn.constants.HTTP2_HEADER_METHOD]:l});if(T.ref(),N.on("response",(F)=>{let z=new Yn.HttpResponse({statusCode:F[":status"]||-1,headers:Zn(F),body:N});if(o=!0,x({response:z}),r)T.close(),this.connectionManager.deleteSession(d,T)}),i)N.setTimeout(i,()=>{N.close();let F=new Error(`Stream timed out because of no activity for ${i} ms`);F.name="TimeoutError",I(F)});if(e){let F=S(()=>{N.close();let z=new Error("Request aborted");z.name="AbortError",I(z)},"onAbort");if(typeof e.addEventListener==="function"){let z=e;z.addEventListener("abort",F,{once:!0}),N.once("close",()=>z.removeEventListener("abort",F))}else e.onabort=F}N.on("frameError",(F,z,Ii)=>{I(new Error(`Frame type id ${F} in stream id ${Ii} has failed with code ${z}.`))}),N.on("error",I),N.on("aborted",()=>{I(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${N.rstCode}.`))}),N.on("close",()=>{if(T.unref(),r)T.destroy();if(!o)I(new Error("Unexpected error: http2 request did not get a response"))}),a=$t(N,n,i)})}updateHttpClientConfig(n,e){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return{...i,[n]:e}})}httpHandlerConfigs(){return this.config??{}}destroySession(n){if(!n.destroyed)n.destroy()}};S(jn,"NodeHttp2Handler");var ts=jn,Jn=class t extends Qn.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(n,e,i){this.bufferedBytes.push(n),i()}};S(Jn,"Collector");var ns=Jn,es=S((t)=>{if(is(t))return pn(t);return new Promise((n,e)=>{let i=new ns;t.pipe(i),t.on("error",(r)=>{i.end(),e(r)}),i.on("error",e),i.on("finish",function(){let r=new Uint8Array(Buffer.concat(this.bufferedBytes));n(r)})})},"streamCollector"),is=S((t)=>typeof ReadableStream==="function"&&t instanceof ReadableStream,"isReadableStreamInstance");async function pn(t){let n=[],e=t.getReader(),i=!1,r=0;while(!i){let{done:f,value:o}=await e.read();if(o)n.push(o),r+=o.length;i=f}let s=new Uint8Array(r),c=0;for(let f of n)s.set(f,c),c+=f.length;return s}S(pn,"collectReadableStream")});var _n=g(($f,qn)=>{var{defineProperty:nt,getOwnPropertyDescriptor:rs,getOwnPropertyNames:ss}=Object,cs=Object.prototype.hasOwnProperty,A=(t,n)=>nt(t,"name",{value:n,configurable:!0}),fs=(t,n)=>{for(var e in n)nt(t,e,{get:n[e],enumerable:!0})},hs=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of ss(n))if(!cs.call(t,r)&&r!==e)nt(t,r,{get:()=>n[r],enumerable:!(i=rs(n,r))||i.enumerable})}return t},os=(t)=>hs(nt({},"__esModule",{value:!0}),t),On={};fs(On,{FetchHttpHandler:()=>us,keepAliveSupport:()=>tt,streamCollector:()=>ls});qn.exports=os(On);var Hn=m(),ds=at();function vn(t=0){return new Promise((n,e)=>{if(t)setTimeout(()=>{let i=new Error(`Request did not complete within ${t} ms`);i.name="TimeoutError",e(i)},t)})}A(vn,"requestTimeout");var tt={supported:void 0},Pn=class t{static create(n){if(typeof(n==null?void 0:n.handle)==="function")return n;return new t(n)}constructor(n){if(typeof n==="function")this.configProvider=n().then((e)=>e||{});else this.config=n??{},this.configProvider=Promise.resolve(this.config);if(tt.supported===void 0)tt.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(n,{abortSignal:e}={}){var i;if(!this.config)this.config=await this.configProvider;let r=this.config.requestTimeout,s=this.config.keepAlive===!0,c=this.config.credentials;if(e==null?void 0:e.aborted){let d=new Error("Request aborted");return d.name="AbortError",Promise.reject(d)}let f=n.path,o=ds.buildQueryString(n.query||{});if(o)f+=`?${o}`;if(n.fragment)f+=`#${n.fragment}`;let a="";if(n.username!=null||n.password!=null){let d=n.username??"",w=n.password??"";a=`${d}:${w}@`}let{port:x,method:h}=n,u=`${n.protocol}//${a}${n.hostname}${x?`:${x}`:""}${f}`,l=h==="GET"||h==="HEAD"?void 0:n.body,E={body:l,headers:new Headers(n.headers),method:h,credentials:c};if((i=this.config)==null?void 0:i.cache)E.cache=this.config.cache;if(l)E.duplex="half";if(typeof AbortController!=="undefined")E.signal=e;if(tt.supported)E.keepalive=s;if(typeof this.config.requestInit==="function")Object.assign(E,this.config.requestInit(n));let C=A(()=>{},"removeSignalEventListener"),y=new Request(u,E),$=[fetch(y).then((d)=>{let w=d.headers,T={};for(let L of w.entries())T[L[0]]=L[1];if(d.body==null)return d.blob().then((L)=>({response:new Hn.HttpResponse({headers:T,reason:d.statusText,statusCode:d.status,body:L})}));return{response:new Hn.HttpResponse({headers:T,reason:d.statusText,statusCode:d.status,body:d.body})}}),vn(r)];if(e)$.push(new Promise((d,w)=>{let T=A(()=>{let I=new Error("Request aborted");I.name="AbortError",w(I)},"onAbort");if(typeof e.addEventListener==="function"){let I=e;I.addEventListener("abort",T,{once:!0}),C=A(()=>I.removeEventListener("abort",T),"removeSignalEventListener")}else e.onabort=T}));return Promise.race($).finally(C)}updateHttpClientConfig(n,e){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return i[n]=e,i})}httpHandlerConfigs(){return this.config??{}}};A(Pn,"FetchHttpHandler");var us=Pn,ls=A(async(t)=>{if(typeof Blob==="function"&&t instanceof Blob)return new Uint8Array(await t.arrayBuffer());return mn(t)},"streamCollector");async function mn(t){let n=[],e=t.getReader(),i=!1,r=0;while(!i){let{done:f,value:o}=await e.read();if(o)n.push(o),r+=o.length;i=f}let s=new Uint8Array(r),c=0;for(let f of n)s.set(f,c),c+=f.length;return s}A(mn,"collectStream")});var ce=g((Ef,se)=>{var{defineProperty:et,getOwnPropertyDescriptor:as,getOwnPropertyNames:ws}=Object,ys=Object.prototype.hasOwnProperty,te=(t,n)=>et(t,"name",{value:n,configurable:!0}),$s=(t,n)=>{for(var e in n)et(t,e,{get:n[e],enumerable:!0})},Es=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of ws(n))if(!ys.call(t,r)&&r!==e)et(t,r,{get:()=>n[r],enumerable:!(i=as(n,r))||i.enumerable})}return t},xs=(t)=>Es(et({},"__esModule",{value:!0}),t),ne={};$s(ne,{fromHex:()=>ie,toHex:()=>re});se.exports=xs(ne);var ee={},Et={};for(let t=0;t<256;t++){let n=t.toString(16).toLowerCase();if(n.length===1)n=`0${n}`;ee[t]=n,Et[n]=t}function ie(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2){let i=t.slice(e,e+2).toLowerCase();if(i in Et)n[e/2]=Et[i];else throw new Error(`Cannot decode unrecognized sequence ${i} as hexadecimal`)}return n}te(ie,"fromHex");function re(t){let n="";for(let e=0;e<t.byteLength;e++)n+=ee[t[e]];return n}te(re,"toHex")});var Y=g((fe)=>{Object.defineProperty(fe,"__esModule",{value:!0});fe.isReadableStream=void 0;var Ts=(t)=>{var n;return typeof ReadableStream==="function"&&(((n=t===null||t===void 0?void 0:t.constructor)===null||n===void 0?void 0:n.name)===ReadableStream.name||t instanceof ReadableStream)};fe.isReadableStream=Ts});var we=g((le)=>{Object.defineProperty(le,"__esModule",{value:!0});le.sdkStreamMixin=void 0;var Cs=_n(),gs=X(),Ss=ce(),Fs=O(),oe=Y(),de="The stream has already been transformed.",Is=(t)=>{var n,e;if(!ue(t)&&!oe.isReadableStream(t)){let c=((e=(n=t===null||t===void 0?void 0:t.__proto__)===null||n===void 0?void 0:n.constructor)===null||e===void 0?void 0:e.name)||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${c}`)}let i=!1,r=async()=>{if(i)throw new Error(de);return i=!0,await Cs.streamCollector(t)},s=(c)=>{if(typeof c.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return c.stream()};return Object.assign(t,{transformToByteArray:r,transformToString:async(c)=>{let f=await r();if(c==="base64")return gs.toBase64(f);else if(c==="hex")return Ss.toHex(f);else if(c===void 0||c==="utf8"||c==="utf-8")return Fs.toUtf8(f);else if(typeof TextDecoder==="function")return new TextDecoder(c).decode(f);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(i)throw new Error(de);if(i=!0,ue(t))return s(t);else if(oe.isReadableStream(t))return t;else throw new Error(`Cannot transform payload to web stream, got ${t}`)}})};le.sdkStreamMixin=Is;var ue=(t)=>typeof Blob==="function"&&t instanceof Blob});var xe=g(($e)=>{Object.defineProperty($e,"__esModule",{value:!0});$e.sdkStreamMixin=void 0;var Ns=kn(),Ls=V(),xt=import.meta.require("stream"),zs=import.meta.require("util"),Ms=we(),ye="The stream has already been transformed.",Us=(t)=>{var n,e;if(!(t instanceof xt.Readable))try{return Ms.sdkStreamMixin(t)}catch(s){let c=((e=(n=t===null||t===void 0?void 0:t.__proto__)===null||n===void 0?void 0:n.constructor)===null||e===void 0?void 0:e.name)||t;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${c}`)}let i=!1,r=async()=>{if(i)throw new Error(ye);return i=!0,await Ns.streamCollector(t)};return Object.assign(t,{transformToByteArray:r,transformToString:async(s)=>{let c=await r();if(s===void 0||Buffer.isEncoding(s))return Ls.fromArrayBuffer(c.buffer,c.byteOffset,c.byteLength).toString(s);else return new zs.TextDecoder(s).decode(c)},transformToWebStream:()=>{if(i)throw new Error(ye);if(t.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof xt.Readable.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return i=!0,xt.Readable.toWeb(t)}})};$e.sdkStreamMixin=Us});var ge=g((Te)=>{Object.defineProperty(Te,"__esModule",{value:!0});Te.splitStream=void 0;async function bs(t){if(typeof t.stream==="function")t=t.stream();return t.tee()}Te.splitStream=bs});var Ne=g((Fe)=>{Object.defineProperty(Fe,"__esModule",{value:!0});Fe.splitStream=void 0;var Se=import.meta.require("stream"),Rs=ge(),Ds=Y();async function As(t){if(Ds.isReadableStream(t))return Rs.splitStream(t);let n=new Se.PassThrough,e=new Se.PassThrough;return t.pipe(n),t.pipe(e),[n,e]}Fe.splitStream=As});var Me=g((Le)=>{Object.defineProperty(Le,"__esModule",{value:!0});Le.headStream=void 0;async function Ys(t,n){var e;let i=0,r=[],s=t.getReader(),c=!1;while(!c){let{done:a,value:x}=await s.read();if(x)r.push(x),i+=(e=x===null||x===void 0?void 0:x.byteLength)!==null&&e!==void 0?e:0;if(i>=n)break;c=a}s.releaseLock();let f=new Uint8Array(Math.min(n,i)),o=0;for(let a of r){if(a.byteLength>f.byteLength-o){f.set(a.subarray(0,f.byteLength-o),o);break}else f.set(a,o);o+=a.length}return f}Le.headStream=Ys});var De=g((be)=>{Object.defineProperty(be,"__esModule",{value:!0});be.headStream=void 0;var Ws=import.meta.require("stream"),Zs=Me(),Qs=Y(),Ks=(t,n)=>{if(Qs.isReadableStream(t))return Zs.headStream(t,n);return new Promise((e,i)=>{let r=new Ue;r.limit=n,t.pipe(r),t.on("error",(s)=>{r.end(),i(s)}),r.on("error",i),r.on("finish",function(){let s=new Uint8Array(Buffer.concat(this.buffers));e(s)})})};be.headStream=Ks;class Ue extends Ws.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=1/0,this.bytesBuffered=0}_write(t,n,e){var i;if(this.buffers.push(t),this.bytesBuffered+=(i=t.byteLength)!==null&&i!==void 0?i:0,this.bytesBuffered>=this.limit){let r=this.bytesBuffered-this.limit,s=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=s.subarray(0,s.byteLength-r),this.emit("finish")}e()}}});var Tt=g((Ye)=>{Object.defineProperty(Ye,"__esModule",{value:!0});Ye.ChecksumStream=void 0;var Vs=X(),Xs=import.meta.require("stream");class Ae extends Xs.Duplex{constructor({expectedChecksum:t,checksum:n,source:e,checksumSourceLocation:i,base64Encoder:r}){var s,c;super();if(typeof e.pipe==="function")this.source=e;else throw new Error(`@smithy/util-stream: unsupported source type ${(c=(s=e===null||e===void 0?void 0:e.constructor)===null||s===void 0?void 0:s.name)!==null&&c!==void 0?c:e} in ChecksumStream.`);this.base64Encoder=r!==null&&r!==void 0?r:Vs.toBase64,this.expectedChecksum=t,this.checksum=n,this.checksumSourceLocation=i,this.source.pipe(this)}_read(t){}_write(t,n,e){try{this.checksum.update(t),this.push(t)}catch(i){return e(i)}return e()}async _final(t){try{let n=await this.checksum.digest(),e=this.base64Encoder(n);if(this.expectedChecksum!==e)return t(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${e}" in response header "${this.checksumSourceLocation}".`))}catch(n){return t(n)}return this.push(null),t()}}Ye.ChecksumStream=Ae});var Ve=g((Qe)=>{Object.defineProperty(Qe,"__esModule",{value:!0});Qe.ChecksumStream=void 0;var Gs=typeof ReadableStream==="function"?ReadableStream:function(){};class Ze extends Gs{}Qe.ChecksumStream=Ze});var je=g((Xe)=>{Object.defineProperty(Xe,"__esModule",{value:!0});Xe.createChecksumStream=void 0;var js=X(),Js=Y(),ps=Ve(),Bs=({expectedChecksum:t,checksum:n,source:e,checksumSourceLocation:i,base64Encoder:r})=>{var s,c;if(!Js.isReadableStream(e))throw new Error(`@smithy/util-stream: unsupported source type ${(c=(s=e===null||e===void 0?void 0:e.constructor)===null||s===void 0?void 0:s.name)!==null&&c!==void 0?c:e} in ChecksumStream.`);let f=r!==null&&r!==void 0?r:js.toBase64;if(typeof TransformStream!=="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let o=new TransformStream({start(){},async transform(x,h){n.update(x),h.enqueue(x)},async flush(x){let h=await n.digest(),u=f(h);if(t!==u){let l=new Error(`Checksum mismatch: expected "${t}" but received "${u}" in response header "${i}".`);x.error(l)}else x.terminate()}});e.pipeThrough(o);let a=o.readable;return Object.setPrototypeOf(a,ps.ChecksumStream.prototype),a};Xe.createChecksumStream=Bs});var Be=g((Je)=>{Object.defineProperty(Je,"__esModule",{value:!0});Je.createChecksumStream=void 0;var ks=Y(),Hs=Tt(),Os=je();function vs(t){if(typeof ReadableStream==="function"&&ks.isReadableStream(t.source))return Os.createChecksumStream(t);return new Hs.ChecksumStream(t)}Je.createChecksumStream=vs});var me=g((Uf,U)=>{var{defineProperty:it,getOwnPropertyDescriptor:Ps,getOwnPropertyNames:ms}=Object,qs=Object.prototype.hasOwnProperty,St=(t,n)=>it(t,"name",{value:n,configurable:!0}),_s=(t,n)=>{for(var e in n)it(t,e,{get:n[e],enumerable:!0})},Ct=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of ms(n))if(!qs.call(t,r)&&r!==e)it(t,r,{get:()=>n[r],enumerable:!(i=Ps(n,r))||i.enumerable})}return t},W=(t,n,e)=>(Ct(t,n,"default"),e&&Ct(e,n,"default")),tc=(t)=>Ct(it({},"__esModule",{value:!0}),t),M={};_s(M,{Uint8ArrayBlobAdapter:()=>gt});U.exports=tc(M);var ke=X(),He=O();function Oe(t,n="utf-8"){if(n==="base64")return ke.toBase64(t);return He.toUtf8(t)}St(Oe,"transformToString");function ve(t,n){if(n==="base64")return gt.mutate(ke.fromBase64(t));return gt.mutate(He.fromUtf8(t))}St(ve,"transformFromString");var Pe=class t extends Uint8Array{static fromString(n,e="utf-8"){switch(typeof n){case"string":return ve(n,e);default:throw new Error(`Unsupported conversion from ${typeof n} to Uint8ArrayBlobAdapter.`)}}static mutate(n){return Object.setPrototypeOf(n,t.prototype),n}transformToString(n="utf-8"){return Oe(this,n)}};St(Pe,"Uint8ArrayBlobAdapter");var gt=Pe;W(M,un(),U.exports);W(M,xe(),U.exports);W(M,Ne(),U.exports);W(M,De(),U.exports);W(M,Y(),U.exports);W(M,Be(),U.exports);W(M,Tt(),U.exports)});var j=g((bf,ti)=>{var{defineProperty:Nt,getOwnPropertyDescriptor:nc,getOwnPropertyNames:ec}=Object,ic=Object.prototype.hasOwnProperty,rc=(t,n)=>{for(var e in n)Nt(t,e,{get:n[e],enumerable:!0})},sc=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of ec(n))if(!ic.call(t,r)&&r!==e)Nt(t,r,{get:()=>n[r],enumerable:!(i=nc(n,r))||i.enumerable})}return t},cc=(t)=>sc(Nt({},"__esModule",{value:!0}),t),qe={};rc(qe,{RequestBuilder:()=>_e,collectBody:()=>fc,extendedEncodeURIComponent:()=>It,requestBuilder:()=>dc,resolvedPath:()=>uc});ti.exports=cc(qe);var Ft=me(),fc=async(t=new Uint8Array,n)=>{if(t instanceof Uint8Array)return Ft.Uint8ArrayBlobAdapter.mutate(t);if(!t)return Ft.Uint8ArrayBlobAdapter.mutate(new Uint8Array);let e=n.streamCollector(t);return Ft.Uint8ArrayBlobAdapter.mutate(await e)};function It(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16).toUpperCase()})}var hc=j(),oc=m();function dc(t,n){return new _e(t,n)}var _e=class{constructor(t,n){this.input=t,this.context=n,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){let{hostname:t,protocol:n="https",port:e,path:i}=await this.context.endpoint();this.path=i;for(let r of this.resolvePathStack)r(this.path);return new oc.HttpRequest({protocol:n,hostname:this.hostname||t,port:e,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(t){return this.hostname=t,this}bp(t){return this.resolvePathStack.push((n)=>{this.path=`${(n==null?void 0:n.endsWith("/"))?n.slice(0,-1):n||""}`+t}),this}p(t,n,e,i){return this.resolvePathStack.push((r)=>{this.path=hc.resolvedPath(r,this.input,t,n,e,i)}),this}h(t){return this.headers=t,this}q(t){return this.query=t,this}b(t){return this.body=t,this}m(t){return this.method=t,this}},uc=(t,n,e,i,r,s)=>{if(n!=null&&n[e]!==void 0){let c=i();if(c.length<=0)throw new Error("Empty value provided for input HTTP label: "+e+".");t=t.replace(r,s?c.split("/").map((f)=>It(f)).join("/"):It(c))}else throw new Error("No value provided for input HTTP label: "+e+".");return t}});var D=(t,n)=>{let e=[];if(t)e.push(t);if(n)for(let i of n)e.push(i);return e},b=(t,n)=>{return`${t||"anonymous"}${n&&n.length>0?` (a.k.a. ${n.join(",")})`:""}`},Q=()=>{let t=[],n=[],e=!1,i=new Set,r=(h)=>h.sort((u,l)=>Qt[l.step]-Qt[u.step]||Kt[l.priority||"normal"]-Kt[u.priority||"normal"]),s=(h)=>{let u=!1,l=(E)=>{let C=D(E.name,E.aliases);if(C.includes(h)){u=!0;for(let y of C)i.delete(y);return!1}return!0};return t=t.filter(l),n=n.filter(l),u},c=(h)=>{let u=!1,l=(E)=>{if(E.middleware===h){u=!0;for(let C of D(E.name,E.aliases))i.delete(C);return!1}return!0};return t=t.filter(l),n=n.filter(l),u},f=(h)=>{return t.forEach((u)=>{h.add(u.middleware,{...u})}),n.forEach((u)=>{h.addRelativeTo(u.middleware,{...u})}),h.identifyOnResolve?.(x.identifyOnResolve()),h},o=(h)=>{let u=[];return h.before.forEach((l)=>{if(l.before.length===0&&l.after.length===0)u.push(l);else u.push(...o(l))}),u.push(h),h.after.reverse().forEach((l)=>{if(l.before.length===0&&l.after.length===0)u.push(l);else u.push(...o(l))}),u},a=(h=!1)=>{let u=[],l=[],E={};return t.forEach((y)=>{let $={...y,before:[],after:[]};for(let d of D($.name,$.aliases))E[d]=$;u.push($)}),n.forEach((y)=>{let $={...y,before:[],after:[]};for(let d of D($.name,$.aliases))E[d]=$;l.push($)}),l.forEach((y)=>{if(y.toMiddleware){let $=E[y.toMiddleware];if($===void 0){if(h)return;throw new Error(`${y.toMiddleware} is not found when adding ${b(y.name,y.aliases)} middleware ${y.relation} ${y.toMiddleware}`)}if(y.relation==="after")$.after.push(y);if(y.relation==="before")$.before.push(y)}}),r(u).map(o).reduce((y,$)=>{return y.push(...$),y},[])},x={add:(h,u={})=>{let{name:l,override:E,aliases:C}=u,y={step:"initialize",priority:"normal",middleware:h,...u},$=D(l,C);if($.length>0){if($.some((d)=>i.has(d))){if(!E)throw new Error(`Duplicate middleware name '${b(l,C)}'`);for(let d of $){let w=t.findIndex((I)=>I.name===d||I.aliases?.some((L)=>L===d));if(w===-1)continue;let T=t[w];if(T.step!==y.step||y.priority!==T.priority)throw new Error(`"${b(T.name,T.aliases)}" middleware with ${T.priority} priority in ${T.step} step cannot be overridden by "${b(l,C)}" middleware with ${y.priority} priority in ${y.step} step.`);t.splice(w,1)}}for(let d of $)i.add(d)}t.push(y)},addRelativeTo:(h,u)=>{let{name:l,override:E,aliases:C}=u,y={middleware:h,...u},$=D(l,C);if($.length>0){if($.some((d)=>i.has(d))){if(!E)throw new Error(`Duplicate middleware name '${b(l,C)}'`);for(let d of $){let w=n.findIndex((I)=>I.name===d||I.aliases?.some((L)=>L===d));if(w===-1)continue;let T=n[w];if(T.toMiddleware!==y.toMiddleware||T.relation!==y.relation)throw new Error(`"${b(T.name,T.aliases)}" middleware ${T.relation} "${T.toMiddleware}" middleware cannot be overridden by "${b(l,C)}" middleware ${y.relation} "${y.toMiddleware}" middleware.`);n.splice(w,1)}}for(let d of $)i.add(d)}n.push(y)},clone:()=>f(Q()),use:(h)=>{h.applyToStack(x)},remove:(h)=>{if(typeof h==="string")return s(h);else return c(h)},removeByTag:(h)=>{let u=!1,l=(E)=>{let{tags:C,name:y,aliases:$}=E;if(C&&C.includes(h)){let d=D(y,$);for(let w of d)i.delete(w);return u=!0,!1}return!0};return t=t.filter(l),n=n.filter(l),u},concat:(h)=>{let u=f(Q());return u.use(h),u.identifyOnResolve(e||u.identifyOnResolve()||(h.identifyOnResolve?.()??!1)),u},applyToStack:f,identify:()=>{return a(!0).map((h)=>{let u=h.step??h.relation+" "+h.toMiddleware;return b(h.name,h.aliases)+" - "+u})},identifyOnResolve(h){if(typeof h==="boolean")e=h;return e},resolve:(h,u)=>{for(let l of a().map((E)=>E.middleware).reverse())h=l(h,u);if(e)console.log(x.identify());return h}};return x},Qt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Kt={high:3,normal:2,low:1};class Ni{constructor(t){this.config=t,this.middlewareStack=Q()}send(t,n,e){let i=typeof n!=="function"?n:void 0,r=typeof n==="function"?n:e,s=i===void 0&&this.config.cacheMiddleware===!0,c;if(s){if(!this.handlers)this.handlers=new WeakMap;let f=this.handlers;if(f.has(t.constructor))c=f.get(t.constructor);else c=t.resolveMiddleware(this.middlewareStack,this.config,i),f.set(t.constructor,c)}else delete this.handlers,c=t.resolveMiddleware(this.middlewareStack,this.config,i);if(r)c(t).then((f)=>r(null,f.output),(f)=>r(f)).catch(()=>{});else return c(t).then((f)=>f.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var Vt=K(p(),1);class Xt{constructor(){this.middlewareStack=Q()}static classBuilder(){return new Gt}resolveMiddlewareWithContext(t,n,e,{middlewareFn:i,clientName:r,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:f,smithyContext:o,additionalContext:a,CommandCtor:x}){for(let C of i.bind(this)(x,t,n,e))this.middlewareStack.use(C);let h=t.concat(this.middlewareStack),{logger:u}=n,l={logger:u,clientName:r,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:f,[Vt.SMITHY_CONTEXT_KEY]:{commandInstance:this,...o},...a},{requestHandler:E}=n;return h.resolve((C)=>E.handle(C.request,e||{}),l)}}class Gt{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(t)=>t,this._outputFilterSensitiveLog=(t)=>t,this._serializer=null,this._deserializer=null}init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,n,e={}){return this._smithyContext={service:t,operation:n,...e},this}c(t={}){return this._additionalContext=t,this}n(t,n){return this._clientName=t,this._commandName=n,this}f(t=(e)=>e,n=(e)=>e){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=n,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}build(){let t=this,n;return n=class extends Xt{static getEndpointParameterInstructions(){return t._ep}constructor(...[e]){super();this.serialize=t._serializer,this.deserialize=t._deserializer,this.input=e??{},t._init(this)}resolveMiddleware(e,i,r){return this.resolveMiddlewareWithContext(e,i,r,{CommandCtor:n,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog,outputFilterSensitiveLog:t._outputFilterSensitiveLog,smithyContext:t._smithyContext,additionalContext:t._additionalContext})}}}}var _c="***SensitiveInformation***";var nf=(t,n)=>{for(let e of Object.keys(t)){let i=t[e],r=async function(c,f,o){let a=new i(c);if(typeof f==="function")this.send(a,f);else if(typeof o==="function"){if(typeof f!=="object")throw new Error(`Expected http options but got ${typeof f}`);this.send(a,f||{},o)}else return this.send(a,f)},s=(e[0].toLowerCase()+e.slice(1)).replace(/Command$/,"");n.prototype[s]=r}};class jt extends Error{constructor(t){super(t.message);Object.setPrototypeOf(this,jt.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}}var Jt=(t,n={})=>{Object.entries(n).filter(([,i])=>i!==void 0).forEach(([i,r])=>{if(t[i]==null||t[i]==="")t[i]=r});let e=t.message||t.Message||"UnknownError";return t.message=e,delete t.Message,t};var lc=K(j(),1);var ac=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string"){let n=parseFloat(t);if(!Number.isNaN(n)){if(String(n)!==String(t))hi.warn(fi(`Expected number but observed string: ${t}`));return n}}if(typeof t==="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)},wc=Math.ceil(340282346638528860000000000000000000000),ni=(t)=>{let n=ac(t);if(n!==void 0&&!Number.isNaN(n)&&n!==1/0&&n!==-1/0){if(Math.abs(n)>wc)throw new TypeError(`Expected 32-bit float, got ${t}`)}return n},yc=(t)=>{if(t===null||t===void 0)return;if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw new TypeError(`Expected integer, got ${typeof t}: ${t}`)};var ei=(t)=>Lt(t,32),ii=(t)=>Lt(t,16),ri=(t)=>Lt(t,8),Lt=(t,n)=>{let e=yc(t);if(e!==void 0&&$c(e,n)!==e)throw new TypeError(`Expected ${n}-bit integer, got ${t}`);return e},$c=(t,n)=>{switch(n){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},Af=(t,n)=>{if(t===null||t===void 0){if(n)throw new TypeError(`Expected a non-null value for ${n}`);throw new TypeError("Expected a non-null value")}return t},Yf=(t)=>{if(t===null||t===void 0)return;if(typeof t==="object"&&!Array.isArray(t))return t;let n=Array.isArray(t)?"array":typeof t;throw new TypeError(`Expected object, got ${n}: ${t}`)},Wf=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string")return t;if(["boolean","number","bigint"].includes(typeof t))return hi.warn(fi(`Expected string, got ${typeof t}: ${t}`)),String(t);throw new TypeError(`Expected string, got ${typeof t}: ${t}`)};var si=(t)=>{if(typeof t=="string")return ni(rt(t));return ni(t)},Ec=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,rt=(t)=>{let n=t.match(Ec);if(n===null||n[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)};var Zf=(t)=>{if(typeof t==="string")return ei(rt(t));return ei(t)},zt=(t)=>{if(typeof t==="string")return ii(rt(t));return ii(t)},ci=(t)=>{if(typeof t==="string")return ri(rt(t));return ri(t)},fi=(t)=>{return String(new TypeError(t).stack||t).split("\n").slice(0,5).filter((n)=>!n.includes("stackTraceWarning")).join("\n")},hi={warn:console.warn};var xc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var Tc=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Xf=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let n=Tc.exec(t);if(!n)throw new TypeError("Invalid RFC-3339 date-time value");let[e,i,r,s,c,f,o,a]=n,x=zt(Mt(i)),h=Z(r,"month",1,12),u=Z(s,"day",1,31);return oi(x,h,u,{hours:c,minutes:f,seconds:o,fractionalMilliseconds:a})},Cc=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Gf=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let n=Cc.exec(t);if(!n)throw new TypeError("Invalid RFC-3339 date-time value");let[e,i,r,s,c,f,o,a,x]=n,h=zt(Mt(i)),u=Z(r,"month",1,12),l=Z(s,"day",1,31),E=oi(h,u,l,{hours:c,minutes:f,seconds:o,fractionalMilliseconds:a});if(x.toUpperCase()!="Z")E.setTime(E.getTime()-Nc(x));return E},jf=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Jf=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),pf=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);var oi=(t,n,e,i)=>{let r=n-1;return Sc(t,r,e),new Date(Date.UTC(t,r,e,Z(i.hours,"hour",0,23),Z(i.minutes,"minute",0,59),Z(i.seconds,"seconds",0,60),Ic(i.fractionalMilliseconds)))};var gc=[31,28,31,30,31,30,31,31,30,31,30,31],Sc=(t,n,e)=>{let i=gc[n];if(n===1&&Fc(t))i=29;if(e>i)throw new TypeError(`Invalid day for ${xc[n]} in ${t}: ${e}`)},Fc=(t)=>{return t%4===0&&(t%100!==0||t%400===0)},Z=(t,n,e,i)=>{let r=ci(Mt(t));if(r<e||r>i)throw new TypeError(`${n} must be between ${e} and ${i}, inclusive`);return r},Ic=(t)=>{if(t===null||t===void 0)return 0;return si("0."+t)*1000},Nc=(t)=>{let n=t[0],e=1;if(n=="+")e=1;else if(n=="-")e=-1;else throw new TypeError(`Offset direction, ${n}, must be "+" or "-"`);let i=Number(t.substring(1,3)),r=Number(t.substring(4,6));return e*(i*60+r)*60*1000},Mt=(t)=>{let n=0;while(n<t.length-1&&t.charAt(n)==="0")n++;if(n===0)return t;return t.slice(n)};var Lc=({output:t,parsedBody:n,exceptionCtor:e,errorCode:i})=>{let r=zc(t),s=r.httpStatusCode?r.httpStatusCode+"":void 0,c=new e({name:n?.code||n?.Code||i||s||"UnknownError",$fault:"client",$metadata:r});throw Jt(c,n)},Hf=(t)=>{return({output:n,parsedBody:e,errorCode:i})=>{Lc({output:n,parsedBody:e,exceptionCtor:t,errorCode:i})}},zc=(t)=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]});var vf=(t)=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}};var di=!1,mf=(t)=>{if(t&&!di&&parseInt(t.substring(1,t.indexOf(".")))<16)di=!0};var Mc=K(j(),1);var Ut=K(p(),1);var ui=(t)=>{let n=[];for(let e in Ut.AlgorithmId){let i=Ut.AlgorithmId[e];if(t[i]===void 0)continue;n.push({algorithmId:()=>i,checksumConstructor:()=>t[i]})}return{_checksumAlgorithms:n,addChecksumAlgorithm(e){this._checksumAlgorithms.push(e)},checksumAlgorithms(){return this._checksumAlgorithms}}},li=(t)=>{let n={};return t.checksumAlgorithms().forEach((e)=>{n[e.algorithmId()]=e.checksumConstructor()}),n};var ai=(t)=>{let n=t.retryStrategy;return{setRetryStrategy(e){n=e},retryStrategy(){return n}}},wi=(t)=>{let n={};return n.retryStrategy=t.retryStrategy(),n};var rh=(t)=>{return{...ui(t),...ai(t)}};var sh=(t)=>{return{...li(t),...wi(t)}};var oh=(t)=>Array.isArray(t)?t:[t];var lh=(t)=>{return t!=null};var bt=function(){let t=Object.getPrototypeOf(this).constructor,e=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(e,t.prototype),e};bt.prototype=Object.create(String.prototype,{constructor:{value:bt,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(bt,String);class Uc{trace(){}debug(){}info(){}warn(){}error(){}}function bc(t,n,e){let i,r,s;if(typeof n==="undefined"&&typeof e==="undefined")i={},s=t;else if(i=t,typeof n==="function")return r=n,s=e,Rc(i,r,s);else s=n;for(let c of Object.keys(s)){if(!Array.isArray(s[c])){i[c]=s[c];continue}yi(i,null,s,c)}return i}var $h=(t,n)=>{let e={};for(let i in n)yi(e,t,n,i);return e},Rc=(t,n,e)=>{return bc(t,Object.entries(e).reduce((i,[r,s])=>{if(Array.isArray(s))i[r]=s;else if(typeof s==="function")i[r]=[n,s()];else i[r]=[n,s];return i},{}))},yi=(t,n,e,i)=>{if(n!==null){let c=e[i];if(typeof c==="function")c=[,c];let[f=Dc,o=Ac,a=i]=c;if(typeof f==="function"&&f(n[a])||typeof f!=="function"&&!!f)t[i]=o(n[a]);return}let[r,s]=e[i];if(typeof s==="function"){let c,f=r===void 0&&(c=s())!=null,o=typeof r==="function"&&!!r(void 0)||typeof r!=="function"&&!!r;if(f)t[i]=c;else if(o)t[i]=s()}else{let c=r===void 0&&s!=null,f=typeof r==="function"&&!!r(s)||typeof r!=="function"&&!!r;if(c||f)t[i]=s}},Dc=(t)=>t!=null,Ac=(t)=>t;var Yc=K(j(),1);var $i=(t)=>{if(t==null)return{};if(Array.isArray(t))return t.filter((n)=>n!=null).map($i);if(typeof t==="object"){let n={};for(let e of Object.keys(t)){if(t[e]==null)continue;n[e]=$i(t[e])}return n}return t};var Ph=(t)=>{let n=t.httpHandler;return{setHttpHandler(e){n=e},httpHandler(){return n},updateHttpClientConfig(e,i){n.updateHttpClientConfig(e,i)},httpHandlerConfigs(){return n.httpHandlerConfigs()}}},mh=(t)=>{return{httpHandler:t.httpHandler()}};var Wc=K(p(),1);class Rt{constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){let n=new Rt({...t,headers:{...t.headers}});if(n.query)n.query=Zc(n.query);return n}static isInstance(t){if(!t)return!1;let n=t;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query==="object"&&typeof n.headers==="object"}clone(){return Rt.clone(this)}}function Zc(t){return Object.keys(t).reduce((n,e)=>{let i=t[e];return{...n,[e]:Array.isArray(i)?[...i]:i}},{})}class st{constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;let n=t;return typeof n.statusCode==="number"&&typeof n.headers==="object"}}var J=(t)=>encodeURIComponent(t).replace(/[!'()*]/g,Qc),Qc=(t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`;function Dt(t){let n=[];for(let e of Object.keys(t).sort()){let i=t[e];if(e=J(e),Array.isArray(i))for(let r=0,s=i.length;r<s;r++)n.push(`${e}=${J(i[r])}`);else{let r=e;if(i||typeof i==="string")r+=`=${J(i)}`;n.push(r)}}return n.join("&")}import{Agent as Si,request as Xc}from"http";import{Agent as Fi,request as Gc}from"https";var Ei=["ECONNRESET","EPIPE","ETIMEDOUT"];var At=(t)=>{let n={};for(let e of Object.keys(t)){let i=t[e];n[e]=Array.isArray(i)?i.join(","):i}return n};var xi=(t,n,e=0)=>{if(!e)return-1;let i=(r)=>{let s=setTimeout(()=>{t.destroy(),n(Object.assign(new Error(`Socket timed out without establishing a connection within ${e} ms`),{name:"TimeoutError"}))},e-r),c=(f)=>{if(f?.connecting)f.on("connect",()=>{clearTimeout(s)});else clearTimeout(s)};if(t.socket)c(t.socket);else t.on("socket",c)};if(e<2000)return i(0),0;return setTimeout(i.bind(null,1000),1000)};var Ti=(t,{keepAlive:n,keepAliveMsecs:e},i=3000)=>{if(n!==!0)return-1;let r=()=>{if(t.socket)t.socket.setKeepAlive(n,e||0);else t.on("socket",(s)=>{s.setKeepAlive(n,e||0)})};if(i===0)return r(),0;return setTimeout(r,i)};var Ci=(t,n,e=0)=>{let i=(r)=>{t.setTimeout(e-r,()=>{t.destroy(),n(Object.assign(new Error(`Connection timed out after ${e} ms`),{name:"TimeoutError"}))})};if(0<e&&e<6000)return i(0),0;return setTimeout(i.bind(null,e===0?0:3000),3000)};import{Readable as Kc}from"stream";var gi=1000;async function Yt(t,n,e=gi){let i=n.headers??{},r=i.Expect||i.expect,s=-1,c=!1;if(r==="100-continue")await Promise.race([new Promise((f)=>{s=Number(setTimeout(f,Math.max(gi,e)))}),new Promise((f)=>{t.on("continue",()=>{clearTimeout(s),f()}),t.on("error",()=>{c=!0,clearTimeout(s),f()})})]);if(!c)Vc(t,n.body)}function Vc(t,n){if(n instanceof Kc){n.pipe(t);return}if(n){if(Buffer.isBuffer(n)||typeof n==="string"){t.end(n);return}let e=n;if(typeof e==="object"&&e.buffer&&typeof e.byteOffset==="number"&&typeof e.byteLength==="number"){t.end(Buffer.from(e.buffer,e.byteOffset,e.byteLength));return}t.end(Buffer.from(n));return}t.end()}class Wt{static create(t){if(typeof t?.handle==="function")return t;return new Wt(t)}static checkSocketUsage(t,n,e=console){let{sockets:i,requests:r,maxSockets:s}=t;if(typeof s!=="number"||s===1/0)return n;let c=15000;if(Date.now()-c<n)return n;if(i&&r)for(let f in i){let o=i[f]?.length??0,a=r[f]?.length??0;if(o>=s&&a>=2*s)return e?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${o} and ${a} additional requests are enqueued.
4
- See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
5
- or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return n}constructor(t){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((n,e)=>{if(typeof t==="function")t().then((i)=>{n(this.resolveDefaultConfig(i))}).catch(e);else n(this.resolveDefaultConfig(t))})}resolveDefaultConfig(t){let{requestTimeout:n,connectionTimeout:e,socketTimeout:i,httpAgent:r,httpsAgent:s}=t||{},c=!0,f=50;return{connectionTimeout:e,requestTimeout:n??i,httpAgent:(()=>{if(r instanceof Si||typeof r?.destroy==="function")return r;return new Si({keepAlive:!0,maxSockets:50,...r})})(),httpsAgent:(()=>{if(s instanceof Fi||typeof s?.destroy==="function")return s;return new Fi({keepAlive:!0,maxSockets:50,...s})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:n}={}){if(!this.config)this.config=await this.configProvider;return new Promise((e,i)=>{let r=void 0,s=[],c=async(d)=>{await r,s.forEach(clearTimeout),e(d)},f=async(d)=>{await r,s.forEach(clearTimeout),i(d)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(n?.aborted){let d=new Error("Request aborted");d.name="AbortError",f(d);return}let o=t.protocol==="https:",a=o?this.config.httpsAgent:this.config.httpAgent;s.push(setTimeout(()=>{this.socketWarningTimestamp=Wt.checkSocketUsage(a,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let x=Dt(t.query||{}),h=void 0;if(t.username!=null||t.password!=null){let d=t.username??"",w=t.password??"";h=`${d}:${w}`}let u=t.path;if(x)u+=`?${x}`;if(t.fragment)u+=`#${t.fragment}`;let l=t.hostname??"";if(l[0]==="["&&l.endsWith("]"))l=t.hostname.slice(1,-1);else l=t.hostname;let E={headers:t.headers,host:l,method:t.method,path:u,port:t.port,agent:a,auth:h},y=(o?Gc:Xc)(E,(d)=>{let w=new st({statusCode:d.statusCode||-1,reason:d.statusMessage,headers:At(d.headers),body:d});c({response:w})});if(y.on("error",(d)=>{if(Ei.includes(d.code))f(Object.assign(d,{name:"TimeoutError"}));else f(d)}),n){let d=()=>{y.destroy();let w=new Error("Request aborted");w.name="AbortError",f(w)};if(typeof n.addEventListener==="function"){let w=n;w.addEventListener("abort",d,{once:!0}),y.once("close",()=>w.removeEventListener("abort",d))}else n.onabort=d}s.push(xi(y,f,this.config.connectionTimeout)),s.push(Ci(y,f,this.config.requestTimeout));let $=E.agent;if(typeof $==="object"&&"keepAlive"in $)s.push(Ti(y,{keepAlive:$.keepAlive,keepAliveMsecs:$.keepAliveMsecs}));r=Yt(y,t,this.config.requestTimeout).catch((d)=>{return s.forEach(clearTimeout),i(d)})})}updateHttpClientConfig(t,n){this.config=void 0,this.configProvider=this.configProvider.then((e)=>{return{...e,[t]:n}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as jc}from"stream";class Zt extends jc{constructor(){super(...arguments);this.bufferedBytes=[]}_write(t,n,e){this.bufferedBytes.push(t),e()}}var ed=(t)=>{if(Jc(t))return pc(t);return new Promise((n,e)=>{let i=new Zt;t.pipe(i),t.on("error",(r)=>{i.end(),e(r)}),i.on("error",e),i.on("finish",function(){let r=new Uint8Array(Buffer.concat(this.bufferedBytes));n(r)})})},Jc=(t)=>typeof ReadableStream==="function"&&t instanceof ReadableStream;async function pc(t){let n=[],e=t.getReader(),i=!1,r=0;while(!i){let{done:f,value:o}=await e.read();if(o)n.push(o),r+=o.length;i=f}let s=new Uint8Array(r),c=0;for(let f of n)s.set(f,c),c+=f.length;return s}export{Ph as ya,mh as za,Rt as Aa,st as Ba,m as Ca,kt as Da,O as Ea,In as Fa,ce as Ga,me as Ha,j as Ia,Ni as Ja,Xt as Ka,_c as La,nf as Ma,yc as Na,ei as Oa,Af as Pa,Yf as Qa,Wf as Ra,Zf as Sa,Xf as Ta,Gf as Ua,jt as Va,Jt as Wa,Hf as Xa,vf as Ya,mf as Za,Mc as _a,rh as $a,sh as ab,oh as bb,lh as cb,Uc as db,bc as eb,$h as fb,$i as gb,Wt as hb,ed as ib};
@@ -1,2 +0,0 @@
1
- import{lb as d,pb as g}from"./chunk-cs5k02gt.js";import{Bb as s,Db as y,Eb as u,Fb as C}from"./chunk-3wpw5xgd.js";function c(o){try{let r=new Set(Array.from(o.match(/([A-Z_]){3,}/g)??[]));return r.delete("CONFIG"),r.delete("CONFIG_PREFIX_SEPARATOR"),r.delete("ENV"),[...r].join(", ")}catch(r){return o}}var l=(o,r)=>async()=>{try{let t=o(process.env);if(t===void 0)throw new Error;return t}catch(t){throw new s(t.message||`Not found in ENV: ${c(o.toString())}`,{logger:r})}};var h=(o,{preferredFile:r="config",...t}={})=>async()=>{let e=d(t),{configFile:n,credentialsFile:i}=await g(t),f=i[e]||{},m=n[e]||{},S=r==="config"?{...f,...m}:{...m,...f};try{let p=o(S,r==="config"?n:i);if(p===void 0)throw new Error;return p}catch(a){throw new s(a.message||`Not found in config files w/ profile [${e}]: ${c(o.toString())}`,{logger:t.logger})}};var E=(o)=>typeof o==="function",w=(o)=>E(o)?async()=>await o():u(o);var k=({environmentVariableSelector:o,configFileSelector:r,default:t},e={})=>C(y(l(o),h(r,e),w(t)));function F(o){let r={};if(o=o.replace(/^\?/,""),o)for(let t of o.split("&")){let[e,n=null]=t.split("=");if(e=decodeURIComponent(e),n)n=decodeURIComponent(n);if(!(e in r))r[e]=n;else if(Array.isArray(r[e]))r[e].push(n);else r[e]=[r[e],n]}return r}var N=(o)=>{if(typeof o==="string")return N(new URL(o));let{hostname:r,pathname:t,port:e,protocol:n,search:i}=o,f;if(i)f=F(i);return{hostname:r,port:e?parseInt(e):void 0,protocol:n,path:t,query:f}};
2
- export{k as wa,N as xa};
@@ -1,6 +0,0 @@
1
- // @bun
2
- import{Ba as g,Ia as b,Ua as w,ib as x}from"./chunk-bx2vf8g7.js";import"./chunk-j2n86dsz.js";import{wb as v}from"./chunk-fxsv4p5c.js";import{xb as i}from"./chunk-p5va3trj.js";import{yb as n}from"./chunk-27ksm11g.js";var E=n(v(),1);var d=n(i(),1);import _ from"fs/promises";var C=n(i(),1);var u="169.254.170.2",A="169.254.170.23",O="[fd00:ec2::23]",S=(e,a)=>{if(e.protocol==="https:")return;if(e.hostname===u||e.hostname===A||e.hostname===O)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 C.CredentialsProviderError(`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 o=n(i(),1);var I=n(b(),1);function P(e){return new g({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 K(e,a){let r=await I.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 o.CredentialsProviderError("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:w(t.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let t={};try{t=JSON.parse(r)}catch(s){}throw Object.assign(new o.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:a}),{Code:t.Code,Message:t.Message})}throw new o.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:a})}var T=(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",D="http://169.254.170.2",M="AWS_CONTAINER_CREDENTIALS_FULL_URI",N="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",j="AWS_CONTAINER_AUTHORIZATION_TOKEN",H=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let a,c=e.awsContainerCredentialsRelativeUri??process.env[B],r=e.awsContainerCredentialsFullUri??process.env[M],t=e.awsContainerAuthorizationToken??process.env[j],s=e.awsContainerAuthorizationTokenFile??process.env[N],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=`${D}${c}`;else throw new d.CredentialsProviderError(`No HTTP credential provider host provided.
6
- Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:e.logger});let y=new URL(a);S(y,e.logger);let R=new x({requestTimeout:e.timeout??1000,connectionTimeout:e.timeout??1000});return T(async()=>{let f=P(y);if(t)f.headers.Authorization=t;else if(s)f.headers.Authorization=(await _.readFile(s)).toString();try{let h=await R.handle(f);return K(h.response).then((p)=>E.setCredentialFeature(p,"CREDENTIALS_HTTP","z"))}catch(h){throw new d.CredentialsProviderError(String(h),{logger:e.logger})}},e.maxRetries??3,e.timeout??1000)};export{H as fromHttp};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{L as ge}from"./chunk-zanq4wm3.js";import{$ as se,M as or,N as dr,O as yr,P as cr,Q as N,R as tr,S as Re,T as Pe,U as Te,V as be,W as U,X as ar,Y as Je,Z as Ve,_ as re,aa as We,ba as Ae,ca as mr,da as vr,ea as E,fa as S,ga as wr,ha as Ke,ia as Me,ja as kr,ka as Be,la as Sr,ma as Ze,na as fe,oa as He,pa as Ne,qa as Ue,ra as qe,sa as _e,ta as lr,ua as hr}from"./chunk-qpdxnnf8.js";import{va as I,wa as Fe}from"./chunk-a4g1e1n0.js";import{$a as sr,Ea as Zr,Ja as Er,Ka as $,La as t,Ma as Wr,Na as p,Oa as b,Pa as j,Qa as F,Ra as h,Va as $r,Wa as a,Xa as Fr,Ya as Le,Za as Qe,ab as ir,db as De,eb as y,fb as o,gb as R,hb as Xe,ib as Ye,xa as er,ya as rr}from"./chunk-y5vqt054.js";import"./chunk-8gx9at51.js";import"./chunk-6yazdvb4.js";import"./chunk-cm7bwdk9.js";import"./chunk-ha75r57f.js";import"./chunk-gg80s18j.js";import{xb as w}from"./chunk-d2dbhn2h.js";var P=w(N(),1);var ie=w(U(),1);var le=async(e,s,r)=>{return{operation:re(s).operation,region:await se(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};function Lr(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(s,r)=>({signingProperties:{config:s,context:r}})}}function H(e){return{schemeId:"smithy.api#noAuth"}}var he=(e)=>{let s=[];switch(e.operation){case"CreateToken":{s.push(H(e));break}case"RegisterClient":{s.push(H(e));break}case"StartDeviceAuthorization":{s.push(H(e));break}default:s.push(Lr(e))}return s},ne=(e)=>{return{...ie.resolveAwsSdkSigV4Config(e)}};var oe=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}},k={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var de={name:"@aws-sdk/client-sso-oidc",description:"AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",version:"3.679.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso-oidc","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso-oidc"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.679.0","@aws-sdk/credential-provider-node":"3.679.0","@aws-sdk/middleware-host-header":"3.679.0","@aws-sdk/middleware-logger":"3.679.0","@aws-sdk/middleware-recursion-detection":"3.679.0","@aws-sdk/middleware-user-agent":"3.679.0","@aws-sdk/region-config-resolver":"3.679.0","@aws-sdk/types":"3.679.0","@aws-sdk/util-endpoints":"3.679.0","@aws-sdk/util-user-agent-browser":"3.679.0","@aws-sdk/util-user-agent-node":"3.679.0","@smithy/config-resolver":"^3.0.9","@smithy/core":"^2.4.8","@smithy/fetch-http-handler":"^3.2.9","@smithy/hash-node":"^3.0.7","@smithy/invalid-dependency":"^3.0.7","@smithy/middleware-content-length":"^3.0.9","@smithy/middleware-endpoint":"^3.1.4","@smithy/middleware-retry":"^3.0.23","@smithy/middleware-serde":"^3.0.7","@smithy/middleware-stack":"^3.0.7","@smithy/node-config-provider":"^3.1.8","@smithy/node-http-handler":"^3.2.4","@smithy/protocol-http":"^4.1.4","@smithy/smithy-client":"^3.4.0","@smithy/types":"^3.5.0","@smithy/url-parser":"^3.0.7","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.23","@smithy/util-defaults-mode-node":"^3.0.23","@smithy/util-endpoints":"^2.1.3","@smithy/util-middleware":"^3.0.7","@smithy/util-retry":"^3.0.7","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",peerDependencies:{"@aws-sdk/client-sts":"^3.679.0"},browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso-oidc",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso-oidc"}};var pe=w(U(),1);var xe=w(U(),1),ze=w(N(),1);var q=w(Zr(),1);var ye={["required"]:!1,type:"String"},ce={["required"]:!0,default:!1,type:"Boolean"},te={["ref"]:"Endpoint"},Ee={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},Se={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},m={},ae={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},$e={["ref"]:"PartitionResult"},me={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[$e,"supportsDualStack"]}]},ve=[Ee],we=[Se],ke=[{["ref"]:"Region"}],Xr={version:"1.0",parameters:{Region:ye,UseDualStack:ce,UseFIPS:ce,Endpoint:ye},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[te]}],rules:[{conditions:ve,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:we,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:te,properties:m,headers:m},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:ke}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:ke,assign:"PartitionResult"}],rules:[{conditions:[Ee,Se],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,ae]},me],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:ve,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[ae,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[$e,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:m,headers:m},type:"endpoint"},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:we,rules:[{conditions:[me],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},Ie=Xr;var Yr=new Re({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),je=(e,s={})=>{return Yr.get(e,()=>Te(Ie,{endpointParams:e,logger:s.logger}))};Pe.aws=be;var Ge=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??Ue,base64Encoder:e?.base64Encoder??qe,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??je,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??he,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new xe.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ze.NoAuthSigner}],logger:e?.logger??new De,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??Fe,utf8Decoder:e?.utf8Decoder??q.fromUtf8,utf8Encoder:e?.utf8Encoder??q.toUtf8}};var Ce=(e)=>{Qe(process.version);let s=_e(e),r=()=>s().then(Le),i=Ge(e);return pe.emitWarningIfUnsupportedVersion(process.version),{...i,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??Ne,credentialDefaultProvider:e?.credentialDefaultProvider??ge,defaultUserAgentProvider:e?.defaultUserAgentProvider??Ze({serviceId:i.serviceId,clientVersion:de.version}),maxAttempts:e?.maxAttempts??I(Me),region:e?.region??I(We,Ae),requestHandler:Xe.create(e?.requestHandler??r),retryMode:e?.retryMode??I({...Be,default:async()=>(await r()).retryMode||Ke}),sha256:e?.sha256??He.bind(null,"sha256"),streamCollector:e?.streamCollector??Ye,useDualstackEndpoint:e?.useDualstackEndpoint??I(Je),useFipsEndpoint:e?.useFipsEndpoint??I(Ve),userAgentAppId:e?.userAgentAppId??I(fe)}};var Oe=(e)=>{let{httpAuthSchemes:s,httpAuthSchemeProvider:r,credentials:i}=e;return{setHttpAuthScheme(l){let n=s.findIndex((T)=>T.schemeId===l.schemeId);if(n===-1)s.push(l);else s.splice(n,1,l)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(l){r=l},httpAuthSchemeProvider(){return r},setCredentials(l){i=l},credentials(){return i}}},ue=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var x=(e)=>e,nr=(e,s)=>{let r={...x(lr(e)),...x(sr(e)),...x(er(e)),...x(Oe(e))};return s.forEach((i)=>i.configure(r)),{...e,...hr(r),...ir(r),...rr(r),...ue(r)}};class _ extends Er{constructor(...[e]){let s=Ce(e||{}),r=oe(s),i=tr(r),l=kr(i),n=mr(l),T=or(n),Kr=wr(T),Mr=ne(Kr),ee=nr(Mr,e?.extensions||[]);super(ee);this.config=ee,this.middlewareStack.use(ar(this.config)),this.middlewareStack.use(Sr(this.config)),this.middlewareStack.use(vr(this.config)),this.middlewareStack.use(dr(this.config)),this.middlewareStack.use(yr(this.config)),this.middlewareStack.use(cr(this.config)),this.middlewareStack.use(P.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:le,identityProviderConfigProvider:async(Br)=>new P.DefaultIdentityProviderConfig({"aws.auth#sigv4":Br.credentials})})),this.middlewareStack.use(P.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class d extends $r{constructor(e){super(e);Object.setPrototypeOf(this,d.prototype)}}class z extends d{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,z.prototype),this.error=e.error,this.error_description=e.error_description}}class G extends d{constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,G.prototype),this.error=e.error,this.error_description=e.error_description}}class J extends d{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}class V extends d{constructor(e){super({name:"InternalServerException",$fault:"server",...e});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}class W extends d{constructor(e){super({name:"InvalidClientException",$fault:"client",...e});this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,W.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends d{constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class K extends d{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,K.prototype),this.error=e.error,this.error_description=e.error_description}}class M extends d{constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,M.prototype),this.error=e.error,this.error_description=e.error_description}}class B extends d{constructor(e){super({name:"SlowDownException",$fault:"client",...e});this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,B.prototype),this.error=e.error,this.error_description=e.error_description}}class L extends d{constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,L.prototype),this.error=e.error,this.error_description=e.error_description}}class Q extends d{constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description}}class X extends d{constructor(e){super({name:"InvalidRequestRegionException",$fault:"client",...e});this.name="InvalidRequestRegionException",this.$fault="client",Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description,this.endpoint=e.endpoint,this.region=e.region}}class Y extends d{constructor(e){super({name:"InvalidClientMetadataException",$fault:"client",...e});this.name="InvalidClientMetadataException",this.$fault="client",Object.setPrototypeOf(this,Y.prototype),this.error=e.error,this.error_description=e.error_description}}class Z extends d{constructor(e){super({name:"InvalidRedirectUriException",$fault:"client",...e});this.name="InvalidRedirectUriException",this.$fault="client",Object.setPrototypeOf(this,Z.prototype),this.error=e.error,this.error_description=e.error_description}}var Ir=(e)=>({...e,...e.clientSecret&&{clientSecret:t},...e.refreshToken&&{refreshToken:t},...e.codeVerifier&&{codeVerifier:t}}),Rr=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Pr=(e)=>({...e,...e.refreshToken&&{refreshToken:t},...e.assertion&&{assertion:t},...e.subjectToken&&{subjectToken:t},...e.codeVerifier&&{codeVerifier:t}}),Tr=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),br=(e)=>({...e,...e.clientSecret&&{clientSecret:t}}),jr=(e)=>({...e,...e.clientSecret&&{clientSecret:t}});var v=w(U(),1),D=w(N(),1);var Dr=async(e,s)=>{let r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/token");let l;return l=JSON.stringify(o(e,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:(n)=>R(n)})),r.m("POST").h(i).b(l),r.build()},Ur=async(e,s)=>{let r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/token");let l=y({[ns]:[,"t"]}),n;return n=JSON.stringify(o(e,{assertion:[],clientId:[],code:[],codeVerifier:[],grantType:[],redirectUri:[],refreshToken:[],requestedTokenType:[],scope:(T)=>R(T),subjectToken:[],subjectTokenType:[]})),r.m("POST").h(i).q(l).b(n),r.build()},qr=async(e,s)=>{let r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/client/register");let l;return l=JSON.stringify(o(e,{clientName:[],clientType:[],entitledApplicationArn:[],grantTypes:(n)=>R(n),issuerUrl:[],redirectUris:(n)=>R(n),scopes:(n)=>R(n)})),r.m("POST").h(i).b(l),r.build()},xr=async(e,s)=>{let r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/device_authorization");let l;return l=JSON.stringify(o(e,{clientId:[],clientSecret:[],startUrl:[]})),r.m("POST").h(i).b(l),r.build()},zr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return f(e,s);let r=y({$metadata:c(e)}),i=j(F(await v.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:b,idToken:h,refreshToken:h,tokenType:h});return Object.assign(r,l),r},Gr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return f(e,s);let r=y({$metadata:c(e)}),i=j(F(await v.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:b,idToken:h,issuedTokenType:h,refreshToken:h,scope:R,tokenType:h});return Object.assign(r,l),r},Jr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return f(e,s);let r=y({$metadata:c(e)}),i=j(F(await v.parseJsonBody(e.body,s)),"body"),l=o(i,{authorizationEndpoint:h,clientId:h,clientIdIssuedAt:p,clientSecret:h,clientSecretExpiresAt:p,tokenEndpoint:h});return Object.assign(r,l),r},Vr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return f(e,s);let r=y({$metadata:c(e)}),i=j(F(await v.parseJsonBody(e.body,s)),"body"),l=o(i,{deviceCode:h,expiresIn:b,interval:b,userCode:h,verificationUri:h,verificationUriComplete:h});return Object.assign(r,l),r},f=async(e,s)=>{let r={...e,body:await v.parseJsonErrorBody(e.body,s)},i=v.loadRestJsonErrorCode(e,r.body);switch(i){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await Hr(r,s);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await Nr(r,s);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await _r(r,s);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await pr(r,s);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await Cr(r,s);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await Or(r,s);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await es(r,s);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await ss(r,s);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await is(r,s);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await ls(r,s);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await hs(r,s);case"InvalidRequestRegionException":case"com.amazonaws.ssooidc#InvalidRequestRegionException":throw await rs(r,s);case"InvalidClientMetadataException":case"com.amazonaws.ssooidc#InvalidClientMetadataException":throw await gr(r,s);case"InvalidRedirectUriException":case"com.amazonaws.ssooidc#InvalidRedirectUriException":throw await ur(r,s);default:let l=r.body;return fr({output:e,parsedBody:l,errorCode:i})}},fr=Fr(d),Hr=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new z({$metadata:c(e),...r});return a(n,e.body)},Nr=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new G({$metadata:c(e),...r});return a(n,e.body)},_r=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new J({$metadata:c(e),...r});return a(n,e.body)},pr=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new V({$metadata:c(e),...r});return a(n,e.body)},Cr=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new W({$metadata:c(e),...r});return a(n,e.body)},gr=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new Y({$metadata:c(e),...r});return a(n,e.body)},Or=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new A({$metadata:c(e),...r});return a(n,e.body)},ur=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new Z({$metadata:c(e),...r});return a(n,e.body)},es=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new K({$metadata:c(e),...r});return a(n,e.body)},rs=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{endpoint:h,error:h,error_description:h,region:h});Object.assign(r,l);let n=new X({$metadata:c(e),...r});return a(n,e.body)},ss=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new M({$metadata:c(e),...r});return a(n,e.body)},is=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new B({$metadata:c(e),...r});return a(n,e.body)},ls=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new L({$metadata:c(e),...r});return a(n,e.body)},hs=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new Q({$metadata:c(e),...r});return a(n,e.body)},c=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var ns="aws_iam";class C extends $.classBuilder().ep(k).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(Ir,Rr).ser(Dr).de(zr).build(){}class g extends $.classBuilder().ep(k).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateTokenWithIAM",{}).n("SSOOIDCClient","CreateTokenWithIAMCommand").f(Pr,Tr).ser(Ur).de(Gr).build(){}class O extends $.classBuilder().ep(k).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","RegisterClient",{}).n("SSOOIDCClient","RegisterClientCommand").f(void 0,br).ser(qr).de(Jr).build(){}class u extends $.classBuilder().ep(k).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","StartDeviceAuthorization",{}).n("SSOOIDCClient","StartDeviceAuthorizationCommand").f(jr,void 0).ser(xr).de(Vr).build(){}var os={CreateTokenCommand:C,CreateTokenWithIAMCommand:g,RegisterClientCommand:O,StartDeviceAuthorizationCommand:u};class Ar extends _{}Wr(os,Ar);export{Er as __Client,Q as UnsupportedGrantTypeException,L as UnauthorizedClientException,jr as StartDeviceAuthorizationRequestFilterSensitiveLog,u as StartDeviceAuthorizationCommand,B as SlowDownException,d as SSOOIDCServiceException,_ as SSOOIDCClient,Ar as SSOOIDC,br as RegisterClientResponseFilterSensitiveLog,O as RegisterClientCommand,M as InvalidScopeException,X as InvalidRequestRegionException,K as InvalidRequestException,Z as InvalidRedirectUriException,A as InvalidGrantException,Y as InvalidClientMetadataException,W as InvalidClientException,V as InternalServerException,J as ExpiredTokenException,Tr as CreateTokenWithIAMResponseFilterSensitiveLog,Pr as CreateTokenWithIAMRequestFilterSensitiveLog,g as CreateTokenWithIAMCommand,Rr as CreateTokenResponseFilterSensitiveLog,Ir as CreateTokenRequestFilterSensitiveLog,C as CreateTokenCommand,G as AuthorizationPendingException,z as AccessDeniedException,$ as $Command};
@@ -1,9 +0,0 @@
1
- import{jb as $}from"./chunk-8gx9at51.js";import{sb as w,tb as z,ub as B}from"./chunk-cm7bwdk9.js";import{wb as X}from"./chunk-gg80s18j.js";import{xb as q}from"./chunk-d2dbhn2h.js";var x=q(X(),1);var J=q(X(),1),k="AWS_EC2_METADATA_DISABLED",Y=async(b)=>{let{ENV_CMDS_FULL_URI:j,ENV_CMDS_RELATIVE_URI:y,fromContainerMetadata:G,fromInstanceMetadata:K}=await import("./chunk-n2c2dcxa.js");if(process.env[y]||process.env[j]){b.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:Q}=await import("./chunk-qq851psj.js");return J.chain(Q(b),G(b))}if(process.env[k])return async()=>{throw new J.CredentialsProviderError("EC2 Instance Metadata Service access disabled",{logger:b.logger})};return b.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),K(b)};var Z=!1,T=(b={})=>x.memoize(x.chain(async()=>{if(b.profile??process.env[$]){if(process.env[w]&&process.env[z]){if(!Z)(b.logger?.warn&&b.logger?.constructor?.name!=="NoOpLogger"?b.logger.warn:console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
2
- Multiple credential sources detected:
3
- Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
4
- This SDK will proceed with the AWS_PROFILE value.
5
-
6
- However, a future version may change this behavior to prefer the ENV static credentials.
7
- Please ensure that your environment only sets either the AWS_PROFILE or the
8
- AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
9
- `),Z=!0}throw new x.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.",{logger:b.logger,tryNextLink:!0})}return b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),B(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:j,ssoAccountId:y,ssoRegion:G,ssoRoleName:K,ssoSession:Q}=b;if(!j&&!y&&!G&&!K&&!Q)throw new x.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:b.logger});let{fromSSO:H}=await import("./chunk-rtfeef82.js");return H(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:j}=await import("./chunk-gjefq0nq.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:j}=await import("./chunk-5ewcj9vd.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:j}=await import("./chunk-0qvaepnz.js");return j(b)()},async()=>{return b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await Y(b))()},async()=>{throw new x.CredentialsProviderError("Could not load credentials from any providers",{tryNextLink:!1,logger:b.logger})}),O,v),v=(b)=>b?.expiration!==void 0,O=(b)=>b?.expiration!==void 0&&b.expiration.getTime()-Date.now()<300000;export{T as L};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{wb as a}from"./chunk-fxsv4p5c.js";import{xb as p}from"./chunk-p5va3trj.js";import{yb as E}from"./chunk-27ksm11g.js";var c=E(a(),1),N=E(p(),1);import{readFileSync as T}from"fs";var i=(e)=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:o,roleSessionName:r,webIdentityToken:s,providerId:n,policyArns:S,policy:d,durationSeconds:l}=e,{roleAssumerWithWebIdentity:t}=e;if(!t){let{getDefaultRoleAssumerWithWebIdentity:m}=await import("./chunk-3y0gapf6.js");t=m({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:e.parentClientConfig},e.clientPlugins)}return t({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:s,ProviderId:n,PolicyArns:S,Policy:d,DurationSeconds:l})};var _="AWS_WEB_IDENTITY_TOKEN_FILE",f="AWS_ROLE_ARN",A="AWS_ROLE_SESSION_NAME",w=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let o=e?.webIdentityTokenFile??process.env[_],r=e?.roleArn??process.env[f],s=e?.roleSessionName??process.env[A];if(!o||!r)throw new N.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});let n=await i({...e,webIdentityToken:T(o,{encoding:"ascii"}),roleArn:r,roleSessionName:s})();if(o===process.env[_])c.setCredentialFeature(n,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return n};export{i as fromWebToken,w as fromTokenFile};