dispach 0.2.0 → 0.2.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 (226) hide show
  1. package/README.md +144 -49
  2. package/dist/APEv2Parser-etzjd528.js +5 -0
  3. package/dist/{FlacParser-6jwner07.js.map → APEv2Parser-etzjd528.js.map} +1 -1
  4. package/dist/{AiffParser-n65syezh.js → AiffParser-y21k3fak.js} +3 -3
  5. package/dist/{AiffParser-n65syezh.js.map → AiffParser-y21k3fak.js.map} +1 -1
  6. package/dist/App-4w3qkcs4.js +11 -0
  7. package/dist/{App-pmqmzsb3.js.map → App-4w3qkcs4.js.map} +1 -1
  8. package/dist/{AsfParser-da1fqvxz.js → AsfParser-wd98k2h4.js} +3 -3
  9. package/dist/{AsfParser-da1fqvxz.js.map → AsfParser-wd98k2h4.js.map} +1 -1
  10. package/dist/{ConfigEditor-4nqbeejh.js → ConfigEditor-vk7vxaa6.js} +3 -3
  11. package/dist/{ConfigEditor-4nqbeejh.js.map → ConfigEditor-vk7vxaa6.js.map} +1 -1
  12. package/dist/{DsdiffParser-gk95sj7t.js → DsdiffParser-cbfaj500.js} +3 -3
  13. package/dist/{DsdiffParser-gk95sj7t.js.map → DsdiffParser-cbfaj500.js.map} +1 -1
  14. package/dist/{DsfParser-b0enevjw.js → DsfParser-tybrja4x.js} +3 -3
  15. package/dist/{DsfParser-b0enevjw.js.map → DsfParser-tybrja4x.js.map} +1 -1
  16. package/dist/FlacParser-7t7da7qy.js +5 -0
  17. package/dist/{APEv2Parser-jdp5yp24.js.map → FlacParser-7t7da7qy.js.map} +1 -1
  18. package/dist/{KeyProbe-rspsxpsr.js → KeyProbe-5anphmb7.js} +3 -3
  19. package/dist/{KeyProbe-rspsxpsr.js.map → KeyProbe-5anphmb7.js.map} +1 -1
  20. package/dist/{MP4Parser-ph7rv2fn.js → MP4Parser-gc94h1n9.js} +3 -3
  21. package/dist/{MP4Parser-ph7rv2fn.js.map → MP4Parser-gc94h1n9.js.map} +1 -1
  22. package/dist/{MatroskaParser-fjk1mpct.js → MatroskaParser-cy2k4fac.js} +3 -3
  23. package/dist/{MatroskaParser-fjk1mpct.js.map → MatroskaParser-cy2k4fac.js.map} +1 -1
  24. package/dist/{MpegParser-vp7cj8ts.js → MpegParser-c460fwf0.js} +3 -3
  25. package/dist/{MpegParser-vp7cj8ts.js.map → MpegParser-c460fwf0.js.map} +1 -1
  26. package/dist/{MusepackParser-v22gft1f.js → MusepackParser-8mq2eabg.js} +3 -3
  27. package/dist/{MusepackParser-v22gft1f.js.map → MusepackParser-8mq2eabg.js.map} +1 -1
  28. package/dist/OggParser-7dnc6apg.js +5 -0
  29. package/dist/{OggParser-as1m8xsa.js.map → OggParser-7dnc6apg.js.map} +1 -1
  30. package/dist/Picker-j7txnm7w.js +5 -0
  31. package/dist/{Picker-jkmd5xnx.js.map → Picker-j7txnm7w.js.map} +1 -1
  32. package/dist/SessionPicker-hpv2ncsb.js +5 -0
  33. package/dist/{SessionPicker-3712ke3k.js.map → SessionPicker-hpv2ncsb.js.map} +3 -3
  34. package/dist/SkillBrowser-qc542n71.js +5 -0
  35. package/dist/{SkillBrowser-qhsyszt4.js.map → SkillBrowser-qc542n71.js.map} +1 -1
  36. package/dist/{WavPackParser-b4qqavzg.js → WavPackParser-kt7cds9c.js} +3 -3
  37. package/dist/{WavPackParser-b4qqavzg.js.map → WavPackParser-kt7cds9c.js.map} +1 -1
  38. package/dist/{WaveParser-fqs1h38f.js → WaveParser-g47ja0vy.js} +3 -3
  39. package/dist/{WaveParser-fqs1h38f.js.map → WaveParser-g47ja0vy.js.map} +1 -1
  40. package/dist/WizardApp-q4p979d1.js +5 -0
  41. package/dist/{WizardApp-qrq36nv8.js.map → WizardApp-q4p979d1.js.map} +3 -3
  42. package/dist/{channels-gf31stv7.js → channels-4t89qpdt.js} +18 -18
  43. package/dist/{channels-gf31stv7.js.map → channels-4t89qpdt.js.map} +1 -1
  44. package/dist/client.d.ts +242 -1
  45. package/dist/client.js +11 -11
  46. package/dist/client.js.map +5 -5
  47. package/dist/config-35r6n1gh.js +24 -0
  48. package/dist/{config-z2cd0c5f.js.map → config-35r6n1gh.js.map} +1 -1
  49. package/dist/credential-dpdgg4j6.js +19 -0
  50. package/dist/{credential-h0wmsjsw.js.map → credential-dpdgg4j6.js.map} +1 -1
  51. package/dist/{index-3s2q0m64.js → index-0444sh6x.js} +4 -4
  52. package/dist/{index-3s2q0m64.js.map → index-0444sh6x.js.map} +1 -1
  53. package/dist/{index-v271gbaz.js → index-095hrkyr.js} +6 -6
  54. package/dist/{index-v271gbaz.js.map → index-095hrkyr.js.map} +1 -1
  55. package/dist/index-1x8mzvz7.js +6 -0
  56. package/dist/{index-rhv6gqpt.js.map → index-1x8mzvz7.js.map} +1 -1
  57. package/dist/index-2bsardvh.js +5 -0
  58. package/dist/{index-tny7c703.js.map → index-2bsardvh.js.map} +2 -2
  59. package/dist/{index-9m6b14b4.js → index-2zjh5zd5.js} +4 -4
  60. package/dist/{index-9m6b14b4.js.map → index-2zjh5zd5.js.map} +1 -1
  61. package/dist/{index-t6xnecdx.js → index-323jvr1g.js} +4 -4
  62. package/dist/{index-t6xnecdx.js.map → index-323jvr1g.js.map} +1 -1
  63. package/dist/{index-gace5ac7.js → index-3826kf9t.js} +5 -5
  64. package/dist/{index-gace5ac7.js.map → index-3826kf9t.js.map} +1 -1
  65. package/dist/index-38gs9anh.js +9 -0
  66. package/dist/{index-b7qc21s7.js.map → index-38gs9anh.js.map} +1 -1
  67. package/dist/index-3c5jt6by.js +5 -0
  68. package/dist/{index-3mvenfbg.js.map → index-3c5jt6by.js.map} +2 -2
  69. package/dist/{index-k2q76dhw.js → index-3vzf253k.js} +7 -7
  70. package/dist/{index-k2q76dhw.js.map → index-3vzf253k.js.map} +1 -1
  71. package/dist/{index-t5d8ey5t.js → index-42e29zs4.js} +4 -4
  72. package/dist/{index-t5d8ey5t.js.map → index-42e29zs4.js.map} +1 -1
  73. package/dist/{index-v7mz396x.js → index-4fj1k64j.js} +4 -4
  74. package/dist/{index-v7mz396x.js.map → index-4fj1k64j.js.map} +1 -1
  75. package/dist/{index-gqbny9gy.js → index-51x0n5z0.js} +6 -6
  76. package/dist/{index-gqbny9gy.js.map → index-51x0n5z0.js.map} +1 -1
  77. package/dist/index-664xcamy.js +110 -0
  78. package/dist/index-664xcamy.js.map +13 -0
  79. package/dist/index-7mn8ack9.js +6 -0
  80. package/dist/{index-qe3ybzh6.js.map → index-7mn8ack9.js.map} +2 -2
  81. package/dist/index-8edck2pr.js +6 -0
  82. package/dist/{index-kktaw552.js.map → index-8edck2pr.js.map} +1 -1
  83. package/dist/index-8h6kewy1.js +9 -0
  84. package/dist/{index-s4a28ctb.js.map → index-8h6kewy1.js.map} +1 -1
  85. package/dist/index-8tmv33mr.js +6 -0
  86. package/dist/{index-v6taf4vn.js.map → index-8tmv33mr.js.map} +1 -1
  87. package/dist/index-9914wh1d.js +6 -0
  88. package/dist/index-9914wh1d.js.map +10 -0
  89. package/dist/{index-y6r1k2yd.js → index-a2eh8dnk.js} +7 -7
  90. package/dist/{index-y6r1k2yd.js.map → index-a2eh8dnk.js.map} +1 -1
  91. package/dist/{index-81vj1bxe.js → index-bqdkm3de.js} +4 -4
  92. package/dist/{index-81vj1bxe.js.map → index-bqdkm3de.js.map} +1 -1
  93. package/dist/{index-rfa0ztab.js → index-dzy19wtf.js} +4 -4
  94. package/dist/{index-rfa0ztab.js.map → index-dzy19wtf.js.map} +1 -1
  95. package/dist/{index-c2qjdz4q.js → index-eqqd4k4f.js} +9 -9
  96. package/dist/{index-c2qjdz4q.js.map → index-eqqd4k4f.js.map} +1 -1
  97. package/dist/{index-g1d06ct5.js → index-ew997be5.js} +7 -7
  98. package/dist/{index-g1d06ct5.js.map → index-ew997be5.js.map} +1 -1
  99. package/dist/{index-0v2gw4mk.js → index-fa9wvpyw.js} +3 -3
  100. package/dist/{index-0v2gw4mk.js.map → index-fa9wvpyw.js.map} +1 -1
  101. package/dist/{index-rvq7t636.js → index-fbsrhcga.js} +4 -4
  102. package/dist/{index-rvq7t636.js.map → index-fbsrhcga.js.map} +1 -1
  103. package/dist/index-fcsg95m5.js +11 -0
  104. package/dist/{index-5nprb9px.js.map → index-fcsg95m5.js.map} +1 -1
  105. package/dist/{index-dgrwpzz9.js → index-gbkma7ds.js} +4 -4
  106. package/dist/{index-dgrwpzz9.js.map → index-gbkma7ds.js.map} +1 -1
  107. package/dist/{index-0m0x1454.js → index-gq1npngp.js} +4 -4
  108. package/dist/{index-0m0x1454.js.map → index-gq1npngp.js.map} +1 -1
  109. package/dist/index-haypwvzd.js +308 -0
  110. package/dist/index-haypwvzd.js.map +21 -0
  111. package/dist/{index-g8n8rhtr.js → index-jc4kmfwa.js} +4 -4
  112. package/dist/{index-g8n8rhtr.js.map → index-jc4kmfwa.js.map} +1 -1
  113. package/dist/index-kjqksgch.js +429 -0
  114. package/dist/index-kjqksgch.js.map +12 -0
  115. package/dist/{index-es4bgkbh.js → index-m6fqx0ch.js} +7 -7
  116. package/dist/{index-es4bgkbh.js.map → index-m6fqx0ch.js.map} +1 -1
  117. package/dist/{index-60jxyzbe.js → index-ma6p7bt4.js} +4 -4
  118. package/dist/{index-60jxyzbe.js.map → index-ma6p7bt4.js.map} +1 -1
  119. package/dist/index-nvc24414.js +6 -0
  120. package/dist/{index-2yj11ykt.js.map → index-nvc24414.js.map} +1 -1
  121. package/dist/index-nxhqf597.js +6 -0
  122. package/dist/{index-m5rmhcez.js.map → index-nxhqf597.js.map} +1 -1
  123. package/dist/{index-jmnjcw61.js → index-p1zy871m.js} +4 -4
  124. package/dist/{index-jmnjcw61.js.map → index-p1zy871m.js.map} +1 -1
  125. package/dist/{index-2pzgta33.js → index-p6ya59m6.js} +5 -5
  126. package/dist/{index-2pzgta33.js.map → index-p6ya59m6.js.map} +1 -1
  127. package/dist/{index-6c4p19m1.js → index-pszmnhgq.js} +2 -2
  128. package/dist/index-qg9bn980.js +1213 -0
  129. package/dist/{index-1h9pqnec.js.map → index-qg9bn980.js.map} +28 -25
  130. package/dist/index-qgsdgbk8.js +5 -0
  131. package/dist/{index-ak304afj.js.map → index-qgsdgbk8.js.map} +2 -2
  132. package/dist/index-r4ax3x4d.js +74 -0
  133. package/dist/index-r4ax3x4d.js.map +13 -0
  134. package/dist/{index-m01mb74d.js → index-snz49ndn.js} +4 -4
  135. package/dist/{index-m01mb74d.js.map → index-snz49ndn.js.map} +1 -1
  136. package/dist/index-twn9bfm2.js +8 -0
  137. package/dist/{index-dwxmy0kx.js.map → index-twn9bfm2.js.map} +2 -2
  138. package/dist/{index-0p9p6fvc.js → index-wc4entme.js} +10 -10
  139. package/dist/{index-0p9p6fvc.js.map → index-wc4entme.js.map} +3 -3
  140. package/dist/{index-wxmqyv4c.js → index-ynsvkqgb.js} +4 -4
  141. package/dist/{index-wxmqyv4c.js.map → index-ynsvkqgb.js.map} +1 -1
  142. package/dist/index-ytxbw8py.js +63 -0
  143. package/dist/{index-fcqy46mh.js.map → index-ytxbw8py.js.map} +2 -2
  144. package/dist/index-yw3fby4n.js +6 -0
  145. package/dist/{index-dh2g58s1.js.map → index-yw3fby4n.js.map} +2 -2
  146. package/dist/{index-ccpq4k6r.js → index-z157at3s.js} +28 -28
  147. package/dist/{index-ccpq4k6r.js.map → index-z157at3s.js.map} +1 -1
  148. package/dist/{index-s78sq9g1.js → index-zce9gy22.js} +64 -64
  149. package/dist/{index-s78sq9g1.js.map → index-zce9gy22.js.map} +1 -1
  150. package/dist/{index-jv7egrh2.js → index-zw6wyas6.js} +4 -4
  151. package/dist/{index-jv7egrh2.js.map → index-zw6wyas6.js.map} +1 -1
  152. package/dist/index.js +308 -292
  153. package/dist/index.js.map +15 -12
  154. package/dist/init.d.ts.map +1 -1
  155. package/dist/lib/agent-template.d.ts +5 -0
  156. package/dist/lib/agent-template.d.ts.map +1 -1
  157. package/dist/lib/commands.d.ts.map +1 -1
  158. package/dist/lib/init-flow.d.ts +7 -30
  159. package/dist/lib/init-flow.d.ts.map +1 -1
  160. package/dist/lib/owner.d.ts +49 -0
  161. package/dist/lib/owner.d.ts.map +1 -0
  162. package/dist/lib/presets.d.ts +44 -0
  163. package/dist/lib/presets.d.ts.map +1 -0
  164. package/dist/lib/provision.d.ts +8 -1
  165. package/dist/lib/provision.d.ts.map +1 -1
  166. package/dist/lib/relay-client.d.ts +17 -0
  167. package/dist/lib/relay-client.d.ts.map +1 -0
  168. package/dist/lib/schema.d.ts +2 -0
  169. package/dist/lib/schema.d.ts.map +1 -1
  170. package/dist/lib/sessions-view.d.ts +2 -0
  171. package/dist/lib/sessions-view.d.ts.map +1 -1
  172. package/dist/lib/source.d.ts +17 -0
  173. package/dist/lib/source.d.ts.map +1 -1
  174. package/dist/lib/wizard.d.ts.map +1 -1
  175. package/dist/owner.d.ts +16 -0
  176. package/dist/owner.d.ts.map +1 -0
  177. package/dist/run.d.ts.map +1 -1
  178. package/dist/serve.d.ts.map +1 -1
  179. package/dist/transcript.d.ts.map +1 -1
  180. package/dist/web-zph4h3p9.js +14 -0
  181. package/dist/{web-stkkwyka.js.map → web-zph4h3p9.js.map} +1 -1
  182. package/dist/wire.d.ts +31 -0
  183. package/dist/wire.js +2 -2
  184. package/dist/wire.js.map +4 -4
  185. package/dist/wrapper-f662ny3r.js +5 -0
  186. package/dist/{wrapper-bwxbqa53.js.map → wrapper-f662ny3r.js.map} +1 -1
  187. package/package.json +5 -2
  188. package/dist/APEv2Parser-jdp5yp24.js +0 -5
  189. package/dist/App-pmqmzsb3.js +0 -11
  190. package/dist/FlacParser-6jwner07.js +0 -5
  191. package/dist/OggParser-as1m8xsa.js +0 -5
  192. package/dist/Picker-jkmd5xnx.js +0 -5
  193. package/dist/SessionPicker-3712ke3k.js +0 -5
  194. package/dist/SkillBrowser-qhsyszt4.js +0 -5
  195. package/dist/WizardApp-qrq36nv8.js +0 -5
  196. package/dist/config-z2cd0c5f.js +0 -24
  197. package/dist/credential-h0wmsjsw.js +0 -19
  198. package/dist/index-026q0y3a.js +0 -6
  199. package/dist/index-026q0y3a.js.map +0 -10
  200. package/dist/index-1h9pqnec.js +0 -1194
  201. package/dist/index-1wxw30j1.js +0 -74
  202. package/dist/index-1wxw30j1.js.map +0 -13
  203. package/dist/index-2yj11ykt.js +0 -6
  204. package/dist/index-358nsn9t.js +0 -65
  205. package/dist/index-358nsn9t.js.map +0 -21
  206. package/dist/index-3mvenfbg.js +0 -5
  207. package/dist/index-5nprb9px.js +0 -11
  208. package/dist/index-ak304afj.js +0 -5
  209. package/dist/index-b7qc21s7.js +0 -9
  210. package/dist/index-dh2g58s1.js +0 -6
  211. package/dist/index-dwxmy0kx.js +0 -8
  212. package/dist/index-fcqy46mh.js +0 -63
  213. package/dist/index-kktaw552.js +0 -6
  214. package/dist/index-m5rmhcez.js +0 -6
  215. package/dist/index-qe3ybzh6.js +0 -6
  216. package/dist/index-rhv6gqpt.js +0 -6
  217. package/dist/index-s4a28ctb.js +0 -9
  218. package/dist/index-tny7c703.js +0 -5
  219. package/dist/index-v6taf4vn.js +0 -6
  220. package/dist/index-y605a1rj.js +0 -429
  221. package/dist/index-y605a1rj.js.map +0 -11
  222. package/dist/index-z88f35vs.js +0 -96
  223. package/dist/index-z88f35vs.js.map +0 -13
  224. package/dist/web-stkkwyka.js +0 -14
  225. package/dist/wrapper-bwxbqa53.js +0 -5
  226. /package/dist/{index-6c4p19m1.js.map → index-pszmnhgq.js.map} +0 -0
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+ import{e,c}from"./index-323jvr1g.js";var xt=e(function(xw){var qo;(function(t){t.HEADER="header",t.QUERY="query"})(qo||(qo={}));var Vo;(function(t){t.HEADER="header",t.QUERY="query"})(Vo||(Vo={}));var jo;(function(t){t.HTTP="http",t.HTTPS="https"})(jo||(jo={}));var Nr;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(Nr||(Nr={}));var ww=(t)=>{let r=[];if(t.sha256!==void 0)r.push({algorithmId:()=>Nr.SHA256,checksumConstructor:()=>t.sha256});if(t.md5!=null)r.push({algorithmId:()=>Nr.MD5,checksumConstructor:()=>t.md5});return{addChecksumAlgorithm(n){r.push(n)},checksumAlgorithms(){return r}}},Ew=(t)=>{let r={};return t.checksumAlgorithms().forEach((n)=>{r[n.algorithmId()]=n.checksumConstructor()}),r},bw=(t)=>ww(t),_w=(t)=>Ew(t),Wo;(function(t){t[t.HEADER=0]="HEADER",t[t.TRAILER=1]="TRAILER"})(Wo||(Wo={}));var Aw="__smithy_context",Go;(function(t){t.PROFILE="profile",t.SSO_SESSION="sso-session",t.SERVICES="services"})(Go||(Go={}));var Ko;(function(t){t.HTTP_0_9="http/0.9",t.HTTP_1_0="http/1.0",t.TDS_8_0="tds/8.0"})(Ko||(Ko={}));xw.AlgorithmId=Nr;xw.EndpointURLScheme=jo;xw.FieldPosition=Wo;xw.HttpApiKeyAuthLocation=Vo;xw.HttpAuthLocation=qo;xw.IniSectionType=Go;xw.RequestHandlerProtocol=Ko;xw.SMITHY_CONTEXT_KEY=Aw;xw.getDefaultClientConfiguration=bw;xw.resolveDefaultRuntimeConfig=_w});var me=e(function(Hw){var{SMITHY_CONTEXT_KEY:gu}=xt(),Dw=(t)=>t[gu]||(t[gu]={});function mu(t,r){return Object.prototype.hasOwnProperty.call(t,r)}class vn{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;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 r=new vn({...t,headers:{...t.headers}});if(r.query)r.query=Fw(r.query);return r}static isInstance(t){if(!t)return!1;let r=t;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query==="object"&&typeof r.headers==="object"}clone(){return vn.clone(this)}}function Fw(t){return Object.keys(t).reduce((r,n)=>{let s=t[n];return{...r,[n]:Array.isArray(s)?[...s]:s}},{})}class yu{statusCode;reason;headers;body;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 r=t;return typeof r.statusCode==="number"&&typeof r.headers==="object"}}var Lw=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Su=(t,r=!1)=>{if(!r)return Lw.test(t);let n=t.split(".");for(let s of n)if(!Su(s))return!1;return!0};function Uw(t){return/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(t)}var $w=(t)=>{if(typeof t==="function")return t;let r=Promise.resolve(t);return()=>r};function wu(t){let r={};if(t=t.replace(/^\?/,""),t)for(let n of t.split("&")){let[s,o=null]=n.split("=");if(s=decodeURIComponent(s),o)o=decodeURIComponent(o);if(!(s in r))r[s]=o;else if(Array.isArray(r[s]))r[s].push(o);else r[s]=[r[s],o]}return r}var Nn=(t)=>{if(typeof t==="string")return Nn(new URL(t));let{hostname:r,pathname:n,port:s,protocol:o,search:i}=t,u;if(i)u=wu(i);return{hostname:r,port:s?parseInt(s):void 0,protocol:o,path:n,query:u}},Bw=(t)=>{if(typeof t==="object"){if("url"in t){let r=Nn(t.url);if(t.headers){r.headers={};for(let n in t.headers){if(!mu(t.headers,n))continue;r.headers[n.toLowerCase()]=t.headers[n].join(", ")}}return r}return t}return Nn(t)};Hw.HttpRequest=vn;Hw.HttpResponse=yu;Hw.getSmithyContext=Dw;Hw.hasOwn=mu;Hw.isValidHostLabel=Su;Hw.isValidHostname=Uw;Hw.normalizeProvider=$w;Hw.parseQueryString=wu;Hw.parseUrl=Nn;Hw.toEndpointV1=Bw});var Re=e(function(lE){var{getSmithyContext:Eu,HttpResponse:Jw,toEndpointV1:Zw}=me(),On=(t)=>{if(typeof t==="function")return t();return t},Yo=(t,r,n,s,o)=>({name:r,namespace:t,traits:n,input:s,output:o}),eE=(t)=>(r,n)=>async(s)=>{let{response:o}=await r(s),{operationSchema:i}=Eu(n),[,u,a,d,l,h]=i??[];try{let f=await t.protocol.deserializeResponse(Yo(u,a,d,l,h),{...t,...n},o);return{response:o,output:f}}catch(f){if(Object.defineProperty(f,"$response",{value:o,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in f)){try{f.message+=`
3
+ Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`}catch(g){if(!n.logger||n.logger?.constructor?.name==="NoOpLogger")console.warn("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.");else n.logger?.warn?.("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.")}if(typeof f.$responseBodyText<"u"){if(f.$response)f.$response.body=f.$responseBodyText}try{if(Jw.isInstance(o)){let{headers:g={},statusCode:m}=o,y=Object.entries(g);f.$metadata={httpStatusCode:m,requestId:Qo(/^x-[\w-]+-request-?id$/,y),extendedRequestId:Qo(/^x-[\w-]+-id-2$/,y),cfId:Qo(/^x-[\w-]+-cf-id$/,y)}}}catch(g){}}throw f}},Qo=(t,r)=>(r.find(([n])=>n.match(t))||[void 0,void 0])[1],tE=(t)=>(r,n)=>async(s)=>{let{operationSchema:o}=Eu(n),[,i,u,a,d,l]=o??[],h=n.endpointV2?async()=>Zw(n.endpointV2):t.endpoint,f=await t.protocol.serializeRequest(Yo(i,u,a,d,l),s.input,{...t,...n,endpoint:h});return r({...s,request:f})},bu={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},_u={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function rE(t){return{applyToStack:(r)=>{r.add(tE(t),_u),r.add(eE(t),bu),t.protocol.setSerdeContext(t)}}}class fe{name;namespace;traits;static assign(t,r){return Object.assign(t,r)}static[Symbol.hasInstance](t){let r=this.prototype.isPrototypeOf(t);if(!r&&typeof t==="object"&&t!==null)return t.symbol===this.symbol;return r}getName(){return this.namespace+"#"+this.name}}class Fn extends fe{static symbol=Symbol.for("@smithy/lis");valueSchema;symbol=Fn.symbol}var nE=(t,r,n,s)=>fe.assign(new Fn,{name:r,namespace:t,traits:n,valueSchema:s});class Ln extends fe{static symbol=Symbol.for("@smithy/map");keySchema;valueSchema;symbol=Ln.symbol}var sE=(t,r,n,s,o)=>fe.assign(new Ln,{name:r,namespace:t,traits:n,keySchema:s,valueSchema:o});class Un extends fe{static symbol=Symbol.for("@smithy/ope");input;output;symbol=Un.symbol}var oE=(t,r,n,s,o)=>fe.assign(new Un,{name:r,namespace:t,traits:n,input:s,output:o});class Mr extends fe{static symbol=Symbol.for("@smithy/str");memberNames;memberList;symbol=Mr.symbol}var iE=(t,r,n,s,o)=>fe.assign(new Mr,{name:r,namespace:t,traits:n,memberNames:s,memberList:o});class $n extends Mr{static symbol=Symbol.for("@smithy/err");ctor;symbol=$n.symbol}var aE=(t,r,n,s,o,i)=>fe.assign(new $n,{name:r,namespace:t,traits:n,memberNames:s,memberList:o,ctor:null}),Pn=[];function kr(t){if(typeof t==="object")return t;if(t=t|0,Pn[t])return Pn[t];let r={},n=0;for(let s of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])if((t>>n++&1)===1)r[s]=1;return Pn[t]=r}var Or={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},kn=[],Dn={};class Ve{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=Ve.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(t,r){this.ref=t,this.memberName=r;let n=[],s=t,o=t;this._isMemberSchema=!1;while(Xo(s))n.push(s[1]),s=s[0],o=On(s),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let i=n.length-1;i>=0;--i){let u=n[i];Object.assign(this.memberTraits,kr(u))}}else this.memberTraits=0;if(o instanceof Ve){let i=this.memberTraits;Object.assign(this,o),this.memberTraits=Object.assign({},i,o.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=r??o.memberName;return}if(this.schema=On(o),Au(this.schema))this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3];else this.name=this.memberName??String(o),this.traits=0;if(this._isMemberSchema&&!r)throw Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](t){let r=this.prototype.isPrototypeOf(t);if(!r&&typeof t==="object"&&t!==null)return t.symbol===this.symbol;return r}static of(t){let r=typeof t==="function"||typeof t==="object"&&t!==null;if(typeof t==="number"){if(kn[t])return kn[t]}else if(typeof t==="string"){if(Dn[t])return Dn[t]}else if(r){if(t[Or.ns])return t[Or.ns]}let n=On(t);if(n instanceof Ve)return n;if(Xo(n)){let[o,i]=n;if(o instanceof Ve)return Object.assign(o.getMergedTraits(),kr(i)),o;throw Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(t,null,2)}.`)}let s=new Ve(n);if(r)return t[Or.ns]=s;if(typeof n==="string")return Dn[n]=s;if(typeof n==="number")return kn[n]=s;return s}getSchema(){let t=this.schema;if(Array.isArray(t)&&t[0]===0)return t[4];return t}getName(t=!1){let{name:r}=this;return!t&&r&&r.includes("#")?r.split("#")[1]:r||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){let t=this.getSchema();return typeof t==="number"?t>=64&&t<128:t[0]===1}isMapSchema(){let t=this.getSchema();return typeof t==="number"?t>=128&&t<=255:t[0]===2}isStructSchema(){let t=this.getSchema();if(typeof t!=="object")return!1;let r=t[0];return r===3||r===-3||r===4}isUnionSchema(){let t=this.getSchema();if(typeof t!=="object")return!1;return t[0]===4}isBlobSchema(){let t=this.getSchema();return t===21||t===42}isTimestampSchema(){let t=this.getSchema();return typeof t==="number"&&t>=4&&t<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){let{streaming:t}=this.getMergedTraits();return!!t||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return kr(this.memberTraits)}getOwnTraits(){return kr(this.traits)}getKeySchema(){let[t,r]=[this.isDocumentSchema(),this.isMapSchema()];if(!t&&!r)throw Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);let n=this.getSchema(),s=t?15:n[4]??0;return Pr([s,0],"key")}getValueSchema(){let t=this.getSchema(),[r,n,s]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],o=typeof t==="number"?63&t:t&&typeof t==="object"&&(n||s)?t[3+t[0]]:r?15:void 0;if(o!=null)return Pr([o,0],n?"value":"member");throw Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(t){let r=this.getSchema();if(this.isStructSchema()&&r[4].includes(t)){let n=r[4].indexOf(t),s=r[5][n];return Pr(Xo(s)?s:[s,0],t)}if(this.isDocumentSchema())return Pr([15,0],t);throw Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${t}.`)}getMemberSchemas(){let t={};try{for(let[r,n]of this.structIterator())t[r]=n}catch(r){}return t}getEventStreamMember(){if(this.isStructSchema()){for(let[t,r]of this.structIterator())if(r.isStreaming()&&r.isStructSchema())return t}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw Error("@smithy/core/schema - cannot iterate non-struct schema.");let t=this.getSchema(),r=t[4].length,n=t[Or.it];if(n&&r===n.length){yield*n;return}n=Array(r);for(let s=0;s<r;++s){let o=t[4][s],i=Pr([t[5][s],0],o);yield n[s]=[o,i]}t[Or.it]=n}}function Pr(t,r){if(t instanceof Ve)return Object.assign(t,{memberName:r,_isMemberSchema:!0});return new Ve(t,r)}var Xo=(t)=>Array.isArray(t)&&t.length===2,Au=(t)=>Array.isArray(t)&&t.length>=5;class Dr extends fe{static symbol=Symbol.for("@smithy/sim");schemaRef;symbol=Dr.symbol}var cE=(t,r,n,s)=>fe.assign(new Dr,{name:r,namespace:t,traits:s,schemaRef:n}),uE=(t,r,n,s)=>fe.assign(new Dr,{name:r,namespace:t,traits:n,schemaRef:s}),dE={BLOB:21,STREAMING_BLOB:42,BOOLEAN:2,STRING:0,NUMERIC:1,BIG_INTEGER:17,BIG_DECIMAL:19,DOCUMENT:15,TIMESTAMP_DEFAULT:4,TIMESTAMP_DATE_TIME:5,TIMESTAMP_HTTP_DATE:6,TIMESTAMP_EPOCH_SECONDS:7,LIST_MODIFIER:64,MAP_MODIFIER:128};class qe{namespace;schemas;exceptions;static registries=new Map;constructor(t,r=new Map,n=new Map){if(this.namespace=t,this.schemas=r,this.exceptions=n,!qe.registries.has(t))qe.registries.set(t,this)}static for(t){return qe.registries.get(t)??new qe(t)}copyFrom(t){let{schemas:r,exceptions:n}=this;for(let[s,o]of t.schemas)if(!r.has(s))r.set(s,o);for(let[s,o]of t.exceptions)if(!n.has(s))n.set(s,o)}register(t,r){let n=this.normalizeShapeId(t);for(let s of[this,qe.for(n.split("#")[0])])if(!s.schemas.has(n))s.schemas.set(n,r)}getSchema(t){let r=this.normalizeShapeId(t);if(!this.schemas.has(r)){if(!t.includes("#")){let n="#"+t,s=[];for(let[o,i]of this.schemas.entries())if(o.endsWith(n))s.push(i);if(s.length===1)return s[0]}throw Error(`@smithy/core/schema - schema not found for ${r}`)}return this.schemas.get(r)}registerError(t,r){let n=t,s=n[1],o=s+"#"+n[2];for(let i of[this,qe.for(s)])if(!i.schemas.has(o)&&!i.exceptions.has(n))i.schemas.set(o,n),i.exceptions.set(n,r)}getErrorCtor(t){let r=t;if(this.exceptions.has(r))return this.exceptions.get(r);return qe.for(r[1]).exceptions.get(r)}getBaseException(){for(let t of this.exceptions.keys())if(Array.isArray(t)){let[,r,n]=t,s=r+"#"+n;if(s.startsWith("smithy.ts.sdk.synthetic.")&&s.endsWith("ServiceException"))return t}return}find(t){for(let r of this.schemas.values())if(t(r))return r;return}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(t){if(t.includes("#"))return t;return this.namespace+"#"+t}}lE.ErrorSchema=$n;lE.ListSchema=Fn;lE.MapSchema=Ln;lE.NormalizedSchema=Ve;lE.OperationSchema=Un;lE.SCHEMA=dE;lE.Schema=fe;lE.SimpleSchema=Dr;lE.StructureSchema=Mr;lE.TypeRegistry=qe;lE.deref=On;lE.deserializerMiddlewareOption=bu;lE.error=aE;lE.getSchemaSerdePlugin=rE;lE.isStaticSchema=Au;lE.list=nE;lE.map=sE;lE.op=oE;lE.operation=Yo;lE.serializerMiddlewareOption=_u;lE.sim=cE;lE.simAdapter=uE;lE.simpleSchemaCacheN=kn;lE.simpleSchemaCacheS=Dn;lE.struct=iE;lE.traitsCache=Pn;lE.translateTraits=kr});var Ie=e(function(yb){var{hasOwn:Ur}=me(),{getSmithyContext:$E,normalizeProvider:BE}=me();yb.getSmithyContext=$E;yb.normalizeProvider=BE;var{SMITHY_CONTEXT_KEY:xu,AlgorithmId:Fr}=xt();yb.AlgorithmId=Fr;var{NormalizedSchema:HE}=Re(),Tt=(t,r)=>{let n=[];if(t)n.push(t);if(r)for(let s of r)n.push(s);return n},Ze=(t,r)=>`${t||"anonymous"}${r&&r.length>0?` (a.k.a. ${r.join(",")})`:""}`,Lr=()=>{let t=[],r=[],n=!1,s=new Set,o=(f)=>f.sort((p,g)=>Tu[g.step]-Tu[p.step]||Cu[g.priority||"normal"]-Cu[p.priority||"normal"]),i=(f)=>{let p=!1,g=(m)=>{let y=Tt(m.name,m.aliases);if(y.includes(f)){p=!0;for(let S of y)s.delete(S);return!1}return!0};return t=t.filter(g),r=r.filter(g),p},u=(f)=>{let p=!1,g=(m)=>{if(m.middleware===f){p=!0;for(let y of Tt(m.name,m.aliases))s.delete(y);return!1}return!0};return t=t.filter(g),r=r.filter(g),p},a=(f)=>(t.forEach((p)=>{f.add(p.middleware,{...p})}),r.forEach((p)=>{f.addRelativeTo(p.middleware,{...p})}),f.identifyOnResolve?.(h.identifyOnResolve()),f),d=(f)=>{let p=[];return f.before.forEach((g)=>{if(g.before.length===0&&g.after.length===0)p.push(g);else p.push(...d(g))}),p.push(f),f.after.reverse().forEach((g)=>{if(g.before.length===0&&g.after.length===0)p.push(g);else p.push(...d(g))}),p},l=(f=!1)=>{let p=[],g=[],m={};return t.forEach((S)=>{let w={...S,before:[],after:[]};for(let E of Tt(w.name,w.aliases))m[E]=w;p.push(w)}),r.forEach((S)=>{let w={...S,before:[],after:[]};for(let E of Tt(w.name,w.aliases))m[E]=w;g.push(w)}),g.forEach((S)=>{if(S.toMiddleware){let w=m[S.toMiddleware];if(w===void 0){if(f)return;throw Error(`${S.toMiddleware} is not found when adding ${Ze(S.name,S.aliases)} middleware ${S.relation} ${S.toMiddleware}`)}if(S.relation==="after")w.after.push(S);if(S.relation==="before")w.before.push(S)}}),o(p).map(d).reduce((S,w)=>(S.push(...w),S),[])},h={add:(f,p={})=>{let{name:g,override:m,aliases:y}=p,S={step:"initialize",priority:"normal",middleware:f,...p},w=Tt(g,y);if(w.length>0){if(w.some((E)=>s.has(E))){if(!m)throw Error(`Duplicate middleware name '${Ze(g,y)}'`);for(let E of w){let A=t.findIndex((L)=>L.name===E||L.aliases?.some((k)=>k===E));if(A===-1)continue;let v=t[A];if(v.step!==S.step||S.priority!==v.priority)throw Error(`"${Ze(v.name,v.aliases)}" middleware with ${v.priority} priority in ${v.step} step cannot be overridden by "${Ze(g,y)}" middleware with ${S.priority} priority in ${S.step} step.`);t.splice(A,1)}}for(let E of w)s.add(E)}t.push(S)},addRelativeTo:(f,p)=>{let{name:g,override:m,aliases:y}=p,S={middleware:f,...p},w=Tt(g,y);if(w.length>0){if(w.some((E)=>s.has(E))){if(!m)throw Error(`Duplicate middleware name '${Ze(g,y)}'`);for(let E of w){let A=r.findIndex((L)=>L.name===E||L.aliases?.some((k)=>k===E));if(A===-1)continue;let v=r[A];if(v.toMiddleware!==S.toMiddleware||v.relation!==S.relation)throw Error(`"${Ze(v.name,v.aliases)}" middleware ${v.relation} "${v.toMiddleware}" middleware cannot be overridden by "${Ze(g,y)}" middleware ${S.relation} "${S.toMiddleware}" middleware.`);r.splice(A,1)}}for(let E of w)s.add(E)}r.push(S)},clone:()=>a(Lr()),use:(f)=>{f.applyToStack(h)},remove:(f)=>{if(typeof f==="string")return i(f);else return u(f)},removeByTag:(f)=>{let p=!1,g=(m)=>{let{tags:y,name:S,aliases:w}=m;if(y&&y.includes(f)){let E=Tt(S,w);for(let A of E)s.delete(A);return p=!0,!1}return!0};return t=t.filter(g),r=r.filter(g),p},concat:(f)=>{let p=a(Lr());return p.use(f),p.identifyOnResolve(n||p.identifyOnResolve()||(f.identifyOnResolve?.()??!1)),p},applyToStack:a,identify:()=>l(!0).map((f)=>{let p=f.step??f.relation+" "+f.toMiddleware;return Ze(f.name,f.aliases)+" - "+p}),identifyOnResolve(f){if(typeof f==="boolean")n=f;return n},resolve:(f,p)=>{for(let g of l().map((m)=>m.middleware).reverse())f=g(f,p);if(n)console.log(h.identify());return f}};return h},Tu={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Cu={high:3,normal:2,low:1},zE=(t)=>()=>{throw Error(t)},qE=(t)=>()=>Promise.reject(t),Bn=()=>{let t=new WeakSet;return(r,n)=>{if(typeof n==="object"&&n!==null){if(t.has(n))return"[Circular]";t.add(n)}return n}},VE=(t)=>new Promise((r)=>setTimeout(r,t*1000)),vu={minDelay:2,maxDelay:120},Me;(function(t){t.ABORTED="ABORTED",t.FAILURE="FAILURE",t.SUCCESS="SUCCESS",t.RETRY="RETRY",t.TIMEOUT="TIMEOUT"})(Me||(Me={}));var jE=(t)=>{if(t.state===Me.ABORTED){let r=Error(`${JSON.stringify({...t,reason:"Request was aborted"},Bn())}`);throw r.name="AbortError",r}else if(t.state===Me.TIMEOUT){let r=Error(`${JSON.stringify({...t,reason:"Waiter has timed out"},Bn())}`);throw r.name="TimeoutError",r}else if(t.state!==Me.SUCCESS)throw Error(`${JSON.stringify(t,Bn())}`);return t},WE=async({minDelay:t,maxDelay:r,maxWaitTime:n,abortController:s,client:o,abortSignal:i},u,a)=>{let d={},[l,h]=[t*1000,r*1000],f=0,p=Date.now()+n*1000,g=Date.now()+60000,m=!1;while(!0){if(f>0){let w=QE(l,h,f,p);if(s?.signal?.aborted||i?.aborted)return d["AbortController signal aborted."]|=0,d["AbortController signal aborted."]+=1,{state:Me.ABORTED,observedResponses:d};if(Date.now()+w>p)return{state:Me.TIMEOUT,observedResponses:d};await VE(w/1000)}let{state:y,reason:S}=await a(o,u);if(S){let w=KE(S);d[w]|=0,d[w]+=1}if(y!==Me.RETRY)return{state:y,reason:S,final:S,observedResponses:d};if(f+=1,!m&&Date.now()>=g)GE(d,o),m=!0}},GE=(t={},r)=>{let n=Object.keys(t),s=0;for(let u of n){let a=t[u]|0;if(u.startsWith("403:"))s+=a}let o=r?.config?.logger,i=typeof o?.warn==="function"&&!o.constructor?.name?.includes?.("NoOpLogger")?o:console;if(s>=3||n[n.length-1]?.startsWith("403:"))i.warn("@smithy/util-waiter WARN - 403 status code encountered during waiter polling.")},KE=(t)=>{let r=t?.$response?.statusCode??t?.$metadata?.httpStatusCode;if(t?.$responseBodyText)return`${r?r+": ":""}Deserialization error for body: ${t.$responseBodyText}`;if(r){if(t?.$response||t?.message)return`${r??"Unknown"}: ${t?.message}`;return`${r}: OK`}return String(t?.message??JSON.stringify(t,Bn())??"Unknown")},QE=(t,r,n,s)=>{let o=Math.log(r/t)/Math.log(2)+1;if(n>o)return r;let i=t*2**(n-1),u=Math.min(i,r),a=XE(t,u);if(Date.now()+a>s){let d=s-Date.now();return Math.max(0,d-500)}return a},XE=(t,r)=>t+Math.random()*(r-t),YE=(t)=>{if(t.maxWaitTime<=0)throw Error("WaiterConfiguration.maxWaitTime must be greater than 0");else if(t.minDelay<=0)throw Error("WaiterConfiguration.minDelay must be greater than 0");else if(t.maxDelay<=0)throw Error("WaiterConfiguration.maxDelay must be greater than 0");else if(t.maxWaitTime<=t.minDelay)throw Error(`WaiterConfiguration.maxWaitTime [${t.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${t.minDelay}] for this waiter`);else if(t.maxDelay<t.minDelay)throw Error(`WaiterConfiguration.maxDelay [${t.maxDelay}] must be greater than WaiterConfiguration.minDelay [${t.minDelay}] for this waiter`)},Iu=(t)=>{let r,n=new Promise((s)=>{if(r=()=>s({state:Me.ABORTED}),typeof t.addEventListener==="function")t.addEventListener("abort",r);else t.onabort=r});return{clearListener(){if(typeof t.removeEventListener==="function")t.removeEventListener("abort",r)},aborted:n}},JE=async(t,r,n)=>{let s={...vu,...t};YE(s);let o=[WE(s,r,n)],i=[];if(t.abortSignal){let{aborted:u,clearListener:a}=Iu(t.abortSignal);i.push(a),o.push(u)}if(t.abortController?.signal){let{aborted:u,clearListener:a}=Iu(t.abortController.signal);i.push(a),o.push(u)}return Promise.race(o).then((u)=>{for(let a of i)a();return u})};class Nu{config;middlewareStack=Lr();initConfig;handlers;constructor(t){this.config=t;let{protocol:r,protocolSettings:n}=t;if(n){if(typeof r==="function")t.protocol=new r(n)}}send(t,r,n){let s=typeof r!=="function"?r:void 0,o=typeof r==="function"?r:n,i=s===void 0&&this.config.cacheMiddleware===!0,u;if(i){if(!this.handlers)this.handlers=new WeakMap;let a=this.handlers;if(a.has(t.constructor))u=a.get(t.constructor);else u=t.resolveMiddleware(this.middlewareStack,this.config,s),a.set(t.constructor,u)}else delete this.handlers,u=t.resolveMiddleware(this.middlewareStack,this.config,s);if(o)u(t).then((a)=>o(null,a.output),(a)=>o(a)).catch(()=>{});else return u(t).then((a)=>a.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var Jo="***SensitiveInformation***";function Hn(t,r){if(r==null)return r;let n=HE.of(t);if(n.getMergedTraits().sensitive)return Jo;if(n.isListSchema()){if(!!n.getValueSchema().getMergedTraits().sensitive)return Jo}else if(n.isMapSchema()){if(!!n.getKeySchema().getMergedTraits().sensitive||!!n.getValueSchema().getMergedTraits().sensitive)return Jo}else if(n.isStructSchema()&&typeof r==="object"){let s=r,o={};for(let[i,u]of n.structIterator())if(s[i]!=null)o[i]=Hn(u,s[i]);return o}return r}class zn{middlewareStack=Lr();schema;static classBuilder(){return new Ou}resolveMiddlewareWithContext(t,r,n,{middlewareFn:s,clientName:o,commandName:i,inputFilterSensitiveLog:u,outputFilterSensitiveLog:a,smithyContext:d,additionalContext:l,CommandCtor:h}){for(let w of s.bind(this)(h,t,r,n))this.middlewareStack.use(w);let f=t.concat(this.middlewareStack),{logger:p}=r,g=l[xu],m={logger:p,clientName:o,commandName:i,inputFilterSensitiveLog:u,outputFilterSensitiveLog:a,...l,[xu]:{...g,commandInstance:this,...d,...n?.metricsRecorder===void 0?{}:{metricsRecorder:n.metricsRecorder}}},{requestHandler:y}=r,S=n??{};if(S.metricsRecorder)S={...S},delete S.metricsRecorder;if(d.eventStream)S={isEventStream:!0,...S};return f.resolve((w)=>y.handle(w.request,S),m)}}class Ou{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,r,n={}){return this._smithyContext={service:t,operation:r,...n},this}c(t={}){return this._additionalContext=t,this}n(t,r){return this._clientName=t,this._commandName=r,this}f(t=(n)=>n,r=(n)=>n){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=r,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}sc(t){return this._operationSchema=t,this._smithyContext.operationSchema=t,this}build(){let t=this,r;return r=class extends zn{input;static getEndpointParameterInstructions(){return t._ep}constructor(...[n]){super();this.input=n??{},t._init(this),this.schema=t._operationSchema}resolveMiddleware(n,s,o){let i=t._operationSchema,u=i?.[4]??i?.input,a=i?.[5]??i?.output;return this.resolveMiddlewareWithContext(n,s,o,{CommandCtor:r,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog??(i?Hn.bind(null,u):(d)=>d),outputFilterSensitiveLog:t._outputFilterSensitiveLog??(i?Hn.bind(null,a):(d)=>d),smithyContext:t._smithyContext,additionalContext:t._additionalContext})}serialize=t._serializer;deserialize=t._deserializer}}}var ZE="***SensitiveInformation***",eb=(t,r,n)=>{for(let[i,u]of Object.entries(t)){let a=async function(l,h,f){let p=new u(l);if(typeof h==="function")this.send(p,h);else if(typeof f==="function"){if(typeof h!=="object")throw Error(`Expected http options but got ${typeof h}`);this.send(p,h||{},f)}else return this.send(p,h)},d=(i[0].toLowerCase()+i.slice(1)).replace(/Command$/,"");r.prototype[d]=a}let{paginators:s={},waiters:o={}}=n??{};for(let[i,u]of Object.entries(s))if(r.prototype[i]===void 0)r.prototype[i]=function(a={},d,...l){return u({...d,client:this},a,...l)};for(let[i,u]of Object.entries(o))if(r.prototype[i]===void 0)r.prototype[i]=async function(a={},d,...l){let h=d;if(typeof d==="number")h={maxWaitTime:d};return u({...h,client:this},a,...l)}};class Xt extends Error{$fault;$response;$retryable;$metadata;constructor(t){super(t.message);Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}static isInstance(t){if(!t)return!1;let r=t;return Xt.prototype.isPrototypeOf(r)||Boolean(r.$fault)&&Boolean(r.$metadata)&&(r.$fault==="client"||r.$fault==="server")}static[Symbol.hasInstance](t){if(!t)return!1;let r=t;if(this===Xt)return Xt.isInstance(t);if(Xt.isInstance(t)){if(this.prototype.isPrototypeOf(t))return!0;let n=this.name;if(!n||!r.name)return!1;if(r.name===n)return!0;let s=Object.getPrototypeOf(r);while(s&&s!==Object.prototype){let o=s.constructor?.name;if(o&&o!=="Error"&&o===n)return!0;s=Object.getPrototypeOf(s)}return!1}return!1}}var Pu=(t,r={})=>{Object.entries(r).filter(([,s])=>s!==void 0).forEach(([s,o])=>{if(t[s]==null||t[s]==="")t[s]=o});let n=t.message||t.Message||"UnknownError";return t.message=n,delete t.Message,t},ku=({output:t,parsedBody:r,exceptionCtor:n,errorCode:s})=>{let o=rb(t),i=o.httpStatusCode?o.httpStatusCode+"":void 0,u=new n({name:r?.code||r?.Code||s||i||"UnknownError",$fault:"client",$metadata:o});throw Pu(u,r)},tb=(t)=>({output:r,parsedBody:n,errorCode:s})=>{ku({output:r,parsedBody:n,exceptionCtor:t,errorCode:s})},rb=(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"]}),nb=(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{}}},Ru=!1,sb=(t)=>{if(t&&!Ru&&parseInt(t.substring(1,t.indexOf(".")))<16)Ru=!0},Mu=Object.values(Fr),Du=(t)=>{let r=[];for(let n in Fr){if(!Ur(Fr,n))continue;let s=Fr[n];if(t[s]===void 0)continue;r.push({algorithmId:()=>s,checksumConstructor:()=>t[s]})}for(let[n,s]of Object.entries(t.checksumAlgorithms??{}))r.push({algorithmId:()=>n,checksumConstructor:()=>s});return{addChecksumAlgorithm(n){t.checksumAlgorithms=t.checksumAlgorithms??{};let s=n.algorithmId(),o=n.checksumConstructor();if(Mu.includes(s))t.checksumAlgorithms[s.toUpperCase()]=o;else t.checksumAlgorithms[s]=o;r.push(n)},checksumAlgorithms(){return r}}},Fu=(t)=>{let r={};return t.checksumAlgorithms().forEach((n)=>{let s=n.algorithmId();if(Mu.includes(s))r[s]=n.checksumConstructor()}),r},Lu=(t)=>({setRetryStrategy(r){t.retryStrategy=r},retryStrategy(){return t.retryStrategy}}),Uu=(t)=>{let r={};return r.retryStrategy=t.retryStrategy(),r},$u=(t)=>Object.assign(Du(t),Lu(t)),ob=$u,ib=(t)=>Object.assign(Fu(t),Uu(t)),ab=(t)=>Array.isArray(t)?t:[t],Bu=(t)=>{for(let n in t){if(!Ur(t,n))continue;if(t[n]["#text"]!==void 0)t[n]=t[n]["#text"];else if(typeof t[n]==="object"&&t[n]!==null)t[n]=Bu(t[n])}return t},cb=(t)=>t!=null;class Hu{trace(){}debug(){}info(){}warn(){}error(){}}function zu(t,r,n){let s,o,i;if(typeof r>"u"&&typeof n>"u")s={},i=t;else if(s=t,typeof r==="function")return o=r,i=n,lb(s,o,i);else i=r;for(let u in i){if(!Ur(i,u))continue;if(!Array.isArray(i[u])){s[u]=i[u];continue}qu(s,null,i,u)}return s}var ub=(t)=>{let r={};for(let[n,s]of Object.entries(t||{}))r[n]=[,s];return r},db=(t,r)=>{let n={};for(let s in r){if(!Ur(r,s))continue;qu(n,t,r,s)}return n},lb=(t,r,n)=>zu(t,Object.entries(n).reduce((s,[o,i])=>{if(Array.isArray(i))s[o]=i;else if(typeof i==="function")s[o]=[r,i()];else s[o]=[r,i];return s},{})),qu=(t,r,n,s)=>{if(r!==null){let u=n[s];if(typeof u==="function")u=[,u];let[a=fb,d=hb,l=s]=u;if(typeof a==="function"&&a(r[l])||typeof a!=="function"&&!!a)t[s]=d(r[l]);return}let[o,i]=n[s];if(typeof i==="function"){let u,a=o===void 0&&(u=i())!=null,d=typeof o==="function"&&!!o(void 0)||typeof o!=="function"&&!!o;if(a)t[s]=u;else if(d)t[s]=i()}else{let u=o===void 0&&i!=null,a=typeof o==="function"&&!!o(i)||typeof o!=="function"&&!!o;if(u||a)t[s]=i}},fb=(t)=>t!=null,hb=(t)=>t,pb=(t)=>{if(t!==t)return"NaN";switch(t){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return t}},gb=(t)=>t.toISOString().replace(".000Z","Z"),Zo=(t)=>{if(t==null)return{};if(Array.isArray(t))return t.filter((r)=>r!=null).map(Zo);if(typeof t==="object"){let r={};for(let n in t){if(!Ur(t,n))continue;if(t[n]==null)continue;r[n]=Zo(t[n])}return r}return t};function mb(t,r,n,s){return function(i,u,a,d,l={}){let h=Object.assign({},t,i);return zn.classBuilder().ep(h).m(function(f,p,g,m){let y=u.call(this,f,p,g,m);return y.unshift(s(g,f.getEndpointParameterInstructions())),y}).s(r,a,l).n(n,a.charAt(0).toUpperCase()+a.slice(1)+"Command").sc(d).build()}}yb.Client=Nu;yb.Command=zn;yb.NoOpLogger=Hu;yb.SENSITIVE_STRING=ZE;yb.ServiceException=Xt;yb.WaiterState=Me;yb._json=Zo;yb.checkExceptions=jE;yb.constructStack=Lr;yb.convertMap=ub;yb.createAggregatedClient=eb;yb.createWaiter=JE;yb.decorateServiceException=Pu;yb.emitWarningIfUnsupportedVersion=sb;yb.getArrayIfSingleItem=ab;yb.getChecksumConfiguration=Du;yb.getDefaultClientConfiguration=ob;yb.getDefaultExtensionConfiguration=$u;yb.getRetryConfiguration=Lu;yb.getValueFromTextNode=Bu;yb.invalidFunction=zE;yb.invalidProvider=qE;yb.isSerializableHeaderValue=cb;yb.loadConfigsForDefaultMode=nb;yb.makeBuilder=mb;yb.map=zu;yb.resolveChecksumRuntimeConfig=Fu;yb.resolveDefaultRuntimeConfig=ib;yb.resolveRetryRuntimeConfig=Uu;yb.schemaLogFilter=Hn;yb.serializeDateTime=gb;yb.serializeFloat=pb;yb.take=db;yb.throwDefaultError=ku;yb.waiterServiceDefaults=vu;yb.withBaseException=tb});var W=e(function(nA){var{homedir:n_}=c("node:os"),{sep:s_,join:$r}=c("node:path"),{createHash:o_}=c("node:crypto"),{readFile:Ju}=c("node:fs/promises"),{IniSectionType:qn}=xt(),{normalizeProvider:Vn}=Ie(),{isValidHostLabel:i_}=me();class Yt extends Error{name="ProviderError";tryNextLink;constructor(t,r=!0){let n,s=!0;if(typeof r==="boolean")n=void 0,s=r;else if(r!=null&&typeof r==="object")n=r.logger,s=r.tryNextLink??!0;super(t);this.tryNextLink=s,Object.setPrototypeOf(this,Yt.prototype),n?.debug?.(`@smithy/property-provider ${s?"->":"(!)"} ${t}`)}static from(t,r=!0){return Object.assign(new this(t.message,r),t)}}class Br extends Yt{name="CredentialsProviderError";constructor(t,r=!0){super(t,r);Object.setPrototypeOf(this,Br.prototype)}}class si extends Yt{name="TokenProviderError";constructor(t,r=!0){super(t,r);Object.setPrototypeOf(this,si.prototype)}}var Zu=(...t)=>async()=>{if(t.length===0)throw new Yt("No providers in chain");let r;for(let n of t)try{return await n()}catch(s){if(r=s,s?.tryNextLink)continue;throw s}throw r},ed=(t)=>()=>Promise.resolve(t),oi=(t,r,n)=>{let s,o,i,u=!1,a=async()=>{if(!o)o=t();try{s=await o,i=!0,u=!1}finally{o=void 0}return s};if(r===void 0)return async(d)=>{if(!i||d?.forceRefresh)s=await a();return s};return async(d)=>{if(!i||d?.forceRefresh)s=await a();if(u)return s;if(n&&!n(s))return u=!0,s;if(r(s))return await a(),s;return s}},je=(t,r,n)=>{if(!(r in t))return;if(t[r]==="true")return!0;if(t[r]==="false")return!1;throw Error(`Cannot load ${n} "${r}". Expected "true" or "false", got ${t[r]}.`)},a_=(t,r,n)=>{if(!(r in t))return;let s=parseInt(t[r],10);if(Number.isNaN(s))throw TypeError(`Cannot load ${n} '${r}'. Expected number, got '${t[r]}'.`);return s},_e;(function(t){t.ENV="env",t.CONFIG="shared config entry"})(_e||(_e={}));var ei={},c_=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},Hr=()=>{let{HOME:t,USERPROFILE:r,HOMEPATH:n,HOMEDRIVE:s=`C:${s_}`}=process.env;if(t)return t;if(r)return r;if(n)return`${s}${n}`;let o=c_();if(!ei[o])ei[o]=n_();return ei[o]},td="AWS_PROFILE",rd="default",nd=(t)=>t.profile||process.env[td]||rd,sd=(t)=>{let n=o_("sha1").update(t).digest("hex");return $r(Hr(),".aws","sso","cache",`${n}.json`)},jn={},u_=async(t)=>{if(jn[t])return jn[t];let r=sd(t),n=await Ju(r,"utf8");return JSON.parse(n)},Ct=".",d_=(t)=>Object.entries(t).filter(([r])=>{let n=r.indexOf(Ct);if(n===-1)return!1;return Object.values(qn).includes(r.substring(0,n))}).reduce((r,[n,s])=>{let o=n.indexOf(Ct),i=n.substring(0,o)===qn.PROFILE?n.substring(o+1):n;return r[i]=s,r},{...t.default&&{default:t.default}}),l_="AWS_CONFIG_FILE",od=()=>process.env[l_]||$r(Hr(),".aws","config"),f_="AWS_SHARED_CREDENTIALS_FILE",h_=()=>process.env[f_]||$r(Hr(),".aws","credentials"),p_=/^([\w-]+)\s(["'])?([\w-@+.%:/]+)\2$/,g_=["__proto__","profile __proto__"],ri=(t)=>{let r={},n,s;for(let o of t.split(/\r?\n/)){let i=o.split(/(^|\s)[;#]/)[0].trim();if(i[0]==="["&&i[i.length-1]==="]"){n=void 0,s=void 0;let a=i.substring(1,i.length-1),d=p_.exec(a);if(d){let[,l,,h]=d;if(Object.values(qn).includes(l))n=[l,h].join(Ct)}else n=a;if(g_.includes(a))throw Error(`Found invalid profile name "${a}"`)}else if(n){let a=i.indexOf("=");if(![0,-1].includes(a)){let[d,l]=[i.substring(0,a).trim(),i.substring(a+1).trim()];if(l==="")s=d;else{if(s&&o.trimStart()===o)s=void 0;r[n]=r[n]||{};let h=s?[s,d].join(Ct):d;r[n][h]=l}}}}return r},ti={},Wn={},Gn=(t,r)=>{if(Wn[t]!==void 0)return Wn[t];if(!ti[t]||r?.ignoreCache)ti[t]=Ju(t,"utf8");return ti[t]},Vu=()=>({}),ii=async(t={})=>{let{filepath:r=h_(),configFilepath:n=od()}=t,s=Hr(),o="~/",i=r;if(r.startsWith("~/"))i=$r(s,r.slice(2));let u=n;if(n.startsWith("~/"))u=$r(s,n.slice(2));let a=await Promise.all([Gn(u,{ignoreCache:t.ignoreCache}).then(ri).then(d_).catch(Vu),Gn(i,{ignoreCache:t.ignoreCache}).then(ri).catch(Vu)]);return{configFile:a[0],credentialsFile:a[1]}},m_=(t)=>Object.entries(t).filter(([r])=>r.startsWith(qn.SSO_SESSION+Ct)).reduce((r,[n,s])=>({...r,[n.substring(n.indexOf(Ct)+1)]:s}),{}),y_=()=>({}),S_=async(t={})=>Gn(t.configFilepath??od()).then(ri).then(m_).catch(y_),w_=(...t)=>{let r={};for(let n of t)for(let[s,o]of Object.entries(n))if(r[s]!==void 0)Object.assign(r[s],o);else r[s]=o;return r},E_=async(t)=>{let r=await ii(t);return w_(r.configFile,r.credentialsFile)},b_={getFileRecord(){return Wn},interceptFile(t,r){Wn[t]=Promise.resolve(r)},getTokenRecord(){return jn},interceptToken(t,r){jn[t]=r}};function id(t){try{let r=new Set(Array.from(t.match(/([A-Z_]){3,}/g)??[]));return r.delete("CONFIG"),r.delete("CONFIG_PREFIX_SEPARATOR"),r.delete("ENV"),[...r].join(", ")}catch(r){return t}}var __=(t,r)=>async()=>{try{let n=t(process.env,r);if(n===void 0)throw Error();return n}catch(n){throw new Br(n.message||`Not found in ENV: ${id(t.toString())}`,{logger:r?.logger})}},A_=(t,{preferredFile:r="config",...n}={})=>async()=>{let s=nd(n),{configFile:o,credentialsFile:i}=await ii(n),u=i[s]||{},a=o[s]||{},d=r==="config"?{...u,...a}:{...a,...u};try{let h=t(d,r==="config"?o:i);if(h===void 0)throw Error();return h}catch(l){throw new Br(l.message||`Not found in config files w/ profile [${s}]: ${id(t.toString())}`,{logger:n.logger})}},x_=(t)=>typeof t==="function",ad=(t)=>x_(t)?async()=>await t():ed(t),ni=({environmentVariableSelector:t,configFileSelector:r,default:n},s={})=>{let{signingName:o,logger:i}=s;return oi(Zu(__(t,{signingName:o,logger:i}),A_(r,s),ad(n)))},ai="AWS_USE_DUALSTACK_ENDPOINT",ci="use_dualstack_endpoint",T_=!1,C_={environmentVariableSelector:(t)=>je(t,ai,_e.ENV),configFileSelector:(t)=>je(t,ci,_e.CONFIG),default:!1},I_={environmentVariableSelector:(t)=>je(t,ai,_e.ENV),configFileSelector:(t)=>je(t,ci,_e.CONFIG),default:void 0},ui="AWS_USE_FIPS_ENDPOINT",di="use_fips_endpoint",R_=!1,v_={environmentVariableSelector:(t)=>je(t,ui,_e.ENV),configFileSelector:(t)=>je(t,di,_e.CONFIG),default:!1},N_={environmentVariableSelector:(t)=>je(t,ui,_e.ENV),configFileSelector:(t)=>je(t,di,_e.CONFIG),default:void 0},O_=(t)=>{let{tls:r,endpoint:n,urlParser:s,useDualstackEndpoint:o}=t;return Object.assign(t,{tls:r??!0,endpoint:Vn(typeof n==="string"?s(n):n),isCustomEndpoint:!0,useDualstackEndpoint:Vn(o??!1)})},P_=async(t)=>{let{tls:r=!0}=t,n=await t.region();if(!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(n))throw Error("Invalid region in client config");let o=await t.useDualstackEndpoint(),i=await t.useFipsEndpoint(),{hostname:u}=await t.regionInfoProvider(n,{useDualstackEndpoint:o,useFipsEndpoint:i})??{};if(!u)throw Error("Cannot resolve hostname from client config");return t.urlParser(`${r?"https:":"http:"}//${u}`)},k_=(t)=>{let r=Vn(t.useDualstackEndpoint??!1),{endpoint:n,useFipsEndpoint:s,urlParser:o,tls:i}=t;return Object.assign(t,{tls:i??!0,endpoint:n?Vn(typeof n==="string"?o(n):n):()=>P_({...t,useDualstackEndpoint:r,useFipsEndpoint:s}),isCustomEndpoint:!!n,useDualstackEndpoint:r})},M_="AWS_EXECUTION_ENV",ju="AWS_REGION",Wu="AWS_DEFAULT_REGION",D_="AWS_EC2_METADATA_DISABLED",F_=["in-region","cross-region","mobile","standard","legacy"],L_="/latest/meta-data/placement/region",U_="/latest/api/token",$_="x-aws-ec2-metadata-token",B_="x-aws-ec2-metadata-token-ttl-seconds",Gu=1000,H_=60000,cd=0,ud=async()=>{if(process.env[D_])return;if(Date.now()<cd)return;try{let t=z_(),r=(await Qu({...t,path:U_,method:"PUT",headers:{[B_]:"21600"}})).toString();return(await Qu({...t,path:L_,method:"GET",headers:{[$_]:r}})).toString().trim()||Ku()}catch{return Ku()}},Ku=()=>{cd=Date.now()+H_;return},z_=()=>{let t=process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT;if(t){let r=new URL(t);return{hostname:r.hostname.replace(/^\[(.+)]$/,"$1"),port:r.port?Number(r.port):void 0}}if(process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE==="IPv6")return{hostname:"fd00:ec2::254"};return{hostname:"169.254.169.254"}},Qu=async(t)=>{let{request:r}=c("node:http");return new Promise((n,s)=>{let o=r({hostname:t.hostname,port:t.port,path:t.path,method:t.method,headers:t.headers,timeout:Gu,signal:AbortSignal.timeout(Gu)});o.on("error",(i)=>{s(i),o.destroy()}),o.on("timeout",()=>{s(Error("TimeoutError from instance metadata service")),o.destroy()}),o.on("response",(i)=>{let{statusCode:u=400}=i;if(u<200||u>=300){s(Object.assign(Error("Error response received from instance metadata service"),{statusCode:u})),o.destroy();return}let a=[];i.on("data",(d)=>a.push(d)),i.on("end",()=>{n(Buffer.concat(a)),o.destroy()})}),o.end()})},dd="AWS_REGION",ld="region",fd={environmentVariableSelector:(t)=>t[dd],configFileSelector:(t)=>t[ld],default:async()=>{let t=await ud();if(t)return t;throw Error("Region is missing")}},q_={preferredFile:"credentials"},Xu=new Set,V_=(t,r=i_)=>{if(!Xu.has(t)&&!r(t))if(t==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw Error(`Region not accepted: region="${t}" is not a valid hostname component.`);else Xu.add(t)},hd=(t)=>typeof t==="string"&&(t.startsWith("fips-")||t.endsWith("-fips")),j_=(t)=>hd(t)?["fips-aws-global","aws-fips"].includes(t)?"us-east-1":t.replace(/fips-(dkr-|prod-)?|-fips/,""):t,W_=(t)=>{let{region:r,useFipsEndpoint:n}=t;if(!r)throw Error("Region is missing");return Object.assign(t,{region:async()=>{let s=typeof r==="function"?await r():r,o=j_(s);return V_(o),o},useFipsEndpoint:async()=>{let s=typeof r==="string"?r:await r();if(hd(s))return!0;return typeof n!=="function"?Promise.resolve(!!n):n()}})},Yu=(t=[],{useFipsEndpoint:r,useDualstackEndpoint:n})=>t.find(({tags:s})=>r===s.includes("fips")&&n===s.includes("dualstack"))?.hostname,G_=(t,{regionHostname:r,partitionHostname:n})=>r?r:n?n.replace("{region}",t):void 0,K_=(t,{partitionHash:r})=>Object.keys(r||{}).find((n)=>r[n].regions.includes(t))??"aws",Q_=(t,{signingRegion:r,regionRegex:n,useFipsEndpoint:s})=>{if(r)return r;else if(s){let o=n.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),i=t.match(o);if(i)return i[0].slice(1,-1)}},X_=(t,{useFipsEndpoint:r=!1,useDualstackEndpoint:n=!1,signingService:s,regionHash:o,partitionHash:i})=>{let u=K_(t,{partitionHash:i}),a=t in o?t:i[u]?.endpoint??t,d={useFipsEndpoint:r,useDualstackEndpoint:n},l=Yu(o[a]?.variants,d),h=Yu(i[u]?.variants,d),f=G_(a,{regionHostname:l,partitionHostname:h});if(f===void 0)throw Error(`Endpoint resolution failed for: ${{resolvedRegion:a,useFipsEndpoint:r,useDualstackEndpoint:n}}`);let p=Q_(f,{signingRegion:o[a]?.signingRegion,regionRegex:i[u].regionRegex,useFipsEndpoint:r});return{partition:u,signingService:s,hostname:f,...p&&{signingRegion:p},...o[a]?.signingService&&{signingService:o[a].signingService}}},Y_="AWS_DEFAULTS_MODE",J_="defaults_mode",Z_={environmentVariableSelector:(t)=>t[Y_],configFileSelector:(t)=>t[J_],default:"legacy"},eA=({region:t=ni(fd),defaultsMode:r=ni(Z_)}={})=>oi(async()=>{let n=typeof r==="function"?await r():r;switch(n?.toLowerCase()){case"auto":return tA(t);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(n?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw Error(`Invalid parameter for "defaultsMode", expect ${F_.join(", ")}, got ${n}`)}}),tA=async(t)=>{if(t){let r=typeof t==="function"?await t():t,n=await rA();if(!n)return"standard";if(r===n)return"in-region";else return"cross-region"}return"standard"},rA=async()=>{if(process.env[M_]&&(process.env[ju]||process.env[Wu]))return process.env[ju]??process.env[Wu];return ud()};nA.CONFIG_PREFIX_SEPARATOR=Ct;nA.CONFIG_USE_DUALSTACK_ENDPOINT=ci;nA.CONFIG_USE_FIPS_ENDPOINT=di;nA.CredentialsProviderError=Br;nA.DEFAULT_PROFILE=rd;nA.DEFAULT_USE_DUALSTACK_ENDPOINT=T_;nA.DEFAULT_USE_FIPS_ENDPOINT=R_;nA.ENV_PROFILE=td;nA.ENV_USE_DUALSTACK_ENDPOINT=ai;nA.ENV_USE_FIPS_ENDPOINT=ui;nA.NODE_REGION_CONFIG_FILE_OPTIONS=q_;nA.NODE_REGION_CONFIG_OPTIONS=fd;nA.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS=C_;nA.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS=v_;nA.ProviderError=Yt;nA.REGION_ENV_NAME=dd;nA.REGION_INI_NAME=ld;nA.SelectorType=_e;nA.TokenProviderError=si;nA.booleanSelector=je;nA.chain=Zu;nA.externalDataInterceptor=b_;nA.fromStatic=ad;nA.fromValue=ed;nA.getHomeDir=Hr;nA.getProfileName=nd;nA.getRegionInfo=X_;nA.getSSOTokenFilepath=sd;nA.getSSOTokenFromFile=u_;nA.loadConfig=ni;nA.loadSharedConfigFiles=ii;nA.loadSsoSessionData=S_;nA.memoize=oi;nA.nodeDualstackConfigSelectors=I_;nA.nodeFipsConfigSelectors=N_;nA.numberSelector=a_;nA.parseKnownFiles=E_;nA.readFile=Gn;nA.resolveCustomEndpointsConfig=O_;nA.resolveDefaultsModeConfig=eA;nA.resolveEndpointsConfig=k_;nA.resolveRegionConfig=W_});var Ye=e(function(Fx){var{CONFIG_PREFIX_SEPARATOR:pd,booleanSelector:gd,SelectorType:md,loadConfig:yd}=W(),{toEndpointV1:Kn,getSmithyContext:GA,normalizeProvider:li,isValidHostLabel:Ed,hasOwn:KA}=me();Fx.isValidHostLabel=Ed;Fx.middlewareEndpointToEndpointV1=Kn;Fx.toEndpointV1=Kn;var{EndpointURLScheme:pi}=xt(),Sd="AWS_ENDPOINT_URL",wd="endpoint_url",QA=(t)=>({environmentVariableSelector:(r)=>{let n=t.split(" ").map((i)=>i.toUpperCase()),s=r[[Sd,...n].join("_")];if(s)return s;let o=r[Sd];if(o)return o;return},configFileSelector:(r,n)=>{if(r.services){let o=["services",r.services].join(pd);if(!n||!n[o])throw Error(`The services section "${r.services}" specified in the profile is not present in the shared configuration file.`);let i=n[o],u=t.split(" ").map((d)=>d.toLowerCase()),a=i[[u.join("_"),wd].join(pd)];if(a)return a}let s=r[wd];if(s)return s;return},default:void 0}),YA="AWS_IGNORE_CONFIGURED_ENDPOINT_URLS",JA="ignore_configured_endpoint_urls",ex={environmentVariableSelector:(t)=>gd(t,YA,md.ENV),configFileSelector:(t)=>gd(t,JA,md.CONFIG),default:!1},Qn=async(t)=>{if(await yd(ex)())return;return yd(QA(t??""))()},tx=async(t)=>{let r=t?.Bucket||"";if(typeof t.Bucket==="string")t.Bucket=r.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(ix(r)){if(t.ForcePathStyle===!0)throw Error("Path-style addressing cannot be used with ARN buckets")}else if(!ox(r)||r.indexOf(".")!==-1&&!String(t.Endpoint).startsWith("http:")||r.toLowerCase()!==r||r.length<3)t.ForcePathStyle=!0;if(t.DisableMultiRegionAccessPoints)t.disableMultiRegionAccessPoints=!0,t.DisableMRAP=!0;return t},rx=/^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/,nx=/(\d+\.){3}\d+/,sx=/\.\./,ox=(t)=>rx.test(t)&&!nx.test(t)&&!sx.test(t),ix=(t)=>{let[r,n,s,,,o]=t.split(":"),i=r==="arn"&&t.split(":").length>=6,u=Boolean(i&&n&&s&&o);if(i&&!u)throw Error(`Invalid ARN: ${t} was an invalid ARN.`);return u},ax=(t,r,n,s=!1)=>{let o=async()=>{let i;if(s)i=n.clientContextParams?.[t]??n[t]??n[r];else i=n[t]??n[r];if(typeof i==="function")return i();return i};if(t==="credentialScope"||r==="CredentialScope")return async()=>{let i=typeof n.credentials==="function"?await n.credentials():n.credentials;return i?.credentialScope??i?.CredentialScope};if(t==="accountId"||r==="AccountId")return async()=>{let i=typeof n.credentials==="function"?await n.credentials():n.credentials;return i?.accountId??i?.AccountId};if(t==="endpoint"||r==="endpoint")return async()=>{if(n.isCustomEndpoint===!1)return;let i=await o();if(i&&typeof i==="object"){if("url"in i)return i.url.href;if("hostname"in i){let{protocol:u,hostname:a,port:d,path:l}=i;return`${u}//${a}${d?":"+d:""}${l}`}}return i};return o};function bd(t){return async(r,n,s,o)=>{if(!s.isCustomEndpoint&&!s.ignoreConfiguredEndpointUrls){let a;if(s.serviceConfiguredEndpoint)a=await s.serviceConfiguredEndpoint();else a=await t(s.serviceId);if(a)s.endpoint=()=>Promise.resolve(Kn(a)),s.isCustomEndpoint=!0,o?.logger?.debug?.(`@smithy/core/endpoints - resolved endpoint from config: ${a}`)}let i=await _d(r,n,s);if(typeof s.endpointProvider!=="function")throw Error("config.endpointProvider is not set.");let u=s.endpointProvider(i,o);if(s.isCustomEndpoint&&s.endpoint){let a=await s.endpoint();if(a?.headers){u.headers??={};for(let[d,l]of Object.entries(a.headers))u.headers[d]=Array.isArray(l)?l:[l]}}return u}}var _d=async(t,r,n)=>{let s={},o=r?.getEndpointParameterInstructions?.()||{};for(let[i,u]of Object.entries(o))switch(u.type){case"staticContextParams":s[i]=u.value;break;case"contextParams":s[i]=t[u.name];break;case"clientContextParams":case"builtInParams":s[i]=await ax(u.name,i,n,u.type!=="builtInParams")();break;case"operationContextParams":s[i]=u.get(t);break;default:throw Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(u))}if(Object.keys(o).length===0)Object.assign(s,n);if(String(n.serviceId).toLowerCase()==="s3")await tx(s);return s};function cx(t,r,n){if(!t.__smithy_context)t.__smithy_context={features:{}};else if(!t.__smithy_context.features)t.__smithy_context.features={};t.__smithy_context.features[r]=n}function Ad(t){let r=bd(t);return({config:n,instructions:s})=>(o,i)=>async(u)=>{if(n.isCustomEndpoint)cx(i,"ENDPOINT_OVERRIDE","N");let a=await r(u.input,{getEndpointParameterInstructions(){return s}},{...n},i);i.endpointV2=a,i.authSchemes=a.properties?.authSchemes;let d=i.authSchemes?.[0];if(d){i.signing_region=d.signingRegion,i.signing_service=d.signingName;let h=GA(i)?.selectedHttpAuthScheme?.httpAuthOption;if(h)h.signingProperties=Object.assign(h.signingProperties||{},{signing_region:d.signingRegion,signingRegion:d.signingRegion,signing_service:d.signingName,signingName:d.signingName,signingRegionSet:d.signingRegionSet},d.properties)}return o({...u})}}var ux={name:"serializerMiddleware"},xd={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:ux.name};function dx(t){let r=Ad(t);return(n,s)=>({applyToStack:(o)=>{o.addRelativeTo(r({config:n,instructions:s}),xd)}})}function lx(t){return(r)=>{let n=r.tls??!0,{endpoint:s,useDualstackEndpoint:o,useFipsEndpoint:i}=r,u=s!=null?async()=>Kn(await li(s)()):void 0,d=Object.assign(r,{endpoint:u,tls:n,isCustomEndpoint:!!s,useDualstackEndpoint:li(o??!1),useFipsEndpoint:li(i??!1),ignoreConfiguredEndpointUrls:!!r.ignoreConfiguredEndpointUrls}),l=void 0;return d.serviceConfiguredEndpoint=async()=>{if(r.serviceId&&!l)l=t(r.serviceId);return l},d}}class gi{nodes;root;conditions;results;constructor(t,r,n,s){this.nodes=t,this.root=r,this.conditions=n,this.results=s}static from(t,r,n,s){return new gi(t,r,n,s)}}class Td{capacity;data=new Map;parameters=[];constructor({size:t,params:r}){if(this.capacity=t??50,r)this.parameters=r}get(t,r){let n=this.hash(t);if(n===!1)return r();if(!this.data.has(n)){if(this.data.size>this.capacity+10){let s=this.data.keys(),o=0;while(!0){let{value:i,done:u}=s.next();if(this.data.delete(i),u||++o>10)break}}this.data.set(n,r())}return this.data.get(n)}size(){return this.data.size}hash(t){let r="",{parameters:n}=this;if(n.length===0)return!1;for(let s of n){let o=String(t[s]??"");if(o.includes("|;"))return!1;r+=o+"|;"}return r}}class J extends Error{constructor(t){super(t);this.name="EndpointError"}}var zr="endpoints";function rt(t){if(typeof t!=="object"||t==null)return t;if("ref"in t)return`$${rt(t.ref)}`;if("fn"in t)return`${t.fn}(${(t.argv||[]).map(rt).join(", ")})`;return JSON.stringify(t,null,2)}var Cd={},fx=(t,r)=>t===r;function hx(...t){for(let r of t)if(r!=null)return r;return}var px=(t)=>{let r=t.split("."),n=[];for(let s of r){let o=s.indexOf("[");if(o!==-1){if(s.indexOf("]")!==s.length-1)throw new J(`Path: '${t}' does not end with ']'`);let i=s.slice(o+1,-1);if(Number.isNaN(parseInt(i)))throw new J(`Invalid array index: '${i}' in path: '${t}'`);if(o!==0)n.push(s.slice(0,o));n.push(i)}else n.push(s)}return n},Id=(t,r)=>px(r).reduce((n,s)=>{if(typeof n!=="object")throw new J(`Index '${s}' in '${r}' not found in '${JSON.stringify(t)}'`);else if(Array.isArray(n)){let o=parseInt(s);return n[o<0?n.length+o:o]}return n[s]},t),gx=(t)=>t!=null;function mx(t,r,n){return t?r:n}var yx=(t)=>!t,Sx=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),Rd=(t)=>Sx.test(t)||t.startsWith("[")&&t.endsWith("]"),fi={[pi.HTTP]:80,[pi.HTTPS]:443},wx=(t)=>{let r=(()=>{try{if(t instanceof URL)return t;if(typeof t==="object"&&"hostname"in t){let{hostname:p,port:g,protocol:m="",path:y="",query:S={}}=t,w=new URL(`${m}//${p}${g?`:${g}`:""}${y}`);return w.search=Object.entries(S).map(([E,A])=>`${E}=${A}`).join("&"),w}return new URL(t)}catch(p){return null}})();if(!r)return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`),null;let n=r.href,{host:s,hostname:o,pathname:i,protocol:u,search:a}=r;if(a)return null;let d=u.slice(0,-1);if(!Object.values(pi).includes(d))return null;let l=Rd(o),h=n.includes(`${s}:${fi[d]}`)||typeof t==="string"&&t.includes(`${s}:${fi[d]}`),f=`${s}${h?`:${fi[d]}`:""}`;return{scheme:d,authority:f,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:l}};function Ex(t,r,n){if(n===1)return[t];if(t==="")return[""];let s=t.split(r);if(n===0)return s;return s.slice(0,n-1).concat(s.slice(1).join(r))}var bx=(t,r)=>t===r,_x=(t,r,n,s)=>{if(t==null||r>=n||t.length<n||/[^\u0000-\u007f]/.test(t))return null;if(!s)return t.substring(r,n);return t.substring(t.length-n,t.length-r)},Ax=(t)=>encodeURIComponent(t).replace(/[!*'()]/g,(r)=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),xx={booleanEquals:fx,coalesce:hx,getAttr:Id,isSet:gx,isValidHostLabel:Ed,ite:mx,not:yx,parseURL:wx,split:Ex,stringEquals:bx,substring:_x,uriEncode:Ax},vd=(t,r)=>{let n=[],{referenceRecord:s,endpointParams:o}=r,i=0;while(i<t.length){let u=t.indexOf("{",i);if(u===-1){n.push(t.slice(i));break}n.push(t.slice(i,u));let a=t.indexOf("}",u);if(a===-1){n.push(t.slice(u));break}if(t[u+1]==="{"&&t[a+1]==="}")n.push(t.slice(u+1,a)),i=a+2;let d=t.substring(u+1,a);if(d.includes("#")){let[l,h]=d.split("#");n.push(Id(s[l]??o[l],h))}else n.push(s[d]??o[d]);i=a+1}return n.join("")},Tx=({ref:t},r)=>r.referenceRecord[t]??r.endpointParams[t],qr=(t,r,n)=>{if(typeof t==="string")return vd(t,n);else if(t.fn)return Od.callFunction(t,n);else if(t.ref)return Tx(t,n);throw new J(`'${r}': ${String(t)} is not a string, function or reference.`)},Nd=({fn:t,argv:r},n)=>{let s=Array(r.length);for(let u=0;u<s.length;++u){let a=r[u];if(typeof a==="boolean"||typeof a==="number")s[u]=a;else s[u]=Od.evaluateExpression(a,"arg",n)}let o=t.indexOf(".");if(o!==-1){let a=Cd[t.slice(0,o)]?.[t.slice(o+1)];if(typeof a==="function")return a(...s)}let i=xx[t];if(typeof i==="function")return i(...s);throw Error(`function ${t} not loaded in endpointFunctions.`)},Od={evaluateExpression:qr,callFunction:Nd},Pd=(t,r)=>{let{assign:n}=t;if(n&&n in r.referenceRecord)throw new J(`'${n}' is already defined in Reference Record.`);let s=Nd(t,r);r.logger?.debug?.(`${zr} evaluateCondition: ${rt(t)} = ${rt(s)}`);let o=s===""?!0:!!s;if(n!=null)return{result:o,toAssign:{name:n,value:s}};return{result:o}},kd=(t,r)=>Object.entries(t??{}).reduce((n,[s,o])=>(n[s]=o.map((i)=>{let u=qr(i,"Header value entry",r);if(typeof u!=="string")throw new J(`Header '${s}' value '${u}' is not a string`);return u}),n),{}),mi=(t,r)=>Object.entries(t).reduce((n,[s,o])=>(n[s]=Dd.getEndpointProperty(o,r),n),{}),Md=(t,r)=>{if(Array.isArray(t))return t.map((n)=>Md(n,r));switch(typeof t){case"string":return vd(t,r);case"object":if(t===null)throw new J(`Unexpected endpoint property: ${t}`);return Dd.getEndpointProperties(t,r);case"boolean":return t;default:throw new J(`Unexpected endpoint property type: ${typeof t}`)}},Dd={getEndpointProperty:Md,getEndpointProperties:mi},Fd=(t,r)=>{let n=qr(t,"Endpoint URL",r);if(typeof n==="string")try{return new URL(n)}catch(s){throw console.error(`Failed to construct URL with ${n}`,s),s}throw new J(`Endpoint URL must be a string, got ${typeof n}`)},hi=1e8,Cx=(t,r)=>{let{nodes:n,root:s,results:o,conditions:i}=t,u=s,a={},d={referenceRecord:a,endpointParams:r.endpointParams,logger:r.logger};while(u!==1&&u!==-1&&u<hi){let l=3*(Math.abs(u)-1),[h,f,p]=[n[l],n[l+1],n[l+2]],[g,m,y]=i[h],S=Pd({fn:g,assign:y,argv:m},d);if(S.toAssign){let{name:w,value:E}=S.toAssign;a[w]=E}u=u>=0===S.result?f:p}if(u>=hi){let l=o[u-hi];if(l[0]===-1){let[,g]=l;throw new J(qr(g,"Error",d))}let[h,f,p]=l;return{url:Fd(h,d),properties:mi(f,d),headers:kd(p??{},d)}}throw new J("No matching endpoint.")},yi=(t=[],r)=>{let n={},s={...r,referenceRecord:{...r.referenceRecord}},o=!1;for(let i of t){let{result:u,toAssign:a}=Pd(i,s);if(!u)return{result:u};if(a)o=!0,n[a.name]=a.value,s.referenceRecord[a.name]=a.value,r.logger?.debug?.(`${zr} assign: ${a.name} := ${rt(a.value)}`)}if(o)return{result:!0,referenceRecord:n};return{result:!0}},Ix=(t,r)=>{let{conditions:n,endpoint:s}=t,{result:o,referenceRecord:i}=yi(n,r);if(!o)return;let u=i?{...r,referenceRecord:{...r.referenceRecord,...i}}:r,{url:a,properties:d,headers:l}=s;r.logger?.debug?.(`${zr} Resolving endpoint from template: ${rt(s)}`);let h={url:Fd(a,u)};if(l!=null)h.headers=kd(l,u);if(d!=null)h.properties=mi(d,u);return h},Rx=(t,r)=>{let{conditions:n,error:s}=t,{result:o,referenceRecord:i}=yi(n,r);if(!o)return;let u=i?{...r,referenceRecord:{...r.referenceRecord,...i}}:r;throw new J(qr(s,"Error",u))},Ld=(t,r)=>{for(let n of t)if(n.type==="endpoint"){let s=Ix(n,r);if(s)return s}else if(n.type==="error")Rx(n,r);else if(n.type==="tree"){let s=Ud.evaluateTreeRule(n,r);if(s)return s}else throw new J(`Unknown endpoint rule: ${n}`);throw new J("Rules evaluation failed")},vx=(t,r)=>{let{conditions:n,rules:s}=t,{result:o,referenceRecord:i}=yi(n,r);if(!o)return;let u=i?{...r,referenceRecord:{...r.referenceRecord,...i}}:r;return Ud.evaluateRules(s,u)},Ud={evaluateRules:Ld,evaluateTreeRule:vx},Nx=(t,r)=>{let{endpointParams:n,logger:s}=r,{parameters:o,rules:i}=t;r.logger?.debug?.(`${zr} Initial EndpointParams: ${rt(n)}`);for(let a in o){if(!KA(o,a))continue;let d=o[a],l=n[a];if(l==null&&d.default!=null){n[a]=d.default;continue}if(d.required&&l==null)throw new J(`Missing required parameter: '${a}'`)}let u=Ld(i,{endpointParams:n,logger:s,referenceRecord:{}});return r.logger?.debug?.(`${zr} Resolved endpoint: ${rt(u)}`),u},Ox=(t)=>{let{endpoint:r}=t;if(r===void 0)t.endpoint=async()=>{throw Error("@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint.")};return t},Px=bd(Qn),kx=lx(Qn),Mx=Ad(Qn),Dx=dx(Qn);Fx.BinaryDecisionDiagram=gi;Fx.EndpointCache=Td;Fx.EndpointError=J;Fx.customEndpointFunctions=Cd;Fx.decideEndpoint=Cx;Fx.endpointMiddleware=Mx;Fx.endpointMiddlewareOptions=xd;Fx.getEndpointFromInstructions=Px;Fx.getEndpointPlugin=Dx;Fx.isIpAddress=Rd;Fx.resolveEndpoint=Nx;Fx.resolveEndpointConfig=kx;Fx.resolveEndpointRequiredConfig=Ox;Fx.resolveParams=_d});var ee=e(function(RT){var{createHmac:e0,createHash:t0,getRandomValues:r0}=c("node:crypto"),{hasOwn:Wd,HttpResponse:n0}=me();RT.hasOwn=Wd;var{ReadStream:s0,lstatSync:o0,fstatSync:i0}=c("node:fs"),{toEndpointV1:a0}=Ye(),{Readable:Jt,Writable:Gd,PassThrough:$d}=c("node:stream"),Kd=(t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",er=(t,r=0,n=t.byteLength-r)=>{if(!Kd(t))throw TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return Buffer.from(t,r,n)},Zn=(t,r)=>{if(typeof t!=="string")throw TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return r?Buffer.from(t,r):Buffer.from(t)},c0=/^[A-Za-z0-9+/]*={0,2}$/,Qd=(t)=>{if(t.length*3%4!==0)throw TypeError("Incorrect padding on base64 string.");if(!c0.exec(t))throw TypeError("Invalid base64 string.");let r=Zn(t,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)},es=(t)=>{let r=Zn(t,"utf8");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT)},Ti=(t)=>{let r;if(typeof t==="string")r=es(t);else r=t;if(typeof r!=="object"||typeof r.byteOffset!=="number"||typeof r.byteLength!=="number")throw Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return er(r.buffer,r.byteOffset,r.byteLength).toString("base64")};function u0(t,r,n,s){return class o extends Uint8Array{static fromString(i,u="utf-8"){if(typeof i==="string"){if(u==="base64")return o.mutate(s(i));return o.mutate(r(i))}throw Error(`Unsupported conversion from ${typeof i} to Uint8ArrayBlobAdapter.`)}static mutate(i){return Object.setPrototypeOf(i,o.prototype),i}transformToString(i="utf-8"){if(i==="base64")return n(this);return t(this)}}}var Xd=(t)=>{if(typeof t==="string")return t;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return er(t.buffer,t.byteOffset,t.byteLength).toString("utf8")},ie=Array.from({length:256},(t,r)=>r.toString(16).padStart(2,"0"));function d0(t){if(typeof crypto<"u"&&typeof crypto.randomUUID==="function")return()=>crypto.randomUUID();return()=>{let r=new Uint8Array(16);return t(r),r[6]=r[6]&15|64,r[8]=r[8]&63|128,ie[r[0]]+ie[r[1]]+ie[r[2]]+ie[r[3]]+"-"+ie[r[4]]+ie[r[5]]+"-"+ie[r[6]]+ie[r[7]]+"-"+ie[r[8]]+ie[r[9]]+"-"+ie[r[10]]+ie[r[11]]+ie[r[12]]+ie[r[13]]+ie[r[14]]+ie[r[15]]}}var l0=(t,r,n=(s)=>s)=>t,f0=(t)=>{switch(t){case"true":return!0;case"false":return!1;default:throw Error(`Unable to parse boolean value "${t}"`)}},h0=(t)=>{if(t===null||t===void 0)return;if(typeof t==="number"){if(t===0||t===1)Gr.warn(Yn(`Expected boolean, got ${typeof t}: ${t}`));if(t===0)return!1;if(t===1)return!0}if(typeof t==="string"){let r=t.toLowerCase();if(r==="false"||r==="true")Gr.warn(Yn(`Expected boolean, got ${typeof t}: ${t}`));if(r==="false")return!1;if(r==="true")return!0}if(typeof t==="boolean")return t;throw TypeError(`Expected boolean, got ${typeof t}: ${t}`)},jr=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string"){let r=parseFloat(t);if(!Number.isNaN(r)){if(String(r)!==String(t))Gr.warn(Yn(`Expected number but observed string: ${t}`));return r}}if(typeof t==="number")return t;throw TypeError(`Expected number, got ${typeof t}: ${t}`)},p0=Math.ceil(340282346638528860000000000000000000000),Xn=(t)=>{let r=jr(t);if(r!==void 0&&!Number.isNaN(r)&&r!==1/0&&r!==-1/0){if(Math.abs(r)>p0)throw TypeError(`Expected 32-bit float, got ${t}`)}return r},Wr=(t)=>{if(t===null||t===void 0)return;if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw TypeError(`Expected integer, got ${typeof t}: ${t}`)},g0=Wr,bi=(t)=>Ci(t,32),_i=(t)=>Ci(t,16),Ai=(t)=>Ci(t,8),Ci=(t,r)=>{let n=Wr(t);if(n!==void 0&&m0(n,r)!==n)throw TypeError(`Expected ${r}-bit integer, got ${t}`);return n},m0=(t,r)=>{switch(r){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},y0=(t,r)=>{if(t===null||t===void 0){if(r)throw TypeError(`Expected a non-null value for ${r}`);throw TypeError("Expected a non-null value")}return t},Yd=(t)=>{if(t===null||t===void 0)return;if(typeof t==="object"&&!Array.isArray(t))return t;let r=Array.isArray(t)?"array":typeof t;throw TypeError(`Expected object, got ${r}: ${t}`)},S0=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string")return t;if(["boolean","number","bigint"].includes(typeof t))return Gr.warn(Yn(`Expected string, got ${typeof t}: ${t}`)),String(t);throw TypeError(`Expected string, got ${typeof t}: ${t}`)},w0=(t)=>{if(t===null||t===void 0)return;let r=Yd(t),n=[];for(let s in r){if(!Wd(r,s))continue;if(r[s]!=null)n.push(s)}if(n.length===0)throw TypeError("Unions must have exactly one non-null member. None were found.");if(n.length>1)throw TypeError(`Unions must have exactly one non-null member. Keys ${n} were not null.`);return r},Ii=(t)=>{if(typeof t=="string")return jr(nr(t));return jr(t)},E0=Ii,Jd=(t)=>{if(typeof t=="string")return Xn(nr(t));return Xn(t)},b0=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,nr=(t)=>{let r=t.match(b0);if(r===null||r[0].length!==t.length)throw TypeError("Expected real number, got implicit NaN");return parseFloat(t)},Ri=(t)=>{if(typeof t=="string")return Zd(t);return jr(t)},_0=Ri,A0=Ri,x0=(t)=>{if(typeof t=="string")return Zd(t);return Xn(t)},Zd=(t)=>{switch(t){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw Error(`Unable to parse float value: ${t}`)}},el=(t)=>{if(typeof t==="string")return Wr(nr(t));return Wr(t)},T0=el,C0=(t)=>{if(typeof t==="string")return bi(nr(t));return bi(t)},tr=(t)=>{if(typeof t==="string")return _i(nr(t));return _i(t)},tl=(t)=>{if(typeof t==="string")return Ai(nr(t));return Ai(t)},Yn=(t)=>String(TypeError(t).stack||t).split(`
4
+ `).slice(0,5).filter((r)=>!r.includes("stackTraceWarning")).join(`
5
+ `),Gr={warn:console.warn},I0=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],vi=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R0(t){let r=t.getUTCFullYear(),n=t.getUTCMonth(),s=t.getUTCDay(),o=t.getUTCDate(),i=t.getUTCHours(),u=t.getUTCMinutes(),a=t.getUTCSeconds(),d=o<10?`0${o}`:`${o}`,l=i<10?`0${i}`:`${i}`,h=u<10?`0${u}`:`${u}`,f=a<10?`0${a}`:`${a}`;return`${I0[s]}, ${d} ${vi[n]} ${r} ${l}:${h}:${f} GMT`}var v0=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),N0=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw TypeError("RFC-3339 date-times must be expressed as strings");let r=v0.exec(t);if(!r)throw TypeError("Invalid RFC-3339 date-time value");let[n,s,o,i,u,a,d,l]=r,h=tr(rr(s)),f=De(o,"month",1,12),p=De(i,"day",1,31);return Vr(h,f,p,{hours:u,minutes:a,seconds:d,fractionalMilliseconds:l})},O0=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}:\d{2})|[zZ])$/),P0=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw TypeError("RFC-3339 date-times must be expressed as strings");let r=O0.exec(t);if(!r)throw TypeError("Invalid RFC-3339 date-time value");let[n,s,o,i,u,a,d,l,h]=r,f=tr(rr(s)),p=De(o,"month",1,12),g=De(i,"day",1,31),m=Vr(f,p,g,{hours:u,minutes:a,seconds:d,fractionalMilliseconds:l});if(h.toUpperCase()!="Z")m.setTime(m.getTime()-j0(h));return m},k0=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$/),M0=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$/),D0=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})$/),F0=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw TypeError("RFC-7231 date-times must be expressed as strings");let r=k0.exec(t);if(r){let[n,s,o,i,u,a,d,l]=r;return Vr(tr(rr(i)),Si(o),De(s,"day",1,31),{hours:u,minutes:a,seconds:d,fractionalMilliseconds:l})}if(r=M0.exec(t),r){let[n,s,o,i,u,a,d,l]=r;return B0(Vr(U0(i),Si(o),De(s,"day",1,31),{hours:u,minutes:a,seconds:d,fractionalMilliseconds:l}))}if(r=D0.exec(t),r){let[n,s,o,i,u,a,d,l]=r;return Vr(tr(rr(l)),Si(s),De(o.trimLeft(),"day",1,31),{hours:i,minutes:u,seconds:a,fractionalMilliseconds:d})}throw TypeError("Invalid RFC-7231 date-time value")},L0=(t)=>{if(t===null||t===void 0)return;let r;if(typeof t==="number")r=t;else if(typeof t==="string")r=Ii(t);else if(typeof t==="object"&&t.tag===1)r=t.value;else throw TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(r)||r===1/0||r===-1/0)throw TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(r*1000))},Vr=(t,r,n,s)=>{let o=r-1;return z0(t,o,n),new Date(Date.UTC(t,o,n,De(s.hours,"hour",0,23),De(s.minutes,"minute",0,59),De(s.seconds,"seconds",0,60),V0(s.fractionalMilliseconds)))},U0=(t)=>{let r=new Date().getUTCFullYear(),n=Math.floor(r/100)*100+tr(rr(t));if(n<r)return n+100;return n},$0=1576800000000,B0=(t)=>{if(t.getTime()-new Date().getTime()>$0)return new Date(Date.UTC(t.getUTCFullYear()-100,t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()));return t},Si=(t)=>{let r=vi.indexOf(t);if(r<0)throw TypeError(`Invalid month: ${t}`);return r+1},H0=[31,28,31,30,31,30,31,31,30,31,30,31],z0=(t,r,n)=>{let s=H0[r];if(r===1&&q0(t))s=29;if(n>s)throw TypeError(`Invalid day for ${vi[r]} in ${t}: ${n}`)},q0=(t)=>t%4===0&&(t%100!==0||t%400===0),De=(t,r,n,s)=>{let o=tl(rr(t));if(o<n||o>s)throw TypeError(`${r} must be between ${n} and ${s}, inclusive`);return o},V0=(t)=>{if(t===null||t===void 0)return 0;return Jd("0."+t)*1000},j0=(t)=>{let r=t[0],n=1;if(r=="+")n=1;else if(r=="-")n=-1;else throw TypeError(`Offset direction, ${r}, must be "+" or "-"`);let s=Number(t.substring(1,3)),o=Number(t.substring(4,6));return n*(s*60+o)*60*1000},rr=(t)=>{let r=0;while(r<t.length-1&&t.charAt(r)==="0")r++;if(r===0)return t;return t.slice(r)},Rt=function(r){return Object.assign(new String(r),{deserializeJSON(){return JSON.parse(String(r))},toString(){return String(r)},toJSON(){return String(r)}})};Rt.from=(t)=>{if(t&&typeof t==="object"&&(t instanceof Rt||("deserializeJSON"in t)))return t;else if(typeof t==="string"||Object.getPrototypeOf(t)===String.prototype)return Rt(String(t));return Rt(JSON.stringify(t))};Rt.fromObject=Rt.from;function W0(t){if(t.includes(",")||t.includes('"'))t=`"${t.replace(/"/g,"\\\"")}"`;return t}var Ni="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",Oi="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",Pi="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",rl="(\\d?\\d)",nl="(\\d{4})",G0=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),K0=new RegExp(`^${Ni}, ${rl} ${Oi} ${nl} ${Pi} GMT$`),Q0=new RegExp(`^${Ni}, ${rl}-${Oi}-(\\d\\d) ${Pi} GMT$`),X0=new RegExp(`^${Ni} ${Oi} ( [1-9]|\\d\\d) ${Pi} ${nl}$`),Y0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],J0=(t)=>{if(t==null)return;let r=NaN;if(typeof t==="number")r=t;else if(typeof t==="string"){if(!/^-?\d*\.?\d+$/.test(t))throw TypeError("parseEpochTimestamp - numeric string invalid.");r=Number.parseFloat(t)}else if(typeof t==="object"&&t.tag===1)r=t.value;if(isNaN(r)||Math.abs(r)===1/0)throw TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(r*1000))},Z0=(t)=>{if(t==null)return;if(typeof t!=="string")throw TypeError("RFC3339 timestamps must be strings");let r=G0.exec(t);if(!r)throw TypeError(`Invalid RFC3339 timestamp format ${t}`);let[,n,s,o,i,u,a,,d,l]=r;We(s,1,12),We(o,1,31),We(i,0,23),We(u,0,59),We(a,0,60);let h=new Date(Date.UTC(Number(n),Number(s)-1,Number(o),Number(i),Number(u),Number(a),Number(d)?Math.round(parseFloat(`0.${d}`)*1000):0));if(h.setUTCFullYear(Number(n)),l.toUpperCase()!="Z"){let[,f,p,g]=/([+-])(\d\d):(\d\d)/.exec(l)||[void 0,"+",0,0],m=f==="-"?1:-1;h.setTime(h.getTime()+m*(Number(p)*60*60*1000+Number(g)*60*1000))}return h},eT=(t)=>{if(t==null)return;if(typeof t!=="string")throw TypeError("RFC7231 timestamps must be strings.");let r,n,s,o,i,u,a,d;if(d=K0.exec(t))[,r,n,s,o,i,u,a]=d;else if(d=Q0.exec(t))[,r,n,s,o,i,u,a]=d,s=(Number(s)+1900).toString();else if(d=X0.exec(t))[,n,r,o,i,u,a,s]=d;if(s&&u){let l=Date.UTC(Number(s),Y0.indexOf(n),Number(r),Number(o),Number(i),Number(u),a?Math.round(parseFloat(`0.${a}`)*1000):0);We(r,1,31),We(o,0,23),We(i,0,59),We(u,0,60);let h=new Date(l);return h.setUTCFullYear(Number(s)),h}throw TypeError(`Invalid RFC7231 date-time value ${t}.`)};function We(t,r,n){let s=Number(t);if(s<r||s>n)throw Error(`Value ${s} out of range [${r}, ${n}]`)}function tT(t,r,n){if(n<=0||!Number.isInteger(n))throw Error("Invalid number of delimiters ("+n+") for splitEvery.");let s=t.split(r);if(n===1)return s;let o=[],i="";for(let u=0;u<s.length;u++){if(i==="")i=s[u];else i+=r+s[u];if((u+1)%n===0)o.push(i),i=""}if(i!=="")o.push(i);return o}var rT=(t)=>{let r=t.length,n=[],s=!1,o=void 0,i=0;for(let u=0;u<r;++u){let a=t[u];switch(a){case'"':if(o!=="\\")s=!s;break;case",":if(!s)n.push(t.slice(i,u)),i=u+1;break}o=a}return n.push(t.slice(i)),n.map((u)=>{u=u.trim();let a=u.length;if(a<2)return u;if(u[0]==='"'&&u[a-1]==='"')u=u.slice(1,a-1);return u.replace(/\\"/g,'"')})},Bd=/^-?((0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?$/;class ts{string;type;constructor(t,r){if(this.string=t,this.type=r,!Bd.test(t))throw Error(`@smithy/core/serde - NumericValue string must conform to the Smithy bigDecimal format. Received: "${t}"`)}toString(){return this.string}static[Symbol.hasInstance](t){if(!t||typeof t!=="object")return!1;let r=t;return ts.prototype.isPrototypeOf(t)||r.type==="bigDecimal"&&Bd.test(r.string)}}function nT(t){return new ts(String(t),"bigDecimal")}var sl={},xi={};for(let t=0;t<256;t++){let r=t.toString(16).toLowerCase();if(r.length===1)r=`0${r}`;sl[t]=r,xi[r]=t}function sT(t){if(t.length%2!==0)throw Error("Hex encoded strings must have an even number length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2){let s=t.slice(n,n+2).toLowerCase();if(s in xi)r[n/2]=xi[s];else throw Error(`Cannot decode unrecognized sequence ${s} as hexadecimal`)}return r}function ol(t){let r="";for(let n=0;n<t.byteLength;n++)r+=sl[t[n]];return r}var oT=(t)=>{if(!t)return 0;if(typeof t==="string")return Buffer.byteLength(t);else if(typeof t.byteLength==="number")return t.byteLength;else if(typeof t.size==="number")return t.size;else if(typeof t.start==="number"&&typeof t.end==="number")return t.end+1-t.start;else if(t instanceof s0){if(t.path!=null)return o0(t.path).size;else if(typeof t.fd==="number")return i0(t.fd).size}throw Error(`Body Length computation failed for ${t}`)},il=(t)=>{if(t instanceof Uint8Array)return t;if(typeof t==="string")return es(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)};function rs(t,r){if(r===void 0){r=0;for(let o of t)r+=o.byteLength}let n=new Uint8Array(r),s=0;for(let o of t)n.set(o,s),s+=o.byteLength;return n}var al=(t,r)=>(n,s)=>async(o)=>{let{response:i}=await n(o);try{let u=await r(i,t);return{response:i,output:u}}catch(u){if(Object.defineProperty(u,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in u)){try{u.message+=`
6
+ Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`}catch(d){if(!s.logger||s.logger?.constructor?.name==="NoOpLogger")console.warn("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.");else s.logger?.warn?.("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.")}if(typeof u.$responseBodyText<"u"){if(u.$response)u.$response.body=u.$responseBodyText}try{if(n0.isInstance(i)){let{headers:d={}}=i,l=Object.entries(d);u.$metadata={httpStatusCode:i.statusCode,requestId:wi(/^x-[\w-]+-request-?id$/,l),extendedRequestId:wi(/^x-[\w-]+-id-2$/,l),cfId:wi(/^x-[\w-]+-cf-id$/,l)}}}catch(d){}}throw u}},wi=(t,r)=>(r.find(([n])=>n.match(t))||[void 0,void 0])[1],cl=(t,r)=>(n,s)=>async(o)=>{let i=t,u=s.endpointV2?async()=>a0(s.endpointV2):i.endpoint;if(!u)throw Error("No valid endpoint provider available.");let a=await r(o.input,{...t,endpoint:u});return n({...o,request:a})},ul={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},dl={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function iT(t,r,n){return{applyToStack:(s)=>{s.add(al(t,n),ul),s.add(cl(t,r),dl)}}}class ll{algorithmIdentifier;secret;hash;constructor(t,r){this.algorithmIdentifier=t,this.secret=r,this.reset()}update(t,r){this.hash.update(il(Hd(t,r)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?e0(this.algorithmIdentifier,Hd(this.secret)):t0(this.algorithmIdentifier)}}function Hd(t,r){if(Buffer.isBuffer(t))return t;if(typeof t==="string")return Zn(t,r);if(ArrayBuffer.isView(t))return er(t.buffer,t.byteOffset,t.byteLength);return er(t)}var fl=class extends Jt{expectedChecksum;checksumSourceLocation;checksum;source;base64Encoder;constructor({expectedChecksum:r,checksum:n,source:s,checksumSourceLocation:o,base64Encoder:i}){super();if(typeof s.pipe!=="function")throw Error(`@smithy/util-stream: unsupported source type ${s?.constructor?.name??s} in ChecksumStream.`);this.source=s,this.base64Encoder=i??Ti,this.expectedChecksum=r,this.checksum=n,this.checksumSourceLocation=o,this.source.on("data",this.onSourceData),this.source.on("end",this.onSourceEnd),this.source.on("error",this.onSourceError),this.source.on("close",this.onSourceClose),this.source.pause()}onSourceData=(r)=>{if(this.destroyed)return;try{this.checksum.update(r)}catch(n){this.destroy(n);return}if(!this.push(r))this.source.pause()};onSourceEnd=async()=>{if(this.destroyed)return;try{let r=await this.checksum.digest(),n=this.base64Encoder(r);if(this.expectedChecksum!==n){this.destroy(Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${n}" in response header "${this.checksumSourceLocation}".`));return}}catch(r){this.destroy(r);return}this.push(null)};onSourceError=(r)=>{this.destroy(r)};onSourceClose=()=>{if(!this.destroyed&&!this.source.readableEnded)this.destroy(Error("Connection lost or stream closed before all data was received."))};_read(r){this.source.resume()}_destroy(r,n){this.source?.removeListener("data",this.onSourceData),this.source?.removeListener("end",this.onSourceEnd),this.source?.removeListener("error",this.onSourceError),this.source?.removeListener("close",this.onSourceClose),this.source?.destroy(),n(r)}},Fe=(t)=>typeof ReadableStream==="function"&&(t?.constructor?.name===ReadableStream.name||t instanceof ReadableStream),ns=(t)=>typeof Blob==="function"&&(t?.constructor?.name===Blob.name||t instanceof Blob),aT=(t)=>new TextEncoder().encode(t),hl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";Object.entries(hl).reduce((t,[r,n])=>(t[n]=Number(r),t),{});var cT=hl.split(""),Ei=6,zd=8,uT=63;function pl(t){let r;if(typeof t==="string")r=aT(t);else r=t;let n=typeof r==="object"&&typeof r.length==="number",s=typeof r==="object"&&typeof r.byteOffset==="number"&&typeof r.byteLength==="number";if(!n&&!s)throw Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let o="";for(let i=0;i<r.length;i+=3){let u=0,a=0;for(let l=i,h=Math.min(i+3,r.length);l<h;l++)u|=r[l]<<(h-l-1)*zd,a+=zd;let d=Math.ceil(a/Ei);u<<=d*Ei-a;for(let l=1;l<=d;l++){let h=(d-l)*Ei;o+=cT[(u&uT<<h)>>h]}o+="==".slice(0,4-d)}return o}var dT=typeof ReadableStream==="function"?ReadableStream:function(){};class gl extends dT{}var lT=({expectedChecksum:t,checksum:r,source:n,checksumSourceLocation:s,base64Encoder:o})=>{if(!Fe(n))throw Error(`@smithy/util-stream: unsupported source type ${n?.constructor?.name??n} in ChecksumStream.`);let i=o??pl;if(typeof TransformStream!=="function")throw Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let u=new TransformStream({start(){},async transform(d,l){r.update(d),l.enqueue(d)},async flush(d){let l=await r.digest(),h=i(l);if(t!==h){let f=Error(`Checksum mismatch: expected "${t}" but received "${h}" in response header "${s}".`);d.error(f)}else d.terminate()}});n.pipeThrough(u);let a=u.readable;return Object.setPrototypeOf(a,gl.prototype),a};function fT(t){if(typeof ReadableStream==="function"&&Fe(t.source))return lT(t);return new fl(t)}class Jn{allocByteArray;byteLength=0;byteArrays=[];constructor(t){this.allocByteArray=t}push(t){this.byteArrays.push(t),this.byteLength+=t.byteLength}flush(){if(this.byteArrays.length===1){let n=this.byteArrays[0];return this.reset(),n}let t=this.allocByteArray(this.byteLength),r=0;for(let n=0;n<this.byteArrays.length;++n){let s=this.byteArrays[n];t.set(s,r),r+=s.byteLength}return this.reset(),t}reset(){this.byteArrays=[],this.byteLength=0}}function hT(t,r,n){let s=t.getReader(),o=!1,i=0,u=["",new Jn((l)=>new Uint8Array(l))],a=-1,d=async(l)=>{let{value:h,done:f}=await s.read(),p=h;if(f){if(a!==-1){let g=Zt(u,a);if(nt(g)>0)l.enqueue(g)}l.close()}else{let g=yl(p,!1);if(a!==g){if(a>=0)l.enqueue(Zt(u,a));a=g}if(a===-1){l.enqueue(p);return}let m=nt(p);i+=m;let y=nt(u[a]);if(m>=r&&y===0)l.enqueue(p);else{let S=ml(u,a,p);if(!o&&i>r*2)o=!0,n?.warn(`@smithy/util-stream - stream chunk size ${m} is below threshold of ${r}, automatically buffering.`);if(S>=r)l.enqueue(Zt(u,a));else await d(l)}}};return new ReadableStream({pull:d})}function ml(t,r,n){switch(r){case 0:return t[0]+=n,nt(t[0]);case 1:case 2:return t[r].push(n),nt(t[r])}}function Zt(t,r){switch(r){case 0:let n=t[0];return t[0]="",n;case 1:case 2:return t[r].flush()}throw Error(`@smithy/util-stream - invalid index ${r} given to flush()`)}function nt(t){return t?.byteLength??t?.length??0}function yl(t,r=!0){if(r&&typeof Buffer<"u"&&t instanceof Buffer)return 2;if(t instanceof Uint8Array)return 1;if(typeof t==="string")return 0;return-1}function pT(t,r,n){if(Fe(t))return hT(t,r,n);let s=new Jt({read(){}}),o=!1,i=0,u=["",new Jn((d)=>new Uint8Array(d)),new Jn((d)=>Buffer.from(new Uint8Array(d)))],a=-1;return t.on("data",(d)=>{let l=yl(d,!0);if(a!==l){if(a>=0)s.push(Zt(u,a));a=l}if(a===-1){s.push(d);return}let h=nt(d);i+=h;let f=nt(u[a]);if(h>=r&&f===0)s.push(d);else{let p=ml(u,a,d);if(!o&&i>r*2)o=!0,n?.warn(`@smithy/util-stream - stream chunk size ${h} is below threshold of ${r}, automatically buffering.`);if(p>=r)s.push(Zt(u,a))}}),t.on("end",()=>{if(a!==-1){let d=Zt(u,a);if(nt(d)>0)s.push(d)}s.push(null)}),s}var gT=(t,r)=>{let{base64Encoder:n,bodyLengthChecker:s,checksumAlgorithmFn:o,checksumLocationName:i,streamHasher:u}=r,a=n!==void 0&&s!==void 0&&o!==void 0&&i!==void 0&&u!==void 0,d=a?u(o,t):void 0;Promise.resolve(d).catch(()=>{});let l=t.getReader();return new ReadableStream({async pull(h){let{value:f,done:p}=await l.read();if(p){if(h.enqueue(`0\r
7
+ `),a){let g=n(await d);h.enqueue(`${i}:${g}\r
8
+ `),h.enqueue(`\r
9
+ `)}h.close()}else h.enqueue(`${(s(f)||0).toString(16)}\r
10
+ ${f}\r
11
+ `)}})};function mT(t,r){let n=t,s=t;if(Fe(s))return gT(s,r);let{base64Encoder:o,bodyLengthChecker:i,checksumAlgorithmFn:u,checksumLocationName:a,streamHasher:d}=r,l=o!==void 0&&u!==void 0&&a!==void 0&&d!==void 0,h=l?d(u,n):void 0;Promise.resolve(h).catch(()=>{});let f=new Jt({read(){n.resume()}});return n.on("data",(p)=>{let g=i(p)||0;if(g===0)return;if(f.push(`${g.toString(16)}\r
12
+ `),f.push(p),!f.push(`\r
13
+ `))n.pause()}),n.on("error",(p)=>{f.destroy(p)}),n.pause(),n.on("end",async()=>{try{if(f.push(`0\r
14
+ `),l){let p=o(await h);f.push(`${a}:${p}\r
15
+ `),f.push(`\r
16
+ `)}f.push(null)}catch(p){f.destroy(p)}}),f}async function yT(t,r){let n=0,s=[],o=t.getReader(),i=!1;while(!i){let{done:d,value:l}=await o.read();if(l)s.push(l),n+=l?.byteLength??0;if(n>=r)break;i=d}o.releaseLock();let u=new Uint8Array(Math.min(r,n)),a=0;for(let d of s){if(d.byteLength>u.byteLength-a){u.set(d.subarray(0,u.byteLength-a),a);break}else u.set(d,a);a+=d.length}return u}var ST=(t,r)=>{if(Fe(t))return yT(t,r);return new Promise((n,s)=>{let o=new wT;o.limit=r,t.pipe(o),t.on("error",(i)=>{o.end(),s(i)}),o.on("error",s),o.on("finish",function(){let i=rs(this.buffers);n(i)})})},wT=class extends Gd{buffers=[];limit=1/0;bytesBuffered=0;_write(r,n,s){if(this.buffers.push(r),this.bytesBuffered+=r.byteLength??0,this.bytesBuffered>=this.limit){let o=this.bytesBuffered-this.limit,i=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=i.subarray(0,i.byteLength-o),this.emit("finish")}s()}},ET=(t)=>{if(typeof t==="string")return t;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(t)},bT=async(t)=>{if(ns(t))return Sl(t);return wl(t)};async function Sl(t){return t.arrayBuffer().then((r)=>new Uint8Array(r))}async function wl(t){let r=[],n=t.getReader(),s=0;while(!0){let{done:o,value:i}=await n.read();if(i)r.push(i),s+=i.length;if(o)break}return rs(r,s)}var qd="The stream has already been transformed.",_T=(t)=>{if(!Vd(t)&&!Fe(t)){let o=t?.__proto__?.constructor?.name||t;throw Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`)}let r=!1,n=async()=>{if(r)throw Error(qd);return r=!0,await bT(t)},s=(o)=>{if(typeof o.stream!=="function")throw Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
17
+ If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return o.stream()};return Object.assign(t,{transformToByteArray:n,transformToString:async(o)=>{let i=await n();if(o==="base64")return pl(i);else if(o==="hex")return ol(i);else if(o===void 0||o==="utf8"||o==="utf-8")return ET(i);else if(typeof TextDecoder==="function")return new TextDecoder(o).decode(i);else throw Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(r)throw Error(qd);if(r=!0,Vd(t))return s(t);else if(Fe(t))return t;else throw Error(`Cannot transform payload to web stream, got ${t}`)}})},Vd=(t)=>typeof Blob==="function"&&t instanceof Blob,El=(t)=>{if(ns(t))return Sl(t);if(Fe(t))return wl(t);return new Promise((r,n)=>{let s=new bl,o=t;o.pipe(s),o.on("error",(i)=>{s.end(),n(i)}),s.on("error",n),s.on("finish",function(){let i=rs(this.bufferedBytes);r(i)})})};class bl extends Gd{bufferedBytes=[];_write(t,r,n){this.bufferedBytes.push(t),n()}}var jd="The stream has already been transformed.",AT=(t)=>{if(!(t instanceof Jt))try{return _T(t)}catch(s){let o=t?.__proto__?.constructor?.name||t;throw Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${o}`)}let r=!1,n=async()=>{if(r)throw Error(jd);return r=!0,await El(t)};return Object.assign(t,{transformToByteArray:n,transformToString:async(s)=>{let o=await n();if(s===void 0||Buffer.isEncoding(s))return er(o.buffer,o.byteOffset,o.byteLength).toString(s);else return new TextDecoder(s).decode(o)},transformToWebStream:()=>{if(r)throw Error(jd);if(t.readableFlowing!==null)throw Error("The stream has been consumed by other callbacks.");if(typeof Jt.toWeb!=="function")throw Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return r=!0,Jt.toWeb(t)}})};async function xT(t){if(typeof t.stream==="function")t=t.stream();return t.tee()}async function TT(t){if(Fe(t)||ns(t))return xT(t);let r=new $d,n=new $d;return t.pipe(r),t.pipe(n),[r,n]}class _l extends u0(Xd,es,Ti,Qd){}var CT=r0,Al=d0(CT),IT=Al;RT.ChecksumStream=fl;RT.Hash=ll;RT.LazyJsonString=Rt;RT.NumericValue=ts;RT.Uint8ArrayBlobAdapter=_l;RT._parseEpochTimestamp=J0;RT._parseRfc3339DateTimeWithOffset=Z0;RT._parseRfc7231DateTime=eT;RT.calculateBodyLength=oT;RT.concatBytes=rs;RT.copyDocumentWithTransform=l0;RT.createBufferedReadable=pT;RT.createChecksumStream=fT;RT.dateToUtcString=R0;RT.deserializerMiddleware=al;RT.deserializerMiddlewareOption=ul;RT.expectBoolean=h0;RT.expectByte=Ai;RT.expectFloat32=Xn;RT.expectInt=g0;RT.expectInt32=bi;RT.expectLong=Wr;RT.expectNonNull=y0;RT.expectNumber=jr;RT.expectObject=Yd;RT.expectShort=_i;RT.expectString=S0;RT.expectUnion=w0;RT.fromArrayBuffer=er;RT.fromBase64=Qd;RT.fromHex=sT;RT.fromString=Zn;RT.fromUtf8=es;RT.generateIdempotencyToken=IT;RT.getAwsChunkedEncodingStream=mT;RT.getSerdePlugin=iT;RT.handleFloat=_0;RT.headStream=ST;RT.isArrayBuffer=Kd;RT.isBlob=ns;RT.isReadableStream=Fe;RT.limitedParseDouble=Ri;RT.limitedParseFloat=A0;RT.limitedParseFloat32=x0;RT.logger=Gr;RT.nv=nT;RT.parseBoolean=f0;RT.parseEpochTimestamp=L0;RT.parseRfc3339DateTime=N0;RT.parseRfc3339DateTimeWithOffset=P0;RT.parseRfc7231DateTime=F0;RT.quoteHeader=W0;RT.sdkStreamMixin=AT;RT.serializerMiddleware=cl;RT.serializerMiddlewareOption=dl;RT.splitEvery=tT;RT.splitHeader=rT;RT.splitStream=TT;RT.streamCollector=El;RT.strictParseByte=tl;RT.strictParseDouble=Ii;RT.strictParseFloat=E0;RT.strictParseFloat32=Jd;RT.strictParseInt=T0;RT.strictParseInt32=C0;RT.strictParseLong=el;RT.strictParseShort=tr;RT.toBase64=Ti;RT.toHex=ol;RT.toUint8Array=il;RT.toUtf8=Xd;RT.v4=Al});var ct=e(function(mI){var{createReadStream:KC}=c("node:fs"),{Writable:QC}=c("node:stream"),{toUint8Array:sr,concatBytes:XC}=ee(),{createHash:Kr,createHmac:YC}=c("node:crypto"),os=c("node:zlib");async function Rl(t,r,n=1048576){let s=t.size,o=0;while(o<s){let i=t.slice(o,Math.min(s,o+n));r(new Uint8Array(await i.arrayBuffer())),o+=i.size}}var JC=async function(r,n){let s=new r;return await Rl(n,(o)=>{s.update(o)}),s.digest()};class Di extends QC{hash;constructor(t,r){super(r);this.hash=t}_write(t,r,n){try{this.hash.update(sr(t))}catch(s){return n(s)}n()}}var ZC=(t,r)=>new Promise((n,s)=>{if(!eI(r)){s(Error("Unable to calculate hash for non-file streams."));return}let o=KC(r.path,{start:r.start,end:r.end}),i=new t,u=new Di(i);o.pipe(u),o.on("error",(a)=>{u.end(),s(a)}),u.on("error",s),u.on("finish",function(){i.digest().then(n).catch(s)})}),eI=(t)=>typeof t.path==="string",tI=(t,r)=>{if(r.readableFlowing!==null)throw Error("Unable to calculate hash for flowing readable stream");let n=new t,s=new Di(n);return r.pipe(s),new Promise((o,i)=>{r.on("error",(u)=>{s.end(),i(u)}),s.on("error",i),s.on("finish",()=>{n.digest().then(o).catch(i)})})};class Fi{digestLength=16;state=Uint32Array.from(xl);writeBuffer=new DataView(new ArrayBuffer(64));bufferLength=0;bytesHashed=0;update(t){let r=sr(t),n=0,s=r.byteLength;this.bytesHashed+=s;while(s>0)if(this.writeBuffer.setUint8(this.bufferLength++,r[n++]),--s,this.bufferLength===64)ki(this.state,this.writeBuffer),this.bufferLength=0}async digest(){let t=Uint32Array.from(this.state),r=new DataView(this.writeBuffer.buffer.slice(0)),n=this.bufferLength,s=this.bytesHashed*8;if(r.setUint8(n++,128),this.bufferLength%64>=56){for(let u=n;u<64;++u)r.setUint8(u,0);ki(t,r),n=0}for(let u=n;u<56;++u)r.setUint8(u,0);r.setUint32(56,s>>>0,!0),r.setUint32(60,Math.floor(s/4294967296),!0),ki(t,r);let o=new Uint8Array(16),i=new DataView(o.buffer);for(let u=0;u<4;++u)i.setUint32(u*4,t[u],!0);return o}reset(){this.state.set(xl),this.writeBuffer=new DataView(new ArrayBuffer(64)),this.bufferLength=0,this.bytesHashed=0}}var xl=[1732584193,4023233417,2562383102,271733878],st=4294967295,rI=Uint8Array.of(7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21),nI=Array.from({length:64},(t,r)=>Math.abs(Math.sin(r+1))*4294967296>>>0);function ki(t,r){let n=t[0],s=t[1],o=t[2],i=t[3];for(let u=0;u<64;++u){let a,d;if(u<16)a=s&o|~s&i,d=u;else if(u<32)a=i&s|o&~i,d=(5*u+1)%16;else if(u<48)a=s^o^i,d=(3*u+5)%16;else a=o^(s|~i),d=7*u%16;let l=r.getUint32(d*4,!0),h=i;i=o,o=s;let f=rI[(u>>4)*4+(u&3)],p=(n+a&st)+(l+nI[u]&st)&st;s=s+((p<<f|p>>>32-f)>>>0)&st,n=h}t[0]=t[0]+n&st,t[1]=t[1]+s&st,t[2]=t[2]+o&st,t[3]=t[3]+i&st}var sI=(()=>{try{return Kr("md5"),!0}catch{return!1}})(),vl=sI?oI():Fi;function oI(){return class{digestLength=16;hash=Kr("md5");update(r){this.hash.update(sr(r))}async digest(){let r=this.hash.copy().digest();return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}reset(){this.hash=Kr("md5")}}}var Nl=new Uint32Array(256);for(let t=0;t<256;++t){let r=t;for(let n=0;n<8;++n)r=r&1?3988292384^r>>>1:r>>>1;Nl[t]=r>>>0}var Mi=4294967295;class Li{digestLength=4;checksum=Mi;update(t){for(let r=0;r<t.length;++r)this.checksum=this.checksum>>>8^Nl[(this.checksum^t[r])&255]}digestSync(){return(this.checksum^Mi)>>>0}async digest(){let t=this.digestSync(),r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!1),r}reset(){this.checksum=Mi}}var Tl=typeof os.crc32==="function"?os.crc32:void 0,Ol=Tl?iI(Tl):Li;function iI(t){return class{digestLength=4;value=0;update(n){this.value=t(n,this.value)}digestSync(){return this.value>>>0}async digest(){let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,this.digestSync(),!1),n}reset(){this.value=0}}}var Z=64,Cl=32,aI=9007199254740991;class Ge{digestLength=Cl;state=Int32Array.from(Il);w;buffer=new Uint8Array(64);bufferLength=0;bytesHashed=0;finished=!1;inner;outer;constructor(t){if(t){let r=Ge.normalizeKey(t);this.inner=new Ge,this.outer=new Ge;let{inner:n,outer:s}=this,o=new Uint8Array(Z*2);for(let i=0;i<Z;++i)o[i]=54^r[i],o[i+Z]=92^r[i];n.update(o.subarray(0,Z)),s.update(o.subarray(Z))}}update(t){if(this.finished)throw Error("Attempted to update an already finished HMAC.");if(this.inner){this.inner.update(t);return}let r=sr(t),n=0,{byteLength:s}=r;if(this.bytesHashed+=s,this.bytesHashed*8>aI)throw Error("Cannot hash more than 2^53 - 1 bits");while(s>0)if(this.buffer[this.bufferLength++]=r[n++],s--,this.bufferLength===Z)this.hashBuffer(),this.bufferLength=0}async digest(){let{inner:t,outer:r}=this;if(t&&r){if(this.finished)throw Error("Attempted to digest an already finished HMAC.");this.finished=!0;let n=t.digestSync();return r.update(n),r.digestSync()}return this.digestSync()}reset(){this.state=Int32Array.from(Il),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0}digestSync(){let t=this.state.slice(),r=this.buffer.slice(),n=this.bufferLength,s=this.bytesHashed*8,o=new DataView(r.buffer,r.byteOffset,r.byteLength);if(o.setUint8(n++,128),(n-1)%Z>=Z-8){for(let u=n;u<Z;++u)o.setUint8(u,0);this.hashBufferWith(t,r),n=0}for(let u=n;u<Z-8;++u)o.setUint8(u,0);o.setUint32(Z-8,Math.floor(s/4294967296),!1),o.setUint32(Z-4,s,!1),this.hashBufferWith(t,r);let i=new Uint8Array(Cl);for(let u=0;u<8;++u)i[u*4]=t[u]>>>24&255,i[u*4+1]=t[u]>>>16&255,i[u*4+2]=t[u]>>>8&255,i[u*4+3]=t[u]>>>0&255;return i}static normalizeKey(t){let r=sr(t);if(r.byteLength>Z){let n=new Ge;n.update(r);let s=n.digestSync(),o=new Uint8Array(Z);return o.set(s),o}if(r.byteLength<Z){let n=new Uint8Array(Z);return n.set(r),n}return r}hashBuffer(){this.hashBufferWith(this.state,this.buffer)}hashBufferWith(t,r){let n=this.w??=new Int32Array(64),s=t[0],o=t[1],i=t[2],u=t[3],a=t[4],d=t[5],l=t[6],h=t[7];for(let f=0;f<Z;++f){if(f<16)n[f]=(r[f*4]&255)<<24|(r[f*4+1]&255)<<16|(r[f*4+2]&255)<<8|r[f*4+3]&255;else{let m=n[f-2],y=(m>>>17|m<<15)^(m>>>19|m<<13)^m>>>10;m=n[f-15];let S=(m>>>7|m<<25)^(m>>>18|m<<14)^m>>>3;n[f]=(y+n[f-7]|0)+(S+n[f-16]|0)}let p=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&d^~a&l)|0)+(h+(cI[f]+n[f]|0)|0)|0,g=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&o^s&i^o&i)|0;h=l,l=d,d=a,a=u+p|0,u=i,i=o,o=s,s=p+g|0}t[0]+=s,t[1]+=o,t[2]+=i,t[3]+=u,t[4]+=a,t[5]+=d,t[6]+=l,t[7]+=h}}var Il=new Int32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),cI=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),uI=(()=>{try{return Kr("sha256"),!0}catch{return!1}})(),Pl=uI?dI():Ge;function dI(){return class{digestLength=32;secret;hash;isHmac;finished=!1;constructor(r){this.secret=r,this.isHmac=!!r,this.hash=this.createHash()}update(r){if(this.finished)throw Error("Attempted to update an already finished hash.");this.hash.update(r)}async digest(){let r;if(this.isHmac)this.finished=!0,r=this.hash.digest();else r=this.hash.copy().digest();return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}reset(){this.hash=this.createHash(),this.finished=!1}createHash(){return this.secret?YC("sha256",lI(this.secret)):Kr("sha256")}}}function lI(t){if(typeof t==="string")return t;if(ArrayBuffer.isView(t))return Buffer.from(t.buffer,t.byteOffset,t.byteLength);return Buffer.from(t)}var{digest:fI,sign:hI,importKey:pI}=globalThis?.crypto?.subtle??{},ss=typeof fI==="function"&&typeof hI==="function"&&typeof pI==="function"?globalThis.crypto.subtle:void 0,gI=8388608;class kl{digestLength=32;secret;pending=[];pendingBytes=0;fallback;finished=!1;constructor(t){if(t)this.secret=sr(t)}update(t){if(this.finished)throw Error("Attempted to update an already finished HMAC.");if(this.fallback){this.fallback.update(t);return}if(this.pending.push(t.slice()),this.pendingBytes+=t.byteLength,this.pendingBytes>=gI)this.switchToFallback()}async digest(){if(this.fallback)return this.fallback.digest();if(this.secret&&this.finished)throw Error("Attempted to digest an already finished HMAC.");let t=XC(this.pending);if(ss){if(this.secret){this.finished=!0;let s=await ss.importKey("raw",this.secret,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),o=await ss.sign("HMAC",s,t);return new Uint8Array(o)}let n=await ss.digest("SHA-256",t);return new Uint8Array(n)}let r=new Ge(this.secret);return r.update(t),r.digest()}reset(){this.pending=[],this.pendingBytes=0,this.fallback=void 0,this.finished=!1}switchToFallback(){let t=new Ge(this.secret);for(let r of this.pending)t.update(r);this.fallback=t,this.pending=[],this.pendingBytes=0}}mI.Crc32=Ol;mI.Crc32Js=Li;mI.Crc32Node=Ol;mI.Md5=vl;mI.Md5Js=Fi;mI.Md5Node=vl;mI.Sha256=Pl;mI.Sha256Js=Ge;mI.Sha256Node=Pl;mI.Sha256WebCrypto=kl;mI.blobHasher=JC;mI.blobReader=Rl;mI.fileStreamHasher=ZC;mI.readableStreamHasher=tI});var yt=e(function(eR){var{Crc32:Ll}=ct(),{hasOwn:is}=me(),{toHex:or,fromHex:OI,toUtf8:PI,fromUtf8:kI}=ee(),{Readable:MI}=c("node:stream"),{TypeRegistry:DI}=Re();class ir{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776000||t<-9223372036854776000)throw Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(t));n>-1&&s>0;n--,s/=256)r[n]=s;if(t<0)Ml(r);return new ir(r)}valueOf(){let t=this.bytes.slice(0),r=t[0]&128;if(r)Ml(t);return parseInt(or(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function Ml(t){for(let r=0;r<8;r++)t[r]^=255;for(let r=7;r>-1;r--)if(t[r]++,t[r]!==0)break}class Ui{toUtf8;fromUtf8;constructor(t,r){this.toUtf8=t,this.fromUtf8=r}format(t){let r=[];for(let o in t){if(!is(t,o))continue;let i=this.fromUtf8(o);r.push(Uint8Array.from([i.byteLength]),i,this.formatHeaderValue(t[o]))}let n=new Uint8Array(r.reduce((o,i)=>o+i.byteLength,0)),s=0;for(let o of r)n.set(o,s),s+=o.byteLength;return n}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":let r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,t.value,!1),new Uint8Array(r.buffer);case"integer":let n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,t.value,!1),new Uint8Array(n.buffer);case"long":let s=new Uint8Array(9);return s[0]=5,s.set(t.value.bytes,1),s;case"binary":let o=new DataView(new ArrayBuffer(3+t.value.byteLength));o.setUint8(0,6),o.setUint16(1,t.value.byteLength,!1);let i=new Uint8Array(o.buffer);return i.set(t.value,3),i;case"string":let u=this.fromUtf8(t.value),a=new DataView(new ArrayBuffer(3+u.byteLength));a.setUint8(0,7),a.setUint16(1,u.byteLength,!1);let d=new Uint8Array(a.buffer);return d.set(u,3),d;case"timestamp":let l=new Uint8Array(9);return l[0]=8,l.set(ir.fromNumber(t.value.valueOf()).bytes,1),l;case"uuid":if(!VI.test(t.value))throw Error(`Invalid UUID received: ${t.value}`);let h=new Uint8Array(17);return h[0]=9,h.set(OI(t.value.replace(/-/g,"")),1),h}}parse(t){let r={},n=0;while(n<t.byteLength){let s=t.getUint8(n++),o=this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+n,s));switch(n+=s,t.getUint8(n++)){case 0:r[o]={type:Fl,value:!0};break;case 1:r[o]={type:Fl,value:!1};break;case 2:r[o]={type:FI,value:t.getInt8(n++)};break;case 3:r[o]={type:LI,value:t.getInt16(n,!1)},n+=2;break;case 4:r[o]={type:UI,value:t.getInt32(n,!1)},n+=4;break;case 5:r[o]={type:$I,value:new ir(new Uint8Array(t.buffer,t.byteOffset+n,8))},n+=8;break;case 6:let i=t.getUint16(n,!1);n+=2,r[o]={type:BI,value:new Uint8Array(t.buffer,t.byteOffset+n,i)},n+=i;break;case 7:let u=t.getUint16(n,!1);n+=2,r[o]={type:HI,value:this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+n,u))},n+=u;break;case 8:r[o]={type:zI,value:new Date(new ir(new Uint8Array(t.buffer,t.byteOffset+n,8)).valueOf())},n+=8;break;case 9:let a=new Uint8Array(t.buffer,t.byteOffset+n,16);n+=16,r[o]={type:qI,value:`${or(a.subarray(0,4))}-${or(a.subarray(4,6))}-${or(a.subarray(6,8))}-${or(a.subarray(8,10))}-${or(a.subarray(10))}`};break;default:throw Error("Unrecognized header type tag")}}return r}}var Dl;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(Dl||(Dl={}));var Fl="boolean",FI="byte",LI="short",UI="integer",$I="long",BI="binary",HI="string",zI="timestamp",qI="uuid",VI=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,Ul=4,ot=Ul*2,vt=4,jI=ot+vt*2;function WI({byteLength:t,byteOffset:r,buffer:n}){if(t<jI)throw Error("Provided message too short to accommodate event stream message overhead");let s=new DataView(n,r,t),o=s.getUint32(0,!1);if(t!==o)throw Error("Reported message length does not match received message length");let i=s.getUint32(Ul,!1),u=s.getUint32(ot,!1),a=s.getUint32(t-vt,!1),d=new Ll;if(d.update(new Uint8Array(n,r,ot)),u!==d.digestSync())throw Error(`The prelude checksum specified in the message (${u}) does not match the calculated CRC32 checksum (${d.digestSync()})`);if(d.update(new Uint8Array(n,r+ot,t-(ot+vt))),a!==d.digestSync())throw Error(`The message checksum (${d.digestSync()}) did not match the expected value of ${a}`);return{headers:new DataView(n,r+ot+vt,i),body:new Uint8Array(n,r+ot+vt+i,o-i-(ot+vt+vt))}}class $i{headerMarshaller;messageBuffer;isEndOfStream;constructor(t,r){this.headerMarshaller=new Ui(t,r),this.messageBuffer=[],this.isEndOfStream=!1}feed(t){this.messageBuffer.push(this.decode(t))}endOfStream(){this.isEndOfStream=!0}getMessage(){let t=this.messageBuffer.pop(),r=this.isEndOfStream;return{getMessage(){return t},isEndOfStream(){return r}}}getAvailableMessages(){let t=this.messageBuffer;this.messageBuffer=[];let r=this.isEndOfStream;return{getMessages(){return t},isEndOfStream(){return r}}}encode({headers:t,body:r}){let n=this.headerMarshaller.format(t),s=n.byteLength+r.byteLength+16,o=new Uint8Array(s),i=new DataView(o.buffer,o.byteOffset,o.byteLength),u=new Ll;return i.setUint32(0,s,!1),i.setUint32(4,n.byteLength,!1),u.update(o.subarray(0,8)),i.setUint32(8,u.digestSync(),!1),o.set(n,12),o.set(r,n.byteLength+12),u.update(o.subarray(8,s-4)),i.setUint32(s-4,u.digestSync(),!1),o}decode(t){let{headers:r,body:n}=WI(t);return{headers:this.headerMarshaller.parse(r),body:n}}formatHeaders(t){return this.headerMarshaller.format(t)}}class Bi{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let t of this.options.inputStream)yield this.options.decoder.decode(t)}}class Hi{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let t of this.options.messageStream)yield this.options.encoder.encode(t);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class zi{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let t of this.options.messageStream){let r=await this.options.deserializer(t);if(r===void 0)continue;yield r}}}class qi{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let t of this.options.inputStream)yield this.options.serializer(t)}}function $l(t){let r=0,n=0,s=null,o=null,i=(a)=>{if(typeof a!=="number")throw Error("Attempted to allocate an event message where size was not a number: "+a);r=a,n=4,s=new Uint8Array(a),new DataView(s.buffer).setUint32(0,a,!1)},u=async function*(){let a=t[Symbol.asyncIterator]();while(!0){let{value:d,done:l}=await a.next();if(l){if(!r)return;else if(r===n)yield s;else throw Error("Truncated event message received.");return}let h=d.length,f=0;while(f<h){if(!s){let g=h-f;if(!o)o=new Uint8Array(4);let m=Math.min(4-n,g);if(o.set(d.slice(f,f+m),n),n+=m,f+=m,n<4)break;i(new DataView(o.buffer).getUint32(0,!1)),o=null}let p=Math.min(r-n,h-f);if(s.set(d.slice(f,f+p),n),n+=p,f+=p,r&&r===n)yield s,s=null,r=0,n=0}}};return{[Symbol.asyncIterator]:u}}function GI(t,r){let n=Vi(r.deserializer,r.toUtf8);return{[Symbol.asyncIterator]:async function*(){for await(let s of t){let o=r.eventStreamCodec.decode(s),i=await n(o);if(i===void 0)continue;yield i}}}}function Vi(t,r){return async function(n){let{value:s}=n.headers[":message-type"];if(s==="error"){let o=Error(n.headers[":error-message"].value||"UnknownError");throw o.name=n.headers[":error-code"].value,o}else if(s==="exception"){let o=n.headers[":exception-type"].value,i={[o]:n},u=await t(i);if(u.$unknown){let a=Error(r(n.body));throw a.name=o,a}throw u[o]}else if(s==="event"){let o={[n.headers[":event-type"].value]:n},i=await t(o);if(i.$unknown)return;return i}else throw Error(`Unrecognizable event type: ${n.headers[":event-type"].value}`)}}var ji=class{eventStreamCodec;utfEncoder;constructor({utf8Encoder:r,utf8Decoder:n}){this.eventStreamCodec=new $i(r,n),this.utfEncoder=r}deserialize(r,n){let s=$l(r);return new zi({messageStream:new Bi({inputStream:s,decoder:this.eventStreamCodec}),deserializer:Vi(n,this.utfEncoder)})}serialize(r,n){return new Hi({messageStream:new qi({inputStream:r,serializer:n}),encoder:this.eventStreamCodec,includeEndFrame:!0})}},KI=(t)=>new ji(t);class Wi{universalMarshaller;constructor({utf8Encoder:t,utf8Decoder:r}){this.universalMarshaller=new ji({utf8Decoder:r,utf8Encoder:t})}deserialize(t,r){let n=typeof t[Symbol.asyncIterator]==="function"?t:XI(t);return this.universalMarshaller.deserialize(n,r)}serialize(t,r){return MI.from(this.universalMarshaller.serialize(t,r))}}var QI=(t)=>new Wi(t);async function*XI(t){let r=!1,n=!1,s=[];t.on("error",(o)=>{if(!r)r=!0;if(o)throw o}),t.on("data",(o)=>{s.push(o)}),t.on("end",()=>{r=!0});while(!n){let o=await new Promise((i)=>setTimeout(()=>i(s.shift()),0));if(o)yield o;n=r&&s.length===0}}var YI=(t)=>({[Symbol.asyncIterator]:async function*(){let r=t.getReader();try{while(!0){let{done:n,value:s}=await r.read();if(n)return;yield s}}finally{r.releaseLock()}}}),JI=(t)=>{let r=t[Symbol.asyncIterator]();return new ReadableStream({async pull(n){let{done:s,value:o}=await r.next();if(s)return n.close();n.enqueue(o)}})},ZI=(t)=>Object.assign(t,{eventStreamMarshaller:t.eventStreamSerdeProvider(t)});class Bl{marshaller;serializer;deserializer;serdeContext;defaultContentType;compositeErrorRegistry;constructor({marshaller:t,serializer:r,deserializer:n,serdeContext:s,defaultContentType:o,compositeErrorRegistry:i}){this.marshaller=t,this.serializer=r,this.deserializer=n,this.serdeContext=s,this.defaultContentType=o,this.compositeErrorRegistry=i}async serializeEventStream({eventStream:t,requestSchema:r,initialRequest:n,initialMessageType:s}){let o=this.marshaller,i=r.getEventStreamMember(),u=r.getMemberSchema(i),a=this.serializer,d=this.defaultContentType,l=Symbol("initialRequestMarker"),h={async*[Symbol.asyncIterator](){if(n){let f={":event-type":{type:"string",value:s??"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:d}};a.write(r,n);let p=a.flush();yield{[l]:!0,headers:f,body:p}}for await(let f of t)yield f}};return o.serialize(h,(f)=>{if(f[l])return{headers:f.headers,body:f.body};let p="";for(let E in f){if(!is(f,E))continue;if(E!=="__type"){p=E;break}}let{additionalHeaders:g,body:m,eventType:y,explicitPayloadContentType:S}=this.writeEventBody(p,u,f);return{headers:{":event-type":{type:"string",value:y},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:S??d},...g},body:m}})}async deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:n,initialMessageType:s}){let o=this.marshaller,i=r.getEventStreamMember(),a=r.getMemberSchema(i).getMemberSchemas(),d=Symbol("initialResponseMarker"),l=o.deserialize(t.body,async(p)=>{let g="";for(let y in p){if(!is(p,y))continue;if(y!=="__type"){g=y;break}}let m=p[g].body;if(g===(s??"initial-response")){let y=await this.deserializer.read(r,m);return delete y[i],{[d]:!0,...y}}else if(g in a){let y=a[g];if(y.isStructSchema()){let S={},w=!1;for(let[E,A]of y.structIterator()){let{eventHeader:v,eventPayload:L}=A.getMergedTraits();if(w=w||Boolean(v||L),L){if(A.isBlobSchema())S[E]=m;else if(A.isStringSchema())S[E]=(this.serdeContext?.utf8Encoder??PI)(m);else if(A.isStructSchema())S[E]=await this.deserializer.read(A,m)}else if(v){let k=p[g].headers[E]?.value;if(k!=null)if(A.isNumericSchema())if(k&&typeof k==="object"&&"bytes"in k)S[E]=BigInt(k.toString());else S[E]=Number(k);else S[E]=k}}return{[g]:await this.readEventMember(y,m,w,S)}}return{[g]:await this.deserializer.read(y,m)}}else return{$unknown:p}}),h=l[Symbol.asyncIterator](),f=await h.next();if(f.done)return l;if(f.value?.[d]){if(!r)throw Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(let p in f.value){if(!is(f.value,p))continue;n[p]=f.value[p]}}return{async*[Symbol.asyncIterator](){if(!f?.value?.[d])yield f.value;while(!0){let{done:p,value:g}=await h.next();if(p)break;yield g}}}}async readEventMember(t,r,n,s){let o,i=t.getSchema();if(Array.isArray(i)&&i[0]===-3){let a=i[1],d=DI.for(a);this.compositeErrorRegistry?.copyFrom(d),o=(this.compositeErrorRegistry??d)?.getErrorCtor(i)}let u=n?s:r.byteLength===0?{}:await this.deserializer.read(t,r);if(o){let a=u.message??u.Message??"Unknown",d={},l=t.getMergedTraits().error;if(l)d.$fault=l;return Object.assign(new o({}),d,{message:a},u)}return u}writeEventBody(t,r,n){let s=this.serializer,o=t,i=null,u,a=(()=>r.getSchema()[4].includes(t))(),d={};if(!a){let[f,p]=n[t];o=f,s.write(15,p)}else{let f=r.getMemberSchema(t);if(f.isStructSchema()){for(let[p,g]of f.structIterator()){let{eventHeader:m,eventPayload:y}=g.getMergedTraits();if(y)i=p;else if(m){let S=n[t][p],w="binary";if(g.isNumericSchema())if(-2147483648<=S&&S<=2147483647)w="integer";else w="long";else if(g.isTimestampSchema())w="timestamp";else if(g.isStringSchema())w="string";else if(g.isBooleanSchema())w="boolean";if(S!=null)d[p]={type:w,value:S},delete n[t][p]}}if(i!==null){let p=f.getMemberSchema(i);if(p.isBlobSchema())u="application/octet-stream";else if(p.isStringSchema())u="text/plain";s.write(p,n[t][i])}else s.write(f,n[t])}else if(f.isUnitSchema())s.write(f,{});else throw Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}let l=s.flush()??new Uint8Array;return{body:typeof l==="string"?(this.serdeContext?.utf8Decoder??kI)(l):l,eventType:o,explicitPayloadContentType:u,additionalHeaders:d}}}eR.EventStreamCodec=$i;eR.EventStreamMarshaller=Wi;eR.EventStreamSerde=Bl;eR.HeaderMarshaller=Ui;eR.Int64=ir;eR.MessageDecoderStream=Bi;eR.MessageEncoderStream=Hi;eR.SmithyMessageDecoderStream=zi;eR.SmithyMessageEncoderStream=qi;eR.UniversalEventStreamMarshaller=ji;eR.eventStreamSerdeProvider=QI;eR.getChunkedStream=$l;eR.getMessageUnmarshaller=Vi;eR.getUnmarshalledStream=GI;eR.iterableToReadableStream=JI;eR.readableStreamToIterable=YI;eR.resolveEventStreamSerdeConfig=ZI;eR.universalEventStreamSerdeProvider=KI});var K=e(function(BR){var{Uint8ArrayBlobAdapter:Gi,sdkStreamMixin:wR,splitEvery:ER,splitHeader:Vl,fromBase64:Hl,_parseEpochTimestamp:bR,_parseRfc7231DateTime:_R,_parseRfc3339DateTimeWithOffset:AR,LazyJsonString:jl,NumericValue:xR,toUtf8:Wl,fromUtf8:TR,generateIdempotencyToken:CR,toBase64:zl,dateToUtcString:IR,quoteHeader:RR}=ee(),{HttpRequest:ar,HttpResponse:Gl,hasOwn:Nt,isValidHostname:Kl}=me(),{parseQueryString:vR,parseUrl:NR}=me();BR.HttpRequest=ar;BR.HttpResponse=Gl;BR.isValidHostname=Kl;BR.parseQueryString=vR;BR.parseUrl=NR;var{TypeRegistry:OR,NormalizedSchema:Le,translateTraits:Ql}=Re(),{FieldPosition:PR}=xt(),Ot=async(t=new Uint8Array,r)=>{if(t instanceof Uint8Array)return Gi.mutate(t);if(!t)return Gi.mutate(new Uint8Array);let n=r.streamCollector(t);return Gi.mutate(await n)};function Xr(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})}class cr{serdeContext;setSerdeContext(t){this.serdeContext=t}}class as extends cr{options;compositeErrorRegistry;constructor(t){super();this.options=t,this.compositeErrorRegistry=new OR(t.defaultNamespace);for(let r of t.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(r)}getRequestType(){return ar}getResponseType(){return Gl}setSerdeContext(t){if(this.serdeContext=t,this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t),this.getPayloadCodec())this.getPayloadCodec().setSerdeContext(t)}updateServiceEndpoint(t,r){if("url"in r){if(t.protocol=r.url.protocol,t.hostname=r.url.hostname,t.port=r.url.port?Number(r.url.port):void 0,t.path=r.url.pathname,t.fragment=r.url.hash||void 0,t.username=r.url.username||void 0,t.password=r.url.password||void 0,!t.query)t.query={};for(let[n,s]of r.url.searchParams.entries())t.query[n]=s;if(r.headers)for(let n in r.headers){if(!Nt(r.headers,n))continue;t.headers[n]=r.headers[n].join(", ")}return t}else{if(t.protocol=r.protocol,t.hostname=r.hostname,t.port=r.port?Number(r.port):void 0,t.path=r.path,t.query={...r.query},r.headers)for(let n in r.headers){if(!Nt(r.headers,n))continue;t.headers[n]=r.headers[n]}return t}}setHostPrefix(t,r,n){if(this.serdeContext?.disableHostPrefix)return;let s=Le.of(r.input),o=Ql(r.traits??{});if(o.endpoint){let i=o.endpoint?.[0];if(typeof i==="string"){for(let[u,a]of s.structIterator()){if(!a.getMergedTraits().hostLabel)continue;let d=n[u];if(typeof d!=="string")throw Error(`@smithy/core/schema - ${u} in input must be a string as hostLabel.`);i=i.replace(`{${u}}`,d)}if(t.hostname=i+t.hostname,!Kl(t.hostname))throw Error(`[${t.hostname}] is not a valid hostname.`)}}}deserializeMetadata(t){return{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"]}}resolveError(t,r,n){let s=[-3,"","Error",0,[],[],0],o;for(let i of n)for(let u of r)try{if(u==="*")o=i.getSchema(t);else o=i.getSchema(u+"#"+t);let a=i.getErrorCtor(o);if(a)return[o,a,"modeled"];else{let d=i.getBaseException();if(d){let l=i.getErrorCtor(d);if(l)return[o,l,"synthetic"]}}}catch(a){}for(let i of n){let u=i.getBaseException();if(u){let a=i.getErrorCtor(u);if(a)return[u,a,"synthetic"]}}return[s,Error,"native"]}async serializeEventStream({eventStream:t,requestSchema:r,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:t,requestSchema:r,initialRequest:n})}async deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:n})}async loadEventStreamCapability(){let{EventStreamSerde:t,eventStreamSerdeProvider:r}=yt(),n=this.resolveEventStreamMarshaller(r);return new t({marshaller:n,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType(),compositeErrorRegistry:this.compositeErrorRegistry})}getDefaultContentType(){throw Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(t,r,n,s,o){return[]}getEventStreamMarshaller(){let t=this.serdeContext;if(!t.eventStreamMarshaller)throw Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return t.eventStreamMarshaller}resolveEventStreamMarshaller(t){let r=this.serdeContext;if(r.eventStreamMarshaller)return r.eventStreamMarshaller;return t(this.serdeContext)}}class Xl extends as{async serializeRequest(t,r,n){let s=r&&typeof r==="object"?r:{},o=this.serializer,i={},u={},a=await n.endpoint(),d=Le.of(t?.input),l=[],h=[],f=!1,p,g=new ar({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:i,headers:u,body:void 0});if(a){this.updateServiceEndpoint(g,a),this.setHostPrefix(g,t,s);let m=Ql(t.traits);if(m.http){g.method=m.http[0];let[y,S]=m.http[1].split("?");if(g.path=="/")g.path=y;else g.path+=y;let w=new URLSearchParams(S??"");for(let[E,A]of w)i[E]=A}}for(let[m,y]of d.structIterator()){let S=y.getMergedTraits()??{},w=s[m];if(w==null&&!y.isIdempotencyToken()){if(S.httpLabel){if(g.path.includes(`{${m}+}`)||g.path.includes(`{${m}}`))throw Error(`No value provided for input HTTP label: ${m}.`)}continue}if(S.httpPayload)if(y.isStreaming())if(y.isStructSchema()){if(s[m])p=await this.serializeEventStream({eventStream:s[m],requestSchema:d})}else p=w;else o.write(y,w),p=o.flush();else if(S.httpLabel){o.write(y,w);let E=o.flush();if(g.path.includes(`{${m}+}`))g.path=g.path.replace(`{${m}+}`,E.split("/").map(Xr).join("/"));else if(g.path.includes(`{${m}}`))g.path=g.path.replace(`{${m}}`,Xr(E))}else if(S.httpHeader)o.write(y,w),u[S.httpHeader.toLowerCase()]=String(o.flush());else if(typeof S.httpPrefixHeaders==="string")for(let E in w){if(!Nt(w,E))continue;let A=w[E],v=S.httpPrefixHeaders+E;o.write([y.getValueSchema(),{httpHeader:v}],A),u[v.toLowerCase()]=o.flush()}else if(S.httpQuery||S.httpQueryParams)this.serializeQuery(y,w,i);else f=!0,l.push(m),h.push(y)}if(f&&s){let[m,y]=(d.getName(!0)??"#Unknown").split("#"),S=d.getSchema()[6],w=[3,m,y,d.getMergedTraits(),l,h,void 0];if(S)w[6]=S;else w.pop();o.write(w,s),p=o.flush()}return g.headers=u,g.query=i,g.body=p,g}serializeQuery(t,r,n){let s=this.serializer,o=t.getMergedTraits();if(o.httpQueryParams){for(let i in r){if(!Nt(r,i))continue;if(!(i in n)){let u=r[i],a=t.getValueSchema();Object.assign(a.getMergedTraits(),{...o,httpQuery:i,httpQueryParams:void 0}),this.serializeQuery(a,u,n)}}return}if(t.isListSchema()){let i=!!t.getMergedTraits().sparse,u=[];for(let a of r){s.write([t.getValueSchema(),o],a);let d=s.flush();if(i||d!==void 0)u.push(d)}n[o.httpQuery]=u}else s.write([t,o],r),n[o.httpQuery]=s.flush()}async deserializeResponse(t,r,n){let s=this.deserializer,o=Le.of(t.output),i={};if(n.statusCode>=300){let a=await Ot(n.body,r);if(a.byteLength>0)Object.assign(i,await s.read(15,a));throw await this.handleError(t,r,n,i,this.deserializeMetadata(n)),Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(let a in n.headers){if(!Nt(n.headers,a))continue;let d=n.headers[a];delete n.headers[a],n.headers[a.toLowerCase()]=d}let u=await this.deserializeHttpMessage(o,r,n,i);if(u.length){let a=await Ot(n.body,r);if(a.byteLength>0){let d=await s.read(o,a);for(let l of u)if(d[l]!=null)i[l]=d[l]}}else if(u.discardResponseBody)await Ot(n.body,r);return i.$metadata=this.deserializeMetadata(n),i}async deserializeHttpMessage(t,r,n,s,o){let i;if(s instanceof Set)i=o;else i=s;let u=!0,a=this.deserializer,d=Le.of(t),l=[];for(let[h,f]of d.structIterator()){let p=f.getMemberTraits();if(p.httpPayload){if(u=!1,f.isStreaming())if(f.isStructSchema())i[h]=await this.deserializeEventStream({response:n,responseSchema:d});else i[h]=wR(n.body);else if(n.body){let m=await Ot(n.body,r);if(m.byteLength>0)i[h]=await a.read(f,m)}}else if(p.httpHeader){let g=String(p.httpHeader).toLowerCase(),m=n.headers[g];if(m!=null)if(f.isListSchema()){let y=f.getValueSchema();y.getMergedTraits().httpHeader=g;let S;if(y.isTimestampSchema()&&y.getSchema()===4)S=ER(m,",",2);else S=Vl(m);let w=[];for(let E of S)w.push(await a.read(y,E.trim()));i[h]=w}else i[h]=await a.read(f,m)}else if(p.httpPrefixHeaders!==void 0){i[h]={};for(let g in n.headers){if(!Nt(n.headers,g))continue;if(g.startsWith(p.httpPrefixHeaders)){let m=n.headers[g],y=f.getValueSchema();y.getMergedTraits().httpHeader=g,i[h][g.slice(p.httpPrefixHeaders.length)]=await a.read(y,m)}}}else if(p.httpResponseCode)i[h]=n.statusCode;else l.push(h)}return l.discardResponseBody=u,l}}class Yl extends as{async serializeRequest(t,r,n){let s=this.serializer,o={},i={},u=await n.endpoint(),a=Le.of(t?.input),d=a.getSchema(),l,h=r&&typeof r==="object"?r:{},f=new ar({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:o,headers:i,body:void 0});if(u)this.updateServiceEndpoint(f,u),this.setHostPrefix(f,t,h);if(h){let p=a.getEventStreamMember();if(p){if(h[p]){let g={};for(let[m]of a.structIterator())if(m!==p&&h[m]!=null)g[m]=h[m];l=await this.serializeEventStream({eventStream:h[p],requestSchema:a,initialRequest:g})}}else s.write(d,h),l=s.flush()}return f.headers=Object.assign(f.headers,i),f.query=o,f.body=l,f.method="POST",f}async deserializeResponse(t,r,n){let s=this.deserializer,o=Le.of(t.output),i={};if(n.statusCode>=300){let a=await Ot(n.body,r);if(a.byteLength>0)Object.assign(i,await s.read(15,a));throw await this.handleError(t,r,n,i,this.deserializeMetadata(n)),Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(let a in n.headers){if(!Nt(n.headers,a))continue;let d=n.headers[a];delete n.headers[a],n.headers[a.toLowerCase()]=d}let u=o.getEventStreamMember();if(u)i[u]=await this.deserializeEventStream({response:n,responseSchema:o,initialResponseContainer:i});else{let a=await Ot(n.body,r);if(a.byteLength>0)Object.assign(i,await s.read(o,a))}return i.$metadata=this.deserializeMetadata(n),i}}var Jl=(t,r,n,s,o,i)=>{if(r!=null&&r[n]!==void 0){let u=s();if(u==null||u.length<=0)throw Error("Empty value provided for input HTTP label: "+n+".");t=t.replace(o,i?u.split("/").map((a)=>Xr(a)).join("/"):Xr(u))}else throw Error("No value provided for input HTTP label: "+n+".");return t};function kR(t,r){return new Ki(t,r)}class Ki{input;context;query={};method="";headers={};path="";body=null;hostname="";resolvePathStack=[];constructor(t,r){this.input=t,this.context=r}async build(){let{hostname:t,protocol:r="https",port:n,path:s}=await this.context.endpoint();this.path=s;for(let o of this.resolvePathStack)o(this.path);return new ar({protocol:r,hostname:this.hostname||t,port:n,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((r)=>{this.path=`${r?.endsWith("/")?r.slice(0,-1):r||""}`+t}),this}p(t,r,n,s){return this.resolvePathStack.push((o)=>{this.path=Jl(o,this.input,t,r,n,s)}),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}}function Qi(t,r){if(r.timestampFormat.useTrait){if(t.isTimestampSchema()&&(t.getSchema()===5||t.getSchema()===6||t.getSchema()===7))return t.getSchema()}let{httpLabel:n,httpPrefixHeaders:s,httpHeader:o,httpQuery:i}=t.getMergedTraits();return(r.httpBindings?typeof s==="string"||Boolean(o)?6:Boolean(i)||Boolean(n)?5:void 0:void 0)??r.timestampFormat.default}class Xi extends cr{settings;constructor(t){super();this.settings=t}read(t,r){let n=Le.of(t);if(n.isListSchema())return Vl(r).map((s)=>this.read(n.getValueSchema(),s));if(n.isBlobSchema())return(this.serdeContext?.base64Decoder??Hl)(r);if(n.isTimestampSchema())switch(Qi(n,this.settings)){case 5:return AR(r);case 6:return _R(r);case 7:return bR(r);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",r),new Date(r)}if(n.isStringSchema()){let s=n.getMergedTraits().mediaType,o=r;if(s){if(n.getMergedTraits().httpHeader)o=this.base64ToUtf8(o);if(s==="application/json"||s.endsWith("+json"))o=jl.from(o);return o}}if(n.isNumericSchema())return Number(r);if(n.isBigIntegerSchema())return BigInt(r);if(n.isBigDecimalSchema())return new xR(r,"bigDecimal");if(n.isBooleanSchema())return String(r).toLowerCase()==="true";return r}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??Wl)((this.serdeContext?.base64Decoder??Hl)(t))}}class Zl extends cr{codecDeserializer;stringDeserializer;constructor(t,r){super();this.codecDeserializer=t,this.stringDeserializer=new Xi(r)}setSerdeContext(t){this.stringDeserializer.setSerdeContext(t),this.codecDeserializer.setSerdeContext(t),this.serdeContext=t}read(t,r){let n=Le.of(t),s=n.getMergedTraits(),o=this.serdeContext?.utf8Encoder??Wl;if(s.httpHeader||s.httpResponseCode)return this.stringDeserializer.read(n,o(r));if(s.httpPayload){if(n.isBlobSchema()){let i=this.serdeContext?.utf8Decoder??TR;if(typeof r==="string")return i(r);return r}else if(n.isStringSchema()){if("byteLength"in r)return o(r);return r}}return this.codecDeserializer.read(n,r)}}class Yi extends cr{settings;stringBuffer="";constructor(t){super();this.settings=t}write(t,r){let n=Le.of(t);switch(typeof r){case"object":if(r===null){this.stringBuffer="null";return}if(n.isTimestampSchema()){if(!(r instanceof Date))throw Error(`@smithy/core/protocols - received non-Date value ${r} when schema expected Date in ${n.getName(!0)}`);switch(Qi(n,this.settings)){case 5:this.stringBuffer=r.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=IR(r);break;case 7:this.stringBuffer=String(r.getTime()/1000);break;default:console.warn("Missing timestamp format, using epoch seconds",r),this.stringBuffer=String(r.getTime()/1000)}return}if(n.isBlobSchema()&&"byteLength"in r){this.stringBuffer=(this.serdeContext?.base64Encoder??zl)(r);return}if(n.isListSchema()&&Array.isArray(r)){let i="";for(let u of r){this.write([n.getValueSchema(),n.getMergedTraits()],u);let a=this.flush(),d=n.getValueSchema().isTimestampSchema()?a:RR(a);if(i!=="")i+=", ";i+=d}this.stringBuffer=i;return}this.stringBuffer=JSON.stringify(r,null,2);break;case"string":let s=n.getMergedTraits().mediaType,o=r;if(s){if(s==="application/json"||s.endsWith("+json"))o=jl.from(o);if(n.getMergedTraits().httpHeader){this.stringBuffer=(this.serdeContext?.base64Encoder??zl)(o.toString());return}}this.stringBuffer=r;break;default:if(n.isIdempotencyToken())this.stringBuffer=CR();else this.stringBuffer=String(r)}}flush(){let t=this.stringBuffer;return this.stringBuffer="",t}}class ef{codecSerializer;stringSerializer;buffer;constructor(t,r,n=new Yi(r)){this.codecSerializer=t,this.stringSerializer=n}setSerdeContext(t){this.codecSerializer.setSerdeContext(t),this.stringSerializer.setSerdeContext(t)}write(t,r){let n=Le.of(t),s=n.getMergedTraits();if(s.httpHeader||s.httpLabel||s.httpQuery){this.stringSerializer.write(n,r),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(n,r)}flush(){if(this.buffer!==void 0){let t=this.buffer;return this.buffer=void 0,t}return this.codecSerializer.flush()}}class tf{name;kind;values;constructor({name:t,kind:r=PR.HEADER,values:n=[]}){this.name=t,this.kind=r,this.values=n}add(t){this.values.push(t)}set(t){this.values=t}remove(t){this.values=this.values.filter((r)=>r!==t)}toString(){return this.values.map((t)=>t.includes(",")||t.includes(" ")?`"${t}"`:t).join(", ")}get(){return this.values}}class rf{entries={};encoding;constructor({fields:t=[],encoding:r="utf-8"}){t.forEach(this.setField.bind(this)),this.encoding=r}setField(t){this.entries[t.name.toLowerCase()]=t}getField(t){return this.entries[t.toLowerCase()]}removeField(t){delete this.entries[t.toLowerCase()]}getByType(t){return Object.values(this.entries).filter((r)=>r.kind===t)}}var MR=(t)=>{if(t.logger&&t.logger.constructor?.name!=="NoOpLogger")t.requestHandler?.updateHttpClientConfig?.(Symbol.for("logger"),t.logger);return{setHttpHandler(r){t.requestHandler=r},httpHandler(){return t.requestHandler},updateHttpClientConfig(r,n){t.requestHandler?.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return t.requestHandler.httpHandlerConfigs()}}},DR=(t)=>({requestHandler:t.httpHandler()}),ql="content-length";function nf(t){return(r)=>async(n)=>{let s=n.request;if(ar.isInstance(s)){let{body:o,headers:i}=s;if(o&&Object.keys(i).map((u)=>u.toLowerCase()).indexOf(ql)===-1)try{let u=t(o);if(u!=null)s.headers={...s.headers,[ql]:String(u)}}catch(u){}}return r({...n,request:s})}}var sf={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},FR=(t)=>({applyToStack:(r)=>{r.add(nf(t.bodyLengthChecker),sf)}}),Qr=(t)=>encodeURIComponent(t).replace(/[!'()*]/g,LR),LR=(t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`,UR=(t)=>t.split("/").map(Qr).join("/");function $R(t){let r=[];for(let n of Object.keys(t).sort()){let s=t[n];if(n=Qr(n),Array.isArray(s))for(let o=0,i=s.length;o<i;o++)r.push(`${n}=${Qr(s[o])}`);else{let o=n;if(s||typeof s==="string")o+=`=${Qr(s)}`;r.push(o)}}return r.join("&")}BR.Field=tf;BR.Fields=rf;BR.FromStringShapeDeserializer=Xi;BR.HttpBindingProtocol=Xl;BR.HttpInterceptingShapeDeserializer=Zl;BR.HttpInterceptingShapeSerializer=ef;BR.HttpProtocol=as;BR.RequestBuilder=Ki;BR.RpcProtocol=Yl;BR.SerdeContext=cr;BR.ToStringShapeSerializer=Yi;BR.buildQueryString=$R;BR.collectBody=Ot;BR.contentLengthMiddleware=nf;BR.contentLengthMiddlewareOptions=sf;BR.determineTimestampFormat=Qi;BR.escapeUri=Qr;BR.escapeUriPath=UR;BR.extendedEncodeURIComponent=Xr;BR.getContentLengthPlugin=FR;BR.getHttpHandlerExtensionConfiguration=MR;BR.requestBuilder=kR;BR.resolveHttpHandlerRuntimeConfig=DR;BR.resolvedPath=Jl});var lt=e(function(Bv){var{Readable:mv}=c("node:stream"),{NoOpLogger:yv,normalizeProvider:of}=Ie(),{HttpResponse:af,HttpRequest:us}=K(),{parseRfc7231DateTime:Sv,v4:cf}=ee(),{hasOwn:wv}=me(),uf=(t)=>t?.body instanceof mv||typeof ReadableStream<"u"&&t?.body instanceof ReadableStream,Ev=["AccessDeniedException","AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],bv=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],_v=["TimeoutError","RequestTimeout","RequestTimeoutException"],Av=[500,502,503,504],xv=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Tv=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"],ta=(t)=>t?.$retryable!==void 0,df=(t)=>Ev.includes(t.name),lf=(t)=>t.$metadata?.clockSkewCorrected,ff=(t)=>{let r=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);if(!(t&&t instanceof TypeError))return!1;return r.has(t.message)},Jr=(t)=>t.$metadata?.httpStatusCode===429||bv.includes(t.name)||t.$retryable?.throttling==!0,Zr=(t,r=0)=>t?.name!=="AbortError"&&(ta(t)||lf(t)||t.name==="InvalidSignatureException"&&t.message?.includes("Signature expired")||_v.includes(t.name)||xv.includes(t?.code||"")||Tv.includes(t?.code||"")||Av.includes(t.$metadata?.httpStatusCode||0)||ff(t)||pf(t)||t.cause!==void 0&&r<=10&&Zr(t.cause,r+1)),hf=(t)=>{if(t.$metadata?.httpStatusCode!==void 0){let r=t.$metadata.httpStatusCode;if(500<=r&&r<=599&&!Zr(t))return!0;return!1}return!1};function pf(t){return t.code==="ERR_HTTP2_STREAM_ERROR"&&t.message.includes("NGHTTP2_REFUSED_STREAM")}var gf=100,ls=20000,mf=500,ds=500,yf=5,Sf=10,ra=1,fs="amz-sdk-invocation-id",hs="amz-sdk-request";function wf(t,r){if(!af.isInstance(t))return;for(let n in t.headers){if(!wv(t.headers,n))continue;let s=n.toLowerCase();if(s==="retry-after"){let o=t.headers[n],i=NaN;if(o.endsWith("GMT"))try{i=(Sv(o).getTime()-Date.now())/1000}catch(u){r?.trace?.("Failed to parse retry-after header"),r?.trace?.(u)}else if(o.match(/ GMT, ((\d+)|(\d+\.\d+))$/))i=Number(o.match(/ GMT, ([\d.]+)$/)?.[1]);else if(o.match(/^((\d+)|(\d+\.\d+))$/))i=Number(o);else if(Date.parse(o)>=Date.now())i=(Date.parse(o)-Date.now())/1000;if(isNaN(i))return;return new Date(Date.now()+i*1000)}else if(s==="x-amz-retry-after"){let o=t.headers[n],i=Number(o);if(isNaN(i)){r?.trace?.(`Failed to parse x-amz-retry-after=${o}`);return}return new Date(Date.now()+i)}}}function Cv(t,r){return wf(t,r)}var Ef=(t)=>{if(t instanceof Error)return t;if(t instanceof Object)return Object.assign(Error(),t);if(typeof t==="string")return Error(t);return Error(`AWS SDK error wrapper for ${t}`)};function bf(t){return(r)=>(n,s)=>async(o)=>{let i=await r.retryStrategy(),u=await r.maxAttempts();if(Rv(i)){i=i;let a=await i.acquireInitialRetryToken((s.partition_id??"")+(s.__retryLongPoll?":longpoll":"")),d=Error(),l=0,h=0,{request:f}=o,p=us.isInstance(f);if(p)f.headers[fs]=cf();while(!0)try{if(p)f.headers[hs]=`attempt=${l+1}; max=${u}`;let{response:g,output:m}=await n(o);return i.recordSuccess(a),m.$metadata.attempts=l+1,m.$metadata.totalRetryDelay=h,{response:g,output:m}}catch(g){let m=vv(g,r.logger);if(d=Ef(g),p&&t(f))throw(s.logger instanceof yv?console:s.logger)?.warn("An error was encountered in a non-retryable streaming request."),d;try{a=await i.refreshRetryTokenForRetry(a,m)}catch(S){if(!d.$metadata)d.$metadata={};throw d.$metadata.attempts=l+1,d.$metadata.totalRetryDelay=h,d}l=a.getRetryCount();let y=a.getRetryDelay();if(h+=(a?.$retryLog?.acquisitionDelay??0)+y,y>0)await Iv(y)}}else{if(i=i,i?.mode)s.userAgent=[...s.userAgent||[],["cfg/retry-mode",i.mode]];return i.retry(n,o)}}}var Iv=(t)=>new Promise((r)=>setTimeout(r,t)),Rv=(t)=>typeof t.acquireInitialRetryToken<"u"&&typeof t.refreshRetryTokenForRetry<"u"&&typeof t.recordSuccess<"u",vv=(t,r)=>{let n={error:t,errorType:Nv(t)},s=wf(t.$response,r);if(s)n.retryAfterHint=s;return n},Nv=(t)=>{if(Jr(t))return"THROTTLING";if(Zr(t))return"TRANSIENT";if(hf(t))return"SERVER_ERROR";return"CLIENT_ERROR"},_f={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function Ov(t){let r=bf(t);return(n)=>({applyToStack:(s)=>{s.add(r(n),_f)}})}class en{static setTimeoutFn=(t,r)=>setTimeout(t,r);beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(t){this.beta=t?.beta??0.7,this.minCapacity=t?.minCapacity??1,this.minFillRate=t?.minFillRate??0.5,this.scaleConstant=t?.scaleConstant??0.4,this.smooth=t?.smooth??0.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(t){let r;this.updateMeasuredRate();let n=t;if(n?.errorType==="THROTTLING"||Jr(n?.error??t)){let i=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=i,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(i),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());let o=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(o)}getCurrentTimeInSeconds(){return Date.now()/1000}async acquireTokenBucket(t){if(!this.enabled)return;this.refillTokenBucket();while(t>this.availableTokens){let r=(t-this.availableTokens)/this.fillRate*1000;await new Promise((n)=>en.setTimeoutFn(n,r)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-t}refillTokenBucket(){let t=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=t;return}let r=(t-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+r),this.lastTimestamp=t}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(t){return this.getPrecise(t*this.beta)}cubicSuccess(t){return this.getPrecise(this.scaleConstant*Math.pow(t-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(t){this.refillTokenBucket(),this.fillRate=Math.max(t,this.minFillRate),this.maxCapacity=Math.max(t,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){let t=this.getCurrentTimeInSeconds(),r=Math.floor(t*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){let n=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(t){return parseFloat(t.toFixed(8))}}class Q{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return Q.v2026?50:100}static throttlingDelay(){return Q.v2026?1000:500}static cost(){return Q.v2026?14:5}static throttlingCost(){return Q.v2026?5:10}static modifiedCostType(){return Q.v2026?"THROTTLING":"TRANSIENT"}}class Af{x=Q.delay();computeNextBackoffDelay(t){let r=Math.random(),n=2,s=r*Math.min(this.x*2**t,ls);return Math.floor(s)}setDelayBase(t){this.x=t}}class Ji{delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(t,r,n,s){this.delay=t,this.count=r,this.cost=n,this.longPoll=s}getRetryCount(){return this.count}getRetryDelay(){return Math.min(ls,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}var Ke;(function(t){t.STANDARD="standard",t.ADAPTIVE="adaptive"})(Ke||(Ke={}));var Pt=3,xf=Ke.STANDARD,cs={incompatible:1,attempts:2,capacity:3},Yr=class{mode=Ke.STANDARD;retryBackoffStrategy;capacity=ds;maxAttemptsProvider;baseDelay;constructor(r){if(typeof r==="number")this.maxAttemptsProvider=async()=>r;else if(typeof r==="function")this.maxAttemptsProvider=r;else if(r&&typeof r==="object")this.maxAttemptsProvider=async()=>r.maxAttempts,this.baseDelay=r.baseDelay,this.retryBackoffStrategy=r.backoff;this.maxAttemptsProvider??=async()=>Pt,this.baseDelay??=Q.delay(),this.retryBackoffStrategy??=new Af}async acquireInitialRetryToken(r){return new Ji(Q.delay(),0,void 0,Q.v2026&&r.includes(":longpoll"))}async refreshRetryTokenForRetry(r,n){let s=await this.getMaxAttempts(),o=this.retryCode(r,n,s),i=o===0,u=r.isLongPoll?.();if(i||u){let a=n.errorType;this.retryBackoffStrategy.setDelayBase(a==="THROTTLING"?Q.throttlingDelay():this.baseDelay);let d=this.retryBackoffStrategy.computeNextBackoffDelay(r.getRetryCount()),l=d;if(n.retryAfterHint instanceof Date)l=Math.max(d,Math.min(n.retryAfterHint.getTime()-Date.now(),d+5000));if(!i){let h=Q.v2026&&o===cs.capacity&&u?l:0;if(h>0)await new Promise((f)=>setTimeout(f,h))}else{let h=this.getCapacityCost(a);this.capacity-=h;let f=new Ji(0,r.getRetryCount()+1,h,r.isLongPoll?.()??!1);return await new Promise((p)=>setTimeout(p,l)),f.$retryLog.acquisitionDelay=l,f}}throw Error("No retry token available")}recordSuccess(r){this.capacity=Math.min(ds,this.capacity+(r.getRetryCost()??ra))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(r){return console.warn(`Max attempts provider could not resolve. Using default of ${Pt}`),Pt}}retryCode(r,n,s){let o=r.getRetryCount()+1,i=this.isRetryableError(n.errorType)?0:cs.incompatible,u=o<s?0:cs.attempts,a=this.capacity>=this.getCapacityCost(n.errorType)?0:cs.capacity;return i||u||a}getCapacityCost(r){return r===Q.modifiedCostType()?Q.throttlingCost():Q.cost()}isRetryableError(r){return r==="THROTTLING"||r==="TRANSIENT"}},Tf=class{mode=Ke.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(r,n){let{rateLimiter:s}=n??{};this.rateLimiter=s??new en,this.standardRetryStrategy=n?new Yr({maxAttempts:typeof r==="number"?r:3,...n}):new Yr(r)}async acquireInitialRetryToken(r){let n=await this.standardRetryStrategy.acquireInitialRetryToken(r);return await this.rateLimiter.getSendToken(),n}async refreshRetryTokenForRetry(r,n){this.rateLimiter.updateClientSendingRate(n);let s=await this.standardRetryStrategy.refreshRetryTokenForRetry(r,n);return await this.rateLimiter.getSendToken(),s}recordSuccess(r){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(r)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}};class Cf extends Yr{computeNextBackoffDelay;constructor(t,r=Q.delay()){super(typeof t==="function"?t:async()=>t);if(typeof r==="number")this.computeNextBackoffDelay=()=>r;else this.computeNextBackoffDelay=r;this.retryBackoffStrategy.computeNextBackoffDelay=(n)=>{let s=n+1;return this.computeNextBackoffDelay(s)}}}var Pv=(t,r)=>{let n=t,s=ra,o=yf,i=Sf,u=t,a=(f)=>f.name==="TimeoutError"?i:o,d=(f)=>a(f)<=u;return Object.freeze({hasRetryTokens:d,retrieveRetryTokens:(f)=>{if(!d(f))throw Error("No retry token available");let p=a(f);return u-=p,p},releaseRetryTokens:(f)=>{u+=f??s,u=Math.min(u,n)}})},If=(t,r)=>Math.floor(Math.min(ls,Math.random()*2**r*t)),Rf=(t)=>{if(!t)return!1;return ta(t)||df(t)||Jr(t)||Zr(t)};class na{maxAttemptsProvider;retryDecider;delayDecider;retryQuota;mode=Ke.STANDARD;constructor(t,r){this.maxAttemptsProvider=t,this.retryDecider=r?.retryDecider??Rf,this.delayDecider=r?.delayDecider??If,this.retryQuota=r?.retryQuota??Pv(ds)}shouldRetry(t,r,n){return r<n&&this.retryDecider(t)&&this.retryQuota.hasRetryTokens(t)}async getMaxAttempts(){let t;try{t=await this.maxAttemptsProvider()}catch(r){t=Pt}return t}async retry(t,r,n){let s,o=0,i=0,u=await this.getMaxAttempts(),{request:a}=r;if(us.isInstance(a))a.headers[fs]=cf();while(!0)try{if(us.isInstance(a))a.headers[hs]=`attempt=${o+1}; max=${u}`;if(n?.beforeRequest)await n.beforeRequest();let{response:d,output:l}=await t(r);if(n?.afterRequest)n.afterRequest(d);return this.retryQuota.releaseRetryTokens(s),l.$metadata.attempts=o+1,l.$metadata.totalRetryDelay=i,{response:d,output:l}}catch(d){let l=Ef(d);if(o++,this.shouldRetry(l,o,u)){s=this.retryQuota.retrieveRetryTokens(l);let h=this.delayDecider(Jr(l)?mf:gf,o),f=kv(l.$response),p=Math.max(f||0,h);i+=p,await new Promise((g)=>setTimeout(g,p));continue}if(!l.$metadata)l.$metadata={};throw l.$metadata.attempts=o,l.$metadata.totalRetryDelay=i,l}}}var kv=(t)=>{if(!af.isInstance(t))return;let r=Object.keys(t.headers).find((i)=>i.toLowerCase()==="retry-after");if(!r)return;let n=t.headers[r],s=Number(n);if(!Number.isNaN(s))return Math.min(s*1000,20000);let o=new Date(n);return Math.min(o.getTime()-Date.now(),20000)};class vf extends na{rateLimiter;constructor(t,r){let{rateLimiter:n,...s}=r??{};super(t,s);this.rateLimiter=n??new en,this.mode=Ke.ADAPTIVE}async retry(t,r){return super.retry(t,r,{beforeRequest:async()=>this.rateLimiter.getSendToken(),afterRequest:(n)=>{this.rateLimiter.updateClientSendingRate(n)}})}}var Zi="AWS_MAX_ATTEMPTS",ea="max_attempts",Mv={environmentVariableSelector:(t)=>{let r=t[Zi];if(!r)return;let n=parseInt(r);if(Number.isNaN(n))throw Error(`Environment variable ${Zi} mast be a number, got "${r}"`);return n},configFileSelector:(t)=>{let r=t[ea];if(!r)return;let n=parseInt(r);if(Number.isNaN(n))throw Error(`Shared config file entry ${ea} mast be a number, got "${r}"`);return n},default:Pt},Dv=(t,r)=>{let{retryStrategy:n,retryMode:s}=t,{defaultMaxAttempts:o=Pt,defaultBaseDelay:i=Q.delay()}=r??{},u=of(t.maxAttempts??o),a=n?Promise.resolve(n):void 0,d=async()=>{let l=await u();if(await of(s)()===Ke.ADAPTIVE)return new Tf(u,{maxAttempts:l,baseDelay:i});return new Yr({maxAttempts:l,baseDelay:i})};return Object.assign(t,{maxAttempts:u,retryStrategy:()=>a??=d()})},Nf="AWS_RETRY_MODE",Of="retry_mode",Fv={environmentVariableSelector:(t)=>t[Nf],configFileSelector:(t)=>t[Of],default:xf},Pf=()=>(t)=>async(r)=>{let{request:n}=r;if(us.isInstance(n))delete n.headers[fs],delete n.headers[hs];return t(r)},kf={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},Lv=(t)=>({applyToStack:(r)=>{r.addRelativeTo(Pf(),kf)}}),Uv=bf(uf),$v=Ov(uf);Bv.AdaptiveRetryStrategy=Tf;Bv.CONFIG_MAX_ATTEMPTS=ea;Bv.CONFIG_RETRY_MODE=Of;Bv.ConfiguredRetryStrategy=Cf;Bv.DEFAULT_MAX_ATTEMPTS=Pt;Bv.DEFAULT_RETRY_DELAY_BASE=gf;Bv.DEFAULT_RETRY_MODE=xf;Bv.DefaultRateLimiter=en;Bv.DeprecatedAdaptiveRetryStrategy=vf;Bv.DeprecatedStandardRetryStrategy=na;Bv.ENV_MAX_ATTEMPTS=Zi;Bv.ENV_RETRY_MODE=Nf;Bv.INITIAL_RETRY_TOKENS=ds;Bv.INVOCATION_ID_HEADER=fs;Bv.MAXIMUM_RETRY_DELAY=ls;Bv.NODE_MAX_ATTEMPT_CONFIG_OPTIONS=Mv;Bv.NODE_RETRY_MODE_CONFIG_OPTIONS=Fv;Bv.NO_RETRY_INCREMENT=ra;Bv.REQUEST_HEADER=hs;Bv.RETRY_COST=yf;Bv.RETRY_MODES=Ke;Bv.Retry=Q;Bv.StandardRetryStrategy=Yr;Bv.THROTTLING_RETRY_DELAY_BASE=mf;Bv.TIMEOUT_RETRY_COST=Sf;Bv.defaultDelayDecider=If;Bv.defaultRetryDecider=Rf;Bv.getOmitRetryHeadersPlugin=Lv;Bv.getRetryAfterHint=Cv;Bv.getRetryPlugin=$v;Bv.isBrowserNetworkError=ff;Bv.isClockSkewCorrectedError=lf;Bv.isClockSkewError=df;Bv.isNodeJsHttp2TransientError=pf;Bv.isRetryableByTrait=ta;Bv.isServerError=hf;Bv.isThrottlingError=Jr;Bv.isTransientError=Zr;Bv.omitRetryHeadersMiddleware=Pf;Bv.omitRetryHeadersMiddlewareOptions=kf;Bv.resolveRetryConfig=Dv;Bv.retryMiddleware=Uv;Bv.retryMiddlewareOptions=_f});var Df=e(function(NN){var it={REQUEST_ID:Symbol.for("_AWS_LAMBDA_REQUEST_ID"),X_RAY_TRACE_ID:Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),TENANT_ID:Symbol.for("_AWS_LAMBDA_TENANT_ID"),TRACEPARENT:Symbol.for("_AWS_LAMBDA_TRACEPARENT"),TRACESTATE:Symbol.for("_AWS_LAMBDA_TRACESTATE"),BAGGAGE:Symbol.for("_AWS_LAMBDA_BAGGAGE")},sa=["true","1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??"");if(!sa)globalThis.awslambda=globalThis.awslambda||{};class ps{static PROTECTED_KEYS=it;isProtectedKey(t){return Object.values(it).includes(t)}getRequestId(){return this.get(it.REQUEST_ID)??"-"}getXRayTraceId(){return this.get(it.X_RAY_TRACE_ID)}getTenantId(){return this.get(it.TENANT_ID)}getTraceparent(){return this.get(it.TRACEPARENT)}getTracestate(){return this.get(it.TRACESTATE)}getBaggage(){return this.get(it.BAGGAGE)}}class Mf extends ps{currentContext;getContext(){return this.currentContext}hasContext(){return this.currentContext!==void 0}get(t){return this.currentContext?.[t]}set(t,r){if(this.isProtectedKey(t))throw Error(`Cannot modify protected Lambda context field: ${String(t)}`);this.currentContext=this.currentContext||{},this.currentContext[t]=r}run(t,r){return this.currentContext=t,r()}}class ia extends ps{als;static async create(){let t=new ia,r=await import("node:async_hooks");return t.als=new r.AsyncLocalStorage,t}getContext(){return this.als.getStore()}hasContext(){return this.als.getStore()!==void 0}get(t){return this.als.getStore()?.[t]}set(t,r){if(this.isProtectedKey(t))throw Error(`Cannot modify protected Lambda context field: ${String(t)}`);let n=this.als.getStore();if(!n)throw Error("No context available");n[t]=r}run(t,r){return this.als.run(t,r)}}NN.InvokeStore=void 0;(function(t){let r=null;async function n(s){if(!r)r=(async()=>{let i=s===!0||"AWS_LAMBDA_MAX_CONCURRENCY"in process.env?await ia.create():new Mf;if(!sa&&globalThis.awslambda?.InvokeStore)return globalThis.awslambda.InvokeStore;else if(!sa&&globalThis.awslambda)return globalThis.awslambda.InvokeStore=i,i;else return i})();return r}t.getInstanceAsync=n,t._testing=process.env.AWS_LAMBDA_BENCHMARK_MODE==="1"?{reset:()=>{if(r=null,globalThis.awslambda?.InvokeStore)delete globalThis.awslambda.InvokeStore;globalThis.awslambda={InvokeStore:void 0}}}:void 0})(NN.InvokeStore||(NN.InvokeStore={}));NN.InvokeStoreBase=ps});var et=e(function(KN){var{getSmithyContext:aa,hasOwn:PN}=me();KN.getSmithyContext=aa;var{HttpRequest:ca}=K(),{requestBuilder:kN}=K();KN.requestBuilder=kN;var{HttpApiKeyAuthLocation:Ff}=xt(),MN=(t,r)=>{if(!r||r.length===0)return t;let n=[];for(let s of r)for(let o of t)if(o.schemeId.split("#")[1]===s)n.push(o);for(let s of t)if(!n.find(({schemeId:o})=>o===s.schemeId))n.push(s);return n};function DN(t){let r=new Map;for(let n of t)r.set(n.schemeId,n);return r}var ua=(t,r)=>(n,s)=>async(o)=>{let i=t.httpAuthSchemeProvider(await r.httpAuthSchemeParametersProvider(t,s,o.input)),u=t.authSchemePreference?await t.authSchemePreference():[],a=MN(i,u),d=DN(t.httpAuthSchemes),l=aa(s),h=[];for(let f of a){let p=d.get(f.schemeId);if(!p){h.push(`HttpAuthScheme \`${f.schemeId}\` was not enabled for this service.`);continue}let g=p.identityProvider(await r.identityProviderConfigProvider(t));if(!g){h.push(`HttpAuthScheme \`${f.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:m={},signingProperties:y={}}=f.propertiesExtractor?.(t,s)||{};f.identityProperties=Object.assign(f.identityProperties||{},m),f.signingProperties=Object.assign(f.signingProperties||{},y),l.selectedHttpAuthScheme={httpAuthOption:f,identity:await g(f.identityProperties),signer:p.signer};break}if(!l.selectedHttpAuthScheme)throw Error(h.join(`
18
+ `));return n(o)},Lf={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},FN=(t,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:n})=>({applyToStack:(s)=>{s.addRelativeTo(ua(t,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:n}),Lf)}}),Uf={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"},LN=(t,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:n})=>({applyToStack:(s)=>{s.addRelativeTo(ua(t,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:n}),Uf)}}),UN=(t)=>(r)=>{throw r},$N=(t,r)=>{},$f=(t)=>(r,n)=>async(s)=>{if(!ca.isInstance(s.request))return r(s);let i=aa(n).selectedHttpAuthScheme;if(!i)throw Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:u={}},identity:a,signer:d}=i,l=await r({...s,request:await d.sign(s.request,a,u)}).catch((d.errorHandler||UN)(u));return(d.successHandler||$N)(l.response,u),l},Bf={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},BN=(t)=>({applyToStack:(r)=>{r.addRelativeTo($f(),Bf)}}),HN=(t)=>{if(typeof t==="function")return t;let r=Promise.resolve(t);return()=>r},zN=async(t,r,n,s=(i)=>i,...o)=>{let i=new t(n);return i=s(i)??i,await r.send(i,...o)};function qN(t,r,n,s,o){return async function*(u,a,...d){let l=a,h=u.startingToken??l[n],f=!0,p;while(f){if(l[n]=h,o)l[o]=l[o]??u.pageSize;if(u.client instanceof t)p=await zN(r,u.client,a,u.withCommand,...d);else throw Error(`Invalid client, expected instance of ${t.name}`);yield p;let g=h;h=VN(p,s),f=!!(h&&(!u.stopOnSameToken||h!==g))}return}}var VN=(t,r)=>{let n=t,s=r.split(".");for(let o of s){if(!n||typeof n!=="object")return;n=n[o]}return n};function jN(t,r,n){if(!t.__smithy_context)t.__smithy_context={features:{}};else if(!t.__smithy_context.features)t.__smithy_context.features={};t.__smithy_context.features[r]=n}class Hf{authSchemes=new Map;constructor(t){for(let r in t){if(!PN(t,r))continue;let n=t[r];if(n!==void 0)this.authSchemes.set(r,n)}}getIdentityProvider(t){return this.authSchemes.get(t)}}class zf{async sign(t,r,n){if(!n)throw Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!n.name)throw Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!n.in)throw Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!r.apiKey)throw Error("request could not be signed with `apiKey` since the `apiKey` is not defined");let s=ca.clone(t);if(n.in===Ff.QUERY)s.query[n.name]=r.apiKey;else if(n.in===Ff.HEADER)s.headers[n.name]=n.scheme?`${n.scheme} ${r.apiKey}`:r.apiKey;else throw Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+n.in+"`");return s}}class qf{async sign(t,r,n){let s=ca.clone(t);if(!r.token)throw Error("request could not be signed with `token` since the `token` is not defined");return s.headers.Authorization=`Bearer ${r.token}`,s}}class Vf{async sign(t,r,n){return t}}var jf=(t)=>function(n){return Gf(n)&&n.expiration.getTime()-Date.now()<t},Wf=300000,WN=jf(Wf),Gf=(t)=>t.expiration!==void 0,GN=(t,r,n)=>{if(t===void 0)return;let s=typeof t!=="function"?async()=>Promise.resolve(t):t,o,i,u,a=!1,d=async(l)=>{if(!i)i=s(l);try{o=await i,u=!0,a=!1}finally{i=void 0}return o};if(r===void 0)return async(l)=>{if(!u||l?.forceRefresh)o=await d(l);return o};return async(l)=>{if(!u||l?.forceRefresh)o=await d(l);if(a)return o;if(!n(o))return a=!0,o;if(r(o))return await d(l),o;return o}};KN.DefaultIdentityProviderConfig=Hf;KN.EXPIRATION_MS=Wf;KN.HttpApiKeyAuthSigner=zf;KN.HttpBearerAuthSigner=qf;KN.NoAuthSigner=Vf;KN.createIsIdentityExpiredFunction=jf;KN.createPaginator=qN;KN.doesIdentityRequireRefresh=Gf;KN.getHttpAuthSchemeEndpointRuleSetPlugin=FN;KN.getHttpAuthSchemePlugin=LN;KN.getHttpSigningPlugin=BN;KN.httpAuthSchemeEndpointRuleSetMiddlewareOptions=Lf;KN.httpAuthSchemeMiddleware=ua;KN.httpAuthSchemeMiddlewareOptions=Uf;KN.httpSigningMiddleware=$f;KN.httpSigningMiddlewareOptions=Bf;KN.isIdentityExpired=WN;KN.memoizeIdentityProvider=GN;KN.normalizeProvider=HN;KN.setFeature=jN});var Kf=e(function(tn,da){(function(t,r){typeof tn=="object"&&typeof da=="object"?da.exports=r():typeof define=="function"&&define.amd?define([],r):typeof tn=="object"?tn.bowser=r():t.bowser=r()})(tn,function(){return function(t){var r={};function n(s){if(r[s])return r[s].exports;var o=r[s]={i:s,l:!1,exports:{}};return t[s].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=r,n.d=function(s,o,i){n.o(s,o)||Object.defineProperty(s,o,{enumerable:!0,get:i})},n.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},n.t=function(s,o){if(1&o&&(s=n(s)),8&o)return s;if(4&o&&typeof s=="object"&&s&&s.__esModule)return s;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:s}),2&o&&typeof s!="string")for(var u in s)n.d(i,u,function(a){return s[a]}.bind(null,u));return i},n.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return n.d(o,"a",o),o},n.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},n.p="",n(n.s=90)}({17:function(t,r,n){r.__esModule=!0,r.default=void 0;var s=n(18),o=function(){function i(){}return i.getFirstMatch=function(u,a){var d=a.match(u);return d&&d.length>0&&d[1]||""},i.getSecondMatch=function(u,a){var d=a.match(u);return d&&d.length>1&&d[2]||""},i.matchAndReturnConst=function(u,a,d){if(u.test(a))return d},i.getWindowsVersionName=function(u){switch(u){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},i.getMacOSVersionName=function(u){var a=u.split(".").splice(0,2).map(function(h){return parseInt(h,10)||0});a.push(0);var d=a[0],l=a[1];if(d===10)switch(l){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(d){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}},i.getAndroidVersionName=function(u){var a=u.split(".").splice(0,2).map(function(d){return parseInt(d,10)||0});if(a.push(0),!(a[0]===1&&a[1]<5))return a[0]===1&&a[1]<6?"Cupcake":a[0]===1&&a[1]>=6?"Donut":a[0]===2&&a[1]<2?"Eclair":a[0]===2&&a[1]===2?"Froyo":a[0]===2&&a[1]>2?"Gingerbread":a[0]===3?"Honeycomb":a[0]===4&&a[1]<1?"Ice Cream Sandwich":a[0]===4&&a[1]<4?"Jelly Bean":a[0]===4&&a[1]>=4?"KitKat":a[0]===5?"Lollipop":a[0]===6?"Marshmallow":a[0]===7?"Nougat":a[0]===8?"Oreo":a[0]===9?"Pie":void 0},i.getVersionPrecision=function(u){return u.split(".").length},i.compareVersions=function(u,a,d){d===void 0&&(d=!1);var l=i.getVersionPrecision(u),h=i.getVersionPrecision(a),f=Math.max(l,h),p=0,g=i.map([u,a],function(m){var y=f-i.getVersionPrecision(m),S=m+Array(y+1).join(".0");return i.map(S.split("."),function(w){return Array(20-w.length).join("0")+w}).reverse()});for(d&&(p=f-Math.min(l,h)),f-=1;f>=p;){if(g[0][f]>g[1][f])return 1;if(g[0][f]===g[1][f]){if(f===p)return 0;f-=1}else if(g[0][f]<g[1][f])return-1}},i.map=function(u,a){var d,l=[];if(Array.prototype.map)return Array.prototype.map.call(u,a);for(d=0;d<u.length;d+=1)l.push(a(u[d]));return l},i.find=function(u,a){var d,l;if(Array.prototype.find)return Array.prototype.find.call(u,a);for(d=0,l=u.length;d<l;d+=1){var h=u[d];if(a(h,d))return h}},i.assign=function(u){for(var a,d,l=u,h=arguments.length,f=Array(h>1?h-1:0),p=1;p<h;p++)f[p-1]=arguments[p];if(Object.assign)return Object.assign.apply(Object,[u].concat(f));var g=function(){var m=f[a];typeof m=="object"&&m!==null&&Object.keys(m).forEach(function(y){l[y]=m[y]})};for(a=0,d=f.length;a<d;a+=1)g();return u},i.getBrowserAlias=function(u){return s.BROWSER_ALIASES_MAP[u]},i.getBrowserTypeByAlias=function(u){return s.BROWSER_MAP[u]||""},i}();r.default=o,t.exports=r.default},18:function(t,r,n){r.__esModule=!0,r.ENGINE_MAP=r.OS_MAP=r.PLATFORMS_MAP=r.BROWSER_MAP=r.BROWSER_ALIASES_MAP=void 0,r.BROWSER_ALIASES_MAP={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",Brave:"brave",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",DuckDuckGo:"duckduckgo",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Linespider:"linespider",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SlackBot:"slackbot",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},r.BROWSER_MAP={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",brave:"Brave",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",duckduckgo:"DuckDuckGo",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",linespider:"Linespider",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",slackbot:"SlackBot",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},r.PLATFORMS_MAP={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},r.OS_MAP={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},r.ENGINE_MAP={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"}},90:function(t,r,n){r.__esModule=!0,r.default=void 0;var s,o=(s=n(91))&&s.__esModule?s:{default:s},i=n(18);function u(d,l){for(var h=0;h<l.length;h++){var f=l[h];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}var a=function(){function d(){}var l,h,f;return d.getParser=function(p,g,m){if(g===void 0&&(g=!1),m===void 0&&(m=null),typeof p!="string")throw Error("UserAgent should be a string");return new o.default(p,g,m)},d.parse=function(p,g){return g===void 0&&(g=null),new o.default(p,g).getResult()},l=d,f=[{key:"BROWSER_MAP",get:function(){return i.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return i.ENGINE_MAP}},{key:"OS_MAP",get:function(){return i.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return i.PLATFORMS_MAP}}],(h=null)&&u(l.prototype,h),f&&u(l,f),d}();r.default=a,t.exports=r.default},91:function(t,r,n){r.__esModule=!0,r.default=void 0;var s=d(n(92)),o=d(n(93)),i=d(n(94)),u=d(n(95)),a=d(n(17));function d(h){return h&&h.__esModule?h:{default:h}}var l=function(){function h(p,g,m){if(g===void 0&&(g=!1),m===void 0&&(m=null),p==null||p==="")throw Error("UserAgent parameter can't be empty");this._ua=p;var y=!1;typeof g=="boolean"?(y=g,this._hints=m):this._hints=g!=null&&typeof g=="object"?g:null,this.parsedResult={},y!==!0&&this.parse()}var f=h.prototype;return f.getHints=function(){return this._hints},f.hasBrand=function(p){if(!this._hints||!Array.isArray(this._hints.brands))return!1;var g=p.toLowerCase();return this._hints.brands.some(function(m){return m.brand&&m.brand.toLowerCase()===g})},f.getBrandVersion=function(p){if(this._hints&&Array.isArray(this._hints.brands)){var g=p.toLowerCase(),m=this._hints.brands.find(function(y){return y.brand&&y.brand.toLowerCase()===g});return m?m.version:void 0}},f.getUA=function(){return this._ua},f.test=function(p){return p.test(this._ua)},f.parseBrowser=function(){var p=this;this.parsedResult.browser={};var g=a.default.find(s.default,function(m){if(typeof m.test=="function")return m.test(p);if(Array.isArray(m.test))return m.test.some(function(y){return p.test(y)});throw Error("Browser's test function is not valid")});return g&&(this.parsedResult.browser=g.describe(this.getUA(),this)),this.parsedResult.browser},f.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},f.getBrowserName=function(p){return p?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},f.getBrowserVersion=function(){return this.getBrowser().version},f.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},f.parseOS=function(){var p=this;this.parsedResult.os={};var g=a.default.find(o.default,function(m){if(typeof m.test=="function")return m.test(p);if(Array.isArray(m.test))return m.test.some(function(y){return p.test(y)});throw Error("Browser's test function is not valid")});return g&&(this.parsedResult.os=g.describe(this.getUA())),this.parsedResult.os},f.getOSName=function(p){var g=this.getOS().name;return p?String(g).toLowerCase()||"":g||""},f.getOSVersion=function(){return this.getOS().version},f.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},f.getPlatformType=function(p){p===void 0&&(p=!1);var g=this.getPlatform().type;return p?String(g).toLowerCase()||"":g||""},f.parsePlatform=function(){var p=this;this.parsedResult.platform={};var g=a.default.find(i.default,function(m){if(typeof m.test=="function")return m.test(p);if(Array.isArray(m.test))return m.test.some(function(y){return p.test(y)});throw Error("Browser's test function is not valid")});return g&&(this.parsedResult.platform=g.describe(this.getUA())),this.parsedResult.platform},f.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},f.getEngineName=function(p){return p?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},f.parseEngine=function(){var p=this;this.parsedResult.engine={};var g=a.default.find(u.default,function(m){if(typeof m.test=="function")return m.test(p);if(Array.isArray(m.test))return m.test.some(function(y){return p.test(y)});throw Error("Browser's test function is not valid")});return g&&(this.parsedResult.engine=g.describe(this.getUA())),this.parsedResult.engine},f.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},f.getResult=function(){return a.default.assign({},this.parsedResult)},f.satisfies=function(p){var g=this,m={},y=0,S={},w=0;if(Object.keys(p).forEach(function(q){var j=p[q];typeof j=="string"?(S[q]=j,w+=1):typeof j=="object"&&(m[q]=j,y+=1)}),y>0){var E=Object.keys(m),A=a.default.find(E,function(q){return g.isOS(q)});if(A){var v=this.satisfies(m[A]);if(v!==void 0)return v}var L=a.default.find(E,function(q){return g.isPlatform(q)});if(L){var k=this.satisfies(m[L]);if(k!==void 0)return k}}if(w>0){var U=Object.keys(S),de=a.default.find(U,function(q){return g.isBrowser(q,!0)});if(de!==void 0)return this.compareVersion(S[de])}},f.isBrowser=function(p,g){g===void 0&&(g=!1);var m=this.getBrowserName().toLowerCase(),y=p.toLowerCase(),S=a.default.getBrowserTypeByAlias(y);return g&&S&&(y=S.toLowerCase()),y===m},f.compareVersion=function(p){var g=[0],m=p,y=!1,S=this.getBrowserVersion();if(typeof S=="string")return p[0]===">"||p[0]==="<"?(m=p.substr(1),p[1]==="="?(y=!0,m=p.substr(2)):g=[],p[0]===">"?g.push(1):g.push(-1)):p[0]==="="?m=p.substr(1):p[0]==="~"&&(y=!0,m=p.substr(1)),g.indexOf(a.default.compareVersions(S,m,y))>-1},f.isOS=function(p){return this.getOSName(!0)===String(p).toLowerCase()},f.isPlatform=function(p){return this.getPlatformType(!0)===String(p).toLowerCase()},f.isEngine=function(p){return this.getEngineName(!0)===String(p).toLowerCase()},f.is=function(p,g){return g===void 0&&(g=!1),this.isBrowser(p,g)||this.isOS(p)||this.isPlatform(p)},f.some=function(p){var g=this;return p===void 0&&(p=[]),p.some(function(m){return g.is(m)})},h}();r.default=l,t.exports=r.default},92:function(t,r,n){r.__esModule=!0,r.default=void 0;var s,o=(s=n(17))&&s.__esModule?s:{default:s},i=/version\/(\d+(\.?_?\d+)+)/i,u=[{test:[/gptbot/i],describe:function(a){var d={name:"GPTBot"},l=o.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/chatgpt-user/i],describe:function(a){var d={name:"ChatGPT-User"},l=o.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/oai-searchbot/i],describe:function(a){var d={name:"OAI-SearchBot"},l=o.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(a){var d={name:"ClaudeBot"},l=o.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(a){var d={name:"Omgilibot"},l=o.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/diffbot/i],describe:function(a){var d={name:"Diffbot"},l=o.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/perplexitybot/i],describe:function(a){var d={name:"PerplexityBot"},l=o.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/perplexity-user/i],describe:function(a){var d={name:"Perplexity-User"},l=o.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/youbot/i],describe:function(a){var d={name:"YouBot"},l=o.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/meta-webindexer/i],describe:function(a){var d={name:"Meta-WebIndexer"},l=o.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/meta-externalads/i],describe:function(a){var d={name:"Meta-ExternalAds"},l=o.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/meta-externalagent/i],describe:function(a){var d={name:"Meta-ExternalAgent"},l=o.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/meta-externalfetcher/i],describe:function(a){var d={name:"Meta-ExternalFetcher"},l=o.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/googlebot/i],describe:function(a){var d={name:"Googlebot"},l=o.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/linespider/i],describe:function(a){var d={name:"Linespider"},l=o.default.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/amazonbot/i],describe:function(a){var d={name:"AmazonBot"},l=o.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/bingbot/i],describe:function(a){var d={name:"BingCrawler"},l=o.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/baiduspider/i],describe:function(a){var d={name:"BaiduSpider"},l=o.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/duckduckbot/i],describe:function(a){var d={name:"DuckDuckBot"},l=o.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/ia_archiver/i],describe:function(a){var d={name:"InternetArchiveCrawler"},l=o.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{name:"FacebookExternalHit"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(a){var d={name:"SlackBot"},l=o.default.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe:function(){return{name:"PingdomBot"}}},{test:[/opera/i],describe:function(a){var d={name:"Opera"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/opr\/|opios/i],describe:function(a){var d={name:"Opera"},l=o.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/SamsungBrowser/i],describe:function(a){var d={name:"Samsung Internet for Android"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/Whale/i],describe:function(a){var d={name:"NAVER Whale Browser"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/PaleMoon/i],describe:function(a){var d={name:"Pale Moon"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/MZBrowser/i],describe:function(a){var d={name:"MZ Browser"},l=o.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/focus/i],describe:function(a){var d={name:"Focus"},l=o.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/swing/i],describe:function(a){var d={name:"Swing"},l=o.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/coast/i],describe:function(a){var d={name:"Opera Coast"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(a){var d={name:"Opera Touch"},l=o.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/yabrowser/i],describe:function(a){var d={name:"Yandex Browser"},l=o.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/ucbrowser/i],describe:function(a){var d={name:"UC Browser"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/Maxthon|mxios/i],describe:function(a){var d={name:"Maxthon"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/epiphany/i],describe:function(a){var d={name:"Epiphany"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/puffin/i],describe:function(a){var d={name:"Puffin"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/sleipnir/i],describe:function(a){var d={name:"Sleipnir"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/k-meleon/i],describe:function(a){var d={name:"K-Meleon"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/micromessenger/i],describe:function(a){var d={name:"WeChat"},l=o.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/qqbrowser/i],describe:function(a){var d={name:/qqbrowserlite/i.test(a)?"QQ Browser Lite":"QQ Browser"},l=o.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/msie|trident/i],describe:function(a){var d={name:"Internet Explorer"},l=o.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/\sedg\//i],describe:function(a){var d={name:"Microsoft Edge"},l=o.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/edg([ea]|ios)/i],describe:function(a){var d={name:"Microsoft Edge"},l=o.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/vivaldi/i],describe:function(a){var d={name:"Vivaldi"},l=o.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/seamonkey/i],describe:function(a){var d={name:"SeaMonkey"},l=o.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/sailfish/i],describe:function(a){var d={name:"Sailfish"},l=o.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,a);return l&&(d.version=l),d}},{test:[/silk/i],describe:function(a){var d={name:"Amazon Silk"},l=o.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/phantom/i],describe:function(a){var d={name:"PhantomJS"},l=o.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/slimerjs/i],describe:function(a){var d={name:"SlimerJS"},l=o.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(a){var d={name:"BlackBerry"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/(web|hpw)[o0]s/i],describe:function(a){var d={name:"WebOS Browser"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/bada/i],describe:function(a){var d={name:"Bada"},l=o.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/tizen/i],describe:function(a){var d={name:"Tizen"},l=o.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/qupzilla/i],describe:function(a){var d={name:"QupZilla"},l=o.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/librewolf/i],describe:function(a){var d={name:"LibreWolf"},l=o.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/firefox|iceweasel|fxios/i],describe:function(a){var d={name:"Firefox"},l=o.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/electron/i],describe:function(a){var d={name:"Electron"},l=o.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(a){var d={name:"Sogou Browser"},l=o.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,a),h=o.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,a),f=o.default.getFirstMatch(/se ([\d.]+)x/i,a),p=l||h||f;return p&&(d.version=p),d}},{test:[/MiuiBrowser/i],describe:function(a){var d={name:"Miui"},l=o.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:function(a){return!!a.hasBrand("DuckDuckGo")||a.test(/\sDdg\/[\d.]+$/i)},describe:function(a,d){var l={name:"DuckDuckGo"};if(d){var h=d.getBrandVersion("DuckDuckGo");if(h)return l.version=h,l}var f=o.default.getFirstMatch(/\sDdg\/([\d.]+)$/i,a);return f&&(l.version=f),l}},{test:function(a){return a.hasBrand("Brave")},describe:function(a,d){var l={name:"Brave"};if(d){var h=d.getBrandVersion("Brave");if(h)return l.version=h,l}return l}},{test:[/chromium/i],describe:function(a){var d={name:"Chromium"},l=o.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/chrome|crios|crmo/i],describe:function(a){var d={name:"Chrome"},l=o.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/GSA/i],describe:function(a){var d={name:"Google Search"},l=o.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:function(a){var d=!a.test(/like android/i),l=a.test(/android/i);return d&&l},describe:function(a){var d={name:"Android Browser"},l=o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/playstation 4/i],describe:function(a){var d={name:"PlayStation 4"},l=o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/safari|applewebkit/i],describe:function(a){var d={name:"Safari"},l=o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/.*/i],describe:function(a){var d=a.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:o.default.getFirstMatch(d,a),version:o.default.getSecondMatch(d,a)}}}];r.default=u,t.exports=r.default},93:function(t,r,n){r.__esModule=!0,r.default=void 0;var s,o=(s=n(17))&&s.__esModule?s:{default:s},i=n(18),u=[{test:[/Roku\/DVP/],describe:function(a){var d=o.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,a);return{name:i.OS_MAP.Roku,version:d}}},{test:[/windows phone/i],describe:function(a){var d=o.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.WindowsPhone,version:d}}},{test:[/windows /i],describe:function(a){var d=o.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,a),l=o.default.getWindowsVersionName(d);return{name:i.OS_MAP.Windows,version:d,versionName:l}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(a){var d={name:i.OS_MAP.iOS},l=o.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,a);return l&&(d.version=l),d}},{test:[/macintosh/i],describe:function(a){var d=o.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,a).replace(/[_\s]/g,"."),l=o.default.getMacOSVersionName(d),h={name:i.OS_MAP.MacOS,version:d};return l&&(h.versionName=l),h}},{test:[/(ipod|iphone|ipad)/i],describe:function(a){var d=o.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,a).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:d}}},{test:[/OpenHarmony/i],describe:function(a){var d=o.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.HarmonyOS,version:d}}},{test:function(a){var d=!a.test(/like android/i),l=a.test(/android/i);return d&&l},describe:function(a){var d=o.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,a),l=o.default.getAndroidVersionName(d),h={name:i.OS_MAP.Android,version:d};return l&&(h.versionName=l),h}},{test:[/(web|hpw)[o0]s/i],describe:function(a){var d=o.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,a),l={name:i.OS_MAP.WebOS};return d&&d.length&&(l.version=d),l}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(a){var d=o.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,a)||o.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,a)||o.default.getFirstMatch(/\bbb(\d+)/i,a);return{name:i.OS_MAP.BlackBerry,version:d}}},{test:[/bada/i],describe:function(a){var d=o.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.Bada,version:d}}},{test:[/tizen/i],describe:function(a){var d=o.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.Tizen,version:d}}},{test:[/linux/i],describe:function(){return{name:i.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:i.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(a){var d=o.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.PlayStation4,version:d}}}];r.default=u,t.exports=r.default},94:function(t,r,n){r.__esModule=!0,r.default=void 0;var s,o=(s=n(17))&&s.__esModule?s:{default:s},i=n(18),u=[{test:[/googlebot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/linespider/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Line"}}},{test:[/amazonbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Slack"}}},{test:[/yahoo/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe:function(a){var d=o.default.getFirstMatch(/(can-l01)/i,a)&&"Nova",l={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return d&&(l.model=d),l}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(a){var d=a.test(/ipod|iphone/i),l=a.test(/like (ipod|iphone)/i);return d&&!l},describe:function(a){var d=o.default.getFirstMatch(/(ipod|iphone)/i,a);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:d}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(a){var d=o.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,a),l={type:i.PLATFORMS_MAP.mobile,vendor:"Nokia"};return d&&(l.model=d),l}},{test:[/[^-]mobi/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(a){return a.getBrowserName(!0)==="blackberry"},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(a){return a.getBrowserName(!0)==="bada"},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(a){return a.getBrowserName()==="windows phone"},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(a){var d=Number(String(a.getOSVersion()).split(".")[0]);return a.getOSName(!0)==="android"&&d>=3},describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(a){return a.getOSName(!0)==="android"},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:[/smart-?tv|smarttv/i],describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:[/netcast/i],describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(a){return a.getOSName(!0)==="macos"},describe:function(){return{type:i.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(a){return a.getOSName(!0)==="windows"},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(a){return a.getOSName(!0)==="linux"},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(a){return a.getOSName(!0)==="playstation 4"},describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(a){return a.getOSName(!0)==="roku"},describe:function(){return{type:i.PLATFORMS_MAP.tv}}}];r.default=u,t.exports=r.default},95:function(t,r,n){r.__esModule=!0,r.default=void 0;var s,o=(s=n(17))&&s.__esModule?s:{default:s},i=n(18),u=[{test:function(a){return a.getBrowserName(!0)==="microsoft edge"},describe:function(a){if(/\sedg\//i.test(a))return{name:i.ENGINE_MAP.Blink};var d=o.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,a);return{name:i.ENGINE_MAP.EdgeHTML,version:d}}},{test:[/trident/i],describe:function(a){var d={name:i.ENGINE_MAP.Trident},l=o.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:function(a){return a.test(/presto/i)},describe:function(a){var d={name:i.ENGINE_MAP.Presto},l=o.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:function(a){var d=a.test(/gecko/i),l=a.test(/like gecko/i);return d&&!l},describe:function(a){var d={name:i.ENGINE_MAP.Gecko},l=o.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(a){var d={name:i.ENGINE_MAP.WebKit},l=o.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}}];r.default=u,t.exports=r.default}})})});var pe=e(function(lP){var{Retry:yO,RETRY_MODES:Qf}=lt(),{HttpRequest:ma,parseUrl:SO}=K(),{InvokeStore:Xf}=Df(),{normalizeProvider:wO}=et(),{platform:EO,release:bO}=c("node:os"),{versions:la,env:Yf}=c("node:process"),{isValidHostLabel:_O,isIpAddress:rh,customEndpointFunctions:AO}=Ye(),{EndpointError:xO,resolveEndpoint:TO}=Ye();lP.EndpointError=xO;lP.isIpAddress=rh;lP.resolveEndpoint=TO;var{loadConfig:CO,NODE_REGION_CONFIG_OPTIONS:nh,NODE_REGION_CONFIG_FILE_OPTIONS:sh}=W(),{REGION_ENV_NAME:IO,REGION_INI_NAME:RO,resolveRegionConfig:vO}=W();lP.NODE_REGION_CONFIG_FILE_OPTIONS=sh;lP.NODE_REGION_CONFIG_OPTIONS=nh;lP.REGION_ENV_NAME=IO;lP.REGION_INI_NAME=RO;lP.resolveRegionConfig=vO;var ms={warningEmitted:!1},NO=(t)=>{if(t&&!ms.warningEmitted){if(process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED==="true"){ms.warningEmitted=!0;return}let r=parseInt(t.substring(1,t.indexOf("."))),n=22;if(r<n)ms.warningEmitted=!0,process.emitWarning(`NodeVersionSupportWarning: The AWS SDK for JavaScript (v3)
19
+ versions published after the first week of January 2027
20
+ will require node >=${n}. You are running node ${t}.
21
+
22
+ To continue receiving updates to AWS services, bug fixes,
23
+ and security updates please upgrade to node >=${n}.
24
+
25
+ More information can be found at: https://a.co/c895JFp`)}},OO=()=>(t,r)=>async(n)=>(r.__retryLongPoll=!0,t(n)),PO={name:"longPollMiddleware",tags:["RETRY"],step:"initialize",override:!0},kO=(t)=>({applyToStack:(r)=>{r.add(OO(),PO)}});function MO(t,r,n){if(!t.$source)t.$source={};return t.$source[r]=n,t}yO.v2026||=typeof process==="object"&&process.env?.AWS_NEW_RETRIES_2026==="true";function Ue(t,r,n){if(!t.__aws_sdk_context)t.__aws_sdk_context={features:{}};else if(!t.__aws_sdk_context.features)t.__aws_sdk_context.features={};t.__aws_sdk_context.features[r]=n}function DO(t,r,n){if(!t.$source)t.$source={};return t.$source[r]=n,t}function FO(t){return t}var oh=(t)=>(r)=>async(n)=>{if(!ma.isInstance(n.request))return r(n);let{request:s}=n,{handlerProtocol:o=""}=t.requestHandler.metadata||{};if(o.indexOf("h2")>=0&&!s.headers[":authority"])delete s.headers.host,s.headers[":authority"]=s.hostname+(s.port?":"+s.port:"");else if(!s.headers.host){let i=s.hostname;if(s.port!=null)i+=`:${s.port}`;s.headers.host=i}return r(n)},ih={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},LO=(t)=>({applyToStack:(r)=>{r.add(oh(t),ih)}}),ah=()=>(t,r)=>async(n)=>{try{let s=await t(n),{clientName:o,commandName:i,logger:u,dynamoDbDocumentClientOptions:a={}}=r,{overrideInputFilterSensitiveLog:d,overrideOutputFilterSensitiveLog:l}=a,h=d??r.inputFilterSensitiveLog,f=l??r.outputFilterSensitiveLog,{$metadata:p,...g}=s.output;return u?.info?.({clientName:o,commandName:i,input:h(n.input),output:f(g),metadata:p}),s}catch(s){let{clientName:o,commandName:i,logger:u,dynamoDbDocumentClientOptions:a={}}=r,{overrideInputFilterSensitiveLog:d}=a,l=d??r.inputFilterSensitiveLog;throw u?.error?.({clientName:o,commandName:i,input:l(n.input),error:s,metadata:s.$metadata}),s}},ch={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},UO=(t)=>({applyToStack:(r)=>{r.add(ah(),ch)}}),uh={step:"build",tags:["RECURSION_DETECTION","TRACE_CONTEXT_PROPAGATION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},$O="AWS_LAMBDA_FUNCTION_NAME",BO="_X_AMZN_TRACE_ID",fa="X-Amzn-Trace-Id",ga="traceparent",dh="tracestate",lh="baggage",fh=()=>(t)=>async(r)=>{let{request:n}=r;if(!ma.isInstance(n))return t(r);let s;{let o=Object.keys(n.headers??{}).find((i)=>i.toLowerCase()===fa.toLowerCase())??fa;if(!n.headers.hasOwnProperty(o)){let i=process.env[$O],u=process.env[BO];s??=await Xf.getInstanceAsync();let d=s?.getXRayTraceId()??u,l=(h)=>typeof h==="string"&&h.length>0;if(l(i)&&l(d))n.headers[fa]=d}}if(HO(n.headers),!n.headers[ga]){let i=(s??=await Xf.getInstanceAsync())?.getTraceparent?.();if(i){n.headers[ga]=i;let u=s?.getTracestate?.();if(u)n.headers[dh]=u;let a=s?.getBaggage?.();if(a)n.headers[lh]=a}}return t(r)};function HO(t){for(let r of Object.keys(t)){let n=r.toLowerCase();if(r!==n&&(n===ga||n===dh||n===lh))t[n]=t[r],delete t[r]}}var zO=(t)=>({applyToStack:(r)=>{r.add(fh(),uh)}}),ya=void 0;function qO(t){if(t===void 0)return!0;return typeof t==="string"&&t.length<=50}function VO(t){let r=wO(t.userAgentAppId??ya),{customUserAgent:n}=t;return Object.assign(t,{customUserAgent:typeof n==="string"?[[n]]:n,userAgentAppId:async()=>{let s=await r();if(!qO(s)){let o=t.logger?.constructor?.name==="NoOpLogger"||!t.logger?console:t.logger;if(typeof s!=="string")o?.warn("userAgentAppId must be a string or undefined.");else if(s.length>50)o?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return s}})}var hh={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],version:"1.1"},ph=hh,gh="",mh=(t)=>{let{partitions:r}=ph;for(let s of r){let{regions:o,outputs:i}=s;for(let[u,a]of Object.entries(o))if(u===t)return{...i,...a}}for(let s of r){let{regionRegex:o,outputs:i}=s;if(new RegExp(o).test(t))return{...i}}let n=r.find((s)=>s.id==="aws");if(!n)throw Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}},yh=(t,r="")=>{ph=t,gh=r},jO=()=>{yh(hh,"")},Sh=()=>gh,WO=/\d{12}\.ddb/;async function GO(t,r,n){if(n.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor")Ue(t,"PROTOCOL_RPC_V2_CBOR","M");if(typeof r.retryStrategy==="function"){let i=await r.retryStrategy();if(typeof i.mode==="string")switch(i.mode){case Qf.ADAPTIVE:Ue(t,"RETRY_MODE_ADAPTIVE","F");break;case Qf.STANDARD:Ue(t,"RETRY_MODE_STANDARD","E");break}}if(typeof r.accountIdEndpointMode==="function"){let i=t.endpointV2;if(String(i?.url?.hostname).match(WO))Ue(t,"ACCOUNT_ID_ENDPOINT","O");switch(await r.accountIdEndpointMode?.()){case"disabled":Ue(t,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":Ue(t,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":Ue(t,"ACCOUNT_ID_MODE_REQUIRED","R");break}}let o=t.__smithy_context?.selectedHttpAuthScheme?.identity;if(o?.$source){let i=o;if(i.accountId)Ue(t,"RESOLVED_ACCOUNT_ID","T");for(let[u,a]of Object.entries(i.$source??{}))Ue(t,u,a)}}var Jf="user-agent",ha="x-amz-user-agent",Zf=" ",pa="/",KO=/[^!$%&'*+\-.^_`|~\w]/g,QO=/[^!$%&'*+\-.^_`|~\w#]/g,eh="-",XO=1024;function YO(t){let r="";for(let n in t){let s=t[n];if(r.length+s.length+1<=XO){if(r.length)r+=","+s;else r+=s;continue}break}return r}var wh=(t)=>(r,n)=>async(s)=>{let{request:o}=s;if(!ma.isInstance(o))return r(s);let{headers:i}=o,u=n?.userAgent?.map(gs)||[],a=(await t.defaultUserAgentProvider()).map(gs);await GO(n,t,s);let d=n;a.push(`m/${YO(Object.assign({},n.__smithy_context?.features,d.__aws_sdk_context?.features))}`);let l=t?.customUserAgent?.map(gs)||[],h=await t.userAgentAppId();if(h)a.push(gs(["app",`${h}`]));let f=Sh(),p=(f?[f]:[]).concat([...a,...u,...l]).join(Zf),g=[...a.filter((m)=>m.startsWith("aws-sdk-")),...l].join(Zf);if(t.runtime!=="browser"){if(g)i[ha]=i[ha]?`${i[Jf]} ${g}`:g;i[Jf]=p}else i[ha]=p;return r({...s,request:o})},gs=(t)=>{let r=t[0].split(pa).map((u)=>u.replace(KO,eh)).join(pa),n=t[1]?.replace(QO,eh),s=r.indexOf(pa),o=r.substring(0,s),i=r.substring(s+1);if(o==="api")i=i.toLowerCase();return[o,i,n].filter((u)=>u&&u.length>0).reduce((u,a,d)=>{switch(d){case 0:return a;case 1:return`${u}/${a}`;default:return`${u}#${a}`}},"")},Eh={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},JO=(t)=>({applyToStack:(r)=>{r.add(wh(t),Eh)}}),ZO=()=>{let t=["deno","bun","llrt"];for(let r of t)if(la[r])return[`md/${r}`,la[r]];return["md/nodejs",la.node]},bh={isCrtAvailable:!1},eP=()=>{if(bh.isCrtAvailable)return["md/crt-avail"];return null},_h=({serviceId:t,clientVersion:r})=>{let n=ZO();return async(s)=>{let o=[["aws-sdk-js",r],["ua","2.1"],[`os/${EO()}`,bO()],["lang/js"],n],i=eP();if(i)o.push(i);if(t)o.push([`api/${t}`,r]);if(Yf.AWS_EXECUTION_ENV)o.push([`exec-env/${Yf.AWS_EXECUTION_ENV}`]);let u=await s?.userAgentAppId?.();return u?[...o,[`app/${u}`]]:[...o]}},tP=_h,Ah="AWS_SDK_UA_APP_ID",xh="sdk_ua_app_id",rP="sdk-ua-app-id",nP={environmentVariableSelector:(t)=>t[Ah],configFileSelector:(t)=>t[xh]??t[rP],default:ya},sP=({serviceId:t,clientVersion:r})=>async(n)=>{let s=Kf(),o=s.parse??s.default.parse??(()=>""),i=typeof window<"u"&&window?.navigator?.userAgent?o(window.navigator.userAgent):void 0,u=[["aws-sdk-js",r],["ua","2.1"],[`os/${i?.os?.name||"other"}`,i?.os?.version],["lang/js"],["md/browser",`${i?.browser?.name??"unknown"}_${i?.browser?.version??"unknown"}`]];if(t)u.push([`api/${t}`,r]);let a=await n?.userAgentAppId?.();if(a)u.push([`app/${a}`]);return u},oP={os(t){if(/iPhone|iPad|iPod/.test(t))return"iOS";if(/Macintosh|Mac OS X/.test(t))return"macOS";if(/Windows NT/.test(t))return"Windows";if(/Android/.test(t))return"Android";if(/Linux/.test(t))return"Linux";return},browser(t){if(/EdgiOS|EdgA|Edg\//.test(t))return"Microsoft Edge";if(/Firefox\//.test(t))return"Firefox";if(/Chrome\//.test(t))return"Chrome";if(/Safari\//.test(t))return"Safari";return}},Sa=(t,r=!1)=>{if(r){for(let n of t.split("."))if(!Sa(n))return!1;return!0}if(!_O(t))return!1;if(t.length<3||t.length>63)return!1;if(t!==t.toLowerCase())return!1;if(rh(t))return!1;return!0},th=":",iP="/",Th=(t)=>{let r=t.split(th);if(r.length<6)return null;let[n,s,o,i,u,...a]=r;if(n!=="arn"||s===""||o===""||a.join(th)==="")return null;let d=a.map((l)=>l.split(iP)).flat();return{partition:s,service:o,region:i,accountId:u,resourceId:d}},Ch={isVirtualHostableS3Bucket:Sa,parseArn:Th,partition:mh};AO.aws=Ch;var aP=(t)=>{if(typeof t.endpointProvider!=="function")throw Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client.");let{endpoint:r}=t;if(r===void 0)t.endpoint=async()=>Ih(t.endpointProvider({Region:typeof t.region==="function"?await t.region():t.region,UseDualStack:typeof t.useDualstackEndpoint==="function"?await t.useDualstackEndpoint():t.useDualstackEndpoint,UseFIPS:typeof t.useFipsEndpoint==="function"?await t.useFipsEndpoint():t.useFipsEndpoint,Endpoint:void 0},{logger:t.logger}));return t},Ih=(t)=>SO(t.url);function cP(t={}){return CO({...nh,async default(){if(!Rh.silence)console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly.");return"us-east-1"}},{...sh,...t})}var Rh={silence:!1},uP=(t)=>({setRegion(r){t.region=r},region(){return t.region}}),dP=(t)=>({region:t.region()});lP.DEFAULT_UA_APP_ID=ya;lP.NODE_APP_ID_CONFIG_OPTIONS=nP;lP.UA_APP_ID_ENV_NAME=Ah;lP.UA_APP_ID_INI_NAME=xh;lP.awsEndpointFunctions=Ch;lP.createDefaultUserAgentProvider=_h;lP.createUserAgentStringParsingProvider=sP;lP.crtAvailability=bh;lP.defaultUserAgent=tP;lP.emitWarningIfUnsupportedVersion=NO;lP.fallback=oP;lP.getAwsRegionExtensionConfiguration=uP;lP.getHostHeaderPlugin=LO;lP.getLoggerPlugin=UO;lP.getLongPollPlugin=kO;lP.getRecursionDetectionPlugin=zO;lP.getUserAgentMiddlewareOptions=Eh;lP.getUserAgentPlugin=JO;lP.getUserAgentPrefix=Sh;lP.hostHeaderMiddleware=oh;lP.hostHeaderMiddlewareOptions=ih;lP.isVirtualHostableS3Bucket=Sa;lP.loggerMiddleware=ah;lP.loggerMiddlewareOptions=ch;lP.parseArn=Th;lP.partition=mh;lP.recursionDetectionMiddleware=fh;lP.recursionDetectionMiddlewareOptions=uh;lP.resolveAwsRegionExtensionConfiguration=dP;lP.resolveDefaultAwsRegionalEndpointsConfig=aP;lP.resolveHostHeaderConfig=FO;lP.resolveUserAgentConfig=VO;lP.setCredentialFeature=MO;lP.setFeature=Ue;lP.setPartitionInfo=yh;lP.setTokenFeature=DO;lP.state=ms;lP.stsRegionDefaultResolver=cP;lP.stsRegionWarning=Rh;lP.toEndpointV1=Ih;lP.useDefaultPartitionInfo=jO;lP.userAgentMiddleware=wh});var ZA=e(function(dk){var{HttpRequest:vh}=K();function ck(t){let{signer:r,signer:n}=t,s=Object.assign(t,{eventSigner:r,messageSigner:n}),o=s.eventStreamPayloadHandlerProvider(s);return Object.assign(s,{eventStreamPayloadHandler:o})}var Nh=(t)=>(r,n)=>async(s)=>{let{request:o}=s;if(!vh.isInstance(o))return r(s);return t.eventStreamPayloadHandler.handle(r,s,n)},Oh={tags:["EVENT_STREAM","SIGNATURE","HANDLE"],name:"eventStreamHandlingMiddleware",relation:"after",toMiddleware:"awsAuthMiddleware",override:!0},Ph=(t)=>async(r)=>{let{request:n}=r;if(!vh.isInstance(n))return t(r);return n.headers={...n.headers,"content-type":"application/vnd.amazon.eventstream","x-amz-content-sha256":"STREAMING-AWS4-HMAC-SHA256-EVENTS"},t({...r,request:n})},kh={step:"build",tags:["EVENT_STREAM","HEADER","CONTENT_TYPE","CONTENT_SHA256"],name:"eventStreamHeaderMiddleware",override:!0},uk=(t)=>({applyToStack:(r)=>{r.addRelativeTo(Nh(t),Oh),r.add(Ph,kh)}});dk.eventStreamHandlingMiddleware=Nh;dk.eventStreamHandlingMiddlewareOptions=Oh;dk.eventStreamHeaderMiddleware=Ph;dk.eventStreamHeaderMiddlewareOptions=kh;dk.getEventStreamPlugin=uk;dk.resolveEventStreamConfig=ck});var va=e(function(Rk){var{hasOwn:dr,fromUtf8:Mh,fromHex:yk,toHex:kt,toUint8Array:rn,isArrayBuffer:Sk}=ee(),{normalizeProvider:Dh}=Ie(),{escapeUri:ys,HttpRequest:$h}=K();class Bh{format(t){let r=[];for(let o in t){if(!dr(t,o))continue;let i=Mh(o);r.push(Uint8Array.from([i.byteLength]),i,this.formatHeaderValue(t[o]))}let n=new Uint8Array(r.reduce((o,i)=>o+i.byteLength,0)),s=0;for(let o of r)n.set(o,s),s+=o.byteLength;return n}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":let r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,t.value,!1),new Uint8Array(r.buffer);case"integer":let n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,t.value,!1),new Uint8Array(n.buffer);case"long":let s=new Uint8Array(9);return s[0]=5,s.set(t.value.bytes,1),s;case"binary":let o=new DataView(new ArrayBuffer(3+t.value.byteLength));o.setUint8(0,6),o.setUint16(1,t.value.byteLength,!1);let i=new Uint8Array(o.buffer);return i.set(t.value,3),i;case"string":let u=Mh(t.value),a=new DataView(new ArrayBuffer(3+u.byteLength));a.setUint8(0,7),a.setUint16(1,u.byteLength,!1);let d=new Uint8Array(a.buffer);return d.set(u,3),d;case"timestamp":let l=new Uint8Array(9);return l[0]=8,l.set(ba.fromNumber(t.value.valueOf()).bytes,1),l;case"uuid":if(!wk.test(t.value))throw Error(`Invalid UUID received: ${t.value}`);let h=new Uint8Array(17);return h[0]=9,h.set(yk(t.value.replace(/-/g,"")),1),h}}}var Fh;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(Fh||(Fh={}));var wk=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class ba{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776000||t<-9223372036854776000)throw Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(t));n>-1&&s>0;n--,s/=256)r[n]=s;if(t<0)Lh(r);return new ba(r)}valueOf(){let t=this.bytes.slice(0),r=t[0]&128;if(r)Lh(t);return parseInt(kt(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function Lh(t){for(let r=0;r<8;r++)t[r]^=255;for(let r=7;r>-1;r--)if(t[r]++,t[r]!==0)break}var Hh="X-Amz-Algorithm",zh="X-Amz-Credential",_a="X-Amz-Date",qh="X-Amz-SignedHeaders",Vh="X-Amz-Expires",Aa="X-Amz-Signature",xa="X-Amz-Security-Token",Ek="X-Amz-Region-Set",Ta="authorization",Ca=_a.toLowerCase(),jh="date",Wh=[Ta,Ca,jh],Gh=Aa.toLowerCase(),_s="x-amz-content-sha256",Kh=xa.toLowerCase(),bk="host",Qh={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Xh=/^proxy-/,Yh=/^sec-/,_k=[/^proxy-/i,/^sec-/i],Ss="AWS4-HMAC-SHA256",Ak="AWS4-ECDSA-P256-SHA256",Jh="AWS4-HMAC-SHA256-PAYLOAD",Zh="UNSIGNED-PAYLOAD",ep=50,Ia="aws4_request",tp=604800,rp=({query:t={}})=>{let r=[],n={};for(let s in t){if(!dr(t,s))continue;if(s.toLowerCase()===Gh)continue;let o=ys(s);r.push(o);let i=t[s];if(typeof i==="string")n[o]=`${o}=${ys(i)}`;else if(Array.isArray(i))n[o]=i.slice(0).reduce((u,a)=>u.concat([`${o}=${ys(a)}`]),[]).sort().join("&")}return r.sort().map((s)=>n[s]).filter((s)=>s).join("&")},xk=(t)=>Tk(t).toISOString().replace(/\.\d{3}Z$/,"Z"),Tk=(t)=>{if(typeof t==="number")return new Date(t*1000);if(typeof t==="string"){if(Number(t))return new Date(Number(t)*1000);return new Date(t)}return t};class Ra{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:t,credentials:r,region:n,service:s,sha256:o,uriEscapePath:i=!0}){this.service=s,this.sha256=o,this.uriEscapePath=i,this.applyChecksum=typeof t==="boolean"?t:!0,this.regionProvider=Dh(n),this.credentialProvider=Dh(r)}createCanonicalRequest(t,r,n){let s=Object.keys(r).sort();return`${t.method}
26
+ ${this.getCanonicalPath(t)}
27
+ ${rp(t)}
28
+ ${s.map((o)=>`${o}:${r[o]}`).join(`
29
+ `)}
30
+
31
+ ${s.join(";")}
32
+ ${n}`}async createStringToSign(t,r,n,s){let o=new this.sha256;o.update(rn(n));let i=await o.digest();return`${s}
33
+ ${t}
34
+ ${r}
35
+ ${kt(i)}`}getCanonicalPath({path:t}){if(this.uriEscapePath){let r=[];for(let o of t.split("/")){if(o?.length===0)continue;if(o===".")continue;if(o==="..")r.pop();else r.push(o)}let n=`${t?.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&t?.endsWith("/")?"/":""}`;return ys(n).replace(/%2F/g,"/")}return t}validateResolvedCredentials(t){if(typeof t!=="object"||typeof t.accessKeyId!=="string"||typeof t.secretAccessKey!=="string")throw Error("Resolved credential object is not valid")}formatDate(t){let r=xk(t).replace(/[-:]/g,"");return{longDate:r,shortDate:r.slice(0,8)}}getCanonicalHeaderList(t){return Object.keys(t).sort().join(";")}}var ur={},ws=[],Es=(t,r,n)=>`${t}/${r}/${n}/${Ia}`,np=async(t,r,n,s,o)=>{let i=await Uh(t,r.secretAccessKey,r.accessKeyId),u=`${n}:${s}:${o}:${kt(i)}:${r.sessionToken}`;if(u in ur)return ur[u];ws.push(u);while(ws.length>ep)delete ur[ws.shift()];let a=`AWS4${r.secretAccessKey}`;for(let d of[n,s,o,Ia])a=await Uh(t,a,d);return ur[u]=a},Ck=()=>{ws.length=0,Object.keys(ur).forEach((t)=>{delete ur[t]})},Uh=(t,r,n)=>{let s=new t(r);return s.update(rn(n)),s.digest()},wa=({headers:t},r,n)=>{let s={};for(let o of Object.keys(t).sort()){if(t[o]==null)continue;let i=o.toLowerCase();if(i in Qh||r?.has(i)||Xh.test(i)||Yh.test(i)){if(!n||n&&!n.has(i))continue}s[i]=t[o].replace(/[\r\n]/g," ").replace(/[ \t]+/g," ").replace(/^ | $/g,"")}return s},bs=async({headers:t,body:r},n)=>{for(let s in t){if(!dr(t,s))continue;if(s.toLowerCase()===_s)return t[s]}if(r==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof r==="string"||ArrayBuffer.isView(r)||Sk(r)){let s=new n;return s.update(rn(r)),kt(await s.digest())}return Zh},sp=(t,r)=>{t=t.toLowerCase();for(let n in r){if(!dr(r,n))continue;if(t===n.toLowerCase())return!0}return!1},op=(t,r={})=>{let{headers:n,query:s={}}=$h.clone(t);for(let o in n){if(!dr(n,o))continue;let i=o.toLowerCase();if(i.slice(0,6)==="x-amz-"&&!r.unhoistableHeaders?.has(i)||r.hoistableHeaders?.has(i))s[o]=n[o],delete n[o]}return{...t,headers:n,query:s}},Ea=(t)=>{t=$h.clone(t);for(let r in t.headers){if(!dr(t.headers,r))continue;if(Wh.indexOf(r.toLowerCase())>-1)delete t.headers[r]}return t};class ip extends Ra{headerFormatter=new Bh;constructor({applyChecksum:t,credentials:r,region:n,service:s,sha256:o,uriEscapePath:i=!0}){super({applyChecksum:t,credentials:r,region:n,service:s,sha256:o,uriEscapePath:i})}async presign(t,r={}){let{signingDate:n=new Date,expiresIn:s=3600,unsignableHeaders:o,unhoistableHeaders:i,signableHeaders:u,hoistableHeaders:a,signingRegion:d,signingService:l}=r,h=await this.credentialProvider();this.validateResolvedCredentials(h);let f=d??await this.regionProvider(),{longDate:p,shortDate:g}=this.formatDate(n);if(s>tp)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");let m=Es(g,f,l??this.service),y=op(Ea(t),{unhoistableHeaders:i,hoistableHeaders:a});if(h.sessionToken)y.query[xa]=h.sessionToken;y.query[Hh]=Ss,y.query[zh]=`${h.accessKeyId}/${m}`,y.query[_a]=p,y.query[Vh]=s.toString(10);let S=wa(y,o,u);return y.query[qh]=this.getCanonicalHeaderList(S),y.query[Aa]=await this.getSignature(p,m,this.getSigningKey(h,f,g,l),this.createCanonicalRequest(y,S,await bs(t,this.sha256))),y}async sign(t,r){if(typeof t==="string")return this.signString(t,r);else if(t.headers&&t.payload)return this.signEvent(t,r);else if(t.message)return this.signMessage(t,r);else return this.signRequest(t,r)}async signEvent({headers:t,payload:r},{signingDate:n=new Date,priorSignature:s,signingRegion:o,signingService:i,eventStreamCredentials:u}){let a=o??await this.regionProvider(),{shortDate:d,longDate:l}=this.formatDate(n),h=Es(d,a,i??this.service),f=await bs({headers:{},body:r},this.sha256),p=new this.sha256;p.update(t);let g=kt(await p.digest()),m=[Jh,l,h,s,g,f].join(`
36
+ `);return this.signString(m,{signingDate:n,signingRegion:a,signingService:i,eventStreamCredentials:u})}async signMessage(t,{signingDate:r=new Date,signingRegion:n,signingService:s,eventStreamCredentials:o}){return this.signEvent({headers:this.headerFormatter.format(t.message.headers),payload:t.message.body},{signingDate:r,signingRegion:n,signingService:s,priorSignature:t.priorSignature,eventStreamCredentials:o}).then((u)=>({message:t.message,signature:u}))}async signString(t,{signingDate:r=new Date,signingRegion:n,signingService:s,eventStreamCredentials:o}={}){let i=o??await this.credentialProvider();this.validateResolvedCredentials(i);let u=n??await this.regionProvider(),{shortDate:a}=this.formatDate(r),d=new this.sha256(await this.getSigningKey(i,u,a,s));return d.update(rn(t)),kt(await d.digest())}async signRequest(t,{signingDate:r=new Date,signableHeaders:n,unsignableHeaders:s,signingRegion:o,signingService:i}={}){let u=await this.credentialProvider();this.validateResolvedCredentials(u);let a=o??await this.regionProvider(),d=Ea(t),{longDate:l,shortDate:h}=this.formatDate(r),f=Es(h,a,i??this.service);if(d.headers[Ca]=l,u.sessionToken)d.headers[Kh]=u.sessionToken;let p=await bs(d,this.sha256);if(!sp(_s,d.headers)&&this.applyChecksum)d.headers[_s]=p;let g=wa(d,s,n),m=await this.getSignature(l,f,this.getSigningKey(u,a,h,i),this.createCanonicalRequest(d,g,p));return d.headers[Ta]=`${Ss} Credential=${u.accessKeyId}/${f}, SignedHeaders=${this.getCanonicalHeaderList(g)}, Signature=${m}`,d}async getSignature(t,r,n,s){let o=await this.createStringToSign(t,r,s,Ss),i=new this.sha256(await n);return i.update(rn(o)),kt(await i.digest())}getSigningKey(t,r,n,s){return np(this.sha256,t,n,r,s||this.service)}}var Ik={SignatureV4a:null};Rk.ALGORITHM_IDENTIFIER=Ss;Rk.ALGORITHM_IDENTIFIER_V4A=Ak;Rk.ALGORITHM_QUERY_PARAM=Hh;Rk.ALWAYS_UNSIGNABLE_HEADERS=Qh;Rk.AMZ_DATE_HEADER=Ca;Rk.AMZ_DATE_QUERY_PARAM=_a;Rk.AUTH_HEADER=Ta;Rk.CREDENTIAL_QUERY_PARAM=zh;Rk.DATE_HEADER=jh;Rk.EVENT_ALGORITHM_IDENTIFIER=Jh;Rk.EXPIRES_QUERY_PARAM=Vh;Rk.GENERATED_HEADERS=Wh;Rk.HOST_HEADER=bk;Rk.KEY_TYPE_IDENTIFIER=Ia;Rk.MAX_CACHE_SIZE=ep;Rk.MAX_PRESIGNED_TTL=tp;Rk.PROXY_HEADER_PATTERN=Xh;Rk.REGION_SET_PARAM=Ek;Rk.SEC_HEADER_PATTERN=Yh;Rk.SHA256_HEADER=_s;Rk.SIGNATURE_HEADER=Gh;Rk.SIGNATURE_QUERY_PARAM=Aa;Rk.SIGNED_HEADERS_QUERY_PARAM=qh;Rk.SignatureV4=ip;Rk.SignatureV4Base=Ra;Rk.TOKEN_HEADER=Kh;Rk.TOKEN_QUERY_PARAM=xa;Rk.UNSIGNABLE_PATTERNS=_k;Rk.UNSIGNED_PAYLOAD=Zh;Rk.clearCredentialCache=Ck;Rk.createScope=Es;Rk.getCanonicalHeaders=wa;Rk.getCanonicalQuery=rp;Rk.getPayloadHash=bs;Rk.getSigningKey=np;Rk.hasHeader=sp;Rk.moveHeadersToQuery=op;Rk.prepareRequest=Ea;Rk.signatureV4aContainer=Ik});var tt=e(function(O1){var{ProviderError:ap,booleanSelector:cp,SelectorType:up,loadConfig:p1}=W(),{setCredentialFeature:g1}=pe(),{normalizeProvider:lr,memoizeIdentityProvider:m1,isIdentityExpired:y1,doesIdentityRequireRefresh:S1}=et(),{SignatureV4:dp}=va(),{HttpResponse:yp,HttpRequest:Sp}=K(),lp=(t)=>yp.isInstance(t)?t.headers?.date??t.headers?.Date:void 0,fp=(t)=>yp.isInstance(t)?t.headers?.age??t.headers?.Age:void 0,wp=(t)=>new Date(Date.now()+t),hp=(t,r,n,s)=>{if(s!==void 0)return r;let o=Date.parse(t),i=Date.now();if(n!==void 0&&i-n>900000)return r;return n!==void 0?o-(n+i)/2:o-i},nn=(t,r)=>{if(!r)throw Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);return r},Na=async(t)=>{let r=nn("context",t.context),n=nn("config",t.config),s=r.endpointV2?.properties?.authSchemes?.[0],i=await nn("signer",n.signer)(s),u=t?.signingRegion,a=t?.signingRegionSet,d=t?.signingName;return{config:n,signer:i,signingRegion:u,signingRegionSet:a,signingName:d}};class As{async sign(t,r,n){if(!Sp.isInstance(t))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let s=await Na(n),{config:o,signer:i}=s,{signingRegion:u,signingName:a}=s,d=n.context;if(d?.authSchemes?.length??!1){let[f,p]=d.authSchemes;if(f?.name==="sigv4a"&&p?.name==="sigv4")u=p?.signingRegion??u,a=p?.signingName??a}let l=await o.disableClockSkewCorrection?.()===!0;if(n._disableClockSkewCorrection=l,!l)n._preRequestSystemClockOffset=o.systemClockOffset,n._requestSentAt=Date.now();return await i.sign(t,{signingDate:l?new Date:wp(o.systemClockOffset),signingRegion:u,signingService:a})}errorHandler(t){return(r)=>{let n=r;if(!t._disableClockSkewCorrection){let s=n.ServerTime??lp(n.$response);if(s){let o=nn("config",t.config),{_preRequestSystemClockOffset:i,_requestSentAt:u}=t,a=fp(n.$response),d=hp(s,o.systemClockOffset,u,a);if(o.systemClockOffset=d,Math.abs(d)>=240000&&(d!==i||i!==void 0&&i!==d)&&n.$metadata)n.$metadata.clockSkewCorrected=!0}}throw r}}successHandler(t,r){if(r._disableClockSkewCorrection)return;let n=lp(t);if(n){let s=nn("config",r.config),o=r._requestSentAt,i=fp(t);s.systemClockOffset=hp(n,s.systemClockOffset,o,i)}}}var w1=As;class Ep extends As{async sign(t,r,n){if(!Sp.isInstance(t))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let{config:s,signer:o,signingRegion:i,signingRegionSet:u,signingName:a}=await Na(n),l=(await s.sigv4aSigningRegionSet?.()??u??[i]).join(","),h=await s.disableClockSkewCorrection?.()===!0;if(n._disableClockSkewCorrection=h,!h)n._preRequestSystemClockOffset=s.systemClockOffset,n._requestSentAt=Date.now();return await o.sign(t,{signingDate:h?new Date:wp(s.systemClockOffset),signingRegion:l,signingService:a})}}var pp=(t)=>typeof t==="string"&&t.length>0?t.split(",").map((r)=>r.trim()):[],bp=(t)=>`AWS_BEARER_TOKEN_${t.replace(/[\s-]/g,"_").toUpperCase()}`,gp="AWS_AUTH_SCHEME_PREFERENCE",mp="auth_scheme_preference",E1={environmentVariableSelector:(t,r)=>{if(r?.signingName){if(bp(r.signingName)in t)return["httpBearerAuth"]}if(!(gp in t))return;return pp(t[gp])},configFileSelector:(t)=>{if(!(mp in t))return;return pp(t[mp])},default:[]},b1=(t)=>(t.sigv4aSigningRegionSet=lr(t.sigv4aSigningRegionSet),t),_1={environmentVariableSelector(t){if(t.AWS_SIGV4A_SIGNING_REGION_SET)return t.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((r)=>r.trim());throw new ap("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector(t){if(t.sigv4a_signing_region_set)return(t.sigv4a_signing_region_set??"").split(",").map((r)=>r.trim());throw new ap("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},A1=(t)=>(r)=>{let n=r.credentials,s=!!r.credentials,o=void 0;Object.defineProperty(r,"credentials",{set(h){if(h&&h!==n&&h!==o)s=!0;n=h;let f=x1(r,{credentials:n,credentialDefaultProvider:r.credentialDefaultProvider}),p=T1(r,f);if(s&&!p.attributed){let g=typeof n==="object"&&n!==null;o=async(m)=>{let S=await p(m);if(g&&(!S.$source||Object.keys(S.$source).length===0))return g1(S,"CREDENTIALS_CODE","e");return S},o.memoized=p.memoized,o.configBound=p.configBound,o.attributed=!0}else o=p},get(){return o},enumerable:!0,configurable:!0}),r.credentials=n;let{signingEscapePath:i=!0,systemClockOffset:u=r.systemClockOffset||0,sha256:a}=r,d;if(r.signer)d=lr(r.signer);else if(r.regionInfoProvider)d=()=>lr(r.region)().then(async(h)=>[await r.regionInfoProvider(h,{useFipsEndpoint:await r.useFipsEndpoint(),useDualstackEndpoint:await r.useDualstackEndpoint()})||{},h]).then(([h,f])=>{let{signingRegion:p,signingService:g}=h;r.signingRegion=r.signingRegion||p||f,r.signingName=r.signingName||g||r.serviceId;let m={...r,credentials:r.credentials,region:r.signingRegion,service:r.signingName,sha256:a,uriEscapePath:i};return new(r.signerConstructor||dp)(m)});else d=async(h)=>{h=Object.assign({},{name:"sigv4",signingName:r.signingName||r.defaultSigningName,signingRegion:await lr(r.region)(),properties:{}},h);let f=h.signingRegion,p=h.signingName;r.signingRegion=r.signingRegion||f,r.signingName=r.signingName||p||r.serviceId;let g={...r,credentials:r.credentials,region:r.signingRegion,service:r.signingName,sha256:a,uriEscapePath:i};return new(r.signerConstructor||dp)(g)};return Object.assign(r,{systemClockOffset:u,signingEscapePath:i,signer:d,disableClockSkewCorrection:lr(r.disableClockSkewCorrection??t)})};function x1(t,{credentials:r,credentialDefaultProvider:n}){let s;if(r)if(!r?.memoized)s=m1(r,y1,S1);else s=r;else if(n)s=lr(n(Object.assign({},t,{parentClientConfig:t})));else s=async()=>{throw Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")};return s.memoized=!0,s}function T1(t,r){if(r.configBound)return r;let n=async(s)=>r({...s,callerClientConfig:t});return n.memoized=r.memoized,n.configBound=!0,n}var C1="AWS_DISABLE_CLOCK_SKEW_CORRECTION",I1="disable_clock_skew_correction",R1={environmentVariableSelector:(t)=>cp(t,C1,up.ENV),configFileSelector:(t)=>cp(t,I1,up.CONFIG),default:!1},v1=p1(R1),_p=A1(v1),N1=_p;O1.AWSSDKSigV4Signer=w1;O1.AwsSdkSigV4ASigner=Ep;O1.AwsSdkSigV4Signer=As;O1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS=E1;O1.NODE_SIGV4A_CONFIG_OPTIONS=_1;O1.getBearerTokenEnvKey=bp;O1.resolveAWSSDKSigV4Config=N1;O1.resolveAwsSdkSigV4AConfig=b1;O1.resolveAwsSdkSigV4Config=_p;O1.validateSigningProperties=Na});var Oa=e(function(j1){var{setCredentialFeature:z1}=pe(),{CredentialsProviderError:q1}=W(),V1=(t)=>async()=>{t?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let r=process.env.AWS_ACCESS_KEY_ID,n=process.env.AWS_SECRET_ACCESS_KEY,s=process.env.AWS_SESSION_TOKEN,o=process.env.AWS_CREDENTIAL_EXPIRATION,i=process.env.AWS_CREDENTIAL_SCOPE,u=process.env.AWS_ACCOUNT_ID;if(r&&n){let a={accessKeyId:r,secretAccessKey:n,...s&&{sessionToken:s},...o&&{expiration:new Date(o)},...i&&{credentialScope:i},...u&&{accountId:u}};return z1(a,"CREDENTIALS_ENV_VARS","g"),a}throw new q1("Unable to find environment variable credentials.",{logger:t?.logger})};j1.ENV_ACCOUNT_ID="AWS_ACCOUNT_ID";j1.ENV_CREDENTIAL_SCOPE="AWS_CREDENTIAL_SCOPE";j1.ENV_EXPIRATION="AWS_CREDENTIAL_EXPIRATION";j1.ENV_KEY="AWS_ACCESS_KEY_ID";j1.ENV_SECRET="AWS_SECRET_ACCESS_KEY";j1.ENV_SESSION="AWS_SESSION_TOKEN";j1.fromEnv=V1});var Ts=e(function(xM){var{ProviderError:Pa,CredentialsProviderError:at,loadConfig:Fa}=W(),Cp=c("node:http"),{parseUrl:Z1}=K(),Ip=(t)=>Boolean(t)&&typeof t==="object"&&typeof t.AccessKeyId==="string"&&typeof t.SecretAccessKey==="string"&&typeof t.Token==="string"&&typeof t.Expiration==="string",Rp=(t)=>({accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:new Date(t.Expiration),...t.AccountId&&{accountId:t.AccountId}}),La=({maxRetries:t=0,timeout:r=1000})=>({maxRetries:t,timeout:r});function an(t){return new Promise((r,n)=>{let s=Cp.request({method:"GET",...t,hostname:t.hostname?.replace(/^\[(.+)\]$/,"$1")});s.on("error",(o)=>{n(Object.assign(new Pa("Unable to connect to instance metadata service"),o)),s.destroy()}),s.on("timeout",()=>{n(new Pa("TimeoutError from instance metadata service")),s.destroy()}),s.on("response",(o)=>{let{statusCode:i=400}=o;if(i<200||300<=i)n(Object.assign(new Pa("Error response received from instance metadata service"),{statusCode:i})),s.destroy();let u=[];o.on("data",(a)=>{u.push(a)}),o.on("end",()=>{r(Buffer.concat(u)),s.destroy()})}),s.end()})}var Ma=(t,r)=>{let n=t();for(let s=0;s<r;s++)n=n.catch(t);return n},sn="AWS_CONTAINER_CREDENTIALS_FULL_URI",xs="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",Da="AWS_CONTAINER_AUTHORIZATION_TOKEN",eM=(t={})=>{let{timeout:r,maxRetries:n}=La(t);return()=>Ma(async()=>{let s=await oM({logger:t.logger}),o=JSON.parse(await tM(r,s));if(!Ip(o))throw new at("Invalid response received from instance metadata service.",{logger:t.logger});return Rp(o)},n)},tM=async(t,r)=>{if(process.env[Da])r.headers={...r.headers,Authorization:process.env[Da]};return(await an({...r,timeout:t})).toString()},rM="169.254.170.2",nM=new Set(["localhost","127.0.0.1"]),sM=new Set(["http:","https:"]),oM=async({logger:t})=>{if(process.env[xs])return{hostname:rM,path:process.env[xs]};if(process.env[sn]){let r;try{r=new URL(process.env[sn])}catch{throw new at(`${process.env[sn]} is not a valid container metadata service URL`,{tryNextLink:!1,logger:t})}if(!r.hostname||!nM.has(r.hostname))throw new at(`${r.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:t});if(!r.protocol||!sM.has(r.protocol))throw new at(`${r.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:t});return{protocol:r.protocol,hostname:r.hostname,path:r.pathname+r.search,port:r.port?parseInt(r.port,10):void 0}}throw new at(`The container metadata credential provider cannot be used unless the ${xs} or ${sn} environment variable is set`,{tryNextLink:!1,logger:t})};class Ua extends at{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(t,r=!0){super(t,r);this.tryNextLink=r,Object.setPrototypeOf(this,Ua.prototype)}}var on;(function(t){t.IPv4="http://169.254.169.254",t.IPv6="http://[fd00:ec2::254]"})(on||(on={}));var iM="AWS_EC2_METADATA_SERVICE_ENDPOINT",aM="ec2_metadata_service_endpoint",cM={environmentVariableSelector:(t)=>t[iM],configFileSelector:(t)=>t[aM],default:void 0},fr;(function(t){t.IPv4="IPv4",t.IPv6="IPv6"})(fr||(fr={}));var uM="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",dM="ec2_metadata_service_endpoint_mode",lM={environmentVariableSelector:(t)=>t[uM],configFileSelector:(t)=>t[dM],default:fr.IPv4},vp=async()=>Z1(await fM()||await hM()),fM=async()=>Fa(cM)(),hM=async()=>{let t=await Fa(lM)();switch(t){case fr.IPv4:return on.IPv4;case fr.IPv6:return on.IPv6;default:throw Error(`Unsupported endpoint mode: ${t}. Select from ${Object.values(fr)}`)}},pM=300,gM=300,mM="https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html",Ap=(t,r)=>{let n=pM+Math.floor(Math.random()*gM),s=new Date(Date.now()+n*1000);r.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(s)}.
37
+ For more information, please visit: `+mM);let o=t.originalExpiration??t.expiration;return{...t,...o?{originalExpiration:o}:{},expiration:s}},yM=(t,r={})=>{let n=r?.logger||console,s;return async()=>{let o;try{if(o=await t(),o.expiration&&o.expiration.getTime()<Date.now())o=Ap(o,n)}catch(i){if(s)n.warn("Credential renew failed: ",i),o=Ap(s,n);else throw i}return s=o,o}},Np="/latest/meta-data/iam/security-credentials/",SM="/latest/api/token",ka="AWS_EC2_METADATA_V1_DISABLED",xp="ec2_metadata_v1_disabled",Tp="x-aws-ec2-metadata-token",wM=(t={})=>yM(EM(t),{logger:t.logger}),EM=(t={})=>{let r=!1,{logger:n,profile:s}=t,{timeout:o,maxRetries:i}=La(t),u=async(a,d)=>{if(r||d.headers?.[Tp]==null){let f=!1,p=!1,g=await Fa({environmentVariableSelector:(m)=>{let y=m[ka];if(p=!!y&&y!=="false",y===void 0)throw new at(`${ka} not set in env, checking config file next.`,{logger:t.logger});return p},configFileSelector:(m)=>{let y=m[xp];return f=!!y&&y!=="false",f},default:!1},{profile:s})();if(t.ec2MetadataV1Disabled||g){let m=[];if(t.ec2MetadataV1Disabled)m.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(f)m.push(`config file profile (${xp})`);if(p)m.push(`process environment variable (${ka})`);throw new Ua(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${m.join(", ")}].`)}}let h=(await Ma(async()=>{let f;try{f=await _M(d)}catch(p){if(p.statusCode===401)r=!1;throw p}return f},a)).trim();return Ma(async()=>{let f;try{f=await AM(h,d,t)}catch(p){if(p.statusCode===401)r=!1;throw p}return f},a)};return async()=>{let a=await vp();if(r)return n?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),u(i,{...a,timeout:o});else{let d;try{d=(await bM({...a,timeout:o})).toString()}catch(l){if(l?.statusCode===400)throw Object.assign(l,{message:"EC2 Metadata token request returned error"});else if(l.message==="TimeoutError"||[403,404,405].includes(l.statusCode))r=!0;return n?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),u(i,{...a,timeout:o})}return u(i,{...a,headers:{[Tp]:d},timeout:o})}}},bM=async(t)=>an({...t,path:SM,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),_M=async(t)=>(await an({...t,path:Np})).toString(),AM=async(t,r,n)=>{let s=JSON.parse((await an({...r,path:Np+t})).toString());if(!Ip(s))throw new at("Invalid response received from instance metadata service.",{logger:n.logger});return Rp(s)};xM.DEFAULT_MAX_RETRIES=0;xM.DEFAULT_TIMEOUT=1000;xM.ENV_CMDS_AUTH_TOKEN=Da;xM.ENV_CMDS_FULL_URI=sn;xM.ENV_CMDS_RELATIVE_URI=xs;xM.Endpoint=on;xM.fromContainerMetadata=eM;xM.fromInstanceMetadata=wM;xM.getInstanceMetadataEndpoint=vp;xM.httpRequest=an;xM.providerConfigFromInit=La});var It=e(function(GM){var{hasOwn:Fp}=ee(),{streamCollector:FM}=ee();GM.streamCollector=FM;var{buildQueryString:Lp,HttpResponse:Up}=K(),ut=c("node:https"),{Readable:LM}=c("node:stream"),cn=c("node:http2");function Is(t){let r=t&&typeof t==="object"&&"reason"in t?t.reason:void 0;if(r){if(r instanceof Error){let o=Error("Request aborted");return o.name="AbortError",o.cause=r,o}let s=Error(String(r));return s.name="AbortError",s}let n=Error("Request aborted");return n.name="AbortError",n}var UM=["ECONNRESET","EPIPE","ETIMEDOUT"],$p=(t)=>{let r={};for(let n in t){if(!Fp(t,n))continue;let s=t[n];r[n]=Array.isArray(s)?s.join(","):s}return r},te={setTimeout:(t,r)=>setTimeout(t,r),clearTimeout:(t)=>clearTimeout(t)},Op=1000,$M=(t,r,n=0)=>{if(!n)return-1;let s=(o)=>{let i=te.setTimeout(()=>{t.destroy(),r(Object.assign(Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${n} ms.`),{name:"TimeoutError"}))},n-o),u=(a)=>{if(a?.connecting)a.on("connect",()=>{te.clearTimeout(i)});else te.clearTimeout(i)};if(t.socket)u(t.socket);else t.on("socket",u)};if(n<2000)return s(0),0;return te.setTimeout(s.bind(null,Op),Op)},BM=(t,r,n=0,s,o)=>{if(n)return te.setTimeout(()=>{let i=`@smithy/node-http-handler - [${s?"ERROR":"WARN"}] a request has exceeded the configured ${n} ms requestTimeout.`;if(s){let u=Object.assign(Error(i),{name:"TimeoutError",code:"ETIMEDOUT"});t.destroy(u),r(u)}else i+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",o?.warn?.(i)},n);return-1},HM=3000,zM=(t,{keepAlive:r,keepAliveMsecs:n},s=HM)=>{if(r!==!0)return-1;let o=()=>{if(t.socket)t.socket.setKeepAlive(r,n||0);else t.on("socket",(i)=>{i.setKeepAlive(r,n||0)})};if(s===0)return o(),0;return te.setTimeout(o,s)},Pp=3000,qM=(t,r,n=0)=>{let s=(o)=>{let i=n-o,u=()=>{t.destroy(),r(Object.assign(Error(`@smithy/node-http-handler - the request socket timed out after ${n} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};if(t.socket)t.socket.setTimeout(i,u),t.on("close",()=>t.socket?.removeListener("timeout",u));else t.setTimeout(i,u)};if(0<n&&n<6000)return s(0),0;return te.setTimeout(s.bind(null,n===0?0:Pp),Pp)},kp=6000;async function Bp(t,r,n=kp,s=!1){let o=r.headers,i=o?o.Expect||o.expect:void 0,u=-1,a=!0;if(!s&&i==="100-continue")a=await Promise.race([new Promise((d)=>{u=Number(te.setTimeout(()=>d(!0),Math.max(kp,n)))}),new Promise((d)=>{t.on("continue",()=>{te.clearTimeout(u),d(!0)}),t.on("response",()=>{te.clearTimeout(u),d(!1)}),t.on("error",()=>{te.clearTimeout(u),d(!1)})})]);if(a)VM(t,r.body)}function VM(t,r){if(r instanceof LM){r.pipe(t);return}if(r){let n=Buffer.isBuffer(r);if(n||typeof r==="string"){if(n&&r.byteLength===0)t.end();else t.end(r);return}let o=r;if(typeof o==="object"&&o.buffer&&typeof o.byteOffset==="number"&&typeof o.byteLength==="number"){t.end(Buffer.from(o.buffer,o.byteOffset,o.byteLength));return}t.end(Buffer.from(r));return}t.end()}var jM=0,Cs=void 0,Mp=void 0;class Rs{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(t){if(typeof t?.handle==="function")return t;return new Rs(t)}static checkSocketUsage(t,r,n=console){let{sockets:s,requests:o,maxSockets:i}=t;if(typeof i!=="number"||i===1/0)return r;let u=15000;if(Date.now()-u<r)return r;if(s&&o)for(let a in s){if(!Fp(s,a))continue;let d=s[a]?.length??0,l=o[a]?.length??0;if(d>=i&&l>=2*i)return n?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${d} and ${l} additional requests are enqueued.
38
+ See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
39
+ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return r}constructor(t){this.configProvider=new Promise((r,n)=>{if(typeof t==="function")t().then((s)=>{r(this.resolveDefaultConfig(s))}).catch(n);else r(this.resolveDefaultConfig(t))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:r,requestTimeout:n}={}){if(!this.config)this.config=await this.configProvider;let s=this.config,o=s.logger,i=t.protocol==="https:";if(!i&&!this.config.httpAgent)this.config.httpAgent=await this.config.httpAgentProvider();return new Promise((u,a)=>{let d=void 0,l=-1,h=-1,f=-1,p=-1,g=-1,m=()=>{te.clearTimeout(l),te.clearTimeout(h),te.clearTimeout(f),te.clearTimeout(p),te.clearTimeout(g)},y=async(C)=>{await d,m(),u(C)},S=async(C)=>{await d,m(),a(C)};if(r?.aborted){let C=Is(r);S(C);return}let w=t.headers,E=w?(w.Expect??w.expect)==="100-continue":!1,A=i?s.httpsAgent:s.httpAgent;if(E&&!this.externalAgent)A=new(i?ut.Agent:Cs)({keepAlive:!1,maxSockets:1/0});l=te.setTimeout(()=>{this.socketWarningTimestamp=Rs.checkSocketUsage(A,this.socketWarningTimestamp,o)},s.socketAcquisitionWarningTimeout??(s.requestTimeout??2000)+(s.connectionTimeout??1000));let v=t.query?Lp(t.query):"",L=void 0;if(t.username!=null||t.password!=null){let C=t.username??"",G=t.password??"";L=`${C}:${G}`}let k=t.path;if(v)k+=`?${v}`;if(t.fragment)k+=`#${t.fragment}`;let U=t.hostname??"";if(U[0]==="["&&U.endsWith("]"))U=t.hostname.slice(1,-1);else U=t.hostname;let de={headers:t.headers,host:U,method:t.method,path:k,port:t.port,agent:A,auth:L},j=(i?ut.request:Mp)(de,(C)=>{let G=new Up({statusCode:C.statusCode||-1,reason:C.statusMessage,headers:$p(C.headers),body:C});y({response:G})});if(j.on("error",(C)=>{if(UM.includes(C.code))S(Object.assign(C,{name:"TimeoutError"}));else S(C)}),r){let C=()=>{j.destroy();let G=Is(r);S(G)};if(typeof r.addEventListener==="function"){let G=r;G.addEventListener("abort",C,{once:!0}),j.once("close",()=>G.removeEventListener("abort",C))}else r.onabort=C}let ke=n??s.requestTimeout;h=$M(j,S,s.connectionTimeout),f=BM(j,S,ke,s.throwOnRequestTimeout,o??console),p=qM(j,S,s.socketTimeout);let D=de.agent;if(typeof D==="object"&&"keepAlive"in D)g=zM(j,{keepAlive:D.keepAlive,keepAliveMsecs:D.keepAliveMsecs});d=Bp(j,t,ke,this.externalAgent).catch((C)=>(m(),a(C)))})}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then((n)=>{if(t===Symbol.for("logger"))return{...n,logger:n.logger??r};return{...n,[t]:r}})}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(t){let{requestTimeout:r,connectionTimeout:n,socketTimeout:s,socketAcquisitionWarningTimeout:o,httpAgent:i,httpsAgent:u,throwOnRequestTimeout:a,logger:d}=t||{},l=!0,h=50;return{connectionTimeout:n,requestTimeout:r,socketTimeout:s,socketAcquisitionWarningTimeout:o,throwOnRequestTimeout:a,httpAgentProvider:async()=>{let f=c("node:http"),{Agent:p,request:g}=f.default??f;if(Mp=g,Cs=p,i instanceof Cs||typeof i?.destroy==="function")return this.externalAgent=!0,i;return new Cs({keepAlive:!0,maxSockets:50,...i})},httpsAgent:(()=>{if(u instanceof ut.Agent||typeof u?.destroy==="function")return this.externalAgent=!0,u;return new ut.Agent({keepAlive:!0,maxSockets:50,...u})})(),logger:d}}}var WM=new Uint16Array(1);class vs{id=WM[0]++;total=0;max=0;session;refs=0;constructor(t){t.unref(),this.session=t}retain(){if(this.session.destroyed)throw Error("@smithy/node-http-handler - cannot acquire reference to destroyed session.");this.refs+=1,this.total+=1,this.max=Math.max(this.refs,this.max),this.session.ref()}free(){if(this.session.destroyed)return;if(this.refs-=1,this.refs===0)this.session.unref();if(this.refs<0)throw Error("@smithy/node-http-handler - ClientHttp2Session refcount at zero, cannot decrement.")}deref(){return this.session}close(){if(!this.session.closed)this.session.close()}destroy(){if(this.refs=0,!this.session.destroyed)this.session.setTimeout(0),this.session.destroy()}useCount(){return this.refs}}class Hp{sessions=[];maxConcurrency=0;constructor(t){this.sessions=(t??[]).map((r)=>new vs(r))}poll(){let t=!1;for(let r of this.sessions){if(r.deref().destroyed){t=!0;continue}if(!this.maxConcurrency||r.useCount()<this.maxConcurrency)return r}if(t){for(let r of this.sessions)if(r.deref().destroyed)this.remove(r)}}offerLast(t){this.sessions.push(t)}remove(t){let r=this.sessions.indexOf(t);if(r>-1)this.sessions.splice(r,1)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}setMaxConcurrency(t){this.maxConcurrency=t}destroy(t){this.remove(t),t.destroy()}}class zp{config;connectOptions;connectionPools=new Map;constructor(t){if(this.config=t,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw RangeError("maxConcurrency must be greater than zero.")}lease(t,r){let n=this.getUrlString(t),s=this.getPool(n);if(!this.config.disableConcurrency&&!r.isEventStream){let d=s.poll();if(d)return d.retain(),d}let o=new vs(this.connect(n)),i=o.deref();if(this.config.maxConcurrency)i.settings({maxConcurrentStreams:this.config.maxConcurrency},(d)=>{if(d)throw Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+t.destination.toString())});let u=()=>{this.removeFromPoolAndClose(n,o)},a=()=>{this.removeFromPoolAndCheckedDestroy(n,o)};if(i.on("goaway",u),i.on("error",a),i.on("frameError",a),i.on("close",a),r.requestTimeout)i.setTimeout(r.requestTimeout,a);return s.offerLast(o),o.retain(),o}release(t,r){r.free()}createIsolatedSession(t,r){let n=this.getUrlString(t),s=new vs(this.connect(n)),o=s.deref();o.settings({maxConcurrentStreams:1});let i=()=>{s.destroy()};o.on("error",i),o.on("frameError",i),o.on("close",i);let u=r.requestTimeout??300000;return o.setTimeout(u,i),s.retain(),s}destroy(){for(let[t,r]of this.connectionPools){for(let n of[...r])n.destroy();this.connectionPools.delete(t)}}setMaxConcurrentStreams(t){if(t&&t<=0)throw RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=t;for(let r of this.connectionPools.values())r.setMaxConcurrency(t)}setDisableConcurrentStreams(t){this.config.disableConcurrency=t}setNodeHttp2ConnectOptions(t){this.connectOptions=t}debug(){let t={};for(let[r,n]of this.connectionPools){let s=[];for(let o of n)s.push({id:o.id,active:o.useCount(),maxConcurrent:o.max,totalRequests:o.total});t[r]={sessions:s}}return t}removeFromPoolAndClose(t,r){this.connectionPools.get(t)?.remove(r),r.close()}removeFromPoolAndCheckedDestroy(t,r){this.connectionPools.get(t)?.remove(r),r.destroy()}getPool(t){if(!this.connectionPools.has(t)){let r=new Hp;if(this.config.maxConcurrency)r.setMaxConcurrency(this.config.maxConcurrency);this.connectionPools.set(t,r)}return this.connectionPools.get(t)}getUrlString(t){return t.destination.toString()}connect(t){return this.connectOptions===void 0?cn.connect(t):cn.connect(t,this.connectOptions)}}var{constants:Dp}=cn;class $a{config;configProvider;metadata={handlerProtocol:"h2"};connectionManager=new zp({});static create(t){if(typeof t?.handle==="function")return t;return new $a(t)}constructor(t){this.configProvider=new Promise((r,n)=>{if(typeof t==="function")t().then((s)=>{r(s||{})}).catch(n);else r(t||{})})}destroy(){this.connectionManager.destroy()}async handle(t,{abortSignal:r,requestTimeout:n,isEventStream:s}={}){if(!this.config){this.config=await this.configProvider;let{disableConcurrentStreams:d,maxConcurrentStreams:l,nodeHttp2ConnectOptions:h}=this.config;if(this.connectionManager.setDisableConcurrentStreams(d??!1),l)this.connectionManager.setMaxConcurrentStreams(l);if(h)this.connectionManager.setNodeHttp2ConnectOptions(h)}let{requestTimeout:o,disableConcurrentStreams:i}=this.config,u=i||s,a=n??o;return new Promise((d,l)=>{let h=!1,f=void 0,p=async(C)=>{await f,d(C)},g=async(C)=>{await f,l(C)};if(r?.aborted){h=!0;let C=Is(r);g(C);return}let{hostname:m,method:y,port:S,protocol:w,query:E}=t,A="";if(t.username!=null||t.password!=null){let C=t.username??"",G=t.password??"";A=`${C}:${G}@`}let v=`${w}//${A}${m}${S?`:${S}`:""}`,L={destination:new URL(v)},k={requestTimeout:this.config?.sessionTimeout,isEventStream:s},U=u?this.connectionManager.createIsolatedSession(L,k):this.connectionManager.lease(L,k),de=U.deref(),q=(C)=>{if(u)U.destroy();h=!0,g(C)},j=E?Lp(E):"",ke=t.path;if(j)ke+=`?${j}`;if(t.fragment)ke+=`#${t.fragment}`;let D=de.request({...t.headers,[Dp.HTTP2_HEADER_PATH]:ke,[Dp.HTTP2_HEADER_METHOD]:y});if(a)D.setTimeout(a,()=>{D.close();let C=Error(`Stream timed out because of no activity for ${a} ms`);C.name="TimeoutError",q(C)});if(r){let C=()=>{D.close();let G=Is(r);q(G)};if(typeof r.addEventListener==="function"){let G=r;G.addEventListener("abort",C,{once:!0}),D.once("close",()=>G.removeEventListener("abort",C))}else r.onabort=C}D.on("frameError",(C,G,Sw)=>{q(Error(`Frame type id ${C} in stream id ${Sw} has failed with code ${G}.`))}),D.on("error",q),D.on("aborted",()=>{q(Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${D.rstCode}.`))}),D.on("response",(C)=>{let G=new Up({statusCode:C[":status"]??-1,headers:$p(C),body:D});if(h=!0,p({response:G}),u)de.close(),D.on("end",()=>{U.destroy()})}),D.on("close",()=>{if(u)U.destroy();else this.connectionManager.release(L,U);if(!h){let C=Error("Unexpected error: http2 request did not get a response");if(de.destroyed)C.name="TimeoutError";q(C)}}),f=Bp(D,t,a)})}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then((n)=>({...n,[t]:r}))}httpHandlerConfigs(){return this.config??{}}}GM.DEFAULT_REQUEST_TIMEOUT=jM;GM.NodeHttp2Handler=$a;GM.NodeHttpHandler=Rs});var Ba=e(function(hD){var{setCredentialFeature:JM}=pe(),{CredentialsProviderError:Mt}=W(),{NodeHttpHandler:ZM}=It(),Vp=c("node:fs/promises"),{HttpRequest:eD}=K(),{sdkStreamMixin:tD,parseRfc3339DateTime:rD}=ee(),nD=(t,r)=>{if(t.protocol==="https:")return;if(t.hostname==="169.254.170.2"||t.hostname==="169.254.170.23"||t.hostname==="[fd00:ec2::23]")return;if(t.hostname.includes("[")){if(t.hostname==="[::1]"||t.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(t.hostname==="localhost")return;let n=t.hostname.split("."),s=(o)=>{let i=parseInt(o,10);return 0<=i&&i<=255};if(n[0]==="127"&&s(n[1])&&s(n[2])&&s(n[3])&&n.length===4)return}throw new Mt(`URL not accepted. It must either be HTTPS or match one of the following:
40
+ - loopback CIDR 127.0.0.0/8 or [::1/128]
41
+ - ECS container host 169.254.170.2
42
+ - EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:r})};function sD(t){return new eD({protocol:t.protocol,hostname:t.hostname,port:Number(t.port),path:t.pathname,query:Array.from(t.searchParams.entries()).reduce((r,[n,s])=>(r[n]=s,r),{}),fragment:t.hash})}async function oD(t,r){let s=await tD(t.body).transformToString();if(t.statusCode===200){let o=JSON.parse(s);if(typeof o.AccessKeyId!=="string"||typeof o.SecretAccessKey!=="string"||typeof o.Token!=="string"||typeof o.Expiration!=="string")throw new Mt("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:r});return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.Token,expiration:rD(o.Expiration)}}if(t.statusCode>=400&&t.statusCode<500){let o={};try{o=JSON.parse(s)}catch(i){}throw Object.assign(new Mt(`Server responded with status: ${t.statusCode}`,{logger:r}),{Code:o.Code,Message:o.Message})}throw new Mt(`Server responded with status: ${t.statusCode}`,{logger:r})}var iD=(t,r,n)=>async()=>{for(let s=0;s<r;++s)try{return await t()}catch(o){await new Promise((i)=>setTimeout(i,n))}return await t()},aD="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",cD="http://169.254.170.2",uD="AWS_CONTAINER_CREDENTIALS_FULL_URI",dD="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",lD="AWS_CONTAINER_AUTHORIZATION_TOKEN",fD=(t={})=>{t.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let r,n=t.awsContainerCredentialsRelativeUri??process.env[aD],s=t.awsContainerCredentialsFullUri??process.env[uD],o=t.awsContainerAuthorizationToken??process.env[lD],i=t.awsContainerAuthorizationTokenFile??process.env[dD],u=t.logger?.constructor?.name==="NoOpLogger"||!t.logger?.warn?console.warn:t.logger.warn.bind(t.logger);if(n&&s)u("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),u("awsContainerCredentialsRelativeUri will take precedence.");if(o&&i)u("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),u("awsContainerAuthorizationTokenFile will take precedence.");if(n)r=`${cD}${n}`;else if(s)r=s;else throw new Mt(`No HTTP credential provider host provided.
43
+ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:t.logger});let a=new URL(r);nD(a,t.logger);let d=ZM.create({connectionTimeout:t.timeout??1000}),l=t.timeout??1000,h=iD(async()=>{let f=sD(a);if(i)f.headers.Authorization=qp((await Vp.readFile(i)).toString());else if(o)f.headers.Authorization=qp(o);try{let p=await d.handle(f,{requestTimeout:l});return oD(p.response).then((g)=>JM(g,"CREDENTIALS_HTTP","z"))}catch(p){throw new Mt(String(p),{logger:t.logger})}},t.maxRetries??3,t.timeout??1000);return async()=>{try{return await h()}finally{d.destroy?.()}}},qp=(t)=>{if(t.includes(`\r
44
+ `))throw new Mt("Authorization token contains invalid \\r\\n sequence.");return t};hD.fromHttp=fD});var yg=e(function(cF){var{nv:tg,NumericValue:pn,calculateBodyLength:gD,generateIdempotencyToken:rg,fromBase64:Ya,_parseEpochTimestamp:fn}=ee(),{hasOwn:ae,getSmithyContext:mD}=me(),{HttpRequest:yD,collectBody:SD,SerdeContext:gn,RpcProtocol:wD}=K(),{NormalizedSchema:we,deref:ED,TypeRegistry:jp}=Re();function wr(t){return typeof Buffer<"u"?Buffer.alloc(t):new Uint8Array(t)}var mn=Symbol("@smithy/core/cbor::tagSymbol");function Ja(t){return t[mn]=!0,t}var ng=typeof Buffer<"u",Za=new TextDecoder,N=wr(0),ec=!1,Ae=new DataView(N.buffer,N.byteOffset,N.byteLength),I=0;function bD(t){N=t,ec=ng&&N instanceof Buffer,Ae=new DataView(N.buffer,N.byteOffset,N.byteLength)}function ft(t,r){if(t>=r)throw Error("unexpected end of (decode) payload.");let n=(N[t]&224)>>5,s=N[t]&31;if(s===31&&2<=n&&n<=5)return _D(t,r);switch(n){case 0:case 1:case 6:{let o,i;if(s<24)o=s,i=1;else switch(s){case 24:if(r-t<2)$e(1);o=N[t+1],i=2;break;case 25:if(r-t<3)$e(2);o=Ae.getUint16(t+1),i=3;break;case 26:if(r-t<5)$e(4);o=Ae.getUint32(t+1),i=5;break;case 27:if(r-t<9)$e(8);{let u=Ae.getUint32(t+1);if(u<2097152)o=u*4294967296+Ae.getUint32(t+5);else o=Ae.getBigUint64(t+1)}i=9;break;default:rc(s)}if(n===0)return I=i,Wa(o);else if(n===1){let u;if(typeof o==="bigint")u=BigInt(-1)-o;else u=-1-o;return I=i,Wa(u)}else return ND(t,r,s,o,i)}case 3:return hn(t,r);case 5:return xD(t,r);case 4:return ID(t,r);case 2:return tc(t,r);default:return OD(t,r)}}function _D(t,r){let n=(N[t]&224)>>5;if((N[t]&31)===31)switch(n){case 3:return MD(t,r);case 5:return PD(t,r);case 4:return kD(t,r);case 2:return DD(t,r)}}function AD(t,r){let n=t>>7,s=(t&124)>>2,o=(t&3)<<8|r,i=n===0?1:-1;if(s===0){if(o===0)return 0;return i*(Math.pow(2,-14)*(o/1024))}else if(s===31){if(o===0)return i*(1/0);return NaN}return i*(Math.pow(2,s-15)*(1+o/1024))}function xD(t,r){let n=yn(t,r);if(n<25)return CD(t,r,n);return TD(t,r,n)}function TD(t,r,n){let s=I;t+=s;let o=t,i=Object.create(null);for(let u=0;u<n;++u){let a=hn(t,r);if(t+=I,(N[t]&224)>>5===3)i[a]=hn(t,r);else i[a]=ft(t,r);t+=I}return I=s+(t-o),Object.setPrototypeOf(i,Object.prototype),i}function CD(t,r,n){let s=I;t+=s;let o=t,i={};for(let u=0;u<n;++u){let a=hn(t,r);t+=I,i[a]=ft(t,r),t+=I}return I=s+(t-o),i}function ID(t,r){let n=yn(t,r),s=I;t+=s;let o=t,i=Array(n);for(let u=0;u<n;++u)i[u]=ft(t,r),t+=I;return I=s+(t-o),i}function hn(t,r){let n=yn(t,r),s=I;if(t+=s,r-t<n)$e(n);if(I=s+n,n<24)return vD(t,n);if(ec)return N.toString("utf-8",t,t+n);return Za.decode(N.subarray(t,t+n))}var Wp=Array(2048),Ha=new Uint16Array(2048),un=0;function RD(){un=un+1&65535}function vD(t,r){let n=r;for(let u=0;u<r;++u)n=n*31+N[t+u]|0;let s=n>>>0&2047,o=Wp[s];if(o!==void 0){if(o.length===r){let u=!0;for(let a=0;a<r;++a)if(o.charCodeAt(a)!==N[t+a]){u=!1;break}if(u)return Ha[s]=un,o}}let i=ec?N.toString("utf-8",t,t+r):Za.decode(N.subarray(t,t+r));if(Ha[s]!==un)Wp[s]=i,Ha[s]=un;return i}function tc(t,r){let n=yn(t,r),s=I;if(t+=s,r-t<n)$e(n);let o=N.subarray(t,t+n);return I=s+n,o}function ND(t,r,n,s,o){if(n===2||n===3){let i=yn(t+o,r),u=BigInt(0),a=t+o+I;for(let d=a;d<a+i;++d)u=u<<BigInt(8)|BigInt(N[d]);return I=o+I+i,n===3?-u-BigInt(1):u}else if(n===4){let i=ft(t+o,r),[u,a]=i,d=a<0?-1:1,l=BigInt(d)*BigInt(a),h=String(l),f=a<0?"-":"",p;if(typeof u==="number"&&Math.abs(u)<=268435456){let m=u,y="0".repeat(Math.abs(m)+1)+h;if(p=m===0?y:y.slice(0,y.length+m)+"."+y.slice(m),p=p.replace(/^0+/g,""),p==="")p="0";if(p[0]===".")p="0"+p;p=f+p}else{let m=BigInt(u);if(h.length===1)p=f+h+"e"+String(m);else{let y=m+BigInt(h.length-1);p=f+h[0]+"."+h.slice(1)+"e"+String(y)}}return I=o+I,tg(p)}else{let i=ft(t+o,r);return I=o+I,Ja({tag:Wa(s),value:i})}}function OD(t,r){let n=N[t]&31;switch(n){case 21:case 20:return I=1,n===21;case 22:return I=1,null;case 23:return I=1,null;case 25:if(r-t<3)throw Error("incomplete float16 at end of buf.");return I=3,AD(N[t+1],N[t+2]);case 26:if(r-t<5)throw Error("incomplete float32 at end of buf.");return I=5,Ae.getFloat32(t+1);case 27:if(r-t<9)throw Error("incomplete float64 at end of buf.");return I=9,Ae.getFloat64(t+1);default:rc(n)}}function yn(t,r){let n=N[t]&31;if(n<24)return I=1,n;switch(n){case 24:if(r-t<2)$e(1);return I=2,N[t+1];case 25:if(r-t<3)$e(2);return I=3,Ae.getUint16(t+1);case 26:if(r-t<5)$e(4);return I=5,Ae.getUint32(t+1);case 27:if(r-t<9)$e(8);return I=9,FD(Ae.getBigUint64(t+1));default:rc(n)}}function PD(t,r){t+=1;let n=t,s={};for(;t<r;){if(N[t]===255)return I=t-n+2,s;let o=hn(t,r);t+=I,s[o]=ft(t,r),t+=I}throw Error("expected break marker.")}function kD(t,r){t+=1;let n=[];for(let s=t;t<r;){if(N[t]===255)return I=t-s+2,n;n.push(ft(t,r)),t+=I}throw Error("expected break marker.")}function MD(t,r){t+=1;let n=[];for(let s=t;t<r;){if(N[t]===255){let d=wr(n.length);if(d.set(n,0),I=t-s+2,ng)return d.toString("utf-8",0,d.length);return Za.decode(d)}let o=(N[t]&224)>>5,i=N[t]&31;if(o!==3)sg(o);if(i===31)throw Error("nested indefinite string.");let u=tc(t,r);t+=I;for(let d=0;d<u.length;++d)n.push(u[d])}throw Error("expected break marker.")}function DD(t,r){t+=1;let n=[];for(let s=t;t<r;){if(N[t]===255){let d=wr(n.length);return d.set(n,0),I=t-s+2,d}let o=(N[t]&224)>>5,i=N[t]&31;if(o!==2)sg(o);if(i===31)throw Error("nested indefinite string.");let u=tc(t,r);t+=I;for(let d=0;d<u.length;++d)n.push(u[d])}throw Error("expected break marker.")}function Wa(t){if(typeof t==="number")return t;let r=Number(t);if(Number.MIN_SAFE_INTEGER<=r&&r<=Number.MAX_SAFE_INTEGER)return r;return t}function FD(t){let r=Number(t);if(r<Number.MIN_SAFE_INTEGER||Number.MAX_SAFE_INTEGER<r)console.warn(Error(`@smithy/core/cbor - truncating BigInt(${t}) to ${r} with loss of precision.`));return r}function $e(t){throw Error(`length ${t} greater than remaining buf len.`)}function rc(t){throw Error(`unexpected minor value ${t}.`)}function sg(t){throw Error(`unexpected major type ${t} in indefinite string.`)}var LD=typeof Buffer<"u",hr=new Map,dn=0,Ga=!1,UD=2048,x=wr(UD),Se=new DataView(x.buffer,x.byteOffset,x.byteLength),b=0;function $D(t){let r=[t];while(r.length){let n=r.pop();if(typeof n==="string"){let s=n.length;if(LD)if(pr(s*3+9),s>23)za(3,Buffer.byteLength(n)),b+=x.write(n,b);else HD(n);else{let o=s*3;pr(o+9);let i=b,a=new TextEncoder().encodeInto(n,x.subarray(b+9)).written,d;if(a<24)d=1;else if(a<256)d=2;else if(a<65536)d=3;else if(a<4294967296)d=5;else d=9;if(d<9)x.copyWithin(i+d,i+9,i+9+a);b=i,Dt(3,a),b+=a}continue}if(x.byteLength-b<9)pr(64);if(typeof n==="number"){if(Number.isInteger(n)&&n>=-9007199254740992&&n<=9007199254740991){let s=n>=0,o=s?0:1,i=s?n:-n-1;if(i<24)x[b++]=o<<5|i;else if(i<256)x[b++]=o<<5|24,x[b++]=i;else if(i<65536)x[b++]=o<<5|25,x[b++]=i>>8,x[b++]=i&255;else if(i<4294967296)x[b++]=o<<5|26,Se.setUint32(b,i),b+=4;else{x[b++]=o<<5|27;let u=i/4294967296|0,a=i-u*4294967296|0;Se.setUint32(b,u),Se.setUint32(b+4,a),b+=8}continue}x[b++]=251,Se.setFloat64(b,n),b+=8;continue}else if(typeof n==="bigint"){let s=n>=0,o=s?0:1,i=s?n:-n-BigInt(1);if(i<BigInt("18446744073709551616")){let u=Number(i);if(u<4294967296)Dt(o,u);else x[b++]=o<<5|27,Se.setBigUint64(b,i),b+=8}else{let u=i.toString(2),a=new Uint8Array(Math.ceil(u.length/8)),d=i,l=0;while(a.byteLength-++l>=0)a[a.byteLength-l]=Number(d&BigInt(255)),d>>=BigInt(8);pr(a.byteLength*2+16),x[b++]=s?194:195,za(2,a.byteLength),x.set(a,b),b+=a.byteLength}continue}else if(n===null){x[b++]=246;continue}else if(typeof n==="boolean"){x[b++]=224|(n?21:20);continue}else if(typeof n>"u")throw Error("@smithy/core/cbor: client may not serialize undefined value.");else if(Array.isArray(n)){Dt(4,n.length),pr(n.length*9+64);for(let s=n.length-1;s>=0;--s)r.push(n[s]);continue}else if(typeof n.byteLength==="number"){pr(n.length*2+9),Dt(2,n.length),x.set(n,b),b+=n.byteLength;continue}else if(typeof n==="object"){if(n instanceof pn){let i=n.string,u=BigInt(0),a=i.search(/[eE]/);if(a!==-1)u=BigInt(i.slice(a+1)),i=i.slice(0,a);let d=i.indexOf("."),l=d===-1?0:i.length-d-1,h=u-BigInt(l),f=BigInt(i.replace(".",""));x[b++]=196,Dt(4,2),r.push(f),r.push(h>=-0x20000000000000n&&h<=0x1fffffffffffffn?Number(h):h);continue}if(n[mn])if("tag"in n&&"value"in n){r.push(n.value),za(6,n.tag);continue}else throw Error("tag encountered with missing fields, need 'tag' and 'value', found: "+JSON.stringify(n));let s=Object.keys(n),o=s.length;Dt(5,o);for(let i=o-1;i>=0;--i)r.push(n[s[i]]),r.push(s[i]);continue}throw Error(`data type ${n?.constructor?.name??typeof n} not compatible for encoding.`)}}function BD(){dn=dn+1&65535,Ga=!1}function Gp(){let t=wr(b);return t.set(x.subarray(0,b),0),b=0,t}function Ka(t){let r=x;if(x=wr(t),r)if(r.copy)r.copy(x,0,0,r.byteLength);else x.set(r,0);Se=new DataView(x.buffer,x.byteOffset,x.byteLength)}function HD(t){let r=hr.get(t);if(r!==void 0){x.set(r.bytes,b),b+=r.bytes.length,r.epoch=dn;return}let n=b,s=Buffer.byteLength(t);Dt(3,s),b+=x.write(t,b);let o=Uint8Array.prototype.slice.call(x,n,b);if(hr.size>=2048){if(Ga)return;let i=0;for(let[u,a]of hr){if(i>=1024)break;if(a.epoch!==dn)hr.delete(u),i++}if(i===0){Ga=!0;return}}if(hr.size<2048)hr.set(t,{epoch:dn,bytes:o})}function pr(t){if(x.byteLength-b<t)if(b<16000000)Ka(Math.max(x.byteLength*4,x.byteLength+t));else Ka(x.byteLength+t+16000000)}function za(t,r){if(r<24)x[b++]=t<<5|r;else if(r<256)x[b++]=t<<5|24,x[b++]=r;else if(r<65536)x[b++]=t<<5|25,Se.setUint16(b,r),b+=2;else if(r<4294967296)x[b++]=t<<5|26,Se.setUint32(b,r),b+=4;else x[b++]=t<<5|27,Se.setBigUint64(b,typeof r==="bigint"?r:BigInt(r)),b+=8}function Dt(t,r){if(r<24)x[b++]=t<<5|r;else if(r<256)x[b++]=t<<5|24,x[b++]=r;else if(r<65536)x[b++]=t<<5|25,x[b++]=r>>8,x[b++]=r&255;else if(r<4294967296)x[b++]=t<<5|26,Se.setUint32(b,r),b+=4;else{x[b++]=t<<5|27;let n=r/4294967296|0,s=r-n*4294967296|0;Se.setUint32(b,n),Se.setUint32(b+4,s),b+=8}}var Ms={deserialize(t){return RD(),bD(t),ft(0,t.length)},serialize(t){BD();try{return $D(t),Gp()}catch(r){throw Gp(),r}},resizeEncodingBuffer(t){Ka(t)}},og=(t,r)=>SD(t,r).then(async(n)=>{if(n.length)try{return Ms.deserialize(n)}catch(s){throw Object.defineProperty(s,"$responseBodyText",{value:r.utf8Encoder(n)}),s}return{}}),Ns=(t)=>Ja({tag:1,value:t.getTime()/1000}),zD=async(t,r)=>{let n=await og(t,r);return n.message=n.message??n.Message,n},ig=(t,r)=>{let n=(s)=>{let o=s;if(typeof o==="number")o=o.toString();if(o.indexOf(",")>=0)o=o.split(",")[0];if(o.indexOf(":")>=0)o=o.split(":")[0];return o};if(r.__type!==void 0)return n(r.__type)},qD=(t)=>{if(String(t.headers["smithy-protocol"]).toLowerCase()!=="rpc-v2-cbor")throw Error("Malformed RPCv2 CBOR response, status: "+t.statusCode)},VD=async(t,r,n,s,o)=>{let i=await t.endpoint(),{hostname:u,protocol:a="https",port:d,path:l}=i,h={protocol:a,hostname:u,port:d,method:"POST",path:l.endsWith("/")?l.slice(0,-1)+n:l+n,headers:{...r}};if(s!==void 0)h.hostname=s;if(i.headers)for(let f in i.headers){if(!ae(i.headers,f))continue;h.headers[f]=i.headers[f]}if(o!==void 0){h.body=o;try{h.headers["content-length"]=String(gD(o))}catch(f){}}return new yD(h)};class nc extends gn{write(t,r){T=0;let n=we.of(t);mr(n,r,void 0,this.serdeContext)}flush(){let t=R.subarray(0,T);return T=0,R=ag(Qa),Ft=new DataView(R.buffer,R.byteOffset,R.byteLength),t}}var Kp=Symbol.for("@smithy/cbor-struct-cache");function sc(t){let r=t.getSchema(),n=r[Kp];if(n)return n;let s=[],o=[];for(let[a,d]of t.structIterator())s.push(a),o.push(d);let i=Array(s.length);for(let a=0;a<s.length;++a)i[a]=jD(s[a]);let u={memberNames:s,memberSchemas:o,encodedKeys:i};return r[Kp]=u,u}function jD(t){let r;if(Ds)r=Buffer.from(t,"utf-8");else r=new TextEncoder().encode(t);let n=r.length,s;if(n<24)s=1;else if(n<256)s=2;else s=3;let o=new Uint8Array(s+n);if(s===1)o[0]=96|n;else if(s===2)o[0]=120,o[1]=n;else o[0]=121,o[1]=n>>8,o[2]=n&255;return o.set(r,s),o}var Ds=typeof Buffer<"u",WD=new TextEncoder,Qa=2048,R=Ds?Buffer.allocUnsafe(Qa):new Uint8Array(Qa),Ft=new DataView(R.buffer,R.byteOffset,R.byteLength),T=0,Qp=2048,gr=new Map,qa=0,Xp=!1;function ag(t){return Ds?Buffer.allocUnsafe(t):new Uint8Array(t)}function mr(t,r,n,s){if(r==null){if(r===void 0&&t.isIdempotencyToken()){Be(rg());return}M(1),R[T++]=246;return}if(t.isUnitSchema()){M(1),Y(5,0);return}if(typeof r==="object"){if(t.isBlobSchema()){if(r instanceof Uint8Array){Os(r);return}}if(t.isTimestampSchema()){if(r instanceof Date){Xa(r);return}}if(t.isStructSchema()){GD(t,r,s);return}if(Array.isArray(r)&&(t.isListSchema()||t.isDocumentSchema())){Yp(t,r,t.isDocumentSchema(),s);return}if(t.isMapSchema()){Va(t,r,!1,s);return}if(r instanceof Date){Xa(r);return}if(r instanceof Uint8Array){Os(r);return}if(r instanceof pn){dg(r);return}if(r[mn]){let i=r;ug(i.tag,i.value);return}if(t.isDocumentSchema()){if(Array.isArray(r))Yp(t,r,!0,s);else Va(t,r,!0,s);return}if(t.isBigDecimalSchema()){yr(r);return}Va(t,r,!0,s);return}if(typeof r==="string"){if(t.isBlobSchema()){let i=(s?.base64Decoder??Ya)(r);Os(i);return}Be(r);return}if(typeof r==="number"){if(M(9),Number.isInteger(r)&&r>=-9007199254740992&&r<=9007199254740991)Fs(r);else oc(r);return}if(typeof r==="boolean"){M(1),R[T++]=224|(r?21:20);return}if(typeof r==="bigint"){ks(r);return}Be(String(r))}function GD(t,r,n){if(t.isUnionSchema()){let f=!1;for(let[p,g]of t.structIterator()){let m=r[p];if(m!=null){M(9),Y(5,1),Be(p),mr(g,m,t,n),f=!0;break}}if(!f){let{$unknown:p}=r;if(Array.isArray(p))M(9),Y(5,1),Be(p[0]),yr(p[1]);else M(9),Y(5,0)}return}let s=sc(t),{memberNames:o,memberSchemas:i,encodedKeys:u}=s,a=o.length,d;if(a<24)d=1;else if(a<256)d=2;else d=3;M(d);let l=T;T+=d;let h=0;for(let f=0;f<a;++f){let p=r[o[f]];if(p==null&&!i[f].isIdempotencyToken())continue;let g=u[f];M(g.length),R.set(g,T),T+=g.length,mr(i[f],p,t,n),++h}if(typeof r.__type==="string")for(let f in r){if(!ae(r,f))continue;if(!o.includes(f))Be(f),yr(r[f]),++h}if(d===1)R[l]=160|h;else if(d===2)R[l]=184,R[l+1]=h;else R[l]=185,R[l+1]=h>>8,R[l+2]=h&255}function Yp(t,r,n,s){let o=!!t.getMergedTraits().sparse,i=t.getValueSchema();if(n||o){let u=[];for(let a=0;a<r.length;++a){let d=r[a];if(n){if(d!==void 0)u.push(d)}else if(d!=null||o)u.push(d)}M(9),Y(4,u.length);for(let a=0;a<u.length;++a)mr(i,u[a],void 0,s)}else{let u=0;for(let a=0;a<r.length;++a)if(r[a]!=null)++u;M(9),Y(4,u);for(let a=0;a<r.length;++a)if(r[a]!=null)mr(i,r[a],void 0,s)}}function Va(t,r,n,s){let o=!!t.getMergedTraits().sparse,i=t.getValueSchema(),u=[];for(let a in r){if(!ae(r,a))continue;let d=r[a];if(n?d!==void 0:d!=null||o)u.push(a)}M(9),Y(5,u.length);for(let a=0;a<u.length;++a){let d=u[a];Be(d),mr(i,r[d],void 0,s)}}function yr(t){if(t==null){M(1),R[T++]=246;return}if(typeof t==="string"){Be(t);return}if(typeof t==="number"){if(M(9),Number.isInteger(t)&&t>=-9007199254740992&&t<=9007199254740991)Fs(t);else oc(t);return}if(typeof t==="boolean"){M(1),R[T++]=224|(t?21:20);return}if(typeof t==="bigint"){ks(t);return}if(t instanceof Uint8Array){Os(t);return}if(t instanceof Date){Xa(t);return}if(t instanceof pn){dg(t);return}if(t[mn]){let r=t;ug(r.tag,r.value);return}if(Array.isArray(t)){M(9),Y(4,t.length);for(let r=0;r<t.length;++r)yr(t[r]);return}if(typeof t==="object"){let r=Object.keys(t);M(9),Y(5,r.length);for(let n=0;n<r.length;++n)Be(r[n]),yr(t[r[n]]);return}Be(String(t))}function M(t){if(T+t>R.length){let r=R.length*2;while(r<T+t)r*=2;let n=ag(r);n.set(R.subarray(0,T)),R=n,Ft=new DataView(n.buffer,n.byteOffset,n.byteLength)}}function Y(t,r){if(r<24)R[T++]=t<<5|r;else if(r<256)R[T++]=t<<5|24,R[T++]=r;else if(r<65536)R[T++]=t<<5|25,R[T++]=r>>8,R[T++]=r&255;else if(r<4294967296)R[T++]=t<<5|26,Ft.setUint32(T,r),T+=4;else{R[T++]=t<<5|27;let n=r/4294967296|0,s=r-n*4294967296|0;Ft.setUint32(T,n),Ft.setUint32(T+4,s),T+=8}}function cg(t,r){let n=Number(r);if(n<4294967296){Y(t,n);return}R[T++]=t<<5|27,Ft.setBigUint64(T,r),T+=8}function Be(t){let r=t.length;if(r<=23){let n=gr.get(t);if(n){M(n.bytes.length),R.set(n.bytes,T),T+=n.bytes.length,n.epoch=qa;return}let s=T;Jp(t,r);let o=T,i=Uint8Array.prototype.slice.call(R,s,o);if(gr.size>=Qp){if(Xp)return;let u=0;for(let[a,d]of gr){if(u>=1024)break;if(d.epoch!==qa)gr.delete(a),++u}if(u===0){Xp=!0;return}}if(gr.size<Qp)gr.set(t,{epoch:qa,bytes:i});return}Jp(t,r)}function Jp(t,r){if(Ds){let n=r*3;M(n+9);let s=Buffer.byteLength(t);Y(3,s),T+=R.write(t,T)}else{let n=r*3;M(n+9);let s=T,i=WD.encodeInto(t,R.subarray(s+9)).written,u;if(i<24)u=1;else if(i<256)u=2;else if(i<65536)u=3;else if(i<4294967296)u=5;else u=9;if(u<9)R.copyWithin(s+u,s+9,s+9+i);T=s,Y(3,i),T+=i}}function oc(t){M(9),R[T++]=251,Ft.setFloat64(T,t),T+=8}function Fs(t){M(9);let r=t>=0,n=r?0:1,s=r?t:-t-1;Y(n,s)}function ks(t){let r=t>=0,n=r?0:1,s=r?t:-t-BigInt(1);if(s<BigInt("18446744073709551616"))M(9),cg(n,s);else{let o=s.toString(2),i=Math.ceil(o.length/8),u=new Uint8Array(i),a=s;for(let d=i-1;d>=0;--d)u[d]=Number(a&BigInt(255)),a>>=BigInt(8);M(i+16),R[T++]=r?194:195,Y(2,i),R.set(u,T),T+=i}}function Os(t){M(t.length+9),Y(2,t.length),R.set(t,T),T+=t.length}function ug(t,r){if(M(9),typeof t==="bigint")cg(6,t);else Y(6,t);yr(r)}function dg(t){let r=t.string,n=BigInt(0),s=r.search(/[eE]/);if(s!==-1)n=BigInt(r.slice(s+1)),r=r.slice(0,s);let o=r.indexOf("."),i=o===-1?0:r.length-o-1,u=n-BigInt(i),a=BigInt(r.replace(".",""));if(M(9),R[T++]=196,Y(4,2),M(9),u>=-0x20000000000000n&&u<=0x1fffffffffffffn)Fs(Number(u));else ks(u);ks(a)}function Xa(t){M(18),Y(6,1);let r=t.getTime()/1000;if(Number.isInteger(r))Fs(r);else oc(r)}class ic extends gn{read(t,r){return H=r,cc=lg&&r instanceof Buffer,dt=new DataView(r.buffer,r.byteOffset,r.byteLength),_=0,X=r.length,ln=ln+1&65535,ye(we.of(t))}readValue(t,r){return Ps(we.of(t),r)}}var lg=typeof Buffer<"u",ac=new TextDecoder,H=new Uint8Array(0),cc=!1,dt=new DataView(new ArrayBuffer(0)),_=0,X=0,uc=2048,Zp=Array(uc),ja=new Uint16Array(uc),ln=0;function ye(t){if(_>=X)throw Error("unexpected end of CBOR payload.");let r=(H[_]&224)>>5;if((H[_]&31)===31&&r>=2&&r<=5)return JD(t,r);switch(r){case 0:return nF();case 1:return sF();case 2:return $s();case 3:return Sr();case 4:return KD(t);case 5:return QD(t);case 6:return YD();case 7:return iF();default:throw Error(`unexpected CBOR major type ${r}.`)}}function KD(t){let r=Us(),n=t.isListSchema()?t.getValueSchema():t,s=Array(r);for(let o=0;o<r;++o)s[o]=ye(n);return s}function QD(t){let r=Us();if(t.isStructSchema())return XD(t,r,_);let n=t.isMapSchema()?t.getValueSchema():t,s={};for(let o=0;o<r;++o){let i=Sr();s[i]=ye(n)}return s}function XD(t,r,n){let s=t.isUnionSchema(),o=sc(t),{memberSchemas:i,encodedKeys:u,memberNames:a}=o,d=u.length,l={},h,f,p=0,g=!1,m=0;for(let y=0;y<r;++y){let S=fg(u,d,m);if(S>=0){if(m=S+1,m>=d)m=0;let w=ye(i[S]);if(w!=null)l[a[S]]=w}else{let w=Sr(),E=ye(we.of(15));if(w==="__type"&&typeof E==="string")g=!0;else h=w,f=E,++p}}if(s){let y=!0;for(let S in l){if(!ae(l,S))continue;y=!1;break}if(y&&p===1)l.$unknown=[h,f]}else if(g){_=n;let y=we.of(15);for(let S=0;S<r;++S){let w=Sr(),E=ye(y);if(!(w in l))l[w]=E}}return l}function YD(t){let r=Ls(),n=typeof r==="bigint"?Number(r):r;if(n===1){let i=we.of(15),u=ye(i);return fn(u)}if(n===2||n===3){let i=$s(),u=BigInt(0);for(let a=0;a<i.length;++a)u=u<<BigInt(8)|BigInt(i[a]);return n===3?-u-BigInt(1):u}if(n===4){let i=we.of(15),u=ye(i),[a,d]=u,l=d<0?-1:1,h=BigInt(l)*BigInt(d),f=String(h),p=d<0?"-":"",g;if(typeof a==="number"&&Math.abs(a)<=268435456){let y=a,S="0".repeat(Math.abs(y)+1)+f;if(g=y===0?S:S.slice(0,S.length+y)+"."+S.slice(y),g=g.replace(/^0+/g,""),g==="")g="0";if(g[0]===".")g="0"+g;g=p+g}else{let y=BigInt(a);if(f.length===1)g=p+f+"e"+String(y);else{let S=y+BigInt(f.length-1);g=p+f[0]+"."+f.slice(1)+"e"+String(S)}}return tg(g)}let s=we.of(15),o=ye(s);return{tag:hg(r),value:o}}function JD(t,r){switch(r){case 3:return ZD();case 2:return eF();case 4:return tF(t);case 5:return rF(t);default:throw Error(`unexpected indefinite length for major ${r}.`)}}function ZD(){_+=1;let t=[],r=0;while(_<X){if(H[_]===255){_+=1;let s=new Uint8Array(r),o=0;for(let i=0;i<t.length;++i)s.set(t[i],o),o+=t[i].length;if(lg)return Buffer.from(s.buffer,s.byteOffset,s.byteLength).toString("utf-8");return ac.decode(s)}let n=$s();t.push(n),r+=n.length}throw Error("expected break marker.")}function eF(){_+=1;let t=[],r=0;while(_<X){if(H[_]===255){_+=1;let s=new Uint8Array(r),o=0;for(let i=0;i<t.length;++i)s.set(t[i],o),o+=t[i].length;return s}let n=$s();t.push(n),r+=n.length}throw Error("expected break marker.")}function tF(t){_+=1;let r=t.isListSchema()?t.getValueSchema():t,n=[];while(_<X){if(H[_]===255)return _+=1,n;n.push(ye(r))}throw Error("expected break marker.")}function rF(t){if(_+=1,t.isStructSchema()){let s=sc(t),{memberSchemas:o,encodedKeys:i,memberNames:u}=s,a=i.length,d=t.isUnionSchema(),l={},h,f,p=0,g=0;while(_<X){if(H[_]===255){if(_+=1,d){let y=!0;for(let S in l){if(!ae(l,S))continue;y=!1;break}if(y&&p===1)l.$unknown=[h,f]}return l}let m=fg(i,a,g);if(m>=0){if(g=m+1,g>=a)g=0;let y=ye(o[m]);if(y!=null)l[u[m]]=y}else{let y=Sr(),S=ye(we.of(15));if(y!=="__type")h=y,f=S,++p}}throw Error("expected break marker.")}let r=t.isMapSchema()?t.getValueSchema():t,n={};while(_<X){if(H[_]===255)return _+=1,n;let s=Sr();n[s]=ye(r)}throw Error("expected break marker.")}function fg(t,r,n){let s=t[n];if(_+s.length<=X&&eg(_,s))return _+=s.length,n;for(let o=0;o<r;++o){if(o===n)continue;let i=t[o];if(_+i.length<=X&&eg(_,i))return _+=i.length,o}return-1}function eg(t,r){let n=r.length;if(H[t]!==r[0])return!1;for(let s=1;s<n;++s)if(H[t+s]!==r[s])return!1;return!0}function Ls(){let t=H[_]&31;if(t<24)return _+=1,t;switch(t){case 24:if(X-_<2)Qe(1);return _+=2,H[_-1];case 25:if(X-_<3)Qe(2);return _+=3,dt.getUint16(_-2);case 26:if(X-_<5)Qe(4);return _+=5,dt.getUint32(_-4);case 27:{if(X-_<9)Qe(8);_+=9;let r=dt.getUint32(_-8);if(r<2097152)return r*4294967296+dt.getUint32(_-4);return dt.getBigUint64(_-8)}default:throw Error(`unexpected minor value ${t}.`)}}function Us(){let t=Ls();return typeof t==="bigint"?Number(t):t}function nF(){let t=Ls();return hg(t)}function sF(){let t=Ls();if(typeof t==="bigint")return BigInt(-1)-t;return-1-t}function $s(){let t=Us();if(X-_<t)Qe(t);let r=_;return _+=t,H.subarray(r,r+t)}function Sr(){let t=Us();if(X-_<t)Qe(t);let r=_;if(_+=t,t<24)return oF(r,t);if(cc)return H.toString("utf-8",r,r+t);return ac.decode(H.subarray(r,r+t))}function oF(t,r){let n=r;for(let u=0;u<r;++u)n=n*31+H[t+u]|0;let s=n>>>0&uc-1,o=Zp[s];if(o!==void 0&&o.length===r){let u=!0;for(let a=0;a<r;++a)if(o.charCodeAt(a)!==H[t+a]){u=!1;break}if(u)return ja[s]=ln,o}let i=cc?H.toString("utf-8",t,t+r):ac.decode(H.subarray(t,t+r));if(ja[s]!==ln)Zp[s]=i,ja[s]=ln;return i}function iF(){let t=_,r=H[t]&31;switch(r){case 21:return _=t+1,!0;case 20:return _=t+1,!1;case 22:return _=t+1,null;case 23:return _=t+1,null;case 25:{if(X-t<3)Qe(2);return _=t+3,aF(H[t+1],H[t+2])}case 26:{if(X-t<5)Qe(4);return _=t+5,dt.getFloat32(t+1)}case 27:{if(X-t<9)Qe(8);return _=t+9,dt.getFloat64(t+1)}default:throw Error(`unexpected minor value ${r} for major 7.`)}}function aF(t,r){let n=t>>7,s=(t&124)>>2,o=(t&3)<<8|r,i=n===0?1:-1;if(s===0){if(o===0)return 0;return i*(Math.pow(2,-14)*(o/1024))}else if(s===31){if(o===0)return i*(1/0);return NaN}return i*(Math.pow(2,s-15)*(1+o/1024))}function hg(t){if(typeof t==="number")return t;let r=Number(t);if(Number.MIN_SAFE_INTEGER<=r&&r<=Number.MAX_SAFE_INTEGER)return r;return t}function Qe(t){throw Error(`CBOR: length ${t} greater than remaining buffer length.`)}function Ps(t,r){if(t.isTimestampSchema()){if(typeof r==="number")return fn(r);if(typeof r==="object"&&r!==null){if(r.tag===1&&"value"in r)return fn(r.value)}}if(t.isBlobSchema())return r;if(typeof r>"u"||typeof r==="boolean"||typeof r==="number"||typeof r==="string"||typeof r==="bigint"||typeof r==="symbol")return r;if(typeof r!=="object"||r===null)return r;if("byteLength"in r)return r;if(r instanceof Date)return r;if(r instanceof pn)return r;if(t.isDocumentSchema())return r;if(t.isListSchema()){let s=t.getValueSchema(),o=[];for(let i of r)o.push(Ps(s,i));return o}let n={};if(t.isMapSchema()){let s=t.getValueSchema();for(let o in r){if(!ae(r,o))continue;n[o]=Ps(s,r[o])}}else if(t.isStructSchema()){let s=t.isUnionSchema(),o;if(s){o=new Set;for(let i in r){if(!ae(r,i))continue;if(i!=="__type")o.add(i)}}for(let[i,u]of t.structIterator()){if(s)o.delete(i);if(r[i]!=null)n[i]=Ps(u,r[i])}if(s&&o?.size===1){let i=!0;for(let u in n){if(!ae(n,u))continue;i=!1;break}if(i){let u=o.values().next().value;n.$unknown=[u,r[u]]}}else if(typeof r.__type==="string")for(let i in r){if(!ae(r,i))continue;if(!(i in n))n[i]=r[i]}}return n}class dc extends gn{createSerializer(){let t=new nc;return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new ic;return t.setSerdeContext(this.serdeContext),t}}class pg extends wD{codec=new dc;serializer=this.codec.createSerializer();deserializer=this.codec.createDeserializer();constructor({defaultNamespace:t,errorTypeRegistries:r}){super({defaultNamespace:t,errorTypeRegistries:r})}getShapeId(){return"smithy.protocols#rpcv2Cbor"}getPayloadCodec(){return this.codec}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n);if(Object.assign(s.headers,{"content-type":this.getDefaultContentType(),"smithy-protocol":"rpc-v2-cbor",accept:this.getDefaultContentType()}),ED(t.input)==="unit")delete s.body,delete s.headers["content-type"];else{if(!s.body)this.serializer.write(15,{}),s.body=this.serializer.flush();if(s.body instanceof Uint8Array)s.headers["content-length"]=String(s.body.byteLength)}let{service:o,operation:i}=mD(n),u=`/service/${o}/operation/${i}`;if(s.path.endsWith("/"))s.path+=u.slice(1);else s.path+=u;return s}async deserializeResponse(t,r,n){return super.deserializeResponse(t,r,n)}async handleError(t,r,n,s,o){let i=ig(n,s)??"Unknown",u=["*"],{defaultNamespace:a}=this.options;u.unshift(a);let[d,l]=(()=>{if(i.includes("#"))return i.split("#");return[void 0,i]})();if(d)u.unshift(d);let h={$metadata:o,$fault:n.statusCode<500?"client":"server"},f=[this.compositeErrorRegistry];if(d)f.push(jp.for(d));f.push(jp.for(a));let[p,g,m]=this.resolveError(l,u,f);if(m==="native"||m==="synthetic"){if(s.Message)s.message=s.Message;let A=m==="synthetic"?new g({name:l}):Error(l);throw Object.assign(A,h,s)}let y=we.of(p),S=s.message??s.Message??"Unknown",w=new g({}),E={};for(let[A,v]of y.structIterator())E[A]=this.deserializer.readValue(v,s[A]);throw Object.assign(w,h,{$fault:y.getMergedTraits().error,message:S},E)}getDefaultContentType(){return"application/cbor"}}class gg extends gn{value;write(t,r){this.value=this.serialize(t,r)}serialize(t,r){let n=we.of(t);if(r==null){if(n.isIdempotencyToken())return rg();return r}if(n.isBlobSchema()){if(typeof r==="string")return(this.serdeContext?.base64Decoder??Ya)(r);return r}if(n.isTimestampSchema()){if(typeof r==="number"||typeof r==="bigint")return Ns(new Date(Number(r)/1000|0));return Ns(r)}if(typeof r==="function"||typeof r==="object"){let s=r;if(n.isListSchema()&&Array.isArray(s)){let i=!!n.getMergedTraits().sparse,u=[],a=0;for(let d of s){let l=this.serialize(n.getValueSchema(),d);if(l!=null||i)u[a++]=l}return u}if(s instanceof Date)return Ns(s);let o={};if(n.isMapSchema()){let i=!!n.getMergedTraits().sparse;for(let u in s){if(!ae(s,u))continue;let a=this.serialize(n.getValueSchema(),s[u]);if(a!=null||i)o[u]=a}}else if(n.isStructSchema()){for(let[u,a]of n.structIterator()){let d=this.serialize(a,s[u]);if(d!=null)o[u]=d}if(n.isUnionSchema()&&Array.isArray(s.$unknown)){let[u,a]=s.$unknown;o[u]=a}else if(typeof s.__type==="string")for(let u in s){if(!ae(s,u))continue;if(!(u in o))o[u]=this.serialize(15,s[u])}}else if(n.isDocumentSchema()){if(Array.isArray(s)){let i=[],u=0;for(let a of s)i[u++]=this.serialize(n.getValueSchema(),a);return i}for(let i in s){if(!ae(s,i))continue;o[i]=this.serialize(n.getValueSchema(),s[i])}}else if(n.isBigDecimalSchema())return s;return o}return r}flush(){let t=Ms.serialize(this.value);return this.value=void 0,t}}class mg extends gn{read(t,r){let n=Ms.deserialize(r);return this.readValue(t,n)}readValue(t,r){let n=we.of(t);if(n.isTimestampSchema()){if(typeof r==="number")return fn(r);if(typeof r==="object"){if(r.tag===1&&"value"in r)return fn(r.value)}}if(n.isBlobSchema()){if(typeof r==="string")return(this.serdeContext?.base64Decoder??Ya)(r);return r}if(typeof r>"u"||typeof r==="boolean"||typeof r==="number"||typeof r==="string"||typeof r==="bigint"||typeof r==="symbol")return r;else if(typeof r==="object"){if(r===null)return null;if("byteLength"in r)return r;if(r instanceof Date)return r;if(n.isDocumentSchema())return r;if(n.isListSchema()){let o=[],i=n.getValueSchema();for(let u of r){let a=this.readValue(i,u);o.push(a)}return o}let s={};if(n.isMapSchema()){let o=n.getValueSchema();for(let i in r){if(!ae(r,i))continue;let u=this.readValue(o,r[i]);s[i]=u}}else if(n.isStructSchema()){let o=n.isUnionSchema(),i;if(o){i=new Set;for(let u in r){if(!ae(r,u))continue;if(u!=="__type")i.add(u)}}for(let[u,a]of n.structIterator()){if(o)i.delete(u);if(r[u]!=null)s[u]=this.readValue(a,r[u])}if(o&&i?.size===1){let u=!0;for(let a in s){if(!ae(s,a))continue;u=!1;break}if(u){let a=i.values().next().value;s.$unknown=[a,r[a]]}}else if(typeof r.__type==="string")for(let u in r){if(!ae(r,u))continue;if(!(u in s))s[u]=r[u]}}else if(r instanceof pn)return r;return s}else return r}}cF.CborCodec=dc;cF.CborShapeDeserializer=mg;cF.CborShapeDeserializer2=ic;cF.CborShapeSerializer=gg;cF.CborShapeSerializer2=nc;cF.SmithyRpcV2CborProtocol=pg;cF.buildHttpRpcRequest=VD;cF.cbor=Ms;cF.checkCborResponse=qD;cF.dateToTag=Ns;cF.loadSmithyRpcV2CborErrorCode=ig;cF.parseCborBody=og;cF.parseCborErrorBody=zD;cF.tag=Ja;cF.tagSymbol=mn});var Sg=e(function(OF){var xF=/[&<>"]/g,TF={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function CF(t){return t.replace(xF,(r)=>TF[r])}var IF=/[&"'<>\r\n\u0085\u2028]/g,RF={"&":"&amp;",'"':"&quot;","'":"&apos;","<":"&lt;",">":"&gt;","\r":"&#x0D;","\n":"&#x0A;","…":"&#x85;","\u2028":"&#x2028;"};function vF(t){return t.replace(IF,(r)=>RF[r])}class fc{value;constructor(t){this.value=t}toString(){return vF(""+this.value)}}class Sn{name;children;attributes={};static of(t,r,n){let s=new Sn(t);if(r!==void 0)s.addChildNode(new fc(r));if(n!==void 0)s.withName(n);return s}constructor(t,r=[]){this.name=t,this.children=r}withName(t){return this.name=t,this}addAttribute(t,r){return this.attributes[t]=r,this}addChildNode(t){return this.children.push(t),this}removeAttribute(t){return delete this.attributes[t],this}n(t){return this.name=t,this}c(t){return this.children.push(t),this}a(t,r){if(r!=null)this.attributes[t]=r;return this}cc(t,r,n=r){if(t[r]!=null){let s=Sn.of(r,t[r]).withName(n);this.c(s)}}l(t,r,n,s){if(t[r]!=null)s().map((i)=>{i.withName(n),this.c(i)})}lc(t,r,n,s){if(t[r]!=null){let o=s(),i=new Sn(n);o.map((u)=>{i.c(u)}),this.c(i)}}toString(){let t=Boolean(this.children.length),r=`<${this.name}`,n=this.attributes;for(let s of Object.keys(n)){let o=n[s];if(o!=null)r+=` ${s}="${CF(""+o)}"`}return r+=!t?"/>":`>${this.children.map((s)=>s.toString()).join("")}</${this.name}>`}}function lc(t){Object.defineProperty(t,"__proto__",{value:void 0,writable:!0,enumerable:!0,configurable:!0})}function NF(t){return new hc(t).parse()}class hc{x;i=0;z;constructor(t){this.x=t,this.x=t.replace(/\r\n?/g,`
45
+ `),this.z=this.x.length}parse(){let t=this,{z:r}=t;while(t.i<r){if(t.trim(),t.i>=r)break;if(t.isNext("<?"))t.readTo("?>"),t.trim();else if(t.isNext("<!--"))t.readTo("-->"),t.trim();else if(t.isNext("<!DOCTYPE",!1))t.skipDoctype(),t.trim();else if(t.x[t.i]==="<"){let n=t.parseTag();return{[n.tag]:n.value}}else throw Error("@aws-sdk XML parse error: unexpected content.")}throw Error("@aws-sdk XML parse error: no root element.")}isNext(t,r=!0){let n=this;if(r)return n.x.startsWith(t,n.i);return n.x.toLowerCase().startsWith(t.toLowerCase(),n.i)}readTo(t){let r=this,n=r.x.indexOf(t,r.i);if(n===-1)throw Error(`@aws-sdk XML parse error: expected "${t}" not found.`);let s=r.x.slice(r.i,n);return r.i=n+t.length,s}trim(){let t=this;while(t.i<t.z&&` \r
46
+ `.includes(t.x[t.i]))++t.i}readAttrValue(){let t=this,r=t.x[t.i];++t.i;let n="";while(t.i<t.z&&t.x[t.i]!==r)n+=t.x[t.i++];return++t.i,t.decodeEntities(n)}parseTag(){let t=this;++t.i;let r="";while(t.i<t.z&&!` \r
47
+ >/`.includes(t.x[t.i]))r+=t.x[t.i++];let n=!1,s={};while(t.i<t.z){if(t.trim(),">/".includes(t.x[t.i]))break;let l="";while(t.i<t.z&&!`= \r
48
+ >/?`.includes(t.x[t.i]))l+=t.x[t.i++];if(t.trim(),t.x[t.i]!=="=")break;if(++t.i,t.trim(),l==="__proto__")lc(s);s[l]=t.readAttrValue(),n=!0}if(t.i>=t.z)throw Error("@aws-sdk XML parse error: unexpected end of input.");if(t.x[t.i]==="/"){if(++t.i,t.i>=t.z||t.x[t.i]!==">")throw Error("@aws-sdk XML parse error: expected > at the end of self-closing tag.");return++t.i,{tag:r,value:n?s:""}}if(t.x[t.i]!==">")throw Error("@aws-sdk XML parse error: expected > at the end of opening tag.");++t.i;let o=[],i=[],u=!1;while(t.i<t.z){if(t.isNext("</"))break;if(t.x[t.i]==="<")if(t.isNext("<!--"))t.readTo("-->");else if(t.isNext("<![CDATA["))t.i+=9,o.push(t.readTo("]]>"));else if(t.isNext("<?"))t.readTo("?>");else u=!0,i.push(t.parseTag());else{let l="";while(t.i<t.z&&t.x[t.i]!=="<")l+=t.x[t.i++];o.push(t.decodeEntities(l))}}if(!t.isNext("</"))throw Error(`@aws-sdk XML parse error: missing closing tag </${r}>.`);t.i+=2;let a=t.readTo(">").trim();if(a!==r)throw Error(`@aws-sdk XML parse error: mismatched tags <${r}> and </${a}>.`);if(!n&&o.length===0&&!u)return{tag:r,value:""};if(!n&&!u){let l=o.length===1?o[0]:o.join("");if(l.trim()===""&&l.includes(`
49
+ `))return{tag:r,value:""};return{tag:r,value:l}}let d={};for(let l of o){if(l.trim()===""&&l.includes(`
50
+ `))continue;d["#text"]="#text"in d?d["#text"]+l:l}for(let l of i){if(l.tag==="__proto__")lc(d);if(l.tag in d)if(Array.isArray(d[l.tag]))d[l.tag].push(l.value);else d[l.tag]=[d[l.tag],l.value];else d[l.tag]=l.value}for(let[l,h]of Object.entries(s)){if(l==="__proto__")lc(d);d[l]=h}return{tag:r,value:d}}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};skipDoctype(){let t=this;t.i+=9;let r=0;while(t.i<t.z){let n=t.x[t.i];if(n==="[")++r;else if(n==="]")--r;else if(n===">"&&r===0){++t.i;return}++t.i}throw Error("@aws-sdk XML parse error: unclosed DOCTYPE.")}decodeEntities(t){return t.replace(/&(?:#x([0-9a-fA-F]{1,6})|#(\d{1,7})|([a-zA-Z][a-zA-Z0-9]{0,30}));/g,(r,n,s,o)=>{if(n)return String.fromCharCode(parseInt(n,16));if(s)return String.fromCharCode(parseInt(s,10));return hc.ENTITIES[o]??""})}}OF.XmlNode=Sn;OF.XmlText=fc;OF.parseXML=NF});var Qt=e(function(ZF){var{SmithyRpcV2CborProtocol:DF,loadSmithyRpcV2CborErrorCode:FF}=yg(),{TypeRegistry:wg,NormalizedSchema:F,deref:Ng}=Re(),{decorateServiceException:Eg,getValueFromTextNode:Og}=Ie(),{collectBody:qs,determineTimestampFormat:_r,RpcProtocol:Pg,HttpBindingProtocol:kg,HttpInterceptingShapeSerializer:Mg,HttpInterceptingShapeDeserializer:Dg,FromStringShapeDeserializer:LF,extendedEncodeURIComponent:bg}=K(),{NumericValue:re,toUtf8:Sc,fromBase64:wc,LazyJsonString:Ws,parseEpochTimestamp:Fg,parseRfc7231DateTime:Lg,parseRfc3339DateTimeWithOffset:Ug,generateIdempotencyToken:Gs,toBase64:br,dateToUtcString:En,expectUnion:UF}=ee(),{parseXML:$g,XmlNode:xe,XmlText:_g}=Sg();class Ar{queryCompat;errorRegistry;constructor(t=!1){this.queryCompat=t}resolveRestContentType(t,r){let n=r.getMemberSchemas(),s=Object.values(n).find((o)=>!!o.getMergedTraits().httpPayload);if(s){let o=s.getMergedTraits().mediaType;if(o)return o;else if(s.isStringSchema())return"text/plain";else if(s.isBlobSchema())return"application/octet-stream";else return t}else if(!r.isUnitSchema()){if(Object.values(n).find((i)=>{let{httpQuery:u,httpQueryParams:a,httpHeader:d,httpLabel:l,httpPrefixHeaders:h}=i.getMergedTraits();return!u&&!a&&!d&&!l&&h===void 0}))return t}}async getErrorSchemaOrThrowBaseException(t,r,n,s,o,i){let u=t;if(t.includes("#"))[,u]=t.split("#");let a={$metadata:o,$fault:n.statusCode<500?"client":"server"};if(!this.errorRegistry)throw Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:i?.(this.errorRegistry,u)??this.errorRegistry.getSchema(t),errorMetadata:a}}catch(d){s.message=s.message??s.Message??"UnknownError";let l=this.errorRegistry,h=l.getBaseException();if(h){let g=l.getErrorCtor(h)??Error;throw this.decorateServiceException(Object.assign(new g({name:u}),a),s)}let f=s,p=f?.message??f?.Message??f?.Error?.Message??f?.Error?.message;throw this.decorateServiceException(Object.assign(Error(p),{name:u},a),s)}}compose(t,r,n){let s=n;if(r.includes("#"))[s]=r.split("#");let o=wg.for(s),i=wg.for("smithy.ts.sdk.synthetic."+n);t.copyFrom(o),t.copyFrom(i),this.errorRegistry=t}decorateServiceException(t,r={}){if(this.queryCompat){let n=t.Message??r.Message,s=Eg(t,r);if(n)s.message=n;let o=s.Error??{};o.Type=s.Error?.Type,o.Code=s.Error?.Code,o.Message=s.Error?.message??s.Error?.Message??n,s.Error=o;let i=s.$metadata.requestId;if(i)s.RequestId=i;return s}return Eg(t,r)}setQueryCompatError(t,r){let n=r.headers?.["x-amzn-query-error"];if(t!==void 0&&n!=null){let[s,o]=n.split(";"),i=Object.keys(t),u={Code:s,Type:o};t.Code=s,t.Type=o;for(let a=0;a<i.length;a++){let d=i[a];u[d==="message"?"Message":d]=t[d]}delete u.__type,t.Error=u}}queryCompatOutput(t,r){if(t.Error)r.Error=t.Error;if(t.Type)r.Type=t.Type;if(t.Code)r.Code=t.Code}findQueryCompatibleError(t,r){try{return t.getSchema(r)}catch(n){return t.find((s)=>F.of(s).getMergedTraits().awsQueryError?.[0]===r)}}}class Bg extends DF{awsQueryCompatible;mixin;constructor({defaultNamespace:t,errorTypeRegistries:r,awsQueryCompatible:n}){super({defaultNamespace:t,errorTypeRegistries:r});this.awsQueryCompatible=!!n,this.mixin=new Ar(this.awsQueryCompatible)}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n);if(this.awsQueryCompatible)s.headers["x-amzn-query-mode"]="true";return s}async handleError(t,r,n,s,o){if(this.awsQueryCompatible)this.mixin.setQueryCompatError(s,n);let i=(()=>{let g=n.headers["x-amzn-query-error"];if(g&&this.awsQueryCompatible)return g.split(";")[0];return FF(n,s)??"Unknown"})();this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace);let{errorSchema:u,errorMetadata:a}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,n,s,o,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),d=F.of(u),l=s.message??s.Message??"UnknownError",f=new(this.compositeErrorRegistry.getErrorCtor(u)??Error)({}),p={};for(let[g,m]of d.structIterator())if(s[g]!=null)p[g]=this.deserializer.readValue(m,s[g]);if(this.awsQueryCompatible)this.mixin.queryCompatOutput(s,p);throw this.mixin.decorateServiceException(Object.assign(f,a,{$fault:d.getMergedTraits().error,message:l},p),s)}}class Te{serdeContext;setSerdeContext(t){this.serdeContext=t}}class Ks{from;to;keys;constructor(t,r){this.from=t,this.to=r;let n=Object.keys(this.from),s=new Set(n);s.delete("__type"),this.keys=s}mark(t){this.keys.delete(t)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){let t=this.keys.values().next().value,r=this.from[t];this.to.$unknown=[t,r]}}}var wn;function Hg(){if(wn===void 0)try{if(typeof Buffer!=="function")wn=!1;else{let t=JSON.parse(Buffer.from([123,125]));wn=t!==null&&typeof t==="object"}}catch{wn=!1}return wn}function Ec(t,r,n){if(n?.source){let s=n.source;if(typeof r==="number")if(r<=Number.MAX_SAFE_INTEGER&&r>=Number.MIN_SAFE_INTEGER){if(BF(s,r))return r;return new re(s,"bigDecimal")}else{if($F(s))return new re(s,"bigDecimal");if(/[eE]/.test(s))return HF(s);return BigInt(s)}}return r}function $F(t){let r=t.indexOf(".");if(r===-1)return!1;let n=t.search(/[eE]/);if(n===-1)return!0;let s=n-r-1;return parseInt(t.slice(n+1),10)<s}function BF(t,r){if(t===String(r))return!0;if(Object.is(r,-0))return!0;if(/[eE]/.test(t))return pc(t)===pc(String(r));let n=t.replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,""),s=String(r);if(n===s)return!0;if(/[eE]/.test(s))return n===pc(s);return!1}function pc(t){let r=t.startsWith("-"),n=r?t.slice(1):t,s=n.search(/[eE]/),o;if(s===-1)o=n;else{let i=parseInt(n.slice(s+1),10),u=n.slice(0,s),a=u.indexOf("."),d,l;if(a===-1)d=u,l=u.length;else d=u.slice(0,a)+u.slice(a+1),l=a;d=d.replace(/0+$/,"")||"0";let h=l+i;if(d==="0")o="0";else if(h<=0)o="0."+"0".repeat(-h)+d;else if(h>=d.length)o=d+"0".repeat(h-d.length);else o=d.slice(0,h)+"."+d.slice(h)}if(o.includes("."))o=o.replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"");return(r?"-":"")+o}function HF(t){let r=t.search(/[eE]/),n=parseInt(t.slice(r+1),10),s=t.startsWith("-"),o=t.slice(s?1:0,r),i=o.indexOf("."),u,a;if(i===-1)u=o,a=n;else{u=o.slice(0,i)+o.slice(i+1);let l=o.length-i-1;a=n-l}u=u.replace(/0+$/,"")||"0";let d=BigInt(u)*10n**BigInt(a+(o.replace(".","").length-u.length));return s?-d:d}var gc=Symbol.for("@aws-sdk/reviver");function bc(t){let r=F.of(t),n=r.getSchema();if(Array.isArray(n)&&r.isStructSchema()){if(gc in n)return n[gc];let s=Vs(r,new Set);return n[gc]=s,s}return Vs(r,new Set)}function Vs(t,r){let n=t.getSchema();if(r.has(n))return!1;if(r.add(n),t.isBigIntegerSchema()||t.isBigDecimalSchema())return!0;if(t.isStructSchema()){for(let[,s]of t.structIterator())if(Vs(s,r))return!0}else if(t.isListSchema()||t.isMapSchema()){if(Vs(t.getValueSchema(),r))return!0}else if(t.isDocumentSchema())return!0;return!1}var zg=(t,r)=>qs(t,r).then((n)=>(r?.utf8Encoder??Sc)(n));async function Qs(t,r,n){let s;if(Hg()&&typeof t?.[Symbol.asyncIterator]==="function"){let i=await qs(t,r);if(typeof Buffer==="function")if(Buffer.isBuffer(i))s=i;else s=Buffer.from(i.buffer,i.byteOffset,i.byteLength)}if(!s)s=await zg(t,r);if(s.length===0)return{};let o=n&&bc(n)?Ec:void 0;try{return JSON.parse(s,o)}catch(i){if(i?.name==="SyntaxError")Object.defineProperty(i,"$responseBodyText",{value:typeof s==="string"?s:s.toString("utf8")});throw i}}var zF=async(t,r)=>{let n=await Qs(t,r);return n.message=n.message??n.Message,n},Ag=(t,r)=>Object.keys(t).find((n)=>n.toLowerCase()===r.toLowerCase()),mc=(t)=>{let r=t;if(typeof r==="number")r=r.toString();if(r.indexOf(",")>=0)r=r.split(",")[0];if(r.indexOf(":")>=0)r=r.split(":")[0];if(r.indexOf("#")>=0)r=r.split("#")[1];return r},qg=(t,r)=>jg(t,r,["header","code","type"]),Vg=(t,r,n=!1)=>jg(t,r,n?["code","header","type"]:["type","code","header"]),jg=({headers:t},r,n)=>{while(n.length>0)switch(n.shift()){case"header":let o=Ag(t??{},"x-amzn-errortype");if(o!==void 0)return mc(t[o]);break;case"code":let i=Ag(r??{},"code");if(i&&r[i]!==void 0)return mc(r[i]);break;case"type":if(r?.__type!==void 0)return mc(r.__type);break}};function ht(t){Object.defineProperty(t,"__proto__",{value:void 0,writable:!0,enumerable:!0,configurable:!0})}class _c extends Te{settings;constructor(t){super();this.settings=t}async read(t,r){let n=bc(t)?Ec:void 0,s;if(typeof r==="string"){if(r.length===0)return{};s=JSON.parse(r,n)}else if(r instanceof Uint8Array&&Hg()){if(r.byteLength===0)return{};let o=Buffer.isBuffer(r)?r:Buffer.from(r.buffer,r.byteOffset,r.byteLength);s=JSON.parse(o,n)}else s=await Qs(r,this.serdeContext,t);return this._read(t,s)}readObject(t,r){return this._read(t,r)}_read(t,r){let n=r!==null&&typeof r==="object",s=F.of(t);if(n){if(s.isStructSchema())return this._readStruct(s,r);if(Array.isArray(r)&&s.isListSchema()){let i=s.getValueSchema();if(this.needsTransform(i))for(let u=0;u<r.length;++u)r[u]=this._read(i,r[u]);return r}if(s.isMapSchema()){let i=s.getValueSchema(),u=r;if(this.needsTransform(i))for(let a in u){if(a==="__proto__")ht(u);u[a]=this._read(i,u[a])}return u}}if(s.isBlobSchema()&&typeof r==="string")return wc(r);let o=s.getMergedTraits().mediaType;if(s.isStringSchema()&&typeof r==="string"&&o){if(o==="application/json"||o.endsWith("+json"))return Ws.from(r);return r}if(s.isTimestampSchema()&&r!=null)switch(_r(s,this.settings)){case 5:return Ug(r);case 6:return Lg(r);case 7:return Fg(r);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",r),new Date(r)}if(s.isBigIntegerSchema()&&(typeof r==="number"||typeof r==="string"))return BigInt(r);if(s.isBigDecimalSchema()&&r!=null){if(r instanceof re)return r;let i=r;if(i.type==="bigDecimal"&&"string"in i)return new re(i.string,i.type);return new re(String(r),"bigDecimal")}if(s.isNumericSchema()&&typeof r==="string"){switch(r){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return r}if(s.isDocumentSchema()){if(n)if(Array.isArray(r))for(let i=0;i<r.length;++i){let u=r[i];if(!(u instanceof re))r[i]=this._read(s,u)}else{let i=r;for(let u in i){if(u==="__proto__")ht(i);let a=i[u];if(!(a instanceof re))i[u]=this._read(s,a)}}}return r}_readStruct(t,r){let n=t.isUnionSchema(),s={},o,i=typeof r.__type==="string",{jsonName:u}=this.settings;if(u&&i)o={};let a;if(n)a=new Ks(r,s);for(let[d,l]of t.structIterator()){let h=d;if(u){if(h=l.getMergedTraits().jsonName??h,i)o[h]=d}if(n)a.mark(h);if(r[h]!=null)s[d]=this._read(l,r[h])}if(n)a.writeUnknown();else if(i)for(let d in r){let l=r[d],h=u?o[d]??d:d;if(!(h in s))s[h]=l}return s}needsTransform(t){if(t.isBlobSchema()||t.isTimestampSchema()||t.isBigIntegerSchema()||t.isBigDecimalSchema())return!0;if(t.isDocumentSchema()||t.isStructSchema()||t.isListSchema()||t.isMapSchema())return!0;if(t.isStringSchema()&&t.getMergedTraits().mediaType)return!0;return!1}}class js extends Uint8Array{string=null;static allocUnsafe(t){if(typeof Buffer==="function"){let r=Buffer.allocUnsafe(t);return new js(r.buffer,r.byteOffset,r.byteLength)}return new js(t)}toString(){return this.s()}valueOf(){return this.s()}includes(t,r){if(typeof t==="string")return this.s().includes(t,r);return Uint8Array.prototype.includes.call(this,t,r)}indexOf(t,r){if(typeof t==="string")return this.s().indexOf(t,r);return Uint8Array.prototype.indexOf.call(this,t,r)}lastIndexOf(t,r){if(typeof t==="string")return this.s().lastIndexOf(t,r);let n=Uint8Array.prototype.lastIndexOf;if(r!==void 0)return n.call(this,t,r);return n.call(this,t)}startsWith(t,r){return this.s().startsWith(t,r)}endsWith(t,r){return this.s().endsWith(t,r)}match(t){return this.s().match(t)}replace(t,r){return this.s().replace(t,r)}search(t){return this.s().search(t)}split(t,r){return this.s().split(t,r)}substring(t,r){return this.s().substring(t,r)}trim(){return this.s().trim()}trimStart(){return this.s().trimStart()}trimEnd(){return this.s().trimEnd()}charAt(t){return this.s().charAt(t)}charCodeAt(t){return this.s().charCodeAt(t)}padStart(t,r){return this.s().padStart(t,r)}padEnd(t,r){return this.s().padEnd(t,r)}repeat(t){return this.s().repeat(t)}toUpperCase(){return this.s().toUpperCase()}toLowerCase(){return this.s().toLowerCase()}s(){if(this.string==null){let t=Date.now();if(t>xg+60000)console.warn("@aws-sdk/core/protocols - WARN - JsonCodec2: you have called a string method on a Uint8Array request body. It has been automatically converted to string. In a future version this will throw an error."),xg=t;this.string=Sc(this)}return this.string}}var xg=0,Bs=new TextEncoder,Tg=123,Cg=125,qF=91,VF=93,Er=34,Hs=58,zs=44,Ig=92,jF=new Uint8Array([116,114,117,101]),WF=new Uint8Array([102,97,108,115,101]),GF=new Uint8Array([110,117,108,108]),He=Array(128).fill(null);He[8]="b";He[9]="t";He[10]="n";He[12]="f";He[13]="r";He[34]='"';He[92]="\\";for(let t=0;t<32;t++)if(He[t]===null)He[t]="u00"+t.toString(16).padStart(2,"0");var Rg=2048;function yc(t){return js.allocUnsafe(t)}class Xs extends Te{settings;json;i=0;rootSchema;rawValue;passthrough=!1;constructor(t){super();this.settings=t,this.json=yc(Rg)}write(t,r){if(this.i=0,this.rawValue=r,this.rootSchema=F.of(t),this.passthrough=this.rootSchema.isBlobSchema()||this.rootSchema.isStringSchema(),!this.passthrough)this.writeValue(this.rootSchema,r,void 0)}writeDiscriminatedDocument(t,r){this.i=0,this.rootSchema=F.of(t);let n=this.rootSchema;if(n.isStructSchema()&&r!=null&&typeof r==="object"){this.writeValue(n,r,void 0);let s=`"__type":"${n.getName(!0)??"Unknown"}",`,o=s.length;this.ensure(o),this.json.copyWithin(1+o,1,this.i),Bs.encodeInto(s,this.json.subarray(1)),this.i+=o}else this.writeValue(n,r,void 0)}flush(){this.rootSchema=void 0;let t=this.i;this.i=0;let r=this.rawValue;if(this.rawValue=void 0,t===0)return r;let n=this.json.subarray(0,t);return this.json=yc(Rg),n}ensure(t){let{i:r,json:n}=this;if(r+t>n.length){let s=n.length*2;while(s<r+t)s*=2;let o=yc(s);o.set(this.json),this.json=o}}writeAscii(t){let r=t.length;this.ensure(r);let{i:n,json:s}=this;for(let o=0;o<r;++o)s[n]=t.charCodeAt(o),n+=1;this.i=n}writeAsciiQuoted(t){let r=t.length;this.ensure(r+4);let{json:n,i:s}=this;n[s++]=Er;for(let o=0;o<r;++o)n[s++]=t.charCodeAt(o);n[s++]=Er,this.i=s}writeJsonString(t){this.ensure(t.length*3+2),this.json[this.i++]=Er;let r=t.length;for(let n=0;n<r;++n){let s=t.charCodeAt(n);if(s>34&&s<92)this.json[this.i++]=s;else if(s<128){let o=He[s];if(o!==null){this.ensure(o.length+1),this.json[this.i++]=Ig;for(let i=0;i<o.length;i++)this.json[this.i++]=o.charCodeAt(i)}else this.json[this.i++]=s}else if(s>=55296&&s<=56319){let o=n+1<r?t.charCodeAt(n+1):0;if(o>=56320&&o<=57343){this.ensure(4);let{written:i}=Bs.encodeInto(t.substring(n,n+2),this.json.subarray(this.i));this.i+=i,++n}else this.ensure(6),this.writeUnicodeEscape(s)}else if(s>=56320&&s<=57343)this.ensure(6),this.writeUnicodeEscape(s);else{let{i:o,json:i}=this;if(s<2048)i[o++]=192|s>>6,i[o++]=128|s&63;else i[o++]=224|s>>12,i[o++]=128|s>>6&63,i[o++]=128|s&63;this.i=o}}this.json[this.i++]=Er}writeUnicodeEscape(t){let{json:r,i:n}=this;r[n++]=Ig,r[n++]=117;let s=t.toString(16).padStart(4,"0");for(let o=0;o<4;++o)r[n++]=s.charCodeAt(o);this.i=n}static B64=(()=>{let r=new Uint8Array(64);for(let n=0;n<64;++n)r[n]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(n);return r})();writeBase64(t){let r=Math.ceil(t.length/3)*4;this.ensure(r+2);let n=this.json,s=Xs.B64,o=this.i;n[o++]=Er;let i=t.length,u=i%3,a=i-u;for(let d=0;d<a;d+=3){let l=t[d],h=t[d+1],f=t[d+2];n[o++]=s[l>>2],n[o++]=s[(l&3)<<4|h>>4],n[o++]=s[(h&15)<<2|f>>6],n[o++]=s[f&63]}if(u===2){let d=t[a],l=t[a+1];n[o++]=s[d>>2],n[o++]=s[(d&3)<<4|l>>4],n[o++]=s[(l&15)<<2],n[o++]=61}else if(u===1){let d=t[a];n[o++]=s[d>>2],n[o++]=s[(d&3)<<4],n[o++]=61,n[o++]=61}n[o++]=Er,this.i=o}writeValue(t,r,n){if(r==null){if(n?.isStructSchema()){if(r===void 0){if(F.of(t).isIdempotencyToken()){this.writeAsciiQuoted(Gs());return}}return}this.ensure(4),this.json.set(GF,this.i),this.i+=4;return}let s=F.of(t),o=typeof r==="object";if(s.isStringSchema()){let i=s.getMergedTraits().mediaType;if(i){if(i==="application/json"||i.endsWith("+json")){this.writeJsonString(Ws.from(r).toString());return}}}if(o){if(s.isStructSchema()){this.writeStruct(s,r);return}if(Array.isArray(r)&&(s.isListSchema()||s.isDocumentSchema())){this.writeList(s,r,s.isDocumentSchema());return}if(s.isMapSchema()){this.writeMap(s,r,!1);return}if(r instanceof Uint8Array&&(s.isBlobSchema()||s.isDocumentSchema())){this.writeBase64(r);return}if(r instanceof Date&&(s.isTimestampSchema()||s.isDocumentSchema())){this.writeTimestamp(s,r);return}if(r instanceof re){this.writeAscii(r.string);return}if(s.isDocumentSchema()){if(Array.isArray(r))this.writeList(s,r,!0);else this.writeMap(s,r,!0);return}let i=JSON.stringify(r);this.writeAscii(i);return}if(typeof r==="string"){if(s.isBlobSchema()){let i=(this.serdeContext?.base64Encoder??br)(r);this.writeAsciiQuoted(i);return}this.writeJsonString(r);return}if(typeof r==="number"){if(Math.abs(r)===1/0||Number.isNaN(r)){this.writeAsciiQuoted(String(r));return}let i=String(r);this.writeAscii(i);return}if(typeof r==="boolean"){this.ensure(5);let{i,json:u}=this;if(r)u.set(jF,i),i+=4;else u.set(WF,i),i+=5;this.i=i;return}if(typeof r==="bigint"){this.writeAscii(r.toString());return}this.writeAscii(String(r))}writeStruct(t,r){this.ensure(2),this.json[this.i++]=Tg;let n=!1,s=typeof r.__type==="string",o;if(s)o=new Set;for(let[i,u]of t.structIterator()){let a=r[i];if(a==null&&!u.isIdempotencyToken())continue;if(n)this.ensure(1),this.json[this.i++]=zs;n=!0;let d=this.settings.jsonName?u.getMergedTraits().jsonName??i:i;if(o)o.add(i),o.add(d);this.writeAsciiQuoted(d),this.json[this.i++]=Hs,this.writeValue(u,a,t)}if(!n&&t.isUnionSchema()){let{$unknown:i}=r;if(Array.isArray(i)){let[u,a]=i;this.writeAsciiQuoted(u),this.ensure(1),this.json[this.i++]=Hs,this.writeValue(15,a,t)}}else if(s)for(let i in r){if(o.has(i))continue;o.add(i);let u=r[i];if(n)this.ensure(1),this.json[this.i++]=zs;n=!0,this.writeAsciiQuoted(i),this.ensure(1),this.json[this.i++]=Hs,this.writeValue(15,u,void 0)}this.ensure(1),this.json[this.i++]=Cg}writeList(t,r,n){let s=!!t.getMergedTraits().sparse,o=t.getValueSchema();if(!n){if(o.isStringSchema()||o.isNumericSchema()||o.isBooleanSchema()){let u=!1;for(let d=0;d<r.length;++d){let l=r[d];if(Number.isNaN(l)||l===1/0||l===-1/0||l==null&&!s){u=!0;break}}let a;if(!u)a=JSON.stringify(r);else{let d=[];for(let l=0;l<r.length;++l){let h=r[l];if(h==null&&!s)continue;if(Number.isNaN(h)||h===1/0||h===-1/0)d.push(String(h));else d.push(h)}a=JSON.stringify(d)}this.ensure(a.length*3),this.i+=Bs.encodeInto(a,this.json.subarray(this.i)).written;return}}this.ensure(2),this.json[this.i++]=qF;let i=!1;for(let u=0;u<r.length;++u){let a=r[u];if(n?a===void 0:a==null&&!s)continue;if(i)this.ensure(1),this.json[this.i++]=zs;this.writeValue(o,a,void 0),i=!0}this.ensure(1),this.json[this.i++]=VF}writeMap(t,r,n){let s=!!t.getMergedTraits().sparse,o=t.getValueSchema();if(!n){if(o.isStringSchema()||o.isNumericSchema()||o.isBooleanSchema()){let u;for(let d in r){let l=r[d];if(Number.isNaN(l)||l===1/0||l===-1/0)(u??={})[d]=l,r[d]=String(l);else if(l===null&&!s)(u??={})[d]=null,r[d]=void 0}let a=JSON.stringify(r);if(u)Object.assign(r,u);this.ensure(a.length*3),this.i+=Bs.encodeInto(a,this.json.subarray(this.i)).written;return}}this.ensure(2),this.json[this.i++]=Tg;let i=!0;for(let u in r){let a=r[u];if(n?a===void 0:a==null&&!s)continue;if(!i)this.ensure(1),this.json[this.i++]=zs;i=!1,this.writeJsonString(u),this.ensure(1),this.json[this.i++]=Hs,this.writeValue(o,a,void 0)}this.ensure(1),this.json[this.i++]=Cg}writeTimestamp(t,r){switch(_r(t,this.settings)){case 5:{let s=r.toISOString().replace(".000Z","Z");this.writeAsciiQuoted(s);return}case 6:{this.writeAsciiQuoted(En(r));return}case 7:{let s=String(r.getTime()/1000);this.writeAscii(s);return}default:{let s=String(r.getTime()/1000);this.writeAscii(s);return}}}}class Ys extends Te{settings;constructor(t){super();this.settings=t}createSerializer(){let t=new Xs(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new _c(this.settings);return t.setSerdeContext(this.serdeContext),t}}class Js extends Pg{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:t,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:o}){super({defaultNamespace:t,errorTypeRegistries:r});this.serviceTarget=n,this.codec=o??new Ys({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!s,this.mixin=new Ar(this.awsQueryCompatible)}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n);if(!s.path.endsWith("/"))s.path+="/";if(s.headers["content-type"]=`application/x-amz-json-${this.getJsonRpcVersion()}`,s.headers["x-amz-target"]=`${this.serviceTarget}.${t.name}`,this.awsQueryCompatible)s.headers["x-amzn-query-mode"]="true";if(Ng(t.input)==="unit"||!s.body)s.body="{}";return s}getPayloadCodec(){return this.codec}async handleError(t,r,n,s,o){let{awsQueryCompatible:i}=this;if(i)this.mixin.setQueryCompatError(s,n);let u=Vg(n,s,i)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,u,this.options.defaultNamespace);let{errorSchema:a,errorMetadata:d}=await this.mixin.getErrorSchemaOrThrowBaseException(u,this.options.defaultNamespace,n,s,o,i?this.mixin.findQueryCompatibleError:void 0),l=F.of(a),h=s.message??s.Message??"UnknownError",p=new(this.compositeErrorRegistry.getErrorCtor(a)??Error)({}),g={},m=this.codec.createDeserializer();for(let[y,S]of l.structIterator())if(s[y]!=null)g[y]=m.readObject(S,s[y]);if(i)this.mixin.queryCompatOutput(s,g);throw this.mixin.decorateServiceException(Object.assign(p,d,{$fault:l.getMergedTraits().error,message:h},g),s)}}class Wg extends Js{constructor({defaultNamespace:t,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:o}){super({defaultNamespace:t,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:o})}getShapeId(){return"aws.protocols#awsJson1_0"}getJsonRpcVersion(){return"1.0"}getDefaultContentType(){return"application/x-amz-json-1.0"}}class Gg extends Js{constructor({defaultNamespace:t,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:o}){super({defaultNamespace:t,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:o})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}class Kg extends kg{serializer;deserializer;codec;mixin=new Ar;constructor({defaultNamespace:t,errorTypeRegistries:r,jsonCodec:n}){super({defaultNamespace:t,errorTypeRegistries:r});let s={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=n??new Ys(s),this.serializer=new Mg(this.codec.createSerializer(),s),this.deserializer=new Dg(this.codec.createDeserializer(),s)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(t){this.codec.setSerdeContext(t),super.setSerdeContext(t)}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n),o=F.of(t.input);if(!s.headers["content-type"]){let i=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);if(i)s.headers["content-type"]=i}if(s.body==null&&s.headers["content-type"]===this.getDefaultContentType())s.body="{}";return s}async deserializeResponse(t,r,n){let s=await super.deserializeResponse(t,r,n),o=F.of(t.output);for(let[i,u]of o.structIterator())if(u.getMemberTraits().httpPayload&&!(i in s))s[i]=null;return s}async handleError(t,r,n,s,o){let i=qg(n,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace);let{errorSchema:u,errorMetadata:a}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,n,s,o),d=F.of(u),l=s.message??s.Message??"UnknownError",f=new(this.compositeErrorRegistry.getErrorCtor(u)??Error)({});await this.deserializeHttpMessage(u,r,n,s);let p={},g=this.codec.createDeserializer();for(let[m,y]of d.structIterator()){let S=y.getMergedTraits().jsonName??m;p[m]=g.readObject(y,s[S])}throw this.mixin.decorateServiceException(Object.assign(f,a,{$fault:d.getMergedTraits().error,message:l},p),s)}getDefaultContentType(){return"application/json"}}class Ac extends Te{settings;constructor(t){super();this.settings=t}async read(t,r){let n=bc(t)?Ec:void 0;return this._read(t,typeof r==="string"?JSON.parse(r,n):await Qs(r,this.serdeContext,t))}readObject(t,r){return this._read(t,r)}_read(t,r){let n=r!==null&&typeof r==="object",s=F.of(t);if(n){if(s.isStructSchema()){let i=r,u=s.isUnionSchema(),a={},d=void 0,{jsonName:l}=this.settings;if(l)d={};let h;if(u)h=new Ks(i,a);for(let[f,p]of s.structIterator()){let g=f;if(l)g=p.getMergedTraits().jsonName??g,d[g]=f;if(u)h.mark(g);if(i[g]!=null)a[f]=this._read(p,i[g])}if(u)h.writeUnknown();else if(typeof i.__type==="string")for(let f in i){let p=i[f],g=l?d[f]??f:f;if(!(g in a))a[g]=p}return a}if(Array.isArray(r)&&s.isListSchema()){let i=s.getValueSchema(),u=[];for(let a of r)u.push(this._read(i,a));return u}if(s.isMapSchema()){let i=s.getValueSchema(),u={};for(let a in r){if(a==="__proto__")ht(u);u[a]=this._read(i,r[a])}return u}}if(s.isBlobSchema()&&typeof r==="string")return wc(r);let o=s.getMergedTraits().mediaType;if(s.isStringSchema()&&typeof r==="string"&&o){if(o==="application/json"||o.endsWith("+json"))return Ws.from(r);return r}if(s.isTimestampSchema()&&r!=null)switch(_r(s,this.settings)){case 5:return Ug(r);case 6:return Lg(r);case 7:return Fg(r);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",r),new Date(r)}if(s.isBigIntegerSchema()&&(typeof r==="number"||typeof r==="string"))return BigInt(r);if(s.isBigDecimalSchema()&&r!=null){if(r instanceof re)return r;let i=r;if(i.type==="bigDecimal"&&"string"in i)return new re(i.string,i.type);return new re(String(r),"bigDecimal")}if(s.isNumericSchema()&&typeof r==="string"){switch(r){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return r}if(s.isDocumentSchema())if(n){let i=Array.isArray(r)?[]:{};for(let u in r){if(u==="__proto__")ht(i);let a=r[u];if(a instanceof re)i[u]=a;else i[u]=this._read(s,a)}return i}else return structuredClone(r);return r}}var vg=String.fromCharCode(925);class Qg{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(t,r)=>{if(r instanceof re){let n=`${vg+"nv"+this.counter++}_`+r.string;return this.values.set(`"${n}"`,r.string),n}if(typeof r==="bigint"){let n=r.toString(),s=`${vg+"b"+this.counter++}_`+n;return this.values.set(`"${s}"`,n),s}return r}}replaceInJson(t){if(this.stage===0)throw Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return t;for(let[r,n]of this.values)t=t.replace(r,n);return t}}class xc extends Te{settings;buffer;useReplacer=!1;rootSchema;constructor(t){super();this.settings=t}write(t,r){this.rootSchema=F.of(t),this.buffer=this._write(this.rootSchema,r)}flush(){let{rootSchema:t,useReplacer:r}=this;if(this.rootSchema=void 0,this.useReplacer=!1,t?.isStructSchema()||t?.isDocumentSchema()){if(!r)return JSON.stringify(this.buffer);let n=new Qg;return n.replaceInJson(JSON.stringify(this.buffer,n.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(t,r){if(this.write(t,r),typeof this.buffer==="object")this.buffer.__type=F.of(t).getName(!0)}_write(t,r,n){let s=r!==null&&typeof r==="object",o=F.of(t);if(s){if(o.isStructSchema()){let i=r,u={},{jsonName:a}=this.settings,d=void 0;if(a)d={};let l=0;for(let[h,f]of o.structIterator()){let p=this._write(f,i[h],o);if(p!==void 0){let g=h;if(a)g=f.getMergedTraits().jsonName??h,d[h]=g;u[g]=p,l++}}if(o.isUnionSchema()&&l===0){let{$unknown:h}=i;if(Array.isArray(h)){let[f,p]=h;if(f==="__proto__")ht(u);u[f]=this._write(15,p)}}else if(typeof i.__type==="string")for(let h in i){let f=i[h],p=a?d[h]??h:h;if(!(p in u))u[p]=this._write(15,f)}return u}if(Array.isArray(r)&&o.isListSchema()){let i=o.getValueSchema(),u=[],a=!!o.getMergedTraits().sparse;for(let d of r)if(a||d!=null)u.push(this._write(i,d));return u}if(o.isMapSchema()){let i=o.getValueSchema(),u={},a=!!o.getMergedTraits().sparse;for(let d in r){let l=r[d];if(a||l!=null){if(d==="__proto__")ht(u);u[d]=this._write(i,l)}}return u}if(r instanceof Uint8Array&&o.isBlobSchema()){if(o===this.rootSchema)return r;return(this.serdeContext?.base64Encoder??br)(r)}if(r instanceof Date&&(o.isTimestampSchema()||o.isDocumentSchema()))switch(_r(o,this.settings)){case 5:return r.toISOString().replace(".000Z","Z");case 6:return En(r);case 7:return r.getTime()/1000;default:return console.warn("Missing timestamp format, using epoch seconds",r),r.getTime()/1000}if(r instanceof re)this.useReplacer=!0}if(r===null&&n?.isStructSchema())return;if(o.isStringSchema()){if(typeof r>"u"&&o.isIdempotencyToken())return Gs();let i=o.getMergedTraits().mediaType;if(r!=null&&i){if(i==="application/json"||i.endsWith("+json"))return Ws.from(r)}return r}if(typeof r==="number"){if(Math.abs(r)===1/0||isNaN(r))return String(r);return r}if(typeof r==="string"&&o.isBlobSchema()){if(o===this.rootSchema)return r;return(this.serdeContext?.base64Encoder??br)(r)}if(typeof r==="bigint")this.useReplacer=!0;if(o.isDocumentSchema())if(s){if(r instanceof Uint8Array)return(this.serdeContext?.base64Encoder??br)(r);let i=Array.isArray(r)?[]:{};for(let u in r){let a=r[u];if(u==="__proto__")ht(i);if(a instanceof re)this.useReplacer=!0,i[u]=a;else i[u]=this._write(o,a)}return i}else return structuredClone(r);return r}}class Xg extends Te{settings;constructor(t){super();this.settings=t}createSerializer(){let t=new xc(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new Ac(this.settings);return t.setSerdeContext(this.serdeContext),t}}class Zs extends Te{settings;stringDeserializer;constructor(t){super();this.settings=t,this.stringDeserializer=new LF(t)}setSerdeContext(t){this.serdeContext=t,this.stringDeserializer.setSerdeContext(t)}read(t,r,n){let s=F.of(t),o=s.getMemberSchemas();if(s.isStructSchema()&&s.isMemberSchema()&&!!Object.values(o).find((d)=>!!d.getMemberTraits().eventPayload)){let d={},l=Object.keys(o)[0];if(o[l].isBlobSchema())d[l]=r;else d[l]=this.read(o[l],r);return d}let u=(this.serdeContext?.utf8Encoder??Sc)(r),a=this.parseXml(u);return this.readSchema(t,n?a[n]:a)}readSchema(t,r){let n=F.of(t);if(n.isUnitSchema())return;let s=n.getMergedTraits();if(n.isListSchema()&&!Array.isArray(r))return this.readSchema(n,[r]);if(r==null)return r;if(typeof r==="object"){let o=!!s.xmlFlattened;if(n.isListSchema()){let u=n.getValueSchema(),a=[],d=u.getMergedTraits().xmlName??"member",l=o?r:(r[0]??r)[d];if(l==null)return a;let h=Array.isArray(l)?l:[l];for(let f of h)a.push(this.readSchema(u,f));return a}let i={};if(n.isMapSchema()){let u=n.getKeySchema(),a=n.getValueSchema(),d;if(o)d=Array.isArray(r)?r:[r];else d=Array.isArray(r.entry)?r.entry:[r.entry];let l=u.getMergedTraits().xmlName??"key",h=a.getMergedTraits().xmlName??"value";for(let f of d){let p=f[l],g=f[h];if(p==="__proto__")ht(i);i[p]=this.readSchema(a,g)}return i}if(n.isStructSchema()){let u=n.isUnionSchema(),a;if(u)a=new Ks(r,i);for(let[d,l]of n.structIterator()){let h=l.getMergedTraits(),f=!h.httpPayload?l.getMemberTraits().xmlName??d:h.xmlName??l.getName();if(u)a.mark(f);if(r[f]!=null)i[d]=this.readSchema(l,r[f])}if(u)a.writeUnknown();return i}if(n.isDocumentSchema())return r;throw Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${n.getName(!0)}`)}if(n.isListSchema())return[];if(n.isMapSchema()||n.isStructSchema())return{};return this.stringDeserializer.read(n,r)}parseXml(t){if(t.length){let r;try{r=$g(t)}catch(i){if(i&&typeof i==="object")Object.defineProperty(i,"$responseBodyText",{value:t});throw i}let n="#text",s=Object.keys(r)[0],o=r[s];if(o[n])o[s]=o[n],delete o[n];return Og(o)}return{}}}class Tc extends Te{settings;buffer;constructor(t){super();this.settings=t}write(t,r,n=""){if(this.buffer===void 0)this.buffer="";let s=F.of(t);if(n&&!n.endsWith("."))n+=".";if(s.isBlobSchema()){if(typeof r==="string"||r instanceof Uint8Array)this.writeKey(n),this.writeValue((this.serdeContext?.base64Encoder??br)(r))}else if(s.isBooleanSchema()||s.isNumericSchema()||s.isStringSchema()){if(r!=null)this.writeKey(n),this.writeValue(String(r));else if(s.isIdempotencyToken())this.writeKey(n),this.writeValue(Gs())}else if(s.isBigIntegerSchema()){if(r!=null)this.writeKey(n),this.writeValue(String(r))}else if(s.isBigDecimalSchema()){if(r!=null)this.writeKey(n),this.writeValue(r instanceof re?r.string:String(r))}else if(s.isTimestampSchema()){if(r instanceof Date)switch(this.writeKey(n),_r(s,this.settings)){case 5:this.writeValue(r.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue(En(r));break;case 7:this.writeValue(String(r.getTime()/1000));break}}else if(s.isDocumentSchema())if(Array.isArray(r))this.write(79,r,n);else if(r instanceof Date)this.write(4,r,n);else if(r instanceof Uint8Array)this.write(21,r,n);else if(r&&typeof r==="object")this.write(143,r,n);else this.writeKey(n),this.writeValue(String(r));else if(s.isListSchema()){if(Array.isArray(r))if(r.length===0){if(this.settings.serializeEmptyLists)this.writeKey(n),this.writeValue("")}else{let o=s.getValueSchema(),i=this.settings.flattenLists||s.getMergedTraits().xmlFlattened,u=1;for(let a of r){if(a==null)continue;let d=o.getMergedTraits(),l=this.getKey("member",d.xmlName,d.ec2QueryName),h=i?`${n}${u}`:`${n}${l}.${u}`;this.write(o,a,h),++u}}}else if(s.isMapSchema()){if(r&&typeof r==="object"){let o=s.getKeySchema(),i=s.getValueSchema(),u=s.getMergedTraits().xmlFlattened,a=1;for(let d in r){let l=r[d];if(l==null)continue;let h=o.getMergedTraits(),f=this.getKey("key",h.xmlName,h.ec2QueryName),p=u?`${n}${a}.${f}`:`${n}entry.${a}.${f}`,g=i.getMergedTraits(),m=this.getKey("value",g.xmlName,g.ec2QueryName),y=u?`${n}${a}.${m}`:`${n}entry.${a}.${m}`;this.write(o,d,p),this.write(i,l,y),++a}}}else if(s.isStructSchema()){if(r&&typeof r==="object"){let o=!1;for(let[i,u]of s.structIterator()){if(r[i]==null&&!u.isIdempotencyToken())continue;let a=u.getMergedTraits(),d=this.getKey(i,a.xmlName,a.ec2QueryName,"struct"),l=`${n}${d}`;this.write(u,r[i],l),o=!0}if(!o&&s.isUnionSchema()){let{$unknown:i}=r;if(Array.isArray(i)){let[u,a]=i,d=`${n}${u}`;this.write(15,a,d)}}}}else if(s.isUnitSchema());else throw Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${s.getName(!0)}`)}flush(){if(this.buffer===void 0)throw Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");let t=this.buffer;return delete this.buffer,t}getKey(t,r,n,s){let{ec2:o,capitalizeKeys:i}=this.settings;if(o&&n)return n;let u=r??t;if(i&&s==="struct")return u[0].toUpperCase()+u.slice(1);return u}writeKey(t){if(t.endsWith("."))t=t.slice(0,t.length-1);this.buffer+=`&${bg(t)}=`}writeValue(t){this.buffer+=bg(t)}}class Cc extends Pg{options;serializer;deserializer;mixin=new Ar;constructor(t){super({defaultNamespace:t.defaultNamespace,errorTypeRegistries:t.errorTypeRegistries});this.options=t;let r={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace,serializeEmptyLists:!0};this.serializer=new Tc(r),this.deserializer=new Zs(r)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(t){this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t)}getPayloadCodec(){throw Error("AWSQuery protocol has no payload codec.")}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n);if(!s.path.endsWith("/"))s.path+="/";if(s.headers["content-type"]="application/x-www-form-urlencoded",Ng(t.input)==="unit"||!s.body)s.body="";let o=t.name.split("#")[1]??t.name;if(s.body=`Action=${o}&Version=${this.options.version}`+s.body,s.body.endsWith("&"))s.body=s.body.slice(-1);return s}async deserializeResponse(t,r,n){let s=this.deserializer,o=F.of(t.output),i={};if(n.statusCode>=300){let l=await qs(n.body,r);if(l.byteLength>0)Object.assign(i,await s.read(15,l));await this.handleError(t,r,n,i,this.deserializeMetadata(n))}for(let l in n.headers){let h=n.headers[l];delete n.headers[l],n.headers[l.toLowerCase()]=h}let u=t.name.split("#")[1]??t.name,a=o.isStructSchema()&&this.useNestedResult()?u+"Result":void 0,d=await qs(n.body,r);if(d.byteLength>0)Object.assign(i,await s.read(o,d,a));return i.$metadata=this.deserializeMetadata(n),i}useNestedResult(){return!0}async handleError(t,r,n,s,o){let i=this.loadQueryErrorCode(n,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace);let u=this.loadQueryError(s)??{},a=this.loadQueryErrorMessage(s);u.message=a,u.Error={Type:u.Type,Code:u.Code,Message:a};let{errorSchema:d,errorMetadata:l}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,n,u,o,this.mixin.findQueryCompatibleError),h=F.of(d),p=new(this.compositeErrorRegistry.getErrorCtor(d)??Error)({}),g={Type:u.Error.Type,Code:u.Error.Code,Error:u.Error};for(let[m,y]of h.structIterator()){let S=y.getMergedTraits().xmlName??m,w=u[S]??s[S];g[m]=this.deserializer.readSchema(y,w)}throw this.mixin.decorateServiceException(Object.assign(p,l,{$fault:h.getMergedTraits().error,message:a},g),s)}loadQueryErrorCode(t,r){let n=(r.Errors?.[0]?.Error??r.Errors?.Error??r.Error)?.Code;if(n!==void 0)return n;if(t.statusCode==404)return"NotFound"}loadQueryError(t){return t.Errors?.[0]?.Error??t.Errors?.Error??t.Error}loadQueryErrorMessage(t){let r=this.loadQueryError(t);return r?.message??r?.Message??t.message??t.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}class Yg extends Cc{options;constructor(t){super(t);this.options=t;let r={capitalizeKeys:!0,flattenLists:!0,serializeEmptyLists:!1,ec2:!0};Object.assign(this.serializer.settings,r)}getShapeId(){return"aws.protocols#ec2Query"}useNestedResult(){return!1}}var Jg=(t,r)=>zg(t,r).then((n)=>{if(n.length){let s;try{s=$g(n)}catch(a){if(a&&typeof a==="object")Object.defineProperty(a,"$responseBodyText",{value:n});throw a}let o="#text",i=Object.keys(s)[0],u=s[i];if(u[o])u[i]=u[o],delete u[o];return Og(u)}return{}}),KF=async(t,r)=>{let n=await Jg(t,r);if(n.Error)n.Error.message=n.Error.message??n.Error.Message;return n},Zg=(t,r)=>{if(r?.Error?.Code!==void 0)return r.Error.Code;if(r?.Code!==void 0)return r.Code;if(t.statusCode==404)return"NotFound"};class Ic extends Te{settings;stringBuffer;byteBuffer;buffer;constructor(t){super();this.settings=t}write(t,r){let n=F.of(t);if(n.isStringSchema()&&typeof r==="string")this.stringBuffer=r;else if(n.isBlobSchema())this.byteBuffer="byteLength"in r?r:(this.serdeContext?.base64Decoder??wc)(r);else{this.buffer=this.writeStruct(n,r,void 0);let s=n.getMergedTraits();if(s.httpPayload&&!s.xmlName)this.buffer.withName(n.getName())}}flush(){if(this.byteBuffer!==void 0){let r=this.byteBuffer;return delete this.byteBuffer,r}if(this.stringBuffer!==void 0){let r=this.stringBuffer;return delete this.stringBuffer,r}let t=this.buffer;if(this.settings.xmlNamespace){if(!t?.attributes?.xmlns)t.addAttribute("xmlns",this.settings.xmlNamespace)}return delete this.buffer,t.toString()}writeStruct(t,r,n){let s=t.getMergedTraits(),o=t.isMemberSchema()&&!s.httpPayload?t.getMemberTraits().xmlName??t.getMemberName():s.xmlName??t.getName();if(!o||!t.isStructSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${t.getName(!0)}.`);let i=xe.of(o),[u,a]=this.getXmlnsAttribute(t,n);for(let[l,h]of t.structIterator()){let f=r[l];if(f!=null||h.isIdempotencyToken()){if(h.getMergedTraits().xmlAttribute){i.addAttribute(h.getMergedTraits().xmlName??l,this.writeSimple(h,f));continue}if(h.isListSchema())this.writeList(h,f,i,a);else if(h.isMapSchema())this.writeMap(h,f,i,a);else if(h.isStructSchema())i.addChildNode(this.writeStruct(h,f,a));else{let p=xe.of(h.getMergedTraits().xmlName??h.getMemberName());this.writeSimpleInto(h,f,p,a),i.addChildNode(p)}}}let{$unknown:d}=r;if(d&&t.isUnionSchema()&&Array.isArray(d)&&Object.keys(r).length===1){let[l,h]=d,f=xe.of(l);if(typeof h!=="string")if(r instanceof xe||r instanceof _g)i.addChildNode(r);else throw Error("@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.");this.writeSimpleInto(0,h,f,a),i.addChildNode(f)}if(a)i.addAttribute(u,a);return i}writeList(t,r,n,s){if(!t.isMemberSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${t.getName(!0)}`);let o=t.getMergedTraits(),i=t.getValueSchema(),u=i.getMergedTraits(),a=!!u.sparse,d=!!o.xmlFlattened,[l,h]=this.getXmlnsAttribute(t,s),f=(p,g)=>{if(i.isListSchema())this.writeList(i,Array.isArray(g)?g:[g],p,h);else if(i.isMapSchema())this.writeMap(i,g,p,h);else if(i.isStructSchema()){let m=this.writeStruct(i,g,h);p.addChildNode(m.withName(d?o.xmlName??t.getMemberName():u.xmlName??"member"))}else{let m=xe.of(d?o.xmlName??t.getMemberName():u.xmlName??"member");this.writeSimpleInto(i,g,m,h),p.addChildNode(m)}};if(d){for(let p of r)if(a||p!=null)f(n,p)}else{let p=xe.of(o.xmlName??t.getMemberName());if(h)p.addAttribute(l,h);for(let g of r)if(a||g!=null)f(p,g);n.addChildNode(p)}}writeMap(t,r,n,s,o=!1){if(!t.isMemberSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${t.getName(!0)}`);let i=t.getMergedTraits(),u=t.getKeySchema(),d=u.getMergedTraits().xmlName??"key",l=t.getValueSchema(),h=l.getMergedTraits(),f=h.xmlName??"value",p=!!h.sparse,g=!!i.xmlFlattened,[m,y]=this.getXmlnsAttribute(t,s),S=(w,E,A)=>{let v=xe.of(d,E),[L,k]=this.getXmlnsAttribute(u,y);if(k)v.addAttribute(L,k);w.addChildNode(v);let U=xe.of(f);if(l.isListSchema())this.writeList(l,A,U,y);else if(l.isMapSchema())this.writeMap(l,A,U,y,!0);else if(l.isStructSchema())U=this.writeStruct(l,A,y);else this.writeSimpleInto(l,A,U,y);w.addChildNode(U)};if(g)for(let w in r){let E=r[w];if(p||E!=null){let A=xe.of(i.xmlName??t.getMemberName());S(A,w,E),n.addChildNode(A)}}else{let w;if(!o){if(w=xe.of(i.xmlName??t.getMemberName()),y)w.addAttribute(m,y);n.addChildNode(w)}for(let E in r){let A=r[E];if(p||A!=null){let v=xe.of("entry");S(v,E,A),(o?n:w).addChildNode(v)}}}}writeSimple(t,r){if(r===null)throw Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");let n=F.of(t),s=null;if(r&&typeof r==="object")if(n.isBlobSchema())s=(this.serdeContext?.base64Encoder??br)(r);else if(n.isTimestampSchema()&&r instanceof Date)switch(_r(n,this.settings)){case 5:s=r.toISOString().replace(".000Z","Z");break;case 6:s=En(r);break;case 7:s=String(r.getTime()/1000);break;default:console.warn("Missing timestamp format, using http date",r),s=En(r);break}else if(n.isBigDecimalSchema()&&r){if(r instanceof re)return r.string;return String(r)}else if(n.isMapSchema()||n.isListSchema())throw Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead.");else throw Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${n.getName(!0)}`);if(n.isBooleanSchema()||n.isNumericSchema()||n.isBigIntegerSchema()||n.isBigDecimalSchema())s=String(r);if(n.isStringSchema())if(r===void 0&&n.isIdempotencyToken())s=Gs();else s=String(r);if(s===null)throw Error(`Unhandled schema-value pair ${n.getName(!0)}=${r}`);return s}writeSimpleInto(t,r,n,s){let o=this.writeSimple(t,r),i=F.of(t),u=new _g(o),[a,d]=this.getXmlnsAttribute(i,s);if(d)n.addAttribute(a,d);n.addChildNode(u)}getXmlnsAttribute(t,r){let n=t.getMergedTraits(),[s,o]=n.xmlNamespace??[];if(o&&o!==r)return[s?`xmlns:${s}`:"xmlns",o];return[void 0,void 0]}}class Rc extends Te{settings;constructor(t){super();this.settings=t}createSerializer(){let t=new Ic(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new Zs(this.settings);return t.setSerdeContext(this.serdeContext),t}}class em extends kg{codec;serializer;deserializer;mixin=new Ar;constructor(t){super(t);let r={timestampFormat:{useTrait:!0,default:5},httpBindings:!0,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace};this.codec=new Rc(r),this.serializer=new Mg(this.codec.createSerializer(),r),this.deserializer=new Dg(this.codec.createDeserializer(),r)}getPayloadCodec(){return this.codec}getShapeId(){return"aws.protocols#restXml"}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n),o=F.of(t.input);if(!s.headers["content-type"]){let i=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);if(i)s.headers["content-type"]=i}if(typeof s.body==="string"&&s.headers["content-type"]===this.getDefaultContentType()&&!s.body.startsWith("<?xml ")&&!this.hasUnstructuredPayloadBinding(o))s.body='<?xml version="1.0" encoding="UTF-8"?>'+s.body;return s}async deserializeResponse(t,r,n){return super.deserializeResponse(t,r,n)}async handleError(t,r,n,s,o){let i=Zg(n,s)??"Unknown";if(this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace),s.Error&&typeof s.Error==="object"){for(let m of Object.keys(s.Error))if(s[m]=s.Error[m],m.toLowerCase()==="message")s.message=s.Error[m]}if(s.RequestId&&!o.requestId)o.requestId=s.RequestId;let{errorSchema:u,errorMetadata:a}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,n,s,o),d=F.of(u),l=s.Error?.message??s.Error?.Message??s.message??s.Message??"UnknownError",f=new(this.compositeErrorRegistry.getErrorCtor(u)??Error)({});await this.deserializeHttpMessage(u,r,n,s);let p={},g=this.codec.createDeserializer();for(let[m,y]of d.structIterator()){let S=y.getMergedTraits().xmlName??m,w=s.Error?.[S]??s[S];p[m]=g.readSchema(y,w)}throw this.mixin.decorateServiceException(Object.assign(f,a,{$fault:d.getMergedTraits().error,message:l},p),s)}getDefaultContentType(){return"application/xml"}hasUnstructuredPayloadBinding(t){for(let[,r]of t.structIterator())if(r.getMergedTraits().httpPayload)return!(r.isStructSchema()||r.isMapSchema()||r.isListSchema());return!1}}var QF=(t)=>{if(t==null)return;if(typeof t==="object"&&"__type"in t)delete t.__type;return UF(t)},XF=(t)=>{if(t==null)return t;if(typeof t==="number"||typeof t==="bigint"){let r=Error(`Received number ${t} where a string was expected.`);return r.name="Warning",console.warn(r),String(t)}if(typeof t==="boolean"){let r=Error(`Received boolean ${t} where a string was expected.`);return r.name="Warning",console.warn(r),String(t)}return t},YF=(t)=>{if(t==null)return t;if(typeof t==="string"){let r=t.toLowerCase();if(t!==""&&r!=="false"&&r!=="true"){let n=Error(`Received string "${t}" where a boolean was expected.`);n.name="Warning",console.warn(n)}return t!==""&&r!=="false"}return t},JF=(t)=>{if(t==null)return t;if(typeof t==="string"){let r=Number(t);if(r.toString()!==t){let n=Error(`Received string "${t}" where a number was expected.`);return n.name="Warning",console.warn(n),t}return r}return t};ZF.AwsEc2QueryProtocol=Yg;ZF.AwsJson1_0Protocol=Wg;ZF.AwsJson1_1Protocol=Gg;ZF.AwsJsonRpcProtocol=Js;ZF.AwsQueryProtocol=Cc;ZF.AwsRestJsonProtocol=Kg;ZF.AwsRestXmlProtocol=em;ZF.AwsSmithyRpcV2CborProtocol=Bg;ZF.JsonCodec=Xg;ZF.JsonCodec2=Ys;ZF.JsonShapeDeserializer=Ac;ZF.JsonShapeDeserializer2=_c;ZF.JsonShapeSerializer=xc;ZF.JsonShapeSerializer2=Xs;ZF.QueryShapeSerializer=Tc;ZF.XmlCodec=Rc;ZF.XmlShapeDeserializer=Zs;ZF.XmlShapeSerializer=Ic;ZF._toBool=YF;ZF._toNum=JF;ZF._toStr=XF;ZF.awsExpectUnion=QF;ZF.loadJsonRpcErrorCode=Vg;ZF.loadRestJsonErrorCode=qg;ZF.loadRestXmlErrorCode=Zg;ZF.parseJsonBody=Qs;ZF.parseJsonErrorBody=zF;ZF.parseXmlBody=Jg;ZF.parseXmlErrorBody=KF});var Mn=e(function(q$){var{awsEndpointFunctions:vL,emitWarningIfUnsupportedVersion:NL,createDefaultUserAgentProvider:OL,NODE_APP_ID_CONFIG_OPTIONS:PL,getAwsRegionExtensionConfiguration:kL,resolveAwsRegionExtensionConfiguration:ML,resolveUserAgentConfig:DL,resolveHostHeaderConfig:FL,getUserAgentPlugin:LL,getHostHeaderPlugin:UL,getLoggerPlugin:$L,getRecursionDetectionPlugin:BL}=pe(),{NoAuthSigner:HL,getHttpAuthSchemeEndpointRuleSetPlugin:zL,DefaultIdentityProviderConfig:qL,getHttpSigningPlugin:VL}=et(),{normalizeProvider:om,getSmithyContext:jL,ServiceException:WL,NoOpLogger:GL,emitWarningIfUnsupportedVersion:KL,loadConfigsForDefaultMode:QL,getDefaultExtensionConfiguration:XL,resolveDefaultRuntimeConfig:YL,Client:im,makeBuilder:JL,createAggregatedClient:ZL}=Ie(),{Command:eU}=Ie();q$.$Command=eU;q$.__Client=im;var{resolveDefaultsModeConfig:tU,loadConfig:Lt,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:rU,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:nU,NODE_REGION_CONFIG_OPTIONS:sU,NODE_REGION_CONFIG_FILE_OPTIONS:oU,resolveRegionConfig:iU}=W(),{BinaryDecisionDiagram:aU,EndpointCache:cU,decideEndpoint:uU,customEndpointFunctions:dU,resolveEndpointConfig:lU,getEndpointPlugin:fU}=Ye(),{parseUrl:hU,getHttpHandlerExtensionConfiguration:pU,resolveHttpHandlerRuntimeConfig:gU,getContentLengthPlugin:mU}=K(),{DEFAULT_RETRY_MODE:yU,NODE_RETRY_MODE_CONFIG_OPTIONS:SU,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:wU,resolveRetryConfig:EU,getRetryPlugin:bU}=lt(),{TypeRegistry:am,getSchemaSerdePlugin:_U}=Re(),{resolveAwsSdkSigV4Config:AU,AwsSdkSigV4Signer:xU,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:TU}=tt(),{toUtf8:CU,fromUtf8:IU,toBase64:RU,fromBase64:vU,calculateBodyLength:NU}=ee(),{streamCollector:OU,NodeHttpHandler:PU}=It(),{AwsRestJsonProtocol:kU}=Qt(),{Sha256:MU}=ct(),DU=async(t,r,n)=>({operation:jL(r).operation,region:await om(t.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function FU(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:t.region},propertiesExtractor:(r,n)=>({signingProperties:{config:r,context:n}})}}function LU(t){return{schemeId:"smithy.api#noAuth"}}var UU=(t)=>{let r=[];switch(t.operation){case"CreateToken":{r.push(LU());break}default:r.push(FU(t))}return r},$U=(t)=>{let r=AU(t);return Object.assign(r,{authSchemePreference:om(t.authSchemePreference??[])})},BU=(t)=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),HU={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},zU="3.997.45",qU={version:zU},bn="ref",Ut=-1,eo=!0,tm="isSet",cm="PartitionResult",to="booleanEquals",vc="getAttr",rm={[bn]:"Endpoint"},Nc={[bn]:cm},xr={},nm=[{[bn]:"Region"}],sm={conditions:[[tm,[rm]],[tm,nm],["aws.partition",nm,cm],[to,[{[bn]:"UseFIPS"},eo]],[to,[{[bn]:"UseDualStack"},eo]],[to,[{fn:vc,argv:[Nc,"supportsDualStack"]},eo]],[to,[{fn:vc,argv:[Nc,"supportsFIPS"]},eo]],["stringEquals",[{fn:vc,argv:[Nc,"name"]},"aws-us-gov"]]],results:[[Ut],[Ut,"Invalid Configuration: FIPS and custom endpoint are not supported"],[Ut,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[rm,xr],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",xr],[Ut,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://oidc.{Region}.amazonaws.com",xr],["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",xr],[Ut,"FIPS is enabled but this partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",xr],[Ut,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",xr],[Ut,"Invalid Configuration: Missing Region"]]},VU=2,he=1e8,jU=new Int32Array([-1,1,-1,0,13,3,1,4,he+12,2,5,he+12,3,8,6,4,7,he+11,5,he+9,he+10,4,11,9,6,10,he+8,7,he+6,he+7,5,12,he+5,6,he+4,he+5,3,he+1,14,4,he+2,he+3]),WU=aU.from(jU,VU,sm.conditions,sm.results),GU=new cU({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),KU=(t,r={})=>GU.get(t,()=>uU(WU,{endpointParams:t,logger:r.logger}));dU.aws=vL;class le extends WL{constructor(t){super(t);Object.setPrototypeOf(this,le.prototype)}}class ro extends le{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(t){super({name:"AccessDeniedException",$fault:"client",...t});Object.setPrototypeOf(this,ro.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}}class no extends le{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(t){super({name:"AuthorizationPendingException",$fault:"client",...t});Object.setPrototypeOf(this,no.prototype),this.error=t.error,this.error_description=t.error_description}}class so extends le{name="ExpiredTokenException";$fault="client";error;error_description;constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t});Object.setPrototypeOf(this,so.prototype),this.error=t.error,this.error_description=t.error_description}}class oo extends le{name="InternalServerException";$fault="server";error;error_description;constructor(t){super({name:"InternalServerException",$fault:"server",...t});Object.setPrototypeOf(this,oo.prototype),this.error=t.error,this.error_description=t.error_description}}class io extends le{name="InvalidClientException";$fault="client";error;error_description;constructor(t){super({name:"InvalidClientException",$fault:"client",...t});Object.setPrototypeOf(this,io.prototype),this.error=t.error,this.error_description=t.error_description}}class ao extends le{name="InvalidGrantException";$fault="client";error;error_description;constructor(t){super({name:"InvalidGrantException",$fault:"client",...t});Object.setPrototypeOf(this,ao.prototype),this.error=t.error,this.error_description=t.error_description}}class co extends le{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(t){super({name:"InvalidRequestException",$fault:"client",...t});Object.setPrototypeOf(this,co.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}}class uo extends le{name="InvalidScopeException";$fault="client";error;error_description;constructor(t){super({name:"InvalidScopeException",$fault:"client",...t});Object.setPrototypeOf(this,uo.prototype),this.error=t.error,this.error_description=t.error_description}}class lo extends le{name="SlowDownException";$fault="client";error;error_description;constructor(t){super({name:"SlowDownException",$fault:"client",...t});Object.setPrototypeOf(this,lo.prototype),this.error=t.error,this.error_description=t.error_description}}class fo extends le{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(t){super({name:"UnauthorizedClientException",$fault:"client",...t});Object.setPrototypeOf(this,fo.prototype),this.error=t.error,this.error_description=t.error_description}}class ho extends le{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(t){super({name:"UnsupportedGrantTypeException",$fault:"client",...t});Object.setPrototypeOf(this,ho.prototype),this.error=t.error,this.error_description=t.error_description}}var QU="AccessDeniedException",XU="AuthorizationPendingException",YU="AccessToken",JU="ClientSecret",ZU="CreateToken",e$="CreateTokenRequest",t$="CreateTokenResponse",r$="CodeVerifier",n$="ExpiredTokenException",s$="InvalidClientException",o$="InvalidGrantException",i$="InvalidRequestException",a$="InternalServerException",c$="InvalidScopeException",u$="IdToken",d$="RefreshToken",l$="SlowDownException",f$="UnauthorizedClientException",h$="UnsupportedGrantTypeException",p$="accessToken",ze="client",g$="clientId",m$="clientSecret",y$="codeVerifier",S$="code",w$="deviceCode",z="error",E$="expiresIn",Ce="error_description",b$="grantType",_$="http",ve="httpError",A$="idToken",um="reason",dm="refreshToken",x$="redirectUri",lm="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",T$="scope",C$="server",I$="tokenType",V="com.amazonaws.ssooidc",fm=new am(lm),hm=[-3,lm,"SSOOIDCServiceException",0,[],[]];fm.registerError(hm,le);var Ee=new am(V),pm=[-3,V,QU,{[z]:ze,[ve]:400},[z,um,Ce],[0,0,0]];Ee.registerError(pm,ro);var gm=[-3,V,XU,{[z]:ze,[ve]:400},[z,Ce],[0,0]];Ee.registerError(gm,no);var mm=[-3,V,n$,{[z]:ze,[ve]:400},[z,Ce],[0,0]];Ee.registerError(mm,so);var ym=[-3,V,a$,{[z]:C$,[ve]:500},[z,Ce],[0,0]];Ee.registerError(ym,oo);var Sm=[-3,V,s$,{[z]:ze,[ve]:401},[z,Ce],[0,0]];Ee.registerError(Sm,io);var wm=[-3,V,o$,{[z]:ze,[ve]:400},[z,Ce],[0,0]];Ee.registerError(wm,ao);var Em=[-3,V,i$,{[z]:ze,[ve]:400},[z,um,Ce],[0,0,0]];Ee.registerError(Em,co);var bm=[-3,V,c$,{[z]:ze,[ve]:400},[z,Ce],[0,0]];Ee.registerError(bm,uo);var _m=[-3,V,l$,{[z]:ze,[ve]:400},[z,Ce],[0,0]];Ee.registerError(_m,lo);var Am=[-3,V,f$,{[z]:ze,[ve]:400},[z,Ce],[0,0]];Ee.registerError(Am,fo);var xm=[-3,V,h$,{[z]:ze,[ve]:400},[z,Ce],[0,0]];Ee.registerError(xm,ho);var Tm=[fm,Ee],R$=[0,V,YU,8,0],v$=[0,V,JU,8,0],N$=[0,V,r$,8,0],O$=[0,V,u$,8,0],Cm=[0,V,d$,8,0],Im=[3,V,e$,0,[g$,m$,b$,w$,S$,dm,T$,x$,y$],[0,[()=>v$,0],0,0,0,[()=>Cm,0],64,0,[()=>N$,0]],3],Rm=[3,V,t$,0,[p$,I$,E$,dm,A$],[[()=>R$,0],0,1,[()=>Cm,0],[()=>O$,0]]],vm=[9,V,ZU,{[_$]:["POST","/token",200]},()=>Im,()=>Rm],P$=(t)=>({apiVersion:"2019-06-10",base64Decoder:t?.base64Decoder??vU,base64Encoder:t?.base64Encoder??RU,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??KU,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??UU,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new xU},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new HL}],logger:t?.logger??new GL,protocol:t?.protocol??kU,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:Tm,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:t?.serviceId??"SSO OIDC",sha256:t?.sha256??MU,urlParser:t?.urlParser??hU,utf8Decoder:t?.utf8Decoder??IU,utf8Encoder:t?.utf8Encoder??CU}),k$=(t)=>{KL(process.version);let r=tU(t),n=()=>r().then(QL),s=P$(t);NL(process.version);let o={profile:t?.profile,logger:s.logger};return{...s,...t,runtime:"node",defaultsMode:r,authSchemePreference:t?.authSchemePreference??Lt(TU,o),bodyLengthChecker:t?.bodyLengthChecker??NU,defaultUserAgentProvider:t?.defaultUserAgentProvider??OL({serviceId:s.serviceId,clientVersion:qU.version}),maxAttempts:t?.maxAttempts??Lt(wU,t),region:t?.region??Lt(sU,{...oU,...o}),requestHandler:PU.create(t?.requestHandler??n),retryMode:t?.retryMode??Lt({...SU,default:async()=>(await n()).retryMode||yU},t),streamCollector:t?.streamCollector??OU,useDualstackEndpoint:t?.useDualstackEndpoint??Lt(nU,o),useFipsEndpoint:t?.useFipsEndpoint??Lt(rU,o),userAgentAppId:t?.userAgentAppId??Lt(PL,o)}},M$=(t)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:n,credentials:s}=t;return{setHttpAuthScheme(o){let i=r.findIndex((u)=>u.schemeId===o.schemeId);if(i===-1)r.push(o);else r.splice(i,1,o)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(o){n=o},httpAuthSchemeProvider(){return n},setCredentials(o){s=o},credentials(){return s}}},D$=(t)=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),F$=(t,r)=>{let n=Object.assign(kL(t),XL(t),pU(t),M$(t));return r.forEach((s)=>s.configure(n)),Object.assign(t,ML(n),YL(n),gU(n),D$(n))};class Oc extends im{config;constructor(...[t]){let r=k$(t||{});super(r);this.initConfig=r;let n=BU(r),s=DL(n),o=EU(s),i=iU(o),u=FL(i),a=lU(u),d=$U(a),l=F$(d,t?.extensions||[]);this.config=l,this.middlewareStack.use(_U(this.config)),this.middlewareStack.use(LL(this.config)),this.middlewareStack.use(bU(this.config)),this.middlewareStack.use(mU(this.config)),this.middlewareStack.use(UL(this.config)),this.middlewareStack.use($L(this.config)),this.middlewareStack.use(BL(this.config)),this.middlewareStack.use(zL(this.config,{httpAuthSchemeParametersProvider:DU,identityProviderConfigProvider:async(h)=>new qL({"aws.auth#sigv4":h.credentials})})),this.middlewareStack.use(VL(this.config))}destroy(){super.destroy()}}var L$=JL(HU,"AWSSSOOIDCService","SSOOIDCClient",fU),U$={},$$=(t,r,n,s)=>[];class Pc extends L$(U$,$$,"CreateToken",vm){}var B$={CreateTokenCommand:Pc};class kc extends Oc{}ZL(B$,kc);var H$={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},z$={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};q$.AccessDeniedException=ro;q$.AccessDeniedException$=pm;q$.AccessDeniedExceptionReason=H$;q$.AuthorizationPendingException=no;q$.AuthorizationPendingException$=gm;q$.CreateToken$=vm;q$.CreateTokenCommand=Pc;q$.CreateTokenRequest$=Im;q$.CreateTokenResponse$=Rm;q$.ExpiredTokenException=so;q$.ExpiredTokenException$=mm;q$.InternalServerException=oo;q$.InternalServerException$=ym;q$.InvalidClientException=io;q$.InvalidClientException$=Sm;q$.InvalidGrantException=ao;q$.InvalidGrantException$=wm;q$.InvalidRequestException=co;q$.InvalidRequestException$=Em;q$.InvalidRequestExceptionReason=z$;q$.InvalidScopeException=uo;q$.InvalidScopeException$=bm;q$.SSOOIDC=kc;q$.SSOOIDCClient=Oc;q$.SSOOIDCServiceException=le;q$.SSOOIDCServiceException$=hm;q$.SlowDownException=lo;q$.SlowDownException$=_m;q$.UnauthorizedClientException=fo;q$.UnauthorizedClientException$=Am;q$.UnsupportedGrantTypeException=ho;q$.UnsupportedGrantTypeException$=xm;q$.errorTypeRegistries=Tm});var km=e(function(z2){var{setTokenFeature:T2}=pe(),{getBearerTokenEnvKey:C2}=tt(),{TokenProviderError:Ne,getSSOTokenFilepath:I2,parseKnownFiles:R2,getProfileName:v2,loadSsoSessionData:N2,getSSOTokenFromFile:O2,memoize:P2,chain:k2}=W(),{promises:M2}=c("node:fs"),D2=({logger:t,signingName:r}={})=>async()=>{if(t?.debug?.("@aws-sdk/token-providers - fromEnvSigningName"),!r)throw new Ne("Please pass 'signingName' to compute environment variable key",{logger:t});let n=C2(r);if(!(n in process.env))throw new Ne(`Token not present in '${n}' environment variable`,{logger:t});let s={token:process.env[n]};return T2(s,"BEARER_SERVICE_ENV_VARS","3"),s},F2=async(t,r={},n)=>{let{SSOOIDCClient:s}=Mn(),o=(u)=>r.clientConfig?.[u]??r.parentClientConfig?.[u]??n?.[u];return new s(Object.assign({},r.clientConfig??{},{region:t??r.clientConfig?.region,logger:o("logger"),userAgentAppId:o("userAgentAppId")}))},L2=async(t,r,n={},s)=>{let{CreateTokenCommand:o}=Mn();return(await F2(r,n,s)).send(new o({clientId:t.clientId,clientSecret:t.clientSecret,refreshToken:t.refreshToken,grantType:"refresh_token"}))},Nm=(t)=>{if(t.expiration&&t.expiration.getTime()<Date.now())throw new Ne("Token is expired. To refresh this SSO session run 'aws sso login' with the corresponding profile.",!1)},$t=(t,r,n=!1)=>{if(typeof r>"u")throw new Ne(`Value not present for '${t}' in SSO Token${n?". Cannot refresh":""}. To refresh this SSO session run 'aws sso login' with the corresponding profile.`,!1)},{writeFile:U2}=M2,$2=(t,r)=>{let n=I2(t),s=JSON.stringify(r,null,2);return U2(n,s)},Om=new Map,Pm=(t={})=>async({callerClientConfig:r}={})=>{t.logger?.debug("@aws-sdk/token-providers - fromSso");let n=await R2(t),s=v2({profile:t.profile??r?.profile}),o=n[s];if(!o)throw new Ne(`Profile '${s}' could not be found in shared credentials file.`,!1);else if(!o.sso_session)throw new Ne(`Profile '${s}' is missing required property 'sso_session'.`);let i=o.sso_session,a=(await N2(t))[i];if(!a)throw new Ne(`Sso session '${i}' could not be found in shared credentials file.`,!1);for(let m of["sso_start_url","sso_region"])if(!a[m])throw new Ne(`Sso session '${i}' is missing required property '${m}'.`,!1);a.sso_start_url;let d=a.sso_region,l;try{l=await O2(i)}catch(m){throw new Ne(`The SSO session token associated with profile=${s} was not found or is invalid. To refresh this SSO session run 'aws sso login' with the corresponding profile.`,!1)}$t("accessToken",l.accessToken),$t("expiresAt",l.expiresAt);let{accessToken:h,expiresAt:f}=l,p={token:h,expiration:new Date(f)};if(p.expiration.getTime()-Date.now()>300000)return p;let g=Om.get(i)??0;if(Date.now()-g<30000)return Nm(p),p;$t("clientId",l.clientId,!0),$t("clientSecret",l.clientSecret,!0),$t("refreshToken",l.refreshToken,!0);try{Om.set(i,Date.now());let m=await L2(l,d,t,r);$t("accessToken",m.accessToken),$t("expiresIn",m.expiresIn);let y=new Date(Date.now()+m.expiresIn*1000);try{await $2(i,{...l,accessToken:m.accessToken,expiresAt:y.toISOString(),refreshToken:m.refreshToken})}catch(S){}return{token:m.accessToken,expiration:y}}catch(m){return Nm(p),p}},B2=({token:t,logger:r})=>async()=>{if(r?.debug("@aws-sdk/token-providers - fromStatic"),!t||!t.token)throw new Ne("Please pass a valid token to fromStatic",!1);return t},H2=(t={})=>P2(k2(Pm(t),async()=>{throw new Ne("Could not load token from any providers",!1)}),(r)=>r.expiration!==void 0&&r.expiration.getTime()-Date.now()<300000,(r)=>r.expiration!==void 0);z2.fromEnvSigningName=D2;z2.fromSso=Pm;z2.fromStatic=B2;z2.nodeProvider=H2});var ty=e(function(Q4){var{awsEndpointFunctions:G2,emitWarningIfUnsupportedVersion:K2,createDefaultUserAgentProvider:Q2,NODE_APP_ID_CONFIG_OPTIONS:X2,getAwsRegionExtensionConfiguration:Y2,resolveAwsRegionExtensionConfiguration:J2,resolveUserAgentConfig:Z2,resolveHostHeaderConfig:eB,getUserAgentPlugin:tB,getHostHeaderPlugin:rB,getLoggerPlugin:nB,getRecursionDetectionPlugin:sB}=pe(),{NoAuthSigner:oB,getHttpAuthSchemeEndpointRuleSetPlugin:iB,DefaultIdentityProviderConfig:aB,getHttpSigningPlugin:cB}=et(),{normalizeProvider:$m,getSmithyContext:uB,ServiceException:dB,NoOpLogger:lB,emitWarningIfUnsupportedVersion:fB,loadConfigsForDefaultMode:hB,getDefaultExtensionConfiguration:pB,resolveDefaultRuntimeConfig:gB,Client:Bm,makeBuilder:mB,createAggregatedClient:yB}=Ie(),{Command:SB}=Ie();Q4.$Command=SB;Q4.__Client=Bm;var{resolveDefaultsModeConfig:wB,loadConfig:Bt,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:EB,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:bB,NODE_REGION_CONFIG_OPTIONS:_B,NODE_REGION_CONFIG_FILE_OPTIONS:AB,resolveRegionConfig:xB}=W(),{BinaryDecisionDiagram:TB,EndpointCache:CB,decideEndpoint:IB,customEndpointFunctions:RB,resolveEndpointConfig:vB,getEndpointPlugin:NB}=Ye(),{parseUrl:OB,getHttpHandlerExtensionConfiguration:PB,resolveHttpHandlerRuntimeConfig:kB,getContentLengthPlugin:MB}=K(),{DEFAULT_RETRY_MODE:DB,NODE_RETRY_MODE_CONFIG_OPTIONS:FB,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:LB,resolveRetryConfig:UB,getRetryPlugin:$B}=lt(),{TypeRegistry:Hm,getSchemaSerdePlugin:BB}=Re(),{resolveAwsSdkSigV4Config:HB,AwsSdkSigV4Signer:zB,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:qB}=tt(),{toUtf8:VB,fromUtf8:jB,toBase64:WB,fromBase64:GB,calculateBodyLength:KB}=ee(),{streamCollector:QB,NodeHttpHandler:XB}=It(),{AwsRestJsonProtocol:YB}=Qt(),{Sha256:JB}=ct(),ZB=async(t,r,n)=>({operation:uB(r).operation,region:await $m(t.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function e4(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:t.region},propertiesExtractor:(r,n)=>({signingProperties:{config:r,context:n}})}}function t4(t){return{schemeId:"smithy.api#noAuth"}}var r4=(t)=>{let r=[];switch(t.operation){case"GetRoleCredentials":{r.push(t4());break}default:r.push(e4(t))}return r},n4=(t)=>{let r=HB(t);return Object.assign(r,{authSchemePreference:$m(t.authSchemePreference??[])})},s4=(t)=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}),o4={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},i4="3.997.45",a4={version:i4},_n="ref",Ht=-1,po=!0,Mm="isSet",zm="PartitionResult",go="booleanEquals",Mc="getAttr",Dm={[_n]:"Endpoint"},Dc={[_n]:zm},Tr={},Fm=[{[_n]:"Region"}],Lm={conditions:[[Mm,[Dm]],[Mm,Fm],["aws.partition",Fm,zm],[go,[{[_n]:"UseFIPS"},po]],[go,[{[_n]:"UseDualStack"},po]],[go,[{fn:Mc,argv:[Dc,"supportsDualStack"]},po]],[go,[{fn:Mc,argv:[Dc,"supportsFIPS"]},po]],["stringEquals",[{fn:Mc,argv:[Dc,"name"]},"aws-us-gov"]]],results:[[Ht],[Ht,"Invalid Configuration: FIPS and custom endpoint are not supported"],[Ht,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[Dm,Tr],["https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",Tr],[Ht,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://portal.sso.{Region}.amazonaws.com",Tr],["https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",Tr],[Ht,"FIPS is enabled but this partition does not support FIPS"],["https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",Tr],[Ht,"DualStack is enabled but this partition does not support DualStack"],["https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",Tr],[Ht,"Invalid Configuration: Missing Region"]]},c4=2,ge=1e8,u4=new Int32Array([-1,1,-1,0,13,3,1,4,ge+12,2,5,ge+12,3,8,6,4,7,ge+11,5,ge+9,ge+10,4,11,9,6,10,ge+8,7,ge+6,ge+7,5,12,ge+5,6,ge+4,ge+5,3,ge+1,14,4,ge+2,ge+3]),d4=TB.from(u4,c4,Lm.conditions,Lm.results),l4=new CB({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),f4=(t,r={})=>l4.get(t,()=>IB(d4,{endpointParams:t,logger:r.logger}));RB.aws=G2;class pt extends dB{constructor(t){super(t);Object.setPrototypeOf(this,pt.prototype)}}class mo extends pt{name="InvalidRequestException";$fault="client";constructor(t){super({name:"InvalidRequestException",$fault:"client",...t});Object.setPrototypeOf(this,mo.prototype)}}class yo extends pt{name="ResourceNotFoundException";$fault="client";constructor(t){super({name:"ResourceNotFoundException",$fault:"client",...t});Object.setPrototypeOf(this,yo.prototype)}}class So extends pt{name="TooManyRequestsException";$fault="client";constructor(t){super({name:"TooManyRequestsException",$fault:"client",...t});Object.setPrototypeOf(this,So.prototype)}}class wo extends pt{name="UnauthorizedException";$fault="client";constructor(t){super({name:"UnauthorizedException",$fault:"client",...t});Object.setPrototypeOf(this,wo.prototype)}}var h4="AccessTokenType",p4="GetRoleCredentials",g4="GetRoleCredentialsRequest",m4="GetRoleCredentialsResponse",y4="InvalidRequestException",S4="RoleCredentials",w4="ResourceNotFoundException",E4="SecretAccessKeyType",b4="SessionTokenType",_4="TooManyRequestsException",A4="UnauthorizedException",x4="accountId",T4="accessKeyId",C4="accessToken",I4="account_id",Eo="client",bo="error",R4="expiration",v4="http",_o="httpError",N4="httpHeader",Um="httpQuery",Ao="message",O4="roleCredentials",P4="roleName",k4="role_name",qm="smithy.ts.sdk.synthetic.com.amazonaws.sso",M4="secretAccessKey",D4="sessionToken",F4="x-amz-sso_bearer_token",be="com.amazonaws.sso",Vm=new Hm(qm),jm=[-3,qm,"SSOServiceException",0,[],[]];Vm.registerError(jm,pt);var An=new Hm(be),Wm=[-3,be,y4,{[bo]:Eo,[_o]:400},[Ao],[0]];An.registerError(Wm,mo);var Gm=[-3,be,w4,{[bo]:Eo,[_o]:404},[Ao],[0]];An.registerError(Gm,yo);var Km=[-3,be,_4,{[bo]:Eo,[_o]:429},[Ao],[0]];An.registerError(Km,So);var Qm=[-3,be,A4,{[bo]:Eo,[_o]:401},[Ao],[0]];An.registerError(Qm,wo);var Xm=[Vm,An],L4=[0,be,h4,8,0],U4=[0,be,E4,8,0],$4=[0,be,b4,8,0],Ym=[3,be,g4,0,[P4,x4,C4],[[0,{[Um]:k4}],[0,{[Um]:I4}],[()=>L4,{[N4]:F4}]],3],Jm=[3,be,m4,0,[O4],[[()=>Zm,0]]],Zm=[3,be,S4,0,[T4,M4,D4,R4],[0,[()=>U4,0],[()=>$4,0],1]],ey=[9,be,p4,{[v4]:["GET","/federation/credentials",200]},()=>Ym,()=>Jm],B4=(t)=>({apiVersion:"2019-06-10",base64Decoder:t?.base64Decoder??GB,base64Encoder:t?.base64Encoder??WB,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??f4,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??r4,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new zB},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new oB}],logger:t?.logger??new lB,protocol:t?.protocol??YB,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sso",errorTypeRegistries:Xm,version:"2019-06-10",serviceTarget:"SWBPortalService"},serviceId:t?.serviceId??"SSO",sha256:t?.sha256??JB,urlParser:t?.urlParser??OB,utf8Decoder:t?.utf8Decoder??jB,utf8Encoder:t?.utf8Encoder??VB}),H4=(t)=>{fB(process.version);let r=wB(t),n=()=>r().then(hB),s=B4(t);K2(process.version);let o={profile:t?.profile,logger:s.logger};return{...s,...t,runtime:"node",defaultsMode:r,authSchemePreference:t?.authSchemePreference??Bt(qB,o),bodyLengthChecker:t?.bodyLengthChecker??KB,defaultUserAgentProvider:t?.defaultUserAgentProvider??Q2({serviceId:s.serviceId,clientVersion:a4.version}),maxAttempts:t?.maxAttempts??Bt(LB,t),region:t?.region??Bt(_B,{...AB,...o}),requestHandler:XB.create(t?.requestHandler??n),retryMode:t?.retryMode??Bt({...FB,default:async()=>(await n()).retryMode||DB},t),streamCollector:t?.streamCollector??QB,useDualstackEndpoint:t?.useDualstackEndpoint??Bt(bB,o),useFipsEndpoint:t?.useFipsEndpoint??Bt(EB,o),userAgentAppId:t?.userAgentAppId??Bt(X2,o)}},z4=(t)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:n,credentials:s}=t;return{setHttpAuthScheme(o){let i=r.findIndex((u)=>u.schemeId===o.schemeId);if(i===-1)r.push(o);else r.splice(i,1,o)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(o){n=o},httpAuthSchemeProvider(){return n},setCredentials(o){s=o},credentials(){return s}}},q4=(t)=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),V4=(t,r)=>{let n=Object.assign(Y2(t),pB(t),PB(t),z4(t));return r.forEach((s)=>s.configure(n)),Object.assign(t,J2(n),gB(n),kB(n),q4(n))};class Fc extends Bm{config;constructor(...[t]){let r=H4(t||{});super(r);this.initConfig=r;let n=s4(r),s=Z2(n),o=UB(s),i=xB(o),u=eB(i),a=vB(u),d=n4(a),l=V4(d,t?.extensions||[]);this.config=l,this.middlewareStack.use(BB(this.config)),this.middlewareStack.use(tB(this.config)),this.middlewareStack.use($B(this.config)),this.middlewareStack.use(MB(this.config)),this.middlewareStack.use(rB(this.config)),this.middlewareStack.use(nB(this.config)),this.middlewareStack.use(sB(this.config)),this.middlewareStack.use(iB(this.config,{httpAuthSchemeParametersProvider:ZB,identityProviderConfigProvider:async(h)=>new aB({"aws.auth#sigv4":h.credentials})})),this.middlewareStack.use(cB(this.config))}destroy(){super.destroy()}}var j4=mB(o4,"SWBPortalService","SSOClient",NB),W4={},G4=(t,r,n,s)=>[];class Lc extends j4(W4,G4,"GetRoleCredentials",ey){}var K4={GetRoleCredentialsCommand:Lc};class Uc extends Fc{}yB(K4,Uc);Q4.GetRoleCredentials$=ey;Q4.GetRoleCredentialsCommand=Lc;Q4.GetRoleCredentialsRequest$=Ym;Q4.GetRoleCredentialsResponse$=Jm;Q4.InvalidRequestException=mo;Q4.InvalidRequestException$=Wm;Q4.ResourceNotFoundException=yo;Q4.ResourceNotFoundException$=Gm;Q4.RoleCredentials$=Zm;Q4.SSO=Uc;Q4.SSOClient=Fc;Q4.SSOServiceException=pt;Q4.SSOServiceException$=jm;Q4.TooManyRequestsException=So;Q4.TooManyRequestsException$=Km;Q4.UnauthorizedException=wo;Q4.UnauthorizedException$=Qm;Q4.errorTypeRegistries=Xm});var ry=e(function(SH){var{GetRoleCredentialsCommand:mH,SSOClient:yH}=ty();SH.GetRoleCredentialsCommand=mH;SH.SSOClient=yH});var $c=e(function(IH){var{CredentialsProviderError:Oe,getSSOTokenFromFile:bH,getProfileName:_H,parseKnownFiles:AH,loadSsoSessionData:xH}=W(),{setCredentialFeature:ny}=pe(),{fromSso:TH}=km(),oy=(t)=>t&&(typeof t.sso_start_url==="string"||typeof t.sso_account_id==="string"||typeof t.sso_session==="string"||typeof t.sso_region==="string"||typeof t.sso_role_name==="string"),sy=async({ssoStartUrl:t,ssoSession:r,ssoAccountId:n,ssoRegion:s,ssoRoleName:o,ssoClient:i,clientConfig:u,parentClientConfig:a,callerClientConfig:d,profile:l,filepath:h,configFilepath:f,ignoreCache:p,logger:g})=>{let m,y="To refresh this SSO session run aws sso login with the corresponding profile.";if(r)try{let D=await TH({profile:l,filepath:h,configFilepath:f,ignoreCache:p,clientConfig:u,parentClientConfig:a,logger:g})({callerClientConfig:d});m={accessToken:D.token,expiresAt:new Date(D.expiration).toISOString()}}catch(D){throw new Oe(D.message,{tryNextLink:!1,logger:g})}else try{m=await bH(t)}catch(D){throw new Oe("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:!1,logger:g})}if(new Date(m.expiresAt).getTime()-Date.now()<=0)throw new Oe("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:!1,logger:g});let{accessToken:S}=m,{SSOClient:w,GetRoleCredentialsCommand:E}=ry(),A=i||new w(Object.assign({},u??{},{logger:u?.logger??d?.logger??a?.logger,region:u?.region??s,userAgentAppId:u?.userAgentAppId??d?.userAgentAppId??a?.userAgentAppId})),v;try{v=await A.send(new E({accountId:n,roleName:o,accessToken:S}))}catch(D){throw new Oe(D,{tryNextLink:!1,logger:g})}let{roleCredentials:{accessKeyId:L,secretAccessKey:k,sessionToken:U,expiration:de,credentialScope:q,accountId:j}={}}=v;if(!L||!k||!U||!de)throw new Oe("SSO returns an invalid temporary credential.",{tryNextLink:!1,logger:g});let ke={accessKeyId:L,secretAccessKey:k,sessionToken:U,expiration:new Date(de),...q&&{credentialScope:q},...j&&{accountId:j}};if(r)ny(ke,"CREDENTIALS_SSO","s");else ny(ke,"CREDENTIALS_SSO_LEGACY","u");return ke},iy=(t,r)=>{let{sso_start_url:n,sso_account_id:s,sso_region:o,sso_role_name:i}=t;if(!n||!s||!o||!i)throw new Oe(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(t).join(", ")}
51
+ Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:r});return t},CH=(t={})=>async({callerClientConfig:r}={})=>{t.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:n,ssoAccountId:s,ssoRegion:o,ssoRoleName:i,ssoSession:u}=t,{ssoClient:a}=t,d=_H({profile:t.profile??r?.profile});if(!n&&!s&&!o&&!i&&!u){let h=(await AH(t))[d];if(!h)throw new Oe(`Profile ${d} was not found.`,{logger:t.logger});if(!oy(h))throw new Oe(`Profile ${d} is not configured with SSO credentials.`,{logger:t.logger});if(h?.sso_session){let w=(await xH(t))[h.sso_session],E=` configurations in profile ${d} and sso-session ${h.sso_session}`;if(o&&o!==w.sso_region)throw new Oe("Conflicting SSO region"+E,{tryNextLink:!1,logger:t.logger});if(n&&n!==w.sso_start_url)throw new Oe("Conflicting SSO start_url"+E,{tryNextLink:!1,logger:t.logger});h.sso_region=w.sso_region,h.sso_start_url=w.sso_start_url}let{sso_start_url:f,sso_account_id:p,sso_region:g,sso_role_name:m,sso_session:y}=iy(h,t.logger);return sy({ssoStartUrl:f,ssoSession:y,ssoAccountId:p,ssoRegion:g,ssoRoleName:m,ssoClient:a,clientConfig:t.clientConfig,parentClientConfig:t.parentClientConfig,callerClientConfig:t.callerClientConfig,profile:d,filepath:t.filepath,configFilepath:t.configFilepath,ignoreCache:t.ignoreCache,logger:t.logger})}else if(!n||!s||!o||!i)throw new Oe('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:t.logger});else return sy({ssoStartUrl:n,ssoSession:u,ssoAccountId:s,ssoRegion:o,ssoRoleName:i,ssoClient:a,clientConfig:t.clientConfig,parentClientConfig:t.parentClientConfig,callerClientConfig:t.callerClientConfig,profile:d,filepath:t.filepath,configFilepath:t.configFilepath,ignoreCache:t.ignoreCache,logger:t.logger})};IH.fromSSO=CH;IH.isSsoProfile=oy;IH.validateSsoProfile=iy});var fy=e(function(PH){var{SignatureV4:OH,signatureV4aContainer:ay}=va(),xn={CrtSignerV4:null},cy="X-Amz-S3session-Token".toLowerCase();class Bc extends OH{async signWithCredentials(t,r,n){let s=uy(r);t.headers[cy]=r.sessionToken;let o=this;return dy(o,s),o.signRequest(t,n??{})}async presignWithCredentials(t,r,n){let s=uy(r);return delete t.headers[cy],t.headers["X-Amz-S3session-Token"]=r.sessionToken,t.query=t.query??{},t.query["X-Amz-S3session-Token"]=r.sessionToken,dy(this,s),this.presign(t,n)}}function uy(t){return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,expiration:t.expiration}}function dy(t,r){let n=t.credentialProvider;t.credentialProvider=()=>(t.credentialProvider=n,Promise.resolve(r))}class ly{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){if(typeof xn.CrtSignerV4==="function")return"crt";else if(typeof ay.SignatureV4a==="function")return"js";return"none"}constructor(t){this.sigv4Signer=new Bc(t),this.signerOptions=t}async sign(t,r={}){if(r.signingRegion==="*")return this.getSigv4aSigner().sign(t,r);return this.sigv4Signer.sign(t,r)}async signWithCredentials(t,r,n={}){if(n.signingRegion==="*"){let s=this.getSigv4aSigner(),o=xn.CrtSignerV4;if(o&&s instanceof o)return s.signWithCredentials(t,r,n);else throw Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.signWithCredentials(t,r,n)}async presign(t,r={}){if(r.signingRegion==="*"){let n=this.getSigv4aSigner(),s=xn.CrtSignerV4;if(s&&n instanceof s)return n.presign(t,r);else throw Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.presign(t,r)}async presignWithCredentials(t,r,n={}){if(n.signingRegion==="*")throw Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(t,r,n)}getSigv4aSigner(){if(!this.sigv4aSigner){let t=xn.CrtSignerV4,r=ay.SignatureV4a;if(this.signerOptions.runtime==="node"){if(!t&&!r)throw Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");if(t&&typeof t==="function")this.sigv4aSigner=new t({...this.signerOptions,signingAlgorithm:1});else if(r&&typeof r==="function")this.sigv4aSigner=new r({...this.signerOptions});else throw Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt")}else{if(!r||typeof r!=="function")throw Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");this.sigv4aSigner=new r({...this.signerOptions})}}return this.sigv4aSigner}}PH.SignatureV4MultiRegion=ly;PH.SignatureV4SignWithCredentials=Bc;PH.signatureV4CrtContainer=xn});var Yc=e(function(iq){var{awsEndpointFunctions:FH,emitWarningIfUnsupportedVersion:LH,createDefaultUserAgentProvider:UH,NODE_APP_ID_CONFIG_OPTIONS:$H,getAwsRegionExtensionConfiguration:BH,resolveAwsRegionExtensionConfiguration:HH,resolveUserAgentConfig:zH,resolveHostHeaderConfig:qH,getUserAgentPlugin:VH,getHostHeaderPlugin:jH,getLoggerPlugin:WH,getRecursionDetectionPlugin:GH,setCredentialFeature:qc,stsRegionDefaultResolver:KH}=pe(),{NoAuthSigner:by,getHttpAuthSchemeEndpointRuleSetPlugin:QH,DefaultIdentityProviderConfig:XH,getHttpSigningPlugin:YH}=et(),{normalizeProvider:_y,getSmithyContext:Ay,ServiceException:JH,NoOpLogger:ZH,emitWarningIfUnsupportedVersion:ez,loadConfigsForDefaultMode:tz,getDefaultExtensionConfiguration:rz,resolveDefaultRuntimeConfig:nz,Client:xy,makeBuilder:sz,createAggregatedClient:oz}=Ie(),{Command:iz}=Ie();iq.$Command=iz;iq.__Client=xy;var{resolveDefaultsModeConfig:az,loadConfig:gt,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:cz,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:uz,NODE_REGION_CONFIG_OPTIONS:dz,NODE_REGION_CONFIG_FILE_OPTIONS:lz,resolveRegionConfig:fz}=W(),{BinaryDecisionDiagram:hz,EndpointCache:pz,decideEndpoint:gz,customEndpointFunctions:mz,resolveParams:yz,resolveEndpointConfig:Sz,getEndpointPlugin:wz}=Ye(),{parseUrl:Ez,getHttpHandlerExtensionConfiguration:bz,resolveHttpHandlerRuntimeConfig:_z,getContentLengthPlugin:Az}=K(),{DEFAULT_RETRY_MODE:xz,NODE_RETRY_MODE_CONFIG_OPTIONS:Tz,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:Cz,resolveRetryConfig:Iz,getRetryPlugin:Rz}=lt(),{TypeRegistry:Ty,getSchemaSerdePlugin:vz}=Re(),{resolveAwsSdkSigV4Config:Nz,resolveAwsSdkSigV4AConfig:Oz,AwsSdkSigV4Signer:Cy,AwsSdkSigV4ASigner:Iy,NODE_SIGV4A_CONFIG_OPTIONS:Pz,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:kz}=tt(),{SignatureV4MultiRegion:Ry}=fy(),{toUtf8:Mz,fromUtf8:Dz,toBase64:Fz,fromBase64:Lz,calculateBodyLength:Uz}=ee(),{streamCollector:$z,NodeHttpHandler:Bz}=It(),{AwsQueryProtocol:Hz}=Qt(),{Sha256:zz}=ct(),Ir="ref",zt=-1,Tn=!0,hy="isSet",vy="PartitionResult",Cn="booleanEquals",ne="stringEquals",Hc="getAttr",py="us-east-1",gy="sigv4",my="sts",yy="https://sts.{Region}.{PartitionResult#dnsSuffix}",Sy={[Ir]:"Endpoint"},se={[Ir]:"Region"},zc={[Ir]:vy},Cr={},wy=[se],Ey={conditions:[[hy,[Sy]],[hy,wy],["aws.partition",wy,vy],[Cn,[{[Ir]:"UseFIPS"},Tn]],[Cn,[{[Ir]:"UseDualStack"},Tn]],[ne,[se,"aws-global"]],[Cn,[{[Ir]:"UseGlobalEndpoint"},Tn]],[ne,[se,"eu-central-1"]],[Cn,[{fn:Hc,argv:[zc,"supportsDualStack"]},Tn]],[Cn,[{fn:Hc,argv:[zc,"supportsFIPS"]},Tn]],[ne,[se,"ap-south-1"]],[ne,[se,"eu-north-1"]],[ne,[se,"eu-west-1"]],[ne,[se,"eu-west-2"]],[ne,[se,"eu-west-3"]],[ne,[se,"sa-east-1"]],[ne,[se,py]],[ne,[se,"us-east-2"]],[ne,[se,"us-west-2"]],[ne,[se,"us-west-1"]],[ne,[se,"ca-central-1"]],[ne,[se,"ap-southeast-1"]],[ne,[se,"ap-northeast-1"]],[ne,[se,"ap-southeast-2"]],[ne,[{fn:Hc,argv:[zc,"name"]},"aws-us-gov"]]],results:[[zt],["https://sts.amazonaws.com",{authSchemes:[{name:gy,signingName:my,signingRegion:py}]}],[yy,{authSchemes:[{name:gy,signingName:my,signingRegion:"{Region}"}]}],[zt,"Invalid Configuration: FIPS and custom endpoint are not supported"],[zt,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[Sy,Cr],["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",Cr],[zt,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://sts.{Region}.amazonaws.com",Cr],["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",Cr],[zt,"FIPS is enabled but this partition does not support FIPS"],["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",Cr],[zt,"DualStack is enabled but this partition does not support DualStack"],[yy,Cr],[zt,"Invalid Configuration: Missing Region"]]},qz=2,P=1e8,Vz=new Int32Array([-1,1,-1,0,30,3,1,4,P+14,2,5,P+14,3,25,6,4,24,7,5,P+1,8,6,9,P+13,7,P+1,10,10,P+1,11,11,P+1,12,12,P+1,13,13,P+1,14,14,P+1,15,15,P+1,16,16,P+1,17,17,P+1,18,18,P+1,19,19,P+1,20,20,P+1,21,21,P+1,22,22,P+1,23,23,P+1,P+2,8,P+11,P+12,4,28,26,9,27,P+10,24,P+8,P+9,8,29,P+7,9,P+6,P+7,3,P+3,31,4,P+4,P+5]),jz=hz.from(Vz,qz,Ey.conditions,Ey.results),Wz=new pz({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),Ny=(t,r={})=>Wz.get(t,()=>gz(jz,{endpointParams:t,logger:r.logger}));mz.aws=FH;var Gz=(t)=>async(r,n,s)=>{if(!s)throw Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");let o=await t(r,n,s),i=Ay(n)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!i)throw Error(`getEndpointParameterInstructions() is not defined on '${n.commandName}'`);let u=await yz(s,{getEndpointParameterInstructions:i},r);return Object.assign(o,u)},Kz=async(t,r,n)=>({operation:Ay(r).operation,region:await _y(t.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),Qz=Gz(Kz);function Oy(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(r,n)=>({signingProperties:{config:r,context:n}})}}function Vc(t){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(r,n)=>({signingProperties:{config:r,context:n}})}}function Py(t){return{schemeId:"smithy.api#noAuth"}}var Xz=(t,r,n)=>(o)=>{let u=t(o).properties?.authSchemes;if(!u)return r(o);let a=[];for(let d of u){let{name:l,properties:h={},...f}=d,p=l.toLowerCase();if(l!==p)console.warn(`HttpAuthScheme has been normalized with lowercasing: '${l}' to '${p}'`);let g;if(p==="sigv4a"){g="aws.auth#sigv4a";let S=u.find((w)=>{let E=w.name.toLowerCase();return E!=="sigv4a"&&E.startsWith("sigv4")});if(Ry.sigv4aDependency()==="none"&&S)continue}else if(p.startsWith("sigv4"))g="aws.auth#sigv4";else throw Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${p}'`);let m=n[g];if(!m)throw Error(`Could not find HttpAuthOption create function for '${g}'`);let y=m(o);y.schemeId=g,y.signingProperties={...y.signingProperties||{},...f,...h},a.push(y)}return a},Yz=(t)=>{let r=[];switch(t.operation){case"AssumeRoleWithWebIdentity":{r.push(Py()),r.push(Vc(t));break}default:r.push(Oy(t)),r.push(Vc(t))}return r},Jz=Xz(Ny,Yz,{"aws.auth#sigv4":Oy,"aws.auth#sigv4a":Vc,"smithy.api#noAuth":Py}),Zz=(t)=>{let r=Nz(t),n=Oz(r);return Object.assign(n,{authSchemePreference:_y(t.authSchemePreference??[])})},e3=(t)=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,useGlobalEndpoint:t.useGlobalEndpoint??!1,defaultSigningName:"sts"}),t3={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},r3="3.997.45",n3={version:r3};class Pe extends JH{constructor(t){super(t);Object.setPrototypeOf(this,Pe.prototype)}}class xo extends Pe{name="ExpiredTokenException";$fault="client";constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t});Object.setPrototypeOf(this,xo.prototype)}}class To extends Pe{name="MalformedPolicyDocumentException";$fault="client";constructor(t){super({name:"MalformedPolicyDocumentException",$fault:"client",...t});Object.setPrototypeOf(this,To.prototype)}}class Co extends Pe{name="PackedPolicyTooLargeException";$fault="client";constructor(t){super({name:"PackedPolicyTooLargeException",$fault:"client",...t});Object.setPrototypeOf(this,Co.prototype)}}class Io extends Pe{name="RegionDisabledException";$fault="client";constructor(t){super({name:"RegionDisabledException",$fault:"client",...t});Object.setPrototypeOf(this,Io.prototype)}}class Ro extends Pe{name="IDPRejectedClaimException";$fault="client";constructor(t){super({name:"IDPRejectedClaimException",$fault:"client",...t});Object.setPrototypeOf(this,Ro.prototype)}}class vo extends Pe{name="InvalidIdentityTokenException";$fault="client";constructor(t){super({name:"InvalidIdentityTokenException",$fault:"client",...t});Object.setPrototypeOf(this,vo.prototype)}}class No extends Pe{name="IDPCommunicationErrorException";$fault="client";$retryable={};constructor(t){super({name:"IDPCommunicationErrorException",$fault:"client",...t});Object.setPrototypeOf(this,No.prototype)}}var s3="Arn",o3="AccessKeyId",i3="AssumeRole",a3="AssumedRoleId",c3="AssumeRoleRequest",u3="AssumeRoleResponse",jc="AssumedRoleUser",d3="AssumeRoleWithWebIdentity",l3="AssumeRoleWithWebIdentityRequest",f3="AssumeRoleWithWebIdentityResponse",h3="Audience",Wc="Credentials",p3="ContextAssertion",ky="DurationSeconds",g3="Expiration",m3="ExternalId",y3="ExpiredTokenException",S3="IDPCommunicationErrorException",w3="IDPRejectedClaimException",E3="InvalidIdentityTokenException",b3="Key",_3="MalformedPolicyDocumentException",My="MinimumSessionTokenSize",Dy="Policy",Fy="PolicyArns",A3="ProviderArn",x3="ProvidedContexts",T3="ProvidedContextsListType",C3="ProvidedContext",I3="PolicyDescriptorType",R3="ProviderId",Ly="PackedPolicySize",v3="PackedPolicyTooLargeException",N3="Provider",Uy="RoleArn",O3="RegionDisabledException",$y="RoleSessionName",P3="SecretAccessKey",k3="SubjectFromWebIdentityToken",Gc="SourceIdentity",M3="SerialNumber",D3="SessionToken",By="SessionTokenSize",Hy="SessionTokenUtilization",F3="Tags",L3="TokenCode",U3="TransitiveTagKeys",$3="Tag",B3="Value",H3="WebIdentityToken",z3="arn",q3="accessKeySecretType",qt="awsQueryError",Vt="client",V3="clientTokenType",jt="error",Wt="httpError",Gt="message",j3="policyDescriptorListType",zy="smithy.ts.sdk.synthetic.com.amazonaws.sts",W3="tagListType",B="com.amazonaws.sts",qy=new Ty(zy),Vy=[-3,zy,"STSServiceException",0,[],[]];qy.registerError(Vy,Pe);var mt=new Ty(B),jy=[-3,B,y3,{[qt]:["ExpiredTokenException",400],[jt]:Vt,[Wt]:400},[Gt],[0]];mt.registerError(jy,xo);var Wy=[-3,B,S3,{[qt]:["IDPCommunicationError",400],[jt]:Vt,[Wt]:400},[Gt],[0]];mt.registerError(Wy,No);var Gy=[-3,B,w3,{[qt]:["IDPRejectedClaim",403],[jt]:Vt,[Wt]:403},[Gt],[0]];mt.registerError(Gy,Ro);var Ky=[-3,B,E3,{[qt]:["InvalidIdentityToken",400],[jt]:Vt,[Wt]:400},[Gt],[0]];mt.registerError(Ky,vo);var Qy=[-3,B,_3,{[qt]:["MalformedPolicyDocument",400],[jt]:Vt,[Wt]:400},[Gt],[0]];mt.registerError(Qy,To);var Xy=[-3,B,v3,{[qt]:["PackedPolicyTooLarge",400],[jt]:Vt,[Wt]:400},[Gt],[0]];mt.registerError(Xy,Co);var Yy=[-3,B,O3,{[qt]:["RegionDisabledException",403],[jt]:Vt,[Wt]:403},[Gt],[0]];mt.registerError(Yy,Io);var Jy=[qy,mt],G3=[0,B,q3,8,0],K3=[0,B,V3,8,0],Kc=[3,B,jc,0,[a3,s3],[0,0],2],Zy=[3,B,c3,0,[Uy,$y,Fy,Dy,ky,F3,U3,m3,M3,L3,Gc,x3,My],[0,0,()=>iS,0,1,()=>X3,64,0,0,0,0,()=>Q3,1],2],eS=[3,B,u3,0,[Wc,jc,Ly,Gc,Hy,By],[[()=>Qc,0],()=>Kc,1,0,1,1]],tS=[3,B,l3,0,[Uy,$y,H3,R3,Fy,Dy,ky,My],[0,0,[()=>K3,0],0,()=>iS,0,1,1],3],rS=[3,B,f3,0,[Wc,k3,jc,Ly,N3,h3,Gc,Hy,By],[[()=>Qc,0],0,()=>Kc,1,0,0,0,1,1]],Qc=[3,B,Wc,0,[o3,P3,D3,g3],[0,[()=>G3,0],0,4],4],nS=[3,B,I3,0,[z3],[0]],sS=[3,B,C3,0,[A3,p3],[0,0]],oS=[3,B,$3,0,[b3,B3],[0,0],2],iS=[1,B,j3,0,()=>nS],Q3=[1,B,T3,0,()=>sS],X3=[1,B,W3,0,()=>oS],aS=[9,B,i3,0,()=>Zy,()=>eS],cS=[9,B,d3,0,()=>tS,()=>rS],Y3=(t)=>({apiVersion:"2011-06-15",base64Decoder:t?.base64Decoder??Lz,base64Encoder:t?.base64Encoder??Fz,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??Ny,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??Jz,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new Cy},{schemeId:"aws.auth#sigv4a",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4a"),signer:new Iy},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new by}],logger:t?.logger??new ZH,protocol:t?.protocol??Hz,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:Jy,xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:t?.serviceId??"STS",sha256:t?.sha256??zz,signerConstructor:t?.signerConstructor??Ry,urlParser:t?.urlParser??Ez,utf8Decoder:t?.utf8Decoder??Dz,utf8Encoder:t?.utf8Encoder??Mz}),J3=(t)=>{ez(process.version);let r=az(t),n=()=>r().then(tz),s=Y3(t);LH(process.version);let o={profile:t?.profile,logger:s.logger};return{...s,...t,runtime:"node",defaultsMode:r,authSchemePreference:t?.authSchemePreference??gt(kz,o),bodyLengthChecker:t?.bodyLengthChecker??Uz,defaultUserAgentProvider:t?.defaultUserAgentProvider??UH({serviceId:s.serviceId,clientVersion:n3.version}),httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(i)=>i.getIdentityProvider("aws.auth#sigv4")||(async(u)=>await t.credentialDefaultProvider(u?.__config||{})()),signer:new Cy},{schemeId:"aws.auth#sigv4a",identityProvider:(i)=>i.getIdentityProvider("aws.auth#sigv4a"),signer:new Iy},{schemeId:"smithy.api#noAuth",identityProvider:(i)=>i.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new by}],maxAttempts:t?.maxAttempts??gt(Cz,t),region:t?.region??gt(dz,{...lz,...o}),requestHandler:Bz.create(t?.requestHandler??n),retryMode:t?.retryMode??gt({...Tz,default:async()=>(await n()).retryMode||xz},t),sigv4aSigningRegionSet:t?.sigv4aSigningRegionSet??gt(Pz,o),streamCollector:t?.streamCollector??$z,useDualstackEndpoint:t?.useDualstackEndpoint??gt(uz,o),useFipsEndpoint:t?.useFipsEndpoint??gt(cz,o),userAgentAppId:t?.userAgentAppId??gt($H,o)}},Z3=(t)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:n,credentials:s}=t;return{setHttpAuthScheme(o){let i=r.findIndex((u)=>u.schemeId===o.schemeId);if(i===-1)r.push(o);else r.splice(i,1,o)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(o){n=o},httpAuthSchemeProvider(){return n},setCredentials(o){s=o},credentials(){return s}}},eq=(t)=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),tq=(t,r)=>{let n=Object.assign(BH(t),rz(t),bz(t),Z3(t));return r.forEach((s)=>s.configure(n)),Object.assign(t,HH(n),nz(n),_z(n),eq(n))};class In extends xy{config;constructor(...[t]){let r=J3(t||{});super(r);this.initConfig=r;let n=e3(r),s=zH(n),o=Iz(s),i=fz(o),u=qH(i),a=Sz(u),d=Zz(a),l=tq(d,t?.extensions||[]);this.config=l,this.middlewareStack.use(vz(this.config)),this.middlewareStack.use(VH(this.config)),this.middlewareStack.use(Rz(this.config)),this.middlewareStack.use(Az(this.config)),this.middlewareStack.use(jH(this.config)),this.middlewareStack.use(WH(this.config)),this.middlewareStack.use(GH(this.config)),this.middlewareStack.use(QH(this.config,{httpAuthSchemeParametersProvider:Qz,identityProviderConfigProvider:async(h)=>new XH({"aws.auth#sigv4":h.credentials,"aws.auth#sigv4a":h.credentials})})),this.middlewareStack.use(YH(this.config))}destroy(){super.destroy()}}var uS=sz(t3,"AWSSecurityTokenServiceV20110615","STSClient",wz),dS={},lS=(t,r,n,s)=>[];class Oo extends uS(dS,lS,"AssumeRole",aS){}class Po extends uS(dS,lS,"AssumeRoleWithWebIdentity",cS){}var rq={AssumeRoleCommand:Oo,AssumeRoleWithWebIdentityCommand:Po};class Xc extends In{}oz(rq,Xc);var fS=(t)=>{if(typeof t?.Arn==="string"){let r=t.Arn.split(":");if(r.length>4&&r[4]!=="")return r[4]}return},hS=async(t,r,n,s={})=>{let o=typeof t==="function"?await t():t,i=typeof r==="function"?await r():r,u="",a=o??i??(u=await KH(s)());return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${o} (credential provider clientConfig)`,`${i} (contextual client)`,`${u} (STS default: AWS_REGION, profile region, or us-east-1)`),a},nq=(t,r)=>{let n,s;return async(o,i)=>{if(s=o,!n){let{logger:h=t?.parentClientConfig?.logger,profile:f=t?.parentClientConfig?.profile,region:p,requestHandler:g=t?.parentClientConfig?.requestHandler,credentialProviderLogger:m,userAgentAppId:y=t?.parentClientConfig?.userAgentAppId}=t,S=await hS(p,t?.parentClientConfig?.region,m,{logger:h,profile:f}),w=!pS(g);n=new r({...t,userAgentAppId:y,profile:f,credentialDefaultProvider:()=>async()=>s,region:S,requestHandler:w?g:void 0,logger:h})}let{Credentials:u,AssumedRoleUser:a}=await n.send(new Oo(i));if(!u||!u.AccessKeyId||!u.SecretAccessKey)throw Error(`Invalid response from STS.assumeRole call with role ${i.RoleArn}`);let d=fS(a),l={accessKeyId:u.AccessKeyId,secretAccessKey:u.SecretAccessKey,sessionToken:u.SessionToken,expiration:u.Expiration,...u.CredentialScope&&{credentialScope:u.CredentialScope},...d&&{accountId:d}};return qc(l,"CREDENTIALS_STS_ASSUME_ROLE","i"),l}},sq=(t,r)=>{let n;return async(s)=>{if(!n){let{logger:d=t?.parentClientConfig?.logger,profile:l=t?.parentClientConfig?.profile,region:h,requestHandler:f=t?.parentClientConfig?.requestHandler,credentialProviderLogger:p,userAgentAppId:g=t?.parentClientConfig?.userAgentAppId}=t,m=await hS(h,t?.parentClientConfig?.region,p,{logger:d,profile:l}),y=!pS(f);n=new r({...t,userAgentAppId:g,profile:l,region:m,requestHandler:y?f:void 0,logger:d})}let{Credentials:o,AssumedRoleUser:i}=await n.send(new Po(s));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${s.RoleArn}`);let u=fS(i),a={accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration,...o.CredentialScope&&{credentialScope:o.CredentialScope},...u&&{accountId:u}};if(u)qc(a,"RESOLVED_ACCOUNT_ID","T");return qc(a,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),a}},pS=(t)=>t?.metadata?.handlerProtocol==="h2",gS=(t,r)=>{if(!r)return t;else return class extends t{constructor(s){super(s);for(let o of r)this.middlewareStack.use(o)}}},mS=(t={},r)=>nq(t,gS(In,r)),yS=(t={},r)=>sq(t,gS(In,r)),oq=(t)=>(r)=>t({roleAssumer:mS(r),roleAssumerWithWebIdentity:yS(r),...r});iq.AssumeRole$=aS;iq.AssumeRoleCommand=Oo;iq.AssumeRoleRequest$=Zy;iq.AssumeRoleResponse$=eS;iq.AssumeRoleWithWebIdentity$=cS;iq.AssumeRoleWithWebIdentityCommand=Po;iq.AssumeRoleWithWebIdentityRequest$=tS;iq.AssumeRoleWithWebIdentityResponse$=rS;iq.AssumedRoleUser$=Kc;iq.Credentials$=Qc;iq.ExpiredTokenException=xo;iq.ExpiredTokenException$=jy;iq.IDPCommunicationErrorException=No;iq.IDPCommunicationErrorException$=Wy;iq.IDPRejectedClaimException=Ro;iq.IDPRejectedClaimException$=Gy;iq.InvalidIdentityTokenException=vo;iq.InvalidIdentityTokenException$=Ky;iq.MalformedPolicyDocumentException=To;iq.MalformedPolicyDocumentException$=Qy;iq.PackedPolicyTooLargeException=Co;iq.PackedPolicyTooLargeException$=Xy;iq.PolicyDescriptorType$=nS;iq.ProvidedContext$=sS;iq.RegionDisabledException=Io;iq.RegionDisabledException$=Yy;iq.STS=Xc;iq.STSClient=In;iq.STSServiceException=Pe;iq.STSServiceException$=Vy;iq.Tag$=oS;iq.decorateDefaultCredentialProvider=oq;iq.errorTypeRegistries=Jy;iq.getDefaultRoleAssumer=mS;iq.getDefaultRoleAssumerWithWebIdentity=yS});var sw=e(function(VV){var{awsEndpointFunctions:Vq,emitWarningIfUnsupportedVersion:jq,createDefaultUserAgentProvider:Wq,NODE_APP_ID_CONFIG_OPTIONS:Gq,getAwsRegionExtensionConfiguration:Kq,resolveAwsRegionExtensionConfiguration:Qq,resolveUserAgentConfig:Xq,resolveHostHeaderConfig:Yq,getUserAgentPlugin:Jq,getHostHeaderPlugin:Zq,getLoggerPlugin:e6,getRecursionDetectionPlugin:t6}=pe(),{NoAuthSigner:r6,getHttpAuthSchemeEndpointRuleSetPlugin:n6,DefaultIdentityProviderConfig:s6,getHttpSigningPlugin:o6}=et(),{normalizeProvider:kS,getSmithyContext:i6,ServiceException:a6,NoOpLogger:c6,emitWarningIfUnsupportedVersion:u6,loadConfigsForDefaultMode:d6,getDefaultExtensionConfiguration:l6,resolveDefaultRuntimeConfig:f6,Client:MS,makeBuilder:h6,createAggregatedClient:p6}=Ie(),{Command:g6}=Ie();VV.$Command=g6;VV.__Client=MS;var{resolveDefaultsModeConfig:m6,loadConfig:Kt,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:y6,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:S6,NODE_REGION_CONFIG_OPTIONS:w6,NODE_REGION_CONFIG_FILE_OPTIONS:E6,resolveRegionConfig:b6}=W(),{BinaryDecisionDiagram:_6,EndpointCache:A6,decideEndpoint:x6,customEndpointFunctions:T6,resolveEndpointConfig:C6,getEndpointPlugin:I6}=Ye(),{parseUrl:R6,getHttpHandlerExtensionConfiguration:v6,resolveHttpHandlerRuntimeConfig:N6,getContentLengthPlugin:O6}=K(),{DEFAULT_RETRY_MODE:P6,NODE_RETRY_MODE_CONFIG_OPTIONS:k6,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:M6,resolveRetryConfig:D6,getRetryPlugin:F6}=lt(),{TypeRegistry:DS,getSchemaSerdePlugin:L6}=Re(),{resolveAwsSdkSigV4Config:U6,AwsSdkSigV4Signer:$6,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:B6}=tt(),{toUtf8:H6,fromUtf8:z6,toBase64:q6,fromBase64:V6,calculateBodyLength:j6}=ee(),{streamCollector:W6,NodeHttpHandler:G6}=It(),{AwsRestJsonProtocol:K6}=Qt(),{Sha256:Q6}=ct(),X6=async(t,r,n)=>({operation:i6(r).operation,region:await kS(t.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Y6(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:t.region},propertiesExtractor:(r,n)=>({signingProperties:{config:r,context:n}})}}function J6(t){return{schemeId:"smithy.api#noAuth"}}var Z6=(t)=>{let r=[];switch(t.operation){case"CreateOAuth2Token":{r.push(J6());break}default:r.push(Y6(t))}return r},eV=(t)=>{let r=U6(t);return Object.assign(r,{authSchemePreference:kS(t.authSchemePreference??[])})},tV=(t)=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"signin"}),rV={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},nV="3.997.45",sV={version:nV},Et="ref",St=-1,SS=!1,Rr=!0,wS="isSet",vr="booleanEquals",ES="coalesce",nu="PartitionResult",Xe="stringEquals",Jc="getAttr",bS="https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",_S={[Et]:"Endpoint"},wt={fn:Jc,argv:[{[Et]:nu},"name"]},FS={[Et]:"Region"},AS={[Et]:nu},ko={authSchemes:[{name:"sigv4",signingName:"signin",signingRegion:"{Region}"}]},ce={},xS=[FS],TS={conditions:[[wS,xS],[vr,[{fn:ES,argv:[{[Et]:"IsControlPlane"},SS]},Rr]],[wS,[_S]],["aws.partition",xS,nu],[vr,[{[Et]:"UseFIPS"},Rr]],[Xe,[wt,"aws"]],[vr,[{fn:ES,argv:[{[Et]:"IsOAuthEndpoint"},SS]},Rr]],[vr,[{[Et]:"UseDualStack"},Rr]],[Xe,[wt,"aws-cn"]],[Xe,[FS,"us-gov-west-1"]],[Xe,[wt,"aws-us-gov"]],[vr,[{fn:Jc,argv:[AS,"supportsFIPS"]},Rr]],[Xe,[wt,"aws-iso"]],[Xe,[wt,"aws-iso-b"]],[Xe,[wt,"aws-iso-f"]],[Xe,[wt,"aws-iso-e"]],[Xe,[wt,"aws-eusc"]],[vr,[{fn:Jc,argv:[AS,"supportsDualStack"]},Rr]]],results:[[St],["https://signin.{Region}.api.aws",ko],["https://signin.{Region}.api.amazonwebservices.com.cn",ko],[bS,ko],[St,"FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation."],["https://{Region}.oauth.signin.aws",ko],["https://{Region}.signin.aws.amazon.com",ce],["https://{Region}.signin.amazonaws.cn",ce],["https://{Region}.signin.amazonaws-us-gov.com",ce],["https://{Region}.signin.c2shome.ic.gov",ce],["https://{Region}.signin.sc2shome.sgov.gov",ce],["https://{Region}.signin.csphome.hci.ic.gov",ce],["https://{Region}.signin.csphome.adc-e.uk",ce],["https://{Region}.signin.amazonaws-eusc.eu",ce],["https://signin-fips.amazonaws-us-gov.com",ce],["https://{Region}.signin-fips.amazonaws-us-gov.com",ce],["https://{Region}.signin.{PartitionResult#dnsSuffix}",ce],[St,"Invalid Configuration: FIPS and custom endpoint are not supported"],[St,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[_S,ce],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",ce],[St,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",ce],[St,"FIPS is enabled but this partition does not support FIPS"],[bS,ce],[St,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",ce],[St,"Invalid Configuration: Missing Region"]]},oV=2,O=1e8,iV=new Int32Array([-1,1,-1,0,6,3,2,36,4,4,5,O+27,6,O+4,O+27,1,29,7,2,36,8,3,9,31,4,22,10,5,19,11,7,21,12,8,O+7,13,10,O+8,14,12,O+9,15,13,O+10,16,14,O+11,17,15,O+12,18,16,O+13,O+16,6,O+5,20,7,21,O+6,17,O+24,O+25,6,O+4,23,7,27,24,9,O+14,25,10,O+15,26,11,O+22,O+23,11,28,O+21,17,O+20,O+21,2,35,30,3,39,31,4,32,O+27,6,O+4,33,7,O+27,34,9,O+14,O+27,3,39,36,4,38,37,7,O+18,O+19,6,O+4,O+17,5,O+1,40,8,O+2,O+3]),aV=_6.from(iV,oV,TS.conditions,TS.results),cV=new A6({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),uV=(t,r={})=>cV.get(t,()=>x6(aV,{endpointParams:t,logger:r.logger}));T6.aws=Vq;class _t extends a6{constructor(t){super(t);Object.setPrototypeOf(this,_t.prototype)}}class Do extends _t{name="AccessDeniedException";$fault="client";error;constructor(t){super({name:"AccessDeniedException",$fault:"client",...t});Object.setPrototypeOf(this,Do.prototype),this.error=t.error}}class Fo extends _t{name="InternalServerException";$fault="server";error;constructor(t){super({name:"InternalServerException",$fault:"server",...t});Object.setPrototypeOf(this,Fo.prototype),this.error=t.error}}class Lo extends _t{name="TooManyRequestsError";$fault="client";error;constructor(t){super({name:"TooManyRequestsError",$fault:"client",...t});Object.setPrototypeOf(this,Lo.prototype),this.error=t.error}}class Uo extends _t{name="ValidationException";$fault="client";error;constructor(t){super({name:"ValidationException",$fault:"client",...t});Object.setPrototypeOf(this,Uo.prototype),this.error=t.error}}var dV="AccessDeniedException",lV="AccessToken",fV="CreateOAuth2Token",hV="CreateOAuth2TokenRequest",pV="CreateOAuth2TokenRequestBody",gV="CreateOAuth2TokenResponseBody",mV="CreateOAuth2TokenResponse",yV="CreateOAuth2TokenWithIAM",SV="CreateOAuth2TokenWithIAMRequest",wV="CreateOAuth2TokenWithIAMResponse",EV="InternalServerException",bV="OAuthAccessToken",_V="RefreshToken",AV="TooManyRequestsError",xV="ValidationException",CS="accessKeyId",Zc="accessToken",TV="access_token",su="client",IS="clientId",RS="codeVerifier",CV="code",bt="error",eu="expiresIn",IV="expires_in",tu="grantType",RV="grant_type",LS="http",ou="httpError",vS="idToken",oe="jsonName",$o="message",vV="resource",Mo="refreshToken",NS="redirectUri",US="smithy.ts.sdk.synthetic.com.amazonaws.signin",OS="secretAccessKey",PS="sessionToken",NV="server",OV="tokenInput",PV="tokenOutput",ru="tokenType",kV="token_type",ue="com.amazonaws.signin",$S=new DS(US),BS=[-3,US,"SigninServiceException",0,[],[]];$S.registerError(BS,_t);var Rn=new DS(ue),HS=[-3,ue,dV,{[bt]:su},[bt,$o],[0,0],2];Rn.registerError(HS,Do);var zS=[-3,ue,EV,{[bt]:NV,[ou]:500},[bt,$o],[0,0],2];Rn.registerError(zS,Fo);var qS=[-3,ue,AV,{[bt]:su,[ou]:429},[bt,$o],[0,0],2];Rn.registerError(qS,Lo);var VS=[-3,ue,xV,{[bt]:su,[ou]:400},[bt,$o],[0,0],2];Rn.registerError(VS,Uo);var jS=[$S,Rn],MV=[0,ue,bV,8,0],WS=[0,ue,_V,8,0],GS=[3,ue,lV,8,[CS,OS,PS],[[0,{[oe]:CS}],[0,{[oe]:OS}],[0,{[oe]:PS}]],3],KS=[3,ue,hV,0,[OV],[[()=>QS,16]],1],QS=[3,ue,pV,0,[IS,tu,CV,NS,RS,Mo],[[0,{[oe]:IS}],[0,{[oe]:tu}],0,[0,{[oe]:NS}],[0,{[oe]:RS}],[()=>WS,{[oe]:Mo}]],2],XS=[3,ue,mV,0,[PV],[[()=>YS,16]],1],YS=[3,ue,gV,0,[Zc,ru,eu,Mo,vS],[[()=>GS,{[oe]:Zc}],[0,{[oe]:ru}],[1,{[oe]:eu}],[()=>WS,{[oe]:Mo}],[0,{[oe]:vS}]],4],JS=[3,ue,SV,0,[tu,vV],[[0,{[oe]:RV}],0],2],ZS=[3,ue,wV,0,[Zc,ru,eu],[[()=>MV,{[oe]:TV}],[0,{[oe]:kV}],[1,{[oe]:IV}]],3],ew=[9,ue,fV,{[LS]:["POST","/v1/token",200]},()=>KS,()=>XS],tw=[9,ue,yV,{[LS]:["POST","/v1/token?x-amz-client-auth-method=iam",200]},()=>JS,()=>ZS],DV=(t)=>({apiVersion:"2023-01-01",base64Decoder:t?.base64Decoder??V6,base64Encoder:t?.base64Encoder??q6,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??uV,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??Z6,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new $6},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new r6}],logger:t?.logger??new c6,protocol:t?.protocol??K6,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:jS,version:"2023-01-01",serviceTarget:"Signin"},serviceId:t?.serviceId??"Signin",sha256:t?.sha256??Q6,urlParser:t?.urlParser??R6,utf8Decoder:t?.utf8Decoder??z6,utf8Encoder:t?.utf8Encoder??H6}),FV=(t)=>{u6(process.version);let r=m6(t),n=()=>r().then(d6),s=DV(t);jq(process.version);let o={profile:t?.profile,logger:s.logger};return{...s,...t,runtime:"node",defaultsMode:r,authSchemePreference:t?.authSchemePreference??Kt(B6,o),bodyLengthChecker:t?.bodyLengthChecker??j6,defaultUserAgentProvider:t?.defaultUserAgentProvider??Wq({serviceId:s.serviceId,clientVersion:sV.version}),maxAttempts:t?.maxAttempts??Kt(M6,t),region:t?.region??Kt(w6,{...E6,...o}),requestHandler:G6.create(t?.requestHandler??n),retryMode:t?.retryMode??Kt({...k6,default:async()=>(await n()).retryMode||P6},t),streamCollector:t?.streamCollector??W6,useDualstackEndpoint:t?.useDualstackEndpoint??Kt(S6,o),useFipsEndpoint:t?.useFipsEndpoint??Kt(y6,o),userAgentAppId:t?.userAgentAppId??Kt(Gq,o)}},LV=(t)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:n,credentials:s}=t;return{setHttpAuthScheme(o){let i=r.findIndex((u)=>u.schemeId===o.schemeId);if(i===-1)r.push(o);else r.splice(i,1,o)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(o){n=o},httpAuthSchemeProvider(){return n},setCredentials(o){s=o},credentials(){return s}}},UV=(t)=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),$V=(t,r)=>{let n=Object.assign(Kq(t),l6(t),v6(t),LV(t));return r.forEach((s)=>s.configure(n)),Object.assign(t,Qq(n),f6(n),N6(n),UV(n))};class iu extends MS{config;constructor(...[t]){let r=FV(t||{});super(r);this.initConfig=r;let n=tV(r),s=Xq(n),o=D6(s),i=b6(o),u=Yq(i),a=C6(u),d=eV(a),l=$V(d,t?.extensions||[]);this.config=l,this.middlewareStack.use(L6(this.config)),this.middlewareStack.use(Jq(this.config)),this.middlewareStack.use(F6(this.config)),this.middlewareStack.use(O6(this.config)),this.middlewareStack.use(Zq(this.config)),this.middlewareStack.use(e6(this.config)),this.middlewareStack.use(t6(this.config)),this.middlewareStack.use(n6(this.config,{httpAuthSchemeParametersProvider:X6,identityProviderConfigProvider:async(h)=>new s6({"aws.auth#sigv4":h.credentials})})),this.middlewareStack.use(o6(this.config))}destroy(){super.destroy()}}var rw=h6(rV,"Signin","SigninClient",I6),BV={IsControlPlane:{type:"staticContextParams",value:!1}},HV={IsOAuthEndpoint:{type:"staticContextParams",value:!0}},nw=(t,r,n,s)=>[];class au extends rw(BV,nw,"CreateOAuth2Token",ew){}class cu extends rw(HV,nw,"CreateOAuth2TokenWithIAM",tw){}var zV={CreateOAuth2TokenCommand:au,CreateOAuth2TokenWithIAMCommand:cu};class uu extends iu{}p6(zV,uu);var qV={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",CONFLICT:"CONFLICT",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",RESOURCE_NOT_FOUND:"RESOURCE_NOT_FOUND",SERVER_ERROR:"server_error",SERVICE_QUOTA_EXCEEDED:"SERVICE_QUOTA_EXCEEDED",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};VV.AccessDeniedException=Do;VV.AccessDeniedException$=HS;VV.AccessToken$=GS;VV.CreateOAuth2Token$=ew;VV.CreateOAuth2TokenCommand=au;VV.CreateOAuth2TokenRequest$=KS;VV.CreateOAuth2TokenRequestBody$=QS;VV.CreateOAuth2TokenResponse$=XS;VV.CreateOAuth2TokenResponseBody$=YS;VV.CreateOAuth2TokenWithIAM$=tw;VV.CreateOAuth2TokenWithIAMCommand=cu;VV.CreateOAuth2TokenWithIAMRequest$=JS;VV.CreateOAuth2TokenWithIAMResponse$=ZS;VV.InternalServerException=Fo;VV.InternalServerException$=zS;VV.OAuth2ErrorCode=qV;VV.Signin=uu;VV.SigninClient=iu;VV.SigninServiceException=_t;VV.SigninServiceException$=BS;VV.TooManyRequestsError=Lo;VV.TooManyRequestsError$=qS;VV.ValidationException=Uo;VV.ValidationException$=VS;VV.errorTypeRegistries=jS});var iw=e(function(vj){var{setCredentialFeature:Sj}=pe(),{CredentialsProviderError:At,parseKnownFiles:wj,getProfileName:Ej}=W(),{HttpRequest:bj}=K(),{createHash:_j,createPrivateKey:Aj,createPublicKey:xj,sign:Tj}=c("node:crypto"),{promises:du}=c("node:fs"),{homedir:Cj}=c("node:os"),{dirname:Ij,join:ow}=c("node:path");class Bo{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=300000;constructor(t,r,n){this.profileData=t,this.init=r,this.callerClientConfig=n}async loadCredentials(){let t=await this.loadToken();if(!t)throw new At(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});let r=t.accessToken,n=Date.now();if(new Date(r.expiresAt).getTime()-n<=Bo.REFRESH_THRESHOLD)return this.refresh(t);return this.toCredentials(t.accessToken)}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}toCredentials(t){return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,sessionToken:t.sessionToken,accountId:t.accountId,expiration:new Date(t.expiresAt)}}async refresh(t){let r=await this.loadToken().catch(()=>t),n=Date.now(),s=new Date(r.accessToken.expiresAt).getTime(),o=new Date(t.accessToken.expiresAt).getTime(),i=s<=n&&o>n?t:r;if(new Date(i.accessToken.expiresAt).getTime()-Date.now()>Bo.REFRESH_THRESHOLD)return this.toCredentials(i.accessToken);let{SigninClient:a,CreateOAuth2TokenCommand:d}=sw(),{logger:l,userAgentAppId:h}=this.callerClientConfig??{},p=((S)=>S?.metadata?.handlerProtocol==="h2")(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,g=this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,m=new a({credentials:{accessKeyId:"",secretAccessKey:""},region:g,requestHandler:p,logger:l,userAgentAppId:h,...this.init?.clientConfig});this.createDPoPInterceptor(m.middlewareStack);let y={tokenInput:{clientId:i.clientId,refreshToken:i.refreshToken,grantType:"refresh_token"}};try{let S=await m.send(new d(y)),{accessKeyId:w,secretAccessKey:E,sessionToken:A}=S.tokenOutput?.accessToken??{},{refreshToken:v,expiresIn:L}=S.tokenOutput??{};if(!w||!E||!A||!v)throw new At("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});let k=(L??900)*1000,U=new Date(Date.now()+k),de={...i,accessToken:{...i.accessToken,accessKeyId:w,secretAccessKey:E,sessionToken:A,expiresAt:U.toISOString()},refreshToken:v};return await this.saveToken(de),this.toCredentials(de.accessToken)}catch(S){if(S.name==="AccessDeniedException"){let E=S.error,A;switch(E){case"TOKEN_EXPIRED":A="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":A="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":A="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:A=`Failed to refresh token: ${String(S)}. Please re-authenticate using \`aws login\``}throw new At(A,{logger:this.logger,tryNextLink:!1})}if(new Date(i.accessToken.expiresAt).getTime()>Date.now())return this.logger?.warn?.(`Failed to refresh token: ${String(S)}. Using existing token until expiry.`),this.toCredentials(i.accessToken);throw new At(`Failed to refresh token: ${String(S)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let t=this.getTokenFilePath();try{let r=await du.readFile(t,"utf8"),n=JSON.parse(r),s=["accessToken","clientId","refreshToken","dpopKey"].filter((o)=>!n[o]);if(!n.accessToken?.accountId)s.push("accountId");if(s.length>0)throw new At(`Token validation failed, missing fields: ${s.join(", ")}`,{logger:this.logger,tryNextLink:!1});return n}catch(r){throw new At(`Failed to load token from ${t}: ${String(r)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(t){let r=this.getTokenFilePath(),n=Ij(r);try{await du.mkdir(n,{recursive:!0})}catch(s){}await du.writeFile(r,JSON.stringify(t,null,2),"utf8")}getTokenFilePath(){let t=process.env.AWS_LOGIN_CACHE_DIRECTORY??ow(Cj(),".aws","login","cache"),r=Buffer.from(this.loginSession,"utf8"),n=_j("sha256").update(r).digest("hex");return ow(t,`${n}.json`)}derToRawSignature(t){let r=2;if(t[r]!==2)throw Error("Invalid DER signature");r++;let n=t[r++],s=t.subarray(r,r+n);if(r+=n,t[r]!==2)throw Error("Invalid DER signature");r++;let o=t[r++],i=t.subarray(r,r+o);s=s[0]===0?s.subarray(1):s,i=i[0]===0?i.subarray(1):i;let u=Buffer.concat([Buffer.alloc(32-s.length),s]),a=Buffer.concat([Buffer.alloc(32-i.length),i]);return Buffer.concat([u,a])}createDPoPInterceptor(t){t.add((r)=>async(n)=>{if(bj.isInstance(n.request)){let s=n.request,o=`${s.protocol}//${s.hostname}${s.port?`:${s.port}`:""}${s.path}`,i=await this.generateDpop(s.method,o);s.headers={...s.headers,DPoP:i}}return r(n)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(t="POST",r){let n=await this.loadToken();try{let s=Aj({key:n.dpopKey,format:"pem",type:"sec1"}),i=xj(s).export({format:"der",type:"spki"}),u=-1;for(let w=0;w<i.length;w++)if(i[w]===4){u=w;break}let a=i.slice(u+1,u+33),d=i.slice(u+33,u+65),l={alg:"ES256",typ:"dpop+jwt",jwk:{kty:"EC",crv:"P-256",x:a.toString("base64url"),y:d.toString("base64url")}},h={jti:crypto.randomUUID(),htm:t,htu:r,iat:Math.floor(Date.now()/1000)},f=Buffer.from(JSON.stringify(l)).toString("base64url"),p=Buffer.from(JSON.stringify(h)).toString("base64url"),g=`${f}.${p}`,m=Tj("sha256",Buffer.from(g),s),S=this.derToRawSignature(m).toString("base64url");return`${g}.${S}`}catch(s){throw new At(`Failed to generate Dpop proof: ${s instanceof Error?s.message:String(s)}`,{logger:this.logger,tryNextLink:!1})}}}var Rj=(t)=>async({callerClientConfig:r}={})=>{t?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");let n=await wj(t||{}),s=Ej({profile:t?.profile??r?.profile}),o=n[s];if(!o?.login_session)throw new At(`Profile ${s} does not contain login_session.`,{tryNextLink:!0,logger:t?.logger});let u=await new Bo(o,t,r).loadCredentials();return Sj(u,"CREDENTIALS_LOGIN","AD")};vj.fromLoginCredentials=Rj});var fu=e(function(Bj){var{externalDataInterceptor:Oj,CredentialsProviderError:lu,parseKnownFiles:Pj,getProfileName:kj}=W(),{exec:Mj}=c("node:child_process"),{promisify:Dj}=c("node:util"),{setCredentialFeature:Fj}=pe(),Lj=(t,r,n)=>{if(r.Version!==1)throw Error(`Profile ${t} credential_process did not return Version 1.`);if(r.AccessKeyId===void 0||r.SecretAccessKey===void 0)throw Error(`Profile ${t} credential_process returned invalid credentials.`);if(r.Expiration){let i=new Date;if(new Date(r.Expiration)<i)throw Error(`Profile ${t} credential_process returned expired credentials.`)}let s=r.AccountId;if(!s&&n?.[t]?.aws_account_id)s=n[t].aws_account_id;let o={accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretAccessKey,...r.SessionToken&&{sessionToken:r.SessionToken},...r.Expiration&&{expiration:new Date(r.Expiration)},...r.CredentialScope&&{credentialScope:r.CredentialScope},...s&&{accountId:s}};return Fj(o,"CREDENTIALS_PROCESS","w"),o},Uj=async(t,r,n)=>{let s=r[t];if(r[t]){let o=s.credential_process;if(o!==void 0){let i=Dj(Oj?.getTokenRecord?.().exec??Mj);try{let{stdout:u}=await i(o),a;try{a=JSON.parse(u.trim())}catch{throw Error(`Profile ${t} credential_process returned invalid JSON.`)}return Lj(t,a,r)}catch(u){throw new lu(u.message,{logger:n})}}else throw new lu(`Profile ${t} did not contain credential_process.`,{logger:n})}else throw new lu(`Profile ${t} could not be found in shared credentials file.`,{logger:n})},$j=(t={})=>async({callerClientConfig:r}={})=>{t.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");let n=await Pj(t);return Uj(kj({profile:t.profile??r?.profile}),n,t.logger)};Bj.fromProcess=$j});var hu=e(function(Gj){var{setCredentialFeature:zj}=pe(),{CredentialsProviderError:qj,externalDataInterceptor:Vj}=W(),{readFileSync:jj}=c("node:fs"),aw=(t)=>async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:n,roleSessionName:s,webIdentityToken:o,providerId:i,policyArns:u,policy:a,durationSeconds:d}=t,{roleAssumerWithWebIdentity:l}=t;if(!l){let{getDefaultRoleAssumerWithWebIdentity:h}=Yc();l=h({...t.clientConfig,credentialProviderLogger:t.logger,parentClientConfig:{...r?.callerClientConfig,...t.parentClientConfig}},t.clientPlugins)}return l({RoleArn:n,RoleSessionName:s??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:o,ProviderId:i,PolicyArns:u,Policy:a,DurationSeconds:d})},Wj=(t={})=>async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let n=t?.webIdentityTokenFile??process.env.AWS_WEB_IDENTITY_TOKEN_FILE,s=t?.roleArn??process.env.AWS_ROLE_ARN,o=t?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!n||!s)throw new qj("Web identity configuration not specified",{logger:t.logger});let i=await aw({...t,webIdentityToken:Vj?.getTokenRecord?.()[n]??jj(n,{encoding:"ascii"}),roleArn:s,roleSessionName:o})(r);if(n===process.env.AWS_WEB_IDENTITY_TOKEN_FILE)zj(i,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return i};Gj.fromTokenFile=Wj;Gj.fromWebToken=aw});var hw=e(function(f8){var{CredentialsProviderError:Ho,chain:Xj,getProfileName:lw,parseKnownFiles:Yj}=W(),{setCredentialFeature:Je}=pe(),Jj=(t,r,n)=>{let s={EcsContainer:async(o)=>{let{fromHttp:i}=Ba(),{fromContainerMetadata:u}=Ts();return n?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>Xj(i(o??{}),u(o))().then(pu)},Ec2InstanceMetadata:async(o)=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");let{fromInstanceMetadata:i}=Ts();return async()=>i(o)().then(pu)},Environment:async(o)=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");let{fromEnv:i}=Oa();return async()=>i(o)().then(pu)}};if(t in s)return s[t];else throw new Ho(`Unsupported credential source in profile ${r}. Got ${t}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:n})},pu=(t)=>Je(t,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p"),Zj=(t,{profile:r="default",logger:n}={})=>Boolean(t)&&typeof t==="object"&&typeof t.role_arn==="string"&&["undefined","string"].indexOf(typeof t.role_session_name)>-1&&["undefined","string"].indexOf(typeof t.external_id)>-1&&["undefined","string"].indexOf(typeof t.mfa_serial)>-1&&(e8(t,{profile:r,logger:n})||t8(t,{profile:r,logger:n})),e8=(t,{profile:r,logger:n})=>{let s=typeof t.source_profile==="string"&&typeof t.credential_source>"u";if(s)n?.debug?.(` ${r} isAssumeRoleWithSourceProfile source_profile=${t.source_profile}`);return s},t8=(t,{profile:r,logger:n})=>{let s=typeof t.credential_source==="string"&&typeof t.source_profile>"u";if(s)n?.debug?.(` ${r} isCredentialSourceProfile credential_source=${t.credential_source}`);return s},r8=async(t,r,n,s,o={},i)=>{n.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");let u=r[t],{source_profile:a,region:d}=u;if(!n.roleAssumer){let{getDefaultRoleAssumer:h}=Yc();n.roleAssumer=h({...n.clientConfig,credentialProviderLogger:n.logger,parentClientConfig:{...s,...n?.parentClientConfig,region:d??n?.parentClientConfig?.region??s?.region}},n.clientPlugins)}if(a&&a in o)throw new Ho(`Detected a cycle attempting to resolve credentials for profile ${lw(n)}. Profiles visited: `+Object.keys(o).join(", "),{logger:n.logger});n.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${a?`source_profile=[${a}]`:`profile=[${t}]`}`);let l=a?i(a,r,n,s,{...o,[a]:!0},cw(r[a]??{})):(await Jj(u.credential_source,t,n.logger)(n))();if(cw(u))return l.then((h)=>Je(h,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));else{let h={RoleArn:u.role_arn,RoleSessionName:u.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:u.external_id,DurationSeconds:parseInt(u.duration_seconds||"3600",10)},{mfa_serial:f}=u;if(f){if(!n.mfaCodeProvider)throw new Ho(`Profile ${t} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:n.logger,tryNextLink:!1});h.SerialNumber=f,h.TokenCode=await n.mfaCodeProvider(f)}let p=await l;return n.roleAssumer(p,h).then((g)=>Je(g,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},cw=(t)=>!t.role_arn&&!!t.credential_source,n8=(t)=>Boolean(t&&t.login_session),s8=async(t,r,n)=>{let{fromLoginCredentials:s}=iw(),o=await s({...r,profile:t})({callerClientConfig:n});return Je(o,"CREDENTIALS_PROFILE_LOGIN","AC")},o8=(t)=>Boolean(t)&&typeof t==="object"&&typeof t.credential_process==="string",i8=async(t,r)=>{let{fromProcess:n}=fu(),s=await n({...t,profile:r})();return Je(s,"CREDENTIALS_PROFILE_PROCESS","v")},a8=async(t,r,n={},s)=>{let{fromSSO:o}=$c();return o({profile:t,logger:n.logger,parentClientConfig:n.parentClientConfig,clientConfig:n.clientConfig})({callerClientConfig:s}).then((i)=>{if(r.sso_session)return Je(i,"CREDENTIALS_PROFILE_SSO","r");else return Je(i,"CREDENTIALS_PROFILE_SSO_LEGACY","t")})},c8=(t)=>t&&(typeof t.sso_start_url==="string"||typeof t.sso_account_id==="string"||typeof t.sso_session==="string"||typeof t.sso_region==="string"||typeof t.sso_role_name==="string"),uw=(t)=>Boolean(t)&&typeof t==="object"&&typeof t.aws_access_key_id==="string"&&typeof t.aws_secret_access_key==="string"&&["undefined","string"].indexOf(typeof t.aws_session_token)>-1&&["undefined","string"].indexOf(typeof t.aws_account_id)>-1,dw=async(t,r)=>{r?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");let n={accessKeyId:t.aws_access_key_id,secretAccessKey:t.aws_secret_access_key,sessionToken:t.aws_session_token,...t.aws_credential_scope&&{credentialScope:t.aws_credential_scope},...t.aws_account_id&&{accountId:t.aws_account_id}};return Je(n,"CREDENTIALS_PROFILE","n")},u8=(t)=>Boolean(t)&&typeof t==="object"&&typeof t.web_identity_token_file==="string"&&typeof t.role_arn==="string"&&["undefined","string"].indexOf(typeof t.role_session_name)>-1,d8=async(t,r,n)=>{let{fromTokenFile:s}=hu(),o=await s({webIdentityTokenFile:t.web_identity_token_file,roleArn:t.role_arn,roleSessionName:t.role_session_name,roleAssumerWithWebIdentity:r.roleAssumerWithWebIdentity,logger:r.logger,parentClientConfig:r.parentClientConfig})({callerClientConfig:n});return Je(o,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q")},fw=async(t,r,n,s,o={},i=!1)=>{let u=r[t];if(Object.keys(o).length>0&&uw(u))return dw(u,n);if(i||Zj(u,{profile:t,logger:n.logger}))return r8(t,r,n,s,o,fw);if(uw(u))return dw(u,n);if(u8(u))return d8(u,n,s);if(o8(u))return i8(n,t);if(c8(u))return await a8(t,u,n,s);if(n8(u))return s8(t,n,s);throw new Ho(`Could not resolve credentials using profile: [${t}] in configuration/credentials file(s).`,{logger:n.logger})},l8=(t={})=>async({callerClientConfig:r}={})=>{t.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");let n=await Yj(t);return fw(lw({profile:t.profile??r?.profile}),n,t,r)};f8.fromIni=l8});var $A=e(function(x8){var{ENV_KEY:p8,ENV_SECRET:g8,fromEnv:m8}=Oa(),{chain:y8,CredentialsProviderError:zo,ENV_PROFILE:S8}=W(),w8=async(t)=>{let{ENV_CMDS_FULL_URI:r,ENV_CMDS_RELATIVE_URI:n,fromContainerMetadata:s,fromInstanceMetadata:o}=Ts();if(process.env[n]||process.env[r]){t.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:i}=Ba();return y8(i(t),s(t))}if(process.env.AWS_EC2_METADATA_DISABLED&&process.env.AWS_EC2_METADATA_DISABLED!=="false")return async()=>{throw new zo("EC2 Instance Metadata Service access disabled",{logger:t.logger})};return t.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),o(t)};function E8(t,r){let n=b8(t),s,o,i,u,a=async(d)=>{if(d?.forceRefresh){if(!u)u=n(d).then((l)=>{i=l}).finally(()=>{u=void 0});return await u,i}if(i?.expiration){if(i?.expiration?.getTime()<Date.now())i=void 0}if(s)await s;else if(!i||r?.(i))if(i){if(!o)o=n(d).then((l)=>{i=l}).catch(()=>{}).finally(()=>{o=void 0})}else return s=n(d).then((l)=>{i=l}).finally(()=>{s=void 0}),a(d);return i};return a}var b8=(t)=>async(r)=>{let n;for(let s of t)try{return await s(r)}catch(o){if(n=o,o?.tryNextLink)continue;throw o}throw n},pw=!1,_8=(t={})=>E8([async()=>{if(t.profile??process.env[S8]){if(process.env[p8]&&process.env[g8]){if(!pw)(t.logger?.warn&&t.logger?.constructor?.name!=="NoOpLogger"?t.logger.warn.bind(t.logger):console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
52
+ Multiple credential sources detected:
53
+ Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
54
+ This SDK will proceed with the AWS_PROFILE value.
55
+
56
+ However, a future version may change this behavior to prefer the ENV static credentials.
57
+ Please ensure that your environment only sets either the AWS_PROFILE or the
58
+ AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
59
+ `),pw=!0}throw new zo("AWS_PROFILE is set, skipping fromEnv provider.",{logger:t.logger,tryNextLink:!0})}return t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),m8(t)()},async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:n,ssoAccountId:s,ssoRegion:o,ssoRoleName:i,ssoSession:u}=t;if(!n&&!s&&!o&&!i&&!u)throw new zo("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:t.logger});let{fromSSO:a}=$c();return a(t)(r)},async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:n}=hw();return n(t)(r)},async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:n}=fu();return n(t)(r)},async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:n}=hu();return n(t)(r)},async()=>(t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await w8(t))()),async()=>{throw new zo("Could not load credentials from any providers",{tryNextLink:!1,logger:t.logger})}],gw),A8=(t)=>t?.expiration!==void 0,gw=(t)=>t?.expiration!==void 0&&t.expiration.getTime()-Date.now()<300000;x8.credentialsTreatedAsExpired=gw;x8.credentialsWillNeedRefresh=A8;x8.defaultProvider=_8});var XA=e(function(D8){var{EventStreamCodec:R8}=yt(),{Transform:v8,Readable:N8,PassThrough:O8,pipeline:P8}=c("node:stream");class mw extends v8{priorSignature;messageSigner;eventStreamCodec;systemClockOffsetProvider;staticCredentials;constructor(t){super({autoDestroy:!0,readableObjectMode:!0,writableObjectMode:!0,...t});this.priorSignature=t.priorSignature,this.eventStreamCodec=t.eventStreamCodec,this.messageSigner=t.messageSigner,this.systemClockOffsetProvider=t.systemClockOffsetProvider,this.staticCredentials=t.credentials?.()}async _transform(t,r,n){try{let s=new Date(Date.now()+await this.systemClockOffsetProvider()),o={":date":{type:"timestamp",value:s}},i=await this.messageSigner.sign({message:{body:t,headers:o},priorSignature:this.priorSignature},{signingDate:s,eventStreamCredentials:await this.staticCredentials});this.priorSignature=i.signature;let u=this.eventStreamCodec.encode({headers:{...o,":chunk-signature":{type:"binary",value:k8(i.signature)}},body:t});return this.push(u),n()}catch(s){n(s)}}}function k8(t){let r=Buffer.from(t,"hex");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT)}class yw{messageSigner;eventStreamCodec;systemClockOffsetProvider;credentials;constructor(t){this.messageSigner=t.messageSigner,this.eventStreamCodec=new R8(t.utf8Encoder,t.utf8Decoder),this.systemClockOffsetProvider=async()=>t.systemClockOffset??0,this.credentials=t.credentials}async handle(t,r,n={}){let s=r.request,{body:o,query:i}=s;if(!(o instanceof N8))throw Error("Eventstream payload must be a Readable stream.");s.body=new O8({objectMode:!0});let a=s.headers?.authorization?.match(/Signature=([\w]+)$/)?.[1]??i?.["X-Amz-Signature"]??"";if(n.__staticSignature)a="";let d=new mw({priorSignature:a,eventStreamCodec:this.eventStreamCodec,messageSigner:await this.messageSigner(),systemClockOffsetProvider:this.systemClockOffsetProvider,credentials:this.credentials}),l,h=new Promise((p,g)=>{l=()=>p(void 0),P8(o,d,s.body,(m)=>{if(m)g(Error(`Pipeline error in @aws-sdk/eventstream-handler-node: ${m.message}`,{cause:m}))})}),f;try{f=await Promise.race([t(r),h])}catch(p){throw s.body.end(),p}finally{l()}return f}}var M8=(t)=>new yw(t);D8.eventStreamPayloadHandlerProvider=M8});
60
+ export{Re,Ie,W,Ye,ee,ct,yt,K,lt,et,pe,ZA,tt,It,Qt,Mn,$A,XA};
61
+
62
+ //# debugId=B31AAF40EA56B75064756E2164756E21
63
+ //# sourceMappingURL=index-ytxbw8py.js.map