@bigbinary/neeto-audit-frontend 2.0.13 → 2.0.15

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.
package/dist/index.js CHANGED
@@ -3,14 +3,14 @@ import process$3 from 'node:process';
3
3
  import os from 'node:os';
4
4
  import tty from 'node:tty';
5
5
  import require$$1, { spawn, exec } from 'child_process';
6
- import require$$0$2 from 'events';
6
+ import require$$0$2, { EventEmitter as EventEmitter$1 } from 'events';
7
7
  import path$2 from 'path';
8
8
  import require$$3, { promises } from 'fs';
9
9
  import require$$4 from 'process';
10
10
  import { readFile, mkdir, lstat, writeFile } from 'fs/promises';
11
11
  import require$$0$3 from 'assert';
12
12
  import require$$1$1 from 'tty';
13
- import require$$1$2, { TextEncoder } from 'util';
13
+ import require$$1$2, { TextEncoder as TextEncoder$1 } from 'util';
14
14
  import require$$0$4 from 'os';
15
15
  import stream, { Readable } from 'stream';
16
16
  import require$$3$1 from 'http';
@@ -15938,7 +15938,7 @@ const eslint = async (debug) => {
15938
15938
 
15939
15939
  // neeto-molecules has different ESLint rules disabled. This does not match other frontend packages.
15940
15940
  // So, decided to skip this check instead of adding a different config check just for a single repo.
15941
- if (repoName === "neeto-molecules") {
15941
+ if (repoName === "neeto-molecules" || repoName === "neeto-commons-frontend") {
15942
15942
  return { isSuccess: true, status: STATUSES.SKIPPED };
15943
15943
  }
15944
15944
 
@@ -16055,7 +16055,7 @@ const prettier = async (debug) => {
16055
16055
 
16056
16056
  // neeto-molecules uses custom tailwind plugins for styles. This does not match other frontend packages.
16057
16057
  // So, decided to skip this check instead of adding a different config check just for a single repo.
16058
- if (repoName === "neeto-molecules") {
16058
+ if (repoName === "neeto-molecules" || repoName === "neeto-commons-frontend") {
16059
16059
  return { isSuccess: true, status: STATUSES.SKIPPED };
16060
16060
  }
16061
16061
 
@@ -16099,45 +16099,47 @@ const prettier = async (debug) => {
16099
16099
  const DEPENDENCIES$4 = {};
16100
16100
 
16101
16101
  const DEV_DEPENDENCIES$4 = {
16102
- "@babel/core": "7.23.2",
16103
- "@babel/eslint-parser": "7.22.15",
16104
- "@babel/plugin-transform-runtime": "7.23.2",
16105
- "@babel/preset-env": "7.23.2",
16106
- "@babel/preset-react": "7.22.15",
16107
- "@babel/preset-typescript": "7.23.2",
16108
- "@babel/runtime": "7.23.2",
16109
- "@bigbinary/babel-preset-neeto": "1.0.6",
16110
- "@bigbinary/eslint-plugin-neeto": "latest",
16111
- "@bigbinary/neeto-cist": "latest",
16112
- "@bigbinary/neeto-commons-frontend": "latest",
16113
- "@bigbinary/neeto-icons": "latest",
16114
- "@bigbinary/neetoui": "latest",
16115
- autoprefixer: "10.4.16",
16116
- "babel-loader": "9.1.3",
16117
- "babel-plugin-istanbul": "6.1.1",
16102
+ "@babel/core": "^7.19.1",
16103
+ "@babel/eslint-parser": "7.17.0",
16104
+ "@babel/plugin-transform-runtime": "^7.19.1",
16105
+ "@babel/preset-env": "7.17.10",
16106
+ "@babel/preset-react": "7.16.7",
16107
+ "@babel/preset-typescript": "^7.18.6",
16108
+ "@babel/runtime": "7.19.0",
16109
+ "@bigbinary/babel-preset-neeto": "^1.0.3",
16110
+ "@bigbinary/eslint-plugin-neeto": "1.5.2",
16111
+ "autoprefixer": "^10.4.5",
16112
+ "babel-loader": "^8.2.5",
16113
+ "babel-plugin-istanbul": "^6.1.1",
16118
16114
  "babel-plugin-js-logger": "1.0.17",
16119
16115
  "babel-plugin-macros": "3.1.0",
16116
+ "babel-plugin-preval": "^5.1.0",
16117
+ "babel-plugin-transform-imports": "^2.0.0",
16120
16118
  "babel-plugin-transform-react-remove-prop-types": "0.4.24",
16121
16119
  "babel-preset-react": "6.24.1",
16122
- "babel-preset-typescript": "7.0.0-alpha.19",
16123
- eslint: "8.52.0",
16120
+ "babel-preset-typescript": "^7.0.0-alpha.19",
16121
+ "eslint": "8.14.0",
16124
16122
  "eslint-config-prettier": "8.5.0",
16125
- "eslint-plugin-cypress": "2.15.1",
16126
- "eslint-plugin-import": "2.29.0",
16123
+ "eslint-plugin-cypress": "2.12.1",
16124
+ "eslint-plugin-import": "2.26.0",
16127
16125
  "eslint-plugin-jam3": "0.2.3",
16128
16126
  "eslint-plugin-json": "3.1.0",
16127
+ "eslint-plugin-no-unsanitized": "^4.0.2",
16129
16128
  "eslint-plugin-prettier": "4.0.0",
16130
- "eslint-plugin-promise": "6.1.1",
16131
- "eslint-plugin-react": "7.33.2",
16132
- "eslint-plugin-react-hooks": "4.6.0",
16133
- "eslint-plugin-unused-imports": "3.0.0",
16134
- husky: "8.0.3",
16135
- "lint-staged": "15.0.2",
16136
- postcss: "8.4.31",
16137
- "postcss-import": "15.1.0",
16138
- "postcss-loader": "7.3.3",
16139
- "postcss-preset-env": "9.2.0",
16140
- prettier: "2.6.2",
16129
+ "eslint-plugin-promise": "6.0.0",
16130
+ "eslint-plugin-react": "7.29.4",
16131
+ "eslint-plugin-react-hooks": "4.5.0",
16132
+ "eslint-plugin-security": "^1.7.1",
16133
+ "eslint-plugin-sonarjs": "^0.21.0",
16134
+ "eslint-plugin-unused-imports": "2.0.0",
16135
+ "eslint-plugin-xss": "^0.1.12",
16136
+ "husky": "7.0.4",
16137
+ "lint-staged": "12.4.1",
16138
+ "postcss": "^8.4.31",
16139
+ "postcss-import": "^15.0.0",
16140
+ "postcss-loader": "^7.0.1",
16141
+ "postcss-preset-env": "7.8.2",
16142
+ "prettier": "2.6.2",
16141
16143
  "prettier-plugin-tailwindcss": "0.1.10",
16142
16144
  };
16143
16145
 
@@ -16150,20 +16152,20 @@ var common = {
16150
16152
  };
16151
16153
 
16152
16154
  const DEPENDENCIES$3 = {
16153
- "@honeybadger-io/js": "6.5.3",
16154
- "@honeybadger-io/react": "6.1.9",
16155
- antd: "5.10.2",
16156
- axios: "1.6.0",
16157
- i18next: "23.6.0",
16155
+ "@honeybadger-io/js": "^6.4.1",
16156
+ "@honeybadger-io/react": "^6.1.3",
16157
+ "antd": "5.16.0",
16158
+ axios: "1.7.4",
16159
+ "i18next": "22.5.1",
16158
16160
  "js-logger": "1.6.1",
16159
16161
  ramda: "0.29.1",
16160
16162
  react: "18.2.0",
16161
16163
  "react-dom": "18.2.0",
16162
- "react-i18next": "13.3.1",
16163
- "react-router-dom": "5.3.4",
16164
- "react-toastify": "8.2.0",
16165
- sass: "1.69.5",
16166
- yup: "1.3.2",
16164
+ "react-i18next": "12.3.1",
16165
+ "react-router-dom": "5.3.3",
16166
+ "react-toastify": "8.0.2",
16167
+ "sass": "^1.54.9",
16168
+ yup: "0.32.11",
16167
16169
  };
16168
16170
 
16169
16171
  const DEV_DEPENDENCIES$3 = {};
@@ -16179,11 +16181,11 @@ var extension = {
16179
16181
  const DEPENDENCIES$2 = {};
16180
16182
 
16181
16183
  const DEV_DEPENDENCIES$2 = {
16182
- "@bigbinary/neeto-filters-frontend": "latest",
16183
- "@bigbinary/neeto-molecules": "latest",
16184
16184
  "@faker-js/faker": "8.2.0",
16185
- "@honeybadger-io/js": "6.5.3",
16186
- "@honeybadger-io/react": "6.1.9",
16185
+ "@honeybadger-io/js": "^6.4.1",
16186
+ "@honeybadger-io/react": "^6.1.3",
16187
+ "@hello-pangea/dnd": "16.3.0",
16188
+ "@rails/activestorage": "7.0.8-3",
16187
16189
  "@rollup/plugin-alias": "5.0.1",
16188
16190
  "@rollup/plugin-babel": "6.0.4",
16189
16191
  "@rollup/plugin-commonjs": "25.0.7",
@@ -16193,54 +16195,104 @@ const DEV_DEPENDENCIES$2 = {
16193
16195
  "@svgr/rollup": "8.1.0",
16194
16196
  "@tanstack/react-query": "5.40.0",
16195
16197
  "@tanstack/react-query-devtools": "5.40.0",
16196
- antd: "5.10.2",
16197
- axios: "1.6.0",
16198
- classnames: "2.3.2",
16199
- formik: "2.4.5",
16200
- i18next: "23.6.0",
16198
+ "@tippyjs/react": "4.2.6",
16199
+ "antd": "5.16.0",
16200
+ "avvvatars-react": "0.4.2",
16201
+ "axios": "1.7.4",
16202
+ "classnames": "2.3.1",
16203
+ "crypto-browserify": "^3.12.0",
16204
+ "dayjs": "1.11.10",
16205
+ "formik": "2.2.9",
16206
+ "framer-motion": "11.2.14",
16207
+ "husky": "7.0.4",
16208
+ "https-browserify": "1.0.0",
16209
+ "i18next": "22.5.1",
16201
16210
  "js-logger": "1.6.1",
16202
- qs: "6.11.2",
16203
- ramda: "0.29.1",
16204
- react: "18.2.0",
16211
+ "libphonenumber-js": "1.11.2",
16212
+ "linkifyjs": "4.1.2",
16213
+ "linkify-react": "4.1.3",
16214
+ "os-browserify": "0.3.0",
16215
+ "path-browserify": "^1.0.1",
16216
+ "qs": "^6.11.2",
16217
+ "ramda": "0.29.1",
16218
+ "react": "18.2.0",
16219
+ "react-colorful": "5.6.1",
16205
16220
  "react-dom": "18.2.0",
16206
- "react-helmet": "6.1.0",
16207
- "react-i18next": "13.3.1",
16208
- "react-router-dom": "5.3.4",
16209
- "react-toastify": "8.2.0",
16210
- rollup: "2.79.1",
16221
+ "react-drag-listview": "2.0.0",
16222
+ "react-helmet": "^6.1.0",
16223
+ "react-i18next": "12.3.1",
16224
+ "react-resizable": "3.0.4",
16225
+ "react-router-dom": "5.3.3",
16226
+ "react-toastify": "8.0.2",
16227
+ "rollup": "2.79.1",
16211
16228
  "rollup-plugin-analyzer": "4.0.0",
16212
16229
  "rollup-plugin-cleaner": "1.0.0",
16230
+ "rollup-plugin-copy": "3.5.0",
16213
16231
  "rollup-plugin-peer-deps-external": "2.2.4",
16214
16232
  "rollup-plugin-styles": "4.0.0",
16215
- sass: "1.69.5",
16216
- tailwindcss: "3.4.1",
16217
- util: "0.12.5",
16218
- yup: "1.3.2",
16233
+ "sass": "^1.54.9",
16234
+ "sass-loader": "^13.0.2",
16235
+ "stream-browserify": "^3.0.0",
16236
+ "stream-http": "3.2.0",
16237
+ "tailwindcss": "^3.4.1",
16238
+ "tippy.js": "6.3.7",
16239
+ "tty-browserify": "0.0.1",
16240
+ "url": "^0.11.0",
16241
+ "util": "^0.12.5",
16242
+ "vm-browserify": "1.1.2",
16243
+ "yup": "0.32.11",
16244
+ "zustand": "4.3.2"
16219
16245
  };
16220
16246
 
16221
16247
  const PEER_DEPENDENCIES$2 = {
16222
- "@bigbinary/neeto-commons-frontend": "latest",
16223
- "@bigbinary/neeto-filters-frontend": "latest",
16224
- "@bigbinary/neeto-icons": "latest",
16225
- "@bigbinary/neeto-molecules": "latest",
16226
- "@bigbinary/neetoui": "latest",
16227
- "@honeybadger-io/js": "^6.5.3",
16228
- "@honeybadger-io/react": "^6.1.9",
16248
+ "@honeybadger-io/js": "^6.4.1",
16249
+ "@honeybadger-io/react": "^6.1.3",
16250
+ "@hello-pangea/dnd": "16.3.0",
16251
+ "@rails/activestorage": "7.0.8-3",
16229
16252
  "@tanstack/react-query": "5.40.0",
16230
16253
  "@tanstack/react-query-devtools": "5.40.0",
16231
- axios: "^1.6.0",
16232
- classnames: "^2.3.2",
16233
- formik: "^2.4.5",
16234
- i18next: "^23.6.0",
16235
- "js-logger": "^1.6.1",
16236
- ramda: "^0.29.1",
16237
- react: "^18.2.0",
16238
- "react-dom": "^18.2.0",
16254
+ "@tippyjs/react": "4.2.6",
16255
+ "antd": "5.16.0",
16256
+ "avvvatars-react": "0.4.2",
16257
+ "axios": "1.7.4",
16258
+ "classnames": "2.3.1",
16259
+ "crypto-browserify": "^3.12.0",
16260
+ "dayjs": "1.11.10",
16261
+ "dompurify": "^2.4.0",
16262
+ "emoji-mart": "^5.2.2",
16263
+ "framer-motion": "11.2.14",
16264
+ "formik": "2.2.9",
16265
+ "husky": "7.0.4",
16266
+ "https-browserify": "1.0.0",
16267
+ "i18next": "22.5.1",
16268
+ "js-logger": "1.6.1",
16269
+ "libphonenumber-js": "1.11.2",
16270
+ "linkifyjs": "4.1.2",
16271
+ "linkify-react": "4.1.3",
16272
+ "os-browserify": "0.3.0",
16273
+ "path-browserify": "^1.0.1",
16274
+ "qs": "^6.11.2",
16275
+ "ramda": "0.29.1",
16276
+ "react": "18.2.0",
16277
+ "react-colorful": "5.6.1",
16278
+ "react-dom": "18.2.0",
16279
+ "react-drag-listview": "2.0.0",
16280
+ "react-dropzone": "14.2.3",
16239
16281
  "react-helmet": "^6.1.0",
16240
- "react-i18next": "^13.3.1",
16241
- "react-router-dom": "^5.3.4",
16242
- "react-toastify": "^8.2.0",
16243
- yup: "^0.32.11",
16282
+ "react-i18next": "12.3.1",
16283
+ "react-resizable": "3.0.4",
16284
+ "react-router-dom": "5.3.3",
16285
+ "react-toastify": "8.0.2",
16286
+ "stream-browserify": "^3.0.0",
16287
+ "stream-http": "3.2.0",
16288
+ "tailwindcss": "^3.4.1",
16289
+ "tippy.js": "6.3.7",
16290
+ "tty-browserify": "0.0.1",
16291
+ "url": "^0.11.0",
16292
+ "util": "^0.12.5",
16293
+ "vm-browserify": "1.1.2",
16294
+ "yup": "0.32.11",
16295
+ "zustand": "4.3.2"
16244
16296
  };
16245
16297
 
16246
16298
  var frontend = {
@@ -16255,8 +16307,8 @@ const DEV_DEPENDENCIES$1 = {
16255
16307
  "@bigbinary/neeto-filters-frontend": "latest",
16256
16308
  "@bigbinary/neeto-molecules": "latest",
16257
16309
  "@faker-js/faker": "8.2.0",
16258
- "@honeybadger-io/js": "6.5.3",
16259
- "@honeybadger-io/react": "6.1.9",
16310
+ "@honeybadger-io/js": "^6.4.1",
16311
+ "@honeybadger-io/react": "^6.1.3",
16260
16312
  "@rollup/plugin-alias": "5.0.1",
16261
16313
  "@rollup/plugin-babel": "6.0.4",
16262
16314
  "@rollup/plugin-commonjs": "25.0.7",
@@ -16266,54 +16318,49 @@ const DEV_DEPENDENCIES$1 = {
16266
16318
  "@svgr/rollup": "8.1.0",
16267
16319
  "@tanstack/react-query": "5.40.0",
16268
16320
  "@tanstack/react-query-devtools": "5.40.0",
16269
- antd: "5.10.2",
16270
- axios: "1.6.0",
16271
- classnames: "2.3.2",
16272
- formik: "2.4.5",
16273
- i18next: "23.6.0",
16321
+ "antd": "5.16.0",
16322
+ axios: "1.7.4",
16323
+ classnames: "2.3.1",
16324
+ formik: "2.2.9",
16325
+ "i18next": "22.5.1",
16274
16326
  "js-logger": "1.6.1",
16275
- qs: "6.11.2",
16327
+ qs: "^6.11.2",
16276
16328
  ramda: "0.29.1",
16277
16329
  react: "18.2.0",
16278
16330
  "react-dom": "18.2.0",
16279
- "react-helmet": "6.1.0",
16280
- "react-i18next": "13.3.1",
16281
- "react-router-dom": "5.3.4",
16282
- "react-toastify": "8.2.0",
16331
+ "react-helmet": "^6.1.0",
16332
+ "react-i18next": "12.3.1",
16333
+ "react-router-dom": "5.3.3",
16334
+ "react-toastify": "8.0.2",
16283
16335
  rollup: "2.79.1",
16284
16336
  "rollup-plugin-analyzer": "4.0.0",
16285
16337
  "rollup-plugin-cleaner": "1.0.0",
16286
16338
  "rollup-plugin-peer-deps-external": "2.2.4",
16287
16339
  "rollup-plugin-styles": "4.0.0",
16288
- sass: "1.69.5",
16289
- tailwindcss: "3.4.1",
16290
- util: "0.12.5",
16291
- yup: "1.3.2",
16340
+ "sass": "^1.54.9",
16341
+ tailwindcss: "^3.4.1",
16342
+ util: "^0.12.5",
16343
+ yup: "0.32.11",
16292
16344
  };
16293
16345
 
16294
16346
  const PEER_DEPENDENCIES$1 = {
16295
- "@bigbinary/neeto-commons-frontend": "latest",
16296
- "@bigbinary/neeto-filters-frontend": "latest",
16297
- "@bigbinary/neeto-icons": "latest",
16298
- "@bigbinary/neeto-molecules": "latest",
16299
- "@bigbinary/neetoui": "latest",
16300
- "@honeybadger-io/js": "^6.5.3",
16301
- "@honeybadger-io/react": "^6.1.9",
16347
+ "@honeybadger-io/js": "^6.4.1",
16348
+ "@honeybadger-io/react": "^6.1.3",
16302
16349
  "@tanstack/react-query": "5.40.0",
16303
16350
  "@tanstack/react-query-devtools": "5.40.0",
16304
- axios: "^1.6.0",
16305
- classnames: "^2.3.2",
16306
- formik: "^2.4.5",
16307
- i18next: "^23.6.0",
16308
- "js-logger": "^1.6.1",
16309
- ramda: "^0.29.1",
16310
- react: "^18.2.0",
16311
- "react-dom": "^18.2.0",
16351
+ axios: "1.7.4",
16352
+ classnames: "2.3.1",
16353
+ formik: "2.2.9",
16354
+ "i18next": "22.5.1",
16355
+ "js-logger": "1.6.1",
16356
+ ramda: "0.29.1",
16357
+ react: "18.2.0",
16358
+ "react-dom": "18.2.0",
16312
16359
  "react-helmet": "^6.1.0",
16313
- "react-i18next": "^13.3.1",
16314
- "react-router-dom": "^5.3.4",
16315
- "react-toastify": "^8.2.0",
16316
- yup: "^0.32.11",
16360
+ "react-i18next": "12.3.1",
16361
+ "react-router-dom": "5.3.3",
16362
+ "react-toastify": "8.0.2",
16363
+ yup: "0.32.11",
16317
16364
  };
16318
16365
 
16319
16366
  var nano = {
@@ -16549,6 +16596,8 @@ const isFormData = (thing) => {
16549
16596
  */
16550
16597
  const isURLSearchParams = kindOfTest('URLSearchParams');
16551
16598
 
16599
+ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
16600
+
16552
16601
  /**
16553
16602
  * Trim excess whitespace off the beginning and end of a string
16554
16603
  *
@@ -16937,8 +16986,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
16937
16986
  const noop$1 = () => {};
16938
16987
 
16939
16988
  const toFiniteNumber = (value, defaultValue) => {
16940
- value = +value;
16941
- return Number.isFinite(value) ? value : defaultValue;
16989
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
16942
16990
  };
16943
16991
 
16944
16992
  const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
@@ -17008,7 +17056,37 @@ const isAsyncFn = kindOfTest('AsyncFunction');
17008
17056
  const isThenable = (thing) =>
17009
17057
  thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
17010
17058
 
17011
- var utils = {
17059
+ // original code
17060
+ // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
17061
+
17062
+ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
17063
+ if (setImmediateSupported) {
17064
+ return setImmediate;
17065
+ }
17066
+
17067
+ return postMessageSupported ? ((token, callbacks) => {
17068
+ _global.addEventListener("message", ({source, data}) => {
17069
+ if (source === _global && data === token) {
17070
+ callbacks.length && callbacks.shift()();
17071
+ }
17072
+ }, false);
17073
+
17074
+ return (cb) => {
17075
+ callbacks.push(cb);
17076
+ _global.postMessage(token, "*");
17077
+ }
17078
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
17079
+ })(
17080
+ typeof setImmediate === 'function',
17081
+ isFunction$1(_global.postMessage)
17082
+ );
17083
+
17084
+ const asap = typeof queueMicrotask !== 'undefined' ?
17085
+ queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
17086
+
17087
+ // *********************
17088
+
17089
+ var utils$1 = {
17012
17090
  isArray,
17013
17091
  isArrayBuffer,
17014
17092
  isBuffer: isBuffer$1,
@@ -17019,6 +17097,10 @@ var utils = {
17019
17097
  isBoolean,
17020
17098
  isObject,
17021
17099
  isPlainObject,
17100
+ isReadableStream,
17101
+ isRequest,
17102
+ isResponse,
17103
+ isHeaders,
17022
17104
  isUndefined,
17023
17105
  isDate,
17024
17106
  isFile,
@@ -17059,7 +17141,9 @@ var utils = {
17059
17141
  isSpecCompliantForm,
17060
17142
  toJSONObject,
17061
17143
  isAsyncFn,
17062
- isThenable
17144
+ isThenable,
17145
+ setImmediate: _setImmediate,
17146
+ asap
17063
17147
  };
17064
17148
 
17065
17149
  /**
@@ -17090,7 +17174,7 @@ function AxiosError(message, code, config, request, response) {
17090
17174
  response && (this.response = response);
17091
17175
  }
17092
17176
 
17093
- utils.inherits(AxiosError, Error, {
17177
+ utils$1.inherits(AxiosError, Error, {
17094
17178
  toJSON: function toJSON() {
17095
17179
  return {
17096
17180
  // Standard
@@ -17105,7 +17189,7 @@ utils.inherits(AxiosError, Error, {
17105
17189
  columnNumber: this.columnNumber,
17106
17190
  stack: this.stack,
17107
17191
  // Axios
17108
- config: utils.toJSONObject(this.config),
17192
+ config: utils$1.toJSONObject(this.config),
17109
17193
  code: this.code,
17110
17194
  status: this.response && this.response.status ? this.response.status : null
17111
17195
  };
@@ -17140,7 +17224,7 @@ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
17140
17224
  AxiosError.from = (error, code, config, request, response, customProps) => {
17141
17225
  const axiosError = Object.create(prototype$1);
17142
17226
 
17143
- utils.toFlatObject(error, axiosError, function filter(obj) {
17227
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
17144
17228
  return obj !== Error.prototype;
17145
17229
  }, prop => {
17146
17230
  return prop !== 'isAxiosError';
@@ -29290,7 +29374,7 @@ var FormData$2 = /*@__PURE__*/getDefaultExportFromCjs(form_data);
29290
29374
  * @returns {boolean}
29291
29375
  */
29292
29376
  function isVisitable(thing) {
29293
- return utils.isPlainObject(thing) || utils.isArray(thing);
29377
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
29294
29378
  }
29295
29379
 
29296
29380
  /**
@@ -29301,7 +29385,7 @@ function isVisitable(thing) {
29301
29385
  * @returns {string} the key without the brackets.
29302
29386
  */
29303
29387
  function removeBrackets(key) {
29304
- return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
29388
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
29305
29389
  }
29306
29390
 
29307
29391
  /**
@@ -29330,10 +29414,10 @@ function renderKey(path, key, dots) {
29330
29414
  * @returns {boolean}
29331
29415
  */
29332
29416
  function isFlatArray(arr) {
29333
- return utils.isArray(arr) && !arr.some(isVisitable);
29417
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
29334
29418
  }
29335
29419
 
29336
- const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
29420
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
29337
29421
  return /^is[A-Z]/.test(prop);
29338
29422
  });
29339
29423
 
@@ -29361,7 +29445,7 @@ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
29361
29445
  * @returns
29362
29446
  */
29363
29447
  function toFormData(obj, formData, options) {
29364
- if (!utils.isObject(obj)) {
29448
+ if (!utils$1.isObject(obj)) {
29365
29449
  throw new TypeError('target must be an object');
29366
29450
  }
29367
29451
 
@@ -29369,13 +29453,13 @@ function toFormData(obj, formData, options) {
29369
29453
  formData = formData || new (FormData$2 || FormData)();
29370
29454
 
29371
29455
  // eslint-disable-next-line no-param-reassign
29372
- options = utils.toFlatObject(options, {
29456
+ options = utils$1.toFlatObject(options, {
29373
29457
  metaTokens: true,
29374
29458
  dots: false,
29375
29459
  indexes: false
29376
29460
  }, false, function defined(option, source) {
29377
29461
  // eslint-disable-next-line no-eq-null,eqeqeq
29378
- return !utils.isUndefined(source[option]);
29462
+ return !utils$1.isUndefined(source[option]);
29379
29463
  });
29380
29464
 
29381
29465
  const metaTokens = options.metaTokens;
@@ -29384,24 +29468,24 @@ function toFormData(obj, formData, options) {
29384
29468
  const dots = options.dots;
29385
29469
  const indexes = options.indexes;
29386
29470
  const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
29387
- const useBlob = _Blob && utils.isSpecCompliantForm(formData);
29471
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
29388
29472
 
29389
- if (!utils.isFunction(visitor)) {
29473
+ if (!utils$1.isFunction(visitor)) {
29390
29474
  throw new TypeError('visitor must be a function');
29391
29475
  }
29392
29476
 
29393
29477
  function convertValue(value) {
29394
29478
  if (value === null) return '';
29395
29479
 
29396
- if (utils.isDate(value)) {
29480
+ if (utils$1.isDate(value)) {
29397
29481
  return value.toISOString();
29398
29482
  }
29399
29483
 
29400
- if (!useBlob && utils.isBlob(value)) {
29484
+ if (!useBlob && utils$1.isBlob(value)) {
29401
29485
  throw new AxiosError('Blob is not supported. Use a Buffer instead.');
29402
29486
  }
29403
29487
 
29404
- if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
29488
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
29405
29489
  return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
29406
29490
  }
29407
29491
 
@@ -29422,20 +29506,20 @@ function toFormData(obj, formData, options) {
29422
29506
  let arr = value;
29423
29507
 
29424
29508
  if (value && !path && typeof value === 'object') {
29425
- if (utils.endsWith(key, '{}')) {
29509
+ if (utils$1.endsWith(key, '{}')) {
29426
29510
  // eslint-disable-next-line no-param-reassign
29427
29511
  key = metaTokens ? key : key.slice(0, -2);
29428
29512
  // eslint-disable-next-line no-param-reassign
29429
29513
  value = JSON.stringify(value);
29430
29514
  } else if (
29431
- (utils.isArray(value) && isFlatArray(value)) ||
29432
- ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
29515
+ (utils$1.isArray(value) && isFlatArray(value)) ||
29516
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
29433
29517
  )) {
29434
29518
  // eslint-disable-next-line no-param-reassign
29435
29519
  key = removeBrackets(key);
29436
29520
 
29437
29521
  arr.forEach(function each(el, index) {
29438
- !(utils.isUndefined(el) || el === null) && formData.append(
29522
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
29439
29523
  // eslint-disable-next-line no-nested-ternary
29440
29524
  indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
29441
29525
  convertValue(el)
@@ -29463,7 +29547,7 @@ function toFormData(obj, formData, options) {
29463
29547
  });
29464
29548
 
29465
29549
  function build(value, path) {
29466
- if (utils.isUndefined(value)) return;
29550
+ if (utils$1.isUndefined(value)) return;
29467
29551
 
29468
29552
  if (stack.indexOf(value) !== -1) {
29469
29553
  throw Error('Circular reference detected in ' + path.join('.'));
@@ -29471,9 +29555,9 @@ function toFormData(obj, formData, options) {
29471
29555
 
29472
29556
  stack.push(value);
29473
29557
 
29474
- utils.forEach(value, function each(el, key) {
29475
- const result = !(utils.isUndefined(el) || el === null) && visitor.call(
29476
- formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
29558
+ utils$1.forEach(value, function each(el, key) {
29559
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
29560
+ formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
29477
29561
  );
29478
29562
 
29479
29563
  if (result === true) {
@@ -29484,7 +29568,7 @@ function toFormData(obj, formData, options) {
29484
29568
  stack.pop();
29485
29569
  }
29486
29570
 
29487
- if (!utils.isObject(obj)) {
29571
+ if (!utils$1.isObject(obj)) {
29488
29572
  throw new TypeError('data must be an object');
29489
29573
  }
29490
29574
 
@@ -29588,7 +29672,7 @@ function buildURL(url, params, options) {
29588
29672
  if (serializeFn) {
29589
29673
  serializedParams = serializeFn(params, options);
29590
29674
  } else {
29591
- serializedParams = utils.isURLSearchParams(params) ?
29675
+ serializedParams = utils$1.isURLSearchParams(params) ?
29592
29676
  params.toString() :
29593
29677
  new AxiosURLSearchParams(params, options).toString(_encode);
29594
29678
  }
@@ -29663,7 +29747,7 @@ class InterceptorManager {
29663
29747
  * @returns {void}
29664
29748
  */
29665
29749
  forEach(fn) {
29666
- utils.forEach(this.handlers, function forEachHandler(h) {
29750
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
29667
29751
  if (h !== null) {
29668
29752
  fn(h);
29669
29753
  }
@@ -29679,7 +29763,7 @@ var transitionalDefaults = {
29679
29763
 
29680
29764
  var URLSearchParams = require$$0$5.URLSearchParams;
29681
29765
 
29682
- var platform = {
29766
+ var platform$1 = {
29683
29767
  isNode: true,
29684
29768
  classes: {
29685
29769
  URLSearchParams,
@@ -29689,10 +29773,67 @@ var platform = {
29689
29773
  protocols: [ 'http', 'https', 'file', 'data' ]
29690
29774
  };
29691
29775
 
29776
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
29777
+
29778
+ /**
29779
+ * Determine if we're running in a standard browser environment
29780
+ *
29781
+ * This allows axios to run in a web worker, and react-native.
29782
+ * Both environments support XMLHttpRequest, but not fully standard globals.
29783
+ *
29784
+ * web workers:
29785
+ * typeof window -> undefined
29786
+ * typeof document -> undefined
29787
+ *
29788
+ * react-native:
29789
+ * navigator.product -> 'ReactNative'
29790
+ * nativescript
29791
+ * navigator.product -> 'NativeScript' or 'NS'
29792
+ *
29793
+ * @returns {boolean}
29794
+ */
29795
+ const hasStandardBrowserEnv = (
29796
+ (product) => {
29797
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
29798
+ })(typeof navigator !== 'undefined' && navigator.product);
29799
+
29800
+ /**
29801
+ * Determine if we're running in a standard browser webWorker environment
29802
+ *
29803
+ * Although the `isStandardBrowserEnv` method indicates that
29804
+ * `allows axios to run in a web worker`, the WebWorker will still be
29805
+ * filtered out due to its judgment standard
29806
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
29807
+ * This leads to a problem when axios post `FormData` in webWorker
29808
+ */
29809
+ const hasStandardBrowserWebWorkerEnv = (() => {
29810
+ return (
29811
+ typeof WorkerGlobalScope !== 'undefined' &&
29812
+ // eslint-disable-next-line no-undef
29813
+ self instanceof WorkerGlobalScope &&
29814
+ typeof self.importScripts === 'function'
29815
+ );
29816
+ })();
29817
+
29818
+ const origin = hasBrowserEnv && window.location.href || 'http://localhost';
29819
+
29820
+ var utils = /*#__PURE__*/Object.freeze({
29821
+ __proto__: null,
29822
+ hasBrowserEnv: hasBrowserEnv,
29823
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
29824
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
29825
+ origin: origin
29826
+ });
29827
+
29828
+ var platform = {
29829
+ ...utils,
29830
+ ...platform$1
29831
+ };
29832
+
29692
29833
  function toURLEncodedForm(data, options) {
29693
29834
  return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
29694
29835
  visitor: function(value, key, path, helpers) {
29695
- if (utils.isBuffer(value)) {
29836
+ if (platform.isNode && utils$1.isBuffer(value)) {
29696
29837
  this.append(key, value.toString('base64'));
29697
29838
  return false;
29698
29839
  }
@@ -29714,7 +29855,7 @@ function parsePropPath(name) {
29714
29855
  // foo.x.y.z
29715
29856
  // foo-x-y-z
29716
29857
  // foo x y z
29717
- return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
29858
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
29718
29859
  return match[0] === '[]' ? '' : match[1] || match[0];
29719
29860
  });
29720
29861
  }
@@ -29749,12 +29890,15 @@ function arrayToObject(arr) {
29749
29890
  function formDataToJSON(formData) {
29750
29891
  function buildPath(path, value, target, index) {
29751
29892
  let name = path[index++];
29893
+
29894
+ if (name === '__proto__') return true;
29895
+
29752
29896
  const isNumericKey = Number.isFinite(+name);
29753
29897
  const isLast = index >= path.length;
29754
- name = !name && utils.isArray(target) ? target.length : name;
29898
+ name = !name && utils$1.isArray(target) ? target.length : name;
29755
29899
 
29756
29900
  if (isLast) {
29757
- if (utils.hasOwnProp(target, name)) {
29901
+ if (utils$1.hasOwnProp(target, name)) {
29758
29902
  target[name] = [target[name], value];
29759
29903
  } else {
29760
29904
  target[name] = value;
@@ -29763,23 +29907,23 @@ function formDataToJSON(formData) {
29763
29907
  return !isNumericKey;
29764
29908
  }
29765
29909
 
29766
- if (!target[name] || !utils.isObject(target[name])) {
29910
+ if (!target[name] || !utils$1.isObject(target[name])) {
29767
29911
  target[name] = [];
29768
29912
  }
29769
29913
 
29770
29914
  const result = buildPath(path, value, target[name], index);
29771
29915
 
29772
- if (result && utils.isArray(target[name])) {
29916
+ if (result && utils$1.isArray(target[name])) {
29773
29917
  target[name] = arrayToObject(target[name]);
29774
29918
  }
29775
29919
 
29776
29920
  return !isNumericKey;
29777
29921
  }
29778
29922
 
29779
- if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
29923
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
29780
29924
  const obj = {};
29781
29925
 
29782
- utils.forEachEntry(formData, (name, value) => {
29926
+ utils$1.forEachEntry(formData, (name, value) => {
29783
29927
  buildPath(parsePropPath(name), value, obj, 0);
29784
29928
  });
29785
29929
 
@@ -29800,10 +29944,10 @@ function formDataToJSON(formData) {
29800
29944
  * @returns {string} A stringified version of the rawValue.
29801
29945
  */
29802
29946
  function stringifySafely(rawValue, parser, encoder) {
29803
- if (utils.isString(rawValue)) {
29947
+ if (utils$1.isString(rawValue)) {
29804
29948
  try {
29805
29949
  (parser || JSON.parse)(rawValue);
29806
- return utils.trim(rawValue);
29950
+ return utils$1.trim(rawValue);
29807
29951
  } catch (e) {
29808
29952
  if (e.name !== 'SyntaxError') {
29809
29953
  throw e;
@@ -29818,38 +29962,36 @@ const defaults = {
29818
29962
 
29819
29963
  transitional: transitionalDefaults,
29820
29964
 
29821
- adapter: ['xhr', 'http'],
29965
+ adapter: ['xhr', 'http', 'fetch'],
29822
29966
 
29823
29967
  transformRequest: [function transformRequest(data, headers) {
29824
29968
  const contentType = headers.getContentType() || '';
29825
29969
  const hasJSONContentType = contentType.indexOf('application/json') > -1;
29826
- const isObjectPayload = utils.isObject(data);
29970
+ const isObjectPayload = utils$1.isObject(data);
29827
29971
 
29828
- if (isObjectPayload && utils.isHTMLForm(data)) {
29972
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
29829
29973
  data = new FormData(data);
29830
29974
  }
29831
29975
 
29832
- const isFormData = utils.isFormData(data);
29976
+ const isFormData = utils$1.isFormData(data);
29833
29977
 
29834
29978
  if (isFormData) {
29835
- if (!hasJSONContentType) {
29836
- return data;
29837
- }
29838
29979
  return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
29839
29980
  }
29840
29981
 
29841
- if (utils.isArrayBuffer(data) ||
29842
- utils.isBuffer(data) ||
29843
- utils.isStream(data) ||
29844
- utils.isFile(data) ||
29845
- utils.isBlob(data)
29982
+ if (utils$1.isArrayBuffer(data) ||
29983
+ utils$1.isBuffer(data) ||
29984
+ utils$1.isStream(data) ||
29985
+ utils$1.isFile(data) ||
29986
+ utils$1.isBlob(data) ||
29987
+ utils$1.isReadableStream(data)
29846
29988
  ) {
29847
29989
  return data;
29848
29990
  }
29849
- if (utils.isArrayBufferView(data)) {
29991
+ if (utils$1.isArrayBufferView(data)) {
29850
29992
  return data.buffer;
29851
29993
  }
29852
- if (utils.isURLSearchParams(data)) {
29994
+ if (utils$1.isURLSearchParams(data)) {
29853
29995
  headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
29854
29996
  return data.toString();
29855
29997
  }
@@ -29861,7 +30003,7 @@ const defaults = {
29861
30003
  return toURLEncodedForm(data, this.formSerializer).toString();
29862
30004
  }
29863
30005
 
29864
- if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
30006
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
29865
30007
  const _FormData = this.env && this.env.FormData;
29866
30008
 
29867
30009
  return toFormData(
@@ -29885,7 +30027,11 @@ const defaults = {
29885
30027
  const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
29886
30028
  const JSONRequested = this.responseType === 'json';
29887
30029
 
29888
- if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
30030
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
30031
+ return data;
30032
+ }
30033
+
30034
+ if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
29889
30035
  const silentJSONParsing = transitional && transitional.silentJSONParsing;
29890
30036
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
29891
30037
 
@@ -29933,7 +30079,7 @@ const defaults = {
29933
30079
  }
29934
30080
  };
29935
30081
 
29936
- utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
30082
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
29937
30083
  defaults.headers[method] = {};
29938
30084
  });
29939
30085
 
@@ -29941,7 +30087,7 @@ var defaults$1 = defaults;
29941
30087
 
29942
30088
  // RawAxiosHeaders whose duplicates are ignored by node
29943
30089
  // c.f. https://nodejs.org/api/http.html#http_message_headers
29944
- const ignoreDuplicateOf = utils.toObjectSet([
30090
+ const ignoreDuplicateOf = utils$1.toObjectSet([
29945
30091
  'age', 'authorization', 'content-length', 'content-type', 'etag',
29946
30092
  'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
29947
30093
  'last-modified', 'location', 'max-forwards', 'proxy-authorization',
@@ -30002,7 +30148,7 @@ function normalizeValue(value) {
30002
30148
  return value;
30003
30149
  }
30004
30150
 
30005
- return utils.isArray(value) ? value.map(normalizeValue) : String(value);
30151
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
30006
30152
  }
30007
30153
 
30008
30154
  function parseTokens(str) {
@@ -30020,7 +30166,7 @@ function parseTokens(str) {
30020
30166
  const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
30021
30167
 
30022
30168
  function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
30023
- if (utils.isFunction(filter)) {
30169
+ if (utils$1.isFunction(filter)) {
30024
30170
  return filter.call(this, value, header);
30025
30171
  }
30026
30172
 
@@ -30028,13 +30174,13 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
30028
30174
  value = header;
30029
30175
  }
30030
30176
 
30031
- if (!utils.isString(value)) return;
30177
+ if (!utils$1.isString(value)) return;
30032
30178
 
30033
- if (utils.isString(filter)) {
30179
+ if (utils$1.isString(filter)) {
30034
30180
  return value.indexOf(filter) !== -1;
30035
30181
  }
30036
30182
 
30037
- if (utils.isRegExp(filter)) {
30183
+ if (utils$1.isRegExp(filter)) {
30038
30184
  return filter.test(value);
30039
30185
  }
30040
30186
  }
@@ -30047,7 +30193,7 @@ function formatHeader(header) {
30047
30193
  }
30048
30194
 
30049
30195
  function buildAccessors(obj, header) {
30050
- const accessorName = utils.toCamelCase(' ' + header);
30196
+ const accessorName = utils$1.toCamelCase(' ' + header);
30051
30197
 
30052
30198
  ['get', 'set', 'has'].forEach(methodName => {
30053
30199
  Object.defineProperty(obj, methodName + accessorName, {
@@ -30074,7 +30220,7 @@ class AxiosHeaders {
30074
30220
  throw new Error('header name must be a non-empty string');
30075
30221
  }
30076
30222
 
30077
- const key = utils.findKey(self, lHeader);
30223
+ const key = utils$1.findKey(self, lHeader);
30078
30224
 
30079
30225
  if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
30080
30226
  self[key || _header] = normalizeValue(_value);
@@ -30082,12 +30228,16 @@ class AxiosHeaders {
30082
30228
  }
30083
30229
 
30084
30230
  const setHeaders = (headers, _rewrite) =>
30085
- utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
30231
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
30086
30232
 
30087
- if (utils.isPlainObject(header) || header instanceof this.constructor) {
30233
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
30088
30234
  setHeaders(header, valueOrRewrite);
30089
- } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
30235
+ } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
30090
30236
  setHeaders(parseHeaders(header), valueOrRewrite);
30237
+ } else if (utils$1.isHeaders(header)) {
30238
+ for (const [key, value] of header.entries()) {
30239
+ setHeader(value, key, rewrite);
30240
+ }
30091
30241
  } else {
30092
30242
  header != null && setHeader(valueOrRewrite, header, rewrite);
30093
30243
  }
@@ -30099,7 +30249,7 @@ class AxiosHeaders {
30099
30249
  header = normalizeHeader(header);
30100
30250
 
30101
30251
  if (header) {
30102
- const key = utils.findKey(this, header);
30252
+ const key = utils$1.findKey(this, header);
30103
30253
 
30104
30254
  if (key) {
30105
30255
  const value = this[key];
@@ -30112,11 +30262,11 @@ class AxiosHeaders {
30112
30262
  return parseTokens(value);
30113
30263
  }
30114
30264
 
30115
- if (utils.isFunction(parser)) {
30265
+ if (utils$1.isFunction(parser)) {
30116
30266
  return parser.call(this, value, key);
30117
30267
  }
30118
30268
 
30119
- if (utils.isRegExp(parser)) {
30269
+ if (utils$1.isRegExp(parser)) {
30120
30270
  return parser.exec(value);
30121
30271
  }
30122
30272
 
@@ -30129,7 +30279,7 @@ class AxiosHeaders {
30129
30279
  header = normalizeHeader(header);
30130
30280
 
30131
30281
  if (header) {
30132
- const key = utils.findKey(this, header);
30282
+ const key = utils$1.findKey(this, header);
30133
30283
 
30134
30284
  return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
30135
30285
  }
@@ -30145,7 +30295,7 @@ class AxiosHeaders {
30145
30295
  _header = normalizeHeader(_header);
30146
30296
 
30147
30297
  if (_header) {
30148
- const key = utils.findKey(self, _header);
30298
+ const key = utils$1.findKey(self, _header);
30149
30299
 
30150
30300
  if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
30151
30301
  delete self[key];
@@ -30155,7 +30305,7 @@ class AxiosHeaders {
30155
30305
  }
30156
30306
  }
30157
30307
 
30158
- if (utils.isArray(header)) {
30308
+ if (utils$1.isArray(header)) {
30159
30309
  header.forEach(deleteHeader);
30160
30310
  } else {
30161
30311
  deleteHeader(header);
@@ -30184,8 +30334,8 @@ class AxiosHeaders {
30184
30334
  const self = this;
30185
30335
  const headers = {};
30186
30336
 
30187
- utils.forEach(this, (value, header) => {
30188
- const key = utils.findKey(headers, header);
30337
+ utils$1.forEach(this, (value, header) => {
30338
+ const key = utils$1.findKey(headers, header);
30189
30339
 
30190
30340
  if (key) {
30191
30341
  self[key] = normalizeValue(value);
@@ -30214,8 +30364,8 @@ class AxiosHeaders {
30214
30364
  toJSON(asStrings) {
30215
30365
  const obj = Object.create(null);
30216
30366
 
30217
- utils.forEach(this, (value, header) => {
30218
- value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
30367
+ utils$1.forEach(this, (value, header) => {
30368
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
30219
30369
  });
30220
30370
 
30221
30371
  return obj;
@@ -30262,7 +30412,7 @@ class AxiosHeaders {
30262
30412
  }
30263
30413
  }
30264
30414
 
30265
- utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
30415
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
30266
30416
 
30267
30417
  return this;
30268
30418
  }
@@ -30271,7 +30421,7 @@ class AxiosHeaders {
30271
30421
  AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
30272
30422
 
30273
30423
  // reserved names hotfix
30274
- utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
30424
+ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
30275
30425
  let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
30276
30426
  return {
30277
30427
  get: () => value,
@@ -30281,7 +30431,7 @@ utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
30281
30431
  }
30282
30432
  });
30283
30433
 
30284
- utils.freezeMethods(AxiosHeaders);
30434
+ utils$1.freezeMethods(AxiosHeaders);
30285
30435
 
30286
30436
  var AxiosHeaders$1 = AxiosHeaders;
30287
30437
 
@@ -30299,7 +30449,7 @@ function transformData(fns, response) {
30299
30449
  const headers = AxiosHeaders$1.from(context.headers);
30300
30450
  let data = context.data;
30301
30451
 
30302
- utils.forEach(fns, function transform(fn) {
30452
+ utils$1.forEach(fns, function transform(fn) {
30303
30453
  data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
30304
30454
  });
30305
30455
 
@@ -30327,7 +30477,7 @@ function CanceledError(message, config, request) {
30327
30477
  this.name = 'CanceledError';
30328
30478
  }
30329
30479
 
30330
- utils.inherits(CanceledError, AxiosError, {
30480
+ utils$1.inherits(CanceledError, AxiosError, {
30331
30481
  __CANCEL__: true
30332
30482
  });
30333
30483
 
@@ -30379,7 +30529,7 @@ function isAbsoluteURL(url) {
30379
30529
  */
30380
30530
  function combineURLs(baseURL, relativeURL) {
30381
30531
  return relativeURL
30382
- ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
30532
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
30383
30533
  : baseURL;
30384
30534
  }
30385
30535
 
@@ -31201,7 +31351,7 @@ followRedirects$1.exports.wrap = wrap;
31201
31351
  var followRedirectsExports = followRedirects$1.exports;
31202
31352
  var followRedirects = /*@__PURE__*/getDefaultExportFromCjs(followRedirectsExports);
31203
31353
 
31204
- const VERSION = "1.6.0";
31354
+ const VERSION = "1.7.4";
31205
31355
 
31206
31356
  function parseProtocol(url) {
31207
31357
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -31256,93 +31406,11 @@ function fromDataURI(uri, asBlob, options) {
31256
31406
  throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
31257
31407
  }
31258
31408
 
31259
- /**
31260
- * Throttle decorator
31261
- * @param {Function} fn
31262
- * @param {Number} freq
31263
- * @return {Function}
31264
- */
31265
- function throttle(fn, freq) {
31266
- let timestamp = 0;
31267
- const threshold = 1000 / freq;
31268
- let timer = null;
31269
- return function throttled(force, args) {
31270
- const now = Date.now();
31271
- if (force || now - timestamp > threshold) {
31272
- if (timer) {
31273
- clearTimeout(timer);
31274
- timer = null;
31275
- }
31276
- timestamp = now;
31277
- return fn.apply(null, args);
31278
- }
31279
- if (!timer) {
31280
- timer = setTimeout(() => {
31281
- timer = null;
31282
- timestamp = Date.now();
31283
- return fn.apply(null, args);
31284
- }, threshold - (now - timestamp));
31285
- }
31286
- };
31287
- }
31288
-
31289
- /**
31290
- * Calculate data maxRate
31291
- * @param {Number} [samplesCount= 10]
31292
- * @param {Number} [min= 1000]
31293
- * @returns {Function}
31294
- */
31295
- function speedometer(samplesCount, min) {
31296
- samplesCount = samplesCount || 10;
31297
- const bytes = new Array(samplesCount);
31298
- const timestamps = new Array(samplesCount);
31299
- let head = 0;
31300
- let tail = 0;
31301
- let firstSampleTS;
31302
-
31303
- min = min !== undefined ? min : 1000;
31304
-
31305
- return function push(chunkLength) {
31306
- const now = Date.now();
31307
-
31308
- const startedAt = timestamps[tail];
31309
-
31310
- if (!firstSampleTS) {
31311
- firstSampleTS = now;
31312
- }
31313
-
31314
- bytes[head] = chunkLength;
31315
- timestamps[head] = now;
31316
-
31317
- let i = tail;
31318
- let bytesCount = 0;
31319
-
31320
- while (i !== head) {
31321
- bytesCount += bytes[i++];
31322
- i = i % samplesCount;
31323
- }
31324
-
31325
- head = (head + 1) % samplesCount;
31326
-
31327
- if (head === tail) {
31328
- tail = (tail + 1) % samplesCount;
31329
- }
31330
-
31331
- if (now - firstSampleTS < min) {
31332
- return;
31333
- }
31334
-
31335
- const passed = startedAt && now - startedAt;
31336
-
31337
- return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
31338
- };
31339
- }
31340
-
31341
31409
  const kInternals = Symbol('internals');
31342
31410
 
31343
31411
  class AxiosTransformStream extends stream.Transform{
31344
31412
  constructor(options) {
31345
- options = utils.toFlatObject(options, {
31413
+ options = utils$1.toFlatObject(options, {
31346
31414
  maxRate: 0,
31347
31415
  chunkSize: 64 * 1024,
31348
31416
  minChunkSize: 100,
@@ -31350,19 +31418,15 @@ class AxiosTransformStream extends stream.Transform{
31350
31418
  ticksRate: 2,
31351
31419
  samplesCount: 15
31352
31420
  }, null, (prop, source) => {
31353
- return !utils.isUndefined(source[prop]);
31421
+ return !utils$1.isUndefined(source[prop]);
31354
31422
  });
31355
31423
 
31356
31424
  super({
31357
31425
  readableHighWaterMark: options.chunkSize
31358
31426
  });
31359
31427
 
31360
- const self = this;
31361
-
31362
31428
  const internals = this[kInternals] = {
31363
- length: options.length,
31364
31429
  timeWindow: options.timeWindow,
31365
- ticksRate: options.ticksRate,
31366
31430
  chunkSize: options.chunkSize,
31367
31431
  maxRate: options.maxRate,
31368
31432
  minChunkSize: options.minChunkSize,
@@ -31374,8 +31438,6 @@ class AxiosTransformStream extends stream.Transform{
31374
31438
  onReadCallback: null
31375
31439
  };
31376
31440
 
31377
- const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);
31378
-
31379
31441
  this.on('newListener', event => {
31380
31442
  if (event === 'progress') {
31381
31443
  if (!internals.isCaptured) {
@@ -31383,38 +31445,6 @@ class AxiosTransformStream extends stream.Transform{
31383
31445
  }
31384
31446
  }
31385
31447
  });
31386
-
31387
- let bytesNotified = 0;
31388
-
31389
- internals.updateProgress = throttle(function throttledHandler() {
31390
- const totalBytes = internals.length;
31391
- const bytesTransferred = internals.bytesSeen;
31392
- const progressBytes = bytesTransferred - bytesNotified;
31393
- if (!progressBytes || self.destroyed) return;
31394
-
31395
- const rate = _speedometer(progressBytes);
31396
-
31397
- bytesNotified = bytesTransferred;
31398
-
31399
- process.nextTick(() => {
31400
- self.emit('progress', {
31401
- 'loaded': bytesTransferred,
31402
- 'total': totalBytes,
31403
- 'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined,
31404
- 'bytes': progressBytes,
31405
- 'rate': rate ? rate : undefined,
31406
- 'estimated': rate && totalBytes && bytesTransferred <= totalBytes ?
31407
- (totalBytes - bytesTransferred) / rate : undefined
31408
- });
31409
- });
31410
- }, internals.ticksRate);
31411
-
31412
- const onFinish = () => {
31413
- internals.updateProgress(true);
31414
- };
31415
-
31416
- this.once('end', onFinish);
31417
- this.once('error', onFinish);
31418
31448
  }
31419
31449
 
31420
31450
  _read(size) {
@@ -31428,7 +31458,6 @@ class AxiosTransformStream extends stream.Transform{
31428
31458
  }
31429
31459
 
31430
31460
  _transform(chunk, encoding, callback) {
31431
- const self = this;
31432
31461
  const internals = this[kInternals];
31433
31462
  const maxRate = internals.maxRate;
31434
31463
 
@@ -31440,16 +31469,14 @@ class AxiosTransformStream extends stream.Transform{
31440
31469
  const bytesThreshold = (maxRate / divider);
31441
31470
  const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
31442
31471
 
31443
- function pushChunk(_chunk, _callback) {
31472
+ const pushChunk = (_chunk, _callback) => {
31444
31473
  const bytes = Buffer.byteLength(_chunk);
31445
31474
  internals.bytesSeen += bytes;
31446
31475
  internals.bytes += bytes;
31447
31476
 
31448
- if (internals.isCaptured) {
31449
- internals.updateProgress();
31450
- }
31477
+ internals.isCaptured && this.emit('progress', internals.bytesSeen);
31451
31478
 
31452
- if (self.push(_chunk)) {
31479
+ if (this.push(_chunk)) {
31453
31480
  process.nextTick(_callback);
31454
31481
  } else {
31455
31482
  internals.onReadCallback = () => {
@@ -31457,7 +31484,7 @@ class AxiosTransformStream extends stream.Transform{
31457
31484
  process.nextTick(_callback);
31458
31485
  };
31459
31486
  }
31460
- }
31487
+ };
31461
31488
 
31462
31489
  const transformChunk = (_chunk, _callback) => {
31463
31490
  const chunkSize = Buffer.byteLength(_chunk);
@@ -31514,11 +31541,6 @@ class AxiosTransformStream extends stream.Transform{
31514
31541
  }
31515
31542
  });
31516
31543
  }
31517
-
31518
- setLength(length) {
31519
- this[kInternals].length = +length;
31520
- return this;
31521
- }
31522
31544
  }
31523
31545
 
31524
31546
  var AxiosTransformStream$1 = AxiosTransformStream;
@@ -31537,9 +31559,9 @@ const readBlob = async function* (blob) {
31537
31559
  }
31538
31560
  };
31539
31561
 
31540
- const BOUNDARY_ALPHABET = utils.ALPHABET.ALPHA_DIGIT + '-_';
31562
+ const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_';
31541
31563
 
31542
- const textEncoder = new TextEncoder();
31564
+ const textEncoder = new TextEncoder$1();
31543
31565
 
31544
31566
  const CRLF = '\r\n';
31545
31567
  const CRLF_BYTES = textEncoder.encode(CRLF);
@@ -31548,7 +31570,7 @@ const CRLF_BYTES_COUNT = 2;
31548
31570
  class FormDataPart {
31549
31571
  constructor(name, value) {
31550
31572
  const {escapeName} = this.constructor;
31551
- const isStringValue = utils.isString(value);
31573
+ const isStringValue = utils$1.isString(value);
31552
31574
 
31553
31575
  let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${
31554
31576
  !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''
@@ -31575,7 +31597,7 @@ class FormDataPart {
31575
31597
 
31576
31598
  const {value} = this;
31577
31599
 
31578
- if(utils.isTypedArray(value)) {
31600
+ if(utils$1.isTypedArray(value)) {
31579
31601
  yield value;
31580
31602
  } else {
31581
31603
  yield* readBlob(value);
@@ -31597,10 +31619,10 @@ const formDataToStream = (form, headersHandler, options) => {
31597
31619
  const {
31598
31620
  tag = 'form-data-boundary',
31599
31621
  size = 25,
31600
- boundary = tag + '-' + utils.generateString(size, BOUNDARY_ALPHABET)
31622
+ boundary = tag + '-' + utils$1.generateString(size, BOUNDARY_ALPHABET)
31601
31623
  } = options || {};
31602
31624
 
31603
- if(!utils.isFormData(form)) {
31625
+ if(!utils$1.isFormData(form)) {
31604
31626
  throw TypeError('FormData instance required');
31605
31627
  }
31606
31628
 
@@ -31620,7 +31642,7 @@ const formDataToStream = (form, headersHandler, options) => {
31620
31642
 
31621
31643
  contentLength += boundaryBytes.byteLength * parts.length;
31622
31644
 
31623
- contentLength = utils.toFiniteNumber(contentLength);
31645
+ contentLength = utils$1.toFiniteNumber(contentLength);
31624
31646
 
31625
31647
  const computedHeaders = {
31626
31648
  'Content-Type': `multipart/form-data; boundary=${boundary}`
@@ -31666,7 +31688,7 @@ class ZlibHeaderTransformStream extends stream.Transform {
31666
31688
  }
31667
31689
 
31668
31690
  const callbackify = (fn, reducer) => {
31669
- return utils.isAsyncFn(fn) ? function (...args) {
31691
+ return utils$1.isAsyncFn(fn) ? function (...args) {
31670
31692
  const cb = args.pop();
31671
31693
  fn.apply(this, args).then((value) => {
31672
31694
  try {
@@ -31678,6 +31700,142 @@ const callbackify = (fn, reducer) => {
31678
31700
  } : fn;
31679
31701
  };
31680
31702
 
31703
+ /**
31704
+ * Calculate data maxRate
31705
+ * @param {Number} [samplesCount= 10]
31706
+ * @param {Number} [min= 1000]
31707
+ * @returns {Function}
31708
+ */
31709
+ function speedometer(samplesCount, min) {
31710
+ samplesCount = samplesCount || 10;
31711
+ const bytes = new Array(samplesCount);
31712
+ const timestamps = new Array(samplesCount);
31713
+ let head = 0;
31714
+ let tail = 0;
31715
+ let firstSampleTS;
31716
+
31717
+ min = min !== undefined ? min : 1000;
31718
+
31719
+ return function push(chunkLength) {
31720
+ const now = Date.now();
31721
+
31722
+ const startedAt = timestamps[tail];
31723
+
31724
+ if (!firstSampleTS) {
31725
+ firstSampleTS = now;
31726
+ }
31727
+
31728
+ bytes[head] = chunkLength;
31729
+ timestamps[head] = now;
31730
+
31731
+ let i = tail;
31732
+ let bytesCount = 0;
31733
+
31734
+ while (i !== head) {
31735
+ bytesCount += bytes[i++];
31736
+ i = i % samplesCount;
31737
+ }
31738
+
31739
+ head = (head + 1) % samplesCount;
31740
+
31741
+ if (head === tail) {
31742
+ tail = (tail + 1) % samplesCount;
31743
+ }
31744
+
31745
+ if (now - firstSampleTS < min) {
31746
+ return;
31747
+ }
31748
+
31749
+ const passed = startedAt && now - startedAt;
31750
+
31751
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
31752
+ };
31753
+ }
31754
+
31755
+ /**
31756
+ * Throttle decorator
31757
+ * @param {Function} fn
31758
+ * @param {Number} freq
31759
+ * @return {Function}
31760
+ */
31761
+ function throttle(fn, freq) {
31762
+ let timestamp = 0;
31763
+ let threshold = 1000 / freq;
31764
+ let lastArgs;
31765
+ let timer;
31766
+
31767
+ const invoke = (args, now = Date.now()) => {
31768
+ timestamp = now;
31769
+ lastArgs = null;
31770
+ if (timer) {
31771
+ clearTimeout(timer);
31772
+ timer = null;
31773
+ }
31774
+ fn.apply(null, args);
31775
+ };
31776
+
31777
+ const throttled = (...args) => {
31778
+ const now = Date.now();
31779
+ const passed = now - timestamp;
31780
+ if ( passed >= threshold) {
31781
+ invoke(args, now);
31782
+ } else {
31783
+ lastArgs = args;
31784
+ if (!timer) {
31785
+ timer = setTimeout(() => {
31786
+ timer = null;
31787
+ invoke(lastArgs);
31788
+ }, threshold - passed);
31789
+ }
31790
+ }
31791
+ };
31792
+
31793
+ const flush = () => lastArgs && invoke(lastArgs);
31794
+
31795
+ return [throttled, flush];
31796
+ }
31797
+
31798
+ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
31799
+ let bytesNotified = 0;
31800
+ const _speedometer = speedometer(50, 250);
31801
+
31802
+ return throttle(e => {
31803
+ const loaded = e.loaded;
31804
+ const total = e.lengthComputable ? e.total : undefined;
31805
+ const progressBytes = loaded - bytesNotified;
31806
+ const rate = _speedometer(progressBytes);
31807
+ const inRange = loaded <= total;
31808
+
31809
+ bytesNotified = loaded;
31810
+
31811
+ const data = {
31812
+ loaded,
31813
+ total,
31814
+ progress: total ? (loaded / total) : undefined,
31815
+ bytes: progressBytes,
31816
+ rate: rate ? rate : undefined,
31817
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
31818
+ event: e,
31819
+ lengthComputable: total != null,
31820
+ [isDownloadStream ? 'download' : 'upload']: true
31821
+ };
31822
+
31823
+ listener(data);
31824
+ }, freq);
31825
+ };
31826
+
31827
+ const progressEventDecorator = (total, throttled) => {
31828
+ const lengthComputable = total != null;
31829
+
31830
+ return [(loaded) => throttled[0]({
31831
+ lengthComputable,
31832
+ total,
31833
+ loaded
31834
+ }), throttled[1]];
31835
+ };
31836
+
31837
+ const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
31838
+
31681
31839
  const zlibOptions = {
31682
31840
  flush: zlib.constants.Z_SYNC_FLUSH,
31683
31841
  finishFlush: zlib.constants.Z_SYNC_FLUSH
@@ -31688,7 +31846,7 @@ const brotliOptions = {
31688
31846
  finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
31689
31847
  };
31690
31848
 
31691
- const isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress);
31849
+ const isBrotliSupported = utils$1.isFunction(zlib.createBrotliDecompress);
31692
31850
 
31693
31851
  const {http: httpFollow, https: httpsFollow} = followRedirects;
31694
31852
 
@@ -31698,6 +31856,14 @@ const supportedProtocols = platform.protocols.map(protocol => {
31698
31856
  return protocol + ':';
31699
31857
  });
31700
31858
 
31859
+ const flushOnFinish = (stream, [throttled, flush]) => {
31860
+ stream
31861
+ .on('end', flush)
31862
+ .on('error', flush);
31863
+
31864
+ return throttled;
31865
+ };
31866
+
31701
31867
  /**
31702
31868
  * If the proxy or config beforeRedirects functions are defined, call them with the options
31703
31869
  * object.
@@ -31706,12 +31872,12 @@ const supportedProtocols = platform.protocols.map(protocol => {
31706
31872
  *
31707
31873
  * @returns {Object<string, any>}
31708
31874
  */
31709
- function dispatchBeforeRedirect(options) {
31875
+ function dispatchBeforeRedirect(options, responseDetails) {
31710
31876
  if (options.beforeRedirects.proxy) {
31711
31877
  options.beforeRedirects.proxy(options);
31712
31878
  }
31713
31879
  if (options.beforeRedirects.config) {
31714
- options.beforeRedirects.config(options);
31880
+ options.beforeRedirects.config(options, responseDetails);
31715
31881
  }
31716
31882
  }
31717
31883
 
@@ -31768,7 +31934,7 @@ function setProxy(options, configProxy, location) {
31768
31934
  };
31769
31935
  }
31770
31936
 
31771
- const isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process';
31937
+ const isHttpAdapterSupported = typeof process !== 'undefined' && utils$1.kindOf(process) === 'process';
31772
31938
 
31773
31939
  // temporary hotfix
31774
31940
 
@@ -31798,7 +31964,7 @@ const wrapAsync = (asyncExecutor) => {
31798
31964
  };
31799
31965
 
31800
31966
  const resolveFamily = ({address, family}) => {
31801
- if (!utils.isString(address)) {
31967
+ if (!utils$1.isString(address)) {
31802
31968
  throw TypeError('address must be a string');
31803
31969
  }
31804
31970
  return ({
@@ -31807,7 +31973,7 @@ const resolveFamily = ({address, family}) => {
31807
31973
  });
31808
31974
  };
31809
31975
 
31810
- const buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family});
31976
+ const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {address, family});
31811
31977
 
31812
31978
  /*eslint consistent-return:0*/
31813
31979
  var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
@@ -31820,11 +31986,15 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
31820
31986
  let req;
31821
31987
 
31822
31988
  if (lookup) {
31823
- const _lookup = callbackify(lookup, (value) => utils.isArray(value) ? value : [value]);
31989
+ const _lookup = callbackify(lookup, (value) => utils$1.isArray(value) ? value : [value]);
31824
31990
  // hotfix to support opt.all option which is required for node 20.x
31825
31991
  lookup = (hostname, opt, cb) => {
31826
31992
  _lookup(hostname, opt, (err, arg0, arg1) => {
31827
- const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
31993
+ if (err) {
31994
+ return cb(err);
31995
+ }
31996
+
31997
+ const addresses = utils$1.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
31828
31998
 
31829
31999
  opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
31830
32000
  });
@@ -31832,7 +32002,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
31832
32002
  }
31833
32003
 
31834
32004
  // temporary internal emitter until the AxiosRequest class will be implemented
31835
- const emitter = new require$$0$2();
32005
+ const emitter = new EventEmitter$1();
31836
32006
 
31837
32007
  const onFinished = () => {
31838
32008
  if (config.cancelToken) {
@@ -31869,7 +32039,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
31869
32039
 
31870
32040
  // Parse url
31871
32041
  const fullPath = buildFullPath(config.baseURL, config.url);
31872
- const parsed = new URL(fullPath, 'http://localhost');
32042
+ const parsed = new URL(fullPath, utils$1.hasBrowserEnv ? platform.origin : undefined);
31873
32043
  const protocol = parsed.protocol || supportedProtocols[0];
31874
32044
 
31875
32045
  if (protocol === 'data:') {
@@ -31896,7 +32066,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
31896
32066
  convertedData = convertedData.toString(responseEncoding);
31897
32067
 
31898
32068
  if (!responseEncoding || responseEncoding === 'utf8') {
31899
- convertedData = utils.stripBOM(convertedData);
32069
+ convertedData = utils$1.stripBOM(convertedData);
31900
32070
  }
31901
32071
  } else if (responseType === 'stream') {
31902
32072
  convertedData = stream.Readable.from(convertedData);
@@ -31927,14 +32097,13 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
31927
32097
  // Only set header if it hasn't been set in config
31928
32098
  headers.set('User-Agent', 'axios/' + VERSION, false);
31929
32099
 
31930
- const onDownloadProgress = config.onDownloadProgress;
31931
- const onUploadProgress = config.onUploadProgress;
32100
+ const {onUploadProgress, onDownloadProgress} = config;
31932
32101
  const maxRate = config.maxRate;
31933
32102
  let maxUploadRate = undefined;
31934
32103
  let maxDownloadRate = undefined;
31935
32104
 
31936
32105
  // support for spec compliant FormData objects
31937
- if (utils.isSpecCompliantForm(data)) {
32106
+ if (utils$1.isSpecCompliantForm(data)) {
31938
32107
  const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
31939
32108
 
31940
32109
  data = formDataToStream(data, (formHeaders) => {
@@ -31944,7 +32113,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
31944
32113
  boundary: userBoundary && userBoundary[1] || undefined
31945
32114
  });
31946
32115
  // support for https://www.npmjs.com/package/form-data api
31947
- } else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {
32116
+ } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) {
31948
32117
  headers.set(data.getHeaders());
31949
32118
 
31950
32119
  if (!headers.hasContentLength()) {
@@ -31955,14 +32124,14 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
31955
32124
  } catch (e) {
31956
32125
  }
31957
32126
  }
31958
- } else if (utils.isBlob(data)) {
32127
+ } else if (utils$1.isBlob(data)) {
31959
32128
  data.size && headers.setContentType(data.type || 'application/octet-stream');
31960
32129
  headers.setContentLength(data.size || 0);
31961
32130
  data = stream.Readable.from(readBlob(data));
31962
- } else if (data && !utils.isStream(data)) {
31963
- if (Buffer.isBuffer(data)) ; else if (utils.isArrayBuffer(data)) {
32131
+ } else if (data && !utils$1.isStream(data)) {
32132
+ if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) {
31964
32133
  data = Buffer.from(new Uint8Array(data));
31965
- } else if (utils.isString(data)) {
32134
+ } else if (utils$1.isString(data)) {
31966
32135
  data = Buffer.from(data, 'utf-8');
31967
32136
  } else {
31968
32137
  return reject(new AxiosError(
@@ -31984,9 +32153,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
31984
32153
  }
31985
32154
  }
31986
32155
 
31987
- const contentLength = utils.toFiniteNumber(headers.getContentLength());
32156
+ const contentLength = utils$1.toFiniteNumber(headers.getContentLength());
31988
32157
 
31989
- if (utils.isArray(maxRate)) {
32158
+ if (utils$1.isArray(maxRate)) {
31990
32159
  maxUploadRate = maxRate[0];
31991
32160
  maxDownloadRate = maxRate[1];
31992
32161
  } else {
@@ -31994,20 +32163,21 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
31994
32163
  }
31995
32164
 
31996
32165
  if (data && (onUploadProgress || maxUploadRate)) {
31997
- if (!utils.isStream(data)) {
32166
+ if (!utils$1.isStream(data)) {
31998
32167
  data = stream.Readable.from(data, {objectMode: false});
31999
32168
  }
32000
32169
 
32001
32170
  data = stream.pipeline([data, new AxiosTransformStream$1({
32002
- length: contentLength,
32003
- maxRate: utils.toFiniteNumber(maxUploadRate)
32004
- })], utils.noop);
32005
-
32006
- onUploadProgress && data.on('progress', progress => {
32007
- onUploadProgress(Object.assign(progress, {
32008
- upload: true
32009
- }));
32010
- });
32171
+ maxRate: utils$1.toFiniteNumber(maxUploadRate)
32172
+ })], utils$1.noop);
32173
+
32174
+ onUploadProgress && data.on('progress', flushOnFinish(
32175
+ data,
32176
+ progressEventDecorator(
32177
+ contentLength,
32178
+ progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
32179
+ )
32180
+ ));
32011
32181
  }
32012
32182
 
32013
32183
  // HTTP basic authentication
@@ -32060,7 +32230,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
32060
32230
  };
32061
32231
 
32062
32232
  // cacheable-lookup integration hotfix
32063
- !utils.isUndefined(lookup) && (options.lookup = lookup);
32233
+ !utils$1.isUndefined(lookup) && (options.lookup = lookup);
32064
32234
 
32065
32235
  if (config.socketPath) {
32066
32236
  options.socketPath = config.socketPath;
@@ -32106,17 +32276,18 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
32106
32276
 
32107
32277
  const responseLength = +res.headers['content-length'];
32108
32278
 
32109
- if (onDownloadProgress) {
32279
+ if (onDownloadProgress || maxDownloadRate) {
32110
32280
  const transformStream = new AxiosTransformStream$1({
32111
- length: utils.toFiniteNumber(responseLength),
32112
- maxRate: utils.toFiniteNumber(maxDownloadRate)
32281
+ maxRate: utils$1.toFiniteNumber(maxDownloadRate)
32113
32282
  });
32114
32283
 
32115
- onDownloadProgress && transformStream.on('progress', progress => {
32116
- onDownloadProgress(Object.assign(progress, {
32117
- download: true
32118
- }));
32119
- });
32284
+ onDownloadProgress && transformStream.on('progress', flushOnFinish(
32285
+ transformStream,
32286
+ progressEventDecorator(
32287
+ responseLength,
32288
+ progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
32289
+ )
32290
+ ));
32120
32291
 
32121
32292
  streams.push(transformStream);
32122
32293
  }
@@ -32164,7 +32335,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
32164
32335
  }
32165
32336
  }
32166
32337
 
32167
- responseStream = streams.length > 1 ? stream.pipeline(streams, utils.noop) : streams[0];
32338
+ responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0];
32168
32339
 
32169
32340
  const offListeners = stream.finished(responseStream, () => {
32170
32341
  offListeners();
@@ -32226,7 +32397,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
32226
32397
  if (responseType !== 'arraybuffer') {
32227
32398
  responseData = responseData.toString(responseEncoding);
32228
32399
  if (!responseEncoding || responseEncoding === 'utf8') {
32229
- responseData = utils.stripBOM(responseData);
32400
+ responseData = utils$1.stripBOM(responseData);
32230
32401
  }
32231
32402
  }
32232
32403
  response.data = responseData;
@@ -32303,7 +32474,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
32303
32474
 
32304
32475
 
32305
32476
  // Send the request
32306
- if (utils.isStream(data)) {
32477
+ if (utils$1.isStream(data)) {
32307
32478
  let ended = false;
32308
32479
  let errored = false;
32309
32480
 
@@ -32329,55 +32500,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
32329
32500
  });
32330
32501
  };
32331
32502
 
32332
- var cookies = platform.isStandardBrowserEnv ?
32333
-
32334
- // Standard browser envs support document.cookie
32335
- (function standardBrowserEnv() {
32336
- return {
32337
- write: function write(name, value, expires, path, domain, secure) {
32338
- const cookie = [];
32339
- cookie.push(name + '=' + encodeURIComponent(value));
32340
-
32341
- if (utils.isNumber(expires)) {
32342
- cookie.push('expires=' + new Date(expires).toGMTString());
32343
- }
32344
-
32345
- if (utils.isString(path)) {
32346
- cookie.push('path=' + path);
32347
- }
32348
-
32349
- if (utils.isString(domain)) {
32350
- cookie.push('domain=' + domain);
32351
- }
32352
-
32353
- if (secure === true) {
32354
- cookie.push('secure');
32355
- }
32356
-
32357
- document.cookie = cookie.join('; ');
32358
- },
32359
-
32360
- read: function read(name) {
32361
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
32362
- return (match ? decodeURIComponent(match[3]) : null);
32363
- },
32364
-
32365
- remove: function remove(name) {
32366
- this.write(name, '', Date.now() - 86400000);
32367
- }
32368
- };
32369
- })() :
32370
-
32371
- // Non standard browser env (web workers, react-native) lack needed support.
32372
- (function nonStandardBrowserEnv() {
32373
- return {
32374
- write: function write() {},
32375
- read: function read() { return null; },
32376
- remove: function remove() {}
32377
- };
32378
- })();
32379
-
32380
- var isURLSameOrigin = platform.isStandardBrowserEnv ?
32503
+ var isURLSameOrigin = platform.hasStandardBrowserEnv ?
32381
32504
 
32382
32505
  // Standard browser envs have full support of the APIs needed to test
32383
32506
  // whether the request URL is of the same origin as current location.
@@ -32387,7 +32510,7 @@ var isURLSameOrigin = platform.isStandardBrowserEnv ?
32387
32510
  let originURL;
32388
32511
 
32389
32512
  /**
32390
- * Parse a URL to discover it's components
32513
+ * Parse a URL to discover its components
32391
32514
  *
32392
32515
  * @param {String} url The URL to be parsed
32393
32516
  * @returns {Object}
@@ -32427,7 +32550,7 @@ var isURLSameOrigin = platform.isStandardBrowserEnv ?
32427
32550
  * @returns {boolean} True if URL shares the same origin, otherwise false
32428
32551
  */
32429
32552
  return function isURLSameOrigin(requestURL) {
32430
- const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
32553
+ const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
32431
32554
  return (parsed.protocol === originURL.protocol &&
32432
32555
  parsed.host === originURL.host);
32433
32556
  };
@@ -32440,81 +32563,222 @@ var isURLSameOrigin = platform.isStandardBrowserEnv ?
32440
32563
  };
32441
32564
  })();
32442
32565
 
32443
- function progressEventReducer(listener, isDownloadStream) {
32444
- let bytesNotified = 0;
32445
- const _speedometer = speedometer(50, 250);
32566
+ var cookies = platform.hasStandardBrowserEnv ?
32446
32567
 
32447
- return e => {
32448
- const loaded = e.loaded;
32449
- const total = e.lengthComputable ? e.total : undefined;
32450
- const progressBytes = loaded - bytesNotified;
32451
- const rate = _speedometer(progressBytes);
32452
- const inRange = loaded <= total;
32568
+ // Standard browser envs support document.cookie
32569
+ {
32570
+ write(name, value, expires, path, domain, secure) {
32571
+ const cookie = [name + '=' + encodeURIComponent(value)];
32453
32572
 
32454
- bytesNotified = loaded;
32573
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
32455
32574
 
32456
- const data = {
32457
- loaded,
32458
- total,
32459
- progress: total ? (loaded / total) : undefined,
32460
- bytes: progressBytes,
32461
- rate: rate ? rate : undefined,
32462
- estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
32463
- event: e
32464
- };
32575
+ utils$1.isString(path) && cookie.push('path=' + path);
32465
32576
 
32466
- data[isDownloadStream ? 'download' : 'upload'] = true;
32577
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
32467
32578
 
32468
- listener(data);
32579
+ secure === true && cookie.push('secure');
32580
+
32581
+ document.cookie = cookie.join('; ');
32582
+ },
32583
+
32584
+ read(name) {
32585
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
32586
+ return (match ? decodeURIComponent(match[3]) : null);
32587
+ },
32588
+
32589
+ remove(name) {
32590
+ this.write(name, '', Date.now() - 86400000);
32591
+ }
32592
+ }
32593
+
32594
+ :
32595
+
32596
+ // Non-standard browser env (web workers, react-native) lack needed support.
32597
+ {
32598
+ write() {},
32599
+ read() {
32600
+ return null;
32601
+ },
32602
+ remove() {}
32603
+ };
32604
+
32605
+ const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
32606
+
32607
+ /**
32608
+ * Config-specific merge-function which creates a new config-object
32609
+ * by merging two configuration objects together.
32610
+ *
32611
+ * @param {Object} config1
32612
+ * @param {Object} config2
32613
+ *
32614
+ * @returns {Object} New object resulting from merging config2 to config1
32615
+ */
32616
+ function mergeConfig(config1, config2) {
32617
+ // eslint-disable-next-line no-param-reassign
32618
+ config2 = config2 || {};
32619
+ const config = {};
32620
+
32621
+ function getMergedValue(target, source, caseless) {
32622
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
32623
+ return utils$1.merge.call({caseless}, target, source);
32624
+ } else if (utils$1.isPlainObject(source)) {
32625
+ return utils$1.merge({}, source);
32626
+ } else if (utils$1.isArray(source)) {
32627
+ return source.slice();
32628
+ }
32629
+ return source;
32630
+ }
32631
+
32632
+ // eslint-disable-next-line consistent-return
32633
+ function mergeDeepProperties(a, b, caseless) {
32634
+ if (!utils$1.isUndefined(b)) {
32635
+ return getMergedValue(a, b, caseless);
32636
+ } else if (!utils$1.isUndefined(a)) {
32637
+ return getMergedValue(undefined, a, caseless);
32638
+ }
32639
+ }
32640
+
32641
+ // eslint-disable-next-line consistent-return
32642
+ function valueFromConfig2(a, b) {
32643
+ if (!utils$1.isUndefined(b)) {
32644
+ return getMergedValue(undefined, b);
32645
+ }
32646
+ }
32647
+
32648
+ // eslint-disable-next-line consistent-return
32649
+ function defaultToConfig2(a, b) {
32650
+ if (!utils$1.isUndefined(b)) {
32651
+ return getMergedValue(undefined, b);
32652
+ } else if (!utils$1.isUndefined(a)) {
32653
+ return getMergedValue(undefined, a);
32654
+ }
32655
+ }
32656
+
32657
+ // eslint-disable-next-line consistent-return
32658
+ function mergeDirectKeys(a, b, prop) {
32659
+ if (prop in config2) {
32660
+ return getMergedValue(a, b);
32661
+ } else if (prop in config1) {
32662
+ return getMergedValue(undefined, a);
32663
+ }
32664
+ }
32665
+
32666
+ const mergeMap = {
32667
+ url: valueFromConfig2,
32668
+ method: valueFromConfig2,
32669
+ data: valueFromConfig2,
32670
+ baseURL: defaultToConfig2,
32671
+ transformRequest: defaultToConfig2,
32672
+ transformResponse: defaultToConfig2,
32673
+ paramsSerializer: defaultToConfig2,
32674
+ timeout: defaultToConfig2,
32675
+ timeoutMessage: defaultToConfig2,
32676
+ withCredentials: defaultToConfig2,
32677
+ withXSRFToken: defaultToConfig2,
32678
+ adapter: defaultToConfig2,
32679
+ responseType: defaultToConfig2,
32680
+ xsrfCookieName: defaultToConfig2,
32681
+ xsrfHeaderName: defaultToConfig2,
32682
+ onUploadProgress: defaultToConfig2,
32683
+ onDownloadProgress: defaultToConfig2,
32684
+ decompress: defaultToConfig2,
32685
+ maxContentLength: defaultToConfig2,
32686
+ maxBodyLength: defaultToConfig2,
32687
+ beforeRedirect: defaultToConfig2,
32688
+ transport: defaultToConfig2,
32689
+ httpAgent: defaultToConfig2,
32690
+ httpsAgent: defaultToConfig2,
32691
+ cancelToken: defaultToConfig2,
32692
+ socketPath: defaultToConfig2,
32693
+ responseEncoding: defaultToConfig2,
32694
+ validateStatus: mergeDirectKeys,
32695
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
32469
32696
  };
32697
+
32698
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
32699
+ const merge = mergeMap[prop] || mergeDeepProperties;
32700
+ const configValue = merge(config1[prop], config2[prop], prop);
32701
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
32702
+ });
32703
+
32704
+ return config;
32470
32705
  }
32471
32706
 
32472
- const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
32707
+ var resolveConfig = (config) => {
32708
+ const newConfig = mergeConfig({}, config);
32473
32709
 
32474
- var xhrAdapter = isXHRAdapterSupported && function (config) {
32475
- return new Promise(function dispatchXhrRequest(resolve, reject) {
32476
- let requestData = config.data;
32477
- const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
32478
- const responseType = config.responseType;
32479
- let onCanceled;
32480
- function done() {
32481
- if (config.cancelToken) {
32482
- config.cancelToken.unsubscribe(onCanceled);
32483
- }
32710
+ let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
32484
32711
 
32485
- if (config.signal) {
32486
- config.signal.removeEventListener('abort', onCanceled);
32487
- }
32712
+ newConfig.headers = headers = AxiosHeaders$1.from(headers);
32713
+
32714
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
32715
+
32716
+ // HTTP basic authentication
32717
+ if (auth) {
32718
+ headers.set('Authorization', 'Basic ' +
32719
+ btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
32720
+ );
32721
+ }
32722
+
32723
+ let contentType;
32724
+
32725
+ if (utils$1.isFormData(data)) {
32726
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
32727
+ headers.setContentType(undefined); // Let the browser set it
32728
+ } else if ((contentType = headers.getContentType()) !== false) {
32729
+ // fix semicolon duplication issue for ReactNative FormData implementation
32730
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
32731
+ headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
32488
32732
  }
32733
+ }
32734
+
32735
+ // Add xsrf header
32736
+ // This is only done if running in a standard browser environment.
32737
+ // Specifically not if we're in a web worker, or react-native.
32738
+
32739
+ if (platform.hasStandardBrowserEnv) {
32740
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
32489
32741
 
32490
- let contentType;
32742
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
32743
+ // Add xsrf header
32744
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
32491
32745
 
32492
- if (utils.isFormData(requestData)) {
32493
- if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
32494
- requestHeaders.setContentType(false); // Let the browser set it
32495
- } else if(!requestHeaders.getContentType(/^\s*multipart\/form-data/)){
32496
- requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks
32497
- } else if(utils.isString(contentType = requestHeaders.getContentType())){
32498
- // fix semicolon duplication issue for ReactNative FormData implementation
32499
- requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, '$1'));
32746
+ if (xsrfValue) {
32747
+ headers.set(xsrfHeaderName, xsrfValue);
32500
32748
  }
32501
32749
  }
32750
+ }
32502
32751
 
32503
- let request = new XMLHttpRequest();
32752
+ return newConfig;
32753
+ };
32504
32754
 
32505
- // HTTP basic authentication
32506
- if (config.auth) {
32507
- const username = config.auth.username || '';
32508
- const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
32509
- requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
32755
+ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
32756
+
32757
+ var xhrAdapter = isXHRAdapterSupported && function (config) {
32758
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
32759
+ const _config = resolveConfig(config);
32760
+ let requestData = _config.data;
32761
+ const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
32762
+ let {responseType, onUploadProgress, onDownloadProgress} = _config;
32763
+ let onCanceled;
32764
+ let uploadThrottled, downloadThrottled;
32765
+ let flushUpload, flushDownload;
32766
+
32767
+ function done() {
32768
+ flushUpload && flushUpload(); // flush events
32769
+ flushDownload && flushDownload(); // flush events
32770
+
32771
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
32772
+
32773
+ _config.signal && _config.signal.removeEventListener('abort', onCanceled);
32510
32774
  }
32511
32775
 
32512
- const fullPath = buildFullPath(config.baseURL, config.url);
32776
+ let request = new XMLHttpRequest();
32513
32777
 
32514
- request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
32778
+ request.open(_config.method.toUpperCase(), _config.url, true);
32515
32779
 
32516
32780
  // Set the request timeout in MS
32517
- request.timeout = config.timeout;
32781
+ request.timeout = _config.timeout;
32518
32782
 
32519
32783
  function onloadend() {
32520
32784
  if (!request) {
@@ -32594,10 +32858,10 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
32594
32858
 
32595
32859
  // Handle timeout
32596
32860
  request.ontimeout = function handleTimeout() {
32597
- let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
32598
- const transitional = config.transitional || transitionalDefaults;
32599
- if (config.timeoutErrorMessage) {
32600
- timeoutErrorMessage = config.timeoutErrorMessage;
32861
+ let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
32862
+ const transitional = _config.transitional || transitionalDefaults;
32863
+ if (_config.timeoutErrorMessage) {
32864
+ timeoutErrorMessage = _config.timeoutErrorMessage;
32601
32865
  }
32602
32866
  reject(new AxiosError(
32603
32867
  timeoutErrorMessage,
@@ -32609,50 +32873,42 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
32609
32873
  request = null;
32610
32874
  };
32611
32875
 
32612
- // Add xsrf header
32613
- // This is only done if running in a standard browser environment.
32614
- // Specifically not if we're in a web worker, or react-native.
32615
- if (platform.isStandardBrowserEnv) {
32616
- // Add xsrf header
32617
- // regarding CVE-2023-45857 config.withCredentials condition was removed temporarily
32618
- const xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
32619
-
32620
- if (xsrfValue) {
32621
- requestHeaders.set(config.xsrfHeaderName, xsrfValue);
32622
- }
32623
- }
32624
-
32625
32876
  // Remove Content-Type if data is undefined
32626
32877
  requestData === undefined && requestHeaders.setContentType(null);
32627
32878
 
32628
32879
  // Add headers to the request
32629
32880
  if ('setRequestHeader' in request) {
32630
- utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
32881
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
32631
32882
  request.setRequestHeader(key, val);
32632
32883
  });
32633
32884
  }
32634
32885
 
32635
32886
  // Add withCredentials to request if needed
32636
- if (!utils.isUndefined(config.withCredentials)) {
32637
- request.withCredentials = !!config.withCredentials;
32887
+ if (!utils$1.isUndefined(_config.withCredentials)) {
32888
+ request.withCredentials = !!_config.withCredentials;
32638
32889
  }
32639
32890
 
32640
32891
  // Add responseType to request if needed
32641
32892
  if (responseType && responseType !== 'json') {
32642
- request.responseType = config.responseType;
32893
+ request.responseType = _config.responseType;
32643
32894
  }
32644
32895
 
32645
32896
  // Handle progress if needed
32646
- if (typeof config.onDownloadProgress === 'function') {
32647
- request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
32897
+ if (onDownloadProgress) {
32898
+ ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
32899
+ request.addEventListener('progress', downloadThrottled);
32648
32900
  }
32649
32901
 
32650
32902
  // Not all browsers support upload events
32651
- if (typeof config.onUploadProgress === 'function' && request.upload) {
32652
- request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
32903
+ if (onUploadProgress && request.upload) {
32904
+ ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
32905
+
32906
+ request.upload.addEventListener('progress', uploadThrottled);
32907
+
32908
+ request.upload.addEventListener('loadend', flushUpload);
32653
32909
  }
32654
32910
 
32655
- if (config.cancelToken || config.signal) {
32911
+ if (_config.cancelToken || _config.signal) {
32656
32912
  // Handle cancellation
32657
32913
  // eslint-disable-next-line func-names
32658
32914
  onCanceled = cancel => {
@@ -32664,13 +32920,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
32664
32920
  request = null;
32665
32921
  };
32666
32922
 
32667
- config.cancelToken && config.cancelToken.subscribe(onCanceled);
32668
- if (config.signal) {
32669
- config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
32923
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
32924
+ if (_config.signal) {
32925
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
32670
32926
  }
32671
32927
  }
32672
32928
 
32673
- const protocol = parseProtocol(fullPath);
32929
+ const protocol = parseProtocol(_config.url);
32674
32930
 
32675
32931
  if (protocol && platform.protocols.indexOf(protocol) === -1) {
32676
32932
  reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
@@ -32683,12 +32939,340 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
32683
32939
  });
32684
32940
  };
32685
32941
 
32942
+ const composeSignals = (signals, timeout) => {
32943
+ let controller = new AbortController();
32944
+
32945
+ let aborted;
32946
+
32947
+ const onabort = function (cancel) {
32948
+ if (!aborted) {
32949
+ aborted = true;
32950
+ unsubscribe();
32951
+ const err = cancel instanceof Error ? cancel : this.reason;
32952
+ controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
32953
+ }
32954
+ };
32955
+
32956
+ let timer = timeout && setTimeout(() => {
32957
+ onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
32958
+ }, timeout);
32959
+
32960
+ const unsubscribe = () => {
32961
+ if (signals) {
32962
+ timer && clearTimeout(timer);
32963
+ timer = null;
32964
+ signals.forEach(signal => {
32965
+ signal &&
32966
+ (signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
32967
+ });
32968
+ signals = null;
32969
+ }
32970
+ };
32971
+
32972
+ signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
32973
+
32974
+ const {signal} = controller;
32975
+
32976
+ signal.unsubscribe = unsubscribe;
32977
+
32978
+ return [signal, () => {
32979
+ timer && clearTimeout(timer);
32980
+ timer = null;
32981
+ }];
32982
+ };
32983
+
32984
+ const streamChunk = function* (chunk, chunkSize) {
32985
+ let len = chunk.byteLength;
32986
+
32987
+ if (!chunkSize || len < chunkSize) {
32988
+ yield chunk;
32989
+ return;
32990
+ }
32991
+
32992
+ let pos = 0;
32993
+ let end;
32994
+
32995
+ while (pos < len) {
32996
+ end = pos + chunkSize;
32997
+ yield chunk.slice(pos, end);
32998
+ pos = end;
32999
+ }
33000
+ };
33001
+
33002
+ const readBytes = async function* (iterable, chunkSize, encode) {
33003
+ for await (const chunk of iterable) {
33004
+ yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
33005
+ }
33006
+ };
33007
+
33008
+ const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
33009
+ const iterator = readBytes(stream, chunkSize, encode);
33010
+
33011
+ let bytes = 0;
33012
+ let done;
33013
+ let _onFinish = (e) => {
33014
+ if (!done) {
33015
+ done = true;
33016
+ onFinish && onFinish(e);
33017
+ }
33018
+ };
33019
+
33020
+ return new ReadableStream({
33021
+ async pull(controller) {
33022
+ try {
33023
+ const {done, value} = await iterator.next();
33024
+
33025
+ if (done) {
33026
+ _onFinish();
33027
+ controller.close();
33028
+ return;
33029
+ }
33030
+
33031
+ let len = value.byteLength;
33032
+ if (onProgress) {
33033
+ let loadedBytes = bytes += len;
33034
+ onProgress(loadedBytes);
33035
+ }
33036
+ controller.enqueue(new Uint8Array(value));
33037
+ } catch (err) {
33038
+ _onFinish(err);
33039
+ throw err;
33040
+ }
33041
+ },
33042
+ cancel(reason) {
33043
+ _onFinish(reason);
33044
+ return iterator.return();
33045
+ }
33046
+ }, {
33047
+ highWaterMark: 2
33048
+ })
33049
+ };
33050
+
33051
+ const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
33052
+ const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
33053
+
33054
+ // used only inside the fetch adapter
33055
+ const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
33056
+ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
33057
+ async (str) => new Uint8Array(await new Response(str).arrayBuffer())
33058
+ );
33059
+
33060
+ const test = (fn, ...args) => {
33061
+ try {
33062
+ return !!fn(...args);
33063
+ } catch (e) {
33064
+ return false
33065
+ }
33066
+ };
33067
+
33068
+ const supportsRequestStream = isReadableStreamSupported && test(() => {
33069
+ let duplexAccessed = false;
33070
+
33071
+ const hasContentType = new Request(platform.origin, {
33072
+ body: new ReadableStream(),
33073
+ method: 'POST',
33074
+ get duplex() {
33075
+ duplexAccessed = true;
33076
+ return 'half';
33077
+ },
33078
+ }).headers.has('Content-Type');
33079
+
33080
+ return duplexAccessed && !hasContentType;
33081
+ });
33082
+
33083
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
33084
+
33085
+ const supportsResponseStream = isReadableStreamSupported &&
33086
+ test(() => utils$1.isReadableStream(new Response('').body));
33087
+
33088
+
33089
+ const resolvers = {
33090
+ stream: supportsResponseStream && ((res) => res.body)
33091
+ };
33092
+
33093
+ isFetchSupported && (((res) => {
33094
+ ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
33095
+ !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
33096
+ (_, config) => {
33097
+ throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
33098
+ });
33099
+ });
33100
+ })(new Response));
33101
+
33102
+ const getBodyLength = async (body) => {
33103
+ if (body == null) {
33104
+ return 0;
33105
+ }
33106
+
33107
+ if(utils$1.isBlob(body)) {
33108
+ return body.size;
33109
+ }
33110
+
33111
+ if(utils$1.isSpecCompliantForm(body)) {
33112
+ return (await new Request(body).arrayBuffer()).byteLength;
33113
+ }
33114
+
33115
+ if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
33116
+ return body.byteLength;
33117
+ }
33118
+
33119
+ if(utils$1.isURLSearchParams(body)) {
33120
+ body = body + '';
33121
+ }
33122
+
33123
+ if(utils$1.isString(body)) {
33124
+ return (await encodeText(body)).byteLength;
33125
+ }
33126
+ };
33127
+
33128
+ const resolveBodyLength = async (headers, body) => {
33129
+ const length = utils$1.toFiniteNumber(headers.getContentLength());
33130
+
33131
+ return length == null ? getBodyLength(body) : length;
33132
+ };
33133
+
33134
+ var fetchAdapter = isFetchSupported && (async (config) => {
33135
+ let {
33136
+ url,
33137
+ method,
33138
+ data,
33139
+ signal,
33140
+ cancelToken,
33141
+ timeout,
33142
+ onDownloadProgress,
33143
+ onUploadProgress,
33144
+ responseType,
33145
+ headers,
33146
+ withCredentials = 'same-origin',
33147
+ fetchOptions
33148
+ } = resolveConfig(config);
33149
+
33150
+ responseType = responseType ? (responseType + '').toLowerCase() : 'text';
33151
+
33152
+ let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?
33153
+ composeSignals([signal, cancelToken], timeout) : [];
33154
+
33155
+ let finished, request;
33156
+
33157
+ const onFinish = () => {
33158
+ !finished && setTimeout(() => {
33159
+ composedSignal && composedSignal.unsubscribe();
33160
+ });
33161
+
33162
+ finished = true;
33163
+ };
33164
+
33165
+ let requestContentLength;
33166
+
33167
+ try {
33168
+ if (
33169
+ onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
33170
+ (requestContentLength = await resolveBodyLength(headers, data)) !== 0
33171
+ ) {
33172
+ let _request = new Request(url, {
33173
+ method: 'POST',
33174
+ body: data,
33175
+ duplex: "half"
33176
+ });
33177
+
33178
+ let contentTypeHeader;
33179
+
33180
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
33181
+ headers.setContentType(contentTypeHeader);
33182
+ }
33183
+
33184
+ if (_request.body) {
33185
+ const [onProgress, flush] = progressEventDecorator(
33186
+ requestContentLength,
33187
+ progressEventReducer(asyncDecorator(onUploadProgress))
33188
+ );
33189
+
33190
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
33191
+ }
33192
+ }
33193
+
33194
+ if (!utils$1.isString(withCredentials)) {
33195
+ withCredentials = withCredentials ? 'include' : 'omit';
33196
+ }
33197
+
33198
+ request = new Request(url, {
33199
+ ...fetchOptions,
33200
+ signal: composedSignal,
33201
+ method: method.toUpperCase(),
33202
+ headers: headers.normalize().toJSON(),
33203
+ body: data,
33204
+ duplex: "half",
33205
+ credentials: withCredentials
33206
+ });
33207
+
33208
+ let response = await fetch(request);
33209
+
33210
+ const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
33211
+
33212
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
33213
+ const options = {};
33214
+
33215
+ ['status', 'statusText', 'headers'].forEach(prop => {
33216
+ options[prop] = response[prop];
33217
+ });
33218
+
33219
+ const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
33220
+
33221
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
33222
+ responseContentLength,
33223
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
33224
+ ) || [];
33225
+
33226
+ response = new Response(
33227
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
33228
+ flush && flush();
33229
+ isStreamResponse && onFinish();
33230
+ }, encodeText),
33231
+ options
33232
+ );
33233
+ }
33234
+
33235
+ responseType = responseType || 'text';
33236
+
33237
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
33238
+
33239
+ !isStreamResponse && onFinish();
33240
+
33241
+ stopTimeout && stopTimeout();
33242
+
33243
+ return await new Promise((resolve, reject) => {
33244
+ settle(resolve, reject, {
33245
+ data: responseData,
33246
+ headers: AxiosHeaders$1.from(response.headers),
33247
+ status: response.status,
33248
+ statusText: response.statusText,
33249
+ config,
33250
+ request
33251
+ });
33252
+ })
33253
+ } catch (err) {
33254
+ onFinish();
33255
+
33256
+ if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
33257
+ throw Object.assign(
33258
+ new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
33259
+ {
33260
+ cause: err.cause || err
33261
+ }
33262
+ )
33263
+ }
33264
+
33265
+ throw AxiosError.from(err, err && err.code, config, request);
33266
+ }
33267
+ });
33268
+
32686
33269
  const knownAdapters = {
32687
33270
  http: httpAdapter,
32688
- xhr: xhrAdapter
33271
+ xhr: xhrAdapter,
33272
+ fetch: fetchAdapter
32689
33273
  };
32690
33274
 
32691
- utils.forEach(knownAdapters, (fn, value) => {
33275
+ utils$1.forEach(knownAdapters, (fn, value) => {
32692
33276
  if (fn) {
32693
33277
  try {
32694
33278
  Object.defineProperty(fn, 'name', {value});
@@ -32701,11 +33285,11 @@ utils.forEach(knownAdapters, (fn, value) => {
32701
33285
 
32702
33286
  const renderReason = (reason) => `- ${reason}`;
32703
33287
 
32704
- const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
33288
+ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
32705
33289
 
32706
33290
  var adapters = {
32707
33291
  getAdapter: (adapters) => {
32708
- adapters = utils.isArray(adapters) ? adapters : [adapters];
33292
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
32709
33293
 
32710
33294
  const {length} = adapters;
32711
33295
  let nameOrAdapter;
@@ -32829,107 +33413,6 @@ function dispatchRequest(config) {
32829
33413
  });
32830
33414
  }
32831
33415
 
32832
- const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing;
32833
-
32834
- /**
32835
- * Config-specific merge-function which creates a new config-object
32836
- * by merging two configuration objects together.
32837
- *
32838
- * @param {Object} config1
32839
- * @param {Object} config2
32840
- *
32841
- * @returns {Object} New object resulting from merging config2 to config1
32842
- */
32843
- function mergeConfig(config1, config2) {
32844
- // eslint-disable-next-line no-param-reassign
32845
- config2 = config2 || {};
32846
- const config = {};
32847
-
32848
- function getMergedValue(target, source, caseless) {
32849
- if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
32850
- return utils.merge.call({caseless}, target, source);
32851
- } else if (utils.isPlainObject(source)) {
32852
- return utils.merge({}, source);
32853
- } else if (utils.isArray(source)) {
32854
- return source.slice();
32855
- }
32856
- return source;
32857
- }
32858
-
32859
- // eslint-disable-next-line consistent-return
32860
- function mergeDeepProperties(a, b, caseless) {
32861
- if (!utils.isUndefined(b)) {
32862
- return getMergedValue(a, b, caseless);
32863
- } else if (!utils.isUndefined(a)) {
32864
- return getMergedValue(undefined, a, caseless);
32865
- }
32866
- }
32867
-
32868
- // eslint-disable-next-line consistent-return
32869
- function valueFromConfig2(a, b) {
32870
- if (!utils.isUndefined(b)) {
32871
- return getMergedValue(undefined, b);
32872
- }
32873
- }
32874
-
32875
- // eslint-disable-next-line consistent-return
32876
- function defaultToConfig2(a, b) {
32877
- if (!utils.isUndefined(b)) {
32878
- return getMergedValue(undefined, b);
32879
- } else if (!utils.isUndefined(a)) {
32880
- return getMergedValue(undefined, a);
32881
- }
32882
- }
32883
-
32884
- // eslint-disable-next-line consistent-return
32885
- function mergeDirectKeys(a, b, prop) {
32886
- if (prop in config2) {
32887
- return getMergedValue(a, b);
32888
- } else if (prop in config1) {
32889
- return getMergedValue(undefined, a);
32890
- }
32891
- }
32892
-
32893
- const mergeMap = {
32894
- url: valueFromConfig2,
32895
- method: valueFromConfig2,
32896
- data: valueFromConfig2,
32897
- baseURL: defaultToConfig2,
32898
- transformRequest: defaultToConfig2,
32899
- transformResponse: defaultToConfig2,
32900
- paramsSerializer: defaultToConfig2,
32901
- timeout: defaultToConfig2,
32902
- timeoutMessage: defaultToConfig2,
32903
- withCredentials: defaultToConfig2,
32904
- adapter: defaultToConfig2,
32905
- responseType: defaultToConfig2,
32906
- xsrfCookieName: defaultToConfig2,
32907
- xsrfHeaderName: defaultToConfig2,
32908
- onUploadProgress: defaultToConfig2,
32909
- onDownloadProgress: defaultToConfig2,
32910
- decompress: defaultToConfig2,
32911
- maxContentLength: defaultToConfig2,
32912
- maxBodyLength: defaultToConfig2,
32913
- beforeRedirect: defaultToConfig2,
32914
- transport: defaultToConfig2,
32915
- httpAgent: defaultToConfig2,
32916
- httpsAgent: defaultToConfig2,
32917
- cancelToken: defaultToConfig2,
32918
- socketPath: defaultToConfig2,
32919
- responseEncoding: defaultToConfig2,
32920
- validateStatus: mergeDirectKeys,
32921
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
32922
- };
32923
-
32924
- utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
32925
- const merge = mergeMap[prop] || mergeDeepProperties;
32926
- const configValue = merge(config1[prop], config2[prop], prop);
32927
- (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
32928
- });
32929
-
32930
- return config;
32931
- }
32932
-
32933
33416
  const validators$1 = {};
32934
33417
 
32935
33418
  // eslint-disable-next-line func-names
@@ -33043,7 +33526,34 @@ class Axios {
33043
33526
  *
33044
33527
  * @returns {Promise} The Promise to be fulfilled
33045
33528
  */
33046
- request(configOrUrl, config) {
33529
+ async request(configOrUrl, config) {
33530
+ try {
33531
+ return await this._request(configOrUrl, config);
33532
+ } catch (err) {
33533
+ if (err instanceof Error) {
33534
+ let dummy;
33535
+
33536
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
33537
+
33538
+ // slice off the Error: ... line
33539
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
33540
+ try {
33541
+ if (!err.stack) {
33542
+ err.stack = stack;
33543
+ // match without the 2 top stack lines
33544
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
33545
+ err.stack += '\n' + stack;
33546
+ }
33547
+ } catch (e) {
33548
+ // ignore the case where "stack" is an un-writable property
33549
+ }
33550
+ }
33551
+
33552
+ throw err;
33553
+ }
33554
+ }
33555
+
33556
+ _request(configOrUrl, config) {
33047
33557
  /*eslint no-param-reassign:0*/
33048
33558
  // Allow for axios('example/url'[, config]) a la fetch API
33049
33559
  if (typeof configOrUrl === 'string') {
@@ -33066,7 +33576,7 @@ class Axios {
33066
33576
  }
33067
33577
 
33068
33578
  if (paramsSerializer != null) {
33069
- if (utils.isFunction(paramsSerializer)) {
33579
+ if (utils$1.isFunction(paramsSerializer)) {
33070
33580
  config.paramsSerializer = {
33071
33581
  serialize: paramsSerializer
33072
33582
  };
@@ -33082,12 +33592,12 @@ class Axios {
33082
33592
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
33083
33593
 
33084
33594
  // Flatten headers
33085
- let contextHeaders = headers && utils.merge(
33595
+ let contextHeaders = headers && utils$1.merge(
33086
33596
  headers.common,
33087
33597
  headers[config.method]
33088
33598
  );
33089
33599
 
33090
- headers && utils.forEach(
33600
+ headers && utils$1.forEach(
33091
33601
  ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
33092
33602
  (method) => {
33093
33603
  delete headers[method];
@@ -33174,7 +33684,7 @@ class Axios {
33174
33684
  }
33175
33685
 
33176
33686
  // Provide aliases for supported request methods
33177
- utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
33687
+ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
33178
33688
  /*eslint func-names:0*/
33179
33689
  Axios.prototype[method] = function(url, config) {
33180
33690
  return this.request(mergeConfig(config || {}, {
@@ -33185,7 +33695,7 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
33185
33695
  };
33186
33696
  });
33187
33697
 
33188
- utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
33698
+ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
33189
33699
  /*eslint func-names:0*/
33190
33700
 
33191
33701
  function generateHTTPMethod(isForm) {
@@ -33361,7 +33871,7 @@ function spread(callback) {
33361
33871
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
33362
33872
  */
33363
33873
  function isAxiosError(payload) {
33364
- return utils.isObject(payload) && (payload.isAxiosError === true);
33874
+ return utils$1.isObject(payload) && (payload.isAxiosError === true);
33365
33875
  }
33366
33876
 
33367
33877
  const HttpStatusCode = {
@@ -33448,10 +33958,10 @@ function createInstance(defaultConfig) {
33448
33958
  const instance = bind(Axios$1.prototype.request, context);
33449
33959
 
33450
33960
  // Copy axios.prototype to instance
33451
- utils.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
33961
+ utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
33452
33962
 
33453
33963
  // Copy context to instance
33454
- utils.extend(instance, context, null, {allOwnKeys: true});
33964
+ utils$1.extend(instance, context, null, {allOwnKeys: true});
33455
33965
 
33456
33966
  // Factory for creating new instances
33457
33967
  instance.create = function create(instanceConfig) {
@@ -33495,7 +34005,7 @@ axios.mergeConfig = mergeConfig;
33495
34005
 
33496
34006
  axios.AxiosHeaders = AxiosHeaders$1;
33497
34007
 
33498
- axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
34008
+ axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
33499
34009
 
33500
34010
  axios.getAdapter = adapters.getAdapter;
33501
34011