@kyro-cms/core 0.13.5 → 0.13.7

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 (325) hide show
  1. package/dist/api-handler-graphql.cjs +1 -1
  2. package/dist/api-handler-graphql.js +2 -2
  3. package/dist/api-handler-trpc.cjs +1 -1
  4. package/dist/api-handler-trpc.js +2 -2
  5. package/dist/api-handler.cjs +1 -1
  6. package/dist/api-handler.js +1 -1
  7. package/dist/auth-session-4WJUKESW.js +1 -0
  8. package/dist/auth-session-VHUHDBCL.cjs +1 -0
  9. package/dist/bootstrap-JYAUQ52D.cjs +1 -0
  10. package/dist/bootstrap-TTMLNQM3.js +1 -0
  11. package/dist/chunk-23RSKVJP.cjs +1 -0
  12. package/dist/chunk-24W5I6SJ.cjs +2 -0
  13. package/dist/{chunk-CH4TZZI5.js → chunk-2I2AXTKY.cjs} +38 -39
  14. package/dist/chunk-34LCWI5X.cjs +1 -0
  15. package/dist/chunk-3A5UO6OQ.cjs +114 -0
  16. package/dist/chunk-3N34WXBS.js +2 -0
  17. package/dist/chunk-3RIGRHON.js +109 -0
  18. package/dist/chunk-5BUAWCU6.js +91 -0
  19. package/dist/{chunk-7NKNSRCB.cjs → chunk-5I3BM5TV.js} +33 -32
  20. package/dist/chunk-5RBGM5N5.js +3 -0
  21. package/dist/chunk-7EY3GXRA.js +2 -0
  22. package/dist/chunk-7KTPBTH5.cjs +1 -0
  23. package/dist/chunk-A7763NCF.cjs +19 -0
  24. package/dist/chunk-AQWTJGML.cjs +1 -0
  25. package/dist/chunk-DCFOVCJX.cjs +1 -0
  26. package/dist/chunk-DCKJT247.cjs +1 -0
  27. package/dist/chunk-EG4SRTYS.cjs +2 -0
  28. package/dist/chunk-FAG2645P.js +2 -0
  29. package/dist/chunk-FIVTKI25.cjs +3 -0
  30. package/dist/chunk-FU76HURF.cjs +1 -0
  31. package/dist/chunk-GS4CMYKS.cjs +1 -0
  32. package/dist/chunk-GTAKGVUY.js +2 -0
  33. package/dist/chunk-GWUHIIPO.cjs +132 -0
  34. package/dist/chunk-H2IJDTA2.cjs +1 -0
  35. package/dist/chunk-HCM2G674.cjs +20 -0
  36. package/dist/chunk-I22MSXGL.js +2 -0
  37. package/dist/chunk-IIPSXKNV.js +115 -0
  38. package/dist/{chunk-WNU76M2C.js → chunk-IIVBEZC2.js} +6 -6
  39. package/dist/chunk-JHFD3IAU.cjs +1 -0
  40. package/dist/chunk-JJY2F6NL.cjs +3 -0
  41. package/dist/chunk-JQ4V2MGJ.cjs +2 -0
  42. package/dist/chunk-JXJTFBHG.js +3 -0
  43. package/dist/chunk-KOSR7235.cjs +1 -0
  44. package/dist/chunk-KUY4QDAL.js +2 -0
  45. package/dist/chunk-LGUHXOEW.js +3 -0
  46. package/dist/chunk-LXTVMP5F.cjs +6 -0
  47. package/dist/chunk-MCK2QRAU.cjs +4 -0
  48. package/dist/chunk-N2BMGZIX.cjs +90 -0
  49. package/dist/chunk-N7CDHWQH.cjs +2 -0
  50. package/dist/chunk-NGNXOXI5.js +2 -0
  51. package/dist/chunk-O2SA56P2.cjs +108 -0
  52. package/dist/chunk-O4PPZOVI.cjs +1 -0
  53. package/dist/chunk-O4RKZQYQ.js +2 -0
  54. package/dist/chunk-O6I26T6A.js +3 -0
  55. package/dist/chunk-OJBL4CXK.cjs +2 -0
  56. package/dist/chunk-OPKZYQV7.js +3 -0
  57. package/dist/chunk-OXEJCIOA.cjs +1 -0
  58. package/dist/chunk-OXH6CANN.js +2 -0
  59. package/dist/chunk-PPGZHOYR.cjs +1 -0
  60. package/dist/{chunk-EQN3HDES.cjs → chunk-PW6Y5MQL.cjs} +5 -5
  61. package/dist/chunk-RLW6AQF2.js +2 -0
  62. package/dist/chunk-SBFVITY2.js +7 -0
  63. package/dist/chunk-SEJ7LMYY.js +4 -0
  64. package/dist/chunk-SYE3OS5T.js +5 -0
  65. package/dist/chunk-SZY25KAE.js +21 -0
  66. package/dist/chunk-TJ6N5ZPZ.js +133 -0
  67. package/dist/chunk-TVWHTVLI.js +2 -0
  68. package/dist/chunk-UE7DTBD7.cjs +1 -0
  69. package/dist/chunk-V2RMDMWN.js +2 -0
  70. package/dist/chunk-V4SR7DU5.js +3 -0
  71. package/dist/chunk-VLFM66BZ.js +4 -0
  72. package/dist/chunk-VPBGZW4P.cjs +1 -0
  73. package/dist/chunk-W5GDZG64.js +2 -0
  74. package/dist/chunk-WLSVS3NC.js +2 -0
  75. package/dist/chunk-XL64URKD.cjs +2 -0
  76. package/dist/chunk-YNBJGPIU.js +2 -0
  77. package/dist/chunk-YNSKDTFG.js +2 -0
  78. package/dist/chunk-YOJOVQIH.cjs +1 -0
  79. package/dist/chunk-ZE2X3FBU.js +20 -0
  80. package/dist/chunk-ZMH35QYG.js +2 -0
  81. package/dist/cli/index.cjs +53 -182
  82. package/dist/cli/index.js +54 -183
  83. package/dist/drizzle/index.cjs +1 -1
  84. package/dist/drizzle/index.js +1 -1
  85. package/dist/fields/index.cjs +1 -1
  86. package/dist/fields/index.js +1 -1
  87. package/dist/graphql/index.cjs +1 -1
  88. package/dist/graphql/index.js +1 -1
  89. package/dist/index-B_39z2jP.d.cts +217 -0
  90. package/dist/index-xqpVL2Zq.d.ts +217 -0
  91. package/dist/index.cjs +30 -30
  92. package/dist/index.d.cts +2 -31
  93. package/dist/index.d.ts +2 -31
  94. package/dist/index.js +31 -31
  95. package/dist/integration.cjs +1 -1
  96. package/dist/integration.js +1 -1
  97. package/dist/local-DKP43BWQ.cjs +1 -0
  98. package/dist/local-TF5ZMHWW.js +1 -0
  99. package/dist/media-M3EIZ4QS.cjs +1 -0
  100. package/dist/media-WYEILC6K.js +1 -0
  101. package/dist/mongo-auth-adapter-22MV3TI3.cjs +1 -0
  102. package/dist/mongo-auth-adapter-66PWVRZW.js +1 -0
  103. package/dist/mongodb/index.cjs +1 -1
  104. package/dist/mongodb/index.d.cts +3 -130
  105. package/dist/mongodb/index.d.ts +3 -130
  106. package/dist/mongodb/index.js +1 -1
  107. package/dist/nodemailer-transport-7F3VLLBW.js +1 -0
  108. package/dist/nodemailer-transport-WAPZD3SJ.cjs +1 -0
  109. package/dist/postgres-auth-adapter-7BCPXNBO.js +1 -0
  110. package/dist/postgres-auth-adapter-HMXFUM5W.cjs +1 -0
  111. package/dist/redis-adapter-2E5AWMMA.cjs +1 -0
  112. package/dist/redis-adapter-GFH74CF4.js +1 -0
  113. package/dist/rest/index.cjs +1 -1
  114. package/dist/rest/index.js +1 -1
  115. package/dist/schema-FNIDQKIJ.cjs +1 -0
  116. package/dist/schema-KD736QFN.js +1 -0
  117. package/dist/sqlite-adapter-HL53RLSN.cjs +1 -0
  118. package/dist/sqlite-adapter-TT6ZASDG.js +1 -0
  119. package/dist/templates/index.cjs +1 -1
  120. package/dist/templates/index.js +1 -1
  121. package/dist/trpc/index.cjs +1 -1
  122. package/dist/trpc/index.js +1 -1
  123. package/dist/ws/index.cjs +1 -1
  124. package/dist/ws/index.js +1 -1
  125. package/package.json +2 -10
  126. package/dist/WebhookService-CGxHtw7E.d.cts +0 -143
  127. package/dist/WebhookService-CNC1lYz7.d.ts +0 -143
  128. package/dist/auth-session-DHVGXHOH.cjs +0 -1
  129. package/dist/auth-session-O7IIH7EP.js +0 -1
  130. package/dist/base-A9AJPCG5.d.ts +0 -219
  131. package/dist/base-C6wyX2nC.d.cts +0 -219
  132. package/dist/bcryptjs-WIQSWJGK.cjs +0 -1
  133. package/dist/bcryptjs-ZEEHSMAG.js +0 -2
  134. package/dist/better-sqlite3-5IISPX34.cjs +0 -1
  135. package/dist/better-sqlite3-B34RIU4C.js +0 -2
  136. package/dist/bootstrap-PG2LGDLB.js +0 -1
  137. package/dist/bootstrap-YD3GLTWX.cjs +0 -1
  138. package/dist/bowser-SB3ZUPO4.js +0 -11
  139. package/dist/bowser-VX6B6ZSE.cjs +0 -10
  140. package/dist/chokidar-5RVQZVHP.cjs +0 -5
  141. package/dist/chokidar-BOYGRT4Q.js +0 -6
  142. package/dist/chunk-262YP5XA.cjs +0 -1
  143. package/dist/chunk-2HA6EKXX.js +0 -24
  144. package/dist/chunk-2SPWRQ5O.js +0 -122
  145. package/dist/chunk-2TYITUOC.js +0 -122
  146. package/dist/chunk-35PGCW3S.cjs +0 -1
  147. package/dist/chunk-3CIMGC2F.cjs +0 -56
  148. package/dist/chunk-3KZXF4US.js +0 -2
  149. package/dist/chunk-3NSZZCOJ.js +0 -2
  150. package/dist/chunk-3TAUNYEM.js +0 -8
  151. package/dist/chunk-3VXEK5ZW.cjs +0 -1
  152. package/dist/chunk-47CXBWMA.js +0 -2
  153. package/dist/chunk-4BMWWGJN.js +0 -384
  154. package/dist/chunk-4NTIK6DF.cjs +0 -2
  155. package/dist/chunk-6E44MQQ5.js +0 -115
  156. package/dist/chunk-6LWF5MPL.js +0 -20
  157. package/dist/chunk-6NBZDW53.js +0 -133
  158. package/dist/chunk-6TPICJ2L.js +0 -7
  159. package/dist/chunk-6YS6XLOD.cjs +0 -121
  160. package/dist/chunk-73D2PNHD.cjs +0 -7
  161. package/dist/chunk-7ACHOBWY.cjs +0 -13
  162. package/dist/chunk-7GGZA5YU.cjs +0 -2
  163. package/dist/chunk-7JWQ2PZP.cjs +0 -1
  164. package/dist/chunk-7KLEANTO.cjs +0 -1
  165. package/dist/chunk-7MNDQU6K.js +0 -8
  166. package/dist/chunk-7NH7H3WA.js +0 -10
  167. package/dist/chunk-7WMMKGEO.cjs +0 -1
  168. package/dist/chunk-ALTU3FDG.js +0 -2
  169. package/dist/chunk-BAVN7VDR.cjs +0 -1
  170. package/dist/chunk-BCEE4NBZ.cjs +0 -2
  171. package/dist/chunk-BUNLC3II.cjs +0 -1
  172. package/dist/chunk-C7QCZX7X.js +0 -2
  173. package/dist/chunk-D6SDGHY6.js +0 -2
  174. package/dist/chunk-DVWYO3KK.cjs +0 -1
  175. package/dist/chunk-EHWUALGH.cjs +0 -1
  176. package/dist/chunk-EML5FDUU.js +0 -2
  177. package/dist/chunk-EN65ZEK2.cjs +0 -2
  178. package/dist/chunk-EW424IBO.cjs +0 -1
  179. package/dist/chunk-EZIDQBXI.cjs +0 -1
  180. package/dist/chunk-F2O4QO5N.cjs +0 -383
  181. package/dist/chunk-F4ITQ6XQ.cjs +0 -3
  182. package/dist/chunk-FK2BG4HU.js +0 -3
  183. package/dist/chunk-FLMUMPDE.js +0 -2
  184. package/dist/chunk-GIS6X43A.cjs +0 -3
  185. package/dist/chunk-GNEVCEJU.cjs +0 -3
  186. package/dist/chunk-GNOSG3PK.cjs +0 -1
  187. package/dist/chunk-GQGFNTDZ.js +0 -2
  188. package/dist/chunk-GTR7JAKP.cjs +0 -3
  189. package/dist/chunk-HPIJI7TM.js +0 -3
  190. package/dist/chunk-HPYH7GTS.cjs +0 -1
  191. package/dist/chunk-HRAY65XH.js +0 -3
  192. package/dist/chunk-HTYVI2HK.cjs +0 -9
  193. package/dist/chunk-IKGVPXMK.js +0 -3
  194. package/dist/chunk-J6V573PE.cjs +0 -1
  195. package/dist/chunk-JA44K75G.js +0 -2
  196. package/dist/chunk-JRUQ5ABB.js +0 -4
  197. package/dist/chunk-JV4HJBXW.js +0 -14
  198. package/dist/chunk-KEITOXIP.js +0 -2
  199. package/dist/chunk-KMFLHGD5.cjs +0 -1
  200. package/dist/chunk-KZHXYXSH.cjs +0 -10
  201. package/dist/chunk-L3Q64RUX.js +0 -3
  202. package/dist/chunk-LEBM6ZSZ.cjs +0 -10
  203. package/dist/chunk-LKRI5X2V.cjs +0 -1
  204. package/dist/chunk-LQ3YZTPU.cjs +0 -15
  205. package/dist/chunk-LVBHOZZF.js +0 -4
  206. package/dist/chunk-LWM4WABU.js +0 -3
  207. package/dist/chunk-LY7N3UHH.cjs +0 -23
  208. package/dist/chunk-MCIZG4A3.cjs +0 -1
  209. package/dist/chunk-MDLJTZLV.cjs +0 -1
  210. package/dist/chunk-N4FXLQE3.cjs +0 -132
  211. package/dist/chunk-N5POANYV.js +0 -2
  212. package/dist/chunk-NGNJSUGL.cjs +0 -1
  213. package/dist/chunk-NRE6VKL6.cjs +0 -121
  214. package/dist/chunk-O4YE57OS.cjs +0 -6
  215. package/dist/chunk-OBYAIJVU.js +0 -11
  216. package/dist/chunk-OLRCZ6E3.js +0 -2
  217. package/dist/chunk-OOVNTOZC.cjs +0 -56
  218. package/dist/chunk-P6JITOFF.js +0 -4
  219. package/dist/chunk-PITMDQYN.cjs +0 -18
  220. package/dist/chunk-PYUWSKKP.js +0 -57
  221. package/dist/chunk-Q5TFO66G.cjs +0 -1
  222. package/dist/chunk-QO5ZWQA3.cjs +0 -74
  223. package/dist/chunk-QYN6C3FZ.cjs +0 -114
  224. package/dist/chunk-REQ622YC.js +0 -3
  225. package/dist/chunk-RPRGGGIW.js +0 -11
  226. package/dist/chunk-RVBSJ4UQ.cjs +0 -7
  227. package/dist/chunk-RYHOWZLK.js +0 -2
  228. package/dist/chunk-RYXLEFS5.js +0 -2
  229. package/dist/chunk-SBNMXQNO.cjs +0 -2
  230. package/dist/chunk-SLMIYECU.js +0 -2
  231. package/dist/chunk-SRIXRJHL.js +0 -4
  232. package/dist/chunk-TBHNE4VV.js +0 -2
  233. package/dist/chunk-TCFL3UWT.cjs +0 -2
  234. package/dist/chunk-TYQYKKWJ.js +0 -16
  235. package/dist/chunk-U6KFONKM.js +0 -2
  236. package/dist/chunk-UNYXWPLZ.cjs +0 -2
  237. package/dist/chunk-UWHWSWDE.js +0 -2
  238. package/dist/chunk-V4FAL7AG.js +0 -2
  239. package/dist/chunk-VQ53TFYA.cjs +0 -1
  240. package/dist/chunk-VRZC4TTF.cjs +0 -1
  241. package/dist/chunk-W45TLOOT.js +0 -2
  242. package/dist/chunk-WAVGRSE6.js +0 -2
  243. package/dist/chunk-WPM6LFCY.js +0 -2
  244. package/dist/chunk-WXT2XW7T.js +0 -13
  245. package/dist/chunk-X473JI7Z.js +0 -75
  246. package/dist/chunk-X6HUA6EF.cjs +0 -20
  247. package/dist/chunk-XDPLVJRO.js +0 -21
  248. package/dist/chunk-XDQVYCIR.cjs +0 -1
  249. package/dist/chunk-XFYSADHV.cjs +0 -2
  250. package/dist/chunk-XOR64WUQ.cjs +0 -19
  251. package/dist/chunk-Y2YAKDEQ.js +0 -2
  252. package/dist/chunk-YENNL5HG.js +0 -2
  253. package/dist/chunk-YGI5W4RS.js +0 -2
  254. package/dist/chunk-YIFKTA5N.js +0 -57
  255. package/dist/chunk-YUUXFD73.js +0 -19
  256. package/dist/chunk-ZAKYTBEN.js +0 -3
  257. package/dist/chunk-ZHA446FA.cjs +0 -1
  258. package/dist/chunk-ZTLGK6R4.cjs +0 -12
  259. package/dist/chunk-ZUBJ6RLQ.cjs +0 -1
  260. package/dist/client.d.cts +0 -1291
  261. package/dist/client.d.ts +0 -1291
  262. package/dist/d1-5ZQJOFDX.cjs +0 -1
  263. package/dist/d1-HPB6B253.js +0 -2
  264. package/dist/dist-es-3SSNUZST.cjs +0 -1
  265. package/dist/dist-es-64F22JL2.js +0 -2
  266. package/dist/dist-es-A5OF2STN.cjs +0 -2
  267. package/dist/dist-es-BOW5V247.cjs +0 -6
  268. package/dist/dist-es-CRIMATLL.cjs +0 -2
  269. package/dist/dist-es-DL3VLVP6.cjs +0 -1
  270. package/dist/dist-es-F2ZR55UK.js +0 -4
  271. package/dist/dist-es-IPSSZNFP.js +0 -1
  272. package/dist/dist-es-M2F7M27Y.js +0 -2
  273. package/dist/dist-es-M66JKZF5.js +0 -7
  274. package/dist/dist-es-OKLLRYI3.js +0 -2
  275. package/dist/dist-es-P25IKLBI.cjs +0 -1
  276. package/dist/dist-es-SRPWSAF4.cjs +0 -1
  277. package/dist/dist-es-SVHZDVUF.js +0 -3
  278. package/dist/dist-es-T2H2W5BX.cjs +0 -3
  279. package/dist/dist-es-WFI55HKT.js +0 -3
  280. package/dist/drizzle-orm-47ELDEM6.cjs +0 -1
  281. package/dist/drizzle-orm-XRTSOQJS.js +0 -1
  282. package/dist/event-streams-7NAWZW2I.js +0 -1
  283. package/dist/event-streams-JBMWCI2O.cjs +0 -1
  284. package/dist/fs-KWBRQ6T6.js +0 -1
  285. package/dist/fs-ZQYOJOIO.cjs +0 -1
  286. package/dist/index-NGnJpSgf.d.ts +0 -105
  287. package/dist/index-Zrg3sZ6R.d.cts +0 -105
  288. package/dist/jsonwebtoken-DFB6ZBZA.cjs +0 -8
  289. package/dist/jsonwebtoken-OD67R5JS.js +0 -9
  290. package/dist/lib-A2D63VXD.cjs +0 -1
  291. package/dist/lib-JQD2JAOO.js +0 -2
  292. package/dist/loadSso-JY4WDQPS.cjs +0 -2
  293. package/dist/loadSso-UQR6545M.js +0 -3
  294. package/dist/local-6UUGBZ4M.js +0 -1
  295. package/dist/local-ZYHV3J2K.cjs +0 -1
  296. package/dist/media-3Z6YW5J4.cjs +0 -1
  297. package/dist/media-E762GEHL.js +0 -1
  298. package/dist/mongo-auth-adapter-2H2AXDRH.cjs +0 -1
  299. package/dist/mongo-auth-adapter-YWMEOC42.js +0 -1
  300. package/dist/nodemailer-IDML4L6W.cjs +0 -53
  301. package/dist/nodemailer-NITB45SS.js +0 -54
  302. package/dist/nodemailer-transport-3VWVUBM5.cjs +0 -1
  303. package/dist/nodemailer-transport-7RHATUKL.js +0 -1
  304. package/dist/postgres-auth-adapter-QKBNXVPT.js +0 -1
  305. package/dist/postgres-auth-adapter-WMLM4UUC.cjs +0 -1
  306. package/dist/postgres-js-7YBZKGXG.cjs +0 -1
  307. package/dist/postgres-js-JLFIWOBH.js +0 -1
  308. package/dist/redis-adapter-EVK2SMKH.cjs +0 -1
  309. package/dist/redis-adapter-LY2NBSAG.js +0 -1
  310. package/dist/schema-RT6WSUYC.cjs +0 -1
  311. package/dist/schema-YFMSJK2P.js +0 -2
  312. package/dist/signin-N3T2KF5Q.js +0 -3
  313. package/dist/signin-VFBLX7EL.cjs +0 -2
  314. package/dist/sqlite-adapter-KPSISY6E.cjs +0 -1
  315. package/dist/sqlite-adapter-PI6SIY7O.js +0 -1
  316. package/dist/src-6LAUXXDM.cjs +0 -1
  317. package/dist/src-QBADSZV4.js +0 -1
  318. package/dist/sso-oidc-54BIRYR6.cjs +0 -2
  319. package/dist/sso-oidc-UB7G4END.js +0 -3
  320. package/dist/sts-WAA6I22C.js +0 -3
  321. package/dist/sts-YLXXIB3X.cjs +0 -2
  322. package/dist/types-BCOhfwHC.d.ts +0 -839
  323. package/dist/types-DxaK39ix.d.cts +0 -330
  324. package/dist/types-DxaK39ix.d.ts +0 -330
  325. package/dist/types-QglJ7PwT.d.cts +0 -839
