Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-it

Package Overview
Dependencies
Maintainers
1
Versions
159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-it - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

index.js

2

lib/bundle-all.js
'use strict';
var getIt = require('./index');
const getIt = require('./index');

@@ -5,0 +5,0 @@ getIt.middleware = require('./middleware');

'use strict';
var pubsub = require('nano-pubsub');
var middlewareReducer = require('./util/middlewareReducer');
var processOptions = require('./middleware/defaultOptionsProcessor');
var httpRequest = require('./request'); // node-request in node, browser-request in browsers
const pubsub = require('nano-pubsub');
const middlewareReducer = require('./util/middlewareReducer');
const processOptions = require('./middleware/defaultOptionsProcessor');
const httpRequest = require('./request'); // node-request in node, browser-request in browsers
var channelNames = ['request', 'response', 'progress', 'error', 'abort'];
var middlehooks = ['processOptions', 'onRequest', 'onResponse', 'onError', 'onReturn', 'onHeaders'];
const channelNames = ['request', 'response', 'progress', 'error', 'abort'];
const middlehooks = ['processOptions', 'onRequest', 'onResponse', 'onError', 'onReturn', 'onHeaders'];
module.exports = function createRequester() {
var initMiddleware = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
let initMiddleware = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var loadedMiddleware = [];
var middleware = middlehooks.reduce(function (ware, name) {
const loadedMiddleware = [];
const middleware = middlehooks.reduce((ware, name) => {
ware[name] = ware[name] || [];

@@ -21,3 +21,3 @@ return ware;

function request(opts) {
var channels = channelNames.reduce(function (target, name) {
const channels = channelNames.reduce((target, name) => {
target[name] = pubsub();

@@ -28,19 +28,17 @@ return target;

// Prepare a middleware reducer that can be reused throughout the lifecycle
var applyMiddleware = middlewareReducer(middleware);
const applyMiddleware = middlewareReducer(middleware);
// Parse the passed options
var options = applyMiddleware('processOptions', opts);
const options = applyMiddleware('processOptions', opts);
// Build a context object we can pass to child handlers
var context = { options: options, channels: channels, applyMiddleware: applyMiddleware };
const context = { options, channels, applyMiddleware
// We need to hold a reference to the current, ongoing request,
// in order to allow cancellation. In the case of the retry middleware,
// a new request might be triggered
var ongoingRequest = null;
var unsubscribe = channels.request.subscribe(function (ctx) {
// We need to hold a reference to the current, ongoing request,
// in order to allow cancellation. In the case of the retry middleware,
// a new request might be triggered
};let ongoingRequest = null;
const unsubscribe = channels.request.subscribe(ctx => {
// Let request adapters (node/browser) perform the actual request
ongoingRequest = httpRequest(ctx, function (err, res) {
return onResponse(err, res, ctx);
});
ongoingRequest = httpRequest(ctx, (err, res) => onResponse(err, res, ctx));
});

@@ -50,3 +48,3 @@

// and be sure to cancel any ongoing request (obviously)
channels.abort.subscribe(function () {
channels.abort.subscribe(() => {
unsubscribe();

@@ -60,3 +58,3 @@ if (ongoingRequest) {

// the promise or observable middlewares
var returnValue = applyMiddleware('onReturn', channels, context);
const returnValue = applyMiddleware('onReturn', channels, context);

@@ -73,4 +71,4 @@ // If return value has been modified by a middleware, we expect the middleware

function onResponse(reqErr, res, ctx) {
var error = reqErr;
var response = res;
let error = reqErr;
let response = res;

@@ -114,3 +112,3 @@ // We're processing non-errors first, in case a middleware converts the

middlehooks.forEach(function (key) {
middlehooks.forEach(key => {
if (newMiddleware[key]) {

@@ -117,0 +115,0 @@ middleware[key].push(newMiddleware[key]);

'use strict';
var objectAssign = require('object-assign');
const objectAssign = require('object-assign');
var leadingSlash = /^\//;
var trailingSlash = /\/$/;
const leadingSlash = /^\//;
const trailingSlash = /\/$/;
module.exports = function (baseUrl) {
var baseUri = baseUrl.replace(trailingSlash, '');
module.exports = baseUrl => {
const baseUri = baseUrl.replace(trailingSlash, '');
return {
processOptions: function processOptions(options) {
processOptions: options => {
if (/^https?:\/\//i.test(options.url)) {

@@ -16,4 +16,4 @@ return options; // Already prefixed

var url = [baseUri, options.url.replace(leadingSlash, '')].join('/');
return objectAssign({}, options, { url: url });
const url = [baseUri, options.url.replace(leadingSlash, '')].join('/');
return objectAssign({}, options, { url });
}

@@ -20,0 +20,0 @@ };

@@ -8,3 +8,3 @@ 'use strict';

Cancel.prototype.toString = function toString() {
return 'Cancel' + (this.message ? ': ' + this.message : '');
return `Cancel${this.message ? `: ${this.message}` : ''}`;
};

@@ -11,0 +11,0 @@

'use strict';
var Cancel = require('./Cancel');
const Cancel = require('./Cancel');
function CancelToken(executor) {
var _this = this;
if (typeof executor !== 'function') {

@@ -12,9 +10,9 @@ throw new TypeError('executor must be a function.');

var resolvePromise = null;
this.promise = new Promise(function (resolve) {
let resolvePromise = null;
this.promise = new Promise(resolve => {
resolvePromise = resolve;
});
executor(function (message) {
if (_this.reason) {
executor(message => {
if (this.reason) {
// Cancellation has already been requested

@@ -24,4 +22,4 @@ return;

_this.reason = new Cancel(message);
resolvePromise(_this.reason);
this.reason = new Cancel(message);
resolvePromise(this.reason);
});

@@ -31,4 +29,4 @@ }

CancelToken.source = function () {
var cancel = void 0;
var token = new CancelToken(function (can) {
let cancel;
const token = new CancelToken(can => {
cancel = can;

@@ -35,0 +33,0 @@ });

"use strict";
module.exports = function (value) {
return !!(value && value.__CANCEL__);
};
module.exports = value => !!(value && value.__CANCEL__);
//# sourceMappingURL=isCancel.js.map
'use strict';
var debugIt = require('debug');
const debugIt = require('debug');
module.exports = function () {
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var verbose = opts.verbose;
var namespace = opts.namespace || 'get-it';
var defaultLogger = debugIt(namespace);
var log = opts.log || defaultLogger;
var shortCircuit = log === defaultLogger && !debugIt.enabled(namespace);
var requestId = 0;
const verbose = opts.verbose;
const namespace = opts.namespace || 'get-it';
const defaultLogger = debugIt(namespace);
const log = opts.log || defaultLogger;
const shortCircuit = log === defaultLogger && !debugIt.enabled(namespace);
let requestId = 0;
return {
processOptions: function processOptions(options) {
processOptions: options => {
options.requestId = options.requestId || ++requestId;

@@ -21,3 +21,3 @@ return options;

onRequest: function onRequest(event) {
onRequest: event => {
// Short-circuit if not enabled, to save some CPU cycles with formatting stuff

@@ -28,3 +28,3 @@ if (shortCircuit || !event) {

var options = event.options;
const options = event.options;

@@ -44,3 +44,3 @@ log('[%s] HTTP %s %s', options.requestId, options.method, options.url);

onResponse: function onResponse(res, context) {
onResponse: (res, context) => {
// Short-circuit if not enabled, to save some CPU cycles with formatting stuff

@@ -51,3 +51,3 @@ if (shortCircuit || !res) {

var reqId = context.options.requestId;
const reqId = context.options.requestId;

@@ -63,3 +63,3 @@ log('[%s] Response code: %s %s', reqId, res.statusCode, res.statusMessage);

onError: function onError(err, context) {
onError: (err, context) => {
log('[%s] ERROR: %s', context.options.requestId, err.message);

@@ -72,4 +72,4 @@ return err;

function stringifyBody(res) {
var contentType = (res.headers['content-type'] || '').toLowerCase();
var isJson = contentType.indexOf('application/json') !== -1;
const contentType = (res.headers['content-type'] || '').toLowerCase();
const isJson = contentType.indexOf('application/json') !== -1;
return isJson ? tryFormat(res.body) : res.body;

@@ -81,3 +81,3 @@ }

try {
var parsed = typeof body === 'string' ? JSON.parse(body) : body;
const parsed = typeof body === 'string' ? JSON.parse(body) : body;
return JSON.stringify(parsed, null, 2);

@@ -84,0 +84,0 @@ } catch (err) {

'use strict';
var objectAssign = require('object-assign');
var urlParse = require('url-parse');
const objectAssign = require('object-assign');
const urlParse = require('url-parse');
var has = Object.prototype.hasOwnProperty;
var defaultOptions = { timeout: 120000 };
const has = Object.prototype.hasOwnProperty;
const defaultOptions = { timeout: 120000 };
module.exports = function (opts) {
var options = typeof opts === 'string' ? objectAssign({ url: opts }, defaultOptions) : objectAssign({}, defaultOptions, opts);
module.exports = opts => {
const options = typeof opts === 'string' ? objectAssign({ url: opts }, defaultOptions) : objectAssign({}, defaultOptions, opts);
// Parse URL into parts
var url = urlParse(options.url, {}, // Don't use current browser location
const url = urlParse(options.url, {}, // Don't use current browser location
true // Parse query strings

@@ -35,4 +35,4 @@ );

function stringifyQueryString(obj) {
var pairs = [];
for (var key in obj) {
const pairs = [];
for (const key in obj) {
if (has.call(obj, key)) {

@@ -47,5 +47,3 @@ push(key, obj[key]);

if (Array.isArray(val)) {
val.forEach(function (item) {
return push(key, item);
});
val.forEach(item => push(key, item));
} else {

@@ -66,3 +64,3 @@ pairs.push([key, val].map(encodeURIComponent).join('='));

var delay = Number(time);
const delay = Number(time);
if (isNaN(delay)) {

@@ -76,4 +74,4 @@ return normalizeTimeout(defaultOptions.timeout);

function removeUndefined(obj) {
var target = {};
for (var key in obj) {
const target = {};
for (const key in obj) {
if (obj[key] !== undefined) {

@@ -80,0 +78,0 @@ target[key] = obj[key];

'use strict';
var objectAssign = require('object-assign');
const objectAssign = require('object-assign');
module.exports = function (headers) {
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return {
processOptions: function processOptions(options) {
var existing = options.headers || {};
processOptions: options => {
const existing = options.headers || {};
options.headers = opts.override ? objectAssign({}, existing, headers) : objectAssign({}, headers, existing);

@@ -11,0 +11,0 @@

'use strict';
var createErrorClass = require('create-error-class');
const createErrorClass = require('create-error-class');
var HttpError = createErrorClass('HttpError', function (res) {
this.message = (res.method + '-request to ' + res.url + ' resulted in HTTP ' + res.statusCode + ' ' + res.statusMessage).trim();
const HttpError = createErrorClass('HttpError', function (res) {
this.message = `${res.method}-request to ${res.url} resulted in HTTP ${res.statusCode} ${res.statusMessage}`.trim();
this.response = res;
});
module.exports = function () {
return {
onResponse: function onResponse(res) {
var isHttpError = res.statusCode >= 400;
if (!isHttpError) {
return res;
}
module.exports = () => ({
onResponse: res => {
const isHttpError = res.statusCode >= 400;
if (!isHttpError) {
return res;
}
throw new HttpError(res);
}
};
};
throw new HttpError(res);
}
});
//# sourceMappingURL=httpErrors.js.map
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
const objectAssign = require('object-assign');
const isPlainObject = require('is-plain-object');
var objectAssign = require('object-assign');
var isPlainObject = require('is-plain-object');
const serializeTypes = ['boolean', 'string', 'number'];
const isBuffer = obj => !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj);
var serializeTypes = ['boolean', 'string', 'number'];
var isBuffer = function isBuffer(obj) {
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj);
};
module.exports = () => ({
processOptions: options => {
const body = options.body;
const shouldSerialize = body && !isBuffer(body) && (serializeTypes.indexOf(typeof body) !== -1 || Array.isArray(body) || isPlainObject(body) || body && typeof body.toJSON === 'function');
module.exports = function () {
return {
processOptions: function processOptions(options) {
var body = options.body;
var shouldSerialize = body && !isBuffer(body) && (serializeTypes.indexOf(typeof body === 'undefined' ? 'undefined' : _typeof(body)) !== -1 || Array.isArray(body) || isPlainObject(body) || body && typeof body.toJSON === 'function');
if (!shouldSerialize) {
return options;
}
if (!shouldSerialize) {
return options;
}
return objectAssign({}, options, {
body: JSON.stringify(options.body),
headers: objectAssign({}, options.headers, {
'Content-Type': 'application/json'
})
});
}
};
};
return objectAssign({}, options, {
body: JSON.stringify(options.body),
headers: objectAssign({}, options.headers, {
'Content-Type': 'application/json'
})
});
}
});
//# sourceMappingURL=jsonRequest.js.map
'use strict';
var objectAssign = require('object-assign');
const objectAssign = require('object-assign');
module.exports = function () {
return {
onResponse: function onResponse(response) {
var contentType = response.headers['content-type'];
if (!response.body || !contentType || contentType.indexOf('application/json') === -1) {
return response;
}
module.exports = () => ({
onResponse: response => {
const contentType = response.headers['content-type'];
if (!response.body || !contentType || contentType.indexOf('application/json') === -1) {
return response;
}
return objectAssign({}, response, { body: tryParse(response.body) });
},
return objectAssign({}, response, { body: tryParse(response.body) });
},
processOptions: function processOptions(options) {
return objectAssign({}, options, {
headers: objectAssign({ Accept: 'application/json' }, options.headers)
});
}
};
};
processOptions: options => objectAssign({}, options, {
headers: objectAssign({ Accept: 'application/json' }, options.headers)
})
});

@@ -28,3 +24,3 @@ function tryParse(body) {

} catch (err) {
err.message = 'Failed to parsed response body as JSON: ' + err.message;
err.message = `Failed to parsed response body as JSON: ${err.message}`;
throw err;

@@ -31,0 +27,0 @@ }

'use strict';
var global = require('../util/global');
var objectAssign = require('object-assign');
const global = require('../util/global');
const objectAssign = require('object-assign');
module.exports = function () {
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var Observable = opts.implementation || global.Observable;
const Observable = opts.implementation || global.Observable;
if (!Observable) {

@@ -15,23 +15,15 @@ throw new Error('`Observable` is not available in global scope, and no implementation was passed');

return {
onReturn: function onReturn(channels, context) {
return new Observable(function (observer) {
channels.error.subscribe(function (err) {
return observer.error(err);
});
channels.progress.subscribe(function (event) {
return observer.next(objectAssign({ type: 'progress' }, event));
});
channels.response.subscribe(function (response) {
observer.next(objectAssign({ type: 'response' }, response));
observer.complete();
});
onReturn: (channels, context) => new Observable(observer => {
channels.error.subscribe(err => observer.error(err));
channels.progress.subscribe(event => observer.next(objectAssign({ type: 'progress' }, event)));
channels.response.subscribe(response => {
observer.next(objectAssign({ type: 'response' }, response));
observer.complete();
});
channels.request.publish(context);
return function () {
return channels.abort.publish();
};
});
}
channels.request.publish(context);
return () => channels.abort.publish();
})
};
};
//# sourceMappingURL=observable.js.map
'use strict';
module.exports = function () {
return {
onRequest: function onRequest(evt) {
if (evt.adapter !== 'xhr') {
return;
}
module.exports = () => ({
onRequest: evt => {
if (evt.adapter !== 'xhr') {
return;
}
var xhr = evt.request;
var context = evt.context;
const xhr = evt.request;
const context = evt.context;
if ('upload' in xhr && 'onprogress' in xhr.upload) {
xhr.upload.onprogress = handleProgress('upload');
}
if ('upload' in xhr && 'onprogress' in xhr.upload) {
xhr.upload.onprogress = handleProgress('upload');
}
if ('onprogress' in xhr) {
xhr.onprogress = handleProgress('download');
}
if ('onprogress' in xhr) {
xhr.onprogress = handleProgress('download');
}
function handleProgress(stage) {
return function (event) {
var percent = event.lengthComputable ? event.loaded / event.total * 100 : -1;
context.channels.progress.publish({
stage: stage,
percent: percent,
total: event.total,
loaded: event.loaded,
lengthComputable: event.lengthComputable
});
};
}
function handleProgress(stage) {
return event => {
const percent = event.lengthComputable ? event.loaded / event.total * 100 : -1;
context.channels.progress.publish({
stage,
percent,
total: event.total,
loaded: event.loaded,
lengthComputable: event.lengthComputable
});
};
}
};
};
}
});
//# sourceMappingURL=browser-progress.js.map
'use strict';
var progressStream = require('progress-stream');
const progressStream = require('progress-stream');
function normalizer(stage) {
return function (prog) {
return {
stage: stage,
percent: prog.percentage,
total: prog.length,
loaded: prog.transferred,
lengthComputable: !(prog.length === 0 && prog.percentage === 0)
};
};
return prog => ({
stage,
percent: prog.percentage,
total: prog.length,
loaded: prog.transferred,
lengthComputable: !(prog.length === 0 && prog.percentage === 0)
});
}
module.exports = function () {
return {
onHeaders: function onHeaders(response, evt) {
var progress = progressStream({ time: 16 });
var normalize = normalizer('download');
module.exports = () => ({
onHeaders: (response, evt) => {
const progress = progressStream({ time: 16 });
const normalize = normalizer('download');
// This is supposed to be handled automatically, but it has a bug,
// see https://github.com/freeall/progress-stream/pull/22
var contentLength = response.headers['content-length'];
var length = contentLength && Number(contentLength);
if (!isNaN(length) && length > 0) {
progress.setLength(length);
}
// This is supposed to be handled automatically, but it has a bug,
// see https://github.com/freeall/progress-stream/pull/22
const contentLength = response.headers['content-length'];
const length = contentLength && Number(contentLength);
if (!isNaN(length) && length > 0) {
progress.setLength(length);
}
progress.on('progress', function (prog) {
return evt.context.channels.progress.publish(normalize(prog));
});
return response.pipe(progress);
},
progress.on('progress', prog => evt.context.channels.progress.publish(normalize(prog)));
return response.pipe(progress);
},
onRequest: function onRequest(evt) {
if (!evt.progress) {
return;
}
onRequest: evt => {
if (!evt.progress) {
return;
}
var normalize = normalizer('upload');
evt.progress.on('progress', function (prog) {
return evt.context.channels.progress.publish(normalize(prog));
});
}
};
};
const normalize = normalizer('upload');
evt.progress.on('progress', prog => evt.context.channels.progress.publish(normalize(prog)));
}
});
//# sourceMappingURL=node-progress.js.map
'use strict';
var global = require('../util/global');
var Cancel = require('./cancel/Cancel');
var CancelToken = require('./cancel/CancelToken');
var isCancel = require('./cancel/isCancel');
const global = require('../util/global');
const Cancel = require('./cancel/Cancel');
const CancelToken = require('./cancel/CancelToken');
const isCancel = require('./cancel/isCancel');
var promise = function promise() {
var Promise = global.Promise;
const promise = () => {
const Promise = global.Promise;
if (!Promise) {

@@ -15,21 +15,17 @@ throw new Error('`Promise` is not available in global scope, and no implementation was passed');

return {
onReturn: function onReturn(channels, context) {
return new Promise(function (resolve, reject) {
var cancel = context.options.cancelToken;
if (cancel) {
cancel.promise.then(function (reason) {
channels.abort.publish(reason);
reject(reason);
});
}
onReturn: (channels, context) => new Promise((resolve, reject) => {
const cancel = context.options.cancelToken;
if (cancel) {
cancel.promise.then(reason => {
channels.abort.publish(reason);
reject(reason);
});
}
channels.error.subscribe(reject);
channels.response.subscribe(resolve);
channels.error.subscribe(reject);
channels.response.subscribe(resolve);
// Wait until next tick in case cancel has been performed
setTimeout(function () {
return channels.request.publish(context);
}, 0);
});
}
// Wait until next tick in case cancel has been performed
setTimeout(() => channels.request.publish(context), 0);
})
};

@@ -36,0 +32,0 @@ };

'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
const objectAssign = require('object-assign');
const defaultShouldRetry = require('../util/node-shouldRetry');
var objectAssign = require('object-assign');
var defaultShouldRetry = require('../util/node-shouldRetry');
const isStream = stream => stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
var isStream = function isStream(stream) {
return stream !== null && (typeof stream === 'undefined' ? 'undefined' : _typeof(stream)) === 'object' && typeof stream.pipe === 'function';
};
const retry = function retry() {
let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var retry = module.exports = function () {
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const maxRetries = opts.maxRetries || 5;
const retryDelay = opts.retryDelay || getRetryDelay;
const allowRetry = opts.shouldRetry || defaultShouldRetry;
var maxRetries = opts.maxRetries || 5;
var retryDelay = opts.retryDelay || getRetryDelay;
var allowRetry = opts.shouldRetry || defaultShouldRetry;
return {
onError: function onError(err, context) {
var options = context.options;
var max = options.maxRetries || maxRetries;
var shouldRetry = options.shouldRetry || allowRetry;
var attemptNumber = options.attemptNumber || 0;
onError: (err, context) => {
const options = context.options;
const max = options.maxRetries || maxRetries;
const shouldRetry = options.shouldRetry || allowRetry;
const attemptNumber = options.attemptNumber || 0;

@@ -37,3 +33,3 @@ // We can't retry if body is a stream, since it'll be drained

// Create a new context with an increased attempt number, so we can exit if we reach a limit
var newContext = objectAssign({}, context, {
const newContext = objectAssign({}, context, {
options: objectAssign({}, options, { attemptNumber: attemptNumber + 1 })

@@ -43,5 +39,3 @@ });

// Wait a given amount of time before doing the request again
setTimeout(function () {
return context.channels.request.publish(newContext);
}, retryDelay(attemptNumber));
setTimeout(() => context.channels.request.publish(newContext), retryDelay(attemptNumber));

@@ -56,2 +50,4 @@ // Signal that we've handled the error and that it should not propagate further

module.exports = retry;
function getRetryDelay(attemptNum) {

@@ -58,0 +54,0 @@ return 100 * Math.pow(2, attemptNum) + Math.random() * 100;

'use strict';
/* eslint max-depth: ["error", 4] */
var sameOrigin = require('same-origin');
var parseHeaders = require('parse-headers');
var noop = function noop() {/* intentional noop */};
const sameOrigin = require('same-origin');
const parseHeaders = require('parse-headers');
const noop = function noop() {/* intentional noop */};
var win = window;
var XmlHttpRequest = win.XMLHttpRequest || noop;
var hasXhr2 = 'withCredentials' in new XmlHttpRequest();
var XDomainRequest = hasXhr2 ? XmlHttpRequest : win.XDomainRequest;
var adapter = 'xhr';
const win = window;
const XmlHttpRequest = win.XMLHttpRequest || noop;
const hasXhr2 = 'withCredentials' in new XmlHttpRequest();
const XDomainRequest = hasXhr2 ? XmlHttpRequest : win.XDomainRequest;
const adapter = 'xhr';
module.exports = function (context, callback) {
var options = context.options;
var cors = !sameOrigin(win.location.href, options.url);
var timers = {};
module.exports = (context, callback) => {
const options = context.options;
const cors = !sameOrigin(win.location.href, options.url);
const timers = {};
// We'll want to null out the request on success/failure
var xhr = cors ? new XDomainRequest() : new XmlHttpRequest();
let xhr = cors ? new XDomainRequest() : new XmlHttpRequest();
var isXdr = win.XDomainRequest && xhr instanceof win.XDomainRequest;
var headers = options.headers;
const isXdr = win.XDomainRequest && xhr instanceof win.XDomainRequest;
const headers = options.headers;
// Request state
var aborted = false;
var loaded = false;
var timedOut = false;
let aborted = false;
let loaded = false;
let timedOut = false;

@@ -33,3 +33,3 @@ // Apply event handlers

xhr.ontimeout = onError;
xhr.onabort = function () {
xhr.onabort = () => {
aborted = true;

@@ -39,6 +39,6 @@ };

// IE9 must have onprogress be set to a unique function
xhr.onprogress = function () {/* intentional noop */};
xhr.onprogress = () => {/* intentional noop */};
var loadEvent = isXdr ? 'onload' : 'onreadystatechange';
xhr[loadEvent] = function () {
const loadEvent = isXdr ? 'onload' : 'onreadystatechange';
xhr[loadEvent] = () => {
// Prevent request from timing out

@@ -68,3 +68,3 @@ resetTimers();

if (headers && xhr.setRequestHeader) {
for (var key in headers) {
for (const key in headers) {
if (headers.hasOwnProperty(key)) {

@@ -83,3 +83,3 @@ xhr.setRequestHeader(key, headers[key]);

// Let middleware know we're about to do a request
context.applyMiddleware('onRequest', { options: options, adapter: adapter, request: xhr, context: context });
context.applyMiddleware('onRequest', { options, adapter, request: xhr, context });

@@ -89,10 +89,8 @@ xhr.send(options.body || null);

// Figure out which timeouts to use (if any)
var delays = options.timeout;
const delays = options.timeout;
if (delays) {
timers.connect = setTimeout(function () {
return timeoutRequest('ETIMEDOUT');
}, delays.connect);
timers.connect = setTimeout(() => timeoutRequest('ETIMEDOUT'), delays.connect);
}
return { abort: abort };
return { abort };

@@ -110,3 +108,3 @@ function abort() {

xhr.abort();
var error = new Error(code === 'ESOCKETTIMEDOUT' ? 'Socket timed out on request to ' + options.url : 'Connection timed out on request to ' + options.url);
const error = new Error(code === 'ESOCKETTIMEDOUT' ? `Socket timed out on request to ${options.url}` : `Connection timed out on request to ${options.url}`);
error.code = code;

@@ -122,5 +120,3 @@ context.channels.error.publish(error);

stopTimers();
timers.socket = setTimeout(function () {
return timeoutRequest('ESOCKETTIMEDOUT');
}, delays.socket);
timers.socket = setTimeout(() => timeoutRequest('ESOCKETTIMEDOUT'), delays.socket);
}

@@ -151,3 +147,3 @@

// We only really know that it is a network error
var err = new Error('Network error while attempting to reach ' + options.url);
const err = new Error(`Network error while attempting to reach ${options.url}`);
err.isNetworkError = true;

@@ -159,4 +155,4 @@ err.request = options;

function reduceResponse() {
var statusCode = xhr.status;
var statusMessage = xhr.statusText;
let statusCode = xhr.status;
let statusMessage = xhr.statusText;

@@ -163,0 +159,0 @@ if (isXdr && statusCode === undefined) {

'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
const url = require('url');
const http = require('http');
const https = require('https');
const concat = require('simple-concat');
const follow = require('follow-redirects');
const timedOut = require('timed-out');
const isStream = require('is-stream');
const toStream = require('into-stream');
const objectAssign = require('object-assign');
const progressStream = require('progress-stream');
const decompressResponse = require('decompress-response');
var url = require('url');
var http = require('http');
var https = require('https');
var concat = require('simple-concat');
var follow = require('follow-redirects');
var timedOut = require('timed-out');
var isStream = require('is-stream');
var toStream = require('into-stream');
var objectAssign = require('object-assign');
var unzipResponse = require('unzip-response');
var progressStream = require('progress-stream');
const adapter = 'node';
var adapter = 'node';
// Reduce a fully fledged node-style response object to
// something that works in both browser and node environment
var reduceResponse = function reduceResponse(res, reqUrl, method, body) {
return {
body: body,
url: reqUrl,
method: method,
headers: res.headers,
statusCode: res.statusCode,
statusMessage: res.statusMessage
};
};
const reduceResponse = (res, reqUrl, method, body) => ({
body,
url: reqUrl,
method: method,
headers: res.headers,
statusCode: res.statusCode,
statusMessage: res.statusMessage
});
module.exports = function (context, cb) {
var options = context.options;
var uri = objectAssign({}, url.parse(options.url));
var bodyType = isStream(options.body) ? 'stream' : _typeof(options.body);
module.exports = (context, cb) => {
const options = context.options;
const uri = objectAssign({}, url.parse(options.url));
const bodyType = isStream(options.body) ? 'stream' : typeof options.body;
if (bodyType !== 'undefined' && bodyType !== 'stream' && bodyType !== 'string' && !Buffer.isBuffer(options.body)) {
throw new Error('Request body must be a string, buffer or stream, got ' + bodyType);
throw new Error(`Request body must be a string, buffer or stream, got ${bodyType}`);
}
var lengthHeader = {};
const lengthHeader = {};
if (options.bodySize) {

@@ -49,7 +45,5 @@ lengthHeader['Content-Length'] = options.bodySize;

// Make sure callback is not called in the event of a cancellation
var aborted = false;
var callback = function callback(err, res) {
return !aborted && cb(err, res);
};
context.channels.abort.subscribe(function () {
let aborted = false;
const callback = (err, res) => !aborted && cb(err, res);
context.channels.abort.subscribe(() => {
aborted = true;

@@ -59,3 +53,3 @@ });

// Create a reduced subset of options meant for the http.request() method
var reqOpts = objectAssign(uri, {
const reqOpts = objectAssign(uri, {
method: options.method,

@@ -65,3 +59,3 @@ headers: objectAssign({}, options.headers, lengthHeader)

var protocol = uri.protocol === 'https:' ? https : http;
let protocol = uri.protocol === 'https:' ? https : http;

@@ -74,15 +68,15 @@ // We're using the follow-redirects module to transparently follow redirects

var request = protocol.request(reqOpts, function (response) {
// See if we should try to unzip the response
var tryUnzip = reqOpts.method !== 'HEAD';
var res = tryUnzip ? unzipResponse(response) : response;
const request = protocol.request(reqOpts, response => {
// See if we should try to decompress the response
const tryDecompress = reqOpts.method !== 'HEAD';
const res = tryDecompress ? decompressResponse(response) : response;
var resStream = context.applyMiddleware('onHeaders', res, {
const resStream = context.applyMiddleware('onHeaders', res, {
headers: response.headers,
adapter: adapter,
context: context
adapter,
context
});
// Concatenate the response body, then parse the response with middlewares
concat(resStream, function (err, data) {
concat(resStream, (err, data) => {
if (err) {

@@ -92,4 +86,4 @@ return callback(err);

var body = options.rawBody ? data : data.toString();
var reduced = reduceResponse(res, options.url, reqOpts.method, body);
const body = options.rawBody ? data : data.toString();
const reduced = reduceResponse(res, options.url, reqOpts.method, body);
return callback(null, reduced);

@@ -109,11 +103,11 @@ });

var _getProgressStream = getProgressStream(options),
bodyStream = _getProgressStream.bodyStream,
progress = _getProgressStream.progress;
var _getProgressStream = getProgressStream(options);
const bodyStream = _getProgressStream.bodyStream,
progress = _getProgressStream.progress;
// Let middleware know we're about to do a request
context.applyMiddleware('onRequest', { options, adapter, request, context, progress });
context.applyMiddleware('onRequest', { options: options, adapter: adapter, request: request, context: context, progress: progress });
if (bodyStream) {

@@ -125,5 +119,3 @@ bodyStream.pipe(request);

return { abort: function abort() {
return request.abort();
} };
return { abort: () => request.abort() };
};

@@ -136,4 +128,4 @@

var bodyIsStream = isStream(options.body);
var length = options.bodySize || (bodyIsStream ? null : Buffer.byteLength(options.body));
const bodyIsStream = isStream(options.body);
const length = options.bodySize || (bodyIsStream ? null : Buffer.byteLength(options.body));
if (!length) {

@@ -143,6 +135,6 @@ return bodyIsStream ? { bodyStream: options.body } : {};

var progress = progressStream({ time: 16, length: length });
var bodyStream = bodyIsStream ? options.body : toStream(options.body);
return { bodyStream: bodyStream.pipe(progress), progress: progress };
const progress = progressStream({ time: 16, length });
const bodyStream = bodyIsStream ? options.body : toStream(options.body);
return { bodyStream: bodyStream.pipe(progress), progress };
}
//# sourceMappingURL=node-request.js.map
'use strict';
/* eslint-disable no-console */
var fs = require('fs');
var path = require('path');
var boxen = require('boxen');
var chalk = require('chalk');
var gzipSize = require('gzip-size');
var prettyBytes = require('pretty-bytes');
const fs = require('fs');
const path = require('path');
const boxen = require('boxen');
const chalk = require('chalk');
const gzipSize = require('gzip-size');
const prettyBytes = require('pretty-bytes');
var read = function read(filePath) {
return new Promise(function (resolve, reject) {
fs.readFile(filePath, function (err, content) {
if (err) {
reject(err);
} else {
resolve(content);
}
});
const read = filePath => new Promise((resolve, reject) => {
fs.readFile(filePath, (err, content) => {
if (err) {
reject(err);
} else {
resolve(content);
}
});
};
});
var zip = function zip(content) {
return new Promise(function (resolve, reject) {
gzipSize(content, function (err, zipSize) {
if (err) {
reject(err);
} else {
resolve({
uncompressed: content.length,
compressed: zipSize
});
}
});
const zip = content => new Promise((resolve, reject) => {
gzipSize(content, (err, zipSize) => {
if (err) {
reject(err);
} else {
resolve({
uncompressed: content.length,
compressed: zipSize
});
}
});
};
});
var umdPath = path.join(__dirname, '..', '..', 'umd');
var bundlePath = path.join(umdPath, 'get-it.js');
var minPath = path.join(umdPath, 'get-it.min.js');
var allPath = path.join(umdPath, 'get-it-all.js');
var minAllPath = path.join(umdPath, 'get-it-all.min.js');
const umdPath = path.join(__dirname, '..', '..', 'umd');
const bundlePath = path.join(umdPath, 'get-it.js');
const minPath = path.join(umdPath, 'get-it.min.js');
const allPath = path.join(umdPath, 'get-it-all.js');
const minAllPath = path.join(umdPath, 'get-it-all.min.js');
Promise.all([bundlePath, minPath, allPath, minAllPath].map(read)).then(function (files) {
return Promise.all(files.map(zip));
}).then(output).catch(throwOnError);
Promise.all([bundlePath, minPath, allPath, minAllPath].map(read)).then(files => Promise.all(files.map(zip))).then(output).catch(throwOnError);
function output(res) {
var text = ['UMD bundle size:', '────────────────', 'Raw: ' + size(res[0].uncompressed), 'Raw + gzip: ' + size(res[0].compressed), '', 'Minified: ' + size(res[1].uncompressed), 'Minified + gzip: ' + size(res[1].compressed), '', 'Full bundle: ' + size(res[2].uncompressed), 'Full bundle + gzip: ' + size(res[2].compressed), '', 'Full bundle, minified: ' + size(res[3].uncompressed), 'Full bundle, minified + gzip: ' + size(res[3].compressed)].join('\n');
const text = ['UMD bundle size:', '────────────────', `Raw: ${size(res[0].uncompressed)}`, `Raw + gzip: ${size(res[0].compressed)}`, '', `Minified: ${size(res[1].uncompressed)}`, `Minified + gzip: ${size(res[1].compressed)}`, '', `Full bundle: ${size(res[2].uncompressed)}`, `Full bundle + gzip: ${size(res[2].compressed)}`, '', `Full bundle, minified: ${size(res[3].uncompressed)}`, `Full bundle, minified + gzip: ${size(res[3].compressed)}`].join('\n');

@@ -67,5 +61,5 @@ console.log(boxen(text, {

function size(bytes) {
var color = bytes > 1024 * 50 ? 'red' : 'green';
const color = bytes > 1024 * 50 ? 'red' : 'green';
return chalk[color](prettyBytes(bytes));
}
//# sourceMappingURL=print-bundle-size.js.map
"use strict";
module.exports = function (err) {
return err.isNetworkError || false;
};
module.exports = err => err.isNetworkError || false;
//# sourceMappingURL=browser-shouldRetry.js.map
"use strict";
module.exports = function (middleware) {
var applyMiddleware = function applyMiddleware(hook, defaultValue) {
module.exports = middleware => {
const applyMiddleware = function applyMiddleware(hook, defaultValue) {
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {

@@ -9,3 +9,3 @@ args[_key - 2] = arguments[_key];

return middleware[hook].reduce(function (value, handler) {
return middleware[hook].reduce((value, handler) => {
return handler.apply(undefined, [value].concat(args));

@@ -12,0 +12,0 @@ }, defaultValue);

'use strict';
var allowed = require('is-retry-allowed');
const allowed = require('is-retry-allowed');
module.exports = function (err) {
module.exports = err => {
// Don't allow retries if we get any http status code by default

@@ -7,0 +7,0 @@ if (err.response && err.response.statusCode) {

{
"name": "get-it",
"version": "2.0.0",
"version": "2.0.1",
"description": "Generic HTTP request library for node and browsers",
"main": "lib/index.js",
"main": "index.js",
"engines": {

@@ -10,9 +10,13 @@ "node": ">=4.0.0"

"browser": {
"./middleware.js": "./lib-browser/middleware/index.js",
"./src/index.js": "./lib-browser/index.js",
"./lib/index.js": "./lib-browser/index.js",
"./src/request/node-request.js": "./src/request/browser-request.js",
"./lib/request/node-request.js": "./lib/request/browser-request.js",
"./lib-browser/request/node-request.js": "./lib-browser/request/browser-request.js",
"./src/middleware/progress/node-progress.js": "./src/middleware/progress/browser-progress.js",
"./lib/middleware/progress/node-progress.js": "./lib/middleware/progress/browser-progress.js",
"./lib-browser/middleware/progress/node-progress.js": "./lib-browser/middleware/progress/browser-progress.js",
"./src/util/node-shouldRetry.js": "./src/util/browser-shouldRetry.js",
"./lib/util/node-shouldRetry.js": "./lib/util/browser-shouldRetry.js",
"./lib-browser/util/node-shouldRetry.js": "./lib-browser/util/browser-shouldRetry.js",
"fs": "./test/helpers/noop.js",
"get-uri": "./test/helpers/noop.js",
"into-stream": "./test/helpers/noop.js"

@@ -22,6 +26,6 @@ },

"bundle": "npm run bundle:build && npm run bundle:build:all && npm run bundle:minify && npm run bundle:minify:all && npm run bundle:size",
"bundle:analyze": "npm run compile && NODE_ENV=production DEBUG='' browserify --full-paths -t envify -g uglifyify lib/index.js | discify --open",
"bundle:analyze:all": "npm run compile && NODE_ENV=production DEBUG='' browserify --full-paths -t envify -g uglifyify lib/bundle-all.js | discify --open",
"bundle:build": "npm run compile && NODE_ENV=production DEBUG='' browserify -t envify -g uglifyify lib/index.js -o umd/get-it.js --standalone=getIt",
"bundle:build:all": "npm run compile && NODE_ENV=production DEBUG='' browserify -t envify -g uglifyify lib/bundle-all.js -o umd/get-it-all.js --standalone=getIt",
"bundle:analyze": "npm run compile && NODE_ENV=production DEBUG='' browserify --full-paths -t envify -g uglifyify lib-browser/index.js | discify --open",
"bundle:analyze:all": "npm run compile && NODE_ENV=production DEBUG='' browserify --full-paths -t envify -g uglifyify lib-browser/bundle-all.js | discify --open",
"bundle:build": "npm run compile && NODE_ENV=production DEBUG='' browserify -t envify -g uglifyify lib-browser/index.js -o umd/get-it.js --standalone=getIt",
"bundle:build:all": "npm run compile && NODE_ENV=production DEBUG='' browserify -t envify -g uglifyify lib-browser/bundle-all.js -o umd/get-it-all.js --standalone=getIt",
"bundle:minify": "uglifyjs -c -m -- umd/get-it.js > umd/get-it.min.js",

@@ -32,4 +36,4 @@ "bundle:minify:all": "uglifyjs -c -m -- umd/get-it-all.js > umd/get-it-all.min.js",

"ci": "npm run coverage && npm run karma && npm run lint",
"clean": "rimraf lib .nyc_output coverage npm-debug.log yarn-debug.log umd/*.js",
"compile": "babel --source-maps --copy-files -d lib/ src/",
"clean": "rimraf lib lib-browser .nyc_output coverage npm-debug.log yarn-debug.log umd/*.js",
"compile": "BABEL_ENV=node babel --source-maps --copy-files -d lib/ src/ && BABEL_ENV=browser babel --source-maps --copy-files -d lib-browser/ src/",
"coverage": "nyc --reporter=html --reporter=lcov --reporter=text _mocha",

@@ -40,3 +44,3 @@ "karma": "karma start",

"prepublish": "in-publish && npm run build && npm test || not-in-publish",
"test": "mocha"
"test": "BABEL_ENV=node mocha"
},

@@ -52,55 +56,55 @@ "keywords": [

"create-error-class": "^3.0.2",
"debug": "^2.6.1",
"follow-redirects": "^1.2.1",
"debug": "^2.6.8",
"decompress-response": "^3.3.0",
"follow-redirects": "^1.2.4",
"in-publish": "^2.0.0",
"into-stream": "^3.1.0",
"is-plain-object": "^2.0.1",
"is-plain-object": "^2.0.3",
"is-retry-allowed": "^1.1.0",
"is-stream": "^1.1.0",
"nano-pubsub": "^1.0.1",
"nano-pubsub": "^1.0.2",
"object-assign": "^4.1.1",
"parse-headers": "^2.0.1",
"progress-stream": "^1.2.0",
"progress-stream": "^2.0.0",
"same-origin": "^0.1.1",
"simple-concat": "^1.0.0",
"timed-out": "^3.1.0",
"unzip-response": "^2.0.1",
"url-parse": "^1.1.8"
"timed-out": "^4.0.1",
"url-parse": "^1.1.9"
},
"devDependencies": {
"babel-cli": "^6.23.0",
"babel-loader": "^6.3.2",
"babel-preset-es2015": "^6.22.0",
"babel-register": "^6.23.0",
"boxen": "^1.0.0",
"browserify": "^13.1.1",
"babel-cli": "^6.24.1",
"babel-loader": "^7.1.1",
"babel-preset-env": "^1.5.2",
"babel-register": "^6.24.1",
"boxen": "^1.1.0",
"browserify": "^14.4.0",
"chai": "^3.5.0",
"chai-as-promised": "^6.0.0",
"chai-subset": "^1.4.0",
"chalk": "^1.1.3",
"chai-subset": "^1.5.0",
"chalk": "^2.0.1",
"disc": "^1.3.2",
"envify": "^4.0.0",
"es6-promise": "^4.0.5",
"eslint": "^3.16.0",
"eslint-config-sanity": "^2.0.2",
"es6-promise": "^4.1.1",
"eslint": "^4.1.1",
"eslint-config-sanity": "^2.1.4",
"get-uri": "^2.0.0",
"gzip-size": "^3.0.0",
"karma": "^1.5.0",
"karma-chrome-launcher": "^2.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma": "^1.7.0",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.0.1",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-virtualboxany-launcher": "^0.1.3",
"karma-webpack": "^1.8.0",
"karma-webpack": "^2.0.3",
"lodash.once": "^4.1.1",
"mocha": "^3.2.0",
"nyc": "^10.1.2",
"mocha": "^3.4.2",
"nyc": "^11.0.3",
"pretty-bytes": "^4.0.2",
"rimraf": "^2.6.0",
"uglify-js": "^2.7.5",
"uglifyify": "^3.0.4",
"webpack": "^1.14.0",
"rimraf": "^2.6.1",
"uglify-js": "^3.0.23",
"uglifyify": "^4.0.2",
"webpack": "^2.0.0",
"zen-observable": "^0.4.0"
}
}
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.getIt = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";var getIt=require("./index");getIt.middleware=require("./middleware"),module.exports=getIt;
},{"./index":2,"./middleware":11}],2:[function(require,module,exports){
"use strict";var pubsub=require("nano-pubsub"),middlewareReducer=require("./util/middlewareReducer"),processOptions=require("./middleware/defaultOptionsProcessor"),httpRequest=require("./request"),channelNames=["request","response","progress","error","abort"],middlehooks=["processOptions","onRequest","onResponse","onError","onReturn","onHeaders"];module.exports=function e(){function r(e){function r(e,r,t){var s=e,u=r;if(!s)try{u=n("onResponse",r,t)}catch(e){u=null,s=e}s=s&&n("onError",s,t),s?o.error.publish(s):u&&o.response.publish(u)}var o=channelNames.reduce(function(e,r){return e[r]=pubsub(),e},{}),n=middlewareReducer(t),s=n("processOptions",e),u={options:s,channels:o,applyMiddleware:n},i=null,a=o.request.subscribe(function(e){i=httpRequest(e,function(o,n){return r(o,n,e)})});o.abort.subscribe(function(){a(),i&&i.abort()});var d=n("onReturn",o,u);return d===o&&o.request.publish(u),d}var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],t=middlehooks.reduce(function(e,r){return e[r]=e[r]||[],e},{processOptions:[processOptions]});return r.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&t.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");middlehooks.forEach(function(r){e[r]&&t[r].push(e[r])}),n.push(e)},r.clone=function(){return e(n)},o.forEach(r.use),r};
"use strict";var pubsub=require("nano-pubsub"),middlewareReducer=require("./util/middlewareReducer"),processOptions=require("./middleware/defaultOptionsProcessor"),httpRequest=require("./request"),channelNames=["request","response","progress","error","abort"],middlehooks=["processOptions","onRequest","onResponse","onError","onReturn","onHeaders"];module.exports=function e(){function r(e){function r(e,r,t){var s=e,u=r;if(!s)try{u=n("onResponse",r,t)}catch(e){u=null,s=e}(s=s&&n("onError",s,t))?o.error.publish(s):u&&o.response.publish(u)}var o=channelNames.reduce(function(e,r){return e[r]=pubsub(),e},{}),n=middlewareReducer(t),s={options:n("processOptions",e),channels:o,applyMiddleware:n},u=null,i=o.request.subscribe(function(e){u=httpRequest(e,function(o,n){return r(o,n,e)})});o.abort.subscribe(function(){i(),u&&u.abort()});var a=n("onReturn",o,s);return a===o&&o.request.publish(s),a}var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],t=middlehooks.reduce(function(e,r){return e[r]=e[r]||[],e},{processOptions:[processOptions]});return r.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&t.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");middlehooks.forEach(function(r){e[r]&&t[r].push(e[r])}),n.push(e)},r.clone=function(){return e(n)},o.forEach(r.use),r};
},{"./middleware/defaultOptionsProcessor":8,"./request":20,"./util/middlewareReducer":23,"nano-pubsub":33}],3:[function(require,module,exports){
"use strict";var objectAssign=require("object-assign"),leadingSlash=/^\//,trailingSlash=/\/$/;module.exports=function(r){var e=r.replace(trailingSlash,"");return{processOptions:function(r){if(/^https?:\/\//i.test(r.url))return r;var s=[e,r.url.replace(leadingSlash,"")].join("/");return objectAssign({},r,{url:s})}}};
},{"object-assign":34}],4:[function(require,module,exports){

@@ -11,3 +14,3 @@ "use strict";function Cancel(e){this.message=e}Cancel.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Cancel.prototype.__CANCEL__=!0,module.exports=Cancel;

},{}],5:[function(require,module,exports){
"use strict";function CancelToken(n){var e=this;if("function"!=typeof n)throw new TypeError("executor must be a function.");var o=null;this.promise=new Promise(function(n){o=n}),n(function(n){e.reason||(e.reason=new Cancel(n),o(e.reason))})}var Cancel=require("./Cancel");CancelToken.source=function(){var n=void 0,e=new CancelToken(function(e){n=e});return{token:e,cancel:n}},module.exports=CancelToken;
"use strict";function CancelToken(n){var e=this;if("function"!=typeof n)throw new TypeError("executor must be a function.");var o=null;this.promise=new Promise(function(n){o=n}),n(function(n){e.reason||(e.reason=new Cancel(n),o(e.reason))})}var Cancel=require("./Cancel");CancelToken.source=function(){var n=void 0;return{token:new CancelToken(function(e){n=e}),cancel:n}},module.exports=CancelToken;

@@ -18,6 +21,6 @@ },{"./Cancel":4}],6:[function(require,module,exports){

},{}],7:[function(require,module,exports){
"use strict";function stringifyBody(e){var t=(e.headers["content-type"]||"").toLowerCase(),s=t.indexOf("application/json")!==-1;return s?tryFormat(e.body):e.body}function tryFormat(e){try{var t="string"==typeof e?JSON.parse(e):e;return JSON.stringify(t,null,2)}catch(t){return e}}var debugIt=require("debug");module.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.verbose,s=e.namespace||"get-it",r=debugIt(s),n=e.log||r,o=n===r&&!debugIt.enabled(s),u=0;return{processOptions:function(e){return e.requestId=e.requestId||++u,e},onRequest:function(e){if(o||!e)return e;var s=e.options;return n("[%s] HTTP %s %s",s.requestId,s.method,s.url),t&&s.body&&"string"==typeof s.body&&n("[%s] Request body: %s",s.requestId,s.body),t&&s.headers&&n("[%s] Request headers: %s",s.requestId,JSON.stringify(s.headers,null,2)),e},onResponse:function(e,s){if(o||!e)return e;var r=s.options.requestId;return n("[%s] Response code: %s %s",r,e.statusCode,e.statusMessage),t&&e.body&&n("[%s] Response body: %s",r,stringifyBody(e)),e},onError:function(e,t){return n("[%s] ERROR: %s",t.options.requestId,e.message),e}}};
"use strict";function stringifyBody(e){return-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?tryFormat(e.body):e.body}function tryFormat(e){try{var t="string"==typeof e?JSON.parse(e):e;return JSON.stringify(t,null,2)}catch(t){return e}}var debugIt=require("debug");module.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.verbose,s=e.namespace||"get-it",r=debugIt(s),n=e.log||r,o=n===r&&!debugIt.enabled(s),u=0;return{processOptions:function(e){return e.requestId=e.requestId||++u,e},onRequest:function(e){if(o||!e)return e;var s=e.options;return n("[%s] HTTP %s %s",s.requestId,s.method,s.url),t&&s.body&&"string"==typeof s.body&&n("[%s] Request body: %s",s.requestId,s.body),t&&s.headers&&n("[%s] Request headers: %s",s.requestId,JSON.stringify(s.headers,null,2)),e},onResponse:function(e,s){if(o||!e)return e;var r=s.options.requestId;return n("[%s] Response code: %s %s",r,e.statusCode,e.statusMessage),t&&e.body&&n("[%s] Response body: %s",r,stringifyBody(e)),e},onError:function(e,t){return n("[%s] ERROR: %s",t.options.requestId,e.message),e}}};
},{"debug":26}],8:[function(require,module,exports){
"use strict";function stringifyQueryString(e){function r(e,n){Array.isArray(n)?n.forEach(function(t){return r(e,t)}):t.push([e,n].map(encodeURIComponent).join("="))}var t=[];for(var n in e)has.call(e,n)&&r(n,e[n]);return t.length?t.join("&"):""}function normalizeTimeout(e){if(e===!1||0===e)return!1;if(e.connect||e.socket)return e;var r=Number(e);return isNaN(r)?normalizeTimeout(defaultOptions.timeout):{connect:r,socket:r}}function removeUndefined(e){var r={};for(var t in e)void 0!==e[t]&&(r[t]=e[t]);return r}var objectAssign=require("object-assign"),urlParse=require("url-parse"),has=Object.prototype.hasOwnProperty,defaultOptions={timeout:12e4};module.exports=function(e){var r="string"==typeof e?objectAssign({url:e},defaultOptions):objectAssign({},defaultOptions,e),t=urlParse(r.url,{},!0);return r.timeout=normalizeTimeout(r.timeout),r.query&&(t.query=objectAssign({},t.query,removeUndefined(r.query))),r.method=r.body&&!r.method?"POST":(r.method||"GET").toUpperCase(),r.url=t.toString(stringifyQueryString),r};
},{"debug":27}],8:[function(require,module,exports){
"use strict";function stringifyQueryString(e){function r(e,n){Array.isArray(n)?n.forEach(function(t){return r(e,t)}):t.push([e,n].map(encodeURIComponent).join("="))}var t=[];for(var n in e)has.call(e,n)&&r(n,e[n]);return t.length?t.join("&"):""}function normalizeTimeout(e){if(!1===e||0===e)return!1;if(e.connect||e.socket)return e;var r=Number(e);return isNaN(r)?normalizeTimeout(defaultOptions.timeout):{connect:r,socket:r}}function removeUndefined(e){var r={};for(var t in e)void 0!==e[t]&&(r[t]=e[t]);return r}var objectAssign=require("object-assign"),urlParse=require("url-parse"),has=Object.prototype.hasOwnProperty,defaultOptions={timeout:12e4};module.exports=function(e){var r="string"==typeof e?objectAssign({url:e},defaultOptions):objectAssign({},defaultOptions,e),t=urlParse(r.url,{},!0);return r.timeout=normalizeTimeout(r.timeout),r.query&&(t.query=objectAssign({},t.query,removeUndefined(r.query))),r.method=r.body&&!r.method?"POST":(r.method||"GET").toUpperCase(),r.url=t.toString(stringifyQueryString),r};

@@ -28,19 +31,22 @@ },{"object-assign":34,"url-parse":42}],9:[function(require,module,exports){

},{"object-assign":34}],10:[function(require,module,exports){
"use strict";var createErrorClass=require("create-error-class"),HttpError=createErrorClass("HttpError",function(r){this.message=(r.method+"-request to "+r.url+" resulted in HTTP "+r.statusCode+" "+r.statusMessage).trim(),this.response=r});module.exports=function(){return{onResponse:function(r){var t=r.statusCode>=400;if(!t)return r;throw new HttpError(r)}}};
"use strict";var createErrorClass=require("create-error-class"),HttpError=createErrorClass("HttpError",function(r){this.message=(r.method+"-request to "+r.url+" resulted in HTTP "+r.statusCode+" "+r.statusMessage).trim(),this.response=r});module.exports=function(){return{onResponse:function(r){if(!(r.statusCode>=400))return r;throw new HttpError(r)}}};
},{"create-error-class":25}],11:[function(require,module,exports){
"use strict";exports.base=require("./base"),exports.debug=require("./debug"),exports.jsonRequest=require("./jsonRequest"),exports.jsonResponse=require("./jsonResponse"),exports.httpErrors=require("./httpErrors"),exports.retry=require("./retry"),exports.promise=require("./promise"),exports.observable=require("./observable"),exports.progress=require("./progress"),exports.headers=require("./headers");
},{"./base":3,"./debug":7,"./headers":9,"./httpErrors":10,"./jsonRequest":12,"./jsonResponse":13,"./observable":14,"./progress":16,"./promise":17,"./retry":18}],12:[function(require,module,exports){
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},objectAssign=require("object-assign"),isPlainObject=require("is-plain-object"),serializeTypes=["boolean","string","number"],isBuffer=function(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)};module.exports=function(){return{processOptions:function(e){var o=e.body,t=o&&!isBuffer(o)&&(serializeTypes.indexOf("undefined"==typeof o?"undefined":_typeof(o))!==-1||Array.isArray(o)||isPlainObject(o)||o&&"function"==typeof o.toJSON);return t?objectAssign({},e,{body:JSON.stringify(e.body),headers:objectAssign({},e.headers,{"Content-Type":"application/json"})}):e}}};
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},objectAssign=require("object-assign"),isPlainObject=require("is-plain-object"),serializeTypes=["boolean","string","number"],isBuffer=function(o){return!!o.constructor&&"function"==typeof o.constructor.isBuffer&&o.constructor.isBuffer(o)};module.exports=function(){return{processOptions:function(o){var e=o.body;return e&&!isBuffer(e)&&(-1!==serializeTypes.indexOf(void 0===e?"undefined":_typeof(e))||Array.isArray(e)||isPlainObject(e)||e&&"function"==typeof e.toJSON)?objectAssign({},o,{body:JSON.stringify(o.body),headers:objectAssign({},o.headers,{"Content-Type":"application/json"})}):o}}};
},{"is-plain-object":30,"object-assign":34}],13:[function(require,module,exports){
"use strict";function tryParse(e){try{return JSON.parse(e)}catch(e){throw e.message="Failed to parsed response body as JSON: "+e.message,e}}var objectAssign=require("object-assign");module.exports=function(){return{onResponse:function(e){var s=e.headers["content-type"];return e.body&&s&&s.indexOf("application/json")!==-1?objectAssign({},e,{body:tryParse(e.body)}):e},processOptions:function(e){return objectAssign({},e,{headers:objectAssign({Accept:"application/json"},e.headers)})}}};
},{"is-plain-object":31,"object-assign":34}],13:[function(require,module,exports){
"use strict";function tryParse(e){try{return JSON.parse(e)}catch(e){throw e.message="Failed to parsed response body as JSON: "+e.message,e}}var objectAssign=require("object-assign");module.exports=function(){return{onResponse:function(e){var s=e.headers["content-type"];return e.body&&s&&-1!==s.indexOf("application/json")?objectAssign({},e,{body:tryParse(e.body)}):e},processOptions:function(e){return objectAssign({},e,{headers:objectAssign({Accept:"application/json"},e.headers)})}}};
},{"object-assign":34}],14:[function(require,module,exports){
"use strict";var global=require("../util/global"),objectAssign=require("object-assign");module.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.implementation||global.Observable;if(!r)throw new Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:function(e,n){return new r(function(r){return e.error.subscribe(function(e){return r.error(e)}),e.progress.subscribe(function(e){return r.next(objectAssign({type:"progress"},e))}),e.response.subscribe(function(e){r.next(objectAssign({type:"response"},e)),r.complete()}),e.request.publish(n),function(){return e.abort.publish()}})}}};
"use strict";var global=require("../util/global"),objectAssign=require("object-assign");module.exports=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).implementation||global.Observable;if(!e)throw new Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:function(r,n){return new e(function(e){return r.error.subscribe(function(r){return e.error(r)}),r.progress.subscribe(function(r){return e.next(objectAssign({type:"progress"},r))}),r.response.subscribe(function(r){e.next(objectAssign({type:"response"},r)),e.complete()}),r.request.publish(n),function(){return r.abort.publish()}})}}};
},{"../util/global":22,"object-assign":34}],15:[function(require,module,exports){
"use strict";module.exports=function(){return{onRequest:function(o){function e(o){return function(e){var t=e.lengthComputable?e.loaded/e.total*100:-1;n.channels.progress.publish({stage:o,percent:t,total:e.total,loaded:e.loaded,lengthComputable:e.lengthComputable})}}if("xhr"===o.adapter){var t=o.request,n=o.context;"upload"in t&&"onprogress"in t.upload&&(t.upload.onprogress=e("upload")),"onprogress"in t&&(t.onprogress=e("download"))}}}};
},{}],16:[function(require,module,exports){
"use strict";module.exports=require("./node-progress");
},{"./node-progress":15}],17:[function(require,module,exports){

@@ -50,8 +56,10 @@ "use strict";var global=require("../util/global"),Cancel=require("./cancel/Cancel"),CancelToken=require("./cancel/CancelToken"),isCancel=require("./cancel/isCancel"),promise=function(){var e=global.Promise;if(!e)throw new Error("`Promise` is not available in global scope, and no implementation was passed");return{onReturn:function(n,r){return new e(function(e,o){var i=r.options.cancelToken;i&&i.promise.then(function(e){n.abort.publish(e),o(e)}),n.error.subscribe(o),n.response.subscribe(e),setTimeout(function(){return n.request.publish(r)},0)})}}};promise.Cancel=Cancel,promise.CancelToken=CancelToken,promise.isCancel=isCancel,module.exports=promise;

},{"../util/global":22,"./cancel/Cancel":4,"./cancel/CancelToken":5,"./cancel/isCancel":6}],18:[function(require,module,exports){
"use strict";function getRetryDelay(t){return 100*Math.pow(2,t)+100*Math.random()}var _typeof="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},objectAssign=require("object-assign"),defaultShouldRetry=require("../util/node-shouldRetry"),isStream=function(t){return null!==t&&"object"===("undefined"==typeof t?"undefined":_typeof(t))&&"function"==typeof t.pipe},retry=module.exports=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.maxRetries||5,r=t.retryDelay||getRetryDelay,o=t.shouldRetry||defaultShouldRetry;return{onError:function(t,n){var u=n.options,i=u.maxRetries||e,y=u.shouldRetry||o,l=u.attemptNumber||0;if(isStream(u.body))return t;if(!y(t,l,u)||l>=i)return t;var s=objectAssign({},n,{options:objectAssign({},u,{attemptNumber:l+1})});return setTimeout(function(){return n.channels.request.publish(s)},r(l)),null}}};retry.shouldRetry=defaultShouldRetry;
"use strict";function getRetryDelay(t){return 100*Math.pow(2,t)+100*Math.random()}var _typeof="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},objectAssign=require("object-assign"),defaultShouldRetry=require("../util/node-shouldRetry"),isStream=function(t){return null!==t&&"object"===(void 0===t?"undefined":_typeof(t))&&"function"==typeof t.pipe},retry=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.maxRetries||5,r=t.retryDelay||getRetryDelay,o=t.shouldRetry||defaultShouldRetry;return{onError:function(t,n){var u=n.options,i=u.maxRetries||e,y=u.shouldRetry||o,l=u.attemptNumber||0;if(isStream(u.body))return t;if(!y(t,l,u)||l>=i)return t;var s=objectAssign({},n,{options:objectAssign({},u,{attemptNumber:l+1})});return setTimeout(function(){return n.channels.request.publish(s)},r(l)),null}}};retry.shouldRetry=defaultShouldRetry,module.exports=retry;
},{"../util/node-shouldRetry":21,"object-assign":34}],19:[function(require,module,exports){
"use strict";var sameOrigin=require("same-origin"),parseHeaders=require("parse-headers"),noop=function(){},win=window,XmlHttpRequest=win.XMLHttpRequest||noop,hasXhr2="withCredentials"in new XmlHttpRequest,XDomainRequest=hasXhr2?XmlHttpRequest:win.XDomainRequest,adapter="xhr";module.exports=function(e,t){function r(){w=!0,p&&p.abort()}function n(t){q=!0,p.abort();var r=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+c.url:"Connection timed out on request to "+c.url);r.code=t,e.channels.error.publish(r)}function o(){X&&(s(),l.socket=setTimeout(function(){return n("ESOCKETTIMEDOUT")},X.socket))}function s(){(w||p.readyState>=2&&l.connect)&&clearTimeout(l.connect),l.socket&&clearTimeout(l.socket)}function a(){if(!h){s(),h=!0,p=null;var e=new Error("Network error while attempting to reach "+c.url);e.isNetworkError=!0,e.request=c,t(e)}}function i(){var e=p.status,t=p.statusText;if(f&&void 0===e)e=200;else{if(e>12e3&&e<12156)return a();e=1223===p.status?204:p.status,t=1223===p.status?"No Content":t}return{body:p.response||p.responseText,url:c.url,method:c.method,headers:f?{}:parseHeaders(p.getAllResponseHeaders()),statusCode:e,statusMessage:t}}function u(){if(!(w||h||q)){if(0===p.status)return void a(new Error("Unknown XHR error"));s(),h=!0,t(null,i())}}var c=e.options,d=!sameOrigin(win.location.href,c.url),l={},p=d?new XDomainRequest:new XmlHttpRequest,f=win.XDomainRequest&&p instanceof win.XDomainRequest,m=c.headers,w=!1,h=!1,q=!1;p.onerror=a,p.ontimeout=a,p.onabort=function(){w=!0},p.onprogress=function(){};var R=f?"onload":"onreadystatechange";if(p[R]=function(){o(),w||4!==p.readyState&&!f||0!==p.status&&u()},p.open(c.method,c.url,!0),p.withCredentials=!!c.withCredentials,m&&p.setRequestHeader)for(var T in m)m.hasOwnProperty(T)&&p.setRequestHeader(T,m[T]);else if(m&&f)throw new Error("Headers cannot be set on an XDomainRequest object");c.rawBody&&(p.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:c,adapter:adapter,request:p,context:e}),p.send(c.body||null);var X=c.timeout;return X&&(l.connect=setTimeout(function(){return n("ETIMEDOUT")},X.connect)),{abort:r}};
"use strict";var sameOrigin=require("same-origin"),parseHeaders=require("parse-headers"),noop=function(){},win=window,XmlHttpRequest=win.XMLHttpRequest||noop,hasXhr2="withCredentials"in new XmlHttpRequest,XDomainRequest=hasXhr2?XmlHttpRequest:win.XDomainRequest,adapter="xhr";module.exports=function(e,t){function n(t){f=!0,d.abort();var n=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+i.url:"Connection timed out on request to "+i.url);n.code=t,e.channels.error.publish(n)}function r(){q&&(o(),c.socket=setTimeout(function(){return n("ESOCKETTIMEDOUT")},q.socket))}function o(){(m||d.readyState>=2&&c.connect)&&clearTimeout(c.connect),c.socket&&clearTimeout(c.socket)}function s(){if(!w){o(),w=!0,d=null;var e=new Error("Network error while attempting to reach "+i.url);e.isNetworkError=!0,e.request=i,t(e)}}function a(){var e=d.status,t=d.statusText;if(l&&void 0===e)e=200;else{if(e>12e3&&e<12156)return s();e=1223===d.status?204:d.status,t=1223===d.status?"No Content":t}return{body:d.response||d.responseText,url:i.url,method:i.method,headers:l?{}:parseHeaders(d.getAllResponseHeaders()),statusCode:e,statusMessage:t}}function u(){m||w||f||(0!==d.status?(o(),w=!0,t(null,a())):s(new Error("Unknown XHR error")))}var i=e.options,c={},d=!sameOrigin(win.location.href,i.url)?new XDomainRequest:new XmlHttpRequest,l=win.XDomainRequest&&d instanceof win.XDomainRequest,p=i.headers,m=!1,w=!1,f=!1;if(d.onerror=s,d.ontimeout=s,d.onabort=function(){m=!0},d.onprogress=function(){},d[l?"onload":"onreadystatechange"]=function(){r(),m||4!==d.readyState&&!l||0!==d.status&&u()},d.open(i.method,i.url,!0),d.withCredentials=!!i.withCredentials,p&&d.setRequestHeader)for(var h in p)p.hasOwnProperty(h)&&d.setRequestHeader(h,p[h]);else if(p&&l)throw new Error("Headers cannot be set on an XDomainRequest object");i.rawBody&&(d.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:i,adapter:adapter,request:d,context:e}),d.send(i.body||null);var q=i.timeout;return q&&(c.connect=setTimeout(function(){return n("ETIMEDOUT")},q.connect)),{abort:function(){m=!0,d&&d.abort()}}};
},{"parse-headers":35,"same-origin":39}],20:[function(require,module,exports){
"use strict";module.exports=require("./node-request");
},{"./node-request":19}],21:[function(require,module,exports){

@@ -66,46 +74,57 @@ "use strict";module.exports=function(r){return r.isNetworkError||!1};

},{}],23:[function(require,module,exports){
"use strict";module.exports=function(r){var n=function(n,t){for(var e=arguments.length,u=Array(e>2?e-2:0),o=2;o<e;o++)u[o-2]=arguments[o];return r[n].reduce(function(r,n){return n.apply(void 0,[r].concat(u))},t)};return n};
"use strict";module.exports=function(r){return function(n,t){for(var e=arguments.length,u=Array(e>2?e-2:0),o=2;o<e;o++)u[o-2]=arguments[o];return r[n].reduce(function(r,n){return n.apply(void 0,[r].concat(u))},t)}};
},{}],24:[function(require,module,exports){
"use strict";module.exports=Error.captureStackTrace||function(r){var e=new Error;Object.defineProperty(r,"stack",{configurable:!0,get:function(){var r=e.stack;return Object.defineProperty(this,"stack",{value:r}),r}})};
},{}],25:[function(require,module,exports){
"use strict";function inherits(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}var captureStackTrace=require("capture-stack-trace");module.exports=function(e,t){if("string"!=typeof e)throw new TypeError("Expected className to be a string");if(/[^0-9a-zA-Z_$]/.test(e))throw new Error("className contains invalid characters");t=t||function(e){this.message=e};var r=function(){Object.defineProperty(this,"name",{configurable:!0,value:e,writable:!0}),captureStackTrace(this,this.constructor),t.apply(this,arguments)};return inherits(r,Error),r};
},{"capture-stack-trace":24}],26:[function(require,module,exports){
function parse(e){if(!((e=String(e)).length>100)){var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(r){var a=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*y;case"days":case"day":case"d":return a*d;case"hours":case"hour":case"hrs":case"hr":case"h":return a*h;case"minutes":case"minute":case"mins":case"min":case"m":return a*m;case"seconds":case"second":case"secs":case"sec":case"s":return a*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}function fmtShort(e){return e>=d?Math.round(e/d)+"d":e>=h?Math.round(e/h)+"h":e>=m?Math.round(e/m)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function fmtLong(e){return plural(e,d,"day")||plural(e,h,"hour")||plural(e,m,"minute")||plural(e,s,"second")||e+" ms"}function plural(s,e,r){if(!(s<e))return s<1.5*e?Math.floor(s/e)+" "+r:Math.ceil(s/e)+" "+r+"s"}var s=1e3,m=60*s,h=60*m,d=24*h,y=365.25*d;module.exports=function(s,e){e=e||{};var r=typeof s;if("string"===r&&s.length>0)return parse(s);if("number"===r&&!1===isNaN(s))return e.long?fmtLong(s):fmtShort(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))};
},{}],27:[function(require,module,exports){
(function (process){
function useColors(){return!("undefined"==typeof window||!window||"undefined"==typeof window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document&&"WebkitAppearance"in document.documentElement.style||"undefined"!=typeof window&&window&&window.console&&(console.firebug||console.exception&&console.table)||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(e){var o=this.useColors;if(e[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+e[0]+(o?"%c ":" ")+"+"+exports.humanize(this.diff),o){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var t=0,n=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(t++,"%c"===e&&(n=t))}),e.splice(n,0,r)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(e){try{null==e?exports.storage.removeItem("debug"):exports.storage.debug=e}catch(e){}}function load(){try{return exports.storage.debug}catch(e){}if("undefined"!=typeof process&&"env"in process)return process.env.DEBUG}function localstorage(){try{return window.localStorage}catch(e){}}exports=module.exports=require("./debug"),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:localstorage(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},exports.enable(load());
function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(e){var o=this.useColors;if(e[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+e[0]+(o?"%c ":" ")+"+"+exports.humanize(this.diff),o){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var t=0,n=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(t++,"%c"===e&&(n=t))}),e.splice(n,0,r)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(e){try{null==e?exports.storage.removeItem("debug"):exports.storage.debug=e}catch(e){}}function load(){var e;try{e=exports.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}function localstorage(){try{return window.localStorage}catch(e){}}exports=module.exports=require("./debug"),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:localstorage(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},exports.enable(load());
}).call(this,require('_process'))
},{"./debug":27,"_process":36}],27:[function(require,module,exports){
function selectColor(e){var r,t=0;for(r in e)t=(t<<5)-t+e.charCodeAt(r),t|=0;return exports.colors[Math.abs(t)%exports.colors.length]}function createDebug(e){function r(){if(r.enabled){var e=r,t=+new Date,o=t-(prevTime||t);e.diff=o,e.prev=prevTime,e.curr=t,prevTime=t;for(var s=new Array(arguments.length),n=0;n<s.length;n++)s[n]=arguments[n];s[0]=exports.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var a=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(r,t){if("%%"===r)return r;a++;var o=exports.formatters[t];if("function"==typeof o){var n=s[a];r=o.call(e,n),s.splice(a,1),a--}return r}),exports.formatArgs.call(e,s);var p=r.log||exports.log||console.log.bind(console);p.apply(e,s)}}return r.namespace=e,r.enabled=exports.enabled(e),r.useColors=exports.useColors(),r.color=selectColor(e),"function"==typeof exports.init&&exports.init(r),r}function enable(e){exports.save(e),exports.names=[],exports.skips=[];for(var r=(e||"").split(/[\s,]+/),t=r.length,o=0;o<t;o++)r[o]&&(e=r[o].replace(/\*/g,".*?"),"-"===e[0]?exports.skips.push(new RegExp("^"+e.substr(1)+"$")):exports.names.push(new RegExp("^"+e+"$")))}function disable(){exports.enable("")}function enabled(e){var r,t;for(r=0,t=exports.skips.length;r<t;r++)if(exports.skips[r].test(e))return!1;for(r=0,t=exports.names.length;r<t;r++)if(exports.names[r].test(e))return!0;return!1}function coerce(e){return e instanceof Error?e.stack||e.message:e}exports=module.exports=createDebug.debug=createDebug.default=createDebug,exports.coerce=coerce,exports.disable=disable,exports.enable=enable,exports.enabled=enabled,exports.humanize=require("ms"),exports.names=[],exports.skips=[],exports.formatters={};var prevTime;
},{"./debug":28,"_process":36}],28:[function(require,module,exports){
function selectColor(e){var r,t=0;for(r in e)t=(t<<5)-t+e.charCodeAt(r),t|=0;return exports.colors[Math.abs(t)%exports.colors.length]}function createDebug(e){function r(){if(r.enabled){var e=r,t=+new Date,o=t-(prevTime||t);e.diff=o,e.prev=prevTime,e.curr=t,prevTime=t;for(var s=new Array(arguments.length),n=0;n<s.length;n++)s[n]=arguments[n];s[0]=exports.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var p=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(r,t){if("%%"===r)return r;p++;var o=exports.formatters[t];if("function"==typeof o){var n=s[p];r=o.call(e,n),s.splice(p,1),p--}return r}),exports.formatArgs.call(e,s),(r.log||exports.log||console.log.bind(console)).apply(e,s)}}return r.namespace=e,r.enabled=exports.enabled(e),r.useColors=exports.useColors(),r.color=selectColor(e),"function"==typeof exports.init&&exports.init(r),r}function enable(e){exports.save(e),exports.names=[],exports.skips=[];for(var r=("string"==typeof e?e:"").split(/[\s,]+/),t=r.length,o=0;o<t;o++)r[o]&&("-"===(e=r[o].replace(/\*/g,".*?"))[0]?exports.skips.push(new RegExp("^"+e.substr(1)+"$")):exports.names.push(new RegExp("^"+e+"$")))}function disable(){exports.enable("")}function enabled(e){var r,t;for(r=0,t=exports.skips.length;r<t;r++)if(exports.skips[r].test(e))return!1;for(r=0,t=exports.names.length;r<t;r++)if(exports.names[r].test(e))return!0;return!1}function coerce(e){return e instanceof Error?e.stack||e.message:e}exports=module.exports=createDebug.debug=createDebug.default=createDebug,exports.coerce=coerce,exports.disable=disable,exports.enable=enable,exports.enabled=enabled,exports.humanize=require("ms"),exports.names=[],exports.skips=[],exports.formatters={};var prevTime;
},{"ms":32}],28:[function(require,module,exports){
},{"ms":26}],29:[function(require,module,exports){
function forEach(r,t,o){if(!isFunction(t))throw new TypeError("iterator must be a function");arguments.length<3&&(o=this),"[object Array]"===toString.call(r)?forEachArray(r,t,o):"string"==typeof r?forEachString(r,t,o):forEachObject(r,t,o)}function forEachArray(r,t,o){for(var n=0,a=r.length;n<a;n++)hasOwnProperty.call(r,n)&&t.call(o,r[n],n,r)}function forEachString(r,t,o){for(var n=0,a=r.length;n<a;n++)t.call(o,r.charAt(n),n,r)}function forEachObject(r,t,o){for(var n in r)hasOwnProperty.call(r,n)&&t.call(o,r[n],n,r)}var isFunction=require("is-function");module.exports=forEach;var toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty;
},{"is-function":29}],29:[function(require,module,exports){
},{"is-function":30}],30:[function(require,module,exports){
function isFunction(o){var t=toString.call(o);return"[object Function]"===t||"function"==typeof o&&"[object RegExp]"!==t||"undefined"!=typeof window&&(o===window.setTimeout||o===window.alert||o===window.confirm||o===window.prompt)}module.exports=isFunction;var toString=Object.prototype.toString;
},{}],30:[function(require,module,exports){
"use strict";function isObjectObject(t){return isObject(t)===!0&&"[object Object]"===Object.prototype.toString.call(t)}var isObject=require("isobject");module.exports=function(t){var e,c;return isObjectObject(t)!==!1&&(e=t.constructor,"function"==typeof e&&(c=e.prototype,isObjectObject(c)!==!1&&c.hasOwnProperty("isPrototypeOf")!==!1))};
},{"isobject":31}],31:[function(require,module,exports){
"use strict";module.exports=function(r){return null!=r&&"object"==typeof r&&!Array.isArray(r)};
},{}],32:[function(require,module,exports){
function parse(e){if(e=String(e),!(e.length>1e4)){var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(r){var a=parseFloat(r[1]),n=(r[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return a*y;case"days":case"day":case"d":return a*d;case"hours":case"hour":case"hrs":case"hr":case"h":return a*h;case"minutes":case"minute":case"mins":case"min":case"m":return a*m;case"seconds":case"second":case"secs":case"sec":case"s":return a*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}function fmtShort(e){return e>=d?Math.round(e/d)+"d":e>=h?Math.round(e/h)+"h":e>=m?Math.round(e/m)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function fmtLong(e){return plural(e,d,"day")||plural(e,h,"hour")||plural(e,m,"minute")||plural(e,s,"second")||e+" ms"}function plural(s,e,r){if(!(s<e))return s<1.5*e?Math.floor(s/e)+" "+r:Math.ceil(s/e)+" "+r+"s"}var s=1e3,m=60*s,h=60*m,d=24*h,y=365.25*d;module.exports=function(s,e){e=e||{};var r=typeof s;if("string"===r&&s.length>0)return parse(s);if("number"===r&&isNaN(s)===!1)return e.long?fmtLong(s):fmtShort(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))};
},{}],31:[function(require,module,exports){
"use strict";function isObjectObject(t){return!0===isObject(t)&&"[object Object]"===Object.prototype.toString.call(t)}var isObject=require("isobject");module.exports=function(t){var e,c;return!1!==isObjectObject(t)&&("function"==typeof(e=t.constructor)&&(c=e.prototype,!1!==isObjectObject(c)&&!1!==c.hasOwnProperty("isPrototypeOf")))};
},{"isobject":32}],32:[function(require,module,exports){
"use strict";module.exports=function(r){return null!=r&&"object"==typeof r&&!1===Array.isArray(r)};
},{}],33:[function(require,module,exports){
module.exports=function(){function n(n){return r.push(n),function(){var u=r.indexOf(n);u>-1&&r.splice(u,1)}}function u(){for(var n=0;n<r.length;n++)r[n].apply(null,arguments)}var r=[];return{subscribe:n,publish:u}};
module.exports=function(){var n=[];return{subscribe:function(u){return n.push(u),function(){var r=n.indexOf(u);r>-1&&n.splice(r,1)}},publish:function(){for(var u=0;u<n.length;u++)n[u].apply(null,arguments)}}};
},{}],34:[function(require,module,exports){
"use strict";function toObject(r){if(null===r||void 0===r)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function shouldUseNative(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de","5"===Object.getOwnPropertyNames(r)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(r){return e[r]});if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(r){o[r]=r}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(r){return!1}}var getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=shouldUseNative()?Object.assign:function(r,e){for(var t,n,o=toObject(r),a=1;a<arguments.length;a++){t=Object(arguments[a]);for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);if(getOwnPropertySymbols){n=getOwnPropertySymbols(t);for(var c=0;c<n.length;c++)propIsEnumerable.call(t,n[c])&&(o[n[c]]=t[n[c]])}}return o};
"use strict";function toObject(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function shouldUseNative(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(r).map(function(e){return r[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}var getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=shouldUseNative()?Object.assign:function(e,r){for(var t,n,o=toObject(e),a=1;a<arguments.length;a++){t=Object(arguments[a]);for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);if(getOwnPropertySymbols){n=getOwnPropertySymbols(t);for(var c=0;c<n.length;c++)propIsEnumerable.call(t,n[c])&&(o[n[c]]=t[n[c]])}}return o};
},{}],35:[function(require,module,exports){
var trim=require("trim"),forEach=require("for-each"),isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)};module.exports=function(r){if(!r)return{};var e={};return forEach(trim(r).split("\n"),function(r){var t=r.indexOf(":"),i=trim(r.slice(0,t)).toLowerCase(),o=trim(r.slice(t+1));"undefined"==typeof e[i]?e[i]=o:isArray(e[i])?e[i].push(o):e[i]=[e[i],o]}),e};
var trim=require("trim"),forEach=require("for-each"),isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)};module.exports=function(r){if(!r)return{};var t={};return forEach(trim(r).split("\n"),function(r){var i=r.indexOf(":"),e=trim(r.slice(0,i)).toLowerCase(),o=trim(r.slice(i+1));void 0===t[e]?t[e]=o:isArray(t[e])?t[e].push(o):t[e]=[t[e],o]}),t};
},{"for-each":28,"trim":41}],36:[function(require,module,exports){
},{"for-each":29,"trim":41}],36:[function(require,module,exports){
function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}function cleanUpNextTick(){draining&&currentQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}var process=module.exports={},cachedSetTimeout,cachedClearTimeout;!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var queue=[],draining=!1,currentQueue,queueIndex=-1;process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var u=1;u<arguments.length;u++)t[u-1]=arguments[u];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};
},{}],37:[function(require,module,exports){
"use strict";function querystring(e){for(var r,n=/([^=?&]+)=?([^&]*)/g,t={};r=n.exec(e);t[decodeURIComponent(r[1])]=decodeURIComponent(r[2]));return t}function querystringify(e,r){r=r||"";var n=[];"string"!=typeof r&&(r="?");for(var t in e)has.call(e,t)&&n.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return n.length?r+n.join("&"):""}var has=Object.prototype.hasOwnProperty;exports.stringify=querystringify,exports.parse=querystring;
"use strict";function decode(e){return decodeURIComponent(e.replace(/\+/g," "))}function querystring(e){for(var r,n=/([^=?&]+)=?([^&]*)/g,t={};r=n.exec(e);t[decode(r[1])]=decode(r[2]));return t}function querystringify(e,r){var n=[];"string"!=typeof(r=r||"")&&(r="?");for(var t in e)has.call(e,t)&&n.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return n.length?r+n.join("&"):""}var has=Object.prototype.hasOwnProperty;exports.stringify=querystringify,exports.parse=querystring;
},{}],38:[function(require,module,exports){
"use strict";module.exports=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e};
"use strict";module.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e};
},{}],39:[function(require,module,exports){
"use strict";var url=require("url");module.exports=function(o,r,t){if(o===r)return!0;var p=url.parse(o,!1,!0),e=url.parse(r,!1,!0),s=0|p.port||("https"===p.protocol?443:80),u=0|e.port||("https"===e.protocol?443:80),l={proto:p.protocol===e.protocol,hostname:p.hostname===e.hostname,port:s===u};return l.proto&&l.hostname&&(l.port||t)};
},{"url":40}],40:[function(require,module,exports){
"use strict";var regex=/^(?:(?:(?:([^:\/#\?]+:)?(?:(?:\/\/)((?:((?:[^:@\/#\?]+)(?:\:(?:[^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/;module.exports={regex:regex,parse:function(e){var o=regex.exec(e);return o?{protocol:(o[1]||"").toLowerCase()||void 0,hostname:(o[5]||"").toLowerCase()||void 0,port:o[6]||void 0}:{}}};
},{}],41:[function(require,module,exports){

@@ -115,9 +134,7 @@ function trim(r){return r.replace(/^\s*|\s*$/g,"")}exports=module.exports=trim,exports.left=function(r){return r.replace(/^\s*/,"")},exports.right=function(r){return r.replace(/\s*$/,"")};

},{}],42:[function(require,module,exports){
"use strict";function extractProtocol(o){var t=protocolre.exec(o);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function resolve(o,t){for(var e=(t||"/").split("/").slice(0,-1).concat(o.split("/")),r=e.length,s=e[r-1],a=!1,n=0;r--;)"."===e[r]?e.splice(r,1):".."===e[r]?(e.splice(r,1),n++):n&&(0===r&&(a=!0),e.splice(r,1),n--);return a&&e.unshift(""),"."!==s&&".."!==s||e.push(""),e.join("/")}function URL(o,t,e){if(!(this instanceof URL))return new URL(o,t,e);var r,s,a,n,l,i,c=rules.slice(),h=typeof t,p=this,u=0;for("object"!==h&&"string"!==h&&(e=t,t=null),e&&"function"!=typeof e&&(e=qs.parse),t=lolcation(t),s=extractProtocol(o||""),r=!s.protocol&&!s.slashes,p.slashes=s.slashes||r&&t.slashes,p.protocol=s.protocol||t.protocol||"",o=s.rest,s.slashes||(c[2]=[/(.*)/,"pathname"]);u<c.length;u++)n=c[u],a=n[0],i=n[1],a!==a?p[i]=o:"string"==typeof a?~(l=o.indexOf(a))&&("number"==typeof n[2]?(p[i]=o.slice(0,l),o=o.slice(l+n[2])):(p[i]=o.slice(l),o=o.slice(0,l))):(l=a.exec(o))&&(p[i]=l[1],o=o.slice(0,l.index)),p[i]=p[i]||(r&&n[3]?t[i]||"":""),n[4]&&(p[i]=p[i].toLowerCase());e&&(p.query=e(p.query)),r&&t.slashes&&"/"!==p.pathname.charAt(0)&&(""!==p.pathname||""!==t.pathname)&&(p.pathname=resolve(p.pathname,t.pathname)),required(p.port,p.protocol)||(p.host=p.hostname,p.port=""),p.username=p.password="",p.auth&&(n=p.auth.split(":"),p.username=n[0]||"",p.password=n[1]||""),p.origin=p.protocol&&p.host&&"file:"!==p.protocol?p.protocol+"//"+p.host:"null",p.href=p.toString()}function set(o,t,e){var r=this;switch(o){case"query":"string"==typeof t&&t.length&&(t=(e||qs.parse)(t)),r[o]=t;break;case"port":r[o]=t,required(t,r.protocol)?t&&(r.host=r.hostname+":"+t):(r.host=r.hostname,r[o]="");break;case"hostname":r[o]=t,r.port&&(t+=":"+r.port),r.host=t;break;case"host":r[o]=t,/:\d+$/.test(t)?(t=t.split(":"),r.port=t.pop(),r.hostname=t.join(":")):(r.hostname=t,r.port="");break;case"protocol":r.protocol=t.toLowerCase(),r.slashes=!e;break;case"pathname":r.pathname=t.length&&"/"!==t.charAt(0)?"/"+t:t;break;default:r[o]=t}for(var s=0;s<rules.length;s++){var a=rules[s];a[4]&&(r[a[1]]=r[a[1]].toLowerCase())}return r.origin=r.protocol&&r.host&&"file:"!==r.protocol?r.protocol+"//"+r.host:"null",r.href=r.toString(),r}function toString(o){o&&"function"==typeof o||(o=qs.stringify);var t,e=this,r=e.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var s=r+(e.slashes?"//":"");return e.username&&(s+=e.username,e.password&&(s+=":"+e.password),s+="@"),s+=e.host+e.pathname,t="object"==typeof e.query?o(e.query):e.query,t&&(s+="?"!==t.charAt(0)?"?"+t:t),e.hash&&(s+=e.hash),s}var required=require("requires-port"),lolcation=require("./lolcation"),qs=require("querystringify"),protocolre=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,rules=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]];URL.prototype={set:set,toString:toString},URL.extractProtocol=extractProtocol,URL.location=lolcation,URL.qs=qs,module.exports=URL;
},{"./lolcation":43,"querystringify":37,"requires-port":38}],43:[function(require,module,exports){
(function (global){
"use strict";var slashes=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,ignore={hash:1,query:1},URL;module.exports=function(e){e=e||global.location||{},URL=URL||require("./");var s,o={},r=typeof e;if("blob:"===e.protocol)o=new URL(unescape(e.pathname),{});else if("string"===r){o=new URL(e,{});for(s in ignore)delete o[s]}else if("object"===r){for(s in e)s in ignore||(o[s]=e[s]);void 0===o.slashes&&(o.slashes=slashes.test(e.href))}return o};
"use strict";function lolcation(e){var o,t={},r=typeof(e=e||global.location||{});if("blob:"===e.protocol)t=new URL(unescape(e.pathname),{});else if("string"===r){t=new URL(e,{});for(o in ignore)delete t[o]}else if("object"===r){for(o in e)o in ignore||(t[o]=e[o]);void 0===t.slashes&&(t.slashes=slashes.test(e.href))}return t}function extractProtocol(e){var o=protocolre.exec(e);return{protocol:o[1]?o[1].toLowerCase():"",slashes:!!o[2],rest:o[3]}}function resolve(e,o){for(var t=(o||"/").split("/").slice(0,-1).concat(e.split("/")),r=t.length,s=t[r-1],a=!1,n=0;r--;)"."===t[r]?t.splice(r,1):".."===t[r]?(t.splice(r,1),n++):n&&(0===r&&(a=!0),t.splice(r,1),n--);return a&&t.unshift(""),"."!==s&&".."!==s||t.push(""),t.join("/")}function URL(e,o,t){if(!(this instanceof URL))return new URL(e,o,t);var r,s,a,n,l,i,h=rules.slice(),c=typeof o,p=this,u=0;for("object"!==c&&"string"!==c&&(t=o,o=null),t&&"function"!=typeof t&&(t=qs.parse),o=lolcation(o),r=!(s=extractProtocol(e||"")).protocol&&!s.slashes,p.slashes=s.slashes||r&&o.slashes,p.protocol=s.protocol||o.protocol||"",e=s.rest,s.slashes||(h[2]=[/(.*)/,"pathname"]);u<h.length;u++)a=(n=h[u])[0],i=n[1],a!==a?p[i]=e:"string"==typeof a?~(l=e.indexOf(a))&&("number"==typeof n[2]?(p[i]=e.slice(0,l),e=e.slice(l+n[2])):(p[i]=e.slice(l),e=e.slice(0,l))):(l=a.exec(e))&&(p[i]=l[1],e=e.slice(0,l.index)),p[i]=p[i]||(r&&n[3]?o[i]||"":""),n[4]&&(p[i]=p[i].toLowerCase());t&&(p.query=t(p.query)),r&&o.slashes&&"/"!==p.pathname.charAt(0)&&(""!==p.pathname||""!==o.pathname)&&(p.pathname=resolve(p.pathname,o.pathname)),required(p.port,p.protocol)||(p.host=p.hostname,p.port=""),p.username=p.password="",p.auth&&(n=p.auth.split(":"),p.username=n[0]||"",p.password=n[1]||""),p.origin=p.protocol&&p.host&&"file:"!==p.protocol?p.protocol+"//"+p.host:"null",p.href=p.toString()}function set(e,o,t){var r=this;switch(e){case"query":"string"==typeof o&&o.length&&(o=(t||qs.parse)(o)),r[e]=o;break;case"port":r[e]=o,required(o,r.protocol)?o&&(r.host=r.hostname+":"+o):(r.host=r.hostname,r[e]="");break;case"hostname":r[e]=o,r.port&&(o+=":"+r.port),r.host=o;break;case"host":r[e]=o,/:\d+$/.test(o)?(o=o.split(":"),r.port=o.pop(),r.hostname=o.join(":")):(r.hostname=o,r.port="");break;case"protocol":r.protocol=o.toLowerCase(),r.slashes=!t;break;case"pathname":r.pathname=o.length&&"/"!==o.charAt(0)?"/"+o:o;break;default:r[e]=o}for(var s=0;s<rules.length;s++){var a=rules[s];a[4]&&(r[a[1]]=r[a[1]].toLowerCase())}return r.origin=r.protocol&&r.host&&"file:"!==r.protocol?r.protocol+"//"+r.host:"null",r.href=r.toString(),r}function toString(e){e&&"function"==typeof e||(e=qs.stringify);var o,t=this,r=t.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var s=r+(t.slashes?"//":"");return t.username&&(s+=t.username,t.password&&(s+=":"+t.password),s+="@"),s+=t.host+t.pathname,(o="object"==typeof t.query?e(t.query):t.query)&&(s+="?"!==o.charAt(0)?"?"+o:o),t.hash&&(s+=t.hash),s}var required=require("requires-port"),qs=require("querystringify"),protocolre=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,slashes=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,rules=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],ignore={hash:1,query:1};URL.prototype={set:set,toString:toString},URL.extractProtocol=extractProtocol,URL.location=lolcation,URL.qs=qs,module.exports=URL;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./":42}]},{},[1])(1)
},{"querystringify":37,"requires-port":38}]},{},[1])(1)
});

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.getIt=e()}}(function(){return function e(t,r,n){function o(i,u){if(!r[i]){if(!t[i]){var a="function"==typeof require&&require;if(!u&&a)return a(i,!0);if(s)return s(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[i]={exports:{}};t[i][0].call(f.exports,function(e){var r=t[i][1][e];return o(r?r:e)},f,f.exports,e,t,r,n)}return r[i].exports}for(var s="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}({1:[function(e,t,r){"use strict";var n=e("./index");n.middleware=e("./middleware"),t.exports=n},{"./index":2,"./middleware":11}],2:[function(e,t,r){"use strict";var n=e("nano-pubsub"),o=e("./util/middlewareReducer"),s=e("./middleware/defaultOptionsProcessor"),i=e("./request"),u=["request","response","progress","error","abort"],a=["processOptions","onRequest","onResponse","onError","onReturn","onHeaders"];t.exports=function e(){function t(e){function t(e,t,n){var o=e,i=t;if(!o)try{i=s("onResponse",t,n)}catch(e){i=null,o=e}o=o&&s("onError",o,n),o?r.error.publish(o):i&&r.response.publish(i)}var r=u.reduce(function(e,t){return e[t]=n(),e},{}),s=o(f),a=s("processOptions",e),c={options:a,channels:r,applyMiddleware:s},l=null,p=r.request.subscribe(function(e){l=i(e,function(r,n){return t(r,n,e)})});r.abort.subscribe(function(){p(),l&&l.abort()});var d=s("onReturn",r,c);return d===r&&r.request.publish(c),d}var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],c=[],f=a.reduce(function(e,t){return e[t]=e[t]||[],e},{processOptions:[s]});return t.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&f.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");a.forEach(function(t){e[t]&&f[t].push(e[t])}),c.push(e)},t.clone=function(){return e(c)},r.forEach(t.use),t}},{"./middleware/defaultOptionsProcessor":8,"./request":20,"./util/middlewareReducer":23,"nano-pubsub":33}],3:[function(e,t,r){"use strict";var n=e("object-assign"),o=/^\//,s=/\/$/;t.exports=function(e){var t=e.replace(s,"");return{processOptions:function(e){if(/^https?:\/\//i.test(e.url))return e;var r=[t,e.url.replace(o,"")].join("/");return n({},e,{url:r})}}}},{"object-assign":34}],4:[function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,t.exports=n},{}],5:[function(e,t,r){"use strict";function n(e){var t=this;if("function"!=typeof e)throw new TypeError("executor must be a function.");var r=null;this.promise=new Promise(function(e){r=e}),e(function(e){t.reason||(t.reason=new o(e),r(t.reason))})}var o=e("./Cancel");n.source=function(){var e=void 0,t=new n(function(t){e=t});return{token:t,cancel:e}},t.exports=n},{"./Cancel":4}],6:[function(e,t,r){"use strict";t.exports=function(e){return!(!e||!e.__CANCEL__)}},{}],7:[function(e,t,r){"use strict";function n(e){var t=(e.headers["content-type"]||"").toLowerCase(),r=t.indexOf("application/json")!==-1;return r?o(e.body):e.body}function o(e){try{var t="string"==typeof e?JSON.parse(e):e;return JSON.stringify(t,null,2)}catch(t){return e}}var s=e("debug");t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.verbose,r=e.namespace||"get-it",o=s(r),i=e.log||o,u=i===o&&!s.enabled(r),a=0;return{processOptions:function(e){return e.requestId=e.requestId||++a,e},onRequest:function(e){if(u||!e)return e;var r=e.options;return i("[%s] HTTP %s %s",r.requestId,r.method,r.url),t&&r.body&&"string"==typeof r.body&&i("[%s] Request body: %s",r.requestId,r.body),t&&r.headers&&i("[%s] Request headers: %s",r.requestId,JSON.stringify(r.headers,null,2)),e},onResponse:function(e,r){if(u||!e)return e;var o=r.options.requestId;return i("[%s] Response code: %s %s",o,e.statusCode,e.statusMessage),t&&e.body&&i("[%s] Response body: %s",o,n(e)),e},onError:function(e,t){return i("[%s] ERROR: %s",t.options.requestId,e.message),e}}}},{debug:26}],8:[function(e,t,r){"use strict";function n(e){function t(e,n){Array.isArray(n)?n.forEach(function(r){return t(e,r)}):r.push([e,n].map(encodeURIComponent).join("="))}var r=[];for(var n in e)a.call(e,n)&&t(n,e[n]);return r.length?r.join("&"):""}function o(e){if(e===!1||0===e)return!1;if(e.connect||e.socket)return e;var t=Number(e);return isNaN(t)?o(c.timeout):{connect:t,socket:t}}function s(e){var t={};for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}var i=e("object-assign"),u=e("url-parse"),a=Object.prototype.hasOwnProperty,c={timeout:12e4};t.exports=function(e){var t="string"==typeof e?i({url:e},c):i({},c,e),r=u(t.url,{},!0);return t.timeout=o(t.timeout),t.query&&(r.query=i({},r.query,s(t.query))),t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t.url=r.toString(n),t}},{"object-assign":34,"url-parse":42}],9:[function(e,t,r){"use strict";var n=e("object-assign");t.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{processOptions:function(r){var o=r.headers||{};return r.headers=t.override?n({},o,e):n({},e,o),r}}}},{"object-assign":34}],10:[function(e,t,r){"use strict";var n=e("create-error-class"),o=n("HttpError",function(e){this.message=(e.method+"-request to "+e.url+" resulted in HTTP "+e.statusCode+" "+e.statusMessage).trim(),this.response=e});t.exports=function(){return{onResponse:function(e){var t=e.statusCode>=400;if(!t)return e;throw new o(e)}}}},{"create-error-class":25}],11:[function(e,t,r){"use strict";r.base=e("./base"),r.debug=e("./debug"),r.jsonRequest=e("./jsonRequest"),r.jsonResponse=e("./jsonResponse"),r.httpErrors=e("./httpErrors"),r.retry=e("./retry"),r.promise=e("./promise"),r.observable=e("./observable"),r.progress=e("./progress"),r.headers=e("./headers")},{"./base":3,"./debug":7,"./headers":9,"./httpErrors":10,"./jsonRequest":12,"./jsonResponse":13,"./observable":14,"./progress":16,"./promise":17,"./retry":18}],12:[function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=e("object-assign"),s=e("is-plain-object"),i=["boolean","string","number"],u=function(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)};t.exports=function(){return{processOptions:function(e){var t=e.body,r=t&&!u(t)&&(i.indexOf("undefined"==typeof t?"undefined":n(t))!==-1||Array.isArray(t)||s(t)||t&&"function"==typeof t.toJSON);return r?o({},e,{body:JSON.stringify(e.body),headers:o({},e.headers,{"Content-Type":"application/json"})}):e}}}},{"is-plain-object":30,"object-assign":34}],13:[function(e,t,r){"use strict";function n(e){try{return JSON.parse(e)}catch(e){throw e.message="Failed to parsed response body as JSON: "+e.message,e}}var o=e("object-assign");t.exports=function(){return{onResponse:function(e){var t=e.headers["content-type"];return e.body&&t&&t.indexOf("application/json")!==-1?o({},e,{body:n(e.body)}):e},processOptions:function(e){return o({},e,{headers:o({Accept:"application/json"},e.headers)})}}}},{"object-assign":34}],14:[function(e,t,r){"use strict";var n=e("../util/global"),o=e("object-assign");t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.implementation||n.Observable;if(!t)throw new Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:function(e,r){return new t(function(t){return e.error.subscribe(function(e){return t.error(e)}),e.progress.subscribe(function(e){return t.next(o({type:"progress"},e))}),e.response.subscribe(function(e){t.next(o({type:"response"},e)),t.complete()}),e.request.publish(r),function(){return e.abort.publish()}})}}}},{"../util/global":22,"object-assign":34}],15:[function(e,t,r){"use strict";t.exports=function(){return{onRequest:function(e){function t(e){return function(t){var r=t.lengthComputable?t.loaded/t.total*100:-1;n.channels.progress.publish({stage:e,percent:r,total:t.total,loaded:t.loaded,lengthComputable:t.lengthComputable})}}if("xhr"===e.adapter){var r=e.request,n=e.context;"upload"in r&&"onprogress"in r.upload&&(r.upload.onprogress=t("upload")),"onprogress"in r&&(r.onprogress=t("download"))}}}}},{}],16:[function(e,t,r){"use strict";t.exports=e("./node-progress")},{"./node-progress":15}],17:[function(e,t,r){"use strict";var n=e("../util/global"),o=e("./cancel/Cancel"),s=e("./cancel/CancelToken"),i=e("./cancel/isCancel"),u=function(){var e=n.Promise;if(!e)throw new Error("`Promise` is not available in global scope, and no implementation was passed");return{onReturn:function(t,r){return new e(function(e,n){var o=r.options.cancelToken;o&&o.promise.then(function(e){t.abort.publish(e),n(e)}),t.error.subscribe(n),t.response.subscribe(e),setTimeout(function(){return t.request.publish(r)},0)})}}};u.Cancel=o,u.CancelToken=s,u.isCancel=i,t.exports=u},{"../util/global":22,"./cancel/Cancel":4,"./cancel/CancelToken":5,"./cancel/isCancel":6}],18:[function(e,t,r){"use strict";function n(e){return 100*Math.pow(2,e)+100*Math.random()}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=e("object-assign"),i=e("../util/node-shouldRetry"),u=function(e){return null!==e&&"object"===("undefined"==typeof e?"undefined":o(e))&&"function"==typeof e.pipe},a=t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maxRetries||5,r=e.retryDelay||n,o=e.shouldRetry||i;return{onError:function(e,n){var i=n.options,a=i.maxRetries||t,c=i.shouldRetry||o,f=i.attemptNumber||0;if(u(i.body))return e;if(!c(e,f,i)||f>=a)return e;var l=s({},n,{options:s({},i,{attemptNumber:f+1})});return setTimeout(function(){return n.channels.request.publish(l)},r(f)),null}}};a.shouldRetry=i},{"../util/node-shouldRetry":21,"object-assign":34}],19:[function(e,t,r){"use strict";var n=e("same-origin"),o=e("parse-headers"),s=function(){},i=window,u=i.XMLHttpRequest||s,a="withCredentials"in new u,c=a?u:i.XDomainRequest,f="xhr";t.exports=function(e,t){function r(){x=!0,g&&g.abort()}function s(t){O=!0,g.abort();var r=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+y.url:"Connection timed out on request to "+y.url);r.code=t,e.channels.error.publish(r)}function a(){C&&(l(),m.socket=setTimeout(function(){return s("ESOCKETTIMEDOUT")},C.socket))}function l(){(x||g.readyState>=2&&m.connect)&&clearTimeout(m.connect),m.socket&&clearTimeout(m.socket)}function p(){if(!j){l(),j=!0,g=null;var e=new Error("Network error while attempting to reach "+y.url);e.isNetworkError=!0,e.request=y,t(e)}}function d(){var e=g.status,t=g.statusText;if(v&&void 0===e)e=200;else{if(e>12e3&&e<12156)return p();e=1223===g.status?204:g.status,t=1223===g.status?"No Content":t}return{body:g.response||g.responseText,url:y.url,method:y.method,headers:v?{}:o(g.getAllResponseHeaders()),statusCode:e,statusMessage:t}}function h(){if(!(x||j||O)){if(0===g.status)return void p(new Error("Unknown XHR error"));l(),j=!0,t(null,d())}}var y=e.options,b=!n(i.location.href,y.url),m={},g=b?new c:new u,v=i.XDomainRequest&&g instanceof i.XDomainRequest,w=y.headers,x=!1,j=!1,O=!1;g.onerror=p,g.ontimeout=p,g.onabort=function(){x=!0},g.onprogress=function(){};var q=v?"onload":"onreadystatechange";if(g[q]=function(){a(),x||4!==g.readyState&&!v||0!==g.status&&h()},g.open(y.method,y.url,!0),g.withCredentials=!!y.withCredentials,w&&g.setRequestHeader)for(var E in w)w.hasOwnProperty(E)&&g.setRequestHeader(E,w[E]);else if(w&&v)throw new Error("Headers cannot be set on an XDomainRequest object");y.rawBody&&(g.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:y,adapter:f,request:g,context:e}),g.send(y.body||null);var C=y.timeout;return C&&(m.connect=setTimeout(function(){return s("ETIMEDOUT")},C.connect)),{abort:r}}},{"parse-headers":35,"same-origin":39}],20:[function(e,t,r){"use strict";t.exports=e("./node-request")},{"./node-request":19}],21:[function(e,t,r){"use strict";t.exports=function(e){return e.isNetworkError||!1}},{}],22:[function(e,t,r){(function(e){"use strict";"undefined"!=typeof window?t.exports=window:"undefined"!=typeof e?t.exports=e:"undefined"!=typeof self?t.exports=self:t.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],23:[function(e,t,r){"use strict";t.exports=function(e){var t=function(t,r){for(var n=arguments.length,o=Array(n>2?n-2:0),s=2;s<n;s++)o[s-2]=arguments[s];return e[t].reduce(function(e,t){return t.apply(void 0,[e].concat(o))},r)};return t}},{}],24:[function(e,t,r){"use strict";t.exports=Error.captureStackTrace||function(e){var t=new Error;Object.defineProperty(e,"stack",{configurable:!0,get:function(){var e=t.stack;return Object.defineProperty(this,"stack",{value:e}),e}})}},{}],25:[function(e,t,r){"use strict";function n(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}var o=e("capture-stack-trace");t.exports=function(e,t){if("string"!=typeof e)throw new TypeError("Expected className to be a string");if(/[^0-9a-zA-Z_$]/.test(e))throw new Error("className contains invalid characters");t=t||function(e){this.message=e};var r=function(){Object.defineProperty(this,"name",{configurable:!0,value:e,writable:!0}),o(this,this.constructor),t.apply(this,arguments)};return n(r,Error),r}},{"capture-stack-trace":24}],26:[function(e,t,r){(function(n){function o(){return!("undefined"==typeof window||!window||"undefined"==typeof window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document&&"WebkitAppearance"in document.documentElement.style||"undefined"!=typeof window&&window&&window.console&&(console.firebug||console.exception&&console.table)||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function s(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),t){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,s=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(s=o))}),e.splice(s,0,n)}}function i(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function u(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(e){}}function a(){try{return r.storage.debug}catch(e){}if("undefined"!=typeof n&&"env"in n)return n.env.DEBUG}function c(){try{return window.localStorage}catch(e){}}r=t.exports=e("./debug"),r.log=i,r.formatArgs=s,r.save=u,r.load=a,r.useColors=o,r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:c(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(a())}).call(this,e("_process"))},{"./debug":27,_process:36}],27:[function(e,t,r){function n(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return r.colors[Math.abs(n)%r.colors.length]}function o(e){function t(){if(t.enabled){var e=t,n=+new Date,o=n-(c||n);e.diff=o,e.prev=c,e.curr=n,c=n;for(var s=new Array(arguments.length),i=0;i<s.length;i++)s[i]=arguments[i];s[0]=r.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var u=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(t,n){if("%%"===t)return t;u++;var o=r.formatters[n];if("function"==typeof o){var i=s[u];t=o.call(e,i),s.splice(u,1),u--}return t}),r.formatArgs.call(e,s);var a=t.log||r.log||console.log.bind(console);a.apply(e,s)}}return t.namespace=e,t.enabled=r.enabled(e),t.useColors=r.useColors(),t.color=n(e),"function"==typeof r.init&&r.init(t),t}function s(e){r.save(e),r.names=[],r.skips=[];for(var t=(e||"").split(/[\s,]+/),n=t.length,o=0;o<n;o++)t[o]&&(e=t[o].replace(/\*/g,".*?"),"-"===e[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")))}function i(){r.enable("")}function u(e){var t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1}function a(e){return e instanceof Error?e.stack||e.message:e}r=t.exports=o.debug=o.default=o,r.coerce=a,r.disable=i,r.enable=s,r.enabled=u,r.humanize=e("ms"),r.names=[],r.skips=[],r.formatters={};var c},{ms:32}],28:[function(e,t,r){function n(e,t,r){if(!u(t))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this),"[object Array]"===a.call(e)?o(e,t,r):"string"==typeof e?s(e,t,r):i(e,t,r)}function o(e,t,r){for(var n=0,o=e.length;n<o;n++)c.call(e,n)&&t.call(r,e[n],n,e)}function s(e,t,r){for(var n=0,o=e.length;n<o;n++)t.call(r,e.charAt(n),n,e)}function i(e,t,r){for(var n in e)c.call(e,n)&&t.call(r,e[n],n,e)}var u=e("is-function");t.exports=n;var a=Object.prototype.toString,c=Object.prototype.hasOwnProperty},{"is-function":29}],29:[function(e,t,r){function n(e){var t=o.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}t.exports=n;var o=Object.prototype.toString},{}],30:[function(e,t,r){"use strict";function n(e){return o(e)===!0&&"[object Object]"===Object.prototype.toString.call(e)}var o=e("isobject");t.exports=function(e){var t,r;return n(e)!==!1&&(t=e.constructor,"function"==typeof t&&(r=t.prototype,n(r)!==!1&&r.hasOwnProperty("isPrototypeOf")!==!1))}},{isobject:31}],31:[function(e,t,r){"use strict";t.exports=function(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}},{}],32:[function(e,t,r){function n(e){if(e=String(e),!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*l;case"days":case"day":case"d":return r*f;case"hours":case"hour":case"hrs":case"hr":case"h":return r*c;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function o(e){return e>=f?Math.round(e/f)+"d":e>=c?Math.round(e/c)+"h":e>=a?Math.round(e/a)+"m":e>=u?Math.round(e/u)+"s":e+"ms"}function s(e){return i(e,f,"day")||i(e,c,"hour")||i(e,a,"minute")||i(e,u,"second")||e+" ms"}function i(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var u=1e3,a=60*u,c=60*a,f=24*c,l=365.25*f;t.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return n(e);if("number"===r&&isNaN(e)===!1)return t.long?s(e):o(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],33:[function(e,t,r){t.exports=function(){function e(e){return r.push(e),function(){var t=r.indexOf(e);t>-1&&r.splice(t,1)}}function t(){for(var e=0;e<r.length;e++)r[e].apply(null,arguments)}var r=[];return{subscribe:e,publish:t}}},{}],34:[function(e,t,r){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}var s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;t.exports=o()?Object.assign:function(e,t){for(var r,o,a=n(e),c=1;c<arguments.length;c++){r=Object(arguments[c]);for(var f in r)i.call(r,f)&&(a[f]=r[f]);if(s){o=s(r);for(var l=0;l<o.length;l++)u.call(r,o[l])&&(a[o[l]]=r[o[l]])}}return a}},{}],35:[function(e,t,r){var n=e("trim"),o=e("for-each"),s=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return o(n(e).split("\n"),function(e){var r=e.indexOf(":"),o=n(e.slice(0,r)).toLowerCase(),i=n(e.slice(r+1));"undefined"==typeof t[o]?t[o]=i:s(t[o])?t[o].push(i):t[o]=[t[o],i]}),t}},{"for-each":28,trim:41}],36:[function(e,t,r){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function u(){b&&h&&(b=!1,h.length?y=h.concat(y):m=-1,y.length&&a())}function a(){if(!b){var e=s(u);b=!0;for(var t=y.length;t;){for(h=y,y=[];++m<t;)h&&h[m].run();m=-1,t=y.length}h=null,b=!1,i(e)}}function c(e,t){this.fun=e,this.array=t}function f(){}var l,p,d=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var h,y=[],b=!1,m=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];y.push(new c(e,t)),1!==y.length||b||s(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=f,d.addListener=f,d.once=f,d.off=f,d.removeListener=f,d.removeAllListeners=f,d.emit=f,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],37:[function(e,t,r){"use strict";function n(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,n={};t=r.exec(e);n[decodeURIComponent(t[1])]=decodeURIComponent(t[2]));return n}function o(e,t){t=t||"";var r=[];"string"!=typeof t&&(t="?");for(var n in e)s.call(e,n)&&r.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return r.length?t+r.join("&"):""}var s=Object.prototype.hasOwnProperty;r.stringify=o,r.parse=n},{}],38:[function(e,t,r){"use strict";t.exports=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},{}],39:[function(e,t,r){"use strict";var n=e("url");t.exports=function(e,t,r){if(e===t)return!0;var o=n.parse(e,!1,!0),s=n.parse(t,!1,!0),i=0|o.port||("https"===o.protocol?443:80),u=0|s.port||("https"===s.protocol?443:80),a={proto:o.protocol===s.protocol,hostname:o.hostname===s.hostname,port:i===u};return a.proto&&a.hostname&&(a.port||r)}},{url:40}],40:[function(e,t,r){"use strict";var n=/^(?:(?:(?:([^:\/#\?]+:)?(?:(?:\/\/)((?:((?:[^:@\/#\?]+)(?:\:(?:[^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/;t.exports={regex:n,parse:function(e){var t=n.exec(e);return t?{protocol:(t[1]||"").toLowerCase()||void 0,hostname:(t[5]||"").toLowerCase()||void 0,port:t[6]||void 0}:{}}}},{}],41:[function(e,t,r){function n(e){return e.replace(/^\s*|\s*$/g,"")}r=t.exports=n,r.left=function(e){return e.replace(/^\s*/,"")},r.right=function(e){return e.replace(/\s*$/,"")}},{}],42:[function(e,t,r){"use strict";function n(e){var t=l.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function o(e,t){for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],s=!1,i=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),i++):i&&(0===n&&(s=!0),r.splice(n,1),i--);return s&&r.unshift(""),"."!==o&&".."!==o||r.push(""),r.join("/")}function s(e,t,r){if(!(this instanceof s))return new s(e,t,r);var i,u,l,d,h,y,b=p.slice(),m=typeof t,g=this,v=0;for("object"!==m&&"string"!==m&&(r=t,t=null),r&&"function"!=typeof r&&(r=f.parse),t=c(t),u=n(e||""),i=!u.protocol&&!u.slashes,g.slashes=u.slashes||i&&t.slashes,g.protocol=u.protocol||t.protocol||"",e=u.rest,u.slashes||(b[2]=[/(.*)/,"pathname"]);v<b.length;v++)d=b[v],l=d[0],y=d[1],l!==l?g[y]=e:"string"==typeof l?~(h=e.indexOf(l))&&("number"==typeof d[2]?(g[y]=e.slice(0,h),e=e.slice(h+d[2])):(g[y]=e.slice(h),e=e.slice(0,h))):(h=l.exec(e))&&(g[y]=h[1],e=e.slice(0,h.index)),g[y]=g[y]||(i&&d[3]?t[y]||"":""),d[4]&&(g[y]=g[y].toLowerCase());r&&(g.query=r(g.query)),i&&t.slashes&&"/"!==g.pathname.charAt(0)&&(""!==g.pathname||""!==t.pathname)&&(g.pathname=o(g.pathname,t.pathname)),a(g.port,g.protocol)||(g.host=g.hostname,g.port=""),g.username=g.password="",g.auth&&(d=g.auth.split(":"),g.username=d[0]||"",g.password=d[1]||""),g.origin=g.protocol&&g.host&&"file:"!==g.protocol?g.protocol+"//"+g.host:"null",g.href=g.toString()}function i(e,t,r){var n=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||f.parse)(t)),n[e]=t;break;case"port":n[e]=t,a(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,/:\d+$/.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case"pathname":n.pathname=t.length&&"/"!==t.charAt(0)?"/"+t:t;break;default:n[e]=t}for(var o=0;o<p.length;o++){var s=p[o];s[4]&&(n[s[1]]=n[s[1]].toLowerCase())}return n.origin=n.protocol&&n.host&&"file:"!==n.protocol?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function u(e){e&&"function"==typeof e||(e=f.stringify);var t,r=this,n=r.protocol;n&&":"!==n.charAt(n.length-1)&&(n+=":");var o=n+(r.slashes?"//":"");return r.username&&(o+=r.username,r.password&&(o+=":"+r.password),o+="@"),o+=r.host+r.pathname,t="object"==typeof r.query?e(r.query):r.query,t&&(o+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(o+=r.hash),o}var a=e("requires-port"),c=e("./lolcation"),f=e("querystringify"),l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,p=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]];s.prototype={set:i,toString:u},s.extractProtocol=n,s.location=c,s.qs=f,t.exports=s},{"./lolcation":43,querystringify:37,"requires-port":38}],43:[function(e,t,r){(function(r){"use strict";var n,o=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,s={hash:1,query:1};t.exports=function(t){t=t||r.location||{},n=n||e("./");var i,u={},a=typeof t;if("blob:"===t.protocol)u=new n(unescape(t.pathname),{});else if("string"===a){u=new n(t,{});for(i in s)delete u[i]}else if("object"===a){for(i in t)i in s||(u[i]=t[i]);void 0===u.slashes&&(u.slashes=o.test(t.href))}return u}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./":42}]},{},[1])(1)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).getIt=e()}}(function(){return function e(t,r,n){function o(i,u){if(!r[i]){if(!t[i]){var a="function"==typeof require&&require;if(!u&&a)return a(i,!0);if(s)return s(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[i]={exports:{}};t[i][0].call(l.exports,function(e){var r=t[i][1][e];return o(r||e)},l,l.exports,e,t,r,n)}return r[i].exports}for(var s="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}({1:[function(e,t,r){"use strict";var n=e("./index");n.middleware=e("./middleware"),t.exports=n},{"./index":2,"./middleware":11}],2:[function(e,t,r){"use strict";var n=e("nano-pubsub"),o=e("./util/middlewareReducer"),s=e("./middleware/defaultOptionsProcessor"),i=e("./request"),u=["request","response","progress","error","abort"],a=["processOptions","onRequest","onResponse","onError","onReturn","onHeaders"];t.exports=function e(){function t(e){function t(e,t,n){var o=e,i=t;if(!o)try{i=s("onResponse",t,n)}catch(e){i=null,o=e}(o=o&&s("onError",o,n))?r.error.publish(o):i&&r.response.publish(i)}var r=u.reduce(function(e,t){return e[t]=n(),e},{}),s=o(l),a={options:s("processOptions",e),channels:r,applyMiddleware:s},c=null,f=r.request.subscribe(function(e){c=i(e,function(r,n){return t(r,n,e)})});r.abort.subscribe(function(){f(),c&&c.abort()});var p=s("onReturn",r,a);return p===r&&r.request.publish(a),p}var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],c=[],l=a.reduce(function(e,t){return e[t]=e[t]||[],e},{processOptions:[s]});return t.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&l.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");a.forEach(function(t){e[t]&&l[t].push(e[t])}),c.push(e)},t.clone=function(){return e(c)},r.forEach(t.use),t}},{"./middleware/defaultOptionsProcessor":8,"./request":20,"./util/middlewareReducer":23,"nano-pubsub":33}],3:[function(e,t,r){"use strict";var n=e("object-assign"),o=/^\//,s=/\/$/;t.exports=function(e){var t=e.replace(s,"");return{processOptions:function(e){if(/^https?:\/\//i.test(e.url))return e;var r=[t,e.url.replace(o,"")].join("/");return n({},e,{url:r})}}}},{"object-assign":34}],4:[function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,t.exports=n},{}],5:[function(e,t,r){"use strict";function n(e){var t=this;if("function"!=typeof e)throw new TypeError("executor must be a function.");var r=null;this.promise=new Promise(function(e){r=e}),e(function(e){t.reason||(t.reason=new o(e),r(t.reason))})}var o=e("./Cancel");n.source=function(){var e=void 0;return{token:new n(function(t){e=t}),cancel:e}},t.exports=n},{"./Cancel":4}],6:[function(e,t,r){"use strict";t.exports=function(e){return!(!e||!e.__CANCEL__)}},{}],7:[function(e,t,r){"use strict";function n(e){return-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?o(e.body):e.body}function o(e){try{var t="string"==typeof e?JSON.parse(e):e;return JSON.stringify(t,null,2)}catch(t){return e}}var s=e("debug");t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.verbose,r=e.namespace||"get-it",o=s(r),i=e.log||o,u=i===o&&!s.enabled(r),a=0;return{processOptions:function(e){return e.requestId=e.requestId||++a,e},onRequest:function(e){if(u||!e)return e;var r=e.options;return i("[%s] HTTP %s %s",r.requestId,r.method,r.url),t&&r.body&&"string"==typeof r.body&&i("[%s] Request body: %s",r.requestId,r.body),t&&r.headers&&i("[%s] Request headers: %s",r.requestId,JSON.stringify(r.headers,null,2)),e},onResponse:function(e,r){if(u||!e)return e;var o=r.options.requestId;return i("[%s] Response code: %s %s",o,e.statusCode,e.statusMessage),t&&e.body&&i("[%s] Response body: %s",o,n(e)),e},onError:function(e,t){return i("[%s] ERROR: %s",t.options.requestId,e.message),e}}}},{debug:27}],8:[function(e,t,r){"use strict";function n(e){function t(e,n){Array.isArray(n)?n.forEach(function(r){return t(e,r)}):r.push([e,n].map(encodeURIComponent).join("="))}var r=[];for(var n in e)a.call(e,n)&&t(n,e[n]);return r.length?r.join("&"):""}function o(e){if(!1===e||0===e)return!1;if(e.connect||e.socket)return e;var t=Number(e);return isNaN(t)?o(c.timeout):{connect:t,socket:t}}function s(e){var t={};for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}var i=e("object-assign"),u=e("url-parse"),a=Object.prototype.hasOwnProperty,c={timeout:12e4};t.exports=function(e){var t="string"==typeof e?i({url:e},c):i({},c,e),r=u(t.url,{},!0);return t.timeout=o(t.timeout),t.query&&(r.query=i({},r.query,s(t.query))),t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t.url=r.toString(n),t}},{"object-assign":34,"url-parse":42}],9:[function(e,t,r){"use strict";var n=e("object-assign");t.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{processOptions:function(r){var o=r.headers||{};return r.headers=t.override?n({},o,e):n({},e,o),r}}}},{"object-assign":34}],10:[function(e,t,r){"use strict";var n=e("create-error-class")("HttpError",function(e){this.message=(e.method+"-request to "+e.url+" resulted in HTTP "+e.statusCode+" "+e.statusMessage).trim(),this.response=e});t.exports=function(){return{onResponse:function(e){if(!(e.statusCode>=400))return e;throw new n(e)}}}},{"create-error-class":25}],11:[function(e,t,r){"use strict";r.base=e("./base"),r.debug=e("./debug"),r.jsonRequest=e("./jsonRequest"),r.jsonResponse=e("./jsonResponse"),r.httpErrors=e("./httpErrors"),r.retry=e("./retry"),r.promise=e("./promise"),r.observable=e("./observable"),r.progress=e("./progress"),r.headers=e("./headers")},{"./base":3,"./debug":7,"./headers":9,"./httpErrors":10,"./jsonRequest":12,"./jsonResponse":13,"./observable":14,"./progress":16,"./promise":17,"./retry":18}],12:[function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=e("object-assign"),s=e("is-plain-object"),i=["boolean","string","number"],u=function(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)};t.exports=function(){return{processOptions:function(e){var t=e.body;return t&&!u(t)&&(-1!==i.indexOf(void 0===t?"undefined":n(t))||Array.isArray(t)||s(t)||t&&"function"==typeof t.toJSON)?o({},e,{body:JSON.stringify(e.body),headers:o({},e.headers,{"Content-Type":"application/json"})}):e}}}},{"is-plain-object":31,"object-assign":34}],13:[function(e,t,r){"use strict";function n(e){try{return JSON.parse(e)}catch(e){throw e.message="Failed to parsed response body as JSON: "+e.message,e}}var o=e("object-assign");t.exports=function(){return{onResponse:function(e){var t=e.headers["content-type"];return e.body&&t&&-1!==t.indexOf("application/json")?o({},e,{body:n(e.body)}):e},processOptions:function(e){return o({},e,{headers:o({Accept:"application/json"},e.headers)})}}}},{"object-assign":34}],14:[function(e,t,r){"use strict";var n=e("../util/global"),o=e("object-assign");t.exports=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).implementation||n.Observable;if(!e)throw new Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:function(t,r){return new e(function(e){return t.error.subscribe(function(t){return e.error(t)}),t.progress.subscribe(function(t){return e.next(o({type:"progress"},t))}),t.response.subscribe(function(t){e.next(o({type:"response"},t)),e.complete()}),t.request.publish(r),function(){return t.abort.publish()}})}}}},{"../util/global":22,"object-assign":34}],15:[function(e,t,r){"use strict";t.exports=function(){return{onRequest:function(e){function t(e){return function(t){var r=t.lengthComputable?t.loaded/t.total*100:-1;n.channels.progress.publish({stage:e,percent:r,total:t.total,loaded:t.loaded,lengthComputable:t.lengthComputable})}}if("xhr"===e.adapter){var r=e.request,n=e.context;"upload"in r&&"onprogress"in r.upload&&(r.upload.onprogress=t("upload")),"onprogress"in r&&(r.onprogress=t("download"))}}}}},{}],16:[function(e,t,r){"use strict";t.exports=e("./node-progress")},{"./node-progress":15}],17:[function(e,t,r){"use strict";var n=e("../util/global"),o=e("./cancel/Cancel"),s=e("./cancel/CancelToken"),i=e("./cancel/isCancel"),u=function(){var e=n.Promise;if(!e)throw new Error("`Promise` is not available in global scope, and no implementation was passed");return{onReturn:function(t,r){return new e(function(e,n){var o=r.options.cancelToken;o&&o.promise.then(function(e){t.abort.publish(e),n(e)}),t.error.subscribe(n),t.response.subscribe(e),setTimeout(function(){return t.request.publish(r)},0)})}}};u.Cancel=o,u.CancelToken=s,u.isCancel=i,t.exports=u},{"../util/global":22,"./cancel/Cancel":4,"./cancel/CancelToken":5,"./cancel/isCancel":6}],18:[function(e,t,r){"use strict";function n(e){return 100*Math.pow(2,e)+100*Math.random()}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=e("object-assign"),i=e("../util/node-shouldRetry"),u=function(e){return null!==e&&"object"===(void 0===e?"undefined":o(e))&&"function"==typeof e.pipe},a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maxRetries||5,r=e.retryDelay||n,o=e.shouldRetry||i;return{onError:function(e,n){var i=n.options,a=i.maxRetries||t,c=i.shouldRetry||o,l=i.attemptNumber||0;if(u(i.body))return e;if(!c(e,l,i)||l>=a)return e;var f=s({},n,{options:s({},i,{attemptNumber:l+1})});return setTimeout(function(){return n.channels.request.publish(f)},r(l)),null}}};a.shouldRetry=i,t.exports=a},{"../util/node-shouldRetry":21,"object-assign":34}],19:[function(e,t,r){"use strict";var n=e("same-origin"),o=e("parse-headers"),s=window,i=s.XMLHttpRequest||function(){},u="withCredentials"in new i?i:s.XDomainRequest;t.exports=function(e,t){function r(t){w=!0,y.abort();var r=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+d.url:"Connection timed out on request to "+d.url);r.code=t,e.channels.error.publish(r)}function a(){j&&(c(),h.socket=setTimeout(function(){return r("ESOCKETTIMEDOUT")},j.socket))}function c(){(g||y.readyState>=2&&h.connect)&&clearTimeout(h.connect),h.socket&&clearTimeout(h.socket)}function l(){if(!v){c(),v=!0,y=null;var e=new Error("Network error while attempting to reach "+d.url);e.isNetworkError=!0,e.request=d,t(e)}}function f(){var e=y.status,t=y.statusText;if(b&&void 0===e)e=200;else{if(e>12e3&&e<12156)return l();e=1223===y.status?204:y.status,t=1223===y.status?"No Content":t}return{body:y.response||y.responseText,url:d.url,method:d.method,headers:b?{}:o(y.getAllResponseHeaders()),statusCode:e,statusMessage:t}}function p(){g||v||w||(0!==y.status?(c(),v=!0,t(null,f())):l(new Error("Unknown XHR error")))}var d=e.options,h={},y=n(s.location.href,d.url)?new i:new u,b=s.XDomainRequest&&y instanceof s.XDomainRequest,m=d.headers,g=!1,v=!1,w=!1;if(y.onerror=l,y.ontimeout=l,y.onabort=function(){g=!0},y.onprogress=function(){},y[b?"onload":"onreadystatechange"]=function(){a(),g||4!==y.readyState&&!b||0!==y.status&&p()},y.open(d.method,d.url,!0),y.withCredentials=!!d.withCredentials,m&&y.setRequestHeader)for(var x in m)m.hasOwnProperty(x)&&y.setRequestHeader(x,m[x]);else if(m&&b)throw new Error("Headers cannot be set on an XDomainRequest object");d.rawBody&&(y.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:d,adapter:"xhr",request:y,context:e}),y.send(d.body||null);var j=d.timeout;return j&&(h.connect=setTimeout(function(){return r("ETIMEDOUT")},j.connect)),{abort:function(){g=!0,y&&y.abort()}}}},{"parse-headers":35,"same-origin":39}],20:[function(e,t,r){"use strict";t.exports=e("./node-request")},{"./node-request":19}],21:[function(e,t,r){"use strict";t.exports=function(e){return e.isNetworkError||!1}},{}],22:[function(e,t,r){(function(e){"use strict";"undefined"!=typeof window?t.exports=window:void 0!==e?t.exports=e:"undefined"!=typeof self?t.exports=self:t.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],23:[function(e,t,r){"use strict";t.exports=function(e){return function(t,r){for(var n=arguments.length,o=Array(n>2?n-2:0),s=2;s<n;s++)o[s-2]=arguments[s];return e[t].reduce(function(e,t){return t.apply(void 0,[e].concat(o))},r)}}},{}],24:[function(e,t,r){"use strict";t.exports=Error.captureStackTrace||function(e){var t=new Error;Object.defineProperty(e,"stack",{configurable:!0,get:function(){var e=t.stack;return Object.defineProperty(this,"stack",{value:e}),e}})}},{}],25:[function(e,t,r){"use strict";function n(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}var o=e("capture-stack-trace");t.exports=function(e,t){if("string"!=typeof e)throw new TypeError("Expected className to be a string");if(/[^0-9a-zA-Z_$]/.test(e))throw new Error("className contains invalid characters");t=t||function(e){this.message=e};var r=function(){Object.defineProperty(this,"name",{configurable:!0,value:e,writable:!0}),o(this,this.constructor),t.apply(this,arguments)};return n(r,Error),r}},{"capture-stack-trace":24}],26:[function(e,t,r){function n(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*f;case"days":case"day":case"d":return r*l;case"hours":case"hour":case"hrs":case"hr":case"h":return r*c;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function o(e){return e>=l?Math.round(e/l)+"d":e>=c?Math.round(e/c)+"h":e>=a?Math.round(e/a)+"m":e>=u?Math.round(e/u)+"s":e+"ms"}function s(e){return i(e,l,"day")||i(e,c,"hour")||i(e,a,"minute")||i(e,u,"second")||e+" ms"}function i(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var u=1e3,a=60*u,c=60*a,l=24*c,f=365.25*l;t.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return n(e);if("number"===r&&!1===isNaN(e))return t.long?s(e):o(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],27:[function(e,t,r){(function(n){function o(){var e;try{e=r.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}(r=t.exports=e("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),t){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,s=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(s=o))}),e.splice(s,0,n)}},r.save=function(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(e){}},r.load=o,r.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(o())}).call(this,e("_process"))},{"./debug":28,_process:36}],28:[function(e,t,r){function n(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return r.colors[Math.abs(n)%r.colors.length]}function o(e){function t(){if(t.enabled){var e=t,n=+new Date,o=n-(s||n);e.diff=o,e.prev=s,e.curr=n,s=n;for(var i=new Array(arguments.length),u=0;u<i.length;u++)i[u]=arguments[u];i[0]=r.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var a=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(t,n){if("%%"===t)return t;a++;var o=r.formatters[n];if("function"==typeof o){var s=i[a];t=o.call(e,s),i.splice(a,1),a--}return t}),r.formatArgs.call(e,i),(t.log||r.log||console.log.bind(console)).apply(e,i)}}return t.namespace=e,t.enabled=r.enabled(e),t.useColors=r.useColors(),t.color=n(e),"function"==typeof r.init&&r.init(t),t}(r=t.exports=o.debug=o.default=o).coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){r.enable("")},r.enable=function(e){r.save(e),r.names=[],r.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),n=t.length,o=0;o<n;o++)t[o]&&("-"===(e=t[o].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")))},r.enabled=function(e){var t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=e("ms"),r.names=[],r.skips=[],r.formatters={};var s},{ms:26}],29:[function(e,t,r){function n(e,t,r){for(var n=0,o=e.length;n<o;n++)a.call(e,n)&&t.call(r,e[n],n,e)}function o(e,t,r){for(var n=0,o=e.length;n<o;n++)t.call(r,e.charAt(n),n,e)}function s(e,t,r){for(var n in e)a.call(e,n)&&t.call(r,e[n],n,e)}var i=e("is-function");t.exports=function(e,t,r){if(!i(t))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this),"[object Array]"===u.call(e)?n(e,t,r):"string"==typeof e?o(e,t,r):s(e,t,r)};var u=Object.prototype.toString,a=Object.prototype.hasOwnProperty},{"is-function":30}],30:[function(e,t,r){t.exports=function(e){var t=n.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var n=Object.prototype.toString},{}],31:[function(e,t,r){"use strict";function n(e){return!0===o(e)&&"[object Object]"===Object.prototype.toString.call(e)}var o=e("isobject");t.exports=function(e){var t,r;return!1!==n(e)&&"function"==typeof(t=e.constructor)&&(r=t.prototype,!1!==n(r)&&!1!==r.hasOwnProperty("isPrototypeOf"))}},{isobject:32}],32:[function(e,t,r){"use strict";t.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},{}],33:[function(e,t,r){t.exports=function(){var e=[];return{subscribe:function(t){return e.push(t),function(){var r=e.indexOf(t);r>-1&&e.splice(r,1)}},publish:function(){for(var t=0;t<e.length;t++)e[t].apply(null,arguments)}}}},{}],34:[function(e,t,r){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,u,a=n(e),c=1;c<arguments.length;c++){r=Object(arguments[c]);for(var l in r)s.call(r,l)&&(a[l]=r[l]);if(o){u=o(r);for(var f=0;f<u.length;f++)i.call(r,u[f])&&(a[u[f]]=r[u[f]])}}return a}},{}],35:[function(e,t,r){var n=e("trim"),o=e("for-each"),s=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return o(n(e).split("\n"),function(e){var r=e.indexOf(":"),o=n(e.slice(0,r)).toLowerCase(),i=n(e.slice(r+1));void 0===t[o]?t[o]=i:s(t[o])?t[o].push(i):t[o]=[t[o],i]}),t}},{"for-each":29,trim:41}],36:[function(e,t,r){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function u(){b&&h&&(b=!1,h.length?y=h.concat(y):m=-1,y.length&&a())}function a(){if(!b){var e=s(u);b=!0;for(var t=y.length;t;){for(h=y,y=[];++m<t;)h&&h[m].run();m=-1,t=y.length}h=null,b=!1,i(e)}}function c(e,t){this.fun=e,this.array=t}function l(){}var f,p,d=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var h,y=[],b=!1,m=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];y.push(new c(e,t)),1!==y.length||b||s(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=l,d.addListener=l,d.once=l,d.off=l,d.removeListener=l,d.removeAllListeners=l,d.emit=l,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],37:[function(e,t,r){"use strict";function n(e){return decodeURIComponent(e.replace(/\+/g," "))}var o=Object.prototype.hasOwnProperty;r.stringify=function(e,t){var r=[];"string"!=typeof(t=t||"")&&(t="?");for(var n in e)o.call(e,n)&&r.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return r.length?t+r.join("&"):""},r.parse=function(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,o={};t=r.exec(e);o[n(t[1])]=n(t[2]));return o}},{}],38:[function(e,t,r){"use strict";t.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},{}],39:[function(e,t,r){"use strict";var n=e("url");t.exports=function(e,t,r){if(e===t)return!0;var o=n.parse(e,!1,!0),s=n.parse(t,!1,!0),i=0|o.port||("https"===o.protocol?443:80),u=0|s.port||("https"===s.protocol?443:80),a={proto:o.protocol===s.protocol,hostname:o.hostname===s.hostname,port:i===u};return a.proto&&a.hostname&&(a.port||r)}},{url:40}],40:[function(e,t,r){"use strict";var n=/^(?:(?:(?:([^:\/#\?]+:)?(?:(?:\/\/)((?:((?:[^:@\/#\?]+)(?:\:(?:[^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/;t.exports={regex:n,parse:function(e){var t=n.exec(e);return t?{protocol:(t[1]||"").toLowerCase()||void 0,hostname:(t[5]||"").toLowerCase()||void 0,port:t[6]||void 0}:{}}}},{}],41:[function(e,t,r){(r=t.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},r.right=function(e){return e.replace(/\s*$/,"")}},{}],42:[function(e,t,r){(function(r){"use strict";function n(e){var t,n={},o=typeof(e=e||r.location||{});if("blob:"===e.protocol)n=new i(unescape(e.pathname),{});else if("string"===o){n=new i(e,{});for(t in p)delete n[t]}else if("object"===o){for(t in e)t in p||(n[t]=e[t]);void 0===n.slashes&&(n.slashes=l.test(e.href))}return n}function o(e){var t=c.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function s(e,t){for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],s=!1,i=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),i++):i&&(0===n&&(s=!0),r.splice(n,1),i--);return s&&r.unshift(""),"."!==o&&".."!==o||r.push(""),r.join("/")}function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);var c,l,p,d,h,y,b=f.slice(),m=typeof t,g=this,v=0;for("object"!==m&&"string"!==m&&(r=t,t=null),r&&"function"!=typeof r&&(r=a.parse),t=n(t),c=!(l=o(e||"")).protocol&&!l.slashes,g.slashes=l.slashes||c&&t.slashes,g.protocol=l.protocol||t.protocol||"",e=l.rest,l.slashes||(b[2]=[/(.*)/,"pathname"]);v<b.length;v++)p=(d=b[v])[0],y=d[1],p!==p?g[y]=e:"string"==typeof p?~(h=e.indexOf(p))&&("number"==typeof d[2]?(g[y]=e.slice(0,h),e=e.slice(h+d[2])):(g[y]=e.slice(h),e=e.slice(0,h))):(h=p.exec(e))&&(g[y]=h[1],e=e.slice(0,h.index)),g[y]=g[y]||(c&&d[3]?t[y]||"":""),d[4]&&(g[y]=g[y].toLowerCase());r&&(g.query=r(g.query)),c&&t.slashes&&"/"!==g.pathname.charAt(0)&&(""!==g.pathname||""!==t.pathname)&&(g.pathname=s(g.pathname,t.pathname)),u(g.port,g.protocol)||(g.host=g.hostname,g.port=""),g.username=g.password="",g.auth&&(d=g.auth.split(":"),g.username=d[0]||"",g.password=d[1]||""),g.origin=g.protocol&&g.host&&"file:"!==g.protocol?g.protocol+"//"+g.host:"null",g.href=g.toString()}var u=e("requires-port"),a=e("querystringify"),c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,l=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,f=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],p={hash:1,query:1};i.prototype={set:function(e,t,r){var n=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||a.parse)(t)),n[e]=t;break;case"port":n[e]=t,u(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,/:\d+$/.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case"pathname":n.pathname=t.length&&"/"!==t.charAt(0)?"/"+t:t;break;default:n[e]=t}for(var o=0;o<f.length;o++){var s=f[o];s[4]&&(n[s[1]]=n[s[1]].toLowerCase())}return n.origin=n.protocol&&n.host&&"file:"!==n.protocol?n.protocol+"//"+n.host:"null",n.href=n.toString(),n},toString:function(e){e&&"function"==typeof e||(e=a.stringify);var t,r=this,n=r.protocol;n&&":"!==n.charAt(n.length-1)&&(n+=":");var o=n+(r.slashes?"//":"");return r.username&&(o+=r.username,r.password&&(o+=":"+r.password),o+="@"),o+=r.host+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(o+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(o+=r.hash),o}},i.extractProtocol=o,i.location=n,i.qs=a,t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{querystringify:37,"requires-port":38}]},{},[1])(1)});
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.getIt = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";var pubsub=require("nano-pubsub"),middlewareReducer=require("./util/middlewareReducer"),processOptions=require("./middleware/defaultOptionsProcessor"),httpRequest=require("./request"),channelNames=["request","response","progress","error","abort"],middlehooks=["processOptions","onRequest","onResponse","onError","onReturn","onHeaders"];module.exports=function e(){function r(e){function r(e,r,t){var s=e,u=r;if(!s)try{u=n("onResponse",r,t)}catch(e){u=null,s=e}s=s&&n("onError",s,t),s?o.error.publish(s):u&&o.response.publish(u)}var o=channelNames.reduce(function(e,r){return e[r]=pubsub(),e},{}),n=middlewareReducer(t),s=n("processOptions",e),u={options:s,channels:o,applyMiddleware:n},i=null,a=o.request.subscribe(function(e){i=httpRequest(e,function(o,n){return r(o,n,e)})});o.abort.subscribe(function(){a(),i&&i.abort()});var d=n("onReturn",o,u);return d===o&&o.request.publish(u),d}var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],t=middlehooks.reduce(function(e,r){return e[r]=e[r]||[],e},{processOptions:[processOptions]});return r.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&t.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");middlehooks.forEach(function(r){e[r]&&t[r].push(e[r])}),n.push(e)},r.clone=function(){return e(n)},o.forEach(r.use),r};
"use strict";var pubsub=require("nano-pubsub"),middlewareReducer=require("./util/middlewareReducer"),processOptions=require("./middleware/defaultOptionsProcessor"),httpRequest=require("./request"),channelNames=["request","response","progress","error","abort"],middlehooks=["processOptions","onRequest","onResponse","onError","onReturn","onHeaders"];module.exports=function e(){function r(e){function r(e,r,t){var s=e,u=r;if(!s)try{u=n("onResponse",r,t)}catch(e){u=null,s=e}(s=s&&n("onError",s,t))?o.error.publish(s):u&&o.response.publish(u)}var o=channelNames.reduce(function(e,r){return e[r]=pubsub(),e},{}),n=middlewareReducer(t),s={options:n("processOptions",e),channels:o,applyMiddleware:n},u=null,i=o.request.subscribe(function(e){u=httpRequest(e,function(o,n){return r(o,n,e)})});o.abort.subscribe(function(){i(),u&&u.abort()});var a=n("onReturn",o,s);return a===o&&o.request.publish(s),a}var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],t=middlehooks.reduce(function(e,r){return e[r]=e[r]||[],e},{processOptions:[processOptions]});return r.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&t.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");middlehooks.forEach(function(r){e[r]&&t[r].push(e[r])}),n.push(e)},r.clone=function(){return e(n)},o.forEach(r.use),r};
},{"./middleware/defaultOptionsProcessor":2,"./request":4,"./util/middlewareReducer":5,"nano-pubsub":8}],2:[function(require,module,exports){
"use strict";function stringifyQueryString(e){function r(e,n){Array.isArray(n)?n.forEach(function(t){return r(e,t)}):t.push([e,n].map(encodeURIComponent).join("="))}var t=[];for(var n in e)has.call(e,n)&&r(n,e[n]);return t.length?t.join("&"):""}function normalizeTimeout(e){if(e===!1||0===e)return!1;if(e.connect||e.socket)return e;var r=Number(e);return isNaN(r)?normalizeTimeout(defaultOptions.timeout):{connect:r,socket:r}}function removeUndefined(e){var r={};for(var t in e)void 0!==e[t]&&(r[t]=e[t]);return r}var objectAssign=require("object-assign"),urlParse=require("url-parse"),has=Object.prototype.hasOwnProperty,defaultOptions={timeout:12e4};module.exports=function(e){var r="string"==typeof e?objectAssign({url:e},defaultOptions):objectAssign({},defaultOptions,e),t=urlParse(r.url,{},!0);return r.timeout=normalizeTimeout(r.timeout),r.query&&(t.query=objectAssign({},t.query,removeUndefined(r.query))),r.method=r.body&&!r.method?"POST":(r.method||"GET").toUpperCase(),r.url=t.toString(stringifyQueryString),r};
"use strict";function stringifyQueryString(e){function r(e,n){Array.isArray(n)?n.forEach(function(t){return r(e,t)}):t.push([e,n].map(encodeURIComponent).join("="))}var t=[];for(var n in e)has.call(e,n)&&r(n,e[n]);return t.length?t.join("&"):""}function normalizeTimeout(e){if(!1===e||0===e)return!1;if(e.connect||e.socket)return e;var r=Number(e);return isNaN(r)?normalizeTimeout(defaultOptions.timeout):{connect:r,socket:r}}function removeUndefined(e){var r={};for(var t in e)void 0!==e[t]&&(r[t]=e[t]);return r}var objectAssign=require("object-assign"),urlParse=require("url-parse"),has=Object.prototype.hasOwnProperty,defaultOptions={timeout:12e4};module.exports=function(e){var r="string"==typeof e?objectAssign({url:e},defaultOptions):objectAssign({},defaultOptions,e),t=urlParse(r.url,{},!0);return r.timeout=normalizeTimeout(r.timeout),r.query&&(t.query=objectAssign({},t.query,removeUndefined(r.query))),r.method=r.body&&!r.method?"POST":(r.method||"GET").toUpperCase(),r.url=t.toString(stringifyQueryString),r};
},{"object-assign":9,"url-parse":16}],3:[function(require,module,exports){
"use strict";var sameOrigin=require("same-origin"),parseHeaders=require("parse-headers"),noop=function(){},win=window,XmlHttpRequest=win.XMLHttpRequest||noop,hasXhr2="withCredentials"in new XmlHttpRequest,XDomainRequest=hasXhr2?XmlHttpRequest:win.XDomainRequest,adapter="xhr";module.exports=function(e,t){function r(){w=!0,p&&p.abort()}function n(t){q=!0,p.abort();var r=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+c.url:"Connection timed out on request to "+c.url);r.code=t,e.channels.error.publish(r)}function o(){X&&(s(),l.socket=setTimeout(function(){return n("ESOCKETTIMEDOUT")},X.socket))}function s(){(w||p.readyState>=2&&l.connect)&&clearTimeout(l.connect),l.socket&&clearTimeout(l.socket)}function a(){if(!h){s(),h=!0,p=null;var e=new Error("Network error while attempting to reach "+c.url);e.isNetworkError=!0,e.request=c,t(e)}}function i(){var e=p.status,t=p.statusText;if(f&&void 0===e)e=200;else{if(e>12e3&&e<12156)return a();e=1223===p.status?204:p.status,t=1223===p.status?"No Content":t}return{body:p.response||p.responseText,url:c.url,method:c.method,headers:f?{}:parseHeaders(p.getAllResponseHeaders()),statusCode:e,statusMessage:t}}function u(){if(!(w||h||q)){if(0===p.status)return void a(new Error("Unknown XHR error"));s(),h=!0,t(null,i())}}var c=e.options,d=!sameOrigin(win.location.href,c.url),l={},p=d?new XDomainRequest:new XmlHttpRequest,f=win.XDomainRequest&&p instanceof win.XDomainRequest,m=c.headers,w=!1,h=!1,q=!1;p.onerror=a,p.ontimeout=a,p.onabort=function(){w=!0},p.onprogress=function(){};var R=f?"onload":"onreadystatechange";if(p[R]=function(){o(),w||4!==p.readyState&&!f||0!==p.status&&u()},p.open(c.method,c.url,!0),p.withCredentials=!!c.withCredentials,m&&p.setRequestHeader)for(var T in m)m.hasOwnProperty(T)&&p.setRequestHeader(T,m[T]);else if(m&&f)throw new Error("Headers cannot be set on an XDomainRequest object");c.rawBody&&(p.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:c,adapter:adapter,request:p,context:e}),p.send(c.body||null);var X=c.timeout;return X&&(l.connect=setTimeout(function(){return n("ETIMEDOUT")},X.connect)),{abort:r}};
"use strict";var sameOrigin=require("same-origin"),parseHeaders=require("parse-headers"),noop=function(){},win=window,XmlHttpRequest=win.XMLHttpRequest||noop,hasXhr2="withCredentials"in new XmlHttpRequest,XDomainRequest=hasXhr2?XmlHttpRequest:win.XDomainRequest,adapter="xhr";module.exports=function(e,t){function n(t){f=!0,d.abort();var n=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+i.url:"Connection timed out on request to "+i.url);n.code=t,e.channels.error.publish(n)}function r(){q&&(o(),c.socket=setTimeout(function(){return n("ESOCKETTIMEDOUT")},q.socket))}function o(){(m||d.readyState>=2&&c.connect)&&clearTimeout(c.connect),c.socket&&clearTimeout(c.socket)}function s(){if(!w){o(),w=!0,d=null;var e=new Error("Network error while attempting to reach "+i.url);e.isNetworkError=!0,e.request=i,t(e)}}function a(){var e=d.status,t=d.statusText;if(l&&void 0===e)e=200;else{if(e>12e3&&e<12156)return s();e=1223===d.status?204:d.status,t=1223===d.status?"No Content":t}return{body:d.response||d.responseText,url:i.url,method:i.method,headers:l?{}:parseHeaders(d.getAllResponseHeaders()),statusCode:e,statusMessage:t}}function u(){m||w||f||(0!==d.status?(o(),w=!0,t(null,a())):s(new Error("Unknown XHR error")))}var i=e.options,c={},d=!sameOrigin(win.location.href,i.url)?new XDomainRequest:new XmlHttpRequest,l=win.XDomainRequest&&d instanceof win.XDomainRequest,p=i.headers,m=!1,w=!1,f=!1;if(d.onerror=s,d.ontimeout=s,d.onabort=function(){m=!0},d.onprogress=function(){},d[l?"onload":"onreadystatechange"]=function(){r(),m||4!==d.readyState&&!l||0!==d.status&&u()},d.open(i.method,i.url,!0),d.withCredentials=!!i.withCredentials,p&&d.setRequestHeader)for(var h in p)p.hasOwnProperty(h)&&d.setRequestHeader(h,p[h]);else if(p&&l)throw new Error("Headers cannot be set on an XDomainRequest object");i.rawBody&&(d.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:i,adapter:adapter,request:d,context:e}),d.send(i.body||null);var q=i.timeout;return q&&(c.connect=setTimeout(function(){return n("ETIMEDOUT")},q.connect)),{abort:function(){m=!0,d&&d.abort()}}};
},{"parse-headers":10,"same-origin":13}],4:[function(require,module,exports){

@@ -11,3 +14,3 @@ "use strict";module.exports=require("./node-request");

},{"./node-request":3}],5:[function(require,module,exports){
"use strict";module.exports=function(r){var n=function(n,t){for(var e=arguments.length,u=Array(e>2?e-2:0),o=2;o<e;o++)u[o-2]=arguments[o];return r[n].reduce(function(r,n){return n.apply(void 0,[r].concat(u))},t)};return n};
"use strict";module.exports=function(r){return function(n,t){for(var e=arguments.length,u=Array(e>2?e-2:0),o=2;o<e;o++)u[o-2]=arguments[o];return r[n].reduce(function(r,n){return n.apply(void 0,[r].concat(u))},t)}};

@@ -19,28 +22,33 @@ },{}],6:[function(require,module,exports){

function isFunction(o){var t=toString.call(o);return"[object Function]"===t||"function"==typeof o&&"[object RegExp]"!==t||"undefined"!=typeof window&&(o===window.setTimeout||o===window.alert||o===window.confirm||o===window.prompt)}module.exports=isFunction;var toString=Object.prototype.toString;
},{}],8:[function(require,module,exports){
module.exports=function(){function n(n){return r.push(n),function(){var u=r.indexOf(n);u>-1&&r.splice(u,1)}}function u(){for(var n=0;n<r.length;n++)r[n].apply(null,arguments)}var r=[];return{subscribe:n,publish:u}};
module.exports=function(){var n=[];return{subscribe:function(u){return n.push(u),function(){var r=n.indexOf(u);r>-1&&n.splice(r,1)}},publish:function(){for(var u=0;u<n.length;u++)n[u].apply(null,arguments)}}};
},{}],9:[function(require,module,exports){
"use strict";function toObject(r){if(null===r||void 0===r)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function shouldUseNative(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de","5"===Object.getOwnPropertyNames(r)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(r){return e[r]});if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(r){o[r]=r}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(r){return!1}}var getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=shouldUseNative()?Object.assign:function(r,e){for(var t,n,o=toObject(r),a=1;a<arguments.length;a++){t=Object(arguments[a]);for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);if(getOwnPropertySymbols){n=getOwnPropertySymbols(t);for(var c=0;c<n.length;c++)propIsEnumerable.call(t,n[c])&&(o[n[c]]=t[n[c]])}}return o};
"use strict";function toObject(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function shouldUseNative(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(r).map(function(e){return r[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}var getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=shouldUseNative()?Object.assign:function(e,r){for(var t,n,o=toObject(e),a=1;a<arguments.length;a++){t=Object(arguments[a]);for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);if(getOwnPropertySymbols){n=getOwnPropertySymbols(t);for(var c=0;c<n.length;c++)propIsEnumerable.call(t,n[c])&&(o[n[c]]=t[n[c]])}}return o};
},{}],10:[function(require,module,exports){
var trim=require("trim"),forEach=require("for-each"),isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)};module.exports=function(r){if(!r)return{};var e={};return forEach(trim(r).split("\n"),function(r){var t=r.indexOf(":"),i=trim(r.slice(0,t)).toLowerCase(),o=trim(r.slice(t+1));"undefined"==typeof e[i]?e[i]=o:isArray(e[i])?e[i].push(o):e[i]=[e[i],o]}),e};
var trim=require("trim"),forEach=require("for-each"),isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)};module.exports=function(r){if(!r)return{};var t={};return forEach(trim(r).split("\n"),function(r){var i=r.indexOf(":"),e=trim(r.slice(0,i)).toLowerCase(),o=trim(r.slice(i+1));void 0===t[e]?t[e]=o:isArray(t[e])?t[e].push(o):t[e]=[t[e],o]}),t};
},{"for-each":6,"trim":15}],11:[function(require,module,exports){
"use strict";function querystring(e){for(var r,n=/([^=?&]+)=?([^&]*)/g,t={};r=n.exec(e);t[decodeURIComponent(r[1])]=decodeURIComponent(r[2]));return t}function querystringify(e,r){r=r||"";var n=[];"string"!=typeof r&&(r="?");for(var t in e)has.call(e,t)&&n.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return n.length?r+n.join("&"):""}var has=Object.prototype.hasOwnProperty;exports.stringify=querystringify,exports.parse=querystring;
"use strict";function decode(e){return decodeURIComponent(e.replace(/\+/g," "))}function querystring(e){for(var r,n=/([^=?&]+)=?([^&]*)/g,t={};r=n.exec(e);t[decode(r[1])]=decode(r[2]));return t}function querystringify(e,r){var n=[];"string"!=typeof(r=r||"")&&(r="?");for(var t in e)has.call(e,t)&&n.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return n.length?r+n.join("&"):""}var has=Object.prototype.hasOwnProperty;exports.stringify=querystringify,exports.parse=querystring;
},{}],12:[function(require,module,exports){
"use strict";module.exports=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e};
"use strict";module.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e};
},{}],13:[function(require,module,exports){
"use strict";var url=require("url");module.exports=function(o,r,t){if(o===r)return!0;var p=url.parse(o,!1,!0),e=url.parse(r,!1,!0),s=0|p.port||("https"===p.protocol?443:80),u=0|e.port||("https"===e.protocol?443:80),l={proto:p.protocol===e.protocol,hostname:p.hostname===e.hostname,port:s===u};return l.proto&&l.hostname&&(l.port||t)};
},{"url":14}],14:[function(require,module,exports){
"use strict";var regex=/^(?:(?:(?:([^:\/#\?]+:)?(?:(?:\/\/)((?:((?:[^:@\/#\?]+)(?:\:(?:[^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/;module.exports={regex:regex,parse:function(e){var o=regex.exec(e);return o?{protocol:(o[1]||"").toLowerCase()||void 0,hostname:(o[5]||"").toLowerCase()||void 0,port:o[6]||void 0}:{}}};
},{}],15:[function(require,module,exports){
function trim(r){return r.replace(/^\s*|\s*$/g,"")}exports=module.exports=trim,exports.left=function(r){return r.replace(/^\s*/,"")},exports.right=function(r){return r.replace(/\s*$/,"")};
},{}],16:[function(require,module,exports){
"use strict";function extractProtocol(o){var t=protocolre.exec(o);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function resolve(o,t){for(var e=(t||"/").split("/").slice(0,-1).concat(o.split("/")),r=e.length,s=e[r-1],a=!1,n=0;r--;)"."===e[r]?e.splice(r,1):".."===e[r]?(e.splice(r,1),n++):n&&(0===r&&(a=!0),e.splice(r,1),n--);return a&&e.unshift(""),"."!==s&&".."!==s||e.push(""),e.join("/")}function URL(o,t,e){if(!(this instanceof URL))return new URL(o,t,e);var r,s,a,n,l,i,c=rules.slice(),h=typeof t,p=this,u=0;for("object"!==h&&"string"!==h&&(e=t,t=null),e&&"function"!=typeof e&&(e=qs.parse),t=lolcation(t),s=extractProtocol(o||""),r=!s.protocol&&!s.slashes,p.slashes=s.slashes||r&&t.slashes,p.protocol=s.protocol||t.protocol||"",o=s.rest,s.slashes||(c[2]=[/(.*)/,"pathname"]);u<c.length;u++)n=c[u],a=n[0],i=n[1],a!==a?p[i]=o:"string"==typeof a?~(l=o.indexOf(a))&&("number"==typeof n[2]?(p[i]=o.slice(0,l),o=o.slice(l+n[2])):(p[i]=o.slice(l),o=o.slice(0,l))):(l=a.exec(o))&&(p[i]=l[1],o=o.slice(0,l.index)),p[i]=p[i]||(r&&n[3]?t[i]||"":""),n[4]&&(p[i]=p[i].toLowerCase());e&&(p.query=e(p.query)),r&&t.slashes&&"/"!==p.pathname.charAt(0)&&(""!==p.pathname||""!==t.pathname)&&(p.pathname=resolve(p.pathname,t.pathname)),required(p.port,p.protocol)||(p.host=p.hostname,p.port=""),p.username=p.password="",p.auth&&(n=p.auth.split(":"),p.username=n[0]||"",p.password=n[1]||""),p.origin=p.protocol&&p.host&&"file:"!==p.protocol?p.protocol+"//"+p.host:"null",p.href=p.toString()}function set(o,t,e){var r=this;switch(o){case"query":"string"==typeof t&&t.length&&(t=(e||qs.parse)(t)),r[o]=t;break;case"port":r[o]=t,required(t,r.protocol)?t&&(r.host=r.hostname+":"+t):(r.host=r.hostname,r[o]="");break;case"hostname":r[o]=t,r.port&&(t+=":"+r.port),r.host=t;break;case"host":r[o]=t,/:\d+$/.test(t)?(t=t.split(":"),r.port=t.pop(),r.hostname=t.join(":")):(r.hostname=t,r.port="");break;case"protocol":r.protocol=t.toLowerCase(),r.slashes=!e;break;case"pathname":r.pathname=t.length&&"/"!==t.charAt(0)?"/"+t:t;break;default:r[o]=t}for(var s=0;s<rules.length;s++){var a=rules[s];a[4]&&(r[a[1]]=r[a[1]].toLowerCase())}return r.origin=r.protocol&&r.host&&"file:"!==r.protocol?r.protocol+"//"+r.host:"null",r.href=r.toString(),r}function toString(o){o&&"function"==typeof o||(o=qs.stringify);var t,e=this,r=e.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var s=r+(e.slashes?"//":"");return e.username&&(s+=e.username,e.password&&(s+=":"+e.password),s+="@"),s+=e.host+e.pathname,t="object"==typeof e.query?o(e.query):e.query,t&&(s+="?"!==t.charAt(0)?"?"+t:t),e.hash&&(s+=e.hash),s}var required=require("requires-port"),lolcation=require("./lolcation"),qs=require("querystringify"),protocolre=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,rules=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]];URL.prototype={set:set,toString:toString},URL.extractProtocol=extractProtocol,URL.location=lolcation,URL.qs=qs,module.exports=URL;
(function (global){
"use strict";function lolcation(e){var o,t={},r=typeof(e=e||global.location||{});if("blob:"===e.protocol)t=new URL(unescape(e.pathname),{});else if("string"===r){t=new URL(e,{});for(o in ignore)delete t[o]}else if("object"===r){for(o in e)o in ignore||(t[o]=e[o]);void 0===t.slashes&&(t.slashes=slashes.test(e.href))}return t}function extractProtocol(e){var o=protocolre.exec(e);return{protocol:o[1]?o[1].toLowerCase():"",slashes:!!o[2],rest:o[3]}}function resolve(e,o){for(var t=(o||"/").split("/").slice(0,-1).concat(e.split("/")),r=t.length,s=t[r-1],a=!1,n=0;r--;)"."===t[r]?t.splice(r,1):".."===t[r]?(t.splice(r,1),n++):n&&(0===r&&(a=!0),t.splice(r,1),n--);return a&&t.unshift(""),"."!==s&&".."!==s||t.push(""),t.join("/")}function URL(e,o,t){if(!(this instanceof URL))return new URL(e,o,t);var r,s,a,n,l,i,h=rules.slice(),c=typeof o,p=this,u=0;for("object"!==c&&"string"!==c&&(t=o,o=null),t&&"function"!=typeof t&&(t=qs.parse),o=lolcation(o),r=!(s=extractProtocol(e||"")).protocol&&!s.slashes,p.slashes=s.slashes||r&&o.slashes,p.protocol=s.protocol||o.protocol||"",e=s.rest,s.slashes||(h[2]=[/(.*)/,"pathname"]);u<h.length;u++)a=(n=h[u])[0],i=n[1],a!==a?p[i]=e:"string"==typeof a?~(l=e.indexOf(a))&&("number"==typeof n[2]?(p[i]=e.slice(0,l),e=e.slice(l+n[2])):(p[i]=e.slice(l),e=e.slice(0,l))):(l=a.exec(e))&&(p[i]=l[1],e=e.slice(0,l.index)),p[i]=p[i]||(r&&n[3]?o[i]||"":""),n[4]&&(p[i]=p[i].toLowerCase());t&&(p.query=t(p.query)),r&&o.slashes&&"/"!==p.pathname.charAt(0)&&(""!==p.pathname||""!==o.pathname)&&(p.pathname=resolve(p.pathname,o.pathname)),required(p.port,p.protocol)||(p.host=p.hostname,p.port=""),p.username=p.password="",p.auth&&(n=p.auth.split(":"),p.username=n[0]||"",p.password=n[1]||""),p.origin=p.protocol&&p.host&&"file:"!==p.protocol?p.protocol+"//"+p.host:"null",p.href=p.toString()}function set(e,o,t){var r=this;switch(e){case"query":"string"==typeof o&&o.length&&(o=(t||qs.parse)(o)),r[e]=o;break;case"port":r[e]=o,required(o,r.protocol)?o&&(r.host=r.hostname+":"+o):(r.host=r.hostname,r[e]="");break;case"hostname":r[e]=o,r.port&&(o+=":"+r.port),r.host=o;break;case"host":r[e]=o,/:\d+$/.test(o)?(o=o.split(":"),r.port=o.pop(),r.hostname=o.join(":")):(r.hostname=o,r.port="");break;case"protocol":r.protocol=o.toLowerCase(),r.slashes=!t;break;case"pathname":r.pathname=o.length&&"/"!==o.charAt(0)?"/"+o:o;break;default:r[e]=o}for(var s=0;s<rules.length;s++){var a=rules[s];a[4]&&(r[a[1]]=r[a[1]].toLowerCase())}return r.origin=r.protocol&&r.host&&"file:"!==r.protocol?r.protocol+"//"+r.host:"null",r.href=r.toString(),r}function toString(e){e&&"function"==typeof e||(e=qs.stringify);var o,t=this,r=t.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var s=r+(t.slashes?"//":"");return t.username&&(s+=t.username,t.password&&(s+=":"+t.password),s+="@"),s+=t.host+t.pathname,(o="object"==typeof t.query?e(t.query):t.query)&&(s+="?"!==o.charAt(0)?"?"+o:o),t.hash&&(s+=t.hash),s}var required=require("requires-port"),qs=require("querystringify"),protocolre=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,slashes=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,rules=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],ignore={hash:1,query:1};URL.prototype={set:set,toString:toString},URL.extractProtocol=extractProtocol,URL.location=lolcation,URL.qs=qs,module.exports=URL;
},{"./lolcation":17,"querystringify":11,"requires-port":12}],17:[function(require,module,exports){
(function (global){
"use strict";var slashes=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,ignore={hash:1,query:1},URL;module.exports=function(e){e=e||global.location||{},URL=URL||require("./");var s,o={},r=typeof e;if("blob:"===e.protocol)o=new URL(unescape(e.pathname),{});else if("string"===r){o=new URL(e,{});for(s in ignore)delete o[s]}else if("object"===r){for(s in e)s in ignore||(o[s]=e[s]);void 0===o.slashes&&(o.slashes=slashes.test(e.href))}return o};
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./":16}]},{},[1])(1)
},{"querystringify":11,"requires-port":12}]},{},[1])(1)
});

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.getIt=e()}}(function(){return function e(t,r,o){function n(i,a){if(!r[i]){if(!t[i]){var u="function"==typeof require&&require;if(!a&&u)return u(i,!0);if(s)return s(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var p=r[i]={exports:{}};t[i][0].call(p.exports,function(e){var r=t[i][1][e];return n(r?r:e)},p,p.exports,e,t,r,o)}return r[i].exports}for(var s="function"==typeof require&&require,i=0;i<o.length;i++)n(o[i]);return n}({1:[function(e,t,r){"use strict";var o=e("nano-pubsub"),n=e("./util/middlewareReducer"),s=e("./middleware/defaultOptionsProcessor"),i=e("./request"),a=["request","response","progress","error","abort"],u=["processOptions","onRequest","onResponse","onError","onReturn","onHeaders"];t.exports=function e(){function t(e){function t(e,t,o){var n=e,i=t;if(!n)try{i=s("onResponse",t,o)}catch(e){i=null,n=e}n=n&&s("onError",n,o),n?r.error.publish(n):i&&r.response.publish(i)}var r=a.reduce(function(e,t){return e[t]=o(),e},{}),s=n(p),u=s("processOptions",e),c={options:u,channels:r,applyMiddleware:s},f=null,l=r.request.subscribe(function(e){f=i(e,function(r,o){return t(r,o,e)})});r.abort.subscribe(function(){l(),f&&f.abort()});var h=s("onReturn",r,c);return h===r&&r.request.publish(c),h}var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],c=[],p=u.reduce(function(e,t){return e[t]=e[t]||[],e},{processOptions:[s]});return t.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&p.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");u.forEach(function(t){e[t]&&p[t].push(e[t])}),c.push(e)},t.clone=function(){return e(c)},r.forEach(t.use),t}},{"./middleware/defaultOptionsProcessor":2,"./request":4,"./util/middlewareReducer":5,"nano-pubsub":8}],2:[function(e,t,r){"use strict";function o(e){function t(e,o){Array.isArray(o)?o.forEach(function(r){return t(e,r)}):r.push([e,o].map(encodeURIComponent).join("="))}var r=[];for(var o in e)u.call(e,o)&&t(o,e[o]);return r.length?r.join("&"):""}function n(e){if(e===!1||0===e)return!1;if(e.connect||e.socket)return e;var t=Number(e);return isNaN(t)?n(c.timeout):{connect:t,socket:t}}function s(e){var t={};for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}var i=e("object-assign"),a=e("url-parse"),u=Object.prototype.hasOwnProperty,c={timeout:12e4};t.exports=function(e){var t="string"==typeof e?i({url:e},c):i({},c,e),r=a(t.url,{},!0);return t.timeout=n(t.timeout),t.query&&(r.query=i({},r.query,s(t.query))),t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t.url=r.toString(o),t}},{"object-assign":9,"url-parse":16}],3:[function(e,t,r){"use strict";var o=e("same-origin"),n=e("parse-headers"),s=function(){},i=window,a=i.XMLHttpRequest||s,u="withCredentials"in new a,c=u?a:i.XDomainRequest,p="xhr";t.exports=function(e,t){function r(){q=!0,v&&v.abort()}function s(t){j=!0,v.abort();var r=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+y.url:"Connection timed out on request to "+y.url);r.code=t,e.channels.error.publish(r)}function u(){R&&(f(),m.socket=setTimeout(function(){return s("ESOCKETTIMEDOUT")},R.socket))}function f(){(q||v.readyState>=2&&m.connect)&&clearTimeout(m.connect),m.socket&&clearTimeout(m.socket)}function l(){if(!O){f(),O=!0,v=null;var e=new Error("Network error while attempting to reach "+y.url);e.isNetworkError=!0,e.request=y,t(e)}}function h(){var e=v.status,t=v.statusText;if(b&&void 0===e)e=200;else{if(e>12e3&&e<12156)return l();e=1223===v.status?204:v.status,t=1223===v.status?"No Content":t}return{body:v.response||v.responseText,url:y.url,method:y.method,headers:b?{}:n(v.getAllResponseHeaders()),statusCode:e,statusMessage:t}}function d(){if(!(q||O||j)){if(0===v.status)return void l(new Error("Unknown XHR error"));f(),O=!0,t(null,h())}}var y=e.options,w=!o(i.location.href,y.url),m={},v=w?new c:new a,b=i.XDomainRequest&&v instanceof i.XDomainRequest,g=y.headers,q=!1,O=!1,j=!1;v.onerror=l,v.ontimeout=l,v.onabort=function(){q=!0},v.onprogress=function(){};var x=b?"onload":"onreadystatechange";if(v[x]=function(){u(),q||4!==v.readyState&&!b||0!==v.status&&d()},v.open(y.method,y.url,!0),v.withCredentials=!!y.withCredentials,g&&v.setRequestHeader)for(var E in g)g.hasOwnProperty(E)&&v.setRequestHeader(E,g[E]);else if(g&&b)throw new Error("Headers cannot be set on an XDomainRequest object");y.rawBody&&(v.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:y,adapter:p,request:v,context:e}),v.send(y.body||null);var R=y.timeout;return R&&(m.connect=setTimeout(function(){return s("ETIMEDOUT")},R.connect)),{abort:r}}},{"parse-headers":10,"same-origin":13}],4:[function(e,t,r){"use strict";t.exports=e("./node-request")},{"./node-request":3}],5:[function(e,t,r){"use strict";t.exports=function(e){var t=function(t,r){for(var o=arguments.length,n=Array(o>2?o-2:0),s=2;s<o;s++)n[s-2]=arguments[s];return e[t].reduce(function(e,t){return t.apply(void 0,[e].concat(n))},r)};return t}},{}],6:[function(e,t,r){function o(e,t,r){if(!a(t))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this),"[object Array]"===u.call(e)?n(e,t,r):"string"==typeof e?s(e,t,r):i(e,t,r)}function n(e,t,r){for(var o=0,n=e.length;o<n;o++)c.call(e,o)&&t.call(r,e[o],o,e)}function s(e,t,r){for(var o=0,n=e.length;o<n;o++)t.call(r,e.charAt(o),o,e)}function i(e,t,r){for(var o in e)c.call(e,o)&&t.call(r,e[o],o,e)}var a=e("is-function");t.exports=o;var u=Object.prototype.toString,c=Object.prototype.hasOwnProperty},{"is-function":7}],7:[function(e,t,r){function o(e){var t=n.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}t.exports=o;var n=Object.prototype.toString},{}],8:[function(e,t,r){t.exports=function(){function e(e){return r.push(e),function(){var t=r.indexOf(e);t>-1&&r.splice(t,1)}}function t(){for(var e=0;e<r.length;e++)r[e].apply(null,arguments)}var r=[];return{subscribe:e,publish:t}}},{}],9:[function(e,t,r){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function n(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var o=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==o.join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}var s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=n()?Object.assign:function(e,t){for(var r,n,u=o(e),c=1;c<arguments.length;c++){r=Object(arguments[c]);for(var p in r)i.call(r,p)&&(u[p]=r[p]);if(s){n=s(r);for(var f=0;f<n.length;f++)a.call(r,n[f])&&(u[n[f]]=r[n[f]])}}return u}},{}],10:[function(e,t,r){var o=e("trim"),n=e("for-each"),s=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return n(o(e).split("\n"),function(e){var r=e.indexOf(":"),n=o(e.slice(0,r)).toLowerCase(),i=o(e.slice(r+1));"undefined"==typeof t[n]?t[n]=i:s(t[n])?t[n].push(i):t[n]=[t[n],i]}),t}},{"for-each":6,trim:15}],11:[function(e,t,r){"use strict";function o(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,o={};t=r.exec(e);o[decodeURIComponent(t[1])]=decodeURIComponent(t[2]));return o}function n(e,t){t=t||"";var r=[];"string"!=typeof t&&(t="?");for(var o in e)s.call(e,o)&&r.push(encodeURIComponent(o)+"="+encodeURIComponent(e[o]));return r.length?t+r.join("&"):""}var s=Object.prototype.hasOwnProperty;r.stringify=n,r.parse=o},{}],12:[function(e,t,r){"use strict";t.exports=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},{}],13:[function(e,t,r){"use strict";var o=e("url");t.exports=function(e,t,r){if(e===t)return!0;var n=o.parse(e,!1,!0),s=o.parse(t,!1,!0),i=0|n.port||("https"===n.protocol?443:80),a=0|s.port||("https"===s.protocol?443:80),u={proto:n.protocol===s.protocol,hostname:n.hostname===s.hostname,port:i===a};return u.proto&&u.hostname&&(u.port||r)}},{url:14}],14:[function(e,t,r){"use strict";var o=/^(?:(?:(?:([^:\/#\?]+:)?(?:(?:\/\/)((?:((?:[^:@\/#\?]+)(?:\:(?:[^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/;t.exports={regex:o,parse:function(e){var t=o.exec(e);return t?{protocol:(t[1]||"").toLowerCase()||void 0,hostname:(t[5]||"").toLowerCase()||void 0,port:t[6]||void 0}:{}}}},{}],15:[function(e,t,r){function o(e){return e.replace(/^\s*|\s*$/g,"")}r=t.exports=o,r.left=function(e){return e.replace(/^\s*/,"")},r.right=function(e){return e.replace(/\s*$/,"")}},{}],16:[function(e,t,r){"use strict";function o(e){var t=f.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function n(e,t){for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=r.length,n=r[o-1],s=!1,i=0;o--;)"."===r[o]?r.splice(o,1):".."===r[o]?(r.splice(o,1),i++):i&&(0===o&&(s=!0),r.splice(o,1),i--);return s&&r.unshift(""),"."!==n&&".."!==n||r.push(""),r.join("/")}function s(e,t,r){if(!(this instanceof s))return new s(e,t,r);var i,a,f,h,d,y,w=l.slice(),m=typeof t,v=this,b=0;for("object"!==m&&"string"!==m&&(r=t,t=null),r&&"function"!=typeof r&&(r=p.parse),t=c(t),a=o(e||""),i=!a.protocol&&!a.slashes,v.slashes=a.slashes||i&&t.slashes,v.protocol=a.protocol||t.protocol||"",e=a.rest,a.slashes||(w[2]=[/(.*)/,"pathname"]);b<w.length;b++)h=w[b],f=h[0],y=h[1],f!==f?v[y]=e:"string"==typeof f?~(d=e.indexOf(f))&&("number"==typeof h[2]?(v[y]=e.slice(0,d),e=e.slice(d+h[2])):(v[y]=e.slice(d),e=e.slice(0,d))):(d=f.exec(e))&&(v[y]=d[1],e=e.slice(0,d.index)),v[y]=v[y]||(i&&h[3]?t[y]||"":""),h[4]&&(v[y]=v[y].toLowerCase());r&&(v.query=r(v.query)),i&&t.slashes&&"/"!==v.pathname.charAt(0)&&(""!==v.pathname||""!==t.pathname)&&(v.pathname=n(v.pathname,t.pathname)),u(v.port,v.protocol)||(v.host=v.hostname,v.port=""),v.username=v.password="",v.auth&&(h=v.auth.split(":"),v.username=h[0]||"",v.password=h[1]||""),v.origin=v.protocol&&v.host&&"file:"!==v.protocol?v.protocol+"//"+v.host:"null",v.href=v.toString()}function i(e,t,r){var o=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||p.parse)(t)),o[e]=t;break;case"port":o[e]=t,u(t,o.protocol)?t&&(o.host=o.hostname+":"+t):(o.host=o.hostname,o[e]="");break;case"hostname":o[e]=t,o.port&&(t+=":"+o.port),o.host=t;break;case"host":o[e]=t,/:\d+$/.test(t)?(t=t.split(":"),o.port=t.pop(),o.hostname=t.join(":")):(o.hostname=t,o.port="");break;case"protocol":o.protocol=t.toLowerCase(),o.slashes=!r;break;case"pathname":o.pathname=t.length&&"/"!==t.charAt(0)?"/"+t:t;break;default:o[e]=t}for(var n=0;n<l.length;n++){var s=l[n];s[4]&&(o[s[1]]=o[s[1]].toLowerCase())}return o.origin=o.protocol&&o.host&&"file:"!==o.protocol?o.protocol+"//"+o.host:"null",o.href=o.toString(),o}function a(e){e&&"function"==typeof e||(e=p.stringify);var t,r=this,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var n=o+(r.slashes?"//":"");return r.username&&(n+=r.username,r.password&&(n+=":"+r.password),n+="@"),n+=r.host+r.pathname,t="object"==typeof r.query?e(r.query):r.query,t&&(n+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(n+=r.hash),n}var u=e("requires-port"),c=e("./lolcation"),p=e("querystringify"),f=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,l=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]];s.prototype={set:i,toString:a},s.extractProtocol=o,s.location=c,s.qs=p,t.exports=s},{"./lolcation":17,querystringify:11,"requires-port":12}],17:[function(e,t,r){(function(r){"use strict";var o,n=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,s={hash:1,query:1};t.exports=function(t){t=t||r.location||{},o=o||e("./");var i,a={},u=typeof t;if("blob:"===t.protocol)a=new o(unescape(t.pathname),{});else if("string"===u){a=new o(t,{});for(i in s)delete a[i]}else if("object"===u){for(i in t)i in s||(a[i]=t[i]);void 0===a.slashes&&(a.slashes=n.test(t.href))}return a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./":16}]},{},[1])(1)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).getIt=e()}}(function(){return function e(t,r,o){function n(i,a){if(!r[i]){if(!t[i]){var u="function"==typeof require&&require;if(!a&&u)return u(i,!0);if(s)return s(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var p=r[i]={exports:{}};t[i][0].call(p.exports,function(e){var r=t[i][1][e];return n(r||e)},p,p.exports,e,t,r,o)}return r[i].exports}for(var s="function"==typeof require&&require,i=0;i<o.length;i++)n(o[i]);return n}({1:[function(e,t,r){"use strict";var o=e("nano-pubsub"),n=e("./util/middlewareReducer"),s=e("./middleware/defaultOptionsProcessor"),i=e("./request"),a=["request","response","progress","error","abort"],u=["processOptions","onRequest","onResponse","onError","onReturn","onHeaders"];t.exports=function e(){function t(e){function t(e,t,o){var n=e,i=t;if(!n)try{i=s("onResponse",t,o)}catch(e){i=null,n=e}(n=n&&s("onError",n,o))?r.error.publish(n):i&&r.response.publish(i)}var r=a.reduce(function(e,t){return e[t]=o(),e},{}),s=n(p),u={options:s("processOptions",e),channels:r,applyMiddleware:s},c=null,f=r.request.subscribe(function(e){c=i(e,function(r,o){return t(r,o,e)})});r.abort.subscribe(function(){f(),c&&c.abort()});var l=s("onReturn",r,u);return l===r&&r.request.publish(u),l}var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],c=[],p=u.reduce(function(e,t){return e[t]=e[t]||[],e},{processOptions:[s]});return t.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&p.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");u.forEach(function(t){e[t]&&p[t].push(e[t])}),c.push(e)},t.clone=function(){return e(c)},r.forEach(t.use),t}},{"./middleware/defaultOptionsProcessor":2,"./request":4,"./util/middlewareReducer":5,"nano-pubsub":8}],2:[function(e,t,r){"use strict";function o(e){function t(e,o){Array.isArray(o)?o.forEach(function(r){return t(e,r)}):r.push([e,o].map(encodeURIComponent).join("="))}var r=[];for(var o in e)u.call(e,o)&&t(o,e[o]);return r.length?r.join("&"):""}function n(e){if(!1===e||0===e)return!1;if(e.connect||e.socket)return e;var t=Number(e);return isNaN(t)?n(c.timeout):{connect:t,socket:t}}function s(e){var t={};for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}var i=e("object-assign"),a=e("url-parse"),u=Object.prototype.hasOwnProperty,c={timeout:12e4};t.exports=function(e){var t="string"==typeof e?i({url:e},c):i({},c,e),r=a(t.url,{},!0);return t.timeout=n(t.timeout),t.query&&(r.query=i({},r.query,s(t.query))),t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t.url=r.toString(o),t}},{"object-assign":9,"url-parse":16}],3:[function(e,t,r){"use strict";var o=e("same-origin"),n=e("parse-headers"),s=window,i=s.XMLHttpRequest||function(){},a="withCredentials"in new i?i:s.XDomainRequest;t.exports=function(e,t){function r(t){g=!0,y.abort();var r=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+h.url:"Connection timed out on request to "+h.url);r.code=t,e.channels.error.publish(r)}function u(){O&&(c(),d.socket=setTimeout(function(){return r("ESOCKETTIMEDOUT")},O.socket))}function c(){(b||y.readyState>=2&&d.connect)&&clearTimeout(d.connect),d.socket&&clearTimeout(d.socket)}function p(){if(!v){c(),v=!0,y=null;var e=new Error("Network error while attempting to reach "+h.url);e.isNetworkError=!0,e.request=h,t(e)}}function f(){var e=y.status,t=y.statusText;if(w&&void 0===e)e=200;else{if(e>12e3&&e<12156)return p();e=1223===y.status?204:y.status,t=1223===y.status?"No Content":t}return{body:y.response||y.responseText,url:h.url,method:h.method,headers:w?{}:n(y.getAllResponseHeaders()),statusCode:e,statusMessage:t}}function l(){b||v||g||(0!==y.status?(c(),v=!0,t(null,f())):p(new Error("Unknown XHR error")))}var h=e.options,d={},y=o(s.location.href,h.url)?new i:new a,w=s.XDomainRequest&&y instanceof s.XDomainRequest,m=h.headers,b=!1,v=!1,g=!1;if(y.onerror=p,y.ontimeout=p,y.onabort=function(){b=!0},y.onprogress=function(){},y[w?"onload":"onreadystatechange"]=function(){u(),b||4!==y.readyState&&!w||0!==y.status&&l()},y.open(h.method,h.url,!0),y.withCredentials=!!h.withCredentials,m&&y.setRequestHeader)for(var q in m)m.hasOwnProperty(q)&&y.setRequestHeader(q,m[q]);else if(m&&w)throw new Error("Headers cannot be set on an XDomainRequest object");h.rawBody&&(y.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:h,adapter:"xhr",request:y,context:e}),y.send(h.body||null);var O=h.timeout;return O&&(d.connect=setTimeout(function(){return r("ETIMEDOUT")},O.connect)),{abort:function(){b=!0,y&&y.abort()}}}},{"parse-headers":10,"same-origin":13}],4:[function(e,t,r){"use strict";t.exports=e("./node-request")},{"./node-request":3}],5:[function(e,t,r){"use strict";t.exports=function(e){return function(t,r){for(var o=arguments.length,n=Array(o>2?o-2:0),s=2;s<o;s++)n[s-2]=arguments[s];return e[t].reduce(function(e,t){return t.apply(void 0,[e].concat(n))},r)}}},{}],6:[function(e,t,r){function o(e,t,r){for(var o=0,n=e.length;o<n;o++)u.call(e,o)&&t.call(r,e[o],o,e)}function n(e,t,r){for(var o=0,n=e.length;o<n;o++)t.call(r,e.charAt(o),o,e)}function s(e,t,r){for(var o in e)u.call(e,o)&&t.call(r,e[o],o,e)}var i=e("is-function");t.exports=function(e,t,r){if(!i(t))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this),"[object Array]"===a.call(e)?o(e,t,r):"string"==typeof e?n(e,t,r):s(e,t,r)};var a=Object.prototype.toString,u=Object.prototype.hasOwnProperty},{"is-function":7}],7:[function(e,t,r){t.exports=function(e){var t=o.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var o=Object.prototype.toString},{}],8:[function(e,t,r){t.exports=function(){var e=[];return{subscribe:function(t){return e.push(t),function(){var r=e.indexOf(t);r>-1&&e.splice(r,1)}},publish:function(){for(var t=0;t<e.length;t++)e[t].apply(null,arguments)}}}},{}],9:[function(e,t,r){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,a,u=o(e),c=1;c<arguments.length;c++){r=Object(arguments[c]);for(var p in r)s.call(r,p)&&(u[p]=r[p]);if(n){a=n(r);for(var f=0;f<a.length;f++)i.call(r,a[f])&&(u[a[f]]=r[a[f]])}}return u}},{}],10:[function(e,t,r){var o=e("trim"),n=e("for-each"),s=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return n(o(e).split("\n"),function(e){var r=e.indexOf(":"),n=o(e.slice(0,r)).toLowerCase(),i=o(e.slice(r+1));void 0===t[n]?t[n]=i:s(t[n])?t[n].push(i):t[n]=[t[n],i]}),t}},{"for-each":6,trim:15}],11:[function(e,t,r){"use strict";function o(e){return decodeURIComponent(e.replace(/\+/g," "))}var n=Object.prototype.hasOwnProperty;r.stringify=function(e,t){var r=[];"string"!=typeof(t=t||"")&&(t="?");for(var o in e)n.call(e,o)&&r.push(encodeURIComponent(o)+"="+encodeURIComponent(e[o]));return r.length?t+r.join("&"):""},r.parse=function(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,n={};t=r.exec(e);n[o(t[1])]=o(t[2]));return n}},{}],12:[function(e,t,r){"use strict";t.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},{}],13:[function(e,t,r){"use strict";var o=e("url");t.exports=function(e,t,r){if(e===t)return!0;var n=o.parse(e,!1,!0),s=o.parse(t,!1,!0),i=0|n.port||("https"===n.protocol?443:80),a=0|s.port||("https"===s.protocol?443:80),u={proto:n.protocol===s.protocol,hostname:n.hostname===s.hostname,port:i===a};return u.proto&&u.hostname&&(u.port||r)}},{url:14}],14:[function(e,t,r){"use strict";var o=/^(?:(?:(?:([^:\/#\?]+:)?(?:(?:\/\/)((?:((?:[^:@\/#\?]+)(?:\:(?:[^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/;t.exports={regex:o,parse:function(e){var t=o.exec(e);return t?{protocol:(t[1]||"").toLowerCase()||void 0,hostname:(t[5]||"").toLowerCase()||void 0,port:t[6]||void 0}:{}}}},{}],15:[function(e,t,r){(r=t.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},r.right=function(e){return e.replace(/\s*$/,"")}},{}],16:[function(e,t,r){(function(r){"use strict";function o(e){var t,o={},n=typeof(e=e||r.location||{});if("blob:"===e.protocol)o=new i(unescape(e.pathname),{});else if("string"===n){o=new i(e,{});for(t in l)delete o[t]}else if("object"===n){for(t in e)t in l||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=p.test(e.href))}return o}function n(e){var t=c.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function s(e,t){for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=r.length,n=r[o-1],s=!1,i=0;o--;)"."===r[o]?r.splice(o,1):".."===r[o]?(r.splice(o,1),i++):i&&(0===o&&(s=!0),r.splice(o,1),i--);return s&&r.unshift(""),"."!==n&&".."!==n||r.push(""),r.join("/")}function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);var c,p,l,h,d,y,w=f.slice(),m=typeof t,b=this,v=0;for("object"!==m&&"string"!==m&&(r=t,t=null),r&&"function"!=typeof r&&(r=u.parse),t=o(t),c=!(p=n(e||"")).protocol&&!p.slashes,b.slashes=p.slashes||c&&t.slashes,b.protocol=p.protocol||t.protocol||"",e=p.rest,p.slashes||(w[2]=[/(.*)/,"pathname"]);v<w.length;v++)l=(h=w[v])[0],y=h[1],l!==l?b[y]=e:"string"==typeof l?~(d=e.indexOf(l))&&("number"==typeof h[2]?(b[y]=e.slice(0,d),e=e.slice(d+h[2])):(b[y]=e.slice(d),e=e.slice(0,d))):(d=l.exec(e))&&(b[y]=d[1],e=e.slice(0,d.index)),b[y]=b[y]||(c&&h[3]?t[y]||"":""),h[4]&&(b[y]=b[y].toLowerCase());r&&(b.query=r(b.query)),c&&t.slashes&&"/"!==b.pathname.charAt(0)&&(""!==b.pathname||""!==t.pathname)&&(b.pathname=s(b.pathname,t.pathname)),a(b.port,b.protocol)||(b.host=b.hostname,b.port=""),b.username=b.password="",b.auth&&(h=b.auth.split(":"),b.username=h[0]||"",b.password=h[1]||""),b.origin=b.protocol&&b.host&&"file:"!==b.protocol?b.protocol+"//"+b.host:"null",b.href=b.toString()}var a=e("requires-port"),u=e("querystringify"),c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,p=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,f=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};i.prototype={set:function(e,t,r){var o=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||u.parse)(t)),o[e]=t;break;case"port":o[e]=t,a(t,o.protocol)?t&&(o.host=o.hostname+":"+t):(o.host=o.hostname,o[e]="");break;case"hostname":o[e]=t,o.port&&(t+=":"+o.port),o.host=t;break;case"host":o[e]=t,/:\d+$/.test(t)?(t=t.split(":"),o.port=t.pop(),o.hostname=t.join(":")):(o.hostname=t,o.port="");break;case"protocol":o.protocol=t.toLowerCase(),o.slashes=!r;break;case"pathname":o.pathname=t.length&&"/"!==t.charAt(0)?"/"+t:t;break;default:o[e]=t}for(var n=0;n<f.length;n++){var s=f[n];s[4]&&(o[s[1]]=o[s[1]].toLowerCase())}return o.origin=o.protocol&&o.host&&"file:"!==o.protocol?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(e){e&&"function"==typeof e||(e=u.stringify);var t,r=this,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var n=o+(r.slashes?"//":"");return r.username&&(n+=r.username,r.password&&(n+=":"+r.password),n+="@"),n+=r.host+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(n+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(n+=r.hash),n}},i.extractProtocol=n,i.location=o,i.qs=u,t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{querystringify:11,"requires-port":12}]},{},[1])(1)});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc