dispach 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/README.md +29 -25
  2. package/dist/APEv2Parser-x13n424p.js +5 -0
  3. package/dist/{FlacParser-drm5wq0p.js.map → APEv2Parser-x13n424p.js.map} +1 -1
  4. package/dist/{AiffParser-9hj6fpmy.js → AiffParser-ns1y9f0g.js} +3 -3
  5. package/dist/{AiffParser-9hj6fpmy.js.map → AiffParser-ns1y9f0g.js.map} +1 -1
  6. package/dist/App-wkpkwgjt.js +11 -0
  7. package/dist/{App-2f72vhjv.js.map → App-wkpkwgjt.js.map} +1 -1
  8. package/dist/AsfParser-bae2a1yf.js +5 -0
  9. package/dist/{AsfParser-7emspn04.js.map → AsfParser-bae2a1yf.js.map} +1 -1
  10. package/dist/ConfigEditor-hy9jtas3.js +6 -0
  11. package/dist/{ConfigEditor-vk7vxaa6.js.map → ConfigEditor-hy9jtas3.js.map} +1 -1
  12. package/dist/DsdiffParser-s0zvxnfa.js +5 -0
  13. package/dist/{DsdiffParser-dz88pnnr.js.map → DsdiffParser-s0zvxnfa.js.map} +1 -1
  14. package/dist/{DsfParser-qgh63tbs.js → DsfParser-90mvzt4v.js} +3 -3
  15. package/dist/{DsfParser-qgh63tbs.js.map → DsfParser-90mvzt4v.js.map} +1 -1
  16. package/dist/FlacParser-8xprykrh.js +5 -0
  17. package/dist/{APEv2Parser-ysjr6adv.js.map → FlacParser-8xprykrh.js.map} +1 -1
  18. package/dist/{KeyProbe-5anphmb7.js → KeyProbe-fk5krzks.js} +3 -3
  19. package/dist/{KeyProbe-5anphmb7.js.map → KeyProbe-fk5krzks.js.map} +1 -1
  20. package/dist/MP4Parser-nmvbkq21.js +5 -0
  21. package/dist/{MP4Parser-yr7p3z12.js.map → MP4Parser-nmvbkq21.js.map} +2 -2
  22. package/dist/{MatroskaParser-jkbsbsk3.js → MatroskaParser-tsmz2qfq.js} +3 -3
  23. package/dist/{MatroskaParser-jkbsbsk3.js.map → MatroskaParser-tsmz2qfq.js.map} +1 -1
  24. package/dist/{MpegParser-t93vwnew.js → MpegParser-y5fjpaz9.js} +3 -3
  25. package/dist/{MpegParser-t93vwnew.js.map → MpegParser-y5fjpaz9.js.map} +1 -1
  26. package/dist/MusepackParser-544q0byg.js +5 -0
  27. package/dist/{MusepackParser-6e8kbh2d.js.map → MusepackParser-544q0byg.js.map} +2 -2
  28. package/dist/OggParser-v77rbjnt.js +5 -0
  29. package/dist/{OggParser-ggcypmag.js.map → OggParser-v77rbjnt.js.map} +1 -1
  30. package/dist/Picker-32m79nmp.js +5 -0
  31. package/dist/{Picker-j7txnm7w.js.map → Picker-32m79nmp.js.map} +1 -1
  32. package/dist/SessionPicker-9p06npt5.js +5 -0
  33. package/dist/{SessionPicker-hpv2ncsb.js.map → SessionPicker-9p06npt5.js.map} +1 -1
  34. package/dist/SkillBrowser-ezdx3xsh.js +5 -0
  35. package/dist/{SkillBrowser-qc542n71.js.map → SkillBrowser-ezdx3xsh.js.map} +1 -1
  36. package/dist/WavPackParser-k623m0hk.js +5 -0
  37. package/dist/{WavPackParser-jw9stzqp.js.map → WavPackParser-k623m0hk.js.map} +1 -1
  38. package/dist/WaveParser-nj4p1vx8.js +5 -0
  39. package/dist/{WaveParser-epmncs9w.js.map → WaveParser-nj4p1vx8.js.map} +1 -1
  40. package/dist/WizardApp-p350qspw.js +5 -0
  41. package/dist/{WizardApp-pgzcz9zq.js.map → WizardApp-p350qspw.js.map} +1 -1
  42. package/dist/channels-a9zx9yba.js +31 -0
  43. package/dist/{channels-m8nambmm.js.map → channels-a9zx9yba.js.map} +1 -1
  44. package/dist/config-3mz4zwsf.js +24 -0
  45. package/dist/{config-hmgrqgf2.js.map → config-3mz4zwsf.js.map} +2 -2
  46. package/dist/credential-ja7zmd4c.js +19 -0
  47. package/dist/{credential-nkb2ya59.js.map → credential-ja7zmd4c.js.map} +1 -1
  48. package/dist/index-039ew35r.js +6 -0
  49. package/dist/index-039ew35r.js.map +10 -0
  50. package/dist/index-0dvs3a06.js +6 -0
  51. package/dist/{index-jc4kmfwa.js.map → index-0dvs3a06.js.map} +1 -1
  52. package/dist/{index-pszmnhgq.js → index-1cagdzqe.js} +9 -9
  53. package/dist/{index-pszmnhgq.js.map → index-1cagdzqe.js.map} +1 -1
  54. package/dist/index-2fw9e5gg.js +6 -0
  55. package/dist/{index-0444sh6x.js.map → index-2fw9e5gg.js.map} +1 -1
  56. package/dist/{index-hgm2gchq.js → index-2td5h856.js} +12 -12
  57. package/dist/{index-hgm2gchq.js.map → index-2td5h856.js.map} +1 -1
  58. package/dist/{index-m6fqx0ch.js → index-446exxcb.js} +7 -7
  59. package/dist/{index-m6fqx0ch.js.map → index-446exxcb.js.map} +1 -1
  60. package/dist/{index-snz49ndn.js → index-4fajxhdv.js} +4 -4
  61. package/dist/{index-snz49ndn.js.map → index-4fajxhdv.js.map} +1 -1
  62. package/dist/index-4j65jp20.js +9 -0
  63. package/dist/{index-38gs9anh.js.map → index-4j65jp20.js.map} +1 -1
  64. package/dist/index-5gn74n56.js +10 -0
  65. package/dist/{index-22fzzn7z.js.map → index-5gn74n56.js.map} +2 -2
  66. package/dist/index-5zpfz4kb.js +9 -0
  67. package/dist/{index-eztfverw.js.map → index-5zpfz4kb.js.map} +1 -1
  68. package/dist/index-60h4knj6.js +126 -0
  69. package/dist/{index-ry6a4bqh.js.map → index-60h4knj6.js.map} +2 -2
  70. package/dist/index-635wcsh1.js +5 -0
  71. package/dist/{index-2bsardvh.js.map → index-635wcsh1.js.map} +1 -1
  72. package/dist/{index-k8e9f466.js → index-67sfck4d.js} +19 -19
  73. package/dist/index-67sfck4d.js.map +13 -0
  74. package/dist/index-7p8d1gf0.js +63 -0
  75. package/dist/{index-ytxbw8py.js.map → index-7p8d1gf0.js.map} +1 -1
  76. package/dist/index-7zgjkbb0.js +5 -0
  77. package/dist/{index-qgsdgbk8.js.map → index-7zgjkbb0.js.map} +1 -1
  78. package/dist/{index-zw6wyas6.js → index-86rb86nr.js} +4 -4
  79. package/dist/{index-zw6wyas6.js.map → index-86rb86nr.js.map} +1 -1
  80. package/dist/{index-fbsrhcga.js → index-8jejze0z.js} +4 -4
  81. package/dist/{index-fbsrhcga.js.map → index-8jejze0z.js.map} +1 -1
  82. package/dist/index-8k8y7edx.js +7 -0
  83. package/dist/{index-3826kf9t.js.map → index-8k8y7edx.js.map} +1 -1
  84. package/dist/index-8mkatm20.js +6 -0
  85. package/dist/{index-42e29zs4.js.map → index-8mkatm20.js.map} +1 -1
  86. package/dist/{index-3vzf253k.js → index-9k6qa50r.js} +7 -7
  87. package/dist/{index-3vzf253k.js.map → index-9k6qa50r.js.map} +1 -1
  88. package/dist/{index-yw3fby4n.js → index-a1axc952.js} +4 -4
  89. package/dist/{index-yw3fby4n.js.map → index-a1axc952.js.map} +1 -1
  90. package/dist/index-ayhdn87b.js +6 -0
  91. package/dist/{index-dzy19wtf.js.map → index-ayhdn87b.js.map} +1 -1
  92. package/dist/index-b8bfzbfe.js +6 -0
  93. package/dist/{index-836hc2h1.js.map → index-b8bfzbfe.js.map} +2 -2
  94. package/dist/index-brh25jhq.js +6 -0
  95. package/dist/{index-hrwakb11.js.map → index-brh25jhq.js.map} +2 -2
  96. package/dist/index-c6qrcweh.js +6 -0
  97. package/dist/{index-nxhqf597.js.map → index-c6qrcweh.js.map} +1 -1
  98. package/dist/index-cb45233h.js +6 -0
  99. package/dist/{index-nvc24414.js.map → index-cb45233h.js.map} +1 -1
  100. package/dist/{index-51x0n5z0.js → index-dcy14zdn.js} +5 -5
  101. package/dist/{index-51x0n5z0.js.map → index-dcy14zdn.js.map} +1 -1
  102. package/dist/index-f6r3h2yh.js +8 -0
  103. package/dist/{index-9t4dz145.js.map → index-f6r3h2yh.js.map} +1 -1
  104. package/dist/index-gezqawvw.js +11 -0
  105. package/dist/{index-sh44ymqz.js.map → index-gezqawvw.js.map} +1 -1
  106. package/dist/{index-1mbdz3f7.js → index-h787rq0h.js} +10 -10
  107. package/dist/{index-1mbdz3f7.js.map → index-h787rq0h.js.map} +1 -1
  108. package/dist/index-hd5nkwd7.js +74 -0
  109. package/dist/{index-djeqvfms.js.map → index-hd5nkwd7.js.map} +5 -5
  110. package/dist/index-k6wq0j4q.js +6 -0
  111. package/dist/{index-mjfv7k5w.js.map → index-k6wq0j4q.js.map} +1 -1
  112. package/dist/index-kz01jz58.js +6 -0
  113. package/dist/{index-323jvr1g.js.map → index-kz01jz58.js.map} +1 -1
  114. package/dist/{index-dv9pdjy4.js → index-mgef1n4e.js} +10 -10
  115. package/dist/{index-dv9pdjy4.js.map → index-mgef1n4e.js.map} +1 -1
  116. package/dist/{index-fxpmx6cr.js → index-n197qdw1.js} +191 -191
  117. package/dist/{index-fxpmx6cr.js.map → index-n197qdw1.js.map} +3 -3
  118. package/dist/index-nndwx2wp.js +153 -0
  119. package/dist/{index-dpcm1j62.js.map → index-nndwx2wp.js.map} +2 -2
  120. package/dist/index-pz92ksp8.js +5 -0
  121. package/dist/{index-3c5jt6by.js.map → index-pz92ksp8.js.map} +1 -1
  122. package/dist/index-qj4adnfe.js +14 -0
  123. package/dist/{index-y7dxq4a4.js.map → index-qj4adnfe.js.map} +2 -2
  124. package/dist/index-r83jpct7.js +6 -0
  125. package/dist/{index-xg7s813b.js.map → index-r83jpct7.js.map} +2 -2
  126. package/dist/{index-2zjh5zd5.js → index-rqfwd7j5.js} +4 -4
  127. package/dist/{index-2zjh5zd5.js.map → index-rqfwd7j5.js.map} +1 -1
  128. package/dist/index-s0f0s6n5.js +6 -0
  129. package/dist/{index-pqw1n1pv.js.map → index-s0f0s6n5.js.map} +1 -1
  130. package/dist/index-s0t15ndj.js +6 -0
  131. package/dist/{index-8edck2pr.js.map → index-s0t15ndj.js.map} +1 -1
  132. package/dist/index-tc054tcb.js +6 -0
  133. package/dist/{index-8tmv33mr.js.map → index-tc054tcb.js.map} +1 -1
  134. package/dist/{index-095hrkyr.js → index-ts8a1sdn.js} +6 -6
  135. package/dist/{index-095hrkyr.js.map → index-ts8a1sdn.js.map} +1 -1
  136. package/dist/index-tv52jhac.js +1252 -0
  137. package/dist/{index-hpvfqq6r.js.map → index-tv52jhac.js.map} +3 -3
  138. package/dist/index-x9nn57kk.js +6 -0
  139. package/dist/{index-1x8mzvz7.js.map → index-x9nn57kk.js.map} +1 -1
  140. package/dist/{index-308y9xt0.js → index-xyh98x7p.js} +4 -4
  141. package/dist/{index-308y9xt0.js.map → index-xyh98x7p.js.map} +1 -1
  142. package/dist/{index-jff5q27j.js → index-yy4v9kca.js} +4 -4
  143. package/dist/{index-jff5q27j.js.map → index-yy4v9kca.js.map} +1 -1
  144. package/dist/{index-bqdkm3de.js → index-yz0fcxky.js} +4 -4
  145. package/dist/{index-bqdkm3de.js.map → index-yz0fcxky.js.map} +1 -1
  146. package/dist/{index-p6ya59m6.js → index-z4adxmzm.js} +5 -5
  147. package/dist/{index-p6ya59m6.js.map → index-z4adxmzm.js.map} +1 -1
  148. package/dist/{index-4fj1k64j.js → index-zzpgsbn3.js} +4 -4
  149. package/dist/{index-4fj1k64j.js.map → index-zzpgsbn3.js.map} +1 -1
  150. package/dist/index.js +345 -345
  151. package/dist/index.js.map +4 -4
  152. package/dist/web-7mdrcb8a.js +14 -0
  153. package/dist/{web-gfv0mzgs.js.map → web-7mdrcb8a.js.map} +1 -1
  154. package/dist/wrapper-4hdmdwft.js +5 -0
  155. package/dist/{wrapper-f662ny3r.js.map → wrapper-4hdmdwft.js.map} +1 -1
  156. package/package.json +1 -1
  157. package/dist/APEv2Parser-ysjr6adv.js +0 -5
  158. package/dist/App-2f72vhjv.js +0 -11
  159. package/dist/AsfParser-7emspn04.js +0 -5
  160. package/dist/ConfigEditor-vk7vxaa6.js +0 -6
  161. package/dist/DsdiffParser-dz88pnnr.js +0 -5
  162. package/dist/FlacParser-drm5wq0p.js +0 -5
  163. package/dist/MP4Parser-yr7p3z12.js +0 -5
  164. package/dist/MusepackParser-6e8kbh2d.js +0 -5
  165. package/dist/OggParser-ggcypmag.js +0 -5
  166. package/dist/Picker-j7txnm7w.js +0 -5
  167. package/dist/SessionPicker-hpv2ncsb.js +0 -5
  168. package/dist/SkillBrowser-qc542n71.js +0 -5
  169. package/dist/WavPackParser-jw9stzqp.js +0 -5
  170. package/dist/WaveParser-epmncs9w.js +0 -5
  171. package/dist/WizardApp-pgzcz9zq.js +0 -5
  172. package/dist/channels-m8nambmm.js +0 -31
  173. package/dist/config-hmgrqgf2.js +0 -24
  174. package/dist/credential-nkb2ya59.js +0 -19
  175. package/dist/index-0444sh6x.js +0 -6
  176. package/dist/index-1x8mzvz7.js +0 -6
  177. package/dist/index-22fzzn7z.js +0 -10
  178. package/dist/index-2bsardvh.js +0 -5
  179. package/dist/index-323jvr1g.js +0 -6
  180. package/dist/index-3826kf9t.js +0 -7
  181. package/dist/index-38gs9anh.js +0 -9
  182. package/dist/index-3c5jt6by.js +0 -5
  183. package/dist/index-42e29zs4.js +0 -6
  184. package/dist/index-836hc2h1.js +0 -6
  185. package/dist/index-8edck2pr.js +0 -6
  186. package/dist/index-8tmv33mr.js +0 -6
  187. package/dist/index-9t4dz145.js +0 -8
  188. package/dist/index-djeqvfms.js +0 -74
  189. package/dist/index-dpcm1j62.js +0 -153
  190. package/dist/index-dzy19wtf.js +0 -6
  191. package/dist/index-eztfverw.js +0 -9
  192. package/dist/index-hpvfqq6r.js +0 -1252
  193. package/dist/index-hrwakb11.js +0 -6
  194. package/dist/index-jc4kmfwa.js +0 -6
  195. package/dist/index-k8e9f466.js.map +0 -13
  196. package/dist/index-mjfv7k5w.js +0 -6
  197. package/dist/index-nvc24414.js +0 -6
  198. package/dist/index-nxhqf597.js +0 -6
  199. package/dist/index-pqw1n1pv.js +0 -6
  200. package/dist/index-qgsdgbk8.js +0 -5
  201. package/dist/index-qv6ktepc.js +0 -6
  202. package/dist/index-qv6ktepc.js.map +0 -10
  203. package/dist/index-ry6a4bqh.js +0 -126
  204. package/dist/index-sh44ymqz.js +0 -11
  205. package/dist/index-xg7s813b.js +0 -6
  206. package/dist/index-y7dxq4a4.js +0 -14
  207. package/dist/index-ytxbw8py.js +0 -63
  208. package/dist/web-gfv0mzgs.js +0 -14
  209. package/dist/wrapper-f662ny3r.js +0 -5
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+ import{e,I}from"./index-kz01jz58.js";var Tt=e(function(Tw){var Vo;(function(t){t.HEADER="header",t.QUERY="query"})(Vo||(Vo={}));var jo;(function(t){t.HEADER="header",t.QUERY="query"})(jo||(jo={}));var Wo;(function(t){t.HTTP="http",t.HTTPS="https"})(Wo||(Wo={}));var Nr;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(Nr||(Nr={}));var Ew=(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}}},bw=(t)=>{let r={};return t.checksumAlgorithms().forEach((n)=>{r[n.algorithmId()]=n.checksumConstructor()}),r},_w=(t)=>Ew(t),Aw=(t)=>bw(t),Go;(function(t){t[t.HEADER=0]="HEADER",t[t.TRAILER=1]="TRAILER"})(Go||(Go={}));var xw="__smithy_context",Ko;(function(t){t.PROFILE="profile",t.SSO_SESSION="sso-session",t.SERVICES="services"})(Ko||(Ko={}));var Qo;(function(t){t.HTTP_0_9="http/0.9",t.HTTP_1_0="http/1.0",t.TDS_8_0="tds/8.0"})(Qo||(Qo={}));Tw.AlgorithmId=Nr;Tw.EndpointURLScheme=Wo;Tw.FieldPosition=Go;Tw.HttpApiKeyAuthLocation=jo;Tw.HttpAuthLocation=Vo;Tw.IniSectionType=Ko;Tw.RequestHandlerProtocol=Qo;Tw.SMITHY_CONTEXT_KEY=xw;Tw.getDefaultClientConfiguration=_w;Tw.resolveDefaultRuntimeConfig=Aw});var me=e(function(zw){var{SMITHY_CONTEXT_KEY:mu}=Tt(),Fw=(t)=>t[mu]||(t[mu]={});function yu(t,r){return Object.prototype.hasOwnProperty.call(t,r)}class On{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 On({...t,headers:{...t.headers}});if(r.query)r.query=Lw(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 On.clone(this)}}function Lw(t){return Object.keys(t).reduce((r,n)=>{let s=t[n];return{...r,[n]:Array.isArray(s)?[...s]:s}},{})}class Su{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 Uw=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),wu=(t,r=!1)=>{if(!r)return Uw.test(t);let n=t.split(".");for(let s of n)if(!wu(s))return!1;return!0};function $w(t){return/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(t)}var Bw=(t)=>{if(typeof t==="function")return t;let r=Promise.resolve(t);return()=>r};function Eu(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 Pn=(t)=>{if(typeof t==="string")return Pn(new URL(t));let{hostname:r,pathname:n,port:s,protocol:o,search:i}=t,c;if(i)c=Eu(i);return{hostname:r,port:s?parseInt(s):void 0,protocol:o,path:n,query:c}},Hw=(t)=>{if(typeof t==="object"){if("url"in t){let r=Pn(t.url);if(t.headers){r.headers={};for(let n in t.headers){if(!yu(t.headers,n))continue;r.headers[n.toLowerCase()]=t.headers[n].join(", ")}}return r}return t}return Pn(t)};zw.HttpRequest=On;zw.HttpResponse=Su;zw.getSmithyContext=Fw;zw.hasOwn=yu;zw.isValidHostLabel=wu;zw.isValidHostname=$w;zw.normalizeProvider=Bw;zw.parseQueryString=Eu;zw.parseUrl=Pn;zw.toEndpointV1=Hw});var ve=e(function(fE){var{getSmithyContext:bu,HttpResponse:Zw,toEndpointV1:eE}=me(),kn=(t)=>{if(typeof t==="function")return t();return t},Jo=(t,r,n,s,o)=>({name:r,namespace:t,traits:n,input:s,output:o}),tE=(t)=>(r,n)=>async(s)=>{let{response:o}=await r(s),{operationSchema:i}=bu(n),[,c,a,u,d,f]=i??[];try{let l=await t.protocol.deserializeResponse(Jo(c,a,u,d,f),{...t,...n},o);return{response:o,output:l}}catch(l){if(Object.defineProperty(l,"$response",{value:o,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in l)){try{l.message+=`
3
+ Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`}catch(p){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 l.$responseBodyText<"u"){if(l.$response)l.$response.body=l.$responseBodyText}try{if(Zw.isInstance(o)){let{headers:p={},statusCode:g}=o,m=Object.entries(p);l.$metadata={httpStatusCode:g,requestId:Xo(/^x-[\w-]+-request-?id$/,m),extendedRequestId:Xo(/^x-[\w-]+-id-2$/,m),cfId:Xo(/^x-[\w-]+-cf-id$/,m)}}}catch(p){}}throw l}},Xo=(t,r)=>(r.find(([n])=>n.match(t))||[void 0,void 0])[1],rE=(t)=>(r,n)=>async(s)=>{let{operationSchema:o}=bu(n),[,i,c,a,u,d]=o??[],f=n.endpointV2?async()=>eE(n.endpointV2):t.endpoint,l=await t.protocol.serializeRequest(Jo(i,c,a,u,d),s.input,{...t,...n,endpoint:f});return r({...s,request:l})},_u={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Au={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function nE(t){return{applyToStack:(r)=>{r.add(rE(t),Au),r.add(tE(t),_u),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 Ln extends fe{static symbol=Symbol.for("@smithy/lis");valueSchema;symbol=Ln.symbol}var sE=(t,r,n,s)=>fe.assign(new Ln,{name:r,namespace:t,traits:n,valueSchema:s});class Un extends fe{static symbol=Symbol.for("@smithy/map");keySchema;valueSchema;symbol=Un.symbol}var oE=(t,r,n,s,o)=>fe.assign(new Un,{name:r,namespace:t,traits:n,keySchema:s,valueSchema:o});class $n extends fe{static symbol=Symbol.for("@smithy/ope");input;output;symbol=$n.symbol}var iE=(t,r,n,s,o)=>fe.assign(new $n,{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 aE=(t,r,n,s,o)=>fe.assign(new Mr,{name:r,namespace:t,traits:n,memberNames:s,memberList:o});class Bn extends Mr{static symbol=Symbol.for("@smithy/err");ctor;symbol=Bn.symbol}var cE=(t,r,n,s,o,i)=>fe.assign(new Bn,{name:r,namespace:t,traits:n,memberNames:s,memberList:o,ctor:null}),Mn=[];function kr(t){if(typeof t==="object")return t;if(t=t|0,Mn[t])return Mn[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 Mn[t]=r}var Or={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},Dn=[],Fn={};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(Yo(s))n.push(s[1]),s=s[0],o=kn(s),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let i=n.length-1;i>=0;--i){let c=n[i];Object.assign(this.memberTraits,kr(c))}}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=kn(o),xu(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(Dn[t])return Dn[t]}else if(typeof t==="string"){if(Fn[t])return Fn[t]}else if(r){if(t[Or.ns])return t[Or.ns]}let n=kn(t);if(n instanceof Ve)return n;if(Yo(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 Fn[n]=s;if(typeof n==="number")return Dn[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(Yo(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 Yo=(t)=>Array.isArray(t)&&t.length===2,xu=(t)=>Array.isArray(t)&&t.length>=5;class Dr extends fe{static symbol=Symbol.for("@smithy/sim");schemaRef;symbol=Dr.symbol}var uE=(t,r,n,s)=>fe.assign(new Dr,{name:r,namespace:t,traits:s,schemaRef:n}),dE=(t,r,n,s)=>fe.assign(new Dr,{name:r,namespace:t,traits:n,schemaRef:s}),lE={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}}fE.ErrorSchema=Bn;fE.ListSchema=Ln;fE.MapSchema=Un;fE.NormalizedSchema=Ve;fE.OperationSchema=$n;fE.SCHEMA=lE;fE.Schema=fe;fE.SimpleSchema=Dr;fE.StructureSchema=Mr;fE.TypeRegistry=qe;fE.deref=kn;fE.deserializerMiddlewareOption=_u;fE.error=cE;fE.getSchemaSerdePlugin=nE;fE.isStaticSchema=xu;fE.list=sE;fE.map=oE;fE.op=iE;fE.operation=Jo;fE.serializerMiddlewareOption=Au;fE.sim=uE;fE.simAdapter=dE;fE.simpleSchemaCacheN=Dn;fE.simpleSchemaCacheS=Fn;fE.struct=aE;fE.traitsCache=Mn;fE.translateTraits=kr});var ue=e(function(Sb){var{hasOwn:Ur}=me(),{getSmithyContext:BE,normalizeProvider:HE}=me();Sb.getSmithyContext=BE;Sb.normalizeProvider=HE;var{SMITHY_CONTEXT_KEY:Tu,AlgorithmId:Fr}=Tt();Sb.AlgorithmId=Fr;var{NormalizedSchema:zE}=ve(),Ct=(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=(l)=>l.sort((h,p)=>Cu[p.step]-Cu[h.step]||Iu[p.priority||"normal"]-Iu[h.priority||"normal"]),i=(l)=>{let h=!1,p=(g)=>{let m=Ct(g.name,g.aliases);if(m.includes(l)){h=!0;for(let y of m)s.delete(y);return!1}return!0};return t=t.filter(p),r=r.filter(p),h},c=(l)=>{let h=!1,p=(g)=>{if(g.middleware===l){h=!0;for(let m of Ct(g.name,g.aliases))s.delete(m);return!1}return!0};return t=t.filter(p),r=r.filter(p),h},a=(l)=>(t.forEach((h)=>{l.add(h.middleware,{...h})}),r.forEach((h)=>{l.addRelativeTo(h.middleware,{...h})}),l.identifyOnResolve?.(f.identifyOnResolve()),l),u=(l)=>{let h=[];return l.before.forEach((p)=>{if(p.before.length===0&&p.after.length===0)h.push(p);else h.push(...u(p))}),h.push(l),l.after.reverse().forEach((p)=>{if(p.before.length===0&&p.after.length===0)h.push(p);else h.push(...u(p))}),h},d=(l=!1)=>{let h=[],p=[],g={};return t.forEach((y)=>{let S={...y,before:[],after:[]};for(let w of Ct(S.name,S.aliases))g[w]=S;h.push(S)}),r.forEach((y)=>{let S={...y,before:[],after:[]};for(let w of Ct(S.name,S.aliases))g[w]=S;p.push(S)}),p.forEach((y)=>{if(y.toMiddleware){let S=g[y.toMiddleware];if(S===void 0){if(l)return;throw Error(`${y.toMiddleware} is not found when adding ${Ze(y.name,y.aliases)} middleware ${y.relation} ${y.toMiddleware}`)}if(y.relation==="after")S.after.push(y);if(y.relation==="before")S.before.push(y)}}),o(h).map(u).reduce((y,S)=>(y.push(...S),y),[])},f={add:(l,h={})=>{let{name:p,override:g,aliases:m}=h,y={step:"initialize",priority:"normal",middleware:l,...h},S=Ct(p,m);if(S.length>0){if(S.some((w)=>s.has(w))){if(!g)throw Error(`Duplicate middleware name '${Ze(p,m)}'`);for(let w of S){let _=t.findIndex((L)=>L.name===w||L.aliases?.some((k)=>k===w));if(_===-1)continue;let v=t[_];if(v.step!==y.step||y.priority!==v.priority)throw Error(`"${Ze(v.name,v.aliases)}" middleware with ${v.priority} priority in ${v.step} step cannot be overridden by "${Ze(p,m)}" middleware with ${y.priority} priority in ${y.step} step.`);t.splice(_,1)}}for(let w of S)s.add(w)}t.push(y)},addRelativeTo:(l,h)=>{let{name:p,override:g,aliases:m}=h,y={middleware:l,...h},S=Ct(p,m);if(S.length>0){if(S.some((w)=>s.has(w))){if(!g)throw Error(`Duplicate middleware name '${Ze(p,m)}'`);for(let w of S){let _=r.findIndex((L)=>L.name===w||L.aliases?.some((k)=>k===w));if(_===-1)continue;let v=r[_];if(v.toMiddleware!==y.toMiddleware||v.relation!==y.relation)throw Error(`"${Ze(v.name,v.aliases)}" middleware ${v.relation} "${v.toMiddleware}" middleware cannot be overridden by "${Ze(p,m)}" middleware ${y.relation} "${y.toMiddleware}" middleware.`);r.splice(_,1)}}for(let w of S)s.add(w)}r.push(y)},clone:()=>a(Lr()),use:(l)=>{l.applyToStack(f)},remove:(l)=>{if(typeof l==="string")return i(l);else return c(l)},removeByTag:(l)=>{let h=!1,p=(g)=>{let{tags:m,name:y,aliases:S}=g;if(m&&m.includes(l)){let w=Ct(y,S);for(let _ of w)s.delete(_);return h=!0,!1}return!0};return t=t.filter(p),r=r.filter(p),h},concat:(l)=>{let h=a(Lr());return h.use(l),h.identifyOnResolve(n||h.identifyOnResolve()||(l.identifyOnResolve?.()??!1)),h},applyToStack:a,identify:()=>d(!0).map((l)=>{let h=l.step??l.relation+" "+l.toMiddleware;return Ze(l.name,l.aliases)+" - "+h}),identifyOnResolve(l){if(typeof l==="boolean")n=l;return n},resolve:(l,h)=>{for(let p of d().map((g)=>g.middleware).reverse())l=p(l,h);if(n)console.log(f.identify());return l}};return f},Cu={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Iu={high:3,normal:2,low:1},qE=(t)=>()=>{throw Error(t)},VE=(t)=>()=>Promise.reject(t),Hn=()=>{let t=new WeakSet;return(r,n)=>{if(typeof n==="object"&&n!==null){if(t.has(n))return"[Circular]";t.add(n)}return n}},jE=(t)=>new Promise((r)=>setTimeout(r,t*1000)),Nu={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 WE=(t)=>{if(t.state===Me.ABORTED){let r=Error(`${JSON.stringify({...t,reason:"Request was aborted"},Hn())}`);throw r.name="AbortError",r}else if(t.state===Me.TIMEOUT){let r=Error(`${JSON.stringify({...t,reason:"Waiter has timed out"},Hn())}`);throw r.name="TimeoutError",r}else if(t.state!==Me.SUCCESS)throw Error(`${JSON.stringify(t,Hn())}`);return t},GE=async({minDelay:t,maxDelay:r,maxWaitTime:n,abortController:s,client:o,abortSignal:i},c,a)=>{let u={},[d,f]=[t*1000,r*1000],l=0,h=Date.now()+n*1000,p=Date.now()+60000,g=!1;while(!0){if(l>0){let S=XE(d,f,l,h);if(s?.signal?.aborted||i?.aborted)return u["AbortController signal aborted."]|=0,u["AbortController signal aborted."]+=1,{state:Me.ABORTED,observedResponses:u};if(Date.now()+S>h)return{state:Me.TIMEOUT,observedResponses:u};await jE(S/1000)}let{state:m,reason:y}=await a(o,c);if(y){let S=QE(y);u[S]|=0,u[S]+=1}if(m!==Me.RETRY)return{state:m,reason:y,final:y,observedResponses:u};if(l+=1,!g&&Date.now()>=p)KE(u,o),g=!0}},KE=(t={},r)=>{let n=Object.keys(t),s=0;for(let c of n){let a=t[c]|0;if(c.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.")},QE=(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,Hn())??"Unknown")},XE=(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),c=Math.min(i,r),a=YE(t,c);if(Date.now()+a>s){let u=s-Date.now();return Math.max(0,u-500)}return a},YE=(t,r)=>t+Math.random()*(r-t),JE=(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`)},Ru=(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}},ZE=async(t,r,n)=>{let s={...Nu,...t};JE(s);let o=[GE(s,r,n)],i=[];if(t.abortSignal){let{aborted:c,clearListener:a}=Ru(t.abortSignal);i.push(a),o.push(c)}if(t.abortController?.signal){let{aborted:c,clearListener:a}=Ru(t.abortController.signal);i.push(a),o.push(c)}return Promise.race(o).then((c)=>{for(let a of i)a();return c})};class Ou{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,c;if(i){if(!this.handlers)this.handlers=new WeakMap;let a=this.handlers;if(a.has(t.constructor))c=a.get(t.constructor);else c=t.resolveMiddleware(this.middlewareStack,this.config,s),a.set(t.constructor,c)}else delete this.handlers,c=t.resolveMiddleware(this.middlewareStack,this.config,s);if(o)c(t).then((a)=>o(null,a.output),(a)=>o(a)).catch(()=>{});else return c(t).then((a)=>a.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var Zo="***SensitiveInformation***";function zn(t,r){if(r==null)return r;let n=zE.of(t);if(n.getMergedTraits().sensitive)return Zo;if(n.isListSchema()){if(!!n.getValueSchema().getMergedTraits().sensitive)return Zo}else if(n.isMapSchema()){if(!!n.getKeySchema().getMergedTraits().sensitive||!!n.getValueSchema().getMergedTraits().sensitive)return Zo}else if(n.isStructSchema()&&typeof r==="object"){let s=r,o={};for(let[i,c]of n.structIterator())if(s[i]!=null)o[i]=zn(c,s[i]);return o}return r}class qn{middlewareStack=Lr();schema;static classBuilder(){return new Pu}resolveMiddlewareWithContext(t,r,n,{middlewareFn:s,clientName:o,commandName:i,inputFilterSensitiveLog:c,outputFilterSensitiveLog:a,smithyContext:u,additionalContext:d,CommandCtor:f}){for(let S of s.bind(this)(f,t,r,n))this.middlewareStack.use(S);let l=t.concat(this.middlewareStack),{logger:h}=r,p=d[Tu],g={logger:h,clientName:o,commandName:i,inputFilterSensitiveLog:c,outputFilterSensitiveLog:a,...d,[Tu]:{...p,commandInstance:this,...u,...n?.metricsRecorder===void 0?{}:{metricsRecorder:n.metricsRecorder}}},{requestHandler:m}=r,y=n??{};if(y.metricsRecorder)y={...y},delete y.metricsRecorder;if(u.eventStream)y={isEventStream:!0,...y};return l.resolve((S)=>m.handle(S.request,y),g)}}class Pu{_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 qn{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,c=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?zn.bind(null,c):(u)=>u),outputFilterSensitiveLog:t._outputFilterSensitiveLog??(i?zn.bind(null,a):(u)=>u),smithyContext:t._smithyContext,additionalContext:t._additionalContext})}serialize=t._serializer;deserialize=t._deserializer}}}var eb="***SensitiveInformation***",tb=(t,r,n)=>{for(let[i,c]of Object.entries(t)){let a=async function(d,f,l){let h=new c(d);if(typeof f==="function")this.send(h,f);else if(typeof l==="function"){if(typeof f!=="object")throw Error(`Expected http options but got ${typeof f}`);this.send(h,f||{},l)}else return this.send(h,f)},u=(i[0].toLowerCase()+i.slice(1)).replace(/Command$/,"");r.prototype[u]=a}let{paginators:s={},waiters:o={}}=n??{};for(let[i,c]of Object.entries(s))if(r.prototype[i]===void 0)r.prototype[i]=function(a={},u,...d){return c({...u,client:this},a,...d)};for(let[i,c]of Object.entries(o))if(r.prototype[i]===void 0)r.prototype[i]=async function(a={},u,...d){let f=u;if(typeof u==="number")f={maxWaitTime:u};return c({...f,client:this},a,...d)}};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 ku=(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},Mu=({output:t,parsedBody:r,exceptionCtor:n,errorCode:s})=>{let o=nb(t),i=o.httpStatusCode?o.httpStatusCode+"":void 0,c=new n({name:r?.code||r?.Code||s||i||"UnknownError",$fault:"client",$metadata:o});throw ku(c,r)},rb=(t)=>({output:r,parsedBody:n,errorCode:s})=>{Mu({output:r,parsedBody:n,exceptionCtor:t,errorCode:s})},nb=(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"]}),sb=(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{}}},vu=!1,ob=(t)=>{if(t&&!vu&&parseInt(t.substring(1,t.indexOf(".")))<16)vu=!0},Du=Object.values(Fr),Fu=(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(Du.includes(s))t.checksumAlgorithms[s.toUpperCase()]=o;else t.checksumAlgorithms[s]=o;r.push(n)},checksumAlgorithms(){return r}}},Lu=(t)=>{let r={};return t.checksumAlgorithms().forEach((n)=>{let s=n.algorithmId();if(Du.includes(s))r[s]=n.checksumConstructor()}),r},Uu=(t)=>({setRetryStrategy(r){t.retryStrategy=r},retryStrategy(){return t.retryStrategy}}),$u=(t)=>{let r={};return r.retryStrategy=t.retryStrategy(),r},Bu=(t)=>Object.assign(Fu(t),Uu(t)),ib=Bu,ab=(t)=>Object.assign(Lu(t),$u(t)),cb=(t)=>Array.isArray(t)?t:[t],Hu=(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]=Hu(t[n])}return t},ub=(t)=>t!=null;class zu{trace(){}debug(){}info(){}warn(){}error(){}}function qu(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,fb(s,o,i);else i=r;for(let c in i){if(!Ur(i,c))continue;if(!Array.isArray(i[c])){s[c]=i[c];continue}Vu(s,null,i,c)}return s}var db=(t)=>{let r={};for(let[n,s]of Object.entries(t||{}))r[n]=[,s];return r},lb=(t,r)=>{let n={};for(let s in r){if(!Ur(r,s))continue;Vu(n,t,r,s)}return n},fb=(t,r,n)=>qu(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},{})),Vu=(t,r,n,s)=>{if(r!==null){let c=n[s];if(typeof c==="function")c=[,c];let[a=hb,u=pb,d=s]=c;if(typeof a==="function"&&a(r[d])||typeof a!=="function"&&!!a)t[s]=u(r[d]);return}let[o,i]=n[s];if(typeof i==="function"){let c,a=o===void 0&&(c=i())!=null,u=typeof o==="function"&&!!o(void 0)||typeof o!=="function"&&!!o;if(a)t[s]=c;else if(u)t[s]=i()}else{let c=o===void 0&&i!=null,a=typeof o==="function"&&!!o(i)||typeof o!=="function"&&!!o;if(c||a)t[s]=i}},hb=(t)=>t!=null,pb=(t)=>t,gb=(t)=>{if(t!==t)return"NaN";switch(t){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return t}},mb=(t)=>t.toISOString().replace(".000Z","Z"),ei=(t)=>{if(t==null)return{};if(Array.isArray(t))return t.filter((r)=>r!=null).map(ei);if(typeof t==="object"){let r={};for(let n in t){if(!Ur(t,n))continue;if(t[n]==null)continue;r[n]=ei(t[n])}return r}return t};function yb(t,r,n,s){return function(i,c,a,u,d={}){let f=Object.assign({},t,i);return qn.classBuilder().ep(f).m(function(l,h,p,g){let m=c.call(this,l,h,p,g);return m.unshift(s(p,l.getEndpointParameterInstructions())),m}).s(r,a,d).n(n,a.charAt(0).toUpperCase()+a.slice(1)+"Command").sc(u).build()}}Sb.Client=Ou;Sb.Command=qn;Sb.NoOpLogger=zu;Sb.SENSITIVE_STRING=eb;Sb.ServiceException=Xt;Sb.WaiterState=Me;Sb._json=ei;Sb.checkExceptions=WE;Sb.constructStack=Lr;Sb.convertMap=db;Sb.createAggregatedClient=tb;Sb.createWaiter=ZE;Sb.decorateServiceException=ku;Sb.emitWarningIfUnsupportedVersion=ob;Sb.getArrayIfSingleItem=cb;Sb.getChecksumConfiguration=Fu;Sb.getDefaultClientConfiguration=ib;Sb.getDefaultExtensionConfiguration=Bu;Sb.getRetryConfiguration=Uu;Sb.getValueFromTextNode=Hu;Sb.invalidFunction=qE;Sb.invalidProvider=VE;Sb.isSerializableHeaderValue=ub;Sb.loadConfigsForDefaultMode=sb;Sb.makeBuilder=yb;Sb.map=qu;Sb.resolveChecksumRuntimeConfig=Lu;Sb.resolveDefaultRuntimeConfig=ab;Sb.resolveRetryRuntimeConfig=$u;Sb.schemaLogFilter=zn;Sb.serializeDateTime=mb;Sb.serializeFloat=gb;Sb.take=lb;Sb.throwDefaultError=Mu;Sb.waiterServiceDefaults=Nu;Sb.withBaseException=rb});var Z=e(function(sA){var{homedir:s_}=I("node:os"),{sep:o_,join:$r}=I("node:path"),{createHash:i_}=I("node:crypto"),{readFile:Zu}=I("node:fs/promises"),{IniSectionType:Vn}=Tt(),{normalizeProvider:jn}=ue(),{isValidHostLabel:a_}=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 oi extends Yt{name="TokenProviderError";constructor(t,r=!0){super(t,r);Object.setPrototypeOf(this,oi.prototype)}}var ed=(...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},td=(t)=>()=>Promise.resolve(t),ii=(t,r,n)=>{let s,o,i,c=!1,a=async()=>{if(!o)o=t();try{s=await o,i=!0,c=!1}finally{o=void 0}return s};if(r===void 0)return async(u)=>{if(!i||u?.forceRefresh)s=await a();return s};return async(u)=>{if(!i||u?.forceRefresh)s=await a();if(c)return s;if(n&&!n(s))return c=!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]}.`)},c_=(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 ti={},u_=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},Hr=()=>{let{HOME:t,USERPROFILE:r,HOMEPATH:n,HOMEDRIVE:s=`C:${o_}`}=process.env;if(t)return t;if(r)return r;if(n)return`${s}${n}`;let o=u_();if(!ti[o])ti[o]=s_();return ti[o]},rd="AWS_PROFILE",nd="default",sd=(t)=>t.profile||process.env[rd]||nd,od=(t)=>{let n=i_("sha1").update(t).digest("hex");return $r(Hr(),".aws","sso","cache",`${n}.json`)},Wn={},d_=async(t)=>{if(Wn[t])return Wn[t];let r=od(t),n=await Zu(r,"utf8");return JSON.parse(n)},It=".",l_=(t)=>Object.entries(t).filter(([r])=>{let n=r.indexOf(It);if(n===-1)return!1;return Object.values(Vn).includes(r.substring(0,n))}).reduce((r,[n,s])=>{let o=n.indexOf(It),i=n.substring(0,o)===Vn.PROFILE?n.substring(o+1):n;return r[i]=s,r},{...t.default&&{default:t.default}}),f_="AWS_CONFIG_FILE",id=()=>process.env[f_]||$r(Hr(),".aws","config"),h_="AWS_SHARED_CREDENTIALS_FILE",p_=()=>process.env[h_]||$r(Hr(),".aws","credentials"),g_=/^([\w-]+)\s(["'])?([\w-@+.%:/]+)\2$/,m_=["__proto__","profile __proto__"],ni=(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),u=g_.exec(a);if(u){let[,d,,f]=u;if(Object.values(Vn).includes(d))n=[d,f].join(It)}else n=a;if(m_.includes(a))throw Error(`Found invalid profile name "${a}"`)}else if(n){let a=i.indexOf("=");if(![0,-1].includes(a)){let[u,d]=[i.substring(0,a).trim(),i.substring(a+1).trim()];if(d==="")s=u;else{if(s&&o.trimStart()===o)s=void 0;r[n]=r[n]||{};let f=s?[s,u].join(It):u;r[n][f]=d}}}}return r},ri={},Gn={},Kn=(t,r)=>{if(Gn[t]!==void 0)return Gn[t];if(!ri[t]||r?.ignoreCache)ri[t]=Zu(t,"utf8");return ri[t]},ju=()=>({}),ai=async(t={})=>{let{filepath:r=p_(),configFilepath:n=id()}=t,s=Hr(),o="~/",i=r;if(r.startsWith("~/"))i=$r(s,r.slice(2));let c=n;if(n.startsWith("~/"))c=$r(s,n.slice(2));let a=await Promise.all([Kn(c,{ignoreCache:t.ignoreCache}).then(ni).then(l_).catch(ju),Kn(i,{ignoreCache:t.ignoreCache}).then(ni).catch(ju)]);return{configFile:a[0],credentialsFile:a[1]}},y_=(t)=>Object.entries(t).filter(([r])=>r.startsWith(Vn.SSO_SESSION+It)).reduce((r,[n,s])=>({...r,[n.substring(n.indexOf(It)+1)]:s}),{}),S_=()=>({}),w_=async(t={})=>Kn(t.configFilepath??id()).then(ni).then(y_).catch(S_),E_=(...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},b_=async(t)=>{let r=await ai(t);return E_(r.configFile,r.credentialsFile)},__={getFileRecord(){return Gn},interceptFile(t,r){Gn[t]=Promise.resolve(r)},getTokenRecord(){return Wn},interceptToken(t,r){Wn[t]=r}};function ad(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 A_=(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: ${ad(t.toString())}`,{logger:r?.logger})}},x_=(t,{preferredFile:r="config",...n}={})=>async()=>{let s=sd(n),{configFile:o,credentialsFile:i}=await ai(n),c=i[s]||{},a=o[s]||{},u=r==="config"?{...c,...a}:{...a,...c};try{let f=t(u,r==="config"?o:i);if(f===void 0)throw Error();return f}catch(d){throw new Br(d.message||`Not found in config files w/ profile [${s}]: ${ad(t.toString())}`,{logger:n.logger})}},T_=(t)=>typeof t==="function",cd=(t)=>T_(t)?async()=>await t():td(t),si=({environmentVariableSelector:t,configFileSelector:r,default:n},s={})=>{let{signingName:o,logger:i}=s;return ii(ed(A_(t,{signingName:o,logger:i}),x_(r,s),cd(n)))},ci="AWS_USE_DUALSTACK_ENDPOINT",ui="use_dualstack_endpoint",C_=!1,I_={environmentVariableSelector:(t)=>je(t,ci,_e.ENV),configFileSelector:(t)=>je(t,ui,_e.CONFIG),default:!1},R_={environmentVariableSelector:(t)=>je(t,ci,_e.ENV),configFileSelector:(t)=>je(t,ui,_e.CONFIG),default:void 0},di="AWS_USE_FIPS_ENDPOINT",li="use_fips_endpoint",v_=!1,N_={environmentVariableSelector:(t)=>je(t,di,_e.ENV),configFileSelector:(t)=>je(t,li,_e.CONFIG),default:!1},O_={environmentVariableSelector:(t)=>je(t,di,_e.ENV),configFileSelector:(t)=>je(t,li,_e.CONFIG),default:void 0},P_=(t)=>{let{tls:r,endpoint:n,urlParser:s,useDualstackEndpoint:o}=t;return Object.assign(t,{tls:r??!0,endpoint:jn(typeof n==="string"?s(n):n),isCustomEndpoint:!0,useDualstackEndpoint:jn(o??!1)})},k_=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:c}=await t.regionInfoProvider(n,{useDualstackEndpoint:o,useFipsEndpoint:i})??{};if(!c)throw Error("Cannot resolve hostname from client config");return t.urlParser(`${r?"https:":"http:"}//${c}`)},M_=(t)=>{let r=jn(t.useDualstackEndpoint??!1),{endpoint:n,useFipsEndpoint:s,urlParser:o,tls:i}=t;return Object.assign(t,{tls:i??!0,endpoint:n?jn(typeof n==="string"?o(n):n):()=>k_({...t,useDualstackEndpoint:r,useFipsEndpoint:s}),isCustomEndpoint:!!n,useDualstackEndpoint:r})},D_="AWS_EXECUTION_ENV",Wu="AWS_REGION",Gu="AWS_DEFAULT_REGION",F_="AWS_EC2_METADATA_DISABLED",L_=["in-region","cross-region","mobile","standard","legacy"],U_="/latest/meta-data/placement/region",$_="/latest/api/token",B_="x-aws-ec2-metadata-token",H_="x-aws-ec2-metadata-token-ttl-seconds",Ku=1000,z_=60000,ud=0,dd=async()=>{if(process.env[F_])return;if(Date.now()<ud)return;try{let t=q_(),r=(await Xu({...t,path:$_,method:"PUT",headers:{[H_]:"21600"}})).toString();return(await Xu({...t,path:U_,method:"GET",headers:{[B_]:r}})).toString().trim()||Qu()}catch{return Qu()}},Qu=()=>{ud=Date.now()+z_;return},q_=()=>{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"}},Xu=async(t)=>{let{request:r}=I("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:Ku,signal:AbortSignal.timeout(Ku)});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:c=400}=i;if(c<200||c>=300){s(Object.assign(Error("Error response received from instance metadata service"),{statusCode:c})),o.destroy();return}let a=[];i.on("data",(u)=>a.push(u)),i.on("end",()=>{n(Buffer.concat(a)),o.destroy()})}),o.end()})},ld="AWS_REGION",fd="region",hd={environmentVariableSelector:(t)=>t[ld],configFileSelector:(t)=>t[fd],default:async()=>{let t=await dd();if(t)return t;throw Error("Region is missing")}},V_={preferredFile:"credentials"},Yu=new Set,j_=(t,r=a_)=>{if(!Yu.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 Yu.add(t)},pd=(t)=>typeof t==="string"&&(t.startsWith("fips-")||t.endsWith("-fips")),W_=(t)=>pd(t)?["fips-aws-global","aws-fips"].includes(t)?"us-east-1":t.replace(/fips-(dkr-|prod-)?|-fips/,""):t,G_=(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=W_(s);return j_(o),o},useFipsEndpoint:async()=>{let s=typeof r==="string"?r:await r();if(pd(s))return!0;return typeof n!=="function"?Promise.resolve(!!n):n()}})},Ju=(t=[],{useFipsEndpoint:r,useDualstackEndpoint:n})=>t.find(({tags:s})=>r===s.includes("fips")&&n===s.includes("dualstack"))?.hostname,K_=(t,{regionHostname:r,partitionHostname:n})=>r?r:n?n.replace("{region}",t):void 0,Q_=(t,{partitionHash:r})=>Object.keys(r||{}).find((n)=>r[n].regions.includes(t))??"aws",X_=(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)}},Y_=(t,{useFipsEndpoint:r=!1,useDualstackEndpoint:n=!1,signingService:s,regionHash:o,partitionHash:i})=>{let c=Q_(t,{partitionHash:i}),a=t in o?t:i[c]?.endpoint??t,u={useFipsEndpoint:r,useDualstackEndpoint:n},d=Ju(o[a]?.variants,u),f=Ju(i[c]?.variants,u),l=K_(a,{regionHostname:d,partitionHostname:f});if(l===void 0)throw Error(`Endpoint resolution failed for: ${{resolvedRegion:a,useFipsEndpoint:r,useDualstackEndpoint:n}}`);let h=X_(l,{signingRegion:o[a]?.signingRegion,regionRegex:i[c].regionRegex,useFipsEndpoint:r});return{partition:c,signingService:s,hostname:l,...h&&{signingRegion:h},...o[a]?.signingService&&{signingService:o[a].signingService}}},J_="AWS_DEFAULTS_MODE",Z_="defaults_mode",eA={environmentVariableSelector:(t)=>t[J_],configFileSelector:(t)=>t[Z_],default:"legacy"},tA=({region:t=si(hd),defaultsMode:r=si(eA)}={})=>ii(async()=>{let n=typeof r==="function"?await r():r;switch(n?.toLowerCase()){case"auto":return rA(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 ${L_.join(", ")}, got ${n}`)}}),rA=async(t)=>{if(t){let r=typeof t==="function"?await t():t,n=await nA();if(!n)return"standard";if(r===n)return"in-region";else return"cross-region"}return"standard"},nA=async()=>{if(process.env[D_]&&(process.env[Wu]||process.env[Gu]))return process.env[Wu]??process.env[Gu];return dd()};sA.CONFIG_PREFIX_SEPARATOR=It;sA.CONFIG_USE_DUALSTACK_ENDPOINT=ui;sA.CONFIG_USE_FIPS_ENDPOINT=li;sA.CredentialsProviderError=Br;sA.DEFAULT_PROFILE=nd;sA.DEFAULT_USE_DUALSTACK_ENDPOINT=C_;sA.DEFAULT_USE_FIPS_ENDPOINT=v_;sA.ENV_PROFILE=rd;sA.ENV_USE_DUALSTACK_ENDPOINT=ci;sA.ENV_USE_FIPS_ENDPOINT=di;sA.NODE_REGION_CONFIG_FILE_OPTIONS=V_;sA.NODE_REGION_CONFIG_OPTIONS=hd;sA.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS=I_;sA.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS=N_;sA.ProviderError=Yt;sA.REGION_ENV_NAME=ld;sA.REGION_INI_NAME=fd;sA.SelectorType=_e;sA.TokenProviderError=oi;sA.booleanSelector=je;sA.chain=ed;sA.externalDataInterceptor=__;sA.fromStatic=cd;sA.fromValue=td;sA.getHomeDir=Hr;sA.getProfileName=sd;sA.getRegionInfo=Y_;sA.getSSOTokenFilepath=od;sA.getSSOTokenFromFile=d_;sA.loadConfig=si;sA.loadSharedConfigFiles=ai;sA.loadSsoSessionData=w_;sA.memoize=ii;sA.nodeDualstackConfigSelectors=R_;sA.nodeFipsConfigSelectors=O_;sA.numberSelector=c_;sA.parseKnownFiles=b_;sA.readFile=Kn;sA.resolveCustomEndpointsConfig=P_;sA.resolveDefaultsModeConfig=tA;sA.resolveEndpointsConfig=M_;sA.resolveRegionConfig=G_});var Je=e(function(Fx){var{CONFIG_PREFIX_SEPARATOR:gd,booleanSelector:md,SelectorType:yd,loadConfig:Sd}=Z(),{toEndpointV1:Qn,getSmithyContext:KA,normalizeProvider:fi,isValidHostLabel:bd,hasOwn:QA}=me();Fx.isValidHostLabel=bd;Fx.middlewareEndpointToEndpointV1=Qn;Fx.toEndpointV1=Qn;var{EndpointURLScheme:gi}=Tt(),wd="AWS_ENDPOINT_URL",Ed="endpoint_url",YA=(t)=>({environmentVariableSelector:(r)=>{let n=t.split(" ").map((i)=>i.toUpperCase()),s=r[[wd,...n].join("_")];if(s)return s;let o=r[wd];if(o)return o;return},configFileSelector:(r,n)=>{if(r.services){let o=["services",r.services].join(gd);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],c=t.split(" ").map((u)=>u.toLowerCase()),a=i[[c.join("_"),Ed].join(gd)];if(a)return a}let s=r[Ed];if(s)return s;return},default:void 0}),JA="AWS_IGNORE_CONFIGURED_ENDPOINT_URLS",ZA="ignore_configured_endpoint_urls",ex={environmentVariableSelector:(t)=>md(t,JA,yd.ENV),configFileSelector:(t)=>md(t,ZA,yd.CONFIG),default:!1},Xn=async(t)=>{if(await Sd(ex)())return;return Sd(YA(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,c=Boolean(i&&n&&s&&o);if(i&&!c)throw Error(`Invalid ARN: ${t} was an invalid ARN.`);return c},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:c,hostname:a,port:u,path:d}=i;return`${c}//${a}${u?":"+u:""}${d}`}}return i};return o};function _d(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(Qn(a)),s.isCustomEndpoint=!0,o?.logger?.debug?.(`@smithy/core/endpoints - resolved endpoint from config: ${a}`)}let i=await Ad(r,n,s);if(typeof s.endpointProvider!=="function")throw Error("config.endpointProvider is not set.");let c=s.endpointProvider(i,o);if(s.isCustomEndpoint&&s.endpoint){let a=await s.endpoint();if(a?.headers){c.headers??={};for(let[u,d]of Object.entries(a.headers))c.headers[u]=Array.isArray(d)?d:[d]}}return c}}var Ad=async(t,r,n)=>{let s={},o=r?.getEndpointParameterInstructions?.()||{};for(let[i,c]of Object.entries(o))switch(c.type){case"staticContextParams":s[i]=c.value;break;case"contextParams":s[i]=t[c.name];break;case"clientContextParams":case"builtInParams":s[i]=await ax(c.name,i,n,c.type!=="builtInParams")();break;case"operationContextParams":s[i]=c.get(t);break;default:throw Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(c))}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 xd(t){let r=_d(t);return({config:n,instructions:s})=>(o,i)=>async(c)=>{if(n.isCustomEndpoint)cx(i,"ENDPOINT_OVERRIDE","N");let a=await r(c.input,{getEndpointParameterInstructions(){return s}},{...n},i);i.endpointV2=a,i.authSchemes=a.properties?.authSchemes;let u=i.authSchemes?.[0];if(u){i.signing_region=u.signingRegion,i.signing_service=u.signingName;let f=KA(i)?.selectedHttpAuthScheme?.httpAuthOption;if(f)f.signingProperties=Object.assign(f.signingProperties||{},{signing_region:u.signingRegion,signingRegion:u.signingRegion,signing_service:u.signingName,signingName:u.signingName,signingRegionSet:u.signingRegionSet},u.properties)}return o({...c})}}var ux={name:"serializerMiddleware"},Td={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:ux.name};function dx(t){let r=xd(t);return(n,s)=>({applyToStack:(o)=>{o.addRelativeTo(r({config:n,instructions:s}),Td)}})}function lx(t){return(r)=>{let n=r.tls??!0,{endpoint:s,useDualstackEndpoint:o,useFipsEndpoint:i}=r,c=s!=null?async()=>Qn(await fi(s)()):void 0,u=Object.assign(r,{endpoint:c,tls:n,isCustomEndpoint:!!s,useDualstackEndpoint:fi(o??!1),useFipsEndpoint:fi(i??!1),ignoreConfiguredEndpointUrls:!!r.ignoreConfiguredEndpointUrls}),d=void 0;return u.serviceConfiguredEndpoint=async()=>{if(r.serviceId&&!d)d=t(r.serviceId);return d},u}}class mi{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 mi(t,r,n,s)}}class Cd{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:c}=s.next();if(this.data.delete(i),c||++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 X extends Error{constructor(t){super(t);this.name="EndpointError"}}var zr="endpoints";function et(t){if(typeof t!=="object"||t==null)return t;if("ref"in t)return`$${et(t.ref)}`;if("fn"in t)return`${t.fn}(${(t.argv||[]).map(et).join(", ")})`;return JSON.stringify(t,null,2)}var Id={},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 X(`Path: '${t}' does not end with ']'`);let i=s.slice(o+1,-1);if(Number.isNaN(parseInt(i)))throw new X(`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},Rd=(t,r)=>px(r).reduce((n,s)=>{if(typeof n!=="object")throw new X(`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}$"),vd=(t)=>Sx.test(t)||t.startsWith("[")&&t.endsWith("]"),hi={[gi.HTTP]:80,[gi.HTTPS]:443},wx=(t)=>{let r=(()=>{try{if(t instanceof URL)return t;if(typeof t==="object"&&"hostname"in t){let{hostname:h,port:p,protocol:g="",path:m="",query:y={}}=t,S=new URL(`${g}//${h}${p?`:${p}`:""}${m}`);return S.search=Object.entries(y).map(([w,_])=>`${w}=${_}`).join("&"),S}return new URL(t)}catch(h){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:c,search:a}=r;if(a)return null;let u=c.slice(0,-1);if(!Object.values(gi).includes(u))return null;let d=vd(o),f=n.includes(`${s}:${hi[u]}`)||typeof t==="string"&&t.includes(`${s}:${hi[u]}`),l=`${s}${f?`:${hi[u]}`:""}`;return{scheme:u,authority:l,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:d}};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:Rd,isSet:gx,isValidHostLabel:bd,ite:mx,not:yx,parseURL:wx,split:Ex,stringEquals:bx,substring:_x,uriEncode:Ax},Nd=(t,r)=>{let n=[],{referenceRecord:s,endpointParams:o}=r,i=0;while(i<t.length){let c=t.indexOf("{",i);if(c===-1){n.push(t.slice(i));break}n.push(t.slice(i,c));let a=t.indexOf("}",c);if(a===-1){n.push(t.slice(c));break}if(t[c+1]==="{"&&t[a+1]==="}")n.push(t.slice(c+1,a)),i=a+2;let u=t.substring(c+1,a);if(u.includes("#")){let[d,f]=u.split("#");n.push(Rd(s[d]??o[d],f))}else n.push(s[u]??o[u]);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 Nd(t,n);else if(t.fn)return Pd.callFunction(t,n);else if(t.ref)return Tx(t,n);throw new X(`'${r}': ${String(t)} is not a string, function or reference.`)},Od=({fn:t,argv:r},n)=>{let s=Array(r.length);for(let c=0;c<s.length;++c){let a=r[c];if(typeof a==="boolean"||typeof a==="number")s[c]=a;else s[c]=Pd.evaluateExpression(a,"arg",n)}let o=t.indexOf(".");if(o!==-1){let a=Id[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.`)},Pd={evaluateExpression:qr,callFunction:Od},kd=(t,r)=>{let{assign:n}=t;if(n&&n in r.referenceRecord)throw new X(`'${n}' is already defined in Reference Record.`);let s=Od(t,r);r.logger?.debug?.(`${zr} evaluateCondition: ${et(t)} = ${et(s)}`);let o=s===""?!0:!!s;if(n!=null)return{result:o,toAssign:{name:n,value:s}};return{result:o}},Md=(t,r)=>Object.entries(t??{}).reduce((n,[s,o])=>(n[s]=o.map((i)=>{let c=qr(i,"Header value entry",r);if(typeof c!=="string")throw new X(`Header '${s}' value '${c}' is not a string`);return c}),n),{}),yi=(t,r)=>Object.entries(t).reduce((n,[s,o])=>(n[s]=Fd.getEndpointProperty(o,r),n),{}),Dd=(t,r)=>{if(Array.isArray(t))return t.map((n)=>Dd(n,r));switch(typeof t){case"string":return Nd(t,r);case"object":if(t===null)throw new X(`Unexpected endpoint property: ${t}`);return Fd.getEndpointProperties(t,r);case"boolean":return t;default:throw new X(`Unexpected endpoint property type: ${typeof t}`)}},Fd={getEndpointProperty:Dd,getEndpointProperties:yi},Ld=(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 X(`Endpoint URL must be a string, got ${typeof n}`)},pi=1e8,Cx=(t,r)=>{let{nodes:n,root:s,results:o,conditions:i}=t,c=s,a={},u={referenceRecord:a,endpointParams:r.endpointParams,logger:r.logger};while(c!==1&&c!==-1&&c<pi){let d=3*(Math.abs(c)-1),[f,l,h]=[n[d],n[d+1],n[d+2]],[p,g,m]=i[f],y=kd({fn:p,assign:m,argv:g},u);if(y.toAssign){let{name:S,value:w}=y.toAssign;a[S]=w}c=c>=0===y.result?l:h}if(c>=pi){let d=o[c-pi];if(d[0]===-1){let[,p]=d;throw new X(qr(p,"Error",u))}let[f,l,h]=d;return{url:Ld(f,u),properties:yi(l,u),headers:Md(h??{},u)}}throw new X("No matching endpoint.")},Si=(t=[],r)=>{let n={},s={...r,referenceRecord:{...r.referenceRecord}},o=!1;for(let i of t){let{result:c,toAssign:a}=kd(i,s);if(!c)return{result:c};if(a)o=!0,n[a.name]=a.value,s.referenceRecord[a.name]=a.value,r.logger?.debug?.(`${zr} assign: ${a.name} := ${et(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}=Si(n,r);if(!o)return;let c=i?{...r,referenceRecord:{...r.referenceRecord,...i}}:r,{url:a,properties:u,headers:d}=s;r.logger?.debug?.(`${zr} Resolving endpoint from template: ${et(s)}`);let f={url:Ld(a,c)};if(d!=null)f.headers=Md(d,c);if(u!=null)f.properties=yi(u,c);return f},Rx=(t,r)=>{let{conditions:n,error:s}=t,{result:o,referenceRecord:i}=Si(n,r);if(!o)return;let c=i?{...r,referenceRecord:{...r.referenceRecord,...i}}:r;throw new X(qr(s,"Error",c))},Ud=(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=$d.evaluateTreeRule(n,r);if(s)return s}else throw new X(`Unknown endpoint rule: ${n}`);throw new X("Rules evaluation failed")},vx=(t,r)=>{let{conditions:n,rules:s}=t,{result:o,referenceRecord:i}=Si(n,r);if(!o)return;let c=i?{...r,referenceRecord:{...r.referenceRecord,...i}}:r;return $d.evaluateRules(s,c)},$d={evaluateRules:Ud,evaluateTreeRule:vx},Nx=(t,r)=>{let{endpointParams:n,logger:s}=r,{parameters:o,rules:i}=t;r.logger?.debug?.(`${zr} Initial EndpointParams: ${et(n)}`);for(let a in o){if(!QA(o,a))continue;let u=o[a],d=n[a];if(d==null&&u.default!=null){n[a]=u.default;continue}if(u.required&&d==null)throw new X(`Missing required parameter: '${a}'`)}let c=Ud(i,{endpointParams:n,logger:s,referenceRecord:{}});return r.logger?.debug?.(`${zr} Resolved endpoint: ${et(c)}`),c},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=_d(Xn),kx=lx(Xn),Mx=xd(Xn),Dx=dx(Xn);Fx.BinaryDecisionDiagram=mi;Fx.EndpointCache=Cd;Fx.EndpointError=X;Fx.customEndpointFunctions=Id;Fx.decideEndpoint=Cx;Fx.endpointMiddleware=Mx;Fx.endpointMiddlewareOptions=Td;Fx.getEndpointFromInstructions=Px;Fx.getEndpointPlugin=Dx;Fx.isIpAddress=vd;Fx.resolveEndpoint=Nx;Fx.resolveEndpointConfig=kx;Fx.resolveEndpointRequiredConfig=Ox;Fx.resolveParams=Ad});var Ae=e(function(RT){var{createHmac:e0,createHash:t0,getRandomValues:r0}=I("node:crypto"),{hasOwn:Gd,HttpResponse:n0}=me();RT.hasOwn=Gd;var{ReadStream:s0,lstatSync:o0,fstatSync:i0}=I("node:fs"),{toEndpointV1:a0}=Je(),{Readable:Jt,Writable:Kd,PassThrough:Bd}=I("node:stream"),Qd=(t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",er=(t,r=0,n=t.byteLength-r)=>{if(!Qd(t))throw TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return Buffer.from(t,r,n)},es=(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}$/,Xd=(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=es(t,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)},ts=(t)=>{let r=es(t,"utf8");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT)},Ci=(t)=>{let r;if(typeof t==="string")r=ts(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,c="utf-8"){if(typeof i==="string"){if(c==="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 Yd=(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")},oe=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,oe[r[0]]+oe[r[1]]+oe[r[2]]+oe[r[3]]+"-"+oe[r[4]]+oe[r[5]]+"-"+oe[r[6]]+oe[r[7]]+"-"+oe[r[8]]+oe[r[9]]+"-"+oe[r[10]]+oe[r[11]]+oe[r[12]]+oe[r[13]]+oe[r[14]]+oe[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(Jn(`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(Jn(`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(Jn(`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),Yn=(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,_i=(t)=>Ii(t,32),Ai=(t)=>Ii(t,16),xi=(t)=>Ii(t,8),Ii=(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},Jd=(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(Jn(`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=Jd(t),n=[];for(let s in r){if(!Gd(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},Ri=(t)=>{if(typeof t=="string")return jr(nr(t));return jr(t)},E0=Ri,Zd=(t)=>{if(typeof t=="string")return Yn(nr(t));return Yn(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)},vi=(t)=>{if(typeof t=="string")return el(t);return jr(t)},_0=vi,A0=vi,x0=(t)=>{if(typeof t=="string")return el(t);return Yn(t)},el=(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}`)}},tl=(t)=>{if(typeof t==="string")return Wr(nr(t));return Wr(t)},T0=tl,C0=(t)=>{if(typeof t==="string")return _i(nr(t));return _i(t)},tr=(t)=>{if(typeof t==="string")return Ai(nr(t));return Ai(t)},rl=(t)=>{if(typeof t==="string")return xi(nr(t));return xi(t)},Jn=(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"],Ni=["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(),c=t.getUTCMinutes(),a=t.getUTCSeconds(),u=o<10?`0${o}`:`${o}`,d=i<10?`0${i}`:`${i}`,f=c<10?`0${c}`:`${c}`,l=a<10?`0${a}`:`${a}`;return`${I0[s]}, ${u} ${Ni[n]} ${r} ${d}:${f}:${l} 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,c,a,u,d]=r,f=tr(rr(s)),l=De(o,"month",1,12),h=De(i,"day",1,31);return Vr(f,l,h,{hours:c,minutes:a,seconds:u,fractionalMilliseconds:d})},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,c,a,u,d,f]=r,l=tr(rr(s)),h=De(o,"month",1,12),p=De(i,"day",1,31),g=Vr(l,h,p,{hours:c,minutes:a,seconds:u,fractionalMilliseconds:d});if(f.toUpperCase()!="Z")g.setTime(g.getTime()-j0(f));return g},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,c,a,u,d]=r;return Vr(tr(rr(i)),wi(o),De(s,"day",1,31),{hours:c,minutes:a,seconds:u,fractionalMilliseconds:d})}if(r=M0.exec(t),r){let[n,s,o,i,c,a,u,d]=r;return B0(Vr(U0(i),wi(o),De(s,"day",1,31),{hours:c,minutes:a,seconds:u,fractionalMilliseconds:d}))}if(r=D0.exec(t),r){let[n,s,o,i,c,a,u,d]=r;return Vr(tr(rr(d)),wi(s),De(o.trimLeft(),"day",1,31),{hours:i,minutes:c,seconds:a,fractionalMilliseconds:u})}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=Ri(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},wi=(t)=>{let r=Ni.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 ${Ni[r]} in ${t}: ${n}`)},q0=(t)=>t%4===0&&(t%100!==0||t%400===0),De=(t,r,n,s)=>{let o=rl(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 Zd("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 Oi="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",Pi="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",ki="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",nl="(\\d?\\d)",sl="(\\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(`^${Oi}, ${nl} ${Pi} ${sl} ${ki} GMT$`),Q0=new RegExp(`^${Oi}, ${nl}-${Pi}-(\\d\\d) ${ki} GMT$`),X0=new RegExp(`^${Oi} ${Pi} ( [1-9]|\\d\\d) ${ki} ${sl}$`),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,c,a,,u,d]=r;We(s,1,12),We(o,1,31),We(i,0,23),We(c,0,59),We(a,0,60);let f=new Date(Date.UTC(Number(n),Number(s)-1,Number(o),Number(i),Number(c),Number(a),Number(u)?Math.round(parseFloat(`0.${u}`)*1000):0));if(f.setUTCFullYear(Number(n)),d.toUpperCase()!="Z"){let[,l,h,p]=/([+-])(\d\d):(\d\d)/.exec(d)||[void 0,"+",0,0],g=l==="-"?1:-1;f.setTime(f.getTime()+g*(Number(h)*60*60*1000+Number(p)*60*1000))}return f},eT=(t)=>{if(t==null)return;if(typeof t!=="string")throw TypeError("RFC7231 timestamps must be strings.");let r,n,s,o,i,c,a,u;if(u=K0.exec(t))[,r,n,s,o,i,c,a]=u;else if(u=Q0.exec(t))[,r,n,s,o,i,c,a]=u,s=(Number(s)+1900).toString();else if(u=X0.exec(t))[,n,r,o,i,c,a,s]=u;if(s&&c){let d=Date.UTC(Number(s),Y0.indexOf(n),Number(r),Number(o),Number(i),Number(c),a?Math.round(parseFloat(`0.${a}`)*1000):0);We(r,1,31),We(o,0,23),We(i,0,59),We(c,0,60);let f=new Date(d);return f.setUTCFullYear(Number(s)),f}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 c=0;c<s.length;c++){if(i==="")i=s[c];else i+=r+s[c];if((c+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 c=0;c<r;++c){let a=t[c];switch(a){case'"':if(o!=="\\")s=!s;break;case",":if(!s)n.push(t.slice(i,c)),i=c+1;break}o=a}return n.push(t.slice(i)),n.map((c)=>{c=c.trim();let a=c.length;if(a<2)return c;if(c[0]==='"'&&c[a-1]==='"')c=c.slice(1,a-1);return c.replace(/\\"/g,'"')})},Hd=/^-?((0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?$/;class rs{string;type;constructor(t,r){if(this.string=t,this.type=r,!Hd.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 rs.prototype.isPrototypeOf(t)||r.type==="bigDecimal"&&Hd.test(r.string)}}function nT(t){return new rs(String(t),"bigDecimal")}var ol={},Ti={};for(let t=0;t<256;t++){let r=t.toString(16).toLowerCase();if(r.length===1)r=`0${r}`;ol[t]=r,Ti[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 Ti)r[n/2]=Ti[s];else throw Error(`Cannot decode unrecognized sequence ${s} as hexadecimal`)}return r}function il(t){let r="";for(let n=0;n<t.byteLength;n++)r+=ol[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}`)},al=(t)=>{if(t instanceof Uint8Array)return t;if(typeof t==="string")return ts(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)};function ns(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 cl=(t,r)=>(n,s)=>async(o)=>{let{response:i}=await n(o);try{let c=await r(i,t);return{response:i,output:c}}catch(c){if(Object.defineProperty(c,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in c)){try{c.message+=`
6
+ Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`}catch(u){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 c.$responseBodyText<"u"){if(c.$response)c.$response.body=c.$responseBodyText}try{if(n0.isInstance(i)){let{headers:u={}}=i,d=Object.entries(u);c.$metadata={httpStatusCode:i.statusCode,requestId:Ei(/^x-[\w-]+-request-?id$/,d),extendedRequestId:Ei(/^x-[\w-]+-id-2$/,d),cfId:Ei(/^x-[\w-]+-cf-id$/,d)}}}catch(u){}}throw c}},Ei=(t,r)=>(r.find(([n])=>n.match(t))||[void 0,void 0])[1],ul=(t,r)=>(n,s)=>async(o)=>{let i=t,c=s.endpointV2?async()=>a0(s.endpointV2):i.endpoint;if(!c)throw Error("No valid endpoint provider available.");let a=await r(o.input,{...t,endpoint:c});return n({...o,request:a})},dl={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},ll={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function iT(t,r,n){return{applyToStack:(s)=>{s.add(cl(t,n),dl),s.add(ul(t,r),ll)}}}class fl{algorithmIdentifier;secret;hash;constructor(t,r){this.algorithmIdentifier=t,this.secret=r,this.reset()}update(t,r){this.hash.update(al(zd(t,r)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?e0(this.algorithmIdentifier,zd(this.secret)):t0(this.algorithmIdentifier)}}function zd(t,r){if(Buffer.isBuffer(t))return t;if(typeof t==="string")return es(t,r);if(ArrayBuffer.isView(t))return er(t.buffer,t.byteOffset,t.byteLength);return er(t)}var hl=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??Ci,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),ss=(t)=>typeof Blob==="function"&&(t?.constructor?.name===Blob.name||t instanceof Blob),aT=(t)=>new TextEncoder().encode(t),pl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";Object.entries(pl).reduce((t,[r,n])=>(t[n]=Number(r),t),{});var cT=pl.split(""),bi=6,qd=8,uT=63;function gl(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 c=0,a=0;for(let d=i,f=Math.min(i+3,r.length);d<f;d++)c|=r[d]<<(f-d-1)*qd,a+=qd;let u=Math.ceil(a/bi);c<<=u*bi-a;for(let d=1;d<=u;d++){let f=(u-d)*bi;o+=cT[(c&uT<<f)>>f]}o+="==".slice(0,4-u)}return o}var dT=typeof ReadableStream==="function"?ReadableStream:function(){};class ml 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??gl;if(typeof TransformStream!=="function")throw Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let c=new TransformStream({start(){},async transform(u,d){r.update(u),d.enqueue(u)},async flush(u){let d=await r.digest(),f=i(d);if(t!==f){let l=Error(`Checksum mismatch: expected "${t}" but received "${f}" in response header "${s}".`);u.error(l)}else u.terminate()}});n.pipeThrough(c);let a=c.readable;return Object.setPrototypeOf(a,ml.prototype),a};function fT(t){if(typeof ReadableStream==="function"&&Fe(t.source))return lT(t);return new hl(t)}class Zn{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,c=["",new Zn((d)=>new Uint8Array(d))],a=-1,u=async(d)=>{let{value:f,done:l}=await s.read(),h=f;if(l){if(a!==-1){let p=Zt(c,a);if(tt(p)>0)d.enqueue(p)}d.close()}else{let p=Sl(h,!1);if(a!==p){if(a>=0)d.enqueue(Zt(c,a));a=p}if(a===-1){d.enqueue(h);return}let g=tt(h);i+=g;let m=tt(c[a]);if(g>=r&&m===0)d.enqueue(h);else{let y=yl(c,a,h);if(!o&&i>r*2)o=!0,n?.warn(`@smithy/util-stream - stream chunk size ${g} is below threshold of ${r}, automatically buffering.`);if(y>=r)d.enqueue(Zt(c,a));else await u(d)}}};return new ReadableStream({pull:u})}function yl(t,r,n){switch(r){case 0:return t[0]+=n,tt(t[0]);case 1:case 2:return t[r].push(n),tt(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 tt(t){return t?.byteLength??t?.length??0}function Sl(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,c=["",new Zn((u)=>new Uint8Array(u)),new Zn((u)=>Buffer.from(new Uint8Array(u)))],a=-1;return t.on("data",(u)=>{let d=Sl(u,!0);if(a!==d){if(a>=0)s.push(Zt(c,a));a=d}if(a===-1){s.push(u);return}let f=tt(u);i+=f;let l=tt(c[a]);if(f>=r&&l===0)s.push(u);else{let h=yl(c,a,u);if(!o&&i>r*2)o=!0,n?.warn(`@smithy/util-stream - stream chunk size ${f} is below threshold of ${r}, automatically buffering.`);if(h>=r)s.push(Zt(c,a))}}),t.on("end",()=>{if(a!==-1){let u=Zt(c,a);if(tt(u)>0)s.push(u)}s.push(null)}),s}var gT=(t,r)=>{let{base64Encoder:n,bodyLengthChecker:s,checksumAlgorithmFn:o,checksumLocationName:i,streamHasher:c}=r,a=n!==void 0&&s!==void 0&&o!==void 0&&i!==void 0&&c!==void 0,u=a?c(o,t):void 0;Promise.resolve(u).catch(()=>{});let d=t.getReader();return new ReadableStream({async pull(f){let{value:l,done:h}=await d.read();if(h){if(f.enqueue(`0\r
7
+ `),a){let p=n(await u);f.enqueue(`${i}:${p}\r
8
+ `),f.enqueue(`\r
9
+ `)}f.close()}else f.enqueue(`${(s(l)||0).toString(16)}\r
10
+ ${l}\r
11
+ `)}})};function mT(t,r){let n=t,s=t;if(Fe(s))return gT(s,r);let{base64Encoder:o,bodyLengthChecker:i,checksumAlgorithmFn:c,checksumLocationName:a,streamHasher:u}=r,d=o!==void 0&&c!==void 0&&a!==void 0&&u!==void 0,f=d?u(c,n):void 0;Promise.resolve(f).catch(()=>{});let l=new Jt({read(){n.resume()}});return n.on("data",(h)=>{let p=i(h)||0;if(p===0)return;if(l.push(`${p.toString(16)}\r
12
+ `),l.push(h),!l.push(`\r
13
+ `))n.pause()}),n.on("error",(h)=>{l.destroy(h)}),n.pause(),n.on("end",async()=>{try{if(l.push(`0\r
14
+ `),d){let h=o(await f);l.push(`${a}:${h}\r
15
+ `),l.push(`\r
16
+ `)}l.push(null)}catch(h){l.destroy(h)}}),l}async function yT(t,r){let n=0,s=[],o=t.getReader(),i=!1;while(!i){let{done:u,value:d}=await o.read();if(d)s.push(d),n+=d?.byteLength??0;if(n>=r)break;i=u}o.releaseLock();let c=new Uint8Array(Math.min(r,n)),a=0;for(let u of s){if(u.byteLength>c.byteLength-a){c.set(u.subarray(0,c.byteLength-a),a);break}else c.set(u,a);a+=u.length}return c}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=ns(this.buffers);n(i)})})},wT=class extends Kd{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(ss(t))return wl(t);return El(t)};async function wl(t){return t.arrayBuffer().then((r)=>new Uint8Array(r))}async function El(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 ns(r,s)}var Vd="The stream has already been transformed.",_T=(t)=>{if(!jd(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(Vd);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 gl(i);else if(o==="hex")return il(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(Vd);if(r=!0,jd(t))return s(t);else if(Fe(t))return t;else throw Error(`Cannot transform payload to web stream, got ${t}`)}})},jd=(t)=>typeof Blob==="function"&&t instanceof Blob,bl=(t)=>{if(ss(t))return wl(t);if(Fe(t))return El(t);return new Promise((r,n)=>{let s=new _l,o=t;o.pipe(s),o.on("error",(i)=>{s.end(),n(i)}),s.on("error",n),s.on("finish",function(){let i=ns(this.bufferedBytes);r(i)})})};class _l extends Kd{bufferedBytes=[];_write(t,r,n){this.bufferedBytes.push(t),n()}}var Wd="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(Wd);return r=!0,await bl(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(Wd);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)||ss(t))return xT(t);let r=new Bd,n=new Bd;return t.pipe(r),t.pipe(n),[r,n]}class Al extends u0(Yd,ts,Ci,Xd){}var CT=r0,xl=d0(CT),IT=xl;RT.ChecksumStream=hl;RT.Hash=fl;RT.LazyJsonString=Rt;RT.NumericValue=rs;RT.Uint8ArrayBlobAdapter=Al;RT._parseEpochTimestamp=J0;RT._parseRfc3339DateTimeWithOffset=Z0;RT._parseRfc7231DateTime=eT;RT.calculateBodyLength=oT;RT.concatBytes=ns;RT.copyDocumentWithTransform=l0;RT.createBufferedReadable=pT;RT.createChecksumStream=fT;RT.dateToUtcString=R0;RT.deserializerMiddleware=cl;RT.deserializerMiddlewareOption=dl;RT.expectBoolean=h0;RT.expectByte=xi;RT.expectFloat32=Yn;RT.expectInt=g0;RT.expectInt32=_i;RT.expectLong=Wr;RT.expectNonNull=y0;RT.expectNumber=jr;RT.expectObject=Jd;RT.expectShort=Ai;RT.expectString=S0;RT.expectUnion=w0;RT.fromArrayBuffer=er;RT.fromBase64=Xd;RT.fromHex=sT;RT.fromString=es;RT.fromUtf8=ts;RT.generateIdempotencyToken=IT;RT.getAwsChunkedEncodingStream=mT;RT.getSerdePlugin=iT;RT.handleFloat=_0;RT.headStream=ST;RT.isArrayBuffer=Qd;RT.isBlob=ss;RT.isReadableStream=Fe;RT.limitedParseDouble=vi;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=ul;RT.serializerMiddlewareOption=ll;RT.splitEvery=tT;RT.splitHeader=rT;RT.splitStream=TT;RT.streamCollector=bl;RT.strictParseByte=rl;RT.strictParseDouble=Ri;RT.strictParseFloat=E0;RT.strictParseFloat32=Zd;RT.strictParseInt=T0;RT.strictParseInt32=C0;RT.strictParseLong=tl;RT.strictParseShort=tr;RT.toBase64=Ci;RT.toHex=il;RT.toUint8Array=al;RT.toUtf8=Yd;RT.v4=xl});var dt=e(function(mI){var{createReadStream:KC}=I("node:fs"),{Writable:QC}=I("node:stream"),{toUint8Array:sr,concatBytes:XC}=Ae(),{createHash:Kr,createHmac:YC}=I("node:crypto"),is=I("node:zlib");async function vl(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 vl(n,(o)=>{s.update(o)}),s.digest()};class Fi 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,c=new Fi(i);o.pipe(c),o.on("error",(a)=>{c.end(),s(a)}),c.on("error",s),c.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 Fi(n);return r.pipe(s),new Promise((o,i)=>{r.on("error",(c)=>{s.end(),i(c)}),s.on("error",i),s.on("finish",()=>{n.digest().then(o).catch(i)})})};class Li{digestLength=16;state=Uint32Array.from(Tl);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)Mi(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 c=n;c<64;++c)r.setUint8(c,0);Mi(t,r),n=0}for(let c=n;c<56;++c)r.setUint8(c,0);r.setUint32(56,s>>>0,!0),r.setUint32(60,Math.floor(s/4294967296),!0),Mi(t,r);let o=new Uint8Array(16),i=new DataView(o.buffer);for(let c=0;c<4;++c)i.setUint32(c*4,t[c],!0);return o}reset(){this.state.set(Tl),this.writeBuffer=new DataView(new ArrayBuffer(64)),this.bufferLength=0,this.bytesHashed=0}}var Tl=[1732584193,4023233417,2562383102,271733878],rt=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 Mi(t,r){let n=t[0],s=t[1],o=t[2],i=t[3];for(let c=0;c<64;++c){let a,u;if(c<16)a=s&o|~s&i,u=c;else if(c<32)a=i&s|o&~i,u=(5*c+1)%16;else if(c<48)a=s^o^i,u=(3*c+5)%16;else a=o^(s|~i),u=7*c%16;let d=r.getUint32(u*4,!0),f=i;i=o,o=s;let l=rI[(c>>4)*4+(c&3)],h=(n+a&rt)+(d+nI[c]&rt)&rt;s=s+((h<<l|h>>>32-l)>>>0)&rt,n=f}t[0]=t[0]+n&rt,t[1]=t[1]+s&rt,t[2]=t[2]+o&rt,t[3]=t[3]+i&rt}var sI=(()=>{try{return Kr("md5"),!0}catch{return!1}})(),Nl=sI?oI():Li;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 Ol=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;Ol[t]=r>>>0}var Di=4294967295;class Ui{digestLength=4;checksum=Di;update(t){for(let r=0;r<t.length;++r)this.checksum=this.checksum>>>8^Ol[(this.checksum^t[r])&255]}digestSync(){return(this.checksum^Di)>>>0}async digest(){let t=this.digestSync(),r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!1),r}reset(){this.checksum=Di}}var Cl=typeof is.crc32==="function"?is.crc32:void 0,Pl=Cl?iI(Cl):Ui;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 J=64,Il=32,aI=9007199254740991;class Ge{digestLength=Il;state=Int32Array.from(Rl);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(J*2);for(let i=0;i<J;++i)o[i]=54^r[i],o[i+J]=92^r[i];n.update(o.subarray(0,J)),s.update(o.subarray(J))}}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===J)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(Rl),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)%J>=J-8){for(let c=n;c<J;++c)o.setUint8(c,0);this.hashBufferWith(t,r),n=0}for(let c=n;c<J-8;++c)o.setUint8(c,0);o.setUint32(J-8,Math.floor(s/4294967296),!1),o.setUint32(J-4,s,!1),this.hashBufferWith(t,r);let i=new Uint8Array(Il);for(let c=0;c<8;++c)i[c*4]=t[c]>>>24&255,i[c*4+1]=t[c]>>>16&255,i[c*4+2]=t[c]>>>8&255,i[c*4+3]=t[c]>>>0&255;return i}static normalizeKey(t){let r=sr(t);if(r.byteLength>J){let n=new Ge;n.update(r);let s=n.digestSync(),o=new Uint8Array(J);return o.set(s),o}if(r.byteLength<J){let n=new Uint8Array(J);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],c=t[3],a=t[4],u=t[5],d=t[6],f=t[7];for(let l=0;l<J;++l){if(l<16)n[l]=(r[l*4]&255)<<24|(r[l*4+1]&255)<<16|(r[l*4+2]&255)<<8|r[l*4+3]&255;else{let g=n[l-2],m=(g>>>17|g<<15)^(g>>>19|g<<13)^g>>>10;g=n[l-15];let y=(g>>>7|g<<25)^(g>>>18|g<<14)^g>>>3;n[l]=(m+n[l-7]|0)+(y+n[l-16]|0)}let h=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&u^~a&d)|0)+(f+(cI[l]+n[l]|0)|0)|0,p=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&o^s&i^o&i)|0;f=d,d=u,u=a,a=c+h|0,c=i,i=o,o=s,s=h+p|0}t[0]+=s,t[1]+=o,t[2]+=i,t[3]+=c,t[4]+=a,t[5]+=u,t[6]+=d,t[7]+=f}}var Rl=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}})(),kl=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??{},os=typeof fI==="function"&&typeof hI==="function"&&typeof pI==="function"?globalThis.crypto.subtle:void 0,gI=8388608;class Ml{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(os){if(this.secret){this.finished=!0;let s=await os.importKey("raw",this.secret,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),o=await os.sign("HMAC",s,t);return new Uint8Array(o)}let n=await os.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=Pl;mI.Crc32Js=Ui;mI.Crc32Node=Pl;mI.Md5=Nl;mI.Md5Js=Li;mI.Md5Node=Nl;mI.Sha256=kl;mI.Sha256Js=Ge;mI.Sha256Node=kl;mI.Sha256WebCrypto=Ml;mI.blobHasher=JC;mI.blobReader=vl;mI.fileStreamHasher=ZC;mI.readableStreamHasher=tI});var Qt=e(function(eR){var{Crc32:Ul}=dt(),{hasOwn:as}=me(),{toHex:or,fromHex:OI,toUtf8:PI,fromUtf8:kI}=Ae(),{Readable:MI}=I("node:stream"),{TypeRegistry:DI}=ve();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)Dl(r);return new ir(r)}valueOf(){let t=this.bytes.slice(0),r=t[0]&128;if(r)Dl(t);return parseInt(or(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function Dl(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 $i{toUtf8;fromUtf8;constructor(t,r){this.toUtf8=t,this.fromUtf8=r}format(t){let r=[];for(let o in t){if(!as(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 c=this.fromUtf8(t.value),a=new DataView(new ArrayBuffer(3+c.byteLength));a.setUint8(0,7),a.setUint16(1,c.byteLength,!1);let u=new Uint8Array(a.buffer);return u.set(c,3),u;case"timestamp":let d=new Uint8Array(9);return d[0]=8,d.set(ir.fromNumber(t.value.valueOf()).bytes,1),d;case"uuid":if(!VI.test(t.value))throw Error(`Invalid UUID received: ${t.value}`);let f=new Uint8Array(17);return f[0]=9,f.set(OI(t.value.replace(/-/g,"")),1),f}}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:Ll,value:!0};break;case 1:r[o]={type:Ll,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 c=t.getUint16(n,!1);n+=2,r[o]={type:HI,value:this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+n,c))},n+=c;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 Fl;(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"})(Fl||(Fl={}));var Ll="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}$/,$l=4,st=$l*2,vt=4,jI=st+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($l,!1),c=s.getUint32(st,!1),a=s.getUint32(t-vt,!1),u=new Ul;if(u.update(new Uint8Array(n,r,st)),c!==u.digestSync())throw Error(`The prelude checksum specified in the message (${c}) does not match the calculated CRC32 checksum (${u.digestSync()})`);if(u.update(new Uint8Array(n,r+st,t-(st+vt))),a!==u.digestSync())throw Error(`The message checksum (${u.digestSync()}) did not match the expected value of ${a}`);return{headers:new DataView(n,r+st+vt,i),body:new Uint8Array(n,r+st+vt+i,o-i-(st+vt+vt))}}class Bi{headerMarshaller;messageBuffer;isEndOfStream;constructor(t,r){this.headerMarshaller=new $i(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),c=new Ul;return i.setUint32(0,s,!1),i.setUint32(4,n.byteLength,!1),c.update(o.subarray(0,8)),i.setUint32(8,c.digestSync(),!1),o.set(n,12),o.set(r,n.byteLength+12),c.update(o.subarray(8,s-4)),i.setUint32(s-4,c.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 Hi{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 zi{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 qi{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 Vi{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 Bl(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)},c=async function*(){let a=t[Symbol.asyncIterator]();while(!0){let{value:u,done:d}=await a.next();if(d){if(!r)return;else if(r===n)yield s;else throw Error("Truncated event message received.");return}let f=u.length,l=0;while(l<f){if(!s){let p=f-l;if(!o)o=new Uint8Array(4);let g=Math.min(4-n,p);if(o.set(u.slice(l,l+g),n),n+=g,l+=g,n<4)break;i(new DataView(o.buffer).getUint32(0,!1)),o=null}let h=Math.min(r-n,f-l);if(s.set(u.slice(l,l+h),n),n+=h,l+=h,r&&r===n)yield s,s=null,r=0,n=0}}};return{[Symbol.asyncIterator]:c}}function GI(t,r){let n=ji(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 ji(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},c=await t(i);if(c.$unknown){let a=Error(r(n.body));throw a.name=o,a}throw c[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 Wi=class{eventStreamCodec;utfEncoder;constructor({utf8Encoder:r,utf8Decoder:n}){this.eventStreamCodec=new Bi(r,n),this.utfEncoder=r}deserialize(r,n){let s=Bl(r);return new qi({messageStream:new Hi({inputStream:s,decoder:this.eventStreamCodec}),deserializer:ji(n,this.utfEncoder)})}serialize(r,n){return new zi({messageStream:new Vi({inputStream:r,serializer:n}),encoder:this.eventStreamCodec,includeEndFrame:!0})}},KI=(t)=>new Wi(t);class Gi{universalMarshaller;constructor({utf8Encoder:t,utf8Decoder:r}){this.universalMarshaller=new Wi({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 Gi(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 Hl{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(),c=r.getMemberSchema(i),a=this.serializer,u=this.defaultContentType,d=Symbol("initialRequestMarker"),f={async*[Symbol.asyncIterator](){if(n){let l={":event-type":{type:"string",value:s??"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:u}};a.write(r,n);let h=a.flush();yield{[d]:!0,headers:l,body:h}}for await(let l of t)yield l}};return o.serialize(f,(l)=>{if(l[d])return{headers:l.headers,body:l.body};let h="";for(let w in l){if(!as(l,w))continue;if(w!=="__type"){h=w;break}}let{additionalHeaders:p,body:g,eventType:m,explicitPayloadContentType:y}=this.writeEventBody(h,c,l);return{headers:{":event-type":{type:"string",value:m},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:y??u},...p},body:g}})}async deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:n,initialMessageType:s}){let o=this.marshaller,i=r.getEventStreamMember(),a=r.getMemberSchema(i).getMemberSchemas(),u=Symbol("initialResponseMarker"),d=o.deserialize(t.body,async(h)=>{let p="";for(let m in h){if(!as(h,m))continue;if(m!=="__type"){p=m;break}}let g=h[p].body;if(p===(s??"initial-response")){let m=await this.deserializer.read(r,g);return delete m[i],{[u]:!0,...m}}else if(p in a){let m=a[p];if(m.isStructSchema()){let y={},S=!1;for(let[w,_]of m.structIterator()){let{eventHeader:v,eventPayload:L}=_.getMergedTraits();if(S=S||Boolean(v||L),L){if(_.isBlobSchema())y[w]=g;else if(_.isStringSchema())y[w]=(this.serdeContext?.utf8Encoder??PI)(g);else if(_.isStructSchema())y[w]=await this.deserializer.read(_,g)}else if(v){let k=h[p].headers[w]?.value;if(k!=null)if(_.isNumericSchema())if(k&&typeof k==="object"&&"bytes"in k)y[w]=BigInt(k.toString());else y[w]=Number(k);else y[w]=k}}return{[p]:await this.readEventMember(m,g,S,y)}}return{[p]:await this.deserializer.read(m,g)}}else return{$unknown:h}}),f=d[Symbol.asyncIterator](),l=await f.next();if(l.done)return d;if(l.value?.[u]){if(!r)throw Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(let h in l.value){if(!as(l.value,h))continue;n[h]=l.value[h]}}return{async*[Symbol.asyncIterator](){if(!l?.value?.[u])yield l.value;while(!0){let{done:h,value:p}=await f.next();if(h)break;yield p}}}}async readEventMember(t,r,n,s){let o,i=t.getSchema();if(Array.isArray(i)&&i[0]===-3){let a=i[1],u=DI.for(a);this.compositeErrorRegistry?.copyFrom(u),o=(this.compositeErrorRegistry??u)?.getErrorCtor(i)}let c=n?s:r.byteLength===0?{}:await this.deserializer.read(t,r);if(o){let a=c.message??c.Message??"Unknown",u={},d=t.getMergedTraits().error;if(d)u.$fault=d;return Object.assign(new o({}),u,{message:a},c)}return c}writeEventBody(t,r,n){let s=this.serializer,o=t,i=null,c,a=(()=>r.getSchema()[4].includes(t))(),u={};if(!a){let[l,h]=n[t];o=l,s.write(15,h)}else{let l=r.getMemberSchema(t);if(l.isStructSchema()){for(let[h,p]of l.structIterator()){let{eventHeader:g,eventPayload:m}=p.getMergedTraits();if(m)i=h;else if(g){let y=n[t][h],S="binary";if(p.isNumericSchema())if(-2147483648<=y&&y<=2147483647)S="integer";else S="long";else if(p.isTimestampSchema())S="timestamp";else if(p.isStringSchema())S="string";else if(p.isBooleanSchema())S="boolean";if(y!=null)u[h]={type:S,value:y},delete n[t][h]}}if(i!==null){let h=l.getMemberSchema(i);if(h.isBlobSchema())c="application/octet-stream";else if(h.isStringSchema())c="text/plain";s.write(h,n[t][i])}else s.write(l,n[t])}else if(l.isUnitSchema())s.write(l,{});else throw Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}let d=s.flush()??new Uint8Array;return{body:typeof d==="string"?(this.serdeContext?.utf8Decoder??kI)(d):d,eventType:o,explicitPayloadContentType:c,additionalHeaders:u}}}eR.EventStreamCodec=Bi;eR.EventStreamMarshaller=Gi;eR.EventStreamSerde=Hl;eR.HeaderMarshaller=$i;eR.Int64=ir;eR.MessageDecoderStream=Hi;eR.MessageEncoderStream=zi;eR.SmithyMessageDecoderStream=qi;eR.SmithyMessageEncoderStream=Vi;eR.UniversalEventStreamMarshaller=Wi;eR.eventStreamSerdeProvider=QI;eR.getChunkedStream=Bl;eR.getMessageUnmarshaller=ji;eR.getUnmarshalledStream=GI;eR.iterableToReadableStream=JI;eR.readableStreamToIterable=YI;eR.resolveEventStreamSerdeConfig=ZI;eR.universalEventStreamSerdeProvider=KI});var Y=e(function(BR){var{Uint8ArrayBlobAdapter:Ki,sdkStreamMixin:wR,splitEvery:ER,splitHeader:jl,fromBase64:zl,_parseEpochTimestamp:bR,_parseRfc7231DateTime:_R,_parseRfc3339DateTimeWithOffset:AR,LazyJsonString:Wl,NumericValue:xR,toUtf8:Gl,fromUtf8:TR,generateIdempotencyToken:CR,toBase64:ql,dateToUtcString:IR,quoteHeader:RR}=Ae(),{HttpRequest:ar,HttpResponse:Kl,hasOwn:Nt,isValidHostname:Ql}=me(),{parseQueryString:vR,parseUrl:NR}=me();BR.HttpRequest=ar;BR.HttpResponse=Kl;BR.isValidHostname=Ql;BR.parseQueryString=vR;BR.parseUrl=NR;var{TypeRegistry:OR,NormalizedSchema:Le,translateTraits:Xl}=ve(),{FieldPosition:PR}=Tt(),Ot=async(t=new Uint8Array,r)=>{if(t instanceof Uint8Array)return Ki.mutate(t);if(!t)return Ki.mutate(new Uint8Array);let n=r.streamCollector(t);return Ki.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 cs 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 Kl}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=Xl(r.traits??{});if(o.endpoint){let i=o.endpoint?.[0];if(typeof i==="string"){for(let[c,a]of s.structIterator()){if(!a.getMergedTraits().hostLabel)continue;let u=n[c];if(typeof u!=="string")throw Error(`@smithy/core/schema - ${c} in input must be a string as hostLabel.`);i=i.replace(`{${c}}`,u)}if(t.hostname=i+t.hostname,!Ql(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 c of r)try{if(c==="*")o=i.getSchema(t);else o=i.getSchema(c+"#"+t);let a=i.getErrorCtor(o);if(a)return[o,a,"modeled"];else{let u=i.getBaseException();if(u){let d=i.getErrorCtor(u);if(d)return[o,d,"synthetic"]}}}catch(a){}for(let i of n){let c=i.getBaseException();if(c){let a=i.getErrorCtor(c);if(a)return[c,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}=Qt(),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 Yl extends cs{async serializeRequest(t,r,n){let s=r&&typeof r==="object"?r:{},o=this.serializer,i={},c={},a=await n.endpoint(),u=Le.of(t?.input),d=[],f=[],l=!1,h,p=new ar({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:i,headers:c,body:void 0});if(a){this.updateServiceEndpoint(p,a),this.setHostPrefix(p,t,s);let g=Xl(t.traits);if(g.http){p.method=g.http[0];let[m,y]=g.http[1].split("?");if(p.path=="/")p.path=m;else p.path+=m;let S=new URLSearchParams(y??"");for(let[w,_]of S)i[w]=_}}for(let[g,m]of u.structIterator()){let y=m.getMergedTraits()??{},S=s[g];if(S==null&&!m.isIdempotencyToken()){if(y.httpLabel){if(p.path.includes(`{${g}+}`)||p.path.includes(`{${g}}`))throw Error(`No value provided for input HTTP label: ${g}.`)}continue}if(y.httpPayload)if(m.isStreaming())if(m.isStructSchema()){if(s[g])h=await this.serializeEventStream({eventStream:s[g],requestSchema:u})}else h=S;else o.write(m,S),h=o.flush();else if(y.httpLabel){o.write(m,S);let w=o.flush();if(p.path.includes(`{${g}+}`))p.path=p.path.replace(`{${g}+}`,w.split("/").map(Xr).join("/"));else if(p.path.includes(`{${g}}`))p.path=p.path.replace(`{${g}}`,Xr(w))}else if(y.httpHeader)o.write(m,S),c[y.httpHeader.toLowerCase()]=String(o.flush());else if(typeof y.httpPrefixHeaders==="string")for(let w in S){if(!Nt(S,w))continue;let _=S[w],v=y.httpPrefixHeaders+w;o.write([m.getValueSchema(),{httpHeader:v}],_),c[v.toLowerCase()]=o.flush()}else if(y.httpQuery||y.httpQueryParams)this.serializeQuery(m,S,i);else l=!0,d.push(g),f.push(m)}if(l&&s){let[g,m]=(u.getName(!0)??"#Unknown").split("#"),y=u.getSchema()[6],S=[3,g,m,u.getMergedTraits(),d,f,void 0];if(y)S[6]=y;else S.pop();o.write(S,s),h=o.flush()}return p.headers=c,p.query=i,p.body=h,p}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 c=r[i],a=t.getValueSchema();Object.assign(a.getMergedTraits(),{...o,httpQuery:i,httpQueryParams:void 0}),this.serializeQuery(a,c,n)}}return}if(t.isListSchema()){let i=!!t.getMergedTraits().sparse,c=[];for(let a of r){s.write([t.getValueSchema(),o],a);let u=s.flush();if(i||u!==void 0)c.push(u)}n[o.httpQuery]=c}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 u=n.headers[a];delete n.headers[a],n.headers[a.toLowerCase()]=u}let c=await this.deserializeHttpMessage(o,r,n,i);if(c.length){let a=await Ot(n.body,r);if(a.byteLength>0){let u=await s.read(o,a);for(let d of c)if(u[d]!=null)i[d]=u[d]}}else if(c.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 c=!0,a=this.deserializer,u=Le.of(t),d=[];for(let[f,l]of u.structIterator()){let h=l.getMemberTraits();if(h.httpPayload){if(c=!1,l.isStreaming())if(l.isStructSchema())i[f]=await this.deserializeEventStream({response:n,responseSchema:u});else i[f]=wR(n.body);else if(n.body){let g=await Ot(n.body,r);if(g.byteLength>0)i[f]=await a.read(l,g)}}else if(h.httpHeader){let p=String(h.httpHeader).toLowerCase(),g=n.headers[p];if(g!=null)if(l.isListSchema()){let m=l.getValueSchema();m.getMergedTraits().httpHeader=p;let y;if(m.isTimestampSchema()&&m.getSchema()===4)y=ER(g,",",2);else y=jl(g);let S=[];for(let w of y)S.push(await a.read(m,w.trim()));i[f]=S}else i[f]=await a.read(l,g)}else if(h.httpPrefixHeaders!==void 0){i[f]={};for(let p in n.headers){if(!Nt(n.headers,p))continue;if(p.startsWith(h.httpPrefixHeaders)){let g=n.headers[p],m=l.getValueSchema();m.getMergedTraits().httpHeader=p,i[f][p.slice(h.httpPrefixHeaders.length)]=await a.read(m,g)}}}else if(h.httpResponseCode)i[f]=n.statusCode;else d.push(f)}return d.discardResponseBody=c,d}}class Jl extends cs{async serializeRequest(t,r,n){let s=this.serializer,o={},i={},c=await n.endpoint(),a=Le.of(t?.input),u=a.getSchema(),d,f=r&&typeof r==="object"?r:{},l=new ar({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:o,headers:i,body:void 0});if(c)this.updateServiceEndpoint(l,c),this.setHostPrefix(l,t,f);if(f){let h=a.getEventStreamMember();if(h){if(f[h]){let p={};for(let[g]of a.structIterator())if(g!==h&&f[g]!=null)p[g]=f[g];d=await this.serializeEventStream({eventStream:f[h],requestSchema:a,initialRequest:p})}}else s.write(u,f),d=s.flush()}return l.headers=Object.assign(l.headers,i),l.query=o,l.body=d,l.method="POST",l}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 u=n.headers[a];delete n.headers[a],n.headers[a.toLowerCase()]=u}let c=o.getEventStreamMember();if(c)i[c]=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 Zl=(t,r,n,s,o,i)=>{if(r!=null&&r[n]!==void 0){let c=s();if(c==null||c.length<=0)throw Error("Empty value provided for input HTTP label: "+n+".");t=t.replace(o,i?c.split("/").map((a)=>Xr(a)).join("/"):Xr(c))}else throw Error("No value provided for input HTTP label: "+n+".");return t};function kR(t,r){return new Qi(t,r)}class Qi{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=Zl(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 Xi(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 Yi extends cr{settings;constructor(t){super();this.settings=t}read(t,r){let n=Le.of(t);if(n.isListSchema())return jl(r).map((s)=>this.read(n.getValueSchema(),s));if(n.isBlobSchema())return(this.serdeContext?.base64Decoder??zl)(r);if(n.isTimestampSchema())switch(Xi(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=Wl.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??Gl)((this.serdeContext?.base64Decoder??zl)(t))}}class ef extends cr{codecDeserializer;stringDeserializer;constructor(t,r){super();this.codecDeserializer=t,this.stringDeserializer=new Yi(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??Gl;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 Ji 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(Xi(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??ql)(r);return}if(n.isListSchema()&&Array.isArray(r)){let i="";for(let c of r){this.write([n.getValueSchema(),n.getMergedTraits()],c);let a=this.flush(),u=n.getValueSchema().isTimestampSchema()?a:RR(a);if(i!=="")i+=", ";i+=u}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=Wl.from(o);if(n.getMergedTraits().httpHeader){this.stringBuffer=(this.serdeContext?.base64Encoder??ql)(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 tf{codecSerializer;stringSerializer;buffer;constructor(t,r,n=new Ji(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 rf{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 nf{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()}),Vl="content-length";function sf(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((c)=>c.toLowerCase()).indexOf(Vl)===-1)try{let c=t(o);if(c!=null)s.headers={...s.headers,[Vl]:String(c)}}catch(c){}}return r({...n,request:s})}}var of={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},FR=(t)=>({applyToStack:(r)=>{r.add(sf(t.bodyLengthChecker),of)}}),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=rf;BR.Fields=nf;BR.FromStringShapeDeserializer=Yi;BR.HttpBindingProtocol=Yl;BR.HttpInterceptingShapeDeserializer=ef;BR.HttpInterceptingShapeSerializer=tf;BR.HttpProtocol=cs;BR.RequestBuilder=Qi;BR.RpcProtocol=Jl;BR.SerdeContext=cr;BR.ToStringShapeSerializer=Ji;BR.buildQueryString=$R;BR.collectBody=Ot;BR.contentLengthMiddleware=sf;BR.contentLengthMiddlewareOptions=of;BR.determineTimestampFormat=Xi;BR.escapeUri=Qr;BR.escapeUriPath=UR;BR.extendedEncodeURIComponent=Xr;BR.getContentLengthPlugin=FR;BR.getHttpHandlerExtensionConfiguration=MR;BR.requestBuilder=kR;BR.resolveHttpHandlerRuntimeConfig=DR;BR.resolvedPath=Zl});var ut=e(function(Bv){var{Readable:mv}=I("node:stream"),{NoOpLogger:yv,normalizeProvider:af}=ue(),{HttpResponse:cf,HttpRequest:ds}=Y(),{parseRfc7231DateTime:Sv,v4:uf}=Ae(),{hasOwn:wv}=me(),df=(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"],ra=(t)=>t?.$retryable!==void 0,lf=(t)=>Ev.includes(t.name),ff=(t)=>t.$metadata?.clockSkewCorrected,hf=(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"&&(ra(t)||ff(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)||hf(t)||gf(t)||t.cause!==void 0&&r<=10&&Zr(t.cause,r+1)),pf=(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 gf(t){return t.code==="ERR_HTTP2_STREAM_ERROR"&&t.message.includes("NGHTTP2_REFUSED_STREAM")}var mf=100,fs=20000,yf=500,ls=500,Sf=5,wf=10,na=1,hs="amz-sdk-invocation-id",ps="amz-sdk-request";function Ef(t,r){if(!cf.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(c){r?.trace?.("Failed to parse retry-after header"),r?.trace?.(c)}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 Ef(t,r)}var bf=(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 _f(t){return(r)=>(n,s)=>async(o)=>{let i=await r.retryStrategy(),c=await r.maxAttempts();if(Rv(i)){i=i;let a=await i.acquireInitialRetryToken((s.partition_id??"")+(s.__retryLongPoll?":longpoll":"")),u=Error(),d=0,f=0,{request:l}=o,h=ds.isInstance(l);if(h)l.headers[hs]=uf();while(!0)try{if(h)l.headers[ps]=`attempt=${d+1}; max=${c}`;let{response:p,output:g}=await n(o);return i.recordSuccess(a),g.$metadata.attempts=d+1,g.$metadata.totalRetryDelay=f,{response:p,output:g}}catch(p){let g=vv(p,r.logger);if(u=bf(p),h&&t(l))throw(s.logger instanceof yv?console:s.logger)?.warn("An error was encountered in a non-retryable streaming request."),u;try{a=await i.refreshRetryTokenForRetry(a,g)}catch(y){if(!u.$metadata)u.$metadata={};throw u.$metadata.attempts=d+1,u.$metadata.totalRetryDelay=f,u}d=a.getRetryCount();let m=a.getRetryDelay();if(f+=(a?.$retryLog?.acquisitionDelay??0)+m,m>0)await Iv(m)}}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=Ef(t.$response,r);if(s)n.retryAfterHint=s;return n},Nv=(t)=>{if(Jr(t))return"THROTTLING";if(Zr(t))return"TRANSIENT";if(pf(t))return"SERVER_ERROR";return"CLIENT_ERROR"},Af={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function Ov(t){let r=_f(t);return(n)=>({applyToStack:(s)=>{s.add(r(n),Af)}})}class tn{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)=>tn.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 G{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return G.v2026?50:100}static throttlingDelay(){return G.v2026?1000:500}static cost(){return G.v2026?14:5}static throttlingCost(){return G.v2026?5:10}static modifiedCostType(){return G.v2026?"THROTTLING":"TRANSIENT"}}class xf{x=G.delay();computeNextBackoffDelay(t){let r=Math.random(),n=2,s=r*Math.min(this.x*2**t,fs);return Math.floor(s)}setDelayBase(t){this.x=t}}class Zi{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(fs,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,Tf=Ke.STANDARD,us={incompatible:1,attempts:2,capacity:3},Yr=class{mode=Ke.STANDARD;retryBackoffStrategy;capacity=ls;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??=G.delay(),this.retryBackoffStrategy??=new xf}async acquireInitialRetryToken(r){return new Zi(G.delay(),0,void 0,G.v2026&&r.includes(":longpoll"))}async refreshRetryTokenForRetry(r,n){let s=await this.getMaxAttempts(),o=this.retryCode(r,n,s),i=o===0,c=r.isLongPoll?.();if(i||c){let a=n.errorType;this.retryBackoffStrategy.setDelayBase(a==="THROTTLING"?G.throttlingDelay():this.baseDelay);let u=this.retryBackoffStrategy.computeNextBackoffDelay(r.getRetryCount()),d=u;if(n.retryAfterHint instanceof Date)d=Math.max(u,Math.min(n.retryAfterHint.getTime()-Date.now(),u+5000));if(!i){let f=G.v2026&&o===us.capacity&&c?d:0;if(f>0)await new Promise((l)=>setTimeout(l,f))}else{let f=this.getCapacityCost(a);this.capacity-=f;let l=new Zi(0,r.getRetryCount()+1,f,r.isLongPoll?.()??!1);return await new Promise((h)=>setTimeout(h,d)),l.$retryLog.acquisitionDelay=d,l}}throw Error("No retry token available")}recordSuccess(r){this.capacity=Math.min(ls,this.capacity+(r.getRetryCost()??na))}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:us.incompatible,c=o<s?0:us.attempts,a=this.capacity>=this.getCapacityCost(n.errorType)?0:us.capacity;return i||c||a}getCapacityCost(r){return r===G.modifiedCostType()?G.throttlingCost():G.cost()}isRetryableError(r){return r==="THROTTLING"||r==="TRANSIENT"}},Cf=class{mode=Ke.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(r,n){let{rateLimiter:s}=n??{};this.rateLimiter=s??new tn,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 If extends Yr{computeNextBackoffDelay;constructor(t,r=G.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=na,o=Sf,i=wf,c=t,a=(l)=>l.name==="TimeoutError"?i:o,u=(l)=>a(l)<=c;return Object.freeze({hasRetryTokens:u,retrieveRetryTokens:(l)=>{if(!u(l))throw Error("No retry token available");let h=a(l);return c-=h,h},releaseRetryTokens:(l)=>{c+=l??s,c=Math.min(c,n)}})},Rf=(t,r)=>Math.floor(Math.min(fs,Math.random()*2**r*t)),vf=(t)=>{if(!t)return!1;return ra(t)||lf(t)||Jr(t)||Zr(t)};class sa{maxAttemptsProvider;retryDecider;delayDecider;retryQuota;mode=Ke.STANDARD;constructor(t,r){this.maxAttemptsProvider=t,this.retryDecider=r?.retryDecider??vf,this.delayDecider=r?.delayDecider??Rf,this.retryQuota=r?.retryQuota??Pv(ls)}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,c=await this.getMaxAttempts(),{request:a}=r;if(ds.isInstance(a))a.headers[hs]=uf();while(!0)try{if(ds.isInstance(a))a.headers[ps]=`attempt=${o+1}; max=${c}`;if(n?.beforeRequest)await n.beforeRequest();let{response:u,output:d}=await t(r);if(n?.afterRequest)n.afterRequest(u);return this.retryQuota.releaseRetryTokens(s),d.$metadata.attempts=o+1,d.$metadata.totalRetryDelay=i,{response:u,output:d}}catch(u){let d=bf(u);if(o++,this.shouldRetry(d,o,c)){s=this.retryQuota.retrieveRetryTokens(d);let f=this.delayDecider(Jr(d)?yf:mf,o),l=kv(d.$response),h=Math.max(l||0,f);i+=h,await new Promise((p)=>setTimeout(p,h));continue}if(!d.$metadata)d.$metadata={};throw d.$metadata.attempts=o,d.$metadata.totalRetryDelay=i,d}}}var kv=(t)=>{if(!cf.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 Nf extends sa{rateLimiter;constructor(t,r){let{rateLimiter:n,...s}=r??{};super(t,s);this.rateLimiter=n??new tn,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 ea="AWS_MAX_ATTEMPTS",ta="max_attempts",Mv={environmentVariableSelector:(t)=>{let r=t[ea];if(!r)return;let n=parseInt(r);if(Number.isNaN(n))throw Error(`Environment variable ${ea} mast be a number, got "${r}"`);return n},configFileSelector:(t)=>{let r=t[ta];if(!r)return;let n=parseInt(r);if(Number.isNaN(n))throw Error(`Shared config file entry ${ta} mast be a number, got "${r}"`);return n},default:Pt},Dv=(t,r)=>{let{retryStrategy:n,retryMode:s}=t,{defaultMaxAttempts:o=Pt,defaultBaseDelay:i=G.delay()}=r??{},c=af(t.maxAttempts??o),a=n?Promise.resolve(n):void 0,u=async()=>{let d=await c();if(await af(s)()===Ke.ADAPTIVE)return new Cf(c,{maxAttempts:d,baseDelay:i});return new Yr({maxAttempts:d,baseDelay:i})};return Object.assign(t,{maxAttempts:c,retryStrategy:()=>a??=u()})},Of="AWS_RETRY_MODE",Pf="retry_mode",Fv={environmentVariableSelector:(t)=>t[Of],configFileSelector:(t)=>t[Pf],default:Tf},kf=()=>(t)=>async(r)=>{let{request:n}=r;if(ds.isInstance(n))delete n.headers[hs],delete n.headers[ps];return t(r)},Mf={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},Lv=(t)=>({applyToStack:(r)=>{r.addRelativeTo(kf(),Mf)}}),Uv=_f(df),$v=Ov(df);Bv.AdaptiveRetryStrategy=Cf;Bv.CONFIG_MAX_ATTEMPTS=ta;Bv.CONFIG_RETRY_MODE=Pf;Bv.ConfiguredRetryStrategy=If;Bv.DEFAULT_MAX_ATTEMPTS=Pt;Bv.DEFAULT_RETRY_DELAY_BASE=mf;Bv.DEFAULT_RETRY_MODE=Tf;Bv.DefaultRateLimiter=tn;Bv.DeprecatedAdaptiveRetryStrategy=Nf;Bv.DeprecatedStandardRetryStrategy=sa;Bv.ENV_MAX_ATTEMPTS=ea;Bv.ENV_RETRY_MODE=Of;Bv.INITIAL_RETRY_TOKENS=ls;Bv.INVOCATION_ID_HEADER=hs;Bv.MAXIMUM_RETRY_DELAY=fs;Bv.NODE_MAX_ATTEMPT_CONFIG_OPTIONS=Mv;Bv.NODE_RETRY_MODE_CONFIG_OPTIONS=Fv;Bv.NO_RETRY_INCREMENT=na;Bv.REQUEST_HEADER=ps;Bv.RETRY_COST=Sf;Bv.RETRY_MODES=Ke;Bv.Retry=G;Bv.StandardRetryStrategy=Yr;Bv.THROTTLING_RETRY_DELAY_BASE=yf;Bv.TIMEOUT_RETRY_COST=wf;Bv.defaultDelayDecider=Rf;Bv.defaultRetryDecider=vf;Bv.getOmitRetryHeadersPlugin=Lv;Bv.getRetryAfterHint=Cv;Bv.getRetryPlugin=$v;Bv.isBrowserNetworkError=hf;Bv.isClockSkewCorrectedError=ff;Bv.isClockSkewError=lf;Bv.isNodeJsHttp2TransientError=gf;Bv.isRetryableByTrait=ra;Bv.isServerError=pf;Bv.isThrottlingError=Jr;Bv.isTransientError=Zr;Bv.omitRetryHeadersMiddleware=kf;Bv.omitRetryHeadersMiddlewareOptions=Mf;Bv.resolveRetryConfig=Dv;Bv.retryMiddleware=Uv;Bv.retryMiddlewareOptions=Af});var Ff=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")},oa=["true","1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??"");if(!oa)globalThis.awslambda=globalThis.awslambda||{};class gs{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 Df extends gs{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 aa extends gs{als;static async create(){let t=new aa,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 aa.create():new Df;if(!oa&&globalThis.awslambda?.InvokeStore)return globalThis.awslambda.InvokeStore;else if(!oa&&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=gs});var nt=e(function(KN){var{getSmithyContext:ca,hasOwn:PN}=me();KN.getSmithyContext=ca;var{HttpRequest:ua}=Y(),{requestBuilder:kN}=Y();KN.requestBuilder=kN;var{HttpApiKeyAuthLocation:Lf}=Tt(),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 da=(t,r)=>(n,s)=>async(o)=>{let i=t.httpAuthSchemeProvider(await r.httpAuthSchemeParametersProvider(t,s,o.input)),c=t.authSchemePreference?await t.authSchemePreference():[],a=MN(i,c),u=DN(t.httpAuthSchemes),d=ca(s),f=[];for(let l of a){let h=u.get(l.schemeId);if(!h){f.push(`HttpAuthScheme \`${l.schemeId}\` was not enabled for this service.`);continue}let p=h.identityProvider(await r.identityProviderConfigProvider(t));if(!p){f.push(`HttpAuthScheme \`${l.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:g={},signingProperties:m={}}=l.propertiesExtractor?.(t,s)||{};l.identityProperties=Object.assign(l.identityProperties||{},g),l.signingProperties=Object.assign(l.signingProperties||{},m),d.selectedHttpAuthScheme={httpAuthOption:l,identity:await p(l.identityProperties),signer:h.signer};break}if(!d.selectedHttpAuthScheme)throw Error(f.join(`
18
+ `));return n(o)},Uf={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},FN=(t,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:n})=>({applyToStack:(s)=>{s.addRelativeTo(da(t,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:n}),Uf)}}),$f={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"},LN=(t,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:n})=>({applyToStack:(s)=>{s.addRelativeTo(da(t,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:n}),$f)}}),UN=(t)=>(r)=>{throw r},$N=(t,r)=>{},Bf=(t)=>(r,n)=>async(s)=>{if(!ua.isInstance(s.request))return r(s);let i=ca(n).selectedHttpAuthScheme;if(!i)throw Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:c={}},identity:a,signer:u}=i,d=await r({...s,request:await u.sign(s.request,a,c)}).catch((u.errorHandler||UN)(c));return(u.successHandler||$N)(d.response,c),d},Hf={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},BN=(t)=>({applyToStack:(r)=>{r.addRelativeTo(Bf(),Hf)}}),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*(c,a,...u){let d=a,f=c.startingToken??d[n],l=!0,h;while(l){if(d[n]=f,o)d[o]=d[o]??c.pageSize;if(c.client instanceof t)h=await zN(r,c.client,a,c.withCommand,...u);else throw Error(`Invalid client, expected instance of ${t.name}`);yield h;let p=f;f=VN(h,s),l=!!(f&&(!c.stopOnSameToken||f!==p))}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 zf{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 qf{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=ua.clone(t);if(n.in===Lf.QUERY)s.query[n.name]=r.apiKey;else if(n.in===Lf.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 Vf{async sign(t,r,n){let s=ua.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 jf{async sign(t,r,n){return t}}var Wf=(t)=>function(n){return Kf(n)&&n.expiration.getTime()-Date.now()<t},Gf=300000,WN=Wf(Gf),Kf=(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,c,a=!1,u=async(d)=>{if(!i)i=s(d);try{o=await i,c=!0,a=!1}finally{i=void 0}return o};if(r===void 0)return async(d)=>{if(!c||d?.forceRefresh)o=await u(d);return o};return async(d)=>{if(!c||d?.forceRefresh)o=await u(d);if(a)return o;if(!n(o))return a=!0,o;if(r(o))return await u(d),o;return o}};KN.DefaultIdentityProviderConfig=zf;KN.EXPIRATION_MS=Gf;KN.HttpApiKeyAuthSigner=qf;KN.HttpBearerAuthSigner=Vf;KN.NoAuthSigner=jf;KN.createIsIdentityExpiredFunction=Wf;KN.createPaginator=qN;KN.doesIdentityRequireRefresh=Kf;KN.getHttpAuthSchemeEndpointRuleSetPlugin=FN;KN.getHttpAuthSchemePlugin=LN;KN.getHttpSigningPlugin=BN;KN.httpAuthSchemeEndpointRuleSetMiddlewareOptions=Uf;KN.httpAuthSchemeMiddleware=da;KN.httpAuthSchemeMiddlewareOptions=$f;KN.httpSigningMiddleware=Bf;KN.httpSigningMiddlewareOptions=Hf;KN.isIdentityExpired=WN;KN.memoizeIdentityProvider=GN;KN.normalizeProvider=HN;KN.setFeature=jN});var Qf=e(function(rn,la){(function(t,r){typeof rn=="object"&&typeof la=="object"?la.exports=r():typeof define=="function"&&define.amd?define([],r):typeof rn=="object"?rn.bowser=r():t.bowser=r()})(rn,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 c in s)n.d(i,c,function(a){return s[a]}.bind(null,c));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(c,a){var u=a.match(c);return u&&u.length>0&&u[1]||""},i.getSecondMatch=function(c,a){var u=a.match(c);return u&&u.length>1&&u[2]||""},i.matchAndReturnConst=function(c,a,u){if(c.test(a))return u},i.getWindowsVersionName=function(c){switch(c){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(c){var a=c.split(".").splice(0,2).map(function(f){return parseInt(f,10)||0});a.push(0);var u=a[0],d=a[1];if(u===10)switch(d){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(u){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(c){var a=c.split(".").splice(0,2).map(function(u){return parseInt(u,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(c){return c.split(".").length},i.compareVersions=function(c,a,u){u===void 0&&(u=!1);var d=i.getVersionPrecision(c),f=i.getVersionPrecision(a),l=Math.max(d,f),h=0,p=i.map([c,a],function(g){var m=l-i.getVersionPrecision(g),y=g+Array(m+1).join(".0");return i.map(y.split("."),function(S){return Array(20-S.length).join("0")+S}).reverse()});for(u&&(h=l-Math.min(d,f)),l-=1;l>=h;){if(p[0][l]>p[1][l])return 1;if(p[0][l]===p[1][l]){if(l===h)return 0;l-=1}else if(p[0][l]<p[1][l])return-1}},i.map=function(c,a){var u,d=[];if(Array.prototype.map)return Array.prototype.map.call(c,a);for(u=0;u<c.length;u+=1)d.push(a(c[u]));return d},i.find=function(c,a){var u,d;if(Array.prototype.find)return Array.prototype.find.call(c,a);for(u=0,d=c.length;u<d;u+=1){var f=c[u];if(a(f,u))return f}},i.assign=function(c){for(var a,u,d=c,f=arguments.length,l=Array(f>1?f-1:0),h=1;h<f;h++)l[h-1]=arguments[h];if(Object.assign)return Object.assign.apply(Object,[c].concat(l));var p=function(){var g=l[a];typeof g=="object"&&g!==null&&Object.keys(g).forEach(function(m){d[m]=g[m]})};for(a=0,u=l.length;a<u;a+=1)p();return c},i.getBrowserAlias=function(c){return s.BROWSER_ALIASES_MAP[c]},i.getBrowserTypeByAlias=function(c){return s.BROWSER_MAP[c]||""},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 c(u,d){for(var f=0;f<d.length;f++){var l=d[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(u,l.key,l)}}var a=function(){function u(){}var d,f,l;return u.getParser=function(h,p,g){if(p===void 0&&(p=!1),g===void 0&&(g=null),typeof h!="string")throw Error("UserAgent should be a string");return new o.default(h,p,g)},u.parse=function(h,p){return p===void 0&&(p=null),new o.default(h,p).getResult()},d=u,l=[{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}}],(f=null)&&c(d.prototype,f),l&&c(d,l),u}();r.default=a,t.exports=r.default},91:function(t,r,n){r.__esModule=!0,r.default=void 0;var s=u(n(92)),o=u(n(93)),i=u(n(94)),c=u(n(95)),a=u(n(17));function u(f){return f&&f.__esModule?f:{default:f}}var d=function(){function f(h,p,g){if(p===void 0&&(p=!1),g===void 0&&(g=null),h==null||h==="")throw Error("UserAgent parameter can't be empty");this._ua=h;var m=!1;typeof p=="boolean"?(m=p,this._hints=g):this._hints=p!=null&&typeof p=="object"?p:null,this.parsedResult={},m!==!0&&this.parse()}var l=f.prototype;return l.getHints=function(){return this._hints},l.hasBrand=function(h){if(!this._hints||!Array.isArray(this._hints.brands))return!1;var p=h.toLowerCase();return this._hints.brands.some(function(g){return g.brand&&g.brand.toLowerCase()===p})},l.getBrandVersion=function(h){if(this._hints&&Array.isArray(this._hints.brands)){var p=h.toLowerCase(),g=this._hints.brands.find(function(m){return m.brand&&m.brand.toLowerCase()===p});return g?g.version:void 0}},l.getUA=function(){return this._ua},l.test=function(h){return h.test(this._ua)},l.parseBrowser=function(){var h=this;this.parsedResult.browser={};var p=a.default.find(s.default,function(g){if(typeof g.test=="function")return g.test(h);if(Array.isArray(g.test))return g.test.some(function(m){return h.test(m)});throw Error("Browser's test function is not valid")});return p&&(this.parsedResult.browser=p.describe(this.getUA(),this)),this.parsedResult.browser},l.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},l.getBrowserName=function(h){return h?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},l.getBrowserVersion=function(){return this.getBrowser().version},l.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},l.parseOS=function(){var h=this;this.parsedResult.os={};var p=a.default.find(o.default,function(g){if(typeof g.test=="function")return g.test(h);if(Array.isArray(g.test))return g.test.some(function(m){return h.test(m)});throw Error("Browser's test function is not valid")});return p&&(this.parsedResult.os=p.describe(this.getUA())),this.parsedResult.os},l.getOSName=function(h){var p=this.getOS().name;return h?String(p).toLowerCase()||"":p||""},l.getOSVersion=function(){return this.getOS().version},l.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},l.getPlatformType=function(h){h===void 0&&(h=!1);var p=this.getPlatform().type;return h?String(p).toLowerCase()||"":p||""},l.parsePlatform=function(){var h=this;this.parsedResult.platform={};var p=a.default.find(i.default,function(g){if(typeof g.test=="function")return g.test(h);if(Array.isArray(g.test))return g.test.some(function(m){return h.test(m)});throw Error("Browser's test function is not valid")});return p&&(this.parsedResult.platform=p.describe(this.getUA())),this.parsedResult.platform},l.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},l.getEngineName=function(h){return h?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},l.parseEngine=function(){var h=this;this.parsedResult.engine={};var p=a.default.find(c.default,function(g){if(typeof g.test=="function")return g.test(h);if(Array.isArray(g.test))return g.test.some(function(m){return h.test(m)});throw Error("Browser's test function is not valid")});return p&&(this.parsedResult.engine=p.describe(this.getUA())),this.parsedResult.engine},l.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},l.getResult=function(){return a.default.assign({},this.parsedResult)},l.satisfies=function(h){var p=this,g={},m=0,y={},S=0;if(Object.keys(h).forEach(function(q){var j=h[q];typeof j=="string"?(y[q]=j,S+=1):typeof j=="object"&&(g[q]=j,m+=1)}),m>0){var w=Object.keys(g),_=a.default.find(w,function(q){return p.isOS(q)});if(_){var v=this.satisfies(g[_]);if(v!==void 0)return v}var L=a.default.find(w,function(q){return p.isPlatform(q)});if(L){var k=this.satisfies(g[L]);if(k!==void 0)return k}}if(S>0){var U=Object.keys(y),de=a.default.find(U,function(q){return p.isBrowser(q,!0)});if(de!==void 0)return this.compareVersion(y[de])}},l.isBrowser=function(h,p){p===void 0&&(p=!1);var g=this.getBrowserName().toLowerCase(),m=h.toLowerCase(),y=a.default.getBrowserTypeByAlias(m);return p&&y&&(m=y.toLowerCase()),m===g},l.compareVersion=function(h){var p=[0],g=h,m=!1,y=this.getBrowserVersion();if(typeof y=="string")return h[0]===">"||h[0]==="<"?(g=h.substr(1),h[1]==="="?(m=!0,g=h.substr(2)):p=[],h[0]===">"?p.push(1):p.push(-1)):h[0]==="="?g=h.substr(1):h[0]==="~"&&(m=!0,g=h.substr(1)),p.indexOf(a.default.compareVersions(y,g,m))>-1},l.isOS=function(h){return this.getOSName(!0)===String(h).toLowerCase()},l.isPlatform=function(h){return this.getPlatformType(!0)===String(h).toLowerCase()},l.isEngine=function(h){return this.getEngineName(!0)===String(h).toLowerCase()},l.is=function(h,p){return p===void 0&&(p=!1),this.isBrowser(h,p)||this.isOS(h)||this.isPlatform(h)},l.some=function(h){var p=this;return h===void 0&&(h=[]),h.some(function(g){return p.is(g)})},f}();r.default=d,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,c=[{test:[/gptbot/i],describe:function(a){var u={name:"GPTBot"},d=o.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/chatgpt-user/i],describe:function(a){var u={name:"ChatGPT-User"},d=o.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/oai-searchbot/i],describe:function(a){var u={name:"OAI-SearchBot"},d=o.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(a){var u={name:"ClaudeBot"},d=o.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(a){var u={name:"Omgilibot"},d=o.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/diffbot/i],describe:function(a){var u={name:"Diffbot"},d=o.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/perplexitybot/i],describe:function(a){var u={name:"PerplexityBot"},d=o.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/perplexity-user/i],describe:function(a){var u={name:"Perplexity-User"},d=o.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/youbot/i],describe:function(a){var u={name:"YouBot"},d=o.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/meta-webindexer/i],describe:function(a){var u={name:"Meta-WebIndexer"},d=o.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/meta-externalads/i],describe:function(a){var u={name:"Meta-ExternalAds"},d=o.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/meta-externalagent/i],describe:function(a){var u={name:"Meta-ExternalAgent"},d=o.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/meta-externalfetcher/i],describe:function(a){var u={name:"Meta-ExternalFetcher"},d=o.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/googlebot/i],describe:function(a){var u={name:"Googlebot"},d=o.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/linespider/i],describe:function(a){var u={name:"Linespider"},d=o.default.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/amazonbot/i],describe:function(a){var u={name:"AmazonBot"},d=o.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/bingbot/i],describe:function(a){var u={name:"BingCrawler"},d=o.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/baiduspider/i],describe:function(a){var u={name:"BaiduSpider"},d=o.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/duckduckbot/i],describe:function(a){var u={name:"DuckDuckBot"},d=o.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/ia_archiver/i],describe:function(a){var u={name:"InternetArchiveCrawler"},d=o.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{name:"FacebookExternalHit"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(a){var u={name:"SlackBot"},d=o.default.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{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 u={name:"Opera"},d=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/opr\/|opios/i],describe:function(a){var u={name:"Opera"},d=o.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/SamsungBrowser/i],describe:function(a){var u={name:"Samsung Internet for Android"},d=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/Whale/i],describe:function(a){var u={name:"NAVER Whale Browser"},d=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/PaleMoon/i],describe:function(a){var u={name:"Pale Moon"},d=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/MZBrowser/i],describe:function(a){var u={name:"MZ Browser"},d=o.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/focus/i],describe:function(a){var u={name:"Focus"},d=o.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/swing/i],describe:function(a){var u={name:"Swing"},d=o.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/coast/i],describe:function(a){var u={name:"Opera Coast"},d=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(a){var u={name:"Opera Touch"},d=o.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/yabrowser/i],describe:function(a){var u={name:"Yandex Browser"},d=o.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/ucbrowser/i],describe:function(a){var u={name:"UC Browser"},d=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/Maxthon|mxios/i],describe:function(a){var u={name:"Maxthon"},d=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/epiphany/i],describe:function(a){var u={name:"Epiphany"},d=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/puffin/i],describe:function(a){var u={name:"Puffin"},d=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/sleipnir/i],describe:function(a){var u={name:"Sleipnir"},d=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/k-meleon/i],describe:function(a){var u={name:"K-Meleon"},d=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/micromessenger/i],describe:function(a){var u={name:"WeChat"},d=o.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/qqbrowser/i],describe:function(a){var u={name:/qqbrowserlite/i.test(a)?"QQ Browser Lite":"QQ Browser"},d=o.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/msie|trident/i],describe:function(a){var u={name:"Internet Explorer"},d=o.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/\sedg\//i],describe:function(a){var u={name:"Microsoft Edge"},d=o.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/edg([ea]|ios)/i],describe:function(a){var u={name:"Microsoft Edge"},d=o.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/vivaldi/i],describe:function(a){var u={name:"Vivaldi"},d=o.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/seamonkey/i],describe:function(a){var u={name:"SeaMonkey"},d=o.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/sailfish/i],describe:function(a){var u={name:"Sailfish"},d=o.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,a);return d&&(u.version=d),u}},{test:[/silk/i],describe:function(a){var u={name:"Amazon Silk"},d=o.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/phantom/i],describe:function(a){var u={name:"PhantomJS"},d=o.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/slimerjs/i],describe:function(a){var u={name:"SlimerJS"},d=o.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(a){var u={name:"BlackBerry"},d=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/(web|hpw)[o0]s/i],describe:function(a){var u={name:"WebOS Browser"},d=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/bada/i],describe:function(a){var u={name:"Bada"},d=o.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/tizen/i],describe:function(a){var u={name:"Tizen"},d=o.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/qupzilla/i],describe:function(a){var u={name:"QupZilla"},d=o.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/librewolf/i],describe:function(a){var u={name:"LibreWolf"},d=o.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/firefox|iceweasel|fxios/i],describe:function(a){var u={name:"Firefox"},d=o.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/electron/i],describe:function(a){var u={name:"Electron"},d=o.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(a){var u={name:"Sogou Browser"},d=o.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,a),f=o.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,a),l=o.default.getFirstMatch(/se ([\d.]+)x/i,a),h=d||f||l;return h&&(u.version=h),u}},{test:[/MiuiBrowser/i],describe:function(a){var u={name:"Miui"},d=o.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:function(a){return!!a.hasBrand("DuckDuckGo")||a.test(/\sDdg\/[\d.]+$/i)},describe:function(a,u){var d={name:"DuckDuckGo"};if(u){var f=u.getBrandVersion("DuckDuckGo");if(f)return d.version=f,d}var l=o.default.getFirstMatch(/\sDdg\/([\d.]+)$/i,a);return l&&(d.version=l),d}},{test:function(a){return a.hasBrand("Brave")},describe:function(a,u){var d={name:"Brave"};if(u){var f=u.getBrandVersion("Brave");if(f)return d.version=f,d}return d}},{test:[/chromium/i],describe:function(a){var u={name:"Chromium"},d=o.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/chrome|crios|crmo/i],describe:function(a){var u={name:"Chrome"},d=o.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/GSA/i],describe:function(a){var u={name:"Google Search"},d=o.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:function(a){var u=!a.test(/like android/i),d=a.test(/android/i);return u&&d},describe:function(a){var u={name:"Android Browser"},d=o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/playstation 4/i],describe:function(a){var u={name:"PlayStation 4"},d=o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/safari|applewebkit/i],describe:function(a){var u={name:"Safari"},d=o.default.getFirstMatch(i,a);return d&&(u.version=d),u}},{test:[/.*/i],describe:function(a){var u=a.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:o.default.getFirstMatch(u,a),version:o.default.getSecondMatch(u,a)}}}];r.default=c,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),c=[{test:[/Roku\/DVP/],describe:function(a){var u=o.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,a);return{name:i.OS_MAP.Roku,version:u}}},{test:[/windows phone/i],describe:function(a){var u=o.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.WindowsPhone,version:u}}},{test:[/windows /i],describe:function(a){var u=o.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,a),d=o.default.getWindowsVersionName(u);return{name:i.OS_MAP.Windows,version:u,versionName:d}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(a){var u={name:i.OS_MAP.iOS},d=o.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,a);return d&&(u.version=d),u}},{test:[/macintosh/i],describe:function(a){var u=o.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,a).replace(/[_\s]/g,"."),d=o.default.getMacOSVersionName(u),f={name:i.OS_MAP.MacOS,version:u};return d&&(f.versionName=d),f}},{test:[/(ipod|iphone|ipad)/i],describe:function(a){var u=o.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,a).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:u}}},{test:[/OpenHarmony/i],describe:function(a){var u=o.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.HarmonyOS,version:u}}},{test:function(a){var u=!a.test(/like android/i),d=a.test(/android/i);return u&&d},describe:function(a){var u=o.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,a),d=o.default.getAndroidVersionName(u),f={name:i.OS_MAP.Android,version:u};return d&&(f.versionName=d),f}},{test:[/(web|hpw)[o0]s/i],describe:function(a){var u=o.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,a),d={name:i.OS_MAP.WebOS};return u&&u.length&&(d.version=u),d}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(a){var u=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:u}}},{test:[/bada/i],describe:function(a){var u=o.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.Bada,version:u}}},{test:[/tizen/i],describe:function(a){var u=o.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.Tizen,version:u}}},{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 u=o.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.PlayStation4,version:u}}}];r.default=c,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),c=[{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 u=o.default.getFirstMatch(/(can-l01)/i,a)&&"Nova",d={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return u&&(d.model=u),d}},{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 u=a.test(/ipod|iphone/i),d=a.test(/like (ipod|iphone)/i);return u&&!d},describe:function(a){var u=o.default.getFirstMatch(/(ipod|iphone)/i,a);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:u}}},{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 u=o.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,a),d={type:i.PLATFORMS_MAP.mobile,vendor:"Nokia"};return u&&(d.model=u),d}},{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 u=Number(String(a.getOSVersion()).split(".")[0]);return a.getOSName(!0)==="android"&&u>=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=c,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),c=[{test:function(a){return a.getBrowserName(!0)==="microsoft edge"},describe:function(a){if(/\sedg\//i.test(a))return{name:i.ENGINE_MAP.Blink};var u=o.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,a);return{name:i.ENGINE_MAP.EdgeHTML,version:u}}},{test:[/trident/i],describe:function(a){var u={name:i.ENGINE_MAP.Trident},d=o.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:function(a){return a.test(/presto/i)},describe:function(a){var u={name:i.ENGINE_MAP.Presto},d=o.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:function(a){var u=a.test(/gecko/i),d=a.test(/like gecko/i);return u&&!d},describe:function(a){var u={name:i.ENGINE_MAP.Gecko},d=o.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(a){var u={name:i.ENGINE_MAP.WebKit},d=o.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,a);return d&&(u.version=d),u}}];r.default=c,t.exports=r.default}})})});var he=e(function(lP){var{Retry:yO,RETRY_MODES:Xf}=ut(),{HttpRequest:ya,parseUrl:SO}=Y(),{InvokeStore:Yf}=Ff(),{normalizeProvider:wO}=nt(),{platform:EO,release:bO}=I("node:os"),{versions:fa,env:Jf}=I("node:process"),{isValidHostLabel:_O,isIpAddress:nh,customEndpointFunctions:AO}=Je(),{EndpointError:xO,resolveEndpoint:TO}=Je();lP.EndpointError=xO;lP.isIpAddress=nh;lP.resolveEndpoint=TO;var{loadConfig:CO,NODE_REGION_CONFIG_OPTIONS:sh,NODE_REGION_CONFIG_FILE_OPTIONS:oh}=Z(),{REGION_ENV_NAME:IO,REGION_INI_NAME:RO,resolveRegionConfig:vO}=Z();lP.NODE_REGION_CONFIG_FILE_OPTIONS=oh;lP.NODE_REGION_CONFIG_OPTIONS=sh;lP.REGION_ENV_NAME=IO;lP.REGION_INI_NAME=RO;lP.resolveRegionConfig=vO;var ys={warningEmitted:!1},NO=(t)=>{if(t&&!ys.warningEmitted){if(process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED==="true"){ys.warningEmitted=!0;return}let r=parseInt(t.substring(1,t.indexOf("."))),n=22;if(r<n)ys.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 ih=(t)=>(r)=>async(n)=>{if(!ya.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)},ah={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},LO=(t)=>({applyToStack:(r)=>{r.add(ih(t),ah)}}),ch=()=>(t,r)=>async(n)=>{try{let s=await t(n),{clientName:o,commandName:i,logger:c,dynamoDbDocumentClientOptions:a={}}=r,{overrideInputFilterSensitiveLog:u,overrideOutputFilterSensitiveLog:d}=a,f=u??r.inputFilterSensitiveLog,l=d??r.outputFilterSensitiveLog,{$metadata:h,...p}=s.output;return c?.info?.({clientName:o,commandName:i,input:f(n.input),output:l(p),metadata:h}),s}catch(s){let{clientName:o,commandName:i,logger:c,dynamoDbDocumentClientOptions:a={}}=r,{overrideInputFilterSensitiveLog:u}=a,d=u??r.inputFilterSensitiveLog;throw c?.error?.({clientName:o,commandName:i,input:d(n.input),error:s,metadata:s.$metadata}),s}},uh={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},UO=(t)=>({applyToStack:(r)=>{r.add(ch(),uh)}}),dh={step:"build",tags:["RECURSION_DETECTION","TRACE_CONTEXT_PROPAGATION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},$O="AWS_LAMBDA_FUNCTION_NAME",BO="_X_AMZN_TRACE_ID",ha="X-Amzn-Trace-Id",ma="traceparent",lh="tracestate",fh="baggage",hh=()=>(t)=>async(r)=>{let{request:n}=r;if(!ya.isInstance(n))return t(r);let s;{let o=Object.keys(n.headers??{}).find((i)=>i.toLowerCase()===ha.toLowerCase())??ha;if(!n.headers.hasOwnProperty(o)){let i=process.env[$O],c=process.env[BO];s??=await Yf.getInstanceAsync();let u=s?.getXRayTraceId()??c,d=(f)=>typeof f==="string"&&f.length>0;if(d(i)&&d(u))n.headers[ha]=u}}if(HO(n.headers),!n.headers[ma]){let i=(s??=await Yf.getInstanceAsync())?.getTraceparent?.();if(i){n.headers[ma]=i;let c=s?.getTracestate?.();if(c)n.headers[lh]=c;let a=s?.getBaggage?.();if(a)n.headers[fh]=a}}return t(r)};function HO(t){for(let r of Object.keys(t)){let n=r.toLowerCase();if(r!==n&&(n===ma||n===lh||n===fh))t[n]=t[r],delete t[r]}}var zO=(t)=>({applyToStack:(r)=>{r.add(hh(),dh)}}),Sa=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??Sa),{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 ph={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"},gh=ph,mh="",yh=(t)=>{let{partitions:r}=gh;for(let s of r){let{regions:o,outputs:i}=s;for(let[c,a]of Object.entries(o))if(c===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}},Sh=(t,r="")=>{gh=t,mh=r},jO=()=>{Sh(ph,"")},wh=()=>mh,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 Xf.ADAPTIVE:Ue(t,"RETRY_MODE_ADAPTIVE","F");break;case Xf.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[c,a]of Object.entries(i.$source??{}))Ue(t,c,a)}}var Zf="user-agent",pa="x-amz-user-agent",eh=" ",ga="/",KO=/[^!$%&'*+\-.^_`|~\w]/g,QO=/[^!$%&'*+\-.^_`|~\w#]/g,th="-",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 Eh=(t)=>(r,n)=>async(s)=>{let{request:o}=s;if(!ya.isInstance(o))return r(s);let{headers:i}=o,c=n?.userAgent?.map(ms)||[],a=(await t.defaultUserAgentProvider()).map(ms);await GO(n,t,s);let u=n;a.push(`m/${YO(Object.assign({},n.__smithy_context?.features,u.__aws_sdk_context?.features))}`);let d=t?.customUserAgent?.map(ms)||[],f=await t.userAgentAppId();if(f)a.push(ms(["app",`${f}`]));let l=wh(),h=(l?[l]:[]).concat([...a,...c,...d]).join(eh),p=[...a.filter((g)=>g.startsWith("aws-sdk-")),...d].join(eh);if(t.runtime!=="browser"){if(p)i[pa]=i[pa]?`${i[Zf]} ${p}`:p;i[Zf]=h}else i[pa]=h;return r({...s,request:o})},ms=(t)=>{let r=t[0].split(ga).map((c)=>c.replace(KO,th)).join(ga),n=t[1]?.replace(QO,th),s=r.indexOf(ga),o=r.substring(0,s),i=r.substring(s+1);if(o==="api")i=i.toLowerCase();return[o,i,n].filter((c)=>c&&c.length>0).reduce((c,a,u)=>{switch(u){case 0:return a;case 1:return`${c}/${a}`;default:return`${c}#${a}`}},"")},bh={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},JO=(t)=>({applyToStack:(r)=>{r.add(Eh(t),bh)}}),ZO=()=>{let t=["deno","bun","llrt"];for(let r of t)if(fa[r])return[`md/${r}`,fa[r]];return["md/nodejs",fa.node]},_h={isCrtAvailable:!1},eP=()=>{if(_h.isCrtAvailable)return["md/crt-avail"];return null},Ah=({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(Jf.AWS_EXECUTION_ENV)o.push([`exec-env/${Jf.AWS_EXECUTION_ENV}`]);let c=await s?.userAgentAppId?.();return c?[...o,[`app/${c}`]]:[...o]}},tP=Ah,xh="AWS_SDK_UA_APP_ID",Th="sdk_ua_app_id",rP="sdk-ua-app-id",nP={environmentVariableSelector:(t)=>t[xh],configFileSelector:(t)=>t[Th]??t[rP],default:Sa},sP=({serviceId:t,clientVersion:r})=>async(n)=>{let s=Qf(),o=s.parse??s.default.parse??(()=>""),i=typeof window<"u"&&window?.navigator?.userAgent?o(window.navigator.userAgent):void 0,c=[["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)c.push([`api/${t}`,r]);let a=await n?.userAgentAppId?.();if(a)c.push([`app/${a}`]);return c},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}},wa=(t,r=!1)=>{if(r){for(let n of t.split("."))if(!wa(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(nh(t))return!1;return!0},rh=":",iP="/",Ch=(t)=>{let r=t.split(rh);if(r.length<6)return null;let[n,s,o,i,c,...a]=r;if(n!=="arn"||s===""||o===""||a.join(rh)==="")return null;let u=a.map((d)=>d.split(iP)).flat();return{partition:s,service:o,region:i,accountId:c,resourceId:u}},Ih={isVirtualHostableS3Bucket:wa,parseArn:Ch,partition:yh};AO.aws=Ih;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()=>Rh(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},Rh=(t)=>SO(t.url);function cP(t={}){return CO({...sh,async default(){if(!vh.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"}},{...oh,...t})}var vh={silence:!1},uP=(t)=>({setRegion(r){t.region=r},region(){return t.region}}),dP=(t)=>({region:t.region()});lP.DEFAULT_UA_APP_ID=Sa;lP.NODE_APP_ID_CONFIG_OPTIONS=nP;lP.UA_APP_ID_ENV_NAME=xh;lP.UA_APP_ID_INI_NAME=Th;lP.awsEndpointFunctions=Ih;lP.createDefaultUserAgentProvider=Ah;lP.createUserAgentStringParsingProvider=sP;lP.crtAvailability=_h;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=bh;lP.getUserAgentPlugin=JO;lP.getUserAgentPrefix=wh;lP.hostHeaderMiddleware=ih;lP.hostHeaderMiddlewareOptions=ah;lP.isVirtualHostableS3Bucket=wa;lP.loggerMiddleware=ch;lP.loggerMiddlewareOptions=uh;lP.parseArn=Ch;lP.partition=yh;lP.recursionDetectionMiddleware=hh;lP.recursionDetectionMiddlewareOptions=dh;lP.resolveAwsRegionExtensionConfiguration=dP;lP.resolveDefaultAwsRegionalEndpointsConfig=aP;lP.resolveHostHeaderConfig=FO;lP.resolveUserAgentConfig=VO;lP.setCredentialFeature=MO;lP.setFeature=Ue;lP.setPartitionInfo=Sh;lP.setTokenFeature=DO;lP.state=ys;lP.stsRegionDefaultResolver=cP;lP.stsRegionWarning=vh;lP.toEndpointV1=Rh;lP.useDefaultPartitionInfo=jO;lP.userAgentMiddleware=Eh});var $A=e(function(dk){var{HttpRequest:Nh}=Y();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 Oh=(t)=>(r,n)=>async(s)=>{let{request:o}=s;if(!Nh.isInstance(o))return r(s);return t.eventStreamPayloadHandler.handle(r,s,n)},Ph={tags:["EVENT_STREAM","SIGNATURE","HANDLE"],name:"eventStreamHandlingMiddleware",relation:"after",toMiddleware:"awsAuthMiddleware",override:!0},kh=(t)=>async(r)=>{let{request:n}=r;if(!Nh.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})},Mh={step:"build",tags:["EVENT_STREAM","HEADER","CONTENT_TYPE","CONTENT_SHA256"],name:"eventStreamHeaderMiddleware",override:!0},uk=(t)=>({applyToStack:(r)=>{r.addRelativeTo(Oh(t),Ph),r.add(kh,Mh)}});dk.eventStreamHandlingMiddleware=Oh;dk.eventStreamHandlingMiddlewareOptions=Ph;dk.eventStreamHeaderMiddleware=kh;dk.eventStreamHeaderMiddlewareOptions=Mh;dk.getEventStreamPlugin=uk;dk.resolveEventStreamConfig=ck});var Na=e(function(Rk){var{hasOwn:dr,fromUtf8:Dh,fromHex:yk,toHex:kt,toUint8Array:nn,isArrayBuffer:Sk}=Ae(),{normalizeProvider:Fh}=ue(),{escapeUri:Ss,HttpRequest:Bh}=Y();class Hh{format(t){let r=[];for(let o in t){if(!dr(t,o))continue;let i=Dh(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 c=Dh(t.value),a=new DataView(new ArrayBuffer(3+c.byteLength));a.setUint8(0,7),a.setUint16(1,c.byteLength,!1);let u=new Uint8Array(a.buffer);return u.set(c,3),u;case"timestamp":let d=new Uint8Array(9);return d[0]=8,d.set(_a.fromNumber(t.value.valueOf()).bytes,1),d;case"uuid":if(!wk.test(t.value))throw Error(`Invalid UUID received: ${t.value}`);let f=new Uint8Array(17);return f[0]=9,f.set(yk(t.value.replace(/-/g,"")),1),f}}}var Lh;(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"})(Lh||(Lh={}));var wk=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class _a{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)Uh(r);return new _a(r)}valueOf(){let t=this.bytes.slice(0),r=t[0]&128;if(r)Uh(t);return parseInt(kt(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function Uh(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 zh="X-Amz-Algorithm",qh="X-Amz-Credential",Aa="X-Amz-Date",Vh="X-Amz-SignedHeaders",jh="X-Amz-Expires",xa="X-Amz-Signature",Ta="X-Amz-Security-Token",Ek="X-Amz-Region-Set",Ca="authorization",Ia=Aa.toLowerCase(),Wh="date",Gh=[Ca,Ia,Wh],Kh=xa.toLowerCase(),As="x-amz-content-sha256",Qh=Ta.toLowerCase(),bk="host",Xh={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},Yh=/^proxy-/,Jh=/^sec-/,_k=[/^proxy-/i,/^sec-/i],ws="AWS4-HMAC-SHA256",Ak="AWS4-ECDSA-P256-SHA256",Zh="AWS4-HMAC-SHA256-PAYLOAD",ep="UNSIGNED-PAYLOAD",tp=50,Ra="aws4_request",rp=604800,np=({query:t={}})=>{let r=[],n={};for(let s in t){if(!dr(t,s))continue;if(s.toLowerCase()===Kh)continue;let o=Ss(s);r.push(o);let i=t[s];if(typeof i==="string")n[o]=`${o}=${Ss(i)}`;else if(Array.isArray(i))n[o]=i.slice(0).reduce((c,a)=>c.concat([`${o}=${Ss(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 va{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=Fh(n),this.credentialProvider=Fh(r)}createCanonicalRequest(t,r,n){let s=Object.keys(r).sort();return`${t.method}
26
+ ${this.getCanonicalPath(t)}
27
+ ${np(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(nn(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 Ss(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={},Es=[],bs=(t,r,n)=>`${t}/${r}/${n}/${Ra}`,sp=async(t,r,n,s,o)=>{let i=await $h(t,r.secretAccessKey,r.accessKeyId),c=`${n}:${s}:${o}:${kt(i)}:${r.sessionToken}`;if(c in ur)return ur[c];Es.push(c);while(Es.length>tp)delete ur[Es.shift()];let a=`AWS4${r.secretAccessKey}`;for(let u of[n,s,o,Ra])a=await $h(t,a,u);return ur[c]=a},Ck=()=>{Es.length=0,Object.keys(ur).forEach((t)=>{delete ur[t]})},$h=(t,r,n)=>{let s=new t(r);return s.update(nn(n)),s.digest()},Ea=({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 Xh||r?.has(i)||Yh.test(i)||Jh.test(i)){if(!n||n&&!n.has(i))continue}s[i]=t[o].replace(/[\r\n]/g," ").replace(/[ \t]+/g," ").replace(/^ | $/g,"")}return s},_s=async({headers:t,body:r},n)=>{for(let s in t){if(!dr(t,s))continue;if(s.toLowerCase()===As)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(nn(r)),kt(await s.digest())}return ep},op=(t,r)=>{t=t.toLowerCase();for(let n in r){if(!dr(r,n))continue;if(t===n.toLowerCase())return!0}return!1},ip=(t,r={})=>{let{headers:n,query:s={}}=Bh.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}},ba=(t)=>{t=Bh.clone(t);for(let r in t.headers){if(!dr(t.headers,r))continue;if(Gh.indexOf(r.toLowerCase())>-1)delete t.headers[r]}return t};class ap extends va{headerFormatter=new Hh;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:c,hoistableHeaders:a,signingRegion:u,signingService:d}=r,f=await this.credentialProvider();this.validateResolvedCredentials(f);let l=u??await this.regionProvider(),{longDate:h,shortDate:p}=this.formatDate(n);if(s>rp)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");let g=bs(p,l,d??this.service),m=ip(ba(t),{unhoistableHeaders:i,hoistableHeaders:a});if(f.sessionToken)m.query[Ta]=f.sessionToken;m.query[zh]=ws,m.query[qh]=`${f.accessKeyId}/${g}`,m.query[Aa]=h,m.query[jh]=s.toString(10);let y=Ea(m,o,c);return m.query[Vh]=this.getCanonicalHeaderList(y),m.query[xa]=await this.getSignature(h,g,this.getSigningKey(f,l,p,d),this.createCanonicalRequest(m,y,await _s(t,this.sha256))),m}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:c}){let a=o??await this.regionProvider(),{shortDate:u,longDate:d}=this.formatDate(n),f=bs(u,a,i??this.service),l=await _s({headers:{},body:r},this.sha256),h=new this.sha256;h.update(t);let p=kt(await h.digest()),g=[Zh,d,f,s,p,l].join(`
36
+ `);return this.signString(g,{signingDate:n,signingRegion:a,signingService:i,eventStreamCredentials:c})}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((c)=>({message:t.message,signature:c}))}async signString(t,{signingDate:r=new Date,signingRegion:n,signingService:s,eventStreamCredentials:o}={}){let i=o??await this.credentialProvider();this.validateResolvedCredentials(i);let c=n??await this.regionProvider(),{shortDate:a}=this.formatDate(r),u=new this.sha256(await this.getSigningKey(i,c,a,s));return u.update(nn(t)),kt(await u.digest())}async signRequest(t,{signingDate:r=new Date,signableHeaders:n,unsignableHeaders:s,signingRegion:o,signingService:i}={}){let c=await this.credentialProvider();this.validateResolvedCredentials(c);let a=o??await this.regionProvider(),u=ba(t),{longDate:d,shortDate:f}=this.formatDate(r),l=bs(f,a,i??this.service);if(u.headers[Ia]=d,c.sessionToken)u.headers[Qh]=c.sessionToken;let h=await _s(u,this.sha256);if(!op(As,u.headers)&&this.applyChecksum)u.headers[As]=h;let p=Ea(u,s,n),g=await this.getSignature(d,l,this.getSigningKey(c,a,f,i),this.createCanonicalRequest(u,p,h));return u.headers[Ca]=`${ws} Credential=${c.accessKeyId}/${l}, SignedHeaders=${this.getCanonicalHeaderList(p)}, Signature=${g}`,u}async getSignature(t,r,n,s){let o=await this.createStringToSign(t,r,s,ws),i=new this.sha256(await n);return i.update(nn(o)),kt(await i.digest())}getSigningKey(t,r,n,s){return sp(this.sha256,t,n,r,s||this.service)}}var Ik={SignatureV4a:null};Rk.ALGORITHM_IDENTIFIER=ws;Rk.ALGORITHM_IDENTIFIER_V4A=Ak;Rk.ALGORITHM_QUERY_PARAM=zh;Rk.ALWAYS_UNSIGNABLE_HEADERS=Xh;Rk.AMZ_DATE_HEADER=Ia;Rk.AMZ_DATE_QUERY_PARAM=Aa;Rk.AUTH_HEADER=Ca;Rk.CREDENTIAL_QUERY_PARAM=qh;Rk.DATE_HEADER=Wh;Rk.EVENT_ALGORITHM_IDENTIFIER=Zh;Rk.EXPIRES_QUERY_PARAM=jh;Rk.GENERATED_HEADERS=Gh;Rk.HOST_HEADER=bk;Rk.KEY_TYPE_IDENTIFIER=Ra;Rk.MAX_CACHE_SIZE=tp;Rk.MAX_PRESIGNED_TTL=rp;Rk.PROXY_HEADER_PATTERN=Yh;Rk.REGION_SET_PARAM=Ek;Rk.SEC_HEADER_PATTERN=Jh;Rk.SHA256_HEADER=As;Rk.SIGNATURE_HEADER=Kh;Rk.SIGNATURE_QUERY_PARAM=xa;Rk.SIGNED_HEADERS_QUERY_PARAM=Vh;Rk.SignatureV4=ap;Rk.SignatureV4Base=va;Rk.TOKEN_HEADER=Qh;Rk.TOKEN_QUERY_PARAM=Ta;Rk.UNSIGNABLE_PATTERNS=_k;Rk.UNSIGNED_PAYLOAD=ep;Rk.clearCredentialCache=Ck;Rk.createScope=bs;Rk.getCanonicalHeaders=Ea;Rk.getCanonicalQuery=np;Rk.getPayloadHash=_s;Rk.getSigningKey=sp;Rk.hasHeader=op;Rk.moveHeadersToQuery=ip;Rk.prepareRequest=ba;Rk.signatureV4aContainer=Ik});var ot=e(function(O1){var{ProviderError:cp,booleanSelector:up,SelectorType:dp,loadConfig:p1}=Z(),{setCredentialFeature:g1}=he(),{normalizeProvider:lr,memoizeIdentityProvider:m1,isIdentityExpired:y1,doesIdentityRequireRefresh:S1}=nt(),{SignatureV4:lp}=Na(),{HttpResponse:Sp,HttpRequest:wp}=Y(),fp=(t)=>Sp.isInstance(t)?t.headers?.date??t.headers?.Date:void 0,hp=(t)=>Sp.isInstance(t)?t.headers?.age??t.headers?.Age:void 0,Ep=(t)=>new Date(Date.now()+t),pp=(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},sn=(t,r)=>{if(!r)throw Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);return r},Oa=async(t)=>{let r=sn("context",t.context),n=sn("config",t.config),s=r.endpointV2?.properties?.authSchemes?.[0],i=await sn("signer",n.signer)(s),c=t?.signingRegion,a=t?.signingRegionSet,u=t?.signingName;return{config:n,signer:i,signingRegion:c,signingRegionSet:a,signingName:u}};class xs{async sign(t,r,n){if(!wp.isInstance(t))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let s=await Oa(n),{config:o,signer:i}=s,{signingRegion:c,signingName:a}=s,u=n.context;if(u?.authSchemes?.length??!1){let[l,h]=u.authSchemes;if(l?.name==="sigv4a"&&h?.name==="sigv4")c=h?.signingRegion??c,a=h?.signingName??a}let d=await o.disableClockSkewCorrection?.()===!0;if(n._disableClockSkewCorrection=d,!d)n._preRequestSystemClockOffset=o.systemClockOffset,n._requestSentAt=Date.now();return await i.sign(t,{signingDate:d?new Date:Ep(o.systemClockOffset),signingRegion:c,signingService:a})}errorHandler(t){return(r)=>{let n=r;if(!t._disableClockSkewCorrection){let s=n.ServerTime??fp(n.$response);if(s){let o=sn("config",t.config),{_preRequestSystemClockOffset:i,_requestSentAt:c}=t,a=hp(n.$response),u=pp(s,o.systemClockOffset,c,a);if(o.systemClockOffset=u,Math.abs(u)>=240000&&(u!==i||i!==void 0&&i!==u)&&n.$metadata)n.$metadata.clockSkewCorrected=!0}}throw r}}successHandler(t,r){if(r._disableClockSkewCorrection)return;let n=fp(t);if(n){let s=sn("config",r.config),o=r._requestSentAt,i=hp(t);s.systemClockOffset=pp(n,s.systemClockOffset,o,i)}}}var w1=xs;class bp extends xs{async sign(t,r,n){if(!wp.isInstance(t))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let{config:s,signer:o,signingRegion:i,signingRegionSet:c,signingName:a}=await Oa(n),d=(await s.sigv4aSigningRegionSet?.()??c??[i]).join(","),f=await s.disableClockSkewCorrection?.()===!0;if(n._disableClockSkewCorrection=f,!f)n._preRequestSystemClockOffset=s.systemClockOffset,n._requestSentAt=Date.now();return await o.sign(t,{signingDate:f?new Date:Ep(s.systemClockOffset),signingRegion:d,signingService:a})}}var gp=(t)=>typeof t==="string"&&t.length>0?t.split(",").map((r)=>r.trim()):[],_p=(t)=>`AWS_BEARER_TOKEN_${t.replace(/[\s-]/g,"_").toUpperCase()}`,mp="AWS_AUTH_SCHEME_PREFERENCE",yp="auth_scheme_preference",E1={environmentVariableSelector:(t,r)=>{if(r?.signingName){if(_p(r.signingName)in t)return["httpBearerAuth"]}if(!(mp in t))return;return gp(t[mp])},configFileSelector:(t)=>{if(!(yp in t))return;return gp(t[yp])},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 cp("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 cp("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(f){if(f&&f!==n&&f!==o)s=!0;n=f;let l=x1(r,{credentials:n,credentialDefaultProvider:r.credentialDefaultProvider}),h=T1(r,l);if(s&&!h.attributed){let p=typeof n==="object"&&n!==null;o=async(g)=>{let y=await h(g);if(p&&(!y.$source||Object.keys(y.$source).length===0))return g1(y,"CREDENTIALS_CODE","e");return y},o.memoized=h.memoized,o.configBound=h.configBound,o.attributed=!0}else o=h},get(){return o},enumerable:!0,configurable:!0}),r.credentials=n;let{signingEscapePath:i=!0,systemClockOffset:c=r.systemClockOffset||0,sha256:a}=r,u;if(r.signer)u=lr(r.signer);else if(r.regionInfoProvider)u=()=>lr(r.region)().then(async(f)=>[await r.regionInfoProvider(f,{useFipsEndpoint:await r.useFipsEndpoint(),useDualstackEndpoint:await r.useDualstackEndpoint()})||{},f]).then(([f,l])=>{let{signingRegion:h,signingService:p}=f;r.signingRegion=r.signingRegion||h||l,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||lp)(g)});else u=async(f)=>{f=Object.assign({},{name:"sigv4",signingName:r.signingName||r.defaultSigningName,signingRegion:await lr(r.region)(),properties:{}},f);let l=f.signingRegion,h=f.signingName;r.signingRegion=r.signingRegion||l,r.signingName=r.signingName||h||r.serviceId;let p={...r,credentials:r.credentials,region:r.signingRegion,service:r.signingName,sha256:a,uriEscapePath:i};return new(r.signerConstructor||lp)(p)};return Object.assign(r,{systemClockOffset:c,signingEscapePath:i,signer:u,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)=>up(t,C1,dp.ENV),configFileSelector:(t)=>up(t,I1,dp.CONFIG),default:!1},v1=p1(R1),Ap=A1(v1),N1=Ap;O1.AWSSDKSigV4Signer=w1;O1.AwsSdkSigV4ASigner=bp;O1.AwsSdkSigV4Signer=xs;O1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS=E1;O1.NODE_SIGV4A_CONFIG_OPTIONS=_1;O1.getBearerTokenEnvKey=_p;O1.resolveAWSSDKSigV4Config=N1;O1.resolveAwsSdkSigV4AConfig=b1;O1.resolveAwsSdkSigV4Config=Ap;O1.validateSigningProperties=Oa});var Pa=e(function(j1){var{setCredentialFeature:z1}=he(),{CredentialsProviderError:q1}=Z(),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,c=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},...c&&{accountId:c}};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 Cs=e(function(xM){var{ProviderError:ka,CredentialsProviderError:at,loadConfig:La}=Z(),Ip=I("node:http"),{parseUrl:Z1}=Y(),Rp=(t)=>Boolean(t)&&typeof t==="object"&&typeof t.AccessKeyId==="string"&&typeof t.SecretAccessKey==="string"&&typeof t.Token==="string"&&typeof t.Expiration==="string",vp=(t)=>({accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:new Date(t.Expiration),...t.AccountId&&{accountId:t.AccountId}}),Ua=({maxRetries:t=0,timeout:r=1000})=>({maxRetries:t,timeout:r});function cn(t){return new Promise((r,n)=>{let s=Ip.request({method:"GET",...t,hostname:t.hostname?.replace(/^\[(.+)\]$/,"$1")});s.on("error",(o)=>{n(Object.assign(new ka("Unable to connect to instance metadata service"),o)),s.destroy()}),s.on("timeout",()=>{n(new ka("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 ka("Error response received from instance metadata service"),{statusCode:i})),s.destroy();let c=[];o.on("data",(a)=>{c.push(a)}),o.on("end",()=>{r(Buffer.concat(c)),s.destroy()})}),s.end()})}var Da=(t,r)=>{let n=t();for(let s=0;s<r;s++)n=n.catch(t);return n},on="AWS_CONTAINER_CREDENTIALS_FULL_URI",Ts="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",Fa="AWS_CONTAINER_AUTHORIZATION_TOKEN",eM=(t={})=>{let{timeout:r,maxRetries:n}=Ua(t);return()=>Da(async()=>{let s=await oM({logger:t.logger}),o=JSON.parse(await tM(r,s));if(!Rp(o))throw new at("Invalid response received from instance metadata service.",{logger:t.logger});return vp(o)},n)},tM=async(t,r)=>{if(process.env[Fa])r.headers={...r.headers,Authorization:process.env[Fa]};return(await cn({...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[Ts])return{hostname:rM,path:process.env[Ts]};if(process.env[on]){let r;try{r=new URL(process.env[on])}catch{throw new at(`${process.env[on]} 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 ${Ts} or ${on} environment variable is set`,{tryNextLink:!1,logger:t})};class $a extends at{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(t,r=!0){super(t,r);this.tryNextLink=r,Object.setPrototypeOf(this,$a.prototype)}}var an;(function(t){t.IPv4="http://169.254.169.254",t.IPv6="http://[fd00:ec2::254]"})(an||(an={}));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},Np=async()=>Z1(await fM()||await hM()),fM=async()=>La(cM)(),hM=async()=>{let t=await La(lM)();switch(t){case fr.IPv4:return an.IPv4;case fr.IPv6:return an.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",xp=(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=xp(o,n)}catch(i){if(s)n.warn("Credential renew failed: ",i),o=xp(s,n);else throw i}return s=o,o}},Op="/latest/meta-data/iam/security-credentials/",SM="/latest/api/token",Ma="AWS_EC2_METADATA_V1_DISABLED",Tp="ec2_metadata_v1_disabled",Cp="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}=Ua(t),c=async(a,u)=>{if(r||u.headers?.[Cp]==null){let l=!1,h=!1,p=await La({environmentVariableSelector:(g)=>{let m=g[Ma];if(h=!!m&&m!=="false",m===void 0)throw new at(`${Ma} not set in env, checking config file next.`,{logger:t.logger});return h},configFileSelector:(g)=>{let m=g[Tp];return l=!!m&&m!=="false",l},default:!1},{profile:s})();if(t.ec2MetadataV1Disabled||p){let g=[];if(t.ec2MetadataV1Disabled)g.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(l)g.push(`config file profile (${Tp})`);if(h)g.push(`process environment variable (${Ma})`);throw new $a(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${g.join(", ")}].`)}}let f=(await Da(async()=>{let l;try{l=await _M(u)}catch(h){if(h.statusCode===401)r=!1;throw h}return l},a)).trim();return Da(async()=>{let l;try{l=await AM(f,u,t)}catch(h){if(h.statusCode===401)r=!1;throw h}return l},a)};return async()=>{let a=await Np();if(r)return n?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),c(i,{...a,timeout:o});else{let u;try{u=(await bM({...a,timeout:o})).toString()}catch(d){if(d?.statusCode===400)throw Object.assign(d,{message:"EC2 Metadata token request returned error"});else if(d.message==="TimeoutError"||[403,404,405].includes(d.statusCode))r=!0;return n?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),c(i,{...a,timeout:o})}return c(i,{...a,headers:{[Cp]:u},timeout:o})}}},bM=async(t)=>cn({...t,path:SM,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),_M=async(t)=>(await cn({...t,path:Op})).toString(),AM=async(t,r,n)=>{let s=JSON.parse((await cn({...r,path:Op+t})).toString());if(!Rp(s))throw new at("Invalid response received from instance metadata service.",{logger:n.logger});return vp(s)};xM.DEFAULT_MAX_RETRIES=0;xM.DEFAULT_TIMEOUT=1000;xM.ENV_CMDS_AUTH_TOKEN=Fa;xM.ENV_CMDS_FULL_URI=on;xM.ENV_CMDS_RELATIVE_URI=Ts;xM.Endpoint=an;xM.fromContainerMetadata=eM;xM.fromInstanceMetadata=wM;xM.getInstanceMetadataEndpoint=Np;xM.httpRequest=cn;xM.providerConfigFromInit=Ua});var Et=e(function(GM){var{hasOwn:Lp}=Ae(),{streamCollector:FM}=Ae();GM.streamCollector=FM;var{buildQueryString:Up,HttpResponse:$p}=Y(),ct=I("node:https"),{Readable:LM}=I("node:stream"),un=I("node:http2");function Rs(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"],Bp=(t)=>{let r={};for(let n in t){if(!Lp(t,n))continue;let s=t[n];r[n]=Array.isArray(s)?s.join(","):s}return r},ee={setTimeout:(t,r)=>setTimeout(t,r),clearTimeout:(t)=>clearTimeout(t)},Pp=1000,$M=(t,r,n=0)=>{if(!n)return-1;let s=(o)=>{let i=ee.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),c=(a)=>{if(a?.connecting)a.on("connect",()=>{ee.clearTimeout(i)});else ee.clearTimeout(i)};if(t.socket)c(t.socket);else t.on("socket",c)};if(n<2000)return s(0),0;return ee.setTimeout(s.bind(null,Pp),Pp)},BM=(t,r,n=0,s,o)=>{if(n)return ee.setTimeout(()=>{let i=`@smithy/node-http-handler - [${s?"ERROR":"WARN"}] a request has exceeded the configured ${n} ms requestTimeout.`;if(s){let c=Object.assign(Error(i),{name:"TimeoutError",code:"ETIMEDOUT"});t.destroy(c),r(c)}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 ee.setTimeout(o,s)},kp=3000,qM=(t,r,n=0)=>{let s=(o)=>{let i=n-o,c=()=>{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,c),t.on("close",()=>t.socket?.removeListener("timeout",c));else t.setTimeout(i,c)};if(0<n&&n<6000)return s(0),0;return ee.setTimeout(s.bind(null,n===0?0:kp),kp)},Mp=6000;async function Hp(t,r,n=Mp,s=!1){let o=r.headers,i=o?o.Expect||o.expect:void 0,c=-1,a=!0;if(!s&&i==="100-continue")a=await Promise.race([new Promise((u)=>{c=Number(ee.setTimeout(()=>u(!0),Math.max(Mp,n)))}),new Promise((u)=>{t.on("continue",()=>{ee.clearTimeout(c),u(!0)}),t.on("response",()=>{ee.clearTimeout(c),u(!1)}),t.on("error",()=>{ee.clearTimeout(c),u(!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,Is=void 0,Dp=void 0;class vs{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(t){if(typeof t?.handle==="function")return t;return new vs(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 c=15000;if(Date.now()-c<r)return r;if(s&&o)for(let a in s){if(!Lp(s,a))continue;let u=s[a]?.length??0,d=o[a]?.length??0;if(u>=i&&d>=2*i)return n?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${d} 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((c,a)=>{let u=void 0,d=-1,f=-1,l=-1,h=-1,p=-1,g=()=>{ee.clearTimeout(d),ee.clearTimeout(f),ee.clearTimeout(l),ee.clearTimeout(h),ee.clearTimeout(p)},m=async(T)=>{await u,g(),c(T)},y=async(T)=>{await u,g(),a(T)};if(r?.aborted){let T=Rs(r);y(T);return}let S=t.headers,w=S?(S.Expect??S.expect)==="100-continue":!1,_=i?s.httpsAgent:s.httpAgent;if(w&&!this.externalAgent)_=new(i?ct.Agent:Is)({keepAlive:!1,maxSockets:1/0});d=ee.setTimeout(()=>{this.socketWarningTimestamp=vs.checkSocketUsage(_,this.socketWarningTimestamp,o)},s.socketAcquisitionWarningTimeout??(s.requestTimeout??2000)+(s.connectionTimeout??1000));let v=t.query?Up(t.query):"",L=void 0;if(t.username!=null||t.password!=null){let T=t.username??"",W=t.password??"";L=`${T}:${W}`}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:_,auth:L},j=(i?ct.request:Dp)(de,(T)=>{let W=new $p({statusCode:T.statusCode||-1,reason:T.statusMessage,headers:Bp(T.headers),body:T});m({response:W})});if(j.on("error",(T)=>{if(UM.includes(T.code))y(Object.assign(T,{name:"TimeoutError"}));else y(T)}),r){let T=()=>{j.destroy();let W=Rs(r);y(W)};if(typeof r.addEventListener==="function"){let W=r;W.addEventListener("abort",T,{once:!0}),j.once("close",()=>W.removeEventListener("abort",T))}else r.onabort=T}let ke=n??s.requestTimeout;f=$M(j,y,s.connectionTimeout),l=BM(j,y,ke,s.throwOnRequestTimeout,o??console),h=qM(j,y,s.socketTimeout);let D=de.agent;if(typeof D==="object"&&"keepAlive"in D)p=zM(j,{keepAlive:D.keepAlive,keepAliveMsecs:D.keepAliveMsecs});u=Hp(j,t,ke,this.externalAgent).catch((T)=>(g(),a(T)))})}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:c,throwOnRequestTimeout:a,logger:u}=t||{},d=!0,f=50;return{connectionTimeout:n,requestTimeout:r,socketTimeout:s,socketAcquisitionWarningTimeout:o,throwOnRequestTimeout:a,httpAgentProvider:async()=>{let l=I("node:http"),{Agent:h,request:p}=l.default??l;if(Dp=p,Is=h,i instanceof Is||typeof i?.destroy==="function")return this.externalAgent=!0,i;return new Is({keepAlive:!0,maxSockets:50,...i})},httpsAgent:(()=>{if(c instanceof ct.Agent||typeof c?.destroy==="function")return this.externalAgent=!0,c;return new ct.Agent({keepAlive:!0,maxSockets:50,...c})})(),logger:u}}}var WM=new Uint16Array(1);class Ns{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 zp{sessions=[];maxConcurrency=0;constructor(t){this.sessions=(t??[]).map((r)=>new Ns(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 qp{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 u=s.poll();if(u)return u.retain(),u}let o=new Ns(this.connect(n)),i=o.deref();if(this.config.maxConcurrency)i.settings({maxConcurrentStreams:this.config.maxConcurrency},(u)=>{if(u)throw Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+t.destination.toString())});let c=()=>{this.removeFromPoolAndClose(n,o)},a=()=>{this.removeFromPoolAndCheckedDestroy(n,o)};if(i.on("goaway",c),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 Ns(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 c=r.requestTimeout??300000;return o.setTimeout(c,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 zp;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?un.connect(t):un.connect(t,this.connectOptions)}}var{constants:Fp}=un;class Ba{config;configProvider;metadata={handlerProtocol:"h2"};connectionManager=new qp({});static create(t){if(typeof t?.handle==="function")return t;return new Ba(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:u,maxConcurrentStreams:d,nodeHttp2ConnectOptions:f}=this.config;if(this.connectionManager.setDisableConcurrentStreams(u??!1),d)this.connectionManager.setMaxConcurrentStreams(d);if(f)this.connectionManager.setNodeHttp2ConnectOptions(f)}let{requestTimeout:o,disableConcurrentStreams:i}=this.config,c=i||s,a=n??o;return new Promise((u,d)=>{let f=!1,l=void 0,h=async(T)=>{await l,u(T)},p=async(T)=>{await l,d(T)};if(r?.aborted){f=!0;let T=Rs(r);p(T);return}let{hostname:g,method:m,port:y,protocol:S,query:w}=t,_="";if(t.username!=null||t.password!=null){let T=t.username??"",W=t.password??"";_=`${T}:${W}@`}let v=`${S}//${_}${g}${y?`:${y}`:""}`,L={destination:new URL(v)},k={requestTimeout:this.config?.sessionTimeout,isEventStream:s},U=c?this.connectionManager.createIsolatedSession(L,k):this.connectionManager.lease(L,k),de=U.deref(),q=(T)=>{if(c)U.destroy();f=!0,p(T)},j=w?Up(w):"",ke=t.path;if(j)ke+=`?${j}`;if(t.fragment)ke+=`#${t.fragment}`;let D=de.request({...t.headers,[Fp.HTTP2_HEADER_PATH]:ke,[Fp.HTTP2_HEADER_METHOD]:m});if(a)D.setTimeout(a,()=>{D.close();let T=Error(`Stream timed out because of no activity for ${a} ms`);T.name="TimeoutError",q(T)});if(r){let T=()=>{D.close();let W=Rs(r);q(W)};if(typeof r.addEventListener==="function"){let W=r;W.addEventListener("abort",T,{once:!0}),D.once("close",()=>W.removeEventListener("abort",T))}else r.onabort=T}D.on("frameError",(T,W,ww)=>{q(Error(`Frame type id ${T} in stream id ${ww} has failed with code ${W}.`))}),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",(T)=>{let W=new $p({statusCode:T[":status"]??-1,headers:Bp(T),body:D});if(f=!0,h({response:W}),c)de.close(),D.on("end",()=>{U.destroy()})}),D.on("close",()=>{if(c)U.destroy();else this.connectionManager.release(L,U);if(!f){let T=Error("Unexpected error: http2 request did not get a response");if(de.destroyed)T.name="TimeoutError";q(T)}}),l=Hp(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=Ba;GM.NodeHttpHandler=vs});var Ha=e(function(hD){var{setCredentialFeature:JM}=he(),{CredentialsProviderError:Mt}=Z(),{NodeHttpHandler:ZM}=Et(),jp=I("node:fs/promises"),{HttpRequest:eD}=Y(),{sdkStreamMixin:tD,parseRfc3339DateTime:rD}=Ae(),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],c=t.logger?.constructor?.name==="NoOpLogger"||!t.logger?.warn?console.warn:t.logger.warn.bind(t.logger);if(n&&s)c("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),c("awsContainerCredentialsRelativeUri will take precedence.");if(o&&i)c("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),c("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 u=ZM.create({connectionTimeout:t.timeout??1000}),d=t.timeout??1000,f=iD(async()=>{let l=sD(a);if(i)l.headers.Authorization=Vp((await jp.readFile(i)).toString());else if(o)l.headers.Authorization=Vp(o);try{let h=await u.handle(l,{requestTimeout:d});return oD(h.response).then((p)=>JM(p,"CREDENTIALS_HTTP","z"))}catch(h){throw new Mt(String(h),{logger:t.logger})}},t.maxRetries??3,t.timeout??1000);return async()=>{try{return await f()}finally{u.destroy?.()}}},Vp=(t)=>{if(t.includes(`\r
44
+ `))throw new Mt("Authorization token contains invalid \\r\\n sequence.");return t};hD.fromHttp=fD});var Sg=e(function(cF){var{nv:rg,NumericValue:gn,calculateBodyLength:gD,generateIdempotencyToken:ng,fromBase64:Ja,_parseEpochTimestamp:hn}=Ae(),{hasOwn:ie,getSmithyContext:mD}=me(),{HttpRequest:yD,collectBody:SD,SerdeContext:mn,RpcProtocol:wD}=Y(),{NormalizedSchema:we,deref:ED,TypeRegistry:Wp}=ve();function wr(t){return typeof Buffer<"u"?Buffer.alloc(t):new Uint8Array(t)}var yn=Symbol("@smithy/core/cbor::tagSymbol");function Za(t){return t[yn]=!0,t}var sg=typeof Buffer<"u",ec=new TextDecoder,N=wr(0),tc=!1,xe=new DataView(N.buffer,N.byteOffset,N.byteLength),C=0;function bD(t){N=t,tc=sg&&N instanceof Buffer,xe=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=xe.getUint16(t+1),i=3;break;case 26:if(r-t<5)$e(4);o=xe.getUint32(t+1),i=5;break;case 27:if(r-t<9)$e(8);{let c=xe.getUint32(t+1);if(c<2097152)o=c*4294967296+xe.getUint32(t+5);else o=xe.getBigUint64(t+1)}i=9;break;default:nc(s)}if(n===0)return C=i,Ga(o);else if(n===1){let c;if(typeof o==="bigint")c=BigInt(-1)-o;else c=-1-o;return C=i,Ga(c)}else return ND(t,r,s,o,i)}case 3:return pn(t,r);case 5:return xD(t,r);case 4:return ID(t,r);case 2:return rc(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=Sn(t,r);if(n<25)return CD(t,r,n);return TD(t,r,n)}function TD(t,r,n){let s=C;t+=s;let o=t,i=Object.create(null);for(let c=0;c<n;++c){let a=pn(t,r);if(t+=C,(N[t]&224)>>5===3)i[a]=pn(t,r);else i[a]=ft(t,r);t+=C}return C=s+(t-o),Object.setPrototypeOf(i,Object.prototype),i}function CD(t,r,n){let s=C;t+=s;let o=t,i={};for(let c=0;c<n;++c){let a=pn(t,r);t+=C,i[a]=ft(t,r),t+=C}return C=s+(t-o),i}function ID(t,r){let n=Sn(t,r),s=C;t+=s;let o=t,i=Array(n);for(let c=0;c<n;++c)i[c]=ft(t,r),t+=C;return C=s+(t-o),i}function pn(t,r){let n=Sn(t,r),s=C;if(t+=s,r-t<n)$e(n);if(C=s+n,n<24)return vD(t,n);if(tc)return N.toString("utf-8",t,t+n);return ec.decode(N.subarray(t,t+n))}var Gp=Array(2048),za=new Uint16Array(2048),dn=0;function RD(){dn=dn+1&65535}function vD(t,r){let n=r;for(let c=0;c<r;++c)n=n*31+N[t+c]|0;let s=n>>>0&2047,o=Gp[s];if(o!==void 0){if(o.length===r){let c=!0;for(let a=0;a<r;++a)if(o.charCodeAt(a)!==N[t+a]){c=!1;break}if(c)return za[s]=dn,o}}let i=tc?N.toString("utf-8",t,t+r):ec.decode(N.subarray(t,t+r));if(za[s]!==dn)Gp[s]=i,za[s]=dn;return i}function rc(t,r){let n=Sn(t,r),s=C;if(t+=s,r-t<n)$e(n);let o=N.subarray(t,t+n);return C=s+n,o}function ND(t,r,n,s,o){if(n===2||n===3){let i=Sn(t+o,r),c=BigInt(0),a=t+o+C;for(let u=a;u<a+i;++u)c=c<<BigInt(8)|BigInt(N[u]);return C=o+C+i,n===3?-c-BigInt(1):c}else if(n===4){let i=ft(t+o,r),[c,a]=i,u=a<0?-1:1,d=BigInt(u)*BigInt(a),f=String(d),l=a<0?"-":"",h;if(typeof c==="number"&&Math.abs(c)<=268435456){let g=c,m="0".repeat(Math.abs(g)+1)+f;if(h=g===0?m:m.slice(0,m.length+g)+"."+m.slice(g),h=h.replace(/^0+/g,""),h==="")h="0";if(h[0]===".")h="0"+h;h=l+h}else{let g=BigInt(c);if(f.length===1)h=l+f+"e"+String(g);else{let m=g+BigInt(f.length-1);h=l+f[0]+"."+f.slice(1)+"e"+String(m)}}return C=o+C,rg(h)}else{let i=ft(t+o,r);return C=o+C,Za({tag:Ga(s),value:i})}}function OD(t,r){let n=N[t]&31;switch(n){case 21:case 20:return C=1,n===21;case 22:return C=1,null;case 23:return C=1,null;case 25:if(r-t<3)throw Error("incomplete float16 at end of buf.");return C=3,AD(N[t+1],N[t+2]);case 26:if(r-t<5)throw Error("incomplete float32 at end of buf.");return C=5,xe.getFloat32(t+1);case 27:if(r-t<9)throw Error("incomplete float64 at end of buf.");return C=9,xe.getFloat64(t+1);default:nc(n)}}function Sn(t,r){let n=N[t]&31;if(n<24)return C=1,n;switch(n){case 24:if(r-t<2)$e(1);return C=2,N[t+1];case 25:if(r-t<3)$e(2);return C=3,xe.getUint16(t+1);case 26:if(r-t<5)$e(4);return C=5,xe.getUint32(t+1);case 27:if(r-t<9)$e(8);return C=9,FD(xe.getBigUint64(t+1));default:nc(n)}}function PD(t,r){t+=1;let n=t,s={};for(;t<r;){if(N[t]===255)return C=t-n+2,s;let o=pn(t,r);t+=C,s[o]=ft(t,r),t+=C}throw Error("expected break marker.")}function kD(t,r){t+=1;let n=[];for(let s=t;t<r;){if(N[t]===255)return C=t-s+2,n;n.push(ft(t,r)),t+=C}throw Error("expected break marker.")}function MD(t,r){t+=1;let n=[];for(let s=t;t<r;){if(N[t]===255){let u=wr(n.length);if(u.set(n,0),C=t-s+2,sg)return u.toString("utf-8",0,u.length);return ec.decode(u)}let o=(N[t]&224)>>5,i=N[t]&31;if(o!==3)og(o);if(i===31)throw Error("nested indefinite string.");let c=rc(t,r);t+=C;for(let u=0;u<c.length;++u)n.push(c[u])}throw Error("expected break marker.")}function DD(t,r){t+=1;let n=[];for(let s=t;t<r;){if(N[t]===255){let u=wr(n.length);return u.set(n,0),C=t-s+2,u}let o=(N[t]&224)>>5,i=N[t]&31;if(o!==2)og(o);if(i===31)throw Error("nested indefinite string.");let c=rc(t,r);t+=C;for(let u=0;u<c.length;++u)n.push(c[u])}throw Error("expected break marker.")}function Ga(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 nc(t){throw Error(`unexpected minor value ${t}.`)}function og(t){throw Error(`unexpected major type ${t} in indefinite string.`)}var LD=typeof Buffer<"u",hr=new Map,ln=0,Ka=!1,UD=2048,A=wr(UD),Se=new DataView(A.buffer,A.byteOffset,A.byteLength),E=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)qa(3,Buffer.byteLength(n)),E+=A.write(n,E);else HD(n);else{let o=s*3;pr(o+9);let i=E,a=new TextEncoder().encodeInto(n,A.subarray(E+9)).written,u;if(a<24)u=1;else if(a<256)u=2;else if(a<65536)u=3;else if(a<4294967296)u=5;else u=9;if(u<9)A.copyWithin(i+u,i+9,i+9+a);E=i,Dt(3,a),E+=a}continue}if(A.byteLength-E<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)A[E++]=o<<5|i;else if(i<256)A[E++]=o<<5|24,A[E++]=i;else if(i<65536)A[E++]=o<<5|25,A[E++]=i>>8,A[E++]=i&255;else if(i<4294967296)A[E++]=o<<5|26,Se.setUint32(E,i),E+=4;else{A[E++]=o<<5|27;let c=i/4294967296|0,a=i-c*4294967296|0;Se.setUint32(E,c),Se.setUint32(E+4,a),E+=8}continue}A[E++]=251,Se.setFloat64(E,n),E+=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 c=Number(i);if(c<4294967296)Dt(o,c);else A[E++]=o<<5|27,Se.setBigUint64(E,i),E+=8}else{let c=i.toString(2),a=new Uint8Array(Math.ceil(c.length/8)),u=i,d=0;while(a.byteLength-++d>=0)a[a.byteLength-d]=Number(u&BigInt(255)),u>>=BigInt(8);pr(a.byteLength*2+16),A[E++]=s?194:195,qa(2,a.byteLength),A.set(a,E),E+=a.byteLength}continue}else if(n===null){A[E++]=246;continue}else if(typeof n==="boolean"){A[E++]=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),A.set(n,E),E+=n.byteLength;continue}else if(typeof n==="object"){if(n instanceof gn){let i=n.string,c=BigInt(0),a=i.search(/[eE]/);if(a!==-1)c=BigInt(i.slice(a+1)),i=i.slice(0,a);let u=i.indexOf("."),d=u===-1?0:i.length-u-1,f=c-BigInt(d),l=BigInt(i.replace(".",""));A[E++]=196,Dt(4,2),r.push(l),r.push(f>=-0x20000000000000n&&f<=0x1fffffffffffffn?Number(f):f);continue}if(n[yn])if("tag"in n&&"value"in n){r.push(n.value),qa(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(){ln=ln+1&65535,Ka=!1}function Kp(){let t=wr(E);return t.set(A.subarray(0,E),0),E=0,t}function Qa(t){let r=A;if(A=wr(t),r)if(r.copy)r.copy(A,0,0,r.byteLength);else A.set(r,0);Se=new DataView(A.buffer,A.byteOffset,A.byteLength)}function HD(t){let r=hr.get(t);if(r!==void 0){A.set(r.bytes,E),E+=r.bytes.length,r.epoch=ln;return}let n=E,s=Buffer.byteLength(t);Dt(3,s),E+=A.write(t,E);let o=Uint8Array.prototype.slice.call(A,n,E);if(hr.size>=2048){if(Ka)return;let i=0;for(let[c,a]of hr){if(i>=1024)break;if(a.epoch!==ln)hr.delete(c),i++}if(i===0){Ka=!0;return}}if(hr.size<2048)hr.set(t,{epoch:ln,bytes:o})}function pr(t){if(A.byteLength-E<t)if(E<16000000)Qa(Math.max(A.byteLength*4,A.byteLength+t));else Qa(A.byteLength+t+16000000)}function qa(t,r){if(r<24)A[E++]=t<<5|r;else if(r<256)A[E++]=t<<5|24,A[E++]=r;else if(r<65536)A[E++]=t<<5|25,Se.setUint16(E,r),E+=2;else if(r<4294967296)A[E++]=t<<5|26,Se.setUint32(E,r),E+=4;else A[E++]=t<<5|27,Se.setBigUint64(E,typeof r==="bigint"?r:BigInt(r)),E+=8}function Dt(t,r){if(r<24)A[E++]=t<<5|r;else if(r<256)A[E++]=t<<5|24,A[E++]=r;else if(r<65536)A[E++]=t<<5|25,A[E++]=r>>8,A[E++]=r&255;else if(r<4294967296)A[E++]=t<<5|26,Se.setUint32(E,r),E+=4;else{A[E++]=t<<5|27;let n=r/4294967296|0,s=r-n*4294967296|0;Se.setUint32(E,n),Se.setUint32(E+4,s),E+=8}}var Ds={deserialize(t){return RD(),bD(t),ft(0,t.length)},serialize(t){BD();try{return $D(t),Kp()}catch(r){throw Kp(),r}},resizeEncodingBuffer(t){Qa(t)}},ig=(t,r)=>SD(t,r).then(async(n)=>{if(n.length)try{return Ds.deserialize(n)}catch(s){throw Object.defineProperty(s,"$responseBodyText",{value:r.utf8Encoder(n)}),s}return{}}),Os=(t)=>Za({tag:1,value:t.getTime()/1000}),zD=async(t,r)=>{let n=await ig(t,r);return n.message=n.message??n.Message,n},ag=(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:c,protocol:a="https",port:u,path:d}=i,f={protocol:a,hostname:c,port:u,method:"POST",path:d.endsWith("/")?d.slice(0,-1)+n:d+n,headers:{...r}};if(s!==void 0)f.hostname=s;if(i.headers)for(let l in i.headers){if(!ie(i.headers,l))continue;f.headers[l]=i.headers[l]}if(o!==void 0){f.body=o;try{f.headers["content-length"]=String(gD(o))}catch(l){}}return new yD(f)};class sc extends mn{write(t,r){x=0;let n=we.of(t);mr(n,r,void 0,this.serdeContext)}flush(){let t=R.subarray(0,x);return x=0,R=cg(Xa),Ft=new DataView(R.buffer,R.byteOffset,R.byteLength),t}}var Qp=Symbol.for("@smithy/cbor-struct-cache");function oc(t){let r=t.getSchema(),n=r[Qp];if(n)return n;let s=[],o=[];for(let[a,u]of t.structIterator())s.push(a),o.push(u);let i=Array(s.length);for(let a=0;a<s.length;++a)i[a]=jD(s[a]);let c={memberNames:s,memberSchemas:o,encodedKeys:i};return r[Qp]=c,c}function jD(t){let r;if(Fs)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 Fs=typeof Buffer<"u",WD=new TextEncoder,Xa=2048,R=Fs?Buffer.allocUnsafe(Xa):new Uint8Array(Xa),Ft=new DataView(R.buffer,R.byteOffset,R.byteLength),x=0,Xp=2048,gr=new Map,Va=0,Yp=!1;function cg(t){return Fs?Buffer.allocUnsafe(t):new Uint8Array(t)}function mr(t,r,n,s){if(r==null){if(r===void 0&&t.isIdempotencyToken()){Be(ng());return}M(1),R[x++]=246;return}if(t.isUnitSchema()){M(1),Q(5,0);return}if(typeof r==="object"){if(t.isBlobSchema()){if(r instanceof Uint8Array){Ps(r);return}}if(t.isTimestampSchema()){if(r instanceof Date){Ya(r);return}}if(t.isStructSchema()){GD(t,r,s);return}if(Array.isArray(r)&&(t.isListSchema()||t.isDocumentSchema())){Jp(t,r,t.isDocumentSchema(),s);return}if(t.isMapSchema()){ja(t,r,!1,s);return}if(r instanceof Date){Ya(r);return}if(r instanceof Uint8Array){Ps(r);return}if(r instanceof gn){lg(r);return}if(r[yn]){let i=r;dg(i.tag,i.value);return}if(t.isDocumentSchema()){if(Array.isArray(r))Jp(t,r,!0,s);else ja(t,r,!0,s);return}if(t.isBigDecimalSchema()){yr(r);return}ja(t,r,!0,s);return}if(typeof r==="string"){if(t.isBlobSchema()){let i=(s?.base64Decoder??Ja)(r);Ps(i);return}Be(r);return}if(typeof r==="number"){if(M(9),Number.isInteger(r)&&r>=-9007199254740992&&r<=9007199254740991)Ls(r);else ic(r);return}if(typeof r==="boolean"){M(1),R[x++]=224|(r?21:20);return}if(typeof r==="bigint"){Ms(r);return}Be(String(r))}function GD(t,r,n){if(t.isUnionSchema()){let l=!1;for(let[h,p]of t.structIterator()){let g=r[h];if(g!=null){M(9),Q(5,1),Be(h),mr(p,g,t,n),l=!0;break}}if(!l){let{$unknown:h}=r;if(Array.isArray(h))M(9),Q(5,1),Be(h[0]),yr(h[1]);else M(9),Q(5,0)}return}let s=oc(t),{memberNames:o,memberSchemas:i,encodedKeys:c}=s,a=o.length,u;if(a<24)u=1;else if(a<256)u=2;else u=3;M(u);let d=x;x+=u;let f=0;for(let l=0;l<a;++l){let h=r[o[l]];if(h==null&&!i[l].isIdempotencyToken())continue;let p=c[l];M(p.length),R.set(p,x),x+=p.length,mr(i[l],h,t,n),++f}if(typeof r.__type==="string")for(let l in r){if(!ie(r,l))continue;if(!o.includes(l))Be(l),yr(r[l]),++f}if(u===1)R[d]=160|f;else if(u===2)R[d]=184,R[d+1]=f;else R[d]=185,R[d+1]=f>>8,R[d+2]=f&255}function Jp(t,r,n,s){let o=!!t.getMergedTraits().sparse,i=t.getValueSchema();if(n||o){let c=[];for(let a=0;a<r.length;++a){let u=r[a];if(n){if(u!==void 0)c.push(u)}else if(u!=null||o)c.push(u)}M(9),Q(4,c.length);for(let a=0;a<c.length;++a)mr(i,c[a],void 0,s)}else{let c=0;for(let a=0;a<r.length;++a)if(r[a]!=null)++c;M(9),Q(4,c);for(let a=0;a<r.length;++a)if(r[a]!=null)mr(i,r[a],void 0,s)}}function ja(t,r,n,s){let o=!!t.getMergedTraits().sparse,i=t.getValueSchema(),c=[];for(let a in r){if(!ie(r,a))continue;let u=r[a];if(n?u!==void 0:u!=null||o)c.push(a)}M(9),Q(5,c.length);for(let a=0;a<c.length;++a){let u=c[a];Be(u),mr(i,r[u],void 0,s)}}function yr(t){if(t==null){M(1),R[x++]=246;return}if(typeof t==="string"){Be(t);return}if(typeof t==="number"){if(M(9),Number.isInteger(t)&&t>=-9007199254740992&&t<=9007199254740991)Ls(t);else ic(t);return}if(typeof t==="boolean"){M(1),R[x++]=224|(t?21:20);return}if(typeof t==="bigint"){Ms(t);return}if(t instanceof Uint8Array){Ps(t);return}if(t instanceof Date){Ya(t);return}if(t instanceof gn){lg(t);return}if(t[yn]){let r=t;dg(r.tag,r.value);return}if(Array.isArray(t)){M(9),Q(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),Q(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(x+t>R.length){let r=R.length*2;while(r<x+t)r*=2;let n=cg(r);n.set(R.subarray(0,x)),R=n,Ft=new DataView(n.buffer,n.byteOffset,n.byteLength)}}function Q(t,r){if(r<24)R[x++]=t<<5|r;else if(r<256)R[x++]=t<<5|24,R[x++]=r;else if(r<65536)R[x++]=t<<5|25,R[x++]=r>>8,R[x++]=r&255;else if(r<4294967296)R[x++]=t<<5|26,Ft.setUint32(x,r),x+=4;else{R[x++]=t<<5|27;let n=r/4294967296|0,s=r-n*4294967296|0;Ft.setUint32(x,n),Ft.setUint32(x+4,s),x+=8}}function ug(t,r){let n=Number(r);if(n<4294967296){Q(t,n);return}R[x++]=t<<5|27,Ft.setBigUint64(x,r),x+=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,x),x+=n.bytes.length,n.epoch=Va;return}let s=x;Zp(t,r);let o=x,i=Uint8Array.prototype.slice.call(R,s,o);if(gr.size>=Xp){if(Yp)return;let c=0;for(let[a,u]of gr){if(c>=1024)break;if(u.epoch!==Va)gr.delete(a),++c}if(c===0){Yp=!0;return}}if(gr.size<Xp)gr.set(t,{epoch:Va,bytes:i});return}Zp(t,r)}function Zp(t,r){if(Fs){let n=r*3;M(n+9);let s=Buffer.byteLength(t);Q(3,s),x+=R.write(t,x)}else{let n=r*3;M(n+9);let s=x,i=WD.encodeInto(t,R.subarray(s+9)).written,c;if(i<24)c=1;else if(i<256)c=2;else if(i<65536)c=3;else if(i<4294967296)c=5;else c=9;if(c<9)R.copyWithin(s+c,s+9,s+9+i);x=s,Q(3,i),x+=i}}function ic(t){M(9),R[x++]=251,Ft.setFloat64(x,t),x+=8}function Ls(t){M(9);let r=t>=0,n=r?0:1,s=r?t:-t-1;Q(n,s)}function Ms(t){let r=t>=0,n=r?0:1,s=r?t:-t-BigInt(1);if(s<BigInt("18446744073709551616"))M(9),ug(n,s);else{let o=s.toString(2),i=Math.ceil(o.length/8),c=new Uint8Array(i),a=s;for(let u=i-1;u>=0;--u)c[u]=Number(a&BigInt(255)),a>>=BigInt(8);M(i+16),R[x++]=r?194:195,Q(2,i),R.set(c,x),x+=i}}function Ps(t){M(t.length+9),Q(2,t.length),R.set(t,x),x+=t.length}function dg(t,r){if(M(9),typeof t==="bigint")ug(6,t);else Q(6,t);yr(r)}function lg(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,c=n-BigInt(i),a=BigInt(r.replace(".",""));if(M(9),R[x++]=196,Q(4,2),M(9),c>=-0x20000000000000n&&c<=0x1fffffffffffffn)Ls(Number(c));else Ms(c);Ms(a)}function Ya(t){M(18),Q(6,1);let r=t.getTime()/1000;if(Number.isInteger(r))Ls(r);else ic(r)}class ac extends mn{read(t,r){return H=r,uc=fg&&r instanceof Buffer,lt=new DataView(r.buffer,r.byteOffset,r.byteLength),b=0,K=r.length,fn=fn+1&65535,ye(we.of(t))}readValue(t,r){return ks(we.of(t),r)}}var fg=typeof Buffer<"u",cc=new TextDecoder,H=new Uint8Array(0),uc=!1,lt=new DataView(new ArrayBuffer(0)),b=0,K=0,dc=2048,eg=Array(dc),Wa=new Uint16Array(dc),fn=0;function ye(t){if(b>=K)throw Error("unexpected end of CBOR payload.");let r=(H[b]&224)>>5;if((H[b]&31)===31&&r>=2&&r<=5)return JD(t,r);switch(r){case 0:return nF();case 1:return sF();case 2:return Bs();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=$s(),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=$s();if(t.isStructSchema())return XD(t,r,b);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=oc(t),{memberSchemas:i,encodedKeys:c,memberNames:a}=o,u=c.length,d={},f,l,h=0,p=!1,g=0;for(let m=0;m<r;++m){let y=hg(c,u,g);if(y>=0){if(g=y+1,g>=u)g=0;let S=ye(i[y]);if(S!=null)d[a[y]]=S}else{let S=Sr(),w=ye(we.of(15));if(S==="__type"&&typeof w==="string")p=!0;else f=S,l=w,++h}}if(s){let m=!0;for(let y in d){if(!ie(d,y))continue;m=!1;break}if(m&&h===1)d.$unknown=[f,l]}else if(p){b=n;let m=we.of(15);for(let y=0;y<r;++y){let S=Sr(),w=ye(m);if(!(S in d))d[S]=w}}return d}function YD(t){let r=Us(),n=typeof r==="bigint"?Number(r):r;if(n===1){let i=we.of(15),c=ye(i);return hn(c)}if(n===2||n===3){let i=Bs(),c=BigInt(0);for(let a=0;a<i.length;++a)c=c<<BigInt(8)|BigInt(i[a]);return n===3?-c-BigInt(1):c}if(n===4){let i=we.of(15),c=ye(i),[a,u]=c,d=u<0?-1:1,f=BigInt(d)*BigInt(u),l=String(f),h=u<0?"-":"",p;if(typeof a==="number"&&Math.abs(a)<=268435456){let m=a,y="0".repeat(Math.abs(m)+1)+l;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=h+p}else{let m=BigInt(a);if(l.length===1)p=h+l+"e"+String(m);else{let y=m+BigInt(l.length-1);p=h+l[0]+"."+l.slice(1)+"e"+String(y)}}return rg(p)}let s=we.of(15),o=ye(s);return{tag:pg(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(){b+=1;let t=[],r=0;while(b<K){if(H[b]===255){b+=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(fg)return Buffer.from(s.buffer,s.byteOffset,s.byteLength).toString("utf-8");return cc.decode(s)}let n=Bs();t.push(n),r+=n.length}throw Error("expected break marker.")}function eF(){b+=1;let t=[],r=0;while(b<K){if(H[b]===255){b+=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=Bs();t.push(n),r+=n.length}throw Error("expected break marker.")}function tF(t){b+=1;let r=t.isListSchema()?t.getValueSchema():t,n=[];while(b<K){if(H[b]===255)return b+=1,n;n.push(ye(r))}throw Error("expected break marker.")}function rF(t){if(b+=1,t.isStructSchema()){let s=oc(t),{memberSchemas:o,encodedKeys:i,memberNames:c}=s,a=i.length,u=t.isUnionSchema(),d={},f,l,h=0,p=0;while(b<K){if(H[b]===255){if(b+=1,u){let m=!0;for(let y in d){if(!ie(d,y))continue;m=!1;break}if(m&&h===1)d.$unknown=[f,l]}return d}let g=hg(i,a,p);if(g>=0){if(p=g+1,p>=a)p=0;let m=ye(o[g]);if(m!=null)d[c[g]]=m}else{let m=Sr(),y=ye(we.of(15));if(m!=="__type")f=m,l=y,++h}}throw Error("expected break marker.")}let r=t.isMapSchema()?t.getValueSchema():t,n={};while(b<K){if(H[b]===255)return b+=1,n;let s=Sr();n[s]=ye(r)}throw Error("expected break marker.")}function hg(t,r,n){let s=t[n];if(b+s.length<=K&&tg(b,s))return b+=s.length,n;for(let o=0;o<r;++o){if(o===n)continue;let i=t[o];if(b+i.length<=K&&tg(b,i))return b+=i.length,o}return-1}function tg(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 Us(){let t=H[b]&31;if(t<24)return b+=1,t;switch(t){case 24:if(K-b<2)Qe(1);return b+=2,H[b-1];case 25:if(K-b<3)Qe(2);return b+=3,lt.getUint16(b-2);case 26:if(K-b<5)Qe(4);return b+=5,lt.getUint32(b-4);case 27:{if(K-b<9)Qe(8);b+=9;let r=lt.getUint32(b-8);if(r<2097152)return r*4294967296+lt.getUint32(b-4);return lt.getBigUint64(b-8)}default:throw Error(`unexpected minor value ${t}.`)}}function $s(){let t=Us();return typeof t==="bigint"?Number(t):t}function nF(){let t=Us();return pg(t)}function sF(){let t=Us();if(typeof t==="bigint")return BigInt(-1)-t;return-1-t}function Bs(){let t=$s();if(K-b<t)Qe(t);let r=b;return b+=t,H.subarray(r,r+t)}function Sr(){let t=$s();if(K-b<t)Qe(t);let r=b;if(b+=t,t<24)return oF(r,t);if(uc)return H.toString("utf-8",r,r+t);return cc.decode(H.subarray(r,r+t))}function oF(t,r){let n=r;for(let c=0;c<r;++c)n=n*31+H[t+c]|0;let s=n>>>0&dc-1,o=eg[s];if(o!==void 0&&o.length===r){let c=!0;for(let a=0;a<r;++a)if(o.charCodeAt(a)!==H[t+a]){c=!1;break}if(c)return Wa[s]=fn,o}let i=uc?H.toString("utf-8",t,t+r):cc.decode(H.subarray(t,t+r));if(Wa[s]!==fn)eg[s]=i,Wa[s]=fn;return i}function iF(){let t=b,r=H[t]&31;switch(r){case 21:return b=t+1,!0;case 20:return b=t+1,!1;case 22:return b=t+1,null;case 23:return b=t+1,null;case 25:{if(K-t<3)Qe(2);return b=t+3,aF(H[t+1],H[t+2])}case 26:{if(K-t<5)Qe(4);return b=t+5,lt.getFloat32(t+1)}case 27:{if(K-t<9)Qe(8);return b=t+9,lt.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 pg(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 ks(t,r){if(t.isTimestampSchema()){if(typeof r==="number")return hn(r);if(typeof r==="object"&&r!==null){if(r.tag===1&&"value"in r)return hn(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 gn)return r;if(t.isDocumentSchema())return r;if(t.isListSchema()){let s=t.getValueSchema(),o=[];for(let i of r)o.push(ks(s,i));return o}let n={};if(t.isMapSchema()){let s=t.getValueSchema();for(let o in r){if(!ie(r,o))continue;n[o]=ks(s,r[o])}}else if(t.isStructSchema()){let s=t.isUnionSchema(),o;if(s){o=new Set;for(let i in r){if(!ie(r,i))continue;if(i!=="__type")o.add(i)}}for(let[i,c]of t.structIterator()){if(s)o.delete(i);if(r[i]!=null)n[i]=ks(c,r[i])}if(s&&o?.size===1){let i=!0;for(let c in n){if(!ie(n,c))continue;i=!1;break}if(i){let c=o.values().next().value;n.$unknown=[c,r[c]]}}else if(typeof r.__type==="string")for(let i in r){if(!ie(r,i))continue;if(!(i in n))n[i]=r[i]}}return n}class lc extends mn{createSerializer(){let t=new sc;return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new ac;return t.setSerdeContext(this.serdeContext),t}}class gg extends wD{codec=new lc;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),c=`/service/${o}/operation/${i}`;if(s.path.endsWith("/"))s.path+=c.slice(1);else s.path+=c;return s}async deserializeResponse(t,r,n){return super.deserializeResponse(t,r,n)}async handleError(t,r,n,s,o){let i=ag(n,s)??"Unknown",c=["*"],{defaultNamespace:a}=this.options;c.unshift(a);let[u,d]=(()=>{if(i.includes("#"))return i.split("#");return[void 0,i]})();if(u)c.unshift(u);let f={$metadata:o,$fault:n.statusCode<500?"client":"server"},l=[this.compositeErrorRegistry];if(u)l.push(Wp.for(u));l.push(Wp.for(a));let[h,p,g]=this.resolveError(d,c,l);if(g==="native"||g==="synthetic"){if(s.Message)s.message=s.Message;let _=g==="synthetic"?new p({name:d}):Error(d);throw Object.assign(_,f,s)}let m=we.of(h),y=s.message??s.Message??"Unknown",S=new p({}),w={};for(let[_,v]of m.structIterator())w[_]=this.deserializer.readValue(v,s[_]);throw Object.assign(S,f,{$fault:m.getMergedTraits().error,message:y},w)}getDefaultContentType(){return"application/cbor"}}class mg extends mn{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 ng();return r}if(n.isBlobSchema()){if(typeof r==="string")return(this.serdeContext?.base64Decoder??Ja)(r);return r}if(n.isTimestampSchema()){if(typeof r==="number"||typeof r==="bigint")return Os(new Date(Number(r)/1000|0));return Os(r)}if(typeof r==="function"||typeof r==="object"){let s=r;if(n.isListSchema()&&Array.isArray(s)){let i=!!n.getMergedTraits().sparse,c=[],a=0;for(let u of s){let d=this.serialize(n.getValueSchema(),u);if(d!=null||i)c[a++]=d}return c}if(s instanceof Date)return Os(s);let o={};if(n.isMapSchema()){let i=!!n.getMergedTraits().sparse;for(let c in s){if(!ie(s,c))continue;let a=this.serialize(n.getValueSchema(),s[c]);if(a!=null||i)o[c]=a}}else if(n.isStructSchema()){for(let[c,a]of n.structIterator()){let u=this.serialize(a,s[c]);if(u!=null)o[c]=u}if(n.isUnionSchema()&&Array.isArray(s.$unknown)){let[c,a]=s.$unknown;o[c]=a}else if(typeof s.__type==="string")for(let c in s){if(!ie(s,c))continue;if(!(c in o))o[c]=this.serialize(15,s[c])}}else if(n.isDocumentSchema()){if(Array.isArray(s)){let i=[],c=0;for(let a of s)i[c++]=this.serialize(n.getValueSchema(),a);return i}for(let i in s){if(!ie(s,i))continue;o[i]=this.serialize(n.getValueSchema(),s[i])}}else if(n.isBigDecimalSchema())return s;return o}return r}flush(){let t=Ds.serialize(this.value);return this.value=void 0,t}}class yg extends mn{read(t,r){let n=Ds.deserialize(r);return this.readValue(t,n)}readValue(t,r){let n=we.of(t);if(n.isTimestampSchema()){if(typeof r==="number")return hn(r);if(typeof r==="object"){if(r.tag===1&&"value"in r)return hn(r.value)}}if(n.isBlobSchema()){if(typeof r==="string")return(this.serdeContext?.base64Decoder??Ja)(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 c of r){let a=this.readValue(i,c);o.push(a)}return o}let s={};if(n.isMapSchema()){let o=n.getValueSchema();for(let i in r){if(!ie(r,i))continue;let c=this.readValue(o,r[i]);s[i]=c}}else if(n.isStructSchema()){let o=n.isUnionSchema(),i;if(o){i=new Set;for(let c in r){if(!ie(r,c))continue;if(c!=="__type")i.add(c)}}for(let[c,a]of n.structIterator()){if(o)i.delete(c);if(r[c]!=null)s[c]=this.readValue(a,r[c])}if(o&&i?.size===1){let c=!0;for(let a in s){if(!ie(s,a))continue;c=!1;break}if(c){let a=i.values().next().value;s.$unknown=[a,r[a]]}}else if(typeof r.__type==="string")for(let c in r){if(!ie(r,c))continue;if(!(c in s))s[c]=r[c]}}else if(r instanceof gn)return r;return s}else return r}}cF.CborCodec=lc;cF.CborShapeDeserializer=yg;cF.CborShapeDeserializer2=ac;cF.CborShapeSerializer=mg;cF.CborShapeSerializer2=sc;cF.SmithyRpcV2CborProtocol=gg;cF.buildHttpRpcRequest=VD;cF.cbor=Ds;cF.checkCborResponse=qD;cF.dateToTag=Os;cF.loadSmithyRpcV2CborErrorCode=ag;cF.parseCborBody=ig;cF.parseCborErrorBody=zD;cF.tag=Za;cF.tagSymbol=yn});var wg=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 hc{value;constructor(t){this.value=t}toString(){return vF(""+this.value)}}class wn{name;children;attributes={};static of(t,r,n){let s=new wn(t);if(r!==void 0)s.addChildNode(new hc(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=wn.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 wn(n);o.map((c)=>{i.c(c)}),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 fc(t){Object.defineProperty(t,"__proto__",{value:void 0,writable:!0,enumerable:!0,configurable:!0})}function NF(t){return new pc(t).parse()}class pc{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 d="";while(t.i<t.z&&!`= \r
48
+ >/?`.includes(t.x[t.i]))d+=t.x[t.i++];if(t.trim(),t.x[t.i]!=="=")break;if(++t.i,t.trim(),d==="__proto__")fc(s);s[d]=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=[],c=!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 c=!0,i.push(t.parseTag());else{let d="";while(t.i<t.z&&t.x[t.i]!=="<")d+=t.x[t.i++];o.push(t.decodeEntities(d))}}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&&!c)return{tag:r,value:""};if(!n&&!c){let d=o.length===1?o[0]:o.join("");if(d.trim()===""&&d.includes(`
49
+ `))return{tag:r,value:""};return{tag:r,value:d}}let u={};for(let d of o){if(d.trim()===""&&d.includes(`
50
+ `))continue;u["#text"]="#text"in u?u["#text"]+d:d}for(let d of i){if(d.tag==="__proto__")fc(u);if(d.tag in u)if(Array.isArray(u[d.tag]))u[d.tag].push(d.value);else u[d.tag]=[u[d.tag],d.value];else u[d.tag]=d.value}for(let[d,f]of Object.entries(s)){if(d==="__proto__")fc(u);u[d]=f}return{tag:r,value:u}}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 pc.ENTITIES[o]??""})}}OF.XmlNode=wn;OF.XmlText=hc;OF.parseXML=NF});var mt=e(function(ZF){var{SmithyRpcV2CborProtocol:DF,loadSmithyRpcV2CborErrorCode:FF}=Sg(),{TypeRegistry:Eg,NormalizedSchema:F,deref:Og}=ve(),{decorateServiceException:bg,getValueFromTextNode:Pg}=ue(),{collectBody:Vs,determineTimestampFormat:_r,RpcProtocol:kg,HttpBindingProtocol:Mg,HttpInterceptingShapeSerializer:Dg,HttpInterceptingShapeDeserializer:Fg,FromStringShapeDeserializer:LF,extendedEncodeURIComponent:_g}=Y(),{NumericValue:te,toUtf8:wc,fromBase64:Ec,LazyJsonString:Gs,parseEpochTimestamp:Lg,parseRfc7231DateTime:Ug,parseRfc3339DateTimeWithOffset:$g,generateIdempotencyToken:Ks,toBase64:br,dateToUtcString:bn,expectUnion:UF}=Ae(),{parseXML:Bg,XmlNode:Te,XmlText:Ag}=wg();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:c,httpQueryParams:a,httpHeader:u,httpLabel:d,httpPrefixHeaders:f}=i.getMergedTraits();return!c&&!a&&!u&&!d&&f===void 0}))return t}}async getErrorSchemaOrThrowBaseException(t,r,n,s,o,i){let c=t;if(t.includes("#"))[,c]=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,c)??this.errorRegistry.getSchema(t),errorMetadata:a}}catch(u){s.message=s.message??s.Message??"UnknownError";let d=this.errorRegistry,f=d.getBaseException();if(f){let p=d.getErrorCtor(f)??Error;throw this.decorateServiceException(Object.assign(new p({name:c}),a),s)}let l=s,h=l?.message??l?.Message??l?.Error?.Message??l?.Error?.message;throw this.decorateServiceException(Object.assign(Error(h),{name:c},a),s)}}compose(t,r,n){let s=n;if(r.includes("#"))[s]=r.split("#");let o=Eg.for(s),i=Eg.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=bg(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 bg(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),c={Code:s,Type:o};t.Code=s,t.Type=o;for(let a=0;a<i.length;a++){let u=i[a];c[u==="message"?"Message":u]=t[u]}delete c.__type,t.Error=c}}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 Hg 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 p=n.headers["x-amzn-query-error"];if(p&&this.awsQueryCompatible)return p.split(";")[0];return FF(n,s)??"Unknown"})();this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace);let{errorSchema:c,errorMetadata:a}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,n,s,o,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),u=F.of(c),d=s.message??s.Message??"UnknownError",l=new(this.compositeErrorRegistry.getErrorCtor(c)??Error)({}),h={};for(let[p,g]of u.structIterator())if(s[p]!=null)h[p]=this.deserializer.readValue(g,s[p]);if(this.awsQueryCompatible)this.mixin.queryCompatOutput(s,h);throw this.mixin.decorateServiceException(Object.assign(l,a,{$fault:u.getMergedTraits().error,message:d},h),s)}}class Ce{serdeContext;setSerdeContext(t){this.serdeContext=t}}class Qs{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 En;function zg(){if(En===void 0)try{if(typeof Buffer!=="function")En=!1;else{let t=JSON.parse(Buffer.from([123,125]));En=t!==null&&typeof t==="object"}}catch{En=!1}return En}function bc(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 te(s,"bigDecimal")}else{if($F(s))return new te(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 gc(t)===gc(String(r));let n=t.replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,""),s=String(r);if(n===s)return!0;if(/[eE]/.test(s))return n===gc(s);return!1}function gc(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),c=n.slice(0,s),a=c.indexOf("."),u,d;if(a===-1)u=c,d=c.length;else u=c.slice(0,a)+c.slice(a+1),d=a;u=u.replace(/0+$/,"")||"0";let f=d+i;if(u==="0")o="0";else if(f<=0)o="0."+"0".repeat(-f)+u;else if(f>=u.length)o=u+"0".repeat(f-u.length);else o=u.slice(0,f)+"."+u.slice(f)}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("."),c,a;if(i===-1)c=o,a=n;else{c=o.slice(0,i)+o.slice(i+1);let d=o.length-i-1;a=n-d}c=c.replace(/0+$/,"")||"0";let u=BigInt(c)*10n**BigInt(a+(o.replace(".","").length-c.length));return s?-u:u}var mc=Symbol.for("@aws-sdk/reviver");function _c(t){let r=F.of(t),n=r.getSchema();if(Array.isArray(n)&&r.isStructSchema()){if(mc in n)return n[mc];let s=js(r,new Set);return n[mc]=s,s}return js(r,new Set)}function js(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(js(s,r))return!0}else if(t.isListSchema()||t.isMapSchema()){if(js(t.getValueSchema(),r))return!0}else if(t.isDocumentSchema())return!0;return!1}var qg=(t,r)=>Vs(t,r).then((n)=>(r?.utf8Encoder??wc)(n));async function Xs(t,r,n){let s;if(zg()&&typeof t?.[Symbol.asyncIterator]==="function"){let i=await Vs(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 qg(t,r);if(s.length===0)return{};let o=n&&_c(n)?bc: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 Xs(t,r);return n.message=n.message??n.Message,n},xg=(t,r)=>Object.keys(t).find((n)=>n.toLowerCase()===r.toLowerCase()),yc=(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},Vg=(t,r)=>Wg(t,r,["header","code","type"]),jg=(t,r,n=!1)=>Wg(t,r,n?["code","header","type"]:["type","code","header"]),Wg=({headers:t},r,n)=>{while(n.length>0)switch(n.shift()){case"header":let o=xg(t??{},"x-amzn-errortype");if(o!==void 0)return yc(t[o]);break;case"code":let i=xg(r??{},"code");if(i&&r[i]!==void 0)return yc(r[i]);break;case"type":if(r?.__type!==void 0)return yc(r.__type);break}};function ht(t){Object.defineProperty(t,"__proto__",{value:void 0,writable:!0,enumerable:!0,configurable:!0})}class Ac extends Ce{settings;constructor(t){super();this.settings=t}async read(t,r){let n=_c(t)?bc:void 0,s;if(typeof r==="string"){if(r.length===0)return{};s=JSON.parse(r,n)}else if(r instanceof Uint8Array&&zg()){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 Xs(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 c=0;c<r.length;++c)r[c]=this._read(i,r[c]);return r}if(s.isMapSchema()){let i=s.getValueSchema(),c=r;if(this.needsTransform(i))for(let a in c){if(a==="__proto__")ht(c);c[a]=this._read(i,c[a])}return c}}if(s.isBlobSchema()&&typeof r==="string")return Ec(r);let o=s.getMergedTraits().mediaType;if(s.isStringSchema()&&typeof r==="string"&&o){if(o==="application/json"||o.endsWith("+json"))return Gs.from(r);return r}if(s.isTimestampSchema()&&r!=null)switch(_r(s,this.settings)){case 5:return $g(r);case 6:return Ug(r);case 7:return Lg(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 te)return r;let i=r;if(i.type==="bigDecimal"&&"string"in i)return new te(i.string,i.type);return new te(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 c=r[i];if(!(c instanceof te))r[i]=this._read(s,c)}else{let i=r;for(let c in i){if(c==="__proto__")ht(i);let a=i[c];if(!(a instanceof te))i[c]=this._read(s,a)}}}return r}_readStruct(t,r){let n=t.isUnionSchema(),s={},o,i=typeof r.__type==="string",{jsonName:c}=this.settings;if(c&&i)o={};let a;if(n)a=new Qs(r,s);for(let[u,d]of t.structIterator()){let f=u;if(c){if(f=d.getMergedTraits().jsonName??f,i)o[f]=u}if(n)a.mark(f);if(r[f]!=null)s[u]=this._read(d,r[f])}if(n)a.writeUnknown();else if(i)for(let u in r){let d=r[u],f=c?o[u]??u:u;if(!(f in s))s[f]=d}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 Ws extends Uint8Array{string=null;static allocUnsafe(t){if(typeof Buffer==="function"){let r=Buffer.allocUnsafe(t);return new Ws(r.buffer,r.byteOffset,r.byteLength)}return new Ws(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>Tg+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."),Tg=t;this.string=wc(this)}return this.string}}var Tg=0,Hs=new TextEncoder,Cg=123,Ig=125,qF=91,VF=93,Er=34,zs=58,qs=44,Rg=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 vg=2048;function Sc(t){return Ws.allocUnsafe(t)}class Ys extends Ce{settings;json;i=0;rootSchema;rawValue;passthrough=!1;constructor(t){super();this.settings=t,this.json=Sc(vg)}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),Hs.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=Sc(vg),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=Sc(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++]=Rg;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}=Hs.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++]=Rg,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=Ys.B64,o=this.i;n[o++]=Er;let i=t.length,c=i%3,a=i-c;for(let u=0;u<a;u+=3){let d=t[u],f=t[u+1],l=t[u+2];n[o++]=s[d>>2],n[o++]=s[(d&3)<<4|f>>4],n[o++]=s[(f&15)<<2|l>>6],n[o++]=s[l&63]}if(c===2){let u=t[a],d=t[a+1];n[o++]=s[u>>2],n[o++]=s[(u&3)<<4|d>>4],n[o++]=s[(d&15)<<2],n[o++]=61}else if(c===1){let u=t[a];n[o++]=s[u>>2],n[o++]=s[(u&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(Ks());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(Gs.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 te){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:c}=this;if(r)c.set(jF,i),i+=4;else c.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++]=Cg;let n=!1,s=typeof r.__type==="string",o;if(s)o=new Set;for(let[i,c]of t.structIterator()){let a=r[i];if(a==null&&!c.isIdempotencyToken())continue;if(n)this.ensure(1),this.json[this.i++]=qs;n=!0;let u=this.settings.jsonName?c.getMergedTraits().jsonName??i:i;if(o)o.add(i),o.add(u);this.writeAsciiQuoted(u),this.json[this.i++]=zs,this.writeValue(c,a,t)}if(!n&&t.isUnionSchema()){let{$unknown:i}=r;if(Array.isArray(i)){let[c,a]=i;this.writeAsciiQuoted(c),this.ensure(1),this.json[this.i++]=zs,this.writeValue(15,a,t)}}else if(s)for(let i in r){if(o.has(i))continue;o.add(i);let c=r[i];if(n)this.ensure(1),this.json[this.i++]=qs;n=!0,this.writeAsciiQuoted(i),this.ensure(1),this.json[this.i++]=zs,this.writeValue(15,c,void 0)}this.ensure(1),this.json[this.i++]=Ig}writeList(t,r,n){let s=!!t.getMergedTraits().sparse,o=t.getValueSchema();if(!n){if(o.isStringSchema()||o.isNumericSchema()||o.isBooleanSchema()){let c=!1;for(let u=0;u<r.length;++u){let d=r[u];if(Number.isNaN(d)||d===1/0||d===-1/0||d==null&&!s){c=!0;break}}let a;if(!c)a=JSON.stringify(r);else{let u=[];for(let d=0;d<r.length;++d){let f=r[d];if(f==null&&!s)continue;if(Number.isNaN(f)||f===1/0||f===-1/0)u.push(String(f));else u.push(f)}a=JSON.stringify(u)}this.ensure(a.length*3),this.i+=Hs.encodeInto(a,this.json.subarray(this.i)).written;return}}this.ensure(2),this.json[this.i++]=qF;let i=!1;for(let c=0;c<r.length;++c){let a=r[c];if(n?a===void 0:a==null&&!s)continue;if(i)this.ensure(1),this.json[this.i++]=qs;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 c;for(let u in r){let d=r[u];if(Number.isNaN(d)||d===1/0||d===-1/0)(c??={})[u]=d,r[u]=String(d);else if(d===null&&!s)(c??={})[u]=null,r[u]=void 0}let a=JSON.stringify(r);if(c)Object.assign(r,c);this.ensure(a.length*3),this.i+=Hs.encodeInto(a,this.json.subarray(this.i)).written;return}}this.ensure(2),this.json[this.i++]=Cg;let i=!0;for(let c in r){let a=r[c];if(n?a===void 0:a==null&&!s)continue;if(!i)this.ensure(1),this.json[this.i++]=qs;i=!1,this.writeJsonString(c),this.ensure(1),this.json[this.i++]=zs,this.writeValue(o,a,void 0)}this.ensure(1),this.json[this.i++]=Ig}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(bn(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 Js extends Ce{settings;constructor(t){super();this.settings=t}createSerializer(){let t=new Ys(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new Ac(this.settings);return t.setSerdeContext(this.serdeContext),t}}class Zs extends kg{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 Js({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(Og(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 c=jg(n,s,i)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,c,this.options.defaultNamespace);let{errorSchema:a,errorMetadata:u}=await this.mixin.getErrorSchemaOrThrowBaseException(c,this.options.defaultNamespace,n,s,o,i?this.mixin.findQueryCompatibleError:void 0),d=F.of(a),f=s.message??s.Message??"UnknownError",h=new(this.compositeErrorRegistry.getErrorCtor(a)??Error)({}),p={},g=this.codec.createDeserializer();for(let[m,y]of d.structIterator())if(s[m]!=null)p[m]=g.readObject(y,s[m]);if(i)this.mixin.queryCompatOutput(s,p);throw this.mixin.decorateServiceException(Object.assign(h,u,{$fault:d.getMergedTraits().error,message:f},p),s)}}class Gg extends Zs{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 Kg extends Zs{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 Qg extends Mg{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 Js(s),this.serializer=new Dg(this.codec.createSerializer(),s),this.deserializer=new Fg(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,c]of o.structIterator())if(c.getMemberTraits().httpPayload&&!(i in s))s[i]=null;return s}async handleError(t,r,n,s,o){let i=Vg(n,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace);let{errorSchema:c,errorMetadata:a}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,n,s,o),u=F.of(c),d=s.message??s.Message??"UnknownError",l=new(this.compositeErrorRegistry.getErrorCtor(c)??Error)({});await this.deserializeHttpMessage(c,r,n,s);let h={},p=this.codec.createDeserializer();for(let[g,m]of u.structIterator()){let y=m.getMergedTraits().jsonName??g;h[g]=p.readObject(m,s[y])}throw this.mixin.decorateServiceException(Object.assign(l,a,{$fault:u.getMergedTraits().error,message:d},h),s)}getDefaultContentType(){return"application/json"}}class xc extends Ce{settings;constructor(t){super();this.settings=t}async read(t,r){let n=_c(t)?bc:void 0;return this._read(t,typeof r==="string"?JSON.parse(r,n):await Xs(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,c=s.isUnionSchema(),a={},u=void 0,{jsonName:d}=this.settings;if(d)u={};let f;if(c)f=new Qs(i,a);for(let[l,h]of s.structIterator()){let p=l;if(d)p=h.getMergedTraits().jsonName??p,u[p]=l;if(c)f.mark(p);if(i[p]!=null)a[l]=this._read(h,i[p])}if(c)f.writeUnknown();else if(typeof i.__type==="string")for(let l in i){let h=i[l],p=d?u[l]??l:l;if(!(p in a))a[p]=h}return a}if(Array.isArray(r)&&s.isListSchema()){let i=s.getValueSchema(),c=[];for(let a of r)c.push(this._read(i,a));return c}if(s.isMapSchema()){let i=s.getValueSchema(),c={};for(let a in r){if(a==="__proto__")ht(c);c[a]=this._read(i,r[a])}return c}}if(s.isBlobSchema()&&typeof r==="string")return Ec(r);let o=s.getMergedTraits().mediaType;if(s.isStringSchema()&&typeof r==="string"&&o){if(o==="application/json"||o.endsWith("+json"))return Gs.from(r);return r}if(s.isTimestampSchema()&&r!=null)switch(_r(s,this.settings)){case 5:return $g(r);case 6:return Ug(r);case 7:return Lg(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 te)return r;let i=r;if(i.type==="bigDecimal"&&"string"in i)return new te(i.string,i.type);return new te(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 c in r){if(c==="__proto__")ht(i);let a=r[c];if(a instanceof te)i[c]=a;else i[c]=this._read(s,a)}return i}else return structuredClone(r);return r}}var Ng=String.fromCharCode(925);class Xg{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 te){let n=`${Ng+"nv"+this.counter++}_`+r.string;return this.values.set(`"${n}"`,r.string),n}if(typeof r==="bigint"){let n=r.toString(),s=`${Ng+"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 Tc extends Ce{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 Xg;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,c={},{jsonName:a}=this.settings,u=void 0;if(a)u={};let d=0;for(let[f,l]of o.structIterator()){let h=this._write(l,i[f],o);if(h!==void 0){let p=f;if(a)p=l.getMergedTraits().jsonName??f,u[f]=p;c[p]=h,d++}}if(o.isUnionSchema()&&d===0){let{$unknown:f}=i;if(Array.isArray(f)){let[l,h]=f;if(l==="__proto__")ht(c);c[l]=this._write(15,h)}}else if(typeof i.__type==="string")for(let f in i){let l=i[f],h=a?u[f]??f:f;if(!(h in c))c[h]=this._write(15,l)}return c}if(Array.isArray(r)&&o.isListSchema()){let i=o.getValueSchema(),c=[],a=!!o.getMergedTraits().sparse;for(let u of r)if(a||u!=null)c.push(this._write(i,u));return c}if(o.isMapSchema()){let i=o.getValueSchema(),c={},a=!!o.getMergedTraits().sparse;for(let u in r){let d=r[u];if(a||d!=null){if(u==="__proto__")ht(c);c[u]=this._write(i,d)}}return c}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 bn(r);case 7:return r.getTime()/1000;default:return console.warn("Missing timestamp format, using epoch seconds",r),r.getTime()/1000}if(r instanceof te)this.useReplacer=!0}if(r===null&&n?.isStructSchema())return;if(o.isStringSchema()){if(typeof r>"u"&&o.isIdempotencyToken())return Ks();let i=o.getMergedTraits().mediaType;if(r!=null&&i){if(i==="application/json"||i.endsWith("+json"))return Gs.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 c in r){let a=r[c];if(c==="__proto__")ht(i);if(a instanceof te)this.useReplacer=!0,i[c]=a;else i[c]=this._write(o,a)}return i}else return structuredClone(r);return r}}class Yg extends Ce{settings;constructor(t){super();this.settings=t}createSerializer(){let t=new Tc(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new xc(this.settings);return t.setSerdeContext(this.serdeContext),t}}class eo extends Ce{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((u)=>!!u.getMemberTraits().eventPayload)){let u={},d=Object.keys(o)[0];if(o[d].isBlobSchema())u[d]=r;else u[d]=this.read(o[d],r);return u}let c=(this.serdeContext?.utf8Encoder??wc)(r),a=this.parseXml(c);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 c=n.getValueSchema(),a=[],u=c.getMergedTraits().xmlName??"member",d=o?r:(r[0]??r)[u];if(d==null)return a;let f=Array.isArray(d)?d:[d];for(let l of f)a.push(this.readSchema(c,l));return a}let i={};if(n.isMapSchema()){let c=n.getKeySchema(),a=n.getValueSchema(),u;if(o)u=Array.isArray(r)?r:[r];else u=Array.isArray(r.entry)?r.entry:[r.entry];let d=c.getMergedTraits().xmlName??"key",f=a.getMergedTraits().xmlName??"value";for(let l of u){let h=l[d],p=l[f];if(h==="__proto__")ht(i);i[h]=this.readSchema(a,p)}return i}if(n.isStructSchema()){let c=n.isUnionSchema(),a;if(c)a=new Qs(r,i);for(let[u,d]of n.structIterator()){let f=d.getMergedTraits(),l=!f.httpPayload?d.getMemberTraits().xmlName??u:f.xmlName??d.getName();if(c)a.mark(l);if(r[l]!=null)i[u]=this.readSchema(d,r[l])}if(c)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=Bg(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 Pg(o)}return{}}}class Cc extends Ce{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(Ks())}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 te?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(bn(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,c=1;for(let a of r){if(a==null)continue;let u=o.getMergedTraits(),d=this.getKey("member",u.xmlName,u.ec2QueryName),f=i?`${n}${c}`:`${n}${d}.${c}`;this.write(o,a,f),++c}}}else if(s.isMapSchema()){if(r&&typeof r==="object"){let o=s.getKeySchema(),i=s.getValueSchema(),c=s.getMergedTraits().xmlFlattened,a=1;for(let u in r){let d=r[u];if(d==null)continue;let f=o.getMergedTraits(),l=this.getKey("key",f.xmlName,f.ec2QueryName),h=c?`${n}${a}.${l}`:`${n}entry.${a}.${l}`,p=i.getMergedTraits(),g=this.getKey("value",p.xmlName,p.ec2QueryName),m=c?`${n}${a}.${g}`:`${n}entry.${a}.${g}`;this.write(o,u,h),this.write(i,d,m),++a}}}else if(s.isStructSchema()){if(r&&typeof r==="object"){let o=!1;for(let[i,c]of s.structIterator()){if(r[i]==null&&!c.isIdempotencyToken())continue;let a=c.getMergedTraits(),u=this.getKey(i,a.xmlName,a.ec2QueryName,"struct"),d=`${n}${u}`;this.write(c,r[i],d),o=!0}if(!o&&s.isUnionSchema()){let{$unknown:i}=r;if(Array.isArray(i)){let[c,a]=i,u=`${n}${c}`;this.write(15,a,u)}}}}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 c=r??t;if(i&&s==="struct")return c[0].toUpperCase()+c.slice(1);return c}writeKey(t){if(t.endsWith("."))t=t.slice(0,t.length-1);this.buffer+=`&${_g(t)}=`}writeValue(t){this.buffer+=_g(t)}}class Ic extends kg{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 Cc(r),this.deserializer=new eo(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",Og(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 d=await Vs(n.body,r);if(d.byteLength>0)Object.assign(i,await s.read(15,d));await this.handleError(t,r,n,i,this.deserializeMetadata(n))}for(let d in n.headers){let f=n.headers[d];delete n.headers[d],n.headers[d.toLowerCase()]=f}let c=t.name.split("#")[1]??t.name,a=o.isStructSchema()&&this.useNestedResult()?c+"Result":void 0,u=await Vs(n.body,r);if(u.byteLength>0)Object.assign(i,await s.read(o,u,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 c=this.loadQueryError(s)??{},a=this.loadQueryErrorMessage(s);c.message=a,c.Error={Type:c.Type,Code:c.Code,Message:a};let{errorSchema:u,errorMetadata:d}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,n,c,o,this.mixin.findQueryCompatibleError),f=F.of(u),h=new(this.compositeErrorRegistry.getErrorCtor(u)??Error)({}),p={Type:c.Error.Type,Code:c.Error.Code,Error:c.Error};for(let[g,m]of f.structIterator()){let y=m.getMergedTraits().xmlName??g,S=c[y]??s[y];p[g]=this.deserializer.readSchema(m,S)}throw this.mixin.decorateServiceException(Object.assign(h,d,{$fault:f.getMergedTraits().error,message:a},p),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 Jg extends Ic{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 Zg=(t,r)=>qg(t,r).then((n)=>{if(n.length){let s;try{s=Bg(n)}catch(a){if(a&&typeof a==="object")Object.defineProperty(a,"$responseBodyText",{value:n});throw a}let o="#text",i=Object.keys(s)[0],c=s[i];if(c[o])c[i]=c[o],delete c[o];return Pg(c)}return{}}),KF=async(t,r)=>{let n=await Zg(t,r);if(n.Error)n.Error.message=n.Error.message??n.Error.Message;return n},em=(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 Rc extends Ce{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??Ec)(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=Te.of(o),[c,a]=this.getXmlnsAttribute(t,n);for(let[d,f]of t.structIterator()){let l=r[d];if(l!=null||f.isIdempotencyToken()){if(f.getMergedTraits().xmlAttribute){i.addAttribute(f.getMergedTraits().xmlName??d,this.writeSimple(f,l));continue}if(f.isListSchema())this.writeList(f,l,i,a);else if(f.isMapSchema())this.writeMap(f,l,i,a);else if(f.isStructSchema())i.addChildNode(this.writeStruct(f,l,a));else{let h=Te.of(f.getMergedTraits().xmlName??f.getMemberName());this.writeSimpleInto(f,l,h,a),i.addChildNode(h)}}}let{$unknown:u}=r;if(u&&t.isUnionSchema()&&Array.isArray(u)&&Object.keys(r).length===1){let[d,f]=u,l=Te.of(d);if(typeof f!=="string")if(r instanceof Te||r instanceof Ag)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,f,l,a),i.addChildNode(l)}if(a)i.addAttribute(c,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(),c=i.getMergedTraits(),a=!!c.sparse,u=!!o.xmlFlattened,[d,f]=this.getXmlnsAttribute(t,s),l=(h,p)=>{if(i.isListSchema())this.writeList(i,Array.isArray(p)?p:[p],h,f);else if(i.isMapSchema())this.writeMap(i,p,h,f);else if(i.isStructSchema()){let g=this.writeStruct(i,p,f);h.addChildNode(g.withName(u?o.xmlName??t.getMemberName():c.xmlName??"member"))}else{let g=Te.of(u?o.xmlName??t.getMemberName():c.xmlName??"member");this.writeSimpleInto(i,p,g,f),h.addChildNode(g)}};if(u){for(let h of r)if(a||h!=null)l(n,h)}else{let h=Te.of(o.xmlName??t.getMemberName());if(f)h.addAttribute(d,f);for(let p of r)if(a||p!=null)l(h,p);n.addChildNode(h)}}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(),c=t.getKeySchema(),u=c.getMergedTraits().xmlName??"key",d=t.getValueSchema(),f=d.getMergedTraits(),l=f.xmlName??"value",h=!!f.sparse,p=!!i.xmlFlattened,[g,m]=this.getXmlnsAttribute(t,s),y=(S,w,_)=>{let v=Te.of(u,w),[L,k]=this.getXmlnsAttribute(c,m);if(k)v.addAttribute(L,k);S.addChildNode(v);let U=Te.of(l);if(d.isListSchema())this.writeList(d,_,U,m);else if(d.isMapSchema())this.writeMap(d,_,U,m,!0);else if(d.isStructSchema())U=this.writeStruct(d,_,m);else this.writeSimpleInto(d,_,U,m);S.addChildNode(U)};if(p)for(let S in r){let w=r[S];if(h||w!=null){let _=Te.of(i.xmlName??t.getMemberName());y(_,S,w),n.addChildNode(_)}}else{let S;if(!o){if(S=Te.of(i.xmlName??t.getMemberName()),m)S.addAttribute(g,m);n.addChildNode(S)}for(let w in r){let _=r[w];if(h||_!=null){let v=Te.of("entry");y(v,w,_),(o?n:S).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=bn(r);break;case 7:s=String(r.getTime()/1000);break;default:console.warn("Missing timestamp format, using http date",r),s=bn(r);break}else if(n.isBigDecimalSchema()&&r){if(r instanceof te)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=Ks();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),c=new Ag(o),[a,u]=this.getXmlnsAttribute(i,s);if(u)n.addAttribute(a,u);n.addChildNode(c)}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 vc extends Ce{settings;constructor(t){super();this.settings=t}createSerializer(){let t=new Rc(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new eo(this.settings);return t.setSerdeContext(this.serdeContext),t}}class tm extends Mg{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 vc(r),this.serializer=new Dg(this.codec.createSerializer(),r),this.deserializer=new Fg(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=em(n,s)??"Unknown";if(this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace),s.Error&&typeof s.Error==="object"){for(let g of Object.keys(s.Error))if(s[g]=s.Error[g],g.toLowerCase()==="message")s.message=s.Error[g]}if(s.RequestId&&!o.requestId)o.requestId=s.RequestId;let{errorSchema:c,errorMetadata:a}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,n,s,o),u=F.of(c),d=s.Error?.message??s.Error?.Message??s.message??s.Message??"UnknownError",l=new(this.compositeErrorRegistry.getErrorCtor(c)??Error)({});await this.deserializeHttpMessage(c,r,n,s);let h={},p=this.codec.createDeserializer();for(let[g,m]of u.structIterator()){let y=m.getMergedTraits().xmlName??g,S=s.Error?.[y]??s[y];h[g]=p.readSchema(m,S)}throw this.mixin.decorateServiceException(Object.assign(l,a,{$fault:u.getMergedTraits().error,message:d},h),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=Jg;ZF.AwsJson1_0Protocol=Gg;ZF.AwsJson1_1Protocol=Kg;ZF.AwsJsonRpcProtocol=Zs;ZF.AwsQueryProtocol=Ic;ZF.AwsRestJsonProtocol=Qg;ZF.AwsRestXmlProtocol=tm;ZF.AwsSmithyRpcV2CborProtocol=Hg;ZF.JsonCodec=Yg;ZF.JsonCodec2=Js;ZF.JsonShapeDeserializer=xc;ZF.JsonShapeDeserializer2=Ac;ZF.JsonShapeSerializer=Tc;ZF.JsonShapeSerializer2=Ys;ZF.QueryShapeSerializer=Cc;ZF.XmlCodec=vc;ZF.XmlShapeDeserializer=eo;ZF.XmlShapeSerializer=Rc;ZF._toBool=YF;ZF._toNum=JF;ZF._toStr=XF;ZF.awsExpectUnion=QF;ZF.loadJsonRpcErrorCode=jg;ZF.loadRestJsonErrorCode=Vg;ZF.loadRestXmlErrorCode=em;ZF.parseJsonBody=Xs;ZF.parseJsonErrorBody=zF;ZF.parseXmlBody=Zg;ZF.parseXmlErrorBody=KF});var Tn=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}=he(),{NoAuthSigner:HL,getHttpAuthSchemeEndpointRuleSetPlugin:zL,DefaultIdentityProviderConfig:qL,getHttpSigningPlugin:VL}=nt(),{normalizeProvider:im,getSmithyContext:jL,ServiceException:WL,NoOpLogger:GL,emitWarningIfUnsupportedVersion:KL,loadConfigsForDefaultMode:QL,getDefaultExtensionConfiguration:XL,resolveDefaultRuntimeConfig:YL,Client:am,makeBuilder:JL,createAggregatedClient:ZL}=ue(),{Command:eU}=ue();q$.$Command=eU;q$.__Client=am;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}=Z(),{BinaryDecisionDiagram:aU,EndpointCache:cU,decideEndpoint:uU,customEndpointFunctions:dU,resolveEndpointConfig:lU,getEndpointPlugin:fU}=Je(),{parseUrl:hU,getHttpHandlerExtensionConfiguration:pU,resolveHttpHandlerRuntimeConfig:gU,getContentLengthPlugin:mU}=Y(),{DEFAULT_RETRY_MODE:yU,NODE_RETRY_MODE_CONFIG_OPTIONS:SU,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:wU,resolveRetryConfig:EU,getRetryPlugin:bU}=ut(),{TypeRegistry:cm,getSchemaSerdePlugin:_U}=ve(),{resolveAwsSdkSigV4Config:AU,AwsSdkSigV4Signer:xU,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:TU}=ot(),{toUtf8:CU,fromUtf8:IU,toBase64:RU,fromBase64:vU,calculateBodyLength:NU}=Ae(),{streamCollector:OU,NodeHttpHandler:PU}=Et(),{AwsRestJsonProtocol:kU}=mt(),{Sha256:MU}=dt(),DU=async(t,r,n)=>({operation:jL(r).operation,region:await im(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:im(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},_n="ref",Ut=-1,to=!0,rm="isSet",um="PartitionResult",ro="booleanEquals",Nc="getAttr",nm={[_n]:"Endpoint"},Oc={[_n]:um},xr={},sm=[{[_n]:"Region"}],om={conditions:[[rm,[nm]],[rm,sm],["aws.partition",sm,um],[ro,[{[_n]:"UseFIPS"},to]],[ro,[{[_n]:"UseDualStack"},to]],[ro,[{fn:Nc,argv:[Oc,"supportsDualStack"]},to]],[ro,[{fn:Nc,argv:[Oc,"supportsFIPS"]},to]],["stringEquals",[{fn:Nc,argv:[Oc,"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"],[nm,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,pe=1e8,jU=new Int32Array([-1,1,-1,0,13,3,1,4,pe+12,2,5,pe+12,3,8,6,4,7,pe+11,5,pe+9,pe+10,4,11,9,6,10,pe+8,7,pe+6,pe+7,5,12,pe+5,6,pe+4,pe+5,3,pe+1,14,4,pe+2,pe+3]),WU=aU.from(jU,VU,om.conditions,om.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 no extends le{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(t){super({name:"AccessDeniedException",$fault:"client",...t});Object.setPrototypeOf(this,no.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}}class so extends le{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(t){super({name:"AuthorizationPendingException",$fault:"client",...t});Object.setPrototypeOf(this,so.prototype),this.error=t.error,this.error_description=t.error_description}}class oo extends le{name="ExpiredTokenException";$fault="client";error;error_description;constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t});Object.setPrototypeOf(this,oo.prototype),this.error=t.error,this.error_description=t.error_description}}class io extends le{name="InternalServerException";$fault="server";error;error_description;constructor(t){super({name:"InternalServerException",$fault:"server",...t});Object.setPrototypeOf(this,io.prototype),this.error=t.error,this.error_description=t.error_description}}class ao extends le{name="InvalidClientException";$fault="client";error;error_description;constructor(t){super({name:"InvalidClientException",$fault:"client",...t});Object.setPrototypeOf(this,ao.prototype),this.error=t.error,this.error_description=t.error_description}}class co extends le{name="InvalidGrantException";$fault="client";error;error_description;constructor(t){super({name:"InvalidGrantException",$fault:"client",...t});Object.setPrototypeOf(this,co.prototype),this.error=t.error,this.error_description=t.error_description}}class uo extends le{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(t){super({name:"InvalidRequestException",$fault:"client",...t});Object.setPrototypeOf(this,uo.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}}class lo extends le{name="InvalidScopeException";$fault="client";error;error_description;constructor(t){super({name:"InvalidScopeException",$fault:"client",...t});Object.setPrototypeOf(this,lo.prototype),this.error=t.error,this.error_description=t.error_description}}class fo extends le{name="SlowDownException";$fault="client";error;error_description;constructor(t){super({name:"SlowDownException",$fault:"client",...t});Object.setPrototypeOf(this,fo.prototype),this.error=t.error,this.error_description=t.error_description}}class ho extends le{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(t){super({name:"UnauthorizedClientException",$fault:"client",...t});Object.setPrototypeOf(this,ho.prototype),this.error=t.error,this.error_description=t.error_description}}class po extends le{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(t){super({name:"UnsupportedGrantTypeException",$fault:"client",...t});Object.setPrototypeOf(this,po.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",Ie="error_description",b$="grantType",_$="http",Re="httpError",A$="idToken",dm="reason",lm="refreshToken",x$="redirectUri",fm="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",T$="scope",C$="server",I$="tokenType",V="com.amazonaws.ssooidc",hm=new cm(fm),pm=[-3,fm,"SSOOIDCServiceException",0,[],[]];hm.registerError(pm,le);var Ee=new cm(V),gm=[-3,V,QU,{[z]:ze,[Re]:400},[z,dm,Ie],[0,0,0]];Ee.registerError(gm,no);var mm=[-3,V,XU,{[z]:ze,[Re]:400},[z,Ie],[0,0]];Ee.registerError(mm,so);var ym=[-3,V,n$,{[z]:ze,[Re]:400},[z,Ie],[0,0]];Ee.registerError(ym,oo);var Sm=[-3,V,a$,{[z]:C$,[Re]:500},[z,Ie],[0,0]];Ee.registerError(Sm,io);var wm=[-3,V,s$,{[z]:ze,[Re]:401},[z,Ie],[0,0]];Ee.registerError(wm,ao);var Em=[-3,V,o$,{[z]:ze,[Re]:400},[z,Ie],[0,0]];Ee.registerError(Em,co);var bm=[-3,V,i$,{[z]:ze,[Re]:400},[z,dm,Ie],[0,0,0]];Ee.registerError(bm,uo);var _m=[-3,V,c$,{[z]:ze,[Re]:400},[z,Ie],[0,0]];Ee.registerError(_m,lo);var Am=[-3,V,l$,{[z]:ze,[Re]:400},[z,Ie],[0,0]];Ee.registerError(Am,fo);var xm=[-3,V,f$,{[z]:ze,[Re]:400},[z,Ie],[0,0]];Ee.registerError(xm,ho);var Tm=[-3,V,h$,{[z]:ze,[Re]:400},[z,Ie],[0,0]];Ee.registerError(Tm,po);var Cm=[hm,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],Im=[0,V,d$,8,0],Rm=[3,V,e$,0,[g$,m$,b$,w$,S$,lm,T$,x$,y$],[0,[()=>v$,0],0,0,0,[()=>Im,0],64,0,[()=>N$,0]],3],vm=[3,V,t$,0,[p$,I$,E$,lm,A$],[[()=>R$,0],0,1,[()=>Im,0],[()=>O$,0]]],Nm=[9,V,ZU,{[_$]:["POST","/token",200]},()=>Rm,()=>vm],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:Cm,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((c)=>c.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 Pc extends am{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),c=FL(i),a=lU(c),u=$U(a),d=F$(u,t?.extensions||[]);this.config=d,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(f)=>new qL({"aws.auth#sigv4":f.credentials})})),this.middlewareStack.use(VL(this.config))}destroy(){super.destroy()}}var L$=JL(HU,"AWSSSOOIDCService","SSOOIDCClient",fU),U$={},$$=(t,r,n,s)=>[];class kc extends L$(U$,$$,"CreateToken",Nm){}var B$={CreateTokenCommand:kc};class Mc extends Pc{}ZL(B$,Mc);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=no;q$.AccessDeniedException$=gm;q$.AccessDeniedExceptionReason=H$;q$.AuthorizationPendingException=so;q$.AuthorizationPendingException$=mm;q$.CreateToken$=Nm;q$.CreateTokenCommand=kc;q$.CreateTokenRequest$=Rm;q$.CreateTokenResponse$=vm;q$.ExpiredTokenException=oo;q$.ExpiredTokenException$=ym;q$.InternalServerException=io;q$.InternalServerException$=Sm;q$.InvalidClientException=ao;q$.InvalidClientException$=wm;q$.InvalidGrantException=co;q$.InvalidGrantException$=Em;q$.InvalidRequestException=uo;q$.InvalidRequestException$=bm;q$.InvalidRequestExceptionReason=z$;q$.InvalidScopeException=lo;q$.InvalidScopeException$=_m;q$.SSOOIDC=Mc;q$.SSOOIDCClient=Pc;q$.SSOOIDCServiceException=le;q$.SSOOIDCServiceException$=pm;q$.SlowDownException=fo;q$.SlowDownException$=Am;q$.UnauthorizedClientException=ho;q$.UnauthorizedClientException$=xm;q$.UnsupportedGrantTypeException=po;q$.UnsupportedGrantTypeException$=Tm;q$.errorTypeRegistries=Cm});var Mm=e(function(z2){var{setTokenFeature:T2}=he(),{getBearerTokenEnvKey:C2}=ot(),{TokenProviderError:Ne,getSSOTokenFilepath:I2,parseKnownFiles:R2,getProfileName:v2,loadSsoSessionData:N2,getSSOTokenFromFile:O2,memoize:P2,chain:k2}=Z(),{promises:M2}=I("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}=Tn(),o=(c)=>r.clientConfig?.[c]??r.parentClientConfig?.[c]??n?.[c];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}=Tn();return(await F2(r,n,s)).send(new o({clientId:t.clientId,clientSecret:t.clientSecret,refreshToken:t.refreshToken,grantType:"refresh_token"}))},Om=(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)},Pm=new Map,km=(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 g of["sso_start_url","sso_region"])if(!a[g])throw new Ne(`Sso session '${i}' is missing required property '${g}'.`,!1);a.sso_start_url;let u=a.sso_region,d;try{d=await O2(i)}catch(g){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",d.accessToken),$t("expiresAt",d.expiresAt);let{accessToken:f,expiresAt:l}=d,h={token:f,expiration:new Date(l)};if(h.expiration.getTime()-Date.now()>300000)return h;let p=Pm.get(i)??0;if(Date.now()-p<30000)return Om(h),h;$t("clientId",d.clientId,!0),$t("clientSecret",d.clientSecret,!0),$t("refreshToken",d.refreshToken,!0);try{Pm.set(i,Date.now());let g=await L2(d,u,t,r);$t("accessToken",g.accessToken),$t("expiresIn",g.expiresIn);let m=new Date(Date.now()+g.expiresIn*1000);try{await $2(i,{...d,accessToken:g.accessToken,expiresAt:m.toISOString(),refreshToken:g.refreshToken})}catch(y){}return{token:g.accessToken,expiration:m}}catch(g){return Om(h),h}},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(km(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=km;z2.fromStatic=B2;z2.nodeProvider=H2});var ry=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}=he(),{NoAuthSigner:oB,getHttpAuthSchemeEndpointRuleSetPlugin:iB,DefaultIdentityProviderConfig:aB,getHttpSigningPlugin:cB}=nt(),{normalizeProvider:Bm,getSmithyContext:uB,ServiceException:dB,NoOpLogger:lB,emitWarningIfUnsupportedVersion:fB,loadConfigsForDefaultMode:hB,getDefaultExtensionConfiguration:pB,resolveDefaultRuntimeConfig:gB,Client:Hm,makeBuilder:mB,createAggregatedClient:yB}=ue(),{Command:SB}=ue();Q4.$Command=SB;Q4.__Client=Hm;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}=Z(),{BinaryDecisionDiagram:TB,EndpointCache:CB,decideEndpoint:IB,customEndpointFunctions:RB,resolveEndpointConfig:vB,getEndpointPlugin:NB}=Je(),{parseUrl:OB,getHttpHandlerExtensionConfiguration:PB,resolveHttpHandlerRuntimeConfig:kB,getContentLengthPlugin:MB}=Y(),{DEFAULT_RETRY_MODE:DB,NODE_RETRY_MODE_CONFIG_OPTIONS:FB,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:LB,resolveRetryConfig:UB,getRetryPlugin:$B}=ut(),{TypeRegistry:zm,getSchemaSerdePlugin:BB}=ve(),{resolveAwsSdkSigV4Config:HB,AwsSdkSigV4Signer:zB,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:qB}=ot(),{toUtf8:VB,fromUtf8:jB,toBase64:WB,fromBase64:GB,calculateBodyLength:KB}=Ae(),{streamCollector:QB,NodeHttpHandler:XB}=Et(),{AwsRestJsonProtocol:YB}=mt(),{Sha256:JB}=dt(),ZB=async(t,r,n)=>({operation:uB(r).operation,region:await Bm(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:Bm(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},An="ref",Ht=-1,go=!0,Dm="isSet",qm="PartitionResult",mo="booleanEquals",Dc="getAttr",Fm={[An]:"Endpoint"},Fc={[An]:qm},Tr={},Lm=[{[An]:"Region"}],Um={conditions:[[Dm,[Fm]],[Dm,Lm],["aws.partition",Lm,qm],[mo,[{[An]:"UseFIPS"},go]],[mo,[{[An]:"UseDualStack"},go]],[mo,[{fn:Dc,argv:[Fc,"supportsDualStack"]},go]],[mo,[{fn:Dc,argv:[Fc,"supportsFIPS"]},go]],["stringEquals",[{fn:Dc,argv:[Fc,"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"],[Fm,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,Um.conditions,Um.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 yo extends pt{name="InvalidRequestException";$fault="client";constructor(t){super({name:"InvalidRequestException",$fault:"client",...t});Object.setPrototypeOf(this,yo.prototype)}}class So extends pt{name="ResourceNotFoundException";$fault="client";constructor(t){super({name:"ResourceNotFoundException",$fault:"client",...t});Object.setPrototypeOf(this,So.prototype)}}class wo extends pt{name="TooManyRequestsException";$fault="client";constructor(t){super({name:"TooManyRequestsException",$fault:"client",...t});Object.setPrototypeOf(this,wo.prototype)}}class Eo extends pt{name="UnauthorizedException";$fault="client";constructor(t){super({name:"UnauthorizedException",$fault:"client",...t});Object.setPrototypeOf(this,Eo.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",bo="client",_o="error",R4="expiration",v4="http",Ao="httpError",N4="httpHeader",$m="httpQuery",xo="message",O4="roleCredentials",P4="roleName",k4="role_name",Vm="smithy.ts.sdk.synthetic.com.amazonaws.sso",M4="secretAccessKey",D4="sessionToken",F4="x-amz-sso_bearer_token",be="com.amazonaws.sso",jm=new zm(Vm),Wm=[-3,Vm,"SSOServiceException",0,[],[]];jm.registerError(Wm,pt);var xn=new zm(be),Gm=[-3,be,y4,{[_o]:bo,[Ao]:400},[xo],[0]];xn.registerError(Gm,yo);var Km=[-3,be,w4,{[_o]:bo,[Ao]:404},[xo],[0]];xn.registerError(Km,So);var Qm=[-3,be,_4,{[_o]:bo,[Ao]:429},[xo],[0]];xn.registerError(Qm,wo);var Xm=[-3,be,A4,{[_o]:bo,[Ao]:401},[xo],[0]];xn.registerError(Xm,Eo);var Ym=[jm,xn],L4=[0,be,h4,8,0],U4=[0,be,E4,8,0],$4=[0,be,b4,8,0],Jm=[3,be,g4,0,[P4,x4,C4],[[0,{[$m]:k4}],[0,{[$m]:I4}],[()=>L4,{[N4]:F4}]],3],Zm=[3,be,m4,0,[O4],[[()=>ey,0]]],ey=[3,be,S4,0,[T4,M4,D4,R4],[0,[()=>U4,0],[()=>$4,0],1]],ty=[9,be,p4,{[v4]:["GET","/federation/credentials",200]},()=>Jm,()=>Zm],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:Ym,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((c)=>c.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 Lc extends Hm{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),c=eB(i),a=vB(c),u=n4(a),d=V4(u,t?.extensions||[]);this.config=d,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(f)=>new aB({"aws.auth#sigv4":f.credentials})})),this.middlewareStack.use(cB(this.config))}destroy(){super.destroy()}}var j4=mB(o4,"SWBPortalService","SSOClient",NB),W4={},G4=(t,r,n,s)=>[];class Uc extends j4(W4,G4,"GetRoleCredentials",ty){}var K4={GetRoleCredentialsCommand:Uc};class $c extends Lc{}yB(K4,$c);Q4.GetRoleCredentials$=ty;Q4.GetRoleCredentialsCommand=Uc;Q4.GetRoleCredentialsRequest$=Jm;Q4.GetRoleCredentialsResponse$=Zm;Q4.InvalidRequestException=yo;Q4.InvalidRequestException$=Gm;Q4.ResourceNotFoundException=So;Q4.ResourceNotFoundException$=Km;Q4.RoleCredentials$=ey;Q4.SSO=$c;Q4.SSOClient=Lc;Q4.SSOServiceException=pt;Q4.SSOServiceException$=Wm;Q4.TooManyRequestsException=wo;Q4.TooManyRequestsException$=Qm;Q4.UnauthorizedException=Eo;Q4.UnauthorizedException$=Xm;Q4.errorTypeRegistries=Ym});var ny=e(function(SH){var{GetRoleCredentialsCommand:mH,SSOClient:yH}=ry();SH.GetRoleCredentialsCommand=mH;SH.SSOClient=yH});var Bc=e(function(IH){var{CredentialsProviderError:Oe,getSSOTokenFromFile:bH,getProfileName:_H,parseKnownFiles:AH,loadSsoSessionData:xH}=Z(),{setCredentialFeature:sy}=he(),{fromSso:TH}=Mm(),iy=(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"),oy=async({ssoStartUrl:t,ssoSession:r,ssoAccountId:n,ssoRegion:s,ssoRoleName:o,ssoClient:i,clientConfig:c,parentClientConfig:a,callerClientConfig:u,profile:d,filepath:f,configFilepath:l,ignoreCache:h,logger:p})=>{let g,m="To refresh this SSO session run aws sso login with the corresponding profile.";if(r)try{let D=await TH({profile:d,filepath:f,configFilepath:l,ignoreCache:h,clientConfig:c,parentClientConfig:a,logger:p})({callerClientConfig:u});g={accessToken:D.token,expiresAt:new Date(D.expiration).toISOString()}}catch(D){throw new Oe(D.message,{tryNextLink:!1,logger:p})}else try{g=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:p})}if(new Date(g.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:p});let{accessToken:y}=g,{SSOClient:S,GetRoleCredentialsCommand:w}=ny(),_=i||new S(Object.assign({},c??{},{logger:c?.logger??u?.logger??a?.logger,region:c?.region??s,userAgentAppId:c?.userAgentAppId??u?.userAgentAppId??a?.userAgentAppId})),v;try{v=await _.send(new w({accountId:n,roleName:o,accessToken:y}))}catch(D){throw new Oe(D,{tryNextLink:!1,logger:p})}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:p});let ke={accessKeyId:L,secretAccessKey:k,sessionToken:U,expiration:new Date(de),...q&&{credentialScope:q},...j&&{accountId:j}};if(r)sy(ke,"CREDENTIALS_SSO","s");else sy(ke,"CREDENTIALS_SSO_LEGACY","u");return ke},ay=(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:c}=t,{ssoClient:a}=t,u=_H({profile:t.profile??r?.profile});if(!n&&!s&&!o&&!i&&!c){let f=(await AH(t))[u];if(!f)throw new Oe(`Profile ${u} was not found.`,{logger:t.logger});if(!iy(f))throw new Oe(`Profile ${u} is not configured with SSO credentials.`,{logger:t.logger});if(f?.sso_session){let S=(await xH(t))[f.sso_session],w=` configurations in profile ${u} and sso-session ${f.sso_session}`;if(o&&o!==S.sso_region)throw new Oe("Conflicting SSO region"+w,{tryNextLink:!1,logger:t.logger});if(n&&n!==S.sso_start_url)throw new Oe("Conflicting SSO start_url"+w,{tryNextLink:!1,logger:t.logger});f.sso_region=S.sso_region,f.sso_start_url=S.sso_start_url}let{sso_start_url:l,sso_account_id:h,sso_region:p,sso_role_name:g,sso_session:m}=ay(f,t.logger);return oy({ssoStartUrl:l,ssoSession:m,ssoAccountId:h,ssoRegion:p,ssoRoleName:g,ssoClient:a,clientConfig:t.clientConfig,parentClientConfig:t.parentClientConfig,callerClientConfig:t.callerClientConfig,profile:u,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 oy({ssoStartUrl:n,ssoSession:c,ssoAccountId:s,ssoRegion:o,ssoRoleName:i,ssoClient:a,clientConfig:t.clientConfig,parentClientConfig:t.parentClientConfig,callerClientConfig:t.callerClientConfig,profile:u,filepath:t.filepath,configFilepath:t.configFilepath,ignoreCache:t.ignoreCache,logger:t.logger})};IH.fromSSO=CH;IH.isSsoProfile=iy;IH.validateSsoProfile=ay});var hy=e(function(PH){var{SignatureV4:OH,signatureV4aContainer:cy}=Na(),Cn={CrtSignerV4:null},uy="X-Amz-S3session-Token".toLowerCase();class Hc extends OH{async signWithCredentials(t,r,n){let s=dy(r);t.headers[uy]=r.sessionToken;let o=this;return ly(o,s),o.signRequest(t,n??{})}async presignWithCredentials(t,r,n){let s=dy(r);return delete t.headers[uy],t.headers["X-Amz-S3session-Token"]=r.sessionToken,t.query=t.query??{},t.query["X-Amz-S3session-Token"]=r.sessionToken,ly(this,s),this.presign(t,n)}}function dy(t){return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,expiration:t.expiration}}function ly(t,r){let n=t.credentialProvider;t.credentialProvider=()=>(t.credentialProvider=n,Promise.resolve(r))}class fy{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){if(typeof Cn.CrtSignerV4==="function")return"crt";else if(typeof cy.SignatureV4a==="function")return"js";return"none"}constructor(t){this.sigv4Signer=new Hc(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=Cn.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=Cn.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=Cn.CrtSignerV4,r=cy.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=fy;PH.SignatureV4SignWithCredentials=Hc;PH.signatureV4CrtContainer=Cn});var Jc=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:Vc,stsRegionDefaultResolver:KH}=he(),{NoAuthSigner:_y,getHttpAuthSchemeEndpointRuleSetPlugin:QH,DefaultIdentityProviderConfig:XH,getHttpSigningPlugin:YH}=nt(),{normalizeProvider:Ay,getSmithyContext:xy,ServiceException:JH,NoOpLogger:ZH,emitWarningIfUnsupportedVersion:ez,loadConfigsForDefaultMode:tz,getDefaultExtensionConfiguration:rz,resolveDefaultRuntimeConfig:nz,Client:Ty,makeBuilder:sz,createAggregatedClient:oz}=ue(),{Command:iz}=ue();iq.$Command=iz;iq.__Client=Ty;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}=Z(),{BinaryDecisionDiagram:hz,EndpointCache:pz,decideEndpoint:gz,customEndpointFunctions:mz,resolveParams:yz,resolveEndpointConfig:Sz,getEndpointPlugin:wz}=Je(),{parseUrl:Ez,getHttpHandlerExtensionConfiguration:bz,resolveHttpHandlerRuntimeConfig:_z,getContentLengthPlugin:Az}=Y(),{DEFAULT_RETRY_MODE:xz,NODE_RETRY_MODE_CONFIG_OPTIONS:Tz,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:Cz,resolveRetryConfig:Iz,getRetryPlugin:Rz}=ut(),{TypeRegistry:Cy,getSchemaSerdePlugin:vz}=ve(),{resolveAwsSdkSigV4Config:Nz,resolveAwsSdkSigV4AConfig:Oz,AwsSdkSigV4Signer:Iy,AwsSdkSigV4ASigner:Ry,NODE_SIGV4A_CONFIG_OPTIONS:Pz,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:kz}=ot(),{SignatureV4MultiRegion:vy}=hy(),{toUtf8:Mz,fromUtf8:Dz,toBase64:Fz,fromBase64:Lz,calculateBodyLength:Uz}=Ae(),{streamCollector:$z,NodeHttpHandler:Bz}=Et(),{AwsQueryProtocol:Hz}=mt(),{Sha256:zz}=dt(),Ir="ref",zt=-1,In=!0,py="isSet",Ny="PartitionResult",Rn="booleanEquals",re="stringEquals",zc="getAttr",gy="us-east-1",my="sigv4",yy="sts",Sy="https://sts.{Region}.{PartitionResult#dnsSuffix}",wy={[Ir]:"Endpoint"},ne={[Ir]:"Region"},qc={[Ir]:Ny},Cr={},Ey=[ne],by={conditions:[[py,[wy]],[py,Ey],["aws.partition",Ey,Ny],[Rn,[{[Ir]:"UseFIPS"},In]],[Rn,[{[Ir]:"UseDualStack"},In]],[re,[ne,"aws-global"]],[Rn,[{[Ir]:"UseGlobalEndpoint"},In]],[re,[ne,"eu-central-1"]],[Rn,[{fn:zc,argv:[qc,"supportsDualStack"]},In]],[Rn,[{fn:zc,argv:[qc,"supportsFIPS"]},In]],[re,[ne,"ap-south-1"]],[re,[ne,"eu-north-1"]],[re,[ne,"eu-west-1"]],[re,[ne,"eu-west-2"]],[re,[ne,"eu-west-3"]],[re,[ne,"sa-east-1"]],[re,[ne,gy]],[re,[ne,"us-east-2"]],[re,[ne,"us-west-2"]],[re,[ne,"us-west-1"]],[re,[ne,"ca-central-1"]],[re,[ne,"ap-southeast-1"]],[re,[ne,"ap-northeast-1"]],[re,[ne,"ap-southeast-2"]],[re,[{fn:zc,argv:[qc,"name"]},"aws-us-gov"]]],results:[[zt],["https://sts.amazonaws.com",{authSchemes:[{name:my,signingName:yy,signingRegion:gy}]}],[Sy,{authSchemes:[{name:my,signingName:yy,signingRegion:"{Region}"}]}],[zt,"Invalid Configuration: FIPS and custom endpoint are not supported"],[zt,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[wy,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"],[Sy,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,by.conditions,by.results),Wz=new pz({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),Oy=(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=xy(n)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!i)throw Error(`getEndpointParameterInstructions() is not defined on '${n.commandName}'`);let c=await yz(s,{getEndpointParameterInstructions:i},r);return Object.assign(o,c)},Kz=async(t,r,n)=>({operation:xy(r).operation,region:await Ay(t.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),Qz=Gz(Kz);function Py(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(r,n)=>({signingProperties:{config:r,context:n}})}}function jc(t){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(r,n)=>({signingProperties:{config:r,context:n}})}}function ky(t){return{schemeId:"smithy.api#noAuth"}}var Xz=(t,r,n)=>(o)=>{let c=t(o).properties?.authSchemes;if(!c)return r(o);let a=[];for(let u of c){let{name:d,properties:f={},...l}=u,h=d.toLowerCase();if(d!==h)console.warn(`HttpAuthScheme has been normalized with lowercasing: '${d}' to '${h}'`);let p;if(h==="sigv4a"){p="aws.auth#sigv4a";let y=c.find((S)=>{let w=S.name.toLowerCase();return w!=="sigv4a"&&w.startsWith("sigv4")});if(vy.sigv4aDependency()==="none"&&y)continue}else if(h.startsWith("sigv4"))p="aws.auth#sigv4";else throw Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${h}'`);let g=n[p];if(!g)throw Error(`Could not find HttpAuthOption create function for '${p}'`);let m=g(o);m.schemeId=p,m.signingProperties={...m.signingProperties||{},...l,...f},a.push(m)}return a},Yz=(t)=>{let r=[];switch(t.operation){case"AssumeRoleWithWebIdentity":{r.push(ky()),r.push(jc(t));break}default:r.push(Py(t)),r.push(jc(t))}return r},Jz=Xz(Oy,Yz,{"aws.auth#sigv4":Py,"aws.auth#sigv4a":jc,"smithy.api#noAuth":ky}),Zz=(t)=>{let r=Nz(t),n=Oz(r);return Object.assign(n,{authSchemePreference:Ay(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 To extends Pe{name="ExpiredTokenException";$fault="client";constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t});Object.setPrototypeOf(this,To.prototype)}}class Co extends Pe{name="MalformedPolicyDocumentException";$fault="client";constructor(t){super({name:"MalformedPolicyDocumentException",$fault:"client",...t});Object.setPrototypeOf(this,Co.prototype)}}class Io extends Pe{name="PackedPolicyTooLargeException";$fault="client";constructor(t){super({name:"PackedPolicyTooLargeException",$fault:"client",...t});Object.setPrototypeOf(this,Io.prototype)}}class Ro extends Pe{name="RegionDisabledException";$fault="client";constructor(t){super({name:"RegionDisabledException",$fault:"client",...t});Object.setPrototypeOf(this,Ro.prototype)}}class vo extends Pe{name="IDPRejectedClaimException";$fault="client";constructor(t){super({name:"IDPRejectedClaimException",$fault:"client",...t});Object.setPrototypeOf(this,vo.prototype)}}class No extends Pe{name="InvalidIdentityTokenException";$fault="client";constructor(t){super({name:"InvalidIdentityTokenException",$fault:"client",...t});Object.setPrototypeOf(this,No.prototype)}}class Oo extends Pe{name="IDPCommunicationErrorException";$fault="client";$retryable={};constructor(t){super({name:"IDPCommunicationErrorException",$fault:"client",...t});Object.setPrototypeOf(this,Oo.prototype)}}var s3="Arn",o3="AccessKeyId",i3="AssumeRole",a3="AssumedRoleId",c3="AssumeRoleRequest",u3="AssumeRoleResponse",Wc="AssumedRoleUser",d3="AssumeRoleWithWebIdentity",l3="AssumeRoleWithWebIdentityRequest",f3="AssumeRoleWithWebIdentityResponse",h3="Audience",Gc="Credentials",p3="ContextAssertion",My="DurationSeconds",g3="Expiration",m3="ExternalId",y3="ExpiredTokenException",S3="IDPCommunicationErrorException",w3="IDPRejectedClaimException",E3="InvalidIdentityTokenException",b3="Key",_3="MalformedPolicyDocumentException",Dy="MinimumSessionTokenSize",Fy="Policy",Ly="PolicyArns",A3="ProviderArn",x3="ProvidedContexts",T3="ProvidedContextsListType",C3="ProvidedContext",I3="PolicyDescriptorType",R3="ProviderId",Uy="PackedPolicySize",v3="PackedPolicyTooLargeException",N3="Provider",$y="RoleArn",O3="RegionDisabledException",By="RoleSessionName",P3="SecretAccessKey",k3="SubjectFromWebIdentityToken",Kc="SourceIdentity",M3="SerialNumber",D3="SessionToken",Hy="SessionTokenSize",zy="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",qy="smithy.ts.sdk.synthetic.com.amazonaws.sts",W3="tagListType",B="com.amazonaws.sts",Vy=new Cy(qy),jy=[-3,qy,"STSServiceException",0,[],[]];Vy.registerError(jy,Pe);var yt=new Cy(B),Wy=[-3,B,y3,{[qt]:["ExpiredTokenException",400],[jt]:Vt,[Wt]:400},[Gt],[0]];yt.registerError(Wy,To);var Gy=[-3,B,S3,{[qt]:["IDPCommunicationError",400],[jt]:Vt,[Wt]:400},[Gt],[0]];yt.registerError(Gy,Oo);var Ky=[-3,B,w3,{[qt]:["IDPRejectedClaim",403],[jt]:Vt,[Wt]:403},[Gt],[0]];yt.registerError(Ky,vo);var Qy=[-3,B,E3,{[qt]:["InvalidIdentityToken",400],[jt]:Vt,[Wt]:400},[Gt],[0]];yt.registerError(Qy,No);var Xy=[-3,B,_3,{[qt]:["MalformedPolicyDocument",400],[jt]:Vt,[Wt]:400},[Gt],[0]];yt.registerError(Xy,Co);var Yy=[-3,B,v3,{[qt]:["PackedPolicyTooLarge",400],[jt]:Vt,[Wt]:400},[Gt],[0]];yt.registerError(Yy,Io);var Jy=[-3,B,O3,{[qt]:["RegionDisabledException",403],[jt]:Vt,[Wt]:403},[Gt],[0]];yt.registerError(Jy,Ro);var Zy=[Vy,yt],G3=[0,B,q3,8,0],K3=[0,B,V3,8,0],Qc=[3,B,Wc,0,[a3,s3],[0,0],2],eS=[3,B,c3,0,[$y,By,Ly,Fy,My,F3,U3,m3,M3,L3,Kc,x3,Dy],[0,0,()=>aS,0,1,()=>X3,64,0,0,0,0,()=>Q3,1],2],tS=[3,B,u3,0,[Gc,Wc,Uy,Kc,zy,Hy],[[()=>Xc,0],()=>Qc,1,0,1,1]],rS=[3,B,l3,0,[$y,By,H3,R3,Ly,Fy,My,Dy],[0,0,[()=>K3,0],0,()=>aS,0,1,1],3],nS=[3,B,f3,0,[Gc,k3,Wc,Uy,N3,h3,Kc,zy,Hy],[[()=>Xc,0],0,()=>Qc,1,0,0,0,1,1]],Xc=[3,B,Gc,0,[o3,P3,D3,g3],[0,[()=>G3,0],0,4],4],sS=[3,B,I3,0,[z3],[0]],oS=[3,B,C3,0,[A3,p3],[0,0]],iS=[3,B,$3,0,[b3,B3],[0,0],2],aS=[1,B,j3,0,()=>sS],Q3=[1,B,T3,0,()=>oS],X3=[1,B,W3,0,()=>iS],cS=[9,B,i3,0,()=>eS,()=>tS],uS=[9,B,d3,0,()=>rS,()=>nS],Y3=(t)=>({apiVersion:"2011-06-15",base64Decoder:t?.base64Decoder??Lz,base64Encoder:t?.base64Encoder??Fz,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??Oy,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??Jz,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new Iy},{schemeId:"aws.auth#sigv4a",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4a"),signer:new Ry},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new _y}],logger:t?.logger??new ZH,protocol:t?.protocol??Hz,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:Zy,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??vy,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(c)=>await t.credentialDefaultProvider(c?.__config||{})()),signer:new Iy},{schemeId:"aws.auth#sigv4a",identityProvider:(i)=>i.getIdentityProvider("aws.auth#sigv4a"),signer:new Ry},{schemeId:"smithy.api#noAuth",identityProvider:(i)=>i.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new _y}],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((c)=>c.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 vn extends Ty{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),c=qH(i),a=Sz(c),u=Zz(a),d=tq(u,t?.extensions||[]);this.config=d,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(f)=>new XH({"aws.auth#sigv4":f.credentials,"aws.auth#sigv4a":f.credentials})})),this.middlewareStack.use(YH(this.config))}destroy(){super.destroy()}}var dS=sz(t3,"AWSSecurityTokenServiceV20110615","STSClient",wz),lS={},fS=(t,r,n,s)=>[];class Po extends dS(lS,fS,"AssumeRole",cS){}class ko extends dS(lS,fS,"AssumeRoleWithWebIdentity",uS){}var rq={AssumeRoleCommand:Po,AssumeRoleWithWebIdentityCommand:ko};class Yc extends vn{}oz(rq,Yc);var hS=(t)=>{if(typeof t?.Arn==="string"){let r=t.Arn.split(":");if(r.length>4&&r[4]!=="")return r[4]}return},pS=async(t,r,n,s={})=>{let o=typeof t==="function"?await t():t,i=typeof r==="function"?await r():r,c="",a=o??i??(c=await KH(s)());return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${o} (credential provider clientConfig)`,`${i} (contextual client)`,`${c} (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:f=t?.parentClientConfig?.logger,profile:l=t?.parentClientConfig?.profile,region:h,requestHandler:p=t?.parentClientConfig?.requestHandler,credentialProviderLogger:g,userAgentAppId:m=t?.parentClientConfig?.userAgentAppId}=t,y=await pS(h,t?.parentClientConfig?.region,g,{logger:f,profile:l}),S=!gS(p);n=new r({...t,userAgentAppId:m,profile:l,credentialDefaultProvider:()=>async()=>s,region:y,requestHandler:S?p:void 0,logger:f})}let{Credentials:c,AssumedRoleUser:a}=await n.send(new Po(i));if(!c||!c.AccessKeyId||!c.SecretAccessKey)throw Error(`Invalid response from STS.assumeRole call with role ${i.RoleArn}`);let u=hS(a),d={accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.SessionToken,expiration:c.Expiration,...c.CredentialScope&&{credentialScope:c.CredentialScope},...u&&{accountId:u}};return Vc(d,"CREDENTIALS_STS_ASSUME_ROLE","i"),d}},sq=(t,r)=>{let n;return async(s)=>{if(!n){let{logger:u=t?.parentClientConfig?.logger,profile:d=t?.parentClientConfig?.profile,region:f,requestHandler:l=t?.parentClientConfig?.requestHandler,credentialProviderLogger:h,userAgentAppId:p=t?.parentClientConfig?.userAgentAppId}=t,g=await pS(f,t?.parentClientConfig?.region,h,{logger:u,profile:d}),m=!gS(l);n=new r({...t,userAgentAppId:p,profile:d,region:g,requestHandler:m?l:void 0,logger:u})}let{Credentials:o,AssumedRoleUser:i}=await n.send(new ko(s));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${s.RoleArn}`);let c=hS(i),a={accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration,...o.CredentialScope&&{credentialScope:o.CredentialScope},...c&&{accountId:c}};if(c)Vc(a,"RESOLVED_ACCOUNT_ID","T");return Vc(a,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),a}},gS=(t)=>t?.metadata?.handlerProtocol==="h2",mS=(t,r)=>{if(!r)return t;else return class extends t{constructor(s){super(s);for(let o of r)this.middlewareStack.use(o)}}},yS=(t={},r)=>nq(t,mS(vn,r)),SS=(t={},r)=>sq(t,mS(vn,r)),oq=(t)=>(r)=>t({roleAssumer:yS(r),roleAssumerWithWebIdentity:SS(r),...r});iq.AssumeRole$=cS;iq.AssumeRoleCommand=Po;iq.AssumeRoleRequest$=eS;iq.AssumeRoleResponse$=tS;iq.AssumeRoleWithWebIdentity$=uS;iq.AssumeRoleWithWebIdentityCommand=ko;iq.AssumeRoleWithWebIdentityRequest$=rS;iq.AssumeRoleWithWebIdentityResponse$=nS;iq.AssumedRoleUser$=Qc;iq.Credentials$=Xc;iq.ExpiredTokenException=To;iq.ExpiredTokenException$=Wy;iq.IDPCommunicationErrorException=Oo;iq.IDPCommunicationErrorException$=Gy;iq.IDPRejectedClaimException=vo;iq.IDPRejectedClaimException$=Ky;iq.InvalidIdentityTokenException=No;iq.InvalidIdentityTokenException$=Qy;iq.MalformedPolicyDocumentException=Co;iq.MalformedPolicyDocumentException$=Xy;iq.PackedPolicyTooLargeException=Io;iq.PackedPolicyTooLargeException$=Yy;iq.PolicyDescriptorType$=sS;iq.ProvidedContext$=oS;iq.RegionDisabledException=Ro;iq.RegionDisabledException$=Jy;iq.STS=Yc;iq.STSClient=vn;iq.STSServiceException=Pe;iq.STSServiceException$=jy;iq.Tag$=iS;iq.decorateDefaultCredentialProvider=oq;iq.errorTypeRegistries=Zy;iq.getDefaultRoleAssumer=yS;iq.getDefaultRoleAssumerWithWebIdentity=SS});var ow=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}=he(),{NoAuthSigner:r6,getHttpAuthSchemeEndpointRuleSetPlugin:n6,DefaultIdentityProviderConfig:s6,getHttpSigningPlugin:o6}=nt(),{normalizeProvider:MS,getSmithyContext:i6,ServiceException:a6,NoOpLogger:c6,emitWarningIfUnsupportedVersion:u6,loadConfigsForDefaultMode:d6,getDefaultExtensionConfiguration:l6,resolveDefaultRuntimeConfig:f6,Client:DS,makeBuilder:h6,createAggregatedClient:p6}=ue(),{Command:g6}=ue();VV.$Command=g6;VV.__Client=DS;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}=Z(),{BinaryDecisionDiagram:_6,EndpointCache:A6,decideEndpoint:x6,customEndpointFunctions:T6,resolveEndpointConfig:C6,getEndpointPlugin:I6}=Je(),{parseUrl:R6,getHttpHandlerExtensionConfiguration:v6,resolveHttpHandlerRuntimeConfig:N6,getContentLengthPlugin:O6}=Y(),{DEFAULT_RETRY_MODE:P6,NODE_RETRY_MODE_CONFIG_OPTIONS:k6,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:M6,resolveRetryConfig:D6,getRetryPlugin:F6}=ut(),{TypeRegistry:FS,getSchemaSerdePlugin:L6}=ve(),{resolveAwsSdkSigV4Config:U6,AwsSdkSigV4Signer:$6,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:B6}=ot(),{toUtf8:H6,fromUtf8:z6,toBase64:q6,fromBase64:V6,calculateBodyLength:j6}=Ae(),{streamCollector:W6,NodeHttpHandler:G6}=Et(),{AwsRestJsonProtocol:K6}=mt(),{Sha256:Q6}=dt(),X6=async(t,r,n)=>({operation:i6(r).operation,region:await MS(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:MS(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},bt="ref",St=-1,wS=!1,Rr=!0,ES="isSet",vr="booleanEquals",bS="coalesce",su="PartitionResult",Xe="stringEquals",Zc="getAttr",_S="https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",AS={[bt]:"Endpoint"},wt={fn:Zc,argv:[{[bt]:su},"name"]},LS={[bt]:"Region"},xS={[bt]:su},Mo={authSchemes:[{name:"sigv4",signingName:"signin",signingRegion:"{Region}"}]},ae={},TS=[LS],CS={conditions:[[ES,TS],[vr,[{fn:bS,argv:[{[bt]:"IsControlPlane"},wS]},Rr]],[ES,[AS]],["aws.partition",TS,su],[vr,[{[bt]:"UseFIPS"},Rr]],[Xe,[wt,"aws"]],[vr,[{fn:bS,argv:[{[bt]:"IsOAuthEndpoint"},wS]},Rr]],[vr,[{[bt]:"UseDualStack"},Rr]],[Xe,[wt,"aws-cn"]],[Xe,[LS,"us-gov-west-1"]],[Xe,[wt,"aws-us-gov"]],[vr,[{fn:Zc,argv:[xS,"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:Zc,argv:[xS,"supportsDualStack"]},Rr]]],results:[[St],["https://signin.{Region}.api.aws",Mo],["https://signin.{Region}.api.amazonwebservices.com.cn",Mo],[_S,Mo],[St,"FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation."],["https://{Region}.oauth.signin.aws",Mo],["https://{Region}.signin.aws.amazon.com",ae],["https://{Region}.signin.amazonaws.cn",ae],["https://{Region}.signin.amazonaws-us-gov.com",ae],["https://{Region}.signin.c2shome.ic.gov",ae],["https://{Region}.signin.sc2shome.sgov.gov",ae],["https://{Region}.signin.csphome.hci.ic.gov",ae],["https://{Region}.signin.csphome.adc-e.uk",ae],["https://{Region}.signin.amazonaws-eusc.eu",ae],["https://signin-fips.amazonaws-us-gov.com",ae],["https://{Region}.signin-fips.amazonaws-us-gov.com",ae],["https://{Region}.signin.{PartitionResult#dnsSuffix}",ae],[St,"Invalid Configuration: FIPS and custom endpoint are not supported"],[St,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[AS,ae],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",ae],[St,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",ae],[St,"FIPS is enabled but this partition does not support FIPS"],[_S,ae],[St,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",ae],[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,CS.conditions,CS.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 At extends a6{constructor(t){super(t);Object.setPrototypeOf(this,At.prototype)}}class Fo extends At{name="AccessDeniedException";$fault="client";error;constructor(t){super({name:"AccessDeniedException",$fault:"client",...t});Object.setPrototypeOf(this,Fo.prototype),this.error=t.error}}class Lo extends At{name="InternalServerException";$fault="server";error;constructor(t){super({name:"InternalServerException",$fault:"server",...t});Object.setPrototypeOf(this,Lo.prototype),this.error=t.error}}class Uo extends At{name="TooManyRequestsError";$fault="client";error;constructor(t){super({name:"TooManyRequestsError",$fault:"client",...t});Object.setPrototypeOf(this,Uo.prototype),this.error=t.error}}class $o extends At{name="ValidationException";$fault="client";error;constructor(t){super({name:"ValidationException",$fault:"client",...t});Object.setPrototypeOf(this,$o.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",IS="accessKeyId",eu="accessToken",TV="access_token",ou="client",RS="clientId",vS="codeVerifier",CV="code",_t="error",tu="expiresIn",IV="expires_in",ru="grantType",RV="grant_type",US="http",iu="httpError",NS="idToken",se="jsonName",Bo="message",vV="resource",Do="refreshToken",OS="redirectUri",$S="smithy.ts.sdk.synthetic.com.amazonaws.signin",PS="secretAccessKey",kS="sessionToken",NV="server",OV="tokenInput",PV="tokenOutput",nu="tokenType",kV="token_type",ce="com.amazonaws.signin",BS=new FS($S),HS=[-3,$S,"SigninServiceException",0,[],[]];BS.registerError(HS,At);var Nn=new FS(ce),zS=[-3,ce,dV,{[_t]:ou},[_t,Bo],[0,0],2];Nn.registerError(zS,Fo);var qS=[-3,ce,EV,{[_t]:NV,[iu]:500},[_t,Bo],[0,0],2];Nn.registerError(qS,Lo);var VS=[-3,ce,AV,{[_t]:ou,[iu]:429},[_t,Bo],[0,0],2];Nn.registerError(VS,Uo);var jS=[-3,ce,xV,{[_t]:ou,[iu]:400},[_t,Bo],[0,0],2];Nn.registerError(jS,$o);var WS=[BS,Nn],MV=[0,ce,bV,8,0],GS=[0,ce,_V,8,0],KS=[3,ce,lV,8,[IS,PS,kS],[[0,{[se]:IS}],[0,{[se]:PS}],[0,{[se]:kS}]],3],QS=[3,ce,hV,0,[OV],[[()=>XS,16]],1],XS=[3,ce,pV,0,[RS,ru,CV,OS,vS,Do],[[0,{[se]:RS}],[0,{[se]:ru}],0,[0,{[se]:OS}],[0,{[se]:vS}],[()=>GS,{[se]:Do}]],2],YS=[3,ce,mV,0,[PV],[[()=>JS,16]],1],JS=[3,ce,gV,0,[eu,nu,tu,Do,NS],[[()=>KS,{[se]:eu}],[0,{[se]:nu}],[1,{[se]:tu}],[()=>GS,{[se]:Do}],[0,{[se]:NS}]],4],ZS=[3,ce,SV,0,[ru,vV],[[0,{[se]:RV}],0],2],ew=[3,ce,wV,0,[eu,nu,tu],[[()=>MV,{[se]:TV}],[0,{[se]:kV}],[1,{[se]:IV}]],3],tw=[9,ce,fV,{[US]:["POST","/v1/token",200]},()=>QS,()=>YS],rw=[9,ce,yV,{[US]:["POST","/v1/token?x-amz-client-auth-method=iam",200]},()=>ZS,()=>ew],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:WS,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((c)=>c.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 au extends DS{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),c=Yq(i),a=C6(c),u=eV(a),d=$V(u,t?.extensions||[]);this.config=d,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(f)=>new s6({"aws.auth#sigv4":f.credentials})})),this.middlewareStack.use(o6(this.config))}destroy(){super.destroy()}}var nw=h6(rV,"Signin","SigninClient",I6),BV={IsControlPlane:{type:"staticContextParams",value:!1}},HV={IsOAuthEndpoint:{type:"staticContextParams",value:!0}},sw=(t,r,n,s)=>[];class cu extends nw(BV,sw,"CreateOAuth2Token",tw){}class uu extends nw(HV,sw,"CreateOAuth2TokenWithIAM",rw){}var zV={CreateOAuth2TokenCommand:cu,CreateOAuth2TokenWithIAMCommand:uu};class du extends au{}p6(zV,du);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=Fo;VV.AccessDeniedException$=zS;VV.AccessToken$=KS;VV.CreateOAuth2Token$=tw;VV.CreateOAuth2TokenCommand=cu;VV.CreateOAuth2TokenRequest$=QS;VV.CreateOAuth2TokenRequestBody$=XS;VV.CreateOAuth2TokenResponse$=YS;VV.CreateOAuth2TokenResponseBody$=JS;VV.CreateOAuth2TokenWithIAM$=rw;VV.CreateOAuth2TokenWithIAMCommand=uu;VV.CreateOAuth2TokenWithIAMRequest$=ZS;VV.CreateOAuth2TokenWithIAMResponse$=ew;VV.InternalServerException=Lo;VV.InternalServerException$=qS;VV.OAuth2ErrorCode=qV;VV.Signin=du;VV.SigninClient=au;VV.SigninServiceException=At;VV.SigninServiceException$=HS;VV.TooManyRequestsError=Uo;VV.TooManyRequestsError$=VS;VV.ValidationException=$o;VV.ValidationException$=jS;VV.errorTypeRegistries=WS});var aw=e(function(vj){var{setCredentialFeature:Sj}=he(),{CredentialsProviderError:xt,parseKnownFiles:wj,getProfileName:Ej}=Z(),{HttpRequest:bj}=Y(),{createHash:_j,createPrivateKey:Aj,createPublicKey:xj,sign:Tj}=I("node:crypto"),{promises:lu}=I("node:fs"),{homedir:Cj}=I("node:os"),{dirname:Ij,join:iw}=I("node:path");class Ho{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 xt(`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<=Ho.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()>Ho.REFRESH_THRESHOLD)return this.toCredentials(i.accessToken);let{SigninClient:a,CreateOAuth2TokenCommand:u}=ow(),{logger:d,userAgentAppId:f}=this.callerClientConfig??{},h=((y)=>y?.metadata?.handlerProtocol==="h2")(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,p=this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,g=new a({credentials:{accessKeyId:"",secretAccessKey:""},region:p,requestHandler:h,logger:d,userAgentAppId:f,...this.init?.clientConfig});this.createDPoPInterceptor(g.middlewareStack);let m={tokenInput:{clientId:i.clientId,refreshToken:i.refreshToken,grantType:"refresh_token"}};try{let y=await g.send(new u(m)),{accessKeyId:S,secretAccessKey:w,sessionToken:_}=y.tokenOutput?.accessToken??{},{refreshToken:v,expiresIn:L}=y.tokenOutput??{};if(!S||!w||!_||!v)throw new xt("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:S,secretAccessKey:w,sessionToken:_,expiresAt:U.toISOString()},refreshToken:v};return await this.saveToken(de),this.toCredentials(de.accessToken)}catch(y){if(y.name==="AccessDeniedException"){let w=y.error,_;switch(w){case"TOKEN_EXPIRED":_="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":_="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":_="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:_=`Failed to refresh token: ${String(y)}. Please re-authenticate using \`aws login\``}throw new xt(_,{logger:this.logger,tryNextLink:!1})}if(new Date(i.accessToken.expiresAt).getTime()>Date.now())return this.logger?.warn?.(`Failed to refresh token: ${String(y)}. Using existing token until expiry.`),this.toCredentials(i.accessToken);throw new xt(`Failed to refresh token: ${String(y)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let t=this.getTokenFilePath();try{let r=await lu.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 xt(`Token validation failed, missing fields: ${s.join(", ")}`,{logger:this.logger,tryNextLink:!1});return n}catch(r){throw new xt(`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 lu.mkdir(n,{recursive:!0})}catch(s){}await lu.writeFile(r,JSON.stringify(t,null,2),"utf8")}getTokenFilePath(){let t=process.env.AWS_LOGIN_CACHE_DIRECTORY??iw(Cj(),".aws","login","cache"),r=Buffer.from(this.loginSession,"utf8"),n=_j("sha256").update(r).digest("hex");return iw(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 c=Buffer.concat([Buffer.alloc(32-s.length),s]),a=Buffer.concat([Buffer.alloc(32-i.length),i]);return Buffer.concat([c,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"}),c=-1;for(let S=0;S<i.length;S++)if(i[S]===4){c=S;break}let a=i.slice(c+1,c+33),u=i.slice(c+33,c+65),d={alg:"ES256",typ:"dpop+jwt",jwk:{kty:"EC",crv:"P-256",x:a.toString("base64url"),y:u.toString("base64url")}},f={jti:crypto.randomUUID(),htm:t,htu:r,iat:Math.floor(Date.now()/1000)},l=Buffer.from(JSON.stringify(d)).toString("base64url"),h=Buffer.from(JSON.stringify(f)).toString("base64url"),p=`${l}.${h}`,g=Tj("sha256",Buffer.from(p),s),y=this.derToRawSignature(g).toString("base64url");return`${p}.${y}`}catch(s){throw new xt(`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 xt(`Profile ${s} does not contain login_session.`,{tryNextLink:!0,logger:t?.logger});let c=await new Ho(o,t,r).loadCredentials();return Sj(c,"CREDENTIALS_LOGIN","AD")};vj.fromLoginCredentials=Rj});var hu=e(function(Bj){var{externalDataInterceptor:Oj,CredentialsProviderError:fu,parseKnownFiles:Pj,getProfileName:kj}=Z(),{exec:Mj}=I("node:child_process"),{promisify:Dj}=I("node:util"),{setCredentialFeature:Fj}=he(),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:c}=await i(o),a;try{a=JSON.parse(c.trim())}catch{throw Error(`Profile ${t} credential_process returned invalid JSON.`)}return Lj(t,a,r)}catch(c){throw new fu(c.message,{logger:n})}}else throw new fu(`Profile ${t} did not contain credential_process.`,{logger:n})}else throw new fu(`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 pu=e(function(Gj){var{setCredentialFeature:zj}=he(),{CredentialsProviderError:qj,externalDataInterceptor:Vj}=Z(),{readFileSync:jj}=I("node:fs"),cw=(t)=>async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:n,roleSessionName:s,webIdentityToken:o,providerId:i,policyArns:c,policy:a,durationSeconds:u}=t,{roleAssumerWithWebIdentity:d}=t;if(!d){let{getDefaultRoleAssumerWithWebIdentity:f}=Jc();d=f({...t.clientConfig,credentialProviderLogger:t.logger,parentClientConfig:{...r?.callerClientConfig,...t.parentClientConfig}},t.clientPlugins)}return d({RoleArn:n,RoleSessionName:s??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:o,ProviderId:i,PolicyArns:c,Policy:a,DurationSeconds:u})},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 cw({...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=cw});var pw=e(function(f8){var{CredentialsProviderError:zo,chain:Xj,getProfileName:fw,parseKnownFiles:Yj}=Z(),{setCredentialFeature:Ye}=he(),Jj=(t,r,n)=>{let s={EcsContainer:async(o)=>{let{fromHttp:i}=Ha(),{fromContainerMetadata:c}=Cs();return n?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>Xj(i(o??{}),c(o))().then(gu)},Ec2InstanceMetadata:async(o)=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");let{fromInstanceMetadata:i}=Cs();return async()=>i(o)().then(gu)},Environment:async(o)=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");let{fromEnv:i}=Pa();return async()=>i(o)().then(gu)}};if(t in s)return s[t];else throw new zo(`Unsupported credential source in profile ${r}. Got ${t}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:n})},gu=(t)=>Ye(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 c=r[t],{source_profile:a,region:u}=c;if(!n.roleAssumer){let{getDefaultRoleAssumer:f}=Jc();n.roleAssumer=f({...n.clientConfig,credentialProviderLogger:n.logger,parentClientConfig:{...s,...n?.parentClientConfig,region:u??n?.parentClientConfig?.region??s?.region}},n.clientPlugins)}if(a&&a in o)throw new zo(`Detected a cycle attempting to resolve credentials for profile ${fw(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 d=a?i(a,r,n,s,{...o,[a]:!0},uw(r[a]??{})):(await Jj(c.credential_source,t,n.logger)(n))();if(uw(c))return d.then((f)=>Ye(f,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));else{let f={RoleArn:c.role_arn,RoleSessionName:c.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:c.external_id,DurationSeconds:parseInt(c.duration_seconds||"3600",10)},{mfa_serial:l}=c;if(l){if(!n.mfaCodeProvider)throw new zo(`Profile ${t} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:n.logger,tryNextLink:!1});f.SerialNumber=l,f.TokenCode=await n.mfaCodeProvider(l)}let h=await d;return n.roleAssumer(h,f).then((p)=>Ye(p,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},uw=(t)=>!t.role_arn&&!!t.credential_source,n8=(t)=>Boolean(t&&t.login_session),s8=async(t,r,n)=>{let{fromLoginCredentials:s}=aw(),o=await s({...r,profile:t})({callerClientConfig:n});return Ye(o,"CREDENTIALS_PROFILE_LOGIN","AC")},o8=(t)=>Boolean(t)&&typeof t==="object"&&typeof t.credential_process==="string",i8=async(t,r)=>{let{fromProcess:n}=hu(),s=await n({...t,profile:r})();return Ye(s,"CREDENTIALS_PROFILE_PROCESS","v")},a8=async(t,r,n={},s)=>{let{fromSSO:o}=Bc();return o({profile:t,logger:n.logger,parentClientConfig:n.parentClientConfig,clientConfig:n.clientConfig})({callerClientConfig:s}).then((i)=>{if(r.sso_session)return Ye(i,"CREDENTIALS_PROFILE_SSO","r");else return Ye(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"),dw=(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,lw=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 Ye(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}=pu(),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 Ye(o,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q")},hw=async(t,r,n,s,o={},i=!1)=>{let c=r[t];if(Object.keys(o).length>0&&dw(c))return lw(c,n);if(i||Zj(c,{profile:t,logger:n.logger}))return r8(t,r,n,s,o,hw);if(dw(c))return lw(c,n);if(u8(c))return d8(c,n,s);if(o8(c))return i8(n,t);if(c8(c))return await a8(t,c,n,s);if(n8(c))return s8(t,n,s);throw new zo(`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 hw(fw({profile:t.profile??r?.profile}),n,t,r)};f8.fromIni=l8});var XA=e(function(x8){var{ENV_KEY:p8,ENV_SECRET:g8,fromEnv:m8}=Pa(),{chain:y8,CredentialsProviderError:qo,ENV_PROFILE:S8}=Z(),w8=async(t)=>{let{ENV_CMDS_FULL_URI:r,ENV_CMDS_RELATIVE_URI:n,fromContainerMetadata:s,fromInstanceMetadata:o}=Cs();if(process.env[n]||process.env[r]){t.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:i}=Ha();return y8(i(t),s(t))}if(process.env.AWS_EC2_METADATA_DISABLED&&process.env.AWS_EC2_METADATA_DISABLED!=="false")return async()=>{throw new qo("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,c,a=async(u)=>{if(u?.forceRefresh){if(!c)c=n(u).then((d)=>{i=d}).finally(()=>{c=void 0});return await c,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(u).then((d)=>{i=d}).catch(()=>{}).finally(()=>{o=void 0})}else return s=n(u).then((d)=>{i=d}).finally(()=>{s=void 0}),a(u);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},gw=!1,_8=(t={})=>E8([async()=>{if(t.profile??process.env[S8]){if(process.env[p8]&&process.env[g8]){if(!gw)(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
+ `),gw=!0}throw new qo("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:c}=t;if(!n&&!s&&!o&&!i&&!c)throw new qo("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:t.logger});let{fromSSO:a}=Bc();return a(t)(r)},async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:n}=pw();return n(t)(r)},async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:n}=hu();return n(t)(r)},async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:n}=pu();return n(t)(r)},async()=>(t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await w8(t))()),async()=>{throw new qo("Could not load credentials from any providers",{tryNextLink:!1,logger:t.logger})}],mw),A8=(t)=>t?.expiration!==void 0,mw=(t)=>t?.expiration!==void 0&&t.expiration.getTime()-Date.now()<300000;x8.credentialsTreatedAsExpired=mw;x8.credentialsWillNeedRefresh=A8;x8.defaultProvider=_8});var en=e(function(D8){var{EventStreamCodec:R8}=Qt(),{Transform:v8,Readable:N8,PassThrough:O8,pipeline:P8}=I("node:stream");class yw 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 c=this.eventStreamCodec.encode({headers:{...o,":chunk-signature":{type:"binary",value:k8(i.signature)}},body:t});return this.push(c),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 Sw{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 u=new yw({priorSignature:a,eventStreamCodec:this.eventStreamCodec,messageSigner:await this.messageSigner(),systemClockOffsetProvider:this.systemClockOffsetProvider,credentials:this.credentials}),d,f=new Promise((h,p)=>{d=()=>h(void 0),P8(o,u,s.body,(g)=>{if(g)p(Error(`Pipeline error in @aws-sdk/eventstream-handler-node: ${g.message}`,{cause:g}))})}),l;try{l=await Promise.race([t(r),f])}catch(h){throw s.body.end(),h}finally{d()}return l}}var M8=(t)=>new Sw(t);D8.eventStreamPayloadHandlerProvider=M8});
60
+ export{ve,ue,Z,Je,Ae,dt,Qt,Y,ut,nt,he,$A,ot,Et,mt,Tn,XA,en};
61
+
62
+ //# debugId=5C900E1ED06C434264756E2164756E21
63
+ //# sourceMappingURL=index-7p8d1gf0.js.map