@cortex-agent/server 2026.10.27 → 2026.11.17

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 (258) hide show
  1. package/LICENSE +255 -21
  2. package/README.md +54 -7
  3. package/THIRD_PARTY_NOTICES.txt +1109 -278
  4. package/defaults/hooks/cortex-hook-api.mjs +2 -1
  5. package/defaults/plugins/cortex-system/skills/client-manage/SKILL.md +23 -15
  6. package/dist/agent-adapter/claude/remote-mcp-proxy.js +1 -1
  7. package/dist/chunks/{anthropic-messages-M3SMXACA.js → anthropic-messages-M732OMEE.js} +1 -1
  8. package/dist/chunks/{azure-openai-responses-76YWXHSB.js → azure-openai-responses-RAKTV6JY.js} +1 -1
  9. package/dist/chunks/bedrock-converse-stream-WNUGNZ27.js +62 -0
  10. package/dist/chunks/bowser-MLGGLXTZ.js +20 -0
  11. package/dist/chunks/child-runner-MO5RT6FH.js +4 -0
  12. package/dist/chunks/chunk-2ATTYCRJ.js +4 -0
  13. package/dist/chunks/{chunk-PXS5SHOV.js → chunk-2ROGTDM2.js} +1 -1
  14. package/dist/chunks/chunk-2VVRTJQN.js +4 -0
  15. package/dist/chunks/{chunk-OZGBWAT2.js → chunk-2YTYYG4K.js} +1 -1
  16. package/dist/chunks/chunk-3CPIMAYX.js +30 -0
  17. package/dist/chunks/{chunk-FXDIR3SQ.js → chunk-3CZPBLB3.js} +1 -1
  18. package/dist/chunks/chunk-3ORG56I5.js +8 -0
  19. package/dist/chunks/{chunk-LEUENXI2.js → chunk-4YLAGSDM.js} +1 -1
  20. package/dist/chunks/{chunk-HU6UIDEJ.js → chunk-53TQNK7Z.js} +1 -1
  21. package/dist/chunks/{chunk-4U7XXM4W.js → chunk-5A6CA5TM.js} +1 -1
  22. package/dist/chunks/{chunk-PBJ5MPPX.js → chunk-5DF5WJNM.js} +1 -1
  23. package/dist/chunks/chunk-5PAW3DEU.js +50 -0
  24. package/dist/chunks/{chunk-DXBSQXJL.js → chunk-7GAYFN52.js} +1 -1
  25. package/dist/chunks/chunk-7GEBDPTT.js +4 -0
  26. package/dist/chunks/{chunk-NR6U3WIZ.js → chunk-AFTBQRPN.js} +1 -1
  27. package/dist/chunks/chunk-AVXDF7AG.js +4 -0
  28. package/dist/chunks/chunk-BDLKI2NT.js +4 -0
  29. package/dist/chunks/{chunk-P52RMIYX.js → chunk-BJGYGEZO.js} +1 -1
  30. package/dist/chunks/chunk-BUZQBTV2.js +10 -0
  31. package/dist/chunks/chunk-BZDIAI5M.js +125 -0
  32. package/dist/chunks/{chunk-A34TDMIC.js → chunk-CEGSDGYQ.js} +1 -1
  33. package/dist/chunks/{chunk-Q7CE3UIE.js → chunk-CK3P345X.js} +69 -69
  34. package/dist/chunks/{chunk-YAEVYJAR.js → chunk-EE3WT25T.js} +1 -1
  35. package/dist/chunks/chunk-ETIBCA2S.js +4 -0
  36. package/dist/chunks/{chunk-REBNWCKI.js → chunk-FP7ML72L.js} +1 -1
  37. package/dist/chunks/{chunk-H2FP6DG4.js → chunk-H4QZ2P3Z.js} +1 -1
  38. package/dist/chunks/chunk-IA6IODY3.js +4 -0
  39. package/dist/chunks/{chunk-D3NXKK2L.js → chunk-IKLTEWA3.js} +1 -1
  40. package/dist/chunks/chunk-IYVZHGUQ.js +5 -0
  41. package/dist/chunks/chunk-JJDEQ6N2.js +4 -0
  42. package/dist/chunks/chunk-JKL3AK5D.js +106 -0
  43. package/dist/chunks/chunk-KDPY2YA3.js +129 -0
  44. package/dist/chunks/{chunk-SUFW24P4.js → chunk-KUDK7GPS.js} +1 -1
  45. package/dist/chunks/chunk-LAWOWPZX.js +363 -0
  46. package/dist/chunks/chunk-LEAV3FFG.js +4 -0
  47. package/dist/chunks/chunk-LP72AF56.js +45 -0
  48. package/dist/chunks/{chunk-KENCMLRE.js → chunk-LP7T32PW.js} +1 -1
  49. package/dist/chunks/chunk-LQTFDC67.js +4 -0
  50. package/dist/chunks/{chunk-HALUQ7ZF.js → chunk-MGYYSX7Y.js} +1 -1
  51. package/dist/chunks/chunk-NNBSSISP.js +4 -0
  52. package/dist/chunks/chunk-NNTQUHLO.js +877 -0
  53. package/dist/chunks/{chunk-PFMEUFJ7.js → chunk-NRD57ICT.js} +1 -1
  54. package/dist/chunks/{chunk-QWAQHHRS.js → chunk-NXZS5PEW.js} +1 -1
  55. package/dist/chunks/chunk-OFEPDNRB.js +4 -0
  56. package/dist/chunks/{chunk-6LZK4DDH.js → chunk-P7TVR4GY.js} +1 -1
  57. package/dist/chunks/chunk-QEL6CMLE.js +4 -0
  58. package/dist/chunks/chunk-QMSSIDRQ.js +70 -0
  59. package/dist/chunks/chunk-QUXPMNFQ.js +4 -0
  60. package/dist/chunks/chunk-R52AVUQB.js +5 -0
  61. package/dist/chunks/chunk-R6CGBSTC.js +22 -0
  62. package/dist/chunks/chunk-RA2BUYI3.js +6 -0
  63. package/dist/chunks/chunk-RDW6FRF5.js +4 -0
  64. package/dist/chunks/chunk-RF4JLYBX.js +6 -0
  65. package/dist/chunks/{chunk-YPK2CAIZ.js → chunk-ROVKOIHF.js} +1 -1
  66. package/dist/chunks/chunk-RYLSRII6.js +7 -0
  67. package/dist/chunks/{chunk-XNSSUVT6.js → chunk-S3MR37DL.js} +1 -1
  68. package/dist/chunks/chunk-SAJD4EKE.js +10 -0
  69. package/dist/chunks/chunk-SFX7V5O2.js +10 -0
  70. package/dist/chunks/chunk-STCNHXPJ.js +6 -0
  71. package/dist/chunks/{chunk-FOJQXLL2.js → chunk-SY2HV3V5.js} +1 -1
  72. package/dist/chunks/chunk-T73GHMFB.js +4 -0
  73. package/dist/chunks/chunk-TKFFQNAP.js +19 -0
  74. package/dist/chunks/chunk-TMV2ZDOI.js +18 -0
  75. package/dist/chunks/chunk-TX46YMGI.js +5 -0
  76. package/dist/chunks/chunk-U23S37TT.js +6 -0
  77. package/dist/chunks/chunk-UT6DGZDO.js +4 -0
  78. package/dist/chunks/{chunk-JERCOLY3.js → chunk-V35MFAUQ.js} +4 -6
  79. package/dist/chunks/chunk-V6X7Y62J.js +7 -0
  80. package/dist/chunks/chunk-V7K3KNDM.js +4 -0
  81. package/dist/chunks/{chunk-NAA7GF6Q.js → chunk-VBN2JSER.js} +1 -1
  82. package/dist/chunks/chunk-VIMHSW6J.js +4 -0
  83. package/dist/chunks/chunk-VK5J556O.js +4 -0
  84. package/dist/chunks/chunk-VPVSKJGX.js +6 -0
  85. package/dist/chunks/chunk-VTL3Z2OP.js +23 -0
  86. package/dist/chunks/{chunk-X2GYYRVM.js → chunk-VW7TLY3P.js} +1 -1
  87. package/dist/chunks/chunk-W34AK4SK.js +65 -0
  88. package/dist/chunks/chunk-W6AKCEYF.js +8 -0
  89. package/dist/chunks/chunk-WBSE3EF3.js +27 -0
  90. package/dist/chunks/chunk-WZYS2HAK.js +4 -0
  91. package/dist/chunks/{chunk-UNVEZI57.js → chunk-XEBEWR6Y.js} +1 -1
  92. package/dist/chunks/chunk-XPPZ6Y3X.js +8 -0
  93. package/dist/chunks/chunk-XYSXL3KX.js +4 -0
  94. package/dist/chunks/chunk-YAAKL3QS.js +80 -0
  95. package/dist/chunks/chunk-YB5LUJHS.js +65 -0
  96. package/dist/chunks/chunk-Z24SBRJK.js +4 -0
  97. package/dist/chunks/cloudflare-workers-ai-system-one-32JCFHI3.js +1 -1
  98. package/dist/chunks/context-GQKWKFRM.js +4 -0
  99. package/dist/chunks/cost-OOO32GLC.js +5 -0
  100. package/dist/chunks/dist-V5FRMUFH.js +4 -0
  101. package/dist/chunks/easter-egg-3d-CZH7AYZ7.js +4 -0
  102. package/dist/chunks/{event-streams-3JSFPOTZ.js → event-streams-AVE4MSS6.js} +1 -1
  103. package/dist/chunks/execution-repo-XXL4FXC6.js +4 -0
  104. package/dist/chunks/{executions-6ARGR3IO.js → executions-BN6OLLVM.js} +1 -1
  105. package/dist/chunks/file-H572PL2Z.js +4 -0
  106. package/dist/chunks/google-generative-ai-2G4ITOZL.js +4 -0
  107. package/dist/chunks/google-vertex-PACHCMRZ.js +4 -0
  108. package/dist/chunks/init-75F4V7SK.js +4 -0
  109. package/dist/chunks/{install-cli-4IZCSDFZ.js → install-cli-ABBD7DO5.js} +1 -1
  110. package/dist/chunks/{interaction-ask-G5T3H3CG.js → interaction-ask-EE2UPR3Q.js} +1 -1
  111. package/dist/chunks/{interaction-plan-E5V42MUP.js → interaction-plan-C446T2GZ.js} +1 -1
  112. package/dist/chunks/{llama-cpp-classify-OTXZWCMW.js → llama-cpp-classify-IA2F2H7A.js} +1 -1
  113. package/dist/chunks/local-client-stop-5YOLXGYT.js +4 -0
  114. package/dist/chunks/memory-cli-5SSF6YJM.js +11 -0
  115. package/dist/chunks/{mistral-conversations-34F66L3O.js → mistral-conversations-VHP63CDS.js} +1 -1
  116. package/dist/chunks/{model-resolver-N3DTAQ2S.js → model-resolver-FVJNZ6NA.js} +1 -1
  117. package/dist/chunks/{node-PTK2HCDV.js → node-DAO3SX7O.js} +1 -1
  118. package/dist/chunks/{openai-codex-2REL6UQU.js → openai-codex-JULCKICT.js} +1 -1
  119. package/dist/chunks/{openai-codex-responses-ZBVHREB3.js → openai-codex-responses-EHJ4AZBE.js} +1 -1
  120. package/dist/chunks/{openai-completions-VVIB26SH.js → openai-completions-CRAGQFCE.js} +1 -1
  121. package/dist/chunks/{openai-decisions-2N6ZRPZC.js → openai-decisions-P5UX7BWY.js} +1 -1
  122. package/dist/chunks/{openai-responses-735XA2ZX.js → openai-responses-IZ22NVQ7.js} +1 -1
  123. package/dist/chunks/{openrouter-images-3IKETHAC.js → openrouter-images-W2JAMSRH.js} +1 -1
  124. package/dist/chunks/{pi-messages-I3E4ZFHA.js → pi-messages-MJEEQU2R.js} +1 -1
  125. package/dist/chunks/{radius-HXRZVBDB.js → radius-ZM7ZRMXF.js} +1 -1
  126. package/dist/chunks/{remote-ops-BALZYKH6.js → remote-ops-O5CR4RGA.js} +1 -1
  127. package/dist/chunks/runner-S6R3US24.js +4 -0
  128. package/dist/chunks/schedule-cli-4T4YC5V5.js +4 -0
  129. package/dist/chunks/slack-2CGM4SMY.js +4 -0
  130. package/dist/chunks/start-ui-http-3D7QNHGB.js +43 -0
  131. package/dist/chunks/subagent-OZGUOV3J.js +4 -0
  132. package/dist/chunks/{time-KEHDQT6K.js → time-P6PE52WL.js} +1 -1
  133. package/dist/chunks/tool-shims-IA2WELXJ.js +4 -0
  134. package/dist/chunks/typesafe-system-one-6ULACYD4.js +1 -1
  135. package/dist/chunks/ui-board-H4INJD6C.js +5 -0
  136. package/dist/chunks/ui-decision-6HHNROIT.js +4 -0
  137. package/dist/chunks/{ui-file-GVH53O3X.js → ui-file-6PLXHSTB.js} +1 -1
  138. package/dist/chunks/ui-view-6MDU4GXY.js +4 -0
  139. package/dist/chunks/virtual-modules-OFI7QKYH.js +4 -0
  140. package/dist/chunks/waitpoint-W5M3BE55.js +5 -0
  141. package/dist/chunks/workers-GTFP75MS.js +4 -0
  142. package/dist/client-bundle/client.mjs +44 -31
  143. package/dist/client-bundle/manifest.json +2 -2
  144. package/dist/core/pi-sdk.js +1 -1
  145. package/dist/domain/auth/cc-auth-cli.js +1 -1
  146. package/dist/domain/mcp/bundled-server.js +1 -1
  147. package/dist/domain/mcp/feishu/client.js +4 -0
  148. package/dist/entry/app.js +201 -191
  149. package/dist/entry/browser-cli.js +10 -10
  150. package/dist/entry/cli.js +1 -1
  151. package/dist/entry/cortex-cli.js +1 -1
  152. package/dist/entry/daemon.js +4 -4
  153. package/dist/entry/hook-cli.js +2 -2
  154. package/dist/entry/production-app-bootstrap.js +1 -1
  155. package/dist/entry/production-evidence-export-cli.js +1 -1
  156. package/dist/entry/signal-cli.js +2 -2
  157. package/dist/tui/index.js +41 -41
  158. package/package.json +3 -3
  159. package/vendor/pi/dist/core/extensions/loader.js +1 -1
  160. package/vendor/pi/dist/extensions/codemode/execute.js +1 -1
  161. package/vendor/pi-ai/bedrock.js +1 -1
  162. package/vendor/pi-ai/oauth-load.js +1 -1
  163. package/web/dist/assets/{board-math-css-BmiXB1z5.js → board-math-css-BgIyUG-C.js} +1 -1
  164. package/web/dist/assets/index-9lyu2S6W.css +1 -0
  165. package/web/dist/assets/index-C-hpzey7.js +532 -0
  166. package/web/dist/assets/{index-XBRXpnC5.js → index-C2eMpcuI.js} +1 -1
  167. package/web/dist/assets/pdf-worker-DdZgk2mV.js +57 -0
  168. package/web/dist/assets/pdf.worker.min-Bz_KHX45.js +55 -0
  169. package/web/dist/index.html +2 -2
  170. package/web/dist/theme.css +22 -0
  171. package/dist/chunks/api-GM53PHIL-GFHEXXE6.js +0 -4
  172. package/dist/chunks/bedrock-converse-stream-5UPX4NTQ.js +0 -58
  173. package/dist/chunks/child-runner-3GHOWGZP.js +0 -4
  174. package/dist/chunks/chunk-2ZNLUY2U.js +0 -128
  175. package/dist/chunks/chunk-3F6WW7HR.js +0 -13
  176. package/dist/chunks/chunk-3OKHUVEM.js +0 -7
  177. package/dist/chunks/chunk-3THJYAEF.js +0 -4
  178. package/dist/chunks/chunk-3YHOCPQU.js +0 -10
  179. package/dist/chunks/chunk-4LLH5OWM.js +0 -10
  180. package/dist/chunks/chunk-52T37Y47.js +0 -8
  181. package/dist/chunks/chunk-7MU2AKNM.js +0 -4
  182. package/dist/chunks/chunk-AAA3UBIS.js +0 -4
  183. package/dist/chunks/chunk-ASYQHJVQ.js +0 -9
  184. package/dist/chunks/chunk-BGVHA2D4.js +0 -4
  185. package/dist/chunks/chunk-BKHDWCRT.js +0 -79
  186. package/dist/chunks/chunk-CQLH4UVX.js +0 -4
  187. package/dist/chunks/chunk-D6UA4BZC.js +0 -19
  188. package/dist/chunks/chunk-DGMNI4AO.js +0 -4
  189. package/dist/chunks/chunk-DHSA5ACV.js +0 -125
  190. package/dist/chunks/chunk-DPQPXBTP.js +0 -68
  191. package/dist/chunks/chunk-E7ZMYIY6.js +0 -30
  192. package/dist/chunks/chunk-EQITBTJC.js +0 -10
  193. package/dist/chunks/chunk-EXJA5RIX.js +0 -357
  194. package/dist/chunks/chunk-FH74NME3.js +0 -115
  195. package/dist/chunks/chunk-FOQ7VLIL.js +0 -17
  196. package/dist/chunks/chunk-J5DVLUKY.js +0 -6
  197. package/dist/chunks/chunk-JW2HFMTF.js +0 -4
  198. package/dist/chunks/chunk-KIGMAATV.js +0 -23
  199. package/dist/chunks/chunk-KIU5FAPY.js +0 -5
  200. package/dist/chunks/chunk-KIWMQPH7.js +0 -739
  201. package/dist/chunks/chunk-LMSQZ6TQ.js +0 -4
  202. package/dist/chunks/chunk-MEPASGPP.js +0 -6
  203. package/dist/chunks/chunk-MFAEUHMV.js +0 -28
  204. package/dist/chunks/chunk-NKDMKRSB.js +0 -68
  205. package/dist/chunks/chunk-NKXV32S6.js +0 -4
  206. package/dist/chunks/chunk-NVX5IPRN.js +0 -4
  207. package/dist/chunks/chunk-O3JW2F7D.js +0 -8
  208. package/dist/chunks/chunk-OISO5JXB.js +0 -4
  209. package/dist/chunks/chunk-OPYXNSMY.js +0 -4
  210. package/dist/chunks/chunk-PZMXHA6X.js +0 -9
  211. package/dist/chunks/chunk-QEOFEETJ.js +0 -4
  212. package/dist/chunks/chunk-REPYBMQS.js +0 -4
  213. package/dist/chunks/chunk-TAWLERZA.js +0 -4
  214. package/dist/chunks/chunk-TWAEABGG.js +0 -52
  215. package/dist/chunks/chunk-TZFLHVOQ.js +0 -7
  216. package/dist/chunks/chunk-UD3NMUHR.js +0 -12
  217. package/dist/chunks/chunk-W25TB3PU.js +0 -4
  218. package/dist/chunks/chunk-W5LGYSPZ.js +0 -4
  219. package/dist/chunks/chunk-XAJLZR7C.js +0 -28
  220. package/dist/chunks/chunk-XH6FMP3N.js +0 -71
  221. package/dist/chunks/chunk-XSRZHN63.js +0 -4
  222. package/dist/chunks/chunk-YG7OEPR2.js +0 -6
  223. package/dist/chunks/chunk-YHIWOGVL.js +0 -4
  224. package/dist/chunks/chunk-YZSHTWNM.js +0 -92
  225. package/dist/chunks/chunk-Z4H3VDHI.js +0 -4
  226. package/dist/chunks/client-XOGYH5UR.js +0 -4
  227. package/dist/chunks/config-DJSQI77S-335IXHSM.js +0 -4
  228. package/dist/chunks/context-VCQH5OB6.js +0 -4
  229. package/dist/chunks/cost-PGGFI7QJ.js +0 -5
  230. package/dist/chunks/dist-PUKMZ7GW.js +0 -4
  231. package/dist/chunks/easter-egg-3d-MO4MOEVF.js +0 -4
  232. package/dist/chunks/es5-VNTQPCKX.js +0 -4
  233. package/dist/chunks/execution-repo-ZLJTBWFC.js +0 -4
  234. package/dist/chunks/file-7BN7RCAY.js +0 -4
  235. package/dist/chunks/gateway-UCRPMR75.js +0 -36
  236. package/dist/chunks/google-generative-ai-2VXWLHWI.js +0 -4
  237. package/dist/chunks/google-vertex-UA36QP2U.js +0 -4
  238. package/dist/chunks/init-HA7FAQ73.js +0 -4
  239. package/dist/chunks/local-client-stop-SQRU7ZZM.js +0 -4
  240. package/dist/chunks/memory-cli-PYOILNN5.js +0 -11
  241. package/dist/chunks/models-L5VF4I5O-XXNJYQMQ.js +0 -4
  242. package/dist/chunks/runner-PLVZDGHB.js +0 -4
  243. package/dist/chunks/schedule-cli-OLASBBYJ.js +0 -4
  244. package/dist/chunks/slack-WAGSPZUX.js +0 -4
  245. package/dist/chunks/start-ui-http-QALT7C3P.js +0 -43
  246. package/dist/chunks/subagent-E3UC7ZHC.js +0 -4
  247. package/dist/chunks/tool-shims-Q6P6UXVC.js +0 -4
  248. package/dist/chunks/ui-board-4GYW6KKW.js +0 -5
  249. package/dist/chunks/ui-decision-U2FXSEC2.js +0 -4
  250. package/dist/chunks/ui-view-O7PLANT7.js +0 -4
  251. package/dist/chunks/virtual-modules-IDC5YKZJ.js +0 -4
  252. package/dist/chunks/waitpoint-2FGQBIAC.js +0 -5
  253. package/dist/chunks/workers-XN4PSTH6.js +0 -4
  254. package/vendor/aistatus/gateway-cli.js +0 -21
  255. package/web/dist/assets/index-DqWMdMkh.css +0 -1
  256. package/web/dist/assets/index-btKNdkvc.js +0 -525
  257. package/web/dist/assets/pdf-worker-Hp15W1QJ.js +0 -57
  258. package/web/dist/assets/pdf.worker.min-DnhTvCwe.js +0 -55
