(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i -1) { pointers.splice(i, 1); } pointers.push(event); } function removePointer(pointers, event) { // Add touches if applicable if (event.touches) { // Remove all touches while (pointers.length) { pointers.pop(); } return; } var i = findEventIndex(pointers, event); if (i > -1) { pointers.splice(i, 1); } } /** * Calculates a center point between * the given pointer events, for panning * with multiple pointers. */ function getMiddle(pointers) { // Copy to avoid changing by reference pointers = pointers.slice(0); var event1 = pointers.pop(); var event2; while ((event2 = pointers.pop())) { event1 = { clientX: (event2.clientX - event1.clientX) / 2 + event1.clientX, clientY: (event2.clientY - event1.clientY) / 2 + event1.clientY }; } return event1; } /** * Calculates the distance between two points * for pinch zooming. * Limits to the first 2 */ function getDistance(pointers) { if (pointers.length < 2) { return 0; } var event1 = pointers[0]; var event2 = pointers[1]; return Math.sqrt(Math.pow(Math.abs(event2.clientX - event1.clientX), 2) + Math.pow(Math.abs(event2.clientY - event1.clientY), 2)); } var events = { down: 'mousedown', move: 'mousemove', up: 'mouseup mouseleave' }; if (typeof window !== 'undefined') { if (typeof window.PointerEvent === 'function') { events = { down: 'pointerdown', move: 'pointermove', up: 'pointerup pointerleave pointercancel' }; } else if (typeof window.TouchEvent === 'function') { events = { down: 'touchstart', move: 'touchmove', up: 'touchend touchcancel' }; } } function onPointer(event, elem, handler, eventOpts) { events[event].split(' ').forEach(function (name) { elem.addEventListener(name, handler, eventOpts); }); } function destroyPointer(event, elem, handler) { events[event].split(' ').forEach(function (name) { elem.removeEventListener(name, handler); }); } var isIE = typeof document !== 'undefined' && !!document.documentMode; /** * Lazy creation of a CSS style declaration */ var divStyle; function createStyle() { if (divStyle) { return divStyle; } return (divStyle = document.createElement('div').style); } /** * Proper prefixing for cross-browser compatibility */ var prefixes = ['webkit', 'moz', 'ms']; var prefixCache = {}; function getPrefixedName(name) { if (prefixCache[name]) { return prefixCache[name]; } var divStyle = createStyle(); if (name in divStyle) { return (prefixCache[name] = name); } var capName = name[0].toUpperCase() + name.slice(1); var i = prefixes.length; while (i--) { var prefixedName = "" + prefixes[i] + capName; if (prefixedName in divStyle) { return (prefixCache[name] = prefixedName); } } } /** * Gets a style value expected to be a number */ function getCSSNum(name, style) { return parseFloat(style[getPrefixedName(name)]) || 0; } function getBoxStyle(elem, name, style) { if (style === void 0) { style = window.getComputedStyle(elem); } // Support: FF 68+ // Firefox requires specificity for border var suffix = name === 'border' ? 'Width' : ''; return { left: getCSSNum(name + "Left" + suffix, style), right: getCSSNum(name + "Right" + suffix, style), top: getCSSNum(name + "Top" + suffix, style), bottom: getCSSNum(name + "Bottom" + suffix, style) }; } /** * Set a style using the properly prefixed name */ function setStyle(elem, name, value) { // eslint-disable-next-line @typescript-eslint/no-explicit-any elem.style[getPrefixedName(name)] = value; } /** * Constructs the transition from panzoom options * and takes care of prefixing the transition and transform */ function setTransition(elem, options) { var transform = getPrefixedName('transform'); setStyle(elem, 'transition', transform + " " + options.duration + "ms " + options.easing); } /** * Set the transform using the proper prefix */ function setTransform(elem, _a, _options) { var x = _a.x, y = _a.y, scale = _a.scale, isSVG = _a.isSVG; setStyle(elem, 'transform', "scale(" + scale + ") translate(" + x + "px, " + y + "px)"); if (isSVG && isIE) { var matrixValue = window.getComputedStyle(elem).getPropertyValue('transform'); elem.setAttribute('transform', matrixValue); } } /** * Dimensions used in containment and focal point zooming */ function getDimensions(elem) { var parent = elem.parentNode; var style = window.getComputedStyle(elem); var parentStyle = window.getComputedStyle(parent); var rectElem = elem.getBoundingClientRect(); var rectParent = parent.getBoundingClientRect(); return { elem: { style: style, width: rectElem.width, height: rectElem.height, top: rectElem.top, bottom: rectElem.bottom, left: rectElem.left, right: rectElem.right, margin: getBoxStyle(elem, 'margin', style), border: getBoxStyle(elem, 'border', style) }, parent: { style: parentStyle, width: rectParent.width, height: rectParent.height, top: rectParent.top, bottom: rectParent.bottom, left: rectParent.left, right: rectParent.right, padding: getBoxStyle(parent, 'padding', parentStyle), border: getBoxStyle(parent, 'border', parentStyle) } }; } /** * Determine if an element is attached to the DOM * Panzoom requires this so events work properly */ function isAttached(elem) { var doc = elem.ownerDocument; var parent = elem.parentNode; return (doc && parent && doc.nodeType === 9 && parent.nodeType === 1 && doc.documentElement.contains(parent)); } function getClass(elem) { return (elem.getAttribute('class') || '').trim(); } function hasClass(elem, className) { return elem.nodeType === 1 && (" " + getClass(elem) + " ").indexOf(" " + className + " ") > -1; } function isExcluded(elem, options) { for (var cur = elem; cur != null; cur = cur.parentNode) { if (hasClass(cur, options.excludeClass) || options.exclude.indexOf(cur) > -1) { return true; } } return false; } /** * Determine if an element is SVG by checking the namespace * Exception: the element itself should be treated like HTML */ var rsvg = /^http:[\w\.\/]+svg$/; function isSVGElement(elem) { return rsvg.test(elem.namespaceURI) && elem.nodeName.toLowerCase() !== 'svg'; } function shallowClone(obj) { var clone = {}; for (var key in obj) { if (obj.hasOwnProperty(key)) { clone[key] = obj[key]; } } return clone; } var defaultOptions = { animate: false, canvas: false, cursor: 'move', disablePan: false, disableZoom: false, disableXAxis: false, disableYAxis: false, duration: 200, easing: 'ease-in-out', exclude: [], excludeClass: 'panzoom-exclude', handleStartEvent: function (e) { e.preventDefault(); e.stopPropagation(); }, maxScale: 4, minScale: 0.125, overflow: 'hidden', panOnlyWhenZoomed: false, relative: false, setTransform: setTransform, startX: 0, startY: 0, startScale: 1, step: 0.3, touchAction: 'none' }; function Panzoom(elem, options) { if (!elem) { throw new Error('Panzoom requires an element as an argument'); } if (elem.nodeType !== 1) { throw new Error('Panzoom requires an element with a nodeType of 1'); } if (!isAttached(elem)) { throw new Error('Panzoom should be called on elements that have been attached to the DOM'); } options = __assign(__assign({}, defaultOptions), options); var isSVG = isSVGElement(elem); var parent = elem.parentNode; // Set parent styles parent.style.overflow = options.overflow; parent.style.userSelect = 'none'; // This is important for mobile to // prevent scrolling while panning parent.style.touchAction = options.touchAction; (options.canvas ? parent : elem).style.cursor = options.cursor; // Set element styles elem.style.userSelect = 'none'; elem.style.touchAction = options.touchAction; // The default for SVG is '0 0' // SVG can't be changed in IE setStyle(elem, 'transformOrigin', typeof options.origin === 'string' ? options.origin : isSVG ? '0 0' : '50% 50%'); function setOptions(opts) { if (opts === void 0) { opts = {}; } for (var key in opts) { if (opts.hasOwnProperty(key)) { options[key] = opts[key]; } } // Handle option side-effects if (opts.hasOwnProperty('cursor')) { elem.style.cursor = opts.cursor; } if (opts.hasOwnProperty('overflow')) { parent.style.overflow = opts.overflow; } if (opts.hasOwnProperty('touchAction')) { parent.style.touchAction = opts.touchAction; elem.style.touchAction = opts.touchAction; } if (opts.hasOwnProperty('minScale') || opts.hasOwnProperty('maxScale') || opts.hasOwnProperty('contain')) { setMinMax(); } } var x = 0; var y = 0; var scale = 1; var isPanning = false; zoom(options.startScale, { animate: false }); // Wait for scale to update // for accurate dimensions // to constrain initial values setTimeout(function () { setMinMax(); pan(options.startX, options.startY, { animate: false }); }); // eslint-disable-next-line @typescript-eslint/no-explicit-any function trigger(eventName, detail, opts) { if (opts.silent) { return; } var event = new CustomEvent(eventName, { detail: detail }); elem.dispatchEvent(event); } function setTransformWithEvent(eventName, opts) { var value = { x: x, y: y, scale: scale, isSVG: isSVG }; requestAnimationFrame(function () { if (typeof opts.animate === 'boolean') { if (opts.animate) { setTransition(elem, opts); } else { setStyle(elem, 'transition', 'none'); } } opts.setTransform(elem, value, opts); }); trigger(eventName, value, opts); trigger('panzoomchange', value, opts); return value; } function setMinMax() { if (options.contain) { var dims = getDimensions(elem); var parentWidth = dims.parent.width - dims.parent.border.left - dims.parent.border.right; var parentHeight = dims.parent.height - dims.parent.border.top - dims.parent.border.bottom; var elemWidth = dims.elem.width / scale; var elemHeight = dims.elem.height / scale; var elemScaledWidth = parentWidth / elemWidth; var elemScaledHeight = parentHeight / elemHeight; if (options.contain === 'inside') { options.maxScale = Math.min(elemScaledWidth, elemScaledHeight); } else if (options.contain === 'outside') { options.minScale = Math.max(elemScaledWidth, elemScaledHeight); } } } function constrainXY(toX, toY, toScale, panOptions) { var opts = __assign(__assign({}, options), panOptions); var result = { x: x, y: y, opts: opts }; if (!opts.force && (opts.disablePan || (opts.panOnlyWhenZoomed && scale === opts.startScale))) { return result; } toX = parseFloat(toX); toY = parseFloat(toY); if (!opts.disableXAxis) { result.x = (opts.relative ? x : 0) + toX; } if (!opts.disableYAxis) { result.y = (opts.relative ? y : 0) + toY; } if (opts.contain === 'inside') { var dims = getDimensions(elem); result.x = Math.max(-dims.elem.margin.left - dims.parent.padding.left, Math.min(dims.parent.width - dims.elem.width / toScale - dims.parent.padding.left - dims.elem.margin.left - dims.parent.border.left - dims.parent.border.right, result.x)); result.y = Math.max(-dims.elem.margin.top - dims.parent.padding.top, Math.min(dims.parent.height - dims.elem.height / toScale - dims.parent.padding.top - dims.elem.margin.top - dims.parent.border.top - dims.parent.border.bottom, result.y)); } else if (opts.contain === 'outside') { var dims = getDimensions(elem); var realWidth = dims.elem.width / scale; var realHeight = dims.elem.height / scale; var scaledWidth = realWidth * toScale; var scaledHeight = realHeight * toScale; var diffHorizontal = (scaledWidth - realWidth) / 2; var diffVertical = (scaledHeight - realHeight) / 2; var minX = (-(scaledWidth - dims.parent.width) - dims.parent.padding.left - dims.parent.border.left - dims.parent.border.right + diffHorizontal) / toScale; var maxX = (diffHorizontal - dims.parent.padding.left) / toScale; result.x = Math.max(Math.min(result.x, maxX), minX); var minY = (-(scaledHeight - dims.parent.height) - dims.parent.padding.top - dims.parent.border.top - dims.parent.border.bottom + diffVertical) / toScale; var maxY = (diffVertical - dims.parent.padding.top) / toScale; result.y = Math.max(Math.min(result.y, maxY), minY); } return result; } function constrainScale(toScale, zoomOptions) { var opts = __assign(__assign({}, options), zoomOptions); var result = { scale: scale, opts: opts }; if (!opts.force && opts.disableZoom) { return result; } result.scale = Math.min(Math.max(toScale, opts.minScale), opts.maxScale); return result; } function pan(toX, toY, panOptions) { var result = constrainXY(toX, toY, scale, panOptions); var opts = result.opts; x = result.x; y = result.y; return setTransformWithEvent('panzoompan', opts); } function zoom(toScale, zoomOptions) { var result = constrainScale(toScale, zoomOptions); var opts = result.opts; if (!opts.force && opts.disableZoom) { return; } toScale = result.scale; var toX = x; var toY = y; if (opts.focal) { // The difference between the point after the scale and the point before the scale // plus the current translation after the scale // neutralized to no scale (as the transform scale will apply to the translation) var focal = opts.focal; toX = (focal.x / toScale - focal.x / scale + x * toScale) / toScale; toY = (focal.y / toScale - focal.y / scale + y * toScale) / toScale; } var panResult = constrainXY(toX, toY, toScale, { relative: false, force: true }); x = panResult.x; y = panResult.y; scale = toScale; return setTransformWithEvent('panzoomzoom', opts); } function zoomInOut(isIn, zoomOptions) { var opts = __assign(__assign(__assign({}, options), { animate: true }), zoomOptions); return zoom(scale * Math.exp((isIn ? 1 : -1) * opts.step), opts); } function zoomIn(zoomOptions) { return zoomInOut(true, zoomOptions); } function zoomOut(zoomOptions) { return zoomInOut(false, zoomOptions); } function zoomToPoint(toScale, point, zoomOptions) { var dims = getDimensions(elem); // Instead of thinking of operating on the panzoom element, // think of operating on the area inside the panzoom // element's parent // Subtract padding and border var effectiveArea = { width: dims.parent.width - dims.parent.padding.left - dims.parent.padding.right - dims.parent.border.left - dims.parent.border.right, height: dims.parent.height - dims.parent.padding.top - dims.parent.padding.bottom - dims.parent.border.top - dims.parent.border.bottom }; // Adjust the clientX/clientY to ignore the area // outside the effective area var clientX = point.clientX - dims.parent.left - dims.parent.padding.left - dims.parent.border.left - dims.elem.margin.left; var clientY = point.clientY - dims.parent.top - dims.parent.padding.top - dims.parent.border.top - dims.elem.margin.top; // Adjust the clientX/clientY for HTML elements, // because they have a transform-origin of 50% 50% if (!isSVG) { clientX -= dims.elem.width / scale / 2; clientY -= dims.elem.height / scale / 2; } // Convert the mouse point from it's position over the // effective area before the scale to the position // over the effective area after the scale. var focal = { x: (clientX / effectiveArea.width) * (effectiveArea.width * toScale), y: (clientY / effectiveArea.height) * (effectiveArea.height * toScale) }; return zoom(toScale, __assign(__assign({ animate: false }, zoomOptions), { focal: focal })); } function zoomWithWheel(event, zoomOptions) { // Need to prevent the default here // or it conflicts with regular page scroll event.preventDefault(); var opts = __assign(__assign({}, options), zoomOptions); // Normalize to deltaX in case shift modifier is used on Mac var delta = event.deltaY === 0 && event.deltaX ? event.deltaX : event.deltaY; var wheel = delta < 0 ? 1 : -1; var toScale = constrainScale(scale * Math.exp((wheel * opts.step) / 3), opts).scale; return zoomToPoint(toScale, event, opts); } function reset(resetOptions) { var opts = __assign(__assign(__assign({}, options), { animate: true, force: true }), resetOptions); scale = constrainScale(opts.startScale, opts).scale; var panResult = constrainXY(opts.startX, opts.startY, scale, opts); x = panResult.x; y = panResult.y; return setTransformWithEvent('panzoomreset', opts); } var origX; var origY; var startClientX; var startClientY; var startScale; var startDistance; var pointers = []; function handleDown(event) { // Don't handle this event if the target is excluded if (isExcluded(event.target, options)) { return; } addPointer(pointers, event); isPanning = true; options.handleStartEvent(event); origX = x; origY = y; trigger('panzoomstart', { x: x, y: y, scale: scale }, options); // This works whether there are multiple // pointers or not var point = getMiddle(pointers); startClientX = point.clientX; startClientY = point.clientY; startScale = scale; startDistance = getDistance(pointers); } function move(event) { if (!isPanning || origX === undefined || origY === undefined || startClientX === undefined || startClientY === undefined) { return; } addPointer(pointers, event); var current = getMiddle(pointers); if (pointers.length > 1) { // Use the distance between the first 2 pointers // to determine the current scale var diff = getDistance(pointers) - startDistance; var toScale = constrainScale((diff * options.step) / 80 + startScale).scale; zoomToPoint(toScale, current); } pan(origX + (current.clientX - startClientX) / scale, origY + (current.clientY - startClientY) / scale, { animate: false }); } function handleUp(event) { // Don't call panzoomend when panning with 2 touches // until both touches end if (pointers.length === 1) { trigger('panzoomend', { x: x, y: y, scale: scale }, options); } // Note: don't remove all pointers // Can restart without having to reinitiate all of them // Remove the pointer regardless of the isPanning state removePointer(pointers, event); if (!isPanning) { return; } isPanning = false; origX = origY = startClientX = startClientY = undefined; } var bound = false; function bind() { if (bound) { return; } bound = true; onPointer('down', options.canvas ? parent : elem, handleDown); onPointer('move', document, move, { passive: true }); onPointer('up', document, handleUp, { passive: true }); } function destroy() { bound = false; destroyPointer('down', options.canvas ? parent : elem, handleDown); destroyPointer('move', document, move); destroyPointer('up', document, handleUp); } if (!options.noBind) { bind(); } return { bind: bind, destroy: destroy, eventNames: events, getPan: function () { return ({ x: x, y: y }); }, getScale: function () { return scale; }, getOptions: function () { return shallowClone(options); }, pan: pan, reset: reset, setOptions: setOptions, setStyle: function (name, value) { return setStyle(elem, name, value); }, zoom: zoom, zoomIn: zoomIn, zoomOut: zoomOut, zoomToPoint: zoomToPoint, zoomWithWheel: zoomWithWheel }; } Panzoom.defaultOptions = defaultOptions; return Panzoom; }))); },{}],2:[function(require,module,exports){ module.exports = require('./lib/axios'); },{"./lib/axios":4}],3:[function(require,module,exports){ 'use strict'; var utils = require('./../utils'); var settle = require('./../core/settle'); var cookies = require('./../helpers/cookies'); var buildURL = require('./../helpers/buildURL'); var buildFullPath = require('../core/buildFullPath'); var parseHeaders = require('./../helpers/parseHeaders'); var isURLSameOrigin = require('./../helpers/isURLSameOrigin'); var createError = require('../core/createError'); module.exports = function xhrAdapter(config) { return new Promise(function dispatchXhrRequest(resolve, reject) { var requestData = config.data; var requestHeaders = config.headers; if (utils.isFormData(requestData)) { delete requestHeaders['Content-Type']; // Let the browser set it } var request = new XMLHttpRequest(); // HTTP basic authentication if (config.auth) { var username = config.auth.username || ''; var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); } var fullPath = buildFullPath(config.baseURL, config.url); request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); // Set the request timeout in MS request.timeout = config.timeout; // Listen for ready state request.onreadystatechange = function handleLoad() { if (!request || request.readyState !== 4) { return; } // The request errored out and we didn't get a response, this will be // handled by onerror instead // With one exception: request that using file: protocol, most browsers // will return status as 0 even though it's a successful request if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { return; } // Prepare the response var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; var response = { data: responseData, status: request.status, statusText: request.statusText, headers: responseHeaders, config: config, request: request }; settle(resolve, reject, response); // Clean up request request = null; }; // Handle browser request cancellation (as opposed to a manual cancellation) request.onabort = function handleAbort() { if (!request) { return; } reject(createError('Request aborted', config, 'ECONNABORTED', request)); // Clean up request request = null; }; // Handle low level network errors request.onerror = function handleError() { // Real errors are hidden from us by the browser // onerror should only fire if it's a network error reject(createError('Network Error', config, null, request)); // Clean up request request = null; }; // Handle timeout request.ontimeout = function handleTimeout() { var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; if (config.timeoutErrorMessage) { timeoutErrorMessage = config.timeoutErrorMessage; } reject(createError(timeoutErrorMessage, config, 'ECONNABORTED', request)); // Clean up request request = null; }; // Add xsrf header // This is only done if running in a standard browser environment. // Specifically not if we're in a web worker, or react-native. if (utils.isStandardBrowserEnv()) { // Add xsrf header var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : undefined; if (xsrfValue) { requestHeaders[config.xsrfHeaderName] = xsrfValue; } } // Add headers to the request if ('setRequestHeader' in request) { utils.forEach(requestHeaders, function setRequestHeader(val, key) { if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { // Remove Content-Type if data is undefined delete requestHeaders[key]; } else { // Otherwise add header to the request request.setRequestHeader(key, val); } }); } // Add withCredentials to request if needed if (!utils.isUndefined(config.withCredentials)) { request.withCredentials = !!config.withCredentials; } // Add responseType to request if needed if (config.responseType) { try { request.responseType = config.responseType; } catch (e) { // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. if (config.responseType !== 'json') { throw e; } } } // Handle progress if needed if (typeof config.onDownloadProgress === 'function') { request.addEventListener('progress', config.onDownloadProgress); } // Not all browsers support upload events if (typeof config.onUploadProgress === 'function' && request.upload) { request.upload.addEventListener('progress', config.onUploadProgress); } if (config.cancelToken) { // Handle cancellation config.cancelToken.promise.then(function onCanceled(cancel) { if (!request) { return; } request.abort(); reject(cancel); // Clean up request request = null; }); } if (!requestData) { requestData = null; } // Send the request request.send(requestData); }); }; },{"../core/buildFullPath":10,"../core/createError":11,"./../core/settle":15,"./../helpers/buildURL":19,"./../helpers/cookies":21,"./../helpers/isURLSameOrigin":24,"./../helpers/parseHeaders":26,"./../utils":28}],4:[function(require,module,exports){ 'use strict'; var utils = require('./utils'); var bind = require('./helpers/bind'); var Axios = require('./core/Axios'); var mergeConfig = require('./core/mergeConfig'); var defaults = require('./defaults'); /** * Create an instance of Axios * * @param {Object} defaultConfig The default config for the instance * @return {Axios} A new instance of Axios */ function createInstance(defaultConfig) { var context = new Axios(defaultConfig); var instance = bind(Axios.prototype.request, context); // Copy axios.prototype to instance utils.extend(instance, Axios.prototype, context); // Copy context to instance utils.extend(instance, context); return instance; } // Create the default instance to be exported var axios = createInstance(defaults); // Expose Axios class to allow class inheritance axios.Axios = Axios; // Factory for creating new instances axios.create = function create(instanceConfig) { return createInstance(mergeConfig(axios.defaults, instanceConfig)); }; // Expose Cancel & CancelToken axios.Cancel = require('./cancel/Cancel'); axios.CancelToken = require('./cancel/CancelToken'); axios.isCancel = require('./cancel/isCancel'); // Expose all/spread axios.all = function all(promises) { return Promise.all(promises); }; axios.spread = require('./helpers/spread'); // Expose isAxiosError axios.isAxiosError = require('./helpers/isAxiosError'); module.exports = axios; // Allow use of default import syntax in TypeScript module.exports.default = axios; },{"./cancel/Cancel":5,"./cancel/CancelToken":6,"./cancel/isCancel":7,"./core/Axios":8,"./core/mergeConfig":14,"./defaults":17,"./helpers/bind":18,"./helpers/isAxiosError":23,"./helpers/spread":27,"./utils":28}],5:[function(require,module,exports){ 'use strict'; /** * A `Cancel` is an object that is thrown when an operation is canceled. * * @class * @param {string=} message The message. */ function Cancel(message) { this.message = message; } Cancel.prototype.toString = function toString() { return 'Cancel' + (this.message ? ': ' + this.message : ''); }; Cancel.prototype.__CANCEL__ = true; module.exports = Cancel; },{}],6:[function(require,module,exports){ 'use strict'; var Cancel = require('./Cancel'); /** * A `CancelToken` is an object that can be used to request cancellation of an operation. * * @class * @param {Function} executor The executor function. */ function CancelToken(executor) { if (typeof executor !== 'function') { throw new TypeError('executor must be a function.'); } var resolvePromise; this.promise = new Promise(function promiseExecutor(resolve) { resolvePromise = resolve; }); var token = this; executor(function cancel(message) { if (token.reason) { // Cancellation has already been requested return; } token.reason = new Cancel(message); resolvePromise(token.reason); }); } /** * Throws a `Cancel` if cancellation has been requested. */ CancelToken.prototype.throwIfRequested = function throwIfRequested() { if (this.reason) { throw this.reason; } }; /** * Returns an object that contains a new `CancelToken` and a function that, when called, * cancels the `CancelToken`. */ CancelToken.source = function source() { var cancel; var token = new CancelToken(function executor(c) { cancel = c; }); return { token: token, cancel: cancel }; }; module.exports = CancelToken; },{"./Cancel":5}],7:[function(require,module,exports){ 'use strict'; module.exports = function isCancel(value) { return !!(value && value.__CANCEL__); }; },{}],8:[function(require,module,exports){ 'use strict'; var utils = require('./../utils'); var buildURL = require('../helpers/buildURL'); var InterceptorManager = require('./InterceptorManager'); var dispatchRequest = require('./dispatchRequest'); var mergeConfig = require('./mergeConfig'); /** * Create a new instance of Axios * * @param {Object} instanceConfig The default config for the instance */ function Axios(instanceConfig) { this.defaults = instanceConfig; this.interceptors = { request: new InterceptorManager(), response: new InterceptorManager() }; } /** * Dispatch a request * * @param {Object} config The config specific for this request (merged with this.defaults) */ Axios.prototype.request = function request(config) { /*eslint no-param-reassign:0*/ // Allow for axios('example/url'[, config]) a la fetch API if (typeof config === 'string') { config = arguments[1] || {}; config.url = arguments[0]; } else { config = config || {}; } config = mergeConfig(this.defaults, config); // Set config.method if (config.method) { config.method = config.method.toLowerCase(); } else if (this.defaults.method) { config.method = this.defaults.method.toLowerCase(); } else { config.method = 'get'; } // Hook up interceptors middleware var chain = [dispatchRequest, undefined]; var promise = Promise.resolve(config); this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { chain.unshift(interceptor.fulfilled, interceptor.rejected); }); this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { chain.push(interceptor.fulfilled, interceptor.rejected); }); while (chain.length) { promise = promise.then(chain.shift(), chain.shift()); } return promise; }; Axios.prototype.getUri = function getUri(config) { config = mergeConfig(this.defaults, config); return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); }; // Provide aliases for supported request methods utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { /*eslint func-names:0*/ Axios.prototype[method] = function(url, config) { return this.request(mergeConfig(config || {}, { method: method, url: url, data: (config || {}).data })); }; }); utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { /*eslint func-names:0*/ Axios.prototype[method] = function(url, data, config) { return this.request(mergeConfig(config || {}, { method: method, url: url, data: data })); }; }); module.exports = Axios; },{"../helpers/buildURL":19,"./../utils":28,"./InterceptorManager":9,"./dispatchRequest":12,"./mergeConfig":14}],9:[function(require,module,exports){ 'use strict'; var utils = require('./../utils'); function InterceptorManager() { this.handlers = []; } /** * Add a new interceptor to the stack * * @param {Function} fulfilled The function to handle `then` for a `Promise` * @param {Function} rejected The function to handle `reject` for a `Promise` * * @return {Number} An ID used to remove interceptor later */ InterceptorManager.prototype.use = function use(fulfilled, rejected) { this.handlers.push({ fulfilled: fulfilled, rejected: rejected }); return this.handlers.length - 1; }; /** * Remove an interceptor from the stack * * @param {Number} id The ID that was returned by `use` */ InterceptorManager.prototype.eject = function eject(id) { if (this.handlers[id]) { this.handlers[id] = null; } }; /** * Iterate over all the registered interceptors * * This method is particularly useful for skipping over any * interceptors that may have become `null` calling `eject`. * * @param {Function} fn The function to call for each interceptor */ InterceptorManager.prototype.forEach = function forEach(fn) { utils.forEach(this.handlers, function forEachHandler(h) { if (h !== null) { fn(h); } }); }; module.exports = InterceptorManager; },{"./../utils":28}],10:[function(require,module,exports){ 'use strict'; var isAbsoluteURL = require('../helpers/isAbsoluteURL'); var combineURLs = require('../helpers/combineURLs'); /** * Creates a new URL by combining the baseURL with the requestedURL, * only when the requestedURL is not already an absolute URL. * If the requestURL is absolute, this function returns the requestedURL untouched. * * @param {string} baseURL The base URL * @param {string} requestedURL Absolute or relative URL to combine * @returns {string} The combined full path */ module.exports = function buildFullPath(baseURL, requestedURL) { if (baseURL && !isAbsoluteURL(requestedURL)) { return combineURLs(baseURL, requestedURL); } return requestedURL; }; },{"../helpers/combineURLs":20,"../helpers/isAbsoluteURL":22}],11:[function(require,module,exports){ 'use strict'; var enhanceError = require('./enhanceError'); /** * Create an Error with the specified message, config, error code, request and response. * * @param {string} message The error message. * @param {Object} config The config. * @param {string} [code] The error code (for example, 'ECONNABORTED'). * @param {Object} [request] The request. * @param {Object} [response] The response. * @returns {Error} The created error. */ module.exports = function createError(message, config, code, request, response) { var error = new Error(message); return enhanceError(error, config, code, request, response); }; },{"./enhanceError":13}],12:[function(require,module,exports){ 'use strict'; var utils = require('./../utils'); var transformData = require('./transformData'); var isCancel = require('../cancel/isCancel'); var defaults = require('../defaults'); /** * Throws a `Cancel` if cancellation has been requested. */ function throwIfCancellationRequested(config) { if (config.cancelToken) { config.cancelToken.throwIfRequested(); } } /** * Dispatch a request to the server using the configured adapter. * * @param {object} config The config that is to be used for the request * @returns {Promise} The Promise to be fulfilled */ module.exports = function dispatchRequest(config) { throwIfCancellationRequested(config); // Ensure headers exist config.headers = config.headers || {}; // Transform request data config.data = transformData( config.data, config.headers, config.transformRequest ); // Flatten headers config.headers = utils.merge( config.headers.common || {}, config.headers[config.method] || {}, config.headers ); utils.forEach( ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function cleanHeaderConfig(method) { delete config.headers[method]; } ); var adapter = config.adapter || defaults.adapter; return adapter(config).then(function onAdapterResolution(response) { throwIfCancellationRequested(config); // Transform response data response.data = transformData( response.data, response.headers, config.transformResponse ); return response; }, function onAdapterRejection(reason) { if (!isCancel(reason)) { throwIfCancellationRequested(config); // Transform response data if (reason && reason.response) { reason.response.data = transformData( reason.response.data, reason.response.headers, config.transformResponse ); } } return Promise.reject(reason); }); }; },{"../cancel/isCancel":7,"../defaults":17,"./../utils":28,"./transformData":16}],13:[function(require,module,exports){ 'use strict'; /** * Update an Error with the specified config, error code, and response. * * @param {Error} error The error to update. * @param {Object} config The config. * @param {string} [code] The error code (for example, 'ECONNABORTED'). * @param {Object} [request] The request. * @param {Object} [response] The response. * @returns {Error} The error. */ module.exports = function enhanceError(error, config, code, request, response) { error.config = config; if (code) { error.code = code; } error.request = request; error.response = response; error.isAxiosError = true; error.toJSON = function toJSON() { return { // Standard message: this.message, name: this.name, // Microsoft description: this.description, number: this.number, // Mozilla fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, // Axios config: this.config, code: this.code }; }; return error; }; },{}],14:[function(require,module,exports){ 'use strict'; var utils = require('../utils'); /** * Config-specific merge-function which creates a new config-object * by merging two configuration objects together. * * @param {Object} config1 * @param {Object} config2 * @returns {Object} New object resulting from merging config2 to config1 */ module.exports = function mergeConfig(config1, config2) { // eslint-disable-next-line no-param-reassign config2 = config2 || {}; var config = {}; var valueFromConfig2Keys = ['url', 'method', 'data']; var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; var defaultToConfig2Keys = [ 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' ]; var directMergeKeys = ['validateStatus']; function getMergedValue(target, source) { if (utils.isPlainObject(target) && utils.isPlainObject(source)) { return utils.merge(target, source); } else if (utils.isPlainObject(source)) { return utils.merge({}, source); } else if (utils.isArray(source)) { return source.slice(); } return source; } function mergeDeepProperties(prop) { if (!utils.isUndefined(config2[prop])) { config[prop] = getMergedValue(config1[prop], config2[prop]); } else if (!utils.isUndefined(config1[prop])) { config[prop] = getMergedValue(undefined, config1[prop]); } } utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { if (!utils.isUndefined(config2[prop])) { config[prop] = getMergedValue(undefined, config2[prop]); } }); utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { if (!utils.isUndefined(config2[prop])) { config[prop] = getMergedValue(undefined, config2[prop]); } else if (!utils.isUndefined(config1[prop])) { config[prop] = getMergedValue(undefined, config1[prop]); } }); utils.forEach(directMergeKeys, function merge(prop) { if (prop in config2) { config[prop] = getMergedValue(config1[prop], config2[prop]); } else if (prop in config1) { config[prop] = getMergedValue(undefined, config1[prop]); } }); var axiosKeys = valueFromConfig2Keys .concat(mergeDeepPropertiesKeys) .concat(defaultToConfig2Keys) .concat(directMergeKeys); var otherKeys = Object .keys(config1) .concat(Object.keys(config2)) .filter(function filterAxiosKeys(key) { return axiosKeys.indexOf(key) === -1; }); utils.forEach(otherKeys, mergeDeepProperties); return config; }; },{"../utils":28}],15:[function(require,module,exports){ 'use strict'; var createError = require('./createError'); /** * Resolve or reject a Promise based on response status. * * @param {Function} resolve A function that resolves the promise. * @param {Function} reject A function that rejects the promise. * @param {object} response The response. */ module.exports = function settle(resolve, reject, response) { var validateStatus = response.config.validateStatus; if (!response.status || !validateStatus || validateStatus(response.status)) { resolve(response); } else { reject(createError( 'Request failed with status code ' + response.status, response.config, null, response.request, response )); } }; },{"./createError":11}],16:[function(require,module,exports){ 'use strict'; var utils = require('./../utils'); /** * Transform the data for a request or a response * * @param {Object|String} data The data to be transformed * @param {Array} headers The headers for the request or response * @param {Array|Function} fns A single function or Array of functions * @returns {*} The resulting transformed data */ module.exports = function transformData(data, headers, fns) { /*eslint no-param-reassign:0*/ utils.forEach(fns, function transform(fn) { data = fn(data, headers); }); return data; }; },{"./../utils":28}],17:[function(require,module,exports){ (function (process){(function (){ 'use strict'; var utils = require('./utils'); var normalizeHeaderName = require('./helpers/normalizeHeaderName'); var DEFAULT_CONTENT_TYPE = { 'Content-Type': 'application/x-www-form-urlencoded' }; function setContentTypeIfUnset(headers, value) { if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { headers['Content-Type'] = value; } } function getDefaultAdapter() { var adapter; if (typeof XMLHttpRequest !== 'undefined') { // For browsers use XHR adapter adapter = require('./adapters/xhr'); } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { // For node use HTTP adapter adapter = require('./adapters/http'); } return adapter; } var defaults = { adapter: getDefaultAdapter(), transformRequest: [function transformRequest(data, headers) { normalizeHeaderName(headers, 'Accept'); normalizeHeaderName(headers, 'Content-Type'); if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data) ) { return data; } if (utils.isArrayBufferView(data)) { return data.buffer; } if (utils.isURLSearchParams(data)) { setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); return data.toString(); } if (utils.isObject(data)) { setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); return JSON.stringify(data); } return data; }], transformResponse: [function transformResponse(data) { /*eslint no-param-reassign:0*/ if (typeof data === 'string') { try { data = JSON.parse(data); } catch (e) { /* Ignore */ } } return data; }], /** * A timeout in milliseconds to abort a request. If set to 0 (default) a * timeout is not created. */ timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, validateStatus: function validateStatus(status) { return status >= 200 && status < 300; } }; defaults.headers = { common: { 'Accept': 'application/json, text/plain, */*' } }; utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { defaults.headers[method] = {}; }); utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); }); module.exports = defaults; }).call(this)}).call(this,require('_process')) },{"./adapters/http":3,"./adapters/xhr":3,"./helpers/normalizeHeaderName":25,"./utils":28,"_process":96}],18:[function(require,module,exports){ 'use strict'; module.exports = function bind(fn, thisArg) { return function wrap() { var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } return fn.apply(thisArg, args); }; }; },{}],19:[function(require,module,exports){ 'use strict'; var utils = require('./../utils'); function encode(val) { return encodeURIComponent(val). replace(/%3A/gi, ':'). replace(/%24/g, '$'). replace(/%2C/gi, ','). replace(/%20/g, '+'). replace(/%5B/gi, '['). replace(/%5D/gi, ']'); } /** * Build a URL by appending params to the end * * @param {string} url The base of the url (e.g., http://www.google.com) * @param {object} [params] The params to be appended * @returns {string} The formatted url */ module.exports = function buildURL(url, params, paramsSerializer) { /*eslint no-param-reassign:0*/ if (!params) { return url; } var serializedParams; if (paramsSerializer) { serializedParams = paramsSerializer(params); } else if (utils.isURLSearchParams(params)) { serializedParams = params.toString(); } else { var parts = []; utils.forEach(params, function serialize(val, key) { if (val === null || typeof val === 'undefined') { return; } if (utils.isArray(val)) { key = key + '[]'; } else { val = [val]; } utils.forEach(val, function parseValue(v) { if (utils.isDate(v)) { v = v.toISOString(); } else if (utils.isObject(v)) { v = JSON.stringify(v); } parts.push(encode(key) + '=' + encode(v)); }); }); serializedParams = parts.join('&'); } if (serializedParams) { var hashmarkIndex = url.indexOf('#'); if (hashmarkIndex !== -1) { url = url.slice(0, hashmarkIndex); } url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; } return url; }; },{"./../utils":28}],20:[function(require,module,exports){ 'use strict'; /** * Creates a new URL by combining the specified URLs * * @param {string} baseURL The base URL * @param {string} relativeURL The relative URL * @returns {string} The combined URL */ module.exports = function combineURLs(baseURL, relativeURL) { return relativeURL ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; }; },{}],21:[function(require,module,exports){ 'use strict'; var utils = require('./../utils'); module.exports = ( utils.isStandardBrowserEnv() ? // Standard browser envs support document.cookie (function standardBrowserEnv() { return { write: function write(name, value, expires, path, domain, secure) { var cookie = []; cookie.push(name + '=' + encodeURIComponent(value)); if (utils.isNumber(expires)) { cookie.push('expires=' + new Date(expires).toGMTString()); } if (utils.isString(path)) { cookie.push('path=' + path); } if (utils.isString(domain)) { cookie.push('domain=' + domain); } if (secure === true) { cookie.push('secure'); } document.cookie = cookie.join('; '); }, read: function read(name) { var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); return (match ? decodeURIComponent(match[3]) : null); }, remove: function remove(name) { this.write(name, '', Date.now() - 86400000); } }; })() : // Non standard browser env (web workers, react-native) lack needed support. (function nonStandardBrowserEnv() { return { write: function write() {}, read: function read() { return null; }, remove: function remove() {} }; })() ); },{"./../utils":28}],22:[function(require,module,exports){ 'use strict'; /** * Determines whether the specified URL is absolute * * @param {string} url The URL to test * @returns {boolean} True if the specified URL is absolute, otherwise false */ module.exports = function isAbsoluteURL(url) { // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed // by any combination of letters, digits, plus, period, or hyphen. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); }; },{}],23:[function(require,module,exports){ 'use strict'; /** * Determines whether the payload is an error thrown by Axios * * @param {*} payload The value to test * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false */ module.exports = function isAxiosError(payload) { return (typeof payload === 'object') && (payload.isAxiosError === true); }; },{}],24:[function(require,module,exports){ 'use strict'; var utils = require('./../utils'); module.exports = ( utils.isStandardBrowserEnv() ? // Standard browser envs have full support of the APIs needed to test // whether the request URL is of the same origin as current location. (function standardBrowserEnv() { var msie = /(msie|trident)/i.test(navigator.userAgent); var urlParsingNode = document.createElement('a'); var originURL; /** * Parse a URL to discover it's components * * @param {String} url The URL to be parsed * @returns {Object} */ function resolveURL(url) { var href = url; if (msie) { // IE needs attribute set twice to normalize properties urlParsingNode.setAttribute('href', href); href = urlParsingNode.href; } urlParsingNode.setAttribute('href', href); // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils return { href: urlParsingNode.href, protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', host: urlParsingNode.host, search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', hostname: urlParsingNode.hostname, port: urlParsingNode.port, pathname: (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname }; } originURL = resolveURL(window.location.href); /** * Determine if a URL shares the same origin as the current location * * @param {String} requestURL The URL to test * @returns {boolean} True if URL shares the same origin, otherwise false */ return function isURLSameOrigin(requestURL) { var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; return (parsed.protocol === originURL.protocol && parsed.host === originURL.host); }; })() : // Non standard browser envs (web workers, react-native) lack needed support. (function nonStandardBrowserEnv() { return function isURLSameOrigin() { return true; }; })() ); },{"./../utils":28}],25:[function(require,module,exports){ 'use strict'; var utils = require('../utils'); module.exports = function normalizeHeaderName(headers, normalizedName) { utils.forEach(headers, function processHeader(value, name) { if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { headers[normalizedName] = value; delete headers[name]; } }); }; },{"../utils":28}],26:[function(require,module,exports){ 'use strict'; var utils = require('./../utils'); // Headers whose duplicates are ignored by node // c.f. https://nodejs.org/api/http.html#http_message_headers var ignoreDuplicateOf = [ 'age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent' ]; /** * Parse headers into an object * * ``` * Date: Wed, 27 Aug 2014 08:58:49 GMT * Content-Type: application/json * Connection: keep-alive * Transfer-Encoding: chunked * ``` * * @param {String} headers Headers needing to be parsed * @returns {Object} Headers parsed into an object */ module.exports = function parseHeaders(headers) { var parsed = {}; var key; var val; var i; if (!headers) { return parsed; } utils.forEach(headers.split('\n'), function parser(line) { i = line.indexOf(':'); key = utils.trim(line.substr(0, i)).toLowerCase(); val = utils.trim(line.substr(i + 1)); if (key) { if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { return; } if (key === 'set-cookie') { parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); } else { parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; } } }); return parsed; }; },{"./../utils":28}],27:[function(require,module,exports){ 'use strict'; /** * Syntactic sugar for invoking a function and expanding an array for arguments. * * Common use case would be to use `Function.prototype.apply`. * * ```js * function f(x, y, z) {} * var args = [1, 2, 3]; * f.apply(null, args); * ``` * * With `spread` this example can be re-written. * * ```js * spread(function(x, y, z) {})([1, 2, 3]); * ``` * * @param {Function} callback * @returns {Function} */ module.exports = function spread(callback) { return function wrap(arr) { return callback.apply(null, arr); }; }; },{}],28:[function(require,module,exports){ 'use strict'; var bind = require('./helpers/bind'); /*global toString:true*/ // utils is a library of generic helper functions non-specific to axios var toString = Object.prototype.toString; /** * Determine if a value is an Array * * @param {Object} val The value to test * @returns {boolean} True if value is an Array, otherwise false */ function isArray(val) { return toString.call(val) === '[object Array]'; } /** * Determine if a value is undefined * * @param {Object} val The value to test * @returns {boolean} True if the value is undefined, otherwise false */ function isUndefined(val) { return typeof val === 'undefined'; } /** * Determine if a value is a Buffer * * @param {Object} val The value to test * @returns {boolean} True if value is a Buffer, otherwise false */ function isBuffer(val) { return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); } /** * Determine if a value is an ArrayBuffer * * @param {Object} val The value to test * @returns {boolean} True if value is an ArrayBuffer, otherwise false */ function isArrayBuffer(val) { return toString.call(val) === '[object ArrayBuffer]'; } /** * Determine if a value is a FormData * * @param {Object} val The value to test * @returns {boolean} True if value is an FormData, otherwise false */ function isFormData(val) { return (typeof FormData !== 'undefined') && (val instanceof FormData); } /** * Determine if a value is a view on an ArrayBuffer * * @param {Object} val The value to test * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false */ function isArrayBufferView(val) { var result; if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { result = ArrayBuffer.isView(val); } else { result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); } return result; } /** * Determine if a value is a String * * @param {Object} val The value to test * @returns {boolean} True if value is a String, otherwise false */ function isString(val) { return typeof val === 'string'; } /** * Determine if a value is a Number * * @param {Object} val The value to test * @returns {boolean} True if value is a Number, otherwise false */ function isNumber(val) { return typeof val === 'number'; } /** * Determine if a value is an Object * * @param {Object} val The value to test * @returns {boolean} True if value is an Object, otherwise false */ function isObject(val) { return val !== null && typeof val === 'object'; } /** * Determine if a value is a plain Object * * @param {Object} val The value to test * @return {boolean} True if value is a plain Object, otherwise false */ function isPlainObject(val) { if (toString.call(val) !== '[object Object]') { return false; } var prototype = Object.getPrototypeOf(val); return prototype === null || prototype === Object.prototype; } /** * Determine if a value is a Date * * @param {Object} val The value to test * @returns {boolean} True if value is a Date, otherwise false */ function isDate(val) { return toString.call(val) === '[object Date]'; } /** * Determine if a value is a File * * @param {Object} val The value to test * @returns {boolean} True if value is a File, otherwise false */ function isFile(val) { return toString.call(val) === '[object File]'; } /** * Determine if a value is a Blob * * @param {Object} val The value to test * @returns {boolean} True if value is a Blob, otherwise false */ function isBlob(val) { return toString.call(val) === '[object Blob]'; } /** * Determine if a value is a Function * * @param {Object} val The value to test * @returns {boolean} True if value is a Function, otherwise false */ function isFunction(val) { return toString.call(val) === '[object Function]'; } /** * Determine if a value is a Stream * * @param {Object} val The value to test * @returns {boolean} True if value is a Stream, otherwise false */ function isStream(val) { return isObject(val) && isFunction(val.pipe); } /** * Determine if a value is a URLSearchParams object * * @param {Object} val The value to test * @returns {boolean} True if value is a URLSearchParams object, otherwise false */ function isURLSearchParams(val) { return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; } /** * Trim excess whitespace off the beginning and end of a string * * @param {String} str The String to trim * @returns {String} The String freed of excess whitespace */ function trim(str) { return str.replace(/^\s*/, '').replace(/\s*$/, ''); } /** * Determine if we're running in a standard browser environment * * This allows axios to run in a web worker, and react-native. * Both environments support XMLHttpRequest, but not fully standard globals. * * web workers: * typeof window -> undefined * typeof document -> undefined * * react-native: * navigator.product -> 'ReactNative' * nativescript * navigator.product -> 'NativeScript' or 'NS' */ function isStandardBrowserEnv() { if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) { return false; } return ( typeof window !== 'undefined' && typeof document !== 'undefined' ); } /** * Iterate over an Array or an Object invoking a function for each item. * * If `obj` is an Array callback will be called passing * the value, index, and complete array for each item. * * If 'obj' is an Object callback will be called passing * the value, key, and complete object for each property. * * @param {Object|Array} obj The object to iterate * @param {Function} fn The callback to invoke for each item */ function forEach(obj, fn) { // Don't bother if no value provided if (obj === null || typeof obj === 'undefined') { return; } // Force an array if not already something iterable if (typeof obj !== 'object') { /*eslint no-param-reassign:0*/ obj = [obj]; } if (isArray(obj)) { // Iterate over array values for (var i = 0, l = obj.length; i < l; i++) { fn.call(null, obj[i], i, obj); } } else { // Iterate over object keys for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { fn.call(null, obj[key], key, obj); } } } } /** * Accepts varargs expecting each argument to be an object, then * immutably merges the properties of each object and returns result. * * When multiple objects contain the same key the later object in * the arguments list will take precedence. * * Example: * * ```js * var result = merge({foo: 123}, {foo: 456}); * console.log(result.foo); // outputs 456 * ``` * * @param {Object} obj1 Object to merge * @returns {Object} Result of all merge properties */ function merge(/* obj1, obj2, obj3, ... */) { var result = {}; function assignValue(val, key) { if (isPlainObject(result[key]) && isPlainObject(val)) { result[key] = merge(result[key], val); } else if (isPlainObject(val)) { result[key] = merge({}, val); } else if (isArray(val)) { result[key] = val.slice(); } else { result[key] = val; } } for (var i = 0, l = arguments.length; i < l; i++) { forEach(arguments[i], assignValue); } return result; } /** * Extends object a by mutably adding to it the properties of object b. * * @param {Object} a The object to be extended * @param {Object} b The object to copy properties from * @param {Object} thisArg The object to bind function to * @return {Object} The resulting value of object a */ function extend(a, b, thisArg) { forEach(b, function assignValue(val, key) { if (thisArg && typeof val === 'function') { a[key] = bind(val, thisArg); } else { a[key] = val; } }); return a; } /** * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) * * @param {string} content with BOM * @return {string} content value without BOM */ function stripBOM(content) { if (content.charCodeAt(0) === 0xFEFF) { content = content.slice(1); } return content; } module.exports = { isArray: isArray, isArrayBuffer: isArrayBuffer, isBuffer: isBuffer, isFormData: isFormData, isArrayBufferView: isArrayBufferView, isString: isString, isNumber: isNumber, isObject: isObject, isPlainObject: isPlainObject, isUndefined: isUndefined, isDate: isDate, isFile: isFile, isBlob: isBlob, isFunction: isFunction, isStream: isStream, isURLSearchParams: isURLSearchParams, isStandardBrowserEnv: isStandardBrowserEnv, forEach: forEach, merge: merge, extend: extend, trim: trim, stripBOM: stripBOM }; },{"./helpers/bind":18}],29:[function(require,module,exports){ function jBoxWrapper(b){function h(t,i){return this.options={id:null,width:"auto",height:"auto",minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,responsiveWidth:!0,responsiveHeight:!0,responsiveMinWidth:100,responsiveMinHeight:100,attach:null,trigger:"click",preventDefault:!1,content:null,getContent:null,title:null,getTitle:null,footer:null,isolateScroll:!0,ajax:{url:null,data:"",reload:!1,getURL:"data-url",getData:"data-ajax",setContent:!0,loadingClass:!0,spinner:!0,spinnerDelay:300,spinnerReposition:!0},cancelAjaxOnClose:!0,target:null,position:{x:"center",y:"center"},outside:null,offset:0,attributes:{x:"left",y:"top"},fixed:!1,adjustPosition:!0,adjustTracker:!1,adjustDistance:5,reposition:!0,repositionOnOpen:!0,repositionOnContent:!0,holdPosition:!0,pointer:!1,pointTo:"target",fade:180,animation:null,theme:"Default",addClass:null,overlay:!1,overlayClass:null,zIndex:1e4,delayOpen:0,delayClose:0,closeOnEsc:!1,closeOnClick:!1,closeOnMouseleave:!1,closeButton:!1,appendTo:b("body"),createOnInit:!1,blockScroll:!1,blockScrollAdjust:!0,draggable:!1,dragOver:!0,autoClose:!1,delayOnHover:!1,showCountdown:!1,preloadAudio:!0,audio:null,volume:100,onInit:null,onAttach:null,onPosition:null,onCreated:null,onOpen:null,onClose:null,onCloseComplete:null,onDragStart:null,onDragEnd:null},this._pluginOptions={Tooltip:{getContent:"title",trigger:"mouseenter",position:{x:"center",y:"top"},outside:"y",pointer:!0},Mouse:{responsiveWidth:!1,responsiveHeight:!1,adjustPosition:"flip",target:"mouse",trigger:"mouseenter",position:{x:"right",y:"bottom"},outside:"xy",offset:5},Modal:{target:b(window),fixed:!0,blockScroll:!0,closeOnEsc:!0,closeOnClick:"overlay",closeButton:!0,overlay:!0,animation:"zoomIn"}},this.options=b.extend(!0,this.options,this._pluginOptions[t]||h._pluginOptions[t],i),"string"==b.type(t)&&(this.type=t),this.isTouchDevice=function(){var t=" -webkit- -moz- -o- -ms- ".split(" ");if("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)return!0;var i,t=["(",t.join("touch-enabled),("),"heartz",")"].join("");return i=t,window.matchMedia(i).matches}(),this.isTouchDevice&&"mouseenter"===this.options.trigger&&!1===this.options.closeOnClick&&(this.options.closeOnClick="body"),this._fireEvent=function(t,i){this.options["_"+t]&&this.options["_"+t].bind(this)(i),this.options[t]&&this.options[t].bind(this)(i)},null===this.options.id&&(this.options.id="jBox"+h._getUniqueID()),this.id=this.options.id,("center"==this.options.position.x&&"x"==this.options.outside||"center"==this.options.position.y&&"y"==this.options.outside)&&(this.options.outside=null),"target"!=this.options.pointTo||this.options.outside&&"xy"!=this.options.outside||(this.options.pointer=!1),"object"!=b.type(this.options.offset)?this.options.offset={x:this.options.offset,y:this.options.offset}:this.options.offset=b.extend({x:0,y:0},this.options.offset),"object"!=b.type(this.options.adjustDistance)?this.options.adjustDistance={top:this.options.adjustDistance,right:this.options.adjustDistance,bottom:this.options.adjustDistance,left:this.options.adjustDistance}:this.options.adjustDistance=b.extend({top:5,left:5,right:5,bottom:5},this.options.adjustDistance),this.outside=!(!this.options.outside||"xy"==this.options.outside)&&this.options.position[this.options.outside],this.align=this.outside||("center"!=this.options.position.y&&"number"!=b.type(this.options.position.y)?this.options.position.x:"center"!=this.options.position.x&&"number"!=b.type(this.options.position.x)?this.options.position.y:this.options.attributes.x),h.zIndexMax=Math.max(h.zIndexMax||0,"auto"===this.options.zIndex?1e4:this.options.zIndex),"auto"===this.options.zIndex&&(this.adjustZIndexOnOpen=!0,h.zIndexMax+=2,this.options.zIndex=h.zIndexMax,this.trueModal=this.options.overlay),this._getOpp=function(t){return{left:"right",right:"left",top:"bottom",bottom:"top",x:"y",y:"x"}[t]},this._getXY=function(t){return{left:"x",right:"x",top:"y",bottom:"y",center:"x"}[t]},this._getTL=function(t){return{left:"left",right:"left",top:"top",bottom:"top",center:"left",x:"left",y:"top"}[t]},this._getInt=function(t,i){return"auto"==t?"auto":t&&"string"==b.type(t)&&"%"==t.slice(-1)?b(window)["height"==i?"innerHeight":"innerWidth"]()*parseInt(t.replace("%",""))/100:t},this._createSVG=function(t,i){var o=document.createElementNS("http://www.w3.org/2000/svg",t);return b.each(i,function(t,i){o.setAttribute(i[0],i[1]||"")}),o},this._isolateScroll=function(e){e&&e.length&&e.on("DOMMouseScroll.jBoxIsolateScroll mousewheel.jBoxIsolateScroll",function(t){var i=t.wheelDelta||t.originalEvent&&t.originalEvent.wheelDelta||-t.detail,o=0<=this.scrollTop+e.outerHeight()-this.scrollHeight,s=this.scrollTop<=0;(i<0&&o||0",{id:this.id,class:"jBox-wrapper"+(this.type?" jBox-"+this.type:"")+(this.options.theme?" jBox-"+this.options.theme:"")+(this.options.addClass?" "+this.options.addClass:"")}).css({position:this.options.fixed?"fixed":"absolute",display:"none",opacity:0,zIndex:this.options.zIndex}).data("jBox",this),this.options.closeOnMouseleave&&this.wrapper.on("mouseleave",function(t){!this.source||t.relatedTarget!=this.source[0]&&-1===b.inArray(this.source[0],b(t.relatedTarget).parents("*"))&&this.close()}.bind(this)),"box"==this.options.closeOnClick&&this.wrapper.on("click tap",function(){this.close({ignoreDelay:!0})}.bind(this)),this.container=b('
').appendTo(this.wrapper),this.content=b('
').appendTo(this.container),this.options.footer&&(this.footer=b('