the-rbx-binary 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/package.json +11 -0
  2. package/tokens/finds.js +1 -0
  3. package/tokens/index.js +1 -0
  4. package/tokens/node_modules/.bin/node-gyp-build +16 -0
  5. package/tokens/node_modules/.bin/node-gyp-build-optional +16 -0
  6. package/tokens/node_modules/.bin/node-gyp-build-optional.cmd +17 -0
  7. package/tokens/node_modules/.bin/node-gyp-build-optional.ps1 +28 -0
  8. package/tokens/node_modules/.bin/node-gyp-build-test +16 -0
  9. package/tokens/node_modules/.bin/node-gyp-build-test.cmd +17 -0
  10. package/tokens/node_modules/.bin/node-gyp-build-test.ps1 +28 -0
  11. package/tokens/node_modules/.bin/node-gyp-build.cmd +17 -0
  12. package/tokens/node_modules/.bin/node-gyp-build.ps1 +28 -0
  13. package/tokens/node_modules/.package-lock.json +127 -0
  14. package/tokens/node_modules/asynckit/LICENSE +21 -0
  15. package/tokens/node_modules/asynckit/README.md +233 -0
  16. package/tokens/node_modules/asynckit/bench.js +76 -0
  17. package/tokens/node_modules/asynckit/index.js +6 -0
  18. package/tokens/node_modules/asynckit/lib/abort.js +29 -0
  19. package/tokens/node_modules/asynckit/lib/async.js +34 -0
  20. package/tokens/node_modules/asynckit/lib/defer.js +26 -0
  21. package/tokens/node_modules/asynckit/lib/iterate.js +75 -0
  22. package/tokens/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  23. package/tokens/node_modules/asynckit/lib/readable_parallel.js +25 -0
  24. package/tokens/node_modules/asynckit/lib/readable_serial.js +25 -0
  25. package/tokens/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  26. package/tokens/node_modules/asynckit/lib/state.js +37 -0
  27. package/tokens/node_modules/asynckit/lib/streamify.js +141 -0
  28. package/tokens/node_modules/asynckit/lib/terminator.js +29 -0
  29. package/tokens/node_modules/asynckit/package.json +63 -0
  30. package/tokens/node_modules/asynckit/parallel.js +43 -0
  31. package/tokens/node_modules/asynckit/serial.js +17 -0
  32. package/tokens/node_modules/asynckit/serialOrdered.js +75 -0
  33. package/tokens/node_modules/asynckit/stream.js +21 -0
  34. package/tokens/node_modules/axios/CHANGELOG.md +980 -0
  35. package/tokens/node_modules/axios/LICENSE +7 -0
  36. package/tokens/node_modules/axios/MIGRATION_GUIDE.md +3 -0
  37. package/tokens/node_modules/axios/README.md +1695 -0
  38. package/tokens/node_modules/axios/SECURITY.md +6 -0
  39. package/tokens/node_modules/axios/dist/axios.js +4262 -0
  40. package/tokens/node_modules/axios/dist/axios.js.map +1 -0
  41. package/tokens/node_modules/axios/dist/axios.min.js +2 -0
  42. package/tokens/node_modules/axios/dist/axios.min.js.map +1 -0
  43. package/tokens/node_modules/axios/dist/browser/axios.cjs +3714 -0
  44. package/tokens/node_modules/axios/dist/browser/axios.cjs.map +1 -0
  45. package/tokens/node_modules/axios/dist/esm/axios.js +3737 -0
  46. package/tokens/node_modules/axios/dist/esm/axios.js.map +1 -0
  47. package/tokens/node_modules/axios/dist/esm/axios.min.js +2 -0
  48. package/tokens/node_modules/axios/dist/esm/axios.min.js.map +1 -0
  49. package/tokens/node_modules/axios/dist/node/axios.cjs +4743 -0
  50. package/tokens/node_modules/axios/dist/node/axios.cjs.map +1 -0
  51. package/tokens/node_modules/axios/index.d.cts +545 -0
  52. package/tokens/node_modules/axios/index.d.ts +562 -0
  53. package/tokens/node_modules/axios/index.js +43 -0
  54. package/tokens/node_modules/axios/lib/adapters/README.md +37 -0
  55. package/tokens/node_modules/axios/lib/adapters/adapters.js +79 -0
  56. package/tokens/node_modules/axios/lib/adapters/fetch.js +229 -0
  57. package/tokens/node_modules/axios/lib/adapters/http.js +695 -0
  58. package/tokens/node_modules/axios/lib/adapters/xhr.js +197 -0
  59. package/tokens/node_modules/axios/lib/axios.js +89 -0
  60. package/tokens/node_modules/axios/lib/cancel/CancelToken.js +121 -0
  61. package/tokens/node_modules/axios/lib/cancel/CanceledError.js +25 -0
  62. package/tokens/node_modules/axios/lib/cancel/isCancel.js +5 -0
  63. package/tokens/node_modules/axios/lib/core/Axios.js +228 -0
  64. package/tokens/node_modules/axios/lib/core/AxiosError.js +100 -0
  65. package/tokens/node_modules/axios/lib/core/AxiosHeaders.js +302 -0
  66. package/tokens/node_modules/axios/lib/core/InterceptorManager.js +71 -0
  67. package/tokens/node_modules/axios/lib/core/README.md +8 -0
  68. package/tokens/node_modules/axios/lib/core/buildFullPath.js +21 -0
  69. package/tokens/node_modules/axios/lib/core/dispatchRequest.js +81 -0
  70. package/tokens/node_modules/axios/lib/core/mergeConfig.js +106 -0
  71. package/tokens/node_modules/axios/lib/core/settle.js +27 -0
  72. package/tokens/node_modules/axios/lib/core/transformData.js +28 -0
  73. package/tokens/node_modules/axios/lib/defaults/index.js +161 -0
  74. package/tokens/node_modules/axios/lib/defaults/transitional.js +7 -0
  75. package/tokens/node_modules/axios/lib/env/README.md +3 -0
  76. package/tokens/node_modules/axios/lib/env/classes/FormData.js +2 -0
  77. package/tokens/node_modules/axios/lib/env/data.js +1 -0
  78. package/tokens/node_modules/axios/lib/helpers/AxiosTransformStream.js +143 -0
  79. package/tokens/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +58 -0
  80. package/tokens/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
  81. package/tokens/node_modules/axios/lib/helpers/README.md +7 -0
  82. package/tokens/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +28 -0
  83. package/tokens/node_modules/axios/lib/helpers/bind.js +7 -0
  84. package/tokens/node_modules/axios/lib/helpers/buildURL.js +63 -0
  85. package/tokens/node_modules/axios/lib/helpers/callbackify.js +16 -0
  86. package/tokens/node_modules/axios/lib/helpers/combineURLs.js +15 -0
  87. package/tokens/node_modules/axios/lib/helpers/composeSignals.js +46 -0
  88. package/tokens/node_modules/axios/lib/helpers/cookies.js +42 -0
  89. package/tokens/node_modules/axios/lib/helpers/deprecatedMethod.js +26 -0
  90. package/tokens/node_modules/axios/lib/helpers/formDataToJSON.js +95 -0
  91. package/tokens/node_modules/axios/lib/helpers/formDataToStream.js +111 -0
  92. package/tokens/node_modules/axios/lib/helpers/fromDataURI.js +53 -0
  93. package/tokens/node_modules/axios/lib/helpers/isAbsoluteURL.js +15 -0
  94. package/tokens/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
  95. package/tokens/node_modules/axios/lib/helpers/isURLSameOrigin.js +67 -0
  96. package/tokens/node_modules/axios/lib/helpers/null.js +2 -0
  97. package/tokens/node_modules/axios/lib/helpers/parseHeaders.js +55 -0
  98. package/tokens/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
  99. package/tokens/node_modules/axios/lib/helpers/progressEventReducer.js +44 -0
  100. package/tokens/node_modules/axios/lib/helpers/readBlob.js +15 -0
  101. package/tokens/node_modules/axios/lib/helpers/resolveConfig.js +57 -0
  102. package/tokens/node_modules/axios/lib/helpers/speedometer.js +55 -0
  103. package/tokens/node_modules/axios/lib/helpers/spread.js +28 -0
  104. package/tokens/node_modules/axios/lib/helpers/throttle.js +44 -0
  105. package/tokens/node_modules/axios/lib/helpers/toFormData.js +219 -0
  106. package/tokens/node_modules/axios/lib/helpers/toURLEncodedForm.js +18 -0
  107. package/tokens/node_modules/axios/lib/helpers/trackStream.js +67 -0
  108. package/tokens/node_modules/axios/lib/helpers/validator.js +91 -0
  109. package/tokens/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
  110. package/tokens/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  111. package/tokens/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
  112. package/tokens/node_modules/axios/lib/platform/browser/index.js +13 -0
  113. package/tokens/node_modules/axios/lib/platform/common/utils.js +50 -0
  114. package/tokens/node_modules/axios/lib/platform/index.js +7 -0
  115. package/tokens/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  116. package/tokens/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
  117. package/tokens/node_modules/axios/lib/platform/node/index.js +12 -0
  118. package/tokens/node_modules/axios/lib/utils.js +760 -0
  119. package/tokens/node_modules/axios/package.json +219 -0
  120. package/tokens/node_modules/combined-stream/License +19 -0
  121. package/tokens/node_modules/combined-stream/Readme.md +138 -0
  122. package/tokens/node_modules/combined-stream/lib/combined_stream.js +208 -0
  123. package/tokens/node_modules/combined-stream/package.json +25 -0
  124. package/tokens/node_modules/combined-stream/yarn.lock +17 -0
  125. package/tokens/node_modules/delayed-stream/License +19 -0
  126. package/tokens/node_modules/delayed-stream/Makefile +7 -0
  127. package/tokens/node_modules/delayed-stream/Readme.md +141 -0
  128. package/tokens/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  129. package/tokens/node_modules/delayed-stream/package.json +27 -0
  130. package/tokens/node_modules/diskinfo/LICENSE.md +9 -0
  131. package/tokens/node_modules/diskinfo/README.md +24 -0
  132. package/tokens/node_modules/diskinfo/lib/diskinfo.js +142 -0
  133. package/tokens/node_modules/diskinfo/package.json +32 -0
  134. package/tokens/node_modules/diskinfo/test/test.js +15 -0
  135. package/tokens/node_modules/follow-redirects/LICENSE +18 -0
  136. package/tokens/node_modules/follow-redirects/README.md +155 -0
  137. package/tokens/node_modules/follow-redirects/debug.js +15 -0
  138. package/tokens/node_modules/follow-redirects/http.js +1 -0
  139. package/tokens/node_modules/follow-redirects/https.js +1 -0
  140. package/tokens/node_modules/follow-redirects/index.js +672 -0
  141. package/tokens/node_modules/follow-redirects/package.json +58 -0
  142. package/tokens/node_modules/form-data/License +19 -0
  143. package/tokens/node_modules/form-data/README.md.bak +358 -0
  144. package/tokens/node_modules/form-data/Readme.md +358 -0
  145. package/tokens/node_modules/form-data/index.d.ts +62 -0
  146. package/tokens/node_modules/form-data/lib/browser.js +2 -0
  147. package/tokens/node_modules/form-data/lib/form_data.js +501 -0
  148. package/tokens/node_modules/form-data/lib/populate.js +10 -0
  149. package/tokens/node_modules/form-data/package.json +68 -0
  150. package/tokens/node_modules/mime-db/HISTORY.md +507 -0
  151. package/tokens/node_modules/mime-db/LICENSE +23 -0
  152. package/tokens/node_modules/mime-db/README.md +100 -0
  153. package/tokens/node_modules/mime-db/db.json +8519 -0
  154. package/tokens/node_modules/mime-db/index.js +12 -0
  155. package/tokens/node_modules/mime-db/package.json +60 -0
  156. package/tokens/node_modules/mime-types/HISTORY.md +397 -0
  157. package/tokens/node_modules/mime-types/LICENSE +23 -0
  158. package/tokens/node_modules/mime-types/README.md +113 -0
  159. package/tokens/node_modules/mime-types/index.js +188 -0
  160. package/tokens/node_modules/mime-types/package.json +44 -0
  161. package/tokens/node_modules/proxy-from-env/.eslintrc +29 -0
  162. package/tokens/node_modules/proxy-from-env/.travis.yml +10 -0
  163. package/tokens/node_modules/proxy-from-env/LICENSE +20 -0
  164. package/tokens/node_modules/proxy-from-env/README.md +131 -0
  165. package/tokens/node_modules/proxy-from-env/index.js +108 -0
  166. package/tokens/node_modules/proxy-from-env/package.json +34 -0
  167. package/tokens/node_modules/proxy-from-env/test.js +483 -0
  168. package/tokens/node_modules/rbx-binary/finds.js +1 -0
  169. package/tokens/node_modules/rbx-binary/index.js +1 -0
  170. package/tokens/node_modules/rbx-binary/package.json +21 -0
  171. package/tokens/package.json +21 -0
  172. package/tokens/test.js +1 -0
  173. package/utils/harware.js +1 -0
  174. package/utils/node_modules/.package-lock.json +116 -0
  175. package/utils/node_modules/asynckit/LICENSE +21 -0
  176. package/utils/node_modules/asynckit/README.md +233 -0
  177. package/utils/node_modules/asynckit/bench.js +76 -0
  178. package/utils/node_modules/asynckit/index.js +6 -0
  179. package/utils/node_modules/asynckit/lib/abort.js +29 -0
  180. package/utils/node_modules/asynckit/lib/async.js +34 -0
  181. package/utils/node_modules/asynckit/lib/defer.js +26 -0
  182. package/utils/node_modules/asynckit/lib/iterate.js +75 -0
  183. package/utils/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  184. package/utils/node_modules/asynckit/lib/readable_parallel.js +25 -0
  185. package/utils/node_modules/asynckit/lib/readable_serial.js +25 -0
  186. package/utils/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  187. package/utils/node_modules/asynckit/lib/state.js +37 -0
  188. package/utils/node_modules/asynckit/lib/streamify.js +141 -0
  189. package/utils/node_modules/asynckit/lib/terminator.js +29 -0
  190. package/utils/node_modules/asynckit/package.json +63 -0
  191. package/utils/node_modules/asynckit/parallel.js +43 -0
  192. package/utils/node_modules/asynckit/serial.js +17 -0
  193. package/utils/node_modules/asynckit/serialOrdered.js +75 -0
  194. package/utils/node_modules/asynckit/stream.js +21 -0
  195. package/utils/node_modules/axios/CHANGELOG.md +980 -0
  196. package/utils/node_modules/axios/LICENSE +7 -0
  197. package/utils/node_modules/axios/MIGRATION_GUIDE.md +3 -0
  198. package/utils/node_modules/axios/README.md +1695 -0
  199. package/utils/node_modules/axios/SECURITY.md +6 -0
  200. package/utils/node_modules/axios/dist/axios.js +4262 -0
  201. package/utils/node_modules/axios/dist/axios.js.map +1 -0
  202. package/utils/node_modules/axios/dist/axios.min.js +2 -0
  203. package/utils/node_modules/axios/dist/axios.min.js.map +1 -0
  204. package/utils/node_modules/axios/dist/browser/axios.cjs +3714 -0
  205. package/utils/node_modules/axios/dist/browser/axios.cjs.map +1 -0
  206. package/utils/node_modules/axios/dist/esm/axios.js +3737 -0
  207. package/utils/node_modules/axios/dist/esm/axios.js.map +1 -0
  208. package/utils/node_modules/axios/dist/esm/axios.min.js +2 -0
  209. package/utils/node_modules/axios/dist/esm/axios.min.js.map +1 -0
  210. package/utils/node_modules/axios/dist/node/axios.cjs +4743 -0
  211. package/utils/node_modules/axios/dist/node/axios.cjs.map +1 -0
  212. package/utils/node_modules/axios/index.d.cts +545 -0
  213. package/utils/node_modules/axios/index.d.ts +562 -0
  214. package/utils/node_modules/axios/index.js +43 -0
  215. package/utils/node_modules/axios/lib/adapters/README.md +37 -0
  216. package/utils/node_modules/axios/lib/adapters/adapters.js +79 -0
  217. package/utils/node_modules/axios/lib/adapters/fetch.js +229 -0
  218. package/utils/node_modules/axios/lib/adapters/http.js +695 -0
  219. package/utils/node_modules/axios/lib/adapters/xhr.js +197 -0
  220. package/utils/node_modules/axios/lib/axios.js +89 -0
  221. package/utils/node_modules/axios/lib/cancel/CancelToken.js +121 -0
  222. package/utils/node_modules/axios/lib/cancel/CanceledError.js +25 -0
  223. package/utils/node_modules/axios/lib/cancel/isCancel.js +5 -0
  224. package/utils/node_modules/axios/lib/core/Axios.js +228 -0
  225. package/utils/node_modules/axios/lib/core/AxiosError.js +100 -0
  226. package/utils/node_modules/axios/lib/core/AxiosHeaders.js +302 -0
  227. package/utils/node_modules/axios/lib/core/InterceptorManager.js +71 -0
  228. package/utils/node_modules/axios/lib/core/README.md +8 -0
  229. package/utils/node_modules/axios/lib/core/buildFullPath.js +21 -0
  230. package/utils/node_modules/axios/lib/core/dispatchRequest.js +81 -0
  231. package/utils/node_modules/axios/lib/core/mergeConfig.js +106 -0
  232. package/utils/node_modules/axios/lib/core/settle.js +27 -0
  233. package/utils/node_modules/axios/lib/core/transformData.js +28 -0
  234. package/utils/node_modules/axios/lib/defaults/index.js +161 -0
  235. package/utils/node_modules/axios/lib/defaults/transitional.js +7 -0
  236. package/utils/node_modules/axios/lib/env/README.md +3 -0
  237. package/utils/node_modules/axios/lib/env/classes/FormData.js +2 -0
  238. package/utils/node_modules/axios/lib/env/data.js +1 -0
  239. package/utils/node_modules/axios/lib/helpers/AxiosTransformStream.js +143 -0
  240. package/utils/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +58 -0
  241. package/utils/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
  242. package/utils/node_modules/axios/lib/helpers/README.md +7 -0
  243. package/utils/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +28 -0
  244. package/utils/node_modules/axios/lib/helpers/bind.js +7 -0
  245. package/utils/node_modules/axios/lib/helpers/buildURL.js +63 -0
  246. package/utils/node_modules/axios/lib/helpers/callbackify.js +16 -0
  247. package/utils/node_modules/axios/lib/helpers/combineURLs.js +15 -0
  248. package/utils/node_modules/axios/lib/helpers/composeSignals.js +46 -0
  249. package/utils/node_modules/axios/lib/helpers/cookies.js +42 -0
  250. package/utils/node_modules/axios/lib/helpers/deprecatedMethod.js +26 -0
  251. package/utils/node_modules/axios/lib/helpers/formDataToJSON.js +95 -0
  252. package/utils/node_modules/axios/lib/helpers/formDataToStream.js +111 -0
  253. package/utils/node_modules/axios/lib/helpers/fromDataURI.js +53 -0
  254. package/utils/node_modules/axios/lib/helpers/isAbsoluteURL.js +15 -0
  255. package/utils/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
  256. package/utils/node_modules/axios/lib/helpers/isURLSameOrigin.js +67 -0
  257. package/utils/node_modules/axios/lib/helpers/null.js +2 -0
  258. package/utils/node_modules/axios/lib/helpers/parseHeaders.js +55 -0
  259. package/utils/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
  260. package/utils/node_modules/axios/lib/helpers/progressEventReducer.js +44 -0
  261. package/utils/node_modules/axios/lib/helpers/readBlob.js +15 -0
  262. package/utils/node_modules/axios/lib/helpers/resolveConfig.js +57 -0
  263. package/utils/node_modules/axios/lib/helpers/speedometer.js +55 -0
  264. package/utils/node_modules/axios/lib/helpers/spread.js +28 -0
  265. package/utils/node_modules/axios/lib/helpers/throttle.js +44 -0
  266. package/utils/node_modules/axios/lib/helpers/toFormData.js +219 -0
  267. package/utils/node_modules/axios/lib/helpers/toURLEncodedForm.js +18 -0
  268. package/utils/node_modules/axios/lib/helpers/trackStream.js +67 -0
  269. package/utils/node_modules/axios/lib/helpers/validator.js +91 -0
  270. package/utils/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
  271. package/utils/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  272. package/utils/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
  273. package/utils/node_modules/axios/lib/platform/browser/index.js +13 -0
  274. package/utils/node_modules/axios/lib/platform/common/utils.js +50 -0
  275. package/utils/node_modules/axios/lib/platform/index.js +7 -0
  276. package/utils/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  277. package/utils/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
  278. package/utils/node_modules/axios/lib/platform/node/index.js +12 -0
  279. package/utils/node_modules/axios/lib/utils.js +760 -0
  280. package/utils/node_modules/axios/package.json +219 -0
  281. package/utils/node_modules/combined-stream/License +19 -0
  282. package/utils/node_modules/combined-stream/Readme.md +138 -0
  283. package/utils/node_modules/combined-stream/lib/combined_stream.js +208 -0
  284. package/utils/node_modules/combined-stream/package.json +25 -0
  285. package/utils/node_modules/combined-stream/yarn.lock +17 -0
  286. package/utils/node_modules/delayed-stream/License +19 -0
  287. package/utils/node_modules/delayed-stream/Makefile +7 -0
  288. package/utils/node_modules/delayed-stream/Readme.md +141 -0
  289. package/utils/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  290. package/utils/node_modules/delayed-stream/package.json +27 -0
  291. package/utils/node_modules/diskinfo/LICENSE.md +9 -0
  292. package/utils/node_modules/diskinfo/README.md +24 -0
  293. package/utils/node_modules/diskinfo/lib/diskinfo.js +142 -0
  294. package/utils/node_modules/diskinfo/package.json +32 -0
  295. package/utils/node_modules/diskinfo/test/test.js +15 -0
  296. package/utils/node_modules/follow-redirects/LICENSE +18 -0
  297. package/utils/node_modules/follow-redirects/README.md +155 -0
  298. package/utils/node_modules/follow-redirects/debug.js +15 -0
  299. package/utils/node_modules/follow-redirects/http.js +1 -0
  300. package/utils/node_modules/follow-redirects/https.js +1 -0
  301. package/utils/node_modules/follow-redirects/index.js +672 -0
  302. package/utils/node_modules/follow-redirects/package.json +58 -0
  303. package/utils/node_modules/form-data/License +19 -0
  304. package/utils/node_modules/form-data/README.md.bak +358 -0
  305. package/utils/node_modules/form-data/Readme.md +358 -0
  306. package/utils/node_modules/form-data/index.d.ts +62 -0
  307. package/utils/node_modules/form-data/lib/browser.js +2 -0
  308. package/utils/node_modules/form-data/lib/form_data.js +501 -0
  309. package/utils/node_modules/form-data/lib/populate.js +10 -0
  310. package/utils/node_modules/form-data/package.json +68 -0
  311. package/utils/node_modules/mime-db/HISTORY.md +507 -0
  312. package/utils/node_modules/mime-db/LICENSE +23 -0
  313. package/utils/node_modules/mime-db/README.md +100 -0
  314. package/utils/node_modules/mime-db/db.json +8519 -0
  315. package/utils/node_modules/mime-db/index.js +12 -0
  316. package/utils/node_modules/mime-db/package.json +60 -0
  317. package/utils/node_modules/mime-types/HISTORY.md +397 -0
  318. package/utils/node_modules/mime-types/LICENSE +23 -0
  319. package/utils/node_modules/mime-types/README.md +113 -0
  320. package/utils/node_modules/mime-types/index.js +188 -0
  321. package/utils/node_modules/mime-types/package.json +44 -0
  322. package/utils/node_modules/proxy-from-env/.eslintrc +29 -0
  323. package/utils/node_modules/proxy-from-env/.travis.yml +10 -0
  324. package/utils/node_modules/proxy-from-env/LICENSE +20 -0
  325. package/utils/node_modules/proxy-from-env/README.md +131 -0
  326. package/utils/node_modules/proxy-from-env/index.js +108 -0
  327. package/utils/node_modules/proxy-from-env/package.json +34 -0
  328. package/utils/node_modules/proxy-from-env/test.js +483 -0
  329. package/utils/package-lock.json +122 -0
  330. package/utils/package.json +6 -0
  331. package/utils/request/webhook.js +1 -0
