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