vendor: 7,907 bytes, lines 1-295
1/* axios v0.19.0 | (c) 2019 by Matt Zabriskie */ 2(function webpackUniversalModuleDefinition(root, factory) { 3 if(typeof exports === 'object' && typeof module === 'object') 4 module.exports = factory(); 5 else if(typeof define === 'function' && define.amd) 6 define([], factory); 7 else if(typeof exports === 'object') 8 exports["axios"] = factory(); 9 else 10 root["axios"] = factory(); 11})(this, function() { 12return /******/ (function(modules) { // webpackBootstrap 13/******/ // The module cache 14/******/ var installedModules = {}; 15/******/ 16/******/ // The require function 17/******/ function __webpack_require__(moduleId) { 18/******/ 19/******/ // Check if module is in cache 20/******/ if(installedModules[moduleId]) 21/******/ return installedModules[moduleId].exports; 22/******/ 23/******/ // Create a new module (and put it into the cache) 24/******/ var module = installedModules[moduleId] = { 25/******/ exports: {}, 26/******/ id: moduleId, 27/******/ loaded: false 28/******/ }; 29/******/ 30/******/ // Execute the module function 31/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 32/******/ 33/******/ // Flag the module as loaded 34/******/ module.loaded = true; 35/******/ 36/******/ // Return the exports of the module 37/******/ return module.exports; 38/******/ } 39/******/ 40/******/ 41/******/ // expose the modules object (__webpack_modules__) 42/******/ __webpack_require__.m = modules; 43/******/ 44/******/ // expose the module cache 45/******/ __webpack_require__.c = installedModules; 46/******/ 47/******/ // __webpack_public_path__ 48/******/ __webpack_require__.p = ""; 49/******/ 50/******/ // Load entry module and return exports 51/******/ return __webpack_require__(0); 52/******/ }) 53/************************************************************************/ 54/******/ ([ 55/* 0 */ 56/***/ (function(module, exports, __webpack_require__) { 57 58 module.exports = __webpack_require__(1); 59 60/***/ }), 61/* 1 */ 62/***/ (function(module, exports, __webpack_require__) { 63 64 'use strict'; 65 66 var utils = __webpack_require__(2); 67 var bind = __webpack_require__(3); 68 var Axios = __webpack_require__(5); 69 var mergeConfig = __webpack_require__(22); 70 var defaults = __webpack_require__(11); 71 72 /** 73 * Create an instance of Axios 74 * 75 * @param {Object} defaultConfig The default config for the instance 76 * @return {Axios} A new instance of Axios 77 */ 78 function createInstance(defaultConfig) { 79 var context = new Axios(defaultConfig); 80 var instance = bind(Axios.prototype.request, context); 81 82 // Copy axios.prototype to instance 83 utils.extend(instance, Axios.prototype, context); 84 85 // Copy context to instance 86 utils.extend(instance, context); 87 88 return instance; 89 } 90 91 // Create the default instance to be exported 92 var axios = createInstance(defaults); 93 94 // Expose Axios class to allow class inheritance 95 axios.Axios = Axios; 96 97 // Factory for creating new instances 98 axios.create = function create(instanceConfig) { 99 return createInstance(mergeConfig(axios.defaults, instanceConfig)); 100 }; 101 102 // Expose Cancel & CancelToken 103 axios.Cancel = __webpack_require__(23); 104 axios.CancelToken = __webpack_require__(24); 105 axios.isCancel = __webpack_require__(10); 106 107 // Expose all/spread 108 axios.all = function all(promises) { 109 return Promise.all(promises); 110 }; 111 axios.spread = __webpack_require__(25); 112 113 module.exports = axios; 114 115 // Allow use of default import syntax in TypeScript 116 module.exports.default = axios; 117 118 119/***/ }), 120/* 2 */ 121/***/ (function(module, exports, __webpack_require__) { 122 123 'use strict'; 124 125 var bind = __webpack_require__(3); 126 var isBuffer = __webpack_require__(4); 127 128 /*global toString:true*/ 129 130 // utils is a library of generic helper functions non-specific to axios 131 132 var toString = Object.prototype.toString; 133 134 /** 135 * Determine if a value is an Array 136 * 137 * @param {Object} val The value to test 138 * @returns {boolean} True if value is an Array, otherwise false 139 */ 140 function isArray(val) { 141 return toString.call(val) === '[object Array]'; 142 } 143 144 /** 145 * Determine if a value is an ArrayBuffer 146 * 147 * @param {Object} val The value to test 148 * @returns {boolean} True if value is an ArrayBuffer, otherwise false 149 */ 150 function isArrayBuffer(val) { 151 return toString.call(val) === '[object ArrayBuffer]'; 152 } 153 154 /** 155 * Determine if a value is a FormData 156 * 157 * @param {Object} val The value to test 158 * @returns {boolean} True if value is an FormData, otherwise false 159 */ 160 function isFormData(val) { 161 return (typeof FormData !== 'undefined') && (val instanceof FormData); 162 } 163 164 /** 165 * Determine if a value is a view on an ArrayBuffer 166 * 167 * @param {Object} val The value to test 168 * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false 169 */ 170 function isArrayBufferView(val) { 171 var result; 172 if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { 173 result = ArrayBuffer.isView(val); 174 } else { 175 result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); 176 } 177 return result; 178 } 179 180 /** 181 * Determine if a value is a String 182 * 183 * @param {Object} val The value to test 184 * @returns {boolean} True if value is a String, otherwise false 185 */ 186 function isString(val) { 187 return typeof val === 'string'; 188 } 189 190 /** 191 * Determine if a value is a Number 192 * 193 * @param {Object} val The value to test 194 * @returns {boolean} True if value is a Number, otherwise false 195 */ 196 function isNumber(val) { 197 return typeof val === 'number'; 198 } 199 200 /** 201 * Determine if a value is undefined 202 * 203 * @param {Object} val The value to test 204 * @returns {boolean} True if the value is undefined, otherwise false 205 */ 206 function isUndefined(val) { 207 return typeof val === 'undefined'; 208 } 209 210 /** 211 * Determine if a value is an Object 212 * 213 * @param {Object} val The value to test 214 * @returns {boolean} True if value is an Object, otherwise false 215 */ 216 function isObject(val) { 217 return val !== null && typeof val === 'object'; 218 } 219 220 /** 221 * Determine if a value is a Date 222 * 223 * @param {Object} val The value to test 224 * @returns {boolean} True if value is a Date, otherwise false 225 */ 226 function isDate(val) { 227 return toString.call(val) === '[object Date]'; 228 } 229 230 /** 231 * Determine if a value is a File 232 * 233 * @param {Object} val The value to test 234 * @returns {boolean} True if value is a File, otherwise false 235 */ 236 function isFile(val) { 237 return toString.call(val) === '[object File]'; 238 } 239 240 /** 241 * Determine if a value is a Blob 242 * 243 * @param {Object} val The value to test 244 * @returns {boolean} True if value is a Blob, otherwise false 245 */ 246 function isBlob(val) { 247 return toString.call(val) === '[object Blob]'; 248 } 249 250 /** 251 * Determine if a value is a Function 252 * 253 * @param {Object} val The value to test 254 * @returns {boolean} True if value is a Function, otherwise false 255 */ 256 function isFunction(val) { 257 return toString.call(val) === '[object Function]'; 258 } 259 260 /** 261 * Determine if a value is a Stream 262 * 263 * @param {Object} val The value to test 264 * @returns {boolean} True if value is a Stream, otherwise false 265 */ 266 function isStream(val) { 267 return isObject(val) && isFunction(val.pipe); 268 } 269 270 /** 271 * Determine if a value is a URLSearchParams object 272 * 273 * @param {Object} val The value to test 274 * @returns {boolean} True if value is a URLSearchParams object, otherwise false 275 */ 276 function isURLSearchParams(val) { 277 return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; 278 } 279 280 /** 281 * Trim excess whitespace off the beginning and end of a string 282 * 283 * @param {String} str The String to trim 284 * @returns {String} The String freed of excess whitespace 285 */ 286 function trim(str) { 287 return str.replace(/^\s*/, '').replace(/\s*$/, ''); 288 } 289 290 /** 291 * Determine if we're running in a standard browser environment 292 * 293 * This allows axios to run in a web worker, and react-native. 294 * Both environments support XMLHttpRequest, but not fully standard globals. 295 *
vendor: 8,659 bytes, lines 296-624
296 * web workers: 297 * typeof window -> undefined 298 * typeof document -> undefined 299 * 300 * react-native: 301 * navigator.product -> 'ReactNative' 302 * nativescript 303 * navigator.product -> 'NativeScript' or 'NS' 304 */ 305 function isStandardBrowserEnv() { 306 if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || 307 navigator.product === 'NativeScript' || 308 navigator.product === 'NS')) { 309 return false; 310 } 311 return ( 312 typeof window !== 'undefined' && 313 typeof document !== 'undefined' 314 ); 315 } 316 317 /** 318 * Iterate over an Array or an Object invoking a function for each item. 319 * 320 * If `obj` is an Array callback will be called passing 321 * the value, index, and complete array for each item. 322 * 323 * If 'obj' is an Object callback will be called passing 324 * the value, key, and complete object for each property. 325 * 326 * @param {Object|Array} obj The object to iterate 327 * @param {Function} fn The callback to invoke for each item 328 */ 329 function forEach(obj, fn) { 330 // Don't bother if no value provided 331 if (obj === null || typeof obj === 'undefined') { 332 return; 333 } 334 335 // Force an array if not already something iterable 336 if (typeof obj !== 'object') { 337 /*eslint no-param-reassign:0*/ 338 obj = [obj]; 339 } 340 341 if (isArray(obj)) { 342 // Iterate over array values 343 for (var i = 0, l = obj.length; i < l; i++) { 344 fn.call(null, obj[i], i, obj); 345 } 346 } else { 347 // Iterate over object keys 348 for (var key in obj) { 349 if (Object.prototype.hasOwnProperty.call(obj, key)) { 350 fn.call(null, obj[key], key, obj); 351 } 352 } 353 } 354 } 355 356 /** 357 * Accepts varargs expecting each argument to be an object, then 358 * immutably merges the properties of each object and returns result. 359 * 360 * When multiple objects contain the same key the later object in 361 * the arguments list will take precedence. 362 * 363 * Example: 364 * 365 * ```js 366 * var result = merge({foo: 123}, {foo: 456}); 367 * console.log(result.foo); // outputs 456 368 * ``` 369 * 370 * @param {Object} obj1 Object to merge 371 * @returns {Object} Result of all merge properties 372 */ 373 function merge(/* obj1, obj2, obj3, ... */) { 374 var result = {}; 375 function assignValue(val, key) { 376 if (typeof result[key] === 'object' && typeof val === 'object') { 377 result[key] = merge(result[key], val); 378 } else { 379 result[key] = val; 380 } 381 } 382 383 for (var i = 0, l = arguments.length; i < l; i++) { 384 forEach(arguments[i], assignValue); 385 } 386 return result; 387 } 388 389 /** 390 * Function equal to merge with the difference being that no reference 391 * to original objects is kept. 392 * 393 * @see merge 394 * @param {Object} obj1 Object to merge 395 * @returns {Object} Result of all merge properties 396 */ 397 function deepMerge(/* obj1, obj2, obj3, ... */) { 398 var result = {}; 399 function assignValue(val, key) { 400 if (typeof result[key] === 'object' && typeof val === 'object') { 401 result[key] = deepMerge(result[key], val); 402 } else if (typeof val === 'object') { 403 result[key] = deepMerge({}, val); 404 } else { 405 result[key] = val; 406 } 407 } 408 409 for (var i = 0, l = arguments.length; i < l; i++) { 410 forEach(arguments[i], assignValue); 411 } 412 return result; 413 } 414 415 /** 416 * Extends object a by mutably adding to it the properties of object b. 417 * 418 * @param {Object} a The object to be extended 419 * @param {Object} b The object to copy properties from 420 * @param {Object} thisArg The object to bind function to 421 * @return {Object} The resulting value of object a 422 */ 423 function extend(a, b, thisArg) { 424 forEach(b, function assignValue(val, key) { 425 if (thisArg && typeof val === 'function') { 426 a[key] = bind(val, thisArg); 427 } else { 428 a[key] = val; 429 } 430 }); 431 return a; 432 } 433 434 module.exports = { 435 isArray: isArray, 436 isArrayBuffer: isArrayBuffer, 437 isBuffer: isBuffer, 438 isFormData: isFormData, 439 isArrayBufferView: isArrayBufferView, 440 isString: isString, 441 isNumber: isNumber, 442 isObject: isObject, 443 isUndefined: isUndefined, 444 isDate: isDate, 445 isFile: isFile, 446 isBlob: isBlob, 447 isFunction: isFunction, 448 isStream: isStream, 449 isURLSearchParams: isURLSearchParams, 450 isStandardBrowserEnv: isStandardBrowserEnv, 451 forEach: forEach, 452 merge: merge, 453 deepMerge: deepMerge, 454 extend: extend, 455 trim: trim 456 }; 457 458 459/***/ }), 460/* 3 */ 461/***/ (function(module, exports) { 462 463 'use strict'; 464 465 module.exports = function bind(fn, thisArg) { 466 return function wrap() { 467 var args = new Array(arguments.length); 468 for (var i = 0; i < args.length; i++) { 469 args[i] = arguments[i]; 470 } 471 return fn.apply(thisArg, args); 472 }; 473 }; 474 475 476/***/ }), 477/* 4 */ 478/***/ (function(module, exports) { 479 480 /*! 481 * Determine if an object is a Buffer 482 * 483 * @author Feross Aboukhadijeh <https://feross.org> 484 * @license MIT 485 */ 486 487 module.exports = function isBuffer (obj) { 488 return obj != null && obj.constructor != null && 489 typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) 490 } 491 492 493/***/ }), 494/* 5 */ 495/***/ (function(module, exports, __webpack_require__) { 496 497 'use strict'; 498 499 var utils = __webpack_require__(2); 500 var buildURL = __webpack_require__(6); 501 var InterceptorManager = __webpack_require__(7); 502 var dispatchRequest = __webpack_require__(8); 503 var mergeConfig = __webpack_require__(22); 504 505 /** 506 * Create a new instance of Axios 507 * 508 * @param {Object} instanceConfig The default config for the instance 509 */ 510 function Axios(instanceConfig) { 511 this.defaults = instanceConfig; 512 this.interceptors = { 513 request: new InterceptorManager(), 514 response: new InterceptorManager() 515 }; 516 } 517 518 /** 519 * Dispatch a request 520 * 521 * @param {Object} config The config specific for this request (merged with this.defaults) 522 */ 523 Axios.prototype.request = function request(config) { 524 /*eslint no-param-reassign:0*/ 525 // Allow for axios('example/url'[, config]) a la fetch API 526 if (typeof config === 'string') { 527 config = arguments[1] || {}; 528 config.url = arguments[0]; 529 } else { 530 config = config || {}; 531 } 532 533 config = mergeConfig(this.defaults, config); 534 config.method = config.method ? config.method.toLowerCase() : 'get'; 535 536 // Hook up interceptors middleware 537 var chain = [dispatchRequest, undefined]; 538 var promise = Promise.resolve(config); 539 540 this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { 541 chain.unshift(interceptor.fulfilled, interceptor.rejected); 542 }); 543 544 this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { 545 chain.push(interceptor.fulfilled, interceptor.rejected); 546 }); 547 548 while (chain.length) { 549 promise = promise.then(chain.shift(), chain.shift()); 550 } 551 552 return promise; 553 }; 554 555 Axios.prototype.getUri = function getUri(config) { 556 config = mergeConfig(this.defaults, config); 557 return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); 558 }; 559 560 // Provide aliases for supported request methods 561 utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { 562 /*eslint func-names:0*/ 563 Axios.prototype[method] = function(url, config) { 564 return this.request(utils.merge(config || {}, { 565 method: method, 566 url: url 567 })); 568 }; 569 }); 570 571 utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { 572 /*eslint func-names:0*/ 573 Axios.prototype[method] = function(url, data, config) { 574 return this.request(utils.merge(config || {}, { 575 method: method, 576 url: url, 577 data: data 578 })); 579 }; 580 }); 581 582 module.exports = Axios; 583 584 585/***/ }), 586/* 6 */ 587/***/ (function(module, exports, __webpack_require__) { 588 589 'use strict'; 590 591 var utils = __webpack_require__(2); 592 593 function encode(val) { 594 return encodeURIComponent(val). 595 replace(/%40/gi, '@'). 596 replace(/%3A/gi, ':'). 597 replace(/%24/g, '$'). 598 replace(/%2C/gi, ','). 599 replace(/%20/g, '+'). 600 replace(/%5B/gi, '['). 601 replace(/%5D/gi, ']'); 602 } 603 604 /** 605 * Build a URL by appending params to the end 606 * 607 * @param {string} url The base of the url (e.g., http://www.google.com) 608 * @param {object} [params] The params to be appended 609 * @returns {string} The formatted url 610 */ 611 module.exports = function buildURL(url, params, paramsSerializer) { 612 /*eslint no-param-reassign:0*/ 613 if (!params) { 614 return url; 615 } 616 617 var serializedParams; 618 if (paramsSerializer) { 619 serializedParams = paramsSerializer(params); 620 } else if (utils.isURLSearchParams(params)) { 621 serializedParams = params.toString(); 622 } else { 623 var parts = []; 624
vendor: 5,047 bytes, lines 625-829
625 utils.forEach(params, function serialize(val, key) { 626 if (val === null || typeof val === 'undefined') { 627 return; 628 } 629 630 if (utils.isArray(val)) { 631 key = key + '[]'; 632 } else { 633 val = [val]; 634 } 635 636 utils.forEach(val, function parseValue(v) { 637 if (utils.isDate(v)) { 638 v = v.toISOString(); 639 } else if (utils.isObject(v)) { 640 v = JSON.stringify(v); 641 } 642 parts.push(encode(key) + '=' + encode(v)); 643 }); 644 }); 645 646 serializedParams = parts.join('&'); 647 } 648 649 if (serializedParams) { 650 var hashmarkIndex = url.indexOf('#'); 651 if (hashmarkIndex !== -1) { 652 url = url.slice(0, hashmarkIndex); 653 } 654 655 url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; 656 } 657 658 return url; 659 }; 660 661 662/***/ }), 663/* 7 */ 664/***/ (function(module, exports, __webpack_require__) { 665 666 'use strict'; 667 668 var utils = __webpack_require__(2); 669 670 function InterceptorManager() { 671 this.handlers = []; 672 } 673 674 /** 675 * Add a new interceptor to the stack 676 * 677 * @param {Function} fulfilled The function to handle `then` for a `Promise` 678 * @param {Function} rejected The function to handle `reject` for a `Promise` 679 * 680 * @return {Number} An ID used to remove interceptor later 681 */ 682 InterceptorManager.prototype.use = function use(fulfilled, rejected) { 683 this.handlers.push({ 684 fulfilled: fulfilled, 685 rejected: rejected 686 }); 687 return this.handlers.length - 1; 688 }; 689 690 /** 691 * Remove an interceptor from the stack 692 * 693 * @param {Number} id The ID that was returned by `use` 694 */ 695 InterceptorManager.prototype.eject = function eject(id) { 696 if (this.handlers[id]) { 697 this.handlers[id] = null; 698 } 699 }; 700 701 /** 702 * Iterate over all the registered interceptors 703 * 704 * This method is particularly useful for skipping over any 705 * interceptors that may have become `null` calling `eject`. 706 * 707 * @param {Function} fn The function to call for each interceptor 708 */ 709 InterceptorManager.prototype.forEach = function forEach(fn) { 710 utils.forEach(this.handlers, function forEachHandler(h) { 711 if (h !== null) { 712 fn(h); 713 } 714 }); 715 }; 716 717 module.exports = InterceptorManager; 718 719 720/***/ }), 721/* 8 */ 722/***/ (function(module, exports, __webpack_require__) { 723 724 'use strict'; 725 726 var utils = __webpack_require__(2); 727 var transformData = __webpack_require__(9); 728 var isCancel = __webpack_require__(10); 729 var defaults = __webpack_require__(11); 730 var isAbsoluteURL = __webpack_require__(20); 731 var combineURLs = __webpack_require__(21); 732 733 /** 734 * Throws a `Cancel` if cancellation has been requested. 735 */ 736 function throwIfCancellationRequested(config) { 737 if (config.cancelToken) { 738 config.cancelToken.throwIfRequested(); 739 } 740 } 741 742 /** 743 * Dispatch a request to the server using the configured adapter. 744 * 745 * @param {object} config The config that is to be used for the request 746 * @returns {Promise} The Promise to be fulfilled 747 */ 748 module.exports = function dispatchRequest(config) { 749 throwIfCancellationRequested(config); 750 751 // Support baseURL config 752 if (config.baseURL && !isAbsoluteURL(config.url)) { 753 config.url = combineURLs(config.baseURL, config.url); 754 } 755 756 // Ensure headers exist 757 config.headers = config.headers || {}; 758 759 // Transform request data 760 config.data = transformData( 761 config.data, 762 config.headers, 763 config.transformRequest 764 ); 765 766 // Flatten headers 767 config.headers = utils.merge( 768 config.headers.common || {}, 769 config.headers[config.method] || {}, 770 config.headers || {} 771 ); 772 773 utils.forEach( 774 ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], 775 function cleanHeaderConfig(method) { 776 delete config.headers[method]; 777 } 778 ); 779 780 var adapter = config.adapter || defaults.adapter; 781 782 return adapter(config).then(function onAdapterResolution(response) { 783 throwIfCancellationRequested(config); 784 785 // Transform response data 786 response.data = transformData( 787 response.data, 788 response.headers, 789 config.transformResponse 790 ); 791 792 return response; 793 }, function onAdapterRejection(reason) { 794 if (!isCancel(reason)) { 795 throwIfCancellationRequested(config); 796 797 // Transform response data 798 if (reason && reason.response) { 799 reason.response.data = transformData( 800 reason.response.data, 801 reason.response.headers, 802 config.transformResponse 803 ); 804 } 805 } 806 807 return Promise.reject(reason); 808 }); 809 }; 810 811 812/***/ }), 813/* 9 */ 814/***/ (function(module, exports, __webpack_require__) { 815 816 'use strict'; 817 818 var utils = __webpack_require__(2); 819 820 /** 821 * Transform the data for a request or a response 822 * 823 * @param {Object|String} data The data to be transformed 824 * @param {Array} headers The headers for the request or response 825 * @param {Array|Function} fns A single function or Array of functions 826 * @returns {*} The resulting transformed data 827 */ 828 module.exports = function transformData(data, headers, fns) { 829 /*eslint no-param-reassign:0*/
vendor: 21,971 bytes, lines 830-1619
830 utils.forEach(fns, function transform(fn) { 831 data = fn(data, headers); 832 }); 833 834 return data; 835 }; 836 837 838/***/ }), 839/* 10 */ 840/***/ (function(module, exports) { 841 842 'use strict'; 843 844 module.exports = function isCancel(value) { 845 return !!(value && value.__CANCEL__); 846 }; 847 848 849/***/ }), 850/* 11 */ 851/***/ (function(module, exports, __webpack_require__) { 852 853 'use strict'; 854 855 var utils = __webpack_require__(2); 856 var normalizeHeaderName = __webpack_require__(12); 857 858 var DEFAULT_CONTENT_TYPE = { 859 'Content-Type': 'application/x-www-form-urlencoded' 860 }; 861 862 function setContentTypeIfUnset(headers, value) { 863 if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { 864 headers['Content-Type'] = value; 865 } 866 } 867 868 function getDefaultAdapter() { 869 var adapter; 870 // Only Node.JS has a process variable that is of [[Class]] process 871 if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { 872 // For node use HTTP adapter 873 adapter = __webpack_require__(13); 874 } else if (typeof XMLHttpRequest !== 'undefined') { 875 // For browsers use XHR adapter 876 adapter = __webpack_require__(13); 877 } 878 return adapter; 879 } 880 881 var defaults = { 882 adapter: getDefaultAdapter(), 883 884 transformRequest: [function transformRequest(data, headers) { 885 normalizeHeaderName(headers, 'Accept'); 886 normalizeHeaderName(headers, 'Content-Type'); 887 if (utils.isFormData(data) || 888 utils.isArrayBuffer(data) || 889 utils.isBuffer(data) || 890 utils.isStream(data) || 891 utils.isFile(data) || 892 utils.isBlob(data) 893 ) { 894 return data; 895 } 896 if (utils.isArrayBufferView(data)) { 897 return data.buffer; 898 } 899 if (utils.isURLSearchParams(data)) { 900 setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); 901 return data.toString(); 902 } 903 if (utils.isObject(data)) { 904 setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); 905 return JSON.stringify(data); 906 } 907 return data; 908 }], 909 910 transformResponse: [function transformResponse(data) { 911 /*eslint no-param-reassign:0*/ 912 if (typeof data === 'string') { 913 try { 914 data = JSON.parse(data); 915 } catch (e) { /* Ignore */ } 916 } 917 return data; 918 }], 919 920 /** 921 * A timeout in milliseconds to abort a request. If set to 0 (default) a 922 * timeout is not created. 923 */ 924 timeout: 0, 925 926 xsrfCookieName: 'XSRF-TOKEN', 927 xsrfHeaderName: 'X-XSRF-TOKEN', 928 929 maxContentLength: -1, 930 931 validateStatus: function validateStatus(status) { 932 return status >= 200 && status < 300; 933 } 934 }; 935 936 defaults.headers = { 937 common: { 938 'Accept': 'application/json, text/plain, */*' 939 } 940 }; 941 942 utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { 943 defaults.headers[method] = {}; 944 }); 945 946 utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { 947 defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); 948 }); 949 950 module.exports = defaults; 951 952 953/***/ }), 954/* 12 */ 955/***/ (function(module, exports, __webpack_require__) { 956 957 'use strict'; 958 959 var utils = __webpack_require__(2); 960 961 module.exports = function normalizeHeaderName(headers, normalizedName) { 962 utils.forEach(headers, function processHeader(value, name) { 963 if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { 964 headers[normalizedName] = value; 965 delete headers[name]; 966 } 967 }); 968 }; 969 970 971/***/ }), 972/* 13 */ 973/***/ (function(module, exports, __webpack_require__) { 974 975 'use strict'; 976 977 var utils = __webpack_require__(2); 978 var settle = __webpack_require__(14); 979 var buildURL = __webpack_require__(6); 980 var parseHeaders = __webpack_require__(17); 981 var isURLSameOrigin = __webpack_require__(18); 982 var createError = __webpack_require__(15); 983 984 module.exports = function xhrAdapter(config) { 985 return new Promise(function dispatchXhrRequest(resolve, reject) { 986 var requestData = config.data; 987 var requestHeaders = config.headers; 988 989 if (utils.isFormData(requestData)) { 990 delete requestHeaders['Content-Type']; // Let the browser set it 991 } 992 993 var request = new XMLHttpRequest(); 994 995 // HTTP basic authentication 996 if (config.auth) { 997 var username = config.auth.username || ''; 998 var password = config.auth.password || ''; 999 requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); 1000 } 1001 1002 request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); 1003 1004 // Set the request timeout in MS 1005 request.timeout = config.timeout; 1006 1007 // Listen for ready state 1008 request.onreadystatechange = function handleLoad() { 1009 if (!request || request.readyState !== 4) { 1010 return; 1011 } 1012 1013 // The request errored out and we didn't get a response, this will be 1014 // handled by onerror instead 1015 // With one exception: request that using file: protocol, most browsers 1016 // will return status as 0 even though it's a successful request 1017 if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { 1018 return; 1019 } 1020 1021 // Prepare the response 1022 var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; 1023 var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; 1024 var response = { 1025 data: responseData, 1026 status: request.status, 1027 statusText: request.statusText, 1028 headers: responseHeaders, 1029 config: config, 1030 request: request 1031 }; 1032 1033 settle(resolve, reject, response); 1034 1035 // Clean up request 1036 request = null; 1037 }; 1038 1039 // Handle browser request cancellation (as opposed to a manual cancellation) 1040 request.onabort = function handleAbort() { 1041 if (!request) { 1042 return; 1043 } 1044 1045 reject(createError('Request aborted', config, 'ECONNABORTED', request)); 1046 1047 // Clean up request 1048 request = null; 1049 }; 1050 1051 // Handle low level network errors 1052 request.onerror = function handleError() { 1053 // Real errors are hidden from us by the browser 1054 // onerror should only fire if it's a network error 1055 reject(createError('Network Error', config, null, request)); 1056 1057 // Clean up request 1058 request = null; 1059 }; 1060 1061 // Handle timeout 1062 request.ontimeout = function handleTimeout() { 1063 reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', 1064 request)); 1065 1066 // Clean up request 1067 request = null; 1068 }; 1069 1070 // Add xsrf header 1071 // This is only done if running in a standard browser environment. 1072 // Specifically not if we're in a web worker, or react-native. 1073 if (utils.isStandardBrowserEnv()) { 1074 var cookies = __webpack_require__(19); 1075 1076 // Add xsrf header 1077 var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ? 1078 cookies.read(config.xsrfCookieName) : 1079 undefined; 1080 1081 if (xsrfValue) { 1082 requestHeaders[config.xsrfHeaderName] = xsrfValue; 1083 } 1084 } 1085 1086 // Add headers to the request 1087 if ('setRequestHeader' in request) { 1088 utils.forEach(requestHeaders, function setRequestHeader(val, key) { 1089 if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { 1090 // Remove Content-Type if data is undefined 1091 delete requestHeaders[key]; 1092 } else { 1093 // Otherwise add header to the request 1094 request.setRequestHeader(key, val); 1095 } 1096 }); 1097 } 1098 1099 // Add withCredentials to request if needed 1100 if (config.withCredentials) { 1101 request.withCredentials = true; 1102 } 1103 1104 // Add responseType to request if needed 1105 if (config.responseType) { 1106 try { 1107 request.responseType = config.responseType; 1108 } catch (e) { 1109 // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. 1110 // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. 1111 if (config.responseType !== 'json') { 1112 throw e; 1113 } 1114 } 1115 } 1116 1117 // Handle progress if needed 1118 if (typeof config.onDownloadProgress === 'function') { 1119 request.addEventListener('progress', config.onDownloadProgress); 1120 } 1121 1122 // Not all browsers support upload events 1123 if (typeof config.onUploadProgress === 'function' && request.upload) { 1124 request.upload.addEventListener('progress', config.onUploadProgress); 1125 } 1126 1127 if (config.cancelToken) { 1128 // Handle cancellation 1129 config.cancelToken.promise.then(function onCanceled(cancel) { 1130 if (!request) { 1131 return; 1132 } 1133 1134 request.abort(); 1135 reject(cancel); 1136 // Clean up request 1137 request = null; 1138 }); 1139 } 1140 1141 if (requestData === undefined) { 1142 requestData = null; 1143 } 1144 1145 // Send the request 1146 request.send(requestData); 1147 }); 1148 }; 1149 1150 1151/***/ }), 1152/* 14 */ 1153/***/ (function(module, exports, __webpack_require__) { 1154 1155 'use strict'; 1156 1157 var createError = __webpack_require__(15); 1158 1159 /** 1160 * Resolve or reject a Promise based on response status. 1161 * 1162 * @param {Function} resolve A function that resolves the promise. 1163 * @param {Function} reject A function that rejects the promise. 1164 * @param {object} response The response. 1165 */ 1166 module.exports = function settle(resolve, reject, response) { 1167 var validateStatus = response.config.validateStatus; 1168 if (!validateStatus || validateStatus(response.status)) { 1169 resolve(response); 1170 } else { 1171 reject(createError( 1172 'Request failed with status code ' + response.status, 1173 response.config, 1174 null, 1175 response.request, 1176 response 1177 )); 1178 } 1179 }; 1180 1181 1182/***/ }), 1183/* 15 */ 1184/***/ (function(module, exports, __webpack_require__) { 1185 1186 'use strict'; 1187 1188 var enhanceError = __webpack_require__(16); 1189 1190 /** 1191 * Create an Error with the specified message, config, error code, request and response. 1192 * 1193 * @param {string} message The error message. 1194 * @param {Object} config The config. 1195 * @param {string} [code] The error code (for example, 'ECONNABORTED'). 1196 * @param {Object} [request] The request. 1197 * @param {Object} [response] The response. 1198 * @returns {Error} The created error. 1199 */ 1200 module.exports = function createError(message, config, code, request, response) { 1201 var error = new Error(message); 1202 return enhanceError(error, config, code, request, response); 1203 }; 1204 1205 1206/***/ }), 1207/* 16 */ 1208/***/ (function(module, exports) { 1209 1210 'use strict'; 1211 1212 /** 1213 * Update an Error with the specified config, error code, and response. 1214 * 1215 * @param {Error} error The error to update. 1216 * @param {Object} config The config. 1217 * @param {string} [code] The error code (for example, 'ECONNABORTED'). 1218 * @param {Object} [request] The request. 1219 * @param {Object} [response] The response. 1220 * @returns {Error} The error. 1221 */ 1222 module.exports = function enhanceError(error, config, code, request, response) { 1223 error.config = config; 1224 if (code) { 1225 error.code = code; 1226 } 1227 1228 error.request = request; 1229 error.response = response; 1230 error.isAxiosError = true; 1231 1232 error.toJSON = function() { 1233 return { 1234 // Standard 1235 message: this.message, 1236 name: this.name, 1237 // Microsoft 1238 description: this.description, 1239 number: this.number, 1240 // Mozilla 1241 fileName: this.fileName, 1242 lineNumber: this.lineNumber, 1243 columnNumber: this.columnNumber, 1244 stack: this.stack, 1245 // Axios 1246 config: this.config, 1247 code: this.code 1248 }; 1249 }; 1250 return error; 1251 }; 1252 1253 1254/***/ }), 1255/* 17 */ 1256/***/ (function(module, exports, __webpack_require__) { 1257 1258 'use strict'; 1259 1260 var utils = __webpack_require__(2); 1261 1262 // Headers whose duplicates are ignored by node 1263 // c.f. https://nodejs.org/api/http.html#http_message_headers 1264 var ignoreDuplicateOf = [ 1265 'age', 'authorization', 'content-length', 'content-type', 'etag', 1266 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 1267 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 1268 'referer', 'retry-after', 'user-agent' 1269 ]; 1270 1271 /** 1272 * Parse headers into an object 1273 * 1274 * ``` 1275 * Date: Wed, 27 Aug 2014 08:58:49 GMT 1276 * Content-Type: application/json 1277 * Connection: keep-alive 1278 * Transfer-Encoding: chunked 1279 * ``` 1280 * 1281 * @param {String} headers Headers needing to be parsed 1282 * @returns {Object} Headers parsed into an object 1283 */ 1284 module.exports = function parseHeaders(headers) { 1285 var parsed = {}; 1286 var key; 1287 var val; 1288 var i; 1289 1290 if (!headers) { return parsed; } 1291 1292 utils.forEach(headers.split('\n'), function parser(line) { 1293 i = line.indexOf(':'); 1294 key = utils.trim(line.substr(0, i)).toLowerCase(); 1295 val = utils.trim(line.substr(i + 1)); 1296 1297 if (key) { 1298 if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { 1299 return; 1300 } 1301 if (key === 'set-cookie') { 1302 parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); 1303 } else { 1304 parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; 1305 } 1306 } 1307 }); 1308 1309 return parsed; 1310 }; 1311 1312 1313/***/ }), 1314/* 18 */ 1315/***/ (function(module, exports, __webpack_require__) { 1316 1317 'use strict'; 1318 1319 var utils = __webpack_require__(2); 1320 1321 module.exports = ( 1322 utils.isStandardBrowserEnv() ? 1323 1324 // Standard browser envs have full support of the APIs needed to test 1325 // whether the request URL is of the same origin as current location. 1326 (function standardBrowserEnv() { 1327 var msie = /(msie|trident)/i.test(navigator.userAgent); 1328 var urlParsingNode = document.createElement('a'); 1329 var originURL; 1330 1331 /** 1332 * Parse a URL to discover it's components 1333 * 1334 * @param {String} url The URL to be parsed 1335 * @returns {Object} 1336 */ 1337 function resolveURL(url) { 1338 var href = url; 1339 1340 if (msie) { 1341 // IE needs attribute set twice to normalize properties 1342 urlParsingNode.setAttribute('href', href); 1343 href = urlParsingNode.href; 1344 } 1345 1346 urlParsingNode.setAttribute('href', href); 1347 1348 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils 1349 return { 1350 href: urlParsingNode.href, 1351 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', 1352 host: urlParsingNode.host, 1353 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', 1354 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', 1355 hostname: urlParsingNode.hostname, 1356 port: urlParsingNode.port, 1357 pathname: (urlParsingNode.pathname.charAt(0) === '/') ? 1358 urlParsingNode.pathname : 1359 '/' + urlParsingNode.pathname 1360 }; 1361 } 1362 1363 originURL = resolveURL(window.location.href); 1364 1365 /** 1366 * Determine if a URL shares the same origin as the current location 1367 * 1368 * @param {String} requestURL The URL to test 1369 * @returns {boolean} True if URL shares the same origin, otherwise false 1370 */ 1371 return function isURLSameOrigin(requestURL) { 1372 var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; 1373 return (parsed.protocol === originURL.protocol && 1374 parsed.host === originURL.host); 1375 }; 1376 })() : 1377 1378 // Non standard browser envs (web workers, react-native) lack needed support. 1379 (function nonStandardBrowserEnv() { 1380 return function isURLSameOrigin() { 1381 return true; 1382 }; 1383 })() 1384 ); 1385 1386 1387/***/ }), 1388/* 19 */ 1389/***/ (function(module, exports, __webpack_require__) { 1390 1391 'use strict'; 1392 1393 var utils = __webpack_require__(2); 1394 1395 module.exports = ( 1396 utils.isStandardBrowserEnv() ? 1397 1398 // Standard browser envs support document.cookie 1399 (function standardBrowserEnv() { 1400 return { 1401 write: function write(name, value, expires, path, domain, secure) { 1402 var cookie = []; 1403 cookie.push(name + '=' + encodeURIComponent(value)); 1404 1405 if (utils.isNumber(expires)) { 1406 cookie.push('expires=' + new Date(expires).toGMTString()); 1407 } 1408 1409 if (utils.isString(path)) { 1410 cookie.push('path=' + path); 1411 } 1412 1413 if (utils.isString(domain)) { 1414 cookie.push('domain=' + domain); 1415 } 1416 1417 if (secure === true) { 1418 cookie.push('secure'); 1419 } 1420 1421 document.cookie = cookie.join('; '); 1422 }, 1423 1424 read: function read(name) { 1425 var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); 1426 return (match ? decodeURIComponent(match[3]) : null); 1427 }, 1428 1429 remove: function remove(name) { 1430 this.write(name, '', Date.now() - 86400000); 1431 } 1432 }; 1433 })() : 1434 1435 // Non standard browser env (web workers, react-native) lack needed support. 1436 (function nonStandardBrowserEnv() { 1437 return { 1438 write: function write() {}, 1439 read: function read() { return null; }, 1440 remove: function remove() {} 1441 }; 1442 })() 1443 ); 1444 1445 1446/***/ }), 1447/* 20 */ 1448/***/ (function(module, exports) { 1449 1450 'use strict'; 1451 1452 /** 1453 * Determines whether the specified URL is absolute 1454 * 1455 * @param {string} url The URL to test 1456 * @returns {boolean} True if the specified URL is absolute, otherwise false 1457 */ 1458 module.exports = function isAbsoluteURL(url) { 1459 // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). 1460 // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed 1461 // by any combination of letters, digits, plus, period, or hyphen. 1462 return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); 1463 }; 1464 1465 1466/***/ }), 1467/* 21 */ 1468/***/ (function(module, exports) { 1469 1470 'use strict'; 1471 1472 /** 1473 * Creates a new URL by combining the specified URLs 1474 * 1475 * @param {string} baseURL The base URL 1476 * @param {string} relativeURL The relative URL 1477 * @returns {string} The combined URL 1478 */ 1479 module.exports = function combineURLs(baseURL, relativeURL) { 1480 return relativeURL 1481 ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') 1482 : baseURL; 1483 }; 1484 1485 1486/***/ }), 1487/* 22 */ 1488/***/ (function(module, exports, __webpack_require__) { 1489 1490 'use strict'; 1491 1492 var utils = __webpack_require__(2); 1493 1494 /** 1495 * Config-specific merge-function which creates a new config-object 1496 * by merging two configuration objects together. 1497 * 1498 * @param {Object} config1 1499 * @param {Object} config2 1500 * @returns {Object} New object resulting from merging config2 to config1 1501 */ 1502 module.exports = function mergeConfig(config1, config2) { 1503 // eslint-disable-next-line no-param-reassign 1504 config2 = config2 || {}; 1505 var config = {}; 1506 1507 utils.forEach(['url', 'method', 'params', 'data'], function valueFromConfig2(prop) { 1508 if (typeof config2[prop] !== 'undefined') { 1509 config[prop] = config2[prop]; 1510 } 1511 }); 1512 1513 utils.forEach(['headers', 'auth', 'proxy'], function mergeDeepProperties(prop) { 1514 if (utils.isObject(config2[prop])) { 1515 config[prop] = utils.deepMerge(config1[prop], config2[prop]); 1516 } else if (typeof config2[prop] !== 'undefined') { 1517 config[prop] = config2[prop]; 1518 } else if (utils.isObject(config1[prop])) { 1519 config[prop] = utils.deepMerge(config1[prop]); 1520 } else if (typeof config1[prop] !== 'undefined') { 1521 config[prop] = config1[prop]; 1522 } 1523 }); 1524 1525 utils.forEach([ 1526 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', 1527 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', 1528 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength', 1529 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken', 1530 'socketPath' 1531 ], function defaultToConfig2(prop) { 1532 if (typeof config2[prop] !== 'undefined') { 1533 config[prop] = config2[prop]; 1534 } else if (typeof config1[prop] !== 'undefined') { 1535 config[prop] = config1[prop]; 1536 } 1537 }); 1538 1539 return config; 1540 }; 1541 1542 1543/***/ }), 1544/* 23 */ 1545/***/ (function(module, exports) { 1546 1547 'use strict'; 1548 1549 /** 1550 * A `Cancel` is an object that is thrown when an operation is canceled. 1551 * 1552 * @class 1553 * @param {string=} message The message. 1554 */ 1555 function Cancel(message) { 1556 this.message = message; 1557 } 1558 1559 Cancel.prototype.toString = function toString() { 1560 return 'Cancel' + (this.message ? ': ' + this.message : ''); 1561 }; 1562 1563 Cancel.prototype.__CANCEL__ = true; 1564 1565 module.exports = Cancel; 1566 1567 1568/***/ }), 1569/* 24 */ 1570/***/ (function(module, exports, __webpack_require__) { 1571 1572 'use strict'; 1573 1574 var Cancel = __webpack_require__(23); 1575 1576 /** 1577 * A `CancelToken` is an object that can be used to request cancellation of an operation. 1578 * 1579 * @class 1580 * @param {Function} executor The executor function. 1581 */ 1582 function CancelToken(executor) { 1583 if (typeof executor !== 'function') { 1584 throw new TypeError('executor must be a function.'); 1585 } 1586 1587 var resolvePromise; 1588 this.promise = new Promise(function promiseExecutor(resolve) { 1589 resolvePromise = resolve; 1590 }); 1591 1592 var token = this; 1593 executor(function cancel(message) { 1594 if (token.reason) { 1595 // Cancellation has already been requested 1596 return; 1597 } 1598 1599 token.reason = new Cancel(message); 1600 resolvePromise(token.reason); 1601 }); 1602 } 1603 1604 /** 1605 * Throws a `Cancel` if cancellation has been requested. 1606 */ 1607 CancelToken.prototype.throwIfRequested = function throwIfRequested() { 1608 if (this.reason) { 1609 throw this.reason; 1610 } 1611 }; 1612 1613 /** 1614 * Returns an object that contains a new `CancelToken` and a function that, when called, 1615 * cancels the `CancelToken`. 1616 */ 1617 CancelToken.source = function source() { 1618 var cancel; 1619 var token = new CancelToken(function executor(c) {
1620 cancel = c; 1621 }); 1622 return { 1623 token: token, 1624 cancel: cancel 1625 }; 1626 }; 1627 1628 module.exports = CancelToken; 1629 1630 1631/***/ }), 1632/* 25 */ 1633/***/ (function(module, exports) { 1634 1635 'use strict'; 1636 1637 /** 1638 * Syntactic sugar for invoking a function and expanding an array for arguments. 1639 * 1640 * Common use case would be to use `Function.prototype.apply`. 1641 * 1642 * ```js 1643 * function f(x, y, z) {} 1644 * var args = [1, 2, 3]; 1645 * f.apply(null, args); 1646 * ``` 1647 * 1648 * With `spread` this example can be re-written. 1649 * 1650 * ```js 1651 * spread(function(x, y, z) {})([1, 2, 3]); 1652 * ``` 1653 * 1654 * @param {Function} callback 1655 * @returns {Function} 1656 */ 1657 module.exports = function spread(callback) { 1658 return function wrap(arr) { 1659 return callback.apply(null, arr); 1660 }; 1661 }; 1662 1663 1664/***/ }) 1665/******/ ]) 1666}); 1667;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.