From 99a384e41f9ee695f9e7fa9db454718f24d10bb6 Mon Sep 17 00:00:00 2001 From: Hannu Lyytikainen Date: Tue, 4 Feb 2020 15:53:02 +0200 Subject: [PATCH 1/6] Add dedicated interceptors for grant type and scope Replace setting `grant_type` and `scope` params with the `defaultParams` interceptor in the login fn by using dedicated interceptors. This enables deciding the grant type and scope based on params passed to the login function. --- src/interceptors/add_grant_type_to_params.js | 23 ++++++++++++++++++++ src/interceptors/add_scope_to_params.js | 18 +++++++++++++++ src/sdk.js | 6 +++-- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 src/interceptors/add_grant_type_to_params.js create mode 100644 src/interceptors/add_scope_to_params.js diff --git a/src/interceptors/add_grant_type_to_params.js b/src/interceptors/add_grant_type_to_params.js new file mode 100644 index 00000000..11173523 --- /dev/null +++ b/src/interceptors/add_grant_type_to_params.js @@ -0,0 +1,23 @@ +/** + See what credentials (`username`, `password`, and `authorizationCode`) are + passed in params and set the grant_type based on those. + + Changes to `ctx`: + + - add `params.grant_type` + */ +export default class AddGrantTypeToParams { + enter({ params, ...ctx }) { + const { username, password, code } = params; + + if (username && password) { + return { ...ctx, params: { grant_type: 'password', ...params } }; + } + + if (code) { + return { ...ctx, params: { grant_type: 'authorization_code', ...params } }; + } + + return { ...ctx, params: { ...params } }; + } +} diff --git a/src/interceptors/add_scope_to_params.js b/src/interceptors/add_scope_to_params.js new file mode 100644 index 00000000..e6836c4f --- /dev/null +++ b/src/interceptors/add_scope_to_params.js @@ -0,0 +1,18 @@ +/** + Set the scope for a token request based on the params. + + Changes to `ctx`: + + - add `params.scope` + */ +export default class AddScopeToParams { + enter({ params, ...ctx }) { + const { username, password } = params; + + if (username && password) { + return { ...ctx, params: { scope: 'user', ...params } }; + } + + return { ...ctx, params: { ...params } }; + } +} diff --git a/src/sdk.js b/src/sdk.js index 4ccf3447..01530446 100644 --- a/src/sdk.js +++ b/src/sdk.js @@ -12,8 +12,9 @@ import SaveToken from './interceptors/save_token'; import FetchAuthTokenFromApi from './interceptors/fetch_auth_token_from_api'; import FetchAuthTokenFromStore from './interceptors/fetch_auth_token_from_store'; import AddClientIdToParams from './interceptors/add_client_id_to_params'; +import AddGrantTypeToParams from './interceptors/add_grant_type_to_params'; +import AddScopeToParams from './interceptors/add_scope_to_params'; import AuthInfo from './interceptors/auth_info'; -import defaultParams from './interceptors/default_params'; import MultipartRequest from './interceptors/multipart_request'; import TransitRequest from './interceptors/transit_request'; import TransitResponse from './interceptors/transit_response'; @@ -488,8 +489,9 @@ const authenticateInterceptors = [ ]; const loginInterceptors = [ - defaultParams({ grant_type: 'password', scope: 'user' }), new AddClientIdToParams(), + new AddGrantTypeToParams(), + new AddScopeToParams(), new SaveToken(), new AddAuthTokenResponse(), ]; From 4beeca60a5dfd01c1c073dcf557a765dbc20ba0a Mon Sep 17 00:00:00 2001 From: Hannu Lyytikainen Date: Tue, 4 Feb 2020 18:53:46 +0200 Subject: [PATCH 2/6] Refactor faken token store and Auth API Refactor fake token store and Auth API to better mimic token handling in the actual Auth API. This change enables adding and testing new grant type auth requests. --- src/fake/auth.js | 6 ++--- src/fake/token_store.js | 59 +++++++++++++++++++++++++---------------- src/sdk.test.js | 22 +++++++-------- 3 files changed, 48 insertions(+), 39 deletions(-) diff --git a/src/fake/auth.js b/src/fake/auth.js index a2de5318..0c1aa106 100644 --- a/src/fake/auth.js +++ b/src/fake/auth.js @@ -8,7 +8,7 @@ export const revoke = (config, resolve, reject, tokenStore) => { if (formData.token) { if (tokenStore) { - const revoked = tokenStore.revokePasswordToken(formData.token); + const revoked = tokenStore.revokeRefreshToken(formData.token); if (revoked.length) { return resolve({ data: { action: 'revoked' } }); @@ -31,9 +31,9 @@ export const token = (config, resolve, reject, fakeTokenStore) => { if (formData.grant_type === 'client_credentials') { res = fakeTokenStore.createAnonToken(); } else if (formData.grant_type === 'password') { - res = fakeTokenStore.createPasswordToken(formData.username, formData.password); + res = fakeTokenStore.createTokenWithCredentials(formData.username, formData.password); } else if (formData.grant_type === 'refresh_token') { - res = fakeTokenStore.freshPasswordToken(formData.refresh_token); + res = fakeTokenStore.freshToken(formData.refresh_token); } } diff --git a/src/fake/token_store.js b/src/fake/token_store.js index 1deb4af2..efc89e05 100644 --- a/src/fake/token_store.js +++ b/src/fake/token_store.js @@ -2,27 +2,27 @@ import _ from 'lodash'; const createTokenStore = () => { const tokens = []; - let anonAccessCount = 0; - let passwordAccessCount = 0; - let passwordRefreshCount = 0; + let anonAccessTokenCount = 0; + let accessTokenCount = 0; + let refreshTokenCount = 0; const knownUsers = [['joe.dunphy@example.com', 'secret-joe']]; // Private const generateAnonAccessToken = () => { - anonAccessCount += 1; - return `anonymous-access-${anonAccessCount}`; + anonAccessTokenCount += 1; + return `anonymous-access-${anonAccessTokenCount}`; }; - const generatePasswordAccessToken = (username, password) => { - passwordAccessCount += 1; - return `${username}-${password}-access-${passwordAccessCount}`; + const generateAccessToken = username => { + accessTokenCount += 1; + return `${username}-access-${accessTokenCount}`; }; - const generatePasswordRefreshToken = (username, password) => { - passwordRefreshCount += 1; - return `${username}-${password}-refresh-${passwordRefreshCount}`; + const generateRefreshToken = username => { + refreshTokenCount += 1; + return `${username}-refresh-${refreshTokenCount}`; }; // Public @@ -52,7 +52,7 @@ const createTokenStore = () => { return token.token; }; - const createPasswordToken = (username, password) => { + const createTokenWithCredentials = (username, password) => { const user = _.find(knownUsers, u => _.isEqual(u, [username, password])); if (!user) { @@ -61,14 +61,13 @@ const createTokenStore = () => { const token = { token: { - access_token: generatePasswordAccessToken(username, password), - refresh_token: generatePasswordRefreshToken(username, password), + access_token: generateAccessToken(username), + refresh_token: generateRefreshToken(username), token_type: 'bearer', expires_in: 86400, }, user: { username, - password, }, }; tokens.push(token); @@ -88,15 +87,29 @@ const createTokenStore = () => { }); }; - const revokePasswordToken = refreshToken => + const revokeRefreshToken = refreshToken => _.remove(tokens, t => t.token.refresh_token === refreshToken); - const freshPasswordToken = refreshToken => { - const existingToken = revokePasswordToken(refreshToken); + const freshToken = refreshToken => { + const existingToken = revokeRefreshToken(refreshToken); if (existingToken.length) { - const { username, password } = existingToken[0].user; - return createPasswordToken(username, password); + const { username } = existingToken[0].user; + + const token = { + token: { + access_token: generateAccessToken(username), + refresh_token: generateRefreshToken(username), + token_type: 'bearer', + expires_in: 86400, + }, + user: { + username, + }, + }; + tokens.push(token); + + return token.token; } return null; @@ -104,9 +117,9 @@ const createTokenStore = () => { return { createAnonToken, - createPasswordToken, - freshPasswordToken, - revokePasswordToken, + createTokenWithCredentials, + freshToken, + revokeRefreshToken, validToken, expireAccessToken, }; diff --git a/src/sdk.test.js b/src/sdk.test.js index 979ccf70..a2f9a6ab 100644 --- a/src/sdk.test.js +++ b/src/sdk.test.js @@ -269,7 +269,7 @@ describe('new SharetribeSdk', () => { .login({ username: 'joe.dunphy@example.com', password: 'secret-joe' }) .then(() => { expect(sdkTokenStore.getToken().access_token).toEqual( - 'joe.dunphy@example.com-secret-joe-access-1' + 'joe.dunphy@example.com-access-1' ); }); }) @@ -283,14 +283,12 @@ describe('new SharetribeSdk', () => { return report( sdk.login({ username: 'joe.dunphy@example.com', password: 'secret-joe' }).then(() => { const { access_token } = sdkTokenStore.getToken(); - expect(access_token).toEqual('joe.dunphy@example.com-secret-joe-access-1'); + expect(access_token).toEqual('joe.dunphy@example.com-access-1'); adapterTokenStore.expireAccessToken(access_token); return sdk.marketplace.show({ id: '0e0b60fe-d9a2-11e6-bf26-cec0c932ce01' }).then(res => { - expect(sdkTokenStore.getToken().access_token).toEqual( - 'joe.dunphy@example.com-secret-joe-access-2' - ); + expect(sdkTokenStore.getToken().access_token).toEqual('joe.dunphy@example.com-access-2'); const resource = res.data.data; const attrs = resource.attributes; @@ -342,9 +340,7 @@ describe('new SharetribeSdk', () => { // First, login return report( sdk.login({ username: 'joe.dunphy@example.com', password: 'secret-joe' }).then(() => { - expect(sdkTokenStore.getToken().access_token).toEqual( - 'joe.dunphy@example.com-secret-joe-access-1' - ); + expect(sdkTokenStore.getToken().access_token).toEqual('joe.dunphy@example.com-access-1'); // Revoke token return sdk.logout().then(res => { @@ -367,7 +363,7 @@ describe('new SharetribeSdk', () => { return report( sdk.login({ username: 'joe.dunphy@example.com', password: 'secret-joe' }).then(() => { const { access_token } = sdkTokenStore.getToken(); - expect(access_token).toEqual('joe.dunphy@example.com-secret-joe-access-1'); + expect(access_token).toEqual('joe.dunphy@example.com-access-1'); adapterTokenStore.expireAccessToken(access_token); @@ -392,10 +388,10 @@ describe('new SharetribeSdk', () => { return report( sdk.login({ username: 'joe.dunphy@example.com', password: 'secret-joe' }).then(() => { const { access_token, refresh_token } = sdkTokenStore.getToken(); - expect(access_token).toEqual('joe.dunphy@example.com-secret-joe-access-1'); + expect(access_token).toEqual('joe.dunphy@example.com-access-1'); adapterTokenStore.expireAccessToken(access_token); - adapterTokenStore.revokePasswordToken(refresh_token); + adapterTokenStore.revokeRefreshToken(refresh_token); // Revoke token return sdk.logout().then(() => { @@ -419,10 +415,10 @@ describe('new SharetribeSdk', () => { return report( sdk.login({ username: 'joe.dunphy@example.com', password: 'secret-joe' }).then(() => { const { access_token, refresh_token } = sdkTokenStore.getToken(); - expect(access_token).toEqual('joe.dunphy@example.com-secret-joe-access-1'); + expect(access_token).toEqual('joe.dunphy@example.com-access-1'); adapterTokenStore.expireAccessToken(access_token); - adapterTokenStore.revokePasswordToken(refresh_token); + adapterTokenStore.revokeRefreshToken(refresh_token); // Revoke token return sdk From 62dd566ff91c3a16b69108e58e741d4fc483ed14 Mon Sep 17 00:00:00 2001 From: Hannu Lyytikainen Date: Wed, 5 Feb 2020 10:18:14 +0200 Subject: [PATCH 3/6] Add a test for logging in with an authorization code --- src/fake/auth.js | 2 ++ src/fake/token_store.js | 29 +++++++++++++++++++++++++++++ src/sdk.test.js | 10 ++++++++++ 3 files changed, 41 insertions(+) diff --git a/src/fake/auth.js b/src/fake/auth.js index 0c1aa106..363c48e0 100644 --- a/src/fake/auth.js +++ b/src/fake/auth.js @@ -32,6 +32,8 @@ export const token = (config, resolve, reject, fakeTokenStore) => { res = fakeTokenStore.createAnonToken(); } else if (formData.grant_type === 'password') { res = fakeTokenStore.createTokenWithCredentials(formData.username, formData.password); + } else if (formData.grant_type === 'authorization_code') { + res = fakeTokenStore.createTokenWithAuthorizationCode(formData.code); } else if (formData.grant_type === 'refresh_token') { res = fakeTokenStore.freshToken(formData.refresh_token); } diff --git a/src/fake/token_store.js b/src/fake/token_store.js index efc89e05..f983ead1 100644 --- a/src/fake/token_store.js +++ b/src/fake/token_store.js @@ -8,6 +8,10 @@ const createTokenStore = () => { const knownUsers = [['joe.dunphy@example.com', 'secret-joe']]; + const knownAuthorizationCodes = [ + { code: 'flex-authorization-code', username: 'joe.dunphy@example.com' }, + ]; + // Private const generateAnonAccessToken = () => { @@ -75,6 +79,30 @@ const createTokenStore = () => { return token.token; }; + const createTokenWithAuthorizationCode = authorizationCode => { + const knownCode = _.find(knownAuthorizationCodes, ({ code }) => code === authorizationCode); + + if (!knownCode) { + return null; + } + + const { username } = knownCode; + const token = { + token: { + access_token: generateAccessToken(username), + refresh_token: generateRefreshToken(username), + token_type: 'bearer', + expires_in: 86400, + }, + user: { + username, + }, + }; + tokens.push(token); + + return token.token; + }; + const expireAccessToken = accessToken => { _.map(tokens, t => { const { token } = t; @@ -118,6 +146,7 @@ const createTokenStore = () => { return { createAnonToken, createTokenWithCredentials, + createTokenWithAuthorizationCode, freshToken, revokeRefreshToken, validToken, diff --git a/src/sdk.test.js b/src/sdk.test.js index a2f9a6ab..f9e237f0 100644 --- a/src/sdk.test.js +++ b/src/sdk.test.js @@ -334,6 +334,16 @@ describe('new SharetribeSdk', () => { ); }); + it('logs in with an authorization code', () => { + const { sdk, sdkTokenStore } = createSdk(); + + return sdk.login({ code: 'flex-authorization-code' }).then(() => { + const { access_token, refresh_token } = sdkTokenStore.getToken(); + expect(access_token).toEqual('joe.dunphy@example.com-access-1'); + expect(refresh_token).toEqual('joe.dunphy@example.com-refresh-1'); + }); + }); + it('revokes token (a.k.a logout)', () => { const { sdk, sdkTokenStore } = createSdk(); From f503bb6b0e101ec7cd8c13bca077a8cdbec6ebf6 Mon Sep 17 00:00:00 2001 From: Hannu Lyytikainen Date: Mon, 10 Feb 2020 15:25:12 +0200 Subject: [PATCH 4/6] Update `authInfo` method Returns an array of scopes associated with the token in store. An `isAnonymous` attribute is returned based on the scopes. --- src/fake/token_store.js | 3 +++ src/interceptors/auth_info.js | 18 ++++++++++++++---- src/sdk.test.js | 10 ++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/fake/token_store.js b/src/fake/token_store.js index f983ead1..f2cfadc8 100644 --- a/src/fake/token_store.js +++ b/src/fake/token_store.js @@ -49,6 +49,7 @@ const createTokenStore = () => { access_token: generateAnonAccessToken(), token_type: 'bearer', expires_in: 86400, + scope: 'public-read', }, }; tokens.push(token); @@ -69,6 +70,7 @@ const createTokenStore = () => { refresh_token: generateRefreshToken(username), token_type: 'bearer', expires_in: 86400, + scope: 'user', }, user: { username, @@ -93,6 +95,7 @@ const createTokenStore = () => { refresh_token: generateRefreshToken(username), token_type: 'bearer', expires_in: 86400, + scope: 'user:limited', }, user: { username, diff --git a/src/interceptors/auth_info.js b/src/interceptors/auth_info.js index 0d19644f..a6765e77 100644 --- a/src/interceptors/auth_info.js +++ b/src/interceptors/auth_info.js @@ -1,7 +1,11 @@ /** Reads current authentication token from the tokenStore and returns - information whether the user is currently logged in with anon token - or password token. + the following information: + + - scopes: list of scopes associated with the access token in store + - isAnonymous: boolean value indicating if the access token only grants + access to publicly read data from API + Changes to `ctx`: @@ -17,9 +21,15 @@ export default class AuthInfo { .then(tokenStore.getToken) .then(storedToken => { if (storedToken) { - const grantType = storedToken.refresh_token ? 'refresh_token' : 'client_credentials'; + const tokenScope = storedToken.scope; + const scopes = tokenScope.split(' '); + const isAnonymous = tokenScope === 'public-read'; + + // Deprecated attribute, maintained here for client implementations + // that rely on this attribute + const grantType = isAnonymous ? 'client_credentials' : 'refresh_token'; - return { ...ctx, res: { grantType } }; + return { ...ctx, res: { scopes, isAnonymous, grantType } }; } return { ...ctx, res: {} }; diff --git a/src/sdk.test.js b/src/sdk.test.js index f9e237f0..82f6191c 100644 --- a/src/sdk.test.js +++ b/src/sdk.test.js @@ -636,6 +636,8 @@ describe('new SharetribeSdk', () => { .then(authInfo => { // No auth info yet. expect(authInfo.grantType).toBeUndefined(); + expect(authInfo.isAnonymous).toBeUndefined(); + expect(authInfo.scopes).toBeUndefined(); }) .then(() => sdk.marketplace @@ -644,6 +646,8 @@ describe('new SharetribeSdk', () => { .then(authInfo => { // Anonymous token expect(authInfo.grantType).toEqual('client_credentials'); + expect(authInfo.isAnonymous).toEqual(true); + expect(authInfo.scopes).toEqual(['public-read']); }) ) .then(() => @@ -653,6 +657,8 @@ describe('new SharetribeSdk', () => { .then(authInfo => { // Login token expect(authInfo.grantType).toEqual('refresh_token'); + expect(authInfo.isAnonymous).toEqual(false); + expect(authInfo.scopes).toEqual(['user']); }) ) .then(() => @@ -662,6 +668,8 @@ describe('new SharetribeSdk', () => { .then(authInfo => { // Logout expect(authInfo.grantType).toBeUndefined(); + expect(authInfo.isAnonymous).toBeUndefined(); + expect(authInfo.scopes).toBeUndefined(); }) ) .then(() => @@ -671,6 +679,8 @@ describe('new SharetribeSdk', () => { .then(authInfo => { // Logging out already logged out user does nothing expect(authInfo.grantType).toBeUndefined(); + expect(authInfo.isAnonymous).toBeUndefined(); + expect(authInfo.scopes).toBeUndefined(); }) ) ); From 679d820fd7f53b35a42441aa834b54c207d7c05e Mon Sep 17 00:00:00 2001 From: Hannu Lyytikainen Date: Wed, 5 Feb 2020 10:29:58 +0200 Subject: [PATCH 5/6] Bump version and update build --- build/sharetribe-flex-sdk-node.js | 392 +++++++++++++++++++----------- build/sharetribe-flex-sdk-web.js | 4 +- package.json | 2 +- 3 files changed, 254 insertions(+), 144 deletions(-) diff --git a/build/sharetribe-flex-sdk-node.js b/build/sharetribe-flex-sdk-node.js index 6856e7da..df98957e 100644 --- a/build/sharetribe-flex-sdk-node.js +++ b/build/sharetribe-flex-sdk-node.js @@ -2452,15 +2452,15 @@ module.exports = map; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_reduce___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_reduce__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_flatten__ = __webpack_require__(57); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_flatten___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_flatten__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_find__ = __webpack_require__(189); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_find__ = __webpack_require__(190); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_find___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_find__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_map__ = __webpack_require__(63); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_map__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash_fromPairs__ = __webpack_require__(195); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash_fromPairs__ = __webpack_require__(196); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash_fromPairs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_lodash_fromPairs__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash_identity__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash_identity___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_lodash_identity__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_transit_js__ = __webpack_require__(196); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_transit_js__ = __webpack_require__(197); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_transit_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_transit_js__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__types__ = __webpack_require__(33); @@ -2779,7 +2779,7 @@ var createTransitConverters = function createTransitConverters() { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_js_cookie__ = __webpack_require__(203); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_js_cookie__ = __webpack_require__(204); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_js_cookie___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_js_cookie__); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } @@ -2867,7 +2867,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sdk__ = __webpack_require__(68); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__types__ = __webpack_require__(33); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__browser_cookie_store__ = __webpack_require__(65); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__express_cookie_store__ = __webpack_require__(204); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__express_cookie_store__ = __webpack_require__(205); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__memory_store__ = __webpack_require__(66); /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "types", function() { return __WEBPACK_IMPORTED_MODULE_1__types__; }); @@ -2920,13 +2920,14 @@ var tokenStore = { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__interceptors_fetch_auth_token_from_api__ = __webpack_require__(180); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__interceptors_fetch_auth_token_from_store__ = __webpack_require__(181); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__interceptors_add_client_id_to_params__ = __webpack_require__(182); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__interceptors_auth_info__ = __webpack_require__(183); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__interceptors_default_params__ = __webpack_require__(184); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__interceptors_multipart_request__ = __webpack_require__(185); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__ = __webpack_require__(188); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__ = __webpack_require__(197); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__token_store__ = __webpack_require__(201); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__context_runner__ = __webpack_require__(19); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__interceptors_add_grant_type_to_params__ = __webpack_require__(183); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__interceptors_add_scope_to_params__ = __webpack_require__(184); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__interceptors_auth_info__ = __webpack_require__(185); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__interceptors_multipart_request__ = __webpack_require__(186); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__ = __webpack_require__(189); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__ = __webpack_require__(198); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__token_store__ = __webpack_require__(202); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__context_runner__ = __webpack_require__(19); @@ -2971,6 +2972,7 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr + /* eslint-disable class-methods-use-this */ @@ -3075,319 +3077,319 @@ var endpointDefinitions = [{ path: 'marketplace/show', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'users/show', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'current_user/show', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'current_user/create', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'current_user/update_profile', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'current_user/change_email', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'current_user/change_password', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'current_user/verify_email', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'current_user/send_verification_email', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'current_user/create_stripe_account', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'current_user/update_stripe_account', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'current_user/delete_stripe_account', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'password_reset/request', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'password_reset/reset', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'listings/show', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'own_listings/show', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'listings/query', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'own_listings/query', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'listings/search', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'own_listings/create', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'own_listings/create_draft', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'own_listings/publish_draft', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'own_listings/discard_draft', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'own_listings/update', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'own_listings/open', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'own_listings/close', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'own_listings/add_image', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'availability_exceptions/create', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'availability_exceptions/delete', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'availability_exceptions/query', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'images/upload', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_20__interceptors_multipart_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_multipart_request__["a" /* default */]()] }, { apiName: 'api', path: 'transactions/initiate', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'transactions/initiate_speculative', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'transactions/transition', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'transactions/transition_speculative', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'transactions/query', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'transactions/show', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'process_transitions/query', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'bookings/query', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'messages/query', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'messages/send', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'reviews/query', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'reviews/show', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'timeslots/query', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'stripe_account/create', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'stripe_account/fetch', internal: false, method: 'get', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */]()] }, { apiName: 'api', path: 'stripe_account/update', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'stripe_account_links/create', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'stripe_persons/create', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'stripe_setup_intents/create', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'stripe_customer/create', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'stripe_customer/add_payment_method', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'api', path: 'stripe_customer/delete_payment_method', internal: false, method: 'post', - interceptors: [new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_21__interceptors_transit_request__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_23__interceptors_transit_response__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_22__interceptors_transit_request__["a" /* default */]()] }, { apiName: 'auth', path: 'token', @@ -3402,10 +3404,7 @@ var endpointDefinitions = [{ interceptors: [] }]; var authenticateInterceptors = [new __WEBPACK_IMPORTED_MODULE_16__interceptors_fetch_auth_token_from_store__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_15__interceptors_fetch_auth_token_from_api__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_10__interceptors_retry_with_anon_token__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_9__interceptors_retry_with_refresh_token__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_8__interceptors_add_auth_header__["a" /* default */]()]; -var loginInterceptors = [Object(__WEBPACK_IMPORTED_MODULE_19__interceptors_default_params__["a" /* default */])({ - grant_type: 'password', - scope: 'user' -}), new __WEBPACK_IMPORTED_MODULE_17__interceptors_add_client_id_to_params__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_14__interceptors_save_token__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_13__interceptors_add_auth_token_response__["a" /* default */]()]; +var loginInterceptors = [new __WEBPACK_IMPORTED_MODULE_17__interceptors_add_client_id_to_params__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_18__interceptors_add_grant_type_to_params__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_19__interceptors_add_scope_to_params__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_14__interceptors_save_token__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_13__interceptors_add_auth_token_response__["a" /* default */]()]; var logoutInterceptors = [new __WEBPACK_IMPORTED_MODULE_16__interceptors_fetch_auth_token_from_store__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_11__interceptors_clear_token_after_revoke__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_9__interceptors_retry_with_refresh_token__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_8__interceptors_add_auth_header__["a" /* default */](), new __WEBPACK_IMPORTED_MODULE_12__interceptors_fetch_refresh_token_for_revoke__["a" /* default */]()]; /** Take endpoint definitions and return SDK function definition. @@ -3459,7 +3458,7 @@ var additionalSdkFnDefinitions = [{ interceptors: [].concat(logoutInterceptors) }, { path: 'authInfo', - interceptors: [new __WEBPACK_IMPORTED_MODULE_18__interceptors_auth_info__["a" /* default */]()] + interceptors: [new __WEBPACK_IMPORTED_MODULE_20__interceptors_auth_info__["a" /* default */]()] }]; // const logAndReturn = (data) => { // console.log(data); // return data; @@ -3601,7 +3600,7 @@ var createSdkFnContextRunner = function createSdkFnContextRunner(_ref7) { ctx = _ref7.ctx, interceptors = _ref7.interceptors, endpointInterceptors = _ref7.endpointInterceptors; - return Object(__WEBPACK_IMPORTED_MODULE_24__context_runner__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_3_lodash_compact___default()([].concat(_toConsumableArray(interceptors), _toConsumableArray(endpointInterceptors))))(_objectSpread({}, ctx, { + return Object(__WEBPACK_IMPORTED_MODULE_25__context_runner__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_3_lodash_compact___default()([].concat(_toConsumableArray(interceptors), _toConsumableArray(endpointInterceptors))))(_objectSpread({}, ctx, { params: params, queryParams: queryParams, perRequestOpts: perRequestOpts @@ -3661,7 +3660,7 @@ var transformSdkConfig = function transformSdkConfig(_ref10) { return _objectSpread({}, sdkConfig, { baseUrl: Object(__WEBPACK_IMPORTED_MODULE_6__utils__["c" /* trimEndSlash */])(baseUrl), - tokenStore: tokenStore || Object(__WEBPACK_IMPORTED_MODULE_23__token_store__["a" /* createDefaultTokenStore */])(tokenStore, sdkConfig.clientId, !!sdkConfig.secure) + tokenStore: tokenStore || Object(__WEBPACK_IMPORTED_MODULE_24__token_store__["a" /* createDefaultTokenStore */])(tokenStore, sdkConfig.clientId, !!sdkConfig.secure) }); }; // Validate SDK configurations, throw an error if invalid, otherwise return. @@ -7916,13 +7915,17 @@ function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AuthInfo; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AddGrantTypeToParams; }); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } @@ -7930,51 +7933,53 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** - Reads current authentication token from the tokenStore and returns - information whether the user is currently logged in with anon token - or password token. + See what credentials (`username`, `password`, and `authorizationCode`) are + passed in params and set the grant_type based on those. Changes to `ctx`: - - add `res` - -*/ -var AuthInfo = + - add `params.grant_type` + */ +var AddGrantTypeToParams = /*#__PURE__*/ function () { - function AuthInfo() { - _classCallCheck(this, AuthInfo); + function AddGrantTypeToParams() { + _classCallCheck(this, AddGrantTypeToParams); } - _createClass(AuthInfo, [{ + _createClass(AddGrantTypeToParams, [{ key: "enter", - value: function enter(ctx) { - var tokenStore = ctx.tokenStore; + value: function enter(_ref) { + var params = _ref.params, + ctx = _objectWithoutProperties(_ref, ["params"]); - if (tokenStore) { - return Promise.resolve().then(tokenStore.getToken).then(function (storedToken) { - if (storedToken) { - var grantType = storedToken.refresh_token ? 'refresh_token' : 'client_credentials'; - return _objectSpread({}, ctx, { - res: { - grantType: grantType - } - }); - } + var username = params.username, + password = params.password, + code = params.code; - return _objectSpread({}, ctx, { - res: {} - }); + if (username && password) { + return _objectSpread({}, ctx, { + params: _objectSpread({ + grant_type: 'password' + }, params) + }); + } + + if (code) { + return _objectSpread({}, ctx, { + params: _objectSpread({ + grant_type: 'authorization_code' + }, params) }); } return _objectSpread({}, ctx, { - res: {} + params: _objectSpread({}, params) }); } }]); - return AuthInfo; + return AddGrantTypeToParams; }(); @@ -7984,6 +7989,7 @@ function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AddScopeToParams; }); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } @@ -7994,38 +8000,142 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + /** - Add given params to the `ctx.params` + Set the scope for a token request based on the params. Changes to `ctx`: - - Modify `ctx.params` + - add `params.scope` */ -var defaultParams = function defaultParams() { - var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - return { - enter: function enter(_ref) { - var ctxParams = _ref.params, +var AddScopeToParams = +/*#__PURE__*/ +function () { + function AddScopeToParams() { + _classCallCheck(this, AddScopeToParams); + } + + _createClass(AddScopeToParams, [{ + key: "enter", + value: function enter(_ref) { + var params = _ref.params, ctx = _objectWithoutProperties(_ref, ["params"]); + var username = params.username, + password = params.password; + + if (username && password) { + return _objectSpread({}, ctx, { + params: _objectSpread({ + scope: 'user' + }, params) + }); + } + return _objectSpread({}, ctx, { - params: _objectSpread({}, params, {}, ctxParams) + params: _objectSpread({}, params) }); } - }; -}; + }]); + + return AddScopeToParams; +}(); + -/* harmony default export */ __webpack_exports__["a"] = (defaultParams); /***/ }), /* 185 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AuthInfo; }); +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +/** + Reads current authentication token from the tokenStore and returns + the following information: + + - scopes: list of scopes associated with the access token in store + - isAnonymous: boolean value indicating if the access token only grants + access to publicly read data from API + + + Changes to `ctx`: + + - add `res` + +*/ +var AuthInfo = +/*#__PURE__*/ +function () { + function AuthInfo() { + _classCallCheck(this, AuthInfo); + } + + _createClass(AuthInfo, [{ + key: "enter", + value: function enter(ctx) { + var tokenStore = ctx.tokenStore; + + if (tokenStore) { + return Promise.resolve().then(tokenStore.getToken).then(function (storedToken) { + if (storedToken) { + var tokenScope = storedToken.scope; + var scopes = tokenScope.split(' '); + var isAnonymous = tokenScope === 'public-read'; // Deprecated attribute, maintained here for client implementations + // that rely on this attribute + + var grantType = isAnonymous ? 'client_credentials' : 'refresh_token'; + return _objectSpread({}, ctx, { + res: { + scopes: scopes, + isAnonymous: isAnonymous, + grantType: grantType + } + }); + } + + return _objectSpread({}, ctx, { + res: {} + }); + }); + } + + return _objectSpread({}, ctx, { + res: {} + }); + } + }]); + + return AuthInfo; +}(); + + + +/***/ }), +/* 186 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MultipartRequest; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_reduce__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_reduce___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_reduce__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_isPlainObject__ = __webpack_require__(186); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_isPlainObject__ = __webpack_require__(187); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_isPlainObject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isPlainObject__); @@ -8096,11 +8206,11 @@ function () { /***/ }), -/* 186 */ +/* 187 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(4), - getPrototype = __webpack_require__(187), + getPrototype = __webpack_require__(188), isObjectLike = __webpack_require__(2); /** `Object#toString` result references. */ @@ -8164,7 +8274,7 @@ module.exports = isPlainObject; /***/ }), -/* 187 */ +/* 188 */ /***/ (function(module, exports, __webpack_require__) { var overArg = __webpack_require__(46); @@ -8176,7 +8286,7 @@ module.exports = getPrototype; /***/ }), -/* 188 */ +/* 189 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8246,11 +8356,11 @@ function () { /***/ }), -/* 189 */ +/* 190 */ /***/ (function(module, exports, __webpack_require__) { -var createFind = __webpack_require__(190), - findIndex = __webpack_require__(191); +var createFind = __webpack_require__(191), + findIndex = __webpack_require__(192); /** * Iterates over elements of `collection`, returning the first element @@ -8294,7 +8404,7 @@ module.exports = find; /***/ }), -/* 190 */ +/* 191 */ /***/ (function(module, exports, __webpack_require__) { var baseIteratee = __webpack_require__(9), @@ -8325,12 +8435,12 @@ module.exports = createFind; /***/ }), -/* 191 */ +/* 192 */ /***/ (function(module, exports, __webpack_require__) { var baseFindIndex = __webpack_require__(62), baseIteratee = __webpack_require__(9), - toInteger = __webpack_require__(192); + toInteger = __webpack_require__(193); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; @@ -8386,10 +8496,10 @@ module.exports = findIndex; /***/ }), -/* 192 */ +/* 193 */ /***/ (function(module, exports, __webpack_require__) { -var toFinite = __webpack_require__(193); +var toFinite = __webpack_require__(194); /** * Converts `value` to an integer. @@ -8428,10 +8538,10 @@ module.exports = toInteger; /***/ }), -/* 193 */ +/* 194 */ /***/ (function(module, exports, __webpack_require__) { -var toNumber = __webpack_require__(194); +var toNumber = __webpack_require__(195); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, @@ -8476,7 +8586,7 @@ module.exports = toFinite; /***/ }), -/* 194 */ +/* 195 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(5), @@ -8548,7 +8658,7 @@ module.exports = toNumber; /***/ }), -/* 195 */ +/* 196 */ /***/ (function(module, exports) { /** @@ -8582,7 +8692,7 @@ module.exports = fromPairs; /***/ }), -/* 196 */ +/* 197 */ /***/ (function(module, exports) { // transit-js 0.8.862 @@ -12452,12 +12562,12 @@ writeCache:com.cognitect.transit.caching.writeCache}); /***/ }), -/* 197 */ +/* 198 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TransitResponse; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_update__ = __webpack_require__(198); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_update__ = __webpack_require__(199); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_update___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_update__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__serializer__ = __webpack_require__(64); @@ -12522,11 +12632,11 @@ function () { /***/ }), -/* 198 */ +/* 199 */ /***/ (function(module, exports, __webpack_require__) { -var baseUpdate = __webpack_require__(199), - castFunction = __webpack_require__(200); +var baseUpdate = __webpack_require__(200), + castFunction = __webpack_require__(201); /** * This method is like `_.set` except that accepts `updater` to produce the @@ -12563,7 +12673,7 @@ module.exports = update; /***/ }), -/* 199 */ +/* 200 */ /***/ (function(module, exports, __webpack_require__) { var baseGet = __webpack_require__(11), @@ -12587,7 +12697,7 @@ module.exports = baseUpdate; /***/ }), -/* 200 */ +/* 201 */ /***/ (function(module, exports, __webpack_require__) { var identity = __webpack_require__(10); @@ -12607,12 +12717,12 @@ module.exports = castFunction; /***/ }), -/* 201 */ +/* 202 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createDefaultTokenStore; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__detect__ = __webpack_require__(202); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__detect__ = __webpack_require__(203); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__browser_cookie_store__ = __webpack_require__(65); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__memory_store__ = __webpack_require__(66); @@ -12634,7 +12744,7 @@ var createDefaultTokenStore = function createDefaultTokenStore(tokenStore, clien }; /***/ }), -/* 202 */ +/* 203 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -12655,7 +12765,7 @@ var hasBrowserCookies = function hasBrowserCookies() { }; /***/ }), -/* 203 */ +/* 204 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! @@ -12828,7 +12938,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! /***/ }), -/* 204 */ +/* 205 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; diff --git a/build/sharetribe-flex-sdk-web.js b/build/sharetribe-flex-sdk-web.js index 670c5d87..6ee66de1 100644 --- a/build/sharetribe-flex-sdk-web.js +++ b/build/sharetribe-flex-sdk-web.js @@ -1,7 +1,7 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.sharetribeSdk=e():t.sharetribeSdk=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=77)}([function(t,e,n){"use strict";function r(t){return"[object Array]"===T.call(t)}function o(t){return"[object ArrayBuffer]"===T.call(t)}function i(t){return"undefined"!=typeof FormData&&t instanceof FormData}function a(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer}function c(t){return"string"==typeof t}function s(t){return"number"==typeof t}function u(t){return void 0===t}function g(t){return null!==t&&"object"==typeof t}function p(t){return"[object Date]"===T.call(t)}function l(t){return"[object File]"===T.call(t)}function f(t){return"[object Blob]"===T.call(t)}function h(t){return"[object Function]"===T.call(t)}function m(t){return g(t)&&h(t.pipe)}function d(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams}function y(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function b(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function v(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),r(t))for(var n=0,o=t.length;n=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function o(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}function i(t,e){return s(t)||c(t,e)||a()}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function c(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}function s(t){if(Array.isArray(t))return t}function u(t){return l(t)||p(t)||g()}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function p(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function l(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{},{enterQueue:u(arguments.length>1?arguments[1]:void 0).reverse(),leaveStack:[]})},b=function(t,e,n){return d(t).then(e[n]||d).catch(function(r){var o=r.ctx||t;return Promise.resolve(h({},o,{error:r,errorMiddleware:e.constructor.name,errorStage:n}))})},v=function(t){var e,n,r=u(t.leaveStack),o=u(t.enterQueue);return t.error?(e=r.shift(),n="error"):o.length?(e=o.pop(),r.unshift(e),n="enter"):(e=r.shift(),n="leave"),[h({},t,{enterQueue:o,leaveStack:r}),e,n]},_=function t(e){var n=v(e),o=i(n,3),a=o[0],c=o[1],s=o[2];if(c)return b(a,c,s).then(t);if(a.error){var u=a.error,g=r(a,["error"]);return u.ctx=g,Promise.reject(u)}return Promise.resolve(a)},w=function(t){return function(e){return _(y(e,t))}};e.a=w},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n-1&&t%1==0&&t-1&&t%1==0&&t<=r}var r=9007199254740991;t.exports=n},function(t,e,n){function r(t,e,n){var r=s(t)?o:c,u=arguments.length<3;return r(t,a(e,4),n,u,i)}var o=n(181),i=n(70),a=n(10),c=n(183),s=n(1);t.exports=r},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"UUID",function(){return o}),n.d(e,"LatLng",function(){return i}),n.d(e,"LatLngBounds",function(){return a}),n.d(e,"Money",function(){return c}),n.d(e,"BigDecimal",function(){return s}),n.d(e,"toType",function(){return u}),n.d(e,"replacer",function(){return g}),n.d(e,"reviver",function(){return p});var o=function t(e){r(this,t),this._sdkType=this.constructor._sdkType,this.uuid=e};o._sdkType="UUID";var i=function t(e,n){r(this,t),this._sdkType=this.constructor._sdkType,this.lat=e,this.lng=n};i._sdkType="LatLng";var a=function t(e,n){r(this,t),this._sdkType=this.constructor._sdkType,this.ne=e,this.sw=n};a._sdkType="LatLngBounds";var c=function t(e,n){r(this,t),this._sdkType=this.constructor._sdkType,this.amount=e,this.currency=n};c._sdkType="Money";var s=function t(e){r(this,t),this._sdkType=this.constructor._sdkType,this.value=e};s._sdkType="BigDecimal";var u=function(t){switch(t&&t._sdkType){case"LatLng":return new i(t.lat,t.lng);case"LatLngBounds":return new a(t.ne,t.sw);case"UUID":return new o(t.uuid);case"Money":return new c(t.amount,t.currency);case"BigDecimal":return new s(t.value);default:return t}},g=function(t,e){return e},p=function(t,e){return u(e)}},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(e,n(36))},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){function r(t){if(!i(t))return!1;var e=o(t);return e==c||e==s||e==a||e==u}var o=n(5),i=n(6),a="[object AsyncFunction]",c="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";t.exports=r},function(t,e){function n(t){if(null!=t){try{return o.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var r=Function.prototype,o=r.toString;t.exports=n},function(t,e,n){function r(t){return null==t?"":o(t)}var o=n(40);t.exports=r},function(t,e,n){function r(t){if("string"==typeof t)return t;if(a(t))return i(t,r)+"";if(c(t))return g?g.call(t):"";var e=t+"";return"0"==e&&1/t==-s?"-0":e}var o=n(7),i=n(28),a=n(1),c=n(14),s=1/0,u=o?o.prototype:void 0,g=u?u.toString:void 0;t.exports=r},function(t,e,n){function r(t,e,n){"__proto__"==e&&o?o(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var o=n(42);t.exports=r},function(t,e,n){var r=n(4),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,n){function r(t,e){return t&&o(t,e,i)}var o=n(108),i=n(19);t.exports=r},function(t,e,n){(function(t){var r=n(2),o=n(113),i="object"==typeof e&&e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,c=a&&a.exports===i,s=c?r.Buffer:void 0,u=s?s.isBuffer:void 0,g=u||o;t.exports=g}).call(e,n(45)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(114),o=n(47),i=n(115),a=i&&i.isTypedArray,c=a?o(a):r;t.exports=c},function(t,e){function n(t){return function(e){return t(e)}}t.exports=n},function(t,e){function n(t,e){return function(n){return t(e(n))}}t.exports=n},function(t,e,n){function r(t){var e=this.__data__=new o(t);this.size=e.size}var o=n(16),i=n(121),a=n(122),c=n(123),s=n(124),u=n(125);r.prototype.clear=i,r.prototype.delete=a,r.prototype.get=c,r.prototype.has=s,r.prototype.set=u,t.exports=r},function(t,e,n){function r(t,e,n,a,c){return t===e||(null==t||null==e||!i(t)&&!i(e)?t!==t&&e!==e:o(t,e,n,a,r,c))}var o=n(126),i=n(3);t.exports=r},function(t,e,n){function r(t,e,n,r,u,g){var p=n&c,l=t.length,f=e.length;if(l!=f&&!(p&&f>l))return!1;var h=g.get(t);if(h&&g.get(e))return h==e;var m=-1,d=!0,y=n&s?new o:void 0;for(g.set(t,e),g.set(e,t);++m=200&&t<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],function(t){c.headers[t]={}}),o.forEach(["post","put","patch"],function(t){c.headers[t]=o.merge(a)}),t.exports=c}).call(e,n(169))},function(t,e,n){"use strict";var r=n(0),o=n(171),i=n(63),a=n(173),c=n(174),s=n(67);t.exports=function(t){return new Promise(function(e,u){var g=t.data,p=t.headers;r.isFormData(g)&&delete p["Content-Type"];var l=new XMLHttpRequest;if(t.auth){var f=t.auth.username||"",h=t.auth.password||"";p.Authorization="Basic "+btoa(f+":"+h)}if(l.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),l.timeout=t.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in l?a(l.getAllResponseHeaders()):null,r=t.responseType&&"text"!==t.responseType?l.response:l.responseText,i={data:r,status:l.status,statusText:l.statusText,headers:n,config:t,request:l};o(e,u,i),l=null}},l.onabort=function(){l&&(u(s("Request aborted",t,"ECONNABORTED",l)),l=null)},l.onerror=function(){u(s("Network Error",t,null,l)),l=null},l.ontimeout=function(){u(s("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",l)),l=null},r.isStandardBrowserEnv()){var m=n(175),d=(t.withCredentials||c(t.url))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;d&&(p[t.xsrfHeaderName]=d)}if("setRequestHeader"in l&&r.forEach(p,function(t,e){void 0===g&&"content-type"===e.toLowerCase()?delete p[e]:l.setRequestHeader(e,t)}),t.withCredentials&&(l.withCredentials=!0),t.responseType)try{l.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&l.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){l&&(l.abort(),u(t),l=null)}),void 0===g&&(g=null),l.send(g)})}},function(t,e,n){"use strict";var r=n(172);t.exports=function(t,e,n,o,i){var a=new Error(t);return r(a,e,n,o,i)}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){e=e||{};var n={};return r.forEach(["url","method","params","data"],function(t){void 0!==e[t]&&(n[t]=e[t])}),r.forEach(["headers","auth","proxy"],function(o){r.isObject(e[o])?n[o]=r.deepMerge(t[o],e[o]):void 0!==e[o]?n[o]=e[o]:r.isObject(t[o])?n[o]=r.deepMerge(t[o]):void 0!==t[o]&&(n[o]=t[o])}),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])}),n}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){var r=n(43),o=n(182),i=o(r);t.exports=i},function(t,e,n){function r(t,e,n){return e===e?a(t,e,n):o(t,i,n)}var o=n(72),i=n(187),a=n(188);t.exports=r},function(t,e){function n(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i0&&void 0!==arguments[0]?arguments[0]:[],e=N(t);return L.a.reader("json",{handlers:u({},e,{":":function(t){return t},set:function(t){return t},list:function(t){return t}}),mapBuilder:U})},B=[Object,L.a.makeWriteHandler({tag:function(){return"map"},rep:function(t){return b()(t,function(t,e,n){return t.set(L.a.keyword(n),e),t},L.a.map())}})],H=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.verbose,i=n?"json-verbose":"json";return L.a.writer(i,{handlers:L.a.map([].concat(o(R),B)),transform:function(e){if(d()(e)){if(e._sdkType)return Object(P.toType)(e);var n=O()(t,function(t){return t.appType&&e instanceof t.appType||t.canHandle&&t.canHandle(e)});if(n)return n.writer(e)}return e},handlerForForeign:function(t,e){return Array.isArray(t)?e.get("array"):"object"===r(t)?e.get("map"):null}})},$=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,n=t.reduce(function(t,e){var n={sdkType:e.sdkType||e.type,reader:e.reader},r={sdkType:e.sdkType||e.type,appType:e.appType||e.customType,canHandle:e.canHandle,writer:e.writer};return t.readers.push(n),t.writers.push(r),t},{readers:[],writers:[]}),r=n.readers,o=n.writers;return{reader:q(r),writer:H(o,e)}}},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function o(t){for(var e=1;e=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function i(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function c(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return ot(c({params:e,queryParams:n,perRequestOpts:rt(r)},t))}},at=function(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ot(c({params:e},t))}},ct=function(t){var e=t.method,n=o(t,["method"]);return e&&"post"===e.toLowerCase()?it(n):at(n)},st=function(t){var e=t.baseUrl,n=t.tokenStore,r=o(t,["baseUrl","tokenStore"]);return c({},r,{baseUrl:Object(T.c)(e),tokenStore:n||Object($.a)(n,r.clientId,!!r.secure)})},ut=function(t){if(!t.clientId)throw new Error("clientId must be provided");if(!t.baseUrl)throw new Error("baseUrl must be provided");return t},gt=function t(e){var n=this;r(this,t);var o=ut(st(c({},V,{},e))),i=b()(W,function(t){return t(o)}),a=[].concat(G).map(function(t){var e=t.path,n=t.apiName,r=t.method,o=t.interceptors,a=void 0===o?[]:o,s=Object(T.a)(e),g=[n].concat(u(s)),p=[n,e].join("/"),l=i[n];return c({},t,{fnPath:s,fullFnPath:g,endpointInterceptors:[].concat(u(a),[et({method:r,url:p,httpOpts:l})])})}),s=a.reduce(function(t,e){var n=e.fullFnPath,r=e.endpointInterceptors;return d()(t,n,r)},{}),g={tokenStore:o.tokenStore,endpointInterceptors:s,clientId:o.clientId,typeHandlers:o.typeHandlers,transitVerbose:o.transitVerbose};[].concat(u(X),Z).map(function(t){var e=t.path,n=t.method,r=t.endpointInterceptorPath,o=t.interceptors;return{path:e,fn:ct({method:n,ctx:g,endpointInterceptors:h()(s,r)||[],interceptors:o})}}).forEach(function(t){var e=t.path,r=t.fn;return d()(n,e,r)})}},function(t,e,n){function r(t){var e=a.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var o=c.call(t);return r&&(e?t[s]=n:delete t[s]),o}var o=n(7),i=Object.prototype,a=i.hasOwnProperty,c=i.toString,s=o?o.toStringTag:void 0;t.exports=r},function(t,e){function n(t){return o.call(t)}var r=Object.prototype,o=r.toString;t.exports=n},function(t,e,n){var r=n(82),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,function(t,n,r,o){e.push(r?o.replace(i,"$1"):n||t)}),e});t.exports=a},function(t,e,n){function r(t){var e=o(t,function(t){return n.size===i&&n.clear(),t}),n=e.cache;return e}var o=n(83),i=500;t.exports=r},function(t,e,n){function r(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(i);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(r.Cache||o),n}var o=n(25),i="Expected a function";r.Cache=o,t.exports=r},function(t,e,n){function r(){this.size=0,this.__data__={hash:new o,map:new(a||i),string:new o}}var o=n(85),i=n(16),a=n(27);t.exports=r},function(t,e,n){function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1}var o=n(17);t.exports=r},function(t,e,n){function r(t,e){var n=this.__data__,r=o(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var o=n(17);t.exports=r},function(t,e,n){function r(t){var e=o(this,t).delete(t);return this.size-=e?1:0,e}var o=n(18);t.exports=r},function(t,e){function n(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}t.exports=n},function(t,e,n){function r(t){return o(this,t).get(t)}var o=n(18);t.exports=r},function(t,e,n){function r(t){return o(this,t).has(t)}var o=n(18);t.exports=r},function(t,e,n){function r(t,e){var n=o(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var o=n(18);t.exports=r},function(t,e,n){function r(t,e,n){return null==t?t:o(t,e,n)}var o=n(29);t.exports=r},function(t,e,n){function r(t,e,n){var r=t[e];c.call(t,e)&&i(r,n)&&(void 0!==n||e in t)||o(t,e,n)}var o=n(41),i=n(26),a=Object.prototype,c=a.hasOwnProperty;t.exports=r},function(t,e,n){function r(t,e){var n={};return e=a(e,3),i(t,function(t,r,i){o(n,r,e(t,r,i))}),n}var o=n(41),i=n(43),a=n(10);t.exports=r},function(t,e,n){var r=n(109),o=r();t.exports=o},function(t,e){function n(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),c=a.length;c--;){var s=a[t?c:++o];if(!1===n(i[s],s,i))break}return e}}t.exports=n},function(t,e,n){function r(t,e){var n=a(t),r=!n&&i(t),g=!n&&!r&&c(t),l=!n&&!r&&!g&&u(t),f=n||r||g||l,h=f?o(t.length,String):[],m=h.length;for(var d in t)!e&&!p.call(t,d)||f&&("length"==d||g&&("offset"==d||"parent"==d)||l&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||s(d,m))||h.push(d);return h}var o=n(111),i=n(31),a=n(1),c=n(44),s=n(30),u=n(46),g=Object.prototype,p=g.hasOwnProperty;t.exports=r},function(t,e){function n(t,e){for(var n=-1,r=Array(t);++n0&&n(g)?e>1?r(g,e-1,n,a,c):o(c,g):a||(c[c.length]=g)}return c}var o=n(54),i=n(157);t.exports=r},function(t,e,n){function r(t){return a(t)||i(t)||!!(c&&t&&t[c])}var o=n(7),i=n(31),a=n(1),c=o?o.isConcatSpreadable:void 0;t.exports=r},function(t,e){function n(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}t.exports=n},function(t,e,n){var r=n(160),o=n(42),i=n(11),a=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i;t.exports=a},function(t,e){function n(t){return function(){return t}}t.exports=n},function(t,e){function n(t){var e=0,n=0;return function(){var a=i(),c=o-(a-n);if(n=a,c>0){if(++e>=r)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var r=800,o=16,i=Date.now;t.exports=n},function(t,e,n){t.exports=n(163)},function(t,e,n){"use strict";function r(t){var e=new a(t),n=i(a.prototype.request,e);return o.extend(n,a.prototype,e),o.extend(n,e),n}var o=n(0),i=n(62),a=n(165),c=n(68),s=n(65),u=r(s);u.Axios=a,u.create=function(t){return r(c(u.defaults,t))},u.Cancel=n(69),u.CancelToken=n(178),u.isCancel=n(64),u.all=function(t){return Promise.all(t)},u.spread=n(179),t.exports=u,t.exports.default=u},function(t,e){/*! +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.sharetribeSdk=e():t.sharetribeSdk=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=77)}([function(t,e,n){"use strict";function r(t){return"[object Array]"===j.call(t)}function o(t){return"[object ArrayBuffer]"===j.call(t)}function i(t){return"undefined"!=typeof FormData&&t instanceof FormData}function a(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer}function c(t){return"string"==typeof t}function s(t){return"number"==typeof t}function u(t){return void 0===t}function g(t){return null!==t&&"object"==typeof t}function p(t){return"[object Date]"===j.call(t)}function l(t){return"[object File]"===j.call(t)}function f(t){return"[object Blob]"===j.call(t)}function h(t){return"[object Function]"===j.call(t)}function m(t){return g(t)&&h(t.pipe)}function d(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams}function y(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function b(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function v(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),r(t))for(var n=0,o=t.length;n=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function o(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}function i(t,e){return s(t)||c(t,e)||a()}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function c(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}function s(t){if(Array.isArray(t))return t}function u(t){return l(t)||p(t)||g()}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function p(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function l(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{},{enterQueue:u(arguments.length>1?arguments[1]:void 0).reverse(),leaveStack:[]})},b=function(t,e,n){return d(t).then(e[n]||d).catch(function(r){var o=r.ctx||t;return Promise.resolve(h({},o,{error:r,errorMiddleware:e.constructor.name,errorStage:n}))})},v=function(t){var e,n,r=u(t.leaveStack),o=u(t.enterQueue);return t.error?(e=r.shift(),n="error"):o.length?(e=o.pop(),r.unshift(e),n="enter"):(e=r.shift(),n="leave"),[h({},t,{enterQueue:o,leaveStack:r}),e,n]},_=function t(e){var n=v(e),o=i(n,3),a=o[0],c=o[1],s=o[2];if(c)return b(a,c,s).then(t);if(a.error){var u=a.error,g=r(a,["error"]);return u.ctx=g,Promise.reject(u)}return Promise.resolve(a)},w=function(t){return function(e){return _(y(e,t))}};e.a=w},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n-1&&t%1==0&&t-1&&t%1==0&&t<=r}var r=9007199254740991;t.exports=n},function(t,e,n){function r(t,e,n){var r=s(t)?o:c,u=arguments.length<3;return r(t,a(e,4),n,u,i)}var o=n(181),i=n(70),a=n(10),c=n(183),s=n(1);t.exports=r},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"UUID",function(){return o}),n.d(e,"LatLng",function(){return i}),n.d(e,"LatLngBounds",function(){return a}),n.d(e,"Money",function(){return c}),n.d(e,"BigDecimal",function(){return s}),n.d(e,"toType",function(){return u}),n.d(e,"replacer",function(){return g}),n.d(e,"reviver",function(){return p});var o=function t(e){r(this,t),this._sdkType=this.constructor._sdkType,this.uuid=e};o._sdkType="UUID";var i=function t(e,n){r(this,t),this._sdkType=this.constructor._sdkType,this.lat=e,this.lng=n};i._sdkType="LatLng";var a=function t(e,n){r(this,t),this._sdkType=this.constructor._sdkType,this.ne=e,this.sw=n};a._sdkType="LatLngBounds";var c=function t(e,n){r(this,t),this._sdkType=this.constructor._sdkType,this.amount=e,this.currency=n};c._sdkType="Money";var s=function t(e){r(this,t),this._sdkType=this.constructor._sdkType,this.value=e};s._sdkType="BigDecimal";var u=function(t){switch(t&&t._sdkType){case"LatLng":return new i(t.lat,t.lng);case"LatLngBounds":return new a(t.ne,t.sw);case"UUID":return new o(t.uuid);case"Money":return new c(t.amount,t.currency);case"BigDecimal":return new s(t.value);default:return t}},g=function(t,e){return e},p=function(t,e){return u(e)}},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(e,n(36))},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){function r(t){if(!i(t))return!1;var e=o(t);return e==c||e==s||e==a||e==u}var o=n(5),i=n(6),a="[object AsyncFunction]",c="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";t.exports=r},function(t,e){function n(t){if(null!=t){try{return o.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var r=Function.prototype,o=r.toString;t.exports=n},function(t,e,n){function r(t){return null==t?"":o(t)}var o=n(40);t.exports=r},function(t,e,n){function r(t){if("string"==typeof t)return t;if(a(t))return i(t,r)+"";if(c(t))return g?g.call(t):"";var e=t+"";return"0"==e&&1/t==-s?"-0":e}var o=n(7),i=n(28),a=n(1),c=n(14),s=1/0,u=o?o.prototype:void 0,g=u?u.toString:void 0;t.exports=r},function(t,e,n){function r(t,e,n){"__proto__"==e&&o?o(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var o=n(42);t.exports=r},function(t,e,n){var r=n(4),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,n){function r(t,e){return t&&o(t,e,i)}var o=n(108),i=n(19);t.exports=r},function(t,e,n){(function(t){var r=n(2),o=n(113),i="object"==typeof e&&e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,c=a&&a.exports===i,s=c?r.Buffer:void 0,u=s?s.isBuffer:void 0,g=u||o;t.exports=g}).call(e,n(45)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(114),o=n(47),i=n(115),a=i&&i.isTypedArray,c=a?o(a):r;t.exports=c},function(t,e){function n(t){return function(e){return t(e)}}t.exports=n},function(t,e){function n(t,e){return function(n){return t(e(n))}}t.exports=n},function(t,e,n){function r(t){var e=this.__data__=new o(t);this.size=e.size}var o=n(16),i=n(121),a=n(122),c=n(123),s=n(124),u=n(125);r.prototype.clear=i,r.prototype.delete=a,r.prototype.get=c,r.prototype.has=s,r.prototype.set=u,t.exports=r},function(t,e,n){function r(t,e,n,a,c){return t===e||(null==t||null==e||!i(t)&&!i(e)?t!==t&&e!==e:o(t,e,n,a,r,c))}var o=n(126),i=n(3);t.exports=r},function(t,e,n){function r(t,e,n,r,u,g){var p=n&c,l=t.length,f=e.length;if(l!=f&&!(p&&f>l))return!1;var h=g.get(t);if(h&&g.get(e))return h==e;var m=-1,d=!0,y=n&s?new o:void 0;for(g.set(t,e),g.set(e,t);++m=200&&t<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],function(t){c.headers[t]={}}),o.forEach(["post","put","patch"],function(t){c.headers[t]=o.merge(a)}),t.exports=c}).call(e,n(169))},function(t,e,n){"use strict";var r=n(0),o=n(171),i=n(63),a=n(173),c=n(174),s=n(67);t.exports=function(t){return new Promise(function(e,u){var g=t.data,p=t.headers;r.isFormData(g)&&delete p["Content-Type"];var l=new XMLHttpRequest;if(t.auth){var f=t.auth.username||"",h=t.auth.password||"";p.Authorization="Basic "+btoa(f+":"+h)}if(l.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),l.timeout=t.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in l?a(l.getAllResponseHeaders()):null,r=t.responseType&&"text"!==t.responseType?l.response:l.responseText,i={data:r,status:l.status,statusText:l.statusText,headers:n,config:t,request:l};o(e,u,i),l=null}},l.onabort=function(){l&&(u(s("Request aborted",t,"ECONNABORTED",l)),l=null)},l.onerror=function(){u(s("Network Error",t,null,l)),l=null},l.ontimeout=function(){u(s("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",l)),l=null},r.isStandardBrowserEnv()){var m=n(175),d=(t.withCredentials||c(t.url))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;d&&(p[t.xsrfHeaderName]=d)}if("setRequestHeader"in l&&r.forEach(p,function(t,e){void 0===g&&"content-type"===e.toLowerCase()?delete p[e]:l.setRequestHeader(e,t)}),t.withCredentials&&(l.withCredentials=!0),t.responseType)try{l.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&l.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){l&&(l.abort(),u(t),l=null)}),void 0===g&&(g=null),l.send(g)})}},function(t,e,n){"use strict";var r=n(172);t.exports=function(t,e,n,o,i){var a=new Error(t);return r(a,e,n,o,i)}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){e=e||{};var n={};return r.forEach(["url","method","params","data"],function(t){void 0!==e[t]&&(n[t]=e[t])}),r.forEach(["headers","auth","proxy"],function(o){r.isObject(e[o])?n[o]=r.deepMerge(t[o],e[o]):void 0!==e[o]?n[o]=e[o]:r.isObject(t[o])?n[o]=r.deepMerge(t[o]):void 0!==t[o]&&(n[o]=t[o])}),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])}),n}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){var r=n(43),o=n(182),i=o(r);t.exports=i},function(t,e,n){function r(t,e,n){return e===e?a(t,e,n):o(t,i,n)}var o=n(72),i=n(187),a=n(188);t.exports=r},function(t,e){function n(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i0&&void 0!==arguments[0]?arguments[0]:[],e=N(t);return L.a.reader("json",{handlers:u({},e,{":":function(t){return t},set:function(t){return t},list:function(t){return t}}),mapBuilder:U})},B=[Object,L.a.makeWriteHandler({tag:function(){return"map"},rep:function(t){return b()(t,function(t,e,n){return t.set(L.a.keyword(n),e),t},L.a.map())}})],H=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.verbose,i=n?"json-verbose":"json";return L.a.writer(i,{handlers:L.a.map([].concat(o(R),B)),transform:function(e){if(d()(e)){if(e._sdkType)return Object(P.toType)(e);var n=O()(t,function(t){return t.appType&&e instanceof t.appType||t.canHandle&&t.canHandle(e)});if(n)return n.writer(e)}return e},handlerForForeign:function(t,e){return Array.isArray(t)?e.get("array"):"object"===r(t)?e.get("map"):null}})},$=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,n=t.reduce(function(t,e){var n={sdkType:e.sdkType||e.type,reader:e.reader},r={sdkType:e.sdkType||e.type,appType:e.appType||e.customType,canHandle:e.canHandle,writer:e.writer};return t.readers.push(n),t.writers.push(r),t},{readers:[],writers:[]}),r=n.readers,o=n.writers;return{reader:q(r),writer:H(o,e)}}},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function o(t){for(var e=1;e=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function i(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function c(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return it(c({params:e,queryParams:n,perRequestOpts:ot(r)},t))}},ct=function(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return it(c({params:e},t))}},st=function(t){var e=t.method,n=o(t,["method"]);return e&&"post"===e.toLowerCase()?at(n):ct(n)},ut=function(t){var e=t.baseUrl,n=t.tokenStore,r=o(t,["baseUrl","tokenStore"]);return c({},r,{baseUrl:Object(j.c)(e),tokenStore:n||Object(F.a)(n,r.clientId,!!r.secure)})},gt=function(t){if(!t.clientId)throw new Error("clientId must be provided");if(!t.baseUrl)throw new Error("baseUrl must be provided");return t},pt=function t(e){var n=this;r(this,t);var o=gt(ut(c({},z,{},e))),i=b()(G,function(t){return t(o)}),a=[].concat(K).map(function(t){var e=t.path,n=t.apiName,r=t.method,o=t.interceptors,a=void 0===o?[]:o,s=Object(j.a)(e),g=[n].concat(u(s)),p=[n,e].join("/"),l=i[n];return c({},t,{fnPath:s,fullFnPath:g,endpointInterceptors:[].concat(u(a),[nt({method:r,url:p,httpOpts:l})])})}),s=a.reduce(function(t,e){var n=e.fullFnPath,r=e.endpointInterceptors;return d()(t,n,r)},{}),g={tokenStore:o.tokenStore,endpointInterceptors:s,clientId:o.clientId,typeHandlers:o.typeHandlers,transitVerbose:o.transitVerbose};[].concat(u(Z),J).map(function(t){var e=t.path,n=t.method,r=t.endpointInterceptorPath,o=t.interceptors;return{path:e,fn:st({method:n,ctx:g,endpointInterceptors:h()(s,r)||[],interceptors:o})}}).forEach(function(t){var e=t.path,r=t.fn;return d()(n,e,r)})}},function(t,e,n){function r(t){var e=a.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var o=c.call(t);return r&&(e?t[s]=n:delete t[s]),o}var o=n(7),i=Object.prototype,a=i.hasOwnProperty,c=i.toString,s=o?o.toStringTag:void 0;t.exports=r},function(t,e){function n(t){return o.call(t)}var r=Object.prototype,o=r.toString;t.exports=n},function(t,e,n){var r=n(82),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,function(t,n,r,o){e.push(r?o.replace(i,"$1"):n||t)}),e});t.exports=a},function(t,e,n){function r(t){var e=o(t,function(t){return n.size===i&&n.clear(),t}),n=e.cache;return e}var o=n(83),i=500;t.exports=r},function(t,e,n){function r(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(i);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(r.Cache||o),n}var o=n(25),i="Expected a function";r.Cache=o,t.exports=r},function(t,e,n){function r(){this.size=0,this.__data__={hash:new o,map:new(a||i),string:new o}}var o=n(85),i=n(16),a=n(27);t.exports=r},function(t,e,n){function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1}var o=n(17);t.exports=r},function(t,e,n){function r(t,e){var n=this.__data__,r=o(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var o=n(17);t.exports=r},function(t,e,n){function r(t){var e=o(this,t).delete(t);return this.size-=e?1:0,e}var o=n(18);t.exports=r},function(t,e){function n(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}t.exports=n},function(t,e,n){function r(t){return o(this,t).get(t)}var o=n(18);t.exports=r},function(t,e,n){function r(t){return o(this,t).has(t)}var o=n(18);t.exports=r},function(t,e,n){function r(t,e){var n=o(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var o=n(18);t.exports=r},function(t,e,n){function r(t,e,n){return null==t?t:o(t,e,n)}var o=n(29);t.exports=r},function(t,e,n){function r(t,e,n){var r=t[e];c.call(t,e)&&i(r,n)&&(void 0!==n||e in t)||o(t,e,n)}var o=n(41),i=n(26),a=Object.prototype,c=a.hasOwnProperty;t.exports=r},function(t,e,n){function r(t,e){var n={};return e=a(e,3),i(t,function(t,r,i){o(n,r,e(t,r,i))}),n}var o=n(41),i=n(43),a=n(10);t.exports=r},function(t,e,n){var r=n(109),o=r();t.exports=o},function(t,e){function n(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),c=a.length;c--;){var s=a[t?c:++o];if(!1===n(i[s],s,i))break}return e}}t.exports=n},function(t,e,n){function r(t,e){var n=a(t),r=!n&&i(t),g=!n&&!r&&c(t),l=!n&&!r&&!g&&u(t),f=n||r||g||l,h=f?o(t.length,String):[],m=h.length;for(var d in t)!e&&!p.call(t,d)||f&&("length"==d||g&&("offset"==d||"parent"==d)||l&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||s(d,m))||h.push(d);return h}var o=n(111),i=n(31),a=n(1),c=n(44),s=n(30),u=n(46),g=Object.prototype,p=g.hasOwnProperty;t.exports=r},function(t,e){function n(t,e){for(var n=-1,r=Array(t);++n0&&n(g)?e>1?r(g,e-1,n,a,c):o(c,g):a||(c[c.length]=g)}return c}var o=n(54),i=n(157);t.exports=r},function(t,e,n){function r(t){return a(t)||i(t)||!!(c&&t&&t[c])}var o=n(7),i=n(31),a=n(1),c=o?o.isConcatSpreadable:void 0;t.exports=r},function(t,e){function n(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}t.exports=n},function(t,e,n){var r=n(160),o=n(42),i=n(11),a=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i;t.exports=a},function(t,e){function n(t){return function(){return t}}t.exports=n},function(t,e){function n(t){var e=0,n=0;return function(){var a=i(),c=o-(a-n);if(n=a,c>0){if(++e>=r)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var r=800,o=16,i=Date.now;t.exports=n},function(t,e,n){t.exports=n(163)},function(t,e,n){"use strict";function r(t){var e=new a(t),n=i(a.prototype.request,e);return o.extend(n,a.prototype,e),o.extend(n,e),n}var o=n(0),i=n(62),a=n(165),c=n(68),s=n(65),u=r(s);u.Axios=a,u.create=function(t){return r(c(u.defaults,t))},u.Cancel=n(69),u.CancelToken=n(178),u.isCancel=n(64),u.all=function(t){return Promise.all(t)},u.spread=n(179),t.exports=u,t.exports.default=u},function(t,e){/*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ -t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},function(t,e,n){"use strict";function r(t){this.defaults=t,this.interceptors={request:new a,response:new a}}var o=n(0),i=n(63),a=n(166),c=n(167),s=n(68);r.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{},t.url=arguments[0]):t=t||{},t=s(this.defaults,t),t.method=t.method?t.method.toLowerCase():"get";var e=[c,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},r.prototype.getUri=function(t){return t=s(this.defaults,t),i(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},o.forEach(["delete","get","head","options"],function(t){r.prototype[t]=function(e,n){return this.request(o.merge(n||{},{method:t,url:e}))}}),o.forEach(["post","put","patch"],function(t){r.prototype[t]=function(e,n,r){return this.request(o.merge(r||{},{method:t,url:e,data:n}))}}),t.exports=r},function(t,e,n){"use strict";function r(){this.handlers=[]}var o=n(0);r.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},r.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},r.prototype.forEach=function(t){o.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=r},function(t,e,n){"use strict";function r(t){t.cancelToken&&t.cancelToken.throwIfRequested()}var o=n(0),i=n(168),a=n(64),c=n(65),s=n(176),u=n(177);t.exports=function(t){return r(t),t.baseURL&&!s(t.url)&&(t.url=u(t.baseURL,t.url)),t.headers=t.headers||{},t.data=i(t.data,t.headers,t.transformRequest),t.headers=o.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||c.adapter)(t).then(function(e){return r(t),e.data=i(e.data,e.headers,t.transformResponse),e},function(e){return a(e)||(r(t),e&&e.response&&(e.response.data=i(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(g===setTimeout)return setTimeout(t,0);if((g===n||!g)&&setTimeout)return g=setTimeout,setTimeout(t,0);try{return g(t,0)}catch(e){try{return g.call(null,t,0)}catch(e){return g.call(this,t,0)}}}function i(t){if(p===clearTimeout)return clearTimeout(t);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function a(){m&&f&&(m=!1,f.length?h=f.concat(h):d=-1,h.length&&c())}function c(){if(!m){var t=o(a);m=!0;for(var e=h.length;e;){for(f=h,h=[];++d1)for(var n=1;n=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}}),a):a}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){function t(t){var e=t;return n&&(o.setAttribute("href",e),e=o.href),o.setAttribute("href",e),{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 e,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return e=t(window.location.href),function(n){var o=r.isString(n)?t(n):n;return o.protocol===e.protocol&&o.host===e.host}}():function(){return function(){return!0}}()},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){return{write:function(t,e,n,o,i,a){var c=[];c.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),r.isString(o)&&c.push("path="+o),r.isString(i)&&c.push("domain="+i),!0===a&&c.push("secure"),document.cookie=c.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";function r(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new o(t),e(n.reason))})}var o=n(69);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var t;return{token:new r(function(e){t=e}),cancel:t}},t.exports=r},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";n.d(e,"c",function(){return u}),n.d(e,"a",function(){return g}),n.d(e,"b",function(){return p});var r=n(33),o=n.n(r),i=n(184),a=n.n(i),c=n(192),s=n.n(c),u=function(t){return s()(t,"/")},g=function(t){return a()(t.split("/"),"").map(function(t){return t.replace(/_\w/g,function(t){return t[1].toUpperCase()})})},p=function(t){return o()(t,function(t,e,n){return t.push("".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(e))),t},[]).join("&")}},function(t,e){function n(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o=g&&(l=u,f=!1,e=new o(e));t:for(;++p-1}var o=n(71);t.exports=r},function(t,e){function n(t){return t!==t}t.exports=n},function(t,e){function n(t,e,n){for(var r=n-1,o=t.length;++r=r?t:o(t,e,n)}var o=n(194);t.exports=r},function(t,e){function n(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),n=n>o?o:n,n<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r-1;);return n}var o=n(71);t.exports=r},function(t,e,n){function r(t){return i(t)?a(t):o(t)}var o=n(197),i=n(198),a=n(199);t.exports=r},function(t,e){function n(t){return t.split("")}t.exports=n},function(t,e){function n(t){return r.test(t)}var r=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=n},function(t,e){function n(t){return t.match(p)||[]}var r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",c="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",s="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",i,a].join("|")+")[\\ufe0e\\ufe0f]?"+c+")*",u="[\\ufe0e\\ufe0f]?"+c+s,g="(?:"+["[^\\ud800-\\udfff]"+r+"?",r,i,a,"[\\ud800-\\udfff]"].join("|")+")",p=RegExp(o+"(?="+o+")|"+g+u,"g");t.exports=n},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=n(73),i=n.n(o),a=n(58),c=n.n(a),s=n(34),u=function(t){return encodeURIComponent(t).replace(/%2C/gi,",")},g=function(t,e){var n;if(e instanceof s.UUID)n=e.uuid;else if(e instanceof s.LatLng)n="".concat(e.lat,",").concat(e.lng);else if(e instanceof s.LatLngBounds)n="".concat(e.ne.lat,",").concat(e.ne.lng,",").concat(e.sw.lat,",").concat(e.sw.lng);else if(Array.isArray(e))n=e;else if(e instanceof Date)n=e.toISOString();else if(null==e)n=e;else{if("object"===r(e))throw new Error("Don't know how to serialize query parameter '".concat(t,"': ").concat(e));n=e}return null==n?null:[t,u(n)]},p=function(t){return c()(i()(t,function(t,e){var n=g(e,t);return n?n.join("="):null})).join("&")};e.a=p},function(t,e,n){function r(t,e){var n=-1,r=i(t)?Array(t.length):[];return o(t,function(t,o,i){r[++n]=e(t,o,i)}),r}var o=n(70),i=n(9);t.exports=r},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function o(t){for(var e=1;e1?t:t.res&&401===t.res.status&&e.refresh_token?Object(f.a)([new h.a,new m.a].concat(r(i.auth.token)))({params:{client_id:n,grant_type:"refresh_token",refresh_token:e.refresh_token},tokenStore:o}).then(function(e){var n=e.authToken;return s({},t,{authToken:n,enterQueue:c,error:null})}).catch(function(e){return s({},t,{refreshTokenRetry:{retryQueue:c,attempts:u,res:e.response}})}):t}}]),t}()},function(t,e,n){"use strict";function r(t){return a(t)||i(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function i(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function a(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1?t:t.res&&401===t.res.status?Object(f.a)([new h.a,new m.a].concat(r(o.auth.token)))({params:{client_id:e,grant_type:"client_credentials",scope:"public-read"},tokenStore:n}).then(function(e){var n=e.authToken;return s({},t,{authToken:n,enterQueue:a,error:null})}):t}}]),t}()},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function o(t){for(var e=1;e=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function c(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function c(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}var s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{enter:function(e){var n=e.params;return o({},a(e,["params"]),{params:o({},t,{},n)})}}};e.a=s},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function o(t){for(var e=1;e=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function c(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function c(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n-1?c[s?e[u]:u]:void 0}}var o=n(10),i=n(9),a=n(19);t.exports=r},function(t,e,n){function r(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var s=null==n?0:a(n);return s<0&&(s=c(r+s,0)),o(t,i(e,3),s)}var o=n(72),i=n(10),a=n(219),c=Math.max;t.exports=r},function(t,e,n){function r(t){var e=o(t),n=e%1;return e===e?n?e-n:e:0}var o=n(220);t.exports=r},function(t,e,n){function r(t){if(!t)return 0===t?t:0;if((t=o(t))===i||t===-i){return(t<0?-1:1)*a}return t===t?t:0}var o=n(221),i=1/0,a=1.7976931348623157e308;t.exports=r},function(t,e,n){function r(t){if("number"==typeof t)return t;if(i(t))return a;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(c,"");var n=u.test(t);return n||g.test(t)?p(t.slice(2),n?2:8):s.test(t)?a:+t}var o=n(6),i=n(14),a=NaN,c=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,g=/^0o[0-7]+$/i,p=parseInt;t.exports=r},function(t,e){function n(t){for(var e=-1,n=null==t?0:t.length,r={};++et||1342177279>>=1)&&(e+=e);return n}},"es6-impl","es3"),$jscomp.SYMBOL_PREFIX="jscomp_symbol_",$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){},$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)},$jscomp.symbolCounter_=0,$jscomp.Symbol=function(t){return $jscomp.SYMBOL_PREFIX+(t||"")+$jscomp.symbolCounter_++},$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var t=$jscomp.global.Symbol.iterator;t||(t=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator")),"function"!=typeof Array.prototype[t]&&$jscomp.defineProperty(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}}),$jscomp.initSymbolIterator=function(){}},$jscomp.arrayIterator=function(t){var e=0;return $jscomp.iteratorPrototype(function(){return e<\/script>')},goog.appendScriptSrcNode_=function(t){var e=goog.global.document,n=e.createElement("script");n.type="text/javascript",n.src=t,n.defer=!1,n.async=!1,e.head.appendChild(n)},goog.writeScriptTag_=function(t,e){if(goog.inHtmlDocument_()){var n=goog.global.document;if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&"complete"==n.readyState){if(/\bdeps.js$/.test(t))return!1;throw Error('Cannot write "'+t+'" after document load')}if(void 0===e)if(goog.IS_OLD_IE_){goog.oldIeWaiting_=!0;var r=" onreadystatechange='goog.onScriptLoad_(this, "+ ++goog.lastNonModuleScriptIndex_+")' ";n.write('