@@ -1,4 +0,0 @@
1
- import {g}from'./chunk-Y2YAKDEQ.js';import {execSync}from'child_process';import {existsSync}from'fs';import {join}from'path';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
- g();function s(){let n=process.cwd();return existsSync(join(n,"pnpm-lock.yaml"))?"pnpm":existsSync(join(n,"yarn.lock"))?"yarn":existsSync(join(n,"bun.lockb"))||existsSync(join(n,"bun.lock"))?"bun":"npm"}function d(n){let o=s();console.log(`
3
- \u{1F4E6} [Kyro CMS] Auto-installing missing database drivers: ${n.join(", ")}...`);try{let i=o==="npm"?"npm install":`${o} add`;execSync(`${i} ${n.join(" ")}`,{stdio:"inherit"}),console.log(`\u2705 [Kyro CMS] Successfully installed drivers!
4
- `);}catch(i){throw console.error(`\u274C [Kyro CMS] Failed to auto-install drivers. Please run manually: ${o==="npm"?"npm install":`${o} add`} ${n.join(" ")}`),i}}export{d as a};
@@ -1,18 +0,0 @@
1
- 'use strict';var chunkLEBM6ZSZ_cjs=require('./chunk-LEBM6ZSZ.cjs'),chunkGNEVCEJU_cjs=require('./chunk-GNEVCEJU.cjs'),chunkLQ3YZTPU_cjs=require('./chunk-LQ3YZTPU.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var re=i=>chunkGNEVCEJU_cjs.f.isInstance(i)?i.headers?.date??i.headers?.Date:void 0;chunkBUNLC3II_cjs.h();var $=i=>new Date(Date.now()+i);chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var rt=(i,e)=>Math.abs($(e).getTime()-i)>=3e5;var se=(i,e)=>{let t=Date.parse(i);return rt(t,e)?t-Date.now():e};var Q=(i,e)=>{if(!e)throw new Error(`Property \`${i}\` is not resolved for AWS SDK SigV4Auth`);return e},q=async i=>{let e=Q("context",i.context),t=Q("config",i.config),r=e.endpointV2?.properties?.authSchemes?.[0],o=await Q("signer",t.signer)(r),n=i?.signingRegion,a=i?.signingRegionSet,m=i?.signingName;return {config:t,signer:o,signingRegion:n,signingRegionSet:a,signingName:m}},B=class{async sign(e,t,r){if(!chunkGNEVCEJU_cjs.e.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");let s=await q(r),{config:o,signer:n}=s,{signingRegion:a,signingName:m}=s,c=r.context;if(c?.authSchemes?.length??false){let[l,h]=c.authSchemes;l?.name==="sigv4a"&&h?.name==="sigv4"&&(a=h?.signingRegion??a,m=h?.signingName??m);}return r._preRequestSystemClockOffset=o.systemClockOffset,await n.sign(e,{signingDate:$(o.systemClockOffset),signingRegion:a,signingService:m})}errorHandler(e){return t=>{let r=t,s=r.ServerTime??re(r.$response);if(s){let o=Q("config",e.config),n=e._preRequestSystemClockOffset,a=se(s,o.systemClockOffset);(a!==o.systemClockOffset||n!==void 0&&n!==a)&&r.$metadata&&(o.systemClockOffset=a,r.$metadata.clockSkewCorrected=true);}throw t}}successHandler(e,t){let r=re(e);if(r){let s=Q("config",t.config);s.systemClockOffset=se(r,s.systemClockOffset);}}};chunkBUNLC3II_cjs.h();var ie=class extends B{async sign(e,t,r){if(!chunkGNEVCEJU_cjs.e.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");let{config:s,signer:o,signingRegion:n,signingRegionSet:a,signingName:m}=await q(r),f=(await s.sigv4aSigningRegionSet?.()??a??[n]).join(",");return r._preRequestSystemClockOffset=s.systemClockOffset,await o.sign(e,{signingDate:$(s.systemClockOffset),signingRegion:f,signingService:m})}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ce=i=>typeof i=="string"&&i.length>0?i.split(",").map(e=>e.trim()):[];chunkBUNLC3II_cjs.h();var st=i=>`AWS_BEARER_TOKEN_${i.replace(/[\s-]/g,"_").toUpperCase()}`;var it="AWS_AUTH_SCHEME_PREFERENCE",ot="auth_scheme_preference",nt={environmentVariableSelector:(i,e)=>{if(e?.signingName&&st(e.signingName)in i)return ["httpBearerAuth"];if(it in i)return Ce(i[it])},configFileSelector:i=>{if(ot in i)return Ce(i[ot])},default:[]};chunkBUNLC3II_cjs.h();var at=i=>(i.sigv4aSigningRegionSet=chunkLEBM6ZSZ_cjs.H(i.sigv4aSigningRegionSet),i),ct={environmentVariableSelector(i){if(i.AWS_SIGV4A_SIGNING_REGION_SET)return i.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map(e=>e.trim());throw new chunkGNEVCEJU_cjs.o("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:true})},configFileSelector(i){if(i.sigv4a_signing_region_set)return (i.sigv4a_signing_region_set??"").split(",").map(e=>e.trim());throw new chunkGNEVCEJU_cjs.o("sigv4a_signing_region_set not set in profile.",{tryNextLink:true})},default:void 0};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var oe=class{format(e){let t=[];for(let o of Object.keys(e)){let n=chunkLQ3YZTPU_cjs.c(o);t.push(Uint8Array.from([n.byteLength]),n,this.formatHeaderValue(e[o]));}let r=new Uint8Array(t.reduce((o,n)=>o+n.byteLength,0)),s=0;for(let o of t)r.set(o,s),s+=o.byteLength;return r}formatHeaderValue(e){switch(e.type){case "boolean":return Uint8Array.from([e.value?R.boolTrue:R.boolFalse]);case "byte":return Uint8Array.from([R.byte,e.value]);case "short":let t=new DataView(new ArrayBuffer(3));return t.setUint8(0,R.short),t.setInt16(1,e.value,false),new Uint8Array(t.buffer);case "integer":let r=new DataView(new ArrayBuffer(5));return r.setUint8(0,R.integer),r.setInt32(1,e.value,false),new Uint8Array(r.buffer);case "long":let s=new Uint8Array(9);return s[0]=R.long,s.set(e.value.bytes,1),s;case "binary":let o=new DataView(new ArrayBuffer(3+e.value.byteLength));o.setUint8(0,R.byteArray),o.setUint16(1,e.value.byteLength,false);let n=new Uint8Array(o.buffer);return n.set(e.value,3),n;case "string":let a=chunkLQ3YZTPU_cjs.c(e.value),m=new DataView(new ArrayBuffer(3+a.byteLength));m.setUint8(0,R.string),m.setUint16(1,a.byteLength,false);let c=new Uint8Array(m.buffer);return c.set(a,3),c;case "timestamp":let f=new Uint8Array(9);return f[0]=R.timestamp,f.set(be.fromNumber(e.value.valueOf()).bytes,1),f;case "uuid":if(!Kt.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);let l=new Uint8Array(17);return l[0]=R.uuid,l.set(chunkLQ3YZTPU_cjs.s(e.value.replace(/-/g,"")),1),l}}},R;(function(i){i[i.boolTrue=0]="boolTrue",i[i.boolFalse=1]="boolFalse",i[i.byte=2]="byte",i[i.short=3]="short",i[i.integer=4]="integer",i[i.long=5]="long",i[i.byteArray=6]="byteArray",i[i.string=7]="string",i[i.timestamp=8]="timestamp",i[i.uuid=9]="uuid";})(R||(R={}));var Kt=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,be=class i{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);let t=new Uint8Array(8);for(let r=7,s=Math.abs(Math.round(e));r>-1&&s>0;r--,s/=256)t[r]=s;return e<0&&mt(t),new i(t)}valueOf(){let e=this.bytes.slice(0),t=e[0]&128;return t&&mt(e),parseInt(chunkLQ3YZTPU_cjs.t(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}};function mt(i){for(let e=0;e<8;e++)i[e]^=255;for(let e=7;e>-1&&(i[e]++,i[e]===0);e--);}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var ft="X-Amz-Algorithm",dt="X-Amz-Credential",Re="X-Amz-Date",lt="X-Amz-SignedHeaders",ht="X-Amz-Expires",Te="X-Amz-Signature",_e="X-Amz-Security-Token";var ke="authorization",Ie=Re.toLowerCase(),Vt="date",ut=[ke,Ie,Vt],gt=Te.toLowerCase(),v="x-amz-content-sha256",pt=_e.toLowerCase();var yt={authorization:true,"cache-control":true,connection:true,expect:true,from:true,"keep-alive":true,"max-forwards":true,pragma:true,referer:true,te:true,trailer:true,"transfer-encoding":true,upgrade:true,"user-agent":true,"x-amzn-trace-id":true},St=/^proxy-/,wt=/^sec-/;var ne="AWS4-HMAC-SHA256";var Et="AWS4-HMAC-SHA256-PAYLOAD",xt="UNSIGNED-PAYLOAD",At=50,Me="aws4_request",Nt=3600*24*7;var Ct=({query:i={}})=>{let e=[],t={};for(let r of Object.keys(i)){if(r.toLowerCase()===gt)continue;let s=chunkGNEVCEJU_cjs.U(r);e.push(s);let o=i[r];typeof o=="string"?t[s]=`${s}=${chunkGNEVCEJU_cjs.U(o)}`:Array.isArray(o)&&(t[s]=o.slice(0).reduce((n,a)=>n.concat([`${s}=${chunkGNEVCEJU_cjs.U(a)}`]),[]).sort().join("&"));}return e.sort().map(r=>t[r]).filter(r=>r).join("&")};chunkBUNLC3II_cjs.h();var bt=i=>jt(i).toISOString().replace(/\.\d{3}Z$/,"Z"),jt=i=>typeof i=="number"?new Date(i*1e3):typeof i=="string"?Number(i)?new Date(Number(i)*1e3):new Date(i):i;var ae=class{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:t,region:r,service:s,sha256:o,uriEscapePath:n=true}){this.service=s,this.sha256=o,this.uriEscapePath=n,this.applyChecksum=typeof e=="boolean"?e:true,this.regionProvider=chunkGNEVCEJU_cjs.h(r),this.credentialProvider=chunkGNEVCEJU_cjs.h(t);}createCanonicalRequest(e,t,r){let s=Object.keys(t).sort();return `${e.method}
2
- ${this.getCanonicalPath(e)}
3
- ${Ct(e)}
4
- ${s.map(o=>`${o}:${t[o]}`).join(`
5
- `)}
6
-
7
- ${s.join(";")}
8
- ${r}`}async createStringToSign(e,t,r,s){let o=new this.sha256;o.update(chunkLQ3YZTPU_cjs.v(r));let n=await o.digest();return `${s}
9
- ${e}
10
- ${t}
11
- ${chunkLQ3YZTPU_cjs.t(n)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){let t=[];for(let o of e.split("/"))o?.length!==0&&o!=="."&&(o===".."?t.pop():t.push(o));let r=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return chunkGNEVCEJU_cjs.U(r).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){let t=bt(e).replace(/[-:]/g,"");return {longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}};chunkBUNLC3II_cjs.h();var ce={},De=[],me=(i,e,t)=>`${i}/${e}/${t}/${Me}`,Tt=async(i,e,t,r,s)=>{let o=await Rt(i,e.secretAccessKey,e.accessKeyId),n=`${t}:${r}:${s}:${chunkLQ3YZTPU_cjs.t(o)}:${e.sessionToken}`;if(n in ce)return ce[n];for(De.push(n);De.length>At;)delete ce[De.shift()];let a=`AWS4${e.secretAccessKey}`;for(let m of [t,r,s,Me])a=await Rt(i,a,m);return ce[n]=a};var Rt=(i,e,t)=>{let r=new i(e);return r.update(chunkLQ3YZTPU_cjs.v(t)),r.digest()};chunkBUNLC3II_cjs.h();var ze=({headers:i},e,t)=>{let r={};for(let s of Object.keys(i).sort()){if(i[s]==null)continue;let o=s.toLowerCase();(o in yt||e?.has(o)||St.test(o)||wt.test(o))&&(!t||t&&!t.has(o))||(r[o]=i[s].trim().replace(/\s+/g," "));}return r};chunkBUNLC3II_cjs.h();var fe=async({headers:i,body:e},t)=>{for(let r of Object.keys(i))if(r.toLowerCase()===v)return i[r];if(e==null)return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||chunkLQ3YZTPU_cjs.a(e)){let r=new t;return r.update(chunkLQ3YZTPU_cjs.v(e)),chunkLQ3YZTPU_cjs.t(await r.digest())}return xt};chunkBUNLC3II_cjs.h();var _t=(i,e)=>{i=i.toLowerCase();for(let t of Object.keys(e))if(i===t.toLowerCase())return true;return false};chunkBUNLC3II_cjs.h();var kt=(i,e={})=>{let{headers:t,query:r={}}=chunkGNEVCEJU_cjs.e.clone(i);for(let s of Object.keys(t)){let o=s.toLowerCase();(o.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(o)||e.hoistableHeaders?.has(o))&&(r[s]=t[s],delete t[s]);}return {...i,headers:t,query:r}};chunkBUNLC3II_cjs.h();var Oe=i=>{i=chunkGNEVCEJU_cjs.e.clone(i);for(let e of Object.keys(i.headers))ut.indexOf(e.toLowerCase())>-1&&delete i.headers[e];return i};var K=class extends ae{headerFormatter=new oe;constructor({applyChecksum:e,credentials:t,region:r,service:s,sha256:o,uriEscapePath:n=true}){super({applyChecksum:e,credentials:t,region:r,service:s,sha256:o,uriEscapePath:n});}async presign(e,t={}){let{signingDate:r=new Date,expiresIn:s=3600,unsignableHeaders:o,unhoistableHeaders:n,signableHeaders:a,hoistableHeaders:m,signingRegion:c,signingService:f}=t,l=await this.credentialProvider();this.validateResolvedCredentials(l);let h=c??await this.regionProvider(),{longDate:u,shortDate:p}=this.formatDate(r);if(s>Nt)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");let y=me(p,h,f??this.service),S=kt(Oe(e),{unhoistableHeaders:n,hoistableHeaders:m});l.sessionToken&&(S.query[_e]=l.sessionToken),S.query[ft]=ne,S.query[dt]=`${l.accessKeyId}/${y}`,S.query[Re]=u,S.query[ht]=s.toString(10);let C=ze(S,o,a);return S.query[lt]=this.getCanonicalHeaderList(C),S.query[Te]=await this.getSignature(u,y,this.getSigningKey(l,h,p,f),this.createCanonicalRequest(S,C,await fe(e,this.sha256))),S}async sign(e,t){return typeof e=="string"?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:r=new Date,priorSignature:s,signingRegion:o,signingService:n,eventStreamCredentials:a}){let m=o??await this.regionProvider(),{shortDate:c,longDate:f}=this.formatDate(r),l=me(c,m,n??this.service),h=await fe({headers:{},body:t},this.sha256),u=new this.sha256;u.update(e);let p=chunkLQ3YZTPU_cjs.t(await u.digest()),y=[Et,f,l,s,p,h].join(`
12
- `);return this.signString(y,{signingDate:r,signingRegion:m,signingService:n,eventStreamCredentials:a})}async signMessage(e,{signingDate:t=new Date,signingRegion:r,signingService:s,eventStreamCredentials:o}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:r,signingService:s,priorSignature:e.priorSignature,eventStreamCredentials:o}).then(a=>({message:e.message,signature:a}))}async signString(e,{signingDate:t=new Date,signingRegion:r,signingService:s,eventStreamCredentials:o}={}){let n=o??await this.credentialProvider();this.validateResolvedCredentials(n);let a=r??await this.regionProvider(),{shortDate:m}=this.formatDate(t),c=new this.sha256(await this.getSigningKey(n,a,m,s));return c.update(chunkLQ3YZTPU_cjs.v(e)),chunkLQ3YZTPU_cjs.t(await c.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:r,unsignableHeaders:s,signingRegion:o,signingService:n}={}){let a=await this.credentialProvider();this.validateResolvedCredentials(a);let m=o??await this.regionProvider(),c=Oe(e),{longDate:f,shortDate:l}=this.formatDate(t),h=me(l,m,n??this.service);c.headers[Ie]=f,a.sessionToken&&(c.headers[pt]=a.sessionToken);let u=await fe(c,this.sha256);!_t(v,c.headers)&&this.applyChecksum&&(c.headers[v]=u);let p=ze(c,s,r),y=await this.getSignature(f,h,this.getSigningKey(a,m,l,n),this.createCanonicalRequest(c,p,u));return c.headers[ke]=`${ne} Credential=${a.accessKeyId}/${h}, SignedHeaders=${this.getCanonicalHeaderList(p)}, Signature=${y}`,c}async getSignature(e,t,r,s){let o=await this.createStringToSign(e,t,s,ne),n=new this.sha256(await r);return n.update(chunkLQ3YZTPU_cjs.v(o)),chunkLQ3YZTPU_cjs.t(await n.digest())}getSigningKey(e,t,r,s){return Tt(this.sha256,e,r,t,s||this.service)}};chunkBUNLC3II_cjs.h();var Xt={SignatureV4a:null};var It=i=>{let e=i.credentials,t=!!i.credentials,r;Object.defineProperty(i,"credentials",{set(c){c&&c!==e&&c!==r&&(t=true),e=c;let f=Ft(i,{credentials:e,credentialDefaultProvider:i.credentialDefaultProvider}),l=Gt(i,f);if(t&&!l.attributed){let h=typeof e=="object"&&e!==null;r=async u=>{let y=await l(u);return h&&(!y.$source||Object.keys(y.$source).length===0)?chunkLEBM6ZSZ_cjs.b(y,"CREDENTIALS_CODE","e"):y},r.memoized=l.memoized,r.configBound=l.configBound,r.attributed=true;}else r=l;},get(){return r},enumerable:true,configurable:true}),i.credentials=e;let{signingEscapePath:s=true,systemClockOffset:o=i.systemClockOffset||0,sha256:n}=i,a;return i.signer?a=chunkLEBM6ZSZ_cjs.H(i.signer):i.regionInfoProvider?a=()=>chunkLEBM6ZSZ_cjs.H(i.region)().then(async c=>[await i.regionInfoProvider(c,{useFipsEndpoint:await i.useFipsEndpoint(),useDualstackEndpoint:await i.useDualstackEndpoint()})||{},c]).then(([c,f])=>{let{signingRegion:l,signingService:h}=c;i.signingRegion=i.signingRegion||l||f,i.signingName=i.signingName||h||i.serviceId;let u={...i,credentials:i.credentials,region:i.signingRegion,service:i.signingName,sha256:n,uriEscapePath:s},p=i.signerConstructor||K;return new p(u)}):a=async c=>{c=Object.assign({},{name:"sigv4",signingName:i.signingName||i.defaultSigningName,signingRegion:await chunkLEBM6ZSZ_cjs.H(i.region)(),properties:{}},c);let f=c.signingRegion,l=c.signingName;i.signingRegion=i.signingRegion||f,i.signingName=i.signingName||l||i.serviceId;let h={...i,credentials:i.credentials,region:i.signingRegion,service:i.signingName,sha256:n,uriEscapePath:s},u=i.signerConstructor||K;return new u(h)},Object.assign(i,{systemClockOffset:o,signingEscapePath:s,signer:a})};function Ft(i,{credentials:e,credentialDefaultProvider:t}){let r;return e?e?.memoized?r=e:r=chunkLEBM6ZSZ_cjs.M(e,chunkLEBM6ZSZ_cjs.K,chunkLEBM6ZSZ_cjs.L):t?r=chunkLEBM6ZSZ_cjs.H(t(Object.assign({},i,{parentClientConfig:i}))):r=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},r.memoized=true,r}function Gt(i,e){if(e.configBound)return e;let t=async r=>e({...r,callerClientConfig:i});return t.memoized=e.memoized,t.configBound=true,t}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var M=class{queryCompat;errorRegistry;constructor(e=false){this.queryCompat=e;}resolveRestContentType(e,t){let r=t.getMemberSchemas(),s=Object.values(r).find(o=>!!o.getMergedTraits().httpPayload);if(s){let o=s.getMergedTraits().mediaType;return o||(s.isStringSchema()?"text/plain":s.isBlobSchema()?"application/octet-stream":e)}else if(!t.isUnitSchema()&&Object.values(r).find(n=>{let{httpQuery:a,httpQueryParams:m,httpHeader:c,httpLabel:f,httpPrefixHeaders:l}=n.getMergedTraits();return !a&&!m&&!c&&!f&&l===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,t,r,s,o,n){let a=e;e.includes("#")&&([,a]=e.split("#"));let m={$metadata:o,$fault:r.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return {errorSchema:n?.(this.errorRegistry,a)??this.errorRegistry.getSchema(e),errorMetadata:m}}catch{s.message=s.message??s.Message??"UnknownError";let f=this.errorRegistry,l=f.getBaseException();if(l){let p=f.getErrorCtor(l)??Error;throw this.decorateServiceException(Object.assign(new p({name:a}),m),s)}let h=s,u=h?.message??h?.Message??h?.Error?.Message??h?.Error?.message;throw this.decorateServiceException(Object.assign(new Error(u),{name:a},m),s)}}compose(e,t,r){let s=r;t.includes("#")&&([s]=t.split("#"));let o=chunkGNEVCEJU_cjs.n.for(s),n=chunkGNEVCEJU_cjs.n.for("smithy.ts.sdk.synthetic."+r);e.copyFrom(o),e.copyFrom(n),this.errorRegistry=e;}decorateServiceException(e,t={}){if(this.queryCompat){let r=e.Message??t.Message,s=chunkLEBM6ZSZ_cjs.g(e,t);r&&(s.message=r);let o=s.Error??{};o.Type=s.Error?.Type,o.Code=s.Error?.Code,o.Message=s.Error?.message??s.Error?.Message??r,s.Error=o;let n=s.$metadata.requestId;return n&&(s.RequestId=n),s}return chunkLEBM6ZSZ_cjs.g(e,t)}setQueryCompatError(e,t){let r=t.headers?.["x-amzn-query-error"];if(e!==void 0&&r!=null){let[s,o]=r.split(";"),n=Object.keys(e),a={Code:s,Type:o};e.Code=s,e.Type=o;for(let m=0;m<n.length;m++){let c=n[m];a[c==="message"?"Message":c]=e[c];}delete a.__type,e.Error=a;}}queryCompatOutput(e,t){e.Error&&(t.Error=e.Error),e.Type&&(t.Type=e.Type),e.Code&&(t.Code=e.Code);}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch{return e.find(s=>chunkGNEVCEJU_cjs.m.of(s).getMergedTraits().awsQueryError?.[0]===t)}}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var x=class{serdeContext;setSerdeContext(e){this.serdeContext=e;}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var V=class{from;to;keys;constructor(e,t){this.from=e,this.to=t;let r=Object.keys(this.from),s=new Set(r);s.delete("__type"),this.keys=s;}mark(e){this.keys.delete(e);}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){let e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t];}}};chunkBUNLC3II_cjs.h();function Mt(i,e,t){if(t?.source){let r=t.source;if(typeof e=="number"&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER||r!==String(e)))return r.includes(".")?new chunkLQ3YZTPU_cjs.r(r,"bigDecimal"):BigInt(r)}return e}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Dt=(i,e)=>chunkGNEVCEJU_cjs.J(i,e).then(t=>(e?.utf8Encoder??chunkLQ3YZTPU_cjs.e)(t));var Ot=(i,e)=>Dt(i,e).then(t=>{if(t.length)try{return JSON.parse(t)}catch(r){throw r?.name==="SyntaxError"&&Object.defineProperty(r,"$responseBodyText",{value:t}),r}return {}});var zt=(i,e)=>Object.keys(i).find(t=>t.toLowerCase()===e.toLowerCase()),Pe=i=>{let e=i;return typeof e=="number"&&(e=e.toString()),e.indexOf(",")>=0&&(e=e.split(",")[0]),e.indexOf(":")>=0&&(e=e.split(":")[0]),e.indexOf("#")>=0&&(e=e.split("#")[1]),e},Pt=(i,e)=>vt(i,e,["header","code","type"]);var vt=({headers:i},e,t)=>{for(;t.length>0;)switch(t.shift()){case "header":let s=zt(i??{},"x-amzn-errortype");if(s!==void 0)return Pe(i[s]);break;case "code":let o=zt(e??{},"code");if(o&&e[o]!==void 0)return Pe(e[o]);break;case "type":if(e?.__type!==void 0)return Pe(e.__type);break}};var de=class extends x{settings;constructor(e){super(),this.settings=e;}async read(e,t){return this._read(e,typeof t=="string"?JSON.parse(t,Mt):await Ot(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){let r=t!==null&&typeof t=="object",s=chunkGNEVCEJU_cjs.m.of(e);if(r){if(s.isStructSchema()){let n=t,a=s.isUnionSchema(),m={},c,{jsonName:f}=this.settings;f&&(c={});let l;a&&(l=new V(n,m));for(let[h,u]of s.structIterator()){let p=h;f&&(p=u.getMergedTraits().jsonName??p,c[p]=h),a&&l.mark(p),n[p]!=null&&(m[h]=this._read(u,n[p]));}if(a)l.writeUnknown();else if(typeof n.__type=="string")for(let h in n){let u=n[h],p=f?c[h]??h:h;p in m||(m[p]=u);}return m}if(Array.isArray(t)&&s.isListSchema()){let n=s.getValueSchema(),a=[];for(let m of t)a.push(this._read(n,m));return a}if(s.isMapSchema()){let n=s.getValueSchema(),a={};for(let m in t)a[m]=this._read(n,t[m]);return a}}if(s.isBlobSchema()&&typeof t=="string")return chunkLQ3YZTPU_cjs.b(t);let o=s.getMergedTraits().mediaType;if(s.isStringSchema()&&typeof t=="string"&&o)return o==="application/json"||o.endsWith("+json")?chunkLQ3YZTPU_cjs.k.from(t):t;if(s.isTimestampSchema()&&t!=null)switch(chunkGNEVCEJU_cjs.N(s,this.settings)){case 5:return chunkLQ3YZTPU_cjs.h(t);case 6:return chunkLQ3YZTPU_cjs.i(t);case 7:return chunkLQ3YZTPU_cjs.j(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(s.isBigIntegerSchema()&&(typeof t=="number"||typeof t=="string"))return BigInt(t);if(s.isBigDecimalSchema()&&t!=null){if(t instanceof chunkLQ3YZTPU_cjs.r)return t;let n=t;return n.type==="bigDecimal"&&"string"in n?new chunkLQ3YZTPU_cjs.r(n.string,n.type):new chunkLQ3YZTPU_cjs.r(String(t),"bigDecimal")}if(s.isNumericSchema()&&typeof t=="string"){switch(t){case "Infinity":return 1/0;case "-Infinity":return -1/0;case "NaN":return NaN}return t}if(s.isDocumentSchema())if(r){let n=Array.isArray(t)?[]:{};for(let a in t){let m=t[a];m instanceof chunkLQ3YZTPU_cjs.r?n[a]=m:n[a]=this._read(s,m);}return n}else return structuredClone(t);return t}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ht="\u039D",le=class{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(e,t)=>{if(t instanceof chunkLQ3YZTPU_cjs.r){let r=`${Ht+"nv"+this.counter++}_`+t.string;return this.values.set(`"${r}"`,t.string),r}if(typeof t=="bigint"){let r=t.toString(),s=`${Ht+"b"+this.counter++}_`+r;return this.values.set(`"${s}"`,r),s}return t}}replaceInJson(e){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return e;for(let[t,r]of this.values)e=e.replace(t,r);return e}};var he=class extends x{settings;buffer;useReplacer=false;rootSchema;constructor(e){super(),this.settings=e;}write(e,t){this.rootSchema=chunkGNEVCEJU_cjs.m.of(e),this.buffer=this._write(this.rootSchema,t);}flush(){let{rootSchema:e,useReplacer:t}=this;if(this.rootSchema=void 0,this.useReplacer=false,e?.isStructSchema()||e?.isDocumentSchema()){if(!t)return JSON.stringify(this.buffer);let r=new le;return r.replaceInJson(JSON.stringify(this.buffer,r.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(e,t){this.write(e,t),typeof this.buffer=="object"&&(this.buffer.__type=chunkGNEVCEJU_cjs.m.of(e).getName(true));}_write(e,t,r){let s=t!==null&&typeof t=="object",o=chunkGNEVCEJU_cjs.m.of(e);if(s){if(o.isStructSchema()){let n=t,a={},{jsonName:m}=this.settings,c;m&&(c={});let f=0;for(let[l,h]of o.structIterator()){let u=this._write(h,n[l],o);if(u!==void 0){let p=l;m&&(p=h.getMergedTraits().jsonName??l,c[l]=p),a[p]=u,f++;}}if(o.isUnionSchema()&&f===0){let{$unknown:l}=n;if(Array.isArray(l)){let[h,u]=l;a[h]=this._write(15,u);}}else if(typeof n.__type=="string")for(let l in n){let h=n[l],u=m?c[l]??l:l;u in a||(a[u]=this._write(15,h));}return a}if(Array.isArray(t)&&o.isListSchema()){let n=o.getValueSchema(),a=[],m=!!o.getMergedTraits().sparse;for(let c of t)(m||c!=null)&&a.push(this._write(n,c));return a}if(o.isMapSchema()){let n=o.getValueSchema(),a={},m=!!o.getMergedTraits().sparse;for(let c in t){let f=t[c];(m||f!=null)&&(a[c]=this._write(n,f));}return a}if(t instanceof Uint8Array&&(o.isBlobSchema()||o.isDocumentSchema()))return o===this.rootSchema?t:(this.serdeContext?.base64Encoder??chunkLQ3YZTPU_cjs.d)(t);if(t instanceof Date&&(o.isTimestampSchema()||o.isDocumentSchema()))switch(chunkGNEVCEJU_cjs.N(o,this.settings)){case 5:return t.toISOString().replace(".000Z","Z");case 6:return chunkLQ3YZTPU_cjs.f(t);case 7:return t.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",t),t.getTime()/1e3}t instanceof chunkLQ3YZTPU_cjs.r&&(this.useReplacer=true);}if(!(t===null&&r?.isStructSchema())){if(o.isStringSchema()){if(typeof t>"u"&&o.isIdempotencyToken())return chunkLQ3YZTPU_cjs.D();let n=o.getMergedTraits().mediaType;return t!=null&&n&&(n==="application/json"||n.endsWith("+json"))?chunkLQ3YZTPU_cjs.k.from(t):t}if(typeof t=="number"&&o.isNumericSchema())return Math.abs(t)===1/0||isNaN(t)?String(t):t;if(typeof t=="string"&&o.isBlobSchema())return o===this.rootSchema?t:(this.serdeContext?.base64Encoder??chunkLQ3YZTPU_cjs.d)(t);if(typeof t=="bigint"&&(this.useReplacer=true),o.isDocumentSchema())if(s){let n=Array.isArray(t)?[]:{};for(let a in t){let m=t[a];m instanceof chunkLQ3YZTPU_cjs.r?(this.useReplacer=true,n[a]=m):n[a]=this._write(o,m);}return n}else return structuredClone(t);return t}}};var ue=class extends x{settings;constructor(e){super(),this.settings=e;}createSerializer(){let e=new he(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new de(this.settings);return e.setSerdeContext(this.serdeContext),e}};var He=class extends chunkGNEVCEJU_cjs.L{serializer;deserializer;codec;mixin=new M;constructor({defaultNamespace:e,errorTypeRegistries:t}){super({defaultNamespace:e,errorTypeRegistries:t});let r={timestampFormat:{useTrait:true,default:7},httpBindings:true,jsonName:true};this.codec=new ue(r),this.serializer=new chunkGNEVCEJU_cjs.Q(this.codec.createSerializer(),r),this.deserializer=new chunkGNEVCEJU_cjs.P(this.codec.createDeserializer(),r);}getShapeId(){return "aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e);}async serializeRequest(e,t,r){let s=await super.serializeRequest(e,t,r),o=chunkGNEVCEJU_cjs.m.of(e.input);if(!s.headers["content-type"]){let n=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);n&&(s.headers["content-type"]=n);}return s.body==null&&s.headers["content-type"]===this.getDefaultContentType()&&(s.body="{}"),s}async deserializeResponse(e,t,r){let s=await super.deserializeResponse(e,t,r),o=chunkGNEVCEJU_cjs.m.of(e.output);for(let[n,a]of o.structIterator())a.getMemberTraits().httpPayload&&!(n in s)&&(s[n]=null);return s}async handleError(e,t,r,s,o){let n=Pt(r,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,n,this.options.defaultNamespace);let{errorSchema:a,errorMetadata:m}=await this.mixin.getErrorSchemaOrThrowBaseException(n,this.options.defaultNamespace,r,s,o),c=chunkGNEVCEJU_cjs.m.of(a),f=s.message??s.Message??"UnknownError",l=this.compositeErrorRegistry.getErrorCtor(a)??Error,h=new l({});await this.deserializeHttpMessage(a,t,r,s);let u={},p=this.codec.createDeserializer();for(let[y,S]of c.structIterator()){let C=S.getMergedTraits().jsonName??y;u[y]=p.readObject(S,s[C]);}throw this.mixin.decorateServiceException(Object.assign(h,m,{$fault:c.getMergedTraits().error,message:f},u),s)}getDefaultContentType(){return "application/json"}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Jt=/[&<>"]/g,Wt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function $t(i){return i.replace(Jt,e=>Wt[e])}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Yt=/[&"'<>\r\n\u0085\u2028]/g,Zt={"&":"&amp;",'"':"&quot;","'":"&apos;","<":"&lt;",">":"&gt;","\r":"&#x0D;","\n":"&#x0A;","\x85":"&#x85;","\u2028":"&#x2028;"};function Ut(i){return i.replace(Yt,e=>Zt[e])}var D=class{value;constructor(e){this.value=e;}toString(){return Ut(""+this.value)}};var A=class i{name;children;attributes={};static of(e,t,r){let s=new i(e);return t!==void 0&&s.addChildNode(new D(t)),r!==void 0&&s.withName(r),s}constructor(e,t=[]){this.name=e,this.children=t;}withName(e){return this.name=e,this}addAttribute(e,t){return this.attributes[e]=t,this}addChildNode(e){return this.children.push(e),this}removeAttribute(e){return delete this.attributes[e],this}n(e){return this.name=e,this}c(e){return this.children.push(e),this}a(e,t){return t!=null&&(this.attributes[e]=t),this}cc(e,t,r=t){if(e[t]!=null){let s=i.of(t,e[t]).withName(r);this.c(s);}}l(e,t,r,s){e[t]!=null&&s().map(n=>{n.withName(r),this.c(n);});}lc(e,t,r,s){if(e[t]!=null){let o=s(),n=new i(r);o.map(a=>{n.c(a);}),this.c(n);}}toString(){let e=!!this.children.length,t=`<${this.name}`,r=this.attributes;for(let s of Object.keys(r)){let o=r[s];o!=null&&(t+=` ${s}="${$t(""+o)}"`);}return t+=e?`>${this.children.map(s=>s.toString()).join("")}</${this.name}>`:"/>"}};chunkBUNLC3II_cjs.h();function Ue(i){return new $e(i).parse()}var $e=class i{x;i=0;z;constructor(e){this.x=e,this.x=e.replace(/\r\n?/g,`
13
- `),this.z=this.x.length;}parse(){let e=this,{z:t}=e;for(;e.i<t&&(e.trim(),!(e.i>=t));)if(e.isNext("<?"))e.readTo("?>"),e.trim();else if(e.isNext("<!--"))e.readTo("-->"),e.trim();else if(e.isNext("<!DOCTYPE",false))e.skipDoctype(),e.trim();else if(e.x[e.i]==="<"){let r=e.parseTag();return {[r.tag]:r.value}}else throw new Error("@aws-sdk XML parse error: unexpected content.");throw new Error("@aws-sdk XML parse error: no root element.")}isNext(e,t=true){let r=this;return t?r.x.startsWith(e,r.i):r.x.toLowerCase().startsWith(e.toLowerCase(),r.i)}readTo(e){let t=this,r=t.x.indexOf(e,t.i);if(r===-1)throw new Error(`@aws-sdk XML parse error: expected "${e}" not found.`);let s=t.x.slice(t.i,r);return t.i=r+e.length,s}trim(){let e=this;for(;e.i<e.z&&` \r
14
- `.includes(e.x[e.i]);)++e.i;}readAttrValue(){let e=this,t=e.x[e.i];++e.i;let r="";for(;e.i<e.z&&e.x[e.i]!==t;)r+=e.x[e.i++];return ++e.i,e.decodeEntities(r)}parseTag(){let e=this;++e.i;let t="";for(;e.i<e.z&&!` \r
15
- >/`.includes(e.x[e.i]);)t+=e.x[e.i++];let r=false,s=Object.create(null);for(;e.i<e.z&&(e.trim(),!">/".includes(e.x[e.i]));){let f="";for(;e.i<e.z&&!`= \r
16
- >/?`.includes(e.x[e.i]);)f+=e.x[e.i++];if(e.trim(),e.x[e.i]!=="=")break;++e.i,e.trim(),s[f]=e.readAttrValue(),r=true;}if(e.i>=e.z)throw new Error("@aws-sdk XML parse error: unexpected end of input.");if(e.x[e.i]==="/"){if(++e.i,e.i>=e.z||e.x[e.i]!==">")throw new Error("@aws-sdk XML parse error: expected > at the end of self-closing tag.");return ++e.i,Object.setPrototypeOf(s,Object.prototype),{tag:t,value:r?s:""}}if(e.x[e.i]!==">")throw new Error("@aws-sdk XML parse error: expected > at the end of opening tag.");++e.i;let o=[],n=[],a=false;for(;e.i<e.z&&!e.isNext("</");)if(e.x[e.i]==="<")e.isNext("<!--")?e.readTo("-->"):e.isNext("<![CDATA[")?(e.i+=9,o.push(e.readTo("]]>"))):e.isNext("<?")?e.readTo("?>"):(a=true,n.push(e.parseTag()));else {let f="";for(;e.i<e.z&&e.x[e.i]!=="<";)f+=e.x[e.i++];o.push(e.decodeEntities(f));}if(!e.isNext("</"))throw new Error(`@aws-sdk XML parse error: missing closing tag </${t}>.`);e.i+=2;let m=e.readTo(">").trim();if(m!==t)throw new Error(`@aws-sdk XML parse error: mismatched tags <${t}> and </${m}>.`);if(!r&&o.length===0&&!a)return {tag:t,value:""};if(!r&&!a){let f=o.length===1?o[0]:o.join("");return f.trim()===""&&f.includes(`
17
- `)?{tag:t,value:""}:{tag:t,value:f}}let c=Object.create(null);for(let f of o)f.trim()===""&&f.includes(`
18
- `)||(c["#text"]="#text"in c?c["#text"]+f:f);for(let f of n)f.tag in c?Array.isArray(c[f.tag])?c[f.tag].push(f.value):c[f.tag]=[c[f.tag],f.value]:c[f.tag]=f.value;for(let[f,l]of Object.entries(s))c[f]=l;return Object.setPrototypeOf(c,Object.prototype),{tag:t,value:c}}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};skipDoctype(){let e=this;e.i+=9;let t=0;for(;e.i<e.z;){let r=e.x[e.i];if(r==="[")++t;else if(r==="]")--t;else if(r===">"&&t===0){++e.i;return}++e.i;}throw new Error("@aws-sdk XML parse error: unclosed DOCTYPE.")}decodeEntities(e){return e.replace(/&(?:#x([0-9a-fA-F]{1,6})|#(\d{1,7})|([a-zA-Z][a-zA-Z0-9]{0,30}));/g,(t,r,s,o)=>r?String.fromCharCode(parseInt(r,16)):s?String.fromCharCode(parseInt(s,10)):i.ENTITIES[o]??"")}};var j=class extends x{settings;stringDeserializer;constructor(e){super(),this.settings=e,this.stringDeserializer=new chunkGNEVCEJU_cjs.O(e);}setSerdeContext(e){this.serdeContext=e,this.stringDeserializer.setSerdeContext(e);}read(e,t,r){let s=chunkGNEVCEJU_cjs.m.of(e),o=s.getMemberSchemas();if(s.isStructSchema()&&s.isMemberSchema()&&!!Object.values(o).find(c=>!!c.getMemberTraits().eventPayload)){let c={},f=Object.keys(o)[0];return o[f].isBlobSchema()?c[f]=t:c[f]=this.read(o[f],t),c}let a=(this.serdeContext?.utf8Encoder??chunkLQ3YZTPU_cjs.e)(t),m=this.parseXml(a);return this.readSchema(e,r?m[r]:m)}readSchema(e,t){let r=chunkGNEVCEJU_cjs.m.of(e);if(r.isUnitSchema())return;let s=r.getMergedTraits();if(r.isListSchema()&&!Array.isArray(t))return this.readSchema(r,[t]);if(t==null)return t;if(typeof t=="object"){let o=!!s.xmlFlattened;if(r.isListSchema()){let a=r.getValueSchema(),m=[],c=a.getMergedTraits().xmlName??"member",f=o?t:(t[0]??t)[c];if(f==null)return m;let l=Array.isArray(f)?f:[f];for(let h of l)m.push(this.readSchema(a,h));return m}let n={};if(r.isMapSchema()){let a=r.getKeySchema(),m=r.getValueSchema(),c;o?c=Array.isArray(t)?t:[t]:c=Array.isArray(t.entry)?t.entry:[t.entry];let f=a.getMergedTraits().xmlName??"key",l=m.getMergedTraits().xmlName??"value";for(let h of c){let u=h[f],p=h[l];n[u]=this.readSchema(m,p);}return n}if(r.isStructSchema()){let a=r.isUnionSchema(),m;a&&(m=new V(t,n));for(let[c,f]of r.structIterator()){let l=f.getMergedTraits(),h=l.httpPayload?l.xmlName??f.getName():f.getMemberTraits().xmlName??c;a&&m.mark(h),t[h]!=null&&(n[c]=this.readSchema(f,t[h]));}return a&&m.writeUnknown(),n}if(r.isDocumentSchema())return t;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${r.getName(true)}`)}return r.isListSchema()?[]:r.isMapSchema()||r.isStructSchema()?{}:this.stringDeserializer.read(r,t)}parseXml(e){if(e.length){let t;try{t=Ue(e);}catch(n){throw n&&typeof n=="object"&&Object.defineProperty(n,"$responseBodyText",{value:e}),n}let r="#text",s=Object.keys(t)[0],o=t[s];return o[r]&&(o[s]=o[r],delete o[r]),chunkLEBM6ZSZ_cjs.l(o)}return {}}};chunkBUNLC3II_cjs.h();var ge=class extends x{settings;buffer;constructor(e){super(),this.settings=e;}write(e,t,r=""){this.buffer===void 0&&(this.buffer="");let s=chunkGNEVCEJU_cjs.m.of(e);if(r&&!r.endsWith(".")&&(r+="."),s.isBlobSchema())(typeof t=="string"||t instanceof Uint8Array)&&(this.writeKey(r),this.writeValue((this.serdeContext?.base64Encoder??chunkLQ3YZTPU_cjs.d)(t)));else if(s.isBooleanSchema()||s.isNumericSchema()||s.isStringSchema())t!=null?(this.writeKey(r),this.writeValue(String(t))):s.isIdempotencyToken()&&(this.writeKey(r),this.writeValue(chunkLQ3YZTPU_cjs.D()));else if(s.isBigIntegerSchema())t!=null&&(this.writeKey(r),this.writeValue(String(t)));else if(s.isBigDecimalSchema())t!=null&&(this.writeKey(r),this.writeValue(t instanceof chunkLQ3YZTPU_cjs.r?t.string:String(t)));else if(s.isTimestampSchema()){if(t instanceof Date)switch(this.writeKey(r),chunkGNEVCEJU_cjs.N(s,this.settings)){case 5:this.writeValue(t.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue(chunkLQ3YZTPU_cjs.f(t));break;case 7:this.writeValue(String(t.getTime()/1e3));break}}else if(s.isDocumentSchema())Array.isArray(t)?this.write(79,t,r):t instanceof Date?this.write(4,t,r):t instanceof Uint8Array?this.write(21,t,r):t&&typeof t=="object"?this.write(143,t,r):(this.writeKey(r),this.writeValue(String(t)));else if(s.isListSchema()){if(Array.isArray(t))if(t.length===0)this.settings.serializeEmptyLists&&(this.writeKey(r),this.writeValue(""));else {let o=s.getValueSchema(),n=this.settings.flattenLists||s.getMergedTraits().xmlFlattened,a=1;for(let m of t){if(m==null)continue;let c=o.getMergedTraits(),f=this.getKey("member",c.xmlName,c.ec2QueryName),l=n?`${r}${a}`:`${r}${f}.${a}`;this.write(o,m,l),++a;}}}else if(s.isMapSchema()){if(t&&typeof t=="object"){let o=s.getKeySchema(),n=s.getValueSchema(),a=s.getMergedTraits().xmlFlattened,m=1;for(let c in t){let f=t[c];if(f==null)continue;let l=o.getMergedTraits(),h=this.getKey("key",l.xmlName,l.ec2QueryName),u=a?`${r}${m}.${h}`:`${r}entry.${m}.${h}`,p=n.getMergedTraits(),y=this.getKey("value",p.xmlName,p.ec2QueryName),S=a?`${r}${m}.${y}`:`${r}entry.${m}.${y}`;this.write(o,c,u),this.write(n,f,S),++m;}}}else if(s.isStructSchema()){if(t&&typeof t=="object"){let o=false;for(let[n,a]of s.structIterator()){if(t[n]==null&&!a.isIdempotencyToken())continue;let m=a.getMergedTraits(),c=this.getKey(n,m.xmlName,m.ec2QueryName,"struct"),f=`${r}${c}`;this.write(a,t[n],f),o=true;}if(!o&&s.isUnionSchema()){let{$unknown:n}=t;if(Array.isArray(n)){let[a,m]=n,c=`${r}${a}`;this.write(15,m,c);}}}}else if(!s.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${s.getName(true)}`)}flush(){if(this.buffer===void 0)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");let e=this.buffer;return delete this.buffer,e}getKey(e,t,r,s){let{ec2:o,capitalizeKeys:n}=this.settings;if(o&&r)return r;let a=t??e;return n&&s==="struct"?a[0].toUpperCase()+a.slice(1):a}writeKey(e){e.endsWith(".")&&(e=e.slice(0,e.length-1)),this.buffer+=`&${chunkGNEVCEJU_cjs.K(e)}=`;}writeValue(e){this.buffer+=chunkGNEVCEJU_cjs.K(e);}};var Le=class extends chunkGNEVCEJU_cjs.M{options;serializer;deserializer;mixin=new M;constructor(e){super({defaultNamespace:e.defaultNamespace,errorTypeRegistries:e.errorTypeRegistries}),this.options=e;let t={timestampFormat:{useTrait:true,default:5},httpBindings:false,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace,serializeEmptyLists:true};this.serializer=new ge(t),this.deserializer=new j(t);}getShapeId(){return "aws.protocols#awsQuery"}setSerdeContext(e){this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e);}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(e,t,r){let s=await super.serializeRequest(e,t,r);s.path.endsWith("/")||(s.path+="/"),s.headers["content-type"]="application/x-www-form-urlencoded",(chunkGNEVCEJU_cjs.k(e.input)==="unit"||!s.body)&&(s.body="");let o=e.name.split("#")[1]??e.name;return s.body=`Action=${o}&Version=${this.options.version}`+s.body,s.body.endsWith("&")&&(s.body=s.body.slice(-1)),s}async deserializeResponse(e,t,r){let s=this.deserializer,o=chunkGNEVCEJU_cjs.m.of(e.output),n={};if(r.statusCode>=300){let f=await chunkGNEVCEJU_cjs.J(r.body,t);f.byteLength>0&&Object.assign(n,await s.read(15,f)),await this.handleError(e,t,r,n,this.deserializeMetadata(r));}for(let f in r.headers){let l=r.headers[f];delete r.headers[f],r.headers[f.toLowerCase()]=l;}let a=e.name.split("#")[1]??e.name,m=o.isStructSchema()&&this.useNestedResult()?a+"Result":void 0,c=await chunkGNEVCEJU_cjs.J(r.body,t);return c.byteLength>0&&Object.assign(n,await s.read(o,c,m)),n.$metadata=this.deserializeMetadata(r),n}useNestedResult(){return true}async handleError(e,t,r,s,o){let n=this.loadQueryErrorCode(r,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,n,this.options.defaultNamespace);let a=this.loadQueryError(s)??{},m=this.loadQueryErrorMessage(s);a.message=m,a.Error={Type:a.Type,Code:a.Code,Message:m};let{errorSchema:c,errorMetadata:f}=await this.mixin.getErrorSchemaOrThrowBaseException(n,this.options.defaultNamespace,r,a,o,this.mixin.findQueryCompatibleError),l=chunkGNEVCEJU_cjs.m.of(c),h=this.compositeErrorRegistry.getErrorCtor(c)??Error,u=new h({}),p={Type:a.Error.Type,Code:a.Error.Code,Error:a.Error};for(let[y,S]of l.structIterator()){let C=S.getMergedTraits().xmlName??y,N=a[C]??s[C];p[y]=this.deserializer.readSchema(S,N);}throw this.mixin.decorateServiceException(Object.assign(u,f,{$fault:l.getMergedTraits().error,message:m},p),s)}loadQueryErrorCode(e,t){let r=(t.Errors?.[0]?.Error??t.Errors?.Error??t.Error)?.Code;if(r!==void 0)return r;if(e.statusCode==404)return "NotFound"}loadQueryError(e){return e.Errors?.[0]?.Error??e.Errors?.Error??e.Error}loadQueryErrorMessage(e){let t=this.loadQueryError(e);return t?.message??t?.Message??e.message??e.Message??"Unknown"}getDefaultContentType(){return "application/x-www-form-urlencoded"}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Lt=(i,e)=>{if(e?.Error?.Code!==void 0)return e.Error.Code;if(e?.Code!==void 0)return e.Code;if(i.statusCode==404)return "NotFound"};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var pe=class extends x{settings;stringBuffer;byteBuffer;buffer;constructor(e){super(),this.settings=e;}write(e,t){let r=chunkGNEVCEJU_cjs.m.of(e);if(r.isStringSchema()&&typeof t=="string")this.stringBuffer=t;else if(r.isBlobSchema())this.byteBuffer="byteLength"in t?t:(this.serdeContext?.base64Decoder??chunkLQ3YZTPU_cjs.b)(t);else {this.buffer=this.writeStruct(r,t,void 0);let s=r.getMergedTraits();s.httpPayload&&!s.xmlName&&this.buffer.withName(r.getName());}}flush(){if(this.byteBuffer!==void 0){let t=this.byteBuffer;return delete this.byteBuffer,t}if(this.stringBuffer!==void 0){let t=this.stringBuffer;return delete this.stringBuffer,t}let e=this.buffer;return this.settings.xmlNamespace&&(e?.attributes?.xmlns||e.addAttribute("xmlns",this.settings.xmlNamespace)),delete this.buffer,e.toString()}writeStruct(e,t,r){let s=e.getMergedTraits(),o=e.isMemberSchema()&&!s.httpPayload?e.getMemberTraits().xmlName??e.getMemberName():s.xmlName??e.getName();if(!o||!e.isStructSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${e.getName(true)}.`);let n=A.of(o),[a,m]=this.getXmlnsAttribute(e,r);for(let[f,l]of e.structIterator()){let h=t[f];if(h!=null||l.isIdempotencyToken()){if(l.getMergedTraits().xmlAttribute){n.addAttribute(l.getMergedTraits().xmlName??f,this.writeSimple(l,h));continue}if(l.isListSchema())this.writeList(l,h,n,m);else if(l.isMapSchema())this.writeMap(l,h,n,m);else if(l.isStructSchema())n.addChildNode(this.writeStruct(l,h,m));else {let u=A.of(l.getMergedTraits().xmlName??l.getMemberName());this.writeSimpleInto(l,h,u,m),n.addChildNode(u);}}}let{$unknown:c}=t;if(c&&e.isUnionSchema()&&Array.isArray(c)&&Object.keys(t).length===1){let[f,l]=c,h=A.of(f);if(typeof l!="string")if(t instanceof A||t instanceof D)n.addChildNode(t);else throw new Error("@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.");this.writeSimpleInto(0,l,h,m),n.addChildNode(h);}return m&&n.addAttribute(a,m),n}writeList(e,t,r,s){if(!e.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${e.getName(true)}`);let o=e.getMergedTraits(),n=e.getValueSchema(),a=n.getMergedTraits(),m=!!a.sparse,c=!!o.xmlFlattened,[f,l]=this.getXmlnsAttribute(e,s),h=(u,p)=>{if(n.isListSchema())this.writeList(n,Array.isArray(p)?p:[p],u,l);else if(n.isMapSchema())this.writeMap(n,p,u,l);else if(n.isStructSchema()){let y=this.writeStruct(n,p,l);u.addChildNode(y.withName(c?o.xmlName??e.getMemberName():a.xmlName??"member"));}else {let y=A.of(c?o.xmlName??e.getMemberName():a.xmlName??"member");this.writeSimpleInto(n,p,y,l),u.addChildNode(y);}};if(c)for(let u of t)(m||u!=null)&&h(r,u);else {let u=A.of(o.xmlName??e.getMemberName());l&&u.addAttribute(f,l);for(let p of t)(m||p!=null)&&h(u,p);r.addChildNode(u);}}writeMap(e,t,r,s,o=false){if(!e.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${e.getName(true)}`);let n=e.getMergedTraits(),a=e.getKeySchema(),c=a.getMergedTraits().xmlName??"key",f=e.getValueSchema(),l=f.getMergedTraits(),h=l.xmlName??"value",u=!!l.sparse,p=!!n.xmlFlattened,[y,S]=this.getXmlnsAttribute(e,s),C=(N,z,T)=>{let X=A.of(c,z),[Bt,Ke]=this.getXmlnsAttribute(a,S);Ke&&X.addAttribute(Bt,Ke),N.addChildNode(X);let F=A.of(h);f.isListSchema()?this.writeList(f,T,F,S):f.isMapSchema()?this.writeMap(f,T,F,S,true):f.isStructSchema()?F=this.writeStruct(f,T,S):this.writeSimpleInto(f,T,F,S),N.addChildNode(F);};if(p)for(let N in t){let z=t[N];if(u||z!=null){let T=A.of(n.xmlName??e.getMemberName());C(T,N,z),r.addChildNode(T);}}else {let N;o||(N=A.of(n.xmlName??e.getMemberName()),S&&N.addAttribute(y,S),r.addChildNode(N));for(let z in t){let T=t[z];if(u||T!=null){let X=A.of("entry");C(X,z,T),(o?r:N).addChildNode(X);}}}}writeSimple(e,t){if(t===null)throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");let r=chunkGNEVCEJU_cjs.m.of(e),s=null;if(t&&typeof t=="object")if(r.isBlobSchema())s=(this.serdeContext?.base64Encoder??chunkLQ3YZTPU_cjs.d)(t);else if(r.isTimestampSchema()&&t instanceof Date)switch(chunkGNEVCEJU_cjs.N(r,this.settings)){case 5:s=t.toISOString().replace(".000Z","Z");break;case 6:s=chunkLQ3YZTPU_cjs.f(t);break;case 7:s=String(t.getTime()/1e3);break;default:console.warn("Missing timestamp format, using http date",t),s=chunkLQ3YZTPU_cjs.f(t);break}else {if(r.isBigDecimalSchema()&&t)return t instanceof chunkLQ3YZTPU_cjs.r?t.string:String(t);throw r.isMapSchema()||r.isListSchema()?new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."):new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${r.getName(true)}`)}if((r.isBooleanSchema()||r.isNumericSchema()||r.isBigIntegerSchema()||r.isBigDecimalSchema())&&(s=String(t)),r.isStringSchema()&&(t===void 0&&r.isIdempotencyToken()?s=chunkLQ3YZTPU_cjs.D():s=String(t)),s===null)throw new Error(`Unhandled schema-value pair ${r.getName(true)}=${t}`);return s}writeSimpleInto(e,t,r,s){let o=this.writeSimple(e,t),n=chunkGNEVCEJU_cjs.m.of(e),a=new D(o),[m,c]=this.getXmlnsAttribute(n,s);c&&r.addAttribute(m,c),r.addChildNode(a);}getXmlnsAttribute(e,t){let r=e.getMergedTraits(),[s,o]=r.xmlNamespace??[];return o&&o!==t?[s?`xmlns:${s}`:"xmlns",o]:[void 0,void 0]}};var ye=class extends x{settings;constructor(e){super(),this.settings=e;}createSerializer(){let e=new pe(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new j(this.settings);return e.setSerdeContext(this.serdeContext),e}};var Be=class extends chunkGNEVCEJU_cjs.L{codec;serializer;deserializer;mixin=new M;constructor(e){super(e);let t={timestampFormat:{useTrait:true,default:5},httpBindings:true,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace};this.codec=new ye(t),this.serializer=new chunkGNEVCEJU_cjs.Q(this.codec.createSerializer(),t),this.deserializer=new chunkGNEVCEJU_cjs.P(this.codec.createDeserializer(),t);}getPayloadCodec(){return this.codec}getShapeId(){return "aws.protocols#restXml"}async serializeRequest(e,t,r){let s=await super.serializeRequest(e,t,r),o=chunkGNEVCEJU_cjs.m.of(e.input);if(!s.headers["content-type"]){let n=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);n&&(s.headers["content-type"]=n);}return 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),s}async deserializeResponse(e,t,r){return super.deserializeResponse(e,t,r)}async handleError(e,t,r,s,o){let n=Lt(r,s)??"Unknown";if(this.mixin.compose(this.compositeErrorRegistry,n,this.options.defaultNamespace),s.Error&&typeof s.Error=="object")for(let y of Object.keys(s.Error))s[y]=s.Error[y],y.toLowerCase()==="message"&&(s.message=s.Error[y]);s.RequestId&&!o.requestId&&(o.requestId=s.RequestId);let{errorSchema:a,errorMetadata:m}=await this.mixin.getErrorSchemaOrThrowBaseException(n,this.options.defaultNamespace,r,s,o),c=chunkGNEVCEJU_cjs.m.of(a),f=s.Error?.message??s.Error?.Message??s.message??s.Message??"UnknownError",l=this.compositeErrorRegistry.getErrorCtor(a)??Error,h=new l({});await this.deserializeHttpMessage(a,t,r,s);let u={},p=this.codec.createDeserializer();for(let[y,S]of c.structIterator()){let C=S.getMergedTraits().xmlName??y,N=s.Error?.[C]??s[C];u[y]=p.readSchema(S,N);}throw this.mixin.decorateServiceException(Object.assign(h,m,{$fault:c.getMergedTraits().error,message:f},u),s)}getDefaultContentType(){return "application/xml"}hasUnstructuredPayloadBinding(e){for(let[,t]of e.structIterator())if(t.getMergedTraits().httpPayload)return !(t.isStructSchema()||t.isMapSchema()||t.isListSchema());return false}};exports.a=K;exports.b=Xt;exports.c=He;exports.d=Le;exports.e=Be;exports.f=B;exports.g=ie;exports.h=nt;exports.i=at;exports.j=ct;exports.k=It;