diff --git a/.eslintrc b/.eslintrc index bf55c16..18a6732 100644 --- a/.eslintrc +++ b/.eslintrc @@ -9,6 +9,141 @@ "node": true }, "rules": { - "quotes": [2, "single"] +/** + * Strict mode + */ + "strict": [2, "global"], // http://eslint.org/docs/rules/strict + +/** + * Variables + */ + "no-shadow": 2, // http://eslint.org/docs/rules/no-shadow + "no-shadow-restricted-names": 2, // http://eslint.org/docs/rules/no-shadow-restricted-names + "no-unused-vars": [2, { // http://eslint.org/docs/rules/no-unused-vars + "vars": "local", + "args": "after-used" + }], + "no-use-before-define": 2, // http://eslint.org/docs/rules/no-use-before-define + +/** + * Possible errors + */ + "comma-dangle": [2, "never"], // http://eslint.org/docs/rules/comma-dangle + "no-cond-assign": [2, "except-parens"], // http://eslint.org/docs/rules/no-cond-assign + "no-console": 1, // http://eslint.org/docs/rules/no-console + "no-debugger": 1, // http://eslint.org/docs/rules/no-debugger + "no-alert": 1, // http://eslint.org/docs/rules/no-alert + "no-constant-condition": 1, // http://eslint.org/docs/rules/no-constant-condition + "no-dupe-keys": 2, // http://eslint.org/docs/rules/no-dupe-keys + "no-duplicate-case": 2, // http://eslint.org/docs/rules/no-duplicate-case + "no-empty": 2, // http://eslint.org/docs/rules/no-empty + "no-ex-assign": 2, // http://eslint.org/docs/rules/no-ex-assign + "no-extra-boolean-cast": 0, // http://eslint.org/docs/rules/no-extra-boolean-cast + "no-extra-semi": 2, // http://eslint.org/docs/rules/no-extra-semi + "no-func-assign": 2, // http://eslint.org/docs/rules/no-func-assign + "no-inner-declarations": 2, // http://eslint.org/docs/rules/no-inner-declarations + "no-invalid-regexp": 2, // http://eslint.org/docs/rules/no-invalid-regexp + "no-irregular-whitespace": 2, // http://eslint.org/docs/rules/no-irregular-whitespace + "no-obj-calls": 2, // http://eslint.org/docs/rules/no-obj-calls + "no-sparse-arrays": 2, // http://eslint.org/docs/rules/no-sparse-arrays + "no-unreachable": 2, // http://eslint.org/docs/rules/no-unreachable + "use-isnan": 2, // http://eslint.org/docs/rules/use-isnan + "block-scoped-var": 2, // http://eslint.org/docs/rules/block-scoped-var + +/** + * Best practices + */ + "consistent-return": 2, // http://eslint.org/docs/rules/consistent-return + "curly": [2, "multi-line"], // http://eslint.org/docs/rules/curly + "default-case": 2, // http://eslint.org/docs/rules/default-case + "dot-notation": [2, { // http://eslint.org/docs/rules/dot-notation + "allowKeywords": true + }], + "eqeqeq": 2, // http://eslint.org/docs/rules/eqeqeq + "guard-for-in": 2, // http://eslint.org/docs/rules/guard-for-in + "no-caller": 2, // http://eslint.org/docs/rules/no-caller + "no-else-return": 2, // http://eslint.org/docs/rules/no-else-return + "no-eq-null": 2, // http://eslint.org/docs/rules/no-eq-null + "no-eval": 2, // http://eslint.org/docs/rules/no-eval + "no-extend-native": 2, // http://eslint.org/docs/rules/no-extend-native + "no-extra-bind": 2, // http://eslint.org/docs/rules/no-extra-bind + "no-fallthrough": 2, // http://eslint.org/docs/rules/no-fallthrough + "no-floating-decimal": 2, // http://eslint.org/docs/rules/no-floating-decimal + "no-implied-eval": 2, // http://eslint.org/docs/rules/no-implied-eval + "no-lone-blocks": 2, // http://eslint.org/docs/rules/no-lone-blocks + "no-loop-func": 2, // http://eslint.org/docs/rules/no-loop-func + "no-multi-str": 2, // http://eslint.org/docs/rules/no-multi-str + "no-native-reassign": 2, // http://eslint.org/docs/rules/no-native-reassign + "no-new": 2, // http://eslint.org/docs/rules/no-new + "no-new-func": 2, // http://eslint.org/docs/rules/no-new-func + "no-new-wrappers": 2, // http://eslint.org/docs/rules/no-new-wrappers + "no-octal": 2, // http://eslint.org/docs/rules/no-octal + "no-octal-escape": 2, // http://eslint.org/docs/rules/no-octal-escape + "no-param-reassign": 2, // http://eslint.org/docs/rules/no-param-reassign + "no-proto": 2, // http://eslint.org/docs/rules/no-proto + "no-redeclare": 2, // http://eslint.org/docs/rules/no-redeclare + "no-return-assign": 2, // http://eslint.org/docs/rules/no-return-assign + "no-script-url": 2, // http://eslint.org/docs/rules/no-script-url + "no-self-compare": 2, // http://eslint.org/docs/rules/no-self-compare + "no-sequences": 2, // http://eslint.org/docs/rules/no-sequences + "no-throw-literal": 2, // http://eslint.org/docs/rules/no-throw-literal + "no-with": 2, // http://eslint.org/docs/rules/no-with + "radix": 2, // http://eslint.org/docs/rules/radix + "vars-on-top": 0, // http://eslint.org/docs/rules/vars-on-top + "wrap-iife": [2, "any"], // http://eslint.org/docs/rules/wrap-iife + "yoda": 2, // http://eslint.org/docs/rules/yoda + +/** + * Style + */ + "indent": [2, 2], // http://eslint.org/docs/rules/indent + "brace-style": [2, // http://eslint.org/docs/rules/brace-style + "1tbs", { + "allowSingleLine": true + }], + "quotes": [ + 2, "single", "avoid-escape" // http://eslint.org/docs/rules/quotes + ], + "camelcase": [2, { // http://eslint.org/docs/rules/camelcase + "properties": "never" + }], + "comma-spacing": [2, { // http://eslint.org/docs/rules/comma-spacing + "before": false, + "after": true + }], + "comma-style": [2, "last"], // http://eslint.org/docs/rules/comma-style + "eol-last": 2, // http://eslint.org/docs/rules/eol-last + "func-names": 1, // http://eslint.org/docs/rules/func-names + "key-spacing": [2, { // http://eslint.org/docs/rules/key-spacing + "beforeColon": false, + "afterColon": true + }], + "new-cap": [2, { // http://eslint.org/docs/rules/new-cap + "newIsCap": true + }], + "no-multiple-empty-lines": [2, { // http://eslint.org/docs/rules/no-multiple-empty-lines + "max": 2 + }], + "no-nested-ternary": 2, // http://eslint.org/docs/rules/no-nested-ternary + "no-new-object": 2, // http://eslint.org/docs/rules/no-new-object + "no-spaced-func": 2, // http://eslint.org/docs/rules/no-spaced-func + "no-trailing-spaces": 2, // http://eslint.org/docs/rules/no-trailing-spaces + "no-extra-parens": [2, "functions"], // http://eslint.org/docs/rules/no-extra-parens + "no-underscore-dangle": 0, // http://eslint.org/docs/rules/no-underscore-dangle + "one-var": [2, "never"], // http://eslint.org/docs/rules/one-var + "padded-blocks": [2, "never"], // http://eslint.org/docs/rules/padded-blocks + "semi": [2, "always"], // http://eslint.org/docs/rules/semi + "semi-spacing": [2, { // http://eslint.org/docs/rules/semi-spacing + "before": false, + "after": true + }], + "space-after-keywords": 2, // http://eslint.org/docs/rules/space-after-keywords + "space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks + "space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren + "space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops + "space-return-throw-case": 2, // http://eslint.org/docs/rules/space-return-throw-case + "spaced-comment": [2, "always", {// http://eslint.org/docs/rules/spaced-comment + "markers": ["global", "eslint"] + }] } } diff --git a/.travis.yml b/.travis.yml index 8b8a8b9..f971875 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,5 @@ language: node_js email: on_failure: change on_success: never -before_script: - - npm install -g grunt-cli after_success: - npm run coveralls diff --git a/CHANGELOG.md b/CHANGELOG.md index 967de71..b84e6ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,73 +1,32 @@ # Changelog -### 0.1.0 (Aug 29, 2014) +### 0.8.1 (Dec 14, 2015) -- Initial release +- Adding support for passing XSRF token for cross domain requests when using `withCredentials` ([#168](https://github.com/mzabriskie/axios/pull/168)) +- Fixing error with format of basic auth header ([#178](https://github.com/mzabriskie/axios/pull/173)) +- Fixing error with JSON payloads throwing `InvalidStateError` in some cases ([#174](https://github.com/mzabriskie/axios/pull/174)) -### 0.2.0 (Sep 12, 2014) +### 0.8.0 (Dec 11, 2015) -- Adding support for `all` and `spread` -- Adding support for node.js ([#1](https://github.com/mzabriskie/axios/issues/1)) +- Adding support for creating instances of axios ([#123](https://github.com/mzabriskie/axios/pull/123)) +- Fixing http adapter to use `Buffer` instead of `String` in case of `responseType === 'arraybuffer'` ([#128](https://github.com/mzabriskie/axios/pull/128)) +- Adding support for using custom parameter serializer with `paramsSerializer` option ([#121](https://github.com/mzabriskie/axios/pull/121)) +- Fixing issue in IE8 caused by `forEach` on `arguments` ([#127](https://github.com/mzabriskie/axios/pull/127)) +- Adding support for following redirects in node ([#146](https://github.com/mzabriskie/axios/pull/146)) +- Adding support for transparent decompression if `content-encoding` is set ([#149](https://github.com/mzabriskie/axios/pull/149)) +- Adding support for transparent XDomainRequest to handle cross domain requests in IE9 ([#140](https://github.com/mzabriskie/axios/pull/140)) +- Adding support for HTTP basic auth via Authorization header ([#167](https://github.com/mzabriskie/axios/pull/167)) +- Adding support for baseURL option ([#160](https://github.com/mzabriskie/axios/pull/160)) -### 0.2.1 (Sep 12, 2014) +### 0.7.0 (Sep 29, 2015) -- Fixing build problem causing ridiculous file sizes - -### 0.2.2 (Sep 14, 2014) - -- Fixing bundling with browserify ([#4](https://github.com/mzabriskie/axios/issues/4)) - -### 0.3.0 (Sep 16, 2014) - -- Fixing `success` and `error` to properly receive response data as individual arguments ([#8](https://github.com/mzabriskie/axios/issues/8)) -- Updating `then` and `catch` to receive response data as a single object ([#6](https://github.com/mzabriskie/axios/issues/6)) -- Fixing issue with `all` not working ([#7](https://github.com/mzabriskie/axios/issues/7)) - -### 0.3.1 (Sep 16, 2014) - -- Fixing missing post body when using node.js ([#3](https://github.com/mzabriskie/axios/issues/3)) - -### 0.4.0 (Oct 03, 2014) - -- Adding support for `ArrayBuffer` and `ArrayBufferView` ([#10](https://github.com/mzabriskie/axios/issues/10)) -- Adding support for utf-8 for node.js ([#13](https://github.com/mzabriskie/axios/issues/13)) -- Adding support for SSL for node.js ([#12](https://github.com/mzabriskie/axios/issues/12)) -- Fixing incorrect `Content-Type` header ([#9](https://github.com/mzabriskie/axios/issues/9)) -- Adding standalone build without bundled es6-promise ([#11](https://github.com/mzabriskie/axios/issues/11)) -- Deprecating `success`/`error` in favor of `then`/`catch` - -### 0.4.1 (Oct 15, 2014) - -- Adding error handling to request for node.js ([#18](https://github.com/mzabriskie/axios/issues/18)) - -### 0.4.2 (Dec 10, 2014) - -- Fixing issue with `Content-Type` when using `FormData` ([#22](https://github.com/mzabriskie/axios/issues/22)) -- Adding support for TypeScript ([#25](https://github.com/mzabriskie/axios/issues/25)) -- Fixing issue with standalone build ([#29](https://github.com/mzabriskie/axios/issues/29)) -- Fixing issue with verbs needing to be capitalized in some browsers ([#30](https://github.com/mzabriskie/axios/issues/30)) - -### 0.5.0 (Jan 23, 2015) - -- Adding support for intercepetors ([#14](https://github.com/mzabriskie/axios/issues/14)) -- Updating es6-promise dependency - -### 0.5.1 (Mar 10, 2015) - -- Fixing issue using strict mode ([#45](https://github.com/mzabriskie/axios/issues/45)) -- Fixing issue with standalone build ([#47](https://github.com/mzabriskie/axios/issues/47)) - -### 0.5.2 (Mar 13, 2015) - -- Adding support for `statusText` in response ([#46](https://github.com/mzabriskie/axios/issues/46)) - -### 0.5.3 (Apr 07, 2015) - -- Using JSON.parse unconditionally when transforming response string ([#55](https://github.com/mzabriskie/axios/issues/55)) - -### 0.5.4 (Apr 08, 2015) - -- Fixing issue with FormData not being sent ([#53](https://github.com/mzabriskie/axios/issues/53)) +- Fixing issue with minified bundle in IE8 ([#87](https://github.com/mzabriskie/axios/pull/87)) +- Adding support for passing agent in node ([#102](https://github.com/mzabriskie/axios/pull/102)) +- Adding support for returning result from `axios.spread` for chaining ([#106](https://github.com/mzabriskie/axios/pull/106)) +- Fixing typescript definition ([#105](https://github.com/mzabriskie/axios/pull/105)) +- Fixing default timeout config for node ([#112](https://github.com/mzabriskie/axios/pull/112)) +- Adding support for use in web workers, and react-native ([#70](https://github.com/mzabriskie/axios/issue/70)), ([#98](https://github.com/mzabriskie/axios/pull/98)) +- Adding support for fetch like API `axios(url[, config])` ([#116](https://github.com/mzabriskie/axios/issues/116)) ### 0.6.0 (Sep 21, 2015) @@ -80,12 +39,71 @@ - Fixing issue with IE8 ([#85](https://github.com/mzabriskie/axios/pull/85)) - Converting build to UMD -### 0.7.0 (Sep 29, 2015) +### 0.5.4 (Apr 08, 2015) -- Fixing issue with minified bundle in IE8 ([#87](https://github.com/mzabriskie/axios/pull/87)) -- Adding support for passing agent in node ([#102](https://github.com/mzabriskie/axios/pull/102)) -- Adding support for returning result from `axios.spread` for chaining ([#106](https://github.com/mzabriskie/axios/pull/106)) -- Fixing typescript definition ([#105](https://github.com/mzabriskie/axios/pull/105)) -- Fixing default timeout config for node ([#112](https://github.com/mzabriskie/axios/pull/112)) -- Adding support for use in web workers, and react-native ([#70](https://github.com/mzabriskie/axios/issue/70)), ([#98](https://github.com/mzabriskie/axios/pull/98)) -- Adding support for fetch like API `axios(url[, config])` ([#116](https://github.com/mzabriskie/axios/issues/116)) +- Fixing issue with FormData not being sent ([#53](https://github.com/mzabriskie/axios/issues/53)) + +### 0.5.3 (Apr 07, 2015) + +- Using JSON.parse unconditionally when transforming response string ([#55](https://github.com/mzabriskie/axios/issues/55)) + +### 0.5.2 (Mar 13, 2015) + +- Adding support for `statusText` in response ([#46](https://github.com/mzabriskie/axios/issues/46)) + +### 0.5.1 (Mar 10, 2015) + +- Fixing issue using strict mode ([#45](https://github.com/mzabriskie/axios/issues/45)) +- Fixing issue with standalone build ([#47](https://github.com/mzabriskie/axios/issues/47)) + +### 0.5.0 (Jan 23, 2015) + +- Adding support for intercepetors ([#14](https://github.com/mzabriskie/axios/issues/14)) +- Updating es6-promise dependency + +### 0.4.2 (Dec 10, 2014) + +- Fixing issue with `Content-Type` when using `FormData` ([#22](https://github.com/mzabriskie/axios/issues/22)) +- Adding support for TypeScript ([#25](https://github.com/mzabriskie/axios/issues/25)) +- Fixing issue with standalone build ([#29](https://github.com/mzabriskie/axios/issues/29)) +- Fixing issue with verbs needing to be capitalized in some browsers ([#30](https://github.com/mzabriskie/axios/issues/30)) + +### 0.4.1 (Oct 15, 2014) + +- Adding error handling to request for node.js ([#18](https://github.com/mzabriskie/axios/issues/18)) + +### 0.4.0 (Oct 03, 2014) + +- Adding support for `ArrayBuffer` and `ArrayBufferView` ([#10](https://github.com/mzabriskie/axios/issues/10)) +- Adding support for utf-8 for node.js ([#13](https://github.com/mzabriskie/axios/issues/13)) +- Adding support for SSL for node.js ([#12](https://github.com/mzabriskie/axios/issues/12)) +- Fixing incorrect `Content-Type` header ([#9](https://github.com/mzabriskie/axios/issues/9)) +- Adding standalone build without bundled es6-promise ([#11](https://github.com/mzabriskie/axios/issues/11)) +- Deprecating `success`/`error` in favor of `then`/`catch` + +### 0.3.1 (Sep 16, 2014) + +- Fixing missing post body when using node.js ([#3](https://github.com/mzabriskie/axios/issues/3)) + +### 0.3.0 (Sep 16, 2014) + +- Fixing `success` and `error` to properly receive response data as individual arguments ([#8](https://github.com/mzabriskie/axios/issues/8)) +- Updating `then` and `catch` to receive response data as a single object ([#6](https://github.com/mzabriskie/axios/issues/6)) +- Fixing issue with `all` not working ([#7](https://github.com/mzabriskie/axios/issues/7)) + +### 0.2.2 (Sep 14, 2014) + +- Fixing bundling with browserify ([#4](https://github.com/mzabriskie/axios/issues/4)) + +### 0.2.1 (Sep 12, 2014) + +- Fixing build problem causing ridiculous file sizes + +### 0.2.0 (Sep 12, 2014) + +- Adding support for `all` and `spread` +- Adding support for node.js ([#1](https://github.com/mzabriskie/axios/issues/1)) + +### 0.1.0 (Aug 29, 2014) + +- Initial release diff --git a/README.md b/README.md index 72311f2..0a50e1e 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ axios.get('/user?ID=12345') .catch(function (response) { console.log(response); }); - + // Optionally the request above could also be done as axios.get('/user', { params: { @@ -132,14 +132,45 @@ Helper functions for dealing with concurrent requests. ##### axios.all(iterable) ##### axios.spread(callback) +### Creating an instance + +You can create a new instance of axios with a custom config. + +##### axios.create([config]) + +```js +var instance = axios.create({ + baseURL: 'https://some-domain.com/api/', + timeout: 1000, + headers: {'X-Custom-Header': 'foobar'} +}); +``` + +### Instance methods + +The available instance methods are listed below. The specified config will be merged with the instance config. + +##### axios#request(config) +##### axios#get(url[, config]) +##### axios#delete(url[, config]) +##### axios#head(url[, config]) +##### axios#post(url[, data[, config]]) +##### axios#put(url[, data[, config]]) +##### axios#patch(url[, data[, config]]) + ## Request API -This is the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. +These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. ```js { // `url` is the server URL that will be used for the request url: '/user', + + // `baseURL` will be prepended to `url` unless `url` is absolute. + // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs + // to methods of that instance. + baseURL: 'https://some-domain.com/api/', // `method` is the request method to be used when making the request method: 'get', // default @@ -149,7 +180,7 @@ This is the available config options for making requests. Only the `url` is requ // The last function in the array must return a string or an ArrayBuffer transformRequest: [function (data) { // Do whatever you want to transform the data - + return data; }], @@ -157,7 +188,7 @@ This is the available config options for making requests. Only the `url` is requ // it is passed to then/catch transformResponse: [function (data) { // Do whatever you want to transform the data - + return data; }], @@ -169,6 +200,12 @@ This is the available config options for making requests. Only the `url` is requ ID: 12345 }, + // `paramsSerializer` is an optional function in charge of serializing `params` + // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) + paramsSerializer: function(params) { + return Qs.stringify(params, {arrayFormat: 'brackets'}) + }, + // `data` is the data to be sent as the request body // Only applicable for request methods 'PUT', 'POST', and 'PATCH' // When no `transformRequest` is set, must be a string, an ArrayBuffer or a hash @@ -184,6 +221,14 @@ This is the available config options for making requests. Only the `url` is requ // should be made using credentials withCredentials: false, // default + // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. + // This will set an `Authorization` header, overwriting any existing + // `Authorization` custom headers you have set using `headers`. + auth: { + username: 'janedoe', + password: 's00pers3cret' + } + // `responseType` indicates the type of data that the server will respond with // options are 'arraybuffer', 'blob', 'document', 'json', 'text' responseType: 'json', // default @@ -207,7 +252,7 @@ The response for a request contains the following information. // `status` is the HTTP status code from the server response status: 200, - + // `statusText` is the HTTP status message from the server response statusText: 'OK', @@ -263,6 +308,13 @@ var myInterceptor = axios.interceptors.request.use(function () {/*...*/}); axios.interceptors.request.eject(myInterceptor); ``` +You can add interceptors to a custom instance of axios. + +```js +var instance = axios.create(); +instance.interceptors.request.use(function () {/*...*/}); +``` + ## Handling Errors ```js diff --git a/axios.d.ts b/axios.d.ts index 6ceaeaa..7018e95 100644 --- a/axios.d.ts +++ b/axios.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Axios v0.7.0 +// Type definitions for Axios v0.8.1 // Project: https://github.com/mzabriskie/axios @@ -6,18 +6,26 @@ declare var axios: axios.AxiosStatic declare module axios { - interface AxiosStatic { - (options: axios.RequestOptions): axios.Promise; + interface AxiosRequestMethods { get(url: string, config?: any): axios.Promise; delete(url: string, config?: any): axios.Promise; head(url: string, config?: any): axios.Promise; post(url: string, data: any, config?: any): axios.Promise; put(url: string, data: any, config?: any): axios.Promise; patch(url: string, data: any, config?: any): axios.Promise; + } + + interface AxiosStatic extends AxiosRequestMethods { + (options: axios.RequestOptions): axios.Promise; + create(defaultOptions?: axios.InstanceOptions): AxiosInstance; all(iterable: any): axios.Promise; spread(callback: any): axios.Promise; } - + + interface AxiosInstance extends AxiosRequestMethods { + request(options: axios.RequestOptions): axios.Promise; + } + interface Response { data?: any; status?: number; @@ -31,17 +39,24 @@ declare module axios { catch(onRejected:(response: axios.Response) => void): axios.Promise; } - interface RequestOptions { - url: string; - method?: string; + interface InstanceOptions { transformRequest?: (data: any) => any; + transformResponse?: (data: any) => any; headers?: any; - params?: any; - data?: any; + timeout?: number; withCredentials?: boolean; responseType?: string; xsrfCookieName?: string; xsrfHeaderName?: string; + paramsSerializer?: (params: any) => string; + baseURL?: string; + } + + interface RequestOptions extends InstanceOptions { + url: string; + method?: string; + params?: any; + data?: any; } } diff --git a/bower.json b/bower.json index 8fe00ef..c1ff52f 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "axios", "main": "./dist/axios.js", - "version": "0.7.0", + "version": "0.8.1", "homepage": "https://github.com/mzabriskie/axios", "authors": [ "Matt Zabriskie" diff --git a/dist/axios.js b/dist/axios.js index a0960b9..27fe1c9 100644 --- a/dist/axios.js +++ b/dist/axios.js @@ -1,4 +1,4 @@ -/* axios v0.7.0 | (c) 2015 by Matt Zabriskie */ +/* axios v0.8.0 | (c) 2015 by Matt Zabriskie */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); @@ -67,8 +67,26 @@ return /******/ (function(modules) { // webpackBootstrap var utils = __webpack_require__(3); var dispatchRequest = __webpack_require__(4); var InterceptorManager = __webpack_require__(12); + var isAbsoluteURL = __webpack_require__(13); + var combineURLs = __webpack_require__(14); + var bind = __webpack_require__(15); - var axios = module.exports = function (config) { + function Axios(defaultConfig) { + this.defaultConfig = utils.merge({ + headers: {}, + timeout: defaults.timeout, + transformRequest: defaults.transformRequest, + transformResponse: defaults.transformResponse + }, defaultConfig); + + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; + } + + Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ // Allow for axios('example/url'[, config]) a la fetch API if (typeof config === 'string') { config = utils.merge({ @@ -76,13 +94,11 @@ return /******/ (function(modules) { // webpackBootstrap }, arguments[1]); } - config = utils.merge({ - method: 'get', - headers: {}, - timeout: defaults.timeout, - transformRequest: defaults.transformRequest, - transformResponse: defaults.transformResponse - }, config); + config = utils.merge(this.defaultConfig, { method: 'get' }, config); + + if (config.baseURL && !isAbsoluteURL(config.url)) { + config.url = combineURLs(config.baseURL, config.url); + } // Don't allow overriding defaults.withCredentials config.withCredentials = config.withCredentials || defaults.withCredentials; @@ -91,11 +107,11 @@ return /******/ (function(modules) { // webpackBootstrap var chain = [dispatchRequest, undefined]; var promise = Promise.resolve(config); - axios.interceptors.request.forEach(function (interceptor) { + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { chain.unshift(interceptor.fulfilled, interceptor.rejected); }); - axios.interceptors.response.forEach(function (interceptor) { + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { chain.push(interceptor.fulfilled, interceptor.rejected); }); @@ -106,49 +122,49 @@ return /******/ (function(modules) { // webpackBootstrap return promise; }; + var defaultInstance = new Axios(); + + var axios = module.exports = bind(Axios.prototype.request, defaultInstance); + + axios.create = function create(defaultConfig) { + return new Axios(defaultConfig); + }; + // Expose defaults axios.defaults = defaults; // Expose all/spread - axios.all = function (promises) { + axios.all = function all(promises) { return Promise.all(promises); }; - axios.spread = __webpack_require__(13); + axios.spread = __webpack_require__(16); // Expose interceptors - axios.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; + axios.interceptors = defaultInstance.interceptors; // Provide aliases for supported request methods - (function () { - function createShortMethods() { - utils.forEach(arguments, function (method) { - axios[method] = function (url, config) { - return axios(utils.merge(config || {}, { - method: method, - url: url - })); - }; - }); - } + utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url + })); + }; + axios[method] = bind(Axios.prototype[method], defaultInstance); + }); - function createShortMethodsWithData() { - utils.forEach(arguments, function (method) { - axios[method] = function (url, data, config) { - return axios(utils.merge(config || {}, { - method: method, - url: url, - data: data - })); - }; - }); - } - - createShortMethods('delete', 'get', 'head'); - createShortMethodsWithData('post', 'put', 'patch'); - })(); + utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url, + data: data + })); + }; + axios[method] = bind(Axios.prototype[method], defaultInstance); + }); /***/ }, @@ -165,8 +181,8 @@ return /******/ (function(modules) { // webpackBootstrap }; module.exports = { - transformRequest: [function (data, headers) { - if(utils.isFormData(data)) { + transformRequest: [function transformResponseJSON(data, headers) { + if (utils.isFormData(data)) { return data; } if (utils.isArrayBuffer(data)) { @@ -178,7 +194,7 @@ return /******/ (function(modules) { // webpackBootstrap if (utils.isObject(data) && !utils.isFile(data) && !utils.isBlob(data)) { // Set application/json if no Content-Type has been specified if (!utils.isUndefined(headers)) { - utils.forEach(headers, function (val, key) { + utils.forEach(headers, function processContentTypeHeader(val, key) { if (key.toLowerCase() === 'content-type') { headers['Content-Type'] = val; } @@ -193,7 +209,8 @@ return /******/ (function(modules) { // webpackBootstrap return data; }], - transformResponse: [function (data) { + transformResponse: [function transformResponseJSON(data) { + /*eslint no-param-reassign:0*/ if (typeof data === 'string') { data = data.replace(PROTECTION_PREFIX, ''); try { @@ -268,11 +285,13 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false */ function isArrayBufferView(val) { + var result; if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { - return ArrayBuffer.isView(val); + result = ArrayBuffer.isView(val); } else { - return (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); } + return result; } /** @@ -355,16 +374,6 @@ return /******/ (function(modules) { // webpackBootstrap return str.replace(/^\s*/, '').replace(/\s*$/, ''); } - /** - * Determine if a value is an Arguments object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Arguments object, otherwise false - */ - function isArguments(val) { - return toString.call(val) === '[object Arguments]'; - } - /** * Determine if we're running in a standard browser environment * @@ -376,7 +385,7 @@ return /******/ (function(modules) { // webpackBootstrap * typeof document -> undefined * * react-native: - * typeof document.createelement -> undefined + * typeof document.createElement -> undefined */ function isStandardBrowserEnv() { return ( @@ -389,7 +398,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * Iterate over an Array or an Object invoking a function for each item. * - * If `obj` is an Array or arguments callback will be called passing + * If `obj` is an Array callback will be called passing * the value, index, and complete array for each item. * * If 'obj' is an Object callback will be called passing @@ -404,22 +413,19 @@ return /******/ (function(modules) { // webpackBootstrap return; } - // Check if obj is array-like - var isArrayLike = isArray(obj) || isArguments(obj); - // Force an array if not already something iterable - if (typeof obj !== 'object' && !isArrayLike) { + if (typeof obj !== 'object' && !isArray(obj)) { + /*eslint no-param-reassign:0*/ obj = [obj]; } - // Iterate over array values - if (isArrayLike) { + if (isArray(obj)) { + // Iterate over array values for (var i = 0, l = obj.length; i < l; i++) { fn.call(null, obj[i], i, obj); } - } - // Iterate over object keys - else { + } else { + // Iterate over object keys for (var key in obj) { if (obj.hasOwnProperty(key)) { fn.call(null, obj[key], key, obj); @@ -445,13 +451,15 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Object} obj1 Object to merge * @returns {Object} Result of all merge properties */ - function merge(/*obj1, obj2, obj3, ...*/) { + function merge(/* obj1, obj2, obj3, ... */) { var result = {}; - forEach(arguments, function (obj) { - forEach(obj, function (val, key) { - result[key] = val; - }); - }); + function assignValue(val, key) { + result[key] = val; + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } return result; } @@ -478,7 +486,7 @@ return /******/ (function(modules) { // webpackBootstrap /* 4 */ /***/ function(module, exports, __webpack_require__) { - /* WEBPACK VAR INJECTION */(function(process) {'use strict'; + 'use strict'; /** * Dispatch a request to the server using whichever adapter @@ -488,15 +496,14 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {Promise} The Promise to be fulfilled */ module.exports = function dispatchRequest(config) { - return new Promise(function (resolve, reject) { + return new Promise(function executor(resolve, reject) { try { - // For browsers use XHR adapter if ((typeof XMLHttpRequest !== 'undefined') || (typeof ActiveXObject !== 'undefined')) { - __webpack_require__(6)(resolve, reject, config); - } - // For node use HTTP adapter - else if (typeof process !== 'undefined') { - __webpack_require__(6)(resolve, reject, config); + // For browsers use XHR adapter + __webpack_require__(5)(resolve, reject, config); + } else if (typeof process !== 'undefined') { + // For node use HTTP adapter + __webpack_require__(5)(resolve, reject, config); } } catch (e) { reject(e); @@ -504,108 +511,10 @@ return /******/ (function(modules) { // webpackBootstrap }); }; - - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + /***/ }, /* 5 */ -/***/ function(module, exports) { - - // shim for using process in browser - - var process = module.exports = {}; - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - - function cleanUpNextTick() { - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } - } - - function drainQueue() { - if (draining) { - return; - } - var timeout = setTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - clearTimeout(timeout); - } - - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - setTimeout(drainQueue, 0); - } - }; - - // v8 likes predictible objects - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; // empty string to avoid regexp issues - process.versions = {}; - - function noop() {} - - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; - - process.cwd = function () { return '/' }; - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - process.umask = function() { return 0; }; - - -/***/ }, -/* 6 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -614,9 +523,11 @@ return /******/ (function(modules) { // webpackBootstrap var defaults = __webpack_require__(2); var utils = __webpack_require__(3); - var buildUrl = __webpack_require__(7); - var parseHeaders = __webpack_require__(8); - var transformData = __webpack_require__(9); + var buildURL = __webpack_require__(6); + var parseHeaders = __webpack_require__(7); + var transformData = __webpack_require__(8); + var isURLSameOrigin = __webpack_require__(9); + var btoa = window.btoa || __webpack_require__(10); module.exports = function xhrAdapter(resolve, reject, config) { // Transform request data @@ -637,18 +548,36 @@ return /******/ (function(modules) { // webpackBootstrap delete requestHeaders['Content-Type']; // Let the browser set it } + var Adapter = (XMLHttpRequest || ActiveXObject); + var loadEvent = 'onreadystatechange'; + var xDomain = false; + + // For IE 8/9 CORS support + if (!isURLSameOrigin(config.url) && window.XDomainRequest) { + Adapter = window.XDomainRequest; + loadEvent = 'onload'; + xDomain = true; + } + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + // Create the request - var request = new (XMLHttpRequest || ActiveXObject)('Microsoft.XMLHTTP'); - request.open(config.method.toUpperCase(), buildUrl(config.url, config.params), true); + var request = new Adapter('Microsoft.XMLHTTP'); + request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); // Set the request timeout in MS request.timeout = config.timeout; // Listen for ready state - request.onreadystatechange = function () { - if (request && request.readyState === 4) { + request[loadEvent] = function handleReadyState() { + if (request && (request.readyState === 4 || xDomain)) { // Prepare the response - var responseHeaders = parseHeaders(request.getAllResponseHeaders()); + var responseHeaders = xDomain ? null : parseHeaders(request.getAllResponseHeaders()); var responseData = ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response; var response = { data: transformData( @@ -661,9 +590,8 @@ return /******/ (function(modules) { // webpackBootstrap headers: responseHeaders, config: config }; - // Resolve or reject the Promise based on the status - (request.status >= 200 && request.status < 300 ? + ((request.status >= 200 && request.status < 300) || (xDomain && request.responseText) ? resolve : reject)(response); @@ -676,11 +604,10 @@ return /******/ (function(modules) { // webpackBootstrap // This is only done if running in a standard browser environment. // Specifically not if we're in a web worker, or react-native. if (utils.isStandardBrowserEnv()) { - var cookies = __webpack_require__(10); - var urlIsSameOrigin = __webpack_require__(11); + var cookies = __webpack_require__(11); // Add xsrf header - var xsrfValue = urlIsSameOrigin(config.url) ? + var xsrfValue = config.withCredentials || isURLSameOrigin(config.url) ? cookies.read(config.xsrfCookieName || defaults.xsrfCookieName) : undefined; @@ -690,16 +617,17 @@ return /******/ (function(modules) { // webpackBootstrap } // Add headers to the request - utils.forEach(requestHeaders, function (val, key) { - // Remove Content-Type if data is undefined - if (!data && key.toLowerCase() === 'content-type') { - delete requestHeaders[key]; - } - // Otherwise add header to the request - else { - request.setRequestHeader(key, val); - } - }); + if (!xDomain) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (!data && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } // Add withCredentials to request if needed if (config.withCredentials) { @@ -727,7 +655,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 7 */ +/* 6 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -752,47 +680,55 @@ return /******/ (function(modules) { // webpackBootstrap * @param {object} [params] The params to be appended * @returns {string} The formatted url */ - module.exports = function buildUrl(url, params) { + module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ if (!params) { return url; } - var parts = []; + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else { + var parts = []; - utils.forEach(params, function (val, key) { - if (val === null || typeof val === 'undefined') { - return; - } - - if (utils.isArray(val)) { - key = key + '[]'; - } - - if (!utils.isArray(val)) { - val = [val]; - } - - utils.forEach(val, function (v) { - if (utils.isDate(v)) { - v = v.toISOString(); + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; } - else if (utils.isObject(v)) { - v = JSON.stringify(v); + + if (utils.isArray(val)) { + key = key + '[]'; } - parts.push(encode(key) + '=' + encode(v)); + + if (!utils.isArray(val)) { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); }); - }); - if (parts.length > 0) { - url += (url.indexOf('?') === -1 ? '?' : '&') + parts.join('&'); + serializedParams = parts.join('&'); + } + + if (serializedParams) { + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; } return url; }; + /***/ }, -/* 8 */ +/* 7 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -813,11 +749,14 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {Object} Headers parsed into an object */ module.exports = function parseHeaders(headers) { - var parsed = {}, key, val, i; + var parsed = {}; + var key; + var val; + var i; if (!headers) { return parsed; } - utils.forEach(headers.split('\n'), function(line) { + utils.forEach(headers.split('\n'), function parser(line) { i = line.indexOf(':'); key = utils.trim(line.substr(0, i)).toLowerCase(); val = utils.trim(line.substr(i + 1)); @@ -832,7 +771,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 9 */ +/* 8 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -848,7 +787,8 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {*} The resulting transformed data */ module.exports = function transformData(data, headers, fns) { - utils.forEach(fns, function (fn) { + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { data = fn(data, headers); }); @@ -857,52 +797,119 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 10 */ +/* 9 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - /** - * WARNING: - * This file makes references to objects that aren't safe in all environments. - * Please see lib/utils.isStandardBrowserEnv before including this file. - */ - var utils = __webpack_require__(3); - module.exports = { - write: function write(name, value, expires, path, domain, secure) { - var cookie = []; - cookie.push(name + '=' + encodeURIComponent(value)); + module.exports = ( + utils.isStandardBrowserEnv() ? - if (utils.isNumber(expires)) { - cookie.push('expires=' + new Date(expires).toGMTString()); + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; } - if (utils.isString(path)) { - cookie.push('path=' + path); + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() + ); + + +/***/ }, +/* 10 */ +/***/ function(module, exports) { + + 'use strict'; + + // btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js + + var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + function InvalidCharacterError(message) { + this.message = message; + } + InvalidCharacterError.prototype = new Error; + InvalidCharacterError.prototype.code = 5; + InvalidCharacterError.prototype.name = 'InvalidCharacterError'; + + function btoa(input) { + var str = String(input); + var output = ''; + for ( + // initialize result and counter + var block, charCode, idx = 0, map = chars; + // if the next str index does not exist: + // change the mapping table to "=" + // check if d has no fractional digits + str.charAt(idx | 0) || (map = '=', idx % 1); + // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8 + output += map.charAt(63 & block >> 8 - idx % 1 * 8) + ) { + charCode = str.charCodeAt(idx += 3 / 4); + if (charCode > 0xFF) { + throw new InvalidCharacterError('INVALID_CHARACTER_ERR: DOM Exception 5'); } - - if (utils.isString(domain)) { - cookie.push('domain=' + domain); - } - - if (secure === true) { - cookie.push('secure'); - } - - document.cookie = cookie.join('; '); - }, - - read: function read(name) { - var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); - return (match ? decodeURIComponent(match[3]) : null); - }, - - remove: function remove(name) { - this.write(name, '', Date.now() - 86400000); + block = block << 8 | charCode; } - }; + return output; + } + + module.exports = btoa; /***/ }, @@ -911,62 +918,57 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - /** - * WARNING: - * This file makes references to objects that aren't safe in all environments. - * Please see lib/utils.isStandardBrowserEnv before including this file. - */ - var utils = __webpack_require__(3); - var msie = /(msie|trident)/i.test(navigator.userAgent); - var urlParsingNode = document.createElement('a'); - var originUrl; - /** - * Parse a URL to discover it's components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ - function urlResolve(url) { - var href = url; + module.exports = ( + utils.isStandardBrowserEnv() ? - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); - urlParsingNode.setAttribute('href', href); + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; - } + if (utils.isString(path)) { + cookie.push('path=' + path); + } - originUrl = urlResolve(window.location.href); + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } - /** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestUrl The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ - module.exports = function urlIsSameOrigin(requestUrl) { - var parsed = (utils.isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl; - return (parsed.protocol === originUrl.protocol && - parsed.host === originUrl.host); - }; + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() + ); /***/ }, @@ -989,7 +991,7 @@ return /******/ (function(modules) { // webpackBootstrap * * @return {Number} An ID used to remove interceptor later */ - InterceptorManager.prototype.use = function (fulfilled, rejected) { + InterceptorManager.prototype.use = function use(fulfilled, rejected) { this.handlers.push({ fulfilled: fulfilled, rejected: rejected @@ -1002,7 +1004,7 @@ return /******/ (function(modules) { // webpackBootstrap * * @param {Number} id The ID that was returned by `use` */ - InterceptorManager.prototype.eject = function (id) { + InterceptorManager.prototype.eject = function eject(id) { if (this.handlers[id]) { this.handlers[id] = null; } @@ -1012,12 +1014,12 @@ return /******/ (function(modules) { // webpackBootstrap * Iterate over all the registered interceptors * * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `remove`. + * interceptors that may have become `null` calling `eject`. * * @param {Function} fn The function to call for each interceptor */ - InterceptorManager.prototype.forEach = function (fn) { - utils.forEach(this.handlers, function (h) { + InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { if (h !== null) { fn(h); } @@ -1033,6 +1035,61 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; + /** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ + module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); + }; + + +/***/ }, +/* 14 */ +/***/ function(module, exports) { + + 'use strict'; + + /** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ + module.exports = function combineURLs(baseURL, relativeURL) { + return baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, ''); + }; + + +/***/ }, +/* 15 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; + }; + + +/***/ }, +/* 16 */ +/***/ function(module, exports) { + + 'use strict'; + /** * Syntactic sugar for invoking a function and expanding an array for arguments. * @@ -1054,7 +1111,7 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {Function} */ module.exports = function spread(callback) { - return function (arr) { + return function wrap(arr) { return callback.apply(null, arr); }; }; diff --git a/dist/axios.map b/dist/axios.map index 4514466..8747541 100644 --- a/dist/axios.map +++ b/dist/axios.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap bad7c5323abdcf375709","webpack:///./index.js","webpack:///./lib/axios.js","webpack:///./lib/defaults.js","webpack:///./lib/utils.js","webpack:///./lib/core/dispatchRequest.js","webpack:///(webpack)/~/node-libs-browser/~/process/browser.js","webpack:///./lib/adapters/xhr.js","webpack:///./lib/helpers/buildUrl.js","webpack:///./lib/helpers/parseHeaders.js","webpack:///./lib/helpers/transformData.js","webpack:///./lib/helpers/cookies.js","webpack:///./lib/helpers/urlIsSameOrigin.js","webpack:///./lib/core/InterceptorManager.js","webpack:///./lib/helpers/spread.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,yC;;;;;;ACAA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA,gBAAe;AACf;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,8CAA6C;AAC7C;AACA;AACA,UAAS;AACT;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA,8CAA6C;AAC7C;AACA;AACA;AACA,UAAS;AACT;AACA,MAAK;AACL;;AAEA;AACA;AACA,EAAC;;;;;;;ACvFD;;AAEA;;AAEA,iCAAgC;AAChC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA,uDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,QAAO,YAAY;AACnB;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,IAAG;;AAEH;;AAEA;AACA;AACA;;;;;;;AC7DA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,aAAa;AACxB,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAmC,OAAO;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB,SAAS,GAAG,SAAS;AAC5C,4BAA2B;AAC3B;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACxPA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;;;;;;;;;ACxBA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA2B;AAC3B;AACA;AACA;AACA,6BAA4B,UAAU;;;;;;;AC1FtC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAAyC;AACzC;AACA;;AAEA;AACA,2CAA0C;AAC1C;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;ACnHA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;;;;;;;AC1DA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA,kBAAiB;;AAEjB,kBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;ACjCA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,cAAc;AACzB,YAAW,MAAM;AACjB,YAAW,eAAe;AAC1B,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;AClBA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qCAAoC;AACpC,IAAG;;AAEH;AACA,uDAAsD,wBAAwB;AAC9E;AACA,IAAG;;AAEH;AACA;AACA;AACA;;;;;;;AC1CA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;;;;;;ACzDA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB;AACA,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;;;;;;;ACnDA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAA+B;AAC/B;AACA;AACA,YAAW,SAAS;AACpB,cAAa;AACb;AACA;AACA;AACA;AACA;AACA","file":"axios.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap bad7c5323abdcf375709\n **/","module.exports = require('./lib/axios');\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./index.js\n ** module id = 0\n ** module chunks = 0\n **/","'use strict';\n\nvar defaults = require('./defaults');\nvar utils = require('./utils');\nvar dispatchRequest = require('./core/dispatchRequest');\nvar InterceptorManager = require('./core/InterceptorManager');\n\nvar axios = module.exports = function (config) {\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge({\n method: 'get',\n headers: {},\n timeout: defaults.timeout,\n transformRequest: defaults.transformRequest,\n transformResponse: defaults.transformResponse\n }, config);\n\n // Don't allow overriding defaults.withCredentials\n config.withCredentials = config.withCredentials || defaults.withCredentials;\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n axios.interceptors.request.forEach(function (interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n axios.interceptors.response.forEach(function (interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Expose defaults\naxios.defaults = defaults;\n\n// Expose all/spread\naxios.all = function (promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose interceptors\naxios.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n};\n\n// Provide aliases for supported request methods\n(function () {\n function createShortMethods() {\n utils.forEach(arguments, function (method) {\n axios[method] = function (url, config) {\n return axios(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n });\n }\n\n function createShortMethodsWithData() {\n utils.forEach(arguments, function (method) {\n axios[method] = function (url, data, config) {\n return axios(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n });\n }\n\n createShortMethods('delete', 'get', 'head');\n createShortMethodsWithData('post', 'put', 'patch');\n})();\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/axios.js\n ** module id = 1\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./utils');\n\nvar PROTECTION_PREFIX = /^\\)\\]\\}',?\\n/;\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nmodule.exports = {\n transformRequest: [function (data, headers) {\n if(utils.isFormData(data)) {\n return data;\n }\n if (utils.isArrayBuffer(data)) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isObject(data) && !utils.isFile(data) && !utils.isBlob(data)) {\n // Set application/json if no Content-Type has been specified\n if (!utils.isUndefined(headers)) {\n utils.forEach(headers, function (val, key) {\n if (key.toLowerCase() === 'content-type') {\n headers['Content-Type'] = val;\n }\n });\n\n if (utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = 'application/json;charset=utf-8';\n }\n }\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function (data) {\n if (typeof data === 'string') {\n data = data.replace(PROTECTION_PREFIX, '');\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n },\n patch: utils.merge(DEFAULT_CONTENT_TYPE),\n post: utils.merge(DEFAULT_CONTENT_TYPE),\n put: utils.merge(DEFAULT_CONTENT_TYPE)\n },\n\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN'\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/defaults.js\n ** module id = 2\n ** module chunks = 0\n **/","'use strict';\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return toString.call(val) === '[object FormData]';\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n return ArrayBuffer.isView(val);\n } else {\n return (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if a value is an Arguments object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Arguments object, otherwise false\n */\nfunction isArguments(val) {\n return toString.call(val) === '[object Arguments]';\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * typeof document.createelement -> undefined\n */\nfunction isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array or arguments callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Check if obj is array-like\n var isArrayLike = isArray(obj) || isArguments(obj);\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object' && !isArrayLike) {\n obj = [obj];\n }\n\n // Iterate over array values\n if (isArrayLike) {\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n }\n // Iterate over object keys\n else {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/*obj1, obj2, obj3, ...*/) {\n var result = {};\n forEach(arguments, function (obj) {\n forEach(obj, function (val, key) {\n result[key] = val;\n });\n });\n return result;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n trim: trim\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/utils.js\n ** module id = 3\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * Dispatch a request to the server using whichever adapter\n * is supported by the current environment.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n return new Promise(function (resolve, reject) {\n try {\n // For browsers use XHR adapter\n if ((typeof XMLHttpRequest !== 'undefined') || (typeof ActiveXObject !== 'undefined')) {\n require('../adapters/xhr')(resolve, reject, config);\n }\n // For node use HTTP adapter\n else if (typeof process !== 'undefined') {\n require('../adapters/http')(resolve, reject, config);\n }\n } catch (e) {\n reject(e);\n }\n });\n};\n\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/core/dispatchRequest.js\n ** module id = 4\n ** module chunks = 0\n **/","// shim for using process in browser\n\nvar process = module.exports = {};\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = setTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n clearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n setTimeout(drainQueue, 0);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** (webpack)/~/node-libs-browser/~/process/browser.js\n ** module id = 5\n ** module chunks = 0\n **/","'use strict';\n\n/*global ActiveXObject:true*/\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar buildUrl = require('./../helpers/buildUrl');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar transformData = require('./../helpers/transformData');\n\nmodule.exports = function xhrAdapter(resolve, reject, config) {\n // Transform request data\n var data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Merge headers\n var requestHeaders = utils.merge(\n defaults.headers.common,\n defaults.headers[config.method] || {},\n config.headers || {}\n );\n\n if (utils.isFormData(data)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n // Create the request\n var request = new (XMLHttpRequest || ActiveXObject)('Microsoft.XMLHTTP');\n request.open(config.method.toUpperCase(), buildUrl(config.url, config.params), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function () {\n if (request && request.readyState === 4) {\n // Prepare the response\n var responseHeaders = parseHeaders(request.getAllResponseHeaders());\n var responseData = ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response;\n var response = {\n data: transformData(\n responseData,\n responseHeaders,\n config.transformResponse\n ),\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config\n };\n\n // Resolve or reject the Promise based on the status\n (request.status >= 200 && request.status < 300 ?\n resolve :\n reject)(response);\n\n // Clean up request\n request = null;\n }\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n var urlIsSameOrigin = require('./../helpers/urlIsSameOrigin');\n\n // Add xsrf header\n var xsrfValue = urlIsSameOrigin(config.url) ?\n cookies.read(config.xsrfCookieName || defaults.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName || defaults.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n utils.forEach(requestHeaders, function (val, key) {\n // Remove Content-Type if data is undefined\n if (!data && key.toLowerCase() === 'content-type') {\n delete requestHeaders[key];\n }\n // Otherwise add header to the request\n else {\n request.setRequestHeader(key, val);\n }\n });\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n if (request.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n if (utils.isArrayBuffer(data)) {\n data = new DataView(data);\n }\n\n // Send the request\n request.send(data);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/adapters/xhr.js\n ** module id = 6\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildUrl(url, params) {\n if (!params) {\n return url;\n }\n\n var parts = [];\n\n utils.forEach(params, function (val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n }\n\n if (!utils.isArray(val)) {\n val = [val];\n }\n\n utils.forEach(val, function (v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n }\n else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n if (parts.length > 0) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + parts.join('&');\n }\n\n return url;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/buildUrl.js\n ** module id = 7\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {}, key, val, i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/parseHeaders.js\n ** module id = 8\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n utils.forEach(fns, function (fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/transformData.js\n ** module id = 9\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * WARNING:\n * This file makes references to objects that aren't safe in all environments.\n * Please see lib/utils.isStandardBrowserEnv before including this file.\n */\n\nvar utils = require('./../utils');\n\nmodule.exports = {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/cookies.js\n ** module id = 10\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * WARNING:\n * This file makes references to objects that aren't safe in all environments.\n * Please see lib/utils.isStandardBrowserEnv before including this file.\n */\n\nvar utils = require('./../utils');\nvar msie = /(msie|trident)/i.test(navigator.userAgent);\nvar urlParsingNode = document.createElement('a');\nvar originUrl;\n\n/**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\nfunction urlResolve(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n}\n\noriginUrl = urlResolve(window.location.href);\n\n/**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestUrl The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\nmodule.exports = function urlIsSameOrigin(requestUrl) {\n var parsed = (utils.isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;\n return (parsed.protocol === originUrl.protocol &&\n parsed.host === originUrl.host);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/urlIsSameOrigin.js\n ** module id = 11\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function (fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function (id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `remove`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function (fn) {\n utils.forEach(this.handlers, function (h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/core/InterceptorManager.js\n ** module id = 12\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function (arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/spread.js\n ** module id = 13\n ** module chunks = 0\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 51c901ce08a0cb385d8a","webpack:///./index.js","webpack:///./lib/axios.js","webpack:///./lib/defaults.js","webpack:///./lib/utils.js","webpack:///./lib/core/dispatchRequest.js","webpack:///./lib/adapters/xhr.js","webpack:///./lib/helpers/buildURL.js","webpack:///./lib/helpers/parseHeaders.js","webpack:///./lib/helpers/transformData.js","webpack:///./lib/helpers/isURLSameOrigin.js","webpack:///./lib/helpers/btoa.js","webpack:///./lib/helpers/cookies.js","webpack:///./lib/core/InterceptorManager.js","webpack:///./lib/helpers/isAbsoluteURL.js","webpack:///./lib/helpers/combineURLs.js","webpack:///./lib/helpers/bind.js","webpack:///./lib/helpers/spread.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,yC;;;;;;ACAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAe;AACf;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA,6CAA4C,gBAAgB;;AAE5D;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,iDAAgD;AAChD;AACA;AACA,MAAK;AACL;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA,iDAAgD;AAChD;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,EAAC;;;;;;;ACvGD;;AAEA;;AAEA,iCAAgC;AAChC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA,uDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,QAAO,YAAY;AACnB;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,IAAG;;AAEH;;AAEA;AACA;AACA;;;;;;;AC9DA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,aAAa;AACxB,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAmC,OAAO;AAC1C;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB,SAAS,GAAG,SAAS;AAC5C,4BAA2B;AAC3B;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC/OA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;;;;;;;;ACvBA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAAyC;AACzC;AACA;;AAEA;AACA,2CAA0C;AAC1C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;ACtIA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,QAAO;AACP,MAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;ACjEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;ACpCA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,cAAc;AACzB,YAAW,MAAM;AACjB,YAAW,eAAe;AAC1B,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;ACnBA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB,iBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB,iBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;;;;;;ACnEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACnCA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,yCAAwC;AACxC,QAAO;;AAEP;AACA,2DAA0D,wBAAwB;AAClF;AACA,QAAO;;AAEP;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,iCAAgC;AAChC,8BAA6B,aAAa,EAAE;AAC5C;AACA;AACA,IAAG;AACH;;;;;;;ACpDA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB;AACA,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;;;;;;;ACnDA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACbA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;;;;;;ACXA;;AAEA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;ACVA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAA+B;AAC/B;AACA;AACA,YAAW,SAAS;AACpB,cAAa;AACb;AACA;AACA;AACA;AACA;AACA","file":"axios.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 51c901ce08a0cb385d8a\n **/","module.exports = require('./lib/axios');\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./index.js\n ** module id = 0\n ** module chunks = 0\n **/","'use strict';\n\nvar defaults = require('./defaults');\nvar utils = require('./utils');\nvar dispatchRequest = require('./core/dispatchRequest');\nvar InterceptorManager = require('./core/InterceptorManager');\nvar isAbsoluteURL = require('./helpers/isAbsoluteURL');\nvar combineURLs = require('./helpers/combineURLs');\nvar bind = require('./helpers/bind');\n\nfunction Axios(defaultConfig) {\n this.defaultConfig = utils.merge({\n headers: {},\n timeout: defaults.timeout,\n transformRequest: defaults.transformRequest,\n transformResponse: defaults.transformResponse\n }, defaultConfig);\n\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(this.defaultConfig, { method: 'get' }, config);\n\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Don't allow overriding defaults.withCredentials\n config.withCredentials = config.withCredentials || defaults.withCredentials;\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nvar defaultInstance = new Axios();\n\nvar axios = module.exports = bind(Axios.prototype.request, defaultInstance);\n\naxios.create = function create(defaultConfig) {\n return new Axios(defaultConfig);\n};\n\n// Expose defaults\naxios.defaults = defaults;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose interceptors\naxios.interceptors = defaultInstance.interceptors;\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n axios[method] = bind(Axios.prototype[method], defaultInstance);\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n axios[method] = bind(Axios.prototype[method], defaultInstance);\n});\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/axios.js\n ** module id = 1\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./utils');\n\nvar PROTECTION_PREFIX = /^\\)\\]\\}',?\\n/;\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nmodule.exports = {\n transformRequest: [function transformResponseJSON(data, headers) {\n if (utils.isFormData(data)) {\n return data;\n }\n if (utils.isArrayBuffer(data)) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isObject(data) && !utils.isFile(data) && !utils.isBlob(data)) {\n // Set application/json if no Content-Type has been specified\n if (!utils.isUndefined(headers)) {\n utils.forEach(headers, function processContentTypeHeader(val, key) {\n if (key.toLowerCase() === 'content-type') {\n headers['Content-Type'] = val;\n }\n });\n\n if (utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = 'application/json;charset=utf-8';\n }\n }\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponseJSON(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n data = data.replace(PROTECTION_PREFIX, '');\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n },\n patch: utils.merge(DEFAULT_CONTENT_TYPE),\n post: utils.merge(DEFAULT_CONTENT_TYPE),\n put: utils.merge(DEFAULT_CONTENT_TYPE)\n },\n\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN'\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/defaults.js\n ** module id = 2\n ** module chunks = 0\n **/","'use strict';\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return toString.call(val) === '[object FormData]';\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * typeof document.createElement -> undefined\n */\nfunction isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object' && !isArray(obj)) {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n result[key] = val;\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n trim: trim\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/utils.js\n ** module id = 3\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * Dispatch a request to the server using whichever adapter\n * is supported by the current environment.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n return new Promise(function executor(resolve, reject) {\n try {\n if ((typeof XMLHttpRequest !== 'undefined') || (typeof ActiveXObject !== 'undefined')) {\n // For browsers use XHR adapter\n require('../adapters/xhr')(resolve, reject, config);\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n require('../adapters/http')(resolve, reject, config);\n }\n } catch (e) {\n reject(e);\n }\n });\n};\n\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/core/dispatchRequest.js\n ** module id = 4\n ** module chunks = 0\n **/","'use strict';\n\n/*global ActiveXObject:true*/\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar transformData = require('./../helpers/transformData');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar btoa = window.btoa || require('./../helpers/btoa');\n\nmodule.exports = function xhrAdapter(resolve, reject, config) {\n // Transform request data\n var data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Merge headers\n var requestHeaders = utils.merge(\n defaults.headers.common,\n defaults.headers[config.method] || {},\n config.headers || {}\n );\n\n if (utils.isFormData(data)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var Adapter = (XMLHttpRequest || ActiveXObject);\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n if (!isURLSameOrigin(config.url) && window.XDomainRequest) {\n Adapter = window.XDomainRequest;\n loadEvent = 'onload';\n xDomain = true;\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n // Create the request\n var request = new Adapter('Microsoft.XMLHTTP');\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleReadyState() {\n if (request && (request.readyState === 4 || xDomain)) {\n // Prepare the response\n var responseHeaders = xDomain ? null : parseHeaders(request.getAllResponseHeaders());\n var responseData = ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response;\n var response = {\n data: transformData(\n responseData,\n responseHeaders,\n config.transformResponse\n ),\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config\n };\n // Resolve or reject the Promise based on the status\n ((request.status >= 200 && request.status < 300) || (xDomain && request.responseText) ?\n resolve :\n reject)(response);\n\n // Clean up request\n request = null;\n }\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = config.withCredentials || isURLSameOrigin(config.url) ?\n cookies.read(config.xsrfCookieName || defaults.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName || defaults.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if (!xDomain) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (!data && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n if (request.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n if (utils.isArrayBuffer(data)) {\n data = new DataView(data);\n }\n\n // Send the request\n request.send(data);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/adapters/xhr.js\n ** module id = 5\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n }\n\n if (!utils.isArray(val)) {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/buildURL.js\n ** module id = 6\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/parseHeaders.js\n ** module id = 7\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/transformData.js\n ** module id = 8\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/isURLSameOrigin.js\n ** module id = 9\n ** module chunks = 0\n **/","'use strict';\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction InvalidCharacterError(message) {\n this.message = message;\n}\nInvalidCharacterError.prototype = new Error;\nInvalidCharacterError.prototype.code = 5;\nInvalidCharacterError.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new InvalidCharacterError('INVALID_CHARACTER_ERR: DOM Exception 5');\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/btoa.js\n ** module id = 10\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/cookies.js\n ** module id = 11\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/core/InterceptorManager.js\n ** module id = 12\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/isAbsoluteURL.js\n ** module id = 13\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '');\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/combineURLs.js\n ** module id = 14\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/bind.js\n ** module id = 15\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/spread.js\n ** module id = 16\n ** module chunks = 0\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/axios.min.js b/dist/axios.min.js index cb47f55..fc6c199 100644 --- a/dist/axios.min.js +++ b/dist/axios.min.js @@ -1,3 +1,3 @@ -/* axios v0.7.0 | (c) 2015 by Matt Zabriskie */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";var r=n(2),o=n(3),i=n(4),s=n(12),u=e.exports=function(e){"string"==typeof e&&(e=o.merge({url:arguments[0]},arguments[1])),e=o.merge({method:"get",headers:{},timeout:r.timeout,transformRequest:r.transformRequest,transformResponse:r.transformResponse},e),e.withCredentials=e.withCredentials||r.withCredentials;var t=[i,void 0],n=Promise.resolve(e);for(u.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),u.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n};u.defaults=r,u.all=function(e){return Promise.all(e)},u.spread=n(13),u.interceptors={request:new s,response:new s},function(){function e(){o.forEach(arguments,function(e){u[e]=function(t,n){return u(o.merge(n||{},{method:e,url:t}))}})}function t(){o.forEach(arguments,function(e){u[e]=function(t,n,r){return u(o.merge(r||{},{method:e,url:t,data:n}))}})}e("delete","get","head"),t("post","put","patch")}()},function(e,t,n){"use strict";var r=n(3),o=/^\)\]\}',?\n/,i={"Content-Type":"application/x-www-form-urlencoded"};e.exports={transformRequest:[function(e,t){return r.isFormData(e)?e:r.isArrayBuffer(e)?e:r.isArrayBufferView(e)?e.buffer:!r.isObject(e)||r.isFile(e)||r.isBlob(e)?e:(r.isUndefined(t)||(r.forEach(t,function(e,n){"content-type"===n.toLowerCase()&&(t["Content-Type"]=e)}),r.isUndefined(t["Content-Type"])&&(t["Content-Type"]="application/json;charset=utf-8")),JSON.stringify(e))}],transformResponse:[function(e){if("string"==typeof e){e=e.replace(o,"");try{e=JSON.parse(e)}catch(t){}}return e}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:r.merge(i),post:r.merge(i),put:r.merge(i)},timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(e,t){"use strict";function n(e){return"[object Array]"===v.call(e)}function r(e){return"[object ArrayBuffer]"===v.call(e)}function o(e){return"[object FormData]"===v.call(e)}function i(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function s(e){return"string"==typeof e}function u(e){return"number"==typeof e}function a(e){return"undefined"==typeof e}function f(e){return null!==e&&"object"==typeof e}function c(e){return"[object Date]"===v.call(e)}function p(e){return"[object File]"===v.call(e)}function l(e){return"[object Blob]"===v.call(e)}function d(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function h(e){return"[object Arguments]"===v.call(e)}function m(){return"undefined"!=typeof window&&"undefined"!=typeof document&&"function"==typeof document.createElement}function y(e,t){if(null!==e&&"undefined"!=typeof e){var r=n(e)||h(e);if("object"==typeof e||r||(e=[e]),r)for(var o=0,i=e.length;i>o;o++)t.call(null,e[o],o,e);else for(var s in e)e.hasOwnProperty(s)&&t.call(null,e[s],s,e)}}function g(){var e={};return y(arguments,function(t){y(t,function(t,n){e[n]=t})}),e}var v=Object.prototype.toString;e.exports={isArray:n,isArrayBuffer:r,isFormData:o,isArrayBufferView:i,isString:s,isNumber:u,isObject:f,isUndefined:a,isDate:c,isFile:p,isBlob:l,isStandardBrowserEnv:m,forEach:y,merge:g,trim:d}},function(e,t,n){(function(t){"use strict";e.exports=function(e){return new Promise(function(r,o){try{"undefined"!=typeof XMLHttpRequest||"undefined"!=typeof ActiveXObject?n(6)(r,o,e):"undefined"!=typeof t&&n(6)(r,o,e)}catch(i){o(i)}})}}).call(t,n(5))},function(e,t){function n(){f=!1,s.length?a=s.concat(a):c=-1,a.length&&r()}function r(){if(!f){var e=setTimeout(n);f=!0;for(var t=a.length;t;){for(s=a,a=[];++c1)for(var n=1;n=200&&p.status<300?e:t)(o),p=null}},o.isStandardBrowserEnv()){var l=n(10),d=n(11),h=d(a.url)?l.read(a.xsrfCookieName||r.xsrfCookieName):void 0;h&&(c[a.xsrfHeaderName||r.xsrfHeaderName]=h)}if(o.forEach(c,function(e,t){f||"content-type"!==t.toLowerCase()?p.setRequestHeader(t,e):delete c[t]}),a.withCredentials&&(p.withCredentials=!0),a.responseType)try{p.responseType=a.responseType}catch(m){if("json"!==p.responseType)throw m}o.isArrayBuffer(f)&&(f=new DataView(f)),p.send(f)}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=n(3);e.exports=function(e,t){if(!t)return e;var n=[];return o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)&&(t+="[]"),o.isArray(e)||(e=[e]),o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),n.push(r(t)+"="+r(e))}))}),n.length>0&&(e+=(-1===e.indexOf("?")?"?":"&")+n.join("&")),e}},function(e,t,n){"use strict";var r=n(3);e.exports=function(e){var t,n,o,i={};return e?(r.forEach(e.split("\n"),function(e){o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t&&(i[t]=i[t]?i[t]+", "+n:n)}),i):i}},function(e,t,n){"use strict";var r=n(3);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";var r=n(3);e.exports={write:function(e,t,n,o,i,s){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}},function(e,t,n){"use strict";function r(e){var t=e;return s&&(u.setAttribute("href",t),t=u.href),u.setAttribute("href",t),{href:u.href,protocol:u.protocol?u.protocol.replace(/:$/,""):"",host:u.host,search:u.search?u.search.replace(/^\?/,""):"",hash:u.hash?u.hash.replace(/^#/,""):"",hostname:u.hostname,port:u.port,pathname:"/"===u.pathname.charAt(0)?u.pathname:"/"+u.pathname}}var o,i=n(3),s=/(msie|trident)/i.test(navigator.userAgent),u=document.createElement("a");o=r(window.location.href),e.exports=function(e){var t=i.isString(e)?r(e):e;return t.protocol===o.protocol&&t.host===o.host}},function(e,t,n){"use strict";function r(){this.handlers=[]}var o=n(3);r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}}])}); +/* axios v0.8.0 | (c) 2015 by Matt Zabriskie */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){"use strict";function n(e){this.defaultConfig=i.merge({headers:{},timeout:o.timeout,transformRequest:o.transformRequest,transformResponse:o.transformResponse},e),this.interceptors={request:new u,response:new u}}var o=r(2),i=r(3),s=r(4),u=r(12),a=r(13),c=r(14),f=r(15);n.prototype.request=function(e){"string"==typeof e&&(e=i.merge({url:arguments[0]},arguments[1])),e=i.merge(this.defaultConfig,{method:"get"},e),e.baseURL&&!a(e.url)&&(e.url=c(e.baseURL,e.url)),e.withCredentials=e.withCredentials||o.withCredentials;var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r};var p=new n,l=e.exports=f(n.prototype.request,p);l.create=function(e){return new n(e)},l.defaults=o,l.all=function(e){return Promise.all(e)},l.spread=r(16),l.interceptors=p.interceptors,i.forEach(["delete","get","head"],function(e){n.prototype[e]=function(t,r){return this.request(i.merge(r||{},{method:e,url:t}))},l[e]=f(n.prototype[e],p)}),i.forEach(["post","put","patch"],function(e){n.prototype[e]=function(t,r,n){return this.request(i.merge(n||{},{method:e,url:t,data:r}))},l[e]=f(n.prototype[e],p)})},function(e,t,r){"use strict";var n=r(3),o=/^\)\]\}',?\n/,i={"Content-Type":"application/x-www-form-urlencoded"};e.exports={transformRequest:[function(e,t){return n.isFormData(e)?e:n.isArrayBuffer(e)?e:n.isArrayBufferView(e)?e.buffer:!n.isObject(e)||n.isFile(e)||n.isBlob(e)?e:(n.isUndefined(t)||(n.forEach(t,function(e,r){"content-type"===r.toLowerCase()&&(t["Content-Type"]=e)}),n.isUndefined(t["Content-Type"])&&(t["Content-Type"]="application/json;charset=utf-8")),JSON.stringify(e))}],transformResponse:[function(e){if("string"==typeof e){e=e.replace(o,"");try{e=JSON.parse(e)}catch(t){}}return e}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:n.merge(i),post:n.merge(i),put:n.merge(i)},timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(e,t){"use strict";function r(e){return"[object Array]"===g.call(e)}function n(e){return"[object ArrayBuffer]"===g.call(e)}function o(e){return"[object FormData]"===g.call(e)}function i(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function s(e){return"string"==typeof e}function u(e){return"number"==typeof e}function a(e){return"undefined"==typeof e}function c(e){return null!==e&&"object"==typeof e}function f(e){return"[object Date]"===g.call(e)}function p(e){return"[object File]"===g.call(e)}function l(e){return"[object Blob]"===g.call(e)}function d(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function h(){return"undefined"!=typeof window&&"undefined"!=typeof document&&"function"==typeof document.createElement}function m(e,t){if(null!==e&&"undefined"!=typeof e)if("object"==typeof e||r(e)||(e=[e]),r(e))for(var n=0,o=e.length;o>n;n++)t.call(null,e[n],n,e);else for(var i in e)e.hasOwnProperty(i)&&t.call(null,e[i],i,e)}function y(){function e(e,r){t[r]=e}for(var t={},r=0,n=arguments.length;n>r;r++)m(arguments[r],e);return t}var g=Object.prototype.toString;e.exports={isArray:r,isArrayBuffer:n,isFormData:o,isArrayBufferView:i,isString:s,isNumber:u,isObject:c,isUndefined:a,isDate:f,isFile:p,isBlob:l,isStandardBrowserEnv:h,forEach:m,merge:y,trim:d}},function(e,t,r){"use strict";e.exports=function(e){return new Promise(function(t,n){try{"undefined"!=typeof XMLHttpRequest||"undefined"!=typeof ActiveXObject?r(5)(t,n,e):"undefined"!=typeof process&&r(5)(t,n,e)}catch(o){n(o)}})}},function(e,t,r){"use strict";var n=r(2),o=r(3),i=r(6),s=r(7),u=r(8),a=r(9),c=window.btoa||r(10);e.exports=function(e,t,f){var p=u(f.data,f.headers,f.transformRequest),l=o.merge(n.headers.common,n.headers[f.method]||{},f.headers||{});o.isFormData(p)&&delete l["Content-Type"];var d=XMLHttpRequest||ActiveXObject,h="onreadystatechange",m=!1;if(!a(f.url)&&window.XDomainRequest&&(d=window.XDomainRequest,h="onload",m=!0),f.auth){var y=f.auth.username||"",g=f.auth.password||"";l.Authorization="Basic "+c(y+":"+g)}var w=new d("Microsoft.XMLHTTP");if(w.open(f.method.toUpperCase(),i(f.url,f.params,f.paramsSerializer),!0),w.timeout=f.timeout,w[h]=function(){if(w&&(4===w.readyState||m)){var r=m?null:s(w.getAllResponseHeaders()),n=-1!==["text",""].indexOf(f.responseType||"")?w.responseText:w.response,o={data:u(n,r,f.transformResponse),status:w.status,statusText:w.statusText,headers:r,config:f};(w.status>=200&&w.status<300||m&&w.responseText?e:t)(o),w=null}},o.isStandardBrowserEnv()){var v=r(11),x=f.withCredentials||a(f.url)?v.read(f.xsrfCookieName||n.xsrfCookieName):void 0;x&&(l[f.xsrfHeaderName||n.xsrfHeaderName]=x)}if(m||o.forEach(l,function(e,t){p||"content-type"!==t.toLowerCase()?w.setRequestHeader(t,e):delete l[t]}),f.withCredentials&&(w.withCredentials=!0),f.responseType)try{w.responseType=f.responseType}catch(b){if("json"!==w.responseType)throw b}o.isArrayBuffer(p)&&(p=new DataView(p)),w.send(p)}},function(e,t,r){"use strict";function n(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=r(3);e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else{var s=[];o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)&&(t+="[]"),o.isArray(e)||(e=[e]),o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),s.push(n(t)+"="+n(e))}))}),i=s.join("&")}return i&&(e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t,r){"use strict";var n=r(3);e.exports=function(e){var t,r,o,i={};return e?(n.forEach(e.split("\n"),function(e){o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t&&(i[t]=i[t]?i[t]+", "+r:r)}),i):i}},function(e,t,r){"use strict";var n=r(3);e.exports=function(e,t,r){return n.forEach(r,function(r){e=r(e,t)}),e}},function(e,t,r){"use strict";var n=r(3);e.exports=n.isStandardBrowserEnv()?function(){function e(e){var t=e;return r&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,r=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(r){var o=n.isString(r)?e(r):r;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t){"use strict";function r(e){this.message=e}function n(e){for(var t,n,i=String(e),s="",u=0,a=o;i.charAt(0|u)||(a="=",u%1);s+=a.charAt(63&t>>8-u%1*8)){if(n=i.charCodeAt(u+=.75),n>255)throw new r("INVALID_CHARACTER_ERR: DOM Exception 5");t=t<<8|n}return s}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.prototype=new Error,r.prototype.code=5,r.prototype.name="InvalidCharacterError",e.exports=n},function(e,t,r){"use strict";var n=r(3);e.exports=n.isStandardBrowserEnv()?function(){return{write:function(e,t,r,o,i,s){var u=[];u.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),n.isString(o)&&u.push("path="+o),n.isString(i)&&u.push("domain="+i),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,r){"use strict";function n(){this.handlers=[]}var o=r(3);n.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},n.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},n.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=n},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,"")}},function(e,t){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n undefined\n\t * typeof document -> undefined\n\t *\n\t * react-native:\n\t * typeof document.createelement -> undefined\n\t */\n\tfunction isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}\n\t\n\t/**\n\t * Iterate over an Array or an Object invoking a function for each item.\n\t *\n\t * If `obj` is an Array or arguments callback will be called passing\n\t * the value, index, and complete array for each item.\n\t *\n\t * If 'obj' is an Object callback will be called passing\n\t * the value, key, and complete object for each property.\n\t *\n\t * @param {Object|Array} obj The object to iterate\n\t * @param {Function} fn The callback to invoke for each item\n\t */\n\tfunction forEach(obj, fn) {\n\t // Don't bother if no value provided\n\t if (obj === null || typeof obj === 'undefined') {\n\t return;\n\t }\n\t\n\t // Check if obj is array-like\n\t var isArrayLike = isArray(obj) || isArguments(obj);\n\t\n\t // Force an array if not already something iterable\n\t if (typeof obj !== 'object' && !isArrayLike) {\n\t obj = [obj];\n\t }\n\t\n\t // Iterate over array values\n\t if (isArrayLike) {\n\t for (var i = 0, l = obj.length; i < l; i++) {\n\t fn.call(null, obj[i], i, obj);\n\t }\n\t }\n\t // Iterate over object keys\n\t else {\n\t for (var key in obj) {\n\t if (obj.hasOwnProperty(key)) {\n\t fn.call(null, obj[key], key, obj);\n\t }\n\t }\n\t }\n\t}\n\t\n\t/**\n\t * Accepts varargs expecting each argument to be an object, then\n\t * immutably merges the properties of each object and returns result.\n\t *\n\t * When multiple objects contain the same key the later object in\n\t * the arguments list will take precedence.\n\t *\n\t * Example:\n\t *\n\t * ```js\n\t * var result = merge({foo: 123}, {foo: 456});\n\t * console.log(result.foo); // outputs 456\n\t * ```\n\t *\n\t * @param {Object} obj1 Object to merge\n\t * @returns {Object} Result of all merge properties\n\t */\n\tfunction merge(/*obj1, obj2, obj3, ...*/) {\n\t var result = {};\n\t forEach(arguments, function (obj) {\n\t forEach(obj, function (val, key) {\n\t result[key] = val;\n\t });\n\t });\n\t return result;\n\t}\n\t\n\tmodule.exports = {\n\t isArray: isArray,\n\t isArrayBuffer: isArrayBuffer,\n\t isFormData: isFormData,\n\t isArrayBufferView: isArrayBufferView,\n\t isString: isString,\n\t isNumber: isNumber,\n\t isObject: isObject,\n\t isUndefined: isUndefined,\n\t isDate: isDate,\n\t isFile: isFile,\n\t isBlob: isBlob,\n\t isStandardBrowserEnv: isStandardBrowserEnv,\n\t forEach: forEach,\n\t merge: merge,\n\t trim: trim\n\t};\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {'use strict';\n\t\n\t/**\n\t * Dispatch a request to the server using whichever adapter\n\t * is supported by the current environment.\n\t *\n\t * @param {object} config The config that is to be used for the request\n\t * @returns {Promise} The Promise to be fulfilled\n\t */\n\tmodule.exports = function dispatchRequest(config) {\n\t return new Promise(function (resolve, reject) {\n\t try {\n\t // For browsers use XHR adapter\n\t if ((typeof XMLHttpRequest !== 'undefined') || (typeof ActiveXObject !== 'undefined')) {\n\t __webpack_require__(6)(resolve, reject, config);\n\t }\n\t // For node use HTTP adapter\n\t else if (typeof process !== 'undefined') {\n\t __webpack_require__(6)(resolve, reject, config);\n\t }\n\t } catch (e) {\n\t reject(e);\n\t }\n\t });\n\t};\n\t\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t// shim for using process in browser\n\t\n\tvar process = module.exports = {};\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\t\n\tfunction cleanUpNextTick() {\n\t draining = false;\n\t if (currentQueue.length) {\n\t queue = currentQueue.concat(queue);\n\t } else {\n\t queueIndex = -1;\n\t }\n\t if (queue.length) {\n\t drainQueue();\n\t }\n\t}\n\t\n\tfunction drainQueue() {\n\t if (draining) {\n\t return;\n\t }\n\t var timeout = setTimeout(cleanUpNextTick);\n\t draining = true;\n\t\n\t var len = queue.length;\n\t while(len) {\n\t currentQueue = queue;\n\t queue = [];\n\t while (++queueIndex < len) {\n\t if (currentQueue) {\n\t currentQueue[queueIndex].run();\n\t }\n\t }\n\t queueIndex = -1;\n\t len = queue.length;\n\t }\n\t currentQueue = null;\n\t draining = false;\n\t clearTimeout(timeout);\n\t}\n\t\n\tprocess.nextTick = function (fun) {\n\t var args = new Array(arguments.length - 1);\n\t if (arguments.length > 1) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t args[i - 1] = arguments[i];\n\t }\n\t }\n\t queue.push(new Item(fun, args));\n\t if (queue.length === 1 && !draining) {\n\t setTimeout(drainQueue, 0);\n\t }\n\t};\n\t\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\t\n\tfunction noop() {}\n\t\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\t\n\tprocess.binding = function (name) {\n\t throw new Error('process.binding is not supported');\n\t};\n\t\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t/*global ActiveXObject:true*/\n\t\n\tvar defaults = __webpack_require__(2);\n\tvar utils = __webpack_require__(3);\n\tvar buildUrl = __webpack_require__(7);\n\tvar parseHeaders = __webpack_require__(8);\n\tvar transformData = __webpack_require__(9);\n\t\n\tmodule.exports = function xhrAdapter(resolve, reject, config) {\n\t // Transform request data\n\t var data = transformData(\n\t config.data,\n\t config.headers,\n\t config.transformRequest\n\t );\n\t\n\t // Merge headers\n\t var requestHeaders = utils.merge(\n\t defaults.headers.common,\n\t defaults.headers[config.method] || {},\n\t config.headers || {}\n\t );\n\t\n\t if (utils.isFormData(data)) {\n\t delete requestHeaders['Content-Type']; // Let the browser set it\n\t }\n\t\n\t // Create the request\n\t var request = new (XMLHttpRequest || ActiveXObject)('Microsoft.XMLHTTP');\n\t request.open(config.method.toUpperCase(), buildUrl(config.url, config.params), true);\n\t\n\t // Set the request timeout in MS\n\t request.timeout = config.timeout;\n\t\n\t // Listen for ready state\n\t request.onreadystatechange = function () {\n\t if (request && request.readyState === 4) {\n\t // Prepare the response\n\t var responseHeaders = parseHeaders(request.getAllResponseHeaders());\n\t var responseData = ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response;\n\t var response = {\n\t data: transformData(\n\t responseData,\n\t responseHeaders,\n\t config.transformResponse\n\t ),\n\t status: request.status,\n\t statusText: request.statusText,\n\t headers: responseHeaders,\n\t config: config\n\t };\n\t\n\t // Resolve or reject the Promise based on the status\n\t (request.status >= 200 && request.status < 300 ?\n\t resolve :\n\t reject)(response);\n\t\n\t // Clean up request\n\t request = null;\n\t }\n\t };\n\t\n\t // Add xsrf header\n\t // This is only done if running in a standard browser environment.\n\t // Specifically not if we're in a web worker, or react-native.\n\t if (utils.isStandardBrowserEnv()) {\n\t var cookies = __webpack_require__(10);\n\t var urlIsSameOrigin = __webpack_require__(11);\n\t\n\t // Add xsrf header\n\t var xsrfValue = urlIsSameOrigin(config.url) ?\n\t cookies.read(config.xsrfCookieName || defaults.xsrfCookieName) :\n\t undefined;\n\t\n\t if (xsrfValue) {\n\t requestHeaders[config.xsrfHeaderName || defaults.xsrfHeaderName] = xsrfValue;\n\t }\n\t }\n\t\n\t // Add headers to the request\n\t utils.forEach(requestHeaders, function (val, key) {\n\t // Remove Content-Type if data is undefined\n\t if (!data && key.toLowerCase() === 'content-type') {\n\t delete requestHeaders[key];\n\t }\n\t // Otherwise add header to the request\n\t else {\n\t request.setRequestHeader(key, val);\n\t }\n\t });\n\t\n\t // Add withCredentials to request if needed\n\t if (config.withCredentials) {\n\t request.withCredentials = true;\n\t }\n\t\n\t // Add responseType to request if needed\n\t if (config.responseType) {\n\t try {\n\t request.responseType = config.responseType;\n\t } catch (e) {\n\t if (request.responseType !== 'json') {\n\t throw e;\n\t }\n\t }\n\t }\n\t\n\t if (utils.isArrayBuffer(data)) {\n\t data = new DataView(data);\n\t }\n\t\n\t // Send the request\n\t request.send(data);\n\t};\n\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(3);\n\t\n\tfunction encode(val) {\n\t return encodeURIComponent(val).\n\t replace(/%40/gi, '@').\n\t replace(/%3A/gi, ':').\n\t replace(/%24/g, '$').\n\t replace(/%2C/gi, ',').\n\t replace(/%20/g, '+').\n\t replace(/%5B/gi, '[').\n\t replace(/%5D/gi, ']');\n\t}\n\t\n\t/**\n\t * Build a URL by appending params to the end\n\t *\n\t * @param {string} url The base of the url (e.g., http://www.google.com)\n\t * @param {object} [params] The params to be appended\n\t * @returns {string} The formatted url\n\t */\n\tmodule.exports = function buildUrl(url, params) {\n\t if (!params) {\n\t return url;\n\t }\n\t\n\t var parts = [];\n\t\n\t utils.forEach(params, function (val, key) {\n\t if (val === null || typeof val === 'undefined') {\n\t return;\n\t }\n\t\n\t if (utils.isArray(val)) {\n\t key = key + '[]';\n\t }\n\t\n\t if (!utils.isArray(val)) {\n\t val = [val];\n\t }\n\t\n\t utils.forEach(val, function (v) {\n\t if (utils.isDate(v)) {\n\t v = v.toISOString();\n\t }\n\t else if (utils.isObject(v)) {\n\t v = JSON.stringify(v);\n\t }\n\t parts.push(encode(key) + '=' + encode(v));\n\t });\n\t });\n\t\n\t if (parts.length > 0) {\n\t url += (url.indexOf('?') === -1 ? '?' : '&') + parts.join('&');\n\t }\n\t\n\t return url;\n\t};\n\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(3);\n\t\n\t/**\n\t * Parse headers into an object\n\t *\n\t * ```\n\t * Date: Wed, 27 Aug 2014 08:58:49 GMT\n\t * Content-Type: application/json\n\t * Connection: keep-alive\n\t * Transfer-Encoding: chunked\n\t * ```\n\t *\n\t * @param {String} headers Headers needing to be parsed\n\t * @returns {Object} Headers parsed into an object\n\t */\n\tmodule.exports = function parseHeaders(headers) {\n\t var parsed = {}, key, val, i;\n\t\n\t if (!headers) { return parsed; }\n\t\n\t utils.forEach(headers.split('\\n'), function(line) {\n\t i = line.indexOf(':');\n\t key = utils.trim(line.substr(0, i)).toLowerCase();\n\t val = utils.trim(line.substr(i + 1));\n\t\n\t if (key) {\n\t parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n\t }\n\t });\n\t\n\t return parsed;\n\t};\n\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(3);\n\t\n\t/**\n\t * Transform the data for a request or a response\n\t *\n\t * @param {Object|String} data The data to be transformed\n\t * @param {Array} headers The headers for the request or response\n\t * @param {Array|Function} fns A single function or Array of functions\n\t * @returns {*} The resulting transformed data\n\t */\n\tmodule.exports = function transformData(data, headers, fns) {\n\t utils.forEach(fns, function (fn) {\n\t data = fn(data, headers);\n\t });\n\t\n\t return data;\n\t};\n\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t/**\n\t * WARNING:\n\t * This file makes references to objects that aren't safe in all environments.\n\t * Please see lib/utils.isStandardBrowserEnv before including this file.\n\t */\n\t\n\tvar utils = __webpack_require__(3);\n\t\n\tmodule.exports = {\n\t write: function write(name, value, expires, path, domain, secure) {\n\t var cookie = [];\n\t cookie.push(name + '=' + encodeURIComponent(value));\n\t\n\t if (utils.isNumber(expires)) {\n\t cookie.push('expires=' + new Date(expires).toGMTString());\n\t }\n\t\n\t if (utils.isString(path)) {\n\t cookie.push('path=' + path);\n\t }\n\t\n\t if (utils.isString(domain)) {\n\t cookie.push('domain=' + domain);\n\t }\n\t\n\t if (secure === true) {\n\t cookie.push('secure');\n\t }\n\t\n\t document.cookie = cookie.join('; ');\n\t },\n\t\n\t read: function read(name) {\n\t var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n\t return (match ? decodeURIComponent(match[3]) : null);\n\t },\n\t\n\t remove: function remove(name) {\n\t this.write(name, '', Date.now() - 86400000);\n\t }\n\t};\n\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t/**\n\t * WARNING:\n\t * This file makes references to objects that aren't safe in all environments.\n\t * Please see lib/utils.isStandardBrowserEnv before including this file.\n\t */\n\t\n\tvar utils = __webpack_require__(3);\n\tvar msie = /(msie|trident)/i.test(navigator.userAgent);\n\tvar urlParsingNode = document.createElement('a');\n\tvar originUrl;\n\t\n\t/**\n\t * Parse a URL to discover it's components\n\t *\n\t * @param {String} url The URL to be parsed\n\t * @returns {Object}\n\t */\n\tfunction urlResolve(url) {\n\t var href = url;\n\t\n\t if (msie) {\n\t // IE needs attribute set twice to normalize properties\n\t urlParsingNode.setAttribute('href', href);\n\t href = urlParsingNode.href;\n\t }\n\t\n\t urlParsingNode.setAttribute('href', href);\n\t\n\t // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n\t return {\n\t href: urlParsingNode.href,\n\t protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n\t host: urlParsingNode.host,\n\t search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n\t hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n\t hostname: urlParsingNode.hostname,\n\t port: urlParsingNode.port,\n\t pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n\t urlParsingNode.pathname :\n\t '/' + urlParsingNode.pathname\n\t };\n\t}\n\t\n\toriginUrl = urlResolve(window.location.href);\n\t\n\t/**\n\t * Determine if a URL shares the same origin as the current location\n\t *\n\t * @param {String} requestUrl The URL to test\n\t * @returns {boolean} True if URL shares the same origin, otherwise false\n\t */\n\tmodule.exports = function urlIsSameOrigin(requestUrl) {\n\t var parsed = (utils.isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;\n\t return (parsed.protocol === originUrl.protocol &&\n\t parsed.host === originUrl.host);\n\t};\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(3);\n\t\n\tfunction InterceptorManager() {\n\t this.handlers = [];\n\t}\n\t\n\t/**\n\t * Add a new interceptor to the stack\n\t *\n\t * @param {Function} fulfilled The function to handle `then` for a `Promise`\n\t * @param {Function} rejected The function to handle `reject` for a `Promise`\n\t *\n\t * @return {Number} An ID used to remove interceptor later\n\t */\n\tInterceptorManager.prototype.use = function (fulfilled, rejected) {\n\t this.handlers.push({\n\t fulfilled: fulfilled,\n\t rejected: rejected\n\t });\n\t return this.handlers.length - 1;\n\t};\n\t\n\t/**\n\t * Remove an interceptor from the stack\n\t *\n\t * @param {Number} id The ID that was returned by `use`\n\t */\n\tInterceptorManager.prototype.eject = function (id) {\n\t if (this.handlers[id]) {\n\t this.handlers[id] = null;\n\t }\n\t};\n\t\n\t/**\n\t * Iterate over all the registered interceptors\n\t *\n\t * This method is particularly useful for skipping over any\n\t * interceptors that may have become `null` calling `remove`.\n\t *\n\t * @param {Function} fn The function to call for each interceptor\n\t */\n\tInterceptorManager.prototype.forEach = function (fn) {\n\t utils.forEach(this.handlers, function (h) {\n\t if (h !== null) {\n\t fn(h);\n\t }\n\t });\n\t};\n\t\n\tmodule.exports = InterceptorManager;\n\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Syntactic sugar for invoking a function and expanding an array for arguments.\n\t *\n\t * Common use case would be to use `Function.prototype.apply`.\n\t *\n\t * ```js\n\t * function f(x, y, z) {}\n\t * var args = [1, 2, 3];\n\t * f.apply(null, args);\n\t * ```\n\t *\n\t * With `spread` this example can be re-written.\n\t *\n\t * ```js\n\t * spread(function(x, y, z) {})([1, 2, 3]);\n\t * ```\n\t *\n\t * @param {Function} callback\n\t * @returns {Function}\n\t */\n\tmodule.exports = function spread(callback) {\n\t return function (arr) {\n\t return callback.apply(null, arr);\n\t };\n\t};\n\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** axios.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 03594837b55102c9844b\n **/","module.exports = require('./lib/axios');\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./index.js\n ** module id = 0\n ** module chunks = 0\n **/","'use strict';\n\nvar defaults = require('./defaults');\nvar utils = require('./utils');\nvar dispatchRequest = require('./core/dispatchRequest');\nvar InterceptorManager = require('./core/InterceptorManager');\n\nvar axios = module.exports = function (config) {\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge({\n method: 'get',\n headers: {},\n timeout: defaults.timeout,\n transformRequest: defaults.transformRequest,\n transformResponse: defaults.transformResponse\n }, config);\n\n // Don't allow overriding defaults.withCredentials\n config.withCredentials = config.withCredentials || defaults.withCredentials;\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n axios.interceptors.request.forEach(function (interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n axios.interceptors.response.forEach(function (interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Expose defaults\naxios.defaults = defaults;\n\n// Expose all/spread\naxios.all = function (promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose interceptors\naxios.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n};\n\n// Provide aliases for supported request methods\n(function () {\n function createShortMethods() {\n utils.forEach(arguments, function (method) {\n axios[method] = function (url, config) {\n return axios(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n });\n }\n\n function createShortMethodsWithData() {\n utils.forEach(arguments, function (method) {\n axios[method] = function (url, data, config) {\n return axios(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n });\n }\n\n createShortMethods('delete', 'get', 'head');\n createShortMethodsWithData('post', 'put', 'patch');\n})();\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/axios.js\n ** module id = 1\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./utils');\n\nvar PROTECTION_PREFIX = /^\\)\\]\\}',?\\n/;\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nmodule.exports = {\n transformRequest: [function (data, headers) {\n if(utils.isFormData(data)) {\n return data;\n }\n if (utils.isArrayBuffer(data)) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isObject(data) && !utils.isFile(data) && !utils.isBlob(data)) {\n // Set application/json if no Content-Type has been specified\n if (!utils.isUndefined(headers)) {\n utils.forEach(headers, function (val, key) {\n if (key.toLowerCase() === 'content-type') {\n headers['Content-Type'] = val;\n }\n });\n\n if (utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = 'application/json;charset=utf-8';\n }\n }\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function (data) {\n if (typeof data === 'string') {\n data = data.replace(PROTECTION_PREFIX, '');\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n },\n patch: utils.merge(DEFAULT_CONTENT_TYPE),\n post: utils.merge(DEFAULT_CONTENT_TYPE),\n put: utils.merge(DEFAULT_CONTENT_TYPE)\n },\n\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN'\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/defaults.js\n ** module id = 2\n ** module chunks = 0\n **/","'use strict';\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return toString.call(val) === '[object FormData]';\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n return ArrayBuffer.isView(val);\n } else {\n return (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if a value is an Arguments object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Arguments object, otherwise false\n */\nfunction isArguments(val) {\n return toString.call(val) === '[object Arguments]';\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * typeof document.createelement -> undefined\n */\nfunction isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array or arguments callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Check if obj is array-like\n var isArrayLike = isArray(obj) || isArguments(obj);\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object' && !isArrayLike) {\n obj = [obj];\n }\n\n // Iterate over array values\n if (isArrayLike) {\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n }\n // Iterate over object keys\n else {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/*obj1, obj2, obj3, ...*/) {\n var result = {};\n forEach(arguments, function (obj) {\n forEach(obj, function (val, key) {\n result[key] = val;\n });\n });\n return result;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n trim: trim\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/utils.js\n ** module id = 3\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * Dispatch a request to the server using whichever adapter\n * is supported by the current environment.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n return new Promise(function (resolve, reject) {\n try {\n // For browsers use XHR adapter\n if ((typeof XMLHttpRequest !== 'undefined') || (typeof ActiveXObject !== 'undefined')) {\n require('../adapters/xhr')(resolve, reject, config);\n }\n // For node use HTTP adapter\n else if (typeof process !== 'undefined') {\n require('../adapters/http')(resolve, reject, config);\n }\n } catch (e) {\n reject(e);\n }\n });\n};\n\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/core/dispatchRequest.js\n ** module id = 4\n ** module chunks = 0\n **/","// shim for using process in browser\n\nvar process = module.exports = {};\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = setTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n clearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n setTimeout(drainQueue, 0);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** (webpack)/~/node-libs-browser/~/process/browser.js\n ** module id = 5\n ** module chunks = 0\n **/","'use strict';\n\n/*global ActiveXObject:true*/\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar buildUrl = require('./../helpers/buildUrl');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar transformData = require('./../helpers/transformData');\n\nmodule.exports = function xhrAdapter(resolve, reject, config) {\n // Transform request data\n var data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Merge headers\n var requestHeaders = utils.merge(\n defaults.headers.common,\n defaults.headers[config.method] || {},\n config.headers || {}\n );\n\n if (utils.isFormData(data)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n // Create the request\n var request = new (XMLHttpRequest || ActiveXObject)('Microsoft.XMLHTTP');\n request.open(config.method.toUpperCase(), buildUrl(config.url, config.params), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function () {\n if (request && request.readyState === 4) {\n // Prepare the response\n var responseHeaders = parseHeaders(request.getAllResponseHeaders());\n var responseData = ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response;\n var response = {\n data: transformData(\n responseData,\n responseHeaders,\n config.transformResponse\n ),\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config\n };\n\n // Resolve or reject the Promise based on the status\n (request.status >= 200 && request.status < 300 ?\n resolve :\n reject)(response);\n\n // Clean up request\n request = null;\n }\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n var urlIsSameOrigin = require('./../helpers/urlIsSameOrigin');\n\n // Add xsrf header\n var xsrfValue = urlIsSameOrigin(config.url) ?\n cookies.read(config.xsrfCookieName || defaults.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName || defaults.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n utils.forEach(requestHeaders, function (val, key) {\n // Remove Content-Type if data is undefined\n if (!data && key.toLowerCase() === 'content-type') {\n delete requestHeaders[key];\n }\n // Otherwise add header to the request\n else {\n request.setRequestHeader(key, val);\n }\n });\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n if (request.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n if (utils.isArrayBuffer(data)) {\n data = new DataView(data);\n }\n\n // Send the request\n request.send(data);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/adapters/xhr.js\n ** module id = 6\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildUrl(url, params) {\n if (!params) {\n return url;\n }\n\n var parts = [];\n\n utils.forEach(params, function (val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n }\n\n if (!utils.isArray(val)) {\n val = [val];\n }\n\n utils.forEach(val, function (v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n }\n else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n if (parts.length > 0) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + parts.join('&');\n }\n\n return url;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/buildUrl.js\n ** module id = 7\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {}, key, val, i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/parseHeaders.js\n ** module id = 8\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n utils.forEach(fns, function (fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/transformData.js\n ** module id = 9\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * WARNING:\n * This file makes references to objects that aren't safe in all environments.\n * Please see lib/utils.isStandardBrowserEnv before including this file.\n */\n\nvar utils = require('./../utils');\n\nmodule.exports = {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/cookies.js\n ** module id = 10\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * WARNING:\n * This file makes references to objects that aren't safe in all environments.\n * Please see lib/utils.isStandardBrowserEnv before including this file.\n */\n\nvar utils = require('./../utils');\nvar msie = /(msie|trident)/i.test(navigator.userAgent);\nvar urlParsingNode = document.createElement('a');\nvar originUrl;\n\n/**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\nfunction urlResolve(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n}\n\noriginUrl = urlResolve(window.location.href);\n\n/**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestUrl The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\nmodule.exports = function urlIsSameOrigin(requestUrl) {\n var parsed = (utils.isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;\n return (parsed.protocol === originUrl.protocol &&\n parsed.host === originUrl.host);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/urlIsSameOrigin.js\n ** module id = 11\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function (fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function (id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `remove`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function (fn) {\n utils.forEach(this.handlers, function (h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/core/InterceptorManager.js\n ** module id = 12\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function (arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/spread.js\n ** module id = 13\n ** module chunks = 0\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///axios.min.js","webpack:///webpack/bootstrap 540a1ed1aeec3916d6a7","webpack:///./index.js","webpack:///./lib/axios.js","webpack:///./lib/defaults.js","webpack:///./lib/utils.js","webpack:///./lib/core/dispatchRequest.js","webpack:///./lib/adapters/xhr.js","webpack:///./lib/helpers/buildURL.js","webpack:///./lib/helpers/parseHeaders.js","webpack:///./lib/helpers/transformData.js","webpack:///./lib/helpers/isURLSameOrigin.js","webpack:///./lib/helpers/btoa.js","webpack:///./lib/helpers/cookies.js","webpack:///./lib/core/InterceptorManager.js","webpack:///./lib/helpers/isAbsoluteURL.js","webpack:///./lib/helpers/combineURLs.js","webpack:///./lib/helpers/bind.js","webpack:///./lib/helpers/spread.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","Axios","defaultConfig","utils","merge","headers","timeout","defaults","transformRequest","transformResponse","interceptors","request","InterceptorManager","response","dispatchRequest","isAbsoluteURL","combineURLs","bind","prototype","config","url","arguments","method","baseURL","withCredentials","chain","undefined","promise","Promise","resolve","forEach","interceptor","unshift","fulfilled","rejected","push","length","then","shift","defaultInstance","axios","create","all","promises","spread","data","PROTECTION_PREFIX","DEFAULT_CONTENT_TYPE","Content-Type","isFormData","isArrayBuffer","isArrayBufferView","buffer","isObject","isFile","isBlob","isUndefined","val","key","toLowerCase","JSON","stringify","replace","parse","e","common","Accept","patch","post","put","xsrfCookieName","xsrfHeaderName","isArray","toString","result","ArrayBuffer","isView","isString","isNumber","isDate","trim","str","isStandardBrowserEnv","window","document","createElement","obj","fn","i","l","hasOwnProperty","assignValue","Object","reject","XMLHttpRequest","ActiveXObject","process","buildURL","parseHeaders","transformData","isURLSameOrigin","btoa","requestHeaders","Adapter","loadEvent","xDomain","XDomainRequest","auth","username","password","Authorization","open","toUpperCase","params","paramsSerializer","readyState","responseHeaders","getAllResponseHeaders","responseData","indexOf","responseType","responseText","status","statusText","cookies","xsrfValue","read","setRequestHeader","DataView","send","encode","encodeURIComponent","serializedParams","parts","v","toISOString","join","parsed","split","line","substr","fns","resolveURL","href","msie","urlParsingNode","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","originURL","test","navigator","userAgent","location","requestURL","InvalidCharacterError","message","input","block","charCode","String","output","idx","map","chars","charCodeAt","Error","code","name","write","value","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","handlers","use","eject","h","relativeURL","thisArg","args","Array","apply","callback","arr"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,MAAAD,IAEAD,EAAA,MAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAASL,EAAQD,EAASM,GEtDhCL,EAAAD,QAAAM,EAAA,IF4DM,SAASL,EAAQD,EAASM,GG5DhC,YAUA,SAAAS,GAAAC,GACAZ,KAAAY,cAAAC,EAAAC,OACAC,WACAC,QAAAC,EAAAD,QACAE,iBAAAD,EAAAC,iBACAC,kBAAAF,EAAAE,mBACGP,GAEHZ,KAAAoB,cACAC,QAAA,GAAAC,GACAC,SAAA,GAAAD,IAlBA,GAAAL,GAAAf,EAAA,GACAW,EAAAX,EAAA,GACAsB,EAAAtB,EAAA,GACAoB,EAAApB,EAAA,IACAuB,EAAAvB,EAAA,IACAwB,EAAAxB,EAAA,IACAyB,EAAAzB,EAAA,GAgBAS,GAAAiB,UAAAP,QAAA,SAAAQ,GAGA,gBAAAA,KACAA,EAAAhB,EAAAC,OACAgB,IAAAC,UAAA,IACKA,UAAA,KAGLF,EAAAhB,EAAAC,MAAAd,KAAAY,eAA4CoB,OAAA,OAAgBH,GAE5DA,EAAAI,UAAAR,EAAAI,EAAAC,OACAD,EAAAC,IAAAJ,EAAAG,EAAAI,QAAAJ,EAAAC,MAIAD,EAAAK,gBAAAL,EAAAK,iBAAAjB,EAAAiB,eAGA,IAAAC,IAAAX,EAAAY,QACAC,EAAAC,QAAAC,QAAAV,EAUA,KARA7B,KAAAoB,aAAAC,QAAAmB,QAAA,SAAAC,GACAN,EAAAO,QAAAD,EAAAE,UAAAF,EAAAG,YAGA5C,KAAAoB,aAAAG,SAAAiB,QAAA,SAAAC,GACAN,EAAAU,KAAAJ,EAAAE,UAAAF,EAAAG,YAGAT,EAAAW,QACAT,IAAAU,KAAAZ,EAAAa,QAAAb,EAAAa,QAGA,OAAAX,GAGA,IAAAY,GAAA,GAAAtC,GAEAuC,EAAArD,EAAAD,QAAA+B,EAAAhB,EAAAiB,UAAAP,QAAA4B,EAEAC,GAAAC,OAAA,SAAAvC,GACA,UAAAD,GAAAC,IAIAsC,EAAAjC,WAGAiC,EAAAE,IAAA,SAAAC,GACA,MAAAf,SAAAc,IAAAC,IAEAH,EAAAI,OAAApD,EAAA,IAGAgD,EAAA9B,aAAA6B,EAAA7B,aAGAP,EAAA2B,SAAA,gCAAAR,GAEArB,EAAAiB,UAAAI,GAAA,SAAAF,EAAAD,GACA,MAAA7B,MAAAqB,QAAAR,EAAAC,MAAAe,OACAG,SACAF,UAGAoB,EAAAlB,GAAAL,EAAAhB,EAAAiB,UAAAI,GAAAiB,KAGApC,EAAA2B,SAAA,+BAAAR,GAEArB,EAAAiB,UAAAI,GAAA,SAAAF,EAAAyB,EAAA1B,GACA,MAAA7B,MAAAqB,QAAAR,EAAAC,MAAAe,OACAG,SACAF,MACAyB,WAGAL,EAAAlB,GAAAL,EAAAhB,EAAAiB,UAAAI,GAAAiB,MHoEM,SAASpD,EAAQD,EAASM,GI1KhC,YAEA,IAAAW,GAAAX,EAAA,GAEAsD,EAAA,eACAC,GACAC,eAAA,oCAGA7D,GAAAD,SACAsB,kBAAA,SAAAqC,EAAAxC,GACA,MAAAF,GAAA8C,WAAAJ,GACAA,EAEA1C,EAAA+C,cAAAL,GACAA,EAEA1C,EAAAgD,kBAAAN,GACAA,EAAAO,QAEAjD,EAAAkD,SAAAR,IAAA1C,EAAAmD,OAAAT,IAAA1C,EAAAoD,OAAAV,GAeAA,GAbA1C,EAAAqD,YAAAnD,KACAF,EAAA2B,QAAAzB,EAAA,SAAAoD,EAAAC,GACA,iBAAAA,EAAAC,gBACAtD,EAAA,gBAAAoD,KAIAtD,EAAAqD,YAAAnD,EAAA,mBACAA,EAAA,mDAGAuD,KAAAC,UAAAhB,MAKApC,mBAAA,SAAAoC,GAEA,mBAAAA,GAAA,CACAA,IAAAiB,QAAAhB,EAAA,GACA,KACAD,EAAAe,KAAAG,MAAAlB,GACO,MAAAmB,KAEP,MAAAnB,KAGAxC,SACA4D,QACAC,OAAA,qCAEAC,MAAAhE,EAAAC,MAAA2C,GACAqB,KAAAjE,EAAAC,MAAA2C,GACAsB,IAAAlE,EAAAC,MAAA2C,IAGAzC,QAAA,EAEAgE,eAAA,aACAC,eAAA,iBJkLM,SAASpF,EAAQD,GK/OvB,YAcA,SAAAsF,GAAAf,GACA,yBAAAgB,EAAA5E,KAAA4D,GASA,QAAAP,GAAAO,GACA,+BAAAgB,EAAA5E,KAAA4D,GASA,QAAAR,GAAAQ,GACA,4BAAAgB,EAAA5E,KAAA4D,GASA,QAAAN,GAAAM,GACA,GAAAiB,EAMA,OAJAA,GADA,mBAAAC,0BAAA,OACAA,YAAAC,OAAAnB,GAEA,GAAAA,EAAA,QAAAA,EAAAL,iBAAAuB,aAWA,QAAAE,GAAApB,GACA,sBAAAA,GASA,QAAAqB,GAAArB,GACA,sBAAAA,GASA,QAAAD,GAAAC,GACA,yBAAAA,GASA,QAAAJ,GAAAI,GACA,cAAAA,GAAA,gBAAAA,GASA,QAAAsB,GAAAtB,GACA,wBAAAgB,EAAA5E,KAAA4D,GASA,QAAAH,GAAAG,GACA,wBAAAgB,EAAA5E,KAAA4D,GASA,QAAAF,GAAAE,GACA,wBAAAgB,EAAA5E,KAAA4D,GASA,QAAAuB,GAAAC,GACA,MAAAA,GAAAnB,QAAA,WAAAA,QAAA,WAgBA,QAAAoB,KACA,MACA,mBAAAC,SACA,mBAAAC,WACA,kBAAAA,UAAAC,cAgBA,QAAAvD,GAAAwD,EAAAC,GAEA,UAAAD,GAAA,mBAAAA,GAUA,GALA,gBAAAA,IAAAd,EAAAc,KAEAA,OAGAd,EAAAc,GAEA,OAAAE,GAAA,EAAAC,EAAAH,EAAAlD,OAAmCqD,EAAAD,EAAOA,IAC1CD,EAAA1F,KAAA,KAAAyF,EAAAE,KAAAF,OAIA,QAAA5B,KAAA4B,GACAA,EAAAI,eAAAhC,IACA6B,EAAA1F,KAAA,KAAAyF,EAAA5B,KAAA4B,GAuBA,QAAAlF,KAEA,QAAAuF,GAAAlC,EAAAC,GACAgB,EAAAhB,GAAAD,EAGA,OALAiB,MAKAc,EAAA,EAAAC,EAAApE,UAAAe,OAAuCqD,EAAAD,EAAOA,IAC9C1D,EAAAT,UAAAmE,GAAAG,EAEA,OAAAjB,GAtNA,GAAAD,GAAAmB,OAAA1E,UAAAuD,QAyNAtF,GAAAD,SACAsF,UACAtB,gBACAD,aACAE,oBACA0B,WACAC,WACAzB,WACAG,cACAuB,SACAzB,SACAC,SACA2B,uBACApD,UACA1B,QACA4E,SLuPM,SAAS7F,EAAQD,EAASM,GMrehC,YASAL,GAAAD,QAAA,SAAAiC,GACA,UAAAS,SAAA,SAAAC,EAAAgE,GACA,IACA,mBAAAC,iBAAA,mBAAAC,eAEAvG,EAAA,GAAAqC,EAAAgE,EAAA1E,GACO,mBAAA6E,UAEPxG,EAAA,GAAAqC,EAAAgE,EAAA1E,GAEK,MAAA6C,GACL6B,EAAA7B,QNgfM,SAAS7E,EAAQD,EAASM,GOpgBhC,YAIA,IAAAe,GAAAf,EAAA,GACAW,EAAAX,EAAA,GACAyG,EAAAzG,EAAA,GACA0G,EAAA1G,EAAA,GACA2G,EAAA3G,EAAA,GACA4G,EAAA5G,EAAA,GACA6G,EAAAlB,OAAAkB,MAAA7G,EAAA,GAEAL,GAAAD,QAAA,SAAA2C,EAAAgE,EAAA1E,GAEA,GAAA0B,GAAAsD,EACAhF,EAAA0B,KACA1B,EAAAd,QACAc,EAAAX,kBAIA8F,EAAAnG,EAAAC,MACAG,EAAAF,QAAA4D,OACA1D,EAAAF,QAAAc,EAAAG,YACAH,EAAAd,YAGAF,GAAA8C,WAAAJ,UACAyD,GAAA,eAGA,IAAAC,GAAAT,gBAAAC,cACAS,EAAA,qBACAC,GAAA,CAUA,KAPAL,EAAAjF,EAAAC,MAAA+D,OAAAuB,iBACAH,EAAApB,OAAAuB,eACAF,EAAA,SACAC,GAAA,GAIAtF,EAAAwF,KAAA,CACA,GAAAC,GAAAzF,EAAAwF,KAAAC,UAAA,GACAC,EAAA1F,EAAAwF,KAAAE,UAAA,EACAP,GAAAQ,cAAA,SAAAT,EAAAO,EAAA,IAAAC,GAIA,GAAAlG,GAAA,GAAA4F,GAAA,oBAoCA,IAnCA5F,EAAAoG,KAAA5F,EAAAG,OAAA0F,cAAAf,EAAA9E,EAAAC,IAAAD,EAAA8F,OAAA9F,EAAA+F,mBAAA,GAGAvG,EAAAL,QAAAa,EAAAb,QAGAK,EAAA6F,GAAA,WACA,GAAA7F,IAAA,IAAAA,EAAAwG,YAAAV,GAAA,CAEA,GAAAW,GAAAX,EAAA,KAAAP,EAAAvF,EAAA0G,yBACAC,EAAA,iBAAAC,QAAApG,EAAAqG,cAAA,IAAA7G,EAAA8G,aAAA9G,EAAAE,SACAA,GACAgC,KAAAsD,EACAmB,EACAF,EACAjG,EAAAV,mBAEAiH,OAAA/G,EAAA+G,OACAC,WAAAhH,EAAAgH,WACAtH,QAAA+G,EACAjG,WAGAR,EAAA+G,QAAA,KAAA/G,EAAA+G,OAAA,KAAAjB,GAAA9F,EAAA8G,aACA5F,EACAgE,GAAAhF,GAGAF,EAAA,OAOAR,EAAA+E,uBAAA,CACA,GAAA0C,GAAApI,EAAA,IAGAqI,EAAA1G,EAAAK,iBAAA4E,EAAAjF,EAAAC,KACAwG,EAAAE,KAAA3G,EAAAmD,gBAAA/D,EAAA+D,gBACA5C,MAEAmG,KACAvB,EAAAnF,EAAAoD,gBAAAhE,EAAAgE,gBAAAsD,GAuBA,GAlBApB,GACAtG,EAAA2B,QAAAwE,EAAA,SAAA7C,EAAAC,GACAb,GAAA,iBAAAa,EAAAC,cAKAhD,EAAAoH,iBAAArE,EAAAD,SAHA6C,GAAA5C,KASAvC,EAAAK,kBACAb,EAAAa,iBAAA,GAIAL,EAAAqG,aACA,IACA7G,EAAA6G,aAAArG,EAAAqG,aACK,MAAAxD,GACL,YAAArD,EAAA6G,aACA,KAAAxD,GAKA7D,EAAA+C,cAAAL,KACAA,EAAA,GAAAmF,UAAAnF,IAIAlC,EAAAsH,KAAApF,KP4gBM,SAAS1D,EAAQD,EAASM,GQjpBhC,YAIA,SAAA0I,GAAAzE,GACA,MAAA0E,oBAAA1E,GACAK,QAAA,aACAA,QAAA,aACAA,QAAA,YACAA,QAAA,aACAA,QAAA,YACAA,QAAA,aACAA,QAAA,aAVA,GAAA3D,GAAAX,EAAA,EAoBAL,GAAAD,QAAA,SAAAkC,EAAA6F,EAAAC,GAEA,IAAAD,EACA,MAAA7F,EAGA,IAAAgH,EACA,IAAAlB,EACAkB,EAAAlB,EAAAD,OACG,CACH,GAAAoB,KAEAlI,GAAA2B,QAAAmF,EAAA,SAAAxD,EAAAC,GACA,OAAAD,GAAA,mBAAAA,KAIAtD,EAAAqE,QAAAf,KACAC,GAAA,MAGAvD,EAAAqE,QAAAf,KACAA,OAGAtD,EAAA2B,QAAA2B,EAAA,SAAA6E,GACAnI,EAAA4E,OAAAuD,GACAA,IAAAC,cACSpI,EAAAkD,SAAAiF,KACTA,EAAA1E,KAAAC,UAAAyE,IAEAD,EAAAlG,KAAA+F,EAAAxE,GAAA,IAAAwE,EAAAI,SAIAF,EAAAC,EAAAG,KAAA,KAOA,MAJAJ,KACAhH,IAAA,KAAAA,EAAAmG,QAAA,cAAAa,GAGAhH,IR0pBM,SAASjC,EAAQD,EAASM,GS1tBhC,YAEA,IAAAW,GAAAX,EAAA,EAeAL,GAAAD,QAAA,SAAAmB,GACA,GACAqD,GACAD,EACA+B,EAHAiD,IAKA,OAAApI,IAEAF,EAAA2B,QAAAzB,EAAAqI,MAAA,eAAAC,GACAnD,EAAAmD,EAAApB,QAAA,KACA7D,EAAAvD,EAAA6E,KAAA2D,EAAAC,OAAA,EAAApD,IAAA7B,cACAF,EAAAtD,EAAA6E,KAAA2D,EAAAC,OAAApD,EAAA,IAEA9B,IACA+E,EAAA/E,GAAA+E,EAAA/E,GAAA+E,EAAA/E,GAAA,KAAAD,OAIAgF,GAZiBA,IT8uBX,SAAStJ,EAAQD,EAASM,GUrwBhC,YAEA,IAAAW,GAAAX,EAAA,EAUAL,GAAAD,QAAA,SAAA2D,EAAAxC,EAAAwI,GAMA,MAJA1I,GAAA2B,QAAA+G,EAAA,SAAAtD,GACA1C,EAAA0C,EAAA1C,EAAAxC,KAGAwC,IV6wBM,SAAS1D,EAAQD,EAASM,GW/xBhC,YAEA,IAAAW,GAAAX,EAAA,EAEAL,GAAAD,QACAiB,EAAA+E,uBAIA,WAWA,QAAA4D,GAAA1H,GACA,GAAA2H,GAAA3H,CAWA,OATA4H,KAEAC,EAAAC,aAAA,OAAAH,GACAA,EAAAE,EAAAF,MAGAE,EAAAC,aAAA,OAAAH,IAIAA,KAAAE,EAAAF,KACAI,SAAAF,EAAAE,SAAAF,EAAAE,SAAArF,QAAA,YACAsF,KAAAH,EAAAG,KACAC,OAAAJ,EAAAI,OAAAJ,EAAAI,OAAAvF,QAAA,aACAwF,KAAAL,EAAAK,KAAAL,EAAAK,KAAAxF,QAAA,YACAyF,SAAAN,EAAAM,SACAC,KAAAP,EAAAO,KACAC,SAAA,MAAAR,EAAAQ,SAAAC,OAAA,GACAT,EAAAQ,SACA,IAAAR,EAAAQ,UAhCA,GAEAE,GAFAX,EAAA,kBAAAY,KAAAC,UAAAC,WACAb,EAAA7D,SAAAC,cAAA,IA2CA,OARAsE,GAAAb,EAAA3D,OAAA4E,SAAAhB,MAQA,SAAAiB,GACA,GAAAvB,GAAAtI,EAAA0E,SAAAmF,GAAAlB,EAAAkB,IACA,OAAAvB,GAAAU,WAAAQ,EAAAR,UACAV,EAAAW,OAAAO,EAAAP,SAKA,WACA,kBACA,cXyyBM,SAASjK,EAAQD,GYz2BvB,YAMA,SAAA+K,GAAAC,GACA5K,KAAA4K,UAMA,QAAA7D,GAAA8D,GAGA,IAEA,GAAAC,GAAAC,EAJApF,EAAAqF,OAAAH,GACAI,EAAA,GAGAC,EAAA,EAAAC,EAAAC,EAIAzF,EAAAyE,OAAA,EAAAc,KAAAC,EAAA,IAAAD,EAAA,GAEAD,GAAAE,EAAAf,OAAA,GAAAU,GAAA,EAAAI,EAAA,KACA,CAEA,GADAH,EAAApF,EAAA0F,WAAAH,GAAA,KACAH,EAAA,IACA,SAAAJ,GAAA,yCAEAG,MAAA,EAAAC,EAEA,MAAAE,GA5BA,GAAAG,GAAA,mEAKAT,GAAA/I,UAAA,GAAA0J,OACAX,EAAA/I,UAAA2J,KAAA,EACAZ,EAAA/I,UAAA4J,KAAA,wBAwBA3L,EAAAD,QAAAmH,GZg3BM,SAASlH,EAAQD,EAASM,Gan5BhC,YAEA,IAAAW,GAAAX,EAAA,EAEAL,GAAAD,QACAiB,EAAA+E,uBAGA,WACA,OACA6F,MAAA,SAAAD,EAAAE,EAAAC,EAAAC,EAAAC,EAAAC,GACA,GAAAC,KACAA,GAAAlJ,KAAA2I,EAAA,IAAA3C,mBAAA6C,IAEA7K,EAAA2E,SAAAmG,IACAI,EAAAlJ,KAAA,cAAAmJ,MAAAL,GAAAM,eAGApL,EAAA0E,SAAAqG,IACAG,EAAAlJ,KAAA,QAAA+I,GAGA/K,EAAA0E,SAAAsG,IACAE,EAAAlJ,KAAA,UAAAgJ,GAGAC,KAAA,GACAC,EAAAlJ,KAAA,UAGAiD,SAAAiG,SAAA7C,KAAA,OAGAV,KAAA,SAAAgD,GACA,GAAAU,GAAApG,SAAAiG,OAAAG,MAAA,GAAAC,QAAA,aAA0DX,EAAA,aAC1D,OAAAU,GAAAE,mBAAAF,EAAA,UAGAG,OAAA,SAAAb,GACAxL,KAAAyL,MAAAD,EAAA,GAAAQ,KAAAM,MAAA,YAMA,WACA,OACAb,MAAA,aACAjD,KAAA,WAA6B,aAC7B6D,OAAA,kBb65BM,SAASxM,EAAQD,EAASM,Gc98BhC,YAIA,SAAAoB,KACAtB,KAAAuM,YAHA,GAAA1L,GAAAX,EAAA,EAcAoB,GAAAM,UAAA4K,IAAA,SAAA7J,EAAAC,GAKA,MAJA5C,MAAAuM,SAAA1J,MACAF,YACAC,aAEA5C,KAAAuM,SAAAzJ,OAAA,GAQAxB,EAAAM,UAAA6K,MAAA,SAAApM,GACAL,KAAAuM,SAAAlM,KACAL,KAAAuM,SAAAlM,GAAA,OAYAiB,EAAAM,UAAAY,QAAA,SAAAyD,GACApF,EAAA2B,QAAAxC,KAAAuM,SAAA,SAAAG,GACA,OAAAA,GACAzG,EAAAyG,MAKA7M,EAAAD,QAAA0B,Gdq9BM,SAASzB,EAAQD,GexgCvB,YAQAC,GAAAD,QAAA,SAAAkC,GAIA,sCAAAwI,KAAAxI,KfghCM,SAASjC,EAAQD,GgB5hCvB,YASAC,GAAAD,QAAA,SAAAqC,EAAA0K,GACA,MAAA1K,GAAAuC,QAAA,eAAAmI,EAAAnI,QAAA,ahBoiCM,SAAS3E,EAAQD,GiB9iCvB,YAEAC,GAAAD,QAAA,SAAAqG,EAAA2G,GACA,kBAEA,OADAC,GAAA,GAAAC,OAAA/K,UAAAe,QACAoD,EAAA,EAAmBA,EAAA2G,EAAA/J,OAAiBoD,IACpC2G,EAAA3G,GAAAnE,UAAAmE,EAEA,OAAAD,GAAA8G,MAAAH,EAAAC,MjBujCM,SAAShN,EAAQD,GkB/jCvB,YAsBAC,GAAAD,QAAA,SAAAoN,GACA,gBAAAC,GACA,MAAAD,GAAAD,MAAA,KAAAE","file":"axios.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(1);\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar defaults = __webpack_require__(2);\n\tvar utils = __webpack_require__(3);\n\tvar dispatchRequest = __webpack_require__(4);\n\tvar InterceptorManager = __webpack_require__(12);\n\tvar isAbsoluteURL = __webpack_require__(13);\n\tvar combineURLs = __webpack_require__(14);\n\tvar bind = __webpack_require__(15);\n\t\n\tfunction Axios(defaultConfig) {\n\t this.defaultConfig = utils.merge({\n\t headers: {},\n\t timeout: defaults.timeout,\n\t transformRequest: defaults.transformRequest,\n\t transformResponse: defaults.transformResponse\n\t }, defaultConfig);\n\t\n\t this.interceptors = {\n\t request: new InterceptorManager(),\n\t response: new InterceptorManager()\n\t };\n\t}\n\t\n\tAxios.prototype.request = function request(config) {\n\t /*eslint no-param-reassign:0*/\n\t // Allow for axios('example/url'[, config]) a la fetch API\n\t if (typeof config === 'string') {\n\t config = utils.merge({\n\t url: arguments[0]\n\t }, arguments[1]);\n\t }\n\t\n\t config = utils.merge(this.defaultConfig, { method: 'get' }, config);\n\t\n\t if (config.baseURL && !isAbsoluteURL(config.url)) {\n\t config.url = combineURLs(config.baseURL, config.url);\n\t }\n\t\n\t // Don't allow overriding defaults.withCredentials\n\t config.withCredentials = config.withCredentials || defaults.withCredentials;\n\t\n\t // Hook up interceptors middleware\n\t var chain = [dispatchRequest, undefined];\n\t var promise = Promise.resolve(config);\n\t\n\t this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n\t chain.unshift(interceptor.fulfilled, interceptor.rejected);\n\t });\n\t\n\t this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n\t chain.push(interceptor.fulfilled, interceptor.rejected);\n\t });\n\t\n\t while (chain.length) {\n\t promise = promise.then(chain.shift(), chain.shift());\n\t }\n\t\n\t return promise;\n\t};\n\t\n\tvar defaultInstance = new Axios();\n\t\n\tvar axios = module.exports = bind(Axios.prototype.request, defaultInstance);\n\t\n\taxios.create = function create(defaultConfig) {\n\t return new Axios(defaultConfig);\n\t};\n\t\n\t// Expose defaults\n\taxios.defaults = defaults;\n\t\n\t// Expose all/spread\n\taxios.all = function all(promises) {\n\t return Promise.all(promises);\n\t};\n\taxios.spread = __webpack_require__(16);\n\t\n\t// Expose interceptors\n\taxios.interceptors = defaultInstance.interceptors;\n\t\n\t// Provide aliases for supported request methods\n\tutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n\t /*eslint func-names:0*/\n\t Axios.prototype[method] = function(url, config) {\n\t return this.request(utils.merge(config || {}, {\n\t method: method,\n\t url: url\n\t }));\n\t };\n\t axios[method] = bind(Axios.prototype[method], defaultInstance);\n\t});\n\t\n\tutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n\t /*eslint func-names:0*/\n\t Axios.prototype[method] = function(url, data, config) {\n\t return this.request(utils.merge(config || {}, {\n\t method: method,\n\t url: url,\n\t data: data\n\t }));\n\t };\n\t axios[method] = bind(Axios.prototype[method], defaultInstance);\n\t});\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(3);\n\t\n\tvar PROTECTION_PREFIX = /^\\)\\]\\}',?\\n/;\n\tvar DEFAULT_CONTENT_TYPE = {\n\t 'Content-Type': 'application/x-www-form-urlencoded'\n\t};\n\t\n\tmodule.exports = {\n\t transformRequest: [function transformResponseJSON(data, headers) {\n\t if (utils.isFormData(data)) {\n\t return data;\n\t }\n\t if (utils.isArrayBuffer(data)) {\n\t return data;\n\t }\n\t if (utils.isArrayBufferView(data)) {\n\t return data.buffer;\n\t }\n\t if (utils.isObject(data) && !utils.isFile(data) && !utils.isBlob(data)) {\n\t // Set application/json if no Content-Type has been specified\n\t if (!utils.isUndefined(headers)) {\n\t utils.forEach(headers, function processContentTypeHeader(val, key) {\n\t if (key.toLowerCase() === 'content-type') {\n\t headers['Content-Type'] = val;\n\t }\n\t });\n\t\n\t if (utils.isUndefined(headers['Content-Type'])) {\n\t headers['Content-Type'] = 'application/json;charset=utf-8';\n\t }\n\t }\n\t return JSON.stringify(data);\n\t }\n\t return data;\n\t }],\n\t\n\t transformResponse: [function transformResponseJSON(data) {\n\t /*eslint no-param-reassign:0*/\n\t if (typeof data === 'string') {\n\t data = data.replace(PROTECTION_PREFIX, '');\n\t try {\n\t data = JSON.parse(data);\n\t } catch (e) { /* Ignore */ }\n\t }\n\t return data;\n\t }],\n\t\n\t headers: {\n\t common: {\n\t 'Accept': 'application/json, text/plain, */*'\n\t },\n\t patch: utils.merge(DEFAULT_CONTENT_TYPE),\n\t post: utils.merge(DEFAULT_CONTENT_TYPE),\n\t put: utils.merge(DEFAULT_CONTENT_TYPE)\n\t },\n\t\n\t timeout: 0,\n\t\n\t xsrfCookieName: 'XSRF-TOKEN',\n\t xsrfHeaderName: 'X-XSRF-TOKEN'\n\t};\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t/*global toString:true*/\n\t\n\t// utils is a library of generic helper functions non-specific to axios\n\t\n\tvar toString = Object.prototype.toString;\n\t\n\t/**\n\t * Determine if a value is an Array\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an Array, otherwise false\n\t */\n\tfunction isArray(val) {\n\t return toString.call(val) === '[object Array]';\n\t}\n\t\n\t/**\n\t * Determine if a value is an ArrayBuffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n\t */\n\tfunction isArrayBuffer(val) {\n\t return toString.call(val) === '[object ArrayBuffer]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a FormData\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an FormData, otherwise false\n\t */\n\tfunction isFormData(val) {\n\t return toString.call(val) === '[object FormData]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a view on an ArrayBuffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n\t */\n\tfunction isArrayBufferView(val) {\n\t var result;\n\t if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n\t result = ArrayBuffer.isView(val);\n\t } else {\n\t result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Determine if a value is a String\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a String, otherwise false\n\t */\n\tfunction isString(val) {\n\t return typeof val === 'string';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Number\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Number, otherwise false\n\t */\n\tfunction isNumber(val) {\n\t return typeof val === 'number';\n\t}\n\t\n\t/**\n\t * Determine if a value is undefined\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if the value is undefined, otherwise false\n\t */\n\tfunction isUndefined(val) {\n\t return typeof val === 'undefined';\n\t}\n\t\n\t/**\n\t * Determine if a value is an Object\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an Object, otherwise false\n\t */\n\tfunction isObject(val) {\n\t return val !== null && typeof val === 'object';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Date\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Date, otherwise false\n\t */\n\tfunction isDate(val) {\n\t return toString.call(val) === '[object Date]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a File\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a File, otherwise false\n\t */\n\tfunction isFile(val) {\n\t return toString.call(val) === '[object File]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Blob\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Blob, otherwise false\n\t */\n\tfunction isBlob(val) {\n\t return toString.call(val) === '[object Blob]';\n\t}\n\t\n\t/**\n\t * Trim excess whitespace off the beginning and end of a string\n\t *\n\t * @param {String} str The String to trim\n\t * @returns {String} The String freed of excess whitespace\n\t */\n\tfunction trim(str) {\n\t return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n\t}\n\t\n\t/**\n\t * Determine if we're running in a standard browser environment\n\t *\n\t * This allows axios to run in a web worker, and react-native.\n\t * Both environments support XMLHttpRequest, but not fully standard globals.\n\t *\n\t * web workers:\n\t * typeof window -> undefined\n\t * typeof document -> undefined\n\t *\n\t * react-native:\n\t * typeof document.createElement -> undefined\n\t */\n\tfunction isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}\n\t\n\t/**\n\t * Iterate over an Array or an Object invoking a function for each item.\n\t *\n\t * If `obj` is an Array callback will be called passing\n\t * the value, index, and complete array for each item.\n\t *\n\t * If 'obj' is an Object callback will be called passing\n\t * the value, key, and complete object for each property.\n\t *\n\t * @param {Object|Array} obj The object to iterate\n\t * @param {Function} fn The callback to invoke for each item\n\t */\n\tfunction forEach(obj, fn) {\n\t // Don't bother if no value provided\n\t if (obj === null || typeof obj === 'undefined') {\n\t return;\n\t }\n\t\n\t // Force an array if not already something iterable\n\t if (typeof obj !== 'object' && !isArray(obj)) {\n\t /*eslint no-param-reassign:0*/\n\t obj = [obj];\n\t }\n\t\n\t if (isArray(obj)) {\n\t // Iterate over array values\n\t for (var i = 0, l = obj.length; i < l; i++) {\n\t fn.call(null, obj[i], i, obj);\n\t }\n\t } else {\n\t // Iterate over object keys\n\t for (var key in obj) {\n\t if (obj.hasOwnProperty(key)) {\n\t fn.call(null, obj[key], key, obj);\n\t }\n\t }\n\t }\n\t}\n\t\n\t/**\n\t * Accepts varargs expecting each argument to be an object, then\n\t * immutably merges the properties of each object and returns result.\n\t *\n\t * When multiple objects contain the same key the later object in\n\t * the arguments list will take precedence.\n\t *\n\t * Example:\n\t *\n\t * ```js\n\t * var result = merge({foo: 123}, {foo: 456});\n\t * console.log(result.foo); // outputs 456\n\t * ```\n\t *\n\t * @param {Object} obj1 Object to merge\n\t * @returns {Object} Result of all merge properties\n\t */\n\tfunction merge(/* obj1, obj2, obj3, ... */) {\n\t var result = {};\n\t function assignValue(val, key) {\n\t result[key] = val;\n\t }\n\t\n\t for (var i = 0, l = arguments.length; i < l; i++) {\n\t forEach(arguments[i], assignValue);\n\t }\n\t return result;\n\t}\n\t\n\tmodule.exports = {\n\t isArray: isArray,\n\t isArrayBuffer: isArrayBuffer,\n\t isFormData: isFormData,\n\t isArrayBufferView: isArrayBufferView,\n\t isString: isString,\n\t isNumber: isNumber,\n\t isObject: isObject,\n\t isUndefined: isUndefined,\n\t isDate: isDate,\n\t isFile: isFile,\n\t isBlob: isBlob,\n\t isStandardBrowserEnv: isStandardBrowserEnv,\n\t forEach: forEach,\n\t merge: merge,\n\t trim: trim\n\t};\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t/**\n\t * Dispatch a request to the server using whichever adapter\n\t * is supported by the current environment.\n\t *\n\t * @param {object} config The config that is to be used for the request\n\t * @returns {Promise} The Promise to be fulfilled\n\t */\n\tmodule.exports = function dispatchRequest(config) {\n\t return new Promise(function executor(resolve, reject) {\n\t try {\n\t if ((typeof XMLHttpRequest !== 'undefined') || (typeof ActiveXObject !== 'undefined')) {\n\t // For browsers use XHR adapter\n\t __webpack_require__(5)(resolve, reject, config);\n\t } else if (typeof process !== 'undefined') {\n\t // For node use HTTP adapter\n\t __webpack_require__(5)(resolve, reject, config);\n\t }\n\t } catch (e) {\n\t reject(e);\n\t }\n\t });\n\t};\n\t\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t/*global ActiveXObject:true*/\n\t\n\tvar defaults = __webpack_require__(2);\n\tvar utils = __webpack_require__(3);\n\tvar buildURL = __webpack_require__(6);\n\tvar parseHeaders = __webpack_require__(7);\n\tvar transformData = __webpack_require__(8);\n\tvar isURLSameOrigin = __webpack_require__(9);\n\tvar btoa = window.btoa || __webpack_require__(10);\n\t\n\tmodule.exports = function xhrAdapter(resolve, reject, config) {\n\t // Transform request data\n\t var data = transformData(\n\t config.data,\n\t config.headers,\n\t config.transformRequest\n\t );\n\t\n\t // Merge headers\n\t var requestHeaders = utils.merge(\n\t defaults.headers.common,\n\t defaults.headers[config.method] || {},\n\t config.headers || {}\n\t );\n\t\n\t if (utils.isFormData(data)) {\n\t delete requestHeaders['Content-Type']; // Let the browser set it\n\t }\n\t\n\t var Adapter = (XMLHttpRequest || ActiveXObject);\n\t var loadEvent = 'onreadystatechange';\n\t var xDomain = false;\n\t\n\t // For IE 8/9 CORS support\n\t if (!isURLSameOrigin(config.url) && window.XDomainRequest) {\n\t Adapter = window.XDomainRequest;\n\t loadEvent = 'onload';\n\t xDomain = true;\n\t }\n\t\n\t // HTTP basic authentication\n\t if (config.auth) {\n\t var username = config.auth.username || '';\n\t var password = config.auth.password || '';\n\t requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n\t }\n\t\n\t // Create the request\n\t var request = new Adapter('Microsoft.XMLHTTP');\n\t request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\t\n\t // Set the request timeout in MS\n\t request.timeout = config.timeout;\n\t\n\t // Listen for ready state\n\t request[loadEvent] = function handleReadyState() {\n\t if (request && (request.readyState === 4 || xDomain)) {\n\t // Prepare the response\n\t var responseHeaders = xDomain ? null : parseHeaders(request.getAllResponseHeaders());\n\t var responseData = ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response;\n\t var response = {\n\t data: transformData(\n\t responseData,\n\t responseHeaders,\n\t config.transformResponse\n\t ),\n\t status: request.status,\n\t statusText: request.statusText,\n\t headers: responseHeaders,\n\t config: config\n\t };\n\t // Resolve or reject the Promise based on the status\n\t ((request.status >= 200 && request.status < 300) || (xDomain && request.responseText) ?\n\t resolve :\n\t reject)(response);\n\t\n\t // Clean up request\n\t request = null;\n\t }\n\t };\n\t\n\t // Add xsrf header\n\t // This is only done if running in a standard browser environment.\n\t // Specifically not if we're in a web worker, or react-native.\n\t if (utils.isStandardBrowserEnv()) {\n\t var cookies = __webpack_require__(11);\n\t\n\t // Add xsrf header\n\t var xsrfValue = config.withCredentials || isURLSameOrigin(config.url) ?\n\t cookies.read(config.xsrfCookieName || defaults.xsrfCookieName) :\n\t undefined;\n\t\n\t if (xsrfValue) {\n\t requestHeaders[config.xsrfHeaderName || defaults.xsrfHeaderName] = xsrfValue;\n\t }\n\t }\n\t\n\t // Add headers to the request\n\t if (!xDomain) {\n\t utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n\t if (!data && key.toLowerCase() === 'content-type') {\n\t // Remove Content-Type if data is undefined\n\t delete requestHeaders[key];\n\t } else {\n\t // Otherwise add header to the request\n\t request.setRequestHeader(key, val);\n\t }\n\t });\n\t }\n\t\n\t // Add withCredentials to request if needed\n\t if (config.withCredentials) {\n\t request.withCredentials = true;\n\t }\n\t\n\t // Add responseType to request if needed\n\t if (config.responseType) {\n\t try {\n\t request.responseType = config.responseType;\n\t } catch (e) {\n\t if (request.responseType !== 'json') {\n\t throw e;\n\t }\n\t }\n\t }\n\t\n\t if (utils.isArrayBuffer(data)) {\n\t data = new DataView(data);\n\t }\n\t\n\t // Send the request\n\t request.send(data);\n\t};\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(3);\n\t\n\tfunction encode(val) {\n\t return encodeURIComponent(val).\n\t replace(/%40/gi, '@').\n\t replace(/%3A/gi, ':').\n\t replace(/%24/g, '$').\n\t replace(/%2C/gi, ',').\n\t replace(/%20/g, '+').\n\t replace(/%5B/gi, '[').\n\t replace(/%5D/gi, ']');\n\t}\n\t\n\t/**\n\t * Build a URL by appending params to the end\n\t *\n\t * @param {string} url The base of the url (e.g., http://www.google.com)\n\t * @param {object} [params] The params to be appended\n\t * @returns {string} The formatted url\n\t */\n\tmodule.exports = function buildURL(url, params, paramsSerializer) {\n\t /*eslint no-param-reassign:0*/\n\t if (!params) {\n\t return url;\n\t }\n\t\n\t var serializedParams;\n\t if (paramsSerializer) {\n\t serializedParams = paramsSerializer(params);\n\t } else {\n\t var parts = [];\n\t\n\t utils.forEach(params, function serialize(val, key) {\n\t if (val === null || typeof val === 'undefined') {\n\t return;\n\t }\n\t\n\t if (utils.isArray(val)) {\n\t key = key + '[]';\n\t }\n\t\n\t if (!utils.isArray(val)) {\n\t val = [val];\n\t }\n\t\n\t utils.forEach(val, function parseValue(v) {\n\t if (utils.isDate(v)) {\n\t v = v.toISOString();\n\t } else if (utils.isObject(v)) {\n\t v = JSON.stringify(v);\n\t }\n\t parts.push(encode(key) + '=' + encode(v));\n\t });\n\t });\n\t\n\t serializedParams = parts.join('&');\n\t }\n\t\n\t if (serializedParams) {\n\t url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n\t }\n\t\n\t return url;\n\t};\n\t\n\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(3);\n\t\n\t/**\n\t * Parse headers into an object\n\t *\n\t * ```\n\t * Date: Wed, 27 Aug 2014 08:58:49 GMT\n\t * Content-Type: application/json\n\t * Connection: keep-alive\n\t * Transfer-Encoding: chunked\n\t * ```\n\t *\n\t * @param {String} headers Headers needing to be parsed\n\t * @returns {Object} Headers parsed into an object\n\t */\n\tmodule.exports = function parseHeaders(headers) {\n\t var parsed = {};\n\t var key;\n\t var val;\n\t var i;\n\t\n\t if (!headers) { return parsed; }\n\t\n\t utils.forEach(headers.split('\\n'), function parser(line) {\n\t i = line.indexOf(':');\n\t key = utils.trim(line.substr(0, i)).toLowerCase();\n\t val = utils.trim(line.substr(i + 1));\n\t\n\t if (key) {\n\t parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n\t }\n\t });\n\t\n\t return parsed;\n\t};\n\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(3);\n\t\n\t/**\n\t * Transform the data for a request or a response\n\t *\n\t * @param {Object|String} data The data to be transformed\n\t * @param {Array} headers The headers for the request or response\n\t * @param {Array|Function} fns A single function or Array of functions\n\t * @returns {*} The resulting transformed data\n\t */\n\tmodule.exports = function transformData(data, headers, fns) {\n\t /*eslint no-param-reassign:0*/\n\t utils.forEach(fns, function transform(fn) {\n\t data = fn(data, headers);\n\t });\n\t\n\t return data;\n\t};\n\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(3);\n\t\n\tmodule.exports = (\n\t utils.isStandardBrowserEnv() ?\n\t\n\t // Standard browser envs have full support of the APIs needed to test\n\t // whether the request URL is of the same origin as current location.\n\t (function standardBrowserEnv() {\n\t var msie = /(msie|trident)/i.test(navigator.userAgent);\n\t var urlParsingNode = document.createElement('a');\n\t var originURL;\n\t\n\t /**\n\t * Parse a URL to discover it's components\n\t *\n\t * @param {String} url The URL to be parsed\n\t * @returns {Object}\n\t */\n\t function resolveURL(url) {\n\t var href = url;\n\t\n\t if (msie) {\n\t // IE needs attribute set twice to normalize properties\n\t urlParsingNode.setAttribute('href', href);\n\t href = urlParsingNode.href;\n\t }\n\t\n\t urlParsingNode.setAttribute('href', href);\n\t\n\t // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n\t return {\n\t href: urlParsingNode.href,\n\t protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n\t host: urlParsingNode.host,\n\t search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n\t hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n\t hostname: urlParsingNode.hostname,\n\t port: urlParsingNode.port,\n\t pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n\t urlParsingNode.pathname :\n\t '/' + urlParsingNode.pathname\n\t };\n\t }\n\t\n\t originURL = resolveURL(window.location.href);\n\t\n\t /**\n\t * Determine if a URL shares the same origin as the current location\n\t *\n\t * @param {String} requestURL The URL to test\n\t * @returns {boolean} True if URL shares the same origin, otherwise false\n\t */\n\t return function isURLSameOrigin(requestURL) {\n\t var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n\t return (parsed.protocol === originURL.protocol &&\n\t parsed.host === originURL.host);\n\t };\n\t })() :\n\t\n\t // Non standard browser envs (web workers, react-native) lack needed support.\n\t (function nonStandardBrowserEnv() {\n\t return function isURLSameOrigin() {\n\t return true;\n\t };\n\t })()\n\t);\n\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\t\n\tvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\t\n\tfunction InvalidCharacterError(message) {\n\t this.message = message;\n\t}\n\tInvalidCharacterError.prototype = new Error;\n\tInvalidCharacterError.prototype.code = 5;\n\tInvalidCharacterError.prototype.name = 'InvalidCharacterError';\n\t\n\tfunction btoa(input) {\n\t var str = String(input);\n\t var output = '';\n\t for (\n\t // initialize result and counter\n\t var block, charCode, idx = 0, map = chars;\n\t // if the next str index does not exist:\n\t // change the mapping table to \"=\"\n\t // check if d has no fractional digits\n\t str.charAt(idx | 0) || (map = '=', idx % 1);\n\t // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n\t output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n\t ) {\n\t charCode = str.charCodeAt(idx += 3 / 4);\n\t if (charCode > 0xFF) {\n\t throw new InvalidCharacterError('INVALID_CHARACTER_ERR: DOM Exception 5');\n\t }\n\t block = block << 8 | charCode;\n\t }\n\t return output;\n\t}\n\t\n\tmodule.exports = btoa;\n\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(3);\n\t\n\tmodule.exports = (\n\t utils.isStandardBrowserEnv() ?\n\t\n\t // Standard browser envs support document.cookie\n\t (function standardBrowserEnv() {\n\t return {\n\t write: function write(name, value, expires, path, domain, secure) {\n\t var cookie = [];\n\t cookie.push(name + '=' + encodeURIComponent(value));\n\t\n\t if (utils.isNumber(expires)) {\n\t cookie.push('expires=' + new Date(expires).toGMTString());\n\t }\n\t\n\t if (utils.isString(path)) {\n\t cookie.push('path=' + path);\n\t }\n\t\n\t if (utils.isString(domain)) {\n\t cookie.push('domain=' + domain);\n\t }\n\t\n\t if (secure === true) {\n\t cookie.push('secure');\n\t }\n\t\n\t document.cookie = cookie.join('; ');\n\t },\n\t\n\t read: function read(name) {\n\t var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n\t return (match ? decodeURIComponent(match[3]) : null);\n\t },\n\t\n\t remove: function remove(name) {\n\t this.write(name, '', Date.now() - 86400000);\n\t }\n\t };\n\t })() :\n\t\n\t // Non standard browser env (web workers, react-native) lack needed support.\n\t (function nonStandardBrowserEnv() {\n\t return {\n\t write: function write() {},\n\t read: function read() { return null; },\n\t remove: function remove() {}\n\t };\n\t })()\n\t);\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(3);\n\t\n\tfunction InterceptorManager() {\n\t this.handlers = [];\n\t}\n\t\n\t/**\n\t * Add a new interceptor to the stack\n\t *\n\t * @param {Function} fulfilled The function to handle `then` for a `Promise`\n\t * @param {Function} rejected The function to handle `reject` for a `Promise`\n\t *\n\t * @return {Number} An ID used to remove interceptor later\n\t */\n\tInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n\t this.handlers.push({\n\t fulfilled: fulfilled,\n\t rejected: rejected\n\t });\n\t return this.handlers.length - 1;\n\t};\n\t\n\t/**\n\t * Remove an interceptor from the stack\n\t *\n\t * @param {Number} id The ID that was returned by `use`\n\t */\n\tInterceptorManager.prototype.eject = function eject(id) {\n\t if (this.handlers[id]) {\n\t this.handlers[id] = null;\n\t }\n\t};\n\t\n\t/**\n\t * Iterate over all the registered interceptors\n\t *\n\t * This method is particularly useful for skipping over any\n\t * interceptors that may have become `null` calling `eject`.\n\t *\n\t * @param {Function} fn The function to call for each interceptor\n\t */\n\tInterceptorManager.prototype.forEach = function forEach(fn) {\n\t utils.forEach(this.handlers, function forEachHandler(h) {\n\t if (h !== null) {\n\t fn(h);\n\t }\n\t });\n\t};\n\t\n\tmodule.exports = InterceptorManager;\n\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Determines whether the specified URL is absolute\n\t *\n\t * @param {string} url The URL to test\n\t * @returns {boolean} True if the specified URL is absolute, otherwise false\n\t */\n\tmodule.exports = function isAbsoluteURL(url) {\n\t // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n\t // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n\t // by any combination of letters, digits, plus, period, or hyphen.\n\t return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n\t};\n\n\n/***/ },\n/* 14 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Creates a new URL by combining the specified URLs\n\t *\n\t * @param {string} baseURL The base URL\n\t * @param {string} relativeURL The relative URL\n\t * @returns {string} The combined URL\n\t */\n\tmodule.exports = function combineURLs(baseURL, relativeURL) {\n\t return baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '');\n\t};\n\n\n/***/ },\n/* 15 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function bind(fn, thisArg) {\n\t return function wrap() {\n\t var args = new Array(arguments.length);\n\t for (var i = 0; i < args.length; i++) {\n\t args[i] = arguments[i];\n\t }\n\t return fn.apply(thisArg, args);\n\t };\n\t};\n\n\n/***/ },\n/* 16 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Syntactic sugar for invoking a function and expanding an array for arguments.\n\t *\n\t * Common use case would be to use `Function.prototype.apply`.\n\t *\n\t * ```js\n\t * function f(x, y, z) {}\n\t * var args = [1, 2, 3];\n\t * f.apply(null, args);\n\t * ```\n\t *\n\t * With `spread` this example can be re-written.\n\t *\n\t * ```js\n\t * spread(function(x, y, z) {})([1, 2, 3]);\n\t * ```\n\t *\n\t * @param {Function} callback\n\t * @returns {Function}\n\t */\n\tmodule.exports = function spread(callback) {\n\t return function wrap(arr) {\n\t return callback.apply(null, arr);\n\t };\n\t};\n\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** axios.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 540a1ed1aeec3916d6a7\n **/","module.exports = require('./lib/axios');\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./index.js\n ** module id = 0\n ** module chunks = 0\n **/","'use strict';\n\nvar defaults = require('./defaults');\nvar utils = require('./utils');\nvar dispatchRequest = require('./core/dispatchRequest');\nvar InterceptorManager = require('./core/InterceptorManager');\nvar isAbsoluteURL = require('./helpers/isAbsoluteURL');\nvar combineURLs = require('./helpers/combineURLs');\nvar bind = require('./helpers/bind');\n\nfunction Axios(defaultConfig) {\n this.defaultConfig = utils.merge({\n headers: {},\n timeout: defaults.timeout,\n transformRequest: defaults.transformRequest,\n transformResponse: defaults.transformResponse\n }, defaultConfig);\n\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(this.defaultConfig, { method: 'get' }, config);\n\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Don't allow overriding defaults.withCredentials\n config.withCredentials = config.withCredentials || defaults.withCredentials;\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nvar defaultInstance = new Axios();\n\nvar axios = module.exports = bind(Axios.prototype.request, defaultInstance);\n\naxios.create = function create(defaultConfig) {\n return new Axios(defaultConfig);\n};\n\n// Expose defaults\naxios.defaults = defaults;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose interceptors\naxios.interceptors = defaultInstance.interceptors;\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n axios[method] = bind(Axios.prototype[method], defaultInstance);\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n axios[method] = bind(Axios.prototype[method], defaultInstance);\n});\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/axios.js\n ** module id = 1\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./utils');\n\nvar PROTECTION_PREFIX = /^\\)\\]\\}',?\\n/;\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nmodule.exports = {\n transformRequest: [function transformResponseJSON(data, headers) {\n if (utils.isFormData(data)) {\n return data;\n }\n if (utils.isArrayBuffer(data)) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isObject(data) && !utils.isFile(data) && !utils.isBlob(data)) {\n // Set application/json if no Content-Type has been specified\n if (!utils.isUndefined(headers)) {\n utils.forEach(headers, function processContentTypeHeader(val, key) {\n if (key.toLowerCase() === 'content-type') {\n headers['Content-Type'] = val;\n }\n });\n\n if (utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = 'application/json;charset=utf-8';\n }\n }\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponseJSON(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n data = data.replace(PROTECTION_PREFIX, '');\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n },\n patch: utils.merge(DEFAULT_CONTENT_TYPE),\n post: utils.merge(DEFAULT_CONTENT_TYPE),\n put: utils.merge(DEFAULT_CONTENT_TYPE)\n },\n\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN'\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/defaults.js\n ** module id = 2\n ** module chunks = 0\n **/","'use strict';\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return toString.call(val) === '[object FormData]';\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * typeof document.createElement -> undefined\n */\nfunction isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object' && !isArray(obj)) {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n result[key] = val;\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n trim: trim\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/utils.js\n ** module id = 3\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * Dispatch a request to the server using whichever adapter\n * is supported by the current environment.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n return new Promise(function executor(resolve, reject) {\n try {\n if ((typeof XMLHttpRequest !== 'undefined') || (typeof ActiveXObject !== 'undefined')) {\n // For browsers use XHR adapter\n require('../adapters/xhr')(resolve, reject, config);\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n require('../adapters/http')(resolve, reject, config);\n }\n } catch (e) {\n reject(e);\n }\n });\n};\n\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/core/dispatchRequest.js\n ** module id = 4\n ** module chunks = 0\n **/","'use strict';\n\n/*global ActiveXObject:true*/\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar transformData = require('./../helpers/transformData');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar btoa = window.btoa || require('./../helpers/btoa');\n\nmodule.exports = function xhrAdapter(resolve, reject, config) {\n // Transform request data\n var data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Merge headers\n var requestHeaders = utils.merge(\n defaults.headers.common,\n defaults.headers[config.method] || {},\n config.headers || {}\n );\n\n if (utils.isFormData(data)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var Adapter = (XMLHttpRequest || ActiveXObject);\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n if (!isURLSameOrigin(config.url) && window.XDomainRequest) {\n Adapter = window.XDomainRequest;\n loadEvent = 'onload';\n xDomain = true;\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n // Create the request\n var request = new Adapter('Microsoft.XMLHTTP');\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleReadyState() {\n if (request && (request.readyState === 4 || xDomain)) {\n // Prepare the response\n var responseHeaders = xDomain ? null : parseHeaders(request.getAllResponseHeaders());\n var responseData = ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response;\n var response = {\n data: transformData(\n responseData,\n responseHeaders,\n config.transformResponse\n ),\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config\n };\n // Resolve or reject the Promise based on the status\n ((request.status >= 200 && request.status < 300) || (xDomain && request.responseText) ?\n resolve :\n reject)(response);\n\n // Clean up request\n request = null;\n }\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = config.withCredentials || isURLSameOrigin(config.url) ?\n cookies.read(config.xsrfCookieName || defaults.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName || defaults.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if (!xDomain) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (!data && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n if (request.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n if (utils.isArrayBuffer(data)) {\n data = new DataView(data);\n }\n\n // Send the request\n request.send(data);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/adapters/xhr.js\n ** module id = 5\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n }\n\n if (!utils.isArray(val)) {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/buildURL.js\n ** module id = 6\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/parseHeaders.js\n ** module id = 7\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/transformData.js\n ** module id = 8\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/isURLSameOrigin.js\n ** module id = 9\n ** module chunks = 0\n **/","'use strict';\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction InvalidCharacterError(message) {\n this.message = message;\n}\nInvalidCharacterError.prototype = new Error;\nInvalidCharacterError.prototype.code = 5;\nInvalidCharacterError.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new InvalidCharacterError('INVALID_CHARACTER_ERR: DOM Exception 5');\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/btoa.js\n ** module id = 10\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/cookies.js\n ** module id = 11\n ** module chunks = 0\n **/","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/core/InterceptorManager.js\n ** module id = 12\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/isAbsoluteURL.js\n ** module id = 13\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '');\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/combineURLs.js\n ** module id = 14\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/bind.js\n ** module id = 15\n ** module chunks = 0\n **/","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/helpers/spread.js\n ** module id = 16\n ** module chunks = 0\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index 6a2b5a9..38ef4bb 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -10,7 +10,7 @@ module.exports = function(config) { // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['jasmine-ajax', 'jasmine'], + frameworks: ['jasmine-ajax', 'jasmine', 'sinon'], // list of files / patterns to load in the browser @@ -62,7 +62,7 @@ module.exports = function(config) { // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: ['dots', 'coverage'], - + coverageReporter: { type: 'lcov', dir: 'coverage/', diff --git a/lib/adapters/http.js b/lib/adapters/http.js index 177be33..7a916a5 100644 --- a/lib/adapters/http.js +++ b/lib/adapters/http.js @@ -1,29 +1,18 @@ 'use strict'; -var defaults = require('./../defaults'); var utils = require('./../utils'); -var buildUrl = require('./../helpers/buildUrl'); +var buildURL = require('./../helpers/buildURL'); var transformData = require('./../helpers/transformData'); -var http = require('http'); -var https = require('https'); +var http = require('follow-redirects').http; +var https = require('follow-redirects').https; var url = require('url'); +var zlib = require('zlib'); var pkg = require('./../../package.json'); var Buffer = require('buffer').Buffer; module.exports = function httpAdapter(resolve, reject, config) { - // Transform request data - var data = transformData( - config.data, - config.headers, - config.transformRequest - ); - - // Merge headers - var headers = utils.merge( - defaults.headers.common, - defaults.headers[config.method] || {}, - config.headers || {} - ); + var data = config.data; + var headers = config.headers; // Set User-Agent (required by some servers) // Only set header if it hasn't been set in config @@ -45,29 +34,57 @@ module.exports = function httpAdapter(resolve, reject, config) { headers['Content-Length'] = data.length; } + // HTTP basic authentication + var auth = undefined; + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + auth = username + ':' + password; + } + // Parse url var parsed = url.parse(config.url); var options = { host: parsed.hostname, port: parsed.port, - path: buildUrl(parsed.path, config.params).replace(/^\?/, ''), + path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), method: config.method, headers: headers, - agent: config.agent + agent: config.agent, + auth: auth }; // Create the request var transport = parsed.protocol === 'https:' ? https : http; - var req = transport.request(options, function (res) { + var req = transport.request(options, function handleResponse(res) { + // uncompress the response body transparently if required + var stream = res; + switch (res.headers['content-encoding']) { + /*eslint default-case:0*/ + case 'gzip': + case 'compress': + case 'deflate': + // add the unzipper to the body stream processing pipeline + stream = stream.pipe(zlib.createUnzip()); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + } + var responseBuffer = []; - res.on('data', function (chunk) { + stream.on('data', function handleStreamData(chunk) { responseBuffer.push(chunk); }); - res.on('end', function () { + stream.on('end', function handleStreamEnd() { + var d = Buffer.concat(responseBuffer); + if (config.responseType !== 'arraybuffer') { + d = d.toString('utf8'); + } var response = { data: transformData( - Buffer.concat(responseBuffer).toString('utf8'), + d, res.headers, config.transformResponse ), @@ -85,12 +102,12 @@ module.exports = function httpAdapter(resolve, reject, config) { }); // Handle errors - req.on('error', function (err) { + req.on('error', function handleRequestError(err) { reject(err); }); // Handle request timeout - req.setTimeout(config.timeout, function () { + req.setTimeout(config.timeout, function handleRequestTimeout() { req.abort(); }); diff --git a/lib/adapters/xhr.js b/lib/adapters/xhr.js index 1a3ac77..f5b9853 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -2,43 +2,52 @@ /*global ActiveXObject:true*/ -var defaults = require('./../defaults'); var utils = require('./../utils'); -var buildUrl = require('./../helpers/buildUrl'); +var buildURL = require('./../helpers/buildURL'); var parseHeaders = require('./../helpers/parseHeaders'); var transformData = require('./../helpers/transformData'); +var isURLSameOrigin = require('./../helpers/isURLSameOrigin'); +var ieVersion = require('./../helpers/ieVersion'); +var btoa = window.btoa || require('./../helpers/btoa'); module.exports = function xhrAdapter(resolve, reject, config) { - // Transform request data - var data = transformData( - config.data, - config.headers, - config.transformRequest - ); + var requestData = config.data; + var requestHeaders = config.headers; - // Merge headers - var requestHeaders = utils.merge( - defaults.headers.common, - defaults.headers[config.method] || {}, - config.headers || {} - ); - - if (utils.isFormData(data)) { + if (utils.isFormData(requestData)) { delete requestHeaders['Content-Type']; // Let the browser set it } + var Adapter = (XMLHttpRequest || ActiveXObject); + var loadEvent = 'onreadystatechange'; + var xDomain = false; + + // For IE 8/9 CORS support + if (ieVersion() <= 9 && !isURLSameOrigin(config.url) && window.XDomainRequest) { + Adapter = window.XDomainRequest; + loadEvent = 'onload'; + xDomain = true; + } + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + // Create the request - var request = new (XMLHttpRequest || ActiveXObject)('Microsoft.XMLHTTP'); - request.open(config.method.toUpperCase(), buildUrl(config.url, config.params), true); + var request = new Adapter('Microsoft.XMLHTTP'); + request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); // Set the request timeout in MS request.timeout = config.timeout; // Listen for ready state - request.onreadystatechange = function () { - if (request && request.readyState === 4) { + request[loadEvent] = function handleReadyState() { + if (request && (request.readyState === 4 || xDomain)) { // Prepare the response - var responseHeaders = parseHeaders(request.getAllResponseHeaders()); + var responseHeaders = xDomain ? null : parseHeaders(request.getAllResponseHeaders()); var responseData = ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response; var response = { data: transformData( @@ -51,9 +60,8 @@ module.exports = function xhrAdapter(resolve, reject, config) { headers: responseHeaders, config: config }; - // Resolve or reject the Promise based on the status - (request.status >= 200 && request.status < 300 ? + ((request.status >= 200 && request.status < 300) || (xDomain && request.responseText) ? resolve : reject)(response); @@ -67,29 +75,29 @@ module.exports = function xhrAdapter(resolve, reject, config) { // Specifically not if we're in a web worker, or react-native. if (utils.isStandardBrowserEnv()) { var cookies = require('./../helpers/cookies'); - var urlIsSameOrigin = require('./../helpers/urlIsSameOrigin'); // Add xsrf header - var xsrfValue = urlIsSameOrigin(config.url) ? - cookies.read(config.xsrfCookieName || defaults.xsrfCookieName) : + var xsrfValue = config.withCredentials || isURLSameOrigin(config.url) ? + cookies.read(config.xsrfCookieName) : undefined; if (xsrfValue) { - requestHeaders[config.xsrfHeaderName || defaults.xsrfHeaderName] = xsrfValue; + requestHeaders[config.xsrfHeaderName] = xsrfValue; } } // Add headers to the request - utils.forEach(requestHeaders, function (val, key) { - // Remove Content-Type if data is undefined - if (!data && key.toLowerCase() === 'content-type') { - delete requestHeaders[key]; - } - // Otherwise add header to the request - else { - request.setRequestHeader(key, val); - } - }); + if (!xDomain) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (!requestData && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } // Add withCredentials to request if needed if (config.withCredentials) { @@ -107,10 +115,10 @@ module.exports = function xhrAdapter(resolve, reject, config) { } } - if (utils.isArrayBuffer(data)) { - data = new DataView(data); + if (utils.isArrayBuffer(requestData)) { + requestData = new DataView(requestData); } // Send the request - request.send(data); + request.send(requestData); }; diff --git a/lib/axios.js b/lib/axios.js index 6937894..1a32b75 100644 --- a/lib/axios.js +++ b/lib/axios.js @@ -4,8 +4,21 @@ var defaults = require('./defaults'); var utils = require('./utils'); var dispatchRequest = require('./core/dispatchRequest'); var InterceptorManager = require('./core/InterceptorManager'); +var isAbsoluteURL = require('./helpers/isAbsoluteURL'); +var combineURLs = require('./helpers/combineURLs'); +var bind = require('./helpers/bind'); +var transformData = require('./helpers/transformData'); -var axios = module.exports = function (config) { +function Axios(defaultConfig) { + this.defaults = utils.merge({}, defaultConfig); + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ // Allow for axios('example/url'[, config]) a la fetch API if (typeof config === 'string') { config = utils.merge({ @@ -13,26 +26,46 @@ var axios = module.exports = function (config) { }, arguments[1]); } - config = utils.merge({ - method: 'get', - headers: {}, - timeout: defaults.timeout, - transformRequest: defaults.transformRequest, - transformResponse: defaults.transformResponse - }, config); + config = utils.merge(defaults, this.defaults, { method: 'get' }, config); + + // Support baseURL config + if (config.baseURL && !isAbsoluteURL(config.url)) { + config.url = combineURLs(config.baseURL, config.url); + } // Don't allow overriding defaults.withCredentials - config.withCredentials = config.withCredentials || defaults.withCredentials; + config.withCredentials = config.withCredentials || this.defaults.withCredentials; + + // Transform request data + config.data = transformData( + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers || {} + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); // Hook up interceptors middleware var chain = [dispatchRequest, undefined]; var promise = Promise.resolve(config); - axios.interceptors.request.forEach(function (interceptor) { + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { chain.unshift(interceptor.fulfilled, interceptor.rejected); }); - axios.interceptors.response.forEach(function (interceptor) { + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { chain.push(interceptor.fulfilled, interceptor.rejected); }); @@ -43,46 +76,45 @@ var axios = module.exports = function (config) { return promise; }; +var defaultInstance = new Axios(defaults); +var axios = module.exports = bind(Axios.prototype.request, defaultInstance); + +axios.create = function create(defaultConfig) { + return new Axios(defaultConfig); +}; + // Expose defaults -axios.defaults = defaults; +axios.defaults = defaultInstance.defaults; // Expose all/spread -axios.all = function (promises) { +axios.all = function all(promises) { return Promise.all(promises); }; axios.spread = require('./helpers/spread'); // Expose interceptors -axios.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() -}; +axios.interceptors = defaultInstance.interceptors; // Provide aliases for supported request methods -(function () { - function createShortMethods() { - utils.forEach(arguments, function (method) { - axios[method] = function (url, config) { - return axios(utils.merge(config || {}, { - method: method, - url: url - })); - }; - }); - } +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url + })); + }; + axios[method] = bind(Axios.prototype[method], defaultInstance); +}); - function createShortMethodsWithData() { - utils.forEach(arguments, function (method) { - axios[method] = function (url, data, config) { - return axios(utils.merge(config || {}, { - method: method, - url: url, - data: data - })); - }; - }); - } - - createShortMethods('delete', 'get', 'head'); - createShortMethodsWithData('post', 'put', 'patch'); -})(); +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url, + data: data + })); + }; + axios[method] = bind(Axios.prototype[method], defaultInstance); +}); diff --git a/lib/core/InterceptorManager.js b/lib/core/InterceptorManager.js index 4425a7d..50d667b 100644 --- a/lib/core/InterceptorManager.js +++ b/lib/core/InterceptorManager.js @@ -14,7 +14,7 @@ function InterceptorManager() { * * @return {Number} An ID used to remove interceptor later */ -InterceptorManager.prototype.use = function (fulfilled, rejected) { +InterceptorManager.prototype.use = function use(fulfilled, rejected) { this.handlers.push({ fulfilled: fulfilled, rejected: rejected @@ -27,7 +27,7 @@ InterceptorManager.prototype.use = function (fulfilled, rejected) { * * @param {Number} id The ID that was returned by `use` */ -InterceptorManager.prototype.eject = function (id) { +InterceptorManager.prototype.eject = function eject(id) { if (this.handlers[id]) { this.handlers[id] = null; } @@ -37,12 +37,12 @@ InterceptorManager.prototype.eject = function (id) { * Iterate over all the registered interceptors * * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `remove`. + * interceptors that may have become `null` calling `eject`. * * @param {Function} fn The function to call for each interceptor */ -InterceptorManager.prototype.forEach = function (fn) { - utils.forEach(this.handlers, function (h) { +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { if (h !== null) { fn(h); } diff --git a/lib/core/dispatchRequest.js b/lib/core/dispatchRequest.js index 1ec313f..3e566d1 100644 --- a/lib/core/dispatchRequest.js +++ b/lib/core/dispatchRequest.js @@ -8,14 +8,13 @@ * @returns {Promise} The Promise to be fulfilled */ module.exports = function dispatchRequest(config) { - return new Promise(function (resolve, reject) { + return new Promise(function executor(resolve, reject) { try { - // For browsers use XHR adapter if ((typeof XMLHttpRequest !== 'undefined') || (typeof ActiveXObject !== 'undefined')) { + // For browsers use XHR adapter require('../adapters/xhr')(resolve, reject, config); - } - // For node use HTTP adapter - else if (typeof process !== 'undefined') { + } else if (typeof process !== 'undefined') { + // For node use HTTP adapter require('../adapters/http')(resolve, reject, config); } } catch (e) { diff --git a/lib/defaults.js b/lib/defaults.js index ba2ca8e..04d89eb 100644 --- a/lib/defaults.js +++ b/lib/defaults.js @@ -8,8 +8,8 @@ var DEFAULT_CONTENT_TYPE = { }; module.exports = { - transformRequest: [function (data, headers) { - if(utils.isFormData(data)) { + transformRequest: [function transformResponseJSON(data, headers) { + if (utils.isFormData(data)) { return data; } if (utils.isArrayBuffer(data)) { @@ -21,7 +21,7 @@ module.exports = { if (utils.isObject(data) && !utils.isFile(data) && !utils.isBlob(data)) { // Set application/json if no Content-Type has been specified if (!utils.isUndefined(headers)) { - utils.forEach(headers, function (val, key) { + utils.forEach(headers, function processContentTypeHeader(val, key) { if (key.toLowerCase() === 'content-type') { headers['Content-Type'] = val; } @@ -36,7 +36,8 @@ module.exports = { return data; }], - transformResponse: [function (data) { + transformResponse: [function transformResponseJSON(data) { + /*eslint no-param-reassign:0*/ if (typeof data === 'string') { data = data.replace(PROTECTION_PREFIX, ''); try { diff --git a/lib/helpers/bind.js b/lib/helpers/bind.js new file mode 100644 index 0000000..6147c60 --- /dev/null +++ b/lib/helpers/bind.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; diff --git a/lib/helpers/btoa.js b/lib/helpers/btoa.js new file mode 100644 index 0000000..5d0b378 --- /dev/null +++ b/lib/helpers/btoa.js @@ -0,0 +1,36 @@ +'use strict'; + +// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js + +var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + +function InvalidCharacterError(message) { + this.message = message; +} +InvalidCharacterError.prototype = new Error; +InvalidCharacterError.prototype.code = 5; +InvalidCharacterError.prototype.name = 'InvalidCharacterError'; + +function btoa(input) { + var str = String(input); + var output = ''; + for ( + // initialize result and counter + var block, charCode, idx = 0, map = chars; + // if the next str index does not exist: + // change the mapping table to "=" + // check if d has no fractional digits + str.charAt(idx | 0) || (map = '=', idx % 1); + // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8 + output += map.charAt(63 & block >> 8 - idx % 1 * 8) + ) { + charCode = str.charCodeAt(idx += 3 / 4); + if (charCode > 0xFF) { + throw new InvalidCharacterError('INVALID_CHARACTER_ERR: DOM Exception 5'); + } + block = block << 8 | charCode; + } + return output; +} + +module.exports = btoa; diff --git a/lib/helpers/buildURL.js b/lib/helpers/buildURL.js new file mode 100644 index 0000000..c8365f4 --- /dev/null +++ b/lib/helpers/buildURL.js @@ -0,0 +1,67 @@ +'use strict'; + +var utils = require('./../utils'); + +function encode(val) { + return encodeURIComponent(val). + replace(/%40/gi, '@'). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } + + if (!utils.isArray(val)) { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; + diff --git a/lib/helpers/buildUrl.js b/lib/helpers/buildUrl.js deleted file mode 100644 index c3b6e2f..0000000 --- a/lib/helpers/buildUrl.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -function encode(val) { - return encodeURIComponent(val). - replace(/%40/gi, '@'). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%20/g, '+'). - replace(/%5B/gi, '['). - replace(/%5D/gi, ']'); -} - -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @returns {string} The formatted url - */ -module.exports = function buildUrl(url, params) { - if (!params) { - return url; - } - - var parts = []; - - utils.forEach(params, function (val, key) { - if (val === null || typeof val === 'undefined') { - return; - } - - if (utils.isArray(val)) { - key = key + '[]'; - } - - if (!utils.isArray(val)) { - val = [val]; - } - - utils.forEach(val, function (v) { - if (utils.isDate(v)) { - v = v.toISOString(); - } - else if (utils.isObject(v)) { - v = JSON.stringify(v); - } - parts.push(encode(key) + '=' + encode(v)); - }); - }); - - if (parts.length > 0) { - url += (url.indexOf('?') === -1 ? '?' : '&') + parts.join('&'); - } - - return url; -}; diff --git a/lib/helpers/combineURLs.js b/lib/helpers/combineURLs.js new file mode 100644 index 0000000..7145d10 --- /dev/null +++ b/lib/helpers/combineURLs.js @@ -0,0 +1,12 @@ +'use strict'; + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, ''); +}; diff --git a/lib/helpers/cookies.js b/lib/helpers/cookies.js index fc06e0d..e45a4f9 100644 --- a/lib/helpers/cookies.js +++ b/lib/helpers/cookies.js @@ -1,43 +1,53 @@ 'use strict'; -/** - * WARNING: - * This file makes references to objects that aren't safe in all environments. - * Please see lib/utils.isStandardBrowserEnv before including this file. - */ - var utils = require('./../utils'); -module.exports = { - write: function write(name, value, expires, path, domain, secure) { - var cookie = []; - cookie.push(name + '=' + encodeURIComponent(value)); +module.exports = ( + utils.isStandardBrowserEnv() ? - if (utils.isNumber(expires)) { - cookie.push('expires=' + new Date(expires).toGMTString()); - } + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); - if (utils.isString(path)) { - cookie.push('path=' + path); - } + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } - if (utils.isString(domain)) { - cookie.push('domain=' + domain); - } + if (utils.isString(path)) { + cookie.push('path=' + path); + } - if (secure === true) { - cookie.push('secure'); - } + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } - document.cookie = cookie.join('; '); - }, + if (secure === true) { + cookie.push('secure'); + } - read: function read(name) { - var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); - return (match ? decodeURIComponent(match[3]) : null); - }, + document.cookie = cookie.join('; '); + }, - remove: function remove(name) { - this.write(name, '', Date.now() - 86400000); - } -}; + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); diff --git a/lib/helpers/deprecatedMethod.js b/lib/helpers/deprecatedMethod.js index 0b8c75f..ed40965 100644 --- a/lib/helpers/deprecatedMethod.js +++ b/lib/helpers/deprecatedMethod.js @@ -1,5 +1,7 @@ 'use strict'; +/*eslint no-console:0*/ + /** * Supply a warning to the developer that a method they are using * has been deprecated. diff --git a/lib/helpers/ieVersion.js b/lib/helpers/ieVersion.js new file mode 100644 index 0000000..ac4f11e --- /dev/null +++ b/lib/helpers/ieVersion.js @@ -0,0 +1,23 @@ +'use strict'; + +/** + * https://gist.github.com/padolsey/527683 + * + * A short snippet for detecting versions of IE in JavaScript + * without resorting to user-agent sniffing + * + * @returns {Number|undefined} Number of IE version (5-9), otherwise undefined + */ +module.exports = function ieVersion() { + var undef; + var v = 3; + var div = document.createElement('div'); + var all = div.getElementsByTagName('i'); + + while (( + div.innerHTML = '', + all[0] + )); + + return v > 4 ? v : undef; +}; diff --git a/lib/helpers/isAbsoluteURL.js b/lib/helpers/isAbsoluteURL.js new file mode 100644 index 0000000..d33e992 --- /dev/null +++ b/lib/helpers/isAbsoluteURL.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; diff --git a/lib/helpers/isURLSameOrigin.js b/lib/helpers/isURLSameOrigin.js new file mode 100644 index 0000000..e292745 --- /dev/null +++ b/lib/helpers/isURLSameOrigin.js @@ -0,0 +1,68 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); diff --git a/lib/helpers/parseHeaders.js b/lib/helpers/parseHeaders.js index b7d0249..da96796 100644 --- a/lib/helpers/parseHeaders.js +++ b/lib/helpers/parseHeaders.js @@ -16,11 +16,14 @@ var utils = require('./../utils'); * @returns {Object} Headers parsed into an object */ module.exports = function parseHeaders(headers) { - var parsed = {}, key, val, i; + var parsed = {}; + var key; + var val; + var i; if (!headers) { return parsed; } - utils.forEach(headers.split('\n'), function(line) { + utils.forEach(headers.split('\n'), function parser(line) { i = line.indexOf(':'); key = utils.trim(line.substr(0, i)).toLowerCase(); val = utils.trim(line.substr(i + 1)); diff --git a/lib/helpers/spread.js b/lib/helpers/spread.js index d31dddb..25e3cdd 100644 --- a/lib/helpers/spread.js +++ b/lib/helpers/spread.js @@ -21,7 +21,7 @@ * @returns {Function} */ module.exports = function spread(callback) { - return function (arr) { + return function wrap(arr) { return callback.apply(null, arr); }; }; diff --git a/lib/helpers/transformData.js b/lib/helpers/transformData.js index a40d1f4..e065362 100644 --- a/lib/helpers/transformData.js +++ b/lib/helpers/transformData.js @@ -11,7 +11,8 @@ var utils = require('./../utils'); * @returns {*} The resulting transformed data */ module.exports = function transformData(data, headers, fns) { - utils.forEach(fns, function (fn) { + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { data = fn(data, headers); }); diff --git a/lib/helpers/urlIsSameOrigin.js b/lib/helpers/urlIsSameOrigin.js deleted file mode 100644 index a10a26c..0000000 --- a/lib/helpers/urlIsSameOrigin.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -/** - * WARNING: - * This file makes references to objects that aren't safe in all environments. - * Please see lib/utils.isStandardBrowserEnv before including this file. - */ - -var utils = require('./../utils'); -var msie = /(msie|trident)/i.test(navigator.userAgent); -var urlParsingNode = document.createElement('a'); -var originUrl; - -/** - * Parse a URL to discover it's components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ -function urlResolve(url) { - var href = url; - - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } - - urlParsingNode.setAttribute('href', href); - - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; -} - -originUrl = urlResolve(window.location.href); - -/** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestUrl The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ -module.exports = function urlIsSameOrigin(requestUrl) { - var parsed = (utils.isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl; - return (parsed.protocol === originUrl.protocol && - parsed.host === originUrl.host); -}; diff --git a/lib/utils.js b/lib/utils.js index 9dd7287..0d418ae 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -43,11 +43,13 @@ function isFormData(val) { * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false */ function isArrayBufferView(val) { + var result; if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { - return ArrayBuffer.isView(val); + result = ArrayBuffer.isView(val); } else { - return (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); } + return result; } /** @@ -130,16 +132,6 @@ function trim(str) { return str.replace(/^\s*/, '').replace(/\s*$/, ''); } -/** - * Determine if a value is an Arguments object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Arguments object, otherwise false - */ -function isArguments(val) { - return toString.call(val) === '[object Arguments]'; -} - /** * Determine if we're running in a standard browser environment * @@ -151,7 +143,7 @@ function isArguments(val) { * typeof document -> undefined * * react-native: - * typeof document.createelement -> undefined + * typeof document.createElement -> undefined */ function isStandardBrowserEnv() { return ( @@ -164,7 +156,7 @@ function isStandardBrowserEnv() { /** * Iterate over an Array or an Object invoking a function for each item. * - * If `obj` is an Array or arguments callback will be called passing + * If `obj` is an Array callback will be called passing * the value, index, and complete array for each item. * * If 'obj' is an Object callback will be called passing @@ -179,22 +171,19 @@ function forEach(obj, fn) { return; } - // Check if obj is array-like - var isArrayLike = isArray(obj) || isArguments(obj); - // Force an array if not already something iterable - if (typeof obj !== 'object' && !isArrayLike) { + if (typeof obj !== 'object' && !isArray(obj)) { + /*eslint no-param-reassign:0*/ obj = [obj]; } - // Iterate over array values - if (isArrayLike) { + if (isArray(obj)) { + // Iterate over array values for (var i = 0, l = obj.length; i < l; i++) { fn.call(null, obj[i], i, obj); } - } - // Iterate over object keys - else { + } else { + // Iterate over object keys for (var key in obj) { if (obj.hasOwnProperty(key)) { fn.call(null, obj[key], key, obj); @@ -220,13 +209,19 @@ function forEach(obj, fn) { * @param {Object} obj1 Object to merge * @returns {Object} Result of all merge properties */ -function merge(/*obj1, obj2, obj3, ...*/) { +function merge(/* obj1, obj2, obj3, ... */) { var result = {}; - forEach(arguments, function (obj) { - forEach(obj, function (val, key) { + function assignValue(val, key) { + if (typeof result[key] === 'object' && typeof val === 'object') { + result[key] = merge(result[key], val); + } else { result[key] = val; - }); - }); + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } return result; } diff --git a/package.json b/package.json index d7c8132..ac6b8e9 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { "name": "axios", - "version": "0.7.0", + "version": "0.8.1", "description": "Promise based HTTP client for the browser and node.js", "main": "index.js", "scripts": { - "test": "grunt test", + "build": "./node_modules/.bin/grunt build", + "test": "./node_modules/.bin/grunt test", "start": "node ./sandbox/server.js", "examples": "node ./examples/server.js", "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" @@ -47,6 +48,7 @@ "karma-jasmine": "0.3.6", "karma-jasmine-ajax": "0.1.13", "karma-phantomjs-launcher": "0.2.1", + "karma-sinon": "1.0.4", "karma-sourcemap-loader": "0.3.5", "karma-webpack": "1.7.0", "load-grunt-tasks": "3.3.0", @@ -60,5 +62,8 @@ }, "typescript": { "definition": "./axios.d.ts" + }, + "dependencies": { + "follow-redirects": "0.0.7" } } diff --git a/test/specs/__setupBasicAuthTest.js b/test/specs/__setupBasicAuthTest.js new file mode 100644 index 0000000..3fccf1b --- /dev/null +++ b/test/specs/__setupBasicAuthTest.js @@ -0,0 +1,43 @@ +var axios = require('../../index'); + +module.exports = function setupBasicAuthTest() { + beforeEach(function () { + jasmine.Ajax.install(); + }); + + afterEach(function () { + jasmine.Ajax.uninstall(); + }); + + it('should accept HTTP Basic auth with username/password', function (done) { + axios({ + url: '/foo', + auth: { + username: 'Aladdin', + password: 'open sesame' + } + }); + + setTimeout(function () { + var request = jasmine.Ajax.requests.mostRecent(); + + expect(request.requestHeaders['Authorization']).toEqual('Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='); + done(); + }, 0); + }); + + it('should fail to encode HTTP Basic auth credentials with non-Latin1 characters', function (done) { + axios({ + url: '/foo', + auth: { + username: 'Aladßç£☃din', + password: 'open sesame' + } + }).then(function(response) { + done(new Error('Should not succeed to make a HTTP Basic auth request with non-latin1 chars in credentials.')); + }).catch(function(error) { + expect(error.message).toEqual('INVALID_CHARACTER_ERR: DOM Exception 5'); + done(); + }); + }); +}; diff --git a/test/specs/api.spec.js b/test/specs/api.spec.js index abfd286..583b2bf 100644 --- a/test/specs/api.spec.js +++ b/test/specs/api.spec.js @@ -1,6 +1,6 @@ var axios = require('../../index'); -describe('api', function () { +describe('static api', function () { it('should have request method helpers', function () { expect(typeof axios.get).toEqual('function'); expect(typeof axios.head).toEqual('function'); @@ -22,8 +22,36 @@ describe('api', function () { expect(typeof axios.defaults.headers).toEqual('object'); }); + it('should have interceptors', function () { + expect(typeof axios.interceptors.request).toEqual('object'); + expect(typeof axios.interceptors.response).toEqual('object'); + }); + it('should have all/spread helpers', function () { expect(typeof axios.all).toEqual('function'); expect(typeof axios.spread).toEqual('function'); }); + + it('should have factory method', function () { + expect(typeof axios.create).toEqual('function'); + }); +}); + +describe('instance api', function () { + var instance = axios.create(); + + it('should have request methods', function () { + expect(typeof instance.request).toEqual('function'); + expect(typeof instance.get).toEqual('function'); + expect(typeof instance.head).toEqual('function'); + expect(typeof instance.delete).toEqual('function'); + expect(typeof instance.post).toEqual('function'); + expect(typeof instance.put).toEqual('function'); + expect(typeof instance.patch).toEqual('function'); + }); + + it('should have interceptors', function () { + expect(typeof instance.interceptors.request).toEqual('object'); + expect(typeof instance.interceptors.response).toEqual('object'); + }); }); diff --git a/test/specs/basicAuth.spec.js b/test/specs/basicAuth.spec.js new file mode 100644 index 0000000..742fc25 --- /dev/null +++ b/test/specs/basicAuth.spec.js @@ -0,0 +1,5 @@ +var setupBasicAuthTest = require('./__setupBasicAuthTest'); + +describe('basicAuth without btoa polyfill', function () { + setupBasicAuthTest(); +}); diff --git a/test/specs/basicAuthWithPolyfill.spec.js b/test/specs/basicAuthWithPolyfill.spec.js new file mode 100644 index 0000000..13de4c8 --- /dev/null +++ b/test/specs/basicAuthWithPolyfill.spec.js @@ -0,0 +1,21 @@ +var setupBasicAuthTest = require('./__setupBasicAuthTest'); +var window_btoa; + +describe('basicAuth with btoa polyfill', function () { + beforeAll(function() { + window_btoa = window.btoa; + window.btoa = undefined; + }); + + afterAll(function() { + window.btoa = window_btoa; + window_btoa = undefined; + }); + + it('should not have native window.btoa', function () { + expect(window.btoa).toEqual(undefined); + }); + + setupBasicAuthTest(); +}); + diff --git a/test/specs/defaults.spec.js b/test/specs/defaults.spec.js index 9a97653..c283ccb 100644 --- a/test/specs/defaults.spec.js +++ b/test/specs/defaults.spec.js @@ -1,6 +1,22 @@ +var axios = require('../../index'); var defaults = require('../../lib/defaults'); +var utils = require('../../lib/utils'); describe('defaults', function () { + var __defaults; + var XSRF_COOKIE_NAME = 'CUSTOM-XSRF-TOKEN'; + + beforeEach(function () { + jasmine.Ajax.install(); + __defaults = axios.defaults; + }); + + afterEach(function () { + jasmine.Ajax.uninstall(); + axios.defaults = __defaults; + document.cookie = XSRF_COOKIE_NAME + '=;expires=' + new Date(Date.now() - 86400000).toGMTString(); + }); + it('should transform request json', function () { expect(defaults.transformRequest[0]({foo: 'bar'})).toEqual('{"foo":"bar"}'); }); @@ -19,5 +35,105 @@ describe('defaults', function () { it('should do nothing to response string', function () { expect(defaults.transformResponse[0]('foo=bar')).toEqual('foo=bar'); }); + + it('should use global defaults config', function (done) { + var request; + + axios({ url: '/foo' }); + + setTimeout(function () { + request = jasmine.Ajax.requests.mostRecent(); + + expect(request.url).toBe('/foo'); + done(); + }, 0); + }); + + it('should use modified defaults config', function (done) { + var request; + axios.defaults.baseURL = 'http://example.com/'; + + axios({ url: '/foo' }); + + setTimeout(function () { + request = jasmine.Ajax.requests.mostRecent(); + + expect(request.url).toBe('http://example.com/foo'); + done(); + }, 0); + }); + + it('should use request config', function (done) { + var request; + + axios({ + url: '/foo', + baseURL: 'http://www.example.com' + }); + + setTimeout(function () { + request = jasmine.Ajax.requests.mostRecent(); + + expect(request.url).toBe('http://www.example.com/foo'); + done(); + }, 0); + }); + + it('should use default config for custom instance', function (done) { + var request; + var instance = axios.create({ + xsrfCookieName: XSRF_COOKIE_NAME, + xsrfHeaderName: 'X-CUSTOM-XSRF-TOKEN' + }); + document.cookie = instance.defaults.xsrfCookieName + '=foobarbaz'; + + instance.get('/foo'); + + setTimeout(function () { + request = jasmine.Ajax.requests.mostRecent(); + + expect(request.requestHeaders[instance.defaults.xsrfHeaderName]).toEqual('foobarbaz'); + done(); + }, 0); + }); + + it('should use header config', function (done) { + var request; + var instance = axios.create({ + headers: { + common: { + 'X-COMMON-HEADER': 'commonHeaderValue' + }, + get: { + 'X-GET-HEADER': 'getHeaderValue' + }, + post: { + 'X-POST-HEADER': 'postHeaderValue' + } + } + }); + + instance.get('/foo', { + headers: { + 'X-FOO-HEADER': 'fooHeaderValue', + 'X-BAR-HEADER': 'barHeaderValue' + } + }); + + setTimeout(function () { + request = jasmine.Ajax.requests.mostRecent(); + + expect(request.requestHeaders).toEqual( + utils.merge(defaults.headers.common, { + 'X-COMMON-HEADER': 'commonHeaderValue', + 'X-GET-HEADER': 'getHeaderValue', + 'X-FOO-HEADER': 'fooHeaderValue', + 'X-BAR-HEADER': 'barHeaderValue' + }) + ); + done(); + }, 0); + }); + }); diff --git a/test/specs/helpers/bind.spec.js b/test/specs/helpers/bind.spec.js new file mode 100644 index 0000000..a02c462 --- /dev/null +++ b/test/specs/helpers/bind.spec.js @@ -0,0 +1,12 @@ +var bind = require('../../../lib/helpers/bind'); + +describe('bind', function () { + it('should bind an object to a function', function () { + var o = { val: 123 }; + var f = bind(function (num) { + return this.val * num; + }, o); + + expect(f(2)).toEqual(246); + }); +}); diff --git a/test/specs/helpers/btoa.spec.js b/test/specs/helpers/btoa.spec.js new file mode 100644 index 0000000..89a4403 --- /dev/null +++ b/test/specs/helpers/btoa.spec.js @@ -0,0 +1,27 @@ +var __btoa = require('../../../lib/helpers/btoa'); + +describe('btoa polyfill', function () { + it('should behave the same as native window.btoa', function () { + var data = 'Hello, world'; + expect(__btoa(data)).toEqual(window.btoa(data)); + }); + + it('should throw an error if char is out of range 0xFF', function () { + var err1, err2; + var data = 'I ♡ Unicode!'; + + try { + window.btoa(data); + } catch (e) { + err1 = e; + } + + try { + __btoa(data); + } catch (e) { + err2 = e; + } + + expect(err1.message).toEqual(err2.message); + }); +}); diff --git a/test/specs/helpers/buildUrl.spec.js b/test/specs/helpers/buildURL.spec.js similarity index 59% rename from test/specs/helpers/buildUrl.spec.js rename to test/specs/helpers/buildURL.spec.js index 84e58b4..453c1f9 100644 --- a/test/specs/helpers/buildUrl.spec.js +++ b/test/specs/helpers/buildURL.spec.js @@ -1,18 +1,18 @@ -var buildUrl = require('../../../lib/helpers/buildUrl'); +var buildURL = require('../../../lib/helpers/buildURL'); -describe('helpers::buildUrl', function () { +describe('helpers::buildURL', function () { it('should support null params', function () { - expect(buildUrl('/foo')).toEqual('/foo'); + expect(buildURL('/foo')).toEqual('/foo'); }); it('should support params', function () { - expect(buildUrl('/foo', { + expect(buildURL('/foo', { foo: 'bar' })).toEqual('/foo?foo=bar'); }); it('should support object params', function () { - expect(buildUrl('/foo', { + expect(buildURL('/foo', { foo: { bar: 'baz' } @@ -22,35 +22,45 @@ describe('helpers::buildUrl', function () { it('should support date params', function () { var date = new Date(); - expect(buildUrl('/foo', { + expect(buildURL('/foo', { date: date })).toEqual('/foo?date=' + date.toISOString()); }); it('should support array params', function () { - expect(buildUrl('/foo', { + expect(buildURL('/foo', { foo: ['bar', 'baz'] })).toEqual('/foo?foo[]=bar&foo[]=baz'); }); it('should support special char params', function () { - expect(buildUrl('/foo', { + expect(buildURL('/foo', { foo: '@:$, ' })).toEqual('/foo?foo=@:$,+'); }); it('should support existing params', function () { - expect(buildUrl('/foo?foo=bar', { + expect(buildURL('/foo?foo=bar', { bar: 'baz' })).toEqual('/foo?foo=bar&bar=baz'); }); it('should support "length" parameter', function () { - expect(buildUrl('/foo', { + expect(buildURL('/foo', { query: 'bar', start: 0, length: 5 })).toEqual('/foo?query=bar&start=0&length=5'); }); + + it('should use serializer if provided', function () { + serializer = sinon.stub(); + params = {foo: 'bar'}; + serializer.returns('foo=bar'); + expect(buildURL('/foo', params, serializer)).toEqual('/foo?foo=bar'); + expect(serializer.calledOnce).toBe(true); + expect(serializer.calledWith(params)).toBe(true); + }) }); + diff --git a/test/specs/helpers/combineURLs.spec.js b/test/specs/helpers/combineURLs.spec.js new file mode 100644 index 0000000..e09b730 --- /dev/null +++ b/test/specs/helpers/combineURLs.spec.js @@ -0,0 +1,15 @@ +var combineURLs = require('../../../lib/helpers/combineURLs'); + +describe('helpers::combineURLs', function () { + it('should combine URLs', function () { + expect(combineURLs('https://api.github.com', '/users')).toBe('https://api.github.com/users'); + }); + + it('should remove duplicate slashes', function () { + expect(combineURLs('https://api.github.com/', '/users')).toBe('https://api.github.com/users'); + }); + + it('should insert missing slash', function () { + expect(combineURLs('https://api.github.com', 'users')).toBe('https://api.github.com/users'); + }); +}); diff --git a/test/specs/helpers/isAbsoluteURL.spec.js b/test/specs/helpers/isAbsoluteURL.spec.js new file mode 100644 index 0000000..0af4139 --- /dev/null +++ b/test/specs/helpers/isAbsoluteURL.spec.js @@ -0,0 +1,23 @@ +var isAbsoluteURL = require('../../../lib/helpers/isAbsoluteURL'); + +describe('helpers::isAbsoluteURL', function () { + it('should return true if URL begins with valid scheme name', function () { + expect(isAbsoluteURL('https://api.github.com/users')).toBe(true); + expect(isAbsoluteURL('custom-scheme-v1.0://example.com/')).toBe(true); + expect(isAbsoluteURL('HTTP://example.com/')).toBe(true); + }); + + it('should return false if URL begins with invalid scheme name', function () { + expect(isAbsoluteURL('123://example.com/')).toBe(false); + expect(isAbsoluteURL('!valid://example.com/')).toBe(false); + }); + + it('should return true if URL is protocol-relative', function () { + expect(isAbsoluteURL('//example.com/')).toBe(true); + }); + + it('should return false if URL is relative', function () { + expect(isAbsoluteURL('/foo')).toBe(false); + expect(isAbsoluteURL('foo')).toBe(false); + }); +}); diff --git a/test/specs/helpers/isURLSameOrigin.spec.js b/test/specs/helpers/isURLSameOrigin.spec.js new file mode 100644 index 0000000..ec56118 --- /dev/null +++ b/test/specs/helpers/isURLSameOrigin.spec.js @@ -0,0 +1,11 @@ +var isURLSameOrigin = require('../../../lib/helpers/isURLSameOrigin'); + +describe('helpers::isURLSameOrigin', function () { + it('should detect same origin', function () { + expect(isURLSameOrigin(window.location.href)).toEqual(true); + }); + + it('should detect different origin', function () { + expect(isURLSameOrigin('https://github.com/mzabriskie/axios')).toEqual(false); + }); +}); diff --git a/test/specs/helpers/urlIsSameOrigin.spec.js b/test/specs/helpers/urlIsSameOrigin.spec.js deleted file mode 100644 index 12be4e2..0000000 --- a/test/specs/helpers/urlIsSameOrigin.spec.js +++ /dev/null @@ -1,11 +0,0 @@ -var urlIsSameOrigin = require('../../../lib/helpers/urlIsSameOrigin'); - -describe('helpers::urlIsSameOrigin', function () { - it('should detect same origin', function () { - expect(urlIsSameOrigin(window.location.href)).toEqual(true); - }); - - it('should detect different origin', function () { - expect(urlIsSameOrigin('https://github.com/mzabriskie/axios')).toEqual(false); - }); -}); diff --git a/test/specs/instance.spec.js b/test/specs/instance.spec.js new file mode 100644 index 0000000..3024dd0 --- /dev/null +++ b/test/specs/instance.spec.js @@ -0,0 +1,75 @@ +var axios = require('../../index'); + +describe('instance', function () { + beforeEach(function () { + jasmine.Ajax.install(); + }); + + afterEach(function () { + jasmine.Ajax.uninstall(); + }); + + it('should make an http request', function (done) { + var instance = axios.create(); + + instance.request({ + url: '/foo' + }); + + setTimeout(function () { + request = jasmine.Ajax.requests.mostRecent(); + + expect(request.url).toBe('/foo'); + done(); + }, 0); + }); + + it('should use instance options', function (done) { + var instance = axios.create({ timeout: 1000 }); + + instance.request({ + url: '/foo' + }); + + setTimeout(function () { + request = jasmine.Ajax.requests.mostRecent(); + + expect(request.timeout).toBe(1000); + done(); + }, 0); + }); + + it('should have interceptors on the instance', function (done) { + axios.interceptors.request.use(function (config) { + config.foo = true; + return config; + }); + + var instance = axios.create(); + instance.interceptors.request.use(function (config) { + config.bar = true; + return config; + }); + + var response; + instance.request({ + url: '/foo' + }).then(function (res) { + response = res; + }); + + setTimeout(function () { + request = jasmine.Ajax.requests.mostRecent(); + + request.respondWith({ + status: 200 + }); + + setTimeout(function () { + expect(response.config.foo).toEqual(undefined); + expect(response.config.bar).toEqual(true); + done(); + }); + }, 0); + }); +}); diff --git a/test/specs/options.spec.js b/test/specs/options.spec.js index a910662..312fd37 100644 --- a/test/specs/options.spec.js +++ b/test/specs/options.spec.js @@ -78,4 +78,42 @@ describe('options', function () { done(); }, 0); }); + + it('should accept base URL', function (done) { + var request; + + const instance = axios.create({ + baseURL: 'http://test.com/' + }); + + instance.request({ + url: '/foo' + }); + + setTimeout(function () { + request = jasmine.Ajax.requests.mostRecent(); + + expect(request.url).toBe('http://test.com/foo'); + done(); + }, 0); + }); + + it('should ignore base URL if request URL is absolute', function (done) { + var request; + + const instance = axios.create({ + baseURL: 'http://someurl.com/' + }); + + instance.request({ + url: 'http://someotherurl.com/' + }); + + setTimeout(function () { + request = jasmine.Ajax.requests.mostRecent(); + + expect(request.url).toBe('http://someotherurl.com/'); + done(); + }, 0); + }); }); diff --git a/test/specs/requests.spec.js b/test/specs/requests.spec.js index b436d41..a78918e 100644 --- a/test/specs/requests.spec.js +++ b/test/specs/requests.spec.js @@ -54,6 +54,41 @@ describe('requests', function () { }, 0); }); + it('should make cross domian http request', function (done) { + var request, response; + + axios({ + method: 'post', + url: 'www.someurl.com/foo', + xDomain: true + }).then(function(res){ + response = res; + }); + + setTimeout(function () { + request = jasmine.Ajax.requests.mostRecent(); + request.respondWith({ + status: 200, + statusText: 'OK', + responseText: '{"foo": "bar"}', + headers: { + 'Content-Type': 'application/json' + } + }); + + setTimeout(function () { + expect(response.data.foo).toEqual('bar'); + expect(response.status).toEqual(200); + expect(response.statusText).toEqual('OK'); + expect(response.headers['content-type']).toEqual('application/json'); + done(); + }, 0); + + }, 0); + + }); + + it('should supply correct response', function (done) { var request, response; diff --git a/test/specs/utils/forEach.spec.js b/test/specs/utils/forEach.spec.js index f3bc19d..f2de97a 100644 --- a/test/specs/utils/forEach.spec.js +++ b/test/specs/utils/forEach.spec.js @@ -11,18 +11,6 @@ describe('utils::forEach', function () { expect(sum).toEqual(15); }); - it('should loop over arguments', function () { - var sum = 0; - - (function () { - forEach(arguments, function (val) { - sum += val; - }); - })(1, 2, 3, 4, 5); - - expect(sum).toEqual(15); - }); - it('should loop over object keys', function () { var keys = ''; var vals = 0; @@ -61,4 +49,3 @@ describe('utils::forEach', function () { expect(count).toEqual(1); }); }); - diff --git a/test/specs/utils/merge.spec.js b/test/specs/utils/merge.spec.js index 5e826e7..63235d3 100644 --- a/test/specs/utils/merge.spec.js +++ b/test/specs/utils/merge.spec.js @@ -23,5 +23,20 @@ describe('utils::merge', function () { expect(d.foo).toEqual(789); expect(d.bar).toEqual(456); }); + + it('should merge recursively', function () { + var a = {foo: {bar: 123}}; + var b = {foo: {baz: 456}, bar: {qux: 789}}; + + expect(merge(a, b)).toEqual({ + foo: { + bar: 123, + baz: 456 + }, + bar: { + qux: 789 + } + }); + }); }); diff --git a/test/specs/xsrf.spec.js b/test/specs/xsrf.spec.js index 518ae25..d196a37 100644 --- a/test/specs/xsrf.spec.js +++ b/test/specs/xsrf.spec.js @@ -40,4 +40,37 @@ describe('xsrf', function () { done(); }, 0); }); + + it('should not set xsrf header for cross origin', function (done) { + var request; + document.cookie = axios.defaults.xsrfCookieName + '=12345'; + + axios({ + url: 'http://example.com/' + }); + + setTimeout(function () { + request = jasmine.Ajax.requests.mostRecent(); + + expect(request.requestHeaders[axios.defaults.xsrfHeaderName]).toEqual(undefined); + done(); + }); + }); + + it('should set xsrf header for cross origin when using withCredentials', function (done) { + var request; + document.cookie = axios.defaults.xsrfCookieName + '=12345'; + + axios({ + url: 'http://example.com/', + withCredentials: true + }); + + setTimeout(function () { + request = jasmine.Ajax.requests.mostRecent(); + + expect(request.requestHeaders[axios.defaults.xsrfHeaderName]).toEqual('12345'); + done(); + }); + }); }); diff --git a/test/typescript/axios.ts b/test/typescript/axios.ts index e957b50..83146a6 100644 --- a/test/typescript/axios.ts +++ b/test/typescript/axios.ts @@ -4,11 +4,11 @@ import axios = require('axios'); axios.get('/user?ID=12345') .then(function (response) { - console.log(response); - }) + console.log(response); + }) .catch(function (response) { - console.log(response); - }); + console.log(response); + }); axios.get('/user', { params: { @@ -96,16 +96,64 @@ axios({ }); axios({ - url: "hi", - headers: {'X-Requested-With': 'XMLHttpRequest'}, + url: "hi", + headers: {'X-Requested-With': 'XMLHttpRequest'}, + params: { + ID: 12345 + }, + data: { + firstName: 'Fred' + }, + withCredentials: false, // default + responseType: 'json', // default + xsrfCookieName: 'XSRF-TOKEN', // default + xsrfHeaderName: 'X-XSRF-TOKEN' // default +}); + +var instance = axios.create(); + +axios.create({ + transformRequest: (data) => { + return data.doSomething(); + }, + transformResponse: (data) => { + return data.doSomethingElse(); + }, + headers: {'X-Requested-With': 'XMLHttpRequest'}, + timeout: 1000, + withCredentials: false, // default + responseType: 'json', // default + xsrfCookieName: 'XSRF-TOKEN', // default + xsrfHeaderName: 'X-XSRF-TOKEN' // default +}); + +instance.request({ + method: 'get', + url: '/user/12345' + }) + .then(function (response) { + console.log(response); + }) + .catch(function (response) { + console.log(response); + }); + +instance.get('/user?ID=12345') + .then(function (response) { + console.log(response); + }) + .catch(function (response) { + console.log(response); + }); + +instance.get('/user', { params: { ID: 12345 - }, - data: { - firstName: 'Fred' - }, - withCredentials: false, // default - responseType: 'json', // default - xsrfCookieName: 'XSRF-TOKEN', // default - xsrfHeaderName: 'X-XSRF-TOKEN' // default -}); + } + }) + .then(function (response) { + console.log(response); + }) + .catch(function (response) { + console.log(response); + }); diff --git a/test/unit/adapters/http.js b/test/unit/adapters/http.js index 38ee7a5..34caefe 100644 --- a/test/unit/adapters/http.js +++ b/test/unit/adapters/http.js @@ -1,5 +1,6 @@ var axios = require('../../../index'); var http = require('http'); +var zlib = require('zlib'); var server; module.exports = { @@ -27,6 +28,29 @@ module.exports = { }); }, + testTransparentGunzip: function (test) { + var data = { + firstName: 'Fred', + lastName: 'Flintstone', + emailAddr: 'fred@example.com' + }; + + zlib.gzip(JSON.stringify(data), function(err, zipped) { + + server = http.createServer(function (req, res) { + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.setHeader('Content-Encoding', 'gzip'); + res.end(zipped); + }).listen(4444, function () { + axios.get('http://localhost:4444/').then(function (res) { + test.deepEqual(res.data, data); + test.done(); + }); + }); + + }); + }, + testUTF8: function (test) { var str = Array(100000).join('ж'); diff --git a/webpack.config.js b/webpack.config.js index 9254bd6..2afd0f5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -12,6 +12,9 @@ function generateConfig(name) { library: 'axios', libraryTarget: 'umd' }, + node: { + process: false + }, externals: [ { './adapters/http': 'var undefined'