diff --git a/dist/authing-js-sdk-browser.js b/dist/authing-js-sdk-browser.js index c7e1ee5ef..cb2d65f88 100644 --- a/dist/authing-js-sdk-browser.js +++ b/dist/authing-js-sdk-browser.js @@ -96,396 +96,396 @@ return /******/ (function(modules) { // webpackBootstrap /************************************************************************/ /******/ ({ -/***/ "./node_modules/axios/index.js": -/*!*************************************!*\ - !*** ./node_modules/axios/index.js ***! - \*************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/index.js": +/*!***************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/index.js ***! + \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("module.exports = __webpack_require__(/*! ./lib/axios */ \"./node_modules/axios/lib/axios.js\");\n\n//# sourceURL=webpack://Authing/./node_modules/axios/index.js?"); +eval("module.exports = __webpack_require__(/*! ./lib/axios */ \"./node_modules/_axios@0.18.0@axios/lib/axios.js\");\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/index.js?"); /***/ }), -/***/ "./node_modules/axios/lib/adapters/xhr.js": -/*!************************************************!*\ - !*** ./node_modules/axios/lib/adapters/xhr.js ***! - \************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/adapters/xhr.js": +/*!**************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/adapters/xhr.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\nvar settle = __webpack_require__(/*! ./../core/settle */ \"./node_modules/axios/lib/core/settle.js\");\nvar buildURL = __webpack_require__(/*! ./../helpers/buildURL */ \"./node_modules/axios/lib/helpers/buildURL.js\");\nvar parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ \"./node_modules/axios/lib/helpers/parseHeaders.js\");\nvar isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ \"./node_modules/axios/lib/helpers/isURLSameOrigin.js\");\nvar createError = __webpack_require__(/*! ../core/createError */ \"./node_modules/axios/lib/core/createError.js\");\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = __webpack_require__(/*! ./../helpers/cookies */ \"./node_modules/axios/lib/helpers/cookies.js\");\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/adapters/xhr.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\nvar settle = __webpack_require__(/*! ./../core/settle */ \"./node_modules/_axios@0.18.0@axios/lib/core/settle.js\");\nvar buildURL = __webpack_require__(/*! ./../helpers/buildURL */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/buildURL.js\");\nvar parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/parseHeaders.js\");\nvar isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/isURLSameOrigin.js\");\nvar createError = __webpack_require__(/*! ../core/createError */ \"./node_modules/_axios@0.18.0@axios/lib/core/createError.js\");\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || __webpack_require__(/*! ./../helpers/btoa */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/btoa.js\");\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n // Only supports POST and GET calls and doesn't returns the response headers.\n // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n if ( true &&\n typeof window !== 'undefined' &&\n window.XDomainRequest && !('withCredentials' in request) &&\n !isURLSameOrigin(config.url)) {\n request = new window.XDomainRequest();\n loadEvent = 'onload';\n xDomain = true;\n request.onprogress = function handleProgress() {};\n request.ontimeout = function handleTimeout() {};\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleLoad() {\n if (!request || (request.readyState !== 4 && !xDomain)) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201)\n status: request.status === 1223 ? 204 : request.status,\n statusText: request.status === 1223 ? 'No Content' : request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = __webpack_require__(/*! ./../helpers/cookies */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/cookies.js\");\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/adapters/xhr.js?"); /***/ }), -/***/ "./node_modules/axios/lib/axios.js": -/*!*****************************************!*\ - !*** ./node_modules/axios/lib/axios.js ***! - \*****************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/axios.js": +/*!*******************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/axios.js ***! + \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/axios/lib/utils.js\");\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"./node_modules/axios/lib/helpers/bind.js\");\nvar Axios = __webpack_require__(/*! ./core/Axios */ \"./node_modules/axios/lib/core/Axios.js\");\nvar mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ \"./node_modules/axios/lib/core/mergeConfig.js\");\nvar defaults = __webpack_require__(/*! ./defaults */ \"./node_modules/axios/lib/defaults.js\");\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ \"./node_modules/axios/lib/cancel/Cancel.js\");\naxios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ \"./node_modules/axios/lib/cancel/CancelToken.js\");\naxios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ \"./node_modules/axios/lib/cancel/isCancel.js\");\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = __webpack_require__(/*! ./helpers/spread */ \"./node_modules/axios/lib/helpers/spread.js\");\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/axios.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/bind.js\");\nvar Axios = __webpack_require__(/*! ./core/Axios */ \"./node_modules/_axios@0.18.0@axios/lib/core/Axios.js\");\nvar defaults = __webpack_require__(/*! ./defaults */ \"./node_modules/_axios@0.18.0@axios/lib/defaults.js\");\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ \"./node_modules/_axios@0.18.0@axios/lib/cancel/Cancel.js\");\naxios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ \"./node_modules/_axios@0.18.0@axios/lib/cancel/CancelToken.js\");\naxios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ \"./node_modules/_axios@0.18.0@axios/lib/cancel/isCancel.js\");\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = __webpack_require__(/*! ./helpers/spread */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/spread.js\");\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/axios.js?"); /***/ }), -/***/ "./node_modules/axios/lib/cancel/Cancel.js": -/*!*************************************************!*\ - !*** ./node_modules/axios/lib/cancel/Cancel.js ***! - \*************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/cancel/Cancel.js": +/*!***************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/cancel/Cancel.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/cancel/Cancel.js?"); +eval("\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/cancel/Cancel.js?"); /***/ }), -/***/ "./node_modules/axios/lib/cancel/CancelToken.js": -/*!******************************************************!*\ - !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! - \******************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/cancel/CancelToken.js": +/*!********************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/cancel/CancelToken.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar Cancel = __webpack_require__(/*! ./Cancel */ \"./node_modules/axios/lib/cancel/Cancel.js\");\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/cancel/CancelToken.js?"); +eval("\n\nvar Cancel = __webpack_require__(/*! ./Cancel */ \"./node_modules/_axios@0.18.0@axios/lib/cancel/Cancel.js\");\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/cancel/CancelToken.js?"); /***/ }), -/***/ "./node_modules/axios/lib/cancel/isCancel.js": -/*!***************************************************!*\ - !*** ./node_modules/axios/lib/cancel/isCancel.js ***! - \***************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/cancel/isCancel.js": +/*!*****************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/cancel/isCancel.js ***! + \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/cancel/isCancel.js?"); +eval("\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/cancel/isCancel.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/Axios.js": -/*!**********************************************!*\ - !*** ./node_modules/axios/lib/core/Axios.js ***! - \**********************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/Axios.js": +/*!************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/Axios.js ***! + \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\nvar buildURL = __webpack_require__(/*! ../helpers/buildURL */ \"./node_modules/axios/lib/helpers/buildURL.js\");\nvar InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ \"./node_modules/axios/lib/core/InterceptorManager.js\");\nvar dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ \"./node_modules/axios/lib/core/dispatchRequest.js\");\nvar mergeConfig = __webpack_require__(/*! ./mergeConfig */ \"./node_modules/axios/lib/core/mergeConfig.js\");\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n config.method = config.method ? config.method.toLowerCase() : 'get';\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/core/Axios.js?"); +eval("\n\nvar defaults = __webpack_require__(/*! ./../defaults */ \"./node_modules/_axios@0.18.0@axios/lib/defaults.js\");\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\nvar InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ \"./node_modules/_axios@0.18.0@axios/lib/core/InterceptorManager.js\");\nvar dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ \"./node_modules/_axios@0.18.0@axios/lib/core/dispatchRequest.js\");\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, {method: 'get'}, this.defaults, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/core/Axios.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/InterceptorManager.js": -/*!***********************************************************!*\ - !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! - \***********************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/InterceptorManager.js": +/*!*************************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/InterceptorManager.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/core/InterceptorManager.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/core/InterceptorManager.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/createError.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/core/createError.js ***! - \****************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/createError.js": +/*!******************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/createError.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar enhanceError = __webpack_require__(/*! ./enhanceError */ \"./node_modules/axios/lib/core/enhanceError.js\");\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/core/createError.js?"); +eval("\n\nvar enhanceError = __webpack_require__(/*! ./enhanceError */ \"./node_modules/_axios@0.18.0@axios/lib/core/enhanceError.js\");\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/core/createError.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/dispatchRequest.js": -/*!********************************************************!*\ - !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! - \********************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/dispatchRequest.js": +/*!**********************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/dispatchRequest.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\nvar transformData = __webpack_require__(/*! ./transformData */ \"./node_modules/axios/lib/core/transformData.js\");\nvar isCancel = __webpack_require__(/*! ../cancel/isCancel */ \"./node_modules/axios/lib/cancel/isCancel.js\");\nvar defaults = __webpack_require__(/*! ../defaults */ \"./node_modules/axios/lib/defaults.js\");\nvar isAbsoluteURL = __webpack_require__(/*! ./../helpers/isAbsoluteURL */ \"./node_modules/axios/lib/helpers/isAbsoluteURL.js\");\nvar combineURLs = __webpack_require__(/*! ./../helpers/combineURLs */ \"./node_modules/axios/lib/helpers/combineURLs.js\");\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/core/dispatchRequest.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\nvar transformData = __webpack_require__(/*! ./transformData */ \"./node_modules/_axios@0.18.0@axios/lib/core/transformData.js\");\nvar isCancel = __webpack_require__(/*! ../cancel/isCancel */ \"./node_modules/_axios@0.18.0@axios/lib/cancel/isCancel.js\");\nvar defaults = __webpack_require__(/*! ../defaults */ \"./node_modules/_axios@0.18.0@axios/lib/defaults.js\");\nvar isAbsoluteURL = __webpack_require__(/*! ./../helpers/isAbsoluteURL */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/isAbsoluteURL.js\");\nvar combineURLs = __webpack_require__(/*! ./../helpers/combineURLs */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/combineURLs.js\");\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/core/dispatchRequest.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/enhanceError.js": -/*!*****************************************************!*\ - !*** ./node_modules/axios/lib/core/enhanceError.js ***! - \*****************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/enhanceError.js": +/*!*******************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/enhanceError.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/core/enhanceError.js?"); +eval("\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/core/enhanceError.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/mergeConfig.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/core/mergeConfig.js ***! - \****************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/settle.js": +/*!*************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/settle.js ***! + \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/axios/lib/utils.js\");\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n utils.forEach(['url', 'method', 'params', 'data'], function valueFromConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n }\n });\n\n utils.forEach(['headers', 'auth', 'proxy'], function mergeDeepProperties(prop) {\n if (utils.isObject(config2[prop])) {\n config[prop] = utils.deepMerge(config1[prop], config2[prop]);\n } else if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (utils.isObject(config1[prop])) {\n config[prop] = utils.deepMerge(config1[prop]);\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n\n utils.forEach([\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength',\n 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken',\n 'socketPath'\n ], function defaultToConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n\n return config;\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/core/mergeConfig.js?"); +eval("\n\nvar createError = __webpack_require__(/*! ./createError */ \"./node_modules/_axios@0.18.0@axios/lib/core/createError.js\");\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/core/settle.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/settle.js": -/*!***********************************************!*\ - !*** ./node_modules/axios/lib/core/settle.js ***! - \***********************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/transformData.js": +/*!********************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/transformData.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar createError = __webpack_require__(/*! ./createError */ \"./node_modules/axios/lib/core/createError.js\");\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/core/settle.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/core/transformData.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/transformData.js": -/*!******************************************************!*\ - !*** ./node_modules/axios/lib/core/transformData.js ***! - \******************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/defaults.js": +/*!**********************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/defaults.js ***! + \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/core/transformData.js?"); +eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\nvar normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/normalizeHeaderName.js\");\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = __webpack_require__(/*! ./adapters/xhr */ \"./node_modules/_axios@0.18.0@axios/lib/adapters/xhr.js\");\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = __webpack_require__(/*! ./adapters/http */ \"./node_modules/_axios@0.18.0@axios/lib/adapters/xhr.js\");\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../_process@0.11.10@process/browser.js */ \"./node_modules/_process@0.11.10@process/browser.js\")))\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/defaults.js?"); /***/ }), -/***/ "./node_modules/axios/lib/defaults.js": -/*!********************************************!*\ - !*** ./node_modules/axios/lib/defaults.js ***! - \********************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/bind.js": +/*!**************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/bind.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/axios/lib/utils.js\");\nvar normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ \"./node_modules/axios/lib/helpers/normalizeHeaderName.js\");\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n // Only Node.JS has a process variable that is of [[Class]] process\n if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = __webpack_require__(/*! ./adapters/http */ \"./node_modules/axios/lib/adapters/xhr.js\");\n } else if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = __webpack_require__(/*! ./adapters/xhr */ \"./node_modules/axios/lib/adapters/xhr.js\");\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/defaults.js?"); +eval("\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/helpers/bind.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/bind.js": -/*!************************************************!*\ - !*** ./node_modules/axios/lib/helpers/bind.js ***! - \************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/btoa.js": +/*!**************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/btoa.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/helpers/bind.js?"); +eval("\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new E();\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/helpers/btoa.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/buildURL.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/helpers/buildURL.js ***! - \****************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/buildURL.js": +/*!******************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/buildURL.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/helpers/buildURL.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/helpers/buildURL.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/combineURLs.js": -/*!*******************************************************!*\ - !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! - \*******************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/combineURLs.js": +/*!*********************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/combineURLs.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/helpers/combineURLs.js?"); +eval("\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/helpers/combineURLs.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/cookies.js": -/*!***************************************************!*\ - !*** ./node_modules/axios/lib/helpers/cookies.js ***! - \***************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/cookies.js": +/*!*****************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/cookies.js ***! + \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/helpers/cookies.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/helpers/cookies.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": -/*!*********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! - \*********************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/isAbsoluteURL.js": +/*!***********************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/isAbsoluteURL.js ***! + \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/helpers/isAbsoluteURL.js?"); +eval("\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/helpers/isAbsoluteURL.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": -/*!***********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! - \***********************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/isURLSameOrigin.js": +/*!*************************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/isURLSameOrigin.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/helpers/isURLSameOrigin.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/helpers/isURLSameOrigin.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js": -/*!***************************************************************!*\ - !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***! - \***************************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/normalizeHeaderName.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/normalizeHeaderName.js ***! + \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/axios/lib/utils.js\");\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/helpers/normalizeHeaderName.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/helpers/normalizeHeaderName.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": -/*!********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! - \********************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/parseHeaders.js": +/*!**********************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/parseHeaders.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/helpers/parseHeaders.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/helpers/parseHeaders.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/spread.js": -/*!**************************************************!*\ - !*** ./node_modules/axios/lib/helpers/spread.js ***! - \**************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/spread.js": +/*!****************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/spread.js ***! + \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/helpers/spread.js?"); +eval("\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/helpers/spread.js?"); /***/ }), -/***/ "./node_modules/axios/lib/utils.js": -/*!*****************************************!*\ - !*** ./node_modules/axios/lib/utils.js ***! - \*****************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/utils.js": +/*!*******************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/utils.js ***! + \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"./node_modules/axios/lib/helpers/bind.js\");\nvar isBuffer = __webpack_require__(/*! is-buffer */ \"./node_modules/axios/node_modules/is-buffer/index.js\");\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Function equal to merge with the difference being that no reference\n * to original objects is kept.\n *\n * @see merge\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction deepMerge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = deepMerge(result[key], val);\n } else if (typeof val === 'object') {\n result[key] = deepMerge({}, val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n deepMerge: deepMerge,\n extend: extend,\n trim: trim\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/lib/utils.js?"); +eval("\n\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/bind.js\");\nvar isBuffer = __webpack_require__(/*! is-buffer */ \"./node_modules/_is-buffer@1.1.6@is-buffer/index.js\");\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_axios@0.18.0@axios/lib/utils.js?"); /***/ }), -/***/ "./node_modules/axios/node_modules/is-buffer/index.js": -/*!************************************************************!*\ - !*** ./node_modules/axios/node_modules/is-buffer/index.js ***! - \************************************************************/ +/***/ "./node_modules/_base64-js@1.3.0@base64-js/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/_base64-js@1.3.0@base64-js/index.js ***! + \**********************************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\nmodule.exports = function isBuffer (obj) {\n return obj != null && obj.constructor != null &&\n typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n\n//# sourceURL=webpack://Authing/./node_modules/axios/node_modules/is-buffer/index.js?"); +"use strict"; +eval("\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n for (var i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n\n\n//# sourceURL=webpack://Authing/./node_modules/_base64-js@1.3.0@base64-js/index.js?"); /***/ }), -/***/ "./node_modules/base64-js/index.js": -/*!*****************************************!*\ - !*** ./node_modules/base64-js/index.js ***! - \*****************************************/ +/***/ "./node_modules/_buffer@4.9.1@buffer/index.js": +/*!****************************************************!*\ + !*** ./node_modules/_buffer@4.9.1@buffer/index.js ***! + \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n for (var i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n\n\n//# sourceURL=webpack://Authing/./node_modules/base64-js/index.js?"); +eval("/* WEBPACK VAR INJECTION */(function(global) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nvar base64 = __webpack_require__(/*! base64-js */ \"./node_modules/_base64-js@1.3.0@base64-js/index.js\")\nvar ieee754 = __webpack_require__(/*! ieee754 */ \"./node_modules/_ieee754@1.1.13@ieee754/index.js\")\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/_isarray@1.0.0@isarray/index.js\")\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../_webpack@4.30.0@webpack/buildin/global.js */ \"./node_modules/_webpack@4.30.0@webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://Authing/./node_modules/_buffer@4.9.1@buffer/index.js?"); /***/ }), -/***/ "./node_modules/buffer/index.js": -/*!**************************************!*\ - !*** ./node_modules/buffer/index.js ***! - \**************************************/ +/***/ "./node_modules/_ieee754@1.1.13@ieee754/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/_ieee754@1.1.13@ieee754/index.js ***! + \*******************************************************/ /*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { -"use strict"; -eval("/* WEBPACK VAR INJECTION */(function(global) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nvar base64 = __webpack_require__(/*! base64-js */ \"./node_modules/base64-js/index.js\")\nvar ieee754 = __webpack_require__(/*! ieee754 */ \"./node_modules/ieee754/index.js\")\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\")\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://Authing/./node_modules/buffer/index.js?"); +eval("exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n//# sourceURL=webpack://Authing/./node_modules/_ieee754@1.1.13@ieee754/index.js?"); /***/ }), -/***/ "./node_modules/ieee754/index.js": -/*!***************************************!*\ - !*** ./node_modules/ieee754/index.js ***! - \***************************************/ +/***/ "./node_modules/_is-buffer@1.1.6@is-buffer/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/_is-buffer@1.1.6@is-buffer/index.js ***! + \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { -eval("exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n//# sourceURL=webpack://Authing/./node_modules/ieee754/index.js?"); +eval("/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n\n\n//# sourceURL=webpack://Authing/./node_modules/_is-buffer@1.1.6@is-buffer/index.js?"); /***/ }), -/***/ "./node_modules/isarray/index.js": -/*!***************************************!*\ - !*** ./node_modules/isarray/index.js ***! - \***************************************/ +/***/ "./node_modules/_isarray@1.0.0@isarray/index.js": +/*!******************************************************!*\ + !*** ./node_modules/_isarray@1.0.0@isarray/index.js ***! + \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { -eval("var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/isarray/index.js?"); +eval("var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n\n\n//# sourceURL=webpack://Authing/./node_modules/_isarray@1.0.0@isarray/index.js?"); /***/ }), -/***/ "./node_modules/js-sha1/src/sha1.js": -/*!******************************************!*\ - !*** ./node_modules/js-sha1/src/sha1.js ***! - \******************************************/ +/***/ "./node_modules/_js-sha1@0.6.0@js-sha1/src/sha1.js": +/*!*********************************************************!*\ + !*** ./node_modules/_js-sha1@0.6.0@js-sha1/src/sha1.js ***! + \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("/* WEBPACK VAR INJECTION */(function(process, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*\n * [js-sha1]{@link https://github.com/emn178/js-sha1}\n *\n * @version 0.6.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2014-2017\n * @license MIT\n */\n/*jslint bitwise: true */\n(function() {\n 'use strict';\n\n var root = typeof window === 'object' ? window : {};\n var NODE_JS = !root.JS_SHA1_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n }\n var COMMON_JS = !root.JS_SHA1_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = true && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\");\n var HEX_CHARS = '0123456789abcdef'.split('');\n var EXTRA = [-2147483648, 8388608, 32768, 128];\n var SHIFT = [24, 16, 8, 0];\n var OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer'];\n\n var blocks = [];\n\n var createOutputMethod = function (outputType) {\n return function (message) {\n return new Sha1(true).update(message)[outputType]();\n };\n };\n\n var createMethod = function () {\n var method = createOutputMethod('hex');\n if (NODE_JS) {\n method = nodeWrap(method);\n }\n method.create = function () {\n return new Sha1();\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createOutputMethod(type);\n }\n return method;\n };\n\n var nodeWrap = function (method) {\n var crypto = eval(\"require('crypto')\");\n var Buffer = eval(\"require('buffer').Buffer\");\n var nodeMethod = function (message) {\n if (typeof message === 'string') {\n return crypto.createHash('sha1').update(message, 'utf8').digest('hex');\n } else if (message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (message.length === undefined) {\n return method(message);\n }\n return crypto.createHash('sha1').update(new Buffer(message)).digest('hex');\n };\n return nodeMethod;\n };\n\n function Sha1(sharedMemory) {\n if (sharedMemory) {\n blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n this.blocks = blocks;\n } else {\n this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n }\n\n this.h0 = 0x67452301;\n this.h1 = 0xEFCDAB89;\n this.h2 = 0x98BADCFE;\n this.h3 = 0x10325476;\n this.h4 = 0xC3D2E1F0;\n\n this.block = this.start = this.bytes = this.hBytes = 0;\n this.finalized = this.hashed = false;\n this.first = true;\n }\n\n Sha1.prototype.update = function (message) {\n if (this.finalized) {\n return;\n }\n var notString = typeof(message) !== 'string';\n if (notString && message.constructor === root.ArrayBuffer) {\n message = new Uint8Array(message);\n }\n var code, index = 0, i, length = message.length || 0, blocks = this.blocks;\n\n while (index < length) {\n if (this.hashed) {\n this.hashed = false;\n blocks[0] = this.block;\n blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n\n if(notString) {\n for (i = this.start; index < length && i < 64; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < 64; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n\n this.lastByteIndex = i;\n this.bytes += i - this.start;\n if (i >= 64) {\n this.block = blocks[16];\n this.start = i - 64;\n this.hash();\n this.hashed = true;\n } else {\n this.start = i;\n }\n }\n if (this.bytes > 4294967295) {\n this.hBytes += this.bytes / 4294967296 << 0;\n this.bytes = this.bytes % 4294967296;\n }\n return this;\n };\n\n Sha1.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex;\n blocks[16] = this.block;\n blocks[i >> 2] |= EXTRA[i & 3];\n this.block = blocks[16];\n if (i >= 56) {\n if (!this.hashed) {\n this.hash();\n }\n blocks[0] = this.block;\n blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n blocks[14] = this.hBytes << 3 | this.bytes >>> 29;\n blocks[15] = this.bytes << 3;\n this.hash();\n };\n\n Sha1.prototype.hash = function () {\n var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4;\n var f, j, t, blocks = this.blocks;\n\n for(j = 16; j < 80; ++j) {\n t = blocks[j - 3] ^ blocks[j - 8] ^ blocks[j - 14] ^ blocks[j - 16];\n blocks[j] = (t << 1) | (t >>> 31);\n }\n\n for(j = 0; j < 20; j += 5) {\n f = (b & c) | ((~b) & d);\n t = (a << 5) | (a >>> 27);\n e = t + f + e + 1518500249 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = (a & b) | ((~a) & c);\n t = (e << 5) | (e >>> 27);\n d = t + f + d + 1518500249 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = (e & a) | ((~e) & b);\n t = (d << 5) | (d >>> 27);\n c = t + f + c + 1518500249 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = (d & e) | ((~d) & a);\n t = (c << 5) | (c >>> 27);\n b = t + f + b + 1518500249 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = (c & d) | ((~c) & e);\n t = (b << 5) | (b >>> 27);\n a = t + f + a + 1518500249 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 40; j += 5) {\n f = b ^ c ^ d;\n t = (a << 5) | (a >>> 27);\n e = t + f + e + 1859775393 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = a ^ b ^ c;\n t = (e << 5) | (e >>> 27);\n d = t + f + d + 1859775393 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = e ^ a ^ b;\n t = (d << 5) | (d >>> 27);\n c = t + f + c + 1859775393 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = d ^ e ^ a;\n t = (c << 5) | (c >>> 27);\n b = t + f + b + 1859775393 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = c ^ d ^ e;\n t = (b << 5) | (b >>> 27);\n a = t + f + a + 1859775393 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 60; j += 5) {\n f = (b & c) | (b & d) | (c & d);\n t = (a << 5) | (a >>> 27);\n e = t + f + e - 1894007588 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = (a & b) | (a & c) | (b & c);\n t = (e << 5) | (e >>> 27);\n d = t + f + d - 1894007588 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = (e & a) | (e & b) | (a & b);\n t = (d << 5) | (d >>> 27);\n c = t + f + c - 1894007588 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = (d & e) | (d & a) | (e & a);\n t = (c << 5) | (c >>> 27);\n b = t + f + b - 1894007588 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = (c & d) | (c & e) | (d & e);\n t = (b << 5) | (b >>> 27);\n a = t + f + a - 1894007588 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 80; j += 5) {\n f = b ^ c ^ d;\n t = (a << 5) | (a >>> 27);\n e = t + f + e - 899497514 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = a ^ b ^ c;\n t = (e << 5) | (e >>> 27);\n d = t + f + d - 899497514 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = e ^ a ^ b;\n t = (d << 5) | (d >>> 27);\n c = t + f + c - 899497514 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = d ^ e ^ a;\n t = (c << 5) | (c >>> 27);\n b = t + f + b - 899497514 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = c ^ d ^ e;\n t = (b << 5) | (b >>> 27);\n a = t + f + a - 899497514 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n this.h0 = this.h0 + a << 0;\n this.h1 = this.h1 + b << 0;\n this.h2 = this.h2 + c << 0;\n this.h3 = this.h3 + d << 0;\n this.h4 = this.h4 + e << 0;\n };\n\n Sha1.prototype.hex = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;\n\n return HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +\n HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +\n HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +\n HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +\n HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +\n HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +\n HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +\n HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +\n HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +\n HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +\n HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +\n HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +\n HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F] +\n HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +\n HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +\n HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +\n HEX_CHARS[(h4 >> 28) & 0x0F] + HEX_CHARS[(h4 >> 24) & 0x0F] +\n HEX_CHARS[(h4 >> 20) & 0x0F] + HEX_CHARS[(h4 >> 16) & 0x0F] +\n HEX_CHARS[(h4 >> 12) & 0x0F] + HEX_CHARS[(h4 >> 8) & 0x0F] +\n HEX_CHARS[(h4 >> 4) & 0x0F] + HEX_CHARS[h4 & 0x0F];\n };\n\n Sha1.prototype.toString = Sha1.prototype.hex;\n\n Sha1.prototype.digest = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;\n\n return [\n (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, h0 & 0xFF,\n (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, h1 & 0xFF,\n (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, h2 & 0xFF,\n (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, h3 & 0xFF,\n (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, h4 & 0xFF\n ];\n };\n\n Sha1.prototype.array = Sha1.prototype.digest;\n\n Sha1.prototype.arrayBuffer = function () {\n this.finalize();\n\n var buffer = new ArrayBuffer(20);\n var dataView = new DataView(buffer);\n dataView.setUint32(0, this.h0);\n dataView.setUint32(4, this.h1);\n dataView.setUint32(8, this.h2);\n dataView.setUint32(12, this.h3);\n dataView.setUint32(16, this.h4);\n return buffer;\n };\n\n var exports = createMethod();\n\n if (COMMON_JS) {\n module.exports = exports;\n } else {\n root.sha1 = exports;\n if (AMD) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n return exports;\n }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n }\n }\n})();\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://Authing/./node_modules/js-sha1/src/sha1.js?"); +eval("/* WEBPACK VAR INJECTION */(function(process, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*\n * [js-sha1]{@link https://github.com/emn178/js-sha1}\n *\n * @version 0.6.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2014-2017\n * @license MIT\n */\n/*jslint bitwise: true */\n(function() {\n 'use strict';\n\n var root = typeof window === 'object' ? window : {};\n var NODE_JS = !root.JS_SHA1_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n }\n var COMMON_JS = !root.JS_SHA1_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = true && __webpack_require__(/*! !webpack amd options */ \"./node_modules/_webpack@4.30.0@webpack/buildin/amd-options.js\");\n var HEX_CHARS = '0123456789abcdef'.split('');\n var EXTRA = [-2147483648, 8388608, 32768, 128];\n var SHIFT = [24, 16, 8, 0];\n var OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer'];\n\n var blocks = [];\n\n var createOutputMethod = function (outputType) {\n return function (message) {\n return new Sha1(true).update(message)[outputType]();\n };\n };\n\n var createMethod = function () {\n var method = createOutputMethod('hex');\n if (NODE_JS) {\n method = nodeWrap(method);\n }\n method.create = function () {\n return new Sha1();\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createOutputMethod(type);\n }\n return method;\n };\n\n var nodeWrap = function (method) {\n var crypto = eval(\"require('crypto')\");\n var Buffer = eval(\"require('buffer').Buffer\");\n var nodeMethod = function (message) {\n if (typeof message === 'string') {\n return crypto.createHash('sha1').update(message, 'utf8').digest('hex');\n } else if (message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (message.length === undefined) {\n return method(message);\n }\n return crypto.createHash('sha1').update(new Buffer(message)).digest('hex');\n };\n return nodeMethod;\n };\n\n function Sha1(sharedMemory) {\n if (sharedMemory) {\n blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n this.blocks = blocks;\n } else {\n this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n }\n\n this.h0 = 0x67452301;\n this.h1 = 0xEFCDAB89;\n this.h2 = 0x98BADCFE;\n this.h3 = 0x10325476;\n this.h4 = 0xC3D2E1F0;\n\n this.block = this.start = this.bytes = this.hBytes = 0;\n this.finalized = this.hashed = false;\n this.first = true;\n }\n\n Sha1.prototype.update = function (message) {\n if (this.finalized) {\n return;\n }\n var notString = typeof(message) !== 'string';\n if (notString && message.constructor === root.ArrayBuffer) {\n message = new Uint8Array(message);\n }\n var code, index = 0, i, length = message.length || 0, blocks = this.blocks;\n\n while (index < length) {\n if (this.hashed) {\n this.hashed = false;\n blocks[0] = this.block;\n blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n\n if(notString) {\n for (i = this.start; index < length && i < 64; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < 64; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n\n this.lastByteIndex = i;\n this.bytes += i - this.start;\n if (i >= 64) {\n this.block = blocks[16];\n this.start = i - 64;\n this.hash();\n this.hashed = true;\n } else {\n this.start = i;\n }\n }\n if (this.bytes > 4294967295) {\n this.hBytes += this.bytes / 4294967296 << 0;\n this.bytes = this.bytes % 4294967296;\n }\n return this;\n };\n\n Sha1.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex;\n blocks[16] = this.block;\n blocks[i >> 2] |= EXTRA[i & 3];\n this.block = blocks[16];\n if (i >= 56) {\n if (!this.hashed) {\n this.hash();\n }\n blocks[0] = this.block;\n blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n blocks[14] = this.hBytes << 3 | this.bytes >>> 29;\n blocks[15] = this.bytes << 3;\n this.hash();\n };\n\n Sha1.prototype.hash = function () {\n var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4;\n var f, j, t, blocks = this.blocks;\n\n for(j = 16; j < 80; ++j) {\n t = blocks[j - 3] ^ blocks[j - 8] ^ blocks[j - 14] ^ blocks[j - 16];\n blocks[j] = (t << 1) | (t >>> 31);\n }\n\n for(j = 0; j < 20; j += 5) {\n f = (b & c) | ((~b) & d);\n t = (a << 5) | (a >>> 27);\n e = t + f + e + 1518500249 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = (a & b) | ((~a) & c);\n t = (e << 5) | (e >>> 27);\n d = t + f + d + 1518500249 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = (e & a) | ((~e) & b);\n t = (d << 5) | (d >>> 27);\n c = t + f + c + 1518500249 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = (d & e) | ((~d) & a);\n t = (c << 5) | (c >>> 27);\n b = t + f + b + 1518500249 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = (c & d) | ((~c) & e);\n t = (b << 5) | (b >>> 27);\n a = t + f + a + 1518500249 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 40; j += 5) {\n f = b ^ c ^ d;\n t = (a << 5) | (a >>> 27);\n e = t + f + e + 1859775393 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = a ^ b ^ c;\n t = (e << 5) | (e >>> 27);\n d = t + f + d + 1859775393 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = e ^ a ^ b;\n t = (d << 5) | (d >>> 27);\n c = t + f + c + 1859775393 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = d ^ e ^ a;\n t = (c << 5) | (c >>> 27);\n b = t + f + b + 1859775393 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = c ^ d ^ e;\n t = (b << 5) | (b >>> 27);\n a = t + f + a + 1859775393 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 60; j += 5) {\n f = (b & c) | (b & d) | (c & d);\n t = (a << 5) | (a >>> 27);\n e = t + f + e - 1894007588 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = (a & b) | (a & c) | (b & c);\n t = (e << 5) | (e >>> 27);\n d = t + f + d - 1894007588 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = (e & a) | (e & b) | (a & b);\n t = (d << 5) | (d >>> 27);\n c = t + f + c - 1894007588 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = (d & e) | (d & a) | (e & a);\n t = (c << 5) | (c >>> 27);\n b = t + f + b - 1894007588 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = (c & d) | (c & e) | (d & e);\n t = (b << 5) | (b >>> 27);\n a = t + f + a - 1894007588 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 80; j += 5) {\n f = b ^ c ^ d;\n t = (a << 5) | (a >>> 27);\n e = t + f + e - 899497514 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = a ^ b ^ c;\n t = (e << 5) | (e >>> 27);\n d = t + f + d - 899497514 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = e ^ a ^ b;\n t = (d << 5) | (d >>> 27);\n c = t + f + c - 899497514 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = d ^ e ^ a;\n t = (c << 5) | (c >>> 27);\n b = t + f + b - 899497514 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = c ^ d ^ e;\n t = (b << 5) | (b >>> 27);\n a = t + f + a - 899497514 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n this.h0 = this.h0 + a << 0;\n this.h1 = this.h1 + b << 0;\n this.h2 = this.h2 + c << 0;\n this.h3 = this.h3 + d << 0;\n this.h4 = this.h4 + e << 0;\n };\n\n Sha1.prototype.hex = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;\n\n return HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +\n HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +\n HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +\n HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +\n HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +\n HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +\n HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +\n HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +\n HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +\n HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +\n HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +\n HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +\n HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F] +\n HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +\n HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +\n HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +\n HEX_CHARS[(h4 >> 28) & 0x0F] + HEX_CHARS[(h4 >> 24) & 0x0F] +\n HEX_CHARS[(h4 >> 20) & 0x0F] + HEX_CHARS[(h4 >> 16) & 0x0F] +\n HEX_CHARS[(h4 >> 12) & 0x0F] + HEX_CHARS[(h4 >> 8) & 0x0F] +\n HEX_CHARS[(h4 >> 4) & 0x0F] + HEX_CHARS[h4 & 0x0F];\n };\n\n Sha1.prototype.toString = Sha1.prototype.hex;\n\n Sha1.prototype.digest = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;\n\n return [\n (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, h0 & 0xFF,\n (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, h1 & 0xFF,\n (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, h2 & 0xFF,\n (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, h3 & 0xFF,\n (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, h4 & 0xFF\n ];\n };\n\n Sha1.prototype.array = Sha1.prototype.digest;\n\n Sha1.prototype.arrayBuffer = function () {\n this.finalize();\n\n var buffer = new ArrayBuffer(20);\n var dataView = new DataView(buffer);\n dataView.setUint32(0, this.h0);\n dataView.setUint32(4, this.h1);\n dataView.setUint32(8, this.h2);\n dataView.setUint32(12, this.h3);\n dataView.setUint32(16, this.h4);\n return buffer;\n };\n\n var exports = createMethod();\n\n if (COMMON_JS) {\n module.exports = exports;\n } else {\n root.sha1 = exports;\n if (AMD) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n return exports;\n }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n }\n }\n})();\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../_process@0.11.10@process/browser.js */ \"./node_modules/_process@0.11.10@process/browser.js\"), __webpack_require__(/*! ./../../_webpack@4.30.0@webpack/buildin/global.js */ \"./node_modules/_webpack@4.30.0@webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://Authing/./node_modules/_js-sha1@0.6.0@js-sha1/src/sha1.js?"); /***/ }), -/***/ "./node_modules/jsencrypt/bin/jsencrypt.js": -/*!*************************************************!*\ - !*** ./node_modules/jsencrypt/bin/jsencrypt.js ***! - \*************************************************/ +/***/ "./node_modules/_jsencrypt@2.3.1@jsencrypt/bin/jsencrypt.js": +/*!******************************************************************!*\ + !*** ./node_modules/_jsencrypt@2.3.1@jsencrypt/bin/jsencrypt.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! JSEncrypt v2.3.1 | https://npmcdn.com/jsencrypt@2.3.1/LICENSE.txt */\n(function (root, factory) {\n if (true) {\n // AMD\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n})(this, function (exports) {\n // Copyright (c) 2005 Tom Wu\n// All Rights Reserved.\n// See \"LICENSE\" for details.\n\n// Basic JavaScript BN library - subset useful for RSA encryption.\n\n// Bits per digit\nvar dbits;\n\n// JavaScript engine analysis\nvar canary = 0xdeadbeefcafe;\nvar j_lm = ((canary&0xffffff)==0xefcafe);\n\n// (public) Constructor\nfunction BigInteger(a,b,c) {\n if(a != null)\n if(\"number\" == typeof a) this.fromNumber(a,b,c);\n else if(b == null && \"string\" != typeof a) this.fromString(a,256);\n else this.fromString(a,b);\n}\n\n// return new, unset BigInteger\nfunction nbi() { return new BigInteger(null); }\n\n// am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\nfunction am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n}\n// am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\nfunction am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n}\n// Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\nfunction am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n}\nif(j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n}\nelse if(j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n}\nelse { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n}\n\nBigInteger.prototype.DB = dbits;\nBigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n}\n\n// (protected) set from integer value x, -DV <= x < DV\nfunction bnpFromInt(x) {\n this.t = 1;\n this.s = (x<0)?-1:0;\n if(x > 0) this[0] = x;\n else if(x < -1) this[0] = x+this.DV;\n else this.t = 0;\n}\n\n// return bigint initialized to value\nfunction nbv(i) { var r = nbi(); r.fromInt(i); return r; }\n\n// (protected) set from string and radix\nfunction bnpFromString(s,b) {\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else { this.fromRadix(s,b); return; }\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while(--i >= 0) {\n var x = (k==8)?s[i]&0xff:intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if(sh == 0)\n this[this.t++] = x;\n else if(sh+k > this.DB) {\n this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh));\n }\n else\n this[this.t-1] |= x<= this.DB) sh -= this.DB;\n }\n if(k == 8 && (s[0]&0x80) != 0) {\n this.s = -1;\n if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t;\n}\n\n// (public) return string representation in given radix\nfunction bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1< 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}\n\n// (public) -this\nfunction bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\n// (public) |this|\nfunction bnAbs() { return (this.s<0)?this.negate():this; }\n\n// (public) return + if this > a, - if this < a, 0 if equal\nfunction bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n}\n\n// returns bit length of the integer x\nfunction nbits(x) {\n var r = 1, t;\n if((t=x>>>16) != 0) { x = t; r += 16; }\n if((t=x>>8) != 0) { x = t; r += 8; }\n if((t=x>>4) != 0) { x = t; r += 4; }\n if((t=x>>2) != 0) { x = t; r += 2; }\n if((t=x>>1) != 0) { x = t; r += 1; }\n return r;\n}\n\n// (public) return the number of bits in \"this\"\nfunction bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}\n\n// (protected) r = this << n*DB\nfunction bnpDLShiftTo(n,r) {\n var i;\n for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];\n for(i = n-1; i >= 0; --i) r[i] = 0;\n r.t = this.t+n;\n r.s = this.s;\n}\n\n// (protected) r = this >> n*DB\nfunction bnpDRShiftTo(n,r) {\n for(var i = n; i < this.t; ++i) r[i-n] = this[i];\n r.t = Math.max(this.t-n,0);\n r.s = this.s;\n}\n\n// (protected) r = this << n\nfunction bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n}\n\n// (protected) r = this >> n\nfunction bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB;\n }\n if(a.t < this.t) {\n c -= a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c -= a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = (c<0)?-1:0;\n if(c < -1) r[i++] = this.DV+c;\n else if(c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n}\n\n// (protected) r = this * a, r != this,a (HAC 14.12)\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyTo(a,r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i+y.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);\n r.s = 0;\n r.clamp();\n if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n}\n\n// (protected) r = this^2, r != this (HAC 14.16)\nfunction bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2*x.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < x.t-1; ++i) {\n var c = x.am(i,x[i],r,2*i,0,1);\n if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n r[i+x.t] -= x.DV;\n r[i+x.t+1] = 1;\n }\n }\n if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);\n r.s = 0;\n r.clamp();\n}\n\n// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m. q or r may be null.\nfunction bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}\n\n// (public) this mod a\nfunction bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a,null,r);\n if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n return r;\n}\n\n// Modular reduction using \"classic\" algorithm\nfunction Classic(m) { this.m = m; }\nfunction cConvert(x) {\n if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n else return x;\n}\nfunction cRevert(x) { return x; }\nfunction cReduce(x) { x.divRemTo(this.m,null,x); }\nfunction cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\nfunction cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\nClassic.prototype.convert = cConvert;\nClassic.prototype.revert = cRevert;\nClassic.prototype.reduce = cReduce;\nClassic.prototype.mulTo = cMulTo;\nClassic.prototype.sqrTo = cSqrTo;\n\n// (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n// justification:\n// xy == 1 (mod m)\n// xy = 1+km\n// xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply \"overflows\" differently from C/C++, so care is needed here.\nfunction bnpInvDigit() {\n if(this.t < 1) return 0;\n var x = this[0];\n if((x&1) == 0) return 0;\n var y = x&3;\t\t// y == 1/x mod 2^2\n y = (y*(2-(x&0xf)*y))&0xf;\t// y == 1/x mod 2^4\n y = (y*(2-(x&0xff)*y))&0xff;\t// y == 1/x mod 2^8\n y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff;\t// y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = (y*(2-x*y%this.DV))%this.DV;\t\t// y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return (y>0)?this.DV-y:-y;\n}\n\n// Montgomery reduction\nfunction Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp&0x7fff;\n this.mph = this.mp>>15;\n this.um = (1<<(m.DB-15))-1;\n this.mt2 = 2*m.t;\n}\n\n// xR mod m\nfunction montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t,r);\n r.divRemTo(this.m,null,r);\n if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n return r;\n}\n\n// x/R mod m\nfunction montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n}\n\n// x = x/R mod m (HAC 14.32)\nfunction montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}\n\n// r = \"x^2/R mod m\"; x != r\nfunction montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n// r = \"xy/R mod m\"; x,y != r\nfunction montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\nMontgomery.prototype.convert = montConvert;\nMontgomery.prototype.revert = montRevert;\nMontgomery.prototype.reduce = montReduce;\nMontgomery.prototype.mulTo = montMulTo;\nMontgomery.prototype.sqrTo = montSqrTo;\n\n// (protected) true iff this is even\nfunction bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }\n\n// (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\nfunction bnpExp(e,z) {\n if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n g.copyTo(r);\n while(--i >= 0) {\n z.sqrTo(r,r2);\n if((e&(1< 0) z.mulTo(r2,g,r);\n else { var t = r; r = r2; r2 = t; }\n }\n return z.revert(r);\n}\n\n// (public) this^e % m, 0 <= e < 2^32\nfunction bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}\n\n// protected\nBigInteger.prototype.copyTo = bnpCopyTo;\nBigInteger.prototype.fromInt = bnpFromInt;\nBigInteger.prototype.fromString = bnpFromString;\nBigInteger.prototype.clamp = bnpClamp;\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\nBigInteger.prototype.subTo = bnpSubTo;\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\nBigInteger.prototype.squareTo = bnpSquareTo;\nBigInteger.prototype.divRemTo = bnpDivRemTo;\nBigInteger.prototype.invDigit = bnpInvDigit;\nBigInteger.prototype.isEven = bnpIsEven;\nBigInteger.prototype.exp = bnpExp;\n\n// public\nBigInteger.prototype.toString = bnToString;\nBigInteger.prototype.negate = bnNegate;\nBigInteger.prototype.abs = bnAbs;\nBigInteger.prototype.compareTo = bnCompareTo;\nBigInteger.prototype.bitLength = bnBitLength;\nBigInteger.prototype.mod = bnMod;\nBigInteger.prototype.modPowInt = bnModPowInt;\n\n// \"constants\"\nBigInteger.ZERO = nbv(0);\nBigInteger.ONE = nbv(1);\n\n// Copyright (c) 2005-2009 Tom Wu\n// All Rights Reserved.\n// See \"LICENSE\" for details.\n\n// Extended JavaScript BN functions, required for RSA private ops.\n\n// Version 1.1: new BigInteger(\"0\", 10) returns \"proper\" zero\n// Version 1.2: square() API, isProbablePrime fix\n\n// (public)\nfunction bnClone() { var r = nbi(); this.copyTo(r); return r; }\n\n// (public) return value as integer\nfunction bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<>24; }\n\n// (public) return value as short (assumes DB>=16)\nfunction bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }\n\n// (protected) return x s.t. r^x < DV\nfunction bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\n// (public) 0 if this == 0, 1 if this > 0\nfunction bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n}\n\n// (protected) convert to radix string\nfunction bnpToRadix(b) {\n if(b == null) b = 10;\n if(this.signum() == 0 || b < 2 || b > 36) return \"0\";\n var cs = this.chunkSize(b);\n var a = Math.pow(b,cs);\n var d = nbv(a), y = nbi(), z = nbi(), r = \"\";\n this.divRemTo(d,y,z);\n while(y.signum() > 0) {\n r = (a+z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d,y,z);\n }\n return z.intValue().toString(b) + r;\n}\n\n// (protected) convert from radix string\nfunction bnpFromRadix(s,b) {\n this.fromInt(0);\n if(b == null) b = 10;\n var cs = this.chunkSize(b);\n var d = Math.pow(b,cs), mi = false, j = 0, w = 0;\n for(var i = 0; i < s.length; ++i) {\n var x = intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\" && this.signum() == 0) mi = true;\n continue;\n }\n w = b*w+x;\n if(++j >= cs) {\n this.dMultiply(d);\n this.dAddOffset(w,0);\n j = 0;\n w = 0;\n }\n }\n if(j > 0) {\n this.dMultiply(Math.pow(b,j));\n this.dAddOffset(w,0);\n }\n if(mi) BigInteger.ZERO.subTo(this,this);\n}\n\n// (protected) alternate constructor\nfunction bnpFromNumber(a,b,c) {\n if(\"number\" == typeof b) {\n // new BigInteger(int,int,RNG)\n if(a < 2) this.fromInt(1);\n else {\n this.fromNumber(a,c);\n if(!this.testBit(a-1))\t// force MSB set\n this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);\n if(this.isEven()) this.dAddOffset(1,0); // force odd\n while(!this.isProbablePrime(b)) {\n this.dAddOffset(2,0);\n if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);\n }\n }\n }\n else {\n // new BigInteger(int,RNG)\n var x = new Array(), t = a&7;\n x.length = (a>>3)+1;\n b.nextBytes(x);\n if(t > 0) x[0] &= ((1< 0) {\n if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)\n r[k++] = d|(this.s<<(this.DB-p));\n while(i >= 0) {\n if(p < 8) {\n d = (this[i]&((1<>(p+=this.DB-8);\n }\n else {\n d = (this[i]>>(p-=8))&0xff;\n if(p <= 0) { p += this.DB; --i; }\n }\n if((d&0x80) != 0) d |= -256;\n if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;\n if(k > 0 || d != this.s) r[k++] = d;\n }\n }\n return r;\n}\n\nfunction bnEquals(a) { return(this.compareTo(a)==0); }\nfunction bnMin(a) { return(this.compareTo(a)<0)?this:a; }\nfunction bnMax(a) { return(this.compareTo(a)>0)?this:a; }\n\n// (protected) r = this op a (bitwise)\nfunction bnpBitwiseTo(a,op,r) {\n var i, f, m = Math.min(a.t,this.t);\n for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);\n if(a.t < this.t) {\n f = a.s&this.DM;\n for(i = m; i < this.t; ++i) r[i] = op(this[i],f);\n r.t = this.t;\n }\n else {\n f = this.s&this.DM;\n for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);\n r.t = a.t;\n }\n r.s = op(this.s,a.s);\n r.clamp();\n}\n\n// (public) this & a\nfunction op_and(x,y) { return x&y; }\nfunction bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }\n\n// (public) this | a\nfunction op_or(x,y) { return x|y; }\nfunction bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }\n\n// (public) this ^ a\nfunction op_xor(x,y) { return x^y; }\nfunction bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }\n\n// (public) this & ~a\nfunction op_andnot(x,y) { return x&~y; }\nfunction bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }\n\n// (public) ~this\nfunction bnNot() {\n var r = nbi();\n for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];\n r.t = this.t;\n r.s = ~this.s;\n return r;\n}\n\n// (public) this << n\nfunction bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n}\n\n// (public) this >> n\nfunction bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n}\n\n// return index of lowest 1-bit in x, x < 2^31\nfunction lbit(x) {\n if(x == 0) return -1;\n var r = 0;\n if((x&0xffff) == 0) { x >>= 16; r += 16; }\n if((x&0xff) == 0) { x >>= 8; r += 8; }\n if((x&0xf) == 0) { x >>= 4; r += 4; }\n if((x&3) == 0) { x >>= 2; r += 2; }\n if((x&1) == 0) ++r;\n return r;\n}\n\n// (public) returns index of lowest 1-bit (or -1 if none)\nfunction bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}\n\n// return number of 1 bits in x\nfunction cbit(x) {\n var r = 0;\n while(x != 0) { x &= x-1; ++r; }\n return r;\n}\n\n// (public) return number of set bits\nfunction bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n}\n\n// (public) true iff nth bit is set\nfunction bnTestBit(n) {\n var j = Math.floor(n/this.DB);\n if(j >= this.t) return(this.s!=0);\n return((this[j]&(1<<(n%this.DB)))!=0);\n}\n\n// (protected) this op (1<>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}\n\n// (public) this + a\nfunction bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }\n\n// (public) this - a\nfunction bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }\n\n// (public) this * a\nfunction bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }\n\n// (public) this^2\nfunction bnSquare() { var r = nbi(); this.squareTo(r); return r; }\n\n// (public) this / a\nfunction bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }\n\n// (public) this % a\nfunction bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }\n\n// (public) [this/a,this%a]\nfunction bnDivideAndRemainder(a) {\n var q = nbi(), r = nbi();\n this.divRemTo(a,q,r);\n return new Array(q,r);\n}\n\n// (protected) this *= n, this >= 0, 1 < n < DV\nfunction bnpDMultiply(n) {\n this[this.t] = this.am(0,n-1,this,0,0,this.t);\n ++this.t;\n this.clamp();\n}\n\n// (protected) this += n << w words, this >= 0\nfunction bnpDAddOffset(n,w) {\n if(n == 0) return;\n while(this.t <= w) this[this.t++] = 0;\n this[w] += n;\n while(this[w] >= this.DV) {\n this[w] -= this.DV;\n if(++w >= this.t) this[this.t++] = 0;\n ++this[w];\n }\n}\n\n// A \"null\" reducer\nfunction NullExp() {}\nfunction nNop(x) { return x; }\nfunction nMulTo(x,y,r) { x.multiplyTo(y,r); }\nfunction nSqrTo(x,r) { x.squareTo(r); }\n\nNullExp.prototype.convert = nNop;\nNullExp.prototype.revert = nNop;\nNullExp.prototype.mulTo = nMulTo;\nNullExp.prototype.sqrTo = nSqrTo;\n\n// (public) this^e\nfunction bnPow(e) { return this.exp(e,new NullExp()); }\n\n// (protected) r = lower n words of \"this * a\", a.t <= n\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyLowerTo(a,n,r) {\n var i = Math.min(this.t+a.t,n);\n r.s = 0; // assumes a,this >= 0\n r.t = i;\n while(i > 0) r[--i] = 0;\n var j;\n for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);\n for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);\n r.clamp();\n}\n\n// (protected) r = \"this * a\" without lower n words, n > 0\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyUpperTo(a,n,r) {\n --n;\n var i = r.t = this.t+a.t-n;\n r.s = 0; // assumes a,this >= 0\n while(--i >= 0) r[i] = 0;\n for(i = Math.max(n-this.t,0); i < a.t; ++i)\n r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);\n r.clamp();\n r.drShiftTo(1,r);\n}\n\n// Barrett modular reduction\nfunction Barrett(m) {\n // setup Barrett\n this.r2 = nbi();\n this.q3 = nbi();\n BigInteger.ONE.dlShiftTo(2*m.t,this.r2);\n this.mu = this.r2.divide(m);\n this.m = m;\n}\n\nfunction barrettConvert(x) {\n if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);\n else if(x.compareTo(this.m) < 0) return x;\n else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }\n}\n\nfunction barrettRevert(x) { return x; }\n\n// x = x mod m (HAC 14.42)\nfunction barrettReduce(x) {\n x.drShiftTo(this.m.t-1,this.r2);\n if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }\n this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);\n this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);\n while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);\n x.subTo(this.r2,x);\n while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}\n\n// r = x^2 mod m; x != r\nfunction barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n// r = x*y mod m; x,y != r\nfunction barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\nBarrett.prototype.convert = barrettConvert;\nBarrett.prototype.revert = barrettRevert;\nBarrett.prototype.reduce = barrettReduce;\nBarrett.prototype.mulTo = barrettMulTo;\nBarrett.prototype.sqrTo = barrettSqrTo;\n\n// (public) this^e % m (HAC 14.85)\nfunction bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1< 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1< 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}\n\n// (protected) this % n, n < 2^26\nfunction bnpModInt(n) {\n if(n <= 0) return 0;\n var d = this.DV%n, r = (this.s<0)?n-1:0;\n if(this.t > 0)\n if(d == 0) r = this[0]%n;\n else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;\n return r;\n}\n\n// (public) 1/this % m (HAC 14.61)\nfunction bnModInverse(m) {\n var ac = m.isEven();\n if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;\n var u = m.clone(), v = this.clone();\n var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);\n while(u.signum() != 0) {\n while(u.isEven()) {\n u.rShiftTo(1,u);\n if(ac) {\n if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }\n a.rShiftTo(1,a);\n }\n else if(!b.isEven()) b.subTo(m,b);\n b.rShiftTo(1,b);\n }\n while(v.isEven()) {\n v.rShiftTo(1,v);\n if(ac) {\n if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }\n c.rShiftTo(1,c);\n }\n else if(!d.isEven()) d.subTo(m,d);\n d.rShiftTo(1,d);\n }\n if(u.compareTo(v) >= 0) {\n u.subTo(v,u);\n if(ac) a.subTo(c,a);\n b.subTo(d,b);\n }\n else {\n v.subTo(u,v);\n if(ac) c.subTo(a,c);\n d.subTo(b,d);\n }\n }\n if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;\n if(d.compareTo(m) >= 0) return d.subtract(m);\n if(d.signum() < 0) d.addTo(m,d); else return d;\n if(d.signum() < 0) return d.add(m); else return d;\n}\n\nvar lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];\nvar lplim = (1<<26)/lowprimes[lowprimes.length-1];\n\n// (public) test primality with certainty >= 1-.5^t\nfunction bnIsProbablePrime(t) {\n var i, x = this.abs();\n if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {\n for(i = 0; i < lowprimes.length; ++i)\n if(x[0] == lowprimes[i]) return true;\n return false;\n }\n if(x.isEven()) return false;\n i = 1;\n while(i < lowprimes.length) {\n var m = lowprimes[i], j = i+1;\n while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];\n m = x.modInt(m);\n while(i < j) if(m%lowprimes[i++] == 0) return false;\n }\n return x.millerRabin(t);\n}\n\n// (protected) true if probably prime (HAC 4.24, Miller-Rabin)\nfunction bnpMillerRabin(t) {\n var n1 = this.subtract(BigInteger.ONE);\n var k = n1.getLowestSetBit();\n if(k <= 0) return false;\n var r = n1.shiftRight(k);\n t = (t+1)>>1;\n if(t > lowprimes.length) t = lowprimes.length;\n var a = nbi();\n for(var i = 0; i < t; ++i) {\n //Pick bases at random, instead of starting at 2\n a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);\n var y = a.modPow(r,this);\n if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\n var j = 1;\n while(j++ < k && y.compareTo(n1) != 0) {\n y = y.modPowInt(2,this);\n if(y.compareTo(BigInteger.ONE) == 0) return false;\n }\n if(y.compareTo(n1) != 0) return false;\n }\n }\n return true;\n}\n\n// protected\nBigInteger.prototype.chunkSize = bnpChunkSize;\nBigInteger.prototype.toRadix = bnpToRadix;\nBigInteger.prototype.fromRadix = bnpFromRadix;\nBigInteger.prototype.fromNumber = bnpFromNumber;\nBigInteger.prototype.bitwiseTo = bnpBitwiseTo;\nBigInteger.prototype.changeBit = bnpChangeBit;\nBigInteger.prototype.addTo = bnpAddTo;\nBigInteger.prototype.dMultiply = bnpDMultiply;\nBigInteger.prototype.dAddOffset = bnpDAddOffset;\nBigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;\nBigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;\nBigInteger.prototype.modInt = bnpModInt;\nBigInteger.prototype.millerRabin = bnpMillerRabin;\n\n// public\nBigInteger.prototype.clone = bnClone;\nBigInteger.prototype.intValue = bnIntValue;\nBigInteger.prototype.byteValue = bnByteValue;\nBigInteger.prototype.shortValue = bnShortValue;\nBigInteger.prototype.signum = bnSigNum;\nBigInteger.prototype.toByteArray = bnToByteArray;\nBigInteger.prototype.equals = bnEquals;\nBigInteger.prototype.min = bnMin;\nBigInteger.prototype.max = bnMax;\nBigInteger.prototype.and = bnAnd;\nBigInteger.prototype.or = bnOr;\nBigInteger.prototype.xor = bnXor;\nBigInteger.prototype.andNot = bnAndNot;\nBigInteger.prototype.not = bnNot;\nBigInteger.prototype.shiftLeft = bnShiftLeft;\nBigInteger.prototype.shiftRight = bnShiftRight;\nBigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;\nBigInteger.prototype.bitCount = bnBitCount;\nBigInteger.prototype.testBit = bnTestBit;\nBigInteger.prototype.setBit = bnSetBit;\nBigInteger.prototype.clearBit = bnClearBit;\nBigInteger.prototype.flipBit = bnFlipBit;\nBigInteger.prototype.add = bnAdd;\nBigInteger.prototype.subtract = bnSubtract;\nBigInteger.prototype.multiply = bnMultiply;\nBigInteger.prototype.divide = bnDivide;\nBigInteger.prototype.remainder = bnRemainder;\nBigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;\nBigInteger.prototype.modPow = bnModPow;\nBigInteger.prototype.modInverse = bnModInverse;\nBigInteger.prototype.pow = bnPow;\nBigInteger.prototype.gcd = bnGCD;\nBigInteger.prototype.isProbablePrime = bnIsProbablePrime;\n\n// JSBN-specific extension\nBigInteger.prototype.square = bnSquare;\n\n// BigInteger interfaces not implemented in jsbn:\n\n// BigInteger(int signum, byte[] magnitude)\n// double doubleValue()\n// float floatValue()\n// int hashCode()\n// long longValue()\n// static BigInteger valueOf(long val)\n\n// prng4.js - uses Arcfour as a PRNG\n\nfunction Arcfour() {\n this.i = 0;\n this.j = 0;\n this.S = new Array();\n}\n\n// Initialize arcfour context from key, an array of ints, each from [0..255]\nfunction ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}\n\nfunction ARC4next() {\n var t;\n this.i = (this.i + 1) & 255;\n this.j = (this.j + this.S[this.i]) & 255;\n t = this.S[this.i];\n this.S[this.i] = this.S[this.j];\n this.S[this.j] = t;\n return this.S[(t + this.S[this.i]) & 255];\n}\n\nArcfour.prototype.init = ARC4init;\nArcfour.prototype.next = ARC4next;\n\n// Plug in your RNG constructor here\nfunction prng_newstate() {\n return new Arcfour();\n}\n\n// Pool size must be a multiple of 4 and greater than 32.\n// An array of bytes the size of the pool will be passed to init()\nvar rng_psize = 256;\n\n// Random number generator - requires a PRNG backend, e.g. prng4.js\nvar rng_state;\nvar rng_pool;\nvar rng_pptr;\n\n// Initialize the pool with junk if needed.\nif(rng_pool == null) {\n rng_pool = new Array();\n rng_pptr = 0;\n var t;\n if(window.crypto && window.crypto.getRandomValues) {\n // Extract entropy (2048 bits) from RNG if available\n var z = new Uint32Array(256);\n window.crypto.getRandomValues(z);\n for (t = 0; t < z.length; ++t)\n rng_pool[rng_pptr++] = z[t] & 255;\n }\n\n // Use mouse events for entropy, if we do not have enough entropy by the time\n // we need it, entropy will be generated by Math.random.\n var onMouseMoveListener = function(ev) {\n this.count = this.count || 0;\n if (this.count >= 256 || rng_pptr >= rng_psize) {\n if (window.removeEventListener)\n window.removeEventListener(\"mousemove\", onMouseMoveListener, false);\n else if (window.detachEvent)\n window.detachEvent(\"onmousemove\", onMouseMoveListener);\n return;\n }\n try {\n var mouseCoordinates = ev.x + ev.y;\n rng_pool[rng_pptr++] = mouseCoordinates & 255;\n this.count += 1;\n } catch (e) {\n // Sometimes Firefox will deny permission to access event properties for some reason. Ignore.\n }\n };\n if (window.addEventListener)\n window.addEventListener(\"mousemove\", onMouseMoveListener, false);\n else if (window.attachEvent)\n window.attachEvent(\"onmousemove\", onMouseMoveListener);\n\n}\n\nfunction rng_get_byte() {\n if(rng_state == null) {\n rng_state = prng_newstate();\n // At this point, we may not have collected enough entropy. If not, fall back to Math.random\n while (rng_pptr < rng_psize) {\n var random = Math.floor(65536 * Math.random());\n rng_pool[rng_pptr++] = random & 255;\n }\n rng_state.init(rng_pool);\n for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)\n rng_pool[rng_pptr] = 0;\n rng_pptr = 0;\n }\n // TODO: allow reseeding after first request\n return rng_state.next();\n}\n\nfunction rng_get_bytes(ba) {\n var i;\n for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();\n}\n\nfunction SecureRandom() {}\n\nSecureRandom.prototype.nextBytes = rng_get_bytes;\n\n// Depends on jsbn.js and rng.js\n\n// Version 1.1: support utf-8 encoding in pkcs1pad2\n\n// convert a (hex) string to a bignum object\nfunction parseBigInt(str,r) {\n return new BigInteger(str,r);\n}\n\nfunction linebrk(s,n) {\n var ret = \"\";\n var i = 0;\n while(i + n < s.length) {\n ret += s.substring(i,i+n) + \"\\n\";\n i += n;\n }\n return ret + s.substring(i,s.length);\n}\n\nfunction byte2Hex(b) {\n if(b < 0x10)\n return \"0\" + b.toString(16);\n else\n return b.toString(16);\n}\n\n// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint\nfunction pkcs1pad2(s,n) {\n if(n < s.length + 11) { // TODO: fix for utf-8\n console.error(\"Message too long for RSA\");\n return null;\n }\n var ba = new Array();\n var i = s.length - 1;\n while(i >= 0 && n > 0) {\n var c = s.charCodeAt(i--);\n if(c < 128) { // encode using utf-8\n ba[--n] = c;\n }\n else if((c > 127) && (c < 2048)) {\n ba[--n] = (c & 63) | 128;\n ba[--n] = (c >> 6) | 192;\n }\n else {\n ba[--n] = (c & 63) | 128;\n ba[--n] = ((c >> 6) & 63) | 128;\n ba[--n] = (c >> 12) | 224;\n }\n }\n ba[--n] = 0;\n var rng = new SecureRandom();\n var x = new Array();\n while(n > 2) { // random non-zero pad\n x[0] = 0;\n while(x[0] == 0) rng.nextBytes(x);\n ba[--n] = x[0];\n }\n ba[--n] = 2;\n ba[--n] = 0;\n return new BigInteger(ba);\n}\n\n// \"empty\" RSA key constructor\nfunction RSAKey() {\n this.n = null;\n this.e = 0;\n this.d = null;\n this.p = null;\n this.q = null;\n this.dmp1 = null;\n this.dmq1 = null;\n this.coeff = null;\n}\n\n// Set the public key fields N and e from hex strings\nfunction RSASetPublic(N,E) {\n if(N != null && E != null && N.length > 0 && E.length > 0) {\n this.n = parseBigInt(N,16);\n this.e = parseInt(E,16);\n }\n else\n console.error(\"Invalid RSA public key\");\n}\n\n// Perform raw public operation on \"x\": return x^e (mod n)\nfunction RSADoPublic(x) {\n return x.modPowInt(this.e, this.n);\n}\n\n// Return the PKCS#1 RSA encryption of \"text\" as an even-length hex string\nfunction RSAEncrypt(text) {\n var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3);\n if(m == null) return null;\n var c = this.doPublic(m);\n if(c == null) return null;\n var h = c.toString(16);\n if((h.length & 1) == 0) return h; else return \"0\" + h;\n}\n\n// Return the PKCS#1 RSA encryption of \"text\" as a Base64-encoded string\n//function RSAEncryptB64(text) {\n// var h = this.encrypt(text);\n// if(h) return hex2b64(h); else return null;\n//}\n\n// protected\nRSAKey.prototype.doPublic = RSADoPublic;\n\n// public\nRSAKey.prototype.setPublic = RSASetPublic;\nRSAKey.prototype.encrypt = RSAEncrypt;\n//RSAKey.prototype.encrypt_b64 = RSAEncryptB64;\n\n// Depends on rsa.js and jsbn2.js\n\n// Version 1.1: support utf-8 decoding in pkcs1unpad2\n\n// Undo PKCS#1 (type 2, random) padding and, if valid, return the plaintext\nfunction pkcs1unpad2(d,n) {\n var b = d.toByteArray();\n var i = 0;\n while(i < b.length && b[i] == 0) ++i;\n if(b.length-i != n-1 || b[i] != 2)\n return null;\n ++i;\n while(b[i] != 0)\n if(++i >= b.length) return null;\n var ret = \"\";\n while(++i < b.length) {\n var c = b[i] & 255;\n if(c < 128) { // utf-8 decode\n ret += String.fromCharCode(c);\n }\n else if((c > 191) && (c < 224)) {\n ret += String.fromCharCode(((c & 31) << 6) | (b[i+1] & 63));\n ++i;\n }\n else {\n ret += String.fromCharCode(((c & 15) << 12) | ((b[i+1] & 63) << 6) | (b[i+2] & 63));\n i += 2;\n }\n }\n return ret;\n}\n\n// Set the private key fields N, e, and d from hex strings\nfunction RSASetPrivate(N,E,D) {\n if(N != null && E != null && N.length > 0 && E.length > 0) {\n this.n = parseBigInt(N,16);\n this.e = parseInt(E,16);\n this.d = parseBigInt(D,16);\n }\n else\n console.error(\"Invalid RSA private key\");\n}\n\n// Set the private key fields N, e, d and CRT params from hex strings\nfunction RSASetPrivateEx(N,E,D,P,Q,DP,DQ,C) {\n if(N != null && E != null && N.length > 0 && E.length > 0) {\n this.n = parseBigInt(N,16);\n this.e = parseInt(E,16);\n this.d = parseBigInt(D,16);\n this.p = parseBigInt(P,16);\n this.q = parseBigInt(Q,16);\n this.dmp1 = parseBigInt(DP,16);\n this.dmq1 = parseBigInt(DQ,16);\n this.coeff = parseBigInt(C,16);\n }\n else\n console.error(\"Invalid RSA private key\");\n}\n\n// Generate a new random private key B bits long, using public expt E\nfunction RSAGenerate(B,E) {\n var rng = new SecureRandom();\n var qs = B>>1;\n this.e = parseInt(E,16);\n var ee = new BigInteger(E,16);\n for(;;) {\n for(;;) {\n this.p = new BigInteger(B-qs,1,rng);\n if(this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.p.isProbablePrime(10)) break;\n }\n for(;;) {\n this.q = new BigInteger(qs,1,rng);\n if(this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.q.isProbablePrime(10)) break;\n }\n if(this.p.compareTo(this.q) <= 0) {\n var t = this.p;\n this.p = this.q;\n this.q = t;\n }\n var p1 = this.p.subtract(BigInteger.ONE);\n var q1 = this.q.subtract(BigInteger.ONE);\n var phi = p1.multiply(q1);\n if(phi.gcd(ee).compareTo(BigInteger.ONE) == 0) {\n this.n = this.p.multiply(this.q);\n this.d = ee.modInverse(phi);\n this.dmp1 = this.d.mod(p1);\n this.dmq1 = this.d.mod(q1);\n this.coeff = this.q.modInverse(this.p);\n break;\n }\n }\n}\n\n// Perform raw private operation on \"x\": return x^d (mod n)\nfunction RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}\n\n// Return the PKCS#1 RSA decryption of \"ctext\".\n// \"ctext\" is an even-length hex string and the output is a plain string.\nfunction RSADecrypt(ctext) {\n var c = parseBigInt(ctext, 16);\n var m = this.doPrivate(c);\n if(m == null) return null;\n return pkcs1unpad2(m, (this.n.bitLength()+7)>>3);\n}\n\n// Return the PKCS#1 RSA decryption of \"ctext\".\n// \"ctext\" is a Base64-encoded string and the output is a plain string.\n//function RSAB64Decrypt(ctext) {\n// var h = b64tohex(ctext);\n// if(h) return this.decrypt(h); else return null;\n//}\n\n// protected\nRSAKey.prototype.doPrivate = RSADoPrivate;\n\n// public\nRSAKey.prototype.setPrivate = RSASetPrivate;\nRSAKey.prototype.setPrivateEx = RSASetPrivateEx;\nRSAKey.prototype.generate = RSAGenerate;\nRSAKey.prototype.decrypt = RSADecrypt;\n//RSAKey.prototype.b64_decrypt = RSAB64Decrypt;\n\n// Copyright (c) 2011 Kevin M Burns Jr.\n// All Rights Reserved.\n// See \"LICENSE\" for details.\n//\n// Extension to jsbn which adds facilities for asynchronous RSA key generation\n// Primarily created to avoid execution timeout on mobile devices\n//\n// http://www-cs-students.stanford.edu/~tjw/jsbn/\n//\n// ---\n\n(function(){\n\n// Generate a new random private key B bits long, using public expt E\nvar RSAGenerateAsync = function (B, E, callback) {\n //var rng = new SeededRandom();\n var rng = new SecureRandom();\n var qs = B >> 1;\n this.e = parseInt(E, 16);\n var ee = new BigInteger(E, 16);\n var rsa = this;\n // These functions have non-descript names because they were originally for(;;) loops.\n // I don't know about cryptography to give them better names than loop1-4.\n var loop1 = function() {\n var loop4 = function() {\n if (rsa.p.compareTo(rsa.q) <= 0) {\n var t = rsa.p;\n rsa.p = rsa.q;\n rsa.q = t;\n }\n var p1 = rsa.p.subtract(BigInteger.ONE);\n var q1 = rsa.q.subtract(BigInteger.ONE);\n var phi = p1.multiply(q1);\n if (phi.gcd(ee).compareTo(BigInteger.ONE) == 0) {\n rsa.n = rsa.p.multiply(rsa.q);\n rsa.d = ee.modInverse(phi);\n rsa.dmp1 = rsa.d.mod(p1);\n rsa.dmq1 = rsa.d.mod(q1);\n rsa.coeff = rsa.q.modInverse(rsa.p);\n setTimeout(function(){callback()},0); // escape\n } else {\n setTimeout(loop1,0);\n }\n };\n var loop3 = function() {\n rsa.q = nbi();\n rsa.q.fromNumberAsync(qs, 1, rng, function(){\n rsa.q.subtract(BigInteger.ONE).gcda(ee, function(r){\n if (r.compareTo(BigInteger.ONE) == 0 && rsa.q.isProbablePrime(10)) {\n setTimeout(loop4,0);\n } else {\n setTimeout(loop3,0);\n }\n });\n });\n };\n var loop2 = function() {\n rsa.p = nbi();\n rsa.p.fromNumberAsync(B - qs, 1, rng, function(){\n rsa.p.subtract(BigInteger.ONE).gcda(ee, function(r){\n if (r.compareTo(BigInteger.ONE) == 0 && rsa.p.isProbablePrime(10)) {\n setTimeout(loop3,0);\n } else {\n setTimeout(loop2,0);\n }\n });\n });\n };\n setTimeout(loop2,0);\n };\n setTimeout(loop1,0);\n};\nRSAKey.prototype.generateAsync = RSAGenerateAsync;\n\n// Public API method\nvar bnGCDAsync = function (a, callback) {\n var x = (this.s < 0) ? this.negate() : this.clone();\n var y = (a.s < 0) ? a.negate() : a.clone();\n if (x.compareTo(y) < 0) {\n var t = x;\n x = y;\n y = t;\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit();\n if (g < 0) {\n callback(x);\n return;\n }\n if (i < g) g = i;\n if (g > 0) {\n x.rShiftTo(g, x);\n y.rShiftTo(g, y);\n }\n // Workhorse of the algorithm, gets called 200 - 800 times per 512 bit keygen.\n var gcda1 = function() {\n if ((i = x.getLowestSetBit()) > 0){ x.rShiftTo(i, x); }\n if ((i = y.getLowestSetBit()) > 0){ y.rShiftTo(i, y); }\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x);\n x.rShiftTo(1, x);\n } else {\n y.subTo(x, y);\n y.rShiftTo(1, y);\n }\n if(!(x.signum() > 0)) {\n if (g > 0) y.lShiftTo(g, y);\n setTimeout(function(){callback(y)},0); // escape\n } else {\n setTimeout(gcda1,0);\n }\n };\n setTimeout(gcda1,10);\n};\nBigInteger.prototype.gcda = bnGCDAsync;\n\n// (protected) alternate constructor\nvar bnpFromNumberAsync = function (a,b,c,callback) {\n if(\"number\" == typeof b) {\n if(a < 2) {\n this.fromInt(1);\n } else {\n this.fromNumber(a,c);\n if(!this.testBit(a-1)){\n this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);\n }\n if(this.isEven()) {\n this.dAddOffset(1,0);\n }\n var bnp = this;\n var bnpfn1 = function(){\n bnp.dAddOffset(2,0);\n if(bnp.bitLength() > a) bnp.subTo(BigInteger.ONE.shiftLeft(a-1),bnp);\n if(bnp.isProbablePrime(b)) {\n setTimeout(function(){callback()},0); // escape\n } else {\n setTimeout(bnpfn1,0);\n }\n };\n setTimeout(bnpfn1,0);\n }\n } else {\n var x = new Array(), t = a&7;\n x.length = (a>>3)+1;\n b.nextBytes(x);\n if(t > 0) x[0] &= ((1<> 6) + b64map.charAt(c & 63);\n }\n if(i+1 == h.length) {\n c = parseInt(h.substring(i,i+1),16);\n ret += b64map.charAt(c << 2);\n }\n else if(i+2 == h.length) {\n c = parseInt(h.substring(i,i+2),16);\n ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4);\n }\n while((ret.length & 3) > 0) ret += b64pad;\n return ret;\n}\n\n// convert a base64 string to hex\nfunction b64tohex(s) {\n var ret = \"\"\n var i;\n var k = 0; // b64 state, 0-3\n var slop;\n for(i = 0; i < s.length; ++i) {\n if(s.charAt(i) == b64pad) break;\n v = b64map.indexOf(s.charAt(i));\n if(v < 0) continue;\n if(k == 0) {\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 1;\n }\n else if(k == 1) {\n ret += int2char((slop << 2) | (v >> 4));\n slop = v & 0xf;\n k = 2;\n }\n else if(k == 2) {\n ret += int2char(slop);\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 3;\n }\n else {\n ret += int2char((slop << 2) | (v >> 4));\n ret += int2char(v & 0xf);\n k = 0;\n }\n }\n if(k == 1)\n ret += int2char(slop << 2);\n return ret;\n}\n\n// convert a base64 string to a byte/number array\nfunction b64toBA(s) {\n //piggyback on b64tohex for now, optimize later\n var h = b64tohex(s);\n var i;\n var a = new Array();\n for(i = 0; 2*i < h.length; ++i) {\n a[i] = parseInt(h.substring(2*i,2*i+2),16);\n }\n return a;\n}\n\n/*! asn1-1.0.2.js (c) 2013 Kenji Urushima | kjur.github.com/jsrsasign/license\n */\n\nvar JSX = JSX || {};\nJSX.env = JSX.env || {};\n\nvar L = JSX, OP = Object.prototype, FUNCTION_TOSTRING = '[object Function]',ADD = [\"toString\", \"valueOf\"];\n\nJSX.env.parseUA = function(agent) {\n\n var numberify = function(s) {\n var c = 0;\n return parseFloat(s.replace(/\\./g, function() {\n return (c++ == 1) ? '' : '.';\n }));\n },\n\n nav = navigator,\n o = {\n ie: 0,\n opera: 0,\n gecko: 0,\n webkit: 0,\n chrome: 0,\n mobile: null,\n air: 0,\n ipad: 0,\n iphone: 0,\n ipod: 0,\n ios: null,\n android: 0,\n webos: 0,\n caja: nav && nav.cajaVersion,\n secure: false,\n os: null\n\n },\n\n ua = agent || (navigator && navigator.userAgent),\n loc = window && window.location,\n href = loc && loc.href,\n m;\n\n o.secure = href && (href.toLowerCase().indexOf(\"https\") === 0);\n\n if (ua) {\n\n if ((/windows|win32/i).test(ua)) {\n o.os = 'windows';\n } else if ((/macintosh/i).test(ua)) {\n o.os = 'macintosh';\n } else if ((/rhino/i).test(ua)) {\n o.os = 'rhino';\n }\n if ((/KHTML/).test(ua)) {\n o.webkit = 1;\n }\n m = ua.match(/AppleWebKit\\/([^\\s]*)/);\n if (m && m[1]) {\n o.webkit = numberify(m[1]);\n if (/ Mobile\\//.test(ua)) {\n o.mobile = 'Apple'; // iPhone or iPod Touch\n m = ua.match(/OS ([^\\s]*)/);\n if (m && m[1]) {\n m = numberify(m[1].replace('_', '.'));\n }\n o.ios = m;\n o.ipad = o.ipod = o.iphone = 0;\n m = ua.match(/iPad|iPod|iPhone/);\n if (m && m[0]) {\n o[m[0].toLowerCase()] = o.ios;\n }\n } else {\n m = ua.match(/NokiaN[^\\/]*|Android \\d\\.\\d|webOS\\/\\d\\.\\d/);\n if (m) {\n o.mobile = m[0];\n }\n if (/webOS/.test(ua)) {\n o.mobile = 'WebOS';\n m = ua.match(/webOS\\/([^\\s]*);/);\n if (m && m[1]) {\n o.webos = numberify(m[1]);\n }\n }\n if (/ Android/.test(ua)) {\n o.mobile = 'Android';\n m = ua.match(/Android ([^\\s]*);/);\n if (m && m[1]) {\n o.android = numberify(m[1]);\n }\n }\n }\n m = ua.match(/Chrome\\/([^\\s]*)/);\n if (m && m[1]) {\n o.chrome = numberify(m[1]); // Chrome\n } else {\n m = ua.match(/AdobeAIR\\/([^\\s]*)/);\n if (m) {\n o.air = m[0]; // Adobe AIR 1.0 or better\n }\n }\n }\n if (!o.webkit) {\n m = ua.match(/Opera[\\s\\/]([^\\s]*)/);\n if (m && m[1]) {\n o.opera = numberify(m[1]);\n m = ua.match(/Version\\/([^\\s]*)/);\n if (m && m[1]) {\n o.opera = numberify(m[1]); // opera 10+\n }\n m = ua.match(/Opera Mini[^;]*/);\n if (m) {\n o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316\n }\n } else { // not opera or webkit\n m = ua.match(/MSIE\\s([^;]*)/);\n if (m && m[1]) {\n o.ie = numberify(m[1]);\n } else { // not opera, webkit, or ie\n m = ua.match(/Gecko\\/([^\\s]*)/);\n if (m) {\n o.gecko = 1; // Gecko detected, look for revision\n m = ua.match(/rv:([^\\s\\)]*)/);\n if (m && m[1]) {\n o.gecko = numberify(m[1]);\n }\n }\n }\n }\n }\n }\n return o;\n};\n\nJSX.env.ua = JSX.env.parseUA();\n\nJSX.isFunction = function(o) {\n return (typeof o === 'function') || OP.toString.apply(o) === FUNCTION_TOSTRING;\n};\n\nJSX._IEEnumFix = (JSX.env.ua.ie) ? function(r, s) {\n var i, fname, f;\n for (i=0;iMIT License\n */\n\n/** \n * kjur's class library name space\n *

\n * This name space provides following name spaces:\n *

    \n *
  • {@link KJUR.asn1} - ASN.1 primitive hexadecimal encoder
  • \n *
  • {@link KJUR.asn1.x509} - ASN.1 structure for X.509 certificate and CRL
  • \n *
  • {@link KJUR.crypto} - Java Cryptographic Extension(JCE) style MessageDigest/Signature \n * class and utilities
  • \n *
\n *

\n * NOTE: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.\n * @name KJUR\n * @namespace kjur's class library name space\n */\nif (typeof KJUR == \"undefined\" || !KJUR) KJUR = {};\n\n/**\n * kjur's ASN.1 class library name space\n *

\n * This is ITU-T X.690 ASN.1 DER encoder class library and\n * class structure and methods is very similar to \n * org.bouncycastle.asn1 package of \n * well known BouncyCaslte Cryptography Library.\n *\n *

PROVIDING ASN.1 PRIMITIVES

\n * Here are ASN.1 DER primitive classes.\n *
    \n *
  • {@link KJUR.asn1.DERBoolean}
  • \n *
  • {@link KJUR.asn1.DERInteger}
  • \n *
  • {@link KJUR.asn1.DERBitString}
  • \n *
  • {@link KJUR.asn1.DEROctetString}
  • \n *
  • {@link KJUR.asn1.DERNull}
  • \n *
  • {@link KJUR.asn1.DERObjectIdentifier}
  • \n *
  • {@link KJUR.asn1.DERUTF8String}
  • \n *
  • {@link KJUR.asn1.DERNumericString}
  • \n *
  • {@link KJUR.asn1.DERPrintableString}
  • \n *
  • {@link KJUR.asn1.DERTeletexString}
  • \n *
  • {@link KJUR.asn1.DERIA5String}
  • \n *
  • {@link KJUR.asn1.DERUTCTime}
  • \n *
  • {@link KJUR.asn1.DERGeneralizedTime}
  • \n *
  • {@link KJUR.asn1.DERSequence}
  • \n *
  • {@link KJUR.asn1.DERSet}
  • \n *
\n *\n *

OTHER ASN.1 CLASSES

\n *
    \n *
  • {@link KJUR.asn1.ASN1Object}
  • \n *
  • {@link KJUR.asn1.DERAbstractString}
  • \n *
  • {@link KJUR.asn1.DERAbstractTime}
  • \n *
  • {@link KJUR.asn1.DERAbstractStructured}
  • \n *
  • {@link KJUR.asn1.DERTaggedObject}
  • \n *
\n *

\n * NOTE: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.\n * @name KJUR.asn1\n * @namespace\n */\nif (typeof KJUR.asn1 == \"undefined\" || !KJUR.asn1) KJUR.asn1 = {};\n\n/**\n * ASN1 utilities class\n * @name KJUR.asn1.ASN1Util\n * @classs ASN1 utilities class\n * @since asn1 1.0.2\n */\nKJUR.asn1.ASN1Util = new function() {\n this.integerToByteHex = function(i) {\n\tvar h = i.toString(16);\n\tif ((h.length % 2) == 1) h = '0' + h;\n\treturn h;\n };\n this.bigIntToMinTwosComplementsHex = function(bigIntegerValue) {\n\tvar h = bigIntegerValue.toString(16);\n\tif (h.substr(0, 1) != '-') {\n\t if (h.length % 2 == 1) {\n\t\th = '0' + h;\n\t } else {\n\t\tif (! h.match(/^[0-7]/)) {\n\t\t h = '00' + h;\n\t\t}\n\t }\n\t} else {\n\t var hPos = h.substr(1);\n\t var xorLen = hPos.length;\n\t if (xorLen % 2 == 1) {\n\t\txorLen += 1;\n\t } else {\n\t\tif (! h.match(/^[0-7]/)) {\n\t\t xorLen += 2;\n\t\t}\n\t }\n\t var hMask = '';\n\t for (var i = 0; i < xorLen; i++) {\n\t\thMask += 'f';\n\t }\n\t var biMask = new BigInteger(hMask, 16);\n\t var biNeg = biMask.xor(bigIntegerValue).add(BigInteger.ONE);\n\t h = biNeg.toString(16).replace(/^-/, '');\n\t}\n\treturn h;\n };\n /**\n * get PEM string from hexadecimal data and header string\n * @name getPEMStringFromHex\n * @memberOf KJUR.asn1.ASN1Util\n * @function\n * @param {String} dataHex hexadecimal string of PEM body\n * @param {String} pemHeader PEM header string (ex. 'RSA PRIVATE KEY')\n * @return {String} PEM formatted string of input data\n * @description\n * @example\n * var pem = KJUR.asn1.ASN1Util.getPEMStringFromHex('616161', 'RSA PRIVATE KEY');\n * // value of pem will be:\n * -----BEGIN PRIVATE KEY-----\n * YWFh\n * -----END PRIVATE KEY-----\n */\n this.getPEMStringFromHex = function(dataHex, pemHeader) {\n\tvar dataWA = CryptoJS.enc.Hex.parse(dataHex);\n\tvar dataB64 = CryptoJS.enc.Base64.stringify(dataWA);\n\tvar pemBody = dataB64.replace(/(.{64})/g, \"$1\\r\\n\");\n pemBody = pemBody.replace(/\\r\\n$/, '');\n\treturn \"-----BEGIN \" + pemHeader + \"-----\\r\\n\" + \n pemBody + \n \"\\r\\n-----END \" + pemHeader + \"-----\\r\\n\";\n };\n};\n\n// ********************************************************************\n// Abstract ASN.1 Classes\n// ********************************************************************\n\n// ********************************************************************\n\n/**\n * base class for ASN.1 DER encoder object\n * @name KJUR.asn1.ASN1Object\n * @class base class for ASN.1 DER encoder object\n * @property {Boolean} isModified flag whether internal data was changed\n * @property {String} hTLV hexadecimal string of ASN.1 TLV\n * @property {String} hT hexadecimal string of ASN.1 TLV tag(T)\n * @property {String} hL hexadecimal string of ASN.1 TLV length(L)\n * @property {String} hV hexadecimal string of ASN.1 TLV value(V)\n * @description\n */\nKJUR.asn1.ASN1Object = function() {\n var isModified = true;\n var hTLV = null;\n var hT = '00'\n var hL = '00';\n var hV = '';\n\n /**\n * get hexadecimal ASN.1 TLV length(L) bytes from TLV value(V)\n * @name getLengthHexFromValue\n * @memberOf KJUR.asn1.ASN1Object\n * @function\n * @return {String} hexadecimal string of ASN.1 TLV length(L)\n */\n this.getLengthHexFromValue = function() {\n\tif (typeof this.hV == \"undefined\" || this.hV == null) {\n\t throw \"this.hV is null or undefined.\";\n\t}\n\tif (this.hV.length % 2 == 1) {\n\t throw \"value hex must be even length: n=\" + hV.length + \",v=\" + this.hV;\n\t}\n\tvar n = this.hV.length / 2;\n\tvar hN = n.toString(16);\n\tif (hN.length % 2 == 1) {\n\t hN = \"0\" + hN;\n\t}\n\tif (n < 128) {\n\t return hN;\n\t} else {\n\t var hNlen = hN.length / 2;\n\t if (hNlen > 15) {\n\t\tthrow \"ASN.1 length too long to represent by 8x: n = \" + n.toString(16);\n\t }\n\t var head = 128 + hNlen;\n\t return head.toString(16) + hN;\n\t}\n };\n\n /**\n * get hexadecimal string of ASN.1 TLV bytes\n * @name getEncodedHex\n * @memberOf KJUR.asn1.ASN1Object\n * @function\n * @return {String} hexadecimal string of ASN.1 TLV\n */\n this.getEncodedHex = function() {\n\tif (this.hTLV == null || this.isModified) {\n\t this.hV = this.getFreshValueHex();\n\t this.hL = this.getLengthHexFromValue();\n\t this.hTLV = this.hT + this.hL + this.hV;\n\t this.isModified = false;\n\t //console.error(\"first time: \" + this.hTLV);\n\t}\n\treturn this.hTLV;\n };\n\n /**\n * get hexadecimal string of ASN.1 TLV value(V) bytes\n * @name getValueHex\n * @memberOf KJUR.asn1.ASN1Object\n * @function\n * @return {String} hexadecimal string of ASN.1 TLV value(V) bytes\n */\n this.getValueHex = function() {\n\tthis.getEncodedHex();\n\treturn this.hV;\n }\n\n this.getFreshValueHex = function() {\n\treturn '';\n };\n};\n\n// == BEGIN DERAbstractString ================================================\n/**\n * base class for ASN.1 DER string classes\n * @name KJUR.asn1.DERAbstractString\n * @class base class for ASN.1 DER string classes\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @property {String} s internal string of value\n * @extends KJUR.asn1.ASN1Object\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • str - specify initial ASN.1 value(V) by a string
  • \n *
  • hex - specify initial ASN.1 value(V) by a hexadecimal string
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERAbstractString = function(params) {\n KJUR.asn1.DERAbstractString.superclass.constructor.call(this);\n var s = null;\n var hV = null;\n\n /**\n * get string value of this string object\n * @name getString\n * @memberOf KJUR.asn1.DERAbstractString\n * @function\n * @return {String} string value of this string object\n */\n this.getString = function() {\n\treturn this.s;\n };\n\n /**\n * set value by a string\n * @name setString\n * @memberOf KJUR.asn1.DERAbstractString\n * @function\n * @param {String} newS value by a string to set\n */\n this.setString = function(newS) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.s = newS;\n\tthis.hV = stohex(this.s);\n };\n\n /**\n * set value by a hexadecimal string\n * @name setStringHex\n * @memberOf KJUR.asn1.DERAbstractString\n * @function\n * @param {String} newHexString value by a hexadecimal string to set\n */\n this.setStringHex = function(newHexString) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.s = null;\n\tthis.hV = newHexString;\n };\n\n this.getFreshValueHex = function() {\n\treturn this.hV;\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['str'] != \"undefined\") {\n\t this.setString(params['str']);\n\t} else if (typeof params['hex'] != \"undefined\") {\n\t this.setStringHex(params['hex']);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERAbstractString, KJUR.asn1.ASN1Object);\n// == END DERAbstractString ================================================\n\n// == BEGIN DERAbstractTime ==================================================\n/**\n * base class for ASN.1 DER Generalized/UTCTime class\n * @name KJUR.asn1.DERAbstractTime\n * @class base class for ASN.1 DER Generalized/UTCTime class\n * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})\n * @extends KJUR.asn1.ASN1Object\n * @description\n * @see KJUR.asn1.ASN1Object - superclass\n */\nKJUR.asn1.DERAbstractTime = function(params) {\n KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);\n var s = null;\n var date = null;\n\n // --- PRIVATE METHODS --------------------\n this.localDateToUTC = function(d) {\n\tutc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\tvar utcDate = new Date(utc);\n\treturn utcDate;\n };\n\n this.formatDate = function(dateObject, type) {\n\tvar pad = this.zeroPadding;\n\tvar d = this.localDateToUTC(dateObject);\n\tvar year = String(d.getFullYear());\n\tif (type == 'utc') year = year.substr(2, 2);\n\tvar month = pad(String(d.getMonth() + 1), 2);\n\tvar day = pad(String(d.getDate()), 2);\n\tvar hour = pad(String(d.getHours()), 2);\n\tvar min = pad(String(d.getMinutes()), 2);\n\tvar sec = pad(String(d.getSeconds()), 2);\n\treturn year + month + day + hour + min + sec + 'Z';\n };\n\n this.zeroPadding = function(s, len) {\n\tif (s.length >= len) return s;\n\treturn new Array(len - s.length + 1).join('0') + s;\n };\n\n // --- PUBLIC METHODS --------------------\n /**\n * get string value of this string object\n * @name getString\n * @memberOf KJUR.asn1.DERAbstractTime\n * @function\n * @return {String} string value of this time object\n */\n this.getString = function() {\n\treturn this.s;\n };\n\n /**\n * set value by a string\n * @name setString\n * @memberOf KJUR.asn1.DERAbstractTime\n * @function\n * @param {String} newS value by a string to set such like \"130430235959Z\"\n */\n this.setString = function(newS) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.s = newS;\n\tthis.hV = stohex(this.s);\n };\n\n /**\n * set value by a Date object\n * @name setByDateValue\n * @memberOf KJUR.asn1.DERAbstractTime\n * @function\n * @param {Integer} year year of date (ex. 2013)\n * @param {Integer} month month of date between 1 and 12 (ex. 12)\n * @param {Integer} day day of month\n * @param {Integer} hour hours of date\n * @param {Integer} min minutes of date\n * @param {Integer} sec seconds of date\n */\n this.setByDateValue = function(year, month, day, hour, min, sec) {\n\tvar dateObject = new Date(Date.UTC(year, month - 1, day, hour, min, sec, 0));\n\tthis.setByDate(dateObject);\n };\n\n this.getFreshValueHex = function() {\n\treturn this.hV;\n };\n};\nJSX.extend(KJUR.asn1.DERAbstractTime, KJUR.asn1.ASN1Object);\n// == END DERAbstractTime ==================================================\n\n// == BEGIN DERAbstractStructured ============================================\n/**\n * base class for ASN.1 DER structured class\n * @name KJUR.asn1.DERAbstractStructured\n * @class base class for ASN.1 DER structured class\n * @property {Array} asn1Array internal array of ASN1Object\n * @extends KJUR.asn1.ASN1Object\n * @description\n * @see KJUR.asn1.ASN1Object - superclass\n */\nKJUR.asn1.DERAbstractStructured = function(params) {\n KJUR.asn1.DERAbstractString.superclass.constructor.call(this);\n var asn1Array = null;\n\n /**\n * set value by array of ASN1Object\n * @name setByASN1ObjectArray\n * @memberOf KJUR.asn1.DERAbstractStructured\n * @function\n * @param {array} asn1ObjectArray array of ASN1Object to set\n */\n this.setByASN1ObjectArray = function(asn1ObjectArray) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.asn1Array = asn1ObjectArray;\n };\n\n /**\n * append an ASN1Object to internal array\n * @name appendASN1Object\n * @memberOf KJUR.asn1.DERAbstractStructured\n * @function\n * @param {ASN1Object} asn1Object to add\n */\n this.appendASN1Object = function(asn1Object) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.asn1Array.push(asn1Object);\n };\n\n this.asn1Array = new Array();\n if (typeof params != \"undefined\") {\n\tif (typeof params['array'] != \"undefined\") {\n\t this.asn1Array = params['array'];\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERAbstractStructured, KJUR.asn1.ASN1Object);\n\n\n// ********************************************************************\n// ASN.1 Object Classes\n// ********************************************************************\n\n// ********************************************************************\n/**\n * class for ASN.1 DER Boolean\n * @name KJUR.asn1.DERBoolean\n * @class class for ASN.1 DER Boolean\n * @extends KJUR.asn1.ASN1Object\n * @description\n * @see KJUR.asn1.ASN1Object - superclass\n */\nKJUR.asn1.DERBoolean = function() {\n KJUR.asn1.DERBoolean.superclass.constructor.call(this);\n this.hT = \"01\";\n this.hTLV = \"0101ff\";\n};\nJSX.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER Integer\n * @name KJUR.asn1.DERInteger\n * @class class for ASN.1 DER Integer\n * @extends KJUR.asn1.ASN1Object\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • int - specify initial ASN.1 value(V) by integer value
  • \n *
  • bigint - specify initial ASN.1 value(V) by BigInteger object
  • \n *
  • hex - specify initial ASN.1 value(V) by a hexadecimal string
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERInteger = function(params) {\n KJUR.asn1.DERInteger.superclass.constructor.call(this);\n this.hT = \"02\";\n\n /**\n * set value by Tom Wu's BigInteger object\n * @name setByBigInteger\n * @memberOf KJUR.asn1.DERInteger\n * @function\n * @param {BigInteger} bigIntegerValue to set\n */\n this.setByBigInteger = function(bigIntegerValue) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(bigIntegerValue);\n };\n\n /**\n * set value by integer value\n * @name setByInteger\n * @memberOf KJUR.asn1.DERInteger\n * @function\n * @param {Integer} integer value to set\n */\n this.setByInteger = function(intValue) {\n\tvar bi = new BigInteger(String(intValue), 10);\n\tthis.setByBigInteger(bi);\n };\n\n /**\n * set value by integer value\n * @name setValueHex\n * @memberOf KJUR.asn1.DERInteger\n * @function\n * @param {String} hexadecimal string of integer value\n * @description\n *
\n * NOTE: Value shall be represented by minimum octet length of\n * two's complement representation.\n */\n this.setValueHex = function(newHexString) {\n\tthis.hV = newHexString;\n };\n\n this.getFreshValueHex = function() {\n\treturn this.hV;\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['bigint'] != \"undefined\") {\n\t this.setByBigInteger(params['bigint']);\n\t} else if (typeof params['int'] != \"undefined\") {\n\t this.setByInteger(params['int']);\n\t} else if (typeof params['hex'] != \"undefined\") {\n\t this.setValueHex(params['hex']);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER encoded BitString primitive\n * @name KJUR.asn1.DERBitString\n * @class class for ASN.1 DER encoded BitString primitive\n * @extends KJUR.asn1.ASN1Object\n * @description \n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • bin - specify binary string (ex. '10111')
  • \n *
  • array - specify array of boolean (ex. [true,false,true,true])
  • \n *
  • hex - specify hexadecimal string of ASN.1 value(V) including unused bits
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERBitString = function(params) {\n KJUR.asn1.DERBitString.superclass.constructor.call(this);\n this.hT = \"03\";\n\n /**\n * set ASN.1 value(V) by a hexadecimal string including unused bits\n * @name setHexValueIncludingUnusedBits\n * @memberOf KJUR.asn1.DERBitString\n * @function\n * @param {String} newHexStringIncludingUnusedBits\n */\n this.setHexValueIncludingUnusedBits = function(newHexStringIncludingUnusedBits) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.hV = newHexStringIncludingUnusedBits;\n };\n\n /**\n * set ASN.1 value(V) by unused bit and hexadecimal string of value\n * @name setUnusedBitsAndHexValue\n * @memberOf KJUR.asn1.DERBitString\n * @function\n * @param {Integer} unusedBits\n * @param {String} hValue\n */\n this.setUnusedBitsAndHexValue = function(unusedBits, hValue) {\n\tif (unusedBits < 0 || 7 < unusedBits) {\n\t throw \"unused bits shall be from 0 to 7: u = \" + unusedBits;\n\t}\n\tvar hUnusedBits = \"0\" + unusedBits;\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.hV = hUnusedBits + hValue;\n };\n\n /**\n * set ASN.1 DER BitString by binary string\n * @name setByBinaryString\n * @memberOf KJUR.asn1.DERBitString\n * @function\n * @param {String} binaryString binary value string (i.e. '10111')\n * @description\n * Its unused bits will be calculated automatically by length of \n * 'binaryValue'.
\n * NOTE: Trailing zeros '0' will be ignored.\n */\n this.setByBinaryString = function(binaryString) {\n\tbinaryString = binaryString.replace(/0+$/, '');\n\tvar unusedBits = 8 - binaryString.length % 8;\n\tif (unusedBits == 8) unusedBits = 0;\n\tfor (var i = 0; i <= unusedBits; i++) {\n\t binaryString += '0';\n\t}\n\tvar h = '';\n\tfor (var i = 0; i < binaryString.length - 1; i += 8) {\n\t var b = binaryString.substr(i, 8);\n\t var x = parseInt(b, 2).toString(16);\n\t if (x.length == 1) x = '0' + x;\n\t h += x; \n\t}\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.hV = '0' + unusedBits + h;\n };\n\n /**\n * set ASN.1 TLV value(V) by an array of boolean\n * @name setByBooleanArray\n * @memberOf KJUR.asn1.DERBitString\n * @function\n * @param {array} booleanArray array of boolean (ex. [true, false, true])\n * @description\n * NOTE: Trailing falses will be ignored.\n */\n this.setByBooleanArray = function(booleanArray) {\n\tvar s = '';\n\tfor (var i = 0; i < booleanArray.length; i++) {\n\t if (booleanArray[i] == true) {\n\t\ts += '1';\n\t } else {\n\t\ts += '0';\n\t }\n\t}\n\tthis.setByBinaryString(s);\n };\n\n /**\n * generate an array of false with specified length\n * @name newFalseArray\n * @memberOf KJUR.asn1.DERBitString\n * @function\n * @param {Integer} nLength length of array to generate\n * @return {array} array of boolean faluse\n * @description\n * This static method may be useful to initialize boolean array.\n */\n this.newFalseArray = function(nLength) {\n\tvar a = new Array(nLength);\n\tfor (var i = 0; i < nLength; i++) {\n\t a[i] = false;\n\t}\n\treturn a;\n };\n\n this.getFreshValueHex = function() {\n\treturn this.hV;\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['hex'] != \"undefined\") {\n\t this.setHexValueIncludingUnusedBits(params['hex']);\n\t} else if (typeof params['bin'] != \"undefined\") {\n\t this.setByBinaryString(params['bin']);\n\t} else if (typeof params['array'] != \"undefined\") {\n\t this.setByBooleanArray(params['array']);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER OctetString\n * @name KJUR.asn1.DEROctetString\n * @class class for ASN.1 DER OctetString\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @extends KJUR.asn1.DERAbstractString\n * @description\n * @see KJUR.asn1.DERAbstractString - superclass\n */\nKJUR.asn1.DEROctetString = function(params) {\n KJUR.asn1.DEROctetString.superclass.constructor.call(this, params);\n this.hT = \"04\";\n};\nJSX.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER Null\n * @name KJUR.asn1.DERNull\n * @class class for ASN.1 DER Null\n * @extends KJUR.asn1.ASN1Object\n * @description\n * @see KJUR.asn1.ASN1Object - superclass\n */\nKJUR.asn1.DERNull = function() {\n KJUR.asn1.DERNull.superclass.constructor.call(this);\n this.hT = \"05\";\n this.hTLV = \"0500\";\n};\nJSX.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER ObjectIdentifier\n * @name KJUR.asn1.DERObjectIdentifier\n * @class class for ASN.1 DER ObjectIdentifier\n * @param {Array} params associative array of parameters (ex. {'oid': '2.5.4.5'})\n * @extends KJUR.asn1.ASN1Object\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • oid - specify initial ASN.1 value(V) by a oid string (ex. 2.5.4.13)
  • \n *
  • hex - specify initial ASN.1 value(V) by a hexadecimal string
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERObjectIdentifier = function(params) {\n var itox = function(i) {\n\tvar h = i.toString(16);\n\tif (h.length == 1) h = '0' + h;\n\treturn h;\n };\n var roidtox = function(roid) {\n\tvar h = '';\n\tvar bi = new BigInteger(roid, 10);\n\tvar b = bi.toString(2);\n\tvar padLen = 7 - b.length % 7;\n\tif (padLen == 7) padLen = 0;\n\tvar bPad = '';\n\tfor (var i = 0; i < padLen; i++) bPad += '0';\n\tb = bPad + b;\n\tfor (var i = 0; i < b.length - 1; i += 7) {\n\t var b8 = b.substr(i, 7);\n\t if (i != b.length - 7) b8 = '1' + b8;\n\t h += itox(parseInt(b8, 2));\n\t}\n\treturn h;\n }\n\n KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this);\n this.hT = \"06\";\n\n /**\n * set value by a hexadecimal string\n * @name setValueHex\n * @memberOf KJUR.asn1.DERObjectIdentifier\n * @function\n * @param {String} newHexString hexadecimal value of OID bytes\n */\n this.setValueHex = function(newHexString) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.s = null;\n\tthis.hV = newHexString;\n };\n\n /**\n * set value by a OID string\n * @name setValueOidString\n * @memberOf KJUR.asn1.DERObjectIdentifier\n * @function\n * @param {String} oidString OID string (ex. 2.5.4.13)\n */\n this.setValueOidString = function(oidString) {\n\tif (! oidString.match(/^[0-9.]+$/)) {\n\t throw \"malformed oid string: \" + oidString;\n\t}\n\tvar h = '';\n\tvar a = oidString.split('.');\n\tvar i0 = parseInt(a[0]) * 40 + parseInt(a[1]);\n\th += itox(i0);\n\ta.splice(0, 2);\n\tfor (var i = 0; i < a.length; i++) {\n\t h += roidtox(a[i]);\n\t}\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.s = null;\n\tthis.hV = h;\n };\n\n /**\n * set value by a OID name\n * @name setValueName\n * @memberOf KJUR.asn1.DERObjectIdentifier\n * @function\n * @param {String} oidName OID name (ex. 'serverAuth')\n * @since 1.0.1\n * @description\n * OID name shall be defined in 'KJUR.asn1.x509.OID.name2oidList'.\n * Otherwise raise error.\n */\n this.setValueName = function(oidName) {\n\tif (typeof KJUR.asn1.x509.OID.name2oidList[oidName] != \"undefined\") {\n\t var oid = KJUR.asn1.x509.OID.name2oidList[oidName];\n\t this.setValueOidString(oid);\n\t} else {\n\t throw \"DERObjectIdentifier oidName undefined: \" + oidName;\n\t}\n };\n\n this.getFreshValueHex = function() {\n\treturn this.hV;\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['oid'] != \"undefined\") {\n\t this.setValueOidString(params['oid']);\n\t} else if (typeof params['hex'] != \"undefined\") {\n\t this.setValueHex(params['hex']);\n\t} else if (typeof params['name'] != \"undefined\") {\n\t this.setValueName(params['name']);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER UTF8String\n * @name KJUR.asn1.DERUTF8String\n * @class class for ASN.1 DER UTF8String\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @extends KJUR.asn1.DERAbstractString\n * @description\n * @see KJUR.asn1.DERAbstractString - superclass\n */\nKJUR.asn1.DERUTF8String = function(params) {\n KJUR.asn1.DERUTF8String.superclass.constructor.call(this, params);\n this.hT = \"0c\";\n};\nJSX.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER NumericString\n * @name KJUR.asn1.DERNumericString\n * @class class for ASN.1 DER NumericString\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @extends KJUR.asn1.DERAbstractString\n * @description\n * @see KJUR.asn1.DERAbstractString - superclass\n */\nKJUR.asn1.DERNumericString = function(params) {\n KJUR.asn1.DERNumericString.superclass.constructor.call(this, params);\n this.hT = \"12\";\n};\nJSX.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER PrintableString\n * @name KJUR.asn1.DERPrintableString\n * @class class for ASN.1 DER PrintableString\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @extends KJUR.asn1.DERAbstractString\n * @description\n * @see KJUR.asn1.DERAbstractString - superclass\n */\nKJUR.asn1.DERPrintableString = function(params) {\n KJUR.asn1.DERPrintableString.superclass.constructor.call(this, params);\n this.hT = \"13\";\n};\nJSX.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER TeletexString\n * @name KJUR.asn1.DERTeletexString\n * @class class for ASN.1 DER TeletexString\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @extends KJUR.asn1.DERAbstractString\n * @description\n * @see KJUR.asn1.DERAbstractString - superclass\n */\nKJUR.asn1.DERTeletexString = function(params) {\n KJUR.asn1.DERTeletexString.superclass.constructor.call(this, params);\n this.hT = \"14\";\n};\nJSX.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER IA5String\n * @name KJUR.asn1.DERIA5String\n * @class class for ASN.1 DER IA5String\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @extends KJUR.asn1.DERAbstractString\n * @description\n * @see KJUR.asn1.DERAbstractString - superclass\n */\nKJUR.asn1.DERIA5String = function(params) {\n KJUR.asn1.DERIA5String.superclass.constructor.call(this, params);\n this.hT = \"16\";\n};\nJSX.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER UTCTime\n * @name KJUR.asn1.DERUTCTime\n * @class class for ASN.1 DER UTCTime\n * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})\n * @extends KJUR.asn1.DERAbstractTime\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • str - specify initial ASN.1 value(V) by a string (ex.'130430235959Z')
  • \n *
  • hex - specify initial ASN.1 value(V) by a hexadecimal string
  • \n *
  • date - specify Date object.
  • \n *
\n * NOTE: 'params' can be omitted.\n *

EXAMPLES

\n * @example\n * var d1 = new KJUR.asn1.DERUTCTime();\n * d1.setString('130430125959Z');\n *\n * var d2 = new KJUR.asn1.DERUTCTime({'str': '130430125959Z'});\n *\n * var d3 = new KJUR.asn1.DERUTCTime({'date': new Date(Date.UTC(2015, 0, 31, 0, 0, 0, 0))});\n */\nKJUR.asn1.DERUTCTime = function(params) {\n KJUR.asn1.DERUTCTime.superclass.constructor.call(this, params);\n this.hT = \"17\";\n\n /**\n * set value by a Date object\n * @name setByDate\n * @memberOf KJUR.asn1.DERUTCTime\n * @function\n * @param {Date} dateObject Date object to set ASN.1 value(V)\n */\n this.setByDate = function(dateObject) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.date = dateObject;\n\tthis.s = this.formatDate(this.date, 'utc');\n\tthis.hV = stohex(this.s);\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['str'] != \"undefined\") {\n\t this.setString(params['str']);\n\t} else if (typeof params['hex'] != \"undefined\") {\n\t this.setStringHex(params['hex']);\n\t} else if (typeof params['date'] != \"undefined\") {\n\t this.setByDate(params['date']);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER GeneralizedTime\n * @name KJUR.asn1.DERGeneralizedTime\n * @class class for ASN.1 DER GeneralizedTime\n * @param {Array} params associative array of parameters (ex. {'str': '20130430235959Z'})\n * @extends KJUR.asn1.DERAbstractTime\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • str - specify initial ASN.1 value(V) by a string (ex.'20130430235959Z')
  • \n *
  • hex - specify initial ASN.1 value(V) by a hexadecimal string
  • \n *
  • date - specify Date object.
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERGeneralizedTime = function(params) {\n KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, params);\n this.hT = \"18\";\n\n /**\n * set value by a Date object\n * @name setByDate\n * @memberOf KJUR.asn1.DERGeneralizedTime\n * @function\n * @param {Date} dateObject Date object to set ASN.1 value(V)\n * @example\n * When you specify UTC time, use 'Date.UTC' method like this:
\n * var o = new DERUTCTime();\n * var date = new Date(Date.UTC(2015, 0, 31, 23, 59, 59, 0)); #2015JAN31 23:59:59\n * o.setByDate(date);\n */\n this.setByDate = function(dateObject) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.date = dateObject;\n\tthis.s = this.formatDate(this.date, 'gen');\n\tthis.hV = stohex(this.s);\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['str'] != \"undefined\") {\n\t this.setString(params['str']);\n\t} else if (typeof params['hex'] != \"undefined\") {\n\t this.setStringHex(params['hex']);\n\t} else if (typeof params['date'] != \"undefined\") {\n\t this.setByDate(params['date']);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER Sequence\n * @name KJUR.asn1.DERSequence\n * @class class for ASN.1 DER Sequence\n * @extends KJUR.asn1.DERAbstractStructured\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • array - specify array of ASN1Object to set elements of content
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERSequence = function(params) {\n KJUR.asn1.DERSequence.superclass.constructor.call(this, params);\n this.hT = \"30\";\n this.getFreshValueHex = function() {\n\tvar h = '';\n\tfor (var i = 0; i < this.asn1Array.length; i++) {\n\t var asn1Obj = this.asn1Array[i];\n\t h += asn1Obj.getEncodedHex();\n\t}\n\tthis.hV = h;\n\treturn this.hV;\n };\n};\nJSX.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER Set\n * @name KJUR.asn1.DERSet\n * @class class for ASN.1 DER Set\n * @extends KJUR.asn1.DERAbstractStructured\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • array - specify array of ASN1Object to set elements of content
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERSet = function(params) {\n KJUR.asn1.DERSet.superclass.constructor.call(this, params);\n this.hT = \"31\";\n this.getFreshValueHex = function() {\n\tvar a = new Array();\n\tfor (var i = 0; i < this.asn1Array.length; i++) {\n\t var asn1Obj = this.asn1Array[i];\n\t a.push(asn1Obj.getEncodedHex());\n\t}\n\ta.sort();\n\tthis.hV = a.join('');\n\treturn this.hV;\n };\n};\nJSX.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER TaggedObject\n * @name KJUR.asn1.DERTaggedObject\n * @class class for ASN.1 DER TaggedObject\n * @extends KJUR.asn1.ASN1Object\n * @description\n *
\n * Parameter 'tagNoNex' is ASN.1 tag(T) value for this object.\n * For example, if you find '[1]' tag in a ASN.1 dump, \n * 'tagNoHex' will be 'a1'.\n *
\n * As for optional argument 'params' for constructor, you can specify *ANY* of\n * following properties:\n *
    \n *
  • explicit - specify true if this is explicit tag otherwise false \n * (default is 'true').
  • \n *
  • tag - specify tag (default is 'a0' which means [0])
  • \n *
  • obj - specify ASN1Object which is tagged
  • \n *
\n * @example\n * d1 = new KJUR.asn1.DERUTF8String({'str':'a'});\n * d2 = new KJUR.asn1.DERTaggedObject({'obj': d1});\n * hex = d2.getEncodedHex();\n */\nKJUR.asn1.DERTaggedObject = function(params) {\n KJUR.asn1.DERTaggedObject.superclass.constructor.call(this);\n this.hT = \"a0\";\n this.hV = '';\n this.isExplicit = true;\n this.asn1Object = null;\n\n /**\n * set value by an ASN1Object\n * @name setString\n * @memberOf KJUR.asn1.DERTaggedObject\n * @function\n * @param {Boolean} isExplicitFlag flag for explicit/implicit tag\n * @param {Integer} tagNoHex hexadecimal string of ASN.1 tag\n * @param {ASN1Object} asn1Object ASN.1 to encapsulate\n */\n this.setASN1Object = function(isExplicitFlag, tagNoHex, asn1Object) {\n\tthis.hT = tagNoHex;\n\tthis.isExplicit = isExplicitFlag;\n\tthis.asn1Object = asn1Object;\n\tif (this.isExplicit) {\n\t this.hV = this.asn1Object.getEncodedHex();\n\t this.hTLV = null;\n\t this.isModified = true;\n\t} else {\n\t this.hV = null;\n\t this.hTLV = asn1Object.getEncodedHex();\n\t this.hTLV = this.hTLV.replace(/^../, tagNoHex);\n\t this.isModified = false;\n\t}\n };\n\n this.getFreshValueHex = function() {\n\treturn this.hV;\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['tag'] != \"undefined\") {\n\t this.hT = params['tag'];\n\t}\n\tif (typeof params['explicit'] != \"undefined\") {\n\t this.isExplicit = params['explicit'];\n\t}\n\tif (typeof params['obj'] != \"undefined\") {\n\t this.asn1Object = params['obj'];\n\t this.setASN1Object(this.isExplicit, this.hT, this.asn1Object);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object);\n// Hex JavaScript decoder\n// Copyright (c) 2008-2013 Lapo Luchini \n\n// Permission to use, copy, modify, and/or distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */\n(function (undefined) {\n\"use strict\";\n\nvar Hex = {},\n decoder;\n\nHex.decode = function(a) {\n var i;\n if (decoder === undefined) {\n var hex = \"0123456789ABCDEF\",\n ignore = \" \\f\\n\\r\\t\\u00A0\\u2028\\u2029\";\n decoder = [];\n for (i = 0; i < 16; ++i)\n decoder[hex.charAt(i)] = i;\n hex = hex.toLowerCase();\n for (i = 10; i < 16; ++i)\n decoder[hex.charAt(i)] = i;\n for (i = 0; i < ignore.length; ++i)\n decoder[ignore.charAt(i)] = -1;\n }\n var out = [],\n bits = 0,\n char_count = 0;\n for (i = 0; i < a.length; ++i) {\n var c = a.charAt(i);\n if (c == '=')\n break;\n c = decoder[c];\n if (c == -1)\n continue;\n if (c === undefined)\n throw 'Illegal character at offset ' + i;\n bits |= c;\n if (++char_count >= 2) {\n out[out.length] = bits;\n bits = 0;\n char_count = 0;\n } else {\n bits <<= 4;\n }\n }\n if (char_count)\n throw \"Hex encoding incomplete: 4 bits missing\";\n return out;\n};\n\n// export globals\nwindow.Hex = Hex;\n})();\n// Base64 JavaScript decoder\n// Copyright (c) 2008-2013 Lapo Luchini \n\n// Permission to use, copy, modify, and/or distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */\n(function (undefined) {\n\"use strict\";\n\nvar Base64 = {},\n decoder;\n\nBase64.decode = function (a) {\n var i;\n if (decoder === undefined) {\n var b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",\n ignore = \"= \\f\\n\\r\\t\\u00A0\\u2028\\u2029\";\n decoder = [];\n for (i = 0; i < 64; ++i)\n decoder[b64.charAt(i)] = i;\n for (i = 0; i < ignore.length; ++i)\n decoder[ignore.charAt(i)] = -1;\n }\n var out = [];\n var bits = 0, char_count = 0;\n for (i = 0; i < a.length; ++i) {\n var c = a.charAt(i);\n if (c == '=')\n break;\n c = decoder[c];\n if (c == -1)\n continue;\n if (c === undefined)\n throw 'Illegal character at offset ' + i;\n bits |= c;\n if (++char_count >= 4) {\n out[out.length] = (bits >> 16);\n out[out.length] = (bits >> 8) & 0xFF;\n out[out.length] = bits & 0xFF;\n bits = 0;\n char_count = 0;\n } else {\n bits <<= 6;\n }\n }\n switch (char_count) {\n case 1:\n throw \"Base64 encoding incomplete: at least 2 bits missing\";\n case 2:\n out[out.length] = (bits >> 10);\n break;\n case 3:\n out[out.length] = (bits >> 16);\n out[out.length] = (bits >> 8) & 0xFF;\n break;\n }\n return out;\n};\n\nBase64.re = /-----BEGIN [^-]+-----([A-Za-z0-9+\\/=\\s]+)-----END [^-]+-----|begin-base64[^\\n]+\\n([A-Za-z0-9+\\/=\\s]+)====/;\nBase64.unarmor = function (a) {\n var m = Base64.re.exec(a);\n if (m) {\n if (m[1])\n a = m[1];\n else if (m[2])\n a = m[2];\n else\n throw \"RegExp out of sync\";\n }\n return Base64.decode(a);\n};\n\n// export globals\nwindow.Base64 = Base64;\n})();\n// ASN.1 JavaScript decoder\n// Copyright (c) 2008-2013 Lapo Luchini \n\n// Permission to use, copy, modify, and/or distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */\n/*global oids */\n(function (undefined) {\n\"use strict\";\n\nvar hardLimit = 100,\n ellipsis = \"\\u2026\",\n DOM = {\n tag: function (tagName, className) {\n var t = document.createElement(tagName);\n t.className = className;\n return t;\n },\n text: function (str) {\n return document.createTextNode(str);\n }\n };\n\nfunction Stream(enc, pos) {\n if (enc instanceof Stream) {\n this.enc = enc.enc;\n this.pos = enc.pos;\n } else {\n this.enc = enc;\n this.pos = pos;\n }\n}\nStream.prototype.get = function (pos) {\n if (pos === undefined)\n pos = this.pos++;\n if (pos >= this.enc.length)\n throw 'Requesting byte offset ' + pos + ' on a stream of length ' + this.enc.length;\n return this.enc[pos];\n};\nStream.prototype.hexDigits = \"0123456789ABCDEF\";\nStream.prototype.hexByte = function (b) {\n return this.hexDigits.charAt((b >> 4) & 0xF) + this.hexDigits.charAt(b & 0xF);\n};\nStream.prototype.hexDump = function (start, end, raw) {\n var s = \"\";\n for (var i = start; i < end; ++i) {\n s += this.hexByte(this.get(i));\n if (raw !== true)\n switch (i & 0xF) {\n case 0x7: s += \" \"; break;\n case 0xF: s += \"\\n\"; break;\n default: s += \" \";\n }\n }\n return s;\n};\nStream.prototype.parseStringISO = function (start, end) {\n var s = \"\";\n for (var i = start; i < end; ++i)\n s += String.fromCharCode(this.get(i));\n return s;\n};\nStream.prototype.parseStringUTF = function (start, end) {\n var s = \"\";\n for (var i = start; i < end; ) {\n var c = this.get(i++);\n if (c < 128)\n s += String.fromCharCode(c);\n else if ((c > 191) && (c < 224))\n s += String.fromCharCode(((c & 0x1F) << 6) | (this.get(i++) & 0x3F));\n else\n s += String.fromCharCode(((c & 0x0F) << 12) | ((this.get(i++) & 0x3F) << 6) | (this.get(i++) & 0x3F));\n }\n return s;\n};\nStream.prototype.parseStringBMP = function (start, end) {\n var str = \"\"\n for (var i = start; i < end; i += 2) {\n var high_byte = this.get(i);\n var low_byte = this.get(i + 1);\n str += String.fromCharCode( (high_byte << 8) + low_byte );\n }\n\n return str;\n};\nStream.prototype.reTime = /^((?:1[89]|2\\d)?\\d\\d)(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])([01]\\d|2[0-3])(?:([0-5]\\d)(?:([0-5]\\d)(?:[.,](\\d{1,3}))?)?)?(Z|[-+](?:[0]\\d|1[0-2])([0-5]\\d)?)?$/;\nStream.prototype.parseTime = function (start, end) {\n var s = this.parseStringISO(start, end),\n m = this.reTime.exec(s);\n if (!m)\n return \"Unrecognized time: \" + s;\n s = m[1] + \"-\" + m[2] + \"-\" + m[3] + \" \" + m[4];\n if (m[5]) {\n s += \":\" + m[5];\n if (m[6]) {\n s += \":\" + m[6];\n if (m[7])\n s += \".\" + m[7];\n }\n }\n if (m[8]) {\n s += \" UTC\";\n if (m[8] != 'Z') {\n s += m[8];\n if (m[9])\n s += \":\" + m[9];\n }\n }\n return s;\n};\nStream.prototype.parseInteger = function (start, end) {\n //TODO support negative numbers\n var len = end - start;\n if (len > 4) {\n len <<= 3;\n var s = this.get(start);\n if (s === 0)\n len -= 8;\n else\n while (s < 128) {\n s <<= 1;\n --len;\n }\n return \"(\" + len + \" bit)\";\n }\n var n = 0;\n for (var i = start; i < end; ++i)\n n = (n << 8) | this.get(i);\n return n;\n};\nStream.prototype.parseBitString = function (start, end) {\n var unusedBit = this.get(start),\n lenBit = ((end - start - 1) << 3) - unusedBit,\n s = \"(\" + lenBit + \" bit)\";\n if (lenBit <= 20) {\n var skip = unusedBit;\n s += \" \";\n for (var i = end - 1; i > start; --i) {\n var b = this.get(i);\n for (var j = skip; j < 8; ++j)\n s += (b >> j) & 1 ? \"1\" : \"0\";\n skip = 0;\n }\n }\n return s;\n};\nStream.prototype.parseOctetString = function (start, end) {\n var len = end - start,\n s = \"(\" + len + \" byte) \";\n if (len > hardLimit)\n end = start + hardLimit;\n for (var i = start; i < end; ++i)\n s += this.hexByte(this.get(i)); //TODO: also try Latin1?\n if (len > hardLimit)\n s += ellipsis;\n return s;\n};\nStream.prototype.parseOID = function (start, end) {\n var s = '',\n n = 0,\n bits = 0;\n for (var i = start; i < end; ++i) {\n var v = this.get(i);\n n = (n << 7) | (v & 0x7F);\n bits += 7;\n if (!(v & 0x80)) { // finished\n if (s === '') {\n var m = n < 80 ? n < 40 ? 0 : 1 : 2;\n s = m + \".\" + (n - m * 40);\n } else\n s += \".\" + ((bits >= 31) ? \"bigint\" : n);\n n = bits = 0;\n }\n }\n return s;\n};\n\nfunction ASN1(stream, header, length, tag, sub) {\n this.stream = stream;\n this.header = header;\n this.length = length;\n this.tag = tag;\n this.sub = sub;\n}\nASN1.prototype.typeName = function () {\n if (this.tag === undefined)\n return \"unknown\";\n var tagClass = this.tag >> 6,\n tagConstructed = (this.tag >> 5) & 1,\n tagNumber = this.tag & 0x1F;\n switch (tagClass) {\n case 0: // universal\n switch (tagNumber) {\n case 0x00: return \"EOC\";\n case 0x01: return \"BOOLEAN\";\n case 0x02: return \"INTEGER\";\n case 0x03: return \"BIT_STRING\";\n case 0x04: return \"OCTET_STRING\";\n case 0x05: return \"NULL\";\n case 0x06: return \"OBJECT_IDENTIFIER\";\n case 0x07: return \"ObjectDescriptor\";\n case 0x08: return \"EXTERNAL\";\n case 0x09: return \"REAL\";\n case 0x0A: return \"ENUMERATED\";\n case 0x0B: return \"EMBEDDED_PDV\";\n case 0x0C: return \"UTF8String\";\n case 0x10: return \"SEQUENCE\";\n case 0x11: return \"SET\";\n case 0x12: return \"NumericString\";\n case 0x13: return \"PrintableString\"; // ASCII subset\n case 0x14: return \"TeletexString\"; // aka T61String\n case 0x15: return \"VideotexString\";\n case 0x16: return \"IA5String\"; // ASCII\n case 0x17: return \"UTCTime\";\n case 0x18: return \"GeneralizedTime\";\n case 0x19: return \"GraphicString\";\n case 0x1A: return \"VisibleString\"; // ASCII subset\n case 0x1B: return \"GeneralString\";\n case 0x1C: return \"UniversalString\";\n case 0x1E: return \"BMPString\";\n default: return \"Universal_\" + tagNumber.toString(16);\n }\n case 1: return \"Application_\" + tagNumber.toString(16);\n case 2: return \"[\" + tagNumber + \"]\"; // Context\n case 3: return \"Private_\" + tagNumber.toString(16);\n }\n};\nASN1.prototype.reSeemsASCII = /^[ -~]+$/;\nASN1.prototype.content = function () {\n if (this.tag === undefined)\n return null;\n var tagClass = this.tag >> 6,\n tagNumber = this.tag & 0x1F,\n content = this.posContent(),\n len = Math.abs(this.length);\n if (tagClass !== 0) { // universal\n if (this.sub !== null)\n return \"(\" + this.sub.length + \" elem)\";\n //TODO: TRY TO PARSE ASCII STRING\n var s = this.stream.parseStringISO(content, content + Math.min(len, hardLimit));\n if (this.reSeemsASCII.test(s))\n return s.substring(0, 2 * hardLimit) + ((s.length > 2 * hardLimit) ? ellipsis : \"\");\n else\n return this.stream.parseOctetString(content, content + len);\n }\n switch (tagNumber) {\n case 0x01: // BOOLEAN\n return (this.stream.get(content) === 0) ? \"false\" : \"true\";\n case 0x02: // INTEGER\n return this.stream.parseInteger(content, content + len);\n case 0x03: // BIT_STRING\n return this.sub ? \"(\" + this.sub.length + \" elem)\" :\n this.stream.parseBitString(content, content + len);\n case 0x04: // OCTET_STRING\n return this.sub ? \"(\" + this.sub.length + \" elem)\" :\n this.stream.parseOctetString(content, content + len);\n //case 0x05: // NULL\n case 0x06: // OBJECT_IDENTIFIER\n return this.stream.parseOID(content, content + len);\n //case 0x07: // ObjectDescriptor\n //case 0x08: // EXTERNAL\n //case 0x09: // REAL\n //case 0x0A: // ENUMERATED\n //case 0x0B: // EMBEDDED_PDV\n case 0x10: // SEQUENCE\n case 0x11: // SET\n return \"(\" + this.sub.length + \" elem)\";\n case 0x0C: // UTF8String\n return this.stream.parseStringUTF(content, content + len);\n case 0x12: // NumericString\n case 0x13: // PrintableString\n case 0x14: // TeletexString\n case 0x15: // VideotexString\n case 0x16: // IA5String\n //case 0x19: // GraphicString\n case 0x1A: // VisibleString\n //case 0x1B: // GeneralString\n //case 0x1C: // UniversalString\n return this.stream.parseStringISO(content, content + len);\n case 0x1E: // BMPString\n return this.stream.parseStringBMP(content, content + len);\n case 0x17: // UTCTime\n case 0x18: // GeneralizedTime\n return this.stream.parseTime(content, content + len);\n }\n return null;\n};\nASN1.prototype.toString = function () {\n return this.typeName() + \"@\" + this.stream.pos + \"[header:\" + this.header + \",length:\" + this.length + \",sub:\" + ((this.sub === null) ? 'null' : this.sub.length) + \"]\";\n};\nASN1.prototype.print = function (indent) {\n if (indent === undefined) indent = '';\n document.writeln(indent + this);\n if (this.sub !== null) {\n indent += ' ';\n for (var i = 0, max = this.sub.length; i < max; ++i)\n this.sub[i].print(indent);\n }\n};\nASN1.prototype.toPrettyString = function (indent) {\n if (indent === undefined) indent = '';\n var s = indent + this.typeName() + \" @\" + this.stream.pos;\n if (this.length >= 0)\n s += \"+\";\n s += this.length;\n if (this.tag & 0x20)\n s += \" (constructed)\";\n else if (((this.tag == 0x03) || (this.tag == 0x04)) && (this.sub !== null))\n s += \" (encapsulates)\";\n s += \"\\n\";\n if (this.sub !== null) {\n indent += ' ';\n for (var i = 0, max = this.sub.length; i < max; ++i)\n s += this.sub[i].toPrettyString(indent);\n }\n return s;\n};\nASN1.prototype.toDOM = function () {\n var node = DOM.tag(\"div\", \"node\");\n node.asn1 = this;\n var head = DOM.tag(\"div\", \"head\");\n var s = this.typeName().replace(/_/g, \" \");\n head.innerHTML = s;\n var content = this.content();\n if (content !== null) {\n content = String(content).replace(/\";\n s += \"Length: \" + this.header + \"+\";\n if (this.length >= 0)\n s += this.length;\n else\n s += (-this.length) + \" (undefined)\";\n if (this.tag & 0x20)\n s += \"
(constructed)\";\n else if (((this.tag == 0x03) || (this.tag == 0x04)) && (this.sub !== null))\n s += \"
(encapsulates)\";\n //TODO if (this.tag == 0x03) s += \"Unused bits: \"\n if (content !== null) {\n s += \"
Value:
\" + content + \"\";\n if ((typeof oids === 'object') && (this.tag == 0x06)) {\n var oid = oids[content];\n if (oid) {\n if (oid.d) s += \"
\" + oid.d;\n if (oid.c) s += \"
\" + oid.c;\n if (oid.w) s += \"
(warning!)\";\n }\n }\n }\n value.innerHTML = s;\n node.appendChild(value);\n var sub = DOM.tag(\"div\", \"sub\");\n if (this.sub !== null) {\n for (var i = 0, max = this.sub.length; i < max; ++i)\n sub.appendChild(this.sub[i].toDOM());\n }\n node.appendChild(sub);\n head.onclick = function () {\n node.className = (node.className == \"node collapsed\") ? \"node\" : \"node collapsed\";\n };\n return node;\n};\nASN1.prototype.posStart = function () {\n return this.stream.pos;\n};\nASN1.prototype.posContent = function () {\n return this.stream.pos + this.header;\n};\nASN1.prototype.posEnd = function () {\n return this.stream.pos + this.header + Math.abs(this.length);\n};\nASN1.prototype.fakeHover = function (current) {\n this.node.className += \" hover\";\n if (current)\n this.head.className += \" hover\";\n};\nASN1.prototype.fakeOut = function (current) {\n var re = / ?hover/;\n this.node.className = this.node.className.replace(re, \"\");\n if (current)\n this.head.className = this.head.className.replace(re, \"\");\n};\nASN1.prototype.toHexDOM_sub = function (node, className, stream, start, end) {\n if (start >= end)\n return;\n var sub = DOM.tag(\"span\", className);\n sub.appendChild(DOM.text(\n stream.hexDump(start, end)));\n node.appendChild(sub);\n};\nASN1.prototype.toHexDOM = function (root) {\n var node = DOM.tag(\"span\", \"hex\");\n if (root === undefined) root = node;\n this.head.hexNode = node;\n this.head.onmouseover = function () { this.hexNode.className = \"hexCurrent\"; };\n this.head.onmouseout = function () { this.hexNode.className = \"hex\"; };\n node.asn1 = this;\n node.onmouseover = function () {\n var current = !root.selected;\n if (current) {\n root.selected = this.asn1;\n this.className = \"hexCurrent\";\n }\n this.asn1.fakeHover(current);\n };\n node.onmouseout = function () {\n var current = (root.selected == this.asn1);\n this.asn1.fakeOut(current);\n if (current) {\n root.selected = null;\n this.className = \"hex\";\n }\n };\n this.toHexDOM_sub(node, \"tag\", this.stream, this.posStart(), this.posStart() + 1);\n this.toHexDOM_sub(node, (this.length >= 0) ? \"dlen\" : \"ulen\", this.stream, this.posStart() + 1, this.posContent());\n if (this.sub === null)\n node.appendChild(DOM.text(\n this.stream.hexDump(this.posContent(), this.posEnd())));\n else if (this.sub.length > 0) {\n var first = this.sub[0];\n var last = this.sub[this.sub.length - 1];\n this.toHexDOM_sub(node, \"intro\", this.stream, this.posContent(), first.posStart());\n for (var i = 0, max = this.sub.length; i < max; ++i)\n node.appendChild(this.sub[i].toHexDOM(root));\n this.toHexDOM_sub(node, \"outro\", this.stream, last.posEnd(), this.posEnd());\n }\n return node;\n};\nASN1.prototype.toHexString = function (root) {\n return this.stream.hexDump(this.posStart(), this.posEnd(), true);\n};\nASN1.decodeLength = function (stream) {\n var buf = stream.get(),\n len = buf & 0x7F;\n if (len == buf)\n return len;\n if (len > 3)\n throw \"Length over 24 bits not supported at position \" + (stream.pos - 1);\n if (len === 0)\n return -1; // undefined\n buf = 0;\n for (var i = 0; i < len; ++i)\n buf = (buf << 8) | stream.get();\n return buf;\n};\nASN1.hasContent = function (tag, len, stream) {\n if (tag & 0x20) // constructed\n return true;\n if ((tag < 0x03) || (tag > 0x04))\n return false;\n var p = new Stream(stream);\n if (tag == 0x03) p.get(); // BitString unused bits, must be in [0, 7]\n var subTag = p.get();\n if ((subTag >> 6) & 0x01) // not (universal or context)\n return false;\n try {\n var subLength = ASN1.decodeLength(p);\n return ((p.pos - stream.pos) + subLength == len);\n } catch (exception) {\n return false;\n }\n};\nASN1.decode = function (stream) {\n if (!(stream instanceof Stream))\n stream = new Stream(stream, 0);\n var streamStart = new Stream(stream),\n tag = stream.get(),\n len = ASN1.decodeLength(stream),\n header = stream.pos - streamStart.pos,\n sub = null;\n if (ASN1.hasContent(tag, len, stream)) {\n // it has content, so we decode it\n var start = stream.pos;\n if (tag == 0x03) stream.get(); // skip BitString unused bits, must be in [0, 7]\n sub = [];\n if (len >= 0) {\n // definite length\n var end = start + len;\n while (stream.pos < end)\n sub[sub.length] = ASN1.decode(stream);\n if (stream.pos != end)\n throw \"Content size is not correct for container starting at offset \" + start;\n } else {\n // undefined length\n try {\n for (;;) {\n var s = ASN1.decode(stream);\n if (s.tag === 0)\n break;\n sub[sub.length] = s;\n }\n len = start - stream.pos;\n } catch (e) {\n throw \"Exception while decoding undefined length content: \" + e;\n }\n }\n } else\n stream.pos += len; // skip content\n return new ASN1(streamStart, header, len, tag, sub);\n};\nASN1.test = function () {\n var test = [\n { value: [0x27], expected: 0x27 },\n { value: [0x81, 0xC9], expected: 0xC9 },\n { value: [0x83, 0xFE, 0xDC, 0xBA], expected: 0xFEDCBA }\n ];\n for (var i = 0, max = test.length; i < max; ++i) {\n var pos = 0,\n stream = new Stream(test[i].value, 0),\n res = ASN1.decodeLength(stream);\n if (res != test[i].expected)\n document.write(\"In test[\" + i + \"] expected \" + test[i].expected + \" got \" + res + \"\\n\");\n }\n};\n\n// export globals\nwindow.ASN1 = ASN1;\n})();\n/**\n * Retrieve the hexadecimal value (as a string) of the current ASN.1 element\n * @returns {string}\n * @public\n */\nASN1.prototype.getHexStringValue = function () {\n var hexString = this.toHexString();\n var offset = this.header * 2;\n var length = this.length * 2;\n return hexString.substr(offset, length);\n};\n\n/**\n * Method to parse a pem encoded string containing both a public or private key.\n * The method will translate the pem encoded string in a der encoded string and\n * will parse private key and public key parameters. This method accepts public key\n * in the rsaencryption pkcs #1 format (oid: 1.2.840.113549.1.1.1).\n *\n * @todo Check how many rsa formats use the same format of pkcs #1.\n *\n * The format is defined as:\n * PublicKeyInfo ::= SEQUENCE {\n * algorithm AlgorithmIdentifier,\n * PublicKey BIT STRING\n * }\n * Where AlgorithmIdentifier is:\n * AlgorithmIdentifier ::= SEQUENCE {\n * algorithm OBJECT IDENTIFIER, the OID of the enc algorithm\n * parameters ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)\n * }\n * and PublicKey is a SEQUENCE encapsulated in a BIT STRING\n * RSAPublicKey ::= SEQUENCE {\n * modulus INTEGER, -- n\n * publicExponent INTEGER -- e\n * }\n * it's possible to examine the structure of the keys obtained from openssl using\n * an asn.1 dumper as the one used here to parse the components: http://lapo.it/asn1js/\n * @argument {string} pem the pem encoded string, can include the BEGIN/END header/footer\n * @private\n */\nRSAKey.prototype.parseKey = function (pem) {\n try {\n var modulus = 0;\n var public_exponent = 0;\n var reHex = /^\\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\\s*)+$/;\n var der = reHex.test(pem) ? Hex.decode(pem) : Base64.unarmor(pem);\n var asn1 = ASN1.decode(der);\n\n //Fixes a bug with OpenSSL 1.0+ private keys\n if(asn1.sub.length === 3){\n asn1 = asn1.sub[2].sub[0];\n }\n if (asn1.sub.length === 9) {\n\n // Parse the private key.\n modulus = asn1.sub[1].getHexStringValue(); //bigint\n this.n = parseBigInt(modulus, 16);\n\n public_exponent = asn1.sub[2].getHexStringValue(); //int\n this.e = parseInt(public_exponent, 16);\n\n var private_exponent = asn1.sub[3].getHexStringValue(); //bigint\n this.d = parseBigInt(private_exponent, 16);\n\n var prime1 = asn1.sub[4].getHexStringValue(); //bigint\n this.p = parseBigInt(prime1, 16);\n\n var prime2 = asn1.sub[5].getHexStringValue(); //bigint\n this.q = parseBigInt(prime2, 16);\n\n var exponent1 = asn1.sub[6].getHexStringValue(); //bigint\n this.dmp1 = parseBigInt(exponent1, 16);\n\n var exponent2 = asn1.sub[7].getHexStringValue(); //bigint\n this.dmq1 = parseBigInt(exponent2, 16);\n\n var coefficient = asn1.sub[8].getHexStringValue(); //bigint\n this.coeff = parseBigInt(coefficient, 16);\n\n }\n else if (asn1.sub.length === 2) {\n\n // Parse the public key.\n var bit_string = asn1.sub[1];\n var sequence = bit_string.sub[0];\n\n modulus = sequence.sub[0].getHexStringValue();\n this.n = parseBigInt(modulus, 16);\n public_exponent = sequence.sub[1].getHexStringValue();\n this.e = parseInt(public_exponent, 16);\n\n }\n else {\n return false;\n }\n return true;\n }\n catch (ex) {\n return false;\n }\n};\n\n/**\n * Translate rsa parameters in a hex encoded string representing the rsa key.\n *\n * The translation follow the ASN.1 notation :\n * RSAPrivateKey ::= SEQUENCE {\n * version Version,\n * modulus INTEGER, -- n\n * publicExponent INTEGER, -- e\n * privateExponent INTEGER, -- d\n * prime1 INTEGER, -- p\n * prime2 INTEGER, -- q\n * exponent1 INTEGER, -- d mod (p1)\n * exponent2 INTEGER, -- d mod (q-1)\n * coefficient INTEGER, -- (inverse of q) mod p\n * }\n * @returns {string} DER Encoded String representing the rsa private key\n * @private\n */\nRSAKey.prototype.getPrivateBaseKey = function () {\n var options = {\n 'array': [\n new KJUR.asn1.DERInteger({'int': 0}),\n new KJUR.asn1.DERInteger({'bigint': this.n}),\n new KJUR.asn1.DERInteger({'int': this.e}),\n new KJUR.asn1.DERInteger({'bigint': this.d}),\n new KJUR.asn1.DERInteger({'bigint': this.p}),\n new KJUR.asn1.DERInteger({'bigint': this.q}),\n new KJUR.asn1.DERInteger({'bigint': this.dmp1}),\n new KJUR.asn1.DERInteger({'bigint': this.dmq1}),\n new KJUR.asn1.DERInteger({'bigint': this.coeff})\n ]\n };\n var seq = new KJUR.asn1.DERSequence(options);\n return seq.getEncodedHex();\n};\n\n/**\n * base64 (pem) encoded version of the DER encoded representation\n * @returns {string} pem encoded representation without header and footer\n * @public\n */\nRSAKey.prototype.getPrivateBaseKeyB64 = function () {\n return hex2b64(this.getPrivateBaseKey());\n};\n\n/**\n * Translate rsa parameters in a hex encoded string representing the rsa public key.\n * The representation follow the ASN.1 notation :\n * PublicKeyInfo ::= SEQUENCE {\n * algorithm AlgorithmIdentifier,\n * PublicKey BIT STRING\n * }\n * Where AlgorithmIdentifier is:\n * AlgorithmIdentifier ::= SEQUENCE {\n * algorithm OBJECT IDENTIFIER, the OID of the enc algorithm\n * parameters ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)\n * }\n * and PublicKey is a SEQUENCE encapsulated in a BIT STRING\n * RSAPublicKey ::= SEQUENCE {\n * modulus INTEGER, -- n\n * publicExponent INTEGER -- e\n * }\n * @returns {string} DER Encoded String representing the rsa public key\n * @private\n */\nRSAKey.prototype.getPublicBaseKey = function () {\n var options = {\n 'array': [\n new KJUR.asn1.DERObjectIdentifier({'oid': '1.2.840.113549.1.1.1'}), //RSA Encryption pkcs #1 oid\n new KJUR.asn1.DERNull()\n ]\n };\n var first_sequence = new KJUR.asn1.DERSequence(options);\n\n options = {\n 'array': [\n new KJUR.asn1.DERInteger({'bigint': this.n}),\n new KJUR.asn1.DERInteger({'int': this.e})\n ]\n };\n var second_sequence = new KJUR.asn1.DERSequence(options);\n\n options = {\n 'hex': '00' + second_sequence.getEncodedHex()\n };\n var bit_string = new KJUR.asn1.DERBitString(options);\n\n options = {\n 'array': [\n first_sequence,\n bit_string\n ]\n };\n var seq = new KJUR.asn1.DERSequence(options);\n return seq.getEncodedHex();\n};\n\n/**\n * base64 (pem) encoded version of the DER encoded representation\n * @returns {string} pem encoded representation without header and footer\n * @public\n */\nRSAKey.prototype.getPublicBaseKeyB64 = function () {\n return hex2b64(this.getPublicBaseKey());\n};\n\n/**\n * wrap the string in block of width chars. The default value for rsa keys is 64\n * characters.\n * @param {string} str the pem encoded string without header and footer\n * @param {Number} [width=64] - the length the string has to be wrapped at\n * @returns {string}\n * @private\n */\nRSAKey.prototype.wordwrap = function (str, width) {\n width = width || 64;\n if (!str) {\n return str;\n }\n var regex = '(.{1,' + width + '})( +|$\\n?)|(.{1,' + width + '})';\n return str.match(RegExp(regex, 'g')).join('\\n');\n};\n\n/**\n * Retrieve the pem encoded private key\n * @returns {string} the pem encoded private key with header/footer\n * @public\n */\nRSAKey.prototype.getPrivateKey = function () {\n var key = \"-----BEGIN RSA PRIVATE KEY-----\\n\";\n key += this.wordwrap(this.getPrivateBaseKeyB64()) + \"\\n\";\n key += \"-----END RSA PRIVATE KEY-----\";\n return key;\n};\n\n/**\n * Retrieve the pem encoded public key\n * @returns {string} the pem encoded public key with header/footer\n * @public\n */\nRSAKey.prototype.getPublicKey = function () {\n var key = \"-----BEGIN PUBLIC KEY-----\\n\";\n key += this.wordwrap(this.getPublicBaseKeyB64()) + \"\\n\";\n key += \"-----END PUBLIC KEY-----\";\n return key;\n};\n\n/**\n * Check if the object contains the necessary parameters to populate the rsa modulus\n * and public exponent parameters.\n * @param {Object} [obj={}] - An object that may contain the two public key\n * parameters\n * @returns {boolean} true if the object contains both the modulus and the public exponent\n * properties (n and e)\n * @todo check for types of n and e. N should be a parseable bigInt object, E should\n * be a parseable integer number\n * @private\n */\nRSAKey.prototype.hasPublicKeyProperty = function (obj) {\n obj = obj || {};\n return (\n obj.hasOwnProperty('n') &&\n obj.hasOwnProperty('e')\n );\n};\n\n/**\n * Check if the object contains ALL the parameters of an RSA key.\n * @param {Object} [obj={}] - An object that may contain nine rsa key\n * parameters\n * @returns {boolean} true if the object contains all the parameters needed\n * @todo check for types of the parameters all the parameters but the public exponent\n * should be parseable bigint objects, the public exponent should be a parseable integer number\n * @private\n */\nRSAKey.prototype.hasPrivateKeyProperty = function (obj) {\n obj = obj || {};\n return (\n obj.hasOwnProperty('n') &&\n obj.hasOwnProperty('e') &&\n obj.hasOwnProperty('d') &&\n obj.hasOwnProperty('p') &&\n obj.hasOwnProperty('q') &&\n obj.hasOwnProperty('dmp1') &&\n obj.hasOwnProperty('dmq1') &&\n obj.hasOwnProperty('coeff')\n );\n};\n\n/**\n * Parse the properties of obj in the current rsa object. Obj should AT LEAST\n * include the modulus and public exponent (n, e) parameters.\n * @param {Object} obj - the object containing rsa parameters\n * @private\n */\nRSAKey.prototype.parsePropertiesFrom = function (obj) {\n this.n = obj.n;\n this.e = obj.e;\n\n if (obj.hasOwnProperty('d')) {\n this.d = obj.d;\n this.p = obj.p;\n this.q = obj.q;\n this.dmp1 = obj.dmp1;\n this.dmq1 = obj.dmq1;\n this.coeff = obj.coeff;\n }\n};\n\n/**\n * Create a new JSEncryptRSAKey that extends Tom Wu's RSA key object.\n * This object is just a decorator for parsing the key parameter\n * @param {string|Object} key - The key in string format, or an object containing\n * the parameters needed to build a RSAKey object.\n * @constructor\n */\nvar JSEncryptRSAKey = function (key) {\n // Call the super constructor.\n RSAKey.call(this);\n // If a key key was provided.\n if (key) {\n // If this is a string...\n if (typeof key === 'string') {\n this.parseKey(key);\n }\n else if (\n this.hasPrivateKeyProperty(key) ||\n this.hasPublicKeyProperty(key)\n ) {\n // Set the values for the key.\n this.parsePropertiesFrom(key);\n }\n }\n};\n\n// Derive from RSAKey.\nJSEncryptRSAKey.prototype = new RSAKey();\n\n// Reset the contructor.\nJSEncryptRSAKey.prototype.constructor = JSEncryptRSAKey;\n\n\n/**\n *\n * @param {Object} [options = {}] - An object to customize JSEncrypt behaviour\n * possible parameters are:\n * - default_key_size {number} default: 1024 the key size in bit\n * - default_public_exponent {string} default: '010001' the hexadecimal representation of the public exponent\n * - log {boolean} default: false whether log warn/error or not\n * @constructor\n */\nvar JSEncrypt = function (options) {\n options = options || {};\n this.default_key_size = parseInt(options.default_key_size) || 1024;\n this.default_public_exponent = options.default_public_exponent || '010001'; //65537 default openssl public exponent for rsa key type\n this.log = options.log || false;\n // The private and public key.\n this.key = null;\n};\n\n/**\n * Method to set the rsa key parameter (one method is enough to set both the public\n * and the private key, since the private key contains the public key paramenters)\n * Log a warning if logs are enabled\n * @param {Object|string} key the pem encoded string or an object (with or without header/footer)\n * @public\n */\nJSEncrypt.prototype.setKey = function (key) {\n if (this.log && this.key) {\n console.warn('A key was already set, overriding existing.');\n }\n this.key = new JSEncryptRSAKey(key);\n};\n\n/**\n * Proxy method for setKey, for api compatibility\n * @see setKey\n * @public\n */\nJSEncrypt.prototype.setPrivateKey = function (privkey) {\n // Create the key.\n this.setKey(privkey);\n};\n\n/**\n * Proxy method for setKey, for api compatibility\n * @see setKey\n * @public\n */\nJSEncrypt.prototype.setPublicKey = function (pubkey) {\n // Sets the public key.\n this.setKey(pubkey);\n};\n\n/**\n * Proxy method for RSAKey object's decrypt, decrypt the string using the private\n * components of the rsa key object. Note that if the object was not set will be created\n * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor\n * @param {string} string base64 encoded crypted string to decrypt\n * @return {string} the decrypted string\n * @public\n */\nJSEncrypt.prototype.decrypt = function (string) {\n // Return the decrypted string.\n try {\n return this.getKey().decrypt(b64tohex(string));\n }\n catch (ex) {\n return false;\n }\n};\n\n/**\n * Proxy method for RSAKey object's encrypt, encrypt the string using the public\n * components of the rsa key object. Note that if the object was not set will be created\n * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor\n * @param {string} string the string to encrypt\n * @return {string} the encrypted string encoded in base64\n * @public\n */\nJSEncrypt.prototype.encrypt = function (string) {\n // Return the encrypted string.\n try {\n return hex2b64(this.getKey().encrypt(string));\n }\n catch (ex) {\n return false;\n }\n};\n\n/**\n * Getter for the current JSEncryptRSAKey object. If it doesn't exists a new object\n * will be created and returned\n * @param {callback} [cb] the callback to be called if we want the key to be generated\n * in an async fashion\n * @returns {JSEncryptRSAKey} the JSEncryptRSAKey object\n * @public\n */\nJSEncrypt.prototype.getKey = function (cb) {\n // Only create new if it does not exist.\n if (!this.key) {\n // Get a new private key.\n this.key = new JSEncryptRSAKey();\n if (cb && {}.toString.call(cb) === '[object Function]') {\n this.key.generateAsync(this.default_key_size, this.default_public_exponent, cb);\n return;\n }\n // Generate the key.\n this.key.generate(this.default_key_size, this.default_public_exponent);\n }\n return this.key;\n};\n\n/**\n * Returns the pem encoded representation of the private key\n * If the key doesn't exists a new key will be created\n * @returns {string} pem encoded representation of the private key WITH header and footer\n * @public\n */\nJSEncrypt.prototype.getPrivateKey = function () {\n // Return the private representation of this key.\n return this.getKey().getPrivateKey();\n};\n\n/**\n * Returns the pem encoded representation of the private key\n * If the key doesn't exists a new key will be created\n * @returns {string} pem encoded representation of the private key WITHOUT header and footer\n * @public\n */\nJSEncrypt.prototype.getPrivateKeyB64 = function () {\n // Return the private representation of this key.\n return this.getKey().getPrivateBaseKeyB64();\n};\n\n\n/**\n * Returns the pem encoded representation of the public key\n * If the key doesn't exists a new key will be created\n * @returns {string} pem encoded representation of the public key WITH header and footer\n * @public\n */\nJSEncrypt.prototype.getPublicKey = function () {\n // Return the private representation of this key.\n return this.getKey().getPublicKey();\n};\n\n/**\n * Returns the pem encoded representation of the public key\n * If the key doesn't exists a new key will be created\n * @returns {string} pem encoded representation of the public key WITHOUT header and footer\n * @public\n */\nJSEncrypt.prototype.getPublicKeyB64 = function () {\n // Return the private representation of this key.\n return this.getKey().getPublicBaseKeyB64();\n};\n\n\n JSEncrypt.version = '2.3.1';\n exports.JSEncrypt = JSEncrypt;\n});\n\n//# sourceURL=webpack://Authing/./node_modules/jsencrypt/bin/jsencrypt.js?"); +eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! JSEncrypt v2.3.1 | https://npmcdn.com/jsencrypt@2.3.1/LICENSE.txt */\n(function (root, factory) {\n if (true) {\n // AMD\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n})(this, function (exports) {\n // Copyright (c) 2005 Tom Wu\n// All Rights Reserved.\n// See \"LICENSE\" for details.\n\n// Basic JavaScript BN library - subset useful for RSA encryption.\n\n// Bits per digit\nvar dbits;\n\n// JavaScript engine analysis\nvar canary = 0xdeadbeefcafe;\nvar j_lm = ((canary&0xffffff)==0xefcafe);\n\n// (public) Constructor\nfunction BigInteger(a,b,c) {\n if(a != null)\n if(\"number\" == typeof a) this.fromNumber(a,b,c);\n else if(b == null && \"string\" != typeof a) this.fromString(a,256);\n else this.fromString(a,b);\n}\n\n// return new, unset BigInteger\nfunction nbi() { return new BigInteger(null); }\n\n// am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\nfunction am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n}\n// am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\nfunction am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n}\n// Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\nfunction am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n}\nif(j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n}\nelse if(j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n}\nelse { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n}\n\nBigInteger.prototype.DB = dbits;\nBigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n}\n\n// (protected) set from integer value x, -DV <= x < DV\nfunction bnpFromInt(x) {\n this.t = 1;\n this.s = (x<0)?-1:0;\n if(x > 0) this[0] = x;\n else if(x < -1) this[0] = x+this.DV;\n else this.t = 0;\n}\n\n// return bigint initialized to value\nfunction nbv(i) { var r = nbi(); r.fromInt(i); return r; }\n\n// (protected) set from string and radix\nfunction bnpFromString(s,b) {\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else { this.fromRadix(s,b); return; }\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while(--i >= 0) {\n var x = (k==8)?s[i]&0xff:intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if(sh == 0)\n this[this.t++] = x;\n else if(sh+k > this.DB) {\n this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh));\n }\n else\n this[this.t-1] |= x<= this.DB) sh -= this.DB;\n }\n if(k == 8 && (s[0]&0x80) != 0) {\n this.s = -1;\n if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t;\n}\n\n// (public) return string representation in given radix\nfunction bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1< 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}\n\n// (public) -this\nfunction bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\n// (public) |this|\nfunction bnAbs() { return (this.s<0)?this.negate():this; }\n\n// (public) return + if this > a, - if this < a, 0 if equal\nfunction bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n}\n\n// returns bit length of the integer x\nfunction nbits(x) {\n var r = 1, t;\n if((t=x>>>16) != 0) { x = t; r += 16; }\n if((t=x>>8) != 0) { x = t; r += 8; }\n if((t=x>>4) != 0) { x = t; r += 4; }\n if((t=x>>2) != 0) { x = t; r += 2; }\n if((t=x>>1) != 0) { x = t; r += 1; }\n return r;\n}\n\n// (public) return the number of bits in \"this\"\nfunction bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}\n\n// (protected) r = this << n*DB\nfunction bnpDLShiftTo(n,r) {\n var i;\n for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];\n for(i = n-1; i >= 0; --i) r[i] = 0;\n r.t = this.t+n;\n r.s = this.s;\n}\n\n// (protected) r = this >> n*DB\nfunction bnpDRShiftTo(n,r) {\n for(var i = n; i < this.t; ++i) r[i-n] = this[i];\n r.t = Math.max(this.t-n,0);\n r.s = this.s;\n}\n\n// (protected) r = this << n\nfunction bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n}\n\n// (protected) r = this >> n\nfunction bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB;\n }\n if(a.t < this.t) {\n c -= a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c -= a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = (c<0)?-1:0;\n if(c < -1) r[i++] = this.DV+c;\n else if(c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n}\n\n// (protected) r = this * a, r != this,a (HAC 14.12)\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyTo(a,r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i+y.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);\n r.s = 0;\n r.clamp();\n if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n}\n\n// (protected) r = this^2, r != this (HAC 14.16)\nfunction bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2*x.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < x.t-1; ++i) {\n var c = x.am(i,x[i],r,2*i,0,1);\n if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n r[i+x.t] -= x.DV;\n r[i+x.t+1] = 1;\n }\n }\n if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);\n r.s = 0;\n r.clamp();\n}\n\n// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m. q or r may be null.\nfunction bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}\n\n// (public) this mod a\nfunction bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a,null,r);\n if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n return r;\n}\n\n// Modular reduction using \"classic\" algorithm\nfunction Classic(m) { this.m = m; }\nfunction cConvert(x) {\n if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n else return x;\n}\nfunction cRevert(x) { return x; }\nfunction cReduce(x) { x.divRemTo(this.m,null,x); }\nfunction cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\nfunction cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\nClassic.prototype.convert = cConvert;\nClassic.prototype.revert = cRevert;\nClassic.prototype.reduce = cReduce;\nClassic.prototype.mulTo = cMulTo;\nClassic.prototype.sqrTo = cSqrTo;\n\n// (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n// justification:\n// xy == 1 (mod m)\n// xy = 1+km\n// xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply \"overflows\" differently from C/C++, so care is needed here.\nfunction bnpInvDigit() {\n if(this.t < 1) return 0;\n var x = this[0];\n if((x&1) == 0) return 0;\n var y = x&3;\t\t// y == 1/x mod 2^2\n y = (y*(2-(x&0xf)*y))&0xf;\t// y == 1/x mod 2^4\n y = (y*(2-(x&0xff)*y))&0xff;\t// y == 1/x mod 2^8\n y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff;\t// y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = (y*(2-x*y%this.DV))%this.DV;\t\t// y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return (y>0)?this.DV-y:-y;\n}\n\n// Montgomery reduction\nfunction Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp&0x7fff;\n this.mph = this.mp>>15;\n this.um = (1<<(m.DB-15))-1;\n this.mt2 = 2*m.t;\n}\n\n// xR mod m\nfunction montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t,r);\n r.divRemTo(this.m,null,r);\n if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n return r;\n}\n\n// x/R mod m\nfunction montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n}\n\n// x = x/R mod m (HAC 14.32)\nfunction montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}\n\n// r = \"x^2/R mod m\"; x != r\nfunction montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n// r = \"xy/R mod m\"; x,y != r\nfunction montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\nMontgomery.prototype.convert = montConvert;\nMontgomery.prototype.revert = montRevert;\nMontgomery.prototype.reduce = montReduce;\nMontgomery.prototype.mulTo = montMulTo;\nMontgomery.prototype.sqrTo = montSqrTo;\n\n// (protected) true iff this is even\nfunction bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }\n\n// (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\nfunction bnpExp(e,z) {\n if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n g.copyTo(r);\n while(--i >= 0) {\n z.sqrTo(r,r2);\n if((e&(1< 0) z.mulTo(r2,g,r);\n else { var t = r; r = r2; r2 = t; }\n }\n return z.revert(r);\n}\n\n// (public) this^e % m, 0 <= e < 2^32\nfunction bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}\n\n// protected\nBigInteger.prototype.copyTo = bnpCopyTo;\nBigInteger.prototype.fromInt = bnpFromInt;\nBigInteger.prototype.fromString = bnpFromString;\nBigInteger.prototype.clamp = bnpClamp;\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\nBigInteger.prototype.subTo = bnpSubTo;\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\nBigInteger.prototype.squareTo = bnpSquareTo;\nBigInteger.prototype.divRemTo = bnpDivRemTo;\nBigInteger.prototype.invDigit = bnpInvDigit;\nBigInteger.prototype.isEven = bnpIsEven;\nBigInteger.prototype.exp = bnpExp;\n\n// public\nBigInteger.prototype.toString = bnToString;\nBigInteger.prototype.negate = bnNegate;\nBigInteger.prototype.abs = bnAbs;\nBigInteger.prototype.compareTo = bnCompareTo;\nBigInteger.prototype.bitLength = bnBitLength;\nBigInteger.prototype.mod = bnMod;\nBigInteger.prototype.modPowInt = bnModPowInt;\n\n// \"constants\"\nBigInteger.ZERO = nbv(0);\nBigInteger.ONE = nbv(1);\n\n// Copyright (c) 2005-2009 Tom Wu\n// All Rights Reserved.\n// See \"LICENSE\" for details.\n\n// Extended JavaScript BN functions, required for RSA private ops.\n\n// Version 1.1: new BigInteger(\"0\", 10) returns \"proper\" zero\n// Version 1.2: square() API, isProbablePrime fix\n\n// (public)\nfunction bnClone() { var r = nbi(); this.copyTo(r); return r; }\n\n// (public) return value as integer\nfunction bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<>24; }\n\n// (public) return value as short (assumes DB>=16)\nfunction bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }\n\n// (protected) return x s.t. r^x < DV\nfunction bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\n// (public) 0 if this == 0, 1 if this > 0\nfunction bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n}\n\n// (protected) convert to radix string\nfunction bnpToRadix(b) {\n if(b == null) b = 10;\n if(this.signum() == 0 || b < 2 || b > 36) return \"0\";\n var cs = this.chunkSize(b);\n var a = Math.pow(b,cs);\n var d = nbv(a), y = nbi(), z = nbi(), r = \"\";\n this.divRemTo(d,y,z);\n while(y.signum() > 0) {\n r = (a+z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d,y,z);\n }\n return z.intValue().toString(b) + r;\n}\n\n// (protected) convert from radix string\nfunction bnpFromRadix(s,b) {\n this.fromInt(0);\n if(b == null) b = 10;\n var cs = this.chunkSize(b);\n var d = Math.pow(b,cs), mi = false, j = 0, w = 0;\n for(var i = 0; i < s.length; ++i) {\n var x = intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\" && this.signum() == 0) mi = true;\n continue;\n }\n w = b*w+x;\n if(++j >= cs) {\n this.dMultiply(d);\n this.dAddOffset(w,0);\n j = 0;\n w = 0;\n }\n }\n if(j > 0) {\n this.dMultiply(Math.pow(b,j));\n this.dAddOffset(w,0);\n }\n if(mi) BigInteger.ZERO.subTo(this,this);\n}\n\n// (protected) alternate constructor\nfunction bnpFromNumber(a,b,c) {\n if(\"number\" == typeof b) {\n // new BigInteger(int,int,RNG)\n if(a < 2) this.fromInt(1);\n else {\n this.fromNumber(a,c);\n if(!this.testBit(a-1))\t// force MSB set\n this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);\n if(this.isEven()) this.dAddOffset(1,0); // force odd\n while(!this.isProbablePrime(b)) {\n this.dAddOffset(2,0);\n if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);\n }\n }\n }\n else {\n // new BigInteger(int,RNG)\n var x = new Array(), t = a&7;\n x.length = (a>>3)+1;\n b.nextBytes(x);\n if(t > 0) x[0] &= ((1< 0) {\n if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)\n r[k++] = d|(this.s<<(this.DB-p));\n while(i >= 0) {\n if(p < 8) {\n d = (this[i]&((1<>(p+=this.DB-8);\n }\n else {\n d = (this[i]>>(p-=8))&0xff;\n if(p <= 0) { p += this.DB; --i; }\n }\n if((d&0x80) != 0) d |= -256;\n if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;\n if(k > 0 || d != this.s) r[k++] = d;\n }\n }\n return r;\n}\n\nfunction bnEquals(a) { return(this.compareTo(a)==0); }\nfunction bnMin(a) { return(this.compareTo(a)<0)?this:a; }\nfunction bnMax(a) { return(this.compareTo(a)>0)?this:a; }\n\n// (protected) r = this op a (bitwise)\nfunction bnpBitwiseTo(a,op,r) {\n var i, f, m = Math.min(a.t,this.t);\n for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);\n if(a.t < this.t) {\n f = a.s&this.DM;\n for(i = m; i < this.t; ++i) r[i] = op(this[i],f);\n r.t = this.t;\n }\n else {\n f = this.s&this.DM;\n for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);\n r.t = a.t;\n }\n r.s = op(this.s,a.s);\n r.clamp();\n}\n\n// (public) this & a\nfunction op_and(x,y) { return x&y; }\nfunction bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }\n\n// (public) this | a\nfunction op_or(x,y) { return x|y; }\nfunction bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }\n\n// (public) this ^ a\nfunction op_xor(x,y) { return x^y; }\nfunction bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }\n\n// (public) this & ~a\nfunction op_andnot(x,y) { return x&~y; }\nfunction bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }\n\n// (public) ~this\nfunction bnNot() {\n var r = nbi();\n for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];\n r.t = this.t;\n r.s = ~this.s;\n return r;\n}\n\n// (public) this << n\nfunction bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n}\n\n// (public) this >> n\nfunction bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n}\n\n// return index of lowest 1-bit in x, x < 2^31\nfunction lbit(x) {\n if(x == 0) return -1;\n var r = 0;\n if((x&0xffff) == 0) { x >>= 16; r += 16; }\n if((x&0xff) == 0) { x >>= 8; r += 8; }\n if((x&0xf) == 0) { x >>= 4; r += 4; }\n if((x&3) == 0) { x >>= 2; r += 2; }\n if((x&1) == 0) ++r;\n return r;\n}\n\n// (public) returns index of lowest 1-bit (or -1 if none)\nfunction bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}\n\n// return number of 1 bits in x\nfunction cbit(x) {\n var r = 0;\n while(x != 0) { x &= x-1; ++r; }\n return r;\n}\n\n// (public) return number of set bits\nfunction bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n}\n\n// (public) true iff nth bit is set\nfunction bnTestBit(n) {\n var j = Math.floor(n/this.DB);\n if(j >= this.t) return(this.s!=0);\n return((this[j]&(1<<(n%this.DB)))!=0);\n}\n\n// (protected) this op (1<>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}\n\n// (public) this + a\nfunction bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }\n\n// (public) this - a\nfunction bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }\n\n// (public) this * a\nfunction bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }\n\n// (public) this^2\nfunction bnSquare() { var r = nbi(); this.squareTo(r); return r; }\n\n// (public) this / a\nfunction bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }\n\n// (public) this % a\nfunction bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }\n\n// (public) [this/a,this%a]\nfunction bnDivideAndRemainder(a) {\n var q = nbi(), r = nbi();\n this.divRemTo(a,q,r);\n return new Array(q,r);\n}\n\n// (protected) this *= n, this >= 0, 1 < n < DV\nfunction bnpDMultiply(n) {\n this[this.t] = this.am(0,n-1,this,0,0,this.t);\n ++this.t;\n this.clamp();\n}\n\n// (protected) this += n << w words, this >= 0\nfunction bnpDAddOffset(n,w) {\n if(n == 0) return;\n while(this.t <= w) this[this.t++] = 0;\n this[w] += n;\n while(this[w] >= this.DV) {\n this[w] -= this.DV;\n if(++w >= this.t) this[this.t++] = 0;\n ++this[w];\n }\n}\n\n// A \"null\" reducer\nfunction NullExp() {}\nfunction nNop(x) { return x; }\nfunction nMulTo(x,y,r) { x.multiplyTo(y,r); }\nfunction nSqrTo(x,r) { x.squareTo(r); }\n\nNullExp.prototype.convert = nNop;\nNullExp.prototype.revert = nNop;\nNullExp.prototype.mulTo = nMulTo;\nNullExp.prototype.sqrTo = nSqrTo;\n\n// (public) this^e\nfunction bnPow(e) { return this.exp(e,new NullExp()); }\n\n// (protected) r = lower n words of \"this * a\", a.t <= n\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyLowerTo(a,n,r) {\n var i = Math.min(this.t+a.t,n);\n r.s = 0; // assumes a,this >= 0\n r.t = i;\n while(i > 0) r[--i] = 0;\n var j;\n for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);\n for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);\n r.clamp();\n}\n\n// (protected) r = \"this * a\" without lower n words, n > 0\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyUpperTo(a,n,r) {\n --n;\n var i = r.t = this.t+a.t-n;\n r.s = 0; // assumes a,this >= 0\n while(--i >= 0) r[i] = 0;\n for(i = Math.max(n-this.t,0); i < a.t; ++i)\n r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);\n r.clamp();\n r.drShiftTo(1,r);\n}\n\n// Barrett modular reduction\nfunction Barrett(m) {\n // setup Barrett\n this.r2 = nbi();\n this.q3 = nbi();\n BigInteger.ONE.dlShiftTo(2*m.t,this.r2);\n this.mu = this.r2.divide(m);\n this.m = m;\n}\n\nfunction barrettConvert(x) {\n if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);\n else if(x.compareTo(this.m) < 0) return x;\n else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }\n}\n\nfunction barrettRevert(x) { return x; }\n\n// x = x mod m (HAC 14.42)\nfunction barrettReduce(x) {\n x.drShiftTo(this.m.t-1,this.r2);\n if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }\n this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);\n this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);\n while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);\n x.subTo(this.r2,x);\n while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}\n\n// r = x^2 mod m; x != r\nfunction barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n// r = x*y mod m; x,y != r\nfunction barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\nBarrett.prototype.convert = barrettConvert;\nBarrett.prototype.revert = barrettRevert;\nBarrett.prototype.reduce = barrettReduce;\nBarrett.prototype.mulTo = barrettMulTo;\nBarrett.prototype.sqrTo = barrettSqrTo;\n\n// (public) this^e % m (HAC 14.85)\nfunction bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1< 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1< 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}\n\n// (protected) this % n, n < 2^26\nfunction bnpModInt(n) {\n if(n <= 0) return 0;\n var d = this.DV%n, r = (this.s<0)?n-1:0;\n if(this.t > 0)\n if(d == 0) r = this[0]%n;\n else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;\n return r;\n}\n\n// (public) 1/this % m (HAC 14.61)\nfunction bnModInverse(m) {\n var ac = m.isEven();\n if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;\n var u = m.clone(), v = this.clone();\n var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);\n while(u.signum() != 0) {\n while(u.isEven()) {\n u.rShiftTo(1,u);\n if(ac) {\n if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }\n a.rShiftTo(1,a);\n }\n else if(!b.isEven()) b.subTo(m,b);\n b.rShiftTo(1,b);\n }\n while(v.isEven()) {\n v.rShiftTo(1,v);\n if(ac) {\n if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }\n c.rShiftTo(1,c);\n }\n else if(!d.isEven()) d.subTo(m,d);\n d.rShiftTo(1,d);\n }\n if(u.compareTo(v) >= 0) {\n u.subTo(v,u);\n if(ac) a.subTo(c,a);\n b.subTo(d,b);\n }\n else {\n v.subTo(u,v);\n if(ac) c.subTo(a,c);\n d.subTo(b,d);\n }\n }\n if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;\n if(d.compareTo(m) >= 0) return d.subtract(m);\n if(d.signum() < 0) d.addTo(m,d); else return d;\n if(d.signum() < 0) return d.add(m); else return d;\n}\n\nvar lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];\nvar lplim = (1<<26)/lowprimes[lowprimes.length-1];\n\n// (public) test primality with certainty >= 1-.5^t\nfunction bnIsProbablePrime(t) {\n var i, x = this.abs();\n if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {\n for(i = 0; i < lowprimes.length; ++i)\n if(x[0] == lowprimes[i]) return true;\n return false;\n }\n if(x.isEven()) return false;\n i = 1;\n while(i < lowprimes.length) {\n var m = lowprimes[i], j = i+1;\n while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];\n m = x.modInt(m);\n while(i < j) if(m%lowprimes[i++] == 0) return false;\n }\n return x.millerRabin(t);\n}\n\n// (protected) true if probably prime (HAC 4.24, Miller-Rabin)\nfunction bnpMillerRabin(t) {\n var n1 = this.subtract(BigInteger.ONE);\n var k = n1.getLowestSetBit();\n if(k <= 0) return false;\n var r = n1.shiftRight(k);\n t = (t+1)>>1;\n if(t > lowprimes.length) t = lowprimes.length;\n var a = nbi();\n for(var i = 0; i < t; ++i) {\n //Pick bases at random, instead of starting at 2\n a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);\n var y = a.modPow(r,this);\n if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\n var j = 1;\n while(j++ < k && y.compareTo(n1) != 0) {\n y = y.modPowInt(2,this);\n if(y.compareTo(BigInteger.ONE) == 0) return false;\n }\n if(y.compareTo(n1) != 0) return false;\n }\n }\n return true;\n}\n\n// protected\nBigInteger.prototype.chunkSize = bnpChunkSize;\nBigInteger.prototype.toRadix = bnpToRadix;\nBigInteger.prototype.fromRadix = bnpFromRadix;\nBigInteger.prototype.fromNumber = bnpFromNumber;\nBigInteger.prototype.bitwiseTo = bnpBitwiseTo;\nBigInteger.prototype.changeBit = bnpChangeBit;\nBigInteger.prototype.addTo = bnpAddTo;\nBigInteger.prototype.dMultiply = bnpDMultiply;\nBigInteger.prototype.dAddOffset = bnpDAddOffset;\nBigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;\nBigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;\nBigInteger.prototype.modInt = bnpModInt;\nBigInteger.prototype.millerRabin = bnpMillerRabin;\n\n// public\nBigInteger.prototype.clone = bnClone;\nBigInteger.prototype.intValue = bnIntValue;\nBigInteger.prototype.byteValue = bnByteValue;\nBigInteger.prototype.shortValue = bnShortValue;\nBigInteger.prototype.signum = bnSigNum;\nBigInteger.prototype.toByteArray = bnToByteArray;\nBigInteger.prototype.equals = bnEquals;\nBigInteger.prototype.min = bnMin;\nBigInteger.prototype.max = bnMax;\nBigInteger.prototype.and = bnAnd;\nBigInteger.prototype.or = bnOr;\nBigInteger.prototype.xor = bnXor;\nBigInteger.prototype.andNot = bnAndNot;\nBigInteger.prototype.not = bnNot;\nBigInteger.prototype.shiftLeft = bnShiftLeft;\nBigInteger.prototype.shiftRight = bnShiftRight;\nBigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;\nBigInteger.prototype.bitCount = bnBitCount;\nBigInteger.prototype.testBit = bnTestBit;\nBigInteger.prototype.setBit = bnSetBit;\nBigInteger.prototype.clearBit = bnClearBit;\nBigInteger.prototype.flipBit = bnFlipBit;\nBigInteger.prototype.add = bnAdd;\nBigInteger.prototype.subtract = bnSubtract;\nBigInteger.prototype.multiply = bnMultiply;\nBigInteger.prototype.divide = bnDivide;\nBigInteger.prototype.remainder = bnRemainder;\nBigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;\nBigInteger.prototype.modPow = bnModPow;\nBigInteger.prototype.modInverse = bnModInverse;\nBigInteger.prototype.pow = bnPow;\nBigInteger.prototype.gcd = bnGCD;\nBigInteger.prototype.isProbablePrime = bnIsProbablePrime;\n\n// JSBN-specific extension\nBigInteger.prototype.square = bnSquare;\n\n// BigInteger interfaces not implemented in jsbn:\n\n// BigInteger(int signum, byte[] magnitude)\n// double doubleValue()\n// float floatValue()\n// int hashCode()\n// long longValue()\n// static BigInteger valueOf(long val)\n\n// prng4.js - uses Arcfour as a PRNG\n\nfunction Arcfour() {\n this.i = 0;\n this.j = 0;\n this.S = new Array();\n}\n\n// Initialize arcfour context from key, an array of ints, each from [0..255]\nfunction ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}\n\nfunction ARC4next() {\n var t;\n this.i = (this.i + 1) & 255;\n this.j = (this.j + this.S[this.i]) & 255;\n t = this.S[this.i];\n this.S[this.i] = this.S[this.j];\n this.S[this.j] = t;\n return this.S[(t + this.S[this.i]) & 255];\n}\n\nArcfour.prototype.init = ARC4init;\nArcfour.prototype.next = ARC4next;\n\n// Plug in your RNG constructor here\nfunction prng_newstate() {\n return new Arcfour();\n}\n\n// Pool size must be a multiple of 4 and greater than 32.\n// An array of bytes the size of the pool will be passed to init()\nvar rng_psize = 256;\n\n// Random number generator - requires a PRNG backend, e.g. prng4.js\nvar rng_state;\nvar rng_pool;\nvar rng_pptr;\n\n// Initialize the pool with junk if needed.\nif(rng_pool == null) {\n rng_pool = new Array();\n rng_pptr = 0;\n var t;\n if(window.crypto && window.crypto.getRandomValues) {\n // Extract entropy (2048 bits) from RNG if available\n var z = new Uint32Array(256);\n window.crypto.getRandomValues(z);\n for (t = 0; t < z.length; ++t)\n rng_pool[rng_pptr++] = z[t] & 255;\n }\n\n // Use mouse events for entropy, if we do not have enough entropy by the time\n // we need it, entropy will be generated by Math.random.\n var onMouseMoveListener = function(ev) {\n this.count = this.count || 0;\n if (this.count >= 256 || rng_pptr >= rng_psize) {\n if (window.removeEventListener)\n window.removeEventListener(\"mousemove\", onMouseMoveListener, false);\n else if (window.detachEvent)\n window.detachEvent(\"onmousemove\", onMouseMoveListener);\n return;\n }\n try {\n var mouseCoordinates = ev.x + ev.y;\n rng_pool[rng_pptr++] = mouseCoordinates & 255;\n this.count += 1;\n } catch (e) {\n // Sometimes Firefox will deny permission to access event properties for some reason. Ignore.\n }\n };\n if (window.addEventListener)\n window.addEventListener(\"mousemove\", onMouseMoveListener, false);\n else if (window.attachEvent)\n window.attachEvent(\"onmousemove\", onMouseMoveListener);\n\n}\n\nfunction rng_get_byte() {\n if(rng_state == null) {\n rng_state = prng_newstate();\n // At this point, we may not have collected enough entropy. If not, fall back to Math.random\n while (rng_pptr < rng_psize) {\n var random = Math.floor(65536 * Math.random());\n rng_pool[rng_pptr++] = random & 255;\n }\n rng_state.init(rng_pool);\n for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)\n rng_pool[rng_pptr] = 0;\n rng_pptr = 0;\n }\n // TODO: allow reseeding after first request\n return rng_state.next();\n}\n\nfunction rng_get_bytes(ba) {\n var i;\n for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();\n}\n\nfunction SecureRandom() {}\n\nSecureRandom.prototype.nextBytes = rng_get_bytes;\n\n// Depends on jsbn.js and rng.js\n\n// Version 1.1: support utf-8 encoding in pkcs1pad2\n\n// convert a (hex) string to a bignum object\nfunction parseBigInt(str,r) {\n return new BigInteger(str,r);\n}\n\nfunction linebrk(s,n) {\n var ret = \"\";\n var i = 0;\n while(i + n < s.length) {\n ret += s.substring(i,i+n) + \"\\n\";\n i += n;\n }\n return ret + s.substring(i,s.length);\n}\n\nfunction byte2Hex(b) {\n if(b < 0x10)\n return \"0\" + b.toString(16);\n else\n return b.toString(16);\n}\n\n// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint\nfunction pkcs1pad2(s,n) {\n if(n < s.length + 11) { // TODO: fix for utf-8\n console.error(\"Message too long for RSA\");\n return null;\n }\n var ba = new Array();\n var i = s.length - 1;\n while(i >= 0 && n > 0) {\n var c = s.charCodeAt(i--);\n if(c < 128) { // encode using utf-8\n ba[--n] = c;\n }\n else if((c > 127) && (c < 2048)) {\n ba[--n] = (c & 63) | 128;\n ba[--n] = (c >> 6) | 192;\n }\n else {\n ba[--n] = (c & 63) | 128;\n ba[--n] = ((c >> 6) & 63) | 128;\n ba[--n] = (c >> 12) | 224;\n }\n }\n ba[--n] = 0;\n var rng = new SecureRandom();\n var x = new Array();\n while(n > 2) { // random non-zero pad\n x[0] = 0;\n while(x[0] == 0) rng.nextBytes(x);\n ba[--n] = x[0];\n }\n ba[--n] = 2;\n ba[--n] = 0;\n return new BigInteger(ba);\n}\n\n// \"empty\" RSA key constructor\nfunction RSAKey() {\n this.n = null;\n this.e = 0;\n this.d = null;\n this.p = null;\n this.q = null;\n this.dmp1 = null;\n this.dmq1 = null;\n this.coeff = null;\n}\n\n// Set the public key fields N and e from hex strings\nfunction RSASetPublic(N,E) {\n if(N != null && E != null && N.length > 0 && E.length > 0) {\n this.n = parseBigInt(N,16);\n this.e = parseInt(E,16);\n }\n else\n console.error(\"Invalid RSA public key\");\n}\n\n// Perform raw public operation on \"x\": return x^e (mod n)\nfunction RSADoPublic(x) {\n return x.modPowInt(this.e, this.n);\n}\n\n// Return the PKCS#1 RSA encryption of \"text\" as an even-length hex string\nfunction RSAEncrypt(text) {\n var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3);\n if(m == null) return null;\n var c = this.doPublic(m);\n if(c == null) return null;\n var h = c.toString(16);\n if((h.length & 1) == 0) return h; else return \"0\" + h;\n}\n\n// Return the PKCS#1 RSA encryption of \"text\" as a Base64-encoded string\n//function RSAEncryptB64(text) {\n// var h = this.encrypt(text);\n// if(h) return hex2b64(h); else return null;\n//}\n\n// protected\nRSAKey.prototype.doPublic = RSADoPublic;\n\n// public\nRSAKey.prototype.setPublic = RSASetPublic;\nRSAKey.prototype.encrypt = RSAEncrypt;\n//RSAKey.prototype.encrypt_b64 = RSAEncryptB64;\n\n// Depends on rsa.js and jsbn2.js\n\n// Version 1.1: support utf-8 decoding in pkcs1unpad2\n\n// Undo PKCS#1 (type 2, random) padding and, if valid, return the plaintext\nfunction pkcs1unpad2(d,n) {\n var b = d.toByteArray();\n var i = 0;\n while(i < b.length && b[i] == 0) ++i;\n if(b.length-i != n-1 || b[i] != 2)\n return null;\n ++i;\n while(b[i] != 0)\n if(++i >= b.length) return null;\n var ret = \"\";\n while(++i < b.length) {\n var c = b[i] & 255;\n if(c < 128) { // utf-8 decode\n ret += String.fromCharCode(c);\n }\n else if((c > 191) && (c < 224)) {\n ret += String.fromCharCode(((c & 31) << 6) | (b[i+1] & 63));\n ++i;\n }\n else {\n ret += String.fromCharCode(((c & 15) << 12) | ((b[i+1] & 63) << 6) | (b[i+2] & 63));\n i += 2;\n }\n }\n return ret;\n}\n\n// Set the private key fields N, e, and d from hex strings\nfunction RSASetPrivate(N,E,D) {\n if(N != null && E != null && N.length > 0 && E.length > 0) {\n this.n = parseBigInt(N,16);\n this.e = parseInt(E,16);\n this.d = parseBigInt(D,16);\n }\n else\n console.error(\"Invalid RSA private key\");\n}\n\n// Set the private key fields N, e, d and CRT params from hex strings\nfunction RSASetPrivateEx(N,E,D,P,Q,DP,DQ,C) {\n if(N != null && E != null && N.length > 0 && E.length > 0) {\n this.n = parseBigInt(N,16);\n this.e = parseInt(E,16);\n this.d = parseBigInt(D,16);\n this.p = parseBigInt(P,16);\n this.q = parseBigInt(Q,16);\n this.dmp1 = parseBigInt(DP,16);\n this.dmq1 = parseBigInt(DQ,16);\n this.coeff = parseBigInt(C,16);\n }\n else\n console.error(\"Invalid RSA private key\");\n}\n\n// Generate a new random private key B bits long, using public expt E\nfunction RSAGenerate(B,E) {\n var rng = new SecureRandom();\n var qs = B>>1;\n this.e = parseInt(E,16);\n var ee = new BigInteger(E,16);\n for(;;) {\n for(;;) {\n this.p = new BigInteger(B-qs,1,rng);\n if(this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.p.isProbablePrime(10)) break;\n }\n for(;;) {\n this.q = new BigInteger(qs,1,rng);\n if(this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.q.isProbablePrime(10)) break;\n }\n if(this.p.compareTo(this.q) <= 0) {\n var t = this.p;\n this.p = this.q;\n this.q = t;\n }\n var p1 = this.p.subtract(BigInteger.ONE);\n var q1 = this.q.subtract(BigInteger.ONE);\n var phi = p1.multiply(q1);\n if(phi.gcd(ee).compareTo(BigInteger.ONE) == 0) {\n this.n = this.p.multiply(this.q);\n this.d = ee.modInverse(phi);\n this.dmp1 = this.d.mod(p1);\n this.dmq1 = this.d.mod(q1);\n this.coeff = this.q.modInverse(this.p);\n break;\n }\n }\n}\n\n// Perform raw private operation on \"x\": return x^d (mod n)\nfunction RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}\n\n// Return the PKCS#1 RSA decryption of \"ctext\".\n// \"ctext\" is an even-length hex string and the output is a plain string.\nfunction RSADecrypt(ctext) {\n var c = parseBigInt(ctext, 16);\n var m = this.doPrivate(c);\n if(m == null) return null;\n return pkcs1unpad2(m, (this.n.bitLength()+7)>>3);\n}\n\n// Return the PKCS#1 RSA decryption of \"ctext\".\n// \"ctext\" is a Base64-encoded string and the output is a plain string.\n//function RSAB64Decrypt(ctext) {\n// var h = b64tohex(ctext);\n// if(h) return this.decrypt(h); else return null;\n//}\n\n// protected\nRSAKey.prototype.doPrivate = RSADoPrivate;\n\n// public\nRSAKey.prototype.setPrivate = RSASetPrivate;\nRSAKey.prototype.setPrivateEx = RSASetPrivateEx;\nRSAKey.prototype.generate = RSAGenerate;\nRSAKey.prototype.decrypt = RSADecrypt;\n//RSAKey.prototype.b64_decrypt = RSAB64Decrypt;\n\n// Copyright (c) 2011 Kevin M Burns Jr.\n// All Rights Reserved.\n// See \"LICENSE\" for details.\n//\n// Extension to jsbn which adds facilities for asynchronous RSA key generation\n// Primarily created to avoid execution timeout on mobile devices\n//\n// http://www-cs-students.stanford.edu/~tjw/jsbn/\n//\n// ---\n\n(function(){\n\n// Generate a new random private key B bits long, using public expt E\nvar RSAGenerateAsync = function (B, E, callback) {\n //var rng = new SeededRandom();\n var rng = new SecureRandom();\n var qs = B >> 1;\n this.e = parseInt(E, 16);\n var ee = new BigInteger(E, 16);\n var rsa = this;\n // These functions have non-descript names because they were originally for(;;) loops.\n // I don't know about cryptography to give them better names than loop1-4.\n var loop1 = function() {\n var loop4 = function() {\n if (rsa.p.compareTo(rsa.q) <= 0) {\n var t = rsa.p;\n rsa.p = rsa.q;\n rsa.q = t;\n }\n var p1 = rsa.p.subtract(BigInteger.ONE);\n var q1 = rsa.q.subtract(BigInteger.ONE);\n var phi = p1.multiply(q1);\n if (phi.gcd(ee).compareTo(BigInteger.ONE) == 0) {\n rsa.n = rsa.p.multiply(rsa.q);\n rsa.d = ee.modInverse(phi);\n rsa.dmp1 = rsa.d.mod(p1);\n rsa.dmq1 = rsa.d.mod(q1);\n rsa.coeff = rsa.q.modInverse(rsa.p);\n setTimeout(function(){callback()},0); // escape\n } else {\n setTimeout(loop1,0);\n }\n };\n var loop3 = function() {\n rsa.q = nbi();\n rsa.q.fromNumberAsync(qs, 1, rng, function(){\n rsa.q.subtract(BigInteger.ONE).gcda(ee, function(r){\n if (r.compareTo(BigInteger.ONE) == 0 && rsa.q.isProbablePrime(10)) {\n setTimeout(loop4,0);\n } else {\n setTimeout(loop3,0);\n }\n });\n });\n };\n var loop2 = function() {\n rsa.p = nbi();\n rsa.p.fromNumberAsync(B - qs, 1, rng, function(){\n rsa.p.subtract(BigInteger.ONE).gcda(ee, function(r){\n if (r.compareTo(BigInteger.ONE) == 0 && rsa.p.isProbablePrime(10)) {\n setTimeout(loop3,0);\n } else {\n setTimeout(loop2,0);\n }\n });\n });\n };\n setTimeout(loop2,0);\n };\n setTimeout(loop1,0);\n};\nRSAKey.prototype.generateAsync = RSAGenerateAsync;\n\n// Public API method\nvar bnGCDAsync = function (a, callback) {\n var x = (this.s < 0) ? this.negate() : this.clone();\n var y = (a.s < 0) ? a.negate() : a.clone();\n if (x.compareTo(y) < 0) {\n var t = x;\n x = y;\n y = t;\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit();\n if (g < 0) {\n callback(x);\n return;\n }\n if (i < g) g = i;\n if (g > 0) {\n x.rShiftTo(g, x);\n y.rShiftTo(g, y);\n }\n // Workhorse of the algorithm, gets called 200 - 800 times per 512 bit keygen.\n var gcda1 = function() {\n if ((i = x.getLowestSetBit()) > 0){ x.rShiftTo(i, x); }\n if ((i = y.getLowestSetBit()) > 0){ y.rShiftTo(i, y); }\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x);\n x.rShiftTo(1, x);\n } else {\n y.subTo(x, y);\n y.rShiftTo(1, y);\n }\n if(!(x.signum() > 0)) {\n if (g > 0) y.lShiftTo(g, y);\n setTimeout(function(){callback(y)},0); // escape\n } else {\n setTimeout(gcda1,0);\n }\n };\n setTimeout(gcda1,10);\n};\nBigInteger.prototype.gcda = bnGCDAsync;\n\n// (protected) alternate constructor\nvar bnpFromNumberAsync = function (a,b,c,callback) {\n if(\"number\" == typeof b) {\n if(a < 2) {\n this.fromInt(1);\n } else {\n this.fromNumber(a,c);\n if(!this.testBit(a-1)){\n this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);\n }\n if(this.isEven()) {\n this.dAddOffset(1,0);\n }\n var bnp = this;\n var bnpfn1 = function(){\n bnp.dAddOffset(2,0);\n if(bnp.bitLength() > a) bnp.subTo(BigInteger.ONE.shiftLeft(a-1),bnp);\n if(bnp.isProbablePrime(b)) {\n setTimeout(function(){callback()},0); // escape\n } else {\n setTimeout(bnpfn1,0);\n }\n };\n setTimeout(bnpfn1,0);\n }\n } else {\n var x = new Array(), t = a&7;\n x.length = (a>>3)+1;\n b.nextBytes(x);\n if(t > 0) x[0] &= ((1<> 6) + b64map.charAt(c & 63);\n }\n if(i+1 == h.length) {\n c = parseInt(h.substring(i,i+1),16);\n ret += b64map.charAt(c << 2);\n }\n else if(i+2 == h.length) {\n c = parseInt(h.substring(i,i+2),16);\n ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4);\n }\n while((ret.length & 3) > 0) ret += b64pad;\n return ret;\n}\n\n// convert a base64 string to hex\nfunction b64tohex(s) {\n var ret = \"\"\n var i;\n var k = 0; // b64 state, 0-3\n var slop;\n for(i = 0; i < s.length; ++i) {\n if(s.charAt(i) == b64pad) break;\n v = b64map.indexOf(s.charAt(i));\n if(v < 0) continue;\n if(k == 0) {\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 1;\n }\n else if(k == 1) {\n ret += int2char((slop << 2) | (v >> 4));\n slop = v & 0xf;\n k = 2;\n }\n else if(k == 2) {\n ret += int2char(slop);\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 3;\n }\n else {\n ret += int2char((slop << 2) | (v >> 4));\n ret += int2char(v & 0xf);\n k = 0;\n }\n }\n if(k == 1)\n ret += int2char(slop << 2);\n return ret;\n}\n\n// convert a base64 string to a byte/number array\nfunction b64toBA(s) {\n //piggyback on b64tohex for now, optimize later\n var h = b64tohex(s);\n var i;\n var a = new Array();\n for(i = 0; 2*i < h.length; ++i) {\n a[i] = parseInt(h.substring(2*i,2*i+2),16);\n }\n return a;\n}\n\n/*! asn1-1.0.2.js (c) 2013 Kenji Urushima | kjur.github.com/jsrsasign/license\n */\n\nvar JSX = JSX || {};\nJSX.env = JSX.env || {};\n\nvar L = JSX, OP = Object.prototype, FUNCTION_TOSTRING = '[object Function]',ADD = [\"toString\", \"valueOf\"];\n\nJSX.env.parseUA = function(agent) {\n\n var numberify = function(s) {\n var c = 0;\n return parseFloat(s.replace(/\\./g, function() {\n return (c++ == 1) ? '' : '.';\n }));\n },\n\n nav = navigator,\n o = {\n ie: 0,\n opera: 0,\n gecko: 0,\n webkit: 0,\n chrome: 0,\n mobile: null,\n air: 0,\n ipad: 0,\n iphone: 0,\n ipod: 0,\n ios: null,\n android: 0,\n webos: 0,\n caja: nav && nav.cajaVersion,\n secure: false,\n os: null\n\n },\n\n ua = agent || (navigator && navigator.userAgent),\n loc = window && window.location,\n href = loc && loc.href,\n m;\n\n o.secure = href && (href.toLowerCase().indexOf(\"https\") === 0);\n\n if (ua) {\n\n if ((/windows|win32/i).test(ua)) {\n o.os = 'windows';\n } else if ((/macintosh/i).test(ua)) {\n o.os = 'macintosh';\n } else if ((/rhino/i).test(ua)) {\n o.os = 'rhino';\n }\n if ((/KHTML/).test(ua)) {\n o.webkit = 1;\n }\n m = ua.match(/AppleWebKit\\/([^\\s]*)/);\n if (m && m[1]) {\n o.webkit = numberify(m[1]);\n if (/ Mobile\\//.test(ua)) {\n o.mobile = 'Apple'; // iPhone or iPod Touch\n m = ua.match(/OS ([^\\s]*)/);\n if (m && m[1]) {\n m = numberify(m[1].replace('_', '.'));\n }\n o.ios = m;\n o.ipad = o.ipod = o.iphone = 0;\n m = ua.match(/iPad|iPod|iPhone/);\n if (m && m[0]) {\n o[m[0].toLowerCase()] = o.ios;\n }\n } else {\n m = ua.match(/NokiaN[^\\/]*|Android \\d\\.\\d|webOS\\/\\d\\.\\d/);\n if (m) {\n o.mobile = m[0];\n }\n if (/webOS/.test(ua)) {\n o.mobile = 'WebOS';\n m = ua.match(/webOS\\/([^\\s]*);/);\n if (m && m[1]) {\n o.webos = numberify(m[1]);\n }\n }\n if (/ Android/.test(ua)) {\n o.mobile = 'Android';\n m = ua.match(/Android ([^\\s]*);/);\n if (m && m[1]) {\n o.android = numberify(m[1]);\n }\n }\n }\n m = ua.match(/Chrome\\/([^\\s]*)/);\n if (m && m[1]) {\n o.chrome = numberify(m[1]); // Chrome\n } else {\n m = ua.match(/AdobeAIR\\/([^\\s]*)/);\n if (m) {\n o.air = m[0]; // Adobe AIR 1.0 or better\n }\n }\n }\n if (!o.webkit) {\n m = ua.match(/Opera[\\s\\/]([^\\s]*)/);\n if (m && m[1]) {\n o.opera = numberify(m[1]);\n m = ua.match(/Version\\/([^\\s]*)/);\n if (m && m[1]) {\n o.opera = numberify(m[1]); // opera 10+\n }\n m = ua.match(/Opera Mini[^;]*/);\n if (m) {\n o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316\n }\n } else { // not opera or webkit\n m = ua.match(/MSIE\\s([^;]*)/);\n if (m && m[1]) {\n o.ie = numberify(m[1]);\n } else { // not opera, webkit, or ie\n m = ua.match(/Gecko\\/([^\\s]*)/);\n if (m) {\n o.gecko = 1; // Gecko detected, look for revision\n m = ua.match(/rv:([^\\s\\)]*)/);\n if (m && m[1]) {\n o.gecko = numberify(m[1]);\n }\n }\n }\n }\n }\n }\n return o;\n};\n\nJSX.env.ua = JSX.env.parseUA();\n\nJSX.isFunction = function(o) {\n return (typeof o === 'function') || OP.toString.apply(o) === FUNCTION_TOSTRING;\n};\n\nJSX._IEEnumFix = (JSX.env.ua.ie) ? function(r, s) {\n var i, fname, f;\n for (i=0;iMIT License\n */\n\n/** \n * kjur's class library name space\n *

\n * This name space provides following name spaces:\n *

    \n *
  • {@link KJUR.asn1} - ASN.1 primitive hexadecimal encoder
  • \n *
  • {@link KJUR.asn1.x509} - ASN.1 structure for X.509 certificate and CRL
  • \n *
  • {@link KJUR.crypto} - Java Cryptographic Extension(JCE) style MessageDigest/Signature \n * class and utilities
  • \n *
\n *

\n * NOTE: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.\n * @name KJUR\n * @namespace kjur's class library name space\n */\nif (typeof KJUR == \"undefined\" || !KJUR) KJUR = {};\n\n/**\n * kjur's ASN.1 class library name space\n *

\n * This is ITU-T X.690 ASN.1 DER encoder class library and\n * class structure and methods is very similar to \n * org.bouncycastle.asn1 package of \n * well known BouncyCaslte Cryptography Library.\n *\n *

PROVIDING ASN.1 PRIMITIVES

\n * Here are ASN.1 DER primitive classes.\n *
    \n *
  • {@link KJUR.asn1.DERBoolean}
  • \n *
  • {@link KJUR.asn1.DERInteger}
  • \n *
  • {@link KJUR.asn1.DERBitString}
  • \n *
  • {@link KJUR.asn1.DEROctetString}
  • \n *
  • {@link KJUR.asn1.DERNull}
  • \n *
  • {@link KJUR.asn1.DERObjectIdentifier}
  • \n *
  • {@link KJUR.asn1.DERUTF8String}
  • \n *
  • {@link KJUR.asn1.DERNumericString}
  • \n *
  • {@link KJUR.asn1.DERPrintableString}
  • \n *
  • {@link KJUR.asn1.DERTeletexString}
  • \n *
  • {@link KJUR.asn1.DERIA5String}
  • \n *
  • {@link KJUR.asn1.DERUTCTime}
  • \n *
  • {@link KJUR.asn1.DERGeneralizedTime}
  • \n *
  • {@link KJUR.asn1.DERSequence}
  • \n *
  • {@link KJUR.asn1.DERSet}
  • \n *
\n *\n *

OTHER ASN.1 CLASSES

\n *
    \n *
  • {@link KJUR.asn1.ASN1Object}
  • \n *
  • {@link KJUR.asn1.DERAbstractString}
  • \n *
  • {@link KJUR.asn1.DERAbstractTime}
  • \n *
  • {@link KJUR.asn1.DERAbstractStructured}
  • \n *
  • {@link KJUR.asn1.DERTaggedObject}
  • \n *
\n *

\n * NOTE: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.\n * @name KJUR.asn1\n * @namespace\n */\nif (typeof KJUR.asn1 == \"undefined\" || !KJUR.asn1) KJUR.asn1 = {};\n\n/**\n * ASN1 utilities class\n * @name KJUR.asn1.ASN1Util\n * @classs ASN1 utilities class\n * @since asn1 1.0.2\n */\nKJUR.asn1.ASN1Util = new function() {\n this.integerToByteHex = function(i) {\n\tvar h = i.toString(16);\n\tif ((h.length % 2) == 1) h = '0' + h;\n\treturn h;\n };\n this.bigIntToMinTwosComplementsHex = function(bigIntegerValue) {\n\tvar h = bigIntegerValue.toString(16);\n\tif (h.substr(0, 1) != '-') {\n\t if (h.length % 2 == 1) {\n\t\th = '0' + h;\n\t } else {\n\t\tif (! h.match(/^[0-7]/)) {\n\t\t h = '00' + h;\n\t\t}\n\t }\n\t} else {\n\t var hPos = h.substr(1);\n\t var xorLen = hPos.length;\n\t if (xorLen % 2 == 1) {\n\t\txorLen += 1;\n\t } else {\n\t\tif (! h.match(/^[0-7]/)) {\n\t\t xorLen += 2;\n\t\t}\n\t }\n\t var hMask = '';\n\t for (var i = 0; i < xorLen; i++) {\n\t\thMask += 'f';\n\t }\n\t var biMask = new BigInteger(hMask, 16);\n\t var biNeg = biMask.xor(bigIntegerValue).add(BigInteger.ONE);\n\t h = biNeg.toString(16).replace(/^-/, '');\n\t}\n\treturn h;\n };\n /**\n * get PEM string from hexadecimal data and header string\n * @name getPEMStringFromHex\n * @memberOf KJUR.asn1.ASN1Util\n * @function\n * @param {String} dataHex hexadecimal string of PEM body\n * @param {String} pemHeader PEM header string (ex. 'RSA PRIVATE KEY')\n * @return {String} PEM formatted string of input data\n * @description\n * @example\n * var pem = KJUR.asn1.ASN1Util.getPEMStringFromHex('616161', 'RSA PRIVATE KEY');\n * // value of pem will be:\n * -----BEGIN PRIVATE KEY-----\n * YWFh\n * -----END PRIVATE KEY-----\n */\n this.getPEMStringFromHex = function(dataHex, pemHeader) {\n\tvar dataWA = CryptoJS.enc.Hex.parse(dataHex);\n\tvar dataB64 = CryptoJS.enc.Base64.stringify(dataWA);\n\tvar pemBody = dataB64.replace(/(.{64})/g, \"$1\\r\\n\");\n pemBody = pemBody.replace(/\\r\\n$/, '');\n\treturn \"-----BEGIN \" + pemHeader + \"-----\\r\\n\" + \n pemBody + \n \"\\r\\n-----END \" + pemHeader + \"-----\\r\\n\";\n };\n};\n\n// ********************************************************************\n// Abstract ASN.1 Classes\n// ********************************************************************\n\n// ********************************************************************\n\n/**\n * base class for ASN.1 DER encoder object\n * @name KJUR.asn1.ASN1Object\n * @class base class for ASN.1 DER encoder object\n * @property {Boolean} isModified flag whether internal data was changed\n * @property {String} hTLV hexadecimal string of ASN.1 TLV\n * @property {String} hT hexadecimal string of ASN.1 TLV tag(T)\n * @property {String} hL hexadecimal string of ASN.1 TLV length(L)\n * @property {String} hV hexadecimal string of ASN.1 TLV value(V)\n * @description\n */\nKJUR.asn1.ASN1Object = function() {\n var isModified = true;\n var hTLV = null;\n var hT = '00'\n var hL = '00';\n var hV = '';\n\n /**\n * get hexadecimal ASN.1 TLV length(L) bytes from TLV value(V)\n * @name getLengthHexFromValue\n * @memberOf KJUR.asn1.ASN1Object\n * @function\n * @return {String} hexadecimal string of ASN.1 TLV length(L)\n */\n this.getLengthHexFromValue = function() {\n\tif (typeof this.hV == \"undefined\" || this.hV == null) {\n\t throw \"this.hV is null or undefined.\";\n\t}\n\tif (this.hV.length % 2 == 1) {\n\t throw \"value hex must be even length: n=\" + hV.length + \",v=\" + this.hV;\n\t}\n\tvar n = this.hV.length / 2;\n\tvar hN = n.toString(16);\n\tif (hN.length % 2 == 1) {\n\t hN = \"0\" + hN;\n\t}\n\tif (n < 128) {\n\t return hN;\n\t} else {\n\t var hNlen = hN.length / 2;\n\t if (hNlen > 15) {\n\t\tthrow \"ASN.1 length too long to represent by 8x: n = \" + n.toString(16);\n\t }\n\t var head = 128 + hNlen;\n\t return head.toString(16) + hN;\n\t}\n };\n\n /**\n * get hexadecimal string of ASN.1 TLV bytes\n * @name getEncodedHex\n * @memberOf KJUR.asn1.ASN1Object\n * @function\n * @return {String} hexadecimal string of ASN.1 TLV\n */\n this.getEncodedHex = function() {\n\tif (this.hTLV == null || this.isModified) {\n\t this.hV = this.getFreshValueHex();\n\t this.hL = this.getLengthHexFromValue();\n\t this.hTLV = this.hT + this.hL + this.hV;\n\t this.isModified = false;\n\t //console.error(\"first time: \" + this.hTLV);\n\t}\n\treturn this.hTLV;\n };\n\n /**\n * get hexadecimal string of ASN.1 TLV value(V) bytes\n * @name getValueHex\n * @memberOf KJUR.asn1.ASN1Object\n * @function\n * @return {String} hexadecimal string of ASN.1 TLV value(V) bytes\n */\n this.getValueHex = function() {\n\tthis.getEncodedHex();\n\treturn this.hV;\n }\n\n this.getFreshValueHex = function() {\n\treturn '';\n };\n};\n\n// == BEGIN DERAbstractString ================================================\n/**\n * base class for ASN.1 DER string classes\n * @name KJUR.asn1.DERAbstractString\n * @class base class for ASN.1 DER string classes\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @property {String} s internal string of value\n * @extends KJUR.asn1.ASN1Object\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • str - specify initial ASN.1 value(V) by a string
  • \n *
  • hex - specify initial ASN.1 value(V) by a hexadecimal string
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERAbstractString = function(params) {\n KJUR.asn1.DERAbstractString.superclass.constructor.call(this);\n var s = null;\n var hV = null;\n\n /**\n * get string value of this string object\n * @name getString\n * @memberOf KJUR.asn1.DERAbstractString\n * @function\n * @return {String} string value of this string object\n */\n this.getString = function() {\n\treturn this.s;\n };\n\n /**\n * set value by a string\n * @name setString\n * @memberOf KJUR.asn1.DERAbstractString\n * @function\n * @param {String} newS value by a string to set\n */\n this.setString = function(newS) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.s = newS;\n\tthis.hV = stohex(this.s);\n };\n\n /**\n * set value by a hexadecimal string\n * @name setStringHex\n * @memberOf KJUR.asn1.DERAbstractString\n * @function\n * @param {String} newHexString value by a hexadecimal string to set\n */\n this.setStringHex = function(newHexString) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.s = null;\n\tthis.hV = newHexString;\n };\n\n this.getFreshValueHex = function() {\n\treturn this.hV;\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['str'] != \"undefined\") {\n\t this.setString(params['str']);\n\t} else if (typeof params['hex'] != \"undefined\") {\n\t this.setStringHex(params['hex']);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERAbstractString, KJUR.asn1.ASN1Object);\n// == END DERAbstractString ================================================\n\n// == BEGIN DERAbstractTime ==================================================\n/**\n * base class for ASN.1 DER Generalized/UTCTime class\n * @name KJUR.asn1.DERAbstractTime\n * @class base class for ASN.1 DER Generalized/UTCTime class\n * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})\n * @extends KJUR.asn1.ASN1Object\n * @description\n * @see KJUR.asn1.ASN1Object - superclass\n */\nKJUR.asn1.DERAbstractTime = function(params) {\n KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);\n var s = null;\n var date = null;\n\n // --- PRIVATE METHODS --------------------\n this.localDateToUTC = function(d) {\n\tutc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\tvar utcDate = new Date(utc);\n\treturn utcDate;\n };\n\n this.formatDate = function(dateObject, type) {\n\tvar pad = this.zeroPadding;\n\tvar d = this.localDateToUTC(dateObject);\n\tvar year = String(d.getFullYear());\n\tif (type == 'utc') year = year.substr(2, 2);\n\tvar month = pad(String(d.getMonth() + 1), 2);\n\tvar day = pad(String(d.getDate()), 2);\n\tvar hour = pad(String(d.getHours()), 2);\n\tvar min = pad(String(d.getMinutes()), 2);\n\tvar sec = pad(String(d.getSeconds()), 2);\n\treturn year + month + day + hour + min + sec + 'Z';\n };\n\n this.zeroPadding = function(s, len) {\n\tif (s.length >= len) return s;\n\treturn new Array(len - s.length + 1).join('0') + s;\n };\n\n // --- PUBLIC METHODS --------------------\n /**\n * get string value of this string object\n * @name getString\n * @memberOf KJUR.asn1.DERAbstractTime\n * @function\n * @return {String} string value of this time object\n */\n this.getString = function() {\n\treturn this.s;\n };\n\n /**\n * set value by a string\n * @name setString\n * @memberOf KJUR.asn1.DERAbstractTime\n * @function\n * @param {String} newS value by a string to set such like \"130430235959Z\"\n */\n this.setString = function(newS) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.s = newS;\n\tthis.hV = stohex(this.s);\n };\n\n /**\n * set value by a Date object\n * @name setByDateValue\n * @memberOf KJUR.asn1.DERAbstractTime\n * @function\n * @param {Integer} year year of date (ex. 2013)\n * @param {Integer} month month of date between 1 and 12 (ex. 12)\n * @param {Integer} day day of month\n * @param {Integer} hour hours of date\n * @param {Integer} min minutes of date\n * @param {Integer} sec seconds of date\n */\n this.setByDateValue = function(year, month, day, hour, min, sec) {\n\tvar dateObject = new Date(Date.UTC(year, month - 1, day, hour, min, sec, 0));\n\tthis.setByDate(dateObject);\n };\n\n this.getFreshValueHex = function() {\n\treturn this.hV;\n };\n};\nJSX.extend(KJUR.asn1.DERAbstractTime, KJUR.asn1.ASN1Object);\n// == END DERAbstractTime ==================================================\n\n// == BEGIN DERAbstractStructured ============================================\n/**\n * base class for ASN.1 DER structured class\n * @name KJUR.asn1.DERAbstractStructured\n * @class base class for ASN.1 DER structured class\n * @property {Array} asn1Array internal array of ASN1Object\n * @extends KJUR.asn1.ASN1Object\n * @description\n * @see KJUR.asn1.ASN1Object - superclass\n */\nKJUR.asn1.DERAbstractStructured = function(params) {\n KJUR.asn1.DERAbstractString.superclass.constructor.call(this);\n var asn1Array = null;\n\n /**\n * set value by array of ASN1Object\n * @name setByASN1ObjectArray\n * @memberOf KJUR.asn1.DERAbstractStructured\n * @function\n * @param {array} asn1ObjectArray array of ASN1Object to set\n */\n this.setByASN1ObjectArray = function(asn1ObjectArray) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.asn1Array = asn1ObjectArray;\n };\n\n /**\n * append an ASN1Object to internal array\n * @name appendASN1Object\n * @memberOf KJUR.asn1.DERAbstractStructured\n * @function\n * @param {ASN1Object} asn1Object to add\n */\n this.appendASN1Object = function(asn1Object) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.asn1Array.push(asn1Object);\n };\n\n this.asn1Array = new Array();\n if (typeof params != \"undefined\") {\n\tif (typeof params['array'] != \"undefined\") {\n\t this.asn1Array = params['array'];\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERAbstractStructured, KJUR.asn1.ASN1Object);\n\n\n// ********************************************************************\n// ASN.1 Object Classes\n// ********************************************************************\n\n// ********************************************************************\n/**\n * class for ASN.1 DER Boolean\n * @name KJUR.asn1.DERBoolean\n * @class class for ASN.1 DER Boolean\n * @extends KJUR.asn1.ASN1Object\n * @description\n * @see KJUR.asn1.ASN1Object - superclass\n */\nKJUR.asn1.DERBoolean = function() {\n KJUR.asn1.DERBoolean.superclass.constructor.call(this);\n this.hT = \"01\";\n this.hTLV = \"0101ff\";\n};\nJSX.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER Integer\n * @name KJUR.asn1.DERInteger\n * @class class for ASN.1 DER Integer\n * @extends KJUR.asn1.ASN1Object\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • int - specify initial ASN.1 value(V) by integer value
  • \n *
  • bigint - specify initial ASN.1 value(V) by BigInteger object
  • \n *
  • hex - specify initial ASN.1 value(V) by a hexadecimal string
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERInteger = function(params) {\n KJUR.asn1.DERInteger.superclass.constructor.call(this);\n this.hT = \"02\";\n\n /**\n * set value by Tom Wu's BigInteger object\n * @name setByBigInteger\n * @memberOf KJUR.asn1.DERInteger\n * @function\n * @param {BigInteger} bigIntegerValue to set\n */\n this.setByBigInteger = function(bigIntegerValue) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(bigIntegerValue);\n };\n\n /**\n * set value by integer value\n * @name setByInteger\n * @memberOf KJUR.asn1.DERInteger\n * @function\n * @param {Integer} integer value to set\n */\n this.setByInteger = function(intValue) {\n\tvar bi = new BigInteger(String(intValue), 10);\n\tthis.setByBigInteger(bi);\n };\n\n /**\n * set value by integer value\n * @name setValueHex\n * @memberOf KJUR.asn1.DERInteger\n * @function\n * @param {String} hexadecimal string of integer value\n * @description\n *
\n * NOTE: Value shall be represented by minimum octet length of\n * two's complement representation.\n */\n this.setValueHex = function(newHexString) {\n\tthis.hV = newHexString;\n };\n\n this.getFreshValueHex = function() {\n\treturn this.hV;\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['bigint'] != \"undefined\") {\n\t this.setByBigInteger(params['bigint']);\n\t} else if (typeof params['int'] != \"undefined\") {\n\t this.setByInteger(params['int']);\n\t} else if (typeof params['hex'] != \"undefined\") {\n\t this.setValueHex(params['hex']);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER encoded BitString primitive\n * @name KJUR.asn1.DERBitString\n * @class class for ASN.1 DER encoded BitString primitive\n * @extends KJUR.asn1.ASN1Object\n * @description \n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • bin - specify binary string (ex. '10111')
  • \n *
  • array - specify array of boolean (ex. [true,false,true,true])
  • \n *
  • hex - specify hexadecimal string of ASN.1 value(V) including unused bits
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERBitString = function(params) {\n KJUR.asn1.DERBitString.superclass.constructor.call(this);\n this.hT = \"03\";\n\n /**\n * set ASN.1 value(V) by a hexadecimal string including unused bits\n * @name setHexValueIncludingUnusedBits\n * @memberOf KJUR.asn1.DERBitString\n * @function\n * @param {String} newHexStringIncludingUnusedBits\n */\n this.setHexValueIncludingUnusedBits = function(newHexStringIncludingUnusedBits) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.hV = newHexStringIncludingUnusedBits;\n };\n\n /**\n * set ASN.1 value(V) by unused bit and hexadecimal string of value\n * @name setUnusedBitsAndHexValue\n * @memberOf KJUR.asn1.DERBitString\n * @function\n * @param {Integer} unusedBits\n * @param {String} hValue\n */\n this.setUnusedBitsAndHexValue = function(unusedBits, hValue) {\n\tif (unusedBits < 0 || 7 < unusedBits) {\n\t throw \"unused bits shall be from 0 to 7: u = \" + unusedBits;\n\t}\n\tvar hUnusedBits = \"0\" + unusedBits;\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.hV = hUnusedBits + hValue;\n };\n\n /**\n * set ASN.1 DER BitString by binary string\n * @name setByBinaryString\n * @memberOf KJUR.asn1.DERBitString\n * @function\n * @param {String} binaryString binary value string (i.e. '10111')\n * @description\n * Its unused bits will be calculated automatically by length of \n * 'binaryValue'.
\n * NOTE: Trailing zeros '0' will be ignored.\n */\n this.setByBinaryString = function(binaryString) {\n\tbinaryString = binaryString.replace(/0+$/, '');\n\tvar unusedBits = 8 - binaryString.length % 8;\n\tif (unusedBits == 8) unusedBits = 0;\n\tfor (var i = 0; i <= unusedBits; i++) {\n\t binaryString += '0';\n\t}\n\tvar h = '';\n\tfor (var i = 0; i < binaryString.length - 1; i += 8) {\n\t var b = binaryString.substr(i, 8);\n\t var x = parseInt(b, 2).toString(16);\n\t if (x.length == 1) x = '0' + x;\n\t h += x; \n\t}\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.hV = '0' + unusedBits + h;\n };\n\n /**\n * set ASN.1 TLV value(V) by an array of boolean\n * @name setByBooleanArray\n * @memberOf KJUR.asn1.DERBitString\n * @function\n * @param {array} booleanArray array of boolean (ex. [true, false, true])\n * @description\n * NOTE: Trailing falses will be ignored.\n */\n this.setByBooleanArray = function(booleanArray) {\n\tvar s = '';\n\tfor (var i = 0; i < booleanArray.length; i++) {\n\t if (booleanArray[i] == true) {\n\t\ts += '1';\n\t } else {\n\t\ts += '0';\n\t }\n\t}\n\tthis.setByBinaryString(s);\n };\n\n /**\n * generate an array of false with specified length\n * @name newFalseArray\n * @memberOf KJUR.asn1.DERBitString\n * @function\n * @param {Integer} nLength length of array to generate\n * @return {array} array of boolean faluse\n * @description\n * This static method may be useful to initialize boolean array.\n */\n this.newFalseArray = function(nLength) {\n\tvar a = new Array(nLength);\n\tfor (var i = 0; i < nLength; i++) {\n\t a[i] = false;\n\t}\n\treturn a;\n };\n\n this.getFreshValueHex = function() {\n\treturn this.hV;\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['hex'] != \"undefined\") {\n\t this.setHexValueIncludingUnusedBits(params['hex']);\n\t} else if (typeof params['bin'] != \"undefined\") {\n\t this.setByBinaryString(params['bin']);\n\t} else if (typeof params['array'] != \"undefined\") {\n\t this.setByBooleanArray(params['array']);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER OctetString\n * @name KJUR.asn1.DEROctetString\n * @class class for ASN.1 DER OctetString\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @extends KJUR.asn1.DERAbstractString\n * @description\n * @see KJUR.asn1.DERAbstractString - superclass\n */\nKJUR.asn1.DEROctetString = function(params) {\n KJUR.asn1.DEROctetString.superclass.constructor.call(this, params);\n this.hT = \"04\";\n};\nJSX.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER Null\n * @name KJUR.asn1.DERNull\n * @class class for ASN.1 DER Null\n * @extends KJUR.asn1.ASN1Object\n * @description\n * @see KJUR.asn1.ASN1Object - superclass\n */\nKJUR.asn1.DERNull = function() {\n KJUR.asn1.DERNull.superclass.constructor.call(this);\n this.hT = \"05\";\n this.hTLV = \"0500\";\n};\nJSX.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER ObjectIdentifier\n * @name KJUR.asn1.DERObjectIdentifier\n * @class class for ASN.1 DER ObjectIdentifier\n * @param {Array} params associative array of parameters (ex. {'oid': '2.5.4.5'})\n * @extends KJUR.asn1.ASN1Object\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • oid - specify initial ASN.1 value(V) by a oid string (ex. 2.5.4.13)
  • \n *
  • hex - specify initial ASN.1 value(V) by a hexadecimal string
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERObjectIdentifier = function(params) {\n var itox = function(i) {\n\tvar h = i.toString(16);\n\tif (h.length == 1) h = '0' + h;\n\treturn h;\n };\n var roidtox = function(roid) {\n\tvar h = '';\n\tvar bi = new BigInteger(roid, 10);\n\tvar b = bi.toString(2);\n\tvar padLen = 7 - b.length % 7;\n\tif (padLen == 7) padLen = 0;\n\tvar bPad = '';\n\tfor (var i = 0; i < padLen; i++) bPad += '0';\n\tb = bPad + b;\n\tfor (var i = 0; i < b.length - 1; i += 7) {\n\t var b8 = b.substr(i, 7);\n\t if (i != b.length - 7) b8 = '1' + b8;\n\t h += itox(parseInt(b8, 2));\n\t}\n\treturn h;\n }\n\n KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this);\n this.hT = \"06\";\n\n /**\n * set value by a hexadecimal string\n * @name setValueHex\n * @memberOf KJUR.asn1.DERObjectIdentifier\n * @function\n * @param {String} newHexString hexadecimal value of OID bytes\n */\n this.setValueHex = function(newHexString) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.s = null;\n\tthis.hV = newHexString;\n };\n\n /**\n * set value by a OID string\n * @name setValueOidString\n * @memberOf KJUR.asn1.DERObjectIdentifier\n * @function\n * @param {String} oidString OID string (ex. 2.5.4.13)\n */\n this.setValueOidString = function(oidString) {\n\tif (! oidString.match(/^[0-9.]+$/)) {\n\t throw \"malformed oid string: \" + oidString;\n\t}\n\tvar h = '';\n\tvar a = oidString.split('.');\n\tvar i0 = parseInt(a[0]) * 40 + parseInt(a[1]);\n\th += itox(i0);\n\ta.splice(0, 2);\n\tfor (var i = 0; i < a.length; i++) {\n\t h += roidtox(a[i]);\n\t}\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.s = null;\n\tthis.hV = h;\n };\n\n /**\n * set value by a OID name\n * @name setValueName\n * @memberOf KJUR.asn1.DERObjectIdentifier\n * @function\n * @param {String} oidName OID name (ex. 'serverAuth')\n * @since 1.0.1\n * @description\n * OID name shall be defined in 'KJUR.asn1.x509.OID.name2oidList'.\n * Otherwise raise error.\n */\n this.setValueName = function(oidName) {\n\tif (typeof KJUR.asn1.x509.OID.name2oidList[oidName] != \"undefined\") {\n\t var oid = KJUR.asn1.x509.OID.name2oidList[oidName];\n\t this.setValueOidString(oid);\n\t} else {\n\t throw \"DERObjectIdentifier oidName undefined: \" + oidName;\n\t}\n };\n\n this.getFreshValueHex = function() {\n\treturn this.hV;\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['oid'] != \"undefined\") {\n\t this.setValueOidString(params['oid']);\n\t} else if (typeof params['hex'] != \"undefined\") {\n\t this.setValueHex(params['hex']);\n\t} else if (typeof params['name'] != \"undefined\") {\n\t this.setValueName(params['name']);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER UTF8String\n * @name KJUR.asn1.DERUTF8String\n * @class class for ASN.1 DER UTF8String\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @extends KJUR.asn1.DERAbstractString\n * @description\n * @see KJUR.asn1.DERAbstractString - superclass\n */\nKJUR.asn1.DERUTF8String = function(params) {\n KJUR.asn1.DERUTF8String.superclass.constructor.call(this, params);\n this.hT = \"0c\";\n};\nJSX.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER NumericString\n * @name KJUR.asn1.DERNumericString\n * @class class for ASN.1 DER NumericString\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @extends KJUR.asn1.DERAbstractString\n * @description\n * @see KJUR.asn1.DERAbstractString - superclass\n */\nKJUR.asn1.DERNumericString = function(params) {\n KJUR.asn1.DERNumericString.superclass.constructor.call(this, params);\n this.hT = \"12\";\n};\nJSX.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER PrintableString\n * @name KJUR.asn1.DERPrintableString\n * @class class for ASN.1 DER PrintableString\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @extends KJUR.asn1.DERAbstractString\n * @description\n * @see KJUR.asn1.DERAbstractString - superclass\n */\nKJUR.asn1.DERPrintableString = function(params) {\n KJUR.asn1.DERPrintableString.superclass.constructor.call(this, params);\n this.hT = \"13\";\n};\nJSX.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER TeletexString\n * @name KJUR.asn1.DERTeletexString\n * @class class for ASN.1 DER TeletexString\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @extends KJUR.asn1.DERAbstractString\n * @description\n * @see KJUR.asn1.DERAbstractString - superclass\n */\nKJUR.asn1.DERTeletexString = function(params) {\n KJUR.asn1.DERTeletexString.superclass.constructor.call(this, params);\n this.hT = \"14\";\n};\nJSX.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER IA5String\n * @name KJUR.asn1.DERIA5String\n * @class class for ASN.1 DER IA5String\n * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})\n * @extends KJUR.asn1.DERAbstractString\n * @description\n * @see KJUR.asn1.DERAbstractString - superclass\n */\nKJUR.asn1.DERIA5String = function(params) {\n KJUR.asn1.DERIA5String.superclass.constructor.call(this, params);\n this.hT = \"16\";\n};\nJSX.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER UTCTime\n * @name KJUR.asn1.DERUTCTime\n * @class class for ASN.1 DER UTCTime\n * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})\n * @extends KJUR.asn1.DERAbstractTime\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • str - specify initial ASN.1 value(V) by a string (ex.'130430235959Z')
  • \n *
  • hex - specify initial ASN.1 value(V) by a hexadecimal string
  • \n *
  • date - specify Date object.
  • \n *
\n * NOTE: 'params' can be omitted.\n *

EXAMPLES

\n * @example\n * var d1 = new KJUR.asn1.DERUTCTime();\n * d1.setString('130430125959Z');\n *\n * var d2 = new KJUR.asn1.DERUTCTime({'str': '130430125959Z'});\n *\n * var d3 = new KJUR.asn1.DERUTCTime({'date': new Date(Date.UTC(2015, 0, 31, 0, 0, 0, 0))});\n */\nKJUR.asn1.DERUTCTime = function(params) {\n KJUR.asn1.DERUTCTime.superclass.constructor.call(this, params);\n this.hT = \"17\";\n\n /**\n * set value by a Date object\n * @name setByDate\n * @memberOf KJUR.asn1.DERUTCTime\n * @function\n * @param {Date} dateObject Date object to set ASN.1 value(V)\n */\n this.setByDate = function(dateObject) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.date = dateObject;\n\tthis.s = this.formatDate(this.date, 'utc');\n\tthis.hV = stohex(this.s);\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['str'] != \"undefined\") {\n\t this.setString(params['str']);\n\t} else if (typeof params['hex'] != \"undefined\") {\n\t this.setStringHex(params['hex']);\n\t} else if (typeof params['date'] != \"undefined\") {\n\t this.setByDate(params['date']);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER GeneralizedTime\n * @name KJUR.asn1.DERGeneralizedTime\n * @class class for ASN.1 DER GeneralizedTime\n * @param {Array} params associative array of parameters (ex. {'str': '20130430235959Z'})\n * @extends KJUR.asn1.DERAbstractTime\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • str - specify initial ASN.1 value(V) by a string (ex.'20130430235959Z')
  • \n *
  • hex - specify initial ASN.1 value(V) by a hexadecimal string
  • \n *
  • date - specify Date object.
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERGeneralizedTime = function(params) {\n KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, params);\n this.hT = \"18\";\n\n /**\n * set value by a Date object\n * @name setByDate\n * @memberOf KJUR.asn1.DERGeneralizedTime\n * @function\n * @param {Date} dateObject Date object to set ASN.1 value(V)\n * @example\n * When you specify UTC time, use 'Date.UTC' method like this:
\n * var o = new DERUTCTime();\n * var date = new Date(Date.UTC(2015, 0, 31, 23, 59, 59, 0)); #2015JAN31 23:59:59\n * o.setByDate(date);\n */\n this.setByDate = function(dateObject) {\n\tthis.hTLV = null;\n\tthis.isModified = true;\n\tthis.date = dateObject;\n\tthis.s = this.formatDate(this.date, 'gen');\n\tthis.hV = stohex(this.s);\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['str'] != \"undefined\") {\n\t this.setString(params['str']);\n\t} else if (typeof params['hex'] != \"undefined\") {\n\t this.setStringHex(params['hex']);\n\t} else if (typeof params['date'] != \"undefined\") {\n\t this.setByDate(params['date']);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER Sequence\n * @name KJUR.asn1.DERSequence\n * @class class for ASN.1 DER Sequence\n * @extends KJUR.asn1.DERAbstractStructured\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • array - specify array of ASN1Object to set elements of content
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERSequence = function(params) {\n KJUR.asn1.DERSequence.superclass.constructor.call(this, params);\n this.hT = \"30\";\n this.getFreshValueHex = function() {\n\tvar h = '';\n\tfor (var i = 0; i < this.asn1Array.length; i++) {\n\t var asn1Obj = this.asn1Array[i];\n\t h += asn1Obj.getEncodedHex();\n\t}\n\tthis.hV = h;\n\treturn this.hV;\n };\n};\nJSX.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER Set\n * @name KJUR.asn1.DERSet\n * @class class for ASN.1 DER Set\n * @extends KJUR.asn1.DERAbstractStructured\n * @description\n *
\n * As for argument 'params' for constructor, you can specify one of\n * following properties:\n *
    \n *
  • array - specify array of ASN1Object to set elements of content
  • \n *
\n * NOTE: 'params' can be omitted.\n */\nKJUR.asn1.DERSet = function(params) {\n KJUR.asn1.DERSet.superclass.constructor.call(this, params);\n this.hT = \"31\";\n this.getFreshValueHex = function() {\n\tvar a = new Array();\n\tfor (var i = 0; i < this.asn1Array.length; i++) {\n\t var asn1Obj = this.asn1Array[i];\n\t a.push(asn1Obj.getEncodedHex());\n\t}\n\ta.sort();\n\tthis.hV = a.join('');\n\treturn this.hV;\n };\n};\nJSX.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured);\n\n// ********************************************************************\n/**\n * class for ASN.1 DER TaggedObject\n * @name KJUR.asn1.DERTaggedObject\n * @class class for ASN.1 DER TaggedObject\n * @extends KJUR.asn1.ASN1Object\n * @description\n *
\n * Parameter 'tagNoNex' is ASN.1 tag(T) value for this object.\n * For example, if you find '[1]' tag in a ASN.1 dump, \n * 'tagNoHex' will be 'a1'.\n *
\n * As for optional argument 'params' for constructor, you can specify *ANY* of\n * following properties:\n *
    \n *
  • explicit - specify true if this is explicit tag otherwise false \n * (default is 'true').
  • \n *
  • tag - specify tag (default is 'a0' which means [0])
  • \n *
  • obj - specify ASN1Object which is tagged
  • \n *
\n * @example\n * d1 = new KJUR.asn1.DERUTF8String({'str':'a'});\n * d2 = new KJUR.asn1.DERTaggedObject({'obj': d1});\n * hex = d2.getEncodedHex();\n */\nKJUR.asn1.DERTaggedObject = function(params) {\n KJUR.asn1.DERTaggedObject.superclass.constructor.call(this);\n this.hT = \"a0\";\n this.hV = '';\n this.isExplicit = true;\n this.asn1Object = null;\n\n /**\n * set value by an ASN1Object\n * @name setString\n * @memberOf KJUR.asn1.DERTaggedObject\n * @function\n * @param {Boolean} isExplicitFlag flag for explicit/implicit tag\n * @param {Integer} tagNoHex hexadecimal string of ASN.1 tag\n * @param {ASN1Object} asn1Object ASN.1 to encapsulate\n */\n this.setASN1Object = function(isExplicitFlag, tagNoHex, asn1Object) {\n\tthis.hT = tagNoHex;\n\tthis.isExplicit = isExplicitFlag;\n\tthis.asn1Object = asn1Object;\n\tif (this.isExplicit) {\n\t this.hV = this.asn1Object.getEncodedHex();\n\t this.hTLV = null;\n\t this.isModified = true;\n\t} else {\n\t this.hV = null;\n\t this.hTLV = asn1Object.getEncodedHex();\n\t this.hTLV = this.hTLV.replace(/^../, tagNoHex);\n\t this.isModified = false;\n\t}\n };\n\n this.getFreshValueHex = function() {\n\treturn this.hV;\n };\n\n if (typeof params != \"undefined\") {\n\tif (typeof params['tag'] != \"undefined\") {\n\t this.hT = params['tag'];\n\t}\n\tif (typeof params['explicit'] != \"undefined\") {\n\t this.isExplicit = params['explicit'];\n\t}\n\tif (typeof params['obj'] != \"undefined\") {\n\t this.asn1Object = params['obj'];\n\t this.setASN1Object(this.isExplicit, this.hT, this.asn1Object);\n\t}\n }\n};\nJSX.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object);\n// Hex JavaScript decoder\n// Copyright (c) 2008-2013 Lapo Luchini \n\n// Permission to use, copy, modify, and/or distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */\n(function (undefined) {\n\"use strict\";\n\nvar Hex = {},\n decoder;\n\nHex.decode = function(a) {\n var i;\n if (decoder === undefined) {\n var hex = \"0123456789ABCDEF\",\n ignore = \" \\f\\n\\r\\t\\u00A0\\u2028\\u2029\";\n decoder = [];\n for (i = 0; i < 16; ++i)\n decoder[hex.charAt(i)] = i;\n hex = hex.toLowerCase();\n for (i = 10; i < 16; ++i)\n decoder[hex.charAt(i)] = i;\n for (i = 0; i < ignore.length; ++i)\n decoder[ignore.charAt(i)] = -1;\n }\n var out = [],\n bits = 0,\n char_count = 0;\n for (i = 0; i < a.length; ++i) {\n var c = a.charAt(i);\n if (c == '=')\n break;\n c = decoder[c];\n if (c == -1)\n continue;\n if (c === undefined)\n throw 'Illegal character at offset ' + i;\n bits |= c;\n if (++char_count >= 2) {\n out[out.length] = bits;\n bits = 0;\n char_count = 0;\n } else {\n bits <<= 4;\n }\n }\n if (char_count)\n throw \"Hex encoding incomplete: 4 bits missing\";\n return out;\n};\n\n// export globals\nwindow.Hex = Hex;\n})();\n// Base64 JavaScript decoder\n// Copyright (c) 2008-2013 Lapo Luchini \n\n// Permission to use, copy, modify, and/or distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */\n(function (undefined) {\n\"use strict\";\n\nvar Base64 = {},\n decoder;\n\nBase64.decode = function (a) {\n var i;\n if (decoder === undefined) {\n var b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",\n ignore = \"= \\f\\n\\r\\t\\u00A0\\u2028\\u2029\";\n decoder = [];\n for (i = 0; i < 64; ++i)\n decoder[b64.charAt(i)] = i;\n for (i = 0; i < ignore.length; ++i)\n decoder[ignore.charAt(i)] = -1;\n }\n var out = [];\n var bits = 0, char_count = 0;\n for (i = 0; i < a.length; ++i) {\n var c = a.charAt(i);\n if (c == '=')\n break;\n c = decoder[c];\n if (c == -1)\n continue;\n if (c === undefined)\n throw 'Illegal character at offset ' + i;\n bits |= c;\n if (++char_count >= 4) {\n out[out.length] = (bits >> 16);\n out[out.length] = (bits >> 8) & 0xFF;\n out[out.length] = bits & 0xFF;\n bits = 0;\n char_count = 0;\n } else {\n bits <<= 6;\n }\n }\n switch (char_count) {\n case 1:\n throw \"Base64 encoding incomplete: at least 2 bits missing\";\n case 2:\n out[out.length] = (bits >> 10);\n break;\n case 3:\n out[out.length] = (bits >> 16);\n out[out.length] = (bits >> 8) & 0xFF;\n break;\n }\n return out;\n};\n\nBase64.re = /-----BEGIN [^-]+-----([A-Za-z0-9+\\/=\\s]+)-----END [^-]+-----|begin-base64[^\\n]+\\n([A-Za-z0-9+\\/=\\s]+)====/;\nBase64.unarmor = function (a) {\n var m = Base64.re.exec(a);\n if (m) {\n if (m[1])\n a = m[1];\n else if (m[2])\n a = m[2];\n else\n throw \"RegExp out of sync\";\n }\n return Base64.decode(a);\n};\n\n// export globals\nwindow.Base64 = Base64;\n})();\n// ASN.1 JavaScript decoder\n// Copyright (c) 2008-2013 Lapo Luchini \n\n// Permission to use, copy, modify, and/or distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */\n/*global oids */\n(function (undefined) {\n\"use strict\";\n\nvar hardLimit = 100,\n ellipsis = \"\\u2026\",\n DOM = {\n tag: function (tagName, className) {\n var t = document.createElement(tagName);\n t.className = className;\n return t;\n },\n text: function (str) {\n return document.createTextNode(str);\n }\n };\n\nfunction Stream(enc, pos) {\n if (enc instanceof Stream) {\n this.enc = enc.enc;\n this.pos = enc.pos;\n } else {\n this.enc = enc;\n this.pos = pos;\n }\n}\nStream.prototype.get = function (pos) {\n if (pos === undefined)\n pos = this.pos++;\n if (pos >= this.enc.length)\n throw 'Requesting byte offset ' + pos + ' on a stream of length ' + this.enc.length;\n return this.enc[pos];\n};\nStream.prototype.hexDigits = \"0123456789ABCDEF\";\nStream.prototype.hexByte = function (b) {\n return this.hexDigits.charAt((b >> 4) & 0xF) + this.hexDigits.charAt(b & 0xF);\n};\nStream.prototype.hexDump = function (start, end, raw) {\n var s = \"\";\n for (var i = start; i < end; ++i) {\n s += this.hexByte(this.get(i));\n if (raw !== true)\n switch (i & 0xF) {\n case 0x7: s += \" \"; break;\n case 0xF: s += \"\\n\"; break;\n default: s += \" \";\n }\n }\n return s;\n};\nStream.prototype.parseStringISO = function (start, end) {\n var s = \"\";\n for (var i = start; i < end; ++i)\n s += String.fromCharCode(this.get(i));\n return s;\n};\nStream.prototype.parseStringUTF = function (start, end) {\n var s = \"\";\n for (var i = start; i < end; ) {\n var c = this.get(i++);\n if (c < 128)\n s += String.fromCharCode(c);\n else if ((c > 191) && (c < 224))\n s += String.fromCharCode(((c & 0x1F) << 6) | (this.get(i++) & 0x3F));\n else\n s += String.fromCharCode(((c & 0x0F) << 12) | ((this.get(i++) & 0x3F) << 6) | (this.get(i++) & 0x3F));\n }\n return s;\n};\nStream.prototype.parseStringBMP = function (start, end) {\n var str = \"\"\n for (var i = start; i < end; i += 2) {\n var high_byte = this.get(i);\n var low_byte = this.get(i + 1);\n str += String.fromCharCode( (high_byte << 8) + low_byte );\n }\n\n return str;\n};\nStream.prototype.reTime = /^((?:1[89]|2\\d)?\\d\\d)(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])([01]\\d|2[0-3])(?:([0-5]\\d)(?:([0-5]\\d)(?:[.,](\\d{1,3}))?)?)?(Z|[-+](?:[0]\\d|1[0-2])([0-5]\\d)?)?$/;\nStream.prototype.parseTime = function (start, end) {\n var s = this.parseStringISO(start, end),\n m = this.reTime.exec(s);\n if (!m)\n return \"Unrecognized time: \" + s;\n s = m[1] + \"-\" + m[2] + \"-\" + m[3] + \" \" + m[4];\n if (m[5]) {\n s += \":\" + m[5];\n if (m[6]) {\n s += \":\" + m[6];\n if (m[7])\n s += \".\" + m[7];\n }\n }\n if (m[8]) {\n s += \" UTC\";\n if (m[8] != 'Z') {\n s += m[8];\n if (m[9])\n s += \":\" + m[9];\n }\n }\n return s;\n};\nStream.prototype.parseInteger = function (start, end) {\n //TODO support negative numbers\n var len = end - start;\n if (len > 4) {\n len <<= 3;\n var s = this.get(start);\n if (s === 0)\n len -= 8;\n else\n while (s < 128) {\n s <<= 1;\n --len;\n }\n return \"(\" + len + \" bit)\";\n }\n var n = 0;\n for (var i = start; i < end; ++i)\n n = (n << 8) | this.get(i);\n return n;\n};\nStream.prototype.parseBitString = function (start, end) {\n var unusedBit = this.get(start),\n lenBit = ((end - start - 1) << 3) - unusedBit,\n s = \"(\" + lenBit + \" bit)\";\n if (lenBit <= 20) {\n var skip = unusedBit;\n s += \" \";\n for (var i = end - 1; i > start; --i) {\n var b = this.get(i);\n for (var j = skip; j < 8; ++j)\n s += (b >> j) & 1 ? \"1\" : \"0\";\n skip = 0;\n }\n }\n return s;\n};\nStream.prototype.parseOctetString = function (start, end) {\n var len = end - start,\n s = \"(\" + len + \" byte) \";\n if (len > hardLimit)\n end = start + hardLimit;\n for (var i = start; i < end; ++i)\n s += this.hexByte(this.get(i)); //TODO: also try Latin1?\n if (len > hardLimit)\n s += ellipsis;\n return s;\n};\nStream.prototype.parseOID = function (start, end) {\n var s = '',\n n = 0,\n bits = 0;\n for (var i = start; i < end; ++i) {\n var v = this.get(i);\n n = (n << 7) | (v & 0x7F);\n bits += 7;\n if (!(v & 0x80)) { // finished\n if (s === '') {\n var m = n < 80 ? n < 40 ? 0 : 1 : 2;\n s = m + \".\" + (n - m * 40);\n } else\n s += \".\" + ((bits >= 31) ? \"bigint\" : n);\n n = bits = 0;\n }\n }\n return s;\n};\n\nfunction ASN1(stream, header, length, tag, sub) {\n this.stream = stream;\n this.header = header;\n this.length = length;\n this.tag = tag;\n this.sub = sub;\n}\nASN1.prototype.typeName = function () {\n if (this.tag === undefined)\n return \"unknown\";\n var tagClass = this.tag >> 6,\n tagConstructed = (this.tag >> 5) & 1,\n tagNumber = this.tag & 0x1F;\n switch (tagClass) {\n case 0: // universal\n switch (tagNumber) {\n case 0x00: return \"EOC\";\n case 0x01: return \"BOOLEAN\";\n case 0x02: return \"INTEGER\";\n case 0x03: return \"BIT_STRING\";\n case 0x04: return \"OCTET_STRING\";\n case 0x05: return \"NULL\";\n case 0x06: return \"OBJECT_IDENTIFIER\";\n case 0x07: return \"ObjectDescriptor\";\n case 0x08: return \"EXTERNAL\";\n case 0x09: return \"REAL\";\n case 0x0A: return \"ENUMERATED\";\n case 0x0B: return \"EMBEDDED_PDV\";\n case 0x0C: return \"UTF8String\";\n case 0x10: return \"SEQUENCE\";\n case 0x11: return \"SET\";\n case 0x12: return \"NumericString\";\n case 0x13: return \"PrintableString\"; // ASCII subset\n case 0x14: return \"TeletexString\"; // aka T61String\n case 0x15: return \"VideotexString\";\n case 0x16: return \"IA5String\"; // ASCII\n case 0x17: return \"UTCTime\";\n case 0x18: return \"GeneralizedTime\";\n case 0x19: return \"GraphicString\";\n case 0x1A: return \"VisibleString\"; // ASCII subset\n case 0x1B: return \"GeneralString\";\n case 0x1C: return \"UniversalString\";\n case 0x1E: return \"BMPString\";\n default: return \"Universal_\" + tagNumber.toString(16);\n }\n case 1: return \"Application_\" + tagNumber.toString(16);\n case 2: return \"[\" + tagNumber + \"]\"; // Context\n case 3: return \"Private_\" + tagNumber.toString(16);\n }\n};\nASN1.prototype.reSeemsASCII = /^[ -~]+$/;\nASN1.prototype.content = function () {\n if (this.tag === undefined)\n return null;\n var tagClass = this.tag >> 6,\n tagNumber = this.tag & 0x1F,\n content = this.posContent(),\n len = Math.abs(this.length);\n if (tagClass !== 0) { // universal\n if (this.sub !== null)\n return \"(\" + this.sub.length + \" elem)\";\n //TODO: TRY TO PARSE ASCII STRING\n var s = this.stream.parseStringISO(content, content + Math.min(len, hardLimit));\n if (this.reSeemsASCII.test(s))\n return s.substring(0, 2 * hardLimit) + ((s.length > 2 * hardLimit) ? ellipsis : \"\");\n else\n return this.stream.parseOctetString(content, content + len);\n }\n switch (tagNumber) {\n case 0x01: // BOOLEAN\n return (this.stream.get(content) === 0) ? \"false\" : \"true\";\n case 0x02: // INTEGER\n return this.stream.parseInteger(content, content + len);\n case 0x03: // BIT_STRING\n return this.sub ? \"(\" + this.sub.length + \" elem)\" :\n this.stream.parseBitString(content, content + len);\n case 0x04: // OCTET_STRING\n return this.sub ? \"(\" + this.sub.length + \" elem)\" :\n this.stream.parseOctetString(content, content + len);\n //case 0x05: // NULL\n case 0x06: // OBJECT_IDENTIFIER\n return this.stream.parseOID(content, content + len);\n //case 0x07: // ObjectDescriptor\n //case 0x08: // EXTERNAL\n //case 0x09: // REAL\n //case 0x0A: // ENUMERATED\n //case 0x0B: // EMBEDDED_PDV\n case 0x10: // SEQUENCE\n case 0x11: // SET\n return \"(\" + this.sub.length + \" elem)\";\n case 0x0C: // UTF8String\n return this.stream.parseStringUTF(content, content + len);\n case 0x12: // NumericString\n case 0x13: // PrintableString\n case 0x14: // TeletexString\n case 0x15: // VideotexString\n case 0x16: // IA5String\n //case 0x19: // GraphicString\n case 0x1A: // VisibleString\n //case 0x1B: // GeneralString\n //case 0x1C: // UniversalString\n return this.stream.parseStringISO(content, content + len);\n case 0x1E: // BMPString\n return this.stream.parseStringBMP(content, content + len);\n case 0x17: // UTCTime\n case 0x18: // GeneralizedTime\n return this.stream.parseTime(content, content + len);\n }\n return null;\n};\nASN1.prototype.toString = function () {\n return this.typeName() + \"@\" + this.stream.pos + \"[header:\" + this.header + \",length:\" + this.length + \",sub:\" + ((this.sub === null) ? 'null' : this.sub.length) + \"]\";\n};\nASN1.prototype.print = function (indent) {\n if (indent === undefined) indent = '';\n document.writeln(indent + this);\n if (this.sub !== null) {\n indent += ' ';\n for (var i = 0, max = this.sub.length; i < max; ++i)\n this.sub[i].print(indent);\n }\n};\nASN1.prototype.toPrettyString = function (indent) {\n if (indent === undefined) indent = '';\n var s = indent + this.typeName() + \" @\" + this.stream.pos;\n if (this.length >= 0)\n s += \"+\";\n s += this.length;\n if (this.tag & 0x20)\n s += \" (constructed)\";\n else if (((this.tag == 0x03) || (this.tag == 0x04)) && (this.sub !== null))\n s += \" (encapsulates)\";\n s += \"\\n\";\n if (this.sub !== null) {\n indent += ' ';\n for (var i = 0, max = this.sub.length; i < max; ++i)\n s += this.sub[i].toPrettyString(indent);\n }\n return s;\n};\nASN1.prototype.toDOM = function () {\n var node = DOM.tag(\"div\", \"node\");\n node.asn1 = this;\n var head = DOM.tag(\"div\", \"head\");\n var s = this.typeName().replace(/_/g, \" \");\n head.innerHTML = s;\n var content = this.content();\n if (content !== null) {\n content = String(content).replace(/\";\n s += \"Length: \" + this.header + \"+\";\n if (this.length >= 0)\n s += this.length;\n else\n s += (-this.length) + \" (undefined)\";\n if (this.tag & 0x20)\n s += \"
(constructed)\";\n else if (((this.tag == 0x03) || (this.tag == 0x04)) && (this.sub !== null))\n s += \"
(encapsulates)\";\n //TODO if (this.tag == 0x03) s += \"Unused bits: \"\n if (content !== null) {\n s += \"
Value:
\" + content + \"\";\n if ((typeof oids === 'object') && (this.tag == 0x06)) {\n var oid = oids[content];\n if (oid) {\n if (oid.d) s += \"
\" + oid.d;\n if (oid.c) s += \"
\" + oid.c;\n if (oid.w) s += \"
(warning!)\";\n }\n }\n }\n value.innerHTML = s;\n node.appendChild(value);\n var sub = DOM.tag(\"div\", \"sub\");\n if (this.sub !== null) {\n for (var i = 0, max = this.sub.length; i < max; ++i)\n sub.appendChild(this.sub[i].toDOM());\n }\n node.appendChild(sub);\n head.onclick = function () {\n node.className = (node.className == \"node collapsed\") ? \"node\" : \"node collapsed\";\n };\n return node;\n};\nASN1.prototype.posStart = function () {\n return this.stream.pos;\n};\nASN1.prototype.posContent = function () {\n return this.stream.pos + this.header;\n};\nASN1.prototype.posEnd = function () {\n return this.stream.pos + this.header + Math.abs(this.length);\n};\nASN1.prototype.fakeHover = function (current) {\n this.node.className += \" hover\";\n if (current)\n this.head.className += \" hover\";\n};\nASN1.prototype.fakeOut = function (current) {\n var re = / ?hover/;\n this.node.className = this.node.className.replace(re, \"\");\n if (current)\n this.head.className = this.head.className.replace(re, \"\");\n};\nASN1.prototype.toHexDOM_sub = function (node, className, stream, start, end) {\n if (start >= end)\n return;\n var sub = DOM.tag(\"span\", className);\n sub.appendChild(DOM.text(\n stream.hexDump(start, end)));\n node.appendChild(sub);\n};\nASN1.prototype.toHexDOM = function (root) {\n var node = DOM.tag(\"span\", \"hex\");\n if (root === undefined) root = node;\n this.head.hexNode = node;\n this.head.onmouseover = function () { this.hexNode.className = \"hexCurrent\"; };\n this.head.onmouseout = function () { this.hexNode.className = \"hex\"; };\n node.asn1 = this;\n node.onmouseover = function () {\n var current = !root.selected;\n if (current) {\n root.selected = this.asn1;\n this.className = \"hexCurrent\";\n }\n this.asn1.fakeHover(current);\n };\n node.onmouseout = function () {\n var current = (root.selected == this.asn1);\n this.asn1.fakeOut(current);\n if (current) {\n root.selected = null;\n this.className = \"hex\";\n }\n };\n this.toHexDOM_sub(node, \"tag\", this.stream, this.posStart(), this.posStart() + 1);\n this.toHexDOM_sub(node, (this.length >= 0) ? \"dlen\" : \"ulen\", this.stream, this.posStart() + 1, this.posContent());\n if (this.sub === null)\n node.appendChild(DOM.text(\n this.stream.hexDump(this.posContent(), this.posEnd())));\n else if (this.sub.length > 0) {\n var first = this.sub[0];\n var last = this.sub[this.sub.length - 1];\n this.toHexDOM_sub(node, \"intro\", this.stream, this.posContent(), first.posStart());\n for (var i = 0, max = this.sub.length; i < max; ++i)\n node.appendChild(this.sub[i].toHexDOM(root));\n this.toHexDOM_sub(node, \"outro\", this.stream, last.posEnd(), this.posEnd());\n }\n return node;\n};\nASN1.prototype.toHexString = function (root) {\n return this.stream.hexDump(this.posStart(), this.posEnd(), true);\n};\nASN1.decodeLength = function (stream) {\n var buf = stream.get(),\n len = buf & 0x7F;\n if (len == buf)\n return len;\n if (len > 3)\n throw \"Length over 24 bits not supported at position \" + (stream.pos - 1);\n if (len === 0)\n return -1; // undefined\n buf = 0;\n for (var i = 0; i < len; ++i)\n buf = (buf << 8) | stream.get();\n return buf;\n};\nASN1.hasContent = function (tag, len, stream) {\n if (tag & 0x20) // constructed\n return true;\n if ((tag < 0x03) || (tag > 0x04))\n return false;\n var p = new Stream(stream);\n if (tag == 0x03) p.get(); // BitString unused bits, must be in [0, 7]\n var subTag = p.get();\n if ((subTag >> 6) & 0x01) // not (universal or context)\n return false;\n try {\n var subLength = ASN1.decodeLength(p);\n return ((p.pos - stream.pos) + subLength == len);\n } catch (exception) {\n return false;\n }\n};\nASN1.decode = function (stream) {\n if (!(stream instanceof Stream))\n stream = new Stream(stream, 0);\n var streamStart = new Stream(stream),\n tag = stream.get(),\n len = ASN1.decodeLength(stream),\n header = stream.pos - streamStart.pos,\n sub = null;\n if (ASN1.hasContent(tag, len, stream)) {\n // it has content, so we decode it\n var start = stream.pos;\n if (tag == 0x03) stream.get(); // skip BitString unused bits, must be in [0, 7]\n sub = [];\n if (len >= 0) {\n // definite length\n var end = start + len;\n while (stream.pos < end)\n sub[sub.length] = ASN1.decode(stream);\n if (stream.pos != end)\n throw \"Content size is not correct for container starting at offset \" + start;\n } else {\n // undefined length\n try {\n for (;;) {\n var s = ASN1.decode(stream);\n if (s.tag === 0)\n break;\n sub[sub.length] = s;\n }\n len = start - stream.pos;\n } catch (e) {\n throw \"Exception while decoding undefined length content: \" + e;\n }\n }\n } else\n stream.pos += len; // skip content\n return new ASN1(streamStart, header, len, tag, sub);\n};\nASN1.test = function () {\n var test = [\n { value: [0x27], expected: 0x27 },\n { value: [0x81, 0xC9], expected: 0xC9 },\n { value: [0x83, 0xFE, 0xDC, 0xBA], expected: 0xFEDCBA }\n ];\n for (var i = 0, max = test.length; i < max; ++i) {\n var pos = 0,\n stream = new Stream(test[i].value, 0),\n res = ASN1.decodeLength(stream);\n if (res != test[i].expected)\n document.write(\"In test[\" + i + \"] expected \" + test[i].expected + \" got \" + res + \"\\n\");\n }\n};\n\n// export globals\nwindow.ASN1 = ASN1;\n})();\n/**\n * Retrieve the hexadecimal value (as a string) of the current ASN.1 element\n * @returns {string}\n * @public\n */\nASN1.prototype.getHexStringValue = function () {\n var hexString = this.toHexString();\n var offset = this.header * 2;\n var length = this.length * 2;\n return hexString.substr(offset, length);\n};\n\n/**\n * Method to parse a pem encoded string containing both a public or private key.\n * The method will translate the pem encoded string in a der encoded string and\n * will parse private key and public key parameters. This method accepts public key\n * in the rsaencryption pkcs #1 format (oid: 1.2.840.113549.1.1.1).\n *\n * @todo Check how many rsa formats use the same format of pkcs #1.\n *\n * The format is defined as:\n * PublicKeyInfo ::= SEQUENCE {\n * algorithm AlgorithmIdentifier,\n * PublicKey BIT STRING\n * }\n * Where AlgorithmIdentifier is:\n * AlgorithmIdentifier ::= SEQUENCE {\n * algorithm OBJECT IDENTIFIER, the OID of the enc algorithm\n * parameters ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)\n * }\n * and PublicKey is a SEQUENCE encapsulated in a BIT STRING\n * RSAPublicKey ::= SEQUENCE {\n * modulus INTEGER, -- n\n * publicExponent INTEGER -- e\n * }\n * it's possible to examine the structure of the keys obtained from openssl using\n * an asn.1 dumper as the one used here to parse the components: http://lapo.it/asn1js/\n * @argument {string} pem the pem encoded string, can include the BEGIN/END header/footer\n * @private\n */\nRSAKey.prototype.parseKey = function (pem) {\n try {\n var modulus = 0;\n var public_exponent = 0;\n var reHex = /^\\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\\s*)+$/;\n var der = reHex.test(pem) ? Hex.decode(pem) : Base64.unarmor(pem);\n var asn1 = ASN1.decode(der);\n\n //Fixes a bug with OpenSSL 1.0+ private keys\n if(asn1.sub.length === 3){\n asn1 = asn1.sub[2].sub[0];\n }\n if (asn1.sub.length === 9) {\n\n // Parse the private key.\n modulus = asn1.sub[1].getHexStringValue(); //bigint\n this.n = parseBigInt(modulus, 16);\n\n public_exponent = asn1.sub[2].getHexStringValue(); //int\n this.e = parseInt(public_exponent, 16);\n\n var private_exponent = asn1.sub[3].getHexStringValue(); //bigint\n this.d = parseBigInt(private_exponent, 16);\n\n var prime1 = asn1.sub[4].getHexStringValue(); //bigint\n this.p = parseBigInt(prime1, 16);\n\n var prime2 = asn1.sub[5].getHexStringValue(); //bigint\n this.q = parseBigInt(prime2, 16);\n\n var exponent1 = asn1.sub[6].getHexStringValue(); //bigint\n this.dmp1 = parseBigInt(exponent1, 16);\n\n var exponent2 = asn1.sub[7].getHexStringValue(); //bigint\n this.dmq1 = parseBigInt(exponent2, 16);\n\n var coefficient = asn1.sub[8].getHexStringValue(); //bigint\n this.coeff = parseBigInt(coefficient, 16);\n\n }\n else if (asn1.sub.length === 2) {\n\n // Parse the public key.\n var bit_string = asn1.sub[1];\n var sequence = bit_string.sub[0];\n\n modulus = sequence.sub[0].getHexStringValue();\n this.n = parseBigInt(modulus, 16);\n public_exponent = sequence.sub[1].getHexStringValue();\n this.e = parseInt(public_exponent, 16);\n\n }\n else {\n return false;\n }\n return true;\n }\n catch (ex) {\n return false;\n }\n};\n\n/**\n * Translate rsa parameters in a hex encoded string representing the rsa key.\n *\n * The translation follow the ASN.1 notation :\n * RSAPrivateKey ::= SEQUENCE {\n * version Version,\n * modulus INTEGER, -- n\n * publicExponent INTEGER, -- e\n * privateExponent INTEGER, -- d\n * prime1 INTEGER, -- p\n * prime2 INTEGER, -- q\n * exponent1 INTEGER, -- d mod (p1)\n * exponent2 INTEGER, -- d mod (q-1)\n * coefficient INTEGER, -- (inverse of q) mod p\n * }\n * @returns {string} DER Encoded String representing the rsa private key\n * @private\n */\nRSAKey.prototype.getPrivateBaseKey = function () {\n var options = {\n 'array': [\n new KJUR.asn1.DERInteger({'int': 0}),\n new KJUR.asn1.DERInteger({'bigint': this.n}),\n new KJUR.asn1.DERInteger({'int': this.e}),\n new KJUR.asn1.DERInteger({'bigint': this.d}),\n new KJUR.asn1.DERInteger({'bigint': this.p}),\n new KJUR.asn1.DERInteger({'bigint': this.q}),\n new KJUR.asn1.DERInteger({'bigint': this.dmp1}),\n new KJUR.asn1.DERInteger({'bigint': this.dmq1}),\n new KJUR.asn1.DERInteger({'bigint': this.coeff})\n ]\n };\n var seq = new KJUR.asn1.DERSequence(options);\n return seq.getEncodedHex();\n};\n\n/**\n * base64 (pem) encoded version of the DER encoded representation\n * @returns {string} pem encoded representation without header and footer\n * @public\n */\nRSAKey.prototype.getPrivateBaseKeyB64 = function () {\n return hex2b64(this.getPrivateBaseKey());\n};\n\n/**\n * Translate rsa parameters in a hex encoded string representing the rsa public key.\n * The representation follow the ASN.1 notation :\n * PublicKeyInfo ::= SEQUENCE {\n * algorithm AlgorithmIdentifier,\n * PublicKey BIT STRING\n * }\n * Where AlgorithmIdentifier is:\n * AlgorithmIdentifier ::= SEQUENCE {\n * algorithm OBJECT IDENTIFIER, the OID of the enc algorithm\n * parameters ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)\n * }\n * and PublicKey is a SEQUENCE encapsulated in a BIT STRING\n * RSAPublicKey ::= SEQUENCE {\n * modulus INTEGER, -- n\n * publicExponent INTEGER -- e\n * }\n * @returns {string} DER Encoded String representing the rsa public key\n * @private\n */\nRSAKey.prototype.getPublicBaseKey = function () {\n var options = {\n 'array': [\n new KJUR.asn1.DERObjectIdentifier({'oid': '1.2.840.113549.1.1.1'}), //RSA Encryption pkcs #1 oid\n new KJUR.asn1.DERNull()\n ]\n };\n var first_sequence = new KJUR.asn1.DERSequence(options);\n\n options = {\n 'array': [\n new KJUR.asn1.DERInteger({'bigint': this.n}),\n new KJUR.asn1.DERInteger({'int': this.e})\n ]\n };\n var second_sequence = new KJUR.asn1.DERSequence(options);\n\n options = {\n 'hex': '00' + second_sequence.getEncodedHex()\n };\n var bit_string = new KJUR.asn1.DERBitString(options);\n\n options = {\n 'array': [\n first_sequence,\n bit_string\n ]\n };\n var seq = new KJUR.asn1.DERSequence(options);\n return seq.getEncodedHex();\n};\n\n/**\n * base64 (pem) encoded version of the DER encoded representation\n * @returns {string} pem encoded representation without header and footer\n * @public\n */\nRSAKey.prototype.getPublicBaseKeyB64 = function () {\n return hex2b64(this.getPublicBaseKey());\n};\n\n/**\n * wrap the string in block of width chars. The default value for rsa keys is 64\n * characters.\n * @param {string} str the pem encoded string without header and footer\n * @param {Number} [width=64] - the length the string has to be wrapped at\n * @returns {string}\n * @private\n */\nRSAKey.prototype.wordwrap = function (str, width) {\n width = width || 64;\n if (!str) {\n return str;\n }\n var regex = '(.{1,' + width + '})( +|$\\n?)|(.{1,' + width + '})';\n return str.match(RegExp(regex, 'g')).join('\\n');\n};\n\n/**\n * Retrieve the pem encoded private key\n * @returns {string} the pem encoded private key with header/footer\n * @public\n */\nRSAKey.prototype.getPrivateKey = function () {\n var key = \"-----BEGIN RSA PRIVATE KEY-----\\n\";\n key += this.wordwrap(this.getPrivateBaseKeyB64()) + \"\\n\";\n key += \"-----END RSA PRIVATE KEY-----\";\n return key;\n};\n\n/**\n * Retrieve the pem encoded public key\n * @returns {string} the pem encoded public key with header/footer\n * @public\n */\nRSAKey.prototype.getPublicKey = function () {\n var key = \"-----BEGIN PUBLIC KEY-----\\n\";\n key += this.wordwrap(this.getPublicBaseKeyB64()) + \"\\n\";\n key += \"-----END PUBLIC KEY-----\";\n return key;\n};\n\n/**\n * Check if the object contains the necessary parameters to populate the rsa modulus\n * and public exponent parameters.\n * @param {Object} [obj={}] - An object that may contain the two public key\n * parameters\n * @returns {boolean} true if the object contains both the modulus and the public exponent\n * properties (n and e)\n * @todo check for types of n and e. N should be a parseable bigInt object, E should\n * be a parseable integer number\n * @private\n */\nRSAKey.prototype.hasPublicKeyProperty = function (obj) {\n obj = obj || {};\n return (\n obj.hasOwnProperty('n') &&\n obj.hasOwnProperty('e')\n );\n};\n\n/**\n * Check if the object contains ALL the parameters of an RSA key.\n * @param {Object} [obj={}] - An object that may contain nine rsa key\n * parameters\n * @returns {boolean} true if the object contains all the parameters needed\n * @todo check for types of the parameters all the parameters but the public exponent\n * should be parseable bigint objects, the public exponent should be a parseable integer number\n * @private\n */\nRSAKey.prototype.hasPrivateKeyProperty = function (obj) {\n obj = obj || {};\n return (\n obj.hasOwnProperty('n') &&\n obj.hasOwnProperty('e') &&\n obj.hasOwnProperty('d') &&\n obj.hasOwnProperty('p') &&\n obj.hasOwnProperty('q') &&\n obj.hasOwnProperty('dmp1') &&\n obj.hasOwnProperty('dmq1') &&\n obj.hasOwnProperty('coeff')\n );\n};\n\n/**\n * Parse the properties of obj in the current rsa object. Obj should AT LEAST\n * include the modulus and public exponent (n, e) parameters.\n * @param {Object} obj - the object containing rsa parameters\n * @private\n */\nRSAKey.prototype.parsePropertiesFrom = function (obj) {\n this.n = obj.n;\n this.e = obj.e;\n\n if (obj.hasOwnProperty('d')) {\n this.d = obj.d;\n this.p = obj.p;\n this.q = obj.q;\n this.dmp1 = obj.dmp1;\n this.dmq1 = obj.dmq1;\n this.coeff = obj.coeff;\n }\n};\n\n/**\n * Create a new JSEncryptRSAKey that extends Tom Wu's RSA key object.\n * This object is just a decorator for parsing the key parameter\n * @param {string|Object} key - The key in string format, or an object containing\n * the parameters needed to build a RSAKey object.\n * @constructor\n */\nvar JSEncryptRSAKey = function (key) {\n // Call the super constructor.\n RSAKey.call(this);\n // If a key key was provided.\n if (key) {\n // If this is a string...\n if (typeof key === 'string') {\n this.parseKey(key);\n }\n else if (\n this.hasPrivateKeyProperty(key) ||\n this.hasPublicKeyProperty(key)\n ) {\n // Set the values for the key.\n this.parsePropertiesFrom(key);\n }\n }\n};\n\n// Derive from RSAKey.\nJSEncryptRSAKey.prototype = new RSAKey();\n\n// Reset the contructor.\nJSEncryptRSAKey.prototype.constructor = JSEncryptRSAKey;\n\n\n/**\n *\n * @param {Object} [options = {}] - An object to customize JSEncrypt behaviour\n * possible parameters are:\n * - default_key_size {number} default: 1024 the key size in bit\n * - default_public_exponent {string} default: '010001' the hexadecimal representation of the public exponent\n * - log {boolean} default: false whether log warn/error or not\n * @constructor\n */\nvar JSEncrypt = function (options) {\n options = options || {};\n this.default_key_size = parseInt(options.default_key_size) || 1024;\n this.default_public_exponent = options.default_public_exponent || '010001'; //65537 default openssl public exponent for rsa key type\n this.log = options.log || false;\n // The private and public key.\n this.key = null;\n};\n\n/**\n * Method to set the rsa key parameter (one method is enough to set both the public\n * and the private key, since the private key contains the public key paramenters)\n * Log a warning if logs are enabled\n * @param {Object|string} key the pem encoded string or an object (with or without header/footer)\n * @public\n */\nJSEncrypt.prototype.setKey = function (key) {\n if (this.log && this.key) {\n console.warn('A key was already set, overriding existing.');\n }\n this.key = new JSEncryptRSAKey(key);\n};\n\n/**\n * Proxy method for setKey, for api compatibility\n * @see setKey\n * @public\n */\nJSEncrypt.prototype.setPrivateKey = function (privkey) {\n // Create the key.\n this.setKey(privkey);\n};\n\n/**\n * Proxy method for setKey, for api compatibility\n * @see setKey\n * @public\n */\nJSEncrypt.prototype.setPublicKey = function (pubkey) {\n // Sets the public key.\n this.setKey(pubkey);\n};\n\n/**\n * Proxy method for RSAKey object's decrypt, decrypt the string using the private\n * components of the rsa key object. Note that if the object was not set will be created\n * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor\n * @param {string} string base64 encoded crypted string to decrypt\n * @return {string} the decrypted string\n * @public\n */\nJSEncrypt.prototype.decrypt = function (string) {\n // Return the decrypted string.\n try {\n return this.getKey().decrypt(b64tohex(string));\n }\n catch (ex) {\n return false;\n }\n};\n\n/**\n * Proxy method for RSAKey object's encrypt, encrypt the string using the public\n * components of the rsa key object. Note that if the object was not set will be created\n * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor\n * @param {string} string the string to encrypt\n * @return {string} the encrypted string encoded in base64\n * @public\n */\nJSEncrypt.prototype.encrypt = function (string) {\n // Return the encrypted string.\n try {\n return hex2b64(this.getKey().encrypt(string));\n }\n catch (ex) {\n return false;\n }\n};\n\n/**\n * Getter for the current JSEncryptRSAKey object. If it doesn't exists a new object\n * will be created and returned\n * @param {callback} [cb] the callback to be called if we want the key to be generated\n * in an async fashion\n * @returns {JSEncryptRSAKey} the JSEncryptRSAKey object\n * @public\n */\nJSEncrypt.prototype.getKey = function (cb) {\n // Only create new if it does not exist.\n if (!this.key) {\n // Get a new private key.\n this.key = new JSEncryptRSAKey();\n if (cb && {}.toString.call(cb) === '[object Function]') {\n this.key.generateAsync(this.default_key_size, this.default_public_exponent, cb);\n return;\n }\n // Generate the key.\n this.key.generate(this.default_key_size, this.default_public_exponent);\n }\n return this.key;\n};\n\n/**\n * Returns the pem encoded representation of the private key\n * If the key doesn't exists a new key will be created\n * @returns {string} pem encoded representation of the private key WITH header and footer\n * @public\n */\nJSEncrypt.prototype.getPrivateKey = function () {\n // Return the private representation of this key.\n return this.getKey().getPrivateKey();\n};\n\n/**\n * Returns the pem encoded representation of the private key\n * If the key doesn't exists a new key will be created\n * @returns {string} pem encoded representation of the private key WITHOUT header and footer\n * @public\n */\nJSEncrypt.prototype.getPrivateKeyB64 = function () {\n // Return the private representation of this key.\n return this.getKey().getPrivateBaseKeyB64();\n};\n\n\n/**\n * Returns the pem encoded representation of the public key\n * If the key doesn't exists a new key will be created\n * @returns {string} pem encoded representation of the public key WITH header and footer\n * @public\n */\nJSEncrypt.prototype.getPublicKey = function () {\n // Return the private representation of this key.\n return this.getKey().getPublicKey();\n};\n\n/**\n * Returns the pem encoded representation of the public key\n * If the key doesn't exists a new key will be created\n * @returns {string} pem encoded representation of the public key WITHOUT header and footer\n * @public\n */\nJSEncrypt.prototype.getPublicKeyB64 = function () {\n // Return the private representation of this key.\n return this.getKey().getPublicBaseKeyB64();\n};\n\n\n JSEncrypt.version = '2.3.1';\n exports.JSEncrypt = JSEncrypt;\n});\n\n//# sourceURL=webpack://Authing/./node_modules/_jsencrypt@2.3.1@jsencrypt/bin/jsencrypt.js?"); /***/ }), -/***/ "./node_modules/process/browser.js": -/*!*****************************************!*\ - !*** ./node_modules/process/browser.js ***! - \*****************************************/ +/***/ "./node_modules/_process@0.11.10@process/browser.js": +/*!**********************************************************!*\ + !*** ./node_modules/_process@0.11.10@process/browser.js ***! + \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { -eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack://Authing/./node_modules/process/browser.js?"); +eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack://Authing/./node_modules/_process@0.11.10@process/browser.js?"); /***/ }), -/***/ "./node_modules/webpack/buildin/amd-options.js": +/***/ "./node_modules/_webpack@4.30.0@webpack/buildin/amd-options.js": /*!****************************************!*\ !*** (webpack)/buildin/amd-options.js ***! \****************************************/ @@ -496,7 +496,7 @@ eval("/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals /***/ }), -/***/ "./node_modules/webpack/buildin/global.js": +/***/ "./node_modules/_webpack@4.30.0@webpack/buildin/global.js": /*!***********************************!*\ !*** (webpack)/buildin/global.js ***! \***********************************/ @@ -515,7 +515,7 @@ eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn th /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\n/* jshint esversion: 6 */\n\nvar configs = __webpack_require__(/*! ./configs */ \"./src/configs.js\");\nvar cryptoPolyfill = __webpack_require__(/*! ./crypto-polyfill */ \"./src/crypto-polyfill/browser.js\");\n\nvar encryption = void 0;\n\nif (configs.inBrowser) {\n encryption = function encryption(paw) {\n var encrypt = new cryptoPolyfill.JSEncrypt(); // 实例化加密对象\n encrypt.setPublicKey(configs.openSSLSecret); // 设置公钥\n var encryptoPasswd = encrypt.encrypt(paw); // 加密明文\n return encryptoPasswd;\n };\n} else {\n encryption = function encryption(paw) {\n var publicKey = configs.openSSLSecret;\n var pawBuffer = Buffer.from(paw); // jsencrypt 库在加密后使用了base64编码,所以这里要先将base64编码后的密文转成buffer\n var encryptText = cryptoPolyfill.publicEncrypt({\n key: Buffer.from(publicKey), // 如果通过文件方式读入就不必转成Buffer\n padding: cryptoPolyfill.constants.RSA_PKCS1_PADDING\n }, pawBuffer).toString('base64');\n return encryptText;\n };\n}\n\nmodule.exports = encryption;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node_modules/buffer/index.js */ \"./node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://Authing/./src/_encryption.js?"); +eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\n/* jshint esversion: 6 */\n\nvar configs = __webpack_require__(/*! ./configs */ \"./src/configs.js\");\nvar cryptoPolyfill = __webpack_require__(/*! ./crypto-polyfill */ \"./src/crypto-polyfill/browser.js\");\n\nvar encryption = void 0;\n\nif (configs.inBrowser) {\n encryption = function encryption(paw) {\n var encrypt = new cryptoPolyfill.JSEncrypt(); // 实例化加密对象\n encrypt.setPublicKey(configs.openSSLSecret); // 设置公钥\n var encryptoPasswd = encrypt.encrypt(paw); // 加密明文\n return encryptoPasswd;\n };\n} else {\n encryption = function encryption(paw) {\n var publicKey = configs.openSSLSecret;\n var pawBuffer = Buffer.from(paw); // jsencrypt 库在加密后使用了base64编码,所以这里要先将base64编码后的密文转成buffer\n var encryptText = cryptoPolyfill.publicEncrypt({\n key: Buffer.from(publicKey), // 如果通过文件方式读入就不必转成Buffer\n padding: cryptoPolyfill.constants.RSA_PKCS1_PADDING\n }, pawBuffer).toString('base64');\n return encryptText;\n };\n}\n\nmodule.exports = encryption;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node_modules/_buffer@4.9.1@buffer/index.js */ \"./node_modules/_buffer@4.9.1@buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://Authing/./src/_encryption.js?"); /***/ }), @@ -539,7 +539,7 @@ eval("\n\nmodule.exports = {\n services: {\n user: {\n host: 'https://u /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nmodule.exports = __webpack_require__(/*! jsencrypt */ \"./node_modules/jsencrypt/bin/jsencrypt.js\");\n\n//# sourceURL=webpack://Authing/./src/crypto-polyfill/browser.js?"); +eval("\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nmodule.exports = __webpack_require__(/*! jsencrypt */ \"./node_modules/_jsencrypt@2.3.1@jsencrypt/bin/jsencrypt.js\");\n\n//# sourceURL=webpack://Authing/./src/crypto-polyfill/browser.js?"); /***/ }), @@ -551,7 +551,7 @@ eval("\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nmodule. /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* jshint esversion: 6 */\nvar axios = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n\nvar GraphQLClient = function () {\n function GraphQLClient(options) {\n _classCallCheck(this, GraphQLClient);\n\n var defaultOpt = {\n timeout: options.timeout || 8000,\n method: 'POST'\n };\n this.options = _extends({}, defaultOpt, options);\n }\n\n _createClass(GraphQLClient, [{\n key: 'request',\n value: function request(data) {\n this.options.data = data;\n return axios(this.options).then(function (res) {\n var d = res.data;\n if (d.errors) {\n throw d.errors[0];\n }\n return d.data;\n });\n }\n }]);\n\n return GraphQLClient;\n}();\n\nmodule.exports = GraphQLClient;\n\n//# sourceURL=webpack://Authing/./src/graphql.js?"); +eval("\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* jshint esversion: 6 */\nvar axios = __webpack_require__(/*! axios */ \"./node_modules/_axios@0.18.0@axios/index.js\");\n\nvar GraphQLClient = function () {\n function GraphQLClient(options) {\n _classCallCheck(this, GraphQLClient);\n\n var defaultOpt = {\n timeout: options.timeout || 8000,\n method: 'POST'\n };\n this.options = _extends({}, defaultOpt, options);\n }\n\n _createClass(GraphQLClient, [{\n key: 'request',\n value: function request(data) {\n this.options.data = data;\n return axios(this.options).then(function (res) {\n var d = res.data;\n if (d.errors) {\n throw d.errors[0];\n }\n return d.data;\n });\n }\n }]);\n\n return GraphQLClient;\n}();\n\nmodule.exports = GraphQLClient;\n\n//# sourceURL=webpack://Authing/./src/graphql.js?"); /***/ }), @@ -563,7 +563,7 @@ eval("\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar _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; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\n/* jshint esversion: 6 */\n\nvar axios = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\nvar sha1 = __webpack_require__(/*! js-sha1 */ \"./node_modules/js-sha1/src/sha1.js\");\nvar configs = __webpack_require__(/*! ./configs */ \"./src/configs.js\");\nvar GraphQLClient = __webpack_require__(/*! ./graphql */ \"./src/graphql.js\");\nvar encryption = __webpack_require__(/*! ./_encryption */ \"./src/_encryption.js\");\n\nfunction Authing(opts) {\n var self = this;\n this.opts = opts;\n this.opts.useSelfWxapp = opts.useSelfWxapp || false;\n this.opts.timeout = opts.timeout || 8000;\n\n if (opts.host) {\n configs.services.user.host = opts.host.user || configs.services.user.host;\n configs.services.oauth.host = opts.host.oauth || configs.services.oauth.host;\n }\n\n this.ownerAuth = {\n authed: false,\n authSuccess: false,\n token: null\n };\n\n this.userAuth = {\n authed: false,\n authSuccess: false,\n token: null\n };\n\n this.initUserClient();\n this.initOwnerClient();\n this.initOAuthClient();\n\n if (!opts.accessToken) {\n if (!opts.clientId) {\n throw new Error('clientId is not provided');\n }\n\n if (configs.inBrowser) {\n if (opts.secret) {\n throw '检测到你处于浏览器环境,当前已不推荐在浏览器环境中暴露 secret,请到 https://docs.authing.cn/authing/sdk/authing-sdk-for-web#chu-shi-hua 查看最新的初始化方式';\n }\n\n if (!opts.timestamp) {\n throw 'timestamp is not provided';\n }\n\n if (!opts.nonce) {\n throw 'nonce is not provided';\n }\n\n this.opts.signature = sha1(opts.timestamp + opts.nonce.toString());\n } else if (!opts.secret) {\n throw new Error('app secret is not provided');\n }\n }\n\n return this._auth().then(function (token) {\n if (token) {\n self.initOwnerClient(token);\n self.loginFromLocalStorage();\n } else {\n self.ownerAuth.authed = true;\n self.ownerAuth.authSuccess = false;\n throw 'auth failed, please check your secret and client ID.';\n }\n return self;\n }).catch(function (error) {\n self.ownerAuth.authed = true;\n self.ownerAuth.authSuccess = false;\n throw 'auth failed: ' + error.message.message;\n });\n}\n\nAuthing.prototype = {\n\n constructor: Authing,\n\n _initClient: function _initClient(token) {\n var conf = {\n baseURL: configs.services.user.host,\n timeout: this.opts.timeout\n };\n if (token) {\n conf.headers = {\n Authorization: 'Bearer ' + token\n };\n }\n return new GraphQLClient(conf);\n },\n oAuthClientByUserToken: function oAuthClientByUserToken() {\n this.haveLogined();\n var token = this.userAuth.token;\n\n if (!this._oAuthClientByUserToken) {\n this._oAuthClientByUserToken = new GraphQLClient({\n baseURL: configs.services.oauth.host,\n headers: {\n Authorization: 'Bearer ' + token\n },\n timeout: this.opts.timeout\n });\n }\n return this._oAuthClientByUserToken;\n },\n initUserClient: function initUserClient(token) {\n if (token) {\n this.userAuth = {\n authed: true,\n authSuccess: true,\n token: token\n };\n if (configs.inBrowser) {\n localStorage.setItem('_authing_token', token);\n }\n }\n this.UserClient = this._initClient(token);\n },\n initOwnerClient: function initOwnerClient(token) {\n if (token) {\n this.ownerAuth = {\n authed: true,\n authSuccess: true,\n token: token\n };\n }\n this.ownerClient = this._initClient(token);\n },\n initOAuthClient: function initOAuthClient() {\n this.OAuthClient = new GraphQLClient({\n baseURL: configs.services.oauth.host,\n timeout: this.opts.timeout\n });\n },\n _auth: function _auth() {\n var _this = this;\n\n var authOpts = {\n baseURL: configs.services.user.host,\n timeout: this.opts.timeout\n };\n\n if (this.opts.accessToken) {\n authOpts.headers = {\n Authorization: 'Bearer ' + this.opts.accessToken\n };\n }\n\n if (!this.AuthService) {\n this.AuthService = new GraphQLClient(authOpts);\n }\n\n if (this.opts.accessToken && this.AuthService) {\n return new Promise(function (resolve) {\n resolve(_this.opts.accessToken);\n });\n }\n\n var options = {\n secret: this.opts.secret,\n clientId: this.opts.clientId\n };\n\n var self = this;\n\n var query = '';\n var queryField = '{\\n accessToken\\n clientInfo {\\n _id\\n name\\n descriptions\\n jwtExpired\\n createdAt\\n isDeleted\\n logo\\n emailVerifiedDefault\\n registerDisabled\\n allowedOrigins\\n clientType {\\n _id\\n name\\n description\\n image\\n example\\n }\\n }\\n }';\n\n if (configs.inBrowser) {\n options = {\n clientId: this.opts.clientId,\n timestamp: this.opts.timestamp,\n nonce: this.opts.nonce,\n signature: this.opts.signature\n };\n query = 'query {\\n getClientWhenSdkInit(timestamp: \"' + options.timestamp + '\", clientId: \"' + options.clientId + '\", nonce: ' + options.nonce + ', signature: \"' + options.signature + '\")' + queryField + '\\n }';\n } else {\n query = 'query {\\n getClientWhenSdkInit(secret: \"' + options.secret + '\", clientId: \"' + options.clientId + '\")' + queryField + '\\n }';\n }\n\n return this.AuthService.request({\n query: query\n }).then(function (data) {\n var accessToken = '';\n if (data.getClientWhenSdkInit) {\n // eslint-disable-next-line prefer-destructuring\n accessToken = data.getClientWhenSdkInit.accessToken;\n self.clientInfo = data.getClientWhenSdkInit.clientInfo;\n }\n self.AuthService = new GraphQLClient({\n baseURL: configs.services.user.host,\n headers: {\n Authorization: 'Bearer ' + accessToken\n }\n });\n return accessToken;\n });\n },\n loginFromLocalStorage: function loginFromLocalStorage() {\n var self = this;\n if (configs.inBrowser) {\n var authingToken = localStorage.getItem('_authing_token');\n if (authingToken) {\n self.initUserClient(authingToken);\n }\n }\n },\n checkLoginStatus: function checkLoginStatus(token) {\n return this.UserClient.request({\n operationName: 'checkLoginStatus',\n query: 'query checkLoginStatus($token: String) {\\n checkLoginStatus(token: $token) {\\n status\\n code\\n message\\n }\\n }',\n variables: {\n token: token\n }\n }).then(function (res) {\n return res.checkLoginStatus;\n });\n },\n _readOAuthList: function _readOAuthList(params) {\n var variables = {};\n if (params) {\n variables = params;\n }\n var self = this;\n\n this.haveAccess();\n\n if (!this._OAuthService) {\n this._OAuthService = new GraphQLClient({\n baseURL: configs.services.oauth.host,\n headers: {\n Authorization: 'Bearer ' + self.ownerAuth.token\n }\n });\n }\n return this._OAuthService.request({\n operationName: 'getOAuthList',\n query: 'query getOAuthList($clientId: String!, $useGuard: Boolean) {\\n ReadOauthList(clientId: $clientId, useGuard: $useGuard) {\\n _id\\n name\\n image\\n description\\n enabled\\n client\\n user\\n url\\n alias\\n }\\n }',\n variables: _extends({\n clientId: self.opts.clientId\n }, variables)\n }).then(function (res) {\n return res.ReadOauthList;\n });\n },\n haveAccess: function haveAccess() {\n if (!this.ownerAuth.authSuccess) {\n throw 'have no access, please check your secret and client ID.';\n }\n },\n haveLogined: function haveLogined() {\n if (!this.userAuth.authSuccess) {\n throw 'not logined yet, please login first.';\n }\n },\n _chooseClient: function _chooseClient() {\n if (this.userAuth.authSuccess) {\n return this.UserClient;\n }\n return this.ownerClient;\n },\n _login: function _login(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n /* eslint-disable no-param-reassign */\n\n options.registerInClient = this.opts.clientId;\n\n if (options.password) {\n options.password = encryption(options.password);\n }\n\n this.haveAccess();\n\n if (configs.inBrowser) {\n options.browser = window.navigator.userAgent;\n }\n\n return this.UserClient.request({\n operationName: 'login',\n query: 'mutation login($unionid: String, $email: String, $username: String, $password: String, $lastIP: String, $registerInClient: String!, $verifyCode: String, $browser: String, $openid: String) {\\n login(unionid: $unionid, email: $email, username: $username, password: $password, lastIP: $lastIP, registerInClient: $registerInClient, verifyCode: $verifyCode, browser: $browser, openid: $openid) {\\n _id\\n email\\n emailVerified\\n unionid\\n openid\\n oauth\\n registerMethod\\n username\\n nickname\\n company\\n photo\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.login;\n });\n },\n _loginByLDAP: function _loginByLDAP(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n options.clientId = this.opts.clientId;\n\n if (!options.password) {\n throw 'password is not provided.';\n }\n\n if (!options.username) {\n throw 'username is not provided.';\n }\n\n this.haveAccess();\n\n if (configs.inBrowser) {\n options.browser = window.navigator.userAgent;\n }\n\n return this.OAuthClient.request({\n operationName: 'LoginByLDAP',\n query: 'mutation LoginByLDAP($username: String!, $password: String!, $clientId: String!, $browser: String) {\\n LoginByLDAP(username: $username, clientId: $clientId, password: $password, browser: $browser) {\\n _id\\n email\\n emailVerified\\n unionid\\n openid\\n oauth\\n registerMethod\\n username\\n nickname\\n company\\n photo\\n browser\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.LoginByLDAP;\n });\n },\n loginByLDAP: function loginByLDAP(options) {\n var self = this;\n return this._loginByLDAP(options).then(function (user) {\n if (user) {\n self.initUserClient(user.token);\n }\n return user;\n });\n },\n login: function login(options) {\n var self = this;\n return this._login(options).then(function (user) {\n if (user) {\n self.initUserClient(user.token);\n }\n return user;\n });\n },\n register: function register(options) {\n this.haveAccess();\n\n if (!options) {\n throw 'options is not provided';\n }\n\n options.registerInClient = this.opts.clientId;\n\n if (options.password) {\n options.password = encryption(options.password);\n }\n\n if (configs.inBrowser) {\n options.browser = window.navigator.userAgent;\n }\n\n return this.UserClient.request({\n operationName: 'register',\n query: '\\n mutation register(\\n $unionid: String,\\n $openid: String,\\n $email: String,\\n $password: String,\\n $lastIP: String,\\n $gender: String,\\n $birthdate: String,\\n $region: String,\\n $locality: String,\\n $name: String,\\n $givenName: String,\\n $familyName: String,\\n $middleName: String,\\n $profile: String,\\n $preferredUsername: String,\\n $website: String,\\n $zoneinfo: String,\\n $locale: String,\\n $address: String,\\n $formatted: String,\\n $streetAddress: String,\\n $postalCode: String,\\n $country: String,\\n $updatedAt: String,\\n $forceLogin: Boolean,\\n $registerInClient: String!,\\n $oauth: String,\\n $username: String,\\n $nickname: String,\\n $registerMethod: String,\\n $photo: String,\\n $company: String,\\n $browser: String,\\n ) {\\n register(userInfo: {\\n unionid: $unionid,\\n openid: $openid,\\n email: $email,\\n password: $password,\\n lastIP: $lastIP,\\n forceLogin: $forceLogin,\\n registerInClient: $registerInClient,\\n oauth: $oauth,\\n registerMethod: $registerMethod,\\n name: $name,\\n givenName: $givenName,\\n familyName: $familyName,\\n middleName: $middleName,\\n profile: $profile,\\n preferredUsername: $preferredUsername,\\n website: $website,\\n zoneinfo: $zoneinfo,\\n locale: $locale,\\n address: $address,\\n formatted: $formatted,\\n streetAddress: $streetAddress,\\n postalCode: $postalCode,\\n country: $country,\\n updatedAt: $updatedAt,\\n gender: $gender,\\n birthdate: $birthdate,\\n region: $region,\\n locality: $locality,\\n photo: $photo,\\n username: $username,\\n nickname: $nickname,\\n company: $company,\\n browser: $browser,\\n }) {\\n _id,\\n email,\\n emailVerified,\\n unionid,\\n openid,\\n oauth,\\n registerMethod,\\n username,\\n nickname,\\n company,\\n photo,\\n browser,\\n password,\\n token,\\n group {\\n name\\n },\\n blocked,\\n device\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.register;\n });\n },\n logout: function logout(_id) {\n this.haveAccess();\n\n if (!_id) {\n throw '_id is not provided';\n }\n\n this.userAuth = {\n authed: false,\n authSuccess: false,\n token: null\n };\n if (configs.inBrowser) {\n localStorage.removeItem('_authing_token');\n }\n\n return this.update({\n _id: _id,\n tokenExpiredAt: 0\n });\n },\n user: function user(options) {\n this.haveAccess();\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.id) {\n throw 'id in options is not provided';\n }\n options.registerInClient = this.opts.clientId;\n\n var client = this._chooseClient();\n\n return client.request({\n operationName: 'user',\n query: 'query user($id: String!, $registerInClient: String!){\\n user(id: $id, registerInClient: $registerInClient) {\\n _id\\n unionid\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n userLocation {\\n _id\\n when\\n where\\n }\\n userLoginHistory {\\n totalCount\\n list {\\n _id\\n when\\n success\\n ip\\n result\\n }\\n }\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.user;\n });\n },\n userPatch: function userPatch(options) {\n this.haveAccess();\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.ids) {\n throw 'ids in options is not provided';\n }\n options.registerInClient = this.opts.clientId;\n\n var client = this._chooseClient();\n\n return client.request({\n operationName: 'userPatch',\n query: 'query userPatch($ids: String!){\\n userPatch(ids: $ids) {\\n list {\\n _id\\n unionid\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n userLocation {\\n _id\\n when\\n where\\n }\\n userLoginHistory {\\n totalCount\\n list {\\n _id\\n when\\n success\\n ip\\n result\\n }\\n }\\n }\\n totalCount\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.userPatch;\n });\n },\n list: function list(page, count) {\n this.haveAccess();\n\n page = page || 1;\n count = count || 10;\n\n var options = {\n registerInClient: this.opts.clientId,\n page: page,\n count: count\n };\n\n return this.ownerClient.request({\n operationName: 'users',\n query: 'query users($registerInClient: String, $page: Int, $count: Int){\\n users(registerInClient: $registerInClient, page: $page, count: $count) {\\n totalCount\\n list {\\n _id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n password\\n registerInClient\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n group {\\n _id\\n name\\n descriptions\\n createdAt\\n }\\n clientType {\\n _id\\n name\\n description\\n image\\n example\\n }\\n userLocation {\\n _id\\n when\\n where\\n }\\n userLoginHistory {\\n totalCount\\n list{\\n _id\\n when\\n success\\n ip\\n result\\n }\\n }\\n systemApplicationType {\\n _id\\n name\\n descriptions\\n price\\n }\\n }\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.users;\n });\n },\n remove: function remove(_id, operator) {\n var self = this;\n\n this.haveAccess();\n\n if (!_id) {\n throw '_id is not provided';\n }\n\n return this.ownerClient.request({\n query: 'mutation removeUsers($ids: [String], $registerInClient: String, $operator: String){\\n removeUsers(ids: $ids, registerInClient: $registerInClient, operator: $operator) {\\n _id\\n }\\n }',\n variables: {\n ids: [_id],\n registerInClient: self.opts.clientId,\n operator: operator\n }\n }).then(function (res) {\n return res.removeUsers;\n });\n },\n _uploadAvatar: function _uploadAvatar(options) {\n var client = this._chooseClient();\n return client.request({\n operationName: 'qiNiuUploadToken',\n query: 'query qiNiuUploadToken {\\n qiNiuUploadToken\\n }'\n }).then(function (data) {\n return data.qiNiuUploadToken;\n }).then(function (token) {\n if (!token) {\n throw {\n graphQLErrors: [{\n message: {\n message: '获取文件上传token失败'\n }\n }]\n };\n }\n\n var formData = new FormData();\n formData.append('file', options.photo);\n formData.append('token', token);\n return axios.post('https://upload.qiniup.com/', formData, {\n method: 'post',\n headers: { 'Content-Type': 'multipart/form-data' }\n });\n }).then(function (data) {\n return data.data;\n }).then(function (data) {\n if (data.key) {\n options.photo = 'https://usercontents.authing.cn/' + data.key;\n }\n return options;\n }).catch(function (e) {\n if (e.graphQLErrors) {\n throw e.graphQLErrors[0];\n }\n throw {\n message: {\n message: e\n }\n };\n });\n },\n update: function update(options) {\n var self = this;\n\n this.haveAccess();\n\n if (!options) {\n throw 'options is not provided';\n }\n\n // eslint-disable-next-line no-underscore-dangle\n if (!options._id) {\n throw '_id in options is not provided';\n }\n\n if (options.password) {\n if (!options.oldPassword) {\n throw 'oldPassword in options is not provided';\n }\n options.password = encryption(options.password);\n options.oldPassword = encryption(options.oldPassword);\n }\n\n options.registerInClient = self.opts.clientId;\n\n var keyTypeList = {\n _id: 'String!',\n email: 'String',\n emailVerified: 'Boolean',\n username: 'String',\n nickname: 'String',\n company: 'String',\n photo: 'String',\n oauth: 'String',\n browser: 'String',\n password: 'String',\n oldPassword: 'String',\n registerInClient: 'String!',\n phone: 'String',\n token: 'String',\n tokenExpiredAt: 'String',\n loginsCount: 'Int',\n lastLogin: 'String',\n lastIP: 'String',\n signedUp: 'String',\n blocked: 'Boolean',\n isDeleted: 'Boolean'\n };\n var returnFields = '_id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n phone\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted';\n\n function generateArgs(opts) {\n var args = [];\n var argsFiller = [];\n var argsString = '';\n // eslint-disable-next-line no-restricted-syntax\n for (var key in opts) {\n if (keyTypeList[key]) {\n args.push('$' + key + ': ' + keyTypeList[key]);\n argsFiller.push(key + ': $' + key);\n }\n }\n argsString = args.join(', ');\n return {\n args: args,\n argsString: argsString,\n argsFiller: argsFiller\n };\n }\n\n var client = this._chooseClient();\n\n if (options.photo) {\n var photo = options.photo;\n\n if (typeof photo !== 'string') {\n return this._uploadAvatar(options).then(function (opts) {\n var arg = generateArgs(opts);\n return client.request({\n operationName: 'UpdateUser',\n query: '\\n mutation UpdateUser(' + arg.argsString + '){\\n updateUser(options: {\\n ' + arg.argsFiller.join(', ') + '\\n }) {\\n ' + returnFields + '\\n }\\n }\\n ',\n variables: opts\n });\n }).then(function (res) {\n return res.updateUser;\n });\n }\n }\n var args = generateArgs(options);\n return client.request({\n operationName: 'UpdateUser',\n query: '\\n mutation UpdateUser(' + args.argsString + '){\\n updateUser(options: {\\n ' + args.argsFiller.join(', ') + '\\n }) {\\n ' + returnFields + '\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.updateUser;\n });\n },\n\n /**\n * \n * @param {Object} params 获取社会化登录时可以加选项\n * @param {Boolean} params.useGuard 是否使用 Guard\n */\n readOAuthList: function readOAuthList(params) {\n if (!params || (typeof params === 'undefined' ? 'undefined' : _typeof(params)) !== 'object') {\n return this._readOAuthList().then(function (list) {\n if (list) {\n return list.filter(function (item) {\n return item.enabled;\n });\n }\n throw {\n message: '获取OAuth列表失败,原因未知'\n };\n });\n } else {\n return this._readOAuthList(params).then(function (list) {\n if (list) {\n return list.filter(function (item) {\n return item.enabled;\n });\n }\n throw {\n message: '获取OAuth列表失败,原因未知'\n };\n });\n }\n },\n sendResetPasswordEmail: function sendResetPasswordEmail(options) {\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.email) {\n throw 'email in options is not provided';\n }\n\n options.client = this.opts.clientId;\n return this.UserClient.request({\n operationName: 'sendResetPasswordEmail',\n query: '\\n mutation sendResetPasswordEmail(\\n $email: String!,\\n $client: String!\\n ){\\n sendResetPasswordEmail(\\n email: $email,\\n client: $client\\n ) {\\n message\\n code\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.sendResetPasswordEmail;\n });\n },\n verifyResetPasswordVerifyCode: function verifyResetPasswordVerifyCode(options) {\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.email) {\n throw 'email in options is not provided';\n }\n if (!options.verifyCode) {\n throw 'verifyCode in options is not provided';\n }\n options.client = this.opts.clientId;\n return this.UserClient.request({\n operationName: 'verifyResetPasswordVerifyCode',\n query: '\\n mutation verifyResetPasswordVerifyCode(\\n $email: String!,\\n $client: String!,\\n $verifyCode: String!\\n ) {\\n verifyResetPasswordVerifyCode(\\n email: $email,\\n client: $client,\\n verifyCode: $verifyCode\\n ) {\\n message\\n code\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.verifyResetPasswordVerifyCode;\n });\n },\n changePassword: function changePassword(options) {\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.email) {\n throw 'email in options is not provided';\n }\n if (!options.password) {\n throw 'password in options is not provided';\n }\n if (!options.verifyCode) {\n throw 'verifyCode in options is not provided';\n }\n options.client = this.opts.clientId;\n options.password = encryption(options.password);\n return this.UserClient.request({\n operationName: 'changePassword',\n query: '\\n mutation changePassword(\\n $email: String!,\\n $client: String!,\\n $password: String!,\\n $verifyCode: String!\\n ){\\n changePassword(\\n email: $email,\\n client: $client,\\n password: $password,\\n verifyCode: $verifyCode\\n ) {\\n _id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.changePassword;\n });\n },\n sendVerifyEmail: function sendVerifyEmail(options) {\n if (!options.email) {\n throw 'email in options is not provided';\n }\n\n options.client = this.opts.clientId;\n\n return this.AuthService.request({\n operationName: 'sendVerifyEmail',\n query: '\\n mutation sendVerifyEmail(\\n $email: String!,\\n $client: String!\\n ){\\n sendVerifyEmail(\\n email: $email,\\n client: $client\\n ) {\\n message,\\n code,\\n status\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.sendVerifyEmail;\n });\n },\n selectAvatarFile: function selectAvatarFile(cb) {\n if (!configs.inBrowser) {\n throw '当前不是浏览器环境,无法选取文件';\n }\n var inputElem = document.createElement('input');\n inputElem.type = 'file';\n inputElem.accept = 'image/*';\n inputElem.onchange = function () {\n cb(inputElem.files[0]);\n };\n inputElem.click();\n },\n decodeToken: function decodeToken(token) {\n return this.UserClient.request({\n operationName: 'decodeJwtToken',\n query: 'query decodeJwtToken($token: String) {\\n decodeJwtToken(token: $token) {\\n data {\\n email\\n id\\n clientId\\n }\\n status {\\n code\\n message\\n }\\n iat\\n exp\\n }\\n }',\n variables: {\n token: token\n }\n }).then(function (res) {\n return res.decodeJwtToken;\n });\n },\n readUserOAuthList: function readUserOAuthList(variables) {\n var client = this.oAuthClientByUserToken();\n return client.request({\n operationName: 'notBindOAuthList',\n query: 'query notBindOAuthList($user: String, $client: String) {\\n notBindOAuthList(user: $user, client: $client) {\\n type\\n oAuthUrl\\n image\\n name\\n binded\\n }\\n }',\n variables: variables\n }).then(function (res) {\n return res.notBindOAuthList;\n });\n },\n bindOAuth: function bindOAuth(variables) {\n if (!variables) {\n throw 'options is not provided';\n }\n if (!variables.type) {\n throw 'type in options is not provided';\n }\n if (!variables.unionid) {\n throw 'unionid in options is not provided';\n }\n if (!variables.userInfo) {\n throw 'userInfo in options is not provided';\n }\n\n return this.UserClient.request({\n operationName: 'bindOtherOAuth',\n query: 'mutation bindOtherOAuth(\\n $user: String,\\n $client: String,\\n $type: String!,\\n $unionid: String!,\\n $userInfo: String!\\n ) {\\n bindOtherOAuth (\\n user: $user,\\n client: $client,\\n type: $type,\\n unionid: $unionid,\\n userInfo: $userInfo\\n ) {\\n _id\\n user\\n client\\n type\\n userInfo\\n unionid\\n createdAt\\n }\\n }',\n variables: variables\n });\n },\n unbindOAuth: function unbindOAuth(variables) {\n if (!variables) {\n throw 'options is not provided';\n }\n if (!variables.type) {\n throw 'type in options is not provided';\n }\n\n return this.UserClient.request({\n operationName: 'unbindOtherOAuth',\n query: 'mutation unbindOtherOAuth(\\n $user: String,\\n $client: String,\\n $type: String!\\n ){\\n unbindOtherOAuth(\\n user: $user,\\n client: $client,\\n type: $type\\n ) {\\n _id\\n user\\n client\\n type\\n userInfo\\n unionid\\n createdAt\\n }\\n }',\n variables: variables\n });\n },\n unbindEmail: function unbindEmail(variables) {\n return this.UserClient.request({\n operationName: 'unbindEmail',\n query: 'mutation unbindEmail(\\n $user: String,\\n $client: String,\\n ){\\n unbindEmail(\\n user: $user,\\n client: $client,\\n ) {\\n _id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }',\n variables: variables\n });\n },\n randomWord: function randomWord(randomFlag, min, max) {\n var str = '';\n var range = min;\n var arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];\n\n if (randomFlag) {\n range = Math.round(Math.random() * (max - min)) + min; // 任意长度\n }\n\n for (var i = 0; i < range; i += 1) {\n var pos = Math.round(Math.random() * (arr.length - 1));\n str += arr[pos];\n }\n\n return str;\n },\n genQRCode: function genQRCode(clientId) {\n var random = this.randomWord(true, 12, 24);\n sessionStorage.randomWord = random;\n\n var url = configs.services.oauth.host;\n url = url.replace('/graphql', '');\n\n return axios.get(url + '/oauth/wxapp/qrcode/' + clientId + '?random=' + random + '&useSelfWxapp=' + this.opts.useSelfWxapp);\n },\n checkQR: function checkQR() {\n var random = sessionStorage.randomWord || '';\n var url = configs.services.oauth.host;\n url = url.replace('/graphql', '');\n\n return axios.post(url + '/oauth/wxapp/confirm/qr?random=' + random + '&useSelfWxapp=' + this.opts.useSelfWxapp);\n },\n startWXAppScaning: function startWXAppScaning(opts) {\n var self = this;\n\n if (!opts) {\n opts = {};\n }\n\n var mountNode = opts.mount || 'authing__qrcode-root-node';\n var interval = opts.interval || 1500;\n var _opts = opts,\n tips = _opts.tips;\n\n\n var redirect = true;\n\n // eslint-disable-next-line no-prototype-builtins\n if (opts.hasOwnProperty('redirect')) {\n if (!opts.redirect) {\n redirect = false;\n }\n }\n\n var _opts2 = opts,\n onError = _opts2.onError,\n onSuccess = _opts2.onSuccess,\n onIntervalStarting = _opts2.onIntervalStarting,\n onQRCodeShow = _opts2.onQRCodeShow,\n onQRCodeLoad = _opts2.onQRCodeLoad;\n\n\n var qrcodeNode = document.getElementById(mountNode);\n var qrcodeWrapper = void 0;\n\n var needGenerate = false;\n var start = function start() {};\n\n if (!qrcodeNode) {\n qrcodeNode = document.createElement('div');\n qrcodeNode.id = mountNode;\n qrcodeNode.style = 'z-index: 65535;position: fixed;background: #fff;width: 300px;height: 300px;left: 50%;margin-left: -150px;display: flex;justify-content: center;align-items: center;top: 50%;margin-top: -150px;border: 1px solid #ccc;';\n document.getElementsByTagName('body')[0].appendChild(qrcodeNode);\n needGenerate = true;\n } else {\n qrcodeNode.style = 'position:relative';\n }\n\n var styleNode = document.createElement('style');var style = '#authing__retry a:hover{outline:0px;text-decoration:none;}#authing__spinner{position:absolute;left:50%;margin-left:-6px;}.spinner{margin:100px auto;width:20px;height:20px;position:relative}.container1>div,.container2>div,.container3>div{width:6px;height:6px;background-color:#00a1ea;border-radius:100%;position:absolute;-webkit-animation:bouncedelay 1.2s infinite ease-in-out;animation:bouncedelay 1.2s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.spinner .spinner-container{position:absolute;width:100%;height:100%}.container2{-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}.container3{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}.circle1{top:0;left:0}.circle2{top:0;right:0}.circle3{right:0;bottom:0}.circle4{left:0;bottom:0}.container2 .circle1{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.container3 .circle1{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.container1 .circle2{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.container2 .circle2{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}.container3 .circle2{-webkit-animation-delay:-0.7s;animation-delay:-0.7s}.container1 .circle3{-webkit-animation-delay:-0.6s;animation-delay:-0.6s}.container2 .circle3{-webkit-animation-delay:-0.5s;animation-delay:-0.5s}.container3 .circle3{-webkit-animation-delay:-0.4s;animation-delay:-0.4s}.container1 .circle4{-webkit-animation-delay:-0.3s;animation-delay:-0.3s}.container2 .circle4{-webkit-animation-delay:-0.2s;animation-delay:-0.2s}.container3 .circle4{-webkit-animation-delay:-0.1s;animation-delay:-0.1s}@-webkit-keyframes bouncedelay{0%,80%,100%{-webkit-transform:scale(0.0)}40%{-webkit-transform:scale(1.0)}}@keyframes bouncedelay{0%,80%,100%{transform:scale(0.0);-webkit-transform:scale(0.0)}40%{transform:scale(1.0);-webkit-transform:scale(1.0)}}';\n\n styleNode.type = 'text/css';\n\n if (styleNode.styleSheet) {\n styleNode.styleSheet.cssText = style;\n } else {\n styleNode.innerHTML = style;\n }\n\n document.getElementsByTagName('head')[0].appendChild(styleNode);\n\n var loading = function loading() {\n qrcodeNode.innerHTML = '
';\n };\n\n var unloading = function unloading() {\n var child = document.getElementById('authing__spinner');\n qrcodeNode.removeChild(child);\n };\n\n var genTip = function genTip(text) {\n var tip = document.createElement('span');\n tip.class = 'authing__heading-subtitle';\n if (!needGenerate) {\n tip.style = 'display: block;font-weight: 400;font-size: 15px;color: #888;ine-height: 48px;';\n } else {\n tip.style = 'display: block;font-weight: 400;font-size: 12px;color: #888;';\n }\n tip.innerHTML = text;\n return tip;\n };\n\n var genImage = function genImage(src) {\n var qrcodeImage = document.createElement('img');\n qrcodeImage.class = 'authing__qrcode';\n qrcodeImage.src = src;\n qrcodeImage.width = 240;\n qrcodeImage.height = 240;\n return qrcodeImage;\n };\n\n var genShadow = function genShadow(text, aOnClick) {\n var shadow = document.createElement('div');\n shadow.id = 'authing__retry';\n shadow.style = 'text-align:center;width: 240px;height: 240px;position: absolute;left: 50%;top: 0px;margin-left: -120px;background-color: rgba(0,0,0, 0.5);line-height:240px;color:#fff;font-weight:600;';\n\n var shadowA = document.createElement('a');\n shadowA.innerHTML = text;\n shadowA.style = 'color:#fff;border-bottom: 1px solid #fff;cursor: pointer;';\n shadowA.onclick = aOnClick;\n shadow.appendChild(shadowA);\n return shadow;\n };\n\n function genRetry(qrcodeElm, tipText) {\n var tip = genTip(tipText);\n\n qrcodeWrapper = document.createElement('div');\n qrcodeWrapper.id = 'authing__qrcode-wrapper';\n qrcodeWrapper.style = 'text-align: center;position: relative;';\n\n var qrcodeImage = genImage('https://usercontents.authing.cn/authing_user_manager_wxapp_qrcode.jpg');\n\n if (!needGenerate) {\n qrcodeImage.style = 'margin-top: 12px;';\n } else {\n qrcodeImage.style = 'margin-top: 16px;';\n }\n\n qrcodeImage.onload = function () {\n unloading();\n };\n\n var shadow = genShadow('点击重试', function () {\n start();\n });\n\n qrcodeWrapper.appendChild(qrcodeImage);\n qrcodeWrapper.appendChild(shadow);\n qrcodeWrapper.appendChild(tip);\n qrcodeElm.appendChild(qrcodeWrapper);\n }\n\n start = function start() {\n loading();\n self.genQRCode(self.opts.clientId).then(function (qrRes) {\n qrRes = qrRes.data;\n\n if (qrRes.code !== 200) {\n genRetry(qrcodeNode, qrRes.message);\n if (onError) {\n onError(qrRes);\n }\n } else {\n var qrcode = qrRes.data;\n if (onQRCodeLoad) {\n onQRCodeLoad(qrcode);\n }\n sessionStorage.qrcodeUrl = qrcode.qrcode;\n sessionStorage.qrcode = JSON.stringify(qrcode);\n\n if (qrcodeNode) {\n qrcodeWrapper = document.createElement('div');\n qrcodeWrapper.id = 'authing__qrcode-wrapper';\n qrcodeWrapper.style = 'text-align: center;position: relative;';\n\n var qrcodeImage = genImage(qrcode.qrcode);\n\n qrcodeImage.onload = function () {\n unloading();\n if (onQRCodeShow) {\n onQRCodeShow(qrcode);\n }\n var inter = 0;\n inter = setInterval(function () {\n if (onIntervalStarting) {\n onIntervalStarting(inter);\n }\n self.checkQR().then(function (checkRes) {\n var checkResult = checkRes.data.data;\n if (checkResult.code === 200) {\n clearInterval(inter);\n if (redirect) {\n var shadowX = genShadow('扫码成功,即将跳转', function () {\n window.location.href = checkResult.redirect + '?code=200&data=' + JSON.stringify(checkResult.data);\n });\n setTimeout(function () {\n window.location.href = checkResult.redirect + '?code=200&data=' + JSON.stringify(checkResult.data);\n }, 600);\n qrcodeWrapper.appendChild(shadowX);\n } else {\n var shadow = genShadow('扫码成功');\n qrcodeWrapper.appendChild(shadow);\n if (onSuccess) {\n onSuccess(checkResult);\n }\n }\n }\n });\n }, interval);\n };\n\n var tip = genTip(tips || '使用 微信 或小程序 身份管家 扫码登录');\n\n qrcodeWrapper.appendChild(qrcodeImage);\n qrcodeWrapper.appendChild(tip);\n qrcodeNode.appendChild(qrcodeWrapper);\n }\n }\n }).catch(function (error) {\n genRetry(qrcodeNode, '网络出错,请重试');\n if (onError) {\n onError(error);\n }\n });\n };\n\n start();\n },\n getVerificationCode: function getVerificationCode(phone) {\n if (!phone) {\n throw 'phone is not provided';\n }\n\n var url = configs.services.user.host.replace('/graphql', '') + '/send_smscode/' + phone + '/' + this.opts.clientId;\n return axios.get(url).then(function (result) {\n if (result.data.code !== 200) {\n throw result.data;\n } else {\n return result.data;\n }\n });\n },\n loginByPhoneCode: function loginByPhoneCode(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n var self = this;\n\n this.haveAccess();\n\n var variables = {\n registerInClient: this.opts.clientId,\n phone: options.phone,\n phoneCode: parseInt(options.phoneCode, 10)\n };\n\n if (configs.inBrowser) {\n variables.browser = window.navigator.userAgent;\n }\n\n return this.UserClient.request({\n operationName: 'login',\n query: 'mutation login($phone: String, $phoneCode: Int, $registerInClient: String!, $browser: String) {\\n login(phone: $phone, phoneCode: $phoneCode, registerInClient: $registerInClient, browser: $browser) {\\n _id\\n email\\n unionid\\n openid\\n emailVerified\\n username\\n nickname\\n phone\\n company\\n photo\\n browser\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }',\n variables: variables\n }).then(function (res) {\n return res.login;\n }).then(function (user) {\n if (user) {\n self.initUserClient(user.token);\n }\n return user;\n });\n },\n queryPermissions: function queryPermissions(userId) {\n if (!userId) {\n throw 'userId is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n user: userId\n };\n\n return this.ownerClient.request({\n operationName: 'QueryRoleByUserId',\n query: 'query QueryRoleByUserId($user: String!, $client: String!){\\n queryRoleByUserId(user: $user, client: $client) {\\n totalCount\\n list {\\n group {\\n name\\n permissions\\n }\\n }\\n }\\n }',\n variables: variables\n }).then(function (res) {\n return res.queryRoleByUserId;\n });\n },\n queryRoles: function queryRoles(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n clientId: this.opts.clientId,\n page: options.page,\n count: options.count\n };\n\n return this.ownerClient.request({\n operationName: 'ClientRoles',\n query: '\\n query ClientRoles(\\n $clientId: String!\\n $page: Int\\n $count: Int\\n ) {\\n clientRoles(\\n client: $clientId\\n page: $page\\n count: $count\\n ) {\\n totalCount\\n list {\\n _id\\n name\\n descriptions\\n client\\n createdAt\\n permissions\\n }\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.clientRoles;\n });\n },\n createRole: function createRole(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n name: options.name,\n descriptions: options.descriptions\n };\n\n return this.ownerClient.request({\n operationName: 'CreateRole',\n query: '\\n mutation CreateRole(\\n $name: String!\\n $client: String!\\n $descriptions: String\\n ) {\\n createRole(\\n name: $name\\n client: $client\\n descriptions: $descriptions\\n ) {\\n _id,\\n name,\\n client,\\n descriptions\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.createRole;\n });\n },\n updateRolePermissions: function updateRolePermissions(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n name: options.name,\n permissions: options.permissions,\n _id: options.roleId\n };\n\n return this.ownerClient.request({\n operationName: 'UpdateRole',\n query: '\\n mutation UpdateRole(\\n $_id: String!\\n $name: String!\\n $client: String!\\n $descriptions: String\\n $permissions: String\\n ) {\\n updateRole(\\n _id: $_id\\n name: $name\\n client: $client\\n descriptions: $descriptions\\n permissions: $permissions\\n ) {\\n _id,\\n name,\\n client,\\n descriptions,\\n permissions\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.updateRole;\n });\n },\n assignUserToRole: function assignUserToRole(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n group: options.roleId,\n user: options.user\n };\n\n return this.ownerClient.request({\n operationName: 'AssignUserToRole',\n query: '\\n mutation AssignUserToRole(\\n $group: String!\\n $client: String!\\n $user: String!\\n ) {\\n assignUserToRole(\\n group: $group\\n client: $client\\n user: $user\\n ) {\\n totalCount,\\n list {\\n _id,\\n client {\\n _id\\n },\\n user {\\n _id\\n },\\n createdAt\\n }\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.assignUserToRole;\n });\n },\n removeUserFromRole: function removeUserFromRole(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n user: options.user,\n group: options.roleId\n };\n\n return this.ownerClient.request({\n operationName: 'RemoveUserFromGroup',\n query: '\\n mutation RemoveUserFromGroup(\\n $group: String!\\n $client: String!\\n $user: String!\\n ) {\\n removeUserFromGroup(\\n group: $group\\n client: $client\\n user: $user\\n ) {\\n _id,\\n group {\\n _id\\n },\\n client {\\n _id\\n },\\n user {\\n _id\\n }\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.removeUserFromGroup;\n });\n },\n refreshToken: function refreshToken(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n user: options.user\n };\n\n return this.ownerClient.request({\n operationName: 'RefreshToken',\n query: '\\n mutation RefreshToken(\\n $client: String!\\n $user: String!\\n ) {\\n refreshToken(\\n client: $client\\n user: $user\\n ) {\\n token\\n iat\\n exp\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.refreshToken;\n });\n }\n};\n\nmodule.exports = Authing;\n\n//# sourceURL=webpack://Authing/./src/index.js?"); +eval("\n\nvar _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; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\n/* jshint esversion: 6 */\n\nvar axios = __webpack_require__(/*! axios */ \"./node_modules/_axios@0.18.0@axios/index.js\");\nvar sha1 = __webpack_require__(/*! js-sha1 */ \"./node_modules/_js-sha1@0.6.0@js-sha1/src/sha1.js\");\nvar configs = __webpack_require__(/*! ./configs */ \"./src/configs.js\");\nvar GraphQLClient = __webpack_require__(/*! ./graphql */ \"./src/graphql.js\");\nvar encryption = __webpack_require__(/*! ./_encryption */ \"./src/_encryption.js\");\n\nfunction Authing(opts) {\n var self = this;\n this.opts = opts;\n this.opts.useSelfWxapp = opts.useSelfWxapp || false;\n this.opts.enableFetchPhone = opts.enableFetchPhone || false;\n this.opts.timeout = opts.timeout || 8000;\n\n if (opts.host) {\n configs.services.user.host = opts.host.user || configs.services.user.host;\n configs.services.oauth.host = opts.host.oauth || configs.services.oauth.host;\n }\n\n this.ownerAuth = {\n authed: false,\n authSuccess: false,\n token: null\n };\n\n this.userAuth = {\n authed: false,\n authSuccess: false,\n token: null\n };\n\n this.initUserClient();\n this.initOwnerClient();\n this.initOAuthClient();\n\n if (!opts.accessToken) {\n if (!opts.clientId) {\n throw new Error('clientId is not provided');\n }\n\n if (configs.inBrowser) {\n if (opts.secret) {\n throw '检测到你处于浏览器环境,当前已不推荐在浏览器环境中暴露 secret,请到 https://docs.authing.cn/authing/sdk/authing-sdk-for-web#chu-shi-hua 查看最新的初始化方式';\n }\n\n if (!opts.timestamp) {\n throw 'timestamp is not provided';\n }\n\n if (!opts.nonce) {\n throw 'nonce is not provided';\n }\n\n this.opts.signature = sha1(opts.timestamp + opts.nonce.toString());\n } else if (!opts.secret) {\n throw new Error('app secret is not provided');\n }\n }\n\n return this._auth().then(function (token) {\n if (token) {\n self.initOwnerClient(token);\n self.loginFromLocalStorage();\n } else {\n self.ownerAuth.authed = true;\n self.ownerAuth.authSuccess = false;\n throw 'auth failed, please check your secret and client ID.';\n }\n return self;\n }).catch(function (error) {\n self.ownerAuth.authed = true;\n self.ownerAuth.authSuccess = false;\n throw 'auth failed: ' + error.message.message;\n });\n}\n\nAuthing.prototype = {\n\n constructor: Authing,\n\n _initClient: function _initClient(token) {\n var conf = {\n baseURL: configs.services.user.host,\n timeout: this.opts.timeout\n };\n if (token) {\n conf.headers = {\n Authorization: 'Bearer ' + token\n };\n }\n return new GraphQLClient(conf);\n },\n oAuthClientByUserToken: function oAuthClientByUserToken() {\n this.haveLogined();\n var token = this.userAuth.token;\n\n if (!this._oAuthClientByUserToken) {\n this._oAuthClientByUserToken = new GraphQLClient({\n baseURL: configs.services.oauth.host,\n headers: {\n Authorization: 'Bearer ' + token\n },\n timeout: this.opts.timeout\n });\n }\n return this._oAuthClientByUserToken;\n },\n initUserClient: function initUserClient(token) {\n if (token) {\n this.userAuth = {\n authed: true,\n authSuccess: true,\n token: token\n };\n if (configs.inBrowser) {\n localStorage.setItem('_authing_token', token);\n }\n }\n this.UserClient = this._initClient(token);\n },\n initOwnerClient: function initOwnerClient(token) {\n if (token) {\n this.ownerAuth = {\n authed: true,\n authSuccess: true,\n token: token\n };\n }\n this.ownerClient = this._initClient(token);\n },\n initOAuthClient: function initOAuthClient() {\n this.OAuthClient = new GraphQLClient({\n baseURL: configs.services.oauth.host,\n timeout: this.opts.timeout\n });\n },\n _auth: function _auth() {\n var _this = this;\n\n var authOpts = {\n baseURL: configs.services.user.host,\n timeout: this.opts.timeout\n };\n\n if (this.opts.accessToken) {\n authOpts.headers = {\n Authorization: 'Bearer ' + this.opts.accessToken\n };\n }\n\n if (!this.AuthService) {\n this.AuthService = new GraphQLClient(authOpts);\n }\n\n if (this.opts.accessToken && this.AuthService) {\n return new Promise(function (resolve) {\n resolve(_this.opts.accessToken);\n });\n }\n\n var options = {\n secret: this.opts.secret,\n clientId: this.opts.clientId\n };\n\n var self = this;\n\n var query = '';\n var queryField = '{\\n accessToken\\n clientInfo {\\n _id\\n name\\n descriptions\\n jwtExpired\\n createdAt\\n isDeleted\\n logo\\n emailVerifiedDefault\\n registerDisabled\\n allowedOrigins\\n clientType {\\n _id\\n name\\n description\\n image\\n example\\n }\\n }\\n }';\n\n if (configs.inBrowser) {\n options = {\n clientId: this.opts.clientId,\n timestamp: this.opts.timestamp,\n nonce: this.opts.nonce,\n signature: this.opts.signature\n };\n query = 'query {\\n getClientWhenSdkInit(timestamp: \"' + options.timestamp + '\", clientId: \"' + options.clientId + '\", nonce: ' + options.nonce + ', signature: \"' + options.signature + '\")' + queryField + '\\n }';\n } else {\n query = 'query {\\n getClientWhenSdkInit(secret: \"' + options.secret + '\", clientId: \"' + options.clientId + '\")' + queryField + '\\n }';\n }\n\n return this.AuthService.request({\n query: query\n }).then(function (data) {\n var accessToken = '';\n if (data.getClientWhenSdkInit) {\n // eslint-disable-next-line prefer-destructuring\n accessToken = data.getClientWhenSdkInit.accessToken;\n self.clientInfo = data.getClientWhenSdkInit.clientInfo;\n }\n self.AuthService = new GraphQLClient({\n baseURL: configs.services.user.host,\n headers: {\n Authorization: 'Bearer ' + accessToken\n }\n });\n return accessToken;\n });\n },\n loginFromLocalStorage: function loginFromLocalStorage() {\n var self = this;\n if (configs.inBrowser) {\n var authingToken = localStorage.getItem('_authing_token');\n if (authingToken) {\n self.initUserClient(authingToken);\n }\n }\n },\n checkLoginStatus: function checkLoginStatus(token) {\n return this.UserClient.request({\n operationName: 'checkLoginStatus',\n query: 'query checkLoginStatus($token: String) {\\n checkLoginStatus(token: $token) {\\n status\\n code\\n message\\n }\\n }',\n variables: {\n token: token\n }\n }).then(function (res) {\n return res.checkLoginStatus;\n });\n },\n _readOAuthList: function _readOAuthList(params) {\n var variables = {};\n if (params) {\n variables = params;\n }\n var self = this;\n\n this.haveAccess();\n\n if (!this._OAuthService) {\n this._OAuthService = new GraphQLClient({\n baseURL: configs.services.oauth.host,\n headers: {\n Authorization: 'Bearer ' + self.ownerAuth.token\n }\n });\n }\n return this._OAuthService.request({\n operationName: 'getOAuthList',\n query: 'query getOAuthList($clientId: String!, $useGuard: Boolean) {\\n ReadOauthList(clientId: $clientId, useGuard: $useGuard) {\\n _id\\n name\\n image\\n description\\n enabled\\n client\\n user\\n url\\n alias\\n }\\n }',\n variables: _extends({\n clientId: self.opts.clientId\n }, variables)\n }).then(function (res) {\n return res.ReadOauthList;\n });\n },\n haveAccess: function haveAccess() {\n if (!this.ownerAuth.authSuccess) {\n throw 'have no access, please check your secret and client ID.';\n }\n },\n haveLogined: function haveLogined() {\n if (!this.userAuth.authSuccess) {\n throw 'not logined yet, please login first.';\n }\n },\n _chooseClient: function _chooseClient() {\n if (this.userAuth.authSuccess) {\n return this.UserClient;\n }\n return this.ownerClient;\n },\n _login: function _login(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n /* eslint-disable no-param-reassign */\n\n options.registerInClient = this.opts.clientId;\n\n if (options.password) {\n options.password = encryption(options.password);\n }\n\n this.haveAccess();\n\n if (configs.inBrowser) {\n options.browser = window.navigator.userAgent;\n }\n\n return this.UserClient.request({\n operationName: 'login',\n query: 'mutation login($unionid: String, $email: String, $username: String, $password: String, $lastIP: String, $registerInClient: String!, $verifyCode: String, $browser: String, $openid: String) {\\n login(unionid: $unionid, email: $email, username: $username, password: $password, lastIP: $lastIP, registerInClient: $registerInClient, verifyCode: $verifyCode, browser: $browser, openid: $openid) {\\n _id\\n email\\n emailVerified\\n unionid\\n openid\\n oauth\\n registerMethod\\n username\\n nickname\\n company\\n photo\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.login;\n });\n },\n _loginByLDAP: function _loginByLDAP(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n options.clientId = this.opts.clientId;\n\n if (!options.password) {\n throw 'password is not provided.';\n }\n\n if (!options.username) {\n throw 'username is not provided.';\n }\n\n this.haveAccess();\n\n if (configs.inBrowser) {\n options.browser = window.navigator.userAgent;\n }\n\n return this.OAuthClient.request({\n operationName: 'LoginByLDAP',\n query: 'mutation LoginByLDAP($username: String!, $password: String!, $clientId: String!, $browser: String) {\\n LoginByLDAP(username: $username, clientId: $clientId, password: $password, browser: $browser) {\\n _id\\n email\\n emailVerified\\n unionid\\n openid\\n oauth\\n registerMethod\\n username\\n nickname\\n company\\n photo\\n browser\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.LoginByLDAP;\n });\n },\n loginByLDAP: function loginByLDAP(options) {\n var self = this;\n return this._loginByLDAP(options).then(function (user) {\n if (user) {\n self.initUserClient(user.token);\n }\n return user;\n });\n },\n login: function login(options) {\n var self = this;\n return this._login(options).then(function (user) {\n if (user) {\n self.initUserClient(user.token);\n }\n return user;\n });\n },\n register: function register(options) {\n this.haveAccess();\n\n if (!options) {\n throw 'options is not provided';\n }\n\n options.registerInClient = this.opts.clientId;\n\n if (options.password) {\n options.password = encryption(options.password);\n }\n\n if (configs.inBrowser) {\n options.browser = window.navigator.userAgent;\n }\n\n return this.UserClient.request({\n operationName: 'register',\n query: '\\n mutation register(\\n $unionid: String,\\n $openid: String,\\n $email: String,\\n $password: String,\\n $lastIP: String,\\n $gender: String,\\n $birthdate: String,\\n $region: String,\\n $locality: String,\\n $name: String,\\n $givenName: String,\\n $familyName: String,\\n $middleName: String,\\n $profile: String,\\n $preferredUsername: String,\\n $website: String,\\n $zoneinfo: String,\\n $locale: String,\\n $address: String,\\n $formatted: String,\\n $streetAddress: String,\\n $postalCode: String,\\n $country: String,\\n $updatedAt: String,\\n $forceLogin: Boolean,\\n $registerInClient: String!,\\n $oauth: String,\\n $username: String,\\n $nickname: String,\\n $registerMethod: String,\\n $photo: String,\\n $company: String,\\n $browser: String,\\n ) {\\n register(userInfo: {\\n unionid: $unionid,\\n openid: $openid,\\n email: $email,\\n password: $password,\\n lastIP: $lastIP,\\n forceLogin: $forceLogin,\\n registerInClient: $registerInClient,\\n oauth: $oauth,\\n registerMethod: $registerMethod,\\n name: $name,\\n givenName: $givenName,\\n familyName: $familyName,\\n middleName: $middleName,\\n profile: $profile,\\n preferredUsername: $preferredUsername,\\n website: $website,\\n zoneinfo: $zoneinfo,\\n locale: $locale,\\n address: $address,\\n formatted: $formatted,\\n streetAddress: $streetAddress,\\n postalCode: $postalCode,\\n country: $country,\\n updatedAt: $updatedAt,\\n gender: $gender,\\n birthdate: $birthdate,\\n region: $region,\\n locality: $locality,\\n photo: $photo,\\n username: $username,\\n nickname: $nickname,\\n company: $company,\\n browser: $browser,\\n }) {\\n _id,\\n email,\\n emailVerified,\\n unionid,\\n openid,\\n oauth,\\n registerMethod,\\n username,\\n nickname,\\n company,\\n photo,\\n browser,\\n password,\\n token,\\n group {\\n name\\n },\\n blocked,\\n device\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.register;\n });\n },\n logout: function logout(_id) {\n this.haveAccess();\n\n if (!_id) {\n throw '_id is not provided';\n }\n\n this.userAuth = {\n authed: false,\n authSuccess: false,\n token: null\n };\n if (configs.inBrowser) {\n localStorage.removeItem('_authing_token');\n }\n\n return this.update({\n _id: _id,\n tokenExpiredAt: 0\n });\n },\n user: function user(options) {\n this.haveAccess();\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.id) {\n throw 'id in options is not provided';\n }\n options.registerInClient = this.opts.clientId;\n\n var client = this._chooseClient();\n\n return client.request({\n operationName: 'user',\n query: 'query user($id: String!, $registerInClient: String!){\\n user(id: $id, registerInClient: $registerInClient) {\\n _id\\n unionid\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n userLocation {\\n _id\\n when\\n where\\n }\\n userLoginHistory {\\n totalCount\\n list {\\n _id\\n when\\n success\\n ip\\n result\\n }\\n }\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.user;\n });\n },\n userPatch: function userPatch(options) {\n this.haveAccess();\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.ids) {\n throw 'ids in options is not provided';\n }\n options.registerInClient = this.opts.clientId;\n\n var client = this._chooseClient();\n\n return client.request({\n operationName: 'userPatch',\n query: 'query userPatch($ids: String!){\\n userPatch(ids: $ids) {\\n list {\\n _id\\n unionid\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n userLocation {\\n _id\\n when\\n where\\n }\\n userLoginHistory {\\n totalCount\\n list {\\n _id\\n when\\n success\\n ip\\n result\\n }\\n }\\n }\\n totalCount\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.userPatch;\n });\n },\n list: function list(page, count) {\n this.haveAccess();\n\n page = page || 1;\n count = count || 10;\n\n var options = {\n registerInClient: this.opts.clientId,\n page: page,\n count: count\n };\n\n return this.ownerClient.request({\n operationName: 'users',\n query: 'query users($registerInClient: String, $page: Int, $count: Int){\\n users(registerInClient: $registerInClient, page: $page, count: $count) {\\n totalCount\\n list {\\n _id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n password\\n registerInClient\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n group {\\n _id\\n name\\n descriptions\\n createdAt\\n }\\n clientType {\\n _id\\n name\\n description\\n image\\n example\\n }\\n userLocation {\\n _id\\n when\\n where\\n }\\n userLoginHistory {\\n totalCount\\n list{\\n _id\\n when\\n success\\n ip\\n result\\n }\\n }\\n systemApplicationType {\\n _id\\n name\\n descriptions\\n price\\n }\\n }\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.users;\n });\n },\n remove: function remove(_id, operator) {\n var self = this;\n\n this.haveAccess();\n\n if (!_id) {\n throw '_id is not provided';\n }\n\n return this.ownerClient.request({\n query: 'mutation removeUsers($ids: [String], $registerInClient: String, $operator: String){\\n removeUsers(ids: $ids, registerInClient: $registerInClient, operator: $operator) {\\n _id\\n }\\n }',\n variables: {\n ids: [_id],\n registerInClient: self.opts.clientId,\n operator: operator\n }\n }).then(function (res) {\n return res.removeUsers;\n });\n },\n _uploadAvatar: function _uploadAvatar(options) {\n var client = this._chooseClient();\n return client.request({\n operationName: 'qiNiuUploadToken',\n query: 'query qiNiuUploadToken {\\n qiNiuUploadToken\\n }'\n }).then(function (data) {\n return data.qiNiuUploadToken;\n }).then(function (token) {\n if (!token) {\n throw {\n graphQLErrors: [{\n message: {\n message: '获取文件上传token失败'\n }\n }]\n };\n }\n\n var formData = new FormData();\n formData.append('file', options.photo);\n formData.append('token', token);\n return axios.post('https://upload.qiniup.com/', formData, {\n method: 'post',\n headers: { 'Content-Type': 'multipart/form-data' }\n });\n }).then(function (data) {\n return data.data;\n }).then(function (data) {\n if (data.key) {\n options.photo = 'https://usercontents.authing.cn/' + data.key;\n }\n return options;\n }).catch(function (e) {\n if (e.graphQLErrors) {\n throw e.graphQLErrors[0];\n }\n throw {\n message: {\n message: e\n }\n };\n });\n },\n update: function update(options) {\n var self = this;\n\n this.haveAccess();\n\n if (!options) {\n throw 'options is not provided';\n }\n\n // eslint-disable-next-line no-underscore-dangle\n if (!options._id) {\n throw '_id in options is not provided';\n }\n\n if (options.password) {\n if (!options.oldPassword) {\n throw 'oldPassword in options is not provided';\n }\n options.password = encryption(options.password);\n options.oldPassword = encryption(options.oldPassword);\n }\n\n options.registerInClient = self.opts.clientId;\n\n var keyTypeList = {\n _id: 'String!',\n email: 'String',\n emailVerified: 'Boolean',\n username: 'String',\n nickname: 'String',\n company: 'String',\n photo: 'String',\n oauth: 'String',\n browser: 'String',\n password: 'String',\n oldPassword: 'String',\n registerInClient: 'String!',\n phone: 'String',\n token: 'String',\n tokenExpiredAt: 'String',\n loginsCount: 'Int',\n lastLogin: 'String',\n lastIP: 'String',\n signedUp: 'String',\n blocked: 'Boolean',\n isDeleted: 'Boolean'\n };\n var returnFields = '_id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n phone\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted';\n\n function generateArgs(opts) {\n var args = [];\n var argsFiller = [];\n var argsString = '';\n // eslint-disable-next-line no-restricted-syntax\n for (var key in opts) {\n if (keyTypeList[key]) {\n args.push('$' + key + ': ' + keyTypeList[key]);\n argsFiller.push(key + ': $' + key);\n }\n }\n argsString = args.join(', ');\n return {\n args: args,\n argsString: argsString,\n argsFiller: argsFiller\n };\n }\n\n var client = this._chooseClient();\n\n if (options.photo) {\n var photo = options.photo;\n\n if (typeof photo !== 'string') {\n return this._uploadAvatar(options).then(function (opts) {\n var arg = generateArgs(opts);\n return client.request({\n operationName: 'UpdateUser',\n query: '\\n mutation UpdateUser(' + arg.argsString + '){\\n updateUser(options: {\\n ' + arg.argsFiller.join(', ') + '\\n }) {\\n ' + returnFields + '\\n }\\n }\\n ',\n variables: opts\n });\n }).then(function (res) {\n return res.updateUser;\n });\n }\n }\n var args = generateArgs(options);\n return client.request({\n operationName: 'UpdateUser',\n query: '\\n mutation UpdateUser(' + args.argsString + '){\\n updateUser(options: {\\n ' + args.argsFiller.join(', ') + '\\n }) {\\n ' + returnFields + '\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.updateUser;\n });\n },\n\n /**\n * \n * @param {Object} params 获取社会化登录时可以加选项\n * @param {Boolean} params.useGuard 是否使用 Guard\n */\n readOAuthList: function readOAuthList(params) {\n if (!params || (typeof params === 'undefined' ? 'undefined' : _typeof(params)) !== 'object') {\n return this._readOAuthList().then(function (list) {\n if (list) {\n return list.filter(function (item) {\n return item.enabled;\n });\n }\n throw {\n message: '获取OAuth列表失败,原因未知'\n };\n });\n } else {\n return this._readOAuthList(params).then(function (list) {\n if (list) {\n return list.filter(function (item) {\n return item.enabled;\n });\n }\n throw {\n message: '获取OAuth列表失败,原因未知'\n };\n });\n }\n },\n sendResetPasswordEmail: function sendResetPasswordEmail(options) {\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.email) {\n throw 'email in options is not provided';\n }\n\n options.client = this.opts.clientId;\n return this.UserClient.request({\n operationName: 'sendResetPasswordEmail',\n query: '\\n mutation sendResetPasswordEmail(\\n $email: String!,\\n $client: String!\\n ){\\n sendResetPasswordEmail(\\n email: $email,\\n client: $client\\n ) {\\n message\\n code\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.sendResetPasswordEmail;\n });\n },\n verifyResetPasswordVerifyCode: function verifyResetPasswordVerifyCode(options) {\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.email) {\n throw 'email in options is not provided';\n }\n if (!options.verifyCode) {\n throw 'verifyCode in options is not provided';\n }\n options.client = this.opts.clientId;\n return this.UserClient.request({\n operationName: 'verifyResetPasswordVerifyCode',\n query: '\\n mutation verifyResetPasswordVerifyCode(\\n $email: String!,\\n $client: String!,\\n $verifyCode: String!\\n ) {\\n verifyResetPasswordVerifyCode(\\n email: $email,\\n client: $client,\\n verifyCode: $verifyCode\\n ) {\\n message\\n code\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.verifyResetPasswordVerifyCode;\n });\n },\n changePassword: function changePassword(options) {\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.email) {\n throw 'email in options is not provided';\n }\n if (!options.password) {\n throw 'password in options is not provided';\n }\n if (!options.verifyCode) {\n throw 'verifyCode in options is not provided';\n }\n options.client = this.opts.clientId;\n options.password = encryption(options.password);\n return this.UserClient.request({\n operationName: 'changePassword',\n query: '\\n mutation changePassword(\\n $email: String!,\\n $client: String!,\\n $password: String!,\\n $verifyCode: String!\\n ){\\n changePassword(\\n email: $email,\\n client: $client,\\n password: $password,\\n verifyCode: $verifyCode\\n ) {\\n _id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.changePassword;\n });\n },\n sendVerifyEmail: function sendVerifyEmail(options) {\n if (!options.email) {\n throw 'email in options is not provided';\n }\n\n options.client = this.opts.clientId;\n\n return this.AuthService.request({\n operationName: 'sendVerifyEmail',\n query: '\\n mutation sendVerifyEmail(\\n $email: String!,\\n $client: String!\\n ){\\n sendVerifyEmail(\\n email: $email,\\n client: $client\\n ) {\\n message,\\n code,\\n status\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.sendVerifyEmail;\n });\n },\n selectAvatarFile: function selectAvatarFile(cb) {\n if (!configs.inBrowser) {\n throw '当前不是浏览器环境,无法选取文件';\n }\n var inputElem = document.createElement('input');\n inputElem.type = 'file';\n inputElem.accept = 'image/*';\n inputElem.onchange = function () {\n cb(inputElem.files[0]);\n };\n inputElem.click();\n },\n decodeToken: function decodeToken(token) {\n return this.UserClient.request({\n operationName: 'decodeJwtToken',\n query: 'query decodeJwtToken($token: String) {\\n decodeJwtToken(token: $token) {\\n data {\\n email\\n id\\n clientId\\n }\\n status {\\n code\\n message\\n }\\n iat\\n exp\\n }\\n }',\n variables: {\n token: token\n }\n }).then(function (res) {\n return res.decodeJwtToken;\n });\n },\n readUserOAuthList: function readUserOAuthList(variables) {\n var client = this.oAuthClientByUserToken();\n return client.request({\n operationName: 'notBindOAuthList',\n query: 'query notBindOAuthList($user: String, $client: String) {\\n notBindOAuthList(user: $user, client: $client) {\\n type\\n oAuthUrl\\n image\\n name\\n binded\\n }\\n }',\n variables: variables\n }).then(function (res) {\n return res.notBindOAuthList;\n });\n },\n bindOAuth: function bindOAuth(variables) {\n if (!variables) {\n throw 'options is not provided';\n }\n if (!variables.type) {\n throw 'type in options is not provided';\n }\n if (!variables.unionid) {\n throw 'unionid in options is not provided';\n }\n if (!variables.userInfo) {\n throw 'userInfo in options is not provided';\n }\n\n return this.UserClient.request({\n operationName: 'bindOtherOAuth',\n query: 'mutation bindOtherOAuth(\\n $user: String,\\n $client: String,\\n $type: String!,\\n $unionid: String!,\\n $userInfo: String!\\n ) {\\n bindOtherOAuth (\\n user: $user,\\n client: $client,\\n type: $type,\\n unionid: $unionid,\\n userInfo: $userInfo\\n ) {\\n _id\\n user\\n client\\n type\\n userInfo\\n unionid\\n createdAt\\n }\\n }',\n variables: variables\n });\n },\n unbindOAuth: function unbindOAuth(variables) {\n if (!variables) {\n throw 'options is not provided';\n }\n if (!variables.type) {\n throw 'type in options is not provided';\n }\n\n return this.UserClient.request({\n operationName: 'unbindOtherOAuth',\n query: 'mutation unbindOtherOAuth(\\n $user: String,\\n $client: String,\\n $type: String!\\n ){\\n unbindOtherOAuth(\\n user: $user,\\n client: $client,\\n type: $type\\n ) {\\n _id\\n user\\n client\\n type\\n userInfo\\n unionid\\n createdAt\\n }\\n }',\n variables: variables\n });\n },\n unbindEmail: function unbindEmail(variables) {\n return this.UserClient.request({\n operationName: 'unbindEmail',\n query: 'mutation unbindEmail(\\n $user: String,\\n $client: String,\\n ){\\n unbindEmail(\\n user: $user,\\n client: $client,\\n ) {\\n _id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }',\n variables: variables\n });\n },\n randomWord: function randomWord(randomFlag, min, max) {\n var str = '';\n var range = min;\n var arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];\n\n if (randomFlag) {\n range = Math.round(Math.random() * (max - min)) + min; // 任意长度\n }\n\n for (var i = 0; i < range; i += 1) {\n var pos = Math.round(Math.random() * (arr.length - 1));\n str += arr[pos];\n }\n\n return str;\n },\n genQRCode: function genQRCode(clientId) {\n var random = this.randomWord(true, 12, 24);\n sessionStorage.randomWord = random;\n\n var url = configs.services.oauth.host;\n url = url.replace('/graphql', '');\n\n return axios.get(url + '/oauth/wxapp/qrcode/' + clientId + '?random=' + random + '&useSelfWxapp=' + this.opts.useSelfWxapp + '&enableFetchPhone=' + this.opts.enableFetchPhone);\n },\n checkQR: function checkQR() {\n var random = sessionStorage.randomWord || '';\n var url = configs.services.oauth.host;\n url = url.replace('/graphql', '');\n\n return axios.post(url + '/oauth/wxapp/confirm/qr?random=' + random + '&useSelfWxapp=' + this.opts.useSelfWxapp);\n },\n startWXAppScaning: function startWXAppScaning(opts) {\n var self = this;\n\n if (!opts) {\n opts = {};\n }\n\n var mountNode = opts.mount || 'authing__qrcode-root-node';\n var interval = opts.interval || 1500;\n var _opts = opts,\n tips = _opts.tips;\n\n\n var redirect = true;\n\n // eslint-disable-next-line no-prototype-builtins\n if (opts.hasOwnProperty('redirect')) {\n if (!opts.redirect) {\n redirect = false;\n }\n }\n\n var _opts2 = opts,\n onError = _opts2.onError,\n onSuccess = _opts2.onSuccess,\n onIntervalStarting = _opts2.onIntervalStarting,\n onQRCodeShow = _opts2.onQRCodeShow,\n onQRCodeLoad = _opts2.onQRCodeLoad;\n\n\n var qrcodeNode = document.getElementById(mountNode);\n var qrcodeWrapper = void 0;\n\n var needGenerate = false;\n var start = function start() {};\n\n if (!qrcodeNode) {\n qrcodeNode = document.createElement('div');\n qrcodeNode.id = mountNode;\n qrcodeNode.style = 'z-index: 65535;position: fixed;background: #fff;width: 300px;height: 300px;left: 50%;margin-left: -150px;display: flex;justify-content: center;align-items: center;top: 50%;margin-top: -150px;border: 1px solid #ccc;';\n document.getElementsByTagName('body')[0].appendChild(qrcodeNode);\n needGenerate = true;\n } else {\n qrcodeNode.style = 'position:relative';\n }\n\n var styleNode = document.createElement('style');var style = '#authing__retry a:hover{outline:0px;text-decoration:none;}#authing__spinner{position:absolute;left:50%;margin-left:-6px;}.spinner{margin:100px auto;width:20px;height:20px;position:relative}.container1>div,.container2>div,.container3>div{width:6px;height:6px;background-color:#00a1ea;border-radius:100%;position:absolute;-webkit-animation:bouncedelay 1.2s infinite ease-in-out;animation:bouncedelay 1.2s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.spinner .spinner-container{position:absolute;width:100%;height:100%}.container2{-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}.container3{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}.circle1{top:0;left:0}.circle2{top:0;right:0}.circle3{right:0;bottom:0}.circle4{left:0;bottom:0}.container2 .circle1{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.container3 .circle1{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.container1 .circle2{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.container2 .circle2{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}.container3 .circle2{-webkit-animation-delay:-0.7s;animation-delay:-0.7s}.container1 .circle3{-webkit-animation-delay:-0.6s;animation-delay:-0.6s}.container2 .circle3{-webkit-animation-delay:-0.5s;animation-delay:-0.5s}.container3 .circle3{-webkit-animation-delay:-0.4s;animation-delay:-0.4s}.container1 .circle4{-webkit-animation-delay:-0.3s;animation-delay:-0.3s}.container2 .circle4{-webkit-animation-delay:-0.2s;animation-delay:-0.2s}.container3 .circle4{-webkit-animation-delay:-0.1s;animation-delay:-0.1s}@-webkit-keyframes bouncedelay{0%,80%,100%{-webkit-transform:scale(0.0)}40%{-webkit-transform:scale(1.0)}}@keyframes bouncedelay{0%,80%,100%{transform:scale(0.0);-webkit-transform:scale(0.0)}40%{transform:scale(1.0);-webkit-transform:scale(1.0)}}';\n\n styleNode.type = 'text/css';\n\n if (styleNode.styleSheet) {\n styleNode.styleSheet.cssText = style;\n } else {\n styleNode.innerHTML = style;\n }\n\n document.getElementsByTagName('head')[0].appendChild(styleNode);\n\n var loading = function loading() {\n qrcodeNode.innerHTML = '
';\n };\n\n var unloading = function unloading() {\n var child = document.getElementById('authing__spinner');\n qrcodeNode.removeChild(child);\n };\n\n var genTip = function genTip(text) {\n var tip = document.createElement('span');\n tip.class = 'authing__heading-subtitle';\n if (!needGenerate) {\n tip.style = 'display: block;font-weight: 400;font-size: 15px;color: #888;ine-height: 48px;';\n } else {\n tip.style = 'display: block;font-weight: 400;font-size: 12px;color: #888;';\n }\n tip.innerHTML = text;\n return tip;\n };\n\n var genImage = function genImage(src) {\n var qrcodeImage = document.createElement('img');\n qrcodeImage.class = 'authing__qrcode';\n qrcodeImage.src = src;\n qrcodeImage.width = 240;\n qrcodeImage.height = 240;\n return qrcodeImage;\n };\n\n var genShadow = function genShadow(text, aOnClick) {\n var shadow = document.createElement('div');\n shadow.id = 'authing__retry';\n shadow.style = 'text-align:center;width: 240px;height: 240px;position: absolute;left: 50%;top: 0px;margin-left: -120px;background-color: rgba(0,0,0, 0.5);line-height:240px;color:#fff;font-weight:600;';\n\n var shadowA = document.createElement('a');\n shadowA.innerHTML = text;\n shadowA.style = 'color:#fff;border-bottom: 1px solid #fff;cursor: pointer;';\n shadowA.onclick = aOnClick;\n shadow.appendChild(shadowA);\n return shadow;\n };\n\n function genRetry(qrcodeElm, tipText) {\n var tip = genTip(tipText);\n\n qrcodeWrapper = document.createElement('div');\n qrcodeWrapper.id = 'authing__qrcode-wrapper';\n qrcodeWrapper.style = 'text-align: center;position: relative;';\n\n var qrcodeImage = genImage('https://usercontents.authing.cn/authing_user_manager_wxapp_qrcode.jpg');\n\n if (!needGenerate) {\n qrcodeImage.style = 'margin-top: 12px;';\n } else {\n qrcodeImage.style = 'margin-top: 16px;';\n }\n\n qrcodeImage.onload = function () {\n unloading();\n };\n\n var shadow = genShadow('点击重试', function () {\n start();\n });\n\n qrcodeWrapper.appendChild(qrcodeImage);\n qrcodeWrapper.appendChild(shadow);\n qrcodeWrapper.appendChild(tip);\n qrcodeElm.appendChild(qrcodeWrapper);\n }\n\n start = function start() {\n loading();\n self.genQRCode(self.opts.clientId).then(function (qrRes) {\n qrRes = qrRes.data;\n\n if (qrRes.code !== 200) {\n genRetry(qrcodeNode, qrRes.message);\n if (onError) {\n onError(qrRes);\n }\n } else {\n var qrcode = qrRes.data;\n if (onQRCodeLoad) {\n onQRCodeLoad(qrcode);\n }\n sessionStorage.qrcodeUrl = qrcode.qrcode;\n sessionStorage.qrcode = JSON.stringify(qrcode);\n\n if (qrcodeNode) {\n qrcodeWrapper = document.createElement('div');\n qrcodeWrapper.id = 'authing__qrcode-wrapper';\n qrcodeWrapper.style = 'text-align: center;position: relative;';\n\n var qrcodeImage = genImage(qrcode.qrcode);\n\n qrcodeImage.onload = function () {\n unloading();\n if (onQRCodeShow) {\n onQRCodeShow(qrcode);\n }\n var inter = 0;\n inter = setInterval(function () {\n if (onIntervalStarting) {\n onIntervalStarting(inter);\n }\n self.checkQR().then(function (checkRes) {\n var checkResult = checkRes.data.data;\n if (checkResult.code === 200) {\n clearInterval(inter);\n if (redirect) {\n var shadowX = genShadow('扫码成功,即将跳转', function () {\n window.location.href = checkResult.redirect + '?code=200&data=' + JSON.stringify(checkResult.data);\n });\n setTimeout(function () {\n window.location.href = checkResult.redirect + '?code=200&data=' + JSON.stringify(checkResult.data);\n }, 600);\n qrcodeWrapper.appendChild(shadowX);\n } else {\n var shadow = genShadow('扫码成功');\n qrcodeWrapper.appendChild(shadow);\n if (onSuccess) {\n onSuccess(checkResult);\n }\n }\n }\n });\n }, interval);\n };\n\n var tip = genTip(tips || '使用 微信 或小程序 身份管家 扫码登录');\n\n qrcodeWrapper.appendChild(qrcodeImage);\n qrcodeWrapper.appendChild(tip);\n qrcodeNode.appendChild(qrcodeWrapper);\n }\n }\n }).catch(function (error) {\n genRetry(qrcodeNode, '网络出错,请重试');\n if (onError) {\n onError(error);\n }\n });\n };\n\n start();\n },\n getVerificationCode: function getVerificationCode(phone) {\n if (!phone) {\n throw 'phone is not provided';\n }\n\n var url = configs.services.user.host.replace('/graphql', '') + '/send_smscode/' + phone + '/' + this.opts.clientId;\n return axios.get(url).then(function (result) {\n if (result.data.code !== 200) {\n throw result.data;\n } else {\n return result.data;\n }\n });\n },\n loginByPhoneCode: function loginByPhoneCode(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n var self = this;\n\n this.haveAccess();\n\n var variables = {\n registerInClient: this.opts.clientId,\n phone: options.phone,\n phoneCode: parseInt(options.phoneCode, 10)\n };\n\n if (configs.inBrowser) {\n variables.browser = window.navigator.userAgent;\n }\n\n return this.UserClient.request({\n operationName: 'login',\n query: 'mutation login($phone: String, $phoneCode: Int, $registerInClient: String!, $browser: String) {\\n login(phone: $phone, phoneCode: $phoneCode, registerInClient: $registerInClient, browser: $browser) {\\n _id\\n email\\n unionid\\n openid\\n emailVerified\\n username\\n nickname\\n phone\\n company\\n photo\\n browser\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }',\n variables: variables\n }).then(function (res) {\n return res.login;\n }).then(function (user) {\n if (user) {\n self.initUserClient(user.token);\n }\n return user;\n });\n },\n queryPermissions: function queryPermissions(userId) {\n if (!userId) {\n throw 'userId is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n user: userId\n };\n\n return this.ownerClient.request({\n operationName: 'QueryRoleByUserId',\n query: 'query QueryRoleByUserId($user: String!, $client: String!){\\n queryRoleByUserId(user: $user, client: $client) {\\n totalCount\\n list {\\n group {\\n name\\n permissions\\n }\\n }\\n }\\n }',\n variables: variables\n }).then(function (res) {\n return res.queryRoleByUserId;\n });\n },\n queryRoles: function queryRoles(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n clientId: this.opts.clientId,\n page: options.page,\n count: options.count\n };\n\n return this.ownerClient.request({\n operationName: 'ClientRoles',\n query: '\\n query ClientRoles(\\n $clientId: String!\\n $page: Int\\n $count: Int\\n ) {\\n clientRoles(\\n client: $clientId\\n page: $page\\n count: $count\\n ) {\\n totalCount\\n list {\\n _id\\n name\\n descriptions\\n client\\n createdAt\\n permissions\\n }\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.clientRoles;\n });\n },\n createRole: function createRole(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n name: options.name,\n descriptions: options.descriptions\n };\n\n return this.ownerClient.request({\n operationName: 'CreateRole',\n query: '\\n mutation CreateRole(\\n $name: String!\\n $client: String!\\n $descriptions: String\\n ) {\\n createRole(\\n name: $name\\n client: $client\\n descriptions: $descriptions\\n ) {\\n _id,\\n name,\\n client,\\n descriptions\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.createRole;\n });\n },\n updateRolePermissions: function updateRolePermissions(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n name: options.name,\n permissions: options.permissions,\n _id: options.roleId\n };\n\n return this.ownerClient.request({\n operationName: 'UpdateRole',\n query: '\\n mutation UpdateRole(\\n $_id: String!\\n $name: String!\\n $client: String!\\n $descriptions: String\\n $permissions: String\\n ) {\\n updateRole(\\n _id: $_id\\n name: $name\\n client: $client\\n descriptions: $descriptions\\n permissions: $permissions\\n ) {\\n _id,\\n name,\\n client,\\n descriptions,\\n permissions\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.updateRole;\n });\n },\n assignUserToRole: function assignUserToRole(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n group: options.roleId,\n user: options.user\n };\n\n return this.ownerClient.request({\n operationName: 'AssignUserToRole',\n query: '\\n mutation AssignUserToRole(\\n $group: String!\\n $client: String!\\n $user: String!\\n ) {\\n assignUserToRole(\\n group: $group\\n client: $client\\n user: $user\\n ) {\\n totalCount,\\n list {\\n _id,\\n client {\\n _id\\n },\\n user {\\n _id\\n },\\n createdAt\\n }\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.assignUserToRole;\n });\n },\n removeUserFromRole: function removeUserFromRole(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n user: options.user,\n group: options.roleId\n };\n\n return this.ownerClient.request({\n operationName: 'RemoveUserFromGroup',\n query: '\\n mutation RemoveUserFromGroup(\\n $group: String!\\n $client: String!\\n $user: String!\\n ) {\\n removeUserFromGroup(\\n group: $group\\n client: $client\\n user: $user\\n ) {\\n _id,\\n group {\\n _id\\n },\\n client {\\n _id\\n },\\n user {\\n _id\\n }\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.removeUserFromGroup;\n });\n },\n refreshToken: function refreshToken(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n user: options.user\n };\n\n return this.ownerClient.request({\n operationName: 'RefreshToken',\n query: '\\n mutation RefreshToken(\\n $client: String!\\n $user: String!\\n ) {\\n refreshToken(\\n client: $client\\n user: $user\\n ) {\\n token\\n iat\\n exp\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.refreshToken;\n });\n }\n};\n\nmodule.exports = Authing;\n\n//# sourceURL=webpack://Authing/./src/index.js?"); /***/ }) diff --git a/dist/authing-js-sdk-browser.min.js b/dist/authing-js-sdk-browser.min.js index f0090aec2..d4d343bd4 100644 --- a/dist/authing-js-sdk-browser.min.js +++ b/dist/authing-js-sdk-browser.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Authing=e():t.Authing=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=13)}([function(t,e,n){"use strict";var r=n(2),i=n(15),o=Object.prototype.toString;function s(t){return"[object Array]"===o.call(t)}function a(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===o.call(t)}function h(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),s(t))for(var n=0,r=t.length;n=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){u.headers[t]={}}),r.forEach(["post","put","patch"],function(t){u.headers[t]=r.merge(o)}),t.exports=u}).call(this,n(6))},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,h=[],c=!1,f=-1;function l(){c&&u&&(c=!1,u.length?h=u.concat(h):f=-1,h.length&&p())}function p(){if(!c){var t=a(l);c=!0;for(var e=h.length;e;){for(u=h,h=[];++f1)for(var n=1;ndiv,.container2>div,.container3>div{width:6px;height:6px;background-color:#00a1ea;border-radius:100%;position:absolute;-webkit-animation:bouncedelay 1.2s infinite ease-in-out;animation:bouncedelay 1.2s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.spinner .spinner-container{position:absolute;width:100%;height:100%}.container2{-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}.container3{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}.circle1{top:0;left:0}.circle2{top:0;right:0}.circle3{right:0;bottom:0}.circle4{left:0;bottom:0}.container2 .circle1{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.container3 .circle1{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.container1 .circle2{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.container2 .circle2{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}.container3 .circle2{-webkit-animation-delay:-0.7s;animation-delay:-0.7s}.container1 .circle3{-webkit-animation-delay:-0.6s;animation-delay:-0.6s}.container2 .circle3{-webkit-animation-delay:-0.5s;animation-delay:-0.5s}.container3 .circle3{-webkit-animation-delay:-0.4s;animation-delay:-0.4s}.container1 .circle4{-webkit-animation-delay:-0.3s;animation-delay:-0.3s}.container2 .circle4{-webkit-animation-delay:-0.2s;animation-delay:-0.2s}.container3 .circle4{-webkit-animation-delay:-0.1s;animation-delay:-0.1s}@-webkit-keyframes bouncedelay{0%,80%,100%{-webkit-transform:scale(0.0)}40%{-webkit-transform:scale(1.0)}}@keyframes bouncedelay{0%,80%,100%{transform:scale(0.0);-webkit-transform:scale(0.0)}40%{transform:scale(1.0);-webkit-transform:scale(1.0)}}";m.type="text/css",m.styleSheet?m.styleSheet.cssText=v:m.innerHTML=v,document.getElementsByTagName("head")[0].appendChild(m);var y=function(){var t=document.getElementById("authing__spinner");l.removeChild(t)},w=function(t){var e=document.createElement("span");return e.class="authing__heading-subtitle",e.style=d?"display: block;font-weight: 400;font-size: 12px;color: #888;":"display: block;font-weight: 400;font-size: 15px;color: #888;ine-height: 48px;",e.innerHTML=t,e},b=function(t){var e=document.createElement("img");return e.class="authing__qrcode",e.src=t,e.width=240,e.height=240,e},S=function(t,e){var n=document.createElement("div");n.id="authing__retry",n.style="text-align:center;width: 240px;height: 240px;position: absolute;left: 50%;top: 0px;margin-left: -120px;background-color: rgba(0,0,0, 0.5);line-height:240px;color:#fff;font-weight:600;";var r=document.createElement("a");return r.innerHTML=t,r.style="color:#fff;border-bottom: 1px solid #fff;cursor: pointer;",r.onclick=e,n.appendChild(r),n};function E(t,e){var n=w(e);(p=document.createElement("div")).id="authing__qrcode-wrapper",p.style="text-align: center;position: relative;";var r=b("https://usercontents.authing.cn/authing_user_manager_wxapp_qrcode.jpg");r.style=d?"margin-top: 16px;":"margin-top: 12px;",r.onload=function(){y()};var i=S("点击重试",function(){g()});p.appendChild(r),p.appendChild(i),p.appendChild(n),t.appendChild(p)}(g=function(){l.innerHTML='
',e.genQRCode(e.opts.clientId).then(function(t){if(200!==(t=t.data).code)E(l,t.message),a&&a(t);else{var n=t.data;if(f&&f(n),sessionStorage.qrcodeUrl=n.qrcode,sessionStorage.qrcode=JSON.stringify(n),l){(p=document.createElement("div")).id="authing__qrcode-wrapper",p.style="text-align: center;position: relative;";var s=b(n.qrcode);s.onload=function(){y(),c&&c(n);var t=0;t=setInterval(function(){h&&h(t),e.checkQR().then(function(e){var n=e.data.data;if(200===n.code)if(clearInterval(t),o){var r=S("扫码成功,即将跳转",function(){window.location.href=n.redirect+"?code=200&data="+JSON.stringify(n.data)});setTimeout(function(){window.location.href=n.redirect+"?code=200&data="+JSON.stringify(n.data)},600),p.appendChild(r)}else{var i=S("扫码成功");p.appendChild(i),u&&u(n)}})},r)};var d=w(i||"使用 微信 或小程序 身份管家 扫码登录");p.appendChild(s),p.appendChild(d),l.appendChild(p)}}}).catch(function(t){E(l,"网络出错,请重试"),a&&a(t)})})()},getVerificationCode:function(t){if(!t)throw"phone is not provided";var e=a.services.user.host.replace("/graphql","")+"/send_smscode/"+t+"/"+this.opts.clientId;return o.get(e).then(function(t){if(200!==t.data.code)throw t.data;return t.data})},loginByPhoneCode:function(t){if(!t)throw"options is not provided.";var e=this;this.haveAccess();var n={registerInClient:this.opts.clientId,phone:t.phone,phoneCode:parseInt(t.phoneCode,10)};return a.inBrowser&&(n.browser=window.navigator.userAgent),this.UserClient.request({operationName:"login",query:"mutation login($phone: String, $phoneCode: Int, $registerInClient: String!, $browser: String) {\n login(phone: $phone, phoneCode: $phoneCode, registerInClient: $registerInClient, browser: $browser) {\n _id\n email\n unionid\n openid\n emailVerified\n username\n nickname\n phone\n company\n photo\n browser\n token\n tokenExpiredAt\n loginsCount\n lastLogin\n lastIP\n signedUp\n blocked\n isDeleted\n }\n }",variables:n}).then(function(t){return t.login}).then(function(t){return t&&e.initUserClient(t.token),t})},queryPermissions:function(t){if(!t)throw"userId is not provided.";this.haveAccess();var e={client:this.opts.clientId,user:t};return this.ownerClient.request({operationName:"QueryRoleByUserId",query:"query QueryRoleByUserId($user: String!, $client: String!){\n queryRoleByUserId(user: $user, client: $client) {\n totalCount\n list {\n group {\n name\n permissions\n }\n }\n }\n }",variables:e}).then(function(t){return t.queryRoleByUserId})},queryRoles:function(t){if(!t)throw"options is not provided.";this.haveAccess();var e={clientId:this.opts.clientId,page:t.page,count:t.count};return this.ownerClient.request({operationName:"ClientRoles",query:"\n query ClientRoles(\n $clientId: String!\n $page: Int\n $count: Int\n ) {\n clientRoles(\n client: $clientId\n page: $page\n count: $count\n ) {\n totalCount\n list {\n _id\n name\n descriptions\n client\n createdAt\n permissions\n }\n }\n }\n ",variables:e}).then(function(t){return t.clientRoles})},createRole:function(t){if(!t)throw"options is not provided.";this.haveAccess();var e={client:this.opts.clientId,name:t.name,descriptions:t.descriptions};return this.ownerClient.request({operationName:"CreateRole",query:"\n mutation CreateRole(\n $name: String!\n $client: String!\n $descriptions: String\n ) {\n createRole(\n name: $name\n client: $client\n descriptions: $descriptions\n ) {\n _id,\n name,\n client,\n descriptions\n }\n }\n ",variables:e}).then(function(t){return t.createRole})},updateRolePermissions:function(t){if(!t)throw"options is not provided.";this.haveAccess();var e={client:this.opts.clientId,name:t.name,permissions:t.permissions,_id:t.roleId};return this.ownerClient.request({operationName:"UpdateRole",query:"\n mutation UpdateRole(\n $_id: String!\n $name: String!\n $client: String!\n $descriptions: String\n $permissions: String\n ) {\n updateRole(\n _id: $_id\n name: $name\n client: $client\n descriptions: $descriptions\n permissions: $permissions\n ) {\n _id,\n name,\n client,\n descriptions,\n permissions\n }\n }\n ",variables:e}).then(function(t){return t.updateRole})},assignUserToRole:function(t){if(!t)throw"options is not provided.";this.haveAccess();var e={client:this.opts.clientId,group:t.roleId,user:t.user};return this.ownerClient.request({operationName:"AssignUserToRole",query:"\n mutation AssignUserToRole(\n $group: String!\n $client: String!\n $user: String!\n ) {\n assignUserToRole(\n group: $group\n client: $client\n user: $user\n ) {\n totalCount,\n list {\n _id,\n client {\n _id\n },\n user {\n _id\n },\n createdAt\n }\n }\n }\n ",variables:e}).then(function(t){return t.assignUserToRole})},removeUserFromRole:function(t){if(!t)throw"options is not provided.";this.haveAccess();var e={client:this.opts.clientId,user:t.user,group:t.roleId};return this.ownerClient.request({operationName:"RemoveUserFromGroup",query:"\n mutation RemoveUserFromGroup(\n $group: String!\n $client: String!\n $user: String!\n ) {\n removeUserFromGroup(\n group: $group\n client: $client\n user: $user\n ) {\n _id,\n group {\n _id\n },\n client {\n _id\n },\n user {\n _id\n }\n }\n }\n ",variables:e}).then(function(t){return t.removeUserFromGroup})},refreshToken:function(t){if(!t)throw"options is not provided.";this.haveAccess();var e={client:this.opts.clientId,user:t.user};return this.ownerClient.request({operationName:"RefreshToken",query:"\n mutation RefreshToken(\n $client: String!\n $user: String!\n ) {\n refreshToken(\n client: $client\n user: $user\n ) {\n token\n iat\n exp\n }\n }\n ",variables:e}).then(function(t){return t.refreshToken})}},t.exports=c},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(16),s=n(9);function a(t){var e=new o(t),n=i(o.prototype.request,e);return r.extend(n,o.prototype,e),r.extend(n,e),n}var u=a(n(5));u.Axios=o,u.create=function(t){return a(s(u.defaults,t))},u.Cancel=n(10),u.CancelToken=n(28),u.isCancel=n(4),u.all=function(t){return Promise.all(t)},u.spread=n(29),t.exports=u,t.exports.default=u},function(t,e){t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(17),s=n(18),a=n(9);function u(t){this.defaults=t,this.interceptors={request:new o,response:new o}}u.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=a(this.defaults,t)).method=t.method?t.method.toLowerCase():"get";var e=[s,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},u.prototype.getUri=function(t){return t=a(this.defaults,t),i(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],function(t){u.prototype[t]=function(e,n){return this.request(r.merge(n||{},{method:t,url:e}))}}),r.forEach(["post","put","patch"],function(t){u.prototype[t]=function(e,n,i){return this.request(r.merge(i||{},{method:t,url:e,data:n}))}}),t.exports=u},function(t,e,n){"use strict";var r=n(0);function i(){this.handlers=[]}i.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=i},function(t,e,n){"use strict";var r=n(0),i=n(19),o=n(4),s=n(5),a=n(26),u=n(27);function h(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return h(t),t.baseURL&&!a(t.url)&&(t.url=u(t.baseURL,t.url)),t.headers=t.headers||{},t.data=i(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||s.adapter)(t).then(function(e){return h(t),e.data=i(e.data,e.headers,t.transformResponse),e},function(e){return o(e)||(h(t),e&&e.response&&(e.response.data=i(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},function(t,e,n){"use strict";var r=n(8);t.exports=function(t,e,n){var i=n.config.validateStatus;!i||i(n.status)?t(n):e(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,i){return t.config=e,n&&(t.code=n),t.request=r,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},function(t,e,n){"use strict";var r=n(0),i=["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"];t.exports=function(t){var e,n,o,s={};return t?(r.forEach(t.split("\n"),function(t){if(o=t.indexOf(":"),e=r.trim(t.substr(0,o)).toLowerCase(),n=r.trim(t.substr(o+1)),e){if(s[e]&&i.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([n]):s[e]?s[e]+", "+n:n}}),s):s}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(10);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new r(t),e(n.reason))})}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var t;return{token:new i(function(e){t=e}),cancel:t}},t.exports=i},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__;!function(){"use strict";var root="object"==typeof window?window:{},NODE_JS=!root.JS_SHA1_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS&&(root=global);var COMMON_JS=!root.JS_SHA1_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(31),HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[],createOutputMethod=function(t){return function(e){return new Sha1(!0).update(e)[t]()}},createMethod=function(){var t=createOutputMethod("hex");NODE_JS&&(t=nodeWrap(t)),t.create=function(){return new Sha1},t.update=function(e){return t.create().update(e)};for(var e=0;e>2]|=t[i]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=64?(this.block=s[16],this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha1.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha1.prototype.hash=function(){var t,e,n=this.h0,r=this.h1,i=this.h2,o=this.h3,s=this.h4,a=this.blocks;for(t=16;t<80;++t)e=a[t-3]^a[t-8]^a[t-14]^a[t-16],a[t]=e<<1|e>>>31;for(t=0;t<20;t+=5)n=(e=(r=(e=(i=(e=(o=(e=(s=(e=n<<5|n>>>27)+(r&i|~r&o)+s+1518500249+a[t]<<0)<<5|s>>>27)+(n&(r=r<<30|r>>>2)|~n&i)+o+1518500249+a[t+1]<<0)<<5|o>>>27)+(s&(n=n<<30|n>>>2)|~s&r)+i+1518500249+a[t+2]<<0)<<5|i>>>27)+(o&(s=s<<30|s>>>2)|~o&n)+r+1518500249+a[t+3]<<0)<<5|r>>>27)+(i&(o=o<<30|o>>>2)|~i&s)+n+1518500249+a[t+4]<<0,i=i<<30|i>>>2;for(;t<40;t+=5)n=(e=(r=(e=(i=(e=(o=(e=(s=(e=n<<5|n>>>27)+(r^i^o)+s+1859775393+a[t]<<0)<<5|s>>>27)+(n^(r=r<<30|r>>>2)^i)+o+1859775393+a[t+1]<<0)<<5|o>>>27)+(s^(n=n<<30|n>>>2)^r)+i+1859775393+a[t+2]<<0)<<5|i>>>27)+(o^(s=s<<30|s>>>2)^n)+r+1859775393+a[t+3]<<0)<<5|r>>>27)+(i^(o=o<<30|o>>>2)^s)+n+1859775393+a[t+4]<<0,i=i<<30|i>>>2;for(;t<60;t+=5)n=(e=(r=(e=(i=(e=(o=(e=(s=(e=n<<5|n>>>27)+(r&i|r&o|i&o)+s-1894007588+a[t]<<0)<<5|s>>>27)+(n&(r=r<<30|r>>>2)|n&i|r&i)+o-1894007588+a[t+1]<<0)<<5|o>>>27)+(s&(n=n<<30|n>>>2)|s&r|n&r)+i-1894007588+a[t+2]<<0)<<5|i>>>27)+(o&(s=s<<30|s>>>2)|o&n|s&n)+r-1894007588+a[t+3]<<0)<<5|r>>>27)+(i&(o=o<<30|o>>>2)|i&s|o&s)+n-1894007588+a[t+4]<<0,i=i<<30|i>>>2;for(;t<80;t+=5)n=(e=(r=(e=(i=(e=(o=(e=(s=(e=n<<5|n>>>27)+(r^i^o)+s-899497514+a[t]<<0)<<5|s>>>27)+(n^(r=r<<30|r>>>2)^i)+o-899497514+a[t+1]<<0)<<5|o>>>27)+(s^(n=n<<30|n>>>2)^r)+i-899497514+a[t+2]<<0)<<5|i>>>27)+(o^(s=s<<30|s>>>2)^n)+r-899497514+a[t+3]<<0)<<5|r>>>27)+(i^(o=o<<30|o>>>2)^s)+n-899497514+a[t+4]<<0,i=i<<30|i>>>2;this.h0=this.h0+n<<0,this.h1=this.h1+r<<0,this.h2=this.h2+i<<0,this.h3=this.h3+o<<0,this.h4=this.h4+s<<0},Sha1.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,r=this.h3,i=this.h4;return HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]},Sha1.prototype.toString=Sha1.prototype.hex,Sha1.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,r=this.h3,i=this.h4;return[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24&255,n>>16&255,n>>8&255,255&n,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i]},Sha1.prototype.array=Sha1.prototype.digest,Sha1.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(20),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),t};var exports=createMethod();COMMON_JS?module.exports=exports:(root.sha1=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(6),__webpack_require__(11))},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return M(t).length;default:if(r)return H(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){var o,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var c=-1;for(o=n;oa&&(n=a-u),o=n;o>=0;o--){for(var f=!0,l=0;li&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function A(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function R(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:h>223?3:h>191?2:1;if(i+f<=n)switch(f){case 1:h<128&&(c=h);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&h)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&h)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(t){var e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);var n="",r=0;for(;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return U(this,e,n);case"utf8":case"utf-8":return R(this,e,n);case"ascii":return C(this,e,n);case"latin1":case"binary":return _(this,e,n);case"base64":return A(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var o=i-r,s=n-e,a=Math.min(o,s),h=this.slice(r,i),c=t.slice(e,n),f=0;fi)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return S(this,t,e,n);case"base64":return E(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function C(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;ir)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function D(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function O(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function k(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function P(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function $(t,e,n,r,o){return o||P(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function N(t,e,n,r,o){return o||P(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||B(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||B(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||B(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||B(t,e,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||B(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||B(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||B(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||B(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||B(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||B(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||B(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||D(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):k(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);D(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);D(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):k(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return $(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return $(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return N(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return N(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function M(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function K(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(11))},function(t,e,n){"use strict";e.byteLength=function(t){var e=h(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){for(var e,n=h(t),r=n[0],s=n[1],a=new o(function(t,e,n){return 3*(e+n)/4-n}(0,r,s)),u=0,c=s>0?r-4:r,f=0;f>16&255,a[u++]=e>>8&255,a[u++]=255&e;2===s&&(e=i[t.charCodeAt(f)]<<2|i[t.charCodeAt(f+1)]>>4,a[u++]=255&e);1===s&&(e=i[t.charCodeAt(f)]<<10|i[t.charCodeAt(f+1)]<<4|i[t.charCodeAt(f+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e);return a},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;sa?a:s+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,n){for(var i,o,s=[],a=e;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,u=(1<>1,c=-7,f=n?i-1:0,l=n?-1:1,p=t[e+f];for(f+=l,o=p&(1<<-c)-1,p>>=-c,c+=a;c>0;o=256*o+t[e+f],f+=l,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+t[e+f],f+=l,c-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=h}return(p?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,u,h=8*o-i-1,c=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?l/u:l*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[n+p]=255&s,p+=d,s/=256,h-=8);t[n+p-d]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";t.exports=n(39)},function(t,e,n){var r,i,o;i=[e],void 0===(o="function"==typeof(r=function(t){var e;function n(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function r(){return new n(null)}"Microsoft Internet Explorer"==navigator.appName?(n.prototype.am=function(t,e,n,r,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],h=this[t++]>>15,c=a*u+h*s;u=s*u+((32767&c)<<15)+n[r]+(1073741823&i),i=(u>>>30)+(c>>>15)+a*h+(i>>>30),n[r++]=1073741823&u}return i},e=30):"Netscape"!=navigator.appName?(n.prototype.am=function(t,e,n,r,i,o){for(;--o>=0;){var s=e*this[t++]+n[r]+i;i=Math.floor(s/67108864),n[r++]=67108863&s}return i},e=26):(n.prototype.am=function(t,e,n,r,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],h=this[t++]>>14,c=a*u+h*s;u=s*u+((16383&c)<<14)+n[r]+i,i=(u>>28)+(c>>14)+a*h,n[r++]=268435455&u}return i},e=28),n.prototype.DB=e,n.prototype.DM=(1<>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function l(t){this.m=t}function p(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function b(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function S(){}function E(t){return t}function T(t){this.r2=r(),this.q3=r(),n.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}l.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},l.prototype.revert=function(t){return t},l.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},l.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},l.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},p.prototype.convert=function(t){var e=r();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(n.ZERO)>0&&this.m.subTo(e,e),e},p.prototype.revert=function(t){var e=r();return t.copyTo(e),this.reduce(e),e},p.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},p.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},p.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},n.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},n.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},n.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var i=t.length,o=!1,s=0;--i>=0;){var a=8==r?255&t[i]:h(t,i);a<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+r>this.DB?(this[this.t-1]|=(a&(1<>this.DB-s):this[this.t-1]|=a<=this.DB&&(s-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t},n.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s},n.prototype.drShiftTo=function(t,e){for(var n=t;n=0;--n)e[n+s+1]=this[n]>>i|a,a=(this[n]&o)<=0;--n)e[n]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},n.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)e.t=0;else{var r=t%this.DB,i=this.DB-r,o=(1<>r;for(var s=n+1;s>r;r>0&&(e[this.t-n-1]|=(this.s&o)<>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()},n.prototype.multiplyTo=function(t,e){var r=this.abs(),i=t.abs(),o=r.t;for(e.t=o+i.t;--o>=0;)e[o]=0;for(o=0;o=0;)t[n]=0;for(n=0;n=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()},n.prototype.divRemTo=function(t,e,i){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t0?(o.lShiftTo(c,a),s.lShiftTo(c,i)):(o.copyTo(a),s.copyTo(i));var l=a.t,p=a[l-1];if(0!=p){var d=p*(1<1?a[l-2]>>this.F2:0),g=this.FV/d,m=(1<=0&&(i[i.t++]=1,i.subTo(b,i)),n.ONE.dlShiftTo(l,b),b.subTo(a,a);a.t=0;){var S=i[--y]==p?this.DM:Math.floor(i[y]*g+(i[y-1]+v)*m);if((i[y]+=a.am(0,S,i,w,0,l))0&&i.rShiftTo(c,i),u<0&&n.ZERO.subTo(i,i)}}},n.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},n.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},n.prototype.exp=function(t,e){if(t>4294967295||t<1)return n.ONE;var i=r(),o=r(),s=e.convert(this),a=f(t)-1;for(s.copyTo(i);--a>=0;)if(e.sqrTo(i,o),(t&1<0)e.mulTo(o,s,i);else{var u=i;i=o,o=u}return e.revert(i)},n.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,r=(1<0)for(a>a)>0&&(i=!0,o=u(n));s>=0;)a>(a+=this.DB-e)):(n=this[s]>>(a-=e)&r,a<=0&&(a+=this.DB,--s)),n>0&&(i=!0),i&&(o+=u(n));return i?o:"0"},n.prototype.negate=function(){var t=r();return n.ZERO.subTo(this,t),t},n.prototype.abs=function(){return this.s<0?this.negate():this},n.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0},n.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+f(this[this.t-1]^this.s&this.DM)},n.prototype.mod=function(t){var e=r();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(n.ZERO)>0&&t.subTo(e,e),e},n.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new l(e):new p(e),this.exp(t,n)},n.ZERO=c(0),n.ONE=c(1),S.prototype.convert=E,S.prototype.revert=E,S.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},S.prototype.sqrTo=function(t,e){t.squareTo(e)},T.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=r();return t.copyTo(e),this.reduce(e),e},T.prototype.revert=function(t){return t},T.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var A=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],R=(1<<26)/A[A.length-1];function x(){this.i=0,this.j=0,this.S=new Array}n.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},n.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),i=c(n),o=r(),s=r(),a="";for(this.divRemTo(i,o,s);o.signum()>0;)a=(n+s.intValue()).toString(t).substr(1)+a,o.divRemTo(i,o,s);return s.intValue().toString(t)+a},n.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),i=Math.pow(e,r),o=!1,s=0,a=0,u=0;u=r&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),o&&n.ZERO.subTo(this,this)},n.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(n.ONE.shiftLeft(t-1),g,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(n.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),e.nextBytes(i),o>0?i[0]&=(1<>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[n++]=r:r<-1&&(e[n++]=this.DV+r),e.t=n,e.clamp()},n.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},n.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},n.prototype.multiplyLowerTo=function(t,e,n){var r,i=Math.min(this.t+t.t,e);for(n.s=0,n.t=i;i>0;)n[--i]=0;for(r=n.t-this.t;i=0;)n[r]=0;for(r=Math.max(e-this.t,0);r0)if(0==e)n=this[0]%t;else for(var r=this.t-1;r>=0;--r)n=(e*n+this[r])%t;return n},n.prototype.millerRabin=function(t){var e=this.subtract(n.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var o=e.shiftRight(i);(t=t+1>>1)>A.length&&(t=A.length);for(var s=r(),a=0;a>24},n.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},n.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},n.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var n,r=this.DB-t*this.DB%8,i=0;if(t-- >0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this[t]&(1<>(r+=this.DB-8)):(n=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e},n.prototype.equals=function(t){return 0==this.compareTo(t)},n.prototype.min=function(t){return this.compareTo(t)<0?this:t},n.prototype.max=function(t){return this.compareTo(t)>0?this:t},n.prototype.and=function(t){var e=r();return this.bitwiseTo(t,d,e),e},n.prototype.or=function(t){var e=r();return this.bitwiseTo(t,g,e),e},n.prototype.xor=function(t){var e=r();return this.bitwiseTo(t,m,e),e},n.prototype.andNot=function(t){var e=r();return this.bitwiseTo(t,y,e),e},n.prototype.not=function(){for(var t=r(),e=0;e=this.t?0!=this.s:0!=(this[e]&1<1){var g=r();for(i.sqrTo(a[1],g);u<=d;)a[u]=r(),i.mulTo(g,a[u-2],a[u]),u+=2}var m,v,y=t.t-1,w=!0,b=r();for(o=f(t[y])-1;y>=0;){for(o>=h?m=t[y]>>o-h&d:(m=(t[y]&(1<0&&(m|=t[y-1]>>this.DB+o-h)),u=n;0==(1&m);)m>>=1,--u;if((o-=u)<0&&(o+=this.DB,--y),w)a[m].copyTo(s),w=!1;else{for(;u>1;)i.sqrTo(s,b),i.sqrTo(b,s),u-=2;u>0?i.sqrTo(s,b):(v=s,s=b,b=v),i.mulTo(b,a[m],s)}for(;y>=0&&0==(t[y]&1<=0?(r.subTo(i,r),e&&o.subTo(a,o),s.subTo(u,s)):(i.subTo(r,i),e&&a.subTo(o,a),u.subTo(s,u))}return 0!=i.compareTo(n.ONE)?n.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},n.prototype.pow=function(t){return this.exp(t,new S)},n.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var r=e;e=n,n=r}var i=e.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return e;for(i0&&(e.rShiftTo(o,e),n.rShiftTo(o,n));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},n.prototype.isProbablePrime=function(t){var e,n=this.abs();if(1==n.t&&n[0]<=A[A.length-1]){for(e=0;e=256||U>=I)window.removeEventListener?window.removeEventListener("mousemove",O,!1):window.detachEvent&&window.detachEvent("onmousemove",O);else try{var e=t.x+t.y;_[U++]=255&e,this.count+=1}catch(t){}};window.addEventListener?window.addEventListener("mousemove",O,!1):window.attachEvent&&window.attachEvent("onmousemove",O)}function k(){if(null==C){for(C=new x;U0&&e.length>0&&(this.n=$(t,16),this.e=parseInt(e,16))},N.prototype.encrypt=function(t){var e=function(t,e){if(e=0&&e>0;){var o=t.charCodeAt(i--);o<128?r[--e]=o:o>127&&o<2048?(r[--e]=63&o|128,r[--e]=o>>6|192):(r[--e]=63&o|128,r[--e]=o>>6&63|128,r[--e]=o>>12|224)}r[--e]=0;for(var s=new P,a=new Array;e>2;){for(a[0]=0;0==a[0];)s.nextBytes(a);r[--e]=a[0]}return r[--e]=2,r[--e]=0,new n(r)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var r=this.doPublic(e);if(null==r)return null;var i=r.toString(16);return 0==(1&i.length)?i:"0"+i},N.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),n=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(n)<0;)e=e.add(this.p);return e.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},N.prototype.setPrivate=function(t,e,n){null!=t&&null!=e&&t.length>0&&e.length>0&&(this.n=$(t,16),this.e=parseInt(e,16),this.d=$(n,16))},N.prototype.setPrivateEx=function(t,e,n,r,i,o,s,a){null!=t&&null!=e&&t.length>0&&e.length>0&&(this.n=$(t,16),this.e=parseInt(e,16),this.d=$(n,16),this.p=$(r,16),this.q=$(i,16),this.dmp1=$(o,16),this.dmq1=$(s,16),this.coeff=$(a,16))},N.prototype.generate=function(t,e){var r=new P,i=t>>1;this.e=parseInt(e,16);for(var o=new n(e,16);;){for(;this.p=new n(t-i,1,r),0!=this.p.subtract(n.ONE).gcd(o).compareTo(n.ONE)||!this.p.isProbablePrime(10););for(;this.q=new n(i,1,r),0!=this.q.subtract(n.ONE).gcd(o).compareTo(n.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var s=this.p;this.p=this.q,this.q=s}var a=this.p.subtract(n.ONE),u=this.q.subtract(n.ONE),h=a.multiply(u);if(0==h.gcd(o).compareTo(n.ONE)){this.n=this.p.multiply(this.q),this.d=o.modInverse(h),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(u),this.coeff=this.q.modInverse(this.p);break}}},N.prototype.decrypt=function(t){var e=$(t,16),n=this.doPrivate(e);return null==n?null:function(t,e){for(var n=t.toByteArray(),r=0;r=n.length)return null;for(var i="";++r191&&o<224?(i+=String.fromCharCode((31&o)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&o)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return i}(n,this.n.bitLength()+7>>3)},N.prototype.generateAsync=function(t,e,i){var o=new P,s=t>>1;this.e=parseInt(e,16);var a=new n(e,16),u=this,h=function(){var e=function(){if(u.p.compareTo(u.q)<=0){var t=u.p;u.p=u.q,u.q=t}var e=u.p.subtract(n.ONE),r=u.q.subtract(n.ONE),o=e.multiply(r);0==o.gcd(a).compareTo(n.ONE)?(u.n=u.p.multiply(u.q),u.d=a.modInverse(o),u.dmp1=u.d.mod(e),u.dmq1=u.d.mod(r),u.coeff=u.q.modInverse(u.p),setTimeout(function(){i()},0)):setTimeout(h,0)},c=function(){u.q=r(),u.q.fromNumberAsync(s,1,o,function(){u.q.subtract(n.ONE).gcda(a,function(t){0==t.compareTo(n.ONE)&&u.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(c,0)})})},f=function(){u.p=r(),u.p.fromNumberAsync(t-s,1,o,function(){u.p.subtract(n.ONE).gcda(a,function(t){0==t.compareTo(n.ONE)&&u.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(f,0)})})};setTimeout(f,0)};setTimeout(h,0)},n.prototype.gcda=function(t,e){var n=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(n.compareTo(r)<0){var i=n;n=r,r=i}var o=n.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)e(n);else{o0&&(n.rShiftTo(s,n),r.rShiftTo(s,r));var a=function(){(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r)),n.signum()>0?setTimeout(a,0):(s>0&&r.lShiftTo(s,r),setTimeout(function(){e(r)},0))};setTimeout(a,10)}},n.prototype.fromNumberAsync=function(t,e,r,i){if("number"==typeof e)if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(n.ONE.shiftLeft(t-1),g,this),this.isEven()&&this.dAddOffset(1,0);var o=this,s=function(){o.dAddOffset(2,0),o.bitLength()>t&&o.subTo(n.ONE.shiftLeft(t-1),o),o.isProbablePrime(e)?setTimeout(function(){i()},0):setTimeout(s,0)};setTimeout(s,0)}else{var a=new Array,u=7&t;a.length=1+(t>>3),e.nextBytes(a),u>0?a[0]&=(1<>6)+L.charAt(63&n);for(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),r+=L.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),r+=L.charAt(n>>2)+L.charAt((3&n)<<4));(3&r.length)>0;)r+=q;return r}function M(t){var e,n,r="",i=0;for(e=0;e>2),n=3&v,i=1):1==i?(r+=u(n<<2|v>>4),n=15&v,i=2):2==i?(r+=u(n),r+=u(v>>2),n=3&v,i=3):(r+=u(n<<2|v>>4),r+=u(15&v),i=0));return 1==i&&(r+=u(n<<2)),r}var K=K||{};K.env=K.env||{};var V=K,J=Object.prototype,j=["toString","valueOf"];K.env.parseUA=function(t){var e,n=function(t){var e=0;return parseFloat(t.replace(/\./g,function(){return 1==e++?"":"."}))},r=navigator,i={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,webos:0,caja:r&&r.cajaVersion,secure:!1,os:null},o=t||navigator&&navigator.userAgent,s=window&&window.location,a=s&&s.href;return i.secure=a&&0===a.toLowerCase().indexOf("https"),o&&(/windows|win32/i.test(o)?i.os="windows":/macintosh/i.test(o)?i.os="macintosh":/rhino/i.test(o)&&(i.os="rhino"),/KHTML/.test(o)&&(i.webkit=1),(e=o.match(/AppleWebKit\/([^\s]*)/))&&e[1]&&(i.webkit=n(e[1]),/ Mobile\//.test(o)?(i.mobile="Apple",(e=o.match(/OS ([^\s]*)/))&&e[1]&&(e=n(e[1].replace("_","."))),i.ios=e,i.ipad=i.ipod=i.iphone=0,(e=o.match(/iPad|iPod|iPhone/))&&e[0]&&(i[e[0].toLowerCase()]=i.ios)):((e=o.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/))&&(i.mobile=e[0]),/webOS/.test(o)&&(i.mobile="WebOS",(e=o.match(/webOS\/([^\s]*);/))&&e[1]&&(i.webos=n(e[1]))),/ Android/.test(o)&&(i.mobile="Android",(e=o.match(/Android ([^\s]*);/))&&e[1]&&(i.android=n(e[1])))),(e=o.match(/Chrome\/([^\s]*)/))&&e[1]?i.chrome=n(e[1]):(e=o.match(/AdobeAIR\/([^\s]*)/))&&(i.air=e[0])),i.webkit||((e=o.match(/Opera[\s\/]([^\s]*)/))&&e[1]?(i.opera=n(e[1]),(e=o.match(/Version\/([^\s]*)/))&&e[1]&&(i.opera=n(e[1])),(e=o.match(/Opera Mini[^;]*/))&&(i.mobile=e[0])):(e=o.match(/MSIE\s([^;]*)/))&&e[1]?i.ie=n(e[1]):(e=o.match(/Gecko\/([^\s]*)/))&&(i.gecko=1,(e=o.match(/rv:([^\s\)]*)/))&&e[1]&&(i.gecko=n(e[1]))))),i},K.env.ua=K.env.parseUA(),K.isFunction=function(t){return"function"==typeof t||"[object Function]"===J.toString.apply(t)},K._IEEnumFix=K.env.ua.ie?function(t,e){var n,r,i;for(n=0;n15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var r=128+n;return r.toString(16)+e},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},KJUR.asn1.DERAbstractString=function(t){KJUR.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},K.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractTime=function(t){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){utc=t.getTime()+6e4*t.getTimezoneOffset();var e=new Date(utc);return e},this.formatDate=function(t,e){var n=this.zeroPadding,r=this.localDateToUTC(t),i=String(r.getFullYear());"utc"==e&&(i=i.substr(2,2));var o=n(String(r.getMonth()+1),2),s=n(String(r.getDate()),2),a=n(String(r.getHours()),2),u=n(String(r.getMinutes()),2),h=n(String(r.getSeconds()),2);return i+o+s+a+u+h+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setByDateValue=function(t,e,n,r,i,o){var s=new Date(Date.UTC(t,e-1,n,r,i,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},K.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractStructured=function(t){KJUR.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},K.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object),KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},K.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object),KJUR.asn1.DERInteger=function(t){KJUR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new n(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):void 0!==t.hex&&this.setValueHex(t.hex))},K.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object),KJUR.asn1.DERBitString=function(t){KJUR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7=2?(o[o.length]=s,s=0,a=0):s<<=4}}if(a)throw"Hex encoding incomplete: 4 bits missing";return o}};window.Hex=n}(),function(t){"use strict";var e,n={decode:function(t){var n;if(void 0===e){var r="= \f\n\r\t \u2028\u2029";for(e=[],n=0;n<64;++n)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n)]=n;for(n=0;n=4?(i[i.length]=o>>16,i[i.length]=o>>8&255,i[i.length]=255&o,o=0,s=0):o<<=6}}switch(s){case 1:throw"Base64 encoding incomplete: at least 2 bits missing";case 2:i[i.length]=o>>10;break;case 3:i[i.length]=o>>16,i[i.length]=o>>8&255}return i},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=n.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw"RegExp out of sync";t=e[2]}return n.decode(t)}};window.Base64=n}(),function(t){"use strict";var e={tag:function(t,e){var n=document.createElement(t);return n.className=e,n},text:function(t){return document.createTextNode(t)}};function n(t,e){t instanceof n?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=e)}function r(t,e,n,r,i){this.stream=t,this.header=e,this.length=n,this.tag=r,this.sub=i}n.prototype.get=function(t){if(void 0===t&&(t=this.pos++),t>=this.enc.length)throw"Requesting byte offset "+t+" on a stream of length "+this.enc.length;return this.enc[t]},n.prototype.hexDigits="0123456789ABCDEF",n.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},n.prototype.hexDump=function(t,e,n){for(var r="",i=t;i191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(r++)):String.fromCharCode((15&i)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n},n.prototype.parseStringBMP=function(t,e){for(var n="",r=t;r4){n<<=3;var r=this.get(t);if(0===r)n-=8;else for(;r<128;)r<<=1,--n;return"("+n+" bit)"}for(var i=0,o=t;ot;--s){for(var a=this.get(s),u=o;u<8;++u)i+=a>>u&1?"1":"0";o=0}}return i},n.prototype.parseOctetString=function(t,e){var n=e-t,r="("+n+" byte) ";n>100&&(e=t+100);for(var i=t;i100&&(r+="…"),r},n.prototype.parseOID=function(t,e){for(var n="",r=0,i=0,o=t;o=31?"bigint":r);r=i=0}}return n},r.prototype.typeName=function(){if(void 0===this.tag)return"unknown";var t=this.tag>>6,e=(this.tag,31&this.tag);switch(t){case 0:switch(e){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString";default:return"Universal_"+e.toString(16)}case 1:return"Application_"+e.toString(16);case 2:return"["+e+"]";case 3:return"Private_"+e.toString(16)}},r.prototype.reSeemsASCII=/^[ -~]+$/,r.prototype.content=function(){if(void 0===this.tag)return null;var t=this.tag>>6,e=31&this.tag,n=this.posContent(),r=Math.abs(this.length);if(0!==t){if(null!==this.sub)return"("+this.sub.length+" elem)";var i=this.stream.parseStringISO(n,n+Math.min(r,100));return this.reSeemsASCII.test(i)?i.substring(0,200)+(i.length>200?"…":""):this.stream.parseOctetString(n,n+r)}switch(e){case 1:return 0===this.stream.get(n)?"false":"true";case 2:return this.stream.parseInteger(n,n+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(n,n+r);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(n,n+r);case 6:return this.stream.parseOID(n,n+r);case 16:case 17:return"("+this.sub.length+" elem)";case 12:return this.stream.parseStringUTF(n,n+r);case 18:case 19:case 20:case 21:case 22:case 26:return this.stream.parseStringISO(n,n+r);case 30:return this.stream.parseStringBMP(n,n+r);case 23:case 24:return this.stream.parseTime(n,n+r)}return null},r.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},r.prototype.print=function(t){if(void 0===t&&(t=""),document.writeln(t+this),null!==this.sub){t+=" ";for(var e=0,n=this.sub.length;e=0&&(e+="+"),e+=this.length,32&this.tag?e+=" (constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(e+=" (encapsulates)"),e+="\n",null!==this.sub){t+=" ";for(var n=0,r=this.sub.length;n",r+="Length: "+this.header+"+",this.length>=0?r+=this.length:r+=-this.length+" (undefined)",32&this.tag?r+="
(constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(r+="
(encapsulates)"),null!==i&&(r+="
Value:
"+i+"","object"==typeof oids&&6==this.tag)){var a=oids[i];a&&(a.d&&(r+="
"+a.d),a.c&&(r+="
"+a.c),a.w&&(r+="
(warning!)"))}s.innerHTML=r,t.appendChild(s);var u=e.tag("div","sub");if(null!==this.sub)for(var h=0,c=this.sub.length;h=o)){var s=e.tag("span",n);s.appendChild(e.text(r.hexDump(i,o))),t.appendChild(s)}},r.prototype.toHexDOM=function(t){var n=e.tag("span","hex");if(void 0===t&&(t=n),this.head.hexNode=n,this.head.onmouseover=function(){this.hexNode.className="hexCurrent"},this.head.onmouseout=function(){this.hexNode.className="hex"},n.asn1=this,n.onmouseover=function(){var e=!t.selected;e&&(t.selected=this.asn1,this.className="hexCurrent"),this.asn1.fakeHover(e)},n.onmouseout=function(){var e=t.selected==this.asn1;this.asn1.fakeOut(e),e&&(t.selected=null,this.className="hex")},this.toHexDOM_sub(n,"tag",this.stream,this.posStart(),this.posStart()+1),this.toHexDOM_sub(n,this.length>=0?"dlen":"ulen",this.stream,this.posStart()+1,this.posContent()),null===this.sub)n.appendChild(e.text(this.stream.hexDump(this.posContent(),this.posEnd())));else if(this.sub.length>0){var r=this.sub[0],i=this.sub[this.sub.length-1];this.toHexDOM_sub(n,"intro",this.stream,this.posContent(),r.posStart());for(var o=0,s=this.sub.length;o3)throw"Length over 24 bits not supported at position "+(t.pos-1);if(0===n)return-1;e=0;for(var r=0;r4)return!1;var o=new n(i);3==t&&o.get();var s=o.get();if(s>>6&1)return!1;try{var a=r.decodeLength(o);return o.pos-i.pos+a==e}catch(t){return!1}},r.decode=function(t){t instanceof n||(t=new n(t,0));var e=new n(t),i=t.get(),o=r.decodeLength(t),s=t.pos-e.pos,a=null;if(r.hasContent(i,o,t)){var u=t.pos;if(3==i&&t.get(),a=[],o>=0){for(var h=u+o;t.pos=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){u.headers[t]={}}),r.forEach(["post","put","patch"],function(t){u.headers[t]=r.merge(o)}),t.exports=u}).call(this,n(4))},function(t,e,n){t.exports=n(12)},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r1)for(var n=1;ndiv,.container2>div,.container3>div{width:6px;height:6px;background-color:#00a1ea;border-radius:100%;position:absolute;-webkit-animation:bouncedelay 1.2s infinite ease-in-out;animation:bouncedelay 1.2s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.spinner .spinner-container{position:absolute;width:100%;height:100%}.container2{-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}.container3{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}.circle1{top:0;left:0}.circle2{top:0;right:0}.circle3{right:0;bottom:0}.circle4{left:0;bottom:0}.container2 .circle1{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.container3 .circle1{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.container1 .circle2{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.container2 .circle2{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}.container3 .circle2{-webkit-animation-delay:-0.7s;animation-delay:-0.7s}.container1 .circle3{-webkit-animation-delay:-0.6s;animation-delay:-0.6s}.container2 .circle3{-webkit-animation-delay:-0.5s;animation-delay:-0.5s}.container3 .circle3{-webkit-animation-delay:-0.4s;animation-delay:-0.4s}.container1 .circle4{-webkit-animation-delay:-0.3s;animation-delay:-0.3s}.container2 .circle4{-webkit-animation-delay:-0.2s;animation-delay:-0.2s}.container3 .circle4{-webkit-animation-delay:-0.1s;animation-delay:-0.1s}@-webkit-keyframes bouncedelay{0%,80%,100%{-webkit-transform:scale(0.0)}40%{-webkit-transform:scale(1.0)}}@keyframes bouncedelay{0%,80%,100%{transform:scale(0.0);-webkit-transform:scale(0.0)}40%{transform:scale(1.0);-webkit-transform:scale(1.0)}}";m.type="text/css",m.styleSheet?m.styleSheet.cssText=y:m.innerHTML=y,document.getElementsByTagName("head")[0].appendChild(m);var v=function(){var t=document.getElementById("authing__spinner");l.removeChild(t)},w=function(t){var e=document.createElement("span");return e.class="authing__heading-subtitle",e.style=d?"display: block;font-weight: 400;font-size: 12px;color: #888;":"display: block;font-weight: 400;font-size: 15px;color: #888;ine-height: 48px;",e.innerHTML=t,e},b=function(t){var e=document.createElement("img");return e.class="authing__qrcode",e.src=t,e.width=240,e.height=240,e},S=function(t,e){var n=document.createElement("div");n.id="authing__retry",n.style="text-align:center;width: 240px;height: 240px;position: absolute;left: 50%;top: 0px;margin-left: -120px;background-color: rgba(0,0,0, 0.5);line-height:240px;color:#fff;font-weight:600;";var r=document.createElement("a");return r.innerHTML=t,r.style="color:#fff;border-bottom: 1px solid #fff;cursor: pointer;",r.onclick=e,n.appendChild(r),n};function E(t,e){var n=w(e);(p=document.createElement("div")).id="authing__qrcode-wrapper",p.style="text-align: center;position: relative;";var r=b("https://usercontents.authing.cn/authing_user_manager_wxapp_qrcode.jpg");r.style=d?"margin-top: 16px;":"margin-top: 12px;",r.onload=function(){v()};var i=S("点击重试",function(){g()});p.appendChild(r),p.appendChild(i),p.appendChild(n),t.appendChild(p)}(g=function(){l.innerHTML='
',e.genQRCode(e.opts.clientId).then(function(t){if(200!==(t=t.data).code)E(l,t.message),a&&a(t);else{var n=t.data;if(f&&f(n),sessionStorage.qrcodeUrl=n.qrcode,sessionStorage.qrcode=JSON.stringify(n),l){(p=document.createElement("div")).id="authing__qrcode-wrapper",p.style="text-align: center;position: relative;";var s=b(n.qrcode);s.onload=function(){v(),c&&c(n);var t=0;t=setInterval(function(){h&&h(t),e.checkQR().then(function(e){var n=e.data.data;if(200===n.code)if(clearInterval(t),o){var r=S("扫码成功,即将跳转",function(){window.location.href=n.redirect+"?code=200&data="+JSON.stringify(n.data)});setTimeout(function(){window.location.href=n.redirect+"?code=200&data="+JSON.stringify(n.data)},600),p.appendChild(r)}else{var i=S("扫码成功");p.appendChild(i),u&&u(n)}})},r)};var d=w(i||"使用 微信 或小程序 身份管家 扫码登录");p.appendChild(s),p.appendChild(d),l.appendChild(p)}}}).catch(function(t){E(l,"网络出错,请重试"),a&&a(t)})})()},getVerificationCode:function(t){if(!t)throw"phone is not provided";var e=a.services.user.host.replace("/graphql","")+"/send_smscode/"+t+"/"+this.opts.clientId;return o.get(e).then(function(t){if(200!==t.data.code)throw t.data;return t.data})},loginByPhoneCode:function(t){if(!t)throw"options is not provided.";var e=this;this.haveAccess();var n={registerInClient:this.opts.clientId,phone:t.phone,phoneCode:parseInt(t.phoneCode,10)};return a.inBrowser&&(n.browser=window.navigator.userAgent),this.UserClient.request({operationName:"login",query:"mutation login($phone: String, $phoneCode: Int, $registerInClient: String!, $browser: String) {\n login(phone: $phone, phoneCode: $phoneCode, registerInClient: $registerInClient, browser: $browser) {\n _id\n email\n unionid\n openid\n emailVerified\n username\n nickname\n phone\n company\n photo\n browser\n token\n tokenExpiredAt\n loginsCount\n lastLogin\n lastIP\n signedUp\n blocked\n isDeleted\n }\n }",variables:n}).then(function(t){return t.login}).then(function(t){return t&&e.initUserClient(t.token),t})},queryPermissions:function(t){if(!t)throw"userId is not provided.";this.haveAccess();var e={client:this.opts.clientId,user:t};return this.ownerClient.request({operationName:"QueryRoleByUserId",query:"query QueryRoleByUserId($user: String!, $client: String!){\n queryRoleByUserId(user: $user, client: $client) {\n totalCount\n list {\n group {\n name\n permissions\n }\n }\n }\n }",variables:e}).then(function(t){return t.queryRoleByUserId})},queryRoles:function(t){if(!t)throw"options is not provided.";this.haveAccess();var e={clientId:this.opts.clientId,page:t.page,count:t.count};return this.ownerClient.request({operationName:"ClientRoles",query:"\n query ClientRoles(\n $clientId: String!\n $page: Int\n $count: Int\n ) {\n clientRoles(\n client: $clientId\n page: $page\n count: $count\n ) {\n totalCount\n list {\n _id\n name\n descriptions\n client\n createdAt\n permissions\n }\n }\n }\n ",variables:e}).then(function(t){return t.clientRoles})},createRole:function(t){if(!t)throw"options is not provided.";this.haveAccess();var e={client:this.opts.clientId,name:t.name,descriptions:t.descriptions};return this.ownerClient.request({operationName:"CreateRole",query:"\n mutation CreateRole(\n $name: String!\n $client: String!\n $descriptions: String\n ) {\n createRole(\n name: $name\n client: $client\n descriptions: $descriptions\n ) {\n _id,\n name,\n client,\n descriptions\n }\n }\n ",variables:e}).then(function(t){return t.createRole})},updateRolePermissions:function(t){if(!t)throw"options is not provided.";this.haveAccess();var e={client:this.opts.clientId,name:t.name,permissions:t.permissions,_id:t.roleId};return this.ownerClient.request({operationName:"UpdateRole",query:"\n mutation UpdateRole(\n $_id: String!\n $name: String!\n $client: String!\n $descriptions: String\n $permissions: String\n ) {\n updateRole(\n _id: $_id\n name: $name\n client: $client\n descriptions: $descriptions\n permissions: $permissions\n ) {\n _id,\n name,\n client,\n descriptions,\n permissions\n }\n }\n ",variables:e}).then(function(t){return t.updateRole})},assignUserToRole:function(t){if(!t)throw"options is not provided.";this.haveAccess();var e={client:this.opts.clientId,group:t.roleId,user:t.user};return this.ownerClient.request({operationName:"AssignUserToRole",query:"\n mutation AssignUserToRole(\n $group: String!\n $client: String!\n $user: String!\n ) {\n assignUserToRole(\n group: $group\n client: $client\n user: $user\n ) {\n totalCount,\n list {\n _id,\n client {\n _id\n },\n user {\n _id\n },\n createdAt\n }\n }\n }\n ",variables:e}).then(function(t){return t.assignUserToRole})},removeUserFromRole:function(t){if(!t)throw"options is not provided.";this.haveAccess();var e={client:this.opts.clientId,user:t.user,group:t.roleId};return this.ownerClient.request({operationName:"RemoveUserFromGroup",query:"\n mutation RemoveUserFromGroup(\n $group: String!\n $client: String!\n $user: String!\n ) {\n removeUserFromGroup(\n group: $group\n client: $client\n user: $user\n ) {\n _id,\n group {\n _id\n },\n client {\n _id\n },\n user {\n _id\n }\n }\n }\n ",variables:e}).then(function(t){return t.removeUserFromGroup})},refreshToken:function(t){if(!t)throw"options is not provided.";this.haveAccess();var e={client:this.opts.clientId,user:t.user};return this.ownerClient.request({operationName:"RefreshToken",query:"\n mutation RefreshToken(\n $client: String!\n $user: String!\n ) {\n refreshToken(\n client: $client\n user: $user\n ) {\n token\n iat\n exp\n }\n }\n ",variables:e}).then(function(t){return t.refreshToken})}},t.exports=c},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(14),s=n(1);function a(t){var e=new o(t),n=i(o.prototype.request,e);return r.extend(n,o.prototype,e),r.extend(n,e),n}var u=a(s);u.Axios=o,u.create=function(t){return a(r.merge(s,t))},u.Cancel=n(8),u.CancelToken=n(28),u.isCancel=n(7),u.all=function(t){return Promise.all(t)},u.spread=n(29),t.exports=u,t.exports.default=u},function(t,e){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(23),s=n(24);function a(t){this.defaults=t,this.interceptors={request:new o,response:new o}}a.prototype.request=function(t){"string"==typeof t&&(t=i.merge({url:arguments[0]},arguments[1])),(t=i.merge(r,{method:"get"},this.defaults,t)).method=t.method.toLowerCase();var e=[s,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},i.forEach(["delete","get","head","options"],function(t){a.prototype[t]=function(e,n){return this.request(i.merge(n||{},{method:t,url:e}))}}),i.forEach(["post","put","patch"],function(t){a.prototype[t]=function(e,n,r){return this.request(i.merge(r||{},{method:t,url:e,data:n}))}}),t.exports=a},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},function(t,e,n){"use strict";var r=n(6);t.exports=function(t,e,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,i){return t.config=e,n&&(t.code=n),t.request=r,t.response=i,t}},function(t,e,n){"use strict";var r=n(0);function i(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(r.isURLSearchParams(e))o=e.toString();else{var s=[];r.forEach(e,function(t,e){null!==t&&void 0!==t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),s.push(i(e)+"="+i(t))}))}),o=s.join("&")}return o&&(t+=(-1===t.indexOf("?")?"?":"&")+o),t}},function(t,e,n){"use strict";var r=n(0),i=["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"];t.exports=function(t){var e,n,o,s={};return t?(r.forEach(t.split("\n"),function(t){if(o=t.indexOf(":"),e=r.trim(t.substr(0,o)).toLowerCase(),n=r.trim(t.substr(o+1)),e){if(s[e]&&i.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([n]):s[e]?s[e]+", "+n:n}}),s):s}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(){this.message="String contains an invalid character"}i.prototype=new Error,i.prototype.code=5,i.prototype.name="InvalidCharacterError",t.exports=function(t){for(var e,n,o=String(t),s="",a=0,u=r;o.charAt(0|a)||(u="=",a%1);s+=u.charAt(63&e>>8-a%1*8)){if((n=o.charCodeAt(a+=.75))>255)throw new i;e=e<<8|n}return s}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var r=n(0);function i(){this.handlers=[]}i.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=i},function(t,e,n){"use strict";var r=n(0),i=n(25),o=n(7),s=n(1),a=n(26),u=n(27);function h(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return h(t),t.baseURL&&!a(t.url)&&(t.url=u(t.baseURL,t.url)),t.headers=t.headers||{},t.data=i(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||s.adapter)(t).then(function(e){return h(t),e.data=i(e.data,e.headers,t.transformResponse),e},function(e){return o(e)||(h(t),e&&e.response&&(e.response.data=i(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(8);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new r(t),e(n.reason))})}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var t;return{token:new i(function(e){t=e}),cancel:t}},t.exports=i},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__;!function(){"use strict";var root="object"==typeof window?window:{},NODE_JS=!root.JS_SHA1_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS&&(root=global);var COMMON_JS=!root.JS_SHA1_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(31),HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[],createOutputMethod=function(t){return function(e){return new Sha1(!0).update(e)[t]()}},createMethod=function(){var t=createOutputMethod("hex");NODE_JS&&(t=nodeWrap(t)),t.create=function(){return new Sha1},t.update=function(e){return t.create().update(e)};for(var e=0;e>2]|=t[i]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=64?(this.block=s[16],this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha1.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha1.prototype.hash=function(){var t,e,n=this.h0,r=this.h1,i=this.h2,o=this.h3,s=this.h4,a=this.blocks;for(t=16;t<80;++t)e=a[t-3]^a[t-8]^a[t-14]^a[t-16],a[t]=e<<1|e>>>31;for(t=0;t<20;t+=5)n=(e=(r=(e=(i=(e=(o=(e=(s=(e=n<<5|n>>>27)+(r&i|~r&o)+s+1518500249+a[t]<<0)<<5|s>>>27)+(n&(r=r<<30|r>>>2)|~n&i)+o+1518500249+a[t+1]<<0)<<5|o>>>27)+(s&(n=n<<30|n>>>2)|~s&r)+i+1518500249+a[t+2]<<0)<<5|i>>>27)+(o&(s=s<<30|s>>>2)|~o&n)+r+1518500249+a[t+3]<<0)<<5|r>>>27)+(i&(o=o<<30|o>>>2)|~i&s)+n+1518500249+a[t+4]<<0,i=i<<30|i>>>2;for(;t<40;t+=5)n=(e=(r=(e=(i=(e=(o=(e=(s=(e=n<<5|n>>>27)+(r^i^o)+s+1859775393+a[t]<<0)<<5|s>>>27)+(n^(r=r<<30|r>>>2)^i)+o+1859775393+a[t+1]<<0)<<5|o>>>27)+(s^(n=n<<30|n>>>2)^r)+i+1859775393+a[t+2]<<0)<<5|i>>>27)+(o^(s=s<<30|s>>>2)^n)+r+1859775393+a[t+3]<<0)<<5|r>>>27)+(i^(o=o<<30|o>>>2)^s)+n+1859775393+a[t+4]<<0,i=i<<30|i>>>2;for(;t<60;t+=5)n=(e=(r=(e=(i=(e=(o=(e=(s=(e=n<<5|n>>>27)+(r&i|r&o|i&o)+s-1894007588+a[t]<<0)<<5|s>>>27)+(n&(r=r<<30|r>>>2)|n&i|r&i)+o-1894007588+a[t+1]<<0)<<5|o>>>27)+(s&(n=n<<30|n>>>2)|s&r|n&r)+i-1894007588+a[t+2]<<0)<<5|i>>>27)+(o&(s=s<<30|s>>>2)|o&n|s&n)+r-1894007588+a[t+3]<<0)<<5|r>>>27)+(i&(o=o<<30|o>>>2)|i&s|o&s)+n-1894007588+a[t+4]<<0,i=i<<30|i>>>2;for(;t<80;t+=5)n=(e=(r=(e=(i=(e=(o=(e=(s=(e=n<<5|n>>>27)+(r^i^o)+s-899497514+a[t]<<0)<<5|s>>>27)+(n^(r=r<<30|r>>>2)^i)+o-899497514+a[t+1]<<0)<<5|o>>>27)+(s^(n=n<<30|n>>>2)^r)+i-899497514+a[t+2]<<0)<<5|i>>>27)+(o^(s=s<<30|s>>>2)^n)+r-899497514+a[t+3]<<0)<<5|r>>>27)+(i^(o=o<<30|o>>>2)^s)+n-899497514+a[t+4]<<0,i=i<<30|i>>>2;this.h0=this.h0+n<<0,this.h1=this.h1+r<<0,this.h2=this.h2+i<<0,this.h3=this.h3+o<<0,this.h4=this.h4+s<<0},Sha1.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,r=this.h3,i=this.h4;return HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]},Sha1.prototype.toString=Sha1.prototype.hex,Sha1.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,r=this.h3,i=this.h4;return[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24&255,n>>16&255,n>>8&255,255&n,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i]},Sha1.prototype.array=Sha1.prototype.digest,Sha1.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(20),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),t};var exports=createMethod();COMMON_JS?module.exports=exports:(root.sha1=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(4),__webpack_require__(9))},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return M(t).length;default:if(r)return H(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var o,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var c=-1;for(o=n;oa&&(n=a-u),o=n;o>=0;o--){for(var f=!0,l=0;li&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function A(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function R(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:h>223?3:h>191?2:1;if(i+f<=n)switch(f){case 1:h<128&&(c=h);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&h)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&h)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);var n="",r=0;for(;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return U(this,e,n);case"utf8":case"utf-8":return R(this,e,n);case"ascii":return x(this,e,n);case"latin1":case"binary":return _(this,e,n);case"base64":return A(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var o=i-r,s=n-e,a=Math.min(o,s),h=this.slice(r,i),c=t.slice(e,n),f=0;fi)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return S(this,t,e,n);case"base64":return E(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function x(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;ir)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function D(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function O(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function P(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function k(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function $(t,e,n,r,o){return o||k(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function L(t,e,n,r,o){return o||k(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||B(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||B(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||B(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||B(t,e,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||B(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||B(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||B(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||B(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||B(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||B(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||B(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||D(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):P(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);D(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);D(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):P(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return $(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return $(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return L(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return L(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function M(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function K(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(9))},function(t,e,n){"use strict";e.byteLength=function(t){var e=h(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){for(var e,n=h(t),r=n[0],s=n[1],a=new o(function(t,e,n){return 3*(e+n)/4-n}(0,r,s)),u=0,c=s>0?r-4:r,f=0;f>16&255,a[u++]=e>>8&255,a[u++]=255&e;2===s&&(e=i[t.charCodeAt(f)]<<2|i[t.charCodeAt(f+1)]>>4,a[u++]=255&e);1===s&&(e=i[t.charCodeAt(f)]<<10|i[t.charCodeAt(f+1)]<<4|i[t.charCodeAt(f+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e);return a},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;sa?a:s+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,n){for(var i,o,s=[],a=e;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,u=(1<>1,c=-7,f=n?i-1:0,l=n?-1:1,p=t[e+f];for(f+=l,o=p&(1<<-c)-1,p>>=-c,c+=a;c>0;o=256*o+t[e+f],f+=l,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+t[e+f],f+=l,c-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=h}return(p?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,u,h=8*o-i-1,c=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?l/u:l*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[n+p]=255&s,p+=d,s/=256,h-=8);t[n+p-d]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";t.exports=n(39)},function(t,e,n){var r,i,o;i=[e],void 0===(o="function"==typeof(r=function(t){var e;function n(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function r(){return new n(null)}"Microsoft Internet Explorer"==navigator.appName?(n.prototype.am=function(t,e,n,r,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],h=this[t++]>>15,c=a*u+h*s;u=s*u+((32767&c)<<15)+n[r]+(1073741823&i),i=(u>>>30)+(c>>>15)+a*h+(i>>>30),n[r++]=1073741823&u}return i},e=30):"Netscape"!=navigator.appName?(n.prototype.am=function(t,e,n,r,i,o){for(;--o>=0;){var s=e*this[t++]+n[r]+i;i=Math.floor(s/67108864),n[r++]=67108863&s}return i},e=26):(n.prototype.am=function(t,e,n,r,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],h=this[t++]>>14,c=a*u+h*s;u=s*u+((16383&c)<<14)+n[r]+i,i=(u>>28)+(c>>14)+a*h,n[r++]=268435455&u}return i},e=28),n.prototype.DB=e,n.prototype.DM=(1<>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function l(t){this.m=t}function p(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function b(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function S(){}function E(t){return t}function T(t){this.r2=r(),this.q3=r(),n.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}l.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},l.prototype.revert=function(t){return t},l.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},l.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},l.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},p.prototype.convert=function(t){var e=r();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(n.ZERO)>0&&this.m.subTo(e,e),e},p.prototype.revert=function(t){var e=r();return t.copyTo(e),this.reduce(e),e},p.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},p.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},p.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},n.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},n.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},n.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var i=t.length,o=!1,s=0;--i>=0;){var a=8==r?255&t[i]:h(t,i);a<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+r>this.DB?(this[this.t-1]|=(a&(1<>this.DB-s):this[this.t-1]|=a<=this.DB&&(s-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t},n.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s},n.prototype.drShiftTo=function(t,e){for(var n=t;n=0;--n)e[n+s+1]=this[n]>>i|a,a=(this[n]&o)<=0;--n)e[n]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},n.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)e.t=0;else{var r=t%this.DB,i=this.DB-r,o=(1<>r;for(var s=n+1;s>r;r>0&&(e[this.t-n-1]|=(this.s&o)<>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()},n.prototype.multiplyTo=function(t,e){var r=this.abs(),i=t.abs(),o=r.t;for(e.t=o+i.t;--o>=0;)e[o]=0;for(o=0;o=0;)t[n]=0;for(n=0;n=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()},n.prototype.divRemTo=function(t,e,i){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t0?(o.lShiftTo(c,a),s.lShiftTo(c,i)):(o.copyTo(a),s.copyTo(i));var l=a.t,p=a[l-1];if(0!=p){var d=p*(1<1?a[l-2]>>this.F2:0),g=this.FV/d,m=(1<=0&&(i[i.t++]=1,i.subTo(b,i)),n.ONE.dlShiftTo(l,b),b.subTo(a,a);a.t=0;){var S=i[--v]==p?this.DM:Math.floor(i[v]*g+(i[v-1]+y)*m);if((i[v]+=a.am(0,S,i,w,0,l))0&&i.rShiftTo(c,i),u<0&&n.ZERO.subTo(i,i)}}},n.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},n.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},n.prototype.exp=function(t,e){if(t>4294967295||t<1)return n.ONE;var i=r(),o=r(),s=e.convert(this),a=f(t)-1;for(s.copyTo(i);--a>=0;)if(e.sqrTo(i,o),(t&1<0)e.mulTo(o,s,i);else{var u=i;i=o,o=u}return e.revert(i)},n.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,r=(1<0)for(a>a)>0&&(i=!0,o=u(n));s>=0;)a>(a+=this.DB-e)):(n=this[s]>>(a-=e)&r,a<=0&&(a+=this.DB,--s)),n>0&&(i=!0),i&&(o+=u(n));return i?o:"0"},n.prototype.negate=function(){var t=r();return n.ZERO.subTo(this,t),t},n.prototype.abs=function(){return this.s<0?this.negate():this},n.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0},n.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+f(this[this.t-1]^this.s&this.DM)},n.prototype.mod=function(t){var e=r();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(n.ZERO)>0&&t.subTo(e,e),e},n.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new l(e):new p(e),this.exp(t,n)},n.ZERO=c(0),n.ONE=c(1),S.prototype.convert=E,S.prototype.revert=E,S.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},S.prototype.sqrTo=function(t,e){t.squareTo(e)},T.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=r();return t.copyTo(e),this.reduce(e),e},T.prototype.revert=function(t){return t},T.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var A=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],R=(1<<26)/A[A.length-1];function C(){this.i=0,this.j=0,this.S=new Array}n.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},n.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),i=c(n),o=r(),s=r(),a="";for(this.divRemTo(i,o,s);o.signum()>0;)a=(n+s.intValue()).toString(t).substr(1)+a,o.divRemTo(i,o,s);return s.intValue().toString(t)+a},n.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),i=Math.pow(e,r),o=!1,s=0,a=0,u=0;u=r&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),o&&n.ZERO.subTo(this,this)},n.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(n.ONE.shiftLeft(t-1),g,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(n.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),e.nextBytes(i),o>0?i[0]&=(1<>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[n++]=r:r<-1&&(e[n++]=this.DV+r),e.t=n,e.clamp()},n.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},n.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},n.prototype.multiplyLowerTo=function(t,e,n){var r,i=Math.min(this.t+t.t,e);for(n.s=0,n.t=i;i>0;)n[--i]=0;for(r=n.t-this.t;i=0;)n[r]=0;for(r=Math.max(e-this.t,0);r0)if(0==e)n=this[0]%t;else for(var r=this.t-1;r>=0;--r)n=(e*n+this[r])%t;return n},n.prototype.millerRabin=function(t){var e=this.subtract(n.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var o=e.shiftRight(i);(t=t+1>>1)>A.length&&(t=A.length);for(var s=r(),a=0;a>24},n.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},n.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},n.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var n,r=this.DB-t*this.DB%8,i=0;if(t-- >0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this[t]&(1<>(r+=this.DB-8)):(n=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e},n.prototype.equals=function(t){return 0==this.compareTo(t)},n.prototype.min=function(t){return this.compareTo(t)<0?this:t},n.prototype.max=function(t){return this.compareTo(t)>0?this:t},n.prototype.and=function(t){var e=r();return this.bitwiseTo(t,d,e),e},n.prototype.or=function(t){var e=r();return this.bitwiseTo(t,g,e),e},n.prototype.xor=function(t){var e=r();return this.bitwiseTo(t,m,e),e},n.prototype.andNot=function(t){var e=r();return this.bitwiseTo(t,y,e),e},n.prototype.not=function(){for(var t=r(),e=0;e=this.t?0!=this.s:0!=(this[e]&1<1){var g=r();for(i.sqrTo(a[1],g);u<=d;)a[u]=r(),i.mulTo(g,a[u-2],a[u]),u+=2}var m,y,v=t.t-1,w=!0,b=r();for(o=f(t[v])-1;v>=0;){for(o>=h?m=t[v]>>o-h&d:(m=(t[v]&(1<0&&(m|=t[v-1]>>this.DB+o-h)),u=n;0==(1&m);)m>>=1,--u;if((o-=u)<0&&(o+=this.DB,--v),w)a[m].copyTo(s),w=!1;else{for(;u>1;)i.sqrTo(s,b),i.sqrTo(b,s),u-=2;u>0?i.sqrTo(s,b):(y=s,s=b,b=y),i.mulTo(b,a[m],s)}for(;v>=0&&0==(t[v]&1<=0?(r.subTo(i,r),e&&o.subTo(a,o),s.subTo(u,s)):(i.subTo(r,i),e&&a.subTo(o,a),u.subTo(s,u))}return 0!=i.compareTo(n.ONE)?n.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},n.prototype.pow=function(t){return this.exp(t,new S)},n.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var r=e;e=n,n=r}var i=e.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return e;for(i0&&(e.rShiftTo(o,e),n.rShiftTo(o,n));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},n.prototype.isProbablePrime=function(t){var e,n=this.abs();if(1==n.t&&n[0]<=A[A.length-1]){for(e=0;e=256||U>=I)window.removeEventListener?window.removeEventListener("mousemove",O,!1):window.detachEvent&&window.detachEvent("onmousemove",O);else try{var e=t.x+t.y;_[U++]=255&e,this.count+=1}catch(t){}};window.addEventListener?window.addEventListener("mousemove",O,!1):window.attachEvent&&window.attachEvent("onmousemove",O)}function P(){if(null==x){for(x=new C;U0&&e.length>0&&(this.n=$(t,16),this.e=parseInt(e,16))},L.prototype.encrypt=function(t){var e=function(t,e){if(e=0&&e>0;){var o=t.charCodeAt(i--);o<128?r[--e]=o:o>127&&o<2048?(r[--e]=63&o|128,r[--e]=o>>6|192):(r[--e]=63&o|128,r[--e]=o>>6&63|128,r[--e]=o>>12|224)}r[--e]=0;for(var s=new k,a=new Array;e>2;){for(a[0]=0;0==a[0];)s.nextBytes(a);r[--e]=a[0]}return r[--e]=2,r[--e]=0,new n(r)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var r=this.doPublic(e);if(null==r)return null;var i=r.toString(16);return 0==(1&i.length)?i:"0"+i},L.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),n=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(n)<0;)e=e.add(this.p);return e.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},L.prototype.setPrivate=function(t,e,n){null!=t&&null!=e&&t.length>0&&e.length>0&&(this.n=$(t,16),this.e=parseInt(e,16),this.d=$(n,16))},L.prototype.setPrivateEx=function(t,e,n,r,i,o,s,a){null!=t&&null!=e&&t.length>0&&e.length>0&&(this.n=$(t,16),this.e=parseInt(e,16),this.d=$(n,16),this.p=$(r,16),this.q=$(i,16),this.dmp1=$(o,16),this.dmq1=$(s,16),this.coeff=$(a,16))},L.prototype.generate=function(t,e){var r=new k,i=t>>1;this.e=parseInt(e,16);for(var o=new n(e,16);;){for(;this.p=new n(t-i,1,r),0!=this.p.subtract(n.ONE).gcd(o).compareTo(n.ONE)||!this.p.isProbablePrime(10););for(;this.q=new n(i,1,r),0!=this.q.subtract(n.ONE).gcd(o).compareTo(n.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var s=this.p;this.p=this.q,this.q=s}var a=this.p.subtract(n.ONE),u=this.q.subtract(n.ONE),h=a.multiply(u);if(0==h.gcd(o).compareTo(n.ONE)){this.n=this.p.multiply(this.q),this.d=o.modInverse(h),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(u),this.coeff=this.q.modInverse(this.p);break}}},L.prototype.decrypt=function(t){var e=$(t,16),n=this.doPrivate(e);return null==n?null:function(t,e){for(var n=t.toByteArray(),r=0;r=n.length)return null;for(var i="";++r191&&o<224?(i+=String.fromCharCode((31&o)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&o)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return i}(n,this.n.bitLength()+7>>3)},L.prototype.generateAsync=function(t,e,i){var o=new k,s=t>>1;this.e=parseInt(e,16);var a=new n(e,16),u=this,h=function(){var e=function(){if(u.p.compareTo(u.q)<=0){var t=u.p;u.p=u.q,u.q=t}var e=u.p.subtract(n.ONE),r=u.q.subtract(n.ONE),o=e.multiply(r);0==o.gcd(a).compareTo(n.ONE)?(u.n=u.p.multiply(u.q),u.d=a.modInverse(o),u.dmp1=u.d.mod(e),u.dmq1=u.d.mod(r),u.coeff=u.q.modInverse(u.p),setTimeout(function(){i()},0)):setTimeout(h,0)},c=function(){u.q=r(),u.q.fromNumberAsync(s,1,o,function(){u.q.subtract(n.ONE).gcda(a,function(t){0==t.compareTo(n.ONE)&&u.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(c,0)})})},f=function(){u.p=r(),u.p.fromNumberAsync(t-s,1,o,function(){u.p.subtract(n.ONE).gcda(a,function(t){0==t.compareTo(n.ONE)&&u.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(f,0)})})};setTimeout(f,0)};setTimeout(h,0)},n.prototype.gcda=function(t,e){var n=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(n.compareTo(r)<0){var i=n;n=r,r=i}var o=n.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)e(n);else{o0&&(n.rShiftTo(s,n),r.rShiftTo(s,r));var a=function(){(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r)),n.signum()>0?setTimeout(a,0):(s>0&&r.lShiftTo(s,r),setTimeout(function(){e(r)},0))};setTimeout(a,10)}},n.prototype.fromNumberAsync=function(t,e,r,i){if("number"==typeof e)if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(n.ONE.shiftLeft(t-1),g,this),this.isEven()&&this.dAddOffset(1,0);var o=this,s=function(){o.dAddOffset(2,0),o.bitLength()>t&&o.subTo(n.ONE.shiftLeft(t-1),o),o.isProbablePrime(e)?setTimeout(function(){i()},0):setTimeout(s,0)};setTimeout(s,0)}else{var a=new Array,u=7&t;a.length=1+(t>>3),e.nextBytes(a),u>0?a[0]&=(1<>6)+N.charAt(63&n);for(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),r+=N.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),r+=N.charAt(n>>2)+N.charAt((3&n)<<4));(3&r.length)>0;)r+=q;return r}function M(t){var e,n,r="",i=0;for(e=0;e>2),n=3&v,i=1):1==i?(r+=u(n<<2|v>>4),n=15&v,i=2):2==i?(r+=u(n),r+=u(v>>2),n=3&v,i=3):(r+=u(n<<2|v>>4),r+=u(15&v),i=0));return 1==i&&(r+=u(n<<2)),r}var K=K||{};K.env=K.env||{};var V=K,J=Object.prototype,j=["toString","valueOf"];K.env.parseUA=function(t){var e,n=function(t){var e=0;return parseFloat(t.replace(/\./g,function(){return 1==e++?"":"."}))},r=navigator,i={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,webos:0,caja:r&&r.cajaVersion,secure:!1,os:null},o=t||navigator&&navigator.userAgent,s=window&&window.location,a=s&&s.href;return i.secure=a&&0===a.toLowerCase().indexOf("https"),o&&(/windows|win32/i.test(o)?i.os="windows":/macintosh/i.test(o)?i.os="macintosh":/rhino/i.test(o)&&(i.os="rhino"),/KHTML/.test(o)&&(i.webkit=1),(e=o.match(/AppleWebKit\/([^\s]*)/))&&e[1]&&(i.webkit=n(e[1]),/ Mobile\//.test(o)?(i.mobile="Apple",(e=o.match(/OS ([^\s]*)/))&&e[1]&&(e=n(e[1].replace("_","."))),i.ios=e,i.ipad=i.ipod=i.iphone=0,(e=o.match(/iPad|iPod|iPhone/))&&e[0]&&(i[e[0].toLowerCase()]=i.ios)):((e=o.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/))&&(i.mobile=e[0]),/webOS/.test(o)&&(i.mobile="WebOS",(e=o.match(/webOS\/([^\s]*);/))&&e[1]&&(i.webos=n(e[1]))),/ Android/.test(o)&&(i.mobile="Android",(e=o.match(/Android ([^\s]*);/))&&e[1]&&(i.android=n(e[1])))),(e=o.match(/Chrome\/([^\s]*)/))&&e[1]?i.chrome=n(e[1]):(e=o.match(/AdobeAIR\/([^\s]*)/))&&(i.air=e[0])),i.webkit||((e=o.match(/Opera[\s\/]([^\s]*)/))&&e[1]?(i.opera=n(e[1]),(e=o.match(/Version\/([^\s]*)/))&&e[1]&&(i.opera=n(e[1])),(e=o.match(/Opera Mini[^;]*/))&&(i.mobile=e[0])):(e=o.match(/MSIE\s([^;]*)/))&&e[1]?i.ie=n(e[1]):(e=o.match(/Gecko\/([^\s]*)/))&&(i.gecko=1,(e=o.match(/rv:([^\s\)]*)/))&&e[1]&&(i.gecko=n(e[1]))))),i},K.env.ua=K.env.parseUA(),K.isFunction=function(t){return"function"==typeof t||"[object Function]"===J.toString.apply(t)},K._IEEnumFix=K.env.ua.ie?function(t,e){var n,r,i;for(n=0;n15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var r=128+n;return r.toString(16)+e},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},KJUR.asn1.DERAbstractString=function(t){KJUR.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},K.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractTime=function(t){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){utc=t.getTime()+6e4*t.getTimezoneOffset();var e=new Date(utc);return e},this.formatDate=function(t,e){var n=this.zeroPadding,r=this.localDateToUTC(t),i=String(r.getFullYear());"utc"==e&&(i=i.substr(2,2));var o=n(String(r.getMonth()+1),2),s=n(String(r.getDate()),2),a=n(String(r.getHours()),2),u=n(String(r.getMinutes()),2),h=n(String(r.getSeconds()),2);return i+o+s+a+u+h+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setByDateValue=function(t,e,n,r,i,o){var s=new Date(Date.UTC(t,e-1,n,r,i,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},K.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractStructured=function(t){KJUR.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},K.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object),KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},K.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object),KJUR.asn1.DERInteger=function(t){KJUR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new n(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):void 0!==t.hex&&this.setValueHex(t.hex))},K.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object),KJUR.asn1.DERBitString=function(t){KJUR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7=2?(o[o.length]=s,s=0,a=0):s<<=4}}if(a)throw"Hex encoding incomplete: 4 bits missing";return o}};window.Hex=n}(),function(t){"use strict";var e,n={decode:function(t){var n;if(void 0===e){var r="= \f\n\r\t \u2028\u2029";for(e=[],n=0;n<64;++n)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n)]=n;for(n=0;n=4?(i[i.length]=o>>16,i[i.length]=o>>8&255,i[i.length]=255&o,o=0,s=0):o<<=6}}switch(s){case 1:throw"Base64 encoding incomplete: at least 2 bits missing";case 2:i[i.length]=o>>10;break;case 3:i[i.length]=o>>16,i[i.length]=o>>8&255}return i},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=n.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw"RegExp out of sync";t=e[2]}return n.decode(t)}};window.Base64=n}(),function(t){"use strict";var e={tag:function(t,e){var n=document.createElement(t);return n.className=e,n},text:function(t){return document.createTextNode(t)}};function n(t,e){t instanceof n?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=e)}function r(t,e,n,r,i){this.stream=t,this.header=e,this.length=n,this.tag=r,this.sub=i}n.prototype.get=function(t){if(void 0===t&&(t=this.pos++),t>=this.enc.length)throw"Requesting byte offset "+t+" on a stream of length "+this.enc.length;return this.enc[t]},n.prototype.hexDigits="0123456789ABCDEF",n.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},n.prototype.hexDump=function(t,e,n){for(var r="",i=t;i191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(r++)):String.fromCharCode((15&i)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n},n.prototype.parseStringBMP=function(t,e){for(var n="",r=t;r4){n<<=3;var r=this.get(t);if(0===r)n-=8;else for(;r<128;)r<<=1,--n;return"("+n+" bit)"}for(var i=0,o=t;ot;--s){for(var a=this.get(s),u=o;u<8;++u)i+=a>>u&1?"1":"0";o=0}}return i},n.prototype.parseOctetString=function(t,e){var n=e-t,r="("+n+" byte) ";n>100&&(e=t+100);for(var i=t;i100&&(r+="…"),r},n.prototype.parseOID=function(t,e){for(var n="",r=0,i=0,o=t;o=31?"bigint":r);r=i=0}}return n},r.prototype.typeName=function(){if(void 0===this.tag)return"unknown";var t=this.tag>>6,e=(this.tag,31&this.tag);switch(t){case 0:switch(e){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString";default:return"Universal_"+e.toString(16)}case 1:return"Application_"+e.toString(16);case 2:return"["+e+"]";case 3:return"Private_"+e.toString(16)}},r.prototype.reSeemsASCII=/^[ -~]+$/,r.prototype.content=function(){if(void 0===this.tag)return null;var t=this.tag>>6,e=31&this.tag,n=this.posContent(),r=Math.abs(this.length);if(0!==t){if(null!==this.sub)return"("+this.sub.length+" elem)";var i=this.stream.parseStringISO(n,n+Math.min(r,100));return this.reSeemsASCII.test(i)?i.substring(0,200)+(i.length>200?"…":""):this.stream.parseOctetString(n,n+r)}switch(e){case 1:return 0===this.stream.get(n)?"false":"true";case 2:return this.stream.parseInteger(n,n+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(n,n+r);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(n,n+r);case 6:return this.stream.parseOID(n,n+r);case 16:case 17:return"("+this.sub.length+" elem)";case 12:return this.stream.parseStringUTF(n,n+r);case 18:case 19:case 20:case 21:case 22:case 26:return this.stream.parseStringISO(n,n+r);case 30:return this.stream.parseStringBMP(n,n+r);case 23:case 24:return this.stream.parseTime(n,n+r)}return null},r.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},r.prototype.print=function(t){if(void 0===t&&(t=""),document.writeln(t+this),null!==this.sub){t+=" ";for(var e=0,n=this.sub.length;e=0&&(e+="+"),e+=this.length,32&this.tag?e+=" (constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(e+=" (encapsulates)"),e+="\n",null!==this.sub){t+=" ";for(var n=0,r=this.sub.length;n",r+="Length: "+this.header+"+",this.length>=0?r+=this.length:r+=-this.length+" (undefined)",32&this.tag?r+="
(constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(r+="
(encapsulates)"),null!==i&&(r+="
Value:
"+i+"","object"==typeof oids&&6==this.tag)){var a=oids[i];a&&(a.d&&(r+="
"+a.d),a.c&&(r+="
"+a.c),a.w&&(r+="
(warning!)"))}s.innerHTML=r,t.appendChild(s);var u=e.tag("div","sub");if(null!==this.sub)for(var h=0,c=this.sub.length;h=o)){var s=e.tag("span",n);s.appendChild(e.text(r.hexDump(i,o))),t.appendChild(s)}},r.prototype.toHexDOM=function(t){var n=e.tag("span","hex");if(void 0===t&&(t=n),this.head.hexNode=n,this.head.onmouseover=function(){this.hexNode.className="hexCurrent"},this.head.onmouseout=function(){this.hexNode.className="hex"},n.asn1=this,n.onmouseover=function(){var e=!t.selected;e&&(t.selected=this.asn1,this.className="hexCurrent"),this.asn1.fakeHover(e)},n.onmouseout=function(){var e=t.selected==this.asn1;this.asn1.fakeOut(e),e&&(t.selected=null,this.className="hex")},this.toHexDOM_sub(n,"tag",this.stream,this.posStart(),this.posStart()+1),this.toHexDOM_sub(n,this.length>=0?"dlen":"ulen",this.stream,this.posStart()+1,this.posContent()),null===this.sub)n.appendChild(e.text(this.stream.hexDump(this.posContent(),this.posEnd())));else if(this.sub.length>0){var r=this.sub[0],i=this.sub[this.sub.length-1];this.toHexDOM_sub(n,"intro",this.stream,this.posContent(),r.posStart());for(var o=0,s=this.sub.length;o3)throw"Length over 24 bits not supported at position "+(t.pos-1);if(0===n)return-1;e=0;for(var r=0;r4)return!1;var o=new n(i);3==t&&o.get();var s=o.get();if(s>>6&1)return!1;try{var a=r.decodeLength(o);return o.pos-i.pos+a==e}catch(t){return!1}},r.decode=function(t){t instanceof n||(t=new n(t,0));var e=new n(t),i=t.get(),o=r.decodeLength(t),s=t.pos-e.pos,a=null;if(r.hasContent(i,o,t)){var u=t.pos;if(3==i&&t.get(),a=[],o>=0){for(var h=u+o;t.pos -1) {\n options.maxBodyLength = config.maxContentLength;\n }\n\n // Create the request\n var req = transport.request(options, function handleResponse(res) {\n if (req.aborted) return;\n\n // uncompress the response body transparently if required\n var stream = res;\n switch (res.headers['content-encoding']) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'compress':\n case 'deflate':\n // add the unzipper to the body stream processing pipeline\n stream = (res.statusCode === 204) ? stream : stream.pipe(zlib.createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n }\n\n // return the last request in case of redirects\n var lastRequest = res.req || req;\n\n var response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: res.headers,\n config: config,\n request: lastRequest\n };\n\n if (config.responseType === 'stream') {\n response.data = stream;\n settle(resolve, reject, response);\n } else {\n var responseBuffer = [];\n stream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && Buffer.concat(responseBuffer).length > config.maxContentLength) {\n stream.destroy();\n reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n config, null, lastRequest));\n }\n });\n\n stream.on('error', function handleStreamError(err) {\n if (req.aborted) return;\n reject(enhanceError(err, config, null, lastRequest));\n });\n\n stream.on('end', function handleStreamEnd() {\n var responseData = Buffer.concat(responseBuffer);\n if (config.responseType !== 'arraybuffer') {\n responseData = responseData.toString(config.responseEncoding);\n }\n\n response.data = responseData;\n settle(resolve, reject, response);\n });\n }\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n if (req.aborted) return;\n reject(enhanceError(err, config, null, req));\n });\n\n // Handle request timeout\n if (config.timeout) {\n timer = setTimeout(function handleRequestTimeout() {\n req.abort();\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', req));\n }, config.timeout);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (req.aborted) return;\n\n req.abort();\n reject(cancel);\n });\n }\n\n // Send the request\n if (utils.isStream(data)) {\n data.on('error', function handleStreamError(err) {\n reject(enhanceError(err, config, null, req));\n }).pipe(req);\n } else {\n req.end(data);\n }\n });\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/adapters/http.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\nvar settle = __webpack_require__(/*! ./../core/settle */ \"./node_modules/_axios@0.18.0@axios/lib/core/settle.js\");\nvar buildURL = __webpack_require__(/*! ./../helpers/buildURL */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/buildURL.js\");\nvar http = __webpack_require__(/*! http */ \"http\");\nvar https = __webpack_require__(/*! https */ \"https\");\nvar httpFollow = __webpack_require__(/*! follow-redirects */ \"./node_modules/_follow-redirects@1.7.0@follow-redirects/index.js\").http;\nvar httpsFollow = __webpack_require__(/*! follow-redirects */ \"./node_modules/_follow-redirects@1.7.0@follow-redirects/index.js\").https;\nvar url = __webpack_require__(/*! url */ \"url\");\nvar zlib = __webpack_require__(/*! zlib */ \"zlib\");\nvar pkg = __webpack_require__(/*! ./../../package.json */ \"./node_modules/_axios@0.18.0@axios/package.json\");\nvar createError = __webpack_require__(/*! ../core/createError */ \"./node_modules/_axios@0.18.0@axios/lib/core/createError.js\");\nvar enhanceError = __webpack_require__(/*! ../core/enhanceError */ \"./node_modules/_axios@0.18.0@axios/lib/core/enhanceError.js\");\n\n/*eslint consistent-return:0*/\nmodule.exports = function httpAdapter(config) {\n return new Promise(function dispatchHttpRequest(resolve, reject) {\n var data = config.data;\n var headers = config.headers;\n var timer;\n\n // Set User-Agent (required by some servers)\n // Only set header if it hasn't been set in config\n // See https://github.com/axios/axios/issues/69\n if (!headers['User-Agent'] && !headers['user-agent']) {\n headers['User-Agent'] = 'axios/' + pkg.version;\n }\n\n if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } else if (utils.isArrayBuffer(data)) {\n data = new Buffer(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = new Buffer(data, 'utf-8');\n } else {\n return reject(createError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n config\n ));\n }\n\n // Add Content-Length header if data exists\n headers['Content-Length'] = data.length;\n }\n\n // HTTP basic authentication\n var auth = undefined;\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n // Parse url\n var parsed = url.parse(config.url);\n var protocol = parsed.protocol || 'http:';\n\n if (!auth && parsed.auth) {\n var urlAuth = parsed.auth.split(':');\n var urlUsername = urlAuth[0] || '';\n var urlPassword = urlAuth[1] || '';\n auth = urlUsername + ':' + urlPassword;\n }\n\n if (auth) {\n delete headers.Authorization;\n }\n\n var isHttps = protocol === 'https:';\n var agent = isHttps ? config.httpsAgent : config.httpAgent;\n\n var options = {\n path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, ''),\n method: config.method,\n headers: headers,\n agent: agent,\n auth: auth\n };\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n }\n\n var proxy = config.proxy;\n if (!proxy && proxy !== false) {\n var proxyEnv = protocol.slice(0, -1) + '_proxy';\n var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];\n if (proxyUrl) {\n var parsedProxyUrl = url.parse(proxyUrl);\n proxy = {\n host: parsedProxyUrl.hostname,\n port: parsedProxyUrl.port\n };\n\n if (parsedProxyUrl.auth) {\n var proxyUrlAuth = parsedProxyUrl.auth.split(':');\n proxy.auth = {\n username: proxyUrlAuth[0],\n password: proxyUrlAuth[1]\n };\n }\n }\n }\n\n if (proxy) {\n options.hostname = proxy.host;\n options.host = proxy.host;\n options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');\n options.port = proxy.port;\n options.path = protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path;\n\n // Basic proxy authorization\n if (proxy.auth) {\n var base64 = new Buffer(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n }\n\n var transport;\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttps ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n transport = isHttps ? httpsFollow : httpFollow;\n }\n\n if (config.maxContentLength && config.maxContentLength > -1) {\n options.maxBodyLength = config.maxContentLength;\n }\n\n // Create the request\n var req = transport.request(options, function handleResponse(res) {\n if (req.aborted) return;\n\n // Response has been received so kill timer that handles request timeout\n clearTimeout(timer);\n timer = null;\n\n // uncompress the response body transparently if required\n var stream = res;\n switch (res.headers['content-encoding']) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'compress':\n case 'deflate':\n // add the unzipper to the body stream processing pipeline\n stream = stream.pipe(zlib.createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n }\n\n // return the last request in case of redirects\n var lastRequest = res.req || req;\n\n var response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: res.headers,\n config: config,\n request: lastRequest\n };\n\n if (config.responseType === 'stream') {\n response.data = stream;\n settle(resolve, reject, response);\n } else {\n var responseBuffer = [];\n stream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && Buffer.concat(responseBuffer).length > config.maxContentLength) {\n reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n config, null, lastRequest));\n }\n });\n\n stream.on('error', function handleStreamError(err) {\n if (req.aborted) return;\n reject(enhanceError(err, config, null, lastRequest));\n });\n\n stream.on('end', function handleStreamEnd() {\n var responseData = Buffer.concat(responseBuffer);\n if (config.responseType !== 'arraybuffer') {\n responseData = responseData.toString('utf8');\n }\n\n response.data = responseData;\n settle(resolve, reject, response);\n });\n }\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n if (req.aborted) return;\n reject(enhanceError(err, config, null, req));\n });\n\n // Handle request timeout\n if (config.timeout && !timer) {\n timer = setTimeout(function handleRequestTimeout() {\n req.abort();\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', req));\n }, config.timeout);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (req.aborted) return;\n\n req.abort();\n reject(cancel);\n });\n }\n\n // Send the request\n if (utils.isStream(data)) {\n data.pipe(req);\n } else {\n req.end(data);\n }\n });\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/adapters/http.js?"); /***/ }), -/***/ "./node_modules/axios/lib/adapters/xhr.js": -/*!************************************************!*\ - !*** ./node_modules/axios/lib/adapters/xhr.js ***! - \************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/adapters/xhr.js": +/*!**************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/adapters/xhr.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\nvar settle = __webpack_require__(/*! ./../core/settle */ \"./node_modules/axios/lib/core/settle.js\");\nvar buildURL = __webpack_require__(/*! ./../helpers/buildURL */ \"./node_modules/axios/lib/helpers/buildURL.js\");\nvar parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ \"./node_modules/axios/lib/helpers/parseHeaders.js\");\nvar isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ \"./node_modules/axios/lib/helpers/isURLSameOrigin.js\");\nvar createError = __webpack_require__(/*! ../core/createError */ \"./node_modules/axios/lib/core/createError.js\");\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = __webpack_require__(/*! ./../helpers/cookies */ \"./node_modules/axios/lib/helpers/cookies.js\");\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/adapters/xhr.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\nvar settle = __webpack_require__(/*! ./../core/settle */ \"./node_modules/_axios@0.18.0@axios/lib/core/settle.js\");\nvar buildURL = __webpack_require__(/*! ./../helpers/buildURL */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/buildURL.js\");\nvar parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/parseHeaders.js\");\nvar isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/isURLSameOrigin.js\");\nvar createError = __webpack_require__(/*! ../core/createError */ \"./node_modules/_axios@0.18.0@axios/lib/core/createError.js\");\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || __webpack_require__(/*! ./../helpers/btoa */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/btoa.js\");\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n // Only supports POST and GET calls and doesn't returns the response headers.\n // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n if ( true &&\n typeof window !== 'undefined' &&\n window.XDomainRequest && !('withCredentials' in request) &&\n !isURLSameOrigin(config.url)) {\n request = new window.XDomainRequest();\n loadEvent = 'onload';\n xDomain = true;\n request.onprogress = function handleProgress() {};\n request.ontimeout = function handleTimeout() {};\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleLoad() {\n if (!request || (request.readyState !== 4 && !xDomain)) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201)\n status: request.status === 1223 ? 204 : request.status,\n statusText: request.status === 1223 ? 'No Content' : request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = __webpack_require__(/*! ./../helpers/cookies */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/cookies.js\");\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/adapters/xhr.js?"); /***/ }), -/***/ "./node_modules/axios/lib/axios.js": -/*!*****************************************!*\ - !*** ./node_modules/axios/lib/axios.js ***! - \*****************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/axios.js": +/*!*******************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/axios.js ***! + \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/axios/lib/utils.js\");\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"./node_modules/axios/lib/helpers/bind.js\");\nvar Axios = __webpack_require__(/*! ./core/Axios */ \"./node_modules/axios/lib/core/Axios.js\");\nvar mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ \"./node_modules/axios/lib/core/mergeConfig.js\");\nvar defaults = __webpack_require__(/*! ./defaults */ \"./node_modules/axios/lib/defaults.js\");\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ \"./node_modules/axios/lib/cancel/Cancel.js\");\naxios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ \"./node_modules/axios/lib/cancel/CancelToken.js\");\naxios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ \"./node_modules/axios/lib/cancel/isCancel.js\");\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = __webpack_require__(/*! ./helpers/spread */ \"./node_modules/axios/lib/helpers/spread.js\");\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/axios.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/bind.js\");\nvar Axios = __webpack_require__(/*! ./core/Axios */ \"./node_modules/_axios@0.18.0@axios/lib/core/Axios.js\");\nvar defaults = __webpack_require__(/*! ./defaults */ \"./node_modules/_axios@0.18.0@axios/lib/defaults.js\");\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ \"./node_modules/_axios@0.18.0@axios/lib/cancel/Cancel.js\");\naxios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ \"./node_modules/_axios@0.18.0@axios/lib/cancel/CancelToken.js\");\naxios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ \"./node_modules/_axios@0.18.0@axios/lib/cancel/isCancel.js\");\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = __webpack_require__(/*! ./helpers/spread */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/spread.js\");\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/axios.js?"); /***/ }), -/***/ "./node_modules/axios/lib/cancel/Cancel.js": -/*!*************************************************!*\ - !*** ./node_modules/axios/lib/cancel/Cancel.js ***! - \*************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/cancel/Cancel.js": +/*!***************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/cancel/Cancel.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/cancel/Cancel.js?"); +eval("\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/cancel/Cancel.js?"); /***/ }), -/***/ "./node_modules/axios/lib/cancel/CancelToken.js": -/*!******************************************************!*\ - !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! - \******************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/cancel/CancelToken.js": +/*!********************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/cancel/CancelToken.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar Cancel = __webpack_require__(/*! ./Cancel */ \"./node_modules/axios/lib/cancel/Cancel.js\");\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/cancel/CancelToken.js?"); +eval("\n\nvar Cancel = __webpack_require__(/*! ./Cancel */ \"./node_modules/_axios@0.18.0@axios/lib/cancel/Cancel.js\");\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/cancel/CancelToken.js?"); /***/ }), -/***/ "./node_modules/axios/lib/cancel/isCancel.js": -/*!***************************************************!*\ - !*** ./node_modules/axios/lib/cancel/isCancel.js ***! - \***************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/cancel/isCancel.js": +/*!*****************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/cancel/isCancel.js ***! + \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/cancel/isCancel.js?"); +eval("\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/cancel/isCancel.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/Axios.js": -/*!**********************************************!*\ - !*** ./node_modules/axios/lib/core/Axios.js ***! - \**********************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/Axios.js": +/*!************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/Axios.js ***! + \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\nvar buildURL = __webpack_require__(/*! ../helpers/buildURL */ \"./node_modules/axios/lib/helpers/buildURL.js\");\nvar InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ \"./node_modules/axios/lib/core/InterceptorManager.js\");\nvar dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ \"./node_modules/axios/lib/core/dispatchRequest.js\");\nvar mergeConfig = __webpack_require__(/*! ./mergeConfig */ \"./node_modules/axios/lib/core/mergeConfig.js\");\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n config.method = config.method ? config.method.toLowerCase() : 'get';\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/core/Axios.js?"); +eval("\n\nvar defaults = __webpack_require__(/*! ./../defaults */ \"./node_modules/_axios@0.18.0@axios/lib/defaults.js\");\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\nvar InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ \"./node_modules/_axios@0.18.0@axios/lib/core/InterceptorManager.js\");\nvar dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ \"./node_modules/_axios@0.18.0@axios/lib/core/dispatchRequest.js\");\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, {method: 'get'}, this.defaults, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/core/Axios.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/InterceptorManager.js": -/*!***********************************************************!*\ - !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! - \***********************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/InterceptorManager.js": +/*!*************************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/InterceptorManager.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/core/InterceptorManager.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/core/InterceptorManager.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/createError.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/core/createError.js ***! - \****************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/createError.js": +/*!******************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/createError.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar enhanceError = __webpack_require__(/*! ./enhanceError */ \"./node_modules/axios/lib/core/enhanceError.js\");\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/core/createError.js?"); +eval("\n\nvar enhanceError = __webpack_require__(/*! ./enhanceError */ \"./node_modules/_axios@0.18.0@axios/lib/core/enhanceError.js\");\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/core/createError.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/dispatchRequest.js": -/*!********************************************************!*\ - !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! - \********************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/dispatchRequest.js": +/*!**********************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/dispatchRequest.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\nvar transformData = __webpack_require__(/*! ./transformData */ \"./node_modules/axios/lib/core/transformData.js\");\nvar isCancel = __webpack_require__(/*! ../cancel/isCancel */ \"./node_modules/axios/lib/cancel/isCancel.js\");\nvar defaults = __webpack_require__(/*! ../defaults */ \"./node_modules/axios/lib/defaults.js\");\nvar isAbsoluteURL = __webpack_require__(/*! ./../helpers/isAbsoluteURL */ \"./node_modules/axios/lib/helpers/isAbsoluteURL.js\");\nvar combineURLs = __webpack_require__(/*! ./../helpers/combineURLs */ \"./node_modules/axios/lib/helpers/combineURLs.js\");\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/core/dispatchRequest.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\nvar transformData = __webpack_require__(/*! ./transformData */ \"./node_modules/_axios@0.18.0@axios/lib/core/transformData.js\");\nvar isCancel = __webpack_require__(/*! ../cancel/isCancel */ \"./node_modules/_axios@0.18.0@axios/lib/cancel/isCancel.js\");\nvar defaults = __webpack_require__(/*! ../defaults */ \"./node_modules/_axios@0.18.0@axios/lib/defaults.js\");\nvar isAbsoluteURL = __webpack_require__(/*! ./../helpers/isAbsoluteURL */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/isAbsoluteURL.js\");\nvar combineURLs = __webpack_require__(/*! ./../helpers/combineURLs */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/combineURLs.js\");\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/core/dispatchRequest.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/enhanceError.js": -/*!*****************************************************!*\ - !*** ./node_modules/axios/lib/core/enhanceError.js ***! - \*****************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/enhanceError.js": +/*!*******************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/enhanceError.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/core/enhanceError.js?"); +eval("\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/core/enhanceError.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/mergeConfig.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/core/mergeConfig.js ***! - \****************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/settle.js": +/*!*************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/settle.js ***! + \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/axios/lib/utils.js\");\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n utils.forEach(['url', 'method', 'params', 'data'], function valueFromConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n }\n });\n\n utils.forEach(['headers', 'auth', 'proxy'], function mergeDeepProperties(prop) {\n if (utils.isObject(config2[prop])) {\n config[prop] = utils.deepMerge(config1[prop], config2[prop]);\n } else if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (utils.isObject(config1[prop])) {\n config[prop] = utils.deepMerge(config1[prop]);\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n\n utils.forEach([\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength',\n 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken',\n 'socketPath'\n ], function defaultToConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n\n return config;\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/core/mergeConfig.js?"); +eval("\n\nvar createError = __webpack_require__(/*! ./createError */ \"./node_modules/_axios@0.18.0@axios/lib/core/createError.js\");\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/core/settle.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/settle.js": -/*!***********************************************!*\ - !*** ./node_modules/axios/lib/core/settle.js ***! - \***********************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/core/transformData.js": +/*!********************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/core/transformData.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar createError = __webpack_require__(/*! ./createError */ \"./node_modules/axios/lib/core/createError.js\");\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/core/settle.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/core/transformData.js?"); /***/ }), -/***/ "./node_modules/axios/lib/core/transformData.js": -/*!******************************************************!*\ - !*** ./node_modules/axios/lib/core/transformData.js ***! - \******************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/defaults.js": +/*!**********************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/defaults.js ***! + \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/core/transformData.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\nvar normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/normalizeHeaderName.js\");\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = __webpack_require__(/*! ./adapters/xhr */ \"./node_modules/_axios@0.18.0@axios/lib/adapters/xhr.js\");\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = __webpack_require__(/*! ./adapters/http */ \"./node_modules/_axios@0.18.0@axios/lib/adapters/http.js\");\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/defaults.js?"); /***/ }), -/***/ "./node_modules/axios/lib/defaults.js": -/*!********************************************!*\ - !*** ./node_modules/axios/lib/defaults.js ***! - \********************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/bind.js": +/*!**************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/bind.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/axios/lib/utils.js\");\nvar normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ \"./node_modules/axios/lib/helpers/normalizeHeaderName.js\");\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n // Only Node.JS has a process variable that is of [[Class]] process\n if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = __webpack_require__(/*! ./adapters/http */ \"./node_modules/axios/lib/adapters/http.js\");\n } else if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = __webpack_require__(/*! ./adapters/xhr */ \"./node_modules/axios/lib/adapters/xhr.js\");\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/defaults.js?"); +eval("\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/helpers/bind.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/bind.js": -/*!************************************************!*\ - !*** ./node_modules/axios/lib/helpers/bind.js ***! - \************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/btoa.js": +/*!**************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/btoa.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/helpers/bind.js?"); +eval("\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new E();\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/helpers/btoa.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/buildURL.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/helpers/buildURL.js ***! - \****************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/buildURL.js": +/*!******************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/buildURL.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/helpers/buildURL.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/helpers/buildURL.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/combineURLs.js": -/*!*******************************************************!*\ - !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! - \*******************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/combineURLs.js": +/*!*********************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/combineURLs.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/helpers/combineURLs.js?"); +eval("\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/helpers/combineURLs.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/cookies.js": -/*!***************************************************!*\ - !*** ./node_modules/axios/lib/helpers/cookies.js ***! - \***************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/cookies.js": +/*!*****************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/cookies.js ***! + \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/helpers/cookies.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/helpers/cookies.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": -/*!*********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! - \*********************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/isAbsoluteURL.js": +/*!***********************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/isAbsoluteURL.js ***! + \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/helpers/isAbsoluteURL.js?"); +eval("\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/helpers/isAbsoluteURL.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": -/*!***********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! - \***********************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/isURLSameOrigin.js": +/*!*************************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/isURLSameOrigin.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/helpers/isURLSameOrigin.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/helpers/isURLSameOrigin.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js": -/*!***************************************************************!*\ - !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***! - \***************************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/normalizeHeaderName.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/normalizeHeaderName.js ***! + \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/axios/lib/utils.js\");\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/helpers/normalizeHeaderName.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/helpers/normalizeHeaderName.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": -/*!********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! - \********************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/parseHeaders.js": +/*!**********************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/parseHeaders.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/helpers/parseHeaders.js?"); +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/_axios@0.18.0@axios/lib/utils.js\");\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/helpers/parseHeaders.js?"); /***/ }), -/***/ "./node_modules/axios/lib/helpers/spread.js": -/*!**************************************************!*\ - !*** ./node_modules/axios/lib/helpers/spread.js ***! - \**************************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/helpers/spread.js": +/*!****************************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/helpers/spread.js ***! + \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/helpers/spread.js?"); +eval("\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/helpers/spread.js?"); /***/ }), -/***/ "./node_modules/axios/lib/utils.js": -/*!*****************************************!*\ - !*** ./node_modules/axios/lib/utils.js ***! - \*****************************************/ +/***/ "./node_modules/_axios@0.18.0@axios/lib/utils.js": +/*!*******************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/lib/utils.js ***! + \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"./node_modules/axios/lib/helpers/bind.js\");\nvar isBuffer = __webpack_require__(/*! is-buffer */ \"./node_modules/axios/node_modules/is-buffer/index.js\");\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Function equal to merge with the difference being that no reference\n * to original objects is kept.\n *\n * @see merge\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction deepMerge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = deepMerge(result[key], val);\n } else if (typeof val === 'object') {\n result[key] = deepMerge({}, val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n deepMerge: deepMerge,\n extend: extend,\n trim: trim\n};\n\n\n//# sourceURL=webpack:///./node_modules/axios/lib/utils.js?"); +eval("\n\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"./node_modules/_axios@0.18.0@axios/lib/helpers/bind.js\");\nvar isBuffer = __webpack_require__(/*! is-buffer */ \"./node_modules/_is-buffer@1.1.6@is-buffer/index.js\");\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/lib/utils.js?"); /***/ }), -/***/ "./node_modules/axios/node_modules/is-buffer/index.js": -/*!************************************************************!*\ - !*** ./node_modules/axios/node_modules/is-buffer/index.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/_axios@0.18.0@axios/package.json": +/*!*******************************************************!*\ + !*** ./node_modules/_axios@0.18.0@axios/package.json ***! + \*******************************************************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, browser, typings, dependencies, bundlesize, __npminstall_done, _from, _resolved, default */ +/***/ (function(module) { -eval("/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\nmodule.exports = function isBuffer (obj) {\n return obj != null && obj.constructor != null &&\n typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n\n//# sourceURL=webpack:///./node_modules/axios/node_modules/is-buffer/index.js?"); +eval("module.exports = {\"name\":\"axios\",\"version\":\"0.18.0\",\"description\":\"Promise based HTTP client for the browser and node.js\",\"main\":\"index.js\",\"scripts\":{\"test\":\"grunt test && bundlesize\",\"start\":\"node ./sandbox/server.js\",\"build\":\"NODE_ENV=production grunt build\",\"preversion\":\"npm test\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\"postversion\":\"git push && git push --tags\",\"examples\":\"node ./examples/server.js\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/axios/axios.git\"},\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"author\":\"Matt Zabriskie\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"homepage\":\"https://github.com/axios/axios\",\"devDependencies\":{\"bundlesize\":\"^0.5.7\",\"coveralls\":\"^2.11.9\",\"es6-promise\":\"^4.0.5\",\"grunt\":\"^1.0.1\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.0.0\",\"grunt-contrib-nodeunit\":\"^1.0.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^19.0.0\",\"grunt-karma\":\"^2.0.0\",\"grunt-ts\":\"^6.0.0-beta.3\",\"grunt-webpack\":\"^1.0.18\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^1.3.0\",\"karma-chrome-launcher\":\"^2.0.0\",\"karma-coverage\":\"^1.0.0\",\"karma-firefox-launcher\":\"^1.0.0\",\"karma-jasmine\":\"^1.0.2\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-opera-launcher\":\"^1.0.0\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^1.1.0\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.7\",\"karma-webpack\":\"^1.7.0\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"sinon\":\"^1.17.4\",\"webpack\":\"^1.13.1\",\"webpack-dev-server\":\"^1.14.1\",\"url-search-params\":\"^0.6.1\",\"typescript\":\"^2.0.3\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"typings\":\"./index.d.ts\",\"dependencies\":{\"follow-redirects\":\"^1.3.0\",\"is-buffer\":\"^1.1.5\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}],\"__npminstall_done\":\"Tue Apr 23 2019 13:19:25 GMT+0800 (China Standard Time)\",\"_from\":\"axios@0.18.0\",\"_resolved\":\"http://registry.npm.taobao.org/axios/download/axios-0.18.0.tgz\"};\n\n//# sourceURL=webpack:///./node_modules/_axios@0.18.0@axios/package.json?"); /***/ }), -/***/ "./node_modules/axios/package.json": -/*!*****************************************!*\ - !*** ./node_modules/axios/package.json ***! - \*****************************************/ -/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, browser, typings, dependencies, bundlesize, default */ -/***/ (function(module) { +/***/ "./node_modules/_debug@3.2.6@debug/src/browser.js": +/*!********************************************************!*\ + !*** ./node_modules/_debug@3.2.6@debug/src/browser.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"axios\\\",\\\"version\\\":\\\"0.19.0\\\",\\\"description\\\":\\\"Promise based HTTP client for the browser and node.js\\\",\\\"main\\\":\\\"index.js\\\",\\\"scripts\\\":{\\\"test\\\":\\\"grunt test && bundlesize\\\",\\\"start\\\":\\\"node ./sandbox/server.js\\\",\\\"build\\\":\\\"NODE_ENV=production grunt build\\\",\\\"preversion\\\":\\\"npm test\\\",\\\"version\\\":\\\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\\\",\\\"postversion\\\":\\\"git push && git push --tags\\\",\\\"examples\\\":\\\"node ./examples/server.js\\\",\\\"coveralls\\\":\\\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\\\",\\\"fix\\\":\\\"eslint --fix lib/**/*.js\\\"},\\\"repository\\\":{\\\"type\\\":\\\"git\\\",\\\"url\\\":\\\"https://github.com/axios/axios.git\\\"},\\\"keywords\\\":[\\\"xhr\\\",\\\"http\\\",\\\"ajax\\\",\\\"promise\\\",\\\"node\\\"],\\\"author\\\":\\\"Matt Zabriskie\\\",\\\"license\\\":\\\"MIT\\\",\\\"bugs\\\":{\\\"url\\\":\\\"https://github.com/axios/axios/issues\\\"},\\\"homepage\\\":\\\"https://github.com/axios/axios\\\",\\\"devDependencies\\\":{\\\"bundlesize\\\":\\\"^0.17.0\\\",\\\"coveralls\\\":\\\"^3.0.0\\\",\\\"es6-promise\\\":\\\"^4.2.4\\\",\\\"grunt\\\":\\\"^1.0.2\\\",\\\"grunt-banner\\\":\\\"^0.6.0\\\",\\\"grunt-cli\\\":\\\"^1.2.0\\\",\\\"grunt-contrib-clean\\\":\\\"^1.1.0\\\",\\\"grunt-contrib-watch\\\":\\\"^1.0.0\\\",\\\"grunt-eslint\\\":\\\"^20.1.0\\\",\\\"grunt-karma\\\":\\\"^2.0.0\\\",\\\"grunt-mocha-test\\\":\\\"^0.13.3\\\",\\\"grunt-ts\\\":\\\"^6.0.0-beta.19\\\",\\\"grunt-webpack\\\":\\\"^1.0.18\\\",\\\"istanbul-instrumenter-loader\\\":\\\"^1.0.0\\\",\\\"jasmine-core\\\":\\\"^2.4.1\\\",\\\"karma\\\":\\\"^1.3.0\\\",\\\"karma-chrome-launcher\\\":\\\"^2.2.0\\\",\\\"karma-coverage\\\":\\\"^1.1.1\\\",\\\"karma-firefox-launcher\\\":\\\"^1.1.0\\\",\\\"karma-jasmine\\\":\\\"^1.1.1\\\",\\\"karma-jasmine-ajax\\\":\\\"^0.1.13\\\",\\\"karma-opera-launcher\\\":\\\"^1.0.0\\\",\\\"karma-safari-launcher\\\":\\\"^1.0.0\\\",\\\"karma-sauce-launcher\\\":\\\"^1.2.0\\\",\\\"karma-sinon\\\":\\\"^1.0.5\\\",\\\"karma-sourcemap-loader\\\":\\\"^0.3.7\\\",\\\"karma-webpack\\\":\\\"^1.7.0\\\",\\\"load-grunt-tasks\\\":\\\"^3.5.2\\\",\\\"minimist\\\":\\\"^1.2.0\\\",\\\"mocha\\\":\\\"^5.2.0\\\",\\\"sinon\\\":\\\"^4.5.0\\\",\\\"typescript\\\":\\\"^2.8.1\\\",\\\"url-search-params\\\":\\\"^0.10.0\\\",\\\"webpack\\\":\\\"^1.13.1\\\",\\\"webpack-dev-server\\\":\\\"^1.14.1\\\"},\\\"browser\\\":{\\\"./lib/adapters/http.js\\\":\\\"./lib/adapters/xhr.js\\\"},\\\"typings\\\":\\\"./index.d.ts\\\",\\\"dependencies\\\":{\\\"follow-redirects\\\":\\\"1.5.10\\\",\\\"is-buffer\\\":\\\"^2.0.2\\\"},\\\"bundlesize\\\":[{\\\"path\\\":\\\"./dist/axios.min.js\\\",\\\"threshold\\\":\\\"5kB\\\"}]}\");\n\n//# sourceURL=webpack:///./node_modules/axios/package.json?"); +"use strict"; +eval("\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n/**\n * Colors.\n */\n\nexports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n// eslint-disable-next-line complexity\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n return true;\n } // Internet Explorer and Edge do not support colors.\n\n\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n } // Is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\n\n return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773\n typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n}\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\n\nfunction formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function (match) {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\n\nfunction log() {\n var _console;\n\n // This hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return (typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);\n}\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\nfunction save(namespaces) {\n try {\n if (namespaces) {\n exports.storage.setItem('debug', namespaces);\n } else {\n exports.storage.removeItem('debug');\n }\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\nfunction load() {\n var r;\n\n try {\n r = exports.storage.getItem('debug');\n } catch (error) {} // Swallow\n // XXX (@Qix-) should we be logging these?\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\n\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\n\nfunction localstorage() {\n try {\n // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n // The Browser also has localStorage in the global context.\n return localStorage;\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"./node_modules/_debug@3.2.6@debug/src/common.js\")(exports);\nvar formatters = module.exports.formatters;\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n try {\n return JSON.stringify(v);\n } catch (error) {\n return '[UnexpectedJSONParseError]: ' + error.message;\n }\n};\n\n\n\n//# sourceURL=webpack:///./node_modules/_debug@3.2.6@debug/src/browser.js?"); /***/ }), -/***/ "./node_modules/follow-redirects/index.js": -/*!************************************************!*\ - !*** ./node_modules/follow-redirects/index.js ***! - \************************************************/ +/***/ "./node_modules/_debug@3.2.6@debug/src/common.js": +/*!*******************************************************!*\ + !*** ./node_modules/_debug@3.2.6@debug/src/common.js ***! + \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var url = __webpack_require__(/*! url */ \"url\");\nvar http = __webpack_require__(/*! http */ \"http\");\nvar https = __webpack_require__(/*! https */ \"https\");\nvar assert = __webpack_require__(/*! assert */ \"assert\");\nvar Writable = __webpack_require__(/*! stream */ \"stream\").Writable;\nvar debug = __webpack_require__(/*! debug */ \"./node_modules/follow-redirects/node_modules/debug/src/index.js\")(\"follow-redirects\");\n\n// RFC7231§4.2.1: Of the request methods defined by this specification,\n// the GET, HEAD, OPTIONS, and TRACE methods are defined to be safe.\nvar SAFE_METHODS = { GET: true, HEAD: true, OPTIONS: true, TRACE: true };\n\n// Create handlers that pass events from native requests\nvar eventHandlers = Object.create(null);\n[\"abort\", \"aborted\", \"error\", \"socket\", \"timeout\"].forEach(function (event) {\n eventHandlers[event] = function (arg) {\n this._redirectable.emit(event, arg);\n };\n});\n\n// An HTTP(S) request that can be redirected\nfunction RedirectableRequest(options, responseCallback) {\n // Initialize the request\n Writable.call(this);\n options.headers = options.headers || {};\n this._options = options;\n this._redirectCount = 0;\n this._redirects = [];\n this._requestBodyLength = 0;\n this._requestBodyBuffers = [];\n\n // Since http.request treats host as an alias of hostname,\n // but the url module interprets host as hostname plus port,\n // eliminate the host property to avoid confusion.\n if (options.host) {\n // Use hostname if set, because it has precedence\n if (!options.hostname) {\n options.hostname = options.host;\n }\n delete options.host;\n }\n\n // Attach a callback if passed\n if (responseCallback) {\n this.on(\"response\", responseCallback);\n }\n\n // React to responses of native requests\n var self = this;\n this._onNativeResponse = function (response) {\n self._processResponse(response);\n };\n\n // Complete the URL object when necessary\n if (!options.pathname && options.path) {\n var searchPos = options.path.indexOf(\"?\");\n if (searchPos < 0) {\n options.pathname = options.path;\n }\n else {\n options.pathname = options.path.substring(0, searchPos);\n options.search = options.path.substring(searchPos);\n }\n }\n\n // Perform the first request\n this._performRequest();\n}\nRedirectableRequest.prototype = Object.create(Writable.prototype);\n\n// Writes buffered data to the current native request\nRedirectableRequest.prototype.write = function (data, encoding, callback) {\n // Validate input and shift parameters if necessary\n if (!(typeof data === \"string\" || typeof data === \"object\" && (\"length\" in data))) {\n throw new Error(\"data should be a string, Buffer or Uint8Array\");\n }\n if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Ignore empty buffers, since writing them doesn't invoke the callback\n // https://github.com/nodejs/node/issues/22066\n if (data.length === 0) {\n if (callback) {\n callback();\n }\n return;\n }\n // Only write when we don't exceed the maximum body length\n if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {\n this._requestBodyLength += data.length;\n this._requestBodyBuffers.push({ data: data, encoding: encoding });\n this._currentRequest.write(data, encoding, callback);\n }\n // Error when we exceed the maximum body length\n else {\n this.emit(\"error\", new Error(\"Request body larger than maxBodyLength limit\"));\n this.abort();\n }\n};\n\n// Ends the current native request\nRedirectableRequest.prototype.end = function (data, encoding, callback) {\n // Shift parameters if necessary\n if (typeof data === \"function\") {\n callback = data;\n data = encoding = null;\n }\n else if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Write data and end\n var currentRequest = this._currentRequest;\n this.write(data || \"\", encoding, function () {\n currentRequest.end(null, null, callback);\n });\n};\n\n// Sets a header value on the current native request\nRedirectableRequest.prototype.setHeader = function (name, value) {\n this._options.headers[name] = value;\n this._currentRequest.setHeader(name, value);\n};\n\n// Clears a header value on the current native request\nRedirectableRequest.prototype.removeHeader = function (name) {\n delete this._options.headers[name];\n this._currentRequest.removeHeader(name);\n};\n\n// Proxy all other public ClientRequest methods\n[\n \"abort\", \"flushHeaders\", \"getHeader\",\n \"setNoDelay\", \"setSocketKeepAlive\", \"setTimeout\",\n].forEach(function (method) {\n RedirectableRequest.prototype[method] = function (a, b) {\n return this._currentRequest[method](a, b);\n };\n});\n\n// Proxy all public ClientRequest properties\n[\"aborted\", \"connection\", \"socket\"].forEach(function (property) {\n Object.defineProperty(RedirectableRequest.prototype, property, {\n get: function () { return this._currentRequest[property]; },\n });\n});\n\n// Executes the next native request (initial or redirect)\nRedirectableRequest.prototype._performRequest = function () {\n // Load the native protocol\n var protocol = this._options.protocol;\n var nativeProtocol = this._options.nativeProtocols[protocol];\n if (!nativeProtocol) {\n this.emit(\"error\", new Error(\"Unsupported protocol \" + protocol));\n return;\n }\n\n // If specified, use the agent corresponding to the protocol\n // (HTTP and HTTPS use different types of agents)\n if (this._options.agents) {\n var scheme = protocol.substr(0, protocol.length - 1);\n this._options.agent = this._options.agents[scheme];\n }\n\n // Create the native request\n var request = this._currentRequest =\n nativeProtocol.request(this._options, this._onNativeResponse);\n this._currentUrl = url.format(this._options);\n\n // Set up event handlers\n request._redirectable = this;\n for (var event in eventHandlers) {\n /* istanbul ignore else */\n if (event) {\n request.on(event, eventHandlers[event]);\n }\n }\n\n // End a redirected request\n // (The first request must be ended explicitly with RedirectableRequest#end)\n if (this._isRedirect) {\n // Write the request entity and end.\n var i = 0;\n var buffers = this._requestBodyBuffers;\n (function writeNext() {\n if (i < buffers.length) {\n var buffer = buffers[i++];\n request.write(buffer.data, buffer.encoding, writeNext);\n }\n else {\n request.end();\n }\n }());\n }\n};\n\n// Processes a response from the current native request\nRedirectableRequest.prototype._processResponse = function (response) {\n // Store the redirected response\n if (this._options.trackRedirects) {\n this._redirects.push({\n url: this._currentUrl,\n headers: response.headers,\n statusCode: response.statusCode,\n });\n }\n\n // RFC7231§6.4: The 3xx (Redirection) class of status code indicates\n // that further action needs to be taken by the user agent in order to\n // fulfill the request. If a Location header field is provided,\n // the user agent MAY automatically redirect its request to the URI\n // referenced by the Location field value,\n // even if the specific status code is not understood.\n var location = response.headers.location;\n if (location && this._options.followRedirects !== false &&\n response.statusCode >= 300 && response.statusCode < 400) {\n // RFC7231§6.4: A client SHOULD detect and intervene\n // in cyclical redirections (i.e., \"infinite\" redirection loops).\n if (++this._redirectCount > this._options.maxRedirects) {\n this.emit(\"error\", new Error(\"Max redirects exceeded.\"));\n return;\n }\n\n // RFC7231§6.4: Automatic redirection needs to done with\n // care for methods not known to be safe […],\n // since the user might not wish to redirect an unsafe request.\n // RFC7231§6.4.7: The 307 (Temporary Redirect) status code indicates\n // that the target resource resides temporarily under a different URI\n // and the user agent MUST NOT change the request method\n // if it performs an automatic redirection to that URI.\n var header;\n var headers = this._options.headers;\n if (response.statusCode !== 307 && !(this._options.method in SAFE_METHODS)) {\n this._options.method = \"GET\";\n // Drop a possible entity and headers related to it\n this._requestBodyBuffers = [];\n for (header in headers) {\n if (/^content-/i.test(header)) {\n delete headers[header];\n }\n }\n }\n\n // Drop the Host header, as the redirect might lead to a different host\n if (!this._isRedirect) {\n for (header in headers) {\n if (/^host$/i.test(header)) {\n delete headers[header];\n }\n }\n }\n\n // Perform the redirected request\n var redirectUrl = url.resolve(this._currentUrl, location);\n debug(\"redirecting to\", redirectUrl);\n Object.assign(this._options, url.parse(redirectUrl));\n this._isRedirect = true;\n this._performRequest();\n\n // Discard the remainder of the response to avoid waiting for data\n response.destroy();\n }\n else {\n // The response is not a redirect; return it as-is\n response.responseUrl = this._currentUrl;\n response.redirects = this._redirects;\n this.emit(\"response\", response);\n\n // Clean up\n this._requestBodyBuffers = [];\n }\n};\n\n// Wraps the key/value object of protocols with redirect functionality\nfunction wrap(protocols) {\n // Default settings\n var exports = {\n maxRedirects: 21,\n maxBodyLength: 10 * 1024 * 1024,\n };\n\n // Wrap each protocol\n var nativeProtocols = {};\n Object.keys(protocols).forEach(function (scheme) {\n var protocol = scheme + \":\";\n var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];\n var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);\n\n // Executes a request, following redirects\n wrappedProtocol.request = function (options, callback) {\n if (typeof options === \"string\") {\n options = url.parse(options);\n options.maxRedirects = exports.maxRedirects;\n }\n else {\n options = Object.assign({\n protocol: protocol,\n maxRedirects: exports.maxRedirects,\n maxBodyLength: exports.maxBodyLength,\n }, options);\n }\n options.nativeProtocols = nativeProtocols;\n assert.equal(options.protocol, protocol, \"protocol mismatch\");\n debug(\"options\", options);\n return new RedirectableRequest(options, callback);\n };\n\n // Executes a GET request, following redirects\n wrappedProtocol.get = function (options, callback) {\n var request = wrappedProtocol.request(options, callback);\n request.end();\n return request;\n };\n });\n return exports;\n}\n\n// Exports\nmodule.exports = wrap({ http: http, https: https });\nmodule.exports.wrap = wrap;\n\n\n//# sourceURL=webpack:///./node_modules/follow-redirects/index.js?"); +"use strict"; +eval("\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\nfunction setup(env) {\n createDebug.debug = createDebug;\n createDebug.default = createDebug;\n createDebug.coerce = coerce;\n createDebug.disable = disable;\n createDebug.enable = enable;\n createDebug.enabled = enabled;\n createDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/_ms@2.1.1@ms/index.js\");\n Object.keys(env).forEach(function (key) {\n createDebug[key] = env[key];\n });\n /**\n * Active `debug` instances.\n */\n\n createDebug.instances = [];\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n createDebug.names = [];\n createDebug.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n createDebug.formatters = {};\n /**\n * Selects a color for a debug namespace\n * @param {String} namespace The namespace string for the for the debug instance to be colored\n * @return {Number|String} An ANSI color code for the given namespace\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0;\n\n for (var i = 0; i < namespace.length; i++) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n }\n\n createDebug.selectColor = selectColor;\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n function createDebug(namespace) {\n var prevTime;\n\n function debug() {\n // Disabled?\n if (!debug.enabled) {\n return;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var self = debug; // Set `diff` timestamp\n\n var curr = Number(new Date());\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n args[0] = createDebug.coerce(args[0]);\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O');\n } // Apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // If we encounter an escaped % then don't increase the array index\n if (match === '%%') {\n return match;\n }\n\n index++;\n var formatter = createDebug.formatters[format];\n\n if (typeof formatter === 'function') {\n var val = args[index];\n match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // Apply env-specific formatting (colors, etc.)\n\n createDebug.formatArgs.call(self, args);\n var logFn = self.log || createDebug.log;\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = createDebug.enabled(namespace);\n debug.useColors = createDebug.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n debug.extend = extend; // Debug.formatArgs = formatArgs;\n // debug.rawLog = rawLog;\n // env-specific initialization logic for debug instances\n\n if (typeof createDebug.init === 'function') {\n createDebug.init(debug);\n }\n\n createDebug.instances.push(debug);\n return debug;\n }\n\n function destroy() {\n var index = createDebug.instances.indexOf(this);\n\n if (index !== -1) {\n createDebug.instances.splice(index, 1);\n return true;\n }\n\n return false;\n }\n\n function extend(namespace, delimiter) {\n return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n createDebug.save(namespaces);\n createDebug.names = [];\n createDebug.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) {\n // ignore empty strings\n continue;\n }\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n createDebug.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < createDebug.instances.length; i++) {\n var instance = createDebug.instances[i];\n instance.enabled = createDebug.enabled(instance.namespace);\n }\n }\n /**\n * Disable debug output.\n *\n * @api public\n */\n\n\n function disable() {\n createDebug.enable('');\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i;\n var len;\n\n for (i = 0, len = createDebug.skips.length; i < len; i++) {\n if (createDebug.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = createDebug.names.length; i < len; i++) {\n if (createDebug.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) {\n return val.stack || val.message;\n }\n\n return val;\n }\n\n createDebug.enable(createDebug.load());\n return createDebug;\n}\n\nmodule.exports = setup;\n\n\n\n//# sourceURL=webpack:///./node_modules/_debug@3.2.6@debug/src/common.js?"); /***/ }), -/***/ "./node_modules/follow-redirects/node_modules/debug/src/browser.js": -/*!*************************************************************************!*\ - !*** ./node_modules/follow-redirects/node_modules/debug/src/browser.js ***! - \*************************************************************************/ +/***/ "./node_modules/_debug@3.2.6@debug/src/index.js": +/*!******************************************************!*\ + !*** ./node_modules/_debug@3.2.6@debug/src/index.js ***! + \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = __webpack_require__(/*! ./debug */ \"./node_modules/follow-redirects/node_modules/debug/src/debug.js\");\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',\n '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',\n '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',\n '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',\n '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',\n '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',\n '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',\n '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',\n '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',\n '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',\n '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // Internet Explorer and Edge do not support colors.\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n\n\n//# sourceURL=webpack:///./node_modules/follow-redirects/node_modules/debug/src/browser.js?"); +"use strict"; +eval("\n\n/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n module.exports = __webpack_require__(/*! ./browser.js */ \"./node_modules/_debug@3.2.6@debug/src/browser.js\");\n} else {\n module.exports = __webpack_require__(/*! ./node.js */ \"./node_modules/_debug@3.2.6@debug/src/node.js\");\n}\n\n\n\n//# sourceURL=webpack:///./node_modules/_debug@3.2.6@debug/src/index.js?"); /***/ }), -/***/ "./node_modules/follow-redirects/node_modules/debug/src/debug.js": -/*!***********************************************************************!*\ - !*** ./node_modules/follow-redirects/node_modules/debug/src/debug.js ***! - \***********************************************************************/ +/***/ "./node_modules/_debug@3.2.6@debug/src/node.js": +/*!*****************************************************!*\ + !*** ./node_modules/_debug@3.2.6@debug/src/node.js ***! + \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = __webpack_require__(/*! ms */ \"./node_modules/follow-redirects/node_modules/ms/index.js\");\n\n/**\n * Active `debug` instances.\n */\nexports.instances = [];\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n var prevTime;\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n exports.instances.push(debug);\n\n return debug;\n}\n\nfunction destroy () {\n var index = exports.instances.indexOf(this);\n if (index !== -1) {\n exports.instances.splice(index, 1);\n return true;\n } else {\n return false;\n }\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < exports.instances.length; i++) {\n var instance = exports.instances[i];\n instance.enabled = exports.enabled(instance.namespace);\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n\n//# sourceURL=webpack:///./node_modules/follow-redirects/node_modules/debug/src/debug.js?"); +"use strict"; +eval("\n\n/**\n * Module dependencies.\n */\nvar tty = __webpack_require__(/*! tty */ \"tty\");\n\nvar util = __webpack_require__(/*! util */ \"util\");\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n // eslint-disable-next-line import/no-extraneous-dependencies\n var supportsColor = __webpack_require__(/*! supports-color */ \"./node_modules/_supports-color@5.5.0@supports-color/index.js\");\n\n if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n exports.colors = [20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221];\n }\n} catch (error) {} // Swallow - we only care if `supports-color` is available; it doesn't have to be.\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // Camel-case\n var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) {\n return k.toUpperCase();\n }); // Coerce string value into JS value\n\n var val = process.env[key];\n\n if (/^(yes|on|true|enabled)$/i.test(val)) {\n val = true;\n } else if (/^(no|off|false|disabled)$/i.test(val)) {\n val = false;\n } else if (val === 'null') {\n val = null;\n } else {\n val = Number(val);\n }\n\n obj[prop] = val;\n return obj;\n}, {});\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\n\nfunction formatArgs(args) {\n var name = this.namespace,\n useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var colorCode = \"\\x1B[3\" + (c < 8 ? c : '8;5;' + c);\n var prefix = \" \".concat(colorCode, \";1m\").concat(name, \" \\x1B[0m\");\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + \"\\x1B[0m\");\n } else {\n args[0] = getDate() + name + ' ' + args[0];\n }\n}\n\nfunction getDate() {\n if (exports.inspectOpts.hideDate) {\n return '';\n }\n\n return new Date().toISOString() + ' ';\n}\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\n\nfunction log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\nfunction save(namespaces) {\n if (namespaces) {\n process.env.DEBUG = namespaces;\n } else {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n }\n}\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\nfunction load() {\n return process.env.DEBUG;\n}\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\n\nfunction init(debug) {\n debug.inspectOpts = {};\n var keys = Object.keys(exports.inspectOpts);\n\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"./node_modules/_debug@3.2.6@debug/src/common.js\")(exports);\nvar formatters = module.exports.formatters;\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts).replace(/\\s*\\n\\s*/g, ' ');\n};\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\n\nformatters.O = function (v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n\n\n//# sourceURL=webpack:///./node_modules/_debug@3.2.6@debug/src/node.js?"); /***/ }), -/***/ "./node_modules/follow-redirects/node_modules/debug/src/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/follow-redirects/node_modules/debug/src/index.js ***! - \***********************************************************************/ +/***/ "./node_modules/_follow-redirects@1.7.0@follow-redirects/index.js": +/*!************************************************************************!*\ + !*** ./node_modules/_follow-redirects@1.7.0@follow-redirects/index.js ***! + \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer') {\n module.exports = __webpack_require__(/*! ./browser.js */ \"./node_modules/follow-redirects/node_modules/debug/src/browser.js\");\n} else {\n module.exports = __webpack_require__(/*! ./node.js */ \"./node_modules/follow-redirects/node_modules/debug/src/node.js\");\n}\n\n\n//# sourceURL=webpack:///./node_modules/follow-redirects/node_modules/debug/src/index.js?"); +eval("var url = __webpack_require__(/*! url */ \"url\");\nvar URL = url.URL;\nvar http = __webpack_require__(/*! http */ \"http\");\nvar https = __webpack_require__(/*! https */ \"https\");\nvar assert = __webpack_require__(/*! assert */ \"assert\");\nvar Writable = __webpack_require__(/*! stream */ \"stream\").Writable;\nvar debug = __webpack_require__(/*! debug */ \"./node_modules/_debug@3.2.6@debug/src/index.js\")(\"follow-redirects\");\n\n// RFC7231§4.2.1: Of the request methods defined by this specification,\n// the GET, HEAD, OPTIONS, and TRACE methods are defined to be safe.\nvar SAFE_METHODS = { GET: true, HEAD: true, OPTIONS: true, TRACE: true };\n\n// Create handlers that pass events from native requests\nvar eventHandlers = Object.create(null);\n[\"abort\", \"aborted\", \"error\", \"socket\", \"timeout\"].forEach(function (event) {\n eventHandlers[event] = function (arg) {\n this._redirectable.emit(event, arg);\n };\n});\n\n// An HTTP(S) request that can be redirected\nfunction RedirectableRequest(options, responseCallback) {\n // Initialize the request\n Writable.call(this);\n options.headers = options.headers || {};\n this._options = options;\n this._ended = false;\n this._ending = false;\n this._redirectCount = 0;\n this._redirects = [];\n this._requestBodyLength = 0;\n this._requestBodyBuffers = [];\n\n // Since http.request treats host as an alias of hostname,\n // but the url module interprets host as hostname plus port,\n // eliminate the host property to avoid confusion.\n if (options.host) {\n // Use hostname if set, because it has precedence\n if (!options.hostname) {\n options.hostname = options.host;\n }\n delete options.host;\n }\n\n // Attach a callback if passed\n if (responseCallback) {\n this.on(\"response\", responseCallback);\n }\n\n // React to responses of native requests\n var self = this;\n this._onNativeResponse = function (response) {\n self._processResponse(response);\n };\n\n // Complete the URL object when necessary\n if (!options.pathname && options.path) {\n var searchPos = options.path.indexOf(\"?\");\n if (searchPos < 0) {\n options.pathname = options.path;\n }\n else {\n options.pathname = options.path.substring(0, searchPos);\n options.search = options.path.substring(searchPos);\n }\n }\n\n // Perform the first request\n this._performRequest();\n}\nRedirectableRequest.prototype = Object.create(Writable.prototype);\n\n// Writes buffered data to the current native request\nRedirectableRequest.prototype.write = function (data, encoding, callback) {\n // Writing is not allowed if end has been called\n if (this._ending) {\n throw new Error(\"write after end\");\n }\n\n // Validate input and shift parameters if necessary\n if (!(typeof data === \"string\" || typeof data === \"object\" && (\"length\" in data))) {\n throw new Error(\"data should be a string, Buffer or Uint8Array\");\n }\n if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Ignore empty buffers, since writing them doesn't invoke the callback\n // https://github.com/nodejs/node/issues/22066\n if (data.length === 0) {\n if (callback) {\n callback();\n }\n return;\n }\n // Only write when we don't exceed the maximum body length\n if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {\n this._requestBodyLength += data.length;\n this._requestBodyBuffers.push({ data: data, encoding: encoding });\n this._currentRequest.write(data, encoding, callback);\n }\n // Error when we exceed the maximum body length\n else {\n this.emit(\"error\", new Error(\"Request body larger than maxBodyLength limit\"));\n this.abort();\n }\n};\n\n// Ends the current native request\nRedirectableRequest.prototype.end = function (data, encoding, callback) {\n // Shift parameters if necessary\n if (typeof data === \"function\") {\n callback = data;\n data = encoding = null;\n }\n else if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Write data if needed and end\n if (!data) {\n this._ended = this._ending = true;\n this._currentRequest.end(null, null, callback);\n }\n else {\n var self = this;\n var currentRequest = this._currentRequest;\n this.write(data, encoding, function () {\n self._ended = true;\n currentRequest.end(null, null, callback);\n });\n this._ending = true;\n }\n};\n\n// Sets a header value on the current native request\nRedirectableRequest.prototype.setHeader = function (name, value) {\n this._options.headers[name] = value;\n this._currentRequest.setHeader(name, value);\n};\n\n// Clears a header value on the current native request\nRedirectableRequest.prototype.removeHeader = function (name) {\n delete this._options.headers[name];\n this._currentRequest.removeHeader(name);\n};\n\n// Global timeout for all underlying requests\nRedirectableRequest.prototype.setTimeout = function (msecs, callback) {\n if (callback) {\n this.once(\"timeout\", callback);\n }\n\n if (this.socket) {\n startTimer(this, msecs);\n }\n else {\n var self = this;\n this._currentRequest.once(\"socket\", function () {\n startTimer(self, msecs);\n });\n }\n\n this.once(\"response\", clearTimer);\n this.once(\"error\", clearTimer);\n\n return this;\n};\n\nfunction startTimer(request, msecs) {\n clearTimeout(request._timeout);\n request._timeout = setTimeout(function () {\n request.emit(\"timeout\");\n }, msecs);\n}\n\nfunction clearTimer() {\n clearTimeout(this._timeout);\n}\n\n// Proxy all other public ClientRequest methods\n[\n \"abort\", \"flushHeaders\", \"getHeader\",\n \"setNoDelay\", \"setSocketKeepAlive\",\n].forEach(function (method) {\n RedirectableRequest.prototype[method] = function (a, b) {\n return this._currentRequest[method](a, b);\n };\n});\n\n// Proxy all public ClientRequest properties\n[\"aborted\", \"connection\", \"socket\"].forEach(function (property) {\n Object.defineProperty(RedirectableRequest.prototype, property, {\n get: function () { return this._currentRequest[property]; },\n });\n});\n\n// Executes the next native request (initial or redirect)\nRedirectableRequest.prototype._performRequest = function () {\n // Load the native protocol\n var protocol = this._options.protocol;\n var nativeProtocol = this._options.nativeProtocols[protocol];\n if (!nativeProtocol) {\n this.emit(\"error\", new Error(\"Unsupported protocol \" + protocol));\n return;\n }\n\n // If specified, use the agent corresponding to the protocol\n // (HTTP and HTTPS use different types of agents)\n if (this._options.agents) {\n var scheme = protocol.substr(0, protocol.length - 1);\n this._options.agent = this._options.agents[scheme];\n }\n\n // Create the native request\n var request = this._currentRequest =\n nativeProtocol.request(this._options, this._onNativeResponse);\n this._currentUrl = url.format(this._options);\n\n // Set up event handlers\n request._redirectable = this;\n for (var event in eventHandlers) {\n /* istanbul ignore else */\n if (event) {\n request.on(event, eventHandlers[event]);\n }\n }\n\n // End a redirected request\n // (The first request must be ended explicitly with RedirectableRequest#end)\n if (this._isRedirect) {\n // Write the request entity and end.\n var i = 0;\n var self = this;\n var buffers = this._requestBodyBuffers;\n (function writeNext(error) {\n // Only write if this request has not been redirected yet\n /* istanbul ignore else */\n if (request === self._currentRequest) {\n // Report any write errors\n /* istanbul ignore if */\n if (error) {\n self.emit(\"error\", error);\n }\n // Write the next buffer if there are still left\n else if (i < buffers.length) {\n var buffer = buffers[i++];\n /* istanbul ignore else */\n if (!request.finished) {\n request.write(buffer.data, buffer.encoding, writeNext);\n }\n }\n // End the request if `end` has been called on us\n else if (self._ended) {\n request.end();\n }\n }\n }());\n }\n};\n\n// Processes a response from the current native request\nRedirectableRequest.prototype._processResponse = function (response) {\n // Store the redirected response\n if (this._options.trackRedirects) {\n this._redirects.push({\n url: this._currentUrl,\n headers: response.headers,\n statusCode: response.statusCode,\n });\n }\n\n // RFC7231§6.4: The 3xx (Redirection) class of status code indicates\n // that further action needs to be taken by the user agent in order to\n // fulfill the request. If a Location header field is provided,\n // the user agent MAY automatically redirect its request to the URI\n // referenced by the Location field value,\n // even if the specific status code is not understood.\n var location = response.headers.location;\n if (location && this._options.followRedirects !== false &&\n response.statusCode >= 300 && response.statusCode < 400) {\n // Abort the current request\n this._currentRequest.removeAllListeners();\n this._currentRequest.on(\"error\", noop);\n this._currentRequest.abort();\n\n // RFC7231§6.4: A client SHOULD detect and intervene\n // in cyclical redirections (i.e., \"infinite\" redirection loops).\n if (++this._redirectCount > this._options.maxRedirects) {\n this.emit(\"error\", new Error(\"Max redirects exceeded.\"));\n return;\n }\n\n // RFC7231§6.4: Automatic redirection needs to done with\n // care for methods not known to be safe […],\n // since the user might not wish to redirect an unsafe request.\n // RFC7231§6.4.7: The 307 (Temporary Redirect) status code indicates\n // that the target resource resides temporarily under a different URI\n // and the user agent MUST NOT change the request method\n // if it performs an automatic redirection to that URI.\n var header;\n var headers = this._options.headers;\n if (response.statusCode !== 307 && !(this._options.method in SAFE_METHODS)) {\n this._options.method = \"GET\";\n // Drop a possible entity and headers related to it\n this._requestBodyBuffers = [];\n for (header in headers) {\n if (/^content-/i.test(header)) {\n delete headers[header];\n }\n }\n }\n\n // Drop the Host header, as the redirect might lead to a different host\n if (!this._isRedirect) {\n for (header in headers) {\n if (/^host$/i.test(header)) {\n delete headers[header];\n }\n }\n }\n\n // Perform the redirected request\n var redirectUrl = url.resolve(this._currentUrl, location);\n debug(\"redirecting to\", redirectUrl);\n Object.assign(this._options, url.parse(redirectUrl));\n this._isRedirect = true;\n this._performRequest();\n\n // Discard the remainder of the response to avoid waiting for data\n response.destroy();\n }\n else {\n // The response is not a redirect; return it as-is\n response.responseUrl = this._currentUrl;\n response.redirects = this._redirects;\n this.emit(\"response\", response);\n\n // Clean up\n this._requestBodyBuffers = [];\n }\n};\n\n// Wraps the key/value object of protocols with redirect functionality\nfunction wrap(protocols) {\n // Default settings\n var exports = {\n maxRedirects: 21,\n maxBodyLength: 10 * 1024 * 1024,\n };\n\n // Wrap each protocol\n var nativeProtocols = {};\n Object.keys(protocols).forEach(function (scheme) {\n var protocol = scheme + \":\";\n var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];\n var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);\n\n // Executes a request, following redirects\n wrappedProtocol.request = function (input, options, callback) {\n // Parse parameters\n if (typeof input === \"string\") {\n var urlStr = input;\n try {\n input = urlToOptions(new URL(urlStr));\n }\n catch (err) {\n /* istanbul ignore next */\n input = url.parse(urlStr);\n }\n }\n else if (URL && (input instanceof URL)) {\n input = urlToOptions(input);\n }\n else {\n callback = options;\n options = input;\n input = { protocol: protocol };\n }\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n\n // Set defaults\n options = Object.assign({\n maxRedirects: exports.maxRedirects,\n maxBodyLength: exports.maxBodyLength,\n }, input, options);\n options.nativeProtocols = nativeProtocols;\n\n assert.equal(options.protocol, protocol, \"protocol mismatch\");\n debug(\"options\", options);\n return new RedirectableRequest(options, callback);\n };\n\n // Executes a GET request, following redirects\n wrappedProtocol.get = function (input, options, callback) {\n var request = wrappedProtocol.request(input, options, callback);\n request.end();\n return request;\n };\n });\n return exports;\n}\n\n/* istanbul ignore next */\nfunction noop() { /* empty */ }\n\n// from https://github.com/nodejs/node/blob/master/lib/internal/url.js\nfunction urlToOptions(urlObject) {\n var options = {\n protocol: urlObject.protocol,\n hostname: urlObject.hostname.startsWith(\"[\") ?\n /* istanbul ignore next */\n urlObject.hostname.slice(1, -1) :\n urlObject.hostname,\n hash: urlObject.hash,\n search: urlObject.search,\n pathname: urlObject.pathname,\n path: urlObject.pathname + urlObject.search,\n href: urlObject.href,\n };\n if (urlObject.port !== \"\") {\n options.port = Number(urlObject.port);\n }\n return options;\n}\n\n// Exports\nmodule.exports = wrap({ http: http, https: https });\nmodule.exports.wrap = wrap;\n\n\n//# sourceURL=webpack:///./node_modules/_follow-redirects@1.7.0@follow-redirects/index.js?"); /***/ }), -/***/ "./node_modules/follow-redirects/node_modules/debug/src/node.js": -/*!**********************************************************************!*\ - !*** ./node_modules/follow-redirects/node_modules/debug/src/node.js ***! - \**********************************************************************/ +/***/ "./node_modules/_has-flag@3.0.0@has-flag/index.js": +/*!********************************************************!*\ + !*** ./node_modules/_has-flag@3.0.0@has-flag/index.js ***! + \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("/**\n * Module dependencies.\n */\n\nvar tty = __webpack_require__(/*! tty */ \"tty\");\nvar util = __webpack_require__(/*! util */ \"util\");\n\n/**\n * This is the Node.js implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = __webpack_require__(/*! ./debug */ \"./node_modules/follow-redirects/node_modules/debug/src/debug.js\");\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n\n/**\n * Colors.\n */\n\nexports.colors = [ 6, 2, 3, 4, 5, 1 ];\n\ntry {\n var supportsColor = __webpack_require__(/*! supports-color */ \"./node_modules/supports-color/index.js\");\n if (supportsColor && supportsColor.level >= 2) {\n exports.colors = [\n 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68,\n 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134,\n 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,\n 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204,\n 205, 206, 207, 208, 209, 214, 215, 220, 221\n ];\n }\n} catch (err) {\n // swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // camel-case\n var prop = key\n .substring(6)\n .toLowerCase()\n .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });\n\n // coerce string value into JS value\n var val = process.env[key];\n if (/^(yes|on|true|enabled)$/i.test(val)) val = true;\n else if (/^(no|off|false|disabled)$/i.test(val)) val = false;\n else if (val === 'null') val = null;\n else val = Number(val);\n\n obj[prop] = val;\n return obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nexports.formatters.o = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n').map(function(str) {\n return str.trim()\n }).join(' ');\n};\n\n/**\n * Map %o to `util.inspect()`, allowing multiple lines if needed.\n */\n\nexports.formatters.O = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var name = this.namespace;\n var useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var colorCode = '\\u001b[3' + (c < 8 ? c : '8;5;' + c);\n var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\\u001b[0m';\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\\u001b[0m');\n } else {\n args[0] = getDate() + name + ' ' + args[0];\n }\n}\n\nfunction getDate() {\n if (exports.inspectOpts.hideDate) {\n return '';\n } else {\n return new Date().toISOString() + ' ';\n }\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n if (null == namespaces) {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n } else {\n process.env.DEBUG = namespaces;\n }\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n return process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init (debug) {\n debug.inspectOpts = {};\n\n var keys = Object.keys(exports.inspectOpts);\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\n/**\n * Enable namespaces listed in `process.env.DEBUG` initially.\n */\n\nexports.enable(load());\n\n\n//# sourceURL=webpack:///./node_modules/follow-redirects/node_modules/debug/src/node.js?"); +"use strict"; +eval("\nmodule.exports = (flag, argv) => {\n\targv = argv || process.argv;\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst pos = argv.indexOf(prefix + flag);\n\tconst terminatorPos = argv.indexOf('--');\n\treturn pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);\n};\n\n\n//# sourceURL=webpack:///./node_modules/_has-flag@3.0.0@has-flag/index.js?"); /***/ }), -/***/ "./node_modules/follow-redirects/node_modules/ms/index.js": -/*!****************************************************************!*\ - !*** ./node_modules/follow-redirects/node_modules/ms/index.js ***! - \****************************************************************/ +/***/ "./node_modules/_is-buffer@1.1.6@is-buffer/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/_is-buffer@1.1.6@is-buffer/index.js ***! + \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { -eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n\n//# sourceURL=webpack:///./node_modules/follow-redirects/node_modules/ms/index.js?"); +eval("/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n\n\n//# sourceURL=webpack:///./node_modules/_is-buffer@1.1.6@is-buffer/index.js?"); /***/ }), -/***/ "./node_modules/has-flag/index.js": -/*!****************************************!*\ - !*** ./node_modules/has-flag/index.js ***! - \****************************************/ +/***/ "./node_modules/_js-sha1@0.6.0@js-sha1/src/sha1.js": +/*!*********************************************************!*\ + !*** ./node_modules/_js-sha1@0.6.0@js-sha1/src/sha1.js ***! + \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("\nmodule.exports = (flag, argv) => {\n\targv = argv || process.argv;\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst pos = argv.indexOf(prefix + flag);\n\tconst terminatorPos = argv.indexOf('--');\n\treturn pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);\n};\n\n\n//# sourceURL=webpack:///./node_modules/has-flag/index.js?"); +eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*\n * [js-sha1]{@link https://github.com/emn178/js-sha1}\n *\n * @version 0.6.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2014-2017\n * @license MIT\n */\n/*jslint bitwise: true */\n(function() {\n 'use strict';\n\n var root = typeof window === 'object' ? window : {};\n var NODE_JS = !root.JS_SHA1_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n }\n var COMMON_JS = !root.JS_SHA1_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = true && __webpack_require__(/*! !webpack amd options */ \"./node_modules/_webpack@4.30.0@webpack/buildin/amd-options.js\");\n var HEX_CHARS = '0123456789abcdef'.split('');\n var EXTRA = [-2147483648, 8388608, 32768, 128];\n var SHIFT = [24, 16, 8, 0];\n var OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer'];\n\n var blocks = [];\n\n var createOutputMethod = function (outputType) {\n return function (message) {\n return new Sha1(true).update(message)[outputType]();\n };\n };\n\n var createMethod = function () {\n var method = createOutputMethod('hex');\n if (NODE_JS) {\n method = nodeWrap(method);\n }\n method.create = function () {\n return new Sha1();\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createOutputMethod(type);\n }\n return method;\n };\n\n var nodeWrap = function (method) {\n var crypto = eval(\"require('crypto')\");\n var Buffer = eval(\"require('buffer').Buffer\");\n var nodeMethod = function (message) {\n if (typeof message === 'string') {\n return crypto.createHash('sha1').update(message, 'utf8').digest('hex');\n } else if (message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (message.length === undefined) {\n return method(message);\n }\n return crypto.createHash('sha1').update(new Buffer(message)).digest('hex');\n };\n return nodeMethod;\n };\n\n function Sha1(sharedMemory) {\n if (sharedMemory) {\n blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n this.blocks = blocks;\n } else {\n this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n }\n\n this.h0 = 0x67452301;\n this.h1 = 0xEFCDAB89;\n this.h2 = 0x98BADCFE;\n this.h3 = 0x10325476;\n this.h4 = 0xC3D2E1F0;\n\n this.block = this.start = this.bytes = this.hBytes = 0;\n this.finalized = this.hashed = false;\n this.first = true;\n }\n\n Sha1.prototype.update = function (message) {\n if (this.finalized) {\n return;\n }\n var notString = typeof(message) !== 'string';\n if (notString && message.constructor === root.ArrayBuffer) {\n message = new Uint8Array(message);\n }\n var code, index = 0, i, length = message.length || 0, blocks = this.blocks;\n\n while (index < length) {\n if (this.hashed) {\n this.hashed = false;\n blocks[0] = this.block;\n blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n\n if(notString) {\n for (i = this.start; index < length && i < 64; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < 64; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n\n this.lastByteIndex = i;\n this.bytes += i - this.start;\n if (i >= 64) {\n this.block = blocks[16];\n this.start = i - 64;\n this.hash();\n this.hashed = true;\n } else {\n this.start = i;\n }\n }\n if (this.bytes > 4294967295) {\n this.hBytes += this.bytes / 4294967296 << 0;\n this.bytes = this.bytes % 4294967296;\n }\n return this;\n };\n\n Sha1.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex;\n blocks[16] = this.block;\n blocks[i >> 2] |= EXTRA[i & 3];\n this.block = blocks[16];\n if (i >= 56) {\n if (!this.hashed) {\n this.hash();\n }\n blocks[0] = this.block;\n blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n blocks[14] = this.hBytes << 3 | this.bytes >>> 29;\n blocks[15] = this.bytes << 3;\n this.hash();\n };\n\n Sha1.prototype.hash = function () {\n var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4;\n var f, j, t, blocks = this.blocks;\n\n for(j = 16; j < 80; ++j) {\n t = blocks[j - 3] ^ blocks[j - 8] ^ blocks[j - 14] ^ blocks[j - 16];\n blocks[j] = (t << 1) | (t >>> 31);\n }\n\n for(j = 0; j < 20; j += 5) {\n f = (b & c) | ((~b) & d);\n t = (a << 5) | (a >>> 27);\n e = t + f + e + 1518500249 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = (a & b) | ((~a) & c);\n t = (e << 5) | (e >>> 27);\n d = t + f + d + 1518500249 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = (e & a) | ((~e) & b);\n t = (d << 5) | (d >>> 27);\n c = t + f + c + 1518500249 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = (d & e) | ((~d) & a);\n t = (c << 5) | (c >>> 27);\n b = t + f + b + 1518500249 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = (c & d) | ((~c) & e);\n t = (b << 5) | (b >>> 27);\n a = t + f + a + 1518500249 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 40; j += 5) {\n f = b ^ c ^ d;\n t = (a << 5) | (a >>> 27);\n e = t + f + e + 1859775393 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = a ^ b ^ c;\n t = (e << 5) | (e >>> 27);\n d = t + f + d + 1859775393 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = e ^ a ^ b;\n t = (d << 5) | (d >>> 27);\n c = t + f + c + 1859775393 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = d ^ e ^ a;\n t = (c << 5) | (c >>> 27);\n b = t + f + b + 1859775393 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = c ^ d ^ e;\n t = (b << 5) | (b >>> 27);\n a = t + f + a + 1859775393 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 60; j += 5) {\n f = (b & c) | (b & d) | (c & d);\n t = (a << 5) | (a >>> 27);\n e = t + f + e - 1894007588 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = (a & b) | (a & c) | (b & c);\n t = (e << 5) | (e >>> 27);\n d = t + f + d - 1894007588 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = (e & a) | (e & b) | (a & b);\n t = (d << 5) | (d >>> 27);\n c = t + f + c - 1894007588 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = (d & e) | (d & a) | (e & a);\n t = (c << 5) | (c >>> 27);\n b = t + f + b - 1894007588 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = (c & d) | (c & e) | (d & e);\n t = (b << 5) | (b >>> 27);\n a = t + f + a - 1894007588 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 80; j += 5) {\n f = b ^ c ^ d;\n t = (a << 5) | (a >>> 27);\n e = t + f + e - 899497514 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = a ^ b ^ c;\n t = (e << 5) | (e >>> 27);\n d = t + f + d - 899497514 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = e ^ a ^ b;\n t = (d << 5) | (d >>> 27);\n c = t + f + c - 899497514 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = d ^ e ^ a;\n t = (c << 5) | (c >>> 27);\n b = t + f + b - 899497514 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = c ^ d ^ e;\n t = (b << 5) | (b >>> 27);\n a = t + f + a - 899497514 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n this.h0 = this.h0 + a << 0;\n this.h1 = this.h1 + b << 0;\n this.h2 = this.h2 + c << 0;\n this.h3 = this.h3 + d << 0;\n this.h4 = this.h4 + e << 0;\n };\n\n Sha1.prototype.hex = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;\n\n return HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +\n HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +\n HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +\n HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +\n HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +\n HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +\n HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +\n HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +\n HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +\n HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +\n HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +\n HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +\n HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F] +\n HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +\n HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +\n HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +\n HEX_CHARS[(h4 >> 28) & 0x0F] + HEX_CHARS[(h4 >> 24) & 0x0F] +\n HEX_CHARS[(h4 >> 20) & 0x0F] + HEX_CHARS[(h4 >> 16) & 0x0F] +\n HEX_CHARS[(h4 >> 12) & 0x0F] + HEX_CHARS[(h4 >> 8) & 0x0F] +\n HEX_CHARS[(h4 >> 4) & 0x0F] + HEX_CHARS[h4 & 0x0F];\n };\n\n Sha1.prototype.toString = Sha1.prototype.hex;\n\n Sha1.prototype.digest = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;\n\n return [\n (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, h0 & 0xFF,\n (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, h1 & 0xFF,\n (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, h2 & 0xFF,\n (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, h3 & 0xFF,\n (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, h4 & 0xFF\n ];\n };\n\n Sha1.prototype.array = Sha1.prototype.digest;\n\n Sha1.prototype.arrayBuffer = function () {\n this.finalize();\n\n var buffer = new ArrayBuffer(20);\n var dataView = new DataView(buffer);\n dataView.setUint32(0, this.h0);\n dataView.setUint32(4, this.h1);\n dataView.setUint32(8, this.h2);\n dataView.setUint32(12, this.h3);\n dataView.setUint32(16, this.h4);\n return buffer;\n };\n\n var exports = createMethod();\n\n if (COMMON_JS) {\n module.exports = exports;\n } else {\n root.sha1 = exports;\n if (AMD) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n return exports;\n }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n }\n }\n})();\n\n\n//# sourceURL=webpack:///./node_modules/_js-sha1@0.6.0@js-sha1/src/sha1.js?"); /***/ }), -/***/ "./node_modules/js-sha1/src/sha1.js": -/*!******************************************!*\ - !*** ./node_modules/js-sha1/src/sha1.js ***! - \******************************************/ +/***/ "./node_modules/_ms@2.1.1@ms/index.js": +/*!********************************************!*\ + !*** ./node_modules/_ms@2.1.1@ms/index.js ***! + \********************************************/ /*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { -eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*\n * [js-sha1]{@link https://github.com/emn178/js-sha1}\n *\n * @version 0.6.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2014-2017\n * @license MIT\n */\n/*jslint bitwise: true */\n(function() {\n 'use strict';\n\n var root = typeof window === 'object' ? window : {};\n var NODE_JS = !root.JS_SHA1_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n }\n var COMMON_JS = !root.JS_SHA1_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = true && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\");\n var HEX_CHARS = '0123456789abcdef'.split('');\n var EXTRA = [-2147483648, 8388608, 32768, 128];\n var SHIFT = [24, 16, 8, 0];\n var OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer'];\n\n var blocks = [];\n\n var createOutputMethod = function (outputType) {\n return function (message) {\n return new Sha1(true).update(message)[outputType]();\n };\n };\n\n var createMethod = function () {\n var method = createOutputMethod('hex');\n if (NODE_JS) {\n method = nodeWrap(method);\n }\n method.create = function () {\n return new Sha1();\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createOutputMethod(type);\n }\n return method;\n };\n\n var nodeWrap = function (method) {\n var crypto = eval(\"require('crypto')\");\n var Buffer = eval(\"require('buffer').Buffer\");\n var nodeMethod = function (message) {\n if (typeof message === 'string') {\n return crypto.createHash('sha1').update(message, 'utf8').digest('hex');\n } else if (message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (message.length === undefined) {\n return method(message);\n }\n return crypto.createHash('sha1').update(new Buffer(message)).digest('hex');\n };\n return nodeMethod;\n };\n\n function Sha1(sharedMemory) {\n if (sharedMemory) {\n blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n this.blocks = blocks;\n } else {\n this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n }\n\n this.h0 = 0x67452301;\n this.h1 = 0xEFCDAB89;\n this.h2 = 0x98BADCFE;\n this.h3 = 0x10325476;\n this.h4 = 0xC3D2E1F0;\n\n this.block = this.start = this.bytes = this.hBytes = 0;\n this.finalized = this.hashed = false;\n this.first = true;\n }\n\n Sha1.prototype.update = function (message) {\n if (this.finalized) {\n return;\n }\n var notString = typeof(message) !== 'string';\n if (notString && message.constructor === root.ArrayBuffer) {\n message = new Uint8Array(message);\n }\n var code, index = 0, i, length = message.length || 0, blocks = this.blocks;\n\n while (index < length) {\n if (this.hashed) {\n this.hashed = false;\n blocks[0] = this.block;\n blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n\n if(notString) {\n for (i = this.start; index < length && i < 64; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < 64; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n\n this.lastByteIndex = i;\n this.bytes += i - this.start;\n if (i >= 64) {\n this.block = blocks[16];\n this.start = i - 64;\n this.hash();\n this.hashed = true;\n } else {\n this.start = i;\n }\n }\n if (this.bytes > 4294967295) {\n this.hBytes += this.bytes / 4294967296 << 0;\n this.bytes = this.bytes % 4294967296;\n }\n return this;\n };\n\n Sha1.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex;\n blocks[16] = this.block;\n blocks[i >> 2] |= EXTRA[i & 3];\n this.block = blocks[16];\n if (i >= 56) {\n if (!this.hashed) {\n this.hash();\n }\n blocks[0] = this.block;\n blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n blocks[14] = this.hBytes << 3 | this.bytes >>> 29;\n blocks[15] = this.bytes << 3;\n this.hash();\n };\n\n Sha1.prototype.hash = function () {\n var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4;\n var f, j, t, blocks = this.blocks;\n\n for(j = 16; j < 80; ++j) {\n t = blocks[j - 3] ^ blocks[j - 8] ^ blocks[j - 14] ^ blocks[j - 16];\n blocks[j] = (t << 1) | (t >>> 31);\n }\n\n for(j = 0; j < 20; j += 5) {\n f = (b & c) | ((~b) & d);\n t = (a << 5) | (a >>> 27);\n e = t + f + e + 1518500249 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = (a & b) | ((~a) & c);\n t = (e << 5) | (e >>> 27);\n d = t + f + d + 1518500249 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = (e & a) | ((~e) & b);\n t = (d << 5) | (d >>> 27);\n c = t + f + c + 1518500249 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = (d & e) | ((~d) & a);\n t = (c << 5) | (c >>> 27);\n b = t + f + b + 1518500249 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = (c & d) | ((~c) & e);\n t = (b << 5) | (b >>> 27);\n a = t + f + a + 1518500249 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 40; j += 5) {\n f = b ^ c ^ d;\n t = (a << 5) | (a >>> 27);\n e = t + f + e + 1859775393 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = a ^ b ^ c;\n t = (e << 5) | (e >>> 27);\n d = t + f + d + 1859775393 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = e ^ a ^ b;\n t = (d << 5) | (d >>> 27);\n c = t + f + c + 1859775393 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = d ^ e ^ a;\n t = (c << 5) | (c >>> 27);\n b = t + f + b + 1859775393 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = c ^ d ^ e;\n t = (b << 5) | (b >>> 27);\n a = t + f + a + 1859775393 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 60; j += 5) {\n f = (b & c) | (b & d) | (c & d);\n t = (a << 5) | (a >>> 27);\n e = t + f + e - 1894007588 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = (a & b) | (a & c) | (b & c);\n t = (e << 5) | (e >>> 27);\n d = t + f + d - 1894007588 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = (e & a) | (e & b) | (a & b);\n t = (d << 5) | (d >>> 27);\n c = t + f + c - 1894007588 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = (d & e) | (d & a) | (e & a);\n t = (c << 5) | (c >>> 27);\n b = t + f + b - 1894007588 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = (c & d) | (c & e) | (d & e);\n t = (b << 5) | (b >>> 27);\n a = t + f + a - 1894007588 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 80; j += 5) {\n f = b ^ c ^ d;\n t = (a << 5) | (a >>> 27);\n e = t + f + e - 899497514 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = a ^ b ^ c;\n t = (e << 5) | (e >>> 27);\n d = t + f + d - 899497514 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = e ^ a ^ b;\n t = (d << 5) | (d >>> 27);\n c = t + f + c - 899497514 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = d ^ e ^ a;\n t = (c << 5) | (c >>> 27);\n b = t + f + b - 899497514 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = c ^ d ^ e;\n t = (b << 5) | (b >>> 27);\n a = t + f + a - 899497514 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n this.h0 = this.h0 + a << 0;\n this.h1 = this.h1 + b << 0;\n this.h2 = this.h2 + c << 0;\n this.h3 = this.h3 + d << 0;\n this.h4 = this.h4 + e << 0;\n };\n\n Sha1.prototype.hex = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;\n\n return HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +\n HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +\n HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +\n HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +\n HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +\n HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +\n HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +\n HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +\n HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +\n HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +\n HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +\n HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +\n HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F] +\n HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +\n HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +\n HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +\n HEX_CHARS[(h4 >> 28) & 0x0F] + HEX_CHARS[(h4 >> 24) & 0x0F] +\n HEX_CHARS[(h4 >> 20) & 0x0F] + HEX_CHARS[(h4 >> 16) & 0x0F] +\n HEX_CHARS[(h4 >> 12) & 0x0F] + HEX_CHARS[(h4 >> 8) & 0x0F] +\n HEX_CHARS[(h4 >> 4) & 0x0F] + HEX_CHARS[h4 & 0x0F];\n };\n\n Sha1.prototype.toString = Sha1.prototype.hex;\n\n Sha1.prototype.digest = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;\n\n return [\n (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, h0 & 0xFF,\n (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, h1 & 0xFF,\n (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, h2 & 0xFF,\n (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, h3 & 0xFF,\n (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, h4 & 0xFF\n ];\n };\n\n Sha1.prototype.array = Sha1.prototype.digest;\n\n Sha1.prototype.arrayBuffer = function () {\n this.finalize();\n\n var buffer = new ArrayBuffer(20);\n var dataView = new DataView(buffer);\n dataView.setUint32(0, this.h0);\n dataView.setUint32(4, this.h1);\n dataView.setUint32(8, this.h2);\n dataView.setUint32(12, this.h3);\n dataView.setUint32(16, this.h4);\n return buffer;\n };\n\n var exports = createMethod();\n\n if (COMMON_JS) {\n module.exports = exports;\n } else {\n root.sha1 = exports;\n if (AMD) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n return exports;\n }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n }\n }\n})();\n\n\n//# sourceURL=webpack:///./node_modules/js-sha1/src/sha1.js?"); +eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\-?\\d?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n\n\n//# sourceURL=webpack:///./node_modules/_ms@2.1.1@ms/index.js?"); /***/ }), -/***/ "./node_modules/supports-color/index.js": -/*!**********************************************!*\ - !*** ./node_modules/supports-color/index.js ***! - \**********************************************/ +/***/ "./node_modules/_supports-color@5.5.0@supports-color/index.js": +/*!********************************************************************!*\ + !*** ./node_modules/_supports-color@5.5.0@supports-color/index.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nconst os = __webpack_require__(/*! os */ \"os\");\nconst hasFlag = __webpack_require__(/*! has-flag */ \"./node_modules/has-flag/index.js\");\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === true || env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === false || env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(stream) {\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (stream && !stream.isTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Node.js 7.5.0 is the first version of Node.js to include a patch to\n\t\t// libuv that enables 256 color output on Windows. Anything earlier and it\n\t\t// won't work. However, here we target Node.js 8 at minimum as it is an LTS\n\t\t// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows\n\t\t// release that supports 256 colors. Windows 10 build 14931 is the first release\n\t\t// that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(process.versions.node.split('.')[0]) >= 8 &&\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: getSupportLevel(process.stdout),\n\tstderr: getSupportLevel(process.stderr)\n};\n\n\n//# sourceURL=webpack:///./node_modules/supports-color/index.js?"); +eval("\nconst os = __webpack_require__(/*! os */ \"os\");\nconst hasFlag = __webpack_require__(/*! has-flag */ \"./node_modules/_has-flag@3.0.0@has-flag/index.js\");\n\nconst env = process.env;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false')) {\n\tforceColor = false;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = true;\n}\nif ('FORCE_COLOR' in env) {\n\tforceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(stream) {\n\tif (forceColor === false) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (stream && !stream.isTTY && forceColor !== true) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor ? 1 : 0;\n\n\tif (process.platform === 'win32') {\n\t\t// Node.js 7.5.0 is the first version of Node.js to include a patch to\n\t\t// libuv that enables 256 color output on Windows. Anything earlier and it\n\t\t// won't work. However, here we target Node.js 8 at minimum as it is an LTS\n\t\t// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows\n\t\t// release that supports 256 colors. Windows 10 build 14931 is the first release\n\t\t// that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(process.versions.node.split('.')[0]) >= 8 &&\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: getSupportLevel(process.stdout),\n\tstderr: getSupportLevel(process.stderr)\n};\n\n\n//# sourceURL=webpack:///./node_modules/_supports-color@5.5.0@supports-color/index.js?"); /***/ }), -/***/ "./node_modules/webpack/buildin/amd-options.js": +/***/ "./node_modules/_webpack@4.30.0@webpack/buildin/amd-options.js": /*!****************************************!*\ !*** (webpack)/buildin/amd-options.js ***! \****************************************/ @@ -585,7 +589,7 @@ eval("\n\nmodule.exports = __webpack_require__(/*! crypto */ \"crypto\");\n\n//# /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* jshint esversion: 6 */\nvar axios = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n\nvar GraphQLClient = function () {\n function GraphQLClient(options) {\n _classCallCheck(this, GraphQLClient);\n\n var defaultOpt = {\n timeout: options.timeout || 8000,\n method: 'POST'\n };\n this.options = _extends({}, defaultOpt, options);\n }\n\n _createClass(GraphQLClient, [{\n key: 'request',\n value: function request(data) {\n this.options.data = data;\n return axios(this.options).then(function (res) {\n var d = res.data;\n if (d.errors) {\n throw d.errors[0];\n }\n return d.data;\n });\n }\n }]);\n\n return GraphQLClient;\n}();\n\nmodule.exports = GraphQLClient;\n\n//# sourceURL=webpack:///./src/graphql.js?"); +eval("\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* jshint esversion: 6 */\nvar axios = __webpack_require__(/*! axios */ \"./node_modules/_axios@0.18.0@axios/index.js\");\n\nvar GraphQLClient = function () {\n function GraphQLClient(options) {\n _classCallCheck(this, GraphQLClient);\n\n var defaultOpt = {\n timeout: options.timeout || 8000,\n method: 'POST'\n };\n this.options = _extends({}, defaultOpt, options);\n }\n\n _createClass(GraphQLClient, [{\n key: 'request',\n value: function request(data) {\n this.options.data = data;\n return axios(this.options).then(function (res) {\n var d = res.data;\n if (d.errors) {\n throw d.errors[0];\n }\n return d.data;\n });\n }\n }]);\n\n return GraphQLClient;\n}();\n\nmodule.exports = GraphQLClient;\n\n//# sourceURL=webpack:///./src/graphql.js?"); /***/ }), @@ -597,7 +601,7 @@ eval("\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar _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; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\n/* jshint esversion: 6 */\n\nvar axios = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\nvar sha1 = __webpack_require__(/*! js-sha1 */ \"./node_modules/js-sha1/src/sha1.js\");\nvar configs = __webpack_require__(/*! ./configs */ \"./src/configs.js\");\nvar GraphQLClient = __webpack_require__(/*! ./graphql */ \"./src/graphql.js\");\nvar encryption = __webpack_require__(/*! ./_encryption */ \"./src/_encryption.js\");\n\nfunction Authing(opts) {\n var self = this;\n this.opts = opts;\n this.opts.useSelfWxapp = opts.useSelfWxapp || false;\n this.opts.timeout = opts.timeout || 8000;\n\n if (opts.host) {\n configs.services.user.host = opts.host.user || configs.services.user.host;\n configs.services.oauth.host = opts.host.oauth || configs.services.oauth.host;\n }\n\n this.ownerAuth = {\n authed: false,\n authSuccess: false,\n token: null\n };\n\n this.userAuth = {\n authed: false,\n authSuccess: false,\n token: null\n };\n\n this.initUserClient();\n this.initOwnerClient();\n this.initOAuthClient();\n\n if (!opts.accessToken) {\n if (!opts.clientId) {\n throw new Error('clientId is not provided');\n }\n\n if (configs.inBrowser) {\n if (opts.secret) {\n throw '检测到你处于浏览器环境,当前已不推荐在浏览器环境中暴露 secret,请到 https://docs.authing.cn/authing/sdk/authing-sdk-for-web#chu-shi-hua 查看最新的初始化方式';\n }\n\n if (!opts.timestamp) {\n throw 'timestamp is not provided';\n }\n\n if (!opts.nonce) {\n throw 'nonce is not provided';\n }\n\n this.opts.signature = sha1(opts.timestamp + opts.nonce.toString());\n } else if (!opts.secret) {\n throw new Error('app secret is not provided');\n }\n }\n\n return this._auth().then(function (token) {\n if (token) {\n self.initOwnerClient(token);\n self.loginFromLocalStorage();\n } else {\n self.ownerAuth.authed = true;\n self.ownerAuth.authSuccess = false;\n throw 'auth failed, please check your secret and client ID.';\n }\n return self;\n }).catch(function (error) {\n self.ownerAuth.authed = true;\n self.ownerAuth.authSuccess = false;\n throw 'auth failed: ' + error.message.message;\n });\n}\n\nAuthing.prototype = {\n\n constructor: Authing,\n\n _initClient: function _initClient(token) {\n var conf = {\n baseURL: configs.services.user.host,\n timeout: this.opts.timeout\n };\n if (token) {\n conf.headers = {\n Authorization: 'Bearer ' + token\n };\n }\n return new GraphQLClient(conf);\n },\n oAuthClientByUserToken: function oAuthClientByUserToken() {\n this.haveLogined();\n var token = this.userAuth.token;\n\n if (!this._oAuthClientByUserToken) {\n this._oAuthClientByUserToken = new GraphQLClient({\n baseURL: configs.services.oauth.host,\n headers: {\n Authorization: 'Bearer ' + token\n },\n timeout: this.opts.timeout\n });\n }\n return this._oAuthClientByUserToken;\n },\n initUserClient: function initUserClient(token) {\n if (token) {\n this.userAuth = {\n authed: true,\n authSuccess: true,\n token: token\n };\n if (configs.inBrowser) {\n localStorage.setItem('_authing_token', token);\n }\n }\n this.UserClient = this._initClient(token);\n },\n initOwnerClient: function initOwnerClient(token) {\n if (token) {\n this.ownerAuth = {\n authed: true,\n authSuccess: true,\n token: token\n };\n }\n this.ownerClient = this._initClient(token);\n },\n initOAuthClient: function initOAuthClient() {\n this.OAuthClient = new GraphQLClient({\n baseURL: configs.services.oauth.host,\n timeout: this.opts.timeout\n });\n },\n _auth: function _auth() {\n var _this = this;\n\n var authOpts = {\n baseURL: configs.services.user.host,\n timeout: this.opts.timeout\n };\n\n if (this.opts.accessToken) {\n authOpts.headers = {\n Authorization: 'Bearer ' + this.opts.accessToken\n };\n }\n\n if (!this.AuthService) {\n this.AuthService = new GraphQLClient(authOpts);\n }\n\n if (this.opts.accessToken && this.AuthService) {\n return new Promise(function (resolve) {\n resolve(_this.opts.accessToken);\n });\n }\n\n var options = {\n secret: this.opts.secret,\n clientId: this.opts.clientId\n };\n\n var self = this;\n\n var query = '';\n var queryField = '{\\n accessToken\\n clientInfo {\\n _id\\n name\\n descriptions\\n jwtExpired\\n createdAt\\n isDeleted\\n logo\\n emailVerifiedDefault\\n registerDisabled\\n allowedOrigins\\n clientType {\\n _id\\n name\\n description\\n image\\n example\\n }\\n }\\n }';\n\n if (configs.inBrowser) {\n options = {\n clientId: this.opts.clientId,\n timestamp: this.opts.timestamp,\n nonce: this.opts.nonce,\n signature: this.opts.signature\n };\n query = 'query {\\n getClientWhenSdkInit(timestamp: \"' + options.timestamp + '\", clientId: \"' + options.clientId + '\", nonce: ' + options.nonce + ', signature: \"' + options.signature + '\")' + queryField + '\\n }';\n } else {\n query = 'query {\\n getClientWhenSdkInit(secret: \"' + options.secret + '\", clientId: \"' + options.clientId + '\")' + queryField + '\\n }';\n }\n\n return this.AuthService.request({\n query: query\n }).then(function (data) {\n var accessToken = '';\n if (data.getClientWhenSdkInit) {\n // eslint-disable-next-line prefer-destructuring\n accessToken = data.getClientWhenSdkInit.accessToken;\n self.clientInfo = data.getClientWhenSdkInit.clientInfo;\n }\n self.AuthService = new GraphQLClient({\n baseURL: configs.services.user.host,\n headers: {\n Authorization: 'Bearer ' + accessToken\n }\n });\n return accessToken;\n });\n },\n loginFromLocalStorage: function loginFromLocalStorage() {\n var self = this;\n if (configs.inBrowser) {\n var authingToken = localStorage.getItem('_authing_token');\n if (authingToken) {\n self.initUserClient(authingToken);\n }\n }\n },\n checkLoginStatus: function checkLoginStatus(token) {\n return this.UserClient.request({\n operationName: 'checkLoginStatus',\n query: 'query checkLoginStatus($token: String) {\\n checkLoginStatus(token: $token) {\\n status\\n code\\n message\\n }\\n }',\n variables: {\n token: token\n }\n }).then(function (res) {\n return res.checkLoginStatus;\n });\n },\n _readOAuthList: function _readOAuthList(params) {\n var variables = {};\n if (params) {\n variables = params;\n }\n var self = this;\n\n this.haveAccess();\n\n if (!this._OAuthService) {\n this._OAuthService = new GraphQLClient({\n baseURL: configs.services.oauth.host,\n headers: {\n Authorization: 'Bearer ' + self.ownerAuth.token\n }\n });\n }\n return this._OAuthService.request({\n operationName: 'getOAuthList',\n query: 'query getOAuthList($clientId: String!, $useGuard: Boolean) {\\n ReadOauthList(clientId: $clientId, useGuard: $useGuard) {\\n _id\\n name\\n image\\n description\\n enabled\\n client\\n user\\n url\\n alias\\n }\\n }',\n variables: _extends({\n clientId: self.opts.clientId\n }, variables)\n }).then(function (res) {\n return res.ReadOauthList;\n });\n },\n haveAccess: function haveAccess() {\n if (!this.ownerAuth.authSuccess) {\n throw 'have no access, please check your secret and client ID.';\n }\n },\n haveLogined: function haveLogined() {\n if (!this.userAuth.authSuccess) {\n throw 'not logined yet, please login first.';\n }\n },\n _chooseClient: function _chooseClient() {\n if (this.userAuth.authSuccess) {\n return this.UserClient;\n }\n return this.ownerClient;\n },\n _login: function _login(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n /* eslint-disable no-param-reassign */\n\n options.registerInClient = this.opts.clientId;\n\n if (options.password) {\n options.password = encryption(options.password);\n }\n\n this.haveAccess();\n\n if (configs.inBrowser) {\n options.browser = window.navigator.userAgent;\n }\n\n return this.UserClient.request({\n operationName: 'login',\n query: 'mutation login($unionid: String, $email: String, $username: String, $password: String, $lastIP: String, $registerInClient: String!, $verifyCode: String, $browser: String, $openid: String) {\\n login(unionid: $unionid, email: $email, username: $username, password: $password, lastIP: $lastIP, registerInClient: $registerInClient, verifyCode: $verifyCode, browser: $browser, openid: $openid) {\\n _id\\n email\\n emailVerified\\n unionid\\n openid\\n oauth\\n registerMethod\\n username\\n nickname\\n company\\n photo\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.login;\n });\n },\n _loginByLDAP: function _loginByLDAP(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n options.clientId = this.opts.clientId;\n\n if (!options.password) {\n throw 'password is not provided.';\n }\n\n if (!options.username) {\n throw 'username is not provided.';\n }\n\n this.haveAccess();\n\n if (configs.inBrowser) {\n options.browser = window.navigator.userAgent;\n }\n\n return this.OAuthClient.request({\n operationName: 'LoginByLDAP',\n query: 'mutation LoginByLDAP($username: String!, $password: String!, $clientId: String!, $browser: String) {\\n LoginByLDAP(username: $username, clientId: $clientId, password: $password, browser: $browser) {\\n _id\\n email\\n emailVerified\\n unionid\\n openid\\n oauth\\n registerMethod\\n username\\n nickname\\n company\\n photo\\n browser\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.LoginByLDAP;\n });\n },\n loginByLDAP: function loginByLDAP(options) {\n var self = this;\n return this._loginByLDAP(options).then(function (user) {\n if (user) {\n self.initUserClient(user.token);\n }\n return user;\n });\n },\n login: function login(options) {\n var self = this;\n return this._login(options).then(function (user) {\n if (user) {\n self.initUserClient(user.token);\n }\n return user;\n });\n },\n register: function register(options) {\n this.haveAccess();\n\n if (!options) {\n throw 'options is not provided';\n }\n\n options.registerInClient = this.opts.clientId;\n\n if (options.password) {\n options.password = encryption(options.password);\n }\n\n if (configs.inBrowser) {\n options.browser = window.navigator.userAgent;\n }\n\n return this.UserClient.request({\n operationName: 'register',\n query: '\\n mutation register(\\n $unionid: String,\\n $openid: String,\\n $email: String,\\n $password: String,\\n $lastIP: String,\\n $gender: String,\\n $birthdate: String,\\n $region: String,\\n $locality: String,\\n $name: String,\\n $givenName: String,\\n $familyName: String,\\n $middleName: String,\\n $profile: String,\\n $preferredUsername: String,\\n $website: String,\\n $zoneinfo: String,\\n $locale: String,\\n $address: String,\\n $formatted: String,\\n $streetAddress: String,\\n $postalCode: String,\\n $country: String,\\n $updatedAt: String,\\n $forceLogin: Boolean,\\n $registerInClient: String!,\\n $oauth: String,\\n $username: String,\\n $nickname: String,\\n $registerMethod: String,\\n $photo: String,\\n $company: String,\\n $browser: String,\\n ) {\\n register(userInfo: {\\n unionid: $unionid,\\n openid: $openid,\\n email: $email,\\n password: $password,\\n lastIP: $lastIP,\\n forceLogin: $forceLogin,\\n registerInClient: $registerInClient,\\n oauth: $oauth,\\n registerMethod: $registerMethod,\\n name: $name,\\n givenName: $givenName,\\n familyName: $familyName,\\n middleName: $middleName,\\n profile: $profile,\\n preferredUsername: $preferredUsername,\\n website: $website,\\n zoneinfo: $zoneinfo,\\n locale: $locale,\\n address: $address,\\n formatted: $formatted,\\n streetAddress: $streetAddress,\\n postalCode: $postalCode,\\n country: $country,\\n updatedAt: $updatedAt,\\n gender: $gender,\\n birthdate: $birthdate,\\n region: $region,\\n locality: $locality,\\n photo: $photo,\\n username: $username,\\n nickname: $nickname,\\n company: $company,\\n browser: $browser,\\n }) {\\n _id,\\n email,\\n emailVerified,\\n unionid,\\n openid,\\n oauth,\\n registerMethod,\\n username,\\n nickname,\\n company,\\n photo,\\n browser,\\n password,\\n token,\\n group {\\n name\\n },\\n blocked,\\n device\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.register;\n });\n },\n logout: function logout(_id) {\n this.haveAccess();\n\n if (!_id) {\n throw '_id is not provided';\n }\n\n this.userAuth = {\n authed: false,\n authSuccess: false,\n token: null\n };\n if (configs.inBrowser) {\n localStorage.removeItem('_authing_token');\n }\n\n return this.update({\n _id: _id,\n tokenExpiredAt: 0\n });\n },\n user: function user(options) {\n this.haveAccess();\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.id) {\n throw 'id in options is not provided';\n }\n options.registerInClient = this.opts.clientId;\n\n var client = this._chooseClient();\n\n return client.request({\n operationName: 'user',\n query: 'query user($id: String!, $registerInClient: String!){\\n user(id: $id, registerInClient: $registerInClient) {\\n _id\\n unionid\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n userLocation {\\n _id\\n when\\n where\\n }\\n userLoginHistory {\\n totalCount\\n list {\\n _id\\n when\\n success\\n ip\\n result\\n }\\n }\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.user;\n });\n },\n userPatch: function userPatch(options) {\n this.haveAccess();\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.ids) {\n throw 'ids in options is not provided';\n }\n options.registerInClient = this.opts.clientId;\n\n var client = this._chooseClient();\n\n return client.request({\n operationName: 'userPatch',\n query: 'query userPatch($ids: String!){\\n userPatch(ids: $ids) {\\n list {\\n _id\\n unionid\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n userLocation {\\n _id\\n when\\n where\\n }\\n userLoginHistory {\\n totalCount\\n list {\\n _id\\n when\\n success\\n ip\\n result\\n }\\n }\\n }\\n totalCount\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.userPatch;\n });\n },\n list: function list(page, count) {\n this.haveAccess();\n\n page = page || 1;\n count = count || 10;\n\n var options = {\n registerInClient: this.opts.clientId,\n page: page,\n count: count\n };\n\n return this.ownerClient.request({\n operationName: 'users',\n query: 'query users($registerInClient: String, $page: Int, $count: Int){\\n users(registerInClient: $registerInClient, page: $page, count: $count) {\\n totalCount\\n list {\\n _id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n password\\n registerInClient\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n group {\\n _id\\n name\\n descriptions\\n createdAt\\n }\\n clientType {\\n _id\\n name\\n description\\n image\\n example\\n }\\n userLocation {\\n _id\\n when\\n where\\n }\\n userLoginHistory {\\n totalCount\\n list{\\n _id\\n when\\n success\\n ip\\n result\\n }\\n }\\n systemApplicationType {\\n _id\\n name\\n descriptions\\n price\\n }\\n }\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.users;\n });\n },\n remove: function remove(_id, operator) {\n var self = this;\n\n this.haveAccess();\n\n if (!_id) {\n throw '_id is not provided';\n }\n\n return this.ownerClient.request({\n query: 'mutation removeUsers($ids: [String], $registerInClient: String, $operator: String){\\n removeUsers(ids: $ids, registerInClient: $registerInClient, operator: $operator) {\\n _id\\n }\\n }',\n variables: {\n ids: [_id],\n registerInClient: self.opts.clientId,\n operator: operator\n }\n }).then(function (res) {\n return res.removeUsers;\n });\n },\n _uploadAvatar: function _uploadAvatar(options) {\n var client = this._chooseClient();\n return client.request({\n operationName: 'qiNiuUploadToken',\n query: 'query qiNiuUploadToken {\\n qiNiuUploadToken\\n }'\n }).then(function (data) {\n return data.qiNiuUploadToken;\n }).then(function (token) {\n if (!token) {\n throw {\n graphQLErrors: [{\n message: {\n message: '获取文件上传token失败'\n }\n }]\n };\n }\n\n var formData = new FormData();\n formData.append('file', options.photo);\n formData.append('token', token);\n return axios.post('https://upload.qiniup.com/', formData, {\n method: 'post',\n headers: { 'Content-Type': 'multipart/form-data' }\n });\n }).then(function (data) {\n return data.data;\n }).then(function (data) {\n if (data.key) {\n options.photo = 'https://usercontents.authing.cn/' + data.key;\n }\n return options;\n }).catch(function (e) {\n if (e.graphQLErrors) {\n throw e.graphQLErrors[0];\n }\n throw {\n message: {\n message: e\n }\n };\n });\n },\n update: function update(options) {\n var self = this;\n\n this.haveAccess();\n\n if (!options) {\n throw 'options is not provided';\n }\n\n // eslint-disable-next-line no-underscore-dangle\n if (!options._id) {\n throw '_id in options is not provided';\n }\n\n if (options.password) {\n if (!options.oldPassword) {\n throw 'oldPassword in options is not provided';\n }\n options.password = encryption(options.password);\n options.oldPassword = encryption(options.oldPassword);\n }\n\n options.registerInClient = self.opts.clientId;\n\n var keyTypeList = {\n _id: 'String!',\n email: 'String',\n emailVerified: 'Boolean',\n username: 'String',\n nickname: 'String',\n company: 'String',\n photo: 'String',\n oauth: 'String',\n browser: 'String',\n password: 'String',\n oldPassword: 'String',\n registerInClient: 'String!',\n phone: 'String',\n token: 'String',\n tokenExpiredAt: 'String',\n loginsCount: 'Int',\n lastLogin: 'String',\n lastIP: 'String',\n signedUp: 'String',\n blocked: 'Boolean',\n isDeleted: 'Boolean'\n };\n var returnFields = '_id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n phone\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted';\n\n function generateArgs(opts) {\n var args = [];\n var argsFiller = [];\n var argsString = '';\n // eslint-disable-next-line no-restricted-syntax\n for (var key in opts) {\n if (keyTypeList[key]) {\n args.push('$' + key + ': ' + keyTypeList[key]);\n argsFiller.push(key + ': $' + key);\n }\n }\n argsString = args.join(', ');\n return {\n args: args,\n argsString: argsString,\n argsFiller: argsFiller\n };\n }\n\n var client = this._chooseClient();\n\n if (options.photo) {\n var photo = options.photo;\n\n if (typeof photo !== 'string') {\n return this._uploadAvatar(options).then(function (opts) {\n var arg = generateArgs(opts);\n return client.request({\n operationName: 'UpdateUser',\n query: '\\n mutation UpdateUser(' + arg.argsString + '){\\n updateUser(options: {\\n ' + arg.argsFiller.join(', ') + '\\n }) {\\n ' + returnFields + '\\n }\\n }\\n ',\n variables: opts\n });\n }).then(function (res) {\n return res.updateUser;\n });\n }\n }\n var args = generateArgs(options);\n return client.request({\n operationName: 'UpdateUser',\n query: '\\n mutation UpdateUser(' + args.argsString + '){\\n updateUser(options: {\\n ' + args.argsFiller.join(', ') + '\\n }) {\\n ' + returnFields + '\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.updateUser;\n });\n },\n\n /**\n * \n * @param {Object} params 获取社会化登录时可以加选项\n * @param {Boolean} params.useGuard 是否使用 Guard\n */\n readOAuthList: function readOAuthList(params) {\n if (!params || (typeof params === 'undefined' ? 'undefined' : _typeof(params)) !== 'object') {\n return this._readOAuthList().then(function (list) {\n if (list) {\n return list.filter(function (item) {\n return item.enabled;\n });\n }\n throw {\n message: '获取OAuth列表失败,原因未知'\n };\n });\n } else {\n return this._readOAuthList(params).then(function (list) {\n if (list) {\n return list.filter(function (item) {\n return item.enabled;\n });\n }\n throw {\n message: '获取OAuth列表失败,原因未知'\n };\n });\n }\n },\n sendResetPasswordEmail: function sendResetPasswordEmail(options) {\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.email) {\n throw 'email in options is not provided';\n }\n\n options.client = this.opts.clientId;\n return this.UserClient.request({\n operationName: 'sendResetPasswordEmail',\n query: '\\n mutation sendResetPasswordEmail(\\n $email: String!,\\n $client: String!\\n ){\\n sendResetPasswordEmail(\\n email: $email,\\n client: $client\\n ) {\\n message\\n code\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.sendResetPasswordEmail;\n });\n },\n verifyResetPasswordVerifyCode: function verifyResetPasswordVerifyCode(options) {\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.email) {\n throw 'email in options is not provided';\n }\n if (!options.verifyCode) {\n throw 'verifyCode in options is not provided';\n }\n options.client = this.opts.clientId;\n return this.UserClient.request({\n operationName: 'verifyResetPasswordVerifyCode',\n query: '\\n mutation verifyResetPasswordVerifyCode(\\n $email: String!,\\n $client: String!,\\n $verifyCode: String!\\n ) {\\n verifyResetPasswordVerifyCode(\\n email: $email,\\n client: $client,\\n verifyCode: $verifyCode\\n ) {\\n message\\n code\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.verifyResetPasswordVerifyCode;\n });\n },\n changePassword: function changePassword(options) {\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.email) {\n throw 'email in options is not provided';\n }\n if (!options.password) {\n throw 'password in options is not provided';\n }\n if (!options.verifyCode) {\n throw 'verifyCode in options is not provided';\n }\n options.client = this.opts.clientId;\n options.password = encryption(options.password);\n return this.UserClient.request({\n operationName: 'changePassword',\n query: '\\n mutation changePassword(\\n $email: String!,\\n $client: String!,\\n $password: String!,\\n $verifyCode: String!\\n ){\\n changePassword(\\n email: $email,\\n client: $client,\\n password: $password,\\n verifyCode: $verifyCode\\n ) {\\n _id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.changePassword;\n });\n },\n sendVerifyEmail: function sendVerifyEmail(options) {\n if (!options.email) {\n throw 'email in options is not provided';\n }\n\n options.client = this.opts.clientId;\n\n return this.AuthService.request({\n operationName: 'sendVerifyEmail',\n query: '\\n mutation sendVerifyEmail(\\n $email: String!,\\n $client: String!\\n ){\\n sendVerifyEmail(\\n email: $email,\\n client: $client\\n ) {\\n message,\\n code,\\n status\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.sendVerifyEmail;\n });\n },\n selectAvatarFile: function selectAvatarFile(cb) {\n if (!configs.inBrowser) {\n throw '当前不是浏览器环境,无法选取文件';\n }\n var inputElem = document.createElement('input');\n inputElem.type = 'file';\n inputElem.accept = 'image/*';\n inputElem.onchange = function () {\n cb(inputElem.files[0]);\n };\n inputElem.click();\n },\n decodeToken: function decodeToken(token) {\n return this.UserClient.request({\n operationName: 'decodeJwtToken',\n query: 'query decodeJwtToken($token: String) {\\n decodeJwtToken(token: $token) {\\n data {\\n email\\n id\\n clientId\\n }\\n status {\\n code\\n message\\n }\\n iat\\n exp\\n }\\n }',\n variables: {\n token: token\n }\n }).then(function (res) {\n return res.decodeJwtToken;\n });\n },\n readUserOAuthList: function readUserOAuthList(variables) {\n var client = this.oAuthClientByUserToken();\n return client.request({\n operationName: 'notBindOAuthList',\n query: 'query notBindOAuthList($user: String, $client: String) {\\n notBindOAuthList(user: $user, client: $client) {\\n type\\n oAuthUrl\\n image\\n name\\n binded\\n }\\n }',\n variables: variables\n }).then(function (res) {\n return res.notBindOAuthList;\n });\n },\n bindOAuth: function bindOAuth(variables) {\n if (!variables) {\n throw 'options is not provided';\n }\n if (!variables.type) {\n throw 'type in options is not provided';\n }\n if (!variables.unionid) {\n throw 'unionid in options is not provided';\n }\n if (!variables.userInfo) {\n throw 'userInfo in options is not provided';\n }\n\n return this.UserClient.request({\n operationName: 'bindOtherOAuth',\n query: 'mutation bindOtherOAuth(\\n $user: String,\\n $client: String,\\n $type: String!,\\n $unionid: String!,\\n $userInfo: String!\\n ) {\\n bindOtherOAuth (\\n user: $user,\\n client: $client,\\n type: $type,\\n unionid: $unionid,\\n userInfo: $userInfo\\n ) {\\n _id\\n user\\n client\\n type\\n userInfo\\n unionid\\n createdAt\\n }\\n }',\n variables: variables\n });\n },\n unbindOAuth: function unbindOAuth(variables) {\n if (!variables) {\n throw 'options is not provided';\n }\n if (!variables.type) {\n throw 'type in options is not provided';\n }\n\n return this.UserClient.request({\n operationName: 'unbindOtherOAuth',\n query: 'mutation unbindOtherOAuth(\\n $user: String,\\n $client: String,\\n $type: String!\\n ){\\n unbindOtherOAuth(\\n user: $user,\\n client: $client,\\n type: $type\\n ) {\\n _id\\n user\\n client\\n type\\n userInfo\\n unionid\\n createdAt\\n }\\n }',\n variables: variables\n });\n },\n unbindEmail: function unbindEmail(variables) {\n return this.UserClient.request({\n operationName: 'unbindEmail',\n query: 'mutation unbindEmail(\\n $user: String,\\n $client: String,\\n ){\\n unbindEmail(\\n user: $user,\\n client: $client,\\n ) {\\n _id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }',\n variables: variables\n });\n },\n randomWord: function randomWord(randomFlag, min, max) {\n var str = '';\n var range = min;\n var arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];\n\n if (randomFlag) {\n range = Math.round(Math.random() * (max - min)) + min; // 任意长度\n }\n\n for (var i = 0; i < range; i += 1) {\n var pos = Math.round(Math.random() * (arr.length - 1));\n str += arr[pos];\n }\n\n return str;\n },\n genQRCode: function genQRCode(clientId) {\n var random = this.randomWord(true, 12, 24);\n sessionStorage.randomWord = random;\n\n var url = configs.services.oauth.host;\n url = url.replace('/graphql', '');\n\n return axios.get(url + '/oauth/wxapp/qrcode/' + clientId + '?random=' + random + '&useSelfWxapp=' + this.opts.useSelfWxapp);\n },\n checkQR: function checkQR() {\n var random = sessionStorage.randomWord || '';\n var url = configs.services.oauth.host;\n url = url.replace('/graphql', '');\n\n return axios.post(url + '/oauth/wxapp/confirm/qr?random=' + random + '&useSelfWxapp=' + this.opts.useSelfWxapp);\n },\n startWXAppScaning: function startWXAppScaning(opts) {\n var self = this;\n\n if (!opts) {\n opts = {};\n }\n\n var mountNode = opts.mount || 'authing__qrcode-root-node';\n var interval = opts.interval || 1500;\n var _opts = opts,\n tips = _opts.tips;\n\n\n var redirect = true;\n\n // eslint-disable-next-line no-prototype-builtins\n if (opts.hasOwnProperty('redirect')) {\n if (!opts.redirect) {\n redirect = false;\n }\n }\n\n var _opts2 = opts,\n onError = _opts2.onError,\n onSuccess = _opts2.onSuccess,\n onIntervalStarting = _opts2.onIntervalStarting,\n onQRCodeShow = _opts2.onQRCodeShow,\n onQRCodeLoad = _opts2.onQRCodeLoad;\n\n\n var qrcodeNode = document.getElementById(mountNode);\n var qrcodeWrapper = void 0;\n\n var needGenerate = false;\n var start = function start() {};\n\n if (!qrcodeNode) {\n qrcodeNode = document.createElement('div');\n qrcodeNode.id = mountNode;\n qrcodeNode.style = 'z-index: 65535;position: fixed;background: #fff;width: 300px;height: 300px;left: 50%;margin-left: -150px;display: flex;justify-content: center;align-items: center;top: 50%;margin-top: -150px;border: 1px solid #ccc;';\n document.getElementsByTagName('body')[0].appendChild(qrcodeNode);\n needGenerate = true;\n } else {\n qrcodeNode.style = 'position:relative';\n }\n\n var styleNode = document.createElement('style');var style = '#authing__retry a:hover{outline:0px;text-decoration:none;}#authing__spinner{position:absolute;left:50%;margin-left:-6px;}.spinner{margin:100px auto;width:20px;height:20px;position:relative}.container1>div,.container2>div,.container3>div{width:6px;height:6px;background-color:#00a1ea;border-radius:100%;position:absolute;-webkit-animation:bouncedelay 1.2s infinite ease-in-out;animation:bouncedelay 1.2s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.spinner .spinner-container{position:absolute;width:100%;height:100%}.container2{-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}.container3{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}.circle1{top:0;left:0}.circle2{top:0;right:0}.circle3{right:0;bottom:0}.circle4{left:0;bottom:0}.container2 .circle1{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.container3 .circle1{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.container1 .circle2{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.container2 .circle2{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}.container3 .circle2{-webkit-animation-delay:-0.7s;animation-delay:-0.7s}.container1 .circle3{-webkit-animation-delay:-0.6s;animation-delay:-0.6s}.container2 .circle3{-webkit-animation-delay:-0.5s;animation-delay:-0.5s}.container3 .circle3{-webkit-animation-delay:-0.4s;animation-delay:-0.4s}.container1 .circle4{-webkit-animation-delay:-0.3s;animation-delay:-0.3s}.container2 .circle4{-webkit-animation-delay:-0.2s;animation-delay:-0.2s}.container3 .circle4{-webkit-animation-delay:-0.1s;animation-delay:-0.1s}@-webkit-keyframes bouncedelay{0%,80%,100%{-webkit-transform:scale(0.0)}40%{-webkit-transform:scale(1.0)}}@keyframes bouncedelay{0%,80%,100%{transform:scale(0.0);-webkit-transform:scale(0.0)}40%{transform:scale(1.0);-webkit-transform:scale(1.0)}}';\n\n styleNode.type = 'text/css';\n\n if (styleNode.styleSheet) {\n styleNode.styleSheet.cssText = style;\n } else {\n styleNode.innerHTML = style;\n }\n\n document.getElementsByTagName('head')[0].appendChild(styleNode);\n\n var loading = function loading() {\n qrcodeNode.innerHTML = '
';\n };\n\n var unloading = function unloading() {\n var child = document.getElementById('authing__spinner');\n qrcodeNode.removeChild(child);\n };\n\n var genTip = function genTip(text) {\n var tip = document.createElement('span');\n tip.class = 'authing__heading-subtitle';\n if (!needGenerate) {\n tip.style = 'display: block;font-weight: 400;font-size: 15px;color: #888;ine-height: 48px;';\n } else {\n tip.style = 'display: block;font-weight: 400;font-size: 12px;color: #888;';\n }\n tip.innerHTML = text;\n return tip;\n };\n\n var genImage = function genImage(src) {\n var qrcodeImage = document.createElement('img');\n qrcodeImage.class = 'authing__qrcode';\n qrcodeImage.src = src;\n qrcodeImage.width = 240;\n qrcodeImage.height = 240;\n return qrcodeImage;\n };\n\n var genShadow = function genShadow(text, aOnClick) {\n var shadow = document.createElement('div');\n shadow.id = 'authing__retry';\n shadow.style = 'text-align:center;width: 240px;height: 240px;position: absolute;left: 50%;top: 0px;margin-left: -120px;background-color: rgba(0,0,0, 0.5);line-height:240px;color:#fff;font-weight:600;';\n\n var shadowA = document.createElement('a');\n shadowA.innerHTML = text;\n shadowA.style = 'color:#fff;border-bottom: 1px solid #fff;cursor: pointer;';\n shadowA.onclick = aOnClick;\n shadow.appendChild(shadowA);\n return shadow;\n };\n\n function genRetry(qrcodeElm, tipText) {\n var tip = genTip(tipText);\n\n qrcodeWrapper = document.createElement('div');\n qrcodeWrapper.id = 'authing__qrcode-wrapper';\n qrcodeWrapper.style = 'text-align: center;position: relative;';\n\n var qrcodeImage = genImage('https://usercontents.authing.cn/authing_user_manager_wxapp_qrcode.jpg');\n\n if (!needGenerate) {\n qrcodeImage.style = 'margin-top: 12px;';\n } else {\n qrcodeImage.style = 'margin-top: 16px;';\n }\n\n qrcodeImage.onload = function () {\n unloading();\n };\n\n var shadow = genShadow('点击重试', function () {\n start();\n });\n\n qrcodeWrapper.appendChild(qrcodeImage);\n qrcodeWrapper.appendChild(shadow);\n qrcodeWrapper.appendChild(tip);\n qrcodeElm.appendChild(qrcodeWrapper);\n }\n\n start = function start() {\n loading();\n self.genQRCode(self.opts.clientId).then(function (qrRes) {\n qrRes = qrRes.data;\n\n if (qrRes.code !== 200) {\n genRetry(qrcodeNode, qrRes.message);\n if (onError) {\n onError(qrRes);\n }\n } else {\n var qrcode = qrRes.data;\n if (onQRCodeLoad) {\n onQRCodeLoad(qrcode);\n }\n sessionStorage.qrcodeUrl = qrcode.qrcode;\n sessionStorage.qrcode = JSON.stringify(qrcode);\n\n if (qrcodeNode) {\n qrcodeWrapper = document.createElement('div');\n qrcodeWrapper.id = 'authing__qrcode-wrapper';\n qrcodeWrapper.style = 'text-align: center;position: relative;';\n\n var qrcodeImage = genImage(qrcode.qrcode);\n\n qrcodeImage.onload = function () {\n unloading();\n if (onQRCodeShow) {\n onQRCodeShow(qrcode);\n }\n var inter = 0;\n inter = setInterval(function () {\n if (onIntervalStarting) {\n onIntervalStarting(inter);\n }\n self.checkQR().then(function (checkRes) {\n var checkResult = checkRes.data.data;\n if (checkResult.code === 200) {\n clearInterval(inter);\n if (redirect) {\n var shadowX = genShadow('扫码成功,即将跳转', function () {\n window.location.href = checkResult.redirect + '?code=200&data=' + JSON.stringify(checkResult.data);\n });\n setTimeout(function () {\n window.location.href = checkResult.redirect + '?code=200&data=' + JSON.stringify(checkResult.data);\n }, 600);\n qrcodeWrapper.appendChild(shadowX);\n } else {\n var shadow = genShadow('扫码成功');\n qrcodeWrapper.appendChild(shadow);\n if (onSuccess) {\n onSuccess(checkResult);\n }\n }\n }\n });\n }, interval);\n };\n\n var tip = genTip(tips || '使用 微信 或小程序 身份管家 扫码登录');\n\n qrcodeWrapper.appendChild(qrcodeImage);\n qrcodeWrapper.appendChild(tip);\n qrcodeNode.appendChild(qrcodeWrapper);\n }\n }\n }).catch(function (error) {\n genRetry(qrcodeNode, '网络出错,请重试');\n if (onError) {\n onError(error);\n }\n });\n };\n\n start();\n },\n getVerificationCode: function getVerificationCode(phone) {\n if (!phone) {\n throw 'phone is not provided';\n }\n\n var url = configs.services.user.host.replace('/graphql', '') + '/send_smscode/' + phone + '/' + this.opts.clientId;\n return axios.get(url).then(function (result) {\n if (result.data.code !== 200) {\n throw result.data;\n } else {\n return result.data;\n }\n });\n },\n loginByPhoneCode: function loginByPhoneCode(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n var self = this;\n\n this.haveAccess();\n\n var variables = {\n registerInClient: this.opts.clientId,\n phone: options.phone,\n phoneCode: parseInt(options.phoneCode, 10)\n };\n\n if (configs.inBrowser) {\n variables.browser = window.navigator.userAgent;\n }\n\n return this.UserClient.request({\n operationName: 'login',\n query: 'mutation login($phone: String, $phoneCode: Int, $registerInClient: String!, $browser: String) {\\n login(phone: $phone, phoneCode: $phoneCode, registerInClient: $registerInClient, browser: $browser) {\\n _id\\n email\\n unionid\\n openid\\n emailVerified\\n username\\n nickname\\n phone\\n company\\n photo\\n browser\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }',\n variables: variables\n }).then(function (res) {\n return res.login;\n }).then(function (user) {\n if (user) {\n self.initUserClient(user.token);\n }\n return user;\n });\n },\n queryPermissions: function queryPermissions(userId) {\n if (!userId) {\n throw 'userId is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n user: userId\n };\n\n return this.ownerClient.request({\n operationName: 'QueryRoleByUserId',\n query: 'query QueryRoleByUserId($user: String!, $client: String!){\\n queryRoleByUserId(user: $user, client: $client) {\\n totalCount\\n list {\\n group {\\n name\\n permissions\\n }\\n }\\n }\\n }',\n variables: variables\n }).then(function (res) {\n return res.queryRoleByUserId;\n });\n },\n queryRoles: function queryRoles(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n clientId: this.opts.clientId,\n page: options.page,\n count: options.count\n };\n\n return this.ownerClient.request({\n operationName: 'ClientRoles',\n query: '\\n query ClientRoles(\\n $clientId: String!\\n $page: Int\\n $count: Int\\n ) {\\n clientRoles(\\n client: $clientId\\n page: $page\\n count: $count\\n ) {\\n totalCount\\n list {\\n _id\\n name\\n descriptions\\n client\\n createdAt\\n permissions\\n }\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.clientRoles;\n });\n },\n createRole: function createRole(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n name: options.name,\n descriptions: options.descriptions\n };\n\n return this.ownerClient.request({\n operationName: 'CreateRole',\n query: '\\n mutation CreateRole(\\n $name: String!\\n $client: String!\\n $descriptions: String\\n ) {\\n createRole(\\n name: $name\\n client: $client\\n descriptions: $descriptions\\n ) {\\n _id,\\n name,\\n client,\\n descriptions\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.createRole;\n });\n },\n updateRolePermissions: function updateRolePermissions(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n name: options.name,\n permissions: options.permissions,\n _id: options.roleId\n };\n\n return this.ownerClient.request({\n operationName: 'UpdateRole',\n query: '\\n mutation UpdateRole(\\n $_id: String!\\n $name: String!\\n $client: String!\\n $descriptions: String\\n $permissions: String\\n ) {\\n updateRole(\\n _id: $_id\\n name: $name\\n client: $client\\n descriptions: $descriptions\\n permissions: $permissions\\n ) {\\n _id,\\n name,\\n client,\\n descriptions,\\n permissions\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.updateRole;\n });\n },\n assignUserToRole: function assignUserToRole(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n group: options.roleId,\n user: options.user\n };\n\n return this.ownerClient.request({\n operationName: 'AssignUserToRole',\n query: '\\n mutation AssignUserToRole(\\n $group: String!\\n $client: String!\\n $user: String!\\n ) {\\n assignUserToRole(\\n group: $group\\n client: $client\\n user: $user\\n ) {\\n totalCount,\\n list {\\n _id,\\n client {\\n _id\\n },\\n user {\\n _id\\n },\\n createdAt\\n }\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.assignUserToRole;\n });\n },\n removeUserFromRole: function removeUserFromRole(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n user: options.user,\n group: options.roleId\n };\n\n return this.ownerClient.request({\n operationName: 'RemoveUserFromGroup',\n query: '\\n mutation RemoveUserFromGroup(\\n $group: String!\\n $client: String!\\n $user: String!\\n ) {\\n removeUserFromGroup(\\n group: $group\\n client: $client\\n user: $user\\n ) {\\n _id,\\n group {\\n _id\\n },\\n client {\\n _id\\n },\\n user {\\n _id\\n }\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.removeUserFromGroup;\n });\n },\n refreshToken: function refreshToken(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n user: options.user\n };\n\n return this.ownerClient.request({\n operationName: 'RefreshToken',\n query: '\\n mutation RefreshToken(\\n $client: String!\\n $user: String!\\n ) {\\n refreshToken(\\n client: $client\\n user: $user\\n ) {\\n token\\n iat\\n exp\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.refreshToken;\n });\n }\n};\n\nmodule.exports = Authing;\n\n//# sourceURL=webpack:///./src/index.js?"); +eval("\n\nvar _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; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\n/* jshint esversion: 6 */\n\nvar axios = __webpack_require__(/*! axios */ \"./node_modules/_axios@0.18.0@axios/index.js\");\nvar sha1 = __webpack_require__(/*! js-sha1 */ \"./node_modules/_js-sha1@0.6.0@js-sha1/src/sha1.js\");\nvar configs = __webpack_require__(/*! ./configs */ \"./src/configs.js\");\nvar GraphQLClient = __webpack_require__(/*! ./graphql */ \"./src/graphql.js\");\nvar encryption = __webpack_require__(/*! ./_encryption */ \"./src/_encryption.js\");\n\nfunction Authing(opts) {\n var self = this;\n this.opts = opts;\n this.opts.useSelfWxapp = opts.useSelfWxapp || false;\n this.opts.enableFetchPhone = opts.enableFetchPhone || false;\n this.opts.timeout = opts.timeout || 8000;\n\n if (opts.host) {\n configs.services.user.host = opts.host.user || configs.services.user.host;\n configs.services.oauth.host = opts.host.oauth || configs.services.oauth.host;\n }\n\n this.ownerAuth = {\n authed: false,\n authSuccess: false,\n token: null\n };\n\n this.userAuth = {\n authed: false,\n authSuccess: false,\n token: null\n };\n\n this.initUserClient();\n this.initOwnerClient();\n this.initOAuthClient();\n\n if (!opts.accessToken) {\n if (!opts.clientId) {\n throw new Error('clientId is not provided');\n }\n\n if (configs.inBrowser) {\n if (opts.secret) {\n throw '检测到你处于浏览器环境,当前已不推荐在浏览器环境中暴露 secret,请到 https://docs.authing.cn/authing/sdk/authing-sdk-for-web#chu-shi-hua 查看最新的初始化方式';\n }\n\n if (!opts.timestamp) {\n throw 'timestamp is not provided';\n }\n\n if (!opts.nonce) {\n throw 'nonce is not provided';\n }\n\n this.opts.signature = sha1(opts.timestamp + opts.nonce.toString());\n } else if (!opts.secret) {\n throw new Error('app secret is not provided');\n }\n }\n\n return this._auth().then(function (token) {\n if (token) {\n self.initOwnerClient(token);\n self.loginFromLocalStorage();\n } else {\n self.ownerAuth.authed = true;\n self.ownerAuth.authSuccess = false;\n throw 'auth failed, please check your secret and client ID.';\n }\n return self;\n }).catch(function (error) {\n self.ownerAuth.authed = true;\n self.ownerAuth.authSuccess = false;\n throw 'auth failed: ' + error.message.message;\n });\n}\n\nAuthing.prototype = {\n\n constructor: Authing,\n\n _initClient: function _initClient(token) {\n var conf = {\n baseURL: configs.services.user.host,\n timeout: this.opts.timeout\n };\n if (token) {\n conf.headers = {\n Authorization: 'Bearer ' + token\n };\n }\n return new GraphQLClient(conf);\n },\n oAuthClientByUserToken: function oAuthClientByUserToken() {\n this.haveLogined();\n var token = this.userAuth.token;\n\n if (!this._oAuthClientByUserToken) {\n this._oAuthClientByUserToken = new GraphQLClient({\n baseURL: configs.services.oauth.host,\n headers: {\n Authorization: 'Bearer ' + token\n },\n timeout: this.opts.timeout\n });\n }\n return this._oAuthClientByUserToken;\n },\n initUserClient: function initUserClient(token) {\n if (token) {\n this.userAuth = {\n authed: true,\n authSuccess: true,\n token: token\n };\n if (configs.inBrowser) {\n localStorage.setItem('_authing_token', token);\n }\n }\n this.UserClient = this._initClient(token);\n },\n initOwnerClient: function initOwnerClient(token) {\n if (token) {\n this.ownerAuth = {\n authed: true,\n authSuccess: true,\n token: token\n };\n }\n this.ownerClient = this._initClient(token);\n },\n initOAuthClient: function initOAuthClient() {\n this.OAuthClient = new GraphQLClient({\n baseURL: configs.services.oauth.host,\n timeout: this.opts.timeout\n });\n },\n _auth: function _auth() {\n var _this = this;\n\n var authOpts = {\n baseURL: configs.services.user.host,\n timeout: this.opts.timeout\n };\n\n if (this.opts.accessToken) {\n authOpts.headers = {\n Authorization: 'Bearer ' + this.opts.accessToken\n };\n }\n\n if (!this.AuthService) {\n this.AuthService = new GraphQLClient(authOpts);\n }\n\n if (this.opts.accessToken && this.AuthService) {\n return new Promise(function (resolve) {\n resolve(_this.opts.accessToken);\n });\n }\n\n var options = {\n secret: this.opts.secret,\n clientId: this.opts.clientId\n };\n\n var self = this;\n\n var query = '';\n var queryField = '{\\n accessToken\\n clientInfo {\\n _id\\n name\\n descriptions\\n jwtExpired\\n createdAt\\n isDeleted\\n logo\\n emailVerifiedDefault\\n registerDisabled\\n allowedOrigins\\n clientType {\\n _id\\n name\\n description\\n image\\n example\\n }\\n }\\n }';\n\n if (configs.inBrowser) {\n options = {\n clientId: this.opts.clientId,\n timestamp: this.opts.timestamp,\n nonce: this.opts.nonce,\n signature: this.opts.signature\n };\n query = 'query {\\n getClientWhenSdkInit(timestamp: \"' + options.timestamp + '\", clientId: \"' + options.clientId + '\", nonce: ' + options.nonce + ', signature: \"' + options.signature + '\")' + queryField + '\\n }';\n } else {\n query = 'query {\\n getClientWhenSdkInit(secret: \"' + options.secret + '\", clientId: \"' + options.clientId + '\")' + queryField + '\\n }';\n }\n\n return this.AuthService.request({\n query: query\n }).then(function (data) {\n var accessToken = '';\n if (data.getClientWhenSdkInit) {\n // eslint-disable-next-line prefer-destructuring\n accessToken = data.getClientWhenSdkInit.accessToken;\n self.clientInfo = data.getClientWhenSdkInit.clientInfo;\n }\n self.AuthService = new GraphQLClient({\n baseURL: configs.services.user.host,\n headers: {\n Authorization: 'Bearer ' + accessToken\n }\n });\n return accessToken;\n });\n },\n loginFromLocalStorage: function loginFromLocalStorage() {\n var self = this;\n if (configs.inBrowser) {\n var authingToken = localStorage.getItem('_authing_token');\n if (authingToken) {\n self.initUserClient(authingToken);\n }\n }\n },\n checkLoginStatus: function checkLoginStatus(token) {\n return this.UserClient.request({\n operationName: 'checkLoginStatus',\n query: 'query checkLoginStatus($token: String) {\\n checkLoginStatus(token: $token) {\\n status\\n code\\n message\\n }\\n }',\n variables: {\n token: token\n }\n }).then(function (res) {\n return res.checkLoginStatus;\n });\n },\n _readOAuthList: function _readOAuthList(params) {\n var variables = {};\n if (params) {\n variables = params;\n }\n var self = this;\n\n this.haveAccess();\n\n if (!this._OAuthService) {\n this._OAuthService = new GraphQLClient({\n baseURL: configs.services.oauth.host,\n headers: {\n Authorization: 'Bearer ' + self.ownerAuth.token\n }\n });\n }\n return this._OAuthService.request({\n operationName: 'getOAuthList',\n query: 'query getOAuthList($clientId: String!, $useGuard: Boolean) {\\n ReadOauthList(clientId: $clientId, useGuard: $useGuard) {\\n _id\\n name\\n image\\n description\\n enabled\\n client\\n user\\n url\\n alias\\n }\\n }',\n variables: _extends({\n clientId: self.opts.clientId\n }, variables)\n }).then(function (res) {\n return res.ReadOauthList;\n });\n },\n haveAccess: function haveAccess() {\n if (!this.ownerAuth.authSuccess) {\n throw 'have no access, please check your secret and client ID.';\n }\n },\n haveLogined: function haveLogined() {\n if (!this.userAuth.authSuccess) {\n throw 'not logined yet, please login first.';\n }\n },\n _chooseClient: function _chooseClient() {\n if (this.userAuth.authSuccess) {\n return this.UserClient;\n }\n return this.ownerClient;\n },\n _login: function _login(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n /* eslint-disable no-param-reassign */\n\n options.registerInClient = this.opts.clientId;\n\n if (options.password) {\n options.password = encryption(options.password);\n }\n\n this.haveAccess();\n\n if (configs.inBrowser) {\n options.browser = window.navigator.userAgent;\n }\n\n return this.UserClient.request({\n operationName: 'login',\n query: 'mutation login($unionid: String, $email: String, $username: String, $password: String, $lastIP: String, $registerInClient: String!, $verifyCode: String, $browser: String, $openid: String) {\\n login(unionid: $unionid, email: $email, username: $username, password: $password, lastIP: $lastIP, registerInClient: $registerInClient, verifyCode: $verifyCode, browser: $browser, openid: $openid) {\\n _id\\n email\\n emailVerified\\n unionid\\n openid\\n oauth\\n registerMethod\\n username\\n nickname\\n company\\n photo\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.login;\n });\n },\n _loginByLDAP: function _loginByLDAP(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n options.clientId = this.opts.clientId;\n\n if (!options.password) {\n throw 'password is not provided.';\n }\n\n if (!options.username) {\n throw 'username is not provided.';\n }\n\n this.haveAccess();\n\n if (configs.inBrowser) {\n options.browser = window.navigator.userAgent;\n }\n\n return this.OAuthClient.request({\n operationName: 'LoginByLDAP',\n query: 'mutation LoginByLDAP($username: String!, $password: String!, $clientId: String!, $browser: String) {\\n LoginByLDAP(username: $username, clientId: $clientId, password: $password, browser: $browser) {\\n _id\\n email\\n emailVerified\\n unionid\\n openid\\n oauth\\n registerMethod\\n username\\n nickname\\n company\\n photo\\n browser\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.LoginByLDAP;\n });\n },\n loginByLDAP: function loginByLDAP(options) {\n var self = this;\n return this._loginByLDAP(options).then(function (user) {\n if (user) {\n self.initUserClient(user.token);\n }\n return user;\n });\n },\n login: function login(options) {\n var self = this;\n return this._login(options).then(function (user) {\n if (user) {\n self.initUserClient(user.token);\n }\n return user;\n });\n },\n register: function register(options) {\n this.haveAccess();\n\n if (!options) {\n throw 'options is not provided';\n }\n\n options.registerInClient = this.opts.clientId;\n\n if (options.password) {\n options.password = encryption(options.password);\n }\n\n if (configs.inBrowser) {\n options.browser = window.navigator.userAgent;\n }\n\n return this.UserClient.request({\n operationName: 'register',\n query: '\\n mutation register(\\n $unionid: String,\\n $openid: String,\\n $email: String,\\n $password: String,\\n $lastIP: String,\\n $gender: String,\\n $birthdate: String,\\n $region: String,\\n $locality: String,\\n $name: String,\\n $givenName: String,\\n $familyName: String,\\n $middleName: String,\\n $profile: String,\\n $preferredUsername: String,\\n $website: String,\\n $zoneinfo: String,\\n $locale: String,\\n $address: String,\\n $formatted: String,\\n $streetAddress: String,\\n $postalCode: String,\\n $country: String,\\n $updatedAt: String,\\n $forceLogin: Boolean,\\n $registerInClient: String!,\\n $oauth: String,\\n $username: String,\\n $nickname: String,\\n $registerMethod: String,\\n $photo: String,\\n $company: String,\\n $browser: String,\\n ) {\\n register(userInfo: {\\n unionid: $unionid,\\n openid: $openid,\\n email: $email,\\n password: $password,\\n lastIP: $lastIP,\\n forceLogin: $forceLogin,\\n registerInClient: $registerInClient,\\n oauth: $oauth,\\n registerMethod: $registerMethod,\\n name: $name,\\n givenName: $givenName,\\n familyName: $familyName,\\n middleName: $middleName,\\n profile: $profile,\\n preferredUsername: $preferredUsername,\\n website: $website,\\n zoneinfo: $zoneinfo,\\n locale: $locale,\\n address: $address,\\n formatted: $formatted,\\n streetAddress: $streetAddress,\\n postalCode: $postalCode,\\n country: $country,\\n updatedAt: $updatedAt,\\n gender: $gender,\\n birthdate: $birthdate,\\n region: $region,\\n locality: $locality,\\n photo: $photo,\\n username: $username,\\n nickname: $nickname,\\n company: $company,\\n browser: $browser,\\n }) {\\n _id,\\n email,\\n emailVerified,\\n unionid,\\n openid,\\n oauth,\\n registerMethod,\\n username,\\n nickname,\\n company,\\n photo,\\n browser,\\n password,\\n token,\\n group {\\n name\\n },\\n blocked,\\n device\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.register;\n });\n },\n logout: function logout(_id) {\n this.haveAccess();\n\n if (!_id) {\n throw '_id is not provided';\n }\n\n this.userAuth = {\n authed: false,\n authSuccess: false,\n token: null\n };\n if (configs.inBrowser) {\n localStorage.removeItem('_authing_token');\n }\n\n return this.update({\n _id: _id,\n tokenExpiredAt: 0\n });\n },\n user: function user(options) {\n this.haveAccess();\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.id) {\n throw 'id in options is not provided';\n }\n options.registerInClient = this.opts.clientId;\n\n var client = this._chooseClient();\n\n return client.request({\n operationName: 'user',\n query: 'query user($id: String!, $registerInClient: String!){\\n user(id: $id, registerInClient: $registerInClient) {\\n _id\\n unionid\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n userLocation {\\n _id\\n when\\n where\\n }\\n userLoginHistory {\\n totalCount\\n list {\\n _id\\n when\\n success\\n ip\\n result\\n }\\n }\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.user;\n });\n },\n userPatch: function userPatch(options) {\n this.haveAccess();\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.ids) {\n throw 'ids in options is not provided';\n }\n options.registerInClient = this.opts.clientId;\n\n var client = this._chooseClient();\n\n return client.request({\n operationName: 'userPatch',\n query: 'query userPatch($ids: String!){\\n userPatch(ids: $ids) {\\n list {\\n _id\\n unionid\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n userLocation {\\n _id\\n when\\n where\\n }\\n userLoginHistory {\\n totalCount\\n list {\\n _id\\n when\\n success\\n ip\\n result\\n }\\n }\\n }\\n totalCount\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.userPatch;\n });\n },\n list: function list(page, count) {\n this.haveAccess();\n\n page = page || 1;\n count = count || 10;\n\n var options = {\n registerInClient: this.opts.clientId,\n page: page,\n count: count\n };\n\n return this.ownerClient.request({\n operationName: 'users',\n query: 'query users($registerInClient: String, $page: Int, $count: Int){\\n users(registerInClient: $registerInClient, page: $page, count: $count) {\\n totalCount\\n list {\\n _id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n password\\n registerInClient\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n group {\\n _id\\n name\\n descriptions\\n createdAt\\n }\\n clientType {\\n _id\\n name\\n description\\n image\\n example\\n }\\n userLocation {\\n _id\\n when\\n where\\n }\\n userLoginHistory {\\n totalCount\\n list{\\n _id\\n when\\n success\\n ip\\n result\\n }\\n }\\n systemApplicationType {\\n _id\\n name\\n descriptions\\n price\\n }\\n }\\n }\\n }',\n variables: options\n }).then(function (res) {\n return res.users;\n });\n },\n remove: function remove(_id, operator) {\n var self = this;\n\n this.haveAccess();\n\n if (!_id) {\n throw '_id is not provided';\n }\n\n return this.ownerClient.request({\n query: 'mutation removeUsers($ids: [String], $registerInClient: String, $operator: String){\\n removeUsers(ids: $ids, registerInClient: $registerInClient, operator: $operator) {\\n _id\\n }\\n }',\n variables: {\n ids: [_id],\n registerInClient: self.opts.clientId,\n operator: operator\n }\n }).then(function (res) {\n return res.removeUsers;\n });\n },\n _uploadAvatar: function _uploadAvatar(options) {\n var client = this._chooseClient();\n return client.request({\n operationName: 'qiNiuUploadToken',\n query: 'query qiNiuUploadToken {\\n qiNiuUploadToken\\n }'\n }).then(function (data) {\n return data.qiNiuUploadToken;\n }).then(function (token) {\n if (!token) {\n throw {\n graphQLErrors: [{\n message: {\n message: '获取文件上传token失败'\n }\n }]\n };\n }\n\n var formData = new FormData();\n formData.append('file', options.photo);\n formData.append('token', token);\n return axios.post('https://upload.qiniup.com/', formData, {\n method: 'post',\n headers: { 'Content-Type': 'multipart/form-data' }\n });\n }).then(function (data) {\n return data.data;\n }).then(function (data) {\n if (data.key) {\n options.photo = 'https://usercontents.authing.cn/' + data.key;\n }\n return options;\n }).catch(function (e) {\n if (e.graphQLErrors) {\n throw e.graphQLErrors[0];\n }\n throw {\n message: {\n message: e\n }\n };\n });\n },\n update: function update(options) {\n var self = this;\n\n this.haveAccess();\n\n if (!options) {\n throw 'options is not provided';\n }\n\n // eslint-disable-next-line no-underscore-dangle\n if (!options._id) {\n throw '_id in options is not provided';\n }\n\n if (options.password) {\n if (!options.oldPassword) {\n throw 'oldPassword in options is not provided';\n }\n options.password = encryption(options.password);\n options.oldPassword = encryption(options.oldPassword);\n }\n\n options.registerInClient = self.opts.clientId;\n\n var keyTypeList = {\n _id: 'String!',\n email: 'String',\n emailVerified: 'Boolean',\n username: 'String',\n nickname: 'String',\n company: 'String',\n photo: 'String',\n oauth: 'String',\n browser: 'String',\n password: 'String',\n oldPassword: 'String',\n registerInClient: 'String!',\n phone: 'String',\n token: 'String',\n tokenExpiredAt: 'String',\n loginsCount: 'Int',\n lastLogin: 'String',\n lastIP: 'String',\n signedUp: 'String',\n blocked: 'Boolean',\n isDeleted: 'Boolean'\n };\n var returnFields = '_id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n phone\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted';\n\n function generateArgs(opts) {\n var args = [];\n var argsFiller = [];\n var argsString = '';\n // eslint-disable-next-line no-restricted-syntax\n for (var key in opts) {\n if (keyTypeList[key]) {\n args.push('$' + key + ': ' + keyTypeList[key]);\n argsFiller.push(key + ': $' + key);\n }\n }\n argsString = args.join(', ');\n return {\n args: args,\n argsString: argsString,\n argsFiller: argsFiller\n };\n }\n\n var client = this._chooseClient();\n\n if (options.photo) {\n var photo = options.photo;\n\n if (typeof photo !== 'string') {\n return this._uploadAvatar(options).then(function (opts) {\n var arg = generateArgs(opts);\n return client.request({\n operationName: 'UpdateUser',\n query: '\\n mutation UpdateUser(' + arg.argsString + '){\\n updateUser(options: {\\n ' + arg.argsFiller.join(', ') + '\\n }) {\\n ' + returnFields + '\\n }\\n }\\n ',\n variables: opts\n });\n }).then(function (res) {\n return res.updateUser;\n });\n }\n }\n var args = generateArgs(options);\n return client.request({\n operationName: 'UpdateUser',\n query: '\\n mutation UpdateUser(' + args.argsString + '){\\n updateUser(options: {\\n ' + args.argsFiller.join(', ') + '\\n }) {\\n ' + returnFields + '\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.updateUser;\n });\n },\n\n /**\n * \n * @param {Object} params 获取社会化登录时可以加选项\n * @param {Boolean} params.useGuard 是否使用 Guard\n */\n readOAuthList: function readOAuthList(params) {\n if (!params || (typeof params === 'undefined' ? 'undefined' : _typeof(params)) !== 'object') {\n return this._readOAuthList().then(function (list) {\n if (list) {\n return list.filter(function (item) {\n return item.enabled;\n });\n }\n throw {\n message: '获取OAuth列表失败,原因未知'\n };\n });\n } else {\n return this._readOAuthList(params).then(function (list) {\n if (list) {\n return list.filter(function (item) {\n return item.enabled;\n });\n }\n throw {\n message: '获取OAuth列表失败,原因未知'\n };\n });\n }\n },\n sendResetPasswordEmail: function sendResetPasswordEmail(options) {\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.email) {\n throw 'email in options is not provided';\n }\n\n options.client = this.opts.clientId;\n return this.UserClient.request({\n operationName: 'sendResetPasswordEmail',\n query: '\\n mutation sendResetPasswordEmail(\\n $email: String!,\\n $client: String!\\n ){\\n sendResetPasswordEmail(\\n email: $email,\\n client: $client\\n ) {\\n message\\n code\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.sendResetPasswordEmail;\n });\n },\n verifyResetPasswordVerifyCode: function verifyResetPasswordVerifyCode(options) {\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.email) {\n throw 'email in options is not provided';\n }\n if (!options.verifyCode) {\n throw 'verifyCode in options is not provided';\n }\n options.client = this.opts.clientId;\n return this.UserClient.request({\n operationName: 'verifyResetPasswordVerifyCode',\n query: '\\n mutation verifyResetPasswordVerifyCode(\\n $email: String!,\\n $client: String!,\\n $verifyCode: String!\\n ) {\\n verifyResetPasswordVerifyCode(\\n email: $email,\\n client: $client,\\n verifyCode: $verifyCode\\n ) {\\n message\\n code\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.verifyResetPasswordVerifyCode;\n });\n },\n changePassword: function changePassword(options) {\n if (!options) {\n throw 'options is not provided';\n }\n if (!options.email) {\n throw 'email in options is not provided';\n }\n if (!options.password) {\n throw 'password in options is not provided';\n }\n if (!options.verifyCode) {\n throw 'verifyCode in options is not provided';\n }\n options.client = this.opts.clientId;\n options.password = encryption(options.password);\n return this.UserClient.request({\n operationName: 'changePassword',\n query: '\\n mutation changePassword(\\n $email: String!,\\n $client: String!,\\n $password: String!,\\n $verifyCode: String!\\n ){\\n changePassword(\\n email: $email,\\n client: $client,\\n password: $password,\\n verifyCode: $verifyCode\\n ) {\\n _id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.changePassword;\n });\n },\n sendVerifyEmail: function sendVerifyEmail(options) {\n if (!options.email) {\n throw 'email in options is not provided';\n }\n\n options.client = this.opts.clientId;\n\n return this.AuthService.request({\n operationName: 'sendVerifyEmail',\n query: '\\n mutation sendVerifyEmail(\\n $email: String!,\\n $client: String!\\n ){\\n sendVerifyEmail(\\n email: $email,\\n client: $client\\n ) {\\n message,\\n code,\\n status\\n }\\n }\\n ',\n variables: options\n }).then(function (res) {\n return res.sendVerifyEmail;\n });\n },\n selectAvatarFile: function selectAvatarFile(cb) {\n if (!configs.inBrowser) {\n throw '当前不是浏览器环境,无法选取文件';\n }\n var inputElem = document.createElement('input');\n inputElem.type = 'file';\n inputElem.accept = 'image/*';\n inputElem.onchange = function () {\n cb(inputElem.files[0]);\n };\n inputElem.click();\n },\n decodeToken: function decodeToken(token) {\n return this.UserClient.request({\n operationName: 'decodeJwtToken',\n query: 'query decodeJwtToken($token: String) {\\n decodeJwtToken(token: $token) {\\n data {\\n email\\n id\\n clientId\\n }\\n status {\\n code\\n message\\n }\\n iat\\n exp\\n }\\n }',\n variables: {\n token: token\n }\n }).then(function (res) {\n return res.decodeJwtToken;\n });\n },\n readUserOAuthList: function readUserOAuthList(variables) {\n var client = this.oAuthClientByUserToken();\n return client.request({\n operationName: 'notBindOAuthList',\n query: 'query notBindOAuthList($user: String, $client: String) {\\n notBindOAuthList(user: $user, client: $client) {\\n type\\n oAuthUrl\\n image\\n name\\n binded\\n }\\n }',\n variables: variables\n }).then(function (res) {\n return res.notBindOAuthList;\n });\n },\n bindOAuth: function bindOAuth(variables) {\n if (!variables) {\n throw 'options is not provided';\n }\n if (!variables.type) {\n throw 'type in options is not provided';\n }\n if (!variables.unionid) {\n throw 'unionid in options is not provided';\n }\n if (!variables.userInfo) {\n throw 'userInfo in options is not provided';\n }\n\n return this.UserClient.request({\n operationName: 'bindOtherOAuth',\n query: 'mutation bindOtherOAuth(\\n $user: String,\\n $client: String,\\n $type: String!,\\n $unionid: String!,\\n $userInfo: String!\\n ) {\\n bindOtherOAuth (\\n user: $user,\\n client: $client,\\n type: $type,\\n unionid: $unionid,\\n userInfo: $userInfo\\n ) {\\n _id\\n user\\n client\\n type\\n userInfo\\n unionid\\n createdAt\\n }\\n }',\n variables: variables\n });\n },\n unbindOAuth: function unbindOAuth(variables) {\n if (!variables) {\n throw 'options is not provided';\n }\n if (!variables.type) {\n throw 'type in options is not provided';\n }\n\n return this.UserClient.request({\n operationName: 'unbindOtherOAuth',\n query: 'mutation unbindOtherOAuth(\\n $user: String,\\n $client: String,\\n $type: String!\\n ){\\n unbindOtherOAuth(\\n user: $user,\\n client: $client,\\n type: $type\\n ) {\\n _id\\n user\\n client\\n type\\n userInfo\\n unionid\\n createdAt\\n }\\n }',\n variables: variables\n });\n },\n unbindEmail: function unbindEmail(variables) {\n return this.UserClient.request({\n operationName: 'unbindEmail',\n query: 'mutation unbindEmail(\\n $user: String,\\n $client: String,\\n ){\\n unbindEmail(\\n user: $user,\\n client: $client,\\n ) {\\n _id\\n email\\n emailVerified\\n username\\n nickname\\n company\\n photo\\n browser\\n registerInClient\\n registerMethod\\n oauth\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }',\n variables: variables\n });\n },\n randomWord: function randomWord(randomFlag, min, max) {\n var str = '';\n var range = min;\n var arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];\n\n if (randomFlag) {\n range = Math.round(Math.random() * (max - min)) + min; // 任意长度\n }\n\n for (var i = 0; i < range; i += 1) {\n var pos = Math.round(Math.random() * (arr.length - 1));\n str += arr[pos];\n }\n\n return str;\n },\n genQRCode: function genQRCode(clientId) {\n var random = this.randomWord(true, 12, 24);\n sessionStorage.randomWord = random;\n\n var url = configs.services.oauth.host;\n url = url.replace('/graphql', '');\n\n return axios.get(url + '/oauth/wxapp/qrcode/' + clientId + '?random=' + random + '&useSelfWxapp=' + this.opts.useSelfWxapp + '&enableFetchPhone=' + this.opts.enableFetchPhone);\n },\n checkQR: function checkQR() {\n var random = sessionStorage.randomWord || '';\n var url = configs.services.oauth.host;\n url = url.replace('/graphql', '');\n\n return axios.post(url + '/oauth/wxapp/confirm/qr?random=' + random + '&useSelfWxapp=' + this.opts.useSelfWxapp);\n },\n startWXAppScaning: function startWXAppScaning(opts) {\n var self = this;\n\n if (!opts) {\n opts = {};\n }\n\n var mountNode = opts.mount || 'authing__qrcode-root-node';\n var interval = opts.interval || 1500;\n var _opts = opts,\n tips = _opts.tips;\n\n\n var redirect = true;\n\n // eslint-disable-next-line no-prototype-builtins\n if (opts.hasOwnProperty('redirect')) {\n if (!opts.redirect) {\n redirect = false;\n }\n }\n\n var _opts2 = opts,\n onError = _opts2.onError,\n onSuccess = _opts2.onSuccess,\n onIntervalStarting = _opts2.onIntervalStarting,\n onQRCodeShow = _opts2.onQRCodeShow,\n onQRCodeLoad = _opts2.onQRCodeLoad;\n\n\n var qrcodeNode = document.getElementById(mountNode);\n var qrcodeWrapper = void 0;\n\n var needGenerate = false;\n var start = function start() {};\n\n if (!qrcodeNode) {\n qrcodeNode = document.createElement('div');\n qrcodeNode.id = mountNode;\n qrcodeNode.style = 'z-index: 65535;position: fixed;background: #fff;width: 300px;height: 300px;left: 50%;margin-left: -150px;display: flex;justify-content: center;align-items: center;top: 50%;margin-top: -150px;border: 1px solid #ccc;';\n document.getElementsByTagName('body')[0].appendChild(qrcodeNode);\n needGenerate = true;\n } else {\n qrcodeNode.style = 'position:relative';\n }\n\n var styleNode = document.createElement('style');var style = '#authing__retry a:hover{outline:0px;text-decoration:none;}#authing__spinner{position:absolute;left:50%;margin-left:-6px;}.spinner{margin:100px auto;width:20px;height:20px;position:relative}.container1>div,.container2>div,.container3>div{width:6px;height:6px;background-color:#00a1ea;border-radius:100%;position:absolute;-webkit-animation:bouncedelay 1.2s infinite ease-in-out;animation:bouncedelay 1.2s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.spinner .spinner-container{position:absolute;width:100%;height:100%}.container2{-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}.container3{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}.circle1{top:0;left:0}.circle2{top:0;right:0}.circle3{right:0;bottom:0}.circle4{left:0;bottom:0}.container2 .circle1{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.container3 .circle1{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.container1 .circle2{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.container2 .circle2{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}.container3 .circle2{-webkit-animation-delay:-0.7s;animation-delay:-0.7s}.container1 .circle3{-webkit-animation-delay:-0.6s;animation-delay:-0.6s}.container2 .circle3{-webkit-animation-delay:-0.5s;animation-delay:-0.5s}.container3 .circle3{-webkit-animation-delay:-0.4s;animation-delay:-0.4s}.container1 .circle4{-webkit-animation-delay:-0.3s;animation-delay:-0.3s}.container2 .circle4{-webkit-animation-delay:-0.2s;animation-delay:-0.2s}.container3 .circle4{-webkit-animation-delay:-0.1s;animation-delay:-0.1s}@-webkit-keyframes bouncedelay{0%,80%,100%{-webkit-transform:scale(0.0)}40%{-webkit-transform:scale(1.0)}}@keyframes bouncedelay{0%,80%,100%{transform:scale(0.0);-webkit-transform:scale(0.0)}40%{transform:scale(1.0);-webkit-transform:scale(1.0)}}';\n\n styleNode.type = 'text/css';\n\n if (styleNode.styleSheet) {\n styleNode.styleSheet.cssText = style;\n } else {\n styleNode.innerHTML = style;\n }\n\n document.getElementsByTagName('head')[0].appendChild(styleNode);\n\n var loading = function loading() {\n qrcodeNode.innerHTML = '
';\n };\n\n var unloading = function unloading() {\n var child = document.getElementById('authing__spinner');\n qrcodeNode.removeChild(child);\n };\n\n var genTip = function genTip(text) {\n var tip = document.createElement('span');\n tip.class = 'authing__heading-subtitle';\n if (!needGenerate) {\n tip.style = 'display: block;font-weight: 400;font-size: 15px;color: #888;ine-height: 48px;';\n } else {\n tip.style = 'display: block;font-weight: 400;font-size: 12px;color: #888;';\n }\n tip.innerHTML = text;\n return tip;\n };\n\n var genImage = function genImage(src) {\n var qrcodeImage = document.createElement('img');\n qrcodeImage.class = 'authing__qrcode';\n qrcodeImage.src = src;\n qrcodeImage.width = 240;\n qrcodeImage.height = 240;\n return qrcodeImage;\n };\n\n var genShadow = function genShadow(text, aOnClick) {\n var shadow = document.createElement('div');\n shadow.id = 'authing__retry';\n shadow.style = 'text-align:center;width: 240px;height: 240px;position: absolute;left: 50%;top: 0px;margin-left: -120px;background-color: rgba(0,0,0, 0.5);line-height:240px;color:#fff;font-weight:600;';\n\n var shadowA = document.createElement('a');\n shadowA.innerHTML = text;\n shadowA.style = 'color:#fff;border-bottom: 1px solid #fff;cursor: pointer;';\n shadowA.onclick = aOnClick;\n shadow.appendChild(shadowA);\n return shadow;\n };\n\n function genRetry(qrcodeElm, tipText) {\n var tip = genTip(tipText);\n\n qrcodeWrapper = document.createElement('div');\n qrcodeWrapper.id = 'authing__qrcode-wrapper';\n qrcodeWrapper.style = 'text-align: center;position: relative;';\n\n var qrcodeImage = genImage('https://usercontents.authing.cn/authing_user_manager_wxapp_qrcode.jpg');\n\n if (!needGenerate) {\n qrcodeImage.style = 'margin-top: 12px;';\n } else {\n qrcodeImage.style = 'margin-top: 16px;';\n }\n\n qrcodeImage.onload = function () {\n unloading();\n };\n\n var shadow = genShadow('点击重试', function () {\n start();\n });\n\n qrcodeWrapper.appendChild(qrcodeImage);\n qrcodeWrapper.appendChild(shadow);\n qrcodeWrapper.appendChild(tip);\n qrcodeElm.appendChild(qrcodeWrapper);\n }\n\n start = function start() {\n loading();\n self.genQRCode(self.opts.clientId).then(function (qrRes) {\n qrRes = qrRes.data;\n\n if (qrRes.code !== 200) {\n genRetry(qrcodeNode, qrRes.message);\n if (onError) {\n onError(qrRes);\n }\n } else {\n var qrcode = qrRes.data;\n if (onQRCodeLoad) {\n onQRCodeLoad(qrcode);\n }\n sessionStorage.qrcodeUrl = qrcode.qrcode;\n sessionStorage.qrcode = JSON.stringify(qrcode);\n\n if (qrcodeNode) {\n qrcodeWrapper = document.createElement('div');\n qrcodeWrapper.id = 'authing__qrcode-wrapper';\n qrcodeWrapper.style = 'text-align: center;position: relative;';\n\n var qrcodeImage = genImage(qrcode.qrcode);\n\n qrcodeImage.onload = function () {\n unloading();\n if (onQRCodeShow) {\n onQRCodeShow(qrcode);\n }\n var inter = 0;\n inter = setInterval(function () {\n if (onIntervalStarting) {\n onIntervalStarting(inter);\n }\n self.checkQR().then(function (checkRes) {\n var checkResult = checkRes.data.data;\n if (checkResult.code === 200) {\n clearInterval(inter);\n if (redirect) {\n var shadowX = genShadow('扫码成功,即将跳转', function () {\n window.location.href = checkResult.redirect + '?code=200&data=' + JSON.stringify(checkResult.data);\n });\n setTimeout(function () {\n window.location.href = checkResult.redirect + '?code=200&data=' + JSON.stringify(checkResult.data);\n }, 600);\n qrcodeWrapper.appendChild(shadowX);\n } else {\n var shadow = genShadow('扫码成功');\n qrcodeWrapper.appendChild(shadow);\n if (onSuccess) {\n onSuccess(checkResult);\n }\n }\n }\n });\n }, interval);\n };\n\n var tip = genTip(tips || '使用 微信 或小程序 身份管家 扫码登录');\n\n qrcodeWrapper.appendChild(qrcodeImage);\n qrcodeWrapper.appendChild(tip);\n qrcodeNode.appendChild(qrcodeWrapper);\n }\n }\n }).catch(function (error) {\n genRetry(qrcodeNode, '网络出错,请重试');\n if (onError) {\n onError(error);\n }\n });\n };\n\n start();\n },\n getVerificationCode: function getVerificationCode(phone) {\n if (!phone) {\n throw 'phone is not provided';\n }\n\n var url = configs.services.user.host.replace('/graphql', '') + '/send_smscode/' + phone + '/' + this.opts.clientId;\n return axios.get(url).then(function (result) {\n if (result.data.code !== 200) {\n throw result.data;\n } else {\n return result.data;\n }\n });\n },\n loginByPhoneCode: function loginByPhoneCode(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n var self = this;\n\n this.haveAccess();\n\n var variables = {\n registerInClient: this.opts.clientId,\n phone: options.phone,\n phoneCode: parseInt(options.phoneCode, 10)\n };\n\n if (configs.inBrowser) {\n variables.browser = window.navigator.userAgent;\n }\n\n return this.UserClient.request({\n operationName: 'login',\n query: 'mutation login($phone: String, $phoneCode: Int, $registerInClient: String!, $browser: String) {\\n login(phone: $phone, phoneCode: $phoneCode, registerInClient: $registerInClient, browser: $browser) {\\n _id\\n email\\n unionid\\n openid\\n emailVerified\\n username\\n nickname\\n phone\\n company\\n photo\\n browser\\n token\\n tokenExpiredAt\\n loginsCount\\n lastLogin\\n lastIP\\n signedUp\\n blocked\\n isDeleted\\n }\\n }',\n variables: variables\n }).then(function (res) {\n return res.login;\n }).then(function (user) {\n if (user) {\n self.initUserClient(user.token);\n }\n return user;\n });\n },\n queryPermissions: function queryPermissions(userId) {\n if (!userId) {\n throw 'userId is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n user: userId\n };\n\n return this.ownerClient.request({\n operationName: 'QueryRoleByUserId',\n query: 'query QueryRoleByUserId($user: String!, $client: String!){\\n queryRoleByUserId(user: $user, client: $client) {\\n totalCount\\n list {\\n group {\\n name\\n permissions\\n }\\n }\\n }\\n }',\n variables: variables\n }).then(function (res) {\n return res.queryRoleByUserId;\n });\n },\n queryRoles: function queryRoles(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n clientId: this.opts.clientId,\n page: options.page,\n count: options.count\n };\n\n return this.ownerClient.request({\n operationName: 'ClientRoles',\n query: '\\n query ClientRoles(\\n $clientId: String!\\n $page: Int\\n $count: Int\\n ) {\\n clientRoles(\\n client: $clientId\\n page: $page\\n count: $count\\n ) {\\n totalCount\\n list {\\n _id\\n name\\n descriptions\\n client\\n createdAt\\n permissions\\n }\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.clientRoles;\n });\n },\n createRole: function createRole(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n name: options.name,\n descriptions: options.descriptions\n };\n\n return this.ownerClient.request({\n operationName: 'CreateRole',\n query: '\\n mutation CreateRole(\\n $name: String!\\n $client: String!\\n $descriptions: String\\n ) {\\n createRole(\\n name: $name\\n client: $client\\n descriptions: $descriptions\\n ) {\\n _id,\\n name,\\n client,\\n descriptions\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.createRole;\n });\n },\n updateRolePermissions: function updateRolePermissions(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n name: options.name,\n permissions: options.permissions,\n _id: options.roleId\n };\n\n return this.ownerClient.request({\n operationName: 'UpdateRole',\n query: '\\n mutation UpdateRole(\\n $_id: String!\\n $name: String!\\n $client: String!\\n $descriptions: String\\n $permissions: String\\n ) {\\n updateRole(\\n _id: $_id\\n name: $name\\n client: $client\\n descriptions: $descriptions\\n permissions: $permissions\\n ) {\\n _id,\\n name,\\n client,\\n descriptions,\\n permissions\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.updateRole;\n });\n },\n assignUserToRole: function assignUserToRole(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n group: options.roleId,\n user: options.user\n };\n\n return this.ownerClient.request({\n operationName: 'AssignUserToRole',\n query: '\\n mutation AssignUserToRole(\\n $group: String!\\n $client: String!\\n $user: String!\\n ) {\\n assignUserToRole(\\n group: $group\\n client: $client\\n user: $user\\n ) {\\n totalCount,\\n list {\\n _id,\\n client {\\n _id\\n },\\n user {\\n _id\\n },\\n createdAt\\n }\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.assignUserToRole;\n });\n },\n removeUserFromRole: function removeUserFromRole(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n user: options.user,\n group: options.roleId\n };\n\n return this.ownerClient.request({\n operationName: 'RemoveUserFromGroup',\n query: '\\n mutation RemoveUserFromGroup(\\n $group: String!\\n $client: String!\\n $user: String!\\n ) {\\n removeUserFromGroup(\\n group: $group\\n client: $client\\n user: $user\\n ) {\\n _id,\\n group {\\n _id\\n },\\n client {\\n _id\\n },\\n user {\\n _id\\n }\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.removeUserFromGroup;\n });\n },\n refreshToken: function refreshToken(options) {\n if (!options) {\n throw 'options is not provided.';\n }\n\n this.haveAccess();\n\n var variables = {\n client: this.opts.clientId,\n user: options.user\n };\n\n return this.ownerClient.request({\n operationName: 'RefreshToken',\n query: '\\n mutation RefreshToken(\\n $client: String!\\n $user: String!\\n ) {\\n refreshToken(\\n client: $client\\n user: $user\\n ) {\\n token\\n iat\\n exp\\n }\\n }\\n ',\n variables: variables\n }).then(function (res) {\n return res.refreshToken;\n });\n }\n};\n\nmodule.exports = Authing;\n\n//# sourceURL=webpack:///./src/index.js?"); /***/ }), diff --git a/examples/wxapp.html b/examples/wxapp.html index 7c6a21a8e..133fb4120 100644 --- a/examples/wxapp.html +++ b/examples/wxapp.html @@ -8,18 +8,20 @@ - +