mapexplorer-rails 1.0.0.pre.alpha.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +202 -0
- data/README.md +1 -1
- data/app/assets/javascripts/mapexplorer-rails.js +16 -0
- data/app/assets/stylesheets/mapexplorer-rails.scss +16 -0
- data/app/helpers/mapexplorer_helper.rb +14 -0
- data/config/routes.rb +14 -0
- data/lib/mapexplorer/rails.rb +14 -0
- data/lib/mapexplorer/rails/engine.rb +14 -0
- data/lib/mapexplorer/rails/version.rb +15 -1
- data/lib/tasks/mapexplorer/rails_tasks.rake +14 -0
- data/vendor/assets/mapexplorer-core/LICENSE +202 -21
- data/vendor/assets/mapexplorer-core/LICENSE_HEADER +15 -0
- data/vendor/assets/mapexplorer-core/bower.json +1 -1
- data/vendor/assets/mapexplorer-core/dist/mapexplorer-core.js +1552 -330
- data/vendor/assets/mapexplorer-core/dist/mapexplorer-core.js.map +1 -1
- data/vendor/assets/mapexplorer-core/karma.conf.js +4 -2
- data/vendor/assets/mapexplorer-core/package-lock.json +3486 -0
- data/vendor/assets/mapexplorer-core/package.json +8 -8
- data/vendor/assets/mapexplorer-core/update-license-headers.sh +20 -0
- data/vendor/assets/stratumn-agent-client/LICENSE +202 -0
- data/vendor/assets/stratumn-agent-client/LICENSE_HEADER +15 -0
- data/vendor/assets/stratumn-agent-client/README.md +268 -0
- data/vendor/assets/stratumn-agent-client/bower.json +27 -0
- data/vendor/assets/stratumn-agent-client/dist/stratumn-agent-client.js +1449 -0
- data/vendor/assets/stratumn-agent-client/dist/stratumn-agent-client.js.map +1 -0
- data/vendor/assets/stratumn-agent-client/dist/stratumn-agent-client.min.js +2 -0
- data/vendor/assets/stratumn-agent-client/dist/stratumn-agent-client.min.js.map +1 -0
- data/vendor/assets/stratumn-agent-client/examples/browser/index.html +34 -0
- data/vendor/assets/stratumn-agent-client/package.json +69 -0
- data/vendor/assets/stratumn-agent-client/rollup.base.config.js +13 -0
- data/vendor/assets/stratumn-agent-client/rollup.bower.config.js +18 -0
- data/vendor/assets/stratumn-agent-client/rollup.bower.min.config.js +7 -0
- data/vendor/assets/stratumn-agent-client/rollup.es.config.js +9 -0
- data/vendor/assets/stratumn-agent-client/rollup.umd.config.js +10 -0
- data/vendor/assets/stratumn-agent-client/update-license-headers.sh +20 -0
- metadata +25 -7
- data/MIT-LICENSE +0 -20
- data/vendor/assets/mapexplorer-core/dist/mapexplorer-core.min.js +0 -35
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":null,"sources":["../src/deprecated.js","../src/makeQueryString.js","../node_modules/setimmediate/setImmediate.js","../src/promiseWhile.js","../node_modules/httpplease/plugins/jsonrequest.js","../node_modules/httpplease/plugins/jsonresponse.js","../node_modules/httpplease/plugins/json.js","../node_modules/httpplease/plugins/cleanurl.js","../node_modules/httpplease/lib/xhr-browser.js","../node_modules/httpplease/lib/utils/delay.js","../node_modules/httpplease/lib/request.js","../node_modules/xtend/index.js","../node_modules/httpplease/lib/utils/extractResponseProps.js","../node_modules/httpplease/lib/response.js","../node_modules/httpplease/lib/error.js","../node_modules/httpplease/lib/utils/once.js","../node_modules/httpplease/lib/index.js","../src/request.js","../src/findSegments.js","../src/getBranches.js","../src/segmentify.js","../src/createMap.js","../src/getSegment.js","../src/getMapIds.js","../src/getLink.js","../src/getMap.js","../src/getAgent.js","../src/fromSegment.js","../src/config.js","../src/getApplication.js","../src/loadLink.js"],"sourcesContent":["/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nexport default function deprecated(oldFunc, newFunc) {\n if (!newFunc) {\n console.warn(`WARNING: ${oldFunc} is deprecated.`);\n } else {\n console.warn(`WARNING: ${oldFunc} is deprecated. Please use ${newFunc} instead.`);\n }\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\n/**\n * Makes a query string.\n * @param {object} obj - an object of keys\n * @returns {string} a query string\n */\nexport default function makeQueryString(obj) {\n const parts = Object.keys(obj).reduce((curr, key) => {\n const val = Array.isArray(obj[key]) ? obj[key].join('+') : obj[key];\n curr.push(`${encodeURIComponent(key)}=${encodeURIComponent(val)}`);\n return curr;\n }, []);\n\n if (parts.length) {\n return `?${parts.join('&')}`;\n }\n\n return '';\n}\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var script = doc.createElement(\"script\");\n script.onreadystatechange = function () {\n runIfPresent(handle);\n script.onreadystatechange = null;\n html.removeChild(script);\n script = null;\n };\n html.appendChild(script);\n };\n }\n\n function installSetTimeoutImplementation() {\n registerImmediate = function(handle) {\n setTimeout(runIfPresent, 0, handle);\n };\n }\n\n // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.\n var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);\n attachTo = attachTo && attachTo.setTimeout ? attachTo : global;\n\n // Don't get fooled by e.g. browserify environments.\n if ({}.toString.call(global.process) === \"[object process]\") {\n // For Node.js before 0.9\n installNextTickImplementation();\n\n } else if (canUsePostMessage()) {\n // For non-IE10 modern browsers\n installPostMessageImplementation();\n\n } else if (global.MessageChannel) {\n // For web workers, where supported\n installMessageChannelImplementation();\n\n } else if (doc && \"onreadystatechange\" in doc.createElement(\"script\")) {\n // For IE 6–8\n installReadyStateChangeImplementation();\n\n } else {\n // For older browsers\n installSetTimeoutImplementation();\n }\n\n attachTo.setImmediate = setImmediate;\n attachTo.clearImmediate = clearImmediate;\n}(typeof self === \"undefined\" ? typeof global === \"undefined\" ? this : global : self));\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport 'setimmediate';\n\n/**\n * Calls a function that returns a Promise until a condition is reached\n * @param {function} condition - while condition is true body will keep being called\n * @param {function} body - a function that is repeatedly called while condition is true\n * @returns {Promise} a Promise that resolves when the condition is no longer true\n */\nexport default function promiseWhile(condition, body) {\n return new Promise((resolve, reject) => {\n function loop() {\n body()\n .then(() => {\n // When the result of calling `condition` is no longer true, we are\n // done.\n if (!condition()) {\n resolve();\n } else {\n loop();\n }\n })\n .catch(reject);\n }\n\n // Start running the loop in the next tick so that this function is\n // completely async. It would be unexpected if `body` was called\n // synchronously the first time.\n setImmediate(loop);\n });\n}\n","'use strict';\n\nmodule.exports = {\n processRequest: function(req) {\n var\n contentType = req.header('Content-Type'),\n hasJsonContentType = contentType &&\n contentType.indexOf('application/json') !== -1;\n\n if (contentType != null && !hasJsonContentType) {\n return;\n }\n\n if (req.body) {\n if (!contentType) {\n req.header('Content-Type', 'application/json');\n }\n\n req.body = JSON.stringify(req.body);\n }\n }\n};\n","'use strict';\n\nmodule.exports = {\n processRequest: function(req) {\n var accept = req.header('Accept');\n if (accept == null) {\n req.header('Accept', 'application/json');\n }\n },\n processResponse: function(res) {\n // Check to see if the contentype is \"something/json\" or\n // \"something/somethingelse+json\"\n if (res.contentType && /^.*\\/(?:.*\\+)?json(;|$)/i.test(res.contentType)) {\n var raw = typeof res.body === 'string' ? res.body : res.text;\n if (raw) {\n res.body = JSON.parse(raw);\n }\n }\n }\n};\n","'use strict';\n\nvar jsonrequest = require('./jsonrequest'),\n jsonresponse = require('./jsonresponse');\n\nmodule.exports = {\n processRequest: function(req) {\n jsonrequest.processRequest.call(this, req);\n jsonresponse.processRequest.call(this, req);\n },\n processResponse: function(res) {\n jsonresponse.processResponse.call(this, res);\n }\n};\n","'use strict';\n\nmodule.exports = {\n processRequest: function(req) {\n req.url = req.url.replace(/[^%]+/g, function(s) {\n return encodeURI(s);\n });\n }\n};\n","module.exports = window.XMLHttpRequest;\n","'use strict';\n\n// Wrap a function in a `setTimeout` call. This is used to guarantee async\n// behavior, which can avoid unexpected errors.\n\nmodule.exports = function(fn) {\n return function() {\n var\n args = Array.prototype.slice.call(arguments, 0),\n newFunc = function() {\n return fn.apply(null, args);\n };\n setTimeout(newFunc, 0);\n };\n};\n","'use strict';\n\nfunction Request(optsOrUrl) {\n var opts = typeof optsOrUrl === 'string' ? {url: optsOrUrl} : optsOrUrl || {};\n this.method = opts.method ? opts.method.toUpperCase() : 'GET';\n this.url = opts.url;\n this.headers = opts.headers || {};\n this.body = opts.body;\n this.timeout = opts.timeout || 0;\n this.errorOn404 = opts.errorOn404 != null ? opts.errorOn404 : true;\n this.onload = opts.onload;\n this.onerror = opts.onerror;\n}\n\nRequest.prototype.abort = function() {\n if (this.aborted) return;\n this.aborted = true;\n this.xhr.abort();\n return this;\n};\n\nRequest.prototype.header = function(name, value) {\n var k;\n for (k in this.headers) {\n if (this.headers.hasOwnProperty(k)) {\n if (name.toLowerCase() === k.toLowerCase()) {\n if (arguments.length === 1) {\n return this.headers[k];\n }\n\n delete this.headers[k];\n break;\n }\n }\n }\n if (value != null) {\n this.headers[name] = value;\n return value;\n }\n};\n\n\nmodule.exports = Request;\n","module.exports = extend\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n","'use strict';\n\nvar extend = require('xtend');\n\nmodule.exports = function(req) {\n var xhr = req.xhr;\n var props = {request: req, xhr: xhr};\n\n // Try to create the response from the request. If the request was aborted,\n // accesssing properties of the XHR may throw an error, so we wrap in a\n // try/catch.\n try {\n var lines, i, m, headers = {};\n if (xhr.getAllResponseHeaders) {\n lines = xhr.getAllResponseHeaders().split('\\n');\n for (i = 0; i < lines.length; i++) {\n if ((m = lines[i].match(/\\s*([^\\s]+):\\s+([^\\s]+)/))) {\n headers[m[1]] = m[2];\n }\n }\n }\n\n props = extend(props, {\n status: xhr.status,\n contentType: xhr.contentType || (xhr.getResponseHeader && xhr.getResponseHeader('Content-Type')),\n headers: headers,\n text: xhr.responseText,\n body: xhr.response || xhr.responseText\n });\n } catch (err) {}\n\n return props;\n};\n","'use strict';\n\nvar Request = require('./request');\nvar extractResponseProps = require('./utils/extractResponseProps');\n\nfunction Response(props) {\n this.request = props.request;\n this.xhr = props.xhr;\n this.headers = props.headers || {};\n this.status = props.status || 0;\n this.text = props.text;\n this.body = props.body;\n this.contentType = props.contentType;\n this.isHttpError = props.status >= 400;\n}\n\nResponse.prototype.header = Request.prototype.header;\n\nResponse.fromRequest = function(req) {\n return new Response(extractResponseProps(req));\n};\n\n\nmodule.exports = Response;\n","'use strict';\n\nvar Response = require('./response');\nvar extractResponseProps = require('./utils/extractResponseProps');\nvar extend = require('xtend');\n\nfunction RequestError(message, props) {\n var err = new Error(message);\n err.name = 'RequestError';\n this.name = err.name;\n this.message = err.message;\n if (err.stack) {\n this.stack = err.stack;\n }\n\n this.toString = function() {\n return this.message;\n };\n\n for (var k in props) {\n if (props.hasOwnProperty(k)) {\n this[k] = props[k];\n }\n }\n}\n\nRequestError.prototype = extend(Error.prototype);\nRequestError.prototype.constructor = RequestError;\n\nRequestError.create = function(message, req, props) {\n var err = new RequestError(message, props);\n Response.call(err, extractResponseProps(req));\n return err;\n};\n\nmodule.exports = RequestError;\n","'use strict';\n\n// A \"once\" utility.\nmodule.exports = function(fn) {\n var result, called = false;\n return function() {\n if (!called) {\n called = true;\n result = fn.apply(this, arguments);\n }\n return result;\n };\n};\n","'use strict';\n\nvar\n cleanURL = require('../plugins/cleanurl'),\n XHR = require('./xhr'),\n delay = require('./utils/delay'),\n RequestError = require('./error'),\n Response = require('./response'),\n Request = require('./request'),\n extend = require('xtend'),\n once = require('./utils/once');\n\nvar i,\n createError = RequestError.create;\n\nfunction factory(defaults, plugins) {\n defaults = defaults || {};\n plugins = plugins || [];\n\n function http(req, cb) {\n var xhr, plugin, done, k, timeoutId, supportsLoadAndErrorEvents;\n\n req = new Request(extend(defaults, req));\n\n for (i = 0; i < plugins.length; i++) {\n plugin = plugins[i];\n if (plugin.processRequest) {\n plugin.processRequest(req);\n }\n }\n\n // Give the plugins a chance to create the XHR object\n for (i = 0; i < plugins.length; i++) {\n plugin = plugins[i];\n if (plugin.createXHR) {\n xhr = plugin.createXHR(req);\n break; // First come, first serve\n }\n }\n xhr = xhr || new XHR();\n\n req.xhr = xhr;\n\n // Use a single completion callback. This can be called with or without\n // an error. If no error is passed, the request will be examined to see\n // if it was successful.\n done = once(delay(function(rawError) {\n clearTimeout(timeoutId);\n xhr.onload = xhr.onerror = xhr.onabort = xhr.onreadystatechange = xhr.ontimeout = xhr.onprogress = null;\n\n var err = getError(req, rawError);\n\n var res = err || Response.fromRequest(req);\n for (i = 0; i < plugins.length; i++) {\n plugin = plugins[i];\n if (plugin.processResponse) {\n plugin.processResponse(res);\n }\n }\n\n // Invoke callbacks\n if (err && req.onerror) req.onerror(err);\n if (!err && req.onload) req.onload(res);\n if (cb) cb(err, err ? undefined : res);\n\n }));\n\n supportsLoadAndErrorEvents = ('onload' in xhr) && ('onerror' in xhr);\n xhr.onload = function() { done(); };\n xhr.onerror = done;\n xhr.onabort = function() { done(); };\n\n // We'd rather use `onload`, `onerror`, and `onabort` since they're the\n // only way to reliably detect successes and failures but, if they\n // aren't available, we fall back to using `onreadystatechange`.\n xhr.onreadystatechange = function() {\n if (xhr.readyState !== 4) return;\n\n if (req.aborted) return done();\n\n if (!supportsLoadAndErrorEvents) {\n // Assume a status of 0 is an error. This could be a false\n // positive, but there's no way to tell when using\n // `onreadystatechange` ):\n // See matthewwithanm/react-inlinesvg#10.\n\n // Some browsers don't like you reading XHR properties when the\n // XHR has been aborted. In case we've gotten here as a result\n // of that (either our calling `about()` in the timeout handler\n // or the user calling it directly even though they shouldn't),\n // be careful about accessing it.\n var status;\n try {\n status = xhr.status;\n } catch (err) {}\n var err = status === 0 ? new Error('Internal XHR Error') : null;\n return done(err);\n }\n };\n\n // IE sometimes fails if you don't specify every handler.\n // See http://social.msdn.microsoft.com/Forums/ie/en-US/30ef3add-767c-4436-b8a9-f1ca19b4812e/ie9-rtm-xdomainrequest-issued-requests-may-abort-if-all-event-handlers-not-specified?forum=iewebdevelopment\n xhr.ontimeout = function() { /* noop */ };\n xhr.onprogress = function() { /* noop */ };\n\n xhr.open(req.method, req.url);\n\n if (req.timeout) {\n // If we use the normal XHR timeout mechanism (`xhr.timeout` and\n // `xhr.ontimeout`), `onreadystatechange` will be triggered before\n // `ontimeout`. There's no way to recognize that it was triggered by\n // a timeout, and we'd be unable to dispatch the right error.\n timeoutId = setTimeout(function() {\n req.timedOut = true;\n done();\n try {\n xhr.abort();\n } catch (err) {}\n }, req.timeout);\n }\n\n for (k in req.headers) {\n if (req.headers.hasOwnProperty(k)) {\n xhr.setRequestHeader(k, req.headers[k]);\n }\n }\n\n xhr.send(req.body);\n\n return req;\n }\n\n var method,\n methods = ['get', 'post', 'put', 'head', 'patch', 'delete'],\n verb = function(method) {\n return function(req, cb) {\n req = new Request(req);\n req.method = method;\n return http(req, cb);\n };\n };\n for (i = 0; i < methods.length; i++) {\n method = methods[i];\n http[method] = verb(method);\n }\n\n http.plugins = function() {\n return plugins;\n };\n\n http.defaults = function(newValues) {\n if (newValues) {\n return factory(extend(defaults, newValues), plugins);\n }\n return defaults;\n };\n\n http.use = function() {\n var newPlugins = Array.prototype.slice.call(arguments, 0);\n return factory(defaults, plugins.concat(newPlugins));\n };\n\n http.bare = function() {\n return factory();\n };\n\n http.Request = Request;\n http.Response = Response;\n http.RequestError = RequestError;\n\n return http;\n}\n\nmodule.exports = factory({}, [cleanURL]);\n\n/**\n * Analyze the request to see if it represents an error. If so, return it! An\n * original error object can be passed as a hint.\n */\nfunction getError(req, err) {\n if (req.aborted) return createError('Request aborted', req, {name: 'Abort'});\n\n if (req.timedOut) return createError('Request timeout', req, {name: 'Timeout'});\n\n var xhr = req.xhr;\n var type = Math.floor(xhr.status / 100);\n\n var kind;\n switch (type) {\n case 0:\n case 2:\n // These don't represent errors unless the function was passed an\n // error object explicitly.\n if (!err) return;\n return createError(err.message, req);\n case 4:\n // Sometimes 4XX statuses aren't errors.\n if (xhr.status === 404 && !req.errorOn404) return;\n kind = 'Client';\n break;\n case 5:\n kind = 'Server';\n break;\n default:\n kind = 'HTTP';\n }\n var msg = kind + ' Error: ' +\n 'The server returned a status of ' + xhr.status +\n ' for the request \"' +\n req.method.toUpperCase() + ' ' + req.url + '\"';\n return createError(msg, req);\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport json from 'httpplease/plugins/json';\nimport httpplease from 'httpplease';\n\nconst request = httpplease.use(json);\n\nfunction send(method, url, args) {\n return new Promise((resolve, reject) => {\n request({ method, url, body: args }, (err, res) => {\n if (err) {\n const error = (err && err.body && err.body.meta && err.body.meta.errorMessage)\n ? new Error(err.body.meta.errorMessage)\n : err;\n error.status = err.status;\n reject(error);\n } else {\n resolve(res);\n }\n });\n });\n}\n\nexport function get(url) {\n return send('GET', url);\n}\n\nexport function post(url, args) {\n return send('POST', url, args);\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport segmentify from './segmentify';\nimport makeQueryString from './makeQueryString';\nimport promiseWhile from './promiseWhile';\nimport { get } from './request';\n\nconst DEFAULT_BATCH_SIZE = 20;\n\nexport default function findSegments(agent, opts = {}) {\n const options = Object.assign({}, opts);\n if (opts.limit === -1) {\n options.limit = options.batchSize || DEFAULT_BATCH_SIZE;\n delete options.batchSize;\n options.offset = 0;\n const segments = [];\n\n return promiseWhile(\n () => segments.length === options.limit,\n () => findSegments(agent, options)\n .then(newSegments => {\n segments.push(...newSegments);\n options.offset += options.limit;\n })\n ).then(() => segments);\n }\n\n return get(`${agent.url}/segments${makeQueryString(opts)}`)\n .then(res => res.body.map(obj => segmentify(agent, obj)));\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport findSegments from './findSegments';\nimport deprecated from './deprecated';\n\nexport default function getBranches(agent, prevLinkHash, tags = []) {\n deprecated(\n 'Agent#getBranches(agent, prevLinkHash, tags = [])',\n 'Agent#findSegments(agent, filter)'\n );\n\n return findSegments(agent, { prevLinkHash, tags });\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport deprecated from './deprecated';\nimport getBranches from './getBranches';\nimport { post } from './request';\n\nexport default function segmentify(agent, obj) {\n Object\n .keys(agent.agentInfo.actions)\n .filter(key => ['init'].indexOf(key) < 0)\n .forEach(key => {\n /*eslint-disable*/\n obj[key] = (...args) =>\n post(`${agent.url}/segments/${obj.meta.linkHash}/${key}`, args)\n .then(res => segmentify(agent, res.body))\n });\n\n /*eslint-disable*/\n obj.getPrev = () => {\n /*eslint-enable*/\n if (obj.link.meta.prevLinkHash) {\n return agent.getSegment(obj.link.meta.prevLinkHash);\n }\n\n return Promise.resolve(null);\n };\n\n // Deprecated.\n /*eslint-disable*/\n obj.load = () => {\n /*eslint-enable*/\n deprecated('segment#load()');\n return Promise.resolve(segmentify(agent, {\n link: JSON.parse(JSON.stringify(obj.link)),\n meta: JSON.parse(JSON.stringify(obj.meta))\n }));\n };\n\n // Deprecated.\n /*eslint-disable*/\n obj.getBranches = (...args) => {\n /*eslint-enable*/\n return getBranches(agent, obj.meta.linkHash, ...args);\n };\n\n return obj;\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport segmentify from './segmentify';\nimport { post } from './request';\n\nexport default function createMap(agent, ...args) {\n return post(`${agent.url}/segments`, args)\n .then(res => segmentify(agent, res.body));\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport segmentify from './segmentify';\nimport { get } from './request';\n\nexport default function getSegment(agent, linkHash) {\n return get(`${agent.url}/segments/${linkHash}`)\n .then(res => segmentify(agent, res.body));\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport makeQueryString from './makeQueryString';\nimport { get } from './request';\n\nexport default function getMapIds(agent, opts = {}) {\n return get(`${agent.url}/maps${makeQueryString(opts)}`)\n .then(res => res.body);\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport getSegment from './getSegment';\nimport deprecated from './deprecated';\n\nexport default function getLink(agent, hash) {\n deprecated('Agent#getLink(agent, hash)', 'Agent#getSegment(agent, hash)');\n\n return getSegment(agent, hash);\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport findSegments from './findSegments';\nimport deprecated from './deprecated';\n\nexport default function getMap(agent, mapId, tags = []) {\n deprecated('getMap(agent, mapId, tags = [])', 'findSegments(agent, filter)');\n\n return findSegments(agent, { mapId, tags });\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport createMap from './createMap';\nimport getSegment from './getSegment';\nimport findSegments from './findSegments';\nimport getMapIds from './getMapIds';\nimport { get } from './request';\n\n// Deprecated.\nimport getBranches from './getBranches';\nimport getLink from './getLink';\nimport getMap from './getMap';\n\nexport default function getAgent(url) {\n return get(url)\n .then(res => {\n const agent = res.body;\n\n agent.url = url;\n agent.createMap = createMap.bind(null, agent);\n agent.getSegment = getSegment.bind(null, agent);\n agent.findSegments = findSegments.bind(null, agent);\n agent.getMapIds = getMapIds.bind(null, agent);\n\n // Deprecated.\n agent.getBranches = getBranches.bind(null, agent);\n agent.getLink = getLink.bind(null, agent);\n agent.getMap = getMap.bind(null, agent);\n\n return agent;\n });\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport getAgent from './getAgent';\nimport segmentify from './segmentify';\n\nexport default function fromSegment(obj) {\n return getAgent(obj.meta.agentUrl || obj.meta.applicationLocation)\n .then(agent => {\n const segment = segmentify(agent, obj);\n return { agent, segment };\n });\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\n// Deprecated.\nexport default {\n applicationUrl: 'https://%s.stratumn.rocks'\n};\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport getAgent from './getAgent';\nimport deprecated from './deprecated';\nimport config from './config';\n\nexport default function getApplication(name, url) {\n deprecated('getApplication(name, url)', 'getAgent(url)');\n\n return getAgent(url || config.applicationUrl.replace('%s', name));\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport fromSegment from './fromSegment';\nimport deprecated from './deprecated';\n\nexport default function loadLink(obj) {\n deprecated('loadLink(obj)', 'fromSegment(obj)');\n\n return fromSegment(obj)\n .then(({ segment }) => segment);\n}\n"],"names":["deprecated","oldFunc","newFunc","warn","makeQueryString","obj","parts","Object","keys","reduce","curr","key","val","Array","isArray","join","push","encodeURIComponent","length","commonjsHelpers.commonjsGlobal","this","promiseWhile","condition","body","Promise","resolve","reject","loop","then","catch","commonjsHelpers.interopDefault","request","httpplease","use","json","send","method","url","args","err","res","error","meta","errorMessage","Error","status","get","post","DEFAULT_BATCH_SIZE","findSegments","agent","opts","options","assign","limit","batchSize","offset","segments","newSegments","map","segmentify","getBranches","prevLinkHash","tags","agentInfo","actions","filter","indexOf","forEach","linkHash","getPrev","link","getSegment","load","JSON","parse","stringify","createMap","getMapIds","getLink","hash","getMap","mapId","getAgent","bind","fromSegment","agentUrl","applicationLocation","segment","getApplication","name","config","applicationUrl","replace","loadLink"],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;AAgBA,AAAe,SAASA,UAAT,CAAoBC,OAApB,EAA6BC,OAA7B,EAAsC;MAC/C,CAACA,OAAL,EAAc;YACJC,IAAR,eAAyBF,OAAzB;GADF,MAEO;YACGE,IAAR,eAAyBF,OAAzB,mCAA8DC,OAA9D;;;;ACpBJ;;;;;;;;;;;;;;;;;;;;;AAqBA,AAAe,SAASE,eAAT,CAAyBC,GAAzB,EAA8B;MACrCC,QAAQC,OAAOC,IAAP,CAAYH,GAAZ,EAAiBI,MAAjB,CAAwB,UAACC,IAAD,EAAOC,GAAP,EAAe;QAC7CC,MAAMC,MAAMC,OAAN,CAAcT,IAAIM,GAAJ,CAAd,IAA0BN,IAAIM,GAAJ,EAASI,IAAT,CAAc,GAAd,CAA1B,GAA+CV,IAAIM,GAAJ,CAA3D;SACKK,IAAL,CAAaC,mBAAmBN,GAAnB,CAAb,SAAwCM,mBAAmBL,GAAnB,CAAxC;WACOF,IAAP;GAHY,EAIX,EAJW,CAAd;;MAMIJ,MAAMY,MAAV,EAAkB;iBACLZ,MAAMS,IAAN,CAAW,GAAX,CAAX;;;SAGK,EAAP;;;;;;;;;;;;;;AChCF,CAAC,UAAU,MAAM,EAAE,SAAS,EAAE;IAC1B,YAAY,CAAC;;IAEb,IAAI,MAAM,CAAC,YAAY,EAAE;QACrB,OAAO;KACV;;IAED,IAAI,UAAU,GAAG,C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CAAiB,IAAjB,EAAuBlC,KAAvB,CAApB;UACM6B,OAAN,GAAgBA,QAAQK,IAAR,CAAa,IAAb,EAAmBlC,KAAnB,CAAhB;UACM+B,MAAN,GAAeA,OAAOG,IAAP,CAAY,IAAZ,EAAkBlC,KAAlB,CAAf;;WAEOA,KAAP;GAfG,CAAP;;;AC5BF;;;;;;;;;;;;;;;;AAgBA,AACA,AAEA,AAAe,SAASmC,WAAT,CAAqBhF,GAArB,EAA0B;SAChC8E,SAAS9E,IAAIqC,IAAJ,CAAS4C,QAAT,IAAqBjF,IAAIqC,IAAJ,CAAS6C,mBAAvC,EACJ3D,IADI,CACC,iBAAS;QACP4D,UAAU5B,WAAWV,KAAX,EAAkB7C,GAAlB,CAAhB;WACO,EAAE6C,YAAF,EAASsC,gBAAT,EAAP;GAHG,CAAP;;;ACpBF;;;;;;;;;;;;;;;;;AAiBA,aAAe;kBACG;CADlB;;ACjBA;;;;;;;;;;;;;;;;AAgBA,AACA,AACA,AAEA,AAAe,SAASC,cAAT,CAAwBC,IAAxB,EAA8BrD,GAA9B,EAAmC;aACrC,2BAAX,EAAwC,eAAxC;;SAEO8C,SAAS9C,OAAOsD,OAAOC,cAAP,CAAsBC,OAAtB,CAA8B,IAA9B,EAAoCH,IAApC,CAAhB,CAAP;;;ACvBF;;;;;;;;;;;;;;;;AAgBA,AACA,AAEA,AAAe,SAASI,QAAT,CAAkBzF,GAAlB,EAAuB;aACzB,eAAX,EAA4B,kBAA5B;;SAEOgF,YAAYhF,GAAZ,EACJuB,IADI,CACC;QAAG4D,OAAH,QAAGA,OAAH;WAAiBA,OAAjB;GADD,CAAP;;;;;;;;;;;"}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.StratumnAgentClient=e.StratumnAgentClient||{})}(this,function(e){"use strict";function t(e,t){t?console.warn("WARNING: "+e+" is deprecated. Please use "+t+" instead."):console.warn("WARNING: "+e+" is deprecated.")}function n(e){var t=Object.keys(e).reduce(function(t,n){var r=Array.isArray(e[n])?e[n].join("+"):e[n];return t.push(encodeURIComponent(n)+"="+encodeURIComponent(r)),t},[]);return t.length?"?"+t.join("&"):""}function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}function o(e,t){return t={exports:{}},e(t,t.exports),t.exports}function s(e,t){return new Promise(function(n,r){function o(){t().then(function(){e()?o():n()}).catch(r)}setImmediate(o)})}function a(e,t,n){return new Promise(function(r,o){fe({method:e,url:t,body:n},function(e,t){if(e){var n=e&&e.body&&e.body.meta&&e.body.meta.errorMessage?new Error(e.body.meta.errorMessage):e;n.status=e.status,o(n)}else r(t)})})}function i(e){return a("GET",e)}function u(e,t){return a("POST",e,t)}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object.assign({},t);if(t.limit===-1){r.limit=r.batchSize||pe,delete r.batchSize,r.offset=0;var o=[];return s(function(){return o.length===r.limit},function(){return c(e,r).then(function(e){o.push.apply(o,le(e)),r.offset+=r.limit})}).then(function(){return o})}return i(e.url+"/segments"+n(t)).then(function(t){return t.body.map(function(t){return l(e,t)})})}function f(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t("Agent#getBranches(agent, prevLinkHash, tags = [])","Agent#findSegments(agent, filter)"),c(e,{prevLinkHash:n,tags:r})}function l(e,n){return Object.keys(e.agentInfo.actions).filter(function(e){return["init"].indexOf(e)<0}).forEach(function(t){n[t]=function(){for(var r=arguments.length,o=Array(r),s=0;s<r;s++)o[s]=arguments[s];return u(e.url+"/segments/"+n.meta.linkHash+"/"+t,o).then(function(t){return l(e,t.body)})}}),n.getPrev=function(){return n.link.meta.prevLinkHash?e.getSegment(n.link.meta.prevLinkHash):Promise.resolve(null)},n.load=function(){return t("segment#load()"),Promise.resolve(l(e,{link:JSON.parse(JSON.stringify(n.link)),meta:JSON.parse(JSON.stringify(n.meta))}))},n.getBranches=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return f.apply(void 0,[e,n.meta.linkHash].concat(r))},n}function p(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return u(e.url+"/segments",n).then(function(t){return l(e,t.body)})}function d(e,t){return i(e.url+"/segments/"+t).then(function(t){return l(e,t.body)})}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(e.url+"/maps"+n(t)).then(function(e){return e.body})}function g(e,n){return t("Agent#getLink(agent, hash)","Agent#getSegment(agent, hash)"),d(e,n)}function m(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t("getMap(agent, mapId, tags = [])","findSegments(agent, filter)"),c(e,{mapId:n,tags:r})}function y(e){return i(e).then(function(t){var n=t.body;return n.url=e,n.createMap=p.bind(null,n),n.getSegment=d.bind(null,n),n.findSegments=c.bind(null,n),n.getMapIds=h.bind(null,n),n.getBranches=f.bind(null,n),n.getLink=g.bind(null,n),n.getMap=m.bind(null,n),n})}function v(e){return y(e.meta.agentUrl||e.meta.applicationLocation).then(function(t){var n=l(t,e);return{agent:t,segment:n}})}function b(e,n){return t("getApplication(name, url)","getAgent(url)"),y(n||de.applicationUrl.replace("%s",e))}function R(e){return t("loadLink(obj)","fromSegment(obj)"),v(e).then(function(e){var t=e.segment;return t})}var x="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},w=o(function(e){!function(e,t){function n(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var r={callback:e,args:t};return h[d]=r,p(d),d++}function r(e){delete h[e]}function o(e){var n=e.callback,r=e.args;switch(r.length){case 0:n();break;case 1:n(r[0]);break;case 2:n(r[0],r[1]);break;case 3:n(r[0],r[1],r[2]);break;default:n.apply(t,r)}}function s(e){if(g)setTimeout(s,0,e);else{var t=h[e];if(t){g=!0;try{o(t)}finally{r(e),g=!1}}}}function a(){p=function(e){process.nextTick(function(){s(e)})}}function i(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}function u(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&s(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),p=function(n){e.postMessage(t+n,"*")}}function c(){var e=new MessageChannel;e.port1.onmessage=function(e){var t=e.data;s(t)},p=function(t){e.port2.postMessage(t)}}function f(){var e=m.documentElement;p=function(t){var n=m.createElement("script");n.onreadystatechange=function(){s(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}function l(){p=function(e){setTimeout(s,0,e)}}if(!e.setImmediate){var p,d=1,h={},g=!1,m=e.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(e);y=y&&y.setTimeout?y:e,"[object process]"==={}.toString.call(e.process)?a():i()?u():e.MessageChannel?c():m&&"onreadystatechange"in m.createElement("script")?f():l(),y.setImmediate=n,y.clearImmediate=r}}("undefined"==typeof self?"undefined"==typeof x?x:x:self)});r(w);var k=o(function(e){e.exports={processRequest:function(e){var t=e.header("Content-Type"),n=t&&t.indexOf("application/json")!==-1;(null==t||n)&&e.body&&(t||e.header("Content-Type","application/json"),e.body=JSON.stringify(e.body))}}}),O=r(k),j=k.processRequest,A=Object.freeze({default:O,processRequest:j}),q=o(function(e){e.exports={processRequest:function(e){var t=e.header("Accept");null==t&&e.header("Accept","application/json")},processResponse:function(e){if(e.contentType&&/^.*\/(?:.*\+)?json(;|$)/i.test(e.contentType)){var t="string"==typeof e.body?e.body:e.text;t&&(e.body=JSON.parse(t))}}}}),S=r(q),T=q.processRequest,E=q.processResponse,H=Object.freeze({default:S,processRequest:T,processResponse:E}),I=o(function(e){var t=r(A),n=r(H);e.exports={processRequest:function(e){t.processRequest.call(this,e),n.processRequest.call(this,e)},processResponse:function(e){n.processResponse.call(this,e)}}}),P=r(I),C=o(function(e){e.exports={processRequest:function(e){e.url=e.url.replace(/[^%]+/g,function(e){return encodeURI(e)})}}}),M=r(C),L=C.processRequest,z=Object.freeze({default:M,processRequest:L}),N=o(function(e){e.exports=window.XMLHttpRequest}),U=r(N),J=Object.freeze({default:U}),_=o(function(e){e.exports=function(e){return function(){var t=Array.prototype.slice.call(arguments,0),n=function(){return e.apply(null,t)};setTimeout(n,0)}}}),G=r(_),X=Object.freeze({default:G}),B=o(function(e){function t(e){var t="string"==typeof e?{url:e}:e||{};this.method=t.method?t.method.toUpperCase():"GET",this.url=t.url,this.headers=t.headers||{},this.body=t.body,this.timeout=t.timeout||0,this.errorOn404=null==t.errorOn404||t.errorOn404,this.onload=t.onload,this.onerror=t.onerror}t.prototype.abort=function(){if(!this.aborted)return this.aborted=!0,this.xhr.abort(),this},t.prototype.header=function(e,t){var n;for(n in this.headers)if(this.headers.hasOwnProperty(n)&&e.toLowerCase()===n.toLowerCase()){if(1===arguments.length)return this.headers[n];delete this.headers[n];break}if(null!=t)return this.headers[e]=t,t},e.exports=t}),$=r(B),W=Object.freeze({default:$}),F=o(function(e){function t(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}e.exports=t}),D=r(F),K=Object.freeze({default:D}),Q=o(function(e){var t=r(K);e.exports=function(e){var n=e.xhr,r={request:e,xhr:n};try{var o,s,a,i={};if(n.getAllResponseHeaders)for(o=n.getAllResponseHeaders().split("\n"),s=0;s<o.length;s++)(a=o[s].match(/\s*([^\s]+):\s+([^\s]+)/))&&(i[a[1]]=a[2]);r=t(r,{status:n.status,contentType:n.contentType||n.getResponseHeader&&n.getResponseHeader("Content-Type"),headers:i,text:n.responseText,body:n.response||n.responseText})}catch(e){}return r}}),V=r(Q),Y=Object.freeze({default:V}),Z=o(function(e){function t(e){this.request=e.request,this.xhr=e.xhr,this.headers=e.headers||{},this.status=e.status||0,this.text=e.text,this.body=e.body,this.contentType=e.contentType,this.isHttpError=e.status>=400}var n=r(W),o=r(Y);t.prototype.header=n.prototype.header,t.fromRequest=function(e){return new t(o(e))},e.exports=t}),ee=r(Z),te=Object.freeze({default:ee}),ne=o(function(e){function t(e,t){var n=new Error(e);n.name="RequestError",this.name=n.name,this.message=n.message,n.stack&&(this.stack=n.stack),this.toString=function(){return this.message};for(var r in t)t.hasOwnProperty(r)&&(this[r]=t[r])}var n=r(te),o=r(Y),s=r(K);t.prototype=s(Error.prototype),t.prototype.constructor=t,t.create=function(e,r,s){var a=new t(e,s);return n.call(a,o(r)),a},e.exports=t}),re=r(ne),oe=Object.freeze({default:re}),se=o(function(e){e.exports=function(e){var t,n=!1;return function(){return n||(n=!0,t=e.apply(this,arguments)),t}}}),ae=r(se),ie=Object.freeze({default:ae}),ue=o(function(e){function t(e,r){function s(t,s){var u,d,h,g,m,y;for(t=new f(l(e,t)),o=0;o<r.length;o++)d=r[o],d.processRequest&&d.processRequest(t);for(o=0;o<r.length;o++)if(d=r[o],d.createXHR){u=d.createXHR(t);break}u=u||new a,t.xhr=u,h=p(i(function(e){clearTimeout(m),u.onload=u.onerror=u.onabort=u.onreadystatechange=u.ontimeout=u.onprogress=null;var a=n(t,e),i=a||c.fromRequest(t);for(o=0;o<r.length;o++)d=r[o],d.processResponse&&d.processResponse(i);a&&t.onerror&&t.onerror(a),!a&&t.onload&&t.onload(i),s&&s(a,a?void 0:i)})),y="onload"in u&&"onerror"in u,u.onload=function(){h()},u.onerror=h,u.onabort=function(){h()},u.onreadystatechange=function(){if(4===u.readyState){if(t.aborted)return h();if(!y){var e;try{e=u.status}catch(e){}var n=0===e?new Error("Internal XHR Error"):null;return h(n)}}},u.ontimeout=function(){},u.onprogress=function(){},u.open(t.method,t.url),t.timeout&&(m=setTimeout(function(){t.timedOut=!0,h();try{u.abort()}catch(e){}},t.timeout));for(g in t.headers)t.headers.hasOwnProperty(g)&&u.setRequestHeader(g,t.headers[g]);return u.send(t.body),t}e=e||{},r=r||[];var d,h=["get","post","put","head","patch","delete"],g=function(e){return function(t,n){return t=new f(t),t.method=e,s(t,n)}};for(o=0;o<h.length;o++)d=h[o],s[d]=g(d);return s.plugins=function(){return r},s.defaults=function(n){return n?t(l(e,n),r):e},s.use=function(){var n=Array.prototype.slice.call(arguments,0);return t(e,r.concat(n))},s.bare=function(){return t()},s.Request=f,s.Response=c,s.RequestError=u,s}function n(e,t){if(e.aborted)return d("Request aborted",e,{name:"Abort"});if(e.timedOut)return d("Request timeout",e,{name:"Timeout"});var n,r=e.xhr,o=Math.floor(r.status/100);switch(o){case 0:case 2:if(!t)return;return d(t.message,e);case 4:if(404===r.status&&!e.errorOn404)return;n="Client";break;case 5:n="Server";break;default:n="HTTP"}var s=n+" Error: The server returned a status of "+r.status+' for the request "'+e.method.toUpperCase()+" "+e.url+'"';return d(s,e)}var o,s=r(z),a=r(J),i=r(X),u=r(oe),c=r(te),f=r(W),l=r(K),p=r(ie),d=u.create;e.exports=t({},[s])}),ce=r(ue),fe=ce.use(P),le=(function(){function e(e){this.value=e}function t(t){function n(e,t){return new Promise(function(n,o){var i={key:e,arg:t,resolve:n,reject:o,next:null};a?a=a.next=i:(s=a=i,r(e,t))})}function r(n,s){try{var a=t[n](s),i=a.value;i instanceof e?Promise.resolve(i.value).then(function(e){r("next",e)},function(e){r("throw",e)}):o(a.done?"return":"normal",a.value)}catch(e){o("throw",e)}}function o(e,t){switch(e){case"return":s.resolve({value:t,done:!0});break;case"throw":s.reject(t);break;default:s.resolve({value:t,done:!1})}s=s.next,s?r(s.key,s.arg):a=null}var s,a;this._invoke=n,"function"!=typeof t.return&&(this.return=void 0)}return"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)},{wrap:function(e){return function(){return new t(e.apply(this,arguments))}},await:function(t){return new e(t)}}}(),function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}),pe=20,de={applicationUrl:"https://%s.stratumn.rocks"};e.getAgent=y,e.fromSegment=v,e.getApplication=b,e.loadLink=R,e.config=de,Object.defineProperty(e,"__esModule",{value:!0})});
|
2
|
+
//# sourceMappingURL=stratumn-agent-client.min.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":null,"sources":["../src/deprecated.js","../src/makeQueryString.js","../src/promiseWhile.js","../src/request.js","../src/findSegments.js","../src/getBranches.js","../src/segmentify.js","../src/createMap.js","../src/getSegment.js","../src/getMapIds.js","../src/getLink.js","../src/getMap.js","../src/getAgent.js","../src/fromSegment.js","../src/getApplication.js","../src/loadLink.js","../node_modules/setimmediate/setImmediate.js","../node_modules/httpplease/plugins/jsonrequest.js","../node_modules/httpplease/plugins/jsonresponse.js","../node_modules/httpplease/plugins/json.js","../node_modules/httpplease/plugins/cleanurl.js","../node_modules/httpplease/lib/xhr-browser.js","../node_modules/httpplease/lib/utils/delay.js","../node_modules/httpplease/lib/request.js","../node_modules/xtend/index.js","../node_modules/httpplease/lib/utils/extractResponseProps.js","../node_modules/httpplease/lib/response.js","../node_modules/httpplease/lib/error.js","../node_modules/httpplease/lib/utils/once.js","../node_modules/httpplease/lib/index.js","../src/config.js"],"sourcesContent":["/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nexport default function deprecated(oldFunc, newFunc) {\n if (!newFunc) {\n console.warn(`WARNING: ${oldFunc} is deprecated.`);\n } else {\n console.warn(`WARNING: ${oldFunc} is deprecated. Please use ${newFunc} instead.`);\n }\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\n/**\n * Makes a query string.\n * @param {object} obj - an object of keys\n * @returns {string} a query string\n */\nexport default function makeQueryString(obj) {\n const parts = Object.keys(obj).reduce((curr, key) => {\n const val = Array.isArray(obj[key]) ? obj[key].join('+') : obj[key];\n curr.push(`${encodeURIComponent(key)}=${encodeURIComponent(val)}`);\n return curr;\n }, []);\n\n if (parts.length) {\n return `?${parts.join('&')}`;\n }\n\n return '';\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport 'setimmediate';\n\n/**\n * Calls a function that returns a Promise until a condition is reached\n * @param {function} condition - while condition is true body will keep being called\n * @param {function} body - a function that is repeatedly called while condition is true\n * @returns {Promise} a Promise that resolves when the condition is no longer true\n */\nexport default function promiseWhile(condition, body) {\n return new Promise((resolve, reject) => {\n function loop() {\n body()\n .then(() => {\n // When the result of calling `condition` is no longer true, we are\n // done.\n if (!condition()) {\n resolve();\n } else {\n loop();\n }\n })\n .catch(reject);\n }\n\n // Start running the loop in the next tick so that this function is\n // completely async. It would be unexpected if `body` was called\n // synchronously the first time.\n setImmediate(loop);\n });\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport json from 'httpplease/plugins/json';\nimport httpplease from 'httpplease';\n\nconst request = httpplease.use(json);\n\nfunction send(method, url, args) {\n return new Promise((resolve, reject) => {\n request({ method, url, body: args }, (err, res) => {\n if (err) {\n const error = (err && err.body && err.body.meta && err.body.meta.errorMessage)\n ? new Error(err.body.meta.errorMessage)\n : err;\n error.status = err.status;\n reject(error);\n } else {\n resolve(res);\n }\n });\n });\n}\n\nexport function get(url) {\n return send('GET', url);\n}\n\nexport function post(url, args) {\n return send('POST', url, args);\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport segmentify from './segmentify';\nimport makeQueryString from './makeQueryString';\nimport promiseWhile from './promiseWhile';\nimport { get } from './request';\n\nconst DEFAULT_BATCH_SIZE = 20;\n\nexport default function findSegments(agent, opts = {}) {\n const options = Object.assign({}, opts);\n if (opts.limit === -1) {\n options.limit = options.batchSize || DEFAULT_BATCH_SIZE;\n delete options.batchSize;\n options.offset = 0;\n const segments = [];\n\n return promiseWhile(\n () => segments.length === options.limit,\n () => findSegments(agent, options)\n .then(newSegments => {\n segments.push(...newSegments);\n options.offset += options.limit;\n })\n ).then(() => segments);\n }\n\n return get(`${agent.url}/segments${makeQueryString(opts)}`)\n .then(res => res.body.map(obj => segmentify(agent, obj)));\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport findSegments from './findSegments';\nimport deprecated from './deprecated';\n\nexport default function getBranches(agent, prevLinkHash, tags = []) {\n deprecated(\n 'Agent#getBranches(agent, prevLinkHash, tags = [])',\n 'Agent#findSegments(agent, filter)'\n );\n\n return findSegments(agent, { prevLinkHash, tags });\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport deprecated from './deprecated';\nimport getBranches from './getBranches';\nimport { post } from './request';\n\nexport default function segmentify(agent, obj) {\n Object\n .keys(agent.agentInfo.actions)\n .filter(key => ['init'].indexOf(key) < 0)\n .forEach(key => {\n /*eslint-disable*/\n obj[key] = (...args) =>\n post(`${agent.url}/segments/${obj.meta.linkHash}/${key}`, args)\n .then(res => segmentify(agent, res.body))\n });\n\n /*eslint-disable*/\n obj.getPrev = () => {\n /*eslint-enable*/\n if (obj.link.meta.prevLinkHash) {\n return agent.getSegment(obj.link.meta.prevLinkHash);\n }\n\n return Promise.resolve(null);\n };\n\n // Deprecated.\n /*eslint-disable*/\n obj.load = () => {\n /*eslint-enable*/\n deprecated('segment#load()');\n return Promise.resolve(segmentify(agent, {\n link: JSON.parse(JSON.stringify(obj.link)),\n meta: JSON.parse(JSON.stringify(obj.meta))\n }));\n };\n\n // Deprecated.\n /*eslint-disable*/\n obj.getBranches = (...args) => {\n /*eslint-enable*/\n return getBranches(agent, obj.meta.linkHash, ...args);\n };\n\n return obj;\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport segmentify from './segmentify';\nimport { post } from './request';\n\nexport default function createMap(agent, ...args) {\n return post(`${agent.url}/segments`, args)\n .then(res => segmentify(agent, res.body));\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport segmentify from './segmentify';\nimport { get } from './request';\n\nexport default function getSegment(agent, linkHash) {\n return get(`${agent.url}/segments/${linkHash}`)\n .then(res => segmentify(agent, res.body));\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport makeQueryString from './makeQueryString';\nimport { get } from './request';\n\nexport default function getMapIds(agent, opts = {}) {\n return get(`${agent.url}/maps${makeQueryString(opts)}`)\n .then(res => res.body);\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport getSegment from './getSegment';\nimport deprecated from './deprecated';\n\nexport default function getLink(agent, hash) {\n deprecated('Agent#getLink(agent, hash)', 'Agent#getSegment(agent, hash)');\n\n return getSegment(agent, hash);\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport findSegments from './findSegments';\nimport deprecated from './deprecated';\n\nexport default function getMap(agent, mapId, tags = []) {\n deprecated('getMap(agent, mapId, tags = [])', 'findSegments(agent, filter)');\n\n return findSegments(agent, { mapId, tags });\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport createMap from './createMap';\nimport getSegment from './getSegment';\nimport findSegments from './findSegments';\nimport getMapIds from './getMapIds';\nimport { get } from './request';\n\n// Deprecated.\nimport getBranches from './getBranches';\nimport getLink from './getLink';\nimport getMap from './getMap';\n\nexport default function getAgent(url) {\n return get(url)\n .then(res => {\n const agent = res.body;\n\n agent.url = url;\n agent.createMap = createMap.bind(null, agent);\n agent.getSegment = getSegment.bind(null, agent);\n agent.findSegments = findSegments.bind(null, agent);\n agent.getMapIds = getMapIds.bind(null, agent);\n\n // Deprecated.\n agent.getBranches = getBranches.bind(null, agent);\n agent.getLink = getLink.bind(null, agent);\n agent.getMap = getMap.bind(null, agent);\n\n return agent;\n });\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport getAgent from './getAgent';\nimport segmentify from './segmentify';\n\nexport default function fromSegment(obj) {\n return getAgent(obj.meta.agentUrl || obj.meta.applicationLocation)\n .then(agent => {\n const segment = segmentify(agent, obj);\n return { agent, segment };\n });\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport getAgent from './getAgent';\nimport deprecated from './deprecated';\nimport config from './config';\n\nexport default function getApplication(name, url) {\n deprecated('getApplication(name, url)', 'getAgent(url)');\n\n return getAgent(url || config.applicationUrl.replace('%s', name));\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nimport fromSegment from './fromSegment';\nimport deprecated from './deprecated';\n\nexport default function loadLink(obj) {\n deprecated('loadLink(obj)', 'fromSegment(obj)');\n\n return fromSegment(obj)\n .then(({ segment }) => segment);\n}\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var script = doc.createElement(\"script\");\n script.onreadystatechange = function () {\n runIfPresent(handle);\n script.onreadystatechange = null;\n html.removeChild(script);\n script = null;\n };\n html.appendChild(script);\n };\n }\n\n function installSetTimeoutImplementation() {\n registerImmediate = function(handle) {\n setTimeout(runIfPresent, 0, handle);\n };\n }\n\n // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.\n var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);\n attachTo = attachTo && attachTo.setTimeout ? attachTo : global;\n\n // Don't get fooled by e.g. browserify environments.\n if ({}.toString.call(global.process) === \"[object process]\") {\n // For Node.js before 0.9\n installNextTickImplementation();\n\n } else if (canUsePostMessage()) {\n // For non-IE10 modern browsers\n installPostMessageImplementation();\n\n } else if (global.MessageChannel) {\n // For web workers, where supported\n installMessageChannelImplementation();\n\n } else if (doc && \"onreadystatechange\" in doc.createElement(\"script\")) {\n // For IE 6–8\n installReadyStateChangeImplementation();\n\n } else {\n // For older browsers\n installSetTimeoutImplementation();\n }\n\n attachTo.setImmediate = setImmediate;\n attachTo.clearImmediate = clearImmediate;\n}(typeof self === \"undefined\" ? typeof global === \"undefined\" ? this : global : self));\n","'use strict';\n\nmodule.exports = {\n processRequest: function(req) {\n var\n contentType = req.header('Content-Type'),\n hasJsonContentType = contentType &&\n contentType.indexOf('application/json') !== -1;\n\n if (contentType != null && !hasJsonContentType) {\n return;\n }\n\n if (req.body) {\n if (!contentType) {\n req.header('Content-Type', 'application/json');\n }\n\n req.body = JSON.stringify(req.body);\n }\n }\n};\n","'use strict';\n\nmodule.exports = {\n processRequest: function(req) {\n var accept = req.header('Accept');\n if (accept == null) {\n req.header('Accept', 'application/json');\n }\n },\n processResponse: function(res) {\n // Check to see if the contentype is \"something/json\" or\n // \"something/somethingelse+json\"\n if (res.contentType && /^.*\\/(?:.*\\+)?json(;|$)/i.test(res.contentType)) {\n var raw = typeof res.body === 'string' ? res.body : res.text;\n if (raw) {\n res.body = JSON.parse(raw);\n }\n }\n }\n};\n","'use strict';\n\nvar jsonrequest = require('./jsonrequest'),\n jsonresponse = require('./jsonresponse');\n\nmodule.exports = {\n processRequest: function(req) {\n jsonrequest.processRequest.call(this, req);\n jsonresponse.processRequest.call(this, req);\n },\n processResponse: function(res) {\n jsonresponse.processResponse.call(this, res);\n }\n};\n","'use strict';\n\nmodule.exports = {\n processRequest: function(req) {\n req.url = req.url.replace(/[^%]+/g, function(s) {\n return encodeURI(s);\n });\n }\n};\n","module.exports = window.XMLHttpRequest;\n","'use strict';\n\n// Wrap a function in a `setTimeout` call. This is used to guarantee async\n// behavior, which can avoid unexpected errors.\n\nmodule.exports = function(fn) {\n return function() {\n var\n args = Array.prototype.slice.call(arguments, 0),\n newFunc = function() {\n return fn.apply(null, args);\n };\n setTimeout(newFunc, 0);\n };\n};\n","'use strict';\n\nfunction Request(optsOrUrl) {\n var opts = typeof optsOrUrl === 'string' ? {url: optsOrUrl} : optsOrUrl || {};\n this.method = opts.method ? opts.method.toUpperCase() : 'GET';\n this.url = opts.url;\n this.headers = opts.headers || {};\n this.body = opts.body;\n this.timeout = opts.timeout || 0;\n this.errorOn404 = opts.errorOn404 != null ? opts.errorOn404 : true;\n this.onload = opts.onload;\n this.onerror = opts.onerror;\n}\n\nRequest.prototype.abort = function() {\n if (this.aborted) return;\n this.aborted = true;\n this.xhr.abort();\n return this;\n};\n\nRequest.prototype.header = function(name, value) {\n var k;\n for (k in this.headers) {\n if (this.headers.hasOwnProperty(k)) {\n if (name.toLowerCase() === k.toLowerCase()) {\n if (arguments.length === 1) {\n return this.headers[k];\n }\n\n delete this.headers[k];\n break;\n }\n }\n }\n if (value != null) {\n this.headers[name] = value;\n return value;\n }\n};\n\n\nmodule.exports = Request;\n","module.exports = extend\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n","'use strict';\n\nvar extend = require('xtend');\n\nmodule.exports = function(req) {\n var xhr = req.xhr;\n var props = {request: req, xhr: xhr};\n\n // Try to create the response from the request. If the request was aborted,\n // accesssing properties of the XHR may throw an error, so we wrap in a\n // try/catch.\n try {\n var lines, i, m, headers = {};\n if (xhr.getAllResponseHeaders) {\n lines = xhr.getAllResponseHeaders().split('\\n');\n for (i = 0; i < lines.length; i++) {\n if ((m = lines[i].match(/\\s*([^\\s]+):\\s+([^\\s]+)/))) {\n headers[m[1]] = m[2];\n }\n }\n }\n\n props = extend(props, {\n status: xhr.status,\n contentType: xhr.contentType || (xhr.getResponseHeader && xhr.getResponseHeader('Content-Type')),\n headers: headers,\n text: xhr.responseText,\n body: xhr.response || xhr.responseText\n });\n } catch (err) {}\n\n return props;\n};\n","'use strict';\n\nvar Request = require('./request');\nvar extractResponseProps = require('./utils/extractResponseProps');\n\nfunction Response(props) {\n this.request = props.request;\n this.xhr = props.xhr;\n this.headers = props.headers || {};\n this.status = props.status || 0;\n this.text = props.text;\n this.body = props.body;\n this.contentType = props.contentType;\n this.isHttpError = props.status >= 400;\n}\n\nResponse.prototype.header = Request.prototype.header;\n\nResponse.fromRequest = function(req) {\n return new Response(extractResponseProps(req));\n};\n\n\nmodule.exports = Response;\n","'use strict';\n\nvar Response = require('./response');\nvar extractResponseProps = require('./utils/extractResponseProps');\nvar extend = require('xtend');\n\nfunction RequestError(message, props) {\n var err = new Error(message);\n err.name = 'RequestError';\n this.name = err.name;\n this.message = err.message;\n if (err.stack) {\n this.stack = err.stack;\n }\n\n this.toString = function() {\n return this.message;\n };\n\n for (var k in props) {\n if (props.hasOwnProperty(k)) {\n this[k] = props[k];\n }\n }\n}\n\nRequestError.prototype = extend(Error.prototype);\nRequestError.prototype.constructor = RequestError;\n\nRequestError.create = function(message, req, props) {\n var err = new RequestError(message, props);\n Response.call(err, extractResponseProps(req));\n return err;\n};\n\nmodule.exports = RequestError;\n","'use strict';\n\n// A \"once\" utility.\nmodule.exports = function(fn) {\n var result, called = false;\n return function() {\n if (!called) {\n called = true;\n result = fn.apply(this, arguments);\n }\n return result;\n };\n};\n","'use strict';\n\nvar\n cleanURL = require('../plugins/cleanurl'),\n XHR = require('./xhr'),\n delay = require('./utils/delay'),\n RequestError = require('./error'),\n Response = require('./response'),\n Request = require('./request'),\n extend = require('xtend'),\n once = require('./utils/once');\n\nvar i,\n createError = RequestError.create;\n\nfunction factory(defaults, plugins) {\n defaults = defaults || {};\n plugins = plugins || [];\n\n function http(req, cb) {\n var xhr, plugin, done, k, timeoutId, supportsLoadAndErrorEvents;\n\n req = new Request(extend(defaults, req));\n\n for (i = 0; i < plugins.length; i++) {\n plugin = plugins[i];\n if (plugin.processRequest) {\n plugin.processRequest(req);\n }\n }\n\n // Give the plugins a chance to create the XHR object\n for (i = 0; i < plugins.length; i++) {\n plugin = plugins[i];\n if (plugin.createXHR) {\n xhr = plugin.createXHR(req);\n break; // First come, first serve\n }\n }\n xhr = xhr || new XHR();\n\n req.xhr = xhr;\n\n // Use a single completion callback. This can be called with or without\n // an error. If no error is passed, the request will be examined to see\n // if it was successful.\n done = once(delay(function(rawError) {\n clearTimeout(timeoutId);\n xhr.onload = xhr.onerror = xhr.onabort = xhr.onreadystatechange = xhr.ontimeout = xhr.onprogress = null;\n\n var err = getError(req, rawError);\n\n var res = err || Response.fromRequest(req);\n for (i = 0; i < plugins.length; i++) {\n plugin = plugins[i];\n if (plugin.processResponse) {\n plugin.processResponse(res);\n }\n }\n\n // Invoke callbacks\n if (err && req.onerror) req.onerror(err);\n if (!err && req.onload) req.onload(res);\n if (cb) cb(err, err ? undefined : res);\n\n }));\n\n supportsLoadAndErrorEvents = ('onload' in xhr) && ('onerror' in xhr);\n xhr.onload = function() { done(); };\n xhr.onerror = done;\n xhr.onabort = function() { done(); };\n\n // We'd rather use `onload`, `onerror`, and `onabort` since they're the\n // only way to reliably detect successes and failures but, if they\n // aren't available, we fall back to using `onreadystatechange`.\n xhr.onreadystatechange = function() {\n if (xhr.readyState !== 4) return;\n\n if (req.aborted) return done();\n\n if (!supportsLoadAndErrorEvents) {\n // Assume a status of 0 is an error. This could be a false\n // positive, but there's no way to tell when using\n // `onreadystatechange` ):\n // See matthewwithanm/react-inlinesvg#10.\n\n // Some browsers don't like you reading XHR properties when the\n // XHR has been aborted. In case we've gotten here as a result\n // of that (either our calling `about()` in the timeout handler\n // or the user calling it directly even though they shouldn't),\n // be careful about accessing it.\n var status;\n try {\n status = xhr.status;\n } catch (err) {}\n var err = status === 0 ? new Error('Internal XHR Error') : null;\n return done(err);\n }\n };\n\n // IE sometimes fails if you don't specify every handler.\n // See http://social.msdn.microsoft.com/Forums/ie/en-US/30ef3add-767c-4436-b8a9-f1ca19b4812e/ie9-rtm-xdomainrequest-issued-requests-may-abort-if-all-event-handlers-not-specified?forum=iewebdevelopment\n xhr.ontimeout = function() { /* noop */ };\n xhr.onprogress = function() { /* noop */ };\n\n xhr.open(req.method, req.url);\n\n if (req.timeout) {\n // If we use the normal XHR timeout mechanism (`xhr.timeout` and\n // `xhr.ontimeout`), `onreadystatechange` will be triggered before\n // `ontimeout`. There's no way to recognize that it was triggered by\n // a timeout, and we'd be unable to dispatch the right error.\n timeoutId = setTimeout(function() {\n req.timedOut = true;\n done();\n try {\n xhr.abort();\n } catch (err) {}\n }, req.timeout);\n }\n\n for (k in req.headers) {\n if (req.headers.hasOwnProperty(k)) {\n xhr.setRequestHeader(k, req.headers[k]);\n }\n }\n\n xhr.send(req.body);\n\n return req;\n }\n\n var method,\n methods = ['get', 'post', 'put', 'head', 'patch', 'delete'],\n verb = function(method) {\n return function(req, cb) {\n req = new Request(req);\n req.method = method;\n return http(req, cb);\n };\n };\n for (i = 0; i < methods.length; i++) {\n method = methods[i];\n http[method] = verb(method);\n }\n\n http.plugins = function() {\n return plugins;\n };\n\n http.defaults = function(newValues) {\n if (newValues) {\n return factory(extend(defaults, newValues), plugins);\n }\n return defaults;\n };\n\n http.use = function() {\n var newPlugins = Array.prototype.slice.call(arguments, 0);\n return factory(defaults, plugins.concat(newPlugins));\n };\n\n http.bare = function() {\n return factory();\n };\n\n http.Request = Request;\n http.Response = Response;\n http.RequestError = RequestError;\n\n return http;\n}\n\nmodule.exports = factory({}, [cleanURL]);\n\n/**\n * Analyze the request to see if it represents an error. If so, return it! An\n * original error object can be passed as a hint.\n */\nfunction getError(req, err) {\n if (req.aborted) return createError('Request aborted', req, {name: 'Abort'});\n\n if (req.timedOut) return createError('Request timeout', req, {name: 'Timeout'});\n\n var xhr = req.xhr;\n var type = Math.floor(xhr.status / 100);\n\n var kind;\n switch (type) {\n case 0:\n case 2:\n // These don't represent errors unless the function was passed an\n // error object explicitly.\n if (!err) return;\n return createError(err.message, req);\n case 4:\n // Sometimes 4XX statuses aren't errors.\n if (xhr.status === 404 && !req.errorOn404) return;\n kind = 'Client';\n break;\n case 5:\n kind = 'Server';\n break;\n default:\n kind = 'HTTP';\n }\n var msg = kind + ' Error: ' +\n 'The server returned a status of ' + xhr.status +\n ' for the request \"' +\n req.method.toUpperCase() + ' ' + req.url + '\"';\n return createError(msg, req);\n}\n","/*\n Copyright 2017 Stratumn SAS. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\n// Deprecated.\nexport default {\n applicationUrl: 'https://%s.stratumn.rocks'\n};\n"],"names":["deprecated","oldFunc","newFunc","warn","makeQueryString","obj","parts","Object","keys","reduce","curr","key","val","Array","isArray","join","push","encodeURIComponent","length","promiseWhile","condition","body","Promise","resolve","reject","loop","then","catch","send","method","url","args","err","res","error","meta","errorMessage","Error","status","get","post","findSegments","agent","opts","options","assign","limit","batchSize","DEFAULT_BATCH_SIZE","offset","segments","newSegments","map","segmentify","getBranches","prevLinkHash","tags","agentInfo","actions","filter","indexOf","forEach","linkHash","getPrev","link","getSegment","load","JSON","parse","stringify","createMap","getMapIds","getLink","hash","getMap","mapId","getAgent","bind","fromSegment","agentUrl","applicationLocation","segment","getApplication","name","config","applicationUrl","replace","loadLink","global","undefined","setImmediate","callback","Function","arguments","i","task","tasksByHandle","nextHandle","registerImmediate","clearImmediate","handle","run","apply","runIfPresent","currentlyRunningATask","setTimeout","installNextTickImplementation","process","nextTick","canUsePostMessage","postMessage","importScripts","postMessageIsAsynchronous","oldOnMessage","onmessage","installPostMessageImplementation","messagePrefix","Math","random","onGlobalMessage","event","source","data","slice","addEventListener","attachEvent","installMessageChannelImplementation","channel","MessageChannel","port1","port2","installReadyStateChangeImplementation","html","doc","documentElement","script","createElement","onreadystatechange","removeChild","appendChild","installSetTimeoutImplementation","document","attachTo","getPrototypeOf","toString","call","self","commonjsHelpers.commonjsGlobal","this","module","exports","processRequest","req","contentType","header","hasJsonContentType","accept","processResponse","test","raw","text","jsonrequest","commonjsHelpers.interopDefault","jsonresponse","s","encodeURI","window","XMLHttpRequest","fn","prototype","Request","optsOrUrl","toUpperCase","headers","timeout","errorOn404","onload","onerror","abort","aborted","xhr","value","k","hasOwnProperty","toLowerCase","extend","target","props","request","lines","m","getAllResponseHeaders","split","match","getResponseHeader","responseText","response","Response","isHttpError","extractResponseProps","fromRequest","RequestError","message","stack","constructor","create","result","called","factory","defaults","plugins","http","cb","plugin","done","timeoutId","supportsLoadAndErrorEvents","createXHR","XHR","once","delay","rawError","clearTimeout","onabort","ontimeout","onprogress","getError","readyState","open","timedOut","setRequestHeader","methods","verb","newValues","use","newPlugins","concat","bare","createError","kind","type","floor","msg","cleanURL","httpplease","json"],"mappings":"4NAgBA,SAAwBA,GAAWC,EAASC,GACrCA,UAGKC,iBAAiBF,gCAAqCC,u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Y,MAC3CgE,GAAO,QACP,MACF,KAAK,GACHA,EAAO,QACP,MACF,SACEA,EAAO,OAEX,GAAIG,GAAMH,EAAO,2CAC0B3D,EAAI9I,OACzC,qBACAkH,EAAI3H,OAAO+I,cAAgB,IAAMpB,EAAI1H,IAAM,GACjD,OAAOgN,GAAYI,EAAK1F,GAhN1B,GAUI1D,GATFqJ,EAAWjF,KACXwD,EAAMxD,KACN0D,EAAQ1D,KACRuC,EAAevC,MACfmC,EAAWnC,MACXQ,EAAUR,KACVuB,EAASvB,KACTyD,EAAOzD,MAGL4E,EAAcrC,EAAaI,MAgK/BxD,GAAOC,QAAU0D,MAAamC,e1B1JxBvD,GAAUwD,GAAWV,IAAIW,kpCCEzBrM,GAAqB,sB0BHT"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Stratumn SDK for Javascript browser example</title>
|
5
|
+
<script type="text/javascript" src="../../dist/stratumn-agent-client.js"></script>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
|
11
|
+
AgentClient
|
12
|
+
.getAgent('http://localhost:3000')
|
13
|
+
.then(function(agent) {
|
14
|
+
return agent.createMap('Hello');
|
15
|
+
})
|
16
|
+
.then(function(segment) {
|
17
|
+
console.log(segment);
|
18
|
+
return segment.updateTitle('Hi');
|
19
|
+
})
|
20
|
+
.then(function(segment) {
|
21
|
+
console.log(segment);
|
22
|
+
return segment.getPrev();
|
23
|
+
})
|
24
|
+
.then(function(segment) {
|
25
|
+
console.log(segment);
|
26
|
+
})
|
27
|
+
.catch(function(err) {
|
28
|
+
console.error(err);
|
29
|
+
});
|
30
|
+
|
31
|
+
</script>
|
32
|
+
|
33
|
+
</body>
|
34
|
+
</html>
|
@@ -0,0 +1,69 @@
|
|
1
|
+
{
|
2
|
+
"name": "stratumn-agent-client",
|
3
|
+
"version": "1.9.0",
|
4
|
+
"description": "Stratumn Indigo agent client library",
|
5
|
+
"main": "lib/stratumn-agent-client.js",
|
6
|
+
"jsnext:main": "lib/stratumn-agent-client.mjs",
|
7
|
+
"scripts": {
|
8
|
+
"test": "mocha --compilers js:babel-core/register --recursive --require babel-polyfill --require should 2> /dev/null",
|
9
|
+
"test:cov": "babel-node ./node_modules/isparta/bin/isparta cover ./node_modules/mocha/bin/_mocha -- --recursive --require should --require should 2> /dev/null",
|
10
|
+
"lint": "eslint src test",
|
11
|
+
"check": "npm run lint && npm run test",
|
12
|
+
"build:lib": "rollup -c rollup.es.config.js && rollup -c rollup.umd.config.js",
|
13
|
+
"build:bower": "rollup -c rollup.bower.config.js",
|
14
|
+
"build:bower:min": "rollup -c rollup.bower.min.config.js",
|
15
|
+
"build:all": "npm run build:lib && npm run build:bower && npm run build:bower:min",
|
16
|
+
"clean": "rimraf lib coverage",
|
17
|
+
"preversion": "npm run clean && npm run check",
|
18
|
+
"version": "npm run build:all",
|
19
|
+
"postversion": "git push && git push --tags && npm run clean",
|
20
|
+
"prepublish": "npm run clean && npm run build:all",
|
21
|
+
"postpublish": "aws s3 cp dist/stratumn-agent-client.js s3://stratumn-libs/stratumn-agent-client.js --region 'eu-west-1' && aws s3 cp dist/stratumn-agent-client.min.js s3://stratumn-libs/stratumn-agent-client.min.js --region 'eu-west-1' && aws s3 cp dist/stratumn-agent-client.js s3://stratumn-libs/stratumn-agent-client-${npm_package_version}.js --region 'eu-west-1' && aws s3 cp dist/stratumn-agent-client.min.js s3://stratumn-libs/stratumn-agent-client-${npm_package_version}.min.js --region 'eu-west-1'",
|
22
|
+
"update-license-headers": "./update-license-headers.sh"
|
23
|
+
},
|
24
|
+
"repository": {
|
25
|
+
"type": "git",
|
26
|
+
"url": "https://github.com/stratumn/agent-client-js.git"
|
27
|
+
},
|
28
|
+
"keywords": [
|
29
|
+
"stratumn",
|
30
|
+
"sdk",
|
31
|
+
"blockchain",
|
32
|
+
"client"
|
33
|
+
],
|
34
|
+
"author": "Stratumn Team",
|
35
|
+
"license": "Apache-2.0",
|
36
|
+
"bugs": {
|
37
|
+
"url": "https://github.com/stratumn/agent-client-js/issues"
|
38
|
+
},
|
39
|
+
"homepage": "https://github.com/stratumn/agent-client-js",
|
40
|
+
"devDependencies": {
|
41
|
+
"babel-cli": "^6.5.1",
|
42
|
+
"babel-core": "^6.5.2",
|
43
|
+
"babel-eslint": "^6.0.0",
|
44
|
+
"babel-plugin-external-helpers": "^6.8.0",
|
45
|
+
"babel-polyfill": "^6.5.0",
|
46
|
+
"babel-preset-es2015": "^6.5.0",
|
47
|
+
"babel-register": "^6.11.6",
|
48
|
+
"babelrc-rollup": "^3.0.0",
|
49
|
+
"eslint": "^2.3.0",
|
50
|
+
"eslint-config-airbnb": "^6.0.2",
|
51
|
+
"eslint-plugin-react": "^4.1.0",
|
52
|
+
"isparta": "^4.0.0",
|
53
|
+
"mocha": "^2.4.5",
|
54
|
+
"rimraf": "^2.5.2",
|
55
|
+
"rollup": "^0.34.10",
|
56
|
+
"rollup-plugin-babel": "^2.6.1",
|
57
|
+
"rollup-plugin-commonjs": "^3.3.1",
|
58
|
+
"rollup-plugin-node-resolve": "^2.0.0",
|
59
|
+
"rollup-plugin-uglify": "^1.0.1",
|
60
|
+
"rollup-pluginutils": "^1.5.1",
|
61
|
+
"should": "^8.2.2",
|
62
|
+
"stratumn-agent": "^0.15.0"
|
63
|
+
},
|
64
|
+
"dependencies": {
|
65
|
+
"httpplease": "^0.16.4",
|
66
|
+
"setimmediate": "^1.0.5",
|
67
|
+
"xmlhttprequest": "~1.7.0"
|
68
|
+
}
|
69
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import babel from 'rollup-plugin-babel';
|
2
|
+
import { default as babelrc } from 'babelrc-rollup';
|
3
|
+
|
4
|
+
export default {
|
5
|
+
plugins: [
|
6
|
+
babel(Object.assign({
|
7
|
+
exclude: 'node_modules/**'
|
8
|
+
}, babelrc()))
|
9
|
+
],
|
10
|
+
sourceMap: true,
|
11
|
+
entry: 'src/index.js',
|
12
|
+
moduleName: 'StratumnAgentClient'
|
13
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import commonjs from 'rollup-plugin-commonjs';
|
2
|
+
import nodeResolve from 'rollup-plugin-node-resolve';
|
3
|
+
|
4
|
+
import config from './rollup.base.config';
|
5
|
+
|
6
|
+
config.plugins.push(
|
7
|
+
nodeResolve({
|
8
|
+
jsnext: true,
|
9
|
+
browser: true,
|
10
|
+
preferBuiltins: true
|
11
|
+
}),
|
12
|
+
commonjs()
|
13
|
+
);
|
14
|
+
|
15
|
+
config.format = 'umd';
|
16
|
+
config.dest = 'dist/stratumn-agent-client.js';
|
17
|
+
|
18
|
+
export default config;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
|
5
|
+
update-license-header() {
|
6
|
+
perl -i -0pe 's/\/\*.*\n.*Copyright.*Stratumn.*\n(.*\n)*\*\/\n/`cat LICENSE_HEADER`/ge' $1
|
7
|
+
}
|
8
|
+
|
9
|
+
directories="src test"
|
10
|
+
extensions="js"
|
11
|
+
|
12
|
+
for d in $directories; do
|
13
|
+
if [ -d "$d" ]; then
|
14
|
+
for e in $extensions; do
|
15
|
+
for f in $(find $d -name "*.$e"); do
|
16
|
+
update-license-header $f
|
17
|
+
done
|
18
|
+
done
|
19
|
+
fi
|
20
|
+
done
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mapexplorer-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- adrien
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -106,7 +106,7 @@ executables: []
|
|
106
106
|
extensions: []
|
107
107
|
extra_rdoc_files: []
|
108
108
|
files:
|
109
|
-
-
|
109
|
+
- LICENSE
|
110
110
|
- README.md
|
111
111
|
- Rakefile
|
112
112
|
- app/assets/config/mapexplorer_rails_manifest.js
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- vendor/assets/jsrender/jsrender.min.js.map
|
138
138
|
- vendor/assets/jsrender/tmplify/index.js
|
139
139
|
- vendor/assets/mapexplorer-core/LICENSE
|
140
|
+
- vendor/assets/mapexplorer-core/LICENSE_HEADER
|
140
141
|
- vendor/assets/mapexplorer-core/README.md
|
141
142
|
- vendor/assets/mapexplorer-core/assets/stylesheets/map.scss
|
142
143
|
- vendor/assets/mapexplorer-core/assets/stylesheets/mapexplorer-core.scss
|
@@ -145,12 +146,29 @@ files:
|
|
145
146
|
- vendor/assets/mapexplorer-core/bower.json
|
146
147
|
- vendor/assets/mapexplorer-core/dist/mapexplorer-core.js
|
147
148
|
- vendor/assets/mapexplorer-core/dist/mapexplorer-core.js.map
|
148
|
-
- vendor/assets/mapexplorer-core/dist/mapexplorer-core.min.js
|
149
149
|
- vendor/assets/mapexplorer-core/karma.conf.js
|
150
|
+
- vendor/assets/mapexplorer-core/package-lock.json
|
150
151
|
- vendor/assets/mapexplorer-core/package.json
|
151
152
|
- vendor/assets/mapexplorer-core/rollup.bower.config.js
|
152
153
|
- vendor/assets/mapexplorer-core/rollup.es.config.js
|
153
154
|
- vendor/assets/mapexplorer-core/rollup.umd.config.js
|
155
|
+
- vendor/assets/mapexplorer-core/update-license-headers.sh
|
156
|
+
- vendor/assets/stratumn-agent-client/LICENSE
|
157
|
+
- vendor/assets/stratumn-agent-client/LICENSE_HEADER
|
158
|
+
- vendor/assets/stratumn-agent-client/README.md
|
159
|
+
- vendor/assets/stratumn-agent-client/bower.json
|
160
|
+
- vendor/assets/stratumn-agent-client/dist/stratumn-agent-client.js
|
161
|
+
- vendor/assets/stratumn-agent-client/dist/stratumn-agent-client.js.map
|
162
|
+
- vendor/assets/stratumn-agent-client/dist/stratumn-agent-client.min.js
|
163
|
+
- vendor/assets/stratumn-agent-client/dist/stratumn-agent-client.min.js.map
|
164
|
+
- vendor/assets/stratumn-agent-client/examples/browser/index.html
|
165
|
+
- vendor/assets/stratumn-agent-client/package.json
|
166
|
+
- vendor/assets/stratumn-agent-client/rollup.base.config.js
|
167
|
+
- vendor/assets/stratumn-agent-client/rollup.bower.config.js
|
168
|
+
- vendor/assets/stratumn-agent-client/rollup.bower.min.config.js
|
169
|
+
- vendor/assets/stratumn-agent-client/rollup.es.config.js
|
170
|
+
- vendor/assets/stratumn-agent-client/rollup.umd.config.js
|
171
|
+
- vendor/assets/stratumn-agent-client/update-license-headers.sh
|
154
172
|
- vendor/assets/stratumn-sdk/LICENSE
|
155
173
|
- vendor/assets/stratumn-sdk/README.md
|
156
174
|
- vendor/assets/stratumn-sdk/bower.json
|
@@ -167,7 +185,7 @@ files:
|
|
167
185
|
- vendor/assets/stratumn-sdk/rollup.umd.config.js
|
168
186
|
homepage: https://github.com/stratumn/mapexplorer-rails
|
169
187
|
licenses:
|
170
|
-
-
|
188
|
+
- Apache-2.0
|
171
189
|
metadata: {}
|
172
190
|
post_install_message:
|
173
191
|
rdoc_options: []
|
@@ -180,9 +198,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
180
198
|
version: '0'
|
181
199
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
200
|
requirements:
|
183
|
-
- - "
|
201
|
+
- - ">="
|
184
202
|
- !ruby/object:Gem::Version
|
185
|
-
version:
|
203
|
+
version: '0'
|
186
204
|
requirements: []
|
187
205
|
rubyforge_project:
|
188
206
|
rubygems_version: 2.5.2
|
data/MIT-LICENSE
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright 2016 adrien
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,35 +0,0 @@
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.MapexplorerCore=e():t.MapexplorerCore=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var i=r(1),a=n(i),o=r(2),s=n(o),f=r(30),c=n(f),h=r(31),u=n(h),d=r(185),l=n(d),p=r(5),b=n(p),v=r(4),y=n(v),g=r(6),m=n(g);t.exports={ChainTreeBuilder:a["default"],ChainTree:s["default"],ChainValidator:c["default"],SegmentValidator:u["default"],MerklePathTree:l["default"],compactHash:b["default"],parseChainscript:y["default"],resolveLinks:m["default"]}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),f=r(2),c=n(f),h=r(5),u=n(h),d=r(6),l=n(d),p=r(8),b=n(p),v={withArgs:!1,getSegmentText:function(t){return(0,u["default"])(t.data.meta.linkHash)},getLinkText:function(t){return t.target.data.link.meta.action+(this.withArgs?"("+t.target.data.link.meta.arguments.join(", ")+")":"")},duration:750,onclick:function(){}},y=function(){function t(e,r){i(this,t),this.chainTree=new c["default"](e,o({},v,r))}return s(t,[{key:"build",value:function(t){var e=this;if(t.id&&t.application)this._load(t).then(function(t){return e.chainTree.display(t)});else if(t.chainscript&&t.chainscript.length){var r=t.chainscript;try{"object"!==("undefined"==typeof r?"undefined":a(r))&&(r=JSON.parse(r)),(0,l["default"])(r).then(function(t){return e.chainTree.display(t)})}catch(n){console.log(n)}}}},{key:"_load",value:function(t){return b["default"].getApplication(t.application).then(function(e){return e.getMap(t.id)}).then(function(t){return Promise.all(t.map(function(t){return t.load()}))})["catch"](function(t){return console.log(t)})}}]),t}();e["default"]=y},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=r(3),s=r(4),f=n(s),c={top:20,right:120,bottom:20,left:120},h=800-c.top-c.bottom,u={width:78,height:91},d={width:u.width,height:25},l=u.width,p=function(){function t(e,r){i(this,t),this.element=e,this.options=r,this.tree=d3.tree(),this.transition=d3.transition().duration(this.options.duration).ease(d3.easeLinear),this.svg=d3.select(e.find("svg")[0]),this.innerG=this.svg.append("g").attr("transform",function(){return(0,o.translate)(c.top,c.left)})}return a(t,[{key:"display",value:function(t){if(t&&t.length){var e=(0,f["default"])(t);e.x0=h/2,e.y0=0,this._update(e,e.descendants(),e.links())}else this._update(null,[],[])}},{key:"_update",value:function(t,e,r){var n=this,i=this.options,a=d3.max(e,function(t){return t.depth})||0,s=Math.max(a*(u.width+l),500);this.tree.size([h,s]),this.svg.attr("width",s+c.right+c.left+l).attr("height",h+c.top+c.bottom),t&&(this.tree(t),t.each(function(t){t.y+=l}));var f=this.innerG.selectAll("g.node").data(e,function(t){return t?t.id:this.id}),p=f.enter().append("g").attr("class",function(t){return["node"].concat(t.data.link.meta.tags).join(" ")}).attr("id",function(t){return t.id}).attr("transform",function(e){var r=e.parent&&e.parent.x0?e.parent:t;return(0,o.translate)(r.x0,r.y0)}).on("click",function(t){d3.selectAll("g.node").classed("selected",!1),d3.select(this).classed("selected",!0),i.onclick(t,function(){n.innerG.selectAll("g.node.selected").classed("selected",!1)})});p.append("polygon").attr("points","0,"+u.height/4+" "+u.width/2+","+u.height/2+" "+(u.width+","+u.height/4+" "+u.width+","+-u.height/4+" ")+(u.width/2+","+-u.height/2+" 0,"+-u.height/4)),p.append("rect").attr("y",-(d.height/2)).attr("width",u.width).attr("height",d.height).style("fill-opacity",1e-6),p.append("text").attr("dx",12).attr("dy",4).attr("text-anchor","begin").text(this.options.getSegmentText).style("fill-opacity",1e-6);var b=this.svg.selectAll("g.node").transition(this.transition);b.attr("transform",function(t){return(0,o.translate)(t.x,t.y)}),b.select("text").style("fill-opacity",1),b.select("rect").style("fill-opacity",1);var v=f.exit();v.select("text").style("fill-opacity",1e-6),v.attr("transform",function(){return(0,o.translate)(0,0)}).remove();var y=this.innerG.selectAll("path.link").data(r,function(t){return t?t.target.id:this.id});y.enter().insert("text").attr("dx",u.width+20).attr("dy","-0.3em").append("textPath").attr("class","textpath").attr("xlink:href",function(t){return"#link-"+t.target.id}).text(this.options.getLinkText),y.enter().insert("path","g").attr("class","link").attr("id",function(t){return"link-"+t.target.id}).attr("d",function(t){return(0,o.finalLink)(t,15)}),y.exit().transition(this.transition).attr("d",function(){return(0,o.makeLink)({x:0,y:0})}).remove(),this._drawInit(t)}},{key:"_drawInit",value:function(t){this.innerG.append("path").attr("class","link").attr("id","init-link").attr("d",(0,o.makeLink)({x:t.x0,y:t.y0},t,15)),this.innerG.append("text").attr("dx",20).attr("dy","-0.3em").append("textPath").attr("class","textpath").attr("xlink:href","#init-link").text("init")}}]),t}();e["default"]=p},function(t,e){"use strict";function r(t,e){var r=arguments.length<=2||void 0===arguments[2]?0:arguments[2],n=e||t,i=n.x,a=n.y-r;return"M"+t.y+","+t.x+"\n C"+(t.y+a)/2+","+t.x+" "+(t.y+a)/2+",\n "+i+" "+a+","+i}function n(t,e){return r(t.source,t.target,e)}function i(t,e){return"translate("+e+", "+t+")"}function a(t){t.forEach(function(t){t.x0=t.x,t.y0=t.y})}Object.defineProperty(e,"__esModule",{value:!0}),e.makeLink=r,e.finalLink=n,e.translate=i,e.stashPositions=a},function(t,e){"use strict";function r(t){return d3.stratify().id(function(t){return t.meta.linkHash}).parentId(function(t){return t.link.meta.prevLinkHash})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=r},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t){return""+t.slice(0,3)+t.slice(t.length-3)}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t){return Promise.all(t.map(function(t){return t.link.state?Promise.resolve(t):f["default"].loadLink(t).then(function(e){return(0,o["default"])(e,t)})}))}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(7),o=n(a),s=r(8),f=n(s)},function(t,e,r){var n,i;!function(a,o){n=o,i="function"==typeof n?n.call(e,r,e,t):n,!(void 0!==i&&(t.exports=i))}(this,function(){return function t(e,r){var n=Array.isArray(r),i=n&&[]||{};return n?(e=e||[],i=i.concat(e),r.forEach(function(r,n){"undefined"==typeof i[n]?i[n]=r:"object"==typeof r?i[n]=t(e[n],r):e.indexOf(r)===-1&&i.push(r)})):(e&&"object"==typeof e&&Object.keys(e).forEach(function(t){i[t]=e[t]}),Object.keys(r).forEach(function(n){"object"==typeof r[n]&&r[n]&&e[n]?i[n]=t(e[n],r[n]):i[n]=r[n]})),i}})},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var i=r(9),a=n(i),o=r(26),s=n(o),f=r(27),c=n(f),h=r(29),u=n(h),d=r(28),l=n(d);t.exports={getAgent:a["default"],fromSegment:s["default"],getApplication:c["default"],loadLink:u["default"],config:l["default"]}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t){return new Promise(function(e,r){return o["default"].get(t).end(function(n,i){if(n)return n.status=i.statusCode,void r(n);var a=i.body;a.url=t,a.createMap=f["default"].bind(null,a),a.getSegment=h["default"].bind(null,a),a.findSegments=d["default"].bind(null,a),a.getMapIds=p["default"].bind(null,a),a.getBranches=v["default"].bind(null,a),a.getLink=g["default"].bind(null,a),a.getMap=_["default"].bind(null,a),e(a)})})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(10),o=n(a),s=r(16),f=n(s),c=r(19),h=n(c),u=r(20),d=n(u),l=r(22),p=n(l),b=r(23),v=n(b),y=r(24),g=n(y),m=r(25),_=n(m)},function(t,e,r){function n(){}function i(t){var e={}.toString.call(t);switch(e){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function a(t){if(!m(t))return t;var e=[];for(var r in t)null!=t[r]&&o(e,r,t[r]);return e.join("&")}function o(t,e,r){return Array.isArray(r)?r.forEach(function(r){o(t,e,r)}):void t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))}function s(t){for(var e,r,n={},i=t.split("&"),a=0,o=i.length;a<o;++a)r=i[a],e=r.split("="),n[decodeURIComponent(e[0])]=decodeURIComponent(e[1]);return n}function f(t){var e,r,n,i,a=t.split(/\r?\n/),o={};a.pop();for(var s=0,f=a.length;s<f;++s)r=a[s],e=r.indexOf(":"),n=r.slice(0,e).toLowerCase(),i=w(r.slice(e+1)),o[n]=i;return o}function c(t){return/[\/+]json\b/.test(t)}function h(t){return t.split(/ *; */).shift()}function u(t){return y(t.split(/ *; */),function(t,e){var r=e.split(/ *= */),n=r.shift(),i=r.shift();return n&&i&&(t[n]=i),t},{})}function d(t,e){e=e||{},this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=f(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function l(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",function(){var t=null,e=null;try{e=new d(r)}catch(n){return t=new Error("Parser is unable to parse the response"),t.parse=!0,t.original=n,t.rawResponse=r.xhr&&r.xhr.responseText?r.xhr.responseText:null,t.statusCode=r.xhr&&r.xhr.status?r.xhr.status:null,r.callback(t)}if(r.emit("response",e),t)return r.callback(t,e);if(e.status>=200&&e.status<300)return r.callback(t,e);var i=new Error(e.statusText||"Unsuccessful HTTP response");i.original=t,i.response=e,i.status=e.status,r.callback(i,e)})}function p(t,e){var r=_("DELETE",t);return e&&r.end(e),r}var b,v=r(11),y=r(12),g=r(13),m=r(14);b="undefined"!=typeof window?window:"undefined"!=typeof self?self:this;var _=t.exports=r(15).bind(null,l);_.getXHR=function(){if(!(!b.XMLHttpRequest||b.location&&"file:"==b.location.protocol&&b.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}return!1};var w="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};_.serializeObject=a,_.parseString=s,_.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},_.serialize={"application/x-www-form-urlencoded":a,"application/json":JSON.stringify},_.parse={"application/x-www-form-urlencoded":s,"application/json":JSON.parse},d.prototype.get=function(t){return this.header[t.toLowerCase()]},d.prototype.setHeaderProperties=function(t){var e=this.header["content-type"]||"";this.type=h(e);var r=u(e);for(var n in r)this[n]=r[n]},d.prototype.parseBody=function(t){var e=_.parse[this.type];return!e&&c(this.type)&&(e=_.parse["application/json"]),e&&t&&(t.length||t instanceof Object)?e(t):null},d.prototype.setStatusProperties=function(t){1223===t&&(t=204);var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.notFound=404==t,this.forbidden=403==t},d.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot "+e+" "+r+" ("+this.status+")",i=new Error(n);return i.status=this.status,i.method=e,i.url=r,i},_.Response=d,v(l.prototype);for(var S in g)l.prototype[S]=g[S];l.prototype.abort=function(){if(!this.aborted)return this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this},l.prototype.type=function(t){return this.set("Content-Type",_.types[t]||t),this},l.prototype.responseType=function(t){return this._responseType=t,this},l.prototype.accept=function(t){return this.set("Accept",_.types[t]||t),this},l.prototype.auth=function(t,e,r){switch(r||(r={type:"basic"}),r.type){case"basic":var n=btoa(t+":"+e);this.set("Authorization","Basic "+n);break;case"auto":this.username=t,this.password=e}return this},l.prototype.query=function(t){return"string"!=typeof t&&(t=a(t)),t&&this._query.push(t),this},l.prototype.attach=function(t,e,r){return this._getFormData().append(t,e,r||e.name),this},l.prototype._getFormData=function(){return this._formData||(this._formData=new b.FormData),this._formData},l.prototype.send=function(t){var e=m(t),r=this._header["content-type"];if(e&&m(this._data))for(var n in t)this._data[n]=t[n];else"string"==typeof t?(r||this.type("form"),r=this._header["content-type"],"application/x-www-form-urlencoded"==r?this._data=this._data?this._data+"&"+t:t:this._data=(this._data||"")+t):this._data=t;return!e||i(t)?this:(r||this.type("json"),this)},d.prototype.parse=function(t){return b.console&&console.warn("Client-side parse() method has been renamed to serialize(). This method is not compatible with superagent v2.0"),this.serialize(t),this},d.prototype.serialize=function(t){return this._parser=t,this},l.prototype.callback=function(t,e){var r=this._callback;this.clearTimeout(),r(t,e)},l.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},l.prototype.timeoutError=function(){var t=this._timeout,e=new Error("timeout of "+t+"ms exceeded");e.timeout=t,this.callback(e)},l.prototype.withCredentials=function(){return this._withCredentials=!0,this},l.prototype.end=function(t){var e=this,r=this.xhr=_.getXHR(),a=this._query.join("&"),o=this._timeout,s=this._formData||this._data;this._callback=t||n,r.onreadystatechange=function(){if(4==r.readyState){var t;try{t=r.status}catch(n){t=0}if(0==t){if(e.timedout)return e.timeoutError();if(e.aborted)return;return e.crossDomainError()}e.emit("end")}};var f=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),t.direction="download",e.emit("progress",t)};this.hasListeners("progress")&&(r.onprogress=f);try{r.upload&&this.hasListeners("progress")&&(r.upload.onprogress=f)}catch(h){}if(o&&!this._timer&&(this._timer=setTimeout(function(){e.timedout=!0,e.abort()},o)),a&&(a=_.serializeObject(a),this.url+=~this.url.indexOf("?")?"&"+a:"?"+a),this.username&&this.password?r.open(this.method,this.url,!0,this.username,this.password):r.open(this.method,this.url,!0),this._withCredentials&&(r.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof s&&!i(s)){var u=this._header["content-type"],d=this._parser||_.serialize[u?u.split(";")[0]:""];!d&&c(u)&&(d=_.serialize["application/json"]),d&&(s=d(s))}for(var l in this.header)null!=this.header[l]&&r.setRequestHeader(l,this.header[l]);return this._responseType&&(r.responseType=this._responseType),this.emit("request",this),r.send("undefined"!=typeof s?s:null),this},_.Request=l,_.get=function(t,e,r){var n=_("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},_.head=function(t,e,r){var n=_("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},_.del=p,_["delete"]=p,_.patch=function(t,e,r){var n=_("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},_.post=function(t,e,r){var n=_("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},_.put=function(t,e,r){var n=_("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},function(t,e,r){function n(t){if(t)return i(t)}function i(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var n,i=0;i<r.length;i++)if(n=r[i],n===e||n.fn===e){r.splice(i,1);break}return this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),r=this._callbacks["$"+t];if(r){r=r.slice(0);for(var n=0,i=r.length;n<i;++n)r[n].apply(this,e)}return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e){t.exports=function(t,e,r){for(var n=0,i=t.length,a=3==arguments.length?r:t[n++];n<i;)a=e.call(null,a,t[n],++n,t);return a}},function(t,e,r){var n=r(14);e.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},e.parse=function(t){return this._parser=t,this},e.timeout=function(t){return this._timeout=t,this},e.then=function(t,e){return this.end(function(r,n){r?e(r):t(n)})},e.use=function(t){return t(this),this},e.get=function(t){return this._header[t.toLowerCase()]},e.getHeader=e.get,e.set=function(t,e){if(n(t)){for(var r in t)this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},e.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},e.field=function(t,e){return this._getFormData().append(t,e),this}},function(t,e){function r(t){return null!=t&&"object"==typeof t}t.exports=r},function(t,e){function r(t,e,r){return"function"==typeof r?new t("GET",e).end(r):2==arguments.length?new t("GET",e):new t(e,r)}t.exports=r},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return new Promise(function(e,n){var i=t.url+"/segments";return o["default"].post(i).send(r).end(function(r,i){var a=i.body.meta&&i.body.meta.errorMessage?new Error(i.body.meta.errorMessage):r;return a?(a.status=i.statusCode,void n(a)):void e((0,f["default"])(t,i.body))})})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(10),o=n(a),s=r(17),f=n(s)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){return Object.keys(t.agentInfo.functions).filter(function(t){return["init","catchAll"].indexOf(t)<0}).forEach(function(r){e[r]=function(){for(var n=arguments.length,a=Array(n),s=0;s<n;s++)a[s]=arguments[s];return new Promise(function(n,s){var f=t.url+"/segments/"+e.meta.linkHash+"/"+r;return o["default"].post(f).send(a).end(function(e,r){var a=r.body.meta&&r.body.meta.errorMessage?new Error(r.body.meta.errorMessage):e;return a?(a.status=r.statusCode,void s(a)):void n(i(t,r.body))})})}}),e.getPrev=function(){return e.link.meta.prevLinkHash?t.getSegment(e.link.meta.prevLinkHash):Promise.resolve(null)},e.load=function(){return(0,f["default"])("segment#load()"),e},e}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(10),o=n(a),s=r(18),f=n(s)},function(t,e){"use strict";function r(t,e){e?console.warn("WARNING: "+t+" is deprecated. Please use "+e+" instead."):console.warn("WARNING: "+t+" is deprecated.")}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=r},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){return new Promise(function(r,n){var i=t.url+"/segments/"+e;return o["default"].get(i).end(function(e,i){return e?(e.status=i.statusCode,void n(e)):void r((0,f["default"])(t,i.body))})})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(10),o=n(a),s=r(17),f=n(s)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return new Promise(function(r,n){var i=t.url+"/segments"+(0,h["default"])(e);return o["default"].get(i).end(function(e,i){return e?(e.status=i.statusCode,void n(e)):void r(i.body.map(function(e){return(0,f["default"])(t,e)}))})})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(10),o=n(a),s=r(17),f=n(s),c=r(21),h=n(c)},function(t,e){"use strict";function r(t){var e=Object.keys(t).reduce(function(e,r){var n=Array.isArray(t[r])?t[r].join(","):t[r];return e.push(encodeURIComponent(r)+"="+encodeURIComponent(n)),e},[]);return e.length?"?"+e.join("&"):""}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=r},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return new Promise(function(r,n){var i=t.url+"/maps"+(0,f["default"])(e);return o["default"].get(i).end(function(t,e){return t?(t.status=e.statusCode,void n(t)):void r(e.body)})})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(10),o=n(a),s=r(21),f=n(s)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var r=arguments.length<=2||void 0===arguments[2]?[]:arguments[2];return(0,f["default"])("Agent#getBranches(agent, prevLinkHash, tags = [])","Agent#findSegments(agent, filter)"),(0,o["default"])(t,{prevLinkHash:e,tags:r})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(20),o=n(a),s=r(18),f=n(s)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){return(0,f["default"])("Agent#getLink(agent, hash)","Agent#getSegment(agent, hash)"),(0,o["default"])(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(19),o=n(a),s=r(18),f=n(s)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var r=arguments.length<=2||void 0===arguments[2]?[]:arguments[2];return(0,f["default"])("getMap(agent, mapId, tags = [])","findSegments(agent, filter)"),(0,o["default"])(t,{mapId:e,tags:r})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(20),o=n(a),s=r(18),f=n(s)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t){return(0,o["default"])(t.meta.agentUrl||t.meta.applicationLocation).then(function(e){var r=(0,f["default"])(e,t);return{agent:e,segment:r}})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(9),o=n(a),s=r(17),f=n(s)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){return(0,f["default"])("getApplication(name, url)","getAgent(url)"),(0,o["default"])(e||h["default"].applicationUrl.replace("%s",t))}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(9),o=n(a),s=r(18),f=n(s),c=r(28),h=n(c)},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={applicationUrl:"https://%s.stratumn.rocks"}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t){return(0,f["default"])("loadLink(obj)","fromSegment(obj)"),(0,o["default"])(t).then(function(t){var e=t.segment;return e})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(26),o=n(a),s=r(18),f=n(s)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=r(31),s=n(o),f=r(6),c=n(f),h=function(){function t(e){i(this,t),this.segments=e,this.errors={linkHash:[],stateHash:[],merklePath:[],fossil:[]}}return a(t,[{key:"validate",value:function(){var t=this;return(0,c["default"])(this.segments).then(function(e){return e.forEach(function(e){return new s["default"](e).validate(t.errors)}),t.errors})}}]),t}();e["default"]=h},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),s=r(32),f=n(s),c=r(180),h=n(c),u=r(184),d=n(u),l={},p=function(){function t(e){i(this,t),this.segment=e}return o(t,[{key:"validate",value:function(t){t.linkHash.push(this._validateLinkHash()),t.stateHash.push(this._validateStateHash()),t.merklePath.push(this._validateMerklePath()),t.fossil.push(this._validateFossil())}},{key:"_validateLinkHash",value:function(){var t=(0,f["default"])(this.segment.link),e=this.segment.meta.linkHash;return t!==e?"LinkHash computed: "+t+", Found: "+e:null}},{key:"_validateStateHash",value:function(){if(this.segment.link.state){var t=(0,f["default"])(this.segment.link.state),e=this.segment.link.meta.stateHash;if(t!==e)return"StateHash computed: "+t+", Found: "+e}return null}},{key:"_validateMerklePath",value:function(){var t=this,e=this.segment.meta.evidence;if(e&&"COMPLETE"===e.state){var r=function(){var r=t.segment.meta.linkHash,n=void 0;if(e.merklePath.every(function(t){if(t.left===r||t.right===r){var e=(0,d["default"])(t.left,t.right);return e!==t.parent?(n="Invalid Merkle Node "+JSON.stringify(t)+": computed parent: "+e,!1):(r=t.parent,!0)}return n="Invalid Merkle Node "+JSON.stringify(t)+": "+("previous hash ("+r+") not found"),!1}),n)return{v:n};var i=e.merklePath[e.merklePath.length-1];return i.parent!==e.merkleRoot?{v:"Invalid Merkle Root "+e.merkleRoot+": not found in Merkle Path"}:void 0}();if("object"===("undefined"==typeof r?"undefined":a(r)))return r.v}return null}},{key:"_validateFossil",value:function(){var t=this,e=this.segment.meta.evidence.transactions["bitcoin:main"];return this._getFossil(e).then(function(e){return e.body.outputs.find(function(e){return e.data_hex===t.segment.meta.evidence.merkleRoot})?null:"Merkle root not found in transaction data"})}},{key:"_getFossil",value:function(t){if(l[t])return Promise.resolve(l[t]);var e=new Promise(function(e,r){return(0,h["default"])("https://api.blockcypher.com/v1/btc/main/txs/"+t).end(function(t,n){return t?r(t):e(n)})});return l[t]=e,e}}]),t}();e["default"]=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t){return o["default"].createHash("sha256").update((0,f["default"])(t)).digest("hex")}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(33),o=n(a),s=r(179),f=n(s)},function(t,e,r){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(34),e.createHash=e.Hash=r(40),e.createHmac=e.Hmac=r(69);var n=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(Object.keys(r(70)));e.getHashes=function(){return n};var i=r(71);e.pbkdf2=i.pbkdf2,e.pbkdf2Sync=i.pbkdf2Sync;var a=r(72);["Cipher","createCipher","Cipheriv","createCipheriv","Decipher","createDecipher","Decipheriv","createDecipheriv","getCiphers","listCiphers"].forEach(function(t){e[t]=a[t]});var o=r(99);["DiffieHellmanGroup","createDiffieHellmanGroup","getDiffieHellman","createDiffieHellman","DiffieHellman"].forEach(function(t){e[t]=o[t]});var s=r(124);["createSign","Sign","createVerify","Verify"].forEach(function(t){e[t]=s[t]}),e.createECDH=r(172);var f=r(173);["publicEncrypt","privateEncrypt","publicDecrypt","privateDecrypt"].forEach(function(t){e[t]=f[t]}),["createCredentials"].forEach(function(t){e[t]=function(){throw new Error(["sorry, "+t+" is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))}})},function(t,e,r){(function(e,r,n){"use strict";function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}function a(t,i){if(t>65536)throw new Error("requested too many random bytes");var a=new e.Uint8Array(t);t>0&&o.getRandomValues(a);var s=new r(a.buffer);return"function"==typeof i?n.nextTick(function(){i(null,s)}):s}var o=e.crypto||e.msCrypto;o&&o.getRandomValues?t.exports=a:t.exports=i}).call(e,function(){return this}(),r(35).Buffer,r(39))},function(t,e,r){(function(t,n){/*!
|
2
|
-
* The buffer module from node.js, for the browser.
|
3
|
-
*
|
4
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
5
|
-
* @license MIT
|
6
|
-
*/
|
7
|
-
"use strict";function i(){function t(){}try{var e=new Uint8Array(1);return e.foo=function(){return 42},e.constructor=t,42===e.foo()&&e.constructor===t&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(r){return!1}}function a(){return t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function t(e){return this instanceof t?(t.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof e?o(this,e):"string"==typeof e?s(this,e,arguments.length>1?arguments[1]:"utf8"):f(this,e)):arguments.length>1?new t(e,arguments[1]):new t(e)}function o(e,r){if(e=b(e,r<0?0:0|v(r)),!t.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;n++)e[n]=0;return e}function s(t,e,r){"string"==typeof r&&""!==r||(r="utf8");var n=0|g(e,r);return t=b(t,n),t.write(e,r),t}function f(e,r){if(t.isBuffer(r))return c(e,r);if(G(r))return h(e,r);if(null==r)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(r.buffer instanceof ArrayBuffer)return u(e,r);if(r instanceof ArrayBuffer)return d(e,r)}return r.length?l(e,r):p(e,r)}function c(t,e){var r=0|v(e.length);return t=b(t,r),e.copy(t,0,0,r),t}function h(t,e){var r=0|v(e.length);t=b(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function u(t,e){var r=0|v(e.length);t=b(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(e,r){return t.TYPED_ARRAY_SUPPORT?(r.byteLength,e=t._augment(new Uint8Array(r))):e=u(e,new Uint8Array(r)),e}function l(t,e){var r=0|v(e.length);t=b(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t,e){var r,n=0;"Buffer"===e.type&&G(e.data)&&(r=e.data,n=0|v(r.length)),t=b(t,n);for(var i=0;i<n;i+=1)t[i]=255&r[i];return t}function b(e,r){t.TYPED_ARRAY_SUPPORT?(e=t._augment(new Uint8Array(r)),e.__proto__=t.prototype):(e.length=r,e._isBuffer=!0);var n=0!==r&&r<=t.poolSize>>>1;return n&&(e.parent=Z),e}function v(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function y(e,r){if(!(this instanceof y))return new y(e,r);var n=new t(e,r);return delete n.parent,n}function g(t,e){"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function m(t,e,r){var n=!1;if(e=0|e,r=void 0===r||r===1/0?this.length:0|r,t||(t="utf8"),e<0&&(e=0),r>this.length&&(r=this.length),r<=e)return"";for(;;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return B(this,e,r);case"binary":return R(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new Error("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;o++){var s=parseInt(e.substr(2*o,2),16);if(isNaN(s))throw new Error("Invalid hex string");t[r+o]=s}return o}function w(t,e,r,n){return W(F(e,t.length-r),t,r,n)}function S(t,e,r,n){return W(K(e),t,r,n)}function M(t,e,r,n){return S(t,e,r,n)}function E(t,e,r,n){return W(Y(e),t,r,n)}function k(t,e,r,n){return W(X(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?V.fromByteArray(t):V.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=r){var f,c,h,u;switch(s){case 1:a<128&&(o=a);break;case 2:f=t[i+1],128===(192&f)&&(u=(31&a)<<6|63&f,u>127&&(o=u));break;case 3:f=t[i+1],c=t[i+2],128===(192&f)&&128===(192&c)&&(u=(15&a)<<12|(63&f)<<6|63&c,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:f=t[i+1],c=t[i+2],h=t[i+3],128===(192&f)&&128===(192&c)&&128===(192&h)&&(u=(15&a)<<18|(63&f)<<12|(63&c)<<6|63&h,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return I(n)}function I(t){var e=t.length;if(e<=$)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=$));return r}function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;i++)n+=String.fromCharCode(127&t[i]);return n}function R(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;i++)n+=String.fromCharCode(t[i]);return n}function P(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a<r;a++)i+=H(t[a]);return i}function j(t,e,r){for(var n=t.slice(e,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function T(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(e,r,n,i,a,o){if(!t.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(r>a||r<o)throw new RangeError("value is out of bounds");if(n+i>e.length)throw new RangeError("index out of range")}function L(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-r,2);i<a;i++)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function O(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-r,4);i<a;i++)t[r+i]=e>>>8*(n?i:3-i)&255}function D(t,e,r,n,i,a){if(e>i||e<a)throw new RangeError("value is out of bounds");if(r+n>t.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function z(t,e,r,n,i){return i||D(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),J.write(t,e,r,n,23,4),r+4}function q(t,e,r,n,i){return i||D(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),J.write(t,e,r,n,52,8),r+8}function U(t){if(t=N(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function N(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;o<n;o++){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function K(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e}function X(t,e){for(var r,n,i,a=[],o=0;o<t.length&&!((e-=2)<0);o++)r=t.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function Y(t){return V.toByteArray(U(t))}function W(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);i++)e[i+r]=t[i];return i}var V=r(36),J=r(37),G=r(38);e.Buffer=t,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,t.poolSize=8192;var Z={};t.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:i(),t.TYPED_ARRAY_SUPPORT?(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array):(t.prototype.length=void 0,t.prototype.parent=void 0),t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,r){if(!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,a=0,o=Math.min(n,i);a<o&&e[a]===r[a];)++a;return a!==o&&(n=e[a],i=r[a]),n<i?-1:i<n?1:0},t.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(e,r){if(!G(e))throw new TypeError("list argument must be an Array of Buffers.");if(0===e.length)return new t(0);var n;if(void 0===r)for(r=0,n=0;n<e.length;n++)r+=e[n].length;var i=new t(r),a=0;for(n=0;n<e.length;n++){var o=e[n];o.copy(i,a),a+=o.length}return i},t.byteLength=g,t.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):m.apply(this,arguments)},t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===t.compare(this,e)},t.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},t.prototype.compare=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?0:t.compare(this,e)},t.prototype.indexOf=function(e,r){function n(t,e,r){for(var n=-1,i=0;r+i<t.length;i++)if(t[r+i]===e[n===-1?0:i-n]){if(n===-1&&(n=i),i-n+1===e.length)return r+n}else n=-1;return-1}if(r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r>>=0,0===this.length)return-1;if(r>=this.length)return-1;if(r<0&&(r=Math.max(this.length+r,0)),"string"==typeof e)return 0===e.length?-1:String.prototype.indexOf.call(this,e,r);if(t.isBuffer(e))return n(this,e,r);if("number"==typeof e)return t.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,r):n(this,[e],r);throw new TypeError("val must be string, number or Buffer")},t.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},t.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},t.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0);else{var i=n;n=e,e=0|r,r=i}var a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return _(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return S(this,t,e,r);case"binary":return M(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;t.prototype.slice=function(e,r){var n=this.length;e=~~e,r=void 0===r?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i;if(t.TYPED_ARRAY_SUPPORT)i=t._augment(this.subarray(e,r));else{var a=r-e;i=new t(a,(void 0));for(var o=0;o<a;o++)i[o]=this[o+e]}return i.length&&(i.parent=this.parent||this),i},t.prototype.readUIntLE=function(t,e,r){t=0|t,e=0|e,r||T(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},t.prototype.readUIntBE=function(t,e,r){t=0|t,e=0|e,r||T(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},t.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||T(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},t.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||T(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},t.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),J.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),J.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),J.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),J.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||C(this,t,e,r,Math.pow(2,8*r),0);var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},t.prototype.writeUIntBE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||C(this,t,e,r,Math.pow(2,8*r),0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},t.prototype.writeUInt8=function(e,r,n){return e=+e,r=0|r,n||C(this,e,r,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=255&e,r+1},t.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=0|r,n||C(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):L(this,e,r,!0),r+2},t.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=0|r,n||C(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):L(this,e,r,!1),r+2},t.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=0|r,n||C(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e):O(this,e,r,!0),r+4},t.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=0|r,n||C(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):O(this,e,r,!1),r+4},t.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var a=0,o=1,s=t<0?1:0;for(this[e]=255&t;++a<r&&(o*=256);)this[e+a]=(t/o>>0)-s&255;return e+r},t.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=t<0?1:0;for(this[e+a]=255&t;--a>=0&&(o*=256);)this[e+a]=(t/o>>0)-s&255;return e+r},t.prototype.writeInt8=function(e,r,n){return e=+e,r=0|r,n||C(this,e,r,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=255&e,r+1},t.prototype.writeInt16LE=function(e,r,n){return e=+e,r=0|r,n||C(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):L(this,e,r,!0),r+2},t.prototype.writeInt16BE=function(e,r,n){return e=+e,r=0|r,n||C(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):L(this,e,r,!1),r+2},t.prototype.writeInt32LE=function(e,r,n){return e=+e,r=0|r,n||C(this,e,r,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):O(this,e,r,!0),r+4},t.prototype.writeInt32BE=function(e,r,n){return e=+e,r=0|r,n||C(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):O(this,e,r,!1),r+4},t.prototype.writeFloatLE=function(t,e,r){return z(this,t,e,!0,r)},t.prototype.writeFloatBE=function(t,e,r){return z(this,t,e,!1,r)},t.prototype.writeDoubleLE=function(t,e,r){return q(this,t,e,!0,r)},t.prototype.writeDoubleBE=function(t,e,r){return q(this,t,e,!1,r)},t.prototype.copy=function(e,r,n,i){if(n||(n=0),i||0===i||(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);var a,o=i-n;if(this===e&&n<r&&r<i)for(a=o-1;a>=0;a--)e[a+r]=this[a+n];else if(o<1e3||!t.TYPED_ARRAY_SUPPORT)for(a=0;a<o;a++)e[a+r]=this[a+n];else e._set(this.subarray(n,n+o),r);return o},t.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),r<e)throw new RangeError("end < start");if(r!==e&&0!==this.length){if(e<0||e>=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var n;if("number"==typeof t)for(n=e;n<r;n++)this[n]=t;else{var i=F(t.toString()),a=i.length;for(n=e;n<r;n++)this[n]=i[n%a]}return this}},t.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(t.TYPED_ARRAY_SUPPORT)return new t(this).buffer;for(var e=new Uint8Array(this.length),r=0,n=e.length;r<n;r+=1)e[r]=this[r];return e.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var Q=t.prototype;t._augment=function(e){return e.constructor=t,e._isBuffer=!0,e._set=e.set,e.get=Q.get,e.set=Q.set,e.write=Q.write,e.toString=Q.toString,e.toLocaleString=Q.toString,e.toJSON=Q.toJSON,e.equals=Q.equals,e.compare=Q.compare,e.indexOf=Q.indexOf,e.copy=Q.copy,e.slice=Q.slice,e.readUIntLE=Q.readUIntLE,e.readUIntBE=Q.readUIntBE,e.readUInt8=Q.readUInt8,e.readUInt16LE=Q.readUInt16LE,e.readUInt16BE=Q.readUInt16BE,e.readUInt32LE=Q.readUInt32LE,e.readUInt32BE=Q.readUInt32BE,e.readIntLE=Q.readIntLE,e.readIntBE=Q.readIntBE,e.readInt8=Q.readInt8,e.readInt16LE=Q.readInt16LE,e.readInt16BE=Q.readInt16BE,e.readInt32LE=Q.readInt32LE,e.readInt32BE=Q.readInt32BE,e.readFloatLE=Q.readFloatLE,e.readFloatBE=Q.readFloatBE,e.readDoubleLE=Q.readDoubleLE,e.readDoubleBE=Q.readDoubleBE,e.writeUInt8=Q.writeUInt8,e.writeUIntLE=Q.writeUIntLE,e.writeUIntBE=Q.writeUIntBE,e.writeUInt16LE=Q.writeUInt16LE,e.writeUInt16BE=Q.writeUInt16BE,e.writeUInt32LE=Q.writeUInt32LE,e.writeUInt32BE=Q.writeUInt32BE,e.writeIntLE=Q.writeIntLE,e.writeIntBE=Q.writeIntBE,e.writeInt8=Q.writeInt8,e.writeInt16LE=Q.writeInt16LE,e.writeInt16BE=Q.writeInt16BE,e.writeInt32LE=Q.writeInt32LE,e.writeInt32BE=Q.writeInt32BE,e.writeFloatLE=Q.writeFloatLE,e.writeFloatBE=Q.writeFloatBE,e.writeDoubleLE=Q.writeDoubleLE,e.writeDoubleBE=Q.writeDoubleBE,e.fill=Q.fill,e.inspect=Q.inspect,e.toArrayBuffer=Q.toArrayBuffer,e};var tt=/[^+\/0-9A-Za-z-_]/g}).call(e,r(35).Buffer,function(){return this}())},function(t,e,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===o||e===u?62:e===s||e===d?63:e<f?-1:e<f+10?e-f+26+26:e<h+26?e-h:e<c+26?e-c+26:void 0}function r(t){function r(t){c[u++]=t}var n,i,o,s,f,c;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=t.length;f="="===t.charAt(h-2)?2:"="===t.charAt(h-1)?1:0,c=new a(3*t.length/4-f),o=f>0?t.length-4:t.length;var u=0;for(n=0,i=0;n<o;n+=4,i+=3)s=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&s)>>16),r((65280&s)>>8),r(255&s);return 2===f?(s=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&s)):1===f&&(s=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(s>>8&255),r(255&s)),c}function i(t){function e(t){return n.charAt(t)}function r(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,a,o,s=t.length%3,f="";for(i=0,o=t.length-s;i<o;i+=3)a=(t[i]<<16)+(t[i+1]<<8)+t[i+2],f+=r(a);switch(s){case 1:a=t[t.length-1],f+=e(a>>2),f+=e(a<<4&63),f+="==";break;case 2:a=(t[t.length-2]<<8)+t[t.length-1],f+=e(a>>10),f+=e(a>>4&63),f+=e(a<<2&63),f+="="}return f}var a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="+".charCodeAt(0),s="/".charCodeAt(0),f="0".charCodeAt(0),c="a".charCodeAt(0),h="A".charCodeAt(0),u="-".charCodeAt(0),d="_".charCodeAt(0);t.toByteArray=r,t.fromByteArray=i}(e)},function(t,e){e.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,f=(1<<s)-1,c=f>>1,h=-7,u=r?i-1:0,d=r?-1:1,l=t[e+u];for(u+=d,a=l&(1<<-h)-1,l>>=-h,h+=s;h>0;a=256*a+t[e+u],u+=d,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=n;h>0;o=256*o+t[e+u],u+=d,h-=8);if(0===a)a=1-c;else{if(a===f)return o?NaN:(l?-1:1)*(1/0);o+=Math.pow(2,n),a-=c}return(l?-1:1)*o*Math.pow(2,a-n)},e.write=function(t,e,r,n,i,a){var o,s,f,c=8*a-i-1,h=(1<<c)-1,u=h>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:a-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),e+=o+u>=1?d/f:d*Math.pow(2,1-u),e*f>=2&&(o++,f/=2),o+u>=h?(s=0,o=h):o+u>=1?(s=(e*f-1)*Math.pow(2,i),o+=u):(s=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;t[r+l]=255&s,l+=p,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;t[r+l]=255&o,l+=p,o/=256,c-=8);t[r+l-p]|=128*b}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){function r(){u&&c&&(u=!1,c.length?h=c.concat(h):d=-1,h.length&&n())}function n(){if(!u){var t=o.call(null,r);u=!0;for(var e=h.length;e;){for(c=h,h=[];++d<e;)c&&c[d].run();d=-1,e=h.length}c=null,u=!1,s.call(null,t)}}function i(t,e){this.fun=t,this.array=e}function a(){}var o,s,f=t.exports={};!function(){try{o=setTimeout}catch(t){o=function(){throw new Error("setTimeout is not defined")}}try{s=clearTimeout}catch(t){s=function(){throw new Error("clearTimeout is not defined")}}}();var c,h=[],u=!1,d=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new i(t,e)),1!==h.length||u||o.call(null,n,0)},i.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=a,f.addListener=a,f.once=a,f.off=a,f.removeListener=a,f.removeAllListeners=a,f.emit=a,f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e,r){(function(e){"use strict";function n(t){c.call(this,"digest"),this._hash=t,this.buffers=[]}function i(t){c.call(this,"digest"),this._hash=t}var a=r(41),o=r(42),s=r(44),f=r(45),c=r(53);a(n,c),n.prototype._update=function(t){this.buffers.push(t)},n.prototype._final=function(){var t=e.concat(this.buffers),r=this._hash(t);return this.buffers=null,r},a(i,c),i.prototype._update=function(t){this._hash.update(t)},i.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return t=t.toLowerCase(),"md5"===t?new n(o):"rmd160"===t||"ripemd160"===t?new n(s):new i(f(t))}}).call(e,r(35).Buffer)},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){"use strict";function n(t,e){t[e>>5]|=128<<e%32,t[(e+64>>>9<<4)+14]=e;for(var r=1732584193,n=-271733879,i=-1732584194,h=271733878,u=0;u<t.length;u+=16){var d=r,l=n,p=i,b=h;r=a(r,n,i,h,t[u+0],7,-680876936),h=a(h,r,n,i,t[u+1],12,-389564586),i=a(i,h,r,n,t[u+2],17,606105819),n=a(n,i,h,r,t[u+3],22,-1044525330),r=a(r,n,i,h,t[u+4],7,-176418897),h=a(h,r,n,i,t[u+5],12,1200080426),i=a(i,h,r,n,t[u+6],17,-1473231341),n=a(n,i,h,r,t[u+7],22,-45705983),r=a(r,n,i,h,t[u+8],7,1770035416),h=a(h,r,n,i,t[u+9],12,-1958414417),i=a(i,h,r,n,t[u+10],17,-42063),n=a(n,i,h,r,t[u+11],22,-1990404162),r=a(r,n,i,h,t[u+12],7,1804603682),h=a(h,r,n,i,t[u+13],12,-40341101),i=a(i,h,r,n,t[u+14],17,-1502002290),n=a(n,i,h,r,t[u+15],22,1236535329),r=o(r,n,i,h,t[u+1],5,-165796510),h=o(h,r,n,i,t[u+6],9,-1069501632),i=o(i,h,r,n,t[u+11],14,643717713),n=o(n,i,h,r,t[u+0],20,-373897302),r=o(r,n,i,h,t[u+5],5,-701558691),h=o(h,r,n,i,t[u+10],9,38016083),i=o(i,h,r,n,t[u+15],14,-660478335),n=o(n,i,h,r,t[u+4],20,-405537848),r=o(r,n,i,h,t[u+9],5,568446438),h=o(h,r,n,i,t[u+14],9,-1019803690),i=o(i,h,r,n,t[u+3],14,-187363961),n=o(n,i,h,r,t[u+8],20,1163531501),r=o(r,n,i,h,t[u+13],5,-1444681467),h=o(h,r,n,i,t[u+2],9,-51403784),i=o(i,h,r,n,t[u+7],14,1735328473),n=o(n,i,h,r,t[u+12],20,-1926607734),r=s(r,n,i,h,t[u+5],4,-378558),h=s(h,r,n,i,t[u+8],11,-2022574463),i=s(i,h,r,n,t[u+11],16,1839030562),n=s(n,i,h,r,t[u+14],23,-35309556),r=s(r,n,i,h,t[u+1],4,-1530992060),h=s(h,r,n,i,t[u+4],11,1272893353),i=s(i,h,r,n,t[u+7],16,-155497632),n=s(n,i,h,r,t[u+10],23,-1094730640),r=s(r,n,i,h,t[u+13],4,681279174),h=s(h,r,n,i,t[u+0],11,-358537222),i=s(i,h,r,n,t[u+3],16,-722521979),n=s(n,i,h,r,t[u+6],23,76029189),r=s(r,n,i,h,t[u+9],4,-640364487),h=s(h,r,n,i,t[u+12],11,-421815835),i=s(i,h,r,n,t[u+15],16,530742520),n=s(n,i,h,r,t[u+2],23,-995338651),r=f(r,n,i,h,t[u+0],6,-198630844),h=f(h,r,n,i,t[u+7],10,1126891415),i=f(i,h,r,n,t[u+14],15,-1416354905),n=f(n,i,h,r,t[u+5],21,-57434055),r=f(r,n,i,h,t[u+12],6,1700485571),h=f(h,r,n,i,t[u+3],10,-1894986606),i=f(i,h,r,n,t[u+10],15,-1051523),n=f(n,i,h,r,t[u+1],21,-2054922799),r=f(r,n,i,h,t[u+8],6,1873313359),h=f(h,r,n,i,t[u+15],10,-30611744),i=f(i,h,r,n,t[u+6],15,-1560198380),n=f(n,i,h,r,t[u+13],21,1309151649),r=f(r,n,i,h,t[u+4],6,-145523070),h=f(h,r,n,i,t[u+11],10,-1120210379),i=f(i,h,r,n,t[u+2],15,718787259),n=f(n,i,h,r,t[u+9],21,-343485551),r=c(r,d),n=c(n,l),i=c(i,p),h=c(h,b)}return Array(r,n,i,h)}function i(t,e,r,n,i,a){return c(h(c(c(e,t),c(n,a)),i),r)}function a(t,e,r,n,a,o,s){return i(e&r|~e&n,t,e,a,o,s)}function o(t,e,r,n,a,o,s){return i(e&n|r&~n,t,e,a,o,s)}function s(t,e,r,n,a,o,s){return i(e^r^n,t,e,a,o,s)}function f(t,e,r,n,a,o,s){return i(r^(e|~n),t,e,a,o,s)}function c(t,e){var r=(65535&t)+(65535&e),n=(t>>16)+(e>>16)+(r>>16);return n<<16|65535&r}function h(t,e){return t<<e|t>>>32-e}var u=r(43);t.exports=function(t){return u.hash(t,n,16)}},function(t,e,r){(function(t){"use strict";function r(e,r){if(e.length%a!==0){var n=e.length+(a-e.length%a);e=t.concat([e,o],n)}for(var i=[],s=r?e.readInt32BE:e.readInt32LE,f=0;f<e.length;f+=a)i.push(s.call(e,f));return i}function n(e,r,n){for(var i=new t(r),a=n?i.writeInt32BE:i.writeInt32LE,o=0;o<e.length;o++)a.call(i,e[o],4*o,!0);return i}function i(e,i,a,o){t.isBuffer(e)||(e=new t(e));var f=i(r(e,o),e.length*s);return n(f,a,o)}var a=4,o=new t(a);o.fill(0);var s=8;e.hash=i}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function r(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e}function n(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e}function i(t,e,r){for(var n=0;n<16;n++){var i=r+n,u=e[i];e[i]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}var g,m,_,w,S,M,E,k,A,x;M=g=t[0],E=m=t[1],k=_=t[2],A=w=t[3],x=S=t[4];var I;for(n=0;n<80;n+=1)I=g+e[r+d[n]]|0,I+=n<16?a(m,_,w)+v[0]:n<32?o(m,_,w)+v[1]:n<48?s(m,_,w)+v[2]:n<64?f(m,_,w)+v[3]:c(m,_,w)+v[4],I=0|I,I=h(I,p[n]),I=I+S|0,g=S,S=w,w=h(_,10),_=m,m=I,I=M+e[r+l[n]]|0,I+=n<16?c(E,k,A)+y[0]:n<32?f(E,k,A)+y[1]:n<48?s(E,k,A)+y[2]:n<64?o(E,k,A)+y[3]:a(E,k,A)+y[4],I=0|I,I=h(I,b[n]),I=I+x|0,M=x,x=A,A=h(k,10),k=E,E=I;I=t[1]+_+A|0,t[1]=t[2]+w+x|0,t[2]=t[3]+S+M|0,t[3]=t[4]+g+E|0,t[4]=t[0]+m+k|0,t[0]=I}function a(t,e,r){return t^e^r}function o(t,e,r){return t&e|~t&r}function s(t,e,r){return(t|~e)^r}function f(t,e,r){return t&r|e&~r}function c(t,e,r){return t^(e|~r)}function h(t,e){return t<<e|t>>>32-e}function u(t){var a=[1732584193,4023233417,2562383102,271733878,3285377520];"string"==typeof t&&(t=new e(t,"utf8"));var o=r(t),s=8*t.length,f=8*t.length;o[s>>>5]|=128<<24-s%32,o[(s+64>>>9<<4)+14]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8);for(var c=0;c<o.length;c+=16)i(a,o,c);for(c=0;c<5;c++){var h=a[c];a[c]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}var u=n(a);return new e(u)}/** @preserve
|
8
|
-
(c) 2012 by Cédric Mesnil. All rights reserved.
|
9
|
-
|
10
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
11
|
-
|
12
|
-
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
13
|
-
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
14
|
-
|
15
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
16
|
-
*/
|
17
|
-
var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],l=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],p=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],b=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],v=[0,1518500249,1859775393,2400959708,2840853838],y=[1352829926,1548603684,1836072691,2053994217,0];t.exports=u}).call(e,r(35).Buffer)},function(t,e,r){var e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};e.sha=r(46),e.sha1=r(48),e.sha224=r(49),e.sha256=r(50),e.sha384=r(51),e.sha512=r(52)},function(t,e,r){(function(e){function n(){this.init(),this._w=h,f.call(this,64,56)}function i(t){return t<<5|t>>>27}function a(t){return t<<30|t>>>2}function o(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}var s=r(41),f=r(47),c=[1518500249,1859775393,-1894007588,-899497514],h=new Array(80);s(n,f),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,s=0|this._c,f=0|this._d,h=0|this._e,u=0;u<16;++u)e[u]=t.readInt32BE(4*u);for(;u<80;++u)e[u]=e[u-3]^e[u-8]^e[u-14]^e[u-16];for(var d=0;d<80;++d){var l=~~(d/20),p=i(r)+o(l,n,s,f)+h+e[d]+c[l]|0;h=f,f=s,s=a(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=f+this._d|0,this._e=h+this._e|0},n.prototype._hash=function(){var t=new e(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=n}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function r(t,r){this._block=new e(t),this._finalSize=r,this._blockSize=t,this._len=0,this._s=0}r.prototype.update=function(t,r){"string"==typeof t&&(r=r||"utf8",t=new e(t,r));for(var n=this._len+=t.length,i=this._s||0,a=0,o=this._block;i<n;){for(var s=Math.min(t.length,a+this._blockSize-i%this._blockSize),f=s-a,c=0;c<f;c++)o[i%this._blockSize+c]=t[c+a];i+=f,a+=f,i%this._blockSize===0&&this._update(o)}return this._s=i,this},r.prototype.digest=function(t){var e=8*this._len;this._block[this._len%this._blockSize]=128,this._block.fill(0,this._len%this._blockSize+1),e%(8*this._blockSize)>=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(e,this._blockSize-4);var r=this._update(this._block)||this._hash();return t?r.toString(t):r},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(){this.init(),this._w=u,c.call(this,64,56)}function i(t){return t<<1|t>>>31}function a(t){return t<<5|t>>>27}function o(t){return t<<30|t>>>2}function s(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}var f=r(41),c=r(47),h=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);f(n,c),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,f=0|this._c,c=0|this._d,u=0|this._e,d=0;d<16;++d)e[d]=t.readInt32BE(4*d);for(;d<80;++d)e[d]=i(e[d-3]^e[d-8]^e[d-14]^e[d-16]);for(var l=0;l<80;++l){var p=~~(l/20),b=a(r)+s(p,n,f,c)+u+e[l]+h[p]|0;u=c,c=f,f=o(n),n=r,r=b}this._a=r+this._a|0,this._b=n+this._b|0,this._c=f+this._c|0,this._d=c+this._d|0,this._e=u+this._e|0},n.prototype._hash=function(){var t=new e(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=n}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(){this.init(),this._w=s,o.call(this,64,56)}var i=r(41),a=r(50),o=r(47),s=new Array(64);i(n,a),n.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},n.prototype._hash=function(){var t=new e(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=n}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(){this.init(),this._w=l,u.call(this,64,56)}function i(t,e,r){return r^t&(e^r)}function a(t,e,r){return t&e|r&(t|e)}function o(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function s(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function f(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function c(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}var h=r(41),u=r(47),d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],l=new Array(64);h(n,u),n.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},n.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,h=0|this._c,u=0|this._d,l=0|this._e,p=0|this._f,b=0|this._g,v=0|this._h,y=0;y<16;++y)e[y]=t.readInt32BE(4*y);for(;y<64;++y)e[y]=c(e[y-2])+e[y-7]+f(e[y-15])+e[y-16]|0;for(var g=0;g<64;++g){var m=v+s(l)+i(l,p,b)+d[g]+e[g]|0,_=o(r)+a(r,n,h)|0;v=b,b=p,p=l,l=u+m|0,u=h,h=n,n=r,r=m+_|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=h+this._c|0,this._d=u+this._d|0,this._e=l+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=v+this._h|0},n.prototype._hash=function(){var t=new e(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=n}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(){this.init(),this._w=s,o.call(this,128,112)}var i=r(41),a=r(52),o=r(47),s=new Array(160);i(n,a),n.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},n.prototype._hash=function(){function t(t,e,n){r.writeInt32BE(t,n),r.writeInt32BE(e,n+4)}var r=new e(48);return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),r},t.exports=n}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(){this.init(),this._w=v,p.call(this,128,112)}function i(t,e,r){return r^t&(e^r)}function a(t,e,r){return t&e|r&(t|e)}function o(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function s(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function f(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function c(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function h(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function u(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function d(t,e){return t>>>0<e>>>0?1:0}var l=r(41),p=r(47),b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],v=new Array(160);l(n,p),n.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},n.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,l=0|this._ch,p=0|this._dh,v=0|this._eh,y=0|this._fh,g=0|this._gh,m=0|this._hh,_=0|this._al,w=0|this._bl,S=0|this._cl,M=0|this._dl,E=0|this._el,k=0|this._fl,A=0|this._gl,x=0|this._hl,I=0;I<32;I+=2)e[I]=t.readInt32BE(4*I),e[I+1]=t.readInt32BE(4*I+4);for(;I<160;I+=2){var B=e[I-30],R=e[I-30+1],P=f(B,R),j=c(R,B);B=e[I-4],R=e[I-4+1];var T=h(B,R),C=u(R,B),L=e[I-14],O=e[I-14+1],D=e[I-32],z=e[I-32+1],q=j+O|0,U=P+L+d(q,j)|0;q=q+C|0,U=U+T+d(q,C)|0,q=q+z|0,U=U+D+d(q,z)|0,e[I]=U,e[I+1]=q}for(var N=0;N<160;N+=2){U=e[N],q=e[N+1];var H=a(r,n,l),F=a(_,w,S),K=o(r,_),X=o(_,r),Y=s(v,E),W=s(E,v),V=b[N],J=b[N+1],G=i(v,y,g),Z=i(E,k,A),$=x+W|0,Q=m+Y+d($,x)|0;$=$+Z|0,Q=Q+G+d($,Z)|0,$=$+J|0,Q=Q+V+d($,J)|0,$=$+q|0,Q=Q+U+d($,q)|0;var tt=X+F|0,et=K+H+d(tt,X)|0;m=g,x=A,g=y,A=k,y=v,k=E,E=M+$|0,v=p+Q+d(E,M)|0,p=l,M=S,l=n,S=w,n=r,w=_,_=$+tt|0,r=Q+et+d(_,$)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+S|0,this._dl=this._dl+M|0,this._el=this._el+E|0,this._fl=this._fl+k|0,this._gl=this._gl+A|0,this._hl=this._hl+x|0,this._ah=this._ah+r+d(this._al,_)|0,this._bh=this._bh+n+d(this._bl,w)|0,this._ch=this._ch+l+d(this._cl,S)|0,this._dh=this._dh+p+d(this._dl,M)|0,this._eh=this._eh+v+d(this._el,E)|0,this._fh=this._fh+y+d(this._fl,k)|0,this._gh=this._gh+g+d(this._gl,A)|0,this._hh=this._hh+m+d(this._hl,x)|0},n.prototype._hash=function(){function t(t,e,n){r.writeInt32BE(t,n),r.writeInt32BE(e,n+4)}var r=new e(64);return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),r},t.exports=n}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this["final"]=this._finalOrDigest,this._decoder=null,this._encoding=null}var i=r(54).Transform,a=r(41),o=r(60).StringDecoder;t.exports=n,a(n,i),n.prototype.update=function(t,r,n){"string"==typeof t&&(t=new e(t,r));var i=this._update(t);return this.hashMode?this:(n&&(i=this._toString(i,n)),i)},n.prototype.setAutoPadding=function(){},n.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},n.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},n.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},n.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){n=i}finally{r(n)}},n.prototype._flush=function(t){var e;try{this.push(this._final())}catch(r){e=r}finally{t(e)}},n.prototype._finalOrDigest=function(t){var r=this._final()||new e("");return t&&(r=this._toString(r,t,!0)),r},n.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n}}).call(e,r(35).Buffer)},function(t,e,r){function n(){i.call(this)}t.exports=n;var i=r(55).EventEmitter,a=r(41);a(n,i),n.Readable=r(56),n.Writable=r(65),n.Duplex=r(66),n.Transform=r(67),n.PassThrough=r(68),n.Stream=n,n.prototype.pipe=function(t,e){function r(e){t.writable&&!1===t.write(e)&&c.pause&&c.pause()}function n(){c.readable&&c.resume&&c.resume()}function a(){h||(h=!0,t.end())}function o(){h||(h=!0,"function"==typeof t.destroy&&t.destroy())}function s(t){if(f(),0===i.listenerCount(this,"error"))throw t}function f(){c.removeListener("data",r),t.removeListener("drain",n),c.removeListener("end",a),c.removeListener("close",o),c.removeListener("error",s),t.removeListener("error",s),c.removeListener("end",f),c.removeListener("close",f),t.removeListener("close",f)}var c=this;c.on("data",r),t.on("drain",n),t._isStdio||e&&e.end===!1||(c.on("end",a),c.on("close",o));var h=!1;return c.on("error",s),t.on("error",s),c.on("end",f),c.on("close",f),t.on("close",f),t.emit("pipe",c),t}},function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function i(t){return"number"==typeof t}function a(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!i(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,i,s,f,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;var h=new Error('Uncaught, unspecified "error" event. ('+e+")");throw h.context=e,h}if(r=this._events[t],o(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(a(r))for(s=Array.prototype.slice.call(arguments,1),c=r.slice(),i=c.length,f=0;f<i;f++)c[f].apply(this,s);return!0},r.prototype.addListener=function(t,e){var i;if(!n(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(e.listener)?e.listener:e),this._events[t]?a(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,a(this._events[t])&&!this._events[t].warned&&(i=o(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),i||(i=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var i=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,i,o,s;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,i=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){i=s;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],n(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,r){e=t.exports=r(57),e.Readable=e,e.Writable=r(61),e.Duplex=r(62),e.Transform=r(63),e.PassThrough=r(64)},function(t,e,r){(function(e){function n(t,e){t=t||{};var n=t.highWaterMark;this.highWaterMark=n||0===n?n:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(I||(I=r(60).StringDecoder),this.decoder=new I(t.encoding),this.encoding=t.encoding)}function i(t){return this instanceof i?(this._readableState=new n(t,this),this.readable=!0,void A.call(this)):new i(t)}function a(t,e,r,n,i){var a=c(e,r);if(a)t.emit("error",a);else if(null===r||void 0===r)e.reading=!1,e.ended||h(t,e);else if(e.objectMode||r&&r.length>0)if(e.ended&&!i){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&i){var s=new Error("stream.unshift() after end event");t.emit("error",s)}else!e.decoder||i||n||(r=e.decoder.write(r)),e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):(e.reading=!1,e.buffer.push(r)),e.needReadable&&u(t),l(t,e);else i||(e.reading=!1);return o(e)}function o(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}function s(t){if(t>=B)t=B;else{t--;for(var e=1;e<32;e<<=1)t|=t>>e;t++}return t}function f(t,e){return 0===e.length&&e.ended?0:e.objectMode?0===t?0:1:isNaN(t)||null===t?e.flowing&&e.buffer.length?e.buffer[0].length:e.length:t<=0?0:(t>e.highWaterMark&&(e.highWaterMark=s(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function c(t,e){var r=null;return E.isBuffer(e)||"string"==typeof e||null===e||void 0===e||t.objectMode||r||(r=new TypeError("Invalid non-string/buffer chunk")),r}function h(t,e){if(e.decoder&&!e.ended){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.length>0?u(t):_(t)}function u(t){var r=t._readableState;r.needReadable=!1,r.emittedReadable||(r.emittedReadable=!0,r.sync?e.nextTick(function(){d(t)}):d(t))}function d(t){t.emit("readable")}function l(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(function(){p(t,r)}))}function p(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function b(t){return function(){var e=t._readableState;e.awaitDrain--,0===e.awaitDrain&&v(t)}}function v(t){function e(t,e,i){var a=t.write(r);!1===a&&n.awaitDrain++}var r,n=t._readableState;for(n.awaitDrain=0;n.pipesCount&&null!==(r=t.read());)if(1===n.pipesCount?e(n.pipes,0,null):w(n.pipes,e),t.emit("data",r),n.awaitDrain>0)return;return 0===n.pipesCount?(n.flowing=!1,void(k.listenerCount(t,"data")>0&&g(t))):void(n.ranOut=!0)}function y(){this._readableState.ranOut&&(this._readableState.ranOut=!1,v(this))}function g(t,r){var n=t._readableState;if(n.flowing)throw new Error("Cannot switch to old mode now.");var i=r||!1,a=!1;t.readable=!0,t.pipe=A.prototype.pipe,t.on=t.addListener=A.prototype.on,t.on("readable",function(){a=!0;for(var e;!i&&null!==(e=t.read());)t.emit("data",e);null===e&&(a=!1,t._readableState.needReadable=!0)}),t.pause=function(){i=!0,this.emit("pause")},t.resume=function(){i=!1,a?e.nextTick(function(){t.emit("readable")}):this.read(0),this.emit("resume")},t.emit("readable")}function m(t,e){var r,n=e.buffer,i=e.length,a=!!e.decoder,o=!!e.objectMode;if(0===n.length)return null;if(0===i)r=null;else if(o)r=n.shift();else if(!t||t>=i)r=a?n.join(""):E.concat(n,i),n.length=0;else if(t<n[0].length){var s=n[0];r=s.slice(0,t),n[0]=s.slice(t)}else if(t===n[0].length)r=n.shift();else{r=a?"":new E(t);for(var f=0,c=0,h=n.length;c<h&&f<t;c++){var s=n[0],u=Math.min(t-f,s.length);a?r+=s.slice(0,u):s.copy(r,f,0,u),u<s.length?n[0]=s.slice(u):n.shift(),f+=u}}return r}function _(t){var r=t._readableState;if(r.length>0)throw new Error("endReadable called on non-empty stream");!r.endEmitted&&r.calledRead&&(r.ended=!0,e.nextTick(function(){r.endEmitted||0!==r.length||(r.endEmitted=!0,t.readable=!1,t.emit("end"))}))}function w(t,e){for(var r=0,n=t.length;r<n;r++)e(t[r],r)}function S(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}t.exports=i;var M=r(58),E=r(35).Buffer;i.ReadableState=n;var k=r(55).EventEmitter;k.listenerCount||(k.listenerCount=function(t,e){return t.listeners(e).length});var A=r(54),x=r(59);x.inherits=r(41);var I;x.inherits(i,A),i.prototype.push=function(t,e){var r=this._readableState;return"string"!=typeof t||r.objectMode||(e=e||r.defaultEncoding,e!==r.encoding&&(t=new E(t,e),e="")),a(this,r,t,e,!1)},i.prototype.unshift=function(t){var e=this._readableState;return a(this,e,t,"",!0)},i.prototype.setEncoding=function(t){I||(I=r(60).StringDecoder),this._readableState.decoder=new I(t),this._readableState.encoding=t};var B=8388608;i.prototype.read=function(t){var e=this._readableState;e.calledRead=!0;var r=t;if(("number"!=typeof t||t>0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return u(this),null;if(t=f(t,e),0===t&&e.ended)return 0===e.length&&_(this),null;var n=e.needReadable;e.length-t<=e.highWaterMark&&(n=!0),(e.ended||e.reading)&&(n=!1),n&&(e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1),n&&!e.reading&&(t=f(r,e));var i;return i=t>0?m(t,e):null,null===i&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),e.ended&&!e.endEmitted&&0===e.length&&_(this),i},i.prototype._read=function(t){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(t,r){function n(t){t===h&&a()}function i(){t.end()}function a(){t.removeListener("close",s),t.removeListener("finish",f),t.removeListener("drain",p),t.removeListener("error",o),t.removeListener("unpipe",n),h.removeListener("end",i),h.removeListener("end",a),t._writableState&&!t._writableState.needDrain||p()}function o(e){c(),t.removeListener("error",o),0===k.listenerCount(t,"error")&&t.emit("error",e)}function s(){t.removeListener("finish",f),c()}function f(){t.removeListener("close",s),c()}function c(){h.unpipe(t)}var h=this,u=this._readableState;switch(u.pipesCount){case 0:u.pipes=t;break;case 1:u.pipes=[u.pipes,t];break;default:u.pipes.push(t)}u.pipesCount+=1;var d=(!r||r.end!==!1)&&t!==e.stdout&&t!==e.stderr,l=d?i:a;u.endEmitted?e.nextTick(l):h.once("end",l),t.on("unpipe",n);var p=b(h);return t.on("drain",p),t._events&&t._events.error?M(t._events.error)?t._events.error.unshift(o):t._events.error=[o,t._events.error]:t.on("error",o),t.once("close",s),t.once("finish",f),t.emit("pipe",h),u.flowing||(this.on("readable",y),u.flowing=!0,e.nextTick(function(){v(h)})),t},i.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,this.removeListener("readable",y),e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,this.removeListener("readable",y),e.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}var i=S(e.pipes,t);return i===-1?this:(e.pipes.splice(i,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this),this)},i.prototype.on=function(t,e){var r=A.prototype.on.call(this,t,e);if("data"!==t||this._readableState.flowing||g(this),"readable"===t&&this.readable){var n=this._readableState;n.readableListening||(n.readableListening=!0,n.emittedReadable=!1,n.needReadable=!0,n.reading?n.length&&u(this,n):this.read(0))}return r},i.prototype.addListener=i.prototype.on,i.prototype.resume=function(){g(this),this.read(0),this.emit("resume")},i.prototype.pause=function(){g(this,!0),this.emit("pause")},i.prototype.wrap=function(t){var e=this._readableState,r=!1,n=this;t.on("end",function(){if(e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&n.push(t)}n.push(null)}),t.on("data",function(i){if(e.decoder&&(i=e.decoder.write(i)),i&&(e.objectMode||i.length)){var a=n.push(i);a||(r=!0,t.pause())}});for(var i in t)"function"==typeof t[i]&&"undefined"==typeof this[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));var a=["error","close","destroy","pause","resume"];return w(a,function(e){t.on(e,n.emit.bind(n,e))}),n._read=function(e){r&&(r=!1,t.resume())},n},i._fromList=m}).call(e,r(39))},function(t,e){t.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},function(t,e,r){(function(t){function r(t){return Array.isArray?Array.isArray(t):"[object Array]"===v(t)}function n(t){return"boolean"==typeof t}function i(t){return null===t}function a(t){return null==t}function o(t){return"number"==typeof t}function s(t){return"string"==typeof t}function f(t){return"symbol"==typeof t}function c(t){return void 0===t}function h(t){return"[object RegExp]"===v(t)}function u(t){return"object"==typeof t&&null!==t}function d(t){return"[object Date]"===v(t)}function l(t){return"[object Error]"===v(t)||t instanceof Error}function p(t){return"function"==typeof t}function b(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function v(t){return Object.prototype.toString.call(t)}e.isArray=r,e.isBoolean=n,e.isNull=i,e.isNullOrUndefined=a,e.isNumber=o,e.isString=s,e.isSymbol=f,e.isUndefined=c,e.isRegExp=h,e.isObject=u,e.isDate=d,e.isError=l,e.isFunction=p,e.isPrimitive=b,e.isBuffer=t.isBuffer}).call(e,r(35).Buffer)},function(t,e,r){function n(t){if(t&&!f(t))throw new Error("Unknown encoding: "+t)}function i(t){return t.toString(this.encoding)}function a(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function o(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}var s=r(35).Buffer,f=s.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},c=e.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),n(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=a;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=i)}this.charBuffer=new s(6),this.charReceived=0,this.charLength=0};c.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";t=t.slice(r,t.length),e=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var n=e.charCodeAt(e.length-1);if(!(n>=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),e+=t.toString(this.encoding,0,i);var i=e.length-1,n=e.charCodeAt(i);if(n>=55296&&n<=56319){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),t.copy(this.charBuffer,0,0,a),e.substring(0,i)}return e},c.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},c.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},function(t,e,r){(function(e){function n(t,e,r){this.chunk=t,this.encoding=e,this.callback=r}function i(t,e){t=t||{};var r=t.highWaterMark;this.highWaterMark=r||0===r?r:16384,this.objectMode=!!t.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){l(e,t)},this.writecb=null,this.writelen=0,this.buffer=[],this.errorEmitted=!1}function a(t){var e=r(62);return this instanceof a||this instanceof e?(this._writableState=new i(t,this),this.writable=!0,void S.call(this)):new a(t)}function o(t,r,n){var i=new Error("write after end");t.emit("error",i),e.nextTick(function(){n(i)})}function s(t,r,n,i){var a=!0;if(!_.isBuffer(n)&&"string"!=typeof n&&null!==n&&void 0!==n&&!r.objectMode){var o=new TypeError("Invalid non-string/buffer chunk");t.emit("error",o),e.nextTick(function(){i(o)}),a=!1}return a}function f(t,e,r){return t.objectMode||t.decodeStrings===!1||"string"!=typeof e||(e=new _(e,r)),e}function c(t,e,r,i,a){r=f(e,r,i),_.isBuffer(r)&&(i="buffer");var o=e.objectMode?1:r.length;e.length+=o;var s=e.length<e.highWaterMark;return s||(e.needDrain=!0),e.writing?e.buffer.push(new n(r,i,a)):h(t,e,o,r,i,a),s}function h(t,e,r,n,i,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,t._write(n,i,e.onwrite),e.sync=!1}function u(t,r,n,i,a){n?e.nextTick(function(){a(i)}):a(i),t._writableState.errorEmitted=!0,t.emit("error",i)}function d(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function l(t,r){var n=t._writableState,i=n.sync,a=n.writecb;if(d(n),r)u(t,n,i,r,a);else{var o=y(t,n);o||n.bufferProcessing||!n.buffer.length||v(t,n),i?e.nextTick(function(){p(t,n,o,a)}):p(t,n,o,a)}}function p(t,e,r,n){r||b(t,e),n(),r&&g(t,e)}function b(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,
|
18
|
-
t.emit("drain"))}function v(t,e){e.bufferProcessing=!0;for(var r=0;r<e.buffer.length;r++){var n=e.buffer[r],i=n.chunk,a=n.encoding,o=n.callback,s=e.objectMode?1:i.length;if(h(t,e,s,i,a,o),e.writing){r++;break}}e.bufferProcessing=!1,r<e.buffer.length?e.buffer=e.buffer.slice(r):e.buffer.length=0}function y(t,e){return e.ending&&0===e.length&&!e.finished&&!e.writing}function g(t,e){var r=y(t,e);return r&&(e.finished=!0,t.emit("finish")),r}function m(t,r,n){r.ending=!0,g(t,r),n&&(r.finished?e.nextTick(n):t.once("finish",n)),r.ended=!0}t.exports=a;var _=r(35).Buffer;a.WritableState=i;var w=r(59);w.inherits=r(41);var S=r(54);w.inherits(a,S),a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},a.prototype.write=function(t,e,r){var n=this._writableState,i=!1;return"function"==typeof e&&(r=e,e=null),_.isBuffer(t)?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=function(){}),n.ended?o(this,n,r):s(this,n,t,r)&&(i=c(this,n,t,e,r)),i},a.prototype._write=function(t,e,r){r(new Error("not implemented"))},a.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),"undefined"!=typeof t&&null!==t&&this.write(t,e),n.ending||n.finished||m(this,n,r)}}).call(e,r(39))},function(t,e,r){(function(e){function n(t){return this instanceof n?(f.call(this,t),c.call(this,t),t&&t.readable===!1&&(this.readable=!1),t&&t.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,t&&t.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",i)):new n(t)}function i(){this.allowHalfOpen||this._writableState.ended||e.nextTick(this.end.bind(this))}function a(t,e){for(var r=0,n=t.length;r<n;r++)e(t[r],r)}t.exports=n;var o=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e},s=r(59);s.inherits=r(41);var f=r(57),c=r(61);s.inherits(n,f),a(o(c.prototype),function(t){n.prototype[t]||(n.prototype[t]=c.prototype[t])})}).call(e,r(39))},function(t,e,r){function n(t,e){this.afterTransform=function(t,r){return i(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function i(t,e,r){var n=t._transformState;n.transforming=!1;var i=n.writecb;if(!i)return t.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!==r&&void 0!==r&&t.push(r),i&&i(e);var a=t._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&t._read(a.highWaterMark)}function a(t){if(!(this instanceof a))return new a(t);s.call(this,t);var e=(this._transformState=new n(t,this),this);this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("finish",function(){"function"==typeof this._flush?this._flush(function(t){o(e,t)}):o(e)})}function o(t,e){if(e)return t.emit("error",e);var r=t._writableState,n=(t._readableState,t._transformState);if(r.length)throw new Error("calling transform done when ws.length != 0");if(n.transforming)throw new Error("calling transform done when still transforming");return t.push(null)}t.exports=a;var s=r(62),f=r(59);f.inherits=r(41),f.inherits(a,s),a.prototype.push=function(t,e){return this._transformState.needTransform=!1,s.prototype.push.call(this,t,e)},a.prototype._transform=function(t,e,r){throw new Error("not implemented")},a.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0}},function(t,e,r){function n(t){return this instanceof n?void i.call(this,t):new n(t)}t.exports=n;var i=r(63),a=r(59);a.inherits=r(41),a.inherits(n,i),n.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){t.exports=r(61)},function(t,e,r){t.exports=r(62)},function(t,e,r){t.exports=r(63)},function(t,e,r){t.exports=r(64)},function(t,e,r){(function(e){"use strict";function n(t,r){o.call(this),t=t.toLowerCase(),"string"==typeof r&&(r=new e(r));var n="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=r,r.length>n?r=i(t).update(r).digest():r.length<n&&(r=e.concat([r,s],n));for(var a=this._ipad=new e(n),f=this._opad=new e(n),c=0;c<n;c++)a[c]=54^r[c],f[c]=92^r[c];this._hash=i(t).update(a)}var i=r(40),a=r(41),o=r(54).Transform,s=new e(128);s.fill(0),a(n,o),n.prototype.update=function(t,e){return this._hash.update(t,e),this},n.prototype._transform=function(t,e,r){this._hash.update(t),r()},n.prototype._flush=function(t){this.push(this.digest()),t()},n.prototype.digest=function(t){var e=this._hash.digest();return i(this._alg).update(this._opad).update(e).digest(t)},t.exports=function(t,e){return new n(t,e)}}).call(e,r(35).Buffer)},function(t,e,r){(function(t){"use strict";e["RSA-SHA224"]=e.sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:new t("302d300d06096086480165030402040500041c","hex")},e["RSA-SHA256"]=e.sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:new t("3031300d060960864801650304020105000420","hex")},e["RSA-SHA384"]=e.sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:new t("3041300d060960864801650304020205000430","hex")},e["RSA-SHA512"]=e.sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:new t("3051300d060960864801650304020305000440","hex")},e["RSA-SHA1"]={sign:"rsa",hash:"sha1",id:new t("3021300906052b0e03021a05000414","hex")},e["ecdsa-with-SHA1"]={sign:"ecdsa",hash:"sha1",id:new t("","hex")},e.DSA=e["DSA-SHA1"]=e["DSA-SHA"]={sign:"dsa",hash:"sha1",id:new t("","hex")},e["DSA-SHA224"]=e["DSA-WITH-SHA224"]={sign:"dsa",hash:"sha224",id:new t("","hex")},e["DSA-SHA256"]=e["DSA-WITH-SHA256"]={sign:"dsa",hash:"sha256",id:new t("","hex")},e["DSA-SHA384"]=e["DSA-WITH-SHA384"]={sign:"dsa",hash:"sha384",id:new t("","hex")},e["DSA-SHA512"]=e["DSA-WITH-SHA512"]={sign:"dsa",hash:"sha512",id:new t("","hex")},e["DSA-RIPEMD160"]={sign:"dsa",hash:"rmd160",id:new t("","hex")},e["RSA-RIPEMD160"]=e.ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:new t("3021300906052b2403020105000414","hex")},e["RSA-MD5"]=e.md5WithRSAEncryption={sign:"rsa",hash:"md5",id:new t("3020300c06082a864886f70d020505000410","hex")}}).call(e,r(35).Buffer)},function(t,e,r){(function(t){function n(t,e,r,n,a,o){if("function"==typeof a&&(o=a,a=void 0),"function"!=typeof o)throw new Error("No callback provided to pbkdf2");var s=i(t,e,r,n,a);setTimeout(function(){o(void 0,s)})}function i(e,r,n,i,s){if("number"!=typeof n)throw new TypeError("Iterations not a number");if(n<0)throw new TypeError("Bad iterations");if("number"!=typeof i)throw new TypeError("Key length not a number");if(i<0||i>o)throw new TypeError("Bad key length");s=s||"sha1",t.isBuffer(e)||(e=new t(e,"binary")),t.isBuffer(r)||(r=new t(r,"binary"));var f,c=1,h=new t(i),u=new t(r.length+4);r.copy(u,0,0,r.length);for(var d,l,p=1;p<=c;p++){u.writeUInt32BE(p,r.length);var b=a(s,e).update(u).digest();f||(f=b.length,l=new t(f),c=Math.ceil(i/f),d=i-(c-1)*f),b.copy(l,0,0,f);for(var v=1;v<n;v++){b=a(s,e).update(b).digest();for(var y=0;y<f;y++)l[y]^=b[y]}var g=(p-1)*f,m=p===c?d:f;l.copy(h,g,0,m)}return h}var a=r(69),o=Math.pow(2,30)-1;e.pbkdf2=n,e.pbkdf2Sync=i}).call(e,r(35).Buffer)},function(t,e,r){function n(t,e){var r,n;if(t=t.toLowerCase(),d[t])r=d[t].key,n=d[t].iv;else{if(!u[t])throw new TypeError("invalid suite type");r=8*u[t].key,n=u[t].iv}var i=f(e,!1,r,n);return a(t,i.key,i.iv)}function i(t,e){var r,n;if(t=t.toLowerCase(),d[t])r=d[t].key,n=d[t].iv;else{if(!u[t])throw new TypeError("invalid suite type");r=8*u[t].key,n=u[t].iv}var i=f(e,!1,r,n);return o(t,i.key,i.iv)}function a(t,e,r){if(t=t.toLowerCase(),d[t])return c.createCipheriv(t,e,r);if(u[t])return new h({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function o(t,e,r){if(t=t.toLowerCase(),d[t])return c.createDecipheriv(t,e,r);if(u[t])return new h({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}function s(){return Object.keys(u).concat(c.getCiphers())}var f=r(73),c=r(74),h=r(90),u=r(98),d=r(77);e.createCipher=e.Cipher=n,e.createCipheriv=e.Cipheriv=a,e.createDecipher=e.Decipher=i,e.createDecipheriv=e.Decipheriv=o,e.listCiphers=e.getCiphers=s},function(t,e,r){(function(e){function n(t,r,n,a){e.isBuffer(t)||(t=new e(t,"binary")),r&&!e.isBuffer(r)&&(r=new e(r,"binary")),n/=8,a=a||0;for(var o,s,f=0,c=0,h=new e(n),u=new e(a),d=0,l=[];;){if(d++>0&&l.push(o),l.push(t),r&&l.push(r),o=i(e.concat(l)),l=[],s=0,n>0)for(;;){if(0===n)break;if(s===o.length)break;h[f++]=o[s],n--,s++}if(a>0&&s!==o.length)for(;;){if(0===a)break;if(s===o.length)break;u[c++]=o[s],a--,s++}if(0===n&&0===a)break}for(s=0;s<o.length;s++)o[s]=0;return{key:h,iv:u}}var i=r(42);t.exports=n}).call(e,r(35).Buffer)},function(t,e,r){function n(){return Object.keys(o)}var i=r(75);e.createCipher=e.Cipher=i.createCipher,e.createCipheriv=e.Cipheriv=i.createCipheriv;var a=r(89);e.createDecipher=e.Decipher=a.createDecipher,e.createDecipheriv=e.Decipheriv=a.createDecipheriv;var o=r(77);e.listCiphers=e.getCiphers=n},function(t,e,r){(function(t){function n(e,r,a){return this instanceof n?(f.call(this),this._cache=new i,this._cipher=new s.AES(r),this._prev=new t(a.length),a.copy(this._prev),this._mode=e,void(this._autopadding=!0)):new n(e,r,a)}function i(){return this instanceof i?void(this.cache=new t("")):new i}function a(e,r,i){var a=h[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof i&&(i=new t(i)),"string"==typeof r&&(r=new t(r)),r.length!==a.key/8)throw new TypeError("invalid key length "+r.length);if(i.length!==a.iv)throw new TypeError("invalid iv length "+i.length);return"stream"===a.type?new d(p[a.mode],r,i):"auth"===a.type?new l(p[a.mode],r,i):new n(p[a.mode],r,i)}function o(t,e){var r=h[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=u(e,!1,r.key,r.iv);return a(t,n.key,n.iv)}var s=r(76),f=r(53),c=r(41),h=r(77),u=r(73),d=r(78),l=r(79);c(n,f),n.prototype._update=function(e){this._cache.add(e);for(var r,n,i=[];r=this._cache.get();)n=this._mode.encrypt(this,r),i.push(n);return t.concat(i)},n.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if("10101010101010101010101010101010"!==t.toString("hex"))throw this._cipher.scrub(),new Error("data not multiple of block length")},n.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},i.prototype.add=function(e){this.cache=t.concat([this.cache,e])},i.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},i.prototype.flush=function(){for(var e=16-this.cache.length,r=new t(e),n=-1;++n<e;)r.writeUInt8(e,n);var i=t.concat([this.cache,r]);return i};var p={ECB:r(82),CBC:r(83),CFB:r(84),CFB8:r(85),CFB1:r(86),OFB:r(87),CTR:r(88),GCM:r(88)};e.createCipheriv=a,e.createCipher=o}).call(e,r(35).Buffer)},function(t,e,r){(function(t){function r(t){var e,r;return e=t>s||t<0?(r=Math.abs(t)%s,t<0?s-r:r):t}function n(t){for(var e=0;e<t.length;t++)t[e]=0;return!1}function i(){this.SBOX=[],this.INV_SBOX=[],this.SUB_MIX=[[],[],[],[]],this.INV_SUB_MIX=[[],[],[],[]],this.init(),this.RCON=[0,1,2,4,8,16,32,64,128,27,54]}function a(t){for(var e=t.length/4,r=new Array(e),n=-1;++n<e;)r[n]=t.readUInt32BE(4*n);return r}function o(t){this._key=a(t),this._doReset()}var s=Math.pow(2,32);i.prototype.init=function(){var t,e,r,n,i,a,o,s,f,c;for(t=function(){var t,r;for(r=[],e=t=0;t<256;e=++t)e<128?r.push(e<<1):r.push(e<<1^283);return r}(),i=0,f=0,e=c=0;c<256;e=++c)r=f^f<<1^f<<2^f<<3^f<<4,r=r>>>8^255&r^99,this.SBOX[i]=r,this.INV_SBOX[r]=i,a=t[i],o=t[a],s=t[o],n=257*t[r]^16843008*r,this.SUB_MIX[0][i]=n<<24|n>>>8,this.SUB_MIX[1][i]=n<<16|n>>>16,this.SUB_MIX[2][i]=n<<8|n>>>24,this.SUB_MIX[3][i]=n,n=16843009*s^65537*o^257*a^16843008*i,this.INV_SUB_MIX[0][r]=n<<24|n>>>8,this.INV_SUB_MIX[1][r]=n<<16|n>>>16,this.INV_SUB_MIX[2][r]=n<<8|n>>>24,this.INV_SUB_MIX[3][r]=n,0===i?i=f=1:(i=a^t[t[t[s^a]]],f^=t[t[f]]);return!0};var f=new i;o.blockSize=16,o.prototype.blockSize=o.blockSize,o.keySize=32,o.prototype.keySize=o.keySize,o.prototype._doReset=function(){var t,e,r,n,i,a;for(r=this._key,e=r.length,this._nRounds=e+6,i=4*(this._nRounds+1),this._keySchedule=[],n=0;n<i;n++)this._keySchedule[n]=n<e?r[n]:(a=this._keySchedule[n-1],n%e===0?(a=a<<8|a>>>24,a=f.SBOX[a>>>24]<<24|f.SBOX[a>>>16&255]<<16|f.SBOX[a>>>8&255]<<8|f.SBOX[255&a],a^=f.RCON[n/e|0]<<24):e>6&&n%e===4?a=f.SBOX[a>>>24]<<24|f.SBOX[a>>>16&255]<<16|f.SBOX[a>>>8&255]<<8|f.SBOX[255&a]:void 0,this._keySchedule[n-e]^a);for(this._invKeySchedule=[],t=0;t<i;t++)n=i-t,a=this._keySchedule[n-(t%4?0:4)],this._invKeySchedule[t]=t<4||n<=4?a:f.INV_SUB_MIX[0][f.SBOX[a>>>24]]^f.INV_SUB_MIX[1][f.SBOX[a>>>16&255]]^f.INV_SUB_MIX[2][f.SBOX[a>>>8&255]]^f.INV_SUB_MIX[3][f.SBOX[255&a]];return!0},o.prototype.encryptBlock=function(e){e=a(new t(e));var r=this._doCryptBlock(e,this._keySchedule,f.SUB_MIX,f.SBOX),n=new t(16);return n.writeUInt32BE(r[0],0),n.writeUInt32BE(r[1],4),n.writeUInt32BE(r[2],8),n.writeUInt32BE(r[3],12),n},o.prototype.decryptBlock=function(e){e=a(new t(e));var r=[e[3],e[1]];e[1]=r[0],e[3]=r[1];var n=this._doCryptBlock(e,this._invKeySchedule,f.INV_SUB_MIX,f.INV_SBOX),i=new t(16);return i.writeUInt32BE(n[0],0),i.writeUInt32BE(n[3],4),i.writeUInt32BE(n[2],8),i.writeUInt32BE(n[1],12),i},o.prototype.scrub=function(){n(this._keySchedule),n(this._invKeySchedule),n(this._key)},o.prototype._doCryptBlock=function(t,e,n,i){var a,o,s,f,c,h,u,d,l;o=t[0]^e[0],s=t[1]^e[1],f=t[2]^e[2],c=t[3]^e[3],a=4;for(var p=1;p<this._nRounds;p++)h=n[0][o>>>24]^n[1][s>>>16&255]^n[2][f>>>8&255]^n[3][255&c]^e[a++],u=n[0][s>>>24]^n[1][f>>>16&255]^n[2][c>>>8&255]^n[3][255&o]^e[a++],d=n[0][f>>>24]^n[1][c>>>16&255]^n[2][o>>>8&255]^n[3][255&s]^e[a++],l=n[0][c>>>24]^n[1][o>>>16&255]^n[2][s>>>8&255]^n[3][255&f]^e[a++],o=h,s=u,f=d,c=l;return h=(i[o>>>24]<<24|i[s>>>16&255]<<16|i[f>>>8&255]<<8|i[255&c])^e[a++],u=(i[s>>>24]<<24|i[f>>>16&255]<<16|i[c>>>8&255]<<8|i[255&o])^e[a++],d=(i[f>>>24]<<24|i[c>>>16&255]<<16|i[o>>>8&255]<<8|i[255&s])^e[a++],l=(i[c>>>24]<<24|i[o>>>16&255]<<16|i[s>>>8&255]<<8|i[255&f])^e[a++],[r(h),r(u),r(d),r(l)]},e.AES=o}).call(e,r(35).Buffer)},function(t,e){e["aes-128-ecb"]={cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},e["aes-192-ecb"]={cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},e["aes-256-ecb"]={cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},e["aes-128-cbc"]={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},e["aes-192-cbc"]={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},e["aes-256-cbc"]={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},e.aes128=e["aes-128-cbc"],e.aes192=e["aes-192-cbc"],e.aes256=e["aes-256-cbc"],e["aes-128-cfb"]={cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},e["aes-192-cfb"]={cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},e["aes-256-cfb"]={cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},e["aes-128-cfb8"]={cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},e["aes-192-cfb8"]={cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},e["aes-256-cfb8"]={cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},e["aes-128-cfb1"]={cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},e["aes-192-cfb1"]={cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},e["aes-256-cfb1"]={cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},e["aes-128-ofb"]={cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},e["aes-192-ofb"]={cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},e["aes-256-ofb"]={cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},e["aes-128-ctr"]={cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},e["aes-192-ctr"]={cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},e["aes-256-ctr"]={cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},e["aes-128-gcm"]={cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},e["aes-192-gcm"]={cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},e["aes-256-gcm"]={cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},function(t,e,r){(function(e){function n(t,r,o,s){return this instanceof n?(a.call(this),this._cipher=new i.AES(r),this._prev=new e(o.length),this._cache=new e(""),this._secCache=new e(""),this._decrypt=s,o.copy(this._prev),void(this._mode=t)):new n(t,r,o)}var i=r(76),a=r(53),o=r(41);o(n,a),t.exports=n,n.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},n.prototype._final=function(){this._cipher.scrub()}}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(t,r,i,s){if(!(this instanceof n))return new n(t,r,i);o.call(this),this._finID=e.concat([i,new e([0,0,0,1])]),i=e.concat([i,new e([0,0,0,2])]),this._cipher=new a.AES(r),this._prev=new e(i.length),this._cache=new e(""),this._secCache=new e(""),this._decrypt=s,this._alen=0,this._len=0,i.copy(this._prev),this._mode=t;var c=new e(4);c.fill(0),this._ghash=new f(this._cipher.encryptBlock(c)),this._authTag=null,this._called=!1}function i(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=-1;++i<n;)r+=t[i]^e[i];return r}var a=r(76),o=r(53),s=r(41),f=r(80),c=r(81);s(n,o),t.exports=n,n.prototype._update=function(t){if(!this._called&&this._alen){var r=16-this._alen%16;r<16&&(r=new e(r),r.fill(0),this._ghash.update(r))}this._called=!0;var n=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(n),this._len+=t.length,n},n.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=c(this._ghash["final"](8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt){if(i(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data")}else this._authTag=t;this._cipher.scrub()},n.prototype.getAuthTag=function(){if(!this._decrypt&&e.isBuffer(this._authTag))return this._authTag;throw new Error("Attempting to get auth tag in unsupported state")},n.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},n.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length}}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function r(t){this.h=t,this.state=new e(16),this.state.fill(0),this.cache=new e("")}function n(t){return[t.readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)]}function i(t){t=t.map(a);var r=new e(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r}function a(t){var e,r;return e=t>f||t<0?(r=Math.abs(t)%f,t<0?f-r:r):t}function o(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]}var s=new e(16);s.fill(0),t.exports=r,r.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},r.prototype._multiply=function(){for(var t,e,r,a=n(this.h),s=[0,0,0,0],f=-1;++f<128;){for(e=0!==(this.state[~~(f/8)]&1<<7-f%8),e&&(s=o(s,a)),r=0!==(1&a[3]),t=3;t>0;t--)a[t]=a[t]>>>1|(1&a[t-1])<<31;a[0]=a[0]>>>1,r&&(a[0]=a[0]^225<<24)}this.state=i(s)},r.prototype.update=function(t){this.cache=e.concat([this.cache,t]);for(var r;this.cache.length>=16;)r=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(r)},r.prototype["final"]=function(t,r){return this.cache.length&&this.ghash(e.concat([this.cache,s],16)),this.ghash(i([0,t,0,r])),this.state};var f=Math.pow(2,32)}).call(e,r(35).Buffer)},function(t,e,r){(function(e){t.exports=function(t,r){for(var n=Math.min(t.length,r.length),i=new e(n),a=0;a<n;++a)i[a]=t[a]^r[a];return i}}).call(e,r(35).Buffer)},function(t,e){e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},function(t,e,r){var n=r(81);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},function(t,e,r){(function(t){function n(e,r,n){var a=r.length,o=i(r,e._cache);return e._cache=e._cache.slice(a),e._prev=t.concat([e._prev,n?r:o]),o}var i=r(81);e.encrypt=function(e,r,i){for(var a,o=new t("");r.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=new t("")),!(e._cache.length<=r.length)){o=t.concat([o,n(e,r,i)]);break}a=e._cache.length,o=t.concat([o,n(e,r.slice(0,a),i)]),r=r.slice(a)}return o}}).call(e,r(35).Buffer)},function(t,e,r){(function(t){function r(e,r,n){var i=e._cipher.encryptBlock(e._prev),a=i[0]^r;return e._prev=t.concat([e._prev.slice(1),new t([n?r:a])]),a}e.encrypt=function(e,n,i){for(var a=n.length,o=new t(a),s=-1;++s<a;)o[s]=r(e,n[s],i);return o}}).call(e,r(35).Buffer)},function(t,e,r){(function(t){function r(t,e,r){for(var i,a,o,s=-1,f=8,c=0;++s<f;)i=t._cipher.encryptBlock(t._prev),a=e&1<<7-s?128:0,o=i[0]^a,c+=(128&o)>>s%8,t._prev=n(t._prev,r?a:o);return c}function n(e,r){var n=e.length,i=-1,a=new t(e.length);for(e=t.concat([e,new t([r])]);++i<n;)a[i]=e[i]<<1|e[i+1]>>7;return a}e.encrypt=function(e,n,i){for(var a=n.length,o=new t(a),s=-1;++s<a;)o[s]=r(e,n[s],i);return o}}).call(e,r(35).Buffer)},function(t,e,r){(function(t){function n(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}var i=r(81);e.encrypt=function(e,r){for(;e._cache.length<r.length;)e._cache=t.concat([e._cache,n(e)]);var a=e._cache.slice(0,r.length);return e._cache=e._cache.slice(r.length),i(r,a)}}).call(e,r(35).Buffer)},function(t,e,r){(function(t){function n(t){for(var e,r=t.length;r--;){if(e=t.readUInt8(r),255!==e){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}function i(t){var e=t._cipher.encryptBlock(t._prev);return n(t._prev),e}var a=r(81);e.encrypt=function(e,r){for(;e._cache.length<r.length;)e._cache=t.concat([e._cache,i(e)]);var n=e._cache.slice(0,r.length);return e._cache=e._cache.slice(r.length),a(r,n)}}).call(e,r(35).Buffer)},function(t,e,r){(function(t){function n(e,r,a){return this instanceof n?(c.call(this),this._cache=new i,this._last=void 0,this._cipher=new f.AES(r),this._prev=new t(a.length),a.copy(this._prev),this._mode=e,void(this._autopadding=!0)):new n(e,r,a)}function i(){return this instanceof i?void(this.cache=new t("")):new i}function a(t){for(var e=t[15],r=-1;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16!==e)return t.slice(0,16-e)}function o(e,r,i){var a=u[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof i&&(i=new t(i)),"string"==typeof r&&(r=new t(r)),r.length!==a.key/8)throw new TypeError("invalid key length "+r.length);if(i.length!==a.iv)throw new TypeError("invalid iv length "+i.length);return"stream"===a.type?new d(b[a.mode],r,i,(!0)):"auth"===a.type?new l(b[a.mode],r,i,(!0)):new n(b[a.mode],r,i)}function s(t,e){var r=u[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=p(e,!1,r.key,r.iv);return o(t,n.key,n.iv)}var f=r(76),c=r(53),h=r(41),u=r(77),d=r(78),l=r(79),p=r(73);h(n,c),n.prototype._update=function(e){this._cache.add(e);for(var r,n,i=[];r=this._cache.get(this._autopadding);)n=this._mode.decrypt(this,r),i.push(n);return t.concat(i)},n.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return a(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},n.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},i.prototype.add=function(e){this.cache=t.concat([this.cache,e])},i.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},i.prototype.flush=function(){if(this.cache.length)return this.cache};var b={ECB:r(82),CBC:r(83),CFB:r(84),CFB8:r(85),CFB1:r(86),OFB:r(87),CTR:r(88),GCM:r(88)};e.createDecipher=s,e.createDecipheriv=o}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(t){i.call(this);var r,n=t.mode.toLowerCase(),a=s[n];r=t.decrypt?"decrypt":"encrypt";var o=t.key;"des-ede"!==n&&"des-ede-cbc"!==n||(o=e.concat([o,o.slice(0,8)]));var f=t.iv;this._des=a.create({key:o,iv:f,type:r})}var i=r(53),a=r(91),o=r(41),s={"des-ede3-cbc":a.CBC.instantiate(a.EDE),"des-ede3":a.EDE,"des-ede-cbc":a.CBC.instantiate(a.EDE),"des-ede":a.EDE,"des-cbc":a.CBC.instantiate(a.DES),"des-ecb":a.DES};s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],t.exports=n,o(n,i),n.prototype._update=function(t){return new e(this._des.update(t))},n.prototype._final=function(){return new e(this._des["final"]())}}).call(e,r(35).Buffer)},function(t,e,r){"use strict";e.utils=r(92),e.Cipher=r(93),e.DES=r(95),e.CBC=r(96),e.EDE=r(97)},function(t,e){"use strict";e.readUInt32BE=function(t,e){var r=t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e];return r>>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,n){for(var i=0,a=0,o=6;o>=0;o-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>>s+o&1;for(var s=0;s<=24;s+=8)i<<=1,i|=t>>>s+o&1}for(var o=6;o>=0;o-=2){for(var s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1;for(var s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1}r[n+0]=i>>>0,r[n+1]=a>>>0},e.rip=function(t,e,r,n){for(var i=0,a=0,o=0;o<4;o++)for(var s=24;s>=0;s-=8)i<<=1,i|=e>>>s+o&1,i<<=1,i|=t>>>s+o&1;for(var o=4;o<8;o++)for(var s=24;s>=0;s-=8)a<<=1,a|=e>>>s+o&1,a<<=1,a|=t>>>s+o&1;r[n+0]=i>>>0,r[n+1]=a>>>0},e.pc1=function(t,e,r,n){for(var i=0,a=0,o=7;o>=5;o--){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>s+o&1;for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+o&1}for(var s=0;s<=24;s+=8)i<<=1,i|=e>>s+o&1;for(var o=1;o<=3;o++){for(var s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;for(var s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1}for(var s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;r[n+0]=i>>>0,r[n+1]=a>>>0},e.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,n,i){for(var a=0,o=0,s=r.length>>>1,f=0;f<s;f++)a<<=1,a|=t>>>r[f]&1;for(var f=s;f<r.length;f++)o<<=1,o|=e>>>r[f]&1;n[i+0]=a>>>0,n[i+1]=o>>>0},e.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var a=23;a>=15;a-=4)n<<=6,n|=t>>>a&63;for(var a=11;a>=3;a-=4)i|=t>>>a&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++){var a=t>>>18-6*i&63,o=n[64*i+a];r<<=4,r|=o}for(var i=0;i<4;i++){var a=e>>>18-6*i&63,o=n[256+64*i+a];r<<=4,r|=o}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r<i.length;r++)e<<=1,e|=t>>>i[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var n=t.toString(2);n.length<e;)n="0"+n;for(var i=[],a=0;a<e;a+=r)i.push(n.slice(a,a+r));return i.join(" ")}},function(t,e,r){"use strict";function n(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}var i=r(94);t.exports=n,n.prototype._init=function(){},n.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},n.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;n<r;n++)this.buffer[this.bufferOff+n]=t[e+n];return this.bufferOff+=r,r},n.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},n.prototype._updateEncrypt=function(t){var e=0,r=0,n=(this.bufferOff+t.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var a=t.length-(t.length-e)%this.blockSize;e<a;e+=this.blockSize)this._update(t,e,i,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return i},n.prototype._updateDecrypt=function(t){for(var e=0,r=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},n.prototype["final"]=function(t){var e;t&&(e=this.update(t));var r;return r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},n.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},n.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},n.prototype._unpad=function(t){return t},n.prototype._finalDecrypt=function(){i.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){"use strict";function n(){this.tmp=new Array(2),this.keys=null}function i(t){c.call(this,t);var e=new n;this._desState=e,this.deriveKeys(e,t.key)}var a=r(94),o=r(41),s=r(91),f=s.utils,c=s.Cipher;o(i,c),t.exports=i,i.create=function(t){return new i(t)};var h=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];i.prototype.deriveKeys=function(t,e){t.keys=new Array(32),a.equal(e.length,this.blockSize,"Invalid key length");var r=f.readUInt32BE(e,0),n=f.readUInt32BE(e,4);f.pc1(r,n,t.tmp,0),r=t.tmp[0],n=t.tmp[1];for(var i=0;i<t.keys.length;i+=2){var o=h[i>>>1];r=f.r28shl(r,o),n=f.r28shl(n,o),f.pc2(r,n,t.keys,i)}},i.prototype._update=function(t,e,r,n){var i=this._desState,a=f.readUInt32BE(t,e),o=f.readUInt32BE(t,e+4);f.ip(a,o,i.tmp,0),a=i.tmp[0],o=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,o,i.tmp,0):this._decrypt(i,a,o,i.tmp,0),a=i.tmp[0],o=i.tmp[1],f.writeUInt32BE(r,a,n),f.writeUInt32BE(r,o,n+4)},i.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n<t.length;n++)t[n]=r;return!0},i.prototype._unpad=function(t){for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)a.equal(t[r],e);return t.slice(0,t.length-e)},i.prototype._encrypt=function(t,e,r,n,i){for(var a=e,o=r,s=0;s<t.keys.length;s+=2){var c=t.keys[s],h=t.keys[s+1];f.expand(o,t.tmp,0),c^=t.tmp[0],h^=t.tmp[1];var u=f.substitute(c,h),d=f.permute(u),l=o;o=(a^d)>>>0,a=l}f.rip(o,a,n,i)},i.prototype._decrypt=function(t,e,r,n,i){for(var a=r,o=e,s=t.keys.length-2;s>=0;s-=2){var c=t.keys[s],h=t.keys[s+1];f.expand(a,t.tmp,0),c^=t.tmp[0],h^=t.tmp[1];var u=f.substitute(c,h),d=f.permute(u),l=a;a=(o^d)>>>0,o=l}f.rip(a,o,n,i)}},function(t,e,r){"use strict";function n(t){a.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}function i(t){function e(e){t.call(this,e),this._cbcInit()}o(e,t);for(var r=Object.keys(s),n=0;n<r.length;n++){
|
19
|
-
var i=r[n];e.prototype[i]=s[i]}return e.create=function(t){return new e(t)},e}var a=r(94),o=r(41),s={};e.instantiate=i,s._cbcInit=function(){var t=new n(this.options.iv);this._cbcState=t},s._update=function(t,e,r,n){var i=this._cbcState,a=this.constructor.super_.prototype,o=i.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)o[s]^=t[e+s];a._update.call(this,o,0,r,n);for(var s=0;s<this.blockSize;s++)o[s]=r[n+s]}else{a._update.call(this,t,e,r,n);for(var s=0;s<this.blockSize;s++)r[n+s]^=o[s];for(var s=0;s<this.blockSize;s++)o[s]=t[e+s]}}},function(t,e,r){"use strict";function n(t,e){a.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),n=e.slice(8,16),i=e.slice(16,24);"encrypt"===t?this.ciphers=[c.create({type:"encrypt",key:r}),c.create({type:"decrypt",key:n}),c.create({type:"encrypt",key:i})]:this.ciphers=[c.create({type:"decrypt",key:i}),c.create({type:"encrypt",key:n}),c.create({type:"decrypt",key:r})]}function i(t){f.call(this,t);var e=new n(this.type,this.options.key);this._edeState=e}var a=r(94),o=r(41),s=r(91),f=s.Cipher,c=s.DES;o(i,f),t.exports=i,i.create=function(t){return new i(t)},i.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},i.prototype._pad=c.prototype._pad,i.prototype._unpad=c.prototype._unpad},function(t,e){e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},function(t,e,r){(function(t){function n(e){var r=new t(o[e].prime,"hex"),n=new t(o[e].gen,"hex");return new s(r,n)}function i(e,r,n,o){return t.isBuffer(r)||void 0===f[r]?i(e,"binary",r,n):(r=r||"binary",o=o||"binary",n=n||new t([2]),t.isBuffer(n)||(n=new t(n,o)),"number"==typeof e?new s(a(e,n),n,(!0)):(t.isBuffer(e)||(e=new t(e,r)),new s(e,n,(!0))))}var a=r(100),o=r(122),s=r(123),f={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=n,e.createDiffieHellman=e.DiffieHellman=i}).call(e,r(35).Buffer)},function(t,e,r){function n(){if(null!==m)return m;var t=1048576,e=[];e[0]=2;for(var r=1,n=3;n<t;n+=2){for(var i=Math.ceil(Math.sqrt(n)),a=0;a<r&&e[a]<=i&&n%e[a]!==0;a++);r!==a&&e[a]<=i||(e[r++]=n)}return m=e,e}function i(t){for(var e=n(),r=0;r<e.length;r++)if(0===t.modn(e[r]))return 0===t.cmpn(e[r]);return!0}function a(t){var e=f.mont(t);return 0===l.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function o(t,e){if(t<16)return new f(2===e||5===e?[140,123]:[140,39]);e=new f(e);for(var r,n;;){for(r=new f(s(Math.ceil(t/8)));r.bitLength()>t;)r.ishrn(1);if(r.isEven()&&r.iadd(d),r.testn(1)||r.iadd(l),e.cmp(l)){if(!e.cmp(p))for(;r.mod(b).cmp(v);)r.iadd(g)}else for(;r.mod(c).cmp(y);)r.iadd(g);if(n=r.shrn(1),i(n)&&i(r)&&a(n)&&a(r)&&u.test(n)&&u.test(r))return r}}var s=r(34);t.exports=o,o.simpleSieve=i,o.fermatTest=a;var f=r(101),c=new f(24),h=r(103),u=new h,d=new f(1),l=new f(2),p=new f(5),b=(new f(16),new f(8),new f(10)),v=new f(3),y=(new f(7),new f(11)),g=new f(4),m=(new f(12),null)},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){return a.isBN(t)?t:(this.negative=0,this.words=null,this.length=0,this.red=null,void(null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))))}function o(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a<i;a++){var o=t.charCodeAt(a)-48;n<<=4,n|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o<a;o++){var s=t.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}function f(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}function c(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,f=o/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var h=f>>>26,u=67108863&f,d=Math.min(c,e.length-1),l=Math.max(0,c-t.length+1);l<=d;l++){var p=c-l|0;i=0|t.words[p],a=0|e.words[l],o=i*a+u,h+=o/67108864|0,u=67108863&o}r.words[c]=0|u,f=0|h}return 0!==f?r.words[c]=0|f:r.length--,r.strip()}function h(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,f=Math.min(a,e.length-1),c=Math.max(0,a-t.length+1);c<=f;c++){var h=a-c,u=0|t.words[h],d=0|e.words[c],l=u*d,p=67108863&l;o=o+(l/67108864|0)|0,p=p+s|0,s=67108863&p,o=o+(p>>>26)|0,i+=o>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}function u(t,e,r){var n=new d;return n.mulp(t,e,r)}function d(t,e){this.x=t,this.y=e}function l(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){l.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){l.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){l.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function y(){l.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function m(t){g.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof t?t.exports=a:e.BN=a,a.BN=a,a.wordSize=26;var _;try{_=r(35).Buffer}catch(w){}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)for(i=t.length-1,a=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,s+=24,s>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,s+=24,s>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,a=0;for(r=t.length-6,n=0;r>=e;r-=6)i=o(t,r,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303,a+=24,a>=26&&(a-=26,n++);r+6!==e&&(i=o(t,e,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,f=Math.min(a,a-o)+r,c=0,h=r;h<f;h+=n)c=s(t,h,h+n,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var u=1;for(c=s(t,h,t.length,e),h=0;h<o;h++)u*=e;this.imuln(u),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},a.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},a.prototype.clone=function(){var t=new a(null);return this.copy(t),t},a.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var S=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],M=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],f=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,r=0!==a||o!==this.length-1?S[6-f.length]+f+r:f+r,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=M[t],h=E[t];r="";var u=this.clone();for(u.negative=0;!u.isZero();){var d=u.modn(h).toString(t);u=u.idivn(h),r=u.isZero()?d+r:S[c-d.length]+d+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n("undefined"!=typeof _),this.toArrayLike(_,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,f="le"===e,c=new t(a),h=this.clone();if(f){for(s=0;!h.isZero();s++)o=h.andln(255),h.iushrn(8),c[s]=o;for(;s<a;s++)c[s]=0}else{for(s=0;s<a-i;s++)c[s]=0;for(s=0;!h.isZero();s++)o=h.andln(255),h.iushrn(8),c[a-s-1]=o}return c},Math.clz32?a.prototype._countBits=function(t){return 32-Math.clz32(t)}:a.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},a.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},a.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},a.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},a.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},a.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},a.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},a.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),e?this.words[r]=this.words[r]|1<<i:this.words[r]=this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(t){var e;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();var r,n;this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++)e=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&e,i=e>>>26;for(;0!==i&&a<r.length;a++)e=(0|r.words[a])+i,this.words[a]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var a=0,o=0;o<i.length;o++)e=(0|n.words[o])-(0|i.words[o])+a,a=e>>26,this.words[o]=67108863&e;for(;0!==a&&o<n.length;o++)e=(0|n.words[o])+a,a=e>>26,this.words[o]=67108863&e;if(0===a&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(t){return this.clone().isub(t)};var k=function(t,e,r){var n,i,a,o=t.words,s=e.words,f=r.words,c=0,h=0|o[0],u=8191&h,d=h>>>13,l=0|o[1],p=8191&l,b=l>>>13,v=0|o[2],y=8191&v,g=v>>>13,m=0|o[3],_=8191&m,w=m>>>13,S=0|o[4],M=8191&S,E=S>>>13,k=0|o[5],A=8191&k,x=k>>>13,I=0|o[6],B=8191&I,R=I>>>13,P=0|o[7],j=8191&P,T=P>>>13,C=0|o[8],L=8191&C,O=C>>>13,D=0|o[9],z=8191&D,q=D>>>13,U=0|s[0],N=8191&U,H=U>>>13,F=0|s[1],K=8191&F,X=F>>>13,Y=0|s[2],W=8191&Y,V=Y>>>13,J=0|s[3],G=8191&J,Z=J>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],ft=8191&st,ct=st>>>13,ht=0|s[8],ut=8191&ht,dt=ht>>>13,lt=0|s[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19,n=Math.imul(u,N),i=Math.imul(u,H),i=i+Math.imul(d,N)|0,a=Math.imul(d,H);var vt=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,N),i=Math.imul(p,H),i=i+Math.imul(b,N)|0,a=Math.imul(b,H),n=n+Math.imul(u,K)|0,i=i+Math.imul(u,X)|0,i=i+Math.imul(d,K)|0,a=a+Math.imul(d,X)|0;var yt=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,N),i=Math.imul(y,H),i=i+Math.imul(g,N)|0,a=Math.imul(g,H),n=n+Math.imul(p,K)|0,i=i+Math.imul(p,X)|0,i=i+Math.imul(b,K)|0,a=a+Math.imul(b,X)|0,n=n+Math.imul(u,W)|0,i=i+Math.imul(u,V)|0,i=i+Math.imul(d,W)|0,a=a+Math.imul(d,V)|0;var gt=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(_,N),i=Math.imul(_,H),i=i+Math.imul(w,N)|0,a=Math.imul(w,H),n=n+Math.imul(y,K)|0,i=i+Math.imul(y,X)|0,i=i+Math.imul(g,K)|0,a=a+Math.imul(g,X)|0,n=n+Math.imul(p,W)|0,i=i+Math.imul(p,V)|0,i=i+Math.imul(b,W)|0,a=a+Math.imul(b,V)|0,n=n+Math.imul(u,G)|0,i=i+Math.imul(u,Z)|0,i=i+Math.imul(d,G)|0,a=a+Math.imul(d,Z)|0;var mt=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(M,N),i=Math.imul(M,H),i=i+Math.imul(E,N)|0,a=Math.imul(E,H),n=n+Math.imul(_,K)|0,i=i+Math.imul(_,X)|0,i=i+Math.imul(w,K)|0,a=a+Math.imul(w,X)|0,n=n+Math.imul(y,W)|0,i=i+Math.imul(y,V)|0,i=i+Math.imul(g,W)|0,a=a+Math.imul(g,V)|0,n=n+Math.imul(p,G)|0,i=i+Math.imul(p,Z)|0,i=i+Math.imul(b,G)|0,a=a+Math.imul(b,Z)|0,n=n+Math.imul(u,Q)|0,i=i+Math.imul(u,tt)|0,i=i+Math.imul(d,Q)|0,a=a+Math.imul(d,tt)|0;var _t=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(A,N),i=Math.imul(A,H),i=i+Math.imul(x,N)|0,a=Math.imul(x,H),n=n+Math.imul(M,K)|0,i=i+Math.imul(M,X)|0,i=i+Math.imul(E,K)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(_,W)|0,i=i+Math.imul(_,V)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(w,V)|0,n=n+Math.imul(y,G)|0,i=i+Math.imul(y,Z)|0,i=i+Math.imul(g,G)|0,a=a+Math.imul(g,Z)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,tt)|0,i=i+Math.imul(b,Q)|0,a=a+Math.imul(b,tt)|0,n=n+Math.imul(u,rt)|0,i=i+Math.imul(u,nt)|0,i=i+Math.imul(d,rt)|0,a=a+Math.imul(d,nt)|0;var wt=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(B,N),i=Math.imul(B,H),i=i+Math.imul(R,N)|0,a=Math.imul(R,H),n=n+Math.imul(A,K)|0,i=i+Math.imul(A,X)|0,i=i+Math.imul(x,K)|0,a=a+Math.imul(x,X)|0,n=n+Math.imul(M,W)|0,i=i+Math.imul(M,V)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(E,V)|0,n=n+Math.imul(_,G)|0,i=i+Math.imul(_,Z)|0,i=i+Math.imul(w,G)|0,a=a+Math.imul(w,Z)|0,n=n+Math.imul(y,Q)|0,i=i+Math.imul(y,tt)|0,i=i+Math.imul(g,Q)|0,a=a+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=i+Math.imul(p,nt)|0,i=i+Math.imul(b,rt)|0,a=a+Math.imul(b,nt)|0,n=n+Math.imul(u,at)|0,i=i+Math.imul(u,ot)|0,i=i+Math.imul(d,at)|0,a=a+Math.imul(d,ot)|0;var St=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,N),i=Math.imul(j,H),i=i+Math.imul(T,N)|0,a=Math.imul(T,H),n=n+Math.imul(B,K)|0,i=i+Math.imul(B,X)|0,i=i+Math.imul(R,K)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(A,W)|0,i=i+Math.imul(A,V)|0,i=i+Math.imul(x,W)|0,a=a+Math.imul(x,V)|0,n=n+Math.imul(M,G)|0,i=i+Math.imul(M,Z)|0,i=i+Math.imul(E,G)|0,a=a+Math.imul(E,Z)|0,n=n+Math.imul(_,Q)|0,i=i+Math.imul(_,tt)|0,i=i+Math.imul(w,Q)|0,a=a+Math.imul(w,tt)|0,n=n+Math.imul(y,rt)|0,i=i+Math.imul(y,nt)|0,i=i+Math.imul(g,rt)|0,a=a+Math.imul(g,nt)|0,n=n+Math.imul(p,at)|0,i=i+Math.imul(p,ot)|0,i=i+Math.imul(b,at)|0,a=a+Math.imul(b,ot)|0,n=n+Math.imul(u,ft)|0,i=i+Math.imul(u,ct)|0,i=i+Math.imul(d,ft)|0,a=a+Math.imul(d,ct)|0;var Mt=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(L,N),i=Math.imul(L,H),i=i+Math.imul(O,N)|0,a=Math.imul(O,H),n=n+Math.imul(j,K)|0,i=i+Math.imul(j,X)|0,i=i+Math.imul(T,K)|0,a=a+Math.imul(T,X)|0,n=n+Math.imul(B,W)|0,i=i+Math.imul(B,V)|0,i=i+Math.imul(R,W)|0,a=a+Math.imul(R,V)|0,n=n+Math.imul(A,G)|0,i=i+Math.imul(A,Z)|0,i=i+Math.imul(x,G)|0,a=a+Math.imul(x,Z)|0,n=n+Math.imul(M,Q)|0,i=i+Math.imul(M,tt)|0,i=i+Math.imul(E,Q)|0,a=a+Math.imul(E,tt)|0,n=n+Math.imul(_,rt)|0,i=i+Math.imul(_,nt)|0,i=i+Math.imul(w,rt)|0,a=a+Math.imul(w,nt)|0,n=n+Math.imul(y,at)|0,i=i+Math.imul(y,ot)|0,i=i+Math.imul(g,at)|0,a=a+Math.imul(g,ot)|0,n=n+Math.imul(p,ft)|0,i=i+Math.imul(p,ct)|0,i=i+Math.imul(b,ft)|0,a=a+Math.imul(b,ct)|0,n=n+Math.imul(u,ut)|0,i=i+Math.imul(u,dt)|0,i=i+Math.imul(d,ut)|0,a=a+Math.imul(d,dt)|0;var Et=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(z,N),i=Math.imul(z,H),i=i+Math.imul(q,N)|0,a=Math.imul(q,H),n=n+Math.imul(L,K)|0,i=i+Math.imul(L,X)|0,i=i+Math.imul(O,K)|0,a=a+Math.imul(O,X)|0,n=n+Math.imul(j,W)|0,i=i+Math.imul(j,V)|0,i=i+Math.imul(T,W)|0,a=a+Math.imul(T,V)|0,n=n+Math.imul(B,G)|0,i=i+Math.imul(B,Z)|0,i=i+Math.imul(R,G)|0,a=a+Math.imul(R,Z)|0,n=n+Math.imul(A,Q)|0,i=i+Math.imul(A,tt)|0,i=i+Math.imul(x,Q)|0,a=a+Math.imul(x,tt)|0,n=n+Math.imul(M,rt)|0,i=i+Math.imul(M,nt)|0,i=i+Math.imul(E,rt)|0,a=a+Math.imul(E,nt)|0,n=n+Math.imul(_,at)|0,i=i+Math.imul(_,ot)|0,i=i+Math.imul(w,at)|0,a=a+Math.imul(w,ot)|0,n=n+Math.imul(y,ft)|0,i=i+Math.imul(y,ct)|0,i=i+Math.imul(g,ft)|0,a=a+Math.imul(g,ct)|0,n=n+Math.imul(p,ut)|0,i=i+Math.imul(p,dt)|0,i=i+Math.imul(b,ut)|0,a=a+Math.imul(b,dt)|0,n=n+Math.imul(u,pt)|0,i=i+Math.imul(u,bt)|0,i=i+Math.imul(d,pt)|0,a=a+Math.imul(d,bt)|0;var kt=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,K),i=Math.imul(z,X),i=i+Math.imul(q,K)|0,a=Math.imul(q,X),n=n+Math.imul(L,W)|0,i=i+Math.imul(L,V)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(O,V)|0,n=n+Math.imul(j,G)|0,i=i+Math.imul(j,Z)|0,i=i+Math.imul(T,G)|0,a=a+Math.imul(T,Z)|0,n=n+Math.imul(B,Q)|0,i=i+Math.imul(B,tt)|0,i=i+Math.imul(R,Q)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(A,rt)|0,i=i+Math.imul(A,nt)|0,i=i+Math.imul(x,rt)|0,a=a+Math.imul(x,nt)|0,n=n+Math.imul(M,at)|0,i=i+Math.imul(M,ot)|0,i=i+Math.imul(E,at)|0,a=a+Math.imul(E,ot)|0,n=n+Math.imul(_,ft)|0,i=i+Math.imul(_,ct)|0,i=i+Math.imul(w,ft)|0,a=a+Math.imul(w,ct)|0,n=n+Math.imul(y,ut)|0,i=i+Math.imul(y,dt)|0,i=i+Math.imul(g,ut)|0,a=a+Math.imul(g,dt)|0,n=n+Math.imul(p,pt)|0,i=i+Math.imul(p,bt)|0,i=i+Math.imul(b,pt)|0,a=a+Math.imul(b,bt)|0;var At=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(z,W),i=Math.imul(z,V),i=i+Math.imul(q,W)|0,a=Math.imul(q,V),n=n+Math.imul(L,G)|0,i=i+Math.imul(L,Z)|0,i=i+Math.imul(O,G)|0,a=a+Math.imul(O,Z)|0,n=n+Math.imul(j,Q)|0,i=i+Math.imul(j,tt)|0,i=i+Math.imul(T,Q)|0,a=a+Math.imul(T,tt)|0,n=n+Math.imul(B,rt)|0,i=i+Math.imul(B,nt)|0,i=i+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(A,at)|0,i=i+Math.imul(A,ot)|0,i=i+Math.imul(x,at)|0,a=a+Math.imul(x,ot)|0,n=n+Math.imul(M,ft)|0,i=i+Math.imul(M,ct)|0,i=i+Math.imul(E,ft)|0,a=a+Math.imul(E,ct)|0,n=n+Math.imul(_,ut)|0,i=i+Math.imul(_,dt)|0,i=i+Math.imul(w,ut)|0,a=a+Math.imul(w,dt)|0,n=n+Math.imul(y,pt)|0,i=i+Math.imul(y,bt)|0,i=i+Math.imul(g,pt)|0,a=a+Math.imul(g,bt)|0;var xt=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(z,G),i=Math.imul(z,Z),i=i+Math.imul(q,G)|0,a=Math.imul(q,Z),n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,tt)|0,i=i+Math.imul(O,Q)|0,a=a+Math.imul(O,tt)|0,n=n+Math.imul(j,rt)|0,i=i+Math.imul(j,nt)|0,i=i+Math.imul(T,rt)|0,a=a+Math.imul(T,nt)|0,n=n+Math.imul(B,at)|0,i=i+Math.imul(B,ot)|0,i=i+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(A,ft)|0,i=i+Math.imul(A,ct)|0,i=i+Math.imul(x,ft)|0,a=a+Math.imul(x,ct)|0,n=n+Math.imul(M,ut)|0,i=i+Math.imul(M,dt)|0,i=i+Math.imul(E,ut)|0,a=a+Math.imul(E,dt)|0,n=n+Math.imul(_,pt)|0,i=i+Math.imul(_,bt)|0,i=i+Math.imul(w,pt)|0,a=a+Math.imul(w,bt)|0;var It=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(z,Q),i=Math.imul(z,tt),i=i+Math.imul(q,Q)|0,a=Math.imul(q,tt),n=n+Math.imul(L,rt)|0,i=i+Math.imul(L,nt)|0,i=i+Math.imul(O,rt)|0,a=a+Math.imul(O,nt)|0,n=n+Math.imul(j,at)|0,i=i+Math.imul(j,ot)|0,i=i+Math.imul(T,at)|0,a=a+Math.imul(T,ot)|0,n=n+Math.imul(B,ft)|0,i=i+Math.imul(B,ct)|0,i=i+Math.imul(R,ft)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(A,ut)|0,i=i+Math.imul(A,dt)|0,i=i+Math.imul(x,ut)|0,a=a+Math.imul(x,dt)|0,n=n+Math.imul(M,pt)|0,i=i+Math.imul(M,bt)|0,i=i+Math.imul(E,pt)|0,a=a+Math.imul(E,bt)|0;var Bt=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(z,rt),i=Math.imul(z,nt),i=i+Math.imul(q,rt)|0,a=Math.imul(q,nt),n=n+Math.imul(L,at)|0,i=i+Math.imul(L,ot)|0,i=i+Math.imul(O,at)|0,a=a+Math.imul(O,ot)|0,n=n+Math.imul(j,ft)|0,i=i+Math.imul(j,ct)|0,i=i+Math.imul(T,ft)|0,a=a+Math.imul(T,ct)|0,n=n+Math.imul(B,ut)|0,i=i+Math.imul(B,dt)|0,i=i+Math.imul(R,ut)|0,a=a+Math.imul(R,dt)|0,n=n+Math.imul(A,pt)|0,i=i+Math.imul(A,bt)|0,i=i+Math.imul(x,pt)|0,a=a+Math.imul(x,bt)|0;var Rt=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(z,at),i=Math.imul(z,ot),i=i+Math.imul(q,at)|0,a=Math.imul(q,ot),n=n+Math.imul(L,ft)|0,i=i+Math.imul(L,ct)|0,i=i+Math.imul(O,ft)|0,a=a+Math.imul(O,ct)|0,n=n+Math.imul(j,ut)|0,i=i+Math.imul(j,dt)|0,i=i+Math.imul(T,ut)|0,a=a+Math.imul(T,dt)|0,n=n+Math.imul(B,pt)|0,i=i+Math.imul(B,bt)|0,i=i+Math.imul(R,pt)|0,a=a+Math.imul(R,bt)|0;var Pt=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(z,ft),i=Math.imul(z,ct),i=i+Math.imul(q,ft)|0,a=Math.imul(q,ct),n=n+Math.imul(L,ut)|0,i=i+Math.imul(L,dt)|0,i=i+Math.imul(O,ut)|0,a=a+Math.imul(O,dt)|0,n=n+Math.imul(j,pt)|0,i=i+Math.imul(j,bt)|0,i=i+Math.imul(T,pt)|0,a=a+Math.imul(T,bt)|0;var jt=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(z,ut),i=Math.imul(z,dt),i=i+Math.imul(q,ut)|0,a=Math.imul(q,dt),n=n+Math.imul(L,pt)|0,i=i+Math.imul(L,bt)|0,i=i+Math.imul(O,pt)|0,a=a+Math.imul(O,bt)|0;var Tt=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(z,pt),i=Math.imul(z,bt),i=i+Math.imul(q,pt)|0,a=Math.imul(q,bt);var Ct=(c+n|0)+((8191&i)<<13)|0;return c=(a+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,f[0]=vt,f[1]=yt,f[2]=gt,f[3]=mt,f[4]=_t,f[5]=wt,f[6]=St,f[7]=Mt,f[8]=Et,f[9]=kt,f[10]=At,f[11]=xt,f[12]=It,f[13]=Bt,f[14]=Rt,f[15]=Pt,f[16]=jt,f[17]=Tt,f[18]=Ct,0!==c&&(f[19]=c,r.length++),r};Math.imul||(k=c),a.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?k(this,t,e):n<63?c(this,t,e):n<1024?h(this,t,e):u(this,t,e)},d.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},d.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},d.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o<a;o++)n[o]=e[t[o]],i[o]=r[t[o]]},d.prototype.transform=function(t,e,r,n,i,a){this.permute(a,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,f=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),h=0;h<i;h+=s)for(var u=f,d=c,l=0;l<o;l++){var p=r[h+l],b=n[h+l],v=r[h+l+o],y=n[h+l+o],g=u*v-d*y;y=u*y+d*v,v=g,r[h+l]=p+v,n[h+l]=b+y,r[h+l+o]=p-v,n[h+l+o]=b-y,l!==s&&(g=f*u-c*d,d=f*d+c*u,u=g)}},d.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},d.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},d.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},d.prototype.convert13b=function(t,e,r,i){for(var a=0,o=0;o<e;o++)a+=0|t[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===a),n(0===(a&-8192))},d.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},d.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),f=new Array(n),c=new Array(n),h=new Array(n),u=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,c,n),this.transform(o,a,s,f,n,i),this.transform(c,a,h,u,n,i);for(var l=0;l<n;l++){var p=s[l]*h[l]-f[l]*u[l];f[l]=s[l]*u[l]+f[l]*h[l],s[l]=p}return this.conjugate(s,f,n),this.transform(s,f,d,a,n,i),this.conjugate(d,a,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},a.prototype.mul=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},a.prototype.mulf=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),u(this,t,e)},a.prototype.imul=function(t){return this.clone().mulTo(t,this)},a.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,a=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=f(t);if(0===e.length)return new a(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&a,f=(0|this.words[e])-s<<r;this.words[e]=f|o,o=s>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},a.prototype.iushrn=function(t,e,r){n("number"==typeof t&&t>=0);var i;i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<<a,f=r;if(i-=o,i=Math.max(0,i),f){for(var c=0;c<o;c++)f.words[c]=this.words[c];f.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var u=0|this.words[c];this.words[c]=h<<26-a|u>>>a,h=u&s}return f&&0!==h&&(f.words[f.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return!1;var a=this.words[r];return!!(a&i)},a.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(t){return this.clone().imaskn(t)},a.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},a.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,
|
20
|
-
e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},a.prototype.addn=function(t){return this.clone().iaddn(t)},a.prototype.subn=function(t){return this.clone().isubn(t)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(t,e,r){var i,a=t.length+r;this._expand(a);var o,s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var f=(0|t.words[i])*e;o-=67108863&f,s=(o>>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)o=(0|this.words[i+r])+s,s=o>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(s===-1),s=0,i=0;i<this.length;i++)o=-(0|this.words[i])+s,s=o>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),i=t,o=0|i.words[i.length-1],s=this._countBits(o);r=26-s,0!==r&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var f,c=n.length-i.length;if("mod"!==e){f=new a(null),f.length=c+1,f.words=new Array(f.length);for(var h=0;h<f.length;h++)f.words[h]=0}var u=n.clone()._ishlnsubmul(i,1,c);0===u.negative&&(n=u,f&&(f.words[c]=1));for(var d=c-1;d>=0;d--){var l=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(i,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);f&&(f.words[d]=l)}return f&&f.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:f||null,mod:n}},a.prototype.divmod=function(t,e,r){if(n(!t.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e)},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),f=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),u=e.clone();!e.isZero();){for(var d=0,l=1;0===(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(h),o.isub(u)),i.iushrn(1),o.iushrn(1);for(var p=0,b=1;0===(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(h),f.isub(u)),s.iushrn(1),f.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(f)):(r.isub(e),s.isub(i),f.isub(o))}return{a:s,b:f,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0===(e.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(e.iushrn(f);f-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var h=0,u=1;0===(r.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(r.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}var d;return d=0===e.cmpn(1)?i:o,d.cmpn(0)<0&&d.iadd(t),d},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0===(1&this.words[0])},a.prototype.isOdd=function(){return 1===(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];s+=a,a=s>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];r=i===t?0:i<t?-1:1}return 0!==this.negative?0|-r:r},a.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},a.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return this.cmpn(t)===-1},a.prototype.lt=function(t){return this.cmp(t)===-1},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new g(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var A={k256:null,p224:null,p192:null,p25519:null};l.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},l.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength();while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},l.prototype.split=function(t,e){t.iushrn(this.n,0,e)},l.prototype.imulK=function(t){return t.imul(this.k)},i(p,l),p.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];for(e.words[e.length++]=a&r,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(o&r)<<4|a>>>22,a=o}a>>>=22,t.words[i-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},p.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(b,l),i(v,l),i(y,l),y.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function x(t){if(A[t])return A[t];var x;if("k256"===t)x=new p;else if("p224"===t)x=new b;else if("p192"===t)x=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);x=new y}return A[t]=x,x},g.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},g.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},g.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},g.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},g.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},g.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},g.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},g.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},g.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},g.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},g.prototype.isqr=function(t){return this.imul(t,t.clone())},g.prototype.sqr=function(t){return this.mul(t,t)},g.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),f=s.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new a(2*h*h).toRed(this);0!==this.pow(h,c).cmp(f);)h.redIAdd(f);for(var u=this.pow(h,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=o;0!==l.cmp(s);){for(var b=l,v=0;0!==b.cmp(s);v++)b=b.redSqr();n(v<p);var y=this.pow(u,new a(1).iushln(p-v-1));d=d.redMul(y),u=y.redSqr(),l=l.redMul(u),p=v}return d},g.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},g.prototype.pow=function(t,e){if(e.isZero())return new a(1);if(0===e.cmpn(1))return t.clone();var r=4,n=new Array(1<<r);n[0]=new a(1).toRed(this),n[1]=t;for(var i=2;i<n.length;i++)n[i]=this.mul(n[i-1],t);var o=n[0],s=0,f=0,c=e.bitLength()%26;for(0===c&&(c=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],u=c-1;u>=0;u--){var d=h>>u&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==s?(s<<=1,s|=d,f++,(f===r||0===i&&0===u)&&(o=this.mul(o,n[s]),f=0,s=0)):f=0}c=26}return o},g.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},g.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new m(t)},i(m,g),m.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},m.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},m.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},m.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},m.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}("undefined"==typeof t||t,this)}).call(e,r(102)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e,r){function n(t){this.rand=t||new a.Rand}var i=r(101),a=r(104);t.exports=n,n.create=function(t){return new n(t)},n.prototype._rand=function(t){var e=t.bitLength(),r=this.rand.generate(Math.ceil(e/8));r[0]|=3;var n=7&e;return 0!==n&&(r[r.length-1]>>=7-n),new i(r)},n.prototype.test=function(t,e,r){var n=t.bitLength(),a=i.mont(t),o=new i(1).toRed(a);e||(e=Math.max(1,n/48|0));for(var s=t.subn(1),f=s.subn(1),c=0;!s.testn(c);c++);for(var h=t.shrn(c),u=s.toRed(a),d=!0;e>0;e--){var l=this._rand(f);r&&r(l);var p=l.toRed(a).redPow(h);if(0!==p.cmp(o)&&0!==p.cmp(u)){for(var b=1;b<c;b++){if(p=p.redSqr(),0===p.cmp(o))return!1;if(0===p.cmp(u))break}if(b===c)return!1}}return d},n.prototype.getDivisor=function(t,e){var r=t.bitLength(),n=i.mont(t),a=new i(1).toRed(n);e||(e=Math.max(1,r/48|0));for(var o=t.subn(1),s=o.subn(1),f=0;!o.testn(f);f++);for(var c=t.shrn(f),h=o.toRed(n);e>0;e--){var u=this._rand(s),d=t.gcd(u);if(0!==d.cmpn(1))return d;var l=u.toRed(n).redPow(c);if(0!==l.cmp(a)&&0!==l.cmp(h)){for(var p=1;p<f;p++){if(l=l.redSqr(),0===l.cmp(a))return l.fromRed().subn(1).gcd(t);if(0===l.cmp(h))break}if(p===f)return l=l.redSqr(),l.fromRed().subn(1).gcd(t)}}return!1}},function(t,e,r){function n(t){this.rand=t}var i;if(t.exports=function(t){return i||(i=new n(null)),i.generate(t)},t.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},"object"==typeof window)window.crypto&&window.crypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return window.crypto.getRandomValues(e),e}:window.msCrypto&&window.msCrypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return window.msCrypto.getRandomValues(e),e}:n.prototype._rand=function(){throw new Error("Not implemented yet")};else try{var a=r(105);n.prototype._rand=function(t){return a.randomBytes(t)}}catch(o){n.prototype._rand=function(t){for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e}}},function(t,e,r){(function(t){function n(){var t=[].slice.call(arguments).join(" ");throw new Error([t,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}function i(t,e){for(var r in t)e(t[r],r)}var a=r(106);e.createHash=r(108),e.createHmac=r(119),e.randomBytes=function(e,r){if(!r||!r.call)return new t(a(e));try{r.call(this,void 0,new t(a(e)))}catch(n){r(n)}},e.getHashes=function(){return["sha1","sha256","sha512","md5","rmd160"]};var o=r(120)(e);e.pbkdf2=o.pbkdf2,e.pbkdf2Sync=o.pbkdf2Sync,i(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman"],function(t){e[t]=function(){n("sorry,",t,"is not implemented yet")}})}).call(e,r(35).Buffer)},function(t,e,r){(function(e,n){!function(){var i=("undefined"==typeof window?e:window)||{};_crypto=i.crypto||i.msCrypto||r(107),t.exports=function(t){if(_crypto.getRandomValues){var e=new n(t);return _crypto.getRandomValues(e),e}if(_crypto.randomBytes)return _crypto.randomBytes(t);throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}}()}).call(e,function(){return this}(),r(35).Buffer)},function(t,e){},function(t,e,r){(function(e){function n(t){return function(){var r=[],n={update:function(t,n){return e.isBuffer(t)||(t=new e(t,n)),r.push(t),this},digest:function(n){var i=e.concat(r),a=t(i);return r=null,n?a.toString(n):a}};return n}}var i=r(109),a=n(r(116)),o=n(r(118));t.exports=function(t){return"md5"===t?new a:"rmd160"===t?new o:i(t)}}).call(e,r(35).Buffer)},function(t,e,r){var e=t.exports=function(t){var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r},n=r(35).Buffer,i=r(110)(n);e.sha1=r(111)(n,i),e.sha256=r(114)(n,i),e.sha512=r(115)(n,i)},function(t,e){t.exports=function(t){function e(e,r){this._block=new t(e),this._finalSize=r,this._blockSize=e,this._len=0,this._s=0}return e.prototype.init=function(){this._s=0,this._len=0},e.prototype.update=function(e,r){"string"==typeof e&&(r=r||"utf8",e=new t(e,r));for(var n=this._len+=e.length,i=this._s=this._s||0,a=0,o=this._block;i<n;){for(var s=Math.min(e.length,a+this._blockSize-i%this._blockSize),f=s-a,c=0;c<f;c++)o[i%this._blockSize+c]=e[c+a];i+=f,a+=f,i%this._blockSize===0&&this._update(o)}return this._s=i,this},e.prototype.digest=function(t){var e=8*this._len;this._block[this._len%this._blockSize]=128,this._block.fill(0,this._len%this._blockSize+1),e%(8*this._blockSize)>=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(e,this._blockSize-4);var r=this._update(this._block)||this._hash();return t?r.toString(t):r},e.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e}},function(t,e,r){var n=r(112).inherits;t.exports=function(t,e){function r(){return p.length?p.pop().init():this instanceof r?(this._w=l,e.call(this,64,56),this._h=null,void this.init()):new r}function i(t,e,r,n){return t<20?e&r|~e&n:t<40?e^r^n:t<60?e&r|e&n|r&n:e^r^n}function a(t){return t<20?1518500249:t<40?1859775393:t<60?-1894007588:-899497514}function o(t,e){return t+e|0}function s(t,e){return t<<e|t>>>32-e}var f=0,c=4,h=8,u=12,d=16,l=new("undefined"==typeof Int32Array?Array:Int32Array)(80),p=[];return n(r,e),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,e.prototype.init.call(this),this},r.prototype._POOL=p,r.prototype._update=function(t){var e,r,n,f,c,h,u,d,l,p;e=h=this._a,r=u=this._b,n=d=this._c,f=l=this._d,c=p=this._e;for(var b=this._w,v=0;v<80;v++){var y=b[v]=v<16?t.readInt32BE(4*v):s(b[v-3]^b[v-8]^b[v-14]^b[v-16],1),g=o(o(s(e,5),i(v,r,n,f)),o(o(c,y),a(v)));c=f,f=n,n=s(r,30),r=e,e=g}this._a=o(e,h),this._b=o(r,u),this._c=o(n,d),this._d=o(f,l),this._e=o(c,p)},r.prototype._hash=function(){p.length<100&&p.push(this);var e=new t(20);return e.writeInt32BE(0|this._a,f),e.writeInt32BE(0|this._b,c),e.writeInt32BE(0|this._c,h),e.writeInt32BE(0|this._d,u),e.writeInt32BE(0|this._e,d),e},r}},function(t,e,r){(function(t,n){function i(t,r){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),f(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function o(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function f(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return m(i)||(i=f(t,i,n)),i}var a=c(t,r);if(a)return a;var o=Object.keys(r),b=s(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(r)),k(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(r);if(0===o.length){if(A(r)){var v=r.name?": "+r.name:"";return t.stylize("[Function"+v+"]","special")}if(S(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return t.stylize(Date.prototype.toString.call(r),"date");if(k(r))return h(r)}var y="",g=!1,_=["{","}"];if(p(r)&&(g=!0,_=["[","]"]),A(r)){var w=r.name?": "+r.name:"";y=" [Function"+w+"]"}if(S(r)&&(y=" "+RegExp.prototype.toString.call(r)),E(r)&&(y=" "+Date.prototype.toUTCString.call(r)),k(r)&&(y=" "+h(r)),0===o.length&&(!g||0==r.length))return _[0]+y+_[1];if(n<0)return S(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special");t.seen.push(r);var M;return M=g?u(t,r,n,b,o):o.map(function(e){return d(t,r,n,b,e,g)}),t.seen.pop(),l(M,y,_)}function c(t,e){if(w(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):b(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function u(t,e,r,n,i){for(var a=[],o=0,s=e.length;o<s;++o)P(e,String(o))?a.push(d(t,e,r,n,String(o),!0)):a.push("");return i.forEach(function(i){i.match(/^\d+$/)||a.push(d(t,e,r,n,i,!0))}),a}function d(t,e,r,n,i,a){var o,s,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?s=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(s=t.stylize("[Setter]","special")),P(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(c.value)<0?(s=v(r)?f(t,c.value,null):f(t,c.value,r-1),s.indexOf("\n")>-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),w(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function l(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function p(t){return Array.isArray(t)}function b(t){return"boolean"==typeof t}function v(t){return null===t}function y(t){return null==t}function g(t){return"number"==typeof t}function m(t){return"string"==typeof t}function _(t){return"symbol"==typeof t}function w(t){return void 0===t}function S(t){return M(t)&&"[object RegExp]"===I(t)}function M(t){return"object"==typeof t&&null!==t}function E(t){return M(t)&&"[object Date]"===I(t)}function k(t){return M(t)&&("[object Error]"===I(t)||t instanceof Error)}function A(t){return"function"==typeof t}function x(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function I(t){return Object.prototype.toString.call(t)}function B(t){return t<10?"0"+t.toString(10):t.toString(10)}function R(){var t=new Date,e=[B(t.getHours()),B(t.getMinutes()),B(t.getSeconds())].join(":");return[t.getDate(),L[t.getMonth()],e].join(" ")}function P(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var j=/%[sdj%]/g;e.format=function(t){if(!m(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(i(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,a=n.length,o=String(t).replace(j,function(t){if("%%"===t)return"%";if(r>=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}}),s=n[r];r<a;s=n[++r])o+=v(s)||!M(s)?" "+s:" "+i(s);return o},e.deprecate=function(r,i){function a(){if(!o){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),o=!0}return r.apply(this,arguments)}if(w(t.process))return function(){return e.deprecate(r,i).apply(this,arguments)};if(n.noDeprecation===!0)return r;var o=!1;return a};var T,C={};e.debuglog=function(t){if(w(T)&&(T=n.env.NODE_DEBUG||""),t=t.toUpperCase(),!C[t])if(new RegExp("\\b"+t+"\\b","i").test(T)){var r=n.pid;C[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else C[t]=function(){};return C[t]},e.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=p,e.isBoolean=b,e.isNull=v,e.isNullOrUndefined=y,e.isNumber=g,e.isString=m,e.isSymbol=_,e.isUndefined=w,e.isRegExp=S,e.isObject=M,e.isDate=E,e.isError=k,e.isFunction=A,e.isPrimitive=x,e.isBuffer=r(113);var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];e.log=function(){console.log("%s - %s",R(),e.format.apply(e,arguments))},e.inherits=r(41),e._extend=function(t,e){if(!e||!M(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(e,function(){return this}(),r(39))},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e,r){var n=r(112).inherits;t.exports=function(t,e){function r(){this.init(),this._w=l,e.call(this,64,56)}function i(t,e){return t>>>e|t<<32-e}function a(t,e){return t>>>e}function o(t,e,r){return t&e^~t&r}function s(t,e,r){return t&e^t&r^e&r}function f(t){return i(t,2)^i(t,13)^i(t,22)}function c(t){return i(t,6)^i(t,11)^i(t,25)}function h(t){return i(t,7)^i(t,18)^a(t,3)}function u(t){return i(t,17)^i(t,19)^a(t,10)}var d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],l=new Array(64);return n(r,e),r.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this._len=this._s=0,this},r.prototype._update=function(t){var e,r,n,i,a,l,p,b,v,y,g=this._w;e=0|this._a,r=0|this._b,n=0|this._c,i=0|this._d,a=0|this._e,l=0|this._f,p=0|this._g,b=0|this._h;for(var m=0;m<64;m++){var _=g[m]=m<16?t.readInt32BE(4*m):u(g[m-2])+g[m-7]+h(g[m-15])+g[m-16];v=b+c(a)+o(a,l,p)+d[m]+_,y=f(e)+s(e,r,n),b=p,p=l,l=a,a=i+v,i=n,n=r,r=e,e=v+y}this._a=e+this._a|0,this._b=r+this._b|0,this._c=n+this._c|0,this._d=i+this._d|0,this._e=a+this._e|0,this._f=l+this._f|0,this._g=p+this._g|0,this._h=b+this._h|0},r.prototype._hash=function(){var e=new t(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},r}},function(t,e,r){var n=r(112).inherits;t.exports=function(t,e){function r(){this.init(),this._w=f,e.call(this,128,112)}function i(t,e,r){return t>>>r|e<<32-r}function a(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}var s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],f=new Array(160);return n(r,e),r.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this._al=-205731576,this._bl=-2067093701,this._cl=-23791573,this._dl=1595750129,this._el=-1377402159,this._fl=725511199,this._gl=-79577749,this._hl=327033209,this._len=this._s=0,this},r.prototype._update=function(t){var e,r,n,f,c,h,u,d,l,p,b,v,y,g,m,_,w=this._w;e=0|this._a,r=0|this._b,n=0|this._c,f=0|this._d,c=0|this._e,h=0|this._f,u=0|this._g,d=0|this._h,l=0|this._al,p=0|this._bl,b=0|this._cl,v=0|this._dl,y=0|this._el,g=0|this._fl,m=0|this._gl,_=0|this._hl;for(var S=0;S<80;S++){var M,E,k=2*S;if(S<16)M=w[k]=t.readInt32BE(4*k),E=w[k+1]=t.readInt32BE(4*k+4);else{var A=w[k-30],x=w[k-30+1],I=i(A,x,1)^i(A,x,8)^A>>>7,B=i(x,A,1)^i(x,A,8)^i(x,A,7);A=w[k-4],x=w[k-4+1];var R=i(A,x,19)^i(x,A,29)^A>>>6,P=i(x,A,19)^i(A,x,29)^i(x,A,6),j=w[k-14],T=w[k-14+1],C=w[k-32],L=w[k-32+1];E=B+T,M=I+j+(E>>>0<B>>>0?1:0),E+=P,M=M+R+(E>>>0<P>>>0?1:0),E+=L,M=M+C+(E>>>0<L>>>0?1:0),w[k]=M,w[k+1]=E}var O=o(e,r,n),D=o(l,p,b),z=i(e,l,28)^i(l,e,2)^i(l,e,7),q=i(l,e,28)^i(e,l,2)^i(e,l,7),U=i(c,y,14)^i(c,y,18)^i(y,c,9),N=i(y,c,14)^i(y,c,18)^i(c,y,9),H=s[k],F=s[k+1],K=a(c,h,u),X=a(y,g,m),Y=_+N,W=d+U+(Y>>>0<_>>>0?1:0);
|
21
|
-
Y+=X,W=W+K+(Y>>>0<X>>>0?1:0),Y+=F,W=W+H+(Y>>>0<F>>>0?1:0),Y+=E,W=W+M+(Y>>>0<E>>>0?1:0);var V=q+D,J=z+O+(V>>>0<q>>>0?1:0);d=u,_=m,u=h,m=g,h=c,g=y,y=v+Y|0,c=f+W+(y>>>0<v>>>0?1:0)|0,f=n,v=b,n=r,b=p,r=e,p=l,l=Y+V|0,e=W+J+(l>>>0<Y>>>0?1:0)|0}this._al=this._al+l|0,this._bl=this._bl+p|0,this._cl=this._cl+b|0,this._dl=this._dl+v|0,this._el=this._el+y|0,this._fl=this._fl+g|0,this._gl=this._gl+m|0,this._hl=this._hl+_|0,this._a=this._a+e+(this._al>>>0<l>>>0?1:0)|0,this._b=this._b+r+(this._bl>>>0<p>>>0?1:0)|0,this._c=this._c+n+(this._cl>>>0<b>>>0?1:0)|0,this._d=this._d+f+(this._dl>>>0<v>>>0?1:0)|0,this._e=this._e+c+(this._el>>>0<y>>>0?1:0)|0,this._f=this._f+h+(this._fl>>>0<g>>>0?1:0)|0,this._g=this._g+u+(this._gl>>>0<m>>>0?1:0)|0,this._h=this._h+d+(this._hl>>>0<_>>>0?1:0)|0},r.prototype._hash=function(){function e(t,e,n){r.writeInt32BE(t,n),r.writeInt32BE(e,n+4)}var r=new t(64);return e(this._a,this._al,0),e(this._b,this._bl,8),e(this._c,this._cl,16),e(this._d,this._dl,24),e(this._e,this._el,32),e(this._f,this._fl,40),e(this._g,this._gl,48),e(this._h,this._hl,56),r},r}},function(t,e,r){function n(t,e){t[e>>5]|=128<<e%32,t[(e+64>>>9<<4)+14]=e;for(var r=1732584193,n=-271733879,i=-1732584194,h=271733878,u=0;u<t.length;u+=16){var d=r,l=n,p=i,b=h;r=a(r,n,i,h,t[u+0],7,-680876936),h=a(h,r,n,i,t[u+1],12,-389564586),i=a(i,h,r,n,t[u+2],17,606105819),n=a(n,i,h,r,t[u+3],22,-1044525330),r=a(r,n,i,h,t[u+4],7,-176418897),h=a(h,r,n,i,t[u+5],12,1200080426),i=a(i,h,r,n,t[u+6],17,-1473231341),n=a(n,i,h,r,t[u+7],22,-45705983),r=a(r,n,i,h,t[u+8],7,1770035416),h=a(h,r,n,i,t[u+9],12,-1958414417),i=a(i,h,r,n,t[u+10],17,-42063),n=a(n,i,h,r,t[u+11],22,-1990404162),r=a(r,n,i,h,t[u+12],7,1804603682),h=a(h,r,n,i,t[u+13],12,-40341101),i=a(i,h,r,n,t[u+14],17,-1502002290),n=a(n,i,h,r,t[u+15],22,1236535329),r=o(r,n,i,h,t[u+1],5,-165796510),h=o(h,r,n,i,t[u+6],9,-1069501632),i=o(i,h,r,n,t[u+11],14,643717713),n=o(n,i,h,r,t[u+0],20,-373897302),r=o(r,n,i,h,t[u+5],5,-701558691),h=o(h,r,n,i,t[u+10],9,38016083),i=o(i,h,r,n,t[u+15],14,-660478335),n=o(n,i,h,r,t[u+4],20,-405537848),r=o(r,n,i,h,t[u+9],5,568446438),h=o(h,r,n,i,t[u+14],9,-1019803690),i=o(i,h,r,n,t[u+3],14,-187363961),n=o(n,i,h,r,t[u+8],20,1163531501),r=o(r,n,i,h,t[u+13],5,-1444681467),h=o(h,r,n,i,t[u+2],9,-51403784),i=o(i,h,r,n,t[u+7],14,1735328473),n=o(n,i,h,r,t[u+12],20,-1926607734),r=s(r,n,i,h,t[u+5],4,-378558),h=s(h,r,n,i,t[u+8],11,-2022574463),i=s(i,h,r,n,t[u+11],16,1839030562),n=s(n,i,h,r,t[u+14],23,-35309556),r=s(r,n,i,h,t[u+1],4,-1530992060),h=s(h,r,n,i,t[u+4],11,1272893353),i=s(i,h,r,n,t[u+7],16,-155497632),n=s(n,i,h,r,t[u+10],23,-1094730640),r=s(r,n,i,h,t[u+13],4,681279174),h=s(h,r,n,i,t[u+0],11,-358537222),i=s(i,h,r,n,t[u+3],16,-722521979),n=s(n,i,h,r,t[u+6],23,76029189),r=s(r,n,i,h,t[u+9],4,-640364487),h=s(h,r,n,i,t[u+12],11,-421815835),i=s(i,h,r,n,t[u+15],16,530742520),n=s(n,i,h,r,t[u+2],23,-995338651),r=f(r,n,i,h,t[u+0],6,-198630844),h=f(h,r,n,i,t[u+7],10,1126891415),i=f(i,h,r,n,t[u+14],15,-1416354905),n=f(n,i,h,r,t[u+5],21,-57434055),r=f(r,n,i,h,t[u+12],6,1700485571),h=f(h,r,n,i,t[u+3],10,-1894986606),i=f(i,h,r,n,t[u+10],15,-1051523),n=f(n,i,h,r,t[u+1],21,-2054922799),r=f(r,n,i,h,t[u+8],6,1873313359),h=f(h,r,n,i,t[u+15],10,-30611744),i=f(i,h,r,n,t[u+6],15,-1560198380),n=f(n,i,h,r,t[u+13],21,1309151649),r=f(r,n,i,h,t[u+4],6,-145523070),h=f(h,r,n,i,t[u+11],10,-1120210379),i=f(i,h,r,n,t[u+2],15,718787259),n=f(n,i,h,r,t[u+9],21,-343485551),r=c(r,d),n=c(n,l),i=c(i,p),h=c(h,b)}return Array(r,n,i,h)}function i(t,e,r,n,i,a){return c(h(c(c(e,t),c(n,a)),i),r)}function a(t,e,r,n,a,o,s){return i(e&r|~e&n,t,e,a,o,s)}function o(t,e,r,n,a,o,s){return i(e&n|r&~n,t,e,a,o,s)}function s(t,e,r,n,a,o,s){return i(e^r^n,t,e,a,o,s)}function f(t,e,r,n,a,o,s){return i(r^(e|~n),t,e,a,o,s)}function c(t,e){var r=(65535&t)+(65535&e),n=(t>>16)+(e>>16)+(r>>16);return n<<16|65535&r}function h(t,e){return t<<e|t>>>32-e}var u=r(117);t.exports=function(t){return u.hash(t,n,16)}},function(t,e,r){(function(e){function r(t,r){if(t.length%a!==0){var n=t.length+(a-t.length%a);t=e.concat([t,o],n)}for(var i=[],s=r?t.readInt32BE:t.readInt32LE,f=0;f<t.length;f+=a)i.push(s.call(t,f));return i}function n(t,r,n){for(var i=new e(r),a=n?i.writeInt32BE:i.writeInt32LE,o=0;o<t.length;o++)a.call(i,t[o],4*o,!0);return i}function i(t,i,a,o){e.isBuffer(t)||(t=new e(t));var f=i(r(t,o),t.length*s);return n(f,a,o)}var a=4,o=new e(a);o.fill(0);var s=8;t.exports={hash:i}}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function r(t,e,r){return t^e^r}function n(t,e,r){return t&e|~t&r}function i(t,e,r){return(t|~e)^r}function a(t,e,r){return t&r|e&~r}function o(t,e,r){return t^(e|~r)}function s(t,e){return t<<e|t>>>32-e}function f(t){var r=[1732584193,4023233417,2562383102,271733878,3285377520];"string"==typeof t&&(t=new e(t,"utf8"));var n=b(t),i=8*t.length,a=8*t.length;n[i>>>5]|=128<<24-i%32,n[(i+64>>>9<<4)+14]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8);for(var o=0;o<n.length;o+=16)y(r,n,o);for(var o=0;o<5;o++){var s=r[o];r[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var f=v(r);return new e(f)}t.exports=f;/** @preserve
|
22
|
-
(c) 2012 by Cédric Mesnil. All rights reserved.
|
23
|
-
|
24
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
25
|
-
|
26
|
-
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
27
|
-
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
28
|
-
|
29
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
-
*/
|
31
|
-
var c=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],h=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],d=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],p=[1352829926,1548603684,1836072691,2053994217,0],b=function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},v=function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},y=function(t,e,f){for(var b=0;b<16;b++){var v=f+b,y=e[v];e[v]=16711935&(y<<8|y>>>24)|4278255360&(y<<24|y>>>8)}var g,m,_,w,S,M,E,k,A,x;M=g=t[0],E=m=t[1],k=_=t[2],A=w=t[3],x=S=t[4];for(var I,b=0;b<80;b+=1)I=g+e[f+c[b]]|0,I+=b<16?r(m,_,w)+l[0]:b<32?n(m,_,w)+l[1]:b<48?i(m,_,w)+l[2]:b<64?a(m,_,w)+l[3]:o(m,_,w)+l[4],I=0|I,I=s(I,u[b]),I=I+S|0,g=S,S=w,w=s(_,10),_=m,m=I,I=M+e[f+h[b]]|0,I+=b<16?o(E,k,A)+p[0]:b<32?a(E,k,A)+p[1]:b<48?i(E,k,A)+p[2]:b<64?n(E,k,A)+p[3]:r(E,k,A)+p[4],I=0|I,I=s(I,d[b]),I=I+x|0,M=x,x=A,A=s(k,10),k=E,E=I;I=t[1]+_+A|0,t[1]=t[2]+w+x|0,t[2]=t[3]+S+M|0,t[3]=t[4]+g+E|0,t[4]=t[0]+m+k|0,t[0]=I}}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(t,r){if(!(this instanceof n))return new n(t,r);this._opad=f,this._alg=t;var o="sha512"===t?128:64;r=this._key=e.isBuffer(r)?r:new e(r),r.length>o?r=i(t).update(r).digest():r.length<o&&(r=e.concat([r,a],o));for(var s=this._ipad=new e(o),f=this._opad=new e(o),c=0;c<o;c++)s[c]=54^r[c],f[c]=92^r[c];this._hash=i(t).update(s)}var i=r(108),a=new e(128);a.fill(0),t.exports=n,n.prototype.update=function(t,e){return this._hash.update(t,e),this},n.prototype.digest=function(t){var e=this._hash.digest();return i(this._alg).update(this._opad).update(e).digest(t)}}).call(e,r(35).Buffer)},function(t,e,r){var n=r(121);t.exports=function(t,e){e=e||{};var r=n(t);return e.pbkdf2=r.pbkdf2,e.pbkdf2Sync=r.pbkdf2Sync,e}},function(t,e,r){(function(e){t.exports=function(t){function r(t,e,r,i,a,o){if("function"==typeof a&&(o=a,a=void 0),"function"!=typeof o)throw new Error("No callback provided to pbkdf2");setTimeout(function(){var s;try{s=n(t,e,r,i,a)}catch(f){return o(f)}o(void 0,s)})}function n(r,n,i,a,o){if("number"!=typeof i)throw new TypeError("Iterations not a number");if(i<0)throw new TypeError("Bad iterations");if("number"!=typeof a)throw new TypeError("Key length not a number");if(a<0)throw new TypeError("Bad key length");o=o||"sha1",e.isBuffer(r)||(r=new e(r)),e.isBuffer(n)||(n=new e(n));var s,f,c,h=1,u=new e(a),d=new e(n.length+4);n.copy(d,0,0,n.length);for(var l=1;l<=h;l++){d.writeUInt32BE(l,n.length);var p=t.createHmac(o,r).update(d).digest();if(!s&&(s=p.length,c=new e(s),h=Math.ceil(a/s),f=a-(h-1)*s,a>(Math.pow(2,32)-1)*s))throw new TypeError("keylen exceeds maximum length");p.copy(c,0,0,s);for(var b=1;b<i;b++){p=t.createHmac(o,r).update(p).digest();for(var v=0;v<s;v++)c[v]^=p[v]}var y=(l-1)*s,g=l==h?f:s;c.copy(u,y,0,g)}return u}return{pbkdf2:r,pbkdf2Sync:n}}}).call(e,r(35).Buffer)},function(t,e){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},function(t,e,r){(function(e){function n(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._pub=new f(t),this}function i(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._priv=new f(t),this}function a(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in g)return g[n];var i=0;if(t.isEven()||!v.simpleSieve||!v.fermatTest(t)||!h.test(t))return i+=1,i+="02"===r||"05"===r?8:4,g[n]=i,i;h.test(t.shrn(1))||(i+=2);var a;switch(r){case"02":t.mod(u).cmp(d)&&(i+=8);break;case"05":a=t.mod(l),a.cmp(p)&&a.cmp(b)&&(i+=8);break;default:i+=4}return g[n]=i,i}function o(t,e,r){this.setGenerator(e),this.__prime=new f(t),this._prime=f.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=n,this.setPrivateKey=i):this._primeCode=8}function s(t,r){var n=new e(t.toArray());return r?n.toString(r):n}var f=r(101),c=r(103),h=new c,u=new f(24),d=new f(11),l=new f(10),p=new f(3),b=new f(7),v=r(100),y=r(34);t.exports=o;var g={};Object.defineProperty(o.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=a(this.__prime,this.__gen)),this._primeCode}}),o.prototype.generateKeys=function(){return this._priv||(this._priv=new f(y(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},o.prototype.computeSecret=function(t){t=new f(t),t=t.toRed(this._prime);var r=t.redPow(this._priv).fromRed(),n=new e(r.toArray()),i=this.getPrime();if(n.length<i.length){var a=new e(i.length-n.length);a.fill(0),n=e.concat([a,n])}return n},o.prototype.getPublicKey=function(t){return s(this._pub,t)},o.prototype.getPrivateKey=function(t){return s(this._priv,t)},o.prototype.getPrime=function(t){return s(this.__prime,t)},o.prototype.getGenerator=function(t){return s(this._gen,t)},o.prototype.setGenerator=function(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this.__gen=t,this._gen=new f(t),this}}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(t){u.Writable.call(this);var e=l[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=f(e.hash),this._tag=e.id,this._signType=e.sign}function i(t){u.Writable.call(this);var e=l[t];if(!e)throw new Error("Unknown message digest");this._hash=f(e.hash),this._tag=e.id,this._signType=e.sign}function a(t){return new n(t)}function o(t){return new i(t)}var s=r(70),f=r(40),c=r(41),h=r(125),u=r(54),d=r(171),l={};Object.keys(s).forEach(function(t){l[t]=l[t.toLowerCase()]=s[t]}),c(n,u.Writable),n.prototype._write=function(t,e,r){this._hash.update(t),r()},n.prototype.update=function(t,r){return"string"==typeof t&&(t=new e(t,r)),this._hash.update(t),this},n.prototype.sign=function(t,r){this.end();var n=this._hash.digest(),i=h(e.concat([this._tag,n]),t,this._hashType,this._signType);return r?i.toString(r):i},c(i,u.Writable),i.prototype._write=function(t,e,r){this._hash.update(t),r()},i.prototype.update=function(t,r){return"string"==typeof t&&(t=new e(t,r)),this._hash.update(t),this},i.prototype.verify=function(t,r,n){"string"==typeof r&&(r=new e(r,n)),this.end();var i=this._hash.digest();return d(r,e.concat([this._tag,i]),t,this._signType)},t.exports={Sign:a,Verify:o,createSign:a,createVerify:o}}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(t,e,r,n){var o=v(e);if(o.curve){if("ecdsa"!==n)throw new Error("wrong private key type");return i(t,o)}if("dsa"===o.type){if("dsa"!==n)throw new Error("wrong private key type");return a(t,o,r)}if("rsa"!==n)throw new Error("wrong private key type");for(var s=o.modulus.byteLength(),f=[0,1];t.length+f.length+1<s;)f.push(255);f.push(0);for(var c=-1;++c<t.length;)f.push(t[c]);var h=l(f,o);return h}function i(t,r){var n=p[r.curve.join(".")];if(!n)throw new Error("unknown curve "+r.curve.join("."));var i=new g(n),a=i.genKeyPair();a._importPrivate(r.privateKey);var o=a.sign(t);return new e(o.toDER())}function a(t,e,r){for(var n,i=e.params.priv_key,a=e.params.p,c=e.params.q,d=e.params.g,l=new y(0),p=f(t,c).mod(c),b=!1,v=s(i,c,t,r);b===!1;)n=h(c,v,r),l=u(d,n,a,c),b=n.invm(c).imul(p.add(i.mul(l))).mod(c),b.cmpn(0)||(b=!1,l=new y(0));return o(l,b)}function o(t,r){t=t.toArray(),r=r.toArray(),128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var n=t.length+r.length+4,i=[48,n,2,t.length];return i=i.concat(t,[2,r.length],r),new e(i)}function s(t,r,n,i){if(t=new e(t.toArray()),t.length<r.byteLength()){var a=new e(r.byteLength()-t.length);a.fill(0),t=e.concat([a,t])}var o=n.length,s=c(n,r),f=new e(o);f.fill(1);var h=new e(o);return h.fill(0),h=d(i,h).update(f).update(new e([0])).update(t).update(s).digest(),f=d(i,h).update(f).digest(),h=d(i,h).update(f).update(new e([1])).update(t).update(s).digest(),f=d(i,h).update(f).digest(),{k:h,v:f}}function f(t,e){var r=new y(t),n=(t.length<<3)-e.bitLength();return n>0&&r.ishrn(n),r}function c(t,r){t=f(t,r),t=t.mod(r);var n=new e(t.toArray());if(n.length<r.byteLength()){var i=new e(r.byteLength()-n.length);i.fill(0),n=e.concat([i,n])}return n}function h(t,r,n){var i,a;do{for(i=new e("");8*i.length<t.bitLength();)r.v=d(n,r.k).update(r.v).digest(),i=e.concat([i,r.v]);a=f(i,t),r.k=d(n,r.k).update(r.v).update(new e([0])).digest(),r.v=d(n,r.k).update(r.v).digest()}while(a.cmp(t)!==-1);return a}function u(t,e,r,n){return t.toRed(y.mont(r)).redPow(e).fromRed().mod(n)}var d=r(69),l=r(126),p=r(127),b=r(128),v=r(151),y=r(101),g=b.ec;t.exports=n,t.exports.getKey=s,t.exports.makeKey=h}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(t){var e=a(t),r=e.toRed(o.mont(t.modulus)).redPow(new o(t.publicExponent)).fromRed();return{blinder:r,unblinder:e.invm(t.modulus)}}function i(t,r){var i=n(r),a=r.modulus.byteLength(),s=(o.mont(r.modulus),new o(t).mul(i.blinder).umod(r.modulus)),f=s.toRed(o.mont(r.prime1)),c=s.toRed(o.mont(r.prime2)),h=r.coefficient,u=r.prime1,d=r.prime2,l=f.redPow(r.exponent1),p=c.redPow(r.exponent2);l=l.fromRed(),p=p.fromRed();var b=l.isub(p).imul(h).umod(u);return b.imul(d),p.iadd(b),new e(p.imul(i.unblinder).umod(r.modulus).toArray(!1,a))}function a(t){for(var e=t.modulus.byteLength(),r=new o(s(e));r.cmp(t.modulus)>=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new o(s(e));return r}var o=r(101),s=r(34);t.exports=i,i.getr=a}).call(e,r(35).Buffer)},function(t,e){"use strict";e["1.3.132.0.10"]="secp256k1",e["1.3.132.0.33"]="p224",e["1.2.840.10045.3.1.1"]="p192",e["1.2.840.10045.3.1.7"]="p256",e["1.3.132.0.34"]="p384",e["1.3.132.0.35"]="p521"},function(t,e,r){"use strict";var n=e;n.version=r(129).version,n.utils=r(130),n.rand=r(104),n.hmacDRBG=r(131),n.curve=r(138),n.curves=r(143),n.ec=r(145),n.eddsa=r(148)},function(t,e){t.exports={_args:[["elliptic@^6.0.0","/Users/stephan/Work/stratumn/mapexplorer-core/node_modules/browserify-sign"]],_from:"elliptic@>=6.0.0 <7.0.0",_id:"elliptic@6.3.1",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"6.0.0",_npmOperationalInternal:{host:"packages-16-east.internal.npmjs.com",tmp:"tmp/elliptic-6.3.1.tgz_1465921413402_0.5202967382501811"},_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"3.8.6",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.3.1.tgz",_shasum:"17781f2109ab0ec686b146bdcff5d2e8c6aeceda",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/Users/stephan/Work/stratumn/mapexplorer-core/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{shasum:"17781f2109ab0ec686b146bdcff5d2e8c6aeceda",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.3.1.tgz"},files:["lib"],gitHead:"c53f5cf3d832c0073eb4a4ed423a464cbce68f3e",homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",maintainers:[{email:"fedor@indutny.com",name:"indutny"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.3.1"}},function(t,e,r){"use strict";function n(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if(e){if("hex"===e){t=t.replace(/[^a-z0-9]+/gi,""),t.length%2!==0&&(t="0"+t);for(var n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),a=i>>8,o=255&i;a?r.push(a,o):r.push(o)}return r}function i(t){return 1===t.length?"0"+t:t}function a(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}function o(t,e){for(var r=[],n=1<<e+1,i=t.clone();i.cmpn(1)>=0;){var a;if(i.isOdd()){var o=i.andln(n-1);a=o>(n>>1)-1?(n>>1)-o:o,i.isubn(a)}else a=0;r.push(a);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?e+1:1,f=1;f<s;f++)r.push(0);i.iushrn(s)}return r}function s(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var a=t.andln(3)+n&3,o=e.andln(3)+i&3;3===a&&(a=-1),3===o&&(o=-1);var s;if(0===(1&a))s=0;else{var f=t.andln(7)+n&7;s=3!==f&&5!==f||2!==o?a:-a}r[0].push(s);var c;if(0===(1&o))c=0;else{var f=e.andln(7)+i&7;c=3!==f&&5!==f||2!==a?o:-o}r[1].push(c),2*n===s+1&&(n=1-n),2*i===c+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r}function f(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}}function c(t){return"string"==typeof t?u.toArray(t,"hex"):t}function h(t){return new d(t,"hex","le")}var u=e,d=r(101);u.assert=function(t,e){if(!t)throw new Error(e||"Assertion failed")},u.toArray=n,u.zero2=i,u.toHex=a,u.encode=function(t,e){return"hex"===e?a(t):t},u.getNAF=o,u.getJSF=s,u.cachedProperty=f,u.parseBytes=c,u.intFromLE=h},function(t,e,r){"use strict";function n(t){if(!(this instanceof n))return new n(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=o.toArray(t.entropy,t.entropyEnc),r=o.toArray(t.nonce,t.nonceEnc),i=o.toArray(t.pers,t.persEnc);s(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var i=r(132),a=r(128),o=a.utils,s=o.assert;t.exports=n,n.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this.reseed=1,this.reseedInterval=281474976710656},n.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},n.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},n.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=o.toBuffer(t,e),r=o.toBuffer(r,n),s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this.reseed=1},n.prototype.generate=function(t,e,r,n){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=o.toArray(r,n),this._update(r));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var a=i.slice(0,t);return this._update(r),this.reseed++,o.encode(a,e)}},function(t,e,r){var n=e;n.utils=r(133),n.common=r(134),n.sha=r(135),n.ripemd=r(136),n.hmac=r(137),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(t,e,r){function n(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e){t=t.replace(/[^a-z0-9]+/gi,""),t.length%2!==0&&(t="0"+t);for(var n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),a=i>>8,o=255&i;a?r.push(a,o):r.push(o)}else for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}function i(t){for(var e="",r=0;r<t.length;r++)e+=s(t[r].toString(16));return e}function a(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24;return e>>>0}function o(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=a(i)),r+=f(i.toString(16))}return r}function s(t){return 1===t.length?"0"+t:t}function f(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}function c(t,e,r,n){var i=r-e;y(i%4===0);for(var a=new Array(i/4),o=0,s=e;o<a.length;o++,s+=4){var f;f="big"===n?t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]:t[s+3]<<24|t[s+2]<<16|t[s+1]<<8|t[s],a[o]=f>>>0}return a}function h(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var a=t[n];"big"===e?(r[i]=a>>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r}function u(t,e){return t>>>e|t<<32-e}function d(t,e){return t<<e|t>>>32-e}function l(t,e){return t+e>>>0}function p(t,e,r){return t+e+r>>>0}function b(t,e,r,n){return t+e+r+n>>>0}function v(t,e,r,n,i){return t+e+r+n+i>>>0}function y(t,e){if(!t)throw new Error(e||"Assertion failed")}function g(t,e,r,n){var i=t[e],a=t[e+1],o=n+a>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o}function m(t,e,r,n){var i=e+n>>>0,a=(i<e?1:0)+t+r;return a>>>0}function _(t,e,r,n){var i=e+n;return i>>>0}function w(t,e,r,n,i,a,o,s){var f=0,c=e;c=c+n>>>0,f+=c<e?1:0,c=c+a>>>0,f+=c<a?1:0,c=c+s>>>0,f+=c<s?1:0;var h=t+r+i+o+f;return h>>>0}function S(t,e,r,n,i,a,o,s){var f=e+n+a+s;return f>>>0}function M(t,e,r,n,i,a,o,s,f,c){var h=0,u=e;u=u+n>>>0,h+=u<e?1:0,u=u+a>>>0,h+=u<a?1:0,u=u+s>>>0,h+=u<s?1:0,u=u+c>>>0,h+=u<c?1:0;var d=t+r+i+o+f+h;return d>>>0}function E(t,e,r,n,i,a,o,s,f,c){var h=e+n+a+s+c;return h>>>0}function k(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}function A(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}function x(t,e,r){return t>>>r}function I(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}var B=e,R=r(41);B.toArray=n,B.toHex=i,B.htonl=a,B.toHex32=o,B.zero2=s,B.zero8=f,B.join32=c,B.split32=h,B.rotr32=u,B.rotl32=d,B.sum32=l,B.sum32_3=p,B.sum32_4=b,B.sum32_5=v,B.assert=y,B.inherits=R,e.sum64=g,e.sum64_hi=m,e.sum64_lo=_,e.sum64_4_hi=w,e.sum64_4_lo=S,e.sum64_5_hi=M,e.sum64_5_lo=E,e.rotr64_hi=k,e.rotr64_lo=A,e.shr64_hi=x,e.shr64_lo=I},function(t,e,r){function n(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var i=r(132),a=i.utils,o=a.assert;e.BlockHash=n,n.prototype.update=function(t,e){if(t=a.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=a.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},n.prototype.digest=function(t){return this.update(this._pad()),o(null===this.pending),this._digest(t)},n.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else{n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0;for(var a=8;a<this.padLength;a++)n[i++]=0}return n}},function(t,e,r){function n(){return this instanceof n?(W.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=V,void(this.W=new Array(64))):new n}function i(){return this instanceof i?(n.call(this),void(this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])):new i}function a(){return this instanceof a?(W.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=J,void(this.W=new Array(160))):new a}function o(){return this instanceof o?(a.call(this),void(this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428])):new o}function s(){return this instanceof s?(W.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],void(this.W=new Array(80))):new s}function f(t,e,r){return t&e^~t&r}function c(t,e,r){return t&e^t&r^e&r}function h(t,e,r){return t^e^r}function u(t){return P(t,2)^P(t,13)^P(t,22)}function d(t){return P(t,6)^P(t,11)^P(t,25)}function l(t){return P(t,7)^P(t,18)^t>>>3}function p(t){return P(t,17)^P(t,19)^t>>>10}function b(t,e,r,n){return 0===t?f(e,r,n):1===t||3===t?h(e,r,n):2===t?c(e,r,n):void 0}function v(t,e,r,n,i,a){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function y(t,e,r,n,i,a){var o=e&n^~e&a;return o<0&&(o+=4294967296),o}function g(t,e,r,n,i,a){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function m(t,e,r,n,i,a){var o=e&n^e&a^n&a;return o<0&&(o+=4294967296),o}function _(t,e){var r=O(t,e,28),n=O(e,t,2),i=O(e,t,7),a=r^n^i;return a<0&&(a+=4294967296),a}function w(t,e){var r=D(t,e,28),n=D(e,t,2),i=D(e,t,7),a=r^n^i;return a<0&&(a+=4294967296),a}function S(t,e){var r=O(t,e,14),n=O(t,e,18),i=O(e,t,9),a=r^n^i;return a<0&&(a+=4294967296),a}function M(t,e){var r=D(t,e,14),n=D(t,e,18),i=D(e,t,9),a=r^n^i;return a<0&&(a+=4294967296),a}function E(t,e){var r=O(t,e,1),n=O(t,e,8),i=z(t,e,7),a=r^n^i;return a<0&&(a+=4294967296),a}function k(t,e){var r=D(t,e,1),n=D(t,e,8),i=q(t,e,7),a=r^n^i;return a<0&&(a+=4294967296),a}function A(t,e){var r=O(t,e,19),n=O(e,t,29),i=z(t,e,6),a=r^n^i;return a<0&&(a+=4294967296),a}function x(t,e){var r=D(t,e,19),n=D(e,t,29),i=q(t,e,6),a=r^n^i;return a<0&&(a+=4294967296),a}var I=r(132),B=I.utils,R=B.assert,P=B.rotr32,j=B.rotl32,T=B.sum32,C=B.sum32_4,L=B.sum32_5,O=B.rotr64_hi,D=B.rotr64_lo,z=B.shr64_hi,q=B.shr64_lo,U=B.sum64,N=B.sum64_hi,H=B.sum64_lo,F=B.sum64_4_hi,K=B.sum64_4_lo,X=B.sum64_5_hi,Y=B.sum64_5_lo,W=I.common.BlockHash,V=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],J=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],G=[1518500249,1859775393,2400959708,3395469782];
|
32
|
-
B.inherits(n,W),e.sha256=n,n.blockSize=512,n.outSize=256,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=C(p(r[n-2]),r[n-7],l(r[n-15]),r[n-16]);var i=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],h=this.h[4],b=this.h[5],v=this.h[6],y=this.h[7];R(this.k.length===r.length);for(var n=0;n<r.length;n++){var g=L(y,d(h),f(h,b,v),this.k[n],r[n]),m=T(u(i),c(i,a,o));y=v,v=b,b=h,h=T(s,g),s=o,o=a,a=i,i=T(g,m)}this.h[0]=T(this.h[0],i),this.h[1]=T(this.h[1],a),this.h[2]=T(this.h[2],o),this.h[3]=T(this.h[3],s),this.h[4]=T(this.h[4],h),this.h[5]=T(this.h[5],b),this.h[6]=T(this.h[6],v),this.h[7]=T(this.h[7],y)},n.prototype._digest=function(t){return"hex"===t?B.toHex32(this.h,"big"):B.split32(this.h,"big")},B.inherits(i,n),e.sha224=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(t){return"hex"===t?B.toHex32(this.h.slice(0,7),"big"):B.split32(this.h.slice(0,7),"big")},B.inherits(a,W),e.sha512=a,a.blockSize=1024,a.outSize=512,a.hmacStrength=192,a.padLength=128,a.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=A(r[n-4],r[n-3]),a=x(r[n-4],r[n-3]),o=r[n-14],s=r[n-13],f=E(r[n-30],r[n-29]),c=k(r[n-30],r[n-29]),h=r[n-32],u=r[n-31];r[n]=F(i,a,o,s,f,c,h,u),r[n+1]=K(i,a,o,s,f,c,h,u)}},a.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],a=this.h[2],o=this.h[3],s=this.h[4],f=this.h[5],c=this.h[6],h=this.h[7],u=this.h[8],d=this.h[9],l=this.h[10],p=this.h[11],b=this.h[12],E=this.h[13],k=this.h[14],A=this.h[15];R(this.k.length===r.length);for(var x=0;x<r.length;x+=2){var I=k,B=A,P=S(u,d),j=M(u,d),T=v(u,d,l,p,b,E),C=y(u,d,l,p,b,E),L=this.k[x],O=this.k[x+1],D=r[x],z=r[x+1],q=X(I,B,P,j,T,C,L,O,D,z),F=Y(I,B,P,j,T,C,L,O,D,z),I=_(n,i),B=w(n,i),P=g(n,i,a,o,s,f),j=m(n,i,a,o,s,f),K=N(I,B,P,j),W=H(I,B,P,j);k=b,A=E,b=l,E=p,l=u,p=d,u=N(c,h,q,F),d=H(h,h,q,F),c=s,h=f,s=a,f=o,a=n,o=i,n=N(q,F,K,W),i=H(q,F,K,W)}U(this.h,0,n,i),U(this.h,2,a,o),U(this.h,4,s,f),U(this.h,6,c,h),U(this.h,8,u,d),U(this.h,10,l,p),U(this.h,12,b,E),U(this.h,14,k,A)},a.prototype._digest=function(t){return"hex"===t?B.toHex32(this.h,"big"):B.split32(this.h,"big")},B.inherits(o,a),e.sha384=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?B.toHex32(this.h.slice(0,12),"big"):B.split32(this.h.slice(0,12),"big")},B.inherits(s,W),e.sha1=s,s.blockSize=512,s.outSize=160,s.hmacStrength=80,s.padLength=64,s.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=j(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);for(var i=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],f=this.h[4],n=0;n<r.length;n++){var c=~~(n/20),h=L(j(i,5),b(c,a,o,s),f,r[n],G[c]);f=s,s=o,o=j(a,30),a=i,i=h}this.h[0]=T(this.h[0],i),this.h[1]=T(this.h[1],a),this.h[2]=T(this.h[2],o),this.h[3]=T(this.h[3],s),this.h[4]=T(this.h[4],f)},s.prototype._digest=function(t){return"hex"===t?B.toHex32(this.h,"big"):B.split32(this.h,"big")}},function(t,e,r){function n(){return this instanceof n?(l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],void(this.endian="little")):new n}function i(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function a(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function o(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var s=r(132),f=s.utils,c=f.rotl32,h=f.sum32,u=f.sum32_3,d=f.sum32_4,l=s.common.BlockHash;f.inherits(n,l),e.ripemd160=n,n.blockSize=512,n.outSize=160,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],s=this.h[2],f=this.h[3],l=this.h[4],g=r,m=n,_=s,w=f,S=l,M=0;M<80;M++){var E=h(c(d(r,i(M,n,s,f),t[p[M]+e],a(M)),v[M]),l);r=l,l=f,f=c(s,10),s=n,n=E,E=h(c(d(g,i(79-M,m,_,w),t[b[M]+e],o(M)),y[M]),S),g=S,S=w,w=c(_,10),_=m,m=E}E=u(this.h[1],s,w),this.h[1]=u(this.h[2],f,S),this.h[2]=u(this.h[3],l,g),this.h[3]=u(this.h[4],r,m),this.h[4]=u(this.h[0],n,_),this.h[0]=E},n.prototype._digest=function(t){return"hex"===t?f.toHex32(this.h,"little"):f.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],v=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(t,e,r){function n(t,e,r){return this instanceof n?(this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,void this._init(a.toArray(e,r))):new n(t,e,r)}var i=r(132),a=i.utils,o=a.assert;t.exports=n,n.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),o(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(var e=0;e<t.length;e++)t[e]^=54;this.inner=(new this.Hash).update(t);for(var e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},n.prototype.update=function(t,e){return this.inner.update(t,e),this},n.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},function(t,e,r){"use strict";var n=e;n.base=r(139),n["short"]=r(140),n.mont=r(141),n.edwards=r(142)},function(t,e,r){"use strict";function n(t,e){this.type=t,this.p=new a(e.p,16),this.red=e.prime?a.red(e.prime):a.mont(this.p),this.zero=new a(0).toRed(this.red),this.one=new a(1).toRed(this.red),this.two=new a(2).toRed(this.red),this.n=e.n&&new a(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function i(t,e){this.curve=t,this.type=e,this.precomputed=null}var a=r(101),o=r(128),s=o.utils,f=s.getNAF,c=s.getJSF,h=s.assert;t.exports=n,n.prototype.point=function(){throw new Error("Not implemented")},n.prototype.validate=function(){throw new Error("Not implemented")},n.prototype._fixedNafMul=function(t,e){h(t.precomputed);var r=t._getDoubles(),n=f(e,1),i=(1<<r.step+1)-(r.step%2===0?2:1);i/=3;for(var a=[],o=0;o<n.length;o+=r.step){for(var s=0,e=o+r.step-1;e>=o;e--)s=(s<<1)+n[e];a.push(s)}for(var c=this.jpoint(null,null,null),u=this.jpoint(null,null,null),d=i;d>0;d--){for(var o=0;o<a.length;o++){var s=a[o];s===d?u=u.mixedAdd(r.points[o]):s===-d&&(u=u.mixedAdd(r.points[o].neg()))}c=c.add(u)}return c.toP()},n.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,a=f(e,r),o=this.jpoint(null,null,null),s=a.length-1;s>=0;s--){for(var e=0;s>=0&&0===a[s];s--)e++;if(s>=0&&e++,o=o.dblp(e),s<0)break;var c=a[s];h(0!==c),o="affine"===t.type?c>0?o.mixedAdd(i[c-1>>1]):o.mixedAdd(i[-c-1>>1].neg()):c>0?o.add(i[c-1>>1]):o.add(i[-c-1>>1].neg())}return"affine"===t.type?o.toP():o},n.prototype._wnafMulAdd=function(t,e,r,n,i){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,h=0,u=0;u<n;u++){var d=e[u],l=d._getNAFPoints(t);a[u]=l.wnd,o[u]=l.points}for(var u=n-1;u>=1;u-=2){var p=u-1,b=u;if(1===a[p]&&1===a[b]){var v=[e[p],null,null,e[b]];0===e[p].y.cmp(e[b].y)?(v[1]=e[p].add(e[b]),v[2]=e[p].toJ().mixedAdd(e[b].neg())):0===e[p].y.cmp(e[b].y.redNeg())?(v[1]=e[p].toJ().mixedAdd(e[b]),v[2]=e[p].add(e[b].neg())):(v[1]=e[p].toJ().mixedAdd(e[b]),v[2]=e[p].toJ().mixedAdd(e[b].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],g=c(r[p],r[b]);h=Math.max(g[0].length,h),s[p]=new Array(h),s[b]=new Array(h);for(var m=0;m<h;m++){var _=0|g[0][m],w=0|g[1][m];s[p][m]=y[3*(_+1)+(w+1)],s[b][m]=0,o[p]=v}}else s[p]=f(r[p],a[p]),s[b]=f(r[b],a[b]),h=Math.max(s[p].length,h),h=Math.max(s[b].length,h)}for(var S=this.jpoint(null,null,null),M=this._wnafT4,u=h;u>=0;u--){for(var E=0;u>=0;){for(var k=!0,m=0;m<n;m++)M[m]=0|s[m][u],0!==M[m]&&(k=!1);if(!k)break;E++,u--}if(u>=0&&E++,S=S.dblp(E),u<0)break;for(var m=0;m<n;m++){var d,A=M[m];0!==A&&(A>0?d=o[m][A-1>>1]:A<0&&(d=o[m][-A-1>>1].neg()),S="affine"===d.type?S.mixedAdd(d):S.add(d))}}for(var u=0;u<n;u++)o[u]=null;return i?S:S.toP()},n.BasePoint=i,i.prototype.eq=function(){throw new Error("Not implemented")},i.prototype.validate=function(){return this.curve.validate(this)},n.prototype.decodePoint=function(t,e){t=s.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1===2*r){6===t[0]?h(t[t.length-1]%2===0):7===t[0]&&h(t[t.length-1]%2===1);var n=this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));return n}if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},i.prototype.encodeCompressed=function(t){return this.encode(t,!0)},i.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},i.prototype.encode=function(t,e){return s.encode(this._encode(e),t)},i.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},i.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},i.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var a=0;a<t;a++)n=n.dbl();r.push(n)}return{step:t,points:r}},i.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},i.prototype._getBeta=function(){return null},i.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},function(t,e,r){"use strict";function n(t){h.call(this,"short",t),this.a=new f(t.a,16).toRed(this.red),this.b=new f(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function i(t,e,r,n){h.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new f(e,16),this.y=new f(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function a(t,e,r,n){h.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new f(0)):(this.x=new f(e,16),this.y=new f(r,16),this.z=new f(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var o=r(138),s=r(128),f=r(101),c=r(41),h=o.base,u=s.utils.assert;c(n,h),t.exports=n,n.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new f(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=n[0].cmp(n[1])<0?n[0]:n[1],e=e.toRed(this.red)}if(t.lambda)r=new f(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],u(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}var a;return a=t.basis?t.basis.map(function(t){return{a:new f(t.a,16),b:new f(t.b,16)}}):this._getEndoBasis(r),{beta:e,lambda:r,basis:a}}},n.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:f.mont(t),r=new f(2).toRed(e).redInvm(),n=r.redNeg(),i=new f(3).toRed(e).redNeg().redSqrt().redMul(r),a=n.redAdd(i).fromRed(),o=n.redSub(i).fromRed();return[a,o]},n.prototype._getEndoBasis=function(t){for(var e,r,n,i,a,o,s,c,h,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,l=this.n.clone(),p=new f(1),b=new f(0),v=new f(0),y=new f(1),g=0;0!==d.cmpn(0);){var m=l.div(d);c=l.sub(m.mul(d)),h=v.sub(m.mul(p));var _=y.sub(m.mul(b));if(!n&&c.cmp(u)<0)e=s.neg(),r=p,n=c.neg(),i=h;else if(n&&2===++g)break;s=c,l=d,d=c,v=p,p=h,y=b,b=_}a=c.neg(),o=h;var w=n.sqr().add(i.sqr()),S=a.sqr().add(o.sqr());return S.cmp(w)>=0&&(a=e,o=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:n,b:i},{a:a,b:o}]},n.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),a=r.b.neg().mul(t).divRound(this.n),o=i.mul(r.a),s=a.mul(n.a),f=i.mul(r.b),c=a.mul(n.b),h=t.sub(o).sub(s),u=f.add(c).neg();return{k1:h,k2:u}},n.prototype.pointFromX=function(t,e){t=new f(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},n.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},n.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a<t.length;a++){var o=this._endoSplit(e[a]),s=t[a],f=s._getBeta();o.k1.negative&&(o.k1.ineg(),s=s.neg(!0)),o.k2.negative&&(o.k2.ineg(),f=f.neg(!0)),n[2*a]=s,n[2*a+1]=f,i[2*a]=o.k1,i[2*a+1]=o.k2}for(var c=this._wnafMulAdd(1,n,i,2*a,r),h=0;h<2*a;h++)n[h]=null,i[h]=null;return c},c(i,h.BasePoint),n.prototype.point=function(t,e,r){return new i(this,t,e,r)},n.prototype.pointFromJSON=function(t,e){return i.fromJSON(this,t,e)},i.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},i.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},i.fromJSON=function(t,e,r){function n(e){return t.point(e[0],e[1],r)}"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;var a=e[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(n))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(n))}},i},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return this.inf},i.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},i.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},i.prototype.getX=function(){return this.x.fromRed()},i.prototype.getY=function(){return this.y.fromRed()},i.prototype.mul=function(t){return t=new f(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},i.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},i.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},i.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},i.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},i.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t},c(a,h.BasePoint),n.prototype.jpoint=function(t,e,r){return new a(this,t,e,r)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),a=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),f=a.redSub(o);if(0===s.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),h=c.redMul(s),u=n.redMul(c),d=f.redSqr().redIAdd(h).redISub(u).redISub(u),l=f.redMul(u.redISub(d)).redISub(a.redMul(h)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(d,l,p)},a.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,a=t.y.redMul(e).redMul(this.z),o=r.redSub(n),s=i.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),c=f.redMul(o),h=r.redMul(f),u=s.redSqr().redIAdd(c).redISub(h).redISub(h),d=s.redMul(h.redISub(u)).redISub(i.redMul(c)),l=this.z.redMul(o);return this.curve.jpoint(u,d,l)},a.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}for(var n=this.curve.a,i=this.curve.tinv,a=this.x,o=this.y,s=this.z,f=s.redSqr().redSqr(),c=o.redAdd(o),r=0;r<t;r++){var h=a.redSqr(),u=c.redSqr(),d=u.redSqr(),l=h.redAdd(h).redIAdd(h).redIAdd(n.redMul(f)),p=a.redMul(u),b=l.redSqr().redISub(p.redAdd(p)),v=p.redISub(b),y=l.redMul(v);y=y.redIAdd(y).redISub(d);var g=c.redMul(s);r+1<t&&(f=f.redMul(d)),a=b,s=g,c=y}return this.curve.jpoint(a,c.redMul(i),s)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},a.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(a);o=o.redIAdd(o);var s=n.redAdd(n).redIAdd(n),f=s.redSqr().redISub(o).redISub(o),c=a.redIAdd(a);c=c.redIAdd(c),c=c.redIAdd(c),t=f,e=s.redMul(o.redISub(f)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),u=this.y.redSqr(),d=u.redSqr(),l=this.x.redAdd(u).redSqr().redISub(h).redISub(d);l=l.redIAdd(l);var p=h.redAdd(h).redIAdd(h),b=p.redSqr(),v=d.redIAdd(d);v=v.redIAdd(v),v=v.redIAdd(v),t=b.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(v),r=this.y.redMul(this.z),r=r.redIAdd(r)}return this.curve.jpoint(t,e,r)},a.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(a);o=o.redIAdd(o);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),f=s.redSqr().redISub(o).redISub(o);t=f;var c=a.redIAdd(a);c=c.redIAdd(c),c=c.redIAdd(c),e=s.redMul(o.redISub(f)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),u=this.y.redSqr(),d=this.x.redMul(u),l=this.x.redSub(h).redMul(this.x.redAdd(h));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d);p=p.redIAdd(p);var b=p.redAdd(p);t=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(u).redISub(h);var v=u.redSqr();v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v),e=l.redMul(p.redISub(t)).redISub(v)}return this.curve.jpoint(t,e,r)},a.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),a=e.redSqr(),o=r.redSqr(),s=a.redAdd(a).redIAdd(a).redIAdd(t.redMul(i)),f=e.redAdd(e);f=f.redIAdd(f);var c=f.redMul(o),h=s.redSqr().redISub(c.redAdd(c)),u=c.redISub(h),d=o.redSqr();d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var l=s.redMul(u).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(h,l,p)},a.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),a=i.redSqr(),o=this.x.redAdd(e).redSqr().redISub(t).redISub(n);o=o.redIAdd(o),o=o.redAdd(o).redIAdd(o),o=o.redISub(a);var s=o.redSqr(),f=n.redIAdd(n);f=f.redIAdd(f),f=f.redIAdd(f),f=f.redIAdd(f);var c=i.redIAdd(o).redSqr().redISub(a).redISub(s).redISub(f),h=e.redMul(c);h=h.redIAdd(h),h=h.redIAdd(h);var u=this.x.redMul(s).redISub(h);u=u.redIAdd(u),u=u.redIAdd(u);var d=this.y.redMul(c.redMul(f.redISub(c)).redISub(o.redMul(s)));d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var l=this.z.redAdd(o).redSqr().redISub(r).redISub(s);return this.curve.jpoint(u,d,l)},a.prototype.mul=function(t,e){return t=new f(t,e),this.curve._wnafMul(this,t)},a.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},a.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},a.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){"use strict";function n(t){f.call(this,"mont",t),this.a=new o(t.a,16).toRed(this.red),this.b=new o(t.b,16).toRed(this.red),this.i4=new o(4).toRed(this.red).redInvm(),this.two=new o(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(t,e,r){f.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new o(e,16),this.z=new o(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var a=r(138),o=r(101),s=r(41),f=a.base,c=r(128),h=c.utils;s(n,f),t.exports=n,n.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e),i=n.redSqrt();return 0===i.redSqr().cmp(n)},s(i,f.BasePoint),n.prototype.decodePoint=function(t,e){return this.point(h.toArray(t,e),1)},n.prototype.point=function(t,e){return new i(this,t,e)},n.prototype.pointFromJSON=function(t){return i.fromJSON(this,t)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(t,e){return new i(t,e[0],e[1]||t.one)},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var t=this.x.redAdd(this.z),e=t.redSqr(),r=this.x.redSub(this.z),n=r.redSqr(),i=e.redSub(n),a=e.redMul(n),o=i.redMul(n.redAdd(this.curve.a24.redMul(i)));return this.curve.point(a,o)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),a=t.x.redSub(t.z),o=a.redMul(r),s=i.redMul(n),f=e.z.redMul(o.redAdd(s).redSqr()),c=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(f,c)},i.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=this,a=[];0!==e.cmpn(0);e.iushrn(1))a.push(e.andln(1));for(var o=a.length-1;o>=0;o--)0===a[o]?(r=r.diffAdd(n,i),n=n.dbl()):(n=r.diffAdd(n,i),r=r.dbl());return n},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){"use strict";function n(t){this.twisted=1!==(0|t.a),this.mOneA=this.twisted&&(0|t.a)===-1,this.extended=this.mOneA,c.call(this,"edwards",t),this.a=new s(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new s(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new s(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),h(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|t.c)}function i(t,e,r,n,i){c.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new s(e,16),this.y=new s(r,16),this.z=n?new s(n,16):this.curve.one,this.t=i&&new s(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var a=r(138),o=r(128),s=r(101),f=r(41),c=a.base,h=o.utils.assert;f(n,c),t.exports=n,n.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},n.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},n.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},n.prototype.pointFromX=function(t,e){t=new s(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var f=o.fromRed().isOdd();return(e&&!f||!e&&f)&&(o=o.redNeg()),this.point(t,o)},n.prototype.pointFromY=function(t,e){t=new s(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.one),i=r.redMul(this.d).redAdd(this.one),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return o.isOdd()!==e&&(o=o.redNeg()),this.point(o,t)},n.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},f(i,c.BasePoint),n.prototype.pointFromJSON=function(t){return i.fromJSON(this,t)},n.prototype.point=function(t,e,r,n){return new i(this,t,e,r,n)},i.fromJSON=function(t,e){return new i(t,e[0],e[1],e[2])},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},i.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),a=n.redAdd(e),o=a.redSub(r),s=n.redSub(e),f=i.redMul(o),c=a.redMul(s),h=i.redMul(s),u=o.redMul(a);return this.curve.point(f,c,u,h)},i.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=this.curve._mulA(i),s=o.redAdd(a);if(this.zOne)t=n.redSub(i).redSub(a).redMul(s.redSub(this.curve.two)),e=s.redMul(o.redSub(a)),r=s.redSqr().redSub(s).redSub(s);else{var f=this.z.redSqr(),c=s.redSub(f).redISub(f);t=n.redSub(i).redISub(a).redMul(c),e=s.redMul(o.redSub(a)),r=s.redMul(c)}}else{var o=i.redAdd(a),f=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=o.redSub(f).redSub(f);t=this.curve._mulC(n.redISub(o)).redMul(c),e=this.curve._mulC(o).redMul(i.redISub(a)),r=o.redMul(c)}return this.curve.point(t,e,r)},i.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},i.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),a=r.redSub(e),o=i.redSub(n),s=i.redAdd(n),f=r.redAdd(e),c=a.redMul(o),h=s.redMul(f),u=a.redMul(f),d=o.redMul(s);return this.curve.point(c,h,d,u)},i.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),a=this.x.redMul(t.x),o=this.y.redMul(t.y),s=this.curve.d.redMul(a).redMul(o),f=i.redSub(s),c=i.redAdd(s),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(a).redISub(o),u=n.redMul(f).redMul(h);return this.curve.twisted?(e=n.redMul(c).redMul(o.redSub(this.curve._mulA(a))),r=f.redMul(c)):(e=n.redMul(c).redMul(o.redSub(a)),r=this.curve._mulC(f).redMul(c)),this.curve.point(u,e,r)},i.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},i.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},i.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},i.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},i.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},i.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()},i.prototype.getY=function(){return this.normalize(),this.y.fromRed()},i.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},i.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}return!1},i.prototype.toP=i.prototype.normalize,i.prototype.mixedAdd=i.prototype.add},function(t,e,r){"use strict";function n(t){"short"===t.type?this.curve=new s.curve["short"](t):"edwards"===t.type?this.curve=new s.curve.edwards(t):this.curve=new s.curve.mont(t),
|
33
|
-
this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function i(t,e){Object.defineProperty(a,t,{configurable:!0,enumerable:!0,get:function(){var r=new n(e);return Object.defineProperty(a,t,{configurable:!0,enumerable:!0,value:r}),r}})}var a=e,o=r(132),s=r(128),f=s.utils.assert;a.PresetCurve=n,i("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),i("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),i("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),i("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),i("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),i("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),i("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=r(144)}catch(h){c=void 0}i("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})},function(t,e){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(t,e,r){"use strict";function n(t){return this instanceof n?("string"==typeof t&&(s(a.curves.hasOwnProperty(t),"Unknown curve "+t),t=a.curves[t]),t instanceof a.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),void(this.hash=t.hash||t.curve.hash)):new n(t)}var i=r(101),a=r(128),o=a.utils,s=o.assert,f=r(146),c=r(147);t.exports=n,n.prototype.keyPair=function(t){return new f(this,t)},n.prototype.keyFromPrivate=function(t,e){return f.fromPrivate(this,t,e)},n.prototype.keyFromPublic=function(t,e){return f.fromPublic(this,t,e)},n.prototype.genKeyPair=function(t){t||(t={});for(var e=new a.hmacDRBG({hash:this.hash,pers:t.pers,entropy:t.entropy||a.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i(2));;){var o=new i(e.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),
|
34
|
-
this.keyFromPrivate(o)}},n.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},n.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var o=this.n.byteLength(),s=e.getPrivate().toArray("be",o),f=t.toArray("be",o),h=new a.hmacDRBG({hash:this.hash,entropy:s,nonce:f,pers:n.pers,persEnc:n.persEnc}),u=this.n.sub(new i(1)),d=0;!0;d++){var l=n.k?n.k(d):new i(h.generate(this.n.byteLength()));if(l=this._truncateToN(l,!0),!(l.cmpn(1)<=0||l.cmp(u)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),v=b.umod(this.n);if(0!==v.cmpn(0)){var y=l.invm(this.n).mul(v.mul(e.getPrivate()).iadd(t));if(y=y.umod(this.n),0!==y.cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==b.cmp(v)?2:0);return n.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),g^=1),new c({r:v,s:y,recoveryParam:g})}}}}}},n.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n),e=new c(e,"hex");var a=e.r,o=e.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s=o.invm(this.n),f=s.mul(t).umod(this.n),h=s.mul(a).umod(this.n);if(!this.curve._maxwellTrick){var u=this.g.mulAdd(f,r.getPublic(),h);return!u.isInfinity()&&0===u.getX().umod(this.n).cmp(a)}var u=this.g.jmulAdd(f,r.getPublic(),h);return!u.isInfinity()&&u.eqXToP(a)},n.prototype.recoverPubKey=function(t,e,r,n){s((3&r)===r,"The recovery param is more than two bits"),e=new c(e,n);var a=this.n,o=new i(t),f=e.r,h=e.s,u=1&r,d=r>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");f=d?this.curve.pointFromX(f.add(this.curve.n),u):this.curve.pointFromX(f,u);var l=a.sub(o),p=e.r.invm(a);return this.g.mulAdd(l,f,h).mul(p)},n.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new c(e,n),null!==e.recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch(t){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){"use strict";function n(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var i=r(101);t.exports=n,n.fromPublic=function(t,e,r){return e instanceof n?e:new n(t,{pub:e,pubEnc:r})},n.fromPrivate=function(t,e,r){return e instanceof n?e:new n(t,{priv:e,privEnc:r})},n.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},n.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},n.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},n.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},n.prototype._importPublic=function(t,e){return t.x||t.y?void(this.pub=this.ec.curve.point(t.x,t.y)):void(this.pub=this.ec.curve.decodePoint(t,e))},n.prototype.derive=function(t){return t.mul(this.priv).getX()},n.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},n.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},n.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(t,e,r){"use strict";function n(t,e){return t instanceof n?t:void(this._importDER(t,e)||(u(t.r&&t.s,"Signature without r or s"),this.r=new f(t.r,16),this.s=new f(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam))}function i(){this.place=0}function a(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,a=0,o=e.place;a<n;a++,o++)i<<=8,i|=t[o];return e.place=o,i}function o(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function s(t,e){if(e<128)return void t.push(e);var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}var f=r(101),c=r(128),h=c.utils,u=h.assert;t.exports=n,n.prototype._importDER=function(t,e){t=h.toArray(t,e);var r=new i;if(48!==t[r.place++])return!1;var n=a(t,r);if(n+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=a(t,r),s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var c=a(t,r);if(t.length!==c+r.place)return!1;var u=t.slice(r.place,c+r.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===u[0]&&128&u[1]&&(u=u.slice(1)),this.r=new f(s),this.s=new f(u),this.recoveryParam=null,!0},n.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=o(e),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];s(n,e.length),n=n.concat(e),n.push(2),s(n,r.length);var i=n.concat(r),a=[48];return s(a,i.length),a=a.concat(i),h.encode(a,t)}},function(t,e,r){"use strict";function n(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof n))return new n(t);var t=a.curves[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}var i=r(132),a=r(128),o=a.utils,s=o.assert,f=o.parseBytes,c=r(149),h=r(150);t.exports=n,n.prototype.sign=function(t,e){t=f(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),a=this.encodePoint(i),o=this.hashInt(a,r.pubBytes(),t).mul(r.priv()),s=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:a})},n.prototype.verify=function(t,e,r){t=f(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),a=this.g.mul(e.S()),o=e.R().add(n.pub().mul(i));return o.eq(a)},n.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},n.prototype.keyFromPublic=function(t){return c.fromPublic(this,t)},n.prototype.keyFromSecret=function(t){return c.fromSecret(this,t)},n.prototype.makeSignature=function(t){return t instanceof h?t:new h(this,t)},n.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},n.prototype.decodePoint=function(t){t=o.parseBytes(t);var e=t.length-1,r=t.slice(0,e).concat(t[e]&-129),n=0!==(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},n.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},n.prototype.decodeInt=function(t){return o.intFromLE(t)},n.prototype.isPoint=function(t){return t instanceof this.pointClass}},function(t,e,r){"use strict";function n(t,e){this.eddsa=t,this._secret=s(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=s(e.pub)}var i=r(128),a=i.utils,o=a.assert,s=a.parseBytes,f=a.cachedProperty;n.fromPublic=function(t,e){return e instanceof n?e:new n(t,{pub:e})},n.fromSecret=function(t,e){return e instanceof n?e:new n(t,{secret:e})},n.prototype.secret=function(){return this._secret},f(n,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),f(n,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),f(n,"privBytes",function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),f(n,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),f(n,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),f(n,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),n.prototype.sign=function(t){return o(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},n.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},n.prototype.getSecret=function(t){return o(this._secret,"KeyPair is public only"),a.encode(this.secret(),t)},n.prototype.getPublic=function(t){return a.encode(this.pubBytes(),t)},t.exports=n},function(t,e,r){"use strict";function n(t,e){this.eddsa=t,"object"!=typeof e&&(e=c(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),s(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}var i=r(101),a=r(128),o=a.utils,s=o.assert,f=o.cachedProperty,c=o.parseBytes;f(n,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),f(n,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),f(n,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),f(n,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),n.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},n.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},t.exports=n},function(t,e,r){(function(e){function n(t){var r;"object"!=typeof t||e.isBuffer(t)||(r=t.passphrase,t=t.key),"string"==typeof t&&(t=new e(t));var n,o,f=s(t,r),c=f.tag,h=f.data;switch(c){case"PUBLIC KEY":switch(o=a.PublicKey.decode(h,"der"),n=o.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return a.RSAPublicKey.decode(o.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return o.subjectPrivateKey=o.subjectPublicKey,{type:"ec",data:o};case"1.2.840.10040.4.1":return o.algorithm.params.pub_key=a.DSAparam.decode(o.subjectPublicKey.data,"der"),{type:"dsa",data:o.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+c);case"ENCRYPTED PRIVATE KEY":h=a.EncryptedPrivateKey.decode(h,"der"),h=i(h,r);case"PRIVATE KEY":switch(o=a.PrivateKey.decode(h,"der"),n=o.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return a.RSAPrivateKey.decode(o.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:o.algorithm.curve,privateKey:a.ECPrivateKey.decode(o.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return o.algorithm.params.priv_key=a.DSAparam.decode(o.subjectPrivateKey,"der"),{type:"dsa",params:o.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+c);case"RSA PUBLIC KEY":return a.RSAPublicKey.decode(h,"der");case"RSA PRIVATE KEY":return a.RSAPrivateKey.decode(h,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:a.DSAPrivateKey.decode(h,"der")};case"EC PRIVATE KEY":return h=a.ECPrivateKey.decode(h,"der"),{curve:h.parameters.value,privateKey:h.privateKey};default:throw new Error("unknown key type "+c)}}function i(t,r){var n=t.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),a=o[t.algorithm.decrypt.cipher.algo.join(".")],s=t.algorithm.decrypt.cipher.iv,h=t.subjectPrivateKey,u=parseInt(a.split("-")[1],10)/8,d=c.pbkdf2Sync(r,n,i,u),l=f.createDecipheriv(a,d,s),p=[];return p.push(l.update(h)),p.push(l["final"]()),e.concat(p)}var a=r(152),o=r(169),s=r(170),f=r(74),c=r(71);t.exports=n,n.signature=a.signature}).call(e,r(35).Buffer)},function(t,e,r){var n=r(153),i=n.define("RSAPrivateKey",function(){this.seq().obj(this.key("version")["int"](),this.key("modulus")["int"](),this.key("publicExponent")["int"](),this.key("privateExponent")["int"](),this.key("prime1")["int"](),this.key("prime2")["int"](),this.key("exponent1")["int"](),this.key("exponent2")["int"](),this.key("coefficient")["int"]())});e.RSAPrivateKey=i;var a=n.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus")["int"](),this.key("publicExponent")["int"]())});e.RSAPublicKey=a;var o=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});e.PublicKey=o;var s=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p")["int"](),this.key("q")["int"](),this.key("g")["int"]()).optional())}),f=n.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version")["int"](),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});e.PrivateKey=f;var c=n.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters")["int"]())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});e.EncryptedPrivateKey=c;var h=n.define("DSAPrivateKey",function(){this.seq().obj(this.key("version")["int"](),this.key("p")["int"](),this.key("q")["int"](),this.key("g")["int"](),this.key("pub_key")["int"](),this.key("priv_key")["int"]())});e.DSAPrivateKey=h,e.DSAparam=n.define("DSAparam",function(){this["int"]()});var u=n.define("ECPrivateKey",function(){this.seq().obj(this.key("version")["int"](),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(d),this.key("publicKey").optional().explicit(1).bitstr())});e.ECPrivateKey=u;var d=n.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});e.signature=n.define("signature",function(){this.seq().obj(this.key("r")["int"](),this.key("s")["int"]())})},function(t,e,r){var n=e;n.bignum=r(101),n.define=r(154).define,n.base=r(157),n.constants=r(161),n.decoders=r(163),n.encoders=r(166)},function(t,e,r){function n(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}var i=r(153),a=r(41),o=e;o.define=function(t,e){return new n(t,e)},n.prototype._createNamed=function(t){var e;try{e=r(155).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(n){e=function(t){this._initNamed(t)}}return a(e,t),e.prototype._initNamed=function(e){t.call(this,e)},new e(this)},n.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i.decoders[t])),this.decoders[t]},n.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},n.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(i.encoders[t])),this.encoders[t]},n.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},function(module,exports,__webpack_require__){function Context(){}var indexOf=__webpack_require__(156),Object_keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var r in t)e.push(r);return e},forEach=function(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r<t.length;r++)e(t[r],r,t)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(t,e,r){Object.defineProperty(t,e,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch(t){return function(t,e,r){t[e]=r}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];Context.prototype={};var Script=exports.Script=function(t){return this instanceof Script?void(this.code=t):new Script(t)};Script.prototype.runInContext=function(t){if(!(t instanceof Context))throw new TypeError("needs a 'context' argument.");var e=document.createElement("iframe");e.style||(e.style={}),e.style.display="none",document.body.appendChild(e);var r=e.contentWindow,n=r.eval,i=r.execScript;!n&&i&&(i.call(r,"null"),n=r.eval),forEach(Object_keys(t),function(e){r[e]=t[e]}),forEach(globals,function(e){t[e]&&(r[e]=t[e])});var a=Object_keys(r),o=n.call(r,this.code);return forEach(Object_keys(r),function(e){(e in t||indexOf(a,e)===-1)&&(t[e]=r[e])}),forEach(globals,function(e){e in t||defineProp(t,e,r[e])}),document.body.removeChild(e),o},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(t){var e=Script.createContext(t),r=this.runInContext(e);return forEach(Object_keys(e),function(r){t[r]=e[r]}),r},forEach(Object_keys(Script.prototype),function(t){exports[t]=Script[t]=function(e){var r=Script(e);return r[t].apply(r,[].slice.call(arguments,1))}}),exports.createScript=function(t){return exports.Script(t)},exports.createContext=Script.createContext=function(t){var e=new Context;return"object"==typeof t&&forEach(Object_keys(t),function(r){e[r]=t[r]}),e}},function(t,e){var r=[].indexOf;t.exports=function(t,e){if(r)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}},function(t,e,r){var n=e;n.Reporter=r(158).Reporter,n.DecoderBuffer=r(159).DecoderBuffer,n.EncoderBuffer=r(159).EncoderBuffer,n.Node=r(160)},function(t,e,r){function n(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function i(t,e){this.path=t,this.rethrow(e)}var a=r(41);e.Reporter=n,n.prototype.isError=function(t){return t instanceof i},n.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},n.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},n.prototype.enterKey=function(t){return this._reporterState.path.push(t)},n.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},n.prototype.leaveKey=function(t,e,r){var n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[e]=r)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},n.prototype.leaveObject=function(t){var e=this._reporterState,r=e.obj;return e.obj=t,r},n.prototype.error=function(t){var e,r=this._reporterState,n=t instanceof i;if(e=n?t:new i(r.path.map(function(t){return"["+JSON.stringify(t)+"]"}).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},n.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},a(i,Error),i.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,i),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(t,e,r){function n(t,e){return o.call(this,e),s.isBuffer(t)?(this.base=t,this.offset=0,void(this.length=t.length)):void this.error("Input not Buffer")}function i(t,e){if(Array.isArray(t))this.length=0,this.value=t.map(function(t){return t instanceof i||(t=new i(t,e)),this.length+=t.length,t},this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=s.byteLength(t);else{if(!s.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}var a=r(41),o=r(157).Reporter,s=r(35).Buffer;a(n,o),e.DecoderBuffer=n,n.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},n.prototype.restore=function(t){var e=new n(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,o.prototype.restore.call(this,t.reporter),e},n.prototype.isEmpty=function(){return this.offset===this.length},n.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},n.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");var r=new n(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},n.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.EncoderBuffer=i,i.prototype.join=function(t,e){return t||(t=new s(this.length)),e||(e=0),0===this.length?t:(Array.isArray(this.value)?this.value.forEach(function(r){r.join(t,e),e+=r.length}):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):s.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length),t)}},function(t,e,r){function n(t,e){var r={};this._baseState=r,r.enc=t,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r["default"]=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}var i=r(157).Reporter,a=r(157).EncoderBuffer,o=r(157).DecoderBuffer,s=r(94),f=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(f),h=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];t.exports=n;var u=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];n.prototype.clone=function(){var t=this._baseState,e={};u.forEach(function(r){e[r]=t[r]});var r=new this.constructor(e.parent);return r._baseState=e,r},n.prototype._wrap=function(){var t=this._baseState;c.forEach(function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}},this)},n.prototype._init=function(t){var e=this._baseState;s(null===e.parent),t.call(this),e.children=e.children.filter(function(t){return t._baseState.parent===this},this),s.equal(e.children.length,1,"Root node can have only one child")},n.prototype._useArgs=function(t){var e=this._baseState,r=t.filter(function(t){return t instanceof this.constructor},this);t=t.filter(function(t){return!(t instanceof this.constructor)},this),0!==r.length&&(s(null===e.children),e.children=r,r.forEach(function(t){t._baseState.parent=this},this)),0!==t.length&&(s(null===e.args),e.args=t,e.reverseArgs=t.map(function(t){if("object"!=typeof t||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach(function(r){r==(0|r)&&(r|=0);var n=t[r];e[n]=r}),e}))},h.forEach(function(t){n.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}}),f.forEach(function(t){n.prototype[t]=function(){var e=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===e.tag),e.tag=t,this._useArgs(r),this}}),n.prototype.use=function(t){var e=this._baseState;return s(null===e.use),e.use=t,this},n.prototype.optional=function(){var t=this._baseState;return t.optional=!0,this},n.prototype.def=function(t){var e=this._baseState;return s(null===e["default"]),e["default"]=t,e.optional=!0,this},n.prototype.explicit=function(t){var e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.explicit=t,this},n.prototype.implicit=function(t){var e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.implicit=t,this},n.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},n.prototype.key=function(t){var e=this._baseState;return s(null===e.key),e.key=t,this},n.prototype.any=function(){var t=this._baseState;return t.any=!0,this},n.prototype.choice=function(t){var e=this._baseState;return s(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map(function(e){return t[e]})),this},n.prototype.contains=function(t){var e=this._baseState;return s(null===e.use),e.contains=t,this},n.prototype._decode=function(t,e){var r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));var n=r["default"],i=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){var s=null;if(null!==r.explicit?s=r.explicit:null!==r.implicit?s=r.implicit:null!==r.tag&&(s=r.tag),null!==s||r.any){if(i=this._peekTag(t,s,r.any),t.isError(i))return i}else{var f=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),i=!0}catch(c){i=!1}t.restore(f)}}var h;if(r.obj&&i&&(h=t.enterObject()),i){if(null!==r.explicit){var u=this._decodeTag(t,r.explicit);if(t.isError(u))return u;t=u}var d=t.offset;if(null===r.use&&null===r.choice){if(r.any)var f=t.save();var l=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(l))return l;r.any?n=t.raw(f):t=l}if(e&&e.track&&null!==r.tag&&e.track(t.path(),d,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),n=r.any?n:null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),t.isError(n))return n;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function(r){r._decode(t,e)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var p=new o(n);n=this._getUse(r.contains,t._reporterState.obj)._decode(p,e)}}return r.obj&&i&&(n=t.leaveObject(h)),null===r.key||null===n&&i!==!0?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,n),n},n.prototype._decodeGeneric=function(t,e,r){var n=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,n.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&n.args?this._decodeObjid(e,n.args[0],n.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"int"===t||"enum"===t?this._decodeInt(e,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},n.prototype._getUse=function(t,e){var r=this._baseState;return r.useDecoder=this._use(t,e),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},n.prototype._decodeChoice=function(t,e){var r=this._baseState,n=null,i=!1;return Object.keys(r.choice).some(function(a){var o=t.save(),s=r.choice[a];try{var f=s._decode(t,e);if(t.isError(f))return!1;n={type:a,value:f},i=!0}catch(c){return t.restore(o),!1}return!0},this),i?n:t.error("Choice not matched")},n.prototype._createEncoderBuffer=function(t){return new a(t,this.reporter)},n.prototype._encode=function(t,e,r){var n=this._baseState;if(null===n["default"]||n["default"]!==t){var i=this._encodeValue(t,e,r);if(void 0!==i&&!this._skipDefault(i,e,r))return i}},n.prototype._encodeValue=function(t,e,r){var n=this._baseState;if(null===n.parent)return n.children[0]._encode(t,e||new i);var a=null;if(this.reporter=e,n.optional&&void 0===t){if(null===n["default"])return;t=n["default"]}var o=null,s=!1;if(n.any)a=this._createEncoderBuffer(t);else if(n.choice)a=this._encodeChoice(t,e);else if(n.contains)o=this._getUse(n.contains,r)._encode(t,e),s=!0;else if(n.children)o=n.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");var n=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");var i=r._encode(t[r._baseState.key],e,t);return e.leaveKey(n),i},this).filter(function(t){return t}),o=this._createEncoderBuffer(o);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return e.error("Too many args for : "+n.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var f=this.clone();f._baseState.implicit=null,o=this._createEncoderBuffer(t.map(function(r){var n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)},f))}else null!==n.use?a=this._getUse(n.use,r)._encode(t,e):(o=this._encodePrimitive(n.tag,t),s=!0);var a;if(!n.any&&null===n.choice){var c=null!==n.implicit?n.implicit:n.tag,h=null===n.implicit?"universal":"context";null===c?null===n.use&&e.error("Tag could be ommited only for .use()"):null===n.use&&(a=this._encodeComposite(c,s,h,o))}return null!==n.explicit&&(a=this._encodeComposite(n.explicit,!1,"context",a)),a},n.prototype._encodeChoice=function(t,e){var r=this._baseState,n=r.choice[t.type];return n||s(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},n.prototype._encodePrimitive=function(t,e){var r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);throw new Error("Unsupported tag: "+t)},n.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},n.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t)}},function(t,e,r){var n=e;n._reverse=function(t){var e={};return Object.keys(t).forEach(function(r){(0|r)==r&&(r=0|r);var n=t[r];e[n]=r}),e},n.der=r(162)},function(t,e,r){var n=r(161);e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=n._reverse(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=n._reverse(e.tag)},function(t,e,r){var n=e;n.der=r(164),n.pem=r(165)},function(t,e,r){function n(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new i,this.tree._init(t.body)}function i(t){c.Node.call(this,"der",t)}function a(t,e){var r=t.readUInt8(e);if(t.isError(r))return r;var n=u.tagClass[r>>6],i=0===(32&r);if(31===(31&r)){var a=r;for(r=0;128===(128&a);){if(a=t.readUInt8(e),t.isError(a))return a;r<<=7,r|=127&a}}else r&=31;var o=u.tag[r];return{cls:n,primitive:i,tag:r,tagStr:o}}function o(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0===(128&n))return n;var i=127&n;if(i>=4)return t.error("length octect is too long");n=0;for(var a=0;a<i;a++){n<<=8;var o=t.readUInt8(r);if(t.isError(o))return o;n|=o}return n}var s=r(41),f=r(153),c=f.base,h=f.bignum,u=f.constants.der;t.exports=n,n.prototype.decode=function(t,e){return t instanceof c.DecoderBuffer||(t=new c.DecoderBuffer(t,e)),this.tree._decode(t,e)},s(i,c.Node),i.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;var n=t.save(),i=a(t,'Failed to peek tag: "'+e+'"');return t.isError(i)?i:(t.restore(n),i.tag===e||i.tagStr===e||i.tagStr+"of"===e||r)},i.prototype._decodeTag=function(t,e,r){var n=a(t,'Failed to decode tag of "'+e+'"');if(t.isError(n))return n;var i=o(t,n.primitive,'Failed to get length of "'+e+'"');if(t.isError(i))return i;if(!r&&n.tag!==e&&n.tagStr!==e&&n.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(n.primitive||null!==i)return t.skip(i,'Failed to match body of: "'+e+'"');var s=t.save(),f=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(f)?f:(i=t.offset-s.offset,t.restore(s),t.skip(i,'Failed to match body of: "'+e+'"'))},i.prototype._skipUntilEnd=function(t,e){for(;;){var r=a(t,e);if(t.isError(r))return r;var n=o(t,r.primitive,e);if(t.isError(n))return n;var i;if(i=r.primitive||null!==n?t.skip(n):this._skipUntilEnd(t,e),t.isError(i))return i;if("end"===r.tagStr)break}},i.prototype._decodeList=function(t,e,r,n){for(var i=[];!t.isEmpty();){var a=this._peekTag(t,"end");if(t.isError(a))return a;var o=r.decode(t,"der",n);if(t.isError(o)&&a)break;
|
35
|
-
i.push(o)}return i},i.prototype._decodeStr=function(t,e){if("bitstr"===e){var r=t.readUInt8();return t.isError(r)?r:{unused:r,data:t.raw()}}if("bmpstr"===e){var n=t.raw();if(n.length%2===1)return t.error("Decoding of string type: bmpstr length mismatch");for(var i="",a=0;a<n.length/2;a++)i+=String.fromCharCode(n.readUInt16BE(2*a));return i}if("numstr"===e){var o=t.raw().toString("ascii");return this._isNumstr(o)?o:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("printstr"===e){var s=t.raw().toString("ascii");return this._isPrintstr(s)?s:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},i.prototype._decodeObjid=function(t,e,r){for(var n,i=[],a=0;!t.isEmpty();){var o=t.readUInt8();a<<=7,a|=127&o,0===(128&o)&&(i.push(a),a=0)}128&o&&i.push(a);var s=i[0]/40|0,f=i[0]%40;if(n=r?i:[s,f].concat(i.slice(1)),e){var c=e[n.join(" ")];void 0===c&&(c=e[n.join(".")]),void 0!==c&&(n=c)}return n},i.prototype._decodeTime=function(t,e){var r=t.raw().toString();if("gentime"===e)var n=0|r.slice(0,4),i=0|r.slice(4,6),a=0|r.slice(6,8),o=0|r.slice(8,10),s=0|r.slice(10,12),f=0|r.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");var n=0|r.slice(0,2),i=0|r.slice(2,4),a=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),f=0|r.slice(10,12);n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,a,o,s,f,0)},i.prototype._decodeNull=function(t){return null},i.prototype._decodeBool=function(t){var e=t.readUInt8();return t.isError(e)?e:0!==e},i.prototype._decodeInt=function(t,e){var r=t.raw(),n=new h(r);return e&&(n=e[n.toString(10)]||n),n},i.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},function(t,e,r){function n(t){o.call(this,t),this.enc="pem"}var i=r(41),a=r(35).Buffer,o=r(164);i(n,o),t.exports=n,n.prototype.decode=function(t,e){for(var r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),i=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,f=-1,c=0;c<r.length;c++){var h=r[c].match(i);if(null!==h&&h[2]===n){if(s!==-1){if("END"!==h[1])break;f=c;break}if("BEGIN"!==h[1])break;s=c}}if(s===-1||f===-1)throw new Error("PEM section not found for: "+n);var u=r.slice(s+1,f).join("");u.replace(/[^a-z0-9\+\/=]+/gi,"");var d=new a(u,"base64");return o.prototype.decode.call(this,d,e)}},function(t,e,r){var n=e;n.der=r(167),n.pem=r(168)},function(t,e,r){function n(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new i,this.tree._init(t.body)}function i(t){h.Node.call(this,"der",t)}function a(t){return t<10?"0"+t:t}function o(t,e,r,n){var i;if("seqof"===t?t="seq":"setof"===t&&(t="set"),u.tagByName.hasOwnProperty(t))i=u.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=u.tagClassByName[r||"universal"]<<6)}var s=r(41),f=r(35).Buffer,c=r(153),h=c.base,u=c.constants.der;t.exports=n,n.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},s(i,h.Node),i.prototype._encodeComposite=function(t,e,r,n){var i=o(t,e,r,this.reporter);if(n.length<128){var a=new f(2);return a[0]=i,a[1]=n.length,this._createEncoderBuffer([a,n])}for(var s=1,c=n.length;c>=256;c>>=8)s++;var a=new f(2+s);a[0]=i,a[1]=128|s;for(var c=1+s,h=n.length;h>0;c--,h>>=8)a[c]=255&h;return this._createEncoderBuffer([a,n])},i.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=new f(2*t.length),n=0;n<t.length;n++)r.writeUInt16BE(t.charCodeAt(n),2*n);return this._createEncoderBuffer(r)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},i.prototype._encodeObjid=function(t,e,r){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s\.]+/g);for(var n=0;n<t.length;n++)t[n]|=0}else if(Array.isArray(t)){t=t.slice();for(var n=0;n<t.length;n++)t[n]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}for(var i=0,n=0;n<t.length;n++){var a=t[n];for(i++;a>=128;a>>=7)i++}for(var o=new f(i),s=o.length-1,n=t.length-1;n>=0;n--){var a=t[n];for(o[s--]=127&a;(a>>=7)>0;)o[s--]=128|127&a}return this._createEncoderBuffer(o)},i.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[a(n.getFullYear()),a(n.getUTCMonth()+1),a(n.getUTCDate()),a(n.getUTCHours()),a(n.getUTCMinutes()),a(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[a(n.getFullYear()%100),a(n.getUTCMonth()+1),a(n.getUTCDate()),a(n.getUTCHours()),a(n.getUTCMinutes()),a(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},i.prototype._encodeNull=function(){return this._createEncoderBuffer("")},i.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!f.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new f(r)}if(f.isBuffer(t)){var n=t.length;0===t.length&&n++;var i=new f(n);return t.copy(i),0===t.length&&(i[0]=0),this._createEncoderBuffer(i)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);for(var n=1,a=t;a>=256;a>>=8)n++;for(var i=new Array(n),a=i.length-1;a>=0;a--)i[a]=255&t,t>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(new f(i))},i.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},i.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},i.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i["default"])return!1;var a=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i["default"],e,r).join()),a.length!==i.defaultBuffer.length)return!1;for(n=0;n<a.length;n++)if(a[n]!==i.defaultBuffer[n])return!1;return!0}},function(t,e,r){function n(t){a.call(this,t),this.enc="pem"}var i=r(41),a=r(167);i(n,a),t.exports=n,n.prototype.encode=function(t,e){for(var r=a.prototype.encode.call(this,t),n=r.toString("base64"),i=["-----BEGIN "+e.label+"-----"],o=0;o<n.length;o+=64)i.push(n.slice(o,o+64));return i.push("-----END "+e.label+"-----"),i.join("\n")}},function(t,e){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},function(t,e,r){(function(e){var n=/Proc-Type: 4,ENCRYPTED\r?\nDEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\r?\n\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n/m,i=/^-----BEGIN (.*) KEY-----\r?\n/m,a=/^-----BEGIN (.*) KEY-----\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n-----END \1 KEY-----$/m,o=r(73),s=r(74);t.exports=function(t,r){var f,c=t.toString(),h=c.match(n);if(h){var u="aes"+h[1],d=new e(h[2],"hex"),l=new e(h[3].replace(/\r?\n/g,""),"base64"),p=o(r,d.slice(0,8),parseInt(h[1],10)).key,b=[],v=s.createDecipheriv(u,p,d);b.push(v.update(l)),b.push(v["final"]()),f=e.concat(b)}else{var y=c.match(a);f=new e(y[2].replace(/\r?\n/g,""),"base64")}var g=c.match(i)[1]+" KEY";return{tag:g,data:f}}}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(t,r,n,o){var s=c(n);if("ec"===s.type){if("ecdsa"!==o)throw new Error("wrong public key type");return i(t,r,s)}if("dsa"===s.type){if("dsa"!==o)throw new Error("wrong public key type");return a(t,r,s)}if("rsa"!==o)throw new Error("wrong public key type");for(var f=s.modulus.byteLength(),u=[1],d=0;r.length+u.length+2<f;)u.push(255),d++;u.push(0);for(var l=-1;++l<r.length;)u.push(r[l]);u=new e(u);var p=h.mont(s.modulus);t=new h(t).toRed(p),t=t.redPow(new h(s.publicExponent)),t=new e(t.fromRed().toArray());var b=0;for(d<8&&(b=1),f=Math.min(t.length,u.length),t.length!==u.length&&(b=1),l=-1;++l<f;)b|=t[l]^u[l];return 0===b}function i(t,e,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new u(n),a=r.data.subjectPrivateKey.data;return i.verify(e,t,a)}function a(t,e,r){var n=r.data.p,i=r.data.q,a=r.data.g,s=r.data.pub_key,f=c.signature.decode(t,"der"),u=f.s,d=f.r;o(u,i),o(d,i);var l=h.mont(n),p=u.invm(i),b=a.toRed(l).redPow(new h(e).mul(p).mod(i)).fromRed().mul(s.toRed(l).redPow(d.mul(p).mod(i)).fromRed()).mod(n).mod(i);return!b.cmp(d)}function o(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}var s=r(127),f=r(128),c=r(151),h=r(101),u=f.ec;t.exports=n}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(t){this.curveType=s[t],this.curveType||(this.curveType={name:t}),this.curve=new a.ec(this.curveType.name),this.keys=void 0}function i(t,r,n){Array.isArray(t)||(t=t.toArray());var i=new e(t);if(n&&i.length<n){var a=new e(n-i.length);a.fill(0),i=e.concat([a,i])}return r?i.toString(r):i}var a=r(128),o=r(101);t.exports=function(t){return new n(t)};var s={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};s.p224=s.secp224r1,s.p256=s.secp256r1=s.prime256v1,s.p192=s.secp192r1=s.prime192v1,s.p384=s.secp384r1,s.p521=s.secp521r1,n.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},n.prototype.computeSecret=function(t,r,n){r=r||"utf8",e.isBuffer(t)||(t=new e(t,r));var a=this.curve.keyFromPublic(t).getPublic(),o=a.mul(this.keys.getPrivate()).getX();return i(o,n,this.curveType.byteLength)},n.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(r[r.length-1]%2?r[0]=7:r[0]=6),i(r,t)},n.prototype.getPrivateKey=function(t){return i(this.keys.getPrivate(),t)},n.prototype.setPublicKey=function(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this.keys._importPublic(t),this},n.prototype.setPrivateKey=function(t,r){r=r||"utf8",e.isBuffer(t)||(t=new e(t,r));var n=new o(t);return n=n.toString(16),this.keys._importPrivate(n),this}}).call(e,r(35).Buffer)},function(t,e,r){e.publicEncrypt=r(174),e.privateDecrypt=r(178),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}},function(t,e,r){(function(e){function n(t,r){var n=t.modulus.byteLength(),i=r.length,a=f("sha1").update(new e("")).digest(),o=a.length,d=2*o;if(i>n-d-2)throw new Error("message too long");var l=new e(n-i-d-2);l.fill(0);var p=n-o-1,b=s(o),v=h(e.concat([a,l,new e([1]),r],p),c(b,p)),y=h(b,c(v,o));return new u(e.concat([new e([0]),y,v],n))}function i(t,r,n){var i=r.length,o=t.modulus.byteLength();if(i>o-11)throw new Error("message too long");var s;return n?(s=new e(o-i-3),s.fill(255)):s=a(o-i-3),new u(e.concat([new e([0,n?1:2]),s,new e([0]),r],o))}function a(t,r){for(var n,i=new e(t),a=0,o=s(2*t),f=0;a<t;)f===o.length&&(o=s(2*t),f=0),n=o[f++],n&&(i[a++]=n);return i}var o=r(151),s=r(34),f=r(40),c=r(175),h=r(176),u=r(101),d=r(177),l=r(126);t.exports=function(t,e,r){var a;a=t.padding?t.padding:r?1:4;var s,f=o(t);if(4===a)s=n(f,e);else if(1===a)s=i(f,e,r);else{if(3!==a)throw new Error("unknown padding");if(s=new u(e),s.cmp(f.modulus)>=0)throw new Error("data too long for modulus")}return r?l(s,f):d(s,f)}}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(t){var r=new e(4);return r.writeUInt32BE(t,0),r}var i=r(40);t.exports=function(t,r){for(var a,o=new e(""),s=0;o.length<r;)a=n(s++),o=e.concat([o,i("sha1").update(t).update(a).digest()]);return o.slice(0,r)}}).call(e,r(35).Buffer)},function(t,e){t.exports=function(t,e){for(var r=t.length,n=-1;++n<r;)t[n]^=e[n];return t}},function(t,e,r){(function(e){function n(t,r){return new e(t.toRed(i.mont(r.modulus)).redPow(new i(r.publicExponent)).fromRed().toArray())}var i=r(101);t.exports=n}).call(e,r(35).Buffer)},function(t,e,r){(function(e){function n(t,r){var n=(t.modulus,t.modulus.byteLength()),i=(r.length,u("sha1").update(new e("")).digest()),o=i.length;if(0!==r[0])throw new Error("decryption error");var c=r.slice(1,o+1),h=r.slice(o+1),d=f(c,s(h,o)),l=f(h,s(d,n-o-1));if(a(i,l.slice(0,o)))throw new Error("decryption error");for(var p=o;0===l[p];)p++;if(1!==l[p++])throw new Error("decryption error");return l.slice(p)}function i(t,e,r){for(var n=e.slice(0,2),i=2,a=0;0!==e[i++];)if(i>=e.length){a++;break}var o=e.slice(2,i-1);e.slice(i-1,i);if(("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&a++,o.length<8&&a++,a)throw new Error("decryption error");return e.slice(i)}function a(t,r){t=new e(t),r=new e(r);var n=0,i=t.length;t.length!==r.length&&(n++,i=Math.min(t.length,r.length));for(var a=-1;++a<i;)n+=t[a]^r[a];return n}var o=r(151),s=r(175),f=r(176),c=r(101),h=r(126),u=r(40),d=r(177);t.exports=function(t,r,a){var s;s=t.padding?t.padding:a?1:4;var f=o(t),u=f.modulus.byteLength();if(r.length>u||new c(r).cmp(f.modulus)>=0)throw new Error("decryption error");var l;l=a?d(new c(r),f):h(r,f);var p=new e(u-l.length);if(p.fill(0),l=e.concat([p,l],u),4===s)return n(f,l);if(1===s)return i(f,l,a);if(3===s)return l;throw new Error("unknown padding")}}).call(e,r(35).Buffer)},function(t,e){function r(t){return s.lastIndex=0,s.test(t)?'"'+t.replace(s,function(t){var e=f[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function n(t,e){var s,f,c,h,u,d=i,l=e[t];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(t)),"function"==typeof o&&(l=o.call(e,t,l)),typeof l){case"string":return r(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(i+=a,u=[],"[object Array]"===Object.prototype.toString.apply(l)){for(h=l.length,s=0;s<h;s+=1)u[s]=n(s,l)||"null";return c=0===u.length?"[]":i?"[\n"+i+u.join(",\n"+i)+"\n"+d+"]":"["+u.join(",")+"]",i=d,c}if(o&&"object"==typeof o)for(h=o.length,s=0;s<h;s+=1)"string"==typeof o[s]&&(f=o[s],c=n(f,l),c&&u.push(r(f)+(i?": ":":")+c));else{var p=Object.keys(l).sort();for(s in p)f=p[s],Object.prototype.hasOwnProperty.call(l,f)&&(c=n(f,l),c&&u.push(r(f)+(i?": ":":")+c))}return c=0===u.length?"{}":i?"{\n"+i+u.join(",\n"+i)+"\n"+d+"}":"{"+u.join(",")+"}",i=d,c}}var i,a,o,s=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c=function(t,e,r){var s;if(i="",a="","number"==typeof r)for(s=0;s<r;s+=1)a+=" ";else"string"==typeof r&&(a=r);if(o=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw new Error("JSON.stringify");return n("",{"":t})};t.exports=c},function(t,e,r){function n(){}function i(t){if(!y(t))return t;var e=[];for(var r in t)null!=t[r]&&a(e,r,t[r]);return e.join("&")}function a(t,e,r){if(Array.isArray(r))return r.forEach(function(r){a(t,e,r)});if(y(r))for(var n in r)a(t,e+"["+n+"]",r[n]);else t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))}function o(t){for(var e,r,n={},i=t.split("&"),a=0,o=i.length;a<o;++a)e=i[a],r=e.indexOf("="),r==-1?n[decodeURIComponent(e)]="":n[decodeURIComponent(e.slice(0,r))]=decodeURIComponent(e.slice(r+1));return n}function s(t){var e,r,n,i,a=t.split(/\r?\n/),o={};a.pop();for(var s=0,f=a.length;s<f;++s)r=a[s],e=r.indexOf(":"),n=r.slice(0,e).toLowerCase(),i=m(r.slice(e+1)),o[n]=i;return o}function f(t){return/[\/+]json\b/.test(t)}function c(t){return t.split(/ *; */).shift()}function h(t){return t.split(/ *; */).reduce(function(t,e){var r=e.split(/ *= */),n=r.shift(),i=r.shift();return n&&i&&(t[n]=i),t},{})}function u(t,e){e=e||{},this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this._setStatusProperties(this.xhr.status),this.header=this.headers=s(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this._parseBody(this.text?this.text:this.xhr.response):null}function d(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",function(){var t=null,e=null;try{e=new u(r)}catch(n){return t=new Error("Parser is unable to parse the response"),t.parse=!0,t.original=n,t.rawResponse=r.xhr&&r.xhr.responseText?r.xhr.responseText:null,t.statusCode=r.xhr&&r.xhr.status?r.xhr.status:null,r.callback(t)}r.emit("response",e);var i;try{(e.status<200||e.status>=300)&&(i=new Error(e.statusText||"Unsuccessful HTTP response"),i.original=t,i.response=e,i.status=e.status)}catch(n){i=n}i?r.callback(i,e):r.callback(null,e)})}function l(t,e){var r=g("DELETE",t);return e&&r.end(e),r}var p;"undefined"!=typeof window?p=window:"undefined"!=typeof self?p=self:(console.warn("Using browser-only version of superagent in non-browser environment"),p=this);var b=r(11),v=r(181),y=r(182),g=t.exports=r(183).bind(null,d);g.getXHR=function(){if(!(!p.XMLHttpRequest||p.location&&"file:"==p.location.protocol&&p.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw Error("Browser-only verison of superagent could not find XHR")};var m="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};g.serializeObject=i,g.parseString=o,g.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},g.serialize={"application/x-www-form-urlencoded":i,"application/json":JSON.stringify},g.parse={"application/x-www-form-urlencoded":o,"application/json":JSON.parse},u.prototype.get=function(t){return this.header[t.toLowerCase()]},u.prototype._setHeaderProperties=function(t){var e=this.header["content-type"]||"";this.type=c(e);var r=h(e);for(var n in r)this[n]=r[n]},u.prototype._parseBody=function(t){var e=g.parse[this.type];return!e&&f(this.type)&&(e=g.parse["application/json"]),e&&t&&(t.length||t instanceof Object)?e(t):null},u.prototype._setStatusProperties=function(t){1223===t&&(t=204);var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.notFound=404==t,this.forbidden=403==t},u.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot "+e+" "+r+" ("+this.status+")",i=new Error(n);return i.status=this.status,i.method=e,i.url=r,i},g.Response=u,b(d.prototype);for(var _ in v)d.prototype[_]=v[_];d.prototype.type=function(t){return this.set("Content-Type",g.types[t]||t),this},d.prototype.responseType=function(t){return this._responseType=t,this},d.prototype.accept=function(t){return this.set("Accept",g.types[t]||t),this},d.prototype.auth=function(t,e,r){switch(r||(r={type:"basic"}),r.type){case"basic":var n=btoa(t+":"+e);this.set("Authorization","Basic "+n);break;case"auto":this.username=t,this.password=e}return this},d.prototype.query=function(t){return"string"!=typeof t&&(t=i(t)),t&&this._query.push(t),this},d.prototype.attach=function(t,e,r){return this._getFormData().append(t,e,r||e.name),this},d.prototype._getFormData=function(){return this._formData||(this._formData=new p.FormData),this._formData},d.prototype.callback=function(t,e){var r=this._callback;this.clearTimeout(),r(t,e)},d.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},d.prototype._timeoutError=function(){var t=this._timeout,e=new Error("timeout of "+t+"ms exceeded");e.timeout=t,this.callback(e)},d.prototype._appendQueryString=function(){var t=this._query.join("&");t&&(this.url+=~this.url.indexOf("?")?"&"+t:"?"+t)},d.prototype.end=function(t){var e=this,r=this.xhr=g.getXHR(),i=this._timeout,a=this._formData||this._data;this._callback=t||n,r.onreadystatechange=function(){if(4==r.readyState){var t;try{t=r.status}catch(n){t=0}if(0==t){if(e.timedout)return e._timeoutError();if(e._aborted)return;return e.crossDomainError()}e.emit("end")}};var o=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),t.direction="download",e.emit("progress",t)};this.hasListeners("progress")&&(r.onprogress=o);try{r.upload&&this.hasListeners("progress")&&(r.upload.onprogress=o)}catch(s){}if(i&&!this._timer&&(this._timer=setTimeout(function(){e.timedout=!0,e.abort()},i)),this._appendQueryString(),this.username&&this.password?r.open(this.method,this.url,!0,this.username,this.password):r.open(this.method,this.url,!0),this._withCredentials&&(r.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof a&&!this._isHost(a)){var c=this._header["content-type"],h=this._serializer||g.serialize[c?c.split(";")[0]:""];!h&&f(c)&&(h=g.serialize["application/json"]),h&&(a=h(a))}for(var u in this.header)null!=this.header[u]&&r.setRequestHeader(u,this.header[u]);return this._responseType&&(r.responseType=this._responseType),this.emit("request",this),r.send("undefined"!=typeof a?a:null),this},g.Request=d,g.get=function(t,e,r){var n=g("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},g.head=function(t,e,r){var n=g("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},g.options=function(t,e,r){var n=g("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},g.del=l,g["delete"]=l,g.patch=function(t,e,r){var n=g("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},g.post=function(t,e,r){var n=g("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},g.put=function(t,e,r){var n=g("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},function(t,e,r){var n=r(182);e.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},e.parse=function(t){return this._parser=t,this},e.serialize=function(t){return this._serializer=t,this},e.timeout=function(t){return this._timeout=t,this},e.then=function(t,e){if(!this._fullfilledPromise){var r=this;this._fullfilledPromise=new Promise(function(t,e){r.end(function(r,n){r?e(r):t(n)})})}return this._fullfilledPromise.then(t,e)},e.use=function(t){return t(this),this},e.get=function(t){return this._header[t.toLowerCase()]},e.getHeader=e.get,e.set=function(t,e){if(n(t)){for(var r in t)this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},e.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},e.field=function(t,e){return this._getFormData().append(t,e),this},e.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},e.withCredentials=function(){return this._withCredentials=!0,this},e.redirects=function(t){return this._maxRedirects=t,this},e.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},e._isHost=function(t){var e={}.toString.call(t);switch(e){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}},e.send=function(t){var e=n(t),r=this._header["content-type"];if(e&&n(this._data))for(var i in t)this._data[i]=t[i];else"string"==typeof t?(r||this.type("form"),r=this._header["content-type"],"application/x-www-form-urlencoded"==r?this._data=this._data?this._data+"&"+t:t:this._data=(this._data||"")+t):this._data=t;return!e||this._isHost(t)?this:(r||this.type("json"),this)}},function(t,e){function r(t){return null!==t&&"object"==typeof t}t.exports=r},function(t,e){function r(t,e,r){return"function"==typeof r?new t("GET",e).end(r):2==arguments.length?new t("GET",e):new t(e,r)}t.exports=r},function(t,e,r){(function(t){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(e,r){if(r){var n=o["default"].createHash("sha256");return n.update(t.concat([new t(e,"hex"),new t(r,"hex")])).digest("hex")}return e}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var a=r(33),o=n(a)}).call(e,r(35).Buffer)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=r(3),s=r(5),f=n(s),c={top:10,right:5,bottom:20,left:5},h=350-c.top-c.bottom,u=400-c.left-c.right,d=function(){function t(e){i(this,t),this.tree=d3.tree().size([u,h]),this.svg=d3.select(e.find("svg")[0]).attr("width",u+c.right+c.left).attr("height",h+c.top+c.bottom),this.innerG=this.svg.append("g").attr("transform",function(){return(0,o.translate)(c.top,c.left)}),this.root=null}return a(t,[{key:"display",value:function(t){t&&t.length?(this.root=this._parse(t),this._update(this.root.descendants(),this.root.links())):(this.root=null,this._update([],[]))}},{key:"_parse",value:function(t){var e=[];t.forEach(function(t,r){e.push({id:t.left+"-"+r,name:t.left,parentId:t.parent+"-"+(r+1)}),t.right&&e.push({id:t.right+"-"+r,name:t.right,parentId:t.parent+"-"+(r+1)})});var r=t[t.length-1].parent;return e.push({id:r+"-"+t.length,name:r}),d3.stratify()(e)}},{key:"_update",value:function(t,e){this.root&&this.tree(this.root);var r=this.innerG.selectAll("g.node").data(t,function(t){return t?t.id:this.id}),n=r.enter().append("g").attr("class","node").attr("transform",function(t){return(0,o.translate)(t.y,t.x)});n.append("circle").attr("r",10),n.append("text").attr("dx",0).attr("dy",5).attr("text-anchor","middle").text(function(t){return(0,f["default"])(t.data.name)}),n.on("mouseover",function(t){d3.select(this).select("text").text(t.data.name)}).on("mouseout",function(t){d3.select(this).select("text").text((0,f["default"])(t.data.name))}),r.exit().remove();var i=this.innerG.selectAll("path.link").data(e,function(t){return t?t.target.id:this.id});i.enter().insert("path","g").attr("class","link").attr("id",function(t){return t.target.id}).attr("d",function(t){return(0,o.makeLink)({x:t.source.y,y:t.source.x},{x:t.target.y,y:t.target.x})}),i.exit().remove()}}]),t}();e["default"]=d}])});
|