@@ -1,28 +0,0 @@
1
- import { createRequire as __cortexCreateRequire } from 'node:module';
2
- const require = __cortexCreateRequire(import.meta.url);
3
- const __cortexPackageRoot = new URL("../../", import.meta.url);
4
- import{e as tn,f as Vo}from"./chunk-KIGMAATV.js";import{a as Jo}from"./chunk-I6OPDRVF.js";import{b as Yt}from"./chunk-N6BTQN7R.js";import{e as en}from"./chunk-NAA7GF6Q.js";import{a as H,c as E}from"./chunk-WHC7AYZD.js";var Tt=E(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.ErrorCode=void 0;Pe.errorWithCode=at;Pe.requestErrorWithOriginal=Ko;Pe.httpErrorFromResponse=Go;Pe.platformErrorFromResult=Xo;Pe.rateLimitedErrorWithDelay=Yo;var Ve;(function(e){e.RequestError="slack_webapi_request_error",e.HTTPError="slack_webapi_http_error",e.PlatformError="slack_webapi_platform_error",e.RateLimitedError="slack_webapi_rate_limited_error",e.FileUploadInvalidArgumentsError="slack_webapi_file_upload_invalid_args_error",e.FileUploadReadFileDataError="slack_webapi_file_upload_read_file_data_error"})(Ve||(Pe.ErrorCode=Ve={}));function at(e,t){let r=e;return r.code=t,r}function Ko(e,t){let r=at(new Error(`A request error occurred: ${e.message}`),Ve.RequestError);return t&&(r.original=e),r}function Go(e){let t=at(new Error(`An HTTP protocol error occurred: statusCode = ${e.status}`),Ve.HTTPError);t.statusCode=e.status,t.statusMessage=e.statusText;let r={};for(let n of Object.keys(e.headers))n&&e.headers[n]&&(r[n]=e.headers[n]);return t.headers=r,t.body=e.data,t}function Xo(e){let t=at(new Error(`An API error occurred: ${e.error}`),Ve.PlatformError);return t.data=e,t}function Yo(e){let t=at(new Error(`A rate-limit has been reached, you may retry this request in ${e} seconds`),Ve.RateLimitedError);return t.retryAfter=e,t}});var rn=E((vf,Qo)=>{Qo.exports={name:"@slack/web-api",version:"7.18.0",description:"Official library for using the Slack Platform's Web API",author:"Slack Technologies, LLC",license:"MIT",keywords:["slack","web-api","bot","client","http","api","proxy","rate-limiting","pagination"],main:"dist/index.js",types:"./dist/index.d.ts",files:["dist/**/*"],engines:{node:">= 18",npm:">= 8.6.0"},repository:{type:"git",url:"git+https://github.com/slackapi/node-slack-sdk.git"},homepage:"https://docs.slack.dev/tools/node-slack-sdk/web-api/",publishConfig:{access:"public"},bugs:{url:"https://github.com/slackapi/node-slack-sdk/issues"},scripts:{build:"npm run build:clean && tsc","build:clean":"shx rm -rf ./dist",docs:"npx typedoc --plugin typedoc-plugin-markdown",prepack:"npm run build",test:"npm run build && bash -c 'node --test-reporter=spec --test-reporter-destination=stdout --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test src/*.test.ts'","test:coverage":"npm run build && node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test src/*.test.ts","test:integration":"npm run build && node test/integration/commonjs-project/index.js && node test/integration/esm-project/index.mjs && npm run test:integration:ts","test:integration:ts":"cd test/integration/ts-4.7-project && npm i && npm run build","test:types":"tsd",watch:"npx nodemon --watch 'src' --ext 'ts' --exec npm run build"},dependencies:{"@slack/logger":"^4.0.1","@slack/types":"^2.21.0","@types/node":">=18","@types/retry":"0.12.0",axios:"^1.16.0",eventemitter3:"^5.0.1","form-data":"^4.0.4","is-electron":"2.2.2","is-stream":"^2","p-queue":"^6","p-retry":"^4",retry:"^0.13.1"},devDependencies:{"@types/busboy":"^1.5.4","@types/sinon":"^21",busboy:"^1",nock:"^14",sinon:"^21",tsd:"^0.33.0"},tsd:{directory:"test/types"}}});var Qt=E(ve=>{"use strict";var Zo=ve&&ve.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),ea=ve&&ve.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),ta=ve&&ve.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[n.length]=s);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),s=0;s<n.length;s++)n[s]!=="default"&&Zo(r,t,n[s]);return ea(r,t),r}})();Object.defineProperty(ve,"__esModule",{value:!0});ve.addAppMetadata=oa;ve.getUserAgent=aa;var nn=ta(H("node:os")),ra=H("node:path"),sn=rn();function on(e){return e.replace("/",":")}var na=255;function sa(e){let t="";for(let r of e)t+=r.charCodeAt(0)<=na?r:encodeURIComponent(r);return t}var ia=`${on(sn.name)}/${sn.version} ${sa((0,ra.basename)(process.title))}/${process.version.replace("v","")} ${nn.platform()}/${nn.release()}`,an={};function oa({name:e,version:t}){an[on(e)]=t}function aa(){let e=Object.entries(an).map(([t,r])=>`${t}/${r}`).join(" ");return(e.length>0?`${e} `:"")+ia}});var Zt=E(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.ConsoleLogger=Je.LogLevel=void 0;var se;(function(e){e.ERROR="error",e.WARN="warn",e.INFO="info",e.DEBUG="debug"})(se||(Je.LogLevel=se={}));var lt=class e{constructor(){this.level=se.INFO,this.name=""}getLevel(){return this.level}setLevel(t){this.level=t}setName(t){this.name=t}debug(...t){e.isMoreOrEqualSevere(se.DEBUG,this.level)&&console.debug(e.labels.get(se.DEBUG),this.name,...t)}info(...t){e.isMoreOrEqualSevere(se.INFO,this.level)&&console.info(e.labels.get(se.INFO),this.name,...t)}warn(...t){e.isMoreOrEqualSevere(se.WARN,this.level)&&console.warn(e.labels.get(se.WARN),this.name,...t)}error(...t){e.isMoreOrEqualSevere(se.ERROR,this.level)&&console.error(e.labels.get(se.ERROR),this.name,...t)}static isMoreOrEqualSevere(t,r){return e.severity[t]>=e.severity[r]}};Je.ConsoleLogger=lt;lt.labels=(()=>{let t=Object.entries(se).map(([r,n])=>[n,`[${r}] `]);return new Map(t)})();lt.severity={[se.ERROR]:400,[se.WARN]:300,[se.INFO]:200,[se.DEBUG]:100}});var er=E(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.LogLevel=void 0;ut.getLogger=ca;var la=Zt(),ua=Zt();Object.defineProperty(ut,"LogLevel",{enumerable:!0,get:function(){return ua.LogLevel}});var ln=0;function ca(e,t,r){let n=ln;ln+=1;let s=r!==void 0?r:new la.ConsoleLogger;return s.setName(`web-api:${e}:${n}`),t!==void 0&&s.setLevel(t),s}});var tr=E(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.rapidRetryPolicy=pe.fiveRetriesInFiveMinutes=pe.tenRetriesInAboutThirtyMinutes=void 0;pe.tenRetriesInAboutThirtyMinutes={retries:10,factor:1.96821,randomize:!0};pe.fiveRetriesInFiveMinutes={retries:5,factor:3.86};pe.rapidRetryPolicy={minTimeout:0,maxTimeout:1};var fa={tenRetriesInAboutThirtyMinutes:pe.tenRetriesInAboutThirtyMinutes,fiveRetriesInFiveMinutes:pe.fiveRetriesInFiveMinutes,rapidRetryPolicy:pe.rapidRetryPolicy};pe.default=fa});var cn=E(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0})});var dn=E(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0})});var sr=E(Ke=>{"use strict";var rr=Ke&&Ke.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.ChatStreamer=void 0;var nr=class{constructor(t,r,n,s){var i;this.buffer="",this.client=t,this.logger=r,this.options={buffer_size:(i=s.buffer_size)!==null&&i!==void 0?i:256},this.state="starting",this.streamArgs=n}get ts(){return this.streamTs}async append(t){if(this.state==="completed")throw new Error(`failed to append stream: stream state is ${this.state}`);let{markdown_text:r,chunks:n}=t,s=rr(t,["markdown_text","chunks"]);if(s.token&&(this.token=s.token),r&&(this.buffer+=r),this.buffer.length>=this.options.buffer_size||n)return await this.flushBuffer(Object.assign({chunks:n},s));let i={bufferLength:this.buffer.length,bufferSize:this.options.buffer_size,channel:this.streamArgs.channel,recipientTeamId:this.streamArgs.recipient_team_id,recipientUserId:this.streamArgs.recipient_user_id,threadTs:this.streamArgs.thread_ts};return this.logger.debug(`ChatStreamer appended to buffer: ${JSON.stringify(i)}`),null}async stop(t){if(this.state==="completed")throw new Error(`failed to stop stream: stream state is ${this.state}`);let r=t??{},{markdown_text:n,chunks:s}=r,i=rr(r,["markdown_text","chunks"]);if(i.token&&(this.token=i.token),n&&(this.buffer+=n),!this.streamTs){let a=await this.client.chat.startStream(Object.assign(Object.assign({},this.streamArgs),{token:this.token}));if(!a.ts)throw new Error("failed to stop stream: stream not started");this.streamTs=a.ts,this.state="in_progress"}let o=[];this.buffer.length>0&&o.push({type:"markdown_text",text:this.buffer}),s&&o.push(...s);let l=await this.client.chat.stopStream(Object.assign({token:this.token,channel:this.streamArgs.channel,ts:this.streamTs,chunks:o},i));return this.state="completed",l}async flushBuffer(t){let r=t??{},{chunks:n}=r,s=rr(r,["chunks"]),i=[];if(this.buffer.length>0&&i.push({type:"markdown_text",text:this.buffer}),n&&i.push(...n),!this.streamTs){let l=await this.client.chat.startStream(Object.assign(Object.assign(Object.assign({},this.streamArgs),{token:this.token,chunks:i}),s));return this.buffer="",this.streamTs=l.ts,this.state="in_progress",l}let o=await this.client.chat.appendStream(Object.assign({token:this.token,channel:this.streamArgs.channel,ts:this.streamTs,chunks:i},s));return this.buffer="",o}};Ke.ChatStreamer=nr});var hn=E(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});function da(e){return function(t,r){return new Promise((n,s)=>{e.call(this,t,r,(i,o)=>{i?s(i):n(o)})})}}ir.default=da});var yn=E((ar,mn)=>{"use strict";var pn=ar&&ar.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ha=H("events"),pa=pn(Yt()),ma=pn(hn()),ct=pa.default("agent-base");function ya(e){return!!e&&typeof e.addRequest=="function"}function or(){let{stack:e}=new Error;return typeof e!="string"?!1:e.split(`
5
- `).some(t=>t.indexOf("(https.js:")!==-1||t.indexOf("node:https:")!==-1)}function Ct(e,t){return new Ct.Agent(e,t)}(function(e){class t extends ha.EventEmitter{constructor(n,s){super();let i=s;typeof n=="function"?this.callback=n:n&&(i=n),this.timeout=null,i&&typeof i.timeout=="number"&&(this.timeout=i.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:or()?443:80}set defaultPort(n){this.explicitDefaultPort=n}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:or()?"https:":"http:"}set protocol(n){this.explicitProtocol=n}callback(n,s,i){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(n,s){let i=Object.assign({},s);typeof i.secureEndpoint!="boolean"&&(i.secureEndpoint=or()),i.host==null&&(i.host="localhost"),i.port==null&&(i.port=i.secureEndpoint?443:80),i.protocol==null&&(i.protocol=i.secureEndpoint?"https:":"http:"),i.host&&i.path&&delete i.path,delete i.agent,delete i.hostname,delete i._defaultAgent,delete i.defaultPort,delete i.createConnection,n._last=!0,n.shouldKeepAlive=!1;let o=!1,l=null,a=i.timeout||this.timeout,f=p=>{n._hadError||(n.emit("error",p),n._hadError=!0)},h=()=>{l=null,o=!0;let p=new Error(`A "socket" was not created for HTTP request before ${a}ms`);p.code="ETIMEOUT",f(p)},d=p=>{o||(l!==null&&(clearTimeout(l),l=null),f(p))},g=p=>{if(o)return;if(l!=null&&(clearTimeout(l),l=null),ya(p)){ct("Callback returned another Agent instance %o",p.constructor.name),p.addRequest(n,i);return}if(p){p.once("free",()=>{this.freeSocket(p,i)}),n.onSocket(p);return}let _=new Error(`no Duplex stream was returned to agent-base for \`${n.method} ${n.path}\``);f(_)};if(typeof this.callback!="function"){f(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(ct("Converting legacy callback function to promise"),this.promisifiedCallback=ma.default(this.callback)):this.promisifiedCallback=this.callback),typeof a=="number"&&a>0&&(l=setTimeout(h,a)),"port"in i&&typeof i.port!="number"&&(i.port=Number(i.port));try{ct("Resolving socket for %o request: %o",i.protocol,`${n.method} ${n.path}`),Promise.resolve(this.promisifiedCallback(n,i)).then(g,d)}catch(p){Promise.reject(p).catch(d)}}freeSocket(n,s){ct("Freeing socket %o %o",n.constructor.name,s),n.destroy()}destroy(){ct("Destroying agent %o",this.constructor.name)}}e.Agent=t,e.prototype=e.Agent.prototype})(Ct||(Ct={}));mn.exports=Ct});var gn=E(dt=>{"use strict";var ga=dt&&dt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dt,"__esModule",{value:!0});var ba=ga(Yt()),ft=ba.default("https-proxy-agent:parse-proxy-response");function _a(e){return new Promise((t,r)=>{let n=0,s=[];function i(){let d=e.read();d?h(d):e.once("readable",i)}function o(){e.removeListener("end",a),e.removeListener("error",f),e.removeListener("close",l),e.removeListener("readable",i)}function l(d){ft("onclose had error %o",d)}function a(){ft("onend")}function f(d){o(),ft("onerror %o",d),r(d)}function h(d){s.push(d),n+=d.length;let g=Buffer.concat(s,n);if(g.indexOf(`\r
6
- \r
7
- `)===-1){ft("have not received end of HTTP headers yet..."),i();return}let _=g.toString("ascii",0,g.indexOf(`\r
8
- `)),O=+_.split(" ")[1];ft("got proxy server response: %o",_),t({statusCode:O,buffered:g})}e.on("error",f),e.on("close",l),e.on("end",a),i()})}dt.default=_a});var wn=E(De=>{"use strict";var wa=De&&De.__awaiter||function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(h){try{f(n.next(h))}catch(d){o(d)}}function a(h){try{f(n.throw(h))}catch(d){o(d)}}function f(h){h.done?i(h.value):s(h.value).then(l,a)}f((n=n.apply(e,t||[])).next())})},Ge=De&&De.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(De,"__esModule",{value:!0});var bn=Ge(H("net")),_n=Ge(H("tls")),va=Ge(H("url")),Ea=Ge(H("assert")),Oa=Ge(Yt()),Ra=yn(),Pa=Ge(gn()),ht=Oa.default("https-proxy-agent:agent"),lr=class extends Ra.Agent{constructor(t){let r;if(typeof t=="string"?r=va.default.parse(t):r=t,!r)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");ht("creating new HttpsProxyAgent instance: %o",r),super(r);let n=Object.assign({},r);this.secureProxy=r.secureProxy||Ta(n.protocol),n.host=n.hostname||n.host,typeof n.port=="string"&&(n.port=parseInt(n.port,10)),!n.port&&n.host&&(n.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in n)&&(n.ALPNProtocols=["http 1.1"]),n.host&&n.path&&(delete n.path,delete n.pathname),this.proxy=n}callback(t,r){return wa(this,void 0,void 0,function*(){let{proxy:n,secureProxy:s}=this,i;s?(ht("Creating `tls.Socket`: %o",n),i=_n.default.connect(n)):(ht("Creating `net.Socket`: %o",n),i=bn.default.connect(n));let o=Object.assign({},n.headers),a=`CONNECT ${`${r.host}:${r.port}`} HTTP/1.1\r
9
- `;n.auth&&(o["Proxy-Authorization"]=`Basic ${Buffer.from(n.auth).toString("base64")}`);let{host:f,port:h,secureEndpoint:d}=r;Aa(h,d)||(f+=`:${h}`),o.Host=f,o.Connection="close";for(let b of Object.keys(o))a+=`${b}: ${o[b]}\r
10
- `;let g=Pa.default(i);i.write(`${a}\r
11
- `);let{statusCode:p,buffered:_}=yield g;if(p===200){if(t.once("socket",Sa),r.secureEndpoint){ht("Upgrading socket connection to TLS");let b=r.servername||r.host;return _n.default.connect(Object.assign(Object.assign({},Ca(r,"host","hostname","path","port")),{socket:i,servername:b}))}return i}i.destroy();let O=new bn.default.Socket({writable:!1});return O.readable=!0,t.once("socket",b=>{ht("replaying proxy buffer for failed request"),Ea.default(b.listenerCount("data")>0),b.push(_),b.push(null)}),O})}};De.default=lr;function Sa(e){e.resume()}function Aa(e,t){return!!(!t&&e===80||t&&e===443)}function Ta(e){return typeof e=="string"?/^https:?$/i.test(e):!1}function Ca(e,...t){let r={},n;for(n in e)t.includes(n)||(r[n]=e[n]);return r}});var En=E((fr,vn)=>{"use strict";var xa=fr&&fr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ur=xa(wn());function cr(e){return new ur.default(e)}(function(e){e.HttpsProxyAgent=ur.default,e.prototype=ur.default.prototype})(cr||(cr={}));vn.exports=cr});var Ls=E((Lf,ks)=>{"use strict";var Xn=tn(),ka=H("crypto"),La=H("url"),Yn=En(),Qn=H("http"),Zn=H("https"),es=H("http2"),Tr=H("util"),On=H("path"),Ia=Vo(),me=H("zlib"),ce=H("stream"),Ua=H("events");function ts(e,t){return function(){return e.apply(t,arguments)}}var{toString:Da}=Object.prototype,{getPrototypeOf:Qe}=Object,{iterator:bt,toStringTag:rs}=Symbol,Dt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),mt=(e,t)=>{let r=e,n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),Dt(r,t))return!0;r=Qe(r)}return!1},qa=(e,t)=>e!=null&&mt(e,t)?e[t]:void 0,Cr=(e=>t=>{let r=Da.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ye=e=>(e=e.toLowerCase(),t=>Cr(t)===e),Bt=e=>t=>typeof t===e,{isArray:Ne}=Array,Ze=Bt("undefined");function tt(e){return e!==null&&!Ze(e)&&e.constructor!==null&&!Ze(e.constructor)&&fe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var ns=ye("ArrayBuffer");function Ma(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ns(e.buffer),t}var Na=Bt("string"),fe=Bt("function"),ss=Bt("number"),rt=e=>e!==null&&typeof e=="object",ja=e=>e===!0||e===!1,Lt=e=>{if(!rt(e))return!1;let t=Qe(e);return(t===null||t===Object.prototype||Qe(t)===null)&&!mt(e,rs)&&!mt(e,bt)},Fa=e=>{if(!rt(e)||tt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ba=ye("Date"),$a=ye("File"),za=e=>!!(e&&typeof e.uri<"u"),Ha=e=>e&&typeof e.getParts<"u",Wa=ye("Blob"),Va=ye("FileList"),Ja=e=>rt(e)&&fe(e.pipe);function Ka(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}var Rn=Ka(),Pn=typeof Rn.FormData<"u"?Rn.FormData:void 0,Ga=e=>{if(!e)return!1;if(Pn&&e instanceof Pn)return!0;let t=Qe(e);if(!t||t===Object.prototype||!fe(e.append))return!1;let r=Cr(e);return r==="formdata"||r==="object"&&fe(e.toString)&&e.toString()==="[object FormData]"},Xa=ye("URLSearchParams"),[Ya,Qa,Za,el]=["ReadableStream","Request","Response","Headers"].map(ye),tl=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function _t(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),Ne(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(tt(e))return;let i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length,l;for(n=0;n<o;n++)l=i[n],t.call(null,e[l],l,e)}}function is(e,t){if(tt(e))return null;t=t.toLowerCase();let r=Object.keys(e),n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}var qe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,os=e=>!Ze(e)&&e!==qe;function _r(...e){let{caseless:t,skipUndefined:r}=os(this)&&this||{},n={},s=(i,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;let l=t&&typeof o=="string"&&is(n,o)||o,a=Dt(n,l)?n[l]:void 0;Lt(a)&&Lt(i)?n[l]=_r(a,i):Lt(i)?n[l]=_r({},i):Ne(i)?n[l]=i.slice():(!r||!Ze(i))&&(n[l]=i)};for(let i=0,o=e.length;i<o;i++){let l=e[i];if(!l||tt(l)||(_t(l,s),typeof l!="object"||Ne(l)))continue;let a=Object.getOwnPropertySymbols(l);for(let f=0;f<a.length;f++){let h=a[f];hl.call(l,h)&&s(l[h],h)}}return n}var rl=(e,t,r,{allOwnKeys:n}={})=>(_t(t,(s,i)=>{r&&fe(s)?Object.defineProperty(e,i,{__proto__:null,value:ts(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),nl=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),sl=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},il=(e,t,r,n)=>{let s,i,o,l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!n||n(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=r!==!1&&Qe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},ol=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},al=e=>{if(!e)return null;if(Ne(e))return e;let t=e.length;if(!ss(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},ll=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Qe(Uint8Array)),ul=(e,t)=>{let n=(e&&e[bt]).call(e),s;for(;(s=n.next())&&!s.done;){let i=s.value;t.call(e,i[0],i[1])}},cl=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},fl=ye("HTMLFormElement"),dl=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),{propertyIsEnumerable:hl}=Object.prototype,pl=ye("RegExp"),as=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};_t(r,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(n[i]=o||s)}),Object.defineProperties(e,n)},ml=e=>{as(e,(t,r)=>{if(fe(e)&&["arguments","caller","callee"].includes(r))return!1;let n=e[r];if(fe(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},yl=(e,t)=>{let r={},n=s=>{s.forEach(i=>{r[i]=!0})};return Ne(e)?n(e):n(String(e).split(t)),r},gl=()=>{},bl=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function _l(e){return!!(e&&fe(e.append)&&e[rs]==="FormData"&&e[bt])}var wl=e=>{let t=new WeakSet,r=n=>{if(rt(n)){if(t.has(n))return;if(tt(n))return n;if(!("toJSON"in n)){t.add(n);let s=Ne(n)?[]:{};return _t(n,(i,o)=>{let l=r(i);!Ze(l)&&(s[o]=l)}),t.delete(n),s}}return n};return r(e)},vl=ye("AsyncFunction"),El=e=>e&&(rt(e)||fe(e))&&fe(e.then)&&fe(e.catch),ls=((e,t)=>e?setImmediate:t?((r,n)=>(qe.addEventListener("message",({source:s,data:i})=>{s===qe&&i===r&&n.length&&n.shift()()},!1),s=>{n.push(s),qe.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",fe(qe.postMessage)),Ol=typeof queueMicrotask<"u"?queueMicrotask.bind(qe):typeof process<"u"&&process.nextTick||ls,us=e=>e!=null&&fe(e[bt]),Rl=e=>e!=null&&mt(e,bt)&&us(e),u={isArray:Ne,isArrayBuffer:ns,isBuffer:tt,isFormData:Ga,isArrayBufferView:Ma,isString:Na,isNumber:ss,isBoolean:ja,isObject:rt,isPlainObject:Lt,isEmptyObject:Fa,isReadableStream:Ya,isRequest:Qa,isResponse:Za,isHeaders:el,isUndefined:Ze,isDate:Ba,isFile:$a,isReactNativeBlob:za,isReactNative:Ha,isBlob:Wa,isRegExp:pl,isFunction:fe,isStream:Ja,isURLSearchParams:Xa,isTypedArray:ll,isFileList:Va,forEach:_t,merge:_r,extend:rl,trim:tl,stripBOM:nl,inherits:sl,toFlatObject:il,kindOf:Cr,kindOfTest:ye,endsWith:ol,toArray:al,forEachEntry:ul,matchAll:cl,isHTMLForm:fl,hasOwnProperty:Dt,hasOwnProp:Dt,hasOwnInPrototypeChain:mt,getSafeProp:qa,reduceDescriptors:as,freezeMethods:ml,toObjectSet:yl,toCamelCase:dl,noop:gl,toFiniteNumber:bl,findKey:is,global:qe,isContextDefined:os,isSpecCompliantForm:_l,toJSONObject:wl,isAsyncFn:vl,isThenable:El,setImmediate:ls,asap:Ol,isIterable:us,isSafeIterable:Rl},Pl=u.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Sl=e=>{let t={},r,n,s;return e&&e.split(`
12
- `).forEach(function(o){s=o.indexOf(":"),r=o.substring(0,s).trim().toLowerCase(),n=o.substring(s+1).trim(),!(!r||t[r]&&Pl[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function Al(e){let t=0,r=e.length;for(;t<r;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){let n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}var Tl=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Cl=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function xr(e,t){return u.isArray(e)?e.map(r=>xr(r,t)):Al(String(e).replace(t,""))}var xl=e=>xr(e,Tl),kl=e=>xr(e,Cl);function kr(e){let t=Object.create(null);return u.forEach(e.toJSON(),(r,n)=>{t[n]=kl(r)}),t}var Sn=Symbol("internals");function pt(e){return e&&String(e).trim().toLowerCase()}function It(e){return e===!1||e==null?e:u.isArray(e)?e.map(It):xl(String(e))}function Ll(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}var Il=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function dr(e,t,r,n,s){if(u.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!u.isString(t)){if(u.isString(n))return t.indexOf(n)!==-1;if(u.isRegExp(n))return n.test(t)}}function Ul(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Dl(e,t){let r=u.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(s,i,o){return this[n].call(this,t,s,i,o)},configurable:!0})})}var K=class{constructor(t){t&&this.set(t)}set(t,r,n){let s=this;function i(l,a,f){let h=pt(a);if(!h)return;let d=u.findKey(s,h);(!d||s[d]===void 0||f===!0||f===void 0&&s[d]!==!1)&&(s[d||a]=It(l))}let o=(l,a)=>u.forEach(l,(f,h)=>i(f,h,a));if(u.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(u.isString(t)&&(t=t.trim())&&!Il(t))o(Sl(t),r);else if(u.isObject(t)&&u.isSafeIterable(t)){let l=Object.create(null),a,f;for(let h of t){if(!u.isArray(h))throw new TypeError("Object iterator must return a key-value pair");f=h[0],u.hasOwnProp(l,f)?(a=l[f],l[f]=u.isArray(a)?[...a,h[1]]:[a,h[1]]):l[f]=h[1]}o(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=pt(t),t){let n=u.findKey(this,t);if(n){let s=this[n];if(!r)return s;if(r===!0)return Ll(s);if(u.isFunction(r))return r.call(this,s,n);if(u.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=pt(t),t){let n=u.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||dr(this,this[n],n,r)))}return!1}delete(t,r){let n=this,s=!1;function i(o){if(o=pt(o),o){let l=u.findKey(n,o);l&&(!r||dr(n,n[l],l,r))&&(delete n[l],s=!0)}}return u.isArray(t)?t.forEach(i):i(t),s}clear(t){let r=Object.keys(this),n=r.length,s=!1;for(;n--;){let i=r[n];(!t||dr(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){let r=this,n={};return u.forEach(this,(s,i)=>{let o=u.findKey(n,i);if(o){r[o]=It(s),delete r[i];return}let l=t?Ul(i):String(i).trim();l!==i&&delete r[i],r[l]=It(s),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return u.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&u.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
13
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){let n=(this[Sn]=this[Sn]={accessors:{}}).accessors,s=this.prototype;function i(o){let l=pt(o);n[l]||(Dl(s,o),n[l]=!0)}return u.isArray(t)?t.forEach(i):i(t),this}};K.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);u.reduceDescriptors(K.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});u.freezeMethods(K);var ql="[REDACTED ****]";function Ml(e){if(u.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(u.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Nl(e,t){let r=new Set(t.map(i=>String(i).toLowerCase())),n=[],s=i=>{if(i===null||typeof i!="object"||u.isBuffer(i))return i;if(n.indexOf(i)!==-1)return;i instanceof K&&(i=i.toJSON()),n.push(i);let o;if(u.isArray(i))o=[],i.forEach((l,a)=>{let f=s(l);u.isUndefined(f)||(o[a]=f)});else{if(!u.isPlainObject(i)&&Ml(i))return n.pop(),i;o=Object.create(null);for(let[l,a]of Object.entries(i)){let f=r.has(l.toLowerCase())?ql:s(a);u.isUndefined(f)||(o[l]=f)}}return n.pop(),o};return s(e)}var m=class e extends Error{static from(t,r,n,s,i,o){let l=new e(t.message,r||t.code,n,s,i);return Object.defineProperty(l,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),l.name=t.name,t.status!=null&&l.status==null&&(l.status=t.status),o&&Object.assign(l,o),l}constructor(t,r,n,s,i){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),s&&(this.request=s),i&&(this.response=i,this.status=i.status)}toJSON(){let t=this.config,r=t&&u.hasOwnProp(t,"redact")?t.redact:void 0,n=u.isArray(r)&&r.length>0?Nl(t,r):u.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};m.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";m.ERR_BAD_OPTION="ERR_BAD_OPTION";m.ECONNABORTED="ECONNABORTED";m.ETIMEDOUT="ETIMEDOUT";m.ECONNREFUSED="ECONNREFUSED";m.ERR_NETWORK="ERR_NETWORK";m.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";m.ERR_DEPRECATED="ERR_DEPRECATED";m.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";m.ERR_BAD_REQUEST="ERR_BAD_REQUEST";m.ERR_CANCELED="ERR_CANCELED";m.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";m.ERR_INVALID_URL="ERR_INVALID_URL";m.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var cs=100;function wr(e){return u.isPlainObject(e)||u.isArray(e)}function fs(e){return u.endsWith(e,"[]")?e.slice(0,-2):e}function hr(e,t,r){return e?e.concat(t).map(function(s,i){return s=fs(s),!r&&i?"["+s+"]":s}).join(r?".":""):t}function jl(e){return u.isArray(e)&&!e.some(wr)}var Fl=u.toFlatObject(u,{},null,function(t){return/^is[A-Z]/.test(t)});function $t(e,t,r){if(!u.isObject(e))throw new TypeError("target must be an object");t=t||new(Xn||FormData),r=u.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,P){return!u.isUndefined(P[v])});let n=r.metaTokens,s=r.visitor||_,i=r.dots,o=r.indexes,l=r.Blob||typeof Blob<"u"&&Blob,a=r.maxDepth===void 0?cs:r.maxDepth,f=l&&u.isSpecCompliantForm(t),h=[];if(!u.isFunction(s))throw new TypeError("visitor must be a function");function d(y){if(y===null)return"";if(u.isDate(y))return y.toISOString();if(u.isBoolean(y))return y.toString();if(!f&&u.isBlob(y))throw new m("Blob is not supported. Use a Buffer instead.");if(u.isArrayBuffer(y)||u.isTypedArray(y)){if(f&&typeof l=="function")return new l([y]);if(typeof Buffer<"u")return Buffer.from(y);throw new m("Blob is not supported. Use a Buffer instead.",m.ERR_NOT_SUPPORT)}return y}function g(y){if(y>a)throw new m("Object is too deeply nested ("+y+" levels). Max depth: "+a,m.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(y,v){if(a===1/0)return JSON.stringify(y);let P=[];return JSON.stringify(y,function(q,U){if(!u.isObject(U))return U;for(;P.length&&P[P.length-1]!==this;)P.pop();return P.push(U),g(v+P.length-1),U})}function _(y,v,P){let S=y;if(u.isReactNative(t)&&u.isReactNativeBlob(y))return t.append(hr(P,v,i),d(y)),!1;if(y&&!P&&typeof y=="object"){if(u.endsWith(v,"{}"))v=n?v:v.slice(0,-2),y=p(y,1);else if(u.isArray(y)&&jl(y)||(u.isFileList(y)||u.endsWith(v,"[]"))&&(S=u.toArray(y)))return v=fs(v),S.forEach(function(U,be){!(u.isUndefined(U)||U===null)&&t.append(o===!0?hr([v],be,i):o===null?v:v+"[]",d(U))}),!1}return wr(y)?!0:(t.append(hr(P,v,i),d(y)),!1)}let O=Object.assign(Fl,{defaultVisitor:_,convertValue:d,isVisitable:wr});function b(y,v,P=0){if(!u.isUndefined(y)){if(g(P),h.indexOf(y)!==-1)throw new Error("Circular reference detected in "+v.join("."));h.push(y),u.forEach(y,function(q,U){(!(u.isUndefined(q)||q===null)&&s.call(t,q,u.isString(U)?U.trim():U,v,O))===!0&&b(q,v?v.concat(U):[U],P+1)}),h.pop()}}if(!u.isObject(e))throw new TypeError("data must be an object");return b(e),t}function An(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function ds(e,t){this._pairs=[],e&&$t(e,this,t)}var hs=ds.prototype;hs.append=function(t,r){this._pairs.push([t,r])};hs.toString=function(t){let r=t?n=>t.call(this,n,An):An;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function Bl(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Lr(e,t,r){if(!t)return e;e=e||"";let n=u.isFunction(r)?{serialize:r}:r,s=u.getSafeProp(n,"encode")||Bl,i=u.getSafeProp(n,"serialize"),o;if(i?o=i(t,n):o=u.isURLSearchParams(t)?t.toString():new ds(t,n).toString(s),o){let l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}var qt=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){u.forEach(this.handlers,function(n){n!==null&&t(n)})}},zt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},$l=La.URLSearchParams,pr="abcdefghijklmnopqrstuvwxyz",Tn="0123456789",ps={DIGIT:Tn,ALPHA:pr,ALPHA_DIGIT:pr+pr.toUpperCase()+Tn},zl=(e=16,t=ps.ALPHA_DIGIT)=>{let r="",{length:n}=t,s=new Uint32Array(e);ka.randomFillSync(s);for(let i=0;i<e;i++)r+=t[s[i]%n];return r},Hl={isNode:!0,classes:{URLSearchParams:$l,FormData:Xn,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:ps,generateString:zl,protocols:["http","https","file","data"]},Ir=typeof window<"u"&&typeof document<"u",vr=typeof navigator=="object"&&navigator||void 0,Wl=Ir&&(!vr||["ReactNative","NativeScript","NS"].indexOf(vr.product)<0),Vl=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Jl=Ir&&window.location.href||"http://localhost",Kl=Object.freeze({__proto__:null,hasBrowserEnv:Ir,hasStandardBrowserEnv:Wl,hasStandardBrowserWebWorkerEnv:Vl,navigator:vr,origin:Jl}),W={...Kl,...Hl};function Gl(e,t){return $t(e,new W.classes.URLSearchParams,{visitor:function(r,n,s,i){return W.isNode&&u.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}var Cn=cs;function ms(e){if(e>Cn)throw new m("FormData field is too deeply nested ("+e+" levels). Max depth: "+Cn,m.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Xl(e){let t=[],r=/\w+|\[(\w*)]/g,n;for(;(n=r.exec(e))!==null;)ms(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function Yl(e){let t={},r=Object.keys(e),n,s=r.length,i;for(n=0;n<s;n++)i=r[n],t[i]=e[i];return t}function ys(e){function t(r,n,s,i){ms(i);let o=r[i++];if(o==="__proto__")return!0;let l=Number.isFinite(+o),a=i>=r.length;return o=!o&&u.isArray(s)?s.length:o,a?(u.hasOwnProp(s,o)?s[o]=u.isArray(s[o])?s[o].concat(n):[s[o],n]:s[o]=n,!l):((!u.hasOwnProp(s,o)||!u.isObject(s[o]))&&(s[o]=[]),t(r,n,s[o],i)&&u.isArray(s[o])&&(s[o]=Yl(s[o])),!l)}if(u.isFormData(e)&&u.isFunction(e.entries)){let r={};return u.forEachEntry(e,(n,s)=>{t(Xl(n),s,r,0)}),r}return null}var Xe=(e,t)=>e!=null&&u.hasOwnProp(e,t)?e[t]:void 0;function Ql(e,t,r){if(u.isString(e))try{return(t||JSON.parse)(e),u.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var wt={transitional:zt,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",s=n.indexOf("application/json")>-1,i=u.isObject(t);if(i&&u.isHTMLForm(t)&&(t=new FormData(t)),u.isFormData(t))return s?JSON.stringify(ys(t)):t;if(u.isArrayBuffer(t)||u.isBuffer(t)||u.isStream(t)||u.isFile(t)||u.isBlob(t)||u.isReadableStream(t))return t;if(u.isArrayBufferView(t))return t.buffer;if(u.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){let a=Xe(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return Gl(t,a).toString();if((l=u.isFileList(t))||n.indexOf("multipart/form-data")>-1){let f=Xe(this,"env"),h=f&&f.FormData;return $t(l?{"files[]":t}:t,h&&new h,a)}}return i||s?(r.setContentType("application/json",!1),Ql(t)):t}],transformResponse:[function(t){let r=Xe(this,"transitional")||wt.transitional,n=r&&r.forcedJSONParsing,s=Xe(this,"responseType"),i=s==="json";if(u.isResponse(t)||u.isReadableStream(t))return t;if(t&&u.isString(t)&&(n&&!s||i)){let l=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,Xe(this,"parseReviver"))}catch(a){if(l)throw a.name==="SyntaxError"?m.from(a,m.ERR_BAD_RESPONSE,this,null,Xe(this,"response")):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:W.classes.FormData,Blob:W.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};u.forEach(["delete","get","head","post","put","patch","query"],e=>{wt.headers[e]={}});function mr(e,t){let r=this||wt,n=t||r,s=K.from(n.headers),i=n.data;return u.forEach(e,function(l){i=l.call(r,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function gs(e){return!!(e&&e.__CANCEL__)}var Ae=class extends m{constructor(t,r,n){super(t??"canceled",m.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ye(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new m("Request failed with status code "+r.status,r.status>=400&&r.status<500?m.ERR_BAD_REQUEST:m.ERR_BAD_RESPONSE,r.config,r.request,r))}function Zl(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function eu(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}var tu=/^https?:(?!\/\/)/i,ru=/[\t\n\r]/g;function nu(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function su(e){return nu(e).replace(ru,"")}function xn(e,t){if(typeof e=="string"&&tu.test(su(e)))throw new m('Invalid URL: missing "//" after protocol',m.ERR_INVALID_URL,t)}function Ur(e,t,r,n){xn(t,n);let s=!Zl(t);return e&&(s||r===!1)?(xn(e,n),eu(e,t)):t}var iu={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function ou(e){try{return new URL(e)}catch{return null}}function au(e){var t=(typeof e=="string"?ou(e):e)||{},r=t.protocol,n=t.host,s=t.port;if(typeof n!="string"||!n||typeof r!="string"||(r=r.split(":",1)[0],n=n.replace(/:\d*$/,""),s=parseInt(s)||iu[r]||0,!lu(n,s)))return"";var i=Er(r+"_proxy")||Er("all_proxy");return i&&i.indexOf("://")===-1&&(i=r+"://"+i),i}function lu(e,t){var r=Er("no_proxy").toLowerCase();return r?r==="*"?!1:r.split(/[,\s]/).every(function(n){if(!n)return!0;var s=n.match(/^(.+):(\d+)$/),i=s?s[1]:n,o=s?parseInt(s[2]):0;return o&&o!==t?!0:/^[.*]/.test(i)?(i.charAt(0)==="*"&&(i=i.slice(1)),!e.endsWith(i)):e!==i}):!0}function Er(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var yt="1.18.1";function bs(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}var uu=/^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;function cu(e,t,r){let n=r&&r.Blob||W.classes.Blob,s=bs(e);if(t===void 0&&n&&(t=!0),s==="data"){e=s.length?e.slice(s.length+1):e;let i=uu.exec(e);if(!i)throw new m("Invalid URL",m.ERR_INVALID_URL);let o=i[1],l=i[2],a=i[3]?"base64":"utf8",f=i[4],h="";o?h=l?o+l:o:l&&(h="text/plain"+l);let d=a==="base64"?Buffer.from(f,"base64"):Buffer.from(decodeURIComponent(f),a);if(t){if(!n)throw new m("Blob is not supported",m.ERR_NOT_SUPPORT);return new n([d],{type:h})}return d}throw new m("Unsupported protocol "+s,m.ERR_NOT_SUPPORT)}var yr=Symbol("internals"),Mt=class extends ce.Transform{constructor(t){t=u.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,s)=>!u.isUndefined(s[n])),super({readableHighWaterMark:t.chunkSize});let r=this[yr]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",n=>{n==="progress"&&(r.isCaptured||(r.isCaptured=!0))})}_read(t){let r=this[yr];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,n){let s=this[yr],i=s.maxRate,o=this.readableHighWaterMark,l=s.timeWindow,a=1e3/l,f=i/a,h=s.minChunkSize!==!1?Math.max(s.minChunkSize,f*.01):0,d=(p,_)=>{let O=Buffer.byteLength(p);s.bytesSeen+=O,s.bytes+=O,s.isCaptured&&this.emit("progress",s.bytesSeen),this.push(p)?process.nextTick(_):s.onReadCallback=()=>{s.onReadCallback=null,process.nextTick(_)}},g=(p,_)=>{let O=Buffer.byteLength(p),b=null,y=o,v,P=0;if(i){let S=Date.now();(!s.ts||(P=S-s.ts)>=l)&&(s.ts=S,v=f-s.bytes,s.bytes=v<0?-v:0,P=0),v=f-s.bytes}if(i){if(v<=0)return setTimeout(()=>{_(null,p)},l-P);v<y&&(y=v)}y&&O>y&&O-y>h&&(b=p.subarray(y),p=p.subarray(0,y)),d(p,b?()=>{process.nextTick(_,null,b)}:_)};g(t,function p(_,O){if(_)return n(_);O?g(O,p):n(null)})}},{asyncIterator:kn}=Symbol,_s=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[kn]?yield*e[kn]():yield e},fu=W.ALPHABET.ALPHA_DIGIT+"-_",gt=typeof TextEncoder=="function"?new TextEncoder:new Tr.TextEncoder,Me=`\r
14
- `,du=gt.encode(Me),hu=2,Or=class{constructor(t,r){let{escapeName:n}=this.constructor,s=u.isString(r),i=`Content-Disposition: form-data; name="${n(t)}"${!s&&r.name?`; filename="${n(r.name)}"`:""}${Me}`;if(s)r=gt.encode(String(r).replace(/\r?\n|\r\n?/g,Me));else{let o=String(r.type||"application/octet-stream").replace(/[\r\n]/g,"");i+=`Content-Type: ${o}${Me}`}this.headers=gt.encode(i+Me),this.contentLength=s?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+hu,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;u.isTypedArray(t)?yield t:yield*_s(t),yield du}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},pu=(e,t,r)=>{let{tag:n="form-data-boundary",size:s=25,boundary:i=n+"-"+W.generateString(s,fu)}=r||{};if(!u.isFormData(e))throw new TypeError("FormData instance required");if(i.length<1||i.length>70)throw new Error("boundary must be 1-70 characters long");let o=gt.encode("--"+i+Me),l=gt.encode("--"+i+"--"+Me),a=l.byteLength,f=Array.from(e.entries()).map(([d,g])=>{let p=new Or(d,g);return a+=p.size,p});a+=o.byteLength*f.length,a=u.toFiniteNumber(a);let h={"Content-Type":`multipart/form-data; boundary=${i}`};return Number.isFinite(a)&&(h["Content-Length"]=a),t&&t(h),ce.Readable.from((async function*(){for(let d of f)yield o,yield*d.encode();yield l})())},Rr=class extends ce.Transform{__transform(t,r,n){this.push(t),n()}_transform(t,r,n){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let s=Buffer.alloc(2);s[0]=120,s[1]=156,this.push(s,r)}this.__transform(t,r,n)}},Pr=class{constructor(){this.sessions=Object.create(null)}getSession(t,r){r=Object.assign({sessionTimeout:1e3},r);let n=this.sessions[t];if(n){let d=n.length;for(let g=0;g<d;g++){let[p,_]=n[g];if(!p.destroyed&&!p.closed&&Tr.isDeepStrictEqual(_,r))return p}}let s=es.connect(t,r),i,o,l=()=>{if(i)return;i=!0,o&&(clearTimeout(o),o=null);let d=n,g=d.length,p=g;for(;p--;)if(d[p][0]===s){g===1?delete this.sessions[t]:d.splice(p,1),s.closed||s.close();return}},a=s.request,{sessionTimeout:f}=r;if(f!=null){let d=0;s.request=function(){let g=a.apply(this,arguments);return d++,o&&(clearTimeout(o),o=null),g.once("close",()=>{--d||(o=setTimeout(()=>{o=null,l()},f))}),g}}s.once("close",l);let h=[s,r];return n?n.push(h):n=this.sessions[t]=[h],s}},mu=(e,t)=>u.isAsyncFn(e)?function(...r){let n=r.pop();e.apply(this,r).then(s=>{try{t?n(null,...t(s)):n(null,s)}catch(i){n(i)}},n)}:e,yu=new Set(["localhost","0.0.0.0"]),ws=e=>{let t=e.split(".");return t.length!==4||t[0]!=="127"?!1:t.every(r=>/^\d+$/.test(r)&&Number(r)>=0&&Number(r)<=255)},gr=e=>/^0{1,4}$/.test(e),gu=e=>{if(e==="::")return!0;let t=e.indexOf("::");if(t!==-1){if(t!==e.lastIndexOf("::"))return!1;let n=e.slice(0,t),s=e.slice(t+2),i=n?n.split(":"):[],o=s?s.split(":"):[];return i.length+o.length<8&&i.every(gr)&&o.every(gr)}let r=e.split(":");return r.length===8&&r.every(gr)},bu=e=>{if(e==="::1")return!0;let t=e.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return ws(t[1]);let r=e.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(r){let s=parseInt(r[1],16);return s>=32512&&s<=32767}let n=e.split(":");if(n.length===8){for(let s=0;s<7;s++)if(!/^0+$/.test(n[s]))return!1;return/^0*1$/.test(n[7])}return!1},Ln=e=>e?yu.has(e)||ws(e)||gu(e)?!0:bu(e):!1,_u={http:80,https:443,ws:80,wss:443,ftp:21},wu=e=>{let t=e,r=0;if(t.charAt(0)==="["){let i=t.indexOf("]");if(i!==-1){let o=t.slice(1,i),l=t.slice(i+1);return l.charAt(0)===":"&&/^\d+$/.test(l.slice(1))&&(r=Number.parseInt(l.slice(1),10)),[o,r]}}let n=t.indexOf(":"),s=t.lastIndexOf(":");return n!==-1&&n===s&&/^\d+$/.test(t.slice(s+1))&&(r=Number.parseInt(t.slice(s+1),10),t=t.slice(0,s)),[t,r]},vu=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i,Eu=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i,Ou=e=>{if(typeof e!="string"||e.indexOf(":")===-1)return e;let t=e.match(vu);if(t)return t[1];let r=e.match(Eu);if(r){let n=parseInt(r[1],16),s=parseInt(r[2],16);return`${n>>8}.${n&255}.${s>>8}.${s&255}`}return e},In=e=>e&&(e.charAt(0)==="["&&e.charAt(e.length-1)==="]"&&(e=e.slice(1,-1)),Ou(e.replace(/\.+$/,"")));function Ru(e){let t;try{t=new URL(e)}catch{return!1}let r=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!r)return!1;if(r==="*")return!0;let n=Number.parseInt(t.port,10)||_u[t.protocol.split(":",1)[0]]||0,s=In(t.hostname.toLowerCase());return r.split(/[\s,]+/).some(i=>{if(!i)return!1;let[o,l]=wu(i);return o=In(o),!o||l&&l!==n?!1:(o.charAt(0)==="*"&&(o=o.slice(1)),o.charAt(0)==="."?s.endsWith(o):s===o||Ln(s)&&Ln(o))})}function Pu(e,t){e=e||10;let r=new Array(e),n=new Array(e),s=0,i=0,o;return t=t!==void 0?t:1e3,function(a){let f=Date.now(),h=n[i];o||(o=f),r[s]=a,n[s]=f;let d=i,g=0;for(;d!==s;)g+=r[d++],d=d%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),f-o<t)return;let p=h&&f-h;return p?Math.round(g*1e3/p):void 0}}function Su(e,t){let r=0,n=1e3/t,s,i,o=(f,h=Date.now())=>{r=h,s=null,i&&(clearTimeout(i),i=null),e(...f)};return[(...f)=>{let h=Date.now(),d=h-r;d>=n?o(f,h):(s=f,i||(i=setTimeout(()=>{i=null,o(s)},n-d)))},()=>s&&o(s)]}var et=(e,t,r=3)=>{let n=0,s=Pu(50,250);return Su(i=>{if(!i||typeof i.loaded!="number")return;let o=i.loaded,l=i.lengthComputable?i.total:void 0,a=l!=null?Math.min(o,l):o,f=Math.max(0,a-n),h=s(f);n=Math.max(n,a);let d={loaded:a,total:l,progress:l?a/l:void 0,bytes:f,rate:h||void 0,estimated:h&&l?(l-a)/h:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(d)},r)},Nt=(e,t)=>{let r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},jt=e=>(...t)=>u.asap(()=>e(...t)),Ft=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Au=(e,t,r)=>t+2<r&&Ft(e.charCodeAt(t+1))&&Ft(e.charCodeAt(t+2));function vs(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let o=n.length,l=n.length;for(let p=0;p<l;p++)if(n.charCodeAt(p)===37&&p+2<l){let _=n.charCodeAt(p+1),O=n.charCodeAt(p+2);Ft(_)&&Ft(O)&&(o-=2,p+=2)}let a=0,f=l-1,h=p=>p>=2&&n.charCodeAt(p-2)===37&&n.charCodeAt(p-1)===51&&(n.charCodeAt(p)===68||n.charCodeAt(p)===100);f>=0&&(n.charCodeAt(f)===61?(a++,f--):h(f)&&(a++,f-=3)),a===1&&f>=0&&(n.charCodeAt(f)===61||h(f))&&a++;let g=Math.floor(o/4)*3-(a||0);return g>0?g:0}let i=0;for(let o=0,l=n.length;o<l;o++){let a=n.charCodeAt(o);if(a===37&&Au(n,o,l))i+=1,o+=2;else if(a<128)i+=1;else if(a<2048)i+=2;else if(a>=55296&&a<=56319&&o+1<l){let f=n.charCodeAt(o+1);f>=56320&&f<=57343?(i+=4,o++):i+=3}else i+=3}return i}var Un={flush:me.constants.Z_SYNC_FLUSH,finishFlush:me.constants.Z_SYNC_FLUSH},Tu={flush:me.constants.BROTLI_OPERATION_FLUSH,finishFlush:me.constants.BROTLI_OPERATION_FLUSH},Cu={flush:me.constants.ZSTD_e_flush,finishFlush:me.constants.ZSTD_e_flush},Es=u.isFunction(me.createBrotliDecompress),Os=u.isFunction(me.createZstdDecompress),Rs="gzip, compress, deflate"+(Es?", br":""),xu=Rs+(Os?", zstd":""),{http:ku,https:Lu}=Ia,Dr=/https:?/,Iu=["content-type","content-length"];function Uu(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,s])=>{Iu.includes(n.toLowerCase())&&e.set(n,s)})}var Dn=Symbol("axios.http.socketListener"),xt=Symbol("axios.http.currentReq"),Ps=Symbol("axios.http.installedTunnel"),Du=new Map,qn=new WeakMap,Mn={22:21,24:5};function qu(e=process.versions&&process.versions.node){if(!e)return!1;let[t,r]=e.split(".").map(n=>Number(n));return!Number.isInteger(t)||!Number.isInteger(r)?!1:t>24?!0:Mn[t]!=null&&r>=Mn[t]}function Mu(e,t=process.versions&&process.versions.node){if(!qu(t))return!1;let r=e&&e.options;return!!(r&&u.hasOwnProp(r,"proxyEnv")&&r.proxyEnv!=null)}function Nu(e,t,r){return Dr.test(e.protocol)?r||Zn.globalAgent:t||Qn.globalAgent}function ju(e,t){let r=e.protocol+"//"+e.hostname+":"+(e.port||"")+"#"+(e.auth||""),n=t?qn.get(t)||qn.set(t,new Map).get(t):Du,s=n.get(r);if(s)return s;let i=t&&t.options?{...t.options,...e}:e;if(s=new Yn(i),t&&t.options){let o={...t.options},l=s.callback;s.callback=function(f,h){return l.call(this,f,{...o,...h})}}return s[Ps]=!0,n.set(r,s),s}var Nn=W.protocols.map(e=>e+":"),jn=e=>{if(!u.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Fn=(e,[t,r])=>(e.on("end",r).on("error",r),t),Fu=new Pr;function Bu(e,t,r){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.auth&&e.beforeRedirects.auth(e),e.beforeRedirects.sensitiveHeaders&&e.beforeRedirects.sensitiveHeaders(e,r),e.beforeRedirects.config&&e.beforeRedirects.config(e,t,r)}function $u(e,t){e&&Object.keys(e).forEach(r=>{t.has(r.toLowerCase())&&delete e[r]})}function zu(e,t){if(!t)return!1;try{return new URL(t.url).origin===new URL(e.href).origin}catch{return!1}}function Ss(e,t,r,n,s,i){let o=t,l=Nu(e,i,s);if(!o&&o!==!1&&!Mu(l)){let a=au(r);a&&(Ru(r)||(o=new URL(a)))}if(n&&e.headers)for(let a of Object.keys(e.headers))a.toLowerCase()==="proxy-authorization"&&delete e.headers[a];if(n&&e.agent&&e.agent[Ps]&&(e.agent=void 0),o){let a=o instanceof URL,f=_=>a||u.hasOwnProp(o,_)?o[_]:void 0,h=f("username"),d=f("password"),g=u.hasOwnProp(o,"auth")?o.auth:void 0;if(h&&(g=(h||"")+":"+(d||"")),g){let _=typeof g=="object",O=_&&u.hasOwnProp(g,"username")?g.username:void 0,b=_&&u.hasOwnProp(g,"password")?g.password:void 0;if(!!(O||b))g=(O||"")+":"+(b||"");else if(_)throw new m("Invalid proxy authorization",m.ERR_BAD_OPTION,{proxy:o})}if(Dr.test(e.protocol)){if(!(s instanceof Yn)){let _=f("hostname")||f("host"),O=f("port"),b=f("protocol"),y=b?b.includes(":")?b:`${b}:`:"http:",v=_&&_.includes(":")&&!_.startsWith("[")?`[${_}]`:_,P=new URL(`${y}//${v}${O?":"+O:""}`),S={protocol:P.protocol,hostname:P.hostname.replace(/^\[|\]$/g,""),port:P.port,auth:g&&typeof g=="string"?g:void 0};P.protocol==="https:"&&(S.ALPNProtocols=["http/1.1"]);let q=ju(S,s);e.agent=q,e.agents&&(e.agents.https=q)}}else{if(g){let y=Buffer.from(g,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+y}let _=!1;for(let y of Object.keys(e.headers))if(y.toLowerCase()==="host"){_=!0;break}_||(e.headers.host=e.hostname+(e.port?":"+e.port:""));let O=f("hostname")||f("host");e.hostname=O,e.host=O,e.port=f("port"),e.path=r;let b=f("protocol");b&&(e.protocol=b.includes(":")?b:`${b}:`)}}e.beforeRedirects.proxy=function(f){Ss(f,t,f.href,!0,s,i)}}var Hu=typeof process<"u"&&u.kindOf(process)==="process",Wu=e=>new Promise((t,r)=>{let n,s,i=(a,f)=>{s||(s=!0,n&&n(a,f))},o=a=>{i(a),t(a)},l=a=>{i(a,!0),r(a)};e(o,l,a=>n=a).catch(l)}),Vu=({address:e,family:t})=>{if(!u.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},Bn=(e,t)=>Vu(u.isObject(e)?e:{address:e,family:t}),Ju={request(e,t){let r=e.protocol+"//"+e.hostname+":"+(e.port||(e.protocol==="https:"?443:80)),{http2Options:n,headers:s}=e,i=Fu.getSession(r,n),{HTTP2_HEADER_SCHEME:o,HTTP2_HEADER_METHOD:l,HTTP2_HEADER_PATH:a,HTTP2_HEADER_STATUS:f}=es.constants,h={[o]:e.protocol.replace(":",""),[l]:e.method,[a]:e.path};u.forEach(s,(g,p)=>{p.charAt(0)!==":"&&(h[p]=g)});let d=i.request(h);return d.once("response",g=>{let p=d;g=Object.assign({},g);let _=g[f];delete g[f],p.headers=g,p.statusCode=+_,t(p)}),d}},Ku=Hu&&function(t){return Wu(async function(n,s,i){let o=R=>u.getSafeProp(t,R),l=o("transitional")||zt,a=o("data"),f=o("lookup"),h=o("family"),d=o("httpVersion");d===void 0&&(d=1);let g=o("http2Options"),p=o("httpAgent"),_=o("httpsAgent"),O=o("proxy"),b=o("responseType"),y=o("responseEncoding"),v=o("socketPath"),P=o("method").toUpperCase(),S=o("maxRedirects"),q=o("maxBodyLength"),U=o("maxContentLength"),be=o("decompress"),Be,Ce=!1,k,de;if(d=+d,Number.isNaN(d))throw TypeError(`Invalid protocol version: '${t.httpVersion}' is not a number`);if(d!==1&&d!==2)throw TypeError(`Unsupported protocol version '${d}'`);let $e=d===2;if(f){let R=mu(f,w=>u.isArray(w)?w:[w]);f=(w,x,z)=>{R(w,x,(T,Q,ne)=>{if(T)return z(T);let J=u.isArray(Q)?Q.map(We=>Bn(We)):[Bn(Q,ne)];x.all?z(T,J):z(T,J[0].address,J[0].family)})}}let xe=new Ua.EventEmitter;function G(R){try{xe.emit("abort",!R||R.type?new Ae(null,t,k):R)}catch{}}function Oe(){de&&(clearTimeout(de),de=null)}function Le(){let R=o("timeout"),w=R?"timeout of "+R+"ms exceeded":"timeout exceeded",x=o("timeoutErrorMessage");return x&&(w=x),new m(w,l.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,t,k)}xe.once("abort",s);let Ie=()=>{Oe(),t.cancelToken&&t.cancelToken.unsubscribe(G),t.signal&&t.signal.removeEventListener("abort",G),xe.removeAllListeners()};(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(G),t.signal&&(t.signal.aborted?G():t.signal.addEventListener("abort",G))),i((R,w)=>{if(Be=!0,Oe(),w){Ce=!0,Ie();return}let{data:x}=R;if(x instanceof ce.Readable||x instanceof ce.Duplex){let z=ce.finished(x,()=>{z(),Ie()})}else Ie()});let St=Ur(o("baseURL"),o("url"),o("allowAbsoluteUrls"),t),At=v?"http://localhost":W.hasBrowserEnv?W.origin:void 0,F=new URL(St,At),$=F.protocol||Nn[0];if($==="data:"){if(U>-1){let w=String(o("url")||St||"");if(vs(w)>U)return s(new m("maxContentLength size of "+U+" exceeded",m.ERR_BAD_RESPONSE,t))}let R;if(P!=="GET")return Ye(n,s,{status:405,statusText:"method not allowed",headers:{},config:t});try{R=cu(o("url"),b==="blob",{Blob:t.env&&t.env.Blob})}catch(w){throw m.from(w,m.ERR_BAD_REQUEST,t)}return b==="text"?(R=R.toString(y),(!y||y==="utf8")&&(R=u.stripBOM(R))):b==="stream"&&(R=ce.Readable.from(R)),Ye(n,s,{data:R,status:200,statusText:"OK",headers:new K,config:t})}if(Nn.indexOf($)===-1)return s(new m("Unsupported protocol "+$,m.ERR_BAD_REQUEST,t));let V=K.from(t.headers).normalize();V.set("User-Agent","axios/"+yt,!1);let{onUploadProgress:_e,onDownloadProgress:Re}=t,Ue=t.maxRate,L,ee;if(u.isSpecCompliantForm(a)){let R=V.getContentType(/boundary=([-_\w\d]{10,70})/i);a=pu(a,w=>{V.set(w)},{tag:`axios-${yt}-boundary`,boundary:R&&R[1]||void 0})}else if(u.isFormData(a)&&u.isFunction(a.getHeaders)&&a.getHeaders!==Object.prototype.getHeaders){if(Uu(V,a.getHeaders(),o("formDataHeaderPolicy")),!V.hasContentLength())try{let R=await Tr.promisify(a.getLength).call(a);Number.isFinite(R)&&R>=0&&V.setContentLength(R)}catch{}}else if(u.isBlob(a)||u.isFile(a))a.size&&V.setContentType(a.type||"application/octet-stream"),V.setContentLength(a.size||0),a=ce.Readable.from(_s(a));else if(a&&!u.isStream(a)){if(!Buffer.isBuffer(a))if(u.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else if(u.isString(a))a=Buffer.from(a,"utf-8");else return s(new m("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",m.ERR_BAD_REQUEST,t));if(V.setContentLength(a.length,!1),q>-1&&a.length>q)return s(new m("Request body larger than maxBodyLength limit",m.ERR_BAD_REQUEST,t))}let ze=u.toFiniteNumber(V.getContentLength());u.isArray(Ue)?(L=Ue[0],ee=Ue[1]):L=ee=Ue,a&&(_e||L)&&(u.isStream(a)||(a=ce.Readable.from(a,{objectMode:!1})),a=ce.pipeline([a,new Mt({maxRate:u.toFiniteNumber(L)})],u.noop),_e&&a.on("progress",Fn(a,Nt(ze,et(jt(_e),!1,3)))));let we,st=o("auth");if(st){let R=u.getSafeProp(st,"username")||"",w=u.getSafeProp(st,"password")||"";we=R+":"+w}if(!we&&(F.username||F.password)){let R=jn(F.username),w=jn(F.password);we=R+":"+w}we&&V.delete("authorization");let it;try{it=Lr(F.pathname+F.search,o("params"),o("paramsSerializer")).replace(/^\?/,"")}catch(R){return s(m.from(R,m.ERR_BAD_REQUEST,t,null,null,{url:o("url"),exists:!0}))}V.set("Accept-Encoding",u.hasOwnProp(l,"advertiseZstdAcceptEncoding")&&l.advertiseZstdAcceptEncoding===!0?xu:Rs,!1);let D=Object.assign(Object.create(null),{path:it,method:P,headers:kr(V),agents:{http:p,https:_},auth:we,protocol:$,family:h,beforeRedirect:Bu,beforeRedirects:Object.create(null),http2Options:g});if(!u.isUndefined(f)&&(D.lookup=f),v){if(typeof v!="string")return s(new m("socketPath must be a string",m.ERR_BAD_OPTION_VALUE,t));let R=o("allowedSocketPaths");if(R!=null){let w=Array.isArray(R)?R:[R],x=On.resolve(v);if(!w.some(T=>typeof T=="string"&&On.resolve(T)===x))return s(new m(`socketPath "${v}" is not permitted by allowedSocketPaths`,m.ERR_BAD_OPTION_VALUE,t))}D.socketPath=v}else D.hostname=F.hostname.startsWith("[")?F.hostname.slice(1,-1):F.hostname,D.port=F.port,Ss(D,O,$+"//"+F.hostname+(F.port?":"+F.port:"")+D.path,!1,_,p);let ke,He=!1,he=!1,A=Dr.test(D.protocol);if(D.agent==null&&(D.agent=A?_:p),$e)ke=Ju;else{let R=o("transport");if(R)ke=R;else if(S===0)ke=A?Zn:Qn,He=!0;else{he=!0,D.sensitiveHeaders=[],S&&(D.maxRedirects=S);let w=o("beforeRedirect");if(w&&(D.beforeRedirects.config=w),we){let z=F.origin,T=we;D.beforeRedirects.auth=function(ne){try{new URL(ne.href).origin===z&&(ne.auth=T)}catch{}}}let x=o("sensitiveHeaders");if(x!=null){if(!u.isArray(x))return s(new m("sensitiveHeaders must be an array of strings",m.ERR_BAD_OPTION_VALUE,t));let z=new Set;for(let T of x){if(!u.isString(T))return s(new m("sensitiveHeaders must be an array of strings",m.ERR_BAD_OPTION_VALUE,t));z.add(T.toLowerCase())}z.size&&(D.sensitiveHeaders=Array.from(z),D.beforeRedirects.sensitiveHeaders=function(Q,ne){zu(Q,ne)||$u(Q.headers,z)})}ke=A?Lu:ku}}q>-1?D.maxBodyLength=q:D.maxBodyLength=1/0,D.insecureHTTPParser=!!o("insecureHTTPParser"),k=ke.request(D,function(w){if(Oe(),k.destroyed)return;let x=[w],z=u.toFiniteNumber(w.headers["content-length"]);if(Re||ee){let J=new Mt({maxRate:u.toFiniteNumber(ee)});Re&&J.on("progress",Fn(J,Nt(z,et(jt(Re),!0,3)))),x.push(J)}let T=w,Q=w.req||k;if(be!==!1&&w.headers["content-encoding"])switch((P==="HEAD"||w.statusCode===204)&&delete w.headers["content-encoding"],(w.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":x.push(me.createUnzip(Un)),delete w.headers["content-encoding"];break;case"deflate":x.push(new Rr),x.push(me.createUnzip(Un)),delete w.headers["content-encoding"];break;case"br":Es&&(x.push(me.createBrotliDecompress(Tu)),delete w.headers["content-encoding"]);break;case"zstd":Os&&(x.push(me.createZstdDecompress(Cu)),delete w.headers["content-encoding"]);break}T=x.length>1?ce.pipeline(x,u.noop):x[0];let ne={status:w.statusCode,statusText:w.statusMessage,headers:new K(w.headers),config:t,request:Q};if(b==="stream"){if(U>-1){let J=U,We=T;async function*ot(){let Z=0;for await(let Zr of We){if(Z+=Zr.length,Z>J)throw new m("maxContentLength size of "+J+" exceeded",m.ERR_BAD_RESPONSE,t,Q);yield Zr}}T=ce.Readable.from(ot(),{objectMode:!1})}ne.data=T,Ye(n,s,ne)}else{let J=[],We=0;T.on("data",function(Z){J.push(Z),We+=Z.length,U>-1&&We>U&&(Ce=!0,T.destroy(),G(new m("maxContentLength size of "+U+" exceeded",m.ERR_BAD_RESPONSE,t,Q)))}),T.on("aborted",function(){if(Ce)return;let Z=new m("stream has been aborted",m.ERR_BAD_RESPONSE,t,Q,ne);T.destroy(Z),s(Z)}),T.on("error",function(Z){Ce||s(m.from(Z,null,t,Q,ne))}),T.on("end",function(){try{let Z=J.length===1?J[0]:Buffer.concat(J);b!=="arraybuffer"&&(Z=Z.toString(y),(!y||y==="utf8")&&(Z=u.stripBOM(Z))),ne.data=Z}catch(Z){return s(m.from(Z,null,t,ne.request,ne))}Ye(n,s,ne)})}xe.once("abort",J=>{T.destroyed||(T.emit("error",J),T.destroy())})}),xe.once("abort",R=>{k.close?k.close():k.destroy(R)}),k.on("error",function(w){s(m.from(w,null,t,k))});let te=new Set;if(k.on("socket",function(w){typeof w.setKeepAlive=="function"&&w.setKeepAlive(!0,1e3*60),w[Dn]||(w.on("error",function(z){let T=w[xt];T&&!T.destroyed&&T.destroy(z)}),w[Dn]=!0),w[xt]=k,te.add(w)}),k.once("close",function(){Oe();for(let w of te)w[xt]===k&&(w[xt]=null);te.clear()}),o("timeout")){let R=parseInt(o("timeout"),10);if(Number.isNaN(R)){G(new m("error trying to parse `config.timeout` to int",m.ERR_BAD_OPTION_VALUE,t,k));return}let w=function(){Be||G(Le())};He&&R>0&&(de=setTimeout(w,R)),k.setTimeout(R,w)}else k.setTimeout(0);if(u.isStream(a)){let R=!1,w=!1;a.on("end",()=>{R=!0}),a.once("error",z=>{w=!0,k.destroy(z)}),a.on("close",()=>{!R&&!w&&G(new Ae("Request stream has been aborted",t,k))});let x=a;if(q>-1&&!he){let z=q,T=0;x=ce.pipeline([a,new ce.Transform({transform(Q,ne,J){if(T+=Q.length,T>z)return J(new m("Request body larger than maxBodyLength limit",m.ERR_BAD_REQUEST,t,k));J(null,Q)}})],u.noop),x.on("error",Q=>{k.destroyed||k.destroy(Q)})}x.pipe(k)}else a&&k.write(a),k.end()})},Gu=W.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,W.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(W.origin),W.navigator&&/(msie|trident)/i.test(W.navigator.userAgent)):()=>!0,Xu=W.hasStandardBrowserEnv?{write(e,t,r,n,s,i,o){if(typeof document>"u")return;let l=[`${e}=${encodeURIComponent(t)}`];u.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),u.isString(n)&&l.push(`path=${n}`),u.isString(s)&&l.push(`domain=${s}`),i===!0&&l.push("secure"),u.isString(o)&&l.push(`SameSite=${o}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;let t=document.cookie.split(";");for(let r=0;r<t.length;r++){let n=t[r].replace(/^\s+/,""),s=n.indexOf("=");if(s!==-1&&n.slice(0,s)===e)try{return decodeURIComponent(n.slice(s+1))}catch{return n.slice(s+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}},$n=e=>e instanceof K?{...e}:e;function je(e,t){e=e||{},t=t||{};let r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(h,d,g,p){return u.isPlainObject(h)&&u.isPlainObject(d)?u.merge.call({caseless:p},h,d):u.isPlainObject(d)?u.merge({},d):u.isArray(d)?d.slice():d}function s(h,d,g,p){if(u.isUndefined(d)){if(!u.isUndefined(h))return n(void 0,h,g,p)}else return n(h,d,g,p)}function i(h,d){if(!u.isUndefined(d))return n(void 0,d)}function o(h,d){if(u.isUndefined(d)){if(!u.isUndefined(h))return n(void 0,h)}else return n(void 0,d)}function l(h){let d=u.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!u.isUndefined(d))if(u.isPlainObject(d)){if(u.hasOwnProp(d,h))return d[h]}else return;let g=u.hasOwnProp(e,"transitional")?e.transitional:void 0;if(u.isPlainObject(g)&&u.hasOwnProp(g,h))return g[h]}function a(h,d,g){if(u.hasOwnProp(t,g))return n(h,d);if(u.hasOwnProp(e,g))return n(void 0,h)}let f={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:a,headers:(h,d,g)=>s($n(h),$n(d),g,!0)};return u.forEach(Object.keys({...e,...t}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;let g=u.hasOwnProp(f,d)?f[d]:s,p=u.hasOwnProp(e,d)?e[d]:void 0,_=u.hasOwnProp(t,d)?t[d]:void 0,O=g(p,_,d);u.isUndefined(O)&&g!==a||(r[d]=O)}),u.hasOwnProp(t,"validateStatus")&&u.isUndefined(t.validateStatus)&&l("validateStatusUndefinedResolves")===!1&&(u.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}var Yu=["content-type","content-length"];function Qu(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([n,s])=>{Yu.includes(n.toLowerCase())&&e.set(n,s)})}var Zu=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function As(e){let t=je({},e),r=g=>u.hasOwnProp(t,g)?t[g]:void 0,n=r("data"),s=r("withXSRFToken"),i=r("xsrfHeaderName"),o=r("xsrfCookieName"),l=r("headers"),a=r("auth"),f=r("baseURL"),h=r("allowAbsoluteUrls"),d=r("url");if(t.headers=l=K.from(l),t.url=Lr(Ur(f,d,h,t),r("params"),r("paramsSerializer")),a){let g=u.getSafeProp(a,"username")||"",p=u.getSafeProp(a,"password")||"";try{l.set("Authorization","Basic "+btoa(g+":"+(p?Zu(p):"")))}catch(_){throw m.from(_,m.ERR_BAD_OPTION_VALUE,e)}}if(u.isFormData(n)&&(W.hasStandardBrowserEnv||W.hasStandardBrowserWebWorkerEnv||u.isReactNative(n)?l.setContentType(void 0):u.isFunction(n.getHeaders)&&Qu(l,n.getHeaders(),r("formDataHeaderPolicy"))),W.hasStandardBrowserEnv&&(u.isFunction(s)&&(s=s(t)),s===!0||s==null&&Gu(t.url))){let p=i&&o&&Xu.read(o);p&&l.set(i,p)}return t}var ec=typeof XMLHttpRequest<"u",tc=ec&&function(e){return new Promise(function(r,n){let s=As(e),i=s.data,o=K.from(s.headers).normalize(),{responseType:l,onUploadProgress:a,onDownloadProgress:f}=s,h,d,g,p,_;function O(){p&&p(),_&&_(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}let b=new XMLHttpRequest;b.open(s.method.toUpperCase(),s.url,!0),b.timeout=s.timeout;function y(){if(!b)return;let P=K.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),q={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:P,config:e,request:b};Ye(function(be){r(be),O()},function(be){n(be),O()},q),b=null}"onloadend"in b?b.onloadend=y:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.startsWith("file:"))||setTimeout(y)},b.onabort=function(){b&&(n(new m("Request aborted",m.ECONNABORTED,e,b)),O(),b=null)},b.onerror=function(S){let q=S&&S.message?S.message:"Network Error",U=new m(q,m.ERR_NETWORK,e,b);U.event=S||null,n(U),O(),b=null},b.ontimeout=function(){let S=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded",q=s.transitional||zt;s.timeoutErrorMessage&&(S=s.timeoutErrorMessage),n(new m(S,q.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,b)),O(),b=null},i===void 0&&o.setContentType(null),"setRequestHeader"in b&&u.forEach(kr(o),function(S,q){b.setRequestHeader(q,S)}),u.isUndefined(s.withCredentials)||(b.withCredentials=!!s.withCredentials),l&&l!=="json"&&(b.responseType=s.responseType),f&&([g,_]=et(f,!0),b.addEventListener("progress",g)),a&&b.upload&&([d,p]=et(a),b.upload.addEventListener("progress",d),b.upload.addEventListener("loadend",p)),(s.cancelToken||s.signal)&&(h=P=>{b&&(n(!P||P.type?new Ae(null,e,b):P),b.abort(),O(),b=null)},s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));let v=bs(s.url);if(v&&!W.protocols.includes(v)){n(new m("Unsupported protocol "+v+":",m.ERR_BAD_REQUEST,e)),O();return}b.send(i||null)})},rc=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let r=new AbortController,n=!1,s=function(a){if(!n){n=!0,o();let f=a instanceof Error?a:this.reason;r.abort(f instanceof m?f:new Ae(f instanceof Error?f.message:f))}},i=t&&setTimeout(()=>{i=null,s(new m(`timeout of ${t}ms exceeded`,m.ETIMEDOUT))},t),o=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(a=>{a.unsubscribe?a.unsubscribe(s):a.removeEventListener("abort",s)}),e=null)};e.forEach(a=>a.addEventListener("abort",s,{once:!0}));let{signal:l}=r;return l.unsubscribe=()=>u.asap(o),l},nc=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},sc=async function*(e,t){for await(let r of ic(e))yield*nc(r,t)},ic=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},zn=(e,t,r,n)=>{let s=sc(e,t),i=0,o,l=a=>{o||(o=!0,n&&n(a))};return new ReadableStream({async pull(a){try{let{done:f,value:h}=await s.next();if(f){l(),a.close();return}let d=h.byteLength;if(r){let g=i+=d;r(g)}a.enqueue(new Uint8Array(h))}catch(f){throw l(f),f}},cancel(a){return l(a),s.return()}},{highWaterMark:2})},Hn=64*1024,{isFunction:kt}=u,oc=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),Wn=e=>{if(!u.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Vn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ac=e=>{let t=e.indexOf("://"),r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},lc=e=>{let t=u.global!==void 0&&u.global!==null?u.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=u.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:s,Request:i,Response:o}=e,l=s?kt(s):typeof fetch=="function",a=kt(i),f=kt(o);if(!l)return!1;let h=l&&kt(r),d=l&&(typeof n=="function"?(y=>v=>y.encode(v))(new n):async y=>new Uint8Array(await new i(y).arrayBuffer())),g=a&&h&&Vn(()=>{let y=!1,v=new i(W.origin,{body:new r,method:"POST",get duplex(){return y=!0,"half"}}),P=v.headers.has("Content-Type");return v.body!=null&&v.body.cancel(),y&&!P}),p=f&&h&&Vn(()=>u.isReadableStream(new o("").body)),_={stream:p&&(y=>y.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!_[y]&&(_[y]=(v,P)=>{let S=v&&v[y];if(S)return S.call(v);throw new m(`Response type '${y}' is not supported`,m.ERR_NOT_SUPPORT,P)})});let O=async y=>{if(y==null)return 0;if(u.isBlob(y))return y.size;if(u.isSpecCompliantForm(y))return(await new i(W.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(u.isArrayBufferView(y)||u.isArrayBuffer(y))return y.byteLength;if(u.isURLSearchParams(y)&&(y=y+""),u.isString(y))return(await d(y)).byteLength},b=async(y,v)=>{let P=u.toFiniteNumber(y.getContentLength());return P??O(v)};return async y=>{let{url:v,method:P,data:S,signal:q,cancelToken:U,timeout:be,onDownloadProgress:Be,onUploadProgress:Ce,responseType:k,headers:de,withCredentials:$e="same-origin",fetchOptions:xe,maxContentLength:G,maxBodyLength:Oe}=As(y),Le=u.isNumber(G)&&G>-1,Ie=u.isNumber(Oe)&&Oe>-1,St=L=>u.hasOwnProp(y,L)?y[L]:void 0,At=s||fetch;k=k?(k+"").toLowerCase():"text";let F=rc([q,U&&U.toAbortSignal()],be),$=null,V=F&&F.unsubscribe&&(()=>{F.unsubscribe()}),_e,Re=null,Ue=()=>new m("Request body larger than maxBodyLength limit",m.ERR_BAD_REQUEST,y,$);try{let L,ee=St("auth");if(ee){let A=u.getSafeProp(ee,"username")||"",te=u.getSafeProp(ee,"password")||"";L={username:A,password:te}}if(ac(v)){let A=new URL(v,W.origin);if(!L&&(A.username||A.password)){let te=Wn(A.username),R=Wn(A.password);L={username:te,password:R}}(A.username||A.password)&&(A.username="",A.password="",v=A.href)}if(L&&(de.delete("authorization"),de.set("Authorization","Basic "+btoa(oc((L.username||"")+":"+(L.password||""))))),Le&&typeof v=="string"&&v.startsWith("data:")&&vs(v)>G)throw new m("maxContentLength size of "+G+" exceeded",m.ERR_BAD_RESPONSE,y,$);if(Ie&&P!=="get"&&P!=="head"){let A=await O(S);if(typeof A=="number"&&isFinite(A)&&(_e=A,A>Oe))throw Ue()}let ze=Ie&&(u.isReadableStream(S)||u.isStream(S)),we=(A,te,R)=>zn(A,Hn,w=>{if(Ie&&w>Oe)throw Re=Ue();te&&te(w)},R);if(g&&P!=="get"&&P!=="head"&&(Ce||ze)){if(_e=_e??await b(de,S),_e!==0||ze){let A=new i(v,{method:"POST",body:S,duplex:"half"}),te;if(u.isFormData(S)&&(te=A.headers.get("content-type"))&&de.setContentType(te),A.body){let[R,w]=Ce&&Nt(_e,et(jt(Ce)))||[];S=we(A.body,R,w)}}}else if(ze&&!a&&h&&P!=="get"&&P!=="head")S=we(S);else if(ze&&a&&!g&&P!=="get"&&P!=="head")throw new m("Stream request bodies are not supported by the current fetch implementation",m.ERR_NOT_SUPPORT,y,$);u.isString($e)||($e=$e?"include":"omit");let st=a&&"credentials"in i.prototype;if(u.isFormData(S)){let A=de.getContentType();A&&/^multipart\/form-data/i.test(A)&&!/boundary=/i.test(A)&&de.delete("content-type")}de.set("User-Agent","axios/"+yt,!1);let it={...xe,signal:F,method:P.toUpperCase(),headers:kr(de.normalize()),body:S,duplex:"half",credentials:st?$e:void 0};$=a&&new i(v,it);let D=await(a?At($,xe):At(v,it)),ke=K.from(D.headers);if(Le){let A=u.toFiniteNumber(ke.getContentLength());if(A!=null&&A>G)throw new m("maxContentLength size of "+G+" exceeded",m.ERR_BAD_RESPONSE,y,$)}let He=p&&(k==="stream"||k==="response");if(p&&D.body&&(Be||Le||He&&V)){let A={};["status","statusText","headers"].forEach(T=>{A[T]=D[T]});let te=u.toFiniteNumber(ke.getContentLength()),[R,w]=Be&&Nt(te,et(jt(Be),!0))||[],x=0,z=T=>{if(Le&&(x=T,x>G))throw new m("maxContentLength size of "+G+" exceeded",m.ERR_BAD_RESPONSE,y,$);R&&R(T)};D=new o(zn(D.body,Hn,z,()=>{w&&w(),V&&V()}),A)}k=k||"text";let he=await _[u.findKey(_,k)||"text"](D,y);if(Le&&!p&&!He){let A;if(he!=null&&(typeof he.byteLength=="number"?A=he.byteLength:typeof he.size=="number"?A=he.size:typeof he=="string"&&(A=typeof n=="function"?new n().encode(he).byteLength:he.length)),typeof A=="number"&&A>G)throw new m("maxContentLength size of "+G+" exceeded",m.ERR_BAD_RESPONSE,y,$)}return!He&&V&&V(),await new Promise((A,te)=>{Ye(A,te,{data:he,headers:K.from(D.headers),status:D.status,statusText:D.statusText,config:y,request:$})})}catch(L){if(V&&V(),F&&F.aborted&&F.reason instanceof m){let ee=F.reason;throw ee.config=y,$&&(ee.request=$),L!==ee&&Object.defineProperty(ee,"cause",{__proto__:null,value:L,writable:!0,enumerable:!1,configurable:!0}),ee}if(Re)throw $&&!Re.request&&(Re.request=$),Re;if(L instanceof m)throw $&&!L.request&&(L.request=$),L;if(L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)){let ee=new m("Network Error",m.ERR_NETWORK,y,$,L&&L.response);throw Object.defineProperty(ee,"cause",{__proto__:null,value:L.cause||L,writable:!0,enumerable:!1,configurable:!0}),ee}throw m.from(L,L&&L.code,y,$,L&&L.response)}}},uc=new Map,Ts=e=>{let t=e&&e.env||{},{fetch:r,Request:n,Response:s}=t,i=[n,s,r],o=i.length,l=o,a,f,h=uc;for(;l--;)a=i[l],f=h.get(a),f===void 0&&h.set(a,f=l?new Map:lc(t)),h=f;return f};Ts();var qr={http:Ku,xhr:tc,fetch:{get:Ts}};u.forEach(qr,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var Jn=e=>`- ${e}`,cc=e=>u.isFunction(e)||e===null||e===!1;function fc(e,t){e=u.isArray(e)?e:[e];let{length:r}=e,n,s,i={};for(let o=0;o<r;o++){n=e[o];let l;if(s=n,!cc(n)&&(s=qr[(l=String(n)).toLowerCase()],s===void 0))throw new m(`Unknown adapter '${l}'`);if(s&&(u.isFunction(s)||(s=s.get(t))))break;i[l||"#"+o]=s}if(!s){let o=Object.entries(i).map(([a,f])=>`adapter ${a} `+(f===!1?"is not supported by the environment":"is not available in the build")),l=r?o.length>1?`since :
15
- `+o.map(Jn).join(`
16
- `):" "+Jn(o[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+l,m.ERR_NOT_SUPPORT)}return s}var Cs={getAdapter:fc,adapters:qr};function br(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ae(null,e)}function Kn(e){return br(e),e.headers=K.from(e.headers),e.data=mr.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Cs.getAdapter(e.adapter||wt.adapter,e)(e).then(function(n){br(e),e.response=n;try{n.data=mr.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=K.from(n.headers),n},function(n){if(!gs(n)&&(br(e),n&&n.response)){e.response=n.response;try{n.response.data=mr.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=K.from(n.response.headers)}return Promise.reject(n)})}var Ht={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ht[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var Gn={};Ht.transitional=function(t,r,n){function s(i,o){return"[Axios v"+yt+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,l)=>{if(t===!1)throw new m(s(o," has been removed"+(r?" in "+r:"")),m.ERR_DEPRECATED);return r&&!Gn[o]&&(Gn[o]=!0,console.warn(s(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,o,l):!0}};Ht.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function dc(e,t,r){if(typeof e!="object"||e===null)throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),s=n.length;for(;s-- >0;){let i=n[s],o=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(o){let l=e[i],a=l===void 0||o(l,i,e);if(a!==!0)throw new m("option "+i+" must be "+a,m.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}var Ut={assertOptions:dc,validators:Ht},ie=Ut.validators,Se=class{constructor(t){this.defaults=t||{},this.interceptors={request:new qt,response:new qt}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;let i=(()=>{if(!s.stack)return"";let o=s.stack.indexOf(`
17
- `);return o===-1?"":s.stack.slice(o+1)})();try{if(!n.stack)n.stack=i;else if(i){let o=i.indexOf(`
18
- `),l=o===-1?-1:i.indexOf(`
19
- `,o+1),a=l===-1?"":i.slice(l+1);String(n.stack).endsWith(a)||(n.stack+=`
20
- `+i)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=je(this.defaults,r);let{transitional:n,paramsSerializer:s,headers:i}=r;n!==void 0&&Ut.assertOptions(n,{silentJSONParsing:ie.transitional(ie.boolean),forcedJSONParsing:ie.transitional(ie.boolean),clarifyTimeoutError:ie.transitional(ie.boolean),legacyInterceptorReqResOrdering:ie.transitional(ie.boolean),advertiseZstdAcceptEncoding:ie.transitional(ie.boolean),validateStatusUndefinedResolves:ie.transitional(ie.boolean)},!1),s!=null&&(u.isFunction(s)?r.paramsSerializer={serialize:s}:Ut.assertOptions(s,{encode:ie.function,serialize:ie.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Ut.assertOptions(r,{baseUrl:ie.spelling("baseURL"),withXsrfToken:ie.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&u.merge(i.common,i[r.method]);i&&u.forEach(["delete","get","head","post","put","patch","query","common"],_=>{delete i[_]}),r.headers=K.concat(o,i);let l=[],a=!0;this.interceptors.request.forEach(function(O){if(typeof O.runWhen=="function"&&O.runWhen(r)===!1)return;a=a&&O.synchronous;let b=r.transitional||zt;b&&b.legacyInterceptorReqResOrdering?l.unshift(O.fulfilled,O.rejected):l.push(O.fulfilled,O.rejected)});let f=[];this.interceptors.response.forEach(function(O){f.push(O.fulfilled,O.rejected)});let h,d=0,g;if(!a){let _=[Kn.bind(this),void 0];for(_.unshift(...l),_.push(...f),g=_.length,h=Promise.resolve(r);d<g;)h=h.then(_[d++],_[d++]);return h}g=l.length;let p=r;for(;d<g;){let _=l[d++],O=l[d++];try{p=_(p)}catch(b){O.call(this,b);break}}try{h=Kn.call(this,p)}catch(_){return Promise.reject(_)}for(d=0,g=f.length;d<g;)h=h.then(f[d++],f[d++]);return h}getUri(t){t=je(this.defaults,t);let r=Ur(t.baseURL,t.url,t.allowAbsoluteUrls,t);return Lr(r,t.params,t.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(t){Se.prototype[t]=function(r,n){return this.request(je(n||{},{method:t,url:r,data:n&&u.hasOwnProp(n,"data")?n.data:void 0}))}});u.forEach(["post","put","patch","query"],function(t){function r(n){return function(i,o,l){return this.request(je(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Se.prototype[t]=r(),t!=="query"&&(Se.prototype[t+"Form"]=r(!0))});var Sr=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});let n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i,o=new Promise(l=>{n.subscribe(l),i=l}).then(s);return o.cancel=function(){n.unsubscribe(i)},o},t(function(i,o,l){n.reason||(n.reason=new Ae(i,o,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new e(function(s){t=s}),cancel:t}}};function hc(e){return function(r){return e.apply(null,r)}}function pc(e){return u.isObject(e)&&e.isAxiosError===!0}var Ar={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ar).forEach(([e,t])=>{Ar[t]=e});function xs(e){let t=new Se(e),r=ts(Se.prototype.request,t);return u.extend(r,Se.prototype,t,{allOwnKeys:!0}),u.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return xs(je(e,s))},r}var X=xs(wt);X.Axios=Se;X.CanceledError=Ae;X.CancelToken=Sr;X.isCancel=gs;X.VERSION=yt;X.toFormData=$t;X.AxiosError=m;X.Cancel=X.CanceledError;X.all=function(t){return Promise.all(t)};X.spread=hc;X.isAxiosError=pc;X.mergeConfig=je;X.AxiosHeaders=K;X.formToJSON=e=>ys(u.isHTMLForm(e)?new FormData(e):e);X.getAdapter=Cs.getAdapter;X.HttpStatusCode=Ar;X.default=X;ks.exports=X});var Us=E((If,Is)=>{function mc(){return!!(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&process.versions.electron||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Electron")>=0)}Is.exports=mc});var qs=E((Uf,Ds)=>{"use strict";var Ee=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";Ee.writable=e=>Ee(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";Ee.readable=e=>Ee(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";Ee.duplex=e=>Ee.writable(e)&&Ee.readable(e);Ee.transform=e=>Ee.duplex(e)&&typeof e._transform=="function";Ds.exports=Ee});var Ns=E((Df,Mr)=>{"use strict";var yc=Object.prototype.hasOwnProperty,le="~";function vt(){}Object.create&&(vt.prototype=Object.create(null),new vt().__proto__||(le=!1));function gc(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function Ms(e,t,r,n,s){if(typeof r!="function")throw new TypeError("The listener must be a function");var i=new gc(r,n||e,s),o=le?le+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],i]:e._events[o].push(i):(e._events[o]=i,e._eventsCount++),e}function Wt(e,t){--e._eventsCount===0?e._events=new vt:delete e._events[t]}function oe(){this._events=new vt,this._eventsCount=0}oe.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)yc.call(r,n)&&t.push(le?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};oe.prototype.listeners=function(t){var r=le?le+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,i=n.length,o=new Array(i);s<i;s++)o[s]=n[s].fn;return o};oe.prototype.listenerCount=function(t){var r=le?le+t:t,n=this._events[r];return n?n.fn?1:n.length:0};oe.prototype.emit=function(t,r,n,s,i,o){var l=le?le+t:t;if(!this._events[l])return!1;var a=this._events[l],f=arguments.length,h,d;if(a.fn){switch(a.once&&this.removeListener(t,a.fn,void 0,!0),f){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,r),!0;case 3:return a.fn.call(a.context,r,n),!0;case 4:return a.fn.call(a.context,r,n,s),!0;case 5:return a.fn.call(a.context,r,n,s,i),!0;case 6:return a.fn.call(a.context,r,n,s,i,o),!0}for(d=1,h=new Array(f-1);d<f;d++)h[d-1]=arguments[d];a.fn.apply(a.context,h)}else{var g=a.length,p;for(d=0;d<g;d++)switch(a[d].once&&this.removeListener(t,a[d].fn,void 0,!0),f){case 1:a[d].fn.call(a[d].context);break;case 2:a[d].fn.call(a[d].context,r);break;case 3:a[d].fn.call(a[d].context,r,n);break;case 4:a[d].fn.call(a[d].context,r,n,s);break;default:if(!h)for(p=1,h=new Array(f-1);p<f;p++)h[p-1]=arguments[p];a[d].fn.apply(a[d].context,h)}}return!0};oe.prototype.on=function(t,r,n){return Ms(this,t,r,n,!1)};oe.prototype.once=function(t,r,n){return Ms(this,t,r,n,!0)};oe.prototype.removeListener=function(t,r,n,s){var i=le?le+t:t;if(!this._events[i])return this;if(!r)return Wt(this,i),this;var o=this._events[i];if(o.fn)o.fn===r&&(!s||o.once)&&(!n||o.context===n)&&Wt(this,i);else{for(var l=0,a=[],f=o.length;l<f;l++)(o[l].fn!==r||s&&!o[l].once||n&&o[l].context!==n)&&a.push(o[l]);a.length?this._events[i]=a.length===1?a[0]:a:Wt(this,i)}return this};oe.prototype.removeAllListeners=function(t){var r;return t?(r=le?le+t:t,this._events[r]&&Wt(this,r)):(this._events=new vt,this._eventsCount=0),this};oe.prototype.off=oe.prototype.removeListener;oe.prototype.addListener=oe.prototype.on;oe.prefixed=le;oe.EventEmitter=oe;typeof Mr<"u"&&(Mr.exports=oe)});var Fs=E((qf,js)=>{"use strict";js.exports=(e,t)=>(t=t||(()=>{}),e.then(r=>new Promise(n=>{n(t())}).then(()=>r),r=>new Promise(n=>{n(t())}).then(()=>{throw r})))});var $s=E((Mf,Jt)=>{"use strict";var bc=Fs(),Vt=class extends Error{constructor(t){super(t),this.name="TimeoutError"}},Bs=(e,t,r)=>new Promise((n,s)=>{if(typeof t!="number"||t<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(t===1/0){n(e);return}let i=setTimeout(()=>{if(typeof r=="function"){try{n(r())}catch(a){s(a)}return}let o=typeof r=="string"?r:`Promise timed out after ${t} milliseconds`,l=r instanceof Error?r:new Vt(o);typeof e.cancel=="function"&&e.cancel(),s(l)},t);bc(e.then(n,s),()=>{clearTimeout(i)})});Jt.exports=Bs;Jt.exports.default=Bs;Jt.exports.TimeoutError=Vt});var zs=E(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});function _c(e,t,r){let n=0,s=e.length;for(;s>0;){let i=s/2|0,o=n+i;r(e[o],t)<=0?(n=++o,s-=i+1):s=i}return n}Nr.default=_c});var Hs=E(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});var wc=zs(),jr=class{constructor(){this._queue=[]}enqueue(t,r){r=Object.assign({priority:0},r);let n={priority:r.priority,run:t};if(this.size&&this._queue[this.size-1].priority>=r.priority){this._queue.push(n);return}let s=wc.default(this._queue,n,(i,o)=>o.priority-i.priority);this._queue.splice(s,0,n)}dequeue(){let t=this._queue.shift();return t?.run}filter(t){return this._queue.filter(r=>r.priority===t.priority).map(r=>r.run)}get size(){return this._queue.length}};Fr.default=jr});var Vs=E($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});var vc=Ns(),Ws=$s(),Ec=Hs(),Kt=()=>{},Oc=new Ws.TimeoutError,Br=class extends vc{constructor(t){var r,n,s,i;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=Kt,this._resolveIdle=Kt,t=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:Ec.default},t),!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(r=t.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(i=(s=t.interval)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""}\` (${typeof t.interval})`);this._carryoverConcurrencyCount=t.carryoverConcurrencyCount,this._isIntervalIgnored=t.intervalCap===1/0||t.interval===0,this._intervalCap=t.intervalCap,this._interval=t.interval,this._queue=new t.queueClass,this._queueClass=t.queueClass,this.concurrency=t.concurrency,this._timeout=t.timeout,this._throwOnTimeout=t.throwOnTimeout===!0,this._isPaused=t.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=Kt,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=Kt,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){let t=Date.now();if(this._intervalId===void 0){let r=this._intervalEnd-t;if(r<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},r)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let t=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let r=this._queue.dequeue();return r?(this.emit("active"),r(),t&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this._concurrency=t,this._processQueue()}async add(t,r={}){return new Promise((n,s)=>{let i=async()=>{this._pendingCount++,this._intervalCount++;try{let o=this._timeout===void 0&&r.timeout===void 0?t():Ws.default(Promise.resolve(t()),r.timeout===void 0?this._timeout:r.timeout,()=>{(r.throwOnTimeout===void 0?this._throwOnTimeout:r.throwOnTimeout)&&s(Oc)});n(await o)}catch(o){s(o)}this._next()};this._queue.enqueue(i,r),this._tryToStartAnother(),this.emit("add")})}async addAll(t,r){return Promise.all(t.map(async n=>this.add(n,r)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(t=>{let r=this._resolveEmpty;this._resolveEmpty=()=>{r(),t()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(t=>{let r=this._resolveIdle;this._resolveIdle=()=>{r(),t()}})}get size(){return this._queue.size}sizeBy(t){return this._queue.filter(t).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(t){this._timeout=t}};$r.default=Br});var di=E(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.getFileUploadJob=zr;N.getMultipleFileUploadJobs=Sc;N.getFileData=Js;N.getFileDataLength=Ks;N.getFileDataAsStream=Gs;N.getAllFileUploadsToComplete=Ac;N.warnIfNotUsingFilesUploadV2=Tc;N.warnIfChannels=Xs;N.errorIfChannelsCsv=Ys;N.errorIfInvalidOrMissingFileData=Qs;N.warnIfMissingOrInvalidFileNameAndDefault=Zs;N.warnIfLegacyFileType=ei;N.buildMissingFileIdError=ti;N.buildFileSizeErrorMsg=ri;N.buildLegacyFileTypeWarning=ni;N.buildMissingFileNameWarning=si;N.buildMissingExtensionWarning=ii;N.buildLegacyMethodWarning=oi;N.buildGeneralFilesUploadWarning=ai;N.buildFilesUploadMissingMessage=li;N.buildChannelsWarning=ui;N.buildMultipleChannelsErrorMsg=ci;N.buildInvalidFilesUploadParamError=fi;var Rc=H("node:fs"),Pc=H("node:stream"),Y=Tt();async function zr(e,t){var r,n,s,i;ei(e,t),Xs(e,t),Ys(e);let o=Zs(e,t),l=await Js(e),a=Ks(l),f={alt_text:e.alt_text,blocks:e.blocks,channel_id:(r=e.channels)!==null&&r!==void 0?r:e.channel_id,filename:(n=e.filename)!==null&&n!==void 0?n:o,highlight_type:e.highlight_type,initial_comment:e.initial_comment,snippet_type:e.snippet_type,title:(i=(s=e.title)!==null&&s!==void 0?s:e.filename)!==null&&i!==void 0?i:o,data:l,length:a};if("thread_ts"in e&&(f.thread_ts=e.thread_ts),"token"in e&&(f.token=e.token),"content"in e)return Object.assign({content:e.content},f);if("file"in e)return Object.assign({file:e.file},f);throw(0,Y.errorWithCode)(new Error("Either a file or content field is required for valid file upload. You must supply one"),Y.ErrorCode.FileUploadInvalidArgumentsError)}async function Sc(e,t){if("file_uploads"in e)return Promise.all(e.file_uploads.map(r=>{let{blocks:n,channel_id:s,channels:i,initial_comment:o,thread_ts:l}=r;if(n||s||i||o||l)throw(0,Y.errorWithCode)(new Error(fi()),Y.ErrorCode.FileUploadInvalidArgumentsError);let a=Object.assign(Object.assign({},r),{blocks:e.blocks,channels:e.channels,channel_id:e.channel_id,initial_comment:e.initial_comment});if("thread_ts"in e&&(a.thread_ts=e.thread_ts),"token"in e&&(a.token=e.token),"content"in r)return zr(Object.assign({content:r.content},a),t);if("file"in r)return zr(Object.assign({file:r.file},a),t);throw(0,Y.errorWithCode)(new Error("Either a file or content field is required for valid file upload. You must supply one"),Y.ErrorCode.FileUploadInvalidArgumentsError)}));throw new Error(li())}async function Js(e){if(Qs(e),"file"in e){let{file:t}=e;if(Buffer.isBuffer(t))return t;if(typeof t=="string")try{return(0,Rc.readFileSync)(t)}catch{throw(0,Y.errorWithCode)(new Error(`Unable to resolve file data for ${t}. Please supply a filepath string, or binary data Buffer or String directly.`),Y.ErrorCode.FileUploadInvalidArgumentsError)}let r=await Gs(t);if(r)return r}if("content"in e)return Buffer.from(e.content);throw(0,Y.errorWithCode)(new Error("There was an issue getting the file data for the file or content supplied"),Y.ErrorCode.FileUploadReadFileDataError)}function Ks(e){if(e)return Buffer.byteLength(e,"utf8");throw(0,Y.errorWithCode)(new Error(ri()),Y.ErrorCode.FileUploadReadFileDataError)}async function Gs(e){let t=[];return new Promise((r,n)=>{e.on("readable",()=>{let s=e.read();for(;s!==null;)t.push(s),s=e.read()}),e.on("end",()=>{if(t.length>0){let s=Buffer.concat(t);r(s)}else n(Error("No data in supplied file"))})})}function Ac(e){let t={};for(let r of e){let{blocks:n,channel_id:s,thread_ts:i,highlight_type:o,initial_comment:l,file_id:a,title:f}=r;if(a){let h=`:::${s}:::${i}:::${l}:::${JSON.stringify(n)}`;if(Object.prototype.hasOwnProperty.call(t,h))t[h].files.push({id:a,title:f,highlight_type:o});else{if(t[h]={files:[{id:a,title:f,highlight_type:o}],channel_id:s,blocks:n,initial_comment:l},i&&s){let d={channel_id:s,thread_ts:i};t[h]=Object.assign(Object.assign({},t[h]),d)}"token"in r&&(t[h].token=r.token)}}else throw new Error(ti())}return t}function Tc(e,t){let n=["files.upload"].includes(e);e==="files.upload"&&t.warn(oi(e)),n&&t.info(ai())}function Xs(e,t){e.channels&&t.warn(ui())}function Ys(e){if((e.channels?e.channels.split(","):[]).length>1)throw(0,Y.errorWithCode)(new Error(ci()),Y.ErrorCode.FileUploadInvalidArgumentsError)}function Qs(e){let t="file"in e,r="content"in e;if(!(t||r)||t&&r)throw(0,Y.errorWithCode)(new Error("Either a file or content field is required for valid file upload. You cannot supply both"),Y.ErrorCode.FileUploadInvalidArgumentsError);if("file"in e){let{file:n}=e;if(n&&!(typeof n=="string"||Buffer.isBuffer(n)||n instanceof Pc.Readable))throw(0,Y.errorWithCode)(new Error("file must be a valid string path, buffer or Readable"),Y.ErrorCode.FileUploadInvalidArgumentsError)}if("content"in e&&e.content&&typeof e.content!="string")throw(0,Y.errorWithCode)(new Error("content must be a string"),Y.ErrorCode.FileUploadInvalidArgumentsError)}function Zs(e,t){var r;let s=`file.${(r=e.filetype)!==null&&r!==void 0?r:"txt"}`,{filename:i}=e;return i?(i.split(".").length<2&&t.warn(ii(i)),i):(t.warn(si()),s)}function ei(e,t){e.filetype&&t.warn(ni())}function ti(){return"Missing required file id for file upload completion"}function ri(){return"There was an issue calculating the size of your file"}function ni(){return`filetype is no longer a supported field in files.uploadV2.
21
- Please remove this field. To indicate file type, please do so via the required filename property using the appropriate file extension, e.g. image.png, text.txt`}function si(){return`filename is a required field for files.uploadV2.
22
- For backwards compatibility and ease of migration, defaulting the filename. For best experience and consistent unfurl behavior, you should set the filename property with correct file extension, e.g. image.png, text.txt`}function ii(e){return`filename supplied '${e}' may be missing a proper extension. Missing extenions may result in unexpected unfurl behavior when shared`}function oi(e){return`${e} may cause some issues like timeouts for relatively large files.`}function ai(){return"Our latest recommendation is to use client.files.uploadV2() method, which is mostly compatible and much stabler, instead."}function li(){return"Something went wrong with processing file_uploads"}function ui(){return"Although the 'channels' parameter is still supported for smoother migration from legacy files.upload, we recommend using the new channel_id parameter with a single str value instead (e.g. 'C12345')."}function ci(){return"Sharing files with multiple channels is no longer supported in v2. Share files in each channel separately instead."}function fi(){return"You may supply file_uploads only for a single channel, message, or thread respectively. Therefore, please supply any channel_id, initial_comment or blocks, or thread_ts in the top-layer."}});var hi=E(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.default=Cc;function Cc(e){return new Promise(t=>{setTimeout(t,e)})}});var mi=E((zf,Wr)=>{"use strict";var xc=Object.prototype.hasOwnProperty,ue="~";function Et(){}Object.create&&(Et.prototype=Object.create(null),new Et().__proto__||(ue=!1));function kc(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function pi(e,t,r,n,s){if(typeof r!="function")throw new TypeError("The listener must be a function");var i=new kc(r,n||e,s),o=ue?ue+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],i]:e._events[o].push(i):(e._events[o]=i,e._eventsCount++),e}function Gt(e,t){--e._eventsCount===0?e._events=new Et:delete e._events[t]}function ae(){this._events=new Et,this._eventsCount=0}ae.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)xc.call(r,n)&&t.push(ue?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};ae.prototype.listeners=function(t){var r=ue?ue+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,i=n.length,o=new Array(i);s<i;s++)o[s]=n[s].fn;return o};ae.prototype.listenerCount=function(t){var r=ue?ue+t:t,n=this._events[r];return n?n.fn?1:n.length:0};ae.prototype.emit=function(t,r,n,s,i,o){var l=ue?ue+t:t;if(!this._events[l])return!1;var a=this._events[l],f=arguments.length,h,d;if(a.fn){switch(a.once&&this.removeListener(t,a.fn,void 0,!0),f){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,r),!0;case 3:return a.fn.call(a.context,r,n),!0;case 4:return a.fn.call(a.context,r,n,s),!0;case 5:return a.fn.call(a.context,r,n,s,i),!0;case 6:return a.fn.call(a.context,r,n,s,i,o),!0}for(d=1,h=new Array(f-1);d<f;d++)h[d-1]=arguments[d];a.fn.apply(a.context,h)}else{var g=a.length,p;for(d=0;d<g;d++)switch(a[d].once&&this.removeListener(t,a[d].fn,void 0,!0),f){case 1:a[d].fn.call(a[d].context);break;case 2:a[d].fn.call(a[d].context,r);break;case 3:a[d].fn.call(a[d].context,r,n);break;case 4:a[d].fn.call(a[d].context,r,n,s);break;default:if(!h)for(p=1,h=new Array(f-1);p<f;p++)h[p-1]=arguments[p];a[d].fn.apply(a[d].context,h)}}return!0};ae.prototype.on=function(t,r,n){return pi(this,t,r,n,!1)};ae.prototype.once=function(t,r,n){return pi(this,t,r,n,!0)};ae.prototype.removeListener=function(t,r,n,s){var i=ue?ue+t:t;if(!this._events[i])return this;if(!r)return Gt(this,i),this;var o=this._events[i];if(o.fn)o.fn===r&&(!s||o.once)&&(!n||o.context===n)&&Gt(this,i);else{for(var l=0,a=[],f=o.length;l<f;l++)(o[l].fn!==r||s&&!o[l].once||n&&o[l].context!==n)&&a.push(o[l]);a.length?this._events[i]=a.length===1?a[0]:a:Gt(this,i)}return this};ae.prototype.removeAllListeners=function(t){var r;return t?(r=ue?ue+t:t,this._events[r]&&Gt(this,r)):(this._events=new Et,this._eventsCount=0),this};ae.prototype.off=ae.prototype.removeListener;ae.prototype.addListener=ae.prototype.on;ae.prefixed=ue;ae.EventEmitter=ae;typeof Wr<"u"&&(Wr.exports=ae)});var gi=E(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0})});var _i=E(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0})});var vi=E(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0})});var Oi=E(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0})});var Pi=E(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0})});var Ai=E(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0})});var Ci=E(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0})});var ki=E(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0})});var Ii=E(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0})});var Di=E(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0})});var Mi=E(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0})});var ji=E(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0})});var Bi=E(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0})});var zi=E($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0})});var Wi=E(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0})});var Ji=E(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0})});var Gi=E(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0})});var Yi=E(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0})});var Zi=E(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0})});var to=E(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0})});var no=E(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0})});var io=E(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0})});var ao=E(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0})});var uo=E(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0})});var fo=E(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0})});var po=E(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0})});var yo=E(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0})});var bo=E(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0})});var wo=E(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0})});var Eo=E(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0})});var Ro=E(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0})});var So=E(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0})});var To=E(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0})});var Co=E(I=>{"use strict";var Lc=I&&I.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),M=I&&I.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Lc(t,e,r)};Object.defineProperty(I,"__esModule",{value:!0});M(ki(),I);M(Ii(),I);M(Di(),I);M(Mi(),I);M(ji(),I);M(Bi(),I);M(zi(),I);M(Wi(),I);M(Ji(),I);M(Gi(),I);M(Yi(),I);M(Zi(),I);M(to(),I);M(no(),I);M(io(),I);M(ao(),I);M(uo(),I);M(fo(),I);M(po(),I);M(yo(),I);M(bo(),I);M(wo(),I);M(Eo(),I);M(Ro(),I);M(So(),I);M(To(),I)});var ko=E(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0})});var Uo=E(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.CustomFieldType=nt.EntityType=void 0;var Lo;(function(e){e.Task="slack#/entities/task",e.File="slack#/entities/file",e.Item="slack#/entities/item",e.Incident="slack#/entities/incident",e.ContentItem="slack#/entities/content_item"})(Lo||(nt.EntityType=Lo={}));var Io;(function(e){e.Integer="integer",e.String="string",e.Array="array",e.Date="slack#/types/date",e.Timestamp="slack#/types/timestamp",e.Image="slack#/types/image",e.ChannelId="slack#/types/channel_id",e.User="slack#/types/user",e.EntityRef="slack#/types/entity_ref",e.Boolean="boolean",e.Link="slack#/types/link",e.Email="slack#/types/email"})(Io||(nt.CustomFieldType=Io={}))});var qo=E(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0})});var Mo=E(re=>{"use strict";var Ic=re&&re.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),ge=re&&re.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Ic(t,e,r)};Object.defineProperty(re,"__esModule",{value:!0});ge(gi(),re);ge(_i(),re);ge(vi(),re);ge(Oi(),re);ge(Pi(),re);ge(Ai(),re);ge(Ci(),re);ge(Co(),re);ge(ko(),re);ge(Uo(),re);ge(qo(),re)});var Jr=E(Te=>{"use strict";var Uc=Te&&Te.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Dc=Te&&Te.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Uc(t,e,r)};Object.defineProperty(Te,"__esModule",{value:!0});Te.Methods=void 0;var qc=mi(),No=Kr();function c(e,t){return e.apiCall.bind(e,t)}function C(e,t){return e.apiCall.bind(e,t)}function Mc(e){return e.filesUploadV2.bind(e)}var Vr=class extends qc.EventEmitter{constructor(){if(super(),this.admin={analytics:{getFile:c(this,"admin.analytics.getFile")},apps:{activities:{list:C(this,"admin.apps.activities.list")},approve:c(this,"admin.apps.approve"),approved:{list:c(this,"admin.apps.approved.list")},clearResolution:c(this,"admin.apps.clearResolution"),config:{lookup:c(this,"admin.apps.config.lookup"),set:c(this,"admin.apps.config.set")},requests:{cancel:c(this,"admin.apps.requests.cancel"),list:c(this,"admin.apps.requests.list")},restrict:c(this,"admin.apps.restrict"),restricted:{list:c(this,"admin.apps.restricted.list")},uninstall:c(this,"admin.apps.uninstall")},auth:{policy:{assignEntities:c(this,"admin.auth.policy.assignEntities"),getEntities:c(this,"admin.auth.policy.getEntities"),removeEntities:c(this,"admin.auth.policy.removeEntities")}},barriers:{create:c(this,"admin.barriers.create"),delete:c(this,"admin.barriers.delete"),list:C(this,"admin.barriers.list"),update:c(this,"admin.barriers.update")},conversations:{archive:c(this,"admin.conversations.archive"),bulkArchive:c(this,"admin.conversations.bulkArchive"),bulkDelete:c(this,"admin.conversations.bulkDelete"),bulkMove:c(this,"admin.conversations.bulkMove"),convertToPrivate:c(this,"admin.conversations.convertToPrivate"),convertToPublic:c(this,"admin.conversations.convertToPublic"),create:c(this,"admin.conversations.create"),delete:c(this,"admin.conversations.delete"),disconnectShared:c(this,"admin.conversations.disconnectShared"),ekm:{listOriginalConnectedChannelInfo:C(this,"admin.conversations.ekm.listOriginalConnectedChannelInfo")},getConversationPrefs:c(this,"admin.conversations.getConversationPrefs"),getCustomRetention:c(this,"admin.conversations.getCustomRetention"),getTeams:c(this,"admin.conversations.getTeams"),invite:c(this,"admin.conversations.invite"),lookup:c(this,"admin.conversations.lookup"),removeCustomRetention:c(this,"admin.conversations.removeCustomRetention"),rename:c(this,"admin.conversations.rename"),restrictAccess:{addGroup:c(this,"admin.conversations.restrictAccess.addGroup"),listGroups:c(this,"admin.conversations.restrictAccess.listGroups"),removeGroup:c(this,"admin.conversations.restrictAccess.removeGroup")},search:C(this,"admin.conversations.search"),setConversationPrefs:c(this,"admin.conversations.setConversationPrefs"),setCustomRetention:c(this,"admin.conversations.setCustomRetention"),setTeams:c(this,"admin.conversations.setTeams"),unarchive:c(this,"admin.conversations.unarchive")},emoji:{add:c(this,"admin.emoji.add"),addAlias:c(this,"admin.emoji.addAlias"),list:C(this,"admin.emoji.list"),remove:c(this,"admin.emoji.remove"),rename:c(this,"admin.emoji.rename")},functions:{list:c(this,"admin.functions.list"),permissions:{lookup:c(this,"admin.functions.permissions.lookup"),set:c(this,"admin.functions.permissions.set")}},inviteRequests:{approve:c(this,"admin.inviteRequests.approve"),approved:{list:c(this,"admin.inviteRequests.approved.list")},denied:{list:c(this,"admin.inviteRequests.denied.list")},deny:c(this,"admin.inviteRequests.deny"),list:c(this,"admin.inviteRequests.list")},roles:{addAssignments:c(this,"admin.roles.addAssignments"),listAssignments:C(this,"admin.roles.listAssignments"),removeAssignments:c(this,"admin.roles.removeAssignments")},teams:{admins:{list:c(this,"admin.teams.admins.list")},create:c(this,"admin.teams.create"),list:C(this,"admin.teams.list"),owners:{list:c(this,"admin.teams.owners.list")},settings:{info:c(this,"admin.teams.settings.info"),setDefaultChannels:c(this,"admin.teams.settings.setDefaultChannels"),setDescription:c(this,"admin.teams.settings.setDescription"),setDiscoverability:c(this,"admin.teams.settings.setDiscoverability"),setIcon:c(this,"admin.teams.settings.setIcon"),setName:c(this,"admin.teams.settings.setName")}},usergroups:{addChannels:c(this,"admin.usergroups.addChannels"),addTeams:c(this,"admin.usergroups.addTeams"),listChannels:c(this,"admin.usergroups.listChannels"),removeChannels:c(this,"admin.usergroups.removeChannels")},users:{assign:c(this,"admin.users.assign"),invite:c(this,"admin.users.invite"),list:C(this,"admin.users.list"),remove:c(this,"admin.users.remove"),session:{clearSettings:c(this,"admin.users.session.clearSettings"),getSettings:c(this,"admin.users.session.getSettings"),invalidate:c(this,"admin.users.session.invalidate"),list:C(this,"admin.users.session.list"),reset:c(this,"admin.users.session.reset"),resetBulk:c(this,"admin.users.session.resetBulk"),setSettings:c(this,"admin.users.session.setSettings")},setAdmin:c(this,"admin.users.setAdmin"),setExpiration:c(this,"admin.users.setExpiration"),setOwner:c(this,"admin.users.setOwner"),setRegular:c(this,"admin.users.setRegular"),unsupportedVersions:{export:c(this,"admin.users.unsupportedVersions.export")}},workflows:{collaborators:{add:c(this,"admin.workflows.collaborators.add"),remove:c(this,"admin.workflows.collaborators.remove")},permissions:{lookup:c(this,"admin.workflows.permissions.lookup")},search:C(this,"admin.workflows.search"),unpublish:c(this,"admin.workflows.unpublish")}},this.api={test:C(this,"api.test")},this.assistant={threads:{setStatus:c(this,"assistant.threads.setStatus"),setSuggestedPrompts:c(this,"assistant.threads.setSuggestedPrompts"),setTitle:c(this,"assistant.threads.setTitle")}},this.apps={connections:{open:C(this,"apps.connections.open")},event:{authorizations:{list:c(this,"apps.event.authorizations.list")}},manifest:{create:c(this,"apps.manifest.create"),delete:c(this,"apps.manifest.delete"),export:c(this,"apps.manifest.export"),update:c(this,"apps.manifest.update"),validate:c(this,"apps.manifest.validate")},uninstall:c(this,"apps.uninstall"),user:{connection:{update:c(this,"apps.user.connection.update")}}},this.auth={revoke:C(this,"auth.revoke"),teams:{list:C(this,"auth.teams.list")},test:C(this,"auth.test")},this.bookmarks={add:c(this,"bookmarks.add"),edit:c(this,"bookmarks.edit"),list:c(this,"bookmarks.list"),remove:c(this,"bookmarks.remove")},this.bots={info:C(this,"bots.info")},this.calls={add:c(this,"calls.add"),end:c(this,"calls.end"),info:c(this,"calls.info"),update:c(this,"calls.update"),participants:{add:c(this,"calls.participants.add"),remove:c(this,"calls.participants.remove")}},this.canvases={access:{delete:c(this,"canvases.access.delete"),set:c(this,"canvases.access.set")},create:C(this,"canvases.create"),delete:c(this,"canvases.delete"),edit:c(this,"canvases.edit"),sections:{lookup:c(this,"canvases.sections.lookup")}},this.chat={appendStream:c(this,"chat.appendStream"),delete:c(this,"chat.delete"),deleteScheduledMessage:c(this,"chat.deleteScheduledMessage"),getPermalink:c(this,"chat.getPermalink"),meMessage:c(this,"chat.meMessage"),postEphemeral:c(this,"chat.postEphemeral"),postMessage:c(this,"chat.postMessage"),scheduleMessage:c(this,"chat.scheduleMessage"),scheduledMessages:{list:C(this,"chat.scheduledMessages.list")},startStream:c(this,"chat.startStream"),stopStream:c(this,"chat.stopStream"),unfurl:c(this,"chat.unfurl"),update:c(this,"chat.update")},this.conversations={acceptSharedInvite:c(this,"conversations.acceptSharedInvite"),approveSharedInvite:c(this,"conversations.approveSharedInvite"),archive:c(this,"conversations.archive"),canvases:{create:c(this,"conversations.canvases.create")},close:c(this,"conversations.close"),create:c(this,"conversations.create"),declineSharedInvite:c(this,"conversations.declineSharedInvite"),externalInvitePermissions:{set:c(this,"conversations.externalInvitePermissions.set")},history:c(this,"conversations.history"),info:c(this,"conversations.info"),invite:c(this,"conversations.invite"),inviteShared:c(this,"conversations.inviteShared"),join:c(this,"conversations.join"),kick:c(this,"conversations.kick"),leave:c(this,"conversations.leave"),list:C(this,"conversations.list"),listConnectInvites:C(this,"conversations.listConnectInvites"),mark:c(this,"conversations.mark"),members:c(this,"conversations.members"),open:c(this,"conversations.open"),rename:c(this,"conversations.rename"),replies:c(this,"conversations.replies"),requestSharedInvite:{approve:c(this,"conversations.requestSharedInvite.approve"),deny:c(this,"conversations.requestSharedInvite.deny"),list:C(this,"conversations.requestSharedInvite.list")},setPurpose:c(this,"conversations.setPurpose"),setTopic:c(this,"conversations.setTopic"),unarchive:c(this,"conversations.unarchive")},this.dialog={open:c(this,"dialog.open")},this.dnd={endDnd:C(this,"dnd.endDnd"),endSnooze:C(this,"dnd.endSnooze"),info:C(this,"dnd.info"),setSnooze:c(this,"dnd.setSnooze"),teamInfo:c(this,"dnd.teamInfo")},this.emoji={list:C(this,"emoji.list")},this.entity={presentDetails:c(this,"entity.presentDetails")},this.files={completeUploadExternal:c(this,"files.completeUploadExternal"),delete:c(this,"files.delete"),getUploadURLExternal:c(this,"files.getUploadURLExternal"),info:c(this,"files.info"),list:c(this,"files.list"),revokePublicURL:c(this,"files.revokePublicURL"),sharedPublicURL:c(this,"files.sharedPublicURL"),upload:c(this,"files.upload"),uploadV2:Mc(this),comments:{delete:c(this,"files.comments.delete")},remote:{add:c(this,"files.remote.add"),info:c(this,"files.remote.info"),list:c(this,"files.remote.list"),remove:c(this,"files.remote.remove"),share:c(this,"files.remote.share"),update:c(this,"files.remote.update")}},this.functions={completeError:c(this,"functions.completeError"),completeSuccess:c(this,"functions.completeSuccess")},this.migration={exchange:c(this,"migration.exchange")},this.oauth={access:c(this,"oauth.access"),v2:{access:c(this,"oauth.v2.access"),exchange:c(this,"oauth.v2.exchange")}},this.openid={connect:{token:c(this,"openid.connect.token"),userInfo:C(this,"openid.connect.userInfo")}},this.pins={add:c(this,"pins.add"),list:c(this,"pins.list"),remove:c(this,"pins.remove")},this.reactions={add:c(this,"reactions.add"),get:c(this,"reactions.get"),list:C(this,"reactions.list"),remove:c(this,"reactions.remove")},this.reminders={add:c(this,"reminders.add"),complete:c(this,"reminders.complete"),delete:c(this,"reminders.delete"),info:c(this,"reminders.info"),list:C(this,"reminders.list")},this.rtm={connect:C(this,"rtm.connect"),start:C(this,"rtm.start")},this.search={all:c(this,"search.all"),files:c(this,"search.files"),messages:c(this,"search.messages")},this.slackLists={access:{delete:c(this,"slackLists.access.delete"),set:c(this,"slackLists.access.set")},create:c(this,"slackLists.create"),download:{get:c(this,"slackLists.download.get"),start:c(this,"slackLists.download.start")},items:{create:c(this,"slackLists.items.create"),delete:c(this,"slackLists.items.delete"),deleteMultiple:c(this,"slackLists.items.deleteMultiple"),info:c(this,"slackLists.items.info"),list:c(this,"slackLists.items.list"),update:c(this,"slackLists.items.update")},update:c(this,"slackLists.update")},this.team={accessLogs:C(this,"team.accessLogs"),billableInfo:C(this,"team.billableInfo"),billing:{info:c(this,"team.billing.info")},externalTeams:{disconnect:c(this,"team.externalTeams.disconnect"),list:c(this,"team.externalTeams.list")},info:C(this,"team.info"),integrationLogs:C(this,"team.integrationLogs"),preferences:{list:C(this,"team.preferences.list")},profile:{get:C(this,"team.profile.get")}},this.tooling={tokens:{rotate:c(this,"tooling.tokens.rotate")}},this.usergroups={create:c(this,"usergroups.create"),disable:c(this,"usergroups.disable"),enable:c(this,"usergroups.enable"),list:C(this,"usergroups.list"),update:c(this,"usergroups.update"),users:{list:c(this,"usergroups.users.list"),update:c(this,"usergroups.users.update")}},this.users={conversations:c(this,"users.conversations"),deletePhoto:c(this,"users.deletePhoto"),discoverableContacts:{lookup:c(this,"users.discoverableContacts.lookup")},getPresence:c(this,"users.getPresence"),identity:c(this,"users.identity"),info:c(this,"users.info"),list:c(this,"users.list"),lookupByEmail:c(this,"users.lookupByEmail"),setPhoto:c(this,"users.setPhoto"),setPresence:c(this,"users.setPresence"),profile:{get:c(this,"users.profile.get"),set:c(this,"users.profile.set")}},this.views={open:c(this,"views.open"),publish:c(this,"views.publish"),push:c(this,"views.push"),update:c(this,"views.update")},this.stars={add:c(this,"stars.add"),list:c(this,"stars.list"),remove:c(this,"stars.remove")},this.workflows={featured:{add:c(this,"workflows.featured.add"),list:c(this,"workflows.featured.list"),remove:c(this,"workflows.featured.remove"),set:c(this,"workflows.featured.set")},stepCompleted:c(this,"workflows.stepCompleted"),stepFailed:c(this,"workflows.stepFailed"),updateStep:c(this,"workflows.updateStep")},new.target!==No.WebClient&&!(new.target.prototype instanceof No.WebClient))throw new Error("Attempt to inherit from WebClient methods without inheriting from WebClient")}};Te.Methods=Vr;Dc(Mo(),Te)});var Kr=E(B=>{"use strict";var Nc=B&&B.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),jc=B&&B.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Fc=B&&B.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[n.length]=s);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),s=0;s<n.length;s++)n[s]!=="default"&&Nc(r,t,n[s]);return jc(r,t),r}})(),Rt=B&&B.__await||function(e){return this instanceof Rt?(this.v=e,this):new Rt(e)},Bc=B&&B.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(p){return function(_){return Promise.resolve(_).then(p,d)}}function l(p,_){n[p]&&(s[p]=function(O){return new Promise(function(b,y){i.push([p,O,b,y])>1||a(p,O)})},_&&(s[p]=_(s[p])))}function a(p,_){try{f(n[p](_))}catch(O){g(i[0][3],O)}}function f(p){p.value instanceof Rt?Promise.resolve(p.value.v).then(h,d):g(i[0][2],p)}function h(p){a("next",p)}function d(p){a("throw",p)}function g(p,_){p(_),i.shift(),i.length&&a(i[0][0],i[0][1])}},$c=B&&B.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(o){return new Promise(function(l,a){o=e[i](o),s(l,a,o.done,o.value)})}}function s(i,o,l,a){Promise.resolve(a).then(function(f){i({value:f,done:l})},o)}},zc=B&&B.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r},Fe=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(B,"__esModule",{value:!0});B.WebClient=B.WebClientEvent=void 0;B.buildThreadTsWarningMessage=zo;var jo=H("node:path"),Hc=H("node:querystring"),Wc=H("node:util"),Vc=Fe(H("node:zlib")),Jc=Fe(Ls()),Kc=Fe(tn()),Gc=Fe(Us()),Xr=Fe(qs()),Xc=Fe(Vs()),Gr=Fc(Jo()),Yc=sr(),Ot=Tt(),Xt=di(),Qc=Fe(hi()),Zc=Qt(),Fo=er(),ef=Jr(),tf=tr(),rf=["delete","common","get","put","head","post","link","patch","purge","unlink","options"],nf="Untitled",sf=200,of=()=>{},Yr;(function(e){e.RATE_LIMITED="rate_limited"})(Yr||(B.WebClientEvent=Yr={}));var Pt=class e extends ef.Methods{constructor(t,{slackApiUrl:r="https://slack.com/api/",logger:n=void 0,logLevel:s=void 0,maxRequestConcurrency:i=100,retryConfig:o=tf.tenRetriesInAboutThirtyMinutes,agent:l=void 0,tls:a=void 0,timeout:f=0,rejectRateLimitedCalls:h=!1,headers:d={},teamId:g=void 0,allowAbsoluteUrls:p=!0,attachOriginalToWebAPIRequestError:_=!0,requestInterceptor:O=void 0,adapter:b=void 0}={}){super(),this.token=t,this.slackApiUrl=r,this.slackApiUrl.endsWith("/")||(this.slackApiUrl+="/"),this.retryConfig=o,this.requestQueue=new Xc.default({concurrency:i}),this.tlsConfig=a!==void 0?a:{},this.rejectRateLimitedCalls=h,this.teamId=g,this.allowAbsoluteUrls=p,this.attachOriginalToWebAPIRequestError=_,typeof n<"u"?(this.logger=n,typeof s<"u"&&this.logger.debug("The logLevel given to WebClient was ignored as you also gave logger")):this.logger=(0,Fo.getLogger)(e.loggerName,s??Fo.LogLevel.INFO,n),this.token&&!d.Authorization&&(d.Authorization=`Bearer ${this.token}`),this.axios=Jc.default.create({adapter:b?y=>b(Object.assign(Object.assign({},y),{adapter:void 0})):void 0,timeout:f,baseURL:this.slackApiUrl,headers:(0,Gc.default)()?d:Object.assign({"User-Agent":(0,Zc.getUserAgent)()},d),httpAgent:l,httpsAgent:l,validateStatus:()=>!0,maxRedirects:0,proxy:!1}),this.axios.defaults.headers.post["Content-Type"]=void 0,O&&this.axios.interceptors.request.use(O,null),this.axios.interceptors.request.use(this.serializeApiCallData.bind(this),null),this.logger.debug("initialized")}async apiCall(t,r={}){if(this.logger.debug(`apiCall('${t}') start`),lf(t,this.logger),uf(t,this.logger,r),cf(t,this.logger,r),typeof r=="string"||typeof r=="number"||typeof r=="boolean")throw new TypeError(`Expected an options argument but instead received a ${typeof r}`);if((0,Xt.warnIfNotUsingFilesUploadV2)(t,this.logger),t==="files.uploadV2")return this.filesUploadV2(r);let n={};r.token&&(n.Authorization=`Bearer ${r.token}`);let s=this.deriveRequestUrl(t),i=await this.makeRequest(s,Object.assign({team_id:this.teamId},r),n),o=await this.buildResult(i);if(this.logger.debug(`http request result: ${JSON.stringify(o)}`),o.response_metadata!==void 0&&o.response_metadata.warnings!==void 0&&o.response_metadata.warnings.forEach(this.logger.warn.bind(this.logger)),o.response_metadata!==void 0&&o.response_metadata.messages!==void 0)for(let l of o.response_metadata.messages){let a=/\[ERROR\](.*)/,f=/\[WARN\](.*)/;if(a.test(l)){let h=l.match(a);h!=null&&this.logger.error(h[1].trim())}else if(f.test(l)){let h=l.match(f);h!=null&&this.logger.warn(h[1].trim())}}if(!o.ok&&i.headers["content-type"]!=="application/gzip"||"ok"in o&&o.ok===!1)throw(0,Ot.platformErrorFromResult)(o);return this.logger.debug(`apiCall('${t}') end`),o}paginate(t,r,n,s){let i=(()=>{if(r!==void 0&&typeof r.limit=="number"){let{limit:f}=r;return r.limit=void 0,f}return sf})();function o(){return Bc(this,arguments,function*(){let h,d={limit:i};for(r!==void 0&&r.cursor!==void 0&&(d.cursor=r.cursor);h===void 0||d!==void 0;)h=yield Rt(this.apiCall(t,Object.assign(r!==void 0?r:{},d))),yield yield Rt(h),d=af(h,i)})}if(n===void 0)return o.call(this);let l=s!==void 0?s:of,a=0;return(async()=>{var f,h,d,g;let p=o.call(this),O=(await p.next(void 0)).value,b=l(void 0,O,a);if(a+=1,n(O))return b;try{for(var y=!0,v=$c(p),P;P=await v.next(),f=P.done,!f;y=!0){g=P.value,y=!1;let S=g;if(b=l(b,S,a),n(S))return b;a+=1}}catch(S){h={error:S}}finally{try{!y&&!f&&(d=v.return)&&await d.call(v)}finally{if(h)throw h.error}}return b})()}chatStream(t){let{buffer_size:r}=t,n=zc(t,["buffer_size"]),s={buffer_size:r};return new Yc.ChatStreamer(this,this.logger,n,s)}async filesUploadV2(t){this.logger.debug("files.uploadV2() start");let r=await this.getAllFileUploads(t);return(await this.fetchAllUploadURLExternal(r)).forEach((i,o)=>{r[o].upload_url=i.upload_url,r[o].file_id=i.file_id}),await this.postFileUploadsToExternalURL(r,t),{ok:!0,files:await this.completeFileUploads(r)}}async fetchAllUploadURLExternal(t){return Promise.all(t.map(r=>{let n={filename:r.filename,length:r.length,alt_text:r.alt_text,snippet_type:r.snippet_type};return"token"in r&&(n.token=r.token),this.files.getUploadURLExternal(n)}))}async completeFileUploads(t){let r=Object.values((0,Xt.getAllFileUploadsToComplete)(t));return Promise.all(r.map(n=>this.files.completeUploadExternal(n)))}async postFileUploadsToExternalURL(t,r){return Promise.all(t.map(async n=>{let{upload_url:s,file_id:i,filename:o,data:l}=n,a=l;if(s){let f={};r.token&&(f.Authorization=`Bearer ${r.token}`);let h=await this.makeRequest(s,{body:a},f);if(h.status!==200)return Promise.reject(Error(`Failed to upload file (id:${i}, filename: ${o})`));let d={ok:!0,body:h.data};return Promise.resolve(d)}return Promise.reject(Error(`No upload url found for file (id: ${i}, filename: ${o}`))}))}async getAllFileUploads(t){let r=[];return("file"in t||"content"in t)&&r.push(await(0,Xt.getFileUploadJob)(t,this.logger)),"file_uploads"in t&&(r=r.concat(await(0,Xt.getMultipleFileUploadJobs)(t,this.logger))),r}async makeRequest(t,r,n={}){let s=()=>this.requestQueue.add(async()=>{try{let i=Object.assign({headers:n},this.tlsConfig);t.endsWith("admin.analytics.getFile")&&(i.responseType="arraybuffer"),t.endsWith("apps.event.authorizations.list")&&(r.token=void 0),this.logger.debug(`http request url: ${t}`),this.logger.debug(`http request body: ${JSON.stringify($o(r))}`);let o=Object.keys(this.axios.defaults.headers).reduce((a,f)=>(rf.includes(f)||(a[f]=this.axios.defaults.headers[f]),a),{});o=Object.assign(Object.assign(Object.assign({},this.axios.defaults.headers.common),o),n),this.logger.debug(`http request headers: ${JSON.stringify($o(o))}`);let l=await this.axios.post(t,r,i);if(this.logger.debug("http response received"),l.status===429){let a=Bo(l);throw a!==void 0?(this.emit(Yr.RATE_LIMITED,a,{url:t,body:r}),this.rejectRateLimitedCalls?new Gr.AbortError((0,Ot.rateLimitedErrorWithDelay)(a)):(this.logger.info(`API Call failed due to rate limiting. Will retry in ${a} seconds.`),this.requestQueue.pause(),await(0,Qc.default)(a*1e3),this.requestQueue.start(),new Error(`A rate limit was exceeded (url: ${t}, retry-after: ${a})`))):new Gr.AbortError(new Error(`Retry header did not contain a valid timeout (url: ${t}, retry-after header: ${l.headers["retry-after"]})`))}if(l.status!==200)throw(0,Ot.httpErrorFromResponse)(l);return l}catch(i){let o=i;throw this.logger.warn("http request failed",o.message),o.request?(0,Ot.requestErrorWithOriginal)(o,this.attachOriginalToWebAPIRequestError):i}});return(0,Gr.default)(s,this.retryConfig)}deriveRequestUrl(t){return(t.startsWith("https://")||t.startsWith("http://"))&&this.allowAbsoluteUrls?t:`${this.axios.getUri()+t}`}serializeApiCallData(t){let{data:r,headers:n}=t,s=!1,i=Object.entries(r).map(([l,a])=>{if(a==null)return[];let f=a;return Buffer.isBuffer(a)||(0,Xr.default)(a)?s=!0:typeof a!="string"&&typeof a!="number"&&typeof a!="boolean"&&(f=JSON.stringify(a)),[l,f]});if(s){this.logger.debug("Request arguments contain binary data");let l=i.reduce((a,[f,h])=>{if(Buffer.isBuffer(h)||(0,Xr.default)(h)){let d={};d.filename=(()=>{let g=h;return typeof g.name=="string"?(0,jo.basename)(g.name):typeof g.path=="string"?(0,jo.basename)(g.path):nf})(),a.append(f,h,d)}else f!==void 0&&h!==void 0&&a.append(f,h);return a},new Kc.default);if(n)for(let[a,f]of Object.entries(l.getHeaders()))n[a]=f;return t.data=l,t.headers=n,t}n&&(n["Content-Type"]="application/x-www-form-urlencoded");let o={};return t.data=(0,Hc.stringify)(i.reduce((l,[a,f])=>(a!==void 0&&f!==void 0&&(l[a]=f),l),o)),t.headers=n,t}async buildResult(t){let{data:r}=t,n=t.headers["content-type"]==="application/gzip";if(n)try{let i=await new Promise((l,a)=>{Vc.default.unzip(r,(f,h)=>f?a(f):l(h.toString().split(`
23
- `)))}).then(l=>l).catch(l=>{throw l}),o=[];if(Array.isArray(i))for(let l of i)l&&l.length>0&&o.push(JSON.parse(l));r={file_data:o}}catch(i){r={ok:!1,error:i}}else!n&&t.request.path==="/api/admin.analytics.getFile"&&(r=JSON.parse(new Wc.TextDecoder().decode(r)));if(typeof r=="string")try{r=JSON.parse(r)}catch{r={ok:!1,error:r}}r.response_metadata===void 0&&(r.response_metadata={}),t.headers["x-oauth-scopes"]!==void 0&&(r.response_metadata.scopes=t.headers["x-oauth-scopes"].trim().split(/\s*,\s*/)),t.headers["x-accepted-oauth-scopes"]!==void 0&&(r.response_metadata.acceptedScopes=t.headers["x-accepted-oauth-scopes"].trim().split(/\s*,\s*/));let s=Bo(t);return s!==void 0&&(r.response_metadata.retryAfter=s),r}};B.WebClient=Pt;Pt.loggerName="WebClient";B.default=Pt;function af(e,t){if(e!==void 0&&e.response_metadata!==void 0&&e.response_metadata.next_cursor!==void 0&&e.response_metadata.next_cursor!=="")return{limit:t,cursor:e.response_metadata.next_cursor}}function Bo(e){if(e.headers["retry-after"]!==void 0){let t=Number.parseInt(e.headers["retry-after"],10);if(!Number.isNaN(t))return t}}function lf(e,t){["workflows.stepCompleted","workflows.stepFailed","workflows.updateStep"].some(s=>new RegExp(`^${s}`).test(e))&&t.warn(`${e} is deprecated. Please check on https://docs.slack.dev/reference/methods for an alternative.`)}function uf(e,t,r){let s=["chat.postEphemeral","chat.postMessage","chat.scheduleMessage"].includes(e),i=h=>Array.isArray(h.attachments)&&h.attachments.length,o=h=>Array.isArray(h.attachments)&&h.attachments.some(d=>!d.fallback||d.fallback.trim()===""),l=h=>(h.text===void 0||h.text===null||h.text==="")&&(h.markdown_text===void 0||h.markdown===null||h.markdown_text===""),a=()=>`The top-level \`text\` argument is missing in the request payload for a ${e} call - It's a best practice to always provide a \`text\` argument when posting a message. The \`text\` is used in places where the content cannot be rendered such as: system push notifications, assistive technology such as screen readers, etc.`,f=()=>`Additionally, the attachment-level \`fallback\` argument is missing in the request payload for a ${e} call - To avoid this warning, it is recommended to always provide a top-level \`text\` argument when posting a message. Alternatively, you can provide an attachment-level \`fallback\` argument, though this is now considered a legacy field (see https://docs.slack.dev/legacy/legacy-messaging/legacy-secondary-message-attachments for more details).`;s&&typeof r=="object"&&(i(r)?o(r)&&l(r)&&(t.warn(a()),t.warn(f())):l(r)&&t.warn(a()))}function cf(e,t,r){["chat.postEphemeral","chat.postMessage","chat.scheduleMessage","files.upload"].includes(e)&&r?.thread_ts!==void 0&&typeof r?.thread_ts!="string"&&t.warn(zo(e))}function zo(e){return`The given thread_ts value in the request payload for a ${e} call is a float value. We highly recommend using a string value instead.`}function $o(e){let t=Object.entries(e).map(([n,s])=>{if(s==null)return[];let i=s;return(n.match(/.*token.*/)!==null||n.match(/[Aa]uthorization/))&&(i="[[REDACTED]]"),Buffer.isBuffer(s)||(0,Xr.default)(s)?i="[[BINARY VALUE OMITTED]]":typeof s!="string"&&typeof s!="number"&&typeof s!="boolean"&&(i=JSON.stringify(s)),[n,i]}),r={};return t.reduce((n,[s,i])=>(s!==void 0&&i!==void 0&&(n[s]=i),n),r)}});var bf=E(j=>{"use strict";var ff=j&&j.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Qr=j&&j.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&ff(t,e,r)},df=j&&j.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j,"__esModule",{value:!0});j.WebClientEvent=j.WebClient=j.ChatStreamer=j.retryPolicies=j.LogLevel=j.addAppMetadata=j.ErrorCode=void 0;var hf=Tt();Object.defineProperty(j,"ErrorCode",{enumerable:!0,get:function(){return hf.ErrorCode}});var pf=Qt();Object.defineProperty(j,"addAppMetadata",{enumerable:!0,get:function(){return pf.addAppMetadata}});var mf=er();Object.defineProperty(j,"LogLevel",{enumerable:!0,get:function(){return mf.LogLevel}});var yf=tr();Object.defineProperty(j,"retryPolicies",{enumerable:!0,get:function(){return df(yf).default}});Qr(cn(),j);Qr(dn(),j);var gf=sr();Object.defineProperty(j,"ChatStreamer",{enumerable:!0,get:function(){return gf.ChatStreamer}});var Ho=Kr();Object.defineProperty(j,"WebClient",{enumerable:!0,get:function(){return Ho.WebClient}});Object.defineProperty(j,"WebClientEvent",{enumerable:!0,get:function(){return Ho.WebClientEvent}});Qr(Jr(),j)});var _f=en("rate-limiter"),Wo=class{globalCapacity;globalRefillPerSec;perChannelCapacity;perChannelRefillPerSec;cleanupIntervalMs;buckets=new Map;cleanupTimer=null;constructor(t={}){this.globalCapacity=t.globalCapacity??20,this.globalRefillPerSec=t.globalRefillPerSec??1,this.perChannelCapacity=t.perChannelCapacity??1,this.perChannelRefillPerSec=t.perChannelRefillPerSec??1,this.cleanupIntervalMs=t.cleanupIntervalMs??6e4,this.cleanupTimer=setInterval(()=>this._cleanup(),this.cleanupIntervalMs),typeof this.cleanupTimer.unref=="function"&&this.cleanupTimer.unref()}tryAcquire(t,r){let{globalKey:n,channelKey:s}=this._keys(t,r),i=this._tryConsume(n);if(!i.ok)return i;if(s!==n){let o=this._tryConsume(s);if(!o.ok)return this._refund(n),o}return{ok:!0}}async acquire(t,r){for(;;){let n=this.tryAcquire(t,r);if(n.ok)return;await this._sleep(Math.min(n.retryAfterMs??200,200))}}reportThrottled(t,r,n){let s=n&&n>0?n*1e3+1e3:1e4,i=Date.now()+s,{globalKey:o,channelKey:l}=this._keys(t,r);this._getOrCreate(o).backoffUntil=i,l!==o&&(this._getOrCreate(l).backoffUntil=i),_f.warn(`${t}${r?`:${r}`:""} received 429, backing off ${s}ms`)}dispose(){this.cleanupTimer&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null),this.buckets.clear()}_bucketCount(){return this.buckets.size}_advanceTime(t){let r=Date.now();for(let n of this.buckets.values())n.lastRefill=r-t}_keys(t,r){let n=`__global__:${t}`,s=r?`${t}:${r}`:n;return{globalKey:n,channelKey:s}}_tryConsume(t){let r=this._getOrCreate(t),n=Date.now();if(r.backoffUntil>n)return{ok:!1,retryAfterMs:r.backoffUntil-n};if(this._refill(r,n,t),r.tokens>=1)return r.tokens-=1,{ok:!0};let s=this._refillPerSecForKey(t),i=s>0?Math.ceil((1-r.tokens)/s*1e3):1e3;return{ok:!1,retryAfterMs:Math.min(i,5e3)}}_refund(t){let r=this.buckets.get(t);if(!r)return;let n=this._capacityForKey(t);r.tokens=Math.min(r.tokens+1,n)}_getOrCreate(t){let r=this.buckets.get(t);return r||(r={tokens:this._capacityForKey(t),lastRefill:Date.now(),backoffUntil:0},this.buckets.set(t,r)),r}_refill(t,r,n){let s=(r-t.lastRefill)/1e3;if(s<=0)return;let i=this._refillPerSecForKey(n),o=this._capacityForKey(n);t.tokens=Math.min(t.tokens+s*i,o),t.lastRefill=r}_capacityForKey(t){return t.startsWith("__global__")?this.globalCapacity:this.perChannelCapacity}_refillPerSecForKey(t){return t.startsWith("__global__")?this.globalRefillPerSec:this.perChannelRefillPerSec}_cleanup(){let t=Date.now()-3e5;for(let[r,n]of this.buckets)n.lastRefill<t&&n.backoffUntil<t&&this.buckets.delete(r)}_sleep(t){return new Promise(r=>setTimeout(r,t))}};export{Zt as a,Ls as b,mi as c,Mo as d,bf as e,Wo as f};
24
- /*! Bundled license information:
25
-
26
- axios/dist/node/axios.cjs:
27
- (*! Axios v1.18.1 Copyright (c) 2026 Matt Zabriskie and contributors *)
28
- */