axios.js 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132
  1. import "./chunk-SSYGV25P.js";
  2. // node_modules/axios/lib/helpers/bind.js
  3. function bind(fn, thisArg) {
  4. return function wrap() {
  5. return fn.apply(thisArg, arguments);
  6. };
  7. }
  8. // node_modules/axios/lib/utils.js
  9. var { toString } = Object.prototype;
  10. var { getPrototypeOf } = Object;
  11. var kindOf = ((cache) => (thing) => {
  12. const str = toString.call(thing);
  13. return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
  14. })(/* @__PURE__ */ Object.create(null));
  15. var kindOfTest = (type) => {
  16. type = type.toLowerCase();
  17. return (thing) => kindOf(thing) === type;
  18. };
  19. var typeOfTest = (type) => (thing) => typeof thing === type;
  20. var { isArray } = Array;
  21. var isUndefined = typeOfTest("undefined");
  22. function isBuffer(val) {
  23. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
  24. }
  25. var isArrayBuffer = kindOfTest("ArrayBuffer");
  26. function isArrayBufferView(val) {
  27. let result;
  28. if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
  29. result = ArrayBuffer.isView(val);
  30. } else {
  31. result = val && val.buffer && isArrayBuffer(val.buffer);
  32. }
  33. return result;
  34. }
  35. var isString = typeOfTest("string");
  36. var isFunction = typeOfTest("function");
  37. var isNumber = typeOfTest("number");
  38. var isObject = (thing) => thing !== null && typeof thing === "object";
  39. var isBoolean = (thing) => thing === true || thing === false;
  40. var isPlainObject = (val) => {
  41. if (kindOf(val) !== "object") {
  42. return false;
  43. }
  44. const prototype3 = getPrototypeOf(val);
  45. return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
  46. };
  47. var isDate = kindOfTest("Date");
  48. var isFile = kindOfTest("File");
  49. var isBlob = kindOfTest("Blob");
  50. var isFileList = kindOfTest("FileList");
  51. var isStream = (val) => isObject(val) && isFunction(val.pipe);
  52. var isFormData = (thing) => {
  53. let kind;
  54. return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
  55. kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
  56. };
  57. var isURLSearchParams = kindOfTest("URLSearchParams");
  58. var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
  59. function forEach(obj, fn, { allOwnKeys = false } = {}) {
  60. if (obj === null || typeof obj === "undefined") {
  61. return;
  62. }
  63. let i;
  64. let l;
  65. if (typeof obj !== "object") {
  66. obj = [obj];
  67. }
  68. if (isArray(obj)) {
  69. for (i = 0, l = obj.length; i < l; i++) {
  70. fn.call(null, obj[i], i, obj);
  71. }
  72. } else {
  73. const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
  74. const len = keys.length;
  75. let key;
  76. for (i = 0; i < len; i++) {
  77. key = keys[i];
  78. fn.call(null, obj[key], key, obj);
  79. }
  80. }
  81. }
  82. function findKey(obj, key) {
  83. key = key.toLowerCase();
  84. const keys = Object.keys(obj);
  85. let i = keys.length;
  86. let _key;
  87. while (i-- > 0) {
  88. _key = keys[i];
  89. if (key === _key.toLowerCase()) {
  90. return _key;
  91. }
  92. }
  93. return null;
  94. }
  95. var _global = (() => {
  96. if (typeof globalThis !== "undefined")
  97. return globalThis;
  98. return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
  99. })();
  100. var isContextDefined = (context) => !isUndefined(context) && context !== _global;
  101. function merge() {
  102. const { caseless } = isContextDefined(this) && this || {};
  103. const result = {};
  104. const assignValue = (val, key) => {
  105. const targetKey = caseless && findKey(result, key) || key;
  106. if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
  107. result[targetKey] = merge(result[targetKey], val);
  108. } else if (isPlainObject(val)) {
  109. result[targetKey] = merge({}, val);
  110. } else if (isArray(val)) {
  111. result[targetKey] = val.slice();
  112. } else {
  113. result[targetKey] = val;
  114. }
  115. };
  116. for (let i = 0, l = arguments.length; i < l; i++) {
  117. arguments[i] && forEach(arguments[i], assignValue);
  118. }
  119. return result;
  120. }
  121. var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
  122. forEach(b, (val, key) => {
  123. if (thisArg && isFunction(val)) {
  124. a[key] = bind(val, thisArg);
  125. } else {
  126. a[key] = val;
  127. }
  128. }, { allOwnKeys });
  129. return a;
  130. };
  131. var stripBOM = (content) => {
  132. if (content.charCodeAt(0) === 65279) {
  133. content = content.slice(1);
  134. }
  135. return content;
  136. };
  137. var inherits = (constructor, superConstructor, props, descriptors2) => {
  138. constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
  139. constructor.prototype.constructor = constructor;
  140. Object.defineProperty(constructor, "super", {
  141. value: superConstructor.prototype
  142. });
  143. props && Object.assign(constructor.prototype, props);
  144. };
  145. var toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
  146. let props;
  147. let i;
  148. let prop;
  149. const merged = {};
  150. destObj = destObj || {};
  151. if (sourceObj == null)
  152. return destObj;
  153. do {
  154. props = Object.getOwnPropertyNames(sourceObj);
  155. i = props.length;
  156. while (i-- > 0) {
  157. prop = props[i];
  158. if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
  159. destObj[prop] = sourceObj[prop];
  160. merged[prop] = true;
  161. }
  162. }
  163. sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
  164. } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
  165. return destObj;
  166. };
  167. var endsWith = (str, searchString, position) => {
  168. str = String(str);
  169. if (position === void 0 || position > str.length) {
  170. position = str.length;
  171. }
  172. position -= searchString.length;
  173. const lastIndex = str.indexOf(searchString, position);
  174. return lastIndex !== -1 && lastIndex === position;
  175. };
  176. var toArray = (thing) => {
  177. if (!thing)
  178. return null;
  179. if (isArray(thing))
  180. return thing;
  181. let i = thing.length;
  182. if (!isNumber(i))
  183. return null;
  184. const arr = new Array(i);
  185. while (i-- > 0) {
  186. arr[i] = thing[i];
  187. }
  188. return arr;
  189. };
  190. var isTypedArray = ((TypedArray) => {
  191. return (thing) => {
  192. return TypedArray && thing instanceof TypedArray;
  193. };
  194. })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
  195. var forEachEntry = (obj, fn) => {
  196. const generator = obj && obj[Symbol.iterator];
  197. const iterator = generator.call(obj);
  198. let result;
  199. while ((result = iterator.next()) && !result.done) {
  200. const pair = result.value;
  201. fn.call(obj, pair[0], pair[1]);
  202. }
  203. };
  204. var matchAll = (regExp, str) => {
  205. let matches;
  206. const arr = [];
  207. while ((matches = regExp.exec(str)) !== null) {
  208. arr.push(matches);
  209. }
  210. return arr;
  211. };
  212. var isHTMLForm = kindOfTest("HTMLFormElement");
  213. var toCamelCase = (str) => {
  214. return str.toLowerCase().replace(
  215. /[-_\s]([a-z\d])(\w*)/g,
  216. function replacer(m, p1, p2) {
  217. return p1.toUpperCase() + p2;
  218. }
  219. );
  220. };
  221. var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
  222. var isRegExp = kindOfTest("RegExp");
  223. var reduceDescriptors = (obj, reducer) => {
  224. const descriptors2 = Object.getOwnPropertyDescriptors(obj);
  225. const reducedDescriptors = {};
  226. forEach(descriptors2, (descriptor, name) => {
  227. let ret;
  228. if ((ret = reducer(descriptor, name, obj)) !== false) {
  229. reducedDescriptors[name] = ret || descriptor;
  230. }
  231. });
  232. Object.defineProperties(obj, reducedDescriptors);
  233. };
  234. var freezeMethods = (obj) => {
  235. reduceDescriptors(obj, (descriptor, name) => {
  236. if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
  237. return false;
  238. }
  239. const value = obj[name];
  240. if (!isFunction(value))
  241. return;
  242. descriptor.enumerable = false;
  243. if ("writable" in descriptor) {
  244. descriptor.writable = false;
  245. return;
  246. }
  247. if (!descriptor.set) {
  248. descriptor.set = () => {
  249. throw Error("Can not rewrite read-only method '" + name + "'");
  250. };
  251. }
  252. });
  253. };
  254. var toObjectSet = (arrayOrString, delimiter) => {
  255. const obj = {};
  256. const define = (arr) => {
  257. arr.forEach((value) => {
  258. obj[value] = true;
  259. });
  260. };
  261. isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
  262. return obj;
  263. };
  264. var noop = () => {
  265. };
  266. var toFiniteNumber = (value, defaultValue) => {
  267. value = +value;
  268. return Number.isFinite(value) ? value : defaultValue;
  269. };
  270. var ALPHA = "abcdefghijklmnopqrstuvwxyz";
  271. var DIGIT = "0123456789";
  272. var ALPHABET = {
  273. DIGIT,
  274. ALPHA,
  275. ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
  276. };
  277. var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
  278. let str = "";
  279. const { length } = alphabet;
  280. while (size--) {
  281. str += alphabet[Math.random() * length | 0];
  282. }
  283. return str;
  284. };
  285. function isSpecCompliantForm(thing) {
  286. return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
  287. }
  288. var toJSONObject = (obj) => {
  289. const stack = new Array(10);
  290. const visit = (source, i) => {
  291. if (isObject(source)) {
  292. if (stack.indexOf(source) >= 0) {
  293. return;
  294. }
  295. if (!("toJSON" in source)) {
  296. stack[i] = source;
  297. const target = isArray(source) ? [] : {};
  298. forEach(source, (value, key) => {
  299. const reducedValue = visit(value, i + 1);
  300. !isUndefined(reducedValue) && (target[key] = reducedValue);
  301. });
  302. stack[i] = void 0;
  303. return target;
  304. }
  305. }
  306. return source;
  307. };
  308. return visit(obj, 0);
  309. };
  310. var isAsyncFn = kindOfTest("AsyncFunction");
  311. var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
  312. var utils_default = {
  313. isArray,
  314. isArrayBuffer,
  315. isBuffer,
  316. isFormData,
  317. isArrayBufferView,
  318. isString,
  319. isNumber,
  320. isBoolean,
  321. isObject,
  322. isPlainObject,
  323. isUndefined,
  324. isDate,
  325. isFile,
  326. isBlob,
  327. isRegExp,
  328. isFunction,
  329. isStream,
  330. isURLSearchParams,
  331. isTypedArray,
  332. isFileList,
  333. forEach,
  334. merge,
  335. extend,
  336. trim,
  337. stripBOM,
  338. inherits,
  339. toFlatObject,
  340. kindOf,
  341. kindOfTest,
  342. endsWith,
  343. toArray,
  344. forEachEntry,
  345. matchAll,
  346. isHTMLForm,
  347. hasOwnProperty,
  348. hasOwnProp: hasOwnProperty,
  349. // an alias to avoid ESLint no-prototype-builtins detection
  350. reduceDescriptors,
  351. freezeMethods,
  352. toObjectSet,
  353. toCamelCase,
  354. noop,
  355. toFiniteNumber,
  356. findKey,
  357. global: _global,
  358. isContextDefined,
  359. ALPHABET,
  360. generateString,
  361. isSpecCompliantForm,
  362. toJSONObject,
  363. isAsyncFn,
  364. isThenable
  365. };
  366. // node_modules/axios/lib/core/AxiosError.js
  367. function AxiosError(message, code, config, request, response) {
  368. Error.call(this);
  369. if (Error.captureStackTrace) {
  370. Error.captureStackTrace(this, this.constructor);
  371. } else {
  372. this.stack = new Error().stack;
  373. }
  374. this.message = message;
  375. this.name = "AxiosError";
  376. code && (this.code = code);
  377. config && (this.config = config);
  378. request && (this.request = request);
  379. response && (this.response = response);
  380. }
  381. utils_default.inherits(AxiosError, Error, {
  382. toJSON: function toJSON() {
  383. return {
  384. // Standard
  385. message: this.message,
  386. name: this.name,
  387. // Microsoft
  388. description: this.description,
  389. number: this.number,
  390. // Mozilla
  391. fileName: this.fileName,
  392. lineNumber: this.lineNumber,
  393. columnNumber: this.columnNumber,
  394. stack: this.stack,
  395. // Axios
  396. config: utils_default.toJSONObject(this.config),
  397. code: this.code,
  398. status: this.response && this.response.status ? this.response.status : null
  399. };
  400. }
  401. });
  402. var prototype = AxiosError.prototype;
  403. var descriptors = {};
  404. [
  405. "ERR_BAD_OPTION_VALUE",
  406. "ERR_BAD_OPTION",
  407. "ECONNABORTED",
  408. "ETIMEDOUT",
  409. "ERR_NETWORK",
  410. "ERR_FR_TOO_MANY_REDIRECTS",
  411. "ERR_DEPRECATED",
  412. "ERR_BAD_RESPONSE",
  413. "ERR_BAD_REQUEST",
  414. "ERR_CANCELED",
  415. "ERR_NOT_SUPPORT",
  416. "ERR_INVALID_URL"
  417. // eslint-disable-next-line func-names
  418. ].forEach((code) => {
  419. descriptors[code] = { value: code };
  420. });
  421. Object.defineProperties(AxiosError, descriptors);
  422. Object.defineProperty(prototype, "isAxiosError", { value: true });
  423. AxiosError.from = (error, code, config, request, response, customProps) => {
  424. const axiosError = Object.create(prototype);
  425. utils_default.toFlatObject(error, axiosError, function filter2(obj) {
  426. return obj !== Error.prototype;
  427. }, (prop) => {
  428. return prop !== "isAxiosError";
  429. });
  430. AxiosError.call(axiosError, error.message, code, config, request, response);
  431. axiosError.cause = error;
  432. axiosError.name = error.name;
  433. customProps && Object.assign(axiosError, customProps);
  434. return axiosError;
  435. };
  436. var AxiosError_default = AxiosError;
  437. // node_modules/axios/lib/helpers/null.js
  438. var null_default = null;
  439. // node_modules/axios/lib/helpers/toFormData.js
  440. function isVisitable(thing) {
  441. return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
  442. }
  443. function removeBrackets(key) {
  444. return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
  445. }
  446. function renderKey(path, key, dots) {
  447. if (!path)
  448. return key;
  449. return path.concat(key).map(function each(token, i) {
  450. token = removeBrackets(token);
  451. return !dots && i ? "[" + token + "]" : token;
  452. }).join(dots ? "." : "");
  453. }
  454. function isFlatArray(arr) {
  455. return utils_default.isArray(arr) && !arr.some(isVisitable);
  456. }
  457. var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
  458. return /^is[A-Z]/.test(prop);
  459. });
  460. function toFormData(obj, formData, options) {
  461. if (!utils_default.isObject(obj)) {
  462. throw new TypeError("target must be an object");
  463. }
  464. formData = formData || new (null_default || FormData)();
  465. options = utils_default.toFlatObject(options, {
  466. metaTokens: true,
  467. dots: false,
  468. indexes: false
  469. }, false, function defined(option, source) {
  470. return !utils_default.isUndefined(source[option]);
  471. });
  472. const metaTokens = options.metaTokens;
  473. const visitor = options.visitor || defaultVisitor;
  474. const dots = options.dots;
  475. const indexes = options.indexes;
  476. const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
  477. const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
  478. if (!utils_default.isFunction(visitor)) {
  479. throw new TypeError("visitor must be a function");
  480. }
  481. function convertValue(value) {
  482. if (value === null)
  483. return "";
  484. if (utils_default.isDate(value)) {
  485. return value.toISOString();
  486. }
  487. if (!useBlob && utils_default.isBlob(value)) {
  488. throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
  489. }
  490. if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) {
  491. return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
  492. }
  493. return value;
  494. }
  495. function defaultVisitor(value, key, path) {
  496. let arr = value;
  497. if (value && !path && typeof value === "object") {
  498. if (utils_default.endsWith(key, "{}")) {
  499. key = metaTokens ? key : key.slice(0, -2);
  500. value = JSON.stringify(value);
  501. } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
  502. key = removeBrackets(key);
  503. arr.forEach(function each(el, index) {
  504. !(utils_default.isUndefined(el) || el === null) && formData.append(
  505. // eslint-disable-next-line no-nested-ternary
  506. indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
  507. convertValue(el)
  508. );
  509. });
  510. return false;
  511. }
  512. }
  513. if (isVisitable(value)) {
  514. return true;
  515. }
  516. formData.append(renderKey(path, key, dots), convertValue(value));
  517. return false;
  518. }
  519. const stack = [];
  520. const exposedHelpers = Object.assign(predicates, {
  521. defaultVisitor,
  522. convertValue,
  523. isVisitable
  524. });
  525. function build(value, path) {
  526. if (utils_default.isUndefined(value))
  527. return;
  528. if (stack.indexOf(value) !== -1) {
  529. throw Error("Circular reference detected in " + path.join("."));
  530. }
  531. stack.push(value);
  532. utils_default.forEach(value, function each(el, key) {
  533. const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(
  534. formData,
  535. el,
  536. utils_default.isString(key) ? key.trim() : key,
  537. path,
  538. exposedHelpers
  539. );
  540. if (result === true) {
  541. build(el, path ? path.concat(key) : [key]);
  542. }
  543. });
  544. stack.pop();
  545. }
  546. if (!utils_default.isObject(obj)) {
  547. throw new TypeError("data must be an object");
  548. }
  549. build(obj);
  550. return formData;
  551. }
  552. var toFormData_default = toFormData;
  553. // node_modules/axios/lib/helpers/AxiosURLSearchParams.js
  554. function encode(str) {
  555. const charMap = {
  556. "!": "%21",
  557. "'": "%27",
  558. "(": "%28",
  559. ")": "%29",
  560. "~": "%7E",
  561. "%20": "+",
  562. "%00": "\0"
  563. };
  564. return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
  565. return charMap[match];
  566. });
  567. }
  568. function AxiosURLSearchParams(params, options) {
  569. this._pairs = [];
  570. params && toFormData_default(params, this, options);
  571. }
  572. var prototype2 = AxiosURLSearchParams.prototype;
  573. prototype2.append = function append(name, value) {
  574. this._pairs.push([name, value]);
  575. };
  576. prototype2.toString = function toString2(encoder) {
  577. const _encode = encoder ? function(value) {
  578. return encoder.call(this, value, encode);
  579. } : encode;
  580. return this._pairs.map(function each(pair) {
  581. return _encode(pair[0]) + "=" + _encode(pair[1]);
  582. }, "").join("&");
  583. };
  584. var AxiosURLSearchParams_default = AxiosURLSearchParams;
  585. // node_modules/axios/lib/helpers/buildURL.js
  586. function encode2(val) {
  587. return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
  588. }
  589. function buildURL(url, params, options) {
  590. if (!params) {
  591. return url;
  592. }
  593. const _encode = options && options.encode || encode2;
  594. const serializeFn = options && options.serialize;
  595. let serializedParams;
  596. if (serializeFn) {
  597. serializedParams = serializeFn(params, options);
  598. } else {
  599. serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, options).toString(_encode);
  600. }
  601. if (serializedParams) {
  602. const hashmarkIndex = url.indexOf("#");
  603. if (hashmarkIndex !== -1) {
  604. url = url.slice(0, hashmarkIndex);
  605. }
  606. url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
  607. }
  608. return url;
  609. }
  610. // node_modules/axios/lib/core/InterceptorManager.js
  611. var InterceptorManager = class {
  612. constructor() {
  613. this.handlers = [];
  614. }
  615. /**
  616. * Add a new interceptor to the stack
  617. *
  618. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  619. * @param {Function} rejected The function to handle `reject` for a `Promise`
  620. *
  621. * @return {Number} An ID used to remove interceptor later
  622. */
  623. use(fulfilled, rejected, options) {
  624. this.handlers.push({
  625. fulfilled,
  626. rejected,
  627. synchronous: options ? options.synchronous : false,
  628. runWhen: options ? options.runWhen : null
  629. });
  630. return this.handlers.length - 1;
  631. }
  632. /**
  633. * Remove an interceptor from the stack
  634. *
  635. * @param {Number} id The ID that was returned by `use`
  636. *
  637. * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
  638. */
  639. eject(id) {
  640. if (this.handlers[id]) {
  641. this.handlers[id] = null;
  642. }
  643. }
  644. /**
  645. * Clear all interceptors from the stack
  646. *
  647. * @returns {void}
  648. */
  649. clear() {
  650. if (this.handlers) {
  651. this.handlers = [];
  652. }
  653. }
  654. /**
  655. * Iterate over all the registered interceptors
  656. *
  657. * This method is particularly useful for skipping over any
  658. * interceptors that may have become `null` calling `eject`.
  659. *
  660. * @param {Function} fn The function to call for each interceptor
  661. *
  662. * @returns {void}
  663. */
  664. forEach(fn) {
  665. utils_default.forEach(this.handlers, function forEachHandler(h) {
  666. if (h !== null) {
  667. fn(h);
  668. }
  669. });
  670. }
  671. };
  672. var InterceptorManager_default = InterceptorManager;
  673. // node_modules/axios/lib/defaults/transitional.js
  674. var transitional_default = {
  675. silentJSONParsing: true,
  676. forcedJSONParsing: true,
  677. clarifyTimeoutError: false
  678. };
  679. // node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
  680. var URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams_default;
  681. // node_modules/axios/lib/platform/browser/classes/FormData.js
  682. var FormData_default = typeof FormData !== "undefined" ? FormData : null;
  683. // node_modules/axios/lib/platform/browser/classes/Blob.js
  684. var Blob_default = typeof Blob !== "undefined" ? Blob : null;
  685. // node_modules/axios/lib/platform/browser/index.js
  686. var isStandardBrowserEnv = (() => {
  687. let product;
  688. if (typeof navigator !== "undefined" && ((product = navigator.product) === "ReactNative" || product === "NativeScript" || product === "NS")) {
  689. return false;
  690. }
  691. return typeof window !== "undefined" && typeof document !== "undefined";
  692. })();
  693. var isStandardBrowserWebWorkerEnv = (() => {
  694. return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
  695. self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
  696. })();
  697. var browser_default = {
  698. isBrowser: true,
  699. classes: {
  700. URLSearchParams: URLSearchParams_default,
  701. FormData: FormData_default,
  702. Blob: Blob_default
  703. },
  704. isStandardBrowserEnv,
  705. isStandardBrowserWebWorkerEnv,
  706. protocols: ["http", "https", "file", "blob", "url", "data"]
  707. };
  708. // node_modules/axios/lib/helpers/toURLEncodedForm.js
  709. function toURLEncodedForm(data, options) {
  710. return toFormData_default(data, new browser_default.classes.URLSearchParams(), Object.assign({
  711. visitor: function(value, key, path, helpers) {
  712. if (browser_default.isNode && utils_default.isBuffer(value)) {
  713. this.append(key, value.toString("base64"));
  714. return false;
  715. }
  716. return helpers.defaultVisitor.apply(this, arguments);
  717. }
  718. }, options));
  719. }
  720. // node_modules/axios/lib/helpers/formDataToJSON.js
  721. function parsePropPath(name) {
  722. return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
  723. return match[0] === "[]" ? "" : match[1] || match[0];
  724. });
  725. }
  726. function arrayToObject(arr) {
  727. const obj = {};
  728. const keys = Object.keys(arr);
  729. let i;
  730. const len = keys.length;
  731. let key;
  732. for (i = 0; i < len; i++) {
  733. key = keys[i];
  734. obj[key] = arr[key];
  735. }
  736. return obj;
  737. }
  738. function formDataToJSON(formData) {
  739. function buildPath(path, value, target, index) {
  740. let name = path[index++];
  741. const isNumericKey = Number.isFinite(+name);
  742. const isLast = index >= path.length;
  743. name = !name && utils_default.isArray(target) ? target.length : name;
  744. if (isLast) {
  745. if (utils_default.hasOwnProp(target, name)) {
  746. target[name] = [target[name], value];
  747. } else {
  748. target[name] = value;
  749. }
  750. return !isNumericKey;
  751. }
  752. if (!target[name] || !utils_default.isObject(target[name])) {
  753. target[name] = [];
  754. }
  755. const result = buildPath(path, value, target[name], index);
  756. if (result && utils_default.isArray(target[name])) {
  757. target[name] = arrayToObject(target[name]);
  758. }
  759. return !isNumericKey;
  760. }
  761. if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
  762. const obj = {};
  763. utils_default.forEachEntry(formData, (name, value) => {
  764. buildPath(parsePropPath(name), value, obj, 0);
  765. });
  766. return obj;
  767. }
  768. return null;
  769. }
  770. var formDataToJSON_default = formDataToJSON;
  771. // node_modules/axios/lib/defaults/index.js
  772. function stringifySafely(rawValue, parser, encoder) {
  773. if (utils_default.isString(rawValue)) {
  774. try {
  775. (parser || JSON.parse)(rawValue);
  776. return utils_default.trim(rawValue);
  777. } catch (e) {
  778. if (e.name !== "SyntaxError") {
  779. throw e;
  780. }
  781. }
  782. }
  783. return (encoder || JSON.stringify)(rawValue);
  784. }
  785. var defaults = {
  786. transitional: transitional_default,
  787. adapter: browser_default.isNode ? "http" : "xhr",
  788. transformRequest: [function transformRequest(data, headers) {
  789. const contentType = headers.getContentType() || "";
  790. const hasJSONContentType = contentType.indexOf("application/json") > -1;
  791. const isObjectPayload = utils_default.isObject(data);
  792. if (isObjectPayload && utils_default.isHTMLForm(data)) {
  793. data = new FormData(data);
  794. }
  795. const isFormData2 = utils_default.isFormData(data);
  796. if (isFormData2) {
  797. if (!hasJSONContentType) {
  798. return data;
  799. }
  800. return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
  801. }
  802. if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) {
  803. return data;
  804. }
  805. if (utils_default.isArrayBufferView(data)) {
  806. return data.buffer;
  807. }
  808. if (utils_default.isURLSearchParams(data)) {
  809. headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
  810. return data.toString();
  811. }
  812. let isFileList2;
  813. if (isObjectPayload) {
  814. if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
  815. return toURLEncodedForm(data, this.formSerializer).toString();
  816. }
  817. if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
  818. const _FormData = this.env && this.env.FormData;
  819. return toFormData_default(
  820. isFileList2 ? { "files[]": data } : data,
  821. _FormData && new _FormData(),
  822. this.formSerializer
  823. );
  824. }
  825. }
  826. if (isObjectPayload || hasJSONContentType) {
  827. headers.setContentType("application/json", false);
  828. return stringifySafely(data);
  829. }
  830. return data;
  831. }],
  832. transformResponse: [function transformResponse(data) {
  833. const transitional2 = this.transitional || defaults.transitional;
  834. const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
  835. const JSONRequested = this.responseType === "json";
  836. if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
  837. const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
  838. const strictJSONParsing = !silentJSONParsing && JSONRequested;
  839. try {
  840. return JSON.parse(data);
  841. } catch (e) {
  842. if (strictJSONParsing) {
  843. if (e.name === "SyntaxError") {
  844. throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
  845. }
  846. throw e;
  847. }
  848. }
  849. }
  850. return data;
  851. }],
  852. /**
  853. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  854. * timeout is not created.
  855. */
  856. timeout: 0,
  857. xsrfCookieName: "XSRF-TOKEN",
  858. xsrfHeaderName: "X-XSRF-TOKEN",
  859. maxContentLength: -1,
  860. maxBodyLength: -1,
  861. env: {
  862. FormData: browser_default.classes.FormData,
  863. Blob: browser_default.classes.Blob
  864. },
  865. validateStatus: function validateStatus(status) {
  866. return status >= 200 && status < 300;
  867. },
  868. headers: {
  869. common: {
  870. "Accept": "application/json, text/plain, */*",
  871. "Content-Type": void 0
  872. }
  873. }
  874. };
  875. utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
  876. defaults.headers[method] = {};
  877. });
  878. var defaults_default = defaults;
  879. // node_modules/axios/lib/helpers/parseHeaders.js
  880. var ignoreDuplicateOf = utils_default.toObjectSet([
  881. "age",
  882. "authorization",
  883. "content-length",
  884. "content-type",
  885. "etag",
  886. "expires",
  887. "from",
  888. "host",
  889. "if-modified-since",
  890. "if-unmodified-since",
  891. "last-modified",
  892. "location",
  893. "max-forwards",
  894. "proxy-authorization",
  895. "referer",
  896. "retry-after",
  897. "user-agent"
  898. ]);
  899. var parseHeaders_default = (rawHeaders) => {
  900. const parsed = {};
  901. let key;
  902. let val;
  903. let i;
  904. rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
  905. i = line.indexOf(":");
  906. key = line.substring(0, i).trim().toLowerCase();
  907. val = line.substring(i + 1).trim();
  908. if (!key || parsed[key] && ignoreDuplicateOf[key]) {
  909. return;
  910. }
  911. if (key === "set-cookie") {
  912. if (parsed[key]) {
  913. parsed[key].push(val);
  914. } else {
  915. parsed[key] = [val];
  916. }
  917. } else {
  918. parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
  919. }
  920. });
  921. return parsed;
  922. };
  923. // node_modules/axios/lib/core/AxiosHeaders.js
  924. var $internals = Symbol("internals");
  925. function normalizeHeader(header) {
  926. return header && String(header).trim().toLowerCase();
  927. }
  928. function normalizeValue(value) {
  929. if (value === false || value == null) {
  930. return value;
  931. }
  932. return utils_default.isArray(value) ? value.map(normalizeValue) : String(value);
  933. }
  934. function parseTokens(str) {
  935. const tokens = /* @__PURE__ */ Object.create(null);
  936. const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
  937. let match;
  938. while (match = tokensRE.exec(str)) {
  939. tokens[match[1]] = match[2];
  940. }
  941. return tokens;
  942. }
  943. var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
  944. function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
  945. if (utils_default.isFunction(filter2)) {
  946. return filter2.call(this, value, header);
  947. }
  948. if (isHeaderNameFilter) {
  949. value = header;
  950. }
  951. if (!utils_default.isString(value))
  952. return;
  953. if (utils_default.isString(filter2)) {
  954. return value.indexOf(filter2) !== -1;
  955. }
  956. if (utils_default.isRegExp(filter2)) {
  957. return filter2.test(value);
  958. }
  959. }
  960. function formatHeader(header) {
  961. return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
  962. return char.toUpperCase() + str;
  963. });
  964. }
  965. function buildAccessors(obj, header) {
  966. const accessorName = utils_default.toCamelCase(" " + header);
  967. ["get", "set", "has"].forEach((methodName) => {
  968. Object.defineProperty(obj, methodName + accessorName, {
  969. value: function(arg1, arg2, arg3) {
  970. return this[methodName].call(this, header, arg1, arg2, arg3);
  971. },
  972. configurable: true
  973. });
  974. });
  975. }
  976. var AxiosHeaders = class {
  977. constructor(headers) {
  978. headers && this.set(headers);
  979. }
  980. set(header, valueOrRewrite, rewrite) {
  981. const self2 = this;
  982. function setHeader(_value, _header, _rewrite) {
  983. const lHeader = normalizeHeader(_header);
  984. if (!lHeader) {
  985. throw new Error("header name must be a non-empty string");
  986. }
  987. const key = utils_default.findKey(self2, lHeader);
  988. if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
  989. self2[key || _header] = normalizeValue(_value);
  990. }
  991. }
  992. const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
  993. if (utils_default.isPlainObject(header) || header instanceof this.constructor) {
  994. setHeaders(header, valueOrRewrite);
  995. } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
  996. setHeaders(parseHeaders_default(header), valueOrRewrite);
  997. } else {
  998. header != null && setHeader(valueOrRewrite, header, rewrite);
  999. }
  1000. return this;
  1001. }
  1002. get(header, parser) {
  1003. header = normalizeHeader(header);
  1004. if (header) {
  1005. const key = utils_default.findKey(this, header);
  1006. if (key) {
  1007. const value = this[key];
  1008. if (!parser) {
  1009. return value;
  1010. }
  1011. if (parser === true) {
  1012. return parseTokens(value);
  1013. }
  1014. if (utils_default.isFunction(parser)) {
  1015. return parser.call(this, value, key);
  1016. }
  1017. if (utils_default.isRegExp(parser)) {
  1018. return parser.exec(value);
  1019. }
  1020. throw new TypeError("parser must be boolean|regexp|function");
  1021. }
  1022. }
  1023. }
  1024. has(header, matcher) {
  1025. header = normalizeHeader(header);
  1026. if (header) {
  1027. const key = utils_default.findKey(this, header);
  1028. return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
  1029. }
  1030. return false;
  1031. }
  1032. delete(header, matcher) {
  1033. const self2 = this;
  1034. let deleted = false;
  1035. function deleteHeader(_header) {
  1036. _header = normalizeHeader(_header);
  1037. if (_header) {
  1038. const key = utils_default.findKey(self2, _header);
  1039. if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
  1040. delete self2[key];
  1041. deleted = true;
  1042. }
  1043. }
  1044. }
  1045. if (utils_default.isArray(header)) {
  1046. header.forEach(deleteHeader);
  1047. } else {
  1048. deleteHeader(header);
  1049. }
  1050. return deleted;
  1051. }
  1052. clear(matcher) {
  1053. const keys = Object.keys(this);
  1054. let i = keys.length;
  1055. let deleted = false;
  1056. while (i--) {
  1057. const key = keys[i];
  1058. if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
  1059. delete this[key];
  1060. deleted = true;
  1061. }
  1062. }
  1063. return deleted;
  1064. }
  1065. normalize(format) {
  1066. const self2 = this;
  1067. const headers = {};
  1068. utils_default.forEach(this, (value, header) => {
  1069. const key = utils_default.findKey(headers, header);
  1070. if (key) {
  1071. self2[key] = normalizeValue(value);
  1072. delete self2[header];
  1073. return;
  1074. }
  1075. const normalized = format ? formatHeader(header) : String(header).trim();
  1076. if (normalized !== header) {
  1077. delete self2[header];
  1078. }
  1079. self2[normalized] = normalizeValue(value);
  1080. headers[normalized] = true;
  1081. });
  1082. return this;
  1083. }
  1084. concat(...targets) {
  1085. return this.constructor.concat(this, ...targets);
  1086. }
  1087. toJSON(asStrings) {
  1088. const obj = /* @__PURE__ */ Object.create(null);
  1089. utils_default.forEach(this, (value, header) => {
  1090. value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
  1091. });
  1092. return obj;
  1093. }
  1094. [Symbol.iterator]() {
  1095. return Object.entries(this.toJSON())[Symbol.iterator]();
  1096. }
  1097. toString() {
  1098. return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
  1099. }
  1100. get [Symbol.toStringTag]() {
  1101. return "AxiosHeaders";
  1102. }
  1103. static from(thing) {
  1104. return thing instanceof this ? thing : new this(thing);
  1105. }
  1106. static concat(first, ...targets) {
  1107. const computed = new this(first);
  1108. targets.forEach((target) => computed.set(target));
  1109. return computed;
  1110. }
  1111. static accessor(header) {
  1112. const internals = this[$internals] = this[$internals] = {
  1113. accessors: {}
  1114. };
  1115. const accessors = internals.accessors;
  1116. const prototype3 = this.prototype;
  1117. function defineAccessor(_header) {
  1118. const lHeader = normalizeHeader(_header);
  1119. if (!accessors[lHeader]) {
  1120. buildAccessors(prototype3, _header);
  1121. accessors[lHeader] = true;
  1122. }
  1123. }
  1124. utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
  1125. return this;
  1126. }
  1127. };
  1128. AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
  1129. utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
  1130. let mapped = key[0].toUpperCase() + key.slice(1);
  1131. return {
  1132. get: () => value,
  1133. set(headerValue) {
  1134. this[mapped] = headerValue;
  1135. }
  1136. };
  1137. });
  1138. utils_default.freezeMethods(AxiosHeaders);
  1139. var AxiosHeaders_default = AxiosHeaders;
  1140. // node_modules/axios/lib/core/transformData.js
  1141. function transformData(fns, response) {
  1142. const config = this || defaults_default;
  1143. const context = response || config;
  1144. const headers = AxiosHeaders_default.from(context.headers);
  1145. let data = context.data;
  1146. utils_default.forEach(fns, function transform(fn) {
  1147. data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
  1148. });
  1149. headers.normalize();
  1150. return data;
  1151. }
  1152. // node_modules/axios/lib/cancel/isCancel.js
  1153. function isCancel(value) {
  1154. return !!(value && value.__CANCEL__);
  1155. }
  1156. // node_modules/axios/lib/cancel/CanceledError.js
  1157. function CanceledError(message, config, request) {
  1158. AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
  1159. this.name = "CanceledError";
  1160. }
  1161. utils_default.inherits(CanceledError, AxiosError_default, {
  1162. __CANCEL__: true
  1163. });
  1164. var CanceledError_default = CanceledError;
  1165. // node_modules/axios/lib/core/settle.js
  1166. function settle(resolve, reject, response) {
  1167. const validateStatus2 = response.config.validateStatus;
  1168. if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
  1169. resolve(response);
  1170. } else {
  1171. reject(new AxiosError_default(
  1172. "Request failed with status code " + response.status,
  1173. [AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
  1174. response.config,
  1175. response.request,
  1176. response
  1177. ));
  1178. }
  1179. }
  1180. // node_modules/axios/lib/helpers/cookies.js
  1181. var cookies_default = browser_default.isStandardBrowserEnv ? (
  1182. // Standard browser envs support document.cookie
  1183. function standardBrowserEnv() {
  1184. return {
  1185. write: function write(name, value, expires, path, domain, secure) {
  1186. const cookie = [];
  1187. cookie.push(name + "=" + encodeURIComponent(value));
  1188. if (utils_default.isNumber(expires)) {
  1189. cookie.push("expires=" + new Date(expires).toGMTString());
  1190. }
  1191. if (utils_default.isString(path)) {
  1192. cookie.push("path=" + path);
  1193. }
  1194. if (utils_default.isString(domain)) {
  1195. cookie.push("domain=" + domain);
  1196. }
  1197. if (secure === true) {
  1198. cookie.push("secure");
  1199. }
  1200. document.cookie = cookie.join("; ");
  1201. },
  1202. read: function read(name) {
  1203. const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
  1204. return match ? decodeURIComponent(match[3]) : null;
  1205. },
  1206. remove: function remove(name) {
  1207. this.write(name, "", Date.now() - 864e5);
  1208. }
  1209. };
  1210. }()
  1211. ) : (
  1212. // Non standard browser env (web workers, react-native) lack needed support.
  1213. function nonStandardBrowserEnv() {
  1214. return {
  1215. write: function write() {
  1216. },
  1217. read: function read() {
  1218. return null;
  1219. },
  1220. remove: function remove() {
  1221. }
  1222. };
  1223. }()
  1224. );
  1225. // node_modules/axios/lib/helpers/isAbsoluteURL.js
  1226. function isAbsoluteURL(url) {
  1227. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
  1228. }
  1229. // node_modules/axios/lib/helpers/combineURLs.js
  1230. function combineURLs(baseURL, relativeURL) {
  1231. return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
  1232. }
  1233. // node_modules/axios/lib/core/buildFullPath.js
  1234. function buildFullPath(baseURL, requestedURL) {
  1235. if (baseURL && !isAbsoluteURL(requestedURL)) {
  1236. return combineURLs(baseURL, requestedURL);
  1237. }
  1238. return requestedURL;
  1239. }
  1240. // node_modules/axios/lib/helpers/isURLSameOrigin.js
  1241. var isURLSameOrigin_default = browser_default.isStandardBrowserEnv ? (
  1242. // Standard browser envs have full support of the APIs needed to test
  1243. // whether the request URL is of the same origin as current location.
  1244. function standardBrowserEnv2() {
  1245. const msie = /(msie|trident)/i.test(navigator.userAgent);
  1246. const urlParsingNode = document.createElement("a");
  1247. let originURL;
  1248. function resolveURL(url) {
  1249. let href = url;
  1250. if (msie) {
  1251. urlParsingNode.setAttribute("href", href);
  1252. href = urlParsingNode.href;
  1253. }
  1254. urlParsingNode.setAttribute("href", href);
  1255. return {
  1256. href: urlParsingNode.href,
  1257. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
  1258. host: urlParsingNode.host,
  1259. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
  1260. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
  1261. hostname: urlParsingNode.hostname,
  1262. port: urlParsingNode.port,
  1263. pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
  1264. };
  1265. }
  1266. originURL = resolveURL(window.location.href);
  1267. return function isURLSameOrigin(requestURL) {
  1268. const parsed = utils_default.isString(requestURL) ? resolveURL(requestURL) : requestURL;
  1269. return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
  1270. };
  1271. }()
  1272. ) : (
  1273. // Non standard browser envs (web workers, react-native) lack needed support.
  1274. function nonStandardBrowserEnv2() {
  1275. return function isURLSameOrigin() {
  1276. return true;
  1277. };
  1278. }()
  1279. );
  1280. // node_modules/axios/lib/helpers/parseProtocol.js
  1281. function parseProtocol(url) {
  1282. const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
  1283. return match && match[1] || "";
  1284. }
  1285. // node_modules/axios/lib/helpers/speedometer.js
  1286. function speedometer(samplesCount, min) {
  1287. samplesCount = samplesCount || 10;
  1288. const bytes = new Array(samplesCount);
  1289. const timestamps = new Array(samplesCount);
  1290. let head = 0;
  1291. let tail = 0;
  1292. let firstSampleTS;
  1293. min = min !== void 0 ? min : 1e3;
  1294. return function push(chunkLength) {
  1295. const now = Date.now();
  1296. const startedAt = timestamps[tail];
  1297. if (!firstSampleTS) {
  1298. firstSampleTS = now;
  1299. }
  1300. bytes[head] = chunkLength;
  1301. timestamps[head] = now;
  1302. let i = tail;
  1303. let bytesCount = 0;
  1304. while (i !== head) {
  1305. bytesCount += bytes[i++];
  1306. i = i % samplesCount;
  1307. }
  1308. head = (head + 1) % samplesCount;
  1309. if (head === tail) {
  1310. tail = (tail + 1) % samplesCount;
  1311. }
  1312. if (now - firstSampleTS < min) {
  1313. return;
  1314. }
  1315. const passed = startedAt && now - startedAt;
  1316. return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
  1317. };
  1318. }
  1319. var speedometer_default = speedometer;
  1320. // node_modules/axios/lib/adapters/xhr.js
  1321. function progressEventReducer(listener, isDownloadStream) {
  1322. let bytesNotified = 0;
  1323. const _speedometer = speedometer_default(50, 250);
  1324. return (e) => {
  1325. const loaded = e.loaded;
  1326. const total = e.lengthComputable ? e.total : void 0;
  1327. const progressBytes = loaded - bytesNotified;
  1328. const rate = _speedometer(progressBytes);
  1329. const inRange = loaded <= total;
  1330. bytesNotified = loaded;
  1331. const data = {
  1332. loaded,
  1333. total,
  1334. progress: total ? loaded / total : void 0,
  1335. bytes: progressBytes,
  1336. rate: rate ? rate : void 0,
  1337. estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
  1338. event: e
  1339. };
  1340. data[isDownloadStream ? "download" : "upload"] = true;
  1341. listener(data);
  1342. };
  1343. }
  1344. var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
  1345. var xhr_default = isXHRAdapterSupported && function(config) {
  1346. return new Promise(function dispatchXhrRequest(resolve, reject) {
  1347. let requestData = config.data;
  1348. const requestHeaders = AxiosHeaders_default.from(config.headers).normalize();
  1349. const responseType = config.responseType;
  1350. let onCanceled;
  1351. function done() {
  1352. if (config.cancelToken) {
  1353. config.cancelToken.unsubscribe(onCanceled);
  1354. }
  1355. if (config.signal) {
  1356. config.signal.removeEventListener("abort", onCanceled);
  1357. }
  1358. }
  1359. if (utils_default.isFormData(requestData)) {
  1360. if (browser_default.isStandardBrowserEnv || browser_default.isStandardBrowserWebWorkerEnv) {
  1361. requestHeaders.setContentType(false);
  1362. } else {
  1363. requestHeaders.setContentType("multipart/form-data;", false);
  1364. }
  1365. }
  1366. let request = new XMLHttpRequest();
  1367. if (config.auth) {
  1368. const username = config.auth.username || "";
  1369. const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
  1370. requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
  1371. }
  1372. const fullPath = buildFullPath(config.baseURL, config.url);
  1373. request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
  1374. request.timeout = config.timeout;
  1375. function onloadend() {
  1376. if (!request) {
  1377. return;
  1378. }
  1379. const responseHeaders = AxiosHeaders_default.from(
  1380. "getAllResponseHeaders" in request && request.getAllResponseHeaders()
  1381. );
  1382. const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
  1383. const response = {
  1384. data: responseData,
  1385. status: request.status,
  1386. statusText: request.statusText,
  1387. headers: responseHeaders,
  1388. config,
  1389. request
  1390. };
  1391. settle(function _resolve(value) {
  1392. resolve(value);
  1393. done();
  1394. }, function _reject(err) {
  1395. reject(err);
  1396. done();
  1397. }, response);
  1398. request = null;
  1399. }
  1400. if ("onloadend" in request) {
  1401. request.onloadend = onloadend;
  1402. } else {
  1403. request.onreadystatechange = function handleLoad() {
  1404. if (!request || request.readyState !== 4) {
  1405. return;
  1406. }
  1407. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
  1408. return;
  1409. }
  1410. setTimeout(onloadend);
  1411. };
  1412. }
  1413. request.onabort = function handleAbort() {
  1414. if (!request) {
  1415. return;
  1416. }
  1417. reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
  1418. request = null;
  1419. };
  1420. request.onerror = function handleError() {
  1421. reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request));
  1422. request = null;
  1423. };
  1424. request.ontimeout = function handleTimeout() {
  1425. let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
  1426. const transitional2 = config.transitional || transitional_default;
  1427. if (config.timeoutErrorMessage) {
  1428. timeoutErrorMessage = config.timeoutErrorMessage;
  1429. }
  1430. reject(new AxiosError_default(
  1431. timeoutErrorMessage,
  1432. transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
  1433. config,
  1434. request
  1435. ));
  1436. request = null;
  1437. };
  1438. if (browser_default.isStandardBrowserEnv) {
  1439. const xsrfValue = (config.withCredentials || isURLSameOrigin_default(fullPath)) && config.xsrfCookieName && cookies_default.read(config.xsrfCookieName);
  1440. if (xsrfValue) {
  1441. requestHeaders.set(config.xsrfHeaderName, xsrfValue);
  1442. }
  1443. }
  1444. requestData === void 0 && requestHeaders.setContentType(null);
  1445. if ("setRequestHeader" in request) {
  1446. utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
  1447. request.setRequestHeader(key, val);
  1448. });
  1449. }
  1450. if (!utils_default.isUndefined(config.withCredentials)) {
  1451. request.withCredentials = !!config.withCredentials;
  1452. }
  1453. if (responseType && responseType !== "json") {
  1454. request.responseType = config.responseType;
  1455. }
  1456. if (typeof config.onDownloadProgress === "function") {
  1457. request.addEventListener("progress", progressEventReducer(config.onDownloadProgress, true));
  1458. }
  1459. if (typeof config.onUploadProgress === "function" && request.upload) {
  1460. request.upload.addEventListener("progress", progressEventReducer(config.onUploadProgress));
  1461. }
  1462. if (config.cancelToken || config.signal) {
  1463. onCanceled = (cancel) => {
  1464. if (!request) {
  1465. return;
  1466. }
  1467. reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel);
  1468. request.abort();
  1469. request = null;
  1470. };
  1471. config.cancelToken && config.cancelToken.subscribe(onCanceled);
  1472. if (config.signal) {
  1473. config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
  1474. }
  1475. }
  1476. const protocol = parseProtocol(fullPath);
  1477. if (protocol && browser_default.protocols.indexOf(protocol) === -1) {
  1478. reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
  1479. return;
  1480. }
  1481. request.send(requestData || null);
  1482. });
  1483. };
  1484. // node_modules/axios/lib/adapters/adapters.js
  1485. var knownAdapters = {
  1486. http: null_default,
  1487. xhr: xhr_default
  1488. };
  1489. utils_default.forEach(knownAdapters, (fn, value) => {
  1490. if (fn) {
  1491. try {
  1492. Object.defineProperty(fn, "name", { value });
  1493. } catch (e) {
  1494. }
  1495. Object.defineProperty(fn, "adapterName", { value });
  1496. }
  1497. });
  1498. var adapters_default = {
  1499. getAdapter: (adapters) => {
  1500. adapters = utils_default.isArray(adapters) ? adapters : [adapters];
  1501. const { length } = adapters;
  1502. let nameOrAdapter;
  1503. let adapter;
  1504. for (let i = 0; i < length; i++) {
  1505. nameOrAdapter = adapters[i];
  1506. if (adapter = utils_default.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter) {
  1507. break;
  1508. }
  1509. }
  1510. if (!adapter) {
  1511. if (adapter === false) {
  1512. throw new AxiosError_default(
  1513. `Adapter ${nameOrAdapter} is not supported by the environment`,
  1514. "ERR_NOT_SUPPORT"
  1515. );
  1516. }
  1517. throw new Error(
  1518. utils_default.hasOwnProp(knownAdapters, nameOrAdapter) ? `Adapter '${nameOrAdapter}' is not available in the build` : `Unknown adapter '${nameOrAdapter}'`
  1519. );
  1520. }
  1521. if (!utils_default.isFunction(adapter)) {
  1522. throw new TypeError("adapter is not a function");
  1523. }
  1524. return adapter;
  1525. },
  1526. adapters: knownAdapters
  1527. };
  1528. // node_modules/axios/lib/core/dispatchRequest.js
  1529. function throwIfCancellationRequested(config) {
  1530. if (config.cancelToken) {
  1531. config.cancelToken.throwIfRequested();
  1532. }
  1533. if (config.signal && config.signal.aborted) {
  1534. throw new CanceledError_default(null, config);
  1535. }
  1536. }
  1537. function dispatchRequest(config) {
  1538. throwIfCancellationRequested(config);
  1539. config.headers = AxiosHeaders_default.from(config.headers);
  1540. config.data = transformData.call(
  1541. config,
  1542. config.transformRequest
  1543. );
  1544. if (["post", "put", "patch"].indexOf(config.method) !== -1) {
  1545. config.headers.setContentType("application/x-www-form-urlencoded", false);
  1546. }
  1547. const adapter = adapters_default.getAdapter(config.adapter || defaults_default.adapter);
  1548. return adapter(config).then(function onAdapterResolution(response) {
  1549. throwIfCancellationRequested(config);
  1550. response.data = transformData.call(
  1551. config,
  1552. config.transformResponse,
  1553. response
  1554. );
  1555. response.headers = AxiosHeaders_default.from(response.headers);
  1556. return response;
  1557. }, function onAdapterRejection(reason) {
  1558. if (!isCancel(reason)) {
  1559. throwIfCancellationRequested(config);
  1560. if (reason && reason.response) {
  1561. reason.response.data = transformData.call(
  1562. config,
  1563. config.transformResponse,
  1564. reason.response
  1565. );
  1566. reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
  1567. }
  1568. }
  1569. return Promise.reject(reason);
  1570. });
  1571. }
  1572. // node_modules/axios/lib/core/mergeConfig.js
  1573. var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing;
  1574. function mergeConfig(config1, config2) {
  1575. config2 = config2 || {};
  1576. const config = {};
  1577. function getMergedValue(target, source, caseless) {
  1578. if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
  1579. return utils_default.merge.call({ caseless }, target, source);
  1580. } else if (utils_default.isPlainObject(source)) {
  1581. return utils_default.merge({}, source);
  1582. } else if (utils_default.isArray(source)) {
  1583. return source.slice();
  1584. }
  1585. return source;
  1586. }
  1587. function mergeDeepProperties(a, b, caseless) {
  1588. if (!utils_default.isUndefined(b)) {
  1589. return getMergedValue(a, b, caseless);
  1590. } else if (!utils_default.isUndefined(a)) {
  1591. return getMergedValue(void 0, a, caseless);
  1592. }
  1593. }
  1594. function valueFromConfig2(a, b) {
  1595. if (!utils_default.isUndefined(b)) {
  1596. return getMergedValue(void 0, b);
  1597. }
  1598. }
  1599. function defaultToConfig2(a, b) {
  1600. if (!utils_default.isUndefined(b)) {
  1601. return getMergedValue(void 0, b);
  1602. } else if (!utils_default.isUndefined(a)) {
  1603. return getMergedValue(void 0, a);
  1604. }
  1605. }
  1606. function mergeDirectKeys(a, b, prop) {
  1607. if (prop in config2) {
  1608. return getMergedValue(a, b);
  1609. } else if (prop in config1) {
  1610. return getMergedValue(void 0, a);
  1611. }
  1612. }
  1613. const mergeMap = {
  1614. url: valueFromConfig2,
  1615. method: valueFromConfig2,
  1616. data: valueFromConfig2,
  1617. baseURL: defaultToConfig2,
  1618. transformRequest: defaultToConfig2,
  1619. transformResponse: defaultToConfig2,
  1620. paramsSerializer: defaultToConfig2,
  1621. timeout: defaultToConfig2,
  1622. timeoutMessage: defaultToConfig2,
  1623. withCredentials: defaultToConfig2,
  1624. adapter: defaultToConfig2,
  1625. responseType: defaultToConfig2,
  1626. xsrfCookieName: defaultToConfig2,
  1627. xsrfHeaderName: defaultToConfig2,
  1628. onUploadProgress: defaultToConfig2,
  1629. onDownloadProgress: defaultToConfig2,
  1630. decompress: defaultToConfig2,
  1631. maxContentLength: defaultToConfig2,
  1632. maxBodyLength: defaultToConfig2,
  1633. beforeRedirect: defaultToConfig2,
  1634. transport: defaultToConfig2,
  1635. httpAgent: defaultToConfig2,
  1636. httpsAgent: defaultToConfig2,
  1637. cancelToken: defaultToConfig2,
  1638. socketPath: defaultToConfig2,
  1639. responseEncoding: defaultToConfig2,
  1640. validateStatus: mergeDirectKeys,
  1641. headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
  1642. };
  1643. utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
  1644. const merge2 = mergeMap[prop] || mergeDeepProperties;
  1645. const configValue = merge2(config1[prop], config2[prop], prop);
  1646. utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
  1647. });
  1648. return config;
  1649. }
  1650. // node_modules/axios/lib/env/data.js
  1651. var VERSION = "1.5.0";
  1652. // node_modules/axios/lib/helpers/validator.js
  1653. var validators = {};
  1654. ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
  1655. validators[type] = function validator(thing) {
  1656. return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
  1657. };
  1658. });
  1659. var deprecatedWarnings = {};
  1660. validators.transitional = function transitional(validator, version, message) {
  1661. function formatMessage(opt, desc) {
  1662. return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
  1663. }
  1664. return (value, opt, opts) => {
  1665. if (validator === false) {
  1666. throw new AxiosError_default(
  1667. formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
  1668. AxiosError_default.ERR_DEPRECATED
  1669. );
  1670. }
  1671. if (version && !deprecatedWarnings[opt]) {
  1672. deprecatedWarnings[opt] = true;
  1673. console.warn(
  1674. formatMessage(
  1675. opt,
  1676. " has been deprecated since v" + version + " and will be removed in the near future"
  1677. )
  1678. );
  1679. }
  1680. return validator ? validator(value, opt, opts) : true;
  1681. };
  1682. };
  1683. function assertOptions(options, schema, allowUnknown) {
  1684. if (typeof options !== "object") {
  1685. throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
  1686. }
  1687. const keys = Object.keys(options);
  1688. let i = keys.length;
  1689. while (i-- > 0) {
  1690. const opt = keys[i];
  1691. const validator = schema[opt];
  1692. if (validator) {
  1693. const value = options[opt];
  1694. const result = value === void 0 || validator(value, opt, options);
  1695. if (result !== true) {
  1696. throw new AxiosError_default("option " + opt + " must be " + result, AxiosError_default.ERR_BAD_OPTION_VALUE);
  1697. }
  1698. continue;
  1699. }
  1700. if (allowUnknown !== true) {
  1701. throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION);
  1702. }
  1703. }
  1704. }
  1705. var validator_default = {
  1706. assertOptions,
  1707. validators
  1708. };
  1709. // node_modules/axios/lib/core/Axios.js
  1710. var validators2 = validator_default.validators;
  1711. var Axios = class {
  1712. constructor(instanceConfig) {
  1713. this.defaults = instanceConfig;
  1714. this.interceptors = {
  1715. request: new InterceptorManager_default(),
  1716. response: new InterceptorManager_default()
  1717. };
  1718. }
  1719. /**
  1720. * Dispatch a request
  1721. *
  1722. * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
  1723. * @param {?Object} config
  1724. *
  1725. * @returns {Promise} The Promise to be fulfilled
  1726. */
  1727. request(configOrUrl, config) {
  1728. if (typeof configOrUrl === "string") {
  1729. config = config || {};
  1730. config.url = configOrUrl;
  1731. } else {
  1732. config = configOrUrl || {};
  1733. }
  1734. config = mergeConfig(this.defaults, config);
  1735. const { transitional: transitional2, paramsSerializer, headers } = config;
  1736. if (transitional2 !== void 0) {
  1737. validator_default.assertOptions(transitional2, {
  1738. silentJSONParsing: validators2.transitional(validators2.boolean),
  1739. forcedJSONParsing: validators2.transitional(validators2.boolean),
  1740. clarifyTimeoutError: validators2.transitional(validators2.boolean)
  1741. }, false);
  1742. }
  1743. if (paramsSerializer != null) {
  1744. if (utils_default.isFunction(paramsSerializer)) {
  1745. config.paramsSerializer = {
  1746. serialize: paramsSerializer
  1747. };
  1748. } else {
  1749. validator_default.assertOptions(paramsSerializer, {
  1750. encode: validators2.function,
  1751. serialize: validators2.function
  1752. }, true);
  1753. }
  1754. }
  1755. config.method = (config.method || this.defaults.method || "get").toLowerCase();
  1756. let contextHeaders = headers && utils_default.merge(
  1757. headers.common,
  1758. headers[config.method]
  1759. );
  1760. headers && utils_default.forEach(
  1761. ["delete", "get", "head", "post", "put", "patch", "common"],
  1762. (method) => {
  1763. delete headers[method];
  1764. }
  1765. );
  1766. config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
  1767. const requestInterceptorChain = [];
  1768. let synchronousRequestInterceptors = true;
  1769. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  1770. if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
  1771. return;
  1772. }
  1773. synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
  1774. requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
  1775. });
  1776. const responseInterceptorChain = [];
  1777. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  1778. responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
  1779. });
  1780. let promise;
  1781. let i = 0;
  1782. let len;
  1783. if (!synchronousRequestInterceptors) {
  1784. const chain = [dispatchRequest.bind(this), void 0];
  1785. chain.unshift.apply(chain, requestInterceptorChain);
  1786. chain.push.apply(chain, responseInterceptorChain);
  1787. len = chain.length;
  1788. promise = Promise.resolve(config);
  1789. while (i < len) {
  1790. promise = promise.then(chain[i++], chain[i++]);
  1791. }
  1792. return promise;
  1793. }
  1794. len = requestInterceptorChain.length;
  1795. let newConfig = config;
  1796. i = 0;
  1797. while (i < len) {
  1798. const onFulfilled = requestInterceptorChain[i++];
  1799. const onRejected = requestInterceptorChain[i++];
  1800. try {
  1801. newConfig = onFulfilled(newConfig);
  1802. } catch (error) {
  1803. onRejected.call(this, error);
  1804. break;
  1805. }
  1806. }
  1807. try {
  1808. promise = dispatchRequest.call(this, newConfig);
  1809. } catch (error) {
  1810. return Promise.reject(error);
  1811. }
  1812. i = 0;
  1813. len = responseInterceptorChain.length;
  1814. while (i < len) {
  1815. promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
  1816. }
  1817. return promise;
  1818. }
  1819. getUri(config) {
  1820. config = mergeConfig(this.defaults, config);
  1821. const fullPath = buildFullPath(config.baseURL, config.url);
  1822. return buildURL(fullPath, config.params, config.paramsSerializer);
  1823. }
  1824. };
  1825. utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
  1826. Axios.prototype[method] = function(url, config) {
  1827. return this.request(mergeConfig(config || {}, {
  1828. method,
  1829. url,
  1830. data: (config || {}).data
  1831. }));
  1832. };
  1833. });
  1834. utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
  1835. function generateHTTPMethod(isForm) {
  1836. return function httpMethod(url, data, config) {
  1837. return this.request(mergeConfig(config || {}, {
  1838. method,
  1839. headers: isForm ? {
  1840. "Content-Type": "multipart/form-data"
  1841. } : {},
  1842. url,
  1843. data
  1844. }));
  1845. };
  1846. }
  1847. Axios.prototype[method] = generateHTTPMethod();
  1848. Axios.prototype[method + "Form"] = generateHTTPMethod(true);
  1849. });
  1850. var Axios_default = Axios;
  1851. // node_modules/axios/lib/cancel/CancelToken.js
  1852. var CancelToken = class _CancelToken {
  1853. constructor(executor) {
  1854. if (typeof executor !== "function") {
  1855. throw new TypeError("executor must be a function.");
  1856. }
  1857. let resolvePromise;
  1858. this.promise = new Promise(function promiseExecutor(resolve) {
  1859. resolvePromise = resolve;
  1860. });
  1861. const token = this;
  1862. this.promise.then((cancel) => {
  1863. if (!token._listeners)
  1864. return;
  1865. let i = token._listeners.length;
  1866. while (i-- > 0) {
  1867. token._listeners[i](cancel);
  1868. }
  1869. token._listeners = null;
  1870. });
  1871. this.promise.then = (onfulfilled) => {
  1872. let _resolve;
  1873. const promise = new Promise((resolve) => {
  1874. token.subscribe(resolve);
  1875. _resolve = resolve;
  1876. }).then(onfulfilled);
  1877. promise.cancel = function reject() {
  1878. token.unsubscribe(_resolve);
  1879. };
  1880. return promise;
  1881. };
  1882. executor(function cancel(message, config, request) {
  1883. if (token.reason) {
  1884. return;
  1885. }
  1886. token.reason = new CanceledError_default(message, config, request);
  1887. resolvePromise(token.reason);
  1888. });
  1889. }
  1890. /**
  1891. * Throws a `CanceledError` if cancellation has been requested.
  1892. */
  1893. throwIfRequested() {
  1894. if (this.reason) {
  1895. throw this.reason;
  1896. }
  1897. }
  1898. /**
  1899. * Subscribe to the cancel signal
  1900. */
  1901. subscribe(listener) {
  1902. if (this.reason) {
  1903. listener(this.reason);
  1904. return;
  1905. }
  1906. if (this._listeners) {
  1907. this._listeners.push(listener);
  1908. } else {
  1909. this._listeners = [listener];
  1910. }
  1911. }
  1912. /**
  1913. * Unsubscribe from the cancel signal
  1914. */
  1915. unsubscribe(listener) {
  1916. if (!this._listeners) {
  1917. return;
  1918. }
  1919. const index = this._listeners.indexOf(listener);
  1920. if (index !== -1) {
  1921. this._listeners.splice(index, 1);
  1922. }
  1923. }
  1924. /**
  1925. * Returns an object that contains a new `CancelToken` and a function that, when called,
  1926. * cancels the `CancelToken`.
  1927. */
  1928. static source() {
  1929. let cancel;
  1930. const token = new _CancelToken(function executor(c) {
  1931. cancel = c;
  1932. });
  1933. return {
  1934. token,
  1935. cancel
  1936. };
  1937. }
  1938. };
  1939. var CancelToken_default = CancelToken;
  1940. // node_modules/axios/lib/helpers/spread.js
  1941. function spread(callback) {
  1942. return function wrap(arr) {
  1943. return callback.apply(null, arr);
  1944. };
  1945. }
  1946. // node_modules/axios/lib/helpers/isAxiosError.js
  1947. function isAxiosError(payload) {
  1948. return utils_default.isObject(payload) && payload.isAxiosError === true;
  1949. }
  1950. // node_modules/axios/lib/helpers/HttpStatusCode.js
  1951. var HttpStatusCode = {
  1952. Continue: 100,
  1953. SwitchingProtocols: 101,
  1954. Processing: 102,
  1955. EarlyHints: 103,
  1956. Ok: 200,
  1957. Created: 201,
  1958. Accepted: 202,
  1959. NonAuthoritativeInformation: 203,
  1960. NoContent: 204,
  1961. ResetContent: 205,
  1962. PartialContent: 206,
  1963. MultiStatus: 207,
  1964. AlreadyReported: 208,
  1965. ImUsed: 226,
  1966. MultipleChoices: 300,
  1967. MovedPermanently: 301,
  1968. Found: 302,
  1969. SeeOther: 303,
  1970. NotModified: 304,
  1971. UseProxy: 305,
  1972. Unused: 306,
  1973. TemporaryRedirect: 307,
  1974. PermanentRedirect: 308,
  1975. BadRequest: 400,
  1976. Unauthorized: 401,
  1977. PaymentRequired: 402,
  1978. Forbidden: 403,
  1979. NotFound: 404,
  1980. MethodNotAllowed: 405,
  1981. NotAcceptable: 406,
  1982. ProxyAuthenticationRequired: 407,
  1983. RequestTimeout: 408,
  1984. Conflict: 409,
  1985. Gone: 410,
  1986. LengthRequired: 411,
  1987. PreconditionFailed: 412,
  1988. PayloadTooLarge: 413,
  1989. UriTooLong: 414,
  1990. UnsupportedMediaType: 415,
  1991. RangeNotSatisfiable: 416,
  1992. ExpectationFailed: 417,
  1993. ImATeapot: 418,
  1994. MisdirectedRequest: 421,
  1995. UnprocessableEntity: 422,
  1996. Locked: 423,
  1997. FailedDependency: 424,
  1998. TooEarly: 425,
  1999. UpgradeRequired: 426,
  2000. PreconditionRequired: 428,
  2001. TooManyRequests: 429,
  2002. RequestHeaderFieldsTooLarge: 431,
  2003. UnavailableForLegalReasons: 451,
  2004. InternalServerError: 500,
  2005. NotImplemented: 501,
  2006. BadGateway: 502,
  2007. ServiceUnavailable: 503,
  2008. GatewayTimeout: 504,
  2009. HttpVersionNotSupported: 505,
  2010. VariantAlsoNegotiates: 506,
  2011. InsufficientStorage: 507,
  2012. LoopDetected: 508,
  2013. NotExtended: 510,
  2014. NetworkAuthenticationRequired: 511
  2015. };
  2016. Object.entries(HttpStatusCode).forEach(([key, value]) => {
  2017. HttpStatusCode[value] = key;
  2018. });
  2019. var HttpStatusCode_default = HttpStatusCode;
  2020. // node_modules/axios/lib/axios.js
  2021. function createInstance(defaultConfig) {
  2022. const context = new Axios_default(defaultConfig);
  2023. const instance = bind(Axios_default.prototype.request, context);
  2024. utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
  2025. utils_default.extend(instance, context, null, { allOwnKeys: true });
  2026. instance.create = function create(instanceConfig) {
  2027. return createInstance(mergeConfig(defaultConfig, instanceConfig));
  2028. };
  2029. return instance;
  2030. }
  2031. var axios = createInstance(defaults_default);
  2032. axios.Axios = Axios_default;
  2033. axios.CanceledError = CanceledError_default;
  2034. axios.CancelToken = CancelToken_default;
  2035. axios.isCancel = isCancel;
  2036. axios.VERSION = VERSION;
  2037. axios.toFormData = toFormData_default;
  2038. axios.AxiosError = AxiosError_default;
  2039. axios.Cancel = axios.CanceledError;
  2040. axios.all = function all(promises) {
  2041. return Promise.all(promises);
  2042. };
  2043. axios.spread = spread;
  2044. axios.isAxiosError = isAxiosError;
  2045. axios.mergeConfig = mergeConfig;
  2046. axios.AxiosHeaders = AxiosHeaders_default;
  2047. axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
  2048. axios.getAdapter = adapters_default.getAdapter;
  2049. axios.HttpStatusCode = HttpStatusCode_default;
  2050. axios.default = axios;
  2051. var axios_default = axios;
  2052. // node_modules/axios/index.js
  2053. var {
  2054. Axios: Axios2,
  2055. AxiosError: AxiosError2,
  2056. CanceledError: CanceledError2,
  2057. isCancel: isCancel2,
  2058. CancelToken: CancelToken2,
  2059. VERSION: VERSION2,
  2060. all: all2,
  2061. Cancel,
  2062. isAxiosError: isAxiosError2,
  2063. spread: spread2,
  2064. toFormData: toFormData2,
  2065. AxiosHeaders: AxiosHeaders2,
  2066. HttpStatusCode: HttpStatusCode2,
  2067. formToJSON,
  2068. getAdapter,
  2069. mergeConfig: mergeConfig2
  2070. } = axios_default;
  2071. export {
  2072. Axios2 as Axios,
  2073. AxiosError2 as AxiosError,
  2074. AxiosHeaders2 as AxiosHeaders,
  2075. Cancel,
  2076. CancelToken2 as CancelToken,
  2077. CanceledError2 as CanceledError,
  2078. HttpStatusCode2 as HttpStatusCode,
  2079. VERSION2 as VERSION,
  2080. all2 as all,
  2081. axios_default as default,
  2082. formToJSON,
  2083. getAdapter,
  2084. isAxiosError2 as isAxiosError,
  2085. isCancel2 as isCancel,
  2086. mergeConfig2 as mergeConfig,
  2087. spread2 as spread,
  2088. toFormData2 as toFormData
  2089. };
  2090. //# sourceMappingURL=axios.js.map