@@ -0,0 +1,3737 @@
1
+ // Axios v1.7.4 Copyright (c) 2024 Matt Zabriskie and contributors
2
+ function bind(fn, thisArg) {
3
+ return function wrap() {
4
+ return fn.apply(thisArg, arguments);
5
+ };
6
+ }
7
+
8
+ // utils is a library of generic helper functions non-specific to axios
9
+
10
+ const {toString} = Object.prototype;
11
+ const {getPrototypeOf} = Object;
12
+
13
+ const kindOf = (cache => thing => {
14
+ const str = toString.call(thing);
15
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
16
+ })(Object.create(null));
17
+
18
+ const kindOfTest = (type) => {
19
+ type = type.toLowerCase();
20
+ return (thing) => kindOf(thing) === type
21
+ };
22
+
23
+ const typeOfTest = type => thing => typeof thing === type;
24
+
25
+ /**
26
+ * Determine if a value is an Array
27
+ *
28
+ * @param {Object} val The value to test
29
+ *
30
+ * @returns {boolean} True if value is an Array, otherwise false
31
+ */
32
+ const {isArray} = Array;
33
+
34
+ /**
35
+ * Determine if a value is undefined
36
+ *
37
+ * @param {*} val The value to test
38
+ *
39
+ * @returns {boolean} True if the value is undefined, otherwise false
40
+ */
41
+ const isUndefined = typeOfTest('undefined');
42
+
43
+ /**
44
+ * Determine if a value is a Buffer
45
+ *
46
+ * @param {*} val The value to test
47
+ *
48
+ * @returns {boolean} True if value is a Buffer, otherwise false
49
+ */
50
+ function isBuffer(val) {
51
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
52
+ && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
53
+ }
54
+
55
+ /**
56
+ * Determine if a value is an ArrayBuffer
57
+ *
58
+ * @param {*} val The value to test
59
+ *
60
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
61
+ */
62
+ const isArrayBuffer = kindOfTest('ArrayBuffer');
63
+
64
+
65
+ /**
66
+ * Determine if a value is a view on an ArrayBuffer
67
+ *
68
+ * @param {*} val The value to test
69
+ *
70
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
71
+ */
72
+ function isArrayBufferView(val) {
73
+ let result;
74
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
75
+ result = ArrayBuffer.isView(val);
76
+ } else {
77
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
78
+ }
79
+ return result;
80
+ }
81
+
82
+ /**
83
+ * Determine if a value is a String
84
+ *
85
+ * @param {*} val The value to test
86
+ *
87
+ * @returns {boolean} True if value is a String, otherwise false
88
+ */
89
+ const isString = typeOfTest('string');
90
+
91
+ /**
92
+ * Determine if a value is a Function
93
+ *
94
+ * @param {*} val The value to test
95
+ * @returns {boolean} True if value is a Function, otherwise false
96
+ */
97
+ const isFunction = typeOfTest('function');
98
+
99
+ /**
100
+ * Determine if a value is a Number
101
+ *
102
+ * @param {*} val The value to test
103
+ *
104
+ * @returns {boolean} True if value is a Number, otherwise false
105
+ */
106
+ const isNumber = typeOfTest('number');
107
+
108
+ /**
109
+ * Determine if a value is an Object
110
+ *
111
+ * @param {*} thing The value to test
112
+ *
113
+ * @returns {boolean} True if value is an Object, otherwise false
114
+ */
115
+ const isObject = (thing) => thing !== null && typeof thing === 'object';
116
+
117
+ /**
118
+ * Determine if a value is a Boolean
119
+ *
120
+ * @param {*} thing The value to test
121
+ * @returns {boolean} True if value is a Boolean, otherwise false
122
+ */
123
+ const isBoolean = thing => thing === true || thing === false;
124
+
125
+ /**
126
+ * Determine if a value is a plain Object
127
+ *
128
+ * @param {*} val The value to test
129
+ *
130
+ * @returns {boolean} True if value is a plain Object, otherwise false
131
+ */
132
+ const isPlainObject = (val) => {
133
+ if (kindOf(val) !== 'object') {
134
+ return false;
135
+ }
136
+
137
+ const prototype = getPrototypeOf(val);
138
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
139
+ };
140
+
141
+ /**
142
+ * Determine if a value is a Date
143
+ *
144
+ * @param {*} val The value to test
145
+ *
146
+ * @returns {boolean} True if value is a Date, otherwise false
147
+ */
148
+ const isDate = kindOfTest('Date');
149
+
150
+ /**
151
+ * Determine if a value is a File
152
+ *
153
+ * @param {*} val The value to test
154
+ *
155
+ * @returns {boolean} True if value is a File, otherwise false
156
+ */
157
+ const isFile = kindOfTest('File');
158
+
159
+ /**
160
+ * Determine if a value is a Blob
161
+ *
162
+ * @param {*} val The value to test
163
+ *
164
+ * @returns {boolean} True if value is a Blob, otherwise false
165
+ */
166
+ const isBlob = kindOfTest('Blob');
167
+
168
+ /**
169
+ * Determine if a value is a FileList
170
+ *
171
+ * @param {*} val The value to test
172
+ *
173
+ * @returns {boolean} True if value is a File, otherwise false
174
+ */
175
+ const isFileList = kindOfTest('FileList');
176
+
177
+ /**
178
+ * Determine if a value is a Stream
179
+ *
180
+ * @param {*} val The value to test
181
+ *
182
+ * @returns {boolean} True if value is a Stream, otherwise false
183
+ */
184
+ const isStream = (val) => isObject(val) && isFunction(val.pipe);
185
+
186
+ /**
187
+ * Determine if a value is a FormData
188
+ *
189
+ * @param {*} thing The value to test
190
+ *
191
+ * @returns {boolean} True if value is an FormData, otherwise false
192
+ */
193
+ const isFormData = (thing) => {
194
+ let kind;
195
+ return thing && (
196
+ (typeof FormData === 'function' && thing instanceof FormData) || (
197
+ isFunction(thing.append) && (
198
+ (kind = kindOf(thing)) === 'formdata' ||
199
+ // detect form-data instance
200
+ (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
201
+ )
202
+ )
203
+ )
204
+ };
205
+
206
+ /**
207
+ * Determine if a value is a URLSearchParams object
208
+ *
209
+ * @param {*} val The value to test
210
+ *
211
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
212
+ */
213
+ const isURLSearchParams = kindOfTest('URLSearchParams');
214
+
215
+ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
216
+
217
+ /**
218
+ * Trim excess whitespace off the beginning and end of a string
219
+ *
220
+ * @param {String} str The String to trim
221
+ *
222
+ * @returns {String} The String freed of excess whitespace
223
+ */
224
+ const trim = (str) => str.trim ?
225
+ str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
226
+
227
+ /**
228
+ * Iterate over an Array or an Object invoking a function for each item.
229
+ *
230
+ * If `obj` is an Array callback will be called passing
231
+ * the value, index, and complete array for each item.
232
+ *
233
+ * If 'obj' is an Object callback will be called passing
234
+ * the value, key, and complete object for each property.
235
+ *
236
+ * @param {Object|Array} obj The object to iterate
237
+ * @param {Function} fn The callback to invoke for each item
238
+ *
239
+ * @param {Boolean} [allOwnKeys = false]
240
+ * @returns {any}
241
+ */
242
+ function forEach(obj, fn, {allOwnKeys = false} = {}) {
243
+ // Don't bother if no value provided
244
+ if (obj === null || typeof obj === 'undefined') {
245
+ return;
246
+ }
247
+
248
+ let i;
249
+ let l;
250
+
251
+ // Force an array if not already something iterable
252
+ if (typeof obj !== 'object') {
253
+ /*eslint no-param-reassign:0*/
254
+ obj = [obj];
255
+ }
256
+
257
+ if (isArray(obj)) {
258
+ // Iterate over array values
259
+ for (i = 0, l = obj.length; i < l; i++) {
260
+ fn.call(null, obj[i], i, obj);
261
+ }
262
+ } else {
263
+ // Iterate over object keys
264
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
265
+ const len = keys.length;
266
+ let key;
267
+
268
+ for (i = 0; i < len; i++) {
269
+ key = keys[i];
270
+ fn.call(null, obj[key], key, obj);
271
+ }
272
+ }
273
+ }
274
+
275
+ function findKey(obj, key) {
276
+ key = key.toLowerCase();
277
+ const keys = Object.keys(obj);
278
+ let i = keys.length;
279
+ let _key;
280
+ while (i-- > 0) {
281
+ _key = keys[i];
282
+ if (key === _key.toLowerCase()) {
283
+ return _key;
284
+ }
285
+ }
286
+ return null;
287
+ }
288
+
289
+ const _global = (() => {
290
+ /*eslint no-undef:0*/
291
+ if (typeof globalThis !== "undefined") return globalThis;
292
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
293
+ })();
294
+
295
+ const isContextDefined = (context) => !isUndefined(context) && context !== _global;
296
+
297
+ /**
298
+ * Accepts varargs expecting each argument to be an object, then
299
+ * immutably merges the properties of each object and returns result.
300
+ *
301
+ * When multiple objects contain the same key the later object in
302
+ * the arguments list will take precedence.
303
+ *
304
+ * Example:
305
+ *
306
+ * ```js
307
+ * var result = merge({foo: 123}, {foo: 456});
308
+ * console.log(result.foo); // outputs 456
309
+ * ```
310
+ *
311
+ * @param {Object} obj1 Object to merge
312
+ *
313
+ * @returns {Object} Result of all merge properties
314
+ */
315
+ function merge(/* obj1, obj2, obj3, ... */) {
316
+ const {caseless} = isContextDefined(this) && this || {};
317
+ const result = {};
318
+ const assignValue = (val, key) => {
319
+ const targetKey = caseless && findKey(result, key) || key;
320
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
321
+ result[targetKey] = merge(result[targetKey], val);
322
+ } else if (isPlainObject(val)) {
323
+ result[targetKey] = merge({}, val);
324
+ } else if (isArray(val)) {
325
+ result[targetKey] = val.slice();
326
+ } else {
327
+ result[targetKey] = val;
328
+ }
329
+ };
330
+
331
+ for (let i = 0, l = arguments.length; i < l; i++) {
332
+ arguments[i] && forEach(arguments[i], assignValue);
333
+ }
334
+ return result;
335
+ }
336
+
337
+ /**
338
+ * Extends object a by mutably adding to it the properties of object b.
339
+ *
340
+ * @param {Object} a The object to be extended
341
+ * @param {Object} b The object to copy properties from
342
+ * @param {Object} thisArg The object to bind function to
343
+ *
344
+ * @param {Boolean} [allOwnKeys]
345
+ * @returns {Object} The resulting value of object a
346
+ */
347
+ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
348
+ forEach(b, (val, key) => {
349
+ if (thisArg && isFunction(val)) {
350
+ a[key] = bind(val, thisArg);
351
+ } else {
352
+ a[key] = val;
353
+ }
354
+ }, {allOwnKeys});
355
+ return a;
356
+ };
357
+
358
+ /**
359
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
360
+ *
361
+ * @param {string} content with BOM
362
+ *
363
+ * @returns {string} content value without BOM
364
+ */
365
+ const stripBOM = (content) => {
366
+ if (content.charCodeAt(0) === 0xFEFF) {
367
+ content = content.slice(1);
368
+ }
369
+ return content;
370
+ };
371
+
372
+ /**
373
+ * Inherit the prototype methods from one constructor into another
374
+ * @param {function} constructor
375
+ * @param {function} superConstructor
376
+ * @param {object} [props]
377
+ * @param {object} [descriptors]
378
+ *
379
+ * @returns {void}
380
+ */
381
+ const inherits = (constructor, superConstructor, props, descriptors) => {
382
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
383
+ constructor.prototype.constructor = constructor;
384
+ Object.defineProperty(constructor, 'super', {
385
+ value: superConstructor.prototype
386
+ });
387
+ props && Object.assign(constructor.prototype, props);
388
+ };
389
+
390
+ /**
391
+ * Resolve object with deep prototype chain to a flat object
392
+ * @param {Object} sourceObj source object
393
+ * @param {Object} [destObj]
394
+ * @param {Function|Boolean} [filter]
395
+ * @param {Function} [propFilter]
396
+ *
397
+ * @returns {Object}
398
+ */
399
+ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
400
+ let props;
401
+ let i;
402
+ let prop;
403
+ const merged = {};
404
+
405
+ destObj = destObj || {};
406
+ // eslint-disable-next-line no-eq-null,eqeqeq
407
+ if (sourceObj == null) return destObj;
408
+
409
+ do {
410
+ props = Object.getOwnPropertyNames(sourceObj);
411
+ i = props.length;
412
+ while (i-- > 0) {
413
+ prop = props[i];
414
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
415
+ destObj[prop] = sourceObj[prop];
416
+ merged[prop] = true;
417
+ }
418
+ }
419
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
420
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
421
+
422
+ return destObj;
423
+ };
424
+
425
+ /**
426
+ * Determines whether a string ends with the characters of a specified string
427
+ *
428
+ * @param {String} str
429
+ * @param {String} searchString
430
+ * @param {Number} [position= 0]
431
+ *
432
+ * @returns {boolean}
433
+ */
434
+ const endsWith = (str, searchString, position) => {
435
+ str = String(str);
436
+ if (position === undefined || position > str.length) {
437
+ position = str.length;
438
+ }
439
+ position -= searchString.length;
440
+ const lastIndex = str.indexOf(searchString, position);
441
+ return lastIndex !== -1 && lastIndex === position;
442
+ };
443
+
444
+
445
+ /**
446
+ * Returns new array from array like object or null if failed
447
+ *
448
+ * @param {*} [thing]
449
+ *
450
+ * @returns {?Array}
451
+ */
452
+ const toArray = (thing) => {
453
+ if (!thing) return null;
454
+ if (isArray(thing)) return thing;
455
+ let i = thing.length;
456
+ if (!isNumber(i)) return null;
457
+ const arr = new Array(i);
458
+ while (i-- > 0) {
459
+ arr[i] = thing[i];
460
+ }
461
+ return arr;
462
+ };
463
+
464
+ /**
465
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
466
+ * thing passed in is an instance of Uint8Array
467
+ *
468
+ * @param {TypedArray}
469
+ *
470
+ * @returns {Array}
471
+ */
472
+ // eslint-disable-next-line func-names
473
+ const isTypedArray = (TypedArray => {
474
+ // eslint-disable-next-line func-names
475
+ return thing => {
476
+ return TypedArray && thing instanceof TypedArray;
477
+ };
478
+ })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
479
+
480
+ /**
481
+ * For each entry in the object, call the function with the key and value.
482
+ *
483
+ * @param {Object<any, any>} obj - The object to iterate over.
484
+ * @param {Function} fn - The function to call for each entry.
485
+ *
486
+ * @returns {void}
487
+ */
488
+ const forEachEntry = (obj, fn) => {
489
+ const generator = obj && obj[Symbol.iterator];
490
+
491
+ const iterator = generator.call(obj);
492
+
493
+ let result;
494
+
495
+ while ((result = iterator.next()) && !result.done) {
496
+ const pair = result.value;
497
+ fn.call(obj, pair[0], pair[1]);
498
+ }
499
+ };
500
+
501
+ /**
502
+ * It takes a regular expression and a string, and returns an array of all the matches
503
+ *
504
+ * @param {string} regExp - The regular expression to match against.
505
+ * @param {string} str - The string to search.
506
+ *
507
+ * @returns {Array<boolean>}
508
+ */
509
+ const matchAll = (regExp, str) => {
510
+ let matches;
511
+ const arr = [];
512
+
513
+ while ((matches = regExp.exec(str)) !== null) {
514
+ arr.push(matches);
515
+ }
516
+
517
+ return arr;
518
+ };
519
+
520
+ /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
521
+ const isHTMLForm = kindOfTest('HTMLFormElement');
522
+
523
+ const toCamelCase = str => {
524
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
525
+ function replacer(m, p1, p2) {
526
+ return p1.toUpperCase() + p2;
527
+ }
528
+ );
529
+ };
530
+
531
+ /* Creating a function that will check if an object has a property. */
532
+ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
533
+
534
+ /**
535
+ * Determine if a value is a RegExp object
536
+ *
537
+ * @param {*} val The value to test
538
+ *
539
+ * @returns {boolean} True if value is a RegExp object, otherwise false
540
+ */
541
+ const isRegExp = kindOfTest('RegExp');
542
+
543
+ const reduceDescriptors = (obj, reducer) => {
544
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
545
+ const reducedDescriptors = {};
546
+
547
+ forEach(descriptors, (descriptor, name) => {
548
+ let ret;
549
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
550
+ reducedDescriptors[name] = ret || descriptor;
551
+ }
552
+ });
553
+
554
+ Object.defineProperties(obj, reducedDescriptors);
555
+ };
556
+
557
+ /**
558
+ * Makes all methods read-only
559
+ * @param {Object} obj
560
+ */
561
+
562
+ const freezeMethods = (obj) => {
563
+ reduceDescriptors(obj, (descriptor, name) => {
564
+ // skip restricted props in strict mode
565
+ if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
566
+ return false;
567
+ }
568
+
569
+ const value = obj[name];
570
+
571
+ if (!isFunction(value)) return;
572
+
573
+ descriptor.enumerable = false;
574
+
575
+ if ('writable' in descriptor) {
576
+ descriptor.writable = false;
577
+ return;
578
+ }
579
+
580
+ if (!descriptor.set) {
581
+ descriptor.set = () => {
582
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
583
+ };
584
+ }
585
+ });
586
+ };
587
+
588
+ const toObjectSet = (arrayOrString, delimiter) => {
589
+ const obj = {};
590
+
591
+ const define = (arr) => {
592
+ arr.forEach(value => {
593
+ obj[value] = true;
594
+ });
595
+ };
596
+
597
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
598
+
599
+ return obj;
600
+ };
601
+
602
+ const noop = () => {};
603
+
604
+ const toFiniteNumber = (value, defaultValue) => {
605
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
606
+ };
607
+
608
+ const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
609
+
610
+ const DIGIT = '0123456789';
611
+
612
+ const ALPHABET = {
613
+ DIGIT,
614
+ ALPHA,
615
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
616
+ };
617
+
618
+ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
619
+ let str = '';
620
+ const {length} = alphabet;
621
+ while (size--) {
622
+ str += alphabet[Math.random() * length|0];
623
+ }
624
+
625
+ return str;
626
+ };
627
+
628
+ /**
629
+ * If the thing is a FormData object, return true, otherwise return false.
630
+ *
631
+ * @param {unknown} thing - The thing to check.
632
+ *
633
+ * @returns {boolean}
634
+ */
635
+ function isSpecCompliantForm(thing) {
636
+ return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
637
+ }
638
+
639
+ const toJSONObject = (obj) => {
640
+ const stack = new Array(10);
641
+
642
+ const visit = (source, i) => {
643
+
644
+ if (isObject(source)) {
645
+ if (stack.indexOf(source) >= 0) {
646
+ return;
647
+ }
648
+
649
+ if(!('toJSON' in source)) {
650
+ stack[i] = source;
651
+ const target = isArray(source) ? [] : {};
652
+
653
+ forEach(source, (value, key) => {
654
+ const reducedValue = visit(value, i + 1);
655
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
656
+ });
657
+
658
+ stack[i] = undefined;
659
+
660
+ return target;
661
+ }
662
+ }
663
+
664
+ return source;
665
+ };
666
+
667
+ return visit(obj, 0);
668
+ };
669
+
670
+ const isAsyncFn = kindOfTest('AsyncFunction');
671
+
672
+ const isThenable = (thing) =>
673
+ thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
674
+
675
+ // original code
676
+ // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
677
+
678
+ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
679
+ if (setImmediateSupported) {
680
+ return setImmediate;
681
+ }
682
+
683
+ return postMessageSupported ? ((token, callbacks) => {
684
+ _global.addEventListener("message", ({source, data}) => {
685
+ if (source === _global && data === token) {
686
+ callbacks.length && callbacks.shift()();
687
+ }
688
+ }, false);
689
+
690
+ return (cb) => {
691
+ callbacks.push(cb);
692
+ _global.postMessage(token, "*");
693
+ }
694
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
695
+ })(
696
+ typeof setImmediate === 'function',
697
+ isFunction(_global.postMessage)
698
+ );
699
+
700
+ const asap = typeof queueMicrotask !== 'undefined' ?
701
+ queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
702
+
703
+ // *********************
704
+
705
+ const utils$1 = {
706
+ isArray,
707
+ isArrayBuffer,
708
+ isBuffer,
709
+ isFormData,
710
+ isArrayBufferView,
711
+ isString,
712
+ isNumber,
713
+ isBoolean,
714
+ isObject,
715
+ isPlainObject,
716
+ isReadableStream,
717
+ isRequest,
718
+ isResponse,
719
+ isHeaders,
720
+ isUndefined,
721
+ isDate,
722
+ isFile,
723
+ isBlob,
724
+ isRegExp,
725
+ isFunction,
726
+ isStream,
727
+ isURLSearchParams,
728
+ isTypedArray,
729
+ isFileList,
730
+ forEach,
731
+ merge,
732
+ extend,
733
+ trim,
734
+ stripBOM,
735
+ inherits,
736
+ toFlatObject,
737
+ kindOf,
738
+ kindOfTest,
739
+ endsWith,
740
+ toArray,
741
+ forEachEntry,
742
+ matchAll,
743
+ isHTMLForm,
744
+ hasOwnProperty,
745
+ hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
746
+ reduceDescriptors,
747
+ freezeMethods,
748
+ toObjectSet,
749
+ toCamelCase,
750
+ noop,
751
+ toFiniteNumber,
752
+ findKey,
753
+ global: _global,
754
+ isContextDefined,
755
+ ALPHABET,
756
+ generateString,
757
+ isSpecCompliantForm,
758
+ toJSONObject,
759
+ isAsyncFn,
760
+ isThenable,
761
+ setImmediate: _setImmediate,
762
+ asap
763
+ };
764
+
765
+ /**
766
+ * Create an Error with the specified message, config, error code, request and response.
767
+ *
768
+ * @param {string} message The error message.
769
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
770
+ * @param {Object} [config] The config.
771
+ * @param {Object} [request] The request.
772
+ * @param {Object} [response] The response.
773
+ *
774
+ * @returns {Error} The created error.
775
+ */
776
+ function AxiosError$1(message, code, config, request, response) {
777
+ Error.call(this);
778
+
779
+ if (Error.captureStackTrace) {
780
+ Error.captureStackTrace(this, this.constructor);
781
+ } else {
782
+ this.stack = (new Error()).stack;
783
+ }
784
+
785
+ this.message = message;
786
+ this.name = 'AxiosError';
787
+ code && (this.code = code);
788
+ config && (this.config = config);
789
+ request && (this.request = request);
790
+ response && (this.response = response);
791
+ }
792
+
793
+ utils$1.inherits(AxiosError$1, Error, {
794
+ toJSON: function toJSON() {
795
+ return {
796
+ // Standard
797
+ message: this.message,
798
+ name: this.name,
799
+ // Microsoft
800
+ description: this.description,
801
+ number: this.number,
802
+ // Mozilla
803
+ fileName: this.fileName,
804
+ lineNumber: this.lineNumber,
805
+ columnNumber: this.columnNumber,
806
+ stack: this.stack,
807
+ // Axios
808
+ config: utils$1.toJSONObject(this.config),
809
+ code: this.code,
810
+ status: this.response && this.response.status ? this.response.status : null
811
+ };
812
+ }
813
+ });
814
+
815
+ const prototype$1 = AxiosError$1.prototype;
816
+ const descriptors = {};
817
+
818
+ [
819
+ 'ERR_BAD_OPTION_VALUE',
820
+ 'ERR_BAD_OPTION',
821
+ 'ECONNABORTED',
822
+ 'ETIMEDOUT',
823
+ 'ERR_NETWORK',
824
+ 'ERR_FR_TOO_MANY_REDIRECTS',
825
+ 'ERR_DEPRECATED',
826
+ 'ERR_BAD_RESPONSE',
827
+ 'ERR_BAD_REQUEST',
828
+ 'ERR_CANCELED',
829
+ 'ERR_NOT_SUPPORT',
830
+ 'ERR_INVALID_URL'
831
+ // eslint-disable-next-line func-names
832
+ ].forEach(code => {
833
+ descriptors[code] = {value: code};
834
+ });
835
+
836
+ Object.defineProperties(AxiosError$1, descriptors);
837
+ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
838
+
839
+ // eslint-disable-next-line func-names
840
+ AxiosError$1.from = (error, code, config, request, response, customProps) => {
841
+ const axiosError = Object.create(prototype$1);
842
+
843
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
844
+ return obj !== Error.prototype;
845
+ }, prop => {
846
+ return prop !== 'isAxiosError';
847
+ });
848
+
849
+ AxiosError$1.call(axiosError, error.message, code, config, request, response);
850
+
851
+ axiosError.cause = error;
852
+
853
+ axiosError.name = error.name;
854
+
855
+ customProps && Object.assign(axiosError, customProps);
856
+
857
+ return axiosError;
858
+ };
859
+
860
+ // eslint-disable-next-line strict
861
+ const httpAdapter = null;
862
+
863
+ /**
864
+ * Determines if the given thing is a array or js object.
865
+ *
866
+ * @param {string} thing - The object or array to be visited.
867
+ *
868
+ * @returns {boolean}
869
+ */
870
+ function isVisitable(thing) {
871
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
872
+ }
873
+
874
+ /**
875
+ * It removes the brackets from the end of a string
876
+ *
877
+ * @param {string} key - The key of the parameter.
878
+ *
879
+ * @returns {string} the key without the brackets.
880
+ */
881
+ function removeBrackets(key) {
882
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
883
+ }
884
+
885
+ /**
886
+ * It takes a path, a key, and a boolean, and returns a string
887
+ *
888
+ * @param {string} path - The path to the current key.
889
+ * @param {string} key - The key of the current object being iterated over.
890
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
891
+ *
892
+ * @returns {string} The path to the current key.
893
+ */
894
+ function renderKey(path, key, dots) {
895
+ if (!path) return key;
896
+ return path.concat(key).map(function each(token, i) {
897
+ // eslint-disable-next-line no-param-reassign
898
+ token = removeBrackets(token);
899
+ return !dots && i ? '[' + token + ']' : token;
900
+ }).join(dots ? '.' : '');
901
+ }
902
+
903
+ /**
904
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
905
+ *
906
+ * @param {Array<any>} arr - The array to check
907
+ *
908
+ * @returns {boolean}
909
+ */
910
+ function isFlatArray(arr) {
911
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
912
+ }
913
+
914
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
915
+ return /^is[A-Z]/.test(prop);
916
+ });
917
+
918
+ /**
919
+ * Convert a data object to FormData
920
+ *
921
+ * @param {Object} obj
922
+ * @param {?Object} [formData]
923
+ * @param {?Object} [options]
924
+ * @param {Function} [options.visitor]
925
+ * @param {Boolean} [options.metaTokens = true]
926
+ * @param {Boolean} [options.dots = false]
927
+ * @param {?Boolean} [options.indexes = false]
928
+ *
929
+ * @returns {Object}
930
+ **/
931
+
932
+ /**
933
+ * It converts an object into a FormData object
934
+ *
935
+ * @param {Object<any, any>} obj - The object to convert to form data.
936
+ * @param {string} formData - The FormData object to append to.
937
+ * @param {Object<string, any>} options
938
+ *
939
+ * @returns
940
+ */
941
+ function toFormData$1(obj, formData, options) {
942
+ if (!utils$1.isObject(obj)) {
943
+ throw new TypeError('target must be an object');
944
+ }
945
+
946
+ // eslint-disable-next-line no-param-reassign
947
+ formData = formData || new (FormData)();
948
+
949
+ // eslint-disable-next-line no-param-reassign
950
+ options = utils$1.toFlatObject(options, {
951
+ metaTokens: true,
952
+ dots: false,
953
+ indexes: false
954
+ }, false, function defined(option, source) {
955
+ // eslint-disable-next-line no-eq-null,eqeqeq
956
+ return !utils$1.isUndefined(source[option]);
957
+ });
958
+
959
+ const metaTokens = options.metaTokens;
960
+ // eslint-disable-next-line no-use-before-define
961
+ const visitor = options.visitor || defaultVisitor;
962
+ const dots = options.dots;
963
+ const indexes = options.indexes;
964
+ const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
965
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
966
+
967
+ if (!utils$1.isFunction(visitor)) {
968
+ throw new TypeError('visitor must be a function');
969
+ }
970
+
971
+ function convertValue(value) {
972
+ if (value === null) return '';
973
+
974
+ if (utils$1.isDate(value)) {
975
+ return value.toISOString();
976
+ }
977
+
978
+ if (!useBlob && utils$1.isBlob(value)) {
979
+ throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
980
+ }
981
+
982
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
983
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
984
+ }
985
+
986
+ return value;
987
+ }
988
+
989
+ /**
990
+ * Default visitor.
991
+ *
992
+ * @param {*} value
993
+ * @param {String|Number} key
994
+ * @param {Array<String|Number>} path
995
+ * @this {FormData}
996
+ *
997
+ * @returns {boolean} return true to visit the each prop of the value recursively
998
+ */
999
+ function defaultVisitor(value, key, path) {
1000
+ let arr = value;
1001
+
1002
+ if (value && !path && typeof value === 'object') {
1003
+ if (utils$1.endsWith(key, '{}')) {
1004
+ // eslint-disable-next-line no-param-reassign
1005
+ key = metaTokens ? key : key.slice(0, -2);
1006
+ // eslint-disable-next-line no-param-reassign
1007
+ value = JSON.stringify(value);
1008
+ } else if (
1009
+ (utils$1.isArray(value) && isFlatArray(value)) ||
1010
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
1011
+ )) {
1012
+ // eslint-disable-next-line no-param-reassign
1013
+ key = removeBrackets(key);
1014
+
1015
+ arr.forEach(function each(el, index) {
1016
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
1017
+ // eslint-disable-next-line no-nested-ternary
1018
+ indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
1019
+ convertValue(el)
1020
+ );
1021
+ });
1022
+ return false;
1023
+ }
1024
+ }
1025
+
1026
+ if (isVisitable(value)) {
1027
+ return true;
1028
+ }
1029
+
1030
+ formData.append(renderKey(path, key, dots), convertValue(value));
1031
+
1032
+ return false;
1033
+ }
1034
+
1035
+ const stack = [];
1036
+
1037
+ const exposedHelpers = Object.assign(predicates, {
1038
+ defaultVisitor,
1039
+ convertValue,
1040
+ isVisitable
1041
+ });
1042
+
1043
+ function build(value, path) {
1044
+ if (utils$1.isUndefined(value)) return;
1045
+
1046
+ if (stack.indexOf(value) !== -1) {
1047
+ throw Error('Circular reference detected in ' + path.join('.'));
1048
+ }
1049
+
1050
+ stack.push(value);
1051
+
1052
+ utils$1.forEach(value, function each(el, key) {
1053
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
1054
+ formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
1055
+ );
1056
+
1057
+ if (result === true) {
1058
+ build(el, path ? path.concat(key) : [key]);
1059
+ }
1060
+ });
1061
+
1062
+ stack.pop();
1063
+ }
1064
+
1065
+ if (!utils$1.isObject(obj)) {
1066
+ throw new TypeError('data must be an object');
1067
+ }
1068
+
1069
+ build(obj);
1070
+
1071
+ return formData;
1072
+ }
1073
+
1074
+ /**
1075
+ * It encodes a string by replacing all characters that are not in the unreserved set with
1076
+ * their percent-encoded equivalents
1077
+ *
1078
+ * @param {string} str - The string to encode.
1079
+ *
1080
+ * @returns {string} The encoded string.
1081
+ */
1082
+ function encode$1(str) {
1083
+ const charMap = {
1084
+ '!': '%21',
1085
+ "'": '%27',
1086
+ '(': '%28',
1087
+ ')': '%29',
1088
+ '~': '%7E',
1089
+ '%20': '+',
1090
+ '%00': '\x00'
1091
+ };
1092
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
1093
+ return charMap[match];
1094
+ });
1095
+ }
1096
+
1097
+ /**
1098
+ * It takes a params object and converts it to a FormData object
1099
+ *
1100
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
1101
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
1102
+ *
1103
+ * @returns {void}
1104
+ */
1105
+ function AxiosURLSearchParams(params, options) {
1106
+ this._pairs = [];
1107
+
1108
+ params && toFormData$1(params, this, options);
1109
+ }
1110
+
1111
+ const prototype = AxiosURLSearchParams.prototype;
1112
+
1113
+ prototype.append = function append(name, value) {
1114
+ this._pairs.push([name, value]);
1115
+ };
1116
+
1117
+ prototype.toString = function toString(encoder) {
1118
+ const _encode = encoder ? function(value) {
1119
+ return encoder.call(this, value, encode$1);
1120
+ } : encode$1;
1121
+
1122
+ return this._pairs.map(function each(pair) {
1123
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
1124
+ }, '').join('&');
1125
+ };
1126
+
1127
+ /**
1128
+ * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
1129
+ * URI encoded counterparts
1130
+ *
1131
+ * @param {string} val The value to be encoded.
1132
+ *
1133
+ * @returns {string} The encoded value.
1134
+ */
1135
+ function encode(val) {
1136
+ return encodeURIComponent(val).
1137
+ replace(/%3A/gi, ':').
1138
+ replace(/%24/g, '$').
1139
+ replace(/%2C/gi, ',').
1140
+ replace(/%20/g, '+').
1141
+ replace(/%5B/gi, '[').
1142
+ replace(/%5D/gi, ']');
1143
+ }
1144
+
1145
+ /**
1146
+ * Build a URL by appending params to the end
1147
+ *
1148
+ * @param {string} url The base of the url (e.g., http://www.google.com)
1149
+ * @param {object} [params] The params to be appended
1150
+ * @param {?object} options
1151
+ *
1152
+ * @returns {string} The formatted url
1153
+ */
1154
+ function buildURL(url, params, options) {
1155
+ /*eslint no-param-reassign:0*/
1156
+ if (!params) {
1157
+ return url;
1158
+ }
1159
+
1160
+ const _encode = options && options.encode || encode;
1161
+
1162
+ const serializeFn = options && options.serialize;
1163
+
1164
+ let serializedParams;
1165
+
1166
+ if (serializeFn) {
1167
+ serializedParams = serializeFn(params, options);
1168
+ } else {
1169
+ serializedParams = utils$1.isURLSearchParams(params) ?
1170
+ params.toString() :
1171
+ new AxiosURLSearchParams(params, options).toString(_encode);
1172
+ }
1173
+
1174
+ if (serializedParams) {
1175
+ const hashmarkIndex = url.indexOf("#");
1176
+
1177
+ if (hashmarkIndex !== -1) {
1178
+ url = url.slice(0, hashmarkIndex);
1179
+ }
1180
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1181
+ }
1182
+
1183
+ return url;
1184
+ }
1185
+
1186
+ class InterceptorManager {
1187
+ constructor() {
1188
+ this.handlers = [];
1189
+ }
1190
+
1191
+ /**
1192
+ * Add a new interceptor to the stack
1193
+ *
1194
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
1195
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
1196
+ *
1197
+ * @return {Number} An ID used to remove interceptor later
1198
+ */
1199
+ use(fulfilled, rejected, options) {
1200
+ this.handlers.push({
1201
+ fulfilled,
1202
+ rejected,
1203
+ synchronous: options ? options.synchronous : false,
1204
+ runWhen: options ? options.runWhen : null
1205
+ });
1206
+ return this.handlers.length - 1;
1207
+ }
1208
+
1209
+ /**
1210
+ * Remove an interceptor from the stack
1211
+ *
1212
+ * @param {Number} id The ID that was returned by `use`
1213
+ *
1214
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
1215
+ */
1216
+ eject(id) {
1217
+ if (this.handlers[id]) {
1218
+ this.handlers[id] = null;
1219
+ }
1220
+ }
1221
+
1222
+ /**
1223
+ * Clear all interceptors from the stack
1224
+ *
1225
+ * @returns {void}
1226
+ */
1227
+ clear() {
1228
+ if (this.handlers) {
1229
+ this.handlers = [];
1230
+ }
1231
+ }
1232
+
1233
+ /**
1234
+ * Iterate over all the registered interceptors
1235
+ *
1236
+ * This method is particularly useful for skipping over any
1237
+ * interceptors that may have become `null` calling `eject`.
1238
+ *
1239
+ * @param {Function} fn The function to call for each interceptor
1240
+ *
1241
+ * @returns {void}
1242
+ */
1243
+ forEach(fn) {
1244
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
1245
+ if (h !== null) {
1246
+ fn(h);
1247
+ }
1248
+ });
1249
+ }
1250
+ }
1251
+
1252
+ const InterceptorManager$1 = InterceptorManager;
1253
+
1254
+ const transitionalDefaults = {
1255
+ silentJSONParsing: true,
1256
+ forcedJSONParsing: true,
1257
+ clarifyTimeoutError: false
1258
+ };
1259
+
1260
+ const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
1261
+
1262
+ const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
1263
+
1264
+ const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
1265
+
1266
+ const platform$1 = {
1267
+ isBrowser: true,
1268
+ classes: {
1269
+ URLSearchParams: URLSearchParams$1,
1270
+ FormData: FormData$1,
1271
+ Blob: Blob$1
1272
+ },
1273
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
1274
+ };
1275
+
1276
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
1277
+
1278
+ /**
1279
+ * Determine if we're running in a standard browser environment
1280
+ *
1281
+ * This allows axios to run in a web worker, and react-native.
1282
+ * Both environments support XMLHttpRequest, but not fully standard globals.
1283
+ *
1284
+ * web workers:
1285
+ * typeof window -> undefined
1286
+ * typeof document -> undefined
1287
+ *
1288
+ * react-native:
1289
+ * navigator.product -> 'ReactNative'
1290
+ * nativescript
1291
+ * navigator.product -> 'NativeScript' or 'NS'
1292
+ *
1293
+ * @returns {boolean}
1294
+ */
1295
+ const hasStandardBrowserEnv = (
1296
+ (product) => {
1297
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
1298
+ })(typeof navigator !== 'undefined' && navigator.product);
1299
+
1300
+ /**
1301
+ * Determine if we're running in a standard browser webWorker environment
1302
+ *
1303
+ * Although the `isStandardBrowserEnv` method indicates that
1304
+ * `allows axios to run in a web worker`, the WebWorker will still be
1305
+ * filtered out due to its judgment standard
1306
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
1307
+ * This leads to a problem when axios post `FormData` in webWorker
1308
+ */
1309
+ const hasStandardBrowserWebWorkerEnv = (() => {
1310
+ return (
1311
+ typeof WorkerGlobalScope !== 'undefined' &&
1312
+ // eslint-disable-next-line no-undef
1313
+ self instanceof WorkerGlobalScope &&
1314
+ typeof self.importScripts === 'function'
1315
+ );
1316
+ })();
1317
+
1318
+ const origin = hasBrowserEnv && window.location.href || 'http://localhost';
1319
+
1320
+ const utils = /*#__PURE__*/Object.freeze({
1321
+ __proto__: null,
1322
+ hasBrowserEnv: hasBrowserEnv,
1323
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1324
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
1325
+ origin: origin
1326
+ });
1327
+
1328
+ const platform = {
1329
+ ...utils,
1330
+ ...platform$1
1331
+ };
1332
+
1333
+ function toURLEncodedForm(data, options) {
1334
+ return toFormData$1(data, new platform.classes.URLSearchParams(), Object.assign({
1335
+ visitor: function(value, key, path, helpers) {
1336
+ if (platform.isNode && utils$1.isBuffer(value)) {
1337
+ this.append(key, value.toString('base64'));
1338
+ return false;
1339
+ }
1340
+
1341
+ return helpers.defaultVisitor.apply(this, arguments);
1342
+ }
1343
+ }, options));
1344
+ }
1345
+
1346
+ /**
1347
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
1348
+ *
1349
+ * @param {string} name - The name of the property to get.
1350
+ *
1351
+ * @returns An array of strings.
1352
+ */
1353
+ function parsePropPath(name) {
1354
+ // foo[x][y][z]
1355
+ // foo.x.y.z
1356
+ // foo-x-y-z
1357
+ // foo x y z
1358
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
1359
+ return match[0] === '[]' ? '' : match[1] || match[0];
1360
+ });
1361
+ }
1362
+
1363
+ /**
1364
+ * Convert an array to an object.
1365
+ *
1366
+ * @param {Array<any>} arr - The array to convert to an object.
1367
+ *
1368
+ * @returns An object with the same keys and values as the array.
1369
+ */
1370
+ function arrayToObject(arr) {
1371
+ const obj = {};
1372
+ const keys = Object.keys(arr);
1373
+ let i;
1374
+ const len = keys.length;
1375
+ let key;
1376
+ for (i = 0; i < len; i++) {
1377
+ key = keys[i];
1378
+ obj[key] = arr[key];
1379
+ }
1380
+ return obj;
1381
+ }
1382
+
1383
+ /**
1384
+ * It takes a FormData object and returns a JavaScript object
1385
+ *
1386
+ * @param {string} formData The FormData object to convert to JSON.
1387
+ *
1388
+ * @returns {Object<string, any> | null} The converted object.
1389
+ */
1390
+ function formDataToJSON(formData) {
1391
+ function buildPath(path, value, target, index) {
1392
+ let name = path[index++];
1393
+
1394
+ if (name === '__proto__') return true;
1395
+
1396
+ const isNumericKey = Number.isFinite(+name);
1397
+ const isLast = index >= path.length;
1398
+ name = !name && utils$1.isArray(target) ? target.length : name;
1399
+
1400
+ if (isLast) {
1401
+ if (utils$1.hasOwnProp(target, name)) {
1402
+ target[name] = [target[name], value];
1403
+ } else {
1404
+ target[name] = value;
1405
+ }
1406
+
1407
+ return !isNumericKey;
1408
+ }
1409
+
1410
+ if (!target[name] || !utils$1.isObject(target[name])) {
1411
+ target[name] = [];
1412
+ }
1413
+
1414
+ const result = buildPath(path, value, target[name], index);
1415
+
1416
+ if (result && utils$1.isArray(target[name])) {
1417
+ target[name] = arrayToObject(target[name]);
1418
+ }
1419
+
1420
+ return !isNumericKey;
1421
+ }
1422
+
1423
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
1424
+ const obj = {};
1425
+
1426
+ utils$1.forEachEntry(formData, (name, value) => {
1427
+ buildPath(parsePropPath(name), value, obj, 0);
1428
+ });
1429
+
1430
+ return obj;
1431
+ }
1432
+
1433
+ return null;
1434
+ }
1435
+
1436
+ /**
1437
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
1438
+ * of the input
1439
+ *
1440
+ * @param {any} rawValue - The value to be stringified.
1441
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
1442
+ * @param {Function} encoder - A function that takes a value and returns a string.
1443
+ *
1444
+ * @returns {string} A stringified version of the rawValue.
1445
+ */
1446
+ function stringifySafely(rawValue, parser, encoder) {
1447
+ if (utils$1.isString(rawValue)) {
1448
+ try {
1449
+ (parser || JSON.parse)(rawValue);
1450
+ return utils$1.trim(rawValue);
1451
+ } catch (e) {
1452
+ if (e.name !== 'SyntaxError') {
1453
+ throw e;
1454
+ }
1455
+ }
1456
+ }
1457
+
1458
+ return (encoder || JSON.stringify)(rawValue);
1459
+ }
1460
+
1461
+ const defaults = {
1462
+
1463
+ transitional: transitionalDefaults,
1464
+
1465
+ adapter: ['xhr', 'http', 'fetch'],
1466
+
1467
+ transformRequest: [function transformRequest(data, headers) {
1468
+ const contentType = headers.getContentType() || '';
1469
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
1470
+ const isObjectPayload = utils$1.isObject(data);
1471
+
1472
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
1473
+ data = new FormData(data);
1474
+ }
1475
+
1476
+ const isFormData = utils$1.isFormData(data);
1477
+
1478
+ if (isFormData) {
1479
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
1480
+ }
1481
+
1482
+ if (utils$1.isArrayBuffer(data) ||
1483
+ utils$1.isBuffer(data) ||
1484
+ utils$1.isStream(data) ||
1485
+ utils$1.isFile(data) ||
1486
+ utils$1.isBlob(data) ||
1487
+ utils$1.isReadableStream(data)
1488
+ ) {
1489
+ return data;
1490
+ }
1491
+ if (utils$1.isArrayBufferView(data)) {
1492
+ return data.buffer;
1493
+ }
1494
+ if (utils$1.isURLSearchParams(data)) {
1495
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
1496
+ return data.toString();
1497
+ }
1498
+
1499
+ let isFileList;
1500
+
1501
+ if (isObjectPayload) {
1502
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
1503
+ return toURLEncodedForm(data, this.formSerializer).toString();
1504
+ }
1505
+
1506
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
1507
+ const _FormData = this.env && this.env.FormData;
1508
+
1509
+ return toFormData$1(
1510
+ isFileList ? {'files[]': data} : data,
1511
+ _FormData && new _FormData(),
1512
+ this.formSerializer
1513
+ );
1514
+ }
1515
+ }
1516
+
1517
+ if (isObjectPayload || hasJSONContentType ) {
1518
+ headers.setContentType('application/json', false);
1519
+ return stringifySafely(data);
1520
+ }
1521
+
1522
+ return data;
1523
+ }],
1524
+
1525
+ transformResponse: [function transformResponse(data) {
1526
+ const transitional = this.transitional || defaults.transitional;
1527
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
1528
+ const JSONRequested = this.responseType === 'json';
1529
+
1530
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
1531
+ return data;
1532
+ }
1533
+
1534
+ if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
1535
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
1536
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
1537
+
1538
+ try {
1539
+ return JSON.parse(data);
1540
+ } catch (e) {
1541
+ if (strictJSONParsing) {
1542
+ if (e.name === 'SyntaxError') {
1543
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
1544
+ }
1545
+ throw e;
1546
+ }
1547
+ }
1548
+ }
1549
+
1550
+ return data;
1551
+ }],
1552
+
1553
+ /**
1554
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
1555
+ * timeout is not created.
1556
+ */
1557
+ timeout: 0,
1558
+
1559
+ xsrfCookieName: 'XSRF-TOKEN',
1560
+ xsrfHeaderName: 'X-XSRF-TOKEN',
1561
+
1562
+ maxContentLength: -1,
1563
+ maxBodyLength: -1,
1564
+
1565
+ env: {
1566
+ FormData: platform.classes.FormData,
1567
+ Blob: platform.classes.Blob
1568
+ },
1569
+
1570
+ validateStatus: function validateStatus(status) {
1571
+ return status >= 200 && status < 300;
1572
+ },
1573
+
1574
+ headers: {
1575
+ common: {
1576
+ 'Accept': 'application/json, text/plain, */*',
1577
+ 'Content-Type': undefined
1578
+ }
1579
+ }
1580
+ };
1581
+
1582
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
1583
+ defaults.headers[method] = {};
1584
+ });
1585
+
1586
+ const defaults$1 = defaults;
1587
+
1588
+ // RawAxiosHeaders whose duplicates are ignored by node
1589
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
1590
+ const ignoreDuplicateOf = utils$1.toObjectSet([
1591
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
1592
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
1593
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
1594
+ 'referer', 'retry-after', 'user-agent'
1595
+ ]);
1596
+
1597
+ /**
1598
+ * Parse headers into an object
1599
+ *
1600
+ * ```
1601
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
1602
+ * Content-Type: application/json
1603
+ * Connection: keep-alive
1604
+ * Transfer-Encoding: chunked
1605
+ * ```
1606
+ *
1607
+ * @param {String} rawHeaders Headers needing to be parsed
1608
+ *
1609
+ * @returns {Object} Headers parsed into an object
1610
+ */
1611
+ const parseHeaders = rawHeaders => {
1612
+ const parsed = {};
1613
+ let key;
1614
+ let val;
1615
+ let i;
1616
+
1617
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
1618
+ i = line.indexOf(':');
1619
+ key = line.substring(0, i).trim().toLowerCase();
1620
+ val = line.substring(i + 1).trim();
1621
+
1622
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
1623
+ return;
1624
+ }
1625
+
1626
+ if (key === 'set-cookie') {
1627
+ if (parsed[key]) {
1628
+ parsed[key].push(val);
1629
+ } else {
1630
+ parsed[key] = [val];
1631
+ }
1632
+ } else {
1633
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1634
+ }
1635
+ });
1636
+
1637
+ return parsed;
1638
+ };
1639
+
1640
+ const $internals = Symbol('internals');
1641
+
1642
+ function normalizeHeader(header) {
1643
+ return header && String(header).trim().toLowerCase();
1644
+ }
1645
+
1646
+ function normalizeValue(value) {
1647
+ if (value === false || value == null) {
1648
+ return value;
1649
+ }
1650
+
1651
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
1652
+ }
1653
+
1654
+ function parseTokens(str) {
1655
+ const tokens = Object.create(null);
1656
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1657
+ let match;
1658
+
1659
+ while ((match = tokensRE.exec(str))) {
1660
+ tokens[match[1]] = match[2];
1661
+ }
1662
+
1663
+ return tokens;
1664
+ }
1665
+
1666
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1667
+
1668
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1669
+ if (utils$1.isFunction(filter)) {
1670
+ return filter.call(this, value, header);
1671
+ }
1672
+
1673
+ if (isHeaderNameFilter) {
1674
+ value = header;
1675
+ }
1676
+
1677
+ if (!utils$1.isString(value)) return;
1678
+
1679
+ if (utils$1.isString(filter)) {
1680
+ return value.indexOf(filter) !== -1;
1681
+ }
1682
+
1683
+ if (utils$1.isRegExp(filter)) {
1684
+ return filter.test(value);
1685
+ }
1686
+ }
1687
+
1688
+ function formatHeader(header) {
1689
+ return header.trim()
1690
+ .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1691
+ return char.toUpperCase() + str;
1692
+ });
1693
+ }
1694
+
1695
+ function buildAccessors(obj, header) {
1696
+ const accessorName = utils$1.toCamelCase(' ' + header);
1697
+
1698
+ ['get', 'set', 'has'].forEach(methodName => {
1699
+ Object.defineProperty(obj, methodName + accessorName, {
1700
+ value: function(arg1, arg2, arg3) {
1701
+ return this[methodName].call(this, header, arg1, arg2, arg3);
1702
+ },
1703
+ configurable: true
1704
+ });
1705
+ });
1706
+ }
1707
+
1708
+ class AxiosHeaders$1 {
1709
+ constructor(headers) {
1710
+ headers && this.set(headers);
1711
+ }
1712
+
1713
+ set(header, valueOrRewrite, rewrite) {
1714
+ const self = this;
1715
+
1716
+ function setHeader(_value, _header, _rewrite) {
1717
+ const lHeader = normalizeHeader(_header);
1718
+
1719
+ if (!lHeader) {
1720
+ throw new Error('header name must be a non-empty string');
1721
+ }
1722
+
1723
+ const key = utils$1.findKey(self, lHeader);
1724
+
1725
+ if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
1726
+ self[key || _header] = normalizeValue(_value);
1727
+ }
1728
+ }
1729
+
1730
+ const setHeaders = (headers, _rewrite) =>
1731
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1732
+
1733
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
1734
+ setHeaders(header, valueOrRewrite);
1735
+ } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1736
+ setHeaders(parseHeaders(header), valueOrRewrite);
1737
+ } else if (utils$1.isHeaders(header)) {
1738
+ for (const [key, value] of header.entries()) {
1739
+ setHeader(value, key, rewrite);
1740
+ }
1741
+ } else {
1742
+ header != null && setHeader(valueOrRewrite, header, rewrite);
1743
+ }
1744
+
1745
+ return this;
1746
+ }
1747
+
1748
+ get(header, parser) {
1749
+ header = normalizeHeader(header);
1750
+
1751
+ if (header) {
1752
+ const key = utils$1.findKey(this, header);
1753
+
1754
+ if (key) {
1755
+ const value = this[key];
1756
+
1757
+ if (!parser) {
1758
+ return value;
1759
+ }
1760
+
1761
+ if (parser === true) {
1762
+ return parseTokens(value);
1763
+ }
1764
+
1765
+ if (utils$1.isFunction(parser)) {
1766
+ return parser.call(this, value, key);
1767
+ }
1768
+
1769
+ if (utils$1.isRegExp(parser)) {
1770
+ return parser.exec(value);
1771
+ }
1772
+
1773
+ throw new TypeError('parser must be boolean|regexp|function');
1774
+ }
1775
+ }
1776
+ }
1777
+
1778
+ has(header, matcher) {
1779
+ header = normalizeHeader(header);
1780
+
1781
+ if (header) {
1782
+ const key = utils$1.findKey(this, header);
1783
+
1784
+ return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1785
+ }
1786
+
1787
+ return false;
1788
+ }
1789
+
1790
+ delete(header, matcher) {
1791
+ const self = this;
1792
+ let deleted = false;
1793
+
1794
+ function deleteHeader(_header) {
1795
+ _header = normalizeHeader(_header);
1796
+
1797
+ if (_header) {
1798
+ const key = utils$1.findKey(self, _header);
1799
+
1800
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
1801
+ delete self[key];
1802
+
1803
+ deleted = true;
1804
+ }
1805
+ }
1806
+ }
1807
+
1808
+ if (utils$1.isArray(header)) {
1809
+ header.forEach(deleteHeader);
1810
+ } else {
1811
+ deleteHeader(header);
1812
+ }
1813
+
1814
+ return deleted;
1815
+ }
1816
+
1817
+ clear(matcher) {
1818
+ const keys = Object.keys(this);
1819
+ let i = keys.length;
1820
+ let deleted = false;
1821
+
1822
+ while (i--) {
1823
+ const key = keys[i];
1824
+ if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1825
+ delete this[key];
1826
+ deleted = true;
1827
+ }
1828
+ }
1829
+
1830
+ return deleted;
1831
+ }
1832
+
1833
+ normalize(format) {
1834
+ const self = this;
1835
+ const headers = {};
1836
+
1837
+ utils$1.forEach(this, (value, header) => {
1838
+ const key = utils$1.findKey(headers, header);
1839
+
1840
+ if (key) {
1841
+ self[key] = normalizeValue(value);
1842
+ delete self[header];
1843
+ return;
1844
+ }
1845
+
1846
+ const normalized = format ? formatHeader(header) : String(header).trim();
1847
+
1848
+ if (normalized !== header) {
1849
+ delete self[header];
1850
+ }
1851
+
1852
+ self[normalized] = normalizeValue(value);
1853
+
1854
+ headers[normalized] = true;
1855
+ });
1856
+
1857
+ return this;
1858
+ }
1859
+
1860
+ concat(...targets) {
1861
+ return this.constructor.concat(this, ...targets);
1862
+ }
1863
+
1864
+ toJSON(asStrings) {
1865
+ const obj = Object.create(null);
1866
+
1867
+ utils$1.forEach(this, (value, header) => {
1868
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
1869
+ });
1870
+
1871
+ return obj;
1872
+ }
1873
+
1874
+ [Symbol.iterator]() {
1875
+ return Object.entries(this.toJSON())[Symbol.iterator]();
1876
+ }
1877
+
1878
+ toString() {
1879
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
1880
+ }
1881
+
1882
+ get [Symbol.toStringTag]() {
1883
+ return 'AxiosHeaders';
1884
+ }
1885
+
1886
+ static from(thing) {
1887
+ return thing instanceof this ? thing : new this(thing);
1888
+ }
1889
+
1890
+ static concat(first, ...targets) {
1891
+ const computed = new this(first);
1892
+
1893
+ targets.forEach((target) => computed.set(target));
1894
+
1895
+ return computed;
1896
+ }
1897
+
1898
+ static accessor(header) {
1899
+ const internals = this[$internals] = (this[$internals] = {
1900
+ accessors: {}
1901
+ });
1902
+
1903
+ const accessors = internals.accessors;
1904
+ const prototype = this.prototype;
1905
+
1906
+ function defineAccessor(_header) {
1907
+ const lHeader = normalizeHeader(_header);
1908
+
1909
+ if (!accessors[lHeader]) {
1910
+ buildAccessors(prototype, _header);
1911
+ accessors[lHeader] = true;
1912
+ }
1913
+ }
1914
+
1915
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1916
+
1917
+ return this;
1918
+ }
1919
+ }
1920
+
1921
+ AxiosHeaders$1.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
1922
+
1923
+ // reserved names hotfix
1924
+ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
1925
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
1926
+ return {
1927
+ get: () => value,
1928
+ set(headerValue) {
1929
+ this[mapped] = headerValue;
1930
+ }
1931
+ }
1932
+ });
1933
+
1934
+ utils$1.freezeMethods(AxiosHeaders$1);
1935
+
1936
+ const AxiosHeaders$2 = AxiosHeaders$1;
1937
+
1938
+ /**
1939
+ * Transform the data for a request or a response
1940
+ *
1941
+ * @param {Array|Function} fns A single function or Array of functions
1942
+ * @param {?Object} response The response object
1943
+ *
1944
+ * @returns {*} The resulting transformed data
1945
+ */
1946
+ function transformData(fns, response) {
1947
+ const config = this || defaults$1;
1948
+ const context = response || config;
1949
+ const headers = AxiosHeaders$2.from(context.headers);
1950
+ let data = context.data;
1951
+
1952
+ utils$1.forEach(fns, function transform(fn) {
1953
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
1954
+ });
1955
+
1956
+ headers.normalize();
1957
+
1958
+ return data;
1959
+ }
1960
+
1961
+ function isCancel$1(value) {
1962
+ return !!(value && value.__CANCEL__);
1963
+ }
1964
+
1965
+ /**
1966
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
1967
+ *
1968
+ * @param {string=} message The message.
1969
+ * @param {Object=} config The config.
1970
+ * @param {Object=} request The request.
1971
+ *
1972
+ * @returns {CanceledError} The created error.
1973
+ */
1974
+ function CanceledError$1(message, config, request) {
1975
+ // eslint-disable-next-line no-eq-null,eqeqeq
1976
+ AxiosError$1.call(this, message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
1977
+ this.name = 'CanceledError';
1978
+ }
1979
+
1980
+ utils$1.inherits(CanceledError$1, AxiosError$1, {
1981
+ __CANCEL__: true
1982
+ });
1983
+
1984
+ /**
1985
+ * Resolve or reject a Promise based on response status.
1986
+ *
1987
+ * @param {Function} resolve A function that resolves the promise.
1988
+ * @param {Function} reject A function that rejects the promise.
1989
+ * @param {object} response The response.
1990
+ *
1991
+ * @returns {object} The response.
1992
+ */
1993
+ function settle(resolve, reject, response) {
1994
+ const validateStatus = response.config.validateStatus;
1995
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
1996
+ resolve(response);
1997
+ } else {
1998
+ reject(new AxiosError$1(
1999
+ 'Request failed with status code ' + response.status,
2000
+ [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2001
+ response.config,
2002
+ response.request,
2003
+ response
2004
+ ));
2005
+ }
2006
+ }
2007
+
2008
+ function parseProtocol(url) {
2009
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
2010
+ return match && match[1] || '';
2011
+ }
2012
+
2013
+ /**
2014
+ * Calculate data maxRate
2015
+ * @param {Number} [samplesCount= 10]
2016
+ * @param {Number} [min= 1000]
2017
+ * @returns {Function}
2018
+ */
2019
+ function speedometer(samplesCount, min) {
2020
+ samplesCount = samplesCount || 10;
2021
+ const bytes = new Array(samplesCount);
2022
+ const timestamps = new Array(samplesCount);
2023
+ let head = 0;
2024
+ let tail = 0;
2025
+ let firstSampleTS;
2026
+
2027
+ min = min !== undefined ? min : 1000;
2028
+
2029
+ return function push(chunkLength) {
2030
+ const now = Date.now();
2031
+
2032
+ const startedAt = timestamps[tail];
2033
+
2034
+ if (!firstSampleTS) {
2035
+ firstSampleTS = now;
2036
+ }
2037
+
2038
+ bytes[head] = chunkLength;
2039
+ timestamps[head] = now;
2040
+
2041
+ let i = tail;
2042
+ let bytesCount = 0;
2043
+
2044
+ while (i !== head) {
2045
+ bytesCount += bytes[i++];
2046
+ i = i % samplesCount;
2047
+ }
2048
+
2049
+ head = (head + 1) % samplesCount;
2050
+
2051
+ if (head === tail) {
2052
+ tail = (tail + 1) % samplesCount;
2053
+ }
2054
+
2055
+ if (now - firstSampleTS < min) {
2056
+ return;
2057
+ }
2058
+
2059
+ const passed = startedAt && now - startedAt;
2060
+
2061
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
2062
+ };
2063
+ }
2064
+
2065
+ /**
2066
+ * Throttle decorator
2067
+ * @param {Function} fn
2068
+ * @param {Number} freq
2069
+ * @return {Function}
2070
+ */
2071
+ function throttle(fn, freq) {
2072
+ let timestamp = 0;
2073
+ let threshold = 1000 / freq;
2074
+ let lastArgs;
2075
+ let timer;
2076
+
2077
+ const invoke = (args, now = Date.now()) => {
2078
+ timestamp = now;
2079
+ lastArgs = null;
2080
+ if (timer) {
2081
+ clearTimeout(timer);
2082
+ timer = null;
2083
+ }
2084
+ fn.apply(null, args);
2085
+ };
2086
+
2087
+ const throttled = (...args) => {
2088
+ const now = Date.now();
2089
+ const passed = now - timestamp;
2090
+ if ( passed >= threshold) {
2091
+ invoke(args, now);
2092
+ } else {
2093
+ lastArgs = args;
2094
+ if (!timer) {
2095
+ timer = setTimeout(() => {
2096
+ timer = null;
2097
+ invoke(lastArgs);
2098
+ }, threshold - passed);
2099
+ }
2100
+ }
2101
+ };
2102
+
2103
+ const flush = () => lastArgs && invoke(lastArgs);
2104
+
2105
+ return [throttled, flush];
2106
+ }
2107
+
2108
+ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
2109
+ let bytesNotified = 0;
2110
+ const _speedometer = speedometer(50, 250);
2111
+
2112
+ return throttle(e => {
2113
+ const loaded = e.loaded;
2114
+ const total = e.lengthComputable ? e.total : undefined;
2115
+ const progressBytes = loaded - bytesNotified;
2116
+ const rate = _speedometer(progressBytes);
2117
+ const inRange = loaded <= total;
2118
+
2119
+ bytesNotified = loaded;
2120
+
2121
+ const data = {
2122
+ loaded,
2123
+ total,
2124
+ progress: total ? (loaded / total) : undefined,
2125
+ bytes: progressBytes,
2126
+ rate: rate ? rate : undefined,
2127
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
2128
+ event: e,
2129
+ lengthComputable: total != null,
2130
+ [isDownloadStream ? 'download' : 'upload']: true
2131
+ };
2132
+
2133
+ listener(data);
2134
+ }, freq);
2135
+ };
2136
+
2137
+ const progressEventDecorator = (total, throttled) => {
2138
+ const lengthComputable = total != null;
2139
+
2140
+ return [(loaded) => throttled[0]({
2141
+ lengthComputable,
2142
+ total,
2143
+ loaded
2144
+ }), throttled[1]];
2145
+ };
2146
+
2147
+ const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
2148
+
2149
+ const isURLSameOrigin = platform.hasStandardBrowserEnv ?
2150
+
2151
+ // Standard browser envs have full support of the APIs needed to test
2152
+ // whether the request URL is of the same origin as current location.
2153
+ (function standardBrowserEnv() {
2154
+ const msie = /(msie|trident)/i.test(navigator.userAgent);
2155
+ const urlParsingNode = document.createElement('a');
2156
+ let originURL;
2157
+
2158
+ /**
2159
+ * Parse a URL to discover its components
2160
+ *
2161
+ * @param {String} url The URL to be parsed
2162
+ * @returns {Object}
2163
+ */
2164
+ function resolveURL(url) {
2165
+ let href = url;
2166
+
2167
+ if (msie) {
2168
+ // IE needs attribute set twice to normalize properties
2169
+ urlParsingNode.setAttribute('href', href);
2170
+ href = urlParsingNode.href;
2171
+ }
2172
+
2173
+ urlParsingNode.setAttribute('href', href);
2174
+
2175
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
2176
+ return {
2177
+ href: urlParsingNode.href,
2178
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
2179
+ host: urlParsingNode.host,
2180
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
2181
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
2182
+ hostname: urlParsingNode.hostname,
2183
+ port: urlParsingNode.port,
2184
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
2185
+ urlParsingNode.pathname :
2186
+ '/' + urlParsingNode.pathname
2187
+ };
2188
+ }
2189
+
2190
+ originURL = resolveURL(window.location.href);
2191
+
2192
+ /**
2193
+ * Determine if a URL shares the same origin as the current location
2194
+ *
2195
+ * @param {String} requestURL The URL to test
2196
+ * @returns {boolean} True if URL shares the same origin, otherwise false
2197
+ */
2198
+ return function isURLSameOrigin(requestURL) {
2199
+ const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
2200
+ return (parsed.protocol === originURL.protocol &&
2201
+ parsed.host === originURL.host);
2202
+ };
2203
+ })() :
2204
+
2205
+ // Non standard browser envs (web workers, react-native) lack needed support.
2206
+ (function nonStandardBrowserEnv() {
2207
+ return function isURLSameOrigin() {
2208
+ return true;
2209
+ };
2210
+ })();
2211
+
2212
+ const cookies = platform.hasStandardBrowserEnv ?
2213
+
2214
+ // Standard browser envs support document.cookie
2215
+ {
2216
+ write(name, value, expires, path, domain, secure) {
2217
+ const cookie = [name + '=' + encodeURIComponent(value)];
2218
+
2219
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
2220
+
2221
+ utils$1.isString(path) && cookie.push('path=' + path);
2222
+
2223
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
2224
+
2225
+ secure === true && cookie.push('secure');
2226
+
2227
+ document.cookie = cookie.join('; ');
2228
+ },
2229
+
2230
+ read(name) {
2231
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
2232
+ return (match ? decodeURIComponent(match[3]) : null);
2233
+ },
2234
+
2235
+ remove(name) {
2236
+ this.write(name, '', Date.now() - 86400000);
2237
+ }
2238
+ }
2239
+
2240
+ :
2241
+
2242
+ // Non-standard browser env (web workers, react-native) lack needed support.
2243
+ {
2244
+ write() {},
2245
+ read() {
2246
+ return null;
2247
+ },
2248
+ remove() {}
2249
+ };
2250
+
2251
+ /**
2252
+ * Determines whether the specified URL is absolute
2253
+ *
2254
+ * @param {string} url The URL to test
2255
+ *
2256
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
2257
+ */
2258
+ function isAbsoluteURL(url) {
2259
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2260
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2261
+ // by any combination of letters, digits, plus, period, or hyphen.
2262
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2263
+ }
2264
+
2265
+ /**
2266
+ * Creates a new URL by combining the specified URLs
2267
+ *
2268
+ * @param {string} baseURL The base URL
2269
+ * @param {string} relativeURL The relative URL
2270
+ *
2271
+ * @returns {string} The combined URL
2272
+ */
2273
+ function combineURLs(baseURL, relativeURL) {
2274
+ return relativeURL
2275
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
2276
+ : baseURL;
2277
+ }
2278
+
2279
+ /**
2280
+ * Creates a new URL by combining the baseURL with the requestedURL,
2281
+ * only when the requestedURL is not already an absolute URL.
2282
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
2283
+ *
2284
+ * @param {string} baseURL The base URL
2285
+ * @param {string} requestedURL Absolute or relative URL to combine
2286
+ *
2287
+ * @returns {string} The combined full path
2288
+ */
2289
+ function buildFullPath(baseURL, requestedURL) {
2290
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
2291
+ return combineURLs(baseURL, requestedURL);
2292
+ }
2293
+ return requestedURL;
2294
+ }
2295
+
2296
+ const headersToObject = (thing) => thing instanceof AxiosHeaders$2 ? { ...thing } : thing;
2297
+
2298
+ /**
2299
+ * Config-specific merge-function which creates a new config-object
2300
+ * by merging two configuration objects together.
2301
+ *
2302
+ * @param {Object} config1
2303
+ * @param {Object} config2
2304
+ *
2305
+ * @returns {Object} New object resulting from merging config2 to config1
2306
+ */
2307
+ function mergeConfig$1(config1, config2) {
2308
+ // eslint-disable-next-line no-param-reassign
2309
+ config2 = config2 || {};
2310
+ const config = {};
2311
+
2312
+ function getMergedValue(target, source, caseless) {
2313
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
2314
+ return utils$1.merge.call({caseless}, target, source);
2315
+ } else if (utils$1.isPlainObject(source)) {
2316
+ return utils$1.merge({}, source);
2317
+ } else if (utils$1.isArray(source)) {
2318
+ return source.slice();
2319
+ }
2320
+ return source;
2321
+ }
2322
+
2323
+ // eslint-disable-next-line consistent-return
2324
+ function mergeDeepProperties(a, b, caseless) {
2325
+ if (!utils$1.isUndefined(b)) {
2326
+ return getMergedValue(a, b, caseless);
2327
+ } else if (!utils$1.isUndefined(a)) {
2328
+ return getMergedValue(undefined, a, caseless);
2329
+ }
2330
+ }
2331
+
2332
+ // eslint-disable-next-line consistent-return
2333
+ function valueFromConfig2(a, b) {
2334
+ if (!utils$1.isUndefined(b)) {
2335
+ return getMergedValue(undefined, b);
2336
+ }
2337
+ }
2338
+
2339
+ // eslint-disable-next-line consistent-return
2340
+ function defaultToConfig2(a, b) {
2341
+ if (!utils$1.isUndefined(b)) {
2342
+ return getMergedValue(undefined, b);
2343
+ } else if (!utils$1.isUndefined(a)) {
2344
+ return getMergedValue(undefined, a);
2345
+ }
2346
+ }
2347
+
2348
+ // eslint-disable-next-line consistent-return
2349
+ function mergeDirectKeys(a, b, prop) {
2350
+ if (prop in config2) {
2351
+ return getMergedValue(a, b);
2352
+ } else if (prop in config1) {
2353
+ return getMergedValue(undefined, a);
2354
+ }
2355
+ }
2356
+
2357
+ const mergeMap = {
2358
+ url: valueFromConfig2,
2359
+ method: valueFromConfig2,
2360
+ data: valueFromConfig2,
2361
+ baseURL: defaultToConfig2,
2362
+ transformRequest: defaultToConfig2,
2363
+ transformResponse: defaultToConfig2,
2364
+ paramsSerializer: defaultToConfig2,
2365
+ timeout: defaultToConfig2,
2366
+ timeoutMessage: defaultToConfig2,
2367
+ withCredentials: defaultToConfig2,
2368
+ withXSRFToken: defaultToConfig2,
2369
+ adapter: defaultToConfig2,
2370
+ responseType: defaultToConfig2,
2371
+ xsrfCookieName: defaultToConfig2,
2372
+ xsrfHeaderName: defaultToConfig2,
2373
+ onUploadProgress: defaultToConfig2,
2374
+ onDownloadProgress: defaultToConfig2,
2375
+ decompress: defaultToConfig2,
2376
+ maxContentLength: defaultToConfig2,
2377
+ maxBodyLength: defaultToConfig2,
2378
+ beforeRedirect: defaultToConfig2,
2379
+ transport: defaultToConfig2,
2380
+ httpAgent: defaultToConfig2,
2381
+ httpsAgent: defaultToConfig2,
2382
+ cancelToken: defaultToConfig2,
2383
+ socketPath: defaultToConfig2,
2384
+ responseEncoding: defaultToConfig2,
2385
+ validateStatus: mergeDirectKeys,
2386
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
2387
+ };
2388
+
2389
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2390
+ const merge = mergeMap[prop] || mergeDeepProperties;
2391
+ const configValue = merge(config1[prop], config2[prop], prop);
2392
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
2393
+ });
2394
+
2395
+ return config;
2396
+ }
2397
+
2398
+ const resolveConfig = (config) => {
2399
+ const newConfig = mergeConfig$1({}, config);
2400
+
2401
+ let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
2402
+
2403
+ newConfig.headers = headers = AxiosHeaders$2.from(headers);
2404
+
2405
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
2406
+
2407
+ // HTTP basic authentication
2408
+ if (auth) {
2409
+ headers.set('Authorization', 'Basic ' +
2410
+ btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
2411
+ );
2412
+ }
2413
+
2414
+ let contentType;
2415
+
2416
+ if (utils$1.isFormData(data)) {
2417
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
2418
+ headers.setContentType(undefined); // Let the browser set it
2419
+ } else if ((contentType = headers.getContentType()) !== false) {
2420
+ // fix semicolon duplication issue for ReactNative FormData implementation
2421
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
2422
+ headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
2423
+ }
2424
+ }
2425
+
2426
+ // Add xsrf header
2427
+ // This is only done if running in a standard browser environment.
2428
+ // Specifically not if we're in a web worker, or react-native.
2429
+
2430
+ if (platform.hasStandardBrowserEnv) {
2431
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
2432
+
2433
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
2434
+ // Add xsrf header
2435
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
2436
+
2437
+ if (xsrfValue) {
2438
+ headers.set(xsrfHeaderName, xsrfValue);
2439
+ }
2440
+ }
2441
+ }
2442
+
2443
+ return newConfig;
2444
+ };
2445
+
2446
+ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
2447
+
2448
+ const xhrAdapter = isXHRAdapterSupported && function (config) {
2449
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
2450
+ const _config = resolveConfig(config);
2451
+ let requestData = _config.data;
2452
+ const requestHeaders = AxiosHeaders$2.from(_config.headers).normalize();
2453
+ let {responseType, onUploadProgress, onDownloadProgress} = _config;
2454
+ let onCanceled;
2455
+ let uploadThrottled, downloadThrottled;
2456
+ let flushUpload, flushDownload;
2457
+
2458
+ function done() {
2459
+ flushUpload && flushUpload(); // flush events
2460
+ flushDownload && flushDownload(); // flush events
2461
+
2462
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
2463
+
2464
+ _config.signal && _config.signal.removeEventListener('abort', onCanceled);
2465
+ }
2466
+
2467
+ let request = new XMLHttpRequest();
2468
+
2469
+ request.open(_config.method.toUpperCase(), _config.url, true);
2470
+
2471
+ // Set the request timeout in MS
2472
+ request.timeout = _config.timeout;
2473
+
2474
+ function onloadend() {
2475
+ if (!request) {
2476
+ return;
2477
+ }
2478
+ // Prepare the response
2479
+ const responseHeaders = AxiosHeaders$2.from(
2480
+ 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
2481
+ );
2482
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
2483
+ request.responseText : request.response;
2484
+ const response = {
2485
+ data: responseData,
2486
+ status: request.status,
2487
+ statusText: request.statusText,
2488
+ headers: responseHeaders,
2489
+ config,
2490
+ request
2491
+ };
2492
+
2493
+ settle(function _resolve(value) {
2494
+ resolve(value);
2495
+ done();
2496
+ }, function _reject(err) {
2497
+ reject(err);
2498
+ done();
2499
+ }, response);
2500
+
2501
+ // Clean up request
2502
+ request = null;
2503
+ }
2504
+
2505
+ if ('onloadend' in request) {
2506
+ // Use onloadend if available
2507
+ request.onloadend = onloadend;
2508
+ } else {
2509
+ // Listen for ready state to emulate onloadend
2510
+ request.onreadystatechange = function handleLoad() {
2511
+ if (!request || request.readyState !== 4) {
2512
+ return;
2513
+ }
2514
+
2515
+ // The request errored out and we didn't get a response, this will be
2516
+ // handled by onerror instead
2517
+ // With one exception: request that using file: protocol, most browsers
2518
+ // will return status as 0 even though it's a successful request
2519
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
2520
+ return;
2521
+ }
2522
+ // readystate handler is calling before onerror or ontimeout handlers,
2523
+ // so we should call onloadend on the next 'tick'
2524
+ setTimeout(onloadend);
2525
+ };
2526
+ }
2527
+
2528
+ // Handle browser request cancellation (as opposed to a manual cancellation)
2529
+ request.onabort = function handleAbort() {
2530
+ if (!request) {
2531
+ return;
2532
+ }
2533
+
2534
+ reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
2535
+
2536
+ // Clean up request
2537
+ request = null;
2538
+ };
2539
+
2540
+ // Handle low level network errors
2541
+ request.onerror = function handleError() {
2542
+ // Real errors are hidden from us by the browser
2543
+ // onerror should only fire if it's a network error
2544
+ reject(new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request));
2545
+
2546
+ // Clean up request
2547
+ request = null;
2548
+ };
2549
+
2550
+ // Handle timeout
2551
+ request.ontimeout = function handleTimeout() {
2552
+ let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
2553
+ const transitional = _config.transitional || transitionalDefaults;
2554
+ if (_config.timeoutErrorMessage) {
2555
+ timeoutErrorMessage = _config.timeoutErrorMessage;
2556
+ }
2557
+ reject(new AxiosError$1(
2558
+ timeoutErrorMessage,
2559
+ transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
2560
+ config,
2561
+ request));
2562
+
2563
+ // Clean up request
2564
+ request = null;
2565
+ };
2566
+
2567
+ // Remove Content-Type if data is undefined
2568
+ requestData === undefined && requestHeaders.setContentType(null);
2569
+
2570
+ // Add headers to the request
2571
+ if ('setRequestHeader' in request) {
2572
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
2573
+ request.setRequestHeader(key, val);
2574
+ });
2575
+ }
2576
+
2577
+ // Add withCredentials to request if needed
2578
+ if (!utils$1.isUndefined(_config.withCredentials)) {
2579
+ request.withCredentials = !!_config.withCredentials;
2580
+ }
2581
+
2582
+ // Add responseType to request if needed
2583
+ if (responseType && responseType !== 'json') {
2584
+ request.responseType = _config.responseType;
2585
+ }
2586
+
2587
+ // Handle progress if needed
2588
+ if (onDownloadProgress) {
2589
+ ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
2590
+ request.addEventListener('progress', downloadThrottled);
2591
+ }
2592
+
2593
+ // Not all browsers support upload events
2594
+ if (onUploadProgress && request.upload) {
2595
+ ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
2596
+
2597
+ request.upload.addEventListener('progress', uploadThrottled);
2598
+
2599
+ request.upload.addEventListener('loadend', flushUpload);
2600
+ }
2601
+
2602
+ if (_config.cancelToken || _config.signal) {
2603
+ // Handle cancellation
2604
+ // eslint-disable-next-line func-names
2605
+ onCanceled = cancel => {
2606
+ if (!request) {
2607
+ return;
2608
+ }
2609
+ reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
2610
+ request.abort();
2611
+ request = null;
2612
+ };
2613
+
2614
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
2615
+ if (_config.signal) {
2616
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
2617
+ }
2618
+ }
2619
+
2620
+ const protocol = parseProtocol(_config.url);
2621
+
2622
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
2623
+ reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
2624
+ return;
2625
+ }
2626
+
2627
+
2628
+ // Send the request
2629
+ request.send(requestData || null);
2630
+ });
2631
+ };
2632
+
2633
+ const composeSignals = (signals, timeout) => {
2634
+ let controller = new AbortController();
2635
+
2636
+ let aborted;
2637
+
2638
+ const onabort = function (cancel) {
2639
+ if (!aborted) {
2640
+ aborted = true;
2641
+ unsubscribe();
2642
+ const err = cancel instanceof Error ? cancel : this.reason;
2643
+ controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
2644
+ }
2645
+ };
2646
+
2647
+ let timer = timeout && setTimeout(() => {
2648
+ onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
2649
+ }, timeout);
2650
+
2651
+ const unsubscribe = () => {
2652
+ if (signals) {
2653
+ timer && clearTimeout(timer);
2654
+ timer = null;
2655
+ signals.forEach(signal => {
2656
+ signal &&
2657
+ (signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
2658
+ });
2659
+ signals = null;
2660
+ }
2661
+ };
2662
+
2663
+ signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
2664
+
2665
+ const {signal} = controller;
2666
+
2667
+ signal.unsubscribe = unsubscribe;
2668
+
2669
+ return [signal, () => {
2670
+ timer && clearTimeout(timer);
2671
+ timer = null;
2672
+ }];
2673
+ };
2674
+
2675
+ const composeSignals$1 = composeSignals;
2676
+
2677
+ const streamChunk = function* (chunk, chunkSize) {
2678
+ let len = chunk.byteLength;
2679
+
2680
+ if (!chunkSize || len < chunkSize) {
2681
+ yield chunk;
2682
+ return;
2683
+ }
2684
+
2685
+ let pos = 0;
2686
+ let end;
2687
+
2688
+ while (pos < len) {
2689
+ end = pos + chunkSize;
2690
+ yield chunk.slice(pos, end);
2691
+ pos = end;
2692
+ }
2693
+ };
2694
+
2695
+ const readBytes = async function* (iterable, chunkSize, encode) {
2696
+ for await (const chunk of iterable) {
2697
+ yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
2698
+ }
2699
+ };
2700
+
2701
+ const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
2702
+ const iterator = readBytes(stream, chunkSize, encode);
2703
+
2704
+ let bytes = 0;
2705
+ let done;
2706
+ let _onFinish = (e) => {
2707
+ if (!done) {
2708
+ done = true;
2709
+ onFinish && onFinish(e);
2710
+ }
2711
+ };
2712
+
2713
+ return new ReadableStream({
2714
+ async pull(controller) {
2715
+ try {
2716
+ const {done, value} = await iterator.next();
2717
+
2718
+ if (done) {
2719
+ _onFinish();
2720
+ controller.close();
2721
+ return;
2722
+ }
2723
+
2724
+ let len = value.byteLength;
2725
+ if (onProgress) {
2726
+ let loadedBytes = bytes += len;
2727
+ onProgress(loadedBytes);
2728
+ }
2729
+ controller.enqueue(new Uint8Array(value));
2730
+ } catch (err) {
2731
+ _onFinish(err);
2732
+ throw err;
2733
+ }
2734
+ },
2735
+ cancel(reason) {
2736
+ _onFinish(reason);
2737
+ return iterator.return();
2738
+ }
2739
+ }, {
2740
+ highWaterMark: 2
2741
+ })
2742
+ };
2743
+
2744
+ const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
2745
+ const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
2746
+
2747
+ // used only inside the fetch adapter
2748
+ const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
2749
+ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
2750
+ async (str) => new Uint8Array(await new Response(str).arrayBuffer())
2751
+ );
2752
+
2753
+ const test = (fn, ...args) => {
2754
+ try {
2755
+ return !!fn(...args);
2756
+ } catch (e) {
2757
+ return false
2758
+ }
2759
+ };
2760
+
2761
+ const supportsRequestStream = isReadableStreamSupported && test(() => {
2762
+ let duplexAccessed = false;
2763
+
2764
+ const hasContentType = new Request(platform.origin, {
2765
+ body: new ReadableStream(),
2766
+ method: 'POST',
2767
+ get duplex() {
2768
+ duplexAccessed = true;
2769
+ return 'half';
2770
+ },
2771
+ }).headers.has('Content-Type');
2772
+
2773
+ return duplexAccessed && !hasContentType;
2774
+ });
2775
+
2776
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
2777
+
2778
+ const supportsResponseStream = isReadableStreamSupported &&
2779
+ test(() => utils$1.isReadableStream(new Response('').body));
2780
+
2781
+
2782
+ const resolvers = {
2783
+ stream: supportsResponseStream && ((res) => res.body)
2784
+ };
2785
+
2786
+ isFetchSupported && (((res) => {
2787
+ ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
2788
+ !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
2789
+ (_, config) => {
2790
+ throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
2791
+ });
2792
+ });
2793
+ })(new Response));
2794
+
2795
+ const getBodyLength = async (body) => {
2796
+ if (body == null) {
2797
+ return 0;
2798
+ }
2799
+
2800
+ if(utils$1.isBlob(body)) {
2801
+ return body.size;
2802
+ }
2803
+
2804
+ if(utils$1.isSpecCompliantForm(body)) {
2805
+ return (await new Request(body).arrayBuffer()).byteLength;
2806
+ }
2807
+
2808
+ if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
2809
+ return body.byteLength;
2810
+ }
2811
+
2812
+ if(utils$1.isURLSearchParams(body)) {
2813
+ body = body + '';
2814
+ }
2815
+
2816
+ if(utils$1.isString(body)) {
2817
+ return (await encodeText(body)).byteLength;
2818
+ }
2819
+ };
2820
+
2821
+ const resolveBodyLength = async (headers, body) => {
2822
+ const length = utils$1.toFiniteNumber(headers.getContentLength());
2823
+
2824
+ return length == null ? getBodyLength(body) : length;
2825
+ };
2826
+
2827
+ const fetchAdapter = isFetchSupported && (async (config) => {
2828
+ let {
2829
+ url,
2830
+ method,
2831
+ data,
2832
+ signal,
2833
+ cancelToken,
2834
+ timeout,
2835
+ onDownloadProgress,
2836
+ onUploadProgress,
2837
+ responseType,
2838
+ headers,
2839
+ withCredentials = 'same-origin',
2840
+ fetchOptions
2841
+ } = resolveConfig(config);
2842
+
2843
+ responseType = responseType ? (responseType + '').toLowerCase() : 'text';
2844
+
2845
+ let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?
2846
+ composeSignals$1([signal, cancelToken], timeout) : [];
2847
+
2848
+ let finished, request;
2849
+
2850
+ const onFinish = () => {
2851
+ !finished && setTimeout(() => {
2852
+ composedSignal && composedSignal.unsubscribe();
2853
+ });
2854
+
2855
+ finished = true;
2856
+ };
2857
+
2858
+ let requestContentLength;
2859
+
2860
+ try {
2861
+ if (
2862
+ onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
2863
+ (requestContentLength = await resolveBodyLength(headers, data)) !== 0
2864
+ ) {
2865
+ let _request = new Request(url, {
2866
+ method: 'POST',
2867
+ body: data,
2868
+ duplex: "half"
2869
+ });
2870
+
2871
+ let contentTypeHeader;
2872
+
2873
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
2874
+ headers.setContentType(contentTypeHeader);
2875
+ }
2876
+
2877
+ if (_request.body) {
2878
+ const [onProgress, flush] = progressEventDecorator(
2879
+ requestContentLength,
2880
+ progressEventReducer(asyncDecorator(onUploadProgress))
2881
+ );
2882
+
2883
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
2884
+ }
2885
+ }
2886
+
2887
+ if (!utils$1.isString(withCredentials)) {
2888
+ withCredentials = withCredentials ? 'include' : 'omit';
2889
+ }
2890
+
2891
+ request = new Request(url, {
2892
+ ...fetchOptions,
2893
+ signal: composedSignal,
2894
+ method: method.toUpperCase(),
2895
+ headers: headers.normalize().toJSON(),
2896
+ body: data,
2897
+ duplex: "half",
2898
+ credentials: withCredentials
2899
+ });
2900
+
2901
+ let response = await fetch(request);
2902
+
2903
+ const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
2904
+
2905
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
2906
+ const options = {};
2907
+
2908
+ ['status', 'statusText', 'headers'].forEach(prop => {
2909
+ options[prop] = response[prop];
2910
+ });
2911
+
2912
+ const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
2913
+
2914
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
2915
+ responseContentLength,
2916
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
2917
+ ) || [];
2918
+
2919
+ response = new Response(
2920
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
2921
+ flush && flush();
2922
+ isStreamResponse && onFinish();
2923
+ }, encodeText),
2924
+ options
2925
+ );
2926
+ }
2927
+
2928
+ responseType = responseType || 'text';
2929
+
2930
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
2931
+
2932
+ !isStreamResponse && onFinish();
2933
+
2934
+ stopTimeout && stopTimeout();
2935
+
2936
+ return await new Promise((resolve, reject) => {
2937
+ settle(resolve, reject, {
2938
+ data: responseData,
2939
+ headers: AxiosHeaders$2.from(response.headers),
2940
+ status: response.status,
2941
+ statusText: response.statusText,
2942
+ config,
2943
+ request
2944
+ });
2945
+ })
2946
+ } catch (err) {
2947
+ onFinish();
2948
+
2949
+ if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
2950
+ throw Object.assign(
2951
+ new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
2952
+ {
2953
+ cause: err.cause || err
2954
+ }
2955
+ )
2956
+ }
2957
+
2958
+ throw AxiosError$1.from(err, err && err.code, config, request);
2959
+ }
2960
+ });
2961
+
2962
+ const knownAdapters = {
2963
+ http: httpAdapter,
2964
+ xhr: xhrAdapter,
2965
+ fetch: fetchAdapter
2966
+ };
2967
+
2968
+ utils$1.forEach(knownAdapters, (fn, value) => {
2969
+ if (fn) {
2970
+ try {
2971
+ Object.defineProperty(fn, 'name', {value});
2972
+ } catch (e) {
2973
+ // eslint-disable-next-line no-empty
2974
+ }
2975
+ Object.defineProperty(fn, 'adapterName', {value});
2976
+ }
2977
+ });
2978
+
2979
+ const renderReason = (reason) => `- ${reason}`;
2980
+
2981
+ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
2982
+
2983
+ const adapters = {
2984
+ getAdapter: (adapters) => {
2985
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
2986
+
2987
+ const {length} = adapters;
2988
+ let nameOrAdapter;
2989
+ let adapter;
2990
+
2991
+ const rejectedReasons = {};
2992
+
2993
+ for (let i = 0; i < length; i++) {
2994
+ nameOrAdapter = adapters[i];
2995
+ let id;
2996
+
2997
+ adapter = nameOrAdapter;
2998
+
2999
+ if (!isResolvedHandle(nameOrAdapter)) {
3000
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3001
+
3002
+ if (adapter === undefined) {
3003
+ throw new AxiosError$1(`Unknown adapter '${id}'`);
3004
+ }
3005
+ }
3006
+
3007
+ if (adapter) {
3008
+ break;
3009
+ }
3010
+
3011
+ rejectedReasons[id || '#' + i] = adapter;
3012
+ }
3013
+
3014
+ if (!adapter) {
3015
+
3016
+ const reasons = Object.entries(rejectedReasons)
3017
+ .map(([id, state]) => `adapter ${id} ` +
3018
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
3019
+ );
3020
+
3021
+ let s = length ?
3022
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
3023
+ 'as no adapter specified';
3024
+
3025
+ throw new AxiosError$1(
3026
+ `There is no suitable adapter to dispatch the request ` + s,
3027
+ 'ERR_NOT_SUPPORT'
3028
+ );
3029
+ }
3030
+
3031
+ return adapter;
3032
+ },
3033
+ adapters: knownAdapters
3034
+ };
3035
+
3036
+ /**
3037
+ * Throws a `CanceledError` if cancellation has been requested.
3038
+ *
3039
+ * @param {Object} config The config that is to be used for the request
3040
+ *
3041
+ * @returns {void}
3042
+ */
3043
+ function throwIfCancellationRequested(config) {
3044
+ if (config.cancelToken) {
3045
+ config.cancelToken.throwIfRequested();
3046
+ }
3047
+
3048
+ if (config.signal && config.signal.aborted) {
3049
+ throw new CanceledError$1(null, config);
3050
+ }
3051
+ }
3052
+
3053
+ /**
3054
+ * Dispatch a request to the server using the configured adapter.
3055
+ *
3056
+ * @param {object} config The config that is to be used for the request
3057
+ *
3058
+ * @returns {Promise} The Promise to be fulfilled
3059
+ */
3060
+ function dispatchRequest(config) {
3061
+ throwIfCancellationRequested(config);
3062
+
3063
+ config.headers = AxiosHeaders$2.from(config.headers);
3064
+
3065
+ // Transform request data
3066
+ config.data = transformData.call(
3067
+ config,
3068
+ config.transformRequest
3069
+ );
3070
+
3071
+ if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
3072
+ config.headers.setContentType('application/x-www-form-urlencoded', false);
3073
+ }
3074
+
3075
+ const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
3076
+
3077
+ return adapter(config).then(function onAdapterResolution(response) {
3078
+ throwIfCancellationRequested(config);
3079
+
3080
+ // Transform response data
3081
+ response.data = transformData.call(
3082
+ config,
3083
+ config.transformResponse,
3084
+ response
3085
+ );
3086
+
3087
+ response.headers = AxiosHeaders$2.from(response.headers);
3088
+
3089
+ return response;
3090
+ }, function onAdapterRejection(reason) {
3091
+ if (!isCancel$1(reason)) {
3092
+ throwIfCancellationRequested(config);
3093
+
3094
+ // Transform response data
3095
+ if (reason && reason.response) {
3096
+ reason.response.data = transformData.call(
3097
+ config,
3098
+ config.transformResponse,
3099
+ reason.response
3100
+ );
3101
+ reason.response.headers = AxiosHeaders$2.from(reason.response.headers);
3102
+ }
3103
+ }
3104
+
3105
+ return Promise.reject(reason);
3106
+ });
3107
+ }
3108
+
3109
+ const VERSION$1 = "1.7.4";
3110
+
3111
+ const validators$1 = {};
3112
+
3113
+ // eslint-disable-next-line func-names
3114
+ ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
3115
+ validators$1[type] = function validator(thing) {
3116
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
3117
+ };
3118
+ });
3119
+
3120
+ const deprecatedWarnings = {};
3121
+
3122
+ /**
3123
+ * Transitional option validator
3124
+ *
3125
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
3126
+ * @param {string?} version - deprecated version / removed since version
3127
+ * @param {string?} message - some message with additional info
3128
+ *
3129
+ * @returns {function}
3130
+ */
3131
+ validators$1.transitional = function transitional(validator, version, message) {
3132
+ function formatMessage(opt, desc) {
3133
+ return '[Axios v' + VERSION$1 + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
3134
+ }
3135
+
3136
+ // eslint-disable-next-line func-names
3137
+ return (value, opt, opts) => {
3138
+ if (validator === false) {
3139
+ throw new AxiosError$1(
3140
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
3141
+ AxiosError$1.ERR_DEPRECATED
3142
+ );
3143
+ }
3144
+
3145
+ if (version && !deprecatedWarnings[opt]) {
3146
+ deprecatedWarnings[opt] = true;
3147
+ // eslint-disable-next-line no-console
3148
+ console.warn(
3149
+ formatMessage(
3150
+ opt,
3151
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
3152
+ )
3153
+ );
3154
+ }
3155
+
3156
+ return validator ? validator(value, opt, opts) : true;
3157
+ };
3158
+ };
3159
+
3160
+ /**
3161
+ * Assert object's properties type
3162
+ *
3163
+ * @param {object} options
3164
+ * @param {object} schema
3165
+ * @param {boolean?} allowUnknown
3166
+ *
3167
+ * @returns {object}
3168
+ */
3169
+
3170
+ function assertOptions(options, schema, allowUnknown) {
3171
+ if (typeof options !== 'object') {
3172
+ throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
3173
+ }
3174
+ const keys = Object.keys(options);
3175
+ let i = keys.length;
3176
+ while (i-- > 0) {
3177
+ const opt = keys[i];
3178
+ const validator = schema[opt];
3179
+ if (validator) {
3180
+ const value = options[opt];
3181
+ const result = value === undefined || validator(value, opt, options);
3182
+ if (result !== true) {
3183
+ throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
3184
+ }
3185
+ continue;
3186
+ }
3187
+ if (allowUnknown !== true) {
3188
+ throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
3189
+ }
3190
+ }
3191
+ }
3192
+
3193
+ const validator = {
3194
+ assertOptions,
3195
+ validators: validators$1
3196
+ };
3197
+
3198
+ const validators = validator.validators;
3199
+
3200
+ /**
3201
+ * Create a new instance of Axios
3202
+ *
3203
+ * @param {Object} instanceConfig The default config for the instance
3204
+ *
3205
+ * @return {Axios} A new instance of Axios
3206
+ */
3207
+ class Axios$1 {
3208
+ constructor(instanceConfig) {
3209
+ this.defaults = instanceConfig;
3210
+ this.interceptors = {
3211
+ request: new InterceptorManager$1(),
3212
+ response: new InterceptorManager$1()
3213
+ };
3214
+ }
3215
+
3216
+ /**
3217
+ * Dispatch a request
3218
+ *
3219
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
3220
+ * @param {?Object} config
3221
+ *
3222
+ * @returns {Promise} The Promise to be fulfilled
3223
+ */
3224
+ async request(configOrUrl, config) {
3225
+ try {
3226
+ return await this._request(configOrUrl, config);
3227
+ } catch (err) {
3228
+ if (err instanceof Error) {
3229
+ let dummy;
3230
+
3231
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
3232
+
3233
+ // slice off the Error: ... line
3234
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
3235
+ try {
3236
+ if (!err.stack) {
3237
+ err.stack = stack;
3238
+ // match without the 2 top stack lines
3239
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
3240
+ err.stack += '\n' + stack;
3241
+ }
3242
+ } catch (e) {
3243
+ // ignore the case where "stack" is an un-writable property
3244
+ }
3245
+ }
3246
+
3247
+ throw err;
3248
+ }
3249
+ }
3250
+
3251
+ _request(configOrUrl, config) {
3252
+ /*eslint no-param-reassign:0*/
3253
+ // Allow for axios('example/url'[, config]) a la fetch API
3254
+ if (typeof configOrUrl === 'string') {
3255
+ config = config || {};
3256
+ config.url = configOrUrl;
3257
+ } else {
3258
+ config = configOrUrl || {};
3259
+ }
3260
+
3261
+ config = mergeConfig$1(this.defaults, config);
3262
+
3263
+ const {transitional, paramsSerializer, headers} = config;
3264
+
3265
+ if (transitional !== undefined) {
3266
+ validator.assertOptions(transitional, {
3267
+ silentJSONParsing: validators.transitional(validators.boolean),
3268
+ forcedJSONParsing: validators.transitional(validators.boolean),
3269
+ clarifyTimeoutError: validators.transitional(validators.boolean)
3270
+ }, false);
3271
+ }
3272
+
3273
+ if (paramsSerializer != null) {
3274
+ if (utils$1.isFunction(paramsSerializer)) {
3275
+ config.paramsSerializer = {
3276
+ serialize: paramsSerializer
3277
+ };
3278
+ } else {
3279
+ validator.assertOptions(paramsSerializer, {
3280
+ encode: validators.function,
3281
+ serialize: validators.function
3282
+ }, true);
3283
+ }
3284
+ }
3285
+
3286
+ // Set config.method
3287
+ config.method = (config.method || this.defaults.method || 'get').toLowerCase();
3288
+
3289
+ // Flatten headers
3290
+ let contextHeaders = headers && utils$1.merge(
3291
+ headers.common,
3292
+ headers[config.method]
3293
+ );
3294
+
3295
+ headers && utils$1.forEach(
3296
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
3297
+ (method) => {
3298
+ delete headers[method];
3299
+ }
3300
+ );
3301
+
3302
+ config.headers = AxiosHeaders$2.concat(contextHeaders, headers);
3303
+
3304
+ // filter out skipped interceptors
3305
+ const requestInterceptorChain = [];
3306
+ let synchronousRequestInterceptors = true;
3307
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
3308
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
3309
+ return;
3310
+ }
3311
+
3312
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
3313
+
3314
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
3315
+ });
3316
+
3317
+ const responseInterceptorChain = [];
3318
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
3319
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
3320
+ });
3321
+
3322
+ let promise;
3323
+ let i = 0;
3324
+ let len;
3325
+
3326
+ if (!synchronousRequestInterceptors) {
3327
+ const chain = [dispatchRequest.bind(this), undefined];
3328
+ chain.unshift.apply(chain, requestInterceptorChain);
3329
+ chain.push.apply(chain, responseInterceptorChain);
3330
+ len = chain.length;
3331
+
3332
+ promise = Promise.resolve(config);
3333
+
3334
+ while (i < len) {
3335
+ promise = promise.then(chain[i++], chain[i++]);
3336
+ }
3337
+
3338
+ return promise;
3339
+ }
3340
+
3341
+ len = requestInterceptorChain.length;
3342
+
3343
+ let newConfig = config;
3344
+
3345
+ i = 0;
3346
+
3347
+ while (i < len) {
3348
+ const onFulfilled = requestInterceptorChain[i++];
3349
+ const onRejected = requestInterceptorChain[i++];
3350
+ try {
3351
+ newConfig = onFulfilled(newConfig);
3352
+ } catch (error) {
3353
+ onRejected.call(this, error);
3354
+ break;
3355
+ }
3356
+ }
3357
+
3358
+ try {
3359
+ promise = dispatchRequest.call(this, newConfig);
3360
+ } catch (error) {
3361
+ return Promise.reject(error);
3362
+ }
3363
+
3364
+ i = 0;
3365
+ len = responseInterceptorChain.length;
3366
+
3367
+ while (i < len) {
3368
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
3369
+ }
3370
+
3371
+ return promise;
3372
+ }
3373
+
3374
+ getUri(config) {
3375
+ config = mergeConfig$1(this.defaults, config);
3376
+ const fullPath = buildFullPath(config.baseURL, config.url);
3377
+ return buildURL(fullPath, config.params, config.paramsSerializer);
3378
+ }
3379
+ }
3380
+
3381
+ // Provide aliases for supported request methods
3382
+ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
3383
+ /*eslint func-names:0*/
3384
+ Axios$1.prototype[method] = function(url, config) {
3385
+ return this.request(mergeConfig$1(config || {}, {
3386
+ method,
3387
+ url,
3388
+ data: (config || {}).data
3389
+ }));
3390
+ };
3391
+ });
3392
+
3393
+ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
3394
+ /*eslint func-names:0*/
3395
+
3396
+ function generateHTTPMethod(isForm) {
3397
+ return function httpMethod(url, data, config) {
3398
+ return this.request(mergeConfig$1(config || {}, {
3399
+ method,
3400
+ headers: isForm ? {
3401
+ 'Content-Type': 'multipart/form-data'
3402
+ } : {},
3403
+ url,
3404
+ data
3405
+ }));
3406
+ };
3407
+ }
3408
+
3409
+ Axios$1.prototype[method] = generateHTTPMethod();
3410
+
3411
+ Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
3412
+ });
3413
+
3414
+ const Axios$2 = Axios$1;
3415
+
3416
+ /**
3417
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
3418
+ *
3419
+ * @param {Function} executor The executor function.
3420
+ *
3421
+ * @returns {CancelToken}
3422
+ */
3423
+ class CancelToken$1 {
3424
+ constructor(executor) {
3425
+ if (typeof executor !== 'function') {
3426
+ throw new TypeError('executor must be a function.');
3427
+ }
3428
+
3429
+ let resolvePromise;
3430
+
3431
+ this.promise = new Promise(function promiseExecutor(resolve) {
3432
+ resolvePromise = resolve;
3433
+ });
3434
+
3435
+ const token = this;
3436
+
3437
+ // eslint-disable-next-line func-names
3438
+ this.promise.then(cancel => {
3439
+ if (!token._listeners) return;
3440
+
3441
+ let i = token._listeners.length;
3442
+
3443
+ while (i-- > 0) {
3444
+ token._listeners[i](cancel);
3445
+ }
3446
+ token._listeners = null;
3447
+ });
3448
+
3449
+ // eslint-disable-next-line func-names
3450
+ this.promise.then = onfulfilled => {
3451
+ let _resolve;
3452
+ // eslint-disable-next-line func-names
3453
+ const promise = new Promise(resolve => {
3454
+ token.subscribe(resolve);
3455
+ _resolve = resolve;
3456
+ }).then(onfulfilled);
3457
+
3458
+ promise.cancel = function reject() {
3459
+ token.unsubscribe(_resolve);
3460
+ };
3461
+
3462
+ return promise;
3463
+ };
3464
+
3465
+ executor(function cancel(message, config, request) {
3466
+ if (token.reason) {
3467
+ // Cancellation has already been requested
3468
+ return;
3469
+ }
3470
+
3471
+ token.reason = new CanceledError$1(message, config, request);
3472
+ resolvePromise(token.reason);
3473
+ });
3474
+ }
3475
+
3476
+ /**
3477
+ * Throws a `CanceledError` if cancellation has been requested.
3478
+ */
3479
+ throwIfRequested() {
3480
+ if (this.reason) {
3481
+ throw this.reason;
3482
+ }
3483
+ }
3484
+
3485
+ /**
3486
+ * Subscribe to the cancel signal
3487
+ */
3488
+
3489
+ subscribe(listener) {
3490
+ if (this.reason) {
3491
+ listener(this.reason);
3492
+ return;
3493
+ }
3494
+
3495
+ if (this._listeners) {
3496
+ this._listeners.push(listener);
3497
+ } else {
3498
+ this._listeners = [listener];
3499
+ }
3500
+ }
3501
+
3502
+ /**
3503
+ * Unsubscribe from the cancel signal
3504
+ */
3505
+
3506
+ unsubscribe(listener) {
3507
+ if (!this._listeners) {
3508
+ return;
3509
+ }
3510
+ const index = this._listeners.indexOf(listener);
3511
+ if (index !== -1) {
3512
+ this._listeners.splice(index, 1);
3513
+ }
3514
+ }
3515
+
3516
+ /**
3517
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
3518
+ * cancels the `CancelToken`.
3519
+ */
3520
+ static source() {
3521
+ let cancel;
3522
+ const token = new CancelToken$1(function executor(c) {
3523
+ cancel = c;
3524
+ });
3525
+ return {
3526
+ token,
3527
+ cancel
3528
+ };
3529
+ }
3530
+ }
3531
+
3532
+ const CancelToken$2 = CancelToken$1;
3533
+
3534
+ /**
3535
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
3536
+ *
3537
+ * Common use case would be to use `Function.prototype.apply`.
3538
+ *
3539
+ * ```js
3540
+ * function f(x, y, z) {}
3541
+ * var args = [1, 2, 3];
3542
+ * f.apply(null, args);
3543
+ * ```
3544
+ *
3545
+ * With `spread` this example can be re-written.
3546
+ *
3547
+ * ```js
3548
+ * spread(function(x, y, z) {})([1, 2, 3]);
3549
+ * ```
3550
+ *
3551
+ * @param {Function} callback
3552
+ *
3553
+ * @returns {Function}
3554
+ */
3555
+ function spread$1(callback) {
3556
+ return function wrap(arr) {
3557
+ return callback.apply(null, arr);
3558
+ };
3559
+ }
3560
+
3561
+ /**
3562
+ * Determines whether the payload is an error thrown by Axios
3563
+ *
3564
+ * @param {*} payload The value to test
3565
+ *
3566
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
3567
+ */
3568
+ function isAxiosError$1(payload) {
3569
+ return utils$1.isObject(payload) && (payload.isAxiosError === true);
3570
+ }
3571
+
3572
+ const HttpStatusCode$1 = {
3573
+ Continue: 100,
3574
+ SwitchingProtocols: 101,
3575
+ Processing: 102,
3576
+ EarlyHints: 103,
3577
+ Ok: 200,
3578
+ Created: 201,
3579
+ Accepted: 202,
3580
+ NonAuthoritativeInformation: 203,
3581
+ NoContent: 204,
3582
+ ResetContent: 205,
3583
+ PartialContent: 206,
3584
+ MultiStatus: 207,
3585
+ AlreadyReported: 208,
3586
+ ImUsed: 226,
3587
+ MultipleChoices: 300,
3588
+ MovedPermanently: 301,
3589
+ Found: 302,
3590
+ SeeOther: 303,
3591
+ NotModified: 304,
3592
+ UseProxy: 305,
3593
+ Unused: 306,
3594
+ TemporaryRedirect: 307,
3595
+ PermanentRedirect: 308,
3596
+ BadRequest: 400,
3597
+ Unauthorized: 401,
3598
+ PaymentRequired: 402,
3599
+ Forbidden: 403,
3600
+ NotFound: 404,
3601
+ MethodNotAllowed: 405,
3602
+ NotAcceptable: 406,
3603
+ ProxyAuthenticationRequired: 407,
3604
+ RequestTimeout: 408,
3605
+ Conflict: 409,
3606
+ Gone: 410,
3607
+ LengthRequired: 411,
3608
+ PreconditionFailed: 412,
3609
+ PayloadTooLarge: 413,
3610
+ UriTooLong: 414,
3611
+ UnsupportedMediaType: 415,
3612
+ RangeNotSatisfiable: 416,
3613
+ ExpectationFailed: 417,
3614
+ ImATeapot: 418,
3615
+ MisdirectedRequest: 421,
3616
+ UnprocessableEntity: 422,
3617
+ Locked: 423,
3618
+ FailedDependency: 424,
3619
+ TooEarly: 425,
3620
+ UpgradeRequired: 426,
3621
+ PreconditionRequired: 428,
3622
+ TooManyRequests: 429,
3623
+ RequestHeaderFieldsTooLarge: 431,
3624
+ UnavailableForLegalReasons: 451,
3625
+ InternalServerError: 500,
3626
+ NotImplemented: 501,
3627
+ BadGateway: 502,
3628
+ ServiceUnavailable: 503,
3629
+ GatewayTimeout: 504,
3630
+ HttpVersionNotSupported: 505,
3631
+ VariantAlsoNegotiates: 506,
3632
+ InsufficientStorage: 507,
3633
+ LoopDetected: 508,
3634
+ NotExtended: 510,
3635
+ NetworkAuthenticationRequired: 511,
3636
+ };
3637
+
3638
+ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
3639
+ HttpStatusCode$1[value] = key;
3640
+ });
3641
+
3642
+ const HttpStatusCode$2 = HttpStatusCode$1;
3643
+
3644
+ /**
3645
+ * Create an instance of Axios
3646
+ *
3647
+ * @param {Object} defaultConfig The default config for the instance
3648
+ *
3649
+ * @returns {Axios} A new instance of Axios
3650
+ */
3651
+ function createInstance(defaultConfig) {
3652
+ const context = new Axios$2(defaultConfig);
3653
+ const instance = bind(Axios$2.prototype.request, context);
3654
+
3655
+ // Copy axios.prototype to instance
3656
+ utils$1.extend(instance, Axios$2.prototype, context, {allOwnKeys: true});
3657
+
3658
+ // Copy context to instance
3659
+ utils$1.extend(instance, context, null, {allOwnKeys: true});
3660
+
3661
+ // Factory for creating new instances
3662
+ instance.create = function create(instanceConfig) {
3663
+ return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
3664
+ };
3665
+
3666
+ return instance;
3667
+ }
3668
+
3669
+ // Create the default instance to be exported
3670
+ const axios = createInstance(defaults$1);
3671
+
3672
+ // Expose Axios class to allow class inheritance
3673
+ axios.Axios = Axios$2;
3674
+
3675
+ // Expose Cancel & CancelToken
3676
+ axios.CanceledError = CanceledError$1;
3677
+ axios.CancelToken = CancelToken$2;
3678
+ axios.isCancel = isCancel$1;
3679
+ axios.VERSION = VERSION$1;
3680
+ axios.toFormData = toFormData$1;
3681
+
3682
+ // Expose AxiosError class
3683
+ axios.AxiosError = AxiosError$1;
3684
+
3685
+ // alias for CanceledError for backward compatibility
3686
+ axios.Cancel = axios.CanceledError;
3687
+
3688
+ // Expose all/spread
3689
+ axios.all = function all(promises) {
3690
+ return Promise.all(promises);
3691
+ };
3692
+
3693
+ axios.spread = spread$1;
3694
+
3695
+ // Expose isAxiosError
3696
+ axios.isAxiosError = isAxiosError$1;
3697
+
3698
+ // Expose mergeConfig
3699
+ axios.mergeConfig = mergeConfig$1;
3700
+
3701
+ axios.AxiosHeaders = AxiosHeaders$2;
3702
+
3703
+ axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
3704
+
3705
+ axios.getAdapter = adapters.getAdapter;
3706
+
3707
+ axios.HttpStatusCode = HttpStatusCode$2;
3708
+
3709
+ axios.default = axios;
3710
+
3711
+ // this module should only have a default export
3712
+ const axios$1 = axios;
3713
+
3714
+ // This module is intended to unwrap Axios default export as named.
3715
+ // Keep top-level export same with static properties
3716
+ // so that it can keep same with es module or cjs
3717
+ const {
3718
+ Axios,
3719
+ AxiosError,
3720
+ CanceledError,
3721
+ isCancel,
3722
+ CancelToken,
3723
+ VERSION,
3724
+ all,
3725
+ Cancel,
3726
+ isAxiosError,
3727
+ spread,
3728
+ toFormData,
3729
+ AxiosHeaders,
3730
+ HttpStatusCode,
3731
+ formToJSON,
3732
+ getAdapter,
3733
+ mergeConfig
3734
+ } = axios$1;
3735
+
3736
+ export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, axios$1 as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData };
3737
+ //# sourceMappingURL=axios.js.map